From: Andrea Amorese
Date: Fri, 10 Sep 2021 12:04:09 +0000 (+0200)
Subject: Built motion from commit fb0188bc.|2.5.34
X-Git-Url: http://repos.xcallymotion.com/base//%22angular-material.themes.css/%22?a=commitdiff_plain;h=b476a5d2f436b2b8280ab793f64b79221280ef80;p=motion2.git
Built motion from commit fb0188bc.|2.5.34
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 8542fcf..f012e98 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-09-10T08:59:14.535Z",
+ "time": "2021-09-10T11:50:18.270Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 20dd3fe..c42a2e9 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-09-10T08:59:14.535Z",
+ "time": "2021-09-10T11:50:18.270Z",
"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 3164653..d2c464b 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 _0x7a54=['jscripty','urlForward','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','STRING','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','contactManager','integration','motionbar'];(function(_0x3b6b06,_0x5db84b){var _0xdb9708=function(_0x28c3b7){while(--_0x28c3b7){_0x3b6b06['push'](_0x3b6b06['shift']());}};_0xdb9708(++_0x5db84b);}(_0x7a54,0x106));var _0x47a5=function(_0x2a7e69,_0x1361fe){_0x2a7e69=_0x2a7e69-0x0;var _0x44c9b8=_0x7a54[_0x2a7e69];return _0x44c9b8;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'name':{'type':Sequelize[_0x47a5('0x2')],'get':function(_0x58157c){return this[_0x47a5('0x3')](_0x47a5('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x47a5('0x5'),_0x47a5('0x6'),_0x47a5('0x7'),_0x47a5('0x8'),_0x47a5('0x9'),'browser',_0x47a5('0xa'),'script']],'msg':_0x47a5('0xb')}},'comment':_0x47a5('0xb')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x47a5('0xc')},'data2':{'type':Sequelize['STRING'](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':_0x47a5('0xd')},'data4':{'type':Sequelize[_0x47a5('0xe')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x47a5('0xe')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth]'},'data6':{'type':Sequelize['STRING'],'comments':_0x47a5('0xf')},'data7':{'type':Sequelize[_0x47a5('0x10')],'comments':_0x47a5('0x11')}};
\ No newline at end of file
+var _0x5334=['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]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','STRING','integration','motionbar','bot'];(function(_0xd5c88,_0x508cda){var _0xa786d0=function(_0x4d1ffc){while(--_0x4d1ffc){_0xd5c88['push'](_0xd5c88['shift']());}};_0xa786d0(++_0x508cda);}(_0x5334,0x84));var _0x4533=function(_0x3ca4c1,_0x404c12){_0x3ca4c1=_0x3ca4c1-0x0;var _0x566ab5=_0x5334[_0x3ca4c1];return _0x566ab5;};'use strict';var Sequelize=require(_0x4533('0x0'));module[_0x4533('0x1')]={'name':{'type':Sequelize[_0x4533('0x2')],'get':function(_0x35fb80){return this[_0x4533('0x3')]('action');}},'action':{'type':Sequelize[_0x4533('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x4533('0x5'),_0x4533('0x6'),'jscripty','urlForward','browser',_0x4533('0x7'),'script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x4533('0x4')](0x1000),'comment':_0x4533('0x8')},'data2':{'type':Sequelize[_0x4533('0x4')](0x1000),'comment':_0x4533('0x9')},'data3':{'type':Sequelize[_0x4533('0x4')](0x1000),'comment':_0x4533('0xa')},'data4':{'type':Sequelize[_0x4533('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x4533('0x4')](0x1000),'comments':_0x4533('0xb')},'data6':{'type':Sequelize[_0x4533('0x4')],'comments':_0x4533('0xc')},'data7':{'type':Sequelize['TEXT'],'comments':_0x4533('0xd')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index ab31149..3cb79de 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 _0x1b78=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send','body','Action','find','catch','destroy','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js'];(function(_0x4f4c2a,_0x5f5a28){var _0xd15be6=function(_0x1bc725){while(--_0x1bc725){_0x4f4c2a['push'](_0x4f4c2a['shift']());}};_0xd15be6(++_0x5f5a28);}(_0x1b78,0x1bc));var _0x81b7=function(_0xb44fb1,_0x52d6be){_0xb44fb1=_0xb44fb1-0x0;var _0x242522=_0x1b78[_0xb44fb1];return _0x242522;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x81b7('0x0'));var zipdir=require(_0x81b7('0x1'));var jsonpatch=require(_0x81b7('0x2'));var rp=require(_0x81b7('0x3'));var moment=require(_0x81b7('0x4'));var BPromise=require(_0x81b7('0x5'));var Mustache=require(_0x81b7('0x6'));var util=require('util');var path=require(_0x81b7('0x7'));var sox=require(_0x81b7('0x8'));var csv=require('to-csv');var ejs=require(_0x81b7('0x9'));var fs=require('fs');var fs_extra=require(_0x81b7('0xa'));var _=require(_0x81b7('0xb'));var squel=require(_0x81b7('0xc'));var crypto=require(_0x81b7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x81b7('0xe'));var toCsv=require('to-csv');var querystring=require(_0x81b7('0xf'));var Papa=require(_0x81b7('0x10'));var Redis=require(_0x81b7('0x11'));var authService=require(_0x81b7('0x12'));var qs=require(_0x81b7('0x13'));var as=require(_0x81b7('0x14'));var hardwareService=require(_0x81b7('0x15'));var logger=require(_0x81b7('0x16'))(_0x81b7('0x17'));var utils=require(_0x81b7('0x18'));var config=require(_0x81b7('0x19'));var licenseUtil=require(_0x81b7('0x1a'));var db=require(_0x81b7('0x1b'))['db'];function respondWithStatusCode(_0x56ac87,_0x4968b6){_0x4968b6=_0x4968b6||0xcc;return function(_0x14ec1e){if(_0x14ec1e){return _0x56ac87['sendStatus'](_0x4968b6);}return _0x56ac87[_0x81b7('0x1c')](_0x4968b6)[_0x81b7('0x1d')]();};}function respondWithResult(_0x39cd88,_0x35f72f){_0x35f72f=_0x35f72f||0xc8;return function(_0x5a5cc1){if(_0x5a5cc1){return _0x39cd88[_0x81b7('0x1c')](_0x35f72f)[_0x81b7('0x1e')](_0x5a5cc1);}};}function respondWithFilteredResult(_0x563619,_0x360947){return function(_0x7d9b0){if(_0x7d9b0){var _0x41a809=typeof _0x360947[_0x81b7('0x1f')]===_0x81b7('0x20')&&typeof _0x360947[_0x81b7('0x21')]===_0x81b7('0x20');var _0x52b927=_0x7d9b0[_0x81b7('0x22')];var _0x2b3305=_0x41a809?0x0:_0x360947[_0x81b7('0x1f')];var _0x5f5a32=_0x41a809?_0x7d9b0[_0x81b7('0x22')]:_0x360947[_0x81b7('0x1f')]+_0x360947[_0x81b7('0x21')];var _0x5a960a;if(_0x5f5a32>=_0x52b927){_0x5f5a32=_0x52b927;_0x5a960a=0xc8;}else{_0x5a960a=0xce;}_0x563619['status'](_0x5a960a);return _0x563619['set'](_0x81b7('0x23'),_0x2b3305+'-'+_0x5f5a32+'/'+_0x52b927)[_0x81b7('0x1e')](_0x7d9b0);}return null;};}function patchUpdates(_0x5c7e93){return function(_0x1a11a0){try{jsonpatch[_0x81b7('0x24')](_0x1a11a0,_0x5c7e93,!![]);}catch(_0x24e3fc){return BPromise[_0x81b7('0x25')](_0x24e3fc);}return _0x1a11a0[_0x81b7('0x26')]();};}function saveUpdates(_0x4dfe82,_0x5f3d11){return function(_0x305a8a){if(_0x305a8a){return _0x305a8a[_0x81b7('0x27')](_0x4dfe82)[_0x81b7('0x28')](function(_0x270891){return _0x270891;});}return null;};}function removeEntity(_0x432c38,_0x2114fe){return function(_0x37b086){if(_0x37b086){return _0x37b086['destroy']()[_0x81b7('0x28')](function(){_0x432c38[_0x81b7('0x1c')](0xcc)[_0x81b7('0x1d')]();});}};}function handleEntityNotFound(_0x1b20c1,_0x580ce8){return function(_0x3df7e7){if(!_0x3df7e7){_0x1b20c1[_0x81b7('0x29')](0x194);}return _0x3df7e7;};}function handleError(_0x2ebf33,_0x1edb0b){_0x1edb0b=_0x1edb0b||0x1f4;return function(_0x2b718e){logger['error'](_0x2b718e[_0x81b7('0x2a')]);if(_0x2b718e['name']){delete _0x2b718e[_0x81b7('0x2b')];}_0x2ebf33[_0x81b7('0x1c')](_0x1edb0b)[_0x81b7('0x2c')](_0x2b718e);};}exports[_0x81b7('0x27')]=function(_0xf7ae9c,_0x264f50){if(_0xf7ae9c[_0x81b7('0x2d')]['id']){delete _0xf7ae9c[_0x81b7('0x2d')]['id'];}return db[_0x81b7('0x2e')][_0x81b7('0x2f')]({'where':{'id':_0xf7ae9c['params']['id']}})[_0x81b7('0x28')](handleEntityNotFound(_0x264f50,null))[_0x81b7('0x28')](saveUpdates(_0xf7ae9c[_0x81b7('0x2d')],null))[_0x81b7('0x28')](respondWithResult(_0x264f50,null))[_0x81b7('0x30')](handleError(_0x264f50,null));};exports[_0x81b7('0x31')]=function(_0x5b55ea,_0x112733){return db[_0x81b7('0x2e')][_0x81b7('0x2f')]({'where':{'id':_0x5b55ea[_0x81b7('0x32')]['id']}})[_0x81b7('0x28')](handleEntityNotFound(_0x112733,null))['then'](removeEntity(_0x112733,null))['catch'](handleError(_0x112733,null));};
\ No newline at end of file
+var _0x4cf2=['stack','name','send','Action','params','body','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','end','error'];(function(_0x29db36,_0x410ae9){var _0x234e87=function(_0x48697b){while(--_0x48697b){_0x29db36['push'](_0x29db36['shift']());}};_0x234e87(++_0x410ae9);}(_0x4cf2,0xcc));var _0x24cf=function(_0x4314d7,_0x355218){_0x4314d7=_0x4314d7-0x0;var _0x5c599b=_0x4cf2[_0x4314d7];return _0x5c599b;};'use strict';var emlformat=require(_0x24cf('0x0'));var rimraf=require(_0x24cf('0x1'));var zipdir=require(_0x24cf('0x2'));var jsonpatch=require(_0x24cf('0x3'));var rp=require(_0x24cf('0x4'));var moment=require('moment');var BPromise=require(_0x24cf('0x5'));var Mustache=require(_0x24cf('0x6'));var util=require(_0x24cf('0x7'));var path=require('path');var sox=require(_0x24cf('0x8'));var csv=require(_0x24cf('0x9'));var ejs=require(_0x24cf('0xa'));var fs=require('fs');var fs_extra=require(_0x24cf('0xb'));var _=require(_0x24cf('0xc'));var squel=require(_0x24cf('0xd'));var crypto=require(_0x24cf('0xe'));var jsforce=require(_0x24cf('0xf'));var deskjs=require(_0x24cf('0x10'));var toCsv=require(_0x24cf('0x9'));var querystring=require('querystring');var Papa=require(_0x24cf('0x11'));var Redis=require(_0x24cf('0x12'));var authService=require(_0x24cf('0x13'));var qs=require(_0x24cf('0x14'));var as=require(_0x24cf('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x24cf('0x16'))(_0x24cf('0x17'));var utils=require(_0x24cf('0x18'));var config=require(_0x24cf('0x19'));var licenseUtil=require(_0x24cf('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ab8bd,_0x4b3e04){_0x4b3e04=_0x4b3e04||0xcc;return function(_0x48df55){if(_0x48df55){return _0x1ab8bd[_0x24cf('0x1b')](_0x4b3e04);}return _0x1ab8bd[_0x24cf('0x1c')](_0x4b3e04)['end']();};}function respondWithResult(_0x4c7512,_0x47d175){_0x47d175=_0x47d175||0xc8;return function(_0x2203aa){if(_0x2203aa){return _0x4c7512[_0x24cf('0x1c')](_0x47d175)['json'](_0x2203aa);}};}function respondWithFilteredResult(_0x4c270a,_0x5daa9c){return function(_0x1ebe44){if(_0x1ebe44){var _0x38c198=typeof _0x5daa9c['offset']===_0x24cf('0x1d')&&typeof _0x5daa9c[_0x24cf('0x1e')]===_0x24cf('0x1d');var _0x3718e9=_0x1ebe44[_0x24cf('0x1f')];var _0x2f3335=_0x38c198?0x0:_0x5daa9c[_0x24cf('0x20')];var _0x32274e=_0x38c198?_0x1ebe44[_0x24cf('0x1f')]:_0x5daa9c[_0x24cf('0x20')]+_0x5daa9c[_0x24cf('0x1e')];var _0x3466ea;if(_0x32274e>=_0x3718e9){_0x32274e=_0x3718e9;_0x3466ea=0xc8;}else{_0x3466ea=0xce;}_0x4c270a[_0x24cf('0x1c')](_0x3466ea);return _0x4c270a[_0x24cf('0x21')](_0x24cf('0x22'),_0x2f3335+'-'+_0x32274e+'/'+_0x3718e9)['json'](_0x1ebe44);}return null;};}function patchUpdates(_0xf896fb){return function(_0x159255){try{jsonpatch[_0x24cf('0x23')](_0x159255,_0xf896fb,!![]);}catch(_0x37ebb1){return BPromise['reject'](_0x37ebb1);}return _0x159255['save']();};}function saveUpdates(_0x1579b6,_0x2e0927){return function(_0x5ee3e2){if(_0x5ee3e2){return _0x5ee3e2[_0x24cf('0x24')](_0x1579b6)[_0x24cf('0x25')](function(_0x194a3f){return _0x194a3f;});}return null;};}function removeEntity(_0x93c49b,_0x119f5e){return function(_0x2d81fa){if(_0x2d81fa){return _0x2d81fa[_0x24cf('0x26')]()['then'](function(){_0x93c49b[_0x24cf('0x1c')](0xcc)[_0x24cf('0x27')]();});}};}function handleEntityNotFound(_0x280d8d,_0xdfef90){return function(_0x5e3ddb){if(!_0x5e3ddb){_0x280d8d[_0x24cf('0x1b')](0x194);}return _0x5e3ddb;};}function handleError(_0x304241,_0x48450f){_0x48450f=_0x48450f||0x1f4;return function(_0x3ffbda){logger[_0x24cf('0x28')](_0x3ffbda[_0x24cf('0x29')]);if(_0x3ffbda[_0x24cf('0x2a')]){delete _0x3ffbda[_0x24cf('0x2a')];}_0x304241[_0x24cf('0x1c')](_0x48450f)[_0x24cf('0x2b')](_0x3ffbda);};}exports[_0x24cf('0x24')]=function(_0x4c3e78,_0x16a748){if(_0x4c3e78['body']['id']){delete _0x4c3e78['body']['id'];}return db[_0x24cf('0x2c')]['find']({'where':{'id':_0x4c3e78[_0x24cf('0x2d')]['id']}})['then'](handleEntityNotFound(_0x16a748,null))[_0x24cf('0x25')](saveUpdates(_0x4c3e78[_0x24cf('0x2e')],null))[_0x24cf('0x25')](respondWithResult(_0x16a748,null))[_0x24cf('0x2f')](handleError(_0x16a748,null));};exports[_0x24cf('0x26')]=function(_0x2210d0,_0x5d8f27){return db[_0x24cf('0x2c')][_0x24cf('0x30')]({'where':{'id':_0x2210d0['params']['id']}})[_0x24cf('0x25')](handleEntityNotFound(_0x5d8f27,null))[_0x24cf('0x25')](removeEntity(_0x5d8f27,null))[_0x24cf('0x2f')](handleError(_0x5d8f27,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 5aba98a..b091f6d 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 _0xc9ca=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc9ca,0x116));var _0xac9c=function(_0x57cb4f,_0x541f57){_0x57cb4f=_0x57cb4f-0x0;var _0x29bb45=_0xc9ca[_0x57cb4f];return _0x29bb45;};'use strict';var _=require(_0xac9c('0x0'));var util=require(_0xac9c('0x1'));var logger=require(_0xac9c('0x2'))(_0xac9c('0x3'));var moment=require('moment');var BPromise=require(_0xac9c('0x4'));var rp=require(_0xac9c('0x5'));var fs=require('fs');var path=require(_0xac9c('0x6'));var rimraf=require(_0xac9c('0x7'));var config=require(_0xac9c('0x8'));var attributes=require(_0xac9c('0x9'));module[_0xac9c('0xa')]=function(_0x1fcf4e,_0x2255d7){return _0x1fcf4e[_0xac9c('0xb')](_0xac9c('0xc'),attributes,{'tableName':_0xac9c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcbf3=['exports','tools_actions','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x379daf,_0x57135f){var _0x438198=function(_0x32a69e){while(--_0x32a69e){_0x379daf['push'](_0x379daf['shift']());}};_0x438198(++_0x57135f);}(_0xcbf3,0xf2));var _0x3cbf=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xcbf3[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x3cbf('0x0'));var util=require(_0x3cbf('0x1'));var logger=require(_0x3cbf('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3cbf('0x3'));var rp=require(_0x3cbf('0x4'));var fs=require('fs');var path=require(_0x3cbf('0x5'));var rimraf=require(_0x3cbf('0x6'));var config=require(_0x3cbf('0x7'));var attributes=require('./action.attributes');module[_0x3cbf('0x8')]=function(_0x12d916,_0x32505e){return _0x12d916['define']('Action',attributes,{'tableName':_0x3cbf('0x9'),'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 a34a5c5..f1d238f 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x59a7ed,_0x2cf6a2){var _0x53bd62=function(_0x52823b){while(--_0x52823b){_0x59a7ed['push'](_0x59a7ed['shift']());}};_0x53bd62(++_0x2cf6a2);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xc4aa[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ 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(_0x42c916,_0x456eed){var _0x54f7e9=function(_0x23e4bf){while(--_0x23e4bf){_0x42c916['push'](_0x42c916['shift']());}};_0x54f7e9(++_0x456eed);}(_0xabce,0x103));var _0xeabc=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xabce[_0x15bc81];return _0x59440e;};'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 6516181..67e38bf 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 _0x8705=['multer','path','connect-timeout','express','fs-extra','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','destroy'];(function(_0x425ecd,_0x1e1bed){var _0xddc406=function(_0x179638){while(--_0x179638){_0x425ecd['push'](_0x425ecd['shift']());}};_0xddc406(++_0x1e1bed);}(_0x8705,0x15c));var _0x5870=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8705[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x5870('0x0'));var util=require('util');var path=require(_0x5870('0x1'));var timeout=require(_0x5870('0x2'));var express=require(_0x5870('0x3'));var router=express['Router']();var fs_extra=require(_0x5870('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5870('0x5'));var controller=require(_0x5870('0x6'));router[_0x5870('0x7')](_0x5870('0x8'),auth[_0x5870('0x9')](),controller[_0x5870('0xa')]);router['delete'](_0x5870('0x8'),auth[_0x5870('0x9')](),controller[_0x5870('0xb')]);module['exports']=router;
\ No newline at end of file
+var _0xfa4c=['./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0xfa4c,0x108));var _0xcfa4=function(_0x14dbf5,_0x2ec47f){_0x14dbf5=_0x14dbf5-0x0;var _0x161348=_0xfa4c[_0x14dbf5];return _0x161348;};'use strict';var multer=require(_0xcfa4('0x0'));var util=require(_0xcfa4('0x1'));var path=require(_0xcfa4('0x2'));var timeout=require(_0xcfa4('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xcfa4('0x4'));var auth=require(_0xcfa4('0x5'));var interaction=require(_0xcfa4('0x6'));var config=require(_0xcfa4('0x7'));var controller=require(_0xcfa4('0x8'));router[_0xcfa4('0x9')](_0xcfa4('0xa'),auth[_0xcfa4('0xb')](),controller[_0xcfa4('0xc')]);router[_0xcfa4('0xd')](_0xcfa4('0xa'),auth[_0xcfa4('0xb')](),controller[_0xcfa4('0xe')]);module[_0xcfa4('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 94e01c6..7d9c1b8 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 _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x57b38f,_0xc26f33){var _0x6aa12c=function(_0x32850d){while(--_0x32850d){_0x57b38f['push'](_0x57b38f['shift']());}};_0x6aa12c(++_0xc26f33);}(_0x5fab,0x177));var _0xb5fa=function(_0x5224b9,_0x195fcb){_0x5224b9=_0x5224b9-0x0;var _0x363bcc=_0x5fab[_0x5224b9];return _0x363bcc;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}};
\ No newline at end of file
+var _0x3eea=['STRING','TEXT','sequelize'];(function(_0x3330c,_0x3bd322){var _0x345555=function(_0x599928){while(--_0x599928){_0x3330c['push'](_0x3330c['shift']());}};_0x345555(++_0x3bd322);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x2a83b1,_0x12ba87){_0x2a83b1=_0x2a83b1-0x0;var _0x4d17b5=_0x3eea[_0x2a83b1];return _0x4d17b5;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index b875966..1a881b9 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 _0x1569=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','json','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','where','pick','filter','VIRTUAL','merge','includeAll','include','rows','show','params','keys','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','function','format','replace','groupBy','orderBy','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','toString','sequelize','cross_join','GROUP_CONCAT(%s)','HOUR(%s)','keyBy','from','DESC','alias','clone','output','web','fullPath','%s-%s.%s','randomstring','custom','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../files/reports','countTable','SELECT','QueryTypes','run','runReport','COUNT(%s)','IS\x20NOT\x20EMPTY','findAll','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','desk.js','querystring','../../config/utils'];(function(_0x1726e1,_0x1cc1f4){var _0x44eccc=function(_0x29d671){while(--_0x29d671){_0x1726e1['push'](_0x1726e1['shift']());}};_0x44eccc(++_0x1cc1f4);}(_0x1569,0x1bf));var _0x9156=function(_0x4db198,_0x3ea6c2){_0x4db198=_0x4db198-0x0;var _0xedceb9=_0x1569[_0x4db198];return _0xedceb9;};'use strict';var emlformat=require(_0x9156('0x0'));var rimraf=require(_0x9156('0x1'));var zipdir=require(_0x9156('0x2'));var jsonpatch=require(_0x9156('0x3'));var rp=require('request-promise');var moment=require(_0x9156('0x4'));var BPromise=require(_0x9156('0x5'));var Mustache=require(_0x9156('0x6'));var util=require('util');var path=require(_0x9156('0x7'));var sox=require(_0x9156('0x8'));var csv=require(_0x9156('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9156('0xa'));var squel=require('squel');var crypto=require(_0x9156('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9156('0xc'));var toCsv=require(_0x9156('0x9'));var querystring=require(_0x9156('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x9156('0xe'));var config=require(_0x9156('0xf'));var licenseUtil=require(_0x9156('0x10'));var db=require(_0x9156('0x11'))['db'];var dbH=require(_0x9156('0x11'))['dbH'];function respondWithStatusCode(_0x2fb563,_0xc1ee7){_0xc1ee7=_0xc1ee7||0xcc;return function(_0x1f80f2){if(_0x1f80f2){return _0x2fb563[_0x9156('0x12')](_0xc1ee7);}return _0x2fb563['status'](_0xc1ee7)[_0x9156('0x13')]();};}function respondWithResult(_0x31478a,_0x4efbf3){_0x4efbf3=_0x4efbf3||0xc8;return function(_0x3285a1){if(_0x3285a1){return _0x31478a[_0x9156('0x14')](_0x4efbf3)['json'](_0x3285a1);}};}function respondWithFilteredResult(_0x35f293,_0x4d4490){return function(_0x3d1f41){if(_0x3d1f41){var _0x57b038=typeof _0x4d4490[_0x9156('0x15')]===_0x9156('0x16')&&typeof _0x4d4490[_0x9156('0x17')]===_0x9156('0x16');var _0x3c190b=_0x3d1f41[_0x9156('0x18')];var _0x5a80f6=_0x57b038?0x0:_0x4d4490[_0x9156('0x15')];var _0x358752=_0x57b038?_0x3d1f41[_0x9156('0x18')]:_0x4d4490[_0x9156('0x15')]+_0x4d4490[_0x9156('0x17')];var _0x334ec0;if(_0x358752>=_0x3c190b){_0x358752=_0x3c190b;_0x334ec0=0xc8;}else{_0x334ec0=0xce;}_0x35f293[_0x9156('0x14')](_0x334ec0);return _0x35f293['set']('Content-Range',_0x5a80f6+'-'+_0x358752+'/'+_0x3c190b)[_0x9156('0x19')](_0x3d1f41);}return null;};}function patchUpdates(_0x3d66e9){return function(_0x496c8c){try{jsonpatch['apply'](_0x496c8c,_0x3d66e9,!![]);}catch(_0x1cb50d){return BPromise[_0x9156('0x1a')](_0x1cb50d);}return _0x496c8c[_0x9156('0x1b')]();};}function saveUpdates(_0x2b8d20,_0x5cdf84){return function(_0x4f04e7){if(_0x4f04e7){return _0x4f04e7[_0x9156('0x1c')](_0x2b8d20)[_0x9156('0x1d')](function(_0x3ce9c3){return _0x3ce9c3;});}return null;};}function removeEntity(_0x33440a,_0x3b89f9){return function(_0x3c38f8){if(_0x3c38f8){return _0x3c38f8['destroy']()['then'](function(){var _0x53aa15=_0x3c38f8[_0x9156('0x1e')]({'plain':!![]});var _0x2faa60='CustomReports';return db[_0x9156('0x1f')][_0x9156('0x20')]({'where':{'type':_0x2faa60,'resourceId':_0x53aa15['id']}})[_0x9156('0x1d')](function(){return _0x3c38f8;});})[_0x9156('0x1d')](function(){_0x33440a['status'](0xcc)[_0x9156('0x13')]();});}};}function handleEntityNotFound(_0x3f183c,_0x3b38a2){return function(_0x1a0c07){if(!_0x1a0c07){_0x3f183c[_0x9156('0x12')](0x194);}return _0x1a0c07;};}function handleError(_0x34e02f,_0x3439a2){_0x3439a2=_0x3439a2||0x1f4;return function(_0x560006){logger[_0x9156('0x21')](_0x560006[_0x9156('0x22')]);if(_0x560006[_0x9156('0x23')]){delete _0x560006[_0x9156('0x23')];}_0x34e02f[_0x9156('0x14')](_0x3439a2)[_0x9156('0x24')](_0x560006);};}exports[_0x9156('0x25')]=function(_0x1b656e,_0x45d39c){var _0x5b2980={},_0x4a12af={},_0x1b5525={'count':0x0,'rows':[]};var _0x5850cd=_[_0x9156('0x26')](db[_0x9156('0x27')][_0x9156('0x28')],function(_0x2b2ee7){return{'name':_0x2b2ee7[_0x9156('0x29')],'type':_0x2b2ee7[_0x9156('0x2a')][_0x9156('0x2b')]};});_0x4a12af[_0x9156('0x2c')]=_['map'](_0x5850cd,_0x9156('0x23'));_0x4a12af['query']=_['keys'](_0x1b656e['query']);_0x4a12af[_0x9156('0x2d')]=_[_0x9156('0x2e')](_0x4a12af['model'],_0x4a12af[_0x9156('0x2f')]);_0x5b2980[_0x9156('0x30')]=_[_0x9156('0x2e')](_0x4a12af[_0x9156('0x2c')],qs[_0x9156('0x31')](_0x1b656e[_0x9156('0x2f')]['fields']));_0x5b2980[_0x9156('0x30')]=_0x5b2980[_0x9156('0x30')][_0x9156('0x32')]?_0x5b2980[_0x9156('0x30')]:_0x4a12af[_0x9156('0x2c')];if(!_0x1b656e[_0x9156('0x2f')][_0x9156('0x33')]('nolimit')){_0x5b2980[_0x9156('0x17')]=qs[_0x9156('0x17')](_0x1b656e[_0x9156('0x2f')][_0x9156('0x17')]);_0x5b2980['offset']=qs[_0x9156('0x15')](_0x1b656e[_0x9156('0x2f')][_0x9156('0x15')]);}_0x5b2980[_0x9156('0x34')]=qs['sort'](_0x1b656e[_0x9156('0x2f')]['sort']);_0x5b2980[_0x9156('0x35')]=qs[_0x9156('0x2d')](_[_0x9156('0x36')](_0x1b656e[_0x9156('0x2f')],_0x4a12af[_0x9156('0x2d')]),_0x5850cd);if(_0x1b656e[_0x9156('0x2f')][_0x9156('0x37')]){_0x5b2980[_0x9156('0x35')]=_['merge'](_0x5b2980[_0x9156('0x35')],{'$or':_[_0x9156('0x26')](_0x5850cd,function(_0x262eb2){if(_0x262eb2[_0x9156('0x2a')]!==_0x9156('0x38')){var _0x2140af={};_0x2140af[_0x262eb2[_0x9156('0x23')]]={'$like':'%'+_0x1b656e[_0x9156('0x2f')]['filter']+'%'};return _0x2140af;}})});}_0x5b2980=_[_0x9156('0x39')]({},_0x5b2980,_0x1b656e['options']);var _0x4cc9bf={'where':_0x5b2980[_0x9156('0x35')]};return db[_0x9156('0x27')][_0x9156('0x18')](_0x4cc9bf)[_0x9156('0x1d')](function(_0x5b30b5){_0x1b5525[_0x9156('0x18')]=_0x5b30b5;if(_0x1b656e[_0x9156('0x2f')][_0x9156('0x3a')]){_0x5b2980[_0x9156('0x3b')]=[{'all':!![]}];}return db[_0x9156('0x27')]['findAll'](_0x5b2980);})[_0x9156('0x1d')](function(_0x223b26){_0x1b5525[_0x9156('0x3c')]=_0x223b26;return _0x1b5525;})[_0x9156('0x1d')](respondWithFilteredResult(_0x45d39c,_0x5b2980))['catch'](handleError(_0x45d39c,null));};exports[_0x9156('0x3d')]=function(_0x1c5880,_0x308b3a){var _0x2c9639={'raw':![],'where':{'id':_0x1c5880[_0x9156('0x3e')]['id']}},_0x3d9997={};_0x3d9997[_0x9156('0x2c')]=_['keys'](db[_0x9156('0x27')][_0x9156('0x28')]);_0x3d9997[_0x9156('0x2f')]=_[_0x9156('0x3f')](_0x1c5880[_0x9156('0x2f')]);_0x3d9997[_0x9156('0x2d')]=_['intersection'](_0x3d9997[_0x9156('0x2c')],_0x3d9997[_0x9156('0x2f')]);_0x2c9639['attributes']=_[_0x9156('0x2e')](_0x3d9997[_0x9156('0x2c')],qs['fields'](_0x1c5880[_0x9156('0x2f')][_0x9156('0x31')]));_0x2c9639[_0x9156('0x30')]=_0x2c9639[_0x9156('0x30')][_0x9156('0x32')]?_0x2c9639[_0x9156('0x30')]:_0x3d9997[_0x9156('0x2c')];if(_0x1c5880['query'][_0x9156('0x3a')]){_0x2c9639[_0x9156('0x3b')]=[{'all':!![]}];}_0x2c9639=_[_0x9156('0x39')]({},_0x2c9639,_0x1c5880[_0x9156('0x40')]);return db[_0x9156('0x27')][_0x9156('0x41')](_0x2c9639)[_0x9156('0x1d')](handleEntityNotFound(_0x308b3a,null))['then'](respondWithResult(_0x308b3a,null))[_0x9156('0x42')](handleError(_0x308b3a,null));};exports['create']=function(_0x1a9661,_0x5c9ef5){return db[_0x9156('0x27')][_0x9156('0x43')](_0x1a9661[_0x9156('0x44')],{})[_0x9156('0x1d')](function(_0x48265d){var _0x2398e3=_0x1a9661[_0x9156('0x45')][_0x9156('0x1e')]({'plain':!![]});if(!_0x2398e3)throw new Error(_0x9156('0x46'));if(_0x2398e3[_0x9156('0x47')]===_0x9156('0x45')){var _0x214802=_0x48265d[_0x9156('0x1e')]({'plain':!![]});var _0x19498f=_0x9156('0x48');return db[_0x9156('0x49')][_0x9156('0x41')]({'where':{'name':_0x19498f,'userProfileId':_0x2398e3['userProfileId']},'raw':!![]})[_0x9156('0x1d')](function(_0x4fe765){if(_0x4fe765&&_0x4fe765[_0x9156('0x4a')]===0x0){return db['UserProfileResource'][_0x9156('0x43')]({'name':_0x214802[_0x9156('0x23')],'resourceId':_0x214802['id'],'type':'CustomReports','sectionId':_0x4fe765['id']},{})[_0x9156('0x1d')](function(){return _0x48265d;});}else{return _0x48265d;}})[_0x9156('0x42')](function(_0x928454){logger['error'](_0x9156('0x4b'),_0x928454);throw _0x928454;});}return _0x48265d;})[_0x9156('0x1d')](respondWithResult(_0x5c9ef5,0xc9))[_0x9156('0x42')](handleError(_0x5c9ef5,null));};exports[_0x9156('0x1c')]=function(_0x3a8881,_0x23f76d){if(_0x3a8881['body']['id']){delete _0x3a8881[_0x9156('0x44')]['id'];}return db[_0x9156('0x27')][_0x9156('0x41')]({'where':{'id':_0x3a8881[_0x9156('0x3e')]['id']}})[_0x9156('0x1d')](handleEntityNotFound(_0x23f76d,null))[_0x9156('0x1d')](saveUpdates(_0x3a8881[_0x9156('0x44')],null))[_0x9156('0x1d')](respondWithResult(_0x23f76d,null))['catch'](handleError(_0x23f76d,null));};exports[_0x9156('0x20')]=function(_0x533295,_0x2dfd80){return db['AnalyticCustomReport'][_0x9156('0x41')]({'where':{'id':_0x533295[_0x9156('0x3e')]['id']}})[_0x9156('0x1d')](handleEntityNotFound(_0x2dfd80,null))[_0x9156('0x1d')](removeEntity(_0x2dfd80,null))['catch'](handleError(_0x2dfd80,null));};exports[_0x9156('0x4c')]=function(_0x421417,_0x44d5f6){var _0x2382bf=0xa;var _0x3e0a26=[_0x9156('0x4d'),_0x9156('0x4e'),_0x9156('0x4f'),'cross_join'];var _0x2991a9={'SUM':_0x9156('0x50'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x9156('0x51'),'MAX':_0x9156('0x52'),'MIN':_0x9156('0x53'),'AVG':_0x9156('0x54'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x9156('0x55'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f8d50={'SEC_TO_TIME':_0x9156('0x56'),'DATE':_0x9156('0x57'),'HOUR':'HOUR(%s)','ROUND':_0x9156('0x58'),'UNIX_TIMESTAMP':_0x9156('0x59')};var _0x3ffee1=function(_0x57b3c7){return!_[_0x9156('0x5a')]([_0x9156('0x5b'),_0x9156('0x5c'),_0x9156('0x5d'),'IS\x20NOT\x20EMPTY'],_0x57b3c7);};var _0x583224=function(_0x271e97){if(!_0x271e97||!_0x271e97[_0x9156('0x5e')][_0x9156('0x32')]){return'';}for(var _0x2f7cf3='(',_0x1da26f=0x0;_0x1da26f<_0x271e97[_0x9156('0x5e')][_0x9156('0x32')];_0x1da26f+=0x1){_0x1da26f>0x0&&(_0x2f7cf3+='\x20'+_0x271e97[_0x9156('0x5f')]+'\x20');_0x2f7cf3+=_0x271e97[_0x9156('0x5e')][_0x1da26f][_0x9156('0x60')]?_0x583224(_0x271e97[_0x9156('0x5e')][_0x1da26f][_0x9156('0x60')]):_0x271e97[_0x9156('0x5e')][_0x1da26f][_0x9156('0x61')]+'\x20'+_0x271e97[_0x9156('0x5e')][_0x1da26f][_0x9156('0x62')]+(_0x3ffee1(_0x271e97[_0x9156('0x5e')][_0x1da26f][_0x9156('0x62')])?'\x20'+_0x271e97[_0x9156('0x5e')][_0x1da26f][_0x9156('0x63')]:'');}return _0x2f7cf3+')';};var _0x433de5={'where':{'id':_0x421417['params']['id']}},_0x5108cc,_0x34c58a,_0xf9fa17,_0x2b7001,_0x2f6a3c;_0x433de5=_['merge']({},_0x433de5,_0x421417[_0x9156('0x40')]);return db[_0x9156('0x27')]['find'](_0x433de5)[_0x9156('0x1d')](function(_0xedb3f3){if(_0xedb3f3){_0x5108cc=_0xedb3f3;return _0xedb3f3[_0x9156('0x64')]();}return null;})[_0x9156('0x1d')](function(_0x5a01e8){if(_0x5a01e8){if(!_0x5a01e8['length']){throw new db['Sequelize'][(_0x9156('0x65'))](_0x9156('0x66'),0x193);}_0x34c58a=_0x5a01e8;return db[_0x9156('0x67')]['findAll']({'raw':!![]});}return null;})[_0x9156('0x1d')](function(_0x5c7619){if(_0x5c7619){_0xf9fa17=_['keyBy'](_0x5c7619,'id');var _0x3d3ad7;var _0x35c221=squel[_0x9156('0x68')]();_0x35c221['from'](_0x5108cc[_0x9156('0x69')]);for(var _0x58275a=0x0;_0x58275a<_0x34c58a[_0x9156('0x32')];_0x58275a+=0x1){_0x3d3ad7=_0x34c58a[_0x58275a][_0x9156('0x6a')]?_0xf9fa17[_0x34c58a[_0x58275a][_0x9156('0x6a')]][_0x9156('0x6b')]:_0x34c58a[_0x58275a]['field'];_0x3d3ad7=_0x34c58a[_0x58275a][_0x9156('0x6c')]?_['replace'](_0x2991a9[_0x34c58a[_0x58275a][_0x9156('0x6c')]],'%s',_0x3d3ad7):_0x3d3ad7;_0x3d3ad7=_0x34c58a[_0x58275a][_0x9156('0x6d')]?_[_0x9156('0x6e')](_0x1f8d50[_0x34c58a[_0x58275a][_0x9156('0x6d')]],'%s',_0x3d3ad7):_0x3d3ad7;if(_0x34c58a[_0x58275a][_0x9156('0x6f')]){_0x35c221[_0x9156('0x60')](_0x3d3ad7);}_0x34c58a[_0x58275a][_0x9156('0x70')]&&_0x35c221[_0x9156('0x34')](_0x3d3ad7,_0x34c58a[_0x58275a][_0x9156('0x70')]==='DESC'?![]:!![]);_0x35c221['field'](_0x3d3ad7,_0x34c58a[_0x58275a]['alias']||_0x3d3ad7);}if(_0x5108cc[_0x9156('0x71')]){_0x5108cc[_0x9156('0x71')]=JSON[_0x9156('0x72')](_0x5108cc[_0x9156('0x71')]);for(var _0x5aa831=0x0;_0x5aa831<_0x5108cc[_0x9156('0x71')][_0x9156('0x32')];_0x5aa831+=0x1){if(_0x5108cc[_0x9156('0x71')][_0x5aa831]['type']&&_[_0x9156('0x5a')](_0x3e0a26,_0x5108cc['joins'][_0x5aa831][_0x9156('0x2a')])&&_0x5108cc['joins'][_0x5aa831][_0x9156('0x73')]&&_0x5108cc[_0x9156('0x71')][_0x5aa831][_0x9156('0x74')]&&_0x5108cc[_0x9156('0x71')][_0x5aa831][_0x9156('0x75')]){_0x35c221[_0x5108cc[_0x9156('0x71')][_0x5aa831]['type']](_0x5108cc[_0x9156('0x71')][_0x5aa831][_0x9156('0x74')],null,util['format'](_0x9156('0x76'),_0x5108cc['table'],_0x5108cc[_0x9156('0x71')][_0x5aa831]['parentKey'],_0x5108cc[_0x9156('0x71')][_0x5aa831][_0x9156('0x74')],_0x5108cc[_0x9156('0x71')][_0x5aa831][_0x9156('0x75')]));}}}if(_0x5108cc['conditions']){_0x5108cc[_0x9156('0x77')]=JSON[_0x9156('0x72')](_0x5108cc[_0x9156('0x77')]);_0x35c221[_0x9156('0x35')](_0x583224(_0x5108cc[_0x9156('0x77')][_0x9156('0x60')]));}_0x2f6a3c=_0x35c221['clone']();_0x35c221['limit'](_0x2382bf);_0x35c221[_0x9156('0x15')](0x0);logger[_0x9156('0x78')]('Limited\x20Query:',_0x35c221[_0x9156('0x79')]());return dbH[_0x9156('0x7a')]['query'](_0x35c221['toString'](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});}})[_0x9156('0x1d')](respondWithResult(_0x44d5f6,null))[_0x9156('0x42')](handleError(_0x44d5f6,null));};function runReport(_0x208b7c,_0x364fc1,_0x493a15){var _0x1c1f97=_0x364fc1[_0x9156('0x23')];var _0x5822a0=0xa;var _0x11892e=[_0x9156('0x4d'),_0x9156('0x4e'),_0x9156('0x4f'),_0x9156('0x7b')];var _0x55b09e={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9156('0x52'),'MIN':_0x9156('0x53'),'AVG':_0x9156('0x54'),'GROUP_CONCAT':_0x9156('0x7c'),'GROUP_CONCAT ASC':_0x9156('0x55'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5a6a14={'SEC_TO_TIME':_0x9156('0x56'),'DATE':_0x9156('0x57'),'HOUR':_0x9156('0x7d'),'ROUND':_0x9156('0x58'),'UNIX_TIMESTAMP':_0x9156('0x59')};var _0x5b50ef=function(_0x8ee25e){return!_[_0x9156('0x5a')]([_0x9156('0x5b'),'IS\x20NOT\x20NULL',_0x9156('0x5d'),'IS\x20NOT\x20EMPTY'],_0x8ee25e);};var _0x4169fb=function(_0x550f0d){if(!_0x550f0d||!_0x550f0d['rules'][_0x9156('0x32')]){return'';}for(var _0x4d54bc='(',_0x2644d2=0x0;_0x2644d2<_0x550f0d[_0x9156('0x5e')]['length'];_0x2644d2+=0x1){_0x2644d2>0x0&&(_0x4d54bc+='\x20'+_0x550f0d[_0x9156('0x5f')]+'\x20');_0x4d54bc+=_0x550f0d[_0x9156('0x5e')][_0x2644d2][_0x9156('0x60')]?_0x4169fb(_0x550f0d[_0x9156('0x5e')][_0x2644d2][_0x9156('0x60')]):_0x550f0d[_0x9156('0x5e')][_0x2644d2][_0x9156('0x61')]+'\x20'+_0x550f0d[_0x9156('0x5e')][_0x2644d2]['condition']+(_0x5b50ef(_0x550f0d[_0x9156('0x5e')][_0x2644d2][_0x9156('0x62')])?'\x20'+_0x550f0d[_0x9156('0x5e')][_0x2644d2][_0x9156('0x63')]:'');}return _0x4d54bc+')';};var _0x565bb1={'where':{'id':_0x208b7c['id']}},_0x3463c1,_0x2783ee,_0xad4f31,_0x3c9f06,_0x121da0;_0x565bb1=_[_0x9156('0x39')]({},_0x565bb1,_0x493a15);return db[_0x9156('0x27')]['find'](_0x565bb1)[_0x9156('0x1d')](function(_0xbbbe04){if(_0xbbbe04){_0x3463c1=_0xbbbe04;return _0xbbbe04[_0x9156('0x64')]();}return null;})['then'](function(_0x216dd9){if(_0x216dd9){if(!_0x216dd9['length']){throw new db['Sequelize'][(_0x9156('0x65'))](_0x9156('0x66'),0x193);}_0x2783ee=_0x216dd9;return db[_0x9156('0x67')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x12ba78){if(_0x12ba78){_0xad4f31=_[_0x9156('0x7e')](_0x12ba78,'id');var _0x17c92d;var _0x381cde=squel[_0x9156('0x68')]();_0x381cde[_0x9156('0x7f')](_0x3463c1[_0x9156('0x69')]);for(var _0x3fada2=0x0;_0x3fada2<_0x2783ee[_0x9156('0x32')];_0x3fada2+=0x1){_0x17c92d=_0x2783ee[_0x3fada2][_0x9156('0x6a')]?_0xad4f31[_0x2783ee[_0x3fada2]['MetricId']][_0x9156('0x6b')]:_0x2783ee[_0x3fada2][_0x9156('0x61')];_0x17c92d=_0x2783ee[_0x3fada2][_0x9156('0x6c')]?_[_0x9156('0x6e')](_0x55b09e[_0x2783ee[_0x3fada2][_0x9156('0x6c')]],'%s',_0x17c92d):_0x17c92d;_0x17c92d=_0x2783ee[_0x3fada2]['format']?_[_0x9156('0x6e')](_0x5a6a14[_0x2783ee[_0x3fada2][_0x9156('0x6d')]],'%s',_0x17c92d):_0x17c92d;if(_0x2783ee[_0x3fada2]['groupBy']){_0x381cde['group'](_0x17c92d);}_0x2783ee[_0x3fada2]['orderBy']&&_0x381cde[_0x9156('0x34')](_0x17c92d,_0x2783ee[_0x3fada2][_0x9156('0x70')]===_0x9156('0x80')?![]:!![]);_0x381cde[_0x9156('0x61')](_0x17c92d,_0x2783ee[_0x3fada2][_0x9156('0x81')]||_0x17c92d);}if(_0x3463c1['joins']){_0x3463c1[_0x9156('0x71')]=JSON[_0x9156('0x72')](_0x3463c1[_0x9156('0x71')]);for(var _0x16bdc1=0x0;_0x16bdc1<_0x3463c1[_0x9156('0x71')][_0x9156('0x32')];_0x16bdc1+=0x1){if(_0x3463c1[_0x9156('0x71')][_0x16bdc1][_0x9156('0x2a')]&&_[_0x9156('0x5a')](_0x11892e,_0x3463c1[_0x9156('0x71')][_0x16bdc1][_0x9156('0x2a')])&&_0x3463c1['joins'][_0x16bdc1][_0x9156('0x73')]&&_0x3463c1[_0x9156('0x71')][_0x16bdc1][_0x9156('0x74')]&&_0x3463c1[_0x9156('0x71')][_0x16bdc1]['foreignKey']){_0x381cde[_0x3463c1['joins'][_0x16bdc1][_0x9156('0x2a')]](_0x3463c1[_0x9156('0x71')][_0x16bdc1][_0x9156('0x74')],null,util[_0x9156('0x6d')](_0x9156('0x76'),_0x3463c1[_0x9156('0x69')],_0x3463c1[_0x9156('0x71')][_0x16bdc1]['parentKey'],_0x3463c1['joins'][_0x16bdc1][_0x9156('0x74')],_0x3463c1[_0x9156('0x71')][_0x16bdc1][_0x9156('0x75')]));}}}if(_0x3463c1[_0x9156('0x77')]){_0x3463c1[_0x9156('0x77')]=JSON['parse'](_0x3463c1[_0x9156('0x77')]);_0x381cde[_0x9156('0x35')](_0x4169fb(_0x3463c1[_0x9156('0x77')][_0x9156('0x60')]));}_0x121da0=_0x381cde[_0x9156('0x82')]();_0x381cde[_0x9156('0x17')](_0x5822a0);_0x381cde[_0x9156('0x15')](0x0);return;}})[_0x9156('0x1d')](function(){if(_0x364fc1[_0x9156('0x83')]===_0x9156('0x84')){return null;}var _0x49eccc=_[_0x9156('0x39')](_0x364fc1,{'name':_0x364fc1[_0x9156('0x85')]||_0x364fc1['name']||_0x3463c1[_0x9156('0x23')],'basename':_0x1c1f97,'savename':util[_0x9156('0x6d')](_0x9156('0x86'),_0x364fc1[_0x9156('0x23')]||_0x3463c1[_0x9156('0x23')],require(_0x9156('0x87'))['generate'](0x4),_0x364fc1['output']||'csv'),'reportId':_0x3463c1['id'],'reportType':_0x9156('0x88')});return db['AnalyticExtractedReport']['create'](_0x49eccc,{'raw':!![]});})[_0x9156('0x1d')](function(_0x4e6d10){if(_0x3463c1[_0x9156('0x69')]==='cdr'){_0x121da0[_0x9156('0x35')](_0x3463c1[_0x9156('0x69')]+_0x9156('0x89'),_0x364fc1[_0x9156('0x8a')],_0x364fc1[_0x9156('0x8b')]);}else{_0x121da0[_0x9156('0x35')](_0x3463c1[_0x9156('0x69')]+_0x9156('0x8c'),_0x364fc1[_0x9156('0x8a')],_0x364fc1['endDate']);}if(_0x4e6d10){logger[_0x9156('0x8d')]('Run\x20Query:',_0x121da0[_0x9156('0x79')]());require(_0x9156('0x8e'))[_0x9156('0x8f')](path['join'](__dirname,'../../components/export/',_0x4e6d10[_0x9156('0x83')]),[_0x4e6d10['id'],_0x121da0[_0x9156('0x79')](),path[_0x9156('0x4d')](__dirname,_0x9156('0x90'),_0x4e6d10['savename']),_0x1c1f97]);return _0x4e6d10;}else{var _0x555337=squel[_0x9156('0x68')]();_0x555337[_0x9156('0x7f')]('('+_0x121da0['toString']()+')',_0x9156('0x91'));_0x555337['field']('COUNT(*)',_0x9156('0x18'));_0x121da0['limit'](_0x364fc1['limit']||_0x5822a0);_0x121da0['offset'](_0x364fc1[_0x9156('0x15')]||0x0);return dbH[_0x9156('0x7a')][_0x9156('0x2f')](_0x555337['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x9156('0x92')]})[_0x9156('0x1d')](function(_0xdd0410){if(!_0xdd0410[_0x9156('0x32')]){_0x3c9f06=0x0;}else{_0x3c9f06=_0xdd0410[0x0][_0x9156('0x18')]||0x0;}return dbH['sequelize'][_0x9156('0x2f')](_0x121da0[_0x9156('0x79')](),{'type':dbH[_0x9156('0x7a')][_0x9156('0x93')][_0x9156('0x92')]});})[_0x9156('0x1d')](function(_0x341cf1){return{'rows':_0x341cf1||[],'count':_0x3c9f06};});}});}exports[_0x9156('0x94')]=function(_0x16604f,_0x2a5e75){return runReport(_0x16604f[_0x9156('0x3e')],_0x16604f['query'],_0x16604f[_0x9156('0x40')])['then'](respondWithResult(_0x2a5e75,null))[_0x9156('0x42')](handleError(_0x2a5e75,null));};exports[_0x9156('0x95')]=runReport;exports['query']=function(_0x56b776,_0x38ce1e){var _0x8027c7=0xa;var _0x591a33=[_0x9156('0x4d'),'left_join',_0x9156('0x4f'),_0x9156('0x7b')];var _0x56eda8={'SUM':_0x9156('0x50'),'COUNT':_0x9156('0x96'),'COUNT DISTINCT':_0x9156('0x51'),'MAX':_0x9156('0x52'),'MIN':_0x9156('0x53'),'AVG':_0x9156('0x54'),'GROUP_CONCAT':_0x9156('0x7c'),'GROUP_CONCAT ASC':_0x9156('0x55'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x25a59a={'SEC_TO_TIME':_0x9156('0x56'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9156('0x59')};var _0x5bba0f=function(_0x524311){return!_[_0x9156('0x5a')]([_0x9156('0x5b'),_0x9156('0x5c'),'IS\x20EMPTY',_0x9156('0x97')],_0x524311);};var _0xe92626=function(_0x63bec7){if(!_0x63bec7||!_0x63bec7[_0x9156('0x5e')][_0x9156('0x32')]){return'';}for(var _0x290085='(',_0x56f80f=0x0;_0x56f80f<_0x63bec7[_0x9156('0x5e')][_0x9156('0x32')];_0x56f80f+=0x1){_0x56f80f>0x0&&(_0x290085+='\x20'+_0x63bec7[_0x9156('0x5f')]+'\x20');_0x290085+=_0x63bec7[_0x9156('0x5e')][_0x56f80f][_0x9156('0x60')]?_0xe92626(_0x63bec7[_0x9156('0x5e')][_0x56f80f][_0x9156('0x60')]):_0x63bec7['rules'][_0x56f80f][_0x9156('0x61')]+'\x20'+_0x63bec7[_0x9156('0x5e')][_0x56f80f][_0x9156('0x62')]+(_0x5bba0f(_0x63bec7['rules'][_0x56f80f][_0x9156('0x62')])?'\x20'+_0x63bec7[_0x9156('0x5e')][_0x56f80f][_0x9156('0x63')]:'');}return _0x290085+')';};var _0x2f3b03={'where':{'id':_0x56b776['params']['id']}},_0x1a2b7f,_0x9933c9,_0x3a7d45,_0x524ba6,_0x4f5bcf;_0x2f3b03=_[_0x9156('0x39')]({},_0x2f3b03,_0x56b776[_0x9156('0x40')]);return db[_0x9156('0x27')][_0x9156('0x41')](_0x2f3b03)['then'](function(_0x48289e){if(_0x48289e){_0x1a2b7f=_0x48289e;return _0x48289e['getFields']();}return null;})[_0x9156('0x1d')](function(_0x527011){if(_0x527011){if(!_0x527011[_0x9156('0x32')]){throw new db['Sequelize']['ValidationErrorItem'](_0x9156('0x66'),0x193);}_0x9933c9=_0x527011;return db[_0x9156('0x67')][_0x9156('0x98')]({'raw':!![]});}return null;})[_0x9156('0x1d')](function(_0xa55a65){if(_0xa55a65){_0x3a7d45=_['keyBy'](_0xa55a65,'id');var _0x22cbb4;var _0x31578b=squel[_0x9156('0x68')]();_0x31578b[_0x9156('0x7f')](_0x1a2b7f['table']);for(var _0x557979=0x0;_0x557979<_0x9933c9[_0x9156('0x32')];_0x557979+=0x1){_0x22cbb4=_0x9933c9[_0x557979][_0x9156('0x6a')]?_0x3a7d45[_0x9933c9[_0x557979][_0x9156('0x6a')]]['metric']:_0x9933c9[_0x557979]['field'];_0x22cbb4=_0x9933c9[_0x557979]['function']?_[_0x9156('0x6e')](_0x56eda8[_0x9933c9[_0x557979]['function']],'%s',_0x22cbb4):_0x22cbb4;_0x22cbb4=_0x9933c9[_0x557979][_0x9156('0x6d')]?_[_0x9156('0x6e')](_0x25a59a[_0x9933c9[_0x557979][_0x9156('0x6d')]],'%s',_0x22cbb4):_0x22cbb4;if(_0x9933c9[_0x557979][_0x9156('0x6f')]){_0x31578b[_0x9156('0x60')](_0x22cbb4);}_0x9933c9[_0x557979][_0x9156('0x70')]&&_0x31578b[_0x9156('0x34')](_0x22cbb4,_0x9933c9[_0x557979]['orderBy']===_0x9156('0x80')?![]:!![]);_0x31578b[_0x9156('0x61')](_0x22cbb4,_0x9933c9[_0x557979][_0x9156('0x81')]||_0x22cbb4);}if(_0x1a2b7f[_0x9156('0x71')]){_0x1a2b7f['joins']=JSON[_0x9156('0x72')](_0x1a2b7f[_0x9156('0x71')]);for(var _0x398687=0x0;_0x398687<_0x1a2b7f[_0x9156('0x71')][_0x9156('0x32')];_0x398687+=0x1){if(_0x1a2b7f[_0x9156('0x71')][_0x398687][_0x9156('0x2a')]&&_[_0x9156('0x5a')](_0x591a33,_0x1a2b7f['joins'][_0x398687]['type'])&&_0x1a2b7f[_0x9156('0x71')][_0x398687][_0x9156('0x73')]&&_0x1a2b7f[_0x9156('0x71')][_0x398687][_0x9156('0x74')]&&_0x1a2b7f[_0x9156('0x71')][_0x398687][_0x9156('0x75')]){_0x31578b[_0x1a2b7f[_0x9156('0x71')][_0x398687][_0x9156('0x2a')]](_0x1a2b7f[_0x9156('0x71')][_0x398687][_0x9156('0x74')],null,util[_0x9156('0x6d')](_0x9156('0x76'),_0x1a2b7f[_0x9156('0x69')],_0x1a2b7f[_0x9156('0x71')][_0x398687][_0x9156('0x73')],_0x1a2b7f[_0x9156('0x71')][_0x398687]['foreignTable'],_0x1a2b7f[_0x9156('0x71')][_0x398687][_0x9156('0x75')]));}}}if(_0x1a2b7f[_0x9156('0x77')]){_0x1a2b7f[_0x9156('0x77')]=JSON[_0x9156('0x72')](_0x1a2b7f['conditions']);_0x31578b[_0x9156('0x35')](_0xe92626(_0x1a2b7f['conditions'][_0x9156('0x60')]));}_0x4f5bcf=_0x31578b[_0x9156('0x82')]();_0x31578b['limit'](_0x8027c7);_0x31578b['offset'](0x0);logger['debug'](_0x9156('0x99'),_0x31578b[_0x9156('0x79')]());return dbH[_0x9156('0x7a')]['query'](_0x31578b[_0x9156('0x79')](),{'type':dbH[_0x9156('0x7a')]['QueryTypes'][_0x9156('0x92')]});}})[_0x9156('0x1d')](function(){return{'sql':_0x4f5bcf[_0x9156('0x79')]()};})[_0x9156('0x1d')](respondWithResult(_0x38ce1e,null))['catch'](handleError(_0x38ce1e,null));};
\ No newline at end of file
+var _0x4dee=['groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','HOUR(%s)','ROUND(%s)','operator','getFields','keyBy','foreignKey','web','fullPath','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','runReport','IS\x20EMPTY','IS\x20NOT\x20EMPTY','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','destroy','then','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','AnalyticCustomReport','findAll','rows','catch','show','keys','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','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)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','metric','function','replace','format'];(function(_0x6f6f18,_0x406aee){var _0x57c18c=function(_0x289369){while(--_0x289369){_0x6f6f18['push'](_0x6f6f18['shift']());}};_0x57c18c(++_0x406aee);}(_0x4dee,0x172));var _0xe4de=function(_0x4aa667,_0x179830){_0x4aa667=_0x4aa667-0x0;var _0x3ca1b2=_0x4dee[_0x4aa667];return _0x3ca1b2;};'use strict';var emlformat=require(_0xe4de('0x0'));var rimraf=require(_0xe4de('0x1'));var zipdir=require(_0xe4de('0x2'));var jsonpatch=require(_0xe4de('0x3'));var rp=require(_0xe4de('0x4'));var moment=require(_0xe4de('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe4de('0x6'));var util=require(_0xe4de('0x7'));var path=require(_0xe4de('0x8'));var sox=require(_0xe4de('0x9'));var csv=require('to-csv');var ejs=require(_0xe4de('0xa'));var fs=require('fs');var fs_extra=require(_0xe4de('0xb'));var _=require(_0xe4de('0xc'));var squel=require(_0xe4de('0xd'));var crypto=require('crypto');var jsforce=require(_0xe4de('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe4de('0xf'));var authService=require(_0xe4de('0x10'));var qs=require(_0xe4de('0x11'));var as=require(_0xe4de('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe4de('0x13'));var utils=require(_0xe4de('0x14'));var config=require(_0xe4de('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe4de('0x16'))['db'];var dbH=require('../../mysqldb')[_0xe4de('0x17')];function respondWithStatusCode(_0x258b4e,_0xbe0d50){_0xbe0d50=_0xbe0d50||0xcc;return function(_0x26f1eb){if(_0x26f1eb){return _0x258b4e[_0xe4de('0x18')](_0xbe0d50);}return _0x258b4e[_0xe4de('0x19')](_0xbe0d50)[_0xe4de('0x1a')]();};}function respondWithResult(_0x51eeed,_0x36f3f0){_0x36f3f0=_0x36f3f0||0xc8;return function(_0x279104){if(_0x279104){return _0x51eeed[_0xe4de('0x19')](_0x36f3f0)['json'](_0x279104);}};}function respondWithFilteredResult(_0x4f892c,_0x53e52b){return function(_0x141ad5){if(_0x141ad5){var _0x1fa341=typeof _0x53e52b[_0xe4de('0x1b')]===_0xe4de('0x1c')&&typeof _0x53e52b[_0xe4de('0x1d')]===_0xe4de('0x1c');var _0x43b47d=_0x141ad5[_0xe4de('0x1e')];var _0x1c6c1a=_0x1fa341?0x0:_0x53e52b[_0xe4de('0x1b')];var _0x4f1e9a=_0x1fa341?_0x141ad5[_0xe4de('0x1e')]:_0x53e52b[_0xe4de('0x1b')]+_0x53e52b['limit'];var _0x28712d;if(_0x4f1e9a>=_0x43b47d){_0x4f1e9a=_0x43b47d;_0x28712d=0xc8;}else{_0x28712d=0xce;}_0x4f892c[_0xe4de('0x19')](_0x28712d);return _0x4f892c[_0xe4de('0x1f')](_0xe4de('0x20'),_0x1c6c1a+'-'+_0x4f1e9a+'/'+_0x43b47d)[_0xe4de('0x21')](_0x141ad5);}return null;};}function patchUpdates(_0x1a8784){return function(_0x2a8bd8){try{jsonpatch['apply'](_0x2a8bd8,_0x1a8784,!![]);}catch(_0x218a73){return BPromise['reject'](_0x218a73);}return _0x2a8bd8[_0xe4de('0x22')]();};}function saveUpdates(_0x3e571d,_0x3349c2){return function(_0x5a2c18){if(_0x5a2c18){return _0x5a2c18[_0xe4de('0x23')](_0x3e571d)['then'](function(_0xe35f0d){return _0xe35f0d;});}return null;};}function removeEntity(_0xb75ef,_0x145f00){return function(_0x5d26da){if(_0x5d26da){return _0x5d26da[_0xe4de('0x24')]()[_0xe4de('0x25')](function(){var _0x59d5ac=_0x5d26da[_0xe4de('0x26')]({'plain':!![]});var _0x4c8530=_0xe4de('0x27');return db[_0xe4de('0x28')]['destroy']({'where':{'type':_0x4c8530,'resourceId':_0x59d5ac['id']}})[_0xe4de('0x25')](function(){return _0x5d26da;});})['then'](function(){_0xb75ef[_0xe4de('0x19')](0xcc)[_0xe4de('0x1a')]();});}};}function handleEntityNotFound(_0x29f20b,_0x68ed21){return function(_0x46ed77){if(!_0x46ed77){_0x29f20b[_0xe4de('0x18')](0x194);}return _0x46ed77;};}function handleError(_0xae7e08,_0x26657b){_0x26657b=_0x26657b||0x1f4;return function(_0x1a2ca5){logger[_0xe4de('0x29')](_0x1a2ca5[_0xe4de('0x2a')]);if(_0x1a2ca5[_0xe4de('0x2b')]){delete _0x1a2ca5[_0xe4de('0x2b')];}_0xae7e08[_0xe4de('0x19')](_0x26657b)[_0xe4de('0x2c')](_0x1a2ca5);};}exports[_0xe4de('0x2d')]=function(_0x135a66,_0x3fc25a){var _0x286dd6={},_0x5b56e3={},_0x6fdc4={'count':0x0,'rows':[]};var _0x56980d=_[_0xe4de('0x2e')](db['AnalyticCustomReport'][_0xe4de('0x2f')],function(_0x4ff82a){return{'name':_0x4ff82a['fieldName'],'type':_0x4ff82a[_0xe4de('0x30')][_0xe4de('0x31')]};});_0x5b56e3['model']=_[_0xe4de('0x2e')](_0x56980d,_0xe4de('0x2b'));_0x5b56e3[_0xe4de('0x32')]=_['keys'](_0x135a66[_0xe4de('0x32')]);_0x5b56e3[_0xe4de('0x33')]=_[_0xe4de('0x34')](_0x5b56e3[_0xe4de('0x35')],_0x5b56e3[_0xe4de('0x32')]);_0x286dd6[_0xe4de('0x36')]=_[_0xe4de('0x34')](_0x5b56e3[_0xe4de('0x35')],qs[_0xe4de('0x37')](_0x135a66[_0xe4de('0x32')][_0xe4de('0x37')]));_0x286dd6['attributes']=_0x286dd6[_0xe4de('0x36')][_0xe4de('0x38')]?_0x286dd6[_0xe4de('0x36')]:_0x5b56e3[_0xe4de('0x35')];if(!_0x135a66[_0xe4de('0x32')]['hasOwnProperty'](_0xe4de('0x39'))){_0x286dd6[_0xe4de('0x1d')]=qs[_0xe4de('0x1d')](_0x135a66[_0xe4de('0x32')][_0xe4de('0x1d')]);_0x286dd6[_0xe4de('0x1b')]=qs[_0xe4de('0x1b')](_0x135a66[_0xe4de('0x32')][_0xe4de('0x1b')]);}_0x286dd6[_0xe4de('0x3a')]=qs[_0xe4de('0x3b')](_0x135a66[_0xe4de('0x32')]['sort']);_0x286dd6[_0xe4de('0x3c')]=qs[_0xe4de('0x33')](_[_0xe4de('0x3d')](_0x135a66[_0xe4de('0x32')],_0x5b56e3[_0xe4de('0x33')]),_0x56980d);if(_0x135a66['query'][_0xe4de('0x3e')]){_0x286dd6[_0xe4de('0x3c')]=_['merge'](_0x286dd6[_0xe4de('0x3c')],{'$or':_[_0xe4de('0x2e')](_0x56980d,function(_0x55e5a7){if(_0x55e5a7[_0xe4de('0x30')]!==_0xe4de('0x3f')){var _0x4d7e6b={};_0x4d7e6b[_0x55e5a7[_0xe4de('0x2b')]]={'$like':'%'+_0x135a66[_0xe4de('0x32')]['filter']+'%'};return _0x4d7e6b;}})});}_0x286dd6=_[_0xe4de('0x40')]({},_0x286dd6,_0x135a66[_0xe4de('0x41')]);var _0x497878={'where':_0x286dd6[_0xe4de('0x3c')]};return db['AnalyticCustomReport'][_0xe4de('0x1e')](_0x497878)[_0xe4de('0x25')](function(_0x4308eb){_0x6fdc4['count']=_0x4308eb;if(_0x135a66[_0xe4de('0x32')]['includeAll']){_0x286dd6[_0xe4de('0x42')]=[{'all':!![]}];}return db[_0xe4de('0x43')][_0xe4de('0x44')](_0x286dd6);})[_0xe4de('0x25')](function(_0x578356){_0x6fdc4[_0xe4de('0x45')]=_0x578356;return _0x6fdc4;})[_0xe4de('0x25')](respondWithFilteredResult(_0x3fc25a,_0x286dd6))[_0xe4de('0x46')](handleError(_0x3fc25a,null));};exports[_0xe4de('0x47')]=function(_0x1d571c,_0x5354e6){var _0x3c11ae={'raw':![],'where':{'id':_0x1d571c['params']['id']}},_0x49149e={};_0x49149e[_0xe4de('0x35')]=_[_0xe4de('0x48')](db[_0xe4de('0x43')][_0xe4de('0x2f')]);_0x49149e[_0xe4de('0x32')]=_[_0xe4de('0x48')](_0x1d571c[_0xe4de('0x32')]);_0x49149e[_0xe4de('0x33')]=_['intersection'](_0x49149e[_0xe4de('0x35')],_0x49149e[_0xe4de('0x32')]);_0x3c11ae['attributes']=_['intersection'](_0x49149e[_0xe4de('0x35')],qs[_0xe4de('0x37')](_0x1d571c['query'][_0xe4de('0x37')]));_0x3c11ae[_0xe4de('0x36')]=_0x3c11ae[_0xe4de('0x36')][_0xe4de('0x38')]?_0x3c11ae[_0xe4de('0x36')]:_0x49149e['model'];if(_0x1d571c[_0xe4de('0x32')][_0xe4de('0x49')]){_0x3c11ae[_0xe4de('0x42')]=[{'all':!![]}];}_0x3c11ae=_[_0xe4de('0x40')]({},_0x3c11ae,_0x1d571c[_0xe4de('0x41')]);return db['AnalyticCustomReport']['find'](_0x3c11ae)['then'](handleEntityNotFound(_0x5354e6,null))[_0xe4de('0x25')](respondWithResult(_0x5354e6,null))[_0xe4de('0x46')](handleError(_0x5354e6,null));};exports[_0xe4de('0x4a')]=function(_0x518946,_0x42bbf2){return db[_0xe4de('0x43')][_0xe4de('0x4a')](_0x518946[_0xe4de('0x4b')],{})['then'](function(_0x52d305){var _0x2f5f4d=_0x518946[_0xe4de('0x4c')][_0xe4de('0x26')]({'plain':!![]});if(!_0x2f5f4d)throw new Error(_0xe4de('0x4d'));if(_0x2f5f4d['role']===_0xe4de('0x4c')){var _0x4ab531=_0x52d305[_0xe4de('0x26')]({'plain':!![]});var _0x439823=_0xe4de('0x4e');return db[_0xe4de('0x4f')][_0xe4de('0x50')]({'where':{'name':_0x439823,'userProfileId':_0x2f5f4d[_0xe4de('0x51')]},'raw':!![]})[_0xe4de('0x25')](function(_0x13f883){if(_0x13f883&&_0x13f883[_0xe4de('0x52')]===0x0){return db[_0xe4de('0x28')][_0xe4de('0x4a')]({'name':_0x4ab531['name'],'resourceId':_0x4ab531['id'],'type':_0xe4de('0x27'),'sectionId':_0x13f883['id']},{})[_0xe4de('0x25')](function(){return _0x52d305;});}else{return _0x52d305;}})['catch'](function(_0x11a50f){logger[_0xe4de('0x29')](_0xe4de('0x53'),_0x11a50f);throw _0x11a50f;});}return _0x52d305;})[_0xe4de('0x25')](respondWithResult(_0x42bbf2,0xc9))[_0xe4de('0x46')](handleError(_0x42bbf2,null));};exports[_0xe4de('0x23')]=function(_0x443506,_0x39a901){if(_0x443506[_0xe4de('0x4b')]['id']){delete _0x443506[_0xe4de('0x4b')]['id'];}return db[_0xe4de('0x43')][_0xe4de('0x50')]({'where':{'id':_0x443506[_0xe4de('0x54')]['id']}})[_0xe4de('0x25')](handleEntityNotFound(_0x39a901,null))['then'](saveUpdates(_0x443506[_0xe4de('0x4b')],null))[_0xe4de('0x25')](respondWithResult(_0x39a901,null))['catch'](handleError(_0x39a901,null));};exports[_0xe4de('0x24')]=function(_0x5d241f,_0x2fc3fe){return db[_0xe4de('0x43')]['find']({'where':{'id':_0x5d241f[_0xe4de('0x54')]['id']}})[_0xe4de('0x25')](handleEntityNotFound(_0x2fc3fe,null))[_0xe4de('0x25')](removeEntity(_0x2fc3fe,null))[_0xe4de('0x46')](handleError(_0x2fc3fe,null));};exports[_0xe4de('0x55')]=function(_0x2e0aab,_0xac7c5){var _0x7e84f7=0xa;var _0x19514a=[_0xe4de('0x56'),_0xe4de('0x57'),_0xe4de('0x58'),_0xe4de('0x59')];var _0xdb8337={'SUM':_0xe4de('0x5a'),'COUNT':_0xe4de('0x5b'),'COUNT DISTINCT':_0xe4de('0x5c'),'MAX':_0xe4de('0x5d'),'MIN':_0xe4de('0x5e'),'AVG':_0xe4de('0x5f'),'GROUP_CONCAT':_0xe4de('0x60'),'GROUP_CONCAT ASC':_0xe4de('0x61'),'GROUP_CONCAT DESC':_0xe4de('0x62')};var _0x37ee3d={'SEC_TO_TIME':_0xe4de('0x63'),'DATE':_0xe4de('0x64'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xe4de('0x65')};var _0x28b299=function(_0x2da856){return!_[_0xe4de('0x66')]([_0xe4de('0x67'),_0xe4de('0x68'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x2da856);};var _0x4ee4d4=function(_0x2682e6){if(!_0x2682e6||!_0x2682e6[_0xe4de('0x69')][_0xe4de('0x38')]){return'';}for(var _0x37b52c='(',_0x5a07c7=0x0;_0x5a07c7<_0x2682e6[_0xe4de('0x69')][_0xe4de('0x38')];_0x5a07c7+=0x1){_0x5a07c7>0x0&&(_0x37b52c+='\x20'+_0x2682e6['operator']+'\x20');_0x37b52c+=_0x2682e6[_0xe4de('0x69')][_0x5a07c7][_0xe4de('0x6a')]?_0x4ee4d4(_0x2682e6['rules'][_0x5a07c7][_0xe4de('0x6a')]):_0x2682e6[_0xe4de('0x69')][_0x5a07c7][_0xe4de('0x6b')]+'\x20'+_0x2682e6[_0xe4de('0x69')][_0x5a07c7][_0xe4de('0x6c')]+(_0x28b299(_0x2682e6[_0xe4de('0x69')][_0x5a07c7][_0xe4de('0x6c')])?'\x20'+_0x2682e6[_0xe4de('0x69')][_0x5a07c7][_0xe4de('0x6d')]:'');}return _0x37b52c+')';};var _0xe26c45={'where':{'id':_0x2e0aab[_0xe4de('0x54')]['id']}},_0x4c9eea,_0x434c0f,_0x4a94f3,_0x258ac4,_0xde93c2;_0xe26c45=_[_0xe4de('0x40')]({},_0xe26c45,_0x2e0aab[_0xe4de('0x41')]);return db[_0xe4de('0x43')][_0xe4de('0x50')](_0xe26c45)[_0xe4de('0x25')](function(_0x231f5b){if(_0x231f5b){_0x4c9eea=_0x231f5b;return _0x231f5b['getFields']();}return null;})[_0xe4de('0x25')](function(_0x476990){if(_0x476990){if(!_0x476990['length']){throw new db[(_0xe4de('0x6e'))][(_0xe4de('0x6f'))](_0xe4de('0x70'),0x193);}_0x434c0f=_0x476990;return db[_0xe4de('0x71')]['findAll']({'raw':!![]});}return null;})[_0xe4de('0x25')](function(_0x50adb3){if(_0x50adb3){_0x4a94f3=_['keyBy'](_0x50adb3,'id');var _0x431172;var _0x3008a2=squel[_0xe4de('0x72')]();_0x3008a2[_0xe4de('0x73')](_0x4c9eea[_0xe4de('0x74')]);for(var _0x489a72=0x0;_0x489a72<_0x434c0f[_0xe4de('0x38')];_0x489a72+=0x1){_0x431172=_0x434c0f[_0x489a72]['MetricId']?_0x4a94f3[_0x434c0f[_0x489a72][_0xe4de('0x75')]][_0xe4de('0x76')]:_0x434c0f[_0x489a72]['field'];_0x431172=_0x434c0f[_0x489a72][_0xe4de('0x77')]?_[_0xe4de('0x78')](_0xdb8337[_0x434c0f[_0x489a72]['function']],'%s',_0x431172):_0x431172;_0x431172=_0x434c0f[_0x489a72]['format']?_[_0xe4de('0x78')](_0x37ee3d[_0x434c0f[_0x489a72][_0xe4de('0x79')]],'%s',_0x431172):_0x431172;if(_0x434c0f[_0x489a72][_0xe4de('0x7a')]){_0x3008a2[_0xe4de('0x6a')](_0x431172);}_0x434c0f[_0x489a72][_0xe4de('0x7b')]&&_0x3008a2[_0xe4de('0x3a')](_0x431172,_0x434c0f[_0x489a72][_0xe4de('0x7b')]===_0xe4de('0x7c')?![]:!![]);_0x3008a2[_0xe4de('0x6b')](_0x431172,_0x434c0f[_0x489a72][_0xe4de('0x7d')]||_0x431172);}if(_0x4c9eea[_0xe4de('0x7e')]){_0x4c9eea[_0xe4de('0x7e')]=JSON[_0xe4de('0x7f')](_0x4c9eea['joins']);for(var _0x3e0e29=0x0;_0x3e0e29<_0x4c9eea[_0xe4de('0x7e')][_0xe4de('0x38')];_0x3e0e29+=0x1){if(_0x4c9eea['joins'][_0x3e0e29][_0xe4de('0x30')]&&_['includes'](_0x19514a,_0x4c9eea[_0xe4de('0x7e')][_0x3e0e29][_0xe4de('0x30')])&&_0x4c9eea[_0xe4de('0x7e')][_0x3e0e29][_0xe4de('0x80')]&&_0x4c9eea[_0xe4de('0x7e')][_0x3e0e29][_0xe4de('0x81')]&&_0x4c9eea['joins'][_0x3e0e29]['foreignKey']){_0x3008a2[_0x4c9eea[_0xe4de('0x7e')][_0x3e0e29][_0xe4de('0x30')]](_0x4c9eea['joins'][_0x3e0e29][_0xe4de('0x81')],null,util[_0xe4de('0x79')](_0xe4de('0x82'),_0x4c9eea[_0xe4de('0x74')],_0x4c9eea[_0xe4de('0x7e')][_0x3e0e29][_0xe4de('0x80')],_0x4c9eea['joins'][_0x3e0e29][_0xe4de('0x81')],_0x4c9eea[_0xe4de('0x7e')][_0x3e0e29]['foreignKey']));}}}if(_0x4c9eea[_0xe4de('0x83')]){_0x4c9eea[_0xe4de('0x83')]=JSON[_0xe4de('0x7f')](_0x4c9eea[_0xe4de('0x83')]);_0x3008a2[_0xe4de('0x3c')](_0x4ee4d4(_0x4c9eea['conditions'][_0xe4de('0x6a')]));}_0xde93c2=_0x3008a2[_0xe4de('0x84')]();_0x3008a2[_0xe4de('0x1d')](_0x7e84f7);_0x3008a2[_0xe4de('0x1b')](0x0);logger[_0xe4de('0x85')](_0xe4de('0x86'),_0x3008a2[_0xe4de('0x87')]());return dbH['sequelize'][_0xe4de('0x32')](_0x3008a2['toString'](),{'type':dbH[_0xe4de('0x88')][_0xe4de('0x89')][_0xe4de('0x8a')]});}})[_0xe4de('0x25')](respondWithResult(_0xac7c5,null))[_0xe4de('0x46')](handleError(_0xac7c5,null));};function runReport(_0x37ac82,_0x598b24,_0x58f787){var _0x41a2af=_0x598b24['name'];var _0x2f00e2=0xa;var _0x40f535=[_0xe4de('0x56'),'left_join',_0xe4de('0x58'),_0xe4de('0x59')];var _0x559d91={'SUM':'SUM(%s)','COUNT':_0xe4de('0x5b'),'COUNT DISTINCT':_0xe4de('0x5c'),'MAX':_0xe4de('0x5d'),'MIN':_0xe4de('0x5e'),'AVG':_0xe4de('0x5f'),'GROUP_CONCAT':_0xe4de('0x60'),'GROUP_CONCAT ASC':_0xe4de('0x61'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5098fd={'SEC_TO_TIME':_0xe4de('0x63'),'DATE':'DATE(%s)','HOUR':_0xe4de('0x8b'),'ROUND':_0xe4de('0x8c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x13aa2b=function(_0x20ce59){return!_[_0xe4de('0x66')]([_0xe4de('0x67'),_0xe4de('0x68'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x20ce59);};var _0x169817=function(_0x4649bd){if(!_0x4649bd||!_0x4649bd[_0xe4de('0x69')][_0xe4de('0x38')]){return'';}for(var _0x33040a='(',_0x28ea9f=0x0;_0x28ea9f<_0x4649bd[_0xe4de('0x69')][_0xe4de('0x38')];_0x28ea9f+=0x1){_0x28ea9f>0x0&&(_0x33040a+='\x20'+_0x4649bd[_0xe4de('0x8d')]+'\x20');_0x33040a+=_0x4649bd[_0xe4de('0x69')][_0x28ea9f][_0xe4de('0x6a')]?_0x169817(_0x4649bd[_0xe4de('0x69')][_0x28ea9f][_0xe4de('0x6a')]):_0x4649bd[_0xe4de('0x69')][_0x28ea9f][_0xe4de('0x6b')]+'\x20'+_0x4649bd[_0xe4de('0x69')][_0x28ea9f][_0xe4de('0x6c')]+(_0x13aa2b(_0x4649bd[_0xe4de('0x69')][_0x28ea9f][_0xe4de('0x6c')])?'\x20'+_0x4649bd[_0xe4de('0x69')][_0x28ea9f][_0xe4de('0x6d')]:'');}return _0x33040a+')';};var _0x42e858={'where':{'id':_0x37ac82['id']}},_0x43993b,_0x539173,_0x5cdf7d,_0x2af21a,_0x91f81b;_0x42e858=_[_0xe4de('0x40')]({},_0x42e858,_0x58f787);return db[_0xe4de('0x43')][_0xe4de('0x50')](_0x42e858)[_0xe4de('0x25')](function(_0x350611){if(_0x350611){_0x43993b=_0x350611;return _0x350611[_0xe4de('0x8e')]();}return null;})[_0xe4de('0x25')](function(_0x32a796){if(_0x32a796){if(!_0x32a796[_0xe4de('0x38')]){throw new db[(_0xe4de('0x6e'))][(_0xe4de('0x6f'))](_0xe4de('0x70'),0x193);}_0x539173=_0x32a796;return db['AnalyticMetric'][_0xe4de('0x44')]({'raw':!![]});}return null;})[_0xe4de('0x25')](function(_0x1a7417){if(_0x1a7417){_0x5cdf7d=_[_0xe4de('0x8f')](_0x1a7417,'id');var _0x37e3cd;var _0x18ca02=squel['select']();_0x18ca02['from'](_0x43993b[_0xe4de('0x74')]);for(var _0x4f6925=0x0;_0x4f6925<_0x539173[_0xe4de('0x38')];_0x4f6925+=0x1){_0x37e3cd=_0x539173[_0x4f6925]['MetricId']?_0x5cdf7d[_0x539173[_0x4f6925][_0xe4de('0x75')]]['metric']:_0x539173[_0x4f6925][_0xe4de('0x6b')];_0x37e3cd=_0x539173[_0x4f6925][_0xe4de('0x77')]?_[_0xe4de('0x78')](_0x559d91[_0x539173[_0x4f6925][_0xe4de('0x77')]],'%s',_0x37e3cd):_0x37e3cd;_0x37e3cd=_0x539173[_0x4f6925][_0xe4de('0x79')]?_[_0xe4de('0x78')](_0x5098fd[_0x539173[_0x4f6925][_0xe4de('0x79')]],'%s',_0x37e3cd):_0x37e3cd;if(_0x539173[_0x4f6925]['groupBy']){_0x18ca02[_0xe4de('0x6a')](_0x37e3cd);}_0x539173[_0x4f6925]['orderBy']&&_0x18ca02[_0xe4de('0x3a')](_0x37e3cd,_0x539173[_0x4f6925][_0xe4de('0x7b')]==='DESC'?![]:!![]);_0x18ca02[_0xe4de('0x6b')](_0x37e3cd,_0x539173[_0x4f6925][_0xe4de('0x7d')]||_0x37e3cd);}if(_0x43993b[_0xe4de('0x7e')]){_0x43993b['joins']=JSON['parse'](_0x43993b['joins']);for(var _0x4bce62=0x0;_0x4bce62<_0x43993b[_0xe4de('0x7e')][_0xe4de('0x38')];_0x4bce62+=0x1){if(_0x43993b['joins'][_0x4bce62][_0xe4de('0x30')]&&_['includes'](_0x40f535,_0x43993b[_0xe4de('0x7e')][_0x4bce62]['type'])&&_0x43993b['joins'][_0x4bce62]['parentKey']&&_0x43993b[_0xe4de('0x7e')][_0x4bce62][_0xe4de('0x81')]&&_0x43993b[_0xe4de('0x7e')][_0x4bce62][_0xe4de('0x90')]){_0x18ca02[_0x43993b['joins'][_0x4bce62][_0xe4de('0x30')]](_0x43993b[_0xe4de('0x7e')][_0x4bce62][_0xe4de('0x81')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x43993b[_0xe4de('0x74')],_0x43993b[_0xe4de('0x7e')][_0x4bce62]['parentKey'],_0x43993b[_0xe4de('0x7e')][_0x4bce62][_0xe4de('0x81')],_0x43993b[_0xe4de('0x7e')][_0x4bce62][_0xe4de('0x90')]));}}}if(_0x43993b[_0xe4de('0x83')]){_0x43993b[_0xe4de('0x83')]=JSON[_0xe4de('0x7f')](_0x43993b[_0xe4de('0x83')]);_0x18ca02[_0xe4de('0x3c')](_0x169817(_0x43993b[_0xe4de('0x83')][_0xe4de('0x6a')]));}_0x91f81b=_0x18ca02[_0xe4de('0x84')]();_0x18ca02[_0xe4de('0x1d')](_0x2f00e2);_0x18ca02[_0xe4de('0x1b')](0x0);return;}})[_0xe4de('0x25')](function(){if(_0x598b24['output']===_0xe4de('0x91')){return null;}var _0x27eca1=_[_0xe4de('0x40')](_0x598b24,{'name':_0x598b24[_0xe4de('0x92')]||_0x598b24['name']||_0x43993b[_0xe4de('0x2b')],'basename':_0x41a2af,'savename':util[_0xe4de('0x79')]('%s-%s.%s',_0x598b24['name']||_0x43993b[_0xe4de('0x2b')],require(_0xe4de('0x93'))[_0xe4de('0x94')](0x4),_0x598b24['output']||_0xe4de('0x95')),'reportId':_0x43993b['id'],'reportType':_0xe4de('0x96')});return db[_0xe4de('0x97')][_0xe4de('0x4a')](_0x27eca1,{'raw':!![]});})[_0xe4de('0x25')](function(_0x4ac93){if(_0x43993b[_0xe4de('0x74')]==='cdr'){_0x91f81b[_0xe4de('0x3c')](_0x43993b[_0xe4de('0x74')]+_0xe4de('0x98'),_0x598b24[_0xe4de('0x99')],_0x598b24[_0xe4de('0x9a')]);}else{_0x91f81b['where'](_0x43993b[_0xe4de('0x74')]+_0xe4de('0x9b'),_0x598b24[_0xe4de('0x99')],_0x598b24[_0xe4de('0x9a')]);}if(_0x4ac93){logger[_0xe4de('0x9c')]('Run\x20Query:',_0x91f81b['toString']());require(_0xe4de('0x9d'))[_0xe4de('0x9e')](path['join'](__dirname,_0xe4de('0x9f'),_0x4ac93['output']),[_0x4ac93['id'],_0x91f81b[_0xe4de('0x87')](),path[_0xe4de('0x56')](__dirname,_0xe4de('0xa0'),_0x4ac93['savename']),_0x41a2af]);return _0x4ac93;}else{var _0x35b343=squel['select']();_0x35b343['from']('('+_0x91f81b[_0xe4de('0x87')]()+')','countTable');_0x35b343[_0xe4de('0x6b')]('COUNT(*)',_0xe4de('0x1e'));_0x91f81b[_0xe4de('0x1d')](_0x598b24['limit']||_0x2f00e2);_0x91f81b[_0xe4de('0x1b')](_0x598b24['offset']||0x0);return dbH['sequelize'][_0xe4de('0x32')](_0x35b343[_0xe4de('0x87')](),{'type':dbH[_0xe4de('0x88')][_0xe4de('0x89')]['SELECT']})[_0xe4de('0x25')](function(_0xc504df){if(!_0xc504df[_0xe4de('0x38')]){_0x2af21a=0x0;}else{_0x2af21a=_0xc504df[0x0][_0xe4de('0x1e')]||0x0;}return dbH[_0xe4de('0x88')][_0xe4de('0x32')](_0x91f81b['toString'](),{'type':dbH[_0xe4de('0x88')]['QueryTypes'][_0xe4de('0x8a')]});})[_0xe4de('0x25')](function(_0x4f6a3d){return{'rows':_0x4f6a3d||[],'count':_0x2af21a};});}});}exports['run']=function(_0x268b00,_0x63b0c8){return runReport(_0x268b00[_0xe4de('0x54')],_0x268b00[_0xe4de('0x32')],_0x268b00[_0xe4de('0x41')])[_0xe4de('0x25')](respondWithResult(_0x63b0c8,null))[_0xe4de('0x46')](handleError(_0x63b0c8,null));};exports[_0xe4de('0xa1')]=runReport;exports[_0xe4de('0x32')]=function(_0x50b4f8,_0x46d8df){var _0x38926b=0xa;var _0x4b57d9=[_0xe4de('0x56'),_0xe4de('0x57'),'right_join',_0xe4de('0x59')];var _0xf5d9fd={'SUM':_0xe4de('0x5a'),'COUNT':_0xe4de('0x5b'),'COUNT DISTINCT':_0xe4de('0x5c'),'MAX':_0xe4de('0x5d'),'MIN':_0xe4de('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe4de('0x61'),'GROUP_CONCAT DESC':_0xe4de('0x62')};var _0x115a90={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xe4de('0x64'),'HOUR':_0xe4de('0x8b'),'ROUND':_0xe4de('0x8c'),'UNIX_TIMESTAMP':_0xe4de('0x65')};var _0x4527ac=function(_0x2bbb37){return!_[_0xe4de('0x66')]([_0xe4de('0x67'),_0xe4de('0x68'),_0xe4de('0xa2'),_0xe4de('0xa3')],_0x2bbb37);};var _0x1b4084=function(_0x2bc938){if(!_0x2bc938||!_0x2bc938[_0xe4de('0x69')][_0xe4de('0x38')]){return'';}for(var _0x33818b='(',_0x4e5db0=0x0;_0x4e5db0<_0x2bc938[_0xe4de('0x69')]['length'];_0x4e5db0+=0x1){_0x4e5db0>0x0&&(_0x33818b+='\x20'+_0x2bc938[_0xe4de('0x8d')]+'\x20');_0x33818b+=_0x2bc938['rules'][_0x4e5db0][_0xe4de('0x6a')]?_0x1b4084(_0x2bc938[_0xe4de('0x69')][_0x4e5db0][_0xe4de('0x6a')]):_0x2bc938[_0xe4de('0x69')][_0x4e5db0][_0xe4de('0x6b')]+'\x20'+_0x2bc938['rules'][_0x4e5db0]['condition']+(_0x4527ac(_0x2bc938[_0xe4de('0x69')][_0x4e5db0]['condition'])?'\x20'+_0x2bc938[_0xe4de('0x69')][_0x4e5db0][_0xe4de('0x6d')]:'');}return _0x33818b+')';};var _0x53a699={'where':{'id':_0x50b4f8[_0xe4de('0x54')]['id']}},_0x213c06,_0xfc17a8,_0x442946,_0x11f4fe,_0x46e2e6;_0x53a699=_[_0xe4de('0x40')]({},_0x53a699,_0x50b4f8[_0xe4de('0x41')]);return db[_0xe4de('0x43')]['find'](_0x53a699)[_0xe4de('0x25')](function(_0x12dc51){if(_0x12dc51){_0x213c06=_0x12dc51;return _0x12dc51['getFields']();}return null;})[_0xe4de('0x25')](function(_0x424809){if(_0x424809){if(!_0x424809[_0xe4de('0x38')]){throw new db['Sequelize']['ValidationErrorItem'](_0xe4de('0x70'),0x193);}_0xfc17a8=_0x424809;return db['AnalyticMetric'][_0xe4de('0x44')]({'raw':!![]});}return null;})[_0xe4de('0x25')](function(_0x1fe8f6){if(_0x1fe8f6){_0x442946=_[_0xe4de('0x8f')](_0x1fe8f6,'id');var _0x41e67f;var _0x3f7734=squel[_0xe4de('0x72')]();_0x3f7734['from'](_0x213c06[_0xe4de('0x74')]);for(var _0x4ef007=0x0;_0x4ef007<_0xfc17a8['length'];_0x4ef007+=0x1){_0x41e67f=_0xfc17a8[_0x4ef007][_0xe4de('0x75')]?_0x442946[_0xfc17a8[_0x4ef007][_0xe4de('0x75')]][_0xe4de('0x76')]:_0xfc17a8[_0x4ef007][_0xe4de('0x6b')];_0x41e67f=_0xfc17a8[_0x4ef007]['function']?_[_0xe4de('0x78')](_0xf5d9fd[_0xfc17a8[_0x4ef007][_0xe4de('0x77')]],'%s',_0x41e67f):_0x41e67f;_0x41e67f=_0xfc17a8[_0x4ef007][_0xe4de('0x79')]?_[_0xe4de('0x78')](_0x115a90[_0xfc17a8[_0x4ef007]['format']],'%s',_0x41e67f):_0x41e67f;if(_0xfc17a8[_0x4ef007]['groupBy']){_0x3f7734['group'](_0x41e67f);}_0xfc17a8[_0x4ef007]['orderBy']&&_0x3f7734[_0xe4de('0x3a')](_0x41e67f,_0xfc17a8[_0x4ef007][_0xe4de('0x7b')]==='DESC'?![]:!![]);_0x3f7734['field'](_0x41e67f,_0xfc17a8[_0x4ef007][_0xe4de('0x7d')]||_0x41e67f);}if(_0x213c06[_0xe4de('0x7e')]){_0x213c06[_0xe4de('0x7e')]=JSON[_0xe4de('0x7f')](_0x213c06[_0xe4de('0x7e')]);for(var _0x5cf01d=0x0;_0x5cf01d<_0x213c06[_0xe4de('0x7e')][_0xe4de('0x38')];_0x5cf01d+=0x1){if(_0x213c06['joins'][_0x5cf01d]['type']&&_[_0xe4de('0x66')](_0x4b57d9,_0x213c06['joins'][_0x5cf01d][_0xe4de('0x30')])&&_0x213c06[_0xe4de('0x7e')][_0x5cf01d][_0xe4de('0x80')]&&_0x213c06[_0xe4de('0x7e')][_0x5cf01d][_0xe4de('0x81')]&&_0x213c06[_0xe4de('0x7e')][_0x5cf01d]['foreignKey']){_0x3f7734[_0x213c06[_0xe4de('0x7e')][_0x5cf01d][_0xe4de('0x30')]](_0x213c06['joins'][_0x5cf01d]['foreignTable'],null,util[_0xe4de('0x79')](_0xe4de('0x82'),_0x213c06[_0xe4de('0x74')],_0x213c06[_0xe4de('0x7e')][_0x5cf01d][_0xe4de('0x80')],_0x213c06[_0xe4de('0x7e')][_0x5cf01d][_0xe4de('0x81')],_0x213c06['joins'][_0x5cf01d][_0xe4de('0x90')]));}}}if(_0x213c06[_0xe4de('0x83')]){_0x213c06[_0xe4de('0x83')]=JSON[_0xe4de('0x7f')](_0x213c06[_0xe4de('0x83')]);_0x3f7734[_0xe4de('0x3c')](_0x1b4084(_0x213c06[_0xe4de('0x83')][_0xe4de('0x6a')]));}_0x46e2e6=_0x3f7734[_0xe4de('0x84')]();_0x3f7734['limit'](_0x38926b);_0x3f7734[_0xe4de('0x1b')](0x0);logger['debug'](_0xe4de('0x86'),_0x3f7734['toString']());return dbH['sequelize'][_0xe4de('0x32')](_0x3f7734['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xe4de('0x8a')]});}})['then'](function(){return{'sql':_0x46e2e6[_0xe4de('0x87')]()};})[_0xe4de('0x25')](respondWithResult(_0x46d8df,null))[_0xe4de('0x46')](handleError(_0x46d8df,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index cc1720c..2443d4a 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 _0x6677=['exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','moment','bluebird','request-promise','./analyticCustomReport.attributes'];(function(_0x2d066d,_0x2269d7){var _0x3e41d2=function(_0x1ecc20){while(--_0x1ecc20){_0x2d066d['push'](_0x2d066d['shift']());}};_0x3e41d2(++_0x2269d7);}(_0x6677,0xa4));var _0x7667=function(_0x4ef5a1,_0x37a788){_0x4ef5a1=_0x4ef5a1-0x0;var _0x25b667=_0x6677[_0x4ef5a1];return _0x25b667;};'use strict';var _=require(_0x7667('0x0'));var util=require(_0x7667('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7667('0x2'));var BPromise=require(_0x7667('0x3'));var rp=require(_0x7667('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7667('0x5'));module[_0x7667('0x6')]=function(_0xfcfb61,_0x1b0443){return _0xfcfb61[_0x7667('0x7')](_0x7667('0x8'),attributes,{'tableName':_0x7667('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x093a=['moment','bluebird','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger'];(function(_0x4e0c31,_0x208e9f){var _0x3fd7df=function(_0x5ee817){while(--_0x5ee817){_0x4e0c31['push'](_0x4e0c31['shift']());}};_0x3fd7df(++_0x208e9f);}(_0x093a,0x1b6));var _0xa093=function(_0x456a4b,_0x51df8){_0x456a4b=_0x456a4b-0x0;var _0x42957c=_0x093a[_0x456a4b];return _0x42957c;};'use strict';var _=require(_0xa093('0x0'));var util=require('util');var logger=require(_0xa093('0x1'))('api');var moment=require(_0xa093('0x2'));var BPromise=require(_0xa093('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa093('0x4'));var config=require(_0xa093('0x5'));var attributes=require(_0xa093('0x6'));module[_0xa093('0x7')]=function(_0x4cbff8,_0x123144){return _0x4cbff8[_0xa093('0x8')](_0xa093('0x9'),attributes,{'tableName':_0xa093('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 0049906..d8c747c 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 _0xa0ca=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x46d492,_0x1c407d){var _0x41fc87=function(_0x49e5dc){while(--_0x49e5dc){_0x46d492['push'](_0x46d492['shift']());}};_0x41fc87(++_0x1c407d);}(_0xa0ca,0x6e));var _0xaa0c=function(_0xc1b9ae,_0x12c6ac){_0xc1b9ae=_0xc1b9ae-0x0;var _0x27c07e=_0xa0ca[_0xc1b9ae];return _0x27c07e;};'use strict';var _=require('lodash');var util=require(_0xaa0c('0x0'));var moment=require(_0xaa0c('0x1'));var BPromise=require('bluebird');var rs=require(_0xaa0c('0x2'));var fs=require('fs');var Redis=require(_0xaa0c('0x3'));var db=require(_0xaa0c('0x4'))['db'];var utils=require(_0xaa0c('0x5'));var logger=require(_0xaa0c('0x6'))(_0xaa0c('0x7'));var config=require('../../config/environment');var jayson=require(_0xaa0c('0x8'));var client=jayson[_0xaa0c('0x9')][_0xaa0c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34e749,_0xa11c32,_0x130d89){return new BPromise(function(_0x598371,_0x2a26a9){return client[_0xaa0c('0xb')](_0x34e749,_0x130d89)[_0xaa0c('0xc')](function(_0x434910){logger[_0xaa0c('0xd')](_0xaa0c('0xe'),_0xa11c32,_0xaa0c('0xf'));logger['debug'](_0xaa0c('0x10'),_0xa11c32,'request\x20sent',JSON[_0xaa0c('0x11')](_0x434910));if(_0x434910[_0xaa0c('0x12')]){if(_0x434910[_0xaa0c('0x12')][_0xaa0c('0x13')]===0x1f4){logger[_0xaa0c('0x12')](_0xaa0c('0xe'),_0xa11c32,_0x434910['error'][_0xaa0c('0x14')]);return _0x2a26a9(_0x434910['error'][_0xaa0c('0x14')]);}logger['error'](_0xaa0c('0xe'),_0xa11c32,_0x434910[_0xaa0c('0x12')][_0xaa0c('0x14')]);return _0x598371(_0x434910[_0xaa0c('0x12')][_0xaa0c('0x14')]);}else{logger[_0xaa0c('0xd')](_0xaa0c('0xe'),_0xa11c32,_0xaa0c('0xf'));_0x598371(_0x434910[_0xaa0c('0x15')]['message']);}})[_0xaa0c('0x16')](function(_0x181706){logger['error'](_0xaa0c('0xe'),_0xa11c32,_0x181706);_0x2a26a9(_0x181706);});});}
\ No newline at end of file
+var _0xdc46=['../../config/environment','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x14e517,_0x56cee3){var _0x52bdde=function(_0x3e7ca4){while(--_0x3e7ca4){_0x14e517['push'](_0x14e517['shift']());}};_0x52bdde(++_0x56cee3);}(_0xdc46,0xcb));var _0x6dc4=function(_0x4176c5,_0x497677){_0x4176c5=_0x4176c5-0x0;var _0x305a70=_0xdc46[_0x4176c5];return _0x305a70;};'use strict';var _=require(_0x6dc4('0x0'));var util=require(_0x6dc4('0x1'));var moment=require(_0x6dc4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6dc4('0x3'))['db'];var utils=require(_0x6dc4('0x4'));var logger=require(_0x6dc4('0x5'))(_0x6dc4('0x6'));var config=require(_0x6dc4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6dc4('0x8')][_0x6dc4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x328bd3,_0x54260a,_0x20bc90){return new BPromise(function(_0x274833,_0x394266){return client[_0x6dc4('0xa')](_0x328bd3,_0x20bc90)[_0x6dc4('0xb')](function(_0x192093){logger[_0x6dc4('0xc')](_0x6dc4('0xd'),_0x54260a,'request\x20sent');logger['debug'](_0x6dc4('0xe'),_0x54260a,_0x6dc4('0xf'),JSON['stringify'](_0x192093));if(_0x192093['error']){if(_0x192093[_0x6dc4('0x10')][_0x6dc4('0x11')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x54260a,_0x192093[_0x6dc4('0x10')][_0x6dc4('0x12')]);return _0x394266(_0x192093[_0x6dc4('0x10')][_0x6dc4('0x12')]);}logger[_0x6dc4('0x10')](_0x6dc4('0xd'),_0x54260a,_0x192093[_0x6dc4('0x10')][_0x6dc4('0x12')]);return _0x274833(_0x192093[_0x6dc4('0x10')]['message']);}else{logger[_0x6dc4('0xc')](_0x6dc4('0xd'),_0x54260a,_0x6dc4('0xf'));_0x274833(_0x192093[_0x6dc4('0x13')][_0x6dc4('0x12')]);}})[_0x6dc4('0x14')](function(_0x2f9b10){logger[_0x6dc4('0x10')](_0x6dc4('0xd'),_0x54260a,_0x2f9b10);_0x394266(_0x2f9b10);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index a4b922a..2227ea0 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 _0xd8d2=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/query','query','post'];(function(_0x169ea9,_0xf9fc24){var _0x1ab3e3=function(_0x2a2c45){while(--_0x2a2c45){_0x169ea9['push'](_0x169ea9['shift']());}};_0x1ab3e3(++_0xf9fc24);}(_0xd8d2,0xf9));var _0x2d8d=function(_0xe1fb9c,_0x264431){_0xe1fb9c=_0xe1fb9c-0x0;var _0x48b5ea=_0xd8d2[_0xe1fb9c];return _0x48b5ea;};'use strict';var multer=require(_0x2d8d('0x0'));var util=require(_0x2d8d('0x1'));var path=require(_0x2d8d('0x2'));var timeout=require(_0x2d8d('0x3'));var express=require(_0x2d8d('0x4'));var router=express[_0x2d8d('0x5')]();var fs_extra=require(_0x2d8d('0x6'));var auth=require(_0x2d8d('0x7'));var interaction=require(_0x2d8d('0x8'));var config=require(_0x2d8d('0x9'));var controller=require(_0x2d8d('0xa'));router[_0x2d8d('0xb')]('/',auth[_0x2d8d('0xc')](),controller[_0x2d8d('0xd')]);router[_0x2d8d('0xb')](_0x2d8d('0xe'),auth[_0x2d8d('0xc')](),controller[_0x2d8d('0xf')]);router[_0x2d8d('0xb')](_0x2d8d('0x10'),auth[_0x2d8d('0xc')](),controller[_0x2d8d('0x11')]);router[_0x2d8d('0xb')]('/:id/run',auth[_0x2d8d('0xc')](),controller['run']);router['get'](_0x2d8d('0x12'),auth[_0x2d8d('0xc')](),controller[_0x2d8d('0x13')]);router[_0x2d8d('0x14')]('/',auth[_0x2d8d('0xc')](),controller[_0x2d8d('0x15')]);router[_0x2d8d('0x16')](_0x2d8d('0xe'),auth[_0x2d8d('0xc')](),controller[_0x2d8d('0x17')]);router[_0x2d8d('0x18')]('/:id',auth[_0x2d8d('0xc')](),controller[_0x2d8d('0x19')]);module[_0x2d8d('0x1a')]=router;
\ No newline at end of file
+var _0x037e=['/:id/preview','preview','put','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x037e,0x136));var _0xe037=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x037e[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xe037('0x0'));var util=require(_0xe037('0x1'));var path=require(_0xe037('0x2'));var timeout=require(_0xe037('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe037('0x4'));var auth=require(_0xe037('0x5'));var interaction=require(_0xe037('0x6'));var config=require(_0xe037('0x7'));var controller=require(_0xe037('0x8'));router[_0xe037('0x9')]('/',auth[_0xe037('0xa')](),controller[_0xe037('0xb')]);router[_0xe037('0x9')](_0xe037('0xc'),auth[_0xe037('0xa')](),controller['show']);router['get'](_0xe037('0xd'),auth['isAuthenticated'](),controller[_0xe037('0xe')]);router[_0xe037('0x9')]('/:id/run',auth['isAuthenticated'](),controller['run']);router['get']('/:id/query',auth['isAuthenticated'](),controller['query']);router['post']('/',auth[_0xe037('0xa')](),controller['create']);router[_0xe037('0xf')](_0xe037('0xc'),auth[_0xe037('0xa')](),controller[_0xe037('0x10')]);router[_0xe037('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xe037('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 520bd7f..f552608 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 _0xdbf5=['exports','STRING','TEXT'];(function(_0x5e3a94,_0x234e03){var _0x25af6f=function(_0x189ed8){while(--_0x189ed8){_0x5e3a94['push'](_0x5e3a94['shift']());}};_0x25af6f(++_0x234e03);}(_0xdbf5,0x18c));var _0x5dbf=function(_0xe8a2d,_0x2a8c2d){_0xe8a2d=_0xe8a2d-0x0;var _0x1569dd=_0xdbf5[_0xe8a2d];return _0x1569dd;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5dbf('0x1')]},'table':{'type':Sequelize[_0x5dbf('0x1')]},'conditions':{'type':Sequelize[_0x5dbf('0x2')]},'joins':{'type':Sequelize[_0x5dbf('0x2')]}};
\ No newline at end of file
+var _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x46ed,0x168));var _0xd46e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x46ed[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd46e('0x2')]},'parent':{'type':Sequelize[_0xd46e('0x2')]},'table':{'type':Sequelize[_0xd46e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xd46e('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 03a2e50..b5edaa6 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 _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x1416fc,_0x72e155){var _0x3a4b34=function(_0x455ac8){while(--_0x455ac8){_0x1416fc['push'](_0x1416fc['shift']());}};_0x3a4b34(++_0x72e155);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xc4aa[_0x8c43de];return _0xa6591b;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));};
\ No newline at end of file
+var _0x3f8a=['get','DefaultReports','end','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','keys','intersection','model','attributes','fields','query','order','sort','filters','pick','filter','merge','VIRTUAL','options','where','include','findAll','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','field','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','Limited\x20Query:','sequelize','toString','SELECT','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','condition','ValidationErrorItem','metric','DESC','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','QueryTypes','run','runReport','%s.%s\x20=\x20%s.%s','debug','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then'];(function(_0x2dbe55,_0x117ce0){var _0x47687e=function(_0x5a676c){while(--_0x5a676c){_0x2dbe55['push'](_0x2dbe55['shift']());}};_0x47687e(++_0x117ce0);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x20909c,_0x3ffc7c){_0x20909c=_0x20909c-0x0;var _0x4fc341=_0x3f8a[_0x20909c];return _0x4fc341;};'use strict';var emlformat=require(_0xa3f8('0x0'));var rimraf=require(_0xa3f8('0x1'));var zipdir=require(_0xa3f8('0x2'));var jsonpatch=require(_0xa3f8('0x3'));var rp=require('request-promise');var moment=require(_0xa3f8('0x4'));var BPromise=require(_0xa3f8('0x5'));var Mustache=require(_0xa3f8('0x6'));var util=require(_0xa3f8('0x7'));var path=require(_0xa3f8('0x8'));var sox=require(_0xa3f8('0x9'));var csv=require(_0xa3f8('0xa'));var ejs=require(_0xa3f8('0xb'));var fs=require('fs');var fs_extra=require(_0xa3f8('0xc'));var _=require(_0xa3f8('0xd'));var squel=require(_0xa3f8('0xe'));var crypto=require(_0xa3f8('0xf'));var jsforce=require(_0xa3f8('0x10'));var deskjs=require(_0xa3f8('0x11'));var toCsv=require(_0xa3f8('0xa'));var querystring=require(_0xa3f8('0x12'));var Papa=require(_0xa3f8('0x13'));var Redis=require('ioredis');var authService=require(_0xa3f8('0x14'));var qs=require(_0xa3f8('0x15'));var as=require(_0xa3f8('0x16'));var hardwareService=require(_0xa3f8('0x17'));var logger=require('../../config/logger')(_0xa3f8('0x18'));var utils=require(_0xa3f8('0x19'));var config=require(_0xa3f8('0x1a'));var licenseUtil=require(_0xa3f8('0x1b'));var db=require(_0xa3f8('0x1c'))['db'];var dbH=require(_0xa3f8('0x1c'))[_0xa3f8('0x1d')];function respondWithStatusCode(_0x63de8b,_0x324aa8){_0x324aa8=_0x324aa8||0xcc;return function(_0x36b1b8){if(_0x36b1b8){return _0x63de8b[_0xa3f8('0x1e')](_0x324aa8);}return _0x63de8b[_0xa3f8('0x1f')](_0x324aa8)['end']();};}function respondWithResult(_0x2d8f74,_0xe55848){_0xe55848=_0xe55848||0xc8;return function(_0x45014f){if(_0x45014f){return _0x2d8f74[_0xa3f8('0x1f')](_0xe55848)['json'](_0x45014f);}};}function respondWithFilteredResult(_0x39c450,_0x33b98e){return function(_0x46a8d9){if(_0x46a8d9){var _0x8cd130=typeof _0x33b98e[_0xa3f8('0x20')]===_0xa3f8('0x21')&&typeof _0x33b98e[_0xa3f8('0x22')]===_0xa3f8('0x21');var _0x2cb49f=_0x46a8d9[_0xa3f8('0x23')];var _0x54b870=_0x8cd130?0x0:_0x33b98e[_0xa3f8('0x20')];var _0x5a0e18=_0x8cd130?_0x46a8d9[_0xa3f8('0x23')]:_0x33b98e[_0xa3f8('0x20')]+_0x33b98e[_0xa3f8('0x22')];var _0x46042d;if(_0x5a0e18>=_0x2cb49f){_0x5a0e18=_0x2cb49f;_0x46042d=0xc8;}else{_0x46042d=0xce;}_0x39c450['status'](_0x46042d);return _0x39c450[_0xa3f8('0x24')]('Content-Range',_0x54b870+'-'+_0x5a0e18+'/'+_0x2cb49f)[_0xa3f8('0x25')](_0x46a8d9);}return null;};}function patchUpdates(_0x58336d){return function(_0x4066bb){try{jsonpatch[_0xa3f8('0x26')](_0x4066bb,_0x58336d,!![]);}catch(_0x353daa){return BPromise[_0xa3f8('0x27')](_0x353daa);}return _0x4066bb[_0xa3f8('0x28')]();};}function saveUpdates(_0x1e5f30,_0x187352){return function(_0x490717){if(_0x490717){return _0x490717[_0xa3f8('0x29')](_0x1e5f30)['then'](function(_0x3ce57b){return _0x3ce57b;});}return null;};}function removeEntity(_0xa5a697,_0x24985a){return function(_0x37b290){if(_0x37b290){return _0x37b290[_0xa3f8('0x2a')]()[_0xa3f8('0x2b')](function(){var _0x6e3cb4=_0x37b290[_0xa3f8('0x2c')]({'plain':!![]});var _0x1e22b8=_0xa3f8('0x2d');return db['UserProfileResource'][_0xa3f8('0x2a')]({'where':{'type':_0x1e22b8,'resourceId':_0x6e3cb4['id']}})[_0xa3f8('0x2b')](function(){return _0x37b290;});})[_0xa3f8('0x2b')](function(){_0xa5a697['status'](0xcc)[_0xa3f8('0x2e')]();});}};}function handleEntityNotFound(_0x57f6be,_0xbad6a6){return function(_0x3a3746){if(!_0x3a3746){_0x57f6be[_0xa3f8('0x1e')](0x194);}return _0x3a3746;};}function handleError(_0x4ea213,_0x458824){_0x458824=_0x458824||0x1f4;return function(_0x5e69e2){logger[_0xa3f8('0x2f')](_0x5e69e2[_0xa3f8('0x30')]);if(_0x5e69e2[_0xa3f8('0x31')]){delete _0x5e69e2[_0xa3f8('0x31')];}_0x4ea213[_0xa3f8('0x1f')](_0x458824)[_0xa3f8('0x32')](_0x5e69e2);};}exports[_0xa3f8('0x33')]=function(_0x424a3e,_0x25f9f5){var _0x290a4e={},_0x6e83b0={},_0x57c465={'count':0x0,'rows':[]};var _0x4404da=_[_0xa3f8('0x34')](db[_0xa3f8('0x35')][_0xa3f8('0x36')],function(_0x3bb4b0){return{'name':_0x3bb4b0['fieldName'],'type':_0x3bb4b0[_0xa3f8('0x37')][_0xa3f8('0x38')]};});_0x6e83b0['model']=_[_0xa3f8('0x34')](_0x4404da,_0xa3f8('0x31'));_0x6e83b0['query']=_[_0xa3f8('0x39')](_0x424a3e['query']);_0x6e83b0['filters']=_[_0xa3f8('0x3a')](_0x6e83b0[_0xa3f8('0x3b')],_0x6e83b0['query']);_0x290a4e[_0xa3f8('0x3c')]=_['intersection'](_0x6e83b0[_0xa3f8('0x3b')],qs[_0xa3f8('0x3d')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x3d')]));_0x290a4e['attributes']=_0x290a4e[_0xa3f8('0x3c')]['length']?_0x290a4e[_0xa3f8('0x3c')]:_0x6e83b0['model'];if(!_0x424a3e[_0xa3f8('0x3e')]['hasOwnProperty']('nolimit')){_0x290a4e['limit']=qs[_0xa3f8('0x22')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x22')]);_0x290a4e[_0xa3f8('0x20')]=qs['offset'](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x20')]);}_0x290a4e[_0xa3f8('0x3f')]=qs[_0xa3f8('0x40')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x40')]);_0x290a4e['where']=qs[_0xa3f8('0x41')](_[_0xa3f8('0x42')](_0x424a3e[_0xa3f8('0x3e')],_0x6e83b0['filters']),_0x4404da);if(_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x43')]){_0x290a4e['where']=_[_0xa3f8('0x44')](_0x290a4e['where'],{'$or':_[_0xa3f8('0x34')](_0x4404da,function(_0x5a077c){if(_0x5a077c[_0xa3f8('0x37')]!==_0xa3f8('0x45')){var _0x9a00e7={};_0x9a00e7[_0x5a077c[_0xa3f8('0x31')]]={'$like':'%'+_0x424a3e[_0xa3f8('0x3e')]['filter']+'%'};return _0x9a00e7;}})});}_0x290a4e=_[_0xa3f8('0x44')]({},_0x290a4e,_0x424a3e[_0xa3f8('0x46')]);var _0x4db9c5={'where':_0x290a4e[_0xa3f8('0x47')]};return db['AnalyticDefaultReport'][_0xa3f8('0x23')](_0x4db9c5)[_0xa3f8('0x2b')](function(_0x1542cc){_0x57c465[_0xa3f8('0x23')]=_0x1542cc;if(_0x424a3e[_0xa3f8('0x3e')]['includeAll']){_0x290a4e[_0xa3f8('0x48')]=[{'all':!![]}];}return db[_0xa3f8('0x35')][_0xa3f8('0x49')](_0x290a4e);})[_0xa3f8('0x2b')](function(_0x337808){_0x57c465['rows']=_0x337808;return _0x57c465;})[_0xa3f8('0x2b')](respondWithFilteredResult(_0x25f9f5,_0x290a4e))[_0xa3f8('0x4a')](handleError(_0x25f9f5,null));};exports[_0xa3f8('0x4b')]=function(_0x32e371,_0x2a124b){var _0x314dba={'raw':!![],'where':{'id':_0x32e371[_0xa3f8('0x4c')]['id']}},_0x497217={};_0x497217[_0xa3f8('0x3b')]=_[_0xa3f8('0x39')](db[_0xa3f8('0x35')][_0xa3f8('0x36')]);_0x497217[_0xa3f8('0x3e')]=_['keys'](_0x32e371['query']);_0x497217['filters']=_[_0xa3f8('0x3a')](_0x497217[_0xa3f8('0x3b')],_0x497217[_0xa3f8('0x3e')]);_0x314dba[_0xa3f8('0x3c')]=_[_0xa3f8('0x3a')](_0x497217[_0xa3f8('0x3b')],qs['fields'](_0x32e371[_0xa3f8('0x3e')][_0xa3f8('0x3d')]));_0x314dba[_0xa3f8('0x3c')]=_0x314dba[_0xa3f8('0x3c')]['length']?_0x314dba[_0xa3f8('0x3c')]:_0x497217[_0xa3f8('0x3b')];if(_0x32e371[_0xa3f8('0x3e')]['includeAll']){_0x314dba['include']=[{'all':!![]}];}_0x314dba=_['merge']({},_0x314dba,_0x32e371[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')]['find'](_0x314dba)[_0xa3f8('0x2b')](handleEntityNotFound(_0x2a124b,null))[_0xa3f8('0x2b')](respondWithResult(_0x2a124b,null))[_0xa3f8('0x4a')](handleError(_0x2a124b,null));};exports[_0xa3f8('0x4d')]=function(_0x14932f,_0x3c74b5){return db[_0xa3f8('0x35')][_0xa3f8('0x4d')](_0x14932f[_0xa3f8('0x4e')],{})[_0xa3f8('0x2b')](function(_0x338554){var _0x29d8f5=_0x14932f[_0xa3f8('0x4f')][_0xa3f8('0x2c')]({'plain':!![]});if(!_0x29d8f5)throw new Error(_0xa3f8('0x50'));if(_0x29d8f5[_0xa3f8('0x51')]===_0xa3f8('0x4f')){var _0x559ae7=_0x338554['get']({'plain':!![]});var _0x1fad80=_0xa3f8('0x52');return db['UserProfileSection'][_0xa3f8('0x53')]({'where':{'name':_0x1fad80,'userProfileId':_0x29d8f5[_0xa3f8('0x54')]},'raw':!![]})[_0xa3f8('0x2b')](function(_0xaff79b){if(_0xaff79b&&_0xaff79b[_0xa3f8('0x55')]===0x0){return db[_0xa3f8('0x56')][_0xa3f8('0x4d')]({'name':_0x559ae7[_0xa3f8('0x31')],'resourceId':_0x559ae7['id'],'type':_0xa3f8('0x2d'),'sectionId':_0xaff79b['id']},{})[_0xa3f8('0x2b')](function(){return _0x338554;});}else{return _0x338554;}})[_0xa3f8('0x4a')](function(_0x3752fa){logger[_0xa3f8('0x2f')](_0xa3f8('0x57'),_0x3752fa);throw _0x3752fa;});}return _0x338554;})[_0xa3f8('0x2b')](respondWithResult(_0x3c74b5,0xc9))[_0xa3f8('0x4a')](handleError(_0x3c74b5,null));};exports['update']=function(_0x593614,_0xd0628e){if(_0x593614['body']['id']){delete _0x593614[_0xa3f8('0x4e')]['id'];}return db[_0xa3f8('0x35')][_0xa3f8('0x53')]({'where':{'id':_0x593614['params']['id']}})[_0xa3f8('0x2b')](handleEntityNotFound(_0xd0628e,null))[_0xa3f8('0x2b')](saveUpdates(_0x593614[_0xa3f8('0x4e')],null))[_0xa3f8('0x2b')](respondWithResult(_0xd0628e,null))['catch'](handleError(_0xd0628e,null));};exports[_0xa3f8('0x2a')]=function(_0x47cc0c,_0x392e1e){return db[_0xa3f8('0x35')][_0xa3f8('0x53')]({'where':{'id':_0x47cc0c['params']['id']}})['then'](handleEntityNotFound(_0x392e1e,null))[_0xa3f8('0x2b')](removeEntity(_0x392e1e,null))[_0xa3f8('0x4a')](handleError(_0x392e1e,null));};exports[_0xa3f8('0x58')]=function(_0x6ad40a,_0x48f5a6){var _0x36eac9=0xa;var _0x3478e8=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x5d7877={'SUM':_0xa3f8('0x5c'),'COUNT':_0xa3f8('0x5d'),'COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x521719={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x27de61=function(_0x356643){return!_[_0xa3f8('0x68')](['IS\x20NULL',_0xa3f8('0x69'),_0xa3f8('0x6a'),_0xa3f8('0x6b')],_0x356643);};var _0x42e3f8=function(_0x27c5aa){if(!_0x27c5aa||!_0x27c5aa[_0xa3f8('0x6c')][_0xa3f8('0x6d')]){return'';}for(var _0x4d0404='(',_0x33ea06=0x0;_0x33ea06<_0x27c5aa[_0xa3f8('0x6c')]['length'];_0x33ea06+=0x1){_0x33ea06>0x0&&(_0x4d0404+='\x20'+_0x27c5aa[_0xa3f8('0x6e')]+'\x20');_0x4d0404+=_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x6f')]?_0x42e3f8(_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x6f')]):_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x70')]+'\x20'+_0x27c5aa['rules'][_0x33ea06]['condition']+(_0x27de61(_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06]['condition'])?'\x20'+_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x71')]:'');}return _0x4d0404+')';};var _0x3ff369={'where':{'id':_0x6ad40a[_0xa3f8('0x4c')]['id']}},_0x1dba7e,_0x452e99,_0x35d4d6,_0xeca2dc,_0x14508d;_0x3ff369=_[_0xa3f8('0x44')]({},_0x3ff369,_0x6ad40a[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x3ff369)['then'](function(_0x5efdcf){if(_0x5efdcf){_0x1dba7e=_0x5efdcf;return _0x5efdcf[_0xa3f8('0x72')]();}return null;})[_0xa3f8('0x2b')](function(_0x1688ca){if(_0x1688ca){if(!_0x1688ca[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))]['ValidationErrorItem'](_0xa3f8('0x74'),0x193);}_0x452e99=_0x1688ca;return db[_0xa3f8('0x75')][_0xa3f8('0x49')]({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0x28d359){if(_0x28d359){_0x35d4d6=_[_0xa3f8('0x76')](_0x28d359,'id');var _0x3d45ae;var _0x3a2362=squel[_0xa3f8('0x77')]();_0x3a2362[_0xa3f8('0x78')](_0x1dba7e[_0xa3f8('0x79')]);for(var _0x5d4fe5=0x0;_0x5d4fe5<_0x452e99[_0xa3f8('0x6d')];_0x5d4fe5+=0x1){_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7a')]?_0x35d4d6[_0x452e99[_0x5d4fe5]['MetricId']]['metric']:_0x452e99[_0x5d4fe5][_0xa3f8('0x70')];_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7b')]?_[_0xa3f8('0x7c')](_0x5d7877[_0x452e99[_0x5d4fe5][_0xa3f8('0x7b')]],'%s',_0x3d45ae):_0x3d45ae;_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x521719[_0x452e99[_0x5d4fe5][_0xa3f8('0x7d')]],'%s',_0x3d45ae):_0x3d45ae;if(_0x452e99[_0x5d4fe5][_0xa3f8('0x7e')]){_0x3a2362['group'](_0x3d45ae);}_0x452e99[_0x5d4fe5][_0xa3f8('0x7f')]&&_0x3a2362[_0xa3f8('0x3f')](_0x3d45ae,_0x452e99[_0x5d4fe5][_0xa3f8('0x7f')]==='DESC'?![]:!![]);_0x3a2362[_0xa3f8('0x70')](_0x3d45ae,_0x452e99[_0x5d4fe5][_0xa3f8('0x80')]||_0x3d45ae);}if(_0x1dba7e['joins']){_0x1dba7e[_0xa3f8('0x81')]=JSON[_0xa3f8('0x82')](_0x1dba7e[_0xa3f8('0x81')]);for(var _0x14a5b5=0x0;_0x14a5b5<_0x1dba7e[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x14a5b5+=0x1){if(_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x3478e8,_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x37')])&&_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x83')]&&_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x84')]&&_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x85')]){_0x3a2362[_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x37')]](_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x84')],null,util[_0xa3f8('0x7d')]('%s.%s\x20=\x20%s.%s',_0x1dba7e[_0xa3f8('0x79')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x83')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x84')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5]['foreignKey']));}}}if(_0x1dba7e[_0xa3f8('0x86')]){_0x1dba7e[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x1dba7e['conditions']);_0x3a2362[_0xa3f8('0x47')](_0x42e3f8(_0x1dba7e['conditions'][_0xa3f8('0x6f')]));}_0x14508d=_0x3a2362['clone']();_0x3a2362['limit'](_0x36eac9);_0x3a2362[_0xa3f8('0x20')](0x0);logger['debug'](_0xa3f8('0x87'),_0x3a2362['toString']());return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0x3a2362[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')]['QueryTypes'][_0xa3f8('0x8a')]});}})[_0xa3f8('0x2b')](respondWithResult(_0x48f5a6,null))['catch'](handleError(_0x48f5a6,null));};function runReport(_0x3187e0,_0xd0d568,_0x3715ea){var _0x345089=_0xd0d568[_0xa3f8('0x31')];var _0x20ae51=0xa;var _0x190ce8=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x7dc5ec={'SUM':_0xa3f8('0x5c'),'COUNT':_0xa3f8('0x5d'),'COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':_0xa3f8('0x8b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2e2d99={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x599484=function(_0x24fe62){return!_[_0xa3f8('0x68')]([_0xa3f8('0x8c'),_0xa3f8('0x69'),'IS\x20EMPTY',_0xa3f8('0x6b')],_0x24fe62);};var _0x427830=function(_0x3c5091){if(!_0x3c5091||!_0x3c5091[_0xa3f8('0x6c')][_0xa3f8('0x6d')]){return'';}for(var _0x2db7dd='(',_0x12fe03=0x0;_0x12fe03<_0x3c5091[_0xa3f8('0x6c')][_0xa3f8('0x6d')];_0x12fe03+=0x1){_0x12fe03>0x0&&(_0x2db7dd+='\x20'+_0x3c5091[_0xa3f8('0x6e')]+'\x20');_0x2db7dd+=_0x3c5091[_0xa3f8('0x6c')][_0x12fe03]['group']?_0x427830(_0x3c5091[_0xa3f8('0x6c')][_0x12fe03]['group']):_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x70')]+'\x20'+_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x8d')]+(_0x599484(_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x8d')])?'\x20'+_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x71')]:'');}return _0x2db7dd+')';};var _0x4bb7dd={'where':{'id':_0x3187e0['id']}},_0x2c6efe,_0x4f9513,_0x39bd5c,_0x52fcc3,_0x2d2883;_0x4bb7dd=_['merge']({},_0x4bb7dd,_0x3715ea);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x4bb7dd)[_0xa3f8('0x2b')](function(_0xe3cc6a){if(_0xe3cc6a){_0x2c6efe=_0xe3cc6a;return _0xe3cc6a['getFields']();}return null;})[_0xa3f8('0x2b')](function(_0x3d343f){if(_0x3d343f){if(!_0x3d343f[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))][(_0xa3f8('0x8e'))](_0xa3f8('0x74'),0x193);}_0x4f9513=_0x3d343f;return db['AnalyticMetric'][_0xa3f8('0x49')]({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0xbe1a54){if(_0xbe1a54){_0x39bd5c=_[_0xa3f8('0x76')](_0xbe1a54,'id');var _0x477b0a;var _0x565a10=squel[_0xa3f8('0x77')]();_0x565a10[_0xa3f8('0x78')](_0x2c6efe['table']);for(var _0x4494a5=0x0;_0x4494a5<_0x4f9513[_0xa3f8('0x6d')];_0x4494a5+=0x1){_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7a')]?_0x39bd5c[_0x4f9513[_0x4494a5]['MetricId']][_0xa3f8('0x8f')]:_0x4f9513[_0x4494a5][_0xa3f8('0x70')];_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7b')]?_[_0xa3f8('0x7c')](_0x7dc5ec[_0x4f9513[_0x4494a5][_0xa3f8('0x7b')]],'%s',_0x477b0a):_0x477b0a;_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x2e2d99[_0x4f9513[_0x4494a5]['format']],'%s',_0x477b0a):_0x477b0a;if(_0x4f9513[_0x4494a5][_0xa3f8('0x7e')]){_0x565a10[_0xa3f8('0x6f')](_0x477b0a);}_0x4f9513[_0x4494a5]['orderBy']&&_0x565a10[_0xa3f8('0x3f')](_0x477b0a,_0x4f9513[_0x4494a5][_0xa3f8('0x7f')]===_0xa3f8('0x90')?![]:!![]);_0x565a10[_0xa3f8('0x70')](_0x477b0a,_0x4f9513[_0x4494a5][_0xa3f8('0x80')]||_0x477b0a);}if(_0x2c6efe[_0xa3f8('0x81')]){_0x2c6efe[_0xa3f8('0x81')]=JSON['parse'](_0x2c6efe[_0xa3f8('0x81')]);for(var _0x151bab=0x0;_0x151bab<_0x2c6efe[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x151bab+=0x1){if(_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x190ce8,_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x37')])&&_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x83')]&&_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignTable']&&_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x85')]){_0x565a10[_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x37')]](_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x84')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x2c6efe[_0xa3f8('0x79')],_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x83')],_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignTable'],_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignKey']));}}}if(_0x2c6efe[_0xa3f8('0x86')]){_0x2c6efe[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x2c6efe['conditions']);_0x565a10['where'](_0x427830(_0x2c6efe['conditions'][_0xa3f8('0x6f')]));}_0x2d2883=_0x565a10[_0xa3f8('0x91')]();_0x565a10[_0xa3f8('0x22')](_0x20ae51);_0x565a10[_0xa3f8('0x20')](0x0);return;}})[_0xa3f8('0x2b')](function(){if(_0xd0d568[_0xa3f8('0x92')]===_0xa3f8('0x93')){return null;}var _0x18890e=_['merge'](_0xd0d568,{'name':_0xd0d568[_0xa3f8('0x94')]||_0xd0d568[_0xa3f8('0x31')]||_0x2c6efe[_0xa3f8('0x31')],'basename':_0x345089,'savename':util['format'](_0xa3f8('0x95'),_0xd0d568[_0xa3f8('0x31')]||_0x2c6efe['name'],require(_0xa3f8('0x96'))[_0xa3f8('0x97')](0x4),_0xd0d568['output']||_0xa3f8('0x98')),'reportId':_0x2c6efe['id'],'reportType':_0xa3f8('0x99')});return db['AnalyticExtractedReport'][_0xa3f8('0x4d')](_0x18890e,{'raw':!![]});})[_0xa3f8('0x2b')](function(_0x21cc1d){if(_0x2c6efe['table']===_0xa3f8('0x9a')){_0x2d2883[_0xa3f8('0x47')](_0x2c6efe[_0xa3f8('0x79')]+_0xa3f8('0x9b'),_0xd0d568[_0xa3f8('0x9c')],_0xd0d568['endDate']);}else{_0x2d2883['where'](_0x2c6efe[_0xa3f8('0x79')]+_0xa3f8('0x9d'),_0xd0d568[_0xa3f8('0x9c')],_0xd0d568[_0xa3f8('0x9e')]);}if(_0x21cc1d){logger['info'](_0xa3f8('0x9f'),_0x2d2883[_0xa3f8('0x89')]());require(_0xa3f8('0xa0'))[_0xa3f8('0xa1')](path[_0xa3f8('0x59')](__dirname,_0xa3f8('0xa2'),_0x21cc1d[_0xa3f8('0x92')]),[_0x21cc1d['id'],_0x2d2883[_0xa3f8('0x89')](),path['join'](__dirname,_0xa3f8('0xa3'),_0x21cc1d['savename']),_0x345089]);return _0x21cc1d;}else{var _0xe9842=squel['select']();_0xe9842['from']('('+_0x2d2883[_0xa3f8('0x89')]()+')',_0xa3f8('0xa4'));_0xe9842[_0xa3f8('0x70')](_0xa3f8('0xa5'),_0xa3f8('0x23'));_0x2d2883['limit'](_0xd0d568['limit']||_0x20ae51);_0x2d2883[_0xa3f8('0x20')](_0xd0d568[_0xa3f8('0x20')]||0x0);return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0xe9842[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')]['QueryTypes'][_0xa3f8('0x8a')]})[_0xa3f8('0x2b')](function(_0x5a4f4a){if(!_0x5a4f4a['length']){_0x52fcc3=0x0;}else{_0x52fcc3=_0x5a4f4a[0x0][_0xa3f8('0x23')]||0x0;}return dbH[_0xa3f8('0x88')]['query'](_0x2d2883[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')][_0xa3f8('0xa6')][_0xa3f8('0x8a')]});})[_0xa3f8('0x2b')](function(_0x52f592){return{'rows':_0x52f592||[],'count':_0x52fcc3};});}});}exports[_0xa3f8('0xa7')]=function(_0x59026b,_0x234636){return runReport(_0x59026b[_0xa3f8('0x4c')],_0x59026b['query'],_0x59026b['options'])[_0xa3f8('0x2b')](respondWithResult(_0x234636,null))[_0xa3f8('0x4a')](handleError(_0x234636,null));};exports[_0xa3f8('0xa8')]=runReport;exports[_0xa3f8('0x3e')]=function(_0x26ec07,_0x2c9db8){var _0x18ab67=0xa;var _0x1f21a2=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x15a11c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':_0xa3f8('0x8b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x481b70={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x1f776a=function(_0x5b1527){return!_['includes']([_0xa3f8('0x8c'),_0xa3f8('0x69'),_0xa3f8('0x6a'),_0xa3f8('0x6b')],_0x5b1527);};var _0x4670cc=function(_0xfde509){if(!_0xfde509||!_0xfde509['rules']['length']){return'';}for(var _0x3d81fe='(',_0x15111a=0x0;_0x15111a<_0xfde509[_0xa3f8('0x6c')]['length'];_0x15111a+=0x1){_0x15111a>0x0&&(_0x3d81fe+='\x20'+_0xfde509[_0xa3f8('0x6e')]+'\x20');_0x3d81fe+=_0xfde509[_0xa3f8('0x6c')][_0x15111a]['group']?_0x4670cc(_0xfde509[_0xa3f8('0x6c')][_0x15111a]['group']):_0xfde509[_0xa3f8('0x6c')][_0x15111a]['field']+'\x20'+_0xfde509['rules'][_0x15111a][_0xa3f8('0x8d')]+(_0x1f776a(_0xfde509[_0xa3f8('0x6c')][_0x15111a][_0xa3f8('0x8d')])?'\x20'+_0xfde509[_0xa3f8('0x6c')][_0x15111a]['value']:'');}return _0x3d81fe+')';};var _0x2e694e={'where':{'id':_0x26ec07[_0xa3f8('0x4c')]['id']}},_0x1669be,_0x4f248f,_0x6ef1ad,_0xae3a31,_0x31d45c;_0x2e694e=_[_0xa3f8('0x44')]({},_0x2e694e,_0x26ec07[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x2e694e)[_0xa3f8('0x2b')](function(_0x529021){if(_0x529021){_0x1669be=_0x529021;return _0x529021[_0xa3f8('0x72')]();}return null;})[_0xa3f8('0x2b')](function(_0x35c498){if(_0x35c498){if(!_0x35c498[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))][(_0xa3f8('0x8e'))](_0xa3f8('0x74'),0x193);}_0x4f248f=_0x35c498;return db[_0xa3f8('0x75')]['findAll']({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0x286490){if(_0x286490){_0x6ef1ad=_['keyBy'](_0x286490,'id');var _0x16e98d;var _0x3be5c9=squel['select']();_0x3be5c9[_0xa3f8('0x78')](_0x1669be[_0xa3f8('0x79')]);for(var _0x5260e0=0x0;_0x5260e0<_0x4f248f[_0xa3f8('0x6d')];_0x5260e0+=0x1){_0x16e98d=_0x4f248f[_0x5260e0][_0xa3f8('0x7a')]?_0x6ef1ad[_0x4f248f[_0x5260e0]['MetricId']][_0xa3f8('0x8f')]:_0x4f248f[_0x5260e0][_0xa3f8('0x70')];_0x16e98d=_0x4f248f[_0x5260e0]['function']?_['replace'](_0x15a11c[_0x4f248f[_0x5260e0][_0xa3f8('0x7b')]],'%s',_0x16e98d):_0x16e98d;_0x16e98d=_0x4f248f[_0x5260e0][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x481b70[_0x4f248f[_0x5260e0]['format']],'%s',_0x16e98d):_0x16e98d;if(_0x4f248f[_0x5260e0]['groupBy']){_0x3be5c9[_0xa3f8('0x6f')](_0x16e98d);}_0x4f248f[_0x5260e0][_0xa3f8('0x7f')]&&_0x3be5c9['order'](_0x16e98d,_0x4f248f[_0x5260e0][_0xa3f8('0x7f')]==='DESC'?![]:!![]);_0x3be5c9[_0xa3f8('0x70')](_0x16e98d,_0x4f248f[_0x5260e0]['alias']||_0x16e98d);}if(_0x1669be[_0xa3f8('0x81')]){_0x1669be['joins']=JSON['parse'](_0x1669be[_0xa3f8('0x81')]);for(var _0x5ac693=0x0;_0x5ac693<_0x1669be[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x5ac693+=0x1){if(_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x1f21a2,_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')])&&_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x83')]&&_0x1669be['joins'][_0x5ac693][_0xa3f8('0x84')]&&_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x85')]){_0x3be5c9[_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')]](_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x84')],null,util[_0xa3f8('0x7d')](_0xa3f8('0xa9'),_0x1669be[_0xa3f8('0x79')],_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x83')],_0x1669be[_0xa3f8('0x81')][_0x5ac693]['foreignTable'],_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x85')]));}}}if(_0x1669be[_0xa3f8('0x86')]){_0x1669be[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x1669be[_0xa3f8('0x86')]);_0x3be5c9['where'](_0x4670cc(_0x1669be[_0xa3f8('0x86')][_0xa3f8('0x6f')]));}_0x31d45c=_0x3be5c9[_0xa3f8('0x91')]();_0x3be5c9[_0xa3f8('0x22')](_0x18ab67);_0x3be5c9[_0xa3f8('0x20')](0x0);logger[_0xa3f8('0xaa')](_0xa3f8('0x87'),_0x3be5c9[_0xa3f8('0x89')]());return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0x3be5c9[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')][_0xa3f8('0xa6')][_0xa3f8('0x8a')]});}})[_0xa3f8('0x2b')](function(){return{'sql':_0x31d45c[_0xa3f8('0x89')]()};})[_0xa3f8('0x2b')](respondWithResult(_0x2c9db8,null))[_0xa3f8('0x4a')](handleError(_0x2c9db8,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index de40f68..57c4d07 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 _0x6bf8=['path','rimraf','../../config/environment','exports','define','analytics_default_reports','lodash','util','../../config/logger','request-promise'];(function(_0x1a4df0,_0x1e150b){var _0x2a6e62=function(_0xce9ce6){while(--_0xce9ce6){_0x1a4df0['push'](_0x1a4df0['shift']());}};_0x2a6e62(++_0x1e150b);}(_0x6bf8,0x11e));var _0x86bf=function(_0x3fb256,_0xa066af){_0x3fb256=_0x3fb256-0x0;var _0x1ca90f=_0x6bf8[_0x3fb256];return _0x1ca90f;};'use strict';var _=require(_0x86bf('0x0'));var util=require(_0x86bf('0x1'));var logger=require(_0x86bf('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x86bf('0x3'));var fs=require('fs');var path=require(_0x86bf('0x4'));var rimraf=require(_0x86bf('0x5'));var config=require(_0x86bf('0x6'));var attributes=require('./analyticDefaultReport.attributes');module[_0x86bf('0x7')]=function(_0x597504,_0x5ce2da){return _0x597504[_0x86bf('0x8')]('AnalyticDefaultReport',attributes,{'tableName':_0x86bf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xae8d=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport'];(function(_0xb4564c,_0x4fcb88){var _0x4e8dab=function(_0x32be0a){while(--_0x32be0a){_0xb4564c['push'](_0xb4564c['shift']());}};_0x4e8dab(++_0x4fcb88);}(_0xae8d,0x180));var _0xdae8=function(_0x4fda04,_0x503892){_0x4fda04=_0x4fda04-0x0;var _0x1d98f9=_0xae8d[_0x4fda04];return _0x1d98f9;};'use strict';var _=require(_0xdae8('0x0'));var util=require(_0xdae8('0x1'));var logger=require('../../config/logger')(_0xdae8('0x2'));var moment=require(_0xdae8('0x3'));var BPromise=require(_0xdae8('0x4'));var rp=require(_0xdae8('0x5'));var fs=require('fs');var path=require(_0xdae8('0x6'));var rimraf=require(_0xdae8('0x7'));var config=require('../../config/environment');var attributes=require(_0xdae8('0x8'));module[_0xdae8('0x9')]=function(_0x22a0d9,_0x108987){return _0x22a0d9[_0xdae8('0xa')](_0xdae8('0xb'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 7115e1c..0fc027d 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 _0xdf4c=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0xa56c32,_0x2ecb4a){var _0x245d51=function(_0x530c85){while(--_0x530c85){_0xa56c32['push'](_0xa56c32['shift']());}};_0x245d51(++_0x2ecb4a);}(_0xdf4c,0x15f));var _0xcdf4=function(_0x1f6835,_0xff3520){_0x1f6835=_0x1f6835-0x0;var _0x10aee2=_0xdf4c[_0x1f6835];return _0x10aee2;};'use strict';var _=require(_0xcdf4('0x0'));var util=require(_0xcdf4('0x1'));var moment=require(_0xcdf4('0x2'));var BPromise=require(_0xcdf4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcdf4('0x4'));var db=require(_0xcdf4('0x5'))['db'];var utils=require(_0xcdf4('0x6'));var logger=require(_0xcdf4('0x7'))('rpc');var config=require(_0xcdf4('0x8'));var jayson=require(_0xcdf4('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5e060a,_0x26c77d,_0x589122){return new BPromise(function(_0x23b25c,_0x9fc8d6){return client[_0xcdf4('0xa')](_0x5e060a,_0x589122)[_0xcdf4('0xb')](function(_0x22dead){logger[_0xcdf4('0xc')](_0xcdf4('0xd'),_0x26c77d,_0xcdf4('0xe'));logger[_0xcdf4('0xf')](_0xcdf4('0x10'),_0x26c77d,'request\x20sent',JSON[_0xcdf4('0x11')](_0x22dead));if(_0x22dead[_0xcdf4('0x12')]){if(_0x22dead[_0xcdf4('0x12')]['code']===0x1f4){logger[_0xcdf4('0x12')](_0xcdf4('0xd'),_0x26c77d,_0x22dead[_0xcdf4('0x12')]['message']);return _0x9fc8d6(_0x22dead[_0xcdf4('0x12')][_0xcdf4('0x13')]);}logger[_0xcdf4('0x12')](_0xcdf4('0xd'),_0x26c77d,_0x22dead[_0xcdf4('0x12')][_0xcdf4('0x13')]);return _0x23b25c(_0x22dead[_0xcdf4('0x12')][_0xcdf4('0x13')]);}else{logger[_0xcdf4('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x26c77d,'request\x20sent');_0x23b25c(_0x22dead[_0xcdf4('0x14')][_0xcdf4('0x13')]);}})['catch'](function(_0x839b57){logger[_0xcdf4('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x26c77d,_0x839b57);_0x9fc8d6(_0x839b57);});});}
\ No newline at end of file
+var _0x31b7=['message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4bfb4d,_0x404c40){var _0x3488f2=function(_0x204c9e){while(--_0x204c9e){_0x4bfb4d['push'](_0x4bfb4d['shift']());}};_0x3488f2(++_0x404c40);}(_0x31b7,0x13a));var _0x731b=function(_0xc51c1e,_0x495721){_0xc51c1e=_0xc51c1e-0x0;var _0x808ca7=_0x31b7[_0xc51c1e];return _0x808ca7;};'use strict';var _=require(_0x731b('0x0'));var util=require(_0x731b('0x1'));var moment=require('moment');var BPromise=require(_0x731b('0x2'));var rs=require(_0x731b('0x3'));var fs=require('fs');var Redis=require(_0x731b('0x4'));var db=require(_0x731b('0x5'))['db'];var utils=require(_0x731b('0x6'));var logger=require(_0x731b('0x7'))(_0x731b('0x8'));var config=require(_0x731b('0x9'));var jayson=require(_0x731b('0xa'));var client=jayson[_0x731b('0xb')][_0x731b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c010c,_0x34fb96,_0xe250b1){return new BPromise(function(_0x16b18e,_0x259659){return client[_0x731b('0xd')](_0x4c010c,_0xe250b1)[_0x731b('0xe')](function(_0x540e47){logger[_0x731b('0xf')](_0x731b('0x10'),_0x34fb96,_0x731b('0x11'));logger[_0x731b('0x12')](_0x731b('0x13'),_0x34fb96,_0x731b('0x11'),JSON[_0x731b('0x14')](_0x540e47));if(_0x540e47[_0x731b('0x15')]){if(_0x540e47[_0x731b('0x15')]['code']===0x1f4){logger[_0x731b('0x15')](_0x731b('0x10'),_0x34fb96,_0x540e47[_0x731b('0x15')]['message']);return _0x259659(_0x540e47['error'][_0x731b('0x16')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x34fb96,_0x540e47[_0x731b('0x15')][_0x731b('0x16')]);return _0x16b18e(_0x540e47[_0x731b('0x15')][_0x731b('0x16')]);}else{logger[_0x731b('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x34fb96,_0x731b('0x11'));_0x16b18e(_0x540e47['result'][_0x731b('0x16')]);}})[_0x731b('0x17')](function(_0x4fccc3){logger[_0x731b('0x15')](_0x731b('0x10'),_0x34fb96,_0x4fccc3);_0x259659(_0x4fccc3);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 85880bc..9d400fd 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 _0xad7c=['delete','destroy','exports','path','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/preview','preview','/:id/run','run','/:id/query','create','put','update'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xad7c,0xae));var _0xcad7=function(_0x17da18,_0x2563e5){_0x17da18=_0x17da18-0x0;var _0x501192=_0xad7c[_0x17da18];return _0x501192;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcad7('0x0'));var timeout=require('connect-timeout');var express=require(_0xcad7('0x1'));var router=express['Router']();var fs_extra=require(_0xcad7('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xcad7('0x3'));var config=require(_0xcad7('0x4'));var controller=require('./analyticDefaultReport.controller');router[_0xcad7('0x5')]('/',auth[_0xcad7('0x6')](),controller['index']);router[_0xcad7('0x5')](_0xcad7('0x7'),auth['isAuthenticated'](),controller['show']);router['get'](_0xcad7('0x8'),auth[_0xcad7('0x6')](),controller[_0xcad7('0x9')]);router[_0xcad7('0x5')](_0xcad7('0xa'),auth[_0xcad7('0x6')](),controller[_0xcad7('0xb')]);router[_0xcad7('0x5')](_0xcad7('0xc'),auth[_0xcad7('0x6')](),controller['query']);router['post']('/',auth[_0xcad7('0x6')](),controller[_0xcad7('0xd')]);router[_0xcad7('0xe')](_0xcad7('0x7'),auth[_0xcad7('0x6')](),controller[_0xcad7('0xf')]);router[_0xcad7('0x10')](_0xcad7('0x7'),auth['isAuthenticated'](),controller[_0xcad7('0x11')]);module[_0xcad7('0x12')]=router;
\ No newline at end of file
+var _0xd39b=['preview','/:id/run','run','/:id/query','post','create','put','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview'];(function(_0x1c1509,_0x2dfa81){var _0xf11b7=function(_0x17949e){while(--_0x17949e){_0x1c1509['push'](_0x1c1509['shift']());}};_0xf11b7(++_0x2dfa81);}(_0xd39b,0x181));var _0xbd39=function(_0x267df9,_0x58a4a7){_0x267df9=_0x267df9-0x0;var _0x4054a1=_0xd39b[_0x267df9];return _0x4054a1;};'use strict';var multer=require(_0xbd39('0x0'));var util=require('util');var path=require(_0xbd39('0x1'));var timeout=require(_0xbd39('0x2'));var express=require(_0xbd39('0x3'));var router=express['Router']();var fs_extra=require(_0xbd39('0x4'));var auth=require(_0xbd39('0x5'));var interaction=require(_0xbd39('0x6'));var config=require('../../config/environment');var controller=require(_0xbd39('0x7'));router[_0xbd39('0x8')]('/',auth[_0xbd39('0x9')](),controller[_0xbd39('0xa')]);router['get'](_0xbd39('0xb'),auth['isAuthenticated'](),controller[_0xbd39('0xc')]);router[_0xbd39('0x8')](_0xbd39('0xd'),auth[_0xbd39('0x9')](),controller[_0xbd39('0xe')]);router[_0xbd39('0x8')](_0xbd39('0xf'),auth[_0xbd39('0x9')](),controller[_0xbd39('0x10')]);router[_0xbd39('0x8')](_0xbd39('0x11'),auth[_0xbd39('0x9')](),controller['query']);router[_0xbd39('0x12')]('/',auth[_0xbd39('0x9')](),controller[_0xbd39('0x13')]);router[_0xbd39('0x14')](_0xbd39('0xb'),auth[_0xbd39('0x9')](),controller['update']);router['delete'](_0xbd39('0xb'),auth[_0xbd39('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index a7a7def..88b76df 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 _0xbb1f=['scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','pdf','xlsx','csv','DATE','manual'];(function(_0xca1f0e,_0x2713d5){var _0x35e4ef=function(_0x44c40f){while(--_0x44c40f){_0xca1f0e['push'](_0xca1f0e['shift']());}};_0x35e4ef(++_0x2713d5);}(_0xbb1f,0x1bd));var _0xfbb1=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xbb1f[_0x3b0731];return _0x4204d7;};'use strict';var Sequelize=require(_0xfbb1('0x0'));var moment=require(_0xfbb1('0x1'));module[_0xfbb1('0x2')]={'name':{'type':Sequelize[_0xfbb1('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xfbb1('0x4')]('csv',_0xfbb1('0x5'),_0xfbb1('0x6')),'allowNull':![],'defaultValue':_0xfbb1('0x7')},'savename':{'type':Sequelize[_0xfbb1('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xfbb1('0x8')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xfbb1('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xfbb1('0x4')](_0xfbb1('0x9'),_0xfbb1('0xa')),'allowNull':![],'defaultValue':_0xfbb1('0x9')},'reportId':{'type':Sequelize[_0xfbb1('0xb')](0xb)[_0xfbb1('0xc')]},'reportType':{'type':Sequelize[_0xfbb1('0x3')]}};
\ No newline at end of file
+var _0xf660=['ENUM','csv','pdf','DATE','Loading','scheduled','manual','INTEGER','UNSIGNED','moment','STRING'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0xf660,0x106));var _0x0f66=function(_0x4843f9,_0x4af459){_0x4843f9=_0x4843f9-0x0;var _0x193c6a=_0xf660[_0x4843f9];return _0x193c6a;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0f66('0x0'));module['exports']={'name':{'type':Sequelize[_0x0f66('0x1')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x0f66('0x2')](_0x0f66('0x3'),_0x0f66('0x4'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x0f66('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x0f66('0x5')]},'endDate':{'type':Sequelize[_0x0f66('0x5')]},'status':{'type':Sequelize[_0x0f66('0x1')],'defaultValue':_0x0f66('0x6')},'type':{'type':Sequelize[_0x0f66('0x2')]('manual',_0x0f66('0x7')),'allowNull':![],'defaultValue':_0x0f66('0x8')},'reportId':{'type':Sequelize[_0x0f66('0x9')](0xb)[_0x0f66('0xa')]},'reportType':{'type':Sequelize[_0x0f66('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 4562250..7288968 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 _0xb4f9=['api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','ExtractedReports','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','AnalyticExtractedReport','findAll','rows','catch','params','length','includeAll','options','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','output','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','savename','format','%s.%s','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb4f9,0xab));var _0x9b4f=function(_0x3758dd,_0x3608b9){_0x3758dd=_0x3758dd-0x0;var _0x16ba2f=_0xb4f9[_0x3758dd];return _0x16ba2f;};'use strict';var emlformat=require(_0x9b4f('0x0'));var rimraf=require(_0x9b4f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9b4f('0x2'));var rp=require(_0x9b4f('0x3'));var moment=require(_0x9b4f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9b4f('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9b4f('0x6'));var ejs=require(_0x9b4f('0x7'));var fs=require('fs');var fs_extra=require(_0x9b4f('0x8'));var _=require(_0x9b4f('0x9'));var squel=require(_0x9b4f('0xa'));var crypto=require(_0x9b4f('0xb'));var jsforce=require(_0x9b4f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9b4f('0x6'));var querystring=require(_0x9b4f('0xd'));var Papa=require(_0x9b4f('0xe'));var Redis=require(_0x9b4f('0xf'));var authService=require(_0x9b4f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9b4f('0x11'));var hardwareService=require(_0x9b4f('0x12'));var logger=require('../../config/logger')(_0x9b4f('0x13'));var utils=require(_0x9b4f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9b4f('0x15'));var db=require(_0x9b4f('0x16'))['db'];function respondWithStatusCode(_0x450757,_0x5a8f54){_0x5a8f54=_0x5a8f54||0xcc;return function(_0x3323d6){if(_0x3323d6){return _0x450757[_0x9b4f('0x17')](_0x5a8f54);}return _0x450757['status'](_0x5a8f54)[_0x9b4f('0x18')]();};}function respondWithResult(_0x15b944,_0x2fa2cc){_0x2fa2cc=_0x2fa2cc||0xc8;return function(_0x2f2b61){if(_0x2f2b61){return _0x15b944[_0x9b4f('0x19')](_0x2fa2cc)[_0x9b4f('0x1a')](_0x2f2b61);}};}function respondWithFilteredResult(_0x819243,_0xf409cd){return function(_0x1f2263){if(_0x1f2263){var _0x381bad=typeof _0xf409cd[_0x9b4f('0x1b')]==='undefined'&&typeof _0xf409cd[_0x9b4f('0x1c')]===_0x9b4f('0x1d');var _0xfd6ea3=_0x1f2263['count'];var _0x17f07c=_0x381bad?0x0:_0xf409cd[_0x9b4f('0x1b')];var _0x4052a8=_0x381bad?_0x1f2263[_0x9b4f('0x1e')]:_0xf409cd[_0x9b4f('0x1b')]+_0xf409cd[_0x9b4f('0x1c')];var _0xc0d6d9;if(_0x4052a8>=_0xfd6ea3){_0x4052a8=_0xfd6ea3;_0xc0d6d9=0xc8;}else{_0xc0d6d9=0xce;}_0x819243[_0x9b4f('0x19')](_0xc0d6d9);return _0x819243['set'](_0x9b4f('0x1f'),_0x17f07c+'-'+_0x4052a8+'/'+_0xfd6ea3)['json'](_0x1f2263);}return null;};}function patchUpdates(_0x887388){return function(_0x2e98cf){try{jsonpatch[_0x9b4f('0x20')](_0x2e98cf,_0x887388,!![]);}catch(_0x7d1fef){return BPromise[_0x9b4f('0x21')](_0x7d1fef);}return _0x2e98cf[_0x9b4f('0x22')]();};}function saveUpdates(_0x427ea1,_0x161ffe){return function(_0x2d42ff){if(_0x2d42ff){return _0x2d42ff[_0x9b4f('0x23')](_0x427ea1)[_0x9b4f('0x24')](function(_0x4b16c7){return _0x4b16c7;});}return null;};}function removeEntity(_0x2e5583,_0x2221a4){return function(_0x205912){if(_0x205912){return _0x205912[_0x9b4f('0x25')]()[_0x9b4f('0x24')](function(){var _0x4cfca6=_0x205912['get']({'plain':!![]});var _0x4fdbb6=_0x9b4f('0x26');return db['UserProfileResource'][_0x9b4f('0x25')]({'where':{'type':_0x4fdbb6,'resourceId':_0x4cfca6['id']}})[_0x9b4f('0x24')](function(){return _0x205912;});})[_0x9b4f('0x24')](function(){_0x2e5583['status'](0xcc)[_0x9b4f('0x18')]();});}};}function handleEntityNotFound(_0x177612,_0x44d0ff){return function(_0x460382){if(!_0x460382){_0x177612[_0x9b4f('0x17')](0x194);}return _0x460382;};}function handleError(_0x4293a4,_0xc1c8fa){_0xc1c8fa=_0xc1c8fa||0x1f4;return function(_0x2bd532){logger[_0x9b4f('0x27')](_0x2bd532[_0x9b4f('0x28')]);if(_0x2bd532[_0x9b4f('0x29')]){delete _0x2bd532[_0x9b4f('0x29')];}_0x4293a4['status'](_0xc1c8fa)[_0x9b4f('0x2a')](_0x2bd532);};}exports[_0x9b4f('0x2b')]=function(_0x401d2d,_0x433017){var _0x403424={},_0x511088={},_0x8450d0={'count':0x0,'rows':[]};var _0x267fb5=_[_0x9b4f('0x2c')](db['AnalyticExtractedReport'][_0x9b4f('0x2d')],function(_0xf97538){return{'name':_0xf97538[_0x9b4f('0x2e')],'type':_0xf97538[_0x9b4f('0x2f')][_0x9b4f('0x30')]};});_0x511088[_0x9b4f('0x31')]=_[_0x9b4f('0x2c')](_0x267fb5,_0x9b4f('0x29'));_0x511088[_0x9b4f('0x32')]=_[_0x9b4f('0x33')](_0x401d2d[_0x9b4f('0x32')]);_0x511088['filters']=_[_0x9b4f('0x34')](_0x511088[_0x9b4f('0x31')],_0x511088[_0x9b4f('0x32')]);_0x403424[_0x9b4f('0x35')]=_['intersection'](_0x511088[_0x9b4f('0x31')],qs[_0x9b4f('0x36')](_0x401d2d[_0x9b4f('0x32')][_0x9b4f('0x36')]));_0x403424[_0x9b4f('0x35')]=_0x403424['attributes']['length']?_0x403424[_0x9b4f('0x35')]:_0x511088[_0x9b4f('0x31')];if(!_0x401d2d[_0x9b4f('0x32')]['hasOwnProperty'](_0x9b4f('0x37'))){_0x403424[_0x9b4f('0x1c')]=qs[_0x9b4f('0x1c')](_0x401d2d['query'][_0x9b4f('0x1c')]);_0x403424[_0x9b4f('0x1b')]=qs[_0x9b4f('0x1b')](_0x401d2d[_0x9b4f('0x32')]['offset']);}_0x403424[_0x9b4f('0x38')]=qs[_0x9b4f('0x39')](_0x401d2d[_0x9b4f('0x32')][_0x9b4f('0x39')]);_0x403424[_0x9b4f('0x3a')]=qs[_0x9b4f('0x3b')](_[_0x9b4f('0x3c')](_0x401d2d[_0x9b4f('0x32')],_0x511088[_0x9b4f('0x3b')]),_0x267fb5);if(_0x401d2d['query'][_0x9b4f('0x3d')]){_0x403424[_0x9b4f('0x3a')]=_[_0x9b4f('0x3e')](_0x403424[_0x9b4f('0x3a')],{'$or':_['map'](_0x267fb5,function(_0x309c5a){if(_0x309c5a['type']!==_0x9b4f('0x3f')){var _0x461892={};_0x461892[_0x309c5a['name']]={'$like':'%'+_0x401d2d[_0x9b4f('0x32')][_0x9b4f('0x3d')]+'%'};return _0x461892;}})});}_0x403424=_[_0x9b4f('0x3e')]({},_0x403424,_0x401d2d['options']);var _0x4e0c27={'where':_0x403424[_0x9b4f('0x3a')]};return db[_0x9b4f('0x40')][_0x9b4f('0x1e')](_0x4e0c27)[_0x9b4f('0x24')](function(_0x4dbfa6){_0x8450d0[_0x9b4f('0x1e')]=_0x4dbfa6;if(_0x401d2d[_0x9b4f('0x32')]['includeAll']){_0x403424['include']=[{'all':!![]}];}return db[_0x9b4f('0x40')][_0x9b4f('0x41')](_0x403424);})[_0x9b4f('0x24')](function(_0x295a47){_0x8450d0[_0x9b4f('0x42')]=_0x295a47;return _0x8450d0;})[_0x9b4f('0x24')](respondWithFilteredResult(_0x433017,_0x403424))[_0x9b4f('0x43')](handleError(_0x433017,null));};exports['show']=function(_0x30ac62,_0x311bae){var _0xb635e3={'raw':!![],'where':{'id':_0x30ac62[_0x9b4f('0x44')]['id']}},_0x345ca4={};_0x345ca4[_0x9b4f('0x31')]=_['keys'](db[_0x9b4f('0x40')][_0x9b4f('0x2d')]);_0x345ca4[_0x9b4f('0x32')]=_['keys'](_0x30ac62[_0x9b4f('0x32')]);_0x345ca4[_0x9b4f('0x3b')]=_['intersection'](_0x345ca4['model'],_0x345ca4['query']);_0xb635e3[_0x9b4f('0x35')]=_[_0x9b4f('0x34')](_0x345ca4[_0x9b4f('0x31')],qs[_0x9b4f('0x36')](_0x30ac62['query']['fields']));_0xb635e3[_0x9b4f('0x35')]=_0xb635e3[_0x9b4f('0x35')][_0x9b4f('0x45')]?_0xb635e3['attributes']:_0x345ca4[_0x9b4f('0x31')];if(_0x30ac62[_0x9b4f('0x32')][_0x9b4f('0x46')]){_0xb635e3['include']=[{'all':!![]}];}_0xb635e3=_[_0x9b4f('0x3e')]({},_0xb635e3,_0x30ac62[_0x9b4f('0x47')]);return db[_0x9b4f('0x40')]['find'](_0xb635e3)['then'](handleEntityNotFound(_0x311bae,null))[_0x9b4f('0x24')](respondWithResult(_0x311bae,null))['catch'](handleError(_0x311bae,null));};exports['create']=function(_0x15887d,_0x567fdd){return db[_0x9b4f('0x40')]['create'](_0x15887d[_0x9b4f('0x48')],{})[_0x9b4f('0x24')](function(_0x51caf3){var _0x16dd56=_0x15887d[_0x9b4f('0x49')][_0x9b4f('0x4a')]({'plain':!![]});if(!_0x16dd56)throw new Error(_0x9b4f('0x4b'));if(_0x16dd56[_0x9b4f('0x4c')]===_0x9b4f('0x49')){var _0x40e9f7=_0x51caf3[_0x9b4f('0x4a')]({'plain':!![]});var _0x5dfa55=_0x9b4f('0x26');return db['UserProfileSection'][_0x9b4f('0x4d')]({'where':{'name':_0x5dfa55,'userProfileId':_0x16dd56[_0x9b4f('0x4e')]},'raw':!![]})[_0x9b4f('0x24')](function(_0xda8690){if(_0xda8690&&_0xda8690[_0x9b4f('0x4f')]===0x0){return db[_0x9b4f('0x50')]['create']({'name':_0x40e9f7['name'],'resourceId':_0x40e9f7['id'],'type':_0xda8690[_0x9b4f('0x29')],'sectionId':_0xda8690['id']},{})[_0x9b4f('0x24')](function(){return _0x51caf3;});}else{return _0x51caf3;}})[_0x9b4f('0x43')](function(_0x20de80){logger[_0x9b4f('0x27')](_0x9b4f('0x51'),_0x20de80);throw _0x20de80;});}return _0x51caf3;})[_0x9b4f('0x24')](respondWithResult(_0x567fdd,0xc9))[_0x9b4f('0x43')](handleError(_0x567fdd,null));};exports[_0x9b4f('0x23')]=function(_0x85fcc9,_0x3c1547){if(_0x85fcc9['body']['id']){delete _0x85fcc9[_0x9b4f('0x48')]['id'];}return db[_0x9b4f('0x40')][_0x9b4f('0x4d')]({'where':{'id':_0x85fcc9[_0x9b4f('0x44')]['id']}})['then'](handleEntityNotFound(_0x3c1547,null))[_0x9b4f('0x24')](saveUpdates(_0x85fcc9[_0x9b4f('0x48')],null))[_0x9b4f('0x24')](respondWithResult(_0x3c1547,null))[_0x9b4f('0x43')](handleError(_0x3c1547,null));};exports['destroy']=function(_0x6df832,_0xf1c9b7){return db['AnalyticExtractedReport'][_0x9b4f('0x4d')]({'where':{'id':_0x6df832[_0x9b4f('0x44')]['id']}})[_0x9b4f('0x24')](handleEntityNotFound(_0xf1c9b7,null))['then'](removeEntity(_0xf1c9b7,null))['catch'](handleError(_0xf1c9b7,null));};exports['download']=function(_0x23c57f,_0x27b3fe,_0x407b66){return db[_0x9b4f('0x40')][_0x9b4f('0x4d')]({'where':{'id':_0x23c57f[_0x9b4f('0x44')]['id']},'attributes':['name',_0x9b4f('0x52'),'savename',_0x9b4f('0x53')],'raw':!![]})[_0x9b4f('0x24')](handleEntityNotFound(_0x27b3fe,null))[_0x9b4f('0x24')](function(_0x41ac22){if(_0x41ac22){if(!fs['existsSync'](path[_0x9b4f('0x54')](config[_0x9b4f('0x55')],_0x9b4f('0x56'),_0x41ac22['savename']))){throw new db[(_0x9b4f('0x57'))][(_0x9b4f('0x58'))](_0x9b4f('0x59'));}if(_0x23c57f[_0x9b4f('0x32')][_0x9b4f('0x5a')]){return _0x27b3fe['sendStatus'](0xc8);}return _0x27b3fe['download'](path[_0x9b4f('0x54')](config[_0x9b4f('0x55')],_0x9b4f('0x56'),_0x41ac22[_0x9b4f('0x5b')]),util[_0x9b4f('0x5c')](_0x9b4f('0x5d'),_0x41ac22[_0x9b4f('0x52')]||_0x41ac22[_0x9b4f('0x29')],_0x41ac22[_0x9b4f('0x53')][_0x9b4f('0x5e')]()));}})['catch'](handleError(_0x27b3fe,null));};
\ No newline at end of file
+var _0x3e28=['name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','error','download','basename','output','existsSync','join','server/files/reports','Sequelize','ValidationError','exists','root','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','stack'];(function(_0xc7fbe7,_0x553b01){var _0x7c4e0c=function(_0x228441){while(--_0x228441){_0xc7fbe7['push'](_0xc7fbe7['shift']());}};_0x7c4e0c(++_0x553b01);}(_0x3e28,0x14a));var _0x83e2=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x3e28[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require(_0x83e2('0x0'));var rimraf=require(_0x83e2('0x1'));var zipdir=require(_0x83e2('0x2'));var jsonpatch=require(_0x83e2('0x3'));var rp=require(_0x83e2('0x4'));var moment=require(_0x83e2('0x5'));var BPromise=require(_0x83e2('0x6'));var Mustache=require(_0x83e2('0x7'));var util=require('util');var path=require('path');var sox=require(_0x83e2('0x8'));var csv=require(_0x83e2('0x9'));var ejs=require(_0x83e2('0xa'));var fs=require('fs');var fs_extra=require(_0x83e2('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x83e2('0xc'));var jsforce=require(_0x83e2('0xd'));var deskjs=require(_0x83e2('0xe'));var toCsv=require(_0x83e2('0x9'));var querystring=require(_0x83e2('0xf'));var Papa=require(_0x83e2('0x10'));var Redis=require(_0x83e2('0x11'));var authService=require(_0x83e2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x83e2('0x13'));var hardwareService=require(_0x83e2('0x14'));var logger=require(_0x83e2('0x15'))('api');var utils=require(_0x83e2('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x160a0d,_0x26dfce){_0x26dfce=_0x26dfce||0xcc;return function(_0x53a340){if(_0x53a340){return _0x160a0d[_0x83e2('0x17')](_0x26dfce);}return _0x160a0d[_0x83e2('0x18')](_0x26dfce)[_0x83e2('0x19')]();};}function respondWithResult(_0x5606b6,_0x3b2f99){_0x3b2f99=_0x3b2f99||0xc8;return function(_0x3f50ef){if(_0x3f50ef){return _0x5606b6[_0x83e2('0x18')](_0x3b2f99)[_0x83e2('0x1a')](_0x3f50ef);}};}function respondWithFilteredResult(_0xd8d6ca,_0xd40fc8){return function(_0x2e6c37){if(_0x2e6c37){var _0x38e9f6=typeof _0xd40fc8[_0x83e2('0x1b')]==='undefined'&&typeof _0xd40fc8['limit']===_0x83e2('0x1c');var _0x3466db=_0x2e6c37[_0x83e2('0x1d')];var _0xcb2c5e=_0x38e9f6?0x0:_0xd40fc8[_0x83e2('0x1b')];var _0x4565e5=_0x38e9f6?_0x2e6c37[_0x83e2('0x1d')]:_0xd40fc8[_0x83e2('0x1b')]+_0xd40fc8[_0x83e2('0x1e')];var _0x3a4c6f;if(_0x4565e5>=_0x3466db){_0x4565e5=_0x3466db;_0x3a4c6f=0xc8;}else{_0x3a4c6f=0xce;}_0xd8d6ca['status'](_0x3a4c6f);return _0xd8d6ca[_0x83e2('0x1f')]('Content-Range',_0xcb2c5e+'-'+_0x4565e5+'/'+_0x3466db)['json'](_0x2e6c37);}return null;};}function patchUpdates(_0x44593f){return function(_0x4f4d2d){try{jsonpatch[_0x83e2('0x20')](_0x4f4d2d,_0x44593f,!![]);}catch(_0x10686d){return BPromise[_0x83e2('0x21')](_0x10686d);}return _0x4f4d2d[_0x83e2('0x22')]();};}function saveUpdates(_0x3839ad,_0x22ff35){return function(_0x5c42fa){if(_0x5c42fa){return _0x5c42fa[_0x83e2('0x23')](_0x3839ad)[_0x83e2('0x24')](function(_0x2257c4){return _0x2257c4;});}return null;};}function removeEntity(_0x2add80,_0x2f3a5f){return function(_0x1d4db3){if(_0x1d4db3){return _0x1d4db3[_0x83e2('0x25')]()[_0x83e2('0x24')](function(){var _0x2d293d=_0x1d4db3[_0x83e2('0x26')]({'plain':!![]});var _0x2b52a4=_0x83e2('0x27');return db[_0x83e2('0x28')][_0x83e2('0x25')]({'where':{'type':_0x2b52a4,'resourceId':_0x2d293d['id']}})[_0x83e2('0x24')](function(){return _0x1d4db3;});})[_0x83e2('0x24')](function(){_0x2add80[_0x83e2('0x18')](0xcc)[_0x83e2('0x19')]();});}};}function handleEntityNotFound(_0x33dcb8,_0x34957a){return function(_0x14c144){if(!_0x14c144){_0x33dcb8['sendStatus'](0x194);}return _0x14c144;};}function handleError(_0x332f47,_0x1b49e1){_0x1b49e1=_0x1b49e1||0x1f4;return function(_0x158b7f){logger['error'](_0x158b7f[_0x83e2('0x29')]);if(_0x158b7f[_0x83e2('0x2a')]){delete _0x158b7f[_0x83e2('0x2a')];}_0x332f47['status'](_0x1b49e1)[_0x83e2('0x2b')](_0x158b7f);};}exports[_0x83e2('0x2c')]=function(_0x14bad7,_0x1f000e){var _0x13dd2f={},_0x478893={},_0x2d2533={'count':0x0,'rows':[]};var _0x2a78dd=_[_0x83e2('0x2d')](db[_0x83e2('0x2e')][_0x83e2('0x2f')],function(_0x5ee8dc){return{'name':_0x5ee8dc[_0x83e2('0x30')],'type':_0x5ee8dc[_0x83e2('0x31')][_0x83e2('0x32')]};});_0x478893[_0x83e2('0x33')]=_['map'](_0x2a78dd,'name');_0x478893[_0x83e2('0x34')]=_['keys'](_0x14bad7[_0x83e2('0x34')]);_0x478893[_0x83e2('0x35')]=_['intersection'](_0x478893[_0x83e2('0x33')],_0x478893[_0x83e2('0x34')]);_0x13dd2f[_0x83e2('0x36')]=_[_0x83e2('0x37')](_0x478893[_0x83e2('0x33')],qs[_0x83e2('0x38')](_0x14bad7[_0x83e2('0x34')][_0x83e2('0x38')]));_0x13dd2f[_0x83e2('0x36')]=_0x13dd2f[_0x83e2('0x36')]['length']?_0x13dd2f[_0x83e2('0x36')]:_0x478893[_0x83e2('0x33')];if(!_0x14bad7['query'][_0x83e2('0x39')](_0x83e2('0x3a'))){_0x13dd2f[_0x83e2('0x1e')]=qs['limit'](_0x14bad7[_0x83e2('0x34')][_0x83e2('0x1e')]);_0x13dd2f[_0x83e2('0x1b')]=qs['offset'](_0x14bad7['query'][_0x83e2('0x1b')]);}_0x13dd2f['order']=qs[_0x83e2('0x3b')](_0x14bad7['query']['sort']);_0x13dd2f[_0x83e2('0x3c')]=qs[_0x83e2('0x35')](_[_0x83e2('0x3d')](_0x14bad7[_0x83e2('0x34')],_0x478893[_0x83e2('0x35')]),_0x2a78dd);if(_0x14bad7[_0x83e2('0x34')][_0x83e2('0x3e')]){_0x13dd2f['where']=_['merge'](_0x13dd2f['where'],{'$or':_[_0x83e2('0x2d')](_0x2a78dd,function(_0x50d53e){if(_0x50d53e[_0x83e2('0x31')]!=='VIRTUAL'){var _0x2135e5={};_0x2135e5[_0x50d53e[_0x83e2('0x2a')]]={'$like':'%'+_0x14bad7[_0x83e2('0x34')]['filter']+'%'};return _0x2135e5;}})});}_0x13dd2f=_[_0x83e2('0x3f')]({},_0x13dd2f,_0x14bad7[_0x83e2('0x40')]);var _0xe141fe={'where':_0x13dd2f[_0x83e2('0x3c')]};return db[_0x83e2('0x2e')][_0x83e2('0x1d')](_0xe141fe)[_0x83e2('0x24')](function(_0x77f616){_0x2d2533[_0x83e2('0x1d')]=_0x77f616;if(_0x14bad7['query'][_0x83e2('0x41')]){_0x13dd2f[_0x83e2('0x42')]=[{'all':!![]}];}return db[_0x83e2('0x2e')][_0x83e2('0x43')](_0x13dd2f);})[_0x83e2('0x24')](function(_0x26eb0a){_0x2d2533['rows']=_0x26eb0a;return _0x2d2533;})['then'](respondWithFilteredResult(_0x1f000e,_0x13dd2f))[_0x83e2('0x44')](handleError(_0x1f000e,null));};exports[_0x83e2('0x45')]=function(_0x3f952e,_0x552815){var _0x3ba007={'raw':!![],'where':{'id':_0x3f952e[_0x83e2('0x46')]['id']}},_0x4621f9={};_0x4621f9[_0x83e2('0x33')]=_['keys'](db[_0x83e2('0x2e')]['rawAttributes']);_0x4621f9['query']=_[_0x83e2('0x47')](_0x3f952e[_0x83e2('0x34')]);_0x4621f9[_0x83e2('0x35')]=_[_0x83e2('0x37')](_0x4621f9['model'],_0x4621f9[_0x83e2('0x34')]);_0x3ba007['attributes']=_[_0x83e2('0x37')](_0x4621f9[_0x83e2('0x33')],qs[_0x83e2('0x38')](_0x3f952e[_0x83e2('0x34')][_0x83e2('0x38')]));_0x3ba007[_0x83e2('0x36')]=_0x3ba007[_0x83e2('0x36')][_0x83e2('0x48')]?_0x3ba007[_0x83e2('0x36')]:_0x4621f9[_0x83e2('0x33')];if(_0x3f952e[_0x83e2('0x34')][_0x83e2('0x41')]){_0x3ba007[_0x83e2('0x42')]=[{'all':!![]}];}_0x3ba007=_['merge']({},_0x3ba007,_0x3f952e[_0x83e2('0x40')]);return db[_0x83e2('0x2e')][_0x83e2('0x49')](_0x3ba007)[_0x83e2('0x24')](handleEntityNotFound(_0x552815,null))['then'](respondWithResult(_0x552815,null))['catch'](handleError(_0x552815,null));};exports[_0x83e2('0x4a')]=function(_0x3f2942,_0x573077){return db[_0x83e2('0x2e')][_0x83e2('0x4a')](_0x3f2942[_0x83e2('0x4b')],{})['then'](function(_0x10402f){var _0x1f41a6=_0x3f2942[_0x83e2('0x4c')][_0x83e2('0x26')]({'plain':!![]});if(!_0x1f41a6)throw new Error(_0x83e2('0x4d'));if(_0x1f41a6['role']===_0x83e2('0x4c')){var _0x353ac7=_0x10402f['get']({'plain':!![]});var _0x396d5e=_0x83e2('0x27');return db[_0x83e2('0x4e')]['find']({'where':{'name':_0x396d5e,'userProfileId':_0x1f41a6[_0x83e2('0x4f')]},'raw':!![]})['then'](function(_0x4c308b){if(_0x4c308b&&_0x4c308b['autoAssociation']===0x0){return db[_0x83e2('0x28')][_0x83e2('0x4a')]({'name':_0x353ac7[_0x83e2('0x2a')],'resourceId':_0x353ac7['id'],'type':_0x4c308b[_0x83e2('0x2a')],'sectionId':_0x4c308b['id']},{})['then'](function(){return _0x10402f;});}else{return _0x10402f;}})[_0x83e2('0x44')](function(_0x23a573){logger[_0x83e2('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x23a573);throw _0x23a573;});}return _0x10402f;})[_0x83e2('0x24')](respondWithResult(_0x573077,0xc9))[_0x83e2('0x44')](handleError(_0x573077,null));};exports['update']=function(_0x13e7f4,_0x461850){if(_0x13e7f4['body']['id']){delete _0x13e7f4['body']['id'];}return db[_0x83e2('0x2e')][_0x83e2('0x49')]({'where':{'id':_0x13e7f4[_0x83e2('0x46')]['id']}})['then'](handleEntityNotFound(_0x461850,null))['then'](saveUpdates(_0x13e7f4[_0x83e2('0x4b')],null))['then'](respondWithResult(_0x461850,null))['catch'](handleError(_0x461850,null));};exports[_0x83e2('0x25')]=function(_0x26e24b,_0xb6322c){return db[_0x83e2('0x2e')]['find']({'where':{'id':_0x26e24b[_0x83e2('0x46')]['id']}})[_0x83e2('0x24')](handleEntityNotFound(_0xb6322c,null))['then'](removeEntity(_0xb6322c,null))[_0x83e2('0x44')](handleError(_0xb6322c,null));};exports[_0x83e2('0x51')]=function(_0x32d6d8,_0x2c3cda,_0x24c951){return db[_0x83e2('0x2e')]['find']({'where':{'id':_0x32d6d8['params']['id']},'attributes':['name',_0x83e2('0x52'),'savename',_0x83e2('0x53')],'raw':!![]})[_0x83e2('0x24')](handleEntityNotFound(_0x2c3cda,null))[_0x83e2('0x24')](function(_0x26fceb){if(_0x26fceb){if(!fs[_0x83e2('0x54')](path[_0x83e2('0x55')](config['root'],_0x83e2('0x56'),_0x26fceb['savename']))){throw new db[(_0x83e2('0x57'))][(_0x83e2('0x58'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x32d6d8['query'][_0x83e2('0x59')]){return _0x2c3cda[_0x83e2('0x17')](0xc8);}return _0x2c3cda['download'](path[_0x83e2('0x55')](config[_0x83e2('0x5a')],_0x83e2('0x56'),_0x26fceb['savename']),util['format'](_0x83e2('0x5b'),_0x26fceb[_0x83e2('0x52')]||_0x26fceb[_0x83e2('0x2a')],_0x26fceb['output'][_0x83e2('0x5c')]()));}})[_0x83e2('0x44')](handleError(_0x2c3cda,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index f4ed8ba..83d9ae1 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 _0x4aff=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','lodash','util'];(function(_0x39b11b,_0x2435c2){var _0x4d6e84=function(_0x3ce0b6){while(--_0x3ce0b6){_0x39b11b['push'](_0x39b11b['shift']());}};_0x4d6e84(++_0x2435c2);}(_0x4aff,0xc1));var _0xf4af=function(_0x313c92,_0x5d9943){_0x313c92=_0x313c92-0x0;var _0x8ddf39=_0x4aff[_0x313c92];return _0x8ddf39;};'use strict';var _=require(_0xf4af('0x0'));var util=require(_0xf4af('0x1'));var logger=require(_0xf4af('0x2'))(_0xf4af('0x3'));var moment=require(_0xf4af('0x4'));var BPromise=require(_0xf4af('0x5'));var rp=require(_0xf4af('0x6'));var fs=require('fs');var path=require(_0xf4af('0x7'));var rimraf=require(_0xf4af('0x8'));var config=require(_0xf4af('0x9'));var attributes=require(_0xf4af('0xa'));module[_0xf4af('0xb')]=function(_0xf9f81d,_0xb2e354){return _0xf9f81d['define'](_0xf4af('0xc'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5169=['AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api','moment','rimraf','../../config/environment','exports','define'];(function(_0x1187ee,_0x11f291){var _0x4ff316=function(_0x10691c){while(--_0x10691c){_0x1187ee['push'](_0x1187ee['shift']());}};_0x4ff316(++_0x11f291);}(_0x5169,0x16a));var _0x9516=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x5169[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0x9516('0x0'));var util=require(_0x9516('0x1'));var logger=require('../../config/logger')(_0x9516('0x2'));var moment=require(_0x9516('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9516('0x4'));var config=require(_0x9516('0x5'));var attributes=require('./analyticExtractedReport.attributes');module[_0x9516('0x6')]=function(_0x1d8ba7,_0x171855){return _0x1d8ba7[_0x9516('0x7')](_0x9516('0x8'),attributes,{'tableName':_0x9516('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 615449a..f364ee9 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 _0x365c=['request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x2becba,_0x4ea656){var _0x90b5dd=function(_0x26ae2b){while(--_0x26ae2b){_0x2becba['push'](_0x2becba['shift']());}};_0x90b5dd(++_0x4ea656);}(_0x365c,0x1d5));var _0xc365=function(_0x5b58f2,_0x2431af){_0x5b58f2=_0x5b58f2-0x0;var _0x41e066=_0x365c[_0x5b58f2];return _0x41e066;};'use strict';var _=require(_0xc365('0x0'));var util=require('util');var moment=require(_0xc365('0x1'));var BPromise=require(_0xc365('0x2'));var rs=require(_0xc365('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc365('0x4'))['db'];var utils=require(_0xc365('0x5'));var logger=require(_0xc365('0x6'))(_0xc365('0x7'));var config=require(_0xc365('0x8'));var jayson=require(_0xc365('0x9'));var client=jayson[_0xc365('0xa')][_0xc365('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x91976b,_0x44427e,_0x684752){return new BPromise(function(_0x2b22cf,_0x303ebb){return client['request'](_0x91976b,_0x684752)[_0xc365('0xc')](function(_0x4ae332){logger[_0xc365('0xd')](_0xc365('0xe'),_0x44427e,_0xc365('0xf'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x44427e,_0xc365('0xf'),JSON[_0xc365('0x10')](_0x4ae332));if(_0x4ae332[_0xc365('0x11')]){if(_0x4ae332[_0xc365('0x11')][_0xc365('0x12')]===0x1f4){logger[_0xc365('0x11')](_0xc365('0xe'),_0x44427e,_0x4ae332['error']['message']);return _0x303ebb(_0x4ae332[_0xc365('0x11')]['message']);}logger[_0xc365('0x11')](_0xc365('0xe'),_0x44427e,_0x4ae332['error']['message']);return _0x2b22cf(_0x4ae332[_0xc365('0x11')][_0xc365('0x13')]);}else{logger[_0xc365('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x44427e,_0xc365('0xf'));_0x2b22cf(_0x4ae332[_0xc365('0x14')]['message']);}})[_0xc365('0x15')](function(_0x11412d){logger[_0xc365('0x11')](_0xc365('0xe'),_0x44427e,_0x11412d);_0x303ebb(_0x11412d);});});}
\ No newline at end of file
+var _0x1b8f=['catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result'];(function(_0x510cd9,_0x551300){var _0x2b1f61=function(_0x345249){while(--_0x345249){_0x510cd9['push'](_0x510cd9['shift']());}};_0x2b1f61(++_0x551300);}(_0x1b8f,0x8b));var _0xf1b8=function(_0x3d685b,_0x13b983){_0x3d685b=_0x3d685b-0x0;var _0x4fb0d4=_0x1b8f[_0x3d685b];return _0x4fb0d4;};'use strict';var _=require('lodash');var util=require(_0xf1b8('0x0'));var moment=require('moment');var BPromise=require(_0xf1b8('0x1'));var rs=require(_0xf1b8('0x2'));var fs=require('fs');var Redis=require(_0xf1b8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf1b8('0x4'));var logger=require(_0xf1b8('0x5'))(_0xf1b8('0x6'));var config=require(_0xf1b8('0x7'));var jayson=require(_0xf1b8('0x8'));var client=jayson[_0xf1b8('0x9')][_0xf1b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58f761,_0x5a2087,_0x26538e){return new BPromise(function(_0x1b8c35,_0x2c9f56){return client[_0xf1b8('0xb')](_0x58f761,_0x26538e)[_0xf1b8('0xc')](function(_0x2967b3){logger['info'](_0xf1b8('0xd'),_0x5a2087,_0xf1b8('0xe'));logger[_0xf1b8('0xf')](_0xf1b8('0x10'),_0x5a2087,_0xf1b8('0xe'),JSON['stringify'](_0x2967b3));if(_0x2967b3[_0xf1b8('0x11')]){if(_0x2967b3[_0xf1b8('0x11')][_0xf1b8('0x12')]===0x1f4){logger[_0xf1b8('0x11')](_0xf1b8('0xd'),_0x5a2087,_0x2967b3['error'][_0xf1b8('0x13')]);return _0x2c9f56(_0x2967b3[_0xf1b8('0x11')][_0xf1b8('0x13')]);}logger['error'](_0xf1b8('0xd'),_0x5a2087,_0x2967b3['error'][_0xf1b8('0x13')]);return _0x1b8c35(_0x2967b3[_0xf1b8('0x11')][_0xf1b8('0x13')]);}else{logger[_0xf1b8('0x14')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5a2087,_0xf1b8('0xe'));_0x1b8c35(_0x2967b3[_0xf1b8('0x15')][_0xf1b8('0x13')]);}})[_0xf1b8('0x16')](function(_0x4621ba){logger['error'](_0xf1b8('0xd'),_0x5a2087,_0x4621ba);_0x2c9f56(_0x4621ba);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 58d5883..21ca81f 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 _0x1cb1=['put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','get','/:id/download','download','post','create'];(function(_0x48e675,_0x270383){var _0x260d65=function(_0x14509d){while(--_0x14509d){_0x48e675['push'](_0x48e675['shift']());}};_0x260d65(++_0x270383);}(_0x1cb1,0x165));var _0x11cb=function(_0x31bcec,_0x22d9b9){_0x31bcec=_0x31bcec-0x0;var _0x595821=_0x1cb1[_0x31bcec];return _0x595821;};'use strict';var multer=require('multer');var util=require(_0x11cb('0x0'));var path=require(_0x11cb('0x1'));var timeout=require(_0x11cb('0x2'));var express=require(_0x11cb('0x3'));var router=express[_0x11cb('0x4')]();var fs_extra=require(_0x11cb('0x5'));var auth=require(_0x11cb('0x6'));var interaction=require(_0x11cb('0x7'));var config=require(_0x11cb('0x8'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0x11cb('0x9')](),controller[_0x11cb('0xa')]);router['get'](_0x11cb('0xb'),auth[_0x11cb('0x9')](),controller['show']);router[_0x11cb('0xc')](_0x11cb('0xd'),auth['isAuthenticated'](),controller[_0x11cb('0xe')]);router[_0x11cb('0xf')]('/',auth[_0x11cb('0x9')](),controller[_0x11cb('0x10')]);router[_0x11cb('0x11')]('/:id',auth[_0x11cb('0x9')](),controller[_0x11cb('0x12')]);router[_0x11cb('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x11cb('0x14')]);module[_0x11cb('0x15')]=router;
\ No newline at end of file
+var _0x3da4=['download','post','put','update','delete','destroy','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download'];(function(_0x4955fa,_0x2e654c){var _0x9a2fd7=function(_0x3f3756){while(--_0x3f3756){_0x4955fa['push'](_0x4955fa['shift']());}};_0x9a2fd7(++_0x2e654c);}(_0x3da4,0x182));var _0x43da=function(_0xe15f5a,_0x2e028e){_0xe15f5a=_0xe15f5a-0x0;var _0xef92a1=_0x3da4[_0xe15f5a];return _0xef92a1;};'use strict';var multer=require(_0x43da('0x0'));var util=require(_0x43da('0x1'));var path=require(_0x43da('0x2'));var timeout=require('connect-timeout');var express=require(_0x43da('0x3'));var router=express['Router']();var fs_extra=require(_0x43da('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x43da('0x5'));var config=require(_0x43da('0x6'));var controller=require(_0x43da('0x7'));router[_0x43da('0x8')]('/',auth[_0x43da('0x9')](),controller[_0x43da('0xa')]);router[_0x43da('0x8')](_0x43da('0xb'),auth[_0x43da('0x9')](),controller[_0x43da('0xc')]);router[_0x43da('0x8')](_0x43da('0xd'),auth['isAuthenticated'](),controller[_0x43da('0xe')]);router[_0x43da('0xf')]('/',auth[_0x43da('0x9')](),controller['create']);router[_0x43da('0x10')](_0x43da('0xb'),auth[_0x43da('0x9')](),controller[_0x43da('0x11')]);router[_0x43da('0x12')](_0x43da('0xb'),auth['isAuthenticated'](),controller[_0x43da('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 3ee93e3..88439df 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 _0x9bc3=['sequelize','exports','TEXT','STRING'];(function(_0x5ed55e,_0x332aac){var _0x8cb4ef=function(_0x3919ab){while(--_0x3919ab){_0x5ed55e['push'](_0x5ed55e['shift']());}};_0x8cb4ef(++_0x332aac);}(_0x9bc3,0x120));var _0x39bc=function(_0x1cfc64,_0x49087e){_0x1cfc64=_0x1cfc64-0x0;var _0x295e1b=_0x9bc3[_0x1cfc64];return _0x295e1b;};'use strict';var Sequelize=require(_0x39bc('0x0'));module[_0x39bc('0x1')]={'field':{'type':Sequelize[_0x39bc('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x39bc('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x39bc('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x1dee=['BOOLEAN','sequelize','exports','STRING'];(function(_0x3f07d1,_0x90c878){var _0x19502c=function(_0x971b0d){while(--_0x971b0d){_0x3f07d1['push'](_0x3f07d1['shift']());}};_0x19502c(++_0x90c878);}(_0x1dee,0xe1));var _0xe1de=function(_0x3c5ce3,_0x18c28e){_0x3c5ce3=_0x3c5ce3-0x0;var _0x4dc6dd=_0x1dee[_0x3c5ce3];return _0x4dc6dd;};'use strict';var Sequelize=require(_0xe1de('0x0'));module[_0xe1de('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xe1de('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xe1de('0x2')]},'groupBy':{'type':Sequelize[_0xe1de('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xe1de('0x2')]},'custom':{'type':Sequelize[_0xe1de('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 22eb048..40663e1 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 _0xaf3a=['ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','bulkCreate','update','destroy','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xaf3a,0x13f));var _0xaaf3=function(_0x2459fd,_0x575d9b){_0x2459fd=_0x2459fd-0x0;var _0x364cd2=_0xaf3a[_0x2459fd];return _0x364cd2;};'use strict';var emlformat=require(_0xaaf3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaaf3('0x1'));var jsonpatch=require(_0xaaf3('0x2'));var rp=require('request-promise');var moment=require(_0xaaf3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xaaf3('0x4'));var util=require(_0xaaf3('0x5'));var path=require(_0xaaf3('0x6'));var sox=require(_0xaaf3('0x7'));var csv=require(_0xaaf3('0x8'));var ejs=require(_0xaaf3('0x9'));var fs=require('fs');var fs_extra=require(_0xaaf3('0xa'));var _=require(_0xaaf3('0xb'));var squel=require(_0xaaf3('0xc'));var crypto=require(_0xaaf3('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaaf3('0xe'));var Papa=require(_0xaaf3('0xf'));var Redis=require(_0xaaf3('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xaaf3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xaaf3('0x12'))('api');var utils=require(_0xaaf3('0x13'));var config=require(_0xaaf3('0x14'));var licenseUtil=require(_0xaaf3('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe7d413,_0x316c68){_0x316c68=_0x316c68||0xcc;return function(_0x24fa1f){if(_0x24fa1f){return _0xe7d413[_0xaaf3('0x16')](_0x316c68);}return _0xe7d413[_0xaaf3('0x17')](_0x316c68)[_0xaaf3('0x18')]();};}function respondWithResult(_0x5062fe,_0x2536dc){_0x2536dc=_0x2536dc||0xc8;return function(_0x11a96f){if(_0x11a96f){return _0x5062fe['status'](_0x2536dc)[_0xaaf3('0x19')](_0x11a96f);}};}function respondWithFilteredResult(_0x1fcab6,_0x4a389c){return function(_0x40501e){if(_0x40501e){var _0x3e8b97=typeof _0x4a389c[_0xaaf3('0x1a')]===_0xaaf3('0x1b')&&typeof _0x4a389c[_0xaaf3('0x1c')]===_0xaaf3('0x1b');var _0x67e5a5=_0x40501e[_0xaaf3('0x1d')];var _0x492e18=_0x3e8b97?0x0:_0x4a389c[_0xaaf3('0x1a')];var _0x49bd25=_0x3e8b97?_0x40501e[_0xaaf3('0x1d')]:_0x4a389c[_0xaaf3('0x1a')]+_0x4a389c[_0xaaf3('0x1c')];var _0x3ae6b1;if(_0x49bd25>=_0x67e5a5){_0x49bd25=_0x67e5a5;_0x3ae6b1=0xc8;}else{_0x3ae6b1=0xce;}_0x1fcab6[_0xaaf3('0x17')](_0x3ae6b1);return _0x1fcab6[_0xaaf3('0x1e')]('Content-Range',_0x492e18+'-'+_0x49bd25+'/'+_0x67e5a5)[_0xaaf3('0x19')](_0x40501e);}return null;};}function patchUpdates(_0x2d6184){return function(_0x4006d9){try{jsonpatch[_0xaaf3('0x1f')](_0x4006d9,_0x2d6184,!![]);}catch(_0x255f0e){return BPromise[_0xaaf3('0x20')](_0x255f0e);}return _0x4006d9[_0xaaf3('0x21')]();};}function saveUpdates(_0x46618d,_0x6c8a72){return function(_0x2066a5){if(_0x2066a5){return _0x2066a5['update'](_0x46618d)[_0xaaf3('0x22')](function(_0x5f1f61){return _0x5f1f61;});}return null;};}function removeEntity(_0x3472ce,_0x16adbc){return function(_0x3d4dc7){if(_0x3d4dc7){return _0x3d4dc7['destroy']()[_0xaaf3('0x22')](function(){_0x3472ce[_0xaaf3('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f52c1,_0x2c5fff){return function(_0x42332f){if(!_0x42332f){_0x1f52c1[_0xaaf3('0x16')](0x194);}return _0x42332f;};}function handleError(_0x2df858,_0x3a1643){_0x3a1643=_0x3a1643||0x1f4;return function(_0x1e702e){logger[_0xaaf3('0x23')](_0x1e702e['stack']);if(_0x1e702e[_0xaaf3('0x24')]){delete _0x1e702e['name'];}_0x2df858['status'](_0x3a1643)[_0xaaf3('0x25')](_0x1e702e);};}exports[_0xaaf3('0x26')]=function(_0x4da8b7,_0x41984a){var _0x2438f2={},_0x483a37={},_0x4b6987={'count':0x0,'rows':[]};var _0x1d4ef0=_[_0xaaf3('0x27')](db[_0xaaf3('0x28')][_0xaaf3('0x29')],function(_0x2f6ad2){return{'name':_0x2f6ad2[_0xaaf3('0x2a')],'type':_0x2f6ad2['type'][_0xaaf3('0x2b')]};});_0x483a37[_0xaaf3('0x2c')]=_[_0xaaf3('0x27')](_0x1d4ef0,_0xaaf3('0x24'));_0x483a37[_0xaaf3('0x2d')]=_[_0xaaf3('0x2e')](_0x4da8b7[_0xaaf3('0x2d')]);_0x483a37[_0xaaf3('0x2f')]=_[_0xaaf3('0x30')](_0x483a37[_0xaaf3('0x2c')],_0x483a37[_0xaaf3('0x2d')]);_0x2438f2[_0xaaf3('0x31')]=_[_0xaaf3('0x30')](_0x483a37['model'],qs['fields'](_0x4da8b7[_0xaaf3('0x2d')]['fields']));_0x2438f2[_0xaaf3('0x31')]=_0x2438f2[_0xaaf3('0x31')][_0xaaf3('0x32')]?_0x2438f2[_0xaaf3('0x31')]:_0x483a37[_0xaaf3('0x2c')];if(!_0x4da8b7[_0xaaf3('0x2d')][_0xaaf3('0x33')](_0xaaf3('0x34'))){_0x2438f2[_0xaaf3('0x1c')]=qs[_0xaaf3('0x1c')](_0x4da8b7[_0xaaf3('0x2d')][_0xaaf3('0x1c')]);_0x2438f2['offset']=qs[_0xaaf3('0x1a')](_0x4da8b7['query']['offset']);}_0x2438f2[_0xaaf3('0x35')]=qs['sort'](_0x4da8b7['query'][_0xaaf3('0x36')]);_0x2438f2[_0xaaf3('0x37')]=qs['filters'](_['pick'](_0x4da8b7[_0xaaf3('0x2d')],_0x483a37[_0xaaf3('0x2f')]),_0x1d4ef0);if(_0x4da8b7[_0xaaf3('0x2d')][_0xaaf3('0x38')]){_0x2438f2['where']=_['merge'](_0x2438f2[_0xaaf3('0x37')],{'$or':_[_0xaaf3('0x27')](_0x1d4ef0,function(_0x2e2325){if(_0x2e2325[_0xaaf3('0x39')]!==_0xaaf3('0x3a')){var _0x29e059={};_0x29e059[_0x2e2325[_0xaaf3('0x24')]]={'$like':'%'+_0x4da8b7[_0xaaf3('0x2d')][_0xaaf3('0x38')]+'%'};return _0x29e059;}})});}_0x2438f2=_[_0xaaf3('0x3b')]({},_0x2438f2,_0x4da8b7[_0xaaf3('0x3c')]);var _0x52aa8e={'where':_0x2438f2['where']};return db[_0xaaf3('0x28')][_0xaaf3('0x1d')](_0x52aa8e)[_0xaaf3('0x22')](function(_0x1eefac){_0x4b6987[_0xaaf3('0x1d')]=_0x1eefac;if(_0x4da8b7['query'][_0xaaf3('0x3d')]){_0x2438f2[_0xaaf3('0x3e')]=[{'all':!![]}];}return db[_0xaaf3('0x28')][_0xaaf3('0x3f')](_0x2438f2);})[_0xaaf3('0x22')](function(_0x4c7eb9){_0x4b6987[_0xaaf3('0x40')]=_0x4c7eb9;return _0x4b6987;})[_0xaaf3('0x22')](respondWithFilteredResult(_0x41984a,_0x2438f2))[_0xaaf3('0x41')](handleError(_0x41984a,null));};exports[_0xaaf3('0x42')]=function(_0x36d68b,_0x301912){var _0x553f29={'raw':![],'where':{'id':_0x36d68b[_0xaaf3('0x43')]['id']}},_0x4c81c3={};_0x4c81c3['model']=_['keys'](db[_0xaaf3('0x28')]['rawAttributes']);_0x4c81c3['query']=_[_0xaaf3('0x2e')](_0x36d68b[_0xaaf3('0x2d')]);_0x4c81c3[_0xaaf3('0x2f')]=_[_0xaaf3('0x30')](_0x4c81c3[_0xaaf3('0x2c')],_0x4c81c3['query']);_0x553f29[_0xaaf3('0x31')]=_[_0xaaf3('0x30')](_0x4c81c3[_0xaaf3('0x2c')],qs[_0xaaf3('0x44')](_0x36d68b[_0xaaf3('0x2d')][_0xaaf3('0x44')]));_0x553f29[_0xaaf3('0x31')]=_0x553f29[_0xaaf3('0x31')]['length']?_0x553f29[_0xaaf3('0x31')]:_0x4c81c3[_0xaaf3('0x2c')];if(_0x36d68b[_0xaaf3('0x2d')][_0xaaf3('0x3d')]){_0x553f29[_0xaaf3('0x3e')]=[{'all':!![]}];}_0x553f29=_[_0xaaf3('0x3b')]({},_0x553f29,_0x36d68b['options']);return db[_0xaaf3('0x28')][_0xaaf3('0x45')](_0x553f29)[_0xaaf3('0x22')](handleEntityNotFound(_0x301912,null))[_0xaaf3('0x22')](respondWithResult(_0x301912,null))['catch'](handleError(_0x301912,null));};exports[_0xaaf3('0x46')]=function(_0x54975f,_0x3683be){return db[_0xaaf3('0x28')][_0xaaf3('0x46')](_0x54975f[_0xaaf3('0x47')],{})[_0xaaf3('0x22')](respondWithResult(_0x3683be,0xc9))[_0xaaf3('0x41')](handleError(_0x3683be,null));};exports['bulkCreate']=function(_0x377883,_0x181a88){return db[_0xaaf3('0x28')][_0xaaf3('0x48')](_0x377883[_0xaaf3('0x47')],{'raw':![],'individualHooks':!![]})[_0xaaf3('0x22')](respondWithResult(_0x181a88,0xc9))['catch'](handleError(_0x181a88,null));};exports[_0xaaf3('0x49')]=function(_0x2ea1c3,_0x482ed7){if(_0x2ea1c3[_0xaaf3('0x47')]['id']){delete _0x2ea1c3['body']['id'];}return db[_0xaaf3('0x28')]['find']({'where':{'id':_0x2ea1c3[_0xaaf3('0x43')]['id']}})[_0xaaf3('0x22')](handleEntityNotFound(_0x482ed7,null))[_0xaaf3('0x22')](saveUpdates(_0x2ea1c3['body'],null))[_0xaaf3('0x22')](respondWithResult(_0x482ed7,null))[_0xaaf3('0x41')](handleError(_0x482ed7,null));};exports[_0xaaf3('0x4a')]=function(_0x17f179,_0x3e9a68){return db[_0xaaf3('0x28')][_0xaaf3('0x45')]({'where':{'id':_0x17f179[_0xaaf3('0x43')]['id']}})[_0xaaf3('0x22')](handleEntityNotFound(_0x3e9a68,null))[_0xaaf3('0x22')](removeEntity(_0x3e9a68,null))[_0xaaf3('0x41')](handleError(_0x3e9a68,null));};exports[_0xaaf3('0x4b')]=function(_0x57a237,_0x56d7ab){return db[_0xaaf3('0x28')][_0xaaf3('0x4a')]({'where':{'id':_0x57a237['query']['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x56d7ab,0xcc))[_0xaaf3('0x41')](handleError(_0x56d7ab,null));};exports[_0xaaf3('0x4c')]=function(_0x4709ab,_0xf04c5a,_0x2a4aac){return db[_0xaaf3('0x4d')][_0xaaf3('0x4e')]({'where':{'id':_0x4709ab[_0xaaf3('0x43')]['id']}})['then'](handleEntityNotFound(_0xf04c5a,null))['then'](function(_0x5742c1){if(_0x5742c1){return db[_0xaaf3('0x4f')][_0xaaf3('0x50')](function(_0x545f90){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x4709ab[_0xaaf3('0x43')]['id']},'transaction':_0x545f90})[_0xaaf3('0x22')](function(_0x4dabb1){var _0x571079=_[_0xaaf3('0x27')](_0x4709ab[_0xaaf3('0x47')],function(_0x5906f9){delete _0x5906f9['id'];_0x5906f9[_0xaaf3('0x51')]=_0x4709ab[_0xaaf3('0x43')]['id'];return _0x5906f9;});return db['AnalyticFieldReport'][_0xaaf3('0x48')](_0x571079,{'transaction':_0x545f90});});})['then'](function(){return db[_0xaaf3('0x28')]['findAll']({'where':{'CustomReportId':_0x4709ab[_0xaaf3('0x43')]['id']}});});}})['then'](respondWithResult(_0xf04c5a,null))['catch'](handleError(_0xf04c5a,null));};
\ No newline at end of file
+var _0xf7a0=['end','json','limit','count','offset','set','Content-Range','apply','then','destroy','stack','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','params','keys','create','body','bulkCreate','catch','update','find','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','findAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','squel','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','status'];(function(_0x12a554,_0x3d7ef8){var _0x244ba0=function(_0x5eb5ff){while(--_0x5eb5ff){_0x12a554['push'](_0x12a554['shift']());}};_0x244ba0(++_0x3d7ef8);}(_0xf7a0,0x80));var _0x0f7a=function(_0x351914,_0x1d4fe5){_0x351914=_0x351914-0x0;var _0x23707c=_0xf7a0[_0x351914];return _0x23707c;};'use strict';var emlformat=require(_0x0f7a('0x0'));var rimraf=require(_0x0f7a('0x1'));var zipdir=require(_0x0f7a('0x2'));var jsonpatch=require(_0x0f7a('0x3'));var rp=require('request-promise');var moment=require(_0x0f7a('0x4'));var BPromise=require(_0x0f7a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0f7a('0x6'));var sox=require(_0x0f7a('0x7'));var csv=require(_0x0f7a('0x8'));var ejs=require(_0x0f7a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0f7a('0xa'));var crypto=require('crypto');var jsforce=require(_0x0f7a('0xb'));var deskjs=require(_0x0f7a('0xc'));var toCsv=require(_0x0f7a('0x8'));var querystring=require(_0x0f7a('0xd'));var Papa=require(_0x0f7a('0xe'));var Redis=require('ioredis');var authService=require(_0x0f7a('0xf'));var qs=require(_0x0f7a('0x10'));var as=require(_0x0f7a('0x11'));var hardwareService=require(_0x0f7a('0x12'));var logger=require(_0x0f7a('0x13'))(_0x0f7a('0x14'));var utils=require(_0x0f7a('0x15'));var config=require(_0x0f7a('0x16'));var licenseUtil=require(_0x0f7a('0x17'));var db=require(_0x0f7a('0x18'))['db'];function respondWithStatusCode(_0xa1d94,_0x3f40b3){_0x3f40b3=_0x3f40b3||0xcc;return function(_0x5e1c1e){if(_0x5e1c1e){return _0xa1d94['sendStatus'](_0x3f40b3);}return _0xa1d94[_0x0f7a('0x19')](_0x3f40b3)[_0x0f7a('0x1a')]();};}function respondWithResult(_0xc43c4b,_0x532bf9){_0x532bf9=_0x532bf9||0xc8;return function(_0x274d0d){if(_0x274d0d){return _0xc43c4b[_0x0f7a('0x19')](_0x532bf9)[_0x0f7a('0x1b')](_0x274d0d);}};}function respondWithFilteredResult(_0xb4f8ec,_0x80bc50){return function(_0x3c4a72){if(_0x3c4a72){var _0x156532=typeof _0x80bc50['offset']==='undefined'&&typeof _0x80bc50[_0x0f7a('0x1c')]==='undefined';var _0x152714=_0x3c4a72[_0x0f7a('0x1d')];var _0x25e443=_0x156532?0x0:_0x80bc50[_0x0f7a('0x1e')];var _0x21245f=_0x156532?_0x3c4a72[_0x0f7a('0x1d')]:_0x80bc50[_0x0f7a('0x1e')]+_0x80bc50[_0x0f7a('0x1c')];var _0x272cec;if(_0x21245f>=_0x152714){_0x21245f=_0x152714;_0x272cec=0xc8;}else{_0x272cec=0xce;}_0xb4f8ec[_0x0f7a('0x19')](_0x272cec);return _0xb4f8ec[_0x0f7a('0x1f')](_0x0f7a('0x20'),_0x25e443+'-'+_0x21245f+'/'+_0x152714)[_0x0f7a('0x1b')](_0x3c4a72);}return null;};}function patchUpdates(_0x4436ce){return function(_0x12c3ae){try{jsonpatch[_0x0f7a('0x21')](_0x12c3ae,_0x4436ce,!![]);}catch(_0x1c16d9){return BPromise['reject'](_0x1c16d9);}return _0x12c3ae['save']();};}function saveUpdates(_0x25893d,_0xe300d6){return function(_0x48d487){if(_0x48d487){return _0x48d487['update'](_0x25893d)[_0x0f7a('0x22')](function(_0x4b49f2){return _0x4b49f2;});}return null;};}function removeEntity(_0x3e71d3,_0x178c66){return function(_0x39d187){if(_0x39d187){return _0x39d187[_0x0f7a('0x23')]()[_0x0f7a('0x22')](function(){_0x3e71d3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x333c50,_0x592f0a){return function(_0x247688){if(!_0x247688){_0x333c50['sendStatus'](0x194);}return _0x247688;};}function handleError(_0x4cfab0,_0x3fc0c7){_0x3fc0c7=_0x3fc0c7||0x1f4;return function(_0x152530){logger['error'](_0x152530[_0x0f7a('0x24')]);if(_0x152530[_0x0f7a('0x25')]){delete _0x152530[_0x0f7a('0x25')];}_0x4cfab0[_0x0f7a('0x19')](_0x3fc0c7)['send'](_0x152530);};}exports[_0x0f7a('0x26')]=function(_0x8f927d,_0x431a14){var _0x21e8d9={},_0x3b09cd={},_0x2bf9dc={'count':0x0,'rows':[]};var _0x5f4cdb=_[_0x0f7a('0x27')](db[_0x0f7a('0x28')][_0x0f7a('0x29')],function(_0x1461ac){return{'name':_0x1461ac[_0x0f7a('0x2a')],'type':_0x1461ac['type'][_0x0f7a('0x2b')]};});_0x3b09cd[_0x0f7a('0x2c')]=_[_0x0f7a('0x27')](_0x5f4cdb,'name');_0x3b09cd[_0x0f7a('0x2d')]=_['keys'](_0x8f927d['query']);_0x3b09cd['filters']=_[_0x0f7a('0x2e')](_0x3b09cd[_0x0f7a('0x2c')],_0x3b09cd[_0x0f7a('0x2d')]);_0x21e8d9[_0x0f7a('0x2f')]=_[_0x0f7a('0x2e')](_0x3b09cd[_0x0f7a('0x2c')],qs[_0x0f7a('0x30')](_0x8f927d[_0x0f7a('0x2d')][_0x0f7a('0x30')]));_0x21e8d9[_0x0f7a('0x2f')]=_0x21e8d9['attributes']['length']?_0x21e8d9[_0x0f7a('0x2f')]:_0x3b09cd[_0x0f7a('0x2c')];if(!_0x8f927d[_0x0f7a('0x2d')]['hasOwnProperty'](_0x0f7a('0x31'))){_0x21e8d9['limit']=qs[_0x0f7a('0x1c')](_0x8f927d[_0x0f7a('0x2d')][_0x0f7a('0x1c')]);_0x21e8d9[_0x0f7a('0x1e')]=qs[_0x0f7a('0x1e')](_0x8f927d[_0x0f7a('0x2d')][_0x0f7a('0x1e')]);}_0x21e8d9[_0x0f7a('0x32')]=qs[_0x0f7a('0x33')](_0x8f927d['query'][_0x0f7a('0x33')]);_0x21e8d9[_0x0f7a('0x34')]=qs[_0x0f7a('0x35')](_[_0x0f7a('0x36')](_0x8f927d['query'],_0x3b09cd[_0x0f7a('0x35')]),_0x5f4cdb);if(_0x8f927d['query']['filter']){_0x21e8d9[_0x0f7a('0x34')]=_[_0x0f7a('0x37')](_0x21e8d9[_0x0f7a('0x34')],{'$or':_[_0x0f7a('0x27')](_0x5f4cdb,function(_0xa2a1c){if(_0xa2a1c[_0x0f7a('0x38')]!==_0x0f7a('0x39')){var _0x367908={};_0x367908[_0xa2a1c[_0x0f7a('0x25')]]={'$like':'%'+_0x8f927d['query'][_0x0f7a('0x3a')]+'%'};return _0x367908;}})});}_0x21e8d9=_[_0x0f7a('0x37')]({},_0x21e8d9,_0x8f927d[_0x0f7a('0x3b')]);var _0x12c2dd={'where':_0x21e8d9[_0x0f7a('0x34')]};return db['AnalyticFieldReport']['count'](_0x12c2dd)['then'](function(_0x26737f){_0x2bf9dc[_0x0f7a('0x1d')]=_0x26737f;if(_0x8f927d[_0x0f7a('0x2d')][_0x0f7a('0x3c')]){_0x21e8d9[_0x0f7a('0x3d')]=[{'all':!![]}];}return db[_0x0f7a('0x28')]['findAll'](_0x21e8d9);})[_0x0f7a('0x22')](function(_0xe9786f){_0x2bf9dc['rows']=_0xe9786f;return _0x2bf9dc;})[_0x0f7a('0x22')](respondWithFilteredResult(_0x431a14,_0x21e8d9))['catch'](handleError(_0x431a14,null));};exports['show']=function(_0x16831c,_0x240e04){var _0x4bb95f={'raw':![],'where':{'id':_0x16831c[_0x0f7a('0x3e')]['id']}},_0x3c4be={};_0x3c4be[_0x0f7a('0x2c')]=_[_0x0f7a('0x3f')](db['AnalyticFieldReport'][_0x0f7a('0x29')]);_0x3c4be[_0x0f7a('0x2d')]=_[_0x0f7a('0x3f')](_0x16831c[_0x0f7a('0x2d')]);_0x3c4be['filters']=_[_0x0f7a('0x2e')](_0x3c4be[_0x0f7a('0x2c')],_0x3c4be['query']);_0x4bb95f[_0x0f7a('0x2f')]=_[_0x0f7a('0x2e')](_0x3c4be[_0x0f7a('0x2c')],qs[_0x0f7a('0x30')](_0x16831c[_0x0f7a('0x2d')][_0x0f7a('0x30')]));_0x4bb95f['attributes']=_0x4bb95f[_0x0f7a('0x2f')]['length']?_0x4bb95f[_0x0f7a('0x2f')]:_0x3c4be['model'];if(_0x16831c['query']['includeAll']){_0x4bb95f['include']=[{'all':!![]}];}_0x4bb95f=_[_0x0f7a('0x37')]({},_0x4bb95f,_0x16831c[_0x0f7a('0x3b')]);return db[_0x0f7a('0x28')]['find'](_0x4bb95f)[_0x0f7a('0x22')](handleEntityNotFound(_0x240e04,null))[_0x0f7a('0x22')](respondWithResult(_0x240e04,null))['catch'](handleError(_0x240e04,null));};exports[_0x0f7a('0x40')]=function(_0x935d13,_0x47311b){return db[_0x0f7a('0x28')][_0x0f7a('0x40')](_0x935d13[_0x0f7a('0x41')],{})['then'](respondWithResult(_0x47311b,0xc9))['catch'](handleError(_0x47311b,null));};exports[_0x0f7a('0x42')]=function(_0x210c3a,_0x32fb22){return db[_0x0f7a('0x28')][_0x0f7a('0x42')](_0x210c3a[_0x0f7a('0x41')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x32fb22,0xc9))[_0x0f7a('0x43')](handleError(_0x32fb22,null));};exports[_0x0f7a('0x44')]=function(_0x2a0fdd,_0x73650e){if(_0x2a0fdd[_0x0f7a('0x41')]['id']){delete _0x2a0fdd[_0x0f7a('0x41')]['id'];}return db[_0x0f7a('0x28')][_0x0f7a('0x45')]({'where':{'id':_0x2a0fdd['params']['id']}})[_0x0f7a('0x22')](handleEntityNotFound(_0x73650e,null))[_0x0f7a('0x22')](saveUpdates(_0x2a0fdd[_0x0f7a('0x41')],null))[_0x0f7a('0x22')](respondWithResult(_0x73650e,null))[_0x0f7a('0x43')](handleError(_0x73650e,null));};exports[_0x0f7a('0x23')]=function(_0x6553f,_0x408b56){return db['AnalyticFieldReport'][_0x0f7a('0x45')]({'where':{'id':_0x6553f['params']['id']}})[_0x0f7a('0x22')](handleEntityNotFound(_0x408b56,null))[_0x0f7a('0x22')](removeEntity(_0x408b56,null))['catch'](handleError(_0x408b56,null));};exports[_0x0f7a('0x46')]=function(_0x1e1490,_0x3024b0){return db['AnalyticFieldReport'][_0x0f7a('0x23')]({'where':{'id':_0x1e1490[_0x0f7a('0x2d')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x0f7a('0x22')](respondWithResult(_0x3024b0,0xcc))[_0x0f7a('0x43')](handleError(_0x3024b0,null));};exports[_0x0f7a('0x47')]=function(_0x4ed131,_0x5a88bd,_0x2cb69e){return db[_0x0f7a('0x48')][_0x0f7a('0x49')]({'where':{'id':_0x4ed131[_0x0f7a('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5a88bd,null))[_0x0f7a('0x22')](function(_0x1c516e){if(_0x1c516e){return db[_0x0f7a('0x4a')][_0x0f7a('0x4b')](function(_0x3ef56a){return db[_0x0f7a('0x28')][_0x0f7a('0x23')]({'where':{'CustomReportId':_0x4ed131[_0x0f7a('0x3e')]['id']},'transaction':_0x3ef56a})[_0x0f7a('0x22')](function(_0x30a93a){var _0x2286fb=_['map'](_0x4ed131[_0x0f7a('0x41')],function(_0x15fabe){delete _0x15fabe['id'];_0x15fabe['CustomReportId']=_0x4ed131['params']['id'];return _0x15fabe;});return db['AnalyticFieldReport'][_0x0f7a('0x42')](_0x2286fb,{'transaction':_0x3ef56a});});})[_0x0f7a('0x22')](function(){return db[_0x0f7a('0x28')][_0x0f7a('0x4c')]({'where':{'CustomReportId':_0x4ed131[_0x0f7a('0x3e')]['id']}});});}})[_0x0f7a('0x22')](respondWithResult(_0x5a88bd,null))[_0x0f7a('0x43')](handleError(_0x5a88bd,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 8379cea..b62600f 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 _0xa836=['exports','define','lodash','util','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x33914b,_0x53f567){var _0x5f3f3b=function(_0x30be15){while(--_0x30be15){_0x33914b['push'](_0x33914b['shift']());}};_0x5f3f3b(++_0x53f567);}(_0xa836,0x158));var _0x6a83=function(_0x24eef9,_0x1856ec){_0x24eef9=_0x24eef9-0x0;var _0xed5fc4=_0xa836[_0x24eef9];return _0xed5fc4;};'use strict';var _=require(_0x6a83('0x0'));var util=require(_0x6a83('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6a83('0x2'));var fs=require('fs');var path=require(_0x6a83('0x3'));var rimraf=require(_0x6a83('0x4'));var config=require(_0x6a83('0x5'));var attributes=require(_0x6a83('0x6'));module[_0x6a83('0x7')]=function(_0x461e85,_0xd33321){return _0x461e85[_0x6a83('0x8')]('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6fce=['path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2f2360,_0x151089){var _0x1cc8d3=function(_0x5e356f){while(--_0x5e356f){_0x2f2360['push'](_0x2f2360['shift']());}};_0x1cc8d3(++_0x151089);}(_0x6fce,0x1ac));var _0xe6fc=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x6fce[_0x11005e];return _0x29338f;};'use strict';var _=require(_0xe6fc('0x0'));var util=require(_0xe6fc('0x1'));var logger=require(_0xe6fc('0x2'))(_0xe6fc('0x3'));var moment=require('moment');var BPromise=require(_0xe6fc('0x4'));var rp=require(_0xe6fc('0x5'));var fs=require('fs');var path=require(_0xe6fc('0x6'));var rimraf=require(_0xe6fc('0x7'));var config=require(_0xe6fc('0x8'));var attributes=require(_0xe6fc('0x9'));module[_0xe6fc('0xa')]=function(_0x1c4783,_0x10a668){return _0x1c4783[_0xe6fc('0xb')](_0xe6fc('0xc'),attributes,{'tableName':_0xe6fc('0xd'),'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 70284b7..363b44c 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 _0x9c39=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x298b53,_0x3f830d){var _0x370c14=function(_0x16a8d7){while(--_0x16a8d7){_0x298b53['push'](_0x298b53['shift']());}};_0x370c14(++_0x3f830d);}(_0x9c39,0x78));var _0x99c3=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x9c39[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0x99c3('0x0'));var util=require('util');var moment=require(_0x99c3('0x1'));var BPromise=require(_0x99c3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x99c3('0x3'));var db=require(_0x99c3('0x4'))['db'];var utils=require(_0x99c3('0x5'));var logger=require(_0x99c3('0x6'))('rpc');var config=require(_0x99c3('0x7'));var jayson=require(_0x99c3('0x8'));var client=jayson[_0x99c3('0x9')][_0x99c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x511ade,_0x394a96,_0x423840){return new BPromise(function(_0x3f27b6,_0x5da20a){return client[_0x99c3('0xb')](_0x511ade,_0x423840)[_0x99c3('0xc')](function(_0x213523){logger[_0x99c3('0xd')](_0x99c3('0xe'),_0x394a96,_0x99c3('0xf'));logger['debug'](_0x99c3('0x10'),_0x394a96,_0x99c3('0xf'),JSON[_0x99c3('0x11')](_0x213523));if(_0x213523[_0x99c3('0x12')]){if(_0x213523[_0x99c3('0x12')][_0x99c3('0x13')]===0x1f4){logger[_0x99c3('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x394a96,_0x213523[_0x99c3('0x12')]['message']);return _0x5da20a(_0x213523[_0x99c3('0x12')][_0x99c3('0x14')]);}logger[_0x99c3('0x12')](_0x99c3('0xe'),_0x394a96,_0x213523[_0x99c3('0x12')][_0x99c3('0x14')]);return _0x3f27b6(_0x213523[_0x99c3('0x12')]['message']);}else{logger[_0x99c3('0xd')](_0x99c3('0xe'),_0x394a96,_0x99c3('0xf'));_0x3f27b6(_0x213523['result'][_0x99c3('0x14')]);}})['catch'](function(_0x590a40){logger[_0x99c3('0x12')](_0x99c3('0xe'),_0x394a96,_0x590a40);_0x5da20a(_0x590a40);});});}
\ No newline at end of file
+var _0xd6ec=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x23add2,_0x59a127){var _0x2fdc91=function(_0x28671c){while(--_0x28671c){_0x23add2['push'](_0x23add2['shift']());}};_0x2fdc91(++_0x59a127);}(_0xd6ec,0x1df));var _0xcd6e=function(_0x5b60e3,_0x181ac2){_0x5b60e3=_0x5b60e3-0x0;var _0x2ea378=_0xd6ec[_0x5b60e3];return _0x2ea378;};'use strict';var _=require(_0xcd6e('0x0'));var util=require(_0xcd6e('0x1'));var moment=require(_0xcd6e('0x2'));var BPromise=require(_0xcd6e('0x3'));var rs=require(_0xcd6e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd6e('0x5'))['db'];var utils=require(_0xcd6e('0x6'));var logger=require(_0xcd6e('0x7'))(_0xcd6e('0x8'));var config=require(_0xcd6e('0x9'));var jayson=require(_0xcd6e('0xa'));var client=jayson[_0xcd6e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x573daf,_0x7ca5cb,_0x4caf10){return new BPromise(function(_0x211b81,_0x4d1ca9){return client[_0xcd6e('0xc')](_0x573daf,_0x4caf10)[_0xcd6e('0xd')](function(_0x186ebb){logger[_0xcd6e('0xe')](_0xcd6e('0xf'),_0x7ca5cb,_0xcd6e('0x10'));logger[_0xcd6e('0x11')](_0xcd6e('0x12'),_0x7ca5cb,_0xcd6e('0x10'),JSON['stringify'](_0x186ebb));if(_0x186ebb[_0xcd6e('0x13')]){if(_0x186ebb[_0xcd6e('0x13')]['code']===0x1f4){logger['error'](_0xcd6e('0xf'),_0x7ca5cb,_0x186ebb[_0xcd6e('0x13')][_0xcd6e('0x14')]);return _0x4d1ca9(_0x186ebb[_0xcd6e('0x13')][_0xcd6e('0x14')]);}logger[_0xcd6e('0x13')](_0xcd6e('0xf'),_0x7ca5cb,_0x186ebb[_0xcd6e('0x13')][_0xcd6e('0x14')]);return _0x211b81(_0x186ebb['error'][_0xcd6e('0x14')]);}else{logger[_0xcd6e('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x7ca5cb,'request\x20sent');_0x211b81(_0x186ebb[_0xcd6e('0x15')][_0xcd6e('0x14')]);}})[_0xcd6e('0x16')](function(_0x3ed544){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x7ca5cb,_0x3ed544);_0x4d1ca9(_0x3ed544);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index b8570db..fa96f2a 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(_0x397a80,_0x2754a4){var _0x7086c1=function(_0x283a73){while(--_0x283a73){_0x397a80['push'](_0x397a80['shift']());}};_0x7086c1(++_0x2754a4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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(_0x4690d2,_0x32bf1e){var _0x4a19fe=function(_0x7ee1a){while(--_0x7ee1a){_0x4690d2['push'](_0x4690d2['shift']());}};_0x4a19fe(++_0x32bf1e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 72d74c0..8a49f9e 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 _0x9861=['STRING','TEXT','sequelize','name'];(function(_0x21a53f,_0x182961){var _0x23ca6c=function(_0xbbdeff){while(--_0xbbdeff){_0x21a53f['push'](_0x21a53f['shift']());}};_0x23ca6c(++_0x182961);}(_0x9861,0x176));var _0x1986=function(_0x1b46ef,_0x5d30c9){_0x1b46ef=_0x1b46ef-0x0;var _0x12eee9=_0x9861[_0x1b46ef];return _0x12eee9;};'use strict';var Sequelize=require(_0x1986('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1986('0x1')},'table':{'type':Sequelize[_0x1986('0x2')]},'metric':{'type':Sequelize[_0x1986('0x3')]},'description':{'type':Sequelize[_0x1986('0x2')]}};
\ No newline at end of file
+var _0x049e=['TEXT','STRING','sequelize','exports','name'];(function(_0xb953a,_0x3d230e){var _0x27ea69=function(_0x4c9b9e){while(--_0x4c9b9e){_0xb953a['push'](_0xb953a['shift']());}};_0x27ea69(++_0x3d230e);}(_0x049e,0x16a));var _0xe049=function(_0x1857d0,_0x6eade0){_0x1857d0=_0x1857d0-0x0;var _0x3e3c46=_0x049e[_0x1857d0];return _0x3e3c46;};'use strict';var Sequelize=require(_0xe049('0x0'));module[_0xe049('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe049('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xe049('0x3')]},'description':{'type':Sequelize[_0xe049('0x4')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 6ff85e2..f85619f 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 _0x81bd=['filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','AnalyticMetric','includeAll','include','findAll','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','Metrics','stack','name','send','index','map','fieldName','query','keys'];(function(_0x4ec48f,_0x21c136){var _0x39fe28=function(_0x342394){while(--_0x342394){_0x4ec48f['push'](_0x4ec48f['shift']());}};_0x39fe28(++_0x21c136);}(_0x81bd,0x7c));var _0xd81b=function(_0x1e6d9a,_0x548cf2){_0x1e6d9a=_0x1e6d9a-0x0;var _0x59b4da=_0x81bd[_0x1e6d9a];return _0x59b4da;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21dfff,_0x57f71d){_0x57f71d=_0x57f71d||0xcc;return function(_0x3f2405){if(_0x3f2405){return _0x21dfff[_0xd81b('0x1b')](_0x57f71d);}return _0x21dfff['status'](_0x57f71d)[_0xd81b('0x1c')]();};}function respondWithResult(_0x47dd04,_0x13dd00){_0x13dd00=_0x13dd00||0xc8;return function(_0x41bf7a){if(_0x41bf7a){return _0x47dd04[_0xd81b('0x1d')](_0x13dd00)[_0xd81b('0x1e')](_0x41bf7a);}};}function respondWithFilteredResult(_0x128162,_0x552215){return function(_0x1c620d){if(_0x1c620d){var _0x27b7a0=typeof _0x552215['offset']===_0xd81b('0x1f')&&typeof _0x552215[_0xd81b('0x20')]===_0xd81b('0x1f');var _0x15e860=_0x1c620d[_0xd81b('0x21')];var _0xc49b8d=_0x27b7a0?0x0:_0x552215[_0xd81b('0x22')];var _0x3d4d34=_0x27b7a0?_0x1c620d[_0xd81b('0x21')]:_0x552215[_0xd81b('0x22')]+_0x552215[_0xd81b('0x20')];var _0x453952;if(_0x3d4d34>=_0x15e860){_0x3d4d34=_0x15e860;_0x453952=0xc8;}else{_0x453952=0xce;}_0x128162[_0xd81b('0x1d')](_0x453952);return _0x128162[_0xd81b('0x23')](_0xd81b('0x24'),_0xc49b8d+'-'+_0x3d4d34+'/'+_0x15e860)[_0xd81b('0x1e')](_0x1c620d);}return null;};}function patchUpdates(_0x5f101a){return function(_0x4d566e){try{jsonpatch[_0xd81b('0x25')](_0x4d566e,_0x5f101a,!![]);}catch(_0x1b7876){return BPromise[_0xd81b('0x26')](_0x1b7876);}return _0x4d566e['save']();};}function saveUpdates(_0x19ed0e,_0x6571a6){return function(_0x542ee2){if(_0x542ee2){return _0x542ee2[_0xd81b('0x27')](_0x19ed0e)[_0xd81b('0x28')](function(_0x1670cd){return _0x1670cd;});}return null;};}function removeEntity(_0x1ad65c,_0x279176){return function(_0xcb4f91){if(_0xcb4f91){return _0xcb4f91[_0xd81b('0x29')]()[_0xd81b('0x28')](function(){var _0x341aec=_0xcb4f91[_0xd81b('0x2a')]({'plain':!![]});var _0x2ccedf=_0xd81b('0x2b');return db['UserProfileResource'][_0xd81b('0x29')]({'where':{'type':_0x2ccedf,'resourceId':_0x341aec['id']}})[_0xd81b('0x28')](function(){return _0xcb4f91;});})[_0xd81b('0x28')](function(){_0x1ad65c[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();});}};}function handleEntityNotFound(_0x2d0d02,_0x3e28dd){return function(_0x73dc09){if(!_0x73dc09){_0x2d0d02[_0xd81b('0x1b')](0x194);}return _0x73dc09;};}function handleError(_0x483a3d,_0x469cc4){_0x469cc4=_0x469cc4||0x1f4;return function(_0x4e2eff){logger['error'](_0x4e2eff[_0xd81b('0x2c')]);if(_0x4e2eff[_0xd81b('0x2d')]){delete _0x4e2eff['name'];}_0x483a3d['status'](_0x469cc4)[_0xd81b('0x2e')](_0x4e2eff);};}exports[_0xd81b('0x2f')]=function(_0x1b1434,_0x289f54){var _0x1a1572={},_0x4654ba={},_0x5527ed={'count':0x0,'rows':[]};var _0x37d381=_[_0xd81b('0x30')](db['AnalyticMetric']['rawAttributes'],function(_0x165892){return{'name':_0x165892[_0xd81b('0x31')],'type':_0x165892['type']['key']};});_0x4654ba['model']=_[_0xd81b('0x30')](_0x37d381,_0xd81b('0x2d'));_0x4654ba[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x1b1434[_0xd81b('0x32')]);_0x4654ba[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x4654ba['model'],_0x4654ba[_0xd81b('0x32')]);_0x1a1572['attributes']=_[_0xd81b('0x35')](_0x4654ba[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x37')]));_0x1a1572[_0xd81b('0x38')]=_0x1a1572[_0xd81b('0x38')][_0xd81b('0x39')]?_0x1a1572[_0xd81b('0x38')]:_0x4654ba[_0xd81b('0x36')];if(!_0x1b1434[_0xd81b('0x32')][_0xd81b('0x3a')](_0xd81b('0x3b'))){_0x1a1572['limit']=qs['limit'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x20')]);_0x1a1572[_0xd81b('0x22')]=qs['offset'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x22')]);}_0x1a1572['order']=qs[_0xd81b('0x3c')](_0x1b1434[_0xd81b('0x32')]['sort']);_0x1a1572[_0xd81b('0x3d')]=qs['filters'](_[_0xd81b('0x3e')](_0x1b1434[_0xd81b('0x32')],_0x4654ba[_0xd81b('0x34')]),_0x37d381);if(_0x1b1434[_0xd81b('0x32')]['filter']){_0x1a1572[_0xd81b('0x3d')]=_[_0xd81b('0x3f')](_0x1a1572[_0xd81b('0x3d')],{'$or':_[_0xd81b('0x30')](_0x37d381,function(_0x3abd60){if(_0x3abd60[_0xd81b('0x40')]!==_0xd81b('0x41')){var _0x532ada={};_0x532ada[_0x3abd60[_0xd81b('0x2d')]]={'$like':'%'+_0x1b1434[_0xd81b('0x32')][_0xd81b('0x42')]+'%'};return _0x532ada;}})});}_0x1a1572=_['merge']({},_0x1a1572,_0x1b1434[_0xd81b('0x43')]);var _0x3a05f4={'where':_0x1a1572[_0xd81b('0x3d')]};return db[_0xd81b('0x44')][_0xd81b('0x21')](_0x3a05f4)['then'](function(_0x3dfba7){_0x5527ed[_0xd81b('0x21')]=_0x3dfba7;if(_0x1b1434[_0xd81b('0x32')][_0xd81b('0x45')]){_0x1a1572[_0xd81b('0x46')]=[{'all':!![]}];}return db[_0xd81b('0x44')][_0xd81b('0x47')](_0x1a1572);})[_0xd81b('0x28')](function(_0x4405a8){_0x5527ed[_0xd81b('0x48')]=_0x4405a8;return _0x5527ed;})[_0xd81b('0x28')](respondWithFilteredResult(_0x289f54,_0x1a1572))['catch'](handleError(_0x289f54,null));};exports[_0xd81b('0x49')]=function(_0x2778b3,_0x25824e){var _0xa5e391={'raw':!![],'where':{'id':_0x2778b3[_0xd81b('0x4a')]['id']}},_0x1e6654={};_0x1e6654[_0xd81b('0x36')]=_[_0xd81b('0x33')](db['AnalyticMetric']['rawAttributes']);_0x1e6654[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x2778b3[_0xd81b('0x32')]);_0x1e6654[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],_0x1e6654[_0xd81b('0x32')]);_0xa5e391[_0xd81b('0x38')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x2778b3[_0xd81b('0x32')]['fields']));_0xa5e391[_0xd81b('0x38')]=_0xa5e391[_0xd81b('0x38')][_0xd81b('0x39')]?_0xa5e391[_0xd81b('0x38')]:_0x1e6654[_0xd81b('0x36')];if(_0x2778b3[_0xd81b('0x32')][_0xd81b('0x45')]){_0xa5e391[_0xd81b('0x46')]=[{'all':!![]}];}_0xa5e391=_[_0xd81b('0x3f')]({},_0xa5e391,_0x2778b3['options']);return db[_0xd81b('0x44')][_0xd81b('0x4b')](_0xa5e391)[_0xd81b('0x28')](handleEntityNotFound(_0x25824e,null))[_0xd81b('0x28')](respondWithResult(_0x25824e,null))['catch'](handleError(_0x25824e,null));};exports[_0xd81b('0x4c')]=function(_0x151127,_0x15030b){return db[_0xd81b('0x44')][_0xd81b('0x4c')](_0x151127[_0xd81b('0x4d')],{})[_0xd81b('0x28')](function(_0x43d7ce){var _0x133a76=_0x151127['user']['get']({'plain':!![]});if(!_0x133a76)throw new Error(_0xd81b('0x4e'));if(_0x133a76[_0xd81b('0x4f')]===_0xd81b('0x50')){var _0x4da281=_0x43d7ce[_0xd81b('0x2a')]({'plain':!![]});var _0x3d6ab3=_0xd81b('0x2b');return db[_0xd81b('0x51')]['find']({'where':{'name':_0x3d6ab3,'userProfileId':_0x133a76[_0xd81b('0x52')]},'raw':!![]})[_0xd81b('0x28')](function(_0x1b523c){if(_0x1b523c&&_0x1b523c[_0xd81b('0x53')]===0x0){return db[_0xd81b('0x54')]['create']({'name':_0x4da281[_0xd81b('0x2d')],'resourceId':_0x4da281['id'],'type':_0x1b523c[_0xd81b('0x2d')],'sectionId':_0x1b523c['id']},{})['then'](function(){return _0x43d7ce;});}else{return _0x43d7ce;}})[_0xd81b('0x55')](function(_0x315bd5){logger[_0xd81b('0x56')](_0xd81b('0x57'),_0x315bd5);throw _0x315bd5;});}return _0x43d7ce;})[_0xd81b('0x28')](respondWithResult(_0x15030b,0xc9))[_0xd81b('0x55')](handleError(_0x15030b,null));};exports[_0xd81b('0x27')]=function(_0x22f588,_0x3ed626){if(_0x22f588[_0xd81b('0x4d')]['id']){delete _0x22f588[_0xd81b('0x4d')]['id'];}return db['AnalyticMetric'][_0xd81b('0x4b')]({'where':{'id':_0x22f588['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x3ed626,null))[_0xd81b('0x28')](saveUpdates(_0x22f588[_0xd81b('0x4d')],null))[_0xd81b('0x28')](respondWithResult(_0x3ed626,null))[_0xd81b('0x55')](handleError(_0x3ed626,null));};exports[_0xd81b('0x29')]=function(_0x5c196a,_0x2d978d){return db[_0xd81b('0x44')]['find']({'where':{'id':_0x5c196a['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x2d978d,null))['then'](removeEntity(_0x2d978d,null))[_0xd81b('0x55')](handleError(_0x2d978d,null));};
\ No newline at end of file
+var _0x9957=['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','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','Metrics','UserProfileResource','end','error','name','map','type','key','model','keys','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','AnalyticMetric','include','findAll','rawAttributes','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x507403,_0x3f954d){var _0x1327c=function(_0x2aea1b){while(--_0x2aea1b){_0x507403['push'](_0x507403['shift']());}};_0x1327c(++_0x3f954d);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){var _0x472195=_0x563799['get']({'plain':!![]});var _0x39df42=_0x7995('0x28');return db[_0x7995('0x29')][_0x7995('0x27')]({'where':{'type':_0x39df42,'resourceId':_0x472195['id']}})[_0x7995('0x26')](function(){return _0x563799;});})[_0x7995('0x26')](function(){_0x204507['status'](0xcc)[_0x7995('0x2a')]();});}};}function handleEntityNotFound(_0x5911c3,_0x229742){return function(_0x49bc7e){if(!_0x49bc7e){_0x5911c3[_0x7995('0x1b')](0x194);}return _0x49bc7e;};}function handleError(_0x132a42,_0x11c1eb){_0x11c1eb=_0x11c1eb||0x1f4;return function(_0x4b6f99){logger[_0x7995('0x2b')](_0x4b6f99['stack']);if(_0x4b6f99[_0x7995('0x2c')]){delete _0x4b6f99[_0x7995('0x2c')];}_0x132a42[_0x7995('0x1c')](_0x11c1eb)['send'](_0x4b6f99);};}exports['index']=function(_0x48e573,_0x3573be){var _0xe6b0b3={},_0x327a81={},_0x2b874d={'count':0x0,'rows':[]};var _0x2e3493=_[_0x7995('0x2d')](db['AnalyticMetric']['rawAttributes'],function(_0xfa8f15){return{'name':_0xfa8f15['fieldName'],'type':_0xfa8f15[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x327a81[_0x7995('0x30')]=_[_0x7995('0x2d')](_0x2e3493,_0x7995('0x2c'));_0x327a81['query']=_[_0x7995('0x31')](_0x48e573[_0x7995('0x32')]);_0x327a81['filters']=_['intersection'](_0x327a81['model'],_0x327a81[_0x7995('0x32')]);_0xe6b0b3[_0x7995('0x33')]=_['intersection'](_0x327a81[_0x7995('0x30')],qs['fields'](_0x48e573[_0x7995('0x32')][_0x7995('0x34')]));_0xe6b0b3[_0x7995('0x33')]=_0xe6b0b3['attributes']['length']?_0xe6b0b3[_0x7995('0x33')]:_0x327a81['model'];if(!_0x48e573['query'][_0x7995('0x35')](_0x7995('0x36'))){_0xe6b0b3['limit']=qs[_0x7995('0x21')](_0x48e573[_0x7995('0x32')][_0x7995('0x21')]);_0xe6b0b3[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x48e573['query'][_0x7995('0x20')]);}_0xe6b0b3[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x48e573[_0x7995('0x32')]['sort']);_0xe6b0b3[_0x7995('0x39')]=qs[_0x7995('0x3a')](_[_0x7995('0x3b')](_0x48e573[_0x7995('0x32')],_0x327a81[_0x7995('0x3a')]),_0x2e3493);if(_0x48e573[_0x7995('0x32')]['filter']){_0xe6b0b3[_0x7995('0x39')]=_[_0x7995('0x3c')](_0xe6b0b3[_0x7995('0x39')],{'$or':_[_0x7995('0x2d')](_0x2e3493,function(_0x2e04cd){if(_0x2e04cd[_0x7995('0x2e')]!==_0x7995('0x3d')){var _0x270c0e={};_0x270c0e[_0x2e04cd[_0x7995('0x2c')]]={'$like':'%'+_0x48e573[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x270c0e;}})});}_0xe6b0b3=_[_0x7995('0x3c')]({},_0xe6b0b3,_0x48e573[_0x7995('0x3f')]);var _0x53cda2={'where':_0xe6b0b3['where']};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x53cda2)['then'](function(_0x4b0855){_0x2b874d[_0x7995('0x1f')]=_0x4b0855;if(_0x48e573['query']['includeAll']){_0xe6b0b3[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x42')](_0xe6b0b3);})['then'](function(_0x46ac4f){_0x2b874d['rows']=_0x46ac4f;return _0x2b874d;})[_0x7995('0x26')](respondWithFilteredResult(_0x3573be,_0xe6b0b3))['catch'](handleError(_0x3573be,null));};exports['show']=function(_0x39c5b8,_0x403f54){var _0xc04e5={'raw':!![],'where':{'id':_0x39c5b8['params']['id']}},_0x3f1c35={};_0x3f1c35[_0x7995('0x30')]=_[_0x7995('0x31')](db[_0x7995('0x40')][_0x7995('0x43')]);_0x3f1c35['query']=_['keys'](_0x39c5b8[_0x7995('0x32')]);_0x3f1c35['filters']=_[_0x7995('0x44')](_0x3f1c35['model'],_0x3f1c35[_0x7995('0x32')]);_0xc04e5['attributes']=_[_0x7995('0x44')](_0x3f1c35[_0x7995('0x30')],qs['fields'](_0x39c5b8[_0x7995('0x32')][_0x7995('0x34')]));_0xc04e5[_0x7995('0x33')]=_0xc04e5[_0x7995('0x33')]['length']?_0xc04e5[_0x7995('0x33')]:_0x3f1c35[_0x7995('0x30')];if(_0x39c5b8[_0x7995('0x32')]['includeAll']){_0xc04e5[_0x7995('0x41')]=[{'all':!![]}];}_0xc04e5=_[_0x7995('0x3c')]({},_0xc04e5,_0x39c5b8[_0x7995('0x3f')]);return db[_0x7995('0x40')][_0x7995('0x45')](_0xc04e5)['then'](handleEntityNotFound(_0x403f54,null))[_0x7995('0x26')](respondWithResult(_0x403f54,null))[_0x7995('0x46')](handleError(_0x403f54,null));};exports['create']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x40')][_0x7995('0x47')](_0x3d1dbb[_0x7995('0x48')],{})[_0x7995('0x26')](function(_0xddf537){var _0x14b537=_0x3d1dbb[_0x7995('0x49')]['get']({'plain':!![]});if(!_0x14b537)throw new Error(_0x7995('0x4a'));if(_0x14b537[_0x7995('0x4b')]===_0x7995('0x49')){var _0x4ffc8a=_0xddf537[_0x7995('0x4c')]({'plain':!![]});var _0x1fe77e=_0x7995('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x1fe77e,'userProfileId':_0x14b537['userProfileId']},'raw':!![]})[_0x7995('0x26')](function(_0x1fd1ca){if(_0x1fd1ca&&_0x1fd1ca['autoAssociation']===0x0){return db[_0x7995('0x29')][_0x7995('0x47')]({'name':_0x4ffc8a[_0x7995('0x2c')],'resourceId':_0x4ffc8a['id'],'type':_0x1fd1ca[_0x7995('0x2c')],'sectionId':_0x1fd1ca['id']},{})[_0x7995('0x26')](function(){return _0xddf537;});}else{return _0xddf537;}})['catch'](function(_0x29ee32){logger['error'](_0x7995('0x4d'),_0x29ee32);throw _0x29ee32;});}return _0xddf537;})[_0x7995('0x26')](respondWithResult(_0x5843ba,0xc9))[_0x7995('0x46')](handleError(_0x5843ba,null));};exports['update']=function(_0x5e1f34,_0x54e2b1){if(_0x5e1f34['body']['id']){delete _0x5e1f34[_0x7995('0x48')]['id'];}return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0x5e1f34[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x54e2b1,null))[_0x7995('0x26')](saveUpdates(_0x5e1f34[_0x7995('0x48')],null))[_0x7995('0x26')](respondWithResult(_0x54e2b1,null))[_0x7995('0x46')](handleError(_0x54e2b1,null));};exports[_0x7995('0x27')]=function(_0xa7af8c,_0x133c63){return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0xa7af8c[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x133c63,null))[_0x7995('0x26')](removeEntity(_0x133c63,null))[_0x7995('0x46')](handleError(_0x133c63,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index d3a1739..eec9353 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 _0xa63f=['request-promise','path','rimraf','../../config/environment','define','AnalyticMetric','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x58ce0d,_0x3038cd){var _0x1eb027=function(_0x39efe1){while(--_0x39efe1){_0x58ce0d['push'](_0x58ce0d['shift']());}};_0x1eb027(++_0x3038cd);}(_0xa63f,0x1b6));var _0xfa63=function(_0xe4d6c6,_0x3bdbf2){_0xe4d6c6=_0xe4d6c6-0x0;var _0x3a8935=_0xa63f[_0xe4d6c6];return _0x3a8935;};'use strict';var _=require(_0xfa63('0x0'));var util=require(_0xfa63('0x1'));var logger=require(_0xfa63('0x2'))(_0xfa63('0x3'));var moment=require(_0xfa63('0x4'));var BPromise=require(_0xfa63('0x5'));var rp=require(_0xfa63('0x6'));var fs=require('fs');var path=require(_0xfa63('0x7'));var rimraf=require(_0xfa63('0x8'));var config=require(_0xfa63('0x9'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x20d4f6,_0x41efce){return _0x20d4f6[_0xfa63('0xa')](_0xfa63('0xb'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8b8e=['lodash','../../config/logger','moment','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics'];(function(_0x1a77bc,_0x1e48de){var _0x5d1aec=function(_0x1e9673){while(--_0x1e9673){_0x1a77bc['push'](_0x1a77bc['shift']());}};_0x5d1aec(++_0x1e48de);}(_0x8b8e,0x108));var _0xe8b8=function(_0x49bf07,_0x3cd323){_0x49bf07=_0x49bf07-0x0;var _0x4e9276=_0x8b8e[_0x49bf07];return _0x4e9276;};'use strict';var _=require(_0xe8b8('0x0'));var util=require('util');var logger=require(_0xe8b8('0x1'))('api');var moment=require(_0xe8b8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe8b8('0x3'));var rimraf=require(_0xe8b8('0x4'));var config=require(_0xe8b8('0x5'));var attributes=require(_0xe8b8('0x6'));module[_0xe8b8('0x7')]=function(_0x3f5dd7,_0x1c0548){return _0x3f5dd7[_0xe8b8('0x8')](_0xe8b8('0x9'),attributes,{'tableName':_0xe8b8('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 3bc7814..0d8c05f 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 _0x95f9=['jayson/promise','client','http','info','AnalyticMetric,\x20%s,\x20%s','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','../../mysqldb','../../config/logger','../../config/environment'];(function(_0xc63c19,_0xccae28){var _0x3c1a6b=function(_0xb5d410){while(--_0xb5d410){_0xc63c19['push'](_0xc63c19['shift']());}};_0x3c1a6b(++_0xccae28);}(_0x95f9,0x10c));var _0x995f=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x95f9[_0x381589];return _0x2a075d;};'use strict';var _=require(_0x995f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x995f('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x995f('0x2'))('rpc');var config=require(_0x995f('0x3'));var jayson=require(_0x995f('0x4'));var client=jayson[_0x995f('0x5')][_0x995f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1ce329,_0x1a0428,_0x250505){return new BPromise(function(_0x1e47d0,_0x28e25b){return client['request'](_0x1ce329,_0x250505)['then'](function(_0x5d786e){logger[_0x995f('0x7')](_0x995f('0x8'),_0x1a0428,'request\x20sent');logger['debug'](_0x995f('0x9'),_0x1a0428,_0x995f('0xa'),JSON[_0x995f('0xb')](_0x5d786e));if(_0x5d786e[_0x995f('0xc')]){if(_0x5d786e['error'][_0x995f('0xd')]===0x1f4){logger['error'](_0x995f('0x8'),_0x1a0428,_0x5d786e[_0x995f('0xc')][_0x995f('0xe')]);return _0x28e25b(_0x5d786e[_0x995f('0xc')]['message']);}logger[_0x995f('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x1a0428,_0x5d786e[_0x995f('0xc')][_0x995f('0xe')]);return _0x1e47d0(_0x5d786e['error'][_0x995f('0xe')]);}else{logger[_0x995f('0x7')]('AnalyticMetric,\x20%s,\x20%s',_0x1a0428,_0x995f('0xa'));_0x1e47d0(_0x5d786e[_0x995f('0xf')][_0x995f('0xe')]);}})['catch'](function(_0x232edd){logger[_0x995f('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x1a0428,_0x232edd);_0x28e25b(_0x232edd);});});}
\ No newline at end of file
+var _0x051a=['jayson/promise','client','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x051a,0x198));var _0xa051=function(_0x4b4a8f,_0x73c713){_0x4b4a8f=_0x4b4a8f-0x0;var _0x562df5=_0x051a[_0x4b4a8f];return _0x562df5;};'use strict';var _=require(_0xa051('0x0'));var util=require(_0xa051('0x1'));var moment=require(_0xa051('0x2'));var BPromise=require('bluebird');var rs=require(_0xa051('0x3'));var fs=require('fs');var Redis=require(_0xa051('0x4'));var db=require(_0xa051('0x5'))['db'];var utils=require(_0xa051('0x6'));var logger=require(_0xa051('0x7'))(_0xa051('0x8'));var config=require(_0xa051('0x9'));var jayson=require(_0xa051('0xa'));var client=jayson[_0xa051('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ec0c7,_0x26de82,_0x26324e){return new BPromise(function(_0x2fbce6,_0x84dd93){return client[_0xa051('0xc')](_0x5ec0c7,_0x26324e)[_0xa051('0xd')](function(_0x171850){logger[_0xa051('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x26de82,_0xa051('0xf'));logger[_0xa051('0x10')](_0xa051('0x11'),_0x26de82,_0xa051('0xf'),JSON[_0xa051('0x12')](_0x171850));if(_0x171850[_0xa051('0x13')]){if(_0x171850[_0xa051('0x13')]['code']===0x1f4){logger[_0xa051('0x13')](_0xa051('0x14'),_0x26de82,_0x171850[_0xa051('0x13')][_0xa051('0x15')]);return _0x84dd93(_0x171850[_0xa051('0x13')][_0xa051('0x15')]);}logger[_0xa051('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x26de82,_0x171850[_0xa051('0x13')][_0xa051('0x15')]);return _0x2fbce6(_0x171850[_0xa051('0x13')][_0xa051('0x15')]);}else{logger[_0xa051('0xe')](_0xa051('0x14'),_0x26de82,_0xa051('0xf'));_0x2fbce6(_0x171850['result']['message']);}})['catch'](function(_0x36dbcc){logger[_0xa051('0x13')](_0xa051('0x14'),_0x26de82,_0x36dbcc);_0x84dd93(_0x36dbcc);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 6491985..6324ecc 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 _0x0b3d=['express','fs-extra','../../components/interaction/service','./analyticMetric.controller','get','index','/:id','post','put','isAuthenticated','update','destroy','exports','multer','path'];(function(_0x1e85b3,_0x11726d){var _0x20835a=function(_0x438dee){while(--_0x438dee){_0x1e85b3['push'](_0x1e85b3['shift']());}};_0x20835a(++_0x11726d);}(_0x0b3d,0x76));var _0xd0b3=function(_0x44c44b,_0x57e40d){_0x44c44b=_0x44c44b-0x0;var _0xb29ca8=_0x0b3d[_0x44c44b];return _0xb29ca8;};'use strict';var multer=require(_0xd0b3('0x0'));var util=require('util');var path=require(_0xd0b3('0x1'));var timeout=require('connect-timeout');var express=require(_0xd0b3('0x2'));var router=express['Router']();var fs_extra=require(_0xd0b3('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd0b3('0x4'));var config=require('../../config/environment');var controller=require(_0xd0b3('0x5'));router[_0xd0b3('0x6')]('/',auth['isAuthenticated'](),controller[_0xd0b3('0x7')]);router['get'](_0xd0b3('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xd0b3('0x9')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd0b3('0xa')]('/:id',auth[_0xd0b3('0xb')](),controller[_0xd0b3('0xc')]);router['delete']('/:id',auth[_0xd0b3('0xb')](),controller[_0xd0b3('0xd')]);module[_0xd0b3('0xe')]=router;
\ No newline at end of file
+var _0xa4dc=['put','/:id','update','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','show','post'];(function(_0x1492b1,_0x1a7f9a){var _0x4fff7c=function(_0x1175bf){while(--_0x1175bf){_0x1492b1['push'](_0x1492b1['shift']());}};_0x4fff7c(++_0x1a7f9a);}(_0xa4dc,0x16a));var _0xca4d=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0xa4dc[_0x4e7d25];return _0x526fe6;};'use strict';var multer=require(_0xca4d('0x0'));var util=require(_0xca4d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xca4d('0x2'));var router=express[_0xca4d('0x3')]();var fs_extra=require(_0xca4d('0x4'));var auth=require(_0xca4d('0x5'));var interaction=require(_0xca4d('0x6'));var config=require('../../config/environment');var controller=require(_0xca4d('0x7'));router[_0xca4d('0x8')]('/',auth[_0xca4d('0x9')](),controller['index']);router[_0xca4d('0x8')]('/:id',auth[_0xca4d('0x9')](),controller[_0xca4d('0xa')]);router[_0xca4d('0xb')]('/',auth[_0xca4d('0x9')](),controller['create']);router[_0xca4d('0xc')](_0xca4d('0xd'),auth['isAuthenticated'](),controller[_0xca4d('0xe')]);router['delete'](_0xca4d('0xd'),auth[_0xca4d('0x9')](),controller[_0xca4d('0xf')]);module[_0xca4d('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index e037e72..e2298f7 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 _0x22e7=['exports','TEXT','sequelize'];(function(_0x546b62,_0x2e9a97){var _0x50ef01=function(_0x352ee7){while(--_0x352ee7){_0x546b62['push'](_0x546b62['shift']());}};_0x50ef01(++_0x2e9a97);}(_0x22e7,0x188));var _0x722e=function(_0xac9cb9,_0x75280f){_0xac9cb9=_0xac9cb9-0x0;var _0xccf29b=_0x22e7[_0xac9cb9];return _0xccf29b;};'use strict';var Sequelize=require(_0x722e('0x0'));module[_0x722e('0x1')]={'tree':{'type':Sequelize[_0x722e('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xf7b1=['sequelize'];(function(_0x5f52a4,_0x5706d9){var _0xde1bce=function(_0x16ef65){while(--_0x16ef65){_0x5f52a4['push'](_0x5f52a4['shift']());}};_0xde1bce(++_0x5706d9);}(_0xf7b1,0x197));var _0x1f7b=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xf7b1[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require(_0x1f7b('0x0'));module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 4fb5e4d..6ced81a 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 _0x8fd7=['filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticTreeReport','include','rows','catch','show','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','rawAttributes','fieldName','key','model','map','query','keys'];(function(_0x26d89d,_0x291e31){var _0x3a74f4=function(_0x16281e){while(--_0x16281e){_0x26d89d['push'](_0x26d89d['shift']());}};_0x3a74f4(++_0x291e31);}(_0x8fd7,0x1e6));var _0x78fd=function(_0x25e412,_0x177961){_0x25e412=_0x25e412-0x0;var _0x34042f=_0x8fd7[_0x25e412];return _0x34042f;};'use strict';var emlformat=require(_0x78fd('0x0'));var rimraf=require(_0x78fd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x78fd('0x2'));var rp=require(_0x78fd('0x3'));var moment=require(_0x78fd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x78fd('0x5'));var util=require(_0x78fd('0x6'));var path=require('path');var sox=require(_0x78fd('0x7'));var csv=require(_0x78fd('0x8'));var ejs=require(_0x78fd('0x9'));var fs=require('fs');var fs_extra=require(_0x78fd('0xa'));var _=require(_0x78fd('0xb'));var squel=require(_0x78fd('0xc'));var crypto=require(_0x78fd('0xd'));var jsforce=require(_0x78fd('0xe'));var deskjs=require(_0x78fd('0xf'));var toCsv=require(_0x78fd('0x8'));var querystring=require(_0x78fd('0x10'));var Papa=require(_0x78fd('0x11'));var Redis=require(_0x78fd('0x12'));var authService=require(_0x78fd('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x78fd('0x14'));var hardwareService=require(_0x78fd('0x15'));var logger=require(_0x78fd('0x16'))(_0x78fd('0x17'));var utils=require(_0x78fd('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x78fd('0x19'));var db=require(_0x78fd('0x1a'))['db'];function respondWithStatusCode(_0x68b0eb,_0x109805){_0x109805=_0x109805||0xcc;return function(_0x4fe5b4){if(_0x4fe5b4){return _0x68b0eb[_0x78fd('0x1b')](_0x109805);}return _0x68b0eb[_0x78fd('0x1c')](_0x109805)[_0x78fd('0x1d')]();};}function respondWithResult(_0xa90a70,_0x584301){_0x584301=_0x584301||0xc8;return function(_0x3c7c71){if(_0x3c7c71){return _0xa90a70[_0x78fd('0x1c')](_0x584301)[_0x78fd('0x1e')](_0x3c7c71);}};}function respondWithFilteredResult(_0xd668a4,_0x5c49a7){return function(_0x149cfd){if(_0x149cfd){var _0x23aac9=typeof _0x5c49a7[_0x78fd('0x1f')]===_0x78fd('0x20')&&typeof _0x5c49a7['limit']===_0x78fd('0x20');var _0x1d3440=_0x149cfd[_0x78fd('0x21')];var _0x4e4164=_0x23aac9?0x0:_0x5c49a7['offset'];var _0x4d48dd=_0x23aac9?_0x149cfd[_0x78fd('0x21')]:_0x5c49a7['offset']+_0x5c49a7[_0x78fd('0x22')];var _0x394787;if(_0x4d48dd>=_0x1d3440){_0x4d48dd=_0x1d3440;_0x394787=0xc8;}else{_0x394787=0xce;}_0xd668a4[_0x78fd('0x1c')](_0x394787);return _0xd668a4[_0x78fd('0x23')](_0x78fd('0x24'),_0x4e4164+'-'+_0x4d48dd+'/'+_0x1d3440)[_0x78fd('0x1e')](_0x149cfd);}return null;};}function patchUpdates(_0xb21943){return function(_0x199cb3){try{jsonpatch[_0x78fd('0x25')](_0x199cb3,_0xb21943,!![]);}catch(_0x1610ea){return BPromise[_0x78fd('0x26')](_0x1610ea);}return _0x199cb3[_0x78fd('0x27')]();};}function saveUpdates(_0x4723b5,_0x29d7b7){return function(_0x2934a8){if(_0x2934a8){return _0x2934a8[_0x78fd('0x28')](_0x4723b5)[_0x78fd('0x29')](function(_0x58ab44){return _0x58ab44;});}return null;};}function removeEntity(_0x33c165,_0x11131d){return function(_0x4351e5){if(_0x4351e5){return _0x4351e5[_0x78fd('0x2a')]()['then'](function(){_0x33c165[_0x78fd('0x1c')](0xcc)[_0x78fd('0x1d')]();});}};}function handleEntityNotFound(_0x3ba0a3,_0x53dd73){return function(_0x37b71e){if(!_0x37b71e){_0x3ba0a3['sendStatus'](0x194);}return _0x37b71e;};}function handleError(_0x331f11,_0x37ceed){_0x37ceed=_0x37ceed||0x1f4;return function(_0x13f7dd){logger['error'](_0x13f7dd[_0x78fd('0x2b')]);if(_0x13f7dd[_0x78fd('0x2c')]){delete _0x13f7dd[_0x78fd('0x2c')];}_0x331f11[_0x78fd('0x1c')](_0x37ceed)[_0x78fd('0x2d')](_0x13f7dd);};}exports['index']=function(_0x2b38dc,_0x4514c1){var _0x14bd04={},_0x2beedc={},_0x4db5b2={'count':0x0,'rows':[]};var _0x4387ca=_['map'](db['AnalyticTreeReport'][_0x78fd('0x2e')],function(_0x493b32){return{'name':_0x493b32[_0x78fd('0x2f')],'type':_0x493b32['type'][_0x78fd('0x30')]};});_0x2beedc[_0x78fd('0x31')]=_[_0x78fd('0x32')](_0x4387ca,'name');_0x2beedc[_0x78fd('0x33')]=_[_0x78fd('0x34')](_0x2b38dc[_0x78fd('0x33')]);_0x2beedc[_0x78fd('0x35')]=_[_0x78fd('0x36')](_0x2beedc[_0x78fd('0x31')],_0x2beedc['query']);_0x14bd04['attributes']=_['intersection'](_0x2beedc[_0x78fd('0x31')],qs[_0x78fd('0x37')](_0x2b38dc[_0x78fd('0x33')][_0x78fd('0x37')]));_0x14bd04['attributes']=_0x14bd04['attributes'][_0x78fd('0x38')]?_0x14bd04[_0x78fd('0x39')]:_0x2beedc[_0x78fd('0x31')];if(!_0x2b38dc[_0x78fd('0x33')][_0x78fd('0x3a')](_0x78fd('0x3b'))){_0x14bd04[_0x78fd('0x22')]=qs[_0x78fd('0x22')](_0x2b38dc['query'][_0x78fd('0x22')]);_0x14bd04[_0x78fd('0x1f')]=qs[_0x78fd('0x1f')](_0x2b38dc[_0x78fd('0x33')][_0x78fd('0x1f')]);}_0x14bd04[_0x78fd('0x3c')]=qs[_0x78fd('0x3d')](_0x2b38dc[_0x78fd('0x33')]['sort']);_0x14bd04[_0x78fd('0x3e')]=qs[_0x78fd('0x35')](_[_0x78fd('0x3f')](_0x2b38dc['query'],_0x2beedc[_0x78fd('0x35')]),_0x4387ca);if(_0x2b38dc[_0x78fd('0x33')][_0x78fd('0x40')]){_0x14bd04[_0x78fd('0x3e')]=_[_0x78fd('0x41')](_0x14bd04[_0x78fd('0x3e')],{'$or':_[_0x78fd('0x32')](_0x4387ca,function(_0x50029a){if(_0x50029a['type']!==_0x78fd('0x42')){var _0x24ef80={};_0x24ef80[_0x50029a[_0x78fd('0x2c')]]={'$like':'%'+_0x2b38dc['query'][_0x78fd('0x40')]+'%'};return _0x24ef80;}})});}_0x14bd04=_['merge']({},_0x14bd04,_0x2b38dc[_0x78fd('0x43')]);var _0x3a852a={'where':_0x14bd04['where']};return db[_0x78fd('0x44')][_0x78fd('0x21')](_0x3a852a)['then'](function(_0x36fd69){_0x4db5b2[_0x78fd('0x21')]=_0x36fd69;if(_0x2b38dc[_0x78fd('0x33')]['includeAll']){_0x14bd04[_0x78fd('0x45')]=[{'all':!![]}];}return db[_0x78fd('0x44')]['findAll'](_0x14bd04);})[_0x78fd('0x29')](function(_0x1a9a16){_0x4db5b2[_0x78fd('0x46')]=_0x1a9a16;return _0x4db5b2;})[_0x78fd('0x29')](respondWithFilteredResult(_0x4514c1,_0x14bd04))[_0x78fd('0x47')](handleError(_0x4514c1,null));};exports[_0x78fd('0x48')]=function(_0x413dd2,_0x17a052){var _0x3672d3={'raw':!![],'where':{'id':_0x413dd2[_0x78fd('0x49')]['id']}},_0xb3579f={};_0xb3579f[_0x78fd('0x31')]=_[_0x78fd('0x34')](db[_0x78fd('0x44')][_0x78fd('0x2e')]);_0xb3579f[_0x78fd('0x33')]=_[_0x78fd('0x34')](_0x413dd2[_0x78fd('0x33')]);_0xb3579f[_0x78fd('0x35')]=_['intersection'](_0xb3579f[_0x78fd('0x31')],_0xb3579f[_0x78fd('0x33')]);_0x3672d3[_0x78fd('0x39')]=_[_0x78fd('0x36')](_0xb3579f['model'],qs[_0x78fd('0x37')](_0x413dd2[_0x78fd('0x33')][_0x78fd('0x37')]));_0x3672d3['attributes']=_0x3672d3[_0x78fd('0x39')][_0x78fd('0x38')]?_0x3672d3[_0x78fd('0x39')]:_0xb3579f[_0x78fd('0x31')];if(_0x413dd2[_0x78fd('0x33')]['includeAll']){_0x3672d3['include']=[{'all':!![]}];}_0x3672d3=_[_0x78fd('0x41')]({},_0x3672d3,_0x413dd2[_0x78fd('0x43')]);return db['AnalyticTreeReport'][_0x78fd('0x4a')](_0x3672d3)[_0x78fd('0x29')](handleEntityNotFound(_0x17a052,null))[_0x78fd('0x29')](respondWithResult(_0x17a052,null))[_0x78fd('0x47')](handleError(_0x17a052,null));};exports[_0x78fd('0x4b')]=function(_0xed3e90,_0x40fce7){return db[_0x78fd('0x44')][_0x78fd('0x4b')](_0xed3e90[_0x78fd('0x4c')],{})['then'](respondWithResult(_0x40fce7,0xc9))[_0x78fd('0x47')](handleError(_0x40fce7,null));};exports['update']=function(_0x35fbf6,_0x5293ad){if(_0x35fbf6[_0x78fd('0x4c')]['id']){delete _0x35fbf6['body']['id'];}return db[_0x78fd('0x44')][_0x78fd('0x4a')]({'where':{'id':_0x35fbf6[_0x78fd('0x49')]['id']}})['then'](handleEntityNotFound(_0x5293ad,null))[_0x78fd('0x29')](saveUpdates(_0x35fbf6[_0x78fd('0x4c')],null))[_0x78fd('0x29')](respondWithResult(_0x5293ad,null))[_0x78fd('0x47')](handleError(_0x5293ad,null));};exports['destroy']=function(_0x54a1dc,_0x57fdbf){return db[_0x78fd('0x44')][_0x78fd('0x4a')]({'where':{'id':_0x54a1dc[_0x78fd('0x49')]['id']}})[_0x78fd('0x29')](handleEntityNotFound(_0x57fdbf,null))['then'](removeEntity(_0x57fdbf,null))[_0x78fd('0x47')](handleError(_0x57fdbf,null));};
\ No newline at end of file
+var _0x301c=['lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','sendStatus','error','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x4e46fd,_0x55dcbb){var _0x2b4a68=function(_0x3a0551){while(--_0x3a0551){_0x4e46fd['push'](_0x4e46fd['shift']());}};_0x2b4a68(++_0x55dcbb);}(_0x301c,0x93));var _0xc301=function(_0x2563e4,_0x456262){_0x2563e4=_0x2563e4-0x0;var _0x53e6d8=_0x301c[_0x2563e4];return _0x53e6d8;};'use strict';var emlformat=require(_0xc301('0x0'));var rimraf=require(_0xc301('0x1'));var zipdir=require(_0xc301('0x2'));var jsonpatch=require(_0xc301('0x3'));var rp=require(_0xc301('0x4'));var moment=require(_0xc301('0x5'));var BPromise=require(_0xc301('0x6'));var Mustache=require('mustache');var util=require(_0xc301('0x7'));var path=require(_0xc301('0x8'));var sox=require(_0xc301('0x9'));var csv=require(_0xc301('0xa'));var ejs=require(_0xc301('0xb'));var fs=require('fs');var fs_extra=require(_0xc301('0xc'));var _=require(_0xc301('0xd'));var squel=require(_0xc301('0xe'));var crypto=require(_0xc301('0xf'));var jsforce=require(_0xc301('0x10'));var deskjs=require(_0xc301('0x11'));var toCsv=require(_0xc301('0xa'));var querystring=require('querystring');var Papa=require(_0xc301('0x12'));var Redis=require(_0xc301('0x13'));var authService=require(_0xc301('0x14'));var qs=require(_0xc301('0x15'));var as=require(_0xc301('0x16'));var hardwareService=require(_0xc301('0x17'));var logger=require(_0xc301('0x18'))(_0xc301('0x19'));var utils=require(_0xc301('0x1a'));var config=require(_0xc301('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xc301('0x1c'))['db'];function respondWithStatusCode(_0x5e9336,_0x1332c7){_0x1332c7=_0x1332c7||0xcc;return function(_0x39a239){if(_0x39a239){return _0x5e9336['sendStatus'](_0x1332c7);}return _0x5e9336['status'](_0x1332c7)[_0xc301('0x1d')]();};}function respondWithResult(_0x163346,_0x558c1a){_0x558c1a=_0x558c1a||0xc8;return function(_0x49e0da){if(_0x49e0da){return _0x163346[_0xc301('0x1e')](_0x558c1a)['json'](_0x49e0da);}};}function respondWithFilteredResult(_0x18fa2d,_0xf8e652){return function(_0x1ecead){if(_0x1ecead){var _0x57db74=typeof _0xf8e652[_0xc301('0x1f')]===_0xc301('0x20')&&typeof _0xf8e652[_0xc301('0x21')]===_0xc301('0x20');var _0x381a6f=_0x1ecead[_0xc301('0x22')];var _0x1c4c56=_0x57db74?0x0:_0xf8e652[_0xc301('0x1f')];var _0x3aeed2=_0x57db74?_0x1ecead[_0xc301('0x22')]:_0xf8e652[_0xc301('0x1f')]+_0xf8e652[_0xc301('0x21')];var _0x20d94b;if(_0x3aeed2>=_0x381a6f){_0x3aeed2=_0x381a6f;_0x20d94b=0xc8;}else{_0x20d94b=0xce;}_0x18fa2d['status'](_0x20d94b);return _0x18fa2d[_0xc301('0x23')](_0xc301('0x24'),_0x1c4c56+'-'+_0x3aeed2+'/'+_0x381a6f)[_0xc301('0x25')](_0x1ecead);}return null;};}function patchUpdates(_0x1d040f){return function(_0x366f38){try{jsonpatch[_0xc301('0x26')](_0x366f38,_0x1d040f,!![]);}catch(_0x5c3b98){return BPromise[_0xc301('0x27')](_0x5c3b98);}return _0x366f38['save']();};}function saveUpdates(_0x8e048c,_0x5cbd99){return function(_0x2e50dc){if(_0x2e50dc){return _0x2e50dc[_0xc301('0x28')](_0x8e048c)['then'](function(_0x490610){return _0x490610;});}return null;};}function removeEntity(_0xfe4ec1,_0x3a9a48){return function(_0x2090b9){if(_0x2090b9){return _0x2090b9[_0xc301('0x29')]()[_0xc301('0x2a')](function(){_0xfe4ec1[_0xc301('0x1e')](0xcc)[_0xc301('0x1d')]();});}};}function handleEntityNotFound(_0x35240d,_0x3b16c2){return function(_0x5da12f){if(!_0x5da12f){_0x35240d[_0xc301('0x2b')](0x194);}return _0x5da12f;};}function handleError(_0x2941f3,_0x56a525){_0x56a525=_0x56a525||0x1f4;return function(_0x4d2022){logger[_0xc301('0x2c')](_0x4d2022['stack']);if(_0x4d2022['name']){delete _0x4d2022['name'];}_0x2941f3['status'](_0x56a525)[_0xc301('0x2d')](_0x4d2022);};}exports[_0xc301('0x2e')]=function(_0x2072c2,_0x3a2b99){var _0x1c970b={},_0x26edc4={},_0x1f4cea={'count':0x0,'rows':[]};var _0x1c0eed=_['map'](db[_0xc301('0x2f')][_0xc301('0x30')],function(_0x33e095){return{'name':_0x33e095[_0xc301('0x31')],'type':_0x33e095[_0xc301('0x32')][_0xc301('0x33')]};});_0x26edc4[_0xc301('0x34')]=_[_0xc301('0x35')](_0x1c0eed,_0xc301('0x36'));_0x26edc4[_0xc301('0x37')]=_[_0xc301('0x38')](_0x2072c2['query']);_0x26edc4[_0xc301('0x39')]=_[_0xc301('0x3a')](_0x26edc4[_0xc301('0x34')],_0x26edc4['query']);_0x1c970b['attributes']=_['intersection'](_0x26edc4[_0xc301('0x34')],qs[_0xc301('0x3b')](_0x2072c2['query'][_0xc301('0x3b')]));_0x1c970b[_0xc301('0x3c')]=_0x1c970b['attributes'][_0xc301('0x3d')]?_0x1c970b[_0xc301('0x3c')]:_0x26edc4['model'];if(!_0x2072c2[_0xc301('0x37')][_0xc301('0x3e')]('nolimit')){_0x1c970b[_0xc301('0x21')]=qs[_0xc301('0x21')](_0x2072c2[_0xc301('0x37')]['limit']);_0x1c970b['offset']=qs[_0xc301('0x1f')](_0x2072c2['query'][_0xc301('0x1f')]);}_0x1c970b[_0xc301('0x3f')]=qs[_0xc301('0x40')](_0x2072c2['query'][_0xc301('0x40')]);_0x1c970b['where']=qs[_0xc301('0x39')](_[_0xc301('0x41')](_0x2072c2['query'],_0x26edc4[_0xc301('0x39')]),_0x1c0eed);if(_0x2072c2[_0xc301('0x37')][_0xc301('0x42')]){_0x1c970b['where']=_['merge'](_0x1c970b[_0xc301('0x43')],{'$or':_[_0xc301('0x35')](_0x1c0eed,function(_0x2583de){if(_0x2583de['type']!==_0xc301('0x44')){var _0x50ef06={};_0x50ef06[_0x2583de[_0xc301('0x36')]]={'$like':'%'+_0x2072c2[_0xc301('0x37')][_0xc301('0x42')]+'%'};return _0x50ef06;}})});}_0x1c970b=_[_0xc301('0x45')]({},_0x1c970b,_0x2072c2[_0xc301('0x46')]);var _0x1aa554={'where':_0x1c970b['where']};return db[_0xc301('0x2f')][_0xc301('0x22')](_0x1aa554)[_0xc301('0x2a')](function(_0x2f871b){_0x1f4cea['count']=_0x2f871b;if(_0x2072c2[_0xc301('0x37')][_0xc301('0x47')]){_0x1c970b[_0xc301('0x48')]=[{'all':!![]}];}return db[_0xc301('0x2f')][_0xc301('0x49')](_0x1c970b);})[_0xc301('0x2a')](function(_0x1dcc39){_0x1f4cea['rows']=_0x1dcc39;return _0x1f4cea;})[_0xc301('0x2a')](respondWithFilteredResult(_0x3a2b99,_0x1c970b))['catch'](handleError(_0x3a2b99,null));};exports[_0xc301('0x4a')]=function(_0x2d426e,_0xdb01e){var _0x4b46d8={'raw':!![],'where':{'id':_0x2d426e[_0xc301('0x4b')]['id']}},_0x15eb94={};_0x15eb94[_0xc301('0x34')]=_['keys'](db[_0xc301('0x2f')][_0xc301('0x30')]);_0x15eb94[_0xc301('0x37')]=_[_0xc301('0x38')](_0x2d426e['query']);_0x15eb94['filters']=_[_0xc301('0x3a')](_0x15eb94[_0xc301('0x34')],_0x15eb94[_0xc301('0x37')]);_0x4b46d8['attributes']=_[_0xc301('0x3a')](_0x15eb94['model'],qs[_0xc301('0x3b')](_0x2d426e[_0xc301('0x37')]['fields']));_0x4b46d8[_0xc301('0x3c')]=_0x4b46d8[_0xc301('0x3c')]['length']?_0x4b46d8['attributes']:_0x15eb94[_0xc301('0x34')];if(_0x2d426e[_0xc301('0x37')][_0xc301('0x47')]){_0x4b46d8[_0xc301('0x48')]=[{'all':!![]}];}_0x4b46d8=_['merge']({},_0x4b46d8,_0x2d426e[_0xc301('0x46')]);return db[_0xc301('0x2f')][_0xc301('0x4c')](_0x4b46d8)[_0xc301('0x2a')](handleEntityNotFound(_0xdb01e,null))[_0xc301('0x2a')](respondWithResult(_0xdb01e,null))['catch'](handleError(_0xdb01e,null));};exports[_0xc301('0x4d')]=function(_0x6f8bf4,_0x122e4e){return db[_0xc301('0x2f')][_0xc301('0x4d')](_0x6f8bf4['body'],{})[_0xc301('0x2a')](respondWithResult(_0x122e4e,0xc9))['catch'](handleError(_0x122e4e,null));};exports[_0xc301('0x28')]=function(_0x3a19ca,_0x140472){if(_0x3a19ca['body']['id']){delete _0x3a19ca[_0xc301('0x4e')]['id'];}return db[_0xc301('0x2f')]['find']({'where':{'id':_0x3a19ca[_0xc301('0x4b')]['id']}})[_0xc301('0x2a')](handleEntityNotFound(_0x140472,null))['then'](saveUpdates(_0x3a19ca[_0xc301('0x4e')],null))[_0xc301('0x2a')](respondWithResult(_0x140472,null))[_0xc301('0x4f')](handleError(_0x140472,null));};exports[_0xc301('0x29')]=function(_0x21dc4e,_0x49dbf1){return db[_0xc301('0x2f')][_0xc301('0x4c')]({'where':{'id':_0x21dc4e[_0xc301('0x4b')]['id']}})[_0xc301('0x2a')](handleEntityNotFound(_0x49dbf1,null))[_0xc301('0x2a')](removeEntity(_0x49dbf1,null))[_0xc301('0x4f')](handleError(_0x49dbf1,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 61c8131..ba78822 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 _0x7688=['analytics_report_trees','lodash','util','../../config/logger','api','moment','path','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0x12fe24,_0x4061cd){var _0x309501=function(_0x2c91d8){while(--_0x2c91d8){_0x12fe24['push'](_0x12fe24['shift']());}};_0x309501(++_0x4061cd);}(_0x7688,0x173));var _0x8768=function(_0x10d697,_0xdb207c){_0x10d697=_0x10d697-0x0;var _0x13d86a=_0x7688[_0x10d697];return _0x13d86a;};'use strict';var _=require(_0x8768('0x0'));var util=require(_0x8768('0x1'));var logger=require(_0x8768('0x2'))(_0x8768('0x3'));var moment=require(_0x8768('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8768('0x5'));var rimraf=require('rimraf');var config=require(_0x8768('0x6'));var attributes=require(_0x8768('0x7'));module[_0x8768('0x8')]=function(_0x260341,_0x4b5ed0){return _0x260341['define']('AnalyticTreeReport',attributes,{'tableName':_0x8768('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd350=['exports','AnalyticTreeReport','analytics_report_trees','lodash','api','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes'];(function(_0x3709ca,_0x2a026b){var _0x44e1a8=function(_0x4ac820){while(--_0x4ac820){_0x3709ca['push'](_0x3709ca['shift']());}};_0x44e1a8(++_0x2a026b);}(_0xd350,0x1cf));var _0x0d35=function(_0x3cc05d,_0x4b8f88){_0x3cc05d=_0x3cc05d-0x0;var _0x28b736=_0xd350[_0x3cc05d];return _0x28b736;};'use strict';var _=require(_0x0d35('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0d35('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0d35('0x2'));var fs=require('fs');var path=require(_0x0d35('0x3'));var rimraf=require(_0x0d35('0x4'));var config=require(_0x0d35('0x5'));var attributes=require(_0x0d35('0x6'));module[_0x0d35('0x7')]=function(_0x45b590,_0x29c5a6){return _0x45b590['define'](_0x0d35('0x8'),attributes,{'tableName':_0x0d35('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 40be36d..1c1821d 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 _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x21241d,_0x4069c7){_0x21241d=_0x21241d-0x0;var _0x3c11d1=_0x7a54[_0x21241d];return _0x3c11d1;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x3382e2,_0x6fbda2){var _0x25381b=function(_0x28cabc){while(--_0x28cabc){_0x3382e2['push'](_0x3382e2['shift']());}};_0x25381b(++_0x6fbda2);}(_0x2ef3,0xba));var _0x32ef=function(_0xd6f43d,_0x583ec3){_0xd6f43d=_0xd6f43d-0x0;var _0x12ea0=_0x2ef3[_0xd6f43d];return _0x12ea0;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 445e204..f1aae76 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 _0x1cd8=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','/:id','show'];(function(_0xbd6685,_0x2dad17){var _0x50a71a=function(_0x8911b9){while(--_0x8911b9){_0xbd6685['push'](_0xbd6685['shift']());}};_0x50a71a(++_0x2dad17);}(_0x1cd8,0xcb));var _0x81cd=function(_0x4d7bd5,_0x196f54){_0x4d7bd5=_0x4d7bd5-0x0;var _0x1d37e6=_0x1cd8[_0x4d7bd5];return _0x1d37e6;};'use strict';var multer=require(_0x81cd('0x0'));var util=require(_0x81cd('0x1'));var path=require(_0x81cd('0x2'));var timeout=require(_0x81cd('0x3'));var express=require(_0x81cd('0x4'));var router=express['Router']();var fs_extra=require(_0x81cd('0x5'));var auth=require(_0x81cd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x81cd('0x7'));var controller=require(_0x81cd('0x8'));router['get']('/',auth[_0x81cd('0x9')](),controller[_0x81cd('0xa')]);router['get'](_0x81cd('0xb'),auth[_0x81cd('0x9')](),controller[_0x81cd('0xc')]);router['post']('/',auth[_0x81cd('0x9')](),controller['create']);router[_0x81cd('0xd')](_0x81cd('0xb'),auth[_0x81cd('0x9')](),controller[_0x81cd('0xe')]);router[_0x81cd('0xf')](_0x81cd('0xb'),auth[_0x81cd('0x9')](),controller[_0x81cd('0x10')]);module[_0x81cd('0x11')]=router;
\ No newline at end of file
+var _0x9b26=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','show','post','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x16ad45,_0x4bcf1d){var _0x51f76c=function(_0x790f59){while(--_0x790f59){_0x16ad45['push'](_0x16ad45['shift']());}};_0x51f76c(++_0x4bcf1d);}(_0x9b26,0x1d7));var _0x69b2=function(_0x362099,_0x19e68f){_0x362099=_0x362099-0x0;var _0x43adb7=_0x9b26[_0x362099];return _0x43adb7;};'use strict';var multer=require(_0x69b2('0x0'));var util=require(_0x69b2('0x1'));var path=require(_0x69b2('0x2'));var timeout=require(_0x69b2('0x3'));var express=require(_0x69b2('0x4'));var router=express[_0x69b2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x69b2('0x6'));var interaction=require(_0x69b2('0x7'));var config=require(_0x69b2('0x8'));var controller=require(_0x69b2('0x9'));router[_0x69b2('0xa')]('/',auth[_0x69b2('0xb')](),controller[_0x69b2('0xc')]);router[_0x69b2('0xa')]('/:id',auth[_0x69b2('0xb')](),controller[_0x69b2('0xd')]);router[_0x69b2('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x69b2('0xf')]('/:id',auth[_0x69b2('0xb')](),controller[_0x69b2('0x10')]);router[_0x69b2('0x11')]('/:id',auth[_0x69b2('0xb')](),controller[_0x69b2('0x12')]);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 c413be4..f0e4e2e 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 _0x0328=['STRING','sequelize','exports'];(function(_0x302013,_0x49d2fd){var _0x1aa768=function(_0x935431){while(--_0x935431){_0x302013['push'](_0x302013['shift']());}};_0x1aa768(++_0x49d2fd);}(_0x0328,0x172));var _0x8032=function(_0x1e578b,_0x1db00c){_0x1e578b=_0x1e578b-0x0;var _0xd491d=_0x0328[_0x1e578b];return _0xd491d;};'use strict';var Sequelize=require(_0x8032('0x0'));module[_0x8032('0x1')]={'name':{'type':Sequelize[_0x8032('0x2')]},'basename':{'type':Sequelize[_0x8032('0x2')]},'type':{'type':Sequelize[_0x8032('0x2')]}};
\ No newline at end of file
+var _0xfa2f=['STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfa2f,0xe8));var _0xffa2=function(_0x2f4217,_0x397e98){_0x2f4217=_0x2f4217-0x0;var _0x3fffd9=_0xfa2f[_0x2f4217];return _0x3fffd9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xffa2('0x0')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xffa2('0x0')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 48c942a..44deaea 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 _0xff1d=['length','hasOwnProperty','sort','filters','pick','where','merge','VIRTUAL','filter','options','count','includeAll','include','catch','show','rawAttributes','keys','find','clone','get','createdAt','updatedAt','body','omit','update','create','file','originalname','basename','filename','mimetype','ChatOfflineMessageId','join','root','server/files/attachments/','download','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','then','destroy','stack','name','send','index','map','Attachment','type','key','model','query','intersection','attributes','fields'];(function(_0xa8e337,_0x518b8c){var _0xff00a3=function(_0xc83578){while(--_0xc83578){_0xa8e337['push'](_0xa8e337['shift']());}};_0xff00a3(++_0x518b8c);}(_0xff1d,0x1d2));var _0xdff1=function(_0x5252c8,_0x1adf14){_0x5252c8=_0x5252c8-0x0;var _0x480ac4=_0xff1d[_0x5252c8];return _0x480ac4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdff1('0x0'));var zipdir=require(_0xdff1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdff1('0x2'));var moment=require('moment');var BPromise=require(_0xdff1('0x3'));var Mustache=require(_0xdff1('0x4'));var util=require(_0xdff1('0x5'));var path=require(_0xdff1('0x6'));var sox=require(_0xdff1('0x7'));var csv=require(_0xdff1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdff1('0x9'));var _=require(_0xdff1('0xa'));var squel=require(_0xdff1('0xb'));var crypto=require(_0xdff1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdff1('0xd'));var toCsv=require(_0xdff1('0x8'));var querystring=require(_0xdff1('0xe'));var Papa=require(_0xdff1('0xf'));var Redis=require(_0xdff1('0x10'));var authService=require(_0xdff1('0x11'));var qs=require(_0xdff1('0x12'));var as=require(_0xdff1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdff1('0x14'))(_0xdff1('0x15'));var utils=require(_0xdff1('0x16'));var config=require(_0xdff1('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x198f1c,_0x53f4e6){_0x53f4e6=_0x53f4e6||0xcc;return function(_0x5c0a33){if(_0x5c0a33){return _0x198f1c[_0xdff1('0x18')](_0x53f4e6);}return _0x198f1c[_0xdff1('0x19')](_0x53f4e6)[_0xdff1('0x1a')]();};}function respondWithResult(_0x5185cf,_0x3bf51c){_0x3bf51c=_0x3bf51c||0xc8;return function(_0x279a18){if(_0x279a18){return _0x5185cf[_0xdff1('0x19')](_0x3bf51c)[_0xdff1('0x1b')](_0x279a18);}};}function respondWithFilteredResult(_0x4e9398,_0x6216cd){return function(_0x35d6d0){if(_0x35d6d0){var _0xc5e093=typeof _0x6216cd[_0xdff1('0x1c')]===_0xdff1('0x1d')&&typeof _0x6216cd[_0xdff1('0x1e')]===_0xdff1('0x1d');var _0x3a77b9=_0x35d6d0['count'];var _0x2afc88=_0xc5e093?0x0:_0x6216cd['offset'];var _0x457809=_0xc5e093?_0x35d6d0['count']:_0x6216cd['offset']+_0x6216cd[_0xdff1('0x1e')];var _0x107581;if(_0x457809>=_0x3a77b9){_0x457809=_0x3a77b9;_0x107581=0xc8;}else{_0x107581=0xce;}_0x4e9398[_0xdff1('0x19')](_0x107581);return _0x4e9398[_0xdff1('0x1f')]('Content-Range',_0x2afc88+'-'+_0x457809+'/'+_0x3a77b9)[_0xdff1('0x1b')](_0x35d6d0);}return null;};}function patchUpdates(_0x18eb6e){return function(_0x27773a){try{jsonpatch[_0xdff1('0x20')](_0x27773a,_0x18eb6e,!![]);}catch(_0x14c8f1){return BPromise[_0xdff1('0x21')](_0x14c8f1);}return _0x27773a[_0xdff1('0x22')]();};}function saveUpdates(_0x4418f2,_0x3ff4c6){return function(_0x26a1ab){if(_0x26a1ab){return _0x26a1ab['update'](_0x4418f2)[_0xdff1('0x23')](function(_0x1f52f4){return _0x1f52f4;});}return null;};}function removeEntity(_0x2c4ea2,_0x179923){return function(_0x5a53f1){if(_0x5a53f1){return _0x5a53f1[_0xdff1('0x24')]()[_0xdff1('0x23')](function(){_0x2c4ea2[_0xdff1('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c6dad,_0x27ca6f){return function(_0x83054c){if(!_0x83054c){_0x2c6dad[_0xdff1('0x18')](0x194);}return _0x83054c;};}function handleError(_0x28205f,_0xf56cca){_0xf56cca=_0xf56cca||0x1f4;return function(_0x54fe84){logger['error'](_0x54fe84[_0xdff1('0x25')]);if(_0x54fe84[_0xdff1('0x26')]){delete _0x54fe84[_0xdff1('0x26')];}_0x28205f[_0xdff1('0x19')](_0xf56cca)[_0xdff1('0x27')](_0x54fe84);};}exports[_0xdff1('0x28')]=function(_0x40853f,_0x46758e){var _0x31cc63={},_0x353099={},_0xaeb334={'count':0x0,'rows':[]};var _0x13d12c=_[_0xdff1('0x29')](db[_0xdff1('0x2a')]['rawAttributes'],function(_0x589370){return{'name':_0x589370['fieldName'],'type':_0x589370[_0xdff1('0x2b')][_0xdff1('0x2c')]};});_0x353099[_0xdff1('0x2d')]=_[_0xdff1('0x29')](_0x13d12c,_0xdff1('0x26'));_0x353099[_0xdff1('0x2e')]=_['keys'](_0x40853f['query']);_0x353099['filters']=_[_0xdff1('0x2f')](_0x353099[_0xdff1('0x2d')],_0x353099[_0xdff1('0x2e')]);_0x31cc63[_0xdff1('0x30')]=_[_0xdff1('0x2f')](_0x353099['model'],qs[_0xdff1('0x31')](_0x40853f[_0xdff1('0x2e')][_0xdff1('0x31')]));_0x31cc63[_0xdff1('0x30')]=_0x31cc63[_0xdff1('0x30')][_0xdff1('0x32')]?_0x31cc63['attributes']:_0x353099[_0xdff1('0x2d')];if(!_0x40853f[_0xdff1('0x2e')][_0xdff1('0x33')]('nolimit')){_0x31cc63[_0xdff1('0x1e')]=qs[_0xdff1('0x1e')](_0x40853f[_0xdff1('0x2e')][_0xdff1('0x1e')]);_0x31cc63[_0xdff1('0x1c')]=qs[_0xdff1('0x1c')](_0x40853f[_0xdff1('0x2e')]['offset']);}_0x31cc63['order']=qs[_0xdff1('0x34')](_0x40853f[_0xdff1('0x2e')]['sort']);_0x31cc63['where']=qs[_0xdff1('0x35')](_[_0xdff1('0x36')](_0x40853f[_0xdff1('0x2e')],_0x353099[_0xdff1('0x35')]),_0x13d12c);if(_0x40853f[_0xdff1('0x2e')]['filter']){_0x31cc63[_0xdff1('0x37')]=_[_0xdff1('0x38')](_0x31cc63[_0xdff1('0x37')],{'$or':_[_0xdff1('0x29')](_0x13d12c,function(_0x1183f7){if(_0x1183f7[_0xdff1('0x2b')]!==_0xdff1('0x39')){var _0x464087={};_0x464087[_0x1183f7[_0xdff1('0x26')]]={'$like':'%'+_0x40853f[_0xdff1('0x2e')][_0xdff1('0x3a')]+'%'};return _0x464087;}})});}_0x31cc63=_[_0xdff1('0x38')]({},_0x31cc63,_0x40853f[_0xdff1('0x3b')]);var _0x508b44={'where':_0x31cc63[_0xdff1('0x37')]};return db[_0xdff1('0x2a')][_0xdff1('0x3c')](_0x508b44)[_0xdff1('0x23')](function(_0x40d10e){_0xaeb334[_0xdff1('0x3c')]=_0x40d10e;if(_0x40853f['query'][_0xdff1('0x3d')]){_0x31cc63[_0xdff1('0x3e')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x31cc63);})['then'](function(_0x137c7e){_0xaeb334['rows']=_0x137c7e;return _0xaeb334;})[_0xdff1('0x23')](respondWithFilteredResult(_0x46758e,_0x31cc63))[_0xdff1('0x3f')](handleError(_0x46758e,null));};exports[_0xdff1('0x40')]=function(_0x10a461,_0x456ef6){var _0x81f69f={'raw':!![],'where':{'id':_0x10a461['params']['id']}},_0x46164c={};_0x46164c[_0xdff1('0x2d')]=_['keys'](db[_0xdff1('0x2a')][_0xdff1('0x41')]);_0x46164c[_0xdff1('0x2e')]=_[_0xdff1('0x42')](_0x10a461['query']);_0x46164c[_0xdff1('0x35')]=_[_0xdff1('0x2f')](_0x46164c[_0xdff1('0x2d')],_0x46164c['query']);_0x81f69f[_0xdff1('0x30')]=_[_0xdff1('0x2f')](_0x46164c[_0xdff1('0x2d')],qs[_0xdff1('0x31')](_0x10a461['query'][_0xdff1('0x31')]));_0x81f69f[_0xdff1('0x30')]=_0x81f69f[_0xdff1('0x30')][_0xdff1('0x32')]?_0x81f69f['attributes']:_0x46164c[_0xdff1('0x2d')];if(_0x10a461[_0xdff1('0x2e')][_0xdff1('0x3d')]){_0x81f69f['include']=[{'all':!![]}];}_0x81f69f=_['merge']({},_0x81f69f,_0x10a461['options']);return db[_0xdff1('0x2a')][_0xdff1('0x43')](_0x81f69f)['then'](handleEntityNotFound(_0x456ef6,null))['then'](respondWithResult(_0x456ef6,null))[_0xdff1('0x3f')](handleError(_0x456ef6,null));};exports[_0xdff1('0x44')]=function(_0x5609a4,_0x201d50){var _0x4990f0={'where':{'id':_0x5609a4['params']['id']}},_0x253593={};_0x253593[_0xdff1('0x2d')]=_[_0xdff1('0x42')](db[_0xdff1('0x2a')][_0xdff1('0x41')]);_0x4990f0[_0xdff1('0x30')]=_[_0xdff1('0x2f')](_0x253593['model'],qs[_0xdff1('0x31')](_0x5609a4[_0xdff1('0x2e')]['fields']));_0x4990f0[_0xdff1('0x30')]=_0x4990f0[_0xdff1('0x30')][_0xdff1('0x32')]?_0x4990f0[_0xdff1('0x30')]:_0x253593['model'];if(_0x5609a4[_0xdff1('0x2e')][_0xdff1('0x3d')]){_0x4990f0['include']=[{'all':!![]}];}_0x4990f0=_['merge']({},_0x4990f0,_0x5609a4[_0xdff1('0x3b')]);return db[_0xdff1('0x2a')][_0xdff1('0x43')](_0x4990f0)[_0xdff1('0x23')](handleEntityNotFound(_0x201d50,null))[_0xdff1('0x23')](function(_0x41cd8e){if(_0x41cd8e){var _0x19872f=_0x41cd8e[_0xdff1('0x45')]({'plain':!![]});_0x19872f=qs['omit'](_0x19872f,['id',_0xdff1('0x46'),_0xdff1('0x47')]);_0x5609a4[_0xdff1('0x48')]=_[_0xdff1('0x49')](_0x5609a4['body'],['id',_0xdff1('0x46'),'updatedAt']);return db['Attachment']['create'](_['merge'](_0x19872f,_0x5609a4['body']),{'include':_0x5609a4[_0xdff1('0x2e')][_0xdff1('0x3d')]?[{'all':!![]}]:undefined});}})[_0xdff1('0x23')](respondWithResult(_0x201d50,0xc9))['catch'](handleError(_0x201d50,null));};exports[_0xdff1('0x4a')]=function(_0x4539bb,_0x497635){if(_0x4539bb[_0xdff1('0x48')]['id']){delete _0x4539bb[_0xdff1('0x48')]['id'];}return db[_0xdff1('0x2a')][_0xdff1('0x43')]({'where':{'id':_0x4539bb['params']['id']}})[_0xdff1('0x23')](handleEntityNotFound(_0x497635,null))['then'](saveUpdates(_0x4539bb['body'],null))['then'](respondWithResult(_0x497635,null))['catch'](handleError(_0x497635,null));};exports[_0xdff1('0x24')]=function(_0x593d85,_0x23b7d6){return db[_0xdff1('0x2a')][_0xdff1('0x43')]({'where':{'id':_0x593d85['params']['id']}})[_0xdff1('0x23')](handleEntityNotFound(_0x23b7d6,null))['then'](removeEntity(_0x23b7d6,null))[_0xdff1('0x3f')](handleError(_0x23b7d6,null));};exports[_0xdff1('0x4b')]=function(_0x50c592,_0x5b67c6,_0x512999){_0x50c592[_0xdff1('0x48')][_0xdff1('0x26')]=_0x50c592[_0xdff1('0x4c')][_0xdff1('0x4d')];_0x50c592[_0xdff1('0x48')][_0xdff1('0x4e')]=_0x50c592[_0xdff1('0x4c')][_0xdff1('0x4f')];_0x50c592[_0xdff1('0x48')]['type']=_0x50c592[_0xdff1('0x4c')][_0xdff1('0x50')];return db['Attachment'][_0xdff1('0x4b')](_0x50c592[_0xdff1('0x48')])[_0xdff1('0x23')](respondWithResult(_0x5b67c6,0xc9))[_0xdff1('0x3f')](handleError(_0x5b67c6,null));};exports['download']=function(_0x124354,_0x106816,_0x241e77){return db[_0xdff1('0x2a')]['findOne']({'where':{'id':_0x124354['params']['id']},'raw':!![]})[_0xdff1('0x23')](handleEntityNotFound(_0x106816,null))['then'](function(_0x58344d){if(_0x58344d){var _0x3794fb=_0x58344d[_0xdff1('0x51')]!==null;var _0x4ed1d6=path[_0xdff1('0x52')](config[_0xdff1('0x53')],_0xdff1('0x54'));if(_0x3794fb){_0x4ed1d6=path[_0xdff1('0x52')](_0x4ed1d6,'offline-chat/');}var _0x352db5=path['join'](_0x4ed1d6,_0x58344d[_0xdff1('0x4e')]);return _0x106816[_0xdff1('0x55')](_0x352db5);}})[_0xdff1('0x3f')](handleError(_0x106816,null));};
\ No newline at end of file
+var _0xd2fd=['query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','find','clone','get','omit','body','createdAt','updatedAt','create','file','originalname','basename','filename','mimetype','download','findOne','join','server/files/attachments/','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model'];(function(_0x30b045,_0x5cea47){var _0x290a8b=function(_0x3997cd){while(--_0x3997cd){_0x30b045['push'](_0x30b045['shift']());}};_0x290a8b(++_0x5cea47);}(_0xd2fd,0x1da));var _0xdd2f=function(_0x5a3d74,_0x546dc6){_0x5a3d74=_0x5a3d74-0x0;var _0x5db855=_0xd2fd[_0x5a3d74];return _0x5db855;};'use strict';var emlformat=require(_0xdd2f('0x0'));var rimraf=require(_0xdd2f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdd2f('0x2'));var moment=require(_0xdd2f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdd2f('0x4'));var util=require(_0xdd2f('0x5'));var path=require(_0xdd2f('0x6'));var sox=require(_0xdd2f('0x7'));var csv=require(_0xdd2f('0x8'));var ejs=require(_0xdd2f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdd2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xdd2f('0xb'));var deskjs=require(_0xdd2f('0xc'));var toCsv=require(_0xdd2f('0x8'));var querystring=require(_0xdd2f('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdd2f('0xe'));var qs=require(_0xdd2f('0xf'));var as=require(_0xdd2f('0x10'));var hardwareService=require(_0xdd2f('0x11'));var logger=require(_0xdd2f('0x12'))(_0xdd2f('0x13'));var utils=require(_0xdd2f('0x14'));var config=require(_0xdd2f('0x15'));var licenseUtil=require(_0xdd2f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24f753,_0x4e0e55){_0x4e0e55=_0x4e0e55||0xcc;return function(_0x322995){if(_0x322995){return _0x24f753[_0xdd2f('0x17')](_0x4e0e55);}return _0x24f753[_0xdd2f('0x18')](_0x4e0e55)[_0xdd2f('0x19')]();};}function respondWithResult(_0x1b0f9d,_0x2b277a){_0x2b277a=_0x2b277a||0xc8;return function(_0x560329){if(_0x560329){return _0x1b0f9d['status'](_0x2b277a)[_0xdd2f('0x1a')](_0x560329);}};}function respondWithFilteredResult(_0x5d99dc,_0xaa3a22){return function(_0x4de182){if(_0x4de182){var _0x3e2a21=typeof _0xaa3a22[_0xdd2f('0x1b')]===_0xdd2f('0x1c')&&typeof _0xaa3a22[_0xdd2f('0x1d')]===_0xdd2f('0x1c');var _0x24790b=_0x4de182['count'];var _0x521747=_0x3e2a21?0x0:_0xaa3a22[_0xdd2f('0x1b')];var _0x581905=_0x3e2a21?_0x4de182['count']:_0xaa3a22[_0xdd2f('0x1b')]+_0xaa3a22[_0xdd2f('0x1d')];var _0x24e2fc;if(_0x581905>=_0x24790b){_0x581905=_0x24790b;_0x24e2fc=0xc8;}else{_0x24e2fc=0xce;}_0x5d99dc[_0xdd2f('0x18')](_0x24e2fc);return _0x5d99dc[_0xdd2f('0x1e')](_0xdd2f('0x1f'),_0x521747+'-'+_0x581905+'/'+_0x24790b)['json'](_0x4de182);}return null;};}function patchUpdates(_0x1066fb){return function(_0x4992d8){try{jsonpatch[_0xdd2f('0x20')](_0x4992d8,_0x1066fb,!![]);}catch(_0x19eb9f){return BPromise['reject'](_0x19eb9f);}return _0x4992d8['save']();};}function saveUpdates(_0x31e470,_0x30be65){return function(_0x5bf912){if(_0x5bf912){return _0x5bf912[_0xdd2f('0x21')](_0x31e470)[_0xdd2f('0x22')](function(_0x3b350d){return _0x3b350d;});}return null;};}function removeEntity(_0x2db51a,_0x788678){return function(_0x2b736b){if(_0x2b736b){return _0x2b736b[_0xdd2f('0x23')]()['then'](function(){_0x2db51a[_0xdd2f('0x18')](0xcc)[_0xdd2f('0x19')]();});}};}function handleEntityNotFound(_0x460ca1,_0x554cd8){return function(_0xd6cf33){if(!_0xd6cf33){_0x460ca1['sendStatus'](0x194);}return _0xd6cf33;};}function handleError(_0x4b8c6b,_0x36e2ef){_0x36e2ef=_0x36e2ef||0x1f4;return function(_0x4607ac){logger[_0xdd2f('0x24')](_0x4607ac[_0xdd2f('0x25')]);if(_0x4607ac[_0xdd2f('0x26')]){delete _0x4607ac['name'];}_0x4b8c6b[_0xdd2f('0x18')](_0x36e2ef)[_0xdd2f('0x27')](_0x4607ac);};}exports[_0xdd2f('0x28')]=function(_0xfc4e8c,_0x35262d){var _0x5a8a63={},_0x307f5e={},_0x5a99dd={'count':0x0,'rows':[]};var _0x482bcc=_[_0xdd2f('0x29')](db[_0xdd2f('0x2a')][_0xdd2f('0x2b')],function(_0x3a0037){return{'name':_0x3a0037[_0xdd2f('0x2c')],'type':_0x3a0037[_0xdd2f('0x2d')][_0xdd2f('0x2e')]};});_0x307f5e[_0xdd2f('0x2f')]=_[_0xdd2f('0x29')](_0x482bcc,_0xdd2f('0x26'));_0x307f5e[_0xdd2f('0x30')]=_[_0xdd2f('0x31')](_0xfc4e8c[_0xdd2f('0x30')]);_0x307f5e[_0xdd2f('0x32')]=_[_0xdd2f('0x33')](_0x307f5e['model'],_0x307f5e['query']);_0x5a8a63['attributes']=_[_0xdd2f('0x33')](_0x307f5e[_0xdd2f('0x2f')],qs[_0xdd2f('0x34')](_0xfc4e8c[_0xdd2f('0x30')][_0xdd2f('0x34')]));_0x5a8a63['attributes']=_0x5a8a63[_0xdd2f('0x35')][_0xdd2f('0x36')]?_0x5a8a63[_0xdd2f('0x35')]:_0x307f5e[_0xdd2f('0x2f')];if(!_0xfc4e8c[_0xdd2f('0x30')][_0xdd2f('0x37')](_0xdd2f('0x38'))){_0x5a8a63[_0xdd2f('0x1d')]=qs['limit'](_0xfc4e8c[_0xdd2f('0x30')][_0xdd2f('0x1d')]);_0x5a8a63[_0xdd2f('0x1b')]=qs[_0xdd2f('0x1b')](_0xfc4e8c[_0xdd2f('0x30')][_0xdd2f('0x1b')]);}_0x5a8a63['order']=qs[_0xdd2f('0x39')](_0xfc4e8c[_0xdd2f('0x30')][_0xdd2f('0x39')]);_0x5a8a63[_0xdd2f('0x3a')]=qs['filters'](_['pick'](_0xfc4e8c[_0xdd2f('0x30')],_0x307f5e[_0xdd2f('0x32')]),_0x482bcc);if(_0xfc4e8c[_0xdd2f('0x30')][_0xdd2f('0x3b')]){_0x5a8a63[_0xdd2f('0x3a')]=_[_0xdd2f('0x3c')](_0x5a8a63[_0xdd2f('0x3a')],{'$or':_['map'](_0x482bcc,function(_0x10d0ff){if(_0x10d0ff[_0xdd2f('0x2d')]!=='VIRTUAL'){var _0x57b5aa={};_0x57b5aa[_0x10d0ff[_0xdd2f('0x26')]]={'$like':'%'+_0xfc4e8c[_0xdd2f('0x30')][_0xdd2f('0x3b')]+'%'};return _0x57b5aa;}})});}_0x5a8a63=_[_0xdd2f('0x3c')]({},_0x5a8a63,_0xfc4e8c[_0xdd2f('0x3d')]);var _0x3f4371={'where':_0x5a8a63[_0xdd2f('0x3a')]};return db[_0xdd2f('0x2a')][_0xdd2f('0x3e')](_0x3f4371)[_0xdd2f('0x22')](function(_0x5c6381){_0x5a99dd['count']=_0x5c6381;if(_0xfc4e8c[_0xdd2f('0x30')][_0xdd2f('0x3f')]){_0x5a8a63[_0xdd2f('0x40')]=[{'all':!![]}];}return db['Attachment'][_0xdd2f('0x41')](_0x5a8a63);})[_0xdd2f('0x22')](function(_0x6c681){_0x5a99dd[_0xdd2f('0x42')]=_0x6c681;return _0x5a99dd;})['then'](respondWithFilteredResult(_0x35262d,_0x5a8a63))[_0xdd2f('0x43')](handleError(_0x35262d,null));};exports[_0xdd2f('0x44')]=function(_0x499cd0,_0x3f188b){var _0x526d86={'raw':!![],'where':{'id':_0x499cd0[_0xdd2f('0x45')]['id']}},_0x2e1821={};_0x2e1821['model']=_[_0xdd2f('0x31')](db[_0xdd2f('0x2a')][_0xdd2f('0x2b')]);_0x2e1821[_0xdd2f('0x30')]=_['keys'](_0x499cd0[_0xdd2f('0x30')]);_0x2e1821[_0xdd2f('0x32')]=_['intersection'](_0x2e1821[_0xdd2f('0x2f')],_0x2e1821[_0xdd2f('0x30')]);_0x526d86[_0xdd2f('0x35')]=_[_0xdd2f('0x33')](_0x2e1821[_0xdd2f('0x2f')],qs[_0xdd2f('0x34')](_0x499cd0[_0xdd2f('0x30')][_0xdd2f('0x34')]));_0x526d86['attributes']=_0x526d86[_0xdd2f('0x35')]['length']?_0x526d86[_0xdd2f('0x35')]:_0x2e1821[_0xdd2f('0x2f')];if(_0x499cd0[_0xdd2f('0x30')]['includeAll']){_0x526d86['include']=[{'all':!![]}];}_0x526d86=_['merge']({},_0x526d86,_0x499cd0[_0xdd2f('0x3d')]);return db[_0xdd2f('0x2a')][_0xdd2f('0x46')](_0x526d86)[_0xdd2f('0x22')](handleEntityNotFound(_0x3f188b,null))[_0xdd2f('0x22')](respondWithResult(_0x3f188b,null))[_0xdd2f('0x43')](handleError(_0x3f188b,null));};exports[_0xdd2f('0x47')]=function(_0x4d91b1,_0x44b17a){var _0xb83f42={'where':{'id':_0x4d91b1[_0xdd2f('0x45')]['id']}},_0x2f79b4={};_0x2f79b4[_0xdd2f('0x2f')]=_[_0xdd2f('0x31')](db[_0xdd2f('0x2a')]['rawAttributes']);_0xb83f42['attributes']=_['intersection'](_0x2f79b4[_0xdd2f('0x2f')],qs[_0xdd2f('0x34')](_0x4d91b1[_0xdd2f('0x30')][_0xdd2f('0x34')]));_0xb83f42['attributes']=_0xb83f42[_0xdd2f('0x35')][_0xdd2f('0x36')]?_0xb83f42[_0xdd2f('0x35')]:_0x2f79b4['model'];if(_0x4d91b1[_0xdd2f('0x30')][_0xdd2f('0x3f')]){_0xb83f42[_0xdd2f('0x40')]=[{'all':!![]}];}_0xb83f42=_['merge']({},_0xb83f42,_0x4d91b1[_0xdd2f('0x3d')]);return db[_0xdd2f('0x2a')][_0xdd2f('0x46')](_0xb83f42)[_0xdd2f('0x22')](handleEntityNotFound(_0x44b17a,null))[_0xdd2f('0x22')](function(_0x2ce70c){if(_0x2ce70c){var _0x2d6b9d=_0x2ce70c[_0xdd2f('0x48')]({'plain':!![]});_0x2d6b9d=qs[_0xdd2f('0x49')](_0x2d6b9d,['id','createdAt','updatedAt']);_0x4d91b1[_0xdd2f('0x4a')]=_['omit'](_0x4d91b1[_0xdd2f('0x4a')],['id',_0xdd2f('0x4b'),_0xdd2f('0x4c')]);return db[_0xdd2f('0x2a')][_0xdd2f('0x4d')](_[_0xdd2f('0x3c')](_0x2d6b9d,_0x4d91b1['body']),{'include':_0x4d91b1[_0xdd2f('0x30')][_0xdd2f('0x3f')]?[{'all':!![]}]:undefined});}})[_0xdd2f('0x22')](respondWithResult(_0x44b17a,0xc9))['catch'](handleError(_0x44b17a,null));};exports[_0xdd2f('0x21')]=function(_0x2b7001,_0x55d53d){if(_0x2b7001[_0xdd2f('0x4a')]['id']){delete _0x2b7001[_0xdd2f('0x4a')]['id'];}return db[_0xdd2f('0x2a')][_0xdd2f('0x46')]({'where':{'id':_0x2b7001[_0xdd2f('0x45')]['id']}})[_0xdd2f('0x22')](handleEntityNotFound(_0x55d53d,null))['then'](saveUpdates(_0x2b7001[_0xdd2f('0x4a')],null))[_0xdd2f('0x22')](respondWithResult(_0x55d53d,null))[_0xdd2f('0x43')](handleError(_0x55d53d,null));};exports['destroy']=function(_0x2bb77d,_0x15771e){return db[_0xdd2f('0x2a')][_0xdd2f('0x46')]({'where':{'id':_0x2bb77d['params']['id']}})['then'](handleEntityNotFound(_0x15771e,null))[_0xdd2f('0x22')](removeEntity(_0x15771e,null))[_0xdd2f('0x43')](handleError(_0x15771e,null));};exports['create']=function(_0x445d7f,_0x28691a,_0x37795e){_0x445d7f['body'][_0xdd2f('0x26')]=_0x445d7f[_0xdd2f('0x4e')][_0xdd2f('0x4f')];_0x445d7f['body'][_0xdd2f('0x50')]=_0x445d7f['file'][_0xdd2f('0x51')];_0x445d7f[_0xdd2f('0x4a')][_0xdd2f('0x2d')]=_0x445d7f['file'][_0xdd2f('0x52')];return db['Attachment']['create'](_0x445d7f[_0xdd2f('0x4a')])[_0xdd2f('0x22')](respondWithResult(_0x28691a,0xc9))[_0xdd2f('0x43')](handleError(_0x28691a,null));};exports[_0xdd2f('0x53')]=function(_0x1200fb,_0x2431e5,_0x6ea29f){return db[_0xdd2f('0x2a')][_0xdd2f('0x54')]({'where':{'id':_0x1200fb[_0xdd2f('0x45')]['id']},'raw':!![]})[_0xdd2f('0x22')](handleEntityNotFound(_0x2431e5,null))[_0xdd2f('0x22')](function(_0x210763){if(_0x210763){var _0x1bda05=_0x210763['ChatOfflineMessageId']!==null;var _0x17d933=path[_0xdd2f('0x55')](config['root'],_0xdd2f('0x56'));if(_0x1bda05){_0x17d933=path[_0xdd2f('0x55')](_0x17d933,'offline-chat/');}var _0x1a2a3a=path[_0xdd2f('0x55')](_0x17d933,_0x210763[_0xdd2f('0x50')]);return _0x2431e5['download'](_0x1a2a3a);}})[_0xdd2f('0x43')](handleError(_0x2431e5,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 1e15eec..75b338e 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 _0xeda3=['path','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','request-promise'];(function(_0xf26d40,_0x2f4f46){var _0x50b68c=function(_0x10aa58){while(--_0x10aa58){_0xf26d40['push'](_0xf26d40['shift']());}};_0x50b68c(++_0x2f4f46);}(_0xeda3,0x8b));var _0x3eda=function(_0x29f59b,_0x163fae){_0x29f59b=_0x29f59b-0x0;var _0xb18960=_0xeda3[_0x29f59b];return _0xb18960;};'use strict';var _=require(_0x3eda('0x0'));var util=require(_0x3eda('0x1'));var logger=require(_0x3eda('0x2'))(_0x3eda('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3eda('0x4'));var fs=require('fs');var path=require(_0x3eda('0x5'));var rimraf=require('rimraf');var config=require(_0x3eda('0x6'));var attributes=require(_0x3eda('0x7'));module[_0x3eda('0x8')]=function(_0x1957bf,_0x1ad3ac){return _0x1957bf[_0x3eda('0x9')](_0x3eda('0xa'),attributes,{'tableName':_0x3eda('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xed1a=['../../config/logger','api','moment','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xed1a,0x6b));var _0xaed1=function(_0x4a8f91,_0x462fa6){_0x4a8f91=_0x4a8f91-0x0;var _0x445b73=_0xed1a[_0x4a8f91];return _0x445b73;};'use strict';var _=require(_0xaed1('0x0'));var util=require('util');var logger=require(_0xaed1('0x1'))(_0xaed1('0x2'));var moment=require(_0xaed1('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xaed1('0x4'));var rimraf=require(_0xaed1('0x5'));var config=require(_0xaed1('0x6'));var attributes=require(_0xaed1('0x7'));module[_0xaed1('0x8')]=function(_0x39da32,_0xe3fa64){return _0x39da32[_0xaed1('0x9')](_0xaed1('0xa'),attributes,{'tableName':_0xaed1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 4164bb2..8eb38bc 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 _0x31c2=['CreateAttachment','stringify','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','Attachment','create','body','options','raw'];(function(_0x2a4095,_0x13f4f0){var _0x52eeab=function(_0x3950dd){while(--_0x3950dd){_0x2a4095['push'](_0x2a4095['shift']());}};_0x52eeab(++_0x13f4f0);}(_0x31c2,0x98));var _0x231c=function(_0xb2f5d2,_0x98f388){_0xb2f5d2=_0xb2f5d2-0x0;var _0x3488fe=_0x31c2[_0xb2f5d2];return _0x3488fe;};'use strict';var _=require(_0x231c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x231c('0x1'));var rs=require(_0x231c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x231c('0x3'))['db'];var utils=require(_0x231c('0x4'));var logger=require(_0x231c('0x5'))(_0x231c('0x6'));var config=require(_0x231c('0x7'));var jayson=require(_0x231c('0x8'));var client=jayson[_0x231c('0x9')][_0x231c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5afc76,_0x1e3997,_0x4fd8b8){return new BPromise(function(_0x3dfccb,_0x396da8){return client[_0x231c('0xb')](_0x5afc76,_0x4fd8b8)[_0x231c('0xc')](function(_0x4cd3b8){logger[_0x231c('0xd')](_0x231c('0xe'),_0x1e3997,_0x231c('0xf'));logger[_0x231c('0x10')](_0x231c('0x11'),_0x1e3997,_0x231c('0xf'),JSON['stringify'](_0x4cd3b8));if(_0x4cd3b8['error']){if(_0x4cd3b8['error'][_0x231c('0x12')]===0x1f4){logger[_0x231c('0x13')](_0x231c('0xe'),_0x1e3997,_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);return _0x396da8(_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);}logger[_0x231c('0x13')](_0x231c('0xe'),_0x1e3997,_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);return _0x3dfccb(_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);}else{logger[_0x231c('0xd')]('Attachment,\x20%s,\x20%s',_0x1e3997,_0x231c('0xf'));_0x3dfccb(_0x4cd3b8[_0x231c('0x15')][_0x231c('0x14')]);}})[_0x231c('0x16')](function(_0x40f4f6){logger['error'](_0x231c('0xe'),_0x1e3997,_0x40f4f6);_0x396da8(_0x40f4f6);});});}exports['CreateAttachment']=function(_0x1d48e3){var _0x59282c=this;return new Promise(function(_0x286148,_0x34f391){return db[_0x231c('0x17')][_0x231c('0x18')](_0x1d48e3[_0x231c('0x19')],{'raw':_0x1d48e3[_0x231c('0x1a')]?_0x1d48e3[_0x231c('0x1a')][_0x231c('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x29a94){logger[_0x231c('0xd')](_0x231c('0x1c'),_0x1d48e3);logger['debug']('CreateAttachment',_0x1d48e3,JSON[_0x231c('0x1d')](_0x29a94));_0x286148(_0x29a94);})[_0x231c('0x16')](function(_0x3bd9ed){logger['error'](_0x231c('0x1c'),_0x3bd9ed['message'],_0x1d48e3);_0x34f391(_0x59282c[_0x231c('0x13')](0x1f4,_0x3bd9ed[_0x231c('0x14')]));});});};
\ No newline at end of file
+var _0x80df=['catch','CreateAttachment','Attachment','create','options','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x5951e8,_0x42b9a7){var _0x20a1f5=function(_0x2bc968){while(--_0x2bc968){_0x5951e8['push'](_0x5951e8['shift']());}};_0x20a1f5(++_0x42b9a7);}(_0x80df,0x17e));var _0xf80d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x80df[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf80d('0x0'));var util=require(_0xf80d('0x1'));var moment=require(_0xf80d('0x2'));var BPromise=require(_0xf80d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf80d('0x4'));var db=require(_0xf80d('0x5'))['db'];var utils=require(_0xf80d('0x6'));var logger=require(_0xf80d('0x7'))(_0xf80d('0x8'));var config=require(_0xf80d('0x9'));var jayson=require(_0xf80d('0xa'));var client=jayson[_0xf80d('0xb')][_0xf80d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x62e50f,_0x5068d4,_0x30e2b3){return new BPromise(function(_0x16b219,_0x2f56b3){return client[_0xf80d('0xd')](_0x62e50f,_0x30e2b3)[_0xf80d('0xe')](function(_0x186339){logger[_0xf80d('0xf')](_0xf80d('0x10'),_0x5068d4,_0xf80d('0x11'));logger[_0xf80d('0x12')](_0xf80d('0x13'),_0x5068d4,_0xf80d('0x11'),JSON[_0xf80d('0x14')](_0x186339));if(_0x186339[_0xf80d('0x15')]){if(_0x186339['error']['code']===0x1f4){logger[_0xf80d('0x15')](_0xf80d('0x10'),_0x5068d4,_0x186339['error'][_0xf80d('0x16')]);return _0x2f56b3(_0x186339['error'][_0xf80d('0x16')]);}logger['error'](_0xf80d('0x10'),_0x5068d4,_0x186339['error'][_0xf80d('0x16')]);return _0x16b219(_0x186339[_0xf80d('0x15')][_0xf80d('0x16')]);}else{logger[_0xf80d('0xf')](_0xf80d('0x10'),_0x5068d4,_0xf80d('0x11'));_0x16b219(_0x186339[_0xf80d('0x17')][_0xf80d('0x16')]);}})[_0xf80d('0x18')](function(_0x3b8a82){logger[_0xf80d('0x15')](_0xf80d('0x10'),_0x5068d4,_0x3b8a82);_0x2f56b3(_0x3b8a82);});});}exports[_0xf80d('0x19')]=function(_0x1d104a){var _0x34b49d=this;return new Promise(function(_0x2ea2c1,_0x7ba89c){return db[_0xf80d('0x1a')][_0xf80d('0x1b')](_0x1d104a['body'],{'raw':_0x1d104a[_0xf80d('0x1c')]?_0x1d104a[_0xf80d('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xf80d('0xe')](function(_0x539c80){logger[_0xf80d('0xf')](_0xf80d('0x19'),_0x1d104a);logger[_0xf80d('0x12')](_0xf80d('0x19'),_0x1d104a,JSON[_0xf80d('0x14')](_0x539c80));_0x2ea2c1(_0x539c80);})[_0xf80d('0x18')](function(_0x446153){logger[_0xf80d('0x15')](_0xf80d('0x19'),_0x446153[_0xf80d('0x16')],_0x1d104a);_0x7ba89c(_0x34b49d[_0xf80d('0x15')](0x1f4,_0x446153[_0xf80d('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 5cc3312..0aa459e 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 _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x469414,_0x303535){var _0x495fde=function(_0xd58ad0){while(--_0xd58ad0){_0x469414['push'](_0x469414['shift']());}};_0x495fde(++_0x303535);}(_0x2032,0xd9));var _0x2203=function(_0x4e7603,_0x42f87d){_0x4e7603=_0x4e7603-0x0;var _0x413b08=_0x2032[_0x4e7603];return _0x413b08;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
+var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x113aeb,_0x215442){var _0xc0a75f=function(_0x4bbc76){while(--_0x4bbc76){_0x113aeb['push'](_0x113aeb['shift']());}};_0xc0a75f(++_0x215442);}(_0xb10b,0x12a));var _0xbb10=function(_0x163691,_0x3d10c4){_0x163691=_0x163691-0x0;var _0x543ae5=_0xb10b[_0x163691];return _0x543ae5;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index cb2809b..ddbee83 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 _0x3861=['authenticate','google','/login','callback','use','clientID','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','find','map','emails','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport-google-oauth20','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','signToken','login'];(function(_0x463376,_0x13871c){var _0x336ccd=function(_0x33afd2){while(--_0x33afd2){_0x463376['push'](_0x463376['shift']());}};_0x336ccd(++_0x13871c);}(_0x3861,0x80));var _0x1386=function(_0x434e47,_0x3ac472){_0x434e47=_0x434e47-0x0;var _0x46febc=_0x3861[_0x434e47];return _0x46febc;};'use strict';var _=require(_0x1386('0x0'));var passport=require('passport');var GoogleStrategy=require(_0x1386('0x1'))[_0x1386('0x2')];var moment=require('moment');var db=require(_0x1386('0x3'))['db'];var config=require(_0x1386('0x4'));var signToken=require(_0x1386('0x5'))[_0x1386('0x6')];var utils=require('../../config/utils');exports[_0x1386('0x7')]=passport[_0x1386('0x8')](_0x1386('0x9'),{'failureRedirect':_0x1386('0xa'),'scope':['profile','email'],'session':![]});exports[_0x1386('0xb')]=passport[_0x1386('0x8')]('google',{'failureRedirect':_0x1386('0xa'),'session':![]});passport[_0x1386('0xc')](new GoogleStrategy({'clientID':config[_0x1386('0x9')]?config['google'][_0x1386('0xd')]:'id','clientSecret':config['google']?config[_0x1386('0x9')]['clientSecret']:'secret','callbackURL':config[_0x1386('0x9')]?config['google'][_0x1386('0xe')]:''},function(_0x2c6f24,_0x1336ed,_0x53fc01,_0x47e247){var _0x4796b9,_0x2338ae;return db[_0x1386('0xf')][_0x1386('0x10')]({'where':{'id':0x1},'attributes':[_0x1386('0x11'),_0x1386('0x12')],'raw':!![]})[_0x1386('0x13')](function(_0x1597d0){_0x4796b9=_0x1597d0;return db['User'][_0x1386('0x14')]({'where':{'email':_[_0x1386('0x15')](_0x53fc01[_0x1386('0x16')],'value'),'role':{'$or':[_0x1386('0x17'),_0x1386('0x18'),_0x1386('0x19')]}}});})[_0x1386('0x13')](function(_0x265997){_0x2338ae=_0x265997;if(_0x2338ae){if(_0x2338ae[_0x1386('0x1a')]){return _0x47e247(_0x1386('0x1b'));}else if(_0x4796b9[_0x1386('0x12')]>0x0){if(_0x2338ae['blocked']){if(moment(_0x2338ae[_0x1386('0x1c')])[_0x1386('0x1d')](_0x4796b9[_0x1386('0x12')],_0x1386('0x1e'))>moment()){return _0x47e247(_0x1386('0x1b'));}else{return utils[_0x1386('0x1f')](_0x2338ae,0x0,![],null)[_0x1386('0x13')](function(){return utils[_0x1386('0x20')](_0x2338ae);})[_0x1386('0x13')](function(){return _0x47e247(null,_0x2338ae);});}}else{return utils[_0x1386('0x20')](_0x2338ae)[_0x1386('0x13')](function(){return _0x47e247(null,_0x2338ae);});}}else{return utils['getLicense'](_0x2338ae)[_0x1386('0x13')](function(){return _0x47e247(null,_0x2338ae);});}}return _0x47e247(_0x1386('0x1b'));})[_0x1386('0x21')](function(_0x5ec8ea){_0x47e247(_0x5ec8ea);});}));
\ No newline at end of file
+var _0x9daf=['authenticate','google','/login','profile','email','callback','use','secret','findOne','allowedLoginAttempts','blockDuration','then','find','emails','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','Strategy','moment','../../mysqldb','../../components/auth/service','signToken','../../config/utils','login'];(function(_0x2938b9,_0x52e916){var _0x20b12a=function(_0x11c439){while(--_0x11c439){_0x2938b9['push'](_0x2938b9['shift']());}};_0x20b12a(++_0x52e916);}(_0x9daf,0x16d));var _0xf9da=function(_0xaa7629,_0x219723){_0xaa7629=_0xaa7629-0x0;var _0x487c07=_0x9daf[_0xaa7629];return _0x487c07;};'use strict';var _=require(_0xf9da('0x0'));var passport=require(_0xf9da('0x1'));var GoogleStrategy=require('passport-google-oauth20')[_0xf9da('0x2')];var moment=require(_0xf9da('0x3'));var db=require(_0xf9da('0x4'))['db'];var config=require('../../config/environment');var signToken=require(_0xf9da('0x5'))[_0xf9da('0x6')];var utils=require(_0xf9da('0x7'));exports[_0xf9da('0x8')]=passport[_0xf9da('0x9')](_0xf9da('0xa'),{'failureRedirect':_0xf9da('0xb'),'scope':[_0xf9da('0xc'),_0xf9da('0xd')],'session':![]});exports[_0xf9da('0xe')]=passport[_0xf9da('0x9')](_0xf9da('0xa'),{'failureRedirect':_0xf9da('0xb'),'session':![]});passport[_0xf9da('0xf')](new GoogleStrategy({'clientID':config[_0xf9da('0xa')]?config[_0xf9da('0xa')]['clientID']:'id','clientSecret':config['google']?config[_0xf9da('0xa')]['clientSecret']:_0xf9da('0x10'),'callbackURL':config[_0xf9da('0xa')]?config[_0xf9da('0xa')]['callbackURL']:''},function(_0x5925e8,_0x5f5b0f,_0x5a843b,_0x250a01){var _0x396adf,_0x32fabb;return db['Setting'][_0xf9da('0x11')]({'where':{'id':0x1},'attributes':[_0xf9da('0x12'),_0xf9da('0x13')],'raw':!![]})[_0xf9da('0x14')](function(_0x205a0a){_0x396adf=_0x205a0a;return db['User'][_0xf9da('0x15')]({'where':{'email':_['map'](_0x5a843b[_0xf9da('0x16')],_0xf9da('0x17')),'role':{'$or':[_0xf9da('0x18'),_0xf9da('0x19'),_0xf9da('0x1a')]}}});})['then'](function(_0x187cc3){_0x32fabb=_0x187cc3;if(_0x32fabb){if(_0x32fabb[_0xf9da('0x1b')]){return _0x250a01(_0xf9da('0x1c'));}else if(_0x396adf['blockDuration']>0x0){if(_0x32fabb['blocked']){if(moment(_0x32fabb['blockedAt'])[_0xf9da('0x1d')](_0x396adf[_0xf9da('0x13')],_0xf9da('0x1e'))>moment()){return _0x250a01(_0xf9da('0x1c'));}else{return utils[_0xf9da('0x1f')](_0x32fabb,0x0,![],null)['then'](function(){return utils[_0xf9da('0x20')](_0x32fabb);})['then'](function(){return _0x250a01(null,_0x32fabb);});}}else{return utils['getLicense'](_0x32fabb)[_0xf9da('0x14')](function(){return _0x250a01(null,_0x32fabb);});}}else{return utils[_0xf9da('0x20')](_0x32fabb)[_0xf9da('0x14')](function(){return _0x250a01(null,_0x32fabb);});}}return _0x250a01(_0xf9da('0x1c'));})[_0xf9da('0x21')](function(_0x47d605){_0x250a01(_0x47d605);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 77c5255..b25af48 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 _0x7fac=['login','setTokenCookie','exports','express','Router','../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware'];(function(_0x329437,_0x1de73a){var _0x3789d9=function(_0x37832e){while(--_0x37832e){_0x329437['push'](_0x329437['shift']());}};_0x3789d9(++_0x1de73a);}(_0x7fac,0x137));var _0xc7fa=function(_0x529f1c,_0x437ed1){_0x529f1c=_0x529f1c-0x0;var _0x4d57ab=_0x7fac[_0x529f1c];return _0x4d57ab;};'use strict';var express=require(_0xc7fa('0x0'));var passport=require('passport');var router=express[_0xc7fa('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0xc7fa('0x2'));var authService=require(_0xc7fa('0x3'));router[_0xc7fa('0x4')]('/',controller['login']);router[_0xc7fa('0x4')](_0xc7fa('0x5'),controller[_0xc7fa('0x6')],authService[_0xc7fa('0x7')],userController[_0xc7fa('0x8')],authService[_0xc7fa('0x9')]);module[_0xc7fa('0xa')]=router;
\ No newline at end of file
+var _0x7649=['get','/callback','callback','isMiddleware','setTokenCookie','exports','express','Router','./authGoogle.controller','../../components/auth/service','login'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x7649,0x1df));var _0x9764=function(_0x522d1f,_0x9246e2){_0x522d1f=_0x522d1f-0x0;var _0x2d652d=_0x7649[_0x522d1f];return _0x2d652d;};'use strict';var express=require(_0x9764('0x0'));var passport=require('passport');var router=express[_0x9764('0x1')]();var controller=require(_0x9764('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x9764('0x3'));router['get']('/',controller[_0x9764('0x4')]);router[_0x9764('0x5')](_0x9764('0x6'),controller[_0x9764('0x7')],authService[_0x9764('0x8')],userController[_0x9764('0x4')],authService[_0x9764('0x9')]);module[_0x9764('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 16476b2..65d0e96 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 _0xffda=['error','message','stringify','status','send','login','authenticate','local','role','signToken','json','Email\x20parameter\x20is\x20missing','generate','body','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','https://','headers','/reset/','Reset\x20Email\x20sent!','reset','params','token','enforcePasswordHistory','securePassword','validatePasswordPattern','previousPasswords','use','util','passport','passport-local','Strategy','lodash','randomstring','moment','../../components/auth/service','client','http','Setting','findOne','then','password','salt','disabled','blocked','blockedAt','loginAttempts','admin','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','add','blockDuration','minutes','clearBlockUser','getLicense','catch','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','pass','format','user','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!'];(function(_0x26defc,_0x23c1bb){var _0x467fe8=function(_0xc9707f){while(--_0xc9707f){_0x26defc['push'](_0x26defc['shift']());}};_0x467fe8(++_0x23c1bb);}(_0xffda,0x73));var _0xaffd=function(_0x1002a3,_0x4b7184){_0x1002a3=_0x1002a3-0x0;var _0x328e80=_0xffda[_0x1002a3];return _0x328e80;};'use strict';var util=require(_0xaffd('0x0'));var passport=require(_0xaffd('0x1'));var LocalStrategy=require(_0xaffd('0x2'))[_0xaffd('0x3')];var jayson=require('jayson/promise');var _=require(_0xaffd('0x4'));var rs=require(_0xaffd('0x5'));var moment=require(_0xaffd('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0xaffd('0x7'));var utils=require('../../config/utils');var client=jayson[_0xaffd('0x8')][_0xaffd('0x9')]({'port':0x232b});function localAuthenticate(_0x5747e0,_0x4ca99e,_0x39b2e5,_0x12865c){var _0x3647e1,_0x514b76;return db[_0xaffd('0xa')][_0xaffd('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xaffd('0xc')](function(_0x42159b){_0x3647e1=_0x42159b;return _0x5747e0[_0xaffd('0xb')]({'attributes':['id','name',_0xaffd('0xd'),_0xaffd('0xe'),'role',_0xaffd('0xf'),_0xaffd('0x10'),_0xaffd('0x11'),_0xaffd('0x12')],'where':{'name':_0x4ca99e,'role':{'$or':[_0xaffd('0x13'),'user',_0xaffd('0x14')]}}});})['then'](function(_0x513bc8){if(!_0x513bc8||_0x513bc8&&_0x513bc8[_0xaffd('0x15')]!==_0x4ca99e){throw new Error(_0xaffd('0x16'));}else{_0x514b76=_0x513bc8;return _0x514b76;}})[_0xaffd('0xc')](function(){_0x514b76['authenticate'](_0x39b2e5,function(_0x2b0b99,_0x35ebc6){var _0x14caba=_0x514b76[_0xaffd('0x12')]+0x1;if(_0x2b0b99){return _0x12865c(_0x2b0b99);}else if(!_0x35ebc6){if(_0x514b76[_0xaffd('0xf')]){return _0x12865c(null,![],{'message':_0xaffd('0x16')});}else if(_0x3647e1[_0xaffd('0x17')]>0x0){if(_0x514b76[_0xaffd('0x10')]){if(_0x3647e1['blockDuration']>0x0){if(moment(_0x514b76[_0xaffd('0x11')])[_0xaffd('0x18')](_0x3647e1[_0xaffd('0x19')],_0xaffd('0x1a'))>moment()){return _0x12865c(null,![],{'message':_0xaffd('0x16')});}else{return utils[_0xaffd('0x1b')](_0x514b76,_0x14caba,![],null)['then'](function(){return _0x12865c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x12865c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x14caba>=_0x3647e1[_0xaffd('0x17')]){return utils[_0xaffd('0x1b')](_0x514b76,0x0,!![],moment())['then'](function(){return _0x12865c(null,![],{'message':_0xaffd('0x16')});});}else{return utils[_0xaffd('0x1b')](_0x514b76,_0x14caba,![],null)[_0xaffd('0xc')](function(){return _0x12865c(null,![],{'message':_0xaffd('0x16')});});}}}else{return _0x12865c(null,![],{'message':_0xaffd('0x16')});}}else{if(_0x514b76[_0xaffd('0xf')]){return _0x12865c(null,![],{'message':_0xaffd('0x16')});}else if(_0x3647e1[_0xaffd('0x17')]>0x0){if(_0x514b76[_0xaffd('0x10')]){if(_0x3647e1[_0xaffd('0x19')]>0x0){if(moment(_0x514b76[_0xaffd('0x11')])[_0xaffd('0x18')](_0x3647e1[_0xaffd('0x19')],_0xaffd('0x1a'))>moment()){return _0x12865c(null,![],{'message':_0xaffd('0x16')});}else{return utils[_0xaffd('0x1b')](_0x514b76,0x0,![],null)[_0xaffd('0xc')](function(){return utils[_0xaffd('0x1c')](_0x514b76);})['then'](function(){return _0x12865c(null,_0x514b76);});}}else{return _0x12865c(null,![],{'message':_0xaffd('0x16')});}}else{return utils[_0xaffd('0x1b')](_0x514b76,0x0,![],null)[_0xaffd('0xc')](function(){return utils[_0xaffd('0x1c')](_0x514b76);})[_0xaffd('0xc')](function(){return _0x12865c(null,_0x514b76);})[_0xaffd('0x1d')](function(_0x401ad7){return _0x12865c(null,![],_0x401ad7);});}}else{if(_0x514b76[_0xaffd('0x10')]){return _0x12865c(null,![],{'message':_0xaffd('0x16')});}else{return utils['getLicense'](_0x514b76)[_0xaffd('0xc')](function(){return _0x12865c(null,_0x514b76);});}}}});})['catch'](function(_0x5a7fe0){return _0x12865c(null,![],_0x5a7fe0);});}function sendServiceMail(_0x1f4da9){return db['MailAccount'][_0xaffd('0x1e')]({'where':{'service':!![]},'attributes':['id',_0xaffd('0x15'),_0xaffd('0x1f')],'include':[{'model':db['MailServerOut'],'as':_0xaffd('0x20')}]})[_0xaffd('0xc')](function(_0x193926){if(!_0x193926){throw new Error(_0xaffd('0x21'));}var _0xa4f13={'tls':{'rejectUnauthorized':![]}};if(_0x193926['Smtp']['service']){_0xa4f13[_0xaffd('0x22')]=_0x193926['Smtp'][_0xaffd('0x22')];}else{_0xa4f13[_0xaffd('0x23')]=_0x193926[_0xaffd('0x20')]['host'];_0xa4f13[_0xaffd('0x24')]=_0x193926[_0xaffd('0x20')][_0xaffd('0x24')];_0xa4f13[_0xaffd('0x25')]=_0x193926[_0xaffd('0x20')][_0xaffd('0x25')];}if(_0x193926[_0xaffd('0x20')][_0xaffd('0x26')]){_0xa4f13['auth']={'user':_0x193926[_0xaffd('0x20')]['user'],'pass':_0x193926['Smtp'][_0xaffd('0x27')]};}var _0x470f5c={'account':_0xa4f13,'message':_['merge']({'from':util[_0xaffd('0x28')]('\x22%s\x22\x20<%s>',_0x193926[_0xaffd('0x15')],_0x193926[_0xaffd('0x1f')]||_0x193926[_0xaffd('0x20')][_0xaffd('0x29')])},_0x1f4da9)};return client[_0xaffd('0x2a')](_0xaffd('0x2b'),_0x470f5c);})[_0xaffd('0xc')](function(_0x995fc6){if(_0x995fc6['error']){throw new Error(util[_0xaffd('0x28')](_0xaffd('0x2c'),_0x995fc6[_0xaffd('0x2d')][_0xaffd('0x2e')]||JSON[_0xaffd('0x2f')](_0x995fc6['error'])));}return!![];});}function handleError(_0x404cec,_0x1a21ff,_0x2f12a4){return _0x404cec[_0xaffd('0x30')](_0x1a21ff||0x1f4)[_0xaffd('0x31')]({'message':_0x2f12a4?_0x2f12a4[_0xaffd('0x2e')]||_0x2f12a4:''});}exports[_0xaffd('0x32')]=function(_0x4c6a30,_0x33ef8a,_0x30ac8a){passport[_0xaffd('0x33')](_0xaffd('0x34'),function(_0x337b90,_0x537256,_0x151566){var _0x1d1eca=_0x337b90||_0x151566;if(_0x1d1eca){return handleError(_0x33ef8a,0x191,_0x1d1eca);}if(!_0x537256){return handleError(_0x33ef8a,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x208b11={'payload':{'id':_0x537256['id'],'role':_0x537256[_0xaffd('0x35')]},'options':{'expiresIn':0x15180}};return authService[_0xaffd('0x36')](_0x208b11)[_0xaffd('0xc')](function(_0x38a904){_0x33ef8a[_0xaffd('0x37')]({'id':_0x537256['id'],'token':_0x38a904,'statusCall':'','isAlreadyLogged':_0x537256['online']});});}})(_0x4c6a30,_0x33ef8a,_0x30ac8a);};exports['forgot']=function(_0xe47c4,_0x54a86e,_0x2168bc){if(!_0xe47c4['body'][_0xaffd('0x1f')]){return handleError(_0x54a86e,0x1f4,{'message':_0xaffd('0x38')});}var _0x476b59=rs[_0xaffd('0x39')]();_0xe47c4[_0xaffd('0x3a')]['email']=_0xe47c4['body']['email']['trim']()[_0xaffd('0x3b')]();var _0x35b453;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xaffd('0x17'),'blockDuration'],'raw':!![]})[_0xaffd('0xc')](function(_0x1a53ff){_0x35b453=_0x1a53ff;return db[_0xaffd('0x3c')][_0xaffd('0x1e')]({'where':{'email':_0xe47c4[_0xaffd('0x3a')][_0xaffd('0x1f')]}});})['then'](function(_0x5e72){if(!_0x5e72){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x5e72[_0xaffd('0xf')]){throw new Error(_0xaffd('0x3d'));}if(_0x5e72['blocked']){if(moment(_0x5e72['blockedAt'])[_0xaffd('0x18')](_0x35b453['blockDuration'],_0xaffd('0x1a'))>moment()){throw new Error(_0xaffd('0x3e'));}else{_0x5e72[_0xaffd('0x10')]=![];_0x5e72['blockedAt']=null;}}_0x5e72[_0xaffd('0x3f')]=_0x476b59;_0x5e72[_0xaffd('0x40')]=Date[_0xaffd('0x41')]()+0x36ee80;return _0x5e72[_0xaffd('0x42')]();})['then'](function(){return sendServiceMail({'to':_0xe47c4[_0xaffd('0x3a')][_0xaffd('0x1f')],'subject':_0xaffd('0x43'),'text':'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'+_0xaffd('0x44')+_0xe47c4[_0xaffd('0x45')][_0xaffd('0x23')]+_0xaffd('0x46')+_0x476b59+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})['then'](function(){_0x54a86e[_0xaffd('0x30')](0xc8)[_0xaffd('0x31')]({'message':_0xaffd('0x47')});})[_0xaffd('0x1d')](function(_0x1b88c1){return handleError(_0x54a86e,0x1f4,_0x1b88c1);});};exports[_0xaffd('0x48')]=function(_0x38e3a1,_0x4afa85,_0xb985fc){return db['User']['find']({'where':{'resetPasswordToken':_0x38e3a1[_0xaffd('0x49')][_0xaffd('0x4a')],'resetPasswordExpires':{'$gt':Date[_0xaffd('0x41')]()}}})['then'](function(_0x3b842f){if(!_0x3b842f){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0xaffd('0xb')]({'attributes':['id','securePassword',_0xaffd('0x4b'),'passwordHistoryLimit']})[_0xaffd('0xc')](function(_0x1ca289){if(_0x1ca289[_0xaffd('0x4c')])authService[_0xaffd('0x4d')](_0x38e3a1[_0xaffd('0x3a')][_0xaffd('0xd')]);if(!_0x1ca289[_0xaffd('0x4b')]||!_0x3b842f[_0xaffd('0x4e')])return _0x3b842f;authService['validatePasswordHistory'](_0x38e3a1[_0xaffd('0x3a')][_0xaffd('0xd')],_0x3b842f['previousPasswords'],_0x1ca289['passwordHistoryLimit']);return _0x3b842f;})[_0xaffd('0xc')](function(){_0x3b842f[_0xaffd('0xd')]=_0x38e3a1['body']['password'];_0x3b842f[_0xaffd('0x3f')]=null;_0x3b842f[_0xaffd('0x40')]=null;return _0x3b842f[_0xaffd('0x42')]();});})[_0xaffd('0xc')](function(){_0x4afa85['status'](0xc8)[_0xaffd('0x31')]({'message':'Password\x20reset!'});})['catch'](function(_0x41bfe0){return handleError(_0x4afa85,0x1f4,_0x41bfe0);});};passport[_0xaffd('0x4f')](new LocalStrategy({'usernameField':_0xaffd('0x15'),'passwordField':_0xaffd('0xd')},function(_0x168bb2,_0x15fccd,_0xb21690){return localAuthenticate(db['User'],_0x168bb2,_0x15fccd,_0xb21690);}));
\ No newline at end of file
+var _0x2ec8=['MailAccount','find','MailServerOut','Smtp','service','host','port','secure','authentication','auth','user','pass','merge','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','message','stringify','status','send','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','Setting','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','passport-local','Strategy','lodash','../../mysqldb','../../config/utils','client','findOne','allowedLoginAttempts','then','name','password','role','disabled','blocked','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','blockedAt','add','clearBlockUser','minutes','getLicense','catch'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x2ec8,0x188));var _0x82ec=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x2ec8[_0xbca1b1];return _0x4e1686;};'use strict';var util=require(_0x82ec('0x0'));var passport=require(_0x82ec('0x1'));var LocalStrategy=require(_0x82ec('0x2'))[_0x82ec('0x3')];var jayson=require('jayson/promise');var _=require(_0x82ec('0x4'));var rs=require('randomstring');var moment=require('moment');var db=require(_0x82ec('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x82ec('0x6'));var client=jayson[_0x82ec('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x4c9400,_0x5c786a,_0x527476,_0x3af0cf){var _0x3ceabc,_0x4dd14f;return db['Setting'][_0x82ec('0x8')]({'where':{'id':0x1},'attributes':[_0x82ec('0x9'),'blockDuration'],'raw':!![]})[_0x82ec('0xa')](function(_0xf1ab6c){_0x3ceabc=_0xf1ab6c;return _0x4c9400[_0x82ec('0x8')]({'attributes':['id',_0x82ec('0xb'),_0x82ec('0xc'),'salt',_0x82ec('0xd'),_0x82ec('0xe'),_0x82ec('0xf'),'blockedAt',_0x82ec('0x10')],'where':{'name':_0x5c786a,'role':{'$or':[_0x82ec('0x11'),'user',_0x82ec('0x12')]}}});})['then'](function(_0x2a57c2){if(!_0x2a57c2||_0x2a57c2&&_0x2a57c2[_0x82ec('0xb')]!==_0x5c786a){throw new Error(_0x82ec('0x13'));}else{_0x4dd14f=_0x2a57c2;return _0x4dd14f;}})['then'](function(){_0x4dd14f[_0x82ec('0x14')](_0x527476,function(_0x58c4d5,_0x1f0b2c){var _0x4ce834=_0x4dd14f['loginAttempts']+0x1;if(_0x58c4d5){return _0x3af0cf(_0x58c4d5);}else if(!_0x1f0b2c){if(_0x4dd14f['disabled']){return _0x3af0cf(null,![],{'message':_0x82ec('0x13')});}else if(_0x3ceabc[_0x82ec('0x9')]>0x0){if(_0x4dd14f[_0x82ec('0xf')]){if(_0x3ceabc[_0x82ec('0x15')]>0x0){if(moment(_0x4dd14f[_0x82ec('0x16')])[_0x82ec('0x17')](_0x3ceabc[_0x82ec('0x15')],'minutes')>moment()){return _0x3af0cf(null,![],{'message':_0x82ec('0x13')});}else{return utils[_0x82ec('0x18')](_0x4dd14f,_0x4ce834,![],null)['then'](function(){return _0x3af0cf(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x3af0cf(null,![],{'message':_0x82ec('0x13')});}}else{if(_0x4ce834>=_0x3ceabc[_0x82ec('0x9')]){return utils['clearBlockUser'](_0x4dd14f,0x0,!![],moment())[_0x82ec('0xa')](function(){return _0x3af0cf(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x82ec('0x18')](_0x4dd14f,_0x4ce834,![],null)['then'](function(){return _0x3af0cf(null,![],{'message':_0x82ec('0x13')});});}}}else{return _0x3af0cf(null,![],{'message':_0x82ec('0x13')});}}else{if(_0x4dd14f[_0x82ec('0xe')]){return _0x3af0cf(null,![],{'message':_0x82ec('0x13')});}else if(_0x3ceabc[_0x82ec('0x9')]>0x0){if(_0x4dd14f[_0x82ec('0xf')]){if(_0x3ceabc[_0x82ec('0x15')]>0x0){if(moment(_0x4dd14f['blockedAt'])[_0x82ec('0x17')](_0x3ceabc['blockDuration'],_0x82ec('0x19'))>moment()){return _0x3af0cf(null,![],{'message':_0x82ec('0x13')});}else{return utils[_0x82ec('0x18')](_0x4dd14f,0x0,![],null)[_0x82ec('0xa')](function(){return utils[_0x82ec('0x1a')](_0x4dd14f);})['then'](function(){return _0x3af0cf(null,_0x4dd14f);});}}else{return _0x3af0cf(null,![],{'message':_0x82ec('0x13')});}}else{return utils[_0x82ec('0x18')](_0x4dd14f,0x0,![],null)[_0x82ec('0xa')](function(){return utils[_0x82ec('0x1a')](_0x4dd14f);})['then'](function(){return _0x3af0cf(null,_0x4dd14f);})[_0x82ec('0x1b')](function(_0x533a2e){return _0x3af0cf(null,![],_0x533a2e);});}}else{if(_0x4dd14f[_0x82ec('0xf')]){return _0x3af0cf(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x82ec('0x1a')](_0x4dd14f)[_0x82ec('0xa')](function(){return _0x3af0cf(null,_0x4dd14f);});}}}});})[_0x82ec('0x1b')](function(_0x96d96a){return _0x3af0cf(null,![],_0x96d96a);});}function sendServiceMail(_0x2fe135){return db[_0x82ec('0x1c')][_0x82ec('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x82ec('0xb'),'email'],'include':[{'model':db[_0x82ec('0x1e')],'as':_0x82ec('0x1f')}]})[_0x82ec('0xa')](function(_0x278016){if(!_0x278016){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x35b4f3={'tls':{'rejectUnauthorized':![]}};if(_0x278016[_0x82ec('0x1f')]['service']){_0x35b4f3[_0x82ec('0x20')]=_0x278016[_0x82ec('0x1f')][_0x82ec('0x20')];}else{_0x35b4f3[_0x82ec('0x21')]=_0x278016[_0x82ec('0x1f')]['host'];_0x35b4f3[_0x82ec('0x22')]=_0x278016[_0x82ec('0x1f')]['port'];_0x35b4f3[_0x82ec('0x23')]=_0x278016[_0x82ec('0x1f')][_0x82ec('0x23')];}if(_0x278016['Smtp'][_0x82ec('0x24')]){_0x35b4f3[_0x82ec('0x25')]={'user':_0x278016['Smtp'][_0x82ec('0x26')],'pass':_0x278016[_0x82ec('0x1f')][_0x82ec('0x27')]};}var _0x5ac03a={'account':_0x35b4f3,'message':_[_0x82ec('0x28')]({'from':util[_0x82ec('0x29')](_0x82ec('0x2a'),_0x278016[_0x82ec('0xb')],_0x278016[_0x82ec('0x2b')]||_0x278016['Smtp'][_0x82ec('0x26')])},_0x2fe135)};return client[_0x82ec('0x2c')](_0x82ec('0x2d'),_0x5ac03a);})[_0x82ec('0xa')](function(_0x88e244){if(_0x88e244[_0x82ec('0x2e')]){throw new Error(util[_0x82ec('0x29')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x88e244[_0x82ec('0x2e')][_0x82ec('0x2f')]||JSON[_0x82ec('0x30')](_0x88e244[_0x82ec('0x2e')])));}return!![];});}function handleError(_0x3bf738,_0x14563d,_0x41d47c){return _0x3bf738[_0x82ec('0x31')](_0x14563d||0x1f4)[_0x82ec('0x32')]({'message':_0x41d47c?_0x41d47c[_0x82ec('0x2f')]||_0x41d47c:''});}exports['login']=function(_0x4d89ba,_0x4ab41a,_0x1300f2){passport[_0x82ec('0x14')]('local',function(_0x2e3f7e,_0x1ee571,_0x16d509){var _0x80a185=_0x2e3f7e||_0x16d509;if(_0x80a185){return handleError(_0x4ab41a,0x191,_0x80a185);}if(!_0x1ee571){return handleError(_0x4ab41a,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x1c6208={'payload':{'id':_0x1ee571['id'],'role':_0x1ee571[_0x82ec('0xd')]},'options':{'expiresIn':0x15180}};return authService[_0x82ec('0x33')](_0x1c6208)[_0x82ec('0xa')](function(_0x151958){_0x4ab41a[_0x82ec('0x34')]({'id':_0x1ee571['id'],'token':_0x151958,'statusCall':'','isAlreadyLogged':_0x1ee571[_0x82ec('0x35')]});});}})(_0x4d89ba,_0x4ab41a,_0x1300f2);};exports[_0x82ec('0x36')]=function(_0x25c515,_0x2d22d9,_0x434645){if(!_0x25c515[_0x82ec('0x37')][_0x82ec('0x2b')]){return handleError(_0x2d22d9,0x1f4,{'message':_0x82ec('0x38')});}var _0x4cad21=rs[_0x82ec('0x39')]();_0x25c515[_0x82ec('0x37')]['email']=_0x25c515['body']['email'][_0x82ec('0x3a')]()['toLowerCase']();var _0x2017e7;return db[_0x82ec('0x3b')][_0x82ec('0x8')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x82ec('0x15')],'raw':!![]})[_0x82ec('0xa')](function(_0x28d803){_0x2017e7=_0x28d803;return db[_0x82ec('0x3c')][_0x82ec('0x1d')]({'where':{'email':_0x25c515[_0x82ec('0x37')][_0x82ec('0x2b')]}});})[_0x82ec('0xa')](function(_0x4a3712){if(!_0x4a3712){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x4a3712['disabled']){throw new Error(_0x82ec('0x3d'));}if(_0x4a3712[_0x82ec('0xf')]){if(moment(_0x4a3712[_0x82ec('0x16')])[_0x82ec('0x17')](_0x2017e7[_0x82ec('0x15')],_0x82ec('0x19'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x4a3712[_0x82ec('0xf')]=![];_0x4a3712[_0x82ec('0x16')]=null;}}_0x4a3712[_0x82ec('0x3e')]=_0x4cad21;_0x4a3712[_0x82ec('0x3f')]=Date[_0x82ec('0x40')]()+0x36ee80;return _0x4a3712[_0x82ec('0x41')]();})[_0x82ec('0xa')](function(){return sendServiceMail({'to':_0x25c515['body'][_0x82ec('0x2b')],'subject':_0x82ec('0x42'),'text':_0x82ec('0x43')+_0x82ec('0x44')+_0x82ec('0x45')+_0x25c515[_0x82ec('0x46')][_0x82ec('0x21')]+'/reset/'+_0x4cad21+'\x0a\x0a'+_0x82ec('0x47')});})[_0x82ec('0xa')](function(){_0x2d22d9[_0x82ec('0x31')](0xc8)[_0x82ec('0x32')]({'message':_0x82ec('0x48')});})[_0x82ec('0x1b')](function(_0x4a9901){return handleError(_0x2d22d9,0x1f4,_0x4a9901);});};exports[_0x82ec('0x49')]=function(_0x1b707f,_0x3ac2d3,_0x3c6f7b){return db[_0x82ec('0x3c')][_0x82ec('0x1d')]({'where':{'resetPasswordToken':_0x1b707f[_0x82ec('0x4a')]['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x1c6964){if(!_0x1c6964){throw new Error(_0x82ec('0x4b'));}return db['Setting']['findOne']({'attributes':['id',_0x82ec('0x4c'),_0x82ec('0x4d'),_0x82ec('0x4e')]})[_0x82ec('0xa')](function(_0x4c13f5){if(_0x4c13f5[_0x82ec('0x4c')])authService[_0x82ec('0x4f')](_0x1b707f[_0x82ec('0x37')][_0x82ec('0xc')]);if(!_0x4c13f5['enforcePasswordHistory']||!_0x1c6964[_0x82ec('0x50')])return _0x1c6964;authService[_0x82ec('0x51')](_0x1b707f['body'][_0x82ec('0xc')],_0x1c6964['previousPasswords'],_0x4c13f5['passwordHistoryLimit']);return _0x1c6964;})['then'](function(){_0x1c6964[_0x82ec('0xc')]=_0x1b707f[_0x82ec('0x37')][_0x82ec('0xc')];_0x1c6964[_0x82ec('0x3e')]=null;_0x1c6964[_0x82ec('0x3f')]=null;return _0x1c6964[_0x82ec('0x41')]();});})[_0x82ec('0xa')](function(){_0x3ac2d3[_0x82ec('0x31')](0xc8)[_0x82ec('0x32')]({'message':_0x82ec('0x52')});})[_0x82ec('0x1b')](function(_0x5efd84){return handleError(_0x3ac2d3,0x1f4,_0x5efd84);});};passport[_0x82ec('0x53')](new LocalStrategy({'usernameField':_0x82ec('0xb'),'passwordField':_0x82ec('0xc')},function(_0x18afe4,_0x32d3ab,_0x18df3b){return localAuthenticate(db[_0x82ec('0x3c')],_0x18afe4,_0x32d3ab,_0x18df3b);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 6c0dd6a..6f3db79 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 _0xbb34=['forgot','/reset/:token','reset','exports','Router','login','post','/forgot'];(function(_0x340ddc,_0x4c69d6){var _0x29eed3=function(_0x17d566){while(--_0x17d566){_0x340ddc['push'](_0x340ddc['shift']());}};_0x29eed3(++_0x4c69d6);}(_0xbb34,0x164));var _0x4bb3=function(_0x42a44a,_0x15ca12){_0x42a44a=_0x42a44a-0x0;var _0x1e6ab6=_0xbb34[_0x42a44a];return _0x1e6ab6;};'use strict';var express=require('express');var router=express[_0x4bb3('0x0')]();var controller=require('./authLocal.controller');router['post']('/',controller[_0x4bb3('0x1')]);router[_0x4bb3('0x2')](_0x4bb3('0x3'),controller[_0x4bb3('0x4')]);router['post'](_0x4bb3('0x5'),controller[_0x4bb3('0x6')]);module[_0x4bb3('0x7')]=router;
\ No newline at end of file
+var _0x9ce0=['./authLocal.controller','post','/forgot','reset','exports','express','Router'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x9ce0,0x108));var _0x09ce=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9ce0[_0x1ac595];return _0x455fff;};'use strict';var express=require(_0x09ce('0x0'));var router=express[_0x09ce('0x1')]();var controller=require(_0x09ce('0x2'));router[_0x09ce('0x3')]('/',controller['login']);router[_0x09ce('0x3')](_0x09ce('0x4'),controller['forgot']);router[_0x09ce('0x3')]('/reset/:token',controller[_0x09ce('0x5')]);module[_0x09ce('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 6375fbe..d00ad35 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 _0xcf64=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x2a241e,_0x1e950d){var _0x4c7b68=function(_0x26948f){while(--_0x26948f){_0x2a241e['push'](_0x2a241e['shift']());}};_0x4c7b68(++_0x1e950d);}(_0xcf64,0x156));var _0x4cf6=function(_0x3f92a4,_0x296cac){_0x3f92a4=_0x3f92a4-0x0;var _0x5cb51c=_0xcf64[_0x3f92a4];return _0x5cb51c;};'use strict';var Sequelize=require(_0x4cf6('0x0'));module['exports']={'name':{'type':Sequelize[_0x4cf6('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x4cf6('0x1')]},'description':{'type':Sequelize[_0x4cf6('0x1')]},'status':{'type':Sequelize[_0x4cf6('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x4cf6('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x63a4=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x63a4,0x1b4));var _0x463a=function(_0x4256c5,_0x288cee){_0x4256c5=_0x4256c5-0x0;var _0x3c8bfd=_0x63a4[_0x4256c5];return _0x3c8bfd;};'use strict';var Sequelize=require(_0x463a('0x0'));module[_0x463a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x463a('0x2')]},'description':{'type':Sequelize[_0x463a('0x2')]},'status':{'type':Sequelize[_0x463a('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x463a('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 9424ef1..b559a13 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 _0xbbf4=['../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','Automation','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','addConditions','ids','omit','findOne','Condition','getConditions','addActions','getActions','Action','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util'];(function(_0x53d905,_0x4d125d){var _0x347bad=function(_0x45e016){while(--_0x45e016){_0x53d905['push'](_0x53d905['shift']());}};_0x347bad(++_0x4d125d);}(_0xbbf4,0x141));var _0x4bbf=function(_0x7db1a8,_0xe45de3){_0x7db1a8=_0x7db1a8-0x0;var _0x48d2e7=_0xbbf4[_0x7db1a8];return _0x48d2e7;};'use strict';var emlformat=require(_0x4bbf('0x0'));var rimraf=require(_0x4bbf('0x1'));var zipdir=require(_0x4bbf('0x2'));var jsonpatch=require(_0x4bbf('0x3'));var rp=require(_0x4bbf('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4bbf('0x5'));var util=require(_0x4bbf('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4bbf('0x7'));var squel=require(_0x4bbf('0x8'));var crypto=require(_0x4bbf('0x9'));var jsforce=require(_0x4bbf('0xa'));var deskjs=require(_0x4bbf('0xb'));var toCsv=require(_0x4bbf('0xc'));var querystring=require(_0x4bbf('0xd'));var Papa=require(_0x4bbf('0xe'));var Redis=require(_0x4bbf('0xf'));var authService=require(_0x4bbf('0x10'));var qs=require(_0x4bbf('0x11'));var as=require(_0x4bbf('0x12'));var hardwareService=require(_0x4bbf('0x13'));var logger=require('../../config/logger')(_0x4bbf('0x14'));var utils=require('../../config/utils');var config=require(_0x4bbf('0x15'));var licenseUtil=require(_0x4bbf('0x16'));var db=require(_0x4bbf('0x17'))['db'];function respondWithStatusCode(_0x4c48c2,_0x3236f2){_0x3236f2=_0x3236f2||0xcc;return function(_0x2b7d45){if(_0x2b7d45){return _0x4c48c2[_0x4bbf('0x18')](_0x3236f2);}return _0x4c48c2[_0x4bbf('0x19')](_0x3236f2)['end']();};}function respondWithResult(_0x1db077,_0xa7c3b2){_0xa7c3b2=_0xa7c3b2||0xc8;return function(_0x33aef7){if(_0x33aef7){return _0x1db077[_0x4bbf('0x19')](_0xa7c3b2)[_0x4bbf('0x1a')](_0x33aef7);}};}function respondWithFilteredResult(_0x238d8b,_0x1faebb){return function(_0x506a07){if(_0x506a07){var _0x42f2d0=typeof _0x1faebb[_0x4bbf('0x1b')]===_0x4bbf('0x1c')&&typeof _0x1faebb[_0x4bbf('0x1d')]===_0x4bbf('0x1c');var _0x458911=_0x506a07['count'];var _0x5559b4=_0x42f2d0?0x0:_0x1faebb[_0x4bbf('0x1b')];var _0x2f6c88=_0x42f2d0?_0x506a07[_0x4bbf('0x1e')]:_0x1faebb[_0x4bbf('0x1b')]+_0x1faebb['limit'];var _0x35376e;if(_0x2f6c88>=_0x458911){_0x2f6c88=_0x458911;_0x35376e=0xc8;}else{_0x35376e=0xce;}_0x238d8b[_0x4bbf('0x19')](_0x35376e);return _0x238d8b[_0x4bbf('0x1f')](_0x4bbf('0x20'),_0x5559b4+'-'+_0x2f6c88+'/'+_0x458911)[_0x4bbf('0x1a')](_0x506a07);}return null;};}function patchUpdates(_0x4cabef){return function(_0x235f76){try{jsonpatch[_0x4bbf('0x21')](_0x235f76,_0x4cabef,!![]);}catch(_0x12d49a){return BPromise[_0x4bbf('0x22')](_0x12d49a);}return _0x235f76[_0x4bbf('0x23')]();};}function saveUpdates(_0x46a5b2,_0x4b0632){return function(_0x38f771){if(_0x38f771){return _0x38f771[_0x4bbf('0x24')](_0x46a5b2)[_0x4bbf('0x25')](function(_0xb29a81){return _0xb29a81;});}return null;};}function removeEntity(_0x10cec3,_0x123cb1){return function(_0x41644c){if(_0x41644c){return _0x41644c[_0x4bbf('0x26')]()['then'](function(){_0x10cec3['status'](0xcc)[_0x4bbf('0x27')]();});}};}function handleEntityNotFound(_0x588650,_0xb6707a){return function(_0x300aac){if(!_0x300aac){_0x588650['sendStatus'](0x194);}return _0x300aac;};}function handleError(_0x80f8d4,_0x31d2d6){_0x31d2d6=_0x31d2d6||0x1f4;return function(_0x1657ea){logger[_0x4bbf('0x28')](_0x1657ea[_0x4bbf('0x29')]);if(_0x1657ea[_0x4bbf('0x2a')]){delete _0x1657ea[_0x4bbf('0x2a')];}_0x80f8d4['status'](_0x31d2d6)[_0x4bbf('0x2b')](_0x1657ea);};}exports[_0x4bbf('0x2c')]=function(_0xde81ca,_0x3e3ca9){var _0x3f87bb={},_0x5400f7={},_0x4fae64={'count':0x0,'rows':[]};var _0x32512b=_[_0x4bbf('0x2d')](db['Automation'][_0x4bbf('0x2e')],function(_0x26c9bc){return{'name':_0x26c9bc['fieldName'],'type':_0x26c9bc[_0x4bbf('0x2f')][_0x4bbf('0x30')]};});_0x5400f7[_0x4bbf('0x31')]=_[_0x4bbf('0x2d')](_0x32512b,_0x4bbf('0x2a'));_0x5400f7[_0x4bbf('0x32')]=_[_0x4bbf('0x33')](_0xde81ca['query']);_0x5400f7[_0x4bbf('0x34')]=_[_0x4bbf('0x35')](_0x5400f7['model'],_0x5400f7['query']);_0x3f87bb['attributes']=_[_0x4bbf('0x35')](_0x5400f7[_0x4bbf('0x31')],qs[_0x4bbf('0x36')](_0xde81ca['query'][_0x4bbf('0x36')]));_0x3f87bb['attributes']=_0x3f87bb['attributes']['length']?_0x3f87bb[_0x4bbf('0x37')]:_0x5400f7[_0x4bbf('0x31')];if(!_0xde81ca[_0x4bbf('0x32')][_0x4bbf('0x38')](_0x4bbf('0x39'))){_0x3f87bb['limit']=qs[_0x4bbf('0x1d')](_0xde81ca[_0x4bbf('0x32')][_0x4bbf('0x1d')]);_0x3f87bb['offset']=qs[_0x4bbf('0x1b')](_0xde81ca['query'][_0x4bbf('0x1b')]);}_0x3f87bb[_0x4bbf('0x3a')]=qs[_0x4bbf('0x3b')](_0xde81ca[_0x4bbf('0x32')]['sort']);_0x3f87bb[_0x4bbf('0x3c')]=qs['filters'](_['pick'](_0xde81ca['query'],_0x5400f7[_0x4bbf('0x34')]),_0x32512b);if(_0xde81ca['query'][_0x4bbf('0x3d')]){_0x3f87bb[_0x4bbf('0x3c')]=_[_0x4bbf('0x3e')](_0x3f87bb[_0x4bbf('0x3c')],{'$or':_[_0x4bbf('0x2d')](_0x32512b,function(_0x74d5b3){if(_0x74d5b3[_0x4bbf('0x2f')]!=='VIRTUAL'){var _0x53d39e={};_0x53d39e[_0x74d5b3['name']]={'$like':'%'+_0xde81ca['query'][_0x4bbf('0x3d')]+'%'};return _0x53d39e;}})});}_0x3f87bb=_[_0x4bbf('0x3e')]({},_0x3f87bb,_0xde81ca[_0x4bbf('0x3f')]);var _0x5c7973={'where':_0x3f87bb[_0x4bbf('0x3c')]};return db[_0x4bbf('0x40')][_0x4bbf('0x1e')](_0x5c7973)['then'](function(_0x2b2c86){_0x4fae64[_0x4bbf('0x1e')]=_0x2b2c86;if(_0xde81ca[_0x4bbf('0x32')][_0x4bbf('0x41')]){_0x3f87bb[_0x4bbf('0x42')]=[{'all':!![]}];}return db['Automation'][_0x4bbf('0x43')](_0x3f87bb);})[_0x4bbf('0x25')](function(_0x57d212){_0x4fae64[_0x4bbf('0x44')]=_0x57d212;return _0x4fae64;})[_0x4bbf('0x25')](respondWithFilteredResult(_0x3e3ca9,_0x3f87bb))[_0x4bbf('0x45')](handleError(_0x3e3ca9,null));};exports[_0x4bbf('0x46')]=function(_0x585ac8,_0x5de590){var _0x49d990={'raw':![],'where':{'id':_0x585ac8[_0x4bbf('0x47')]['id']}},_0x5e6c9b={};_0x5e6c9b[_0x4bbf('0x31')]=_[_0x4bbf('0x33')](db[_0x4bbf('0x40')]['rawAttributes']);_0x5e6c9b[_0x4bbf('0x32')]=_[_0x4bbf('0x33')](_0x585ac8['query']);_0x5e6c9b[_0x4bbf('0x34')]=_[_0x4bbf('0x35')](_0x5e6c9b[_0x4bbf('0x31')],_0x5e6c9b[_0x4bbf('0x32')]);_0x49d990[_0x4bbf('0x37')]=_[_0x4bbf('0x35')](_0x5e6c9b[_0x4bbf('0x31')],qs[_0x4bbf('0x36')](_0x585ac8['query'][_0x4bbf('0x36')]));_0x49d990[_0x4bbf('0x37')]=_0x49d990[_0x4bbf('0x37')][_0x4bbf('0x48')]?_0x49d990['attributes']:_0x5e6c9b[_0x4bbf('0x31')];if(_0x585ac8['query'][_0x4bbf('0x41')]){_0x49d990[_0x4bbf('0x42')]=[{'all':!![]}];}_0x49d990=_[_0x4bbf('0x3e')]({},_0x49d990,_0x585ac8[_0x4bbf('0x3f')]);return db[_0x4bbf('0x40')][_0x4bbf('0x49')](_0x49d990)[_0x4bbf('0x25')](handleEntityNotFound(_0x5de590,null))[_0x4bbf('0x25')](respondWithResult(_0x5de590,null))[_0x4bbf('0x45')](handleError(_0x5de590,null));};exports[_0x4bbf('0x4a')]=function(_0x442917,_0x580b6e){return db[_0x4bbf('0x40')][_0x4bbf('0x4a')](_0x442917[_0x4bbf('0x4b')],{})[_0x4bbf('0x25')](respondWithResult(_0x580b6e,0xc9))['catch'](handleError(_0x580b6e,null));};exports[_0x4bbf('0x24')]=function(_0x40ae3e,_0x39b67f){if(_0x40ae3e[_0x4bbf('0x4b')]['id']){delete _0x40ae3e[_0x4bbf('0x4b')]['id'];}return db[_0x4bbf('0x40')][_0x4bbf('0x49')]({'where':{'id':_0x40ae3e['params']['id']}})[_0x4bbf('0x25')](handleEntityNotFound(_0x39b67f,null))[_0x4bbf('0x25')](saveUpdates(_0x40ae3e['body'],null))[_0x4bbf('0x25')](respondWithResult(_0x39b67f,null))['catch'](handleError(_0x39b67f,null));};exports[_0x4bbf('0x26')]=function(_0x41d2f1,_0x497125){return db['Automation'][_0x4bbf('0x49')]({'where':{'id':_0x41d2f1['params']['id']}})[_0x4bbf('0x25')](handleEntityNotFound(_0x497125,null))[_0x4bbf('0x25')](removeEntity(_0x497125,null))[_0x4bbf('0x45')](handleError(_0x497125,null));};exports['addConditions']=function(_0x21d1e1,_0x362175,_0x34489a){return db['Condition']['find']({'where':{'id':_0x21d1e1[_0x4bbf('0x47')]['id']}})[_0x4bbf('0x25')](handleEntityNotFound(_0x362175,null))['then'](function(_0x2c89e0){if(_0x2c89e0){return _0x2c89e0[_0x4bbf('0x4c')](_0x21d1e1['body'][_0x4bbf('0x4d')],_[_0x4bbf('0x4e')](_0x21d1e1['body'],['ids','id'])||{});}})[_0x4bbf('0x25')](respondWithResult(_0x362175,null))['catch'](handleError(_0x362175,null));};exports['getConditions']=function(_0x23a6e8,_0x58f43c,_0x35375b){var _0x347aa3={};var _0x4db7b6={};var _0x1fb4bc;var _0x587df2;return db[_0x4bbf('0x40')][_0x4bbf('0x4f')]({'where':{'id':_0x23a6e8[_0x4bbf('0x47')]['id']}})[_0x4bbf('0x25')](handleEntityNotFound(_0x58f43c,null))[_0x4bbf('0x25')](function(_0x5214d1){if(_0x5214d1){_0x1fb4bc=_0x5214d1;_0x4db7b6[_0x4bbf('0x31')]=_[_0x4bbf('0x33')](db[_0x4bbf('0x50')][_0x4bbf('0x2e')]);_0x4db7b6[_0x4bbf('0x32')]=_[_0x4bbf('0x33')](_0x23a6e8['query']);_0x4db7b6['filters']=_[_0x4bbf('0x35')](_0x4db7b6[_0x4bbf('0x31')],_0x4db7b6[_0x4bbf('0x32')]);_0x347aa3[_0x4bbf('0x37')]=_['intersection'](_0x4db7b6[_0x4bbf('0x31')],qs[_0x4bbf('0x36')](_0x23a6e8[_0x4bbf('0x32')][_0x4bbf('0x36')]));_0x347aa3['attributes']=_0x347aa3[_0x4bbf('0x37')][_0x4bbf('0x48')]?_0x347aa3[_0x4bbf('0x37')]:_0x4db7b6[_0x4bbf('0x31')];_0x347aa3[_0x4bbf('0x3a')]=qs[_0x4bbf('0x3b')](_0x23a6e8[_0x4bbf('0x32')][_0x4bbf('0x3b')]);_0x347aa3[_0x4bbf('0x3c')]=qs[_0x4bbf('0x34')](_['pick'](_0x23a6e8['query'],_0x4db7b6[_0x4bbf('0x34')]));if(_0x23a6e8['query']['filter']){_0x347aa3[_0x4bbf('0x3c')]=_[_0x4bbf('0x3e')](_0x347aa3[_0x4bbf('0x3c')],{'$or':_['map'](_0x347aa3[_0x4bbf('0x37')],function(_0x155f3d){var _0x10a449={};_0x10a449[_0x155f3d]={'$like':'%'+_0x23a6e8[_0x4bbf('0x32')][_0x4bbf('0x3d')]+'%'};return _0x10a449;})});}_0x347aa3=_[_0x4bbf('0x3e')]({},_0x347aa3,_0x23a6e8[_0x4bbf('0x3f')]);return _0x1fb4bc['getConditions'](_0x347aa3);}})[_0x4bbf('0x25')](function(_0x31cd28){if(_0x31cd28){_0x587df2=_0x31cd28[_0x4bbf('0x48')];if(!_0x23a6e8[_0x4bbf('0x32')][_0x4bbf('0x38')](_0x4bbf('0x39'))){_0x347aa3[_0x4bbf('0x1d')]=qs[_0x4bbf('0x1d')](_0x23a6e8[_0x4bbf('0x32')][_0x4bbf('0x1d')]);_0x347aa3['offset']=qs['offset'](_0x23a6e8['query'][_0x4bbf('0x1b')]);}return _0x1fb4bc[_0x4bbf('0x51')](_0x347aa3);}})['then'](function(_0x305bad){if(_0x305bad){return _0x305bad?{'count':_0x587df2,'rows':_0x305bad}:null;}})[_0x4bbf('0x25')](respondWithResult(_0x58f43c,null))['catch'](handleError(_0x58f43c,null));};exports[_0x4bbf('0x52')]=function(_0x4fbb44,_0x588a5e,_0x55b2d7){return db['Action'][_0x4bbf('0x49')]({'where':{'id':_0x4fbb44[_0x4bbf('0x47')]['id']}})['then'](handleEntityNotFound(_0x588a5e,null))[_0x4bbf('0x25')](function(_0x426319){if(_0x426319){return _0x426319[_0x4bbf('0x52')](_0x4fbb44[_0x4bbf('0x4b')][_0x4bbf('0x4d')],_[_0x4bbf('0x4e')](_0x4fbb44['body'],[_0x4bbf('0x4d'),'id'])||{});}})[_0x4bbf('0x25')](respondWithResult(_0x588a5e,null))['catch'](handleError(_0x588a5e,null));};exports[_0x4bbf('0x53')]=function(_0x1ca2d7,_0x5ac6e0,_0x258356){var _0x526725={};var _0x1fb44f={};var _0xac9b21;var _0x4af9ce;return db[_0x4bbf('0x40')][_0x4bbf('0x4f')]({'where':{'id':_0x1ca2d7[_0x4bbf('0x47')]['id']}})[_0x4bbf('0x25')](handleEntityNotFound(_0x5ac6e0,null))[_0x4bbf('0x25')](function(_0x109dc2){if(_0x109dc2){_0xac9b21=_0x109dc2;_0x1fb44f['model']=_['keys'](db[_0x4bbf('0x54')][_0x4bbf('0x2e')]);_0x1fb44f[_0x4bbf('0x32')]=_[_0x4bbf('0x33')](_0x1ca2d7['query']);_0x1fb44f[_0x4bbf('0x34')]=_['intersection'](_0x1fb44f['model'],_0x1fb44f[_0x4bbf('0x32')]);_0x526725[_0x4bbf('0x37')]=_[_0x4bbf('0x35')](_0x1fb44f['model'],qs['fields'](_0x1ca2d7[_0x4bbf('0x32')][_0x4bbf('0x36')]));_0x526725[_0x4bbf('0x37')]=_0x526725[_0x4bbf('0x37')]['length']?_0x526725[_0x4bbf('0x37')]:_0x1fb44f['model'];_0x526725[_0x4bbf('0x3a')]=qs[_0x4bbf('0x3b')](_0x1ca2d7[_0x4bbf('0x32')][_0x4bbf('0x3b')]);_0x526725[_0x4bbf('0x3c')]=qs[_0x4bbf('0x34')](_[_0x4bbf('0x55')](_0x1ca2d7[_0x4bbf('0x32')],_0x1fb44f[_0x4bbf('0x34')]));if(_0x1ca2d7[_0x4bbf('0x32')][_0x4bbf('0x3d')]){_0x526725[_0x4bbf('0x3c')]=_[_0x4bbf('0x3e')](_0x526725[_0x4bbf('0x3c')],{'$or':_[_0x4bbf('0x2d')](_0x526725['attributes'],function(_0x19b447){var _0x3aa995={};_0x3aa995[_0x19b447]={'$like':'%'+_0x1ca2d7[_0x4bbf('0x32')]['filter']+'%'};return _0x3aa995;})});}_0x526725=_[_0x4bbf('0x3e')]({},_0x526725,_0x1ca2d7[_0x4bbf('0x3f')]);return _0xac9b21[_0x4bbf('0x53')](_0x526725);}})[_0x4bbf('0x25')](function(_0x5dfe86){if(_0x5dfe86){_0x4af9ce=_0x5dfe86[_0x4bbf('0x48')];if(!_0x1ca2d7[_0x4bbf('0x32')]['hasOwnProperty'](_0x4bbf('0x39'))){_0x526725[_0x4bbf('0x1d')]=qs['limit'](_0x1ca2d7[_0x4bbf('0x32')][_0x4bbf('0x1d')]);_0x526725[_0x4bbf('0x1b')]=qs[_0x4bbf('0x1b')](_0x1ca2d7[_0x4bbf('0x32')]['offset']);}return _0xac9b21['getActions'](_0x526725);}})[_0x4bbf('0x25')](function(_0x344d7e){if(_0x344d7e){return _0x344d7e?{'count':_0x4af9ce,'rows':_0x344d7e}:null;}})[_0x4bbf('0x25')](respondWithResult(_0x5ac6e0,null))['catch'](handleError(_0x5ac6e0,null));};
\ No newline at end of file
+var _0x6139=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','update','destroy','then','error','stack','name','index','Automation','rawAttributes','fieldName','key','model','map','keys','query','attributes','intersection','fields','length','nolimit','sort','where','filters','filter','merge','type','options','count','includeAll','include','findAll','rows','show','params','find','catch','create','body','addConditions','Condition','ids','omit','getConditions','pick','Action','addActions','findOne','order','getActions','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','squel'];(function(_0x4f3964,_0x33df88){var _0xf98636=function(_0x565a2c){while(--_0x565a2c){_0x4f3964['push'](_0x4f3964['shift']());}};_0xf98636(++_0x33df88);}(_0x6139,0xef));var _0x9613=function(_0xfec4f,_0x516119){_0xfec4f=_0xfec4f-0x0;var _0x4d8bad=_0x6139[_0xfec4f];return _0x4d8bad;};'use strict';var emlformat=require(_0x9613('0x0'));var rimraf=require(_0x9613('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9613('0x2'));var rp=require(_0x9613('0x3'));var moment=require(_0x9613('0x4'));var BPromise=require(_0x9613('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9613('0x6'));var sox=require(_0x9613('0x7'));var csv=require(_0x9613('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9613('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9613('0xa'));var toCsv=require(_0x9613('0x8'));var querystring=require(_0x9613('0xb'));var Papa=require('papaparse');var Redis=require(_0x9613('0xc'));var authService=require(_0x9613('0xd'));var qs=require(_0x9613('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9613('0xf'));var logger=require(_0x9613('0x10'))(_0x9613('0x11'));var utils=require(_0x9613('0x12'));var config=require(_0x9613('0x13'));var licenseUtil=require(_0x9613('0x14'));var db=require(_0x9613('0x15'))['db'];function respondWithStatusCode(_0x16d41b,_0x1bc9ba){_0x1bc9ba=_0x1bc9ba||0xcc;return function(_0x5319eb){if(_0x5319eb){return _0x16d41b[_0x9613('0x16')](_0x1bc9ba);}return _0x16d41b[_0x9613('0x17')](_0x1bc9ba)[_0x9613('0x18')]();};}function respondWithResult(_0x16ec05,_0x40b51b){_0x40b51b=_0x40b51b||0xc8;return function(_0x5d4b74){if(_0x5d4b74){return _0x16ec05[_0x9613('0x17')](_0x40b51b)[_0x9613('0x19')](_0x5d4b74);}};}function respondWithFilteredResult(_0x4dd580,_0x2c13f3){return function(_0x2c2b4d){if(_0x2c2b4d){var _0x44e1ea=typeof _0x2c13f3[_0x9613('0x1a')]===_0x9613('0x1b')&&typeof _0x2c13f3['limit']===_0x9613('0x1b');var _0x4e8a9c=_0x2c2b4d['count'];var _0x15559a=_0x44e1ea?0x0:_0x2c13f3[_0x9613('0x1a')];var _0x87db25=_0x44e1ea?_0x2c2b4d['count']:_0x2c13f3[_0x9613('0x1a')]+_0x2c13f3[_0x9613('0x1c')];var _0x1a2ee8;if(_0x87db25>=_0x4e8a9c){_0x87db25=_0x4e8a9c;_0x1a2ee8=0xc8;}else{_0x1a2ee8=0xce;}_0x4dd580[_0x9613('0x17')](_0x1a2ee8);return _0x4dd580[_0x9613('0x1d')]('Content-Range',_0x15559a+'-'+_0x87db25+'/'+_0x4e8a9c)['json'](_0x2c2b4d);}return null;};}function patchUpdates(_0x36dda6){return function(_0x5d12e5){try{jsonpatch[_0x9613('0x1e')](_0x5d12e5,_0x36dda6,!![]);}catch(_0x140f4b){return BPromise[_0x9613('0x1f')](_0x140f4b);}return _0x5d12e5[_0x9613('0x20')]();};}function saveUpdates(_0x270327,_0x33ff16){return function(_0x31b2ac){if(_0x31b2ac){return _0x31b2ac[_0x9613('0x21')](_0x270327)['then'](function(_0x4486de){return _0x4486de;});}return null;};}function removeEntity(_0x37e1b2,_0x3d1baa){return function(_0xc19af){if(_0xc19af){return _0xc19af[_0x9613('0x22')]()[_0x9613('0x23')](function(){_0x37e1b2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x14bfe1,_0x2d93b1){return function(_0x5971a9){if(!_0x5971a9){_0x14bfe1[_0x9613('0x16')](0x194);}return _0x5971a9;};}function handleError(_0x2bcd75,_0x5468e1){_0x5468e1=_0x5468e1||0x1f4;return function(_0x3a3391){logger[_0x9613('0x24')](_0x3a3391[_0x9613('0x25')]);if(_0x3a3391[_0x9613('0x26')]){delete _0x3a3391['name'];}_0x2bcd75[_0x9613('0x17')](_0x5468e1)['send'](_0x3a3391);};}exports[_0x9613('0x27')]=function(_0x2d4416,_0x2a826c){var _0x474f47={},_0x27297f={},_0x33fedb={'count':0x0,'rows':[]};var _0x2f7a39=_['map'](db[_0x9613('0x28')][_0x9613('0x29')],function(_0xd661e){return{'name':_0xd661e[_0x9613('0x2a')],'type':_0xd661e['type'][_0x9613('0x2b')]};});_0x27297f[_0x9613('0x2c')]=_[_0x9613('0x2d')](_0x2f7a39,_0x9613('0x26'));_0x27297f['query']=_[_0x9613('0x2e')](_0x2d4416[_0x9613('0x2f')]);_0x27297f['filters']=_['intersection'](_0x27297f[_0x9613('0x2c')],_0x27297f[_0x9613('0x2f')]);_0x474f47[_0x9613('0x30')]=_[_0x9613('0x31')](_0x27297f[_0x9613('0x2c')],qs['fields'](_0x2d4416['query'][_0x9613('0x32')]));_0x474f47[_0x9613('0x30')]=_0x474f47['attributes'][_0x9613('0x33')]?_0x474f47[_0x9613('0x30')]:_0x27297f['model'];if(!_0x2d4416['query']['hasOwnProperty'](_0x9613('0x34'))){_0x474f47[_0x9613('0x1c')]=qs[_0x9613('0x1c')](_0x2d4416['query'][_0x9613('0x1c')]);_0x474f47['offset']=qs[_0x9613('0x1a')](_0x2d4416[_0x9613('0x2f')][_0x9613('0x1a')]);}_0x474f47['order']=qs['sort'](_0x2d4416['query'][_0x9613('0x35')]);_0x474f47[_0x9613('0x36')]=qs['filters'](_['pick'](_0x2d4416[_0x9613('0x2f')],_0x27297f[_0x9613('0x37')]),_0x2f7a39);if(_0x2d4416['query'][_0x9613('0x38')]){_0x474f47[_0x9613('0x36')]=_[_0x9613('0x39')](_0x474f47['where'],{'$or':_['map'](_0x2f7a39,function(_0x460dc0){if(_0x460dc0[_0x9613('0x3a')]!=='VIRTUAL'){var _0x1981e6={};_0x1981e6[_0x460dc0[_0x9613('0x26')]]={'$like':'%'+_0x2d4416[_0x9613('0x2f')][_0x9613('0x38')]+'%'};return _0x1981e6;}})});}_0x474f47=_[_0x9613('0x39')]({},_0x474f47,_0x2d4416[_0x9613('0x3b')]);var _0x573d77={'where':_0x474f47[_0x9613('0x36')]};return db['Automation']['count'](_0x573d77)[_0x9613('0x23')](function(_0x580758){_0x33fedb[_0x9613('0x3c')]=_0x580758;if(_0x2d4416[_0x9613('0x2f')][_0x9613('0x3d')]){_0x474f47[_0x9613('0x3e')]=[{'all':!![]}];}return db[_0x9613('0x28')][_0x9613('0x3f')](_0x474f47);})['then'](function(_0xa2a883){_0x33fedb[_0x9613('0x40')]=_0xa2a883;return _0x33fedb;})[_0x9613('0x23')](respondWithFilteredResult(_0x2a826c,_0x474f47))['catch'](handleError(_0x2a826c,null));};exports[_0x9613('0x41')]=function(_0x46a27d,_0x2da1c9){var _0x14e7a5={'raw':![],'where':{'id':_0x46a27d[_0x9613('0x42')]['id']}},_0x39c164={};_0x39c164[_0x9613('0x2c')]=_[_0x9613('0x2e')](db['Automation'][_0x9613('0x29')]);_0x39c164[_0x9613('0x2f')]=_['keys'](_0x46a27d[_0x9613('0x2f')]);_0x39c164[_0x9613('0x37')]=_[_0x9613('0x31')](_0x39c164[_0x9613('0x2c')],_0x39c164['query']);_0x14e7a5[_0x9613('0x30')]=_['intersection'](_0x39c164['model'],qs[_0x9613('0x32')](_0x46a27d[_0x9613('0x2f')][_0x9613('0x32')]));_0x14e7a5[_0x9613('0x30')]=_0x14e7a5[_0x9613('0x30')][_0x9613('0x33')]?_0x14e7a5[_0x9613('0x30')]:_0x39c164[_0x9613('0x2c')];if(_0x46a27d['query']['includeAll']){_0x14e7a5[_0x9613('0x3e')]=[{'all':!![]}];}_0x14e7a5=_[_0x9613('0x39')]({},_0x14e7a5,_0x46a27d[_0x9613('0x3b')]);return db['Automation'][_0x9613('0x43')](_0x14e7a5)[_0x9613('0x23')](handleEntityNotFound(_0x2da1c9,null))[_0x9613('0x23')](respondWithResult(_0x2da1c9,null))[_0x9613('0x44')](handleError(_0x2da1c9,null));};exports[_0x9613('0x45')]=function(_0x47a6a8,_0x194a2c){return db['Automation']['create'](_0x47a6a8[_0x9613('0x46')],{})[_0x9613('0x23')](respondWithResult(_0x194a2c,0xc9))[_0x9613('0x44')](handleError(_0x194a2c,null));};exports[_0x9613('0x21')]=function(_0x498cad,_0x3a8021){if(_0x498cad['body']['id']){delete _0x498cad[_0x9613('0x46')]['id'];}return db[_0x9613('0x28')][_0x9613('0x43')]({'where':{'id':_0x498cad[_0x9613('0x42')]['id']}})[_0x9613('0x23')](handleEntityNotFound(_0x3a8021,null))[_0x9613('0x23')](saveUpdates(_0x498cad['body'],null))[_0x9613('0x23')](respondWithResult(_0x3a8021,null))['catch'](handleError(_0x3a8021,null));};exports['destroy']=function(_0x59d074,_0x46c77d){return db[_0x9613('0x28')][_0x9613('0x43')]({'where':{'id':_0x59d074['params']['id']}})[_0x9613('0x23')](handleEntityNotFound(_0x46c77d,null))[_0x9613('0x23')](removeEntity(_0x46c77d,null))[_0x9613('0x44')](handleError(_0x46c77d,null));};exports[_0x9613('0x47')]=function(_0x5cccfa,_0x24f92b,_0x5b8fdb){return db[_0x9613('0x48')]['find']({'where':{'id':_0x5cccfa['params']['id']}})[_0x9613('0x23')](handleEntityNotFound(_0x24f92b,null))[_0x9613('0x23')](function(_0x2bc7fe){if(_0x2bc7fe){return _0x2bc7fe[_0x9613('0x47')](_0x5cccfa['body'][_0x9613('0x49')],_[_0x9613('0x4a')](_0x5cccfa['body'],[_0x9613('0x49'),'id'])||{});}})['then'](respondWithResult(_0x24f92b,null))['catch'](handleError(_0x24f92b,null));};exports[_0x9613('0x4b')]=function(_0x2adc07,_0x29f57f,_0x2477ea){var _0x42a1a1={};var _0x33d3a0={};var _0x4454e4;var _0x523c68;return db['Automation']['findOne']({'where':{'id':_0x2adc07[_0x9613('0x42')]['id']}})[_0x9613('0x23')](handleEntityNotFound(_0x29f57f,null))[_0x9613('0x23')](function(_0x4f6c27){if(_0x4f6c27){_0x4454e4=_0x4f6c27;_0x33d3a0[_0x9613('0x2c')]=_['keys'](db[_0x9613('0x48')]['rawAttributes']);_0x33d3a0[_0x9613('0x2f')]=_[_0x9613('0x2e')](_0x2adc07[_0x9613('0x2f')]);_0x33d3a0[_0x9613('0x37')]=_[_0x9613('0x31')](_0x33d3a0[_0x9613('0x2c')],_0x33d3a0[_0x9613('0x2f')]);_0x42a1a1[_0x9613('0x30')]=_[_0x9613('0x31')](_0x33d3a0[_0x9613('0x2c')],qs[_0x9613('0x32')](_0x2adc07[_0x9613('0x2f')]['fields']));_0x42a1a1[_0x9613('0x30')]=_0x42a1a1['attributes'][_0x9613('0x33')]?_0x42a1a1[_0x9613('0x30')]:_0x33d3a0[_0x9613('0x2c')];_0x42a1a1['order']=qs[_0x9613('0x35')](_0x2adc07[_0x9613('0x2f')][_0x9613('0x35')]);_0x42a1a1['where']=qs[_0x9613('0x37')](_[_0x9613('0x4c')](_0x2adc07[_0x9613('0x2f')],_0x33d3a0[_0x9613('0x37')]));if(_0x2adc07[_0x9613('0x2f')]['filter']){_0x42a1a1[_0x9613('0x36')]=_[_0x9613('0x39')](_0x42a1a1['where'],{'$or':_[_0x9613('0x2d')](_0x42a1a1[_0x9613('0x30')],function(_0x148793){var _0x1deb05={};_0x1deb05[_0x148793]={'$like':'%'+_0x2adc07['query'][_0x9613('0x38')]+'%'};return _0x1deb05;})});}_0x42a1a1=_['merge']({},_0x42a1a1,_0x2adc07[_0x9613('0x3b')]);return _0x4454e4[_0x9613('0x4b')](_0x42a1a1);}})[_0x9613('0x23')](function(_0x281f9e){if(_0x281f9e){_0x523c68=_0x281f9e['length'];if(!_0x2adc07['query']['hasOwnProperty'](_0x9613('0x34'))){_0x42a1a1[_0x9613('0x1c')]=qs[_0x9613('0x1c')](_0x2adc07[_0x9613('0x2f')][_0x9613('0x1c')]);_0x42a1a1[_0x9613('0x1a')]=qs[_0x9613('0x1a')](_0x2adc07[_0x9613('0x2f')][_0x9613('0x1a')]);}return _0x4454e4[_0x9613('0x4b')](_0x42a1a1);}})[_0x9613('0x23')](function(_0x5dc858){if(_0x5dc858){return _0x5dc858?{'count':_0x523c68,'rows':_0x5dc858}:null;}})[_0x9613('0x23')](respondWithResult(_0x29f57f,null))[_0x9613('0x44')](handleError(_0x29f57f,null));};exports['addActions']=function(_0x4d2502,_0x10f7e3,_0x5430a6){return db[_0x9613('0x4d')][_0x9613('0x43')]({'where':{'id':_0x4d2502[_0x9613('0x42')]['id']}})[_0x9613('0x23')](handleEntityNotFound(_0x10f7e3,null))[_0x9613('0x23')](function(_0x251f67){if(_0x251f67){return _0x251f67[_0x9613('0x4e')](_0x4d2502[_0x9613('0x46')][_0x9613('0x49')],_[_0x9613('0x4a')](_0x4d2502[_0x9613('0x46')],['ids','id'])||{});}})['then'](respondWithResult(_0x10f7e3,null))[_0x9613('0x44')](handleError(_0x10f7e3,null));};exports['getActions']=function(_0x12c247,_0x133fe9,_0x45ab8d){var _0x460d3b={};var _0x12dd2b={};var _0x38b6f3;var _0x116232;return db[_0x9613('0x28')][_0x9613('0x4f')]({'where':{'id':_0x12c247[_0x9613('0x42')]['id']}})[_0x9613('0x23')](handleEntityNotFound(_0x133fe9,null))[_0x9613('0x23')](function(_0xe63c33){if(_0xe63c33){_0x38b6f3=_0xe63c33;_0x12dd2b[_0x9613('0x2c')]=_['keys'](db[_0x9613('0x4d')][_0x9613('0x29')]);_0x12dd2b[_0x9613('0x2f')]=_['keys'](_0x12c247[_0x9613('0x2f')]);_0x12dd2b[_0x9613('0x37')]=_[_0x9613('0x31')](_0x12dd2b[_0x9613('0x2c')],_0x12dd2b[_0x9613('0x2f')]);_0x460d3b['attributes']=_[_0x9613('0x31')](_0x12dd2b['model'],qs[_0x9613('0x32')](_0x12c247[_0x9613('0x2f')][_0x9613('0x32')]));_0x460d3b[_0x9613('0x30')]=_0x460d3b[_0x9613('0x30')][_0x9613('0x33')]?_0x460d3b['attributes']:_0x12dd2b[_0x9613('0x2c')];_0x460d3b[_0x9613('0x50')]=qs[_0x9613('0x35')](_0x12c247[_0x9613('0x2f')][_0x9613('0x35')]);_0x460d3b[_0x9613('0x36')]=qs[_0x9613('0x37')](_[_0x9613('0x4c')](_0x12c247[_0x9613('0x2f')],_0x12dd2b[_0x9613('0x37')]));if(_0x12c247[_0x9613('0x2f')][_0x9613('0x38')]){_0x460d3b[_0x9613('0x36')]=_[_0x9613('0x39')](_0x460d3b['where'],{'$or':_[_0x9613('0x2d')](_0x460d3b['attributes'],function(_0x5ef84c){var _0x2b27cf={};_0x2b27cf[_0x5ef84c]={'$like':'%'+_0x12c247[_0x9613('0x2f')][_0x9613('0x38')]+'%'};return _0x2b27cf;})});}_0x460d3b=_[_0x9613('0x39')]({},_0x460d3b,_0x12c247[_0x9613('0x3b')]);return _0x38b6f3[_0x9613('0x51')](_0x460d3b);}})['then'](function(_0x940206){if(_0x940206){_0x116232=_0x940206[_0x9613('0x33')];if(!_0x12c247[_0x9613('0x2f')][_0x9613('0x52')]('nolimit')){_0x460d3b['limit']=qs[_0x9613('0x1c')](_0x12c247[_0x9613('0x2f')]['limit']);_0x460d3b[_0x9613('0x1a')]=qs[_0x9613('0x1a')](_0x12c247[_0x9613('0x2f')][_0x9613('0x1a')]);}return _0x38b6f3[_0x9613('0x51')](_0x460d3b);}})[_0x9613('0x23')](function(_0x49faf8){if(_0x49faf8){return _0x49faf8?{'count':_0x116232,'rows':_0x49faf8}:null;}})[_0x9613('0x23')](respondWithResult(_0x133fe9,null))[_0x9613('0x44')](handleError(_0x133fe9,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 6c91c67..53c350a 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 _0x4b24=['api','moment','request-promise','path','../../config/environment','./automation.attributes','exports','define','Automation','lodash','util','../../config/logger'];(function(_0x337651,_0x2af690){var _0x20893c=function(_0x545dcd){while(--_0x545dcd){_0x337651['push'](_0x337651['shift']());}};_0x20893c(++_0x2af690);}(_0x4b24,0x1c5));var _0x44b2=function(_0x1877d8,_0x16c26a){_0x1877d8=_0x1877d8-0x0;var _0x176162=_0x4b24[_0x1877d8];return _0x176162;};'use strict';var _=require(_0x44b2('0x0'));var util=require(_0x44b2('0x1'));var logger=require(_0x44b2('0x2'))(_0x44b2('0x3'));var moment=require(_0x44b2('0x4'));var BPromise=require('bluebird');var rp=require(_0x44b2('0x5'));var fs=require('fs');var path=require(_0x44b2('0x6'));var rimraf=require('rimraf');var config=require(_0x44b2('0x7'));var attributes=require(_0x44b2('0x8'));module[_0x44b2('0x9')]=function(_0x53f02c,_0x559e5b){return _0x53f02c[_0x44b2('0xa')](_0x44b2('0xb'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x634d=['tools_automations','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x284ca5,_0x2ac104){var _0x2a8e36=function(_0x55b040){while(--_0x55b040){_0x284ca5['push'](_0x284ca5['shift']());}};_0x2a8e36(++_0x2ac104);}(_0x634d,0x91));var _0xd634=function(_0x36f1a9,_0x4ff6c0){_0x36f1a9=_0x36f1a9-0x0;var _0x12d802=_0x634d[_0x36f1a9];return _0x12d802;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd634('0x0'));var BPromise=require('bluebird');var rp=require(_0xd634('0x1'));var fs=require('fs');var path=require(_0xd634('0x2'));var rimraf=require(_0xd634('0x3'));var config=require(_0xd634('0x4'));var attributes=require('./automation.attributes');module[_0xd634('0x5')]=function(_0x12142c,_0x32ca1f){return _0x12142c[_0xd634('0x6')]('Automation',attributes,{'tableName':_0xd634('0x7'),'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 3f735bd..de680d3 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 _0x46c1=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment'];(function(_0x275073,_0x4ea63a){var _0x2864f7=function(_0x4ea815){while(--_0x4ea815){_0x275073['push'](_0x275073['shift']());}};_0x2864f7(++_0x4ea63a);}(_0x46c1,0x7c));var _0x146c=function(_0x17397c,_0x2e2208){_0x17397c=_0x17397c-0x0;var _0x58aa5f=_0x46c1[_0x17397c];return _0x58aa5f;};'use strict';var _=require('lodash');var util=require(_0x146c('0x0'));var moment=require(_0x146c('0x1'));var BPromise=require(_0x146c('0x2'));var rs=require(_0x146c('0x3'));var fs=require('fs');var Redis=require(_0x146c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x146c('0x5'));var logger=require(_0x146c('0x6'))(_0x146c('0x7'));var config=require(_0x146c('0x8'));var jayson=require(_0x146c('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e394f,_0x226480,_0x3bccd4){return new BPromise(function(_0x54f99b,_0x36a8c2){return client['request'](_0x2e394f,_0x3bccd4)[_0x146c('0xa')](function(_0x2c8c0a){logger['info'](_0x146c('0xb'),_0x226480,_0x146c('0xc'));logger[_0x146c('0xd')](_0x146c('0xe'),_0x226480,'request\x20sent',JSON[_0x146c('0xf')](_0x2c8c0a));if(_0x2c8c0a['error']){if(_0x2c8c0a[_0x146c('0x10')][_0x146c('0x11')]===0x1f4){logger[_0x146c('0x10')]('Automation,\x20%s,\x20%s',_0x226480,_0x2c8c0a[_0x146c('0x10')]['message']);return _0x36a8c2(_0x2c8c0a[_0x146c('0x10')]['message']);}logger[_0x146c('0x10')](_0x146c('0xb'),_0x226480,_0x2c8c0a[_0x146c('0x10')][_0x146c('0x12')]);return _0x54f99b(_0x2c8c0a['error'][_0x146c('0x12')]);}else{logger[_0x146c('0x13')]('Automation,\x20%s,\x20%s',_0x226480,_0x146c('0xc'));_0x54f99b(_0x2c8c0a['result']['message']);}})[_0x146c('0x14')](function(_0x512ac8){logger[_0x146c('0x10')](_0x146c('0xb'),_0x226480,_0x512ac8);_0x36a8c2(_0x512ac8);});});}
\ No newline at end of file
+var _0x20d8=['stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent','Automation,\x20%s,\x20%s,\x20%s'];(function(_0x467efe,_0x18a682){var _0x2ba774=function(_0x15da4b){while(--_0x15da4b){_0x467efe['push'](_0x467efe['shift']());}};_0x2ba774(++_0x18a682);}(_0x20d8,0xee));var _0x820d=function(_0x192249,_0x59b0e0){_0x192249=_0x192249-0x0;var _0x37efc8=_0x20d8[_0x192249];return _0x37efc8;};'use strict';var _=require(_0x820d('0x0'));var util=require(_0x820d('0x1'));var moment=require(_0x820d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x820d('0x3'));var db=require(_0x820d('0x4'))['db'];var utils=require(_0x820d('0x5'));var logger=require(_0x820d('0x6'))(_0x820d('0x7'));var config=require('../../config/environment');var jayson=require(_0x820d('0x8'));var client=jayson[_0x820d('0x9')][_0x820d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e23e3,_0x435a84,_0xa2751d){return new BPromise(function(_0x3b084c,_0x485bde){return client[_0x820d('0xb')](_0x4e23e3,_0xa2751d)['then'](function(_0x45fdd7){logger['info']('Automation,\x20%s,\x20%s',_0x435a84,_0x820d('0xc'));logger['debug'](_0x820d('0xd'),_0x435a84,_0x820d('0xc'),JSON[_0x820d('0xe')](_0x45fdd7));if(_0x45fdd7['error']){if(_0x45fdd7[_0x820d('0xf')][_0x820d('0x10')]===0x1f4){logger['error'](_0x820d('0x11'),_0x435a84,_0x45fdd7['error'][_0x820d('0x12')]);return _0x485bde(_0x45fdd7[_0x820d('0xf')][_0x820d('0x12')]);}logger[_0x820d('0xf')](_0x820d('0x11'),_0x435a84,_0x45fdd7[_0x820d('0xf')]['message']);return _0x3b084c(_0x45fdd7['error'][_0x820d('0x12')]);}else{logger['info'](_0x820d('0x11'),_0x435a84,_0x820d('0xc'));_0x3b084c(_0x45fdd7[_0x820d('0x13')]['message']);}})[_0x820d('0x14')](function(_0x3466c1){logger[_0x820d('0xf')](_0x820d('0x11'),_0x435a84,_0x3466c1);_0x485bde(_0x3466c1);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 1483f28..b43e298 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 _0x46b3=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','/:id','get','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions'];(function(_0x57b38f,_0xc26f33){var _0x6aa12c=function(_0x32850d){while(--_0x32850d){_0x57b38f['push'](_0x57b38f['shift']());}};_0x6aa12c(++_0xc26f33);}(_0x46b3,0x194));var _0x346b=function(_0x163285,_0x25607c){_0x163285=_0x163285-0x0;var _0x299c0b=_0x46b3[_0x163285];return _0x299c0b;};'use strict';var multer=require(_0x346b('0x0'));var util=require(_0x346b('0x1'));var path=require(_0x346b('0x2'));var timeout=require(_0x346b('0x3'));var express=require(_0x346b('0x4'));var router=express['Router']();var fs_extra=require(_0x346b('0x5'));var auth=require(_0x346b('0x6'));var interaction=require(_0x346b('0x7'));var config=require(_0x346b('0x8'));var controller=require(_0x346b('0x9'));router['get']('/',auth[_0x346b('0xa')](),controller[_0x346b('0xb')]);router['get'](_0x346b('0xc'),auth[_0x346b('0xa')](),controller['show']);router[_0x346b('0xd')](_0x346b('0xe'),auth[_0x346b('0xa')](),controller[_0x346b('0xf')]);router[_0x346b('0xd')](_0x346b('0x10'),auth[_0x346b('0xa')](),controller[_0x346b('0x11')]);router[_0x346b('0x12')]('/',auth['isAuthenticated'](),controller[_0x346b('0x13')]);router[_0x346b('0x12')]('/:id/conditions',auth[_0x346b('0xa')](),controller[_0x346b('0x14')]);router['post'](_0x346b('0x10'),auth[_0x346b('0xa')](),controller['addActions']);router['put'](_0x346b('0xc'),auth[_0x346b('0xa')](),controller[_0x346b('0x15')]);router[_0x346b('0x16')](_0x346b('0xc'),auth[_0x346b('0xa')](),controller[_0x346b('0x17')]);module[_0x346b('0x18')]=router;
\ No newline at end of file
+var _0x3cb7=['post','create','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/conditions','getConditions','/:id/actions','getActions'];(function(_0x39f34f,_0x298f45){var _0x59fee1=function(_0x6ebbb7){while(--_0x6ebbb7){_0x39f34f['push'](_0x39f34f['shift']());}};_0x59fee1(++_0x298f45);}(_0x3cb7,0x1a8));var _0x73cb=function(_0x3b6648,_0x2d723a){_0x3b6648=_0x3b6648-0x0;var _0x5a0a0d=_0x3cb7[_0x3b6648];return _0x5a0a0d;};'use strict';var multer=require(_0x73cb('0x0'));var util=require(_0x73cb('0x1'));var path=require('path');var timeout=require(_0x73cb('0x2'));var express=require(_0x73cb('0x3'));var router=express[_0x73cb('0x4')]();var fs_extra=require(_0x73cb('0x5'));var auth=require(_0x73cb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x73cb('0x7'));var controller=require('./automation.controller');router[_0x73cb('0x8')]('/',auth[_0x73cb('0x9')](),controller[_0x73cb('0xa')]);router[_0x73cb('0x8')](_0x73cb('0xb'),auth[_0x73cb('0x9')](),controller['show']);router[_0x73cb('0x8')](_0x73cb('0xc'),auth[_0x73cb('0x9')](),controller[_0x73cb('0xd')]);router[_0x73cb('0x8')](_0x73cb('0xe'),auth[_0x73cb('0x9')](),controller[_0x73cb('0xf')]);router[_0x73cb('0x10')]('/',auth[_0x73cb('0x9')](),controller[_0x73cb('0x11')]);router[_0x73cb('0x10')](_0x73cb('0xc'),auth[_0x73cb('0x9')](),controller['addConditions']);router[_0x73cb('0x10')](_0x73cb('0xe'),auth[_0x73cb('0x9')](),controller['addActions']);router['put'](_0x73cb('0xb'),auth[_0x73cb('0x9')](),controller[_0x73cb('0x12')]);router['delete'](_0x73cb('0xb'),auth[_0x73cb('0x9')](),controller['destroy']);module[_0x73cb('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index b8c5cb9..94872d3 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 _0x6e91=['#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'];(function(_0x128b04,_0x5de299){var _0x4a79e0=function(_0x4ea9b1){while(--_0x4ea9b1){_0x128b04['push'](_0x128b04['shift']());}};_0x4a79e0(++_0x5de299);}(_0x6e91,0x15e));var _0x16e9=function(_0x5a8a3c,_0x505557){_0x5a8a3c=_0x5a8a3c-0x0;var _0x201660=_0x6e91[_0x5a8a3c];return _0x201660;};'use strict';var Sequelize=require(_0x16e9('0x0'));module[_0x16e9('0x1')]={'name':{'type':Sequelize[_0x16e9('0x2')],'unique':_0x16e9('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0x16e9('0x4')},'description':{'type':Sequelize[_0x16e9('0x2')]},'active':{'type':Sequelize[_0x16e9('0x5')],'defaultValue':0x0,'comment':_0x16e9('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x16e9('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x16e9('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x16e9('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x16e9('0x8')](0x3)[_0x16e9('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x16e9('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x16e9('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x16e9('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x16e9('0x8')](0x5)[_0x16e9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x16e9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x16e9('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x16e9('0x8')](0x5)[_0x16e9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16e9('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x16e9('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x16e9('0x8')](0x5)[_0x16e9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16e9('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x16e9('0x8')](0x3)[_0x16e9('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x16e9('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x16e9('0x2')],'defaultValue':_0x16e9('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x16e9('0x10')](_0x16e9('0x11'),'never',_0x16e9('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x16e9('0x5')],'defaultValue':0x0,'comment':_0x16e9('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x16e9('0x8')](0x9)[_0x16e9('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x16e9('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x16e9('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x16e9('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x16e9('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x16e9('0x8')](0x9)[_0x16e9('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x16e9('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x16e9('0x8')](0x9)[_0x16e9('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x16e9('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x16e9('0x8')](0x9)[_0x16e9('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x16e9('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x16e9('0x8')](0x9)[_0x16e9('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x16e9('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x16e9('0x8')](0x5)[_0x16e9('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x16e9('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x16e9('0x8')](0x9)[_0x16e9('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x16e9('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x16e9('0x1c'),_0x16e9('0x1d')),'defaultValue':_0x16e9('0x1c')},'dialPrefix':{'type':Sequelize[_0x16e9('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x16e9('0x8')](0x3)[_0x16e9('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x16e9('0x1e')},'dialCutDigit':{'type':Sequelize[_0x16e9('0x8')](0x3)[_0x16e9('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x16e9('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x16e9('0x8')](0x3)[_0x16e9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x16e9('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x16e9('0x8')](0x5)[_0x16e9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16e9('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0x16e9('0x8')](0x3)[_0x16e9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x16e9('0x22')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x16e9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16e9('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x16e9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x16e9('0x8')](0x5)[_0x16e9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16e9('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0x16e9('0x8')](0x3)[_0x16e9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x16e9('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0x16e9('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x16e9('0x8')](0x3)[_0x16e9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x16e9('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x16e9('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16e9('0x27')}};
\ No newline at end of file
+var _0xf1cb=['name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','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,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING'];(function(_0x420990,_0x2031bd){var _0x533411=function(_0x42b118){while(--_0x42b118){_0x420990['push'](_0x420990['shift']());}};_0x533411(++_0x2031bd);}(_0xf1cb,0x6d));var _0xbf1c=function(_0x11c471,_0x1f9001){_0x11c471=_0x11c471-0x0;var _0x18285e=_0xf1cb[_0x11c471];return _0x18285e;};'use strict';var Sequelize=require(_0xbf1c('0x0'));module['exports']={'name':{'type':Sequelize[_0xbf1c('0x1')],'unique':_0xbf1c('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xbf1c('0x3')]('ivr'),'allowNull':![],'defaultValue':_0xbf1c('0x4')},'description':{'type':Sequelize[_0xbf1c('0x1')]},'active':{'type':Sequelize[_0xbf1c('0x5')],'defaultValue':0x0,'comment':_0xbf1c('0x6')},'limitCalls':{'type':Sequelize[_0xbf1c('0x7')](0x4)[_0xbf1c('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xbf1c('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xbf1c('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xbf1c('0x7')](0x3)[_0xbf1c('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf1c('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbf1c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xbf1c('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf1c('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xbf1c('0x7')](0x3)[_0xbf1c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xbf1c('0x7')](0x5)[_0xbf1c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf1c('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xbf1c('0x7')](0x3)[_0xbf1c('0x8')],'defaultValue':0x3,'comment':_0xbf1c('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf1c('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xbf1c('0x7')](0x3)[_0xbf1c('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xbf1c('0xf')},'dialTimezone':{'type':Sequelize[_0xbf1c('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xbf1c('0x1')],'defaultValue':_0xbf1c('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xbf1c('0x3')](_0xbf1c('0x11'),_0xbf1c('0x12'),_0xbf1c('0x13')),'defaultValue':_0xbf1c('0x11')},'dialAMDActive':{'type':Sequelize[_0xbf1c('0x5')],'defaultValue':0x0,'comment':_0xbf1c('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xbf1c('0x7')](0x9)[_0xbf1c('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xbf1c('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xbf1c('0x7')](0x9)[_0xbf1c('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xbf1c('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xbf1c('0x7')](0x9)[_0xbf1c('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xbf1c('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xbf1c('0x7')](0x9)[_0xbf1c('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbf1c('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0xbf1c('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xbf1c('0x7')](0x9)[_0xbf1c('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xbf1c('0x7')](0x9)[_0xbf1c('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xbf1c('0x7')](0x5)[_0xbf1c('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xbf1c('0x7')](0x9)[_0xbf1c('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbf1c('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0xbf1c('0x3')](_0xbf1c('0x1a'),'ASC'),'defaultValue':_0xbf1c('0x1a')},'dialPrefix':{'type':Sequelize[_0xbf1c('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xbf1c('0x7')](0x3)[_0xbf1c('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbf1c('0x1b')},'dialCutDigit':{'type':Sequelize[_0xbf1c('0x7')](0x3)[_0xbf1c('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbf1c('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xbf1c('0x7')](0x3)[_0xbf1c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf1c('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xbf1c('0x7')](0x5)[_0xbf1c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf1c('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0xbf1c('0x7')](0x3)[_0xbf1c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf1c('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0xbf1c('0x7')](0x5)[_0xbf1c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf1c('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbf1c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xbf1c('0x7')](0x5)[_0xbf1c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf1c('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0xbf1c('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf1c('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0xbf1c('0x7')](0x5)[_0xbf1c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xbf1c('0x7')](0x3)[_0xbf1c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf1c('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf1c('0x24')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 917b778..6d02b3e 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 _0x6c2d=['key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','include','findAll','rows','params','keys','includeAll','catch','create','user','get','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','error','getHoppers','CmHopper','nolimit','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CampaignId','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','field','NOW()','ContactId','toString','ListId','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','CmListId','cm_contacts','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','push','sequelize','removeBlackLists','eml-format','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','apply','reject','save','update','then','destroy','IvrCampaigns','UserProfileResource','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type'];(function(_0x5ad220,_0x27407e){var _0xdec77d=function(_0x58d736){while(--_0x58d736){_0x5ad220['push'](_0x5ad220['shift']());}};_0xdec77d(++_0x27407e);}(_0x6c2d,0x1e9));var _0xd6c2=function(_0x593752,_0xfc3827){_0x593752=_0x593752-0x0;var _0x4612be=_0x6c2d[_0x593752];return _0x4612be;};'use strict';var emlformat=require(_0xd6c2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd6c2('0x1'));var moment=require(_0xd6c2('0x2'));var BPromise=require(_0xd6c2('0x3'));var Mustache=require(_0xd6c2('0x4'));var util=require(_0xd6c2('0x5'));var path=require(_0xd6c2('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd6c2('0x7'));var fs=require('fs');var fs_extra=require(_0xd6c2('0x8'));var _=require('lodash');var squel=require(_0xd6c2('0x9'));var crypto=require(_0xd6c2('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd6c2('0xb'));var querystring=require(_0xd6c2('0xc'));var Papa=require(_0xd6c2('0xd'));var Redis=require(_0xd6c2('0xe'));var authService=require(_0xd6c2('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd6c2('0x10'));var hardwareService=require(_0xd6c2('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xd6c2('0x12'));var config=require(_0xd6c2('0x13'));var licenseUtil=require(_0xd6c2('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xdd7a59,_0x2571fa){_0x2571fa=_0x2571fa||0xcc;return function(_0x5bfc8b){if(_0x5bfc8b){return _0xdd7a59[_0xd6c2('0x15')](_0x2571fa);}return _0xdd7a59['status'](_0x2571fa)[_0xd6c2('0x16')]();};}function respondWithResult(_0x4dd054,_0x328de6){_0x328de6=_0x328de6||0xc8;return function(_0x2bd725){if(_0x2bd725){return _0x4dd054['status'](_0x328de6)[_0xd6c2('0x17')](_0x2bd725);}};}function respondWithFilteredResult(_0xc21f55,_0x3b6f23){return function(_0x323cec){if(_0x323cec){var _0xc328=typeof _0x3b6f23[_0xd6c2('0x18')]===_0xd6c2('0x19')&&typeof _0x3b6f23['limit']===_0xd6c2('0x19');var _0x17026c=_0x323cec[_0xd6c2('0x1a')];var _0x58fa76=_0xc328?0x0:_0x3b6f23[_0xd6c2('0x18')];var _0x34fd7e=_0xc328?_0x323cec[_0xd6c2('0x1a')]:_0x3b6f23[_0xd6c2('0x18')]+_0x3b6f23[_0xd6c2('0x1b')];var _0x774f7c;if(_0x34fd7e>=_0x17026c){_0x34fd7e=_0x17026c;_0x774f7c=0xc8;}else{_0x774f7c=0xce;}_0xc21f55[_0xd6c2('0x1c')](_0x774f7c);return _0xc21f55['set'](_0xd6c2('0x1d'),_0x58fa76+'-'+_0x34fd7e+'/'+_0x17026c)['json'](_0x323cec);}return null;};}function patchUpdates(_0x213cf2){return function(_0xc8b7e6){try{jsonpatch[_0xd6c2('0x1e')](_0xc8b7e6,_0x213cf2,!![]);}catch(_0x1a69cf){return BPromise[_0xd6c2('0x1f')](_0x1a69cf);}return _0xc8b7e6[_0xd6c2('0x20')]();};}function saveUpdates(_0x4c6af8,_0x56fc10){return function(_0x49bbb0){if(_0x49bbb0){return _0x49bbb0[_0xd6c2('0x21')](_0x4c6af8)[_0xd6c2('0x22')](function(_0x30bf64){return _0x30bf64;});}return null;};}function removeEntity(_0x2ce300,_0x5ae8de){return function(_0x513a8d){if(_0x513a8d){return _0x513a8d[_0xd6c2('0x23')]()[_0xd6c2('0x22')](function(){var _0x32127e=_0x513a8d['get']({'plain':!![]});var _0xbf58ca=_0xd6c2('0x24');return db[_0xd6c2('0x25')][_0xd6c2('0x23')]({'where':{'type':_0xbf58ca,'resourceId':_0x32127e['id']}})[_0xd6c2('0x22')](function(){return _0x513a8d;});})[_0xd6c2('0x22')](function(){_0x2ce300[_0xd6c2('0x1c')](0xcc)[_0xd6c2('0x16')]();});}};}function handleEntityNotFound(_0xaf813b,_0x383bfb){return function(_0x7b6020){if(!_0x7b6020){_0xaf813b[_0xd6c2('0x15')](0x194);}return _0x7b6020;};}function handleError(_0x429c39,_0x2bb192){_0x2bb192=_0x2bb192||0x1f4;return function(_0x54ea64){logger['error'](_0x54ea64[_0xd6c2('0x26')]);if(_0x54ea64[_0xd6c2('0x27')]){delete _0x54ea64[_0xd6c2('0x27')];}_0x429c39[_0xd6c2('0x1c')](_0x2bb192)[_0xd6c2('0x28')](_0x54ea64);};}exports[_0xd6c2('0x29')]=function(_0x2ef1d0,_0x592738){var _0x17dfad={},_0x212933={},_0x2f452b={'count':0x0,'rows':[]};var _0x595cdf=_[_0xd6c2('0x2a')](db[_0xd6c2('0x2b')][_0xd6c2('0x2c')],function(_0x41fe48){return{'name':_0x41fe48[_0xd6c2('0x2d')],'type':_0x41fe48[_0xd6c2('0x2e')][_0xd6c2('0x2f')]};});_0x212933[_0xd6c2('0x30')]=_[_0xd6c2('0x2a')](_0x595cdf,_0xd6c2('0x27'));_0x212933[_0xd6c2('0x31')]=_['keys'](_0x2ef1d0['query']);_0x212933[_0xd6c2('0x32')]=_[_0xd6c2('0x33')](_0x212933[_0xd6c2('0x30')],_0x212933['query']);_0x17dfad[_0xd6c2('0x34')]=_['intersection'](_0x212933[_0xd6c2('0x30')],qs[_0xd6c2('0x35')](_0x2ef1d0[_0xd6c2('0x31')][_0xd6c2('0x35')]));_0x17dfad[_0xd6c2('0x34')]=_0x17dfad['attributes'][_0xd6c2('0x36')]?_0x17dfad[_0xd6c2('0x34')]:_0x212933[_0xd6c2('0x30')];if(!_0x2ef1d0[_0xd6c2('0x31')][_0xd6c2('0x37')]('nolimit')){_0x17dfad[_0xd6c2('0x1b')]=qs[_0xd6c2('0x1b')](_0x2ef1d0[_0xd6c2('0x31')][_0xd6c2('0x1b')]);_0x17dfad['offset']=qs[_0xd6c2('0x18')](_0x2ef1d0[_0xd6c2('0x31')][_0xd6c2('0x18')]);}_0x17dfad[_0xd6c2('0x38')]=qs[_0xd6c2('0x39')](_0x2ef1d0[_0xd6c2('0x31')][_0xd6c2('0x39')]);_0x17dfad[_0xd6c2('0x3a')]=qs[_0xd6c2('0x32')](_[_0xd6c2('0x3b')](_0x2ef1d0[_0xd6c2('0x31')],_0x212933[_0xd6c2('0x32')]),_0x595cdf);if(_0x2ef1d0[_0xd6c2('0x31')]['filter']){_0x17dfad['where']=_[_0xd6c2('0x3c')](_0x17dfad[_0xd6c2('0x3a')],{'$or':_[_0xd6c2('0x2a')](_0x595cdf,function(_0x9e755c){if(_0x9e755c['type']!=='VIRTUAL'){var _0xae00ea={};_0xae00ea[_0x9e755c[_0xd6c2('0x27')]]={'$like':'%'+_0x2ef1d0[_0xd6c2('0x31')][_0xd6c2('0x3d')]+'%'};return _0xae00ea;}})});}_0x17dfad=_[_0xd6c2('0x3c')]({},_0x17dfad,_0x2ef1d0[_0xd6c2('0x3e')]);var _0x46e7c4={'where':_0x17dfad[_0xd6c2('0x3a')]};return db[_0xd6c2('0x2b')]['count'](_0x46e7c4)[_0xd6c2('0x22')](function(_0x8fdd4c){_0x2f452b[_0xd6c2('0x1a')]=_0x8fdd4c;if(_0x2ef1d0[_0xd6c2('0x31')]['includeAll']){_0x17dfad[_0xd6c2('0x3f')]=[{'all':!![]}];}return db[_0xd6c2('0x2b')][_0xd6c2('0x40')](_0x17dfad);})[_0xd6c2('0x22')](function(_0x315932){_0x2f452b[_0xd6c2('0x41')]=_0x315932;return _0x2f452b;})['then'](respondWithFilteredResult(_0x592738,_0x17dfad))['catch'](handleError(_0x592738,null));};exports['show']=function(_0x552f13,_0x16ee7d){var _0x20899c={'raw':![],'where':{'id':_0x552f13[_0xd6c2('0x42')]['id']}},_0xbf5f25={};_0xbf5f25[_0xd6c2('0x30')]=_[_0xd6c2('0x43')](db[_0xd6c2('0x2b')]['rawAttributes']);_0xbf5f25[_0xd6c2('0x31')]=_[_0xd6c2('0x43')](_0x552f13[_0xd6c2('0x31')]);_0xbf5f25['filters']=_['intersection'](_0xbf5f25[_0xd6c2('0x30')],_0xbf5f25[_0xd6c2('0x31')]);_0x20899c[_0xd6c2('0x34')]=_['intersection'](_0xbf5f25[_0xd6c2('0x30')],qs['fields'](_0x552f13['query'][_0xd6c2('0x35')]));_0x20899c[_0xd6c2('0x34')]=_0x20899c['attributes'][_0xd6c2('0x36')]?_0x20899c[_0xd6c2('0x34')]:_0xbf5f25[_0xd6c2('0x30')];if(_0x552f13[_0xd6c2('0x31')][_0xd6c2('0x44')]){_0x20899c[_0xd6c2('0x3f')]=[{'all':!![]}];}_0x20899c=_['merge']({},_0x20899c,_0x552f13[_0xd6c2('0x3e')]);return db['Campaign']['find'](_0x20899c)[_0xd6c2('0x22')](handleEntityNotFound(_0x16ee7d,null))['then'](respondWithResult(_0x16ee7d,null))[_0xd6c2('0x45')](handleError(_0x16ee7d,null));};exports[_0xd6c2('0x46')]=function(_0x18a574,_0x3b6cd7){return db[_0xd6c2('0x2b')][_0xd6c2('0x46')](_0x18a574['body'],{})['then'](function(_0x554672){var _0x41ab42=_0x18a574[_0xd6c2('0x47')][_0xd6c2('0x48')]({'plain':!![]});if(!_0x41ab42)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x41ab42[_0xd6c2('0x49')]===_0xd6c2('0x47')){var _0x1b6f18=_0x554672[_0xd6c2('0x48')]({'plain':!![]});var _0x31eb49=_0xd6c2('0x24');return db[_0xd6c2('0x4a')][_0xd6c2('0x4b')]({'where':{'name':_0x31eb49,'userProfileId':_0x41ab42[_0xd6c2('0x4c')]},'raw':!![]})[_0xd6c2('0x22')](function(_0x20e9d5){if(_0x20e9d5&&_0x20e9d5[_0xd6c2('0x4d')]===0x0){return db[_0xd6c2('0x25')]['create']({'name':_0x1b6f18['name'],'resourceId':_0x1b6f18['id'],'type':_0x20e9d5[_0xd6c2('0x27')],'sectionId':_0x20e9d5['id']},{})[_0xd6c2('0x22')](function(){return _0x554672;});}else{return _0x554672;}})[_0xd6c2('0x45')](function(_0x2d1c9d){logger['error'](_0xd6c2('0x4e'),_0x2d1c9d);throw _0x2d1c9d;});}return _0x554672;})['then'](respondWithResult(_0x3b6cd7,0xc9))[_0xd6c2('0x45')](handleError(_0x3b6cd7,null));};exports['clone']=function(_0xe244a9,_0xbf9e3e){var _0x3c8417={'where':{'id':_0xe244a9['params']['id']}},_0x4f6cea={};_0x4f6cea[_0xd6c2('0x30')]=_[_0xd6c2('0x43')](db[_0xd6c2('0x2b')][_0xd6c2('0x2c')]);_0x3c8417[_0xd6c2('0x34')]=_[_0xd6c2('0x33')](_0x4f6cea[_0xd6c2('0x30')],qs[_0xd6c2('0x35')](_0xe244a9[_0xd6c2('0x31')]['fields']));_0x3c8417[_0xd6c2('0x34')]=_0x3c8417[_0xd6c2('0x34')][_0xd6c2('0x36')]?_0x3c8417[_0xd6c2('0x34')]:_0x4f6cea[_0xd6c2('0x30')];if(_0xe244a9[_0xd6c2('0x31')]['includeAll']){_0x3c8417[_0xd6c2('0x3f')]=[{'all':!![]}];}_0x3c8417=_[_0xd6c2('0x3c')]({},_0x3c8417,_0xe244a9[_0xd6c2('0x3e')]);return db[_0xd6c2('0x2b')][_0xd6c2('0x4b')](_0x3c8417)['then'](handleEntityNotFound(_0xbf9e3e,null))[_0xd6c2('0x22')](function(_0x204c90){if(_0x204c90){var _0x3724de=_0x204c90[_0xd6c2('0x48')]({'plain':!![]});_0x3724de=qs[_0xd6c2('0x4f')](_0x3724de,['id',_0xd6c2('0x50'),_0xd6c2('0x51')]);_0xe244a9[_0xd6c2('0x52')]=_['omit'](_0xe244a9['body'],['id',_0xd6c2('0x50'),_0xd6c2('0x51')]);return db['Campaign']['create'](_['merge'](_0x3724de,_0xe244a9[_0xd6c2('0x52')]),{'include':_0xe244a9[_0xd6c2('0x31')][_0xd6c2('0x44')]?[{'all':!![]}]:undefined})[_0xd6c2('0x22')](function(_0x169ecf){var _0x2639ff=_0xe244a9[_0xd6c2('0x47')][_0xd6c2('0x48')]({'plain':!![]});if(!_0x2639ff)throw new Error(_0xd6c2('0x53'));if(_0x2639ff[_0xd6c2('0x49')]===_0xd6c2('0x47')){var _0xfd0874=_0x169ecf[_0xd6c2('0x48')]({'plain':!![]});var _0x4db495=_0xd6c2('0x24');return db[_0xd6c2('0x4a')]['find']({'where':{'name':_0x4db495,'userProfileId':_0x2639ff['userProfileId']},'raw':!![]})['then'](function(_0x36742f){if(_0x36742f&&_0x36742f['autoAssociation']===0x0){return db[_0xd6c2('0x25')][_0xd6c2('0x46')]({'name':_0xfd0874['name'],'resourceId':_0xfd0874['id'],'type':_0x36742f[_0xd6c2('0x27')],'sectionId':_0x36742f['id']},{})[_0xd6c2('0x22')](function(){return _0x169ecf;});}else{return _0x169ecf;}})['catch'](function(_0x466f35){logger[_0xd6c2('0x54')](_0xd6c2('0x4e'),_0x466f35);throw _0x466f35;});}return _0x169ecf;});}})[_0xd6c2('0x22')](respondWithResult(_0xbf9e3e,0xc9))[_0xd6c2('0x45')](handleError(_0xbf9e3e,null));};exports[_0xd6c2('0x21')]=function(_0x858bbd,_0x9ae1da){if(_0x858bbd[_0xd6c2('0x52')]['id']){delete _0x858bbd[_0xd6c2('0x52')]['id'];}return db['Campaign'][_0xd6c2('0x4b')]({'where':{'id':_0x858bbd[_0xd6c2('0x42')]['id']}})[_0xd6c2('0x22')](handleEntityNotFound(_0x9ae1da,null))[_0xd6c2('0x22')](saveUpdates(_0x858bbd['body'],null))[_0xd6c2('0x22')](respondWithResult(_0x9ae1da,null))[_0xd6c2('0x45')](handleError(_0x9ae1da,null));};exports[_0xd6c2('0x23')]=function(_0x3af333,_0x24cf4c){return db[_0xd6c2('0x2b')]['find']({'where':{'id':_0x3af333[_0xd6c2('0x42')]['id']}})[_0xd6c2('0x22')](handleEntityNotFound(_0x24cf4c,null))[_0xd6c2('0x22')](removeEntity(_0x24cf4c,null))[_0xd6c2('0x45')](handleError(_0x24cf4c,null));};exports[_0xd6c2('0x55')]=function(_0x280516,_0x123760,_0x483c4e){var _0x49f9b7={'raw':!![],'where':{}};var _0x3ca1c0={};var _0x5d4018={'count':0x0,'rows':[]};return db[_0xd6c2('0x2b')]['findOne']({'where':{'id':_0x280516['params']['id']}})[_0xd6c2('0x22')](handleEntityNotFound(_0x123760,null))[_0xd6c2('0x22')](function(_0x1cde7){if(_0x1cde7){_0x3ca1c0['model']=_[_0xd6c2('0x43')](db[_0xd6c2('0x56')][_0xd6c2('0x2c')]);_0x3ca1c0[_0xd6c2('0x31')]=_[_0xd6c2('0x43')](_0x280516[_0xd6c2('0x31')]);_0x3ca1c0[_0xd6c2('0x32')]=_[_0xd6c2('0x33')](_0x3ca1c0[_0xd6c2('0x30')],_0x3ca1c0[_0xd6c2('0x31')]);_0x49f9b7[_0xd6c2('0x34')]=_[_0xd6c2('0x33')](_0x3ca1c0[_0xd6c2('0x30')],qs[_0xd6c2('0x35')](_0x280516[_0xd6c2('0x31')]['fields']));_0x49f9b7[_0xd6c2('0x34')]=_0x49f9b7[_0xd6c2('0x34')][_0xd6c2('0x36')]?_0x49f9b7[_0xd6c2('0x34')]:_0x3ca1c0[_0xd6c2('0x30')];if(!_0x280516[_0xd6c2('0x31')][_0xd6c2('0x37')](_0xd6c2('0x57'))){_0x49f9b7[_0xd6c2('0x1b')]=qs[_0xd6c2('0x1b')](_0x280516[_0xd6c2('0x31')][_0xd6c2('0x1b')]);_0x49f9b7['offset']=qs['offset'](_0x280516['query'][_0xd6c2('0x18')]);}_0x49f9b7[_0xd6c2('0x38')]=qs[_0xd6c2('0x39')](_0x280516[_0xd6c2('0x31')]['sort']);_0x49f9b7[_0xd6c2('0x3a')]=qs[_0xd6c2('0x32')](_[_0xd6c2('0x3b')](_0x280516['query'],_0x3ca1c0[_0xd6c2('0x32')]));_0x49f9b7[_0xd6c2('0x3a')]['CampaignId']=_0x1cde7['id'];if(_0x280516[_0xd6c2('0x31')][_0xd6c2('0x3d')]){_0x49f9b7[_0xd6c2('0x3a')]=_[_0xd6c2('0x3c')](_0x49f9b7[_0xd6c2('0x3a')],{'$or':_[_0xd6c2('0x2a')](_0x49f9b7['attributes'],function(_0x5b857d){var _0x19e6f5={};_0x19e6f5[_0x5b857d]={'$like':'%'+_0x280516[_0xd6c2('0x31')]['filter']+'%'};return _0x19e6f5;})});}_0x49f9b7=_[_0xd6c2('0x3c')]({},_0x49f9b7,_0x280516['options']);return db[_0xd6c2('0x56')][_0xd6c2('0x1a')]({'where':_0x49f9b7['where']})[_0xd6c2('0x22')](function(_0xedc7b5){_0x5d4018[_0xd6c2('0x1a')]=_0xedc7b5;if(_0x280516[_0xd6c2('0x31')][_0xd6c2('0x44')]){_0x49f9b7[_0xd6c2('0x3f')]=[{'all':!![]}];}return db[_0xd6c2('0x56')][_0xd6c2('0x40')](_0x49f9b7);})[_0xd6c2('0x22')](function(_0x267647){_0x5d4018[_0xd6c2('0x41')]=_0x267647;return _0x5d4018;});}})[_0xd6c2('0x22')](respondWithFilteredResult(_0x123760,_0x49f9b7))[_0xd6c2('0x45')](handleError(_0x123760,null));};exports['getHopperHistories']=function(_0x11079e,_0x4cd0ed,_0x38848c){var _0x14e38f={'raw':!![],'where':{}};var _0x3e5bf1={};var _0x15fa77={'count':0x0,'rows':[]};return db['Campaign'][_0xd6c2('0x58')]({'where':{'id':_0x11079e['params']['id']}})['then'](handleEntityNotFound(_0x4cd0ed,null))[_0xd6c2('0x22')](function(_0x15522c){if(_0x15522c){_0x3e5bf1[_0xd6c2('0x30')]=_['keys'](db[_0xd6c2('0x59')][_0xd6c2('0x2c')]);_0x3e5bf1[_0xd6c2('0x31')]=_[_0xd6c2('0x43')](_0x11079e[_0xd6c2('0x31')]);_0x3e5bf1[_0xd6c2('0x32')]=_[_0xd6c2('0x33')](_0x3e5bf1[_0xd6c2('0x30')],_0x3e5bf1[_0xd6c2('0x31')]);_0x14e38f[_0xd6c2('0x34')]=_['intersection'](_0x3e5bf1[_0xd6c2('0x30')],qs[_0xd6c2('0x35')](_0x11079e[_0xd6c2('0x31')][_0xd6c2('0x35')]));_0x14e38f[_0xd6c2('0x34')]=_0x14e38f['attributes'][_0xd6c2('0x36')]?_0x14e38f[_0xd6c2('0x34')]:_0x3e5bf1[_0xd6c2('0x30')];if(!_0x11079e[_0xd6c2('0x31')][_0xd6c2('0x37')]('nolimit')){_0x14e38f['limit']=qs[_0xd6c2('0x1b')](_0x11079e[_0xd6c2('0x31')][_0xd6c2('0x1b')]);_0x14e38f[_0xd6c2('0x18')]=qs['offset'](_0x11079e[_0xd6c2('0x31')][_0xd6c2('0x18')]);}_0x14e38f[_0xd6c2('0x38')]=qs['sort'](_0x11079e[_0xd6c2('0x31')][_0xd6c2('0x39')]);_0x14e38f['where']=qs['filters'](_[_0xd6c2('0x3b')](_0x11079e[_0xd6c2('0x31')],_0x3e5bf1[_0xd6c2('0x32')]));_0x14e38f[_0xd6c2('0x3a')]['CampaignId']=_0x15522c['id'];if(_0x11079e[_0xd6c2('0x31')]['filter']){_0x14e38f['where']=_[_0xd6c2('0x3c')](_0x14e38f[_0xd6c2('0x3a')],{'$or':_['map'](_0x14e38f['attributes'],function(_0x3447c4){var _0x5534df={};_0x5534df[_0x3447c4]={'$like':'%'+_0x11079e['query'][_0xd6c2('0x3d')]+'%'};return _0x5534df;})});}_0x14e38f=_[_0xd6c2('0x3c')]({},_0x14e38f,_0x11079e[_0xd6c2('0x3e')]);return db[_0xd6c2('0x59')]['count']({'where':_0x14e38f[_0xd6c2('0x3a')]})[_0xd6c2('0x22')](function(_0x3fb10){_0x15fa77[_0xd6c2('0x1a')]=_0x3fb10;if(_0x11079e[_0xd6c2('0x31')][_0xd6c2('0x44')]){_0x14e38f[_0xd6c2('0x3f')]=[{'all':!![]}];}return db[_0xd6c2('0x59')][_0xd6c2('0x40')](_0x14e38f);})[_0xd6c2('0x22')](function(_0xb148b1){_0x15fa77['rows']=_0xb148b1;return _0x15fa77;});}})[_0xd6c2('0x22')](respondWithFilteredResult(_0x4cd0ed,_0x14e38f))[_0xd6c2('0x45')](handleError(_0x4cd0ed,null));};exports[_0xd6c2('0x5a')]=function(_0x38a094,_0x28f7f7,_0x1a1582){var _0x29b239={'raw':!![],'where':{}};var _0x2bad89={};var _0x48585a={'count':0x0,'rows':[]};return db['Campaign'][_0xd6c2('0x58')]({'where':{'id':_0x38a094['params']['id']}})[_0xd6c2('0x22')](handleEntityNotFound(_0x28f7f7,null))[_0xd6c2('0x22')](function(_0x2a358c){if(_0x2a358c){_0x2bad89[_0xd6c2('0x30')]=_[_0xd6c2('0x43')](db['CmHopperFinal'][_0xd6c2('0x2c')]);_0x2bad89['query']=_[_0xd6c2('0x43')](_0x38a094[_0xd6c2('0x31')]);_0x2bad89[_0xd6c2('0x32')]=_[_0xd6c2('0x33')](_0x2bad89[_0xd6c2('0x30')],_0x2bad89[_0xd6c2('0x31')]);_0x29b239[_0xd6c2('0x34')]=_[_0xd6c2('0x33')](_0x2bad89[_0xd6c2('0x30')],qs[_0xd6c2('0x35')](_0x38a094[_0xd6c2('0x31')][_0xd6c2('0x35')]));_0x29b239[_0xd6c2('0x34')]=_0x29b239[_0xd6c2('0x34')][_0xd6c2('0x36')]?_0x29b239['attributes']:_0x2bad89['model'];if(!_0x38a094[_0xd6c2('0x31')]['hasOwnProperty'](_0xd6c2('0x57'))){_0x29b239['limit']=qs[_0xd6c2('0x1b')](_0x38a094[_0xd6c2('0x31')][_0xd6c2('0x1b')]);_0x29b239[_0xd6c2('0x18')]=qs[_0xd6c2('0x18')](_0x38a094['query'][_0xd6c2('0x18')]);}_0x29b239[_0xd6c2('0x38')]=qs['sort'](_0x38a094[_0xd6c2('0x31')][_0xd6c2('0x39')]);_0x29b239[_0xd6c2('0x3a')]=qs[_0xd6c2('0x32')](_[_0xd6c2('0x3b')](_0x38a094[_0xd6c2('0x31')],_0x2bad89['filters']));_0x29b239[_0xd6c2('0x3a')]['CampaignId']=_0x2a358c['id'];if(_0x38a094[_0xd6c2('0x31')]['filter']){_0x29b239[_0xd6c2('0x3a')]=_[_0xd6c2('0x3c')](_0x29b239['where'],{'$or':_['map'](_0x29b239[_0xd6c2('0x34')],function(_0x382d11){var _0x4360d0={};_0x4360d0[_0x382d11]={'$like':'%'+_0x38a094[_0xd6c2('0x31')]['filter']+'%'};return _0x4360d0;})});}_0x29b239=_[_0xd6c2('0x3c')]({},_0x29b239,_0x38a094['options']);return db[_0xd6c2('0x5b')]['count']({'where':_0x29b239[_0xd6c2('0x3a')]})[_0xd6c2('0x22')](function(_0x5d025f){_0x48585a['count']=_0x5d025f;if(_0x38a094[_0xd6c2('0x31')]['includeAll']){_0x29b239[_0xd6c2('0x3f')]=[{'all':!![]}];}return db[_0xd6c2('0x5b')][_0xd6c2('0x40')](_0x29b239);})[_0xd6c2('0x22')](function(_0x57f56c){_0x48585a['rows']=_0x57f56c;return _0x48585a;});}})[_0xd6c2('0x22')](respondWithFilteredResult(_0x28f7f7,_0x29b239))['catch'](handleError(_0x28f7f7,null));};exports[_0xd6c2('0x5c')]=function(_0xab817e,_0x2e57fc,_0x3112b2){var _0x35a4d7={'raw':!![],'where':{}};var _0x52fdfc={};var _0x6e1b85={'count':0x0,'rows':[]};return db[_0xd6c2('0x2b')][_0xd6c2('0x58')]({'where':{'id':_0xab817e['params']['id']}})['then'](handleEntityNotFound(_0x2e57fc,null))[_0xd6c2('0x22')](function(_0xf5dbb){if(_0xf5dbb){_0x52fdfc[_0xd6c2('0x30')]=_[_0xd6c2('0x43')](db[_0xd6c2('0x5d')][_0xd6c2('0x2c')]);_0x52fdfc[_0xd6c2('0x31')]=_['keys'](_0xab817e[_0xd6c2('0x31')]);_0x52fdfc[_0xd6c2('0x32')]=_[_0xd6c2('0x33')](_0x52fdfc['model'],_0x52fdfc[_0xd6c2('0x31')]);_0x35a4d7[_0xd6c2('0x34')]=_['intersection'](_0x52fdfc['model'],qs[_0xd6c2('0x35')](_0xab817e[_0xd6c2('0x31')]['fields']));_0x35a4d7[_0xd6c2('0x34')]=_0x35a4d7[_0xd6c2('0x34')][_0xd6c2('0x36')]?_0x35a4d7['attributes']:_0x52fdfc[_0xd6c2('0x30')];if(!_0xab817e['query'][_0xd6c2('0x37')](_0xd6c2('0x57'))){_0x35a4d7[_0xd6c2('0x1b')]=qs['limit'](_0xab817e[_0xd6c2('0x31')][_0xd6c2('0x1b')]);_0x35a4d7[_0xd6c2('0x18')]=qs[_0xd6c2('0x18')](_0xab817e['query'][_0xd6c2('0x18')]);}_0x35a4d7['order']=qs[_0xd6c2('0x39')](_0xab817e['query'][_0xd6c2('0x39')]);_0x35a4d7['where']=qs[_0xd6c2('0x32')](_[_0xd6c2('0x3b')](_0xab817e['query'],_0x52fdfc[_0xd6c2('0x32')]));_0x35a4d7['where'][_0xd6c2('0x5e')]=_0xf5dbb['id'];if(_0xab817e[_0xd6c2('0x31')][_0xd6c2('0x3d')]){_0x35a4d7['where']=_[_0xd6c2('0x3c')](_0x35a4d7[_0xd6c2('0x3a')],{'$or':_['map'](_0x35a4d7[_0xd6c2('0x34')],function(_0xf2797b){var _0x3e823c={};_0x3e823c[_0xf2797b]={'$like':'%'+_0xab817e[_0xd6c2('0x31')]['filter']+'%'};return _0x3e823c;})});}_0x35a4d7=_['merge']({},_0x35a4d7,_0xab817e['options']);return db[_0xd6c2('0x5d')][_0xd6c2('0x1a')]({'where':_0x35a4d7[_0xd6c2('0x3a')]})['then'](function(_0x8772fc){_0x6e1b85['count']=_0x8772fc;if(_0xab817e[_0xd6c2('0x31')][_0xd6c2('0x44')]){_0x35a4d7[_0xd6c2('0x3f')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xd6c2('0x40')](_0x35a4d7);})[_0xd6c2('0x22')](function(_0x5bf8a1){_0x6e1b85['rows']=_0x5bf8a1;return _0x6e1b85;});}})[_0xd6c2('0x22')](respondWithFilteredResult(_0x2e57fc,_0x35a4d7))[_0xd6c2('0x45')](handleError(_0x2e57fc,null));};exports[_0xd6c2('0x5f')]=function(_0x57679d,_0x60a4aa,_0x5dd5e1){var _0x4fb2e6={};var _0x324015={};var _0x1ef19a;var _0x29f81f;return db['Campaign'][_0xd6c2('0x58')]({'where':{'id':_0x57679d['params']['id']}})[_0xd6c2('0x22')](handleEntityNotFound(_0x60a4aa,null))[_0xd6c2('0x22')](function(_0x54ba2b){if(_0x54ba2b){_0x1ef19a=_0x54ba2b;_0x324015[_0xd6c2('0x30')]=_[_0xd6c2('0x43')](db[_0xd6c2('0x60')][_0xd6c2('0x2c')]);_0x324015['query']=_[_0xd6c2('0x43')](_0x57679d[_0xd6c2('0x31')]);_0x324015[_0xd6c2('0x32')]=_['intersection'](_0x324015[_0xd6c2('0x30')],_0x324015['query']);_0x4fb2e6[_0xd6c2('0x34')]=_[_0xd6c2('0x33')](_0x324015[_0xd6c2('0x30')],qs[_0xd6c2('0x35')](_0x57679d[_0xd6c2('0x31')][_0xd6c2('0x35')]));_0x4fb2e6[_0xd6c2('0x34')]=_0x4fb2e6[_0xd6c2('0x34')][_0xd6c2('0x36')]?_0x4fb2e6[_0xd6c2('0x34')]:_0x324015[_0xd6c2('0x30')];_0x4fb2e6[_0xd6c2('0x38')]=qs[_0xd6c2('0x39')](_0x57679d[_0xd6c2('0x31')]['sort']);_0x4fb2e6['where']=qs['filters'](_[_0xd6c2('0x3b')](_0x57679d['query'],_0x324015[_0xd6c2('0x32')]));if(_0x57679d[_0xd6c2('0x31')][_0xd6c2('0x3d')]){_0x4fb2e6['where']=_['merge'](_0x4fb2e6['where'],{'$or':_['map'](_0x4fb2e6[_0xd6c2('0x34')],function(_0x274e10){var _0xde458f={};_0xde458f[_0x274e10]={'$like':'%'+_0x57679d['query'][_0xd6c2('0x3d')]+'%'};return _0xde458f;})});}_0x4fb2e6=_[_0xd6c2('0x3c')]({},_0x4fb2e6,_0x57679d[_0xd6c2('0x3e')]);return _0x1ef19a[_0xd6c2('0x5f')](_0x4fb2e6);}})['then'](function(_0x5a9f54){if(_0x5a9f54){_0x29f81f=_0x5a9f54[_0xd6c2('0x36')];if(!_0x57679d[_0xd6c2('0x31')][_0xd6c2('0x37')]('nolimit')){_0x4fb2e6[_0xd6c2('0x1b')]=qs[_0xd6c2('0x1b')](_0x57679d['query'][_0xd6c2('0x1b')]);_0x4fb2e6['offset']=qs[_0xd6c2('0x18')](_0x57679d[_0xd6c2('0x31')][_0xd6c2('0x18')]);}return _0x1ef19a[_0xd6c2('0x5f')](_0x4fb2e6);}})[_0xd6c2('0x22')](function(_0x1ed127){if(_0x1ed127){return _0x1ed127?{'count':_0x29f81f,'rows':_0x1ed127}:null;}})[_0xd6c2('0x22')](respondWithResult(_0x60a4aa,null))['catch'](handleError(_0x60a4aa,null));};exports[_0xd6c2('0x61')]=function(_0x3a283e,_0x1bae9d,_0x467307){var _0x54a333,_0x52dae8;return db['Campaign'][_0xd6c2('0x4b')]({'where':{'id':_0x3a283e[_0xd6c2('0x42')]['id']}})[_0xd6c2('0x22')](handleEntityNotFound(_0x1bae9d,null))[_0xd6c2('0x22')](function(_0x2c9f7f){if(_0x2c9f7f){_0x52dae8=_0x2c9f7f;return _0x2c9f7f[_0xd6c2('0x61')](_0x3a283e[_0xd6c2('0x52')]['ids'],_[_0xd6c2('0x4f')](_0x3a283e[_0xd6c2('0x52')],[_0xd6c2('0x62'),'id'])||{});}return null;})[_0xd6c2('0x63')](function(_0x3547f6){var _0x17a0f3;_0x54a333=_0x3547f6||[];var _0x254c03=[];if(_0x3547f6){for(var _0x5edb41=0x0;_0x5edb41<_0x3547f6[_0xd6c2('0x36')];_0x5edb41+=0x1){var _0x28542d=_0x3547f6[_0x5edb41]['get']({'plain':!![]});_0x52dae8['dialCheckDuplicateType']=_0x3a283e[_0xd6c2('0x52')][_0xd6c2('0x64')]?_0x3a283e[_0xd6c2('0x52')]['dialCheckDuplicateType']:_0x52dae8[_0xd6c2('0x64')];switch(_0x52dae8[_0xd6c2('0x64')]){case _0xd6c2('0x65'):_0x17a0f3=squel[_0xd6c2('0x66')]()[_0xd6c2('0x67')](_0xd6c2('0x68'))[_0xd6c2('0x69')]([_0xd6c2('0x6a'),_0xd6c2('0x6b'),'ContactId','ListId',_0xd6c2('0x5e'),_0xd6c2('0x50'),_0xd6c2('0x51')],squel['select']()[_0xd6c2('0x6c')](_0xd6c2('0x6a'),_0xd6c2('0x6a'))['field'](_0xd6c2('0x6d'),_0xd6c2('0x6b'))[_0xd6c2('0x6c')]('id',_0xd6c2('0x6e'))['field'](_0x28542d['CmListId'][_0xd6c2('0x6f')](),_0xd6c2('0x70'))[_0xd6c2('0x6c')](_0x3a283e[_0xd6c2('0x42')]['id'][_0xd6c2('0x6f')](),_0xd6c2('0x5e'))['field'](_0xd6c2('0x6d'),_0xd6c2('0x50'))['field']('NOW()',_0xd6c2('0x51'))[_0xd6c2('0x71')]('cm_contacts')[_0xd6c2('0x3a')](_0xd6c2('0x72'))[_0xd6c2('0x3a')](_0xd6c2('0x73'),_0x28542d['CmListId'][_0xd6c2('0x6f')]())[_0xd6c2('0x3a')](_0xd6c2('0x74'))[_0xd6c2('0x3a')](_0xd6c2('0x75'),squel[_0xd6c2('0x76')]()[_0xd6c2('0x6c')](_0xd6c2('0x77'))['from'](_0xd6c2('0x78'))['where'](_0xd6c2('0x79'),_0x3a283e[_0xd6c2('0x42')]['id'][_0xd6c2('0x6f')]()))[_0xd6c2('0x3a')](_0xd6c2('0x75'),squel[_0xd6c2('0x76')]()['field'](_0xd6c2('0x7a'))[_0xd6c2('0x71')]('cm_hopper')[_0xd6c2('0x3a')]('CampaignId\x20=\x20?',_0x3a283e[_0xd6c2('0x42')]['id'][_0xd6c2('0x6f')]())))[_0xd6c2('0x6f')]();break;case _0xd6c2('0x7b'):_0x17a0f3=squel['insert']()[_0xd6c2('0x67')](_0xd6c2('0x68'))['fromQuery']([_0xd6c2('0x6a'),_0xd6c2('0x6b'),'ContactId',_0xd6c2('0x70'),_0xd6c2('0x5e'),_0xd6c2('0x50'),_0xd6c2('0x51')],squel['select']()[_0xd6c2('0x6c')](_0xd6c2('0x6a'),_0xd6c2('0x6a'))[_0xd6c2('0x6c')]('NOW()',_0xd6c2('0x6b'))[_0xd6c2('0x6c')]('id','ContactId')[_0xd6c2('0x6c')](_0x28542d[_0xd6c2('0x7c')][_0xd6c2('0x6f')](),_0xd6c2('0x70'))[_0xd6c2('0x6c')](_0x3a283e['params']['id'][_0xd6c2('0x6f')](),_0xd6c2('0x5e'))[_0xd6c2('0x6c')](_0xd6c2('0x6d'),_0xd6c2('0x50'))[_0xd6c2('0x6c')](_0xd6c2('0x6d'),_0xd6c2('0x51'))[_0xd6c2('0x71')]('cm_contacts')[_0xd6c2('0x3a')](_0xd6c2('0x72'))[_0xd6c2('0x3a')](_0xd6c2('0x73'),_0x28542d['CmListId'][_0xd6c2('0x6f')]())[_0xd6c2('0x3a')](_0xd6c2('0x74'))[_0xd6c2('0x3a')](_0xd6c2('0x75'),squel[_0xd6c2('0x76')]()['field'](_0xd6c2('0x7a'))[_0xd6c2('0x71')](_0xd6c2('0x68'))['where'](_0xd6c2('0x79'),_0x3a283e['params']['id'][_0xd6c2('0x6f')]())))[_0xd6c2('0x6f')]();break;default:_0x17a0f3=squel[_0xd6c2('0x66')]()[_0xd6c2('0x67')](_0xd6c2('0x68'))['fromQuery'](['phone',_0xd6c2('0x6b'),_0xd6c2('0x6e'),'ListId',_0xd6c2('0x5e'),_0xd6c2('0x50'),_0xd6c2('0x51')],squel[_0xd6c2('0x76')]()['field'](_0xd6c2('0x6a'),_0xd6c2('0x6a'))[_0xd6c2('0x6c')](_0xd6c2('0x6d'),_0xd6c2('0x6b'))[_0xd6c2('0x6c')]('id','ContactId')[_0xd6c2('0x6c')](_0x28542d['CmListId']['toString'](),'ListId')[_0xd6c2('0x6c')](_0x3a283e[_0xd6c2('0x42')]['id'][_0xd6c2('0x6f')](),_0xd6c2('0x5e'))['field']('NOW()',_0xd6c2('0x50'))['field']('NOW()',_0xd6c2('0x51'))[_0xd6c2('0x71')](_0xd6c2('0x7d'))['where']('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x28542d[_0xd6c2('0x7c')][_0xd6c2('0x6f')]())['where'](_0xd6c2('0x74')))['toString']();}_0x254c03['push'](db['sequelize'][_0xd6c2('0x31')](_0x17a0f3));}return BPromise[_0xd6c2('0x7e')](_0x254c03);}})[_0xd6c2('0x22')](function(){return _0x54a333;})['then'](respondWithResult(_0x1bae9d,null))[_0xd6c2('0x45')](handleError(_0x1bae9d,null));};exports['removeLists']=function(_0x2c7dbf,_0x1773a0,_0x1f6353){return db[_0xd6c2('0x2b')][_0xd6c2('0x4b')]({'where':{'id':_0x2c7dbf[_0xd6c2('0x42')]['id']}})[_0xd6c2('0x22')](handleEntityNotFound(_0x1773a0,null))[_0xd6c2('0x22')](function(_0x38dab4){if(_0x38dab4){return _0x38dab4[_0xd6c2('0x7f')](_0x2c7dbf['query'][_0xd6c2('0x62')]);}})[_0xd6c2('0x22')](function(_0x1c54a2){if(_0x1c54a2){return db['CmHopper'][_0xd6c2('0x23')]({'where':{'ListId':_0x2c7dbf[_0xd6c2('0x31')][_0xd6c2('0x62')],'CampaignId':_0x2c7dbf['params']['id']}})[_0xd6c2('0x22')](function(){return _0x1c54a2;});}})[_0xd6c2('0x22')](respondWithStatusCode(_0x1773a0,null))[_0xd6c2('0x45')](handleError(_0x1773a0,null));};exports[_0xd6c2('0x80')]=function(_0x1e6fb3,_0x74c7fa,_0x372329){var _0xdfad1a={};var _0xe5a378={};var _0x358126;var _0x4071e2;return db[_0xd6c2('0x2b')][_0xd6c2('0x58')]({'where':{'id':_0x1e6fb3['params']['id']}})['then'](handleEntityNotFound(_0x74c7fa,null))[_0xd6c2('0x22')](function(_0x468e32){if(_0x468e32){_0x358126=_0x468e32;_0xe5a378[_0xd6c2('0x30')]=_[_0xd6c2('0x43')](db[_0xd6c2('0x60')]['rawAttributes']);_0xe5a378['query']=_['keys'](_0x1e6fb3['query']);_0xe5a378[_0xd6c2('0x32')]=_[_0xd6c2('0x33')](_0xe5a378[_0xd6c2('0x30')],_0xe5a378[_0xd6c2('0x31')]);_0xdfad1a[_0xd6c2('0x34')]=_[_0xd6c2('0x33')](_0xe5a378['model'],qs[_0xd6c2('0x35')](_0x1e6fb3[_0xd6c2('0x31')][_0xd6c2('0x35')]));_0xdfad1a[_0xd6c2('0x34')]=_0xdfad1a[_0xd6c2('0x34')][_0xd6c2('0x36')]?_0xdfad1a[_0xd6c2('0x34')]:_0xe5a378[_0xd6c2('0x30')];_0xdfad1a[_0xd6c2('0x38')]=qs[_0xd6c2('0x39')](_0x1e6fb3[_0xd6c2('0x31')][_0xd6c2('0x39')]);_0xdfad1a['where']=qs[_0xd6c2('0x32')](_[_0xd6c2('0x3b')](_0x1e6fb3[_0xd6c2('0x31')],_0xe5a378[_0xd6c2('0x32')]));if(_0x1e6fb3[_0xd6c2('0x31')][_0xd6c2('0x3d')]){_0xdfad1a[_0xd6c2('0x3a')]=_['merge'](_0xdfad1a[_0xd6c2('0x3a')],{'$or':_['map'](_0xdfad1a['attributes'],function(_0x43f014){var _0x161bbc={};_0x161bbc[_0x43f014]={'$like':'%'+_0x1e6fb3[_0xd6c2('0x31')][_0xd6c2('0x3d')]+'%'};return _0x161bbc;})});}_0xdfad1a=_[_0xd6c2('0x3c')]({},_0xdfad1a,_0x1e6fb3['options']);return _0x358126['getBlackLists'](_0xdfad1a);}})[_0xd6c2('0x22')](function(_0x559593){if(_0x559593){_0x4071e2=_0x559593[_0xd6c2('0x36')];if(!_0x1e6fb3[_0xd6c2('0x31')][_0xd6c2('0x37')](_0xd6c2('0x57'))){_0xdfad1a['limit']=qs['limit'](_0x1e6fb3['query'][_0xd6c2('0x1b')]);_0xdfad1a[_0xd6c2('0x18')]=qs[_0xd6c2('0x18')](_0x1e6fb3[_0xd6c2('0x31')][_0xd6c2('0x18')]);}return _0x358126[_0xd6c2('0x80')](_0xdfad1a);}})['then'](function(_0x1e66e8){if(_0x1e66e8){return _0x1e66e8?{'count':_0x4071e2,'rows':_0x1e66e8}:null;}})[_0xd6c2('0x22')](respondWithResult(_0x74c7fa,null))[_0xd6c2('0x45')](handleError(_0x74c7fa,null));};exports[_0xd6c2('0x81')]=function(_0x450cba,_0x1b1fb0,_0x2ae00d){var _0x61c29a,_0xfa7f7b;return db[_0xd6c2('0x2b')][_0xd6c2('0x4b')]({'where':{'id':_0x450cba['params']['id']}})[_0xd6c2('0x22')](handleEntityNotFound(_0x1b1fb0,null))['then'](function(_0x55584f){if(_0x55584f){_0xfa7f7b=_0x55584f;return _0x55584f['addBlackLists'](_0x450cba[_0xd6c2('0x52')][_0xd6c2('0x62')],_['omit'](_0x450cba[_0xd6c2('0x52')],[_0xd6c2('0x62'),'id'])||{});}return null;})['spread'](function(_0x2dd279){var _0x5dbc6b;_0x61c29a=_0x2dd279||[];var _0x3e8a92=[];if(_0x2dd279){for(var _0xe4f509=0x0;_0xe4f509<_0x2dd279[_0xd6c2('0x36')];_0xe4f509+=0x1){var _0x10e823=_0x2dd279[_0xe4f509][_0xd6c2('0x48')]({'plain':!![]});_0x5dbc6b=squel['insert']()['into'](_0xd6c2('0x82'))[_0xd6c2('0x69')](['phone','ContactId','ListId',_0xd6c2('0x5e'),_0xd6c2('0x50'),_0xd6c2('0x51')],squel[_0xd6c2('0x76')]()['field']('phone',_0xd6c2('0x6a'))['field']('id',_0xd6c2('0x6e'))[_0xd6c2('0x6c')](_0x10e823[_0xd6c2('0x7c')][_0xd6c2('0x6f')](),_0xd6c2('0x70'))[_0xd6c2('0x6c')](_0x450cba[_0xd6c2('0x42')]['id']['toString'](),'CampaignId')[_0xd6c2('0x6c')]('NOW()',_0xd6c2('0x50'))[_0xd6c2('0x6c')]('NOW()',_0xd6c2('0x51'))['from']('cm_contacts')[_0xd6c2('0x3a')]('deletedAt\x20IS\x20NULL')[_0xd6c2('0x3a')]('ListId\x20=\x20?',_0x10e823[_0xd6c2('0x7c')][_0xd6c2('0x6f')]())[_0xd6c2('0x3a')](_0xd6c2('0x74')))[_0xd6c2('0x6f')]();_0x3e8a92[_0xd6c2('0x83')](db[_0xd6c2('0x84')][_0xd6c2('0x31')](_0x5dbc6b));}return BPromise[_0xd6c2('0x7e')](_0x3e8a92);}})['then'](function(){return _0x61c29a;})[_0xd6c2('0x22')](respondWithResult(_0x1b1fb0,null))[_0xd6c2('0x45')](handleError(_0x1b1fb0,null));};exports['removeBlackLists']=function(_0x46bff4,_0x305cbb,_0x52376b){return db[_0xd6c2('0x2b')][_0xd6c2('0x4b')]({'where':{'id':_0x46bff4[_0xd6c2('0x42')]['id']}})['then'](handleEntityNotFound(_0x305cbb,null))[_0xd6c2('0x22')](function(_0xe537e0){if(_0xe537e0){return _0xe537e0[_0xd6c2('0x85')](_0x46bff4[_0xd6c2('0x31')][_0xd6c2('0x62')]);}})['then'](function(_0x743c77){if(_0x743c77){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x46bff4['query'][_0xd6c2('0x62')],'CampaignId':_0x46bff4[_0xd6c2('0x42')]['id']}})[_0xd6c2('0x22')](function(){return _0x743c77;});}})[_0xd6c2('0x22')](respondWithStatusCode(_0x305cbb,null))[_0xd6c2('0x45')](handleError(_0x305cbb,null));};
\ No newline at end of file
+var _0x66a4=['map','Campaign','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','userProfileId','UserProfileResource','clone','omit','createdAt','updatedAt','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','pick','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','insert','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','NOW()','scheduledAt','CmListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','toString','COALESCE(calleridnum,\x27\x27)','phone\x20NOT\x20IN\x20(?)','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','CampaignId\x20=\x20?','push','all','removeLists','getBlackLists','addBlackLists','into','cm_hopper_black','sequelize','removeBlackLists','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','end','error','stack','name','index'];(function(_0x4ce0fa,_0x42443b){var _0x1a2457=function(_0x4b19ee){while(--_0x4b19ee){_0x4ce0fa['push'](_0x4ce0fa['shift']());}};_0x1a2457(++_0x42443b);}(_0x66a4,0x161));var _0x466a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x66a4[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x466a('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x466a('0x1'));var BPromise=require(_0x466a('0x2'));var Mustache=require(_0x466a('0x3'));var util=require(_0x466a('0x4'));var path=require(_0x466a('0x5'));var sox=require(_0x466a('0x6'));var csv=require(_0x466a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x466a('0x8'));var squel=require('squel');var crypto=require(_0x466a('0x9'));var jsforce=require(_0x466a('0xa'));var deskjs=require(_0x466a('0xb'));var toCsv=require('to-csv');var querystring=require(_0x466a('0xc'));var Papa=require(_0x466a('0xd'));var Redis=require(_0x466a('0xe'));var authService=require(_0x466a('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x466a('0x10'));var logger=require(_0x466a('0x11'))('api');var utils=require(_0x466a('0x12'));var config=require(_0x466a('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x466a('0x14'))['db'];function respondWithStatusCode(_0x47d3e9,_0x51b051){_0x51b051=_0x51b051||0xcc;return function(_0x119506){if(_0x119506){return _0x47d3e9[_0x466a('0x15')](_0x51b051);}return _0x47d3e9[_0x466a('0x16')](_0x51b051)['end']();};}function respondWithResult(_0x1069b9,_0x4635c3){_0x4635c3=_0x4635c3||0xc8;return function(_0xe3701){if(_0xe3701){return _0x1069b9[_0x466a('0x16')](_0x4635c3)[_0x466a('0x17')](_0xe3701);}};}function respondWithFilteredResult(_0x460c47,_0x42eea8){return function(_0x50e9fd){if(_0x50e9fd){var _0x3d6528=typeof _0x42eea8[_0x466a('0x18')]===_0x466a('0x19')&&typeof _0x42eea8[_0x466a('0x1a')]===_0x466a('0x19');var _0x43bacd=_0x50e9fd[_0x466a('0x1b')];var _0xa71cb7=_0x3d6528?0x0:_0x42eea8['offset'];var _0x197021=_0x3d6528?_0x50e9fd[_0x466a('0x1b')]:_0x42eea8[_0x466a('0x18')]+_0x42eea8[_0x466a('0x1a')];var _0x33910b;if(_0x197021>=_0x43bacd){_0x197021=_0x43bacd;_0x33910b=0xc8;}else{_0x33910b=0xce;}_0x460c47[_0x466a('0x16')](_0x33910b);return _0x460c47[_0x466a('0x1c')](_0x466a('0x1d'),_0xa71cb7+'-'+_0x197021+'/'+_0x43bacd)[_0x466a('0x17')](_0x50e9fd);}return null;};}function patchUpdates(_0x34ccf9){return function(_0x40b27f){try{jsonpatch['apply'](_0x40b27f,_0x34ccf9,!![]);}catch(_0x216d83){return BPromise['reject'](_0x216d83);}return _0x40b27f[_0x466a('0x1e')]();};}function saveUpdates(_0x51289f,_0x1dc4a4){return function(_0x417939){if(_0x417939){return _0x417939[_0x466a('0x1f')](_0x51289f)[_0x466a('0x20')](function(_0x480e27){return _0x480e27;});}return null;};}function removeEntity(_0x38d151,_0x1c471d){return function(_0x3d8df5){if(_0x3d8df5){return _0x3d8df5[_0x466a('0x21')]()[_0x466a('0x20')](function(){var _0x41ced6=_0x3d8df5[_0x466a('0x22')]({'plain':!![]});var _0x8c582b='IvrCampaigns';return db['UserProfileResource']['destroy']({'where':{'type':_0x8c582b,'resourceId':_0x41ced6['id']}})[_0x466a('0x20')](function(){return _0x3d8df5;});})[_0x466a('0x20')](function(){_0x38d151[_0x466a('0x16')](0xcc)[_0x466a('0x23')]();});}};}function handleEntityNotFound(_0x51cac7,_0x4964fa){return function(_0x174e6c){if(!_0x174e6c){_0x51cac7[_0x466a('0x15')](0x194);}return _0x174e6c;};}function handleError(_0x320cba,_0x50a2a4){_0x50a2a4=_0x50a2a4||0x1f4;return function(_0xe1cdbe){logger[_0x466a('0x24')](_0xe1cdbe[_0x466a('0x25')]);if(_0xe1cdbe['name']){delete _0xe1cdbe[_0x466a('0x26')];}_0x320cba[_0x466a('0x16')](_0x50a2a4)['send'](_0xe1cdbe);};}exports[_0x466a('0x27')]=function(_0x2b675a,_0x581dcc){var _0x15a9f8={},_0x5edc76={},_0x4a9f83={'count':0x0,'rows':[]};var _0x5e754b=_[_0x466a('0x28')](db[_0x466a('0x29')][_0x466a('0x2a')],function(_0x4788d9){return{'name':_0x4788d9[_0x466a('0x2b')],'type':_0x4788d9['type'][_0x466a('0x2c')]};});_0x5edc76[_0x466a('0x2d')]=_[_0x466a('0x28')](_0x5e754b,'name');_0x5edc76[_0x466a('0x2e')]=_['keys'](_0x2b675a['query']);_0x5edc76[_0x466a('0x2f')]=_[_0x466a('0x30')](_0x5edc76[_0x466a('0x2d')],_0x5edc76[_0x466a('0x2e')]);_0x15a9f8['attributes']=_[_0x466a('0x30')](_0x5edc76[_0x466a('0x2d')],qs[_0x466a('0x31')](_0x2b675a['query'][_0x466a('0x31')]));_0x15a9f8[_0x466a('0x32')]=_0x15a9f8[_0x466a('0x32')][_0x466a('0x33')]?_0x15a9f8['attributes']:_0x5edc76['model'];if(!_0x2b675a[_0x466a('0x2e')][_0x466a('0x34')](_0x466a('0x35'))){_0x15a9f8[_0x466a('0x1a')]=qs['limit'](_0x2b675a[_0x466a('0x2e')]['limit']);_0x15a9f8[_0x466a('0x18')]=qs[_0x466a('0x18')](_0x2b675a[_0x466a('0x2e')][_0x466a('0x18')]);}_0x15a9f8[_0x466a('0x36')]=qs[_0x466a('0x37')](_0x2b675a[_0x466a('0x2e')]['sort']);_0x15a9f8['where']=qs['filters'](_['pick'](_0x2b675a[_0x466a('0x2e')],_0x5edc76[_0x466a('0x2f')]),_0x5e754b);if(_0x2b675a['query']['filter']){_0x15a9f8[_0x466a('0x38')]=_[_0x466a('0x39')](_0x15a9f8[_0x466a('0x38')],{'$or':_[_0x466a('0x28')](_0x5e754b,function(_0x4753f8){if(_0x4753f8[_0x466a('0x3a')]!==_0x466a('0x3b')){var _0x2570f2={};_0x2570f2[_0x4753f8['name']]={'$like':'%'+_0x2b675a[_0x466a('0x2e')][_0x466a('0x3c')]+'%'};return _0x2570f2;}})});}_0x15a9f8=_[_0x466a('0x39')]({},_0x15a9f8,_0x2b675a[_0x466a('0x3d')]);var _0x41a272={'where':_0x15a9f8['where']};return db[_0x466a('0x29')][_0x466a('0x1b')](_0x41a272)['then'](function(_0x424b12){_0x4a9f83[_0x466a('0x1b')]=_0x424b12;if(_0x2b675a['query'][_0x466a('0x3e')]){_0x15a9f8[_0x466a('0x3f')]=[{'all':!![]}];}return db[_0x466a('0x29')][_0x466a('0x40')](_0x15a9f8);})['then'](function(_0x29e1a3){_0x4a9f83[_0x466a('0x41')]=_0x29e1a3;return _0x4a9f83;})[_0x466a('0x20')](respondWithFilteredResult(_0x581dcc,_0x15a9f8))[_0x466a('0x42')](handleError(_0x581dcc,null));};exports[_0x466a('0x43')]=function(_0x4c1ee5,_0xb2809d){var _0x495c12={'raw':![],'where':{'id':_0x4c1ee5[_0x466a('0x44')]['id']}},_0x5ba6a7={};_0x5ba6a7[_0x466a('0x2d')]=_['keys'](db[_0x466a('0x29')][_0x466a('0x2a')]);_0x5ba6a7[_0x466a('0x2e')]=_[_0x466a('0x45')](_0x4c1ee5[_0x466a('0x2e')]);_0x5ba6a7['filters']=_[_0x466a('0x30')](_0x5ba6a7[_0x466a('0x2d')],_0x5ba6a7[_0x466a('0x2e')]);_0x495c12[_0x466a('0x32')]=_[_0x466a('0x30')](_0x5ba6a7[_0x466a('0x2d')],qs[_0x466a('0x31')](_0x4c1ee5['query'][_0x466a('0x31')]));_0x495c12[_0x466a('0x32')]=_0x495c12[_0x466a('0x32')]['length']?_0x495c12[_0x466a('0x32')]:_0x5ba6a7[_0x466a('0x2d')];if(_0x4c1ee5[_0x466a('0x2e')]['includeAll']){_0x495c12[_0x466a('0x3f')]=[{'all':!![]}];}_0x495c12=_[_0x466a('0x39')]({},_0x495c12,_0x4c1ee5[_0x466a('0x3d')]);return db[_0x466a('0x29')][_0x466a('0x46')](_0x495c12)[_0x466a('0x20')](handleEntityNotFound(_0xb2809d,null))[_0x466a('0x20')](respondWithResult(_0xb2809d,null))[_0x466a('0x42')](handleError(_0xb2809d,null));};exports[_0x466a('0x47')]=function(_0x627b93,_0xd473d2){return db[_0x466a('0x29')][_0x466a('0x47')](_0x627b93[_0x466a('0x48')],{})[_0x466a('0x20')](function(_0x4aa6cd){var _0x7abe2=_0x627b93['user']['get']({'plain':!![]});if(!_0x7abe2)throw new Error(_0x466a('0x49'));if(_0x7abe2[_0x466a('0x4a')]==='user'){var _0x56ee30=_0x4aa6cd[_0x466a('0x22')]({'plain':!![]});var _0x5f141d=_0x466a('0x4b');return db[_0x466a('0x4c')]['find']({'where':{'name':_0x5f141d,'userProfileId':_0x7abe2[_0x466a('0x4d')]},'raw':!![]})[_0x466a('0x20')](function(_0x1c8083){if(_0x1c8083&&_0x1c8083['autoAssociation']===0x0){return db[_0x466a('0x4e')][_0x466a('0x47')]({'name':_0x56ee30[_0x466a('0x26')],'resourceId':_0x56ee30['id'],'type':_0x1c8083['name'],'sectionId':_0x1c8083['id']},{})[_0x466a('0x20')](function(){return _0x4aa6cd;});}else{return _0x4aa6cd;}})[_0x466a('0x42')](function(_0x2cbbb4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2cbbb4);throw _0x2cbbb4;});}return _0x4aa6cd;})[_0x466a('0x20')](respondWithResult(_0xd473d2,0xc9))[_0x466a('0x42')](handleError(_0xd473d2,null));};exports[_0x466a('0x4f')]=function(_0x396164,_0x3e3ff1){var _0x402fdb={'where':{'id':_0x396164[_0x466a('0x44')]['id']}},_0xfe14d5={};_0xfe14d5[_0x466a('0x2d')]=_[_0x466a('0x45')](db['Campaign'][_0x466a('0x2a')]);_0x402fdb['attributes']=_['intersection'](_0xfe14d5[_0x466a('0x2d')],qs[_0x466a('0x31')](_0x396164[_0x466a('0x2e')][_0x466a('0x31')]));_0x402fdb[_0x466a('0x32')]=_0x402fdb['attributes'][_0x466a('0x33')]?_0x402fdb[_0x466a('0x32')]:_0xfe14d5[_0x466a('0x2d')];if(_0x396164[_0x466a('0x2e')][_0x466a('0x3e')]){_0x402fdb[_0x466a('0x3f')]=[{'all':!![]}];}_0x402fdb=_[_0x466a('0x39')]({},_0x402fdb,_0x396164[_0x466a('0x3d')]);return db[_0x466a('0x29')][_0x466a('0x46')](_0x402fdb)[_0x466a('0x20')](handleEntityNotFound(_0x3e3ff1,null))[_0x466a('0x20')](function(_0x17e875){if(_0x17e875){var _0x24afdd=_0x17e875['get']({'plain':!![]});_0x24afdd=qs[_0x466a('0x50')](_0x24afdd,['id',_0x466a('0x51'),'updatedAt']);_0x396164['body']=_['omit'](_0x396164[_0x466a('0x48')],['id',_0x466a('0x51'),_0x466a('0x52')]);return db[_0x466a('0x29')][_0x466a('0x47')](_[_0x466a('0x39')](_0x24afdd,_0x396164['body']),{'include':_0x396164[_0x466a('0x2e')][_0x466a('0x3e')]?[{'all':!![]}]:undefined})['then'](function(_0x3046a3){var _0x41cc6c=_0x396164['user']['get']({'plain':!![]});if(!_0x41cc6c)throw new Error(_0x466a('0x49'));if(_0x41cc6c['role']===_0x466a('0x53')){var _0xd02bca=_0x3046a3[_0x466a('0x22')]({'plain':!![]});var _0x23549f=_0x466a('0x4b');return db[_0x466a('0x4c')][_0x466a('0x46')]({'where':{'name':_0x23549f,'userProfileId':_0x41cc6c[_0x466a('0x4d')]},'raw':!![]})['then'](function(_0x37d4d7){if(_0x37d4d7&&_0x37d4d7[_0x466a('0x54')]===0x0){return db[_0x466a('0x4e')][_0x466a('0x47')]({'name':_0xd02bca[_0x466a('0x26')],'resourceId':_0xd02bca['id'],'type':_0x37d4d7[_0x466a('0x26')],'sectionId':_0x37d4d7['id']},{})[_0x466a('0x20')](function(){return _0x3046a3;});}else{return _0x3046a3;}})[_0x466a('0x42')](function(_0x1b22b2){logger[_0x466a('0x24')](_0x466a('0x55'),_0x1b22b2);throw _0x1b22b2;});}return _0x3046a3;});}})['then'](respondWithResult(_0x3e3ff1,0xc9))[_0x466a('0x42')](handleError(_0x3e3ff1,null));};exports['update']=function(_0x5927b4,_0x1e86cb){if(_0x5927b4[_0x466a('0x48')]['id']){delete _0x5927b4['body']['id'];}return db[_0x466a('0x29')][_0x466a('0x46')]({'where':{'id':_0x5927b4[_0x466a('0x44')]['id']}})[_0x466a('0x20')](handleEntityNotFound(_0x1e86cb,null))[_0x466a('0x20')](saveUpdates(_0x5927b4['body'],null))[_0x466a('0x20')](respondWithResult(_0x1e86cb,null))[_0x466a('0x42')](handleError(_0x1e86cb,null));};exports[_0x466a('0x21')]=function(_0x244b3f,_0x5d98a1){return db['Campaign']['find']({'where':{'id':_0x244b3f['params']['id']}})[_0x466a('0x20')](handleEntityNotFound(_0x5d98a1,null))[_0x466a('0x20')](removeEntity(_0x5d98a1,null))[_0x466a('0x42')](handleError(_0x5d98a1,null));};exports[_0x466a('0x56')]=function(_0x25a0a2,_0x2edf30,_0x428df3){var _0x2a2961={'raw':!![],'where':{}};var _0x1e82bd={};var _0x13bb13={'count':0x0,'rows':[]};return db[_0x466a('0x29')][_0x466a('0x57')]({'where':{'id':_0x25a0a2[_0x466a('0x44')]['id']}})[_0x466a('0x20')](handleEntityNotFound(_0x2edf30,null))[_0x466a('0x20')](function(_0x552ab8){if(_0x552ab8){_0x1e82bd[_0x466a('0x2d')]=_['keys'](db[_0x466a('0x58')]['rawAttributes']);_0x1e82bd['query']=_['keys'](_0x25a0a2['query']);_0x1e82bd[_0x466a('0x2f')]=_[_0x466a('0x30')](_0x1e82bd[_0x466a('0x2d')],_0x1e82bd[_0x466a('0x2e')]);_0x2a2961[_0x466a('0x32')]=_['intersection'](_0x1e82bd['model'],qs['fields'](_0x25a0a2[_0x466a('0x2e')][_0x466a('0x31')]));_0x2a2961[_0x466a('0x32')]=_0x2a2961[_0x466a('0x32')][_0x466a('0x33')]?_0x2a2961[_0x466a('0x32')]:_0x1e82bd['model'];if(!_0x25a0a2[_0x466a('0x2e')][_0x466a('0x34')]('nolimit')){_0x2a2961[_0x466a('0x1a')]=qs[_0x466a('0x1a')](_0x25a0a2['query'][_0x466a('0x1a')]);_0x2a2961[_0x466a('0x18')]=qs['offset'](_0x25a0a2[_0x466a('0x2e')][_0x466a('0x18')]);}_0x2a2961[_0x466a('0x36')]=qs['sort'](_0x25a0a2['query'][_0x466a('0x37')]);_0x2a2961[_0x466a('0x38')]=qs[_0x466a('0x2f')](_[_0x466a('0x59')](_0x25a0a2[_0x466a('0x2e')],_0x1e82bd[_0x466a('0x2f')]));_0x2a2961[_0x466a('0x38')][_0x466a('0x5a')]=_0x552ab8['id'];if(_0x25a0a2['query'][_0x466a('0x3c')]){_0x2a2961[_0x466a('0x38')]=_['merge'](_0x2a2961['where'],{'$or':_['map'](_0x2a2961[_0x466a('0x32')],function(_0x2dbc14){var _0x4c74e5={};_0x4c74e5[_0x2dbc14]={'$like':'%'+_0x25a0a2[_0x466a('0x2e')][_0x466a('0x3c')]+'%'};return _0x4c74e5;})});}_0x2a2961=_[_0x466a('0x39')]({},_0x2a2961,_0x25a0a2[_0x466a('0x3d')]);return db[_0x466a('0x58')]['count']({'where':_0x2a2961[_0x466a('0x38')]})[_0x466a('0x20')](function(_0x5b676c){_0x13bb13[_0x466a('0x1b')]=_0x5b676c;if(_0x25a0a2[_0x466a('0x2e')]['includeAll']){_0x2a2961['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x2a2961);})['then'](function(_0x4d81a0){_0x13bb13[_0x466a('0x41')]=_0x4d81a0;return _0x13bb13;});}})[_0x466a('0x20')](respondWithFilteredResult(_0x2edf30,_0x2a2961))[_0x466a('0x42')](handleError(_0x2edf30,null));};exports[_0x466a('0x5b')]=function(_0x3e2b3c,_0x227295,_0x41e2bc){var _0x2716da={'raw':!![],'where':{}};var _0x25e2c5={};var _0x50cda8={'count':0x0,'rows':[]};return db[_0x466a('0x29')][_0x466a('0x57')]({'where':{'id':_0x3e2b3c[_0x466a('0x44')]['id']}})[_0x466a('0x20')](handleEntityNotFound(_0x227295,null))[_0x466a('0x20')](function(_0x20aa66){if(_0x20aa66){_0x25e2c5[_0x466a('0x2d')]=_[_0x466a('0x45')](db[_0x466a('0x5c')][_0x466a('0x2a')]);_0x25e2c5[_0x466a('0x2e')]=_[_0x466a('0x45')](_0x3e2b3c[_0x466a('0x2e')]);_0x25e2c5[_0x466a('0x2f')]=_[_0x466a('0x30')](_0x25e2c5['model'],_0x25e2c5[_0x466a('0x2e')]);_0x2716da['attributes']=_[_0x466a('0x30')](_0x25e2c5[_0x466a('0x2d')],qs[_0x466a('0x31')](_0x3e2b3c['query'][_0x466a('0x31')]));_0x2716da[_0x466a('0x32')]=_0x2716da[_0x466a('0x32')][_0x466a('0x33')]?_0x2716da[_0x466a('0x32')]:_0x25e2c5[_0x466a('0x2d')];if(!_0x3e2b3c['query'][_0x466a('0x34')](_0x466a('0x35'))){_0x2716da[_0x466a('0x1a')]=qs['limit'](_0x3e2b3c[_0x466a('0x2e')][_0x466a('0x1a')]);_0x2716da[_0x466a('0x18')]=qs[_0x466a('0x18')](_0x3e2b3c['query']['offset']);}_0x2716da[_0x466a('0x36')]=qs[_0x466a('0x37')](_0x3e2b3c['query'][_0x466a('0x37')]);_0x2716da['where']=qs[_0x466a('0x2f')](_[_0x466a('0x59')](_0x3e2b3c['query'],_0x25e2c5[_0x466a('0x2f')]));_0x2716da[_0x466a('0x38')]['CampaignId']=_0x20aa66['id'];if(_0x3e2b3c['query'][_0x466a('0x3c')]){_0x2716da[_0x466a('0x38')]=_[_0x466a('0x39')](_0x2716da['where'],{'$or':_[_0x466a('0x28')](_0x2716da[_0x466a('0x32')],function(_0x320028){var _0x5a2399={};_0x5a2399[_0x320028]={'$like':'%'+_0x3e2b3c['query'][_0x466a('0x3c')]+'%'};return _0x5a2399;})});}_0x2716da=_[_0x466a('0x39')]({},_0x2716da,_0x3e2b3c[_0x466a('0x3d')]);return db['CmHopperHistory'][_0x466a('0x1b')]({'where':_0x2716da[_0x466a('0x38')]})[_0x466a('0x20')](function(_0x4e0909){_0x50cda8[_0x466a('0x1b')]=_0x4e0909;if(_0x3e2b3c[_0x466a('0x2e')][_0x466a('0x3e')]){_0x2716da[_0x466a('0x3f')]=[{'all':!![]}];}return db[_0x466a('0x5c')][_0x466a('0x40')](_0x2716da);})['then'](function(_0x5f5845){_0x50cda8['rows']=_0x5f5845;return _0x50cda8;});}})[_0x466a('0x20')](respondWithFilteredResult(_0x227295,_0x2716da))[_0x466a('0x42')](handleError(_0x227295,null));};exports[_0x466a('0x5d')]=function(_0x17658d,_0x4d2974,_0x18e0e6){var _0x15479c={'raw':!![],'where':{}};var _0x5da76a={};var _0x3bf3ae={'count':0x0,'rows':[]};return db[_0x466a('0x29')][_0x466a('0x57')]({'where':{'id':_0x17658d[_0x466a('0x44')]['id']}})[_0x466a('0x20')](handleEntityNotFound(_0x4d2974,null))[_0x466a('0x20')](function(_0x4b22a3){if(_0x4b22a3){_0x5da76a[_0x466a('0x2d')]=_[_0x466a('0x45')](db[_0x466a('0x5e')]['rawAttributes']);_0x5da76a[_0x466a('0x2e')]=_['keys'](_0x17658d['query']);_0x5da76a[_0x466a('0x2f')]=_[_0x466a('0x30')](_0x5da76a['model'],_0x5da76a['query']);_0x15479c[_0x466a('0x32')]=_[_0x466a('0x30')](_0x5da76a[_0x466a('0x2d')],qs[_0x466a('0x31')](_0x17658d[_0x466a('0x2e')][_0x466a('0x31')]));_0x15479c[_0x466a('0x32')]=_0x15479c[_0x466a('0x32')][_0x466a('0x33')]?_0x15479c[_0x466a('0x32')]:_0x5da76a[_0x466a('0x2d')];if(!_0x17658d[_0x466a('0x2e')][_0x466a('0x34')](_0x466a('0x35'))){_0x15479c[_0x466a('0x1a')]=qs[_0x466a('0x1a')](_0x17658d[_0x466a('0x2e')][_0x466a('0x1a')]);_0x15479c[_0x466a('0x18')]=qs[_0x466a('0x18')](_0x17658d[_0x466a('0x2e')][_0x466a('0x18')]);}_0x15479c['order']=qs[_0x466a('0x37')](_0x17658d['query'][_0x466a('0x37')]);_0x15479c[_0x466a('0x38')]=qs[_0x466a('0x2f')](_['pick'](_0x17658d[_0x466a('0x2e')],_0x5da76a['filters']));_0x15479c[_0x466a('0x38')][_0x466a('0x5a')]=_0x4b22a3['id'];if(_0x17658d['query'][_0x466a('0x3c')]){_0x15479c[_0x466a('0x38')]=_[_0x466a('0x39')](_0x15479c[_0x466a('0x38')],{'$or':_[_0x466a('0x28')](_0x15479c[_0x466a('0x32')],function(_0x1176e7){var _0x5cde25={};_0x5cde25[_0x1176e7]={'$like':'%'+_0x17658d[_0x466a('0x2e')]['filter']+'%'};return _0x5cde25;})});}_0x15479c=_[_0x466a('0x39')]({},_0x15479c,_0x17658d['options']);return db[_0x466a('0x5e')][_0x466a('0x1b')]({'where':_0x15479c['where']})[_0x466a('0x20')](function(_0x159200){_0x3bf3ae[_0x466a('0x1b')]=_0x159200;if(_0x17658d[_0x466a('0x2e')][_0x466a('0x3e')]){_0x15479c[_0x466a('0x3f')]=[{'all':!![]}];}return db[_0x466a('0x5e')]['findAll'](_0x15479c);})[_0x466a('0x20')](function(_0xcd6449){_0x3bf3ae[_0x466a('0x41')]=_0xcd6449;return _0x3bf3ae;});}})[_0x466a('0x20')](respondWithFilteredResult(_0x4d2974,_0x15479c))[_0x466a('0x42')](handleError(_0x4d2974,null));};exports['getHopperBlacks']=function(_0x3633d5,_0x7fec4e,_0x217809){var _0x1509f7={'raw':!![],'where':{}};var _0x37b6b3={};var _0x4fdc40={'count':0x0,'rows':[]};return db['Campaign'][_0x466a('0x57')]({'where':{'id':_0x3633d5[_0x466a('0x44')]['id']}})[_0x466a('0x20')](handleEntityNotFound(_0x7fec4e,null))[_0x466a('0x20')](function(_0x6038f7){if(_0x6038f7){_0x37b6b3[_0x466a('0x2d')]=_[_0x466a('0x45')](db[_0x466a('0x5f')][_0x466a('0x2a')]);_0x37b6b3[_0x466a('0x2e')]=_[_0x466a('0x45')](_0x3633d5[_0x466a('0x2e')]);_0x37b6b3[_0x466a('0x2f')]=_[_0x466a('0x30')](_0x37b6b3['model'],_0x37b6b3['query']);_0x1509f7['attributes']=_[_0x466a('0x30')](_0x37b6b3[_0x466a('0x2d')],qs[_0x466a('0x31')](_0x3633d5[_0x466a('0x2e')]['fields']));_0x1509f7['attributes']=_0x1509f7[_0x466a('0x32')][_0x466a('0x33')]?_0x1509f7[_0x466a('0x32')]:_0x37b6b3[_0x466a('0x2d')];if(!_0x3633d5['query']['hasOwnProperty']('nolimit')){_0x1509f7['limit']=qs[_0x466a('0x1a')](_0x3633d5[_0x466a('0x2e')][_0x466a('0x1a')]);_0x1509f7['offset']=qs[_0x466a('0x18')](_0x3633d5[_0x466a('0x2e')]['offset']);}_0x1509f7['order']=qs[_0x466a('0x37')](_0x3633d5[_0x466a('0x2e')]['sort']);_0x1509f7[_0x466a('0x38')]=qs[_0x466a('0x2f')](_[_0x466a('0x59')](_0x3633d5[_0x466a('0x2e')],_0x37b6b3[_0x466a('0x2f')]));_0x1509f7[_0x466a('0x38')][_0x466a('0x5a')]=_0x6038f7['id'];if(_0x3633d5[_0x466a('0x2e')][_0x466a('0x3c')]){_0x1509f7['where']=_[_0x466a('0x39')](_0x1509f7[_0x466a('0x38')],{'$or':_['map'](_0x1509f7[_0x466a('0x32')],function(_0x18eb6a){var _0x21a260={};_0x21a260[_0x18eb6a]={'$like':'%'+_0x3633d5['query'][_0x466a('0x3c')]+'%'};return _0x21a260;})});}_0x1509f7=_['merge']({},_0x1509f7,_0x3633d5[_0x466a('0x3d')]);return db[_0x466a('0x5f')]['count']({'where':_0x1509f7[_0x466a('0x38')]})['then'](function(_0x36defa){_0x4fdc40[_0x466a('0x1b')]=_0x36defa;if(_0x3633d5[_0x466a('0x2e')][_0x466a('0x3e')]){_0x1509f7[_0x466a('0x3f')]=[{'all':!![]}];}return db[_0x466a('0x5f')][_0x466a('0x40')](_0x1509f7);})[_0x466a('0x20')](function(_0x25c65c){_0x4fdc40[_0x466a('0x41')]=_0x25c65c;return _0x4fdc40;});}})[_0x466a('0x20')](respondWithFilteredResult(_0x7fec4e,_0x1509f7))['catch'](handleError(_0x7fec4e,null));};exports[_0x466a('0x60')]=function(_0x47b5aa,_0x125741,_0x590b23){var _0x2403f1={};var _0x3e3ce8={};var _0x19a85b;var _0x1bac1a;return db[_0x466a('0x29')][_0x466a('0x57')]({'where':{'id':_0x47b5aa[_0x466a('0x44')]['id']}})[_0x466a('0x20')](handleEntityNotFound(_0x125741,null))['then'](function(_0x4796dd){if(_0x4796dd){_0x19a85b=_0x4796dd;_0x3e3ce8[_0x466a('0x2d')]=_[_0x466a('0x45')](db['CmList'][_0x466a('0x2a')]);_0x3e3ce8[_0x466a('0x2e')]=_[_0x466a('0x45')](_0x47b5aa[_0x466a('0x2e')]);_0x3e3ce8['filters']=_['intersection'](_0x3e3ce8[_0x466a('0x2d')],_0x3e3ce8['query']);_0x2403f1[_0x466a('0x32')]=_[_0x466a('0x30')](_0x3e3ce8[_0x466a('0x2d')],qs[_0x466a('0x31')](_0x47b5aa[_0x466a('0x2e')][_0x466a('0x31')]));_0x2403f1[_0x466a('0x32')]=_0x2403f1[_0x466a('0x32')][_0x466a('0x33')]?_0x2403f1[_0x466a('0x32')]:_0x3e3ce8[_0x466a('0x2d')];_0x2403f1[_0x466a('0x36')]=qs['sort'](_0x47b5aa['query'][_0x466a('0x37')]);_0x2403f1[_0x466a('0x38')]=qs['filters'](_[_0x466a('0x59')](_0x47b5aa[_0x466a('0x2e')],_0x3e3ce8[_0x466a('0x2f')]));if(_0x47b5aa['query'][_0x466a('0x3c')]){_0x2403f1[_0x466a('0x38')]=_['merge'](_0x2403f1[_0x466a('0x38')],{'$or':_[_0x466a('0x28')](_0x2403f1[_0x466a('0x32')],function(_0x3dfbef){var _0x30d7b2={};_0x30d7b2[_0x3dfbef]={'$like':'%'+_0x47b5aa[_0x466a('0x2e')][_0x466a('0x3c')]+'%'};return _0x30d7b2;})});}_0x2403f1=_[_0x466a('0x39')]({},_0x2403f1,_0x47b5aa[_0x466a('0x3d')]);return _0x19a85b[_0x466a('0x60')](_0x2403f1);}})[_0x466a('0x20')](function(_0x5b02d1){if(_0x5b02d1){_0x1bac1a=_0x5b02d1[_0x466a('0x33')];if(!_0x47b5aa[_0x466a('0x2e')][_0x466a('0x34')](_0x466a('0x35'))){_0x2403f1[_0x466a('0x1a')]=qs[_0x466a('0x1a')](_0x47b5aa['query']['limit']);_0x2403f1['offset']=qs[_0x466a('0x18')](_0x47b5aa[_0x466a('0x2e')][_0x466a('0x18')]);}return _0x19a85b[_0x466a('0x60')](_0x2403f1);}})[_0x466a('0x20')](function(_0x3d0edf){if(_0x3d0edf){return _0x3d0edf?{'count':_0x1bac1a,'rows':_0x3d0edf}:null;}})[_0x466a('0x20')](respondWithResult(_0x125741,null))['catch'](handleError(_0x125741,null));};exports[_0x466a('0x61')]=function(_0x4be424,_0x38bb7e,_0x549ff5){var _0x2636f2,_0x3d794b;return db[_0x466a('0x29')]['find']({'where':{'id':_0x4be424[_0x466a('0x44')]['id']}})[_0x466a('0x20')](handleEntityNotFound(_0x38bb7e,null))[_0x466a('0x20')](function(_0x5248ab){if(_0x5248ab){_0x3d794b=_0x5248ab;return _0x5248ab[_0x466a('0x61')](_0x4be424[_0x466a('0x48')][_0x466a('0x62')],_[_0x466a('0x50')](_0x4be424[_0x466a('0x48')],[_0x466a('0x62'),'id'])||{});}return null;})[_0x466a('0x63')](function(_0x484aae){var _0x287c3b;_0x2636f2=_0x484aae||[];var _0x465528=[];if(_0x484aae){for(var _0x52a09a=0x0;_0x52a09a<_0x484aae[_0x466a('0x33')];_0x52a09a+=0x1){var _0x4f32eb=_0x484aae[_0x52a09a][_0x466a('0x22')]({'plain':!![]});_0x3d794b['dialCheckDuplicateType']=_0x4be424[_0x466a('0x48')][_0x466a('0x64')]?_0x4be424[_0x466a('0x48')][_0x466a('0x64')]:_0x3d794b[_0x466a('0x64')];switch(_0x3d794b['dialCheckDuplicateType']){case'always':_0x287c3b=squel[_0x466a('0x65')]()['into'](_0x466a('0x66'))[_0x466a('0x67')]([_0x466a('0x68'),'scheduledAt',_0x466a('0x69'),_0x466a('0x6a'),_0x466a('0x5a'),_0x466a('0x51'),_0x466a('0x52')],squel[_0x466a('0x6b')]()[_0x466a('0x6c')](_0x466a('0x68'),_0x466a('0x68'))['field'](_0x466a('0x6d'),_0x466a('0x6e'))['field']('id',_0x466a('0x69'))['field'](_0x4f32eb[_0x466a('0x6f')]['toString'](),_0x466a('0x6a'))[_0x466a('0x6c')](_0x4be424[_0x466a('0x44')]['id']['toString'](),'CampaignId')[_0x466a('0x6c')]('NOW()',_0x466a('0x51'))[_0x466a('0x6c')](_0x466a('0x6d'),_0x466a('0x52'))[_0x466a('0x70')](_0x466a('0x71'))[_0x466a('0x38')](_0x466a('0x72'))[_0x466a('0x38')](_0x466a('0x73'),_0x4f32eb[_0x466a('0x6f')][_0x466a('0x74')]())[_0x466a('0x38')]('phone\x20IS\x20NOT\x20NULL')[_0x466a('0x38')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x466a('0x6c')](_0x466a('0x75'))['from']('cm_hopper_final')['where']('CampaignId\x20=\x20?',_0x4be424[_0x466a('0x44')]['id']['toString']()))['where'](_0x466a('0x76'),squel[_0x466a('0x6b')]()[_0x466a('0x6c')]('COALESCE(phone,\x27\x27)')[_0x466a('0x70')](_0x466a('0x66'))[_0x466a('0x38')]('CampaignId\x20=\x20?',_0x4be424[_0x466a('0x44')]['id'][_0x466a('0x74')]())))[_0x466a('0x74')]();break;case _0x466a('0x77'):_0x287c3b=squel[_0x466a('0x65')]()['into'](_0x466a('0x66'))[_0x466a('0x67')]([_0x466a('0x68'),_0x466a('0x6e'),_0x466a('0x69'),_0x466a('0x6a'),_0x466a('0x5a'),'createdAt',_0x466a('0x52')],squel[_0x466a('0x6b')]()[_0x466a('0x6c')](_0x466a('0x68'),_0x466a('0x68'))[_0x466a('0x6c')](_0x466a('0x6d'),_0x466a('0x6e'))['field']('id','ContactId')[_0x466a('0x6c')](_0x4f32eb[_0x466a('0x6f')][_0x466a('0x74')](),_0x466a('0x6a'))['field'](_0x4be424[_0x466a('0x44')]['id']['toString'](),'CampaignId')['field'](_0x466a('0x6d'),_0x466a('0x51'))[_0x466a('0x6c')](_0x466a('0x6d'),_0x466a('0x52'))[_0x466a('0x70')](_0x466a('0x71'))[_0x466a('0x38')](_0x466a('0x72'))['where'](_0x466a('0x73'),_0x4f32eb['CmListId']['toString']())[_0x466a('0x38')](_0x466a('0x78'))[_0x466a('0x38')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x466a('0x6c')]('COALESCE(phone,\x27\x27)')['from'](_0x466a('0x66'))['where'](_0x466a('0x79'),_0x4be424['params']['id'][_0x466a('0x74')]())))[_0x466a('0x74')]();break;default:_0x287c3b=squel[_0x466a('0x65')]()['into'](_0x466a('0x66'))[_0x466a('0x67')]([_0x466a('0x68'),_0x466a('0x6e'),_0x466a('0x69'),_0x466a('0x6a'),_0x466a('0x5a'),_0x466a('0x51'),_0x466a('0x52')],squel['select']()[_0x466a('0x6c')](_0x466a('0x68'),_0x466a('0x68'))[_0x466a('0x6c')]('NOW()',_0x466a('0x6e'))[_0x466a('0x6c')]('id',_0x466a('0x69'))[_0x466a('0x6c')](_0x4f32eb[_0x466a('0x6f')][_0x466a('0x74')](),_0x466a('0x6a'))[_0x466a('0x6c')](_0x4be424[_0x466a('0x44')]['id'][_0x466a('0x74')](),_0x466a('0x5a'))['field']('NOW()',_0x466a('0x51'))[_0x466a('0x6c')](_0x466a('0x6d'),_0x466a('0x52'))[_0x466a('0x70')]('cm_contacts')[_0x466a('0x38')]('deletedAt\x20IS\x20NULL')[_0x466a('0x38')](_0x466a('0x73'),_0x4f32eb[_0x466a('0x6f')][_0x466a('0x74')]())[_0x466a('0x38')](_0x466a('0x78')))['toString']();}_0x465528[_0x466a('0x7a')](db['sequelize'][_0x466a('0x2e')](_0x287c3b));}return BPromise[_0x466a('0x7b')](_0x465528);}})[_0x466a('0x20')](function(){return _0x2636f2;})[_0x466a('0x20')](respondWithResult(_0x38bb7e,null))[_0x466a('0x42')](handleError(_0x38bb7e,null));};exports[_0x466a('0x7c')]=function(_0x901c82,_0x300971,_0x1140f6){return db[_0x466a('0x29')][_0x466a('0x46')]({'where':{'id':_0x901c82[_0x466a('0x44')]['id']}})[_0x466a('0x20')](handleEntityNotFound(_0x300971,null))[_0x466a('0x20')](function(_0x125d92){if(_0x125d92){return _0x125d92['removeLists'](_0x901c82['query'][_0x466a('0x62')]);}})['then'](function(_0xe751b0){if(_0xe751b0){return db[_0x466a('0x58')]['destroy']({'where':{'ListId':_0x901c82[_0x466a('0x2e')]['ids'],'CampaignId':_0x901c82[_0x466a('0x44')]['id']}})[_0x466a('0x20')](function(){return _0xe751b0;});}})[_0x466a('0x20')](respondWithStatusCode(_0x300971,null))[_0x466a('0x42')](handleError(_0x300971,null));};exports['getBlackLists']=function(_0x491710,_0x3f29f7,_0x39e530){var _0x79ad8a={};var _0x28e937={};var _0x19a973;var _0x3a7fbe;return db['Campaign'][_0x466a('0x57')]({'where':{'id':_0x491710[_0x466a('0x44')]['id']}})[_0x466a('0x20')](handleEntityNotFound(_0x3f29f7,null))[_0x466a('0x20')](function(_0x495bad){if(_0x495bad){_0x19a973=_0x495bad;_0x28e937[_0x466a('0x2d')]=_[_0x466a('0x45')](db['CmList']['rawAttributes']);_0x28e937[_0x466a('0x2e')]=_['keys'](_0x491710['query']);_0x28e937[_0x466a('0x2f')]=_[_0x466a('0x30')](_0x28e937[_0x466a('0x2d')],_0x28e937['query']);_0x79ad8a['attributes']=_[_0x466a('0x30')](_0x28e937[_0x466a('0x2d')],qs[_0x466a('0x31')](_0x491710[_0x466a('0x2e')][_0x466a('0x31')]));_0x79ad8a[_0x466a('0x32')]=_0x79ad8a[_0x466a('0x32')]['length']?_0x79ad8a[_0x466a('0x32')]:_0x28e937[_0x466a('0x2d')];_0x79ad8a['order']=qs[_0x466a('0x37')](_0x491710[_0x466a('0x2e')][_0x466a('0x37')]);_0x79ad8a[_0x466a('0x38')]=qs[_0x466a('0x2f')](_[_0x466a('0x59')](_0x491710['query'],_0x28e937[_0x466a('0x2f')]));if(_0x491710[_0x466a('0x2e')][_0x466a('0x3c')]){_0x79ad8a[_0x466a('0x38')]=_[_0x466a('0x39')](_0x79ad8a[_0x466a('0x38')],{'$or':_[_0x466a('0x28')](_0x79ad8a[_0x466a('0x32')],function(_0x1edf6f){var _0x57562c={};_0x57562c[_0x1edf6f]={'$like':'%'+_0x491710[_0x466a('0x2e')]['filter']+'%'};return _0x57562c;})});}_0x79ad8a=_[_0x466a('0x39')]({},_0x79ad8a,_0x491710[_0x466a('0x3d')]);return _0x19a973[_0x466a('0x7d')](_0x79ad8a);}})[_0x466a('0x20')](function(_0xee5e35){if(_0xee5e35){_0x3a7fbe=_0xee5e35[_0x466a('0x33')];if(!_0x491710[_0x466a('0x2e')][_0x466a('0x34')](_0x466a('0x35'))){_0x79ad8a[_0x466a('0x1a')]=qs[_0x466a('0x1a')](_0x491710[_0x466a('0x2e')]['limit']);_0x79ad8a[_0x466a('0x18')]=qs[_0x466a('0x18')](_0x491710[_0x466a('0x2e')][_0x466a('0x18')]);}return _0x19a973[_0x466a('0x7d')](_0x79ad8a);}})['then'](function(_0x3fff0e){if(_0x3fff0e){return _0x3fff0e?{'count':_0x3a7fbe,'rows':_0x3fff0e}:null;}})[_0x466a('0x20')](respondWithResult(_0x3f29f7,null))[_0x466a('0x42')](handleError(_0x3f29f7,null));};exports['addBlackLists']=function(_0x385416,_0x1572b5,_0x2ff91c){var _0x252d85,_0x4815ef;return db[_0x466a('0x29')][_0x466a('0x46')]({'where':{'id':_0x385416[_0x466a('0x44')]['id']}})[_0x466a('0x20')](handleEntityNotFound(_0x1572b5,null))[_0x466a('0x20')](function(_0x2db913){if(_0x2db913){_0x4815ef=_0x2db913;return _0x2db913[_0x466a('0x7e')](_0x385416[_0x466a('0x48')][_0x466a('0x62')],_[_0x466a('0x50')](_0x385416['body'],[_0x466a('0x62'),'id'])||{});}return null;})[_0x466a('0x63')](function(_0x3f5ff3){var _0x982559;_0x252d85=_0x3f5ff3||[];var _0x2ed016=[];if(_0x3f5ff3){for(var _0x4827dc=0x0;_0x4827dc<_0x3f5ff3[_0x466a('0x33')];_0x4827dc+=0x1){var _0x3d82e1=_0x3f5ff3[_0x4827dc][_0x466a('0x22')]({'plain':!![]});_0x982559=squel[_0x466a('0x65')]()[_0x466a('0x7f')](_0x466a('0x80'))[_0x466a('0x67')]([_0x466a('0x68'),'ContactId',_0x466a('0x6a'),'CampaignId',_0x466a('0x51'),_0x466a('0x52')],squel['select']()[_0x466a('0x6c')](_0x466a('0x68'),_0x466a('0x68'))['field']('id',_0x466a('0x69'))[_0x466a('0x6c')](_0x3d82e1[_0x466a('0x6f')][_0x466a('0x74')](),_0x466a('0x6a'))['field'](_0x385416['params']['id']['toString'](),_0x466a('0x5a'))[_0x466a('0x6c')](_0x466a('0x6d'),'createdAt')[_0x466a('0x6c')]('NOW()',_0x466a('0x52'))['from']('cm_contacts')[_0x466a('0x38')](_0x466a('0x72'))[_0x466a('0x38')](_0x466a('0x73'),_0x3d82e1[_0x466a('0x6f')]['toString']())[_0x466a('0x38')](_0x466a('0x78')))[_0x466a('0x74')]();_0x2ed016[_0x466a('0x7a')](db[_0x466a('0x81')][_0x466a('0x2e')](_0x982559));}return BPromise['all'](_0x2ed016);}})[_0x466a('0x20')](function(){return _0x252d85;})[_0x466a('0x20')](respondWithResult(_0x1572b5,null))[_0x466a('0x42')](handleError(_0x1572b5,null));};exports[_0x466a('0x82')]=function(_0x557317,_0x4d3f5f,_0x12eed0){return db[_0x466a('0x29')][_0x466a('0x46')]({'where':{'id':_0x557317['params']['id']}})[_0x466a('0x20')](handleEntityNotFound(_0x4d3f5f,null))['then'](function(_0x157e66){if(_0x157e66){return _0x157e66['removeBlackLists'](_0x557317[_0x466a('0x2e')][_0x466a('0x62')]);}})[_0x466a('0x20')](function(_0x5d69cc){if(_0x5d69cc){return db[_0x466a('0x5f')]['destroy']({'where':{'ListId':_0x557317[_0x466a('0x2e')]['ids'],'CampaignId':_0x557317[_0x466a('0x44')]['id']}})[_0x466a('0x20')](function(){return _0x5d69cc;});}})[_0x466a('0x20')](respondWithStatusCode(_0x4d3f5f,null))[_0x466a('0x42')](handleError(_0x4d3f5f,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 37df881..28d0fb3 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 _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index de67ffe..df8edfd 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 _0xdb13=['result','catch','GetCampaign','Campaign','findAll','options','raw','attributes','limit','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x433bd8,_0x3f646a){var _0x2c8fbf=function(_0x24fcad){while(--_0x24fcad){_0x433bd8['push'](_0x433bd8['shift']());}};_0x2c8fbf(++_0x3f646a);}(_0xdb13,0x10c));var _0x3db1=function(_0x277b9a,_0x181597){_0x277b9a=_0x277b9a-0x0;var _0x16785f=_0xdb13[_0x277b9a];return _0x16785f;};'use strict';var _=require('lodash');var util=require(_0x3db1('0x0'));var moment=require(_0x3db1('0x1'));var BPromise=require(_0x3db1('0x2'));var rs=require(_0x3db1('0x3'));var fs=require('fs');var Redis=require(_0x3db1('0x4'));var db=require(_0x3db1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3db1('0x6'))(_0x3db1('0x7'));var config=require(_0x3db1('0x8'));var jayson=require(_0x3db1('0x9'));var client=jayson[_0x3db1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37ae52,_0x2e1935,_0x28e7b6){return new BPromise(function(_0x379cfb,_0x22f0c7){return client[_0x3db1('0xb')](_0x37ae52,_0x28e7b6)[_0x3db1('0xc')](function(_0x9a9677){logger[_0x3db1('0xd')](_0x3db1('0xe'),_0x2e1935,_0x3db1('0xf'));logger[_0x3db1('0x10')]('Campaign,\x20%s,\x20%s,\x20%s',_0x2e1935,_0x3db1('0xf'),JSON[_0x3db1('0x11')](_0x9a9677));if(_0x9a9677[_0x3db1('0x12')]){if(_0x9a9677[_0x3db1('0x12')]['code']===0x1f4){logger['error'](_0x3db1('0xe'),_0x2e1935,_0x9a9677[_0x3db1('0x12')][_0x3db1('0x13')]);return _0x22f0c7(_0x9a9677[_0x3db1('0x12')][_0x3db1('0x13')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x2e1935,_0x9a9677['error']['message']);return _0x379cfb(_0x9a9677[_0x3db1('0x12')][_0x3db1('0x13')]);}else{logger[_0x3db1('0xd')](_0x3db1('0xe'),_0x2e1935,_0x3db1('0xf'));_0x379cfb(_0x9a9677[_0x3db1('0x14')]['message']);}})[_0x3db1('0x15')](function(_0x6b8af0){logger['error'](_0x3db1('0xe'),_0x2e1935,_0x6b8af0);_0x22f0c7(_0x6b8af0);});});}exports[_0x3db1('0x16')]=function(_0x549a0e){var _0x26edb2=this;return new Promise(function(_0x5f3203,_0x16d339){return db[_0x3db1('0x17')][_0x3db1('0x18')]({'raw':_0x549a0e[_0x3db1('0x19')]?_0x549a0e['options'][_0x3db1('0x1a')]===undefined?!![]:![]:!![],'where':_0x549a0e[_0x3db1('0x19')]?_0x549a0e[_0x3db1('0x19')]['where']||null:null,'attributes':_0x549a0e[_0x3db1('0x19')]?_0x549a0e[_0x3db1('0x19')][_0x3db1('0x1b')]||null:null,'limit':_0x549a0e[_0x3db1('0x19')]?_0x549a0e[_0x3db1('0x19')][_0x3db1('0x1c')]||null:null,'include':_0x549a0e[_0x3db1('0x19')]?_0x549a0e[_0x3db1('0x19')][_0x3db1('0x1d')]?_[_0x3db1('0x1e')](_0x549a0e[_0x3db1('0x19')][_0x3db1('0x1d')],function(_0x1ee0c6){return{'model':db[_0x1ee0c6[_0x3db1('0x1f')]],'as':_0x1ee0c6['as'],'attributes':_0x1ee0c6[_0x3db1('0x1b')],'include':_0x1ee0c6['include']?_[_0x3db1('0x1e')](_0x1ee0c6[_0x3db1('0x1d')],function(_0x2263c6){return{'model':db[_0x2263c6['model']],'as':_0x2263c6['as'],'attributes':_0x2263c6[_0x3db1('0x1b')],'include':_0x2263c6[_0x3db1('0x1d')]?_[_0x3db1('0x1e')](_0x2263c6[_0x3db1('0x1d')],function(_0x5bd826){return{'model':db[_0x5bd826[_0x3db1('0x1f')]],'as':_0x5bd826['as'],'attributes':_0x5bd826[_0x3db1('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x408d1c){logger[_0x3db1('0xd')](_0x3db1('0x16'),_0x549a0e);logger['debug'](_0x3db1('0x16'),_0x549a0e,JSON[_0x3db1('0x11')](_0x408d1c));_0x5f3203(_0x408d1c);})[_0x3db1('0x15')](function(_0x51ec2f){logger['error'](_0x3db1('0x16'),_0x51ec2f[_0x3db1('0x13')],_0x549a0e);_0x16d339(_0x26edb2['error'](0x1f4,_0x51ec2f['message']));});});};
\ No newline at end of file
+var _0xef38=['include','info','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCampaign','Campaign','findAll','options','raw','attributes','limit','map','model'];(function(_0x2d5116,_0x4a8bb5){var _0x44808d=function(_0x482ed2){while(--_0x482ed2){_0x2d5116['push'](_0x2d5116['shift']());}};_0x44808d(++_0x4a8bb5);}(_0xef38,0x122));var _0x8ef3=function(_0x103b66,_0x483f12){_0x103b66=_0x103b66-0x0;var _0x4e8417=_0xef38[_0x103b66];return _0x4e8417;};'use strict';var _=require('lodash');var util=require(_0x8ef3('0x0'));var moment=require(_0x8ef3('0x1'));var BPromise=require(_0x8ef3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ef3('0x3'))['db'];var utils=require(_0x8ef3('0x4'));var logger=require(_0x8ef3('0x5'))(_0x8ef3('0x6'));var config=require(_0x8ef3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8ef3('0x8')][_0x8ef3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50ee13,_0x2c9ccd,_0x26107d){return new BPromise(function(_0x217874,_0x12b6c0){return client[_0x8ef3('0xa')](_0x50ee13,_0x26107d)[_0x8ef3('0xb')](function(_0xc4b3b3){logger['info'](_0x8ef3('0xc'),_0x2c9ccd,_0x8ef3('0xd'));logger[_0x8ef3('0xe')](_0x8ef3('0xf'),_0x2c9ccd,_0x8ef3('0xd'),JSON[_0x8ef3('0x10')](_0xc4b3b3));if(_0xc4b3b3[_0x8ef3('0x11')]){if(_0xc4b3b3[_0x8ef3('0x11')][_0x8ef3('0x12')]===0x1f4){logger[_0x8ef3('0x11')](_0x8ef3('0xc'),_0x2c9ccd,_0xc4b3b3[_0x8ef3('0x11')][_0x8ef3('0x13')]);return _0x12b6c0(_0xc4b3b3[_0x8ef3('0x11')][_0x8ef3('0x13')]);}logger[_0x8ef3('0x11')](_0x8ef3('0xc'),_0x2c9ccd,_0xc4b3b3[_0x8ef3('0x11')][_0x8ef3('0x13')]);return _0x217874(_0xc4b3b3['error'][_0x8ef3('0x13')]);}else{logger['info'](_0x8ef3('0xc'),_0x2c9ccd,'request\x20sent');_0x217874(_0xc4b3b3[_0x8ef3('0x14')][_0x8ef3('0x13')]);}})['catch'](function(_0x56884c){logger[_0x8ef3('0x11')](_0x8ef3('0xc'),_0x2c9ccd,_0x56884c);_0x12b6c0(_0x56884c);});});}exports[_0x8ef3('0x15')]=function(_0x434aa9){var _0x5296f2=this;return new Promise(function(_0x5cbed2,_0x29025b){return db[_0x8ef3('0x16')][_0x8ef3('0x17')]({'raw':_0x434aa9[_0x8ef3('0x18')]?_0x434aa9['options'][_0x8ef3('0x19')]===undefined?!![]:![]:!![],'where':_0x434aa9[_0x8ef3('0x18')]?_0x434aa9[_0x8ef3('0x18')]['where']||null:null,'attributes':_0x434aa9['options']?_0x434aa9[_0x8ef3('0x18')][_0x8ef3('0x1a')]||null:null,'limit':_0x434aa9[_0x8ef3('0x18')]?_0x434aa9[_0x8ef3('0x18')][_0x8ef3('0x1b')]||null:null,'include':_0x434aa9[_0x8ef3('0x18')]?_0x434aa9[_0x8ef3('0x18')]['include']?_[_0x8ef3('0x1c')](_0x434aa9[_0x8ef3('0x18')]['include'],function(_0xa9829e){return{'model':db[_0xa9829e[_0x8ef3('0x1d')]],'as':_0xa9829e['as'],'attributes':_0xa9829e[_0x8ef3('0x1a')],'include':_0xa9829e[_0x8ef3('0x1e')]?_[_0x8ef3('0x1c')](_0xa9829e['include'],function(_0x18ef45){return{'model':db[_0x18ef45[_0x8ef3('0x1d')]],'as':_0x18ef45['as'],'attributes':_0x18ef45[_0x8ef3('0x1a')],'include':_0x18ef45[_0x8ef3('0x1e')]?_['map'](_0x18ef45[_0x8ef3('0x1e')],function(_0x28637a){return{'model':db[_0x28637a[_0x8ef3('0x1d')]],'as':_0x28637a['as'],'attributes':_0x28637a[_0x8ef3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8ef3('0xb')](function(_0x28748f){logger[_0x8ef3('0x1f')](_0x8ef3('0x15'),_0x434aa9);logger[_0x8ef3('0xe')](_0x8ef3('0x15'),_0x434aa9,JSON[_0x8ef3('0x10')](_0x28748f));_0x5cbed2(_0x28748f);})['catch'](function(_0x4408f9){logger[_0x8ef3('0x11')](_0x8ef3('0x15'),_0x4408f9[_0x8ef3('0x13')],_0x434aa9);_0x29025b(_0x5296f2[_0x8ef3('0x11')](0x1f4,_0x4408f9[_0x8ef3('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 3d96e98..9662af2 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 _0x1ec4=['../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','/:id','delete','destroy','removeLists','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x3a87ef,_0x25aa94){var _0x414ef9=function(_0x5787eb){while(--_0x5787eb){_0x3a87ef['push'](_0x3a87ef['shift']());}};_0x414ef9(++_0x25aa94);}(_0x1ec4,0xef));var _0x41ec=function(_0x23661c,_0x2cd175){_0x23661c=_0x23661c-0x0;var _0x4295c1=_0x1ec4[_0x23661c];return _0x4295c1;};'use strict';var multer=require(_0x41ec('0x0'));var util=require(_0x41ec('0x1'));var path=require(_0x41ec('0x2'));var timeout=require('connect-timeout');var express=require(_0x41ec('0x3'));var router=express[_0x41ec('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x41ec('0x5'));var interaction=require(_0x41ec('0x6'));var config=require(_0x41ec('0x7'));var controller=require(_0x41ec('0x8'));router[_0x41ec('0x9')]('/',auth[_0x41ec('0xa')](),controller[_0x41ec('0xb')]);router[_0x41ec('0x9')]('/:id',auth[_0x41ec('0xa')](),controller[_0x41ec('0xc')]);router['get'](_0x41ec('0xd'),auth[_0x41ec('0xa')](),controller[_0x41ec('0xe')]);router[_0x41ec('0x9')](_0x41ec('0xf'),auth[_0x41ec('0xa')](),controller[_0x41ec('0x10')]);router[_0x41ec('0x9')](_0x41ec('0x11'),auth[_0x41ec('0xa')](),controller[_0x41ec('0x12')]);router[_0x41ec('0x9')]('/:id/hopper_black',auth[_0x41ec('0xa')](),controller['getHopperBlacks']);router[_0x41ec('0x9')](_0x41ec('0x13'),auth[_0x41ec('0xa')](),controller[_0x41ec('0x14')]);router[_0x41ec('0x9')](_0x41ec('0x15'),auth[_0x41ec('0xa')](),controller[_0x41ec('0x16')]);router[_0x41ec('0x17')]('/',auth['isAuthenticated'](),controller[_0x41ec('0x18')]);router[_0x41ec('0x17')](_0x41ec('0x19'),auth[_0x41ec('0xa')](),controller[_0x41ec('0x1a')]);router[_0x41ec('0x17')](_0x41ec('0x13'),auth[_0x41ec('0xa')](),controller[_0x41ec('0x1b')]);router[_0x41ec('0x17')]('/:id/blacklists',auth[_0x41ec('0xa')](),controller[_0x41ec('0x1c')]);router[_0x41ec('0x1d')](_0x41ec('0x1e'),auth[_0x41ec('0xa')](),controller['update']);router[_0x41ec('0x1f')]('/:id',auth[_0x41ec('0xa')](),controller[_0x41ec('0x20')]);router['delete'](_0x41ec('0x13'),auth[_0x41ec('0xa')](),controller[_0x41ec('0x21')]);router[_0x41ec('0x1f')](_0x41ec('0x15'),auth[_0x41ec('0xa')](),controller['removeBlackLists']);module[_0x41ec('0x22')]=router;
\ No newline at end of file
+var _0x569b=['getHoppers','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addBlackLists','put','update','destroy','delete','removeLists','removeBlackLists','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x569b,0x173));var _0xb569=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x569b[_0x2c7618];return _0x5ce3f0;};'use strict';var multer=require(_0xb569('0x0'));var util=require(_0xb569('0x1'));var path=require('path');var timeout=require(_0xb569('0x2'));var express=require(_0xb569('0x3'));var router=express[_0xb569('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb569('0x5'));var interaction=require(_0xb569('0x6'));var config=require('../../config/environment');var controller=require(_0xb569('0x7'));router[_0xb569('0x8')]('/',auth[_0xb569('0x9')](),controller['index']);router[_0xb569('0x8')](_0xb569('0xa'),auth[_0xb569('0x9')](),controller[_0xb569('0xb')]);router['get'](_0xb569('0xc'),auth['isAuthenticated'](),controller[_0xb569('0xd')]);router[_0xb569('0x8')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0xb569('0xe')]);router[_0xb569('0x8')](_0xb569('0xf'),auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0xb569('0x10'),auth[_0xb569('0x9')](),controller[_0xb569('0x11')]);router[_0xb569('0x8')](_0xb569('0x12'),auth[_0xb569('0x9')](),controller[_0xb569('0x13')]);router['get'](_0xb569('0x14'),auth[_0xb569('0x9')](),controller[_0xb569('0x15')]);router[_0xb569('0x16')]('/',auth['isAuthenticated'](),controller[_0xb569('0x17')]);router[_0xb569('0x16')](_0xb569('0x18'),auth[_0xb569('0x9')](),controller['clone']);router['post']('/:id/lists',auth[_0xb569('0x9')](),controller['addLists']);router[_0xb569('0x16')](_0xb569('0x14'),auth['isAuthenticated'](),controller[_0xb569('0x19')]);router[_0xb569('0x1a')](_0xb569('0xa'),auth[_0xb569('0x9')](),controller[_0xb569('0x1b')]);router['delete'](_0xb569('0xa'),auth[_0xb569('0x9')](),controller[_0xb569('0x1c')]);router[_0xb569('0x1d')](_0xb569('0x12'),auth[_0xb569('0x9')](),controller[_0xb569('0x1e')]);router[_0xb569('0x1d')](_0xb569('0x14'),auth[_0xb569('0x9')](),controller[_0xb569('0x1f')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 6c124a9..48d98da 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 _0x80ea=['sequelize','TEXT','VIRTUAL','getDataValue','key'];(function(_0x451563,_0x1d02c6){var _0x1bff88=function(_0x4bcb4b){while(--_0x4bcb4b){_0x451563['push'](_0x451563['shift']());}};_0x1bff88(++_0x1d02c6);}(_0x80ea,0x127));var _0xa80e=function(_0x54a225,_0x512d8e){_0x54a225=_0x54a225-0x0;var _0x7451ec=_0x80ea[_0x54a225];return _0x7451ec;};'use strict';var Sequelize=require(_0xa80e('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xa80e('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xa80e('0x2')],'get':function(){return this[_0xa80e('0x3')](_0xa80e('0x4'));}}};
\ No newline at end of file
+var _0x8bc3=['getDataValue','key','STRING'];(function(_0x4bcd88,_0x36dc32){var _0x19b254=function(_0x1f7acf){while(--_0x1f7acf){_0x4bcd88['push'](_0x4bcd88['shift']());}};_0x19b254(++_0x36dc32);}(_0x8bc3,0x1a6));var _0x38bc=function(_0x448255,_0x2e681d){_0x448255=_0x448255-0x0;var _0x55d7ec=_0x8bc3[_0x448255];return _0x55d7ec;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x38bc('0x0')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x38bc('0x0')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x38bc('0x1')](_0x38bc('0x2'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index d4fed5e..8d4ce40 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 _0xd0c4=['sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','error','name','send','index','map','CannedAnswer','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order'];(function(_0x106b83,_0x5dc565){var _0x207ed4=function(_0x37ceb1){while(--_0x37ceb1){_0x106b83['push'](_0x106b83['shift']());}};_0x207ed4(++_0x5dc565);}(_0xd0c4,0x6f));var _0x4d0c=function(_0x334201,_0x39f06f){_0x334201=_0x334201-0x0;var _0x134700=_0xd0c4[_0x334201];return _0x134700;};'use strict';var emlformat=require(_0x4d0c('0x0'));var rimraf=require(_0x4d0c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4d0c('0x2'));var moment=require('moment');var BPromise=require(_0x4d0c('0x3'));var Mustache=require(_0x4d0c('0x4'));var util=require(_0x4d0c('0x5'));var path=require(_0x4d0c('0x6'));var sox=require(_0x4d0c('0x7'));var csv=require(_0x4d0c('0x8'));var ejs=require(_0x4d0c('0x9'));var fs=require('fs');var fs_extra=require(_0x4d0c('0xa'));var _=require(_0x4d0c('0xb'));var squel=require(_0x4d0c('0xc'));var crypto=require(_0x4d0c('0xd'));var jsforce=require(_0x4d0c('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4d0c('0xf'));var Papa=require(_0x4d0c('0x10'));var Redis=require(_0x4d0c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4d0c('0x12'));var as=require(_0x4d0c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d0c('0x14'))('api');var utils=require(_0x4d0c('0x15'));var config=require(_0x4d0c('0x16'));var licenseUtil=require(_0x4d0c('0x17'));var db=require(_0x4d0c('0x18'))['db'];function respondWithStatusCode(_0x5286f9,_0x504839){_0x504839=_0x504839||0xcc;return function(_0x5592ad){if(_0x5592ad){return _0x5286f9[_0x4d0c('0x19')](_0x504839);}return _0x5286f9[_0x4d0c('0x1a')](_0x504839)[_0x4d0c('0x1b')]();};}function respondWithResult(_0x396de2,_0x3184b3){_0x3184b3=_0x3184b3||0xc8;return function(_0x186a42){if(_0x186a42){return _0x396de2['status'](_0x3184b3)[_0x4d0c('0x1c')](_0x186a42);}};}function respondWithFilteredResult(_0x26fc71,_0x2ff89d){return function(_0x2aa781){if(_0x2aa781){var _0x188451=typeof _0x2ff89d[_0x4d0c('0x1d')]===_0x4d0c('0x1e')&&typeof _0x2ff89d[_0x4d0c('0x1f')]==='undefined';var _0x164a34=_0x2aa781[_0x4d0c('0x20')];var _0x2617c2=_0x188451?0x0:_0x2ff89d['offset'];var _0x4f2b5f=_0x188451?_0x2aa781[_0x4d0c('0x20')]:_0x2ff89d[_0x4d0c('0x1d')]+_0x2ff89d[_0x4d0c('0x1f')];var _0x13f115;if(_0x4f2b5f>=_0x164a34){_0x4f2b5f=_0x164a34;_0x13f115=0xc8;}else{_0x13f115=0xce;}_0x26fc71['status'](_0x13f115);return _0x26fc71['set'](_0x4d0c('0x21'),_0x2617c2+'-'+_0x4f2b5f+'/'+_0x164a34)[_0x4d0c('0x1c')](_0x2aa781);}return null;};}function patchUpdates(_0x29ba80){return function(_0x54f61e){try{jsonpatch[_0x4d0c('0x22')](_0x54f61e,_0x29ba80,!![]);}catch(_0x5d60c4){return BPromise['reject'](_0x5d60c4);}return _0x54f61e[_0x4d0c('0x23')]();};}function saveUpdates(_0xe5bdaa,_0x3fc636){return function(_0x2b16f0){if(_0x2b16f0){return _0x2b16f0[_0x4d0c('0x24')](_0xe5bdaa)[_0x4d0c('0x25')](function(_0x5b91f9){return _0x5b91f9;});}return null;};}function removeEntity(_0x442d56,_0x14839d){return function(_0x51672){if(_0x51672){return _0x51672['destroy']()[_0x4d0c('0x25')](function(){var _0x4f343c=_0x51672[_0x4d0c('0x26')]({'plain':!![]});var _0x3b4939='CannedAnswers';return db[_0x4d0c('0x27')][_0x4d0c('0x28')]({'where':{'type':_0x3b4939,'resourceId':_0x4f343c['id']}})[_0x4d0c('0x25')](function(){return _0x51672;});})[_0x4d0c('0x25')](function(){_0x442d56[_0x4d0c('0x1a')](0xcc)[_0x4d0c('0x1b')]();});}};}function handleEntityNotFound(_0x49ae94,_0x28edba){return function(_0x532351){if(!_0x532351){_0x49ae94[_0x4d0c('0x19')](0x194);}return _0x532351;};}function handleError(_0x488b49,_0x40257c){_0x40257c=_0x40257c||0x1f4;return function(_0x1e3c9d){logger[_0x4d0c('0x29')](_0x1e3c9d['stack']);if(_0x1e3c9d[_0x4d0c('0x2a')]){delete _0x1e3c9d[_0x4d0c('0x2a')];}_0x488b49['status'](_0x40257c)[_0x4d0c('0x2b')](_0x1e3c9d);};}exports[_0x4d0c('0x2c')]=function(_0x3f84db,_0x51b3b9){var _0x10dff8={},_0x4a0b22={},_0x488632={'count':0x0,'rows':[]};var _0x22de60=_[_0x4d0c('0x2d')](db[_0x4d0c('0x2e')][_0x4d0c('0x2f')],function(_0x1ec0f2){return{'name':_0x1ec0f2['fieldName'],'type':_0x1ec0f2['type'][_0x4d0c('0x30')]};});_0x4a0b22[_0x4d0c('0x31')]=_[_0x4d0c('0x2d')](_0x22de60,_0x4d0c('0x2a'));_0x4a0b22[_0x4d0c('0x32')]=_[_0x4d0c('0x33')](_0x3f84db[_0x4d0c('0x32')]);_0x4a0b22[_0x4d0c('0x34')]=_[_0x4d0c('0x35')](_0x4a0b22[_0x4d0c('0x31')],_0x4a0b22[_0x4d0c('0x32')]);_0x10dff8[_0x4d0c('0x36')]=_[_0x4d0c('0x35')](_0x4a0b22[_0x4d0c('0x31')],qs[_0x4d0c('0x37')](_0x3f84db['query']['fields']));_0x10dff8['attributes']=_0x10dff8['attributes'][_0x4d0c('0x38')]?_0x10dff8[_0x4d0c('0x36')]:_0x4a0b22[_0x4d0c('0x31')];if(!_0x3f84db['query']['hasOwnProperty'](_0x4d0c('0x39'))){_0x10dff8[_0x4d0c('0x1f')]=qs['limit'](_0x3f84db[_0x4d0c('0x32')]['limit']);_0x10dff8[_0x4d0c('0x1d')]=qs[_0x4d0c('0x1d')](_0x3f84db['query']['offset']);}_0x10dff8[_0x4d0c('0x3a')]=qs[_0x4d0c('0x3b')](_0x3f84db[_0x4d0c('0x32')][_0x4d0c('0x3b')]);_0x10dff8[_0x4d0c('0x3c')]=qs[_0x4d0c('0x34')](_[_0x4d0c('0x3d')](_0x3f84db['query'],_0x4a0b22[_0x4d0c('0x34')]),_0x22de60);if(_0x3f84db['query'][_0x4d0c('0x3e')]){_0x10dff8[_0x4d0c('0x3c')]=_[_0x4d0c('0x3f')](_0x10dff8[_0x4d0c('0x3c')],{'$or':[{'key':{'$like':'%'+_0x3f84db[_0x4d0c('0x32')][_0x4d0c('0x3e')]+'%'}},{'value':{'$like':'%'+_0x3f84db[_0x4d0c('0x32')][_0x4d0c('0x3e')]+'%'}}]});}_0x10dff8=_[_0x4d0c('0x3f')]({},_0x10dff8,_0x3f84db[_0x4d0c('0x40')]);var _0x452519={'where':_0x10dff8[_0x4d0c('0x3c')]};return db['CannedAnswer'][_0x4d0c('0x20')](_0x452519)[_0x4d0c('0x25')](function(_0x3ed847){_0x488632[_0x4d0c('0x20')]=_0x3ed847;if(_0x3f84db['query'][_0x4d0c('0x41')]){_0x10dff8[_0x4d0c('0x42')]=[{'all':!![]}];}return db['CannedAnswer'][_0x4d0c('0x43')](_0x10dff8);})[_0x4d0c('0x25')](function(_0x3f9fd6){_0x488632['rows']=_0x3f9fd6;return _0x488632;})[_0x4d0c('0x25')](respondWithFilteredResult(_0x51b3b9,_0x10dff8))[_0x4d0c('0x44')](handleError(_0x51b3b9,null));};exports[_0x4d0c('0x45')]=function(_0x433394,_0x538811){var _0x3ce858={'raw':!![],'where':{'id':_0x433394[_0x4d0c('0x46')]['id']}},_0x471ddc={};_0x471ddc[_0x4d0c('0x31')]=_[_0x4d0c('0x33')](db[_0x4d0c('0x2e')]['rawAttributes']);_0x471ddc['query']=_[_0x4d0c('0x33')](_0x433394[_0x4d0c('0x32')]);_0x471ddc['filters']=_[_0x4d0c('0x35')](_0x471ddc['model'],_0x471ddc['query']);_0x3ce858[_0x4d0c('0x36')]=_['intersection'](_0x471ddc[_0x4d0c('0x31')],qs[_0x4d0c('0x37')](_0x433394[_0x4d0c('0x32')][_0x4d0c('0x37')]));_0x3ce858[_0x4d0c('0x36')]=_0x3ce858[_0x4d0c('0x36')][_0x4d0c('0x38')]?_0x3ce858[_0x4d0c('0x36')]:_0x471ddc['model'];if(_0x433394[_0x4d0c('0x32')]['includeAll']){_0x3ce858[_0x4d0c('0x42')]=[{'all':!![]}];}_0x3ce858=_[_0x4d0c('0x3f')]({},_0x3ce858,_0x433394[_0x4d0c('0x40')]);return db[_0x4d0c('0x2e')][_0x4d0c('0x47')](_0x3ce858)[_0x4d0c('0x25')](handleEntityNotFound(_0x538811,null))[_0x4d0c('0x25')](respondWithResult(_0x538811,null))[_0x4d0c('0x44')](handleError(_0x538811,null));};exports['update']=function(_0x47481a,_0x672106){if(_0x47481a['body']['id']){delete _0x47481a[_0x4d0c('0x48')]['id'];}return db[_0x4d0c('0x2e')][_0x4d0c('0x47')]({'where':{'id':_0x47481a[_0x4d0c('0x46')]['id']}})[_0x4d0c('0x25')](handleEntityNotFound(_0x672106,null))['then'](saveUpdates(_0x47481a['body'],null))[_0x4d0c('0x25')](respondWithResult(_0x672106,null))[_0x4d0c('0x44')](handleError(_0x672106,null));};exports[_0x4d0c('0x28')]=function(_0x589942,_0x3cb6fa){return db[_0x4d0c('0x2e')][_0x4d0c('0x47')]({'where':{'id':_0x589942[_0x4d0c('0x46')]['id']}})[_0x4d0c('0x25')](handleEntityNotFound(_0x3cb6fa,null))[_0x4d0c('0x25')](removeEntity(_0x3cb6fa,null))[_0x4d0c('0x44')](handleError(_0x3cb6fa,null));};exports[_0x4d0c('0x49')]=function(_0x43e5da,_0x597996){var _0x2830a3={'key':_0x43e5da[_0x4d0c('0x48')][_0x4d0c('0x30')]};if(_0x43e5da['body']['MailAccountId']){_0x2830a3[_0x4d0c('0x4a')]=_0x43e5da[_0x4d0c('0x48')]['MailAccountId'];}else if(_0x43e5da['body']['SmsAccountId']){_0x2830a3['SmsAccountId']=_0x43e5da[_0x4d0c('0x48')][_0x4d0c('0x4b')];}else if(_0x43e5da[_0x4d0c('0x48')][_0x4d0c('0x4c')]){_0x2830a3[_0x4d0c('0x4c')]=_0x43e5da[_0x4d0c('0x48')]['OpenchannelAccountId'];}else if(_0x43e5da[_0x4d0c('0x48')]['ChatWebsiteId']){_0x2830a3[_0x4d0c('0x4d')]=_0x43e5da[_0x4d0c('0x48')][_0x4d0c('0x4d')];}return db[_0x4d0c('0x2e')]['find']({'where':_0x2830a3})[_0x4d0c('0x25')](function(_0xcdf751){if(_0xcdf751){throw new db[(_0x4d0c('0x4e'))][(_0x4d0c('0x4f'))](_0x4d0c('0x50'));}return db[_0x4d0c('0x2e')][_0x4d0c('0x49')](_0x43e5da[_0x4d0c('0x48')]);})[_0x4d0c('0x25')](function(_0x133a92){var _0x1161b7=_0x43e5da[_0x4d0c('0x51')][_0x4d0c('0x26')]({'plain':!![]});if(!_0x1161b7)throw new Error(_0x4d0c('0x52'));if(_0x1161b7['role']===_0x4d0c('0x51')){var _0x33240c=_0x133a92[_0x4d0c('0x26')]({'plain':!![]});return db['UserProfileSection'][_0x4d0c('0x47')]({'where':{'name':'CannedAnswers','userProfileId':_0x1161b7['userProfileId']},'raw':!![]})['then'](function(_0x22fb1d){if(_0x22fb1d&&_0x22fb1d[_0x4d0c('0x53')]===0x0){return db[_0x4d0c('0x27')][_0x4d0c('0x49')]({'name':_0x33240c[_0x4d0c('0x2a')],'resourceId':_0x33240c['id'],'type':_0x22fb1d[_0x4d0c('0x2a')],'sectionId':_0x22fb1d['id']},{})[_0x4d0c('0x25')](function(){return _0x133a92;});}else{return _0x133a92;}})[_0x4d0c('0x44')](function(_0x2ec6f4){logger[_0x4d0c('0x29')](_0x4d0c('0x54'),_0x2ec6f4);throw _0x2ec6f4;});}return _0x133a92;})[_0x4d0c('0x25')](respondWithResult(_0x597996,0xc9))['catch'](handleError(_0x597996,null));};
\ No newline at end of file
+var _0xde49=['filters','intersection','attributes','model','length','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','fields','catch','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','lodash','squel','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','sendStatus','end','status','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','query','keys'];(function(_0x34eb31,_0x8f0f70){var _0x254994=function(_0xbec9a3){while(--_0xbec9a3){_0x34eb31['push'](_0x34eb31['shift']());}};_0x254994(++_0x8f0f70);}(_0xde49,0x1f1));var _0x9de4=function(_0x2293cf,_0x4747ac){_0x2293cf=_0x2293cf-0x0;var _0x14f93f=_0xde49[_0x2293cf];return _0x14f93f;};'use strict';var emlformat=require(_0x9de4('0x0'));var rimraf=require(_0x9de4('0x1'));var zipdir=require(_0x9de4('0x2'));var jsonpatch=require(_0x9de4('0x3'));var rp=require(_0x9de4('0x4'));var moment=require(_0x9de4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x9de4('0x6'));var sox=require(_0x9de4('0x7'));var csv=require(_0x9de4('0x8'));var ejs=require(_0x9de4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9de4('0xa'));var squel=require(_0x9de4('0xb'));var crypto=require(_0x9de4('0xc'));var jsforce=require(_0x9de4('0xd'));var deskjs=require(_0x9de4('0xe'));var toCsv=require(_0x9de4('0x8'));var querystring=require(_0x9de4('0xf'));var Papa=require(_0x9de4('0x10'));var Redis=require(_0x9de4('0x11'));var authService=require(_0x9de4('0x12'));var qs=require(_0x9de4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9de4('0x14'));var logger=require(_0x9de4('0x15'))('api');var utils=require(_0x9de4('0x16'));var config=require(_0x9de4('0x17'));var licenseUtil=require(_0x9de4('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7ca7aa,_0x3a1bd3){_0x3a1bd3=_0x3a1bd3||0xcc;return function(_0x1cdb4b){if(_0x1cdb4b){return _0x7ca7aa[_0x9de4('0x19')](_0x3a1bd3);}return _0x7ca7aa['status'](_0x3a1bd3)[_0x9de4('0x1a')]();};}function respondWithResult(_0x1ec39b,_0x315ba3){_0x315ba3=_0x315ba3||0xc8;return function(_0x5f64f8){if(_0x5f64f8){return _0x1ec39b[_0x9de4('0x1b')](_0x315ba3)[_0x9de4('0x1c')](_0x5f64f8);}};}function respondWithFilteredResult(_0xb75ff7,_0x15d96f){return function(_0x20ed3f){if(_0x20ed3f){var _0x3fce8a=typeof _0x15d96f[_0x9de4('0x1d')]==='undefined'&&typeof _0x15d96f[_0x9de4('0x1e')]==='undefined';var _0x203a34=_0x20ed3f[_0x9de4('0x1f')];var _0x32d8ed=_0x3fce8a?0x0:_0x15d96f['offset'];var _0x167f04=_0x3fce8a?_0x20ed3f[_0x9de4('0x1f')]:_0x15d96f[_0x9de4('0x1d')]+_0x15d96f[_0x9de4('0x1e')];var _0x57fcaa;if(_0x167f04>=_0x203a34){_0x167f04=_0x203a34;_0x57fcaa=0xc8;}else{_0x57fcaa=0xce;}_0xb75ff7['status'](_0x57fcaa);return _0xb75ff7['set'](_0x9de4('0x20'),_0x32d8ed+'-'+_0x167f04+'/'+_0x203a34)[_0x9de4('0x1c')](_0x20ed3f);}return null;};}function patchUpdates(_0x4f0472){return function(_0x15ced7){try{jsonpatch[_0x9de4('0x21')](_0x15ced7,_0x4f0472,!![]);}catch(_0x1cc0d9){return BPromise[_0x9de4('0x22')](_0x1cc0d9);}return _0x15ced7[_0x9de4('0x23')]();};}function saveUpdates(_0x504c4b,_0x518448){return function(_0x1444ea){if(_0x1444ea){return _0x1444ea[_0x9de4('0x24')](_0x504c4b)[_0x9de4('0x25')](function(_0x5d6a55){return _0x5d6a55;});}return null;};}function removeEntity(_0x26e834,_0x3f3de8){return function(_0x3819b0){if(_0x3819b0){return _0x3819b0[_0x9de4('0x26')]()['then'](function(){var _0x182a1e=_0x3819b0[_0x9de4('0x27')]({'plain':!![]});var _0x2e626a=_0x9de4('0x28');return db[_0x9de4('0x29')][_0x9de4('0x26')]({'where':{'type':_0x2e626a,'resourceId':_0x182a1e['id']}})['then'](function(){return _0x3819b0;});})[_0x9de4('0x25')](function(){_0x26e834[_0x9de4('0x1b')](0xcc)[_0x9de4('0x1a')]();});}};}function handleEntityNotFound(_0x589f22,_0xf9c205){return function(_0x76e5f7){if(!_0x76e5f7){_0x589f22['sendStatus'](0x194);}return _0x76e5f7;};}function handleError(_0x2d9fa9,_0x3bcd01){_0x3bcd01=_0x3bcd01||0x1f4;return function(_0x1bfcfd){logger[_0x9de4('0x2a')](_0x1bfcfd[_0x9de4('0x2b')]);if(_0x1bfcfd['name']){delete _0x1bfcfd[_0x9de4('0x2c')];}_0x2d9fa9[_0x9de4('0x1b')](_0x3bcd01)[_0x9de4('0x2d')](_0x1bfcfd);};}exports[_0x9de4('0x2e')]=function(_0x413816,_0x553f81){var _0x351378={},_0x1474c8={},_0x257f6d={'count':0x0,'rows':[]};var _0xca76d5=_[_0x9de4('0x2f')](db[_0x9de4('0x30')][_0x9de4('0x31')],function(_0x39267b){return{'name':_0x39267b[_0x9de4('0x32')],'type':_0x39267b[_0x9de4('0x33')][_0x9de4('0x34')]};});_0x1474c8['model']=_[_0x9de4('0x2f')](_0xca76d5,_0x9de4('0x2c'));_0x1474c8[_0x9de4('0x35')]=_[_0x9de4('0x36')](_0x413816['query']);_0x1474c8[_0x9de4('0x37')]=_[_0x9de4('0x38')](_0x1474c8['model'],_0x1474c8['query']);_0x351378[_0x9de4('0x39')]=_[_0x9de4('0x38')](_0x1474c8[_0x9de4('0x3a')],qs['fields'](_0x413816[_0x9de4('0x35')]['fields']));_0x351378[_0x9de4('0x39')]=_0x351378['attributes'][_0x9de4('0x3b')]?_0x351378[_0x9de4('0x39')]:_0x1474c8['model'];if(!_0x413816['query']['hasOwnProperty'](_0x9de4('0x3c'))){_0x351378[_0x9de4('0x1e')]=qs['limit'](_0x413816[_0x9de4('0x35')]['limit']);_0x351378[_0x9de4('0x1d')]=qs[_0x9de4('0x1d')](_0x413816[_0x9de4('0x35')][_0x9de4('0x1d')]);}_0x351378[_0x9de4('0x3d')]=qs['sort'](_0x413816['query'][_0x9de4('0x3e')]);_0x351378[_0x9de4('0x3f')]=qs['filters'](_[_0x9de4('0x40')](_0x413816['query'],_0x1474c8[_0x9de4('0x37')]),_0xca76d5);if(_0x413816['query']['filter']){_0x351378[_0x9de4('0x3f')]=_[_0x9de4('0x41')](_0x351378['where'],{'$or':[{'key':{'$like':'%'+_0x413816[_0x9de4('0x35')][_0x9de4('0x42')]+'%'}},{'value':{'$like':'%'+_0x413816['query']['filter']+'%'}}]});}_0x351378=_[_0x9de4('0x41')]({},_0x351378,_0x413816[_0x9de4('0x43')]);var _0x4cbd21={'where':_0x351378[_0x9de4('0x3f')]};return db[_0x9de4('0x30')][_0x9de4('0x1f')](_0x4cbd21)[_0x9de4('0x25')](function(_0x5292f8){_0x257f6d[_0x9de4('0x1f')]=_0x5292f8;if(_0x413816[_0x9de4('0x35')][_0x9de4('0x44')]){_0x351378[_0x9de4('0x45')]=[{'all':!![]}];}return db[_0x9de4('0x30')][_0x9de4('0x46')](_0x351378);})[_0x9de4('0x25')](function(_0x458077){_0x257f6d[_0x9de4('0x47')]=_0x458077;return _0x257f6d;})[_0x9de4('0x25')](respondWithFilteredResult(_0x553f81,_0x351378))['catch'](handleError(_0x553f81,null));};exports[_0x9de4('0x48')]=function(_0x7b758b,_0x2ab672){var _0x57fed0={'raw':!![],'where':{'id':_0x7b758b[_0x9de4('0x49')]['id']}},_0x4b61cd={};_0x4b61cd[_0x9de4('0x3a')]=_[_0x9de4('0x36')](db[_0x9de4('0x30')][_0x9de4('0x31')]);_0x4b61cd[_0x9de4('0x35')]=_[_0x9de4('0x36')](_0x7b758b[_0x9de4('0x35')]);_0x4b61cd[_0x9de4('0x37')]=_[_0x9de4('0x38')](_0x4b61cd[_0x9de4('0x3a')],_0x4b61cd[_0x9de4('0x35')]);_0x57fed0[_0x9de4('0x39')]=_[_0x9de4('0x38')](_0x4b61cd[_0x9de4('0x3a')],qs['fields'](_0x7b758b[_0x9de4('0x35')][_0x9de4('0x4a')]));_0x57fed0[_0x9de4('0x39')]=_0x57fed0[_0x9de4('0x39')][_0x9de4('0x3b')]?_0x57fed0[_0x9de4('0x39')]:_0x4b61cd[_0x9de4('0x3a')];if(_0x7b758b[_0x9de4('0x35')][_0x9de4('0x44')]){_0x57fed0[_0x9de4('0x45')]=[{'all':!![]}];}_0x57fed0=_[_0x9de4('0x41')]({},_0x57fed0,_0x7b758b[_0x9de4('0x43')]);return db[_0x9de4('0x30')]['find'](_0x57fed0)[_0x9de4('0x25')](handleEntityNotFound(_0x2ab672,null))[_0x9de4('0x25')](respondWithResult(_0x2ab672,null))[_0x9de4('0x4b')](handleError(_0x2ab672,null));};exports['update']=function(_0x152760,_0x2cd163){if(_0x152760[_0x9de4('0x4c')]['id']){delete _0x152760[_0x9de4('0x4c')]['id'];}return db[_0x9de4('0x30')][_0x9de4('0x4d')]({'where':{'id':_0x152760[_0x9de4('0x49')]['id']}})[_0x9de4('0x25')](handleEntityNotFound(_0x2cd163,null))[_0x9de4('0x25')](saveUpdates(_0x152760[_0x9de4('0x4c')],null))[_0x9de4('0x25')](respondWithResult(_0x2cd163,null))['catch'](handleError(_0x2cd163,null));};exports[_0x9de4('0x26')]=function(_0x4400f0,_0x487a1a){return db[_0x9de4('0x30')][_0x9de4('0x4d')]({'where':{'id':_0x4400f0[_0x9de4('0x49')]['id']}})['then'](handleEntityNotFound(_0x487a1a,null))[_0x9de4('0x25')](removeEntity(_0x487a1a,null))[_0x9de4('0x4b')](handleError(_0x487a1a,null));};exports[_0x9de4('0x4e')]=function(_0x540dd8,_0x355d4f){var _0x56f202={'key':_0x540dd8[_0x9de4('0x4c')][_0x9de4('0x34')]};if(_0x540dd8[_0x9de4('0x4c')][_0x9de4('0x4f')]){_0x56f202[_0x9de4('0x4f')]=_0x540dd8['body']['MailAccountId'];}else if(_0x540dd8['body'][_0x9de4('0x50')]){_0x56f202['SmsAccountId']=_0x540dd8[_0x9de4('0x4c')][_0x9de4('0x50')];}else if(_0x540dd8[_0x9de4('0x4c')][_0x9de4('0x51')]){_0x56f202['OpenchannelAccountId']=_0x540dd8[_0x9de4('0x4c')][_0x9de4('0x51')];}else if(_0x540dd8[_0x9de4('0x4c')][_0x9de4('0x52')]){_0x56f202['ChatWebsiteId']=_0x540dd8[_0x9de4('0x4c')][_0x9de4('0x52')];}return db[_0x9de4('0x30')][_0x9de4('0x4d')]({'where':_0x56f202})[_0x9de4('0x25')](function(_0x20e9d2){if(_0x20e9d2){throw new db[(_0x9de4('0x53'))][(_0x9de4('0x54'))](_0x9de4('0x55'));}return db['CannedAnswer']['create'](_0x540dd8['body']);})['then'](function(_0x418bbc){var _0x462536=_0x540dd8[_0x9de4('0x56')]['get']({'plain':!![]});if(!_0x462536)throw new Error(_0x9de4('0x57'));if(_0x462536[_0x9de4('0x58')]===_0x9de4('0x56')){var _0x120f26=_0x418bbc[_0x9de4('0x27')]({'plain':!![]});return db[_0x9de4('0x59')][_0x9de4('0x4d')]({'where':{'name':'CannedAnswers','userProfileId':_0x462536[_0x9de4('0x5a')]},'raw':!![]})[_0x9de4('0x25')](function(_0x539437){if(_0x539437&&_0x539437['autoAssociation']===0x0){return db[_0x9de4('0x29')][_0x9de4('0x4e')]({'name':_0x120f26['name'],'resourceId':_0x120f26['id'],'type':_0x539437[_0x9de4('0x2c')],'sectionId':_0x539437['id']},{})[_0x9de4('0x25')](function(){return _0x418bbc;});}else{return _0x418bbc;}})[_0x9de4('0x4b')](function(_0x53015d){logger[_0x9de4('0x2a')](_0x9de4('0x5b'),_0x53015d);throw _0x53015d;});}return _0x418bbc;})['then'](respondWithResult(_0x355d4f,0xc9))[_0x9de4('0x4b')](handleError(_0x355d4f,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index b26c348..c512e4e 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 _0x9931=['define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','./cannedAnswer.attributes'];(function(_0x1b026e,_0x1a7ec0){var _0x5bb7d8=function(_0x3207e4){while(--_0x3207e4){_0x1b026e['push'](_0x1b026e['shift']());}};_0x5bb7d8(++_0x1a7ec0);}(_0x9931,0x116));var _0x1993=function(_0x37b6bb,_0x47d128){_0x37b6bb=_0x37b6bb-0x0;var _0x7fc3b7=_0x9931[_0x37b6bb];return _0x7fc3b7;};'use strict';var _=require('lodash');var util=require(_0x1993('0x0'));var logger=require(_0x1993('0x1'))(_0x1993('0x2'));var moment=require(_0x1993('0x3'));var BPromise=require(_0x1993('0x4'));var rp=require(_0x1993('0x5'));var fs=require('fs');var path=require(_0x1993('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1993('0x7'));module['exports']=function(_0x5940ce,_0x432da3){return _0x5940ce[_0x1993('0x8')](_0x1993('0x9'),attributes,{'tableName':_0x1993('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1993('0xb'),'collate':_0x1993('0xc')});};
\ No newline at end of file
+var _0xeaa7=['request-promise','exports','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird'];(function(_0x398175,_0x363721){var _0x7cb4fc=function(_0x454fd4){while(--_0x454fd4){_0x398175['push'](_0x398175['shift']());}};_0x7cb4fc(++_0x363721);}(_0xeaa7,0x13a));var _0x7eaa=function(_0x11a55c,_0x4eced9){_0x11a55c=_0x11a55c-0x0;var _0x26c390=_0xeaa7[_0x11a55c];return _0x26c390;};'use strict';var _=require('lodash');var util=require(_0x7eaa('0x0'));var logger=require(_0x7eaa('0x1'))(_0x7eaa('0x2'));var moment=require(_0x7eaa('0x3'));var BPromise=require(_0x7eaa('0x4'));var rp=require(_0x7eaa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0x7eaa('0x6')]=function(_0x21ce95,_0x3f0a3e){return _0x21ce95[_0x7eaa('0x7')](_0x7eaa('0x8'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7eaa('0x9'),'collate':_0x7eaa('0xa')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 3ea22e9..3891807 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(_0x2cb678,_0x1e099a){var _0x9116bf=function(_0x3ff8c5){while(--_0x3ff8c5){_0x2cb678['push'](_0x2cb678['shift']());}};_0x9116bf(++_0x1e099a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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(_0x227a73,_0xb55b36){var _0x99dc57=function(_0x14ffa3){while(--_0x14ffa3){_0x227a73['push'](_0x227a73['shift']());}};_0x99dc57(++_0xb55b36);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 2a21f49..1a8e836 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 _0x8dc7=['get','index','isAuthenticated','show','post','put','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../config/environment','./cannedAnswer.controller'];(function(_0x50619a,_0x325b23){var _0x1364cc=function(_0x500412){while(--_0x500412){_0x50619a['push'](_0x50619a['shift']());}};_0x1364cc(++_0x325b23);}(_0x8dc7,0x1e9));var _0x78dc=function(_0x21d4a6,_0x52293a){_0x21d4a6=_0x21d4a6-0x0;var _0x2826d8=_0x8dc7[_0x21d4a6];return _0x2826d8;};'use strict';var multer=require(_0x78dc('0x0'));var util=require('util');var path=require(_0x78dc('0x1'));var timeout=require(_0x78dc('0x2'));var express=require('express');var router=express[_0x78dc('0x3')]();var fs_extra=require(_0x78dc('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x78dc('0x5'));var controller=require(_0x78dc('0x6'));router[_0x78dc('0x7')]('/',auth['isAuthenticated'](),controller[_0x78dc('0x8')]);router['get']('/:id',auth[_0x78dc('0x9')](),controller[_0x78dc('0xa')]);router[_0x78dc('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x78dc('0xc')]('/:id',auth[_0x78dc('0x9')](),controller['update']);router[_0x78dc('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x78dc('0xe')]);module[_0x78dc('0xf')]=router;
\ No newline at end of file
+var _0x9ae7=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','multer','path'];(function(_0x31157d,_0x4ce3e2){var _0x48a2ab=function(_0x347894){while(--_0x347894){_0x31157d['push'](_0x31157d['shift']());}};_0x48a2ab(++_0x4ce3e2);}(_0x9ae7,0x8e));var _0x79ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ae7[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x79ae('0x0'));var util=require('util');var path=require(_0x79ae('0x1'));var timeout=require(_0x79ae('0x2'));var express=require(_0x79ae('0x3'));var router=express[_0x79ae('0x4')]();var fs_extra=require(_0x79ae('0x5'));var auth=require(_0x79ae('0x6'));var interaction=require(_0x79ae('0x7'));var config=require('../../config/environment');var controller=require(_0x79ae('0x8'));router['get']('/',auth[_0x79ae('0x9')](),controller[_0x79ae('0xa')]);router['get'](_0x79ae('0xb'),auth[_0x79ae('0x9')](),controller[_0x79ae('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x79ae('0xd')]);router[_0x79ae('0xe')](_0x79ae('0xb'),auth[_0x79ae('0x9')](),controller['update']);router[_0x79ae('0xf')]('/:id',auth[_0x79ae('0x9')](),controller[_0x79ae('0x10')]);module[_0x79ae('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index e398015..18e9901 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 _0x804e=['sequelize','exports','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x588006,_0x4ba6c1){var _0x552598=function(_0x2e2115){while(--_0x2e2115){_0x588006['push'](_0x588006['shift']());}};_0x552598(++_0x4ba6c1);}(_0x804e,0x6e));var _0xe804=function(_0x5b28a6,_0x3d3210){_0x5b28a6=_0x5b28a6-0x0;var _0x22fd9b=_0x804e[_0x5b28a6];return _0x22fd9b;};'use strict';var Sequelize=require(_0xe804('0x0'));module[_0xe804('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xe804('0x2')},'clid':{'type':Sequelize[_0xe804('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xe804('0x3')]},'channel':{'type':Sequelize[_0xe804('0x3')]},'dstchannel':{'type':Sequelize[_0xe804('0x3')]},'lastapp':{'type':Sequelize[_0xe804('0x3')]},'lastdata':{'type':Sequelize[_0xe804('0x3')]},'duration':{'type':Sequelize[_0xe804('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xe804('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe804('0x3')]},'amaflags':{'type':Sequelize[_0xe804('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xe804('0x3')]},'userfield':{'type':Sequelize[_0xe804('0x3')]},'uniqueid':{'type':Sequelize[_0xe804('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xe804('0x3')]},'type':{'type':Sequelize[_0xe804('0x3')]},'tag':{'type':Sequelize[_0xe804('0x3')]}};
\ No newline at end of file
+var _0x7b10=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7b10,0x1ac));var _0x07b1=function(_0x268db2,_0x136711){_0x268db2=_0x268db2-0x0;var _0x1d77c7=_0x7b10[_0x268db2];return _0x1d77c7;};'use strict';var Sequelize=require(_0x07b1('0x0'));module[_0x07b1('0x1')]={'calldate':{'type':Sequelize[_0x07b1('0x2')],'allowNull':![],'defaultValue':_0x07b1('0x3')},'clid':{'type':Sequelize[_0x07b1('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x07b1('0x4')]},'dcontext':{'type':Sequelize[_0x07b1('0x4')]},'channel':{'type':Sequelize[_0x07b1('0x4')]},'dstchannel':{'type':Sequelize[_0x07b1('0x4')]},'lastapp':{'type':Sequelize[_0x07b1('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x07b1('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x07b1('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x07b1('0x4')]},'amaflags':{'type':Sequelize[_0x07b1('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x07b1('0x4')]},'userfield':{'type':Sequelize[_0x07b1('0x4')]},'uniqueid':{'type':Sequelize[_0x07b1('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x07b1('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 50c34ea..1253ae5 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 _0x85d0=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','index','Cdr','rawAttributes','fieldName','type','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','describe','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x85d0,0x164));var _0x085d=function(_0x128104,_0x1667f1){_0x128104=_0x128104-0x0;var _0x5d5a74=_0x85d0[_0x128104];return _0x5d5a74;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x085d('0x0'));var moment=require(_0x085d('0x1'));var BPromise=require(_0x085d('0x2'));var Mustache=require(_0x085d('0x3'));var util=require(_0x085d('0x4'));var path=require(_0x085d('0x5'));var sox=require('sox');var csv=require(_0x085d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x085d('0x7'));var _=require(_0x085d('0x8'));var squel=require(_0x085d('0x9'));var crypto=require('crypto');var jsforce=require(_0x085d('0xa'));var deskjs=require(_0x085d('0xb'));var toCsv=require(_0x085d('0x6'));var querystring=require(_0x085d('0xc'));var Papa=require(_0x085d('0xd'));var Redis=require(_0x085d('0xe'));var authService=require(_0x085d('0xf'));var qs=require(_0x085d('0x10'));var as=require(_0x085d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x085d('0x12'))(_0x085d('0x13'));var utils=require(_0x085d('0x14'));var config=require(_0x085d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x085d('0x16'))['db'];function respondWithStatusCode(_0x2bd6ae,_0x5c6c27){_0x5c6c27=_0x5c6c27||0xcc;return function(_0x2e0714){if(_0x2e0714){return _0x2bd6ae[_0x085d('0x17')](_0x5c6c27);}return _0x2bd6ae[_0x085d('0x18')](_0x5c6c27)[_0x085d('0x19')]();};}function respondWithResult(_0x5a5252,_0x4b87b9){_0x4b87b9=_0x4b87b9||0xc8;return function(_0x19ce18){if(_0x19ce18){return _0x5a5252['status'](_0x4b87b9)['json'](_0x19ce18);}};}function respondWithFilteredResult(_0x267374,_0x334263){return function(_0x1d041b){if(_0x1d041b){var _0x5f8e18=typeof _0x334263[_0x085d('0x1a')]==='undefined'&&typeof _0x334263[_0x085d('0x1b')]===_0x085d('0x1c');var _0x1efea9=_0x1d041b[_0x085d('0x1d')];var _0x3e566f=_0x5f8e18?0x0:_0x334263[_0x085d('0x1a')];var _0x5c046e=_0x5f8e18?_0x1d041b[_0x085d('0x1d')]:_0x334263[_0x085d('0x1a')]+_0x334263['limit'];var _0xba531c;if(_0x5c046e>=_0x1efea9){_0x5c046e=_0x1efea9;_0xba531c=0xc8;}else{_0xba531c=0xce;}_0x267374[_0x085d('0x18')](_0xba531c);return _0x267374[_0x085d('0x1e')](_0x085d('0x1f'),_0x3e566f+'-'+_0x5c046e+'/'+_0x1efea9)[_0x085d('0x20')](_0x1d041b);}return null;};}function patchUpdates(_0x54eff1){return function(_0xb9d0ad){try{jsonpatch[_0x085d('0x21')](_0xb9d0ad,_0x54eff1,!![]);}catch(_0x39a85e){return BPromise[_0x085d('0x22')](_0x39a85e);}return _0xb9d0ad['save']();};}function saveUpdates(_0x5b3f9c,_0x4cdb11){return function(_0x2b7cdc){if(_0x2b7cdc){return _0x2b7cdc[_0x085d('0x23')](_0x5b3f9c)[_0x085d('0x24')](function(_0x10aa9d){return _0x10aa9d;});}return null;};}function removeEntity(_0x4715d6,_0x17dafb){return function(_0x576d95){if(_0x576d95){return _0x576d95[_0x085d('0x25')]()[_0x085d('0x24')](function(){_0x4715d6[_0x085d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38cddc,_0x290658){return function(_0xbacfbc){if(!_0xbacfbc){_0x38cddc[_0x085d('0x17')](0x194);}return _0xbacfbc;};}function handleError(_0x300295,_0x4b9032){_0x4b9032=_0x4b9032||0x1f4;return function(_0x5e5228){logger['error'](_0x5e5228[_0x085d('0x26')]);if(_0x5e5228[_0x085d('0x27')]){delete _0x5e5228[_0x085d('0x27')];}_0x300295['status'](_0x4b9032)[_0x085d('0x28')](_0x5e5228);};}exports[_0x085d('0x29')]=function(_0x3faf6b,_0x5c7849){var _0x2f670c={},_0x2eae2c={},_0x3f905d={'count':0x0,'rows':[]};var _0x26aa90=_['map'](db[_0x085d('0x2a')][_0x085d('0x2b')],function(_0x494070){return{'name':_0x494070[_0x085d('0x2c')],'type':_0x494070[_0x085d('0x2d')]['key']};});_0x2eae2c[_0x085d('0x2e')]=_[_0x085d('0x2f')](_0x26aa90,_0x085d('0x27'));_0x2eae2c['query']=_[_0x085d('0x30')](_0x3faf6b[_0x085d('0x31')]);_0x2eae2c[_0x085d('0x32')]=_['intersection'](_0x2eae2c[_0x085d('0x2e')],_0x2eae2c['query']);_0x2f670c[_0x085d('0x33')]=_[_0x085d('0x34')](_0x2eae2c[_0x085d('0x2e')],qs[_0x085d('0x35')](_0x3faf6b['query'][_0x085d('0x35')]));_0x2f670c[_0x085d('0x33')]=_0x2f670c[_0x085d('0x33')][_0x085d('0x36')]?_0x2f670c['attributes']:_0x2eae2c['model'];if(!_0x3faf6b[_0x085d('0x31')][_0x085d('0x37')](_0x085d('0x38'))){_0x2f670c[_0x085d('0x1b')]=qs[_0x085d('0x1b')](_0x3faf6b[_0x085d('0x31')][_0x085d('0x1b')]);_0x2f670c[_0x085d('0x1a')]=qs[_0x085d('0x1a')](_0x3faf6b['query'][_0x085d('0x1a')]);}_0x2f670c[_0x085d('0x39')]=qs['sort'](_0x3faf6b[_0x085d('0x31')]['sort']);_0x2f670c[_0x085d('0x3a')]=qs[_0x085d('0x32')](_['pick'](_0x3faf6b[_0x085d('0x31')],_0x2eae2c[_0x085d('0x32')]),_0x26aa90);if(_0x3faf6b[_0x085d('0x31')][_0x085d('0x3b')]){_0x2f670c[_0x085d('0x3a')]=_['merge'](_0x2f670c[_0x085d('0x3a')],{'$or':_['map'](_0x26aa90,function(_0x5d52be){if(_0x5d52be[_0x085d('0x2d')]!==_0x085d('0x3c')){var _0x31ee22={};_0x31ee22[_0x5d52be[_0x085d('0x27')]]={'$like':'%'+_0x3faf6b[_0x085d('0x31')]['filter']+'%'};return _0x31ee22;}})});}_0x2f670c=_[_0x085d('0x3d')]({},_0x2f670c,_0x3faf6b['options']);var _0x3a8646={'where':_0x2f670c[_0x085d('0x3a')]};return db[_0x085d('0x2a')]['count'](_0x3a8646)[_0x085d('0x24')](function(_0x55d81a){_0x3f905d[_0x085d('0x1d')]=_0x55d81a;if(_0x3faf6b[_0x085d('0x31')]['includeAll']){_0x2f670c[_0x085d('0x3e')]=[{'all':!![]}];}return db[_0x085d('0x2a')][_0x085d('0x3f')](_0x2f670c);})['then'](function(_0x56428e){_0x3f905d[_0x085d('0x40')]=_0x56428e;return _0x3f905d;})[_0x085d('0x24')](respondWithFilteredResult(_0x5c7849,_0x2f670c))[_0x085d('0x41')](handleError(_0x5c7849,null));};exports[_0x085d('0x42')]=function(_0x177f7d,_0x367a32){var _0x27e1c7={'raw':!![],'where':{'id':_0x177f7d[_0x085d('0x43')]['id']}},_0x120980={};_0x120980[_0x085d('0x2e')]=_['keys'](db['Cdr'][_0x085d('0x2b')]);_0x120980[_0x085d('0x31')]=_[_0x085d('0x30')](_0x177f7d[_0x085d('0x31')]);_0x120980[_0x085d('0x32')]=_[_0x085d('0x34')](_0x120980[_0x085d('0x2e')],_0x120980[_0x085d('0x31')]);_0x27e1c7[_0x085d('0x33')]=_[_0x085d('0x34')](_0x120980[_0x085d('0x2e')],qs['fields'](_0x177f7d[_0x085d('0x31')][_0x085d('0x35')]));_0x27e1c7[_0x085d('0x33')]=_0x27e1c7[_0x085d('0x33')][_0x085d('0x36')]?_0x27e1c7['attributes']:_0x120980[_0x085d('0x2e')];if(_0x177f7d['query'][_0x085d('0x44')]){_0x27e1c7['include']=[{'all':!![]}];}_0x27e1c7=_['merge']({},_0x27e1c7,_0x177f7d[_0x085d('0x45')]);return db[_0x085d('0x2a')][_0x085d('0x46')](_0x27e1c7)[_0x085d('0x24')](handleEntityNotFound(_0x367a32,null))[_0x085d('0x24')](respondWithResult(_0x367a32,null))['catch'](handleError(_0x367a32,null));};exports['create']=function(_0x547723,_0x580b91){return db['Cdr'][_0x085d('0x47')](_0x547723[_0x085d('0x48')],{})['then'](respondWithResult(_0x580b91,0xc9))[_0x085d('0x41')](handleError(_0x580b91,null));};exports['update']=function(_0x5df4cf,_0x415a4b){if(_0x5df4cf[_0x085d('0x48')]['id']){delete _0x5df4cf[_0x085d('0x48')]['id'];}return db[_0x085d('0x2a')]['find']({'where':{'id':_0x5df4cf[_0x085d('0x43')]['id']}})['then'](handleEntityNotFound(_0x415a4b,null))[_0x085d('0x24')](saveUpdates(_0x5df4cf[_0x085d('0x48')],null))['then'](respondWithResult(_0x415a4b,null))[_0x085d('0x41')](handleError(_0x415a4b,null));};exports[_0x085d('0x25')]=function(_0x298f6f,_0x37b56c){return db['Cdr'][_0x085d('0x46')]({'where':{'id':_0x298f6f['params']['id']}})[_0x085d('0x24')](handleEntityNotFound(_0x37b56c,null))['then'](removeEntity(_0x37b56c,null))['catch'](handleError(_0x37b56c,null));};exports[_0x085d('0x49')]=function(_0x41e3e0,_0x236368){return db[_0x085d('0x2a')][_0x085d('0x49')]()[_0x085d('0x24')](respondWithResult(_0x236368,null))[_0x085d('0x41')](handleError(_0x236368,null));};
\ No newline at end of file
+var _0xcb66=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','end','name','send','index','Cdr','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','find','create','body','catch','params','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0xcb66,0x19f));var _0x6cb6=function(_0x4db46b,_0xadcb1a){_0x4db46b=_0x4db46b-0x0;var _0x565be8=_0xcb66[_0x4db46b];return _0x565be8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6cb6('0x0'));var zipdir=require(_0x6cb6('0x1'));var jsonpatch=require(_0x6cb6('0x2'));var rp=require(_0x6cb6('0x3'));var moment=require(_0x6cb6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6cb6('0x5'));var util=require(_0x6cb6('0x6'));var path=require(_0x6cb6('0x7'));var sox=require(_0x6cb6('0x8'));var csv=require(_0x6cb6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6cb6('0xa'));var squel=require(_0x6cb6('0xb'));var crypto=require(_0x6cb6('0xc'));var jsforce=require(_0x6cb6('0xd'));var deskjs=require(_0x6cb6('0xe'));var toCsv=require(_0x6cb6('0x9'));var querystring=require(_0x6cb6('0xf'));var Papa=require(_0x6cb6('0x10'));var Redis=require(_0x6cb6('0x11'));var authService=require(_0x6cb6('0x12'));var qs=require(_0x6cb6('0x13'));var as=require(_0x6cb6('0x14'));var hardwareService=require(_0x6cb6('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6cb6('0x16'));var db=require(_0x6cb6('0x17'))['db'];function respondWithStatusCode(_0xad49d9,_0x2604e7){_0x2604e7=_0x2604e7||0xcc;return function(_0x585233){if(_0x585233){return _0xad49d9[_0x6cb6('0x18')](_0x2604e7);}return _0xad49d9[_0x6cb6('0x19')](_0x2604e7)['end']();};}function respondWithResult(_0x1e5468,_0x14a581){_0x14a581=_0x14a581||0xc8;return function(_0x5af476){if(_0x5af476){return _0x1e5468[_0x6cb6('0x19')](_0x14a581)[_0x6cb6('0x1a')](_0x5af476);}};}function respondWithFilteredResult(_0x492629,_0x5ab865){return function(_0x505b4d){if(_0x505b4d){var _0x5dd4cd=typeof _0x5ab865[_0x6cb6('0x1b')]===_0x6cb6('0x1c')&&typeof _0x5ab865[_0x6cb6('0x1d')]===_0x6cb6('0x1c');var _0x432e48=_0x505b4d[_0x6cb6('0x1e')];var _0x5b8a17=_0x5dd4cd?0x0:_0x5ab865[_0x6cb6('0x1b')];var _0xc0bdea=_0x5dd4cd?_0x505b4d['count']:_0x5ab865['offset']+_0x5ab865['limit'];var _0x5b5dab;if(_0xc0bdea>=_0x432e48){_0xc0bdea=_0x432e48;_0x5b5dab=0xc8;}else{_0x5b5dab=0xce;}_0x492629['status'](_0x5b5dab);return _0x492629['set'](_0x6cb6('0x1f'),_0x5b8a17+'-'+_0xc0bdea+'/'+_0x432e48)[_0x6cb6('0x1a')](_0x505b4d);}return null;};}function patchUpdates(_0x407455){return function(_0x2d41c4){try{jsonpatch[_0x6cb6('0x20')](_0x2d41c4,_0x407455,!![]);}catch(_0x5e14c8){return BPromise['reject'](_0x5e14c8);}return _0x2d41c4[_0x6cb6('0x21')]();};}function saveUpdates(_0x1d35d1,_0x1c4bcd){return function(_0x153915){if(_0x153915){return _0x153915['update'](_0x1d35d1)[_0x6cb6('0x22')](function(_0x19837e){return _0x19837e;});}return null;};}function removeEntity(_0x58a6ed,_0x5ad4f2){return function(_0xea5ee5){if(_0xea5ee5){return _0xea5ee5['destroy']()[_0x6cb6('0x22')](function(){_0x58a6ed[_0x6cb6('0x19')](0xcc)[_0x6cb6('0x23')]();});}};}function handleEntityNotFound(_0x18ecb9,_0x299830){return function(_0x16db1d){if(!_0x16db1d){_0x18ecb9[_0x6cb6('0x18')](0x194);}return _0x16db1d;};}function handleError(_0xcae6af,_0x1cc1ed){_0x1cc1ed=_0x1cc1ed||0x1f4;return function(_0x112e47){logger['error'](_0x112e47['stack']);if(_0x112e47['name']){delete _0x112e47[_0x6cb6('0x24')];}_0xcae6af[_0x6cb6('0x19')](_0x1cc1ed)[_0x6cb6('0x25')](_0x112e47);};}exports[_0x6cb6('0x26')]=function(_0x1f8c9d,_0x3b62e6){var _0x57cd74={},_0x124291={},_0x4d4ad9={'count':0x0,'rows':[]};var _0x2b2c4b=_['map'](db[_0x6cb6('0x27')][_0x6cb6('0x28')],function(_0x32c373){return{'name':_0x32c373['fieldName'],'type':_0x32c373[_0x6cb6('0x29')][_0x6cb6('0x2a')]};});_0x124291[_0x6cb6('0x2b')]=_['map'](_0x2b2c4b,_0x6cb6('0x24'));_0x124291[_0x6cb6('0x2c')]=_[_0x6cb6('0x2d')](_0x1f8c9d['query']);_0x124291[_0x6cb6('0x2e')]=_[_0x6cb6('0x2f')](_0x124291['model'],_0x124291[_0x6cb6('0x2c')]);_0x57cd74[_0x6cb6('0x30')]=_[_0x6cb6('0x2f')](_0x124291[_0x6cb6('0x2b')],qs[_0x6cb6('0x31')](_0x1f8c9d[_0x6cb6('0x2c')][_0x6cb6('0x31')]));_0x57cd74[_0x6cb6('0x30')]=_0x57cd74[_0x6cb6('0x30')][_0x6cb6('0x32')]?_0x57cd74['attributes']:_0x124291[_0x6cb6('0x2b')];if(!_0x1f8c9d[_0x6cb6('0x2c')][_0x6cb6('0x33')](_0x6cb6('0x34'))){_0x57cd74['limit']=qs['limit'](_0x1f8c9d['query'][_0x6cb6('0x1d')]);_0x57cd74[_0x6cb6('0x1b')]=qs[_0x6cb6('0x1b')](_0x1f8c9d[_0x6cb6('0x2c')][_0x6cb6('0x1b')]);}_0x57cd74[_0x6cb6('0x35')]=qs[_0x6cb6('0x36')](_0x1f8c9d[_0x6cb6('0x2c')]['sort']);_0x57cd74[_0x6cb6('0x37')]=qs['filters'](_[_0x6cb6('0x38')](_0x1f8c9d[_0x6cb6('0x2c')],_0x124291[_0x6cb6('0x2e')]),_0x2b2c4b);if(_0x1f8c9d[_0x6cb6('0x2c')][_0x6cb6('0x39')]){_0x57cd74[_0x6cb6('0x37')]=_[_0x6cb6('0x3a')](_0x57cd74['where'],{'$or':_[_0x6cb6('0x3b')](_0x2b2c4b,function(_0x58a304){if(_0x58a304[_0x6cb6('0x29')]!==_0x6cb6('0x3c')){var _0x3bb13d={};_0x3bb13d[_0x58a304['name']]={'$like':'%'+_0x1f8c9d['query'][_0x6cb6('0x39')]+'%'};return _0x3bb13d;}})});}_0x57cd74=_['merge']({},_0x57cd74,_0x1f8c9d[_0x6cb6('0x3d')]);var _0x296a3b={'where':_0x57cd74[_0x6cb6('0x37')]};return db[_0x6cb6('0x27')][_0x6cb6('0x1e')](_0x296a3b)[_0x6cb6('0x22')](function(_0x3652ca){_0x4d4ad9['count']=_0x3652ca;if(_0x1f8c9d[_0x6cb6('0x2c')][_0x6cb6('0x3e')]){_0x57cd74['include']=[{'all':!![]}];}return db[_0x6cb6('0x27')][_0x6cb6('0x3f')](_0x57cd74);})[_0x6cb6('0x22')](function(_0x31a391){_0x4d4ad9[_0x6cb6('0x40')]=_0x31a391;return _0x4d4ad9;})[_0x6cb6('0x22')](respondWithFilteredResult(_0x3b62e6,_0x57cd74))['catch'](handleError(_0x3b62e6,null));};exports['show']=function(_0x1f4e94,_0x5d3770){var _0x588ea4={'raw':!![],'where':{'id':_0x1f4e94['params']['id']}},_0x605673={};_0x605673[_0x6cb6('0x2b')]=_[_0x6cb6('0x2d')](db['Cdr']['rawAttributes']);_0x605673[_0x6cb6('0x2c')]=_['keys'](_0x1f4e94[_0x6cb6('0x2c')]);_0x605673[_0x6cb6('0x2e')]=_['intersection'](_0x605673[_0x6cb6('0x2b')],_0x605673[_0x6cb6('0x2c')]);_0x588ea4['attributes']=_[_0x6cb6('0x2f')](_0x605673['model'],qs[_0x6cb6('0x31')](_0x1f4e94[_0x6cb6('0x2c')]['fields']));_0x588ea4[_0x6cb6('0x30')]=_0x588ea4[_0x6cb6('0x30')]['length']?_0x588ea4['attributes']:_0x605673[_0x6cb6('0x2b')];if(_0x1f4e94[_0x6cb6('0x2c')][_0x6cb6('0x3e')]){_0x588ea4['include']=[{'all':!![]}];}_0x588ea4=_[_0x6cb6('0x3a')]({},_0x588ea4,_0x1f4e94[_0x6cb6('0x3d')]);return db['Cdr'][_0x6cb6('0x41')](_0x588ea4)[_0x6cb6('0x22')](handleEntityNotFound(_0x5d3770,null))[_0x6cb6('0x22')](respondWithResult(_0x5d3770,null))['catch'](handleError(_0x5d3770,null));};exports[_0x6cb6('0x42')]=function(_0x4444a4,_0x42dc72){return db[_0x6cb6('0x27')][_0x6cb6('0x42')](_0x4444a4[_0x6cb6('0x43')],{})['then'](respondWithResult(_0x42dc72,0xc9))[_0x6cb6('0x44')](handleError(_0x42dc72,null));};exports['update']=function(_0x4c3a3a,_0x29cb39){if(_0x4c3a3a[_0x6cb6('0x43')]['id']){delete _0x4c3a3a['body']['id'];}return db[_0x6cb6('0x27')]['find']({'where':{'id':_0x4c3a3a[_0x6cb6('0x45')]['id']}})[_0x6cb6('0x22')](handleEntityNotFound(_0x29cb39,null))[_0x6cb6('0x22')](saveUpdates(_0x4c3a3a['body'],null))[_0x6cb6('0x22')](respondWithResult(_0x29cb39,null))[_0x6cb6('0x44')](handleError(_0x29cb39,null));};exports[_0x6cb6('0x46')]=function(_0x567d52,_0x2668a3){return db['Cdr'][_0x6cb6('0x41')]({'where':{'id':_0x567d52[_0x6cb6('0x45')]['id']}})[_0x6cb6('0x22')](handleEntityNotFound(_0x2668a3,null))['then'](removeEntity(_0x2668a3,null))['catch'](handleError(_0x2668a3,null));};exports[_0x6cb6('0x47')]=function(_0x3dca6c,_0x1d12da){return db['Cdr'][_0x6cb6('0x47')]()[_0x6cb6('0x22')](respondWithResult(_0x1d12da,null))[_0x6cb6('0x44')](handleError(_0x1d12da,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index b47c4ef..4a1a925 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(_0x281023,_0x360d57){var _0x30b440=function(_0x157342){while(--_0x157342){_0x281023['push'](_0x281023['shift']());}};_0x30b440(++_0x360d57);}(_0x7a54,0x106));var _0x47a5=function(_0x5705e9,_0x3c550c){_0x5705e9=_0x5705e9-0x0;var _0x1283c2=_0x7a54[_0x5705e9];return _0x1283c2;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x5431d5,_0x580386){var _0x542470=function(_0x2c8969){while(--_0x2c8969){_0x5431d5['push'](_0x5431d5['shift']());}};_0x542470(++_0x580386);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 3db2c04..4655a27 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 _0x4470=['result','catch','lodash','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x58cbdc,_0x16bb11){var _0x5d6f3d=function(_0x539ea7){while(--_0x539ea7){_0x58cbdc['push'](_0x58cbdc['shift']());}};_0x5d6f3d(++_0x16bb11);}(_0x4470,0xda));var _0x0447=function(_0x146a97,_0x2d8483){_0x146a97=_0x146a97-0x0;var _0x259d5c=_0x4470[_0x146a97];return _0x259d5c;};'use strict';var _=require(_0x0447('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0447('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0447('0x2'))['db'];var utils=require(_0x0447('0x3'));var logger=require('../../config/logger')(_0x0447('0x4'));var config=require(_0x0447('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x0447('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1eb763,_0x3b049f,_0xbbda8e){return new BPromise(function(_0x10e33d,_0x214e75){return client['request'](_0x1eb763,_0xbbda8e)[_0x0447('0x7')](function(_0xd7f8ac){logger[_0x0447('0x8')](_0x0447('0x9'),_0x3b049f,'request\x20sent');logger[_0x0447('0xa')](_0x0447('0xb'),_0x3b049f,_0x0447('0xc'),JSON['stringify'](_0xd7f8ac));if(_0xd7f8ac['error']){if(_0xd7f8ac[_0x0447('0xd')][_0x0447('0xe')]===0x1f4){logger[_0x0447('0xd')](_0x0447('0x9'),_0x3b049f,_0xd7f8ac[_0x0447('0xd')][_0x0447('0xf')]);return _0x214e75(_0xd7f8ac[_0x0447('0xd')]['message']);}logger[_0x0447('0xd')](_0x0447('0x9'),_0x3b049f,_0xd7f8ac[_0x0447('0xd')][_0x0447('0xf')]);return _0x10e33d(_0xd7f8ac[_0x0447('0xd')]['message']);}else{logger[_0x0447('0x8')]('Cdr,\x20%s,\x20%s',_0x3b049f,_0x0447('0xc'));_0x10e33d(_0xd7f8ac[_0x0447('0x10')]['message']);}})[_0x0447('0x11')](function(_0x93114a){logger['error'](_0x0447('0x9'),_0x3b049f,_0x93114a);_0x214e75(_0x93114a);});});}
\ No newline at end of file
+var _0xd81d=['lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0xd81d,0x1e4));var _0xdd81=function(_0x32f181,_0x2c8c66){_0x32f181=_0x32f181-0x0;var _0x5b4745=_0xd81d[_0x32f181];return _0x5b4745;};'use strict';var _=require(_0xdd81('0x0'));var util=require('util');var moment=require(_0xdd81('0x1'));var BPromise=require('bluebird');var rs=require(_0xdd81('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdd81('0x3'))['db'];var utils=require(_0xdd81('0x4'));var logger=require(_0xdd81('0x5'))(_0xdd81('0x6'));var config=require(_0xdd81('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdd81('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e1c46,_0x26ddc7,_0x5f4af6){return new BPromise(function(_0x603e7a,_0x4c1f1c){return client[_0xdd81('0x9')](_0x1e1c46,_0x5f4af6)[_0xdd81('0xa')](function(_0x338330){logger[_0xdd81('0xb')](_0xdd81('0xc'),_0x26ddc7,_0xdd81('0xd'));logger[_0xdd81('0xe')](_0xdd81('0xf'),_0x26ddc7,_0xdd81('0xd'),JSON[_0xdd81('0x10')](_0x338330));if(_0x338330['error']){if(_0x338330['error'][_0xdd81('0x11')]===0x1f4){logger[_0xdd81('0x12')](_0xdd81('0xc'),_0x26ddc7,_0x338330['error']['message']);return _0x4c1f1c(_0x338330[_0xdd81('0x12')][_0xdd81('0x13')]);}logger[_0xdd81('0x12')](_0xdd81('0xc'),_0x26ddc7,_0x338330[_0xdd81('0x12')][_0xdd81('0x13')]);return _0x603e7a(_0x338330[_0xdd81('0x12')][_0xdd81('0x13')]);}else{logger[_0xdd81('0xb')](_0xdd81('0xc'),_0x26ddc7,'request\x20sent');_0x603e7a(_0x338330[_0xdd81('0x14')][_0xdd81('0x13')]);}})[_0xdd81('0x15')](function(_0x2493cb){logger[_0xdd81('0x12')](_0xdd81('0xc'),_0x26ddc7,_0x2493cb);_0x4c1f1c(_0x2493cb);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index a687bd6..ad79669 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(_0x4a450a,_0x54d42f){var _0x28baf9=function(_0x5cb70a){while(--_0x5cb70a){_0x4a450a['push'](_0x4a450a['shift']());}};_0x28baf9(++_0x54d42f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x1d2bbb,_0x202267){var _0x38082b=function(_0x27d153){while(--_0x27d153){_0x1d2bbb['push'](_0x1d2bbb['shift']());}};_0x38082b(++_0x202267);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 09dc367..ff63720 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 _0x11df=['exports','STRING','noop','*,*,*,*','sequelize'];(function(_0x377844,_0x31eb42){var _0x58ac10=function(_0x2735a7){while(--_0x2735a7){_0x377844['push'](_0x377844['shift']());}};_0x58ac10(++_0x31eb42);}(_0x11df,0x1df));var _0xf11d=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x11df[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require(_0xf11d('0x0'));module[_0xf11d('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xf11d('0x2')],'allowNull':![],'defaultValue':_0xf11d('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xf11d('0x2')]},'interval':{'type':Sequelize[_0xf11d('0x2')],'defaultValue':_0xf11d('0x4')}};
\ No newline at end of file
+var _0xb81e=['TEXT','*,*,*,*','STRING','noop'];(function(_0x57c2eb,_0x1a2432){var _0x2d62b4=function(_0x5995f5){while(--_0x5995f5){_0x57c2eb['push'](_0x57c2eb['shift']());}};_0x2d62b4(++_0x1a2432);}(_0xb81e,0xee));var _0xeb81=function(_0x385df1,_0x39ca6c){_0x385df1=_0x385df1-0x0;var _0x3ee07e=_0xb81e[_0x385df1];return _0x3ee07e;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xeb81('0x0')],'allowNull':![],'defaultValue':_0xeb81('0x1')},'appdata':{'type':Sequelize[_0xeb81('0x2')]()},'description':{'type':Sequelize[_0xeb81('0x0')]},'interval':{'type':Sequelize[_0xeb81('0x0')],'defaultValue':_0xeb81('0x3')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 8b97561..009041f 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 _0x9c5e=['json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','show','params','model','keys','rawAttributes','filters','intersection','query','attributes','fields','includeAll','include','merge','options','ChatApplication','body','find','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','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'];(function(_0x209ef6,_0x4427da){var _0x50c003=function(_0x1c23bc){while(--_0x1c23bc){_0x209ef6['push'](_0x209ef6['shift']());}};_0x50c003(++_0x4427da);}(_0x9c5e,0x9c));var _0xe9c5=function(_0x2d714a,_0x3a4c1e){_0x2d714a=_0x2d714a-0x0;var _0x2b6ed7=_0x9c5e[_0x2d714a];return _0x2b6ed7;};'use strict';var emlformat=require(_0xe9c5('0x0'));var rimraf=require(_0xe9c5('0x1'));var zipdir=require(_0xe9c5('0x2'));var jsonpatch=require(_0xe9c5('0x3'));var rp=require(_0xe9c5('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe9c5('0x5'));var path=require(_0xe9c5('0x6'));var sox=require('sox');var csv=require(_0xe9c5('0x7'));var ejs=require(_0xe9c5('0x8'));var fs=require('fs');var fs_extra=require(_0xe9c5('0x9'));var _=require(_0xe9c5('0xa'));var squel=require('squel');var crypto=require(_0xe9c5('0xb'));var jsforce=require(_0xe9c5('0xc'));var deskjs=require(_0xe9c5('0xd'));var toCsv=require(_0xe9c5('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe9c5('0xe'));var authService=require(_0xe9c5('0xf'));var qs=require(_0xe9c5('0x10'));var as=require(_0xe9c5('0x11'));var hardwareService=require(_0xe9c5('0x12'));var logger=require(_0xe9c5('0x13'))(_0xe9c5('0x14'));var utils=require(_0xe9c5('0x15'));var config=require(_0xe9c5('0x16'));var licenseUtil=require(_0xe9c5('0x17'));var db=require(_0xe9c5('0x18'))['db'];function respondWithStatusCode(_0x27f3e1,_0x471401){_0x471401=_0x471401||0xcc;return function(_0x25ff11){if(_0x25ff11){return _0x27f3e1[_0xe9c5('0x19')](_0x471401);}return _0x27f3e1[_0xe9c5('0x1a')](_0x471401)['end']();};}function respondWithResult(_0x3cce36,_0xe98b11){_0xe98b11=_0xe98b11||0xc8;return function(_0x5eb474){if(_0x5eb474){return _0x3cce36[_0xe9c5('0x1a')](_0xe98b11)[_0xe9c5('0x1b')](_0x5eb474);}};}function respondWithFilteredResult(_0x232584,_0x5d8236){return function(_0x163253){if(_0x163253){var _0x14eb41=typeof _0x5d8236['offset']===_0xe9c5('0x1c')&&typeof _0x5d8236[_0xe9c5('0x1d')]===_0xe9c5('0x1c');var _0x154390=_0x163253[_0xe9c5('0x1e')];var _0x4d9c7d=_0x14eb41?0x0:_0x5d8236[_0xe9c5('0x1f')];var _0x1cecae=_0x14eb41?_0x163253[_0xe9c5('0x1e')]:_0x5d8236[_0xe9c5('0x1f')]+_0x5d8236['limit'];var _0x26492a;if(_0x1cecae>=_0x154390){_0x1cecae=_0x154390;_0x26492a=0xc8;}else{_0x26492a=0xce;}_0x232584[_0xe9c5('0x1a')](_0x26492a);return _0x232584[_0xe9c5('0x20')](_0xe9c5('0x21'),_0x4d9c7d+'-'+_0x1cecae+'/'+_0x154390)[_0xe9c5('0x1b')](_0x163253);}return null;};}function patchUpdates(_0x58fbad){return function(_0x51e860){try{jsonpatch[_0xe9c5('0x22')](_0x51e860,_0x58fbad,!![]);}catch(_0x57818d){return BPromise[_0xe9c5('0x23')](_0x57818d);}return _0x51e860[_0xe9c5('0x24')]();};}function saveUpdates(_0x21b02a,_0x4d16bc){return function(_0x5750ff){if(_0x5750ff){return _0x5750ff[_0xe9c5('0x25')](_0x21b02a)[_0xe9c5('0x26')](function(_0x37fb90){return _0x37fb90;});}return null;};}function removeEntity(_0x189a13,_0x34a7c8){return function(_0x245161){if(_0x245161){return _0x245161[_0xe9c5('0x27')]()[_0xe9c5('0x26')](function(){_0x189a13[_0xe9c5('0x1a')](0xcc)[_0xe9c5('0x28')]();});}};}function handleEntityNotFound(_0x5a3caa,_0x5c8bb7){return function(_0x250e1c){if(!_0x250e1c){_0x5a3caa[_0xe9c5('0x19')](0x194);}return _0x250e1c;};}function handleError(_0x298dca,_0x3bf679){_0x3bf679=_0x3bf679||0x1f4;return function(_0x33fe71){logger[_0xe9c5('0x29')](_0x33fe71['stack']);if(_0x33fe71[_0xe9c5('0x2a')]){delete _0x33fe71['name'];}_0x298dca[_0xe9c5('0x1a')](_0x3bf679)['send'](_0x33fe71);};}exports[_0xe9c5('0x2b')]=function(_0x2112a6,_0x52d008){var _0x36d145={'raw':!![],'where':{'id':_0x2112a6[_0xe9c5('0x2c')]['id']}},_0x46d253={};_0x46d253[_0xe9c5('0x2d')]=_[_0xe9c5('0x2e')](db['ChatApplication'][_0xe9c5('0x2f')]);_0x46d253['query']=_[_0xe9c5('0x2e')](_0x2112a6['query']);_0x46d253[_0xe9c5('0x30')]=_[_0xe9c5('0x31')](_0x46d253[_0xe9c5('0x2d')],_0x46d253[_0xe9c5('0x32')]);_0x36d145[_0xe9c5('0x33')]=_['intersection'](_0x46d253[_0xe9c5('0x2d')],qs[_0xe9c5('0x34')](_0x2112a6[_0xe9c5('0x32')][_0xe9c5('0x34')]));_0x36d145[_0xe9c5('0x33')]=_0x36d145['attributes']['length']?_0x36d145[_0xe9c5('0x33')]:_0x46d253[_0xe9c5('0x2d')];if(_0x2112a6[_0xe9c5('0x32')][_0xe9c5('0x35')]){_0x36d145[_0xe9c5('0x36')]=[{'all':!![]}];}_0x36d145=_[_0xe9c5('0x37')]({},_0x36d145,_0x2112a6[_0xe9c5('0x38')]);return db[_0xe9c5('0x39')]['find'](_0x36d145)[_0xe9c5('0x26')](handleEntityNotFound(_0x52d008,null))[_0xe9c5('0x26')](respondWithResult(_0x52d008,null))['catch'](handleError(_0x52d008,null));};exports[_0xe9c5('0x25')]=function(_0x4e4828,_0x340905){if(_0x4e4828[_0xe9c5('0x3a')]['id']){delete _0x4e4828[_0xe9c5('0x3a')]['id'];}return db[_0xe9c5('0x39')][_0xe9c5('0x3b')]({'where':{'id':_0x4e4828[_0xe9c5('0x2c')]['id']}})[_0xe9c5('0x26')](handleEntityNotFound(_0x340905,null))[_0xe9c5('0x26')](saveUpdates(_0x4e4828[_0xe9c5('0x3a')],null))[_0xe9c5('0x26')](respondWithResult(_0x340905,null))[_0xe9c5('0x3c')](handleError(_0x340905,null));};exports[_0xe9c5('0x27')]=function(_0x33680c,_0x3aae58){return db[_0xe9c5('0x39')][_0xe9c5('0x3b')]({'where':{'id':_0x33680c[_0xe9c5('0x2c')]['id']}})[_0xe9c5('0x26')](handleEntityNotFound(_0x3aae58,null))[_0xe9c5('0x26')](removeEntity(_0x3aae58,null))['catch'](handleError(_0x3aae58,null));};
\ No newline at end of file
+var _0x94d2=['destroy','error','stack','name','show','params','model','keys','rawAttributes','query','attributes','intersection','fields','length','includeAll','include','options','ChatApplication','catch','body','find','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','count','offset','Content-Range','apply','reject','save','update','then'];(function(_0x5a766f,_0x135d23){var _0xebfcf3=function(_0x1d5bb5){while(--_0x1d5bb5){_0x5a766f['push'](_0x5a766f['shift']());}};_0xebfcf3(++_0x135d23);}(_0x94d2,0x1cd));var _0x294d=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x94d2[_0x1b2ff7];return _0x31656a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x294d('0x0'));var jsonpatch=require(_0x294d('0x1'));var rp=require(_0x294d('0x2'));var moment=require(_0x294d('0x3'));var BPromise=require(_0x294d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x294d('0x5'));var sox=require(_0x294d('0x6'));var csv=require(_0x294d('0x7'));var ejs=require(_0x294d('0x8'));var fs=require('fs');var fs_extra=require(_0x294d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x294d('0xa'));var jsforce=require(_0x294d('0xb'));var deskjs=require(_0x294d('0xc'));var toCsv=require(_0x294d('0x7'));var querystring=require(_0x294d('0xd'));var Papa=require('papaparse');var Redis=require(_0x294d('0xe'));var authService=require(_0x294d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x294d('0x10'));var hardwareService=require(_0x294d('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x294d('0x12'));var config=require(_0x294d('0x13'));var licenseUtil=require(_0x294d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d44ba,_0x3f0f3a){_0x3f0f3a=_0x3f0f3a||0xcc;return function(_0x4119da){if(_0x4119da){return _0x3d44ba[_0x294d('0x15')](_0x3f0f3a);}return _0x3d44ba['status'](_0x3f0f3a)[_0x294d('0x16')]();};}function respondWithResult(_0x49c38f,_0x5adc9c){_0x5adc9c=_0x5adc9c||0xc8;return function(_0xed0e10){if(_0xed0e10){return _0x49c38f[_0x294d('0x17')](_0x5adc9c)[_0x294d('0x18')](_0xed0e10);}};}function respondWithFilteredResult(_0x28f7f6,_0x4bf3ae){return function(_0x42d290){if(_0x42d290){var _0x4fddfe=typeof _0x4bf3ae['offset']==='undefined'&&typeof _0x4bf3ae['limit']===_0x294d('0x19');var _0x15dce0=_0x42d290[_0x294d('0x1a')];var _0x46d9c5=_0x4fddfe?0x0:_0x4bf3ae[_0x294d('0x1b')];var _0x26563e=_0x4fddfe?_0x42d290[_0x294d('0x1a')]:_0x4bf3ae[_0x294d('0x1b')]+_0x4bf3ae['limit'];var _0x3ccc78;if(_0x26563e>=_0x15dce0){_0x26563e=_0x15dce0;_0x3ccc78=0xc8;}else{_0x3ccc78=0xce;}_0x28f7f6[_0x294d('0x17')](_0x3ccc78);return _0x28f7f6['set'](_0x294d('0x1c'),_0x46d9c5+'-'+_0x26563e+'/'+_0x15dce0)[_0x294d('0x18')](_0x42d290);}return null;};}function patchUpdates(_0x429da3){return function(_0xffe147){try{jsonpatch[_0x294d('0x1d')](_0xffe147,_0x429da3,!![]);}catch(_0x31fd1c){return BPromise[_0x294d('0x1e')](_0x31fd1c);}return _0xffe147[_0x294d('0x1f')]();};}function saveUpdates(_0x82ad78,_0x11df11){return function(_0x419717){if(_0x419717){return _0x419717[_0x294d('0x20')](_0x82ad78)[_0x294d('0x21')](function(_0x2b2a1e){return _0x2b2a1e;});}return null;};}function removeEntity(_0x4aa60,_0x524ff2){return function(_0x546a59){if(_0x546a59){return _0x546a59[_0x294d('0x22')]()[_0x294d('0x21')](function(){_0x4aa60[_0x294d('0x17')](0xcc)[_0x294d('0x16')]();});}};}function handleEntityNotFound(_0x1cf383,_0x1ba06c){return function(_0x4da072){if(!_0x4da072){_0x1cf383[_0x294d('0x15')](0x194);}return _0x4da072;};}function handleError(_0x5cac01,_0x4670ae){_0x4670ae=_0x4670ae||0x1f4;return function(_0x233212){logger[_0x294d('0x23')](_0x233212[_0x294d('0x24')]);if(_0x233212[_0x294d('0x25')]){delete _0x233212[_0x294d('0x25')];}_0x5cac01[_0x294d('0x17')](_0x4670ae)['send'](_0x233212);};}exports[_0x294d('0x26')]=function(_0x2b2072,_0x37cf9f){var _0x340ae5={'raw':!![],'where':{'id':_0x2b2072[_0x294d('0x27')]['id']}},_0xdfcde1={};_0xdfcde1[_0x294d('0x28')]=_[_0x294d('0x29')](db['ChatApplication'][_0x294d('0x2a')]);_0xdfcde1[_0x294d('0x2b')]=_[_0x294d('0x29')](_0x2b2072[_0x294d('0x2b')]);_0xdfcde1['filters']=_['intersection'](_0xdfcde1[_0x294d('0x28')],_0xdfcde1[_0x294d('0x2b')]);_0x340ae5[_0x294d('0x2c')]=_[_0x294d('0x2d')](_0xdfcde1[_0x294d('0x28')],qs[_0x294d('0x2e')](_0x2b2072[_0x294d('0x2b')][_0x294d('0x2e')]));_0x340ae5[_0x294d('0x2c')]=_0x340ae5['attributes'][_0x294d('0x2f')]?_0x340ae5[_0x294d('0x2c')]:_0xdfcde1[_0x294d('0x28')];if(_0x2b2072['query'][_0x294d('0x30')]){_0x340ae5[_0x294d('0x31')]=[{'all':!![]}];}_0x340ae5=_['merge']({},_0x340ae5,_0x2b2072[_0x294d('0x32')]);return db[_0x294d('0x33')]['find'](_0x340ae5)['then'](handleEntityNotFound(_0x37cf9f,null))[_0x294d('0x21')](respondWithResult(_0x37cf9f,null))[_0x294d('0x34')](handleError(_0x37cf9f,null));};exports[_0x294d('0x20')]=function(_0x5260a5,_0x37aa78){if(_0x5260a5[_0x294d('0x35')]['id']){delete _0x5260a5[_0x294d('0x35')]['id'];}return db[_0x294d('0x33')][_0x294d('0x36')]({'where':{'id':_0x5260a5[_0x294d('0x27')]['id']}})[_0x294d('0x21')](handleEntityNotFound(_0x37aa78,null))[_0x294d('0x21')](saveUpdates(_0x5260a5[_0x294d('0x35')],null))[_0x294d('0x21')](respondWithResult(_0x37aa78,null))[_0x294d('0x34')](handleError(_0x37aa78,null));};exports[_0x294d('0x22')]=function(_0x496941,_0x3e9576){return db[_0x294d('0x33')][_0x294d('0x36')]({'where':{'id':_0x496941['params']['id']}})[_0x294d('0x21')](handleEntityNotFound(_0x3e9576,null))[_0x294d('0x21')](removeEntity(_0x3e9576,null))[_0x294d('0x34')](handleError(_0x3e9576,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 76788c6..5fd33a6 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 _0xbc17=['rimraf','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','path'];(function(_0x382dd1,_0x448bec){var _0x2109bd=function(_0x5e1091){while(--_0x5e1091){_0x382dd1['push'](_0x382dd1['shift']());}};_0x2109bd(++_0x448bec);}(_0xbc17,0x1ab));var _0x7bc1=function(_0xeead8a,_0x3d2400){_0xeead8a=_0xeead8a-0x0;var _0x24742c=_0xbc17[_0xeead8a];return _0x24742c;};'use strict';var _=require(_0x7bc1('0x0'));var util=require(_0x7bc1('0x1'));var logger=require('../../config/logger')(_0x7bc1('0x2'));var moment=require(_0x7bc1('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7bc1('0x4'));var rimraf=require(_0x7bc1('0x5'));var config=require('../../config/environment');var attributes=require(_0x7bc1('0x6'));module['exports']=function(_0xba4fa8,_0xcecb62){return _0xba4fa8[_0x7bc1('0x7')](_0x7bc1('0x8'),attributes,{'tableName':_0x7bc1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7bc1('0xa'),'collate':_0x7bc1('0xb')});};
\ No newline at end of file
+var _0xe43c=['path','../../config/environment','./chatApplication.attributes','exports','define','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x52dfb2,_0x1a7a8e){var _0xf5b55b=function(_0x392f19){while(--_0x392f19){_0x52dfb2['push'](_0x52dfb2['shift']());}};_0xf5b55b(++_0x1a7a8e);}(_0xe43c,0x180));var _0xce43=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe43c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xce43('0x0'));var util=require(_0xce43('0x1'));var logger=require(_0xce43('0x2'))(_0xce43('0x3'));var moment=require(_0xce43('0x4'));var BPromise=require(_0xce43('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce43('0x6'));var rimraf=require('rimraf');var config=require(_0xce43('0x7'));var attributes=require(_0xce43('0x8'));module[_0xce43('0x9')]=function(_0x3557d0,_0x5d6e5c){return _0x3557d0[_0xce43('0xa')]('ChatApplication',attributes,{'tableName':_0xce43('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xce43('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index b0b8c8d..2993889 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 _0xb2f3=['catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x33d4a2,_0x2baaf4){var _0x2c793f=function(_0x414303){while(--_0x414303){_0x33d4a2['push'](_0x33d4a2['shift']());}};_0x2c793f(++_0x2baaf4);}(_0xb2f3,0xfb));var _0x3b2f=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xb2f3[_0x4a53d];return _0x27410e;};'use strict';var _=require(_0x3b2f('0x0'));var util=require(_0x3b2f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3b2f('0x2'));var fs=require('fs');var Redis=require(_0x3b2f('0x3'));var db=require(_0x3b2f('0x4'))['db'];var utils=require(_0x3b2f('0x5'));var logger=require(_0x3b2f('0x6'))(_0x3b2f('0x7'));var config=require(_0x3b2f('0x8'));var jayson=require(_0x3b2f('0x9'));var client=jayson[_0x3b2f('0xa')][_0x3b2f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48c8a3,_0x49e8ae,_0x5c517f){return new BPromise(function(_0x2f7653,_0x5ed471){return client[_0x3b2f('0xc')](_0x48c8a3,_0x5c517f)[_0x3b2f('0xd')](function(_0x58a802){logger[_0x3b2f('0xe')](_0x3b2f('0xf'),_0x49e8ae,_0x3b2f('0x10'));logger[_0x3b2f('0x11')](_0x3b2f('0x12'),_0x49e8ae,'request\x20sent',JSON[_0x3b2f('0x13')](_0x58a802));if(_0x58a802[_0x3b2f('0x14')]){if(_0x58a802[_0x3b2f('0x14')][_0x3b2f('0x15')]===0x1f4){logger['error'](_0x3b2f('0xf'),_0x49e8ae,_0x58a802[_0x3b2f('0x14')]['message']);return _0x5ed471(_0x58a802['error']['message']);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x49e8ae,_0x58a802['error'][_0x3b2f('0x16')]);return _0x2f7653(_0x58a802['error'][_0x3b2f('0x16')]);}else{logger[_0x3b2f('0xe')]('ChatApplication,\x20%s,\x20%s',_0x49e8ae,_0x3b2f('0x10'));_0x2f7653(_0x58a802[_0x3b2f('0x17')][_0x3b2f('0x16')]);}})[_0x3b2f('0x18')](function(_0x16e9ea){logger[_0x3b2f('0x14')](_0x3b2f('0xf'),_0x49e8ae,_0x16e9ea);_0x5ed471(_0x16e9ea);});});}
\ No newline at end of file
+var _0x0f4b=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x0f4b,0x99));var _0xb0f4=function(_0x597087,_0x588022){_0x597087=_0x597087-0x0;var _0x29f39c=_0x0f4b[_0x597087];return _0x29f39c;};'use strict';var _=require(_0xb0f4('0x0'));var util=require(_0xb0f4('0x1'));var moment=require(_0xb0f4('0x2'));var BPromise=require('bluebird');var rs=require(_0xb0f4('0x3'));var fs=require('fs');var Redis=require(_0xb0f4('0x4'));var db=require(_0xb0f4('0x5'))['db'];var utils=require(_0xb0f4('0x6'));var logger=require(_0xb0f4('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb0f4('0x8')][_0xb0f4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2606df,_0x584cb3,_0x2d1443){return new BPromise(function(_0xb86859,_0x2cfa11){return client[_0xb0f4('0xa')](_0x2606df,_0x2d1443)[_0xb0f4('0xb')](function(_0x388062){logger[_0xb0f4('0xc')](_0xb0f4('0xd'),_0x584cb3,_0xb0f4('0xe'));logger[_0xb0f4('0xf')](_0xb0f4('0x10'),_0x584cb3,'request\x20sent',JSON[_0xb0f4('0x11')](_0x388062));if(_0x388062[_0xb0f4('0x12')]){if(_0x388062['error'][_0xb0f4('0x13')]===0x1f4){logger[_0xb0f4('0x12')](_0xb0f4('0xd'),_0x584cb3,_0x388062[_0xb0f4('0x12')][_0xb0f4('0x14')]);return _0x2cfa11(_0x388062[_0xb0f4('0x12')][_0xb0f4('0x14')]);}logger['error'](_0xb0f4('0xd'),_0x584cb3,_0x388062[_0xb0f4('0x12')][_0xb0f4('0x14')]);return _0xb86859(_0x388062[_0xb0f4('0x12')][_0xb0f4('0x14')]);}else{logger[_0xb0f4('0xc')](_0xb0f4('0xd'),_0x584cb3,_0xb0f4('0xe'));_0xb86859(_0x388062['result']['message']);}})[_0xb0f4('0x15')](function(_0x494b9b){logger[_0xb0f4('0x12')](_0xb0f4('0xd'),_0x584cb3,_0x494b9b);_0x2cfa11(_0x494b9b);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 1daa62f..0d563f3 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 _0x14cc=['delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','show','put','isAuthenticated'];(function(_0x77b4a4,_0xbdb59d){var _0x3f0d95=function(_0x196d79){while(--_0x196d79){_0x77b4a4['push'](_0x77b4a4['shift']());}};_0x3f0d95(++_0xbdb59d);}(_0x14cc,0xa7));var _0xc14c=function(_0x11e03f,_0x20b967){_0x11e03f=_0x11e03f-0x0;var _0x5666fe=_0x14cc[_0x11e03f];return _0x5666fe;};'use strict';var multer=require(_0xc14c('0x0'));var util=require(_0xc14c('0x1'));var path=require('path');var timeout=require(_0xc14c('0x2'));var express=require('express');var router=express[_0xc14c('0x3')]();var fs_extra=require(_0xc14c('0x4'));var auth=require(_0xc14c('0x5'));var interaction=require(_0xc14c('0x6'));var config=require(_0xc14c('0x7'));var controller=require('./chatApplication.controller');router[_0xc14c('0x8')](_0xc14c('0x9'),auth['isAuthenticated'](),controller[_0xc14c('0xa')]);router[_0xc14c('0xb')](_0xc14c('0x9'),auth[_0xc14c('0xc')](),controller['update']);router[_0xc14c('0xd')](_0xc14c('0x9'),auth[_0xc14c('0xc')](),controller['destroy']);module[_0xc14c('0xe')]=router;
\ No newline at end of file
+var _0xc865=['./chatApplication.controller','get','/:id','isAuthenticated','update','delete','exports','util','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x1e97e9,_0x19fa53){var _0x15555d=function(_0x112663){while(--_0x112663){_0x1e97e9['push'](_0x1e97e9['shift']());}};_0x15555d(++_0x19fa53);}(_0xc865,0x1c3));var _0x5c86=function(_0x207c70,_0x503f52){_0x207c70=_0x207c70-0x0;var _0x33f5df=_0xc865[_0x207c70];return _0x33f5df;};'use strict';var multer=require('multer');var util=require(_0x5c86('0x0'));var path=require('path');var timeout=require(_0x5c86('0x1'));var express=require(_0x5c86('0x2'));var router=express[_0x5c86('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5c86('0x4'));var config=require('../../config/environment');var controller=require(_0x5c86('0x5'));router[_0x5c86('0x6')](_0x5c86('0x7'),auth[_0x5c86('0x8')](),controller['show']);router['put'](_0x5c86('0x7'),auth['isAuthenticated'](),controller[_0x5c86('0x9')]);router[_0x5c86('0xa')](_0x5c86('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0x5c86('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index cfa4453..95f10d6 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 _0x6829=['sequelize','exports'];(function(_0xe58f48,_0x3cf2ea){var _0x3297bc=function(_0xf46e13){while(--_0xf46e13){_0xe58f48['push'](_0xe58f48['shift']());}};_0x3297bc(++_0x3cf2ea);}(_0x6829,0x14c));var _0x9682=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x6829[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0x9682('0x0'));module[_0x9682('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x782b=['BOOLEAN','STRING'];(function(_0x47de9a,_0x40cf23){var _0x4b9d6c=function(_0x507054){while(--_0x507054){_0x47de9a['push'](_0x47de9a['shift']());}};_0x4b9d6c(++_0x40cf23);}(_0x782b,0x89));var _0xb782=function(_0x5c0d9a,_0x15d908){_0x5c0d9a=_0x5c0d9a-0x0;var _0x35a6ed=_0x782b[_0x5c0d9a];return _0x35a6ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb782('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xb782('0x1')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 332719c..eaf7ed0 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 _0x5eea=['ids','omit','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','end','sendStatus','stack','name','send','index','map','ChatGroup','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','options','find','create','body','describe','ChatInternalMessage','user','addMembers'];(function(_0x2af627,_0x33d47f){var _0x14eda9=function(_0x38679a){while(--_0x38679a){_0x2af627['push'](_0x2af627['shift']());}};_0x14eda9(++_0x33d47f);}(_0x5eea,0x12c));var _0xa5ee=function(_0x5807d5,_0x96e4b){_0x5807d5=_0x5807d5-0x0;var _0x15aa80=_0x5eea[_0x5807d5];return _0x15aa80;};'use strict';var emlformat=require(_0xa5ee('0x0'));var rimraf=require(_0xa5ee('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa5ee('0x2'));var rp=require(_0xa5ee('0x3'));var moment=require(_0xa5ee('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xa5ee('0x5'));var sox=require(_0xa5ee('0x6'));var csv=require(_0xa5ee('0x7'));var ejs=require(_0xa5ee('0x8'));var fs=require('fs');var fs_extra=require(_0xa5ee('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa5ee('0xa'));var jsforce=require(_0xa5ee('0xb'));var deskjs=require(_0xa5ee('0xc'));var toCsv=require(_0xa5ee('0x7'));var querystring=require(_0xa5ee('0xd'));var Papa=require(_0xa5ee('0xe'));var Redis=require('ioredis');var authService=require(_0xa5ee('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa5ee('0x10'));var hardwareService=require(_0xa5ee('0x11'));var logger=require(_0xa5ee('0x12'))('api');var utils=require(_0xa5ee('0x13'));var config=require(_0xa5ee('0x14'));var licenseUtil=require(_0xa5ee('0x15'));var db=require(_0xa5ee('0x16'))['db'];config['redis']=_[_0xa5ee('0x17')](config[_0xa5ee('0x18')],{'host':_0xa5ee('0x19'),'port':0x18eb});var socket=require(_0xa5ee('0x1a'))(new Redis(config['redis']));require(_0xa5ee('0x1b'))[_0xa5ee('0x1c')](socket);function respondWithStatusCode(_0x47f772,_0x5f3774){_0x5f3774=_0x5f3774||0xcc;return function(_0x725bd){if(_0x725bd){return _0x47f772['sendStatus'](_0x5f3774);}return _0x47f772[_0xa5ee('0x1d')](_0x5f3774)['end']();};}function respondWithResult(_0x2ad95f,_0x561ff4){_0x561ff4=_0x561ff4||0xc8;return function(_0x270e11){if(_0x270e11){return _0x2ad95f[_0xa5ee('0x1d')](_0x561ff4)['json'](_0x270e11);}};}function respondWithFilteredResult(_0x15ab57,_0x4e5043){return function(_0x292c4f){if(_0x292c4f){var _0x3a56a6=typeof _0x4e5043['offset']===_0xa5ee('0x1e')&&typeof _0x4e5043[_0xa5ee('0x1f')]==='undefined';var _0x3a5c5f=_0x292c4f[_0xa5ee('0x20')];var _0x11a8ca=_0x3a56a6?0x0:_0x4e5043[_0xa5ee('0x21')];var _0x57e46b=_0x3a56a6?_0x292c4f[_0xa5ee('0x20')]:_0x4e5043['offset']+_0x4e5043['limit'];var _0xdec5;if(_0x57e46b>=_0x3a5c5f){_0x57e46b=_0x3a5c5f;_0xdec5=0xc8;}else{_0xdec5=0xce;}_0x15ab57[_0xa5ee('0x1d')](_0xdec5);return _0x15ab57[_0xa5ee('0x22')](_0xa5ee('0x23'),_0x11a8ca+'-'+_0x57e46b+'/'+_0x3a5c5f)[_0xa5ee('0x24')](_0x292c4f);}return null;};}function patchUpdates(_0x3f45d3){return function(_0x5af67d){try{jsonpatch[_0xa5ee('0x25')](_0x5af67d,_0x3f45d3,!![]);}catch(_0x4bf73b){return BPromise[_0xa5ee('0x26')](_0x4bf73b);}return _0x5af67d[_0xa5ee('0x27')]();};}function saveUpdates(_0x2c2f30,_0x32f9b8){return function(_0x467771){if(_0x467771){return _0x467771['update'](_0x2c2f30)[_0xa5ee('0x28')](function(_0x4af839){return _0x4af839;});}return null;};}function removeEntity(_0x556594,_0x3c9456){return function(_0x564cc0){if(_0x564cc0){return _0x564cc0[_0xa5ee('0x29')]()['then'](function(){_0x556594[_0xa5ee('0x1d')](0xcc)[_0xa5ee('0x2a')]();});}};}function handleEntityNotFound(_0x1d9b54,_0x46ec83){return function(_0x52395a){if(!_0x52395a){_0x1d9b54[_0xa5ee('0x2b')](0x194);}return _0x52395a;};}function handleError(_0x332ebe,_0x2056de){_0x2056de=_0x2056de||0x1f4;return function(_0x375192){logger['error'](_0x375192[_0xa5ee('0x2c')]);if(_0x375192[_0xa5ee('0x2d')]){delete _0x375192[_0xa5ee('0x2d')];}_0x332ebe[_0xa5ee('0x1d')](_0x2056de)[_0xa5ee('0x2e')](_0x375192);};}exports[_0xa5ee('0x2f')]=function(_0x722c,_0x11907c){var _0x4f7842={},_0x3e3e04={},_0x2f7433={'count':0x0,'rows':[]};var _0x95753a=_[_0xa5ee('0x30')](db[_0xa5ee('0x31')][_0xa5ee('0x32')],function(_0x519607){return{'name':_0x519607['fieldName'],'type':_0x519607[_0xa5ee('0x33')][_0xa5ee('0x34')]};});_0x3e3e04[_0xa5ee('0x35')]=_[_0xa5ee('0x30')](_0x95753a,'name');_0x3e3e04[_0xa5ee('0x36')]=_[_0xa5ee('0x37')](_0x722c[_0xa5ee('0x36')]);_0x3e3e04[_0xa5ee('0x38')]=_['intersection'](_0x3e3e04[_0xa5ee('0x35')],_0x3e3e04[_0xa5ee('0x36')]);_0x4f7842[_0xa5ee('0x39')]=_[_0xa5ee('0x3a')](_0x3e3e04[_0xa5ee('0x35')],qs[_0xa5ee('0x3b')](_0x722c[_0xa5ee('0x36')][_0xa5ee('0x3b')]));_0x4f7842['attributes']=_0x4f7842[_0xa5ee('0x39')][_0xa5ee('0x3c')]?_0x4f7842[_0xa5ee('0x39')]:_0x3e3e04[_0xa5ee('0x35')];if(!_0x722c[_0xa5ee('0x36')][_0xa5ee('0x3d')](_0xa5ee('0x3e'))){_0x4f7842[_0xa5ee('0x1f')]=qs['limit'](_0x722c[_0xa5ee('0x36')][_0xa5ee('0x1f')]);_0x4f7842[_0xa5ee('0x21')]=qs[_0xa5ee('0x21')](_0x722c['query']['offset']);}_0x4f7842[_0xa5ee('0x3f')]=qs['sort'](_0x722c[_0xa5ee('0x36')][_0xa5ee('0x40')]);_0x4f7842[_0xa5ee('0x41')]=qs[_0xa5ee('0x38')](_[_0xa5ee('0x42')](_0x722c[_0xa5ee('0x36')],_0x3e3e04[_0xa5ee('0x38')]),_0x95753a);if(_0x722c[_0xa5ee('0x36')][_0xa5ee('0x43')]){_0x4f7842[_0xa5ee('0x41')]=_['merge'](_0x4f7842[_0xa5ee('0x41')],{'$or':_[_0xa5ee('0x30')](_0x95753a,function(_0x1a4705){if(_0x1a4705[_0xa5ee('0x33')]!==_0xa5ee('0x44')){var _0xb2a4fa={};_0xb2a4fa[_0x1a4705[_0xa5ee('0x2d')]]={'$like':'%'+_0x722c[_0xa5ee('0x36')][_0xa5ee('0x43')]+'%'};return _0xb2a4fa;}})});}_0x4f7842=_[_0xa5ee('0x45')]({},_0x4f7842,_0x722c['options']);var _0x33654d={'where':_0x4f7842[_0xa5ee('0x41')]};return db[_0xa5ee('0x31')][_0xa5ee('0x20')](_0x33654d)['then'](function(_0x4907d4){_0x2f7433[_0xa5ee('0x20')]=_0x4907d4;if(_0x722c['query'][_0xa5ee('0x46')]){_0x4f7842[_0xa5ee('0x47')]=[{'all':!![]}];}return db[_0xa5ee('0x31')][_0xa5ee('0x48')](_0x4f7842);})[_0xa5ee('0x28')](function(_0x22d739){_0x2f7433['rows']=_0x22d739;return _0x2f7433;})[_0xa5ee('0x28')](respondWithFilteredResult(_0x11907c,_0x4f7842))[_0xa5ee('0x49')](handleError(_0x11907c,null));};exports[_0xa5ee('0x4a')]=function(_0x23571c,_0x53c86a){var _0x54bb96={'raw':!![],'where':{'id':_0x23571c[_0xa5ee('0x4b')]['id']}},_0x3b6e2d={};_0x3b6e2d[_0xa5ee('0x35')]=_[_0xa5ee('0x37')](db[_0xa5ee('0x31')][_0xa5ee('0x32')]);_0x3b6e2d[_0xa5ee('0x36')]=_[_0xa5ee('0x37')](_0x23571c[_0xa5ee('0x36')]);_0x3b6e2d['filters']=_[_0xa5ee('0x3a')](_0x3b6e2d['model'],_0x3b6e2d['query']);_0x54bb96[_0xa5ee('0x39')]=_[_0xa5ee('0x3a')](_0x3b6e2d[_0xa5ee('0x35')],qs[_0xa5ee('0x3b')](_0x23571c[_0xa5ee('0x36')][_0xa5ee('0x3b')]));_0x54bb96[_0xa5ee('0x39')]=_0x54bb96[_0xa5ee('0x39')][_0xa5ee('0x3c')]?_0x54bb96[_0xa5ee('0x39')]:_0x3b6e2d['model'];if(_0x23571c['query'][_0xa5ee('0x46')]){_0x54bb96[_0xa5ee('0x47')]=[{'all':!![]}];}_0x54bb96=_[_0xa5ee('0x45')]({},_0x54bb96,_0x23571c[_0xa5ee('0x4c')]);return db[_0xa5ee('0x31')][_0xa5ee('0x4d')](_0x54bb96)[_0xa5ee('0x28')](handleEntityNotFound(_0x53c86a,null))[_0xa5ee('0x28')](respondWithResult(_0x53c86a,null))[_0xa5ee('0x49')](handleError(_0x53c86a,null));};exports[_0xa5ee('0x4e')]=function(_0x5340b4,_0x59ffa3){return db[_0xa5ee('0x31')][_0xa5ee('0x4e')](_0x5340b4[_0xa5ee('0x4f')],{})[_0xa5ee('0x28')](respondWithResult(_0x59ffa3,0xc9))['catch'](handleError(_0x59ffa3,null));};exports['update']=function(_0x525ca9,_0x467ab6){if(_0x525ca9[_0xa5ee('0x4f')]['id']){delete _0x525ca9['body']['id'];}return db[_0xa5ee('0x31')]['find']({'where':{'id':_0x525ca9['params']['id']}})[_0xa5ee('0x28')](handleEntityNotFound(_0x467ab6,null))[_0xa5ee('0x28')](saveUpdates(_0x525ca9[_0xa5ee('0x4f')],null))[_0xa5ee('0x28')](respondWithResult(_0x467ab6,null))[_0xa5ee('0x49')](handleError(_0x467ab6,null));};exports[_0xa5ee('0x29')]=function(_0x16b7f3,_0x99d2a6){return db[_0xa5ee('0x31')][_0xa5ee('0x4d')]({'where':{'id':_0x16b7f3['params']['id']}})[_0xa5ee('0x28')](handleEntityNotFound(_0x99d2a6,null))[_0xa5ee('0x28')](removeEntity(_0x99d2a6,null))[_0xa5ee('0x49')](handleError(_0x99d2a6,null));};exports['describe']=function(_0x5e2299,_0x390d13){return db[_0xa5ee('0x31')][_0xa5ee('0x50')]()[_0xa5ee('0x28')](respondWithResult(_0x390d13,null))[_0xa5ee('0x49')](handleError(_0x390d13,null));};exports['getUnread']=function(_0x3f61a8,_0x3b3ebe,_0x426dcf){return db[_0xa5ee('0x51')][_0xa5ee('0x20')]({'where':{'ChatGroupId':_0x3f61a8[_0xa5ee('0x4b')]['id'],'ToId':_0x3f61a8[_0xa5ee('0x52')]['id'],'read':![]}})[_0xa5ee('0x28')](function(_0x55949b){return{'id':_['toInteger'](_0x3f61a8['params']['id']),'count':_0x55949b};})['then'](respondWithResult(_0x3b3ebe,null))['catch'](handleError(_0x3b3ebe,null));};exports[_0xa5ee('0x53')]=function(_0x2a7614,_0x1dce9e,_0xfa5668){return db[_0xa5ee('0x31')][_0xa5ee('0x4d')]({'where':{'id':_0x2a7614['params']['id']}})['then'](handleEntityNotFound(_0x1dce9e,null))['then'](function(_0x389a5b){if(_0x389a5b){return _0x389a5b[_0xa5ee('0x53')](_0x2a7614[_0xa5ee('0x4f')][_0xa5ee('0x54')],_[_0xa5ee('0x55')](_0x2a7614[_0xa5ee('0x4f')],[_0xa5ee('0x54'),'id'])||{});}})[_0xa5ee('0x28')](respondWithResult(_0x1dce9e,null))[_0xa5ee('0x49')](handleError(_0x1dce9e,null));};exports[_0xa5ee('0x56')]=function(_0x31f605,_0x5b6ad0,_0x1643d4){var _0x2f8f01={};var _0x291e82={};var _0xe73c8a;var _0x28d05c;return db['ChatGroup'][_0xa5ee('0x57')]({'where':{'id':_0x31f605['params']['id']}})[_0xa5ee('0x28')](handleEntityNotFound(_0x5b6ad0,null))['then'](function(_0x4a2428){if(_0x4a2428){_0xe73c8a=_0x4a2428;_0x291e82[_0xa5ee('0x35')]=_['keys'](db[_0xa5ee('0x58')]['rawAttributes']);_0x291e82[_0xa5ee('0x36')]=_['keys'](_0x31f605['query']);_0x291e82[_0xa5ee('0x38')]=_[_0xa5ee('0x3a')](_0x291e82[_0xa5ee('0x35')],_0x291e82[_0xa5ee('0x36')]);_0x2f8f01['attributes']=_[_0xa5ee('0x3a')](_0x291e82[_0xa5ee('0x35')],qs[_0xa5ee('0x3b')](_0x31f605['query'][_0xa5ee('0x3b')]));_0x2f8f01[_0xa5ee('0x39')]=_0x2f8f01[_0xa5ee('0x39')][_0xa5ee('0x3c')]?_0x2f8f01[_0xa5ee('0x39')]:_0x291e82['model'];_0x2f8f01[_0xa5ee('0x3f')]=qs[_0xa5ee('0x40')](_0x31f605[_0xa5ee('0x36')][_0xa5ee('0x40')]);_0x2f8f01[_0xa5ee('0x41')]=qs[_0xa5ee('0x38')](_[_0xa5ee('0x42')](_0x31f605[_0xa5ee('0x36')],_0x291e82['filters']));if(_0x31f605['query'][_0xa5ee('0x43')]){_0x2f8f01['where']=_[_0xa5ee('0x45')](_0x2f8f01['where'],{'$or':_[_0xa5ee('0x30')](_0x2f8f01[_0xa5ee('0x39')],function(_0x4d796f){var _0x72f77={};_0x72f77[_0x4d796f]={'$like':'%'+_0x31f605[_0xa5ee('0x36')][_0xa5ee('0x43')]+'%'};return _0x72f77;})});}_0x2f8f01=_[_0xa5ee('0x45')]({},_0x2f8f01,_0x31f605[_0xa5ee('0x4c')]);return _0xe73c8a[_0xa5ee('0x56')](_0x2f8f01);}})[_0xa5ee('0x28')](function(_0x561b4f){if(_0x561b4f){_0x28d05c=_0x561b4f[_0xa5ee('0x3c')];if(!_0x31f605[_0xa5ee('0x36')]['hasOwnProperty'](_0xa5ee('0x3e'))){_0x2f8f01['limit']=qs[_0xa5ee('0x1f')](_0x31f605['query']['limit']);_0x2f8f01['offset']=qs[_0xa5ee('0x21')](_0x31f605[_0xa5ee('0x36')][_0xa5ee('0x21')]);}return _0xe73c8a['getMembers'](_0x2f8f01);}})[_0xa5ee('0x28')](function(_0x454d3b){if(_0x454d3b){return _0x454d3b?{'count':_0x28d05c,'rows':_0x454d3b}:null;}})[_0xa5ee('0x28')](respondWithResult(_0x5b6ad0,null))[_0xa5ee('0x49')](handleError(_0x5b6ad0,null));};exports[_0xa5ee('0x59')]=function(_0x48fdee,_0x39b065,_0x19dffc){return db[_0xa5ee('0x31')][_0xa5ee('0x4d')]({'where':{'id':_0x48fdee[_0xa5ee('0x4b')]['id']}})[_0xa5ee('0x28')](handleEntityNotFound(_0x39b065,null))[_0xa5ee('0x28')](function(_0x54b575){if(_0x54b575){return _0x54b575[_0xa5ee('0x59')](_0x48fdee[_0xa5ee('0x36')][_0xa5ee('0x54')]);}})[_0xa5ee('0x28')](respondWithStatusCode(_0x39b065,null))[_0xa5ee('0x49')](handleError(_0x39b065,null));};exports[_0xa5ee('0x5a')]=function(_0x1d0bef,_0x2cb03d,_0x16d605){if(_0x1d0bef[_0xa5ee('0x4f')]['id']){delete _0x1d0bef[_0xa5ee('0x4f')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x1d0bef[_0xa5ee('0x4b')]['id']}})[_0xa5ee('0x28')](handleEntityNotFound(_0x2cb03d,null))[_0xa5ee('0x28')](function(_0x354fdb){if(_0x354fdb){_0x1d0bef[_0xa5ee('0x4f')][_0xa5ee('0x5b')]=_0x354fdb['id'];return db[_0xa5ee('0x51')][_0xa5ee('0x4e')](_0x1d0bef[_0xa5ee('0x4f')]);}})[_0xa5ee('0x28')](respondWithResult(_0x2cb03d,null))[_0xa5ee('0x49')](handleError(_0x2cb03d,null));};exports['getMessages']=function(_0x14f010,_0x544d77,_0x479e42){var _0x7ee050={};var _0x579465={};var _0x84de6a;var _0x546e36;return db[_0xa5ee('0x31')][_0xa5ee('0x57')]({'where':{'id':_0x14f010['params']['id']}})[_0xa5ee('0x28')](handleEntityNotFound(_0x544d77,null))[_0xa5ee('0x28')](function(_0x258edb){if(_0x258edb){_0x84de6a=_0x258edb;_0x579465[_0xa5ee('0x35')]=_['keys'](db[_0xa5ee('0x51')][_0xa5ee('0x32')]);_0x579465[_0xa5ee('0x36')]=_[_0xa5ee('0x37')](_0x14f010['query']);_0x579465[_0xa5ee('0x38')]=_[_0xa5ee('0x3a')](_0x579465['model'],_0x579465['query']);_0x7ee050[_0xa5ee('0x39')]=_[_0xa5ee('0x3a')](_0x579465['model'],qs[_0xa5ee('0x3b')](_0x14f010[_0xa5ee('0x36')]['fields']));_0x7ee050[_0xa5ee('0x39')]=_0x7ee050[_0xa5ee('0x39')]['length']?_0x7ee050[_0xa5ee('0x39')]:_0x579465[_0xa5ee('0x35')];_0x7ee050['order']=qs['sort'](_0x14f010['query']['sort']);_0x7ee050[_0xa5ee('0x41')]=qs['filters'](_[_0xa5ee('0x42')](_0x14f010[_0xa5ee('0x36')],_0x579465[_0xa5ee('0x38')]));if(_0x14f010[_0xa5ee('0x36')]['filter']){_0x7ee050['where']=_[_0xa5ee('0x45')](_0x7ee050['where'],{'$or':_[_0xa5ee('0x30')](_0x7ee050[_0xa5ee('0x39')],function(_0xb519f8){var _0x4c870c={};_0x4c870c[_0xb519f8]={'$like':'%'+_0x14f010[_0xa5ee('0x36')]['filter']+'%'};return _0x4c870c;})});}if(_0x14f010['query'][_0xa5ee('0x5c')]){var _0x2f4800=_0x14f010[_0xa5ee('0x36')][_0xa5ee('0x5c')]['split'](',');var _0x1966a7={};_0x1966a7[_0x2f4800[0x0]]={'$gte':moment(_0x2f4800[0x1])[_0xa5ee('0x5d')](_0xa5ee('0x5e'))};_0x7ee050[_0xa5ee('0x41')]=_[_0xa5ee('0x45')](_0x7ee050[_0xa5ee('0x41')],_0x1966a7);}_0x7ee050=_[_0xa5ee('0x45')]({},_0x7ee050,_0x14f010[_0xa5ee('0x4c')]);return _0x84de6a[_0xa5ee('0x5f')](_0x7ee050);}})['then'](function(_0x411e5d){if(_0x411e5d){_0x546e36=_0x411e5d['length'];if(!_0x14f010['query'][_0xa5ee('0x3d')](_0xa5ee('0x3e'))){_0x7ee050[_0xa5ee('0x1f')]=qs['limit'](_0x14f010['query'][_0xa5ee('0x1f')]);_0x7ee050[_0xa5ee('0x21')]=qs[_0xa5ee('0x21')](_0x14f010['query'][_0xa5ee('0x21')]);}return _0x84de6a['getMessages'](_0x7ee050);}})[_0xa5ee('0x28')](function(_0x2bd3e0){if(_0x2bd3e0){return _0x2bd3e0?{'count':_0x546e36,'rows':_0x2bd3e0}:null;}})[_0xa5ee('0x28')](respondWithResult(_0x544d77,null))['catch'](handleError(_0x544d77,null));};
\ No newline at end of file
+var _0x284e=['undefined','count','set','Content-Range','apply','save','then','destroy','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','catch','show','params','find','create','body','update','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','merge','hasOwnProperty','nolimit','removeMembers','addMessage','ChatGroupId','$gte','split','format','getMessages','eml-format','zip-dir','fast-json-patch','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit'];(function(_0x38dd04,_0x498e08){var _0x3dca03=function(_0x2c628d){while(--_0x2c628d){_0x38dd04['push'](_0x38dd04['shift']());}};_0x3dca03(++_0x498e08);}(_0x284e,0x1b8));var _0xe284=function(_0x1344f8,_0x40f4fd){_0x1344f8=_0x1344f8-0x0;var _0x3f9e17=_0x284e[_0x1344f8];return _0x3f9e17;};'use strict';var emlformat=require(_0xe284('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe284('0x1'));var jsonpatch=require(_0xe284('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe284('0x3'));var util=require('util');var path=require(_0xe284('0x4'));var sox=require(_0xe284('0x5'));var csv=require(_0xe284('0x6'));var ejs=require(_0xe284('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe284('0x8'));var crypto=require(_0xe284('0x9'));var jsforce=require(_0xe284('0xa'));var deskjs=require(_0xe284('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe284('0xc'));var Redis=require(_0xe284('0xd'));var authService=require(_0xe284('0xe'));var qs=require(_0xe284('0xf'));var as=require(_0xe284('0x10'));var hardwareService=require(_0xe284('0x11'));var logger=require(_0xe284('0x12'))(_0xe284('0x13'));var utils=require(_0xe284('0x14'));var config=require(_0xe284('0x15'));var licenseUtil=require(_0xe284('0x16'));var db=require(_0xe284('0x17'))['db'];config['redis']=_[_0xe284('0x18')](config[_0xe284('0x19')],{'host':_0xe284('0x1a'),'port':0x18eb});var socket=require(_0xe284('0x1b'))(new Redis(config[_0xe284('0x19')]));require('./chatGroup.socket')[_0xe284('0x1c')](socket);function respondWithStatusCode(_0x2e438c,_0x3b3b50){_0x3b3b50=_0x3b3b50||0xcc;return function(_0x37b3db){if(_0x37b3db){return _0x2e438c[_0xe284('0x1d')](_0x3b3b50);}return _0x2e438c[_0xe284('0x1e')](_0x3b3b50)[_0xe284('0x1f')]();};}function respondWithResult(_0x5bfac5,_0x5216b9){_0x5216b9=_0x5216b9||0xc8;return function(_0x12b132){if(_0x12b132){return _0x5bfac5['status'](_0x5216b9)[_0xe284('0x20')](_0x12b132);}};}function respondWithFilteredResult(_0x54934a,_0x116c29){return function(_0x1df140){if(_0x1df140){var _0x2424eb=typeof _0x116c29[_0xe284('0x21')]==='undefined'&&typeof _0x116c29[_0xe284('0x22')]===_0xe284('0x23');var _0x17e3e0=_0x1df140[_0xe284('0x24')];var _0x42bcce=_0x2424eb?0x0:_0x116c29[_0xe284('0x21')];var _0x4e73ab=_0x2424eb?_0x1df140[_0xe284('0x24')]:_0x116c29[_0xe284('0x21')]+_0x116c29[_0xe284('0x22')];var _0x395136;if(_0x4e73ab>=_0x17e3e0){_0x4e73ab=_0x17e3e0;_0x395136=0xc8;}else{_0x395136=0xce;}_0x54934a[_0xe284('0x1e')](_0x395136);return _0x54934a[_0xe284('0x25')](_0xe284('0x26'),_0x42bcce+'-'+_0x4e73ab+'/'+_0x17e3e0)[_0xe284('0x20')](_0x1df140);}return null;};}function patchUpdates(_0x2f3be7){return function(_0x11c9d6){try{jsonpatch[_0xe284('0x27')](_0x11c9d6,_0x2f3be7,!![]);}catch(_0x3750ed){return BPromise['reject'](_0x3750ed);}return _0x11c9d6[_0xe284('0x28')]();};}function saveUpdates(_0x24af82,_0x10cbdc){return function(_0x177a0e){if(_0x177a0e){return _0x177a0e['update'](_0x24af82)[_0xe284('0x29')](function(_0x44543){return _0x44543;});}return null;};}function removeEntity(_0x44274b,_0x539f4f){return function(_0x5b7e5d){if(_0x5b7e5d){return _0x5b7e5d[_0xe284('0x2a')]()[_0xe284('0x29')](function(){_0x44274b[_0xe284('0x1e')](0xcc)[_0xe284('0x1f')]();});}};}function handleEntityNotFound(_0x33cad5,_0x313f31){return function(_0x526547){if(!_0x526547){_0x33cad5[_0xe284('0x1d')](0x194);}return _0x526547;};}function handleError(_0x3713e5,_0x217761){_0x217761=_0x217761||0x1f4;return function(_0x59d74c){logger['error'](_0x59d74c['stack']);if(_0x59d74c[_0xe284('0x2b')]){delete _0x59d74c[_0xe284('0x2b')];}_0x3713e5[_0xe284('0x1e')](_0x217761)[_0xe284('0x2c')](_0x59d74c);};}exports[_0xe284('0x2d')]=function(_0x420686,_0x287914){var _0x3c53f4={},_0xf72ad9={},_0x9a805b={'count':0x0,'rows':[]};var _0x21f2c3=_[_0xe284('0x2e')](db[_0xe284('0x2f')][_0xe284('0x30')],function(_0x2ce5d9){return{'name':_0x2ce5d9[_0xe284('0x31')],'type':_0x2ce5d9[_0xe284('0x32')]['key']};});_0xf72ad9['model']=_['map'](_0x21f2c3,_0xe284('0x2b'));_0xf72ad9[_0xe284('0x33')]=_[_0xe284('0x34')](_0x420686[_0xe284('0x33')]);_0xf72ad9[_0xe284('0x35')]=_[_0xe284('0x36')](_0xf72ad9[_0xe284('0x37')],_0xf72ad9[_0xe284('0x33')]);_0x3c53f4[_0xe284('0x38')]=_[_0xe284('0x36')](_0xf72ad9[_0xe284('0x37')],qs[_0xe284('0x39')](_0x420686[_0xe284('0x33')]['fields']));_0x3c53f4[_0xe284('0x38')]=_0x3c53f4[_0xe284('0x38')][_0xe284('0x3a')]?_0x3c53f4[_0xe284('0x38')]:_0xf72ad9[_0xe284('0x37')];if(!_0x420686[_0xe284('0x33')]['hasOwnProperty']('nolimit')){_0x3c53f4[_0xe284('0x22')]=qs[_0xe284('0x22')](_0x420686[_0xe284('0x33')]['limit']);_0x3c53f4['offset']=qs[_0xe284('0x21')](_0x420686[_0xe284('0x33')]['offset']);}_0x3c53f4[_0xe284('0x3b')]=qs[_0xe284('0x3c')](_0x420686['query']['sort']);_0x3c53f4[_0xe284('0x3d')]=qs[_0xe284('0x35')](_[_0xe284('0x3e')](_0x420686['query'],_0xf72ad9[_0xe284('0x35')]),_0x21f2c3);if(_0x420686['query'][_0xe284('0x3f')]){_0x3c53f4['where']=_['merge'](_0x3c53f4[_0xe284('0x3d')],{'$or':_[_0xe284('0x2e')](_0x21f2c3,function(_0x408c96){if(_0x408c96['type']!==_0xe284('0x40')){var _0x8db404={};_0x8db404[_0x408c96[_0xe284('0x2b')]]={'$like':'%'+_0x420686[_0xe284('0x33')]['filter']+'%'};return _0x8db404;}})});}_0x3c53f4=_['merge']({},_0x3c53f4,_0x420686[_0xe284('0x41')]);var _0x2528f6={'where':_0x3c53f4[_0xe284('0x3d')]};return db['ChatGroup'][_0xe284('0x24')](_0x2528f6)[_0xe284('0x29')](function(_0x4bb30e){_0x9a805b['count']=_0x4bb30e;if(_0x420686[_0xe284('0x33')][_0xe284('0x42')]){_0x3c53f4['include']=[{'all':!![]}];}return db[_0xe284('0x2f')][_0xe284('0x43')](_0x3c53f4);})['then'](function(_0xc2bca3){_0x9a805b['rows']=_0xc2bca3;return _0x9a805b;})['then'](respondWithFilteredResult(_0x287914,_0x3c53f4))[_0xe284('0x44')](handleError(_0x287914,null));};exports[_0xe284('0x45')]=function(_0x1fd30d,_0x43b5e0){var _0x25ac1a={'raw':!![],'where':{'id':_0x1fd30d[_0xe284('0x46')]['id']}},_0x377446={};_0x377446[_0xe284('0x37')]=_[_0xe284('0x34')](db[_0xe284('0x2f')][_0xe284('0x30')]);_0x377446['query']=_['keys'](_0x1fd30d[_0xe284('0x33')]);_0x377446[_0xe284('0x35')]=_['intersection'](_0x377446[_0xe284('0x37')],_0x377446[_0xe284('0x33')]);_0x25ac1a[_0xe284('0x38')]=_['intersection'](_0x377446['model'],qs[_0xe284('0x39')](_0x1fd30d[_0xe284('0x33')][_0xe284('0x39')]));_0x25ac1a[_0xe284('0x38')]=_0x25ac1a[_0xe284('0x38')][_0xe284('0x3a')]?_0x25ac1a[_0xe284('0x38')]:_0x377446['model'];if(_0x1fd30d['query'][_0xe284('0x42')]){_0x25ac1a['include']=[{'all':!![]}];}_0x25ac1a=_['merge']({},_0x25ac1a,_0x1fd30d[_0xe284('0x41')]);return db[_0xe284('0x2f')][_0xe284('0x47')](_0x25ac1a)[_0xe284('0x29')](handleEntityNotFound(_0x43b5e0,null))[_0xe284('0x29')](respondWithResult(_0x43b5e0,null))[_0xe284('0x44')](handleError(_0x43b5e0,null));};exports[_0xe284('0x48')]=function(_0x3b8dd7,_0x424aff){return db[_0xe284('0x2f')][_0xe284('0x48')](_0x3b8dd7[_0xe284('0x49')],{})['then'](respondWithResult(_0x424aff,0xc9))[_0xe284('0x44')](handleError(_0x424aff,null));};exports[_0xe284('0x4a')]=function(_0x3749b4,_0x28165c){if(_0x3749b4[_0xe284('0x49')]['id']){delete _0x3749b4[_0xe284('0x49')]['id'];}return db[_0xe284('0x2f')][_0xe284('0x47')]({'where':{'id':_0x3749b4[_0xe284('0x46')]['id']}})[_0xe284('0x29')](handleEntityNotFound(_0x28165c,null))[_0xe284('0x29')](saveUpdates(_0x3749b4[_0xe284('0x49')],null))[_0xe284('0x29')](respondWithResult(_0x28165c,null))[_0xe284('0x44')](handleError(_0x28165c,null));};exports[_0xe284('0x2a')]=function(_0x14b93a,_0x426db8){return db[_0xe284('0x2f')][_0xe284('0x47')]({'where':{'id':_0x14b93a['params']['id']}})[_0xe284('0x29')](handleEntityNotFound(_0x426db8,null))[_0xe284('0x29')](removeEntity(_0x426db8,null))['catch'](handleError(_0x426db8,null));};exports[_0xe284('0x4b')]=function(_0x557ed1,_0x36f0b6){return db[_0xe284('0x2f')]['describe']()['then'](respondWithResult(_0x36f0b6,null))['catch'](handleError(_0x36f0b6,null));};exports[_0xe284('0x4c')]=function(_0x2c60b9,_0x5962f1,_0x59c09d){return db[_0xe284('0x4d')][_0xe284('0x24')]({'where':{'ChatGroupId':_0x2c60b9[_0xe284('0x46')]['id'],'ToId':_0x2c60b9[_0xe284('0x4e')]['id'],'read':![]}})['then'](function(_0x3e4e34){return{'id':_['toInteger'](_0x2c60b9[_0xe284('0x46')]['id']),'count':_0x3e4e34};})[_0xe284('0x29')](respondWithResult(_0x5962f1,null))['catch'](handleError(_0x5962f1,null));};exports[_0xe284('0x4f')]=function(_0x509d32,_0x345a9a,_0x14b3d9){return db['ChatGroup'][_0xe284('0x47')]({'where':{'id':_0x509d32['params']['id']}})[_0xe284('0x29')](handleEntityNotFound(_0x345a9a,null))[_0xe284('0x29')](function(_0x9ed047){if(_0x9ed047){return _0x9ed047[_0xe284('0x4f')](_0x509d32[_0xe284('0x49')][_0xe284('0x50')],_[_0xe284('0x51')](_0x509d32[_0xe284('0x49')],[_0xe284('0x50'),'id'])||{});}})['then'](respondWithResult(_0x345a9a,null))[_0xe284('0x44')](handleError(_0x345a9a,null));};exports[_0xe284('0x52')]=function(_0x53fd98,_0x1ccf95,_0x453148){var _0x507f5c={};var _0x2a83a7={};var _0x34a519;var _0x54f572;return db[_0xe284('0x2f')][_0xe284('0x53')]({'where':{'id':_0x53fd98[_0xe284('0x46')]['id']}})[_0xe284('0x29')](handleEntityNotFound(_0x1ccf95,null))['then'](function(_0x55be6f){if(_0x55be6f){_0x34a519=_0x55be6f;_0x2a83a7['model']=_[_0xe284('0x34')](db[_0xe284('0x54')][_0xe284('0x30')]);_0x2a83a7['query']=_['keys'](_0x53fd98[_0xe284('0x33')]);_0x2a83a7[_0xe284('0x35')]=_[_0xe284('0x36')](_0x2a83a7[_0xe284('0x37')],_0x2a83a7['query']);_0x507f5c[_0xe284('0x38')]=_[_0xe284('0x36')](_0x2a83a7[_0xe284('0x37')],qs[_0xe284('0x39')](_0x53fd98[_0xe284('0x33')][_0xe284('0x39')]));_0x507f5c[_0xe284('0x38')]=_0x507f5c['attributes']['length']?_0x507f5c['attributes']:_0x2a83a7[_0xe284('0x37')];_0x507f5c['order']=qs['sort'](_0x53fd98[_0xe284('0x33')][_0xe284('0x3c')]);_0x507f5c['where']=qs[_0xe284('0x35')](_[_0xe284('0x3e')](_0x53fd98[_0xe284('0x33')],_0x2a83a7[_0xe284('0x35')]));if(_0x53fd98['query'][_0xe284('0x3f')]){_0x507f5c[_0xe284('0x3d')]=_[_0xe284('0x55')](_0x507f5c[_0xe284('0x3d')],{'$or':_[_0xe284('0x2e')](_0x507f5c[_0xe284('0x38')],function(_0x5523a8){var _0x3da42f={};_0x3da42f[_0x5523a8]={'$like':'%'+_0x53fd98['query'][_0xe284('0x3f')]+'%'};return _0x3da42f;})});}_0x507f5c=_[_0xe284('0x55')]({},_0x507f5c,_0x53fd98[_0xe284('0x41')]);return _0x34a519[_0xe284('0x52')](_0x507f5c);}})[_0xe284('0x29')](function(_0x5c0ca1){if(_0x5c0ca1){_0x54f572=_0x5c0ca1[_0xe284('0x3a')];if(!_0x53fd98[_0xe284('0x33')][_0xe284('0x56')](_0xe284('0x57'))){_0x507f5c[_0xe284('0x22')]=qs['limit'](_0x53fd98[_0xe284('0x33')][_0xe284('0x22')]);_0x507f5c[_0xe284('0x21')]=qs[_0xe284('0x21')](_0x53fd98[_0xe284('0x33')][_0xe284('0x21')]);}return _0x34a519[_0xe284('0x52')](_0x507f5c);}})[_0xe284('0x29')](function(_0x1f598f){if(_0x1f598f){return _0x1f598f?{'count':_0x54f572,'rows':_0x1f598f}:null;}})[_0xe284('0x29')](respondWithResult(_0x1ccf95,null))[_0xe284('0x44')](handleError(_0x1ccf95,null));};exports[_0xe284('0x58')]=function(_0x30a0a1,_0xe0f5b,_0x482205){return db[_0xe284('0x2f')][_0xe284('0x47')]({'where':{'id':_0x30a0a1[_0xe284('0x46')]['id']}})[_0xe284('0x29')](handleEntityNotFound(_0xe0f5b,null))[_0xe284('0x29')](function(_0x224d5c){if(_0x224d5c){return _0x224d5c[_0xe284('0x58')](_0x30a0a1[_0xe284('0x33')][_0xe284('0x50')]);}})[_0xe284('0x29')](respondWithStatusCode(_0xe0f5b,null))['catch'](handleError(_0xe0f5b,null));};exports[_0xe284('0x59')]=function(_0x2d27b7,_0x4a69ae,_0x310ee0){if(_0x2d27b7['body']['id']){delete _0x2d27b7[_0xe284('0x49')]['id'];}return db[_0xe284('0x2f')][_0xe284('0x47')]({'where':{'id':_0x2d27b7['params']['id']}})[_0xe284('0x29')](handleEntityNotFound(_0x4a69ae,null))['then'](function(_0x3b53ae){if(_0x3b53ae){_0x2d27b7[_0xe284('0x49')][_0xe284('0x5a')]=_0x3b53ae['id'];return db[_0xe284('0x4d')]['create'](_0x2d27b7[_0xe284('0x49')]);}})[_0xe284('0x29')](respondWithResult(_0x4a69ae,null))[_0xe284('0x44')](handleError(_0x4a69ae,null));};exports['getMessages']=function(_0x32c3e2,_0x509e88,_0x447eae){var _0x1d6772={};var _0x31607e={};var _0x4c5135;var _0xd3c4bd;return db[_0xe284('0x2f')][_0xe284('0x53')]({'where':{'id':_0x32c3e2['params']['id']}})[_0xe284('0x29')](handleEntityNotFound(_0x509e88,null))[_0xe284('0x29')](function(_0x19a920){if(_0x19a920){_0x4c5135=_0x19a920;_0x31607e[_0xe284('0x37')]=_[_0xe284('0x34')](db[_0xe284('0x4d')][_0xe284('0x30')]);_0x31607e['query']=_['keys'](_0x32c3e2[_0xe284('0x33')]);_0x31607e[_0xe284('0x35')]=_['intersection'](_0x31607e['model'],_0x31607e[_0xe284('0x33')]);_0x1d6772[_0xe284('0x38')]=_[_0xe284('0x36')](_0x31607e[_0xe284('0x37')],qs[_0xe284('0x39')](_0x32c3e2[_0xe284('0x33')]['fields']));_0x1d6772[_0xe284('0x38')]=_0x1d6772[_0xe284('0x38')][_0xe284('0x3a')]?_0x1d6772[_0xe284('0x38')]:_0x31607e[_0xe284('0x37')];_0x1d6772['order']=qs['sort'](_0x32c3e2['query']['sort']);_0x1d6772[_0xe284('0x3d')]=qs[_0xe284('0x35')](_['pick'](_0x32c3e2[_0xe284('0x33')],_0x31607e['filters']));if(_0x32c3e2['query'][_0xe284('0x3f')]){_0x1d6772['where']=_[_0xe284('0x55')](_0x1d6772[_0xe284('0x3d')],{'$or':_[_0xe284('0x2e')](_0x1d6772[_0xe284('0x38')],function(_0x52f2be){var _0x4e5301={};_0x4e5301[_0x52f2be]={'$like':'%'+_0x32c3e2[_0xe284('0x33')]['filter']+'%'};return _0x4e5301;})});}if(_0x32c3e2[_0xe284('0x33')][_0xe284('0x5b')]){var _0x23e134=_0x32c3e2[_0xe284('0x33')][_0xe284('0x5b')][_0xe284('0x5c')](',');var _0x3ec486={};_0x3ec486[_0x23e134[0x0]]={'$gte':moment(_0x23e134[0x1])[_0xe284('0x5d')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1d6772[_0xe284('0x3d')]=_[_0xe284('0x55')](_0x1d6772['where'],_0x3ec486);}_0x1d6772=_[_0xe284('0x55')]({},_0x1d6772,_0x32c3e2[_0xe284('0x41')]);return _0x4c5135[_0xe284('0x5e')](_0x1d6772);}})['then'](function(_0xef48fb){if(_0xef48fb){_0xd3c4bd=_0xef48fb[_0xe284('0x3a')];if(!_0x32c3e2[_0xe284('0x33')][_0xe284('0x56')](_0xe284('0x57'))){_0x1d6772[_0xe284('0x22')]=qs[_0xe284('0x22')](_0x32c3e2['query'][_0xe284('0x22')]);_0x1d6772['offset']=qs['offset'](_0x32c3e2[_0xe284('0x33')]['offset']);}return _0x4c5135[_0xe284('0x5e')](_0x1d6772);}})[_0xe284('0x29')](function(_0x3229cd){if(_0x3229cd){return _0x3229cd?{'count':_0xd3c4bd,'rows':_0x3229cd}:null;}})[_0xe284('0x29')](respondWithResult(_0x509e88,null))[_0xe284('0x44')](handleError(_0x509e88,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 1747bf5..3a9c67e 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 _0x12b6=['events','../../mysqldb','save','remove','emit','hook','exports'];(function(_0x6534a0,_0x475ba5){var _0x2a279a=function(_0x4871e6){while(--_0x4871e6){_0x6534a0['push'](_0x6534a0['shift']());}};_0x2a279a(++_0x475ba5);}(_0x12b6,0x1b9));var _0x612b=function(_0x269aac,_0x426352){_0x269aac=_0x269aac-0x0;var _0x52f530=_0x12b6[_0x269aac];return _0x52f530;};'use strict';var EventEmitter=require(_0x612b('0x0'));var ChatGroup=require(_0x612b('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x612b('0x2'),'afterUpdate':'update','afterDestroy':_0x612b('0x3')};function emitEvent(_0x39113d){return function(_0x489cb0,_0x317928,_0x1d70a7){ChatGroupEvents['emit'](_0x39113d+':'+_0x489cb0['id'],_0x489cb0);ChatGroupEvents[_0x612b('0x4')](_0x39113d,_0x489cb0);_0x1d70a7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x612b('0x5')](e,emitEvent(event));}}module[_0x612b('0x6')]=ChatGroupEvents;
\ No newline at end of file
+var _0x847f=['hook','exports','events','../../mysqldb','setMaxListeners','save','hasOwnProperty'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x847f,0xb8));var _0xf847=function(_0x27125a,_0x252d0d){_0x27125a=_0x27125a-0x0;var _0x391f7a=_0x847f[_0x27125a];return _0x391f7a;};'use strict';var EventEmitter=require(_0xf847('0x0'));var ChatGroup=require(_0xf847('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xf847('0x2')](0x0);var events={'afterCreate':_0xf847('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x50e00b){return function(_0x8d0a9c,_0x4fe7b9,_0x3299b1){ChatGroupEvents['emit'](_0x50e00b+':'+_0x8d0a9c['id'],_0x8d0a9c);ChatGroupEvents['emit'](_0x50e00b,_0x8d0a9c);_0x3299b1(null);};}for(var e in events){if(events[_0xf847('0x4')](e)){var event=events[e];ChatGroup[_0xf847('0x5')](e,emitEvent(event));}}module[_0xf847('0x6')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index c69f08c..f3be36f 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 _0x492f=['define','ChatGroup','chat_groups','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3ba46e,_0x35da73){var _0x39bdba=function(_0x5e9d2b){while(--_0x5e9d2b){_0x3ba46e['push'](_0x3ba46e['shift']());}};_0x39bdba(++_0x35da73);}(_0x492f,0xb7));var _0xf492=function(_0xb62ac5,_0x2da758){_0xb62ac5=_0xb62ac5-0x0;var _0x1d63ec=_0x492f[_0xb62ac5];return _0x1d63ec;};'use strict';var _=require(_0xf492('0x0'));var util=require('util');var logger=require(_0xf492('0x1'))(_0xf492('0x2'));var moment=require(_0xf492('0x3'));var BPromise=require(_0xf492('0x4'));var rp=require(_0xf492('0x5'));var fs=require('fs');var path=require(_0xf492('0x6'));var rimraf=require(_0xf492('0x7'));var config=require(_0xf492('0x8'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x3b0691,_0x2aee3f){return _0x3b0691[_0xf492('0x9')](_0xf492('0xa'),attributes,{'tableName':_0xf492('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xff47=['bluebird','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','../../config/logger','moment'];(function(_0x415e37,_0x35dff9){var _0x29153d=function(_0x1e3af2){while(--_0x1e3af2){_0x415e37['push'](_0x415e37['shift']());}};_0x29153d(++_0x35dff9);}(_0xff47,0x13d));var _0x7ff4=function(_0x1dc2b4,_0x573a04){_0x1dc2b4=_0x1dc2b4-0x0;var _0x18af92=_0xff47[_0x1dc2b4];return _0x18af92;};'use strict';var _=require(_0x7ff4('0x0'));var util=require('util');var logger=require(_0x7ff4('0x1'))('api');var moment=require(_0x7ff4('0x2'));var BPromise=require(_0x7ff4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7ff4('0x4'));var attributes=require(_0x7ff4('0x5'));module[_0x7ff4('0x6')]=function(_0x3f4fe2,_0x5b6c4e){return _0x3f4fe2[_0x7ff4('0x7')](_0x7ff4('0x8'),attributes,{'tableName':_0x7ff4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 3012b97..8cffe65 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 _0xb833=['catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb833,0x105));var _0x3b83=function(_0x111b47,_0x455ba7){_0x111b47=_0x111b47-0x0;var _0x2c8cf3=_0xb833[_0x111b47];return _0x2c8cf3;};'use strict';var _=require(_0x3b83('0x0'));var util=require(_0x3b83('0x1'));var moment=require(_0x3b83('0x2'));var BPromise=require('bluebird');var rs=require(_0x3b83('0x3'));var fs=require('fs');var Redis=require(_0x3b83('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3b83('0x5'));var logger=require(_0x3b83('0x6'))(_0x3b83('0x7'));var config=require(_0x3b83('0x8'));var jayson=require(_0x3b83('0x9'));var client=jayson['client'][_0x3b83('0xa')]({'port':0x232a});config[_0x3b83('0xb')]=_['defaults'](config[_0x3b83('0xb')],{'host':_0x3b83('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3b83('0xb')]));require(_0x3b83('0xd'))[_0x3b83('0xe')](socket);function respondWithRpcPromise(_0x8cec17,_0x4a7ce6,_0x371511){return new BPromise(function(_0x10c369,_0x532a3b){return client[_0x3b83('0xf')](_0x8cec17,_0x371511)['then'](function(_0x19aa94){logger[_0x3b83('0x10')](_0x3b83('0x11'),_0x4a7ce6,'request\x20sent');logger['debug'](_0x3b83('0x12'),_0x4a7ce6,_0x3b83('0x13'),JSON[_0x3b83('0x14')](_0x19aa94));if(_0x19aa94[_0x3b83('0x15')]){if(_0x19aa94[_0x3b83('0x15')][_0x3b83('0x16')]===0x1f4){logger[_0x3b83('0x15')]('ChatGroup,\x20%s,\x20%s',_0x4a7ce6,_0x19aa94[_0x3b83('0x15')][_0x3b83('0x17')]);return _0x532a3b(_0x19aa94['error'][_0x3b83('0x17')]);}logger[_0x3b83('0x15')](_0x3b83('0x11'),_0x4a7ce6,_0x19aa94['error'][_0x3b83('0x17')]);return _0x10c369(_0x19aa94[_0x3b83('0x15')][_0x3b83('0x17')]);}else{logger[_0x3b83('0x10')](_0x3b83('0x11'),_0x4a7ce6,_0x3b83('0x13'));_0x10c369(_0x19aa94[_0x3b83('0x18')][_0x3b83('0x17')]);}})[_0x3b83('0x19')](function(_0x14ba00){logger['error']('ChatGroup,\x20%s,\x20%s',_0x4a7ce6,_0x14ba00);_0x532a3b(_0x14ba00);});});}
\ No newline at end of file
+var _0xcd3a=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','./chatGroup.socket','register','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x32eb18,_0x332131){var _0x5d9f6c=function(_0x56cd9b){while(--_0x56cd9b){_0x32eb18['push'](_0x32eb18['shift']());}};_0x5d9f6c(++_0x332131);}(_0xcd3a,0xcf));var _0xacd3=function(_0x14253d,_0x5e5b44){_0x14253d=_0x14253d-0x0;var _0x1ab618=_0xcd3a[_0x14253d];return _0x1ab618;};'use strict';var _=require(_0xacd3('0x0'));var util=require(_0xacd3('0x1'));var moment=require(_0xacd3('0x2'));var BPromise=require(_0xacd3('0x3'));var rs=require(_0xacd3('0x4'));var fs=require('fs');var Redis=require(_0xacd3('0x5'));var db=require(_0xacd3('0x6'))['db'];var utils=require(_0xacd3('0x7'));var logger=require('../../config/logger')(_0xacd3('0x8'));var config=require(_0xacd3('0x9'));var jayson=require(_0xacd3('0xa'));var client=jayson[_0xacd3('0xb')]['http']({'port':0x232a});config['redis']=_[_0xacd3('0xc')](config[_0xacd3('0xd')],{'host':_0xacd3('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xacd3('0xd')]));require(_0xacd3('0xf'))[_0xacd3('0x10')](socket);function respondWithRpcPromise(_0x2b5702,_0x5c0e56,_0x106fee){return new BPromise(function(_0x5c85b5,_0x29d379){return client[_0xacd3('0x11')](_0x2b5702,_0x106fee)[_0xacd3('0x12')](function(_0x198184){logger['info'](_0xacd3('0x13'),_0x5c0e56,_0xacd3('0x14'));logger[_0xacd3('0x15')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x5c0e56,'request\x20sent',JSON[_0xacd3('0x16')](_0x198184));if(_0x198184[_0xacd3('0x17')]){if(_0x198184['error'][_0xacd3('0x18')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x5c0e56,_0x198184[_0xacd3('0x17')][_0xacd3('0x19')]);return _0x29d379(_0x198184['error'][_0xacd3('0x19')]);}logger[_0xacd3('0x17')](_0xacd3('0x13'),_0x5c0e56,_0x198184['error'][_0xacd3('0x19')]);return _0x5c85b5(_0x198184[_0xacd3('0x17')]['message']);}else{logger[_0xacd3('0x1a')](_0xacd3('0x13'),_0x5c0e56,_0xacd3('0x14'));_0x5c85b5(_0x198184[_0xacd3('0x1b')][_0xacd3('0x19')]);}})[_0xacd3('0x1c')](function(_0x477b60){logger[_0xacd3('0x17')]('ChatGroup,\x20%s,\x20%s',_0x5c0e56,_0x477b60);_0x29d379(_0x477b60);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index e203c09..94a5a1d 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 _0xfec9=['removeListener','register','length','./chatGroup.events','save','remove','update','emit'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xfec9,0xeb));var _0x9fec=function(_0xa2ba12,_0x3430e3){_0xa2ba12=_0xa2ba12-0x0;var _0x3e32d3=_0xfec9[_0xa2ba12];return _0x3e32d3;};'use strict';var ChatGroupEvents=require(_0x9fec('0x0'));var events=[_0x9fec('0x1'),_0x9fec('0x2'),_0x9fec('0x3')];function createListener(_0x51e5e5,_0x148c8f){return function(_0x2ef68c){_0x148c8f[_0x9fec('0x4')](_0x51e5e5,_0x2ef68c);};}function removeListener(_0x1faf0b,_0x1973de){return function(){ChatGroupEvents[_0x9fec('0x5')](_0x1faf0b,_0x1973de);};}exports[_0x9fec('0x6')]=function(_0x41b14e){for(var _0x4f2691=0x0,_0x5488c8=events[_0x9fec('0x7')];_0x4f2691<_0x5488c8;_0x4f2691++){var _0xfabdea=events[_0x4f2691];var _0x5c0eeb=createListener('chatGroup:'+_0xfabdea,_0x41b14e);ChatGroupEvents['on'](_0xfabdea,_0x5c0eeb);}};
\ No newline at end of file
+var _0xb96d=['remove','update','emit','removeListener','register','length','./chatGroup.events','save'];(function(_0x529fd0,_0x17a79b){var _0x11ad54=function(_0x22964e){while(--_0x22964e){_0x529fd0['push'](_0x529fd0['shift']());}};_0x11ad54(++_0x17a79b);}(_0xb96d,0x1d6));var _0xdb96=function(_0x29d6e6,_0x264220){_0x29d6e6=_0x29d6e6-0x0;var _0xc75ff0=_0xb96d[_0x29d6e6];return _0xc75ff0;};'use strict';var ChatGroupEvents=require(_0xdb96('0x0'));var events=[_0xdb96('0x1'),_0xdb96('0x2'),_0xdb96('0x3')];function createListener(_0x51338c,_0x1d3fce){return function(_0x36192b){_0x1d3fce[_0xdb96('0x4')](_0x51338c,_0x36192b);};}function removeListener(_0x360852,_0x337129){return function(){ChatGroupEvents[_0xdb96('0x5')](_0x360852,_0x337129);};}exports[_0xdb96('0x6')]=function(_0x49279f){for(var _0x318232=0x0,_0x11722b=events[_0xdb96('0x7')];_0x318232<_0x11722b;_0x318232++){var _0xc8df95=events[_0x318232];var _0x429e3a=createListener('chatGroup:'+_0xc8df95,_0x49279f);ChatGroupEvents['on'](_0xc8df95,_0x429e3a);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index e0acd03..9813a78 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 _0x2d5d=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','/:id','update','delete','exports','multer','util','connect-timeout','express','Router'];(function(_0x6bb245,_0x5802b8){var _0x2333c8=function(_0xc4869b){while(--_0xc4869b){_0x6bb245['push'](_0x6bb245['shift']());}};_0x2333c8(++_0x5802b8);}(_0x2d5d,0x1db));var _0xd2d5=function(_0x5e5f0f,_0x3a98bd){_0x5e5f0f=_0x5e5f0f-0x0;var _0x4eb83d=_0x2d5d[_0x5e5f0f];return _0x4eb83d;};'use strict';var multer=require(_0xd2d5('0x0'));var util=require(_0xd2d5('0x1'));var path=require('path');var timeout=require(_0xd2d5('0x2'));var express=require(_0xd2d5('0x3'));var router=express[_0xd2d5('0x4')]();var fs_extra=require(_0xd2d5('0x5'));var auth=require(_0xd2d5('0x6'));var interaction=require(_0xd2d5('0x7'));var config=require(_0xd2d5('0x8'));var controller=require(_0xd2d5('0x9'));router[_0xd2d5('0xa')]('/',auth[_0xd2d5('0xb')](),controller[_0xd2d5('0xc')]);router['get'](_0xd2d5('0xd'),auth[_0xd2d5('0xb')](),controller[_0xd2d5('0xe')]);router[_0xd2d5('0xa')]('/:id',auth[_0xd2d5('0xb')](),controller[_0xd2d5('0xf')]);router[_0xd2d5('0xa')]('/:id/unread',auth[_0xd2d5('0xb')](),controller[_0xd2d5('0x10')]);router[_0xd2d5('0xa')](_0xd2d5('0x11'),auth['isAuthenticated'](),controller[_0xd2d5('0x12')]);router[_0xd2d5('0xa')](_0xd2d5('0x13'),auth['isAuthenticated'](),controller[_0xd2d5('0x14')]);router[_0xd2d5('0x15')]('/',auth['isAuthenticated'](),controller[_0xd2d5('0x16')]);router[_0xd2d5('0x15')](_0xd2d5('0x11'),auth[_0xd2d5('0xb')](),controller[_0xd2d5('0x17')]);router[_0xd2d5('0x15')](_0xd2d5('0x13'),auth[_0xd2d5('0xb')](),controller[_0xd2d5('0x18')]);router[_0xd2d5('0x19')](_0xd2d5('0x1a'),auth[_0xd2d5('0xb')](),controller[_0xd2d5('0x1b')]);router[_0xd2d5('0x1c')](_0xd2d5('0x1a'),auth[_0xd2d5('0xb')](),controller['destroy']);router[_0xd2d5('0x1c')](_0xd2d5('0x11'),auth[_0xd2d5('0xb')](),controller['removeMembers']);module[_0xd2d5('0x1d')]=router;
\ No newline at end of file
+var _0xe292=['index','/describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','delete','destroy','removeMembers','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated'];(function(_0x5a435c,_0x455012){var _0x31a14f=function(_0xa6ffcd){while(--_0xa6ffcd){_0x5a435c['push'](_0x5a435c['shift']());}};_0x31a14f(++_0x455012);}(_0xe292,0x144));var _0x2e29=function(_0x1580fe,_0x17a64c){_0x1580fe=_0x1580fe-0x0;var _0x510c7b=_0xe292[_0x1580fe];return _0x510c7b;};'use strict';var multer=require(_0x2e29('0x0'));var util=require('util');var path=require(_0x2e29('0x1'));var timeout=require(_0x2e29('0x2'));var express=require(_0x2e29('0x3'));var router=express[_0x2e29('0x4')]();var fs_extra=require(_0x2e29('0x5'));var auth=require(_0x2e29('0x6'));var interaction=require(_0x2e29('0x7'));var config=require(_0x2e29('0x8'));var controller=require(_0x2e29('0x9'));router[_0x2e29('0xa')]('/',auth[_0x2e29('0xb')](),controller[_0x2e29('0xc')]);router[_0x2e29('0xa')](_0x2e29('0xd'),auth[_0x2e29('0xb')](),controller['describe']);router[_0x2e29('0xa')](_0x2e29('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0x2e29('0xf'),auth['isAuthenticated'](),controller[_0x2e29('0x10')]);router['get'](_0x2e29('0x11'),auth[_0x2e29('0xb')](),controller[_0x2e29('0x12')]);router[_0x2e29('0xa')](_0x2e29('0x13'),auth[_0x2e29('0xb')](),controller[_0x2e29('0x14')]);router[_0x2e29('0x15')]('/',auth[_0x2e29('0xb')](),controller['create']);router['post'](_0x2e29('0x11'),auth['isAuthenticated'](),controller[_0x2e29('0x16')]);router[_0x2e29('0x15')](_0x2e29('0x13'),auth[_0x2e29('0xb')](),controller[_0x2e29('0x17')]);router['put'](_0x2e29('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x2e29('0x18')](_0x2e29('0xe'),auth[_0x2e29('0xb')](),controller[_0x2e29('0x19')]);router['delete'](_0x2e29('0x11'),auth['isAuthenticated'](),controller[_0x2e29('0x1a')]);module[_0x2e29('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 0e88336..2e9bf4d 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 _0x8cc8=['DATE','long','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING'];(function(_0x5d5ebf,_0x498a7c){var _0x1db3e8=function(_0x13f44c){while(--_0x13f44c){_0x5d5ebf['push'](_0x5d5ebf['shift']());}};_0x1db3e8(++_0x498a7c);}(_0x8cc8,0x177));var _0x88cc=function(_0x1688e9,_0x2f3588){_0x1688e9=_0x1688e9-0x0;var _0x5727ac=_0x8cc8[_0x1688e9];return _0x5727ac;};'use strict';var Sequelize=require(_0x88cc('0x0'));module[_0x88cc('0x1')]={'closed':{'type':Sequelize[_0x88cc('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x88cc('0x3')]},'ratingType':{'type':Sequelize[_0x88cc('0x4')](_0x88cc('0x5'),_0x88cc('0x6')),'defaultValue':_0x88cc('0x5')},'ratingMessage':{'type':Sequelize[_0x88cc('0x7')]},'pathTranscript':{'type':Sequelize[_0x88cc('0x7')]},'mailTranscript':{'type':Sequelize[_0x88cc('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x88cc('0x9')]},'disposition':{'type':Sequelize[_0x88cc('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x88cc('0x8')]},'browserName':{'type':Sequelize[_0x88cc('0x8')]},'browserVersion':{'type':Sequelize[_0x88cc('0x8')]},'osName':{'type':Sequelize[_0x88cc('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x88cc('0x8')]},'deviceVendor':{'type':Sequelize[_0x88cc('0x8')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x88cc('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x88cc('0x7')](_0x88cc('0xa'))},'read1stAt':{'type':Sequelize[_0x88cc('0x9')]},'lastMsgAt':{'type':Sequelize[_0x88cc('0x9')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x88cc('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x88cc('0x8')]},'customerPort':{'type':Sequelize[_0x88cc('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x88cc('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x88cc('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xdb94=['long','DATE','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','thumb','star','STRING','TEXT'];(function(_0x8f2c7a,_0x2fb180){var _0x212e6d=function(_0x2f20b0){while(--_0x2f20b0){_0x8f2c7a['push'](_0x8f2c7a['shift']());}};_0x212e6d(++_0x2fb180);}(_0xdb94,0xab));var _0x4db9=function(_0x105a64,_0x53ab60){_0x105a64=_0x105a64-0x0;var _0x32b896=_0xdb94[_0x105a64];return _0x32b896;};'use strict';var Sequelize=require(_0x4db9('0x0'));module[_0x4db9('0x1')]={'closed':{'type':Sequelize[_0x4db9('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x4db9('0x3')]},'ratingType':{'type':Sequelize[_0x4db9('0x4')]('star',_0x4db9('0x5')),'defaultValue':_0x4db9('0x6')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x4db9('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x4db9('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x4db9('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x4db9('0x7')]},'osName':{'type':Sequelize[_0x4db9('0x7')]},'osVersion':{'type':Sequelize[_0x4db9('0x7')]},'deviceModel':{'type':Sequelize[_0x4db9('0x7')]},'deviceVendor':{'type':Sequelize[_0x4db9('0x7')]},'deviceType':{'type':Sequelize[_0x4db9('0x7')]},'referer':{'type':Sequelize[_0x4db9('0x8')]},'customerIp':{'type':Sequelize[_0x4db9('0x7')]},'formData':{'type':Sequelize[_0x4db9('0x8')](_0x4db9('0x9'))},'read1stAt':{'type':Sequelize[_0x4db9('0xa')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x4db9('0x4')]('in',_0x4db9('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x4db9('0x8')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 9d47c35..5aaf625 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 _0x4024=['ChatInteractionId','push','all','rows','show','params','include','options','create','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooTopic','vidaooNote','fullname','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','ChatMessage','Messages','ContactId','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','getMessages','hasOwnProperty','sort','$gte','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','getMyMessages','includeAgent','addTags','setTags','ids','spread','color','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','Account','get','mkdirSync','Chat','Owner','N.A.','closed','browserName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','renderFile','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','crypto','to-csv','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','end','status','offset','limit','undefined','count','set','json','apply','reject','save','update','destroy','then','sendStatus','name','render','merge','agent','interaction','account','Users','TagIds','Tags','split','forEach','catch','map','ChatInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','`\x20>\x200','Contact','operator','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','buildExpression','type','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','UserId','text','body','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','having','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','a.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy'];(function(_0x3b3d58,_0x45589b){var _0x34c359=function(_0x13036f){while(--_0x13036f){_0x3b3d58['push'](_0x3b3d58['shift']());}};_0x34c359(++_0x45589b);}(_0x4024,0x89));var _0x4402=function(_0x581174,_0x41e3ce){_0x581174=_0x581174-0x0;var _0x132336=_0x4024[_0x581174];return _0x132336;};'use strict';var emlformat=require(_0x4402('0x0'));var rimraf=require(_0x4402('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4402('0x2'));var rp=require(_0x4402('0x3'));var moment=require('moment');var BPromise=require(_0x4402('0x4'));var Mustache=require('mustache');var util=require(_0x4402('0x5'));var path=require(_0x4402('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4402('0x7'));var fs=require('fs');var fs_extra=require(_0x4402('0x8'));var _=require(_0x4402('0x9'));var squel=require('squel');var crypto=require(_0x4402('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4402('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4402('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x4402('0xd'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x4402('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4402('0xf'))(_0x4402('0x10'));var utils=require('../../config/utils');var config=require(_0x4402('0x11'));var licenseUtil=require(_0x4402('0x12'));var db=require(_0x4402('0x13'))['db'];config['redis']=_[_0x4402('0x14')](config[_0x4402('0x15')],{'host':_0x4402('0x16'),'port':0x18eb});var socket=require(_0x4402('0x17'))(new Redis(config[_0x4402('0x15')]));require(_0x4402('0x18'))[_0x4402('0x19')](socket);var jayson=require(_0x4402('0x1a'));var client=jayson[_0x4402('0x1b')][_0x4402('0x1c')]({'port':0x232b});var client9004=jayson[_0x4402('0x1b')][_0x4402('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x2a2ce8,_0x19fe7b,_0xfd9853,_0x30c390){return new BPromise(function(_0x399c24,_0x25e88b){var _0x186c22=_0x30c390||client;return _0x186c22[_0x4402('0x1d')](_0x2a2ce8,_0xfd9853)['then'](function(_0x494389){logger[_0x4402('0x1e')](_0x4402('0x1f'),_0x19fe7b,'request\x20sent');logger[_0x4402('0x20')](_0x4402('0x21'),_0x19fe7b,'request\x20sent',JSON[_0x4402('0x22')](_0x494389));if(_0x494389['error']){if(_0x494389['error'][_0x4402('0x23')]===0x1f4){logger[_0x4402('0x24')](_0x4402('0x1f'),_0x19fe7b,_0x494389['error'][_0x4402('0x25')]);return _0x25e88b(_0x494389['error']['message']);}logger[_0x4402('0x24')](_0x4402('0x1f'),_0x19fe7b,_0x494389[_0x4402('0x24')][_0x4402('0x25')]);return _0x399c24(_0x494389[_0x4402('0x24')][_0x4402('0x25')]);}else{logger[_0x4402('0x1e')](_0x4402('0x1f'),_0x19fe7b,_0x4402('0x26'));_0x399c24(_0x494389['result'][_0x4402('0x25')]);}})['catch'](function(_0x3733cd){logger[_0x4402('0x24')](_0x4402('0x1f'),_0x19fe7b,_0x3733cd);_0x25e88b(_0x3733cd);});});}function respondWithStatusCode(_0x211424,_0x5a43d0){_0x5a43d0=_0x5a43d0||0xcc;return function(_0x15c19f){if(_0x15c19f){return _0x211424['sendStatus'](_0x5a43d0);}return _0x211424['status'](_0x5a43d0)[_0x4402('0x27')]();};}function respondWithResult(_0x395e49,_0x327d60){_0x327d60=_0x327d60||0xc8;return function(_0xabf61b){if(_0xabf61b){return _0x395e49[_0x4402('0x28')](_0x327d60)['json'](_0xabf61b);}};}function respondWithFilteredResult(_0x41de44,_0x52e625){return function(_0x71da2f){if(_0x71da2f){var _0x1e2340=typeof _0x52e625[_0x4402('0x29')]==='undefined'&&typeof _0x52e625[_0x4402('0x2a')]===_0x4402('0x2b');var _0x316239=_0x71da2f[_0x4402('0x2c')];var _0x2526d1=_0x1e2340?0x0:_0x52e625[_0x4402('0x29')];var _0x1189b8=_0x1e2340?_0x71da2f[_0x4402('0x2c')]:_0x52e625[_0x4402('0x29')]+_0x52e625[_0x4402('0x2a')];var _0xcea26b;if(_0x1189b8>=_0x316239){_0x1189b8=_0x316239;_0xcea26b=0xc8;}else{_0xcea26b=0xce;}_0x41de44['status'](_0xcea26b);return _0x41de44[_0x4402('0x2d')]('Content-Range',_0x2526d1+'-'+_0x1189b8+'/'+_0x316239)[_0x4402('0x2e')](_0x71da2f);}return null;};}function patchUpdates(_0x554096){return function(_0x2dea0f){try{jsonpatch[_0x4402('0x2f')](_0x2dea0f,_0x554096,!![]);}catch(_0x145003){return BPromise[_0x4402('0x30')](_0x145003);}return _0x2dea0f[_0x4402('0x31')]();};}function saveUpdates(_0x480781,_0x3a60af){return function(_0x3fa7ae){if(_0x3fa7ae){return _0x3fa7ae[_0x4402('0x32')](_0x480781)['then'](function(_0x331c75){return _0x331c75;});}return null;};}function removeEntity(_0x3383e3,_0x535e1d){return function(_0x2db1fe){if(_0x2db1fe){return _0x2db1fe[_0x4402('0x33')]()[_0x4402('0x34')](function(){_0x3383e3[_0x4402('0x28')](0xcc)[_0x4402('0x27')]();});}};}function handleEntityNotFound(_0x235f30,_0x1e67ac){return function(_0x6e9fb7){if(!_0x6e9fb7){_0x235f30[_0x4402('0x35')](0x194);}return _0x6e9fb7;};}function handleError(_0x5c819a,_0x2995b6){_0x2995b6=_0x2995b6||0x1f4;return function(_0x28fee8){logger[_0x4402('0x24')](_0x28fee8['stack']);if(_0x28fee8[_0x4402('0x36')]){delete _0x28fee8[_0x4402('0x36')];}_0x5c819a['status'](_0x2995b6)['send'](_0x28fee8);};}function getMustacheRender(_0x2b9d51,_0x5b7c2e){return Mustache[_0x4402('0x37')](_0x2b9d51,_[_0x4402('0x38')](_0x5b7c2e['body'],{'contact':_0x5b7c2e['contact'],'message':_0x5b7c2e['message'],'agent':_0x5b7c2e[_0x4402('0x39')],'interaction':_0x5b7c2e[_0x4402('0x3a')],'account':_0x5b7c2e[_0x4402('0x3b')]}))||'';}function getInteractionUsers(_0x3fd8ce,_0x52af0d){return new BPromise(function(_0x20579c,_0x7d5f2a){try{if(_0x52af0d[_0x3fd8ce['id']]){_0x3fd8ce[_0x4402('0x3c')]=_['map'](_0x52af0d[_0x3fd8ce['id']],function(_0x2b92b7){return{'id':_0x2b92b7['id'],'fullname':_0x2b92b7['fullname']};});}}catch(_0x6e328a){_0x7d5f2a(_0x6e328a);}_0x20579c(_0x3fd8ce);});}function getInteractionTags(_0x3ef31d,_0x5c74b1){return new BPromise(function(_0x16ef2e,_0x529526){try{if(_0x3ef31d[_0x4402('0x3d')]){_0x3ef31d[_0x4402('0x3e')]=[];_0x3ef31d['TagIds'][_0x4402('0x3f')](',')[_0x4402('0x40')](function(_0x250f09){_0x3ef31d[_0x4402('0x3e')]['push'](_0x5c74b1[_0x250f09]);});}delete _0x3ef31d['TagIds'];}catch(_0x2cda0a){_0x529526(_0x2cda0a);}_0x16ef2e(_0x3ef31d);});}function updateChatInteraction(_0x47a3a3,_0x3a589b,_0x2a6d78){return new BPromise(function(_0xb9cf85,_0x2e2391){return getInteractionUsers(_0x47a3a3,_0x2a6d78)[_0x4402('0x34')](function(_0x455a62){return getInteractionTags(_0x455a62,_0x3a589b);})[_0x4402('0x34')](function(_0x390169){_0xb9cf85(_0x390169);})[_0x4402('0x41')](function(_0x42812b){_0x2e2391(_0x42812b);});});}exports['index']=function(_0x14b94b,_0x3236fc){var _0x5e7872={},_0x214eec={},_0x370878={'count':0x0,'rows':[]};var _0x50552a=_[_0x4402('0x42')](db[_0x4402('0x43')][_0x4402('0x44')],function(_0x3278fc){return{'name':_0x3278fc[_0x4402('0x45')],'type':_0x3278fc['type'][_0x4402('0x46')]};});_0x214eec[_0x4402('0x47')]=_[_0x4402('0x42')](_0x50552a,_0x4402('0x36'));_0x214eec[_0x4402('0x48')]=_[_0x4402('0x49')](_0x14b94b[_0x4402('0x48')]);_0x214eec[_0x4402('0x4a')]=_[_0x4402('0x4b')](_0x214eec[_0x4402('0x47')],_0x214eec[_0x4402('0x48')]);_0x5e7872['attributes']=_[_0x4402('0x4b')](_0x214eec['model'],qs[_0x4402('0x4c')](_0x14b94b[_0x4402('0x48')]['fields']));_0x5e7872[_0x4402('0x4d')]=_0x5e7872[_0x4402('0x4d')][_0x4402('0x4e')]?_0x5e7872[_0x4402('0x4d')]:_0x214eec[_0x4402('0x47')];if(!_0x14b94b[_0x4402('0x48')]['hasOwnProperty'](_0x4402('0x4f'))){_0x5e7872[_0x4402('0x2a')]=qs[_0x4402('0x2a')](_0x14b94b[_0x4402('0x48')][_0x4402('0x2a')]);_0x5e7872[_0x4402('0x29')]=qs[_0x4402('0x29')](_0x14b94b[_0x4402('0x48')][_0x4402('0x29')]);}_0x5e7872['order']=qs['sort'](_0x14b94b['query']['sort']);_0x5e7872[_0x4402('0x50')]=qs[_0x4402('0x4a')](_[_0x4402('0x51')](_0x14b94b[_0x4402('0x48')],_0x214eec['filters']),_0x50552a);var _0x169bb2=[];var _0x12d6de=squel[_0x4402('0x52')]()[_0x4402('0x53')]('id')[_0x4402('0x53')](_0x4402('0x36'))[_0x4402('0x53')]('color')[_0x4402('0x54')](_0x4402('0x55'));var _0x38e6d1=squel[_0x4402('0x52')]()[_0x4402('0x53')](_0x4402('0x56'))['field'](_0x4402('0x57'))[_0x4402('0x53')](_0x4402('0x58'))[_0x4402('0x54')](_0x4402('0x59'),'ui')[_0x4402('0x5a')](_0x4402('0x5b'),'u','u.id\x20=\x20ui.UserId');var _0x48e138=squel[_0x4402('0x52')]()[_0x4402('0x54')](_0x4402('0x5c'),'i')['left_join']('cm_contacts','c',_0x4402('0x5d'))[_0x4402('0x5a')](_0x4402('0x5b'),'o',_0x4402('0x5e'))[_0x4402('0x5a')](_0x4402('0x5f'),'a',_0x4402('0x60'))[_0x4402('0x5a')](_0x4402('0x61'),'me',_0x4402('0x62'))[_0x4402('0x5a')](_0x4402('0x63'),'it',_0x4402('0x64'))['left_join'](_0x4402('0x55'),'t','t.id\x20=\x20it.TagId');var _0xe4530a=squel['expr']();var _0x3fb9f0=[];var _0x1e5891=squel[_0x4402('0x65')]();var _0x31e36c;if(_0x14b94b[_0x4402('0x48')][_0x4402('0x66')]){_0x31e36c=as['parseSearch'](_0x14b94b[_0x4402('0x48')][_0x4402('0x66')]);var _0xa390ce=_0x31e36c[_0x4402('0x67')];for(var _0xb341ab=0x0;_0xb341ab<_0x31e36c['conditions'][_0x4402('0x4e')];_0xb341ab++){var _0x31d993=_0x31e36c[_0x4402('0x68')][_0xb341ab];var _0xc15c0b='i';var _0x309077=_[_0x4402('0x69')](_0x50552a,[_0x4402('0x36'),_0x31d993[_0x4402('0x53')]]);if(!_0x309077){switch(_0x31d993['field']){case _0x4402('0x6a'):if(_0x31d993[_0x4402('0x6b')]==0x1){_0x48e138['having']('`'+_0x31d993[_0x4402('0x53')]+_0x4402('0x6c'));}else{_0x48e138['having']('`'+_0x31d993['field']+_0x4402('0x6d'));}break;case _0x4402('0x6e'):if(_0x31d993[_0x4402('0x6f')]==='$substring'){if(_0x31d993[_0x4402('0x6b')][_0x4402('0x3f')]('\x20')[_0x4402('0x4e')]>0x1){_0xe4530a[_0xa390ce]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x4402('0x70')](_0x31d993[_0x4402('0x6b')]),null);}else{var _0xdde09f='%'+_0x31d993['value']+'%';_0xe4530a[_0xa390ce](_0x4402('0x71'),_0xdde09f,_0xdde09f,_0xdde09f);}}else{_0x309077=_[_0x4402('0x69')](_0x50552a,['name','ContactId']);_0x31d993[_0x4402('0x53')]='ContactId';_0x53e553=as[_0x4402('0x72')](_0xc15c0b,_0x309077[_0x4402('0x73')],_0x31d993);_0xe4530a[_0xa390ce](_0x53e553['text'],_0x53e553['value'][_0x4402('0x74')],_0x53e553[_0x4402('0x6b')][_0x4402('0x27')]);}break;case _0x4402('0x75'):var _0x4ac95e=_0x31d993[_0x4402('0x6b')][_0x4402('0x3f')](',')[_0x4402('0x42')](function(_0x168095){return Number(_0x168095);});_0x4ac95e[_0x4402('0x40')](function(_0x26b1ad){_0x1e5891['or'](_0x4402('0x76'),'%,'+_0x26b1ad+',%');});_0x3fb9f0=_['union'](_0x3fb9f0,_0x4ac95e);break;case _0x4402('0x77'):if(_0x31d993[_0x4402('0x6f')]==='$substring'){_0xe4530a[_0xa390ce]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x31d993[_0x4402('0x6b')]+'%',null);}else{_0x309077=_['find'](_0x50552a,[_0x4402('0x36'),'UserId']);_0x31d993[_0x4402('0x53')]=_0x4402('0x78');_0x53e553=as[_0x4402('0x72')](_0xc15c0b,_0x309077[_0x4402('0x73')],_0x31d993);_0xe4530a[_0xa390ce](_0x53e553[_0x4402('0x79')],_0x53e553[_0x4402('0x6b')][_0x4402('0x74')],_0x53e553[_0x4402('0x6b')][_0x4402('0x27')]);}break;case _0x4402('0x7a'):_0x53e553=as[_0x4402('0x72')]('me',null,_0x31d993);_0xe4530a[_0xa390ce](_0x53e553[_0x4402('0x79')],_0x53e553[_0x4402('0x6b')][_0x4402('0x74')],_0x53e553[_0x4402('0x6b')][_0x4402('0x27')]);break;}}else{var _0x53e553=as[_0x4402('0x72')](_0xc15c0b,_0x309077[_0x4402('0x73')],_0x31d993);_0xe4530a[_0xa390ce](_0x53e553[_0x4402('0x79')],_0x53e553['value'][_0x4402('0x74')],_0x53e553['value'][_0x4402('0x27')]);}}}else{var _0x1b1147=_(_0x14b94b[_0x4402('0x48')])[_0x4402('0x49')]()['map'](function(_0xac8513){return _['some'](_0x50552a,[_0x4402('0x36'),_0xac8513])?_0xac8513:undefined;})[_0x4402('0x7b')]()[_0x4402('0x6b')]();if(!_['isEmpty'](_0x1b1147)){_0x1b1147[_0x4402('0x40')](function(_0x4c98eb){if(_0x4c98eb===_0x4402('0x7c')){_0x48e138[_0x4402('0x50')](_0x4402('0x7d'),[][_0x4402('0x7e')](_0x14b94b[_0x4402('0x48')][_0x4c98eb]));}else if(_0x4c98eb===_0x4402('0x7f')){var _0x19b427=JSON[_0x4402('0x80')](_0x14b94b[_0x4402('0x48')][_0x4c98eb])['$gte'];var _0x44d806=JSON[_0x4402('0x80')](_0x14b94b[_0x4402('0x48')][_0x4c98eb])[_0x4402('0x81')];_0x48e138[_0x4402('0x50')](_0x4402('0x82'),_0x19b427,_0x44d806);}else{if(_0x14b94b[_0x4402('0x48')][_0x4c98eb]===_0x4402('0x83')){_0x48e138[_0x4402('0x50')]('i.'+_0x4c98eb+'\x20IS\x20NULL');}else{_0x48e138[_0x4402('0x50')]('i.'+_0x4c98eb+_0x4402('0x84'),_0x14b94b[_0x4402('0x48')][_0x4c98eb]);}}});}if(_0x14b94b['query'][_0x4402('0x85')]){if(_0x14b94b['query'][_0x4402('0x85')]==0x1){_0x48e138['having'](_0x4402('0x86'));}else{_0x48e138[_0x4402('0x87')]('`unreadMessages`\x20>\x200');}}if(_0x14b94b[_0x4402('0x48')]['tag']){_0x3fb9f0=_[_0x4402('0x88')](_0x14b94b[_0x4402('0x48')]['tag'])?_0x14b94b[_0x4402('0x48')][_0x4402('0x89')]:new Array(_0x14b94b['query'][_0x4402('0x89')]);_0x3fb9f0[_0x4402('0x40')](function(_0x4f0915){_0x1e5891['or'](_0x4402('0x76'),'%,'+_0x4f0915+',%');});}if(_0x14b94b[_0x4402('0x48')][_0x4402('0x8a')]){var _0x12b834=_0x14b94b[_0x4402('0x48')][_0x4402('0x8a')][_0x4402('0x8b')]('\x5c','\x5c\x5c')[_0x4402('0x8b')](/'/g,'\x27\x27');if(qs[_0x4402('0x8c')](_0x12b834)){_0xe4530a['or'](_0x4402('0x8d'),_0x12b834+'%');}else{_0xe4530a['or'](_0x4402('0x8e'),qs[_0x4402('0x70')](_0x12b834))['or'](_0x4402('0x8f'),_0x12b834+'%');}}}_0x48e138[_0x4402('0x50')](_0xe4530a);_0x48e138['group'](_0x4402('0x90'));var _0xc3914e={'type':db['Sequelize'][_0x4402('0x91')]['SELECT'],'raw':!![]};var _0x2c7ff5=_0x48e138[_0x4402('0x92')]();_0x2c7ff5[_0x4402('0x53')]('i.id');_0x2c7ff5[_0x4402('0x53')](_0x4402('0x93'),_0x4402('0x6a'));if(_0x5e7872['order']){_0x5e7872[_0x4402('0x94')][_0x4402('0x40')](function(_0x179eb4){var _0x1a0a6f=_0x179eb4[0x0]==='contactName'?_0x179eb4[0x0]:'i.'+_0x179eb4[0x0];_0x48e138[_0x4402('0x94')](_0x1a0a6f,_0x179eb4[0x1]===_0x4402('0x95')?![]:!![]);});}if(!_[_0x4402('0x96')](_0x3fb9f0)){_0x48e138[_0x4402('0x87')](_0x1e5891);_0x2c7ff5[_0x4402('0x50')](_0x4402('0x97'),_0x3fb9f0);}BPromise[_0x4402('0x98')]()[_0x4402('0x34')](function(){if(!_0x31e36c){if(_0x14b94b[_0x4402('0x48')][_0x4402('0x7c')])return;_0x2c7ff5[_0x4402('0x50')](_0x4402('0x99'));_0x48e138[_0x4402('0x50')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x14b94b[_0x4402('0x9a')][_0x4402('0x9b')]!==_0x4402('0x39'))return;return _0x14b94b[_0x4402('0x9a')]['getChatWebsites']({'attributes':['id'],'raw':!![]})['then'](function(_0x284b52){if(_[_0x4402('0x96')](_0x284b52)){_0x2c7ff5[_0x4402('0x50')](_0x4402('0x9c'));_0x48e138['where'](_0x4402('0x9c'));}else{_0x2c7ff5[_0x4402('0x50')]('i.ChatWebsiteId\x20IN\x20?',_[_0x4402('0x42')](_0x284b52,'id'));_0x48e138[_0x4402('0x50')](_0x4402('0x7d'),_[_0x4402('0x42')](_0x284b52,'id'));}});})[_0x4402('0x34')](function(){if(_0x14b94b['user'][_0x4402('0x9b')]===_0x4402('0x39')&&!_0x31e36c&&!_0x14b94b[_0x4402('0x48')][_0x4402('0x7c')])return[];return db[_0x4402('0x9d')][_0x4402('0x48')](_0x2c7ff5[_0x4402('0x9e')](),_0xc3914e);})['then'](function(_0x218640){_0x370878[_0x4402('0x2c')]=_0x218640[_0x4402('0x4e')];if(_0x370878[_0x4402('0x2c')]===0x0)return[];return db[_0x4402('0x9d')]['query'](_0x12d6de[_0x4402('0x9e')](),_0xc3914e)[_0x4402('0x34')](function(_0x572e21){_0x169bb2=_[_0x4402('0x9f')](_0x572e21,'id');_0xc3914e=_['merge'](_0xc3914e,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x14b94b[_0x4402('0x48')]['fields']){_0x5e7872[_0x4402('0x4d')]['forEach'](function(_0x51e85d){_0x48e138[_0x4402('0x53')]('i.'+_0x51e85d);});}else{_0x48e138[_0x4402('0x53')](_0x4402('0x93'),_0x4402('0x6a'));_0x48e138[_0x4402('0x53')](_0x4402('0xa0'),'Account.key');_0x48e138[_0x4402('0x53')](_0x4402('0xa1'),'Account.mandatoryDisposition');_0x48e138[_0x4402('0x53')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x48e138[_0x4402('0x53')]('i.*');_0x48e138[_0x4402('0x53')](_0x4402('0xa2'),_0x4402('0xa3'));_0x48e138[_0x4402('0x53')](_0x4402('0xa4'),'Contact.lastName');_0x48e138['field'](_0x4402('0xa5'),_0x4402('0xa6'));_0x48e138['field'](_0x4402('0xa7'),_0x4402('0xa8'));_0x48e138[_0x4402('0x53')](_0x4402('0xa9'),_0x4402('0xaa'));_0x48e138[_0x4402('0x53')]('c.fax','Contact.fax');_0x48e138[_0x4402('0x53')](_0x4402('0xab'),_0x4402('0xac'));_0x48e138[_0x4402('0x53')](_0x4402('0xad'),_0x4402('0xae'));_0x48e138['field'](_0x4402('0xaf'),_0x4402('0x3d'));}if(_0x5e7872[_0x4402('0x2a')])_0x48e138[_0x4402('0x2a')](_0x5e7872[_0x4402('0x2a')]);if(_0x5e7872['offset'])_0x48e138[_0x4402('0x29')](_0x5e7872[_0x4402('0x29')]);return db[_0x4402('0x9d')][_0x4402('0x48')](_0x48e138[_0x4402('0x9e')](),_0xc3914e);})[_0x4402('0x34')](function(_0x518b0b){if(_0x518b0b['length']>0x0)_0x38e6d1[_0x4402('0x50')]('ui.ChatInteractionId\x20IN\x20?',_[_0x4402('0x42')](_0x518b0b,'id'));return db[_0x4402('0x9d')][_0x4402('0x48')](_0x38e6d1[_0x4402('0x9e')](),_0xc3914e)[_0x4402('0x34')](function(_0x25b3ee){var _0x70bdbd=_[_0x4402('0xb0')](_0x25b3ee,_0x4402('0xb1'));var _0x23306f=[];_0x518b0b[_0x4402('0x40')](function(_0x425a1b){_0x23306f[_0x4402('0xb2')](updateChatInteraction(_0x425a1b,_0x169bb2,_0x70bdbd));});return BPromise[_0x4402('0xb3')](_0x23306f);});});})[_0x4402('0x34')](function(_0x1ba5a1){_0x370878[_0x4402('0xb4')]=_0x1ba5a1;return _0x370878;})[_0x4402('0x34')](respondWithFilteredResult(_0x3236fc,_0x5e7872))[_0x4402('0x41')](handleError(_0x3236fc,null));};exports[_0x4402('0xb5')]=function(_0xe37b11,_0x385b8e){var _0x418070={'raw':![],'where':{'id':_0xe37b11[_0x4402('0xb6')]['id']}},_0x47a76a={};_0x47a76a[_0x4402('0x47')]=_[_0x4402('0x49')](db[_0x4402('0x43')][_0x4402('0x44')]);_0x47a76a[_0x4402('0x48')]=_['keys'](_0xe37b11['query']);_0x47a76a[_0x4402('0x4a')]=_[_0x4402('0x4b')](_0x47a76a[_0x4402('0x47')],_0x47a76a['query']);_0x418070['attributes']=_['intersection'](_0x47a76a['model'],qs[_0x4402('0x4c')](_0xe37b11[_0x4402('0x48')][_0x4402('0x4c')]));_0x418070['attributes']=_0x418070[_0x4402('0x4d')][_0x4402('0x4e')]?_0x418070[_0x4402('0x4d')]:_0x47a76a['model'];if(_0xe37b11[_0x4402('0x48')]['includeAll']){_0x418070[_0x4402('0xb7')]=[{'all':!![]}];}_0x418070=_[_0x4402('0x38')]({},_0x418070,_0xe37b11[_0x4402('0xb8')]);return db[_0x4402('0x43')][_0x4402('0x69')](_0x418070)[_0x4402('0x34')](handleEntityNotFound(_0x385b8e,null))['then'](respondWithResult(_0x385b8e,null))[_0x4402('0x41')](handleError(_0x385b8e,null));};exports[_0x4402('0xb9')]=function(_0x3ac6b9,_0x55c3fd){return db[_0x4402('0x43')]['create'](_0x3ac6b9[_0x4402('0x7a')],{})[_0x4402('0x34')](respondWithResult(_0x55c3fd,0xc9))[_0x4402('0x41')](handleError(_0x55c3fd,null));};exports[_0x4402('0x32')]=function(_0x54d6dc,_0x91c49){if(_0x54d6dc[_0x4402('0x7a')]['id']){delete _0x54d6dc[_0x4402('0x7a')]['id'];}return db[_0x4402('0x43')][_0x4402('0x69')]({'where':{'id':_0x54d6dc['params']['id']}})[_0x4402('0x34')](handleEntityNotFound(_0x91c49,null))[_0x4402('0x34')](saveUpdates(_0x54d6dc['body'],null))['then'](respondWithResult(_0x91c49,null))['catch'](handleError(_0x91c49,null));};exports[_0x4402('0x33')]=function(_0x42b774,_0x246ff2){return db[_0x4402('0x43')]['find']({'where':{'id':_0x42b774[_0x4402('0xb6')]['id']}})[_0x4402('0x34')](handleEntityNotFound(_0x246ff2,null))[_0x4402('0x34')](removeEntity(_0x246ff2,null))[_0x4402('0x41')](handleError(_0x246ff2,null));};exports['describe']=function(_0x2a3361,_0x2949ce){return db[_0x4402('0x43')]['describe']()['then'](respondWithResult(_0x2949ce,null))['catch'](handleError(_0x2949ce,null));};exports[_0x4402('0xba')]=function(_0x48bf30,_0x17c5c2){var _0x35c16f=_0x48bf30[_0x4402('0xb6')]['id'];var _0x117911;var _0x87ae2a;var _0xd604a5;return db[_0x4402('0x43')][_0x4402('0xbb')]({'where':{'id':_0x35c16f}})[_0x4402('0x34')](function(_0x423f83){_0x117911=_0x423f83;return db[_0x4402('0xbc')][_0x4402('0xbb')]({'where':{'id':_0x423f83[_0x4402('0x7c')]},'attributes':['id',_0x4402('0xbd'),'vidaooEscalation',_0x4402('0xbe'),_0x4402('0xbf'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x57fd83){if(_0x57fd83&&_0x57fd83[_0x4402('0xbd')]&&_0x57fd83['vidaooEscalation']){_0x87ae2a=_0x57fd83;var _0x47aa8b={'interaction':{'id':_0x35c16f},'agent':{'id':_0x48bf30[_0x4402('0x9a')]['id'],'name':_0x48bf30[_0x4402('0x9a')]['name'],'fullname':_0x48bf30[_0x4402('0x9a')][_0x4402('0xc0')],'email':_0x48bf30[_0x4402('0x9a')][_0x4402('0xc1')]},'contact':_0x48bf30['body'][_0x4402('0xc2')],'account':_0x48bf30[_0x4402('0x7a')][_0x4402('0x3b')]};var _0x286500={'rejectUnauthorized':![],'method':_0x4402('0xc3'),'url':_0x4402('0xc4'),'headers':{'X-APIKEY':_0x57fd83[_0x4402('0xbd')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x48bf30[_0x4402('0x9a')][_0x4402('0xc1')]],'buttons':null,'topic':_0x87ae2a['vidaooTopic'],'note':_[_0x4402('0xc5')](_0x87ae2a[_0x4402('0xbf')])?null:getMustacheRender(_0x87ae2a[_0x4402('0xbf')],_0x47aa8b),'metadata':null},'redirect':_0x4402('0xc6'),'json':!![]};try{if(!_['isNull'](_0x87ae2a[_0x4402('0xc7')])){var _0x4bf0ff=getMustacheRender(_0x87ae2a[_0x4402('0xc7')],_0x47aa8b);var _0x29ffd4=JSON['parse'](_0x4bf0ff);_0x286500['body'][_0x4402('0xc8')]=_0x29ffd4;}}catch(_0x173f64){throw new db[(_0x4402('0xc9'))][(_0x4402('0xca'))](_0x4402('0xcb'));}return rp(_0x286500);}else{throw new db[(_0x4402('0xc9'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x4402('0x34')](function(_0x54e61e){_0xd604a5=_0x54e61e;if(_0xd604a5['id']){var _0xc47081={'body':_0xd604a5[_0x4402('0xcc')],'ChatWebsiteId':_0x87ae2a['id'],'ChatInteractionId':_0x117911['id'],'direction':_0x4402('0xcd'),'UserId':_0x48bf30[_0x4402('0x9a')]['id']};return db['ChatMessage'][_0x4402('0xb9')](_0xc47081,{});}else{throw new db[(_0x4402('0xc9'))][(_0x4402('0xca'))](_0x4402('0xce'));}})[_0x4402('0x34')](function(){return _0x117911[_0x4402('0xcf')]({'vidaooSessionId':_0xd604a5['id']});})['then'](respondWithResult(_0x17c5c2,null))['catch'](handleError(_0x17c5c2,null));};exports[_0x4402('0xd0')]=function(_0x5a768b,_0x38d7b5){if(_0x5a768b[_0x4402('0x7a')]['id']){delete _0x5a768b['body']['id'];}return db[_0x4402('0x43')]['find']({'where':{'id':_0x5a768b[_0x4402('0xb6')]['id']},'include':[{'model':db[_0x4402('0xd1')],'as':_0x4402('0x6e')}]})['then'](handleEntityNotFound(_0x38d7b5,null))[_0x4402('0x34')](saveUpdates(_0x5a768b['body'],null))[_0x4402('0x34')](respondWithResult(_0x38d7b5,null))[_0x4402('0x41')](handleError(_0x38d7b5,null));};exports[_0x4402('0xd2')]=function(_0x1fc790,_0xaaf390,_0x53be9e){if(_0x1fc790['body']['id']){delete _0x1fc790[_0x4402('0x7a')]['id'];}return db['ChatInteraction'][_0x4402('0x69')]({'where':{'id':_0x1fc790[_0x4402('0xb6')]['id']}})['then'](function(_0x50d453){if(!_0x50d453){logger[_0x4402('0x24')](_0x4402('0xd3'),_0x4402('0xd2'),0x194,_0x4402('0xd4'));_0xaaf390[_0x4402('0x35')](0x194);}else{if(_0x50d453[_0x4402('0x78')]){throw new db[(_0x4402('0xc9'))][(_0x4402('0xca'))]('Interaction\x20already\x20assigned');}}return _0x50d453;})['then'](function(_0xf3be9){if(_0xf3be9){return _0xf3be9[_0x4402('0x32')]({'closed':_0x1fc790[_0x4402('0x7a')]['closed'],'disposition':_0x1fc790[_0x4402('0x7a')]['disposition']})[_0x4402('0x34')](function(_0x1237a3){return _0x1237a3;});}})[_0x4402('0x34')](function(_0x4a0fd9){return respondWithRpcPromise(_0x4402('0xd5'),_0x4402('0xd2'),_0x1fc790['body'],client9004);})[_0x4402('0x34')](respondWithResult(_0xaaf390,null))[_0x4402('0x41')](handleError(_0xaaf390,null));};exports[_0x4402('0xd6')]=function(_0x8c436d,_0x15e9d3,_0xa0d1ee){_0x8c436d[_0x4402('0x7a')][_0x4402('0x36')]=_0x8c436d[_0x4402('0xd7')][_0x4402('0xd8')];_0x8c436d[_0x4402('0x7a')][_0x4402('0xd9')]=_0x8c436d['file'][_0x4402('0xda')];_0x8c436d[_0x4402('0x7a')][_0x4402('0x73')]=_0x8c436d[_0x4402('0xd7')][_0x4402('0xdb')];return db[_0x4402('0xdc')][_0x4402('0xb9')](_0x8c436d[_0x4402('0x7a')])[_0x4402('0x34')](respondWithResult(_0x15e9d3,0xc9))['catch'](handleError(_0x15e9d3,null));};exports[_0x4402('0xdd')]=function(_0x113451,_0x338e97,_0x4c6d4e){return db[_0x4402('0x43')][_0x4402('0xbb')]({'where':{'id':_0x113451['params']['id']},'raw':!![]})[_0x4402('0x34')](handleEntityNotFound(_0x338e97,null))[_0x4402('0x34')](function(_0x491a8e){if(_0x491a8e){if(_0x491a8e['closed']){return _0x338e97[_0x4402('0x28')](0x193)[_0x4402('0x2e')]({'status':0x193,'message':_0x4402('0xde')});}return db[_0x4402('0xdc')]['findOne']({'where':{'id':_0x113451[_0x4402('0x48')]['attachId']},'raw':!![]})[_0x4402('0x34')](handleEntityNotFound(_0x338e97,null));}})[_0x4402('0x34')](function(_0x171672){if(_0x171672){var _0xdbd1c8=_0x171672[_0x4402('0xdf')]!==null;var _0x5d190e=path[_0x4402('0xe0')](config[_0x4402('0xe1')],_0x4402('0xe2'));if(_0xdbd1c8){_0x5d190e=path[_0x4402('0xe0')](_0x5d190e,_0x4402('0xe3'));}var _0x23de88=path[_0x4402('0xe0')](_0x5d190e,_0x171672[_0x4402('0xd9')]);return _0x338e97[_0x4402('0xe4')](_0x23de88);}})[_0x4402('0x41')](handleError(_0x338e97,null));};exports[_0x4402('0xe5')]=function(_0x55274b,_0x2afc41){var _0x1c5cad=null;var _0x3b8f77=null;var _0x2b3b75=null;var _0x1ba411=null;if(_0x55274b[_0x4402('0x7a')]['id']){delete _0x55274b[_0x4402('0x7a')]['id'];}if(_0x55274b[_0x4402('0x7a')][_0x4402('0xe6')]){_0x1ba411=path[_0x4402('0xe0')](config['root'],_0x4402('0xe7'),util[_0x4402('0xe8')](_0x4402('0xe9'),Date['now']()));_0x55274b[_0x4402('0x7a')][_0x4402('0xea')]=_0x1ba411;}return db['ChatInteraction'][_0x4402('0x69')]({'where':{'id':_0x55274b[_0x4402('0xb6')]['id']},'include':[{'model':db[_0x4402('0xeb')],'as':_0x4402('0xec'),'include':[{'model':db[_0x4402('0x77')],'as':_0x4402('0x77')}]}]})[_0x4402('0x34')](handleEntityNotFound(_0x2afc41,null))[_0x4402('0x34')](saveUpdates(_0x55274b[_0x4402('0x7a')],null))[_0x4402('0x34')](function(_0x2d86c7){if(_0x2d86c7){_0x1c5cad=_0x2d86c7;return db['ChatWebsite'][_0x4402('0x69')]({'where':{'id':_0x1c5cad[_0x4402('0x7c')]}});}})[_0x4402('0x34')](function(_0x47837e){if(_0x47837e){_0x2b3b75=_0x47837e;return db[_0x4402('0xd1')][_0x4402('0x69')]({'where':{'id':_0x1c5cad[_0x4402('0xed')]}});}})[_0x4402('0x34')](function(_0x259c23){if(_0x259c23){_0x3b8f77=_0x259c23;if(_0x1ba411){var _0x535d83=null;for(var _0x2f3d6e=0x1;_0x2f3d6e<_0x1c5cad['Messages'][_0x4402('0x4e')];++_0x2f3d6e){_0x535d83=_0x1c5cad[_0x4402('0xec')][_0x2f3d6e];var _0x395d17=_0x535d83[_0x4402('0x78')]?util[_0x4402('0xe8')](_0x4402('0xee'),_0x2b3b75[_0x4402('0xef')],_0x535d83[_0x4402('0x78')]):_0x4402('0xf0');var _0x51bdf7=_0x55274b[_0x4402('0x7a')]['customer']||util[_0x4402('0xe8')](_0x4402('0xee'),_0x4402('0xf1'),_0x535d83[_0x4402('0xed')]);switch(_0x2b3b75[_0x4402('0xf2')]){case _0x4402('0xf3'):_0x395d17=_0x535d83['UserId']?util[_0x4402('0xe8')]('%s%d',_0x2b3b75[_0x4402('0xef')],_0x535d83['UserId']):_0x4402('0xf0');break;case _0x4402('0xf4'):_0x395d17=_0x535d83[_0x4402('0x78')]?_0x535d83[_0x4402('0x77')][_0x4402('0xf5')]||_0x535d83[_0x4402('0x77')][_0x4402('0xc0')]:_0x4402('0xf0');break;case _0x4402('0xf6'):_0x395d17=_0x535d83['UserId']?_0x535d83[_0x4402('0x77')]['fullname']:'System';break;default:_0x395d17=_0x535d83['UserId']?util[_0x4402('0xe8')](_0x4402('0xee'),_0x2b3b75[_0x4402('0xef')],_0x535d83['UserId']):_0x4402('0xf0');}var _0x1accec=util[_0x4402('0xe8')](_0x4402('0xf7'),moment(_0x535d83[_0x4402('0x7f')])[_0x4402('0xe8')](_0x4402('0xf8')),_0x535d83[_0x4402('0xf9')]==='in'?_0x51bdf7:_0x395d17,_0x535d83[_0x4402('0x7a')]);if(!_0x535d83[_0x4402('0xfa')]){fs[_0x4402('0xfb')](_0x1ba411,_0x1accec);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x4402('0xfc')],'as':_0x4402('0xfd'),'raw':!![]}]});}}})[_0x4402('0x34')](function(_0x23dbb4){if(_0x23dbb4&&_0x23dbb4[_0x4402('0xfd')]&&_0x55274b['body']){var _0x494b72={'tls':{'rejectUnauthorized':![]}};if(_0x23dbb4[_0x4402('0xfd')][_0x4402('0xfe')]){_0x494b72[_0x4402('0xfe')]=_0x23dbb4[_0x4402('0xfd')][_0x4402('0xfe')];}else{_0x494b72[_0x4402('0xff')]=_0x23dbb4[_0x4402('0xfd')][_0x4402('0xff')];_0x494b72[_0x4402('0x100')]=_0x23dbb4[_0x4402('0xfd')][_0x4402('0x100')];_0x494b72[_0x4402('0x101')]=_0x23dbb4[_0x4402('0xfd')][_0x4402('0x101')];}if(_0x23dbb4[_0x4402('0xfd')][_0x4402('0x102')]){_0x494b72[_0x4402('0x103')]={'user':_0x23dbb4[_0x4402('0xfd')][_0x4402('0x9a')],'pass':_0x23dbb4[_0x4402('0xfd')][_0x4402('0x104')]};}return respondWithRpcPromise(_0x4402('0x105'),_0x4402('0x106'),{'account':_0x494b72,'message':{'from':util[_0x4402('0xe8')](_0x4402('0x107'),_0x23dbb4[_0x4402('0x36')],_0x23dbb4['email']||_0x23dbb4[_0x4402('0xfd')][_0x4402('0x9a')]),'to':_0x55274b[_0x4402('0x7a')][_0x4402('0xe6')],'subject':_0x4402('0x108'),'text':util[_0x4402('0xe8')](_0x4402('0x109'),_0x55274b[_0x4402('0x7a')][_0x4402('0xe6')]),'attachments':[{'path':_0x1ba411}]}})['then'](function(){return _0x1c5cad;})[_0x4402('0x41')](function(_0x3ba561){console[_0x4402('0x24')](_0x3ba561);});}else{return _0x1c5cad;}})[_0x4402('0x34')](respondWithStatusCode(_0x2afc41,0xc8))[_0x4402('0x41')](handleError(_0x2afc41,null));};exports[_0x4402('0x10a')]=function(_0x10f917,_0x1155d1,_0x17c1ee){return db['ChatMessage'][_0x4402('0x69')]({'where':{'id':_0x10f917[_0x4402('0xb6')]['id']}})[_0x4402('0x34')](handleEntityNotFound(_0x1155d1,null))[_0x4402('0x34')](function(_0x37ea8d){if(_0x37ea8d){return _0x37ea8d[_0x4402('0x10a')](_0x10f917[_0x4402('0x7a')]['ids'],_[_0x4402('0x10b')](_0x10f917[_0x4402('0x7a')],['ids','id'])||{});}})[_0x4402('0x34')](respondWithResult(_0x1155d1,null))[_0x4402('0x41')](handleError(_0x1155d1,null));};exports[_0x4402('0x10c')]=function(_0x3e78da,_0x1bf636,_0x44b095){var _0x2433a1={'raw':![],'where':{}};var _0x4069cf={};var _0x7be513={'count':0x0,'rows':[]};return db[_0x4402('0x43')][_0x4402('0xbb')]({'where':{'id':_0x3e78da[_0x4402('0xb6')]['id']}})[_0x4402('0x34')](handleEntityNotFound(_0x1bf636,null))[_0x4402('0x34')](function(_0x1f2219){if(_0x1f2219){_0x4069cf[_0x4402('0x47')]=_[_0x4402('0x49')](db[_0x4402('0xeb')][_0x4402('0x44')]);_0x4069cf[_0x4402('0x48')]=_[_0x4402('0x49')](_0x3e78da[_0x4402('0x48')]);_0x4069cf[_0x4402('0x4a')]=_[_0x4402('0x4b')](_0x4069cf[_0x4402('0x47')],_0x4069cf[_0x4402('0x48')]);_0x2433a1[_0x4402('0x4d')]=_[_0x4402('0x4b')](_0x4069cf[_0x4402('0x47')],qs[_0x4402('0x4c')](_0x3e78da[_0x4402('0x48')]['fields']));_0x2433a1[_0x4402('0x4d')]=_0x2433a1['attributes']['length']?_0x2433a1[_0x4402('0x4d')]:_0x4069cf[_0x4402('0x47')];if(!_0x3e78da[_0x4402('0x48')][_0x4402('0x10d')](_0x4402('0x4f'))){_0x2433a1['limit']=qs[_0x4402('0x2a')](_0x3e78da[_0x4402('0x48')][_0x4402('0x2a')]);_0x2433a1['offset']=qs[_0x4402('0x29')](_0x3e78da[_0x4402('0x48')][_0x4402('0x29')]);}_0x2433a1[_0x4402('0x94')]=qs['sort'](_0x3e78da[_0x4402('0x48')][_0x4402('0x10e')]);_0x2433a1['where']=qs['filters'](_['pick'](_0x3e78da['query'],_0x4069cf[_0x4402('0x4a')]));_0x2433a1[_0x4402('0x50')][_0x4402('0xb1')]=_0x1f2219['id'];if(_0x3e78da['query'][_0x4402('0x8a')]){_0x2433a1[_0x4402('0x50')]=_[_0x4402('0x38')](_0x2433a1['where'],{'$or':_[_0x4402('0x42')](_0x2433a1[_0x4402('0x4d')],function(_0x2466a1){var _0x55ed20={};_0x55ed20[_0x2466a1]={'$like':'%'+_0x3e78da[_0x4402('0x48')][_0x4402('0x8a')]+'%'};return _0x55ed20;})});}if(_0x3e78da['query'][_0x4402('0x10f')]){var _0x335d93=_0x3e78da[_0x4402('0x48')][_0x4402('0x10f')]['split'](',');var _0x3aebf6={};_0x3aebf6[_0x335d93[0x0]]={'$gte':moment(_0x335d93[0x1])['format'](_0x4402('0x110'))};_0x2433a1['where']=_['merge'](_0x2433a1[_0x4402('0x50')],_0x3aebf6);}_0x2433a1=_[_0x4402('0x38')]({},_0x2433a1,_0x3e78da[_0x4402('0xb8')]);return db[_0x4402('0xeb')][_0x4402('0x2c')]({'where':_0x2433a1[_0x4402('0x50')]})[_0x4402('0x34')](function(_0x87e1c){_0x7be513['count']=_0x87e1c;if(_0x3e78da[_0x4402('0x48')][_0x4402('0x111')]){_0x2433a1[_0x4402('0xb7')]=[{'all':!![]}];}return db[_0x4402('0xeb')][_0x4402('0x112')](_0x2433a1);})['then'](function(_0x20b540){_0x7be513['rows']=_0x20b540;return _0x7be513;});}})[_0x4402('0x34')](respondWithFilteredResult(_0x1bf636,_0x2433a1))[_0x4402('0x41')](handleError(_0x1bf636,null));};exports[_0x4402('0x113')]=function(_0x516583,_0x182827,_0x284292){var _0x579bab={'where':{}},_0x30cdd6={},_0x1ac943={'count':0x0,'rows':[]};return db[_0x4402('0x43')][_0x4402('0xbb')]({'where':{'id':_0x516583[_0x4402('0xb6')]['id']}})[_0x4402('0x34')](handleEntityNotFound(_0x182827,null))[_0x4402('0x34')](function(_0xe8f398){if(_0xe8f398){_0x30cdd6[_0x4402('0x47')]=_[_0x4402('0x49')](db[_0x4402('0xeb')][_0x4402('0x44')]);_0x30cdd6[_0x4402('0x48')]=_[_0x4402('0x49')](_0x516583['query']);_0x30cdd6[_0x4402('0x4a')]=_[_0x4402('0x4b')](_0x30cdd6[_0x4402('0x47')],_0x30cdd6[_0x4402('0x48')]);_0x579bab[_0x4402('0x4d')]=_[_0x4402('0x4b')](_0x30cdd6[_0x4402('0x47')],qs[_0x4402('0x4c')](_0x516583['query'][_0x4402('0x4c')]));_0x579bab[_0x4402('0x4d')]=_0x579bab[_0x4402('0x4d')]['length']?_0x579bab[_0x4402('0x4d')]:_0x30cdd6[_0x4402('0x47')];if(!_0x516583[_0x4402('0x48')][_0x4402('0x10d')](_0x4402('0x4f'))){_0x579bab[_0x4402('0x2a')]=qs[_0x4402('0x2a')](_0x516583['query']['limit']);_0x579bab[_0x4402('0x29')]=qs[_0x4402('0x29')](_0x516583[_0x4402('0x48')][_0x4402('0x29')]);}_0x579bab[_0x4402('0x94')]=qs['sort'](_0x516583[_0x4402('0x48')][_0x4402('0x10e')]);_0x579bab[_0x4402('0x50')]=qs['filters'](_[_0x4402('0x51')](_0x516583['query'],_0x30cdd6[_0x4402('0x4a')]));_0x579bab[_0x4402('0x50')][_0x4402('0xb1')]=_0xe8f398['id'];if(_0x516583[_0x4402('0x48')]['filter']){_0x579bab[_0x4402('0x50')]=_[_0x4402('0x38')](_0x579bab[_0x4402('0x50')],{'$or':_[_0x4402('0x42')](_0x579bab[_0x4402('0x4d')],function(_0x3adad4){var _0x207b70={};_0x207b70[_0x3adad4]={'$like':'%'+_0x516583['query']['filter']+'%'};return _0x207b70;})});}_0x579bab[_0x4402('0x50')][_0x4402('0xfa')]=![];if(_0x516583[_0x4402('0x48')]['id']){_0x579bab['where']['id']={'$gt':_0x516583[_0x4402('0x48')]['id']};}_0x579bab=_[_0x4402('0x38')]({},_0x579bab,_0x516583[_0x4402('0xb8')]);return db['ChatMessage'][_0x4402('0x2c')]({'where':_0x579bab['where']})[_0x4402('0x34')](function(_0x2903fd){_0x1ac943[_0x4402('0x2c')]=_0x2903fd;_0x579bab['include']=[];if(_0x516583[_0x4402('0x48')][_0x4402('0x114')]){_0x579bab['include']['push']({'model':db['User'],'as':'User','attributes':['id',_0x4402('0xc0'),'alias']});}if(_0x516583['query'][_0x4402('0x111')]){_0x579bab['include']=[{'all':!![]}];}return db[_0x4402('0xeb')][_0x4402('0x112')](_0x579bab);})['then'](function(_0x230904){_0x1ac943[_0x4402('0xb4')]=_0x230904;return _0x1ac943;});}})[_0x4402('0x34')](respondWithFilteredResult(_0x182827,_0x579bab))['catch'](handleError(_0x182827,null));};exports[_0x4402('0x115')]=function(_0x5f42bc,_0x50999c,_0xc4375e){return db['ChatInteraction'][_0x4402('0x69')]({'where':{'id':_0x5f42bc['params']['id']}})[_0x4402('0x34')](handleEntityNotFound(_0x50999c,null))[_0x4402('0x34')](function(_0x21a6d2){if(_0x21a6d2){return _0x21a6d2[_0x4402('0x116')](_0x5f42bc[_0x4402('0x7a')][_0x4402('0x117')],_[_0x4402('0x10b')](_0x5f42bc[_0x4402('0x7a')],[_0x4402('0x117'),'id'])||{})[_0x4402('0x118')](function(){return db[_0x4402('0x75')][_0x4402('0x112')]({'attributes':['id',_0x4402('0x36'),_0x4402('0x119')],'where':{'id':_0x5f42bc[_0x4402('0x7a')]['ids']}});})[_0x4402('0x34')](function(_0x132621){socket[_0x4402('0x11a')](_0x4402('0x11b'),{'id':Number(_0x5f42bc[_0x4402('0xb6')]['id']),'tags':_0x132621||[]});return{'id':Number(_0x5f42bc[_0x4402('0xb6')]['id']),'tags':_0x132621||[]};});}})[_0x4402('0x34')](respondWithResult(_0x50999c,null))[_0x4402('0x41')](handleError(_0x50999c,null));};exports[_0x4402('0x11c')]=function(_0x4e0ae2,_0x21e2c8,_0x1845d8){return db[_0x4402('0x43')]['find']({'where':{'id':_0x4e0ae2[_0x4402('0xb6')]['id']}})['then'](handleEntityNotFound(_0x21e2c8,null))[_0x4402('0x34')](function(_0x424e93){if(_0x424e93){return _0x424e93[_0x4402('0x11c')](_0x4e0ae2[_0x4402('0x48')]['ids']);}})[_0x4402('0x34')](respondWithStatusCode(_0x21e2c8,null))['catch'](handleError(_0x21e2c8,null));};exports[_0x4402('0xe4')]=function(_0x4cb0bf,_0x2a586e){var _0x5325a7=moment()[_0x4402('0x11d')]()['toString']();var _0x157060=path[_0x4402('0xe0')](config[_0x4402('0xe1')],_0x4402('0x11e'),_0x4402('0x11f'),_0x4402('0x120'));var _0x2ead56=path[_0x4402('0xe0')](config['root'],_0x4402('0x11e'),_0x4402('0x11f'),_0x4402('0x121'));var _0x31d19c=path[_0x4402('0xe0')](_0x157060,_0x5325a7);var _0x1675b2=util[_0x4402('0xe8')](_0x4402('0x122'),_0x4cb0bf['params']['id'],_0x5325a7);var _0xe5e2f3=path[_0x4402('0xe0')](_0x157060,_0x1675b2);var _0x22c8a1=[];_0x22c8a1[_0x4402('0xb2')]({'model':db[_0x4402('0x77')],'as':_0x4402('0x77'),'attributes':['id',_0x4402('0xc0')],'raw':!![]});_0x22c8a1[_0x4402('0xb2')]({'model':db[_0x4402('0xd1')],'as':_0x4402('0x6e'),'attributes':['id',_0x4402('0x123'),'lastName'],'raw':!![]});if(_0x4cb0bf[_0x4402('0x48')]['attachments']){_0x22c8a1[_0x4402('0xb2')]({'model':db[_0x4402('0xdc')],'as':_0x4402('0xdc'),'raw':!![]});}var _0x177297=[{'model':db['ChatMessage'],'as':_0x4402('0xec'),'attributes':['id','body',_0x4402('0x7f'),'direction',_0x4402('0xfa'),_0x4402('0x85')],'include':_0x22c8a1}];_0x177297[_0x4402('0xb2')]({'model':db[_0x4402('0xbc')],'as':_0x4402('0x124'),'attributes':['id',_0x4402('0x36')]});_0x177297[_0x4402('0xb2')]({'model':db[_0x4402('0x77')],'as':'Owner','attributes':['id',_0x4402('0xc0')]});return db[_0x4402('0x43')][_0x4402('0x69')]({'where':{'id':_0x4cb0bf[_0x4402('0xb6')]['id']},'include':_0x177297})[_0x4402('0x34')](handleEntityNotFound(_0x2a586e,null))[_0x4402('0x34')](function(_0x140207){if(_0x140207){var _0x1d2478=_0x140207[_0x4402('0x125')]({'plain':!![]});fs[_0x4402('0x126')](_0x31d19c);var _0x286a77={'channel':_0x4402('0x127'),'account':_0x1d2478[_0x4402('0x124')][_0x4402('0x36')],'agent':_0x1d2478['Owner']?_0x1d2478[_0x4402('0x128')][_0x4402('0xc0')]:_0x4402('0x129'),'createdAt':moment(_0x1d2478[_0x4402('0x7f')])[_0x4402('0xe8')](_0x4402('0x110'))[_0x4402('0x9e')](),'closedAt':_0x1d2478[_0x4402('0x12a')]?moment(_0x1d2478['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x4402('0x9e')]():'','disposition':_0x1d2478['disposition'],'chatInfo':{'browser':_0x1d2478[_0x4402('0x12b')],'os':_0x1d2478['osName'],'referer':_0x1d2478[_0x4402('0x12c')],'customerIp':_0x1d2478[_0x4402('0x12d')],'customerPort':_0x1d2478[_0x4402('0x12e')]?_0x1d2478['customerPort']:_0x4402('0x129')},'messages':_(_0x1d2478[_0x4402('0xec')])[_0x4402('0x12f')]()[_0x4402('0x8a')]({'secret':![]})['map'](function(_0x633496){if(_0x633496[_0x4402('0xdc')]){var _0x5862a7=path[_0x4402('0xe0')](_0x2ead56,_0x633496['Attachment'][_0x4402('0xd9')]);if(fs[_0x4402('0x130')](_0x5862a7)){fs[_0x4402('0x131')](_0x5862a7)[_0x4402('0x132')](fs[_0x4402('0x133')](path[_0x4402('0xe0')](_0x31d19c,_0x633496[_0x4402('0xdc')][_0x4402('0xd9')])));}}return{'date':moment(_0x633496[_0x4402('0x7f')])[_0x4402('0xe8')](_0x4402('0x110'))[_0x4402('0x9e')](),'sender':_0x633496['direction']===_0x4402('0xcd')?_0x633496[_0x4402('0x77')]?_0x633496[_0x4402('0x77')][_0x4402('0xc0')]:_0x4402('0xf0'):_0x633496['Contact'][_0x4402('0x123')]+(_0x633496[_0x4402('0x6e')][_0x4402('0x134')]?'\x20'+_0x633496[_0x4402('0x6e')][_0x4402('0x134')]:''),'body':_0x633496[_0x4402('0xdc')]?_0x633496[_0x4402('0xdc')]['basename']:_0x633496[_0x4402('0x7a')],'direction':_0x633496['direction']===_0x4402('0xcd')?'A':'C','secret':_0x633496[_0x4402('0xfa')],'read':_0x633496[_0x4402('0x85')],'attachment':_0x633496['Attachment']};})[_0x4402('0x6b')]()};return ejs[_0x4402('0x135')](path[_0x4402('0xe0')](config[_0x4402('0xe1')],_0x4402('0x11e'),'views','downloadInteraction.ejs'),{'interaction':_0x286a77})['then'](function(_0x5b8cd8){var _0x3fc6b3=path[_0x4402('0xe0')](_0x31d19c,'transcript-'+_0x1d2478['id']+'-'+_0x5325a7+_0x4402('0x136'));var _0x15bbe1={'path':_0x3fc6b3,'channel':_0x4402('0x127'),'interactionId':_0x1d2478['id']};return pdf[_0x4402('0x137')](_0x5b8cd8,_0x15bbe1);})[_0x4402('0x34')](function(){return new BPromise(function(_0x303680,_0x281eaa){zipdir(_0x31d19c,{'saveTo':_0xe5e2f3},function(_0x1baf42,_0x3d743e){if(_0x1baf42)return _0x281eaa(_0x1baf42);return _0x303680(_0x3d743e);});})[_0x4402('0x34')](function(){return new BPromise(function(_0x5ad41f,_0xbeb577){rimraf(_0x31d19c,function(_0x8c8f01){if(_0x8c8f01)_0xbeb577(_0x8c8f01);return _0x5ad41f();});});})[_0x4402('0x34')](function(){return _0x2a586e[_0x4402('0xe4')](_0xe5e2f3,_0x1675b2,function(_0xc36aed){if(_0xc36aed){console['log'](_0x4402('0x138'),_0xc36aed);}else{fs[_0x4402('0x139')](_0xe5e2f3);}});});});}else{return _0x2a586e[_0x4402('0x35')](0xc8);}})[_0x4402('0x41')](handleError(_0x2a586e,null));};
\ No newline at end of file
+var _0xb10b=['querystring','papaparse','ioredis','../../components/auth/service','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./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','result','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','reject','update','stack','name','send','body','contact','interaction','account','Users','map','fullname','TagIds','Tags','forEach','push','index','ChatInteraction','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','value','having','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','buildExpression','some','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','isEmpty','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','catch','show','params','keys','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooNote','email','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','follow','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','filename','mimetype','attachmentDownload','closed','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','close','mailTranscript','root','now','Messages','format','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agentAlias','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ids','omit','getMessages','split','YYYY-MM-DD\x20HH:mm:ss','includeAgent','alias','findAll','setTags','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','Account','Owner','get','mkdirSync','Chat','N.A.','disposition','osName','referer','customerPort','tail','existsSync','pipe','createWriteStream','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x2f4d7f,_0x62f4b7){var _0x147ba1=function(_0x14ef36){while(--_0x14ef36){_0x2f4d7f['push'](_0x2f4d7f['shift']());}};_0x147ba1(++_0x62f4b7);}(_0xb10b,0x12a));var _0xbb10=function(_0x541a67,_0x50728d){_0x541a67=_0x541a67-0x0;var _0x45da2a=_0xb10b[_0x541a67];return _0x45da2a;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xbb10('0x13'));var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))('api');var utils=require(_0xbb10('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb10('0x17'));var db=require(_0xbb10('0x18'))['db'];config[_0xbb10('0x19')]=_[_0xbb10('0x1a')](config[_0xbb10('0x19')],{'host':_0xbb10('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbb10('0x19')]));require(_0xbb10('0x1c'))[_0xbb10('0x1d')](socket);var jayson=require(_0xbb10('0x1e'));var client=jayson[_0xbb10('0x1f')][_0xbb10('0x20')]({'port':0x232b});var client9004=jayson[_0xbb10('0x1f')][_0xbb10('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x3e26f4,_0x2b184e,_0x4a2bfc,_0x2eca0f){return new BPromise(function(_0x1145f1,_0x133ac2){var _0x42db98=_0x2eca0f||client;return _0x42db98[_0xbb10('0x21')](_0x3e26f4,_0x4a2bfc)[_0xbb10('0x22')](function(_0x575cca){logger[_0xbb10('0x23')](_0xbb10('0x24'),_0x2b184e,_0xbb10('0x25'));logger['debug'](_0xbb10('0x26'),_0x2b184e,_0xbb10('0x25'),JSON[_0xbb10('0x27')](_0x575cca));if(_0x575cca[_0xbb10('0x28')]){if(_0x575cca[_0xbb10('0x28')][_0xbb10('0x29')]===0x1f4){logger['error'](_0xbb10('0x24'),_0x2b184e,_0x575cca[_0xbb10('0x28')]['message']);return _0x133ac2(_0x575cca['error'][_0xbb10('0x2a')]);}logger[_0xbb10('0x28')](_0xbb10('0x24'),_0x2b184e,_0x575cca[_0xbb10('0x28')][_0xbb10('0x2a')]);return _0x1145f1(_0x575cca[_0xbb10('0x28')][_0xbb10('0x2a')]);}else{logger[_0xbb10('0x23')](_0xbb10('0x24'),_0x2b184e,_0xbb10('0x25'));_0x1145f1(_0x575cca[_0xbb10('0x2b')][_0xbb10('0x2a')]);}})['catch'](function(_0x4fedac){logger['error'](_0xbb10('0x24'),_0x2b184e,_0x4fedac);_0x133ac2(_0x4fedac);});});}function respondWithStatusCode(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0xcc;return function(_0x4e25ff){if(_0x4e25ff){return _0x3c5ae7[_0xbb10('0x2c')](_0x2c89b9);}return _0x3c5ae7[_0xbb10('0x2d')](_0x2c89b9)[_0xbb10('0x2e')]();};}function respondWithResult(_0x1d5e95,_0x1acce9){_0x1acce9=_0x1acce9||0xc8;return function(_0x20d946){if(_0x20d946){return _0x1d5e95[_0xbb10('0x2d')](_0x1acce9)['json'](_0x20d946);}};}function respondWithFilteredResult(_0x3796c7,_0x21ac54){return function(_0xfc3595){if(_0xfc3595){var _0x2e0249=typeof _0x21ac54[_0xbb10('0x2f')]===_0xbb10('0x30')&&typeof _0x21ac54['limit']===_0xbb10('0x30');var _0x4ee02e=_0xfc3595[_0xbb10('0x31')];var _0x56f2da=_0x2e0249?0x0:_0x21ac54[_0xbb10('0x2f')];var _0x1dcc9c=_0x2e0249?_0xfc3595[_0xbb10('0x31')]:_0x21ac54['offset']+_0x21ac54['limit'];var _0x4c3744;if(_0x1dcc9c>=_0x4ee02e){_0x1dcc9c=_0x4ee02e;_0x4c3744=0xc8;}else{_0x4c3744=0xce;}_0x3796c7[_0xbb10('0x2d')](_0x4c3744);return _0x3796c7['set'](_0xbb10('0x32'),_0x56f2da+'-'+_0x1dcc9c+'/'+_0x4ee02e)[_0xbb10('0x33')](_0xfc3595);}return null;};}function patchUpdates(_0x2f653f){return function(_0x1c0b57){try{jsonpatch[_0xbb10('0x34')](_0x1c0b57,_0x2f653f,!![]);}catch(_0x138bc6){return BPromise[_0xbb10('0x35')](_0x138bc6);}return _0x1c0b57['save']();};}function saveUpdates(_0x25acb3,_0x1da9c9){return function(_0x441d15){if(_0x441d15){return _0x441d15[_0xbb10('0x36')](_0x25acb3)[_0xbb10('0x22')](function(_0x9de708){return _0x9de708;});}return null;};}function removeEntity(_0x188cbd,_0x10202c){return function(_0x3c8d7d){if(_0x3c8d7d){return _0x3c8d7d['destroy']()[_0xbb10('0x22')](function(){_0x188cbd[_0xbb10('0x2d')](0xcc)[_0xbb10('0x2e')]();});}};}function handleEntityNotFound(_0x3c3c45,_0x570f5a){return function(_0x111762){if(!_0x111762){_0x3c3c45['sendStatus'](0x194);}return _0x111762;};}function handleError(_0x4e2754,_0x3eb3cc){_0x3eb3cc=_0x3eb3cc||0x1f4;return function(_0x40c164){logger[_0xbb10('0x28')](_0x40c164[_0xbb10('0x37')]);if(_0x40c164[_0xbb10('0x38')]){delete _0x40c164[_0xbb10('0x38')];}_0x4e2754['status'](_0x3eb3cc)[_0xbb10('0x39')](_0x40c164);};}function getMustacheRender(_0x25d72f,_0x52de31){return Mustache['render'](_0x25d72f,_['merge'](_0x52de31[_0xbb10('0x3a')],{'contact':_0x52de31[_0xbb10('0x3b')],'message':_0x52de31[_0xbb10('0x2a')],'agent':_0x52de31['agent'],'interaction':_0x52de31[_0xbb10('0x3c')],'account':_0x52de31[_0xbb10('0x3d')]}))||'';}function getInteractionUsers(_0x4345f3,_0x4d1a83){return new BPromise(function(_0x17b6c5,_0x12238a){try{if(_0x4d1a83[_0x4345f3['id']]){_0x4345f3[_0xbb10('0x3e')]=_[_0xbb10('0x3f')](_0x4d1a83[_0x4345f3['id']],function(_0x4f1cdd){return{'id':_0x4f1cdd['id'],'fullname':_0x4f1cdd[_0xbb10('0x40')]};});}}catch(_0x110eb5){_0x12238a(_0x110eb5);}_0x17b6c5(_0x4345f3);});}function getInteractionTags(_0x5835fd,_0xe2040f){return new BPromise(function(_0x2e3214,_0x44d6ae){try{if(_0x5835fd[_0xbb10('0x41')]){_0x5835fd[_0xbb10('0x42')]=[];_0x5835fd[_0xbb10('0x41')]['split'](',')[_0xbb10('0x43')](function(_0x1c7fae){_0x5835fd[_0xbb10('0x42')][_0xbb10('0x44')](_0xe2040f[_0x1c7fae]);});}delete _0x5835fd['TagIds'];}catch(_0x3fff6c){_0x44d6ae(_0x3fff6c);}_0x2e3214(_0x5835fd);});}function updateChatInteraction(_0x331751,_0x23dc18,_0x403beb){return new BPromise(function(_0x5e2cfa,_0x351484){return getInteractionUsers(_0x331751,_0x403beb)[_0xbb10('0x22')](function(_0x54ac18){return getInteractionTags(_0x54ac18,_0x23dc18);})['then'](function(_0x38d78f){_0x5e2cfa(_0x38d78f);})['catch'](function(_0x318984){_0x351484(_0x318984);});});}exports[_0xbb10('0x45')]=function(_0x4c66d8,_0x366608){var _0x1d82bf={},_0x474e99={},_0x5cf4f8={'count':0x0,'rows':[]};var _0x2dd02b=_[_0xbb10('0x3f')](db[_0xbb10('0x46')][_0xbb10('0x47')],function(_0x36e1fa){return{'name':_0x36e1fa[_0xbb10('0x48')],'type':_0x36e1fa[_0xbb10('0x49')][_0xbb10('0x4a')]};});_0x474e99[_0xbb10('0x4b')]=_[_0xbb10('0x3f')](_0x2dd02b,_0xbb10('0x38'));_0x474e99[_0xbb10('0x4c')]=_['keys'](_0x4c66d8[_0xbb10('0x4c')]);_0x474e99[_0xbb10('0x4d')]=_['intersection'](_0x474e99[_0xbb10('0x4b')],_0x474e99[_0xbb10('0x4c')]);_0x1d82bf[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x474e99[_0xbb10('0x4b')],qs[_0xbb10('0x50')](_0x4c66d8[_0xbb10('0x4c')]['fields']));_0x1d82bf['attributes']=_0x1d82bf[_0xbb10('0x4e')][_0xbb10('0x51')]?_0x1d82bf[_0xbb10('0x4e')]:_0x474e99['model'];if(!_0x4c66d8['query'][_0xbb10('0x52')](_0xbb10('0x53'))){_0x1d82bf[_0xbb10('0x54')]=qs[_0xbb10('0x54')](_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x54')]);_0x1d82bf[_0xbb10('0x2f')]=qs[_0xbb10('0x2f')](_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x2f')]);}_0x1d82bf['order']=qs['sort'](_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x55')]);_0x1d82bf[_0xbb10('0x56')]=qs[_0xbb10('0x4d')](_[_0xbb10('0x57')](_0x4c66d8[_0xbb10('0x4c')],_0x474e99[_0xbb10('0x4d')]),_0x2dd02b);var _0x445870=[];var _0x1c0d8f=squel[_0xbb10('0x58')]()[_0xbb10('0x59')]('id')[_0xbb10('0x59')](_0xbb10('0x38'))[_0xbb10('0x59')](_0xbb10('0x5a'))['from'](_0xbb10('0x5b'));var _0x5bd44d=squel[_0xbb10('0x58')]()[_0xbb10('0x59')](_0xbb10('0x5c'))[_0xbb10('0x59')](_0xbb10('0x5d'))[_0xbb10('0x59')](_0xbb10('0x5e'))[_0xbb10('0x5f')](_0xbb10('0x60'),'ui')[_0xbb10('0x61')](_0xbb10('0x62'),'u',_0xbb10('0x63'));var _0x1d49e1=squel[_0xbb10('0x58')]()[_0xbb10('0x5f')]('chat_interactions','i')[_0xbb10('0x61')](_0xbb10('0x64'),'c',_0xbb10('0x65'))[_0xbb10('0x61')](_0xbb10('0x62'),'o',_0xbb10('0x66'))['left_join'](_0xbb10('0x67'),'a',_0xbb10('0x68'))[_0xbb10('0x61')](_0xbb10('0x69'),'me',_0xbb10('0x6a'))[_0xbb10('0x61')](_0xbb10('0x6b'),'it',_0xbb10('0x6c'))[_0xbb10('0x61')](_0xbb10('0x5b'),'t',_0xbb10('0x6d'));var _0x2a1ce1=squel[_0xbb10('0x6e')]();var _0x4e7fac=[];var _0x4ea1a6=squel[_0xbb10('0x6e')]();var _0x3e6338;if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x6f')]){_0x3e6338=as['parseSearch'](_0x4c66d8['query'][_0xbb10('0x6f')]);var _0xaf2cc3=_0x3e6338[_0xbb10('0x70')];for(var _0x2dd150=0x0;_0x2dd150<_0x3e6338[_0xbb10('0x71')][_0xbb10('0x51')];_0x2dd150++){var _0x45c0dc=_0x3e6338['conditions'][_0x2dd150];var _0x117e84='i';var _0x216cff=_['find'](_0x2dd02b,['name',_0x45c0dc['field']]);if(!_0x216cff){switch(_0x45c0dc[_0xbb10('0x59')]){case _0xbb10('0x72'):if(_0x45c0dc[_0xbb10('0x73')]==0x1){_0x1d49e1['having']('`'+_0x45c0dc['field']+'`\x20=\x200');}else{_0x1d49e1[_0xbb10('0x74')]('`'+_0x45c0dc[_0xbb10('0x59')]+_0xbb10('0x75'));}break;case'Contact':if(_0x45c0dc[_0xbb10('0x76')]===_0xbb10('0x77')){if(_0x45c0dc['value']['split']('\x20')[_0xbb10('0x51')]>0x1){_0x2a1ce1[_0xaf2cc3](_0xbb10('0x78'),qs[_0xbb10('0x79')](_0x45c0dc[_0xbb10('0x73')]),null);}else{var _0x54b7c5='%'+_0x45c0dc[_0xbb10('0x73')]+'%';_0x2a1ce1[_0xaf2cc3](_0xbb10('0x7a'),_0x54b7c5,_0x54b7c5,_0x54b7c5);}}else{_0x216cff=_[_0xbb10('0x7b')](_0x2dd02b,['name',_0xbb10('0x7c')]);_0x45c0dc[_0xbb10('0x59')]=_0xbb10('0x7c');_0x329da7=as['buildExpression'](_0x117e84,_0x216cff[_0xbb10('0x49')],_0x45c0dc);_0x2a1ce1[_0xaf2cc3](_0x329da7[_0xbb10('0x7d')],_0x329da7[_0xbb10('0x73')][_0xbb10('0x7e')],_0x329da7['value'][_0xbb10('0x2e')]);}break;case _0xbb10('0x7f'):var _0x108e5b=_0x45c0dc[_0xbb10('0x73')]['split'](',')[_0xbb10('0x3f')](function(_0x277fe7){return Number(_0x277fe7);});_0x108e5b[_0xbb10('0x43')](function(_0x2ceb3e){_0x4ea1a6['or'](_0xbb10('0x80'),'%,'+_0x2ceb3e+',%');});_0x4e7fac=_[_0xbb10('0x81')](_0x4e7fac,_0x108e5b);break;case _0xbb10('0x82'):if(_0x45c0dc['operator']==='$substring'){_0x2a1ce1[_0xaf2cc3]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x45c0dc[_0xbb10('0x73')]+'%',null);}else{_0x216cff=_[_0xbb10('0x7b')](_0x2dd02b,[_0xbb10('0x38'),'UserId']);_0x45c0dc['field']=_0xbb10('0x83');_0x329da7=as[_0xbb10('0x84')](_0x117e84,_0x216cff[_0xbb10('0x49')],_0x45c0dc);_0x2a1ce1[_0xaf2cc3](_0x329da7[_0xbb10('0x7d')],_0x329da7[_0xbb10('0x73')][_0xbb10('0x7e')],_0x329da7['value'][_0xbb10('0x2e')]);}break;case _0xbb10('0x3a'):_0x329da7=as[_0xbb10('0x84')]('me',null,_0x45c0dc);_0x2a1ce1[_0xaf2cc3](_0x329da7[_0xbb10('0x7d')],_0x329da7[_0xbb10('0x73')]['start'],_0x329da7['value']['end']);break;}}else{var _0x329da7=as[_0xbb10('0x84')](_0x117e84,_0x216cff[_0xbb10('0x49')],_0x45c0dc);_0x2a1ce1[_0xaf2cc3](_0x329da7[_0xbb10('0x7d')],_0x329da7[_0xbb10('0x73')][_0xbb10('0x7e')],_0x329da7['value'][_0xbb10('0x2e')]);}}}else{var _0x4bc316=_(_0x4c66d8['query'])['keys']()[_0xbb10('0x3f')](function(_0x13040d){return _[_0xbb10('0x85')](_0x2dd02b,[_0xbb10('0x38'),_0x13040d])?_0x13040d:undefined;})['compact']()[_0xbb10('0x73')]();if(!_['isEmpty'](_0x4bc316)){_0x4bc316['forEach'](function(_0x165fe9){if(_0x165fe9===_0xbb10('0x86')){_0x1d49e1[_0xbb10('0x56')](_0xbb10('0x87'),[][_0xbb10('0x88')](_0x4c66d8['query'][_0x165fe9]));}else if(_0x165fe9===_0xbb10('0x89')){var _0x19fcec=JSON[_0xbb10('0x8a')](_0x4c66d8[_0xbb10('0x4c')][_0x165fe9])[_0xbb10('0x8b')];var _0x27f42f=JSON[_0xbb10('0x8a')](_0x4c66d8['query'][_0x165fe9])[_0xbb10('0x8c')];_0x1d49e1[_0xbb10('0x56')](_0xbb10('0x8d'),_0x19fcec,_0x27f42f);}else{if(_0x4c66d8[_0xbb10('0x4c')][_0x165fe9]===_0xbb10('0x8e')){_0x1d49e1[_0xbb10('0x56')]('i.'+_0x165fe9+_0xbb10('0x8f'));}else{_0x1d49e1[_0xbb10('0x56')]('i.'+_0x165fe9+'\x20=\x20?',_0x4c66d8[_0xbb10('0x4c')][_0x165fe9]);}}});}if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x90')]){if(_0x4c66d8['query']['read']==0x1){_0x1d49e1['having'](_0xbb10('0x91'));}else{_0x1d49e1['having']('`unreadMessages`\x20>\x200');}}if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x92')]){_0x4e7fac=_[_0xbb10('0x93')](_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x92')])?_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x92')]:new Array(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x92')]);_0x4e7fac['forEach'](function(_0x318a14){_0x4ea1a6['or'](_0xbb10('0x80'),'%,'+_0x318a14+',%');});}if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x94')]){var _0x5c8eb8=_0x4c66d8['query'][_0xbb10('0x94')][_0xbb10('0x95')]('\x5c','\x5c\x5c')[_0xbb10('0x95')](/'/g,'\x27\x27');if(qs[_0xbb10('0x96')](_0x5c8eb8)){_0x2a1ce1['or']('i.id\x20LIKE\x20?',_0x5c8eb8+'%');}else{_0x2a1ce1['or'](_0xbb10('0x97'),qs[_0xbb10('0x79')](_0x5c8eb8))['or'](_0xbb10('0x98'),_0x5c8eb8+'%');}}}_0x1d49e1[_0xbb10('0x56')](_0x2a1ce1);_0x1d49e1[_0xbb10('0x99')]('i.id');var _0x5f0691={'type':db[_0xbb10('0x9a')][_0xbb10('0x9b')][_0xbb10('0x9c')],'raw':!![]};var _0x5239da=_0x1d49e1[_0xbb10('0x9d')]();_0x5239da[_0xbb10('0x59')]('i.id');_0x5239da['field'](_0xbb10('0x9e'),_0xbb10('0x72'));if(_0x1d82bf[_0xbb10('0x9f')]){_0x1d82bf['order'][_0xbb10('0x43')](function(_0x3a17fc){var _0xfbb365=_0x3a17fc[0x0]===_0xbb10('0xa0')?_0x3a17fc[0x0]:'i.'+_0x3a17fc[0x0];_0x1d49e1[_0xbb10('0x9f')](_0xfbb365,_0x3a17fc[0x1]===_0xbb10('0xa1')?![]:!![]);});}if(!_[_0xbb10('0xa2')](_0x4e7fac)){_0x1d49e1[_0xbb10('0x74')](_0x4ea1a6);_0x5239da[_0xbb10('0x56')]('t.id\x20IN\x20?',_0x4e7fac);}BPromise[_0xbb10('0xa3')]()[_0xbb10('0x22')](function(){if(!_0x3e6338){if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x86')])return;_0x5239da[_0xbb10('0x56')](_0xbb10('0xa4'));_0x1d49e1[_0xbb10('0x56')](_0xbb10('0xa4'));return;}if(_0x4c66d8[_0xbb10('0xa5')][_0xbb10('0xa6')]!==_0xbb10('0xa7'))return;return _0x4c66d8[_0xbb10('0xa5')]['getChatWebsites']({'attributes':['id'],'raw':!![]})['then'](function(_0xe1fc51){if(_[_0xbb10('0xa2')](_0xe1fc51)){_0x5239da[_0xbb10('0x56')](_0xbb10('0xa8'));_0x1d49e1[_0xbb10('0x56')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x5239da[_0xbb10('0x56')](_0xbb10('0x87'),_[_0xbb10('0x3f')](_0xe1fc51,'id'));_0x1d49e1[_0xbb10('0x56')](_0xbb10('0x87'),_[_0xbb10('0x3f')](_0xe1fc51,'id'));}});})['then'](function(){if(_0x4c66d8[_0xbb10('0xa5')][_0xbb10('0xa6')]==='agent'&&!_0x3e6338&&!_0x4c66d8[_0xbb10('0x4c')]['ChatWebsiteId'])return[];return db[_0xbb10('0xa9')][_0xbb10('0x4c')](_0x5239da[_0xbb10('0xaa')](),_0x5f0691);})[_0xbb10('0x22')](function(_0x3a4a6e){_0x5cf4f8['count']=_0x3a4a6e[_0xbb10('0x51')];if(_0x5cf4f8['count']===0x0)return[];return db[_0xbb10('0xa9')][_0xbb10('0x4c')](_0x1c0d8f['toString'](),_0x5f0691)['then'](function(_0x415407){_0x445870=_[_0xbb10('0xab')](_0x415407,'id');_0x5f0691=_[_0xbb10('0xac')](_0x5f0691,{'model':db[_0xbb10('0x46')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x50')]){_0x1d82bf[_0xbb10('0x4e')][_0xbb10('0x43')](function(_0x252ab8){_0x1d49e1[_0xbb10('0x59')]('i.'+_0x252ab8);});}else{_0x1d49e1[_0xbb10('0x59')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xbb10('0x72'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xad'),_0xbb10('0xae'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xaf'),_0xbb10('0xb0'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb1'),_0xbb10('0xa0'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb2'));_0x1d49e1['field'](_0xbb10('0xb3'),'Contact.firstName');_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb4'),_0xbb10('0xb5'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb6'),'Contact.email');_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb7'),_0xbb10('0xb8'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb9'),_0xbb10('0xba'));_0x1d49e1['field']('c.fax',_0xbb10('0xbb'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xbc'),'Owner.fullname');_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xbd'),'Owner.internal');_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xbe'),'TagIds');}if(_0x1d82bf[_0xbb10('0x54')])_0x1d49e1['limit'](_0x1d82bf[_0xbb10('0x54')]);if(_0x1d82bf[_0xbb10('0x2f')])_0x1d49e1['offset'](_0x1d82bf[_0xbb10('0x2f')]);return db[_0xbb10('0xa9')]['query'](_0x1d49e1['toString'](),_0x5f0691);})[_0xbb10('0x22')](function(_0x13ae83){if(_0x13ae83[_0xbb10('0x51')]>0x0)_0x5bd44d[_0xbb10('0x56')](_0xbb10('0xbf'),_['map'](_0x13ae83,'id'));return db[_0xbb10('0xa9')][_0xbb10('0x4c')](_0x5bd44d[_0xbb10('0xaa')](),_0x5f0691)['then'](function(_0xd68afa){var _0x4f90e6=_[_0xbb10('0xc0')](_0xd68afa,_0xbb10('0xc1'));var _0x44a3e1=[];_0x13ae83[_0xbb10('0x43')](function(_0x1f55d3){_0x44a3e1[_0xbb10('0x44')](updateChatInteraction(_0x1f55d3,_0x445870,_0x4f90e6));});return BPromise[_0xbb10('0xc2')](_0x44a3e1);});});})['then'](function(_0x4fc544){_0x5cf4f8[_0xbb10('0xc3')]=_0x4fc544;return _0x5cf4f8;})[_0xbb10('0x22')](respondWithFilteredResult(_0x366608,_0x1d82bf))[_0xbb10('0xc4')](handleError(_0x366608,null));};exports[_0xbb10('0xc5')]=function(_0x20b585,_0x363b81){var _0x1cccec={'raw':![],'where':{'id':_0x20b585[_0xbb10('0xc6')]['id']}},_0x1674f7={};_0x1674f7[_0xbb10('0x4b')]=_[_0xbb10('0xc7')](db[_0xbb10('0x46')][_0xbb10('0x47')]);_0x1674f7['query']=_[_0xbb10('0xc7')](_0x20b585[_0xbb10('0x4c')]);_0x1674f7[_0xbb10('0x4d')]=_[_0xbb10('0x4f')](_0x1674f7[_0xbb10('0x4b')],_0x1674f7[_0xbb10('0x4c')]);_0x1cccec[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x1674f7[_0xbb10('0x4b')],qs[_0xbb10('0x50')](_0x20b585[_0xbb10('0x4c')]['fields']));_0x1cccec[_0xbb10('0x4e')]=_0x1cccec['attributes'][_0xbb10('0x51')]?_0x1cccec[_0xbb10('0x4e')]:_0x1674f7[_0xbb10('0x4b')];if(_0x20b585[_0xbb10('0x4c')][_0xbb10('0xc8')]){_0x1cccec[_0xbb10('0xc9')]=[{'all':!![]}];}_0x1cccec=_['merge']({},_0x1cccec,_0x20b585[_0xbb10('0xca')]);return db['ChatInteraction'][_0xbb10('0x7b')](_0x1cccec)[_0xbb10('0x22')](handleEntityNotFound(_0x363b81,null))[_0xbb10('0x22')](respondWithResult(_0x363b81,null))[_0xbb10('0xc4')](handleError(_0x363b81,null));};exports[_0xbb10('0xcb')]=function(_0x31907e,_0x4f06c){return db[_0xbb10('0x46')][_0xbb10('0xcb')](_0x31907e[_0xbb10('0x3a')],{})[_0xbb10('0x22')](respondWithResult(_0x4f06c,0xc9))[_0xbb10('0xc4')](handleError(_0x4f06c,null));};exports['update']=function(_0x3696b3,_0x516520){if(_0x3696b3[_0xbb10('0x3a')]['id']){delete _0x3696b3[_0xbb10('0x3a')]['id'];}return db[_0xbb10('0x46')][_0xbb10('0x7b')]({'where':{'id':_0x3696b3[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x516520,null))[_0xbb10('0x22')](saveUpdates(_0x3696b3['body'],null))[_0xbb10('0x22')](respondWithResult(_0x516520,null))['catch'](handleError(_0x516520,null));};exports['destroy']=function(_0x1513e0,_0x35cbb9){return db[_0xbb10('0x46')][_0xbb10('0x7b')]({'where':{'id':_0x1513e0[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x35cbb9,null))['then'](removeEntity(_0x35cbb9,null))[_0xbb10('0xc4')](handleError(_0x35cbb9,null));};exports[_0xbb10('0xcc')]=function(_0x39aa9e,_0xb1b7c8){return db[_0xbb10('0x46')][_0xbb10('0xcc')]()['then'](respondWithResult(_0xb1b7c8,null))[_0xbb10('0xc4')](handleError(_0xb1b7c8,null));};exports[_0xbb10('0xcd')]=function(_0xb7c454,_0xa8b7c3){var _0x31718f=_0xb7c454[_0xbb10('0xc6')]['id'];var _0x2764e1;var _0x5e405b;var _0x33a43e;return db['ChatInteraction'][_0xbb10('0xce')]({'where':{'id':_0x31718f}})['then'](function(_0x4c8b68){_0x2764e1=_0x4c8b68;return db[_0xbb10('0xcf')][_0xbb10('0xce')]({'where':{'id':_0x4c8b68[_0xbb10('0x86')]},'attributes':['id',_0xbb10('0xd0'),_0xbb10('0xd1'),'vidaooTopic',_0xbb10('0xd2'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x4dd138){if(_0x4dd138&&_0x4dd138[_0xbb10('0xd0')]&&_0x4dd138[_0xbb10('0xd1')]){_0x5e405b=_0x4dd138;var _0x1b9012={'interaction':{'id':_0x31718f},'agent':{'id':_0xb7c454[_0xbb10('0xa5')]['id'],'name':_0xb7c454[_0xbb10('0xa5')]['name'],'fullname':_0xb7c454[_0xbb10('0xa5')][_0xbb10('0x40')],'email':_0xb7c454[_0xbb10('0xa5')][_0xbb10('0xd3')]},'contact':_0xb7c454[_0xbb10('0x3a')][_0xbb10('0x3b')],'account':_0xb7c454[_0xbb10('0x3a')]['account']};var _0x4c95c2={'rejectUnauthorized':![],'method':'POST','url':_0xbb10('0xd4'),'headers':{'X-APIKEY':_0x4dd138[_0xbb10('0xd0')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0xb7c454[_0xbb10('0xa5')][_0xbb10('0xd3')]],'buttons':null,'topic':_0x5e405b[_0xbb10('0xd5')],'note':_[_0xbb10('0xd6')](_0x5e405b[_0xbb10('0xd2')])?null:getMustacheRender(_0x5e405b[_0xbb10('0xd2')],_0x1b9012),'metadata':null},'redirect':_0xbb10('0xd7'),'json':!![]};try{if(!_[_0xbb10('0xd6')](_0x5e405b['vidaooMetadata'])){var _0x58295f=getMustacheRender(_0x5e405b['vidaooMetadata'],_0x1b9012);var _0x3d4b89=JSON[_0xbb10('0x8a')](_0x58295f);_0x4c95c2[_0xbb10('0x3a')]['metadata']=_0x3d4b89;}}catch(_0x2bfa8e){throw new db[(_0xbb10('0x9a'))][(_0xbb10('0xd8'))](_0xbb10('0xd9'));}return rp(_0x4c95c2);}else{throw new db[(_0xbb10('0x9a'))][(_0xbb10('0xd8'))]('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x356660){_0x33a43e=_0x356660;if(_0x33a43e['id']){var _0x48889b={'body':_0x33a43e[_0xbb10('0xda')],'ChatWebsiteId':_0x5e405b['id'],'ChatInteractionId':_0x2764e1['id'],'direction':_0xbb10('0xdb'),'UserId':_0xb7c454[_0xbb10('0xa5')]['id']};return db[_0xbb10('0xdc')][_0xbb10('0xcb')](_0x48889b,{});}else{throw new db[(_0xbb10('0x9a'))][(_0xbb10('0xd8'))](_0xbb10('0xdd'));}})[_0xbb10('0x22')](function(){return _0x2764e1[_0xbb10('0xde')]({'vidaooSessionId':_0x33a43e['id']});})['then'](respondWithResult(_0xa8b7c3,null))[_0xbb10('0xc4')](handleError(_0xa8b7c3,null));};exports['customUpdate']=function(_0x27bed2,_0x5547fa){if(_0x27bed2[_0xbb10('0x3a')]['id']){delete _0x27bed2[_0xbb10('0x3a')]['id'];}return db[_0xbb10('0x46')][_0xbb10('0x7b')]({'where':{'id':_0x27bed2['params']['id']},'include':[{'model':db[_0xbb10('0xdf')],'as':'Contact'}]})[_0xbb10('0x22')](handleEntityNotFound(_0x5547fa,null))[_0xbb10('0x22')](saveUpdates(_0x27bed2[_0xbb10('0x3a')],null))['then'](respondWithResult(_0x5547fa,null))[_0xbb10('0xc4')](handleError(_0x5547fa,null));};exports[_0xbb10('0xe0')]=function(_0x140173,_0x18a44f,_0x11d31b){if(_0x140173[_0xbb10('0x3a')]['id']){delete _0x140173['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x140173[_0xbb10('0xc6')]['id']}})['then'](function(_0x318908){if(!_0x318908){logger['error'](_0xbb10('0xe1'),_0xbb10('0xe0'),0x194,_0xbb10('0xe2'));_0x18a44f['sendStatus'](0x194);}else{if(_0x318908['UserId']){throw new db[(_0xbb10('0x9a'))][(_0xbb10('0xd8'))](_0xbb10('0xe3'));}}return _0x318908;})['then'](function(_0x440108){if(_0x440108){return _0x440108[_0xbb10('0x36')]({'closed':_0x140173[_0xbb10('0x3a')]['closed'],'disposition':_0x140173['body']['disposition']})[_0xbb10('0x22')](function(_0x55aa03){return _0x55aa03;});}})[_0xbb10('0x22')](function(_0x1c2c95){return respondWithRpcPromise(_0xbb10('0xe4'),_0xbb10('0xe0'),_0x140173[_0xbb10('0x3a')],client9004);})[_0xbb10('0x22')](respondWithResult(_0x18a44f,null))[_0xbb10('0xc4')](handleError(_0x18a44f,null));};exports[_0xbb10('0xe5')]=function(_0x2746eb,_0x431792,_0x2e2710){_0x2746eb['body'][_0xbb10('0x38')]=_0x2746eb[_0xbb10('0xe6')]['originalname'];_0x2746eb[_0xbb10('0x3a')]['basename']=_0x2746eb['file'][_0xbb10('0xe7')];_0x2746eb[_0xbb10('0x3a')][_0xbb10('0x49')]=_0x2746eb[_0xbb10('0xe6')][_0xbb10('0xe8')];return db['Attachment'][_0xbb10('0xcb')](_0x2746eb[_0xbb10('0x3a')])['then'](respondWithResult(_0x431792,0xc9))[_0xbb10('0xc4')](handleError(_0x431792,null));};exports[_0xbb10('0xe9')]=function(_0x5a82e7,_0x424c96,_0x4c769b){return db[_0xbb10('0x46')][_0xbb10('0xce')]({'where':{'id':_0x5a82e7[_0xbb10('0xc6')]['id']},'raw':!![]})[_0xbb10('0x22')](handleEntityNotFound(_0x424c96,null))[_0xbb10('0x22')](function(_0x20b312){if(_0x20b312){if(_0x20b312[_0xbb10('0xea')]){return _0x424c96['status'](0x193)[_0xbb10('0x33')]({'status':0x193,'message':_0xbb10('0xeb')});}return db[_0xbb10('0xec')][_0xbb10('0xce')]({'where':{'id':_0x5a82e7[_0xbb10('0x4c')][_0xbb10('0xed')]},'raw':!![]})['then'](handleEntityNotFound(_0x424c96,null));}})['then'](function(_0x5a40e8){if(_0x5a40e8){var _0x23849e=_0x5a40e8[_0xbb10('0xee')]!==null;var _0x3e1a86=path[_0xbb10('0xef')](config['root'],_0xbb10('0xf0'));if(_0x23849e){_0x3e1a86=path[_0xbb10('0xef')](_0x3e1a86,_0xbb10('0xf1'));}var _0x577d27=path['join'](_0x3e1a86,_0x5a40e8[_0xbb10('0xf2')]);return _0x424c96['download'](_0x577d27);}})[_0xbb10('0xc4')](handleError(_0x424c96,null));};exports[_0xbb10('0xf3')]=function(_0xb9bc5a,_0x42276f){var _0x425505=null;var _0xcb61bb=null;var _0x1fe250=null;var _0x57933f=null;if(_0xb9bc5a[_0xbb10('0x3a')]['id']){delete _0xb9bc5a[_0xbb10('0x3a')]['id'];}if(_0xb9bc5a['body'][_0xbb10('0xf4')]){_0x57933f=path[_0xbb10('0xef')](config[_0xbb10('0xf5')],'server/files/chat/upload/',util['format']('transcript-%s.txt',Date[_0xbb10('0xf6')]()));_0xb9bc5a[_0xbb10('0x3a')]['pathTranscript']=_0x57933f;}return db[_0xbb10('0x46')][_0xbb10('0x7b')]({'where':{'id':_0xb9bc5a[_0xbb10('0xc6')]['id']},'include':[{'model':db[_0xbb10('0xdc')],'as':_0xbb10('0xf7'),'include':[{'model':db[_0xbb10('0x82')],'as':_0xbb10('0x82')}]}]})['then'](handleEntityNotFound(_0x42276f,null))[_0xbb10('0x22')](saveUpdates(_0xb9bc5a['body'],null))['then'](function(_0x4aa0d7){if(_0x4aa0d7){_0x425505=_0x4aa0d7;return db[_0xbb10('0xcf')][_0xbb10('0x7b')]({'where':{'id':_0x425505['ChatWebsiteId']}});}})[_0xbb10('0x22')](function(_0x49f324){if(_0x49f324){_0x1fe250=_0x49f324;return db[_0xbb10('0xdf')][_0xbb10('0x7b')]({'where':{'id':_0x425505[_0xbb10('0x7c')]}});}})['then'](function(_0x4d10ea){if(_0x4d10ea){_0xcb61bb=_0x4d10ea;if(_0x57933f){var _0x447c0d=null;for(var _0x502e73=0x1;_0x502e73<_0x425505[_0xbb10('0xf7')][_0xbb10('0x51')];++_0x502e73){_0x447c0d=_0x425505['Messages'][_0x502e73];var _0x50cd00=_0x447c0d[_0xbb10('0x83')]?util[_0xbb10('0xf8')](_0xbb10('0xf9'),_0x1fe250['agentAlias'],_0x447c0d[_0xbb10('0x83')]):_0xbb10('0xfa');var _0x22f153=_0xb9bc5a['body'][_0xbb10('0xfb')]||util[_0xbb10('0xf8')](_0xbb10('0xf9'),_0xbb10('0xfc'),_0x447c0d[_0xbb10('0x7c')]);switch(_0x1fe250[_0xbb10('0xfd')]){case _0xbb10('0xfe'):_0x50cd00=_0x447c0d[_0xbb10('0x83')]?util[_0xbb10('0xf8')](_0xbb10('0xf9'),_0x1fe250[_0xbb10('0xff')],_0x447c0d[_0xbb10('0x83')]):_0xbb10('0xfa');break;case'agent_alias':_0x50cd00=_0x447c0d['UserId']?_0x447c0d[_0xbb10('0x82')]['alias']||_0x447c0d[_0xbb10('0x82')][_0xbb10('0x40')]:_0xbb10('0xfa');break;case'agent_fullname':_0x50cd00=_0x447c0d[_0xbb10('0x83')]?_0x447c0d[_0xbb10('0x82')][_0xbb10('0x40')]:_0xbb10('0xfa');break;default:_0x50cd00=_0x447c0d[_0xbb10('0x83')]?util['format'](_0xbb10('0xf9'),_0x1fe250[_0xbb10('0xff')],_0x447c0d[_0xbb10('0x83')]):_0xbb10('0xfa');}var _0x150d4c=util[_0xbb10('0xf8')]('[%s]\x20%s:\x20%s\x0a',moment(_0x447c0d[_0xbb10('0x89')])[_0xbb10('0xf8')]('MM/DD/YYYY\x20HH:mm:ss'),_0x447c0d[_0xbb10('0x100')]==='in'?_0x22f153:_0x50cd00,_0x447c0d[_0xbb10('0x3a')]);if(!_0x447c0d[_0xbb10('0x101')]){fs[_0xbb10('0x102')](_0x57933f,_0x150d4c);}}return db[_0xbb10('0x103')][_0xbb10('0xce')]({'where':{'service':!![]},'include':[{'model':db[_0xbb10('0x104')],'as':_0xbb10('0x105'),'raw':!![]}]});}}})[_0xbb10('0x22')](function(_0x33d1b7){if(_0x33d1b7&&_0x33d1b7[_0xbb10('0x105')]&&_0xb9bc5a[_0xbb10('0x3a')]){var _0x1db646={'tls':{'rejectUnauthorized':![]}};if(_0x33d1b7[_0xbb10('0x105')][_0xbb10('0x106')]){_0x1db646['service']=_0x33d1b7[_0xbb10('0x105')][_0xbb10('0x106')];}else{_0x1db646['host']=_0x33d1b7['Smtp'][_0xbb10('0x107')];_0x1db646[_0xbb10('0x108')]=_0x33d1b7[_0xbb10('0x105')][_0xbb10('0x108')];_0x1db646[_0xbb10('0x109')]=_0x33d1b7[_0xbb10('0x105')][_0xbb10('0x109')];}if(_0x33d1b7[_0xbb10('0x105')][_0xbb10('0x10a')]){_0x1db646['auth']={'user':_0x33d1b7['Smtp']['user'],'pass':_0x33d1b7['Smtp']['pass']};}return respondWithRpcPromise('SendMail',_0xbb10('0x10b'),{'account':_0x1db646,'message':{'from':util[_0xbb10('0xf8')](_0xbb10('0x10c'),_0x33d1b7[_0xbb10('0x38')],_0x33d1b7['email']||_0x33d1b7[_0xbb10('0x105')][_0xbb10('0xa5')]),'to':_0xb9bc5a[_0xbb10('0x3a')][_0xbb10('0xf4')],'subject':'Mail\x20Transcript','text':util['format'](_0xbb10('0x10d'),_0xb9bc5a[_0xbb10('0x3a')]['mailTranscript']),'attachments':[{'path':_0x57933f}]}})['then'](function(){return _0x425505;})[_0xbb10('0xc4')](function(_0xf1371a){console[_0xbb10('0x28')](_0xf1371a);});}else{return _0x425505;}})[_0xbb10('0x22')](respondWithStatusCode(_0x42276f,0xc8))[_0xbb10('0xc4')](handleError(_0x42276f,null));};exports['addMessage']=function(_0x4744f4,_0x5382e9,_0x4c97b9){return db[_0xbb10('0xdc')][_0xbb10('0x7b')]({'where':{'id':_0x4744f4[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x5382e9,null))[_0xbb10('0x22')](function(_0x21c0fd){if(_0x21c0fd){return _0x21c0fd['addMessage'](_0x4744f4[_0xbb10('0x3a')][_0xbb10('0x10e')],_[_0xbb10('0x10f')](_0x4744f4[_0xbb10('0x3a')],[_0xbb10('0x10e'),'id'])||{});}})[_0xbb10('0x22')](respondWithResult(_0x5382e9,null))[_0xbb10('0xc4')](handleError(_0x5382e9,null));};exports[_0xbb10('0x110')]=function(_0x233d5e,_0x16f3ce,_0xbae19c){var _0x26f4b0={'raw':![],'where':{}};var _0x1dbf7b={};var _0x117e95={'count':0x0,'rows':[]};return db[_0xbb10('0x46')][_0xbb10('0xce')]({'where':{'id':_0x233d5e[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x16f3ce,null))[_0xbb10('0x22')](function(_0x43a203){if(_0x43a203){_0x1dbf7b[_0xbb10('0x4b')]=_[_0xbb10('0xc7')](db['ChatMessage'][_0xbb10('0x47')]);_0x1dbf7b['query']=_[_0xbb10('0xc7')](_0x233d5e[_0xbb10('0x4c')]);_0x1dbf7b[_0xbb10('0x4d')]=_[_0xbb10('0x4f')](_0x1dbf7b[_0xbb10('0x4b')],_0x1dbf7b['query']);_0x26f4b0['attributes']=_['intersection'](_0x1dbf7b[_0xbb10('0x4b')],qs[_0xbb10('0x50')](_0x233d5e['query'][_0xbb10('0x50')]));_0x26f4b0[_0xbb10('0x4e')]=_0x26f4b0[_0xbb10('0x4e')]['length']?_0x26f4b0[_0xbb10('0x4e')]:_0x1dbf7b[_0xbb10('0x4b')];if(!_0x233d5e[_0xbb10('0x4c')]['hasOwnProperty'](_0xbb10('0x53'))){_0x26f4b0['limit']=qs[_0xbb10('0x54')](_0x233d5e['query']['limit']);_0x26f4b0['offset']=qs['offset'](_0x233d5e['query']['offset']);}_0x26f4b0[_0xbb10('0x9f')]=qs[_0xbb10('0x55')](_0x233d5e[_0xbb10('0x4c')][_0xbb10('0x55')]);_0x26f4b0['where']=qs[_0xbb10('0x4d')](_[_0xbb10('0x57')](_0x233d5e[_0xbb10('0x4c')],_0x1dbf7b[_0xbb10('0x4d')]));_0x26f4b0[_0xbb10('0x56')][_0xbb10('0xc1')]=_0x43a203['id'];if(_0x233d5e[_0xbb10('0x4c')][_0xbb10('0x94')]){_0x26f4b0[_0xbb10('0x56')]=_[_0xbb10('0xac')](_0x26f4b0['where'],{'$or':_[_0xbb10('0x3f')](_0x26f4b0[_0xbb10('0x4e')],function(_0x288ccc){var _0x5c5ecc={};_0x5c5ecc[_0x288ccc]={'$like':'%'+_0x233d5e[_0xbb10('0x4c')][_0xbb10('0x94')]+'%'};return _0x5c5ecc;})});}if(_0x233d5e[_0xbb10('0x4c')][_0xbb10('0x8b')]){var _0x5b2292=_0x233d5e[_0xbb10('0x4c')][_0xbb10('0x8b')][_0xbb10('0x111')](',');var _0x22ec50={};_0x22ec50[_0x5b2292[0x0]]={'$gte':moment(_0x5b2292[0x1])[_0xbb10('0xf8')](_0xbb10('0x112'))};_0x26f4b0[_0xbb10('0x56')]=_[_0xbb10('0xac')](_0x26f4b0[_0xbb10('0x56')],_0x22ec50);}_0x26f4b0=_[_0xbb10('0xac')]({},_0x26f4b0,_0x233d5e[_0xbb10('0xca')]);return db['ChatMessage'][_0xbb10('0x31')]({'where':_0x26f4b0[_0xbb10('0x56')]})['then'](function(_0x5eb1fb){_0x117e95[_0xbb10('0x31')]=_0x5eb1fb;if(_0x233d5e[_0xbb10('0x4c')]['includeAll']){_0x26f4b0[_0xbb10('0xc9')]=[{'all':!![]}];}return db[_0xbb10('0xdc')]['findAll'](_0x26f4b0);})[_0xbb10('0x22')](function(_0x42441e){_0x117e95[_0xbb10('0xc3')]=_0x42441e;return _0x117e95;});}})[_0xbb10('0x22')](respondWithFilteredResult(_0x16f3ce,_0x26f4b0))[_0xbb10('0xc4')](handleError(_0x16f3ce,null));};exports['getMyMessages']=function(_0x4fc260,_0x5a502c,_0xaeaa51){var _0x4db9ad={'where':{}},_0x43deea={},_0x53e73e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xbb10('0xce')]({'where':{'id':_0x4fc260[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x5a502c,null))[_0xbb10('0x22')](function(_0x2527f4){if(_0x2527f4){_0x43deea[_0xbb10('0x4b')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x43deea[_0xbb10('0x4c')]=_[_0xbb10('0xc7')](_0x4fc260[_0xbb10('0x4c')]);_0x43deea[_0xbb10('0x4d')]=_[_0xbb10('0x4f')](_0x43deea[_0xbb10('0x4b')],_0x43deea[_0xbb10('0x4c')]);_0x4db9ad['attributes']=_[_0xbb10('0x4f')](_0x43deea[_0xbb10('0x4b')],qs[_0xbb10('0x50')](_0x4fc260[_0xbb10('0x4c')]['fields']));_0x4db9ad[_0xbb10('0x4e')]=_0x4db9ad['attributes']['length']?_0x4db9ad[_0xbb10('0x4e')]:_0x43deea[_0xbb10('0x4b')];if(!_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x52')](_0xbb10('0x53'))){_0x4db9ad[_0xbb10('0x54')]=qs['limit'](_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x54')]);_0x4db9ad[_0xbb10('0x2f')]=qs[_0xbb10('0x2f')](_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x2f')]);}_0x4db9ad[_0xbb10('0x9f')]=qs['sort'](_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x55')]);_0x4db9ad[_0xbb10('0x56')]=qs['filters'](_['pick'](_0x4fc260[_0xbb10('0x4c')],_0x43deea[_0xbb10('0x4d')]));_0x4db9ad[_0xbb10('0x56')][_0xbb10('0xc1')]=_0x2527f4['id'];if(_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x94')]){_0x4db9ad[_0xbb10('0x56')]=_['merge'](_0x4db9ad[_0xbb10('0x56')],{'$or':_[_0xbb10('0x3f')](_0x4db9ad[_0xbb10('0x4e')],function(_0x55ba78){var _0x5e195a={};_0x5e195a[_0x55ba78]={'$like':'%'+_0x4fc260['query']['filter']+'%'};return _0x5e195a;})});}_0x4db9ad[_0xbb10('0x56')][_0xbb10('0x101')]=![];if(_0x4fc260[_0xbb10('0x4c')]['id']){_0x4db9ad[_0xbb10('0x56')]['id']={'$gt':_0x4fc260['query']['id']};}_0x4db9ad=_[_0xbb10('0xac')]({},_0x4db9ad,_0x4fc260['options']);return db[_0xbb10('0xdc')][_0xbb10('0x31')]({'where':_0x4db9ad[_0xbb10('0x56')]})[_0xbb10('0x22')](function(_0xa16287){_0x53e73e[_0xbb10('0x31')]=_0xa16287;_0x4db9ad[_0xbb10('0xc9')]=[];if(_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x113')]){_0x4db9ad[_0xbb10('0xc9')][_0xbb10('0x44')]({'model':db[_0xbb10('0x82')],'as':'User','attributes':['id',_0xbb10('0x40'),_0xbb10('0x114')]});}if(_0x4fc260[_0xbb10('0x4c')]['includeAll']){_0x4db9ad[_0xbb10('0xc9')]=[{'all':!![]}];}return db['ChatMessage'][_0xbb10('0x115')](_0x4db9ad);})[_0xbb10('0x22')](function(_0x280119){_0x53e73e[_0xbb10('0xc3')]=_0x280119;return _0x53e73e;});}})[_0xbb10('0x22')](respondWithFilteredResult(_0x5a502c,_0x4db9ad))['catch'](handleError(_0x5a502c,null));};exports['addTags']=function(_0x842d94,_0x4cf5cc,_0x553bb8){return db[_0xbb10('0x46')]['find']({'where':{'id':_0x842d94[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x4cf5cc,null))[_0xbb10('0x22')](function(_0x4469c4){if(_0x4469c4){return _0x4469c4[_0xbb10('0x116')](_0x842d94[_0xbb10('0x3a')][_0xbb10('0x10e')],_[_0xbb10('0x10f')](_0x842d94['body'],[_0xbb10('0x10e'),'id'])||{})['spread'](function(){return db[_0xbb10('0x7f')]['findAll']({'attributes':['id',_0xbb10('0x38'),_0xbb10('0x5a')],'where':{'id':_0x842d94['body'][_0xbb10('0x10e')]}});})[_0xbb10('0x22')](function(_0x1bb072){socket['emit'](_0xbb10('0x117'),{'id':Number(_0x842d94[_0xbb10('0xc6')]['id']),'tags':_0x1bb072||[]});return{'id':Number(_0x842d94[_0xbb10('0xc6')]['id']),'tags':_0x1bb072||[]};});}})['then'](respondWithResult(_0x4cf5cc,null))[_0xbb10('0xc4')](handleError(_0x4cf5cc,null));};exports[_0xbb10('0x118')]=function(_0x46df90,_0x4b781e,_0x3e6756){return db['ChatInteraction'][_0xbb10('0x7b')]({'where':{'id':_0x46df90[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x4b781e,null))[_0xbb10('0x22')](function(_0x583a3e){if(_0x583a3e){return _0x583a3e[_0xbb10('0x118')](_0x46df90[_0xbb10('0x4c')][_0xbb10('0x10e')]);}})[_0xbb10('0x22')](respondWithStatusCode(_0x4b781e,null))[_0xbb10('0xc4')](handleError(_0x4b781e,null));};exports['download']=function(_0x4b10ed,_0x40b5da){var _0x4739a6=moment()[_0xbb10('0x119')]()['toString']();var _0x3d5870=path[_0xbb10('0xef')](config[_0xbb10('0xf5')],_0xbb10('0x11a'),_0xbb10('0x11b'),_0xbb10('0x11c'));var _0x81d970=path[_0xbb10('0xef')](config[_0xbb10('0xf5')],'server',_0xbb10('0x11b'),_0xbb10('0x11d'));var _0x4102af=path[_0xbb10('0xef')](_0x3d5870,_0x4739a6);var _0x4d49a7=util[_0xbb10('0xf8')](_0xbb10('0x11e'),_0x4b10ed[_0xbb10('0xc6')]['id'],_0x4739a6);var _0x59fef2=path['join'](_0x3d5870,_0x4d49a7);var _0x3b45c4=[];_0x3b45c4['push']({'model':db[_0xbb10('0x82')],'as':'User','attributes':['id',_0xbb10('0x40')],'raw':!![]});_0x3b45c4[_0xbb10('0x44')]({'model':db[_0xbb10('0xdf')],'as':_0xbb10('0x11f'),'attributes':['id',_0xbb10('0x120'),_0xbb10('0x121')],'raw':!![]});if(_0x4b10ed[_0xbb10('0x4c')]['attachments']){_0x3b45c4[_0xbb10('0x44')]({'model':db[_0xbb10('0xec')],'as':_0xbb10('0xec'),'raw':!![]});}var _0x2807d2=[{'model':db[_0xbb10('0xdc')],'as':_0xbb10('0xf7'),'attributes':['id','body',_0xbb10('0x89'),_0xbb10('0x100'),_0xbb10('0x101'),_0xbb10('0x90')],'include':_0x3b45c4}];_0x2807d2[_0xbb10('0x44')]({'model':db[_0xbb10('0xcf')],'as':_0xbb10('0x122'),'attributes':['id','name']});_0x2807d2[_0xbb10('0x44')]({'model':db[_0xbb10('0x82')],'as':_0xbb10('0x123'),'attributes':['id','fullname']});return db[_0xbb10('0x46')]['find']({'where':{'id':_0x4b10ed[_0xbb10('0xc6')]['id']},'include':_0x2807d2})[_0xbb10('0x22')](handleEntityNotFound(_0x40b5da,null))[_0xbb10('0x22')](function(_0x58a447){if(_0x58a447){var _0x50fa4e=_0x58a447[_0xbb10('0x124')]({'plain':!![]});fs[_0xbb10('0x125')](_0x4102af);var _0xbb410e={'channel':_0xbb10('0x126'),'account':_0x50fa4e[_0xbb10('0x122')][_0xbb10('0x38')],'agent':_0x50fa4e[_0xbb10('0x123')]?_0x50fa4e[_0xbb10('0x123')][_0xbb10('0x40')]:_0xbb10('0x127'),'createdAt':moment(_0x50fa4e[_0xbb10('0x89')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xbb10('0xaa')](),'closedAt':_0x50fa4e[_0xbb10('0xea')]?moment(_0x50fa4e['closedAt'])['format'](_0xbb10('0x112'))[_0xbb10('0xaa')]():'','disposition':_0x50fa4e[_0xbb10('0x128')],'chatInfo':{'browser':_0x50fa4e['browserName'],'os':_0x50fa4e[_0xbb10('0x129')],'referer':_0x50fa4e[_0xbb10('0x12a')],'customerIp':_0x50fa4e['customerIp'],'customerPort':_0x50fa4e[_0xbb10('0x12b')]?_0x50fa4e[_0xbb10('0x12b')]:'N.A.'},'messages':_(_0x50fa4e['Messages'])[_0xbb10('0x12c')]()[_0xbb10('0x94')]({'secret':![]})[_0xbb10('0x3f')](function(_0x5cab64){if(_0x5cab64['Attachment']){var _0x58ee41=path[_0xbb10('0xef')](_0x81d970,_0x5cab64['Attachment'][_0xbb10('0xf2')]);if(fs[_0xbb10('0x12d')](_0x58ee41)){fs['createReadStream'](_0x58ee41)[_0xbb10('0x12e')](fs[_0xbb10('0x12f')](path[_0xbb10('0xef')](_0x4102af,_0x5cab64[_0xbb10('0xec')]['basename'])));}}return{'date':moment(_0x5cab64[_0xbb10('0x89')])['format'](_0xbb10('0x112'))[_0xbb10('0xaa')](),'sender':_0x5cab64[_0xbb10('0x100')]===_0xbb10('0xdb')?_0x5cab64[_0xbb10('0x82')]?_0x5cab64[_0xbb10('0x82')][_0xbb10('0x40')]:_0xbb10('0xfa'):_0x5cab64['Contact'][_0xbb10('0x120')]+(_0x5cab64[_0xbb10('0x11f')][_0xbb10('0x121')]?'\x20'+_0x5cab64[_0xbb10('0x11f')]['lastName']:''),'body':_0x5cab64['Attachment']?_0x5cab64[_0xbb10('0xec')][_0xbb10('0xf2')]:_0x5cab64[_0xbb10('0x3a')],'direction':_0x5cab64[_0xbb10('0x100')]==='out'?'A':'C','secret':_0x5cab64[_0xbb10('0x101')],'read':_0x5cab64[_0xbb10('0x90')],'attachment':_0x5cab64['Attachment']};})[_0xbb10('0x73')]()};return ejs['renderFile'](path['join'](config[_0xbb10('0xf5')],_0xbb10('0x11a'),_0xbb10('0x130'),_0xbb10('0x131')),{'interaction':_0xbb410e})[_0xbb10('0x22')](function(_0x4aa76a){var _0x38403e=path[_0xbb10('0xef')](_0x4102af,_0xbb10('0x132')+_0x50fa4e['id']+'-'+_0x4739a6+_0xbb10('0x133'));var _0x1b7274={'path':_0x38403e,'channel':_0xbb10('0x126'),'interactionId':_0x50fa4e['id']};return pdf[_0xbb10('0x134')](_0x4aa76a,_0x1b7274);})[_0xbb10('0x22')](function(){return new BPromise(function(_0x34f4d6,_0x254b6e){zipdir(_0x4102af,{'saveTo':_0x59fef2},function(_0x368adb,_0xef4ccf){if(_0x368adb)return _0x254b6e(_0x368adb);return _0x34f4d6(_0xef4ccf);});})[_0xbb10('0x22')](function(){return new BPromise(function(_0x9fcc26,_0x111fd4){rimraf(_0x4102af,function(_0x256ce9){if(_0x256ce9)_0x111fd4(_0x256ce9);return _0x9fcc26();});});})[_0xbb10('0x22')](function(){return _0x40b5da[_0xbb10('0x135')](_0x59fef2,_0x4d49a7,function(_0x27e0c5){if(_0x27e0c5){console[_0xbb10('0x136')](_0xbb10('0x137'),_0x27e0c5);}else{fs[_0xbb10('0x138')](_0x59fef2);}});});});}else{return _0x40b5da[_0xbb10('0x2c')](0xc8);}})[_0xbb10('0xc4')](handleError(_0x40b5da,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index f06e8e4..cd062cf 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 _0x8b6f=['ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','catch','hook','exports','events','ChatInteraction'];(function(_0x2f7ee1,_0x238541){var _0x298295=function(_0x124360){while(--_0x124360){_0x2f7ee1['push'](_0x2f7ee1['shift']());}};_0x298295(++_0x238541);}(_0x8b6f,0xa8));var _0xf8b6=function(_0x119ded,_0x497e72){_0x119ded=_0x119ded-0x0;var _0x22108b=_0x8b6f[_0x119ded];return _0x22108b;};'use strict';var EventEmitter=require(_0xf8b6('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xf8b6('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0xf8b6('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xf8b6('0x3')](0x0);var events={'afterCreate':_0xf8b6('0x4'),'afterUpdate':_0xf8b6('0x5'),'afterDestroy':_0xf8b6('0x6')};function emitEvent(_0x3514a6){return function(_0x5bc9d1,_0x53ab74,_0x3c3589){_0x5bc9d1[_0xf8b6('0x7')]({'attributes':['id'],'raw':!![]})[_0xf8b6('0x8')](function(_0x347c0c){_0x5bc9d1[_0xf8b6('0x9')](_0xf8b6('0xa'),_0x347c0c[_0xf8b6('0xb')](function(_0x401bb0){return{'id':_0x401bb0['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x5bc9d1['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf8b6('0x8')](function(_0x272a5e){_0x5bc9d1[_0xf8b6('0x9')](_0xf8b6('0xc'),_0x272a5e[_0xf8b6('0xd')]);ChatInteractionEvents['emit'](_0x3514a6+':'+_0x5bc9d1['id'],_0x5bc9d1);ChatInteractionEvents['emit'](_0x3514a6,_0x5bc9d1);_0x3c3589(null);})[_0xf8b6('0xe')](_0x3c3589(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xf8b6('0xf')](e,emitEvent(event));}}module[_0xf8b6('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xc474=['remove','getUsers','then','setDataValue','Users','map','length','emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','setMaxListeners','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc474,0xfa));var _0x4c47=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xc474[_0x4a53d];return _0x27410e;};'use strict';var EventEmitter=require(_0x4c47('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x4c47('0x1')];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x4c47('0x2')](0x0);var events={'afterCreate':_0x4c47('0x3'),'afterUpdate':_0x4c47('0x4'),'afterDestroy':_0x4c47('0x5')};function emitEvent(_0x39781a){return function(_0x45e89a,_0x19ef61,_0x547555){_0x45e89a[_0x4c47('0x6')]({'attributes':['id'],'raw':!![]})[_0x4c47('0x7')](function(_0x478301){_0x45e89a[_0x4c47('0x8')](_0x4c47('0x9'),_0x478301[_0x4c47('0xa')](function(_0xf48715){return{'id':_0xf48715['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x45e89a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4c47('0x7')](function(_0x4e9eed){_0x45e89a['setDataValue']('unreadMessages',_0x4e9eed[_0x4c47('0xb')]);ChatInteractionEvents[_0x4c47('0xc')](_0x39781a+':'+_0x45e89a['id'],_0x45e89a);ChatInteractionEvents['emit'](_0x39781a,_0x45e89a);_0x547555(null);})[_0x4c47('0xd')](_0x547555(null));};}for(var e in events){if(events[_0x4c47('0xe')](e)){var event=events[e];ChatInteraction[_0x4c47('0xf')](e,emitEvent(event));}}module[_0x4c47('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 676ba33..926ec2b 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 _0x7232=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','ChatInteraction','chat_interactions','closed','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util'];(function(_0xdf5c3e,_0x32b9ec){var _0x19454f=function(_0x117c12){while(--_0x117c12){_0xdf5c3e['push'](_0xdf5c3e['shift']());}};_0x19454f(++_0x32b9ec);}(_0x7232,0x1b0));var _0x2723=function(_0x1fc508,_0xc233c1){_0x1fc508=_0x1fc508-0x0;var _0x352275=_0x7232[_0x1fc508];return _0x352275;};'use strict';var _=require(_0x2723('0x0'));var util=require(_0x2723('0x1'));var logger=require(_0x2723('0x2'))('api');var moment=require(_0x2723('0x3'));var BPromise=require(_0x2723('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2723('0x5'));var rimraf=require(_0x2723('0x6'));var config=require(_0x2723('0x7'));var attributes=require(_0x2723('0x8'));module['exports']=function(_0x199f00,_0x5395e1){return _0x199f00['define'](_0x2723('0x9'),attributes,{'tableName':_0x2723('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x283374,_0x3d1276,_0x24cd29){if(_0x283374['changed'](_0x2723('0xb'))){_0x283374['closedAt']=moment()['format'](_0x2723('0xc'));}_0x24cd29(null,_0x283374);}},'charset':_0x2723('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xa306=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','../../config/logger','api','moment','bluebird','path','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed'];(function(_0x3454ba,_0x777f81){var _0x42f42c=function(_0x273591){while(--_0x273591){_0x3454ba['push'](_0x3454ba['shift']());}};_0x42f42c(++_0x777f81);}(_0xa306,0xd0));var _0x6a30=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0xa306[_0x31ced5];return _0x10d9e5;};'use strict';var _=require(_0x6a30('0x0'));var util=require('util');var logger=require(_0x6a30('0x1'))(_0x6a30('0x2'));var moment=require(_0x6a30('0x3'));var BPromise=require(_0x6a30('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a30('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6a30('0x6'));module[_0x6a30('0x7')]=function(_0x56fd46,_0x529feb){return _0x56fd46[_0x6a30('0x8')](_0x6a30('0x9'),attributes,{'tableName':_0x6a30('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x52d88e,_0x559dfe,_0x1ebf69){if(_0x52d88e[_0x6a30('0xb')](_0x6a30('0xc'))){_0x52d88e[_0x6a30('0xd')]=moment()[_0x6a30('0xe')](_0x6a30('0xf'));}_0x1ebf69(null,_0x52d88e);}},'charset':_0x6a30('0x10'),'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 4e4af2a..b0258f8 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 _0x31cf=['result','catch','ChatInteraction','update','body','raw','options','where','UpdateChatInteraction','AddTagsToChatInteraction','addTags','ids','omit','AddTags','lodash','util','bluebird','ioredis','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x31cf,0x1d5));var _0xf31c=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x31cf[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0xf31c('0x0'));var util=require(_0xf31c('0x1'));var moment=require('moment');var BPromise=require(_0xf31c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf31c('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf31c('0x4'));var config=require('../../config/environment');var jayson=require(_0xf31c('0x5'));var client=jayson['client'][_0xf31c('0x6')]({'port':0x232a});config[_0xf31c('0x7')]=_['defaults'](config[_0xf31c('0x7')],{'host':_0xf31c('0x8'),'port':0x18eb});var socket=require(_0xf31c('0x9'))(new Redis(config['redis']));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x322a18,_0x2e6bc6,_0x42ca0c){return new BPromise(function(_0x1df152,_0x443591){return client[_0xf31c('0xa')](_0x322a18,_0x42ca0c)[_0xf31c('0xb')](function(_0x71f1ed){logger[_0xf31c('0xc')](_0xf31c('0xd'),_0x2e6bc6,'request\x20sent');logger[_0xf31c('0xe')](_0xf31c('0xf'),_0x2e6bc6,_0xf31c('0x10'),JSON[_0xf31c('0x11')](_0x71f1ed));if(_0x71f1ed[_0xf31c('0x12')]){if(_0x71f1ed['error'][_0xf31c('0x13')]===0x1f4){logger[_0xf31c('0x12')](_0xf31c('0xd'),_0x2e6bc6,_0x71f1ed[_0xf31c('0x12')]['message']);return _0x443591(_0x71f1ed[_0xf31c('0x12')][_0xf31c('0x14')]);}logger[_0xf31c('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x2e6bc6,_0x71f1ed[_0xf31c('0x12')][_0xf31c('0x14')]);return _0x1df152(_0x71f1ed[_0xf31c('0x12')][_0xf31c('0x14')]);}else{logger[_0xf31c('0xc')](_0xf31c('0xd'),_0x2e6bc6,_0xf31c('0x10'));_0x1df152(_0x71f1ed[_0xf31c('0x15')][_0xf31c('0x14')]);}})[_0xf31c('0x16')](function(_0xd6bc6b){logger[_0xf31c('0x12')](_0xf31c('0xd'),_0x2e6bc6,_0xd6bc6b);_0x443591(_0xd6bc6b);});});}exports['UpdateChatInteraction']=function(_0x4430f8){var _0x32c2cd=this;return new Promise(function(_0x3ee2ec,_0x3a11da){return db[_0xf31c('0x17')][_0xf31c('0x18')](_0x4430f8[_0xf31c('0x19')],{'raw':_0x4430f8['options']?_0x4430f8['options'][_0xf31c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4430f8[_0xf31c('0x1b')]?_0x4430f8[_0xf31c('0x1b')][_0xf31c('0x1c')]||null:null,'attributes':_0x4430f8[_0xf31c('0x1b')]?_0x4430f8[_0xf31c('0x1b')]['attributes']||null:null,'limit':_0x4430f8[_0xf31c('0x1b')]?_0x4430f8[_0xf31c('0x1b')]['limit']||null:null})[_0xf31c('0xb')](function(_0x10cca3){logger[_0xf31c('0xc')](_0xf31c('0x1d'),_0x4430f8);logger[_0xf31c('0xe')](_0xf31c('0x1d'),_0x4430f8,JSON[_0xf31c('0x11')](_0x10cca3));_0x3ee2ec(_0x10cca3);})[_0xf31c('0x16')](function(_0x39461a){logger[_0xf31c('0x12')]('UpdateChatInteraction',_0x39461a['message'],_0x4430f8);_0x3a11da(_0x32c2cd[_0xf31c('0x12')](0x1f4,_0x39461a[_0xf31c('0x14')]));});});};exports[_0xf31c('0x1e')]=function(_0x4b13a9){return new Promise(function(_0x471112,_0x5eccbd){return db[_0xf31c('0x17')]['find']({'where':_0x4b13a9[_0xf31c('0x1b')]?_0x4b13a9[_0xf31c('0x1b')][_0xf31c('0x1c')]||null:null})[_0xf31c('0xb')](function(_0x56ad9c){if(_0x56ad9c){return _0x56ad9c[_0xf31c('0x1f')](_0x4b13a9[_0xf31c('0x19')][_0xf31c('0x20')],_[_0xf31c('0x21')](_0x4b13a9[_0xf31c('0x19')],[_0xf31c('0x20'),'id'])||{});}})['spread'](function(_0x364abd){logger[_0xf31c('0xc')](_0xf31c('0x22'),_0x4b13a9);logger[_0xf31c('0xe')](_0xf31c('0x22'),_0x4b13a9,JSON[_0xf31c('0x11')](_0x364abd));_0x471112(_0x364abd);})['catch'](function(_0x147475){logger[_0xf31c('0x12')](_0xf31c('0x22'),_0x147475[_0xf31c('0x14')],_0x4b13a9);_0x5eccbd(_this[_0xf31c('0x12')](0x1f4,_0x147475[_0xf31c('0x14')]));});});};
\ No newline at end of file
+var _0x93c6=['body','options','raw','where','limit','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update'];(function(_0x11da31,_0x5d576f){var _0x6bb4c8=function(_0x1680a3){while(--_0x1680a3){_0x11da31['push'](_0x11da31['shift']());}};_0x6bb4c8(++_0x5d576f);}(_0x93c6,0x88));var _0x693c=function(_0x5d18fc,_0x1de58d){_0x5d18fc=_0x5d18fc-0x0;var _0x2444dd=_0x93c6[_0x5d18fc];return _0x2444dd;};'use strict';var _=require(_0x693c('0x0'));var util=require(_0x693c('0x1'));var moment=require(_0x693c('0x2'));var BPromise=require(_0x693c('0x3'));var rs=require(_0x693c('0x4'));var fs=require('fs');var Redis=require(_0x693c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x693c('0x6'));var logger=require(_0x693c('0x7'))(_0x693c('0x8'));var config=require(_0x693c('0x9'));var jayson=require(_0x693c('0xa'));var client=jayson[_0x693c('0xb')][_0x693c('0xc')]({'port':0x232a});config[_0x693c('0xd')]=_[_0x693c('0xe')](config[_0x693c('0xd')],{'host':_0x693c('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x693c('0xd')]));require(_0x693c('0x10'))[_0x693c('0x11')](socket);function respondWithRpcPromise(_0x577f32,_0x5f26ce,_0x33d2f7){return new BPromise(function(_0x31e357,_0x1c1c69){return client[_0x693c('0x12')](_0x577f32,_0x33d2f7)[_0x693c('0x13')](function(_0x5e94ff){logger[_0x693c('0x14')](_0x693c('0x15'),_0x5f26ce,_0x693c('0x16'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x5f26ce,_0x693c('0x16'),JSON[_0x693c('0x17')](_0x5e94ff));if(_0x5e94ff['error']){if(_0x5e94ff[_0x693c('0x18')][_0x693c('0x19')]===0x1f4){logger[_0x693c('0x18')](_0x693c('0x15'),_0x5f26ce,_0x5e94ff['error'][_0x693c('0x1a')]);return _0x1c1c69(_0x5e94ff[_0x693c('0x18')]['message']);}logger['error'](_0x693c('0x15'),_0x5f26ce,_0x5e94ff[_0x693c('0x18')]['message']);return _0x31e357(_0x5e94ff[_0x693c('0x18')][_0x693c('0x1a')]);}else{logger[_0x693c('0x14')](_0x693c('0x15'),_0x5f26ce,_0x693c('0x16'));_0x31e357(_0x5e94ff[_0x693c('0x1b')]['message']);}})[_0x693c('0x1c')](function(_0x3cf1b0){logger['error'](_0x693c('0x15'),_0x5f26ce,_0x3cf1b0);_0x1c1c69(_0x3cf1b0);});});}exports[_0x693c('0x1d')]=function(_0x21aa18){var _0x2c8a6d=this;return new Promise(function(_0xca7140,_0x2ba1d5){return db[_0x693c('0x1e')][_0x693c('0x1f')](_0x21aa18[_0x693c('0x20')],{'raw':_0x21aa18[_0x693c('0x21')]?_0x21aa18[_0x693c('0x21')][_0x693c('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21aa18[_0x693c('0x21')]?_0x21aa18[_0x693c('0x21')][_0x693c('0x23')]||null:null,'attributes':_0x21aa18[_0x693c('0x21')]?_0x21aa18[_0x693c('0x21')]['attributes']||null:null,'limit':_0x21aa18[_0x693c('0x21')]?_0x21aa18[_0x693c('0x21')][_0x693c('0x24')]||null:null})[_0x693c('0x13')](function(_0x2e2db7){logger[_0x693c('0x14')](_0x693c('0x1d'),_0x21aa18);logger['debug'](_0x693c('0x1d'),_0x21aa18,JSON[_0x693c('0x17')](_0x2e2db7));_0xca7140(_0x2e2db7);})[_0x693c('0x1c')](function(_0x5284fb){logger[_0x693c('0x18')]('UpdateChatInteraction',_0x5284fb['message'],_0x21aa18);_0x2ba1d5(_0x2c8a6d[_0x693c('0x18')](0x1f4,_0x5284fb[_0x693c('0x1a')]));});});};exports['AddTagsToChatInteraction']=function(_0x5d8b2d){return new Promise(function(_0x3090e6,_0x5d6622){return db[_0x693c('0x1e')][_0x693c('0x25')]({'where':_0x5d8b2d[_0x693c('0x21')]?_0x5d8b2d[_0x693c('0x21')][_0x693c('0x23')]||null:null})['then'](function(_0x54fcce){if(_0x54fcce){return _0x54fcce[_0x693c('0x26')](_0x5d8b2d[_0x693c('0x20')][_0x693c('0x27')],_[_0x693c('0x28')](_0x5d8b2d[_0x693c('0x20')],[_0x693c('0x27'),'id'])||{});}})['spread'](function(_0x1245b6){logger[_0x693c('0x14')](_0x693c('0x29'),_0x5d8b2d);logger['debug']('AddTags',_0x5d8b2d,JSON[_0x693c('0x17')](_0x1245b6));_0x3090e6(_0x1245b6);})['catch'](function(_0x12afe1){logger[_0x693c('0x18')]('AddTags',_0x12afe1[_0x693c('0x1a')],_0x5d8b2d);_0x5d6622(_this[_0x693c('0x18')](0x1f4,_0x12afe1[_0x693c('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 17e2f34..713a797 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 _0x550e=['update','removeListener','register','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x550e,0x9d));var _0xe550=function(_0x10e85b,_0x36db62){_0x10e85b=_0x10e85b-0x0;var _0x521052=_0x550e[_0x10e85b];return _0x521052;};'use strict';var ChatInteractionEvents=require(_0xe550('0x0'));var events=[_0xe550('0x1'),_0xe550('0x2'),_0xe550('0x3')];function createListener(_0x5d169c,_0x35ff5e){return function(_0x1b5207){_0x35ff5e['emit'](_0x5d169c,_0x1b5207);};}function removeListener(_0x52273a,_0x31517a){return function(){ChatInteractionEvents[_0xe550('0x4')](_0x52273a,_0x31517a);};}exports[_0xe550('0x5')]=function(_0x2674cb){for(var _0x5f0d53=0x0,_0x48b255=events[_0xe550('0x6')];_0x5f0d53<_0x48b255;_0x5f0d53++){var _0x3f0319=events[_0x5f0d53];var _0x587434=createListener(_0xe550('0x7')+_0x3f0319,_0x2674cb);ChatInteractionEvents['on'](_0x3f0319,_0x587434);}};
\ No newline at end of file
+var _0x5458=['register','length','chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener'];(function(_0x3d84ae,_0x56cf1c){var _0x499806=function(_0x117534){while(--_0x117534){_0x3d84ae['push'](_0x3d84ae['shift']());}};_0x499806(++_0x56cf1c);}(_0x5458,0x1d7));var _0x8545=function(_0x4fd7b2,_0x753108){_0x4fd7b2=_0x4fd7b2-0x0;var _0x3ea112=_0x5458[_0x4fd7b2];return _0x3ea112;};'use strict';var ChatInteractionEvents=require(_0x8545('0x0'));var events=[_0x8545('0x1'),_0x8545('0x2'),_0x8545('0x3')];function createListener(_0x4f3961,_0x4eaacb){return function(_0x5a7ab7){_0x4eaacb[_0x8545('0x4')](_0x4f3961,_0x5a7ab7);};}function removeListener(_0x77a398,_0x3e5b3c){return function(){ChatInteractionEvents[_0x8545('0x5')](_0x77a398,_0x3e5b3c);};}exports[_0x8545('0x6')]=function(_0x2cebbb){for(var _0x3c53d0=0x0,_0x5bb9e=events[_0x8545('0x7')];_0x3c53d0<_0x5bb9e;_0x3c53d0++){var _0x17e822=events[_0x3c53d0];var _0x410082=createListener(_0x8545('0x8')+_0x17e822,_0x2cebbb);ChatInteractionEvents['on'](_0x17e822,_0x410082);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 522bc66..48754aa 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 _0x84a0=['/:id/download','download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','server/files/attachments/','now','originalname','/:id/attachment_upload','single','attachmentUpload','tracked','chat','chatinteraction:addtags','addTags','put','update','customUpdate','abandon','/:id/close','destroy','delete','/:id/tags','removeTags','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages'];(function(_0x2af754,_0x1e90c6){var _0x4e033e=function(_0x1920fa){while(--_0x1920fa){_0x2af754['push'](_0x2af754['shift']());}};_0x4e033e(++_0x1e90c6);}(_0x84a0,0xf1));var _0x084a=function(_0x491903,_0x2e5a65){_0x491903=_0x491903-0x0;var _0x179dd8=_0x84a0[_0x491903];return _0x179dd8;};'use strict';var multer=require(_0x084a('0x0'));var util=require(_0x084a('0x1'));var path=require(_0x084a('0x2'));var timeout=require(_0x084a('0x3'));var express=require(_0x084a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x084a('0x5'));var interaction=require(_0x084a('0x6'));var config=require(_0x084a('0x7'));var controller=require('./chatInteraction.controller');router[_0x084a('0x8')]('/',auth[_0x084a('0x9')](),controller[_0x084a('0xa')]);router[_0x084a('0x8')]('/describe',auth[_0x084a('0x9')](),controller['describe']);router[_0x084a('0x8')](_0x084a('0xb'),auth[_0x084a('0xc')](),controller['show']);router[_0x084a('0x8')]('/:id/attachment_download',auth[_0x084a('0xc')](),controller[_0x084a('0xd')]);router[_0x084a('0x8')](_0x084a('0xe'),auth[_0x084a('0x9')](),controller[_0x084a('0xf')]);router[_0x084a('0x8')](_0x084a('0x10'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0x084a('0x8')](_0x084a('0x11'),auth[_0x084a('0x9')](),controller[_0x084a('0x12')]);router[_0x084a('0x13')]('/',auth[_0x084a('0x9')](),controller['create']);router[_0x084a('0x13')](_0x084a('0x14'),auth[_0x084a('0x9')](),controller[_0x084a('0x15')]);var upload=multer({'storage':multer[_0x084a('0x16')]({'destination':function(_0x4abb31,_0x3b6f5f,_0x476f10){_0x476f10(null,path[_0x084a('0x17')](config['root'],_0x084a('0x18')));},'filename':function(_0x5cc023,_0x4c17ba,_0x59d020){_0x59d020(null,util['format']('%s-%s',Date[_0x084a('0x19')](),_0x4c17ba[_0x084a('0x1a')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x084a('0x13')](_0x084a('0x1b'),upload[_0x084a('0x1c')]('file'),controller[_0x084a('0x1d')]);router[_0x084a('0x13')](_0x084a('0xe'),auth[_0x084a('0xc')](),controller['addMessage']);router[_0x084a('0x13')]('/:id/tags',auth[_0x084a('0x9')](),interaction[_0x084a('0x1e')](_0x084a('0x1f'),_0x084a('0x20')),controller[_0x084a('0x21')]);router[_0x084a('0x22')](_0x084a('0xb'),auth[_0x084a('0x9')](),interaction[_0x084a('0x1e')](_0x084a('0x1f'),'chatinteraction:update'),controller[_0x084a('0x23')]);router[_0x084a('0x22')]('/:id/custom_update',controller[_0x084a('0x24')]);router[_0x084a('0x22')]('/:id/abandon',auth[_0x084a('0xc')](),controller[_0x084a('0x25')]);router[_0x084a('0x22')](_0x084a('0x26'),controller['close']);router['delete'](_0x084a('0xb'),auth[_0x084a('0x9')](),interaction[_0x084a('0x1e')]('chat','chatinteraction:destroy'),controller[_0x084a('0x27')]);router[_0x084a('0x28')](_0x084a('0x29'),auth[_0x084a('0x9')](),controller[_0x084a('0x2a')]);module['exports']=router;
\ No newline at end of file
+var _0x3553=['delete','chatinteraction:destroy','destroy','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','/:id/vidaoo','diskStorage','join','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','customUpdate','/:id/abandon','/:id/close','close'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x3553,0xc7));var _0x3355=function(_0x144051,_0xde7701){_0x144051=_0x144051-0x0;var _0x1c0dc1=_0x3553[_0x144051];return _0x1c0dc1;};'use strict';var multer=require('multer');var util=require(_0x3355('0x0'));var path=require(_0x3355('0x1'));var timeout=require('connect-timeout');var express=require(_0x3355('0x2'));var router=express['Router']();var fs_extra=require(_0x3355('0x3'));var auth=require(_0x3355('0x4'));var interaction=require(_0x3355('0x5'));var config=require('../../config/environment');var controller=require(_0x3355('0x6'));router[_0x3355('0x7')]('/',auth['isAuthenticated'](),controller[_0x3355('0x8')]);router['get'](_0x3355('0x9'),auth[_0x3355('0xa')](),controller[_0x3355('0xb')]);router['get'](_0x3355('0xc'),auth[_0x3355('0xd')](),controller[_0x3355('0xe')]);router['get'](_0x3355('0xf'),auth[_0x3355('0xd')](),controller[_0x3355('0x10')]);router['get'](_0x3355('0x11'),auth['isAuthenticated'](),controller[_0x3355('0x12')]);router[_0x3355('0x7')](_0x3355('0x13'),auth['isChatInteractionAuthorized'](),controller[_0x3355('0x14')]);router[_0x3355('0x7')](_0x3355('0x15'),auth[_0x3355('0xa')](),controller[_0x3355('0x16')]);router[_0x3355('0x17')]('/',auth[_0x3355('0xa')](),controller['create']);router[_0x3355('0x17')](_0x3355('0x18'),auth[_0x3355('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x3355('0x19')]({'destination':function(_0x2ae531,_0x40071a,_0x526f20){_0x526f20(null,path[_0x3355('0x1a')](config['root'],_0x3355('0x1b')));},'filename':function(_0x52efce,_0x218abf,_0x476067){_0x476067(null,util[_0x3355('0x1c')]('%s-%s',Date[_0x3355('0x1d')](),_0x218abf[_0x3355('0x1e')][_0x3355('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3355('0x17')](_0x3355('0x20'),upload['single'](_0x3355('0x21')),controller[_0x3355('0x22')]);router['post']('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x3355('0x23')]);router[_0x3355('0x17')](_0x3355('0x24'),auth['isAuthenticated'](),interaction[_0x3355('0x25')](_0x3355('0x26'),_0x3355('0x27')),controller[_0x3355('0x28')]);router[_0x3355('0x29')](_0x3355('0xc'),auth[_0x3355('0xa')](),interaction['tracked'](_0x3355('0x26'),'chatinteraction:update'),controller['update']);router[_0x3355('0x29')]('/:id/custom_update',controller[_0x3355('0x2a')]);router[_0x3355('0x29')](_0x3355('0x2b'),auth[_0x3355('0xd')](),controller['abandon']);router[_0x3355('0x29')](_0x3355('0x2c'),controller[_0x3355('0x2d')]);router[_0x3355('0x2e')](_0x3355('0xc'),auth[_0x3355('0xa')](),interaction[_0x3355('0x25')](_0x3355('0x26'),_0x3355('0x2f')),controller[_0x3355('0x30')]);router['delete'](_0x3355('0x24'),auth[_0x3355('0xa')](),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 a671cef..87013a7 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 _0xa614=['INTEGER','medium'];(function(_0x48cda9,_0x575113){var _0xe47e76=function(_0x502303){while(--_0x502303){_0x48cda9['push'](_0x48cda9['shift']());}};_0xe47e76(++_0x575113);}(_0xa614,0x1b9));var _0x4a61=function(_0x528575,_0x2e067d){_0x528575=_0x528575-0x0;var _0x3063b7=_0xa614[_0x528575];return _0x3063b7;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0x4a61('0x0')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x4a61('0x1')]}};
\ No newline at end of file
+var _0x0ede=['INTEGER','BOOLEAN'];(function(_0x50c0a0,_0x29e026){var _0x561aa7=function(_0x453ed3){while(--_0x453ed3){_0x50c0a0['push'](_0x50c0a0['shift']());}};_0x561aa7(++_0x29e026);}(_0x0ede,0x119));var _0xe0ed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0ede[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe0ed('0x0')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xe0ed('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 1e28cad..36b6cc0 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 _0x9f1b=['VoiceQueue','VoiceQueues','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','messages','createdAt','FromId','ToId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','../../components/parsers/qs','../../config/environment','../../config/license/util','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','offset','undefined','count','Content-Range','json','reject','save','update','destroy','then','end','error','stack','name','index','ChatInternalMessage','type','key','model','map','keys','query','attributes','intersection','fields','length','nolimit','limit','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','params','describe','get','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','agent','user','fullname','role','internal','online','lastLoginAt','showWebBar','-online'];(function(_0x1f6e85,_0x46ac39){var _0x1c9d9f=function(_0x2ba5dc){while(--_0x2ba5dc){_0x1f6e85['push'](_0x1f6e85['shift']());}};_0x1c9d9f(++_0x46ac39);}(_0x9f1b,0x1a3));var _0xb9f1=function(_0x4f8daa,_0x5bc6fc){_0x4f8daa=_0x4f8daa-0x0;var _0x393ad=_0x9f1b[_0x4f8daa];return _0x393ad;};'use strict';var emlformat=require(_0xb9f1('0x0'));var rimraf=require(_0xb9f1('0x1'));var zipdir=require(_0xb9f1('0x2'));var jsonpatch=require(_0xb9f1('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb9f1('0x4'));var Mustache=require(_0xb9f1('0x5'));var util=require(_0xb9f1('0x6'));var path=require('path');var sox=require(_0xb9f1('0x7'));var csv=require(_0xb9f1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb9f1('0x9'));var _=require(_0xb9f1('0xa'));var squel=require('squel');var crypto=require(_0xb9f1('0xb'));var jsforce=require(_0xb9f1('0xc'));var deskjs=require(_0xb9f1('0xd'));var toCsv=require(_0xb9f1('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb9f1('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xb9f1('0xf'));var licenseUtil=require(_0xb9f1('0x10'));var db=require('../../mysqldb')['db'];config[_0xb9f1('0x11')]=_[_0xb9f1('0x12')](config['redis'],{'host':_0xb9f1('0x13'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb9f1('0x11')]));require(_0xb9f1('0x14'))[_0xb9f1('0x15')](socket);function respondWithStatusCode(_0x3a4ad8,_0x46257e){_0x46257e=_0x46257e||0xcc;return function(_0x5c5e26){if(_0x5c5e26){return _0x3a4ad8[_0xb9f1('0x16')](_0x46257e);}return _0x3a4ad8['status'](_0x46257e)['end']();};}function respondWithResult(_0x2868aa,_0x23dd2b){_0x23dd2b=_0x23dd2b||0xc8;return function(_0x5bb37e){if(_0x5bb37e){return _0x2868aa[_0xb9f1('0x17')](_0x23dd2b)['json'](_0x5bb37e);}};}function respondWithFilteredResult(_0x1c8586,_0xc156fd){return function(_0x5b877e){if(_0x5b877e){var _0x7db9eb=typeof _0xc156fd[_0xb9f1('0x18')]===_0xb9f1('0x19')&&typeof _0xc156fd['limit']===_0xb9f1('0x19');var _0x259c6b=_0x5b877e[_0xb9f1('0x1a')];var _0x5ebeab=_0x7db9eb?0x0:_0xc156fd[_0xb9f1('0x18')];var _0x378d3c=_0x7db9eb?_0x5b877e['count']:_0xc156fd[_0xb9f1('0x18')]+_0xc156fd['limit'];var _0x33436d;if(_0x378d3c>=_0x259c6b){_0x378d3c=_0x259c6b;_0x33436d=0xc8;}else{_0x33436d=0xce;}_0x1c8586[_0xb9f1('0x17')](_0x33436d);return _0x1c8586['set'](_0xb9f1('0x1b'),_0x5ebeab+'-'+_0x378d3c+'/'+_0x259c6b)[_0xb9f1('0x1c')](_0x5b877e);}return null;};}function patchUpdates(_0xa0e544){return function(_0x12e14a){try{jsonpatch['apply'](_0x12e14a,_0xa0e544,!![]);}catch(_0x41937f){return BPromise[_0xb9f1('0x1d')](_0x41937f);}return _0x12e14a[_0xb9f1('0x1e')]();};}function saveUpdates(_0x5aed94,_0xc182e){return function(_0x1ea418){if(_0x1ea418){return _0x1ea418[_0xb9f1('0x1f')](_0x5aed94)['then'](function(_0x5c84cc){return _0x5c84cc;});}return null;};}function removeEntity(_0x591c30,_0xc1631d){return function(_0x2765c7){if(_0x2765c7){return _0x2765c7[_0xb9f1('0x20')]()[_0xb9f1('0x21')](function(){_0x591c30[_0xb9f1('0x17')](0xcc)[_0xb9f1('0x22')]();});}};}function handleEntityNotFound(_0x1bf846,_0x524871){return function(_0xd71d82){if(!_0xd71d82){_0x1bf846[_0xb9f1('0x16')](0x194);}return _0xd71d82;};}function handleError(_0x4432ce,_0x56c0f1){_0x56c0f1=_0x56c0f1||0x1f4;return function(_0x5d3875){logger[_0xb9f1('0x23')](_0x5d3875[_0xb9f1('0x24')]);if(_0x5d3875[_0xb9f1('0x25')]){delete _0x5d3875['name'];}_0x4432ce[_0xb9f1('0x17')](_0x56c0f1)['send'](_0x5d3875);};}exports[_0xb9f1('0x26')]=function(_0x4c4b25,_0x23d2c7){var _0x463dd2={},_0x4984c6={},_0xc82e19={'count':0x0,'rows':[]};var _0x248274=_['map'](db[_0xb9f1('0x27')]['rawAttributes'],function(_0x471fac){return{'name':_0x471fac['fieldName'],'type':_0x471fac[_0xb9f1('0x28')][_0xb9f1('0x29')]};});_0x4984c6[_0xb9f1('0x2a')]=_[_0xb9f1('0x2b')](_0x248274,_0xb9f1('0x25'));_0x4984c6['query']=_[_0xb9f1('0x2c')](_0x4c4b25['query']);_0x4984c6['filters']=_['intersection'](_0x4984c6['model'],_0x4984c6[_0xb9f1('0x2d')]);_0x463dd2[_0xb9f1('0x2e')]=_[_0xb9f1('0x2f')](_0x4984c6[_0xb9f1('0x2a')],qs[_0xb9f1('0x30')](_0x4c4b25[_0xb9f1('0x2d')]['fields']));_0x463dd2[_0xb9f1('0x2e')]=_0x463dd2[_0xb9f1('0x2e')][_0xb9f1('0x31')]?_0x463dd2[_0xb9f1('0x2e')]:_0x4984c6['model'];if(!_0x4c4b25[_0xb9f1('0x2d')]['hasOwnProperty'](_0xb9f1('0x32'))){_0x463dd2[_0xb9f1('0x33')]=qs[_0xb9f1('0x33')](_0x4c4b25[_0xb9f1('0x2d')]['limit']);_0x463dd2[_0xb9f1('0x18')]=qs[_0xb9f1('0x18')](_0x4c4b25[_0xb9f1('0x2d')][_0xb9f1('0x18')]);}_0x463dd2[_0xb9f1('0x34')]=qs[_0xb9f1('0x35')](_0x4c4b25[_0xb9f1('0x2d')]['sort']);_0x463dd2[_0xb9f1('0x36')]=qs['filters'](_[_0xb9f1('0x37')](_0x4c4b25[_0xb9f1('0x2d')],_0x4984c6[_0xb9f1('0x38')]),_0x248274);if(_0x4c4b25[_0xb9f1('0x2d')][_0xb9f1('0x39')]){_0x463dd2['where']=_['merge'](_0x463dd2[_0xb9f1('0x36')],{'$or':_['map'](_0x248274,function(_0x55b26a){if(_0x55b26a[_0xb9f1('0x28')]!==_0xb9f1('0x3a')){var _0x2993c9={};_0x2993c9[_0x55b26a[_0xb9f1('0x25')]]={'$like':'%'+_0x4c4b25[_0xb9f1('0x2d')][_0xb9f1('0x39')]+'%'};return _0x2993c9;}})});}_0x463dd2=_[_0xb9f1('0x3b')]({},_0x463dd2,_0x4c4b25[_0xb9f1('0x3c')]);var _0x57a5b0={'where':_0x463dd2[_0xb9f1('0x36')]};return db[_0xb9f1('0x27')]['count'](_0x57a5b0)[_0xb9f1('0x21')](function(_0x48e9e8){_0xc82e19['count']=_0x48e9e8;if(_0x4c4b25[_0xb9f1('0x2d')][_0xb9f1('0x3d')]){_0x463dd2[_0xb9f1('0x3e')]=[{'all':!![]}];}return db[_0xb9f1('0x27')][_0xb9f1('0x3f')](_0x463dd2);})[_0xb9f1('0x21')](function(_0x20db73){_0xc82e19[_0xb9f1('0x40')]=_0x20db73;return _0xc82e19;})[_0xb9f1('0x21')](respondWithFilteredResult(_0x23d2c7,_0x463dd2))[_0xb9f1('0x41')](handleError(_0x23d2c7,null));};exports['show']=function(_0x466e08,_0x30e442){var _0x4b7ab9={'raw':!![],'where':{'id':_0x466e08['params']['id']}},_0x2cf74c={};_0x2cf74c[_0xb9f1('0x2a')]=_[_0xb9f1('0x2c')](db[_0xb9f1('0x27')][_0xb9f1('0x42')]);_0x2cf74c[_0xb9f1('0x2d')]=_[_0xb9f1('0x2c')](_0x466e08[_0xb9f1('0x2d')]);_0x2cf74c[_0xb9f1('0x38')]=_[_0xb9f1('0x2f')](_0x2cf74c[_0xb9f1('0x2a')],_0x2cf74c[_0xb9f1('0x2d')]);_0x4b7ab9[_0xb9f1('0x2e')]=_[_0xb9f1('0x2f')](_0x2cf74c[_0xb9f1('0x2a')],qs[_0xb9f1('0x30')](_0x466e08[_0xb9f1('0x2d')]['fields']));_0x4b7ab9[_0xb9f1('0x2e')]=_0x4b7ab9[_0xb9f1('0x2e')]['length']?_0x4b7ab9[_0xb9f1('0x2e')]:_0x2cf74c[_0xb9f1('0x2a')];if(_0x466e08['query'][_0xb9f1('0x3d')]){_0x4b7ab9[_0xb9f1('0x3e')]=[{'all':!![]}];}_0x4b7ab9=_[_0xb9f1('0x3b')]({},_0x4b7ab9,_0x466e08[_0xb9f1('0x3c')]);return db[_0xb9f1('0x27')][_0xb9f1('0x43')](_0x4b7ab9)[_0xb9f1('0x21')](handleEntityNotFound(_0x30e442,null))[_0xb9f1('0x21')](respondWithResult(_0x30e442,null))[_0xb9f1('0x41')](handleError(_0x30e442,null));};exports[_0xb9f1('0x44')]=function(_0x13fd73,_0x316a75){return db[_0xb9f1('0x27')][_0xb9f1('0x44')](_0x13fd73[_0xb9f1('0x45')],{})[_0xb9f1('0x21')](respondWithResult(_0x316a75,0xc9))[_0xb9f1('0x41')](handleError(_0x316a75,null));};exports[_0xb9f1('0x1f')]=function(_0x272e8b,_0xbf21e2){if(_0x272e8b[_0xb9f1('0x45')]['id']){delete _0x272e8b[_0xb9f1('0x45')]['id'];}return db['ChatInternalMessage'][_0xb9f1('0x43')]({'where':{'id':_0x272e8b[_0xb9f1('0x46')]['id']}})['then'](handleEntityNotFound(_0xbf21e2,null))[_0xb9f1('0x21')](saveUpdates(_0x272e8b[_0xb9f1('0x45')],null))['then'](respondWithResult(_0xbf21e2,null))[_0xb9f1('0x41')](handleError(_0xbf21e2,null));};exports[_0xb9f1('0x20')]=function(_0x2de198,_0x15c639){return db['ChatInternalMessage'][_0xb9f1('0x43')]({'where':{'id':_0x2de198[_0xb9f1('0x46')]['id']}})['then'](handleEntityNotFound(_0x15c639,null))[_0xb9f1('0x21')](removeEntity(_0x15c639,null))[_0xb9f1('0x41')](handleError(_0x15c639,null));};exports[_0xb9f1('0x47')]=function(_0x2100fd,_0x426ab3){return db[_0xb9f1('0x27')][_0xb9f1('0x47')]()[_0xb9f1('0x21')](respondWithResult(_0x426ab3,null))['catch'](handleError(_0x426ab3,null));};function wrapUser(_0x551b9a){return function(_0x3e92e4){var _0x22255b=_0x551b9a[_0xb9f1('0x48')]({'plain':!![]});_0x22255b['messages']=[];if(_0x3e92e4){_0x22255b['lastMessageAt']=_0x3e92e4['createdAt'];_0x22255b['lastMessage']=_0x3e92e4;}else{_0x22255b[_0xb9f1('0x49')]=moment(0x0)['format'](_0xb9f1('0x4a'));_0x22255b[_0xb9f1('0x4b')]={};}return _0x22255b;};}exports[_0xb9f1('0x4c')]=function(_0x9ce191,_0x55d20d,_0x4fb317){var _0x3f4eb7=[];return db['User'][_0xb9f1('0x3f')]({'where':{'role':[_0xb9f1('0x4d'),'admin',_0xb9f1('0x4e')]},'attributes':['id',_0xb9f1('0x4f'),'name',_0xb9f1('0x50'),'userpic',_0xb9f1('0x51'),_0xb9f1('0x52'),_0xb9f1('0x53'),'allowmessenger',_0xb9f1('0x54')],'order':qs[_0xb9f1('0x35')](_0xb9f1('0x55')),'include':[{'model':db[_0xb9f1('0x56')],'as':_0xb9f1('0x57'),'attributes':['id',_0xb9f1('0x25'),'type'],'through':{'attributes':[]}}]})[_0xb9f1('0x21')](function(_0x44dbdb){if(_0x44dbdb){var _0x533309=_0x9ce191[_0xb9f1('0x4e')][_0xb9f1('0x48')]({'plain':!![]});if(!_0x533309)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x533309[_0xb9f1('0x50')]===_0xb9f1('0x4e')){return db[_0xb9f1('0x58')][_0xb9f1('0x43')]({'where':{'name':_0xb9f1('0x59'),'userProfileId':_0x533309[_0xb9f1('0x5a')]},'raw':!![]})[_0xb9f1('0x21')](function(_0x10f9c7){if(_0x10f9c7){if(_0x10f9c7[_0xb9f1('0x5b')]===0x0){return db[_0xb9f1('0x5c')][_0xb9f1('0x3f')]({'where':{'sectionId':_0x10f9c7['id']},'raw':!![]})[_0xb9f1('0x21')](function(_0x54f33b){var _0x3afbf6=[];if(_[_0xb9f1('0x5d')](_0x54f33b)){_0x3afbf6=_[_0xb9f1('0x39')](_0x44dbdb,function(_0x491388){if(_0x491388[_0xb9f1('0x50')]!==_0xb9f1('0x4d')){return _0x491388;}});return _0x3afbf6;}else{for(var _0x883b1c=0x0;_0x883b1c<_0x44dbdb[_0xb9f1('0x31')];_0x883b1c++){var _0x12212f=_0x44dbdb[_0x883b1c];if(_0x12212f[_0xb9f1('0x50')]===_0xb9f1('0x4d')){var _0x37ba19=_[_0xb9f1('0x43')](_0x54f33b,function(_0x5e1bd4){return _0x5e1bd4[_0xb9f1('0x5e')]===_0x12212f['id'];});if(_0x37ba19)_0x3afbf6['push'](_0x12212f);}else{_0x3afbf6['push'](_0x12212f);}}return _0x3afbf6;}});}else{return _0x44dbdb;}}else{var _0x489334=_[_0xb9f1('0x39')](_0x44dbdb,function(_0x14335b){if(_0x14335b[_0xb9f1('0x50')]!==_0xb9f1('0x4d')){return _0x14335b;}});return _0x489334;}});}else{return _0x44dbdb;}}})['then'](function(_0x1089f5){var _0x35771e=[];if(_0x1089f5){_0x3f4eb7=_0x1089f5;for(var _0x25d057=0x0;_0x25d057<_0x1089f5['length'];_0x25d057+=0x1){_0x3f4eb7[_0x25d057][_0xb9f1('0x5f')]=[];_0x35771e['push'](db['ChatInternalMessage'][_0xb9f1('0x43')]({'where':{'FromId':[_0x9ce191[_0xb9f1('0x4e')]['id'],_0x1089f5[_0x25d057]['id']],'ToId':[_0x9ce191[_0xb9f1('0x4e')]['id'],_0x1089f5[_0x25d057]['id']],'ChatGroupId':null},'attributes':['id',_0xb9f1('0x60'),_0xb9f1('0x61'),_0xb9f1('0x62'),_0xb9f1('0x63'),_0xb9f1('0x45')],'order':qs[_0xb9f1('0x35')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xb9f1('0x21')](wrapUser(_0x1089f5[_0x25d057])));}return BPromise[_0xb9f1('0x64')](_0x35771e);}return[];})[_0xb9f1('0x21')](function(_0x3eb4dc){return{'rows':_0x3eb4dc,'count':_0x3eb4dc[_0xb9f1('0x31')]};})[_0xb9f1('0x21')](respondWithResult(_0x55d20d,null))['catch'](handleError(_0x55d20d,null));};
\ No newline at end of file
+var _0x6fbf=['save','update','then','destroy','end','error','name','send','map','ChatInternalMessage','rawAttributes','fieldName','key','model','query','filters','attributes','fields','length','limit','order','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','params','keys','intersection','includeAll','find','create','body','describe','get','lastMessageAt','createdAt','lastMessage','getUsers','agent','admin','user','fullname','userpic','internal','lastLoginAt','showWebBar','-online','VoiceQueues','role','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','ToId','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject'];(function(_0x1f1876,_0x53c2f8){var _0xf5ba8c=function(_0x3748e5){while(--_0x3748e5){_0x1f1876['push'](_0x1f1876['shift']());}};_0xf5ba8c(++_0x53c2f8);}(_0x6fbf,0x11d));var _0xf6fb=function(_0x137d1d,_0x35c663){_0x137d1d=_0x137d1d-0x0;var _0x485108=_0x6fbf[_0x137d1d];return _0x485108;};'use strict';var emlformat=require(_0xf6fb('0x0'));var rimraf=require(_0xf6fb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf6fb('0x2'));var rp=require(_0xf6fb('0x3'));var moment=require(_0xf6fb('0x4'));var BPromise=require(_0xf6fb('0x5'));var Mustache=require('mustache');var util=require(_0xf6fb('0x6'));var path=require(_0xf6fb('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf6fb('0x8'));var fs=require('fs');var fs_extra=require(_0xf6fb('0x9'));var _=require(_0xf6fb('0xa'));var squel=require(_0xf6fb('0xb'));var crypto=require(_0xf6fb('0xc'));var jsforce=require(_0xf6fb('0xd'));var deskjs=require(_0xf6fb('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf6fb('0xf'));var Papa=require(_0xf6fb('0x10'));var Redis=require(_0xf6fb('0x11'));var authService=require(_0xf6fb('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf6fb('0x13'));var hardwareService=require(_0xf6fb('0x14'));var logger=require(_0xf6fb('0x15'))(_0xf6fb('0x16'));var utils=require(_0xf6fb('0x17'));var config=require(_0xf6fb('0x18'));var licenseUtil=require(_0xf6fb('0x19'));var db=require(_0xf6fb('0x1a'))['db'];config[_0xf6fb('0x1b')]=_[_0xf6fb('0x1c')](config['redis'],{'host':_0xf6fb('0x1d'),'port':0x18eb});var socket=require(_0xf6fb('0x1e'))(new Redis(config[_0xf6fb('0x1b')]));require(_0xf6fb('0x1f'))['register'](socket);function respondWithStatusCode(_0x10e883,_0x18ccd5){_0x18ccd5=_0x18ccd5||0xcc;return function(_0x2f6892){if(_0x2f6892){return _0x10e883[_0xf6fb('0x20')](_0x18ccd5);}return _0x10e883[_0xf6fb('0x21')](_0x18ccd5)['end']();};}function respondWithResult(_0x3cf911,_0x179b55){_0x179b55=_0x179b55||0xc8;return function(_0x51f586){if(_0x51f586){return _0x3cf911[_0xf6fb('0x21')](_0x179b55)[_0xf6fb('0x22')](_0x51f586);}};}function respondWithFilteredResult(_0x51549c,_0x3d5a35){return function(_0x3f6a1f){if(_0x3f6a1f){var _0x5e4eb5=typeof _0x3d5a35[_0xf6fb('0x23')]===_0xf6fb('0x24')&&typeof _0x3d5a35['limit']===_0xf6fb('0x24');var _0x4f30b6=_0x3f6a1f[_0xf6fb('0x25')];var _0x313919=_0x5e4eb5?0x0:_0x3d5a35['offset'];var _0x4a00bf=_0x5e4eb5?_0x3f6a1f[_0xf6fb('0x25')]:_0x3d5a35[_0xf6fb('0x23')]+_0x3d5a35['limit'];var _0x192fb8;if(_0x4a00bf>=_0x4f30b6){_0x4a00bf=_0x4f30b6;_0x192fb8=0xc8;}else{_0x192fb8=0xce;}_0x51549c[_0xf6fb('0x21')](_0x192fb8);return _0x51549c[_0xf6fb('0x26')](_0xf6fb('0x27'),_0x313919+'-'+_0x4a00bf+'/'+_0x4f30b6)[_0xf6fb('0x22')](_0x3f6a1f);}return null;};}function patchUpdates(_0x46132d){return function(_0x5294a6){try{jsonpatch[_0xf6fb('0x28')](_0x5294a6,_0x46132d,!![]);}catch(_0x3462b9){return BPromise[_0xf6fb('0x29')](_0x3462b9);}return _0x5294a6[_0xf6fb('0x2a')]();};}function saveUpdates(_0x945a23,_0xcf6d49){return function(_0x34c5b5){if(_0x34c5b5){return _0x34c5b5[_0xf6fb('0x2b')](_0x945a23)[_0xf6fb('0x2c')](function(_0x1bb41e){return _0x1bb41e;});}return null;};}function removeEntity(_0x21cb5b,_0x1d1f39){return function(_0x40d98e){if(_0x40d98e){return _0x40d98e[_0xf6fb('0x2d')]()[_0xf6fb('0x2c')](function(){_0x21cb5b[_0xf6fb('0x21')](0xcc)[_0xf6fb('0x2e')]();});}};}function handleEntityNotFound(_0x4c6a34,_0x51a9a7){return function(_0x5c478b){if(!_0x5c478b){_0x4c6a34['sendStatus'](0x194);}return _0x5c478b;};}function handleError(_0x353371,_0x2d8eb2){_0x2d8eb2=_0x2d8eb2||0x1f4;return function(_0x3854c9){logger[_0xf6fb('0x2f')](_0x3854c9['stack']);if(_0x3854c9[_0xf6fb('0x30')]){delete _0x3854c9[_0xf6fb('0x30')];}_0x353371[_0xf6fb('0x21')](_0x2d8eb2)[_0xf6fb('0x31')](_0x3854c9);};}exports['index']=function(_0x2f3321,_0x36e848){var _0x4b54e0={},_0x12d944={},_0x470793={'count':0x0,'rows':[]};var _0x5e48ed=_[_0xf6fb('0x32')](db[_0xf6fb('0x33')][_0xf6fb('0x34')],function(_0x4a613d){return{'name':_0x4a613d[_0xf6fb('0x35')],'type':_0x4a613d['type'][_0xf6fb('0x36')]};});_0x12d944[_0xf6fb('0x37')]=_[_0xf6fb('0x32')](_0x5e48ed,_0xf6fb('0x30'));_0x12d944[_0xf6fb('0x38')]=_['keys'](_0x2f3321[_0xf6fb('0x38')]);_0x12d944[_0xf6fb('0x39')]=_['intersection'](_0x12d944[_0xf6fb('0x37')],_0x12d944['query']);_0x4b54e0[_0xf6fb('0x3a')]=_['intersection'](_0x12d944[_0xf6fb('0x37')],qs[_0xf6fb('0x3b')](_0x2f3321[_0xf6fb('0x38')][_0xf6fb('0x3b')]));_0x4b54e0[_0xf6fb('0x3a')]=_0x4b54e0[_0xf6fb('0x3a')][_0xf6fb('0x3c')]?_0x4b54e0[_0xf6fb('0x3a')]:_0x12d944[_0xf6fb('0x37')];if(!_0x2f3321[_0xf6fb('0x38')]['hasOwnProperty']('nolimit')){_0x4b54e0[_0xf6fb('0x3d')]=qs[_0xf6fb('0x3d')](_0x2f3321[_0xf6fb('0x38')][_0xf6fb('0x3d')]);_0x4b54e0[_0xf6fb('0x23')]=qs['offset'](_0x2f3321['query'][_0xf6fb('0x23')]);}_0x4b54e0[_0xf6fb('0x3e')]=qs[_0xf6fb('0x3f')](_0x2f3321[_0xf6fb('0x38')][_0xf6fb('0x3f')]);_0x4b54e0[_0xf6fb('0x40')]=qs[_0xf6fb('0x39')](_['pick'](_0x2f3321[_0xf6fb('0x38')],_0x12d944[_0xf6fb('0x39')]),_0x5e48ed);if(_0x2f3321['query'][_0xf6fb('0x41')]){_0x4b54e0[_0xf6fb('0x40')]=_[_0xf6fb('0x42')](_0x4b54e0[_0xf6fb('0x40')],{'$or':_[_0xf6fb('0x32')](_0x5e48ed,function(_0x1cad53){if(_0x1cad53[_0xf6fb('0x43')]!==_0xf6fb('0x44')){var _0x170002={};_0x170002[_0x1cad53[_0xf6fb('0x30')]]={'$like':'%'+_0x2f3321[_0xf6fb('0x38')][_0xf6fb('0x41')]+'%'};return _0x170002;}})});}_0x4b54e0=_[_0xf6fb('0x42')]({},_0x4b54e0,_0x2f3321[_0xf6fb('0x45')]);var _0x238495={'where':_0x4b54e0[_0xf6fb('0x40')]};return db[_0xf6fb('0x33')][_0xf6fb('0x25')](_0x238495)[_0xf6fb('0x2c')](function(_0x17ab5b){_0x470793['count']=_0x17ab5b;if(_0x2f3321['query']['includeAll']){_0x4b54e0[_0xf6fb('0x46')]=[{'all':!![]}];}return db[_0xf6fb('0x33')][_0xf6fb('0x47')](_0x4b54e0);})[_0xf6fb('0x2c')](function(_0x436899){_0x470793[_0xf6fb('0x48')]=_0x436899;return _0x470793;})[_0xf6fb('0x2c')](respondWithFilteredResult(_0x36e848,_0x4b54e0))[_0xf6fb('0x49')](handleError(_0x36e848,null));};exports['show']=function(_0x511127,_0x4e39fd){var _0x25f910={'raw':!![],'where':{'id':_0x511127[_0xf6fb('0x4a')]['id']}},_0x384ba9={};_0x384ba9[_0xf6fb('0x37')]=_[_0xf6fb('0x4b')](db['ChatInternalMessage'][_0xf6fb('0x34')]);_0x384ba9[_0xf6fb('0x38')]=_[_0xf6fb('0x4b')](_0x511127[_0xf6fb('0x38')]);_0x384ba9[_0xf6fb('0x39')]=_[_0xf6fb('0x4c')](_0x384ba9['model'],_0x384ba9[_0xf6fb('0x38')]);_0x25f910[_0xf6fb('0x3a')]=_[_0xf6fb('0x4c')](_0x384ba9['model'],qs[_0xf6fb('0x3b')](_0x511127[_0xf6fb('0x38')][_0xf6fb('0x3b')]));_0x25f910[_0xf6fb('0x3a')]=_0x25f910[_0xf6fb('0x3a')][_0xf6fb('0x3c')]?_0x25f910[_0xf6fb('0x3a')]:_0x384ba9[_0xf6fb('0x37')];if(_0x511127[_0xf6fb('0x38')][_0xf6fb('0x4d')]){_0x25f910[_0xf6fb('0x46')]=[{'all':!![]}];}_0x25f910=_[_0xf6fb('0x42')]({},_0x25f910,_0x511127['options']);return db['ChatInternalMessage'][_0xf6fb('0x4e')](_0x25f910)[_0xf6fb('0x2c')](handleEntityNotFound(_0x4e39fd,null))[_0xf6fb('0x2c')](respondWithResult(_0x4e39fd,null))[_0xf6fb('0x49')](handleError(_0x4e39fd,null));};exports[_0xf6fb('0x4f')]=function(_0x33ea97,_0x8e3fd4){return db[_0xf6fb('0x33')][_0xf6fb('0x4f')](_0x33ea97[_0xf6fb('0x50')],{})[_0xf6fb('0x2c')](respondWithResult(_0x8e3fd4,0xc9))[_0xf6fb('0x49')](handleError(_0x8e3fd4,null));};exports[_0xf6fb('0x2b')]=function(_0x550274,_0x3f1c8b){if(_0x550274[_0xf6fb('0x50')]['id']){delete _0x550274[_0xf6fb('0x50')]['id'];}return db[_0xf6fb('0x33')][_0xf6fb('0x4e')]({'where':{'id':_0x550274[_0xf6fb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3f1c8b,null))[_0xf6fb('0x2c')](saveUpdates(_0x550274[_0xf6fb('0x50')],null))['then'](respondWithResult(_0x3f1c8b,null))[_0xf6fb('0x49')](handleError(_0x3f1c8b,null));};exports[_0xf6fb('0x2d')]=function(_0x252a6a,_0x537a62){return db['ChatInternalMessage'][_0xf6fb('0x4e')]({'where':{'id':_0x252a6a[_0xf6fb('0x4a')]['id']}})[_0xf6fb('0x2c')](handleEntityNotFound(_0x537a62,null))[_0xf6fb('0x2c')](removeEntity(_0x537a62,null))[_0xf6fb('0x49')](handleError(_0x537a62,null));};exports[_0xf6fb('0x51')]=function(_0x3be39f,_0x45f674){return db[_0xf6fb('0x33')][_0xf6fb('0x51')]()[_0xf6fb('0x2c')](respondWithResult(_0x45f674,null))['catch'](handleError(_0x45f674,null));};function wrapUser(_0x53b0a8){return function(_0x34c953){var _0x488e61=_0x53b0a8[_0xf6fb('0x52')]({'plain':!![]});_0x488e61['messages']=[];if(_0x34c953){_0x488e61[_0xf6fb('0x53')]=_0x34c953[_0xf6fb('0x54')];_0x488e61[_0xf6fb('0x55')]=_0x34c953;}else{_0x488e61['lastMessageAt']=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x488e61[_0xf6fb('0x55')]={};}return _0x488e61;};}exports[_0xf6fb('0x56')]=function(_0x157baf,_0x5db440,_0x2bbb66){var _0x1ce3d3=[];return db['User'][_0xf6fb('0x47')]({'where':{'role':[_0xf6fb('0x57'),_0xf6fb('0x58'),_0xf6fb('0x59')]},'attributes':['id',_0xf6fb('0x5a'),_0xf6fb('0x30'),'role',_0xf6fb('0x5b'),_0xf6fb('0x5c'),'online',_0xf6fb('0x5d'),'allowmessenger',_0xf6fb('0x5e')],'order':qs[_0xf6fb('0x3f')](_0xf6fb('0x5f')),'include':[{'model':db['VoiceQueue'],'as':_0xf6fb('0x60'),'attributes':['id',_0xf6fb('0x30'),_0xf6fb('0x43')],'through':{'attributes':[]}}]})[_0xf6fb('0x2c')](function(_0x1be8fb){if(_0x1be8fb){var _0x5ccc5e=_0x157baf[_0xf6fb('0x59')][_0xf6fb('0x52')]({'plain':!![]});if(!_0x5ccc5e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ccc5e[_0xf6fb('0x61')]===_0xf6fb('0x59')){return db[_0xf6fb('0x62')][_0xf6fb('0x4e')]({'where':{'name':_0xf6fb('0x63'),'userProfileId':_0x5ccc5e['userProfileId']},'raw':!![]})[_0xf6fb('0x2c')](function(_0x1dd05a){if(_0x1dd05a){if(_0x1dd05a[_0xf6fb('0x64')]===0x0){return db[_0xf6fb('0x65')][_0xf6fb('0x47')]({'where':{'sectionId':_0x1dd05a['id']},'raw':!![]})['then'](function(_0x2afe00){var _0x13b231=[];if(_[_0xf6fb('0x66')](_0x2afe00)){_0x13b231=_[_0xf6fb('0x41')](_0x1be8fb,function(_0x3fc14b){if(_0x3fc14b[_0xf6fb('0x61')]!=='agent'){return _0x3fc14b;}});return _0x13b231;}else{for(var _0x58e273=0x0;_0x58e273<_0x1be8fb[_0xf6fb('0x3c')];_0x58e273++){var _0x2fa617=_0x1be8fb[_0x58e273];if(_0x2fa617[_0xf6fb('0x61')]===_0xf6fb('0x57')){var _0x145634=_[_0xf6fb('0x4e')](_0x2afe00,function(_0x322829){return _0x322829[_0xf6fb('0x67')]===_0x2fa617['id'];});if(_0x145634)_0x13b231[_0xf6fb('0x68')](_0x2fa617);}else{_0x13b231[_0xf6fb('0x68')](_0x2fa617);}}return _0x13b231;}});}else{return _0x1be8fb;}}else{var _0x1dc214=_['filter'](_0x1be8fb,function(_0x4aa93c){if(_0x4aa93c[_0xf6fb('0x61')]!==_0xf6fb('0x57')){return _0x4aa93c;}});return _0x1dc214;}});}else{return _0x1be8fb;}}})[_0xf6fb('0x2c')](function(_0x576b86){var _0x46dbe6=[];if(_0x576b86){_0x1ce3d3=_0x576b86;for(var _0x1ccce1=0x0;_0x1ccce1<_0x576b86[_0xf6fb('0x3c')];_0x1ccce1+=0x1){_0x1ce3d3[_0x1ccce1][_0xf6fb('0x69')]=[];_0x46dbe6['push'](db[_0xf6fb('0x33')]['find']({'where':{'FromId':[_0x157baf[_0xf6fb('0x59')]['id'],_0x576b86[_0x1ccce1]['id']],'ToId':[_0x157baf[_0xf6fb('0x59')]['id'],_0x576b86[_0x1ccce1]['id']],'ChatGroupId':null},'attributes':['id',_0xf6fb('0x54'),'FromId',_0xf6fb('0x6a'),'read',_0xf6fb('0x50')],'order':qs[_0xf6fb('0x3f')](_0xf6fb('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x576b86[_0x1ccce1])));}return BPromise[_0xf6fb('0x6c')](_0x46dbe6);}return[];})[_0xf6fb('0x2c')](function(_0x38e996){return{'rows':_0x38e996,'count':_0x38e996['length']};})[_0xf6fb('0x2c')](respondWithResult(_0x5db440,null))[_0xf6fb('0x49')](handleError(_0x5db440,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 41ffb50..041bdbf 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 _0xe978=['exports','events','../../mysqldb','ChatInternalMessage','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe978,0x191));var _0x8e97=function(_0x60255,_0x2cc8ad){_0x60255=_0x60255-0x0;var _0x4a31da=_0xe978[_0x60255];return _0x4a31da;};'use strict';var EventEmitter=require(_0x8e97('0x0'));var ChatInternalMessage=require(_0x8e97('0x1'))['db'][_0x8e97('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8e97('0x3'),'afterUpdate':_0x8e97('0x4'),'afterDestroy':_0x8e97('0x5')};function emitEvent(_0x2ff2ff){return function(_0x130627,_0x49efb3,_0x530533){ChatInternalMessageEvents[_0x8e97('0x6')](_0x2ff2ff+':'+_0x130627['id'],_0x130627);ChatInternalMessageEvents[_0x8e97('0x6')](_0x2ff2ff,_0x130627);_0x530533(null);};}for(var e in events){if(events[_0x8e97('0x7')](e)){var event=events[e];ChatInternalMessage[_0x8e97('0x8')](e,emitEvent(event));}}module[_0x8e97('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x3c42=['emit','hook','ChatInternalMessage','save'];(function(_0x4ce4dc,_0x264735){var _0x1c5e8d=function(_0x21feb1){while(--_0x21feb1){_0x4ce4dc['push'](_0x4ce4dc['shift']());}};_0x1c5e8d(++_0x264735);}(_0x3c42,0x1ee));var _0x23c4=function(_0x12adf0,_0x320e4e){_0x12adf0=_0x12adf0-0x0;var _0x46a439=_0x3c42[_0x12adf0];return _0x46a439;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0x23c4('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x23c4('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x320354){return function(_0x295219,_0x4bd5c8,_0x3175e3){ChatInternalMessageEvents[_0x23c4('0x2')](_0x320354+':'+_0x295219['id'],_0x295219);ChatInternalMessageEvents[_0x23c4('0x2')](_0x320354,_0x295219);_0x3175e3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x23c4('0x3')](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 a4c3e70..068eb0f 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 _0xc045=['utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages'];(function(_0x50d471,_0x2d9086){var _0x214900=function(_0x413fa1){while(--_0x413fa1){_0x50d471['push'](_0x50d471['shift']());}};_0x214900(++_0x2d9086);}(_0xc045,0x8d));var _0x5c04=function(_0x384c23,_0x30cd65){_0x384c23=_0x384c23-0x0;var _0x1fdf67=_0xc045[_0x384c23];return _0x1fdf67;};'use strict';var _=require(_0x5c04('0x0'));var util=require(_0x5c04('0x1'));var logger=require(_0x5c04('0x2'))('api');var moment=require(_0x5c04('0x3'));var BPromise=require(_0x5c04('0x4'));var rp=require(_0x5c04('0x5'));var fs=require('fs');var path=require(_0x5c04('0x6'));var rimraf=require(_0x5c04('0x7'));var config=require(_0x5c04('0x8'));var attributes=require('./chatInternalMessage.attributes');module[_0x5c04('0x9')]=function(_0xc2cd88,_0x5ccc69){return _0xc2cd88[_0x5c04('0xa')](_0x5c04('0xb'),attributes,{'tableName':_0x5c04('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5c04('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x0e53=['util','bluebird','path','rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','utf8mb4'];(function(_0x58b5d7,_0x79ca8a){var _0x817269=function(_0x58dd9f){while(--_0x58dd9f){_0x58b5d7['push'](_0x58b5d7['shift']());}};_0x817269(++_0x79ca8a);}(_0x0e53,0x1c0));var _0x30e5=function(_0x4ba7eb,_0x27a677){_0x4ba7eb=_0x4ba7eb-0x0;var _0x7e002b=_0x0e53[_0x4ba7eb];return _0x7e002b;};'use strict';var _=require('lodash');var util=require(_0x30e5('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x30e5('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x30e5('0x2'));var rimraf=require(_0x30e5('0x3'));var config=require(_0x30e5('0x4'));var attributes=require(_0x30e5('0x5'));module['exports']=function(_0xcd1a73,_0x277ad8){return _0xcd1a73['define'](_0x30e5('0x6'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x30e5('0x7'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 05d8b70..864e8a7 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 _0xd8e0=['ChatInternalMessage,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInternalMessage.socket','register','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd8e0,0x111));var _0x0d8e=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xd8e0[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x0d8e('0x0'));var util=require(_0x0d8e('0x1'));var moment=require(_0x0d8e('0x2'));var BPromise=require(_0x0d8e('0x3'));var rs=require(_0x0d8e('0x4'));var fs=require('fs');var Redis=require(_0x0d8e('0x5'));var db=require(_0x0d8e('0x6'))['db'];var utils=require(_0x0d8e('0x7'));var logger=require(_0x0d8e('0x8'))(_0x0d8e('0x9'));var config=require(_0x0d8e('0xa'));var jayson=require(_0x0d8e('0xb'));var client=jayson[_0x0d8e('0xc')][_0x0d8e('0xd')]({'port':0x232a});config[_0x0d8e('0xe')]=_[_0x0d8e('0xf')](config[_0x0d8e('0xe')],{'host':_0x0d8e('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0d8e('0xe')]));require(_0x0d8e('0x11'))[_0x0d8e('0x12')](socket);function respondWithRpcPromise(_0xfa6994,_0x5950ad,_0x1f2f5b){return new BPromise(function(_0x3a252c,_0x26e4c9){return client[_0x0d8e('0x13')](_0xfa6994,_0x1f2f5b)[_0x0d8e('0x14')](function(_0x596df4){logger[_0x0d8e('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x5950ad,_0x0d8e('0x16'));logger[_0x0d8e('0x17')](_0x0d8e('0x18'),_0x5950ad,_0x0d8e('0x16'),JSON[_0x0d8e('0x19')](_0x596df4));if(_0x596df4[_0x0d8e('0x1a')]){if(_0x596df4[_0x0d8e('0x1a')]['code']===0x1f4){logger['error'](_0x0d8e('0x1b'),_0x5950ad,_0x596df4['error'][_0x0d8e('0x1c')]);return _0x26e4c9(_0x596df4[_0x0d8e('0x1a')][_0x0d8e('0x1c')]);}logger[_0x0d8e('0x1a')](_0x0d8e('0x1b'),_0x5950ad,_0x596df4[_0x0d8e('0x1a')]['message']);return _0x3a252c(_0x596df4[_0x0d8e('0x1a')][_0x0d8e('0x1c')]);}else{logger['info'](_0x0d8e('0x1b'),_0x5950ad,'request\x20sent');_0x3a252c(_0x596df4[_0x0d8e('0x1d')][_0x0d8e('0x1c')]);}})['catch'](function(_0x4fc808){logger[_0x0d8e('0x1a')](_0x0d8e('0x1b'),_0x5950ad,_0x4fc808);_0x26e4c9(_0x4fc808);});});}
\ No newline at end of file
+var _0x590b=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x590b,0x1cc));var _0xb590=function(_0x54363d,_0x161cf6){_0x54363d=_0x54363d-0x0;var _0x50edf4=_0x590b[_0x54363d];return _0x50edf4;};'use strict';var _=require(_0xb590('0x0'));var util=require(_0xb590('0x1'));var moment=require(_0xb590('0x2'));var BPromise=require(_0xb590('0x3'));var rs=require(_0xb590('0x4'));var fs=require('fs');var Redis=require(_0xb590('0x5'));var db=require(_0xb590('0x6'))['db'];var utils=require(_0xb590('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xb590('0x8'));var jayson=require(_0xb590('0x9'));var client=jayson[_0xb590('0xa')][_0xb590('0xb')]({'port':0x232a});config[_0xb590('0xc')]=_[_0xb590('0xd')](config[_0xb590('0xc')],{'host':_0xb590('0xe'),'port':0x18eb});var socket=require(_0xb590('0xf'))(new Redis(config['redis']));require(_0xb590('0x10'))['register'](socket);function respondWithRpcPromise(_0x1f965a,_0x2fb4d6,_0x170cff){return new BPromise(function(_0x321b18,_0x337c99){return client['request'](_0x1f965a,_0x170cff)['then'](function(_0x469924){logger[_0xb590('0x11')](_0xb590('0x12'),_0x2fb4d6,_0xb590('0x13'));logger[_0xb590('0x14')](_0xb590('0x15'),_0x2fb4d6,'request\x20sent',JSON[_0xb590('0x16')](_0x469924));if(_0x469924[_0xb590('0x17')]){if(_0x469924['error']['code']===0x1f4){logger['error'](_0xb590('0x12'),_0x2fb4d6,_0x469924[_0xb590('0x17')][_0xb590('0x18')]);return _0x337c99(_0x469924[_0xb590('0x17')][_0xb590('0x18')]);}logger[_0xb590('0x17')](_0xb590('0x12'),_0x2fb4d6,_0x469924[_0xb590('0x17')][_0xb590('0x18')]);return _0x321b18(_0x469924['error']['message']);}else{logger[_0xb590('0x11')](_0xb590('0x12'),_0x2fb4d6,_0xb590('0x13'));_0x321b18(_0x469924[_0xb590('0x19')][_0xb590('0x18')]);}})[_0xb590('0x1a')](function(_0x1fb67b){logger['error'](_0xb590('0x12'),_0x2fb4d6,_0x1fb67b);_0x337c99(_0x1fb67b);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 3f24e84..ce8cf7a 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 _0xbd5d=['chatInternalMessage:','./chatInternalMessage.events','length'];(function(_0x22dbca,_0xbc4079){var _0x191a37=function(_0x1ac360){while(--_0x1ac360){_0x22dbca['push'](_0x22dbca['shift']());}};_0x191a37(++_0xbc4079);}(_0xbd5d,0x88));var _0xdbd5=function(_0x4a34e8,_0x37b3d1){_0x4a34e8=_0x4a34e8-0x0;var _0x13304f=_0xbd5d[_0x4a34e8];return _0x13304f;};'use strict';var ChatInternalMessageEvents=require(_0xdbd5('0x0'));var events=['save','remove','update'];function createListener(_0x411e29,_0x446604){return function(_0x1fcc42){_0x446604['emit'](_0x411e29,_0x1fcc42);};}function removeListener(_0x57e82,_0x4e7bd2){return function(){ChatInternalMessageEvents['removeListener'](_0x57e82,_0x4e7bd2);};}exports['register']=function(_0x476794){for(var _0x4eed8e=0x0,_0x1d563f=events[_0xdbd5('0x1')];_0x4eed8e<_0x1d563f;_0x4eed8e++){var _0x128f4b=events[_0x4eed8e];var _0xabbb4c=createListener(_0xdbd5('0x2')+_0x128f4b,_0x476794);ChatInternalMessageEvents['on'](_0x128f4b,_0xabbb4c);}};
\ No newline at end of file
+var _0xd5cc=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','remove','update'];(function(_0x1ad258,_0x508d58){var _0x2a6b4a=function(_0x3bf0fe){while(--_0x3bf0fe){_0x1ad258['push'](_0x1ad258['shift']());}};_0x2a6b4a(++_0x508d58);}(_0xd5cc,0x17d));var _0xcd5c=function(_0x22ec55,_0x382deb){_0x22ec55=_0x22ec55-0x0;var _0x179c23=_0xd5cc[_0x22ec55];return _0x179c23;};'use strict';var ChatInternalMessageEvents=require(_0xcd5c('0x0'));var events=['save',_0xcd5c('0x1'),_0xcd5c('0x2')];function createListener(_0xc776a3,_0x1a6284){return function(_0x3bd4ba){_0x1a6284[_0xcd5c('0x3')](_0xc776a3,_0x3bd4ba);};}function removeListener(_0x3f6c84,_0x4cc893){return function(){ChatInternalMessageEvents[_0xcd5c('0x4')](_0x3f6c84,_0x4cc893);};}exports[_0xcd5c('0x5')]=function(_0x38d0e0){for(var _0x2b6a76=0x0,_0x3fd452=events[_0xcd5c('0x6')];_0x2b6a76<_0x3fd452;_0x2b6a76++){var _0x3f62e0=events[_0x2b6a76];var _0x391b23=createListener(_0xcd5c('0x7')+_0x3f62e0,_0x38d0e0);ChatInternalMessageEvents['on'](_0x3f62e0,_0x391b23);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index cc3febe..e9f1e26 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 _0x658f=['destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','getUsers','/:id','show','post','create','put','update','delete'];(function(_0x5924d7,_0x2a20a0){var _0xf025a=function(_0x225776){while(--_0x225776){_0x5924d7['push'](_0x5924d7['shift']());}};_0xf025a(++_0x2a20a0);}(_0x658f,0x94));var _0xf658=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x658f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf658('0x0'));var util=require(_0xf658('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf658('0x2'));var router=express[_0xf658('0x3')]();var fs_extra=require(_0xf658('0x4'));var auth=require(_0xf658('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf658('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xf658('0x7')]('/',auth[_0xf658('0x8')](),controller[_0xf658('0x9')]);router[_0xf658('0x7')](_0xf658('0xa'),auth[_0xf658('0x8')](),controller[_0xf658('0xb')]);router[_0xf658('0x7')]('/users',auth[_0xf658('0x8')](),controller[_0xf658('0xc')]);router['get'](_0xf658('0xd'),auth['isAuthenticated'](),controller[_0xf658('0xe')]);router[_0xf658('0xf')]('/',auth[_0xf658('0x8')](),controller[_0xf658('0x10')]);router[_0xf658('0x11')]('/:id',controller[_0xf658('0x12')]);router[_0xf658('0x13')](_0xf658('0xd'),auth[_0xf658('0x8')](),controller[_0xf658('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xd451=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','getUsers','/:id','show','post','create','put','update','destroy','exports','multer','util','path'];(function(_0x42db3e,_0x4e0e33){var _0x1c86e2=function(_0xf701de){while(--_0xf701de){_0x42db3e['push'](_0x42db3e['shift']());}};_0x1c86e2(++_0x4e0e33);}(_0xd451,0x195));var _0x1d45=function(_0x1f783d,_0x33876d){_0x1f783d=_0x1f783d-0x0;var _0xbb8303=_0xd451[_0x1f783d];return _0xbb8303;};'use strict';var multer=require(_0x1d45('0x0'));var util=require(_0x1d45('0x1'));var path=require(_0x1d45('0x2'));var timeout=require(_0x1d45('0x3'));var express=require(_0x1d45('0x4'));var router=express[_0x1d45('0x5')]();var fs_extra=require(_0x1d45('0x6'));var auth=require(_0x1d45('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1d45('0x8'));var controller=require(_0x1d45('0x9'));router[_0x1d45('0xa')]('/',auth[_0x1d45('0xb')](),controller[_0x1d45('0xc')]);router[_0x1d45('0xa')](_0x1d45('0xd'),auth[_0x1d45('0xb')](),controller[_0x1d45('0xe')]);router[_0x1d45('0xa')]('/users',auth[_0x1d45('0xb')](),controller[_0x1d45('0xf')]);router[_0x1d45('0xa')](_0x1d45('0x10'),auth[_0x1d45('0xb')](),controller[_0x1d45('0x11')]);router[_0x1d45('0x12')]('/',auth[_0x1d45('0xb')](),controller[_0x1d45('0x13')]);router[_0x1d45('0x14')](_0x1d45('0x10'),controller[_0x1d45('0x15')]);router['delete'](_0x1d45('0x10'),auth[_0x1d45('0xb')](),controller[_0x1d45('0x16')]);module[_0x1d45('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index e360621..1823c5c 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 _0xfef3=['sequelize','TEXT','BOOLEAN','out','STRING'];(function(_0x2ff739,_0x1c8e0f){var _0x12dc13=function(_0x26fc97){while(--_0x26fc97){_0x2ff739['push'](_0x2ff739['shift']());}};_0x12dc13(++_0x1c8e0f);}(_0xfef3,0x118));var _0x3fef=function(_0x5ea002,_0x31ce12){_0x5ea002=_0x5ea002-0x0;var _0x31e822=_0xfef3[_0x5ea002];return _0x31e822;};'use strict';var Sequelize=require(_0x3fef('0x0'));module['exports']={'body':{'type':Sequelize[_0x3fef('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x3fef('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x3fef('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x3fef('0x3')),'defaultValue':_0x3fef('0x3'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x3fef('0x4')]},'providerResponse':{'type':Sequelize[_0x3fef('0x1')]}};
\ No newline at end of file
+var _0x88c3=['DATE','STRING','sequelize','TEXT','BOOLEAN','out'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x88c3,0x1ee));var _0x388c=function(_0x35d192,_0x3556f6){_0x35d192=_0x35d192-0x0;var _0x1c0638=_0x88c3[_0x35d192];return _0x1c0638;};'use strict';var Sequelize=require(_0x388c('0x0'));module['exports']={'body':{'type':Sequelize[_0x388c('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x388c('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x388c('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x388c('0x4')]},'providerName':{'type':Sequelize[_0x388c('0x5')]},'providerResponse':{'type':Sequelize[_0x388c('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 1e70d7c..083244b 100644
--- a/server/api/chatMessage/chatMessage.controller.js
+++ b/server/api/chatMessage/chatMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x11dcd5,_0x2a2582){var _0x1a8677=function(_0x2c7d30){while(--_0x2c7d30){_0x11dcd5['push'](_0x11dcd5['shift']());}};_0x1a8677(++_0x2a2582);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));};
\ No newline at end of file
+var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x13ad07,_0x29bed6){var _0x3c0ddd=function(_0x5a5500){while(--_0x5a5500){_0x13ad07['push'](_0x13ad07['shift']());}};_0x3c0ddd(++_0x29bed6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index d3bfa4c..137472f 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 _0xbc6e=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4bcc27,_0x21a49d){var _0x4ce671=function(_0x32a180){while(--_0x32a180){_0x4bcc27['push'](_0x4bcc27['shift']());}};_0x4ce671(++_0x21a49d);}(_0xbc6e,0xf2));var _0xebc6=function(_0x51177b,_0x2a085d){_0x51177b=_0x51177b-0x0;var _0x3d16ad=_0xbc6e[_0x51177b];return _0x3d16ad;};'use strict';var EventEmitter=require(_0xebc6('0x0'));var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xebc6('0x1')](0x0);var events={'afterCreate':_0xebc6('0x2'),'afterUpdate':_0xebc6('0x3'),'afterDestroy':_0xebc6('0x4')};function emitEvent(_0x5eafab){return function(_0x3cc9fc,_0x4d6e6c,_0x2f3706){ChatMessageEvents[_0xebc6('0x5')](_0x5eafab+':'+_0x3cc9fc['id'],_0x3cc9fc);ChatMessageEvents[_0xebc6('0x5')](_0x5eafab,_0x3cc9fc);_0x2f3706(null);};}for(var e in events){if(events[_0xebc6('0x6')](e)){var event=events[e];ChatMessage[_0xebc6('0x7')](e,emitEvent(event));}}module[_0xebc6('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0xf7c2=['emit','hook','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x3f87b3,_0x584a90){var _0x6c3822=function(_0x9b0b5c){while(--_0x9b0b5c){_0x3f87b3['push'](_0x3f87b3['shift']());}};_0x6c3822(++_0x584a90);}(_0xf7c2,0x9a));var _0x2f7c=function(_0x22ea66,_0x30123a){_0x22ea66=_0x22ea66-0x0;var _0x529757=_0xf7c2[_0x22ea66];return _0x529757;};'use strict';var EventEmitter=require(_0x2f7c('0x0'));var ChatMessage=require(_0x2f7c('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x2f7c('0x2')](0x0);var events={'afterCreate':_0x2f7c('0x3'),'afterUpdate':_0x2f7c('0x4'),'afterDestroy':_0x2f7c('0x5')};function emitEvent(_0x11cddf){return function(_0x6af83c,_0x39f661,_0x48f739){ChatMessageEvents['emit'](_0x11cddf+':'+_0x6af83c['id'],_0x6af83c);ChatMessageEvents[_0x2f7c('0x6')](_0x11cddf,_0x6af83c);_0x48f739(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x2f7c('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 32b710a..1f48a07 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 _0x3c5d=['moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','out','isNil','UserId','findOne','ChatInteractionId','update','createdAt','toLowerCase','lodash','util','../../config/logger'];(function(_0x44afa4,_0x5be27b){var _0xcad289=function(_0x206272){while(--_0x206272){_0x44afa4['push'](_0x44afa4['shift']());}};_0xcad289(++_0x5be27b);}(_0x3c5d,0x7f));var _0xd3c5=function(_0x527567,_0x2ec732){_0x527567=_0x527567-0x0;var _0x14d154=_0x3c5d[_0x527567];return _0x14d154;};'use strict';var _=require(_0xd3c5('0x0'));var util=require(_0xd3c5('0x1'));var logger=require(_0xd3c5('0x2'))('api');var moment=require(_0xd3c5('0x3'));var BPromise=require(_0xd3c5('0x4'));var rp=require(_0xd3c5('0x5'));var fs=require('fs');var path=require(_0xd3c5('0x6'));var rimraf=require('rimraf');var config=require(_0xd3c5('0x7'));var attributes=require(_0xd3c5('0x8'));module[_0xd3c5('0x9')]=function(_0x1ee332,_0x1569f){return _0x1ee332[_0xd3c5('0xa')](_0xd3c5('0xb'),attributes,{'tableName':_0xd3c5('0xc'),'paranoid':![],'indexes':[{'name':_0xd3c5('0xd'),'fields':[_0xd3c5('0xe')],'type':_0xd3c5('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x25d1bf,_0xf80ea6,_0x2f968e){var _0x1e0db8=_0x1ee332['models'];var _0x414367=_0x25d1bf[_0xd3c5('0x10')]({'plain':!![]});if(_0x414367['direction']['toLowerCase']()==='in'||_0x414367[_0xd3c5('0x11')]['toLowerCase']()===_0xd3c5('0x12')&&!_0x414367['secret']&&!_[_0xd3c5('0x13')](_0x414367[_0xd3c5('0x14')])){_0x1e0db8['ChatInteraction'][_0xd3c5('0x15')]({'where':{'id':_0x414367[_0xd3c5('0x16')]}})['then'](function(_0x31a779){if(_0x31a779){_0x31a779[_0xd3c5('0x17')]({'lastMsgAt':_0x414367[_0xd3c5('0x18')],'lastMsgDirection':_0x414367[_0xd3c5('0x11')][_0xd3c5('0x19')]()});}})['catch'](function(_0x463d78){console['error'](_0x463d78);});}_0x2f968e();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xadae=['exports','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId','then','update','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','../../config/environment'];(function(_0x549853,_0x5c07ec){var _0x549671=function(_0x3f1a3b){while(--_0x3f1a3b){_0x549853['push'](_0x549853['shift']());}};_0x549671(++_0x5c07ec);}(_0xadae,0x134));var _0xeada=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xadae[_0x465028];return _0xb783d4;};'use strict';var _=require(_0xeada('0x0'));var util=require(_0xeada('0x1'));var logger=require(_0xeada('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xeada('0x3'));var attributes=require('./chatMessage.attributes');module[_0xeada('0x4')]=function(_0x5ef766,_0x5967e6){return _0x5ef766['define'](_0xeada('0x5'),attributes,{'tableName':_0xeada('0x6'),'paranoid':![],'indexes':[{'name':_0xeada('0x7'),'fields':[_0xeada('0x8')],'type':_0xeada('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x195f55,_0x389142,_0x6674fd){var _0x137583=_0x5ef766[_0xeada('0xa')];var _0x285f12=_0x195f55[_0xeada('0xb')]({'plain':!![]});if(_0x285f12[_0xeada('0xc')]['toLowerCase']()==='in'||_0x285f12['direction'][_0xeada('0xd')]()===_0xeada('0xe')&&!_0x285f12[_0xeada('0xf')]&&!_[_0xeada('0x10')](_0x285f12[_0xeada('0x11')])){_0x137583['ChatInteraction'][_0xeada('0x12')]({'where':{'id':_0x285f12[_0xeada('0x13')]}})[_0xeada('0x14')](function(_0x476f24){if(_0x476f24){_0x476f24[_0xeada('0x15')]({'lastMsgAt':_0x285f12['createdAt'],'lastMsgDirection':_0x285f12[_0xeada('0xc')]['toLowerCase']()});}})['catch'](function(_0x51f7b6){console['error'](_0x51f7b6);});}_0x6674fd();}},'charset':_0xeada('0x16'),'collate':_0xeada('0x17')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index b401d38..f245a80 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 _0xc2a9=['catch','CreateChatMessage','ChatMessage','body','options','raw','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','register','request','then','request\x20sent','debug','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','result'];(function(_0x328d46,_0x438f65){var _0x5665e6=function(_0x1e8524){while(--_0x1e8524){_0x328d46['push'](_0x328d46['shift']());}};_0x5665e6(++_0x438f65);}(_0xc2a9,0x82));var _0x9c2a=function(_0x548624,_0x28cde1){_0x548624=_0x548624-0x0;var _0x518d2d=_0xc2a9[_0x548624];return _0x518d2d;};'use strict';var _=require(_0x9c2a('0x0'));var util=require(_0x9c2a('0x1'));var moment=require('moment');var BPromise=require(_0x9c2a('0x2'));var rs=require(_0x9c2a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9c2a('0x4'))['db'];var utils=require(_0x9c2a('0x5'));var logger=require(_0x9c2a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9c2a('0x7'));var client=jayson[_0x9c2a('0x8')][_0x9c2a('0x9')]({'port':0x232a});config['redis']=_[_0x9c2a('0xa')](config[_0x9c2a('0xb')],{'host':_0x9c2a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9c2a('0xb')]));require('./chatMessage.socket')[_0x9c2a('0xd')](socket);function respondWithRpcPromise(_0x4b2c10,_0x5e3997,_0x2f20ba){return new BPromise(function(_0x311b23,_0x5eb9ca){return client[_0x9c2a('0xe')](_0x4b2c10,_0x2f20ba)[_0x9c2a('0xf')](function(_0xac9db2){logger['info']('ChatMessage,\x20%s,\x20%s',_0x5e3997,_0x9c2a('0x10'));logger[_0x9c2a('0x11')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5e3997,_0x9c2a('0x10'),JSON[_0x9c2a('0x12')](_0xac9db2));if(_0xac9db2[_0x9c2a('0x13')]){if(_0xac9db2['error'][_0x9c2a('0x14')]===0x1f4){logger['error'](_0x9c2a('0x15'),_0x5e3997,_0xac9db2['error']['message']);return _0x5eb9ca(_0xac9db2['error'][_0x9c2a('0x16')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x5e3997,_0xac9db2[_0x9c2a('0x13')]['message']);return _0x311b23(_0xac9db2[_0x9c2a('0x13')]['message']);}else{logger[_0x9c2a('0x17')](_0x9c2a('0x15'),_0x5e3997,_0x9c2a('0x10'));_0x311b23(_0xac9db2[_0x9c2a('0x18')]['message']);}})[_0x9c2a('0x19')](function(_0x10e202){logger[_0x9c2a('0x13')](_0x9c2a('0x15'),_0x5e3997,_0x10e202);_0x5eb9ca(_0x10e202);});});}exports[_0x9c2a('0x1a')]=function(_0x5a6a88){var _0x5a4725=this;return new Promise(function(_0xc824e4,_0x5e691f){return db[_0x9c2a('0x1b')]['create'](_0x5a6a88[_0x9c2a('0x1c')],{'raw':_0x5a6a88['options']?_0x5a6a88[_0x9c2a('0x1d')][_0x9c2a('0x1e')]===undefined?!![]:![]:!![]})[_0x9c2a('0xf')](function(_0x15ee9c){logger['info'](_0x9c2a('0x1a'),_0x5a6a88);logger[_0x9c2a('0x11')](_0x9c2a('0x1a'),_0x5a6a88,JSON[_0x9c2a('0x12')](_0x15ee9c));_0xc824e4(_0x15ee9c);})[_0x9c2a('0x19')](function(_0x403592){logger['error'](_0x9c2a('0x1a'),_0x403592[_0x9c2a('0x16')],_0x5a6a88);_0x5e691f(_0x5a4725[_0x9c2a('0x13')](0x1f4,_0x403592[_0x9c2a('0x16')]));});});};
\ No newline at end of file
+var _0x936b=['lodash','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','then','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','result','catch','CreateChatMessage','ChatMessage','body','options','raw'];(function(_0x14a585,_0x42fc19){var _0x3b1ebe=function(_0x18f0df){while(--_0x18f0df){_0x14a585['push'](_0x14a585['shift']());}};_0x3b1ebe(++_0x42fc19);}(_0x936b,0x179));var _0xb936=function(_0x576898,_0x119dff){_0x576898=_0x576898-0x0;var _0x425d72=_0x936b[_0x576898];return _0x425d72;};'use strict';var _=require(_0xb936('0x0'));var util=require('util');var moment=require(_0xb936('0x1'));var BPromise=require(_0xb936('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb936('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb936('0x4'));var config=require(_0xb936('0x5'));var jayson=require(_0xb936('0x6'));var client=jayson[_0xb936('0x7')]['http']({'port':0x232a});config[_0xb936('0x8')]=_[_0xb936('0x9')](config[_0xb936('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xb936('0xa'))(new Redis(config[_0xb936('0x8')]));require('./chatMessage.socket')[_0xb936('0xb')](socket);function respondWithRpcPromise(_0x11eb4f,_0x26d22c,_0x23bbde){return new BPromise(function(_0x559d30,_0x3cf58b){return client['request'](_0x11eb4f,_0x23bbde)[_0xb936('0xc')](function(_0x3a0da2){logger['info']('ChatMessage,\x20%s,\x20%s',_0x26d22c,_0xb936('0xd'));logger[_0xb936('0xe')](_0xb936('0xf'),_0x26d22c,_0xb936('0xd'),JSON[_0xb936('0x10')](_0x3a0da2));if(_0x3a0da2[_0xb936('0x11')]){if(_0x3a0da2[_0xb936('0x11')][_0xb936('0x12')]===0x1f4){logger[_0xb936('0x11')](_0xb936('0x13'),_0x26d22c,_0x3a0da2[_0xb936('0x11')][_0xb936('0x14')]);return _0x3cf58b(_0x3a0da2['error'][_0xb936('0x14')]);}logger[_0xb936('0x11')](_0xb936('0x13'),_0x26d22c,_0x3a0da2[_0xb936('0x11')]['message']);return _0x559d30(_0x3a0da2[_0xb936('0x11')][_0xb936('0x14')]);}else{logger[_0xb936('0x15')](_0xb936('0x13'),_0x26d22c,_0xb936('0xd'));_0x559d30(_0x3a0da2[_0xb936('0x16')][_0xb936('0x14')]);}})[_0xb936('0x17')](function(_0x29a8bb){logger[_0xb936('0x11')](_0xb936('0x13'),_0x26d22c,_0x29a8bb);_0x3cf58b(_0x29a8bb);});});}exports[_0xb936('0x18')]=function(_0x1351b3){var _0x5797f8=this;return new Promise(function(_0x16d42e,_0x1d3852){return db[_0xb936('0x19')]['create'](_0x1351b3[_0xb936('0x1a')],{'raw':_0x1351b3['options']?_0x1351b3[_0xb936('0x1b')][_0xb936('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x72ad8b){logger[_0xb936('0x15')]('CreateChatMessage',_0x1351b3);logger['debug']('CreateChatMessage',_0x1351b3,JSON['stringify'](_0x72ad8b));_0x16d42e(_0x72ad8b);})[_0xb936('0x17')](function(_0x51fce8){logger[_0xb936('0x11')](_0xb936('0x18'),_0x51fce8[_0xb936('0x14')],_0x1351b3);_0x1d3852(_0x5797f8['error'](0x1f4,_0x51fce8[_0xb936('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 57a43f1..cee3be2 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 _0x4b19=['remove','update','emit','removeListener','register','chatMessage:','./chatMessage.events'];(function(_0x48ac40,_0x1e3beb){var _0x55df02=function(_0x5e27d6){while(--_0x5e27d6){_0x48ac40['push'](_0x48ac40['shift']());}};_0x55df02(++_0x1e3beb);}(_0x4b19,0x195));var _0x94b1=function(_0x4eed12,_0x1faabc){_0x4eed12=_0x4eed12-0x0;var _0x44d939=_0x4b19[_0x4eed12];return _0x44d939;};'use strict';var ChatMessageEvents=require(_0x94b1('0x0'));var events=['save',_0x94b1('0x1'),_0x94b1('0x2')];function createListener(_0x221ab3,_0x577f52){return function(_0x1ffdb7){_0x577f52[_0x94b1('0x3')](_0x221ab3,_0x1ffdb7);};}function removeListener(_0x2240b9,_0x4f607f){return function(){ChatMessageEvents[_0x94b1('0x4')](_0x2240b9,_0x4f607f);};}exports[_0x94b1('0x5')]=function(_0x52d6c1){for(var _0x24df76=0x0,_0x110a52=events['length'];_0x24df76<_0x110a52;_0x24df76++){var _0x40c69c=events[_0x24df76];var _0x201a02=createListener(_0x94b1('0x6')+_0x40c69c,_0x52d6c1);ChatMessageEvents['on'](_0x40c69c,_0x201a02);}};
\ No newline at end of file
+var _0xf725=['./chatMessage.events','save','remove','update','emit','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf725,0x7e));var _0x5f72=function(_0x4c81e0,_0x2ae328){_0x4c81e0=_0x4c81e0-0x0;var _0x5ace0e=_0xf725[_0x4c81e0];return _0x5ace0e;};'use strict';var ChatMessageEvents=require(_0x5f72('0x0'));var events=[_0x5f72('0x1'),_0x5f72('0x2'),_0x5f72('0x3')];function createListener(_0x1ab380,_0x2fb465){return function(_0x3f7b69){_0x2fb465[_0x5f72('0x4')](_0x1ab380,_0x3f7b69);};}function removeListener(_0x4200ff,_0x17a5bc){return function(){ChatMessageEvents['removeListener'](_0x4200ff,_0x17a5bc);};}exports[_0x5f72('0x5')]=function(_0x14a92d){for(var _0x3f2ca7=0x0,_0x193393=events[_0x5f72('0x6')];_0x3f2ca7<_0x193393;_0x3f2ca7++){var _0x4961d1=events[_0x3f2ca7];var _0x158aa3=createListener('chatMessage:'+_0x4961d1,_0x14a92d);ChatMessageEvents['on'](_0x4961d1,_0x158aa3);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index b0f19c2..21f5855 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 _0x5fd4=['../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service'];(function(_0x52d5da,_0x9d7b25){var _0x34aa1a=function(_0x17ea7d){while(--_0x17ea7d){_0x52d5da['push'](_0x52d5da['shift']());}};_0x34aa1a(++_0x9d7b25);}(_0x5fd4,0x113));var _0x45fd=function(_0x304809,_0x18167b){_0x304809=_0x304809-0x0;var _0x3e2656=_0x5fd4[_0x304809];return _0x3e2656;};'use strict';var multer=require(_0x45fd('0x0'));var util=require('util');var path=require(_0x45fd('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x45fd('0x2')]();var fs_extra=require(_0x45fd('0x3'));var auth=require(_0x45fd('0x4'));var interaction=require(_0x45fd('0x5'));var config=require(_0x45fd('0x6'));var controller=require(_0x45fd('0x7'));router[_0x45fd('0x8')]('/',auth[_0x45fd('0x9')](),controller[_0x45fd('0xa')]);router[_0x45fd('0x8')](_0x45fd('0xb'),auth[_0x45fd('0x9')](),controller[_0x45fd('0xc')]);router[_0x45fd('0x8')](_0x45fd('0xd'),auth['isAuthenticated'](),controller[_0x45fd('0xe')]);router[_0x45fd('0xf')]('/',auth['isAuthenticated'](),interaction[_0x45fd('0x10')]('chat',_0x45fd('0x11')),controller[_0x45fd('0x12')]);router[_0x45fd('0x13')](_0x45fd('0xd'),controller[_0x45fd('0x14')]);router['put'](_0x45fd('0x15'),auth[_0x45fd('0x9')](),controller[_0x45fd('0x16')]);router[_0x45fd('0x13')](_0x45fd('0x17'),auth[_0x45fd('0x9')](),controller[_0x45fd('0x18')]);router[_0x45fd('0x19')]('/:id',auth[_0x45fd('0x9')](),controller[_0x45fd('0x1a')]);module[_0x45fd('0x1b')]=router;
\ No newline at end of file
+var _0x8765=['get','isAuthenticated','describe','/:id','show','post','chat','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller'];(function(_0x595604,_0x2cc998){var _0x1466f3=function(_0x4e1d9b){while(--_0x4e1d9b){_0x595604['push'](_0x595604['shift']());}};_0x1466f3(++_0x2cc998);}(_0x8765,0xc6));var _0x5876=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x8765[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require(_0x5876('0x0'));var util=require(_0x5876('0x1'));var path=require(_0x5876('0x2'));var timeout=require(_0x5876('0x3'));var express=require(_0x5876('0x4'));var router=express[_0x5876('0x5')]();var fs_extra=require(_0x5876('0x6'));var auth=require(_0x5876('0x7'));var interaction=require(_0x5876('0x8'));var config=require('../../config/environment');var controller=require(_0x5876('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5876('0xa')]('/describe',auth[_0x5876('0xb')](),controller[_0x5876('0xc')]);router[_0x5876('0xa')](_0x5876('0xd'),auth[_0x5876('0xb')](),controller[_0x5876('0xe')]);router[_0x5876('0xf')]('/',auth[_0x5876('0xb')](),interaction['tracked'](_0x5876('0x10'),'chatmessage:create'),controller[_0x5876('0x11')]);router[_0x5876('0x12')](_0x5876('0xd'),controller[_0x5876('0x13')]);router['put'](_0x5876('0x14'),auth[_0x5876('0xb')](),controller['accept']);router[_0x5876('0x12')](_0x5876('0x15'),auth[_0x5876('0xb')](),controller[_0x5876('0x16')]);router[_0x5876('0x17')](_0x5876('0xd'),auth[_0x5876('0xb')](),controller[_0x5876('0x18')]);module[_0x5876('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 261f386..87a3d05 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 _0x6290=['TEXT','sequelize'];(function(_0x2d460c,_0x4f08c0){var _0xf6fc4c=function(_0x4fb81c){while(--_0x4fb81c){_0x2d460c['push'](_0x2d460c['shift']());}};_0xf6fc4c(++_0x4f08c0);}(_0x6290,0xf9));var _0x0629=function(_0x3e90cb,_0x505903){_0x3e90cb=_0x3e90cb-0x0;var _0x2c886f=_0x6290[_0x3e90cb];return _0x2c886f;};'use strict';var Sequelize=require(_0x0629('0x0'));module['exports']={'body':{'type':Sequelize[_0x0629('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
+var _0x7533=['medium','TEXT'];(function(_0x56b98e,_0x2225f0){var _0x474f84=function(_0x58f6c7){while(--_0x58f6c7){_0x56b98e['push'](_0x56b98e['shift']());}};_0x474f84(++_0x2225f0);}(_0x7533,0x1b3));var _0x3753=function(_0x1bedfd,_0x3d34c2){_0x1bedfd=_0x1bedfd-0x0;var _0x1716d2=_0x7533[_0x1bedfd];return _0x1716d2;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x3753('0x0')](_0x3753('0x1')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index e924e23..bfc6642 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x579db3,_0x78f868){var _0x562ff0=function(_0x5490c0){while(--_0x5490c0){_0x579db3['push'](_0x579db3['shift']());}};_0x562ff0(++_0x78f868);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x253f38,_0x2d0a33){var _0x5cac53=function(_0x2dbde4){while(--_0x2dbde4){_0x253f38['push'](_0x253f38['shift']());}};_0x5cac53(++_0x2d0a33);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 741dde8..5074bba 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 _0xb0f1=['util','api','moment','bluebird','request-promise','path','rimraf','define','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x1b2489,_0x4f2740){var _0x45104c=function(_0x57e698){while(--_0x57e698){_0x1b2489['push'](_0x1b2489['shift']());}};_0x45104c(++_0x4f2740);}(_0xb0f1,0x134));var _0x1b0f=function(_0x35d4e9,_0x298c61){_0x35d4e9=_0x35d4e9-0x0;var _0x5c2770=_0xb0f1[_0x35d4e9];return _0x5c2770;};'use strict';var _=require('lodash');var util=require(_0x1b0f('0x0'));var logger=require('../../config/logger')(_0x1b0f('0x1'));var moment=require(_0x1b0f('0x2'));var BPromise=require(_0x1b0f('0x3'));var rp=require(_0x1b0f('0x4'));var fs=require('fs');var path=require(_0x1b0f('0x5'));var rimraf=require(_0x1b0f('0x6'));var config=require('../../config/environment');var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x2c9a9f,_0x56c4a6){return _0x2c9a9f[_0x1b0f('0x7')](_0x1b0f('0x8'),attributes,{'tableName':_0x1b0f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1b0f('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x8fff=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x16c763,_0x46a958){var _0x492039=function(_0x4539d5){while(--_0x4539d5){_0x16c763['push'](_0x16c763['shift']());}};_0x492039(++_0x46a958);}(_0x8fff,0x116));var _0xf8ff=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8fff[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf8ff('0x0'));var util=require(_0xf8ff('0x1'));var logger=require('../../config/logger')(_0xf8ff('0x2'));var moment=require(_0xf8ff('0x3'));var BPromise=require(_0xf8ff('0x4'));var rp=require(_0xf8ff('0x5'));var fs=require('fs');var path=require(_0xf8ff('0x6'));var rimraf=require(_0xf8ff('0x7'));var config=require(_0xf8ff('0x8'));var attributes=require(_0xf8ff('0x9'));module[_0xf8ff('0xa')]=function(_0x3496f9,_0x120b9d){return _0x3496f9['define']('ChatOfflineMessage',attributes,{'tableName':_0xf8ff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf8ff('0xc'),'collate':_0xf8ff('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 33a40e5..ad83637 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 _0x1930=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','util','moment','bluebird'];(function(_0x24064c,_0x423efe){var _0x2b95a0=function(_0x36817f){while(--_0x36817f){_0x24064c['push'](_0x24064c['shift']());}};_0x2b95a0(++_0x423efe);}(_0x1930,0xcc));var _0x0193=function(_0x1bf8e8,_0x3a2b43){_0x1bf8e8=_0x1bf8e8-0x0;var _0x5715c0=_0x1930[_0x1bf8e8];return _0x5715c0;};'use strict';var _=require('lodash');var util=require(_0x0193('0x0'));var moment=require(_0x0193('0x1'));var BPromise=require(_0x0193('0x2'));var rs=require(_0x0193('0x3'));var fs=require('fs');var Redis=require(_0x0193('0x4'));var db=require(_0x0193('0x5'))['db'];var utils=require(_0x0193('0x6'));var logger=require(_0x0193('0x7'))(_0x0193('0x8'));var config=require(_0x0193('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0193('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f6ea7,_0x5815ce,_0x2de696){return new BPromise(function(_0x5dcd09,_0xd57d8b){return client[_0x0193('0xb')](_0x2f6ea7,_0x2de696)[_0x0193('0xc')](function(_0x112aec){logger[_0x0193('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5815ce,'request\x20sent');logger['debug'](_0x0193('0xe'),_0x5815ce,_0x0193('0xf'),JSON[_0x0193('0x10')](_0x112aec));if(_0x112aec[_0x0193('0x11')]){if(_0x112aec['error'][_0x0193('0x12')]===0x1f4){logger[_0x0193('0x11')](_0x0193('0x13'),_0x5815ce,_0x112aec[_0x0193('0x11')][_0x0193('0x14')]);return _0xd57d8b(_0x112aec[_0x0193('0x11')][_0x0193('0x14')]);}logger[_0x0193('0x11')](_0x0193('0x13'),_0x5815ce,_0x112aec[_0x0193('0x11')][_0x0193('0x14')]);return _0x5dcd09(_0x112aec[_0x0193('0x11')][_0x0193('0x14')]);}else{logger[_0x0193('0xd')](_0x0193('0x13'),_0x5815ce,'request\x20sent');_0x5dcd09(_0x112aec[_0x0193('0x15')][_0x0193('0x14')]);}})[_0x0193('0x16')](function(_0x27be32){logger[_0x0193('0x11')](_0x0193('0x13'),_0x5815ce,_0x27be32);_0xd57d8b(_0x27be32);});});}
\ No newline at end of file
+var _0xc090=['info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x1b222a,_0x4643d3){var _0x11745a=function(_0x28fa4a){while(--_0x28fa4a){_0x1b222a['push'](_0x1b222a['shift']());}};_0x11745a(++_0x4643d3);}(_0xc090,0x129));var _0x0c09=function(_0xb6316b,_0x2eb4a2){_0xb6316b=_0xb6316b-0x0;var _0x16b932=_0xc090[_0xb6316b];return _0x16b932;};'use strict';var _=require('lodash');var util=require(_0x0c09('0x0'));var moment=require(_0x0c09('0x1'));var BPromise=require(_0x0c09('0x2'));var rs=require(_0x0c09('0x3'));var fs=require('fs');var Redis=require(_0x0c09('0x4'));var db=require(_0x0c09('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c09('0x6'))(_0x0c09('0x7'));var config=require('../../config/environment');var jayson=require(_0x0c09('0x8'));var client=jayson[_0x0c09('0x9')][_0x0c09('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x168f10,_0x5e3dfb,_0x1123a3){return new BPromise(function(_0x2fa89c,_0x150d88){return client['request'](_0x168f10,_0x1123a3)['then'](function(_0x402120){logger[_0x0c09('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5e3dfb,_0x0c09('0xc'));logger[_0x0c09('0xd')](_0x0c09('0xe'),_0x5e3dfb,'request\x20sent',JSON[_0x0c09('0xf')](_0x402120));if(_0x402120['error']){if(_0x402120[_0x0c09('0x10')][_0x0c09('0x11')]===0x1f4){logger[_0x0c09('0x10')](_0x0c09('0x12'),_0x5e3dfb,_0x402120[_0x0c09('0x10')][_0x0c09('0x13')]);return _0x150d88(_0x402120[_0x0c09('0x10')][_0x0c09('0x13')]);}logger[_0x0c09('0x10')](_0x0c09('0x12'),_0x5e3dfb,_0x402120['error'][_0x0c09('0x13')]);return _0x2fa89c(_0x402120[_0x0c09('0x10')][_0x0c09('0x13')]);}else{logger[_0x0c09('0xb')](_0x0c09('0x12'),_0x5e3dfb,_0x0c09('0xc'));_0x2fa89c(_0x402120[_0x0c09('0x14')][_0x0c09('0x13')]);}})[_0x0c09('0x15')](function(_0x1f3b94){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x5e3dfb,_0x1f3b94);_0x150d88(_0x1f3b94);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 0dead8e..c6867a2 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 _0xf971=['put','update','destroy','exports','multer','util','path','connect-timeout','express','../../config/environment','./chatOfflineMessage.controller','/describe','describe','get','/:id','isAuthenticated','post'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xf971,0x1ad));var _0x1f97=function(_0x5bd05f,_0x27641d){_0x5bd05f=_0x5bd05f-0x0;var _0x13c333=_0xf971[_0x5bd05f];return _0x13c333;};'use strict';var multer=require(_0x1f97('0x0'));var util=require(_0x1f97('0x1'));var path=require(_0x1f97('0x2'));var timeout=require(_0x1f97('0x3'));var express=require(_0x1f97('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1f97('0x5'));var controller=require(_0x1f97('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x1f97('0x7'),auth['isAuthenticated'](),controller[_0x1f97('0x8')]);router[_0x1f97('0x9')](_0x1f97('0xa'),auth[_0x1f97('0xb')](),controller['show']);router[_0x1f97('0xc')]('/',auth[_0x1f97('0xb')](),controller['create']);router[_0x1f97('0xd')]('/:id',auth[_0x1f97('0xb')](),controller[_0x1f97('0xe')]);router['delete'](_0x1f97('0xa'),auth[_0x1f97('0xb')](),controller[_0x1f97('0xf')]);module[_0x1f97('0x10')]=router;
\ No newline at end of file
+var _0xac1c=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','show','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x158c7e,_0x2da006){var _0x155379=function(_0x35af46){while(--_0x35af46){_0x158c7e['push'](_0x158c7e['shift']());}};_0x155379(++_0x2da006);}(_0xac1c,0xa0));var _0xcac1=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xac1c[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0xcac1('0x0'));var util=require('util');var path=require(_0xcac1('0x1'));var timeout=require(_0xcac1('0x2'));var express=require(_0xcac1('0x3'));var router=express[_0xcac1('0x4')]();var fs_extra=require(_0xcac1('0x5'));var auth=require(_0xcac1('0x6'));var interaction=require(_0xcac1('0x7'));var config=require(_0xcac1('0x8'));var controller=require(_0xcac1('0x9'));router[_0xcac1('0xa')]('/',auth[_0xcac1('0xb')](),controller[_0xcac1('0xc')]);router[_0xcac1('0xa')](_0xcac1('0xd'),auth['isAuthenticated'](),controller[_0xcac1('0xe')]);router[_0xcac1('0xa')]('/:id',auth[_0xcac1('0xb')](),controller[_0xcac1('0xf')]);router['post']('/',auth[_0xcac1('0xb')](),controller[_0xcac1('0x10')]);router[_0xcac1('0x11')](_0xcac1('0x12'),auth[_0xcac1('0xb')](),controller[_0xcac1('0x13')]);router[_0xcac1('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xcac1('0x15')]);module[_0xcac1('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index d3c66c7..305a8b3 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 _0x96e0=['INTEGER','sequelize','exports','mouseOver','timeout','STRING'];(function(_0x15cdcb,_0x4340e9){var _0x37b069=function(_0x304cfb){while(--_0x304cfb){_0x15cdcb['push'](_0x15cdcb['shift']());}};_0x37b069(++_0x4340e9);}(_0x96e0,0x145));var _0x096e=function(_0x3c4742,_0x531db9){_0x3c4742=_0x3c4742-0x0;var _0x25a043=_0x96e0[_0x3c4742];return _0x25a043;};'use strict';var Sequelize=require(_0x096e('0x0'));module[_0x096e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x096e('0x2'),_0x096e('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x096e('0x4')]},'timeout':{'type':Sequelize[_0x096e('0x5')]}};
\ No newline at end of file
+var _0x8e7c=['sequelize','ENUM','mouseOver','timeout','STRING','INTEGER'];(function(_0x4fc4fb,_0x2c3677){var _0x237d21=function(_0x5c1aeb){while(--_0x5c1aeb){_0x4fc4fb['push'](_0x4fc4fb['shift']());}};_0x237d21(++_0x2c3677);}(_0x8e7c,0xa8));var _0xc8e7=function(_0x2626a3,_0x3c0a9f){_0x2626a3=_0x2626a3-0x0;var _0x1a0d17=_0x8e7c[_0x2626a3];return _0x1a0d17;};'use strict';var Sequelize=require(_0xc8e7('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xc8e7('0x1')](_0xc8e7('0x2'),_0xc8e7('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xc8e7('0x4')]},'timeout':{'type':Sequelize[_0xc8e7('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 04f0cb4..3b4c735 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 _0xb4c7=['jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','attributes','intersection','fields','include','merge','find','create','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto'];(function(_0x42e781,_0xcbb802){var _0x465a2b=function(_0x3f5936){while(--_0x3f5936){_0x42e781['push'](_0x42e781['shift']());}};_0x465a2b(++_0xcbb802);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x35007a,_0x3e14e8){_0x35007a=_0x35007a-0x0;var _0x267842=_0xb4c7[_0x35007a];return _0x267842;};'use strict';var emlformat=require(_0x7b4c('0x0'));var rimraf=require(_0x7b4c('0x1'));var zipdir=require(_0x7b4c('0x2'));var jsonpatch=require(_0x7b4c('0x3'));var rp=require(_0x7b4c('0x4'));var moment=require('moment');var BPromise=require(_0x7b4c('0x5'));var Mustache=require(_0x7b4c('0x6'));var util=require(_0x7b4c('0x7'));var path=require(_0x7b4c('0x8'));var sox=require(_0x7b4c('0x9'));var csv=require('to-csv');var ejs=require(_0x7b4c('0xa'));var fs=require('fs');var fs_extra=require(_0x7b4c('0xb'));var _=require(_0x7b4c('0xc'));var squel=require('squel');var crypto=require(_0x7b4c('0xd'));var jsforce=require(_0x7b4c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7b4c('0xf'));var querystring=require(_0x7b4c('0x10'));var Papa=require(_0x7b4c('0x11'));var Redis=require(_0x7b4c('0x12'));var authService=require(_0x7b4c('0x13'));var qs=require(_0x7b4c('0x14'));var as=require(_0x7b4c('0x15'));var hardwareService=require(_0x7b4c('0x16'));var logger=require(_0x7b4c('0x17'))(_0x7b4c('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7b4c('0x19'));var db=require(_0x7b4c('0x1a'))['db'];function respondWithStatusCode(_0x38656b,_0x1722ad){_0x1722ad=_0x1722ad||0xcc;return function(_0x3e1558){if(_0x3e1558){return _0x38656b[_0x7b4c('0x1b')](_0x1722ad);}return _0x38656b[_0x7b4c('0x1c')](_0x1722ad)[_0x7b4c('0x1d')]();};}function respondWithResult(_0x25b90b,_0x387488){_0x387488=_0x387488||0xc8;return function(_0x593a19){if(_0x593a19){return _0x25b90b[_0x7b4c('0x1c')](_0x387488)[_0x7b4c('0x1e')](_0x593a19);}};}function respondWithFilteredResult(_0xdc71cd,_0x2a0e2f){return function(_0xa0a812){if(_0xa0a812){var _0x2471b3=typeof _0x2a0e2f[_0x7b4c('0x1f')]===_0x7b4c('0x20')&&typeof _0x2a0e2f['limit']===_0x7b4c('0x20');var _0xe71d88=_0xa0a812[_0x7b4c('0x21')];var _0x36c02a=_0x2471b3?0x0:_0x2a0e2f['offset'];var _0x3ce10c=_0x2471b3?_0xa0a812[_0x7b4c('0x21')]:_0x2a0e2f[_0x7b4c('0x1f')]+_0x2a0e2f[_0x7b4c('0x22')];var _0x2d4c72;if(_0x3ce10c>=_0xe71d88){_0x3ce10c=_0xe71d88;_0x2d4c72=0xc8;}else{_0x2d4c72=0xce;}_0xdc71cd[_0x7b4c('0x1c')](_0x2d4c72);return _0xdc71cd[_0x7b4c('0x23')](_0x7b4c('0x24'),_0x36c02a+'-'+_0x3ce10c+'/'+_0xe71d88)[_0x7b4c('0x1e')](_0xa0a812);}return null;};}function patchUpdates(_0x55e3df){return function(_0x1f06ec){try{jsonpatch[_0x7b4c('0x25')](_0x1f06ec,_0x55e3df,!![]);}catch(_0x11996d){return BPromise[_0x7b4c('0x26')](_0x11996d);}return _0x1f06ec[_0x7b4c('0x27')]();};}function saveUpdates(_0x168ac9,_0x176704){return function(_0x3d4826){if(_0x3d4826){return _0x3d4826[_0x7b4c('0x28')](_0x168ac9)[_0x7b4c('0x29')](function(_0x5eec1e){return _0x5eec1e;});}return null;};}function removeEntity(_0x45438c,_0x4350c9){return function(_0x276271){if(_0x276271){return _0x276271[_0x7b4c('0x2a')]()[_0x7b4c('0x29')](function(){_0x45438c[_0x7b4c('0x1c')](0xcc)[_0x7b4c('0x1d')]();});}};}function handleEntityNotFound(_0x459eb4,_0x1f311e){return function(_0x1a69db){if(!_0x1a69db){_0x459eb4[_0x7b4c('0x1b')](0x194);}return _0x1a69db;};}function handleError(_0x257da2,_0x316e5f){_0x316e5f=_0x316e5f||0x1f4;return function(_0x501f75){logger[_0x7b4c('0x2b')](_0x501f75[_0x7b4c('0x2c')]);if(_0x501f75[_0x7b4c('0x2d')]){delete _0x501f75[_0x7b4c('0x2d')];}_0x257da2[_0x7b4c('0x1c')](_0x316e5f)[_0x7b4c('0x2e')](_0x501f75);};}exports[_0x7b4c('0x2f')]=function(_0x2552f9,_0x3e4a46){var _0x9a799b={'raw':!![],'where':{'id':_0x2552f9[_0x7b4c('0x30')]['id']}},_0x3585cd={};_0x3585cd[_0x7b4c('0x31')]=_[_0x7b4c('0x32')](db[_0x7b4c('0x33')][_0x7b4c('0x34')]);_0x3585cd[_0x7b4c('0x35')]=_[_0x7b4c('0x32')](_0x2552f9[_0x7b4c('0x35')]);_0x3585cd['filters']=_['intersection'](_0x3585cd['model'],_0x3585cd[_0x7b4c('0x35')]);_0x9a799b[_0x7b4c('0x36')]=_[_0x7b4c('0x37')](_0x3585cd[_0x7b4c('0x31')],qs['fields'](_0x2552f9[_0x7b4c('0x35')][_0x7b4c('0x38')]));_0x9a799b['attributes']=_0x9a799b[_0x7b4c('0x36')]['length']?_0x9a799b[_0x7b4c('0x36')]:_0x3585cd[_0x7b4c('0x31')];if(_0x2552f9[_0x7b4c('0x35')]['includeAll']){_0x9a799b[_0x7b4c('0x39')]=[{'all':!![]}];}_0x9a799b=_[_0x7b4c('0x3a')]({},_0x9a799b,_0x2552f9['options']);return db[_0x7b4c('0x33')][_0x7b4c('0x3b')](_0x9a799b)[_0x7b4c('0x29')](handleEntityNotFound(_0x3e4a46,null))[_0x7b4c('0x29')](respondWithResult(_0x3e4a46,null))['catch'](handleError(_0x3e4a46,null));};exports['create']=function(_0x1325c1,_0x460fd4){return db['ChatProactiveAction'][_0x7b4c('0x3c')](_0x1325c1['body'],{})['then'](respondWithResult(_0x460fd4,0xc9))[_0x7b4c('0x3d')](handleError(_0x460fd4,null));};exports[_0x7b4c('0x28')]=function(_0x39d69a,_0x250901){if(_0x39d69a['body']['id']){delete _0x39d69a[_0x7b4c('0x3e')]['id'];}return db[_0x7b4c('0x33')][_0x7b4c('0x3b')]({'where':{'id':_0x39d69a[_0x7b4c('0x30')]['id']}})[_0x7b4c('0x29')](handleEntityNotFound(_0x250901,null))[_0x7b4c('0x29')](saveUpdates(_0x39d69a[_0x7b4c('0x3e')],null))['then'](respondWithResult(_0x250901,null))['catch'](handleError(_0x250901,null));};exports[_0x7b4c('0x2a')]=function(_0x37f136,_0x31ef1e){return db[_0x7b4c('0x33')][_0x7b4c('0x3b')]({'where':{'id':_0x37f136['params']['id']}})[_0x7b4c('0x29')](handleEntityNotFound(_0x31ef1e,null))[_0x7b4c('0x29')](removeEntity(_0x31ef1e,null))[_0x7b4c('0x3d')](handleError(_0x31ef1e,null));};
\ No newline at end of file
+var _0x4ab0=['undefined','limit','count','set','Content-Range','apply','reject','destroy','then','sendStatus','error','stack','name','send','params','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','catch','update','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x4ab0,0xd5));var _0x04ab=function(_0x17be96,_0x1aa8bf){_0x17be96=_0x17be96-0x0;var _0x17d987=_0x4ab0[_0x17be96];return _0x17d987;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x04ab('0x0'));var zipdir=require(_0x04ab('0x1'));var jsonpatch=require(_0x04ab('0x2'));var rp=require(_0x04ab('0x3'));var moment=require(_0x04ab('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x04ab('0x5'));var path=require(_0x04ab('0x6'));var sox=require('sox');var csv=require(_0x04ab('0x7'));var ejs=require(_0x04ab('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x04ab('0x9'));var squel=require(_0x04ab('0xa'));var crypto=require(_0x04ab('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04ab('0xc'));var toCsv=require(_0x04ab('0x7'));var querystring=require(_0x04ab('0xd'));var Papa=require(_0x04ab('0xe'));var Redis=require('ioredis');var authService=require(_0x04ab('0xf'));var qs=require(_0x04ab('0x10'));var as=require(_0x04ab('0x11'));var hardwareService=require(_0x04ab('0x12'));var logger=require('../../config/logger')(_0x04ab('0x13'));var utils=require(_0x04ab('0x14'));var config=require(_0x04ab('0x15'));var licenseUtil=require(_0x04ab('0x16'));var db=require(_0x04ab('0x17'))['db'];function respondWithStatusCode(_0x386d0a,_0x4a6b39){_0x4a6b39=_0x4a6b39||0xcc;return function(_0x710503){if(_0x710503){return _0x386d0a['sendStatus'](_0x4a6b39);}return _0x386d0a[_0x04ab('0x18')](_0x4a6b39)[_0x04ab('0x19')]();};}function respondWithResult(_0x2abdf8,_0x428798){_0x428798=_0x428798||0xc8;return function(_0x4f0da1){if(_0x4f0da1){return _0x2abdf8['status'](_0x428798)['json'](_0x4f0da1);}};}function respondWithFilteredResult(_0x103ca8,_0x3cee44){return function(_0x149fd2){if(_0x149fd2){var _0x2b10b0=typeof _0x3cee44[_0x04ab('0x1a')]===_0x04ab('0x1b')&&typeof _0x3cee44[_0x04ab('0x1c')]===_0x04ab('0x1b');var _0x1f3251=_0x149fd2[_0x04ab('0x1d')];var _0x5ce43c=_0x2b10b0?0x0:_0x3cee44[_0x04ab('0x1a')];var _0x83ab27=_0x2b10b0?_0x149fd2[_0x04ab('0x1d')]:_0x3cee44[_0x04ab('0x1a')]+_0x3cee44[_0x04ab('0x1c')];var _0x10669a;if(_0x83ab27>=_0x1f3251){_0x83ab27=_0x1f3251;_0x10669a=0xc8;}else{_0x10669a=0xce;}_0x103ca8[_0x04ab('0x18')](_0x10669a);return _0x103ca8[_0x04ab('0x1e')](_0x04ab('0x1f'),_0x5ce43c+'-'+_0x83ab27+'/'+_0x1f3251)['json'](_0x149fd2);}return null;};}function patchUpdates(_0x75a04e){return function(_0x4a6679){try{jsonpatch[_0x04ab('0x20')](_0x4a6679,_0x75a04e,!![]);}catch(_0x1d04c2){return BPromise[_0x04ab('0x21')](_0x1d04c2);}return _0x4a6679['save']();};}function saveUpdates(_0x15a36b,_0x1c08f4){return function(_0xf6275e){if(_0xf6275e){return _0xf6275e['update'](_0x15a36b)['then'](function(_0xc8358e){return _0xc8358e;});}return null;};}function removeEntity(_0x2f614a,_0x5885bd){return function(_0x551583){if(_0x551583){return _0x551583[_0x04ab('0x22')]()[_0x04ab('0x23')](function(){_0x2f614a[_0x04ab('0x18')](0xcc)[_0x04ab('0x19')]();});}};}function handleEntityNotFound(_0x26bb81,_0xa3838a){return function(_0x21d9b7){if(!_0x21d9b7){_0x26bb81[_0x04ab('0x24')](0x194);}return _0x21d9b7;};}function handleError(_0x222557,_0x5cf1e5){_0x5cf1e5=_0x5cf1e5||0x1f4;return function(_0x86bf80){logger[_0x04ab('0x25')](_0x86bf80[_0x04ab('0x26')]);if(_0x86bf80[_0x04ab('0x27')]){delete _0x86bf80['name'];}_0x222557['status'](_0x5cf1e5)[_0x04ab('0x28')](_0x86bf80);};}exports['show']=function(_0x404eae,_0x30db64){var _0x2e069d={'raw':!![],'where':{'id':_0x404eae[_0x04ab('0x29')]['id']}},_0x3c25fb={};_0x3c25fb['model']=_['keys'](db[_0x04ab('0x2a')][_0x04ab('0x2b')]);_0x3c25fb[_0x04ab('0x2c')]=_[_0x04ab('0x2d')](_0x404eae[_0x04ab('0x2c')]);_0x3c25fb[_0x04ab('0x2e')]=_[_0x04ab('0x2f')](_0x3c25fb[_0x04ab('0x30')],_0x3c25fb[_0x04ab('0x2c')]);_0x2e069d[_0x04ab('0x31')]=_[_0x04ab('0x2f')](_0x3c25fb[_0x04ab('0x30')],qs[_0x04ab('0x32')](_0x404eae['query'][_0x04ab('0x32')]));_0x2e069d[_0x04ab('0x31')]=_0x2e069d['attributes'][_0x04ab('0x33')]?_0x2e069d[_0x04ab('0x31')]:_0x3c25fb['model'];if(_0x404eae[_0x04ab('0x2c')][_0x04ab('0x34')]){_0x2e069d['include']=[{'all':!![]}];}_0x2e069d=_[_0x04ab('0x35')]({},_0x2e069d,_0x404eae[_0x04ab('0x36')]);return db[_0x04ab('0x2a')][_0x04ab('0x37')](_0x2e069d)[_0x04ab('0x23')](handleEntityNotFound(_0x30db64,null))[_0x04ab('0x23')](respondWithResult(_0x30db64,null))['catch'](handleError(_0x30db64,null));};exports[_0x04ab('0x38')]=function(_0x3f4d83,_0x2ad8ee){return db['ChatProactiveAction'][_0x04ab('0x38')](_0x3f4d83['body'],{})['then'](respondWithResult(_0x2ad8ee,0xc9))[_0x04ab('0x39')](handleError(_0x2ad8ee,null));};exports[_0x04ab('0x3a')]=function(_0x5569ba,_0x40995c){if(_0x5569ba['body']['id']){delete _0x5569ba[_0x04ab('0x3b')]['id'];}return db[_0x04ab('0x2a')][_0x04ab('0x37')]({'where':{'id':_0x5569ba[_0x04ab('0x29')]['id']}})[_0x04ab('0x23')](handleEntityNotFound(_0x40995c,null))[_0x04ab('0x23')](saveUpdates(_0x5569ba[_0x04ab('0x3b')],null))[_0x04ab('0x23')](respondWithResult(_0x40995c,null))[_0x04ab('0x39')](handleError(_0x40995c,null));};exports[_0x04ab('0x22')]=function(_0x2b79f8,_0x3f145){return db['ChatProactiveAction'][_0x04ab('0x37')]({'where':{'id':_0x2b79f8[_0x04ab('0x29')]['id']}})['then'](handleEntityNotFound(_0x3f145,null))['then'](removeEntity(_0x3f145,null))[_0x04ab('0x39')](handleError(_0x3f145,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index e6e6fbe..4c75843 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 _0xd609=['rimraf','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3f3574,_0x5dcb34){var _0x46019d=function(_0x210337){while(--_0x210337){_0x3f3574['push'](_0x3f3574['shift']());}};_0x46019d(++_0x5dcb34);}(_0xd609,0x1ef));var _0x9d60=function(_0x3a8fbd,_0x59c0d0){_0x3a8fbd=_0x3a8fbd-0x0;var _0x2b61da=_0xd609[_0x3a8fbd];return _0x2b61da;};'use strict';var _=require(_0x9d60('0x0'));var util=require(_0x9d60('0x1'));var logger=require(_0x9d60('0x2'))('api');var moment=require(_0x9d60('0x3'));var BPromise=require(_0x9d60('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9d60('0x5'));var config=require('../../config/environment');var attributes=require(_0x9d60('0x6'));module[_0x9d60('0x7')]=function(_0xdcb75f,_0x470aa8){return _0xdcb75f['define'](_0x9d60('0x8'),attributes,{'tableName':_0x9d60('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x32cf=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define'];(function(_0x3072ee,_0x40b136){var _0x47041d=function(_0x47c8ee){while(--_0x47c8ee){_0x3072ee['push'](_0x3072ee['shift']());}};_0x47041d(++_0x40b136);}(_0x32cf,0x9c));var _0xf32c=function(_0x43a37c,_0x25a567){_0x43a37c=_0x43a37c-0x0;var _0x5d1d40=_0x32cf[_0x43a37c];return _0x5d1d40;};'use strict';var _=require(_0xf32c('0x0'));var util=require(_0xf32c('0x1'));var logger=require(_0xf32c('0x2'))(_0xf32c('0x3'));var moment=require(_0xf32c('0x4'));var BPromise=require(_0xf32c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf32c('0x6'));var rimraf=require(_0xf32c('0x7'));var config=require(_0xf32c('0x8'));var attributes=require(_0xf32c('0x9'));module[_0xf32c('0xa')]=function(_0x46b9eb,_0x42fa78){return _0x46b9eb[_0xf32c('0xb')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 4e85e52..497c3d3 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 _0x4790=['code','error','ChatProactiveAction,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','request\x20sent','debug'];(function(_0x12f79e,_0x192a7d){var _0x12f25f=function(_0x8f89eb){while(--_0x8f89eb){_0x12f79e['push'](_0x12f79e['shift']());}};_0x12f25f(++_0x192a7d);}(_0x4790,0x1ab));var _0x0479=function(_0x4cc280,_0x3b77f3){_0x4cc280=_0x4cc280-0x0;var _0x16ed24=_0x4790[_0x4cc280];return _0x16ed24;};'use strict';var _=require(_0x0479('0x0'));var util=require(_0x0479('0x1'));var moment=require(_0x0479('0x2'));var BPromise=require('bluebird');var rs=require(_0x0479('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0479('0x4'))['db'];var utils=require(_0x0479('0x5'));var logger=require(_0x0479('0x6'))('rpc');var config=require(_0x0479('0x7'));var jayson=require(_0x0479('0x8'));var client=jayson[_0x0479('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x154ef4,_0x450cc6,_0x5eb18c){return new BPromise(function(_0x39ce51,_0x13b150){return client['request'](_0x154ef4,_0x5eb18c)[_0x0479('0xa')](function(_0x1b9516){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x450cc6,_0x0479('0xb'));logger[_0x0479('0xc')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x450cc6,_0x0479('0xb'),JSON['stringify'](_0x1b9516));if(_0x1b9516['error']){if(_0x1b9516['error'][_0x0479('0xd')]===0x1f4){logger[_0x0479('0xe')](_0x0479('0xf'),_0x450cc6,_0x1b9516[_0x0479('0xe')][_0x0479('0x10')]);return _0x13b150(_0x1b9516['error']['message']);}logger[_0x0479('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x450cc6,_0x1b9516[_0x0479('0xe')][_0x0479('0x10')]);return _0x39ce51(_0x1b9516[_0x0479('0xe')][_0x0479('0x10')]);}else{logger[_0x0479('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x450cc6,_0x0479('0xb'));_0x39ce51(_0x1b9516[_0x0479('0x12')][_0x0479('0x10')]);}})[_0x0479('0x13')](function(_0x3a2ff6){logger[_0x0479('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x450cc6,_0x3a2ff6);_0x13b150(_0x3a2ff6);});});}
\ No newline at end of file
+var _0xc94a=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2d6197,_0x82ebfb){var _0x4d0e75=function(_0x577e7a){while(--_0x577e7a){_0x2d6197['push'](_0x2d6197['shift']());}};_0x4d0e75(++_0x82ebfb);}(_0xc94a,0x1b4));var _0xac94=function(_0x574257,_0x156faf){_0x574257=_0x574257-0x0;var _0x2de793=_0xc94a[_0x574257];return _0x2de793;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xac94('0x0'));var rs=require(_0xac94('0x1'));var fs=require('fs');var Redis=require(_0xac94('0x2'));var db=require(_0xac94('0x3'))['db'];var utils=require(_0xac94('0x4'));var logger=require(_0xac94('0x5'))(_0xac94('0x6'));var config=require(_0xac94('0x7'));var jayson=require(_0xac94('0x8'));var client=jayson['client'][_0xac94('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cbe38,_0x326044,_0x7c1c7a){return new BPromise(function(_0x2284ab,_0x2c2bef){return client[_0xac94('0xa')](_0x2cbe38,_0x7c1c7a)['then'](function(_0x41a5f4){logger[_0xac94('0xb')](_0xac94('0xc'),_0x326044,'request\x20sent');logger[_0xac94('0xd')](_0xac94('0xe'),_0x326044,_0xac94('0xf'),JSON[_0xac94('0x10')](_0x41a5f4));if(_0x41a5f4[_0xac94('0x11')]){if(_0x41a5f4['error'][_0xac94('0x12')]===0x1f4){logger['error'](_0xac94('0xc'),_0x326044,_0x41a5f4['error']['message']);return _0x2c2bef(_0x41a5f4[_0xac94('0x11')][_0xac94('0x13')]);}logger[_0xac94('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x326044,_0x41a5f4[_0xac94('0x11')][_0xac94('0x13')]);return _0x2284ab(_0x41a5f4['error'][_0xac94('0x13')]);}else{logger[_0xac94('0xb')](_0xac94('0xc'),_0x326044,_0xac94('0xf'));_0x2284ab(_0x41a5f4['result'][_0xac94('0x13')]);}})['catch'](function(_0x8b31c7){logger['error'](_0xac94('0xc'),_0x326044,_0x8b31c7);_0x2c2bef(_0x8b31c7);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index a835d1b..3f13d9e 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 _0x5fc3=['create','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','get','show','isAuthenticated'];(function(_0x1434b7,_0x120c08){var _0x3a20a5=function(_0xd845d8){while(--_0xd845d8){_0x1434b7['push'](_0x1434b7['shift']());}};_0x3a20a5(++_0x120c08);}(_0x5fc3,0xa8));var _0x35fc=function(_0x35bd6c,_0x585087){_0x35bd6c=_0x35bd6c-0x0;var _0x2f421d=_0x5fc3[_0x35bd6c];return _0x2f421d;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x35fc('0xa')]);router['post']('/',auth[_0x35fc('0xb')](),controller[_0x35fc('0xc')]);router[_0x35fc('0xd')](_0x35fc('0xe'),auth[_0x35fc('0xb')](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xb')](),controller[_0x35fc('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x425d=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x425d,0x1e0));var _0xd425=function(_0x568669,_0x166190){_0x568669=_0x568669-0x0;var _0x45a6e7=_0x425d[_0x568669];return _0x45a6e7;};'use strict';var multer=require(_0xd425('0x0'));var util=require('util');var path=require(_0xd425('0x1'));var timeout=require(_0xd425('0x2'));var express=require(_0xd425('0x3'));var router=express[_0xd425('0x4')]();var fs_extra=require(_0xd425('0x5'));var auth=require(_0xd425('0x6'));var interaction=require(_0xd425('0x7'));var config=require('../../config/environment');var controller=require(_0xd425('0x8'));router[_0xd425('0x9')](_0xd425('0xa'),auth[_0xd425('0xb')](),controller[_0xd425('0xc')]);router[_0xd425('0xd')]('/',auth['isAuthenticated'](),controller[_0xd425('0xe')]);router[_0xd425('0xf')](_0xd425('0xa'),auth[_0xd425('0xb')](),controller[_0xd425('0x10')]);router[_0xd425('0x11')](_0xd425('0xa'),auth[_0xd425('0xb')](),controller[_0xd425('0x12')]);module[_0xd425('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 3cabcfa..bfa7431 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 _0x1df9=['sequelize','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x675246,_0x1d0878){var _0x59e2c7=function(_0x2d3d74){while(--_0x2d3d74){_0x675246['push'](_0x675246['shift']());}};_0x59e2c7(++_0x1d0878);}(_0x1df9,0x178));var _0x91df=function(_0x422b9e,_0x37325d){_0x422b9e=_0x422b9e-0x0;var _0x23dc6e=_0x1df9[_0x422b9e];return _0x23dc6e;};'use strict';var Sequelize=require(_0x91df('0x0'));module['exports']={'name':{'type':Sequelize[_0x91df('0x1')],'unique':_0x91df('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x91df('0x1')]},'timeout':{'type':Sequelize[_0x91df('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x91df('0x4')](_0x91df('0x5'),_0x91df('0x6'),_0x91df('0x7'))}};
\ No newline at end of file
+var _0xbb21=['beepall','roundrobin','exports','STRING','name','INTEGER','ENUM'];(function(_0x289abe,_0x4c67e3){var _0x8e39d8=function(_0x2c77f4){while(--_0x2c77f4){_0x289abe['push'](_0x289abe['shift']());}};_0x8e39d8(++_0x4c67e3);}(_0xbb21,0x183));var _0x1bb2=function(_0x44cf3a,_0x204f76){_0x44cf3a=_0x44cf3a-0x0;var _0x3fabc6=_0xbb21[_0x44cf3a];return _0x3fabc6;};'use strict';var Sequelize=require('sequelize');module[_0x1bb2('0x0')]={'name':{'type':Sequelize[_0x1bb2('0x1')],'unique':_0x1bb2('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1bb2('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1bb2('0x4')]('rrmemory',_0x1bb2('0x5'),_0x1bb2('0x6'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 111f063..7601836 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 _0x1c55=['emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','lodash','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../mysqldb','redis','defaults','register','jayson/promise','client','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','status','end','json','offset','undefined','limit','count','set','save','destroy','then','get','ChatQueues','UserProfileResource','stack','name','send','index','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserChatQueue','hasOwnProperty','ChatQueueId','User','UserId','agent','chatPause','updatedAt','createdAt','format','SIP','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach'];(function(_0x4a673b,_0x5c121c){var _0x1145e5=function(_0x3970ed){while(--_0x3970ed){_0x4a673b['push'](_0x4a673b['shift']());}};_0x1145e5(++_0x5c121c);}(_0x1c55,0xad));var _0x51c5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1c55[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x51c5('0x0'));var rimraf=require(_0x51c5('0x1'));var zipdir=require(_0x51c5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x51c5('0x3'));var moment=require(_0x51c5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x51c5('0x5'));var sox=require(_0x51c5('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x51c5('0x7'));var squel=require('squel');var crypto=require(_0x51c5('0x8'));var jsforce=require(_0x51c5('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x51c5('0xa'));var querystring=require(_0x51c5('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x51c5('0xc'));var qs=require(_0x51c5('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x51c5('0xe'))['db'];config[_0x51c5('0xf')]=_[_0x51c5('0x10')](config[_0x51c5('0xf')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x51c5('0xf')]));require('./chatQueue.socket')[_0x51c5('0x11')](socket);var jayson=require(_0x51c5('0x12'));var client=jayson[_0x51c5('0x13')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e423c,_0x5c472f,_0x5d01be,_0x536853){return new BPromise(function(_0x59160b,_0x193a93){var _0x2bda47=_0x536853||client;return _0x2bda47[_0x51c5('0x14')](_0x5e423c,_0x5d01be)['then'](function(_0x57abb4){logger[_0x51c5('0x15')](_0x51c5('0x16'),_0x5c472f,_0x51c5('0x17'));logger['debug'](_0x51c5('0x18'),_0x5c472f,'request\x20sent',JSON[_0x51c5('0x19')](_0x57abb4));if(_0x57abb4[_0x51c5('0x1a')]){if(_0x57abb4[_0x51c5('0x1a')]['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x5c472f,_0x57abb4[_0x51c5('0x1a')]['message']);return _0x193a93(_0x57abb4['error'][_0x51c5('0x1b')]);}logger[_0x51c5('0x1a')](_0x51c5('0x16'),_0x5c472f,_0x57abb4[_0x51c5('0x1a')]['message']);return _0x59160b(_0x57abb4['error'][_0x51c5('0x1b')]);}else{logger[_0x51c5('0x15')](_0x51c5('0x16'),_0x5c472f,_0x51c5('0x17'));_0x59160b(_0x57abb4['result'][_0x51c5('0x1b')]);}})['catch'](function(_0x3f7c3c){logger['error'](_0x51c5('0x16'),_0x5c472f,_0x3f7c3c);_0x193a93(_0x3f7c3c);});});}function respondWithStatusCode(_0x717903,_0x4633d7){_0x4633d7=_0x4633d7||0xcc;return function(_0x419862){if(_0x419862){return _0x717903[_0x51c5('0x1c')](_0x4633d7);}return _0x717903[_0x51c5('0x1d')](_0x4633d7)[_0x51c5('0x1e')]();};}function respondWithResult(_0x345d17,_0x5f8465){_0x5f8465=_0x5f8465||0xc8;return function(_0x280679){if(_0x280679){return _0x345d17[_0x51c5('0x1d')](_0x5f8465)[_0x51c5('0x1f')](_0x280679);}};}function respondWithFilteredResult(_0x1b20e5,_0x547260){return function(_0x564c95){if(_0x564c95){var _0x57cf3f=typeof _0x547260[_0x51c5('0x20')]===_0x51c5('0x21')&&typeof _0x547260[_0x51c5('0x22')]==='undefined';var _0x475f45=_0x564c95[_0x51c5('0x23')];var _0x1cf5fb=_0x57cf3f?0x0:_0x547260[_0x51c5('0x20')];var _0xee54b7=_0x57cf3f?_0x564c95[_0x51c5('0x23')]:_0x547260['offset']+_0x547260[_0x51c5('0x22')];var _0x4ba832;if(_0xee54b7>=_0x475f45){_0xee54b7=_0x475f45;_0x4ba832=0xc8;}else{_0x4ba832=0xce;}_0x1b20e5[_0x51c5('0x1d')](_0x4ba832);return _0x1b20e5[_0x51c5('0x24')]('Content-Range',_0x1cf5fb+'-'+_0xee54b7+'/'+_0x475f45)[_0x51c5('0x1f')](_0x564c95);}return null;};}function patchUpdates(_0x11c52d){return function(_0x15243c){try{jsonpatch['apply'](_0x15243c,_0x11c52d,!![]);}catch(_0xe38196){return BPromise['reject'](_0xe38196);}return _0x15243c[_0x51c5('0x25')]();};}function saveUpdates(_0x199147,_0x556d47){return function(_0x1d74a9){if(_0x1d74a9){return _0x1d74a9['update'](_0x199147)['then'](function(_0x1ffaa1){return _0x1ffaa1;});}return null;};}function removeEntity(_0x4668e4,_0x32c869){return function(_0x44ac1b){if(_0x44ac1b){return _0x44ac1b[_0x51c5('0x26')]()[_0x51c5('0x27')](function(){var _0x81569c=_0x44ac1b[_0x51c5('0x28')]({'plain':!![]});var _0x5c852c=_0x51c5('0x29');return db[_0x51c5('0x2a')]['destroy']({'where':{'type':_0x5c852c,'resourceId':_0x81569c['id']}})[_0x51c5('0x27')](function(){return _0x44ac1b;});})['then'](function(){_0x4668e4[_0x51c5('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ce199,_0x37525b){return function(_0x38b1a6){if(!_0x38b1a6){_0x2ce199[_0x51c5('0x1c')](0x194);}return _0x38b1a6;};}function handleError(_0x4823e7,_0x2b177b){_0x2b177b=_0x2b177b||0x1f4;return function(_0x229496){logger[_0x51c5('0x1a')](_0x229496[_0x51c5('0x2b')]);if(_0x229496[_0x51c5('0x2c')]){delete _0x229496[_0x51c5('0x2c')];}_0x4823e7['status'](_0x2b177b)[_0x51c5('0x2d')](_0x229496);};}exports[_0x51c5('0x2e')]=function(_0x347dfd,_0x13bd98){var _0x94baac={},_0xf6b277={},_0x210eac={'count':0x0,'rows':[]};var _0x26ac93=_['map'](db[_0x51c5('0x2f')][_0x51c5('0x30')],function(_0x567af6){return{'name':_0x567af6[_0x51c5('0x31')],'type':_0x567af6[_0x51c5('0x32')][_0x51c5('0x33')]};});_0xf6b277[_0x51c5('0x34')]=_['map'](_0x26ac93,'name');_0xf6b277[_0x51c5('0x35')]=_[_0x51c5('0x36')](_0x347dfd['query']);_0xf6b277['filters']=_[_0x51c5('0x37')](_0xf6b277['model'],_0xf6b277[_0x51c5('0x35')]);_0x94baac[_0x51c5('0x38')]=_[_0x51c5('0x37')](_0xf6b277[_0x51c5('0x34')],qs['fields'](_0x347dfd[_0x51c5('0x35')]['fields']));_0x94baac[_0x51c5('0x38')]=_0x94baac[_0x51c5('0x38')][_0x51c5('0x39')]?_0x94baac['attributes']:_0xf6b277[_0x51c5('0x34')];if(!_0x347dfd[_0x51c5('0x35')]['hasOwnProperty'](_0x51c5('0x3a'))){_0x94baac[_0x51c5('0x22')]=qs['limit'](_0x347dfd[_0x51c5('0x35')][_0x51c5('0x22')]);_0x94baac[_0x51c5('0x20')]=qs[_0x51c5('0x20')](_0x347dfd[_0x51c5('0x35')][_0x51c5('0x20')]);}_0x94baac[_0x51c5('0x3b')]=qs[_0x51c5('0x3c')](_0x347dfd['query'][_0x51c5('0x3c')]);_0x94baac[_0x51c5('0x3d')]=qs[_0x51c5('0x3e')](_[_0x51c5('0x3f')](_0x347dfd[_0x51c5('0x35')],_0xf6b277['filters']),_0x26ac93);if(_0x347dfd['query'][_0x51c5('0x40')]){_0x94baac[_0x51c5('0x3d')]=_[_0x51c5('0x41')](_0x94baac[_0x51c5('0x3d')],{'$or':_[_0x51c5('0x42')](_0x26ac93,function(_0x4cd2a4){if(_0x4cd2a4[_0x51c5('0x32')]!==_0x51c5('0x43')){var _0x5af58e={};_0x5af58e[_0x4cd2a4[_0x51c5('0x2c')]]={'$like':'%'+_0x347dfd['query'][_0x51c5('0x40')]+'%'};return _0x5af58e;}})});}_0x94baac=_[_0x51c5('0x41')]({},_0x94baac,_0x347dfd[_0x51c5('0x44')]);var _0x2f10b1={'where':_0x94baac[_0x51c5('0x3d')]};return db[_0x51c5('0x2f')][_0x51c5('0x23')](_0x2f10b1)[_0x51c5('0x27')](function(_0x5ab274){_0x210eac[_0x51c5('0x23')]=_0x5ab274;if(_0x347dfd['query'][_0x51c5('0x45')]){_0x94baac[_0x51c5('0x46')]=[{'all':!![]}];}return db['ChatQueue'][_0x51c5('0x47')](_0x94baac);})[_0x51c5('0x27')](function(_0x1cca77){_0x210eac[_0x51c5('0x48')]=_0x1cca77;return _0x210eac;})[_0x51c5('0x27')](respondWithFilteredResult(_0x13bd98,_0x94baac))[_0x51c5('0x49')](handleError(_0x13bd98,null));};exports[_0x51c5('0x4a')]=function(_0x3f4667,_0x19b2af){var _0x1ce0ea={'raw':!![],'where':{'id':_0x3f4667[_0x51c5('0x4b')]['id']}},_0x5247e5={};_0x5247e5[_0x51c5('0x34')]=_[_0x51c5('0x36')](db[_0x51c5('0x2f')][_0x51c5('0x30')]);_0x5247e5[_0x51c5('0x35')]=_[_0x51c5('0x36')](_0x3f4667['query']);_0x5247e5[_0x51c5('0x3e')]=_[_0x51c5('0x37')](_0x5247e5[_0x51c5('0x34')],_0x5247e5[_0x51c5('0x35')]);_0x1ce0ea[_0x51c5('0x38')]=_['intersection'](_0x5247e5[_0x51c5('0x34')],qs[_0x51c5('0x4c')](_0x3f4667['query'][_0x51c5('0x4c')]));_0x1ce0ea[_0x51c5('0x38')]=_0x1ce0ea[_0x51c5('0x38')][_0x51c5('0x39')]?_0x1ce0ea[_0x51c5('0x38')]:_0x5247e5[_0x51c5('0x34')];if(_0x3f4667[_0x51c5('0x35')]['includeAll']){_0x1ce0ea[_0x51c5('0x46')]=[{'all':!![]}];}_0x1ce0ea=_[_0x51c5('0x41')]({},_0x1ce0ea,_0x3f4667[_0x51c5('0x44')]);return db[_0x51c5('0x2f')][_0x51c5('0x4d')](_0x1ce0ea)[_0x51c5('0x27')](handleEntityNotFound(_0x19b2af,null))[_0x51c5('0x27')](respondWithResult(_0x19b2af,null))[_0x51c5('0x49')](handleError(_0x19b2af,null));};exports[_0x51c5('0x4e')]=function(_0x7eecb9,_0x52ec96){return db['ChatQueue'][_0x51c5('0x4e')](_0x7eecb9[_0x51c5('0x4f')],{})[_0x51c5('0x27')](function(_0x2430ea){var _0x2f25be=_0x7eecb9[_0x51c5('0x50')]['get']({'plain':!![]});if(!_0x2f25be)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f25be[_0x51c5('0x51')]===_0x51c5('0x50')){var _0xd766a3=_0x2430ea[_0x51c5('0x28')]({'plain':!![]});var _0x396235=_0x51c5('0x29');return db[_0x51c5('0x52')]['find']({'where':{'name':_0x396235,'userProfileId':_0x2f25be[_0x51c5('0x53')]},'raw':!![]})[_0x51c5('0x27')](function(_0x299df6){if(_0x299df6&&_0x299df6[_0x51c5('0x54')]===0x0){return db[_0x51c5('0x2a')]['create']({'name':_0xd766a3[_0x51c5('0x2c')],'resourceId':_0xd766a3['id'],'type':_0x299df6[_0x51c5('0x2c')],'sectionId':_0x299df6['id']},{})[_0x51c5('0x27')](function(){return _0x2430ea;});}else{return _0x2430ea;}})[_0x51c5('0x49')](function(_0x174025){logger[_0x51c5('0x1a')](_0x51c5('0x55'),_0x174025);throw _0x174025;});}return _0x2430ea;})['then'](respondWithResult(_0x52ec96,0xc9))['catch'](handleError(_0x52ec96,null));};exports[_0x51c5('0x56')]=function(_0x143257,_0x318aeb){if(_0x143257[_0x51c5('0x4f')]['id']){delete _0x143257['body']['id'];}return db[_0x51c5('0x2f')][_0x51c5('0x4d')]({'where':{'id':_0x143257['params']['id']}})['then'](handleEntityNotFound(_0x318aeb,null))[_0x51c5('0x27')](saveUpdates(_0x143257[_0x51c5('0x4f')],null))[_0x51c5('0x27')](respondWithResult(_0x318aeb,null))[_0x51c5('0x49')](handleError(_0x318aeb,null));};exports['destroy']=function(_0x20efdd,_0x8db438){return db[_0x51c5('0x2f')][_0x51c5('0x4d')]({'where':{'id':_0x20efdd[_0x51c5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x8db438,null))['then'](removeEntity(_0x8db438,null))[_0x51c5('0x49')](handleError(_0x8db438,null));};exports[_0x51c5('0x57')]=function(_0x3cf994,_0x44cca2){return db[_0x51c5('0x2f')][_0x51c5('0x57')]()['then'](respondWithResult(_0x44cca2,null))[_0x51c5('0x49')](handleError(_0x44cca2,null));};exports['getMembers']=function(_0x4c04cd,_0x47b8ff,_0x426d79){var _0x46ad8f={'raw':!![],'where':{}},_0x4ebe2e={},_0x5da3fb;return db['ChatQueue'][_0x51c5('0x58')]({'where':{'id':_0x4c04cd[_0x51c5('0x4b')]['id']}})[_0x51c5('0x27')](handleEntityNotFound(_0x47b8ff,null))[_0x51c5('0x27')](function(_0x5b37ce){if(_0x5b37ce){_0x5da3fb=_0x5b37ce['get']({'plain':!![]});_0x4ebe2e[_0x51c5('0x34')]=_['keys'](db[_0x51c5('0x59')][_0x51c5('0x30')]);_0x4ebe2e[_0x51c5('0x35')]=_[_0x51c5('0x36')](_0x4c04cd[_0x51c5('0x35')]);_0x4ebe2e[_0x51c5('0x3e')]=_['intersection'](_0x4ebe2e[_0x51c5('0x34')],_0x4ebe2e['query']);_0x46ad8f[_0x51c5('0x38')]=_[_0x51c5('0x37')](_0x4ebe2e[_0x51c5('0x34')],qs[_0x51c5('0x4c')](_0x4c04cd[_0x51c5('0x35')][_0x51c5('0x4c')]));_0x46ad8f[_0x51c5('0x38')]=_0x46ad8f[_0x51c5('0x38')][_0x51c5('0x39')]?_0x46ad8f[_0x51c5('0x38')]:_0x4ebe2e['model'];if(!_0x4c04cd['query'][_0x51c5('0x5a')](_0x51c5('0x3a'))){_0x46ad8f[_0x51c5('0x22')]=qs[_0x51c5('0x22')](_0x4c04cd[_0x51c5('0x35')]['limit']);_0x46ad8f[_0x51c5('0x20')]=qs[_0x51c5('0x20')](_0x4c04cd['query'][_0x51c5('0x20')]);}_0x46ad8f[_0x51c5('0x3b')]=qs[_0x51c5('0x3c')](_0x4c04cd[_0x51c5('0x35')][_0x51c5('0x3c')]);_0x46ad8f[_0x51c5('0x3d')]=qs[_0x51c5('0x3e')](_['pick'](_0x4c04cd[_0x51c5('0x35')],_0x4ebe2e[_0x51c5('0x3e')]));_0x46ad8f['where'][_0x51c5('0x5b')]=_0x5b37ce['id'];if(_0x4c04cd[_0x51c5('0x35')][_0x51c5('0x40')]){_0x46ad8f[_0x51c5('0x3d')]=_[_0x51c5('0x41')](_0x46ad8f['where'],{'$or':_[_0x51c5('0x42')](_0x46ad8f[_0x51c5('0x38')],function(_0x23f0a7){var _0x717675={};_0x717675[_0x23f0a7]={'$like':'%'+_0x4c04cd[_0x51c5('0x35')][_0x51c5('0x40')]+'%'};return _0x717675;})});}_0x46ad8f=_[_0x51c5('0x41')]({},_0x46ad8f,_0x4c04cd[_0x51c5('0x44')]);return db['UserChatQueue'][_0x51c5('0x47')](_0x46ad8f);}})[_0x51c5('0x27')](function(_0x1e8d18){if(_0x1e8d18){return db[_0x51c5('0x5c')]['findAndCountAll']({'where':{'id':_['map'](_0x1e8d18,_0x51c5('0x5d')),'role':_0x51c5('0x5e')},'attributes':['id',_0x51c5('0x2c'),_0x51c5('0x5f'),_0x51c5('0x60'),_0x51c5('0x61')]});}})['then'](function(_0x5d4573){if(_0x5d4573){return{'count':_0x5d4573[_0x51c5('0x23')],'rows':_[_0x51c5('0x42')](_0x5d4573[_0x51c5('0x48')],function(_0x5b64de){return{'membername':_0x5b64de['name'],'UserId':_0x5b64de['id'],'queue_name':_0x5da3fb['name'],'ChatQueueId':_0x5da3fb['id'],'interface':util[_0x51c5('0x62')]('%s/%s',_0x51c5('0x63'),_0x5b64de[_0x51c5('0x2c')]),'penalty':0x0,'paused':_0x5b64de[_0x51c5('0x5f')],'createdAt':_0x5b64de[_0x51c5('0x61')],'updatedAt':_0x5b64de[_0x51c5('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x47b8ff,_0x46ad8f))[_0x51c5('0x49')](handleError(_0x47b8ff,null));};exports[_0x51c5('0x64')]=function(_0x2807f4,_0x47c372,_0x1e8148){var _0x1bea6a={};var _0x347f8e={};var _0x5396c2;var _0x5e560f;return db[_0x51c5('0x2f')][_0x51c5('0x58')]({'where':{'id':_0x2807f4['params']['id']}})[_0x51c5('0x27')](handleEntityNotFound(_0x47c372,null))['then'](function(_0xde8ca4){if(_0xde8ca4){_0x5396c2=_0xde8ca4;_0x347f8e[_0x51c5('0x34')]=_[_0x51c5('0x36')](db['Team'][_0x51c5('0x30')]);_0x347f8e[_0x51c5('0x35')]=_[_0x51c5('0x36')](_0x2807f4['query']);_0x347f8e[_0x51c5('0x3e')]=_[_0x51c5('0x37')](_0x347f8e[_0x51c5('0x34')],_0x347f8e[_0x51c5('0x35')]);_0x1bea6a[_0x51c5('0x38')]=_['intersection'](_0x347f8e[_0x51c5('0x34')],qs[_0x51c5('0x4c')](_0x2807f4[_0x51c5('0x35')][_0x51c5('0x4c')]));_0x1bea6a[_0x51c5('0x38')]=_0x1bea6a['attributes'][_0x51c5('0x39')]?_0x1bea6a[_0x51c5('0x38')]:_0x347f8e[_0x51c5('0x34')];_0x1bea6a[_0x51c5('0x3b')]=qs[_0x51c5('0x3c')](_0x2807f4[_0x51c5('0x35')][_0x51c5('0x3c')]);_0x1bea6a[_0x51c5('0x3d')]=qs['filters'](_[_0x51c5('0x3f')](_0x2807f4[_0x51c5('0x35')],_0x347f8e[_0x51c5('0x3e')]));if(_0x2807f4[_0x51c5('0x35')][_0x51c5('0x40')]){_0x1bea6a[_0x51c5('0x3d')]=_[_0x51c5('0x41')](_0x1bea6a[_0x51c5('0x3d')],{'$or':_[_0x51c5('0x42')](_0x1bea6a[_0x51c5('0x38')],function(_0xdec595){var _0x42a5c5={};_0x42a5c5[_0xdec595]={'$like':'%'+_0x2807f4[_0x51c5('0x35')][_0x51c5('0x40')]+'%'};return _0x42a5c5;})});}_0x1bea6a=_[_0x51c5('0x41')]({},_0x1bea6a,_0x2807f4[_0x51c5('0x44')]);return _0x5396c2['getTeams'](_0x1bea6a);}})[_0x51c5('0x27')](function(_0x1deb8e){if(_0x1deb8e){_0x5e560f=_0x1deb8e[_0x51c5('0x39')];if(!_0x2807f4[_0x51c5('0x35')][_0x51c5('0x5a')](_0x51c5('0x3a'))){_0x1bea6a['limit']=qs[_0x51c5('0x22')](_0x2807f4['query'][_0x51c5('0x22')]);_0x1bea6a['offset']=qs[_0x51c5('0x20')](_0x2807f4[_0x51c5('0x35')][_0x51c5('0x20')]);}return _0x5396c2['getTeams'](_0x1bea6a);}})[_0x51c5('0x27')](function(_0x1ada78){if(_0x1ada78){return _0x1ada78?{'count':_0x5e560f,'rows':_0x1ada78}:null;}})[_0x51c5('0x27')](respondWithResult(_0x47c372,null))['catch'](handleError(_0x47c372,null));};exports[_0x51c5('0x65')]=function(_0x25e114,_0x333ef3,_0x589ce7){var _0x18c27b=_0x25e114[_0x51c5('0x4f')][_0x51c5('0x66')];return db[_0x51c5('0x67')][_0x51c5('0x47')]({'where':{'id':_0x18c27b},'attributes':['id'],'include':[{'model':db['User'],'as':_0x51c5('0x68'),'attributes':['id','name',_0x51c5('0x69'),_0x51c5('0x6a'),_0x51c5('0x6b')],'raw':!![]}]})['then'](function(_0x40dc3c){if(_0x40dc3c){var _0x2cd8d0=_[_0x51c5('0x6c')](_0x40dc3c,function(_0x5b610a){var _0x58626f=_0x5b610a[_0x51c5('0x28')]({'plain':!![]});return _0x58626f[_0x51c5('0x68')];});return db[_0x51c5('0x2f')][_0x51c5('0x4d')]({'where':{'id':_0x25e114[_0x51c5('0x4b')]['id']}})[_0x51c5('0x27')](function(_0x11ca66){return db[_0x51c5('0x6d')]['transaction'](function(_0x4ef956){return _0x11ca66[_0x51c5('0x65')](_0x18c27b,{'transaction':_0x4ef956})[_0x51c5('0x27')](function(){return BPromise[_0x51c5('0x6e')](_0x2cd8d0,function(_0x407f06){return db[_0x51c5('0x59')][_0x51c5('0x6f')]({'where':{'UserId':_0x407f06['id'],'ChatQueueId':_0x25e114['params']['id']},'transaction':_0x4ef956});});})['then'](function(){_0x2cd8d0[_0x51c5('0x70')](function(_0x3f07e3){socket[_0x51c5('0x71')](_0x51c5('0x72'),{'UserId':_0x3f07e3['id'],'ChatQueueId':_0x11ca66['id']});});});});});}})[_0x51c5('0x27')](respondWithStatusCode(_0x333ef3,null))['catch'](handleError(_0x333ef3,null));};exports[_0x51c5('0x73')]=function(_0x374b18,_0x3d83f6,_0x4bd698){return db[_0x51c5('0x67')][_0x51c5('0x47')]({'where':{'id':_0x374b18[_0x51c5('0x35')][_0x51c5('0x66')]},'attributes':['id'],'include':[{'model':db[_0x51c5('0x5c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x51c5('0x27')](handleEntityNotFound(_0x3d83f6,null))['then'](function(_0x56d82d){var _0x2cbb7c=_[_0x51c5('0x42')](_0x56d82d,'id');var _0x192b74=[];var _0x418a0f=[];var _0x2cb550=squel[_0x51c5('0x74')]();_0x2cb550[_0x51c5('0x75')](_0x51c5('0x76'))[_0x51c5('0x77')](_0x51c5('0x78'),'tq')[_0x51c5('0x79')](_0x51c5('0x7a'),'ut',_0x51c5('0x7b'))[_0x51c5('0x3d')](_0x51c5('0x7c'),_0x374b18[_0x51c5('0x4b')]['id']);for(var _0x5c417d=0x0;_0x5c417d<_0x56d82d['length'];_0x5c417d+=0x1){let _0x48fdc4=_0x56d82d[_0x5c417d];for(var _0x4af97c=0x0;_0x4af97c<_0x48fdc4[_0x51c5('0x68')][_0x51c5('0x39')];_0x4af97c+=0x1){let _0x2acc23=_0x48fdc4[_0x51c5('0x68')][_0x4af97c];var _0x188fa1=_0x2cb550[_0x51c5('0x7d')]();_0x188fa1[_0x51c5('0x3d')]('ut.UserId\x20=\x20?',_0x2acc23['id']);_0x418a0f['push'](db[_0x51c5('0x6d')][_0x51c5('0x35')](_0x188fa1[_0x51c5('0x7e')](),{'type':db[_0x51c5('0x6d')][_0x51c5('0x7f')][_0x51c5('0x80')]})['then'](function(_0x590828){if(_0x590828[_0x51c5('0x39')]===0x1){return _0x2acc23['id'];}else{var _0x174689=_[_0x51c5('0x81')](_[_0x51c5('0x42')](_0x590828,_0x51c5('0x82')),function(_0x56a6d2){return _[_0x51c5('0x83')](_0x2cbb7c,_0x56a6d2);});if(_0x174689){return _0x2acc23['id'];}}}));}}return BPromise[_0x51c5('0x84')](_0x418a0f)[_0x51c5('0x27')](function(_0x22eeac){_0x192b74=_(_0x192b74)[_0x51c5('0x85')](_0x22eeac)[_0x51c5('0x86')]()[_0x51c5('0x87')]();return db[_0x51c5('0x2f')]['find']({'where':{'id':_0x374b18[_0x51c5('0x4b')]['id']}})[_0x51c5('0x27')](function(_0x3615cd){return db[_0x51c5('0x6d')]['transaction'](function(_0x4e491e){return _0x3615cd['removeTeams'](_0x374b18[_0x51c5('0x35')][_0x51c5('0x66')],{'transaction':_0x4e491e})['then'](function(){if(!_[_0x51c5('0x88')](_0x192b74)){return _0x3615cd[_0x51c5('0x89')](_0x192b74,{'transaction':_0x4e491e});}})[_0x51c5('0x27')](function(){_0x192b74['forEach'](function(_0xb1e6f8){socket[_0x51c5('0x71')](_0x51c5('0x8a'),{'UserId':_0xb1e6f8,'ChatQueueId':_0x3615cd['id']});});});});});});})[_0x51c5('0x27')](respondWithStatusCode(_0x3d83f6,null))[_0x51c5('0x49')](handleError(_0x3d83f6,null));};exports[_0x51c5('0x8b')]=function(_0x30521a,_0x2d80ad,_0xa0d121){return db[_0x51c5('0x2f')][_0x51c5('0x4d')]({'where':{'id':_0x30521a[_0x51c5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2d80ad,null))[_0x51c5('0x27')](function(_0x6e7d8c){if(_0x6e7d8c){return _0x6e7d8c[_0x51c5('0x8b')](_0x30521a[_0x51c5('0x4f')][_0x51c5('0x66')],_[_0x51c5('0x8c')](_0x30521a[_0x51c5('0x4f')],[_0x51c5('0x66'),'id'])||{})[_0x51c5('0x8d')](function(_0x4a439a){for(var _0x4cc630=0x0;_0x4cc630<_0x30521a[_0x51c5('0x4f')]['ids'][_0x51c5('0x39')];_0x4cc630+=0x1){socket[_0x51c5('0x71')](_0x51c5('0x72'),{'UserId':Number(_0x30521a[_0x51c5('0x4f')]['ids'][_0x4cc630]),'ChatQueueId':Number(_0x30521a[_0x51c5('0x4b')]['id'])});}return _0x4a439a;});}})['then'](respondWithResult(_0x2d80ad,null))[_0x51c5('0x49')](handleError(_0x2d80ad,null));};exports[_0x51c5('0x89')]=function(_0x19adb0,_0x597e07,_0x4e7507){return db[_0x51c5('0x2f')][_0x51c5('0x4d')]({'where':{'id':_0x19adb0[_0x51c5('0x4b')]['id']}})[_0x51c5('0x27')](handleEntityNotFound(_0x597e07,null))['then'](function(_0x2e75e2){if(_0x2e75e2){return _0x2e75e2['removeAgents'](_0x19adb0[_0x51c5('0x35')][_0x51c5('0x66')])[_0x51c5('0x27')](function(){if(_['isArray'](_0x19adb0['query'][_0x51c5('0x66')])){for(var _0x4c5b30=0x0;_0x4c5b30<_0x19adb0['query'][_0x51c5('0x66')][_0x51c5('0x39')];_0x4c5b30+=0x1){socket['emit'](_0x51c5('0x8a'),{'UserId':Number(_0x19adb0[_0x51c5('0x35')][_0x51c5('0x66')][_0x4c5b30]),'ChatQueueId':Number(_0x19adb0[_0x51c5('0x4b')]['id'])});}}else{socket['emit'](_0x51c5('0x8a'),{'UserId':Number(_0x19adb0[_0x51c5('0x35')][_0x51c5('0x66')]),'ChatQueueId':Number(_0x19adb0[_0x51c5('0x4b')]['id'])});}});}})[_0x51c5('0x27')](respondWithStatusCode(_0x597e07,null))[_0x51c5('0x49')](handleError(_0x597e07,null));};exports[_0x51c5('0x8e')]=function(_0x203cf2,_0x51fb36,_0x17d59d){var _0x5368af={};var _0x7598ac={};var _0x2b3192;var _0x431463;return db[_0x51c5('0x2f')][_0x51c5('0x58')]({'where':{'id':_0x203cf2[_0x51c5('0x4b')]['id']}})[_0x51c5('0x27')](handleEntityNotFound(_0x51fb36,null))[_0x51c5('0x27')](function(_0x412b54){if(_0x412b54){_0x2b3192=_0x412b54;_0x7598ac[_0x51c5('0x34')]=_[_0x51c5('0x36')](db[_0x51c5('0x5c')][_0x51c5('0x30')]);_0x7598ac[_0x51c5('0x35')]=_[_0x51c5('0x36')](_0x203cf2['query']);_0x7598ac[_0x51c5('0x3e')]=_[_0x51c5('0x37')](_0x7598ac[_0x51c5('0x34')],_0x7598ac[_0x51c5('0x35')]);_0x5368af[_0x51c5('0x38')]=_['intersection'](_0x7598ac[_0x51c5('0x34')],qs['fields'](_0x203cf2[_0x51c5('0x35')][_0x51c5('0x4c')]));_0x5368af[_0x51c5('0x38')]=_0x5368af['attributes'][_0x51c5('0x39')]?_0x5368af['attributes']:_0x7598ac[_0x51c5('0x34')];_0x5368af[_0x51c5('0x3b')]=qs[_0x51c5('0x3c')](_0x203cf2['query'][_0x51c5('0x3c')]);_0x5368af[_0x51c5('0x3d')]=qs[_0x51c5('0x3e')](_[_0x51c5('0x3f')](_0x203cf2['query'],_0x7598ac[_0x51c5('0x3e')]));if(_0x203cf2[_0x51c5('0x35')][_0x51c5('0x40')]){_0x5368af[_0x51c5('0x3d')]=_['merge'](_0x5368af[_0x51c5('0x3d')],{'$or':_[_0x51c5('0x42')](_0x5368af[_0x51c5('0x38')],function(_0x13733d){var _0x32797b={};_0x32797b[_0x13733d]={'$like':'%'+_0x203cf2[_0x51c5('0x35')][_0x51c5('0x40')]+'%'};return _0x32797b;})});}_0x5368af=_[_0x51c5('0x41')]({},_0x5368af,_0x203cf2[_0x51c5('0x44')]);return _0x2b3192[_0x51c5('0x8e')](_0x5368af);}})[_0x51c5('0x27')](function(_0x42d28f){if(_0x42d28f){_0x431463=_0x42d28f[_0x51c5('0x39')];if(!_0x203cf2[_0x51c5('0x35')][_0x51c5('0x5a')](_0x51c5('0x3a'))){_0x5368af['limit']=qs[_0x51c5('0x22')](_0x203cf2[_0x51c5('0x35')][_0x51c5('0x22')]);_0x5368af[_0x51c5('0x20')]=qs['offset'](_0x203cf2[_0x51c5('0x35')][_0x51c5('0x20')]);}return _0x2b3192['getAgents'](_0x5368af);}})[_0x51c5('0x27')](function(_0x5a04a9){if(_0x5a04a9){return _0x5a04a9?{'count':_0x431463,'rows':_0x5a04a9}:null;}})['then'](respondWithResult(_0x51fb36,null))[_0x51c5('0x49')](handleError(_0x51fb36,null));};
\ No newline at end of file
+var _0x1053=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','destroy','params','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','pick','ChatQueueId','User','UserId','agent','chatPause','updatedAt','format','SIP','getTeams','addTeams','ids','Team','online','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','emit','removeTeams','field','tq.TeamId','from','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','clone','push','sequelize','toString','QueryTypes','SELECT','every','includes','all','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','get','ChatQueues','UserProfileResource','sendStatus','stack','name','send','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','includeAll','include','findAll','rows','show','keys','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x1053,0x163));var _0x3105=function(_0x51d99b,_0x40f96f){_0x51d99b=_0x51d99b-0x0;var _0x359a78=_0x1053[_0x51d99b];return _0x359a78;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3105('0x0'));var zipdir=require(_0x3105('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3105('0x2'));var moment=require(_0x3105('0x3'));var BPromise=require(_0x3105('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3105('0x5'));var sox=require(_0x3105('0x6'));var csv=require(_0x3105('0x7'));var ejs=require(_0x3105('0x8'));var fs=require('fs');var fs_extra=require(_0x3105('0x9'));var _=require(_0x3105('0xa'));var squel=require(_0x3105('0xb'));var crypto=require(_0x3105('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3105('0xd'));var toCsv=require(_0x3105('0x7'));var querystring=require(_0x3105('0xe'));var Papa=require(_0x3105('0xf'));var Redis=require(_0x3105('0x10'));var authService=require(_0x3105('0x11'));var qs=require(_0x3105('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3105('0x13'));var logger=require(_0x3105('0x14'))(_0x3105('0x15'));var utils=require(_0x3105('0x16'));var config=require(_0x3105('0x17'));var licenseUtil=require(_0x3105('0x18'));var db=require(_0x3105('0x19'))['db'];config[_0x3105('0x1a')]=_['defaults'](config[_0x3105('0x1a')],{'host':_0x3105('0x1b'),'port':0x18eb});var socket=require(_0x3105('0x1c'))(new Redis(config[_0x3105('0x1a')]));require(_0x3105('0x1d'))['register'](socket);var jayson=require(_0x3105('0x1e'));var client=jayson[_0x3105('0x1f')][_0x3105('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x45fd2c,_0xf7428,_0x4cc8c5,_0x57e4bc){return new BPromise(function(_0x3ba8c1,_0x190896){var _0x5039af=_0x57e4bc||client;return _0x5039af['request'](_0x45fd2c,_0x4cc8c5)[_0x3105('0x21')](function(_0x41a4bc){logger[_0x3105('0x22')](_0x3105('0x23'),_0xf7428,'request\x20sent');logger[_0x3105('0x24')](_0x3105('0x25'),_0xf7428,_0x3105('0x26'),JSON[_0x3105('0x27')](_0x41a4bc));if(_0x41a4bc[_0x3105('0x28')]){if(_0x41a4bc[_0x3105('0x28')][_0x3105('0x29')]===0x1f4){logger[_0x3105('0x28')](_0x3105('0x23'),_0xf7428,_0x41a4bc[_0x3105('0x28')][_0x3105('0x2a')]);return _0x190896(_0x41a4bc['error']['message']);}logger[_0x3105('0x28')](_0x3105('0x23'),_0xf7428,_0x41a4bc[_0x3105('0x28')]['message']);return _0x3ba8c1(_0x41a4bc[_0x3105('0x28')][_0x3105('0x2a')]);}else{logger[_0x3105('0x22')](_0x3105('0x23'),_0xf7428,_0x3105('0x26'));_0x3ba8c1(_0x41a4bc['result'][_0x3105('0x2a')]);}})[_0x3105('0x2b')](function(_0x27462c){logger[_0x3105('0x28')](_0x3105('0x23'),_0xf7428,_0x27462c);_0x190896(_0x27462c);});});}function respondWithStatusCode(_0x5c52b4,_0x5eac47){_0x5eac47=_0x5eac47||0xcc;return function(_0x335973){if(_0x335973){return _0x5c52b4['sendStatus'](_0x5eac47);}return _0x5c52b4[_0x3105('0x2c')](_0x5eac47)[_0x3105('0x2d')]();};}function respondWithResult(_0x5e2c79,_0x1eb493){_0x1eb493=_0x1eb493||0xc8;return function(_0x55752e){if(_0x55752e){return _0x5e2c79['status'](_0x1eb493)[_0x3105('0x2e')](_0x55752e);}};}function respondWithFilteredResult(_0x24e7ab,_0xbda9f){return function(_0xb75b03){if(_0xb75b03){var _0x33625a=typeof _0xbda9f[_0x3105('0x2f')]===_0x3105('0x30')&&typeof _0xbda9f[_0x3105('0x31')]===_0x3105('0x30');var _0x156539=_0xb75b03[_0x3105('0x32')];var _0x401593=_0x33625a?0x0:_0xbda9f[_0x3105('0x2f')];var _0x19dbb4=_0x33625a?_0xb75b03[_0x3105('0x32')]:_0xbda9f[_0x3105('0x2f')]+_0xbda9f['limit'];var _0x5781bf;if(_0x19dbb4>=_0x156539){_0x19dbb4=_0x156539;_0x5781bf=0xc8;}else{_0x5781bf=0xce;}_0x24e7ab[_0x3105('0x2c')](_0x5781bf);return _0x24e7ab[_0x3105('0x33')](_0x3105('0x34'),_0x401593+'-'+_0x19dbb4+'/'+_0x156539)[_0x3105('0x2e')](_0xb75b03);}return null;};}function patchUpdates(_0x30b306){return function(_0x44ef1c){try{jsonpatch[_0x3105('0x35')](_0x44ef1c,_0x30b306,!![]);}catch(_0x8e7f31){return BPromise[_0x3105('0x36')](_0x8e7f31);}return _0x44ef1c['save']();};}function saveUpdates(_0x464bdd,_0x117bf9){return function(_0x476f19){if(_0x476f19){return _0x476f19['update'](_0x464bdd)[_0x3105('0x21')](function(_0x2b5e1d){return _0x2b5e1d;});}return null;};}function removeEntity(_0x137ab5,_0x539869){return function(_0x3f5cee){if(_0x3f5cee){return _0x3f5cee['destroy']()[_0x3105('0x21')](function(){var _0x4b7b24=_0x3f5cee[_0x3105('0x37')]({'plain':!![]});var _0x255a8e=_0x3105('0x38');return db[_0x3105('0x39')]['destroy']({'where':{'type':_0x255a8e,'resourceId':_0x4b7b24['id']}})[_0x3105('0x21')](function(){return _0x3f5cee;});})[_0x3105('0x21')](function(){_0x137ab5[_0x3105('0x2c')](0xcc)[_0x3105('0x2d')]();});}};}function handleEntityNotFound(_0x4e1b1f,_0x20ae2a){return function(_0x41e4d8){if(!_0x41e4d8){_0x4e1b1f[_0x3105('0x3a')](0x194);}return _0x41e4d8;};}function handleError(_0x1da3a8,_0x4434fc){_0x4434fc=_0x4434fc||0x1f4;return function(_0x34a05a){logger['error'](_0x34a05a[_0x3105('0x3b')]);if(_0x34a05a[_0x3105('0x3c')]){delete _0x34a05a[_0x3105('0x3c')];}_0x1da3a8['status'](_0x4434fc)[_0x3105('0x3d')](_0x34a05a);};}exports['index']=function(_0x22c95c,_0x141fd2){var _0x338376={},_0x26283c={},_0x56e965={'count':0x0,'rows':[]};var _0x1274d1=_[_0x3105('0x3e')](db[_0x3105('0x3f')][_0x3105('0x40')],function(_0x47b509){return{'name':_0x47b509[_0x3105('0x41')],'type':_0x47b509[_0x3105('0x42')][_0x3105('0x43')]};});_0x26283c[_0x3105('0x44')]=_['map'](_0x1274d1,_0x3105('0x3c'));_0x26283c['query']=_['keys'](_0x22c95c[_0x3105('0x45')]);_0x26283c[_0x3105('0x46')]=_[_0x3105('0x47')](_0x26283c[_0x3105('0x44')],_0x26283c[_0x3105('0x45')]);_0x338376[_0x3105('0x48')]=_[_0x3105('0x47')](_0x26283c['model'],qs[_0x3105('0x49')](_0x22c95c[_0x3105('0x45')]['fields']));_0x338376['attributes']=_0x338376[_0x3105('0x48')][_0x3105('0x4a')]?_0x338376[_0x3105('0x48')]:_0x26283c[_0x3105('0x44')];if(!_0x22c95c[_0x3105('0x45')]['hasOwnProperty'](_0x3105('0x4b'))){_0x338376['limit']=qs['limit'](_0x22c95c[_0x3105('0x45')][_0x3105('0x31')]);_0x338376[_0x3105('0x2f')]=qs[_0x3105('0x2f')](_0x22c95c[_0x3105('0x45')][_0x3105('0x2f')]);}_0x338376[_0x3105('0x4c')]=qs[_0x3105('0x4d')](_0x22c95c[_0x3105('0x45')][_0x3105('0x4d')]);_0x338376[_0x3105('0x4e')]=qs[_0x3105('0x46')](_['pick'](_0x22c95c['query'],_0x26283c[_0x3105('0x46')]),_0x1274d1);if(_0x22c95c[_0x3105('0x45')][_0x3105('0x4f')]){_0x338376[_0x3105('0x4e')]=_['merge'](_0x338376[_0x3105('0x4e')],{'$or':_['map'](_0x1274d1,function(_0x1ae4f0){if(_0x1ae4f0['type']!=='VIRTUAL'){var _0x497bfa={};_0x497bfa[_0x1ae4f0[_0x3105('0x3c')]]={'$like':'%'+_0x22c95c[_0x3105('0x45')][_0x3105('0x4f')]+'%'};return _0x497bfa;}})});}_0x338376=_['merge']({},_0x338376,_0x22c95c['options']);var _0x38f790={'where':_0x338376[_0x3105('0x4e')]};return db[_0x3105('0x3f')][_0x3105('0x32')](_0x38f790)[_0x3105('0x21')](function(_0x10f425){_0x56e965[_0x3105('0x32')]=_0x10f425;if(_0x22c95c[_0x3105('0x45')][_0x3105('0x50')]){_0x338376[_0x3105('0x51')]=[{'all':!![]}];}return db[_0x3105('0x3f')][_0x3105('0x52')](_0x338376);})[_0x3105('0x21')](function(_0x4204fe){_0x56e965[_0x3105('0x53')]=_0x4204fe;return _0x56e965;})[_0x3105('0x21')](respondWithFilteredResult(_0x141fd2,_0x338376))['catch'](handleError(_0x141fd2,null));};exports[_0x3105('0x54')]=function(_0x38fea5,_0x3fdccd){var _0x4e5ca9={'raw':!![],'where':{'id':_0x38fea5['params']['id']}},_0x345f32={};_0x345f32[_0x3105('0x44')]=_[_0x3105('0x55')](db[_0x3105('0x3f')][_0x3105('0x40')]);_0x345f32[_0x3105('0x45')]=_['keys'](_0x38fea5[_0x3105('0x45')]);_0x345f32[_0x3105('0x46')]=_['intersection'](_0x345f32['model'],_0x345f32['query']);_0x4e5ca9[_0x3105('0x48')]=_[_0x3105('0x47')](_0x345f32[_0x3105('0x44')],qs[_0x3105('0x49')](_0x38fea5[_0x3105('0x45')][_0x3105('0x49')]));_0x4e5ca9[_0x3105('0x48')]=_0x4e5ca9['attributes'][_0x3105('0x4a')]?_0x4e5ca9[_0x3105('0x48')]:_0x345f32[_0x3105('0x44')];if(_0x38fea5['query'][_0x3105('0x50')]){_0x4e5ca9[_0x3105('0x51')]=[{'all':!![]}];}_0x4e5ca9=_[_0x3105('0x56')]({},_0x4e5ca9,_0x38fea5[_0x3105('0x57')]);return db[_0x3105('0x3f')][_0x3105('0x58')](_0x4e5ca9)[_0x3105('0x21')](handleEntityNotFound(_0x3fdccd,null))['then'](respondWithResult(_0x3fdccd,null))[_0x3105('0x2b')](handleError(_0x3fdccd,null));};exports[_0x3105('0x59')]=function(_0x2ffff7,_0x5493e2){return db[_0x3105('0x3f')]['create'](_0x2ffff7['body'],{})[_0x3105('0x21')](function(_0x3bbb2f){var _0x589039=_0x2ffff7[_0x3105('0x5a')][_0x3105('0x37')]({'plain':!![]});if(!_0x589039)throw new Error(_0x3105('0x5b'));if(_0x589039[_0x3105('0x5c')]===_0x3105('0x5a')){var _0x3bf7eb=_0x3bbb2f[_0x3105('0x37')]({'plain':!![]});var _0x325f19=_0x3105('0x38');return db[_0x3105('0x5d')]['find']({'where':{'name':_0x325f19,'userProfileId':_0x589039['userProfileId']},'raw':!![]})[_0x3105('0x21')](function(_0x472a03){if(_0x472a03&&_0x472a03[_0x3105('0x5e')]===0x0){return db[_0x3105('0x39')][_0x3105('0x59')]({'name':_0x3bf7eb[_0x3105('0x3c')],'resourceId':_0x3bf7eb['id'],'type':_0x472a03['name'],'sectionId':_0x472a03['id']},{})[_0x3105('0x21')](function(){return _0x3bbb2f;});}else{return _0x3bbb2f;}})['catch'](function(_0x779b48){logger[_0x3105('0x28')](_0x3105('0x5f'),_0x779b48);throw _0x779b48;});}return _0x3bbb2f;})['then'](respondWithResult(_0x5493e2,0xc9))['catch'](handleError(_0x5493e2,null));};exports[_0x3105('0x60')]=function(_0x5c8f6c,_0x1d1735){if(_0x5c8f6c['body']['id']){delete _0x5c8f6c['body']['id'];}return db[_0x3105('0x3f')][_0x3105('0x58')]({'where':{'id':_0x5c8f6c['params']['id']}})['then'](handleEntityNotFound(_0x1d1735,null))[_0x3105('0x21')](saveUpdates(_0x5c8f6c[_0x3105('0x61')],null))['then'](respondWithResult(_0x1d1735,null))[_0x3105('0x2b')](handleError(_0x1d1735,null));};exports[_0x3105('0x62')]=function(_0x3f3143,_0x237f26){return db['ChatQueue'][_0x3105('0x58')]({'where':{'id':_0x3f3143[_0x3105('0x63')]['id']}})[_0x3105('0x21')](handleEntityNotFound(_0x237f26,null))['then'](removeEntity(_0x237f26,null))[_0x3105('0x2b')](handleError(_0x237f26,null));};exports[_0x3105('0x64')]=function(_0x44c97f,_0x4d97e2){return db[_0x3105('0x3f')]['describe']()['then'](respondWithResult(_0x4d97e2,null))['catch'](handleError(_0x4d97e2,null));};exports[_0x3105('0x65')]=function(_0x4907f8,_0x1cf24d,_0x805f17){var _0x46d987={'raw':!![],'where':{}},_0x399e0a={},_0x426634;return db[_0x3105('0x3f')][_0x3105('0x66')]({'where':{'id':_0x4907f8[_0x3105('0x63')]['id']}})['then'](handleEntityNotFound(_0x1cf24d,null))[_0x3105('0x21')](function(_0x297b1e){if(_0x297b1e){_0x426634=_0x297b1e[_0x3105('0x37')]({'plain':!![]});_0x399e0a[_0x3105('0x44')]=_[_0x3105('0x55')](db[_0x3105('0x67')][_0x3105('0x40')]);_0x399e0a['query']=_[_0x3105('0x55')](_0x4907f8[_0x3105('0x45')]);_0x399e0a[_0x3105('0x46')]=_[_0x3105('0x47')](_0x399e0a[_0x3105('0x44')],_0x399e0a['query']);_0x46d987['attributes']=_[_0x3105('0x47')](_0x399e0a[_0x3105('0x44')],qs[_0x3105('0x49')](_0x4907f8['query']['fields']));_0x46d987['attributes']=_0x46d987[_0x3105('0x48')][_0x3105('0x4a')]?_0x46d987[_0x3105('0x48')]:_0x399e0a[_0x3105('0x44')];if(!_0x4907f8[_0x3105('0x45')][_0x3105('0x68')](_0x3105('0x4b'))){_0x46d987[_0x3105('0x31')]=qs[_0x3105('0x31')](_0x4907f8['query'][_0x3105('0x31')]);_0x46d987['offset']=qs[_0x3105('0x2f')](_0x4907f8[_0x3105('0x45')][_0x3105('0x2f')]);}_0x46d987[_0x3105('0x4c')]=qs['sort'](_0x4907f8[_0x3105('0x45')][_0x3105('0x4d')]);_0x46d987['where']=qs[_0x3105('0x46')](_[_0x3105('0x69')](_0x4907f8[_0x3105('0x45')],_0x399e0a['filters']));_0x46d987[_0x3105('0x4e')][_0x3105('0x6a')]=_0x297b1e['id'];if(_0x4907f8[_0x3105('0x45')][_0x3105('0x4f')]){_0x46d987[_0x3105('0x4e')]=_[_0x3105('0x56')](_0x46d987[_0x3105('0x4e')],{'$or':_[_0x3105('0x3e')](_0x46d987[_0x3105('0x48')],function(_0x446ecc){var _0x9e7524={};_0x9e7524[_0x446ecc]={'$like':'%'+_0x4907f8[_0x3105('0x45')]['filter']+'%'};return _0x9e7524;})});}_0x46d987=_['merge']({},_0x46d987,_0x4907f8[_0x3105('0x57')]);return db[_0x3105('0x67')]['findAll'](_0x46d987);}})[_0x3105('0x21')](function(_0x18bf2c){if(_0x18bf2c){return db[_0x3105('0x6b')]['findAndCountAll']({'where':{'id':_[_0x3105('0x3e')](_0x18bf2c,_0x3105('0x6c')),'role':_0x3105('0x6d')},'attributes':['id',_0x3105('0x3c'),_0x3105('0x6e'),_0x3105('0x6f'),'createdAt']});}})[_0x3105('0x21')](function(_0x4d0931){if(_0x4d0931){return{'count':_0x4d0931['count'],'rows':_[_0x3105('0x3e')](_0x4d0931['rows'],function(_0x340bf7){return{'membername':_0x340bf7[_0x3105('0x3c')],'UserId':_0x340bf7['id'],'queue_name':_0x426634[_0x3105('0x3c')],'ChatQueueId':_0x426634['id'],'interface':util[_0x3105('0x70')]('%s/%s',_0x3105('0x71'),_0x340bf7[_0x3105('0x3c')]),'penalty':0x0,'paused':_0x340bf7[_0x3105('0x6e')],'createdAt':_0x340bf7['createdAt'],'updatedAt':_0x340bf7[_0x3105('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3105('0x21')](respondWithFilteredResult(_0x1cf24d,_0x46d987))[_0x3105('0x2b')](handleError(_0x1cf24d,null));};exports[_0x3105('0x72')]=function(_0x37352e,_0x28afb1,_0x4d7566){var _0x8a0444={};var _0xb55fdb={};var _0x30316f;var _0x2d70f3;return db[_0x3105('0x3f')][_0x3105('0x66')]({'where':{'id':_0x37352e[_0x3105('0x63')]['id']}})[_0x3105('0x21')](handleEntityNotFound(_0x28afb1,null))[_0x3105('0x21')](function(_0x32cc80){if(_0x32cc80){_0x30316f=_0x32cc80;_0xb55fdb[_0x3105('0x44')]=_['keys'](db['Team'][_0x3105('0x40')]);_0xb55fdb['query']=_['keys'](_0x37352e[_0x3105('0x45')]);_0xb55fdb[_0x3105('0x46')]=_[_0x3105('0x47')](_0xb55fdb[_0x3105('0x44')],_0xb55fdb[_0x3105('0x45')]);_0x8a0444[_0x3105('0x48')]=_[_0x3105('0x47')](_0xb55fdb['model'],qs['fields'](_0x37352e['query'][_0x3105('0x49')]));_0x8a0444[_0x3105('0x48')]=_0x8a0444[_0x3105('0x48')]['length']?_0x8a0444[_0x3105('0x48')]:_0xb55fdb['model'];_0x8a0444[_0x3105('0x4c')]=qs[_0x3105('0x4d')](_0x37352e[_0x3105('0x45')][_0x3105('0x4d')]);_0x8a0444[_0x3105('0x4e')]=qs['filters'](_['pick'](_0x37352e[_0x3105('0x45')],_0xb55fdb[_0x3105('0x46')]));if(_0x37352e[_0x3105('0x45')]['filter']){_0x8a0444[_0x3105('0x4e')]=_[_0x3105('0x56')](_0x8a0444[_0x3105('0x4e')],{'$or':_['map'](_0x8a0444[_0x3105('0x48')],function(_0xcec602){var _0x2e992b={};_0x2e992b[_0xcec602]={'$like':'%'+_0x37352e[_0x3105('0x45')]['filter']+'%'};return _0x2e992b;})});}_0x8a0444=_[_0x3105('0x56')]({},_0x8a0444,_0x37352e['options']);return _0x30316f[_0x3105('0x72')](_0x8a0444);}})[_0x3105('0x21')](function(_0x5aa869){if(_0x5aa869){_0x2d70f3=_0x5aa869[_0x3105('0x4a')];if(!_0x37352e[_0x3105('0x45')][_0x3105('0x68')](_0x3105('0x4b'))){_0x8a0444[_0x3105('0x31')]=qs['limit'](_0x37352e[_0x3105('0x45')]['limit']);_0x8a0444[_0x3105('0x2f')]=qs[_0x3105('0x2f')](_0x37352e[_0x3105('0x45')]['offset']);}return _0x30316f[_0x3105('0x72')](_0x8a0444);}})[_0x3105('0x21')](function(_0x109a05){if(_0x109a05){return _0x109a05?{'count':_0x2d70f3,'rows':_0x109a05}:null;}})[_0x3105('0x21')](respondWithResult(_0x28afb1,null))[_0x3105('0x2b')](handleError(_0x28afb1,null));};exports[_0x3105('0x73')]=function(_0x59f5db,_0x518897,_0x7a66a6){var _0x2091ff=_0x59f5db['body'][_0x3105('0x74')];return db[_0x3105('0x75')][_0x3105('0x52')]({'where':{'id':_0x2091ff},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x3105('0x76'),_0x3105('0x77'),_0x3105('0x78')],'raw':!![]}]})[_0x3105('0x21')](function(_0x3b3a82){if(_0x3b3a82){var _0x510218=_[_0x3105('0x79')](_0x3b3a82,function(_0xf19676){var _0x46e742=_0xf19676['get']({'plain':!![]});return _0x46e742[_0x3105('0x7a')];});return db[_0x3105('0x3f')][_0x3105('0x58')]({'where':{'id':_0x59f5db[_0x3105('0x63')]['id']}})['then'](function(_0x533de0){return db['sequelize'][_0x3105('0x7b')](function(_0x2b1524){return _0x533de0[_0x3105('0x73')](_0x2091ff,{'transaction':_0x2b1524})['then'](function(){return BPromise[_0x3105('0x7c')](_0x510218,function(_0x1df23e){return db['UserChatQueue'][_0x3105('0x7d')]({'where':{'UserId':_0x1df23e['id'],'ChatQueueId':_0x59f5db[_0x3105('0x63')]['id']},'transaction':_0x2b1524});});})[_0x3105('0x21')](function(){_0x510218[_0x3105('0x7e')](function(_0x2c3bd5){socket[_0x3105('0x7f')]('userChatQueue:save',{'UserId':_0x2c3bd5['id'],'ChatQueueId':_0x533de0['id']});});});});});}})[_0x3105('0x21')](respondWithStatusCode(_0x518897,null))['catch'](handleError(_0x518897,null));};exports[_0x3105('0x80')]=function(_0x3c9622,_0x2fb1ea,_0x43c32f){return db[_0x3105('0x75')][_0x3105('0x52')]({'where':{'id':_0x3c9622[_0x3105('0x45')]['ids']},'attributes':['id'],'include':[{'model':db[_0x3105('0x6b')],'as':_0x3105('0x7a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2fb1ea,null))[_0x3105('0x21')](function(_0x58f676){var _0x28a718=_[_0x3105('0x3e')](_0x58f676,'id');var _0x529c3d=[];var _0x4726a8=[];var _0x2e62f3=squel['select']();_0x2e62f3[_0x3105('0x81')](_0x3105('0x82'))[_0x3105('0x83')](_0x3105('0x84'),'tq')['join']('user_has_teams','ut',_0x3105('0x85'))[_0x3105('0x4e')]('ChatQueueId\x20=\x20?',_0x3c9622['params']['id']);for(var _0x3167c6=0x0;_0x3167c6<_0x58f676[_0x3105('0x4a')];_0x3167c6+=0x1){let _0x51065c=_0x58f676[_0x3167c6];for(var _0x30a26a=0x0;_0x30a26a<_0x51065c['Agents']['length'];_0x30a26a+=0x1){let _0x37f2d0=_0x51065c[_0x3105('0x7a')][_0x30a26a];var _0x236155=_0x2e62f3[_0x3105('0x86')]();_0x236155['where']('ut.UserId\x20=\x20?',_0x37f2d0['id']);_0x4726a8[_0x3105('0x87')](db[_0x3105('0x88')][_0x3105('0x45')](_0x236155[_0x3105('0x89')](),{'type':db[_0x3105('0x88')][_0x3105('0x8a')][_0x3105('0x8b')]})['then'](function(_0x308de7){if(_0x308de7[_0x3105('0x4a')]===0x1){return _0x37f2d0['id'];}else{var _0x52ad00=_[_0x3105('0x8c')](_[_0x3105('0x3e')](_0x308de7,'TeamId'),function(_0x58a36d){return _[_0x3105('0x8d')](_0x28a718,_0x58a36d);});if(_0x52ad00){return _0x37f2d0['id'];}}}));}}return BPromise[_0x3105('0x8e')](_0x4726a8)[_0x3105('0x21')](function(_0x3b61d3){_0x529c3d=_(_0x529c3d)['union'](_0x3b61d3)['compact']()[_0x3105('0x8f')]();return db['ChatQueue'][_0x3105('0x58')]({'where':{'id':_0x3c9622[_0x3105('0x63')]['id']}})[_0x3105('0x21')](function(_0x4097d4){return db['sequelize'][_0x3105('0x7b')](function(_0x3be1ab){return _0x4097d4[_0x3105('0x80')](_0x3c9622[_0x3105('0x45')][_0x3105('0x74')],{'transaction':_0x3be1ab})[_0x3105('0x21')](function(){if(!_[_0x3105('0x90')](_0x529c3d)){return _0x4097d4[_0x3105('0x91')](_0x529c3d,{'transaction':_0x3be1ab});}})[_0x3105('0x21')](function(){_0x529c3d[_0x3105('0x7e')](function(_0x576a22){socket['emit'](_0x3105('0x92'),{'UserId':_0x576a22,'ChatQueueId':_0x4097d4['id']});});});});});});})[_0x3105('0x21')](respondWithStatusCode(_0x2fb1ea,null))['catch'](handleError(_0x2fb1ea,null));};exports[_0x3105('0x93')]=function(_0x7da054,_0x48cfe5,_0x1c4c66){return db[_0x3105('0x3f')][_0x3105('0x58')]({'where':{'id':_0x7da054[_0x3105('0x63')]['id']}})['then'](handleEntityNotFound(_0x48cfe5,null))['then'](function(_0x1a2695){if(_0x1a2695){return _0x1a2695[_0x3105('0x93')](_0x7da054[_0x3105('0x61')][_0x3105('0x74')],_['omit'](_0x7da054[_0x3105('0x61')],[_0x3105('0x74'),'id'])||{})[_0x3105('0x94')](function(_0x401364){for(var _0x22da98=0x0;_0x22da98<_0x7da054[_0x3105('0x61')]['ids'][_0x3105('0x4a')];_0x22da98+=0x1){socket[_0x3105('0x7f')]('userChatQueue:save',{'UserId':Number(_0x7da054[_0x3105('0x61')][_0x3105('0x74')][_0x22da98]),'ChatQueueId':Number(_0x7da054['params']['id'])});}return _0x401364;});}})[_0x3105('0x21')](respondWithResult(_0x48cfe5,null))[_0x3105('0x2b')](handleError(_0x48cfe5,null));};exports[_0x3105('0x91')]=function(_0x4c7c0c,_0x4ae6e9,_0x53d324){return db['ChatQueue'][_0x3105('0x58')]({'where':{'id':_0x4c7c0c['params']['id']}})['then'](handleEntityNotFound(_0x4ae6e9,null))['then'](function(_0x46dd59){if(_0x46dd59){return _0x46dd59[_0x3105('0x91')](_0x4c7c0c[_0x3105('0x45')][_0x3105('0x74')])[_0x3105('0x21')](function(){if(_['isArray'](_0x4c7c0c['query']['ids'])){for(var _0x2a1ed6=0x0;_0x2a1ed6<_0x4c7c0c[_0x3105('0x45')][_0x3105('0x74')][_0x3105('0x4a')];_0x2a1ed6+=0x1){socket[_0x3105('0x7f')](_0x3105('0x92'),{'UserId':Number(_0x4c7c0c[_0x3105('0x45')][_0x3105('0x74')][_0x2a1ed6]),'ChatQueueId':Number(_0x4c7c0c[_0x3105('0x63')]['id'])});}}else{socket[_0x3105('0x7f')]('userChatQueue:remove',{'UserId':Number(_0x4c7c0c[_0x3105('0x45')]['ids']),'ChatQueueId':Number(_0x4c7c0c[_0x3105('0x63')]['id'])});}});}})[_0x3105('0x21')](respondWithStatusCode(_0x4ae6e9,null))[_0x3105('0x2b')](handleError(_0x4ae6e9,null));};exports[_0x3105('0x95')]=function(_0x567b3c,_0x16d2e9,_0x1712a1){var _0x46e9b9={};var _0x35c032={};var _0x261297;var _0x21221b;return db[_0x3105('0x3f')][_0x3105('0x66')]({'where':{'id':_0x567b3c['params']['id']}})[_0x3105('0x21')](handleEntityNotFound(_0x16d2e9,null))['then'](function(_0x203092){if(_0x203092){_0x261297=_0x203092;_0x35c032['model']=_[_0x3105('0x55')](db[_0x3105('0x6b')][_0x3105('0x40')]);_0x35c032['query']=_[_0x3105('0x55')](_0x567b3c[_0x3105('0x45')]);_0x35c032[_0x3105('0x46')]=_[_0x3105('0x47')](_0x35c032[_0x3105('0x44')],_0x35c032[_0x3105('0x45')]);_0x46e9b9['attributes']=_[_0x3105('0x47')](_0x35c032[_0x3105('0x44')],qs['fields'](_0x567b3c['query'][_0x3105('0x49')]));_0x46e9b9['attributes']=_0x46e9b9[_0x3105('0x48')][_0x3105('0x4a')]?_0x46e9b9[_0x3105('0x48')]:_0x35c032[_0x3105('0x44')];_0x46e9b9[_0x3105('0x4c')]=qs['sort'](_0x567b3c['query'][_0x3105('0x4d')]);_0x46e9b9['where']=qs['filters'](_[_0x3105('0x69')](_0x567b3c[_0x3105('0x45')],_0x35c032[_0x3105('0x46')]));if(_0x567b3c[_0x3105('0x45')][_0x3105('0x4f')]){_0x46e9b9[_0x3105('0x4e')]=_[_0x3105('0x56')](_0x46e9b9['where'],{'$or':_['map'](_0x46e9b9[_0x3105('0x48')],function(_0xdb9a3a){var _0x4c3f01={};_0x4c3f01[_0xdb9a3a]={'$like':'%'+_0x567b3c[_0x3105('0x45')]['filter']+'%'};return _0x4c3f01;})});}_0x46e9b9=_['merge']({},_0x46e9b9,_0x567b3c['options']);return _0x261297[_0x3105('0x95')](_0x46e9b9);}})[_0x3105('0x21')](function(_0x5bb221){if(_0x5bb221){_0x21221b=_0x5bb221['length'];if(!_0x567b3c[_0x3105('0x45')][_0x3105('0x68')](_0x3105('0x4b'))){_0x46e9b9[_0x3105('0x31')]=qs[_0x3105('0x31')](_0x567b3c[_0x3105('0x45')][_0x3105('0x31')]);_0x46e9b9[_0x3105('0x2f')]=qs['offset'](_0x567b3c[_0x3105('0x45')]['offset']);}return _0x261297[_0x3105('0x95')](_0x46e9b9);}})[_0x3105('0x21')](function(_0x1fb0ad){if(_0x1fb0ad){return _0x1fb0ad?{'count':_0x21221b,'rows':_0x1fb0ad}:null;}})[_0x3105('0x21')](respondWithResult(_0x16d2e9,null))[_0x3105('0x2b')](handleError(_0x16d2e9,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 755e53b..18df898 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 _0x0efb=['save','remove','emit','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0efb,0x16d));var _0xb0ef=function(_0x35b7d4,_0x5a5c43){_0x35b7d4=_0x35b7d4-0x0;var _0x4e8cee=_0x0efb[_0x35b7d4];return _0x4e8cee;};'use strict';var EventEmitter=require(_0xb0ef('0x0'));var ChatQueue=require(_0xb0ef('0x1'))['db'][_0xb0ef('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xb0ef('0x3')](0x0);var events={'afterCreate':_0xb0ef('0x4'),'afterUpdate':'update','afterDestroy':_0xb0ef('0x5')};function emitEvent(_0x5cd579){return function(_0xf2bc2f,_0x499b5f,_0x251257){ChatQueueEvents[_0xb0ef('0x6')](_0x5cd579+':'+_0xf2bc2f['id'],_0xf2bc2f);ChatQueueEvents[_0xb0ef('0x6')](_0x5cd579,_0xf2bc2f);_0x251257(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xb0ef('0x7')](e,emitEvent(event));}}module[_0xb0ef('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0x9ac8=['ChatQueue','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x247453,_0x33d99d){var _0x5dd474=function(_0x501a0e){while(--_0x501a0e){_0x247453['push'](_0x247453['shift']());}};_0x5dd474(++_0x33d99d);}(_0x9ac8,0x184));var _0x89ac=function(_0x2b22fc,_0x55e38c){_0x2b22fc=_0x2b22fc-0x0;var _0x542b07=_0x9ac8[_0x2b22fc];return _0x542b07;};'use strict';var EventEmitter=require(_0x89ac('0x0'));var ChatQueue=require(_0x89ac('0x1'))['db'][_0x89ac('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x89ac('0x3'),'afterUpdate':_0x89ac('0x4'),'afterDestroy':_0x89ac('0x5')};function emitEvent(_0x32a208){return function(_0x3eb597,_0x3d0aa8,_0x494d3f){ChatQueueEvents[_0x89ac('0x6')](_0x32a208+':'+_0x3eb597['id'],_0x3eb597);ChatQueueEvents[_0x89ac('0x6')](_0x32a208,_0x3eb597);_0x494d3f(null);};}for(var e in events){if(events[_0x89ac('0x7')](e)){var event=events[e];ChatQueue[_0x89ac('0x8')](e,emitEvent(event));}}module[_0x89ac('0x9')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 0d448dd..7adffaf 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 _0x0b2c=['bluebird','request-promise','rimraf','../../config/environment','./chatQueue.attributes','define','ChatQueue','lodash','api','moment'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x0b2c,0x101));var _0xc0b2=function(_0x415423,_0x3d8720){_0x415423=_0x415423-0x0;var _0x2b3362=_0x0b2c[_0x415423];return _0x2b3362;};'use strict';var _=require(_0xc0b2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc0b2('0x1'));var moment=require(_0xc0b2('0x2'));var BPromise=require(_0xc0b2('0x3'));var rp=require(_0xc0b2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc0b2('0x5'));var config=require(_0xc0b2('0x6'));var attributes=require(_0xc0b2('0x7'));module['exports']=function(_0x2be264,_0x36ab42){return _0x2be264[_0xc0b2('0x8')](_0xc0b2('0x9'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdbab=['chat_queues','lodash','util','../../config/logger','moment','rimraf','../../config/environment','exports','define','ChatQueue'];(function(_0x2730f5,_0x3395e1){var _0x45b1b0=function(_0x5ffdf7){while(--_0x5ffdf7){_0x2730f5['push'](_0x2730f5['shift']());}};_0x45b1b0(++_0x3395e1);}(_0xdbab,0x97));var _0xbdba=function(_0x283a81,_0x42f033){_0x283a81=_0x283a81-0x0;var _0x57533f=_0xdbab[_0x283a81];return _0x57533f;};'use strict';var _=require(_0xbdba('0x0'));var util=require(_0xbdba('0x1'));var logger=require(_0xbdba('0x2'))('api');var moment=require(_0xbdba('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbdba('0x4'));var config=require(_0xbdba('0x5'));var attributes=require('./chatQueue.attributes');module[_0xbdba('0x6')]=function(_0x3652ce,_0x32c965){return _0x3652ce[_0xbdba('0x7')](_0xbdba('0x8'),attributes,{'tableName':_0xbdba('0x9'),'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 56e9e51..1b4d1d2 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 _0xa6ea=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','options','where','attributes','limit','include','map','model','then','debug','find','raw','ShowChatQueue','lodash','util','moment','bluebird'];(function(_0x4e930d,_0x5573bc){var _0x30d8ff=function(_0x5797bb){while(--_0x5797bb){_0x4e930d['push'](_0x4e930d['shift']());}};_0x30d8ff(++_0x5573bc);}(_0xa6ea,0x122));var _0xaa6e=function(_0x3394d5,_0x556227){_0x3394d5=_0x3394d5-0x0;var _0x14f441=_0xa6ea[_0x3394d5];return _0x14f441;};'use strict';var _=require(_0xaa6e('0x0'));var util=require(_0xaa6e('0x1'));var moment=require(_0xaa6e('0x2'));var BPromise=require(_0xaa6e('0x3'));var rs=require(_0xaa6e('0x4'));var fs=require('fs');var Redis=require(_0xaa6e('0x5'));var db=require(_0xaa6e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa6e('0x7'))(_0xaa6e('0x8'));var config=require(_0xaa6e('0x9'));var jayson=require(_0xaa6e('0xa'));var client=jayson[_0xaa6e('0xb')]['http']({'port':0x232a});config['redis']=_[_0xaa6e('0xc')](config[_0xaa6e('0xd')],{'host':_0xaa6e('0xe'),'port':0x18eb});var socket=require(_0xaa6e('0xf'))(new Redis(config[_0xaa6e('0xd')]));require(_0xaa6e('0x10'))[_0xaa6e('0x11')](socket);function respondWithRpcPromise(_0x50c23c,_0x357240,_0x4cb51b){return new BPromise(function(_0x534cb5,_0x3fc93b){return client['request'](_0x50c23c,_0x4cb51b)['then'](function(_0x3fbdc5){logger[_0xaa6e('0x12')]('ChatQueue,\x20%s,\x20%s',_0x357240,_0xaa6e('0x13'));logger['debug'](_0xaa6e('0x14'),_0x357240,_0xaa6e('0x13'),JSON[_0xaa6e('0x15')](_0x3fbdc5));if(_0x3fbdc5[_0xaa6e('0x16')]){if(_0x3fbdc5[_0xaa6e('0x16')][_0xaa6e('0x17')]===0x1f4){logger[_0xaa6e('0x16')](_0xaa6e('0x18'),_0x357240,_0x3fbdc5[_0xaa6e('0x16')]['message']);return _0x3fc93b(_0x3fbdc5[_0xaa6e('0x16')][_0xaa6e('0x19')]);}logger[_0xaa6e('0x16')]('ChatQueue,\x20%s,\x20%s',_0x357240,_0x3fbdc5[_0xaa6e('0x16')][_0xaa6e('0x19')]);return _0x534cb5(_0x3fbdc5[_0xaa6e('0x16')][_0xaa6e('0x19')]);}else{logger['info'](_0xaa6e('0x18'),_0x357240,_0xaa6e('0x13'));_0x534cb5(_0x3fbdc5[_0xaa6e('0x1a')][_0xaa6e('0x19')]);}})[_0xaa6e('0x1b')](function(_0x1e80f6){logger['error'](_0xaa6e('0x18'),_0x357240,_0x1e80f6);_0x3fc93b(_0x1e80f6);});});}exports[_0xaa6e('0x1c')]=function(_0x42d03b){var _0x48ca71=this;return new Promise(function(_0x22d985,_0x1c517c){return db[_0xaa6e('0x1d')]['findAll']({'raw':_0x42d03b[_0xaa6e('0x1e')]?_0x42d03b[_0xaa6e('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x42d03b['options']?_0x42d03b['options'][_0xaa6e('0x1f')]||null:null,'attributes':_0x42d03b[_0xaa6e('0x1e')]?_0x42d03b[_0xaa6e('0x1e')][_0xaa6e('0x20')]||null:null,'limit':_0x42d03b['options']?_0x42d03b[_0xaa6e('0x1e')][_0xaa6e('0x21')]||null:null,'include':_0x42d03b[_0xaa6e('0x1e')]?_0x42d03b[_0xaa6e('0x1e')][_0xaa6e('0x22')]?_[_0xaa6e('0x23')](_0x42d03b[_0xaa6e('0x1e')][_0xaa6e('0x22')],function(_0x116c92){return{'model':db[_0x116c92[_0xaa6e('0x24')]],'as':_0x116c92['as'],'attributes':_0x116c92['attributes'],'include':_0x116c92[_0xaa6e('0x22')]?_[_0xaa6e('0x23')](_0x116c92[_0xaa6e('0x22')],function(_0x521402){return{'model':db[_0x521402['model']],'as':_0x521402['as'],'attributes':_0x521402[_0xaa6e('0x20')],'include':_0x521402[_0xaa6e('0x22')]?_[_0xaa6e('0x23')](_0x521402[_0xaa6e('0x22')],function(_0x40c76a){return{'model':db[_0x40c76a[_0xaa6e('0x24')]],'as':_0x40c76a['as'],'attributes':_0x40c76a['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa6e('0x25')](function(_0x21262a){logger['info'](_0xaa6e('0x1c'),_0x42d03b);logger[_0xaa6e('0x26')]('GetChatQueue',_0x42d03b,JSON[_0xaa6e('0x15')](_0x21262a));_0x22d985(_0x21262a);})[_0xaa6e('0x1b')](function(_0x2ddec4){logger['error'](_0xaa6e('0x1c'),_0x2ddec4[_0xaa6e('0x19')],_0x42d03b);_0x1c517c(_0x48ca71[_0xaa6e('0x16')](0x1f4,_0x2ddec4[_0xaa6e('0x19')]));});});};exports['ShowChatQueue']=function(_0x34eb9b){var _0x4176aa=this;return new Promise(function(_0x126a07,_0x258793){return db[_0xaa6e('0x1d')][_0xaa6e('0x27')]({'raw':_0x34eb9b[_0xaa6e('0x1e')]?_0x34eb9b['options'][_0xaa6e('0x28')]===undefined?!![]:![]:!![],'where':_0x34eb9b[_0xaa6e('0x1e')]?_0x34eb9b[_0xaa6e('0x1e')][_0xaa6e('0x1f')]||null:null,'attributes':_0x34eb9b[_0xaa6e('0x1e')]?_0x34eb9b[_0xaa6e('0x1e')][_0xaa6e('0x20')]||null:null,'include':_0x34eb9b[_0xaa6e('0x1e')]?_0x34eb9b[_0xaa6e('0x1e')][_0xaa6e('0x22')]?_['map'](_0x34eb9b[_0xaa6e('0x1e')][_0xaa6e('0x22')],function(_0x2e9911){return{'model':db[_0x2e9911[_0xaa6e('0x24')]],'as':_0x2e9911['as'],'attributes':_0x2e9911[_0xaa6e('0x20')],'include':_0x2e9911[_0xaa6e('0x22')]?_['map'](_0x2e9911[_0xaa6e('0x22')],function(_0x56c24b){return{'model':db[_0x56c24b[_0xaa6e('0x24')]],'as':_0x56c24b['as'],'attributes':_0x56c24b['attributes'],'include':_0x56c24b['include']?_['map'](_0x56c24b[_0xaa6e('0x22')],function(_0x5b9b2d){return{'model':db[_0x5b9b2d[_0xaa6e('0x24')]],'as':_0x5b9b2d['as'],'attributes':_0x5b9b2d[_0xaa6e('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1546b6){logger['info'](_0xaa6e('0x29'),_0x34eb9b);logger[_0xaa6e('0x26')](_0xaa6e('0x29'),_0x34eb9b,JSON['stringify'](_0x1546b6));_0x126a07(_0x1546b6);})[_0xaa6e('0x1b')](function(_0x183597){logger[_0xaa6e('0x16')](_0xaa6e('0x29'),_0x183597[_0xaa6e('0x19')],_0x34eb9b);_0x258793(_0x4176aa['error'](0x1f4,_0x183597[_0xaa6e('0x19')]));});});};
\ No newline at end of file
+var _0xa282=['client','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowChatQueue','ChatQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0xa282,0x189));var _0x2a28=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa282[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x2a28('0x0'));var util=require(_0x2a28('0x1'));var moment=require(_0x2a28('0x2'));var BPromise=require(_0x2a28('0x3'));var rs=require(_0x2a28('0x4'));var fs=require('fs');var Redis=require(_0x2a28('0x5'));var db=require(_0x2a28('0x6'))['db'];var utils=require(_0x2a28('0x7'));var logger=require(_0x2a28('0x8'))(_0x2a28('0x9'));var config=require(_0x2a28('0xa'));var jayson=require(_0x2a28('0xb'));var client=jayson[_0x2a28('0xc')]['http']({'port':0x232a});config['redis']=_[_0x2a28('0xd')](config[_0x2a28('0xe')],{'host':_0x2a28('0xf'),'port':0x18eb});var socket=require(_0x2a28('0x10'))(new Redis(config['redis']));require(_0x2a28('0x11'))[_0x2a28('0x12')](socket);function respondWithRpcPromise(_0x2fb466,_0x1b602e,_0x253357){return new BPromise(function(_0x30c4d3,_0x478842){return client[_0x2a28('0x13')](_0x2fb466,_0x253357)['then'](function(_0x1d4e90){logger['info'](_0x2a28('0x14'),_0x1b602e,_0x2a28('0x15'));logger[_0x2a28('0x16')](_0x2a28('0x17'),_0x1b602e,_0x2a28('0x15'),JSON[_0x2a28('0x18')](_0x1d4e90));if(_0x1d4e90[_0x2a28('0x19')]){if(_0x1d4e90['error'][_0x2a28('0x1a')]===0x1f4){logger[_0x2a28('0x19')](_0x2a28('0x14'),_0x1b602e,_0x1d4e90[_0x2a28('0x19')][_0x2a28('0x1b')]);return _0x478842(_0x1d4e90['error'][_0x2a28('0x1b')]);}logger[_0x2a28('0x19')]('ChatQueue,\x20%s,\x20%s',_0x1b602e,_0x1d4e90[_0x2a28('0x19')][_0x2a28('0x1b')]);return _0x30c4d3(_0x1d4e90[_0x2a28('0x19')]['message']);}else{logger[_0x2a28('0x1c')](_0x2a28('0x14'),_0x1b602e,_0x2a28('0x15'));_0x30c4d3(_0x1d4e90[_0x2a28('0x1d')][_0x2a28('0x1b')]);}})[_0x2a28('0x1e')](function(_0x1d3ecf){logger[_0x2a28('0x19')](_0x2a28('0x14'),_0x1b602e,_0x1d3ecf);_0x478842(_0x1d3ecf);});});}exports[_0x2a28('0x1f')]=function(_0xab245){var _0x320b4=this;return new Promise(function(_0x11d3e5,_0x38f256){return db['ChatQueue'][_0x2a28('0x20')]({'raw':_0xab245[_0x2a28('0x21')]?_0xab245[_0x2a28('0x21')][_0x2a28('0x22')]===undefined?!![]:![]:!![],'where':_0xab245[_0x2a28('0x21')]?_0xab245[_0x2a28('0x21')][_0x2a28('0x23')]||null:null,'attributes':_0xab245[_0x2a28('0x21')]?_0xab245[_0x2a28('0x21')][_0x2a28('0x24')]||null:null,'limit':_0xab245[_0x2a28('0x21')]?_0xab245[_0x2a28('0x21')][_0x2a28('0x25')]||null:null,'include':_0xab245[_0x2a28('0x21')]?_0xab245[_0x2a28('0x21')][_0x2a28('0x26')]?_[_0x2a28('0x27')](_0xab245[_0x2a28('0x21')][_0x2a28('0x26')],function(_0xb7db8e){return{'model':db[_0xb7db8e[_0x2a28('0x28')]],'as':_0xb7db8e['as'],'attributes':_0xb7db8e['attributes'],'include':_0xb7db8e[_0x2a28('0x26')]?_[_0x2a28('0x27')](_0xb7db8e[_0x2a28('0x26')],function(_0x4ed138){return{'model':db[_0x4ed138['model']],'as':_0x4ed138['as'],'attributes':_0x4ed138[_0x2a28('0x24')],'include':_0x4ed138[_0x2a28('0x26')]?_[_0x2a28('0x27')](_0x4ed138[_0x2a28('0x26')],function(_0x406d3e){return{'model':db[_0x406d3e['model']],'as':_0x406d3e['as'],'attributes':_0x406d3e[_0x2a28('0x24')]};}):[]};}):[]};}):[]:[]})[_0x2a28('0x29')](function(_0x1ba395){logger[_0x2a28('0x1c')](_0x2a28('0x1f'),_0xab245);logger[_0x2a28('0x16')](_0x2a28('0x1f'),_0xab245,JSON['stringify'](_0x1ba395));_0x11d3e5(_0x1ba395);})[_0x2a28('0x1e')](function(_0x2e2ada){logger[_0x2a28('0x19')]('GetChatQueue',_0x2e2ada[_0x2a28('0x1b')],_0xab245);_0x38f256(_0x320b4['error'](0x1f4,_0x2e2ada[_0x2a28('0x1b')]));});});};exports[_0x2a28('0x2a')]=function(_0x3ad0fc){var _0x25deba=this;return new Promise(function(_0x3ca5f5,_0x1fd6d5){return db[_0x2a28('0x2b')][_0x2a28('0x2c')]({'raw':_0x3ad0fc['options']?_0x3ad0fc['options'][_0x2a28('0x22')]===undefined?!![]:![]:!![],'where':_0x3ad0fc['options']?_0x3ad0fc[_0x2a28('0x21')]['where']||null:null,'attributes':_0x3ad0fc[_0x2a28('0x21')]?_0x3ad0fc[_0x2a28('0x21')][_0x2a28('0x24')]||null:null,'include':_0x3ad0fc[_0x2a28('0x21')]?_0x3ad0fc['options'][_0x2a28('0x26')]?_['map'](_0x3ad0fc[_0x2a28('0x21')][_0x2a28('0x26')],function(_0x3d69fd){return{'model':db[_0x3d69fd['model']],'as':_0x3d69fd['as'],'attributes':_0x3d69fd[_0x2a28('0x24')],'include':_0x3d69fd[_0x2a28('0x26')]?_[_0x2a28('0x27')](_0x3d69fd[_0x2a28('0x26')],function(_0x2efb50){return{'model':db[_0x2efb50[_0x2a28('0x28')]],'as':_0x2efb50['as'],'attributes':_0x2efb50[_0x2a28('0x24')],'include':_0x2efb50[_0x2a28('0x26')]?_[_0x2a28('0x27')](_0x2efb50[_0x2a28('0x26')],function(_0x4f3824){return{'model':db[_0x4f3824[_0x2a28('0x28')]],'as':_0x4f3824['as'],'attributes':_0x4f3824[_0x2a28('0x24')]};}):[]};}):[]};}):[]:[]})[_0x2a28('0x29')](function(_0x169b81){logger[_0x2a28('0x1c')](_0x2a28('0x2a'),_0x3ad0fc);logger[_0x2a28('0x16')](_0x2a28('0x2a'),_0x3ad0fc,JSON['stringify'](_0x169b81));_0x3ca5f5(_0x169b81);})[_0x2a28('0x1e')](function(_0x6d2e76){logger[_0x2a28('0x19')]('ShowChatQueue',_0x6d2e76[_0x2a28('0x1b')],_0x3ad0fc);_0x1fd6d5(_0x25deba[_0x2a28('0x19')](0x1f4,_0x6d2e76['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index fc2c3cb..9a65b57 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 _0x4c6d=['emit','removeListener','register','length','chatQueue:','./chatQueue.events','save','remove','update'];(function(_0x1ac989,_0x3e5ea6){var _0x16a80b=function(_0x509c64){while(--_0x509c64){_0x1ac989['push'](_0x1ac989['shift']());}};_0x16a80b(++_0x3e5ea6);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x137bdd,_0x43a31f){_0x137bdd=_0x137bdd-0x0;var _0x2656a5=_0x4c6d[_0x137bdd];return _0x2656a5;};'use strict';var ChatQueueEvents=require(_0xd4c6('0x0'));var events=[_0xd4c6('0x1'),_0xd4c6('0x2'),_0xd4c6('0x3')];function createListener(_0x350cc0,_0x5448bc){return function(_0x209f99){_0x5448bc[_0xd4c6('0x4')](_0x350cc0,_0x209f99);};}function removeListener(_0x306766,_0x4b2d75){return function(){ChatQueueEvents[_0xd4c6('0x5')](_0x306766,_0x4b2d75);};}exports[_0xd4c6('0x6')]=function(_0x56279c){for(var _0x182671=0x0,_0x316314=events[_0xd4c6('0x7')];_0x182671<_0x316314;_0x182671++){var _0x5d4fce=events[_0x182671];var _0x440ee3=createListener(_0xd4c6('0x8')+_0x5d4fce,_0x56279c);ChatQueueEvents['on'](_0x5d4fce,_0x440ee3);}};
\ No newline at end of file
+var _0xbec5=['emit','removeListener','register','length','chatQueue:','./chatQueue.events','save','update'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xbec5,0xe5));var _0x5bec=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xbec5[_0x5cb1af];return _0x8d7940;};'use strict';var ChatQueueEvents=require(_0x5bec('0x0'));var events=[_0x5bec('0x1'),'remove',_0x5bec('0x2')];function createListener(_0x38c81a,_0x276b9e){return function(_0x3859a1){_0x276b9e[_0x5bec('0x3')](_0x38c81a,_0x3859a1);};}function removeListener(_0x4ee982,_0x1f8933){return function(){ChatQueueEvents[_0x5bec('0x4')](_0x4ee982,_0x1f8933);};}exports[_0x5bec('0x5')]=function(_0x4aaac6){for(var _0x3ed67a=0x0,_0x28a427=events[_0x5bec('0x6')];_0x3ed67a<_0x28a427;_0x3ed67a++){var _0x406e65=events[_0x3ed67a];var _0x43d96e=createListener(_0x5bec('0x7')+_0x406e65,_0x4aaac6);ChatQueueEvents['on'](_0x406e65,_0x43d96e);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index c640c76..4473b72 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x225074,_0x1abb16){var _0x3fb50c=function(_0xf22c61){while(--_0xf22c61){_0x225074['push'](_0x225074['shift']());}};_0x3fb50c(++_0x1abb16);}(_0xe14b,0x93));var _0xbe14=function(_0x176b0c,_0x321afe){_0x176b0c=_0x176b0c-0x0;var _0x434f3d=_0xe14b[_0x176b0c];return _0x434f3d;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
+var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x14c2e0,_0x1fb177){var _0x5a0569=function(_0x4410ef){while(--_0x4410ef){_0x14c2e0['push'](_0x14c2e0['shift']());}};_0x5a0569(++_0x1fb177);}(_0x814b,0x1a2));var _0xb814=function(_0x190c49,_0x103457){_0x190c49=_0x190c49-0x0;var _0x475b9a=_0x814b[_0x190c49];return _0x475b9a;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index b9e6447..4d66cc6 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 _0xe630=['DATE','moment','sequelize','exports','STRING'];(function(_0x51d477,_0x2349ae){var _0x127b0d=function(_0x4b46b6){while(--_0x4b46b6){_0x51d477['push'](_0x51d477['shift']());}};_0x127b0d(++_0x2349ae);}(_0xe630,0x65));var _0x0e63=function(_0x3a6731,_0x3cf5f7){_0x3a6731=_0x3a6731-0x0;var _0x68e232=_0xe630[_0x3a6731];return _0x68e232;};'use strict';var moment=require(_0x0e63('0x0'));var Sequelize=require(_0x0e63('0x1'));module[_0x0e63('0x2')]={'uniqueid':{'type':Sequelize[_0x0e63('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0e63('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0e63('0x4')]},'acceptAt':{'type':Sequelize[_0x0e63('0x4')]},'exitAt':{'type':Sequelize[_0x0e63('0x4')]},'reason':{'type':Sequelize[_0x0e63('0x3')]}};
\ No newline at end of file
+var _0x9534=['exports','STRING','DATE','moment','sequelize'];(function(_0x437e7d,_0x5bde91){var _0x1d2b5b=function(_0x107a7d){while(--_0x107a7d){_0x437e7d['push'](_0x437e7d['shift']());}};_0x1d2b5b(++_0x5bde91);}(_0x9534,0xc6));var _0x4953=function(_0x3479af,_0x41f5a8){_0x3479af=_0x3479af-0x0;var _0xea457c=_0x9534[_0x3479af];return _0xea457c;};'use strict';var moment=require(_0x4953('0x0'));var Sequelize=require(_0x4953('0x1'));module[_0x4953('0x2')]={'uniqueid':{'type':Sequelize[_0x4953('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x4953('0x4')]},'leaveAt':{'type':Sequelize[_0x4953('0x4')]},'acceptAt':{'type':Sequelize[_0x4953('0x4')]},'exitAt':{'type':Sequelize[_0x4953('0x4')]},'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 0dee7b4..742660d 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 _0x63d4=['../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','ChatQueueReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','merge','options','includeAll','findAll','rows','show','find','catch','create','body','update','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils'];(function(_0x3b3331,_0x420c2f){var _0x214e10=function(_0x5f4c27){while(--_0x5f4c27){_0x3b3331['push'](_0x3b3331['shift']());}};_0x214e10(++_0x420c2f);}(_0x63d4,0x117));var _0x463d=function(_0x3d97c6,_0x2a3020){_0x3d97c6=_0x3d97c6-0x0;var _0x2e2da1=_0x63d4[_0x3d97c6];return _0x2e2da1;};'use strict';var emlformat=require(_0x463d('0x0'));var rimraf=require(_0x463d('0x1'));var zipdir=require(_0x463d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x463d('0x3'));var moment=require(_0x463d('0x4'));var BPromise=require(_0x463d('0x5'));var Mustache=require(_0x463d('0x6'));var util=require(_0x463d('0x7'));var path=require('path');var sox=require(_0x463d('0x8'));var csv=require(_0x463d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x463d('0xa'));var _=require(_0x463d('0xb'));var squel=require(_0x463d('0xc'));var crypto=require(_0x463d('0xd'));var jsforce=require(_0x463d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x463d('0x9'));var querystring=require('querystring');var Papa=require(_0x463d('0xf'));var Redis=require(_0x463d('0x10'));var authService=require(_0x463d('0x11'));var qs=require(_0x463d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x463d('0x13'))('api');var utils=require(_0x463d('0x14'));var config=require(_0x463d('0x15'));var licenseUtil=require(_0x463d('0x16'));var db=require(_0x463d('0x17'))['db'];function respondWithStatusCode(_0x1ac050,_0x15d6ca){_0x15d6ca=_0x15d6ca||0xcc;return function(_0x39834c){if(_0x39834c){return _0x1ac050['sendStatus'](_0x15d6ca);}return _0x1ac050[_0x463d('0x18')](_0x15d6ca)[_0x463d('0x19')]();};}function respondWithResult(_0x436dba,_0x5d82ad){_0x5d82ad=_0x5d82ad||0xc8;return function(_0x8956d3){if(_0x8956d3){return _0x436dba[_0x463d('0x18')](_0x5d82ad)[_0x463d('0x1a')](_0x8956d3);}};}function respondWithFilteredResult(_0x1932e6,_0x37b3f6){return function(_0x46896c){if(_0x46896c){var _0x53c8c6=typeof _0x37b3f6[_0x463d('0x1b')]==='undefined'&&typeof _0x37b3f6[_0x463d('0x1c')]===_0x463d('0x1d');var _0x3c8154=_0x46896c[_0x463d('0x1e')];var _0x408f47=_0x53c8c6?0x0:_0x37b3f6[_0x463d('0x1b')];var _0x48df3c=_0x53c8c6?_0x46896c[_0x463d('0x1e')]:_0x37b3f6[_0x463d('0x1b')]+_0x37b3f6[_0x463d('0x1c')];var _0x2f813d;if(_0x48df3c>=_0x3c8154){_0x48df3c=_0x3c8154;_0x2f813d=0xc8;}else{_0x2f813d=0xce;}_0x1932e6[_0x463d('0x18')](_0x2f813d);return _0x1932e6[_0x463d('0x1f')](_0x463d('0x20'),_0x408f47+'-'+_0x48df3c+'/'+_0x3c8154)[_0x463d('0x1a')](_0x46896c);}return null;};}function patchUpdates(_0x27c4a3){return function(_0x622b48){try{jsonpatch[_0x463d('0x21')](_0x622b48,_0x27c4a3,!![]);}catch(_0xda9541){return BPromise[_0x463d('0x22')](_0xda9541);}return _0x622b48[_0x463d('0x23')]();};}function saveUpdates(_0x458789,_0x5670fc){return function(_0x19e3eb){if(_0x19e3eb){return _0x19e3eb['update'](_0x458789)[_0x463d('0x24')](function(_0x1a2756){return _0x1a2756;});}return null;};}function removeEntity(_0x541aa9,_0x5d16ad){return function(_0x3fc748){if(_0x3fc748){return _0x3fc748[_0x463d('0x25')]()['then'](function(){_0x541aa9[_0x463d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1379ef,_0x35e562){return function(_0x3f10b3){if(!_0x3f10b3){_0x1379ef['sendStatus'](0x194);}return _0x3f10b3;};}function handleError(_0x592748,_0x4627c0){_0x4627c0=_0x4627c0||0x1f4;return function(_0x3763a2){logger[_0x463d('0x26')](_0x3763a2[_0x463d('0x27')]);if(_0x3763a2[_0x463d('0x28')]){delete _0x3763a2[_0x463d('0x28')];}_0x592748['status'](_0x4627c0)['send'](_0x3763a2);};}exports[_0x463d('0x29')]=function(_0x5cf437,_0x5358bb){var _0x45165d={},_0x33305d={},_0x440921={'count':0x0,'rows':[]};var _0x540e9c=_[_0x463d('0x2a')](db[_0x463d('0x2b')][_0x463d('0x2c')],function(_0x236ebb){return{'name':_0x236ebb[_0x463d('0x2d')],'type':_0x236ebb['type'][_0x463d('0x2e')]};});_0x33305d[_0x463d('0x2f')]=_['map'](_0x540e9c,_0x463d('0x28'));_0x33305d['query']=_[_0x463d('0x30')](_0x5cf437[_0x463d('0x31')]);_0x33305d[_0x463d('0x32')]=_[_0x463d('0x33')](_0x33305d[_0x463d('0x2f')],_0x33305d['query']);_0x45165d[_0x463d('0x34')]=_[_0x463d('0x33')](_0x33305d[_0x463d('0x2f')],qs[_0x463d('0x35')](_0x5cf437[_0x463d('0x31')][_0x463d('0x35')]));_0x45165d[_0x463d('0x34')]=_0x45165d[_0x463d('0x34')][_0x463d('0x36')]?_0x45165d[_0x463d('0x34')]:_0x33305d[_0x463d('0x2f')];if(!_0x5cf437[_0x463d('0x31')][_0x463d('0x37')](_0x463d('0x38'))){_0x45165d[_0x463d('0x1c')]=qs['limit'](_0x5cf437[_0x463d('0x31')][_0x463d('0x1c')]);_0x45165d[_0x463d('0x1b')]=qs[_0x463d('0x1b')](_0x5cf437[_0x463d('0x31')][_0x463d('0x1b')]);}_0x45165d[_0x463d('0x39')]=qs[_0x463d('0x3a')](_0x5cf437[_0x463d('0x31')][_0x463d('0x3a')]);_0x45165d[_0x463d('0x3b')]=qs['filters'](_['pick'](_0x5cf437[_0x463d('0x31')],_0x33305d[_0x463d('0x32')]),_0x540e9c);if(_0x5cf437['query'][_0x463d('0x3c')]){_0x45165d['where']=_['merge'](_0x45165d[_0x463d('0x3b')],{'$or':_['map'](_0x540e9c,function(_0x2eab3d){if(_0x2eab3d[_0x463d('0x3d')]!=='VIRTUAL'){var _0x3485dc={};_0x3485dc[_0x2eab3d[_0x463d('0x28')]]={'$like':'%'+_0x5cf437[_0x463d('0x31')][_0x463d('0x3c')]+'%'};return _0x3485dc;}})});}_0x45165d=_[_0x463d('0x3e')]({},_0x45165d,_0x5cf437[_0x463d('0x3f')]);var _0x1d1d67={'where':_0x45165d['where']};return db['ChatQueueReport'][_0x463d('0x1e')](_0x1d1d67)[_0x463d('0x24')](function(_0x41145e){_0x440921['count']=_0x41145e;if(_0x5cf437['query'][_0x463d('0x40')]){_0x45165d['include']=[{'all':!![]}];}return db[_0x463d('0x2b')][_0x463d('0x41')](_0x45165d);})[_0x463d('0x24')](function(_0x36b532){_0x440921[_0x463d('0x42')]=_0x36b532;return _0x440921;})[_0x463d('0x24')](respondWithFilteredResult(_0x5358bb,_0x45165d))['catch'](handleError(_0x5358bb,null));};exports[_0x463d('0x43')]=function(_0x498286,_0xd2232e){var _0x3b261d={'raw':!![],'where':{'id':_0x498286['params']['id']}},_0x5e4976={};_0x5e4976[_0x463d('0x2f')]=_[_0x463d('0x30')](db['ChatQueueReport']['rawAttributes']);_0x5e4976[_0x463d('0x31')]=_['keys'](_0x498286[_0x463d('0x31')]);_0x5e4976[_0x463d('0x32')]=_[_0x463d('0x33')](_0x5e4976[_0x463d('0x2f')],_0x5e4976[_0x463d('0x31')]);_0x3b261d['attributes']=_[_0x463d('0x33')](_0x5e4976[_0x463d('0x2f')],qs[_0x463d('0x35')](_0x498286[_0x463d('0x31')][_0x463d('0x35')]));_0x3b261d[_0x463d('0x34')]=_0x3b261d[_0x463d('0x34')][_0x463d('0x36')]?_0x3b261d['attributes']:_0x5e4976[_0x463d('0x2f')];if(_0x498286['query']['includeAll']){_0x3b261d['include']=[{'all':!![]}];}_0x3b261d=_['merge']({},_0x3b261d,_0x498286[_0x463d('0x3f')]);return db[_0x463d('0x2b')][_0x463d('0x44')](_0x3b261d)[_0x463d('0x24')](handleEntityNotFound(_0xd2232e,null))[_0x463d('0x24')](respondWithResult(_0xd2232e,null))[_0x463d('0x45')](handleError(_0xd2232e,null));};exports[_0x463d('0x46')]=function(_0x533d80,_0x24d179){return db['ChatQueueReport'][_0x463d('0x46')](_0x533d80[_0x463d('0x47')],{})[_0x463d('0x24')](respondWithResult(_0x24d179,0xc9))[_0x463d('0x45')](handleError(_0x24d179,null));};exports[_0x463d('0x48')]=function(_0x29d10c,_0x14b54f){if(_0x29d10c[_0x463d('0x47')]['id']){delete _0x29d10c[_0x463d('0x47')]['id'];}return db['ChatQueueReport'][_0x463d('0x44')]({'where':{'id':_0x29d10c[_0x463d('0x49')]['id']}})[_0x463d('0x24')](handleEntityNotFound(_0x14b54f,null))['then'](saveUpdates(_0x29d10c['body'],null))[_0x463d('0x24')](respondWithResult(_0x14b54f,null))['catch'](handleError(_0x14b54f,null));};exports[_0x463d('0x25')]=function(_0x41152f,_0x18f7b3){return db['ChatQueueReport'][_0x463d('0x44')]({'where':{'id':_0x41152f[_0x463d('0x49')]['id']}})['then'](handleEntityNotFound(_0x18f7b3,null))['then'](removeEntity(_0x18f7b3,null))[_0x463d('0x45')](handleError(_0x18f7b3,null));};exports[_0x463d('0x4a')]=function(_0x217e9c,_0x1efc1f){return db[_0x463d('0x2b')][_0x463d('0x4a')]()[_0x463d('0x24')](respondWithResult(_0x1efc1f,null))[_0x463d('0x45')](handleError(_0x1efc1f,null));};
\ No newline at end of file
+var _0x870d=['includeAll','findAll','rows','catch','show','keys','intersection','include','find','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','end','stack','name','index','rawAttributes','map','query','filters','model','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','ChatQueueReport'];(function(_0x2940d6,_0x2becba){var _0x5dbf83=function(_0x1ab32e){while(--_0x1ab32e){_0x2940d6['push'](_0x2940d6['shift']());}};_0x5dbf83(++_0x2becba);}(_0x870d,0xde));var _0xd870=function(_0x197503,_0x52ded5){_0x197503=_0x197503-0x0;var _0x2afe95=_0x870d[_0x197503];return _0x2afe95;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd870('0x0'));var zipdir=require(_0xd870('0x1'));var jsonpatch=require(_0xd870('0x2'));var rp=require(_0xd870('0x3'));var moment=require(_0xd870('0x4'));var BPromise=require(_0xd870('0x5'));var Mustache=require('mustache');var util=require(_0xd870('0x6'));var path=require(_0xd870('0x7'));var sox=require(_0xd870('0x8'));var csv=require(_0xd870('0x9'));var ejs=require(_0xd870('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd870('0xb'));var squel=require(_0xd870('0xc'));var crypto=require(_0xd870('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd870('0x9'));var querystring=require(_0xd870('0xe'));var Papa=require(_0xd870('0xf'));var Redis=require(_0xd870('0x10'));var authService=require(_0xd870('0x11'));var qs=require(_0xd870('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd870('0x13'))(_0xd870('0x14'));var utils=require(_0xd870('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd870('0x16'));var db=require(_0xd870('0x17'))['db'];function respondWithStatusCode(_0x51137f,_0xd66446){_0xd66446=_0xd66446||0xcc;return function(_0x434193){if(_0x434193){return _0x51137f['sendStatus'](_0xd66446);}return _0x51137f[_0xd870('0x18')](_0xd66446)['end']();};}function respondWithResult(_0x34e325,_0x161fde){_0x161fde=_0x161fde||0xc8;return function(_0x424f06){if(_0x424f06){return _0x34e325[_0xd870('0x18')](_0x161fde)['json'](_0x424f06);}};}function respondWithFilteredResult(_0x1929ef,_0xb2308b){return function(_0x57708e){if(_0x57708e){var _0x14e306=typeof _0xb2308b[_0xd870('0x19')]===_0xd870('0x1a')&&typeof _0xb2308b['limit']===_0xd870('0x1a');var _0xc1f658=_0x57708e['count'];var _0x2b7286=_0x14e306?0x0:_0xb2308b[_0xd870('0x19')];var _0x4ed8da=_0x14e306?_0x57708e[_0xd870('0x1b')]:_0xb2308b[_0xd870('0x19')]+_0xb2308b['limit'];var _0x2e33a2;if(_0x4ed8da>=_0xc1f658){_0x4ed8da=_0xc1f658;_0x2e33a2=0xc8;}else{_0x2e33a2=0xce;}_0x1929ef[_0xd870('0x18')](_0x2e33a2);return _0x1929ef[_0xd870('0x1c')](_0xd870('0x1d'),_0x2b7286+'-'+_0x4ed8da+'/'+_0xc1f658)['json'](_0x57708e);}return null;};}function patchUpdates(_0x53fade){return function(_0x3ea237){try{jsonpatch[_0xd870('0x1e')](_0x3ea237,_0x53fade,!![]);}catch(_0x4dd75e){return BPromise['reject'](_0x4dd75e);}return _0x3ea237[_0xd870('0x1f')]();};}function saveUpdates(_0x1300c,_0xc3e06b){return function(_0x247b90){if(_0x247b90){return _0x247b90[_0xd870('0x20')](_0x1300c)[_0xd870('0x21')](function(_0x134b84){return _0x134b84;});}return null;};}function removeEntity(_0x549b1e,_0x945d1){return function(_0x44787d){if(_0x44787d){return _0x44787d[_0xd870('0x22')]()[_0xd870('0x21')](function(){_0x549b1e[_0xd870('0x18')](0xcc)[_0xd870('0x23')]();});}};}function handleEntityNotFound(_0x3dbf19,_0xf22ff7){return function(_0x2fa5bd){if(!_0x2fa5bd){_0x3dbf19['sendStatus'](0x194);}return _0x2fa5bd;};}function handleError(_0x50d66f,_0x3fcb68){_0x3fcb68=_0x3fcb68||0x1f4;return function(_0x201c8f){logger['error'](_0x201c8f[_0xd870('0x24')]);if(_0x201c8f[_0xd870('0x25')]){delete _0x201c8f[_0xd870('0x25')];}_0x50d66f[_0xd870('0x18')](_0x3fcb68)['send'](_0x201c8f);};}exports[_0xd870('0x26')]=function(_0x401c9d,_0x5bfead){var _0x4413ad={},_0x5ed1d5={},_0x1efd8d={'count':0x0,'rows':[]};var _0x4ccbdb=_['map'](db['ChatQueueReport'][_0xd870('0x27')],function(_0x1061c5){return{'name':_0x1061c5['fieldName'],'type':_0x1061c5['type']['key']};});_0x5ed1d5['model']=_[_0xd870('0x28')](_0x4ccbdb,'name');_0x5ed1d5[_0xd870('0x29')]=_['keys'](_0x401c9d['query']);_0x5ed1d5[_0xd870('0x2a')]=_['intersection'](_0x5ed1d5[_0xd870('0x2b')],_0x5ed1d5[_0xd870('0x29')]);_0x4413ad[_0xd870('0x2c')]=_['intersection'](_0x5ed1d5[_0xd870('0x2b')],qs['fields'](_0x401c9d[_0xd870('0x29')][_0xd870('0x2d')]));_0x4413ad['attributes']=_0x4413ad[_0xd870('0x2c')][_0xd870('0x2e')]?_0x4413ad[_0xd870('0x2c')]:_0x5ed1d5[_0xd870('0x2b')];if(!_0x401c9d[_0xd870('0x29')]['hasOwnProperty'](_0xd870('0x2f'))){_0x4413ad['limit']=qs[_0xd870('0x30')](_0x401c9d[_0xd870('0x29')]['limit']);_0x4413ad[_0xd870('0x19')]=qs['offset'](_0x401c9d[_0xd870('0x29')][_0xd870('0x19')]);}_0x4413ad[_0xd870('0x31')]=qs[_0xd870('0x32')](_0x401c9d[_0xd870('0x29')][_0xd870('0x32')]);_0x4413ad[_0xd870('0x33')]=qs['filters'](_[_0xd870('0x34')](_0x401c9d[_0xd870('0x29')],_0x5ed1d5[_0xd870('0x2a')]),_0x4ccbdb);if(_0x401c9d['query'][_0xd870('0x35')]){_0x4413ad[_0xd870('0x33')]=_[_0xd870('0x36')](_0x4413ad[_0xd870('0x33')],{'$or':_['map'](_0x4ccbdb,function(_0x55daa8){if(_0x55daa8[_0xd870('0x37')]!==_0xd870('0x38')){var _0x171590={};_0x171590[_0x55daa8[_0xd870('0x25')]]={'$like':'%'+_0x401c9d[_0xd870('0x29')]['filter']+'%'};return _0x171590;}})});}_0x4413ad=_[_0xd870('0x36')]({},_0x4413ad,_0x401c9d['options']);var _0x326762={'where':_0x4413ad[_0xd870('0x33')]};return db[_0xd870('0x39')]['count'](_0x326762)['then'](function(_0x516332){_0x1efd8d[_0xd870('0x1b')]=_0x516332;if(_0x401c9d[_0xd870('0x29')][_0xd870('0x3a')]){_0x4413ad['include']=[{'all':!![]}];}return db[_0xd870('0x39')][_0xd870('0x3b')](_0x4413ad);})[_0xd870('0x21')](function(_0x5e04be){_0x1efd8d[_0xd870('0x3c')]=_0x5e04be;return _0x1efd8d;})['then'](respondWithFilteredResult(_0x5bfead,_0x4413ad))[_0xd870('0x3d')](handleError(_0x5bfead,null));};exports[_0xd870('0x3e')]=function(_0x389278,_0x53291d){var _0x3adbe4={'raw':!![],'where':{'id':_0x389278['params']['id']}},_0x5ead29={};_0x5ead29[_0xd870('0x2b')]=_[_0xd870('0x3f')](db[_0xd870('0x39')][_0xd870('0x27')]);_0x5ead29[_0xd870('0x29')]=_['keys'](_0x389278[_0xd870('0x29')]);_0x5ead29['filters']=_[_0xd870('0x40')](_0x5ead29[_0xd870('0x2b')],_0x5ead29[_0xd870('0x29')]);_0x3adbe4[_0xd870('0x2c')]=_[_0xd870('0x40')](_0x5ead29[_0xd870('0x2b')],qs[_0xd870('0x2d')](_0x389278[_0xd870('0x29')][_0xd870('0x2d')]));_0x3adbe4[_0xd870('0x2c')]=_0x3adbe4[_0xd870('0x2c')][_0xd870('0x2e')]?_0x3adbe4[_0xd870('0x2c')]:_0x5ead29[_0xd870('0x2b')];if(_0x389278[_0xd870('0x29')][_0xd870('0x3a')]){_0x3adbe4[_0xd870('0x41')]=[{'all':!![]}];}_0x3adbe4=_[_0xd870('0x36')]({},_0x3adbe4,_0x389278['options']);return db['ChatQueueReport'][_0xd870('0x42')](_0x3adbe4)[_0xd870('0x21')](handleEntityNotFound(_0x53291d,null))['then'](respondWithResult(_0x53291d,null))[_0xd870('0x3d')](handleError(_0x53291d,null));};exports['create']=function(_0x428c5f,_0x255ba5){return db['ChatQueueReport']['create'](_0x428c5f[_0xd870('0x43')],{})['then'](respondWithResult(_0x255ba5,0xc9))[_0xd870('0x3d')](handleError(_0x255ba5,null));};exports[_0xd870('0x20')]=function(_0x1c6635,_0x3459b1){if(_0x1c6635[_0xd870('0x43')]['id']){delete _0x1c6635[_0xd870('0x43')]['id'];}return db[_0xd870('0x39')]['find']({'where':{'id':_0x1c6635[_0xd870('0x44')]['id']}})[_0xd870('0x21')](handleEntityNotFound(_0x3459b1,null))[_0xd870('0x21')](saveUpdates(_0x1c6635[_0xd870('0x43')],null))[_0xd870('0x21')](respondWithResult(_0x3459b1,null))[_0xd870('0x3d')](handleError(_0x3459b1,null));};exports[_0xd870('0x22')]=function(_0x4ca6a6,_0x49ef39){return db[_0xd870('0x39')]['find']({'where':{'id':_0x4ca6a6[_0xd870('0x44')]['id']}})[_0xd870('0x21')](handleEntityNotFound(_0x49ef39,null))[_0xd870('0x21')](removeEntity(_0x49ef39,null))[_0xd870('0x3d')](handleError(_0x49ef39,null));};exports[_0xd870('0x45')]=function(_0x439e12,_0x477ee5){return db['ChatQueueReport'][_0xd870('0x45')]()[_0xd870('0x21')](respondWithResult(_0x477ee5,null))[_0xd870('0x3d')](handleError(_0x477ee5,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index a6a8381..84ecbb2 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 _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x3b3750,_0x28f3b8){var _0x1b9e8b=function(_0xaf75c3){while(--_0xaf75c3){_0x3b3750['push'](_0x3b3750['shift']());}};_0x1b9e8b(++_0x28f3b8);}(_0xb10b,0x12a));var _0xbb10=function(_0x12742e,_0x43f6fa){_0x12742e=_0x12742e-0x0;var _0x173452=_0xb10b[_0x12742e];return _0x173452;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x31e147,_0x146784){var _0x4fead9=function(_0x5f4b96){while(--_0x5f4b96){_0x31e147['push'](_0x31e147['shift']());}};_0x4fead9(++_0x146784);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xb7e7[_0x5d4607];return _0x5e4a86;};'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
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index e1651f7..7f25198 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 _0x917a=['http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','catch','UpdateChatQueueReport','update','limit','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x38dff0,_0x2a9eef){var _0x5ed1be=function(_0x263715){while(--_0x263715){_0x38dff0['push'](_0x38dff0['shift']());}};_0x5ed1be(++_0x2a9eef);}(_0x917a,0x173));var _0xa917=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x917a[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa917('0x0'));var BPromise=require(_0xa917('0x1'));var rs=require(_0xa917('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa917('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa917('0x4'))(_0xa917('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xa917('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3be995,_0x1fe3a0,_0x24ab73){return new BPromise(function(_0x4d3b0d,_0x58530d){return client[_0xa917('0x7')](_0x3be995,_0x24ab73)[_0xa917('0x8')](function(_0x4f8a58){logger[_0xa917('0x9')](_0xa917('0xa'),_0x1fe3a0,_0xa917('0xb'));logger[_0xa917('0xc')](_0xa917('0xd'),_0x1fe3a0,_0xa917('0xb'),JSON[_0xa917('0xe')](_0x4f8a58));if(_0x4f8a58[_0xa917('0xf')]){if(_0x4f8a58[_0xa917('0xf')][_0xa917('0x10')]===0x1f4){logger[_0xa917('0xf')](_0xa917('0xa'),_0x1fe3a0,_0x4f8a58[_0xa917('0xf')][_0xa917('0x11')]);return _0x58530d(_0x4f8a58[_0xa917('0xf')][_0xa917('0x11')]);}logger[_0xa917('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x1fe3a0,_0x4f8a58[_0xa917('0xf')][_0xa917('0x11')]);return _0x4d3b0d(_0x4f8a58[_0xa917('0xf')]['message']);}else{logger[_0xa917('0x9')]('ChatQueueReport,\x20%s,\x20%s',_0x1fe3a0,'request\x20sent');_0x4d3b0d(_0x4f8a58[_0xa917('0x12')][_0xa917('0x11')]);}})['catch'](function(_0x20619a){logger[_0xa917('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x1fe3a0,_0x20619a);_0x58530d(_0x20619a);});});}exports[_0xa917('0x13')]=function(_0x557742){var _0x3bcfd0=this;return new Promise(function(_0x4940bc,_0x410917){return db[_0xa917('0x14')][_0xa917('0x15')](_0x557742[_0xa917('0x16')],{'raw':_0x557742[_0xa917('0x17')]?_0x557742[_0xa917('0x17')][_0xa917('0x18')]===undefined?!![]:![]:!![]})[_0xa917('0x8')](function(_0x413686){logger[_0xa917('0x9')](_0xa917('0x13'),_0x557742);logger[_0xa917('0xc')](_0xa917('0x13'),_0x557742,JSON['stringify'](_0x413686));_0x4940bc(_0x413686);})[_0xa917('0x19')](function(_0x3f75a9){logger['error'](_0xa917('0x13'),_0x3f75a9[_0xa917('0x11')],_0x557742);_0x410917(_0x3bcfd0[_0xa917('0xf')](0x1f4,_0x3f75a9[_0xa917('0x11')]));});});};exports[_0xa917('0x1a')]=function(_0x3234e7){var _0x279f29=this;return new Promise(function(_0x50d6f2,_0x23161a){return db[_0xa917('0x14')][_0xa917('0x1b')](_0x3234e7[_0xa917('0x16')],{'raw':_0x3234e7[_0xa917('0x17')]?_0x3234e7[_0xa917('0x17')][_0xa917('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3234e7[_0xa917('0x17')]?_0x3234e7['options']['where']||null:null,'attributes':_0x3234e7[_0xa917('0x17')]?_0x3234e7[_0xa917('0x17')]['attributes']||null:null,'limit':_0x3234e7[_0xa917('0x17')]?_0x3234e7['options'][_0xa917('0x1c')]||null:null})[_0xa917('0x8')](function(_0x1ccfc0){logger[_0xa917('0x9')](_0xa917('0x1a'),_0x3234e7);logger[_0xa917('0xc')](_0xa917('0x1a'),_0x3234e7,JSON[_0xa917('0xe')](_0x1ccfc0));_0x50d6f2(_0x1ccfc0);})['catch'](function(_0x3d2696){logger[_0xa917('0xf')](_0xa917('0x1a'),_0x3d2696['message'],_0x3234e7);_0x23161a(_0x279f29[_0xa917('0xf')](0x1f4,_0x3d2696['message']));});});};
\ No newline at end of file
+var _0xee7f=['attributes','limit','UpdateChatQueueReport','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatQueueReport','body','options','raw','update','where'];(function(_0x8261bb,_0x48e718){var _0x530867=function(_0x4b2b4e){while(--_0x4b2b4e){_0x8261bb['push'](_0x8261bb['shift']());}};_0x530867(++_0x48e718);}(_0xee7f,0xc3));var _0xfee7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xee7f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfee7('0x0'));var BPromise=require(_0xfee7('0x1'));var rs=require(_0xfee7('0x2'));var fs=require('fs');var Redis=require(_0xfee7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfee7('0x4'));var logger=require(_0xfee7('0x5'))(_0xfee7('0x6'));var config=require(_0xfee7('0x7'));var jayson=require(_0xfee7('0x8'));var client=jayson[_0xfee7('0x9')][_0xfee7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x482abf,_0x309e13,_0x216bfe){return new BPromise(function(_0x481f0e,_0x326255){return client[_0xfee7('0xb')](_0x482abf,_0x216bfe)[_0xfee7('0xc')](function(_0x40515e){logger[_0xfee7('0xd')](_0xfee7('0xe'),_0x309e13,_0xfee7('0xf'));logger[_0xfee7('0x10')](_0xfee7('0x11'),_0x309e13,_0xfee7('0xf'),JSON[_0xfee7('0x12')](_0x40515e));if(_0x40515e['error']){if(_0x40515e[_0xfee7('0x13')][_0xfee7('0x14')]===0x1f4){logger[_0xfee7('0x13')](_0xfee7('0xe'),_0x309e13,_0x40515e[_0xfee7('0x13')][_0xfee7('0x15')]);return _0x326255(_0x40515e[_0xfee7('0x13')]['message']);}logger['error'](_0xfee7('0xe'),_0x309e13,_0x40515e['error'][_0xfee7('0x15')]);return _0x481f0e(_0x40515e[_0xfee7('0x13')][_0xfee7('0x15')]);}else{logger[_0xfee7('0xd')](_0xfee7('0xe'),_0x309e13,_0xfee7('0xf'));_0x481f0e(_0x40515e['result'][_0xfee7('0x15')]);}})[_0xfee7('0x16')](function(_0x374fc0){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x309e13,_0x374fc0);_0x326255(_0x374fc0);});});}exports[_0xfee7('0x17')]=function(_0x329711){var _0x5295b1=this;return new Promise(function(_0x41e841,_0x18dde8){return db['ChatQueueReport']['create'](_0x329711[_0xfee7('0x18')],{'raw':_0x329711[_0xfee7('0x19')]?_0x329711[_0xfee7('0x19')][_0xfee7('0x1a')]===undefined?!![]:![]:!![]})[_0xfee7('0xc')](function(_0x555442){logger[_0xfee7('0xd')](_0xfee7('0x17'),_0x329711);logger[_0xfee7('0x10')](_0xfee7('0x17'),_0x329711,JSON['stringify'](_0x555442));_0x41e841(_0x555442);})[_0xfee7('0x16')](function(_0x58e8c1){logger[_0xfee7('0x13')](_0xfee7('0x17'),_0x58e8c1['message'],_0x329711);_0x18dde8(_0x5295b1[_0xfee7('0x13')](0x1f4,_0x58e8c1[_0xfee7('0x15')]));});});};exports['UpdateChatQueueReport']=function(_0x367a4e){var _0x157e86=this;return new Promise(function(_0x1a0a3a,_0x1c31dd){return db['ChatQueueReport'][_0xfee7('0x1b')](_0x367a4e[_0xfee7('0x18')],{'raw':_0x367a4e[_0xfee7('0x19')]?_0x367a4e['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x367a4e[_0xfee7('0x19')]?_0x367a4e[_0xfee7('0x19')][_0xfee7('0x1c')]||null:null,'attributes':_0x367a4e[_0xfee7('0x19')]?_0x367a4e[_0xfee7('0x19')][_0xfee7('0x1d')]||null:null,'limit':_0x367a4e['options']?_0x367a4e[_0xfee7('0x19')][_0xfee7('0x1e')]||null:null})['then'](function(_0x70f036){logger[_0xfee7('0xd')](_0xfee7('0x1f'),_0x367a4e);logger[_0xfee7('0x10')](_0xfee7('0x1f'),_0x367a4e,JSON[_0xfee7('0x12')](_0x70f036));_0x1a0a3a(_0x70f036);})['catch'](function(_0x52c90e){logger[_0xfee7('0x13')](_0xfee7('0x1f'),_0x52c90e['message'],_0x367a4e);_0x1c31dd(_0x157e86['error'](0x1f4,_0x52c90e['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 56556f5..bb744b7 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 _0xb926=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x3baa0e,_0x3df81a){var _0x432af7=function(_0x390d31){while(--_0x390d31){_0x3baa0e['push'](_0x3baa0e['shift']());}};_0x432af7(++_0x3df81a);}(_0xb926,0x121));var _0x6b92=function(_0x49fc8f,_0x10c63e){_0x49fc8f=_0x49fc8f-0x0;var _0x1a338f=_0xb926[_0x49fc8f];return _0x1a338f;};'use strict';var multer=require(_0x6b92('0x0'));var util=require(_0x6b92('0x1'));var path=require(_0x6b92('0x2'));var timeout=require('connect-timeout');var express=require(_0x6b92('0x3'));var router=express[_0x6b92('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6b92('0x5'));var interaction=require(_0x6b92('0x6'));var config=require(_0x6b92('0x7'));var controller=require('./chatQueueReport.controller');router[_0x6b92('0x8')]('/',auth[_0x6b92('0x9')](),controller[_0x6b92('0xa')]);router[_0x6b92('0x8')](_0x6b92('0xb'),auth[_0x6b92('0x9')](),controller[_0x6b92('0xc')]);router['get'](_0x6b92('0xd'),auth[_0x6b92('0x9')](),controller[_0x6b92('0xe')]);router[_0x6b92('0xf')]('/',auth[_0x6b92('0x9')](),controller[_0x6b92('0x10')]);router['put']('/:id',auth[_0x6b92('0x9')](),controller[_0x6b92('0x11')]);router[_0x6b92('0x12')](_0x6b92('0xd'),auth['isAuthenticated'](),controller[_0x6b92('0x13')]);module[_0x6b92('0x14')]=router;
\ No newline at end of file
+var _0x3e15=['show','post','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','/describe','/:id'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x3e15,0xd8));var _0x53e1=function(_0x433cf1,_0x454307){_0x433cf1=_0x433cf1-0x0;var _0x149e64=_0x3e15[_0x433cf1];return _0x149e64;};'use strict';var multer=require(_0x53e1('0x0'));var util=require(_0x53e1('0x1'));var path=require(_0x53e1('0x2'));var timeout=require(_0x53e1('0x3'));var express=require(_0x53e1('0x4'));var router=express[_0x53e1('0x5')]();var fs_extra=require(_0x53e1('0x6'));var auth=require(_0x53e1('0x7'));var interaction=require(_0x53e1('0x8'));var config=require(_0x53e1('0x9'));var controller=require(_0x53e1('0xa'));router[_0x53e1('0xb')]('/',auth[_0x53e1('0xc')](),controller['index']);router[_0x53e1('0xb')](_0x53e1('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x53e1('0xb')](_0x53e1('0xe'),auth[_0x53e1('0xc')](),controller[_0x53e1('0xf')]);router[_0x53e1('0x10')]('/',auth['isAuthenticated'](),controller[_0x53e1('0x11')]);router[_0x53e1('0x12')](_0x53e1('0xe'),auth[_0x53e1('0xc')](),controller['update']);router[_0x53e1('0x13')](_0x53e1('0xe'),auth[_0x53e1('0xc')](),controller[_0x53e1('0x14')]);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 90bdb2d..60c707b 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x5ebbe0,_0x2cc634){var _0x240399=function(_0x3dade1){while(--_0x3dade1){_0x5ebbe0['push'](_0x5ebbe0['shift']());}};_0x240399(++_0x2cc634);}(_0xaa88,0x137));var _0x8aa8=function(_0x3e32a8,_0x255953){_0x3e32a8=_0x3e32a8-0x0;var _0x2997b0=_0xaa88[_0x3e32a8];return _0x2997b0;};'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
+var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x3e88da,_0xbadca6){var _0xf768d8=function(_0x352054){while(--_0x352054){_0x3e88da['push'](_0x3e88da['shift']());}};_0xf768d8(++_0xbadca6);}(_0xedd9,0xfc));var _0x9edd=function(_0x28212d,_0x449ce4){_0x28212d=_0x28212d-0x0;var _0x15aca7=_0xedd9[_0x28212d];return _0x15aca7;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 19b9943..062ddf8 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 _0x6662=['model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatTransferReport','includeAll','include','findAll','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection'];(function(_0x34d95d,_0x5b503d){var _0x302ea6=function(_0x3f71ff){while(--_0x3f71ff){_0x34d95d['push'](_0x34d95d['shift']());}};_0x302ea6(++_0x5b503d);}(_0x6662,0xaf));var _0x2666=function(_0x38a040,_0x1cb9c3){_0x38a040=_0x38a040-0x0;var _0x50e92f=_0x6662[_0x38a040];return _0x50e92f;};'use strict';var emlformat=require(_0x2666('0x0'));var rimraf=require(_0x2666('0x1'));var zipdir=require(_0x2666('0x2'));var jsonpatch=require(_0x2666('0x3'));var rp=require(_0x2666('0x4'));var moment=require(_0x2666('0x5'));var BPromise=require(_0x2666('0x6'));var Mustache=require(_0x2666('0x7'));var util=require(_0x2666('0x8'));var path=require(_0x2666('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2666('0xa'));var _=require('lodash');var squel=require(_0x2666('0xb'));var crypto=require('crypto');var jsforce=require(_0x2666('0xc'));var deskjs=require(_0x2666('0xd'));var toCsv=require(_0x2666('0xe'));var querystring=require(_0x2666('0xf'));var Papa=require('papaparse');var Redis=require(_0x2666('0x10'));var authService=require(_0x2666('0x11'));var qs=require(_0x2666('0x12'));var as=require(_0x2666('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2666('0x14'))(_0x2666('0x15'));var utils=require(_0x2666('0x16'));var config=require(_0x2666('0x17'));var licenseUtil=require(_0x2666('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x113e92,_0x238394){_0x238394=_0x238394||0xcc;return function(_0x224c90){if(_0x224c90){return _0x113e92[_0x2666('0x19')](_0x238394);}return _0x113e92[_0x2666('0x1a')](_0x238394)[_0x2666('0x1b')]();};}function respondWithResult(_0x5d9a77,_0x2e9da6){_0x2e9da6=_0x2e9da6||0xc8;return function(_0x2fa166){if(_0x2fa166){return _0x5d9a77[_0x2666('0x1a')](_0x2e9da6)[_0x2666('0x1c')](_0x2fa166);}};}function respondWithFilteredResult(_0x2013a9,_0x4de2bf){return function(_0x571c58){if(_0x571c58){var _0x35684d=typeof _0x4de2bf['offset']===_0x2666('0x1d')&&typeof _0x4de2bf[_0x2666('0x1e')]===_0x2666('0x1d');var _0x5df833=_0x571c58[_0x2666('0x1f')];var _0x26a4ff=_0x35684d?0x0:_0x4de2bf[_0x2666('0x20')];var _0x460dfc=_0x35684d?_0x571c58[_0x2666('0x1f')]:_0x4de2bf[_0x2666('0x20')]+_0x4de2bf[_0x2666('0x1e')];var _0x5198b2;if(_0x460dfc>=_0x5df833){_0x460dfc=_0x5df833;_0x5198b2=0xc8;}else{_0x5198b2=0xce;}_0x2013a9[_0x2666('0x1a')](_0x5198b2);return _0x2013a9[_0x2666('0x21')](_0x2666('0x22'),_0x26a4ff+'-'+_0x460dfc+'/'+_0x5df833)['json'](_0x571c58);}return null;};}function patchUpdates(_0xe0ce37){return function(_0x35c378){try{jsonpatch['apply'](_0x35c378,_0xe0ce37,!![]);}catch(_0x4aff82){return BPromise[_0x2666('0x23')](_0x4aff82);}return _0x35c378[_0x2666('0x24')]();};}function saveUpdates(_0x1e57c2,_0x364e70){return function(_0x346005){if(_0x346005){return _0x346005[_0x2666('0x25')](_0x1e57c2)[_0x2666('0x26')](function(_0x3a42ec){return _0x3a42ec;});}return null;};}function removeEntity(_0x53b07b,_0x46ef6b){return function(_0x52e937){if(_0x52e937){return _0x52e937[_0x2666('0x27')]()[_0x2666('0x26')](function(){_0x53b07b['status'](0xcc)[_0x2666('0x1b')]();});}};}function handleEntityNotFound(_0x97f05e,_0x2d44f2){return function(_0x1091b5){if(!_0x1091b5){_0x97f05e[_0x2666('0x19')](0x194);}return _0x1091b5;};}function handleError(_0xeed8c,_0xe30b34){_0xe30b34=_0xe30b34||0x1f4;return function(_0x3890cf){logger[_0x2666('0x28')](_0x3890cf[_0x2666('0x29')]);if(_0x3890cf[_0x2666('0x2a')]){delete _0x3890cf['name'];}_0xeed8c[_0x2666('0x1a')](_0xe30b34)[_0x2666('0x2b')](_0x3890cf);};}exports[_0x2666('0x2c')]=function(_0x14628,_0x879360){var _0x2609e2={},_0x3ad694={},_0x3c6230={'count':0x0,'rows':[]};var _0x44c0ef=_[_0x2666('0x2d')](db['ChatTransferReport'][_0x2666('0x2e')],function(_0x21c230){return{'name':_0x21c230[_0x2666('0x2f')],'type':_0x21c230[_0x2666('0x30')]['key']};});_0x3ad694['model']=_[_0x2666('0x2d')](_0x44c0ef,_0x2666('0x2a'));_0x3ad694[_0x2666('0x31')]=_[_0x2666('0x32')](_0x14628[_0x2666('0x31')]);_0x3ad694[_0x2666('0x33')]=_[_0x2666('0x34')](_0x3ad694[_0x2666('0x35')],_0x3ad694[_0x2666('0x31')]);_0x2609e2['attributes']=_[_0x2666('0x34')](_0x3ad694[_0x2666('0x35')],qs[_0x2666('0x36')](_0x14628[_0x2666('0x31')][_0x2666('0x36')]));_0x2609e2[_0x2666('0x37')]=_0x2609e2[_0x2666('0x37')][_0x2666('0x38')]?_0x2609e2[_0x2666('0x37')]:_0x3ad694[_0x2666('0x35')];if(!_0x14628['query'][_0x2666('0x39')]('nolimit')){_0x2609e2[_0x2666('0x1e')]=qs[_0x2666('0x1e')](_0x14628[_0x2666('0x31')][_0x2666('0x1e')]);_0x2609e2[_0x2666('0x20')]=qs[_0x2666('0x20')](_0x14628[_0x2666('0x31')]['offset']);}_0x2609e2[_0x2666('0x3a')]=qs[_0x2666('0x3b')](_0x14628[_0x2666('0x31')]['sort']);_0x2609e2[_0x2666('0x3c')]=qs[_0x2666('0x33')](_[_0x2666('0x3d')](_0x14628[_0x2666('0x31')],_0x3ad694[_0x2666('0x33')]),_0x44c0ef);if(_0x14628[_0x2666('0x31')][_0x2666('0x3e')]){_0x2609e2[_0x2666('0x3c')]=_[_0x2666('0x3f')](_0x2609e2[_0x2666('0x3c')],{'$or':_[_0x2666('0x2d')](_0x44c0ef,function(_0x38e07f){if(_0x38e07f['type']!==_0x2666('0x40')){var _0x555c53={};_0x555c53[_0x38e07f[_0x2666('0x2a')]]={'$like':'%'+_0x14628[_0x2666('0x31')]['filter']+'%'};return _0x555c53;}})});}_0x2609e2=_[_0x2666('0x3f')]({},_0x2609e2,_0x14628[_0x2666('0x41')]);var _0xfe3db={'where':_0x2609e2[_0x2666('0x3c')]};return db[_0x2666('0x42')]['count'](_0xfe3db)['then'](function(_0x49267f){_0x3c6230['count']=_0x49267f;if(_0x14628['query'][_0x2666('0x43')]){_0x2609e2[_0x2666('0x44')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x2666('0x45')](_0x2609e2);})[_0x2666('0x26')](function(_0x39d76e){_0x3c6230['rows']=_0x39d76e;return _0x3c6230;})[_0x2666('0x26')](respondWithFilteredResult(_0x879360,_0x2609e2))[_0x2666('0x46')](handleError(_0x879360,null));};exports['show']=function(_0x4b8011,_0x4bf3ce){var _0x337ef9={'raw':!![],'where':{'id':_0x4b8011[_0x2666('0x47')]['id']}},_0x2ef539={};_0x2ef539[_0x2666('0x35')]=_['keys'](db['ChatTransferReport'][_0x2666('0x2e')]);_0x2ef539[_0x2666('0x31')]=_[_0x2666('0x32')](_0x4b8011[_0x2666('0x31')]);_0x2ef539[_0x2666('0x33')]=_[_0x2666('0x34')](_0x2ef539['model'],_0x2ef539[_0x2666('0x31')]);_0x337ef9[_0x2666('0x37')]=_[_0x2666('0x34')](_0x2ef539[_0x2666('0x35')],qs[_0x2666('0x36')](_0x4b8011[_0x2666('0x31')][_0x2666('0x36')]));_0x337ef9[_0x2666('0x37')]=_0x337ef9[_0x2666('0x37')][_0x2666('0x38')]?_0x337ef9[_0x2666('0x37')]:_0x2ef539[_0x2666('0x35')];if(_0x4b8011[_0x2666('0x31')]['includeAll']){_0x337ef9['include']=[{'all':!![]}];}_0x337ef9=_[_0x2666('0x3f')]({},_0x337ef9,_0x4b8011['options']);return db[_0x2666('0x42')][_0x2666('0x48')](_0x337ef9)[_0x2666('0x26')](handleEntityNotFound(_0x4bf3ce,null))['then'](respondWithResult(_0x4bf3ce,null))[_0x2666('0x46')](handleError(_0x4bf3ce,null));};exports[_0x2666('0x49')]=function(_0x5587da,_0x24ebb8){return db['ChatTransferReport']['create'](_0x5587da[_0x2666('0x4a')],{})[_0x2666('0x26')](respondWithResult(_0x24ebb8,0xc9))['catch'](handleError(_0x24ebb8,null));};exports[_0x2666('0x25')]=function(_0x3c2d1e,_0x1d1e4f){if(_0x3c2d1e[_0x2666('0x4a')]['id']){delete _0x3c2d1e['body']['id'];}return db[_0x2666('0x42')][_0x2666('0x48')]({'where':{'id':_0x3c2d1e[_0x2666('0x47')]['id']}})[_0x2666('0x26')](handleEntityNotFound(_0x1d1e4f,null))['then'](saveUpdates(_0x3c2d1e[_0x2666('0x4a')],null))[_0x2666('0x26')](respondWithResult(_0x1d1e4f,null))[_0x2666('0x46')](handleError(_0x1d1e4f,null));};exports['destroy']=function(_0x2e243a,_0x4ff844){return db[_0x2666('0x42')][_0x2666('0x48')]({'where':{'id':_0x2e243a[_0x2666('0x47')]['id']}})['then'](handleEntityNotFound(_0x4ff844,null))[_0x2666('0x26')](removeEntity(_0x4ff844,null))[_0x2666('0x46')](handleError(_0x4ff844,null));};exports[_0x2666('0x4b')]=function(_0x54145c,_0x1e86db){return db[_0x2666('0x42')][_0x2666('0x4b')]()[_0x2666('0x26')](respondWithResult(_0x1e86db,null))['catch'](handleError(_0x1e86db,null));};
\ No newline at end of file
+var _0x5840=['pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5840,0x1cd));var _0x0584=function(_0x5efd4d,_0x428f2e){_0x5efd4d=_0x5efd4d-0x0;var _0x5d3540=_0x5840[_0x5efd4d];return _0x5d3540;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0584('0x0'));var zipdir=require(_0x0584('0x1'));var jsonpatch=require(_0x0584('0x2'));var rp=require(_0x0584('0x3'));var moment=require(_0x0584('0x4'));var BPromise=require(_0x0584('0x5'));var Mustache=require('mustache');var util=require(_0x0584('0x6'));var path=require('path');var sox=require(_0x0584('0x7'));var csv=require(_0x0584('0x8'));var ejs=require(_0x0584('0x9'));var fs=require('fs');var fs_extra=require(_0x0584('0xa'));var _=require('lodash');var squel=require(_0x0584('0xb'));var crypto=require('crypto');var jsforce=require(_0x0584('0xc'));var deskjs=require(_0x0584('0xd'));var toCsv=require(_0x0584('0x8'));var querystring=require(_0x0584('0xe'));var Papa=require(_0x0584('0xf'));var Redis=require('ioredis');var authService=require(_0x0584('0x10'));var qs=require(_0x0584('0x11'));var as=require(_0x0584('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x0584('0x13'));var config=require(_0x0584('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e20cc,_0x538921){_0x538921=_0x538921||0xcc;return function(_0x50ba2e){if(_0x50ba2e){return _0x4e20cc['sendStatus'](_0x538921);}return _0x4e20cc[_0x0584('0x15')](_0x538921)[_0x0584('0x16')]();};}function respondWithResult(_0x32d484,_0x1a1f7b){_0x1a1f7b=_0x1a1f7b||0xc8;return function(_0x1b9ee6){if(_0x1b9ee6){return _0x32d484[_0x0584('0x15')](_0x1a1f7b)['json'](_0x1b9ee6);}};}function respondWithFilteredResult(_0x77aef0,_0x5adac2){return function(_0x426dc9){if(_0x426dc9){var _0x32c7e5=typeof _0x5adac2[_0x0584('0x17')]===_0x0584('0x18')&&typeof _0x5adac2[_0x0584('0x19')]===_0x0584('0x18');var _0x369391=_0x426dc9[_0x0584('0x1a')];var _0x2a002d=_0x32c7e5?0x0:_0x5adac2[_0x0584('0x17')];var _0x4d74bb=_0x32c7e5?_0x426dc9['count']:_0x5adac2['offset']+_0x5adac2['limit'];var _0x3d2663;if(_0x4d74bb>=_0x369391){_0x4d74bb=_0x369391;_0x3d2663=0xc8;}else{_0x3d2663=0xce;}_0x77aef0[_0x0584('0x15')](_0x3d2663);return _0x77aef0[_0x0584('0x1b')](_0x0584('0x1c'),_0x2a002d+'-'+_0x4d74bb+'/'+_0x369391)[_0x0584('0x1d')](_0x426dc9);}return null;};}function patchUpdates(_0x2f2c54){return function(_0x5310db){try{jsonpatch['apply'](_0x5310db,_0x2f2c54,!![]);}catch(_0x5d113c){return BPromise[_0x0584('0x1e')](_0x5d113c);}return _0x5310db[_0x0584('0x1f')]();};}function saveUpdates(_0x431124,_0x5cba69){return function(_0x3ffa47){if(_0x3ffa47){return _0x3ffa47[_0x0584('0x20')](_0x431124)[_0x0584('0x21')](function(_0xa3c003){return _0xa3c003;});}return null;};}function removeEntity(_0x1a7ba9,_0x8bae74){return function(_0x13fbb7){if(_0x13fbb7){return _0x13fbb7[_0x0584('0x22')]()['then'](function(){_0x1a7ba9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cdcf6,_0x56f5cc){return function(_0x55e28f){if(!_0x55e28f){_0x3cdcf6[_0x0584('0x23')](0x194);}return _0x55e28f;};}function handleError(_0x156994,_0x3cedb0){_0x3cedb0=_0x3cedb0||0x1f4;return function(_0x39a0b1){logger['error'](_0x39a0b1[_0x0584('0x24')]);if(_0x39a0b1[_0x0584('0x25')]){delete _0x39a0b1[_0x0584('0x25')];}_0x156994[_0x0584('0x15')](_0x3cedb0)[_0x0584('0x26')](_0x39a0b1);};}exports[_0x0584('0x27')]=function(_0x28b51c,_0x1911a8){var _0x64fb74={},_0x139ad7={},_0x41b36e={'count':0x0,'rows':[]};var _0x46d6c4=_[_0x0584('0x28')](db[_0x0584('0x29')][_0x0584('0x2a')],function(_0x1323a3){return{'name':_0x1323a3[_0x0584('0x2b')],'type':_0x1323a3['type'][_0x0584('0x2c')]};});_0x139ad7['model']=_[_0x0584('0x28')](_0x46d6c4,_0x0584('0x25'));_0x139ad7[_0x0584('0x2d')]=_[_0x0584('0x2e')](_0x28b51c[_0x0584('0x2d')]);_0x139ad7[_0x0584('0x2f')]=_[_0x0584('0x30')](_0x139ad7[_0x0584('0x31')],_0x139ad7[_0x0584('0x2d')]);_0x64fb74[_0x0584('0x32')]=_[_0x0584('0x30')](_0x139ad7[_0x0584('0x31')],qs['fields'](_0x28b51c['query'][_0x0584('0x33')]));_0x64fb74[_0x0584('0x32')]=_0x64fb74[_0x0584('0x32')]['length']?_0x64fb74[_0x0584('0x32')]:_0x139ad7[_0x0584('0x31')];if(!_0x28b51c[_0x0584('0x2d')][_0x0584('0x34')](_0x0584('0x35'))){_0x64fb74['limit']=qs[_0x0584('0x19')](_0x28b51c[_0x0584('0x2d')]['limit']);_0x64fb74[_0x0584('0x17')]=qs[_0x0584('0x17')](_0x28b51c['query'][_0x0584('0x17')]);}_0x64fb74[_0x0584('0x36')]=qs[_0x0584('0x37')](_0x28b51c[_0x0584('0x2d')][_0x0584('0x37')]);_0x64fb74[_0x0584('0x38')]=qs[_0x0584('0x2f')](_[_0x0584('0x39')](_0x28b51c[_0x0584('0x2d')],_0x139ad7[_0x0584('0x2f')]),_0x46d6c4);if(_0x28b51c[_0x0584('0x2d')][_0x0584('0x3a')]){_0x64fb74[_0x0584('0x38')]=_[_0x0584('0x3b')](_0x64fb74[_0x0584('0x38')],{'$or':_['map'](_0x46d6c4,function(_0x5bb269){if(_0x5bb269[_0x0584('0x3c')]!==_0x0584('0x3d')){var _0x367a1a={};_0x367a1a[_0x5bb269[_0x0584('0x25')]]={'$like':'%'+_0x28b51c[_0x0584('0x2d')][_0x0584('0x3a')]+'%'};return _0x367a1a;}})});}_0x64fb74=_['merge']({},_0x64fb74,_0x28b51c[_0x0584('0x3e')]);var _0x4f8d9a={'where':_0x64fb74[_0x0584('0x38')]};return db[_0x0584('0x29')]['count'](_0x4f8d9a)[_0x0584('0x21')](function(_0x34ce68){_0x41b36e['count']=_0x34ce68;if(_0x28b51c['query'][_0x0584('0x3f')]){_0x64fb74[_0x0584('0x40')]=[{'all':!![]}];}return db[_0x0584('0x29')][_0x0584('0x41')](_0x64fb74);})[_0x0584('0x21')](function(_0x4f8bb4){_0x41b36e['rows']=_0x4f8bb4;return _0x41b36e;})[_0x0584('0x21')](respondWithFilteredResult(_0x1911a8,_0x64fb74))[_0x0584('0x42')](handleError(_0x1911a8,null));};exports[_0x0584('0x43')]=function(_0x5acd7f,_0x27b816){var _0x3c45ae={'raw':!![],'where':{'id':_0x5acd7f[_0x0584('0x44')]['id']}},_0x4d4166={};_0x4d4166[_0x0584('0x31')]=_[_0x0584('0x2e')](db[_0x0584('0x29')][_0x0584('0x2a')]);_0x4d4166['query']=_['keys'](_0x5acd7f[_0x0584('0x2d')]);_0x4d4166[_0x0584('0x2f')]=_[_0x0584('0x30')](_0x4d4166[_0x0584('0x31')],_0x4d4166[_0x0584('0x2d')]);_0x3c45ae[_0x0584('0x32')]=_[_0x0584('0x30')](_0x4d4166['model'],qs[_0x0584('0x33')](_0x5acd7f['query'][_0x0584('0x33')]));_0x3c45ae[_0x0584('0x32')]=_0x3c45ae[_0x0584('0x32')][_0x0584('0x45')]?_0x3c45ae[_0x0584('0x32')]:_0x4d4166[_0x0584('0x31')];if(_0x5acd7f[_0x0584('0x2d')]['includeAll']){_0x3c45ae['include']=[{'all':!![]}];}_0x3c45ae=_[_0x0584('0x3b')]({},_0x3c45ae,_0x5acd7f['options']);return db[_0x0584('0x29')][_0x0584('0x46')](_0x3c45ae)[_0x0584('0x21')](handleEntityNotFound(_0x27b816,null))[_0x0584('0x21')](respondWithResult(_0x27b816,null))[_0x0584('0x42')](handleError(_0x27b816,null));};exports[_0x0584('0x47')]=function(_0x42bc90,_0x26e746){return db[_0x0584('0x29')][_0x0584('0x47')](_0x42bc90['body'],{})[_0x0584('0x21')](respondWithResult(_0x26e746,0xc9))[_0x0584('0x42')](handleError(_0x26e746,null));};exports[_0x0584('0x20')]=function(_0x3de69e,_0x417415){if(_0x3de69e['body']['id']){delete _0x3de69e[_0x0584('0x48')]['id'];}return db[_0x0584('0x29')]['find']({'where':{'id':_0x3de69e['params']['id']}})[_0x0584('0x21')](handleEntityNotFound(_0x417415,null))['then'](saveUpdates(_0x3de69e[_0x0584('0x48')],null))[_0x0584('0x21')](respondWithResult(_0x417415,null))[_0x0584('0x42')](handleError(_0x417415,null));};exports['destroy']=function(_0x24816e,_0x5f4413){return db[_0x0584('0x29')]['find']({'where':{'id':_0x24816e[_0x0584('0x44')]['id']}})['then'](handleEntityNotFound(_0x5f4413,null))['then'](removeEntity(_0x5f4413,null))[_0x0584('0x42')](handleError(_0x5f4413,null));};exports[_0x0584('0x49')]=function(_0x3c2b9d,_0x356f26){return db['ChatTransferReport'][_0x0584('0x49')]()[_0x0584('0x21')](respondWithResult(_0x356f26,null))[_0x0584('0x42')](handleError(_0x356f26,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 2483b7c..126dc1f 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 _0x1948=['../../config/environment','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5c0570,_0x6adc25){var _0x3611ca=function(_0x4065ab){while(--_0x4065ab){_0x5c0570['push'](_0x5c0570['shift']());}};_0x3611ca(++_0x6adc25);}(_0x1948,0x71));var _0x8194=function(_0xb5a41,_0x200edb){_0xb5a41=_0xb5a41-0x0;var _0x6d1194=_0x1948[_0xb5a41];return _0x6d1194;};'use strict';var _=require(_0x8194('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8194('0x1'));var moment=require(_0x8194('0x2'));var BPromise=require(_0x8194('0x3'));var rp=require(_0x8194('0x4'));var fs=require('fs');var path=require(_0x8194('0x5'));var rimraf=require(_0x8194('0x6'));var config=require(_0x8194('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0x8194('0x8')]=function(_0x4bed85,_0x58ce03){return _0x4bed85['define'](_0x8194('0x9'),attributes,{'tableName':_0x8194('0xa'),'paranoid':![],'indexes':[{'name':_0x8194('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x12f5=['uniqueid','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','./chatTransferReport.attributes','exports','define'];(function(_0x42299,_0x5e65cc){var _0xd2ebd1=function(_0x5486c1){while(--_0x5486c1){_0x42299['push'](_0x42299['shift']());}};_0xd2ebd1(++_0x5e65cc);}(_0x12f5,0x1c4));var _0x512f=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x12f5[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x512f('0x0'));var util=require(_0x512f('0x1'));var logger=require(_0x512f('0x2'))('api');var moment=require(_0x512f('0x3'));var BPromise=require('bluebird');var rp=require(_0x512f('0x4'));var fs=require('fs');var path=require(_0x512f('0x5'));var rimraf=require('rimraf');var config=require(_0x512f('0x6'));var attributes=require(_0x512f('0x7'));module[_0x512f('0x8')]=function(_0xf873bd,_0x147363){return _0xf873bd[_0x512f('0x9')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x512f('0xa'),'fields':[_0x512f('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 cdb4399..5309726 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 _0x822b=['client','http','request','then','info','request\x20sent','debug','error','code','message','ChatTransferReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise'];(function(_0x17afd2,_0x4deb5e){var _0x3c7fec=function(_0x10a031){while(--_0x10a031){_0x17afd2['push'](_0x17afd2['shift']());}};_0x3c7fec(++_0x4deb5e);}(_0x822b,0x183));var _0xb822=function(_0x58f923,_0x2ac4a7){_0x58f923=_0x58f923-0x0;var _0x12088c=_0x822b[_0x58f923];return _0x12088c;};'use strict';var _=require(_0xb822('0x0'));var util=require(_0xb822('0x1'));var moment=require(_0xb822('0x2'));var BPromise=require(_0xb822('0x3'));var rs=require(_0xb822('0x4'));var fs=require('fs');var Redis=require(_0xb822('0x5'));var db=require(_0xb822('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb822('0x7'));var config=require('../../config/environment');var jayson=require(_0xb822('0x8'));var client=jayson[_0xb822('0x9')][_0xb822('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38b1d6,_0x9b03a1,_0x5968ff){return new BPromise(function(_0x4db15f,_0x3669db){return client[_0xb822('0xb')](_0x38b1d6,_0x5968ff)[_0xb822('0xc')](function(_0x2005fb){logger[_0xb822('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x9b03a1,_0xb822('0xe'));logger[_0xb822('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x9b03a1,_0xb822('0xe'),JSON['stringify'](_0x2005fb));if(_0x2005fb[_0xb822('0x10')]){if(_0x2005fb[_0xb822('0x10')][_0xb822('0x11')]===0x1f4){logger[_0xb822('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x9b03a1,_0x2005fb[_0xb822('0x10')][_0xb822('0x12')]);return _0x3669db(_0x2005fb['error']['message']);}logger[_0xb822('0x10')](_0xb822('0x13'),_0x9b03a1,_0x2005fb[_0xb822('0x10')][_0xb822('0x12')]);return _0x4db15f(_0x2005fb[_0xb822('0x10')][_0xb822('0x12')]);}else{logger['info'](_0xb822('0x13'),_0x9b03a1,'request\x20sent');_0x4db15f(_0x2005fb[_0xb822('0x14')][_0xb822('0x12')]);}})[_0xb822('0x15')](function(_0x4c860f){logger[_0xb822('0x10')](_0xb822('0x13'),_0x9b03a1,_0x4c860f);_0x3669db(_0x4c860f);});});}
\ No newline at end of file
+var _0x2130=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x37026d,_0x4323ad){var _0x4c2c88=function(_0x507a94){while(--_0x507a94){_0x37026d['push'](_0x37026d['shift']());}};_0x4c2c88(++_0x4323ad);}(_0x2130,0xf7));var _0x0213=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x2130[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0x0213('0x0'));var util=require(_0x0213('0x1'));var moment=require('moment');var BPromise=require(_0x0213('0x2'));var rs=require(_0x0213('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0213('0x4'))['db'];var utils=require(_0x0213('0x5'));var logger=require(_0x0213('0x6'))(_0x0213('0x7'));var config=require('../../config/environment');var jayson=require(_0x0213('0x8'));var client=jayson[_0x0213('0x9')][_0x0213('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bfd1c,_0x48b9f9,_0x53291){return new BPromise(function(_0x5d2aee,_0x387bb9){return client['request'](_0x2bfd1c,_0x53291)[_0x0213('0xb')](function(_0x561bff){logger[_0x0213('0xc')](_0x0213('0xd'),_0x48b9f9,_0x0213('0xe'));logger[_0x0213('0xf')](_0x0213('0x10'),_0x48b9f9,_0x0213('0xe'),JSON[_0x0213('0x11')](_0x561bff));if(_0x561bff[_0x0213('0x12')]){if(_0x561bff[_0x0213('0x12')]['code']===0x1f4){logger[_0x0213('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x48b9f9,_0x561bff['error'][_0x0213('0x13')]);return _0x387bb9(_0x561bff['error'][_0x0213('0x13')]);}logger['error'](_0x0213('0xd'),_0x48b9f9,_0x561bff[_0x0213('0x12')][_0x0213('0x13')]);return _0x5d2aee(_0x561bff[_0x0213('0x12')][_0x0213('0x13')]);}else{logger[_0x0213('0xc')](_0x0213('0xd'),_0x48b9f9,_0x0213('0xe'));_0x5d2aee(_0x561bff[_0x0213('0x14')][_0x0213('0x13')]);}})['catch'](function(_0x37ee63){logger[_0x0213('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x48b9f9,_0x37ee63);_0x387bb9(_0x37ee63);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 93648a7..b9b0bc4 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 _0xa76b=['put','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create'];(function(_0xf6cfb4,_0x395579){var _0x2d3841=function(_0x14acca){while(--_0x14acca){_0xf6cfb4['push'](_0xf6cfb4['shift']());}};_0x2d3841(++_0x395579);}(_0xa76b,0x17e));var _0xba76=function(_0x31c9d9,_0x4b8036){_0x31c9d9=_0x31c9d9-0x0;var _0x594d55=_0xa76b[_0x31c9d9];return _0x594d55;};'use strict';var multer=require(_0xba76('0x0'));var util=require('util');var path=require(_0xba76('0x1'));var timeout=require(_0xba76('0x2'));var express=require(_0xba76('0x3'));var router=express[_0xba76('0x4')]();var fs_extra=require(_0xba76('0x5'));var auth=require(_0xba76('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xba76('0x7'));var controller=require(_0xba76('0x8'));router[_0xba76('0x9')]('/',auth[_0xba76('0xa')](),controller[_0xba76('0xb')]);router[_0xba76('0x9')](_0xba76('0xc'),auth['isAuthenticated'](),controller[_0xba76('0xd')]);router[_0xba76('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xba76('0xe')]);router[_0xba76('0xf')]('/',auth[_0xba76('0xa')](),controller[_0xba76('0x10')]);router[_0xba76('0x11')](_0xba76('0x12'),auth[_0xba76('0xa')](),controller['update']);router['delete'](_0xba76('0x12'),auth[_0xba76('0xa')](),controller[_0xba76('0x13')]);module[_0xba76('0x14')]=router;
\ No newline at end of file
+var _0xc802=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller','index','get','isAuthenticated','describe','show','post','create','put','update','/:id','destroy','multer','util'];(function(_0x354d5c,_0x1c35f4){var _0x1a8b66=function(_0x40b980){while(--_0x40b980){_0x354d5c['push'](_0x354d5c['shift']());}};_0x1a8b66(++_0x1c35f4);}(_0xc802,0x1f2));var _0x2c80=function(_0x5ed846,_0x5e2ca8){_0x5ed846=_0x5ed846-0x0;var _0x567083=_0xc802[_0x5ed846];return _0x567083;};'use strict';var multer=require(_0x2c80('0x0'));var util=require(_0x2c80('0x1'));var path=require(_0x2c80('0x2'));var timeout=require(_0x2c80('0x3'));var express=require(_0x2c80('0x4'));var router=express[_0x2c80('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2c80('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2c80('0x7'));var controller=require(_0x2c80('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x2c80('0x9')]);router[_0x2c80('0xa')]('/describe',auth[_0x2c80('0xb')](),controller[_0x2c80('0xc')]);router[_0x2c80('0xa')]('/:id',auth[_0x2c80('0xb')](),controller[_0x2c80('0xd')]);router[_0x2c80('0xe')]('/',auth[_0x2c80('0xb')](),controller[_0x2c80('0xf')]);router[_0x2c80('0x10')]('/:id',auth[_0x2c80('0xb')](),controller[_0x2c80('0x11')]);router['delete'](_0x2c80('0x12'),auth['isAuthenticated'](),controller[_0x2c80('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 98c3114..b6b9047 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 _0x279a=['email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','thumb','star','input','name','text','getDataValue','onlineForm','parse','stringify','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','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','randomstring','exports','STRING','address'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x279a,0x1c7));var _0xa279=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x279a[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xa279('0x0'));module[_0xa279('0x1')]={'name':{'type':Sequelize[_0xa279('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa279('0x3')},'description':{'type':Sequelize[_0xa279('0x2')]},'mapKey':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x4')},'mapKeyOffline':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x4')},'key':{'type':Sequelize[_0xa279('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x5')},'customerAlias':{'type':Sequelize[_0xa279('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa279('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xa279('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa279('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xa279('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xa279('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xa279('0xa')]('rounded','squared'),'defaultValue':_0xa279('0xb')},'header_online':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0xc')},'start_chat_button':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xa279('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xa279('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xa279('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xa279('0x10')]},'closingQuestion':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x13')},'noteTitle':{'type':Sequelize[_0xa279('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x14')},'closingMessage':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x15')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xa279('0xe')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x16')},'ratingType':{'type':Sequelize[_0xa279('0xa')]('star',_0xa279('0x17')),'defaultValue':_0xa279('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xa279('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xa279('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xa279('0x19'),'variable':null,'config':{'placeholder':_0xa279('0x1a'),'type':_0xa279('0x1b'),'required':!![]},'props':{'title':_0xa279('0x1a'),'helpText':''}},{'type':_0xa279('0x19'),'props':{'title':_0xa279('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xa279('0x4'),'type':_0xa279('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xa279('0x1c')](_0xa279('0x1d'))?JSON[_0xa279('0x1e')](this[_0xa279('0x1c')]('onlineForm')):{};},'set':function(_0x107f1f){return this['setDataValue']('onlineForm',JSON[_0xa279('0x1f')](_0x107f1f));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xa279('0x1f')]({'items':[{'type':_0xa279('0x19'),'props':{'title':_0xa279('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xa279('0x4'),'type':_0xa279('0x4')},'variable':null},{'type':_0xa279('0x20'),'config':{'placeholder':_0xa279('0x21')},'props':{'title':_0xa279('0x21'),'helpText':_0xa279('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0xa279('0x1c')](_0xa279('0x23'))?JSON[_0xa279('0x1e')](this[_0xa279('0x1c')](_0xa279('0x23'))):{};},'set':function(_0x195659){return this['setDataValue'](_0xa279('0x23'),JSON['stringify'](_0x195659));}},'token':{'type':Sequelize[_0xa279('0x2')],'defaultValue':function(){return rs[_0xa279('0x24')]();}},'autoclose':{'type':Sequelize[_0xa279('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xa279('0x2')]},'forwardOffline':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xa279('0x2')]},'waitingTitle':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x25')},'waitingMessage':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x26')},'offlineMessageSubject':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x27')},'offlineMessageBody':{'type':Sequelize[_0xa279('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xa279('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x28')},'skipUnmanaged':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x29')},'sendUnmanaged':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xa279('0x10')]},'showAgentAvatar':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xa279('0x10')],'defaultValue':function(){return _0xa279('0x2a');}},'notificationSound':{'type':Sequelize[_0xa279('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xa279('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa279('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xa279('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x2b')},'defaultTitle':{'type':Sequelize[_0xa279('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xa279('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xa279('0x2')],'allowNull':![],'defaultValue':_0xa279('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa279('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa279('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xa279('0x2')],'defaultValue':_0xa279('0x2d')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa279('0x8')],'comment':_0xa279('0x2e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xa279('0x2f'),'set':function(_0x45a3c6){if(!_0x45a3c6)this[_0xa279('0x30')]('mandatoryDispositionPauseId',null);this[_0xa279('0x30')](_0xa279('0x31'),_0x45a3c6);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xa279('0x2')]},'vidaooTopic':{'type':Sequelize[_0xa279('0x2')],'allowNull':![],'defaultValue':_0xa279('0x32')},'vidaooNote':{'type':Sequelize[_0xa279('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xa279('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xa279('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xa279('0x10')]}};
\ No newline at end of file
+var _0xff02=['Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','text','onlineForm','getDataValue','textarea','Leave\x20your\x20comments','parse','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.','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat'];(function(_0x1ac5e1,_0x43a483){var _0x3ae80e=function(_0x234518){while(--_0x234518){_0x1ac5e1['push'](_0x1ac5e1['shift']());}};_0x3ae80e(++_0x43a483);}(_0xff02,0x12f));var _0x2ff0=function(_0x2e4f74,_0x4c9771){_0x2e4f74=_0x2e4f74-0x0;var _0x2540c3=_0xff02[_0x2e4f74];return _0x2540c3;};'use strict';var Sequelize=require(_0x2ff0('0x0'));var rs=require(_0x2ff0('0x1'));module[_0x2ff0('0x2')]={'name':{'type':Sequelize[_0x2ff0('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x2ff0('0x3')],'allowNull':![],'unique':_0x2ff0('0x4')},'description':{'type':Sequelize[_0x2ff0('0x3')]},'mapKey':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x2ff0('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x2ff0('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x2ff0('0x3')],'allowNull':![],'defaultValue':_0x2ff0('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x2ff0('0x3')],'allowNull':![],'defaultValue':_0x2ff0('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x2ff0('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x2ff0('0x3')]},'animation':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x2ff0('0xb')](_0x2ff0('0xc'),'squared'),'defaultValue':_0x2ff0('0xc')},'header_online':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0xd')},'start_chat_button':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0xe')},'offline_chat_button':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0xf')},'header_offline':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0x10')},'download_transcript':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x2ff0('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x2ff0('0x12')]},'closingQuestion':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2ff0('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0x14')},'noteTitle':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0x15')},'placeholderMessage':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0x16')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2ff0('0x17')},'closingMessageButton':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0xf')},'skipMessageButton':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0x18')},'conditionAgreement':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0x19')},'ratingType':{'type':Sequelize['ENUM'](_0x2ff0('0x1a'),_0x2ff0('0x1b')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x2ff0('0x12')],'defaultValue':function(){return JSON[_0x2ff0('0x1c')]({'items':[{'type':_0x2ff0('0x1d'),'variable':null,'config':{'placeholder':_0x2ff0('0x1e'),'type':_0x2ff0('0x1f'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x2ff0('0x1d'),'props':{'title':_0x2ff0('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x2ff0('0x5'),'type':_0x2ff0('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x2ff0('0x20'))?JSON['parse'](this[_0x2ff0('0x21')]('onlineForm')):{};},'set':function(_0x27e7c8){return this['setDataValue']('onlineForm',JSON[_0x2ff0('0x1c')](_0x27e7c8));}},'offlineForm':{'type':Sequelize[_0x2ff0('0x12')],'defaultValue':function(){return JSON[_0x2ff0('0x1c')]({'items':[{'type':_0x2ff0('0x1d'),'props':{'title':_0x2ff0('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x2ff0('0x5'),'type':_0x2ff0('0x5')},'variable':null},{'type':_0x2ff0('0x22'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x2ff0('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0x2ff0('0x21')]('offlineForm')?JSON[_0x2ff0('0x24')](this[_0x2ff0('0x21')](_0x2ff0('0x25'))):{};},'set':function(_0x5b8154){return this['setDataValue'](_0x2ff0('0x25'),JSON['stringify'](_0x5b8154));}},'token':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':function(){return rs[_0x2ff0('0x26')]();}},'autoclose':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x2ff0('0x3')]},'waitingTitle':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0x27')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2ff0('0x28')},'offlineMessageSubject':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'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['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0x29')},'skipUnmanaged':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0x18')},'sendUnmanaged':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x2ff0('0x12')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x2ff0('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x2ff0('0x2a');}},'notificationSound':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x2ff0('0x9')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0x2c')},'defaultTitle':{'type':Sequelize[_0x2ff0('0x3')]},'customerAvatar':{'type':Sequelize[_0x2ff0('0x12')]},'showCustomerAvatar':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x2ff0('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x2ff0('0x3')],'allowNull':![],'defaultValue':_0x2ff0('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2ff0('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2ff0('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':_0x2ff0('0x2e')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2ff0('0x9')],'comment':_0x2ff0('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![],'comment':_0x2ff0('0x30'),'set':function(_0xcf9a84){if(!_0xcf9a84)this[_0x2ff0('0x31')](_0x2ff0('0x32'),null);this[_0x2ff0('0x31')]('mandatoryDisposition',_0xcf9a84);}},'vidaooEscalation':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x2ff0('0x3')]},'vidaooTopic':{'type':Sequelize[_0x2ff0('0x3')],'allowNull':![],'defaultValue':_0x2ff0('0x33')},'vidaooNote':{'type':Sequelize[_0x2ff0('0x3')],'defaultValue':function(){return _0x2ff0('0x34');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x2ff0('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x2ff0('0x12')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 238694b..a62ffaf 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 _0x85ce=['ids','addAnswer','CannedAnswer','rawAttributes','removeAnswers','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','getResult','chat','CmContact','Sequelize','updatedAt','CompanyId','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','defaults','ListId','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','format','%s\x20%s','version','unknown','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','messageId','created','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','offline','files','no\x20available\x20attributes','createdAt','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','server','attachments','basename','Attachment','bulkCreate','MailServerOut','forwardOffline','forwardOfflineAddress','service','Smtp','host','secure','authentication','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','mimetype','subjectOffline','toPairsIn','mapValues','NotifyMailAccount','notifyMail','offline-chat','addInteraction','getInteractions','Owner','fullname','internal','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','some','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','referer','render','color_button','backgroundColor','addApplications','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','jayson/promise','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','type','key','model','keys','query','filters','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','show','params','intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','Disposition','findOne','nolimit','ChatWebsiteId','include','findAll','removeDispositions'];(function(_0x1e1c3f,_0x34eedb){var _0x5c3a05=function(_0x1c756d){while(--_0x1c756d){_0x1e1c3f['push'](_0x1e1c3f['shift']());}};_0x5c3a05(++_0x34eedb);}(_0x85ce,0xc9));var _0xe85c=function(_0x3d6cb1,_0x5289ce){_0x3d6cb1=_0x3d6cb1-0x0;var _0x22f035=_0x85ce[_0x3d6cb1];return _0x22f035;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe85c('0x0'));var jsonpatch=require(_0xe85c('0x1'));var rp=require(_0xe85c('0x2'));var moment=require(_0xe85c('0x3'));var BPromise=require(_0xe85c('0x4'));var Mustache=require(_0xe85c('0x5'));var util=require(_0xe85c('0x6'));var path=require(_0xe85c('0x7'));var sox=require('sox');var csv=require(_0xe85c('0x8'));var ejs=require(_0xe85c('0x9'));var fs=require('fs');var fs_extra=require(_0xe85c('0xa'));var _=require(_0xe85c('0xb'));var squel=require('squel');var crypto=require(_0xe85c('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe85c('0x8'));var querystring=require(_0xe85c('0xd'));var Papa=require(_0xe85c('0xe'));var Redis=require(_0xe85c('0xf'));var authService=require(_0xe85c('0x10'));var qs=require(_0xe85c('0x11'));var as=require(_0xe85c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe85c('0x13'));var utils=require(_0xe85c('0x14'));var config=require(_0xe85c('0x15'));var licenseUtil=require(_0xe85c('0x16'));var db=require(_0xe85c('0x17'))['db'];config['redis']=_['defaults'](config[_0xe85c('0x18')],{'host':_0xe85c('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe85c('0x18')]));require('./chatWebsite.socket')[_0xe85c('0x1a')](socket);var jayson=require(_0xe85c('0x1b'));var client=jayson[_0xe85c('0x1c')][_0xe85c('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xe85c('0x1d')]({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0xe85c('0x1c')][_0xe85c('0x1d')]({'port':0x2329});function respondWithRpcPromise(_0x5b25e1,_0x2ab2fe,_0x46f1b3,_0x1b7739){return new BPromise(function(_0x228664,_0x10c169){var _0x26337a=_0x1b7739||client;return _0x26337a[_0xe85c('0x1e')](_0x5b25e1,_0x46f1b3)[_0xe85c('0x1f')](function(_0x448412){logger['info'](_0xe85c('0x20'),_0x2ab2fe,_0xe85c('0x21'));logger[_0xe85c('0x22')](_0xe85c('0x23'),_0x2ab2fe,'request\x20sent',JSON['stringify'](_0x448412));if(_0x448412[_0xe85c('0x24')]){if(_0x448412[_0xe85c('0x24')][_0xe85c('0x25')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x2ab2fe,_0x448412[_0xe85c('0x24')][_0xe85c('0x26')]);return _0x10c169(_0x448412[_0xe85c('0x24')][_0xe85c('0x26')]);}logger[_0xe85c('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x2ab2fe,_0x448412[_0xe85c('0x24')][_0xe85c('0x26')]);return _0x228664(_0x448412['error']['message']);}else{logger[_0xe85c('0x27')](_0xe85c('0x20'),_0x2ab2fe,_0xe85c('0x21'));_0x228664(_0x448412[_0xe85c('0x28')]['message']);}})[_0xe85c('0x29')](function(_0x55ebbc){logger[_0xe85c('0x24')](_0xe85c('0x20'),_0x2ab2fe,_0x55ebbc);_0x10c169(_0x55ebbc);});});}function respondWithStatusCode(_0x35fa41,_0x9c2fae){_0x9c2fae=_0x9c2fae||0xcc;return function(_0x1adb9d){if(_0x1adb9d){return _0x35fa41[_0xe85c('0x2a')](_0x9c2fae);}return _0x35fa41[_0xe85c('0x2b')](_0x9c2fae)[_0xe85c('0x2c')]();};}function respondWithResult(_0x139493,_0x31ef23){_0x31ef23=_0x31ef23||0xc8;return function(_0x17e5cb){if(_0x17e5cb){return _0x139493[_0xe85c('0x2b')](_0x31ef23)['json'](_0x17e5cb);}};}function respondWithFilteredResult(_0x155a7e,_0x5017ab){return function(_0x3467d0){if(_0x3467d0){var _0x26ecb3=typeof _0x5017ab['offset']===_0xe85c('0x2d')&&typeof _0x5017ab[_0xe85c('0x2e')]===_0xe85c('0x2d');var _0x4311db=_0x3467d0[_0xe85c('0x2f')];var _0x25fb88=_0x26ecb3?0x0:_0x5017ab[_0xe85c('0x30')];var _0xac67e6=_0x26ecb3?_0x3467d0[_0xe85c('0x2f')]:_0x5017ab[_0xe85c('0x30')]+_0x5017ab[_0xe85c('0x2e')];var _0x40ae74;if(_0xac67e6>=_0x4311db){_0xac67e6=_0x4311db;_0x40ae74=0xc8;}else{_0x40ae74=0xce;}_0x155a7e[_0xe85c('0x2b')](_0x40ae74);return _0x155a7e[_0xe85c('0x31')](_0xe85c('0x32'),_0x25fb88+'-'+_0xac67e6+'/'+_0x4311db)[_0xe85c('0x33')](_0x3467d0);}return null;};}function patchUpdates(_0x4ed158){return function(_0x22b1d2){try{jsonpatch[_0xe85c('0x34')](_0x22b1d2,_0x4ed158,!![]);}catch(_0x513e64){return BPromise['reject'](_0x513e64);}return _0x22b1d2[_0xe85c('0x35')]();};}function saveUpdates(_0x5a228a,_0x261bcc){return function(_0x8f39e6){if(_0x8f39e6){return _0x8f39e6['update'](_0x5a228a)[_0xe85c('0x1f')](function(_0x2f7ef1){return _0x2f7ef1;});}return null;};}function removeEntity(_0x5032da,_0x39e280){return function(_0x119884){if(_0x119884){return _0x119884[_0xe85c('0x36')]()[_0xe85c('0x1f')](function(){var _0x215639=_0x119884[_0xe85c('0x37')]({'plain':!![]});var _0x118528='ChatWebsites';return db[_0xe85c('0x38')][_0xe85c('0x36')]({'where':{'type':_0x118528,'resourceId':_0x215639['id']}})[_0xe85c('0x1f')](function(){return _0x119884;});})[_0xe85c('0x1f')](function(){_0x5032da[_0xe85c('0x2b')](0xcc)[_0xe85c('0x2c')]();});}};}function handleEntityNotFound(_0x3729cf,_0x5e56ae){return function(_0x12b901){if(!_0x12b901){_0x3729cf[_0xe85c('0x2a')](0x194);}return _0x12b901;};}function handleError(_0x478d06,_0x1003bf){_0x1003bf=_0x1003bf||0x1f4;return function(_0x175017){logger[_0xe85c('0x24')](_0x175017[_0xe85c('0x39')]);if(_0x175017[_0xe85c('0x3a')]){delete _0x175017[_0xe85c('0x3a')];}_0x478d06[_0xe85c('0x2b')](_0x1003bf)[_0xe85c('0x3b')](_0x175017);};}exports[_0xe85c('0x3c')]=function(_0x1d5374,_0x4d51d8){var _0xbdef2a={'include':[{'model':db[_0xe85c('0x3d')],'as':_0xe85c('0x3e')}]},_0xd67420={},_0x295b26={'count':0x0,'rows':[]};var _0x745a8f=_[_0xe85c('0x3f')](db[_0xe85c('0x40')]['rawAttributes'],function(_0x2d8d7e){return{'name':_0x2d8d7e[_0xe85c('0x41')],'type':_0x2d8d7e[_0xe85c('0x42')][_0xe85c('0x43')]};});_0xd67420[_0xe85c('0x44')]=_[_0xe85c('0x3f')](_0x745a8f,_0xe85c('0x3a'));_0xd67420['query']=_[_0xe85c('0x45')](_0x1d5374[_0xe85c('0x46')]);_0xd67420[_0xe85c('0x47')]=_['intersection'](_0xd67420['model'],_0xd67420[_0xe85c('0x46')]);_0xbdef2a['attributes']=_['intersection'](_0xd67420['model'],qs['fields'](_0x1d5374[_0xe85c('0x46')][_0xe85c('0x48')]));_0xbdef2a[_0xe85c('0x49')]=_0xbdef2a[_0xe85c('0x49')][_0xe85c('0x4a')]?_0xbdef2a['attributes']:_0xd67420[_0xe85c('0x44')];if(!_0x1d5374[_0xe85c('0x46')][_0xe85c('0x4b')]('nolimit')){_0xbdef2a[_0xe85c('0x2e')]=qs[_0xe85c('0x2e')](_0x1d5374['query'][_0xe85c('0x2e')]);_0xbdef2a[_0xe85c('0x30')]=qs['offset'](_0x1d5374[_0xe85c('0x46')]['offset']);}_0xbdef2a[_0xe85c('0x4c')]=qs[_0xe85c('0x4d')](_0x1d5374[_0xe85c('0x46')][_0xe85c('0x4d')]);_0xbdef2a['where']=qs[_0xe85c('0x47')](_[_0xe85c('0x4e')](_0x1d5374[_0xe85c('0x46')],_0xd67420[_0xe85c('0x47')]),_0x745a8f);if(_0x1d5374[_0xe85c('0x46')][_0xe85c('0x4f')]){_0xbdef2a[_0xe85c('0x50')]=_[_0xe85c('0x51')](_0xbdef2a['where'],{'$or':_[_0xe85c('0x3f')](_0x745a8f,function(_0x4c56fa){if(_0x4c56fa['type']!==_0xe85c('0x52')){var _0x105d46={};_0x105d46[_0x4c56fa[_0xe85c('0x3a')]]={'$like':'%'+_0x1d5374[_0xe85c('0x46')][_0xe85c('0x4f')]+'%'};return _0x105d46;}})});}_0xbdef2a=_[_0xe85c('0x51')]({},_0xbdef2a,_0x1d5374[_0xe85c('0x53')]);var _0x1e19be={'where':_0xbdef2a[_0xe85c('0x50')]};return db[_0xe85c('0x40')][_0xe85c('0x2f')](_0x1e19be)['then'](function(_0x33cb6c){_0x295b26[_0xe85c('0x2f')]=_0x33cb6c;if(_0x1d5374[_0xe85c('0x46')][_0xe85c('0x54')]){_0xbdef2a['include']=[{'all':!![]}];}return db[_0xe85c('0x40')]['findAll'](_0xbdef2a);})[_0xe85c('0x1f')](function(_0x412327){_0x295b26[_0xe85c('0x55')]=_0x412327;return _0x295b26;})[_0xe85c('0x1f')](respondWithFilteredResult(_0x4d51d8,_0xbdef2a))[_0xe85c('0x29')](handleError(_0x4d51d8,null));};exports[_0xe85c('0x56')]=function(_0x3e49d9,_0x5b2237){var _0x3351a8={'raw':![],'where':{'id':_0x3e49d9[_0xe85c('0x57')]['id']},'include':[{'model':db[_0xe85c('0x3d')],'as':_0xe85c('0x3e')}]},_0x25ea70={};_0x25ea70[_0xe85c('0x44')]=_[_0xe85c('0x45')](db['ChatWebsite']['rawAttributes']);_0x25ea70[_0xe85c('0x46')]=_[_0xe85c('0x45')](_0x3e49d9[_0xe85c('0x46')]);_0x25ea70[_0xe85c('0x47')]=_['intersection'](_0x25ea70[_0xe85c('0x44')],_0x25ea70['query']);_0x3351a8[_0xe85c('0x49')]=_[_0xe85c('0x58')](_0x25ea70[_0xe85c('0x44')],qs[_0xe85c('0x48')](_0x3e49d9['query']['fields']));_0x3351a8[_0xe85c('0x49')]=_0x3351a8[_0xe85c('0x49')][_0xe85c('0x4a')]?_0x3351a8[_0xe85c('0x49')]:_0x25ea70[_0xe85c('0x44')];if(_0x3e49d9[_0xe85c('0x46')][_0xe85c('0x54')]){_0x3351a8['include']=[{'all':!![]}];}_0x3351a8=_[_0xe85c('0x51')]({},_0x3351a8,_0x3e49d9[_0xe85c('0x53')]);return db[_0xe85c('0x40')][_0xe85c('0x59')](_0x3351a8)['then'](handleEntityNotFound(_0x5b2237,null))['then'](respondWithResult(_0x5b2237,null))['catch'](handleError(_0x5b2237,null));};exports[_0xe85c('0x5a')]=function(_0x10d738,_0x2d41be){return db[_0xe85c('0x40')][_0xe85c('0x5a')](_0x10d738['body'],{})[_0xe85c('0x1f')](function(_0x4e8763){var _0x563408=_0x10d738[_0xe85c('0x5b')][_0xe85c('0x37')]({'plain':!![]});if(!_0x563408)throw new Error(_0xe85c('0x5c'));if(_0x563408[_0xe85c('0x5d')]===_0xe85c('0x5b')){var _0x374f2b=_0x4e8763['get']({'plain':!![]});var _0x48a7ab='ChatWebsites';return db[_0xe85c('0x5e')][_0xe85c('0x59')]({'where':{'name':_0x48a7ab,'userProfileId':_0x563408[_0xe85c('0x5f')]},'raw':!![]})[_0xe85c('0x1f')](function(_0x4e38eb){if(_0x4e38eb&&_0x4e38eb[_0xe85c('0x60')]===0x0){return db['UserProfileResource'][_0xe85c('0x5a')]({'name':_0x374f2b[_0xe85c('0x3a')],'resourceId':_0x374f2b['id'],'type':_0x4e38eb[_0xe85c('0x3a')],'sectionId':_0x4e38eb['id']},{})[_0xe85c('0x1f')](function(){return _0x4e8763;});}else{return _0x4e8763;}})['catch'](function(_0x4514e1){logger[_0xe85c('0x24')](_0xe85c('0x61'),_0x4514e1);throw _0x4514e1;});}return _0x4e8763;})['then'](respondWithResult(_0x2d41be,0xc9))[_0xe85c('0x29')](handleError(_0x2d41be,null));};exports[_0xe85c('0x62')]=function(_0x1f71f2,_0x5ef7ed){if(_0x1f71f2[_0xe85c('0x63')]['id']){delete _0x1f71f2[_0xe85c('0x63')]['id'];}return db[_0xe85c('0x40')][_0xe85c('0x59')]({'where':{'id':_0x1f71f2[_0xe85c('0x57')]['id']},'include':[{'model':db[_0xe85c('0x3d')],'as':_0xe85c('0x3e')}]})['then'](handleEntityNotFound(_0x5ef7ed,null))['then'](saveUpdates(_0x1f71f2[_0xe85c('0x63')],null))[_0xe85c('0x1f')](respondWithResult(_0x5ef7ed,null))[_0xe85c('0x29')](handleError(_0x5ef7ed,null));};exports['destroy']=function(_0x1f32c5,_0x1398d9){return db['ChatWebsite'][_0xe85c('0x59')]({'where':{'id':_0x1f32c5[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x1398d9,null))[_0xe85c('0x1f')](removeEntity(_0x1398d9,null))[_0xe85c('0x29')](handleError(_0x1398d9,null));};exports[_0xe85c('0x64')]=function(_0x295eab,_0x488f89){return db[_0xe85c('0x40')][_0xe85c('0x64')]()['then'](respondWithResult(_0x488f89,null))['catch'](handleError(_0x488f89,null));};exports[_0xe85c('0x65')]=function(_0x2faf45,_0x71698c,_0xc6cb90){if(_0x2faf45[_0xe85c('0x63')]['id']){delete _0x2faf45[_0xe85c('0x63')]['id'];}return db[_0xe85c('0x40')][_0xe85c('0x59')]({'where':{'id':_0x2faf45[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x71698c,null))['then'](function(_0x438f8f){if(_0x438f8f){_0x2faf45[_0xe85c('0x63')]['ChatWebsiteId']=_0x438f8f['id'];return db[_0xe85c('0x66')][_0xe85c('0x5a')](_0x2faf45['body']);}})[_0xe85c('0x1f')](respondWithResult(_0x71698c,null))[_0xe85c('0x29')](handleError(_0x71698c,null));};exports['getDispositions']=function(_0x492b05,_0x38eb12,_0x542e19){var _0xe91adc={'raw':![],'where':{}};var _0x553497={};var _0x551840={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xe85c('0x67')]({'where':{'id':_0x492b05[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x38eb12,null))['then'](function(_0x3f0ef7){if(_0x3f0ef7){_0x553497['model']=_[_0xe85c('0x45')](db[_0xe85c('0x66')]['rawAttributes']);_0x553497[_0xe85c('0x46')]=_[_0xe85c('0x45')](_0x492b05[_0xe85c('0x46')]);_0x553497['filters']=_[_0xe85c('0x58')](_0x553497[_0xe85c('0x44')],_0x553497['query']);_0xe91adc['attributes']=_[_0xe85c('0x58')](_0x553497[_0xe85c('0x44')],qs[_0xe85c('0x48')](_0x492b05['query'][_0xe85c('0x48')]));_0xe91adc[_0xe85c('0x49')]=_0xe91adc[_0xe85c('0x49')]['length']?_0xe91adc[_0xe85c('0x49')]:_0x553497[_0xe85c('0x44')];if(!_0x492b05['query'][_0xe85c('0x4b')](_0xe85c('0x68'))){_0xe91adc[_0xe85c('0x2e')]=qs['limit'](_0x492b05['query'][_0xe85c('0x2e')]);_0xe91adc[_0xe85c('0x30')]=qs[_0xe85c('0x30')](_0x492b05[_0xe85c('0x46')]['offset']);}_0xe91adc[_0xe85c('0x4c')]=qs[_0xe85c('0x4d')](_0x492b05[_0xe85c('0x46')][_0xe85c('0x4d')]);_0xe91adc[_0xe85c('0x50')]=qs[_0xe85c('0x47')](_[_0xe85c('0x4e')](_0x492b05[_0xe85c('0x46')],_0x553497[_0xe85c('0x47')]));_0xe91adc[_0xe85c('0x50')][_0xe85c('0x69')]=_0x3f0ef7['id'];if(_0x492b05[_0xe85c('0x46')][_0xe85c('0x4f')]){_0xe91adc[_0xe85c('0x50')]=_[_0xe85c('0x51')](_0xe91adc['where'],{'$or':_[_0xe85c('0x3f')](_0xe91adc[_0xe85c('0x49')],function(_0x3e62bf){var _0x3c9008={};_0x3c9008[_0x3e62bf]={'$like':'%'+_0x492b05['query'][_0xe85c('0x4f')]+'%'};return _0x3c9008;})});}_0xe91adc=_[_0xe85c('0x51')]({},_0xe91adc,_0x492b05['options']);return db['Disposition'][_0xe85c('0x2f')]({'where':_0xe91adc[_0xe85c('0x50')]})[_0xe85c('0x1f')](function(_0x127d28){_0x551840['count']=_0x127d28;if(_0x492b05[_0xe85c('0x46')][_0xe85c('0x54')]){_0xe91adc[_0xe85c('0x6a')]=[{'all':!![]}];}return db[_0xe85c('0x66')][_0xe85c('0x6b')](_0xe91adc);})['then'](function(_0x304e77){_0x551840[_0xe85c('0x55')]=_0x304e77;return _0x551840;});}})[_0xe85c('0x1f')](respondWithFilteredResult(_0x38eb12,_0xe91adc))[_0xe85c('0x29')](handleError(_0x38eb12,null));};exports[_0xe85c('0x6c')]=function(_0x4a9ea5,_0x3ec681,_0x19ed0a){return db['ChatWebsite'][_0xe85c('0x59')]({'where':{'id':_0x4a9ea5[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x3ec681,null))['then'](function(_0x5e4b7e){if(_0x5e4b7e){return _0x5e4b7e[_0xe85c('0x6c')](_0x4a9ea5[_0xe85c('0x46')][_0xe85c('0x6d')]);}})[_0xe85c('0x1f')](respondWithStatusCode(_0x3ec681,null))[_0xe85c('0x29')](handleError(_0x3ec681,null));};exports[_0xe85c('0x6e')]=function(_0x4377ca,_0x40209e,_0x34a7be){if(_0x4377ca[_0xe85c('0x63')]['id']){delete _0x4377ca['body']['id'];}return db[_0xe85c('0x40')][_0xe85c('0x59')]({'where':{'id':_0x4377ca[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x40209e,null))[_0xe85c('0x1f')](function(_0xf26ec){if(_0xf26ec){_0x4377ca[_0xe85c('0x63')][_0xe85c('0x69')]=_0xf26ec['id'];return db['CannedAnswer'][_0xe85c('0x5a')](_0x4377ca[_0xe85c('0x63')]);}})['then'](respondWithResult(_0x40209e,null))[_0xe85c('0x29')](handleError(_0x40209e,null));};exports['getAnswers']=function(_0x3be416,_0xbc979,_0x494f4d){var _0xbfe396={'raw':![],'where':{}};var _0x1a2449={};var _0x55d4bb={'count':0x0,'rows':[]};return db[_0xe85c('0x40')]['findOne']({'where':{'id':_0x3be416[_0xe85c('0x57')]['id']}})['then'](handleEntityNotFound(_0xbc979,null))[_0xe85c('0x1f')](function(_0x5d6f03){if(_0x5d6f03){_0x1a2449[_0xe85c('0x44')]=_[_0xe85c('0x45')](db[_0xe85c('0x6f')][_0xe85c('0x70')]);_0x1a2449['query']=_[_0xe85c('0x45')](_0x3be416['query']);_0x1a2449[_0xe85c('0x47')]=_[_0xe85c('0x58')](_0x1a2449[_0xe85c('0x44')],_0x1a2449[_0xe85c('0x46')]);_0xbfe396['attributes']=_[_0xe85c('0x58')](_0x1a2449['model'],qs[_0xe85c('0x48')](_0x3be416[_0xe85c('0x46')][_0xe85c('0x48')]));_0xbfe396['attributes']=_0xbfe396[_0xe85c('0x49')]['length']?_0xbfe396[_0xe85c('0x49')]:_0x1a2449[_0xe85c('0x44')];if(!_0x3be416['query'][_0xe85c('0x4b')](_0xe85c('0x68'))){_0xbfe396['limit']=qs[_0xe85c('0x2e')](_0x3be416['query'][_0xe85c('0x2e')]);_0xbfe396[_0xe85c('0x30')]=qs[_0xe85c('0x30')](_0x3be416['query'][_0xe85c('0x30')]);}_0xbfe396['order']=qs[_0xe85c('0x4d')](_0x3be416[_0xe85c('0x46')]['sort']);_0xbfe396[_0xe85c('0x50')]=qs[_0xe85c('0x47')](_[_0xe85c('0x4e')](_0x3be416[_0xe85c('0x46')],_0x1a2449[_0xe85c('0x47')]));_0xbfe396[_0xe85c('0x50')]['ChatWebsiteId']=_0x5d6f03['id'];if(_0x3be416[_0xe85c('0x46')][_0xe85c('0x4f')]){_0xbfe396[_0xe85c('0x50')]=_[_0xe85c('0x51')](_0xbfe396[_0xe85c('0x50')],{'$or':_[_0xe85c('0x3f')](_0xbfe396[_0xe85c('0x49')],function(_0x4c9d24){var _0x4f92bf={};_0x4f92bf[_0x4c9d24]={'$like':'%'+_0x3be416[_0xe85c('0x46')][_0xe85c('0x4f')]+'%'};return _0x4f92bf;})});}_0xbfe396=_['merge']({},_0xbfe396,_0x3be416[_0xe85c('0x53')]);return db[_0xe85c('0x6f')]['count']({'where':_0xbfe396[_0xe85c('0x50')]})['then'](function(_0x27db95){_0x55d4bb[_0xe85c('0x2f')]=_0x27db95;if(_0x3be416[_0xe85c('0x46')][_0xe85c('0x54')]){_0xbfe396[_0xe85c('0x6a')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0xbfe396);})[_0xe85c('0x1f')](function(_0x195f33){_0x55d4bb[_0xe85c('0x55')]=_0x195f33;return _0x55d4bb;});}})[_0xe85c('0x1f')](respondWithFilteredResult(_0xbc979,_0xbfe396))[_0xe85c('0x29')](handleError(_0xbc979,null));};exports[_0xe85c('0x71')]=function(_0x2158c0,_0x34fa51,_0x1324d0){return db[_0xe85c('0x40')][_0xe85c('0x59')]({'where':{'id':_0x2158c0[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x34fa51,null))['then'](function(_0x4107fd){if(_0x4107fd){return _0x4107fd[_0xe85c('0x71')](_0x2158c0[_0xe85c('0x46')][_0xe85c('0x6d')]);}})['then'](respondWithStatusCode(_0x34fa51,null))[_0xe85c('0x29')](handleError(_0x34fa51,null));};exports[_0xe85c('0x72')]=function(_0x1179b3,_0x38310f,_0x37a7de){_0x1179b3[_0xe85c('0x63')][_0xe85c('0x73')]=_0x1179b3[_0xe85c('0x74')][_0xe85c('0x75')];return db[_0xe85c('0x40')][_0xe85c('0x59')]({'where':{'id':_0x1179b3[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x38310f,null))[_0xe85c('0x1f')](saveUpdates(_0x1179b3[_0xe85c('0x63')],null))['then'](respondWithResult(_0x38310f,null))[_0xe85c('0x29')](handleError(_0x38310f,null));};exports[_0xe85c('0x76')]=function(_0x5d7e5e,_0x2d965b,_0x4fe281){_0x5d7e5e['body']['agentAvatar']=_0x5d7e5e[_0xe85c('0x74')][_0xe85c('0x75')];return db[_0xe85c('0x40')]['find']({'where':{'id':_0x5d7e5e[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x2d965b,null))['then'](saveUpdates(_0x5d7e5e[_0xe85c('0x63')],null))[_0xe85c('0x1f')](respondWithResult(_0x2d965b,null))[_0xe85c('0x29')](handleError(_0x2d965b,null));};exports[_0xe85c('0x77')]=function(_0x526d53,_0x482687,_0x47028c){_0x526d53['body'][_0xe85c('0x78')]=_0x526d53[_0xe85c('0x74')][_0xe85c('0x75')];return db[_0xe85c('0x40')][_0xe85c('0x59')]({'where':{'id':_0x526d53[_0xe85c('0x57')]['id']}})['then'](handleEntityNotFound(_0x482687,null))[_0xe85c('0x1f')](saveUpdates(_0x526d53[_0xe85c('0x63')],null))[_0xe85c('0x1f')](respondWithResult(_0x482687,null))[_0xe85c('0x29')](handleError(_0x482687,null));};exports[_0xe85c('0x79')]=function(_0x21fd27,_0x145961,_0x35a9cf){_0x21fd27[_0xe85c('0x63')][_0xe85c('0x7a')]=_0x21fd27['file']['filename'];return db['ChatWebsite'][_0xe85c('0x59')]({'where':{'id':_0x21fd27[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x145961,null))[_0xe85c('0x1f')](saveUpdates(_0x21fd27['body'],null))['then'](respondWithResult(_0x145961,null))[_0xe85c('0x29')](handleError(_0x145961,null));};exports[_0xe85c('0x7b')]=function(_0x26edbd,_0x453347,_0x44ef05){var _0x1bba0b=path[_0xe85c('0x7c')](config['root'],'server/files/images/logos/default_logo.svg');var _0x2db29b={'where':{'id':_0x26edbd[_0xe85c('0x57')]['id']},'attributes':['id',_0xe85c('0x73')],'raw':!![]};var _0x3ec763=![];return require(_0xe85c('0x16'))[_0xe85c('0x7d')]()[_0xe85c('0x1f')](function(_0x542ad8){if(_0x542ad8){_0x3ec763=_0x542ad8[_0xe85c('0x7e')];}})[_0xe85c('0x1f')](function(){return db['ChatWebsite']['find'](_0x2db29b);})[_0xe85c('0x1f')](handleEntityNotFound(_0x453347,null))[_0xe85c('0x1f')](function(_0xff8912){if(_0xff8912){if(!_[_0xe85c('0x7f')](_0xff8912[_0xe85c('0x73')])){if(fs[_0xe85c('0x80')](path[_0xe85c('0x7c')](config['root'],'server/files/images/logos/',_0xff8912[_0xe85c('0x73')]))&&_0x3ec763){_0x1bba0b=path['join'](config[_0xe85c('0x81')],_0xe85c('0x82'),_0xff8912[_0xe85c('0x73')]);}}return _0x453347[_0xe85c('0x83')](_0x1bba0b);}})['catch'](handleError(_0x453347,null));};exports[_0xe85c('0x84')]=function(_0x305428,_0x48a225,_0x5c6099){var _0x4dd6bd=path[_0xe85c('0x7c')](config[_0xe85c('0x81')],_0xe85c('0x85'));var _0x1a6d3a={'where':{'id':_0x305428[_0xe85c('0x57')]['id']},'attributes':['id',_0xe85c('0x86')],'raw':!![]};return db[_0xe85c('0x40')][_0xe85c('0x59')](_0x1a6d3a)[_0xe85c('0x1f')](handleEntityNotFound(_0x48a225,null))[_0xe85c('0x1f')](function(_0x1cf380){if(_0x1cf380){if(!_[_0xe85c('0x7f')](_0x1cf380['agentAvatar'])){if(fs[_0xe85c('0x80')](path['join'](config[_0xe85c('0x81')],_0xe85c('0x87'),_0x1cf380[_0xe85c('0x86')]))){_0x4dd6bd=path[_0xe85c('0x7c')](config[_0xe85c('0x81')],_0xe85c('0x87'),_0x1cf380[_0xe85c('0x86')]);}}return _0x48a225[_0xe85c('0x83')](_0x4dd6bd);}})[_0xe85c('0x29')](handleError(_0x48a225,null));};exports['getCustomerAvatar']=function(_0xf68d1a,_0x8480db,_0x3a3355){var _0x3b40f7=path[_0xe85c('0x7c')](config[_0xe85c('0x81')],_0xe85c('0x88'));var _0x2624d5={'where':{'id':_0xf68d1a[_0xe85c('0x57')]['id']},'attributes':['id',_0xe85c('0x78'),'showCustomerAvatar'],'raw':!![]};return db[_0xe85c('0x40')][_0xe85c('0x59')](_0x2624d5)[_0xe85c('0x1f')](handleEntityNotFound(_0x8480db,null))['then'](function(_0x1b7e72){if(_0x1b7e72){if(!_['isNil'](_0x1b7e72[_0xe85c('0x78')])){if(fs['existsSync'](path[_0xe85c('0x7c')](config['root'],_0xe85c('0x87'),_0x1b7e72[_0xe85c('0x78')]))&&_0x1b7e72[_0xe85c('0x89')]){_0x3b40f7=path[_0xe85c('0x7c')](config[_0xe85c('0x81')],_0xe85c('0x87'),_0x1b7e72['customerAvatar']);}}return _0x8480db[_0xe85c('0x83')](_0x3b40f7);}})['catch'](handleError(_0x8480db,null));};exports[_0xe85c('0x8a')]=function(_0x3b9d30,_0x3b3883,_0x5be7d6){var _0x38acc4=path[_0xe85c('0x7c')](config[_0xe85c('0x81')],_0xe85c('0x8b'));var _0x386e24={'where':{'id':_0x3b9d30[_0xe85c('0x57')]['id']},'attributes':['id',_0xe85c('0x7a')],'raw':!![]};return db[_0xe85c('0x40')]['find'](_0x386e24)['then'](handleEntityNotFound(_0x3b3883,null))['then'](function(_0x3c829b){if(_0x3c829b){if(!_[_0xe85c('0x7f')](_0x3c829b[_0xe85c('0x7a')])){if(fs['existsSync'](path[_0xe85c('0x7c')](config[_0xe85c('0x81')],_0xe85c('0x87'),_0x3c829b[_0xe85c('0x7a')]))){_0x38acc4=path[_0xe85c('0x7c')](config['root'],'server/files/images/avatars/',_0x3c829b['systemAvatar']);}}return _0x3b3883[_0xe85c('0x83')](_0x38acc4);}})[_0xe85c('0x29')](handleError(_0x3b3883,null));};exports[_0xe85c('0x8c')]=function(_0x2be5e1,_0x27da3c,_0x220086){var _0x393aed=require(_0xe85c('0x8d'));var _0x1d739a=new _0x393aed();var _0x319038=_0x1d739a[_0xe85c('0x8e')](_0x2be5e1[_0xe85c('0x8f')]['user-agent'])[_0xe85c('0x90')]();var _0x172a5a={'body':_0x2be5e1[_0xe85c('0x63')],'channel':_0xe85c('0x91')};var _0x232202=[];var _0x12c824=[];var _0x34c454={};var _0x1e64cb=![];return db[_0xe85c('0x92')][_0xe85c('0x64')]()[_0xe85c('0x1f')](function(_0x45647d){if(!_0x45647d){throw new db[(_0xe85c('0x93'))]['ValidationError']('no\x20available\x20attributes');}_0x232202=_['difference'](_['keys'](_0x45647d),['createdAt',_0xe85c('0x94')]);_0x12c824=_['difference'](_[_0xe85c('0x45')](_0x45647d),['createdAt','updatedAt',_0xe85c('0x95'),'ListId']);if(_0x2be5e1[_0xe85c('0x63')]['id']){delete _0x2be5e1[_0xe85c('0x63')]['id'];}if(_[_0xe85c('0x7f')](_0x2be5e1[_0xe85c('0x63')]['from'])){throw new db[(_0xe85c('0x93'))][(_0xe85c('0x96'))](_0xe85c('0x97'));}if(_[_0xe85c('0x7f')](_0x2be5e1[_0xe85c('0x63')]['body'])||_0x2be5e1[_0xe85c('0x63')]['body']===''){throw new db[(_0xe85c('0x93'))][(_0xe85c('0x96'))](_0xe85c('0x98'));}if(_[_0xe85c('0x7f')](_0x2be5e1[_0xe85c('0x63')][_0xe85c('0x99')])){throw new db[(_0xe85c('0x93'))]['ValidationError'](_0xe85c('0x9a')+_0x12c824);}if(!_[_0xe85c('0x9b')](_0x12c824,_0x2be5e1[_0xe85c('0x63')]['mapKey'])){throw new db[(_0xe85c('0x93'))][(_0xe85c('0x96'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x12c824);}_0x34c454[_0x2be5e1[_0xe85c('0x63')][_0xe85c('0x99')]]=_0x2be5e1[_0xe85c('0x63')][_0xe85c('0x9c')];})[_0xe85c('0x1f')](function(){return db[_0xe85c('0x40')][_0xe85c('0x59')]({'where':{'id':_0x2be5e1[_0xe85c('0x57')]['id']},'include':[{'model':db[_0xe85c('0x9d')],'as':_0xe85c('0x9e'),'include':[{'model':db[_0xe85c('0x92')],'as':_0xe85c('0x9f'),'where':_0x34c454,'limit':0x1,'order':[[_0xe85c('0x94'),_0xe85c('0xa0')]]}]},{'model':db[_0xe85c('0xa1')],'as':_0xe85c('0xa2')}]});})[_0xe85c('0x1f')](handleEntityNotFound(_0x27da3c,null))[_0xe85c('0x1f')](function(_0x4f6081){if(_0x4f6081&&_0x4f6081[_0xe85c('0x9e')]){_0x172a5a[_0xe85c('0xa3')]=_0x4f6081;_0x172a5a[_0xe85c('0xa4')]=_0x4f6081[_0xe85c('0xa2')];_0x172a5a[_0xe85c('0xa5')]=_0x4f6081['List'];_0x172a5a[_0xe85c('0xa4')]=_[_0xe85c('0xa6')](_0x172a5a[_0xe85c('0xa4')],[_0xe85c('0xa7')],[_0xe85c('0xa8')]);if(_0x172a5a[_0xe85c('0xa3')][_0xe85c('0xa2')]){delete _0x172a5a[_0xe85c('0xa3')]['Applications'];}if(_0x172a5a[_0xe85c('0xa3')][_0xe85c('0x9e')]&&_0x172a5a['account']['List'][_0xe85c('0x9f')][_0xe85c('0x4a')]){return _0x172a5a[_0xe85c('0xa3')][_0xe85c('0x9e')][_0xe85c('0x9f')][0x0];}var _0x5536d9=_[_0xe85c('0xa9')](_0x2be5e1['body'],{'firstName':_0x2be5e1[_0xe85c('0x63')][_0xe85c('0x9c')],'ListId':_0x4f6081[_0xe85c('0xaa')]});_0x5536d9[_0x2be5e1[_0xe85c('0x63')][_0xe85c('0x99')]]=_0x2be5e1[_0xe85c('0x63')][_0xe85c('0x9c')];return db[_0xe85c('0x92')]['create'](_0x5536d9,{'fields':_0x232202,'raw':!![]});}})[_0xe85c('0x1f')](handleEntityNotFound(_0x27da3c,null))['then'](function(_0x339737){_0x172a5a['contact']=_0x339737;var _0x35006b=_0x2be5e1[_0xe85c('0x63')][_0xe85c('0xab')];if(_0x2be5e1[_0xe85c('0x8f')][_0xe85c('0xac')]){_0x35006b=_0x2be5e1[_0xe85c('0x8f')][_0xe85c('0xac')];}else if(_0x2be5e1['headers'][_0xe85c('0xad')]){_0x35006b=_[_0xe85c('0xae')](_0x2be5e1[_0xe85c('0x8f')][_0xe85c('0xad')][_0xe85c('0xaf')](','));}if(_0x339737){var _0x206a9f={'ContactId':_0x339737['id'],'ChatWebsiteId':_0x2be5e1[_0xe85c('0x57')]['id'],'from':(_0x339737[_0xe85c('0xb0')]||'')+'\x20'+(_0x339737[_0xe85c('0xb1')]||''),'customerIp':_0x35006b,'customerPort':_0x2be5e1[_0xe85c('0x8f')][_0xe85c('0xb2')]?_0x2be5e1[_0xe85c('0x8f')]['x-real-port']:null,'referer':_0x2be5e1[_0xe85c('0x63')]['referer'],'browserName':_0x319038[_0xe85c('0xb3')][_0xe85c('0x3a')]&&_0x319038[_0xe85c('0xb3')]['version']?util[_0xe85c('0xb4')](_0xe85c('0xb5'),_0x319038[_0xe85c('0xb3')][_0xe85c('0x3a')],_0x319038[_0xe85c('0xb3')][_0xe85c('0xb6')]):_0xe85c('0xb7'),'browserVersion':_0x319038[_0xe85c('0xb3')][_0xe85c('0xb6')]||_0xe85c('0xb7'),'osName':util[_0xe85c('0xb4')](_0xe85c('0xb5'),_0x319038['os'][_0xe85c('0x3a')],_0x319038['os'][_0xe85c('0xb6')]),'osVersion':_0x319038['os']['version'],'deviceModel':_0x319038[_0xe85c('0xb8')]['model']&&_0x319038['device'][_0xe85c('0xb9')]?util[_0xe85c('0xb4')](_0xe85c('0xba'),_0x319038[_0xe85c('0xb8')][_0xe85c('0x44')],_0x319038[_0xe85c('0xb8')][_0xe85c('0xb9')],_0x319038[_0xe85c('0xb8')][_0xe85c('0x42')]):null,'deviceVendor':_0x319038[_0xe85c('0xb8')][_0xe85c('0xb9')],'deviceType':_0x319038[_0xe85c('0xb8')][_0xe85c('0x42')],'formData':JSON[_0xe85c('0xbb')](_0x2be5e1[_0xe85c('0x63')])};var _0x96a093={'ChatWebsiteId':_0x2be5e1[_0xe85c('0x57')]['id'],'closed':![]};if(_0x2be5e1[_0xe85c('0x63')]['threadId']){_0x96a093[_0xe85c('0xbc')]=_0x2be5e1[_0xe85c('0x63')][_0xe85c('0xbc')];return db[_0xe85c('0xbd')]['find']({'where':_0x96a093})[_0xe85c('0x1f')](function(_0x5db680){if(_0x5db680){return[_0x5db680,![]];}_0x206a9f[_0xe85c('0xbc')]=_0x2be5e1[_0xe85c('0x63')][_0xe85c('0xbc')];_0x206a9f[_0xe85c('0xbe')]=_0x2be5e1[_0xe85c('0x63')]['externalUrl'];return db[_0xe85c('0xbd')][_0xe85c('0x5a')](_0x206a9f)['then'](function(_0x279a3f){return[_0x279a3f,!![]];});});}_0x96a093[_0xe85c('0xbf')]=_0x339737['id'];if(_0x2be5e1['body'][_0xe85c('0xc0')]&&_0x2be5e1[_0xe85c('0x63')]['interaction']['id']){_0x96a093['id']=_0x2be5e1[_0xe85c('0x63')][_0xe85c('0xc0')]['id'];return db['ChatInteraction']['find']({'where':_0x96a093})[_0xe85c('0x1f')](function(_0x2600cf){if(_0x2600cf){return[_0x2600cf,![]];}return db[_0xe85c('0xbd')][_0xe85c('0x5a')](_0x206a9f)[_0xe85c('0x1f')](function(_0x5d3038){return[_0x5d3038,!![]];});});}return db['ChatInteraction'][_0xe85c('0x5a')](_0x206a9f)['then'](function(_0x3dbdf8){return[_0x3dbdf8,!![]];});}})[_0xe85c('0xc1')](function(_0x4aabf1,_0x363542){if(_0x4aabf1){_0x1e64cb=_0x363542;if(!_0x363542){var _0x42bd3b={'from':(_0x172a5a[_0xe85c('0xc2')]['firstName']||'')+'\x20'+(_0x172a5a[_0xe85c('0xc2')]['lastName']||'')};if(_0x2be5e1[_0xe85c('0x63')]['threadId']&&_0x2be5e1[_0xe85c('0x63')][_0xe85c('0xc3')]&&_0x2be5e1['body'][_0xe85c('0xbc')]!=_0x2be5e1[_0xe85c('0x63')]['messageId']){_0x42bd3b['threadId']=_0x2be5e1['body']['messageId'];}return _0x4aabf1[_0xe85c('0x62')](_0x42bd3b);}else{return _0x4aabf1;}}})[_0xe85c('0x1f')](function(_0x392f42){_0x172a5a[_0xe85c('0xc0')]=_0x392f42[_0xe85c('0x37')]({'plain':!![]});_0x172a5a['interaction'][_0xe85c('0xc4')]=_0x1e64cb;if(_0x172a5a[_0xe85c('0xc0')][_0xe85c('0xc4')]){if(_0x172a5a['account']['autoclose']){_0x172a5a[_0xe85c('0xa4')][_0xe85c('0xc5')]({'id':0x0,'priority':_0x172a5a[_0xe85c('0xa4')][_0xe85c('0x4a')]+0x1,'app':_0xe85c('0xc6'),'appdata':_0xe85c('0xc7'),'interval':_0xe85c('0xc8')});}}return db[_0xe85c('0xc9')][_0xe85c('0x5a')]({'body':_0x2be5e1[_0xe85c('0x63')][_0xe85c('0x63')],'ChatWebsiteId':_0x2be5e1['params']['id'],'ChatInteractionId':_0x392f42['id'],'direction':'in','ContactId':_0x172a5a[_0xe85c('0xc2')]['id'],'AttachmentId':_0x2be5e1[_0xe85c('0x63')][_0xe85c('0xca')]});})[_0xe85c('0x1f')](function(_0x1db627){_0x172a5a['message']=_0x1db627;if(_0x172a5a['interaction'][_0xe85c('0xcb')]){return db[_0xe85c('0xcc')][_0xe85c('0x59')]({'attributes':['id',_0xe85c('0x3a')],'where':{'id':_0x172a5a[_0xe85c('0xc0')][_0xe85c('0xcb')]}})[_0xe85c('0x1f')](function(_0x4033ee){if(_0x4033ee){_0x172a5a['applications'][_0xe85c('0xcd')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4033ee[_0xe85c('0x3a')]+','+(_0x172a5a[_0xe85c('0xa3')][_0xe85c('0xce')]||0xa),'interval':_0xe85c('0xc8')});_0x172a5a[_0xe85c('0xcf')]=!![];}return respondWithRpcPromise('Start',_0xe85c('0xd0'),_0x172a5a);});}return respondWithRpcPromise('Start','startRouting',_0x172a5a);})[_0xe85c('0x1f')](function(_0x4ff4ee){respondWithRpcPromise(_0xe85c('0xd1'),_0xe85c('0xd1'),{'event':_0xe85c('0x8c'),'message':_0x4ff4ee},client9002);return _0x4ff4ee;})['then'](respondWithResult(_0x27da3c,null))['catch'](handleError(_0x27da3c,null));};exports[_0xe85c('0xd2')]=function(_0x381e05,_0x1965b6,_0x38247e){var _0x6d43a8,_0x47d9d8,_0x28ba90;var _0xac82b6=[];var _0x3d7bb6=[];var _0x39f10a={};var _0x2b9905=_0x381e05[_0xe85c('0xd3')]||[];var _0x4ae76c=[];var _0x3c66e6;return db[_0xe85c('0x92')][_0xe85c('0x64')]()[_0xe85c('0x1f')](function(_0x17140e){if(!_0x17140e){throw new db['Sequelize']['ValidationError'](_0xe85c('0xd4'));}_0x3d7bb6=_['difference'](_[_0xe85c('0x45')](_0x17140e),[_0xe85c('0xd5'),_0xe85c('0x94')]);_0xac82b6=_['difference'](_[_0xe85c('0x45')](_0x17140e),[_0xe85c('0xd5'),_0xe85c('0x94'),_0xe85c('0x95'),_0xe85c('0xaa')]);if(_0x381e05[_0xe85c('0x63')]['id']){delete _0x381e05[_0xe85c('0x63')]['id'];}if(_[_0xe85c('0x7f')](_0x381e05[_0xe85c('0x63')]['from'])){throw _0x1965b6[_0xe85c('0x2b')](0x1f4)[_0xe85c('0x3b')](new db['Sequelize']['ValidationError'](_0xe85c('0x97')));}if(_[_0xe85c('0x7f')](_0x381e05['body'][_0xe85c('0x63')])||_0x381e05['body'][_0xe85c('0x63')]===''){throw _0x1965b6[_0xe85c('0x2b')](0x1f4)[_0xe85c('0x3b')](new db[(_0xe85c('0x93'))][(_0xe85c('0x96'))](_0xe85c('0x98')));}if(_[_0xe85c('0x7f')](_0x381e05[_0xe85c('0x63')][_0xe85c('0xd6')])){throw _0x1965b6[_0xe85c('0x2b')](0x1f4)[_0xe85c('0x3b')](new db['Sequelize']['ValidationError'](_0xe85c('0xd7')+_0xac82b6));}if(!_['includes'](_0xac82b6,_0x381e05['body'][_0xe85c('0xd6')])){throw _0x1965b6[_0xe85c('0x2b')](0x1f4)['send'](new db[(_0xe85c('0x93'))][(_0xe85c('0x96'))](_0xe85c('0xd8')+_0xac82b6));}_0x39f10a[_0x381e05[_0xe85c('0x63')][_0xe85c('0xd6')]]=_0x381e05[_0xe85c('0x63')]['from'];})[_0xe85c('0x1f')](function(){return db[_0xe85c('0x40')][_0xe85c('0x59')]({'where':{'id':_0x381e05['params']['id']},'include':[{'model':db[_0xe85c('0x9d')],'as':_0xe85c('0x9e')},{'model':db['MailAccount'],'as':_0xe85c('0xd9')}]});})[_0xe85c('0x1f')](handleEntityNotFound(_0x1965b6,null))['then'](function(_0x1d9217){if(_0x1d9217&&_0x1d9217['List']){_0x47d9d8=_0x1d9217;var _0x1a6a3a=_[_0xe85c('0xa9')](_0x381e05[_0xe85c('0x63')],{'firstName':_0x381e05['body']['from'],'phone':_0x381e05[_0xe85c('0x63')][_0xe85c('0x9c')],'ListId':_0x1d9217[_0xe85c('0xaa')]});_0x1a6a3a[_0x381e05[_0xe85c('0x63')][_0xe85c('0xd6')]]=_0x381e05[_0xe85c('0x63')]['from'];return db[_0xe85c('0x92')][_0xe85c('0xda')]({'where':_0x39f10a,'defaults':_0x1a6a3a});}})[_0xe85c('0xc1')](function(_0x5017ea){if(_0x5017ea){_0x28ba90=_0x5017ea;var _0x1b6929=fs['readFileSync'](path['join'](config[_0xe85c('0x81')],_0xe85c('0xdb')),_0xe85c('0xdc'));var _0x147780=ejs['render'](_0x1b6929,{'body':_[_0xe85c('0xdd')](_0x381e05[_0xe85c('0x63')]['body']),'bodyTitle':_0x47d9d8[_0xe85c('0xde')]});return db[_0xe85c('0xdf')][_0xe85c('0x5a')]({'body':_0x147780,'ContactId':_0x5017ea['id'],'ChatWebsiteId':_0x47d9d8['id']});}})[_0xe85c('0x1f')](function(_0x4699ea){_0x3c66e6=_0x4699ea;if(_0x2b9905['length']){var _0x38d9b7=_0x2b9905['map'](function(_0x34cb32){return{'name':_0x34cb32['originalname'],'basename':_0x34cb32[_0xe85c('0x75')],'type':_0x34cb32['mimetype'],'ChatOfflineMessageId':_0x4699ea['id']};});_0x4ae76c=_0x38d9b7[_0xe85c('0x3f')](_0x2e539d=>{var _0x17e807={'filename':_0x2e539d['name'],'path':path[_0xe85c('0x7c')](config[_0xe85c('0x81')],_0xe85c('0xe0'),'files',_0xe85c('0xe1'),'offline-chat',_0x2e539d[_0xe85c('0xe2')])};return _0x17e807;});if(!_0x47d9d8['openNewInteraction']){return db['sequelize']['transaction'](function(_0x201738){return db[_0xe85c('0xe3')][_0xe85c('0xe4')](_0x38d9b7,{'transaction':_0x201738});});}}})[_0xe85c('0x1f')](function(){if(_0x3c66e6){_0x6d43a8=_0x3c66e6;return db[_0xe85c('0xd9')][_0xe85c('0x67')]({'where':{'active':!![]},'include':[{'model':db[_0xe85c('0xe5')],'as':'Smtp','raw':!![]}]});}})[_0xe85c('0x1f')](function(_0x18872c){if(_0x18872c&&_0x18872c['Smtp']&&_0x47d9d8[_0xe85c('0xe6')]&&_0x47d9d8[_0xe85c('0xe7')]){var _0x32faa2={'tls':{'rejectUnauthorized':![]}};if(_0x18872c['Smtp'][_0xe85c('0xe8')]){_0x32faa2[_0xe85c('0xe8')]=_0x18872c[_0xe85c('0xe9')]['service'];}else{_0x32faa2['host']=_0x18872c['Smtp'][_0xe85c('0xea')];_0x32faa2['port']=_0x18872c[_0xe85c('0xe9')]['port'];_0x32faa2[_0xe85c('0xeb')]=_0x18872c[_0xe85c('0xe9')][_0xe85c('0xeb')];}if(_0x18872c['Smtp'][_0xe85c('0xec')]){_0x32faa2['auth']={'user':_0x18872c[_0xe85c('0xe9')]['user'],'pass':_0x18872c[_0xe85c('0xe9')]['pass']};}return respondWithRpcPromise(_0xe85c('0xed'),_0xe85c('0xee'),{'account':_0x32faa2,'message':{'from':util[_0xe85c('0xb4')](_0xe85c('0xef'),_0x18872c[_0xe85c('0x3a')],_0x18872c[_0xe85c('0xf0')]||_0x18872c[_0xe85c('0xe9')]['user']),'to':_0x47d9d8['forwardOfflineAddress'],'subject':_0x47d9d8[_0xe85c('0xf1')],'html':_0x6d43a8['body'],'attachments':_0x4ae76c}},client9003)[_0xe85c('0x1f')](function(){return _0x6d43a8;})[_0xe85c('0x29')](function(_0x2c229b){console['error'](_0x2c229b);});}})[_0xe85c('0x1f')](function(){if(_0x47d9d8&&_0x47d9d8[_0xe85c('0xf2')]&&_0x47d9d8['MailAccountId']){var _0x46ea8b=[];if(_0x2b9905['length']){_0x46ea8b=_0x2b9905[_0xe85c('0x3f')](function(_0x3c7df5){return{'name':_0x3c7df5['originalname'],'basename':_0x3c7df5[_0xe85c('0x75')],'type':_0x3c7df5[_0xe85c('0xf3')],'ChatOfflineMessageId':_0x3c66e6['id']};});}var _0x5b625a;if(!_['isNil'](_0x47d9d8[_0xe85c('0xf4')])){var _0x22a38d=_[_0xe85c('0x3f')](_0x381e05[_0xe85c('0x63')],function(_0x35f94f){return _0x35f94f;});var _0x516fa0=_[_0xe85c('0xf5')](_0x22a38d)[0x0];var _0x223136=_[_0xe85c('0xf6')](_0x516fa0,function(_0x374ddc){return _0x374ddc;});_0x5b625a=_0x223136[0x1][_0x47d9d8[_0xe85c('0xf4')]];}var _0x28d6e2={'from':_0x28ba90[_0xe85c('0xf0')],'firstName':_0x28ba90['firstName'],'lastName':_0x28ba90[_0xe85c('0xb1')],'mapKey':'email','message':{'from':_0x28ba90[_0xe85c('0xf0')],'to':_0x47d9d8[_0xe85c('0xd9')][_0xe85c('0xf0')],'cc':'','subject':_['isNil'](_0x5b625a)?_0x47d9d8['offlineMessageSubject']:_0x5b625a,'messageId':'','sentAt':new Date(),'attach':_0x46ea8b[_0xe85c('0x4a')],'attachments':_0x46ea8b,'originChannel':'Chat','ChatWebsiteId':_0x47d9d8['id'],'ChatOfflineMessageId':_0x6d43a8['id'],'originTo':_0x47d9d8[_0xe85c('0xd9')][_0xe85c('0xf0')]},'body':_0x6d43a8['body']};var _0x1064b6={'account':{'id':_0x47d9d8['MailAccountId']},'body':_0x28d6e2,'log':_0xe85c('0xf7')};return respondWithRpcPromise(_0xe85c('0xf7'),_0xe85c('0xf8'),_0x1064b6,client9001)[_0xe85c('0x1f')](function(){return _0x6d43a8;})[_0xe85c('0x29')](function(_0x489ff3){console[_0xe85c('0x24')](_0x489ff3);});}return;})[_0xe85c('0x1f')](function(){if(_0x6d43a8){return _0x6d43a8;}})['then'](respondWithResult(_0x1965b6,null))[_0xe85c('0x29')](function(_0x4cf739){console[_0xe85c('0x24')](_0xe85c('0x29'),_0x4cf739);for(var _0x665f87 of _0x2b9905){var _0x28e438=path[_0xe85c('0x7c')](config['root'],_0xe85c('0xe0'),_0xe85c('0xd3'),_0xe85c('0xe1'),_0xe85c('0xf9'),_0x665f87[_0xe85c('0x75')]);fs_extra['remove'](_0x28e438)[_0xe85c('0x29')](function(_0x3f5f0d){console['error']('Could\x20not\x20remove\x20attachment\x20file',_0x28e438,_0x3f5f0d);});}});};exports[_0xe85c('0xfa')]=function(_0x49951a,_0x38f6a0,_0x1aef3a){return db[_0xe85c('0xbd')][_0xe85c('0x59')]({'where':{'id':_0x49951a[_0xe85c('0x57')]['id']}})['then'](handleEntityNotFound(_0x38f6a0,null))[_0xe85c('0x1f')](function(_0x1acd44){if(_0x1acd44){return _0x1acd44[_0xe85c('0xfa')](_0x49951a[_0xe85c('0x63')]['ids'],_['omit'](_0x49951a[_0xe85c('0x63')],['ids','id'])||{});}})[_0xe85c('0x1f')](respondWithResult(_0x38f6a0,null))[_0xe85c('0x29')](handleError(_0x38f6a0,null));};exports[_0xe85c('0xfb')]=function(_0x2b3249,_0x53d00d,_0xa79fad){var _0x13c32d={'raw':![],'where':{}};var _0x560a3b={};var _0x20107d={'count':0x0,'rows':[]};return db[_0xe85c('0x40')]['findOne']({'where':{'id':_0x2b3249[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x53d00d,null))[_0xe85c('0x1f')](function(_0x46dc23){if(_0x46dc23){_0x560a3b[_0xe85c('0x44')]=_['keys'](db[_0xe85c('0xbd')][_0xe85c('0x70')]);_0x560a3b[_0xe85c('0x46')]=_[_0xe85c('0x45')](_0x2b3249['query']);_0x560a3b['filters']=_['intersection'](_0x560a3b['model'],_0x560a3b[_0xe85c('0x46')]);_0x13c32d[_0xe85c('0x49')]=_[_0xe85c('0x58')](_0x560a3b[_0xe85c('0x44')],qs[_0xe85c('0x48')](_0x2b3249['query'][_0xe85c('0x48')]));_0x13c32d['attributes']=_0x13c32d[_0xe85c('0x49')][_0xe85c('0x4a')]?_0x13c32d[_0xe85c('0x49')]:_0x560a3b[_0xe85c('0x44')];if(!_0x2b3249[_0xe85c('0x46')][_0xe85c('0x4b')]('nolimit')){_0x13c32d[_0xe85c('0x2e')]=qs[_0xe85c('0x2e')](_0x2b3249[_0xe85c('0x46')][_0xe85c('0x2e')]);_0x13c32d['offset']=qs['offset'](_0x2b3249['query'][_0xe85c('0x30')]);}_0x13c32d[_0xe85c('0x4c')]=qs[_0xe85c('0x4d')](_0x2b3249[_0xe85c('0x46')][_0xe85c('0x4d')]);_0x13c32d[_0xe85c('0x50')]=qs[_0xe85c('0x47')](_[_0xe85c('0x4e')](_0x2b3249['query'],_0x560a3b['filters']));_0x13c32d[_0xe85c('0x50')][_0xe85c('0x69')]=_0x46dc23['id'];if(_0x2b3249[_0xe85c('0x46')][_0xe85c('0x4f')]){_0x13c32d[_0xe85c('0x50')]=_['merge'](_0x13c32d[_0xe85c('0x50')],{'$or':_['map'](_0x13c32d[_0xe85c('0x49')],function(_0x128883){var _0x178ef7={};_0x178ef7[_0x128883]={'$like':'%'+_0x2b3249['query']['filter']+'%'};return _0x178ef7;})});}_0x13c32d=_[_0xe85c('0x51')]({},_0x13c32d,_0x2b3249['options']);return db['ChatInteraction'][_0xe85c('0x2f')]({'where':_0x13c32d['where']})['then'](function(_0x5acea6){_0x20107d['count']=_0x5acea6;if(_0x2b3249['query'][_0xe85c('0x54')]){_0x13c32d['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xe85c('0xcc')],'as':_0xe85c('0xfc'),'attributes':[_0xe85c('0x3a'),_0xe85c('0xfd'),_0xe85c('0xfe')],'required':![]},{'model':db['Tag'],'as':_0xe85c('0xff'),'attributes':['id',_0xe85c('0x3a'),_0xe85c('0x100')],'where':_0x2b3249[_0xe85c('0x46')][_0xe85c('0x101')]?{'id':_0x2b3249[_0xe85c('0x46')][_0xe85c('0x101')]}:undefined,'required':_0x2b3249[_0xe85c('0x46')][_0xe85c('0x101')]?!![]:![]}];}return db[_0xe85c('0xbd')][_0xe85c('0x6b')](_0x13c32d);})['then'](function(_0x15cda6){_0x20107d[_0xe85c('0x55')]=_0x15cda6;return _0x20107d;});}})[_0xe85c('0x1f')](respondWithFilteredResult(_0x53d00d,_0x13c32d))[_0xe85c('0x29')](handleError(_0x53d00d,null));};function iftimePromise(_0x8fac35,_0x408880){return respondWithRpcPromise(_0xe85c('0x102'),_0xe85c('0x103'),{'command':_0x408880[_0xe85c('0x104')]?util[_0xe85c('0xb4')](_0xe85c('0x105'),_0x8fac35[_0xe85c('0x106')],_0x408880['timezone']):util[_0xe85c('0xb4')](_0xe85c('0x107'),_0x8fac35[_0xe85c('0x106')])},client9002)[_0xe85c('0x1f')](function(_0x1676ab){var _0x55a9c7=_0x1676ab&&_0x1676ab[_0xe85c('0x108')](_0xe85c('0x109'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x408880['id'],_0x8fac35['id'],_0x8fac35[_0xe85c('0x106')],_0x55a9c7?_0xe85c('0x10a'):_0xe85c('0x10b'),_0x408880[_0xe85c('0x104')]?_0x408880[_0xe85c('0x104')]:_0xe85c('0x10c'));return _0x55a9c7;})[_0xe85c('0x29')](function(_0x132db6){logger[_0xe85c('0x24')](_0xe85c('0x10d'),_0x408880['id'],_0x8fac35['id'],_0x8fac35['interval'],util[_0xe85c('0x10e')](_0x132db6,{'showHidden':![],'depth':null}),_0x408880[_0xe85c('0x104')]?_0x408880[_0xe85c('0x104')]:_0xe85c('0x10c'));return![];});}exports['getSnippet']=function(_0x3db119,_0x188d56,_0x7b648a){var _0x34560f=0x0;var _0x1488b1=0x0;var _0x391821=![];var _0x808e5;var _0xe8aeaf;return db['ChatWebsite']['find']({'where':{'id':_0x3db119['params']['id']},'include':[{'model':db['Interval'],'as':_0xe85c('0x10f'),'include':[{'model':db[_0xe85c('0x10f')],'as':_0xe85c('0x110'),'attributes':['id',_0xe85c('0x106')],'raw':!![]}]}]})[_0xe85c('0x1f')](handleEntityNotFound(_0x188d56,null))[_0xe85c('0x1f')](function(_0x418165){if(_0x418165){_0x808e5=_0x418165;return _0x418165[_0xe85c('0x111')]({'raw':!![]});}})['then'](function(_0x1b0ff9){if(_0x808e5){if(_0x1b0ff9){_0xe8aeaf=_0x1b0ff9;}}return require(_0xe85c('0x16'))[_0xe85c('0x7d')]();})[_0xe85c('0x1f')](function(_0x871ee1){if(_0x871ee1){_0x1488b1=_0x871ee1[_0xe85c('0x112')];_0x391821=_0x871ee1[_0xe85c('0x7e')];}})[_0xe85c('0x1f')](function(){return db[_0xe85c('0xbd')][_0xe85c('0x2f')]({'where':{'closed':![]}});})[_0xe85c('0x1f')](function(_0x1c1204){_0x34560f=_0x1c1204;if(_0x1488b1&&_0x1c1204>_0x1488b1){return db[_0xe85c('0x113')][_0xe85c('0x67')]({'where':{'id':0x1}})['then'](function(_0x42ec17){if(_0x42ec17){_0x42ec17[_0xe85c('0x114')](_0xe85c('0x115'));}});}})[_0xe85c('0x1f')](function(){if(_0x808e5[_0xe85c('0x10f')]&&_0x808e5['Interval'][_0xe85c('0x110')]){var _0x31fa39=[];for(var _0x53dc5c=0x0;_0x53dc5c<_0x808e5[_0xe85c('0x10f')][_0xe85c('0x110')][_0xe85c('0x4a')];_0x53dc5c++){var _0x3e1bb1=_0x808e5[_0xe85c('0x10f')][_0xe85c('0x110')][_0x53dc5c]['get']({'plain':!![]});_0x31fa39[_0xe85c('0xc5')](iftimePromise(_0x3e1bb1,_0x808e5));}return BPromise['all'](_0x31fa39)['then'](function(_0x44c205){return _[_0xe85c('0x116')](_0x44c205);});}else{return!![];}})[_0xe85c('0x1f')](function(_0x3e6cff){var _0x33166f=fs[_0xe85c('0x117')](path['join'](config[_0xe85c('0x81')],_0xe85c('0x118')),_0xe85c('0xdc'));var _0x5f05d1={'remote':_0x808e5[_0xe85c('0x119')],'query':querystring[_0xe85c('0xbb')](_[_0xe85c('0x51')](_0x808e5[_0xe85c('0x37')]({'plain':!![]}),{'customerIp':_0x3db119[_0xe85c('0x8f')][_0xe85c('0xad')]||_0x3db119[_0xe85c('0x8f')][_0xe85c('0x11a')]||_0x3db119[_0xe85c('0x11b')][_0xe85c('0x11c')]||_0x3db119['ip'],'referer':_0x3db119['headers'][_0xe85c('0x11d')],'openedInteractions':_0x34560f,'maxInteractions':_0x1488b1,'virtual':_0x391821[_0xe85c('0x112')],'online':_0x3e6cff,'custom':_0x391821}))['replace'](/'/g,'\x5c\x27')};_0x188d56[_0xe85c('0x3b')](ejs[_0xe85c('0x11e')](Mustache[_0xe85c('0x11e')](_0x33166f,_0x5f05d1),{'proactiveActions':_0xe8aeaf,'alignment':_0x808e5['alignment'],'verticalAlignment':_0x808e5['verticalAlignment'],'div_color':_0x808e5[_0xe85c('0x100')],'text_color':_0x808e5['textColor'],'button_color':_0x808e5[_0xe85c('0x11f')],'background_color':_0x808e5[_0xe85c('0x120')]}));})[_0xe85c('0x29')](handleError(_0x188d56,null));};exports[_0xe85c('0x121')]=function(_0x3cc04b,_0x2906cd,_0x22eb49){return db[_0xe85c('0x40')][_0xe85c('0x67')]({'where':{'id':_0x3cc04b['params']['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x2906cd,null))[_0xe85c('0x1f')](function(_0x5afbe3){if(_0x5afbe3){return db['sequelize']['transaction'](function(_0x3172b7){return db[_0xe85c('0xa1')][_0xe85c('0x36')]({'where':{'ChatWebsiteId':_0x3cc04b[_0xe85c('0x57')]['id']},'transaction':_0x3172b7})[_0xe85c('0x1f')](function(_0x1b3bfa){var _0x563a7f=_[_0xe85c('0x3f')](_0x3cc04b[_0xe85c('0x63')],function(_0x441eb8){_0x441eb8[_0xe85c('0x69')]=_0x3cc04b[_0xe85c('0x57')]['id'];return _0x441eb8;});return db[_0xe85c('0xa1')]['bulkCreate'](_0x563a7f,{'transaction':_0x3172b7});});})['then'](function(){return db[_0xe85c('0xa1')][_0xe85c('0x122')]({'where':{'ChatWebsiteId':_0x3cc04b['params']['id']},'order':'priority'});});}})['then'](respondWithResult(_0x2906cd,null))[_0xe85c('0x29')](handleError(_0x2906cd,null));};exports[_0xe85c('0x123')]=function(_0xcdbab9,_0x42394d,_0x3ec2c4){var _0x5d949c={};var _0x2e4e0d={};var _0x585942;var _0x11072e;return db[_0xe85c('0x40')][_0xe85c('0x67')]({'where':{'id':_0xcdbab9[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x42394d,null))[_0xe85c('0x1f')](function(_0x236f75){if(_0x236f75){_0x585942=_0x236f75;_0x2e4e0d[_0xe85c('0x44')]=_[_0xe85c('0x45')](db['ChatApplication']['rawAttributes']);_0x2e4e0d[_0xe85c('0x46')]=_[_0xe85c('0x45')](_0xcdbab9['query']);_0x2e4e0d[_0xe85c('0x47')]=_[_0xe85c('0x58')](_0x2e4e0d['model'],_0x2e4e0d[_0xe85c('0x46')]);_0x5d949c[_0xe85c('0x49')]=_[_0xe85c('0x58')](_0x2e4e0d[_0xe85c('0x44')],qs['fields'](_0xcdbab9['query'][_0xe85c('0x48')]));_0x5d949c['attributes']=_0x5d949c[_0xe85c('0x49')][_0xe85c('0x4a')]?_0x5d949c[_0xe85c('0x49')]:_0x2e4e0d[_0xe85c('0x44')];_0x5d949c[_0xe85c('0x4c')]=qs[_0xe85c('0x4d')](_0xcdbab9[_0xe85c('0x46')]['sort']);_0x5d949c[_0xe85c('0x50')]=qs['filters'](_[_0xe85c('0x4e')](_0xcdbab9[_0xe85c('0x46')],_0x2e4e0d[_0xe85c('0x47')]));if(_0xcdbab9[_0xe85c('0x46')][_0xe85c('0x4f')]){_0x5d949c['where']=_[_0xe85c('0x51')](_0x5d949c[_0xe85c('0x50')],{'$or':_['map'](_0x5d949c[_0xe85c('0x49')],function(_0x271004){var _0xd8b449={};_0xd8b449[_0x271004]={'$like':'%'+_0xcdbab9[_0xe85c('0x46')]['filter']+'%'};return _0xd8b449;})});}_0x5d949c=_['merge']({},_0x5d949c,_0xcdbab9['options']);return _0x585942[_0xe85c('0x123')](_0x5d949c);}})[_0xe85c('0x1f')](function(_0x1139ce){if(_0x1139ce){_0x11072e=_0x1139ce[_0xe85c('0x4a')];if(!_0xcdbab9[_0xe85c('0x46')]['hasOwnProperty']('nolimit')){_0x5d949c[_0xe85c('0x2e')]=qs[_0xe85c('0x2e')](_0xcdbab9['query'][_0xe85c('0x2e')]);_0x5d949c['offset']=qs[_0xe85c('0x30')](_0xcdbab9[_0xe85c('0x46')]['offset']);}return _0x585942[_0xe85c('0x123')](_0x5d949c);}})['then'](function(_0x4f1ad8){if(_0x4f1ad8){return _0x4f1ad8?{'count':_0x11072e,'rows':_0x4f1ad8}:null;}})[_0xe85c('0x1f')](respondWithResult(_0x42394d,null))[_0xe85c('0x29')](handleError(_0x42394d,null));};exports[_0xe85c('0x124')]=function(_0x54d2aa,_0xaab4de,_0x460e37){return db[_0xe85c('0x125')][_0xe85c('0x59')]({'where':{'id':_0x54d2aa[_0xe85c('0x57')]['id']}})['then'](handleEntityNotFound(_0xaab4de,null))[_0xe85c('0x1f')](function(_0x58f008){if(_0x58f008){return _0x58f008[_0xe85c('0x124')](_0x54d2aa['body'][_0xe85c('0x6d')],_[_0xe85c('0x126')](_0x54d2aa[_0xe85c('0x63')],[_0xe85c('0x6d'),'id'])||{});}})['then'](respondWithResult(_0xaab4de,null))['catch'](handleError(_0xaab4de,null));};exports[_0xe85c('0x111')]=function(_0xbb0e22,_0x48b894,_0x1745c8){var _0x77127f={};var _0x111d88={};var _0x13a71b;var _0xe7261a;return db['ChatWebsite'][_0xe85c('0x67')]({'where':{'id':_0xbb0e22[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x48b894,null))[_0xe85c('0x1f')](function(_0x763e5f){if(_0x763e5f){_0x13a71b=_0x763e5f;_0x111d88[_0xe85c('0x44')]=_[_0xe85c('0x45')](db['ChatProactiveAction'][_0xe85c('0x70')]);_0x111d88['query']=_[_0xe85c('0x45')](_0xbb0e22[_0xe85c('0x46')]);_0x111d88[_0xe85c('0x47')]=_[_0xe85c('0x58')](_0x111d88['model'],_0x111d88[_0xe85c('0x46')]);_0x77127f[_0xe85c('0x49')]=_[_0xe85c('0x58')](_0x111d88[_0xe85c('0x44')],qs[_0xe85c('0x48')](_0xbb0e22[_0xe85c('0x46')][_0xe85c('0x48')]));_0x77127f[_0xe85c('0x49')]=_0x77127f['attributes']['length']?_0x77127f[_0xe85c('0x49')]:_0x111d88[_0xe85c('0x44')];_0x77127f[_0xe85c('0x4c')]=qs[_0xe85c('0x4d')](_0xbb0e22['query'][_0xe85c('0x4d')]);_0x77127f[_0xe85c('0x50')]=qs[_0xe85c('0x47')](_[_0xe85c('0x4e')](_0xbb0e22[_0xe85c('0x46')],_0x111d88[_0xe85c('0x47')]));if(_0xbb0e22[_0xe85c('0x46')][_0xe85c('0x4f')]){_0x77127f[_0xe85c('0x50')]=_['merge'](_0x77127f['where'],{'$or':_[_0xe85c('0x3f')](_0x77127f[_0xe85c('0x49')],function(_0x265839){var _0x424771={};_0x424771[_0x265839]={'$like':'%'+_0xbb0e22[_0xe85c('0x46')][_0xe85c('0x4f')]+'%'};return _0x424771;})});}_0x77127f=_['merge']({},_0x77127f,_0xbb0e22[_0xe85c('0x53')]);return _0x13a71b['getProactiveActions'](_0x77127f);}})['then'](function(_0x39d810){if(_0x39d810){_0xe7261a=_0x39d810[_0xe85c('0x4a')];if(!_0xbb0e22[_0xe85c('0x46')][_0xe85c('0x4b')](_0xe85c('0x68'))){_0x77127f['limit']=qs['limit'](_0xbb0e22[_0xe85c('0x46')][_0xe85c('0x2e')]);_0x77127f[_0xe85c('0x30')]=qs[_0xe85c('0x30')](_0xbb0e22[_0xe85c('0x46')]['offset']);}return _0x13a71b[_0xe85c('0x111')](_0x77127f);}})[_0xe85c('0x1f')](function(_0x5568b4){if(_0x5568b4){return _0x5568b4?{'count':_0xe7261a,'rows':_0x5568b4}:null;}})['then'](respondWithResult(_0x48b894,null))[_0xe85c('0x29')](handleError(_0x48b894,null));};exports['getFields']=function(_0x3ec073,_0x5af8ff,_0x1f3e6a){var _0x1eadcf=_0x3ec073[_0xe85c('0x46')]['online']===_0xe85c('0x127')?_0xe85c('0x128'):_0xe85c('0x129');return db['ChatWebsite'][_0xe85c('0x59')]({'attributes':['id',_0x1eadcf],'where':{'id':_0x3ec073[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x5af8ff,null))[_0xe85c('0x1f')](function(_0x372b33){if(_0x372b33){var _0x1abec8=_0x372b33[_0x1eadcf];var _0x6b8bdc=_0x1abec8&&_0x1abec8[_0xe85c('0x12a')]?_0x1abec8[_0xe85c('0x12a')]:[];_0x5af8ff[_0xe85c('0x3b')]({'fromKey':_[_0xe85c('0x7f')](_0x1abec8[_0xe85c('0x12b')])?undefined:_0x1abec8['fromKey'],'count':_0x6b8bdc['length'],'rows':_0x6b8bdc});}})[_0xe85c('0x29')](handleError(_0x5af8ff,null));};exports[_0xe85c('0x12c')]=function(_0x2e081c,_0x161cba,_0x464694){var _0x153d3a={'raw':![],'where':{}};var _0x30feda={};var _0x26f0fa={'count':0x0,'rows':[]};return db[_0xe85c('0x40')][_0xe85c('0x67')]({'where':{'id':_0x2e081c[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x161cba,null))[_0xe85c('0x1f')](function(_0x10ad34){if(_0x10ad34){_0x30feda[_0xe85c('0x44')]=_['keys'](db[_0xe85c('0xdf')][_0xe85c('0x70')]);_0x30feda[_0xe85c('0x46')]=_[_0xe85c('0x45')](_0x2e081c[_0xe85c('0x46')]);_0x30feda[_0xe85c('0x47')]=_[_0xe85c('0x58')](_0x30feda[_0xe85c('0x44')],_0x30feda[_0xe85c('0x46')]);_0x153d3a[_0xe85c('0x49')]=_[_0xe85c('0x58')](_0x30feda['model'],qs[_0xe85c('0x48')](_0x2e081c['query'][_0xe85c('0x48')]));_0x153d3a[_0xe85c('0x49')]=_0x153d3a[_0xe85c('0x49')]['length']?_0x153d3a['attributes']:_0x30feda[_0xe85c('0x44')];if(!_0x2e081c[_0xe85c('0x46')]['hasOwnProperty'](_0xe85c('0x68'))){_0x153d3a[_0xe85c('0x2e')]=qs[_0xe85c('0x2e')](_0x2e081c[_0xe85c('0x46')]['limit']);_0x153d3a[_0xe85c('0x30')]=qs['offset'](_0x2e081c[_0xe85c('0x46')]['offset']);}_0x153d3a['order']=qs[_0xe85c('0x4d')](_0x2e081c[_0xe85c('0x46')]['sort']);_0x153d3a[_0xe85c('0x50')]=qs['filters'](_[_0xe85c('0x4e')](_0x2e081c['query'],_0x30feda['filters']));_0x153d3a[_0xe85c('0x50')][_0xe85c('0x69')]=_0x10ad34['id'];if(_0x2e081c[_0xe85c('0x46')]['filter']){_0x153d3a[_0xe85c('0x50')]=_[_0xe85c('0x51')](_0x153d3a['where'],{'$or':_[_0xe85c('0x3f')](_0x153d3a[_0xe85c('0x49')],function(_0x160939){var _0x53c9fe={};_0x53c9fe[_0x160939]={'$like':'%'+_0x2e081c[_0xe85c('0x46')][_0xe85c('0x4f')]+'%'};return _0x53c9fe;})});}_0x153d3a=_['merge']({},_0x153d3a,_0x2e081c[_0xe85c('0x53')]);return db[_0xe85c('0xdf')][_0xe85c('0x2f')]({'where':_0x153d3a[_0xe85c('0x50')]})[_0xe85c('0x1f')](function(_0x5d93c2){_0x26f0fa[_0xe85c('0x2f')]=_0x5d93c2;if(_0x2e081c[_0xe85c('0x46')][_0xe85c('0x54')]){_0x153d3a[_0xe85c('0x6a')]=[{'all':!![]}];}else{_0x153d3a[_0xe85c('0x6a')]=[{'model':db[_0xe85c('0x92')],'as':_0xe85c('0x12d'),'required':![]},{'model':db[_0xe85c('0xe3')],'as':_0xe85c('0x12e'),'required':![]}];}return db['ChatOfflineMessage'][_0xe85c('0x6b')](_0x153d3a);})['then'](function(_0x4c8fde){_0x26f0fa[_0xe85c('0x55')]=_0x4c8fde;return _0x26f0fa;});}})[_0xe85c('0x1f')](respondWithFilteredResult(_0x161cba,_0x153d3a))[_0xe85c('0x29')](handleError(_0x161cba,null));};exports[_0xe85c('0x12f')]=function(_0x51a00f,_0x159edd,_0x5963f1){return db[_0xe85c('0x40')][_0xe85c('0x59')]({'where':{'id':_0x51a00f['params']['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x159edd,null))[_0xe85c('0x1f')](function(_0x40309e){if(_0x40309e){return _0x40309e['addAgents'](_0x51a00f[_0xe85c('0x63')][_0xe85c('0x6d')],_[_0xe85c('0x126')](_0x51a00f[_0xe85c('0x63')],[_0xe85c('0x6d'),'id'])||{})['spread'](function(_0x1a0cde){for(var _0x351580=0x0;_0x351580<_0x51a00f['body']['ids'][_0xe85c('0x4a')];_0x351580+=0x1){socket['emit'](_0xe85c('0x130'),{'UserId':Number(_0x51a00f['body']['ids'][_0x351580]),'ChatWebsiteId':Number(_0x51a00f[_0xe85c('0x57')]['id'])});}return _0x1a0cde;});}})[_0xe85c('0x1f')](respondWithResult(_0x159edd,null))[_0xe85c('0x29')](handleError(_0x159edd,null));};exports[_0xe85c('0x131')]=function(_0x3512c7,_0x1d05e2,_0x4a889b){return db[_0xe85c('0x40')][_0xe85c('0x59')]({'where':{'id':_0x3512c7[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x1d05e2,null))[_0xe85c('0x1f')](function(_0x253a4f){if(_0x253a4f){return _0x253a4f['removeAgents'](_0x3512c7[_0xe85c('0x46')][_0xe85c('0x6d')])[_0xe85c('0x1f')](function(){if(_[_0xe85c('0x132')](_0x3512c7['query'][_0xe85c('0x6d')])){for(var _0x139a28=0x0;_0x139a28<_0x3512c7[_0xe85c('0x46')][_0xe85c('0x6d')][_0xe85c('0x4a')];_0x139a28+=0x1){socket[_0xe85c('0x133')]('userChatWebsite:remove',{'UserId':Number(_0x3512c7[_0xe85c('0x46')][_0xe85c('0x6d')][_0x139a28]),'ChatWebsiteId':Number(_0x3512c7[_0xe85c('0x57')]['id'])});}}else{socket[_0xe85c('0x133')](_0xe85c('0x134'),{'UserId':Number(_0x3512c7[_0xe85c('0x46')]['ids']),'ChatWebsiteId':Number(_0x3512c7[_0xe85c('0x57')]['id'])});}});}})[_0xe85c('0x1f')](respondWithStatusCode(_0x1d05e2,null))[_0xe85c('0x29')](handleError(_0x1d05e2,null));};exports[_0xe85c('0x135')]=function(_0x5aee50,_0x2382e9,_0x5620a5){var _0x4d4209={};var _0x276d8d={};var _0x574232;var _0x5eb090;return db[_0xe85c('0x40')][_0xe85c('0x67')]({'where':{'id':_0x5aee50[_0xe85c('0x57')]['id']}})[_0xe85c('0x1f')](handleEntityNotFound(_0x2382e9,null))['then'](function(_0x440af1){if(_0x440af1){_0x574232=_0x440af1;_0x276d8d['model']=_[_0xe85c('0x45')](db[_0xe85c('0xcc')][_0xe85c('0x70')]);_0x276d8d[_0xe85c('0x46')]=_[_0xe85c('0x45')](_0x5aee50[_0xe85c('0x46')]);_0x276d8d[_0xe85c('0x47')]=_['intersection'](_0x276d8d[_0xe85c('0x44')],_0x276d8d[_0xe85c('0x46')]);_0x4d4209[_0xe85c('0x49')]=_[_0xe85c('0x58')](_0x276d8d['model'],qs[_0xe85c('0x48')](_0x5aee50[_0xe85c('0x46')][_0xe85c('0x48')]));_0x4d4209[_0xe85c('0x49')]=_0x4d4209[_0xe85c('0x49')][_0xe85c('0x4a')]?_0x4d4209[_0xe85c('0x49')]:_0x276d8d[_0xe85c('0x44')];_0x4d4209['order']=qs[_0xe85c('0x4d')](_0x5aee50['query']['sort']);_0x4d4209[_0xe85c('0x50')]=qs[_0xe85c('0x47')](_[_0xe85c('0x4e')](_0x5aee50[_0xe85c('0x46')],_0x276d8d[_0xe85c('0x47')]));if(_0x5aee50[_0xe85c('0x46')]['filter']){_0x4d4209[_0xe85c('0x50')]=_['merge'](_0x4d4209['where'],{'$or':_[_0xe85c('0x3f')](_0x4d4209[_0xe85c('0x49')],function(_0x1b0e4f){var _0x12682e={};_0x12682e[_0x1b0e4f]={'$like':'%'+_0x5aee50['query'][_0xe85c('0x4f')]+'%'};return _0x12682e;})});}_0x4d4209=_[_0xe85c('0x51')]({},_0x4d4209,_0x5aee50[_0xe85c('0x53')]);return _0x574232[_0xe85c('0x135')](_0x4d4209);}})[_0xe85c('0x1f')](function(_0x132d81){if(_0x132d81){_0x5eb090=_0x132d81[_0xe85c('0x4a')];if(!_0x5aee50[_0xe85c('0x46')][_0xe85c('0x4b')](_0xe85c('0x68'))){_0x4d4209[_0xe85c('0x2e')]=qs[_0xe85c('0x2e')](_0x5aee50[_0xe85c('0x46')][_0xe85c('0x2e')]);_0x4d4209[_0xe85c('0x30')]=qs['offset'](_0x5aee50['query'][_0xe85c('0x30')]);}return _0x574232[_0xe85c('0x135')](_0x4d4209);}})[_0xe85c('0x1f')](function(_0x50565f){if(_0x50565f){return _0x50565f?{'count':_0x5eb090,'rows':_0x50565f}:null;}})[_0xe85c('0x1f')](respondWithResult(_0x2382e9,null))[_0xe85c('0x29')](handleError(_0x2382e9,null));};
\ No newline at end of file
+var _0x2563=['openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','auth','sendMail','email','offlineMessageSubject','subjectOffline','Chat','MailAccountId','NotifyMailAccount','notifyMail','remove','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','getLicense','custom','License','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','virtual','replace','alignment','verticalAlignment','color_button','transaction','ChatApplication','findAndCountAll','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./chatWebsite.socket','jayson/promise','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','destroy','ChatWebsites','UserProfileResource','stack','name','send','Pause','map','ChatWebsite','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','include','findAll','rows','catch','show','params','mandatoryDispositionPause','keys','includeAll','find','create','body','user','get','role','UserProfileSection','userProfileId','describe','ChatWebsiteId','Disposition','getDispositions','findOne','order','options','removeDispositions','ids','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','isNil','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','user-agent','getResult','chat','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','from','from\x20is\x20mandatory','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','List','Contacts','DESC','Applications','applications','list','orderBy','asc','account','defaults','CmContact','contact','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','externalUrl','ChatInteraction','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','body\x20is\x20mandatory\x20and\x20not\x20empty','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','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename'];(function(_0x38c652,_0x1ea1b7){var _0x218a37=function(_0x5dcb2a){while(--_0x5dcb2a){_0x38c652['push'](_0x38c652['shift']());}};_0x218a37(++_0x1ea1b7);}(_0x2563,0x182));var _0x3256=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2563[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x3256('0x0'));var rimraf=require(_0x3256('0x1'));var zipdir=require(_0x3256('0x2'));var jsonpatch=require(_0x3256('0x3'));var rp=require(_0x3256('0x4'));var moment=require(_0x3256('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3256('0x6'));var util=require('util');var path=require(_0x3256('0x7'));var sox=require(_0x3256('0x8'));var csv=require(_0x3256('0x9'));var ejs=require(_0x3256('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3256('0xb'));var crypto=require(_0x3256('0xc'));var jsforce=require(_0x3256('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3256('0x9'));var querystring=require(_0x3256('0xe'));var Papa=require(_0x3256('0xf'));var Redis=require('ioredis');var authService=require(_0x3256('0x10'));var qs=require(_0x3256('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3256('0x12'))(_0x3256('0x13'));var utils=require(_0x3256('0x14'));var config=require(_0x3256('0x15'));var licenseUtil=require(_0x3256('0x16'));var db=require('../../mysqldb')['db'];config[_0x3256('0x17')]=_['defaults'](config[_0x3256('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x3256('0x18'))(new Redis(config['redis']));require(_0x3256('0x19'))['register'](socket);var jayson=require(_0x3256('0x1a'));var client=jayson['client'][_0x3256('0x1b')]({'port':0x232c});var client9002=jayson[_0x3256('0x1c')][_0x3256('0x1b')]({'port':0x232a});var client9003=jayson[_0x3256('0x1c')]['http']({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x2ceb70,_0x28dadb,_0x394ba3,_0x4e51a0){return new BPromise(function(_0x351e97,_0x1754af){var _0x12243f=_0x4e51a0||client;return _0x12243f[_0x3256('0x1d')](_0x2ceb70,_0x394ba3)[_0x3256('0x1e')](function(_0xdc2334){logger[_0x3256('0x1f')](_0x3256('0x20'),_0x28dadb,_0x3256('0x21'));logger[_0x3256('0x22')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x28dadb,_0x3256('0x21'),JSON[_0x3256('0x23')](_0xdc2334));if(_0xdc2334[_0x3256('0x24')]){if(_0xdc2334[_0x3256('0x24')][_0x3256('0x25')]===0x1f4){logger[_0x3256('0x24')](_0x3256('0x20'),_0x28dadb,_0xdc2334[_0x3256('0x24')][_0x3256('0x26')]);return _0x1754af(_0xdc2334[_0x3256('0x24')][_0x3256('0x26')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x28dadb,_0xdc2334['error'][_0x3256('0x26')]);return _0x351e97(_0xdc2334[_0x3256('0x24')][_0x3256('0x26')]);}else{logger[_0x3256('0x1f')](_0x3256('0x20'),_0x28dadb,_0x3256('0x21'));_0x351e97(_0xdc2334[_0x3256('0x27')][_0x3256('0x26')]);}})['catch'](function(_0x2a8d8d){logger['error'](_0x3256('0x20'),_0x28dadb,_0x2a8d8d);_0x1754af(_0x2a8d8d);});});}function respondWithStatusCode(_0x3a3915,_0x47cb98){_0x47cb98=_0x47cb98||0xcc;return function(_0x112bf5){if(_0x112bf5){return _0x3a3915[_0x3256('0x28')](_0x47cb98);}return _0x3a3915[_0x3256('0x29')](_0x47cb98)[_0x3256('0x2a')]();};}function respondWithResult(_0x2e21fc,_0x207c5d){_0x207c5d=_0x207c5d||0xc8;return function(_0x51ffaa){if(_0x51ffaa){return _0x2e21fc[_0x3256('0x29')](_0x207c5d)[_0x3256('0x2b')](_0x51ffaa);}};}function respondWithFilteredResult(_0x58e24a,_0x57d36e){return function(_0x22e3b1){if(_0x22e3b1){var _0x5d20ea=typeof _0x57d36e['offset']===_0x3256('0x2c')&&typeof _0x57d36e[_0x3256('0x2d')]===_0x3256('0x2c');var _0x1d597b=_0x22e3b1[_0x3256('0x2e')];var _0x4b1d5c=_0x5d20ea?0x0:_0x57d36e[_0x3256('0x2f')];var _0x2620c7=_0x5d20ea?_0x22e3b1[_0x3256('0x2e')]:_0x57d36e[_0x3256('0x2f')]+_0x57d36e[_0x3256('0x2d')];var _0x59900b;if(_0x2620c7>=_0x1d597b){_0x2620c7=_0x1d597b;_0x59900b=0xc8;}else{_0x59900b=0xce;}_0x58e24a[_0x3256('0x29')](_0x59900b);return _0x58e24a[_0x3256('0x30')](_0x3256('0x31'),_0x4b1d5c+'-'+_0x2620c7+'/'+_0x1d597b)[_0x3256('0x2b')](_0x22e3b1);}return null;};}function patchUpdates(_0x182193){return function(_0x339582){try{jsonpatch[_0x3256('0x32')](_0x339582,_0x182193,!![]);}catch(_0x51b9c5){return BPromise['reject'](_0x51b9c5);}return _0x339582['save']();};}function saveUpdates(_0x2d6deb,_0x27f7cf){return function(_0x3e0890){if(_0x3e0890){return _0x3e0890[_0x3256('0x33')](_0x2d6deb)['then'](function(_0x37b84d){return _0x37b84d;});}return null;};}function removeEntity(_0x283be1,_0x2dc911){return function(_0x5cbd9d){if(_0x5cbd9d){return _0x5cbd9d[_0x3256('0x34')]()[_0x3256('0x1e')](function(){var _0x437d68=_0x5cbd9d['get']({'plain':!![]});var _0x4b2227=_0x3256('0x35');return db[_0x3256('0x36')][_0x3256('0x34')]({'where':{'type':_0x4b2227,'resourceId':_0x437d68['id']}})[_0x3256('0x1e')](function(){return _0x5cbd9d;});})[_0x3256('0x1e')](function(){_0x283be1[_0x3256('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f983b,_0x3910db){return function(_0x229204){if(!_0x229204){_0x3f983b[_0x3256('0x28')](0x194);}return _0x229204;};}function handleError(_0x538dff,_0x16cdbc){_0x16cdbc=_0x16cdbc||0x1f4;return function(_0x32c6f2){logger['error'](_0x32c6f2[_0x3256('0x37')]);if(_0x32c6f2['name']){delete _0x32c6f2[_0x3256('0x38')];}_0x538dff['status'](_0x16cdbc)[_0x3256('0x39')](_0x32c6f2);};}exports['index']=function(_0x4ffdb1,_0x2372fc){var _0x56b82e={'include':[{'model':db[_0x3256('0x3a')],'as':'mandatoryDispositionPause'}]},_0x3862c4={},_0xed50a={'count':0x0,'rows':[]};var _0x12a1cf=_[_0x3256('0x3b')](db[_0x3256('0x3c')][_0x3256('0x3d')],function(_0x4a85c8){return{'name':_0x4a85c8[_0x3256('0x3e')],'type':_0x4a85c8[_0x3256('0x3f')][_0x3256('0x40')]};});_0x3862c4['model']=_[_0x3256('0x3b')](_0x12a1cf,'name');_0x3862c4[_0x3256('0x41')]=_['keys'](_0x4ffdb1[_0x3256('0x41')]);_0x3862c4[_0x3256('0x42')]=_['intersection'](_0x3862c4[_0x3256('0x43')],_0x3862c4['query']);_0x56b82e[_0x3256('0x44')]=_[_0x3256('0x45')](_0x3862c4[_0x3256('0x43')],qs[_0x3256('0x46')](_0x4ffdb1[_0x3256('0x41')][_0x3256('0x46')]));_0x56b82e[_0x3256('0x44')]=_0x56b82e[_0x3256('0x44')][_0x3256('0x47')]?_0x56b82e['attributes']:_0x3862c4['model'];if(!_0x4ffdb1[_0x3256('0x41')][_0x3256('0x48')](_0x3256('0x49'))){_0x56b82e[_0x3256('0x2d')]=qs[_0x3256('0x2d')](_0x4ffdb1[_0x3256('0x41')]['limit']);_0x56b82e[_0x3256('0x2f')]=qs[_0x3256('0x2f')](_0x4ffdb1['query'][_0x3256('0x2f')]);}_0x56b82e['order']=qs[_0x3256('0x4a')](_0x4ffdb1[_0x3256('0x41')][_0x3256('0x4a')]);_0x56b82e[_0x3256('0x4b')]=qs['filters'](_[_0x3256('0x4c')](_0x4ffdb1[_0x3256('0x41')],_0x3862c4[_0x3256('0x42')]),_0x12a1cf);if(_0x4ffdb1[_0x3256('0x41')]['filter']){_0x56b82e[_0x3256('0x4b')]=_[_0x3256('0x4d')](_0x56b82e[_0x3256('0x4b')],{'$or':_[_0x3256('0x3b')](_0x12a1cf,function(_0x4f9c86){if(_0x4f9c86[_0x3256('0x3f')]!=='VIRTUAL'){var _0x4be596={};_0x4be596[_0x4f9c86[_0x3256('0x38')]]={'$like':'%'+_0x4ffdb1[_0x3256('0x41')][_0x3256('0x4e')]+'%'};return _0x4be596;}})});}_0x56b82e=_[_0x3256('0x4d')]({},_0x56b82e,_0x4ffdb1['options']);var _0x2f0943={'where':_0x56b82e[_0x3256('0x4b')]};return db[_0x3256('0x3c')]['count'](_0x2f0943)['then'](function(_0x51ef92){_0xed50a[_0x3256('0x2e')]=_0x51ef92;if(_0x4ffdb1['query']['includeAll']){_0x56b82e[_0x3256('0x4f')]=[{'all':!![]}];}return db[_0x3256('0x3c')][_0x3256('0x50')](_0x56b82e);})[_0x3256('0x1e')](function(_0x25ef94){_0xed50a[_0x3256('0x51')]=_0x25ef94;return _0xed50a;})[_0x3256('0x1e')](respondWithFilteredResult(_0x2372fc,_0x56b82e))[_0x3256('0x52')](handleError(_0x2372fc,null));};exports[_0x3256('0x53')]=function(_0x406af6,_0x5af65d){var _0x1505de={'raw':![],'where':{'id':_0x406af6[_0x3256('0x54')]['id']},'include':[{'model':db[_0x3256('0x3a')],'as':_0x3256('0x55')}]},_0x3bafc1={};_0x3bafc1['model']=_[_0x3256('0x56')](db['ChatWebsite'][_0x3256('0x3d')]);_0x3bafc1[_0x3256('0x41')]=_[_0x3256('0x56')](_0x406af6['query']);_0x3bafc1[_0x3256('0x42')]=_[_0x3256('0x45')](_0x3bafc1[_0x3256('0x43')],_0x3bafc1['query']);_0x1505de[_0x3256('0x44')]=_[_0x3256('0x45')](_0x3bafc1['model'],qs[_0x3256('0x46')](_0x406af6[_0x3256('0x41')][_0x3256('0x46')]));_0x1505de[_0x3256('0x44')]=_0x1505de[_0x3256('0x44')][_0x3256('0x47')]?_0x1505de[_0x3256('0x44')]:_0x3bafc1[_0x3256('0x43')];if(_0x406af6[_0x3256('0x41')][_0x3256('0x57')]){_0x1505de['include']=[{'all':!![]}];}_0x1505de=_[_0x3256('0x4d')]({},_0x1505de,_0x406af6['options']);return db['ChatWebsite'][_0x3256('0x58')](_0x1505de)[_0x3256('0x1e')](handleEntityNotFound(_0x5af65d,null))[_0x3256('0x1e')](respondWithResult(_0x5af65d,null))[_0x3256('0x52')](handleError(_0x5af65d,null));};exports[_0x3256('0x59')]=function(_0x5cfc1c,_0x23f39e){return db[_0x3256('0x3c')][_0x3256('0x59')](_0x5cfc1c[_0x3256('0x5a')],{})[_0x3256('0x1e')](function(_0x5da708){var _0x3af3f8=_0x5cfc1c[_0x3256('0x5b')][_0x3256('0x5c')]({'plain':!![]});if(!_0x3af3f8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3af3f8[_0x3256('0x5d')]==='user'){var _0x3ff570=_0x5da708[_0x3256('0x5c')]({'plain':!![]});var _0x4c98b4='ChatWebsites';return db[_0x3256('0x5e')][_0x3256('0x58')]({'where':{'name':_0x4c98b4,'userProfileId':_0x3af3f8[_0x3256('0x5f')]},'raw':!![]})[_0x3256('0x1e')](function(_0x32a09d){if(_0x32a09d&&_0x32a09d['autoAssociation']===0x0){return db[_0x3256('0x36')][_0x3256('0x59')]({'name':_0x3ff570[_0x3256('0x38')],'resourceId':_0x3ff570['id'],'type':_0x32a09d[_0x3256('0x38')],'sectionId':_0x32a09d['id']},{})[_0x3256('0x1e')](function(){return _0x5da708;});}else{return _0x5da708;}})['catch'](function(_0x110cb6){logger[_0x3256('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x110cb6);throw _0x110cb6;});}return _0x5da708;})[_0x3256('0x1e')](respondWithResult(_0x23f39e,0xc9))['catch'](handleError(_0x23f39e,null));};exports[_0x3256('0x33')]=function(_0xcfd1e8,_0x2caf9f){if(_0xcfd1e8[_0x3256('0x5a')]['id']){delete _0xcfd1e8[_0x3256('0x5a')]['id'];}return db[_0x3256('0x3c')][_0x3256('0x58')]({'where':{'id':_0xcfd1e8['params']['id']},'include':[{'model':db[_0x3256('0x3a')],'as':_0x3256('0x55')}]})[_0x3256('0x1e')](handleEntityNotFound(_0x2caf9f,null))[_0x3256('0x1e')](saveUpdates(_0xcfd1e8[_0x3256('0x5a')],null))[_0x3256('0x1e')](respondWithResult(_0x2caf9f,null))[_0x3256('0x52')](handleError(_0x2caf9f,null));};exports['destroy']=function(_0x132470,_0x1e84fb){return db['ChatWebsite'][_0x3256('0x58')]({'where':{'id':_0x132470[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x1e84fb,null))[_0x3256('0x1e')](removeEntity(_0x1e84fb,null))[_0x3256('0x52')](handleError(_0x1e84fb,null));};exports[_0x3256('0x60')]=function(_0x386b5a,_0x840ccb){return db[_0x3256('0x3c')][_0x3256('0x60')]()[_0x3256('0x1e')](respondWithResult(_0x840ccb,null))['catch'](handleError(_0x840ccb,null));};exports['addDisposition']=function(_0x4b647b,_0x22aee9,_0x488ba7){if(_0x4b647b[_0x3256('0x5a')]['id']){delete _0x4b647b[_0x3256('0x5a')]['id'];}return db[_0x3256('0x3c')][_0x3256('0x58')]({'where':{'id':_0x4b647b[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x22aee9,null))[_0x3256('0x1e')](function(_0x559bc7){if(_0x559bc7){_0x4b647b[_0x3256('0x5a')][_0x3256('0x61')]=_0x559bc7['id'];return db[_0x3256('0x62')][_0x3256('0x59')](_0x4b647b['body']);}})[_0x3256('0x1e')](respondWithResult(_0x22aee9,null))[_0x3256('0x52')](handleError(_0x22aee9,null));};exports[_0x3256('0x63')]=function(_0x1aabd1,_0x5f18cc,_0xd1f55){var _0x4ba77c={'raw':![],'where':{}};var _0x4063b8={};var _0xd13029={'count':0x0,'rows':[]};return db[_0x3256('0x3c')][_0x3256('0x64')]({'where':{'id':_0x1aabd1[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x5f18cc,null))[_0x3256('0x1e')](function(_0x3c6f86){if(_0x3c6f86){_0x4063b8[_0x3256('0x43')]=_[_0x3256('0x56')](db[_0x3256('0x62')][_0x3256('0x3d')]);_0x4063b8[_0x3256('0x41')]=_[_0x3256('0x56')](_0x1aabd1['query']);_0x4063b8[_0x3256('0x42')]=_[_0x3256('0x45')](_0x4063b8[_0x3256('0x43')],_0x4063b8[_0x3256('0x41')]);_0x4ba77c[_0x3256('0x44')]=_[_0x3256('0x45')](_0x4063b8['model'],qs[_0x3256('0x46')](_0x1aabd1[_0x3256('0x41')][_0x3256('0x46')]));_0x4ba77c[_0x3256('0x44')]=_0x4ba77c[_0x3256('0x44')][_0x3256('0x47')]?_0x4ba77c[_0x3256('0x44')]:_0x4063b8[_0x3256('0x43')];if(!_0x1aabd1['query'][_0x3256('0x48')]('nolimit')){_0x4ba77c['limit']=qs['limit'](_0x1aabd1[_0x3256('0x41')][_0x3256('0x2d')]);_0x4ba77c[_0x3256('0x2f')]=qs[_0x3256('0x2f')](_0x1aabd1[_0x3256('0x41')][_0x3256('0x2f')]);}_0x4ba77c[_0x3256('0x65')]=qs[_0x3256('0x4a')](_0x1aabd1[_0x3256('0x41')][_0x3256('0x4a')]);_0x4ba77c[_0x3256('0x4b')]=qs[_0x3256('0x42')](_[_0x3256('0x4c')](_0x1aabd1[_0x3256('0x41')],_0x4063b8[_0x3256('0x42')]));_0x4ba77c[_0x3256('0x4b')]['ChatWebsiteId']=_0x3c6f86['id'];if(_0x1aabd1[_0x3256('0x41')][_0x3256('0x4e')]){_0x4ba77c[_0x3256('0x4b')]=_[_0x3256('0x4d')](_0x4ba77c[_0x3256('0x4b')],{'$or':_[_0x3256('0x3b')](_0x4ba77c[_0x3256('0x44')],function(_0x4bbc32){var _0x1aa174={};_0x1aa174[_0x4bbc32]={'$like':'%'+_0x1aabd1[_0x3256('0x41')][_0x3256('0x4e')]+'%'};return _0x1aa174;})});}_0x4ba77c=_[_0x3256('0x4d')]({},_0x4ba77c,_0x1aabd1[_0x3256('0x66')]);return db[_0x3256('0x62')]['count']({'where':_0x4ba77c[_0x3256('0x4b')]})[_0x3256('0x1e')](function(_0x3fc02a){_0xd13029[_0x3256('0x2e')]=_0x3fc02a;if(_0x1aabd1[_0x3256('0x41')][_0x3256('0x57')]){_0x4ba77c['include']=[{'all':!![]}];}return db[_0x3256('0x62')][_0x3256('0x50')](_0x4ba77c);})[_0x3256('0x1e')](function(_0x481efe){_0xd13029[_0x3256('0x51')]=_0x481efe;return _0xd13029;});}})[_0x3256('0x1e')](respondWithFilteredResult(_0x5f18cc,_0x4ba77c))['catch'](handleError(_0x5f18cc,null));};exports[_0x3256('0x67')]=function(_0x450279,_0x5464cc,_0x4bed17){return db[_0x3256('0x3c')]['find']({'where':{'id':_0x450279[_0x3256('0x54')]['id']}})['then'](handleEntityNotFound(_0x5464cc,null))[_0x3256('0x1e')](function(_0x26363c){if(_0x26363c){return _0x26363c[_0x3256('0x67')](_0x450279[_0x3256('0x41')][_0x3256('0x68')]);}})[_0x3256('0x1e')](respondWithStatusCode(_0x5464cc,null))[_0x3256('0x52')](handleError(_0x5464cc,null));};exports['addAnswer']=function(_0x1e0a5f,_0x372913,_0x5c98eb){if(_0x1e0a5f[_0x3256('0x5a')]['id']){delete _0x1e0a5f[_0x3256('0x5a')]['id'];}return db[_0x3256('0x3c')]['find']({'where':{'id':_0x1e0a5f['params']['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x372913,null))[_0x3256('0x1e')](function(_0x5763ff){if(_0x5763ff){_0x1e0a5f[_0x3256('0x5a')][_0x3256('0x61')]=_0x5763ff['id'];return db[_0x3256('0x69')][_0x3256('0x59')](_0x1e0a5f[_0x3256('0x5a')]);}})[_0x3256('0x1e')](respondWithResult(_0x372913,null))[_0x3256('0x52')](handleError(_0x372913,null));};exports['getAnswers']=function(_0x53cbbb,_0x3c8f0c,_0x469670){var _0x2bd321={'raw':![],'where':{}};var _0x4e55a5={};var _0x28dbc4={'count':0x0,'rows':[]};return db[_0x3256('0x3c')][_0x3256('0x64')]({'where':{'id':_0x53cbbb[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x3c8f0c,null))[_0x3256('0x1e')](function(_0x25524d){if(_0x25524d){_0x4e55a5[_0x3256('0x43')]=_['keys'](db['CannedAnswer'][_0x3256('0x3d')]);_0x4e55a5[_0x3256('0x41')]=_[_0x3256('0x56')](_0x53cbbb['query']);_0x4e55a5[_0x3256('0x42')]=_[_0x3256('0x45')](_0x4e55a5['model'],_0x4e55a5[_0x3256('0x41')]);_0x2bd321[_0x3256('0x44')]=_['intersection'](_0x4e55a5[_0x3256('0x43')],qs[_0x3256('0x46')](_0x53cbbb[_0x3256('0x41')]['fields']));_0x2bd321[_0x3256('0x44')]=_0x2bd321['attributes'][_0x3256('0x47')]?_0x2bd321[_0x3256('0x44')]:_0x4e55a5[_0x3256('0x43')];if(!_0x53cbbb[_0x3256('0x41')][_0x3256('0x48')]('nolimit')){_0x2bd321['limit']=qs[_0x3256('0x2d')](_0x53cbbb['query'][_0x3256('0x2d')]);_0x2bd321['offset']=qs[_0x3256('0x2f')](_0x53cbbb[_0x3256('0x41')][_0x3256('0x2f')]);}_0x2bd321['order']=qs['sort'](_0x53cbbb[_0x3256('0x41')][_0x3256('0x4a')]);_0x2bd321[_0x3256('0x4b')]=qs[_0x3256('0x42')](_[_0x3256('0x4c')](_0x53cbbb[_0x3256('0x41')],_0x4e55a5['filters']));_0x2bd321['where']['ChatWebsiteId']=_0x25524d['id'];if(_0x53cbbb['query'][_0x3256('0x4e')]){_0x2bd321[_0x3256('0x4b')]=_[_0x3256('0x4d')](_0x2bd321[_0x3256('0x4b')],{'$or':_[_0x3256('0x3b')](_0x2bd321[_0x3256('0x44')],function(_0x45b320){var _0x375d47={};_0x375d47[_0x45b320]={'$like':'%'+_0x53cbbb['query']['filter']+'%'};return _0x375d47;})});}_0x2bd321=_['merge']({},_0x2bd321,_0x53cbbb[_0x3256('0x66')]);return db['CannedAnswer'][_0x3256('0x2e')]({'where':_0x2bd321[_0x3256('0x4b')]})[_0x3256('0x1e')](function(_0x37485e){_0x28dbc4[_0x3256('0x2e')]=_0x37485e;if(_0x53cbbb[_0x3256('0x41')][_0x3256('0x57')]){_0x2bd321['include']=[{'all':!![]}];}return db[_0x3256('0x69')][_0x3256('0x50')](_0x2bd321);})[_0x3256('0x1e')](function(_0x34bf4c){_0x28dbc4[_0x3256('0x51')]=_0x34bf4c;return _0x28dbc4;});}})[_0x3256('0x1e')](respondWithFilteredResult(_0x3c8f0c,_0x2bd321))[_0x3256('0x52')](handleError(_0x3c8f0c,null));};exports['removeAnswers']=function(_0x31a908,_0x52d9db,_0x19629c){return db[_0x3256('0x3c')][_0x3256('0x58')]({'where':{'id':_0x31a908['params']['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x52d9db,null))[_0x3256('0x1e')](function(_0x1d72f7){if(_0x1d72f7){return _0x1d72f7[_0x3256('0x6a')](_0x31a908[_0x3256('0x41')][_0x3256('0x68')]);}})[_0x3256('0x1e')](respondWithStatusCode(_0x52d9db,null))['catch'](handleError(_0x52d9db,null));};exports[_0x3256('0x6b')]=function(_0x371429,_0x4a4293,_0x5cd6e1){_0x371429['body'][_0x3256('0x6c')]=_0x371429[_0x3256('0x6d')][_0x3256('0x6e')];return db['ChatWebsite'][_0x3256('0x58')]({'where':{'id':_0x371429['params']['id']}})['then'](handleEntityNotFound(_0x4a4293,null))['then'](saveUpdates(_0x371429[_0x3256('0x5a')],null))[_0x3256('0x1e')](respondWithResult(_0x4a4293,null))[_0x3256('0x52')](handleError(_0x4a4293,null));};exports['addAvatar']=function(_0x2b8e50,_0x226499,_0x5c8941){_0x2b8e50[_0x3256('0x5a')][_0x3256('0x6f')]=_0x2b8e50[_0x3256('0x6d')][_0x3256('0x6e')];return db[_0x3256('0x3c')][_0x3256('0x58')]({'where':{'id':_0x2b8e50[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x226499,null))['then'](saveUpdates(_0x2b8e50[_0x3256('0x5a')],null))['then'](respondWithResult(_0x226499,null))[_0x3256('0x52')](handleError(_0x226499,null));};exports[_0x3256('0x70')]=function(_0x42b3d0,_0x64e81f,_0x24cfff){_0x42b3d0['body'][_0x3256('0x71')]=_0x42b3d0[_0x3256('0x6d')]['filename'];return db[_0x3256('0x3c')][_0x3256('0x58')]({'where':{'id':_0x42b3d0[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x64e81f,null))['then'](saveUpdates(_0x42b3d0[_0x3256('0x5a')],null))[_0x3256('0x1e')](respondWithResult(_0x64e81f,null))[_0x3256('0x52')](handleError(_0x64e81f,null));};exports[_0x3256('0x72')]=function(_0x2d3827,_0x19a2fe,_0x376184){_0x2d3827[_0x3256('0x5a')]['systemAvatar']=_0x2d3827[_0x3256('0x6d')]['filename'];return db[_0x3256('0x3c')][_0x3256('0x58')]({'where':{'id':_0x2d3827[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x19a2fe,null))[_0x3256('0x1e')](saveUpdates(_0x2d3827['body'],null))['then'](respondWithResult(_0x19a2fe,null))[_0x3256('0x52')](handleError(_0x19a2fe,null));};exports[_0x3256('0x73')]=function(_0x44740a,_0x1894b3,_0x13fff4){var _0x523e5d=path[_0x3256('0x74')](config['root'],_0x3256('0x75'));var _0x21a82d={'where':{'id':_0x44740a[_0x3256('0x54')]['id']},'attributes':['id',_0x3256('0x6c')],'raw':!![]};var _0xf95e3=![];return require(_0x3256('0x16'))['getLicense']()['then'](function(_0xc2edf9){if(_0xc2edf9){_0xf95e3=_0xc2edf9['custom'];}})[_0x3256('0x1e')](function(){return db[_0x3256('0x3c')]['find'](_0x21a82d);})['then'](handleEntityNotFound(_0x1894b3,null))[_0x3256('0x1e')](function(_0x139f7a){if(_0x139f7a){if(!_[_0x3256('0x76')](_0x139f7a[_0x3256('0x6c')])){if(fs[_0x3256('0x77')](path[_0x3256('0x74')](config[_0x3256('0x78')],_0x3256('0x79'),_0x139f7a[_0x3256('0x6c')]))&&_0xf95e3){_0x523e5d=path[_0x3256('0x74')](config['root'],'server/files/images/logos/',_0x139f7a[_0x3256('0x6c')]);}}return _0x1894b3[_0x3256('0x7a')](_0x523e5d);}})['catch'](handleError(_0x1894b3,null));};exports[_0x3256('0x7b')]=function(_0x5ab6cc,_0x16666d,_0x30634f){var _0xcbe899=path[_0x3256('0x74')](config[_0x3256('0x78')],_0x3256('0x7c'));var _0x2eedb1={'where':{'id':_0x5ab6cc[_0x3256('0x54')]['id']},'attributes':['id',_0x3256('0x6f')],'raw':!![]};return db['ChatWebsite'][_0x3256('0x58')](_0x2eedb1)[_0x3256('0x1e')](handleEntityNotFound(_0x16666d,null))[_0x3256('0x1e')](function(_0x93f517){if(_0x93f517){if(!_[_0x3256('0x76')](_0x93f517[_0x3256('0x6f')])){if(fs[_0x3256('0x77')](path['join'](config[_0x3256('0x78')],'server/files/images/avatars/',_0x93f517[_0x3256('0x6f')]))){_0xcbe899=path['join'](config[_0x3256('0x78')],'server/files/images/avatars/',_0x93f517[_0x3256('0x6f')]);}}return _0x16666d['download'](_0xcbe899);}})[_0x3256('0x52')](handleError(_0x16666d,null));};exports[_0x3256('0x7d')]=function(_0x248587,_0x4ef400,_0x39fe2f){var _0xb41c7b=path[_0x3256('0x74')](config[_0x3256('0x78')],_0x3256('0x7e'));var _0x160f78={'where':{'id':_0x248587[_0x3256('0x54')]['id']},'attributes':['id',_0x3256('0x71'),_0x3256('0x7f')],'raw':!![]};return db[_0x3256('0x3c')][_0x3256('0x58')](_0x160f78)[_0x3256('0x1e')](handleEntityNotFound(_0x4ef400,null))[_0x3256('0x1e')](function(_0x4c3c13){if(_0x4c3c13){if(!_[_0x3256('0x76')](_0x4c3c13[_0x3256('0x71')])){if(fs[_0x3256('0x77')](path['join'](config[_0x3256('0x78')],_0x3256('0x80'),_0x4c3c13[_0x3256('0x71')]))&&_0x4c3c13[_0x3256('0x7f')]){_0xb41c7b=path['join'](config[_0x3256('0x78')],_0x3256('0x80'),_0x4c3c13[_0x3256('0x71')]);}}return _0x4ef400[_0x3256('0x7a')](_0xb41c7b);}})[_0x3256('0x52')](handleError(_0x4ef400,null));};exports[_0x3256('0x81')]=function(_0x2077b7,_0x5e95ee,_0x372107){var _0x41cc31=path['join'](config[_0x3256('0x78')],_0x3256('0x82'));var _0x5b2b98={'where':{'id':_0x2077b7[_0x3256('0x54')]['id']},'attributes':['id',_0x3256('0x83')],'raw':!![]};return db[_0x3256('0x3c')][_0x3256('0x58')](_0x5b2b98)[_0x3256('0x1e')](handleEntityNotFound(_0x5e95ee,null))[_0x3256('0x1e')](function(_0x14b608){if(_0x14b608){if(!_[_0x3256('0x76')](_0x14b608[_0x3256('0x83')])){if(fs[_0x3256('0x77')](path[_0x3256('0x74')](config[_0x3256('0x78')],_0x3256('0x80'),_0x14b608[_0x3256('0x83')]))){_0x41cc31=path[_0x3256('0x74')](config[_0x3256('0x78')],_0x3256('0x80'),_0x14b608[_0x3256('0x83')]);}}return _0x5e95ee[_0x3256('0x7a')](_0x41cc31);}})['catch'](handleError(_0x5e95ee,null));};exports[_0x3256('0x84')]=function(_0x38db9d,_0x3b44e7,_0x58fe33){var _0x1942ab=require(_0x3256('0x85'));var _0x917c11=new _0x1942ab();var _0x47c9f9=_0x917c11[_0x3256('0x86')](_0x38db9d['headers'][_0x3256('0x87')])[_0x3256('0x88')]();var _0x1503ee={'body':_0x38db9d[_0x3256('0x5a')],'channel':_0x3256('0x89')};var _0x4676a3=[];var _0x2fa144=[];var _0x5f4f93={};var _0xd9a862=![];return db['CmContact']['describe']()[_0x3256('0x1e')](function(_0x307b1c){if(!_0x307b1c){throw new db[(_0x3256('0x8a'))][(_0x3256('0x8b'))](_0x3256('0x8c'));}_0x4676a3=_['difference'](_['keys'](_0x307b1c),[_0x3256('0x8d'),_0x3256('0x8e')]);_0x2fa144=_[_0x3256('0x8f')](_[_0x3256('0x56')](_0x307b1c),[_0x3256('0x8d'),_0x3256('0x8e'),_0x3256('0x90'),_0x3256('0x91')]);if(_0x38db9d['body']['id']){delete _0x38db9d[_0x3256('0x5a')]['id'];}if(_['isNil'](_0x38db9d['body'][_0x3256('0x92')])){throw new db[(_0x3256('0x8a'))]['ValidationError'](_0x3256('0x93'));}if(_['isNil'](_0x38db9d['body'][_0x3256('0x5a')])||_0x38db9d['body'][_0x3256('0x5a')]===''){throw new db[(_0x3256('0x8a'))][(_0x3256('0x8b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x3256('0x76')](_0x38db9d[_0x3256('0x5a')]['mapKey'])){throw new db['Sequelize'][(_0x3256('0x8b'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2fa144);}if(!_[_0x3256('0x94')](_0x2fa144,_0x38db9d[_0x3256('0x5a')]['mapKey'])){throw new db[(_0x3256('0x8a'))][(_0x3256('0x8b'))](_0x3256('0x95')+_0x2fa144);}_0x5f4f93[_0x38db9d[_0x3256('0x5a')][_0x3256('0x96')]]=_0x38db9d['body'][_0x3256('0x92')];})['then'](function(){return db['ChatWebsite']['find']({'where':{'id':_0x38db9d[_0x3256('0x54')]['id']},'include':[{'model':db[_0x3256('0x97')],'as':_0x3256('0x98'),'include':[{'model':db['CmContact'],'as':_0x3256('0x99'),'where':_0x5f4f93,'limit':0x1,'order':[[_0x3256('0x8e'),_0x3256('0x9a')]]}]},{'model':db['ChatApplication'],'as':_0x3256('0x9b')}]});})[_0x3256('0x1e')](handleEntityNotFound(_0x3b44e7,null))[_0x3256('0x1e')](function(_0x1aa37f){if(_0x1aa37f&&_0x1aa37f['List']){_0x1503ee['account']=_0x1aa37f;_0x1503ee[_0x3256('0x9c')]=_0x1aa37f[_0x3256('0x9b')];_0x1503ee[_0x3256('0x9d')]=_0x1aa37f[_0x3256('0x98')];_0x1503ee[_0x3256('0x9c')]=_[_0x3256('0x9e')](_0x1503ee[_0x3256('0x9c')],['priority'],[_0x3256('0x9f')]);if(_0x1503ee[_0x3256('0xa0')][_0x3256('0x9b')]){delete _0x1503ee['account'][_0x3256('0x9b')];}if(_0x1503ee[_0x3256('0xa0')][_0x3256('0x98')]&&_0x1503ee['account'][_0x3256('0x98')][_0x3256('0x99')][_0x3256('0x47')]){return _0x1503ee[_0x3256('0xa0')][_0x3256('0x98')][_0x3256('0x99')][0x0];}var _0x1d0660=_[_0x3256('0xa1')](_0x38db9d['body'],{'firstName':_0x38db9d[_0x3256('0x5a')]['from'],'ListId':_0x1aa37f[_0x3256('0x91')]});_0x1d0660[_0x38db9d[_0x3256('0x5a')]['mapKey']]=_0x38db9d[_0x3256('0x5a')][_0x3256('0x92')];return db[_0x3256('0xa2')][_0x3256('0x59')](_0x1d0660,{'fields':_0x4676a3,'raw':!![]});}})[_0x3256('0x1e')](handleEntityNotFound(_0x3b44e7,null))['then'](function(_0x492050){_0x1503ee[_0x3256('0xa3')]=_0x492050;var _0x54cf13=_0x38db9d['body']['customerIp'];if(_0x38db9d[_0x3256('0xa4')][_0x3256('0xa5')]){_0x54cf13=_0x38db9d['headers']['cf-connecting-ip'];}else if(_0x38db9d[_0x3256('0xa4')][_0x3256('0xa6')]){_0x54cf13=_[_0x3256('0xa7')](_0x38db9d[_0x3256('0xa4')][_0x3256('0xa6')][_0x3256('0xa8')](','));}if(_0x492050){var _0x566c9c={'ContactId':_0x492050['id'],'ChatWebsiteId':_0x38db9d['params']['id'],'from':(_0x492050[_0x3256('0xa9')]||'')+'\x20'+(_0x492050[_0x3256('0xaa')]||''),'customerIp':_0x54cf13,'customerPort':_0x38db9d['headers']['x-real-port']?_0x38db9d[_0x3256('0xa4')][_0x3256('0xab')]:null,'referer':_0x38db9d[_0x3256('0x5a')][_0x3256('0xac')],'browserName':_0x47c9f9['browser'][_0x3256('0x38')]&&_0x47c9f9[_0x3256('0xad')][_0x3256('0xae')]?util[_0x3256('0xaf')](_0x3256('0xb0'),_0x47c9f9[_0x3256('0xad')][_0x3256('0x38')],_0x47c9f9[_0x3256('0xad')][_0x3256('0xae')]):_0x3256('0xb1'),'browserVersion':_0x47c9f9['browser']['version']||'unknown','osName':util[_0x3256('0xaf')](_0x3256('0xb0'),_0x47c9f9['os']['name'],_0x47c9f9['os'][_0x3256('0xae')]),'osVersion':_0x47c9f9['os'][_0x3256('0xae')],'deviceModel':_0x47c9f9[_0x3256('0xb2')][_0x3256('0x43')]&&_0x47c9f9[_0x3256('0xb2')]['vendor']?util[_0x3256('0xaf')](_0x3256('0xb3'),_0x47c9f9[_0x3256('0xb2')]['model'],_0x47c9f9[_0x3256('0xb2')]['vendor'],_0x47c9f9[_0x3256('0xb2')][_0x3256('0x3f')]):null,'deviceVendor':_0x47c9f9[_0x3256('0xb2')][_0x3256('0xb4')],'deviceType':_0x47c9f9[_0x3256('0xb2')][_0x3256('0x3f')],'formData':JSON[_0x3256('0x23')](_0x38db9d[_0x3256('0x5a')])};var _0x3ad65a={'ChatWebsiteId':_0x38db9d[_0x3256('0x54')]['id'],'closed':![]};if(_0x38db9d[_0x3256('0x5a')][_0x3256('0xb5')]){_0x3ad65a[_0x3256('0xb5')]=_0x38db9d['body']['threadId'];return db['ChatInteraction']['find']({'where':_0x3ad65a})['then'](function(_0x591f5c){if(_0x591f5c){return[_0x591f5c,![]];}_0x566c9c[_0x3256('0xb5')]=_0x38db9d[_0x3256('0x5a')][_0x3256('0xb5')];_0x566c9c[_0x3256('0xb6')]=_0x38db9d[_0x3256('0x5a')][_0x3256('0xb6')];return db[_0x3256('0xb7')][_0x3256('0x59')](_0x566c9c)[_0x3256('0x1e')](function(_0x3b55f6){return[_0x3b55f6,!![]];});});}_0x3ad65a['ContactId']=_0x492050['id'];if(_0x38db9d[_0x3256('0x5a')][_0x3256('0xb8')]&&_0x38db9d[_0x3256('0x5a')][_0x3256('0xb8')]['id']){_0x3ad65a['id']=_0x38db9d['body'][_0x3256('0xb8')]['id'];return db[_0x3256('0xb7')]['find']({'where':_0x3ad65a})['then'](function(_0x68048b){if(_0x68048b){return[_0x68048b,![]];}return db[_0x3256('0xb7')][_0x3256('0x59')](_0x566c9c)[_0x3256('0x1e')](function(_0x29c4e5){return[_0x29c4e5,!![]];});});}return db[_0x3256('0xb7')][_0x3256('0x59')](_0x566c9c)[_0x3256('0x1e')](function(_0x25e7fd){return[_0x25e7fd,!![]];});}})[_0x3256('0xb9')](function(_0x415e17,_0x17210f){if(_0x415e17){_0xd9a862=_0x17210f;if(!_0x17210f){var _0x43bafb={'from':(_0x1503ee[_0x3256('0xa3')][_0x3256('0xa9')]||'')+'\x20'+(_0x1503ee[_0x3256('0xa3')][_0x3256('0xaa')]||'')};if(_0x38db9d[_0x3256('0x5a')][_0x3256('0xb5')]&&_0x38db9d['body'][_0x3256('0xba')]&&_0x38db9d[_0x3256('0x5a')][_0x3256('0xb5')]!=_0x38db9d[_0x3256('0x5a')][_0x3256('0xba')]){_0x43bafb[_0x3256('0xb5')]=_0x38db9d[_0x3256('0x5a')][_0x3256('0xba')];}return _0x415e17[_0x3256('0x33')](_0x43bafb);}else{return _0x415e17;}}})[_0x3256('0x1e')](function(_0x1a504e){_0x1503ee[_0x3256('0xb8')]=_0x1a504e[_0x3256('0x5c')]({'plain':!![]});_0x1503ee['interaction'][_0x3256('0xbb')]=_0xd9a862;if(_0x1503ee['interaction']['created']){if(_0x1503ee[_0x3256('0xa0')][_0x3256('0xbc')]){_0x1503ee[_0x3256('0x9c')][_0x3256('0xbd')]({'id':0x0,'priority':_0x1503ee[_0x3256('0x9c')][_0x3256('0x47')]+0x1,'app':_0x3256('0xbe'),'appdata':_0x3256('0xbf'),'interval':_0x3256('0xc0')});}}return db[_0x3256('0xc1')][_0x3256('0x59')]({'body':_0x38db9d[_0x3256('0x5a')]['body'],'ChatWebsiteId':_0x38db9d[_0x3256('0x54')]['id'],'ChatInteractionId':_0x1a504e['id'],'direction':'in','ContactId':_0x1503ee[_0x3256('0xa3')]['id'],'AttachmentId':_0x38db9d[_0x3256('0x5a')][_0x3256('0xc2')]});})['then'](function(_0x1e61ee){_0x1503ee[_0x3256('0x26')]=_0x1e61ee;if(_0x1503ee[_0x3256('0xb8')][_0x3256('0xc3')]){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x1503ee[_0x3256('0xb8')][_0x3256('0xc3')]}})['then'](function(_0x1a545d){if(_0x1a545d){_0x1503ee[_0x3256('0x9c')][_0x3256('0xc4')]({'id':0x0,'priority':0x0,'app':_0x3256('0xc5'),'appdata':_0x1a545d[_0x3256('0x38')]+','+(_0x1503ee[_0x3256('0xa0')][_0x3256('0xc6')]||0xa),'interval':'*,*,*,*'});_0x1503ee[_0x3256('0xc7')]=!![];}return respondWithRpcPromise(_0x3256('0xc8'),'startRouting',_0x1503ee);});}return respondWithRpcPromise(_0x3256('0xc8'),_0x3256('0xc9'),_0x1503ee);})[_0x3256('0x1e')](function(_0x8f1ea9){respondWithRpcPromise(_0x3256('0xca'),_0x3256('0xca'),{'event':_0x3256('0x84'),'message':_0x8f1ea9},client9002);return _0x8f1ea9;})['then'](respondWithResult(_0x3b44e7,null))['catch'](handleError(_0x3b44e7,null));};exports[_0x3256('0xcb')]=function(_0x5a6f32,_0x4eee1e,_0x381919){var _0x10cbf2,_0x233fc8,_0x459ff0;var _0x46fa79=[];var _0x154ad6=[];var _0xaed7db={};var _0x4d880f=_0x5a6f32[_0x3256('0xcc')]||[];var _0x663949=[];var _0x470eda;return db[_0x3256('0xa2')][_0x3256('0x60')]()[_0x3256('0x1e')](function(_0x1fd0a2){if(!_0x1fd0a2){throw new db[(_0x3256('0x8a'))][(_0x3256('0x8b'))](_0x3256('0x8c'));}_0x154ad6=_[_0x3256('0x8f')](_[_0x3256('0x56')](_0x1fd0a2),['createdAt',_0x3256('0x8e')]);_0x46fa79=_[_0x3256('0x8f')](_[_0x3256('0x56')](_0x1fd0a2),[_0x3256('0x8d'),_0x3256('0x8e'),'CompanyId',_0x3256('0x91')]);if(_0x5a6f32[_0x3256('0x5a')]['id']){delete _0x5a6f32[_0x3256('0x5a')]['id'];}if(_[_0x3256('0x76')](_0x5a6f32[_0x3256('0x5a')]['from'])){throw _0x4eee1e[_0x3256('0x29')](0x1f4)[_0x3256('0x39')](new db['Sequelize']['ValidationError'](_0x3256('0x93')));}if(_[_0x3256('0x76')](_0x5a6f32[_0x3256('0x5a')][_0x3256('0x5a')])||_0x5a6f32['body'][_0x3256('0x5a')]===''){throw _0x4eee1e['status'](0x1f4)[_0x3256('0x39')](new db['Sequelize'][(_0x3256('0x8b'))](_0x3256('0xcd')));}if(_['isNil'](_0x5a6f32[_0x3256('0x5a')][_0x3256('0xce')])){throw _0x4eee1e[_0x3256('0x29')](0x1f4)[_0x3256('0x39')](new db['Sequelize']['ValidationError'](_0x3256('0xcf')+_0x46fa79));}if(!_[_0x3256('0x94')](_0x46fa79,_0x5a6f32[_0x3256('0x5a')][_0x3256('0xce')])){throw _0x4eee1e[_0x3256('0x29')](0x1f4)[_0x3256('0x39')](new db[(_0x3256('0x8a'))]['ValidationError'](_0x3256('0xd0')+_0x46fa79));}_0xaed7db[_0x5a6f32[_0x3256('0x5a')][_0x3256('0xce')]]=_0x5a6f32[_0x3256('0x5a')][_0x3256('0x92')];})[_0x3256('0x1e')](function(){return db[_0x3256('0x3c')][_0x3256('0x58')]({'where':{'id':_0x5a6f32[_0x3256('0x54')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0x3256('0xd1')],'as':_0x3256('0xd1')}]});})[_0x3256('0x1e')](handleEntityNotFound(_0x4eee1e,null))[_0x3256('0x1e')](function(_0x215ca5){if(_0x215ca5&&_0x215ca5['List']){_0x233fc8=_0x215ca5;var _0x73d64a=_[_0x3256('0xa1')](_0x5a6f32[_0x3256('0x5a')],{'firstName':_0x5a6f32[_0x3256('0x5a')][_0x3256('0x92')],'phone':_0x5a6f32[_0x3256('0x5a')][_0x3256('0x92')],'ListId':_0x215ca5['ListId']});_0x73d64a[_0x5a6f32['body'][_0x3256('0xce')]]=_0x5a6f32[_0x3256('0x5a')][_0x3256('0x92')];return db[_0x3256('0xa2')][_0x3256('0xd2')]({'where':_0xaed7db,'defaults':_0x73d64a});}})['spread'](function(_0x573cd9){if(_0x573cd9){_0x459ff0=_0x573cd9;var _0x598721=fs[_0x3256('0xd3')](path[_0x3256('0x74')](config['root'],_0x3256('0xd4')),_0x3256('0xd5'));var _0x20b4b7=ejs[_0x3256('0xd6')](_0x598721,{'body':_[_0x3256('0xd7')](_0x5a6f32[_0x3256('0x5a')][_0x3256('0x5a')]),'bodyTitle':_0x233fc8[_0x3256('0xd8')]});return db[_0x3256('0xd9')][_0x3256('0x59')]({'body':_0x20b4b7,'ContactId':_0x573cd9['id'],'ChatWebsiteId':_0x233fc8['id']});}})['then'](function(_0x2a2d13){_0x470eda=_0x2a2d13;if(_0x4d880f[_0x3256('0x47')]){var _0x5f50bd=_0x4d880f['map'](function(_0x42508f){return{'name':_0x42508f[_0x3256('0xda')],'basename':_0x42508f['filename'],'type':_0x42508f[_0x3256('0xdb')],'ChatOfflineMessageId':_0x2a2d13['id']};});_0x663949=_0x5f50bd[_0x3256('0x3b')](_0x4edf95=>{var _0x479a03={'filename':_0x4edf95[_0x3256('0x38')],'path':path['join'](config[_0x3256('0x78')],_0x3256('0xdc'),_0x3256('0xcc'),_0x3256('0xdd'),_0x3256('0xde'),_0x4edf95[_0x3256('0xdf')])};return _0x479a03;});if(!_0x233fc8[_0x3256('0xe0')]){return db[_0x3256('0xe1')]['transaction'](function(_0x4eb54a){return db[_0x3256('0xe2')][_0x3256('0xe3')](_0x5f50bd,{'transaction':_0x4eb54a});});}}})['then'](function(){if(_0x470eda){_0x10cbf2=_0x470eda;return db[_0x3256('0xd1')][_0x3256('0x64')]({'where':{'active':!![]},'include':[{'model':db[_0x3256('0xe4')],'as':_0x3256('0xe5'),'raw':!![]}]});}})[_0x3256('0x1e')](function(_0x4d574e){if(_0x4d574e&&_0x4d574e['Smtp']&&_0x233fc8[_0x3256('0xe6')]&&_0x233fc8[_0x3256('0xe7')]){var _0x500ce1={'tls':{'rejectUnauthorized':![]}};if(_0x4d574e[_0x3256('0xe5')][_0x3256('0xe8')]){_0x500ce1[_0x3256('0xe8')]=_0x4d574e[_0x3256('0xe5')][_0x3256('0xe8')];}else{_0x500ce1[_0x3256('0xe9')]=_0x4d574e[_0x3256('0xe5')]['host'];_0x500ce1[_0x3256('0xea')]=_0x4d574e[_0x3256('0xe5')][_0x3256('0xea')];_0x500ce1[_0x3256('0xeb')]=_0x4d574e['Smtp'][_0x3256('0xeb')];}if(_0x4d574e[_0x3256('0xe5')]['authentication']){_0x500ce1[_0x3256('0xec')]={'user':_0x4d574e[_0x3256('0xe5')][_0x3256('0x5b')],'pass':_0x4d574e[_0x3256('0xe5')]['pass']};}return respondWithRpcPromise('SendMail',_0x3256('0xed'),{'account':_0x500ce1,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x4d574e[_0x3256('0x38')],_0x4d574e[_0x3256('0xee')]||_0x4d574e['Smtp'][_0x3256('0x5b')]),'to':_0x233fc8['forwardOfflineAddress'],'subject':_0x233fc8[_0x3256('0xef')],'html':_0x10cbf2[_0x3256('0x5a')],'attachments':_0x663949}},client9003)[_0x3256('0x1e')](function(){return _0x10cbf2;})['catch'](function(_0x7351e3){console[_0x3256('0x24')](_0x7351e3);});}})['then'](function(){if(_0x233fc8&&_0x233fc8[_0x3256('0xe0')]&&_0x233fc8['MailAccountId']){var _0x1c8065=[];if(_0x4d880f[_0x3256('0x47')]){_0x1c8065=_0x4d880f[_0x3256('0x3b')](function(_0x33f8c1){return{'name':_0x33f8c1[_0x3256('0xda')],'basename':_0x33f8c1[_0x3256('0x6e')],'type':_0x33f8c1[_0x3256('0xdb')],'ChatOfflineMessageId':_0x470eda['id']};});}var _0x2f3198;if(!_[_0x3256('0x76')](_0x233fc8[_0x3256('0xf0')])){var _0x4bc83c=_[_0x3256('0x3b')](_0x5a6f32[_0x3256('0x5a')],function(_0x4d88d7){return _0x4d88d7;});var _0x1bb59b=_['toPairsIn'](_0x4bc83c)[0x0];var _0x20f530=_['mapValues'](_0x1bb59b,function(_0x256d78){return _0x256d78;});_0x2f3198=_0x20f530[0x1][_0x233fc8[_0x3256('0xf0')]];}var _0x53dcdc={'from':_0x459ff0[_0x3256('0xee')],'firstName':_0x459ff0[_0x3256('0xa9')],'lastName':_0x459ff0[_0x3256('0xaa')],'mapKey':'email','message':{'from':_0x459ff0['email'],'to':_0x233fc8[_0x3256('0xd1')][_0x3256('0xee')],'cc':'','subject':_[_0x3256('0x76')](_0x2f3198)?_0x233fc8[_0x3256('0xef')]:_0x2f3198,'messageId':'','sentAt':new Date(),'attach':_0x1c8065[_0x3256('0x47')],'attachments':_0x1c8065,'originChannel':_0x3256('0xf1'),'ChatWebsiteId':_0x233fc8['id'],'ChatOfflineMessageId':_0x10cbf2['id'],'originTo':_0x233fc8['MailAccount'][_0x3256('0xee')]},'body':_0x10cbf2[_0x3256('0x5a')]};var _0x50df33={'account':{'id':_0x233fc8[_0x3256('0xf2')]},'body':_0x53dcdc,'log':_0x3256('0xf3')};return respondWithRpcPromise(_0x3256('0xf3'),_0x3256('0xf4'),_0x50df33,client9001)[_0x3256('0x1e')](function(){return _0x10cbf2;})[_0x3256('0x52')](function(_0x5edb86){console[_0x3256('0x24')](_0x5edb86);});}return;})['then'](function(){if(_0x10cbf2){return _0x10cbf2;}})[_0x3256('0x1e')](respondWithResult(_0x4eee1e,null))['catch'](function(_0x36ba02){console[_0x3256('0x24')](_0x3256('0x52'),_0x36ba02);for(var _0x479862 of _0x4d880f){var _0x48651d=path['join'](config[_0x3256('0x78')],'server',_0x3256('0xcc'),'attachments',_0x3256('0xde'),_0x479862[_0x3256('0x6e')]);fs_extra[_0x3256('0xf5')](_0x48651d)[_0x3256('0x52')](function(_0x236d64){console[_0x3256('0x24')]('Could\x20not\x20remove\x20attachment\x20file',_0x48651d,_0x236d64);});}});};exports['addInteraction']=function(_0x4360b5,_0x229858,_0x3468ad){return db['ChatInteraction'][_0x3256('0x58')]({'where':{'id':_0x4360b5['params']['id']}})['then'](handleEntityNotFound(_0x229858,null))['then'](function(_0x399a81){if(_0x399a81){return _0x399a81[_0x3256('0xf6')](_0x4360b5['body'][_0x3256('0x68')],_[_0x3256('0xf7')](_0x4360b5['body'],[_0x3256('0x68'),'id'])||{});}})[_0x3256('0x1e')](respondWithResult(_0x229858,null))[_0x3256('0x52')](handleError(_0x229858,null));};exports[_0x3256('0xf8')]=function(_0x450719,_0x15b088,_0xaf5f56){var _0x269118={'raw':![],'where':{}};var _0x5007ba={};var _0x4d84b9={'count':0x0,'rows':[]};return db[_0x3256('0x3c')][_0x3256('0x64')]({'where':{'id':_0x450719[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x15b088,null))[_0x3256('0x1e')](function(_0x5d343e){if(_0x5d343e){_0x5007ba['model']=_[_0x3256('0x56')](db[_0x3256('0xb7')][_0x3256('0x3d')]);_0x5007ba['query']=_[_0x3256('0x56')](_0x450719['query']);_0x5007ba[_0x3256('0x42')]=_[_0x3256('0x45')](_0x5007ba['model'],_0x5007ba[_0x3256('0x41')]);_0x269118[_0x3256('0x44')]=_['intersection'](_0x5007ba[_0x3256('0x43')],qs['fields'](_0x450719['query']['fields']));_0x269118['attributes']=_0x269118[_0x3256('0x44')][_0x3256('0x47')]?_0x269118[_0x3256('0x44')]:_0x5007ba[_0x3256('0x43')];if(!_0x450719['query']['hasOwnProperty'](_0x3256('0x49'))){_0x269118['limit']=qs[_0x3256('0x2d')](_0x450719[_0x3256('0x41')][_0x3256('0x2d')]);_0x269118[_0x3256('0x2f')]=qs['offset'](_0x450719[_0x3256('0x41')][_0x3256('0x2f')]);}_0x269118['order']=qs[_0x3256('0x4a')](_0x450719[_0x3256('0x41')][_0x3256('0x4a')]);_0x269118['where']=qs[_0x3256('0x42')](_[_0x3256('0x4c')](_0x450719[_0x3256('0x41')],_0x5007ba[_0x3256('0x42')]));_0x269118[_0x3256('0x4b')][_0x3256('0x61')]=_0x5d343e['id'];if(_0x450719[_0x3256('0x41')]['filter']){_0x269118[_0x3256('0x4b')]=_[_0x3256('0x4d')](_0x269118[_0x3256('0x4b')],{'$or':_[_0x3256('0x3b')](_0x269118[_0x3256('0x44')],function(_0x18aefa){var _0x3ed588={};_0x3ed588[_0x18aefa]={'$like':'%'+_0x450719[_0x3256('0x41')][_0x3256('0x4e')]+'%'};return _0x3ed588;})});}_0x269118=_[_0x3256('0x4d')]({},_0x269118,_0x450719[_0x3256('0x66')]);return db[_0x3256('0xb7')][_0x3256('0x2e')]({'where':_0x269118[_0x3256('0x4b')]})['then'](function(_0x57f8fb){_0x4d84b9[_0x3256('0x2e')]=_0x57f8fb;if(_0x450719['query'][_0x3256('0x57')]){_0x269118[_0x3256('0x4f')]=[{'model':db[_0x3256('0xa2')],'as':_0x3256('0xf9'),'required':![]},{'model':db[_0x3256('0xfa')],'as':_0x3256('0xfb'),'attributes':['name',_0x3256('0xfc'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x3256('0xfd'),'attributes':['id',_0x3256('0x38'),_0x3256('0xfe')],'where':_0x450719[_0x3256('0x41')]['tag']?{'id':_0x450719[_0x3256('0x41')]['tag']}:undefined,'required':_0x450719['query'][_0x3256('0xff')]?!![]:![]}];}return db['ChatInteraction'][_0x3256('0x50')](_0x269118);})[_0x3256('0x1e')](function(_0x4d6fe6){_0x4d84b9[_0x3256('0x51')]=_0x4d6fe6;return _0x4d84b9;});}})[_0x3256('0x1e')](respondWithFilteredResult(_0x15b088,_0x269118))[_0x3256('0x52')](handleError(_0x15b088,null));};function iftimePromise(_0x24f00f,_0x352aa9){return respondWithRpcPromise(_0x3256('0x100'),_0x3256('0x101'),{'command':_0x352aa9[_0x3256('0x102')]?util[_0x3256('0xaf')](_0x3256('0x103'),_0x24f00f['interval'],_0x352aa9[_0x3256('0x102')]):util[_0x3256('0xaf')](_0x3256('0x104'),_0x24f00f[_0x3256('0x105')])},client9002)[_0x3256('0x1e')](function(_0xcbfe47){var _0x44f49d=_0xcbfe47&&_0xcbfe47['indexOf']('true')>=0x0?!![]:![];logger[_0x3256('0x1f')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x352aa9['id'],_0x24f00f['id'],_0x24f00f[_0x3256('0x105')],_0x44f49d?_0x3256('0x106'):_0x3256('0x107'),_0x352aa9[_0x3256('0x102')]?_0x352aa9[_0x3256('0x102')]:_0x3256('0x108'));return _0x44f49d;})[_0x3256('0x52')](function(_0x14149c){logger[_0x3256('0x24')](_0x3256('0x109'),_0x352aa9['id'],_0x24f00f['id'],_0x24f00f[_0x3256('0x105')],util[_0x3256('0x10a')](_0x14149c,{'showHidden':![],'depth':null}),_0x352aa9['timezone']?_0x352aa9[_0x3256('0x102')]:'No\x20timezone');return![];});}exports['getSnippet']=function(_0x5ba3ad,_0x422bc4,_0x10d4a7){var _0x3567fe=0x0;var _0x3b4d7f=0x0;var _0x11e641=![];var _0xc9a6fe;var _0x2506cf;return db[_0x3256('0x3c')]['find']({'where':{'id':_0x5ba3ad[_0x3256('0x54')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x3256('0x10b')],'as':_0x3256('0x10c'),'attributes':['id',_0x3256('0x105')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x422bc4,null))[_0x3256('0x1e')](function(_0x3a01f4){if(_0x3a01f4){_0xc9a6fe=_0x3a01f4;return _0x3a01f4[_0x3256('0x10d')]({'raw':!![]});}})['then'](function(_0x38c9a1){if(_0xc9a6fe){if(_0x38c9a1){_0x2506cf=_0x38c9a1;}}return require(_0x3256('0x16'))[_0x3256('0x10e')]();})[_0x3256('0x1e')](function(_0x476bed){if(_0x476bed){_0x3b4d7f=_0x476bed['virtual'];_0x11e641=_0x476bed[_0x3256('0x10f')];}})['then'](function(){return db[_0x3256('0xb7')][_0x3256('0x2e')]({'where':{'closed':![]}});})[_0x3256('0x1e')](function(_0x4e35fa){_0x3567fe=_0x4e35fa;if(_0x3b4d7f&&_0x4e35fa>_0x3b4d7f){return db[_0x3256('0x110')][_0x3256('0x64')]({'where':{'id':0x1}})[_0x3256('0x1e')](function(_0x4e72c2){if(_0x4e72c2){_0x4e72c2['increment']('chatLicenseExceeded');}});}})[_0x3256('0x1e')](function(){if(_0xc9a6fe['Interval']&&_0xc9a6fe['Interval'][_0x3256('0x10c')]){var _0x455e6c=[];for(var _0x58660a=0x0;_0x58660a<_0xc9a6fe[_0x3256('0x10b')][_0x3256('0x10c')][_0x3256('0x47')];_0x58660a++){var _0x48206c=_0xc9a6fe['Interval']['Intervals'][_0x58660a][_0x3256('0x5c')]({'plain':!![]});_0x455e6c['push'](iftimePromise(_0x48206c,_0xc9a6fe));}return BPromise[_0x3256('0x111')](_0x455e6c)[_0x3256('0x1e')](function(_0x511ed5){return _[_0x3256('0x112')](_0x511ed5);});}else{return!![];}})['then'](function(_0x2e4121){var _0x291151=fs[_0x3256('0xd3')](path[_0x3256('0x74')](config[_0x3256('0x78')],_0x3256('0x113')),_0x3256('0xd5'));var _0x2149a1={'remote':_0xc9a6fe[_0x3256('0x114')],'query':querystring[_0x3256('0x23')](_['merge'](_0xc9a6fe[_0x3256('0x5c')]({'plain':!![]}),{'customerIp':_0x5ba3ad[_0x3256('0xa4')][_0x3256('0xa6')]||_0x5ba3ad[_0x3256('0xa4')][_0x3256('0x115')]||_0x5ba3ad[_0x3256('0x116')][_0x3256('0x117')]||_0x5ba3ad['ip'],'referer':_0x5ba3ad['headers'][_0x3256('0xac')],'openedInteractions':_0x3567fe,'maxInteractions':_0x3b4d7f,'virtual':_0x11e641[_0x3256('0x118')],'online':_0x2e4121,'custom':_0x11e641}))[_0x3256('0x119')](/'/g,'\x5c\x27')};_0x422bc4['send'](ejs[_0x3256('0xd6')](Mustache['render'](_0x291151,_0x2149a1),{'proactiveActions':_0x2506cf,'alignment':_0xc9a6fe[_0x3256('0x11a')],'verticalAlignment':_0xc9a6fe[_0x3256('0x11b')],'div_color':_0xc9a6fe['color'],'text_color':_0xc9a6fe['textColor'],'button_color':_0xc9a6fe[_0x3256('0x11c')],'background_color':_0xc9a6fe['backgroundColor']}));})[_0x3256('0x52')](handleError(_0x422bc4,null));};exports['addApplications']=function(_0x342e26,_0x4c5e64,_0x1bc136){return db['ChatWebsite'][_0x3256('0x64')]({'where':{'id':_0x342e26['params']['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x4c5e64,null))['then'](function(_0x2e24a5){if(_0x2e24a5){return db['sequelize'][_0x3256('0x11d')](function(_0x1e4efb){return db[_0x3256('0x11e')][_0x3256('0x34')]({'where':{'ChatWebsiteId':_0x342e26[_0x3256('0x54')]['id']},'transaction':_0x1e4efb})[_0x3256('0x1e')](function(_0x446ba5){var _0x257b3f=_[_0x3256('0x3b')](_0x342e26['body'],function(_0x561d3d){_0x561d3d['ChatWebsiteId']=_0x342e26[_0x3256('0x54')]['id'];return _0x561d3d;});return db[_0x3256('0x11e')][_0x3256('0xe3')](_0x257b3f,{'transaction':_0x1e4efb});});})[_0x3256('0x1e')](function(){return db['ChatApplication'][_0x3256('0x11f')]({'where':{'ChatWebsiteId':_0x342e26[_0x3256('0x54')]['id']},'order':'priority'});});}})[_0x3256('0x1e')](respondWithResult(_0x4c5e64,null))['catch'](handleError(_0x4c5e64,null));};exports[_0x3256('0x120')]=function(_0x7ecf31,_0x3ffd9b,_0x2cbcff){var _0x3dc0d3={};var _0x58a681={};var _0x37a5e9;var _0x3870fe;return db[_0x3256('0x3c')][_0x3256('0x64')]({'where':{'id':_0x7ecf31[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x3ffd9b,null))[_0x3256('0x1e')](function(_0x37f02d){if(_0x37f02d){_0x37a5e9=_0x37f02d;_0x58a681[_0x3256('0x43')]=_[_0x3256('0x56')](db[_0x3256('0x11e')][_0x3256('0x3d')]);_0x58a681[_0x3256('0x41')]=_[_0x3256('0x56')](_0x7ecf31[_0x3256('0x41')]);_0x58a681[_0x3256('0x42')]=_[_0x3256('0x45')](_0x58a681[_0x3256('0x43')],_0x58a681['query']);_0x3dc0d3[_0x3256('0x44')]=_[_0x3256('0x45')](_0x58a681[_0x3256('0x43')],qs['fields'](_0x7ecf31[_0x3256('0x41')][_0x3256('0x46')]));_0x3dc0d3[_0x3256('0x44')]=_0x3dc0d3[_0x3256('0x44')][_0x3256('0x47')]?_0x3dc0d3['attributes']:_0x58a681[_0x3256('0x43')];_0x3dc0d3[_0x3256('0x65')]=qs[_0x3256('0x4a')](_0x7ecf31[_0x3256('0x41')][_0x3256('0x4a')]);_0x3dc0d3[_0x3256('0x4b')]=qs[_0x3256('0x42')](_[_0x3256('0x4c')](_0x7ecf31[_0x3256('0x41')],_0x58a681[_0x3256('0x42')]));if(_0x7ecf31[_0x3256('0x41')][_0x3256('0x4e')]){_0x3dc0d3[_0x3256('0x4b')]=_[_0x3256('0x4d')](_0x3dc0d3[_0x3256('0x4b')],{'$or':_[_0x3256('0x3b')](_0x3dc0d3['attributes'],function(_0x4d0f3d){var _0x3f1472={};_0x3f1472[_0x4d0f3d]={'$like':'%'+_0x7ecf31['query'][_0x3256('0x4e')]+'%'};return _0x3f1472;})});}_0x3dc0d3=_[_0x3256('0x4d')]({},_0x3dc0d3,_0x7ecf31['options']);return _0x37a5e9[_0x3256('0x120')](_0x3dc0d3);}})[_0x3256('0x1e')](function(_0x472bf9){if(_0x472bf9){_0x3870fe=_0x472bf9[_0x3256('0x47')];if(!_0x7ecf31[_0x3256('0x41')][_0x3256('0x48')]('nolimit')){_0x3dc0d3['limit']=qs[_0x3256('0x2d')](_0x7ecf31[_0x3256('0x41')][_0x3256('0x2d')]);_0x3dc0d3[_0x3256('0x2f')]=qs[_0x3256('0x2f')](_0x7ecf31[_0x3256('0x41')]['offset']);}return _0x37a5e9[_0x3256('0x120')](_0x3dc0d3);}})[_0x3256('0x1e')](function(_0x3afa09){if(_0x3afa09){return _0x3afa09?{'count':_0x3870fe,'rows':_0x3afa09}:null;}})['then'](respondWithResult(_0x3ffd9b,null))[_0x3256('0x52')](handleError(_0x3ffd9b,null));};exports[_0x3256('0x121')]=function(_0x43b2d7,_0x5632d2,_0xf3397d){return db['chatProactiveAction'][_0x3256('0x58')]({'where':{'id':_0x43b2d7[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x5632d2,null))['then'](function(_0x50ed67){if(_0x50ed67){return _0x50ed67[_0x3256('0x121')](_0x43b2d7[_0x3256('0x5a')][_0x3256('0x68')],_[_0x3256('0xf7')](_0x43b2d7[_0x3256('0x5a')],['ids','id'])||{});}})[_0x3256('0x1e')](respondWithResult(_0x5632d2,null))[_0x3256('0x52')](handleError(_0x5632d2,null));};exports[_0x3256('0x10d')]=function(_0x490ae7,_0x2db02d,_0x385fc4){var _0x5e75df={};var _0x3397e6={};var _0x4e8ab2;var _0x2ecacd;return db[_0x3256('0x3c')][_0x3256('0x64')]({'where':{'id':_0x490ae7[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x2db02d,null))[_0x3256('0x1e')](function(_0x55ef80){if(_0x55ef80){_0x4e8ab2=_0x55ef80;_0x3397e6[_0x3256('0x43')]=_['keys'](db[_0x3256('0x122')]['rawAttributes']);_0x3397e6[_0x3256('0x41')]=_[_0x3256('0x56')](_0x490ae7[_0x3256('0x41')]);_0x3397e6[_0x3256('0x42')]=_[_0x3256('0x45')](_0x3397e6['model'],_0x3397e6['query']);_0x5e75df[_0x3256('0x44')]=_[_0x3256('0x45')](_0x3397e6[_0x3256('0x43')],qs[_0x3256('0x46')](_0x490ae7[_0x3256('0x41')][_0x3256('0x46')]));_0x5e75df['attributes']=_0x5e75df[_0x3256('0x44')][_0x3256('0x47')]?_0x5e75df['attributes']:_0x3397e6[_0x3256('0x43')];_0x5e75df['order']=qs[_0x3256('0x4a')](_0x490ae7[_0x3256('0x41')][_0x3256('0x4a')]);_0x5e75df[_0x3256('0x4b')]=qs[_0x3256('0x42')](_[_0x3256('0x4c')](_0x490ae7['query'],_0x3397e6[_0x3256('0x42')]));if(_0x490ae7[_0x3256('0x41')][_0x3256('0x4e')]){_0x5e75df[_0x3256('0x4b')]=_['merge'](_0x5e75df[_0x3256('0x4b')],{'$or':_[_0x3256('0x3b')](_0x5e75df[_0x3256('0x44')],function(_0x365c36){var _0x26364e={};_0x26364e[_0x365c36]={'$like':'%'+_0x490ae7['query']['filter']+'%'};return _0x26364e;})});}_0x5e75df=_[_0x3256('0x4d')]({},_0x5e75df,_0x490ae7['options']);return _0x4e8ab2[_0x3256('0x10d')](_0x5e75df);}})['then'](function(_0x442449){if(_0x442449){_0x2ecacd=_0x442449[_0x3256('0x47')];if(!_0x490ae7[_0x3256('0x41')][_0x3256('0x48')](_0x3256('0x49'))){_0x5e75df[_0x3256('0x2d')]=qs['limit'](_0x490ae7[_0x3256('0x41')][_0x3256('0x2d')]);_0x5e75df[_0x3256('0x2f')]=qs[_0x3256('0x2f')](_0x490ae7[_0x3256('0x41')][_0x3256('0x2f')]);}return _0x4e8ab2['getProactiveActions'](_0x5e75df);}})[_0x3256('0x1e')](function(_0x5dab2b){if(_0x5dab2b){return _0x5dab2b?{'count':_0x2ecacd,'rows':_0x5dab2b}:null;}})['then'](respondWithResult(_0x2db02d,null))[_0x3256('0x52')](handleError(_0x2db02d,null));};exports[_0x3256('0x123')]=function(_0x206956,_0x5e5886,_0x5e1cca){var _0x144483=_0x206956['query'][_0x3256('0x124')]==='false'?_0x3256('0x125'):_0x3256('0x126');return db['ChatWebsite'][_0x3256('0x58')]({'attributes':['id',_0x144483],'where':{'id':_0x206956[_0x3256('0x54')]['id']}})['then'](handleEntityNotFound(_0x5e5886,null))[_0x3256('0x1e')](function(_0x8bdae4){if(_0x8bdae4){var _0x151b37=_0x8bdae4[_0x144483];var _0x4e4d0c=_0x151b37&&_0x151b37[_0x3256('0x127')]?_0x151b37[_0x3256('0x127')]:[];_0x5e5886['send']({'fromKey':_[_0x3256('0x76')](_0x151b37[_0x3256('0x128')])?undefined:_0x151b37[_0x3256('0x128')],'count':_0x4e4d0c[_0x3256('0x47')],'rows':_0x4e4d0c});}})[_0x3256('0x52')](handleError(_0x5e5886,null));};exports[_0x3256('0x129')]=function(_0x540e0c,_0x39d21c,_0x28f78c){var _0x1d2f44={'raw':![],'where':{}};var _0x51787c={};var _0x3aedce={'count':0x0,'rows':[]};return db[_0x3256('0x3c')][_0x3256('0x64')]({'where':{'id':_0x540e0c[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x39d21c,null))['then'](function(_0x43011f){if(_0x43011f){_0x51787c[_0x3256('0x43')]=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x51787c[_0x3256('0x41')]=_[_0x3256('0x56')](_0x540e0c[_0x3256('0x41')]);_0x51787c[_0x3256('0x42')]=_[_0x3256('0x45')](_0x51787c[_0x3256('0x43')],_0x51787c['query']);_0x1d2f44[_0x3256('0x44')]=_[_0x3256('0x45')](_0x51787c['model'],qs[_0x3256('0x46')](_0x540e0c[_0x3256('0x41')][_0x3256('0x46')]));_0x1d2f44[_0x3256('0x44')]=_0x1d2f44[_0x3256('0x44')][_0x3256('0x47')]?_0x1d2f44[_0x3256('0x44')]:_0x51787c[_0x3256('0x43')];if(!_0x540e0c[_0x3256('0x41')][_0x3256('0x48')](_0x3256('0x49'))){_0x1d2f44['limit']=qs[_0x3256('0x2d')](_0x540e0c[_0x3256('0x41')][_0x3256('0x2d')]);_0x1d2f44[_0x3256('0x2f')]=qs[_0x3256('0x2f')](_0x540e0c['query']['offset']);}_0x1d2f44[_0x3256('0x65')]=qs['sort'](_0x540e0c[_0x3256('0x41')][_0x3256('0x4a')]);_0x1d2f44[_0x3256('0x4b')]=qs[_0x3256('0x42')](_[_0x3256('0x4c')](_0x540e0c[_0x3256('0x41')],_0x51787c[_0x3256('0x42')]));_0x1d2f44[_0x3256('0x4b')]['ChatWebsiteId']=_0x43011f['id'];if(_0x540e0c[_0x3256('0x41')][_0x3256('0x4e')]){_0x1d2f44[_0x3256('0x4b')]=_[_0x3256('0x4d')](_0x1d2f44['where'],{'$or':_[_0x3256('0x3b')](_0x1d2f44[_0x3256('0x44')],function(_0x538960){var _0x3fc4d3={};_0x3fc4d3[_0x538960]={'$like':'%'+_0x540e0c[_0x3256('0x41')]['filter']+'%'};return _0x3fc4d3;})});}_0x1d2f44=_[_0x3256('0x4d')]({},_0x1d2f44,_0x540e0c[_0x3256('0x66')]);return db['ChatOfflineMessage'][_0x3256('0x2e')]({'where':_0x1d2f44['where']})['then'](function(_0x136421){_0x3aedce[_0x3256('0x2e')]=_0x136421;if(_0x540e0c[_0x3256('0x41')][_0x3256('0x57')]){_0x1d2f44[_0x3256('0x4f')]=[{'all':!![]}];}else{_0x1d2f44[_0x3256('0x4f')]=[{'model':db[_0x3256('0xa2')],'as':_0x3256('0xf9'),'required':![]},{'model':db[_0x3256('0xe2')],'as':_0x3256('0x12a'),'required':![]}];}return db[_0x3256('0xd9')][_0x3256('0x50')](_0x1d2f44);})[_0x3256('0x1e')](function(_0xa8cdef){_0x3aedce[_0x3256('0x51')]=_0xa8cdef;return _0x3aedce;});}})[_0x3256('0x1e')](respondWithFilteredResult(_0x39d21c,_0x1d2f44))[_0x3256('0x52')](handleError(_0x39d21c,null));};exports[_0x3256('0x12b')]=function(_0x5e6ce7,_0x554254,_0x100035){return db[_0x3256('0x3c')][_0x3256('0x58')]({'where':{'id':_0x5e6ce7[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x554254,null))[_0x3256('0x1e')](function(_0x3a72c4){if(_0x3a72c4){return _0x3a72c4[_0x3256('0x12b')](_0x5e6ce7[_0x3256('0x5a')][_0x3256('0x68')],_[_0x3256('0xf7')](_0x5e6ce7[_0x3256('0x5a')],[_0x3256('0x68'),'id'])||{})[_0x3256('0xb9')](function(_0x1bb4b6){for(var _0x16c5c7=0x0;_0x16c5c7<_0x5e6ce7[_0x3256('0x5a')][_0x3256('0x68')][_0x3256('0x47')];_0x16c5c7+=0x1){socket[_0x3256('0x12c')](_0x3256('0x12d'),{'UserId':Number(_0x5e6ce7[_0x3256('0x5a')][_0x3256('0x68')][_0x16c5c7]),'ChatWebsiteId':Number(_0x5e6ce7[_0x3256('0x54')]['id'])});}return _0x1bb4b6;});}})['then'](respondWithResult(_0x554254,null))[_0x3256('0x52')](handleError(_0x554254,null));};exports[_0x3256('0x12e')]=function(_0x1573ba,_0x3e0e13,_0x428ba3){return db[_0x3256('0x3c')][_0x3256('0x58')]({'where':{'id':_0x1573ba[_0x3256('0x54')]['id']}})['then'](handleEntityNotFound(_0x3e0e13,null))[_0x3256('0x1e')](function(_0x52fe2a){if(_0x52fe2a){return _0x52fe2a[_0x3256('0x12e')](_0x1573ba[_0x3256('0x41')][_0x3256('0x68')])[_0x3256('0x1e')](function(){if(_['isArray'](_0x1573ba[_0x3256('0x41')]['ids'])){for(var _0x1b0a6b=0x0;_0x1b0a6b<_0x1573ba[_0x3256('0x41')][_0x3256('0x68')]['length'];_0x1b0a6b+=0x1){socket['emit'](_0x3256('0x12f'),{'UserId':Number(_0x1573ba[_0x3256('0x41')][_0x3256('0x68')][_0x1b0a6b]),'ChatWebsiteId':Number(_0x1573ba[_0x3256('0x54')]['id'])});}}else{socket[_0x3256('0x12c')](_0x3256('0x12f'),{'UserId':Number(_0x1573ba[_0x3256('0x41')]['ids']),'ChatWebsiteId':Number(_0x1573ba[_0x3256('0x54')]['id'])});}});}})[_0x3256('0x1e')](respondWithStatusCode(_0x3e0e13,null))['catch'](handleError(_0x3e0e13,null));};exports[_0x3256('0x130')]=function(_0xf66eac,_0x156cf8,_0x4aaa99){var _0x262dae={};var _0x4e20c0={};var _0x4c4305;var _0x5c5216;return db['ChatWebsite']['findOne']({'where':{'id':_0xf66eac[_0x3256('0x54')]['id']}})[_0x3256('0x1e')](handleEntityNotFound(_0x156cf8,null))['then'](function(_0x48c9d8){if(_0x48c9d8){_0x4c4305=_0x48c9d8;_0x4e20c0[_0x3256('0x43')]=_[_0x3256('0x56')](db['User'][_0x3256('0x3d')]);_0x4e20c0['query']=_['keys'](_0xf66eac[_0x3256('0x41')]);_0x4e20c0[_0x3256('0x42')]=_[_0x3256('0x45')](_0x4e20c0[_0x3256('0x43')],_0x4e20c0[_0x3256('0x41')]);_0x262dae['attributes']=_[_0x3256('0x45')](_0x4e20c0[_0x3256('0x43')],qs[_0x3256('0x46')](_0xf66eac[_0x3256('0x41')][_0x3256('0x46')]));_0x262dae['attributes']=_0x262dae[_0x3256('0x44')]['length']?_0x262dae[_0x3256('0x44')]:_0x4e20c0[_0x3256('0x43')];_0x262dae[_0x3256('0x65')]=qs[_0x3256('0x4a')](_0xf66eac[_0x3256('0x41')][_0x3256('0x4a')]);_0x262dae[_0x3256('0x4b')]=qs[_0x3256('0x42')](_[_0x3256('0x4c')](_0xf66eac[_0x3256('0x41')],_0x4e20c0[_0x3256('0x42')]));if(_0xf66eac[_0x3256('0x41')][_0x3256('0x4e')]){_0x262dae['where']=_[_0x3256('0x4d')](_0x262dae[_0x3256('0x4b')],{'$or':_[_0x3256('0x3b')](_0x262dae[_0x3256('0x44')],function(_0x5576c5){var _0x47f7b0={};_0x47f7b0[_0x5576c5]={'$like':'%'+_0xf66eac['query']['filter']+'%'};return _0x47f7b0;})});}_0x262dae=_[_0x3256('0x4d')]({},_0x262dae,_0xf66eac[_0x3256('0x66')]);return _0x4c4305[_0x3256('0x130')](_0x262dae);}})[_0x3256('0x1e')](function(_0x33073e){if(_0x33073e){_0x5c5216=_0x33073e[_0x3256('0x47')];if(!_0xf66eac[_0x3256('0x41')][_0x3256('0x48')](_0x3256('0x49'))){_0x262dae[_0x3256('0x2d')]=qs[_0x3256('0x2d')](_0xf66eac[_0x3256('0x41')][_0x3256('0x2d')]);_0x262dae['offset']=qs[_0x3256('0x2f')](_0xf66eac[_0x3256('0x41')]['offset']);}return _0x4c4305[_0x3256('0x130')](_0x262dae);}})['then'](function(_0x8332df){if(_0x8332df){return _0x8332df?{'count':_0x5c5216,'rows':_0x8332df}:null;}})[_0x3256('0x1e')](respondWithResult(_0x156cf8,null))['catch'](handleError(_0x156cf8,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 8d3f0ef..44f87be 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 _0x61a5=['events','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1f31fa,_0x5e96a){var _0x1b50ba=function(_0x4cbe5b){while(--_0x4cbe5b){_0x1f31fa['push'](_0x1f31fa['shift']());}};_0x1b50ba(++_0x5e96a);}(_0x61a5,0xf0));var _0x561a=function(_0x3f1861,_0x7b4285){_0x3f1861=_0x3f1861-0x0;var _0x7ca70a=_0x61a5[_0x3f1861];return _0x7ca70a;};'use strict';var EventEmitter=require(_0x561a('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x561a('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x561a('0x2')](0x0);var events={'afterCreate':_0x561a('0x3'),'afterUpdate':_0x561a('0x4'),'afterDestroy':_0x561a('0x5')};function emitEvent(_0x58f636){return function(_0xe92b4d,_0x33c0f5,_0x5b9ca9){ChatWebsiteEvents[_0x561a('0x6')](_0x58f636+':'+_0xe92b4d['id'],_0xe92b4d);ChatWebsiteEvents[_0x561a('0x6')](_0x58f636,_0xe92b4d);_0x5b9ca9(null);};}for(var e in events){if(events[_0x561a('0x7')](e)){var event=events[e];ChatWebsite[_0x561a('0x8')](e,emitEvent(event));}}module[_0x561a('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x0ef0=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x18eb51,_0x2106a6){var _0x168a91=function(_0x1239ec){while(--_0x1239ec){_0x18eb51['push'](_0x18eb51['shift']());}};_0x168a91(++_0x2106a6);}(_0x0ef0,0x80));var _0x00ef=function(_0xbbcb36,_0x586383){_0xbbcb36=_0xbbcb36-0x0;var _0x4278ff=_0x0ef0[_0xbbcb36];return _0x4278ff;};'use strict';var EventEmitter=require(_0x00ef('0x0'));var ChatWebsite=require(_0x00ef('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x00ef('0x2')](0x0);var events={'afterCreate':_0x00ef('0x3'),'afterUpdate':_0x00ef('0x4'),'afterDestroy':_0x00ef('0x5')};function emitEvent(_0xd4ab59){return function(_0x92e0b,_0x53bad3,_0x5743e8){ChatWebsiteEvents[_0x00ef('0x6')](_0xd4ab59+':'+_0x92e0b['id'],_0x92e0b);ChatWebsiteEvents[_0x00ef('0x6')](_0xd4ab59,_0x92e0b);_0x5743e8(null);};}for(var e in events){if(events[_0x00ef('0x7')](e)){var event=events[e];ChatWebsite[_0x00ef('0x8')](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 7275ed6..d209c41 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 _0x0f8e=['api','bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','util','../../config/logger'];(function(_0x298303,_0x15c755){var _0x220db0=function(_0x12fa67){while(--_0x12fa67){_0x298303['push'](_0x298303['shift']());}};_0x220db0(++_0x15c755);}(_0x0f8e,0x1c1));var _0xe0f8=function(_0x15f590,_0x42b288){_0x15f590=_0x15f590-0x0;var _0x53671c=_0x0f8e[_0x15f590];return _0x53671c;};'use strict';var _=require('lodash');var util=require(_0xe0f8('0x0'));var logger=require(_0xe0f8('0x1'))(_0xe0f8('0x2'));var moment=require('moment');var BPromise=require(_0xe0f8('0x3'));var rp=require(_0xe0f8('0x4'));var fs=require('fs');var path=require(_0xe0f8('0x5'));var rimraf=require(_0xe0f8('0x6'));var config=require('../../config/environment');var attributes=require(_0xe0f8('0x7'));module[_0xe0f8('0x8')]=function(_0x140c64,_0x4e5256){return _0x140c64['define'](_0xe0f8('0x9'),attributes,{'tableName':_0xe0f8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb141=['request-promise','path','rimraf','../../config/environment','exports','define','ChatWebsite','chat_websites','util','../../config/logger','api','moment','bluebird'];(function(_0x1cfa05,_0x1e866c){var _0xbfed13=function(_0x1f92f7){while(--_0x1f92f7){_0x1cfa05['push'](_0x1cfa05['shift']());}};_0xbfed13(++_0x1e866c);}(_0xb141,0xff));var _0x1b14=function(_0x2d0733,_0x5a1e06){_0x2d0733=_0x2d0733-0x0;var _0x50ad90=_0xb141[_0x2d0733];return _0x50ad90;};'use strict';var _=require('lodash');var util=require(_0x1b14('0x0'));var logger=require(_0x1b14('0x1'))(_0x1b14('0x2'));var moment=require(_0x1b14('0x3'));var BPromise=require(_0x1b14('0x4'));var rp=require(_0x1b14('0x5'));var fs=require('fs');var path=require(_0x1b14('0x6'));var rimraf=require(_0x1b14('0x7'));var config=require(_0x1b14('0x8'));var attributes=require('./chatWebsite.attributes');module[_0x1b14('0x9')]=function(_0x4c4d84,_0x17dc71){return _0x4c4d84[_0x1b14('0xa')](_0x1b14('0xb'),attributes,{'tableName':_0x1b14('0xc'),'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 bec1283..dc6583e 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 _0x49bd=['socket.io-emitter','./chatWebsite.socket','register','request','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost'];(function(_0x3a027d,_0x43f542){var _0x886d73=function(_0x404a3b){while(--_0x404a3b){_0x3a027d['push'](_0x3a027d['shift']());}};_0x886d73(++_0x43f542);}(_0x49bd,0x1c5));var _0xd49b=function(_0x5ab37c,_0x9ff9e5){_0x5ab37c=_0x5ab37c-0x0;var _0x1657ef=_0x49bd[_0x5ab37c];return _0x1657ef;};'use strict';var _=require(_0xd49b('0x0'));var util=require(_0xd49b('0x1'));var moment=require(_0xd49b('0x2'));var BPromise=require(_0xd49b('0x3'));var rs=require(_0xd49b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd49b('0x5'))['db'];var utils=require(_0xd49b('0x6'));var logger=require(_0xd49b('0x7'))(_0xd49b('0x8'));var config=require('../../config/environment');var jayson=require(_0xd49b('0x9'));var client=jayson[_0xd49b('0xa')][_0xd49b('0xb')]({'port':0x232a});config['redis']=_[_0xd49b('0xc')](config[_0xd49b('0xd')],{'host':_0xd49b('0xe'),'port':0x18eb});var socket=require(_0xd49b('0xf'))(new Redis(config[_0xd49b('0xd')]));require(_0xd49b('0x10'))[_0xd49b('0x11')](socket);function respondWithRpcPromise(_0x1fff22,_0x464fbb,_0x499088){return new BPromise(function(_0x115fbe,_0x36dd4b){return client[_0xd49b('0x12')](_0x1fff22,_0x499088)['then'](function(_0x4ccc2b){logger['info'](_0xd49b('0x13'),_0x464fbb,_0xd49b('0x14'));logger[_0xd49b('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x464fbb,_0xd49b('0x14'),JSON['stringify'](_0x4ccc2b));if(_0x4ccc2b['error']){if(_0x4ccc2b['error']['code']===0x1f4){logger[_0xd49b('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x464fbb,_0x4ccc2b[_0xd49b('0x16')][_0xd49b('0x17')]);return _0x36dd4b(_0x4ccc2b[_0xd49b('0x16')][_0xd49b('0x17')]);}logger['error'](_0xd49b('0x13'),_0x464fbb,_0x4ccc2b[_0xd49b('0x16')][_0xd49b('0x17')]);return _0x115fbe(_0x4ccc2b[_0xd49b('0x16')][_0xd49b('0x17')]);}else{logger[_0xd49b('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x464fbb,'request\x20sent');_0x115fbe(_0x4ccc2b[_0xd49b('0x19')][_0xd49b('0x17')]);}})['catch'](function(_0x300609){logger[_0xd49b('0x16')](_0xd49b('0x13'),_0x464fbb,_0x300609);_0x36dd4b(_0x300609);});});}
\ No newline at end of file
+var _0x1ac3=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x370157,_0x11077f){var _0x5495c6=function(_0x3f21d8){while(--_0x3f21d8){_0x370157['push'](_0x370157['shift']());}};_0x5495c6(++_0x11077f);}(_0x1ac3,0x13f));var _0x31ac=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x1ac3[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0x31ac('0x0'));var util=require('util');var moment=require(_0x31ac('0x1'));var BPromise=require('bluebird');var rs=require(_0x31ac('0x2'));var fs=require('fs');var Redis=require(_0x31ac('0x3'));var db=require(_0x31ac('0x4'))['db'];var utils=require(_0x31ac('0x5'));var logger=require(_0x31ac('0x6'))(_0x31ac('0x7'));var config=require(_0x31ac('0x8'));var jayson=require(_0x31ac('0x9'));var client=jayson[_0x31ac('0xa')]['http']({'port':0x232a});config[_0x31ac('0xb')]=_[_0x31ac('0xc')](config[_0x31ac('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x31ac('0xd'))(new Redis(config[_0x31ac('0xb')]));require(_0x31ac('0xe'))[_0x31ac('0xf')](socket);function respondWithRpcPromise(_0x581261,_0x4726c2,_0x154cac){return new BPromise(function(_0x21ad1e,_0x1cfd8d){return client['request'](_0x581261,_0x154cac)[_0x31ac('0x10')](function(_0x13b6f8){logger[_0x31ac('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x4726c2,'request\x20sent');logger[_0x31ac('0x12')](_0x31ac('0x13'),_0x4726c2,_0x31ac('0x14'),JSON[_0x31ac('0x15')](_0x13b6f8));if(_0x13b6f8[_0x31ac('0x16')]){if(_0x13b6f8[_0x31ac('0x16')][_0x31ac('0x17')]===0x1f4){logger[_0x31ac('0x16')](_0x31ac('0x18'),_0x4726c2,_0x13b6f8[_0x31ac('0x16')]['message']);return _0x1cfd8d(_0x13b6f8['error'][_0x31ac('0x19')]);}logger[_0x31ac('0x16')](_0x31ac('0x18'),_0x4726c2,_0x13b6f8[_0x31ac('0x16')][_0x31ac('0x19')]);return _0x21ad1e(_0x13b6f8[_0x31ac('0x16')][_0x31ac('0x19')]);}else{logger[_0x31ac('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x4726c2,_0x31ac('0x14'));_0x21ad1e(_0x13b6f8['result'][_0x31ac('0x19')]);}})[_0x31ac('0x1a')](function(_0x2c1532){logger['error'](_0x31ac('0x18'),_0x4726c2,_0x2c1532);_0x1cfd8d(_0x2c1532);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 0a9954f..c4749ef 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 _0x41bb=['remove','update','emit','removeListener','length','./chatWebsite.events','save'];(function(_0x385770,_0xc1b263){var _0x293745=function(_0x363c9c){while(--_0x363c9c){_0x385770['push'](_0x385770['shift']());}};_0x293745(++_0xc1b263);}(_0x41bb,0xc9));var _0xb41b=function(_0x23e2bb,_0xd82b6d){_0x23e2bb=_0x23e2bb-0x0;var _0x2dd8ed=_0x41bb[_0x23e2bb];return _0x2dd8ed;};'use strict';var ChatWebsiteEvents=require(_0xb41b('0x0'));var events=[_0xb41b('0x1'),_0xb41b('0x2'),_0xb41b('0x3')];function createListener(_0x1891b7,_0x27f8cc){return function(_0x58d1e3){_0x27f8cc[_0xb41b('0x4')](_0x1891b7,_0x58d1e3);};}function removeListener(_0x497840,_0x1b4841){return function(){ChatWebsiteEvents[_0xb41b('0x5')](_0x497840,_0x1b4841);};}exports['register']=function(_0x11c357){for(var _0x534434=0x0,_0x5d41f0=events[_0xb41b('0x6')];_0x534434<_0x5d41f0;_0x534434++){var _0x5c67ef=events[_0x534434];var _0x1c067b=createListener('chatWebsite:'+_0x5c67ef,_0x11c357);ChatWebsiteEvents['on'](_0x5c67ef,_0x1c067b);}};
\ No newline at end of file
+var _0x33df=['chatWebsite:','./chatWebsite.events','save','remove','emit','removeListener','register'];(function(_0x301c34,_0x15701e){var _0x1a8c5a=function(_0x297b4f){while(--_0x297b4f){_0x301c34['push'](_0x301c34['shift']());}};_0x1a8c5a(++_0x15701e);}(_0x33df,0xe8));var _0xf33d=function(_0x4a9a17,_0x273a09){_0x4a9a17=_0x4a9a17-0x0;var _0x30e831=_0x33df[_0x4a9a17];return _0x30e831;};'use strict';var ChatWebsiteEvents=require(_0xf33d('0x0'));var events=[_0xf33d('0x1'),_0xf33d('0x2'),'update'];function createListener(_0x5ed991,_0x56e54a){return function(_0x784518){_0x56e54a[_0xf33d('0x3')](_0x5ed991,_0x784518);};}function removeListener(_0x39bc46,_0x28cdc4){return function(){ChatWebsiteEvents[_0xf33d('0x4')](_0x39bc46,_0x28cdc4);};}exports[_0xf33d('0x5')]=function(_0x3faa4d){for(var _0x44d3e1=0x0,_0x28ca1b=events['length'];_0x44d3e1<_0x28ca1b;_0x44d3e1++){var _0x4cc46a=events[_0x44d3e1];var _0x42d525=createListener(_0xf33d('0x6')+_0x4cc46a,_0x3faa4d);ChatWebsiteEvents['on'](_0x4cc46a,_0x42d525);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 67fd3f9..9017043 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 _0x8485=['getInteractions','/:id/snippet','getSnippet','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getAgents','create','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s','originalname','single','file','addLogo','root','now','addAvatar','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','attachments','ensureDir','replace','extname','/:id/offline','offline','addInteraction','/:id/applications','addApplications','addProactiveActions','/:id/users','addAgents','put','delete','destroy','removeDispositions','exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','/:id/interactions'];(function(_0x491faa,_0x4f2907){var _0x414440=function(_0x310864){while(--_0x310864){_0x491faa['push'](_0x491faa['shift']());}};_0x414440(++_0x4f2907);}(_0x8485,0xb9));var _0x5848=function(_0x4d8cef,_0x513893){_0x4d8cef=_0x4d8cef-0x0;var _0x31a519=_0x8485[_0x4d8cef];return _0x31a519;};'use strict';var multer=require(_0x5848('0x0'));var util=require('util');var path=require(_0x5848('0x1'));var timeout=require(_0x5848('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5848('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5848('0x4'));var config=require(_0x5848('0x5'));var controller=require(_0x5848('0x6'));router[_0x5848('0x7')]('/',auth[_0x5848('0x8')](),controller[_0x5848('0x9')]);router[_0x5848('0x7')]('/describe',auth[_0x5848('0x8')](),controller[_0x5848('0xa')]);router[_0x5848('0x7')](_0x5848('0xb'),auth[_0x5848('0x8')](),controller[_0x5848('0xc')]);router[_0x5848('0x7')](_0x5848('0xd'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x5848('0x7')]('/:id/canned_answers',auth[_0x5848('0x8')](),controller[_0x5848('0xe')]);router[_0x5848('0x7')](_0x5848('0xf'),controller[_0x5848('0x10')]);router['get'](_0x5848('0x11'),controller[_0x5848('0x12')]);router[_0x5848('0x7')](_0x5848('0x13'),controller['getCustomerAvatar']);router[_0x5848('0x7')](_0x5848('0x14'),controller['getSystemAvatar']);router[_0x5848('0x7')](_0x5848('0x15'),auth[_0x5848('0x8')](),controller[_0x5848('0x16')]);router['get'](_0x5848('0x17'),controller[_0x5848('0x18')]);router[_0x5848('0x7')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0x5848('0x7')](_0x5848('0x19'),auth['isAuthenticated'](),controller['getProactiveActions']);router['get'](_0x5848('0x1a'),controller[_0x5848('0x1b')]);router[_0x5848('0x7')](_0x5848('0x1c'),auth[_0x5848('0x8')](),controller['getOfflineMessages']);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x5848('0x1d')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5848('0x1e')]);router[_0x5848('0x1f')](_0x5848('0xd'),auth[_0x5848('0x8')](),controller[_0x5848('0x20')]);router['post'](_0x5848('0x21'),auth['isAuthenticated'](),controller[_0x5848('0x22')]);var upload=multer({'storage':multer[_0x5848('0x23')]({'destination':function(_0x530b9c,_0x48b50a,_0x79df24){_0x79df24(null,path[_0x5848('0x24')](config['root'],_0x5848('0x25')));},'filename':function(_0x14877e,_0x68faf6,_0x25d523){_0x25d523(null,util[_0x5848('0x26')](_0x5848('0x27'),Date['now'](),_0x68faf6[_0x5848('0x28')]));}})});router['post'](_0x5848('0xf'),upload[_0x5848('0x29')](_0x5848('0x2a')),controller[_0x5848('0x2b')]);var upload=multer({'storage':multer[_0x5848('0x23')]({'destination':function(_0x557487,_0xe19bde,_0x5120b5){_0x5120b5(null,path[_0x5848('0x24')](config[_0x5848('0x2c')],'server/files/images/avatars/'));},'filename':function(_0x78c2ff,_0x674dd4,_0x4a7ee7){_0x4a7ee7(null,util['format'](_0x5848('0x27'),Date[_0x5848('0x2d')](),_0x674dd4[_0x5848('0x28')]));}})});router[_0x5848('0x1f')](_0x5848('0x11'),upload[_0x5848('0x29')](_0x5848('0x2a')),controller[_0x5848('0x2e')]);var upload=multer({'storage':multer[_0x5848('0x23')]({'destination':function(_0x5a5a48,_0x825ee5,_0x38d7c8){_0x38d7c8(null,path[_0x5848('0x24')](config[_0x5848('0x2c')],_0x5848('0x2f')));},'filename':function(_0x5376b4,_0x503045,_0x4c515b){_0x4c515b(null,util[_0x5848('0x26')](_0x5848('0x27'),Date[_0x5848('0x2d')](),_0x503045[_0x5848('0x28')]));}})});router[_0x5848('0x1f')]('/:id/customer_avatar',upload[_0x5848('0x29')](_0x5848('0x2a')),controller[_0x5848('0x30')]);var upload=multer({'storage':multer[_0x5848('0x23')]({'destination':function(_0x11bf03,_0x18adde,_0x4572bd){_0x4572bd(null,path[_0x5848('0x24')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x3ca36a,_0x23295e,_0x2f7f53){_0x2f7f53(null,util[_0x5848('0x26')]('%s-%s',Date[_0x5848('0x2d')](),_0x23295e[_0x5848('0x28')]));}})});router['post'](_0x5848('0x14'),upload[_0x5848('0x29')](_0x5848('0x2a')),controller[_0x5848('0x31')]);router[_0x5848('0x1f')](_0x5848('0x32'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x5848('0x23')]({'destination':function(_0x16a37f,_0x1fdfad,_0x42eea9){const _0x3f5240=path[_0x5848('0x24')](config[_0x5848('0x2c')],_0x5848('0x33'),_0x5848('0x34'),'offline-chat');fs_extra[_0x5848('0x35')](_0x3f5240,function(){_0x42eea9(null,_0x3f5240);});},'filename':function(_0x814d8e,_0x570eff,_0x50c6d8){const _0x2af2e0=_0x570eff[_0x5848('0x28')][_0x5848('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x29546a=path[_0x5848('0x37')](_0x2af2e0);const _0x32085a=Date[_0x5848('0x2d')]()+'-'+_0x2af2e0[_0x5848('0x36')](_0x29546a,'')+_0x29546a;_0x50c6d8(null,_0x32085a);}})});router[_0x5848('0x1f')](_0x5848('0x38'),offlineUploadMulter['any'](),controller[_0x5848('0x39')]);router[_0x5848('0x1f')](_0x5848('0x15'),auth[_0x5848('0x8')](),controller[_0x5848('0x3a')]);router[_0x5848('0x1f')](_0x5848('0x3b'),auth[_0x5848('0x8')](),controller[_0x5848('0x3c')]);router[_0x5848('0x1f')](_0x5848('0x19'),auth[_0x5848('0x8')](),controller[_0x5848('0x3d')]);router[_0x5848('0x1f')](_0x5848('0x3e'),auth['isAuthenticated'](),controller[_0x5848('0x3f')]);router[_0x5848('0x40')]('/:id',auth[_0x5848('0x8')](),controller['update']);router[_0x5848('0x41')](_0x5848('0xb'),auth[_0x5848('0x8')](),controller[_0x5848('0x42')]);router[_0x5848('0x41')](_0x5848('0xd'),auth[_0x5848('0x8')](),controller[_0x5848('0x43')]);router['delete'](_0x5848('0x21'),auth[_0x5848('0x8')](),controller['removeAnswers']);router[_0x5848('0x41')](_0x5848('0x3e'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x5848('0x44')]=router;
\ No newline at end of file
+var _0xbe67=['join','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','any','offline','/:id/interactions','addApplications','/:id/proactive_actions','addAgents','put','update','destroy','delete','removeAnswers','removeAgents','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','root','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','format','addCustomerAvatar'];(function(_0x2666b3,_0x18481e){var _0x2ab92a=function(_0x3139c9){while(--_0x3139c9){_0x2666b3['push'](_0x2666b3['shift']());}};_0x2ab92a(++_0x18481e);}(_0xbe67,0x1be));var _0x7be6=function(_0x415648,_0x34761f){_0x415648=_0x415648-0x0;var _0x5c8ded=_0xbe67[_0x415648];return _0x5c8ded;};'use strict';var multer=require(_0x7be6('0x0'));var util=require(_0x7be6('0x1'));var path=require(_0x7be6('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x7be6('0x3'));var auth=require(_0x7be6('0x4'));var interaction=require(_0x7be6('0x5'));var config=require(_0x7be6('0x6'));var controller=require('./chatWebsite.controller');router['get']('/',auth[_0x7be6('0x7')](),controller[_0x7be6('0x8')]);router[_0x7be6('0x9')](_0x7be6('0xa'),auth[_0x7be6('0x7')](),controller['describe']);router['get'](_0x7be6('0xb'),auth[_0x7be6('0x7')](),controller[_0x7be6('0xc')]);router[_0x7be6('0x9')](_0x7be6('0xd'),auth[_0x7be6('0x7')](),controller[_0x7be6('0xe')]);router[_0x7be6('0x9')](_0x7be6('0xf'),auth[_0x7be6('0x7')](),controller[_0x7be6('0x10')]);router['get'](_0x7be6('0x11'),controller[_0x7be6('0x12')]);router[_0x7be6('0x9')](_0x7be6('0x13'),controller[_0x7be6('0x14')]);router['get'](_0x7be6('0x15'),controller[_0x7be6('0x16')]);router[_0x7be6('0x9')](_0x7be6('0x17'),controller[_0x7be6('0x18')]);router[_0x7be6('0x9')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0x7be6('0x9')](_0x7be6('0x19'),controller[_0x7be6('0x1a')]);router[_0x7be6('0x9')](_0x7be6('0x1b'),auth[_0x7be6('0x7')](),controller[_0x7be6('0x1c')]);router['get']('/:id/proactive_actions',auth[_0x7be6('0x7')](),controller[_0x7be6('0x1d')]);router[_0x7be6('0x9')](_0x7be6('0x1e'),controller[_0x7be6('0x1f')]);router[_0x7be6('0x9')](_0x7be6('0x20'),auth[_0x7be6('0x7')](),controller[_0x7be6('0x21')]);router[_0x7be6('0x9')](_0x7be6('0x22'),auth['isAuthenticated'](),controller[_0x7be6('0x23')]);router[_0x7be6('0x24')]('/',auth['isAuthenticated'](),controller[_0x7be6('0x25')]);router[_0x7be6('0x24')]('/:id/dispositions',auth[_0x7be6('0x7')](),controller[_0x7be6('0x26')]);router[_0x7be6('0x24')](_0x7be6('0xf'),auth[_0x7be6('0x7')](),controller[_0x7be6('0x27')]);var upload=multer({'storage':multer[_0x7be6('0x28')]({'destination':function(_0x317bd7,_0x386aba,_0x1f6b3a){_0x1f6b3a(null,path['join'](config[_0x7be6('0x29')],'server/files/images/logos/'));},'filename':function(_0x46e511,_0xac4aa8,_0x342a69){_0x342a69(null,util['format'](_0x7be6('0x2a'),Date[_0x7be6('0x2b')](),_0xac4aa8[_0x7be6('0x2c')]));}})});router[_0x7be6('0x24')]('/:id/logo',upload[_0x7be6('0x2d')](_0x7be6('0x2e')),controller[_0x7be6('0x2f')]);var upload=multer({'storage':multer[_0x7be6('0x28')]({'destination':function(_0x35cfc4,_0x2f12c1,_0x5a4978){_0x5a4978(null,path['join'](config[_0x7be6('0x29')],_0x7be6('0x30')));},'filename':function(_0x1480b0,_0x4caf04,_0x4107ec){_0x4107ec(null,util[_0x7be6('0x31')](_0x7be6('0x2a'),Date[_0x7be6('0x2b')](),_0x4caf04[_0x7be6('0x2c')]));}})});router['post']('/:id/avatar',upload[_0x7be6('0x2d')](_0x7be6('0x2e')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x492a5d,_0x159a3d,_0x1faf1e){_0x1faf1e(null,path['join'](config[_0x7be6('0x29')],_0x7be6('0x30')));},'filename':function(_0x8f2b0c,_0x22c21c,_0x3655a2){_0x3655a2(null,util[_0x7be6('0x31')]('%s-%s',Date[_0x7be6('0x2b')](),_0x22c21c[_0x7be6('0x2c')]));}})});router[_0x7be6('0x24')](_0x7be6('0x15'),upload['single'](_0x7be6('0x2e')),controller[_0x7be6('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d3dfb,_0x6b67e4,_0x3d2088){_0x3d2088(null,path[_0x7be6('0x33')](config[_0x7be6('0x29')],_0x7be6('0x30')));},'filename':function(_0x43a43,_0x519025,_0x4522c0){_0x4522c0(null,util[_0x7be6('0x31')]('%s-%s',Date[_0x7be6('0x2b')](),_0x519025['originalname']));}})});router[_0x7be6('0x24')]('/:id/system_avatar',upload[_0x7be6('0x2d')](_0x7be6('0x2e')),controller['addSystemAvatar']);router[_0x7be6('0x24')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x7be6('0x28')]({'destination':function(_0x406bb3,_0x37a2d7,_0x25f019){const _0x4282d1=path[_0x7be6('0x33')](config['root'],_0x7be6('0x34'),_0x7be6('0x35'),_0x7be6('0x36'));fs_extra[_0x7be6('0x37')](_0x4282d1,function(){_0x25f019(null,_0x4282d1);});},'filename':function(_0x2a63e5,_0x48ce01,_0x4b2a5c){const _0x36b4ad=_0x48ce01[_0x7be6('0x2c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1ec921=path['extname'](_0x36b4ad);const _0x16efee=Date[_0x7be6('0x2b')]()+'-'+_0x36b4ad[_0x7be6('0x38')](_0x1ec921,'')+_0x1ec921;_0x4b2a5c(null,_0x16efee);}})});router['post'](_0x7be6('0x39'),offlineUploadMulter[_0x7be6('0x3a')](),controller[_0x7be6('0x3b')]);router['post'](_0x7be6('0x3c'),auth['isAuthenticated'](),controller['addInteraction']);router[_0x7be6('0x24')](_0x7be6('0x1b'),auth['isAuthenticated'](),controller[_0x7be6('0x3d')]);router[_0x7be6('0x24')](_0x7be6('0x3e'),auth[_0x7be6('0x7')](),controller['addProactiveActions']);router['post'](_0x7be6('0x22'),auth['isAuthenticated'](),controller[_0x7be6('0x3f')]);router[_0x7be6('0x40')]('/:id',auth[_0x7be6('0x7')](),controller[_0x7be6('0x41')]);router['delete']('/:id',auth[_0x7be6('0x7')](),controller[_0x7be6('0x42')]);router[_0x7be6('0x43')](_0x7be6('0xd'),auth[_0x7be6('0x7')](),controller['removeDispositions']);router['delete'](_0x7be6('0xf'),auth[_0x7be6('0x7')](),controller[_0x7be6('0x44')]);router[_0x7be6('0x43')]('/:id/users',auth['isAuthenticated'](),controller[_0x7be6('0x45')]);module[_0x7be6('0x46')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 2ade878..d4ef56f 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 _0xdfa0=['Google','sequelize','STRING','ENUM'];(function(_0x3a2e8c,_0x4001d3){var _0x588177=function(_0x2dbc02){while(--_0x2dbc02){_0x3a2e8c['push'](_0x3a2e8c['shift']());}};_0x588177(++_0x4001d3);}(_0xdfa0,0x69));var _0x0dfa=function(_0x4ddd00,_0xc967a9){_0x4ddd00=_0x4ddd00-0x0;var _0x4bc6cc=_0xdfa0[_0x4ddd00];return _0x4bc6cc;};'use strict';var Sequelize=require(_0x0dfa('0x0'));module['exports']={'name':{'type':Sequelize[_0x0dfa('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x0dfa('0x2')]('AmazonAWS',_0x0dfa('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x0dfa('0x1')]},'data2':{'type':Sequelize[_0x0dfa('0x1')]}};
\ No newline at end of file
+var _0x4e47=['ENUM','AmazonAWS','Google','STRING'];(function(_0x21973a,_0xef5df8){var _0x2fb112=function(_0x4cf4fb){while(--_0x4cf4fb){_0x21973a['push'](_0x21973a['shift']());}};_0x2fb112(++_0xef5df8);}(_0x4e47,0x17f));var _0x74e4=function(_0x488389,_0x31e284){_0x488389=_0x488389-0x0;var _0x5b28ac=_0x4e47[_0x488389];return _0x5b28ac;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x74e4('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x74e4('0x1')](_0x74e4('0x2'),_0x74e4('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x74e4('0x0')]},'data2':{'type':Sequelize[_0x74e4('0x0')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 818d25d..bad5b3f 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 _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CloudProvider','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x475f2a,_0x37633d){var _0x211cb5=function(_0x559b8c){while(--_0x559b8c){_0x475f2a['push'](_0x475f2a['shift']());}};_0x211cb5(++_0x37633d);}(_0x2ef3,0xba));var _0x32ef=function(_0x3da750,_0x2db72e){_0x3da750=_0x3da750-0x0;var _0x4d144c=_0x2ef3[_0x3da750];return _0x4d144c;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['CloudProvider'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':!![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['CloudProvider'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['CloudProvider']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));};
\ No newline at end of file
+var _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CloudProvider','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x3faf85,_0x272107){var _0x496c38=function(_0x4500b0){while(--_0x4500b0){_0x3faf85['push'](_0x3faf85['shift']());}};_0x496c38(++_0x272107);}(_0x2ef3,0xba));var _0x32ef=function(_0x3c53b4,_0x242a4c){_0x3c53b4=_0x3c53b4-0x0;var _0x2e1c4a=_0x2ef3[_0x3c53b4];return _0x2e1c4a;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['CloudProvider'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':!![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['CloudProvider'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['CloudProvider']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index cd6021c..cd08ad2 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 _0xbb8f=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash'];(function(_0x78586c,_0x266910){var _0x1bd392=function(_0xd7bb3e){while(--_0xd7bb3e){_0x78586c['push'](_0x78586c['shift']());}};_0x1bd392(++_0x266910);}(_0xbb8f,0x99));var _0xfbb8=function(_0x21bba8,_0x37840e){_0x21bba8=_0x21bba8-0x0;var _0x5d1263=_0xbb8f[_0x21bba8];return _0x5d1263;};'use strict';var _=require(_0xfbb8('0x0'));var util=require('util');var logger=require(_0xfbb8('0x1'))(_0xfbb8('0x2'));var moment=require(_0xfbb8('0x3'));var BPromise=require(_0xfbb8('0x4'));var rp=require(_0xfbb8('0x5'));var fs=require('fs');var path=require(_0xfbb8('0x6'));var rimraf=require(_0xfbb8('0x7'));var config=require(_0xfbb8('0x8'));var attributes=require(_0xfbb8('0x9'));module[_0xfbb8('0xa')]=function(_0x3722cc,_0x11ccce){return _0x3722cc[_0xfbb8('0xb')](_0xfbb8('0xc'),attributes,{'tableName':_0xfbb8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2b72=['CloudProvider','cloud_providers','lodash','util','api','moment','request-promise','path','rimraf','./cloudProvider.attributes','exports','define'];(function(_0xb4a44b,_0xb8870c){var _0x583792=function(_0x37cbdc){while(--_0x37cbdc){_0xb4a44b['push'](_0xb4a44b['shift']());}};_0x583792(++_0xb8870c);}(_0x2b72,0x13a));var _0x22b7=function(_0x18b4e8,_0x30e9e1){_0x18b4e8=_0x18b4e8-0x0;var _0x4b6265=_0x2b72[_0x18b4e8];return _0x4b6265;};'use strict';var _=require(_0x22b7('0x0'));var util=require(_0x22b7('0x1'));var logger=require('../../config/logger')(_0x22b7('0x2'));var moment=require(_0x22b7('0x3'));var BPromise=require('bluebird');var rp=require(_0x22b7('0x4'));var fs=require('fs');var path=require(_0x22b7('0x5'));var rimraf=require(_0x22b7('0x6'));var config=require('../../config/environment');var attributes=require(_0x22b7('0x7'));module[_0x22b7('0x8')]=function(_0x2727a3,_0x5dcfd5){return _0x2727a3[_0x22b7('0x9')](_0x22b7('0xa'),attributes,{'tableName':_0x22b7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 0444ab3..08a076c 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 _0x4c50=['moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x5d4618,_0x2c2057){var _0x389418=function(_0x1f5fc6){while(--_0x1f5fc6){_0x5d4618['push'](_0x5d4618['shift']());}};_0x389418(++_0x2c2057);}(_0x4c50,0x10f));var _0x04c5=function(_0x526f36,_0x19aadb){_0x526f36=_0x526f36-0x0;var _0x3746e6=_0x4c50[_0x526f36];return _0x3746e6;};'use strict';var _=require(_0x04c5('0x0'));var util=require(_0x04c5('0x1'));var moment=require(_0x04c5('0x2'));var BPromise=require(_0x04c5('0x3'));var rs=require(_0x04c5('0x4'));var fs=require('fs');var Redis=require(_0x04c5('0x5'));var db=require(_0x04c5('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x04c5('0x7'));var config=require(_0x04c5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x04c5('0x9')][_0x04c5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22535c,_0x34961a,_0x1fb2db){return new BPromise(function(_0x40a846,_0x411e7f){return client[_0x04c5('0xb')](_0x22535c,_0x1fb2db)['then'](function(_0x4ebad1){logger['info'](_0x04c5('0xc'),_0x34961a,_0x04c5('0xd'));logger[_0x04c5('0xe')](_0x04c5('0xf'),_0x34961a,_0x04c5('0xd'),JSON[_0x04c5('0x10')](_0x4ebad1));if(_0x4ebad1[_0x04c5('0x11')]){if(_0x4ebad1[_0x04c5('0x11')][_0x04c5('0x12')]===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x34961a,_0x4ebad1[_0x04c5('0x11')][_0x04c5('0x13')]);return _0x411e7f(_0x4ebad1['error'][_0x04c5('0x13')]);}logger[_0x04c5('0x11')](_0x04c5('0xc'),_0x34961a,_0x4ebad1[_0x04c5('0x11')][_0x04c5('0x13')]);return _0x40a846(_0x4ebad1['error']['message']);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0x34961a,'request\x20sent');_0x40a846(_0x4ebad1[_0x04c5('0x14')]['message']);}})['catch'](function(_0x1ee3a0){logger[_0x04c5('0x11')]('CloudProvider,\x20%s,\x20%s',_0x34961a,_0x1ee3a0);_0x411e7f(_0x1ee3a0);});});}
\ No newline at end of file
+var _0x1122=['CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2d7bc0,_0x10d7b7){var _0x58fe96=function(_0x6eab7c){while(--_0x6eab7c){_0x2d7bc0['push'](_0x2d7bc0['shift']());}};_0x58fe96(++_0x10d7b7);}(_0x1122,0xac));var _0x2112=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1122[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2112('0x0'));var util=require('util');var moment=require(_0x2112('0x1'));var BPromise=require(_0x2112('0x2'));var rs=require(_0x2112('0x3'));var fs=require('fs');var Redis=require(_0x2112('0x4'));var db=require(_0x2112('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2112('0x6'));var config=require('../../config/environment');var jayson=require(_0x2112('0x7'));var client=jayson[_0x2112('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcca285,_0x2ad731,_0x3f0a81){return new BPromise(function(_0x272bdb,_0x4190c7){return client[_0x2112('0x9')](_0xcca285,_0x3f0a81)[_0x2112('0xa')](function(_0x2f7142){logger[_0x2112('0xb')]('CloudProvider,\x20%s,\x20%s',_0x2ad731,_0x2112('0xc'));logger[_0x2112('0xd')](_0x2112('0xe'),_0x2ad731,_0x2112('0xc'),JSON['stringify'](_0x2f7142));if(_0x2f7142[_0x2112('0xf')]){if(_0x2f7142[_0x2112('0xf')][_0x2112('0x10')]===0x1f4){logger[_0x2112('0xf')](_0x2112('0x11'),_0x2ad731,_0x2f7142[_0x2112('0xf')][_0x2112('0x12')]);return _0x4190c7(_0x2f7142['error'][_0x2112('0x12')]);}logger['error'](_0x2112('0x11'),_0x2ad731,_0x2f7142[_0x2112('0xf')]['message']);return _0x272bdb(_0x2f7142[_0x2112('0xf')]['message']);}else{logger[_0x2112('0xb')]('CloudProvider,\x20%s,\x20%s',_0x2ad731,_0x2112('0xc'));_0x272bdb(_0x2f7142[_0x2112('0x13')]['message']);}})[_0x2112('0x14')](function(_0x4db5c3){logger[_0x2112('0xf')]('CloudProvider,\x20%s,\x20%s',_0x2ad731,_0x4db5c3);_0x4190c7(_0x4db5c3);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index d0fbbb2..fe905cb 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 _0xcabf=['show','create','put','update','delete','exports','multer','util','Router','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x19fda2,_0x5de19b){var _0xb362d4=function(_0x9c9bd4){while(--_0x9c9bd4){_0x19fda2['push'](_0x19fda2['shift']());}};_0xb362d4(++_0x5de19b);}(_0xcabf,0x102));var _0xfcab=function(_0x5da11c,_0x17a50d){_0x5da11c=_0x5da11c-0x0;var _0x960ebf=_0xcabf[_0x5da11c];return _0x960ebf;};'use strict';var multer=require(_0xfcab('0x0'));var util=require(_0xfcab('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfcab('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfcab('0x3'));var controller=require('./cloudProvider.controller');router[_0xfcab('0x4')]('/',auth[_0xfcab('0x5')](),controller[_0xfcab('0x6')]);router['get'](_0xfcab('0x7'),auth[_0xfcab('0x5')](),controller[_0xfcab('0x8')]);router['post']('/',auth[_0xfcab('0x5')](),controller[_0xfcab('0x9')]);router[_0xfcab('0xa')](_0xfcab('0x7'),auth['isAuthenticated'](),controller[_0xfcab('0xb')]);router[_0xfcab('0xc')]('/:id',auth[_0xfcab('0x5')](),controller['destroy']);module[_0xfcab('0xd')]=router;
\ No newline at end of file
+var _0xc26f=['../../components/auth/service','../../components/interaction/service','./cloudProvider.controller','get','isAuthenticated','/:id','post','create','update','delete','destroy','multer','util','connect-timeout','fs-extra'];(function(_0x33759d,_0x1442ba){var _0x368ed7=function(_0x28868d){while(--_0x28868d){_0x33759d['push'](_0x33759d['shift']());}};_0x368ed7(++_0x1442ba);}(_0xc26f,0xdd));var _0xfc26=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc26f[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0xfc26('0x0'));var util=require(_0xfc26('0x1'));var path=require('path');var timeout=require(_0xfc26('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfc26('0x3'));var auth=require(_0xfc26('0x4'));var interaction=require(_0xfc26('0x5'));var config=require('../../config/environment');var controller=require(_0xfc26('0x6'));router[_0xfc26('0x7')]('/',auth[_0xfc26('0x8')](),controller['index']);router[_0xfc26('0x7')](_0xfc26('0x9'),auth[_0xfc26('0x8')](),controller['show']);router[_0xfc26('0xa')]('/',auth[_0xfc26('0x8')](),controller[_0xfc26('0xb')]);router['put']('/:id',auth[_0xfc26('0x8')](),controller[_0xfc26('0xc')]);router[_0xfc26('0xd')]('/:id',auth[_0xfc26('0x8')](),controller[_0xfc26('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index a86199b..ac98eb2 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 _0x1fa7=['STRING','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1fa7,0x151));var _0x71fa=function(_0xe5d44f,_0x11d790){_0xe5d44f=_0xe5d44f-0x0;var _0x5e91ab=_0x1fa7[_0xe5d44f];return _0x5e91ab;};'use strict';var Sequelize=require('sequelize');module[_0x71fa('0x0')]={'name':{'type':Sequelize[_0x71fa('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x71fa('0x1')]},'website':{'type':Sequelize[_0x71fa('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x71fa('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x71fa('0x1')]},'postalCode':{'type':Sequelize[_0x71fa('0x1')]},'city':{'type':Sequelize[_0x71fa('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x71fa('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x71fa('0x1')]},'sStreet':{'type':Sequelize[_0x71fa('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x71fa('0x1')]},'description':{'type':Sequelize[_0x71fa('0x1')]}};
\ No newline at end of file
+var _0x177d=['sequelize','exports','STRING','name'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x177d,0x68));var _0xd177=function(_0x1cb7ea,_0x2496df){_0x1cb7ea=_0x1cb7ea-0x0;var _0x17991f=_0x177d[_0x1cb7ea];return _0x17991f;};'use strict';var Sequelize=require(_0xd177('0x0'));module[_0xd177('0x1')]={'name':{'type':Sequelize[_0xd177('0x2')],'unique':_0xd177('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xd177('0x2')]},'companyId':{'type':Sequelize[_0xd177('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xd177('0x2')]},'type':{'type':Sequelize[_0xd177('0x2')]},'street':{'type':Sequelize[_0xd177('0x2')]},'postalCode':{'type':Sequelize[_0xd177('0x2')]},'city':{'type':Sequelize[_0xd177('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xd177('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xd177('0x2')]},'sStreet':{'type':Sequelize[_0xd177('0x2')]},'sPostalCode':{'type':Sequelize[_0xd177('0x2')]},'sCity':{'type':Sequelize[_0xd177('0x2')]},'sCountry':{'type':Sequelize[_0xd177('0x2')]},'description':{'type':Sequelize[_0xd177('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index bcd3db3..968a72a 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 _0xbc22=['offset','set','json','apply','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','filter','merge','includeAll','include','rows','catch','show','rawAttributes','length','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addContacts','CmContact','params','ids','getContacts','order','map','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count'];(function(_0xc0c68,_0x254415){var _0x2d965f=function(_0x173c22){while(--_0x173c22){_0xc0c68['push'](_0xc0c68['shift']());}};_0x2d965f(++_0x254415);}(_0xbc22,0x131));var _0x2bc2=function(_0x187279,_0x26d152){_0x187279=_0x187279-0x0;var _0x3da59d=_0xbc22[_0x187279];return _0x3da59d;};'use strict';var emlformat=require(_0x2bc2('0x0'));var rimraf=require(_0x2bc2('0x1'));var zipdir=require(_0x2bc2('0x2'));var jsonpatch=require(_0x2bc2('0x3'));var rp=require(_0x2bc2('0x4'));var moment=require(_0x2bc2('0x5'));var BPromise=require(_0x2bc2('0x6'));var Mustache=require('mustache');var util=require(_0x2bc2('0x7'));var path=require(_0x2bc2('0x8'));var sox=require(_0x2bc2('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2bc2('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2bc2('0xb'));var deskjs=require(_0x2bc2('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2bc2('0xd'));var Papa=require(_0x2bc2('0xe'));var Redis=require(_0x2bc2('0xf'));var authService=require(_0x2bc2('0x10'));var qs=require(_0x2bc2('0x11'));var as=require(_0x2bc2('0x12'));var hardwareService=require(_0x2bc2('0x13'));var logger=require(_0x2bc2('0x14'))(_0x2bc2('0x15'));var utils=require(_0x2bc2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2bc2('0x17'));var db=require(_0x2bc2('0x18'))['db'];function respondWithStatusCode(_0x5a16fe,_0x175251){_0x175251=_0x175251||0xcc;return function(_0x132177){if(_0x132177){return _0x5a16fe[_0x2bc2('0x19')](_0x175251);}return _0x5a16fe[_0x2bc2('0x1a')](_0x175251)[_0x2bc2('0x1b')]();};}function respondWithResult(_0x4bad4b,_0x2d0510){_0x2d0510=_0x2d0510||0xc8;return function(_0x503713){if(_0x503713){return _0x4bad4b[_0x2bc2('0x1a')](_0x2d0510)['json'](_0x503713);}};}function respondWithFilteredResult(_0x1233b2,_0x31f218){return function(_0x5860cc){if(_0x5860cc){var _0x54b5c4=typeof _0x31f218['offset']===_0x2bc2('0x1c')&&typeof _0x31f218[_0x2bc2('0x1d')]==='undefined';var _0xfbd7d9=_0x5860cc[_0x2bc2('0x1e')];var _0x53d4ac=_0x54b5c4?0x0:_0x31f218['offset'];var _0x2886c5=_0x54b5c4?_0x5860cc[_0x2bc2('0x1e')]:_0x31f218[_0x2bc2('0x1f')]+_0x31f218[_0x2bc2('0x1d')];var _0x4ff222;if(_0x2886c5>=_0xfbd7d9){_0x2886c5=_0xfbd7d9;_0x4ff222=0xc8;}else{_0x4ff222=0xce;}_0x1233b2['status'](_0x4ff222);return _0x1233b2[_0x2bc2('0x20')]('Content-Range',_0x53d4ac+'-'+_0x2886c5+'/'+_0xfbd7d9)[_0x2bc2('0x21')](_0x5860cc);}return null;};}function patchUpdates(_0x73b73a){return function(_0x25bf1d){try{jsonpatch[_0x2bc2('0x22')](_0x25bf1d,_0x73b73a,!![]);}catch(_0x14b0cd){return BPromise['reject'](_0x14b0cd);}return _0x25bf1d['save']();};}function saveUpdates(_0x852a71,_0x3d7fc6){return function(_0x534b46){if(_0x534b46){return _0x534b46['update'](_0x852a71)[_0x2bc2('0x23')](function(_0x4e3b44){return _0x4e3b44;});}return null;};}function removeEntity(_0x38d32a,_0x3c50f2){return function(_0x2f4c5d){if(_0x2f4c5d){return _0x2f4c5d[_0x2bc2('0x24')]()[_0x2bc2('0x23')](function(){var _0x5717da=_0x2f4c5d[_0x2bc2('0x25')]({'plain':!![]});var _0xeed6a9=_0x2bc2('0x26');return db[_0x2bc2('0x27')][_0x2bc2('0x24')]({'where':{'type':_0xeed6a9,'resourceId':_0x5717da['id']}})['then'](function(){return _0x2f4c5d;});})[_0x2bc2('0x23')](function(){_0x38d32a['status'](0xcc)[_0x2bc2('0x1b')]();});}};}function handleEntityNotFound(_0x4325f3,_0x25e73f){return function(_0x187d33){if(!_0x187d33){_0x4325f3[_0x2bc2('0x19')](0x194);}return _0x187d33;};}function handleError(_0x5065d9,_0x3406af){_0x3406af=_0x3406af||0x1f4;return function(_0x8306c1){logger[_0x2bc2('0x28')](_0x8306c1[_0x2bc2('0x29')]);if(_0x8306c1[_0x2bc2('0x2a')]){delete _0x8306c1[_0x2bc2('0x2a')];}_0x5065d9[_0x2bc2('0x1a')](_0x3406af)[_0x2bc2('0x2b')](_0x8306c1);};}exports[_0x2bc2('0x2c')]=function(_0xa1284f,_0xb7d6fc){var _0x52cfae={},_0xe8c700={},_0x57d6c9={'count':0x0,'rows':[]};return db[_0x2bc2('0x2d')]['describe']()['then'](function(_0x2fea74){_0xe8c700[_0x2bc2('0x2e')]=_['keys'](_0x2fea74);_0xe8c700[_0x2bc2('0x2f')]=_[_0x2bc2('0x30')](_0xa1284f[_0x2bc2('0x2f')]);_0xe8c700[_0x2bc2('0x31')]=_['intersection'](_0xe8c700[_0x2bc2('0x2e')],_0xe8c700[_0x2bc2('0x2f')]);_0x52cfae[_0x2bc2('0x32')]=_[_0x2bc2('0x33')](_0xe8c700['model'],qs[_0x2bc2('0x34')](_0xa1284f[_0x2bc2('0x2f')]['fields']));_0x52cfae[_0x2bc2('0x32')]=_0x52cfae[_0x2bc2('0x32')]['length']?_0x52cfae[_0x2bc2('0x32')]:_0xe8c700[_0x2bc2('0x2e')];if(!_0xa1284f['query']['hasOwnProperty'](_0x2bc2('0x35'))){_0x52cfae[_0x2bc2('0x1d')]=qs[_0x2bc2('0x1d')](_0xa1284f[_0x2bc2('0x2f')]['limit']);_0x52cfae[_0x2bc2('0x1f')]=qs[_0x2bc2('0x1f')](_0xa1284f[_0x2bc2('0x2f')]['offset']);}_0x52cfae['order']=qs[_0x2bc2('0x36')](_0xa1284f['query'][_0x2bc2('0x36')]);_0x52cfae[_0x2bc2('0x37')]=qs[_0x2bc2('0x31')](_['pick'](_0xa1284f[_0x2bc2('0x2f')],_0xe8c700['filters']),_0x2fea74);if(_0xa1284f[_0x2bc2('0x2f')]['filter']){_0x52cfae[_0x2bc2('0x37')]=_['merge'](_0x52cfae[_0x2bc2('0x37')],{'$or':_['map'](_0x52cfae[_0x2bc2('0x32')],function(_0x4153e6){var _0x448640={};_0x448640[_0x4153e6]={'$like':'%'+_0xa1284f[_0x2bc2('0x2f')][_0x2bc2('0x38')]+'%'};return _0x448640;})});}_0x52cfae=_[_0x2bc2('0x39')]({},_0x52cfae,_0xa1284f['options']);var _0x228da5={'where':_0x52cfae[_0x2bc2('0x37')]};return db['CmCompany'][_0x2bc2('0x1e')](_0x228da5)[_0x2bc2('0x23')](function(_0x23511b){_0x57d6c9[_0x2bc2('0x1e')]=_0x23511b;if(_0xa1284f[_0x2bc2('0x2f')][_0x2bc2('0x3a')]){_0x52cfae[_0x2bc2('0x3b')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x52cfae);})[_0x2bc2('0x23')](function(_0x2e0261){_0x57d6c9[_0x2bc2('0x3c')]=_0x2e0261;return _0x57d6c9;})[_0x2bc2('0x23')](respondWithFilteredResult(_0xb7d6fc,_0x52cfae))[_0x2bc2('0x3d')](handleError(_0xb7d6fc,null));})[_0x2bc2('0x3d')](handleError(_0xb7d6fc,null));};exports[_0x2bc2('0x3e')]=function(_0x52f59e,_0x38bb5c){var _0x1342f3={'raw':![],'where':{'id':_0x52f59e['params']['id']}},_0x517794={};_0x517794[_0x2bc2('0x2e')]=_[_0x2bc2('0x30')](db[_0x2bc2('0x2d')][_0x2bc2('0x3f')]);_0x517794[_0x2bc2('0x2f')]=_[_0x2bc2('0x30')](_0x52f59e[_0x2bc2('0x2f')]);_0x517794[_0x2bc2('0x31')]=_[_0x2bc2('0x33')](_0x517794[_0x2bc2('0x2e')],_0x517794[_0x2bc2('0x2f')]);_0x1342f3[_0x2bc2('0x32')]=_['intersection'](_0x517794[_0x2bc2('0x2e')],qs[_0x2bc2('0x34')](_0x52f59e[_0x2bc2('0x2f')][_0x2bc2('0x34')]));_0x1342f3['attributes']=_0x1342f3[_0x2bc2('0x32')][_0x2bc2('0x40')]?_0x1342f3['attributes']:_0x517794[_0x2bc2('0x2e')];if(_0x52f59e[_0x2bc2('0x2f')]['includeAll']){_0x1342f3[_0x2bc2('0x3b')]=[{'all':!![]}];}_0x1342f3=_['merge']({},_0x1342f3,_0x52f59e[_0x2bc2('0x41')]);return db[_0x2bc2('0x2d')][_0x2bc2('0x42')](_0x1342f3)[_0x2bc2('0x23')](handleEntityNotFound(_0x38bb5c,null))[_0x2bc2('0x23')](respondWithResult(_0x38bb5c,null))[_0x2bc2('0x3d')](handleError(_0x38bb5c,null));};exports['create']=function(_0x4421ff,_0x361329){return db['CmCompany'][_0x2bc2('0x43')](_0x4421ff['body'],{})[_0x2bc2('0x23')](function(_0x1c34cd){var _0x2c916a=_0x4421ff['user'][_0x2bc2('0x25')]({'plain':!![]});if(!_0x2c916a)throw new Error(_0x2bc2('0x44'));if(_0x2c916a[_0x2bc2('0x45')]==='user'){var _0x4d58ee=_0x1c34cd[_0x2bc2('0x25')]({'plain':!![]});var _0x57e784=_0x2bc2('0x26');return db['UserProfileSection'][_0x2bc2('0x42')]({'where':{'name':_0x57e784,'userProfileId':_0x2c916a[_0x2bc2('0x46')]},'raw':!![]})[_0x2bc2('0x23')](function(_0x4a025b){if(_0x4a025b&&_0x4a025b[_0x2bc2('0x47')]===0x0){return db[_0x2bc2('0x27')]['create']({'name':_0x4d58ee[_0x2bc2('0x2a')],'resourceId':_0x4d58ee['id'],'type':_0x4a025b['name'],'sectionId':_0x4a025b['id']},{})[_0x2bc2('0x23')](function(){return _0x1c34cd;});}else{return _0x1c34cd;}})[_0x2bc2('0x3d')](function(_0x27cc1e){logger[_0x2bc2('0x28')](_0x2bc2('0x48'),_0x27cc1e);throw _0x27cc1e;});}return _0x1c34cd;})['then'](respondWithResult(_0x361329,0xc9))[_0x2bc2('0x3d')](handleError(_0x361329,null));};exports[_0x2bc2('0x49')]=function(_0x3a5b4d,_0x582571){if(_0x3a5b4d[_0x2bc2('0x4a')]['id']){delete _0x3a5b4d[_0x2bc2('0x4a')]['id'];}return db[_0x2bc2('0x2d')][_0x2bc2('0x42')]({'where':{'id':_0x3a5b4d['params']['id']}})['then'](handleEntityNotFound(_0x582571,null))[_0x2bc2('0x23')](saveUpdates(_0x3a5b4d[_0x2bc2('0x4a')],null))[_0x2bc2('0x23')](respondWithResult(_0x582571,null))[_0x2bc2('0x3d')](handleError(_0x582571,null));};exports[_0x2bc2('0x24')]=function(_0x9e266,_0x2796b5){return db[_0x2bc2('0x2d')][_0x2bc2('0x42')]({'where':{'id':_0x9e266['params']['id']}})[_0x2bc2('0x23')](handleEntityNotFound(_0x2796b5,null))[_0x2bc2('0x23')](removeEntity(_0x2796b5,null))[_0x2bc2('0x3d')](handleError(_0x2796b5,null));};exports[_0x2bc2('0x4b')]=function(_0x9baad9,_0xe22bfe){return db['CmCompany'][_0x2bc2('0x4b')]()['then'](respondWithResult(_0xe22bfe,null))['catch'](handleError(_0xe22bfe,null));};exports[_0x2bc2('0x4c')]=function(_0x4714af,_0x7ca9b3,_0x1944de){return db[_0x2bc2('0x4d')]['find']({'where':{'id':_0x4714af[_0x2bc2('0x4e')]['id']}})[_0x2bc2('0x23')](handleEntityNotFound(_0x7ca9b3,null))[_0x2bc2('0x23')](function(_0x268178){if(_0x268178){return _0x268178[_0x2bc2('0x4c')](_0x4714af[_0x2bc2('0x4a')]['ids'],_['omit'](_0x4714af[_0x2bc2('0x4a')],[_0x2bc2('0x4f'),'id'])||{});}})[_0x2bc2('0x23')](respondWithResult(_0x7ca9b3,null))[_0x2bc2('0x3d')](handleError(_0x7ca9b3,null));};exports[_0x2bc2('0x50')]=function(_0x5d41a6,_0xbabe64,_0x22c844){var _0x9f9a7a={};var _0x2c5a0e={};var _0x1eee1e;var _0x30e3c6;return db[_0x2bc2('0x2d')]['findOne']({'where':{'id':_0x5d41a6['params']['id']}})[_0x2bc2('0x23')](handleEntityNotFound(_0xbabe64,null))[_0x2bc2('0x23')](function(_0xc7c089){if(_0xc7c089){_0x1eee1e=_0xc7c089;_0x2c5a0e[_0x2bc2('0x2e')]=_[_0x2bc2('0x30')](db['CmContact'][_0x2bc2('0x3f')]);_0x2c5a0e['query']=_[_0x2bc2('0x30')](_0x5d41a6[_0x2bc2('0x2f')]);_0x2c5a0e['filters']=_['intersection'](_0x2c5a0e[_0x2bc2('0x2e')],_0x2c5a0e[_0x2bc2('0x2f')]);_0x9f9a7a[_0x2bc2('0x32')]=_[_0x2bc2('0x33')](_0x2c5a0e[_0x2bc2('0x2e')],qs[_0x2bc2('0x34')](_0x5d41a6['query'][_0x2bc2('0x34')]));_0x9f9a7a[_0x2bc2('0x32')]=_0x9f9a7a[_0x2bc2('0x32')][_0x2bc2('0x40')]?_0x9f9a7a[_0x2bc2('0x32')]:_0x2c5a0e[_0x2bc2('0x2e')];_0x9f9a7a[_0x2bc2('0x51')]=qs[_0x2bc2('0x36')](_0x5d41a6[_0x2bc2('0x2f')][_0x2bc2('0x36')]);_0x9f9a7a[_0x2bc2('0x37')]=qs['filters'](_['pick'](_0x5d41a6[_0x2bc2('0x2f')],_0x2c5a0e[_0x2bc2('0x31')]));if(_0x5d41a6[_0x2bc2('0x2f')][_0x2bc2('0x38')]){_0x9f9a7a[_0x2bc2('0x37')]=_[_0x2bc2('0x39')](_0x9f9a7a[_0x2bc2('0x37')],{'$or':_[_0x2bc2('0x52')](_0x9f9a7a['attributes'],function(_0x25d423){var _0x59aab7={};_0x59aab7[_0x25d423]={'$like':'%'+_0x5d41a6[_0x2bc2('0x2f')][_0x2bc2('0x38')]+'%'};return _0x59aab7;})});}_0x9f9a7a=_[_0x2bc2('0x39')]({},_0x9f9a7a,_0x5d41a6['options']);return _0x1eee1e[_0x2bc2('0x50')](_0x9f9a7a);}})['then'](function(_0x5d531f){if(_0x5d531f){_0x30e3c6=_0x5d531f[_0x2bc2('0x40')];if(!_0x5d41a6[_0x2bc2('0x2f')][_0x2bc2('0x53')](_0x2bc2('0x35'))){_0x9f9a7a[_0x2bc2('0x1d')]=qs['limit'](_0x5d41a6['query']['limit']);_0x9f9a7a[_0x2bc2('0x1f')]=qs['offset'](_0x5d41a6[_0x2bc2('0x2f')][_0x2bc2('0x1f')]);}return _0x1eee1e['getContacts'](_0x9f9a7a);}})[_0x2bc2('0x23')](function(_0x599fc5){if(_0x599fc5){return _0x599fc5?{'count':_0x30e3c6,'rows':_0x599fc5}:null;}})['then'](respondWithResult(_0xbabe64,null))[_0x2bc2('0x3d')](handleError(_0xbabe64,null));};
\ No newline at end of file
+var _0xf999=['find','catch','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','ids','omit','CmContact','map','getContacts','eml-format','rimraf','request-promise','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','includeAll','include','findAll','show','params','rawAttributes','merge'];(function(_0x5204e2,_0x29981c){var _0x5c51e9=function(_0x206ea1){while(--_0x206ea1){_0x5204e2['push'](_0x5204e2['shift']());}};_0x5c51e9(++_0x29981c);}(_0xf999,0x160));var _0x9f99=function(_0x5af480,_0xf286a2){_0x5af480=_0x5af480-0x0;var _0x50520f=_0xf999[_0x5af480];return _0x50520f;};'use strict';var emlformat=require(_0x9f99('0x0'));var rimraf=require(_0x9f99('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9f99('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9f99('0x3'));var util=require('util');var path=require('path');var sox=require(_0x9f99('0x4'));var csv=require(_0x9f99('0x5'));var ejs=require(_0x9f99('0x6'));var fs=require('fs');var fs_extra=require(_0x9f99('0x7'));var _=require(_0x9f99('0x8'));var squel=require(_0x9f99('0x9'));var crypto=require(_0x9f99('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x9f99('0xb'));var toCsv=require(_0x9f99('0x5'));var querystring=require(_0x9f99('0xc'));var Papa=require(_0x9f99('0xd'));var Redis=require(_0x9f99('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9f99('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9f99('0x10'));var logger=require(_0x9f99('0x11'))(_0x9f99('0x12'));var utils=require('../../config/utils');var config=require(_0x9f99('0x13'));var licenseUtil=require(_0x9f99('0x14'));var db=require(_0x9f99('0x15'))['db'];function respondWithStatusCode(_0x1b05ed,_0x443d20){_0x443d20=_0x443d20||0xcc;return function(_0x5332a1){if(_0x5332a1){return _0x1b05ed[_0x9f99('0x16')](_0x443d20);}return _0x1b05ed[_0x9f99('0x17')](_0x443d20)[_0x9f99('0x18')]();};}function respondWithResult(_0x34a754,_0x32d9bc){_0x32d9bc=_0x32d9bc||0xc8;return function(_0x4323e2){if(_0x4323e2){return _0x34a754[_0x9f99('0x17')](_0x32d9bc)[_0x9f99('0x19')](_0x4323e2);}};}function respondWithFilteredResult(_0x201eb7,_0xc4f1ed){return function(_0x5d5460){if(_0x5d5460){var _0x594d9b=typeof _0xc4f1ed[_0x9f99('0x1a')]===_0x9f99('0x1b')&&typeof _0xc4f1ed[_0x9f99('0x1c')]===_0x9f99('0x1b');var _0x172561=_0x5d5460[_0x9f99('0x1d')];var _0x22e090=_0x594d9b?0x0:_0xc4f1ed[_0x9f99('0x1a')];var _0x5ea2e9=_0x594d9b?_0x5d5460[_0x9f99('0x1d')]:_0xc4f1ed[_0x9f99('0x1a')]+_0xc4f1ed[_0x9f99('0x1c')];var _0x4ec6ec;if(_0x5ea2e9>=_0x172561){_0x5ea2e9=_0x172561;_0x4ec6ec=0xc8;}else{_0x4ec6ec=0xce;}_0x201eb7[_0x9f99('0x17')](_0x4ec6ec);return _0x201eb7['set'](_0x9f99('0x1e'),_0x22e090+'-'+_0x5ea2e9+'/'+_0x172561)[_0x9f99('0x19')](_0x5d5460);}return null;};}function patchUpdates(_0x4f1c18){return function(_0x3a50ef){try{jsonpatch['apply'](_0x3a50ef,_0x4f1c18,!![]);}catch(_0x22c6ac){return BPromise[_0x9f99('0x1f')](_0x22c6ac);}return _0x3a50ef['save']();};}function saveUpdates(_0x276412,_0x1b8975){return function(_0x2b155e){if(_0x2b155e){return _0x2b155e[_0x9f99('0x20')](_0x276412)[_0x9f99('0x21')](function(_0x27f977){return _0x27f977;});}return null;};}function removeEntity(_0x2ec325,_0xb0b42b){return function(_0x2aa9f4){if(_0x2aa9f4){return _0x2aa9f4[_0x9f99('0x22')]()[_0x9f99('0x21')](function(){var _0x419361=_0x2aa9f4[_0x9f99('0x23')]({'plain':!![]});var _0x5de981=_0x9f99('0x24');return db[_0x9f99('0x25')]['destroy']({'where':{'type':_0x5de981,'resourceId':_0x419361['id']}})[_0x9f99('0x21')](function(){return _0x2aa9f4;});})['then'](function(){_0x2ec325[_0x9f99('0x17')](0xcc)[_0x9f99('0x18')]();});}};}function handleEntityNotFound(_0x50a9c6,_0x3ebad7){return function(_0x1d31ac){if(!_0x1d31ac){_0x50a9c6[_0x9f99('0x16')](0x194);}return _0x1d31ac;};}function handleError(_0x499ed7,_0x81bc6d){_0x81bc6d=_0x81bc6d||0x1f4;return function(_0x47fd1f){logger[_0x9f99('0x26')](_0x47fd1f[_0x9f99('0x27')]);if(_0x47fd1f['name']){delete _0x47fd1f[_0x9f99('0x28')];}_0x499ed7[_0x9f99('0x17')](_0x81bc6d)[_0x9f99('0x29')](_0x47fd1f);};}exports[_0x9f99('0x2a')]=function(_0x46ef9d,_0x4a2c8d){var _0x36a8e3={},_0x4c86b3={},_0x1d9f12={'count':0x0,'rows':[]};return db[_0x9f99('0x2b')][_0x9f99('0x2c')]()[_0x9f99('0x21')](function(_0x28b59a){_0x4c86b3[_0x9f99('0x2d')]=_[_0x9f99('0x2e')](_0x28b59a);_0x4c86b3[_0x9f99('0x2f')]=_[_0x9f99('0x2e')](_0x46ef9d[_0x9f99('0x2f')]);_0x4c86b3[_0x9f99('0x30')]=_[_0x9f99('0x31')](_0x4c86b3[_0x9f99('0x2d')],_0x4c86b3['query']);_0x36a8e3[_0x9f99('0x32')]=_['intersection'](_0x4c86b3[_0x9f99('0x2d')],qs[_0x9f99('0x33')](_0x46ef9d['query']['fields']));_0x36a8e3[_0x9f99('0x32')]=_0x36a8e3[_0x9f99('0x32')][_0x9f99('0x34')]?_0x36a8e3['attributes']:_0x4c86b3['model'];if(!_0x46ef9d['query'][_0x9f99('0x35')](_0x9f99('0x36'))){_0x36a8e3['limit']=qs[_0x9f99('0x1c')](_0x46ef9d[_0x9f99('0x2f')][_0x9f99('0x1c')]);_0x36a8e3[_0x9f99('0x1a')]=qs[_0x9f99('0x1a')](_0x46ef9d['query'][_0x9f99('0x1a')]);}_0x36a8e3[_0x9f99('0x37')]=qs[_0x9f99('0x38')](_0x46ef9d['query'][_0x9f99('0x38')]);_0x36a8e3[_0x9f99('0x39')]=qs['filters'](_[_0x9f99('0x3a')](_0x46ef9d[_0x9f99('0x2f')],_0x4c86b3[_0x9f99('0x30')]),_0x28b59a);if(_0x46ef9d['query']['filter']){_0x36a8e3[_0x9f99('0x39')]=_['merge'](_0x36a8e3[_0x9f99('0x39')],{'$or':_['map'](_0x36a8e3[_0x9f99('0x32')],function(_0x2860d0){var _0x4a91c6={};_0x4a91c6[_0x2860d0]={'$like':'%'+_0x46ef9d[_0x9f99('0x2f')][_0x9f99('0x3b')]+'%'};return _0x4a91c6;})});}_0x36a8e3=_['merge']({},_0x36a8e3,_0x46ef9d[_0x9f99('0x3c')]);var _0x29c858={'where':_0x36a8e3[_0x9f99('0x39')]};return db[_0x9f99('0x2b')][_0x9f99('0x1d')](_0x29c858)['then'](function(_0x138839){_0x1d9f12['count']=_0x138839;if(_0x46ef9d[_0x9f99('0x2f')][_0x9f99('0x3d')]){_0x36a8e3[_0x9f99('0x3e')]=[{'all':!![]}];}return db[_0x9f99('0x2b')][_0x9f99('0x3f')](_0x36a8e3);})[_0x9f99('0x21')](function(_0x493512){_0x1d9f12['rows']=_0x493512;return _0x1d9f12;})[_0x9f99('0x21')](respondWithFilteredResult(_0x4a2c8d,_0x36a8e3))['catch'](handleError(_0x4a2c8d,null));})['catch'](handleError(_0x4a2c8d,null));};exports[_0x9f99('0x40')]=function(_0x4342cc,_0x293913){var _0x3ab2c0={'raw':![],'where':{'id':_0x4342cc[_0x9f99('0x41')]['id']}},_0x53933f={};_0x53933f[_0x9f99('0x2d')]=_[_0x9f99('0x2e')](db['CmCompany'][_0x9f99('0x42')]);_0x53933f[_0x9f99('0x2f')]=_[_0x9f99('0x2e')](_0x4342cc[_0x9f99('0x2f')]);_0x53933f[_0x9f99('0x30')]=_[_0x9f99('0x31')](_0x53933f[_0x9f99('0x2d')],_0x53933f[_0x9f99('0x2f')]);_0x3ab2c0[_0x9f99('0x32')]=_[_0x9f99('0x31')](_0x53933f[_0x9f99('0x2d')],qs[_0x9f99('0x33')](_0x4342cc['query']['fields']));_0x3ab2c0[_0x9f99('0x32')]=_0x3ab2c0[_0x9f99('0x32')][_0x9f99('0x34')]?_0x3ab2c0[_0x9f99('0x32')]:_0x53933f[_0x9f99('0x2d')];if(_0x4342cc['query']['includeAll']){_0x3ab2c0[_0x9f99('0x3e')]=[{'all':!![]}];}_0x3ab2c0=_[_0x9f99('0x43')]({},_0x3ab2c0,_0x4342cc[_0x9f99('0x3c')]);return db[_0x9f99('0x2b')][_0x9f99('0x44')](_0x3ab2c0)[_0x9f99('0x21')](handleEntityNotFound(_0x293913,null))[_0x9f99('0x21')](respondWithResult(_0x293913,null))[_0x9f99('0x45')](handleError(_0x293913,null));};exports['create']=function(_0x2dab81,_0x5ac698){return db['CmCompany']['create'](_0x2dab81['body'],{})[_0x9f99('0x21')](function(_0x46f691){var _0x1d8fa8=_0x2dab81[_0x9f99('0x46')][_0x9f99('0x23')]({'plain':!![]});if(!_0x1d8fa8)throw new Error(_0x9f99('0x47'));if(_0x1d8fa8[_0x9f99('0x48')]===_0x9f99('0x46')){var _0x551db5=_0x46f691[_0x9f99('0x23')]({'plain':!![]});var _0x5eb175=_0x9f99('0x24');return db[_0x9f99('0x49')][_0x9f99('0x44')]({'where':{'name':_0x5eb175,'userProfileId':_0x1d8fa8['userProfileId']},'raw':!![]})[_0x9f99('0x21')](function(_0x2a0069){if(_0x2a0069&&_0x2a0069[_0x9f99('0x4a')]===0x0){return db[_0x9f99('0x25')][_0x9f99('0x4b')]({'name':_0x551db5[_0x9f99('0x28')],'resourceId':_0x551db5['id'],'type':_0x2a0069['name'],'sectionId':_0x2a0069['id']},{})['then'](function(){return _0x46f691;});}else{return _0x46f691;}})[_0x9f99('0x45')](function(_0x343345){logger['error'](_0x9f99('0x4c'),_0x343345);throw _0x343345;});}return _0x46f691;})[_0x9f99('0x21')](respondWithResult(_0x5ac698,0xc9))[_0x9f99('0x45')](handleError(_0x5ac698,null));};exports[_0x9f99('0x20')]=function(_0x36bd25,_0x1a00a6){if(_0x36bd25[_0x9f99('0x4d')]['id']){delete _0x36bd25[_0x9f99('0x4d')]['id'];}return db['CmCompany'][_0x9f99('0x44')]({'where':{'id':_0x36bd25[_0x9f99('0x41')]['id']}})[_0x9f99('0x21')](handleEntityNotFound(_0x1a00a6,null))[_0x9f99('0x21')](saveUpdates(_0x36bd25[_0x9f99('0x4d')],null))[_0x9f99('0x21')](respondWithResult(_0x1a00a6,null))['catch'](handleError(_0x1a00a6,null));};exports[_0x9f99('0x22')]=function(_0x1c0366,_0x1f93da){return db[_0x9f99('0x2b')][_0x9f99('0x44')]({'where':{'id':_0x1c0366[_0x9f99('0x41')]['id']}})['then'](handleEntityNotFound(_0x1f93da,null))['then'](removeEntity(_0x1f93da,null))[_0x9f99('0x45')](handleError(_0x1f93da,null));};exports[_0x9f99('0x2c')]=function(_0x401aec,_0x5f037e){return db['CmCompany'][_0x9f99('0x2c')]()['then'](respondWithResult(_0x5f037e,null))[_0x9f99('0x45')](handleError(_0x5f037e,null));};exports['addContacts']=function(_0x2541d6,_0x4e3102,_0x2011ea){return db['CmContact'][_0x9f99('0x44')]({'where':{'id':_0x2541d6[_0x9f99('0x41')]['id']}})[_0x9f99('0x21')](handleEntityNotFound(_0x4e3102,null))[_0x9f99('0x21')](function(_0x190219){if(_0x190219){return _0x190219[_0x9f99('0x4e')](_0x2541d6[_0x9f99('0x4d')][_0x9f99('0x4f')],_[_0x9f99('0x50')](_0x2541d6[_0x9f99('0x4d')],[_0x9f99('0x4f'),'id'])||{});}})[_0x9f99('0x21')](respondWithResult(_0x4e3102,null))[_0x9f99('0x45')](handleError(_0x4e3102,null));};exports['getContacts']=function(_0x48140b,_0x69ea9,_0x24383f){var _0x15ca22={};var _0x4bbcb6={};var _0x2e88f8;var _0x40b194;return db['CmCompany']['findOne']({'where':{'id':_0x48140b[_0x9f99('0x41')]['id']}})['then'](handleEntityNotFound(_0x69ea9,null))['then'](function(_0x2572ac){if(_0x2572ac){_0x2e88f8=_0x2572ac;_0x4bbcb6[_0x9f99('0x2d')]=_['keys'](db[_0x9f99('0x51')][_0x9f99('0x42')]);_0x4bbcb6['query']=_[_0x9f99('0x2e')](_0x48140b[_0x9f99('0x2f')]);_0x4bbcb6[_0x9f99('0x30')]=_[_0x9f99('0x31')](_0x4bbcb6['model'],_0x4bbcb6['query']);_0x15ca22['attributes']=_[_0x9f99('0x31')](_0x4bbcb6['model'],qs[_0x9f99('0x33')](_0x48140b['query'][_0x9f99('0x33')]));_0x15ca22[_0x9f99('0x32')]=_0x15ca22[_0x9f99('0x32')][_0x9f99('0x34')]?_0x15ca22[_0x9f99('0x32')]:_0x4bbcb6['model'];_0x15ca22['order']=qs['sort'](_0x48140b[_0x9f99('0x2f')][_0x9f99('0x38')]);_0x15ca22['where']=qs[_0x9f99('0x30')](_['pick'](_0x48140b[_0x9f99('0x2f')],_0x4bbcb6['filters']));if(_0x48140b[_0x9f99('0x2f')][_0x9f99('0x3b')]){_0x15ca22[_0x9f99('0x39')]=_['merge'](_0x15ca22[_0x9f99('0x39')],{'$or':_[_0x9f99('0x52')](_0x15ca22[_0x9f99('0x32')],function(_0x35a13e){var _0x4c3250={};_0x4c3250[_0x35a13e]={'$like':'%'+_0x48140b['query'][_0x9f99('0x3b')]+'%'};return _0x4c3250;})});}_0x15ca22=_['merge']({},_0x15ca22,_0x48140b[_0x9f99('0x3c')]);return _0x2e88f8[_0x9f99('0x53')](_0x15ca22);}})['then'](function(_0x308dac){if(_0x308dac){_0x40b194=_0x308dac[_0x9f99('0x34')];if(!_0x48140b[_0x9f99('0x2f')][_0x9f99('0x35')](_0x9f99('0x36'))){_0x15ca22['limit']=qs[_0x9f99('0x1c')](_0x48140b[_0x9f99('0x2f')]['limit']);_0x15ca22[_0x9f99('0x1a')]=qs[_0x9f99('0x1a')](_0x48140b[_0x9f99('0x2f')][_0x9f99('0x1a')]);}return _0x2e88f8['getContacts'](_0x15ca22);}})[_0x9f99('0x21')](function(_0x44550d){if(_0x44550d){return _0x44550d?{'count':_0x40b194,'rows':_0x44550d}:null;}})[_0x9f99('0x21')](respondWithResult(_0x69ea9,null))[_0x9f99('0x45')](handleError(_0x69ea9,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index a3d2347..a5e1b21 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 _0x1d07=['CmCompany','lodash','util','api','bluebird','request-promise','path','./cmCompany.attributes','exports'];(function(_0x5da396,_0x3242cd){var _0x5928e2=function(_0x1d1716){while(--_0x1d1716){_0x5da396['push'](_0x5da396['shift']());}};_0x5928e2(++_0x3242cd);}(_0x1d07,0x184));var _0x71d0=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x1d07[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require(_0x71d0('0x0'));var util=require(_0x71d0('0x1'));var logger=require('../../config/logger')(_0x71d0('0x2'));var moment=require('moment');var BPromise=require(_0x71d0('0x3'));var rp=require(_0x71d0('0x4'));var fs=require('fs');var path=require(_0x71d0('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x71d0('0x6'));module[_0x71d0('0x7')]=function(_0x3b685c,_0x25b9fd){return _0x3b685c['define'](_0x71d0('0x8'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xad99=['CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./cmCompany.attributes'];(function(_0x2f9a4a,_0x93573e){var _0x1529f7=function(_0x206bfe){while(--_0x206bfe){_0x2f9a4a['push'](_0x2f9a4a['shift']());}};_0x1529f7(++_0x93573e);}(_0xad99,0xd3));var _0x9ad9=function(_0x475a8,_0x589d16){_0x475a8=_0x475a8-0x0;var _0x224501=_0xad99[_0x475a8];return _0x224501;};'use strict';var _=require(_0x9ad9('0x0'));var util=require(_0x9ad9('0x1'));var logger=require(_0x9ad9('0x2'))(_0x9ad9('0x3'));var moment=require(_0x9ad9('0x4'));var BPromise=require('bluebird');var rp=require(_0x9ad9('0x5'));var fs=require('fs');var path=require(_0x9ad9('0x6'));var rimraf=require(_0x9ad9('0x7'));var config=require('../../config/environment');var attributes=require(_0x9ad9('0x8'));module['exports']=function(_0x5c4027,_0x317e0a){return _0x5c4027['define'](_0x9ad9('0x9'),attributes,{'tableName':_0x9ad9('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 66686d5..62abe30 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 _0x4292=['http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client'];(function(_0x6a0c92,_0x241b17){var _0x546bb3=function(_0x1937d1){while(--_0x1937d1){_0x6a0c92['push'](_0x6a0c92['shift']());}};_0x546bb3(++_0x241b17);}(_0x4292,0x1b0));var _0x2429=function(_0x33e314,_0x43532){_0x33e314=_0x33e314-0x0;var _0x54a323=_0x4292[_0x33e314];return _0x54a323;};'use strict';var _=require(_0x2429('0x0'));var util=require('util');var moment=require(_0x2429('0x1'));var BPromise=require('bluebird');var rs=require(_0x2429('0x2'));var fs=require('fs');var Redis=require(_0x2429('0x3'));var db=require(_0x2429('0x4'))['db'];var utils=require(_0x2429('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2429('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2429('0x7')][_0x2429('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1f68e3,_0x299251,_0x466c2f){return new BPromise(function(_0x4ca88d,_0x1c9980){return client[_0x2429('0x9')](_0x1f68e3,_0x466c2f)[_0x2429('0xa')](function(_0x53d1b5){logger[_0x2429('0xb')](_0x2429('0xc'),_0x299251,_0x2429('0xd'));logger[_0x2429('0xe')](_0x2429('0xf'),_0x299251,_0x2429('0xd'),JSON[_0x2429('0x10')](_0x53d1b5));if(_0x53d1b5[_0x2429('0x11')]){if(_0x53d1b5[_0x2429('0x11')][_0x2429('0x12')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x299251,_0x53d1b5[_0x2429('0x11')][_0x2429('0x13')]);return _0x1c9980(_0x53d1b5[_0x2429('0x11')][_0x2429('0x13')]);}logger[_0x2429('0x11')](_0x2429('0xc'),_0x299251,_0x53d1b5[_0x2429('0x11')][_0x2429('0x13')]);return _0x4ca88d(_0x53d1b5[_0x2429('0x11')][_0x2429('0x13')]);}else{logger[_0x2429('0xb')](_0x2429('0xc'),_0x299251,_0x2429('0xd'));_0x4ca88d(_0x53d1b5[_0x2429('0x14')][_0x2429('0x13')]);}})[_0x2429('0x15')](function(_0xc59ae1){logger[_0x2429('0x11')](_0x2429('0xc'),_0x299251,_0xc59ae1);_0x1c9980(_0xc59ae1);});});}
\ No newline at end of file
+var _0x7ec1=['info','CmCompany,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then'];(function(_0x4ba4de,_0x5294d3){var _0x161c98=function(_0x334d44){while(--_0x334d44){_0x4ba4de['push'](_0x4ba4de['shift']());}};_0x161c98(++_0x5294d3);}(_0x7ec1,0x1d0));var _0x17ec=function(_0x292f12,_0x525719){_0x292f12=_0x292f12-0x0;var _0x1171a0=_0x7ec1[_0x292f12];return _0x1171a0;};'use strict';var _=require('lodash');var util=require(_0x17ec('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x17ec('0x1'));var fs=require('fs');var Redis=require(_0x17ec('0x2'));var db=require(_0x17ec('0x3'))['db'];var utils=require(_0x17ec('0x4'));var logger=require(_0x17ec('0x5'))(_0x17ec('0x6'));var config=require(_0x17ec('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x17ec('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36b509,_0x182ed6,_0x96f65d){return new BPromise(function(_0x570f78,_0x9b1da2){return client[_0x17ec('0x9')](_0x36b509,_0x96f65d)[_0x17ec('0xa')](function(_0xe4c24e){logger[_0x17ec('0xb')](_0x17ec('0xc'),_0x182ed6,_0x17ec('0xd'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x182ed6,_0x17ec('0xd'),JSON[_0x17ec('0xe')](_0xe4c24e));if(_0xe4c24e['error']){if(_0xe4c24e[_0x17ec('0xf')][_0x17ec('0x10')]===0x1f4){logger['error'](_0x17ec('0xc'),_0x182ed6,_0xe4c24e[_0x17ec('0xf')][_0x17ec('0x11')]);return _0x9b1da2(_0xe4c24e[_0x17ec('0xf')]['message']);}logger['error'](_0x17ec('0xc'),_0x182ed6,_0xe4c24e[_0x17ec('0xf')][_0x17ec('0x11')]);return _0x570f78(_0xe4c24e[_0x17ec('0xf')]['message']);}else{logger[_0x17ec('0xb')](_0x17ec('0xc'),_0x182ed6,_0x17ec('0xd'));_0x570f78(_0xe4c24e['result']['message']);}})[_0x17ec('0x12')](function(_0xadcee4){logger[_0x17ec('0xf')](_0x17ec('0xc'),_0x182ed6,_0xadcee4);_0x9b1da2(_0xadcee4);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 7ee7005..9d8909f 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 _0x24cd=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','update'];(function(_0x12137b,_0x368aa4){var _0x2ec2b3=function(_0x3b0faf){while(--_0x3b0faf){_0x12137b['push'](_0x12137b['shift']());}};_0x2ec2b3(++_0x368aa4);}(_0x24cd,0x17a));var _0xd24c=function(_0x4dc9e6,_0x3ed04a){_0x4dc9e6=_0x4dc9e6-0x0;var _0x4bbdcb=_0x24cd[_0x4dc9e6];return _0x4bbdcb;};'use strict';var multer=require('multer');var util=require(_0xd24c('0x0'));var path=require(_0xd24c('0x1'));var timeout=require(_0xd24c('0x2'));var express=require(_0xd24c('0x3'));var router=express[_0xd24c('0x4')]();var fs_extra=require(_0xd24c('0x5'));var auth=require(_0xd24c('0x6'));var interaction=require(_0xd24c('0x7'));var config=require(_0xd24c('0x8'));var controller=require(_0xd24c('0x9'));router[_0xd24c('0xa')]('/',auth[_0xd24c('0xb')](),controller[_0xd24c('0xc')]);router[_0xd24c('0xa')]('/describe',auth[_0xd24c('0xb')](),controller[_0xd24c('0xd')]);router[_0xd24c('0xa')](_0xd24c('0xe'),auth['isAuthenticated'](),controller[_0xd24c('0xf')]);router[_0xd24c('0xa')](_0xd24c('0x10'),auth[_0xd24c('0xb')](),controller[_0xd24c('0x11')]);router[_0xd24c('0x12')]('/',auth[_0xd24c('0xb')](),controller[_0xd24c('0x13')]);router[_0xd24c('0x12')](_0xd24c('0x10'),auth[_0xd24c('0xb')](),controller[_0xd24c('0x14')]);router['put'](_0xd24c('0xe'),auth[_0xd24c('0xb')](),controller[_0xd24c('0x15')]);router[_0xd24c('0x16')]('/:id',auth[_0xd24c('0xb')](),controller[_0xd24c('0x17')]);module[_0xd24c('0x18')]=router;
\ No newline at end of file
+var _0xbcec=['/describe','isAuthenticated','/:id','show','getContacts','post','create','/:id/contacts','addContacts','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmCompany.controller','get'];(function(_0x537ef7,_0x1bd866){var _0x603c2e=function(_0x5a1cfa){while(--_0x5a1cfa){_0x537ef7['push'](_0x537ef7['shift']());}};_0x603c2e(++_0x1bd866);}(_0xbcec,0xbd));var _0xcbce=function(_0x84a97e,_0x59f2f2){_0x84a97e=_0x84a97e-0x0;var _0x3f980b=_0xbcec[_0x84a97e];return _0x3f980b;};'use strict';var multer=require('multer');var util=require(_0xcbce('0x0'));var path=require(_0xcbce('0x1'));var timeout=require(_0xcbce('0x2'));var express=require(_0xcbce('0x3'));var router=express[_0xcbce('0x4')]();var fs_extra=require(_0xcbce('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcbce('0x6'));var config=require('../../config/environment');var controller=require(_0xcbce('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xcbce('0x8')](_0xcbce('0x9'),auth[_0xcbce('0xa')](),controller['describe']);router[_0xcbce('0x8')](_0xcbce('0xb'),auth[_0xcbce('0xa')](),controller[_0xcbce('0xc')]);router[_0xcbce('0x8')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xcbce('0xd')]);router[_0xcbce('0xe')]('/',auth[_0xcbce('0xa')](),controller[_0xcbce('0xf')]);router['post'](_0xcbce('0x10'),auth[_0xcbce('0xa')](),controller[_0xcbce('0x11')]);router[_0xcbce('0x12')](_0xcbce('0xb'),auth[_0xcbce('0xa')](),controller[_0xcbce('0x13')]);router[_0xcbce('0x14')](_0xcbce('0xb'),auth[_0xcbce('0xa')](),controller[_0xcbce('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index dab212c..ff69cc5 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 _0x6195=['STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports'];(function(_0x7ce51e,_0x251618){var _0xfd7e9a=function(_0x4a0b27){while(--_0x4a0b27){_0x7ce51e['push'](_0x7ce51e['shift']());}};_0xfd7e9a(++_0x251618);}(_0x6195,0xf9));var _0x5619=function(_0x3a5061,_0x17cb02){_0x3a5061=_0x3a5061-0x0;var _0x310beb=_0x6195[_0x3a5061];return _0x310beb;};'use strict';var _=require(_0x5619('0x0'));var Sequelize=require(_0x5619('0x1'));module[_0x5619('0x2')]={'firstName':{'type':Sequelize[_0x5619('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x5619('0x3')]},'street':{'type':Sequelize[_0x5619('0x3')]},'postalCode':{'type':Sequelize[_0x5619('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x5619('0x3')]},'dateOfBirth':{'type':Sequelize[_0x5619('0x3')]},'description':{'type':Sequelize[_0x5619('0x4')]},'phone':{'type':Sequelize[_0x5619('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x5619('0x3')]},'email':{'type':Sequelize[_0x5619('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x5619('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x5619('0x3')]},'wechat':{'type':Sequelize[_0x5619('0x3')]},'telegram':{'type':Sequelize[_0x5619('0x3')]},'UserId':{'type':Sequelize[_0x5619('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x5619('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x5619('0x7')],'defaultValue':Sequelize[_0x5619('0x8')]}};
\ No newline at end of file
+var _0x6bbc=['INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING','TEXT'];(function(_0x19671a,_0x456e1e){var _0x33b179=function(_0xc26cc0){while(--_0xc26cc0){_0x19671a['push'](_0x19671a['shift']());}};_0x33b179(++_0x456e1e);}(_0x6bbc,0x1bd));var _0xc6bb=function(_0x485d47,_0x323593){_0x485d47=_0x485d47-0x0;var _0x342cb0=_0x6bbc[_0x485d47];return _0x342cb0;};'use strict';var _=require(_0xc6bb('0x0'));var Sequelize=require(_0xc6bb('0x1'));module[_0xc6bb('0x2')]={'firstName':{'type':Sequelize[_0xc6bb('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xc6bb('0x3')]},'street':{'type':Sequelize[_0xc6bb('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xc6bb('0x3')]},'country':{'type':Sequelize[_0xc6bb('0x3')]},'dateOfBirth':{'type':Sequelize[_0xc6bb('0x3')]},'description':{'type':Sequelize[_0xc6bb('0x4')]},'phone':{'type':Sequelize[_0xc6bb('0x3')]},'mobile':{'type':Sequelize[_0xc6bb('0x3')]},'fax':{'type':Sequelize[_0xc6bb('0x3')]},'email':{'type':Sequelize[_0xc6bb('0x3')]},'url':{'type':Sequelize[_0xc6bb('0x3')]},'facebook':{'type':Sequelize[_0xc6bb('0x3')]},'fb_data':{'type':Sequelize[_0xc6bb('0x3')]},'twitter':{'type':Sequelize[_0xc6bb('0x3')]},'skype':{'type':Sequelize[_0xc6bb('0x3')]},'teams':{'type':Sequelize[_0xc6bb('0x3')]},'viber':{'type':Sequelize[_0xc6bb('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xc6bb('0x3')]},'telegram':{'type':Sequelize[_0xc6bb('0x3')]},'UserId':{'type':Sequelize[_0xc6bb('0x5')]},'priority':{'type':Sequelize[_0xc6bb('0x5')](0x2)[_0xc6bb('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xc6bb('0x7')],'defaultValue':Sequelize[_0xc6bb('0x8')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index f9eaf34..1b8f39b 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 _0x03fc=['Tags','push','rows','catch','destroy','find','params','describe','cf_','columnName','displayName','values','merge','body','get','tags','join','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','bulkCreate','each','duplicates','ListId','spread','$and','CmCustomField','findAll','omit','format','cf_%d','pickBy','table','cm_contacts','setFields','id\x20=\x20?','toParam','phone','CmHopper','rawAttributes','options','getTags','setTags','ids','getHoppers','ContactId','includeAll','include','getHopperHistories','getHopperFinals','CmHopperFinal','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','filename','chmodSync','0777','fork','CompanyId','File\x20uploaded\x20correctly!','createReadStream','parse','meta','import','binding','stringify','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','mail','chat','sms','openchannel','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','callerid','starttime','endtime','note','createdAt','userDisposition','userSecondDisposition','UserId','fullname','alias','startCase','Website','disposition','Account','browserName','customerIp','customerPort','deviceModel','osName','ratingType','referer','subject','substatus','Interaction','findAndCountAll','Owner','flatten','sortBy','slice','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./cmContact.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','error','stack','name','send','index','keys','length','startsWith','findOne','trimStart','all','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','pick','select','field','color','from','tools_tags','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','expr','parseSearch','sqlOperator','conditions','Tag','value','split','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','fieldType','castTo','buildExpression','text','Contact','isEmpty','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','filter','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','QueryTypes','SELECT','clone','order','DESC','having','t.id\x20IN\x20?','resolve','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','map','toString','keyBy','CmContact','c.id','c.firstName','c.lastName','c.phone','c.mobile','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x03fc,0x96));var _0xc03f=function(_0x450576,_0x27d6c6){_0x450576=_0x450576-0x0;var _0x49013e=_0x03fc[_0x450576];return _0x49013e;};'use strict';var emlformat=require(_0xc03f('0x0'));var rimraf=require(_0xc03f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc03f('0x2'));var rp=require(_0xc03f('0x3'));var moment=require(_0xc03f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc03f('0x5'));var util=require('util');var path=require(_0xc03f('0x6'));var sox=require(_0xc03f('0x7'));var csv=require('to-csv');var ejs=require(_0xc03f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc03f('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc03f('0xa'));var deskjs=require(_0xc03f('0xb'));var toCsv=require(_0xc03f('0xc'));var querystring=require(_0xc03f('0xd'));var Papa=require('papaparse');var Redis=require(_0xc03f('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc03f('0xf'));var as=require(_0xc03f('0x10'));var hardwareService=require(_0xc03f('0x11'));var logger=require('../../config/logger')(_0xc03f('0x12'));var utils=require('../../config/utils');var config=require(_0xc03f('0x13'));var licenseUtil=require(_0xc03f('0x14'));var db=require(_0xc03f('0x15'))['db'];config['redis']=_[_0xc03f('0x16')](config[_0xc03f('0x17')],{'host':_0xc03f('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc03f('0x17')]));require(_0xc03f('0x19'))[_0xc03f('0x1a')](socket);function respondWithStatusCode(_0x113ccd,_0xdda846){_0xdda846=_0xdda846||0xcc;return function(_0x445776){if(_0x445776){return _0x113ccd[_0xc03f('0x1b')](_0xdda846);}return _0x113ccd[_0xc03f('0x1c')](_0xdda846)[_0xc03f('0x1d')]();};}function respondWithResult(_0x11e667,_0x410012){_0x410012=_0x410012||0xc8;return function(_0x3f19ac){if(_0x3f19ac){return _0x11e667[_0xc03f('0x1c')](_0x410012)['json'](_0x3f19ac);}};}function respondWithFilteredResult(_0x30fcf1,_0x355927){return function(_0xb9e0a5){if(_0xb9e0a5){var _0x9bedee=typeof _0x355927[_0xc03f('0x1e')]==='undefined'&&typeof _0x355927['limit']===_0xc03f('0x1f');var _0x565602=_0xb9e0a5['count'];var _0x307c99=_0x9bedee?0x0:_0x355927[_0xc03f('0x1e')];var _0x21568b=_0x9bedee?_0xb9e0a5[_0xc03f('0x20')]:_0x355927[_0xc03f('0x1e')]+_0x355927[_0xc03f('0x21')];var _0x540769;if(_0x21568b>=_0x565602){_0x21568b=_0x565602;_0x540769=0xc8;}else{_0x540769=0xce;}_0x30fcf1[_0xc03f('0x1c')](_0x540769);return _0x30fcf1[_0xc03f('0x22')](_0xc03f('0x23'),_0x307c99+'-'+_0x21568b+'/'+_0x565602)[_0xc03f('0x24')](_0xb9e0a5);}return null;};}function patchUpdates(_0x4936bc){return function(_0x312bae){try{jsonpatch[_0xc03f('0x25')](_0x312bae,_0x4936bc,!![]);}catch(_0x3e1680){return BPromise[_0xc03f('0x26')](_0x3e1680);}return _0x312bae[_0xc03f('0x27')]();};}function saveUpdates(_0x25dad3,_0x32a5a5){return function(_0x401036){if(_0x401036){return _0x401036['update'](_0x25dad3)['then'](function(_0x3be9a9){return _0x3be9a9;});}return null;};}function removeEntity(_0x331d31,_0x65d0b){return function(_0x2847f){if(_0x2847f){return _0x2847f['destroy']()[_0xc03f('0x28')](function(){_0x331d31['status'](0xcc)[_0xc03f('0x1d')]();});}};}function handleEntityNotFound(_0x30a5d1,_0x2d14bb){return function(_0x3972fa){if(!_0x3972fa){_0x30a5d1[_0xc03f('0x1b')](0x194);}return _0x3972fa;};}function handleError(_0x374077,_0x134c84){_0x134c84=_0x134c84||0x1f4;return function(_0x23ba79){logger[_0xc03f('0x29')](_0x23ba79[_0xc03f('0x2a')]);if(_0x23ba79['name']){delete _0x23ba79[_0xc03f('0x2b')];}_0x374077[_0xc03f('0x1c')](_0x134c84)[_0xc03f('0x2c')](_0x23ba79);};}exports[_0xc03f('0x2d')]=function(_0x503852,_0x487b58){var _0x17143e={},_0x482b65={},_0x4465a1={'count':0x0,'rows':[]};return db['CmContact']['describe']()[_0xc03f('0x28')](function(_0x58a679){var _0x31dbdb=[];for(var _0x573f15=0x0;_0x573f15
','Attachments','Data','gmail','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','util','../../../config/logger','head','address','anonymous','generate','@xcally.com','value','name','substring','indexOf','split','length','join','Anonymous','pop','isEmpty','html','test','includes','0x1?_0x2ca6f0['slice'](0x0,-0x1)[_0x807e('0x10')]('\x20'):_0x31f652[_0x807e('0xb')];}return _0x807e('0x11');}function getLastName(_0x19e72f){var _0x2ce562=_[_0x807e('0x5')](_0x19e72f[_0x807e('0xa')]);if(_0x2ce562&&_0x2ce562['name']){var _0x51355b=_0x2ce562[_0x807e('0xb')][_0x807e('0xe')](/\s+/);return _0x51355b[_0x807e('0xf')]>0x1?_0x51355b[_0x807e('0x12')]():'';}return'';}function getMails(_0x5800b9,_0x13b760){var _0x367913='';for(var _0x1ffc81=0x0;_0x1ffc81<_0x13b760[_0x807e('0xa')][_0x807e('0xf')];_0x1ffc81+=0x1){if(_0x13b760[_0x807e('0xa')][_0x1ffc81]['address']!==_0x5800b9){if(!_[_0x807e('0x13')](_0x367913)){_0x367913+=',';}_0x367913+=_0x13b760['value'][_0x1ffc81][_0x807e('0xb')]||_0x13b760[_0x807e('0xa')][_0x1ffc81][_0x807e('0x6')]||'';_0x367913+='\x20<';_0x367913+=_0x13b760[_0x807e('0xa')][_0x1ffc81][_0x807e('0x6')]?_0x13b760[_0x807e('0xa')][_0x1ffc81][_0x807e('0x6')]:_0x807e('0x7')+random[_0x807e('0x8')](0x6)+'@xcally.com';_0x367913+='>';}}return _0x367913;}function parseEmail(_0x5ca377,_0x415eaa,_0x23db10){if(_0x415eaa[_0x807e('0x14')]){var _0x42358e=/