From: Cris Di Sclafani
Date: Mon, 12 Jul 2021 13:27:24 +0000 (+0200)
Subject: Built motion from commit (unavailable).|2.5.31
X-Git-Url: http://repos.xcallymotion.com/base//%22https:/www.w3.org/TR/wai-aria-practices?a=commitdiff_plain;h=8e3d4cbde319aaa1d6c0cdc1590569f27806fdb5;p=motion2.git
Built motion from commit (unavailable).|2.5.31
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 941283a..283034a 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-07-09T13:40:47.044Z",
+ "time": "2021-07-12T13:18:32.483Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 8af26e3..aa84dcf 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-07-09T13:40:47.044Z",
+ "time": "2021-07-12T13:18:32.483Z",
"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 45f1f4c..56ec48a 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 _0x25f4=['sequelize','exports','VIRTUAL','getDataValue','STRING','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','TEXT'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x25f4,0xe0));var _0x425f=function(_0x5c74fc,_0x9617df){_0x5c74fc=_0x5c74fc-0x0;var _0x1dd063=_0x25f4[_0x5c74fc];return _0x1dd063;};'use strict';var Sequelize=require(_0x425f('0x0'));module[_0x425f('0x1')]={'name':{'type':Sequelize[_0x425f('0x2')],'get':function(_0x42d387){return this[_0x425f('0x3')]('action');}},'action':{'type':Sequelize[_0x425f('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x425f('0x5'),_0x425f('0x6'),_0x425f('0x7'),_0x425f('0x8'),_0x425f('0x9'),_0x425f('0xa'),_0x425f('0xb')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x425f('0xc')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x425f('0xd')},'data2':{'type':Sequelize[_0x425f('0x4')](0x1000),'comment':_0x425f('0xe')},'data3':{'type':Sequelize[_0x425f('0x4')](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize[_0x425f('0x4')](0x1000)},'data5':{'type':Sequelize[_0x425f('0x4')](0x1000)},'data6':{'type':Sequelize[_0x425f('0x4')]},'data7':{'type':Sequelize[_0x425f('0xf')]}};
\ No newline at end of file
+var _0x4dfe=['motionbar','jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','getDataValue','action','STRING','contactManager','integration'];(function(_0x2f8296,_0x50308b){var _0x1300d7=function(_0x338ba0){while(--_0x338ba0){_0x2f8296['push'](_0x2f8296['shift']());}};_0x1300d7(++_0x50308b);}(_0x4dfe,0x19e));var _0xe4df=function(_0xd98c2e,_0x3a23e7){_0xd98c2e=_0xd98c2e-0x0;var _0x1d06c8=_0x4dfe[_0xd98c2e];return _0x1d06c8;};'use strict';var Sequelize=require(_0xe4df('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1acbc5){return this[_0xe4df('0x1')](_0xe4df('0x2'));}},'action':{'type':Sequelize[_0xe4df('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xe4df('0x4'),_0xe4df('0x5'),_0xe4df('0x6'),_0xe4df('0x7'),_0xe4df('0x8'),_0xe4df('0x9'),'bot',_0xe4df('0xa')]],'msg':_0xe4df('0xb')}},'comment':_0xe4df('0xb')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize[_0xe4df('0x3')](0x1000),'comment':_0xe4df('0xc')},'data3':{'type':Sequelize[_0xe4df('0x3')](0x1000),'comment':_0xe4df('0xd')},'data4':{'type':Sequelize[_0xe4df('0x3')](0x1000)},'data5':{'type':Sequelize[_0xe4df('0x3')](0x1000)},'data6':{'type':Sequelize[_0xe4df('0x3')]},'data7':{'type':Sequelize[_0xe4df('0xe')]}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index b1cf3fd..1533fa2 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 _0x4a3a=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','offset','undefined','count','apply','reject','save','update','then','stack','name','render','merge','body','contact','interaction','account','params','catch','destroy','Action','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x3c64dc,_0x4c829f){var _0x4ee9d5=function(_0xffd463){while(--_0xffd463){_0x3c64dc['push'](_0x3c64dc['shift']());}};_0x4ee9d5(++_0x4c829f);}(_0x4a3a,0x140));var _0xa4a3=function(_0x5e257c,_0x1df417){_0x5e257c=_0x5e257c-0x0;var _0x33821d=_0x4a3a[_0x5e257c];return _0x33821d;};'use strict';var emlformat=require(_0xa4a3('0x0'));var rimraf=require(_0xa4a3('0x1'));var zipdir=require(_0xa4a3('0x2'));var jsonpatch=require(_0xa4a3('0x3'));var rp=require(_0xa4a3('0x4'));var moment=require('moment');var BPromise=require(_0xa4a3('0x5'));var Mustache=require('mustache');var util=require(_0xa4a3('0x6'));var path=require('path');var sox=require(_0xa4a3('0x7'));var csv=require(_0xa4a3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa4a3('0x9'));var _=require(_0xa4a3('0xa'));var squel=require(_0xa4a3('0xb'));var crypto=require(_0xa4a3('0xc'));var jsforce=require(_0xa4a3('0xd'));var deskjs=require(_0xa4a3('0xe'));var toCsv=require(_0xa4a3('0x8'));var querystring=require(_0xa4a3('0xf'));var Papa=require(_0xa4a3('0x10'));var Redis=require(_0xa4a3('0x11'));var authService=require(_0xa4a3('0x12'));var qs=require(_0xa4a3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa4a3('0x14'));var logger=require(_0xa4a3('0x15'))('api');var utils=require(_0xa4a3('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa4a3('0x17'))['db'];function respondWithStatusCode(_0x2bfc0b,_0xe073b6){_0xe073b6=_0xe073b6||0xcc;return function(_0x1118ec){if(_0x1118ec){return _0x2bfc0b['sendStatus'](_0xe073b6);}return _0x2bfc0b[_0xa4a3('0x18')](_0xe073b6)[_0xa4a3('0x19')]();};}function respondWithResult(_0x476b62,_0x3d092d){_0x3d092d=_0x3d092d||0xc8;return function(_0x24e0c3){if(_0x24e0c3){return _0x476b62[_0xa4a3('0x18')](_0x3d092d)[_0xa4a3('0x1a')](_0x24e0c3);}};}function respondWithFilteredResult(_0x2b378d,_0x1b3ace){return function(_0x55966a){if(_0x55966a){var _0x40b0a5=typeof _0x1b3ace[_0xa4a3('0x1b')]===_0xa4a3('0x1c')&&typeof _0x1b3ace['limit']===_0xa4a3('0x1c');var _0x42696a=_0x55966a[_0xa4a3('0x1d')];var _0x35e6e4=_0x40b0a5?0x0:_0x1b3ace[_0xa4a3('0x1b')];var _0x1d9342=_0x40b0a5?_0x55966a['count']:_0x1b3ace['offset']+_0x1b3ace['limit'];var _0xe49d88;if(_0x1d9342>=_0x42696a){_0x1d9342=_0x42696a;_0xe49d88=0xc8;}else{_0xe49d88=0xce;}_0x2b378d['status'](_0xe49d88);return _0x2b378d['set']('Content-Range',_0x35e6e4+'-'+_0x1d9342+'/'+_0x42696a)[_0xa4a3('0x1a')](_0x55966a);}return null;};}function patchUpdates(_0x4afc76){return function(_0x257c8a){try{jsonpatch[_0xa4a3('0x1e')](_0x257c8a,_0x4afc76,!![]);}catch(_0x272539){return BPromise[_0xa4a3('0x1f')](_0x272539);}return _0x257c8a[_0xa4a3('0x20')]();};}function saveUpdates(_0x48c53e,_0xc34496){return function(_0x319fb8){if(_0x319fb8){return _0x319fb8[_0xa4a3('0x21')](_0x48c53e)['then'](function(_0x27bcc4){return _0x27bcc4;});}return null;};}function removeEntity(_0x455855,_0x115f57){return function(_0x7455ad){if(_0x7455ad){return _0x7455ad['destroy']()[_0xa4a3('0x22')](function(){_0x455855[_0xa4a3('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38c7a9,_0x36cbd8){return function(_0x5073e9){if(!_0x5073e9){_0x38c7a9['sendStatus'](0x194);}return _0x5073e9;};}function handleError(_0x3a056a,_0x2b1f2b){_0x2b1f2b=_0x2b1f2b||0x1f4;return function(_0x21baf8){logger['error'](_0x21baf8[_0xa4a3('0x23')]);if(_0x21baf8[_0xa4a3('0x24')]){delete _0x21baf8['name'];}_0x3a056a[_0xa4a3('0x18')](_0x2b1f2b)['send'](_0x21baf8);};}function getMustacheRender(_0x3b97fd,_0x45cb98){return Mustache[_0xa4a3('0x25')](_0x3b97fd,_[_0xa4a3('0x26')](_0x45cb98[_0xa4a3('0x27')],{'contact':_0x45cb98[_0xa4a3('0x28')],'message':_0x45cb98['message'],'agent':_0x45cb98['agent'],'interaction':_0x45cb98[_0xa4a3('0x29')],'account':_0x45cb98[_0xa4a3('0x2a')]}))||'';}exports['update']=function(_0x5ab91a,_0x4414ce){if(_0x5ab91a['body']['id']){delete _0x5ab91a[_0xa4a3('0x27')]['id'];}return db['Action']['find']({'where':{'id':_0x5ab91a[_0xa4a3('0x2b')]['id']}})[_0xa4a3('0x22')](handleEntityNotFound(_0x4414ce,null))[_0xa4a3('0x22')](saveUpdates(_0x5ab91a[_0xa4a3('0x27')],null))[_0xa4a3('0x22')](respondWithResult(_0x4414ce,null))[_0xa4a3('0x2c')](handleError(_0x4414ce,null));};exports[_0xa4a3('0x2d')]=function(_0x6b143b,_0x3a0e7c){return db[_0xa4a3('0x2e')][_0xa4a3('0x2f')]({'where':{'id':_0x6b143b['params']['id']}})[_0xa4a3('0x22')](handleEntityNotFound(_0x3a0e7c,null))[_0xa4a3('0x22')](removeEntity(_0x3a0e7c,null))[_0xa4a3('0x2c')](handleError(_0x3a0e7c,null));};
\ No newline at end of file
+var _0x559a=['../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','apply','reject','save','update','destroy','end','error','stack','name','render','merge','contact','message','agent','account','body','Action','find','params','then','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils'];(function(_0x4de560,_0x2c8ace){var _0x1aa979=function(_0x4366e6){while(--_0x4366e6){_0x4de560['push'](_0x4de560['shift']());}};_0x1aa979(++_0x2c8ace);}(_0x559a,0xb3));var _0xa559=function(_0x445c05,_0x3618b0){_0x445c05=_0x445c05-0x0;var _0xb30ecf=_0x559a[_0x445c05];return _0xb30ecf;};'use strict';var emlformat=require(_0xa559('0x0'));var rimraf=require(_0xa559('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa559('0x2'));var rp=require(_0xa559('0x3'));var moment=require(_0xa559('0x4'));var BPromise=require(_0xa559('0x5'));var Mustache=require(_0xa559('0x6'));var util=require(_0xa559('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xa559('0x8'));var ejs=require(_0xa559('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa559('0xa'));var squel=require(_0xa559('0xb'));var crypto=require('crypto');var jsforce=require(_0xa559('0xc'));var deskjs=require(_0xa559('0xd'));var toCsv=require(_0xa559('0x8'));var querystring=require(_0xa559('0xe'));var Papa=require('papaparse');var Redis=require(_0xa559('0xf'));var authService=require(_0xa559('0x10'));var qs=require(_0xa559('0x11'));var as=require(_0xa559('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa559('0x13'));var utils=require(_0xa559('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa559('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x442e26,_0x5f0463){_0x5f0463=_0x5f0463||0xcc;return function(_0x2a646e){if(_0x2a646e){return _0x442e26[_0xa559('0x16')](_0x5f0463);}return _0x442e26[_0xa559('0x17')](_0x5f0463)['end']();};}function respondWithResult(_0xe93c61,_0x3853fd){_0x3853fd=_0x3853fd||0xc8;return function(_0x5ed915){if(_0x5ed915){return _0xe93c61[_0xa559('0x17')](_0x3853fd)[_0xa559('0x18')](_0x5ed915);}};}function respondWithFilteredResult(_0x369d26,_0x1e48b3){return function(_0x539a4b){if(_0x539a4b){var _0x309c27=typeof _0x1e48b3['offset']===_0xa559('0x19')&&typeof _0x1e48b3[_0xa559('0x1a')]==='undefined';var _0x2c6993=_0x539a4b[_0xa559('0x1b')];var _0x163405=_0x309c27?0x0:_0x1e48b3[_0xa559('0x1c')];var _0x1a4c42=_0x309c27?_0x539a4b[_0xa559('0x1b')]:_0x1e48b3[_0xa559('0x1c')]+_0x1e48b3[_0xa559('0x1a')];var _0x329d59;if(_0x1a4c42>=_0x2c6993){_0x1a4c42=_0x2c6993;_0x329d59=0xc8;}else{_0x329d59=0xce;}_0x369d26[_0xa559('0x17')](_0x329d59);return _0x369d26['set']('Content-Range',_0x163405+'-'+_0x1a4c42+'/'+_0x2c6993)[_0xa559('0x18')](_0x539a4b);}return null;};}function patchUpdates(_0x3aa532){return function(_0x47cb65){try{jsonpatch[_0xa559('0x1d')](_0x47cb65,_0x3aa532,!![]);}catch(_0x190a9e){return BPromise[_0xa559('0x1e')](_0x190a9e);}return _0x47cb65[_0xa559('0x1f')]();};}function saveUpdates(_0x1812ef,_0x2dd8cf){return function(_0x572046){if(_0x572046){return _0x572046[_0xa559('0x20')](_0x1812ef)['then'](function(_0x1d4370){return _0x1d4370;});}return null;};}function removeEntity(_0x396fe9,_0x314fef){return function(_0x487a60){if(_0x487a60){return _0x487a60[_0xa559('0x21')]()['then'](function(){_0x396fe9[_0xa559('0x17')](0xcc)[_0xa559('0x22')]();});}};}function handleEntityNotFound(_0x5834c6,_0x2a5181){return function(_0x552c2c){if(!_0x552c2c){_0x5834c6['sendStatus'](0x194);}return _0x552c2c;};}function handleError(_0x1581b9,_0x1914e7){_0x1914e7=_0x1914e7||0x1f4;return function(_0x3fcf7f){logger[_0xa559('0x23')](_0x3fcf7f[_0xa559('0x24')]);if(_0x3fcf7f[_0xa559('0x25')]){delete _0x3fcf7f[_0xa559('0x25')];}_0x1581b9[_0xa559('0x17')](_0x1914e7)['send'](_0x3fcf7f);};}function getMustacheRender(_0x11a3d2,_0x30a781){return Mustache[_0xa559('0x26')](_0x11a3d2,_[_0xa559('0x27')](_0x30a781['body'],{'contact':_0x30a781[_0xa559('0x28')],'message':_0x30a781[_0xa559('0x29')],'agent':_0x30a781[_0xa559('0x2a')],'interaction':_0x30a781['interaction'],'account':_0x30a781[_0xa559('0x2b')]}))||'';}exports[_0xa559('0x20')]=function(_0xd0481e,_0x469a4e){if(_0xd0481e[_0xa559('0x2c')]['id']){delete _0xd0481e[_0xa559('0x2c')]['id'];}return db[_0xa559('0x2d')][_0xa559('0x2e')]({'where':{'id':_0xd0481e[_0xa559('0x2f')]['id']}})['then'](handleEntityNotFound(_0x469a4e,null))[_0xa559('0x30')](saveUpdates(_0xd0481e[_0xa559('0x2c')],null))[_0xa559('0x30')](respondWithResult(_0x469a4e,null))[_0xa559('0x31')](handleError(_0x469a4e,null));};exports['destroy']=function(_0x2b6eeb,_0x5e9389){return db[_0xa559('0x2d')][_0xa559('0x2e')]({'where':{'id':_0x2b6eeb[_0xa559('0x2f')]['id']}})[_0xa559('0x30')](handleEntityNotFound(_0x5e9389,null))[_0xa559('0x30')](removeEntity(_0x5e9389,null))[_0xa559('0x31')](handleError(_0x5e9389,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 436a9e2..1e042e8 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 _0x68ba=['define','Action','tools_actions','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./action.attributes','exports'];(function(_0x43dc7e,_0x49a390){var _0x21e12d=function(_0x15cc1a){while(--_0x15cc1a){_0x43dc7e['push'](_0x43dc7e['shift']());}};_0x21e12d(++_0x49a390);}(_0x68ba,0x6b));var _0xa68b=function(_0x9d14e3,_0x5a6072){_0x9d14e3=_0x9d14e3-0x0;var _0x19bf32=_0x68ba[_0x9d14e3];return _0x19bf32;};'use strict';var _=require(_0xa68b('0x0'));var util=require(_0xa68b('0x1'));var logger=require(_0xa68b('0x2'))('api');var moment=require(_0xa68b('0x3'));var BPromise=require(_0xa68b('0x4'));var rp=require(_0xa68b('0x5'));var fs=require('fs');var path=require(_0xa68b('0x6'));var rimraf=require(_0xa68b('0x7'));var config=require('../../config/environment');var attributes=require(_0xa68b('0x8'));module[_0xa68b('0x9')]=function(_0x2e5eea,_0x30474f){return _0x2e5eea[_0xa68b('0xa')](_0xa68b('0xb'),attributes,{'tableName':_0xa68b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0258=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','Action','lodash','util'];(function(_0x18546c,_0x4daf94){var _0x46ef43=function(_0x559377){while(--_0x559377){_0x18546c['push'](_0x18546c['shift']());}};_0x46ef43(++_0x4daf94);}(_0x0258,0x82));var _0x8025=function(_0x40b8bd,_0x45e5c1){_0x40b8bd=_0x40b8bd-0x0;var _0x19c510=_0x0258[_0x40b8bd];return _0x19c510;};'use strict';var _=require(_0x8025('0x0'));var util=require(_0x8025('0x1'));var logger=require(_0x8025('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8025('0x3'));var rp=require(_0x8025('0x4'));var fs=require('fs');var path=require(_0x8025('0x5'));var rimraf=require(_0x8025('0x6'));var config=require(_0x8025('0x7'));var attributes=require(_0x8025('0x8'));module[_0x8025('0x9')]=function(_0x35305e,_0x189327){return _0x35305e['define'](_0x8025('0xa'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 77523e1..5f08290 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 _0xb7e7=['Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x1cc458,_0x5edc40){var _0x3e0dc=function(_0x400348){while(--_0x400348){_0x1cc458['push'](_0x1cc458['shift']());}};_0x3e0dc(++_0x5edc40);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xb7e7[_0x4b2863];return _0x567d67;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('Action,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\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(_0x5e2936,_0x4c2f47){var _0x3cfc5a=function(_0x3962a2){while(--_0x3962a2){_0x5e2936['push'](_0x5e2936['shift']());}};_0x3cfc5a(++_0x4c2f47);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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/action/index.js b/server/api/action/index.js
index 6ff7dd1..6b99b07 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 _0xc12d=['exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id','isAuthenticated','update','delete'];(function(_0x2cf8d3,_0x545a19){var _0x17a79d=function(_0x33f9fd){while(--_0x33f9fd){_0x2cf8d3['push'](_0x2cf8d3['shift']());}};_0x17a79d(++_0x545a19);}(_0xc12d,0x1e2));var _0xdc12=function(_0x16d321,_0x1a3de6){_0x16d321=_0x16d321-0x0;var _0x5a1e15=_0xc12d[_0x16d321];return _0x5a1e15;};'use strict';var multer=require(_0xdc12('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdc12('0x1'));var express=require('express');var router=express[_0xdc12('0x2')]();var fs_extra=require(_0xdc12('0x3'));var auth=require(_0xdc12('0x4'));var interaction=require(_0xdc12('0x5'));var config=require('../../config/environment');var controller=require(_0xdc12('0x6'));router[_0xdc12('0x7')](_0xdc12('0x8'),auth[_0xdc12('0x9')](),controller[_0xdc12('0xa')]);router[_0xdc12('0xb')](_0xdc12('0x8'),auth[_0xdc12('0x9')](),controller['destroy']);module[_0xdc12('0xc')]=router;
\ No newline at end of file
+var _0xdab2=['multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports'];(function(_0x1616ee,_0x308f00){var _0x347134=function(_0x1e1801){while(--_0x1e1801){_0x1616ee['push'](_0x1616ee['shift']());}};_0x347134(++_0x308f00);}(_0xdab2,0x130));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2dab('0x0'));var util=require(_0x2dab('0x1'));var path=require('path');var timeout=require(_0x2dab('0x2'));var express=require(_0x2dab('0x3'));var router=express[_0x2dab('0x4')]();var fs_extra=require(_0x2dab('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2dab('0x6'));var config=require(_0x2dab('0x7'));var controller=require(_0x2dab('0x8'));router[_0x2dab('0x9')](_0x2dab('0xa'),auth[_0x2dab('0xb')](),controller[_0x2dab('0xc')]);router[_0x2dab('0xd')](_0x2dab('0xa'),auth[_0x2dab('0xb')](),controller[_0x2dab('0xe')]);module[_0x2dab('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 7fb05be..5bb7669 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 _0xcfef=['STRING','TEXT','sequelize','exports'];(function(_0x4b80fb,_0x435f51){var _0x21d929=function(_0x791ca8){while(--_0x791ca8){_0x4b80fb['push'](_0x4b80fb['shift']());}};_0x21d929(++_0x435f51);}(_0xcfef,0x12e));var _0xfcfe=function(_0x359994,_0x45527b){_0x359994=_0x359994-0x0;var _0x3e0575=_0xcfef[_0x359994];return _0x3e0575;};'use strict';var Sequelize=require(_0xfcfe('0x0'));module[_0xfcfe('0x1')]={'name':{'type':Sequelize[_0xfcfe('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xfcfe('0x2')]},'table':{'type':Sequelize[_0xfcfe('0x2')]},'conditions':{'type':Sequelize[_0xfcfe('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x330d=['sequelize','STRING'];(function(_0x818c70,_0x706bbe){var _0x466a06=function(_0x2d1f06){while(--_0x2d1f06){_0x818c70['push'](_0x818c70['shift']());}};_0x466a06(++_0x706bbe);}(_0x330d,0x8e));var _0xd330=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x330d[_0xfa634c];return _0x73e478;};'use strict';var Sequelize=require(_0xd330('0x0'));module['exports']={'name':{'type':Sequelize[_0xd330('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd330('0x1')]},'parent':{'type':Sequelize[_0xd330('0x1')]},'table':{'type':Sequelize[_0xd330('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index d62e3be..3a5f1c4 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 _0x5cbe=['replace','function','format','orderBy','DESC','alias','joins','foreignTable','foreignKey','parentKey','conditions','debug','sequelize','toString','QueryTypes','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','IS\x20EMPTY','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','groupBy','parse','%s.%s\x20=\x20%s.%s','clone','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','fork','../../files/reports','savename','COUNT(*)','SELECT','run','IS\x20NULL','IS\x20NOT\x20EMPTY','Sequelize','Limited\x20Query:','eml-format','rimraf','zip-dir','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','get','CustomReports','UserProfileResource','destroy','sendStatus','error','stack','name','send','render','body','agent','account','index','map','AnalyticCustomReport','rawAttributes','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','getFields','AnalyticMetric','from','table','MetricId','metric'];(function(_0x35592d,_0x139db7){var _0x3315bf=function(_0x445848){while(--_0x445848){_0x35592d['push'](_0x35592d['shift']());}};_0x3315bf(++_0x139db7);}(_0x5cbe,0xdd));var _0xe5cb=function(_0x154691,_0x1a205a){_0x154691=_0x154691-0x0;var _0x4de432=_0x5cbe[_0x154691];return _0x4de432;};'use strict';var emlformat=require(_0xe5cb('0x0'));var rimraf=require(_0xe5cb('0x1'));var zipdir=require(_0xe5cb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe5cb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe5cb('0x4'));var util=require(_0xe5cb('0x5'));var path=require('path');var sox=require(_0xe5cb('0x6'));var csv=require(_0xe5cb('0x7'));var ejs=require(_0xe5cb('0x8'));var fs=require('fs');var fs_extra=require(_0xe5cb('0x9'));var _=require(_0xe5cb('0xa'));var squel=require('squel');var crypto=require(_0xe5cb('0xb'));var jsforce=require(_0xe5cb('0xc'));var deskjs=require(_0xe5cb('0xd'));var toCsv=require(_0xe5cb('0x7'));var querystring=require(_0xe5cb('0xe'));var Papa=require(_0xe5cb('0xf'));var Redis=require('ioredis');var authService=require(_0xe5cb('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe5cb('0x11'));var hardwareService=require(_0xe5cb('0x12'));var logger=require(_0xe5cb('0x13'))(_0xe5cb('0x14'));var utils=require('../../config/utils');var config=require(_0xe5cb('0x15'));var licenseUtil=require(_0xe5cb('0x16'));var db=require('../../mysqldb')['db'];var dbH=require(_0xe5cb('0x17'))[_0xe5cb('0x18')];function respondWithStatusCode(_0x412cea,_0x13a7d4){_0x13a7d4=_0x13a7d4||0xcc;return function(_0x5ad97a){if(_0x5ad97a){return _0x412cea['sendStatus'](_0x13a7d4);}return _0x412cea[_0xe5cb('0x19')](_0x13a7d4)[_0xe5cb('0x1a')]();};}function respondWithResult(_0x14b240,_0x540060){_0x540060=_0x540060||0xc8;return function(_0x421743){if(_0x421743){return _0x14b240[_0xe5cb('0x19')](_0x540060)[_0xe5cb('0x1b')](_0x421743);}};}function respondWithFilteredResult(_0x3de278,_0x1704ef){return function(_0x3cafec){if(_0x3cafec){var _0x5e1b99=typeof _0x1704ef['offset']===_0xe5cb('0x1c')&&typeof _0x1704ef[_0xe5cb('0x1d')]===_0xe5cb('0x1c');var _0x356b2d=_0x3cafec[_0xe5cb('0x1e')];var _0x26d178=_0x5e1b99?0x0:_0x1704ef['offset'];var _0x14f0a7=_0x5e1b99?_0x3cafec[_0xe5cb('0x1e')]:_0x1704ef[_0xe5cb('0x1f')]+_0x1704ef[_0xe5cb('0x1d')];var _0x4f9054;if(_0x14f0a7>=_0x356b2d){_0x14f0a7=_0x356b2d;_0x4f9054=0xc8;}else{_0x4f9054=0xce;}_0x3de278[_0xe5cb('0x19')](_0x4f9054);return _0x3de278['set'](_0xe5cb('0x20'),_0x26d178+'-'+_0x14f0a7+'/'+_0x356b2d)[_0xe5cb('0x1b')](_0x3cafec);}return null;};}function patchUpdates(_0x22bc17){return function(_0x184f18){try{jsonpatch[_0xe5cb('0x21')](_0x184f18,_0x22bc17,!![]);}catch(_0x47f051){return BPromise['reject'](_0x47f051);}return _0x184f18[_0xe5cb('0x22')]();};}function saveUpdates(_0x457622,_0x4713e4){return function(_0x2bd1bd){if(_0x2bd1bd){return _0x2bd1bd[_0xe5cb('0x23')](_0x457622)[_0xe5cb('0x24')](function(_0x4188c1){return _0x4188c1;});}return null;};}function removeEntity(_0xed464,_0xea5461){return function(_0x445de6){if(_0x445de6){return _0x445de6['destroy']()[_0xe5cb('0x24')](function(){var _0x4c527c=_0x445de6[_0xe5cb('0x25')]({'plain':!![]});var _0x51c2ca=_0xe5cb('0x26');return db[_0xe5cb('0x27')][_0xe5cb('0x28')]({'where':{'type':_0x51c2ca,'resourceId':_0x4c527c['id']}})[_0xe5cb('0x24')](function(){return _0x445de6;});})[_0xe5cb('0x24')](function(){_0xed464['status'](0xcc)[_0xe5cb('0x1a')]();});}};}function handleEntityNotFound(_0x284bda,_0x1ffd1a){return function(_0x142d33){if(!_0x142d33){_0x284bda[_0xe5cb('0x29')](0x194);}return _0x142d33;};}function handleError(_0x1650d6,_0x5b3324){_0x5b3324=_0x5b3324||0x1f4;return function(_0x41845b){logger[_0xe5cb('0x2a')](_0x41845b[_0xe5cb('0x2b')]);if(_0x41845b[_0xe5cb('0x2c')]){delete _0x41845b[_0xe5cb('0x2c')];}_0x1650d6[_0xe5cb('0x19')](_0x5b3324)[_0xe5cb('0x2d')](_0x41845b);};}function getMustacheRender(_0x1b6e86,_0x6b3d86){return Mustache[_0xe5cb('0x2e')](_0x1b6e86,_['merge'](_0x6b3d86[_0xe5cb('0x2f')],{'contact':_0x6b3d86['contact'],'message':_0x6b3d86['message'],'agent':_0x6b3d86[_0xe5cb('0x30')],'interaction':_0x6b3d86['interaction'],'account':_0x6b3d86[_0xe5cb('0x31')]}))||'';}exports[_0xe5cb('0x32')]=function(_0x241227,_0x3f1752){var _0x871686={},_0x1c285c={},_0x39719d={'count':0x0,'rows':[]};var _0x37f3fc=_[_0xe5cb('0x33')](db[_0xe5cb('0x34')][_0xe5cb('0x35')],function(_0x12b661){return{'name':_0x12b661['fieldName'],'type':_0x12b661[_0xe5cb('0x36')]['key']};});_0x1c285c[_0xe5cb('0x37')]=_[_0xe5cb('0x33')](_0x37f3fc,_0xe5cb('0x2c'));_0x1c285c['query']=_['keys'](_0x241227[_0xe5cb('0x38')]);_0x1c285c[_0xe5cb('0x39')]=_['intersection'](_0x1c285c[_0xe5cb('0x37')],_0x1c285c['query']);_0x871686['attributes']=_[_0xe5cb('0x3a')](_0x1c285c['model'],qs[_0xe5cb('0x3b')](_0x241227[_0xe5cb('0x38')][_0xe5cb('0x3b')]));_0x871686[_0xe5cb('0x3c')]=_0x871686['attributes'][_0xe5cb('0x3d')]?_0x871686[_0xe5cb('0x3c')]:_0x1c285c[_0xe5cb('0x37')];if(!_0x241227[_0xe5cb('0x38')][_0xe5cb('0x3e')](_0xe5cb('0x3f'))){_0x871686[_0xe5cb('0x1d')]=qs[_0xe5cb('0x1d')](_0x241227['query'][_0xe5cb('0x1d')]);_0x871686[_0xe5cb('0x1f')]=qs['offset'](_0x241227[_0xe5cb('0x38')]['offset']);}_0x871686[_0xe5cb('0x40')]=qs[_0xe5cb('0x41')](_0x241227[_0xe5cb('0x38')][_0xe5cb('0x41')]);_0x871686[_0xe5cb('0x42')]=qs[_0xe5cb('0x39')](_[_0xe5cb('0x43')](_0x241227[_0xe5cb('0x38')],_0x1c285c[_0xe5cb('0x39')]),_0x37f3fc);if(_0x241227[_0xe5cb('0x38')][_0xe5cb('0x44')]){_0x871686[_0xe5cb('0x42')]=_[_0xe5cb('0x45')](_0x871686[_0xe5cb('0x42')],{'$or':_[_0xe5cb('0x33')](_0x37f3fc,function(_0x1f8528){if(_0x1f8528[_0xe5cb('0x36')]!==_0xe5cb('0x46')){var _0x674e11={};_0x674e11[_0x1f8528['name']]={'$like':'%'+_0x241227[_0xe5cb('0x38')][_0xe5cb('0x44')]+'%'};return _0x674e11;}})});}_0x871686=_[_0xe5cb('0x45')]({},_0x871686,_0x241227[_0xe5cb('0x47')]);var _0x31e725={'where':_0x871686[_0xe5cb('0x42')]};return db[_0xe5cb('0x34')][_0xe5cb('0x1e')](_0x31e725)[_0xe5cb('0x24')](function(_0x5cbbb9){_0x39719d[_0xe5cb('0x1e')]=_0x5cbbb9;if(_0x241227[_0xe5cb('0x38')][_0xe5cb('0x48')]){_0x871686[_0xe5cb('0x49')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xe5cb('0x4a')](_0x871686);})[_0xe5cb('0x24')](function(_0x586b8c){_0x39719d[_0xe5cb('0x4b')]=_0x586b8c;return _0x39719d;})[_0xe5cb('0x24')](respondWithFilteredResult(_0x3f1752,_0x871686))[_0xe5cb('0x4c')](handleError(_0x3f1752,null));};exports[_0xe5cb('0x4d')]=function(_0x20ae32,_0x514d08){var _0x11465c={'raw':![],'where':{'id':_0x20ae32[_0xe5cb('0x4e')]['id']}},_0x33cb62={};_0x33cb62[_0xe5cb('0x37')]=_['keys'](db['AnalyticCustomReport'][_0xe5cb('0x35')]);_0x33cb62[_0xe5cb('0x38')]=_[_0xe5cb('0x4f')](_0x20ae32['query']);_0x33cb62['filters']=_[_0xe5cb('0x3a')](_0x33cb62[_0xe5cb('0x37')],_0x33cb62['query']);_0x11465c[_0xe5cb('0x3c')]=_[_0xe5cb('0x3a')](_0x33cb62['model'],qs[_0xe5cb('0x3b')](_0x20ae32[_0xe5cb('0x38')][_0xe5cb('0x3b')]));_0x11465c['attributes']=_0x11465c[_0xe5cb('0x3c')][_0xe5cb('0x3d')]?_0x11465c['attributes']:_0x33cb62[_0xe5cb('0x37')];if(_0x20ae32[_0xe5cb('0x38')]['includeAll']){_0x11465c[_0xe5cb('0x49')]=[{'all':!![]}];}_0x11465c=_[_0xe5cb('0x45')]({},_0x11465c,_0x20ae32[_0xe5cb('0x47')]);return db[_0xe5cb('0x34')][_0xe5cb('0x50')](_0x11465c)['then'](handleEntityNotFound(_0x514d08,null))[_0xe5cb('0x24')](respondWithResult(_0x514d08,null))[_0xe5cb('0x4c')](handleError(_0x514d08,null));};exports[_0xe5cb('0x51')]=function(_0x549a21,_0x54b40a){return db[_0xe5cb('0x34')][_0xe5cb('0x51')](_0x549a21[_0xe5cb('0x2f')],{})[_0xe5cb('0x24')](function(_0x24e596){var _0x396c5f=_0x549a21[_0xe5cb('0x52')]['get']({'plain':!![]});if(!_0x396c5f)throw new Error(_0xe5cb('0x53'));if(_0x396c5f['role']===_0xe5cb('0x52')){var _0x3dd158=_0x24e596[_0xe5cb('0x25')]({'plain':!![]});var _0x8d343d=_0xe5cb('0x54');return db[_0xe5cb('0x55')][_0xe5cb('0x50')]({'where':{'name':_0x8d343d,'userProfileId':_0x396c5f[_0xe5cb('0x56')]},'raw':!![]})['then'](function(_0x165a41){if(_0x165a41&&_0x165a41[_0xe5cb('0x57')]===0x0){return db[_0xe5cb('0x27')][_0xe5cb('0x51')]({'name':_0x3dd158[_0xe5cb('0x2c')],'resourceId':_0x3dd158['id'],'type':_0xe5cb('0x26'),'sectionId':_0x165a41['id']},{})['then'](function(){return _0x24e596;});}else{return _0x24e596;}})[_0xe5cb('0x4c')](function(_0x43de93){logger[_0xe5cb('0x2a')](_0xe5cb('0x58'),_0x43de93);throw _0x43de93;});}return _0x24e596;})['then'](respondWithResult(_0x54b40a,0xc9))[_0xe5cb('0x4c')](handleError(_0x54b40a,null));};exports[_0xe5cb('0x23')]=function(_0x353a75,_0x3efe3b){if(_0x353a75[_0xe5cb('0x2f')]['id']){delete _0x353a75['body']['id'];}return db[_0xe5cb('0x34')][_0xe5cb('0x50')]({'where':{'id':_0x353a75[_0xe5cb('0x4e')]['id']}})[_0xe5cb('0x24')](handleEntityNotFound(_0x3efe3b,null))['then'](saveUpdates(_0x353a75[_0xe5cb('0x2f')],null))[_0xe5cb('0x24')](respondWithResult(_0x3efe3b,null))[_0xe5cb('0x4c')](handleError(_0x3efe3b,null));};exports[_0xe5cb('0x28')]=function(_0x5ffbf4,_0x31f851){return db[_0xe5cb('0x34')][_0xe5cb('0x50')]({'where':{'id':_0x5ffbf4[_0xe5cb('0x4e')]['id']}})[_0xe5cb('0x24')](handleEntityNotFound(_0x31f851,null))[_0xe5cb('0x24')](removeEntity(_0x31f851,null))[_0xe5cb('0x4c')](handleError(_0x31f851,null));};exports[_0xe5cb('0x59')]=function(_0x39c82f,_0xe0a963){var _0x22e744=0xa;var _0x1a7c0e=[_0xe5cb('0x5a'),_0xe5cb('0x5b'),_0xe5cb('0x5c'),_0xe5cb('0x5d')];var _0x57e70b={'SUM':'SUM(%s)','COUNT':_0xe5cb('0x5e'),'COUNT DISTINCT':_0xe5cb('0x5f'),'MAX':_0xe5cb('0x60'),'MIN':_0xe5cb('0x61'),'AVG':_0xe5cb('0x62'),'GROUP_CONCAT':_0xe5cb('0x63'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe5cb('0x64')};var _0x4eb125={'SEC_TO_TIME':_0xe5cb('0x65'),'DATE':'DATE(%s)','HOUR':_0xe5cb('0x66'),'ROUND':_0xe5cb('0x67'),'UNIX_TIMESTAMP':_0xe5cb('0x68')};var _0x3e2db2=function(_0x5e96c1){return!_[_0xe5cb('0x69')](['IS\x20NULL',_0xe5cb('0x6a'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x5e96c1);};var _0x1dca86=function(_0x2fabff){if(!_0x2fabff||!_0x2fabff[_0xe5cb('0x6b')][_0xe5cb('0x3d')]){return'';}for(var _0x2528a1='(',_0x5c45e4=0x0;_0x5c45e4<_0x2fabff[_0xe5cb('0x6b')][_0xe5cb('0x3d')];_0x5c45e4+=0x1){_0x5c45e4>0x0&&(_0x2528a1+='\x20'+_0x2fabff[_0xe5cb('0x6c')]+'\x20');_0x2528a1+=_0x2fabff[_0xe5cb('0x6b')][_0x5c45e4][_0xe5cb('0x6d')]?_0x1dca86(_0x2fabff[_0xe5cb('0x6b')][_0x5c45e4][_0xe5cb('0x6d')]):_0x2fabff['rules'][_0x5c45e4][_0xe5cb('0x6e')]+'\x20'+_0x2fabff[_0xe5cb('0x6b')][_0x5c45e4][_0xe5cb('0x6f')]+(_0x3e2db2(_0x2fabff['rules'][_0x5c45e4][_0xe5cb('0x6f')])?'\x20'+_0x2fabff[_0xe5cb('0x6b')][_0x5c45e4][_0xe5cb('0x70')]:'');}return _0x2528a1+')';};var _0x431dc3={'where':{'id':_0x39c82f[_0xe5cb('0x4e')]['id']}},_0x29b10a,_0x2602d4,_0x24147a,_0xd924a,_0x256a20;_0x431dc3=_[_0xe5cb('0x45')]({},_0x431dc3,_0x39c82f['options']);return db[_0xe5cb('0x34')][_0xe5cb('0x50')](_0x431dc3)[_0xe5cb('0x24')](function(_0x5167df){if(_0x5167df){_0x29b10a=_0x5167df;return _0x5167df[_0xe5cb('0x71')]();}return null;})[_0xe5cb('0x24')](function(_0x98a796){if(_0x98a796){if(!_0x98a796['length']){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2602d4=_0x98a796;return db[_0xe5cb('0x72')][_0xe5cb('0x4a')]({'raw':!![]});}return null;})['then'](function(_0x1da6fd){if(_0x1da6fd){_0x24147a=_['keyBy'](_0x1da6fd,'id');var _0x2e163e;var _0x53bcbf=squel['select']();_0x53bcbf[_0xe5cb('0x73')](_0x29b10a[_0xe5cb('0x74')]);for(var _0x151c1d=0x0;_0x151c1d<_0x2602d4[_0xe5cb('0x3d')];_0x151c1d+=0x1){_0x2e163e=_0x2602d4[_0x151c1d][_0xe5cb('0x75')]?_0x24147a[_0x2602d4[_0x151c1d][_0xe5cb('0x75')]][_0xe5cb('0x76')]:_0x2602d4[_0x151c1d]['field'];_0x2e163e=_0x2602d4[_0x151c1d]['function']?_[_0xe5cb('0x77')](_0x57e70b[_0x2602d4[_0x151c1d][_0xe5cb('0x78')]],'%s',_0x2e163e):_0x2e163e;_0x2e163e=_0x2602d4[_0x151c1d][_0xe5cb('0x79')]?_[_0xe5cb('0x77')](_0x4eb125[_0x2602d4[_0x151c1d]['format']],'%s',_0x2e163e):_0x2e163e;if(_0x2602d4[_0x151c1d]['groupBy']){_0x53bcbf[_0xe5cb('0x6d')](_0x2e163e);}_0x2602d4[_0x151c1d][_0xe5cb('0x7a')]&&_0x53bcbf[_0xe5cb('0x40')](_0x2e163e,_0x2602d4[_0x151c1d][_0xe5cb('0x7a')]===_0xe5cb('0x7b')?![]:!![]);_0x53bcbf[_0xe5cb('0x6e')](_0x2e163e,_0x2602d4[_0x151c1d][_0xe5cb('0x7c')]||_0x2e163e);}if(_0x29b10a[_0xe5cb('0x7d')]){_0x29b10a[_0xe5cb('0x7d')]=JSON['parse'](_0x29b10a[_0xe5cb('0x7d')]);for(var _0x22bac0=0x0;_0x22bac0<_0x29b10a['joins'][_0xe5cb('0x3d')];_0x22bac0+=0x1){if(_0x29b10a[_0xe5cb('0x7d')][_0x22bac0][_0xe5cb('0x36')]&&_[_0xe5cb('0x69')](_0x1a7c0e,_0x29b10a[_0xe5cb('0x7d')][_0x22bac0]['type'])&&_0x29b10a['joins'][_0x22bac0]['parentKey']&&_0x29b10a[_0xe5cb('0x7d')][_0x22bac0][_0xe5cb('0x7e')]&&_0x29b10a[_0xe5cb('0x7d')][_0x22bac0][_0xe5cb('0x7f')]){_0x53bcbf[_0x29b10a[_0xe5cb('0x7d')][_0x22bac0][_0xe5cb('0x36')]](_0x29b10a[_0xe5cb('0x7d')][_0x22bac0][_0xe5cb('0x7e')],null,util[_0xe5cb('0x79')]('%s.%s\x20=\x20%s.%s',_0x29b10a[_0xe5cb('0x74')],_0x29b10a[_0xe5cb('0x7d')][_0x22bac0][_0xe5cb('0x80')],_0x29b10a[_0xe5cb('0x7d')][_0x22bac0][_0xe5cb('0x7e')],_0x29b10a['joins'][_0x22bac0][_0xe5cb('0x7f')]));}}}if(_0x29b10a[_0xe5cb('0x81')]){_0x29b10a[_0xe5cb('0x81')]=JSON['parse'](_0x29b10a[_0xe5cb('0x81')]);_0x53bcbf[_0xe5cb('0x42')](_0x1dca86(_0x29b10a['conditions']['group']));}_0x256a20=_0x53bcbf['clone']();_0x53bcbf[_0xe5cb('0x1d')](_0x22e744);_0x53bcbf[_0xe5cb('0x1f')](0x0);logger[_0xe5cb('0x82')]('Limited\x20Query:',_0x53bcbf['toString']());return dbH[_0xe5cb('0x83')]['query'](_0x53bcbf[_0xe5cb('0x84')](),{'type':dbH['sequelize'][_0xe5cb('0x85')]['SELECT']});}})[_0xe5cb('0x24')](respondWithResult(_0xe0a963,null))[_0xe5cb('0x4c')](handleError(_0xe0a963,null));};function runReport(_0x11b55c,_0x36e0f3,_0x1c3ee8){var _0x305452=_0x36e0f3[_0xe5cb('0x2c')];var _0x2916ae=0xa;var _0x3a4bf6=[_0xe5cb('0x5a'),_0xe5cb('0x5b'),_0xe5cb('0x5c'),_0xe5cb('0x5d')];var _0x51a7d4={'SUM':_0xe5cb('0x86'),'COUNT':_0xe5cb('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xe5cb('0x61'),'AVG':_0xe5cb('0x62'),'GROUP_CONCAT':_0xe5cb('0x63'),'GROUP_CONCAT ASC':_0xe5cb('0x87'),'GROUP_CONCAT DESC':_0xe5cb('0x64')};var _0x55464c={'SEC_TO_TIME':_0xe5cb('0x65'),'DATE':_0xe5cb('0x88'),'HOUR':'HOUR(%s)','ROUND':_0xe5cb('0x67'),'UNIX_TIMESTAMP':_0xe5cb('0x68')};var _0x23d39b=function(_0x2807ec){return!_[_0xe5cb('0x69')](['IS\x20NULL',_0xe5cb('0x6a'),_0xe5cb('0x89'),'IS\x20NOT\x20EMPTY'],_0x2807ec);};var _0x111000=function(_0x1116fc){if(!_0x1116fc||!_0x1116fc[_0xe5cb('0x6b')]['length']){return'';}for(var _0x3d1e7c='(',_0x4a2e2d=0x0;_0x4a2e2d<_0x1116fc[_0xe5cb('0x6b')][_0xe5cb('0x3d')];_0x4a2e2d+=0x1){_0x4a2e2d>0x0&&(_0x3d1e7c+='\x20'+_0x1116fc['operator']+'\x20');_0x3d1e7c+=_0x1116fc[_0xe5cb('0x6b')][_0x4a2e2d]['group']?_0x111000(_0x1116fc['rules'][_0x4a2e2d]['group']):_0x1116fc[_0xe5cb('0x6b')][_0x4a2e2d][_0xe5cb('0x6e')]+'\x20'+_0x1116fc[_0xe5cb('0x6b')][_0x4a2e2d][_0xe5cb('0x6f')]+(_0x23d39b(_0x1116fc[_0xe5cb('0x6b')][_0x4a2e2d][_0xe5cb('0x6f')])?'\x20'+_0x1116fc[_0xe5cb('0x6b')][_0x4a2e2d][_0xe5cb('0x70')]:'');}return _0x3d1e7c+')';};var _0x535f9f={'where':{'id':_0x11b55c['id']}},_0x42bbaf,_0x3e677c,_0x468674,_0x12babf,_0xd25210;_0x535f9f=_[_0xe5cb('0x45')]({},_0x535f9f,_0x1c3ee8);return db[_0xe5cb('0x34')][_0xe5cb('0x50')](_0x535f9f)[_0xe5cb('0x24')](function(_0x22048e){if(_0x22048e){_0x42bbaf=_0x22048e;return _0x22048e[_0xe5cb('0x71')]();}return null;})[_0xe5cb('0x24')](function(_0x4d749a){if(_0x4d749a){if(!_0x4d749a[_0xe5cb('0x3d')]){throw new db['Sequelize'][(_0xe5cb('0x8a'))](_0xe5cb('0x8b'),0x193);}_0x3e677c=_0x4d749a;return db[_0xe5cb('0x72')][_0xe5cb('0x4a')]({'raw':!![]});}return null;})['then'](function(_0x3572b1){if(_0x3572b1){_0x468674=_[_0xe5cb('0x8c')](_0x3572b1,'id');var _0x5f4017;var _0x212a34=squel[_0xe5cb('0x8d')]();_0x212a34[_0xe5cb('0x73')](_0x42bbaf[_0xe5cb('0x74')]);for(var _0x5a54ec=0x0;_0x5a54ec<_0x3e677c[_0xe5cb('0x3d')];_0x5a54ec+=0x1){_0x5f4017=_0x3e677c[_0x5a54ec]['MetricId']?_0x468674[_0x3e677c[_0x5a54ec][_0xe5cb('0x75')]][_0xe5cb('0x76')]:_0x3e677c[_0x5a54ec][_0xe5cb('0x6e')];_0x5f4017=_0x3e677c[_0x5a54ec][_0xe5cb('0x78')]?_['replace'](_0x51a7d4[_0x3e677c[_0x5a54ec][_0xe5cb('0x78')]],'%s',_0x5f4017):_0x5f4017;_0x5f4017=_0x3e677c[_0x5a54ec][_0xe5cb('0x79')]?_[_0xe5cb('0x77')](_0x55464c[_0x3e677c[_0x5a54ec][_0xe5cb('0x79')]],'%s',_0x5f4017):_0x5f4017;if(_0x3e677c[_0x5a54ec][_0xe5cb('0x8e')]){_0x212a34[_0xe5cb('0x6d')](_0x5f4017);}_0x3e677c[_0x5a54ec]['orderBy']&&_0x212a34[_0xe5cb('0x40')](_0x5f4017,_0x3e677c[_0x5a54ec][_0xe5cb('0x7a')]===_0xe5cb('0x7b')?![]:!![]);_0x212a34[_0xe5cb('0x6e')](_0x5f4017,_0x3e677c[_0x5a54ec][_0xe5cb('0x7c')]||_0x5f4017);}if(_0x42bbaf[_0xe5cb('0x7d')]){_0x42bbaf[_0xe5cb('0x7d')]=JSON[_0xe5cb('0x8f')](_0x42bbaf[_0xe5cb('0x7d')]);for(var _0x3d75e4=0x0;_0x3d75e4<_0x42bbaf['joins'][_0xe5cb('0x3d')];_0x3d75e4+=0x1){if(_0x42bbaf[_0xe5cb('0x7d')][_0x3d75e4]['type']&&_[_0xe5cb('0x69')](_0x3a4bf6,_0x42bbaf[_0xe5cb('0x7d')][_0x3d75e4]['type'])&&_0x42bbaf[_0xe5cb('0x7d')][_0x3d75e4]['parentKey']&&_0x42bbaf[_0xe5cb('0x7d')][_0x3d75e4][_0xe5cb('0x7e')]&&_0x42bbaf['joins'][_0x3d75e4][_0xe5cb('0x7f')]){_0x212a34[_0x42bbaf[_0xe5cb('0x7d')][_0x3d75e4][_0xe5cb('0x36')]](_0x42bbaf[_0xe5cb('0x7d')][_0x3d75e4][_0xe5cb('0x7e')],null,util[_0xe5cb('0x79')](_0xe5cb('0x90'),_0x42bbaf[_0xe5cb('0x74')],_0x42bbaf[_0xe5cb('0x7d')][_0x3d75e4][_0xe5cb('0x80')],_0x42bbaf['joins'][_0x3d75e4]['foreignTable'],_0x42bbaf[_0xe5cb('0x7d')][_0x3d75e4][_0xe5cb('0x7f')]));}}}if(_0x42bbaf[_0xe5cb('0x81')]){_0x42bbaf[_0xe5cb('0x81')]=JSON[_0xe5cb('0x8f')](_0x42bbaf[_0xe5cb('0x81')]);_0x212a34[_0xe5cb('0x42')](_0x111000(_0x42bbaf[_0xe5cb('0x81')][_0xe5cb('0x6d')]));}_0xd25210=_0x212a34[_0xe5cb('0x91')]();_0x212a34[_0xe5cb('0x1d')](_0x2916ae);_0x212a34[_0xe5cb('0x1f')](0x0);return;}})[_0xe5cb('0x24')](function(){if(_0x36e0f3[_0xe5cb('0x92')]==='web'){return null;}var _0x4560e3=_[_0xe5cb('0x45')](_0x36e0f3,{'name':_0x36e0f3[_0xe5cb('0x93')]||_0x36e0f3['name']||_0x42bbaf[_0xe5cb('0x2c')],'basename':_0x305452,'savename':util['format'](_0xe5cb('0x94'),_0x36e0f3[_0xe5cb('0x2c')]||_0x42bbaf[_0xe5cb('0x2c')],require(_0xe5cb('0x95'))[_0xe5cb('0x96')](0x4),_0x36e0f3[_0xe5cb('0x92')]||_0xe5cb('0x97')),'reportId':_0x42bbaf['id'],'reportType':_0xe5cb('0x98')});return db[_0xe5cb('0x99')][_0xe5cb('0x51')](_0x4560e3,{'raw':!![]});})['then'](function(_0x8e9c06){if(_0x42bbaf['table']===_0xe5cb('0x9a')){_0xd25210[_0xe5cb('0x42')](_0x42bbaf['table']+_0xe5cb('0x9b'),_0x36e0f3[_0xe5cb('0x9c')],_0x36e0f3['endDate']);}else{_0xd25210[_0xe5cb('0x42')](_0x42bbaf[_0xe5cb('0x74')]+_0xe5cb('0x9d'),_0x36e0f3[_0xe5cb('0x9c')],_0x36e0f3[_0xe5cb('0x9e')]);}if(_0x8e9c06){logger['info'](_0xe5cb('0x9f'),_0xd25210[_0xe5cb('0x84')]());require('child_process')[_0xe5cb('0xa0')](path[_0xe5cb('0x5a')](__dirname,'../../components/export/',_0x8e9c06['output']),[_0x8e9c06['id'],_0xd25210['toString'](),path[_0xe5cb('0x5a')](__dirname,_0xe5cb('0xa1'),_0x8e9c06[_0xe5cb('0xa2')]),_0x305452]);return _0x8e9c06;}else{var _0x4e3df5=squel['select']();_0x4e3df5[_0xe5cb('0x73')]('('+_0xd25210['toString']()+')','countTable');_0x4e3df5['field'](_0xe5cb('0xa3'),_0xe5cb('0x1e'));_0xd25210[_0xe5cb('0x1d')](_0x36e0f3[_0xe5cb('0x1d')]||_0x2916ae);_0xd25210['offset'](_0x36e0f3[_0xe5cb('0x1f')]||0x0);return dbH[_0xe5cb('0x83')]['query'](_0x4e3df5[_0xe5cb('0x84')](),{'type':dbH[_0xe5cb('0x83')][_0xe5cb('0x85')][_0xe5cb('0xa4')]})[_0xe5cb('0x24')](function(_0x566549){if(!_0x566549[_0xe5cb('0x3d')]){_0x12babf=0x0;}else{_0x12babf=_0x566549[0x0][_0xe5cb('0x1e')]||0x0;}return dbH['sequelize'][_0xe5cb('0x38')](_0xd25210[_0xe5cb('0x84')](),{'type':dbH['sequelize'][_0xe5cb('0x85')][_0xe5cb('0xa4')]});})[_0xe5cb('0x24')](function(_0x2d7de6){return{'rows':_0x2d7de6||[],'count':_0x12babf};});}});}exports[_0xe5cb('0xa5')]=function(_0x4f81bf,_0x3a17cd){return runReport(_0x4f81bf[_0xe5cb('0x4e')],_0x4f81bf['query'],_0x4f81bf[_0xe5cb('0x47')])['then'](respondWithResult(_0x3a17cd,null))[_0xe5cb('0x4c')](handleError(_0x3a17cd,null));};exports['runReport']=runReport;exports[_0xe5cb('0x38')]=function(_0x279492,_0x368b86){var _0x1fbde8=0xa;var _0x352c65=[_0xe5cb('0x5a'),_0xe5cb('0x5b'),_0xe5cb('0x5c'),_0xe5cb('0x5d')];var _0x24a132={'SUM':_0xe5cb('0x86'),'COUNT':_0xe5cb('0x5e'),'COUNT DISTINCT':_0xe5cb('0x5f'),'MAX':_0xe5cb('0x60'),'MIN':_0xe5cb('0x61'),'AVG':_0xe5cb('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe5cb('0x87'),'GROUP_CONCAT DESC':_0xe5cb('0x64')};var _0xc2ff9c={'SEC_TO_TIME':_0xe5cb('0x65'),'DATE':'DATE(%s)','HOUR':_0xe5cb('0x66'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xe5cb('0x68')};var _0x34d940=function(_0x4dd998){return!_[_0xe5cb('0x69')]([_0xe5cb('0xa6'),_0xe5cb('0x6a'),_0xe5cb('0x89'),_0xe5cb('0xa7')],_0x4dd998);};var _0x43dfdc=function(_0x2b5e87){if(!_0x2b5e87||!_0x2b5e87[_0xe5cb('0x6b')][_0xe5cb('0x3d')]){return'';}for(var _0x459d34='(',_0x374088=0x0;_0x374088<_0x2b5e87[_0xe5cb('0x6b')]['length'];_0x374088+=0x1){_0x374088>0x0&&(_0x459d34+='\x20'+_0x2b5e87[_0xe5cb('0x6c')]+'\x20');_0x459d34+=_0x2b5e87[_0xe5cb('0x6b')][_0x374088][_0xe5cb('0x6d')]?_0x43dfdc(_0x2b5e87[_0xe5cb('0x6b')][_0x374088][_0xe5cb('0x6d')]):_0x2b5e87[_0xe5cb('0x6b')][_0x374088][_0xe5cb('0x6e')]+'\x20'+_0x2b5e87[_0xe5cb('0x6b')][_0x374088]['condition']+(_0x34d940(_0x2b5e87[_0xe5cb('0x6b')][_0x374088][_0xe5cb('0x6f')])?'\x20'+_0x2b5e87[_0xe5cb('0x6b')][_0x374088]['value']:'');}return _0x459d34+')';};var _0x498e72={'where':{'id':_0x279492[_0xe5cb('0x4e')]['id']}},_0xd941e3,_0x11ed1d,_0x3a4f18,_0x2ad11c,_0x48c0a9;_0x498e72=_['merge']({},_0x498e72,_0x279492[_0xe5cb('0x47')]);return db[_0xe5cb('0x34')]['find'](_0x498e72)[_0xe5cb('0x24')](function(_0x23b188){if(_0x23b188){_0xd941e3=_0x23b188;return _0x23b188[_0xe5cb('0x71')]();}return null;})[_0xe5cb('0x24')](function(_0x4237a7){if(_0x4237a7){if(!_0x4237a7[_0xe5cb('0x3d')]){throw new db[(_0xe5cb('0xa8'))][(_0xe5cb('0x8a'))](_0xe5cb('0x8b'),0x193);}_0x11ed1d=_0x4237a7;return db['AnalyticMetric'][_0xe5cb('0x4a')]({'raw':!![]});}return null;})[_0xe5cb('0x24')](function(_0x2ca730){if(_0x2ca730){_0x3a4f18=_['keyBy'](_0x2ca730,'id');var _0x548964;var _0xdf8dc4=squel[_0xe5cb('0x8d')]();_0xdf8dc4[_0xe5cb('0x73')](_0xd941e3['table']);for(var _0x142759=0x0;_0x142759<_0x11ed1d[_0xe5cb('0x3d')];_0x142759+=0x1){_0x548964=_0x11ed1d[_0x142759]['MetricId']?_0x3a4f18[_0x11ed1d[_0x142759][_0xe5cb('0x75')]][_0xe5cb('0x76')]:_0x11ed1d[_0x142759][_0xe5cb('0x6e')];_0x548964=_0x11ed1d[_0x142759][_0xe5cb('0x78')]?_[_0xe5cb('0x77')](_0x24a132[_0x11ed1d[_0x142759][_0xe5cb('0x78')]],'%s',_0x548964):_0x548964;_0x548964=_0x11ed1d[_0x142759][_0xe5cb('0x79')]?_[_0xe5cb('0x77')](_0xc2ff9c[_0x11ed1d[_0x142759][_0xe5cb('0x79')]],'%s',_0x548964):_0x548964;if(_0x11ed1d[_0x142759][_0xe5cb('0x8e')]){_0xdf8dc4[_0xe5cb('0x6d')](_0x548964);}_0x11ed1d[_0x142759][_0xe5cb('0x7a')]&&_0xdf8dc4['order'](_0x548964,_0x11ed1d[_0x142759][_0xe5cb('0x7a')]===_0xe5cb('0x7b')?![]:!![]);_0xdf8dc4[_0xe5cb('0x6e')](_0x548964,_0x11ed1d[_0x142759][_0xe5cb('0x7c')]||_0x548964);}if(_0xd941e3[_0xe5cb('0x7d')]){_0xd941e3[_0xe5cb('0x7d')]=JSON['parse'](_0xd941e3[_0xe5cb('0x7d')]);for(var _0x201e5a=0x0;_0x201e5a<_0xd941e3[_0xe5cb('0x7d')][_0xe5cb('0x3d')];_0x201e5a+=0x1){if(_0xd941e3[_0xe5cb('0x7d')][_0x201e5a]['type']&&_[_0xe5cb('0x69')](_0x352c65,_0xd941e3['joins'][_0x201e5a][_0xe5cb('0x36')])&&_0xd941e3[_0xe5cb('0x7d')][_0x201e5a][_0xe5cb('0x80')]&&_0xd941e3['joins'][_0x201e5a][_0xe5cb('0x7e')]&&_0xd941e3[_0xe5cb('0x7d')][_0x201e5a]['foreignKey']){_0xdf8dc4[_0xd941e3['joins'][_0x201e5a][_0xe5cb('0x36')]](_0xd941e3[_0xe5cb('0x7d')][_0x201e5a]['foreignTable'],null,util[_0xe5cb('0x79')](_0xe5cb('0x90'),_0xd941e3[_0xe5cb('0x74')],_0xd941e3[_0xe5cb('0x7d')][_0x201e5a][_0xe5cb('0x80')],_0xd941e3[_0xe5cb('0x7d')][_0x201e5a][_0xe5cb('0x7e')],_0xd941e3[_0xe5cb('0x7d')][_0x201e5a][_0xe5cb('0x7f')]));}}}if(_0xd941e3['conditions']){_0xd941e3['conditions']=JSON[_0xe5cb('0x8f')](_0xd941e3[_0xe5cb('0x81')]);_0xdf8dc4[_0xe5cb('0x42')](_0x43dfdc(_0xd941e3[_0xe5cb('0x81')][_0xe5cb('0x6d')]));}_0x48c0a9=_0xdf8dc4[_0xe5cb('0x91')]();_0xdf8dc4[_0xe5cb('0x1d')](_0x1fbde8);_0xdf8dc4[_0xe5cb('0x1f')](0x0);logger[_0xe5cb('0x82')](_0xe5cb('0xa9'),_0xdf8dc4['toString']());return dbH['sequelize']['query'](_0xdf8dc4[_0xe5cb('0x84')](),{'type':dbH[_0xe5cb('0x83')][_0xe5cb('0x85')][_0xe5cb('0xa4')]});}})[_0xe5cb('0x24')](function(){return{'sql':_0x48c0a9[_0xe5cb('0x84')]()};})[_0xe5cb('0x24')](respondWithResult(_0x368b86,null))[_0xe5cb('0x4c')](handleError(_0x368b86,null));};
\ No newline at end of file
+var _0xcb2d=['account','index','map','AnalyticCustomReport','rawAttributes','fieldName','model','keys','query','filters','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','intersection','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','field','condition','params','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','operator','value','select','web','randomstring','output','custom','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','COUNT(*)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20EMPTY','getFields','metric','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','CustomReports','UserProfileResource','sendStatus','error','stack','name','send','contact','message','agent','interaction'];(function(_0x44e843,_0x18e958){var _0x4f0a2d=function(_0xd7cb2){while(--_0xd7cb2){_0x44e843['push'](_0x44e843['shift']());}};_0x4f0a2d(++_0x18e958);}(_0xcb2d,0x125));var _0xdcb2=function(_0x5acf2b,_0x4cd989){_0x5acf2b=_0x5acf2b-0x0;var _0x23ef03=_0xcb2d[_0x5acf2b];return _0x23ef03;};'use strict';var emlformat=require(_0xdcb2('0x0'));var rimraf=require(_0xdcb2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdcb2('0x2'));var rp=require(_0xdcb2('0x3'));var moment=require(_0xdcb2('0x4'));var BPromise=require(_0xdcb2('0x5'));var Mustache=require(_0xdcb2('0x6'));var util=require(_0xdcb2('0x7'));var path=require('path');var sox=require(_0xdcb2('0x8'));var csv=require(_0xdcb2('0x9'));var ejs=require(_0xdcb2('0xa'));var fs=require('fs');var fs_extra=require(_0xdcb2('0xb'));var _=require(_0xdcb2('0xc'));var squel=require('squel');var crypto=require(_0xdcb2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xdcb2('0xe'));var toCsv=require(_0xdcb2('0x9'));var querystring=require(_0xdcb2('0xf'));var Papa=require(_0xdcb2('0x10'));var Redis=require(_0xdcb2('0x11'));var authService=require(_0xdcb2('0x12'));var qs=require(_0xdcb2('0x13'));var as=require(_0xdcb2('0x14'));var hardwareService=require(_0xdcb2('0x15'));var logger=require('../../config/logger')(_0xdcb2('0x16'));var utils=require(_0xdcb2('0x17'));var config=require(_0xdcb2('0x18'));var licenseUtil=require(_0xdcb2('0x19'));var db=require(_0xdcb2('0x1a'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x1585fa,_0x3099e8){_0x3099e8=_0x3099e8||0xcc;return function(_0x4ef3d2){if(_0x4ef3d2){return _0x1585fa['sendStatus'](_0x3099e8);}return _0x1585fa['status'](_0x3099e8)[_0xdcb2('0x1b')]();};}function respondWithResult(_0x50241b,_0x4bf90f){_0x4bf90f=_0x4bf90f||0xc8;return function(_0x32a1ec){if(_0x32a1ec){return _0x50241b[_0xdcb2('0x1c')](_0x4bf90f)[_0xdcb2('0x1d')](_0x32a1ec);}};}function respondWithFilteredResult(_0x2cd20a,_0x332827){return function(_0x46741c){if(_0x46741c){var _0x40058c=typeof _0x332827[_0xdcb2('0x1e')]===_0xdcb2('0x1f')&&typeof _0x332827[_0xdcb2('0x20')]===_0xdcb2('0x1f');var _0x2ba1a5=_0x46741c[_0xdcb2('0x21')];var _0x45a54c=_0x40058c?0x0:_0x332827[_0xdcb2('0x1e')];var _0x4e3838=_0x40058c?_0x46741c[_0xdcb2('0x21')]:_0x332827['offset']+_0x332827['limit'];var _0xfce711;if(_0x4e3838>=_0x2ba1a5){_0x4e3838=_0x2ba1a5;_0xfce711=0xc8;}else{_0xfce711=0xce;}_0x2cd20a['status'](_0xfce711);return _0x2cd20a[_0xdcb2('0x22')](_0xdcb2('0x23'),_0x45a54c+'-'+_0x4e3838+'/'+_0x2ba1a5)[_0xdcb2('0x1d')](_0x46741c);}return null;};}function patchUpdates(_0x169d5d){return function(_0x3b916c){try{jsonpatch[_0xdcb2('0x24')](_0x3b916c,_0x169d5d,!![]);}catch(_0x293ac0){return BPromise[_0xdcb2('0x25')](_0x293ac0);}return _0x3b916c[_0xdcb2('0x26')]();};}function saveUpdates(_0x461042,_0x36fd7a){return function(_0x21b311){if(_0x21b311){return _0x21b311[_0xdcb2('0x27')](_0x461042)[_0xdcb2('0x28')](function(_0x5c1eb1){return _0x5c1eb1;});}return null;};}function removeEntity(_0x49286e,_0x43fbf4){return function(_0xe59077){if(_0xe59077){return _0xe59077[_0xdcb2('0x29')]()[_0xdcb2('0x28')](function(){var _0x56e948=_0xe59077['get']({'plain':!![]});var _0x2c48c4=_0xdcb2('0x2a');return db[_0xdcb2('0x2b')]['destroy']({'where':{'type':_0x2c48c4,'resourceId':_0x56e948['id']}})[_0xdcb2('0x28')](function(){return _0xe59077;});})[_0xdcb2('0x28')](function(){_0x49286e[_0xdcb2('0x1c')](0xcc)[_0xdcb2('0x1b')]();});}};}function handleEntityNotFound(_0x2ab459,_0x20a8f1){return function(_0x305779){if(!_0x305779){_0x2ab459[_0xdcb2('0x2c')](0x194);}return _0x305779;};}function handleError(_0x418e4b,_0x3c8447){_0x3c8447=_0x3c8447||0x1f4;return function(_0x1f9126){logger[_0xdcb2('0x2d')](_0x1f9126[_0xdcb2('0x2e')]);if(_0x1f9126[_0xdcb2('0x2f')]){delete _0x1f9126[_0xdcb2('0x2f')];}_0x418e4b['status'](_0x3c8447)[_0xdcb2('0x30')](_0x1f9126);};}function getMustacheRender(_0x540ef2,_0x4294ca){return Mustache['render'](_0x540ef2,_['merge'](_0x4294ca['body'],{'contact':_0x4294ca[_0xdcb2('0x31')],'message':_0x4294ca[_0xdcb2('0x32')],'agent':_0x4294ca[_0xdcb2('0x33')],'interaction':_0x4294ca[_0xdcb2('0x34')],'account':_0x4294ca[_0xdcb2('0x35')]}))||'';}exports[_0xdcb2('0x36')]=function(_0x3fa84a,_0x54a374){var _0x264d21={},_0xde76b8={},_0x465c13={'count':0x0,'rows':[]};var _0x5d3f58=_[_0xdcb2('0x37')](db[_0xdcb2('0x38')][_0xdcb2('0x39')],function(_0x5bc976){return{'name':_0x5bc976[_0xdcb2('0x3a')],'type':_0x5bc976['type']['key']};});_0xde76b8[_0xdcb2('0x3b')]=_[_0xdcb2('0x37')](_0x5d3f58,_0xdcb2('0x2f'));_0xde76b8['query']=_[_0xdcb2('0x3c')](_0x3fa84a[_0xdcb2('0x3d')]);_0xde76b8[_0xdcb2('0x3e')]=_['intersection'](_0xde76b8[_0xdcb2('0x3b')],_0xde76b8[_0xdcb2('0x3d')]);_0x264d21[_0xdcb2('0x3f')]=_['intersection'](_0xde76b8[_0xdcb2('0x3b')],qs[_0xdcb2('0x40')](_0x3fa84a[_0xdcb2('0x3d')][_0xdcb2('0x40')]));_0x264d21[_0xdcb2('0x3f')]=_0x264d21[_0xdcb2('0x3f')]['length']?_0x264d21['attributes']:_0xde76b8[_0xdcb2('0x3b')];if(!_0x3fa84a[_0xdcb2('0x3d')][_0xdcb2('0x41')]('nolimit')){_0x264d21[_0xdcb2('0x20')]=qs['limit'](_0x3fa84a['query'][_0xdcb2('0x20')]);_0x264d21['offset']=qs['offset'](_0x3fa84a[_0xdcb2('0x3d')][_0xdcb2('0x1e')]);}_0x264d21[_0xdcb2('0x42')]=qs[_0xdcb2('0x43')](_0x3fa84a[_0xdcb2('0x3d')][_0xdcb2('0x43')]);_0x264d21[_0xdcb2('0x44')]=qs[_0xdcb2('0x3e')](_[_0xdcb2('0x45')](_0x3fa84a[_0xdcb2('0x3d')],_0xde76b8[_0xdcb2('0x3e')]),_0x5d3f58);if(_0x3fa84a['query'][_0xdcb2('0x46')]){_0x264d21['where']=_[_0xdcb2('0x47')](_0x264d21[_0xdcb2('0x44')],{'$or':_[_0xdcb2('0x37')](_0x5d3f58,function(_0x38fe35){if(_0x38fe35[_0xdcb2('0x48')]!==_0xdcb2('0x49')){var _0x5efdd5={};_0x5efdd5[_0x38fe35[_0xdcb2('0x2f')]]={'$like':'%'+_0x3fa84a['query']['filter']+'%'};return _0x5efdd5;}})});}_0x264d21=_['merge']({},_0x264d21,_0x3fa84a[_0xdcb2('0x4a')]);var _0x4ca9bc={'where':_0x264d21['where']};return db['AnalyticCustomReport']['count'](_0x4ca9bc)[_0xdcb2('0x28')](function(_0x5d357){_0x465c13[_0xdcb2('0x21')]=_0x5d357;if(_0x3fa84a[_0xdcb2('0x3d')][_0xdcb2('0x4b')]){_0x264d21[_0xdcb2('0x4c')]=[{'all':!![]}];}return db[_0xdcb2('0x38')][_0xdcb2('0x4d')](_0x264d21);})['then'](function(_0x539de0){_0x465c13[_0xdcb2('0x4e')]=_0x539de0;return _0x465c13;})[_0xdcb2('0x28')](respondWithFilteredResult(_0x54a374,_0x264d21))[_0xdcb2('0x4f')](handleError(_0x54a374,null));};exports[_0xdcb2('0x50')]=function(_0x4da3c0,_0x271acf){var _0xffe701={'raw':![],'where':{'id':_0x4da3c0['params']['id']}},_0xf36f90={};_0xf36f90['model']=_[_0xdcb2('0x3c')](db[_0xdcb2('0x38')]['rawAttributes']);_0xf36f90[_0xdcb2('0x3d')]=_['keys'](_0x4da3c0['query']);_0xf36f90[_0xdcb2('0x3e')]=_[_0xdcb2('0x51')](_0xf36f90[_0xdcb2('0x3b')],_0xf36f90[_0xdcb2('0x3d')]);_0xffe701[_0xdcb2('0x3f')]=_[_0xdcb2('0x51')](_0xf36f90[_0xdcb2('0x3b')],qs['fields'](_0x4da3c0[_0xdcb2('0x3d')]['fields']));_0xffe701[_0xdcb2('0x3f')]=_0xffe701[_0xdcb2('0x3f')][_0xdcb2('0x52')]?_0xffe701['attributes']:_0xf36f90[_0xdcb2('0x3b')];if(_0x4da3c0[_0xdcb2('0x3d')][_0xdcb2('0x4b')]){_0xffe701[_0xdcb2('0x4c')]=[{'all':!![]}];}_0xffe701=_['merge']({},_0xffe701,_0x4da3c0[_0xdcb2('0x4a')]);return db[_0xdcb2('0x38')][_0xdcb2('0x53')](_0xffe701)[_0xdcb2('0x28')](handleEntityNotFound(_0x271acf,null))[_0xdcb2('0x28')](respondWithResult(_0x271acf,null))[_0xdcb2('0x4f')](handleError(_0x271acf,null));};exports[_0xdcb2('0x54')]=function(_0x270230,_0xb97b30){return db[_0xdcb2('0x38')][_0xdcb2('0x54')](_0x270230[_0xdcb2('0x55')],{})[_0xdcb2('0x28')](function(_0x48e540){var _0x2d528d=_0x270230[_0xdcb2('0x56')][_0xdcb2('0x57')]({'plain':!![]});if(!_0x2d528d)throw new Error(_0xdcb2('0x58'));if(_0x2d528d[_0xdcb2('0x59')]==='user'){var _0x39f6c7=_0x48e540[_0xdcb2('0x57')]({'plain':!![]});var _0x2d8a27=_0xdcb2('0x5a');return db[_0xdcb2('0x5b')]['find']({'where':{'name':_0x2d8a27,'userProfileId':_0x2d528d[_0xdcb2('0x5c')]},'raw':!![]})[_0xdcb2('0x28')](function(_0x314bc9){if(_0x314bc9&&_0x314bc9[_0xdcb2('0x5d')]===0x0){return db[_0xdcb2('0x2b')][_0xdcb2('0x54')]({'name':_0x39f6c7[_0xdcb2('0x2f')],'resourceId':_0x39f6c7['id'],'type':_0xdcb2('0x2a'),'sectionId':_0x314bc9['id']},{})[_0xdcb2('0x28')](function(){return _0x48e540;});}else{return _0x48e540;}})[_0xdcb2('0x4f')](function(_0xe50f08){logger[_0xdcb2('0x2d')](_0xdcb2('0x5e'),_0xe50f08);throw _0xe50f08;});}return _0x48e540;})['then'](respondWithResult(_0xb97b30,0xc9))['catch'](handleError(_0xb97b30,null));};exports[_0xdcb2('0x27')]=function(_0x452e87,_0x2c1f9e){if(_0x452e87[_0xdcb2('0x55')]['id']){delete _0x452e87['body']['id'];}return db['AnalyticCustomReport'][_0xdcb2('0x53')]({'where':{'id':_0x452e87['params']['id']}})[_0xdcb2('0x28')](handleEntityNotFound(_0x2c1f9e,null))[_0xdcb2('0x28')](saveUpdates(_0x452e87[_0xdcb2('0x55')],null))[_0xdcb2('0x28')](respondWithResult(_0x2c1f9e,null))['catch'](handleError(_0x2c1f9e,null));};exports[_0xdcb2('0x29')]=function(_0x5c69c9,_0x26dfed){return db['AnalyticCustomReport']['find']({'where':{'id':_0x5c69c9['params']['id']}})[_0xdcb2('0x28')](handleEntityNotFound(_0x26dfed,null))[_0xdcb2('0x28')](removeEntity(_0x26dfed,null))[_0xdcb2('0x4f')](handleError(_0x26dfed,null));};exports['preview']=function(_0x4d0747,_0x1af683){var _0x1cb3e4=0xa;var _0x27ae2e=[_0xdcb2('0x5f'),_0xdcb2('0x60'),_0xdcb2('0x61'),_0xdcb2('0x62')];var _0x45315e={'SUM':'SUM(%s)','COUNT':_0xdcb2('0x63'),'COUNT DISTINCT':_0xdcb2('0x64'),'MAX':_0xdcb2('0x65'),'MIN':_0xdcb2('0x66'),'AVG':_0xdcb2('0x67'),'GROUP_CONCAT':_0xdcb2('0x68'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xdcb2('0x69')};var _0xde4860={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xdcb2('0x6a'),'HOUR':_0xdcb2('0x6b'),'ROUND':_0xdcb2('0x6c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5e0e31=function(_0x16475b){return!_[_0xdcb2('0x6d')]([_0xdcb2('0x6e'),_0xdcb2('0x6f'),'IS\x20EMPTY',_0xdcb2('0x70')],_0x16475b);};var _0x348a7=function(_0x2e3d87){if(!_0x2e3d87||!_0x2e3d87['rules'][_0xdcb2('0x52')]){return'';}for(var _0x57d6d6='(',_0x3b5b8e=0x0;_0x3b5b8e<_0x2e3d87[_0xdcb2('0x71')][_0xdcb2('0x52')];_0x3b5b8e+=0x1){_0x3b5b8e>0x0&&(_0x57d6d6+='\x20'+_0x2e3d87['operator']+'\x20');_0x57d6d6+=_0x2e3d87['rules'][_0x3b5b8e][_0xdcb2('0x72')]?_0x348a7(_0x2e3d87[_0xdcb2('0x71')][_0x3b5b8e][_0xdcb2('0x72')]):_0x2e3d87[_0xdcb2('0x71')][_0x3b5b8e][_0xdcb2('0x73')]+'\x20'+_0x2e3d87[_0xdcb2('0x71')][_0x3b5b8e][_0xdcb2('0x74')]+(_0x5e0e31(_0x2e3d87[_0xdcb2('0x71')][_0x3b5b8e][_0xdcb2('0x74')])?'\x20'+_0x2e3d87[_0xdcb2('0x71')][_0x3b5b8e]['value']:'');}return _0x57d6d6+')';};var _0x36eaa6={'where':{'id':_0x4d0747[_0xdcb2('0x75')]['id']}},_0x405032,_0x2991e8,_0x1a0edf,_0x9b98a8,_0x586d3;_0x36eaa6=_['merge']({},_0x36eaa6,_0x4d0747[_0xdcb2('0x4a')]);return db[_0xdcb2('0x38')]['find'](_0x36eaa6)[_0xdcb2('0x28')](function(_0x58ba07){if(_0x58ba07){_0x405032=_0x58ba07;return _0x58ba07['getFields']();}return null;})[_0xdcb2('0x28')](function(_0x244c10){if(_0x244c10){if(!_0x244c10[_0xdcb2('0x52')]){throw new db[(_0xdcb2('0x76'))][(_0xdcb2('0x77'))](_0xdcb2('0x78'),0x193);}_0x2991e8=_0x244c10;return db[_0xdcb2('0x79')]['findAll']({'raw':!![]});}return null;})[_0xdcb2('0x28')](function(_0x545957){if(_0x545957){_0x1a0edf=_[_0xdcb2('0x7a')](_0x545957,'id');var _0x2d34b8;var _0x2a0561=squel['select']();_0x2a0561[_0xdcb2('0x7b')](_0x405032['table']);for(var _0x485512=0x0;_0x485512<_0x2991e8[_0xdcb2('0x52')];_0x485512+=0x1){_0x2d34b8=_0x2991e8[_0x485512]['MetricId']?_0x1a0edf[_0x2991e8[_0x485512][_0xdcb2('0x7c')]]['metric']:_0x2991e8[_0x485512][_0xdcb2('0x73')];_0x2d34b8=_0x2991e8[_0x485512][_0xdcb2('0x7d')]?_['replace'](_0x45315e[_0x2991e8[_0x485512]['function']],'%s',_0x2d34b8):_0x2d34b8;_0x2d34b8=_0x2991e8[_0x485512]['format']?_[_0xdcb2('0x7e')](_0xde4860[_0x2991e8[_0x485512][_0xdcb2('0x7f')]],'%s',_0x2d34b8):_0x2d34b8;if(_0x2991e8[_0x485512][_0xdcb2('0x80')]){_0x2a0561[_0xdcb2('0x72')](_0x2d34b8);}_0x2991e8[_0x485512][_0xdcb2('0x81')]&&_0x2a0561[_0xdcb2('0x42')](_0x2d34b8,_0x2991e8[_0x485512]['orderBy']===_0xdcb2('0x82')?![]:!![]);_0x2a0561['field'](_0x2d34b8,_0x2991e8[_0x485512][_0xdcb2('0x83')]||_0x2d34b8);}if(_0x405032[_0xdcb2('0x84')]){_0x405032['joins']=JSON[_0xdcb2('0x85')](_0x405032['joins']);for(var _0x22c34b=0x0;_0x22c34b<_0x405032[_0xdcb2('0x84')][_0xdcb2('0x52')];_0x22c34b+=0x1){if(_0x405032['joins'][_0x22c34b]['type']&&_[_0xdcb2('0x6d')](_0x27ae2e,_0x405032[_0xdcb2('0x84')][_0x22c34b]['type'])&&_0x405032[_0xdcb2('0x84')][_0x22c34b][_0xdcb2('0x86')]&&_0x405032[_0xdcb2('0x84')][_0x22c34b][_0xdcb2('0x87')]&&_0x405032[_0xdcb2('0x84')][_0x22c34b][_0xdcb2('0x88')]){_0x2a0561[_0x405032['joins'][_0x22c34b][_0xdcb2('0x48')]](_0x405032[_0xdcb2('0x84')][_0x22c34b]['foreignTable'],null,util[_0xdcb2('0x7f')](_0xdcb2('0x89'),_0x405032[_0xdcb2('0x8a')],_0x405032[_0xdcb2('0x84')][_0x22c34b]['parentKey'],_0x405032[_0xdcb2('0x84')][_0x22c34b][_0xdcb2('0x87')],_0x405032[_0xdcb2('0x84')][_0x22c34b][_0xdcb2('0x88')]));}}}if(_0x405032[_0xdcb2('0x8b')]){_0x405032[_0xdcb2('0x8b')]=JSON[_0xdcb2('0x85')](_0x405032[_0xdcb2('0x8b')]);_0x2a0561[_0xdcb2('0x44')](_0x348a7(_0x405032[_0xdcb2('0x8b')][_0xdcb2('0x72')]));}_0x586d3=_0x2a0561[_0xdcb2('0x8c')]();_0x2a0561[_0xdcb2('0x20')](_0x1cb3e4);_0x2a0561[_0xdcb2('0x1e')](0x0);logger[_0xdcb2('0x8d')](_0xdcb2('0x8e'),_0x2a0561[_0xdcb2('0x8f')]());return dbH[_0xdcb2('0x90')]['query'](_0x2a0561['toString'](),{'type':dbH[_0xdcb2('0x90')][_0xdcb2('0x91')][_0xdcb2('0x92')]});}})[_0xdcb2('0x28')](respondWithResult(_0x1af683,null))[_0xdcb2('0x4f')](handleError(_0x1af683,null));};function runReport(_0x1c81a6,_0x267951,_0x21f301){var _0x6a5183=_0x267951['name'];var _0x3596dc=0xa;var _0x4c5244=['join',_0xdcb2('0x60'),_0xdcb2('0x61'),'cross_join'];var _0x2f7198={'SUM':_0xdcb2('0x93'),'COUNT':_0xdcb2('0x63'),'COUNT DISTINCT':_0xdcb2('0x64'),'MAX':_0xdcb2('0x65'),'MIN':_0xdcb2('0x66'),'AVG':_0xdcb2('0x67'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x455152={'SEC_TO_TIME':_0xdcb2('0x94'),'DATE':'DATE(%s)','HOUR':_0xdcb2('0x6b'),'ROUND':_0xdcb2('0x6c'),'UNIX_TIMESTAMP':_0xdcb2('0x95')};var _0x1e922d=function(_0x1bb678){return!_[_0xdcb2('0x6d')]([_0xdcb2('0x6e'),_0xdcb2('0x6f'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x1bb678);};var _0x26d06d=function(_0x34c02d){if(!_0x34c02d||!_0x34c02d[_0xdcb2('0x71')]['length']){return'';}for(var _0x211207='(',_0x3d4e43=0x0;_0x3d4e43<_0x34c02d[_0xdcb2('0x71')][_0xdcb2('0x52')];_0x3d4e43+=0x1){_0x3d4e43>0x0&&(_0x211207+='\x20'+_0x34c02d[_0xdcb2('0x96')]+'\x20');_0x211207+=_0x34c02d['rules'][_0x3d4e43][_0xdcb2('0x72')]?_0x26d06d(_0x34c02d[_0xdcb2('0x71')][_0x3d4e43][_0xdcb2('0x72')]):_0x34c02d[_0xdcb2('0x71')][_0x3d4e43][_0xdcb2('0x73')]+'\x20'+_0x34c02d['rules'][_0x3d4e43][_0xdcb2('0x74')]+(_0x1e922d(_0x34c02d[_0xdcb2('0x71')][_0x3d4e43][_0xdcb2('0x74')])?'\x20'+_0x34c02d['rules'][_0x3d4e43][_0xdcb2('0x97')]:'');}return _0x211207+')';};var _0x38701a={'where':{'id':_0x1c81a6['id']}},_0x12c02d,_0x3a3411,_0x384bd0,_0x358934,_0x19ac5c;_0x38701a=_[_0xdcb2('0x47')]({},_0x38701a,_0x21f301);return db[_0xdcb2('0x38')][_0xdcb2('0x53')](_0x38701a)[_0xdcb2('0x28')](function(_0x53dd7c){if(_0x53dd7c){_0x12c02d=_0x53dd7c;return _0x53dd7c['getFields']();}return null;})[_0xdcb2('0x28')](function(_0x254531){if(_0x254531){if(!_0x254531[_0xdcb2('0x52')]){throw new db[(_0xdcb2('0x76'))]['ValidationErrorItem'](_0xdcb2('0x78'),0x193);}_0x3a3411=_0x254531;return db[_0xdcb2('0x79')]['findAll']({'raw':!![]});}return null;})[_0xdcb2('0x28')](function(_0x118b69){if(_0x118b69){_0x384bd0=_[_0xdcb2('0x7a')](_0x118b69,'id');var _0x2af21a;var _0x4c1310=squel[_0xdcb2('0x98')]();_0x4c1310[_0xdcb2('0x7b')](_0x12c02d[_0xdcb2('0x8a')]);for(var _0x58bd45=0x0;_0x58bd45<_0x3a3411['length'];_0x58bd45+=0x1){_0x2af21a=_0x3a3411[_0x58bd45]['MetricId']?_0x384bd0[_0x3a3411[_0x58bd45][_0xdcb2('0x7c')]]['metric']:_0x3a3411[_0x58bd45][_0xdcb2('0x73')];_0x2af21a=_0x3a3411[_0x58bd45][_0xdcb2('0x7d')]?_['replace'](_0x2f7198[_0x3a3411[_0x58bd45][_0xdcb2('0x7d')]],'%s',_0x2af21a):_0x2af21a;_0x2af21a=_0x3a3411[_0x58bd45][_0xdcb2('0x7f')]?_[_0xdcb2('0x7e')](_0x455152[_0x3a3411[_0x58bd45][_0xdcb2('0x7f')]],'%s',_0x2af21a):_0x2af21a;if(_0x3a3411[_0x58bd45][_0xdcb2('0x80')]){_0x4c1310[_0xdcb2('0x72')](_0x2af21a);}_0x3a3411[_0x58bd45][_0xdcb2('0x81')]&&_0x4c1310[_0xdcb2('0x42')](_0x2af21a,_0x3a3411[_0x58bd45][_0xdcb2('0x81')]==='DESC'?![]:!![]);_0x4c1310['field'](_0x2af21a,_0x3a3411[_0x58bd45]['alias']||_0x2af21a);}if(_0x12c02d[_0xdcb2('0x84')]){_0x12c02d[_0xdcb2('0x84')]=JSON[_0xdcb2('0x85')](_0x12c02d[_0xdcb2('0x84')]);for(var _0x562d79=0x0;_0x562d79<_0x12c02d[_0xdcb2('0x84')][_0xdcb2('0x52')];_0x562d79+=0x1){if(_0x12c02d[_0xdcb2('0x84')][_0x562d79][_0xdcb2('0x48')]&&_['includes'](_0x4c5244,_0x12c02d[_0xdcb2('0x84')][_0x562d79][_0xdcb2('0x48')])&&_0x12c02d[_0xdcb2('0x84')][_0x562d79][_0xdcb2('0x86')]&&_0x12c02d[_0xdcb2('0x84')][_0x562d79][_0xdcb2('0x87')]&&_0x12c02d[_0xdcb2('0x84')][_0x562d79][_0xdcb2('0x88')]){_0x4c1310[_0x12c02d[_0xdcb2('0x84')][_0x562d79][_0xdcb2('0x48')]](_0x12c02d['joins'][_0x562d79]['foreignTable'],null,util[_0xdcb2('0x7f')](_0xdcb2('0x89'),_0x12c02d[_0xdcb2('0x8a')],_0x12c02d[_0xdcb2('0x84')][_0x562d79][_0xdcb2('0x86')],_0x12c02d[_0xdcb2('0x84')][_0x562d79][_0xdcb2('0x87')],_0x12c02d[_0xdcb2('0x84')][_0x562d79][_0xdcb2('0x88')]));}}}if(_0x12c02d['conditions']){_0x12c02d[_0xdcb2('0x8b')]=JSON[_0xdcb2('0x85')](_0x12c02d[_0xdcb2('0x8b')]);_0x4c1310[_0xdcb2('0x44')](_0x26d06d(_0x12c02d[_0xdcb2('0x8b')]['group']));}_0x19ac5c=_0x4c1310[_0xdcb2('0x8c')]();_0x4c1310[_0xdcb2('0x20')](_0x3596dc);_0x4c1310['offset'](0x0);return;}})[_0xdcb2('0x28')](function(){if(_0x267951['output']===_0xdcb2('0x99')){return null;}var _0xfa23e3=_[_0xdcb2('0x47')](_0x267951,{'name':_0x267951['fullPath']||_0x267951[_0xdcb2('0x2f')]||_0x12c02d[_0xdcb2('0x2f')],'basename':_0x6a5183,'savename':util['format']('%s-%s.%s',_0x267951[_0xdcb2('0x2f')]||_0x12c02d['name'],require(_0xdcb2('0x9a'))['generate'](0x4),_0x267951[_0xdcb2('0x9b')]||'csv'),'reportId':_0x12c02d['id'],'reportType':_0xdcb2('0x9c')});return db[_0xdcb2('0x9d')]['create'](_0xfa23e3,{'raw':!![]});})['then'](function(_0x415d69){if(_0x12c02d[_0xdcb2('0x8a')]===_0xdcb2('0x9e')){_0x19ac5c[_0xdcb2('0x44')](_0x12c02d['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x267951[_0xdcb2('0x9f')],_0x267951[_0xdcb2('0xa0')]);}else{_0x19ac5c[_0xdcb2('0x44')](_0x12c02d[_0xdcb2('0x8a')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x267951[_0xdcb2('0x9f')],_0x267951['endDate']);}if(_0x415d69){logger[_0xdcb2('0xa1')](_0xdcb2('0xa2'),_0x19ac5c[_0xdcb2('0x8f')]());require(_0xdcb2('0xa3'))[_0xdcb2('0xa4')](path['join'](__dirname,_0xdcb2('0xa5'),_0x415d69[_0xdcb2('0x9b')]),[_0x415d69['id'],_0x19ac5c[_0xdcb2('0x8f')](),path['join'](__dirname,_0xdcb2('0xa6'),_0x415d69[_0xdcb2('0xa7')]),_0x6a5183]);return _0x415d69;}else{var _0x5346c0=squel[_0xdcb2('0x98')]();_0x5346c0[_0xdcb2('0x7b')]('('+_0x19ac5c[_0xdcb2('0x8f')]()+')','countTable');_0x5346c0[_0xdcb2('0x73')](_0xdcb2('0xa8'),'count');_0x19ac5c[_0xdcb2('0x20')](_0x267951[_0xdcb2('0x20')]||_0x3596dc);_0x19ac5c[_0xdcb2('0x1e')](_0x267951[_0xdcb2('0x1e')]||0x0);return dbH[_0xdcb2('0x90')]['query'](_0x5346c0[_0xdcb2('0x8f')](),{'type':dbH[_0xdcb2('0x90')][_0xdcb2('0x91')][_0xdcb2('0x92')]})[_0xdcb2('0x28')](function(_0x52eb90){if(!_0x52eb90[_0xdcb2('0x52')]){_0x358934=0x0;}else{_0x358934=_0x52eb90[0x0][_0xdcb2('0x21')]||0x0;}return dbH['sequelize'][_0xdcb2('0x3d')](_0x19ac5c[_0xdcb2('0x8f')](),{'type':dbH[_0xdcb2('0x90')]['QueryTypes'][_0xdcb2('0x92')]});})[_0xdcb2('0x28')](function(_0x4d03a5){return{'rows':_0x4d03a5||[],'count':_0x358934};});}});}exports['run']=function(_0x436e01,_0x130b82){return runReport(_0x436e01['params'],_0x436e01[_0xdcb2('0x3d')],_0x436e01[_0xdcb2('0x4a')])['then'](respondWithResult(_0x130b82,null))[_0xdcb2('0x4f')](handleError(_0x130b82,null));};exports['runReport']=runReport;exports[_0xdcb2('0x3d')]=function(_0xa5f4fb,_0x451cb9){var _0x1edd48=0xa;var _0xd232e=[_0xdcb2('0x5f'),_0xdcb2('0x60'),_0xdcb2('0x61'),_0xdcb2('0x62')];var _0x266d44={'SUM':'SUM(%s)','COUNT':_0xdcb2('0x63'),'COUNT DISTINCT':_0xdcb2('0x64'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xdcb2('0x68'),'GROUP_CONCAT ASC':_0xdcb2('0xa9'),'GROUP_CONCAT DESC':_0xdcb2('0x69')};var _0x4d10bc={'SEC_TO_TIME':_0xdcb2('0x94'),'DATE':_0xdcb2('0x6a'),'HOUR':_0xdcb2('0x6b'),'ROUND':_0xdcb2('0x6c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x586320=function(_0x2ede64){return!_['includes'](['IS\x20NULL',_0xdcb2('0x6f'),_0xdcb2('0xaa'),_0xdcb2('0x70')],_0x2ede64);};var _0xf00a52=function(_0x1c77bc){if(!_0x1c77bc||!_0x1c77bc[_0xdcb2('0x71')]['length']){return'';}for(var _0x289523='(',_0x10ffb2=0x0;_0x10ffb2<_0x1c77bc[_0xdcb2('0x71')][_0xdcb2('0x52')];_0x10ffb2+=0x1){_0x10ffb2>0x0&&(_0x289523+='\x20'+_0x1c77bc['operator']+'\x20');_0x289523+=_0x1c77bc[_0xdcb2('0x71')][_0x10ffb2][_0xdcb2('0x72')]?_0xf00a52(_0x1c77bc[_0xdcb2('0x71')][_0x10ffb2][_0xdcb2('0x72')]):_0x1c77bc['rules'][_0x10ffb2]['field']+'\x20'+_0x1c77bc[_0xdcb2('0x71')][_0x10ffb2][_0xdcb2('0x74')]+(_0x586320(_0x1c77bc[_0xdcb2('0x71')][_0x10ffb2]['condition'])?'\x20'+_0x1c77bc['rules'][_0x10ffb2]['value']:'');}return _0x289523+')';};var _0x5338ce={'where':{'id':_0xa5f4fb['params']['id']}},_0x4df523,_0x55242c,_0xb511c2,_0x19408b,_0x184d09;_0x5338ce=_['merge']({},_0x5338ce,_0xa5f4fb[_0xdcb2('0x4a')]);return db['AnalyticCustomReport'][_0xdcb2('0x53')](_0x5338ce)['then'](function(_0x147c59){if(_0x147c59){_0x4df523=_0x147c59;return _0x147c59[_0xdcb2('0xab')]();}return null;})[_0xdcb2('0x28')](function(_0x2f8941){if(_0x2f8941){if(!_0x2f8941[_0xdcb2('0x52')]){throw new db['Sequelize'][(_0xdcb2('0x77'))](_0xdcb2('0x78'),0x193);}_0x55242c=_0x2f8941;return db['AnalyticMetric'][_0xdcb2('0x4d')]({'raw':!![]});}return null;})[_0xdcb2('0x28')](function(_0x1bd0b1){if(_0x1bd0b1){_0xb511c2=_[_0xdcb2('0x7a')](_0x1bd0b1,'id');var _0x1299a4;var _0x206c89=squel['select']();_0x206c89[_0xdcb2('0x7b')](_0x4df523[_0xdcb2('0x8a')]);for(var _0x25d5e7=0x0;_0x25d5e7<_0x55242c['length'];_0x25d5e7+=0x1){_0x1299a4=_0x55242c[_0x25d5e7][_0xdcb2('0x7c')]?_0xb511c2[_0x55242c[_0x25d5e7][_0xdcb2('0x7c')]][_0xdcb2('0xac')]:_0x55242c[_0x25d5e7][_0xdcb2('0x73')];_0x1299a4=_0x55242c[_0x25d5e7][_0xdcb2('0x7d')]?_['replace'](_0x266d44[_0x55242c[_0x25d5e7][_0xdcb2('0x7d')]],'%s',_0x1299a4):_0x1299a4;_0x1299a4=_0x55242c[_0x25d5e7][_0xdcb2('0x7f')]?_[_0xdcb2('0x7e')](_0x4d10bc[_0x55242c[_0x25d5e7][_0xdcb2('0x7f')]],'%s',_0x1299a4):_0x1299a4;if(_0x55242c[_0x25d5e7][_0xdcb2('0x80')]){_0x206c89[_0xdcb2('0x72')](_0x1299a4);}_0x55242c[_0x25d5e7][_0xdcb2('0x81')]&&_0x206c89[_0xdcb2('0x42')](_0x1299a4,_0x55242c[_0x25d5e7]['orderBy']===_0xdcb2('0x82')?![]:!![]);_0x206c89[_0xdcb2('0x73')](_0x1299a4,_0x55242c[_0x25d5e7][_0xdcb2('0x83')]||_0x1299a4);}if(_0x4df523[_0xdcb2('0x84')]){_0x4df523[_0xdcb2('0x84')]=JSON['parse'](_0x4df523[_0xdcb2('0x84')]);for(var _0x38aa55=0x0;_0x38aa55<_0x4df523[_0xdcb2('0x84')][_0xdcb2('0x52')];_0x38aa55+=0x1){if(_0x4df523[_0xdcb2('0x84')][_0x38aa55][_0xdcb2('0x48')]&&_[_0xdcb2('0x6d')](_0xd232e,_0x4df523['joins'][_0x38aa55][_0xdcb2('0x48')])&&_0x4df523['joins'][_0x38aa55][_0xdcb2('0x86')]&&_0x4df523[_0xdcb2('0x84')][_0x38aa55][_0xdcb2('0x87')]&&_0x4df523[_0xdcb2('0x84')][_0x38aa55][_0xdcb2('0x88')]){_0x206c89[_0x4df523[_0xdcb2('0x84')][_0x38aa55][_0xdcb2('0x48')]](_0x4df523['joins'][_0x38aa55][_0xdcb2('0x87')],null,util[_0xdcb2('0x7f')](_0xdcb2('0x89'),_0x4df523[_0xdcb2('0x8a')],_0x4df523[_0xdcb2('0x84')][_0x38aa55][_0xdcb2('0x86')],_0x4df523[_0xdcb2('0x84')][_0x38aa55][_0xdcb2('0x87')],_0x4df523[_0xdcb2('0x84')][_0x38aa55][_0xdcb2('0x88')]));}}}if(_0x4df523['conditions']){_0x4df523[_0xdcb2('0x8b')]=JSON[_0xdcb2('0x85')](_0x4df523['conditions']);_0x206c89[_0xdcb2('0x44')](_0xf00a52(_0x4df523[_0xdcb2('0x8b')][_0xdcb2('0x72')]));}_0x184d09=_0x206c89['clone']();_0x206c89[_0xdcb2('0x20')](_0x1edd48);_0x206c89[_0xdcb2('0x1e')](0x0);logger[_0xdcb2('0x8d')](_0xdcb2('0x8e'),_0x206c89[_0xdcb2('0x8f')]());return dbH[_0xdcb2('0x90')][_0xdcb2('0x3d')](_0x206c89[_0xdcb2('0x8f')](),{'type':dbH[_0xdcb2('0x90')][_0xdcb2('0x91')][_0xdcb2('0x92')]});}})['then'](function(){return{'sql':_0x184d09[_0xdcb2('0x8f')]()};})[_0xdcb2('0x28')](respondWithResult(_0x451cb9,null))[_0xdcb2('0x4f')](handleError(_0x451cb9,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 671678a..23800fd 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 _0xc2f7=['exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes'];(function(_0x4c1361,_0x54b845){var _0x5d3639=function(_0x46ba1d){while(--_0x46ba1d){_0x4c1361['push'](_0x4c1361['shift']());}};_0x5d3639(++_0x54b845);}(_0xc2f7,0x1d5));var _0x7c2f=function(_0x4f0cef,_0x3a48ef){_0x4f0cef=_0x4f0cef-0x0;var _0x10c590=_0xc2f7[_0x4f0cef];return _0x10c590;};'use strict';var _=require(_0x7c2f('0x0'));var util=require(_0x7c2f('0x1'));var logger=require(_0x7c2f('0x2'))(_0x7c2f('0x3'));var moment=require(_0x7c2f('0x4'));var BPromise=require(_0x7c2f('0x5'));var rp=require(_0x7c2f('0x6'));var fs=require('fs');var path=require(_0x7c2f('0x7'));var rimraf=require(_0x7c2f('0x8'));var config=require(_0x7c2f('0x9'));var attributes=require(_0x7c2f('0xa'));module[_0x7c2f('0xb')]=function(_0x3faa1c,_0x50608e){return _0x3faa1c[_0x7c2f('0xc')](_0x7c2f('0xd'),attributes,{'tableName':_0x7c2f('0xe'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe02a=['moment','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','analytics_custom_reports','lodash','util','api'];(function(_0x40632e,_0x1f7f8f){var _0x3708c4=function(_0x3fd2d1){while(--_0x3fd2d1){_0x40632e['push'](_0x40632e['shift']());}};_0x3708c4(++_0x1f7f8f);}(_0xe02a,0xb8));var _0xae02=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xe02a[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xae02('0x0'));var util=require(_0xae02('0x1'));var logger=require('../../config/logger')(_0xae02('0x2'));var moment=require(_0xae02('0x3'));var BPromise=require(_0xae02('0x4'));var rp=require(_0xae02('0x5'));var fs=require('fs');var path=require(_0xae02('0x6'));var rimraf=require('rimraf');var config=require(_0xae02('0x7'));var attributes=require(_0xae02('0x8'));module[_0xae02('0x9')]=function(_0x51c003,_0x3175d0){return _0x51c003['define']('AnalyticCustomReport',attributes,{'tableName':_0xae02('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 11af6b8..f06b62e 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 _0x4753=['lodash','util','moment','randomstring','ioredis','../../config/utils','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'];(function(_0x2c1aa8,_0x3e0609){var _0x4019f5=function(_0x916eac){while(--_0x916eac){_0x2c1aa8['push'](_0x2c1aa8['shift']());}};_0x4019f5(++_0x3e0609);}(_0x4753,0x1f4));var _0x3475=function(_0x4f46ee,_0x52facb){_0x4f46ee=_0x4f46ee-0x0;var _0xe40af3=_0x4753[_0x4f46ee];return _0xe40af3;};'use strict';var _=require(_0x3475('0x0'));var util=require(_0x3475('0x1'));var moment=require(_0x3475('0x2'));var BPromise=require('bluebird');var rs=require(_0x3475('0x3'));var fs=require('fs');var Redis=require(_0x3475('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3475('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3475('0x6')][_0x3475('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x48c6af,_0x820cbe,_0x157c1e){return new BPromise(function(_0x409bfc,_0x1d021b){return client[_0x3475('0x8')](_0x48c6af,_0x157c1e)[_0x3475('0x9')](function(_0x2c4cd7){logger[_0x3475('0xa')](_0x3475('0xb'),_0x820cbe,_0x3475('0xc'));logger['debug'](_0x3475('0xd'),_0x820cbe,_0x3475('0xc'),JSON[_0x3475('0xe')](_0x2c4cd7));if(_0x2c4cd7['error']){if(_0x2c4cd7[_0x3475('0xf')][_0x3475('0x10')]===0x1f4){logger['error'](_0x3475('0xb'),_0x820cbe,_0x2c4cd7['error'][_0x3475('0x11')]);return _0x1d021b(_0x2c4cd7[_0x3475('0xf')][_0x3475('0x11')]);}logger['error'](_0x3475('0xb'),_0x820cbe,_0x2c4cd7[_0x3475('0xf')][_0x3475('0x11')]);return _0x409bfc(_0x2c4cd7[_0x3475('0xf')]['message']);}else{logger[_0x3475('0xa')]('AnalyticCustomReport,\x20%s,\x20%s',_0x820cbe,'request\x20sent');_0x409bfc(_0x2c4cd7[_0x3475('0x12')][_0x3475('0x11')]);}})[_0x3475('0x13')](function(_0x1e0c0a){logger[_0x3475('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x820cbe,_0x1e0c0a);_0x1d021b(_0x1e0c0a);});});}
\ No newline at end of file
+var _0xbc41=['then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xbc41,0x129));var _0x1bc4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc41[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1bc4('0x0'));var util=require(_0x1bc4('0x1'));var moment=require(_0x1bc4('0x2'));var BPromise=require('bluebird');var rs=require(_0x1bc4('0x3'));var fs=require('fs');var Redis=require(_0x1bc4('0x4'));var db=require(_0x1bc4('0x5'))['db'];var utils=require(_0x1bc4('0x6'));var logger=require(_0x1bc4('0x7'))('rpc');var config=require(_0x1bc4('0x8'));var jayson=require(_0x1bc4('0x9'));var client=jayson['client'][_0x1bc4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17545d,_0x388043,_0x4b2290){return new BPromise(function(_0xf76e64,_0x4209af){return client['request'](_0x17545d,_0x4b2290)[_0x1bc4('0xb')](function(_0xccc513){logger[_0x1bc4('0xc')](_0x1bc4('0xd'),_0x388043,_0x1bc4('0xe'));logger[_0x1bc4('0xf')](_0x1bc4('0x10'),_0x388043,'request\x20sent',JSON[_0x1bc4('0x11')](_0xccc513));if(_0xccc513['error']){if(_0xccc513[_0x1bc4('0x12')][_0x1bc4('0x13')]===0x1f4){logger[_0x1bc4('0x12')](_0x1bc4('0xd'),_0x388043,_0xccc513[_0x1bc4('0x12')]['message']);return _0x4209af(_0xccc513[_0x1bc4('0x12')][_0x1bc4('0x14')]);}logger[_0x1bc4('0x12')](_0x1bc4('0xd'),_0x388043,_0xccc513[_0x1bc4('0x12')][_0x1bc4('0x14')]);return _0xf76e64(_0xccc513[_0x1bc4('0x12')]['message']);}else{logger['info'](_0x1bc4('0xd'),_0x388043,_0x1bc4('0xe'));_0xf76e64(_0xccc513[_0x1bc4('0x15')][_0x1bc4('0x14')]);}})['catch'](function(_0x1afbec){logger[_0x1bc4('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x388043,_0x1afbec);_0x4209af(_0x1afbec);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 7e80dd4..ce3638b 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 _0x5790=['../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','/:id/query','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x5790,0xa1));var _0x0579=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5790[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x0579('0x0'));var util=require('util');var path=require(_0x0579('0x1'));var timeout=require(_0x0579('0x2'));var express=require(_0x0579('0x3'));var router=express[_0x0579('0x4')]();var fs_extra=require(_0x0579('0x5'));var auth=require(_0x0579('0x6'));var interaction=require(_0x0579('0x7'));var config=require(_0x0579('0x8'));var controller=require(_0x0579('0x9'));router[_0x0579('0xa')]('/',auth[_0x0579('0xb')](),controller[_0x0579('0xc')]);router[_0x0579('0xa')](_0x0579('0xd'),auth[_0x0579('0xb')](),controller[_0x0579('0xe')]);router[_0x0579('0xa')](_0x0579('0xf'),auth[_0x0579('0xb')](),controller['preview']);router['get'](_0x0579('0x10'),auth[_0x0579('0xb')](),controller['run']);router[_0x0579('0xa')](_0x0579('0x11'),auth['isAuthenticated'](),controller['query']);router[_0x0579('0x12')]('/',auth[_0x0579('0xb')](),controller[_0x0579('0x13')]);router[_0x0579('0x14')](_0x0579('0xd'),auth[_0x0579('0xb')](),controller['update']);router[_0x0579('0x15')](_0x0579('0xd'),auth[_0x0579('0xb')](),controller[_0x0579('0x16')]);module[_0x0579('0x17')]=router;
\ No newline at end of file
+var _0x4b38=['delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','index','/:id','show','preview','/:id/run','isAuthenticated','/:id/query','query','update'];(function(_0x2c288a,_0x5bec79){var _0x1ec358=function(_0x2c3f43){while(--_0x2c3f43){_0x2c288a['push'](_0x2c288a['shift']());}};_0x1ec358(++_0x5bec79);}(_0x4b38,0x157));var _0x84b3=function(_0x19ab7c,_0xea4711){_0x19ab7c=_0x19ab7c-0x0;var _0x56492a=_0x4b38[_0x19ab7c];return _0x56492a;};'use strict';var multer=require(_0x84b3('0x0'));var util=require('util');var path=require(_0x84b3('0x1'));var timeout=require('connect-timeout');var express=require(_0x84b3('0x2'));var router=express[_0x84b3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x84b3('0x4'));var interaction=require(_0x84b3('0x5'));var config=require('../../config/environment');var controller=require(_0x84b3('0x6'));router[_0x84b3('0x7')]('/',auth['isAuthenticated'](),controller[_0x84b3('0x8')]);router['get'](_0x84b3('0x9'),auth['isAuthenticated'](),controller[_0x84b3('0xa')]);router[_0x84b3('0x7')]('/:id/preview',auth['isAuthenticated'](),controller[_0x84b3('0xb')]);router[_0x84b3('0x7')](_0x84b3('0xc'),auth[_0x84b3('0xd')](),controller['run']);router[_0x84b3('0x7')](_0x84b3('0xe'),auth[_0x84b3('0xd')](),controller[_0x84b3('0xf')]);router['post']('/',auth[_0x84b3('0xd')](),controller['create']);router['put'](_0x84b3('0x9'),auth[_0x84b3('0xd')](),controller[_0x84b3('0x10')]);router[_0x84b3('0x11')](_0x84b3('0x9'),auth[_0x84b3('0xd')](),controller[_0x84b3('0x12')]);module[_0x84b3('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index ff04620..0edfa65 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 _0x5a49=['sequelize','STRING','TEXT'];(function(_0x50771b,_0x2bcea9){var _0x10071b=function(_0x3ca6a5){while(--_0x3ca6a5){_0x50771b['push'](_0x50771b['shift']());}};_0x10071b(++_0x2bcea9);}(_0x5a49,0x18f));var _0x95a4=function(_0x21987e,_0x24e684){_0x21987e=_0x21987e-0x0;var _0x4535e9=_0x5a49[_0x21987e];return _0x4535e9;};'use strict';var Sequelize=require(_0x95a4('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x95a4('0x1')]},'parent':{'type':Sequelize[_0x95a4('0x1')]},'table':{'type':Sequelize[_0x95a4('0x1')]},'conditions':{'type':Sequelize[_0x95a4('0x2')]},'joins':{'type':Sequelize[_0x95a4('0x2')]}};
\ No newline at end of file
+var _0x6168=['STRING','TEXT','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6168,0x1ea));var _0x8616=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x6168[_0x2235bf];return _0x4c3a64;};'use strict';var Sequelize=require(_0x8616('0x0'));module[_0x8616('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8616('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x8616('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index dff12dd..e15fc1c 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 _0xcb7b=['nolimit','order','sort','filters','filter','where','VIRTUAL','options','include','rows','catch','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','from','MetricId','metric','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','MAX(%s)','MIN(%s)','DATE(%s)','operator','condition','Sequelize','output','web','fullPath','randomstring','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','QueryTypes','SELECT','run','runReport','GROUP_CONCAT(%s)','ValidationErrorItem','select','eml-format','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','send','render','merge','contact','message','interaction','account','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','query','keys','intersection','fields','length','attributes','hasOwnProperty'];(function(_0x2bf966,_0xbbf9bf){var _0x3bf11f=function(_0x22c90a){while(--_0x22c90a){_0x2bf966['push'](_0x2bf966['shift']());}};_0x3bf11f(++_0xbbf9bf);}(_0xcb7b,0x119));var _0xbcb7=function(_0x1087ca,_0x170952){_0x1087ca=_0x1087ca-0x0;var _0x4887b5=_0xcb7b[_0x1087ca];return _0x4887b5;};'use strict';var emlformat=require(_0xbcb7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbcb7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbcb7('0x2'));var util=require(_0xbcb7('0x3'));var path=require(_0xbcb7('0x4'));var sox=require(_0xbcb7('0x5'));var csv=require(_0xbcb7('0x6'));var ejs=require(_0xbcb7('0x7'));var fs=require('fs');var fs_extra=require(_0xbcb7('0x8'));var _=require(_0xbcb7('0x9'));var squel=require(_0xbcb7('0xa'));var crypto=require('crypto');var jsforce=require(_0xbcb7('0xb'));var deskjs=require(_0xbcb7('0xc'));var toCsv=require('to-csv');var querystring=require(_0xbcb7('0xd'));var Papa=require(_0xbcb7('0xe'));var Redis=require(_0xbcb7('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xbcb7('0x10'));var as=require(_0xbcb7('0x11'));var hardwareService=require(_0xbcb7('0x12'));var logger=require(_0xbcb7('0x13'))('api');var utils=require(_0xbcb7('0x14'));var config=require(_0xbcb7('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xbcb7('0x16'))['db'];var dbH=require(_0xbcb7('0x16'))['dbH'];function respondWithStatusCode(_0x30cab3,_0x19c7b5){_0x19c7b5=_0x19c7b5||0xcc;return function(_0x26f7ee){if(_0x26f7ee){return _0x30cab3[_0xbcb7('0x17')](_0x19c7b5);}return _0x30cab3[_0xbcb7('0x18')](_0x19c7b5)[_0xbcb7('0x19')]();};}function respondWithResult(_0x483a0d,_0x492ecb){_0x492ecb=_0x492ecb||0xc8;return function(_0x1c6981){if(_0x1c6981){return _0x483a0d[_0xbcb7('0x18')](_0x492ecb)[_0xbcb7('0x1a')](_0x1c6981);}};}function respondWithFilteredResult(_0x3f3e10,_0x51c93e){return function(_0x509504){if(_0x509504){var _0x7eb71d=typeof _0x51c93e[_0xbcb7('0x1b')]===_0xbcb7('0x1c')&&typeof _0x51c93e['limit']===_0xbcb7('0x1c');var _0x2008aa=_0x509504['count'];var _0x13fb5a=_0x7eb71d?0x0:_0x51c93e[_0xbcb7('0x1b')];var _0xe7d4b2=_0x7eb71d?_0x509504[_0xbcb7('0x1d')]:_0x51c93e['offset']+_0x51c93e[_0xbcb7('0x1e')];var _0x31325c;if(_0xe7d4b2>=_0x2008aa){_0xe7d4b2=_0x2008aa;_0x31325c=0xc8;}else{_0x31325c=0xce;}_0x3f3e10[_0xbcb7('0x18')](_0x31325c);return _0x3f3e10[_0xbcb7('0x1f')](_0xbcb7('0x20'),_0x13fb5a+'-'+_0xe7d4b2+'/'+_0x2008aa)[_0xbcb7('0x1a')](_0x509504);}return null;};}function patchUpdates(_0x53a20c){return function(_0x47a305){try{jsonpatch[_0xbcb7('0x21')](_0x47a305,_0x53a20c,!![]);}catch(_0x551fbf){return BPromise['reject'](_0x551fbf);}return _0x47a305[_0xbcb7('0x22')]();};}function saveUpdates(_0x5af0a7,_0x16d9b9){return function(_0x21a0b9){if(_0x21a0b9){return _0x21a0b9[_0xbcb7('0x23')](_0x5af0a7)[_0xbcb7('0x24')](function(_0x52c101){return _0x52c101;});}return null;};}function removeEntity(_0x2e69ac,_0x46d8f1){return function(_0x1a7a2b){if(_0x1a7a2b){return _0x1a7a2b[_0xbcb7('0x25')]()[_0xbcb7('0x24')](function(){var _0x2f1ced=_0x1a7a2b[_0xbcb7('0x26')]({'plain':!![]});var _0x31f352=_0xbcb7('0x27');return db[_0xbcb7('0x28')]['destroy']({'where':{'type':_0x31f352,'resourceId':_0x2f1ced['id']}})['then'](function(){return _0x1a7a2b;});})['then'](function(){_0x2e69ac[_0xbcb7('0x18')](0xcc)[_0xbcb7('0x19')]();});}};}function handleEntityNotFound(_0x5b40b5,_0x575ddf){return function(_0x24dd96){if(!_0x24dd96){_0x5b40b5['sendStatus'](0x194);}return _0x24dd96;};}function handleError(_0x5da60b,_0x4bba00){_0x4bba00=_0x4bba00||0x1f4;return function(_0x9fd152){logger['error'](_0x9fd152['stack']);if(_0x9fd152[_0xbcb7('0x29')]){delete _0x9fd152[_0xbcb7('0x29')];}_0x5da60b[_0xbcb7('0x18')](_0x4bba00)[_0xbcb7('0x2a')](_0x9fd152);};}function getMustacheRender(_0x502ff1,_0x2d2a7b){return Mustache[_0xbcb7('0x2b')](_0x502ff1,_[_0xbcb7('0x2c')](_0x2d2a7b['body'],{'contact':_0x2d2a7b[_0xbcb7('0x2d')],'message':_0x2d2a7b[_0xbcb7('0x2e')],'agent':_0x2d2a7b['agent'],'interaction':_0x2d2a7b[_0xbcb7('0x2f')],'account':_0x2d2a7b[_0xbcb7('0x30')]}))||'';}exports[_0xbcb7('0x31')]=function(_0x283c99,_0x4c89d4){var _0x5965fd={},_0x1d482a={},_0x173788={'count':0x0,'rows':[]};var _0x19e074=_[_0xbcb7('0x32')](db[_0xbcb7('0x33')][_0xbcb7('0x34')],function(_0x18851c){return{'name':_0x18851c[_0xbcb7('0x35')],'type':_0x18851c[_0xbcb7('0x36')]['key']};});_0x1d482a[_0xbcb7('0x37')]=_[_0xbcb7('0x32')](_0x19e074,'name');_0x1d482a[_0xbcb7('0x38')]=_[_0xbcb7('0x39')](_0x283c99[_0xbcb7('0x38')]);_0x1d482a['filters']=_['intersection'](_0x1d482a[_0xbcb7('0x37')],_0x1d482a[_0xbcb7('0x38')]);_0x5965fd['attributes']=_[_0xbcb7('0x3a')](_0x1d482a['model'],qs[_0xbcb7('0x3b')](_0x283c99[_0xbcb7('0x38')][_0xbcb7('0x3b')]));_0x5965fd['attributes']=_0x5965fd['attributes'][_0xbcb7('0x3c')]?_0x5965fd[_0xbcb7('0x3d')]:_0x1d482a[_0xbcb7('0x37')];if(!_0x283c99[_0xbcb7('0x38')][_0xbcb7('0x3e')](_0xbcb7('0x3f'))){_0x5965fd[_0xbcb7('0x1e')]=qs[_0xbcb7('0x1e')](_0x283c99[_0xbcb7('0x38')][_0xbcb7('0x1e')]);_0x5965fd[_0xbcb7('0x1b')]=qs[_0xbcb7('0x1b')](_0x283c99[_0xbcb7('0x38')][_0xbcb7('0x1b')]);}_0x5965fd[_0xbcb7('0x40')]=qs[_0xbcb7('0x41')](_0x283c99[_0xbcb7('0x38')]['sort']);_0x5965fd['where']=qs[_0xbcb7('0x42')](_['pick'](_0x283c99[_0xbcb7('0x38')],_0x1d482a[_0xbcb7('0x42')]),_0x19e074);if(_0x283c99[_0xbcb7('0x38')][_0xbcb7('0x43')]){_0x5965fd[_0xbcb7('0x44')]=_['merge'](_0x5965fd[_0xbcb7('0x44')],{'$or':_['map'](_0x19e074,function(_0x246251){if(_0x246251['type']!==_0xbcb7('0x45')){var _0x58504b={};_0x58504b[_0x246251['name']]={'$like':'%'+_0x283c99[_0xbcb7('0x38')][_0xbcb7('0x43')]+'%'};return _0x58504b;}})});}_0x5965fd=_['merge']({},_0x5965fd,_0x283c99[_0xbcb7('0x46')]);var _0x291471={'where':_0x5965fd[_0xbcb7('0x44')]};return db[_0xbcb7('0x33')][_0xbcb7('0x1d')](_0x291471)[_0xbcb7('0x24')](function(_0x5720a3){_0x173788[_0xbcb7('0x1d')]=_0x5720a3;if(_0x283c99[_0xbcb7('0x38')]['includeAll']){_0x5965fd[_0xbcb7('0x47')]=[{'all':!![]}];}return db[_0xbcb7('0x33')]['findAll'](_0x5965fd);})[_0xbcb7('0x24')](function(_0x470bd7){_0x173788[_0xbcb7('0x48')]=_0x470bd7;return _0x173788;})[_0xbcb7('0x24')](respondWithFilteredResult(_0x4c89d4,_0x5965fd))[_0xbcb7('0x49')](handleError(_0x4c89d4,null));};exports['show']=function(_0x311121,_0x3781b3){var _0x3b2a6a={'raw':!![],'where':{'id':_0x311121['params']['id']}},_0x8d966={};_0x8d966[_0xbcb7('0x37')]=_['keys'](db[_0xbcb7('0x33')][_0xbcb7('0x34')]);_0x8d966['query']=_[_0xbcb7('0x39')](_0x311121['query']);_0x8d966[_0xbcb7('0x42')]=_[_0xbcb7('0x3a')](_0x8d966[_0xbcb7('0x37')],_0x8d966['query']);_0x3b2a6a['attributes']=_[_0xbcb7('0x3a')](_0x8d966[_0xbcb7('0x37')],qs['fields'](_0x311121[_0xbcb7('0x38')][_0xbcb7('0x3b')]));_0x3b2a6a['attributes']=_0x3b2a6a[_0xbcb7('0x3d')][_0xbcb7('0x3c')]?_0x3b2a6a[_0xbcb7('0x3d')]:_0x8d966[_0xbcb7('0x37')];if(_0x311121[_0xbcb7('0x38')][_0xbcb7('0x4a')]){_0x3b2a6a[_0xbcb7('0x47')]=[{'all':!![]}];}_0x3b2a6a=_['merge']({},_0x3b2a6a,_0x311121[_0xbcb7('0x46')]);return db['AnalyticDefaultReport'][_0xbcb7('0x4b')](_0x3b2a6a)[_0xbcb7('0x24')](handleEntityNotFound(_0x3781b3,null))[_0xbcb7('0x24')](respondWithResult(_0x3781b3,null))['catch'](handleError(_0x3781b3,null));};exports[_0xbcb7('0x4c')]=function(_0xc68bba,_0x5636f2){return db[_0xbcb7('0x33')][_0xbcb7('0x4c')](_0xc68bba['body'],{})[_0xbcb7('0x24')](function(_0x9d640f){var _0x1b7bbd=_0xc68bba[_0xbcb7('0x4d')][_0xbcb7('0x26')]({'plain':!![]});if(!_0x1b7bbd)throw new Error(_0xbcb7('0x4e'));if(_0x1b7bbd[_0xbcb7('0x4f')]==='user'){var _0x37237b=_0x9d640f[_0xbcb7('0x26')]({'plain':!![]});var _0x253187=_0xbcb7('0x50');return db[_0xbcb7('0x51')]['find']({'where':{'name':_0x253187,'userProfileId':_0x1b7bbd[_0xbcb7('0x52')]},'raw':!![]})[_0xbcb7('0x24')](function(_0x3f337e){if(_0x3f337e&&_0x3f337e[_0xbcb7('0x53')]===0x0){return db['UserProfileResource'][_0xbcb7('0x4c')]({'name':_0x37237b[_0xbcb7('0x29')],'resourceId':_0x37237b['id'],'type':_0xbcb7('0x27'),'sectionId':_0x3f337e['id']},{})['then'](function(){return _0x9d640f;});}else{return _0x9d640f;}})[_0xbcb7('0x49')](function(_0x28c726){logger[_0xbcb7('0x54')](_0xbcb7('0x55'),_0x28c726);throw _0x28c726;});}return _0x9d640f;})[_0xbcb7('0x24')](respondWithResult(_0x5636f2,0xc9))[_0xbcb7('0x49')](handleError(_0x5636f2,null));};exports['update']=function(_0x2e7895,_0x522a62){if(_0x2e7895['body']['id']){delete _0x2e7895['body']['id'];}return db[_0xbcb7('0x33')][_0xbcb7('0x4b')]({'where':{'id':_0x2e7895['params']['id']}})[_0xbcb7('0x24')](handleEntityNotFound(_0x522a62,null))['then'](saveUpdates(_0x2e7895[_0xbcb7('0x56')],null))[_0xbcb7('0x24')](respondWithResult(_0x522a62,null))[_0xbcb7('0x49')](handleError(_0x522a62,null));};exports[_0xbcb7('0x25')]=function(_0x3bfdb1,_0x435c31){return db[_0xbcb7('0x33')]['find']({'where':{'id':_0x3bfdb1[_0xbcb7('0x57')]['id']}})[_0xbcb7('0x24')](handleEntityNotFound(_0x435c31,null))['then'](removeEntity(_0x435c31,null))[_0xbcb7('0x49')](handleError(_0x435c31,null));};exports[_0xbcb7('0x58')]=function(_0x3adf98,_0x1ec83e){var _0x3775f5=0xa;var _0x1355f4=[_0xbcb7('0x59'),_0xbcb7('0x5a'),_0xbcb7('0x5b'),_0xbcb7('0x5c')];var _0x159e96={'SUM':_0xbcb7('0x5d'),'COUNT':_0xbcb7('0x5e'),'COUNT DISTINCT':_0xbcb7('0x5f'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xbcb7('0x60'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xbcb7('0x61'),'GROUP_CONCAT DESC':_0xbcb7('0x62')};var _0x7eda18={'SEC_TO_TIME':_0xbcb7('0x63'),'DATE':'DATE(%s)','HOUR':_0xbcb7('0x64'),'ROUND':_0xbcb7('0x65'),'UNIX_TIMESTAMP':_0xbcb7('0x66')};var _0x2ea261=function(_0x120c97){return!_[_0xbcb7('0x67')]([_0xbcb7('0x68'),_0xbcb7('0x69'),_0xbcb7('0x6a'),_0xbcb7('0x6b')],_0x120c97);};var _0x155949=function(_0xf576dd){if(!_0xf576dd||!_0xf576dd['rules'][_0xbcb7('0x3c')]){return'';}for(var _0x341840='(',_0x586d1b=0x0;_0x586d1b<_0xf576dd[_0xbcb7('0x6c')]['length'];_0x586d1b+=0x1){_0x586d1b>0x0&&(_0x341840+='\x20'+_0xf576dd['operator']+'\x20');_0x341840+=_0xf576dd['rules'][_0x586d1b][_0xbcb7('0x6d')]?_0x155949(_0xf576dd['rules'][_0x586d1b][_0xbcb7('0x6d')]):_0xf576dd[_0xbcb7('0x6c')][_0x586d1b]['field']+'\x20'+_0xf576dd[_0xbcb7('0x6c')][_0x586d1b]['condition']+(_0x2ea261(_0xf576dd['rules'][_0x586d1b]['condition'])?'\x20'+_0xf576dd[_0xbcb7('0x6c')][_0x586d1b][_0xbcb7('0x6e')]:'');}return _0x341840+')';};var _0x47c12d={'where':{'id':_0x3adf98[_0xbcb7('0x57')]['id']}},_0x3b84d0,_0x21e834,_0x4740f2,_0x3774e1,_0x425ac2;_0x47c12d=_['merge']({},_0x47c12d,_0x3adf98[_0xbcb7('0x46')]);return db[_0xbcb7('0x33')][_0xbcb7('0x4b')](_0x47c12d)['then'](function(_0x560328){if(_0x560328){_0x3b84d0=_0x560328;return _0x560328[_0xbcb7('0x6f')]();}return null;})[_0xbcb7('0x24')](function(_0x5376f1){if(_0x5376f1){if(!_0x5376f1['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xbcb7('0x70'),0x193);}_0x21e834=_0x5376f1;return db[_0xbcb7('0x71')][_0xbcb7('0x72')]({'raw':!![]});}return null;})[_0xbcb7('0x24')](function(_0x3aac9f){if(_0x3aac9f){_0x4740f2=_[_0xbcb7('0x73')](_0x3aac9f,'id');var _0x4bfcac;var _0x2f3e13=squel['select']();_0x2f3e13[_0xbcb7('0x74')](_0x3b84d0['table']);for(var _0x1e49c4=0x0;_0x1e49c4<_0x21e834[_0xbcb7('0x3c')];_0x1e49c4+=0x1){_0x4bfcac=_0x21e834[_0x1e49c4]['MetricId']?_0x4740f2[_0x21e834[_0x1e49c4][_0xbcb7('0x75')]][_0xbcb7('0x76')]:_0x21e834[_0x1e49c4][_0xbcb7('0x77')];_0x4bfcac=_0x21e834[_0x1e49c4][_0xbcb7('0x78')]?_[_0xbcb7('0x79')](_0x159e96[_0x21e834[_0x1e49c4]['function']],'%s',_0x4bfcac):_0x4bfcac;_0x4bfcac=_0x21e834[_0x1e49c4][_0xbcb7('0x7a')]?_[_0xbcb7('0x79')](_0x7eda18[_0x21e834[_0x1e49c4]['format']],'%s',_0x4bfcac):_0x4bfcac;if(_0x21e834[_0x1e49c4][_0xbcb7('0x7b')]){_0x2f3e13[_0xbcb7('0x6d')](_0x4bfcac);}_0x21e834[_0x1e49c4][_0xbcb7('0x7c')]&&_0x2f3e13['order'](_0x4bfcac,_0x21e834[_0x1e49c4][_0xbcb7('0x7c')]===_0xbcb7('0x7d')?![]:!![]);_0x2f3e13['field'](_0x4bfcac,_0x21e834[_0x1e49c4][_0xbcb7('0x7e')]||_0x4bfcac);}if(_0x3b84d0[_0xbcb7('0x7f')]){_0x3b84d0['joins']=JSON[_0xbcb7('0x80')](_0x3b84d0[_0xbcb7('0x7f')]);for(var _0x4a95e6=0x0;_0x4a95e6<_0x3b84d0[_0xbcb7('0x7f')][_0xbcb7('0x3c')];_0x4a95e6+=0x1){if(_0x3b84d0[_0xbcb7('0x7f')][_0x4a95e6][_0xbcb7('0x36')]&&_[_0xbcb7('0x67')](_0x1355f4,_0x3b84d0[_0xbcb7('0x7f')][_0x4a95e6][_0xbcb7('0x36')])&&_0x3b84d0[_0xbcb7('0x7f')][_0x4a95e6][_0xbcb7('0x81')]&&_0x3b84d0[_0xbcb7('0x7f')][_0x4a95e6][_0xbcb7('0x82')]&&_0x3b84d0[_0xbcb7('0x7f')][_0x4a95e6][_0xbcb7('0x83')]){_0x2f3e13[_0x3b84d0[_0xbcb7('0x7f')][_0x4a95e6][_0xbcb7('0x36')]](_0x3b84d0['joins'][_0x4a95e6][_0xbcb7('0x82')],null,util['format'](_0xbcb7('0x84'),_0x3b84d0[_0xbcb7('0x85')],_0x3b84d0[_0xbcb7('0x7f')][_0x4a95e6][_0xbcb7('0x81')],_0x3b84d0['joins'][_0x4a95e6][_0xbcb7('0x82')],_0x3b84d0[_0xbcb7('0x7f')][_0x4a95e6][_0xbcb7('0x83')]));}}}if(_0x3b84d0['conditions']){_0x3b84d0['conditions']=JSON[_0xbcb7('0x80')](_0x3b84d0[_0xbcb7('0x86')]);_0x2f3e13['where'](_0x155949(_0x3b84d0['conditions'][_0xbcb7('0x6d')]));}_0x425ac2=_0x2f3e13[_0xbcb7('0x87')]();_0x2f3e13['limit'](_0x3775f5);_0x2f3e13['offset'](0x0);logger[_0xbcb7('0x88')](_0xbcb7('0x89'),_0x2f3e13[_0xbcb7('0x8a')]());return dbH['sequelize'][_0xbcb7('0x38')](_0x2f3e13[_0xbcb7('0x8a')](),{'type':dbH[_0xbcb7('0x8b')]['QueryTypes']['SELECT']});}})['then'](respondWithResult(_0x1ec83e,null))[_0xbcb7('0x49')](handleError(_0x1ec83e,null));};function runReport(_0x157d9b,_0x409c13,_0x4ee778){var _0x635e7e=_0x409c13[_0xbcb7('0x29')];var _0x2947cd=0xa;var _0x5f3786=['join','left_join',_0xbcb7('0x5b'),_0xbcb7('0x5c')];var _0x4fa18e={'SUM':_0xbcb7('0x5d'),'COUNT':_0xbcb7('0x5e'),'COUNT DISTINCT':_0xbcb7('0x5f'),'MAX':_0xbcb7('0x8c'),'MIN':_0xbcb7('0x8d'),'AVG':_0xbcb7('0x60'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xbcb7('0x61'),'GROUP_CONCAT DESC':_0xbcb7('0x62')};var _0xac6514={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xbcb7('0x8e'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xbcb7('0x66')};var _0x253171=function(_0x4f10b3){return!_['includes']([_0xbcb7('0x68'),_0xbcb7('0x69'),_0xbcb7('0x6a'),_0xbcb7('0x6b')],_0x4f10b3);};var _0x53f3ab=function(_0x144ce9){if(!_0x144ce9||!_0x144ce9[_0xbcb7('0x6c')][_0xbcb7('0x3c')]){return'';}for(var _0x447687='(',_0x2bf32c=0x0;_0x2bf32c<_0x144ce9[_0xbcb7('0x6c')][_0xbcb7('0x3c')];_0x2bf32c+=0x1){_0x2bf32c>0x0&&(_0x447687+='\x20'+_0x144ce9[_0xbcb7('0x8f')]+'\x20');_0x447687+=_0x144ce9[_0xbcb7('0x6c')][_0x2bf32c][_0xbcb7('0x6d')]?_0x53f3ab(_0x144ce9[_0xbcb7('0x6c')][_0x2bf32c][_0xbcb7('0x6d')]):_0x144ce9[_0xbcb7('0x6c')][_0x2bf32c][_0xbcb7('0x77')]+'\x20'+_0x144ce9[_0xbcb7('0x6c')][_0x2bf32c][_0xbcb7('0x90')]+(_0x253171(_0x144ce9['rules'][_0x2bf32c]['condition'])?'\x20'+_0x144ce9['rules'][_0x2bf32c][_0xbcb7('0x6e')]:'');}return _0x447687+')';};var _0x2578dd={'where':{'id':_0x157d9b['id']}},_0x5c2a45,_0x10e5cb,_0x1f4543,_0x5559ba,_0x1d28fe;_0x2578dd=_[_0xbcb7('0x2c')]({},_0x2578dd,_0x4ee778);return db['AnalyticDefaultReport'][_0xbcb7('0x4b')](_0x2578dd)['then'](function(_0x11fc6b){if(_0x11fc6b){_0x5c2a45=_0x11fc6b;return _0x11fc6b[_0xbcb7('0x6f')]();}return null;})[_0xbcb7('0x24')](function(_0x40f156){if(_0x40f156){if(!_0x40f156['length']){throw new db[(_0xbcb7('0x91'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10e5cb=_0x40f156;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xbcb7('0x24')](function(_0x2aa4c0){if(_0x2aa4c0){_0x1f4543=_[_0xbcb7('0x73')](_0x2aa4c0,'id');var _0x404475;var _0x277833=squel['select']();_0x277833[_0xbcb7('0x74')](_0x5c2a45[_0xbcb7('0x85')]);for(var _0x2d91ef=0x0;_0x2d91ef<_0x10e5cb['length'];_0x2d91ef+=0x1){_0x404475=_0x10e5cb[_0x2d91ef][_0xbcb7('0x75')]?_0x1f4543[_0x10e5cb[_0x2d91ef]['MetricId']][_0xbcb7('0x76')]:_0x10e5cb[_0x2d91ef][_0xbcb7('0x77')];_0x404475=_0x10e5cb[_0x2d91ef][_0xbcb7('0x78')]?_[_0xbcb7('0x79')](_0x4fa18e[_0x10e5cb[_0x2d91ef][_0xbcb7('0x78')]],'%s',_0x404475):_0x404475;_0x404475=_0x10e5cb[_0x2d91ef][_0xbcb7('0x7a')]?_[_0xbcb7('0x79')](_0xac6514[_0x10e5cb[_0x2d91ef]['format']],'%s',_0x404475):_0x404475;if(_0x10e5cb[_0x2d91ef][_0xbcb7('0x7b')]){_0x277833[_0xbcb7('0x6d')](_0x404475);}_0x10e5cb[_0x2d91ef][_0xbcb7('0x7c')]&&_0x277833['order'](_0x404475,_0x10e5cb[_0x2d91ef][_0xbcb7('0x7c')]==='DESC'?![]:!![]);_0x277833[_0xbcb7('0x77')](_0x404475,_0x10e5cb[_0x2d91ef][_0xbcb7('0x7e')]||_0x404475);}if(_0x5c2a45[_0xbcb7('0x7f')]){_0x5c2a45[_0xbcb7('0x7f')]=JSON[_0xbcb7('0x80')](_0x5c2a45[_0xbcb7('0x7f')]);for(var _0x50ffdc=0x0;_0x50ffdc<_0x5c2a45[_0xbcb7('0x7f')][_0xbcb7('0x3c')];_0x50ffdc+=0x1){if(_0x5c2a45[_0xbcb7('0x7f')][_0x50ffdc][_0xbcb7('0x36')]&&_['includes'](_0x5f3786,_0x5c2a45[_0xbcb7('0x7f')][_0x50ffdc][_0xbcb7('0x36')])&&_0x5c2a45[_0xbcb7('0x7f')][_0x50ffdc]['parentKey']&&_0x5c2a45['joins'][_0x50ffdc][_0xbcb7('0x82')]&&_0x5c2a45[_0xbcb7('0x7f')][_0x50ffdc][_0xbcb7('0x83')]){_0x277833[_0x5c2a45[_0xbcb7('0x7f')][_0x50ffdc][_0xbcb7('0x36')]](_0x5c2a45[_0xbcb7('0x7f')][_0x50ffdc][_0xbcb7('0x82')],null,util['format'](_0xbcb7('0x84'),_0x5c2a45['table'],_0x5c2a45[_0xbcb7('0x7f')][_0x50ffdc]['parentKey'],_0x5c2a45[_0xbcb7('0x7f')][_0x50ffdc][_0xbcb7('0x82')],_0x5c2a45['joins'][_0x50ffdc]['foreignKey']));}}}if(_0x5c2a45['conditions']){_0x5c2a45[_0xbcb7('0x86')]=JSON['parse'](_0x5c2a45[_0xbcb7('0x86')]);_0x277833['where'](_0x53f3ab(_0x5c2a45[_0xbcb7('0x86')][_0xbcb7('0x6d')]));}_0x1d28fe=_0x277833[_0xbcb7('0x87')]();_0x277833[_0xbcb7('0x1e')](_0x2947cd);_0x277833[_0xbcb7('0x1b')](0x0);return;}})['then'](function(){if(_0x409c13[_0xbcb7('0x92')]===_0xbcb7('0x93')){return null;}var _0x25ee1d=_['merge'](_0x409c13,{'name':_0x409c13[_0xbcb7('0x94')]||_0x409c13['name']||_0x5c2a45[_0xbcb7('0x29')],'basename':_0x635e7e,'savename':util[_0xbcb7('0x7a')]('%s-%s.%s',_0x409c13[_0xbcb7('0x29')]||_0x5c2a45[_0xbcb7('0x29')],require(_0xbcb7('0x95'))['generate'](0x4),_0x409c13[_0xbcb7('0x92')]||_0xbcb7('0x96')),'reportId':_0x5c2a45['id'],'reportType':_0xbcb7('0x97')});return db[_0xbcb7('0x98')][_0xbcb7('0x4c')](_0x25ee1d,{'raw':!![]});})[_0xbcb7('0x24')](function(_0x277500){if(_0x5c2a45[_0xbcb7('0x85')]===_0xbcb7('0x99')){_0x1d28fe['where'](_0x5c2a45['table']+_0xbcb7('0x9a'),_0x409c13[_0xbcb7('0x9b')],_0x409c13[_0xbcb7('0x9c')]);}else{_0x1d28fe['where'](_0x5c2a45['table']+_0xbcb7('0x9d'),_0x409c13['startDate'],_0x409c13[_0xbcb7('0x9c')]);}if(_0x277500){logger[_0xbcb7('0x9e')](_0xbcb7('0x9f'),_0x1d28fe['toString']());require(_0xbcb7('0xa0'))[_0xbcb7('0xa1')](path['join'](__dirname,_0xbcb7('0xa2'),_0x277500['output']),[_0x277500['id'],_0x1d28fe['toString'](),path[_0xbcb7('0x59')](__dirname,_0xbcb7('0xa3'),_0x277500['savename']),_0x635e7e]);return _0x277500;}else{var _0x1a7f55=squel['select']();_0x1a7f55[_0xbcb7('0x74')]('('+_0x1d28fe['toString']()+')',_0xbcb7('0xa4'));_0x1a7f55[_0xbcb7('0x77')]('COUNT(*)',_0xbcb7('0x1d'));_0x1d28fe[_0xbcb7('0x1e')](_0x409c13['limit']||_0x2947cd);_0x1d28fe[_0xbcb7('0x1b')](_0x409c13[_0xbcb7('0x1b')]||0x0);return dbH[_0xbcb7('0x8b')][_0xbcb7('0x38')](_0x1a7f55[_0xbcb7('0x8a')](),{'type':dbH[_0xbcb7('0x8b')][_0xbcb7('0xa5')][_0xbcb7('0xa6')]})[_0xbcb7('0x24')](function(_0x5d34e1){if(!_0x5d34e1['length']){_0x5559ba=0x0;}else{_0x5559ba=_0x5d34e1[0x0]['count']||0x0;}return dbH[_0xbcb7('0x8b')][_0xbcb7('0x38')](_0x1d28fe['toString'](),{'type':dbH[_0xbcb7('0x8b')][_0xbcb7('0xa5')][_0xbcb7('0xa6')]});})['then'](function(_0x476fc7){return{'rows':_0x476fc7||[],'count':_0x5559ba};});}});}exports[_0xbcb7('0xa7')]=function(_0x369d47,_0xc2bf97){return runReport(_0x369d47['params'],_0x369d47[_0xbcb7('0x38')],_0x369d47[_0xbcb7('0x46')])[_0xbcb7('0x24')](respondWithResult(_0xc2bf97,null))[_0xbcb7('0x49')](handleError(_0xc2bf97,null));};exports[_0xbcb7('0xa8')]=runReport;exports['query']=function(_0x370b64,_0x345840){var _0x5a2630=0xa;var _0x365ee5=['join',_0xbcb7('0x5a'),_0xbcb7('0x5b'),_0xbcb7('0x5c')];var _0x5265ae={'SUM':'SUM(%s)','COUNT':_0xbcb7('0x5e'),'COUNT DISTINCT':_0xbcb7('0x5f'),'MAX':_0xbcb7('0x8c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xbcb7('0xa9'),'GROUP_CONCAT ASC':_0xbcb7('0x61'),'GROUP_CONCAT DESC':_0xbcb7('0x62')};var _0x2b4e3e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xbcb7('0x8e'),'HOUR':_0xbcb7('0x64'),'ROUND':_0xbcb7('0x65'),'UNIX_TIMESTAMP':_0xbcb7('0x66')};var _0x51df76=function(_0x348666){return!_[_0xbcb7('0x67')](['IS\x20NULL',_0xbcb7('0x69'),_0xbcb7('0x6a'),_0xbcb7('0x6b')],_0x348666);};var _0x1066fe=function(_0x3239e9){if(!_0x3239e9||!_0x3239e9[_0xbcb7('0x6c')][_0xbcb7('0x3c')]){return'';}for(var _0x4e347a='(',_0x568af1=0x0;_0x568af1<_0x3239e9[_0xbcb7('0x6c')][_0xbcb7('0x3c')];_0x568af1+=0x1){_0x568af1>0x0&&(_0x4e347a+='\x20'+_0x3239e9[_0xbcb7('0x8f')]+'\x20');_0x4e347a+=_0x3239e9[_0xbcb7('0x6c')][_0x568af1][_0xbcb7('0x6d')]?_0x1066fe(_0x3239e9['rules'][_0x568af1][_0xbcb7('0x6d')]):_0x3239e9['rules'][_0x568af1][_0xbcb7('0x77')]+'\x20'+_0x3239e9[_0xbcb7('0x6c')][_0x568af1][_0xbcb7('0x90')]+(_0x51df76(_0x3239e9[_0xbcb7('0x6c')][_0x568af1][_0xbcb7('0x90')])?'\x20'+_0x3239e9['rules'][_0x568af1][_0xbcb7('0x6e')]:'');}return _0x4e347a+')';};var _0x2112ba={'where':{'id':_0x370b64[_0xbcb7('0x57')]['id']}},_0x369160,_0x192016,_0x40e76d,_0x4e9af9,_0xb8b293;_0x2112ba=_[_0xbcb7('0x2c')]({},_0x2112ba,_0x370b64['options']);return db[_0xbcb7('0x33')]['find'](_0x2112ba)['then'](function(_0x5ac2fc){if(_0x5ac2fc){_0x369160=_0x5ac2fc;return _0x5ac2fc[_0xbcb7('0x6f')]();}return null;})[_0xbcb7('0x24')](function(_0x573003){if(_0x573003){if(!_0x573003[_0xbcb7('0x3c')]){throw new db['Sequelize'][(_0xbcb7('0xaa'))](_0xbcb7('0x70'),0x193);}_0x192016=_0x573003;return db[_0xbcb7('0x71')][_0xbcb7('0x72')]({'raw':!![]});}return null;})[_0xbcb7('0x24')](function(_0xe8e08b){if(_0xe8e08b){_0x40e76d=_[_0xbcb7('0x73')](_0xe8e08b,'id');var _0x267869;var _0x171271=squel[_0xbcb7('0xab')]();_0x171271[_0xbcb7('0x74')](_0x369160[_0xbcb7('0x85')]);for(var _0x3810b7=0x0;_0x3810b7<_0x192016[_0xbcb7('0x3c')];_0x3810b7+=0x1){_0x267869=_0x192016[_0x3810b7][_0xbcb7('0x75')]?_0x40e76d[_0x192016[_0x3810b7]['MetricId']][_0xbcb7('0x76')]:_0x192016[_0x3810b7][_0xbcb7('0x77')];_0x267869=_0x192016[_0x3810b7][_0xbcb7('0x78')]?_[_0xbcb7('0x79')](_0x5265ae[_0x192016[_0x3810b7][_0xbcb7('0x78')]],'%s',_0x267869):_0x267869;_0x267869=_0x192016[_0x3810b7][_0xbcb7('0x7a')]?_['replace'](_0x2b4e3e[_0x192016[_0x3810b7][_0xbcb7('0x7a')]],'%s',_0x267869):_0x267869;if(_0x192016[_0x3810b7]['groupBy']){_0x171271[_0xbcb7('0x6d')](_0x267869);}_0x192016[_0x3810b7][_0xbcb7('0x7c')]&&_0x171271[_0xbcb7('0x40')](_0x267869,_0x192016[_0x3810b7][_0xbcb7('0x7c')]===_0xbcb7('0x7d')?![]:!![]);_0x171271[_0xbcb7('0x77')](_0x267869,_0x192016[_0x3810b7][_0xbcb7('0x7e')]||_0x267869);}if(_0x369160['joins']){_0x369160['joins']=JSON[_0xbcb7('0x80')](_0x369160[_0xbcb7('0x7f')]);for(var _0x1a5397=0x0;_0x1a5397<_0x369160[_0xbcb7('0x7f')][_0xbcb7('0x3c')];_0x1a5397+=0x1){if(_0x369160['joins'][_0x1a5397][_0xbcb7('0x36')]&&_['includes'](_0x365ee5,_0x369160[_0xbcb7('0x7f')][_0x1a5397][_0xbcb7('0x36')])&&_0x369160[_0xbcb7('0x7f')][_0x1a5397][_0xbcb7('0x81')]&&_0x369160['joins'][_0x1a5397][_0xbcb7('0x82')]&&_0x369160[_0xbcb7('0x7f')][_0x1a5397][_0xbcb7('0x83')]){_0x171271[_0x369160['joins'][_0x1a5397][_0xbcb7('0x36')]](_0x369160['joins'][_0x1a5397][_0xbcb7('0x82')],null,util[_0xbcb7('0x7a')](_0xbcb7('0x84'),_0x369160[_0xbcb7('0x85')],_0x369160[_0xbcb7('0x7f')][_0x1a5397]['parentKey'],_0x369160[_0xbcb7('0x7f')][_0x1a5397]['foreignTable'],_0x369160['joins'][_0x1a5397][_0xbcb7('0x83')]));}}}if(_0x369160[_0xbcb7('0x86')]){_0x369160[_0xbcb7('0x86')]=JSON[_0xbcb7('0x80')](_0x369160[_0xbcb7('0x86')]);_0x171271['where'](_0x1066fe(_0x369160[_0xbcb7('0x86')]['group']));}_0xb8b293=_0x171271[_0xbcb7('0x87')]();_0x171271[_0xbcb7('0x1e')](_0x5a2630);_0x171271['offset'](0x0);logger[_0xbcb7('0x88')](_0xbcb7('0x89'),_0x171271['toString']());return dbH[_0xbcb7('0x8b')][_0xbcb7('0x38')](_0x171271['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xbcb7('0xa6')]});}})[_0xbcb7('0x24')](function(){return{'sql':_0xb8b293[_0xbcb7('0x8a')]()};})[_0xbcb7('0x24')](respondWithResult(_0x345840,null))[_0xbcb7('0x49')](handleError(_0x345840,null));};
\ No newline at end of file
+var _0xdcba=['includeAll','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','error','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','ValidationErrorItem','select','from','table','metric','replace','function','format','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20EMPTY','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','MetricId','output','web','fullPath','%s-%s.%s','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','savename','countTable','COUNT(*)','run','HOUR(%s)','operator','AnalyticMetric','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','DefaultReports','UserProfileResource','destroy','end','stack','render','merge','body','message','agent','interaction','account','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','filter','where','VIRTUAL','options','findAll','catch','show','params'];(function(_0x1428d9,_0xded63c){var _0x438019=function(_0x31c37d){while(--_0x31c37d){_0x1428d9['push'](_0x1428d9['shift']());}};_0x438019(++_0xded63c);}(_0xdcba,0x1a6));var _0xadcb=function(_0x54aff6,_0xc4c096){_0x54aff6=_0x54aff6-0x0;var _0x487a36=_0xdcba[_0x54aff6];return _0x487a36;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xadcb('0x0'));var zipdir=require(_0xadcb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xadcb('0x2'));var moment=require(_0xadcb('0x3'));var BPromise=require(_0xadcb('0x4'));var Mustache=require(_0xadcb('0x5'));var util=require('util');var path=require(_0xadcb('0x6'));var sox=require(_0xadcb('0x7'));var csv=require(_0xadcb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xadcb('0x9'));var _=require('lodash');var squel=require(_0xadcb('0xa'));var crypto=require(_0xadcb('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xadcb('0xc'));var toCsv=require(_0xadcb('0x8'));var querystring=require(_0xadcb('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xadcb('0xe'));var qs=require(_0xadcb('0xf'));var as=require(_0xadcb('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xadcb('0x11'))(_0xadcb('0x12'));var utils=require(_0xadcb('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xadcb('0x14'));var db=require(_0xadcb('0x15'))['db'];var dbH=require(_0xadcb('0x15'))[_0xadcb('0x16')];function respondWithStatusCode(_0x3cef0b,_0x4dbbaa){_0x4dbbaa=_0x4dbbaa||0xcc;return function(_0x190ea2){if(_0x190ea2){return _0x3cef0b[_0xadcb('0x17')](_0x4dbbaa);}return _0x3cef0b['status'](_0x4dbbaa)['end']();};}function respondWithResult(_0x42c275,_0x1c401b){_0x1c401b=_0x1c401b||0xc8;return function(_0x38e155){if(_0x38e155){return _0x42c275[_0xadcb('0x18')](_0x1c401b)[_0xadcb('0x19')](_0x38e155);}};}function respondWithFilteredResult(_0x10a9f5,_0x45d521){return function(_0x1da726){if(_0x1da726){var _0x5399e2=typeof _0x45d521[_0xadcb('0x1a')]===_0xadcb('0x1b')&&typeof _0x45d521[_0xadcb('0x1c')]==='undefined';var _0x3f12b9=_0x1da726[_0xadcb('0x1d')];var _0x262d07=_0x5399e2?0x0:_0x45d521['offset'];var _0x57105d=_0x5399e2?_0x1da726[_0xadcb('0x1d')]:_0x45d521[_0xadcb('0x1a')]+_0x45d521[_0xadcb('0x1c')];var _0x4fd595;if(_0x57105d>=_0x3f12b9){_0x57105d=_0x3f12b9;_0x4fd595=0xc8;}else{_0x4fd595=0xce;}_0x10a9f5[_0xadcb('0x18')](_0x4fd595);return _0x10a9f5[_0xadcb('0x1e')](_0xadcb('0x1f'),_0x262d07+'-'+_0x57105d+'/'+_0x3f12b9)['json'](_0x1da726);}return null;};}function patchUpdates(_0x3d69fc){return function(_0x34262d){try{jsonpatch[_0xadcb('0x20')](_0x34262d,_0x3d69fc,!![]);}catch(_0x13b61f){return BPromise[_0xadcb('0x21')](_0x13b61f);}return _0x34262d[_0xadcb('0x22')]();};}function saveUpdates(_0x269c02,_0x358031){return function(_0x3347ad){if(_0x3347ad){return _0x3347ad[_0xadcb('0x23')](_0x269c02)[_0xadcb('0x24')](function(_0x5352b3){return _0x5352b3;});}return null;};}function removeEntity(_0x1e9bc2,_0x3e84cb){return function(_0x59c3ad){if(_0x59c3ad){return _0x59c3ad['destroy']()[_0xadcb('0x24')](function(){var _0x1e3c15=_0x59c3ad['get']({'plain':!![]});var _0x3d7f22=_0xadcb('0x25');return db[_0xadcb('0x26')][_0xadcb('0x27')]({'where':{'type':_0x3d7f22,'resourceId':_0x1e3c15['id']}})[_0xadcb('0x24')](function(){return _0x59c3ad;});})[_0xadcb('0x24')](function(){_0x1e9bc2['status'](0xcc)[_0xadcb('0x28')]();});}};}function handleEntityNotFound(_0x386319,_0x25cc17){return function(_0x6baa73){if(!_0x6baa73){_0x386319[_0xadcb('0x17')](0x194);}return _0x6baa73;};}function handleError(_0x6ef92,_0x28bb4e){_0x28bb4e=_0x28bb4e||0x1f4;return function(_0x57f141){logger['error'](_0x57f141[_0xadcb('0x29')]);if(_0x57f141['name']){delete _0x57f141['name'];}_0x6ef92[_0xadcb('0x18')](_0x28bb4e)['send'](_0x57f141);};}function getMustacheRender(_0x1ff5cd,_0x4ca65a){return Mustache[_0xadcb('0x2a')](_0x1ff5cd,_[_0xadcb('0x2b')](_0x4ca65a[_0xadcb('0x2c')],{'contact':_0x4ca65a['contact'],'message':_0x4ca65a[_0xadcb('0x2d')],'agent':_0x4ca65a[_0xadcb('0x2e')],'interaction':_0x4ca65a[_0xadcb('0x2f')],'account':_0x4ca65a[_0xadcb('0x30')]}))||'';}exports[_0xadcb('0x31')]=function(_0x50b7d6,_0x5cbf19){var _0x5852d5={},_0x434943={},_0x687b44={'count':0x0,'rows':[]};var _0x3c1fe5=_[_0xadcb('0x32')](db[_0xadcb('0x33')][_0xadcb('0x34')],function(_0x4345ce){return{'name':_0x4345ce[_0xadcb('0x35')],'type':_0x4345ce[_0xadcb('0x36')][_0xadcb('0x37')]};});_0x434943[_0xadcb('0x38')]=_[_0xadcb('0x32')](_0x3c1fe5,_0xadcb('0x39'));_0x434943[_0xadcb('0x3a')]=_[_0xadcb('0x3b')](_0x50b7d6[_0xadcb('0x3a')]);_0x434943['filters']=_[_0xadcb('0x3c')](_0x434943[_0xadcb('0x38')],_0x434943[_0xadcb('0x3a')]);_0x5852d5[_0xadcb('0x3d')]=_['intersection'](_0x434943[_0xadcb('0x38')],qs[_0xadcb('0x3e')](_0x50b7d6[_0xadcb('0x3a')][_0xadcb('0x3e')]));_0x5852d5[_0xadcb('0x3d')]=_0x5852d5[_0xadcb('0x3d')][_0xadcb('0x3f')]?_0x5852d5[_0xadcb('0x3d')]:_0x434943['model'];if(!_0x50b7d6[_0xadcb('0x3a')][_0xadcb('0x40')](_0xadcb('0x41'))){_0x5852d5[_0xadcb('0x1c')]=qs[_0xadcb('0x1c')](_0x50b7d6[_0xadcb('0x3a')]['limit']);_0x5852d5[_0xadcb('0x1a')]=qs['offset'](_0x50b7d6[_0xadcb('0x3a')][_0xadcb('0x1a')]);}_0x5852d5['order']=qs[_0xadcb('0x42')](_0x50b7d6['query'][_0xadcb('0x42')]);_0x5852d5['where']=qs[_0xadcb('0x43')](_['pick'](_0x50b7d6[_0xadcb('0x3a')],_0x434943[_0xadcb('0x43')]),_0x3c1fe5);if(_0x50b7d6['query'][_0xadcb('0x44')]){_0x5852d5[_0xadcb('0x45')]=_[_0xadcb('0x2b')](_0x5852d5['where'],{'$or':_[_0xadcb('0x32')](_0x3c1fe5,function(_0x548fb5){if(_0x548fb5['type']!==_0xadcb('0x46')){var _0x22914={};_0x22914[_0x548fb5[_0xadcb('0x39')]]={'$like':'%'+_0x50b7d6[_0xadcb('0x3a')][_0xadcb('0x44')]+'%'};return _0x22914;}})});}_0x5852d5=_['merge']({},_0x5852d5,_0x50b7d6[_0xadcb('0x47')]);var _0x3036b7={'where':_0x5852d5[_0xadcb('0x45')]};return db['AnalyticDefaultReport'][_0xadcb('0x1d')](_0x3036b7)['then'](function(_0x452539){_0x687b44[_0xadcb('0x1d')]=_0x452539;if(_0x50b7d6[_0xadcb('0x3a')]['includeAll']){_0x5852d5['include']=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0xadcb('0x48')](_0x5852d5);})[_0xadcb('0x24')](function(_0x2a782c){_0x687b44['rows']=_0x2a782c;return _0x687b44;})[_0xadcb('0x24')](respondWithFilteredResult(_0x5cbf19,_0x5852d5))[_0xadcb('0x49')](handleError(_0x5cbf19,null));};exports[_0xadcb('0x4a')]=function(_0x162453,_0x21e57f){var _0x17c9c0={'raw':!![],'where':{'id':_0x162453[_0xadcb('0x4b')]['id']}},_0x20aaaa={};_0x20aaaa[_0xadcb('0x38')]=_[_0xadcb('0x3b')](db[_0xadcb('0x33')][_0xadcb('0x34')]);_0x20aaaa[_0xadcb('0x3a')]=_[_0xadcb('0x3b')](_0x162453[_0xadcb('0x3a')]);_0x20aaaa[_0xadcb('0x43')]=_[_0xadcb('0x3c')](_0x20aaaa[_0xadcb('0x38')],_0x20aaaa[_0xadcb('0x3a')]);_0x17c9c0[_0xadcb('0x3d')]=_[_0xadcb('0x3c')](_0x20aaaa[_0xadcb('0x38')],qs[_0xadcb('0x3e')](_0x162453[_0xadcb('0x3a')][_0xadcb('0x3e')]));_0x17c9c0['attributes']=_0x17c9c0['attributes'][_0xadcb('0x3f')]?_0x17c9c0[_0xadcb('0x3d')]:_0x20aaaa['model'];if(_0x162453[_0xadcb('0x3a')][_0xadcb('0x4c')]){_0x17c9c0['include']=[{'all':!![]}];}_0x17c9c0=_['merge']({},_0x17c9c0,_0x162453[_0xadcb('0x47')]);return db[_0xadcb('0x33')]['find'](_0x17c9c0)[_0xadcb('0x24')](handleEntityNotFound(_0x21e57f,null))[_0xadcb('0x24')](respondWithResult(_0x21e57f,null))[_0xadcb('0x49')](handleError(_0x21e57f,null));};exports['create']=function(_0x41ee6a,_0x1e53f0){return db[_0xadcb('0x33')][_0xadcb('0x4d')](_0x41ee6a[_0xadcb('0x2c')],{})[_0xadcb('0x24')](function(_0x545305){var _0x106c08=_0x41ee6a[_0xadcb('0x4e')][_0xadcb('0x4f')]({'plain':!![]});if(!_0x106c08)throw new Error(_0xadcb('0x50'));if(_0x106c08['role']===_0xadcb('0x4e')){var _0x40e2ea=_0x545305[_0xadcb('0x4f')]({'plain':!![]});var _0x30f70b=_0xadcb('0x51');return db[_0xadcb('0x52')][_0xadcb('0x53')]({'where':{'name':_0x30f70b,'userProfileId':_0x106c08[_0xadcb('0x54')]},'raw':!![]})[_0xadcb('0x24')](function(_0x46c2c8){if(_0x46c2c8&&_0x46c2c8['autoAssociation']===0x0){return db[_0xadcb('0x26')][_0xadcb('0x4d')]({'name':_0x40e2ea[_0xadcb('0x39')],'resourceId':_0x40e2ea['id'],'type':_0xadcb('0x25'),'sectionId':_0x46c2c8['id']},{})[_0xadcb('0x24')](function(){return _0x545305;});}else{return _0x545305;}})['catch'](function(_0x5bb937){logger[_0xadcb('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5bb937);throw _0x5bb937;});}return _0x545305;})[_0xadcb('0x24')](respondWithResult(_0x1e53f0,0xc9))[_0xadcb('0x49')](handleError(_0x1e53f0,null));};exports[_0xadcb('0x23')]=function(_0x35786f,_0x40c0c7){if(_0x35786f[_0xadcb('0x2c')]['id']){delete _0x35786f[_0xadcb('0x2c')]['id'];}return db['AnalyticDefaultReport'][_0xadcb('0x53')]({'where':{'id':_0x35786f[_0xadcb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x40c0c7,null))[_0xadcb('0x24')](saveUpdates(_0x35786f[_0xadcb('0x2c')],null))['then'](respondWithResult(_0x40c0c7,null))[_0xadcb('0x49')](handleError(_0x40c0c7,null));};exports['destroy']=function(_0x2f0fc8,_0x5dc2ee){return db[_0xadcb('0x33')][_0xadcb('0x53')]({'where':{'id':_0x2f0fc8['params']['id']}})['then'](handleEntityNotFound(_0x5dc2ee,null))['then'](removeEntity(_0x5dc2ee,null))[_0xadcb('0x49')](handleError(_0x5dc2ee,null));};exports[_0xadcb('0x56')]=function(_0x2ad27c,_0x5d0b2d){var _0x55e11f=0xa;var _0x2673bb=[_0xadcb('0x57'),'left_join',_0xadcb('0x58'),_0xadcb('0x59')];var _0x5731d7={'SUM':_0xadcb('0x5a'),'COUNT':_0xadcb('0x5b'),'COUNT DISTINCT':_0xadcb('0x5c'),'MAX':_0xadcb('0x5d'),'MIN':_0xadcb('0x5e'),'AVG':_0xadcb('0x5f'),'GROUP_CONCAT':_0xadcb('0x60'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xadcb('0x61')};var _0x11946f={'SEC_TO_TIME':_0xadcb('0x62'),'DATE':_0xadcb('0x63'),'HOUR':'HOUR(%s)','ROUND':_0xadcb('0x64'),'UNIX_TIMESTAMP':_0xadcb('0x65')};var _0x8b34cc=function(_0x1c7ea7){return!_[_0xadcb('0x66')]([_0xadcb('0x67'),_0xadcb('0x68'),'IS\x20EMPTY',_0xadcb('0x69')],_0x1c7ea7);};var _0x28c48=function(_0x25b5b5){if(!_0x25b5b5||!_0x25b5b5[_0xadcb('0x6a')][_0xadcb('0x3f')]){return'';}for(var _0x244977='(',_0x2acbe9=0x0;_0x2acbe9<_0x25b5b5[_0xadcb('0x6a')][_0xadcb('0x3f')];_0x2acbe9+=0x1){_0x2acbe9>0x0&&(_0x244977+='\x20'+_0x25b5b5['operator']+'\x20');_0x244977+=_0x25b5b5[_0xadcb('0x6a')][_0x2acbe9][_0xadcb('0x6b')]?_0x28c48(_0x25b5b5['rules'][_0x2acbe9][_0xadcb('0x6b')]):_0x25b5b5[_0xadcb('0x6a')][_0x2acbe9][_0xadcb('0x6c')]+'\x20'+_0x25b5b5[_0xadcb('0x6a')][_0x2acbe9][_0xadcb('0x6d')]+(_0x8b34cc(_0x25b5b5['rules'][_0x2acbe9][_0xadcb('0x6d')])?'\x20'+_0x25b5b5[_0xadcb('0x6a')][_0x2acbe9][_0xadcb('0x6e')]:'');}return _0x244977+')';};var _0x13e433={'where':{'id':_0x2ad27c[_0xadcb('0x4b')]['id']}},_0x573169,_0x5e9f36,_0x15d97a,_0x4af0fb,_0x1778cd;_0x13e433=_[_0xadcb('0x2b')]({},_0x13e433,_0x2ad27c[_0xadcb('0x47')]);return db['AnalyticDefaultReport']['find'](_0x13e433)['then'](function(_0x298c84){if(_0x298c84){_0x573169=_0x298c84;return _0x298c84[_0xadcb('0x6f')]();}return null;})[_0xadcb('0x24')](function(_0x2f8e04){if(_0x2f8e04){if(!_0x2f8e04[_0xadcb('0x3f')]){throw new db['Sequelize'][(_0xadcb('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5e9f36=_0x2f8e04;return db['AnalyticMetric'][_0xadcb('0x48')]({'raw':!![]});}return null;})[_0xadcb('0x24')](function(_0x405bd7){if(_0x405bd7){_0x15d97a=_['keyBy'](_0x405bd7,'id');var _0x8ad66;var _0x4e8ae2=squel[_0xadcb('0x71')]();_0x4e8ae2[_0xadcb('0x72')](_0x573169[_0xadcb('0x73')]);for(var _0xd206b7=0x0;_0xd206b7<_0x5e9f36['length'];_0xd206b7+=0x1){_0x8ad66=_0x5e9f36[_0xd206b7]['MetricId']?_0x15d97a[_0x5e9f36[_0xd206b7]['MetricId']][_0xadcb('0x74')]:_0x5e9f36[_0xd206b7][_0xadcb('0x6c')];_0x8ad66=_0x5e9f36[_0xd206b7]['function']?_[_0xadcb('0x75')](_0x5731d7[_0x5e9f36[_0xd206b7][_0xadcb('0x76')]],'%s',_0x8ad66):_0x8ad66;_0x8ad66=_0x5e9f36[_0xd206b7][_0xadcb('0x77')]?_[_0xadcb('0x75')](_0x11946f[_0x5e9f36[_0xd206b7][_0xadcb('0x77')]],'%s',_0x8ad66):_0x8ad66;if(_0x5e9f36[_0xd206b7][_0xadcb('0x78')]){_0x4e8ae2[_0xadcb('0x6b')](_0x8ad66);}_0x5e9f36[_0xd206b7][_0xadcb('0x79')]&&_0x4e8ae2[_0xadcb('0x7a')](_0x8ad66,_0x5e9f36[_0xd206b7][_0xadcb('0x79')]===_0xadcb('0x7b')?![]:!![]);_0x4e8ae2[_0xadcb('0x6c')](_0x8ad66,_0x5e9f36[_0xd206b7][_0xadcb('0x7c')]||_0x8ad66);}if(_0x573169[_0xadcb('0x7d')]){_0x573169[_0xadcb('0x7d')]=JSON[_0xadcb('0x7e')](_0x573169[_0xadcb('0x7d')]);for(var _0x573bc6=0x0;_0x573bc6<_0x573169[_0xadcb('0x7d')][_0xadcb('0x3f')];_0x573bc6+=0x1){if(_0x573169['joins'][_0x573bc6]['type']&&_[_0xadcb('0x66')](_0x2673bb,_0x573169[_0xadcb('0x7d')][_0x573bc6][_0xadcb('0x36')])&&_0x573169[_0xadcb('0x7d')][_0x573bc6][_0xadcb('0x7f')]&&_0x573169[_0xadcb('0x7d')][_0x573bc6][_0xadcb('0x80')]&&_0x573169[_0xadcb('0x7d')][_0x573bc6][_0xadcb('0x81')]){_0x4e8ae2[_0x573169[_0xadcb('0x7d')][_0x573bc6][_0xadcb('0x36')]](_0x573169['joins'][_0x573bc6][_0xadcb('0x80')],null,util['format'](_0xadcb('0x82'),_0x573169['table'],_0x573169[_0xadcb('0x7d')][_0x573bc6][_0xadcb('0x7f')],_0x573169[_0xadcb('0x7d')][_0x573bc6]['foreignTable'],_0x573169[_0xadcb('0x7d')][_0x573bc6]['foreignKey']));}}}if(_0x573169[_0xadcb('0x83')]){_0x573169['conditions']=JSON[_0xadcb('0x7e')](_0x573169[_0xadcb('0x83')]);_0x4e8ae2[_0xadcb('0x45')](_0x28c48(_0x573169[_0xadcb('0x83')]['group']));}_0x1778cd=_0x4e8ae2[_0xadcb('0x84')]();_0x4e8ae2['limit'](_0x55e11f);_0x4e8ae2[_0xadcb('0x1a')](0x0);logger[_0xadcb('0x85')](_0xadcb('0x86'),_0x4e8ae2[_0xadcb('0x87')]());return dbH[_0xadcb('0x88')][_0xadcb('0x3a')](_0x4e8ae2['toString'](),{'type':dbH[_0xadcb('0x88')][_0xadcb('0x89')][_0xadcb('0x8a')]});}})[_0xadcb('0x24')](respondWithResult(_0x5d0b2d,null))['catch'](handleError(_0x5d0b2d,null));};function runReport(_0x4d0280,_0x2653ff,_0x2bb863){var _0x216dc6=_0x2653ff[_0xadcb('0x39')];var _0x4463c9=0xa;var _0x686362=[_0xadcb('0x57'),_0xadcb('0x8b'),_0xadcb('0x58'),'cross_join'];var _0x26485a={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xadcb('0x5d'),'MIN':_0xadcb('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xadcb('0x60'),'GROUP_CONCAT ASC':_0xadcb('0x8c'),'GROUP_CONCAT DESC':_0xadcb('0x61')};var _0x169866={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xadcb('0x63'),'HOUR':'HOUR(%s)','ROUND':_0xadcb('0x64'),'UNIX_TIMESTAMP':_0xadcb('0x65')};var _0x288068=function(_0x39c492){return!_[_0xadcb('0x66')](['IS\x20NULL',_0xadcb('0x68'),_0xadcb('0x8d'),_0xadcb('0x69')],_0x39c492);};var _0x1e509f=function(_0xeec9af){if(!_0xeec9af||!_0xeec9af[_0xadcb('0x6a')]['length']){return'';}for(var _0x337289='(',_0x1a0285=0x0;_0x1a0285<_0xeec9af[_0xadcb('0x6a')][_0xadcb('0x3f')];_0x1a0285+=0x1){_0x1a0285>0x0&&(_0x337289+='\x20'+_0xeec9af['operator']+'\x20');_0x337289+=_0xeec9af[_0xadcb('0x6a')][_0x1a0285][_0xadcb('0x6b')]?_0x1e509f(_0xeec9af[_0xadcb('0x6a')][_0x1a0285][_0xadcb('0x6b')]):_0xeec9af[_0xadcb('0x6a')][_0x1a0285][_0xadcb('0x6c')]+'\x20'+_0xeec9af[_0xadcb('0x6a')][_0x1a0285][_0xadcb('0x6d')]+(_0x288068(_0xeec9af[_0xadcb('0x6a')][_0x1a0285]['condition'])?'\x20'+_0xeec9af['rules'][_0x1a0285][_0xadcb('0x6e')]:'');}return _0x337289+')';};var _0x3b7fd6={'where':{'id':_0x4d0280['id']}},_0x51f2fa,_0x2c616d,_0x646b96,_0x2fb8f7,_0x2ad91a;_0x3b7fd6=_['merge']({},_0x3b7fd6,_0x2bb863);return db[_0xadcb('0x33')]['find'](_0x3b7fd6)[_0xadcb('0x24')](function(_0x576988){if(_0x576988){_0x51f2fa=_0x576988;return _0x576988['getFields']();}return null;})['then'](function(_0x2caa82){if(_0x2caa82){if(!_0x2caa82['length']){throw new db[(_0xadcb('0x8e'))]['ValidationErrorItem'](_0xadcb('0x8f'),0x193);}_0x2c616d=_0x2caa82;return db['AnalyticMetric'][_0xadcb('0x48')]({'raw':!![]});}return null;})[_0xadcb('0x24')](function(_0x1cde25){if(_0x1cde25){_0x646b96=_[_0xadcb('0x90')](_0x1cde25,'id');var _0x52c1e6;var _0x308b59=squel['select']();_0x308b59[_0xadcb('0x72')](_0x51f2fa[_0xadcb('0x73')]);for(var _0x295254=0x0;_0x295254<_0x2c616d['length'];_0x295254+=0x1){_0x52c1e6=_0x2c616d[_0x295254][_0xadcb('0x91')]?_0x646b96[_0x2c616d[_0x295254][_0xadcb('0x91')]][_0xadcb('0x74')]:_0x2c616d[_0x295254][_0xadcb('0x6c')];_0x52c1e6=_0x2c616d[_0x295254]['function']?_[_0xadcb('0x75')](_0x26485a[_0x2c616d[_0x295254][_0xadcb('0x76')]],'%s',_0x52c1e6):_0x52c1e6;_0x52c1e6=_0x2c616d[_0x295254]['format']?_[_0xadcb('0x75')](_0x169866[_0x2c616d[_0x295254][_0xadcb('0x77')]],'%s',_0x52c1e6):_0x52c1e6;if(_0x2c616d[_0x295254][_0xadcb('0x78')]){_0x308b59[_0xadcb('0x6b')](_0x52c1e6);}_0x2c616d[_0x295254][_0xadcb('0x79')]&&_0x308b59[_0xadcb('0x7a')](_0x52c1e6,_0x2c616d[_0x295254][_0xadcb('0x79')]===_0xadcb('0x7b')?![]:!![]);_0x308b59[_0xadcb('0x6c')](_0x52c1e6,_0x2c616d[_0x295254][_0xadcb('0x7c')]||_0x52c1e6);}if(_0x51f2fa[_0xadcb('0x7d')]){_0x51f2fa['joins']=JSON[_0xadcb('0x7e')](_0x51f2fa[_0xadcb('0x7d')]);for(var _0x49aa42=0x0;_0x49aa42<_0x51f2fa[_0xadcb('0x7d')][_0xadcb('0x3f')];_0x49aa42+=0x1){if(_0x51f2fa['joins'][_0x49aa42]['type']&&_[_0xadcb('0x66')](_0x686362,_0x51f2fa[_0xadcb('0x7d')][_0x49aa42]['type'])&&_0x51f2fa['joins'][_0x49aa42][_0xadcb('0x7f')]&&_0x51f2fa['joins'][_0x49aa42][_0xadcb('0x80')]&&_0x51f2fa[_0xadcb('0x7d')][_0x49aa42]['foreignKey']){_0x308b59[_0x51f2fa[_0xadcb('0x7d')][_0x49aa42][_0xadcb('0x36')]](_0x51f2fa[_0xadcb('0x7d')][_0x49aa42][_0xadcb('0x80')],null,util[_0xadcb('0x77')]('%s.%s\x20=\x20%s.%s',_0x51f2fa['table'],_0x51f2fa[_0xadcb('0x7d')][_0x49aa42][_0xadcb('0x7f')],_0x51f2fa['joins'][_0x49aa42][_0xadcb('0x80')],_0x51f2fa['joins'][_0x49aa42]['foreignKey']));}}}if(_0x51f2fa[_0xadcb('0x83')]){_0x51f2fa['conditions']=JSON[_0xadcb('0x7e')](_0x51f2fa[_0xadcb('0x83')]);_0x308b59[_0xadcb('0x45')](_0x1e509f(_0x51f2fa[_0xadcb('0x83')][_0xadcb('0x6b')]));}_0x2ad91a=_0x308b59[_0xadcb('0x84')]();_0x308b59[_0xadcb('0x1c')](_0x4463c9);_0x308b59[_0xadcb('0x1a')](0x0);return;}})['then'](function(){if(_0x2653ff[_0xadcb('0x92')]===_0xadcb('0x93')){return null;}var _0xf90f6b=_[_0xadcb('0x2b')](_0x2653ff,{'name':_0x2653ff[_0xadcb('0x94')]||_0x2653ff[_0xadcb('0x39')]||_0x51f2fa[_0xadcb('0x39')],'basename':_0x216dc6,'savename':util['format'](_0xadcb('0x95'),_0x2653ff[_0xadcb('0x39')]||_0x51f2fa[_0xadcb('0x39')],require('randomstring')['generate'](0x4),_0x2653ff[_0xadcb('0x92')]||_0xadcb('0x96')),'reportId':_0x51f2fa['id'],'reportType':_0xadcb('0x97')});return db['AnalyticExtractedReport']['create'](_0xf90f6b,{'raw':!![]});})[_0xadcb('0x24')](function(_0x2f1b76){if(_0x51f2fa[_0xadcb('0x73')]===_0xadcb('0x98')){_0x2ad91a['where'](_0x51f2fa[_0xadcb('0x73')]+_0xadcb('0x99'),_0x2653ff[_0xadcb('0x9a')],_0x2653ff[_0xadcb('0x9b')]);}else{_0x2ad91a[_0xadcb('0x45')](_0x51f2fa['table']+_0xadcb('0x9c'),_0x2653ff[_0xadcb('0x9a')],_0x2653ff['endDate']);}if(_0x2f1b76){logger['info'](_0xadcb('0x9d'),_0x2ad91a[_0xadcb('0x87')]());require(_0xadcb('0x9e'))['fork'](path[_0xadcb('0x57')](__dirname,'../../components/export/',_0x2f1b76[_0xadcb('0x92')]),[_0x2f1b76['id'],_0x2ad91a[_0xadcb('0x87')](),path[_0xadcb('0x57')](__dirname,'../../files/reports',_0x2f1b76[_0xadcb('0x9f')]),_0x216dc6]);return _0x2f1b76;}else{var _0x361250=squel[_0xadcb('0x71')]();_0x361250[_0xadcb('0x72')]('('+_0x2ad91a[_0xadcb('0x87')]()+')',_0xadcb('0xa0'));_0x361250[_0xadcb('0x6c')](_0xadcb('0xa1'),_0xadcb('0x1d'));_0x2ad91a[_0xadcb('0x1c')](_0x2653ff[_0xadcb('0x1c')]||_0x4463c9);_0x2ad91a[_0xadcb('0x1a')](_0x2653ff[_0xadcb('0x1a')]||0x0);return dbH[_0xadcb('0x88')][_0xadcb('0x3a')](_0x361250['toString'](),{'type':dbH[_0xadcb('0x88')][_0xadcb('0x89')][_0xadcb('0x8a')]})[_0xadcb('0x24')](function(_0x36455b){if(!_0x36455b[_0xadcb('0x3f')]){_0x2fb8f7=0x0;}else{_0x2fb8f7=_0x36455b[0x0][_0xadcb('0x1d')]||0x0;}return dbH['sequelize'][_0xadcb('0x3a')](_0x2ad91a[_0xadcb('0x87')](),{'type':dbH['sequelize']['QueryTypes'][_0xadcb('0x8a')]});})[_0xadcb('0x24')](function(_0xad9b0e){return{'rows':_0xad9b0e||[],'count':_0x2fb8f7};});}});}exports[_0xadcb('0xa2')]=function(_0x15b65c,_0x511725){return runReport(_0x15b65c[_0xadcb('0x4b')],_0x15b65c[_0xadcb('0x3a')],_0x15b65c['options'])[_0xadcb('0x24')](respondWithResult(_0x511725,null))[_0xadcb('0x49')](handleError(_0x511725,null));};exports['runReport']=runReport;exports['query']=function(_0x47db54,_0x506942){var _0x3ee93e=0xa;var _0x1e2c3a=['join',_0xadcb('0x8b'),'right_join','cross_join'];var _0x4f515d={'SUM':_0xadcb('0x5a'),'COUNT':_0xadcb('0x5b'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xadcb('0x5d'),'MIN':_0xadcb('0x5e'),'AVG':_0xadcb('0x5f'),'GROUP_CONCAT':_0xadcb('0x60'),'GROUP_CONCAT ASC':_0xadcb('0x8c'),'GROUP_CONCAT DESC':_0xadcb('0x61')};var _0x128fe0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xadcb('0x63'),'HOUR':_0xadcb('0xa3'),'ROUND':_0xadcb('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x213b0c=function(_0x1df5d6){return!_[_0xadcb('0x66')]([_0xadcb('0x67'),_0xadcb('0x68'),_0xadcb('0x8d'),_0xadcb('0x69')],_0x1df5d6);};var _0x46f2cf=function(_0x384e4b){if(!_0x384e4b||!_0x384e4b[_0xadcb('0x6a')][_0xadcb('0x3f')]){return'';}for(var _0x5d630e='(',_0x1d1088=0x0;_0x1d1088<_0x384e4b['rules'][_0xadcb('0x3f')];_0x1d1088+=0x1){_0x1d1088>0x0&&(_0x5d630e+='\x20'+_0x384e4b[_0xadcb('0xa4')]+'\x20');_0x5d630e+=_0x384e4b['rules'][_0x1d1088][_0xadcb('0x6b')]?_0x46f2cf(_0x384e4b[_0xadcb('0x6a')][_0x1d1088][_0xadcb('0x6b')]):_0x384e4b[_0xadcb('0x6a')][_0x1d1088][_0xadcb('0x6c')]+'\x20'+_0x384e4b[_0xadcb('0x6a')][_0x1d1088]['condition']+(_0x213b0c(_0x384e4b['rules'][_0x1d1088][_0xadcb('0x6d')])?'\x20'+_0x384e4b[_0xadcb('0x6a')][_0x1d1088][_0xadcb('0x6e')]:'');}return _0x5d630e+')';};var _0x5ae9f7={'where':{'id':_0x47db54[_0xadcb('0x4b')]['id']}},_0x3ff8f1,_0x100966,_0x125106,_0x1dc2fb,_0x29f14a;_0x5ae9f7=_['merge']({},_0x5ae9f7,_0x47db54[_0xadcb('0x47')]);return db[_0xadcb('0x33')][_0xadcb('0x53')](_0x5ae9f7)['then'](function(_0x123c08){if(_0x123c08){_0x3ff8f1=_0x123c08;return _0x123c08[_0xadcb('0x6f')]();}return null;})[_0xadcb('0x24')](function(_0x42ccbb){if(_0x42ccbb){if(!_0x42ccbb[_0xadcb('0x3f')]){throw new db[(_0xadcb('0x8e'))][(_0xadcb('0x70'))](_0xadcb('0x8f'),0x193);}_0x100966=_0x42ccbb;return db[_0xadcb('0xa5')][_0xadcb('0x48')]({'raw':!![]});}return null;})[_0xadcb('0x24')](function(_0x11ca79){if(_0x11ca79){_0x125106=_[_0xadcb('0x90')](_0x11ca79,'id');var _0x3115e6;var _0x1399c9=squel[_0xadcb('0x71')]();_0x1399c9[_0xadcb('0x72')](_0x3ff8f1['table']);for(var _0x300f47=0x0;_0x300f47<_0x100966['length'];_0x300f47+=0x1){_0x3115e6=_0x100966[_0x300f47]['MetricId']?_0x125106[_0x100966[_0x300f47][_0xadcb('0x91')]][_0xadcb('0x74')]:_0x100966[_0x300f47]['field'];_0x3115e6=_0x100966[_0x300f47][_0xadcb('0x76')]?_['replace'](_0x4f515d[_0x100966[_0x300f47]['function']],'%s',_0x3115e6):_0x3115e6;_0x3115e6=_0x100966[_0x300f47]['format']?_[_0xadcb('0x75')](_0x128fe0[_0x100966[_0x300f47][_0xadcb('0x77')]],'%s',_0x3115e6):_0x3115e6;if(_0x100966[_0x300f47][_0xadcb('0x78')]){_0x1399c9[_0xadcb('0x6b')](_0x3115e6);}_0x100966[_0x300f47]['orderBy']&&_0x1399c9['order'](_0x3115e6,_0x100966[_0x300f47][_0xadcb('0x79')]===_0xadcb('0x7b')?![]:!![]);_0x1399c9[_0xadcb('0x6c')](_0x3115e6,_0x100966[_0x300f47]['alias']||_0x3115e6);}if(_0x3ff8f1[_0xadcb('0x7d')]){_0x3ff8f1[_0xadcb('0x7d')]=JSON[_0xadcb('0x7e')](_0x3ff8f1[_0xadcb('0x7d')]);for(var _0x355ba6=0x0;_0x355ba6<_0x3ff8f1[_0xadcb('0x7d')]['length'];_0x355ba6+=0x1){if(_0x3ff8f1[_0xadcb('0x7d')][_0x355ba6][_0xadcb('0x36')]&&_[_0xadcb('0x66')](_0x1e2c3a,_0x3ff8f1[_0xadcb('0x7d')][_0x355ba6][_0xadcb('0x36')])&&_0x3ff8f1[_0xadcb('0x7d')][_0x355ba6][_0xadcb('0x7f')]&&_0x3ff8f1[_0xadcb('0x7d')][_0x355ba6][_0xadcb('0x80')]&&_0x3ff8f1[_0xadcb('0x7d')][_0x355ba6][_0xadcb('0x81')]){_0x1399c9[_0x3ff8f1[_0xadcb('0x7d')][_0x355ba6]['type']](_0x3ff8f1[_0xadcb('0x7d')][_0x355ba6][_0xadcb('0x80')],null,util[_0xadcb('0x77')]('%s.%s\x20=\x20%s.%s',_0x3ff8f1[_0xadcb('0x73')],_0x3ff8f1['joins'][_0x355ba6][_0xadcb('0x7f')],_0x3ff8f1['joins'][_0x355ba6][_0xadcb('0x80')],_0x3ff8f1['joins'][_0x355ba6][_0xadcb('0x81')]));}}}if(_0x3ff8f1['conditions']){_0x3ff8f1['conditions']=JSON[_0xadcb('0x7e')](_0x3ff8f1[_0xadcb('0x83')]);_0x1399c9[_0xadcb('0x45')](_0x46f2cf(_0x3ff8f1['conditions'][_0xadcb('0x6b')]));}_0x29f14a=_0x1399c9[_0xadcb('0x84')]();_0x1399c9[_0xadcb('0x1c')](_0x3ee93e);_0x1399c9[_0xadcb('0x1a')](0x0);logger['debug'](_0xadcb('0x86'),_0x1399c9['toString']());return dbH[_0xadcb('0x88')][_0xadcb('0x3a')](_0x1399c9[_0xadcb('0x87')](),{'type':dbH['sequelize']['QueryTypes'][_0xadcb('0x8a')]});}})['then'](function(){return{'sql':_0x29f14a[_0xadcb('0x87')]()};})[_0xadcb('0x24')](respondWithResult(_0x506942,null))[_0xadcb('0x49')](handleError(_0x506942,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index c41b5dc..2375937 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 _0xc370=['../../config/environment','exports','define','AnalyticDefaultReport','util','api','moment','bluebird','path','rimraf'];(function(_0x210718,_0x247b55){var _0x541bfc=function(_0x5dbcad){while(--_0x5dbcad){_0x210718['push'](_0x210718['shift']());}};_0x541bfc(++_0x247b55);}(_0xc370,0x13a));var _0x0c37=function(_0xeb0a1b,_0x179ad2){_0xeb0a1b=_0xeb0a1b-0x0;var _0x4caf8c=_0xc370[_0xeb0a1b];return _0x4caf8c;};'use strict';var _=require('lodash');var util=require(_0x0c37('0x0'));var logger=require('../../config/logger')(_0x0c37('0x1'));var moment=require(_0x0c37('0x2'));var BPromise=require(_0x0c37('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c37('0x4'));var rimraf=require(_0x0c37('0x5'));var config=require(_0x0c37('0x6'));var attributes=require('./analyticDefaultReport.attributes');module[_0x0c37('0x7')]=function(_0x2e5b32,_0x49fbeb){return _0x2e5b32[_0x0c37('0x8')](_0x0c37('0x9'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2e3d=['request-promise','../../config/environment','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','api','moment','bluebird'];(function(_0x11ca63,_0xea9f9c){var _0x41f1f6=function(_0xb80b69){while(--_0xb80b69){_0x11ca63['push'](_0x11ca63['shift']());}};_0x41f1f6(++_0xea9f9c);}(_0x2e3d,0x1be));var _0xd2e3=function(_0x146114,_0x12ee38){_0x146114=_0x146114-0x0;var _0x277348=_0x2e3d[_0x146114];return _0x277348;};'use strict';var _=require(_0xd2e3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd2e3('0x1'));var moment=require(_0xd2e3('0x2'));var BPromise=require(_0xd2e3('0x3'));var rp=require(_0xd2e3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd2e3('0x5'));var attributes=require('./analyticDefaultReport.attributes');module[_0xd2e3('0x6')]=function(_0x2ba133,_0x3beebf){return _0x2ba133[_0xd2e3('0x7')](_0xd2e3('0x8'),attributes,{'tableName':_0xd2e3('0x9'),'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 2c6d0b9..41f4d6f 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 _0xe205=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash'];(function(_0x1e381c,_0x47b5b9){var _0x9b5ea9=function(_0x6d2be5){while(--_0x6d2be5){_0x1e381c['push'](_0x1e381c['shift']());}};_0x9b5ea9(++_0x47b5b9);}(_0xe205,0xa7));var _0x5e20=function(_0x454d18,_0x4771d2){_0x454d18=_0x454d18-0x0;var _0x2151ef=_0xe205[_0x454d18];return _0x2151ef;};'use strict';var _=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var moment=require(_0x5e20('0x2'));var BPromise=require(_0x5e20('0x3'));var rs=require(_0x5e20('0x4'));var fs=require('fs');var Redis=require(_0x5e20('0x5'));var db=require(_0x5e20('0x6'))['db'];var utils=require(_0x5e20('0x7'));var logger=require(_0x5e20('0x8'))('rpc');var config=require(_0x5e20('0x9'));var jayson=require(_0x5e20('0xa'));var client=jayson[_0x5e20('0xb')][_0x5e20('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5eca5c,_0x4cc88d,_0x3a382f){return new BPromise(function(_0x4c9332,_0x533e18){return client[_0x5e20('0xd')](_0x5eca5c,_0x3a382f)[_0x5e20('0xe')](function(_0x5c1eee){logger[_0x5e20('0xf')](_0x5e20('0x10'),_0x4cc88d,_0x5e20('0x11'));logger[_0x5e20('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4cc88d,_0x5e20('0x11'),JSON[_0x5e20('0x13')](_0x5c1eee));if(_0x5c1eee[_0x5e20('0x14')]){if(_0x5c1eee[_0x5e20('0x14')][_0x5e20('0x15')]===0x1f4){logger[_0x5e20('0x14')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4cc88d,_0x5c1eee[_0x5e20('0x14')][_0x5e20('0x16')]);return _0x533e18(_0x5c1eee[_0x5e20('0x14')]['message']);}logger[_0x5e20('0x14')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4cc88d,_0x5c1eee[_0x5e20('0x14')]['message']);return _0x4c9332(_0x5c1eee[_0x5e20('0x14')][_0x5e20('0x16')]);}else{logger[_0x5e20('0xf')](_0x5e20('0x10'),_0x4cc88d,_0x5e20('0x11'));_0x4c9332(_0x5c1eee['result'][_0x5e20('0x16')]);}})[_0x5e20('0x17')](function(_0x166ffd){logger[_0x5e20('0x14')](_0x5e20('0x10'),_0x4cc88d,_0x166ffd);_0x533e18(_0x166ffd);});});}
\ No newline at end of file
+var _0x1572=['info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x284318,_0xd1ce42){var _0x2682f5=function(_0x1115db){while(--_0x1115db){_0x284318['push'](_0x284318['shift']());}};_0x2682f5(++_0xd1ce42);}(_0x1572,0xf5));var _0x2157=function(_0x5ea2a3,_0x19858f){_0x5ea2a3=_0x5ea2a3-0x0;var _0x34b5df=_0x1572[_0x5ea2a3];return _0x34b5df;};'use strict';var _=require(_0x2157('0x0'));var util=require(_0x2157('0x1'));var moment=require(_0x2157('0x2'));var BPromise=require(_0x2157('0x3'));var rs=require(_0x2157('0x4'));var fs=require('fs');var Redis=require(_0x2157('0x5'));var db=require(_0x2157('0x6'))['db'];var utils=require(_0x2157('0x7'));var logger=require(_0x2157('0x8'))(_0x2157('0x9'));var config=require(_0x2157('0xa'));var jayson=require(_0x2157('0xb'));var client=jayson[_0x2157('0xc')][_0x2157('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x286be0,_0x462657,_0x471e09){return new BPromise(function(_0x91bf75,_0x5e9959){return client[_0x2157('0xe')](_0x286be0,_0x471e09)['then'](function(_0x91d81){logger[_0x2157('0xf')](_0x2157('0x10'),_0x462657,_0x2157('0x11'));logger[_0x2157('0x12')](_0x2157('0x13'),_0x462657,_0x2157('0x11'),JSON[_0x2157('0x14')](_0x91d81));if(_0x91d81['error']){if(_0x91d81[_0x2157('0x15')][_0x2157('0x16')]===0x1f4){logger[_0x2157('0x15')](_0x2157('0x10'),_0x462657,_0x91d81['error'][_0x2157('0x17')]);return _0x5e9959(_0x91d81[_0x2157('0x15')][_0x2157('0x17')]);}logger[_0x2157('0x15')](_0x2157('0x10'),_0x462657,_0x91d81[_0x2157('0x15')][_0x2157('0x17')]);return _0x91bf75(_0x91d81['error']['message']);}else{logger['info'](_0x2157('0x10'),_0x462657,_0x2157('0x11'));_0x91bf75(_0x91d81[_0x2157('0x18')][_0x2157('0x17')]);}})[_0x2157('0x19')](function(_0x465b2b){logger[_0x2157('0x15')](_0x2157('0x10'),_0x462657,_0x465b2b);_0x5e9959(_0x465b2b);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 7bd6f09..bed4c6e 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 _0x859c=['get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x859c,0x16e));var _0xc859=function(_0x36a4ed,_0x5d2f77){_0x36a4ed=_0x36a4ed-0x0;var _0x21f5ff=_0x859c[_0x36a4ed];return _0x21f5ff;};'use strict';var multer=require(_0xc859('0x0'));var util=require(_0xc859('0x1'));var path=require(_0xc859('0x2'));var timeout=require(_0xc859('0x3'));var express=require(_0xc859('0x4'));var router=express[_0xc859('0x5')]();var fs_extra=require(_0xc859('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc859('0x7'));var config=require(_0xc859('0x8'));var controller=require('./analyticDefaultReport.controller');router[_0xc859('0x9')]('/',auth[_0xc859('0xa')](),controller[_0xc859('0xb')]);router[_0xc859('0x9')](_0xc859('0xc'),auth[_0xc859('0xa')](),controller[_0xc859('0xd')]);router['get'](_0xc859('0xe'),auth[_0xc859('0xa')](),controller[_0xc859('0xf')]);router[_0xc859('0x9')](_0xc859('0x10'),auth[_0xc859('0xa')](),controller[_0xc859('0x11')]);router[_0xc859('0x9')](_0xc859('0x12'),auth[_0xc859('0xa')](),controller['query']);router[_0xc859('0x13')]('/',auth[_0xc859('0xa')](),controller[_0xc859('0x14')]);router[_0xc859('0x15')]('/:id',auth[_0xc859('0xa')](),controller[_0xc859('0x16')]);router[_0xc859('0x17')](_0xc859('0xc'),auth[_0xc859('0xa')](),controller['destroy']);module[_0xc859('0x18')]=router;
\ No newline at end of file
+var _0xa2e0=['isAuthenticated','index','get','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xa2e0,0x124));var _0x0a2e=function(_0x484a8a,_0x520c6f){_0x484a8a=_0x484a8a-0x0;var _0x141a0f=_0xa2e0[_0x484a8a];return _0x141a0f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0a2e('0x0'));var timeout=require(_0x0a2e('0x1'));var express=require(_0x0a2e('0x2'));var router=express[_0x0a2e('0x3')]();var fs_extra=require(_0x0a2e('0x4'));var auth=require(_0x0a2e('0x5'));var interaction=require(_0x0a2e('0x6'));var config=require('../../config/environment');var controller=require(_0x0a2e('0x7'));router['get']('/',auth[_0x0a2e('0x8')](),controller[_0x0a2e('0x9')]);router[_0x0a2e('0xa')](_0x0a2e('0xb'),auth[_0x0a2e('0x8')](),controller[_0x0a2e('0xc')]);router[_0x0a2e('0xa')](_0x0a2e('0xd'),auth[_0x0a2e('0x8')](),controller[_0x0a2e('0xe')]);router['get'](_0x0a2e('0xf'),auth['isAuthenticated'](),controller[_0x0a2e('0x10')]);router[_0x0a2e('0xa')](_0x0a2e('0x11'),auth[_0x0a2e('0x8')](),controller[_0x0a2e('0x12')]);router[_0x0a2e('0x13')]('/',auth[_0x0a2e('0x8')](),controller[_0x0a2e('0x14')]);router[_0x0a2e('0x15')](_0x0a2e('0xb'),auth['isAuthenticated'](),controller[_0x0a2e('0x16')]);router[_0x0a2e('0x17')]('/:id',auth[_0x0a2e('0x8')](),controller['destroy']);module[_0x0a2e('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 5fb516f..8d13c22 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 _0x9b55=['Loading','manual','INTEGER','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE'];(function(_0x4d21ff,_0x19d202){var _0x22b554=function(_0x4473c5){while(--_0x4473c5){_0x4d21ff['push'](_0x4d21ff['shift']());}};_0x22b554(++_0x19d202);}(_0x9b55,0x87));var _0x59b5=function(_0x185bde,_0x43e4c6){_0x185bde=_0x185bde-0x0;var _0x39c312=_0x9b55[_0x185bde];return _0x39c312;};'use strict';var Sequelize=require(_0x59b5('0x0'));var moment=require(_0x59b5('0x1'));module[_0x59b5('0x2')]={'name':{'type':Sequelize[_0x59b5('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x59b5('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x59b5('0x4')](_0x59b5('0x5'),_0x59b5('0x6'),_0x59b5('0x7')),'allowNull':![],'defaultValue':_0x59b5('0x5')},'savename':{'type':Sequelize[_0x59b5('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x59b5('0x8')]},'endDate':{'type':Sequelize[_0x59b5('0x8')]},'status':{'type':Sequelize[_0x59b5('0x3')],'defaultValue':_0x59b5('0x9')},'type':{'type':Sequelize[_0x59b5('0x4')](_0x59b5('0xa'),'scheduled'),'allowNull':![],'defaultValue':_0x59b5('0xa')},'reportId':{'type':Sequelize[_0x59b5('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x59b5('0x3')]}};
\ No newline at end of file
+var _0x1321=['pdf','xlsx','DATE','Loading','scheduled','manual','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','csv'];(function(_0xd006b2,_0x300238){var _0xded2ef=function(_0x5e0156){while(--_0x5e0156){_0xd006b2['push'](_0xd006b2['shift']());}};_0xded2ef(++_0x300238);}(_0x1321,0x8a));var _0x1132=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x1321[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require(_0x1132('0x0'));var moment=require(_0x1132('0x1'));module[_0x1132('0x2')]={'name':{'type':Sequelize[_0x1132('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x1132('0x4'),_0x1132('0x5'),_0x1132('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x1132('0x7')]},'endDate':{'type':Sequelize[_0x1132('0x7')]},'status':{'type':Sequelize[_0x1132('0x3')],'defaultValue':_0x1132('0x8')},'type':{'type':Sequelize['ENUM']('manual',_0x1132('0x9')),'allowNull':![],'defaultValue':_0x1132('0xa')},'reportId':{'type':Sequelize[_0x1132('0xb')](0xb)[_0x1132('0xc')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 0cd8cfe..46a391b 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 _0x43f0=['offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','destroy','stack','name','send','render','merge','body','contact','interaction','map','AnalyticExtractedReport','rawAttributes','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','keys','find','create','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','existsSync','join','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','format','%s.%s','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x2f346d,_0xb3e493){var _0x1c2009=function(_0x4ef267){while(--_0x4ef267){_0x2f346d['push'](_0x2f346d['shift']());}};_0x1c2009(++_0xb3e493);}(_0x43f0,0xab));var _0x043f=function(_0x45a93b,_0x31dff5){_0x45a93b=_0x45a93b-0x0;var _0x1b70e3=_0x43f0[_0x45a93b];return _0x1b70e3;};'use strict';var emlformat=require(_0x043f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x043f('0x1'));var jsonpatch=require(_0x043f('0x2'));var rp=require(_0x043f('0x3'));var moment=require('moment');var BPromise=require(_0x043f('0x4'));var Mustache=require(_0x043f('0x5'));var util=require(_0x043f('0x6'));var path=require(_0x043f('0x7'));var sox=require('sox');var csv=require(_0x043f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x043f('0x9'));var _=require(_0x043f('0xa'));var squel=require(_0x043f('0xb'));var crypto=require(_0x043f('0xc'));var jsforce=require(_0x043f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x043f('0x8'));var querystring=require(_0x043f('0xe'));var Papa=require(_0x043f('0xf'));var Redis=require('ioredis');var authService=require(_0x043f('0x10'));var qs=require(_0x043f('0x11'));var as=require(_0x043f('0x12'));var hardwareService=require(_0x043f('0x13'));var logger=require(_0x043f('0x14'))(_0x043f('0x15'));var utils=require(_0x043f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x043f('0x17'));var db=require(_0x043f('0x18'))['db'];function respondWithStatusCode(_0x27769b,_0x4b1eaa){_0x4b1eaa=_0x4b1eaa||0xcc;return function(_0x3c7c27){if(_0x3c7c27){return _0x27769b[_0x043f('0x19')](_0x4b1eaa);}return _0x27769b[_0x043f('0x1a')](_0x4b1eaa)[_0x043f('0x1b')]();};}function respondWithResult(_0x29be82,_0x5a2d1d){_0x5a2d1d=_0x5a2d1d||0xc8;return function(_0x408eda){if(_0x408eda){return _0x29be82[_0x043f('0x1a')](_0x5a2d1d)[_0x043f('0x1c')](_0x408eda);}};}function respondWithFilteredResult(_0x25b2cb,_0x59b616){return function(_0x5b1675){if(_0x5b1675){var _0x5c145d=typeof _0x59b616[_0x043f('0x1d')]==='undefined'&&typeof _0x59b616[_0x043f('0x1e')]===_0x043f('0x1f');var _0x16b68c=_0x5b1675[_0x043f('0x20')];var _0x46c75d=_0x5c145d?0x0:_0x59b616[_0x043f('0x1d')];var _0x526f68=_0x5c145d?_0x5b1675[_0x043f('0x20')]:_0x59b616[_0x043f('0x1d')]+_0x59b616[_0x043f('0x1e')];var _0x566f78;if(_0x526f68>=_0x16b68c){_0x526f68=_0x16b68c;_0x566f78=0xc8;}else{_0x566f78=0xce;}_0x25b2cb[_0x043f('0x1a')](_0x566f78);return _0x25b2cb[_0x043f('0x21')](_0x043f('0x22'),_0x46c75d+'-'+_0x526f68+'/'+_0x16b68c)['json'](_0x5b1675);}return null;};}function patchUpdates(_0x2839b4){return function(_0x44ff9b){try{jsonpatch[_0x043f('0x23')](_0x44ff9b,_0x2839b4,!![]);}catch(_0x33d972){return BPromise[_0x043f('0x24')](_0x33d972);}return _0x44ff9b[_0x043f('0x25')]();};}function saveUpdates(_0x50b530,_0x724f85){return function(_0xb0df07){if(_0xb0df07){return _0xb0df07[_0x043f('0x26')](_0x50b530)['then'](function(_0x389998){return _0x389998;});}return null;};}function removeEntity(_0x5cb91d,_0x3fddea){return function(_0x35b853){if(_0x35b853){return _0x35b853['destroy']()[_0x043f('0x27')](function(){var _0x46d832=_0x35b853[_0x043f('0x28')]({'plain':!![]});var _0x398215=_0x043f('0x29');return db[_0x043f('0x2a')][_0x043f('0x2b')]({'where':{'type':_0x398215,'resourceId':_0x46d832['id']}})[_0x043f('0x27')](function(){return _0x35b853;});})[_0x043f('0x27')](function(){_0x5cb91d[_0x043f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4142eb,_0x1135ba){return function(_0x15b6e5){if(!_0x15b6e5){_0x4142eb[_0x043f('0x19')](0x194);}return _0x15b6e5;};}function handleError(_0x2cad8c,_0x548565){_0x548565=_0x548565||0x1f4;return function(_0x1930fd){logger['error'](_0x1930fd[_0x043f('0x2c')]);if(_0x1930fd[_0x043f('0x2d')]){delete _0x1930fd[_0x043f('0x2d')];}_0x2cad8c[_0x043f('0x1a')](_0x548565)[_0x043f('0x2e')](_0x1930fd);};}function getMustacheRender(_0x3b12a3,_0x4b65e2){return Mustache[_0x043f('0x2f')](_0x3b12a3,_[_0x043f('0x30')](_0x4b65e2[_0x043f('0x31')],{'contact':_0x4b65e2[_0x043f('0x32')],'message':_0x4b65e2['message'],'agent':_0x4b65e2['agent'],'interaction':_0x4b65e2[_0x043f('0x33')],'account':_0x4b65e2['account']}))||'';}exports['index']=function(_0xb73d7b,_0x3b8be0){var _0x44cea4={},_0x133944={},_0x25f681={'count':0x0,'rows':[]};var _0x52d9ad=_[_0x043f('0x34')](db[_0x043f('0x35')][_0x043f('0x36')],function(_0x11ab3d){return{'name':_0x11ab3d['fieldName'],'type':_0x11ab3d['type'][_0x043f('0x37')]};});_0x133944[_0x043f('0x38')]=_[_0x043f('0x34')](_0x52d9ad,_0x043f('0x2d'));_0x133944[_0x043f('0x39')]=_['keys'](_0xb73d7b[_0x043f('0x39')]);_0x133944[_0x043f('0x3a')]=_['intersection'](_0x133944[_0x043f('0x38')],_0x133944[_0x043f('0x39')]);_0x44cea4[_0x043f('0x3b')]=_[_0x043f('0x3c')](_0x133944[_0x043f('0x38')],qs[_0x043f('0x3d')](_0xb73d7b[_0x043f('0x39')][_0x043f('0x3d')]));_0x44cea4[_0x043f('0x3b')]=_0x44cea4[_0x043f('0x3b')][_0x043f('0x3e')]?_0x44cea4[_0x043f('0x3b')]:_0x133944[_0x043f('0x38')];if(!_0xb73d7b[_0x043f('0x39')]['hasOwnProperty'](_0x043f('0x3f'))){_0x44cea4[_0x043f('0x1e')]=qs[_0x043f('0x1e')](_0xb73d7b[_0x043f('0x39')][_0x043f('0x1e')]);_0x44cea4[_0x043f('0x1d')]=qs[_0x043f('0x1d')](_0xb73d7b['query'][_0x043f('0x1d')]);}_0x44cea4[_0x043f('0x40')]=qs[_0x043f('0x41')](_0xb73d7b[_0x043f('0x39')][_0x043f('0x41')]);_0x44cea4[_0x043f('0x42')]=qs[_0x043f('0x3a')](_[_0x043f('0x43')](_0xb73d7b['query'],_0x133944[_0x043f('0x3a')]),_0x52d9ad);if(_0xb73d7b[_0x043f('0x39')]['filter']){_0x44cea4[_0x043f('0x42')]=_['merge'](_0x44cea4[_0x043f('0x42')],{'$or':_[_0x043f('0x34')](_0x52d9ad,function(_0x236e47){if(_0x236e47['type']!==_0x043f('0x44')){var _0x3a654d={};_0x3a654d[_0x236e47['name']]={'$like':'%'+_0xb73d7b[_0x043f('0x39')][_0x043f('0x45')]+'%'};return _0x3a654d;}})});}_0x44cea4=_['merge']({},_0x44cea4,_0xb73d7b[_0x043f('0x46')]);var _0x5ee8e5={'where':_0x44cea4['where']};return db[_0x043f('0x35')]['count'](_0x5ee8e5)[_0x043f('0x27')](function(_0x2ccd02){_0x25f681[_0x043f('0x20')]=_0x2ccd02;if(_0xb73d7b[_0x043f('0x39')][_0x043f('0x47')]){_0x44cea4[_0x043f('0x48')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x043f('0x49')](_0x44cea4);})['then'](function(_0x1f0ea6){_0x25f681['rows']=_0x1f0ea6;return _0x25f681;})[_0x043f('0x27')](respondWithFilteredResult(_0x3b8be0,_0x44cea4))[_0x043f('0x4a')](handleError(_0x3b8be0,null));};exports[_0x043f('0x4b')]=function(_0x264a11,_0x5e1252){var _0x3fb850={'raw':!![],'where':{'id':_0x264a11[_0x043f('0x4c')]['id']}},_0x490816={};_0x490816[_0x043f('0x38')]=_[_0x043f('0x4d')](db[_0x043f('0x35')][_0x043f('0x36')]);_0x490816[_0x043f('0x39')]=_[_0x043f('0x4d')](_0x264a11[_0x043f('0x39')]);_0x490816[_0x043f('0x3a')]=_[_0x043f('0x3c')](_0x490816['model'],_0x490816[_0x043f('0x39')]);_0x3fb850['attributes']=_['intersection'](_0x490816[_0x043f('0x38')],qs[_0x043f('0x3d')](_0x264a11[_0x043f('0x39')][_0x043f('0x3d')]));_0x3fb850[_0x043f('0x3b')]=_0x3fb850['attributes'][_0x043f('0x3e')]?_0x3fb850['attributes']:_0x490816[_0x043f('0x38')];if(_0x264a11[_0x043f('0x39')][_0x043f('0x47')]){_0x3fb850[_0x043f('0x48')]=[{'all':!![]}];}_0x3fb850=_['merge']({},_0x3fb850,_0x264a11[_0x043f('0x46')]);return db[_0x043f('0x35')][_0x043f('0x4e')](_0x3fb850)[_0x043f('0x27')](handleEntityNotFound(_0x5e1252,null))[_0x043f('0x27')](respondWithResult(_0x5e1252,null))[_0x043f('0x4a')](handleError(_0x5e1252,null));};exports[_0x043f('0x4f')]=function(_0x5a4e4f,_0xa64898){return db[_0x043f('0x35')][_0x043f('0x4f')](_0x5a4e4f['body'],{})[_0x043f('0x27')](function(_0x49312b){var _0x25ae90=_0x5a4e4f[_0x043f('0x50')][_0x043f('0x28')]({'plain':!![]});if(!_0x25ae90)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25ae90[_0x043f('0x51')]===_0x043f('0x50')){var _0xb7cdb9=_0x49312b[_0x043f('0x28')]({'plain':!![]});var _0x53b52f=_0x043f('0x29');return db[_0x043f('0x52')][_0x043f('0x4e')]({'where':{'name':_0x53b52f,'userProfileId':_0x25ae90[_0x043f('0x53')]},'raw':!![]})[_0x043f('0x27')](function(_0x11b534){if(_0x11b534&&_0x11b534['autoAssociation']===0x0){return db[_0x043f('0x2a')]['create']({'name':_0xb7cdb9[_0x043f('0x2d')],'resourceId':_0xb7cdb9['id'],'type':_0x11b534[_0x043f('0x2d')],'sectionId':_0x11b534['id']},{})[_0x043f('0x27')](function(){return _0x49312b;});}else{return _0x49312b;}})[_0x043f('0x4a')](function(_0x19a35a){logger['error'](_0x043f('0x54'),_0x19a35a);throw _0x19a35a;});}return _0x49312b;})['then'](respondWithResult(_0xa64898,0xc9))[_0x043f('0x4a')](handleError(_0xa64898,null));};exports[_0x043f('0x26')]=function(_0x1da715,_0x1a1ecb){if(_0x1da715[_0x043f('0x31')]['id']){delete _0x1da715['body']['id'];}return db[_0x043f('0x35')][_0x043f('0x4e')]({'where':{'id':_0x1da715[_0x043f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1a1ecb,null))[_0x043f('0x27')](saveUpdates(_0x1da715[_0x043f('0x31')],null))[_0x043f('0x27')](respondWithResult(_0x1a1ecb,null))[_0x043f('0x4a')](handleError(_0x1a1ecb,null));};exports[_0x043f('0x2b')]=function(_0x43b2a9,_0x2381c6){return db[_0x043f('0x35')][_0x043f('0x4e')]({'where':{'id':_0x43b2a9['params']['id']}})['then'](handleEntityNotFound(_0x2381c6,null))[_0x043f('0x27')](removeEntity(_0x2381c6,null))[_0x043f('0x4a')](handleError(_0x2381c6,null));};exports[_0x043f('0x55')]=function(_0x5a5f3d,_0x23d207,_0x203ada){return db['AnalyticExtractedReport'][_0x043f('0x4e')]({'where':{'id':_0x5a5f3d[_0x043f('0x4c')]['id']},'attributes':['name',_0x043f('0x56'),'savename',_0x043f('0x57')],'raw':!![]})[_0x043f('0x27')](handleEntityNotFound(_0x23d207,null))['then'](function(_0x1c0fe8){if(_0x1c0fe8){if(!fs[_0x043f('0x58')](path[_0x043f('0x59')](config['root'],_0x043f('0x5a'),_0x1c0fe8[_0x043f('0x5b')]))){throw new db[(_0x043f('0x5c'))][(_0x043f('0x5d'))](_0x043f('0x5e'));}if(_0x5a5f3d[_0x043f('0x39')][_0x043f('0x5f')]){return _0x23d207[_0x043f('0x19')](0xc8);}return _0x23d207[_0x043f('0x55')](path[_0x043f('0x59')](config[_0x043f('0x60')],_0x043f('0x5a'),_0x1c0fe8[_0x043f('0x5b')]),util[_0x043f('0x61')](_0x043f('0x62'),_0x1c0fe8[_0x043f('0x56')]||_0x1c0fe8[_0x043f('0x2d')],_0x1c0fe8[_0x043f('0x57')][_0x043f('0x63')]()));}})['catch'](handleError(_0x23d207,null));};
\ No newline at end of file
+var _0xb04a=['rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','render','merge','body','message','agent','interaction','account','index','map','AnalyticExtractedReport','fieldName','type','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','filters','pick','filter','where','VIRTUAL','options','includeAll','include','rows','catch','rawAttributes','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','existsSync','join','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','format','%s.%s','output','toLowerCase','eml-format'];(function(_0x5a36ce,_0xff2dfb){var _0x589e66=function(_0x559a68){while(--_0x559a68){_0x5a36ce['push'](_0x5a36ce['shift']());}};_0x589e66(++_0xff2dfb);}(_0xb04a,0x1df));var _0xab04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb04a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xab04('0x0'));var rimraf=require(_0xab04('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xab04('0x2'));var moment=require('moment');var BPromise=require(_0xab04('0x3'));var Mustache=require(_0xab04('0x4'));var util=require(_0xab04('0x5'));var path=require(_0xab04('0x6'));var sox=require('sox');var csv=require(_0xab04('0x7'));var ejs=require(_0xab04('0x8'));var fs=require('fs');var fs_extra=require(_0xab04('0x9'));var _=require(_0xab04('0xa'));var squel=require('squel');var crypto=require(_0xab04('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xab04('0xc'));var toCsv=require(_0xab04('0x7'));var querystring=require('querystring');var Papa=require(_0xab04('0xd'));var Redis=require(_0xab04('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xab04('0xf'));var as=require(_0xab04('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xab04('0x11'))(_0xab04('0x12'));var utils=require(_0xab04('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f6589,_0xa66eb){_0xa66eb=_0xa66eb||0xcc;return function(_0x47b6dd){if(_0x47b6dd){return _0x4f6589[_0xab04('0x14')](_0xa66eb);}return _0x4f6589['status'](_0xa66eb)[_0xab04('0x15')]();};}function respondWithResult(_0x43dc85,_0x5cc13f){_0x5cc13f=_0x5cc13f||0xc8;return function(_0x5922ac){if(_0x5922ac){return _0x43dc85[_0xab04('0x16')](_0x5cc13f)[_0xab04('0x17')](_0x5922ac);}};}function respondWithFilteredResult(_0x1967c7,_0x44ed8c){return function(_0x239ea2){if(_0x239ea2){var _0x4a61db=typeof _0x44ed8c[_0xab04('0x18')]===_0xab04('0x19')&&typeof _0x44ed8c[_0xab04('0x1a')]===_0xab04('0x19');var _0x3d7e4d=_0x239ea2[_0xab04('0x1b')];var _0x3756d2=_0x4a61db?0x0:_0x44ed8c[_0xab04('0x18')];var _0x4a2465=_0x4a61db?_0x239ea2[_0xab04('0x1b')]:_0x44ed8c[_0xab04('0x18')]+_0x44ed8c[_0xab04('0x1a')];var _0x3a3371;if(_0x4a2465>=_0x3d7e4d){_0x4a2465=_0x3d7e4d;_0x3a3371=0xc8;}else{_0x3a3371=0xce;}_0x1967c7['status'](_0x3a3371);return _0x1967c7[_0xab04('0x1c')](_0xab04('0x1d'),_0x3756d2+'-'+_0x4a2465+'/'+_0x3d7e4d)[_0xab04('0x17')](_0x239ea2);}return null;};}function patchUpdates(_0x415f3b){return function(_0x431712){try{jsonpatch['apply'](_0x431712,_0x415f3b,!![]);}catch(_0x1d04bd){return BPromise[_0xab04('0x1e')](_0x1d04bd);}return _0x431712[_0xab04('0x1f')]();};}function saveUpdates(_0x2da149,_0x39b1a5){return function(_0x4897d4){if(_0x4897d4){return _0x4897d4[_0xab04('0x20')](_0x2da149)[_0xab04('0x21')](function(_0x268db8){return _0x268db8;});}return null;};}function removeEntity(_0x5733d7,_0xd1b834){return function(_0x106527){if(_0x106527){return _0x106527[_0xab04('0x22')]()['then'](function(){var _0x444412=_0x106527[_0xab04('0x23')]({'plain':!![]});var _0x5c2bca=_0xab04('0x24');return db[_0xab04('0x25')]['destroy']({'where':{'type':_0x5c2bca,'resourceId':_0x444412['id']}})['then'](function(){return _0x106527;});})['then'](function(){_0x5733d7['status'](0xcc)[_0xab04('0x15')]();});}};}function handleEntityNotFound(_0x4bb702,_0x2d4161){return function(_0x1f211c){if(!_0x1f211c){_0x4bb702[_0xab04('0x14')](0x194);}return _0x1f211c;};}function handleError(_0x2ee412,_0xd3d382){_0xd3d382=_0xd3d382||0x1f4;return function(_0x204765){logger[_0xab04('0x26')](_0x204765[_0xab04('0x27')]);if(_0x204765[_0xab04('0x28')]){delete _0x204765[_0xab04('0x28')];}_0x2ee412[_0xab04('0x16')](_0xd3d382)['send'](_0x204765);};}function getMustacheRender(_0x562475,_0x10d6c0){return Mustache[_0xab04('0x29')](_0x562475,_[_0xab04('0x2a')](_0x10d6c0[_0xab04('0x2b')],{'contact':_0x10d6c0['contact'],'message':_0x10d6c0[_0xab04('0x2c')],'agent':_0x10d6c0[_0xab04('0x2d')],'interaction':_0x10d6c0[_0xab04('0x2e')],'account':_0x10d6c0[_0xab04('0x2f')]}))||'';}exports[_0xab04('0x30')]=function(_0xa6cc59,_0x146ca5){var _0x5a704e={},_0x3c55d5={},_0x15bed9={'count':0x0,'rows':[]};var _0x51c87b=_[_0xab04('0x31')](db[_0xab04('0x32')]['rawAttributes'],function(_0x18b2d4){return{'name':_0x18b2d4[_0xab04('0x33')],'type':_0x18b2d4[_0xab04('0x34')]['key']};});_0x3c55d5['model']=_[_0xab04('0x31')](_0x51c87b,_0xab04('0x28'));_0x3c55d5['query']=_[_0xab04('0x35')](_0xa6cc59[_0xab04('0x36')]);_0x3c55d5['filters']=_[_0xab04('0x37')](_0x3c55d5[_0xab04('0x38')],_0x3c55d5['query']);_0x5a704e[_0xab04('0x39')]=_[_0xab04('0x37')](_0x3c55d5[_0xab04('0x38')],qs['fields'](_0xa6cc59[_0xab04('0x36')][_0xab04('0x3a')]));_0x5a704e[_0xab04('0x39')]=_0x5a704e[_0xab04('0x39')][_0xab04('0x3b')]?_0x5a704e[_0xab04('0x39')]:_0x3c55d5[_0xab04('0x38')];if(!_0xa6cc59['query'][_0xab04('0x3c')](_0xab04('0x3d'))){_0x5a704e[_0xab04('0x1a')]=qs[_0xab04('0x1a')](_0xa6cc59[_0xab04('0x36')][_0xab04('0x1a')]);_0x5a704e[_0xab04('0x18')]=qs[_0xab04('0x18')](_0xa6cc59[_0xab04('0x36')][_0xab04('0x18')]);}_0x5a704e[_0xab04('0x3e')]=qs['sort'](_0xa6cc59[_0xab04('0x36')]['sort']);_0x5a704e['where']=qs[_0xab04('0x3f')](_[_0xab04('0x40')](_0xa6cc59[_0xab04('0x36')],_0x3c55d5[_0xab04('0x3f')]),_0x51c87b);if(_0xa6cc59[_0xab04('0x36')][_0xab04('0x41')]){_0x5a704e[_0xab04('0x42')]=_[_0xab04('0x2a')](_0x5a704e[_0xab04('0x42')],{'$or':_[_0xab04('0x31')](_0x51c87b,function(_0xdcdac5){if(_0xdcdac5[_0xab04('0x34')]!==_0xab04('0x43')){var _0xcb05d8={};_0xcb05d8[_0xdcdac5['name']]={'$like':'%'+_0xa6cc59['query'][_0xab04('0x41')]+'%'};return _0xcb05d8;}})});}_0x5a704e=_[_0xab04('0x2a')]({},_0x5a704e,_0xa6cc59[_0xab04('0x44')]);var _0x803f91={'where':_0x5a704e[_0xab04('0x42')]};return db[_0xab04('0x32')][_0xab04('0x1b')](_0x803f91)['then'](function(_0x34d8a6){_0x15bed9[_0xab04('0x1b')]=_0x34d8a6;if(_0xa6cc59[_0xab04('0x36')][_0xab04('0x45')]){_0x5a704e[_0xab04('0x46')]=[{'all':!![]}];}return db[_0xab04('0x32')]['findAll'](_0x5a704e);})[_0xab04('0x21')](function(_0x5159fe){_0x15bed9[_0xab04('0x47')]=_0x5159fe;return _0x15bed9;})['then'](respondWithFilteredResult(_0x146ca5,_0x5a704e))[_0xab04('0x48')](handleError(_0x146ca5,null));};exports['show']=function(_0x109816,_0x55a117){var _0x134159={'raw':!![],'where':{'id':_0x109816['params']['id']}},_0x5c7925={};_0x5c7925[_0xab04('0x38')]=_[_0xab04('0x35')](db[_0xab04('0x32')][_0xab04('0x49')]);_0x5c7925[_0xab04('0x36')]=_[_0xab04('0x35')](_0x109816[_0xab04('0x36')]);_0x5c7925[_0xab04('0x3f')]=_[_0xab04('0x37')](_0x5c7925[_0xab04('0x38')],_0x5c7925[_0xab04('0x36')]);_0x134159[_0xab04('0x39')]=_[_0xab04('0x37')](_0x5c7925['model'],qs[_0xab04('0x3a')](_0x109816[_0xab04('0x36')][_0xab04('0x3a')]));_0x134159[_0xab04('0x39')]=_0x134159[_0xab04('0x39')][_0xab04('0x3b')]?_0x134159[_0xab04('0x39')]:_0x5c7925[_0xab04('0x38')];if(_0x109816['query'][_0xab04('0x45')]){_0x134159[_0xab04('0x46')]=[{'all':!![]}];}_0x134159=_[_0xab04('0x2a')]({},_0x134159,_0x109816[_0xab04('0x44')]);return db[_0xab04('0x32')]['find'](_0x134159)['then'](handleEntityNotFound(_0x55a117,null))[_0xab04('0x21')](respondWithResult(_0x55a117,null))[_0xab04('0x48')](handleError(_0x55a117,null));};exports[_0xab04('0x4a')]=function(_0x569e06,_0xb2e058){return db[_0xab04('0x32')][_0xab04('0x4a')](_0x569e06[_0xab04('0x2b')],{})[_0xab04('0x21')](function(_0xecba2){var _0x4cd278=_0x569e06[_0xab04('0x4b')][_0xab04('0x23')]({'plain':!![]});if(!_0x4cd278)throw new Error(_0xab04('0x4c'));if(_0x4cd278[_0xab04('0x4d')]===_0xab04('0x4b')){var _0x4c7110=_0xecba2[_0xab04('0x23')]({'plain':!![]});var _0xd3a5fb='ExtractedReports';return db['UserProfileSection'][_0xab04('0x4e')]({'where':{'name':_0xd3a5fb,'userProfileId':_0x4cd278['userProfileId']},'raw':!![]})[_0xab04('0x21')](function(_0x36447d){if(_0x36447d&&_0x36447d[_0xab04('0x4f')]===0x0){return db[_0xab04('0x25')][_0xab04('0x4a')]({'name':_0x4c7110[_0xab04('0x28')],'resourceId':_0x4c7110['id'],'type':_0x36447d['name'],'sectionId':_0x36447d['id']},{})[_0xab04('0x21')](function(){return _0xecba2;});}else{return _0xecba2;}})[_0xab04('0x48')](function(_0x3d5a45){logger[_0xab04('0x26')](_0xab04('0x50'),_0x3d5a45);throw _0x3d5a45;});}return _0xecba2;})['then'](respondWithResult(_0xb2e058,0xc9))[_0xab04('0x48')](handleError(_0xb2e058,null));};exports[_0xab04('0x20')]=function(_0x5c0afb,_0x49fae0){if(_0x5c0afb[_0xab04('0x2b')]['id']){delete _0x5c0afb[_0xab04('0x2b')]['id'];}return db[_0xab04('0x32')]['find']({'where':{'id':_0x5c0afb['params']['id']}})[_0xab04('0x21')](handleEntityNotFound(_0x49fae0,null))[_0xab04('0x21')](saveUpdates(_0x5c0afb[_0xab04('0x2b')],null))[_0xab04('0x21')](respondWithResult(_0x49fae0,null))[_0xab04('0x48')](handleError(_0x49fae0,null));};exports[_0xab04('0x22')]=function(_0xa696a8,_0x1475bd){return db[_0xab04('0x32')]['find']({'where':{'id':_0xa696a8[_0xab04('0x51')]['id']}})[_0xab04('0x21')](handleEntityNotFound(_0x1475bd,null))[_0xab04('0x21')](removeEntity(_0x1475bd,null))[_0xab04('0x48')](handleError(_0x1475bd,null));};exports[_0xab04('0x52')]=function(_0x280502,_0x3417ab,_0x4365f1){return db[_0xab04('0x32')]['find']({'where':{'id':_0x280502[_0xab04('0x51')]['id']},'attributes':[_0xab04('0x28'),'basename','savename','output'],'raw':!![]})[_0xab04('0x21')](handleEntityNotFound(_0x3417ab,null))['then'](function(_0x5a1bf1){if(_0x5a1bf1){if(!fs[_0xab04('0x53')](path[_0xab04('0x54')](config['root'],_0xab04('0x55'),_0x5a1bf1[_0xab04('0x56')]))){throw new db[(_0xab04('0x57'))][(_0xab04('0x58'))](_0xab04('0x59'));}if(_0x280502[_0xab04('0x36')][_0xab04('0x5a')]){return _0x3417ab[_0xab04('0x14')](0xc8);}return _0x3417ab[_0xab04('0x52')](path['join'](config[_0xab04('0x5b')],_0xab04('0x55'),_0x5a1bf1[_0xab04('0x56')]),util[_0xab04('0x5c')](_0xab04('0x5d'),_0x5a1bf1['basename']||_0x5a1bf1['name'],_0x5a1bf1[_0xab04('0x5e')][_0xab04('0x5f')]()));}})[_0xab04('0x48')](handleError(_0x3417ab,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 1ff4bf7..bcff5a5 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 _0xf9c3=['request-promise','rimraf','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api','moment','bluebird'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0xf9c3,0x1db));var _0x3f9c=function(_0x157111,_0x3a9771){_0x157111=_0x157111-0x0;var _0x5b00c4=_0xf9c3[_0x157111];return _0x5b00c4;};'use strict';var _=require(_0x3f9c('0x0'));var util=require(_0x3f9c('0x1'));var logger=require('../../config/logger')(_0x3f9c('0x2'));var moment=require(_0x3f9c('0x3'));var BPromise=require(_0x3f9c('0x4'));var rp=require(_0x3f9c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3f9c('0x6'));var config=require('../../config/environment');var attributes=require(_0x3f9c('0x7'));module[_0x3f9c('0x8')]=function(_0x104b16,_0x38d6ae){return _0x104b16[_0x3f9c('0x9')](_0x3f9c('0xa'),attributes,{'tableName':_0x3f9c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa5b0=['request-promise','path','rimraf','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','api','moment','bluebird'];(function(_0x24634f,_0x360eef){var _0x475dcf=function(_0x4af5f4){while(--_0x4af5f4){_0x24634f['push'](_0x24634f['shift']());}};_0x475dcf(++_0x360eef);}(_0xa5b0,0x130));var _0x0a5b=function(_0x4853fc,_0x52cd55){_0x4853fc=_0x4853fc-0x0;var _0x23be73=_0xa5b0[_0x4853fc];return _0x23be73;};'use strict';var _=require(_0x0a5b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0a5b('0x1'));var moment=require(_0x0a5b('0x2'));var BPromise=require(_0x0a5b('0x3'));var rp=require(_0x0a5b('0x4'));var fs=require('fs');var path=require(_0x0a5b('0x5'));var rimraf=require(_0x0a5b('0x6'));var config=require('../../config/environment');var attributes=require(_0x0a5b('0x7'));module[_0x0a5b('0x8')]=function(_0x289944,_0x25ca93){return _0x289944['define'](_0x0a5b('0x9'),attributes,{'tableName':_0x0a5b('0xa'),'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 559f548..125abc4 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 _0x2ef2=['client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3b3cc6,_0x1a6e24){var _0x1161e4=function(_0x19cc52){while(--_0x19cc52){_0x3b3cc6['push'](_0x3b3cc6['shift']());}};_0x1161e4(++_0x1a6e24);}(_0x2ef2,0x187));var _0x22ef=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x2ef2[_0x31a371];return _0x2a5bd6;};'use strict';var _=require(_0x22ef('0x0'));var util=require('util');var moment=require(_0x22ef('0x1'));var BPromise=require(_0x22ef('0x2'));var rs=require(_0x22ef('0x3'));var fs=require('fs');var Redis=require(_0x22ef('0x4'));var db=require(_0x22ef('0x5'))['db'];var utils=require(_0x22ef('0x6'));var logger=require(_0x22ef('0x7'))(_0x22ef('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x22ef('0x9')][_0x22ef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b36da,_0x25e491,_0x23f094){return new BPromise(function(_0x594c59,_0xe3a0c6){return client['request'](_0x2b36da,_0x23f094)[_0x22ef('0xb')](function(_0x22f661){logger[_0x22ef('0xc')](_0x22ef('0xd'),_0x25e491,_0x22ef('0xe'));logger[_0x22ef('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x25e491,'request\x20sent',JSON['stringify'](_0x22f661));if(_0x22f661[_0x22ef('0x10')]){if(_0x22f661['error'][_0x22ef('0x11')]===0x1f4){logger['error'](_0x22ef('0xd'),_0x25e491,_0x22f661[_0x22ef('0x10')]['message']);return _0xe3a0c6(_0x22f661[_0x22ef('0x10')][_0x22ef('0x12')]);}logger[_0x22ef('0x10')](_0x22ef('0xd'),_0x25e491,_0x22f661[_0x22ef('0x10')]['message']);return _0x594c59(_0x22f661['error'][_0x22ef('0x12')]);}else{logger[_0x22ef('0xc')](_0x22ef('0xd'),_0x25e491,_0x22ef('0xe'));_0x594c59(_0x22f661['result'][_0x22ef('0x12')]);}})[_0x22ef('0x13')](function(_0x1a0764){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x25e491,_0x1a0764);_0xe3a0c6(_0x1a0764);});});}
\ No newline at end of file
+var _0xd86d=['../../config/utils','../../config/environment','jayson/promise','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','AnalyticExtractedReport,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x202a78,_0x753c8b){var _0x14dabf=function(_0x3f57bc){while(--_0x3f57bc){_0x202a78['push'](_0x202a78['shift']());}};_0x14dabf(++_0x753c8b);}(_0xd86d,0x189));var _0xdd86=function(_0x1f9d32,_0x2dcdaa){_0x1f9d32=_0x1f9d32-0x0;var _0x4c2205=_0xd86d[_0x1f9d32];return _0x4c2205;};'use strict';var _=require(_0xdd86('0x0'));var util=require(_0xdd86('0x1'));var moment=require(_0xdd86('0x2'));var BPromise=require('bluebird');var rs=require(_0xdd86('0x3'));var fs=require('fs');var Redis=require(_0xdd86('0x4'));var db=require(_0xdd86('0x5'))['db'];var utils=require(_0xdd86('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xdd86('0x7'));var jayson=require(_0xdd86('0x8'));var client=jayson['client'][_0xdd86('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x542c44,_0x391c2b,_0x53ddb8){return new BPromise(function(_0x3f57c8,_0xb58d22){return client[_0xdd86('0xa')](_0x542c44,_0x53ddb8)['then'](function(_0x2d9edb){logger[_0xdd86('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x391c2b,'request\x20sent');logger['debug'](_0xdd86('0xc'),_0x391c2b,'request\x20sent',JSON['stringify'](_0x2d9edb));if(_0x2d9edb[_0xdd86('0xd')]){if(_0x2d9edb['error']['code']===0x1f4){logger['error'](_0xdd86('0xe'),_0x391c2b,_0x2d9edb[_0xdd86('0xd')][_0xdd86('0xf')]);return _0xb58d22(_0x2d9edb[_0xdd86('0xd')][_0xdd86('0xf')]);}logger['error'](_0xdd86('0xe'),_0x391c2b,_0x2d9edb[_0xdd86('0xd')][_0xdd86('0xf')]);return _0x3f57c8(_0x2d9edb['error'][_0xdd86('0xf')]);}else{logger[_0xdd86('0xb')](_0xdd86('0xe'),_0x391c2b,_0xdd86('0x10'));_0x3f57c8(_0x2d9edb[_0xdd86('0x11')][_0xdd86('0xf')]);}})[_0xdd86('0x12')](function(_0x15636d){logger[_0xdd86('0xd')](_0xdd86('0xe'),_0x391c2b,_0x15636d);_0xb58d22(_0x15636d);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 2ca754c..584a0a0 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 _0x4be0=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post'];(function(_0x24a4be,_0x2cac64){var _0xf7e46c=function(_0x467bab){while(--_0x467bab){_0x24a4be['push'](_0x24a4be['shift']());}};_0xf7e46c(++_0x2cac64);}(_0x4be0,0x9e));var _0x04be=function(_0x516cee,_0x262a39){_0x516cee=_0x516cee-0x0;var _0x56d2be=_0x4be0[_0x516cee];return _0x56d2be;};'use strict';var multer=require(_0x04be('0x0'));var util=require(_0x04be('0x1'));var path=require(_0x04be('0x2'));var timeout=require(_0x04be('0x3'));var express=require(_0x04be('0x4'));var router=express[_0x04be('0x5')]();var fs_extra=require(_0x04be('0x6'));var auth=require(_0x04be('0x7'));var interaction=require(_0x04be('0x8'));var config=require(_0x04be('0x9'));var controller=require('./analyticExtractedReport.controller');router[_0x04be('0xa')]('/',auth[_0x04be('0xb')](),controller[_0x04be('0xc')]);router[_0x04be('0xa')](_0x04be('0xd'),auth[_0x04be('0xb')](),controller[_0x04be('0xe')]);router[_0x04be('0xa')](_0x04be('0xf'),auth['isAuthenticated'](),controller[_0x04be('0x10')]);router[_0x04be('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x04be('0x12')](_0x04be('0xd'),auth[_0x04be('0xb')](),controller[_0x04be('0x13')]);router['delete']('/:id',auth[_0x04be('0xb')](),controller[_0x04be('0x14')]);module[_0x04be('0x15')]=router;
\ No newline at end of file
+var _0x175c=['fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x1aa56a,_0x56f0df){var _0x1195d7=function(_0x2eb851){while(--_0x2eb851){_0x1aa56a['push'](_0x1aa56a['shift']());}};_0x1195d7(++_0x56f0df);}(_0x175c,0x1b5));var _0xc175=function(_0x5b59ab,_0x1f6d5c){_0x5b59ab=_0x5b59ab-0x0;var _0x27cc47=_0x175c[_0x5b59ab];return _0x27cc47;};'use strict';var multer=require(_0xc175('0x0'));var util=require('util');var path=require(_0xc175('0x1'));var timeout=require(_0xc175('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc175('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xc175('0x4'));var config=require(_0xc175('0x5'));var controller=require(_0xc175('0x6'));router[_0xc175('0x7')]('/',auth['isAuthenticated'](),controller[_0xc175('0x8')]);router[_0xc175('0x7')](_0xc175('0x9'),auth[_0xc175('0xa')](),controller['show']);router[_0xc175('0x7')](_0xc175('0xb'),auth[_0xc175('0xa')](),controller[_0xc175('0xc')]);router[_0xc175('0xd')]('/',auth[_0xc175('0xa')](),controller[_0xc175('0xe')]);router[_0xc175('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xc175('0x10')]);router[_0xc175('0x11')](_0xc175('0x9'),auth[_0xc175('0xa')](),controller[_0xc175('0x12')]);module[_0xc175('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 62afdaf..ef820dd 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 _0xe14b=['sequelize','exports','STRING'];(function(_0x5bd0f1,_0x567887){var _0x17838c=function(_0xc89a6a){while(--_0xc89a6a){_0x5bd0f1['push'](_0x5bd0f1['shift']());}};_0x17838c(++_0x567887);}(_0xe14b,0x93));var _0xbe14=function(_0x4c8d54,_0x446909){_0x4c8d54=_0x4c8d54-0x0;var _0x1b1ef0=_0xe14b[_0x4c8d54];return _0x1b1ef0;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xbe14('0x2')]},'format':{'type':Sequelize[_0xbe14('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xbe14('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xe14b=['sequelize','exports','STRING'];(function(_0x161797,_0x26668a){var _0x46f893=function(_0x5d5112){while(--_0x5d5112){_0x161797['push'](_0x161797['shift']());}};_0x46f893(++_0x26668a);}(_0xe14b,0x93));var _0xbe14=function(_0xde0ad0,_0x198d2e){_0xde0ad0=_0xde0ad0-0x0;var _0x5b11b0=_0xe14b[_0xde0ad0];return _0x5b11b0;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xbe14('0x2')]},'format':{'type':Sequelize[_0xbe14('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xbe14('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index e56ff79..195f236 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 _0x55bd=['apply','save','destroy','then','status','error','name','render','body','message','agent','interaction','index','map','AnalyticFieldReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','show','include','find','catch','create','update','params','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','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','json','offset','undefined','count','set','Content-Range'];(function(_0x16f6ed,_0x2690ec){var _0x22cb8c=function(_0x58eb94){while(--_0x58eb94){_0x16f6ed['push'](_0x16f6ed['shift']());}};_0x22cb8c(++_0x2690ec);}(_0x55bd,0x8c));var _0xd55b=function(_0x226345,_0x1e16fe){_0x226345=_0x226345-0x0;var _0x2ca077=_0x55bd[_0x226345];return _0x2ca077;};'use strict';var emlformat=require(_0xd55b('0x0'));var rimraf=require(_0xd55b('0x1'));var zipdir=require(_0xd55b('0x2'));var jsonpatch=require(_0xd55b('0x3'));var rp=require(_0xd55b('0x4'));var moment=require('moment');var BPromise=require(_0xd55b('0x5'));var Mustache=require('mustache');var util=require(_0xd55b('0x6'));var path=require(_0xd55b('0x7'));var sox=require(_0xd55b('0x8'));var csv=require('to-csv');var ejs=require(_0xd55b('0x9'));var fs=require('fs');var fs_extra=require(_0xd55b('0xa'));var _=require(_0xd55b('0xb'));var squel=require(_0xd55b('0xc'));var crypto=require(_0xd55b('0xd'));var jsforce=require(_0xd55b('0xe'));var deskjs=require(_0xd55b('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd55b('0x10'));var authService=require(_0xd55b('0x11'));var qs=require(_0xd55b('0x12'));var as=require(_0xd55b('0x13'));var hardwareService=require(_0xd55b('0x14'));var logger=require(_0xd55b('0x15'))(_0xd55b('0x16'));var utils=require(_0xd55b('0x17'));var config=require(_0xd55b('0x18'));var licenseUtil=require(_0xd55b('0x19'));var db=require(_0xd55b('0x1a'))['db'];function respondWithStatusCode(_0x544b96,_0x1d0e5c){_0x1d0e5c=_0x1d0e5c||0xcc;return function(_0x4c8647){if(_0x4c8647){return _0x544b96[_0xd55b('0x1b')](_0x1d0e5c);}return _0x544b96['status'](_0x1d0e5c)['end']();};}function respondWithResult(_0x28b43c,_0x4bd0fd){_0x4bd0fd=_0x4bd0fd||0xc8;return function(_0x26713b){if(_0x26713b){return _0x28b43c['status'](_0x4bd0fd)[_0xd55b('0x1c')](_0x26713b);}};}function respondWithFilteredResult(_0x443077,_0x35135c){return function(_0x270de6){if(_0x270de6){var _0x1339be=typeof _0x35135c[_0xd55b('0x1d')]===_0xd55b('0x1e')&&typeof _0x35135c['limit']===_0xd55b('0x1e');var _0x4a9e85=_0x270de6[_0xd55b('0x1f')];var _0x3b8e65=_0x1339be?0x0:_0x35135c[_0xd55b('0x1d')];var _0x346345=_0x1339be?_0x270de6[_0xd55b('0x1f')]:_0x35135c[_0xd55b('0x1d')]+_0x35135c['limit'];var _0x232c2d;if(_0x346345>=_0x4a9e85){_0x346345=_0x4a9e85;_0x232c2d=0xc8;}else{_0x232c2d=0xce;}_0x443077['status'](_0x232c2d);return _0x443077[_0xd55b('0x20')](_0xd55b('0x21'),_0x3b8e65+'-'+_0x346345+'/'+_0x4a9e85)[_0xd55b('0x1c')](_0x270de6);}return null;};}function patchUpdates(_0x2efbbf){return function(_0x4c6955){try{jsonpatch[_0xd55b('0x22')](_0x4c6955,_0x2efbbf,!![]);}catch(_0x357da){return BPromise['reject'](_0x357da);}return _0x4c6955[_0xd55b('0x23')]();};}function saveUpdates(_0x5ce595,_0xab86b4){return function(_0x6f1b){if(_0x6f1b){return _0x6f1b['update'](_0x5ce595)['then'](function(_0x26df23){return _0x26df23;});}return null;};}function removeEntity(_0x46649a,_0x3c202f){return function(_0x11f265){if(_0x11f265){return _0x11f265[_0xd55b('0x24')]()[_0xd55b('0x25')](function(){_0x46649a[_0xd55b('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ff02e,_0x5f698f){return function(_0x1e3e52){if(!_0x1e3e52){_0x4ff02e['sendStatus'](0x194);}return _0x1e3e52;};}function handleError(_0x23d194,_0x19f2dd){_0x19f2dd=_0x19f2dd||0x1f4;return function(_0x408aea){logger[_0xd55b('0x27')](_0x408aea['stack']);if(_0x408aea[_0xd55b('0x28')]){delete _0x408aea[_0xd55b('0x28')];}_0x23d194[_0xd55b('0x26')](_0x19f2dd)['send'](_0x408aea);};}function getMustacheRender(_0x4a7732,_0x2caf7c){return Mustache[_0xd55b('0x29')](_0x4a7732,_['merge'](_0x2caf7c[_0xd55b('0x2a')],{'contact':_0x2caf7c['contact'],'message':_0x2caf7c[_0xd55b('0x2b')],'agent':_0x2caf7c[_0xd55b('0x2c')],'interaction':_0x2caf7c[_0xd55b('0x2d')],'account':_0x2caf7c['account']}))||'';}exports[_0xd55b('0x2e')]=function(_0x347051,_0x5b261d){var _0x474fba={},_0x551e2f={},_0x4b6237={'count':0x0,'rows':[]};var _0x3caa0c=_[_0xd55b('0x2f')](db[_0xd55b('0x30')][_0xd55b('0x31')],function(_0x4771a3){return{'name':_0x4771a3['fieldName'],'type':_0x4771a3[_0xd55b('0x32')][_0xd55b('0x33')]};});_0x551e2f[_0xd55b('0x34')]=_[_0xd55b('0x2f')](_0x3caa0c,_0xd55b('0x28'));_0x551e2f['query']=_[_0xd55b('0x35')](_0x347051[_0xd55b('0x36')]);_0x551e2f[_0xd55b('0x37')]=_[_0xd55b('0x38')](_0x551e2f[_0xd55b('0x34')],_0x551e2f['query']);_0x474fba[_0xd55b('0x39')]=_['intersection'](_0x551e2f[_0xd55b('0x34')],qs[_0xd55b('0x3a')](_0x347051[_0xd55b('0x36')][_0xd55b('0x3a')]));_0x474fba[_0xd55b('0x39')]=_0x474fba[_0xd55b('0x39')][_0xd55b('0x3b')]?_0x474fba['attributes']:_0x551e2f[_0xd55b('0x34')];if(!_0x347051[_0xd55b('0x36')][_0xd55b('0x3c')](_0xd55b('0x3d'))){_0x474fba[_0xd55b('0x3e')]=qs['limit'](_0x347051[_0xd55b('0x36')][_0xd55b('0x3e')]);_0x474fba['offset']=qs[_0xd55b('0x1d')](_0x347051[_0xd55b('0x36')][_0xd55b('0x1d')]);}_0x474fba[_0xd55b('0x3f')]=qs[_0xd55b('0x40')](_0x347051[_0xd55b('0x36')][_0xd55b('0x40')]);_0x474fba['where']=qs[_0xd55b('0x37')](_[_0xd55b('0x41')](_0x347051['query'],_0x551e2f[_0xd55b('0x37')]),_0x3caa0c);if(_0x347051[_0xd55b('0x36')][_0xd55b('0x42')]){_0x474fba[_0xd55b('0x43')]=_[_0xd55b('0x44')](_0x474fba[_0xd55b('0x43')],{'$or':_[_0xd55b('0x2f')](_0x3caa0c,function(_0x12fb35){if(_0x12fb35[_0xd55b('0x32')]!==_0xd55b('0x45')){var _0x1867c5={};_0x1867c5[_0x12fb35[_0xd55b('0x28')]]={'$like':'%'+_0x347051['query'][_0xd55b('0x42')]+'%'};return _0x1867c5;}})});}_0x474fba=_[_0xd55b('0x44')]({},_0x474fba,_0x347051[_0xd55b('0x46')]);var _0x281403={'where':_0x474fba[_0xd55b('0x43')]};return db[_0xd55b('0x30')][_0xd55b('0x1f')](_0x281403)[_0xd55b('0x25')](function(_0x218f7f){_0x4b6237['count']=_0x218f7f;if(_0x347051[_0xd55b('0x36')][_0xd55b('0x47')]){_0x474fba['include']=[{'all':!![]}];}return db[_0xd55b('0x30')][_0xd55b('0x48')](_0x474fba);})[_0xd55b('0x25')](function(_0x12303e){_0x4b6237['rows']=_0x12303e;return _0x4b6237;})[_0xd55b('0x25')](respondWithFilteredResult(_0x5b261d,_0x474fba))['catch'](handleError(_0x5b261d,null));};exports[_0xd55b('0x49')]=function(_0x3cfb80,_0x44ac06){var _0x29715a={'raw':![],'where':{'id':_0x3cfb80['params']['id']}},_0x9a9193={};_0x9a9193[_0xd55b('0x34')]=_[_0xd55b('0x35')](db['AnalyticFieldReport'][_0xd55b('0x31')]);_0x9a9193[_0xd55b('0x36')]=_[_0xd55b('0x35')](_0x3cfb80['query']);_0x9a9193['filters']=_[_0xd55b('0x38')](_0x9a9193[_0xd55b('0x34')],_0x9a9193['query']);_0x29715a[_0xd55b('0x39')]=_[_0xd55b('0x38')](_0x9a9193[_0xd55b('0x34')],qs[_0xd55b('0x3a')](_0x3cfb80['query']['fields']));_0x29715a['attributes']=_0x29715a[_0xd55b('0x39')][_0xd55b('0x3b')]?_0x29715a['attributes']:_0x9a9193[_0xd55b('0x34')];if(_0x3cfb80['query'][_0xd55b('0x47')]){_0x29715a[_0xd55b('0x4a')]=[{'all':!![]}];}_0x29715a=_[_0xd55b('0x44')]({},_0x29715a,_0x3cfb80[_0xd55b('0x46')]);return db[_0xd55b('0x30')][_0xd55b('0x4b')](_0x29715a)[_0xd55b('0x25')](handleEntityNotFound(_0x44ac06,null))[_0xd55b('0x25')](respondWithResult(_0x44ac06,null))[_0xd55b('0x4c')](handleError(_0x44ac06,null));};exports[_0xd55b('0x4d')]=function(_0x7c2c5f,_0xbfc3c8){return db['AnalyticFieldReport']['create'](_0x7c2c5f['body'],{})['then'](respondWithResult(_0xbfc3c8,0xc9))[_0xd55b('0x4c')](handleError(_0xbfc3c8,null));};exports['bulkCreate']=function(_0x52ff89,_0x179872){return db[_0xd55b('0x30')]['bulkCreate'](_0x52ff89[_0xd55b('0x2a')],{'raw':![],'individualHooks':!![]})[_0xd55b('0x25')](respondWithResult(_0x179872,0xc9))[_0xd55b('0x4c')](handleError(_0x179872,null));};exports[_0xd55b('0x4e')]=function(_0x1ca25f,_0x3134e2){if(_0x1ca25f[_0xd55b('0x2a')]['id']){delete _0x1ca25f['body']['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x1ca25f[_0xd55b('0x4f')]['id']}})[_0xd55b('0x25')](handleEntityNotFound(_0x3134e2,null))[_0xd55b('0x25')](saveUpdates(_0x1ca25f['body'],null))[_0xd55b('0x25')](respondWithResult(_0x3134e2,null))[_0xd55b('0x4c')](handleError(_0x3134e2,null));};exports[_0xd55b('0x24')]=function(_0x3f0821,_0x2a1ca5){return db[_0xd55b('0x30')]['find']({'where':{'id':_0x3f0821[_0xd55b('0x4f')]['id']}})[_0xd55b('0x25')](handleEntityNotFound(_0x2a1ca5,null))['then'](removeEntity(_0x2a1ca5,null))[_0xd55b('0x4c')](handleError(_0x2a1ca5,null));};exports[_0xd55b('0x50')]=function(_0x1faa99,_0x312c5f){return db['AnalyticFieldReport'][_0xd55b('0x24')]({'where':{'id':_0x1faa99[_0xd55b('0x36')][_0xd55b('0x51')]||[]},'raw':![],'individualHooks':!![]})[_0xd55b('0x25')](respondWithResult(_0x312c5f,0xcc))[_0xd55b('0x4c')](handleError(_0x312c5f,null));};exports[_0xd55b('0x52')]=function(_0xff224e,_0x28e59b,_0x343d09){return db[_0xd55b('0x53')]['findOne']({'where':{'id':_0xff224e[_0xd55b('0x4f')]['id']}})[_0xd55b('0x25')](handleEntityNotFound(_0x28e59b,null))[_0xd55b('0x25')](function(_0x2fa1c5){if(_0x2fa1c5){return db[_0xd55b('0x54')][_0xd55b('0x55')](function(_0x3bf6c8){return db[_0xd55b('0x30')][_0xd55b('0x24')]({'where':{'CustomReportId':_0xff224e[_0xd55b('0x4f')]['id']},'transaction':_0x3bf6c8})[_0xd55b('0x25')](function(_0x221ff7){var _0x2df510=_['map'](_0xff224e[_0xd55b('0x2a')],function(_0x59cbd0){delete _0x59cbd0['id'];_0x59cbd0[_0xd55b('0x56')]=_0xff224e['params']['id'];return _0x59cbd0;});return db['AnalyticFieldReport']['bulkCreate'](_0x2df510,{'transaction':_0x3bf6c8});});})[_0xd55b('0x25')](function(){return db[_0xd55b('0x30')][_0xd55b('0x48')]({'where':{'CustomReportId':_0xff224e['params']['id']}});});}})[_0xd55b('0x25')](respondWithResult(_0x28e59b,null))[_0xd55b('0x4c')](handleError(_0x28e59b,null));};
\ No newline at end of file
+var _0x230e=['../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','offset','limit','undefined','count','set','apply','save','update','then','destroy','end','stack','name','send','merge','body','message','agent','interaction','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','options','includeAll','include','catch','show','params','keys','find','create','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x5bc4f4,_0x294bcd){var _0x4979cb=function(_0x45b37f){while(--_0x45b37f){_0x5bc4f4['push'](_0x5bc4f4['shift']());}};_0x4979cb(++_0x294bcd);}(_0x230e,0x1da));var _0xe230=function(_0x542e0a,_0x1d2021){_0x542e0a=_0x542e0a-0x0;var _0x195b71=_0x230e[_0x542e0a];return _0x195b71;};'use strict';var emlformat=require(_0xe230('0x0'));var rimraf=require(_0xe230('0x1'));var zipdir=require(_0xe230('0x2'));var jsonpatch=require(_0xe230('0x3'));var rp=require(_0xe230('0x4'));var moment=require(_0xe230('0x5'));var BPromise=require(_0xe230('0x6'));var Mustache=require('mustache');var util=require(_0xe230('0x7'));var path=require(_0xe230('0x8'));var sox=require('sox');var csv=require(_0xe230('0x9'));var ejs=require(_0xe230('0xa'));var fs=require('fs');var fs_extra=require(_0xe230('0xb'));var _=require('lodash');var squel=require(_0xe230('0xc'));var crypto=require('crypto');var jsforce=require(_0xe230('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe230('0x9'));var querystring=require('querystring');var Papa=require(_0xe230('0xe'));var Redis=require(_0xe230('0xf'));var authService=require(_0xe230('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe230('0x11'));var hardwareService=require(_0xe230('0x12'));var logger=require(_0xe230('0x13'))(_0xe230('0x14'));var utils=require(_0xe230('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xaf6d6a,_0x487184){_0x487184=_0x487184||0xcc;return function(_0x2fb5fd){if(_0x2fb5fd){return _0xaf6d6a[_0xe230('0x16')](_0x487184);}return _0xaf6d6a[_0xe230('0x17')](_0x487184)['end']();};}function respondWithResult(_0x1dd3a6,_0x15235e){_0x15235e=_0x15235e||0xc8;return function(_0x3d2cfc){if(_0x3d2cfc){return _0x1dd3a6[_0xe230('0x17')](_0x15235e)['json'](_0x3d2cfc);}};}function respondWithFilteredResult(_0x54f947,_0x5ef615){return function(_0x348292){if(_0x348292){var _0x35a7c4=typeof _0x5ef615[_0xe230('0x18')]==='undefined'&&typeof _0x5ef615[_0xe230('0x19')]===_0xe230('0x1a');var _0xd91943=_0x348292['count'];var _0x2b636d=_0x35a7c4?0x0:_0x5ef615[_0xe230('0x18')];var _0x2fc2ef=_0x35a7c4?_0x348292[_0xe230('0x1b')]:_0x5ef615['offset']+_0x5ef615[_0xe230('0x19')];var _0x1cf1fc;if(_0x2fc2ef>=_0xd91943){_0x2fc2ef=_0xd91943;_0x1cf1fc=0xc8;}else{_0x1cf1fc=0xce;}_0x54f947['status'](_0x1cf1fc);return _0x54f947[_0xe230('0x1c')]('Content-Range',_0x2b636d+'-'+_0x2fc2ef+'/'+_0xd91943)['json'](_0x348292);}return null;};}function patchUpdates(_0x248708){return function(_0x55e3bf){try{jsonpatch[_0xe230('0x1d')](_0x55e3bf,_0x248708,!![]);}catch(_0x48bf0e){return BPromise['reject'](_0x48bf0e);}return _0x55e3bf[_0xe230('0x1e')]();};}function saveUpdates(_0x487a94,_0x4f618d){return function(_0x3bcaa9){if(_0x3bcaa9){return _0x3bcaa9[_0xe230('0x1f')](_0x487a94)[_0xe230('0x20')](function(_0x53b8cf){return _0x53b8cf;});}return null;};}function removeEntity(_0x2d3f13,_0x49c2ee){return function(_0x48922f){if(_0x48922f){return _0x48922f[_0xe230('0x21')]()[_0xe230('0x20')](function(){_0x2d3f13[_0xe230('0x17')](0xcc)[_0xe230('0x22')]();});}};}function handleEntityNotFound(_0x2160a8,_0x74a757){return function(_0x28c359){if(!_0x28c359){_0x2160a8['sendStatus'](0x194);}return _0x28c359;};}function handleError(_0x7b3911,_0xb7dd02){_0xb7dd02=_0xb7dd02||0x1f4;return function(_0x29ee9c){logger['error'](_0x29ee9c[_0xe230('0x23')]);if(_0x29ee9c[_0xe230('0x24')]){delete _0x29ee9c[_0xe230('0x24')];}_0x7b3911[_0xe230('0x17')](_0xb7dd02)[_0xe230('0x25')](_0x29ee9c);};}function getMustacheRender(_0x23b8e3,_0x5989a6){return Mustache['render'](_0x23b8e3,_[_0xe230('0x26')](_0x5989a6[_0xe230('0x27')],{'contact':_0x5989a6['contact'],'message':_0x5989a6[_0xe230('0x28')],'agent':_0x5989a6[_0xe230('0x29')],'interaction':_0x5989a6[_0xe230('0x2a')],'account':_0x5989a6['account']}))||'';}exports[_0xe230('0x2b')]=function(_0x23adf7,_0x25c5a2){var _0x4935c4={},_0x3f658e={},_0x56f444={'count':0x0,'rows':[]};var _0x5bfe94=_[_0xe230('0x2c')](db[_0xe230('0x2d')][_0xe230('0x2e')],function(_0xd5036){return{'name':_0xd5036[_0xe230('0x2f')],'type':_0xd5036[_0xe230('0x30')][_0xe230('0x31')]};});_0x3f658e['model']=_[_0xe230('0x2c')](_0x5bfe94,_0xe230('0x24'));_0x3f658e[_0xe230('0x32')]=_['keys'](_0x23adf7['query']);_0x3f658e[_0xe230('0x33')]=_[_0xe230('0x34')](_0x3f658e['model'],_0x3f658e[_0xe230('0x32')]);_0x4935c4[_0xe230('0x35')]=_[_0xe230('0x34')](_0x3f658e[_0xe230('0x36')],qs[_0xe230('0x37')](_0x23adf7[_0xe230('0x32')]['fields']));_0x4935c4['attributes']=_0x4935c4[_0xe230('0x35')][_0xe230('0x38')]?_0x4935c4[_0xe230('0x35')]:_0x3f658e['model'];if(!_0x23adf7['query'][_0xe230('0x39')](_0xe230('0x3a'))){_0x4935c4['limit']=qs[_0xe230('0x19')](_0x23adf7[_0xe230('0x32')][_0xe230('0x19')]);_0x4935c4[_0xe230('0x18')]=qs['offset'](_0x23adf7[_0xe230('0x32')][_0xe230('0x18')]);}_0x4935c4[_0xe230('0x3b')]=qs[_0xe230('0x3c')](_0x23adf7[_0xe230('0x32')][_0xe230('0x3c')]);_0x4935c4[_0xe230('0x3d')]=qs['filters'](_['pick'](_0x23adf7[_0xe230('0x32')],_0x3f658e['filters']),_0x5bfe94);if(_0x23adf7[_0xe230('0x32')][_0xe230('0x3e')]){_0x4935c4[_0xe230('0x3d')]=_[_0xe230('0x26')](_0x4935c4[_0xe230('0x3d')],{'$or':_['map'](_0x5bfe94,function(_0x5a7d2c){if(_0x5a7d2c[_0xe230('0x30')]!=='VIRTUAL'){var _0x5f0e88={};_0x5f0e88[_0x5a7d2c[_0xe230('0x24')]]={'$like':'%'+_0x23adf7[_0xe230('0x32')][_0xe230('0x3e')]+'%'};return _0x5f0e88;}})});}_0x4935c4=_[_0xe230('0x26')]({},_0x4935c4,_0x23adf7[_0xe230('0x3f')]);var _0xc912cb={'where':_0x4935c4[_0xe230('0x3d')]};return db['AnalyticFieldReport'][_0xe230('0x1b')](_0xc912cb)[_0xe230('0x20')](function(_0xe94841){_0x56f444[_0xe230('0x1b')]=_0xe94841;if(_0x23adf7[_0xe230('0x32')][_0xe230('0x40')]){_0x4935c4[_0xe230('0x41')]=[{'all':!![]}];}return db[_0xe230('0x2d')]['findAll'](_0x4935c4);})[_0xe230('0x20')](function(_0x2cf70d){_0x56f444['rows']=_0x2cf70d;return _0x56f444;})[_0xe230('0x20')](respondWithFilteredResult(_0x25c5a2,_0x4935c4))[_0xe230('0x42')](handleError(_0x25c5a2,null));};exports[_0xe230('0x43')]=function(_0x3b5f87,_0x1b513d){var _0x5a5fff={'raw':![],'where':{'id':_0x3b5f87[_0xe230('0x44')]['id']}},_0x3e9f58={};_0x3e9f58[_0xe230('0x36')]=_[_0xe230('0x45')](db['AnalyticFieldReport'][_0xe230('0x2e')]);_0x3e9f58[_0xe230('0x32')]=_[_0xe230('0x45')](_0x3b5f87[_0xe230('0x32')]);_0x3e9f58[_0xe230('0x33')]=_[_0xe230('0x34')](_0x3e9f58[_0xe230('0x36')],_0x3e9f58['query']);_0x5a5fff[_0xe230('0x35')]=_[_0xe230('0x34')](_0x3e9f58['model'],qs['fields'](_0x3b5f87[_0xe230('0x32')][_0xe230('0x37')]));_0x5a5fff[_0xe230('0x35')]=_0x5a5fff[_0xe230('0x35')][_0xe230('0x38')]?_0x5a5fff[_0xe230('0x35')]:_0x3e9f58[_0xe230('0x36')];if(_0x3b5f87['query'][_0xe230('0x40')]){_0x5a5fff[_0xe230('0x41')]=[{'all':!![]}];}_0x5a5fff=_[_0xe230('0x26')]({},_0x5a5fff,_0x3b5f87[_0xe230('0x3f')]);return db[_0xe230('0x2d')][_0xe230('0x46')](_0x5a5fff)[_0xe230('0x20')](handleEntityNotFound(_0x1b513d,null))[_0xe230('0x20')](respondWithResult(_0x1b513d,null))[_0xe230('0x42')](handleError(_0x1b513d,null));};exports[_0xe230('0x47')]=function(_0x5024d2,_0x5680d9){return db['AnalyticFieldReport'][_0xe230('0x47')](_0x5024d2[_0xe230('0x27')],{})[_0xe230('0x20')](respondWithResult(_0x5680d9,0xc9))[_0xe230('0x42')](handleError(_0x5680d9,null));};exports['bulkCreate']=function(_0x367f19,_0x31eca5){return db[_0xe230('0x2d')][_0xe230('0x48')](_0x367f19[_0xe230('0x27')],{'raw':![],'individualHooks':!![]})[_0xe230('0x20')](respondWithResult(_0x31eca5,0xc9))[_0xe230('0x42')](handleError(_0x31eca5,null));};exports[_0xe230('0x1f')]=function(_0x53094f,_0x869f81){if(_0x53094f['body']['id']){delete _0x53094f['body']['id'];}return db[_0xe230('0x2d')][_0xe230('0x46')]({'where':{'id':_0x53094f[_0xe230('0x44')]['id']}})[_0xe230('0x20')](handleEntityNotFound(_0x869f81,null))[_0xe230('0x20')](saveUpdates(_0x53094f['body'],null))[_0xe230('0x20')](respondWithResult(_0x869f81,null))[_0xe230('0x42')](handleError(_0x869f81,null));};exports[_0xe230('0x21')]=function(_0x48b122,_0x86eeba){return db[_0xe230('0x2d')][_0xe230('0x46')]({'where':{'id':_0x48b122[_0xe230('0x44')]['id']}})[_0xe230('0x20')](handleEntityNotFound(_0x86eeba,null))['then'](removeEntity(_0x86eeba,null))['catch'](handleError(_0x86eeba,null));};exports[_0xe230('0x49')]=function(_0x4b1147,_0x5cc75c){return db[_0xe230('0x2d')][_0xe230('0x21')]({'where':{'id':_0x4b1147[_0xe230('0x32')][_0xe230('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0xe230('0x20')](respondWithResult(_0x5cc75c,0xcc))[_0xe230('0x42')](handleError(_0x5cc75c,null));};exports[_0xe230('0x4b')]=function(_0xef18e5,_0x21f57f,_0xd29ba4){return db[_0xe230('0x4c')][_0xe230('0x4d')]({'where':{'id':_0xef18e5[_0xe230('0x44')]['id']}})['then'](handleEntityNotFound(_0x21f57f,null))['then'](function(_0x3ec6c0){if(_0x3ec6c0){return db[_0xe230('0x4e')][_0xe230('0x4f')](function(_0x4777f8){return db[_0xe230('0x2d')][_0xe230('0x21')]({'where':{'CustomReportId':_0xef18e5[_0xe230('0x44')]['id']},'transaction':_0x4777f8})['then'](function(_0x38020d){var _0x43177e=_[_0xe230('0x2c')](_0xef18e5[_0xe230('0x27')],function(_0x5a190b){delete _0x5a190b['id'];_0x5a190b[_0xe230('0x50')]=_0xef18e5[_0xe230('0x44')]['id'];return _0x5a190b;});return db[_0xe230('0x2d')][_0xe230('0x48')](_0x43177e,{'transaction':_0x4777f8});});})[_0xe230('0x20')](function(){return db[_0xe230('0x2d')][_0xe230('0x51')]({'where':{'CustomReportId':_0xef18e5['params']['id']}});});}})[_0xe230('0x20')](respondWithResult(_0x21f57f,null))[_0xe230('0x42')](handleError(_0x21f57f,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index f7030e5..0bb9abb 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 _0x399c=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports','define','lodash','util'];(function(_0x57c3ab,_0x353af9){var _0x5dba29=function(_0x2848f9){while(--_0x2848f9){_0x57c3ab['push'](_0x57c3ab['shift']());}};_0x5dba29(++_0x353af9);}(_0x399c,0x12a));var _0xc399=function(_0x42afde,_0x5f3b01){_0x42afde=_0x42afde-0x0;var _0x25980e=_0x399c[_0x42afde];return _0x25980e;};'use strict';var _=require(_0xc399('0x0'));var util=require(_0xc399('0x1'));var logger=require(_0xc399('0x2'))(_0xc399('0x3'));var moment=require(_0xc399('0x4'));var BPromise=require(_0xc399('0x5'));var rp=require(_0xc399('0x6'));var fs=require('fs');var path=require(_0xc399('0x7'));var rimraf=require('rimraf');var config=require(_0xc399('0x8'));var attributes=require(_0xc399('0x9'));module[_0xc399('0xa')]=function(_0x53bce9,_0x127c51){return _0x53bce9[_0xc399('0xb')]('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7e41=['../../config/logger','api','bluebird','request-promise','path','./analyticFieldReport.attributes','exports','analytics_report_fields','lodash','util'];(function(_0x545e41,_0x55830d){var _0x20ee17=function(_0xac9b17){while(--_0xac9b17){_0x545e41['push'](_0x545e41['shift']());}};_0x20ee17(++_0x55830d);}(_0x7e41,0x10c));var _0x17e4=function(_0xd0bce2,_0x251a3e){_0xd0bce2=_0xd0bce2-0x0;var _0x1bfed9=_0x7e41[_0xd0bce2];return _0x1bfed9;};'use strict';var _=require(_0x17e4('0x0'));var util=require(_0x17e4('0x1'));var logger=require(_0x17e4('0x2'))(_0x17e4('0x3'));var moment=require('moment');var BPromise=require(_0x17e4('0x4'));var rp=require(_0x17e4('0x5'));var fs=require('fs');var path=require(_0x17e4('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x17e4('0x7'));module[_0x17e4('0x8')]=function(_0x5a927e,_0x1fc364){return _0x5a927e['define']('AnalyticFieldReport',attributes,{'tableName':_0x17e4('0x9'),'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 4a0743b..042a9dc 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 _0x26af=['info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0x26af,0x1d8));var _0xf26a=function(_0x202d24,_0x5e8641){_0x202d24=_0x202d24-0x0;var _0x2b3a8e=_0x26af[_0x202d24];return _0x2b3a8e;};'use strict';var _=require(_0xf26a('0x0'));var util=require(_0xf26a('0x1'));var moment=require('moment');var BPromise=require(_0xf26a('0x2'));var rs=require(_0xf26a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf26a('0x4'))['db'];var utils=require(_0xf26a('0x5'));var logger=require('../../config/logger')(_0xf26a('0x6'));var config=require('../../config/environment');var jayson=require(_0xf26a('0x7'));var client=jayson[_0xf26a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4cf010,_0x2eb51b,_0x22eeea){return new BPromise(function(_0x26f417,_0x327ad1){return client[_0xf26a('0x9')](_0x4cf010,_0x22eeea)[_0xf26a('0xa')](function(_0x1fd9b6){logger[_0xf26a('0xb')](_0xf26a('0xc'),_0x2eb51b,_0xf26a('0xd'));logger[_0xf26a('0xe')](_0xf26a('0xf'),_0x2eb51b,'request\x20sent',JSON[_0xf26a('0x10')](_0x1fd9b6));if(_0x1fd9b6[_0xf26a('0x11')]){if(_0x1fd9b6[_0xf26a('0x11')][_0xf26a('0x12')]===0x1f4){logger['error'](_0xf26a('0xc'),_0x2eb51b,_0x1fd9b6['error'][_0xf26a('0x13')]);return _0x327ad1(_0x1fd9b6[_0xf26a('0x11')][_0xf26a('0x13')]);}logger[_0xf26a('0x11')](_0xf26a('0xc'),_0x2eb51b,_0x1fd9b6[_0xf26a('0x11')]['message']);return _0x26f417(_0x1fd9b6[_0xf26a('0x11')][_0xf26a('0x13')]);}else{logger[_0xf26a('0xb')](_0xf26a('0xc'),_0x2eb51b,_0xf26a('0xd'));_0x26f417(_0x1fd9b6['result'][_0xf26a('0x13')]);}})[_0xf26a('0x14')](function(_0x2bd0fa){logger[_0xf26a('0x11')](_0xf26a('0xc'),_0x2eb51b,_0x2bd0fa);_0x327ad1(_0x2bd0fa);});});}
\ No newline at end of file
+var _0x20a5=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x20a5,0x1ae));var _0x520a=function(_0x4afd36,_0x6de43d){_0x4afd36=_0x4afd36-0x0;var _0x3b7072=_0x20a5[_0x4afd36];return _0x3b7072;};'use strict';var _=require(_0x520a('0x0'));var util=require(_0x520a('0x1'));var moment=require(_0x520a('0x2'));var BPromise=require(_0x520a('0x3'));var rs=require(_0x520a('0x4'));var fs=require('fs');var Redis=require(_0x520a('0x5'));var db=require(_0x520a('0x6'))['db'];var utils=require(_0x520a('0x7'));var logger=require(_0x520a('0x8'))('rpc');var config=require(_0x520a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x520a('0xa')][_0x520a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32be6c,_0x41d247,_0x4b865b){return new BPromise(function(_0x2cd3d6,_0x1008df){return client['request'](_0x32be6c,_0x4b865b)[_0x520a('0xc')](function(_0x117b48){logger[_0x520a('0xd')](_0x520a('0xe'),_0x41d247,'request\x20sent');logger[_0x520a('0xf')](_0x520a('0x10'),_0x41d247,_0x520a('0x11'),JSON[_0x520a('0x12')](_0x117b48));if(_0x117b48[_0x520a('0x13')]){if(_0x117b48[_0x520a('0x13')][_0x520a('0x14')]===0x1f4){logger['error'](_0x520a('0xe'),_0x41d247,_0x117b48[_0x520a('0x13')][_0x520a('0x15')]);return _0x1008df(_0x117b48[_0x520a('0x13')][_0x520a('0x15')]);}logger[_0x520a('0x13')](_0x520a('0xe'),_0x41d247,_0x117b48[_0x520a('0x13')]['message']);return _0x2cd3d6(_0x117b48[_0x520a('0x13')][_0x520a('0x15')]);}else{logger[_0x520a('0xd')](_0x520a('0xe'),_0x41d247,_0x520a('0x11'));_0x2cd3d6(_0x117b48[_0x520a('0x16')][_0x520a('0x15')]);}})[_0x520a('0x17')](function(_0x1c622c){logger[_0x520a('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x41d247,_0x1c622c);_0x1008df(_0x1c622c);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 0fe3b04..cf68123 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 _0x7b44=['/create_many','bulkCreate','/:id/create_many','addFields','put','/:id','delete','/destroy_many','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','show','post','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7b44,0x14f));var _0x47b4=function(_0x452f50,_0x2734ff){_0x452f50=_0x452f50-0x0;var _0x451d69=_0x7b44[_0x452f50];return _0x451d69;};'use strict';var multer=require(_0x47b4('0x0'));var util=require(_0x47b4('0x1'));var path=require(_0x47b4('0x2'));var timeout=require('connect-timeout');var express=require(_0x47b4('0x3'));var router=express[_0x47b4('0x4')]();var fs_extra=require(_0x47b4('0x5'));var auth=require(_0x47b4('0x6'));var interaction=require(_0x47b4('0x7'));var config=require(_0x47b4('0x8'));var controller=require(_0x47b4('0x9'));router[_0x47b4('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x47b4('0xa')]('/:id',auth[_0x47b4('0xb')](),controller[_0x47b4('0xc')]);router[_0x47b4('0xd')]('/',auth[_0x47b4('0xb')](),controller[_0x47b4('0xe')]);router['post'](_0x47b4('0xf'),auth['isAuthenticated'](),controller[_0x47b4('0x10')]);router[_0x47b4('0xd')](_0x47b4('0x11'),auth[_0x47b4('0xb')](),controller[_0x47b4('0x12')]);router[_0x47b4('0x13')](_0x47b4('0x14'),auth['isAuthenticated'](),controller['update']);router[_0x47b4('0x15')](_0x47b4('0x16'),auth[_0x47b4('0xb')](),controller['bulkDestroy']);router[_0x47b4('0x15')](_0x47b4('0x14'),auth[_0x47b4('0xb')](),controller[_0x47b4('0x17')]);module[_0x47b4('0x18')]=router;
\ No newline at end of file
+var _0x6b4d=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','post','create','/create_many','bulkCreate','/:id/create_many','put','update'];(function(_0x5926c4,_0x404826){var _0x337b23=function(_0x4eb36f){while(--_0x4eb36f){_0x5926c4['push'](_0x5926c4['shift']());}};_0x337b23(++_0x404826);}(_0x6b4d,0x1e8));var _0xd6b4=function(_0x550cce,_0x5aba5d){_0x550cce=_0x550cce-0x0;var _0x222211=_0x6b4d[_0x550cce];return _0x222211;};'use strict';var multer=require(_0xd6b4('0x0'));var util=require(_0xd6b4('0x1'));var path=require(_0xd6b4('0x2'));var timeout=require(_0xd6b4('0x3'));var express=require('express');var router=express[_0xd6b4('0x4')]();var fs_extra=require(_0xd6b4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd6b4('0x6'));var controller=require('./analyticFieldReport.controller');router[_0xd6b4('0x7')]('/',auth[_0xd6b4('0x8')](),controller[_0xd6b4('0x9')]);router[_0xd6b4('0x7')](_0xd6b4('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xd6b4('0xb')]('/',auth[_0xd6b4('0x8')](),controller[_0xd6b4('0xc')]);router[_0xd6b4('0xb')](_0xd6b4('0xd'),auth[_0xd6b4('0x8')](),controller[_0xd6b4('0xe')]);router['post'](_0xd6b4('0xf'),auth[_0xd6b4('0x8')](),controller['addFields']);router[_0xd6b4('0x10')](_0xd6b4('0xa'),auth[_0xd6b4('0x8')](),controller[_0xd6b4('0x11')]);router[_0xd6b4('0x12')](_0xd6b4('0x13'),auth['isAuthenticated'](),controller[_0xd6b4('0x14')]);router['delete'](_0xd6b4('0xa'),auth['isAuthenticated'](),controller[_0xd6b4('0x15')]);module[_0xd6b4('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js
index 77fbdf5..b5079a0 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 _0xbc4a=['sequelize','exports','STRING'];(function(_0x92ab1,_0x5d2b6a){var _0x426f4a=function(_0x37d264){while(--_0x37d264){_0x92ab1['push'](_0x92ab1['shift']());}};_0x426f4a(++_0x5d2b6a);}(_0xbc4a,0x1dd));var _0xabc4=function(_0x558841,_0x5cdb84){_0x558841=_0x558841-0x0;var _0x39b015=_0xbc4a[_0x558841];return _0x39b015;};'use strict';var Sequelize=require(_0xabc4('0x0'));module[_0xabc4('0x1')]={'name':{'type':Sequelize[_0xabc4('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6b72=['TEXT','sequelize','STRING','name'];(function(_0xb65e77,_0x238c3d){var _0x38134b=function(_0x39da21){while(--_0x39da21){_0xb65e77['push'](_0xb65e77['shift']());}};_0x38134b(++_0x238c3d);}(_0x6b72,0x19d));var _0x26b7=function(_0x1c9d25,_0x52c419){_0x1c9d25=_0x1c9d25-0x0;var _0x93af2d=_0x6b72[_0x1c9d25];return _0x93af2d;};'use strict';var Sequelize=require(_0x26b7('0x0'));module['exports']={'name':{'type':Sequelize[_0x26b7('0x1')],'allowNull':![],'unique':_0x26b7('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x26b7('0x3')]},'description':{'type':Sequelize[_0x26b7('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index dc5b622..f033e83 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 _0x0962=['Metrics','UserProfileResource','end','error','name','send','render','merge','contact','message','interaction','account','index','map','AnalyticMetric','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','filter','where','type','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','length','options','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get'];(function(_0x46f0bd,_0x1f042f){var _0x57b5ea=function(_0x4d030a){while(--_0x4d030a){_0x46f0bd['push'](_0x46f0bd['shift']());}};_0x57b5ea(++_0x1f042f);}(_0x0962,0x198));var _0x2096=function(_0x48c98c,_0x3b6f60){_0x48c98c=_0x48c98c-0x0;var _0x4eb693=_0x0962[_0x48c98c];return _0x4eb693;};'use strict';var emlformat=require(_0x2096('0x0'));var rimraf=require(_0x2096('0x1'));var zipdir=require(_0x2096('0x2'));var jsonpatch=require(_0x2096('0x3'));var rp=require('request-promise');var moment=require(_0x2096('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2096('0x5'));var path=require(_0x2096('0x6'));var sox=require(_0x2096('0x7'));var csv=require(_0x2096('0x8'));var ejs=require(_0x2096('0x9'));var fs=require('fs');var fs_extra=require(_0x2096('0xa'));var _=require(_0x2096('0xb'));var squel=require(_0x2096('0xc'));var crypto=require('crypto');var jsforce=require(_0x2096('0xd'));var deskjs=require(_0x2096('0xe'));var toCsv=require(_0x2096('0x8'));var querystring=require(_0x2096('0xf'));var Papa=require(_0x2096('0x10'));var Redis=require(_0x2096('0x11'));var authService=require(_0x2096('0x12'));var qs=require(_0x2096('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2096('0x14'));var logger=require(_0x2096('0x15'))('api');var utils=require(_0x2096('0x16'));var config=require(_0x2096('0x17'));var licenseUtil=require(_0x2096('0x18'));var db=require(_0x2096('0x19'))['db'];function respondWithStatusCode(_0x5d351e,_0x541213){_0x541213=_0x541213||0xcc;return function(_0x404e2b){if(_0x404e2b){return _0x5d351e[_0x2096('0x1a')](_0x541213);}return _0x5d351e[_0x2096('0x1b')](_0x541213)['end']();};}function respondWithResult(_0x14bf54,_0x45b7ec){_0x45b7ec=_0x45b7ec||0xc8;return function(_0x420c57){if(_0x420c57){return _0x14bf54['status'](_0x45b7ec)[_0x2096('0x1c')](_0x420c57);}};}function respondWithFilteredResult(_0x37dcd0,_0x2c6e88){return function(_0x305ada){if(_0x305ada){var _0x5b151a=typeof _0x2c6e88[_0x2096('0x1d')]===_0x2096('0x1e')&&typeof _0x2c6e88[_0x2096('0x1f')]==='undefined';var _0x479ba2=_0x305ada[_0x2096('0x20')];var _0x22c478=_0x5b151a?0x0:_0x2c6e88['offset'];var _0xd7e9e0=_0x5b151a?_0x305ada[_0x2096('0x20')]:_0x2c6e88[_0x2096('0x1d')]+_0x2c6e88['limit'];var _0x2a9f62;if(_0xd7e9e0>=_0x479ba2){_0xd7e9e0=_0x479ba2;_0x2a9f62=0xc8;}else{_0x2a9f62=0xce;}_0x37dcd0['status'](_0x2a9f62);return _0x37dcd0[_0x2096('0x21')](_0x2096('0x22'),_0x22c478+'-'+_0xd7e9e0+'/'+_0x479ba2)[_0x2096('0x1c')](_0x305ada);}return null;};}function patchUpdates(_0x12fe63){return function(_0x3f4d7d){try{jsonpatch[_0x2096('0x23')](_0x3f4d7d,_0x12fe63,!![]);}catch(_0x2125ad){return BPromise[_0x2096('0x24')](_0x2125ad);}return _0x3f4d7d[_0x2096('0x25')]();};}function saveUpdates(_0x58c61c,_0x40f28c){return function(_0x4b74e2){if(_0x4b74e2){return _0x4b74e2[_0x2096('0x26')](_0x58c61c)['then'](function(_0x5dfdd5){return _0x5dfdd5;});}return null;};}function removeEntity(_0x362414,_0x686f15){return function(_0x3c3d9c){if(_0x3c3d9c){return _0x3c3d9c[_0x2096('0x27')]()[_0x2096('0x28')](function(){var _0x2b7866=_0x3c3d9c[_0x2096('0x29')]({'plain':!![]});var _0xe72b8a=_0x2096('0x2a');return db[_0x2096('0x2b')][_0x2096('0x27')]({'where':{'type':_0xe72b8a,'resourceId':_0x2b7866['id']}})[_0x2096('0x28')](function(){return _0x3c3d9c;});})['then'](function(){_0x362414['status'](0xcc)[_0x2096('0x2c')]();});}};}function handleEntityNotFound(_0x1119a1,_0x224362){return function(_0x35f1c3){if(!_0x35f1c3){_0x1119a1[_0x2096('0x1a')](0x194);}return _0x35f1c3;};}function handleError(_0xeec1a7,_0x1a8df7){_0x1a8df7=_0x1a8df7||0x1f4;return function(_0x1e980c){logger[_0x2096('0x2d')](_0x1e980c['stack']);if(_0x1e980c[_0x2096('0x2e')]){delete _0x1e980c[_0x2096('0x2e')];}_0xeec1a7[_0x2096('0x1b')](_0x1a8df7)[_0x2096('0x2f')](_0x1e980c);};}function getMustacheRender(_0x2402d5,_0x2464a0){return Mustache[_0x2096('0x30')](_0x2402d5,_[_0x2096('0x31')](_0x2464a0['body'],{'contact':_0x2464a0[_0x2096('0x32')],'message':_0x2464a0[_0x2096('0x33')],'agent':_0x2464a0['agent'],'interaction':_0x2464a0[_0x2096('0x34')],'account':_0x2464a0[_0x2096('0x35')]}))||'';}exports[_0x2096('0x36')]=function(_0x3cc62f,_0x8ab4ab){var _0x315a35={},_0xd584c4={},_0x43b756={'count':0x0,'rows':[]};var _0x570316=_[_0x2096('0x37')](db[_0x2096('0x38')]['rawAttributes'],function(_0x6abbfe){return{'name':_0x6abbfe['fieldName'],'type':_0x6abbfe['type'][_0x2096('0x39')]};});_0xd584c4[_0x2096('0x3a')]=_[_0x2096('0x37')](_0x570316,_0x2096('0x2e'));_0xd584c4['query']=_['keys'](_0x3cc62f[_0x2096('0x3b')]);_0xd584c4[_0x2096('0x3c')]=_[_0x2096('0x3d')](_0xd584c4[_0x2096('0x3a')],_0xd584c4['query']);_0x315a35['attributes']=_[_0x2096('0x3d')](_0xd584c4[_0x2096('0x3a')],qs['fields'](_0x3cc62f[_0x2096('0x3b')][_0x2096('0x3e')]));_0x315a35['attributes']=_0x315a35[_0x2096('0x3f')]['length']?_0x315a35['attributes']:_0xd584c4[_0x2096('0x3a')];if(!_0x3cc62f['query'][_0x2096('0x40')]('nolimit')){_0x315a35[_0x2096('0x1f')]=qs[_0x2096('0x1f')](_0x3cc62f[_0x2096('0x3b')][_0x2096('0x1f')]);_0x315a35[_0x2096('0x1d')]=qs[_0x2096('0x1d')](_0x3cc62f[_0x2096('0x3b')][_0x2096('0x1d')]);}_0x315a35[_0x2096('0x41')]=qs[_0x2096('0x42')](_0x3cc62f[_0x2096('0x3b')][_0x2096('0x42')]);_0x315a35['where']=qs[_0x2096('0x3c')](_['pick'](_0x3cc62f[_0x2096('0x3b')],_0xd584c4[_0x2096('0x3c')]),_0x570316);if(_0x3cc62f[_0x2096('0x3b')][_0x2096('0x43')]){_0x315a35[_0x2096('0x44')]=_[_0x2096('0x31')](_0x315a35[_0x2096('0x44')],{'$or':_[_0x2096('0x37')](_0x570316,function(_0xfbdff7){if(_0xfbdff7[_0x2096('0x45')]!==_0x2096('0x46')){var _0x5f3fc8={};_0x5f3fc8[_0xfbdff7[_0x2096('0x2e')]]={'$like':'%'+_0x3cc62f['query'][_0x2096('0x43')]+'%'};return _0x5f3fc8;}})});}_0x315a35=_[_0x2096('0x31')]({},_0x315a35,_0x3cc62f['options']);var _0x492116={'where':_0x315a35[_0x2096('0x44')]};return db[_0x2096('0x38')]['count'](_0x492116)[_0x2096('0x28')](function(_0x2e757d){_0x43b756[_0x2096('0x20')]=_0x2e757d;if(_0x3cc62f[_0x2096('0x3b')][_0x2096('0x47')]){_0x315a35[_0x2096('0x48')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x2096('0x49')](_0x315a35);})[_0x2096('0x28')](function(_0x34ff3){_0x43b756['rows']=_0x34ff3;return _0x43b756;})[_0x2096('0x28')](respondWithFilteredResult(_0x8ab4ab,_0x315a35))[_0x2096('0x4a')](handleError(_0x8ab4ab,null));};exports[_0x2096('0x4b')]=function(_0x5f5214,_0x2f0bf5){var _0x322a77={'raw':!![],'where':{'id':_0x5f5214[_0x2096('0x4c')]['id']}},_0x56a236={};_0x56a236[_0x2096('0x3a')]=_[_0x2096('0x4d')](db[_0x2096('0x38')]['rawAttributes']);_0x56a236['query']=_[_0x2096('0x4d')](_0x5f5214['query']);_0x56a236['filters']=_['intersection'](_0x56a236[_0x2096('0x3a')],_0x56a236[_0x2096('0x3b')]);_0x322a77[_0x2096('0x3f')]=_[_0x2096('0x3d')](_0x56a236['model'],qs['fields'](_0x5f5214[_0x2096('0x3b')][_0x2096('0x3e')]));_0x322a77[_0x2096('0x3f')]=_0x322a77[_0x2096('0x3f')][_0x2096('0x4e')]?_0x322a77[_0x2096('0x3f')]:_0x56a236['model'];if(_0x5f5214['query'][_0x2096('0x47')]){_0x322a77[_0x2096('0x48')]=[{'all':!![]}];}_0x322a77=_[_0x2096('0x31')]({},_0x322a77,_0x5f5214[_0x2096('0x4f')]);return db[_0x2096('0x38')]['find'](_0x322a77)['then'](handleEntityNotFound(_0x2f0bf5,null))[_0x2096('0x28')](respondWithResult(_0x2f0bf5,null))[_0x2096('0x4a')](handleError(_0x2f0bf5,null));};exports['create']=function(_0x3a93b6,_0x3aad69){return db[_0x2096('0x38')]['create'](_0x3a93b6['body'],{})['then'](function(_0x9b0989){var _0x42d1c2=_0x3a93b6[_0x2096('0x50')][_0x2096('0x29')]({'plain':!![]});if(!_0x42d1c2)throw new Error(_0x2096('0x51'));if(_0x42d1c2[_0x2096('0x52')]==='user'){var _0x2aff64=_0x9b0989[_0x2096('0x29')]({'plain':!![]});var _0x5f0b7d='Metrics';return db[_0x2096('0x53')][_0x2096('0x54')]({'where':{'name':_0x5f0b7d,'userProfileId':_0x42d1c2[_0x2096('0x55')]},'raw':!![]})[_0x2096('0x28')](function(_0x46e66b){if(_0x46e66b&&_0x46e66b[_0x2096('0x56')]===0x0){return db[_0x2096('0x2b')][_0x2096('0x57')]({'name':_0x2aff64[_0x2096('0x2e')],'resourceId':_0x2aff64['id'],'type':_0x46e66b[_0x2096('0x2e')],'sectionId':_0x46e66b['id']},{})['then'](function(){return _0x9b0989;});}else{return _0x9b0989;}})[_0x2096('0x4a')](function(_0x2d1f95){logger[_0x2096('0x2d')](_0x2096('0x58'),_0x2d1f95);throw _0x2d1f95;});}return _0x9b0989;})[_0x2096('0x28')](respondWithResult(_0x3aad69,0xc9))['catch'](handleError(_0x3aad69,null));};exports['update']=function(_0x51eacd,_0x48ec17){if(_0x51eacd['body']['id']){delete _0x51eacd[_0x2096('0x59')]['id'];}return db[_0x2096('0x38')][_0x2096('0x54')]({'where':{'id':_0x51eacd[_0x2096('0x4c')]['id']}})[_0x2096('0x28')](handleEntityNotFound(_0x48ec17,null))[_0x2096('0x28')](saveUpdates(_0x51eacd[_0x2096('0x59')],null))[_0x2096('0x28')](respondWithResult(_0x48ec17,null))[_0x2096('0x4a')](handleError(_0x48ec17,null));};exports[_0x2096('0x27')]=function(_0x554fcd,_0x16822f){return db[_0x2096('0x38')][_0x2096('0x54')]({'where':{'id':_0x554fcd[_0x2096('0x4c')]['id']}})[_0x2096('0x28')](handleEntityNotFound(_0x16822f,null))['then'](removeEntity(_0x16822f,null))[_0x2096('0x4a')](handleError(_0x16822f,null));};
\ No newline at end of file
+var _0x495e=['bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','merge','body','contact','message','interaction','account','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','findAll','catch','params','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','moment'];(function(_0x5a2b54,_0x385211){var _0x4dfce6=function(_0xdddaef){while(--_0xdddaef){_0x5a2b54['push'](_0x5a2b54['shift']());}};_0x4dfce6(++_0x385211);}(_0x495e,0xfb));var _0xe495=function(_0x25bca6,_0xe415ea){_0x25bca6=_0x25bca6-0x0;var _0x3f8d02=_0x495e[_0x25bca6];return _0x3f8d02;};'use strict';var emlformat=require(_0xe495('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe495('0x1'));var rp=require(_0xe495('0x2'));var moment=require(_0xe495('0x3'));var BPromise=require(_0xe495('0x4'));var Mustache=require('mustache');var util=require(_0xe495('0x5'));var path=require(_0xe495('0x6'));var sox=require(_0xe495('0x7'));var csv=require(_0xe495('0x8'));var ejs=require(_0xe495('0x9'));var fs=require('fs');var fs_extra=require(_0xe495('0xa'));var _=require(_0xe495('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe495('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe495('0xd'));var Papa=require(_0xe495('0xe'));var Redis=require(_0xe495('0xf'));var authService=require(_0xe495('0x10'));var qs=require(_0xe495('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe495('0x12'));var logger=require(_0xe495('0x13'))(_0xe495('0x14'));var utils=require('../../config/utils');var config=require(_0xe495('0x15'));var licenseUtil=require(_0xe495('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51c2d4,_0x1d73a5){_0x1d73a5=_0x1d73a5||0xcc;return function(_0x13aedb){if(_0x13aedb){return _0x51c2d4['sendStatus'](_0x1d73a5);}return _0x51c2d4[_0xe495('0x17')](_0x1d73a5)[_0xe495('0x18')]();};}function respondWithResult(_0xab9c10,_0x14744d){_0x14744d=_0x14744d||0xc8;return function(_0x2b5e19){if(_0x2b5e19){return _0xab9c10['status'](_0x14744d)[_0xe495('0x19')](_0x2b5e19);}};}function respondWithFilteredResult(_0x103c25,_0x19d096){return function(_0x1c2d78){if(_0x1c2d78){var _0x1ea256=typeof _0x19d096['offset']==='undefined'&&typeof _0x19d096['limit']===_0xe495('0x1a');var _0x142978=_0x1c2d78[_0xe495('0x1b')];var _0x577fb7=_0x1ea256?0x0:_0x19d096[_0xe495('0x1c')];var _0x302ca0=_0x1ea256?_0x1c2d78[_0xe495('0x1b')]:_0x19d096[_0xe495('0x1c')]+_0x19d096[_0xe495('0x1d')];var _0x525953;if(_0x302ca0>=_0x142978){_0x302ca0=_0x142978;_0x525953=0xc8;}else{_0x525953=0xce;}_0x103c25['status'](_0x525953);return _0x103c25[_0xe495('0x1e')](_0xe495('0x1f'),_0x577fb7+'-'+_0x302ca0+'/'+_0x142978)[_0xe495('0x19')](_0x1c2d78);}return null;};}function patchUpdates(_0x169bd2){return function(_0x5d5d35){try{jsonpatch[_0xe495('0x20')](_0x5d5d35,_0x169bd2,!![]);}catch(_0x46ec15){return BPromise[_0xe495('0x21')](_0x46ec15);}return _0x5d5d35['save']();};}function saveUpdates(_0xa0c9bc,_0x17d13f){return function(_0x475a7e){if(_0x475a7e){return _0x475a7e[_0xe495('0x22')](_0xa0c9bc)[_0xe495('0x23')](function(_0x4840fa){return _0x4840fa;});}return null;};}function removeEntity(_0x33f19,_0x4d836b){return function(_0x181ead){if(_0x181ead){return _0x181ead[_0xe495('0x24')]()[_0xe495('0x23')](function(){var _0x5d095f=_0x181ead[_0xe495('0x25')]({'plain':!![]});var _0x2a6fd6=_0xe495('0x26');return db[_0xe495('0x27')][_0xe495('0x24')]({'where':{'type':_0x2a6fd6,'resourceId':_0x5d095f['id']}})[_0xe495('0x23')](function(){return _0x181ead;});})[_0xe495('0x23')](function(){_0x33f19['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2506f7,_0x5db642){return function(_0x1651d4){if(!_0x1651d4){_0x2506f7[_0xe495('0x28')](0x194);}return _0x1651d4;};}function handleError(_0x598108,_0x4e3a4d){_0x4e3a4d=_0x4e3a4d||0x1f4;return function(_0xd6585c){logger[_0xe495('0x29')](_0xd6585c[_0xe495('0x2a')]);if(_0xd6585c[_0xe495('0x2b')]){delete _0xd6585c[_0xe495('0x2b')];}_0x598108[_0xe495('0x17')](_0x4e3a4d)[_0xe495('0x2c')](_0xd6585c);};}function getMustacheRender(_0x8bff82,_0x535d23){return Mustache['render'](_0x8bff82,_[_0xe495('0x2d')](_0x535d23[_0xe495('0x2e')],{'contact':_0x535d23[_0xe495('0x2f')],'message':_0x535d23[_0xe495('0x30')],'agent':_0x535d23['agent'],'interaction':_0x535d23[_0xe495('0x31')],'account':_0x535d23[_0xe495('0x32')]}))||'';}exports[_0xe495('0x33')]=function(_0xba78e9,_0xc238a){var _0x15fbcd={},_0x2ffb33={},_0x391b31={'count':0x0,'rows':[]};var _0x447aef=_[_0xe495('0x34')](db[_0xe495('0x35')][_0xe495('0x36')],function(_0x31b515){return{'name':_0x31b515[_0xe495('0x37')],'type':_0x31b515[_0xe495('0x38')]['key']};});_0x2ffb33[_0xe495('0x39')]=_[_0xe495('0x34')](_0x447aef,'name');_0x2ffb33[_0xe495('0x3a')]=_[_0xe495('0x3b')](_0xba78e9['query']);_0x2ffb33['filters']=_[_0xe495('0x3c')](_0x2ffb33[_0xe495('0x39')],_0x2ffb33[_0xe495('0x3a')]);_0x15fbcd[_0xe495('0x3d')]=_['intersection'](_0x2ffb33[_0xe495('0x39')],qs[_0xe495('0x3e')](_0xba78e9[_0xe495('0x3a')]['fields']));_0x15fbcd['attributes']=_0x15fbcd[_0xe495('0x3d')]['length']?_0x15fbcd[_0xe495('0x3d')]:_0x2ffb33[_0xe495('0x39')];if(!_0xba78e9['query']['hasOwnProperty'](_0xe495('0x3f'))){_0x15fbcd[_0xe495('0x1d')]=qs[_0xe495('0x1d')](_0xba78e9[_0xe495('0x3a')][_0xe495('0x1d')]);_0x15fbcd[_0xe495('0x1c')]=qs[_0xe495('0x1c')](_0xba78e9[_0xe495('0x3a')][_0xe495('0x1c')]);}_0x15fbcd[_0xe495('0x40')]=qs[_0xe495('0x41')](_0xba78e9[_0xe495('0x3a')]['sort']);_0x15fbcd[_0xe495('0x42')]=qs[_0xe495('0x43')](_[_0xe495('0x44')](_0xba78e9[_0xe495('0x3a')],_0x2ffb33['filters']),_0x447aef);if(_0xba78e9[_0xe495('0x3a')][_0xe495('0x45')]){_0x15fbcd['where']=_['merge'](_0x15fbcd['where'],{'$or':_[_0xe495('0x34')](_0x447aef,function(_0xa0dcf0){if(_0xa0dcf0[_0xe495('0x38')]!==_0xe495('0x46')){var _0x77c1c7={};_0x77c1c7[_0xa0dcf0[_0xe495('0x2b')]]={'$like':'%'+_0xba78e9['query'][_0xe495('0x45')]+'%'};return _0x77c1c7;}})});}_0x15fbcd=_[_0xe495('0x2d')]({},_0x15fbcd,_0xba78e9[_0xe495('0x47')]);var _0xe7f3f3={'where':_0x15fbcd[_0xe495('0x42')]};return db[_0xe495('0x35')][_0xe495('0x1b')](_0xe7f3f3)[_0xe495('0x23')](function(_0x30ebf4){_0x391b31['count']=_0x30ebf4;if(_0xba78e9['query'][_0xe495('0x48')]){_0x15fbcd['include']=[{'all':!![]}];}return db[_0xe495('0x35')][_0xe495('0x49')](_0x15fbcd);})['then'](function(_0x35aaef){_0x391b31['rows']=_0x35aaef;return _0x391b31;})['then'](respondWithFilteredResult(_0xc238a,_0x15fbcd))[_0xe495('0x4a')](handleError(_0xc238a,null));};exports['show']=function(_0x41518b,_0x4d7f59){var _0x40a8a8={'raw':!![],'where':{'id':_0x41518b[_0xe495('0x4b')]['id']}},_0x3f2add={};_0x3f2add[_0xe495('0x39')]=_[_0xe495('0x3b')](db[_0xe495('0x35')][_0xe495('0x36')]);_0x3f2add[_0xe495('0x3a')]=_[_0xe495('0x3b')](_0x41518b[_0xe495('0x3a')]);_0x3f2add['filters']=_[_0xe495('0x3c')](_0x3f2add['model'],_0x3f2add[_0xe495('0x3a')]);_0x40a8a8[_0xe495('0x3d')]=_[_0xe495('0x3c')](_0x3f2add[_0xe495('0x39')],qs['fields'](_0x41518b['query']['fields']));_0x40a8a8[_0xe495('0x3d')]=_0x40a8a8[_0xe495('0x3d')]['length']?_0x40a8a8[_0xe495('0x3d')]:_0x3f2add[_0xe495('0x39')];if(_0x41518b[_0xe495('0x3a')][_0xe495('0x48')]){_0x40a8a8[_0xe495('0x4c')]=[{'all':!![]}];}_0x40a8a8=_[_0xe495('0x2d')]({},_0x40a8a8,_0x41518b[_0xe495('0x47')]);return db['AnalyticMetric'][_0xe495('0x4d')](_0x40a8a8)[_0xe495('0x23')](handleEntityNotFound(_0x4d7f59,null))[_0xe495('0x23')](respondWithResult(_0x4d7f59,null))[_0xe495('0x4a')](handleError(_0x4d7f59,null));};exports[_0xe495('0x4e')]=function(_0x4c366e,_0x5a547f){return db[_0xe495('0x35')][_0xe495('0x4e')](_0x4c366e[_0xe495('0x2e')],{})['then'](function(_0x4b9b76){var _0x1a7d15=_0x4c366e['user'][_0xe495('0x25')]({'plain':!![]});if(!_0x1a7d15)throw new Error(_0xe495('0x4f'));if(_0x1a7d15['role']===_0xe495('0x50')){var _0x3e03a2=_0x4b9b76[_0xe495('0x25')]({'plain':!![]});var _0x45813c=_0xe495('0x26');return db[_0xe495('0x51')][_0xe495('0x4d')]({'where':{'name':_0x45813c,'userProfileId':_0x1a7d15[_0xe495('0x52')]},'raw':!![]})[_0xe495('0x23')](function(_0x42c7dc){if(_0x42c7dc&&_0x42c7dc[_0xe495('0x53')]===0x0){return db[_0xe495('0x27')]['create']({'name':_0x3e03a2[_0xe495('0x2b')],'resourceId':_0x3e03a2['id'],'type':_0x42c7dc[_0xe495('0x2b')],'sectionId':_0x42c7dc['id']},{})[_0xe495('0x23')](function(){return _0x4b9b76;});}else{return _0x4b9b76;}})[_0xe495('0x4a')](function(_0x910a24){logger[_0xe495('0x29')](_0xe495('0x54'),_0x910a24);throw _0x910a24;});}return _0x4b9b76;})[_0xe495('0x23')](respondWithResult(_0x5a547f,0xc9))[_0xe495('0x4a')](handleError(_0x5a547f,null));};exports[_0xe495('0x22')]=function(_0x588069,_0x573547){if(_0x588069[_0xe495('0x2e')]['id']){delete _0x588069[_0xe495('0x2e')]['id'];}return db['AnalyticMetric'][_0xe495('0x4d')]({'where':{'id':_0x588069[_0xe495('0x4b')]['id']}})[_0xe495('0x23')](handleEntityNotFound(_0x573547,null))[_0xe495('0x23')](saveUpdates(_0x588069['body'],null))[_0xe495('0x23')](respondWithResult(_0x573547,null))[_0xe495('0x4a')](handleError(_0x573547,null));};exports[_0xe495('0x24')]=function(_0x368566,_0x256e6e){return db[_0xe495('0x35')]['find']({'where':{'id':_0x368566[_0xe495('0x4b')]['id']}})['then'](handleEntityNotFound(_0x256e6e,null))[_0xe495('0x23')](removeEntity(_0x256e6e,null))['catch'](handleError(_0x256e6e,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 39fb0f5..ff254a5 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 _0x7086=['analytics_metrics','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','AnalyticMetric'];(function(_0x1484c4,_0x2d844b){var _0x598b70=function(_0x3245f9){while(--_0x3245f9){_0x1484c4['push'](_0x1484c4['shift']());}};_0x598b70(++_0x2d844b);}(_0x7086,0xa9));var _0x6708=function(_0x589fff,_0x121c4e){_0x589fff=_0x589fff-0x0;var _0x53cb48=_0x7086[_0x589fff];return _0x53cb48;};'use strict';var _=require(_0x6708('0x0'));var util=require('util');var logger=require(_0x6708('0x1'))(_0x6708('0x2'));var moment=require(_0x6708('0x3'));var BPromise=require('bluebird');var rp=require(_0x6708('0x4'));var fs=require('fs');var path=require(_0x6708('0x5'));var rimraf=require(_0x6708('0x6'));var config=require(_0x6708('0x7'));var attributes=require(_0x6708('0x8'));module[_0x6708('0x9')]=function(_0x5795e7,_0x41779e){return _0x5795e7['define'](_0x6708('0xa'),attributes,{'tableName':_0x6708('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x107a=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','AnalyticMetric','analytics_metrics','util','../../config/logger','api'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0x107a,0x14d));var _0xa107=function(_0x56fc30,_0xab0047){_0x56fc30=_0x56fc30-0x0;var _0xd549f0=_0x107a[_0x56fc30];return _0xd549f0;};'use strict';var _=require('lodash');var util=require(_0xa107('0x0'));var logger=require(_0xa107('0x1'))(_0xa107('0x2'));var moment=require('moment');var BPromise=require(_0xa107('0x3'));var rp=require(_0xa107('0x4'));var fs=require('fs');var path=require(_0xa107('0x5'));var rimraf=require(_0xa107('0x6'));var config=require(_0xa107('0x7'));var attributes=require(_0xa107('0x8'));module[_0xa107('0x9')]=function(_0x55c40a,_0x1f48ef){return _0x55c40a['define'](_0xa107('0xa'),attributes,{'tableName':_0xa107('0xb'),'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 3d2a5d2..5376311 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 _0xb1a1=['AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x337a10,_0x5191c7){var _0x575f98=function(_0x3851cd){while(--_0x3851cd){_0x337a10['push'](_0x337a10['shift']());}};_0x575f98(++_0x5191c7);}(_0xb1a1,0x12d));var _0x1b1a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb1a1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1b1a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1b1a('0x1'));var rs=require(_0x1b1a('0x2'));var fs=require('fs');var Redis=require(_0x1b1a('0x3'));var db=require(_0x1b1a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1b1a('0x5'));var config=require(_0x1b1a('0x6'));var jayson=require(_0x1b1a('0x7'));var client=jayson['client'][_0x1b1a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x517883,_0x3d7037,_0x7dd44f){return new BPromise(function(_0x5e11a9,_0x280120){return client[_0x1b1a('0x9')](_0x517883,_0x7dd44f)[_0x1b1a('0xa')](function(_0xa8a08e){logger['info'](_0x1b1a('0xb'),_0x3d7037,_0x1b1a('0xc'));logger[_0x1b1a('0xd')](_0x1b1a('0xe'),_0x3d7037,_0x1b1a('0xc'),JSON[_0x1b1a('0xf')](_0xa8a08e));if(_0xa8a08e[_0x1b1a('0x10')]){if(_0xa8a08e['error'][_0x1b1a('0x11')]===0x1f4){logger[_0x1b1a('0x10')](_0x1b1a('0xb'),_0x3d7037,_0xa8a08e[_0x1b1a('0x10')][_0x1b1a('0x12')]);return _0x280120(_0xa8a08e[_0x1b1a('0x10')]['message']);}logger[_0x1b1a('0x10')](_0x1b1a('0xb'),_0x3d7037,_0xa8a08e[_0x1b1a('0x10')]['message']);return _0x5e11a9(_0xa8a08e[_0x1b1a('0x10')][_0x1b1a('0x12')]);}else{logger[_0x1b1a('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x3d7037,_0x1b1a('0xc'));_0x5e11a9(_0xa8a08e['result'][_0x1b1a('0x12')]);}})[_0x1b1a('0x14')](function(_0x193b73){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x3d7037,_0x193b73);_0x280120(_0x193b73);});});}
\ No newline at end of file
+var _0xdf64=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','AnalyticMetric,\x20%s,\x20%s','result','catch'];(function(_0xdd1f52,_0x227e9e){var _0x368782=function(_0x480309){while(--_0x480309){_0xdd1f52['push'](_0xdd1f52['shift']());}};_0x368782(++_0x227e9e);}(_0xdf64,0xe6));var _0x4df6=function(_0x4f53a6,_0x582ff5){_0x4f53a6=_0x4f53a6-0x0;var _0x30e4b7=_0xdf64[_0x4f53a6];return _0x30e4b7;};'use strict';var _=require('lodash');var util=require(_0x4df6('0x0'));var moment=require(_0x4df6('0x1'));var BPromise=require(_0x4df6('0x2'));var rs=require(_0x4df6('0x3'));var fs=require('fs');var Redis=require(_0x4df6('0x4'));var db=require(_0x4df6('0x5'))['db'];var utils=require(_0x4df6('0x6'));var logger=require(_0x4df6('0x7'))(_0x4df6('0x8'));var config=require(_0x4df6('0x9'));var jayson=require(_0x4df6('0xa'));var client=jayson[_0x4df6('0xb')][_0x4df6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x15b0d2,_0x4caef1,_0x5f8046){return new BPromise(function(_0xaaccfe,_0x3d6f8c){return client[_0x4df6('0xd')](_0x15b0d2,_0x5f8046)[_0x4df6('0xe')](function(_0xbf5b33){logger[_0x4df6('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x4caef1,_0x4df6('0x10'));logger['debug'](_0x4df6('0x11'),_0x4caef1,_0x4df6('0x10'),JSON['stringify'](_0xbf5b33));if(_0xbf5b33[_0x4df6('0x12')]){if(_0xbf5b33[_0x4df6('0x12')]['code']===0x1f4){logger[_0x4df6('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x4caef1,_0xbf5b33[_0x4df6('0x12')][_0x4df6('0x13')]);return _0x3d6f8c(_0xbf5b33[_0x4df6('0x12')][_0x4df6('0x13')]);}logger['error'](_0x4df6('0x14'),_0x4caef1,_0xbf5b33[_0x4df6('0x12')][_0x4df6('0x13')]);return _0xaaccfe(_0xbf5b33[_0x4df6('0x12')][_0x4df6('0x13')]);}else{logger[_0x4df6('0xf')](_0x4df6('0x14'),_0x4caef1,_0x4df6('0x10'));_0xaaccfe(_0xbf5b33[_0x4df6('0x15')]['message']);}})[_0x4df6('0x16')](function(_0x1ca456){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x4caef1,_0x1ca456);_0x3d6f8c(_0x1ca456);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 742eed5..9450215 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 _0xbaf0=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','path'];(function(_0x27e9be,_0x2f3a0d){var _0x42b8b9=function(_0x39e50e){while(--_0x39e50e){_0x27e9be['push'](_0x27e9be['shift']());}};_0x42b8b9(++_0x2f3a0d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbaf0[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['show']);router[_0x0baf('0xd')]('/',auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0xf')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x11')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);module[_0x0baf('0x13')]=router;
\ No newline at end of file
+var _0x8603=['../../components/interaction/service','./analyticMetric.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x10dfdf,_0x36b623){var _0x4d857d=function(_0x4683ee){while(--_0x4683ee){_0x10dfdf['push'](_0x10dfdf['shift']());}};_0x4d857d(++_0x36b623);}(_0x8603,0x190));var _0x3860=function(_0x3b1bba,_0x220536){_0x3b1bba=_0x3b1bba-0x0;var _0x4ca374=_0x8603[_0x3b1bba];return _0x4ca374;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['delete'](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['destroy']);module[_0x3860('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index eada9c3..800169a 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 _0x6fd7=['sequelize','exports'];(function(_0x119f1c,_0x34e245){var _0x5833e2=function(_0x5d8295){while(--_0x5d8295){_0x119f1c['push'](_0x119f1c['shift']());}};_0x5833e2(++_0x34e245);}(_0x6fd7,0x13e));var _0x76fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6fd7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x76fd('0x0'));module[_0x76fd('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0xe700=['TEXT'];(function(_0x2e8a0d,_0x28d640){var _0x4c8c75=function(_0x2fbc52){while(--_0x2fbc52){_0x2e8a0d['push'](_0x2e8a0d['shift']());}};_0x4c8c75(++_0x28d640);}(_0xe700,0x8e));var _0x0e70=function(_0x227020,_0x5c5b2c){_0x227020=_0x227020-0x0;var _0x171f72=_0xe700[_0x227020];return _0x171f72;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0x0e70('0x0')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index e2019d2..6952253 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 _0xdd94=['then','includeAll','include','findAll','rows','catch','params','options','find','create','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','render','merge','body','contact','agent','interaction','index','map','AnalyticTreeReport','rawAttributes','fieldName','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filter','VIRTUAL'];(function(_0x1e7496,_0x43c0fd){var _0x292c30=function(_0x38575e){while(--_0x38575e){_0x1e7496['push'](_0x1e7496['shift']());}};_0x292c30(++_0x43c0fd);}(_0xdd94,0x18b));var _0x4dd9=function(_0x159d5a,_0x1ad924){_0x159d5a=_0x159d5a-0x0;var _0x5623c9=_0xdd94[_0x159d5a];return _0x5623c9;};'use strict';var emlformat=require(_0x4dd9('0x0'));var rimraf=require(_0x4dd9('0x1'));var zipdir=require(_0x4dd9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4dd9('0x3'));var moment=require(_0x4dd9('0x4'));var BPromise=require(_0x4dd9('0x5'));var Mustache=require(_0x4dd9('0x6'));var util=require(_0x4dd9('0x7'));var path=require(_0x4dd9('0x8'));var sox=require(_0x4dd9('0x9'));var csv=require(_0x4dd9('0xa'));var ejs=require(_0x4dd9('0xb'));var fs=require('fs');var fs_extra=require(_0x4dd9('0xc'));var _=require(_0x4dd9('0xd'));var squel=require('squel');var crypto=require(_0x4dd9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4dd9('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4dd9('0x10'));var Papa=require('papaparse');var Redis=require(_0x4dd9('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4dd9('0x12'));var hardwareService=require(_0x4dd9('0x13'));var logger=require('../../config/logger')(_0x4dd9('0x14'));var utils=require('../../config/utils');var config=require(_0x4dd9('0x15'));var licenseUtil=require(_0x4dd9('0x16'));var db=require(_0x4dd9('0x17'))['db'];function respondWithStatusCode(_0x47cf44,_0xfdf92c){_0xfdf92c=_0xfdf92c||0xcc;return function(_0x51e46c){if(_0x51e46c){return _0x47cf44[_0x4dd9('0x18')](_0xfdf92c);}return _0x47cf44[_0x4dd9('0x19')](_0xfdf92c)[_0x4dd9('0x1a')]();};}function respondWithResult(_0x104522,_0x35b55e){_0x35b55e=_0x35b55e||0xc8;return function(_0x4ecfda){if(_0x4ecfda){return _0x104522['status'](_0x35b55e)[_0x4dd9('0x1b')](_0x4ecfda);}};}function respondWithFilteredResult(_0x221f46,_0x54e8e8){return function(_0x1b97b9){if(_0x1b97b9){var _0x1049a2=typeof _0x54e8e8[_0x4dd9('0x1c')]===_0x4dd9('0x1d')&&typeof _0x54e8e8['limit']===_0x4dd9('0x1d');var _0x19fb02=_0x1b97b9[_0x4dd9('0x1e')];var _0x5dd475=_0x1049a2?0x0:_0x54e8e8[_0x4dd9('0x1c')];var _0x3b7e51=_0x1049a2?_0x1b97b9[_0x4dd9('0x1e')]:_0x54e8e8[_0x4dd9('0x1c')]+_0x54e8e8['limit'];var _0x323277;if(_0x3b7e51>=_0x19fb02){_0x3b7e51=_0x19fb02;_0x323277=0xc8;}else{_0x323277=0xce;}_0x221f46['status'](_0x323277);return _0x221f46['set'](_0x4dd9('0x1f'),_0x5dd475+'-'+_0x3b7e51+'/'+_0x19fb02)[_0x4dd9('0x1b')](_0x1b97b9);}return null;};}function patchUpdates(_0x3d1fdf){return function(_0x5337fe){try{jsonpatch[_0x4dd9('0x20')](_0x5337fe,_0x3d1fdf,!![]);}catch(_0x2db0a3){return BPromise[_0x4dd9('0x21')](_0x2db0a3);}return _0x5337fe[_0x4dd9('0x22')]();};}function saveUpdates(_0x5d34e0,_0x26f9e7){return function(_0x1b7fcd){if(_0x1b7fcd){return _0x1b7fcd[_0x4dd9('0x23')](_0x5d34e0)['then'](function(_0x5cab6f){return _0x5cab6f;});}return null;};}function removeEntity(_0x37f82c,_0xf44981){return function(_0x34f8c8){if(_0x34f8c8){return _0x34f8c8[_0x4dd9('0x24')]()['then'](function(){_0x37f82c['status'](0xcc)[_0x4dd9('0x1a')]();});}};}function handleEntityNotFound(_0x22e5d6,_0x15af40){return function(_0x1c61f4){if(!_0x1c61f4){_0x22e5d6[_0x4dd9('0x18')](0x194);}return _0x1c61f4;};}function handleError(_0x340cdf,_0x5afd14){_0x5afd14=_0x5afd14||0x1f4;return function(_0x3d4ada){logger[_0x4dd9('0x25')](_0x3d4ada[_0x4dd9('0x26')]);if(_0x3d4ada['name']){delete _0x3d4ada[_0x4dd9('0x27')];}_0x340cdf['status'](_0x5afd14)[_0x4dd9('0x28')](_0x3d4ada);};}function getMustacheRender(_0x1b4025,_0x3540c7){return Mustache[_0x4dd9('0x29')](_0x1b4025,_[_0x4dd9('0x2a')](_0x3540c7[_0x4dd9('0x2b')],{'contact':_0x3540c7[_0x4dd9('0x2c')],'message':_0x3540c7['message'],'agent':_0x3540c7[_0x4dd9('0x2d')],'interaction':_0x3540c7[_0x4dd9('0x2e')],'account':_0x3540c7['account']}))||'';}exports[_0x4dd9('0x2f')]=function(_0x404ef0,_0x22889e){var _0x1e41fd={},_0x16547f={},_0x4f7cf2={'count':0x0,'rows':[]};var _0x5764df=_[_0x4dd9('0x30')](db[_0x4dd9('0x31')][_0x4dd9('0x32')],function(_0x5e0d38){return{'name':_0x5e0d38[_0x4dd9('0x33')],'type':_0x5e0d38['type']['key']};});_0x16547f[_0x4dd9('0x34')]=_[_0x4dd9('0x30')](_0x5764df,'name');_0x16547f['query']=_[_0x4dd9('0x35')](_0x404ef0['query']);_0x16547f[_0x4dd9('0x36')]=_['intersection'](_0x16547f[_0x4dd9('0x34')],_0x16547f['query']);_0x1e41fd['attributes']=_[_0x4dd9('0x37')](_0x16547f[_0x4dd9('0x34')],qs['fields'](_0x404ef0[_0x4dd9('0x38')][_0x4dd9('0x39')]));_0x1e41fd[_0x4dd9('0x3a')]=_0x1e41fd[_0x4dd9('0x3a')][_0x4dd9('0x3b')]?_0x1e41fd[_0x4dd9('0x3a')]:_0x16547f[_0x4dd9('0x34')];if(!_0x404ef0['query'][_0x4dd9('0x3c')](_0x4dd9('0x3d'))){_0x1e41fd['limit']=qs[_0x4dd9('0x3e')](_0x404ef0[_0x4dd9('0x38')][_0x4dd9('0x3e')]);_0x1e41fd[_0x4dd9('0x1c')]=qs[_0x4dd9('0x1c')](_0x404ef0['query'][_0x4dd9('0x1c')]);}_0x1e41fd['order']=qs[_0x4dd9('0x3f')](_0x404ef0[_0x4dd9('0x38')][_0x4dd9('0x3f')]);_0x1e41fd[_0x4dd9('0x40')]=qs['filters'](_['pick'](_0x404ef0[_0x4dd9('0x38')],_0x16547f[_0x4dd9('0x36')]),_0x5764df);if(_0x404ef0[_0x4dd9('0x38')][_0x4dd9('0x41')]){_0x1e41fd[_0x4dd9('0x40')]=_[_0x4dd9('0x2a')](_0x1e41fd[_0x4dd9('0x40')],{'$or':_[_0x4dd9('0x30')](_0x5764df,function(_0x27bc83){if(_0x27bc83['type']!==_0x4dd9('0x42')){var _0x5cb468={};_0x5cb468[_0x27bc83['name']]={'$like':'%'+_0x404ef0['query'][_0x4dd9('0x41')]+'%'};return _0x5cb468;}})});}_0x1e41fd=_['merge']({},_0x1e41fd,_0x404ef0['options']);var _0x47b73d={'where':_0x1e41fd[_0x4dd9('0x40')]};return db[_0x4dd9('0x31')]['count'](_0x47b73d)[_0x4dd9('0x43')](function(_0x1a167f){_0x4f7cf2[_0x4dd9('0x1e')]=_0x1a167f;if(_0x404ef0[_0x4dd9('0x38')][_0x4dd9('0x44')]){_0x1e41fd[_0x4dd9('0x45')]=[{'all':!![]}];}return db[_0x4dd9('0x31')][_0x4dd9('0x46')](_0x1e41fd);})['then'](function(_0x35ae52){_0x4f7cf2[_0x4dd9('0x47')]=_0x35ae52;return _0x4f7cf2;})['then'](respondWithFilteredResult(_0x22889e,_0x1e41fd))[_0x4dd9('0x48')](handleError(_0x22889e,null));};exports['show']=function(_0x2ac6e4,_0x572e71){var _0x531205={'raw':!![],'where':{'id':_0x2ac6e4[_0x4dd9('0x49')]['id']}},_0x449aed={};_0x449aed[_0x4dd9('0x34')]=_[_0x4dd9('0x35')](db[_0x4dd9('0x31')][_0x4dd9('0x32')]);_0x449aed['query']=_['keys'](_0x2ac6e4[_0x4dd9('0x38')]);_0x449aed[_0x4dd9('0x36')]=_[_0x4dd9('0x37')](_0x449aed[_0x4dd9('0x34')],_0x449aed['query']);_0x531205[_0x4dd9('0x3a')]=_[_0x4dd9('0x37')](_0x449aed[_0x4dd9('0x34')],qs[_0x4dd9('0x39')](_0x2ac6e4['query'][_0x4dd9('0x39')]));_0x531205[_0x4dd9('0x3a')]=_0x531205['attributes']['length']?_0x531205[_0x4dd9('0x3a')]:_0x449aed[_0x4dd9('0x34')];if(_0x2ac6e4[_0x4dd9('0x38')]['includeAll']){_0x531205['include']=[{'all':!![]}];}_0x531205=_[_0x4dd9('0x2a')]({},_0x531205,_0x2ac6e4[_0x4dd9('0x4a')]);return db[_0x4dd9('0x31')][_0x4dd9('0x4b')](_0x531205)[_0x4dd9('0x43')](handleEntityNotFound(_0x572e71,null))[_0x4dd9('0x43')](respondWithResult(_0x572e71,null))[_0x4dd9('0x48')](handleError(_0x572e71,null));};exports['create']=function(_0x10573d,_0x3ac9a7){return db['AnalyticTreeReport'][_0x4dd9('0x4c')](_0x10573d[_0x4dd9('0x2b')],{})['then'](respondWithResult(_0x3ac9a7,0xc9))[_0x4dd9('0x48')](handleError(_0x3ac9a7,null));};exports[_0x4dd9('0x23')]=function(_0x25facf,_0x4d16c6){if(_0x25facf['body']['id']){delete _0x25facf[_0x4dd9('0x2b')]['id'];}return db[_0x4dd9('0x31')]['find']({'where':{'id':_0x25facf[_0x4dd9('0x49')]['id']}})[_0x4dd9('0x43')](handleEntityNotFound(_0x4d16c6,null))[_0x4dd9('0x43')](saveUpdates(_0x25facf[_0x4dd9('0x2b')],null))[_0x4dd9('0x43')](respondWithResult(_0x4d16c6,null))[_0x4dd9('0x48')](handleError(_0x4d16c6,null));};exports[_0x4dd9('0x24')]=function(_0x2c9fb4,_0x307934){return db[_0x4dd9('0x31')][_0x4dd9('0x4b')]({'where':{'id':_0x2c9fb4[_0x4dd9('0x49')]['id']}})['then'](handleEntityNotFound(_0x307934,null))['then'](removeEntity(_0x307934,null))[_0x4dd9('0x48')](handleError(_0x307934,null));};
\ No newline at end of file
+var _0xff8a=['end','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','error','stack','name','render','merge','body','message','agent','interaction','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','AnalyticTreeReport','then','includeAll','findAll','rows','catch','show','params','keys','include','create','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x3beffb,_0x5c62bb){var _0x2274ca=function(_0x67ebf7){while(--_0x67ebf7){_0x3beffb['push'](_0x3beffb['shift']());}};_0x2274ca(++_0x5c62bb);}(_0xff8a,0x167));var _0xaff8=function(_0x4561fa,_0x1c2d3f){_0x4561fa=_0x4561fa-0x0;var _0x1775f6=_0xff8a[_0x4561fa];return _0x1775f6;};'use strict';var emlformat=require(_0xaff8('0x0'));var rimraf=require(_0xaff8('0x1'));var zipdir=require(_0xaff8('0x2'));var jsonpatch=require(_0xaff8('0x3'));var rp=require(_0xaff8('0x4'));var moment=require(_0xaff8('0x5'));var BPromise=require(_0xaff8('0x6'));var Mustache=require(_0xaff8('0x7'));var util=require(_0xaff8('0x8'));var path=require(_0xaff8('0x9'));var sox=require(_0xaff8('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaff8('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xaff8('0xc'));var deskjs=require(_0xaff8('0xd'));var toCsv=require(_0xaff8('0xe'));var querystring=require(_0xaff8('0xf'));var Papa=require(_0xaff8('0x10'));var Redis=require(_0xaff8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xaff8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xaff8('0x13'))(_0xaff8('0x14'));var utils=require(_0xaff8('0x15'));var config=require(_0xaff8('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xaff8('0x17'))['db'];function respondWithStatusCode(_0x1d74c1,_0x165c9b){_0x165c9b=_0x165c9b||0xcc;return function(_0x333b4c){if(_0x333b4c){return _0x1d74c1[_0xaff8('0x18')](_0x165c9b);}return _0x1d74c1[_0xaff8('0x19')](_0x165c9b)[_0xaff8('0x1a')]();};}function respondWithResult(_0x5d5d29,_0x45a9b4){_0x45a9b4=_0x45a9b4||0xc8;return function(_0x4d1eb0){if(_0x4d1eb0){return _0x5d5d29['status'](_0x45a9b4)[_0xaff8('0x1b')](_0x4d1eb0);}};}function respondWithFilteredResult(_0x174707,_0x253f2e){return function(_0x4149b3){if(_0x4149b3){var _0x2bfd0c=typeof _0x253f2e[_0xaff8('0x1c')]===_0xaff8('0x1d')&&typeof _0x253f2e[_0xaff8('0x1e')]===_0xaff8('0x1d');var _0x4cd75e=_0x4149b3['count'];var _0x4a60e2=_0x2bfd0c?0x0:_0x253f2e[_0xaff8('0x1c')];var _0x271dd4=_0x2bfd0c?_0x4149b3[_0xaff8('0x1f')]:_0x253f2e[_0xaff8('0x1c')]+_0x253f2e[_0xaff8('0x1e')];var _0x12ca42;if(_0x271dd4>=_0x4cd75e){_0x271dd4=_0x4cd75e;_0x12ca42=0xc8;}else{_0x12ca42=0xce;}_0x174707[_0xaff8('0x19')](_0x12ca42);return _0x174707[_0xaff8('0x20')](_0xaff8('0x21'),_0x4a60e2+'-'+_0x271dd4+'/'+_0x4cd75e)['json'](_0x4149b3);}return null;};}function patchUpdates(_0x4ca6ea){return function(_0x2f840e){try{jsonpatch['apply'](_0x2f840e,_0x4ca6ea,!![]);}catch(_0x4a89e4){return BPromise[_0xaff8('0x22')](_0x4a89e4);}return _0x2f840e[_0xaff8('0x23')]();};}function saveUpdates(_0x3f9355,_0x32c3aa){return function(_0x25aa57){if(_0x25aa57){return _0x25aa57['update'](_0x3f9355)['then'](function(_0x66fc28){return _0x66fc28;});}return null;};}function removeEntity(_0x2c05fb,_0x13679d){return function(_0x5bf46d){if(_0x5bf46d){return _0x5bf46d[_0xaff8('0x24')]()['then'](function(){_0x2c05fb[_0xaff8('0x19')](0xcc)[_0xaff8('0x1a')]();});}};}function handleEntityNotFound(_0x48d3f8,_0x433518){return function(_0x587e22){if(!_0x587e22){_0x48d3f8[_0xaff8('0x18')](0x194);}return _0x587e22;};}function handleError(_0x285f6e,_0x3ec552){_0x3ec552=_0x3ec552||0x1f4;return function(_0x440c5d){logger[_0xaff8('0x25')](_0x440c5d[_0xaff8('0x26')]);if(_0x440c5d['name']){delete _0x440c5d[_0xaff8('0x27')];}_0x285f6e[_0xaff8('0x19')](_0x3ec552)['send'](_0x440c5d);};}function getMustacheRender(_0x5a0aa0,_0x7f8f59){return Mustache[_0xaff8('0x28')](_0x5a0aa0,_[_0xaff8('0x29')](_0x7f8f59[_0xaff8('0x2a')],{'contact':_0x7f8f59['contact'],'message':_0x7f8f59[_0xaff8('0x2b')],'agent':_0x7f8f59[_0xaff8('0x2c')],'interaction':_0x7f8f59[_0xaff8('0x2d')],'account':_0x7f8f59['account']}))||'';}exports['index']=function(_0x422b49,_0x1d6235){var _0x5ea3e3={},_0x5c2f43={},_0xd21a85={'count':0x0,'rows':[]};var _0x45eea4=_['map'](db['AnalyticTreeReport'][_0xaff8('0x2e')],function(_0xfac538){return{'name':_0xfac538['fieldName'],'type':_0xfac538[_0xaff8('0x2f')][_0xaff8('0x30')]};});_0x5c2f43[_0xaff8('0x31')]=_[_0xaff8('0x32')](_0x45eea4,'name');_0x5c2f43[_0xaff8('0x33')]=_['keys'](_0x422b49['query']);_0x5c2f43[_0xaff8('0x34')]=_[_0xaff8('0x35')](_0x5c2f43[_0xaff8('0x31')],_0x5c2f43['query']);_0x5ea3e3[_0xaff8('0x36')]=_['intersection'](_0x5c2f43[_0xaff8('0x31')],qs[_0xaff8('0x37')](_0x422b49[_0xaff8('0x33')][_0xaff8('0x37')]));_0x5ea3e3[_0xaff8('0x36')]=_0x5ea3e3[_0xaff8('0x36')][_0xaff8('0x38')]?_0x5ea3e3['attributes']:_0x5c2f43[_0xaff8('0x31')];if(!_0x422b49['query'][_0xaff8('0x39')](_0xaff8('0x3a'))){_0x5ea3e3[_0xaff8('0x1e')]=qs[_0xaff8('0x1e')](_0x422b49['query']['limit']);_0x5ea3e3['offset']=qs[_0xaff8('0x1c')](_0x422b49['query'][_0xaff8('0x1c')]);}_0x5ea3e3[_0xaff8('0x3b')]=qs[_0xaff8('0x3c')](_0x422b49[_0xaff8('0x33')]['sort']);_0x5ea3e3[_0xaff8('0x3d')]=qs['filters'](_[_0xaff8('0x3e')](_0x422b49[_0xaff8('0x33')],_0x5c2f43[_0xaff8('0x34')]),_0x45eea4);if(_0x422b49[_0xaff8('0x33')]['filter']){_0x5ea3e3[_0xaff8('0x3d')]=_[_0xaff8('0x29')](_0x5ea3e3[_0xaff8('0x3d')],{'$or':_[_0xaff8('0x32')](_0x45eea4,function(_0x36ab27){if(_0x36ab27[_0xaff8('0x2f')]!=='VIRTUAL'){var _0x256887={};_0x256887[_0x36ab27['name']]={'$like':'%'+_0x422b49[_0xaff8('0x33')][_0xaff8('0x3f')]+'%'};return _0x256887;}})});}_0x5ea3e3=_[_0xaff8('0x29')]({},_0x5ea3e3,_0x422b49[_0xaff8('0x40')]);var _0x5c82d1={'where':_0x5ea3e3[_0xaff8('0x3d')]};return db[_0xaff8('0x41')][_0xaff8('0x1f')](_0x5c82d1)[_0xaff8('0x42')](function(_0x5cf40a){_0xd21a85[_0xaff8('0x1f')]=_0x5cf40a;if(_0x422b49[_0xaff8('0x33')][_0xaff8('0x43')]){_0x5ea3e3['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xaff8('0x44')](_0x5ea3e3);})[_0xaff8('0x42')](function(_0x1d82f4){_0xd21a85[_0xaff8('0x45')]=_0x1d82f4;return _0xd21a85;})[_0xaff8('0x42')](respondWithFilteredResult(_0x1d6235,_0x5ea3e3))[_0xaff8('0x46')](handleError(_0x1d6235,null));};exports[_0xaff8('0x47')]=function(_0x37e6f7,_0x49056b){var _0x391ad3={'raw':!![],'where':{'id':_0x37e6f7[_0xaff8('0x48')]['id']}},_0x5bd1af={};_0x5bd1af[_0xaff8('0x31')]=_[_0xaff8('0x49')](db[_0xaff8('0x41')][_0xaff8('0x2e')]);_0x5bd1af['query']=_[_0xaff8('0x49')](_0x37e6f7['query']);_0x5bd1af['filters']=_[_0xaff8('0x35')](_0x5bd1af[_0xaff8('0x31')],_0x5bd1af[_0xaff8('0x33')]);_0x391ad3[_0xaff8('0x36')]=_[_0xaff8('0x35')](_0x5bd1af[_0xaff8('0x31')],qs['fields'](_0x37e6f7[_0xaff8('0x33')][_0xaff8('0x37')]));_0x391ad3[_0xaff8('0x36')]=_0x391ad3[_0xaff8('0x36')][_0xaff8('0x38')]?_0x391ad3[_0xaff8('0x36')]:_0x5bd1af[_0xaff8('0x31')];if(_0x37e6f7[_0xaff8('0x33')]['includeAll']){_0x391ad3[_0xaff8('0x4a')]=[{'all':!![]}];}_0x391ad3=_[_0xaff8('0x29')]({},_0x391ad3,_0x37e6f7[_0xaff8('0x40')]);return db[_0xaff8('0x41')]['find'](_0x391ad3)['then'](handleEntityNotFound(_0x49056b,null))['then'](respondWithResult(_0x49056b,null))[_0xaff8('0x46')](handleError(_0x49056b,null));};exports[_0xaff8('0x4b')]=function(_0x2a710f,_0x4999aa){return db[_0xaff8('0x41')][_0xaff8('0x4b')](_0x2a710f[_0xaff8('0x2a')],{})[_0xaff8('0x42')](respondWithResult(_0x4999aa,0xc9))[_0xaff8('0x46')](handleError(_0x4999aa,null));};exports['update']=function(_0x3cbb8f,_0x4ab967){if(_0x3cbb8f[_0xaff8('0x2a')]['id']){delete _0x3cbb8f[_0xaff8('0x2a')]['id'];}return db['AnalyticTreeReport'][_0xaff8('0x4c')]({'where':{'id':_0x3cbb8f['params']['id']}})['then'](handleEntityNotFound(_0x4ab967,null))[_0xaff8('0x42')](saveUpdates(_0x3cbb8f[_0xaff8('0x2a')],null))[_0xaff8('0x42')](respondWithResult(_0x4ab967,null))['catch'](handleError(_0x4ab967,null));};exports[_0xaff8('0x24')]=function(_0xbfd93c,_0x26682e){return db[_0xaff8('0x41')][_0xaff8('0x4c')]({'where':{'id':_0xbfd93c[_0xaff8('0x48')]['id']}})[_0xaff8('0x42')](handleEntityNotFound(_0x26682e,null))[_0xaff8('0x42')](removeEntity(_0x26682e,null))[_0xaff8('0x46')](handleError(_0x26682e,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 43d10ec..8342fa5 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 _0x5204=['request-promise','path','../../config/environment','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','api','moment','bluebird'];(function(_0x5f0f7a,_0x244c53){var _0x8742e7=function(_0x48ff6e){while(--_0x48ff6e){_0x5f0f7a['push'](_0x5f0f7a['shift']());}};_0x8742e7(++_0x244c53);}(_0x5204,0xdf));var _0x4520=function(_0x324012,_0x23f45f){_0x324012=_0x324012-0x0;var _0x435cf2=_0x5204[_0x324012];return _0x435cf2;};'use strict';var _=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var logger=require('../../config/logger')(_0x4520('0x2'));var moment=require(_0x4520('0x3'));var BPromise=require(_0x4520('0x4'));var rp=require(_0x4520('0x5'));var fs=require('fs');var path=require(_0x4520('0x6'));var rimraf=require('rimraf');var config=require(_0x4520('0x7'));var attributes=require('./analyticTreeReport.attributes');module[_0x4520('0x8')]=function(_0x209381,_0xe0a256){return _0x209381[_0x4520('0x9')](_0x4520('0xa'),attributes,{'tableName':_0x4520('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaa37=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash'];(function(_0x3d6e71,_0x5816fb){var _0x2b17af=function(_0x54266b){while(--_0x54266b){_0x3d6e71['push'](_0x3d6e71['shift']());}};_0x2b17af(++_0x5816fb);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xaa37[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0x7aa3('0x0'));var util=require(_0x7aa3('0x1'));var logger=require(_0x7aa3('0x2'))(_0x7aa3('0x3'));var moment=require('moment');var BPromise=require(_0x7aa3('0x4'));var rp=require(_0x7aa3('0x5'));var fs=require('fs');var path=require(_0x7aa3('0x6'));var rimraf=require(_0x7aa3('0x7'));var config=require(_0x7aa3('0x8'));var attributes=require(_0x7aa3('0x9'));module[_0x7aa3('0xa')]=function(_0x5b738a,_0x437b90){return _0x5b738a[_0x7aa3('0xb')]('AnalyticTreeReport',attributes,{'tableName':_0x7aa3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index c3ef9de..dbca7ac 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 _0x9aa9=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','info','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticTreeReport,\x20%s,\x20%s','message','moment','bluebird'];(function(_0x2c7eb4,_0x37591e){var _0xe2dedc=function(_0x2ccac0){while(--_0x2ccac0){_0x2c7eb4['push'](_0x2c7eb4['shift']());}};_0xe2dedc(++_0x37591e);}(_0x9aa9,0x12e));var _0x99aa=function(_0x47acac,_0x3b8af6){_0x47acac=_0x47acac-0x0;var _0xebed16=_0x9aa9[_0x47acac];return _0xebed16;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x99aa('0x0'));var BPromise=require(_0x99aa('0x1'));var rs=require(_0x99aa('0x2'));var fs=require('fs');var Redis=require(_0x99aa('0x3'));var db=require(_0x99aa('0x4'))['db'];var utils=require(_0x99aa('0x5'));var logger=require('../../config/logger')(_0x99aa('0x6'));var config=require(_0x99aa('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x99aa('0x8')][_0x99aa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xec0bee,_0x30b6e4,_0x5e4aa6){return new BPromise(function(_0x166bd7,_0x42424d){return client['request'](_0xec0bee,_0x5e4aa6)['then'](function(_0x2f02a5){logger[_0x99aa('0xa')]('AnalyticTreeReport,\x20%s,\x20%s',_0x30b6e4,_0x99aa('0xb'));logger[_0x99aa('0xc')](_0x99aa('0xd'),_0x30b6e4,_0x99aa('0xb'),JSON[_0x99aa('0xe')](_0x2f02a5));if(_0x2f02a5['error']){if(_0x2f02a5[_0x99aa('0xf')][_0x99aa('0x10')]===0x1f4){logger['error'](_0x99aa('0x11'),_0x30b6e4,_0x2f02a5['error'][_0x99aa('0x12')]);return _0x42424d(_0x2f02a5[_0x99aa('0xf')]['message']);}logger['error'](_0x99aa('0x11'),_0x30b6e4,_0x2f02a5[_0x99aa('0xf')][_0x99aa('0x12')]);return _0x166bd7(_0x2f02a5[_0x99aa('0xf')]['message']);}else{logger[_0x99aa('0xa')](_0x99aa('0x11'),_0x30b6e4,_0x99aa('0xb'));_0x166bd7(_0x2f02a5['result'][_0x99aa('0x12')]);}})['catch'](function(_0x29b248){logger[_0x99aa('0xf')](_0x99aa('0x11'),_0x30b6e4,_0x29b248);_0x42424d(_0x29b248);});});}
\ No newline at end of file
+var _0x0d1e=['rpc','jayson/promise','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x2cd9e8,_0x3520ed){var _0x2f712f=function(_0x769f94){while(--_0x769f94){_0x2cd9e8['push'](_0x2cd9e8['shift']());}};_0x2f712f(++_0x3520ed);}(_0x0d1e,0x184));var _0xe0d1=function(_0x2b304e,_0x27a4a1){_0x2b304e=_0x2b304e-0x0;var _0x274ae5=_0x0d1e[_0x2b304e];return _0x274ae5;};'use strict';var _=require(_0xe0d1('0x0'));var util=require(_0xe0d1('0x1'));var moment=require(_0xe0d1('0x2'));var BPromise=require(_0xe0d1('0x3'));var rs=require(_0xe0d1('0x4'));var fs=require('fs');var Redis=require(_0xe0d1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe0d1('0x6'));var logger=require(_0xe0d1('0x7'))(_0xe0d1('0x8'));var config=require('../../config/environment');var jayson=require(_0xe0d1('0x9'));var client=jayson['client'][_0xe0d1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x557d45,_0xf5393,_0x1d7dc4){return new BPromise(function(_0x53aa0f,_0x1cfff5){return client[_0xe0d1('0xb')](_0x557d45,_0x1d7dc4)[_0xe0d1('0xc')](function(_0x43def3){logger[_0xe0d1('0xd')](_0xe0d1('0xe'),_0xf5393,_0xe0d1('0xf'));logger[_0xe0d1('0x10')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xf5393,_0xe0d1('0xf'),JSON[_0xe0d1('0x11')](_0x43def3));if(_0x43def3['error']){if(_0x43def3[_0xe0d1('0x12')][_0xe0d1('0x13')]===0x1f4){logger[_0xe0d1('0x12')](_0xe0d1('0xe'),_0xf5393,_0x43def3[_0xe0d1('0x12')]['message']);return _0x1cfff5(_0x43def3[_0xe0d1('0x12')][_0xe0d1('0x14')]);}logger[_0xe0d1('0x12')](_0xe0d1('0xe'),_0xf5393,_0x43def3[_0xe0d1('0x12')][_0xe0d1('0x14')]);return _0x53aa0f(_0x43def3[_0xe0d1('0x12')]['message']);}else{logger[_0xe0d1('0xd')](_0xe0d1('0xe'),_0xf5393,_0xe0d1('0xf'));_0x53aa0f(_0x43def3['result'][_0xe0d1('0x14')]);}})[_0xe0d1('0x15')](function(_0xa0160b){logger[_0xe0d1('0x12')](_0xe0d1('0xe'),_0xf5393,_0xa0160b);_0x1cfff5(_0xa0160b);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index b32e5de..ebb2d45 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 _0x2524=['show','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x29d6e6,_0x264220){var _0xc75ff0=function(_0x214f6b){while(--_0x214f6b){_0x29d6e6['push'](_0x29d6e6['shift']());}};_0xc75ff0(++_0x264220);}(_0x2524,0x8c));var _0x4252=function(_0x54e756,_0x18fa40){_0x54e756=_0x54e756-0x0;var _0x351911=_0x2524[_0x54e756];return _0x351911;};'use strict';var multer=require(_0x4252('0x0'));var util=require(_0x4252('0x1'));var path=require('path');var timeout=require(_0x4252('0x2'));var express=require(_0x4252('0x3'));var router=express[_0x4252('0x4')]();var fs_extra=require(_0x4252('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4252('0x6'));var config=require(_0x4252('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x4252('0x8')]('/',auth[_0x4252('0x9')](),controller[_0x4252('0xa')]);router[_0x4252('0x8')](_0x4252('0xb'),auth[_0x4252('0x9')](),controller[_0x4252('0xc')]);router[_0x4252('0xd')]('/',auth[_0x4252('0x9')](),controller[_0x4252('0xe')]);router[_0x4252('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x4252('0x10')]);router['delete']('/:id',auth[_0x4252('0x9')](),controller[_0x4252('0x11')]);module[_0x4252('0x12')]=router;
\ No newline at end of file
+var _0x2964=['./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x46b392,_0x59e8bd){var _0x30963a=function(_0xe26c37){while(--_0xe26c37){_0x46b392['push'](_0x46b392['shift']());}};_0x30963a(++_0x59e8bd);}(_0x2964,0x108));var _0x4296=function(_0x7f0f22,_0xaa2187){_0x7f0f22=_0x7f0f22-0x0;var _0x50334a=_0x2964[_0x7f0f22];return _0x50334a;};'use strict';var multer=require(_0x4296('0x0'));var util=require(_0x4296('0x1'));var path=require(_0x4296('0x2'));var timeout=require(_0x4296('0x3'));var express=require(_0x4296('0x4'));var router=express[_0x4296('0x5')]();var fs_extra=require(_0x4296('0x6'));var auth=require(_0x4296('0x7'));var interaction=require(_0x4296('0x8'));var config=require('../../config/environment');var controller=require(_0x4296('0x9'));router[_0x4296('0xa')]('/',auth[_0x4296('0xb')](),controller[_0x4296('0xc')]);router[_0x4296('0xa')](_0x4296('0xd'),auth['isAuthenticated'](),controller[_0x4296('0xe')]);router[_0x4296('0xf')]('/',auth[_0x4296('0xb')](),controller[_0x4296('0x10')]);router[_0x4296('0x11')](_0x4296('0xd'),auth[_0x4296('0xb')](),controller[_0x4296('0x12')]);router[_0x4296('0x13')](_0x4296('0xd'),auth[_0x4296('0xb')](),controller[_0x4296('0x14')]);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 dcfc99d..b33e775 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 _0x44b3=['exports','STRING','sequelize'];(function(_0x1a3d17,_0x95a7be){var _0x539d97=function(_0x1ce73f){while(--_0x1ce73f){_0x1a3d17['push'](_0x1a3d17['shift']());}};_0x539d97(++_0x95a7be);}(_0x44b3,0x1a9));var _0x344b=function(_0x4858b1,_0x11ddb8){_0x4858b1=_0x4858b1-0x0;var _0x2e222c=_0x44b3[_0x4858b1];return _0x2e222c;};'use strict';var Sequelize=require(_0x344b('0x0'));module[_0x344b('0x1')]={'name':{'type':Sequelize[_0x344b('0x2')]},'basename':{'type':Sequelize[_0x344b('0x2')]},'type':{'type':Sequelize[_0x344b('0x2')]}};
\ No newline at end of file
+var _0xbb72=['sequelize','STRING'];(function(_0x3c729b,_0x2a4146){var _0x55894c=function(_0x183a16){while(--_0x183a16){_0x3c729b['push'](_0x3c729b['shift']());}};_0x55894c(++_0x2a4146);}(_0xbb72,0x19c));var _0x2bb7=function(_0x3aebfe,_0x54ea35){_0x3aebfe=_0x3aebfe-0x0;var _0x458547=_0xbb72[_0x3aebfe];return _0x458547;};'use strict';var Sequelize=require(_0x2bb7('0x0'));module['exports']={'name':{'type':Sequelize[_0x2bb7('0x1')]},'basename':{'type':Sequelize[_0x2bb7('0x1')]},'type':{'type':Sequelize[_0x2bb7('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 62d1ae2..a98a1d3 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 _0x6bd4=['../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','update','then','destroy','send','render','merge','body','message','agent','interaction','account','index','map','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','Attachment','rows','catch','show','params','find','get','omit','createdAt','updatedAt','create','file','basename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x55ee0c,_0x51b713){var _0x2d8f6b=function(_0x4c217c){while(--_0x4c217c){_0x55ee0c['push'](_0x55ee0c['shift']());}};_0x2d8f6b(++_0x51b713);}(_0x6bd4,0x1b2));var _0x46bd=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x6bd4[_0x17b6e3];return _0x3906f3;};'use strict';var emlformat=require(_0x46bd('0x0'));var rimraf=require(_0x46bd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x46bd('0x2'));var moment=require(_0x46bd('0x3'));var BPromise=require(_0x46bd('0x4'));var Mustache=require(_0x46bd('0x5'));var util=require(_0x46bd('0x6'));var path=require(_0x46bd('0x7'));var sox=require(_0x46bd('0x8'));var csv=require(_0x46bd('0x9'));var ejs=require(_0x46bd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x46bd('0xb'));var squel=require(_0x46bd('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x46bd('0xd'));var toCsv=require('to-csv');var querystring=require(_0x46bd('0xe'));var Papa=require(_0x46bd('0xf'));var Redis=require(_0x46bd('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x46bd('0x11'));var logger=require(_0x46bd('0x12'))(_0x46bd('0x13'));var utils=require(_0x46bd('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x46bd('0x15'));var db=require(_0x46bd('0x16'))['db'];function respondWithStatusCode(_0x4d586d,_0x49284d){_0x49284d=_0x49284d||0xcc;return function(_0x1f0141){if(_0x1f0141){return _0x4d586d[_0x46bd('0x17')](_0x49284d);}return _0x4d586d[_0x46bd('0x18')](_0x49284d)[_0x46bd('0x19')]();};}function respondWithResult(_0x3f5412,_0x5ed420){_0x5ed420=_0x5ed420||0xc8;return function(_0x36e9c3){if(_0x36e9c3){return _0x3f5412[_0x46bd('0x18')](_0x5ed420)['json'](_0x36e9c3);}};}function respondWithFilteredResult(_0x4406c4,_0xb0c162){return function(_0x3aa267){if(_0x3aa267){var _0x28b5db=typeof _0xb0c162[_0x46bd('0x1a')]===_0x46bd('0x1b')&&typeof _0xb0c162[_0x46bd('0x1c')]===_0x46bd('0x1b');var _0xf3d78c=_0x3aa267['count'];var _0xe8c5e2=_0x28b5db?0x0:_0xb0c162['offset'];var _0x3b9d1a=_0x28b5db?_0x3aa267[_0x46bd('0x1d')]:_0xb0c162[_0x46bd('0x1a')]+_0xb0c162[_0x46bd('0x1c')];var _0x503665;if(_0x3b9d1a>=_0xf3d78c){_0x3b9d1a=_0xf3d78c;_0x503665=0xc8;}else{_0x503665=0xce;}_0x4406c4[_0x46bd('0x18')](_0x503665);return _0x4406c4[_0x46bd('0x1e')]('Content-Range',_0xe8c5e2+'-'+_0x3b9d1a+'/'+_0xf3d78c)[_0x46bd('0x1f')](_0x3aa267);}return null;};}function patchUpdates(_0x5505f2){return function(_0x1e9fcb){try{jsonpatch[_0x46bd('0x20')](_0x1e9fcb,_0x5505f2,!![]);}catch(_0x34dec6){return BPromise['reject'](_0x34dec6);}return _0x1e9fcb['save']();};}function saveUpdates(_0x37e702,_0x3b759c){return function(_0xd36dcb){if(_0xd36dcb){return _0xd36dcb[_0x46bd('0x21')](_0x37e702)[_0x46bd('0x22')](function(_0x80ff54){return _0x80ff54;});}return null;};}function removeEntity(_0x33bcd7,_0x208c20){return function(_0x4ec149){if(_0x4ec149){return _0x4ec149[_0x46bd('0x23')]()[_0x46bd('0x22')](function(){_0x33bcd7['status'](0xcc)[_0x46bd('0x19')]();});}};}function handleEntityNotFound(_0x3821d2,_0x5b9ad0){return function(_0x268c88){if(!_0x268c88){_0x3821d2[_0x46bd('0x17')](0x194);}return _0x268c88;};}function handleError(_0x5b824f,_0x362fba){_0x362fba=_0x362fba||0x1f4;return function(_0x29b1cd){logger['error'](_0x29b1cd['stack']);if(_0x29b1cd['name']){delete _0x29b1cd['name'];}_0x5b824f[_0x46bd('0x18')](_0x362fba)[_0x46bd('0x24')](_0x29b1cd);};}function getMustacheRender(_0x29b4fa,_0x5ff485){return Mustache[_0x46bd('0x25')](_0x29b4fa,_[_0x46bd('0x26')](_0x5ff485[_0x46bd('0x27')],{'contact':_0x5ff485['contact'],'message':_0x5ff485[_0x46bd('0x28')],'agent':_0x5ff485[_0x46bd('0x29')],'interaction':_0x5ff485[_0x46bd('0x2a')],'account':_0x5ff485[_0x46bd('0x2b')]}))||'';}exports[_0x46bd('0x2c')]=function(_0x309908,_0x5da82f){var _0x51ae76={},_0x2c64f3={},_0x11f8ad={'count':0x0,'rows':[]};var _0x49bb29=_[_0x46bd('0x2d')](db['Attachment'][_0x46bd('0x2e')],function(_0x54708f){return{'name':_0x54708f[_0x46bd('0x2f')],'type':_0x54708f[_0x46bd('0x30')][_0x46bd('0x31')]};});_0x2c64f3[_0x46bd('0x32')]=_[_0x46bd('0x2d')](_0x49bb29,_0x46bd('0x33'));_0x2c64f3['query']=_[_0x46bd('0x34')](_0x309908[_0x46bd('0x35')]);_0x2c64f3[_0x46bd('0x36')]=_[_0x46bd('0x37')](_0x2c64f3['model'],_0x2c64f3['query']);_0x51ae76['attributes']=_[_0x46bd('0x37')](_0x2c64f3[_0x46bd('0x32')],qs['fields'](_0x309908[_0x46bd('0x35')][_0x46bd('0x38')]));_0x51ae76['attributes']=_0x51ae76[_0x46bd('0x39')][_0x46bd('0x3a')]?_0x51ae76[_0x46bd('0x39')]:_0x2c64f3[_0x46bd('0x32')];if(!_0x309908[_0x46bd('0x35')][_0x46bd('0x3b')](_0x46bd('0x3c'))){_0x51ae76[_0x46bd('0x1c')]=qs['limit'](_0x309908[_0x46bd('0x35')][_0x46bd('0x1c')]);_0x51ae76[_0x46bd('0x1a')]=qs[_0x46bd('0x1a')](_0x309908[_0x46bd('0x35')][_0x46bd('0x1a')]);}_0x51ae76[_0x46bd('0x3d')]=qs['sort'](_0x309908[_0x46bd('0x35')][_0x46bd('0x3e')]);_0x51ae76[_0x46bd('0x3f')]=qs[_0x46bd('0x36')](_[_0x46bd('0x40')](_0x309908[_0x46bd('0x35')],_0x2c64f3[_0x46bd('0x36')]),_0x49bb29);if(_0x309908['query'][_0x46bd('0x41')]){_0x51ae76[_0x46bd('0x3f')]=_[_0x46bd('0x26')](_0x51ae76[_0x46bd('0x3f')],{'$or':_['map'](_0x49bb29,function(_0x3525c7){if(_0x3525c7['type']!==_0x46bd('0x42')){var _0x49e674={};_0x49e674[_0x3525c7[_0x46bd('0x33')]]={'$like':'%'+_0x309908[_0x46bd('0x35')][_0x46bd('0x41')]+'%'};return _0x49e674;}})});}_0x51ae76=_[_0x46bd('0x26')]({},_0x51ae76,_0x309908[_0x46bd('0x43')]);var _0x265435={'where':_0x51ae76['where']};return db['Attachment'][_0x46bd('0x1d')](_0x265435)[_0x46bd('0x22')](function(_0x30f9b6){_0x11f8ad[_0x46bd('0x1d')]=_0x30f9b6;if(_0x309908[_0x46bd('0x35')][_0x46bd('0x44')]){_0x51ae76[_0x46bd('0x45')]=[{'all':!![]}];}return db[_0x46bd('0x46')]['findAll'](_0x51ae76);})[_0x46bd('0x22')](function(_0x1ace91){_0x11f8ad[_0x46bd('0x47')]=_0x1ace91;return _0x11f8ad;})[_0x46bd('0x22')](respondWithFilteredResult(_0x5da82f,_0x51ae76))[_0x46bd('0x48')](handleError(_0x5da82f,null));};exports[_0x46bd('0x49')]=function(_0x275873,_0x16b631){var _0x3b6c23={'raw':!![],'where':{'id':_0x275873[_0x46bd('0x4a')]['id']}},_0x28fe2e={};_0x28fe2e[_0x46bd('0x32')]=_[_0x46bd('0x34')](db['Attachment'][_0x46bd('0x2e')]);_0x28fe2e[_0x46bd('0x35')]=_[_0x46bd('0x34')](_0x275873[_0x46bd('0x35')]);_0x28fe2e[_0x46bd('0x36')]=_['intersection'](_0x28fe2e[_0x46bd('0x32')],_0x28fe2e['query']);_0x3b6c23[_0x46bd('0x39')]=_[_0x46bd('0x37')](_0x28fe2e[_0x46bd('0x32')],qs['fields'](_0x275873[_0x46bd('0x35')][_0x46bd('0x38')]));_0x3b6c23['attributes']=_0x3b6c23[_0x46bd('0x39')]['length']?_0x3b6c23[_0x46bd('0x39')]:_0x28fe2e['model'];if(_0x275873[_0x46bd('0x35')][_0x46bd('0x44')]){_0x3b6c23['include']=[{'all':!![]}];}_0x3b6c23=_[_0x46bd('0x26')]({},_0x3b6c23,_0x275873['options']);return db['Attachment'][_0x46bd('0x4b')](_0x3b6c23)[_0x46bd('0x22')](handleEntityNotFound(_0x16b631,null))[_0x46bd('0x22')](respondWithResult(_0x16b631,null))['catch'](handleError(_0x16b631,null));};exports['clone']=function(_0x2480a9,_0x34bec4){var _0x41de22={'where':{'id':_0x2480a9[_0x46bd('0x4a')]['id']}},_0x4f7e35={};_0x4f7e35[_0x46bd('0x32')]=_[_0x46bd('0x34')](db[_0x46bd('0x46')][_0x46bd('0x2e')]);_0x41de22[_0x46bd('0x39')]=_['intersection'](_0x4f7e35['model'],qs[_0x46bd('0x38')](_0x2480a9[_0x46bd('0x35')][_0x46bd('0x38')]));_0x41de22[_0x46bd('0x39')]=_0x41de22[_0x46bd('0x39')][_0x46bd('0x3a')]?_0x41de22[_0x46bd('0x39')]:_0x4f7e35['model'];if(_0x2480a9['query'][_0x46bd('0x44')]){_0x41de22[_0x46bd('0x45')]=[{'all':!![]}];}_0x41de22=_[_0x46bd('0x26')]({},_0x41de22,_0x2480a9[_0x46bd('0x43')]);return db[_0x46bd('0x46')][_0x46bd('0x4b')](_0x41de22)[_0x46bd('0x22')](handleEntityNotFound(_0x34bec4,null))['then'](function(_0x1f0acd){if(_0x1f0acd){var _0x58bf81=_0x1f0acd[_0x46bd('0x4c')]({'plain':!![]});_0x58bf81=qs[_0x46bd('0x4d')](_0x58bf81,['id',_0x46bd('0x4e'),_0x46bd('0x4f')]);_0x2480a9[_0x46bd('0x27')]=_[_0x46bd('0x4d')](_0x2480a9[_0x46bd('0x27')],['id',_0x46bd('0x4e'),'updatedAt']);return db['Attachment'][_0x46bd('0x50')](_[_0x46bd('0x26')](_0x58bf81,_0x2480a9[_0x46bd('0x27')]),{'include':_0x2480a9[_0x46bd('0x35')][_0x46bd('0x44')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x34bec4,0xc9))[_0x46bd('0x48')](handleError(_0x34bec4,null));};exports[_0x46bd('0x21')]=function(_0x191c5a,_0x46c345){if(_0x191c5a[_0x46bd('0x27')]['id']){delete _0x191c5a[_0x46bd('0x27')]['id'];}return db['Attachment'][_0x46bd('0x4b')]({'where':{'id':_0x191c5a[_0x46bd('0x4a')]['id']}})[_0x46bd('0x22')](handleEntityNotFound(_0x46c345,null))['then'](saveUpdates(_0x191c5a[_0x46bd('0x27')],null))['then'](respondWithResult(_0x46c345,null))['catch'](handleError(_0x46c345,null));};exports[_0x46bd('0x23')]=function(_0x267eba,_0x14f9e7){return db['Attachment'][_0x46bd('0x4b')]({'where':{'id':_0x267eba[_0x46bd('0x4a')]['id']}})[_0x46bd('0x22')](handleEntityNotFound(_0x14f9e7,null))['then'](removeEntity(_0x14f9e7,null))['catch'](handleError(_0x14f9e7,null));};exports[_0x46bd('0x50')]=function(_0x4acb2f,_0x494b73,_0x4aec93){_0x4acb2f[_0x46bd('0x27')]['name']=_0x4acb2f[_0x46bd('0x51')]['originalname'];_0x4acb2f[_0x46bd('0x27')][_0x46bd('0x52')]=_0x4acb2f[_0x46bd('0x51')]['filename'];_0x4acb2f[_0x46bd('0x27')]['type']=_0x4acb2f[_0x46bd('0x51')][_0x46bd('0x53')];return db[_0x46bd('0x46')][_0x46bd('0x50')](_0x4acb2f[_0x46bd('0x27')])[_0x46bd('0x22')](respondWithResult(_0x494b73,0xc9))['catch'](handleError(_0x494b73,null));};exports[_0x46bd('0x54')]=function(_0x5959dc,_0x4d2bcb,_0xce4a88){return db[_0x46bd('0x46')][_0x46bd('0x55')]({'where':{'id':_0x5959dc[_0x46bd('0x4a')]['id']},'raw':!![]})[_0x46bd('0x22')](handleEntityNotFound(_0x4d2bcb,null))[_0x46bd('0x22')](function(_0x176d06){if(_0x176d06){var _0x46d3b4=_0x176d06[_0x46bd('0x56')]!==null;var _0x22b014=path[_0x46bd('0x57')](config[_0x46bd('0x58')],_0x46bd('0x59'));if(_0x46d3b4){_0x22b014=path[_0x46bd('0x57')](_0x22b014,_0x46bd('0x5a'));}var _0x3f951a=path[_0x46bd('0x57')](_0x22b014,_0x176d06[_0x46bd('0x52')]);return _0x4d2bcb[_0x46bd('0x54')](_0x3f951a);}})['catch'](handleError(_0x4d2bcb,null));};
\ No newline at end of file
+var _0xb0c9=['length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','options','Attachment','includeAll','include','findAll','rows','catch','show','params','find','clone','createdAt','updatedAt','body','omit','create','file','basename','filename','mimetype','download','join','root','server/files/attachments/','offline-chat/','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','count','limit','set','Content-Range','save','update','destroy','then','stack','name','send','render','merge','message','agent','interaction','index','map','rawAttributes','fieldName','key','query','keys','intersection','model','fields','attributes'];(function(_0x33d398,_0xbdbd3c){var _0xa63b07=function(_0x158a0e){while(--_0x158a0e){_0x33d398['push'](_0x33d398['shift']());}};_0xa63b07(++_0xbdbd3c);}(_0xb0c9,0x13b));var _0x9b0c=function(_0x572068,_0x588353){_0x572068=_0x572068-0x0;var _0x4f3fed=_0xb0c9[_0x572068];return _0x4f3fed;};'use strict';var emlformat=require(_0x9b0c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9b0c('0x1'));var jsonpatch=require(_0x9b0c('0x2'));var rp=require(_0x9b0c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9b0c('0x4'));var util=require(_0x9b0c('0x5'));var path=require(_0x9b0c('0x6'));var sox=require(_0x9b0c('0x7'));var csv=require('to-csv');var ejs=require(_0x9b0c('0x8'));var fs=require('fs');var fs_extra=require(_0x9b0c('0x9'));var _=require(_0x9b0c('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9b0c('0xb'));var toCsv=require(_0x9b0c('0xc'));var querystring=require(_0x9b0c('0xd'));var Papa=require(_0x9b0c('0xe'));var Redis=require(_0x9b0c('0xf'));var authService=require(_0x9b0c('0x10'));var qs=require(_0x9b0c('0x11'));var as=require(_0x9b0c('0x12'));var hardwareService=require(_0x9b0c('0x13'));var logger=require(_0x9b0c('0x14'))(_0x9b0c('0x15'));var utils=require(_0x9b0c('0x16'));var config=require(_0x9b0c('0x17'));var licenseUtil=require(_0x9b0c('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x293486,_0x9580d0){_0x9580d0=_0x9580d0||0xcc;return function(_0x9a115a){if(_0x9a115a){return _0x293486['sendStatus'](_0x9580d0);}return _0x293486['status'](_0x9580d0)[_0x9b0c('0x19')]();};}function respondWithResult(_0xdd533c,_0x2a55c9){_0x2a55c9=_0x2a55c9||0xc8;return function(_0x2a6091){if(_0x2a6091){return _0xdd533c[_0x9b0c('0x1a')](_0x2a55c9)[_0x9b0c('0x1b')](_0x2a6091);}};}function respondWithFilteredResult(_0x268bf5,_0x22a31d){return function(_0x548f0){if(_0x548f0){var _0x19ea36=typeof _0x22a31d[_0x9b0c('0x1c')]===_0x9b0c('0x1d')&&typeof _0x22a31d['limit']==='undefined';var _0x14ebac=_0x548f0[_0x9b0c('0x1e')];var _0xababa=_0x19ea36?0x0:_0x22a31d['offset'];var _0x4f366f=_0x19ea36?_0x548f0['count']:_0x22a31d[_0x9b0c('0x1c')]+_0x22a31d[_0x9b0c('0x1f')];var _0x3b9c89;if(_0x4f366f>=_0x14ebac){_0x4f366f=_0x14ebac;_0x3b9c89=0xc8;}else{_0x3b9c89=0xce;}_0x268bf5[_0x9b0c('0x1a')](_0x3b9c89);return _0x268bf5[_0x9b0c('0x20')](_0x9b0c('0x21'),_0xababa+'-'+_0x4f366f+'/'+_0x14ebac)[_0x9b0c('0x1b')](_0x548f0);}return null;};}function patchUpdates(_0x362acf){return function(_0xc5f214){try{jsonpatch['apply'](_0xc5f214,_0x362acf,!![]);}catch(_0x4e51ce){return BPromise['reject'](_0x4e51ce);}return _0xc5f214[_0x9b0c('0x22')]();};}function saveUpdates(_0x87363e,_0x57e1d0){return function(_0x42a10f){if(_0x42a10f){return _0x42a10f[_0x9b0c('0x23')](_0x87363e)['then'](function(_0x17efdf){return _0x17efdf;});}return null;};}function removeEntity(_0x151523,_0x1e02fe){return function(_0x575613){if(_0x575613){return _0x575613[_0x9b0c('0x24')]()[_0x9b0c('0x25')](function(){_0x151523[_0x9b0c('0x1a')](0xcc)[_0x9b0c('0x19')]();});}};}function handleEntityNotFound(_0x431ec9,_0x592a79){return function(_0x23661f){if(!_0x23661f){_0x431ec9['sendStatus'](0x194);}return _0x23661f;};}function handleError(_0x59f03c,_0x4b0f0a){_0x4b0f0a=_0x4b0f0a||0x1f4;return function(_0x22e467){logger['error'](_0x22e467[_0x9b0c('0x26')]);if(_0x22e467[_0x9b0c('0x27')]){delete _0x22e467['name'];}_0x59f03c[_0x9b0c('0x1a')](_0x4b0f0a)[_0x9b0c('0x28')](_0x22e467);};}function getMustacheRender(_0x2a410e,_0x4cdae2){return Mustache[_0x9b0c('0x29')](_0x2a410e,_[_0x9b0c('0x2a')](_0x4cdae2['body'],{'contact':_0x4cdae2['contact'],'message':_0x4cdae2[_0x9b0c('0x2b')],'agent':_0x4cdae2[_0x9b0c('0x2c')],'interaction':_0x4cdae2[_0x9b0c('0x2d')],'account':_0x4cdae2['account']}))||'';}exports[_0x9b0c('0x2e')]=function(_0x5523e9,_0x17944c){var _0xe0f264={},_0xf04053={},_0x57fa98={'count':0x0,'rows':[]};var _0x35cf68=_[_0x9b0c('0x2f')](db['Attachment'][_0x9b0c('0x30')],function(_0x622e0b){return{'name':_0x622e0b[_0x9b0c('0x31')],'type':_0x622e0b['type'][_0x9b0c('0x32')]};});_0xf04053['model']=_[_0x9b0c('0x2f')](_0x35cf68,_0x9b0c('0x27'));_0xf04053[_0x9b0c('0x33')]=_[_0x9b0c('0x34')](_0x5523e9[_0x9b0c('0x33')]);_0xf04053['filters']=_[_0x9b0c('0x35')](_0xf04053[_0x9b0c('0x36')],_0xf04053[_0x9b0c('0x33')]);_0xe0f264['attributes']=_[_0x9b0c('0x35')](_0xf04053['model'],qs[_0x9b0c('0x37')](_0x5523e9[_0x9b0c('0x33')][_0x9b0c('0x37')]));_0xe0f264[_0x9b0c('0x38')]=_0xe0f264[_0x9b0c('0x38')][_0x9b0c('0x39')]?_0xe0f264[_0x9b0c('0x38')]:_0xf04053[_0x9b0c('0x36')];if(!_0x5523e9['query'][_0x9b0c('0x3a')](_0x9b0c('0x3b'))){_0xe0f264['limit']=qs[_0x9b0c('0x1f')](_0x5523e9[_0x9b0c('0x33')][_0x9b0c('0x1f')]);_0xe0f264[_0x9b0c('0x1c')]=qs[_0x9b0c('0x1c')](_0x5523e9[_0x9b0c('0x33')][_0x9b0c('0x1c')]);}_0xe0f264[_0x9b0c('0x3c')]=qs[_0x9b0c('0x3d')](_0x5523e9[_0x9b0c('0x33')][_0x9b0c('0x3d')]);_0xe0f264[_0x9b0c('0x3e')]=qs[_0x9b0c('0x3f')](_[_0x9b0c('0x40')](_0x5523e9[_0x9b0c('0x33')],_0xf04053[_0x9b0c('0x3f')]),_0x35cf68);if(_0x5523e9['query'][_0x9b0c('0x41')]){_0xe0f264[_0x9b0c('0x3e')]=_[_0x9b0c('0x2a')](_0xe0f264[_0x9b0c('0x3e')],{'$or':_[_0x9b0c('0x2f')](_0x35cf68,function(_0x1106c7){if(_0x1106c7[_0x9b0c('0x42')]!==_0x9b0c('0x43')){var _0x4d3fa8={};_0x4d3fa8[_0x1106c7['name']]={'$like':'%'+_0x5523e9['query'][_0x9b0c('0x41')]+'%'};return _0x4d3fa8;}})});}_0xe0f264=_[_0x9b0c('0x2a')]({},_0xe0f264,_0x5523e9[_0x9b0c('0x44')]);var _0x1f34fc={'where':_0xe0f264[_0x9b0c('0x3e')]};return db[_0x9b0c('0x45')][_0x9b0c('0x1e')](_0x1f34fc)[_0x9b0c('0x25')](function(_0x2ce5b4){_0x57fa98[_0x9b0c('0x1e')]=_0x2ce5b4;if(_0x5523e9[_0x9b0c('0x33')][_0x9b0c('0x46')]){_0xe0f264[_0x9b0c('0x47')]=[{'all':!![]}];}return db[_0x9b0c('0x45')][_0x9b0c('0x48')](_0xe0f264);})[_0x9b0c('0x25')](function(_0x7200d1){_0x57fa98[_0x9b0c('0x49')]=_0x7200d1;return _0x57fa98;})['then'](respondWithFilteredResult(_0x17944c,_0xe0f264))[_0x9b0c('0x4a')](handleError(_0x17944c,null));};exports[_0x9b0c('0x4b')]=function(_0x4e875d,_0x150f76){var _0x22bafd={'raw':!![],'where':{'id':_0x4e875d[_0x9b0c('0x4c')]['id']}},_0x58aa62={};_0x58aa62['model']=_[_0x9b0c('0x34')](db[_0x9b0c('0x45')][_0x9b0c('0x30')]);_0x58aa62[_0x9b0c('0x33')]=_['keys'](_0x4e875d[_0x9b0c('0x33')]);_0x58aa62[_0x9b0c('0x3f')]=_[_0x9b0c('0x35')](_0x58aa62[_0x9b0c('0x36')],_0x58aa62['query']);_0x22bafd[_0x9b0c('0x38')]=_[_0x9b0c('0x35')](_0x58aa62['model'],qs['fields'](_0x4e875d[_0x9b0c('0x33')][_0x9b0c('0x37')]));_0x22bafd['attributes']=_0x22bafd[_0x9b0c('0x38')]['length']?_0x22bafd['attributes']:_0x58aa62[_0x9b0c('0x36')];if(_0x4e875d['query']['includeAll']){_0x22bafd[_0x9b0c('0x47')]=[{'all':!![]}];}_0x22bafd=_[_0x9b0c('0x2a')]({},_0x22bafd,_0x4e875d[_0x9b0c('0x44')]);return db['Attachment'][_0x9b0c('0x4d')](_0x22bafd)[_0x9b0c('0x25')](handleEntityNotFound(_0x150f76,null))[_0x9b0c('0x25')](respondWithResult(_0x150f76,null))[_0x9b0c('0x4a')](handleError(_0x150f76,null));};exports[_0x9b0c('0x4e')]=function(_0x32f182,_0x943409){var _0x53d8b9={'where':{'id':_0x32f182[_0x9b0c('0x4c')]['id']}},_0x26b3b2={};_0x26b3b2[_0x9b0c('0x36')]=_['keys'](db['Attachment'][_0x9b0c('0x30')]);_0x53d8b9[_0x9b0c('0x38')]=_[_0x9b0c('0x35')](_0x26b3b2[_0x9b0c('0x36')],qs[_0x9b0c('0x37')](_0x32f182[_0x9b0c('0x33')]['fields']));_0x53d8b9['attributes']=_0x53d8b9[_0x9b0c('0x38')][_0x9b0c('0x39')]?_0x53d8b9[_0x9b0c('0x38')]:_0x26b3b2['model'];if(_0x32f182[_0x9b0c('0x33')][_0x9b0c('0x46')]){_0x53d8b9[_0x9b0c('0x47')]=[{'all':!![]}];}_0x53d8b9=_[_0x9b0c('0x2a')]({},_0x53d8b9,_0x32f182['options']);return db[_0x9b0c('0x45')][_0x9b0c('0x4d')](_0x53d8b9)['then'](handleEntityNotFound(_0x943409,null))[_0x9b0c('0x25')](function(_0x3ebfe3){if(_0x3ebfe3){var _0x4f453e=_0x3ebfe3['get']({'plain':!![]});_0x4f453e=qs['omit'](_0x4f453e,['id',_0x9b0c('0x4f'),_0x9b0c('0x50')]);_0x32f182[_0x9b0c('0x51')]=_[_0x9b0c('0x52')](_0x32f182[_0x9b0c('0x51')],['id',_0x9b0c('0x4f'),'updatedAt']);return db[_0x9b0c('0x45')][_0x9b0c('0x53')](_[_0x9b0c('0x2a')](_0x4f453e,_0x32f182[_0x9b0c('0x51')]),{'include':_0x32f182[_0x9b0c('0x33')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x9b0c('0x25')](respondWithResult(_0x943409,0xc9))[_0x9b0c('0x4a')](handleError(_0x943409,null));};exports[_0x9b0c('0x23')]=function(_0x1cdf60,_0x4a2c5b){if(_0x1cdf60['body']['id']){delete _0x1cdf60[_0x9b0c('0x51')]['id'];}return db[_0x9b0c('0x45')]['find']({'where':{'id':_0x1cdf60[_0x9b0c('0x4c')]['id']}})[_0x9b0c('0x25')](handleEntityNotFound(_0x4a2c5b,null))[_0x9b0c('0x25')](saveUpdates(_0x1cdf60['body'],null))['then'](respondWithResult(_0x4a2c5b,null))[_0x9b0c('0x4a')](handleError(_0x4a2c5b,null));};exports['destroy']=function(_0x2f1222,_0x2e431b){return db[_0x9b0c('0x45')][_0x9b0c('0x4d')]({'where':{'id':_0x2f1222[_0x9b0c('0x4c')]['id']}})[_0x9b0c('0x25')](handleEntityNotFound(_0x2e431b,null))[_0x9b0c('0x25')](removeEntity(_0x2e431b,null))['catch'](handleError(_0x2e431b,null));};exports['create']=function(_0x2a4572,_0x15304f,_0x4ed4c6){_0x2a4572['body'][_0x9b0c('0x27')]=_0x2a4572[_0x9b0c('0x54')]['originalname'];_0x2a4572[_0x9b0c('0x51')][_0x9b0c('0x55')]=_0x2a4572[_0x9b0c('0x54')][_0x9b0c('0x56')];_0x2a4572[_0x9b0c('0x51')][_0x9b0c('0x42')]=_0x2a4572[_0x9b0c('0x54')][_0x9b0c('0x57')];return db[_0x9b0c('0x45')][_0x9b0c('0x53')](_0x2a4572[_0x9b0c('0x51')])[_0x9b0c('0x25')](respondWithResult(_0x15304f,0xc9))['catch'](handleError(_0x15304f,null));};exports[_0x9b0c('0x58')]=function(_0x43ab96,_0x154995,_0x557060){return db[_0x9b0c('0x45')]['findOne']({'where':{'id':_0x43ab96[_0x9b0c('0x4c')]['id']},'raw':!![]})[_0x9b0c('0x25')](handleEntityNotFound(_0x154995,null))[_0x9b0c('0x25')](function(_0x586b34){if(_0x586b34){var _0xdc05fc=_0x586b34['ChatOfflineMessageId']!==null;var _0x1aa352=path[_0x9b0c('0x59')](config[_0x9b0c('0x5a')],_0x9b0c('0x5b'));if(_0xdc05fc){_0x1aa352=path[_0x9b0c('0x59')](_0x1aa352,_0x9b0c('0x5c'));}var _0x452dfc=path[_0x9b0c('0x59')](_0x1aa352,_0x586b34['basename']);return _0x154995[_0x9b0c('0x58')](_0x452dfc);}})[_0x9b0c('0x4a')](handleError(_0x154995,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 3c7f85b..1c7e3af 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 _0xbb35=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','util'];(function(_0x1677b6,_0x410aa6){var _0x1ff2ce=function(_0xba5d2d){while(--_0xba5d2d){_0x1677b6['push'](_0x1677b6['shift']());}};_0x1ff2ce(++_0x410aa6);}(_0xbb35,0x1d3));var _0x5bb3=function(_0x737577,_0x2fdccf){_0x737577=_0x737577-0x0;var _0xc7b83b=_0xbb35[_0x737577];return _0xc7b83b;};'use strict';var _=require('lodash');var util=require(_0x5bb3('0x0'));var logger=require(_0x5bb3('0x1'))(_0x5bb3('0x2'));var moment=require(_0x5bb3('0x3'));var BPromise=require(_0x5bb3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5bb3('0x5'));var rimraf=require(_0x5bb3('0x6'));var config=require(_0x5bb3('0x7'));var attributes=require(_0x5bb3('0x8'));module[_0x5bb3('0x9')]=function(_0x321535,_0x46ef03){return _0x321535[_0x5bb3('0xa')](_0x5bb3('0xb'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xefda=['../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','api','moment','request-promise','path','rimraf'];(function(_0x1f5837,_0xf8895f){var _0x1c2a7c=function(_0x18dc6a){while(--_0x18dc6a){_0x1f5837['push'](_0x1f5837['shift']());}};_0x1c2a7c(++_0xf8895f);}(_0xefda,0x96));var _0xaefd=function(_0x5242fa,_0x3efff5){_0x5242fa=_0x5242fa-0x0;var _0x1a1376=_0xefda[_0x5242fa];return _0x1a1376;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaefd('0x1'));var moment=require(_0xaefd('0x2'));var BPromise=require('bluebird');var rp=require(_0xaefd('0x3'));var fs=require('fs');var path=require(_0xaefd('0x4'));var rimraf=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var attributes=require(_0xaefd('0x7'));module[_0xaefd('0x8')]=function(_0x497258,_0x3677ea){return _0x497258[_0xaefd('0x9')](_0xaefd('0xa'),attributes,{'tableName':_0xaefd('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 5e56877..7efc319 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 _0xb75b=['../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateAttachment','Attachment','body','options','raw','util','moment','randomstring','ioredis'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xb75b,0x191));var _0xbb75=function(_0x3edf31,_0x5abfc0){_0x3edf31=_0x3edf31-0x0;var _0x37d919=_0xb75b[_0x3edf31];return _0x37d919;};'use strict';var _=require('lodash');var util=require(_0xbb75('0x0'));var moment=require(_0xbb75('0x1'));var BPromise=require('bluebird');var rs=require(_0xbb75('0x2'));var fs=require('fs');var Redis=require(_0xbb75('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb75('0x4'));var logger=require(_0xbb75('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbb75('0x6'));var client=jayson[_0xbb75('0x7')][_0xbb75('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x255829,_0x43f6fa,_0x49a757){return new BPromise(function(_0xd6d99e,_0x94734c){return client[_0xbb75('0x9')](_0x255829,_0x49a757)[_0xbb75('0xa')](function(_0x578005){logger[_0xbb75('0xb')](_0xbb75('0xc'),_0x43f6fa,'request\x20sent');logger[_0xbb75('0xd')](_0xbb75('0xe'),_0x43f6fa,_0xbb75('0xf'),JSON[_0xbb75('0x10')](_0x578005));if(_0x578005[_0xbb75('0x11')]){if(_0x578005[_0xbb75('0x11')][_0xbb75('0x12')]===0x1f4){logger[_0xbb75('0x11')]('Attachment,\x20%s,\x20%s',_0x43f6fa,_0x578005[_0xbb75('0x11')]['message']);return _0x94734c(_0x578005['error'][_0xbb75('0x13')]);}logger[_0xbb75('0x11')](_0xbb75('0xc'),_0x43f6fa,_0x578005[_0xbb75('0x11')]['message']);return _0xd6d99e(_0x578005[_0xbb75('0x11')]['message']);}else{logger[_0xbb75('0xb')]('Attachment,\x20%s,\x20%s',_0x43f6fa,'request\x20sent');_0xd6d99e(_0x578005[_0xbb75('0x14')][_0xbb75('0x13')]);}})[_0xbb75('0x15')](function(_0x4b3399){logger[_0xbb75('0x11')](_0xbb75('0xc'),_0x43f6fa,_0x4b3399);_0x94734c(_0x4b3399);});});}exports[_0xbb75('0x16')]=function(_0x1cb01b){var _0x4ecd83=this;return new Promise(function(_0x39de03,_0x306ca9){return db[_0xbb75('0x17')]['create'](_0x1cb01b[_0xbb75('0x18')],{'raw':_0x1cb01b[_0xbb75('0x19')]?_0x1cb01b[_0xbb75('0x19')][_0xbb75('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x2f588e){logger['info'](_0xbb75('0x16'),_0x1cb01b);logger[_0xbb75('0xd')](_0xbb75('0x16'),_0x1cb01b,JSON[_0xbb75('0x10')](_0x2f588e));_0x39de03(_0x2f588e);})[_0xbb75('0x15')](function(_0x976cad){logger[_0xbb75('0x11')](_0xbb75('0x16'),_0x976cad[_0xbb75('0x13')],_0x1cb01b);_0x306ca9(_0x4ecd83[_0xbb75('0x11')](0x1f4,_0x976cad[_0xbb75('0x13')]));});});};
\ No newline at end of file
+var _0x358e=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','Attachment','options','raw','CreateAttachment','stringify','lodash','moment','bluebird'];(function(_0x35ec0e,_0x29f53f){var _0x157ae4=function(_0x203bee){while(--_0x203bee){_0x35ec0e['push'](_0x35ec0e['shift']());}};_0x157ae4(++_0x29f53f);}(_0x358e,0xa5));var _0xe358=function(_0x2f23c6,_0x8eacbc){_0x2f23c6=_0x2f23c6-0x0;var _0x12e26a=_0x358e[_0x2f23c6];return _0x12e26a;};'use strict';var _=require(_0xe358('0x0'));var util=require('util');var moment=require(_0xe358('0x1'));var BPromise=require(_0xe358('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe358('0x3'));var db=require(_0xe358('0x4'))['db'];var utils=require(_0xe358('0x5'));var logger=require('../../config/logger')(_0xe358('0x6'));var config=require(_0xe358('0x7'));var jayson=require(_0xe358('0x8'));var client=jayson[_0xe358('0x9')][_0xe358('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a4c47,_0x3fb916,_0x48d8b8){return new BPromise(function(_0x59f89f,_0x7291b2){return client[_0xe358('0xb')](_0x5a4c47,_0x48d8b8)[_0xe358('0xc')](function(_0x1b1147){logger['info'](_0xe358('0xd'),_0x3fb916,_0xe358('0xe'));logger[_0xe358('0xf')](_0xe358('0x10'),_0x3fb916,_0xe358('0xe'),JSON['stringify'](_0x1b1147));if(_0x1b1147[_0xe358('0x11')]){if(_0x1b1147[_0xe358('0x11')][_0xe358('0x12')]===0x1f4){logger[_0xe358('0x11')](_0xe358('0xd'),_0x3fb916,_0x1b1147[_0xe358('0x11')][_0xe358('0x13')]);return _0x7291b2(_0x1b1147[_0xe358('0x11')][_0xe358('0x13')]);}logger[_0xe358('0x11')](_0xe358('0xd'),_0x3fb916,_0x1b1147[_0xe358('0x11')][_0xe358('0x13')]);return _0x59f89f(_0x1b1147[_0xe358('0x11')][_0xe358('0x13')]);}else{logger[_0xe358('0x14')]('Attachment,\x20%s,\x20%s',_0x3fb916,'request\x20sent');_0x59f89f(_0x1b1147[_0xe358('0x15')][_0xe358('0x13')]);}})[_0xe358('0x16')](function(_0x8bee2c){logger[_0xe358('0x11')]('Attachment,\x20%s,\x20%s',_0x3fb916,_0x8bee2c);_0x7291b2(_0x8bee2c);});});}exports['CreateAttachment']=function(_0x181d0b){var _0x27cd85=this;return new Promise(function(_0xb27463,_0x32a2b6){return db[_0xe358('0x17')]['create'](_0x181d0b['body'],{'raw':_0x181d0b[_0xe358('0x18')]?_0x181d0b['options'][_0xe358('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x12f918){logger[_0xe358('0x14')](_0xe358('0x1a'),_0x181d0b);logger[_0xe358('0xf')](_0xe358('0x1a'),_0x181d0b,JSON[_0xe358('0x1b')](_0x12f918));_0xb27463(_0x12f918);})['catch'](function(_0x41ecab){logger['error'](_0xe358('0x1a'),_0x41ecab['message'],_0x181d0b);_0x32a2b6(_0x27cd85[_0xe358('0x11')](0x1f4,_0x41ecab[_0xe358('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 57da883..76836ba 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 _0x536f=['multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./attachment.controller','isAuthenticated','index','get','show','/:id/download','/:id/clone','join','root','format','%s-%s','now','originalname','replace','post','single','file','create','put','/:id','update','destroy','exports'];(function(_0x409675,_0x66199f){var _0x26aab0=function(_0x4247de){while(--_0x4247de){_0x409675['push'](_0x409675['shift']());}};_0x26aab0(++_0x66199f);}(_0x536f,0x70));var _0xf536=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x536f[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xf536('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf536('0x1')]();var fs_extra=require(_0xf536('0x2'));var auth=require(_0xf536('0x3'));var interaction=require(_0xf536('0x4'));var config=require('../../config/environment');var controller=require(_0xf536('0x5'));router['get']('/',auth[_0xf536('0x6')](),controller[_0xf536('0x7')]);router[_0xf536('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xf536('0x9')]);router[_0xf536('0x8')](_0xf536('0xa'),auth[_0xf536('0x6')](),controller['download']);router['post'](_0xf536('0xb'),auth[_0xf536('0x6')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3c811b,_0x3ac49c,_0x16c1ae){_0x16c1ae(null,path[_0xf536('0xc')](config[_0xf536('0xd')],'server/files/attachments/'));},'filename':function(_0x398700,_0x539d44,_0x146970){_0x146970(null,util[_0xf536('0xe')](_0xf536('0xf'),Date[_0xf536('0x10')](),_0x539d44[_0xf536('0x11')][_0xf536('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf536('0x13')]('/',upload[_0xf536('0x14')](_0xf536('0x15')),controller[_0xf536('0x16')]);router[_0xf536('0x17')](_0xf536('0x18'),auth['isAuthenticated'](),controller[_0xf536('0x19')]);router['delete'](_0xf536('0x18'),auth['isAuthenticated'](),controller[_0xf536('0x1a')]);module[_0xf536('0x1b')]=router;
\ No newline at end of file
+var _0xaa5e=['get','isAuthenticated','/:id','/:id/download','download','/:id/clone','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','single','create','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./attachment.controller'];(function(_0x57a145,_0x5e58a9){var _0x2305de=function(_0x348b4f){while(--_0x348b4f){_0x57a145['push'](_0x57a145['shift']());}};_0x2305de(++_0x5e58a9);}(_0xaa5e,0xa5));var _0xeaa5=function(_0x37894d,_0x33c763){_0x37894d=_0x37894d-0x0;var _0x44d09e=_0xaa5e[_0x37894d];return _0x44d09e;};'use strict';var multer=require(_0xeaa5('0x0'));var util=require(_0xeaa5('0x1'));var path=require('path');var timeout=require(_0xeaa5('0x2'));var express=require(_0xeaa5('0x3'));var router=express[_0xeaa5('0x4')]();var fs_extra=require(_0xeaa5('0x5'));var auth=require(_0xeaa5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xeaa5('0x7'));var controller=require(_0xeaa5('0x8'));router[_0xeaa5('0x9')]('/',auth[_0xeaa5('0xa')](),controller['index']);router['get'](_0xeaa5('0xb'),auth[_0xeaa5('0xa')](),controller['show']);router[_0xeaa5('0x9')](_0xeaa5('0xc'),auth['isAuthenticated'](),controller[_0xeaa5('0xd')]);router['post'](_0xeaa5('0xe'),auth[_0xeaa5('0xa')](),controller['clone']);var upload=multer({'storage':multer[_0xeaa5('0xf')]({'destination':function(_0x299f44,_0x140a6a,_0x46806d){_0x46806d(null,path[_0xeaa5('0x10')](config[_0xeaa5('0x11')],_0xeaa5('0x12')));},'filename':function(_0x2c3561,_0x123d6e,_0x47a779){_0x47a779(null,util[_0xeaa5('0x13')](_0xeaa5('0x14'),Date[_0xeaa5('0x15')](),_0x123d6e[_0xeaa5('0x16')][_0xeaa5('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/',upload[_0xeaa5('0x18')]('file'),controller[_0xeaa5('0x19')]);router[_0xeaa5('0x1a')](_0xeaa5('0xb'),auth['isAuthenticated'](),controller[_0xeaa5('0x1b')]);router['delete'](_0xeaa5('0xb'),auth[_0xeaa5('0xa')](),controller[_0xeaa5('0x1c')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 5b37cfe..5f4f9d6 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 _0x6f8b=['getLicense','catch','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','google','/login','email','callback','authenticate','use','clientSecret','secret','Setting','allowedLoginAttempts','blockDuration','then','User','find','map','emails','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes'];(function(_0x1eb6cc,_0x165c4f){var _0xbeacea=function(_0x104568){while(--_0x104568){_0x1eb6cc['push'](_0x1eb6cc['shift']());}};_0xbeacea(++_0x165c4f);}(_0x6f8b,0x1be));var _0xb6f8=function(_0x39f42a,_0x3c68dc){_0x39f42a=_0x39f42a-0x0;var _0x44a41d=_0x6f8b[_0x39f42a];return _0x44a41d;};'use strict';var _=require('lodash');var passport=require(_0xb6f8('0x0'));var GoogleStrategy=require(_0xb6f8('0x1'))[_0xb6f8('0x2')];var moment=require(_0xb6f8('0x3'));var db=require(_0xb6f8('0x4'))['db'];var config=require(_0xb6f8('0x5'));var signToken=require(_0xb6f8('0x6'))[_0xb6f8('0x7')];var utils=require(_0xb6f8('0x8'));exports[_0xb6f8('0x9')]=passport['authenticate'](_0xb6f8('0xa'),{'failureRedirect':_0xb6f8('0xb'),'scope':['profile',_0xb6f8('0xc')],'session':![]});exports[_0xb6f8('0xd')]=passport[_0xb6f8('0xe')]('google',{'failureRedirect':'/login','session':![]});passport[_0xb6f8('0xf')](new GoogleStrategy({'clientID':config[_0xb6f8('0xa')]?config[_0xb6f8('0xa')]['clientID']:'id','clientSecret':config[_0xb6f8('0xa')]?config[_0xb6f8('0xa')][_0xb6f8('0x10')]:_0xb6f8('0x11'),'callbackURL':config[_0xb6f8('0xa')]?config[_0xb6f8('0xa')]['callbackURL']:''},function(_0x10ed95,_0xedbb6f,_0x1a109f,_0x69329e){var _0x7133e2,_0x17f09b;return db[_0xb6f8('0x12')]['findOne']({'where':{'id':0x1},'attributes':[_0xb6f8('0x13'),_0xb6f8('0x14')],'raw':!![]})[_0xb6f8('0x15')](function(_0x1c67e4){_0x7133e2=_0x1c67e4;return db[_0xb6f8('0x16')][_0xb6f8('0x17')]({'where':{'email':_[_0xb6f8('0x18')](_0x1a109f[_0xb6f8('0x19')],_0xb6f8('0x1a')),'role':{'$or':[_0xb6f8('0x1b'),_0xb6f8('0x1c'),_0xb6f8('0x1d')]}}});})[_0xb6f8('0x15')](function(_0x5ce62f){_0x17f09b=_0x5ce62f;if(_0x17f09b){if(_0x17f09b['disabled']){return _0x69329e(_0xb6f8('0x1e'));}else if(_0x7133e2[_0xb6f8('0x14')]>0x0){if(_0x17f09b[_0xb6f8('0x1f')]){if(moment(_0x17f09b[_0xb6f8('0x20')])[_0xb6f8('0x21')](_0x7133e2[_0xb6f8('0x14')],_0xb6f8('0x22'))>moment()){return _0x69329e(_0xb6f8('0x1e'));}else{return utils['clearBlockUser'](_0x17f09b,0x0,![],null)[_0xb6f8('0x15')](function(){return utils[_0xb6f8('0x23')](_0x17f09b);})['then'](function(){return _0x69329e(null,_0x17f09b);});}}else{return utils[_0xb6f8('0x23')](_0x17f09b)['then'](function(){return _0x69329e(null,_0x17f09b);});}}else{return utils[_0xb6f8('0x23')](_0x17f09b)[_0xb6f8('0x15')](function(){return _0x69329e(null,_0x17f09b);});}}return _0x69329e(_0xb6f8('0x1e'));})[_0xb6f8('0x24')](function(_0xdeece1){_0x69329e(_0xdeece1);});}));
\ No newline at end of file
+var _0x1af6=['value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','minutes','clearBlockUser','getLicense','catch','lodash','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','../../config/utils','authenticate','google','/login','profile','email','clientID','clientSecret','secret','callbackURL','Setting','allowedLoginAttempts','blockDuration','then','User','find','map'];(function(_0x3ec0e8,_0x485a9d){var _0x26fd54=function(_0x4df6a5){while(--_0x4df6a5){_0x3ec0e8['push'](_0x3ec0e8['shift']());}};_0x26fd54(++_0x485a9d);}(_0x1af6,0xd8));var _0x61af=function(_0x55b986,_0x24d086){_0x55b986=_0x55b986-0x0;var _0x1722af=_0x1af6[_0x55b986];return _0x1722af;};'use strict';var _=require(_0x61af('0x0'));var passport=require('passport');var GoogleStrategy=require('passport-google-oauth20')[_0x61af('0x1')];var moment=require('moment');var db=require(_0x61af('0x2'))['db'];var config=require(_0x61af('0x3'));var signToken=require(_0x61af('0x4'))['signToken'];var utils=require(_0x61af('0x5'));exports['login']=passport[_0x61af('0x6')](_0x61af('0x7'),{'failureRedirect':_0x61af('0x8'),'scope':[_0x61af('0x9'),_0x61af('0xa')],'session':![]});exports['callback']=passport[_0x61af('0x6')](_0x61af('0x7'),{'failureRedirect':'/login','session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x61af('0x7')]?config[_0x61af('0x7')][_0x61af('0xb')]:'id','clientSecret':config['google']?config[_0x61af('0x7')][_0x61af('0xc')]:_0x61af('0xd'),'callbackURL':config[_0x61af('0x7')]?config[_0x61af('0x7')][_0x61af('0xe')]:''},function(_0x542e8f,_0x103573,_0x4c0882,_0x5e9fcc){var _0x2f6b56,_0x48ccfb;return db[_0x61af('0xf')]['findOne']({'where':{'id':0x1},'attributes':[_0x61af('0x10'),_0x61af('0x11')],'raw':!![]})[_0x61af('0x12')](function(_0x450239){_0x2f6b56=_0x450239;return db[_0x61af('0x13')][_0x61af('0x14')]({'where':{'email':_[_0x61af('0x15')](_0x4c0882['emails'],_0x61af('0x16')),'role':{'$or':[_0x61af('0x17'),_0x61af('0x18'),_0x61af('0x19')]}}});})[_0x61af('0x12')](function(_0x36562c){_0x48ccfb=_0x36562c;if(_0x48ccfb){if(_0x48ccfb[_0x61af('0x1a')]){return _0x5e9fcc(_0x61af('0x1b'));}else if(_0x2f6b56[_0x61af('0x11')]>0x0){if(_0x48ccfb[_0x61af('0x1c')]){if(moment(_0x48ccfb[_0x61af('0x1d')])['add'](_0x2f6b56[_0x61af('0x11')],_0x61af('0x1e'))>moment()){return _0x5e9fcc(_0x61af('0x1b'));}else{return utils[_0x61af('0x1f')](_0x48ccfb,0x0,![],null)[_0x61af('0x12')](function(){return utils[_0x61af('0x20')](_0x48ccfb);})[_0x61af('0x12')](function(){return _0x5e9fcc(null,_0x48ccfb);});}}else{return utils[_0x61af('0x20')](_0x48ccfb)['then'](function(){return _0x5e9fcc(null,_0x48ccfb);});}}else{return utils['getLicense'](_0x48ccfb)[_0x61af('0x12')](function(){return _0x5e9fcc(null,_0x48ccfb);});}}return _0x5e9fcc(_0x61af('0x1b'));})[_0x61af('0x21')](function(_0x28e1ab){_0x5e9fcc(_0x28e1ab);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 57aa3d9..545ceba 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 _0x3ae9=['isMiddleware','setTokenCookie','exports','Router','./authGoogle.controller','../user/user.controller.js','get','login','/callback'];(function(_0x20aad0,_0x41a776){var _0x2a21ad=function(_0x4b7236){while(--_0x4b7236){_0x20aad0['push'](_0x20aad0['shift']());}};_0x2a21ad(++_0x41a776);}(_0x3ae9,0xdb));var _0x93ae=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x3ae9[_0x580576];return _0x3f55a0;};'use strict';var express=require('express');var passport=require('passport');var router=express[_0x93ae('0x0')]();var controller=require(_0x93ae('0x1'));var userController=require(_0x93ae('0x2'));var authService=require('../../components/auth/service');router[_0x93ae('0x3')]('/',controller[_0x93ae('0x4')]);router[_0x93ae('0x3')](_0x93ae('0x5'),controller['callback'],authService[_0x93ae('0x6')],userController['login'],authService[_0x93ae('0x7')]);module[_0x93ae('0x8')]=router;
\ No newline at end of file
+var _0xde56=['express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports'];(function(_0x2da363,_0x4758c8){var _0x18c022=function(_0x3755e2){while(--_0x3755e2){_0x2da363['push'](_0x2da363['shift']());}};_0x18c022(++_0x4758c8);}(_0xde56,0x144));var _0x6de5=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xde56[_0x500419];return _0x241c1a;};'use strict';var express=require(_0x6de5('0x0'));var passport=require('passport');var router=express[_0x6de5('0x1')]();var controller=require(_0x6de5('0x2'));var userController=require(_0x6de5('0x3'));var authService=require(_0x6de5('0x4'));router[_0x6de5('0x5')]('/',controller[_0x6de5('0x6')]);router[_0x6de5('0x5')](_0x6de5('0x7'),controller[_0x6de5('0x8')],authService[_0x6de5('0x9')],userController['login'],authService[_0x6de5('0xa')]);module[_0x6de5('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 45e4b0c..56e9577 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 _0x33af=['allowedLoginAttempts','blockDuration','then','salt','role','disabled','blocked','blockedAt','admin','user','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','pass','\x22%s\x22\x20<%s>','request','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','local','online','forgot','body','Email\x20parameter\x20is\x20missing','trim','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','password','validatePasswordHistory','Password\x20reset!','use','passport','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils','client','findOne'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x33af,0xec));var _0xf33a=function(_0x2d2153,_0x4509d6){_0x2d2153=_0x2d2153-0x0;var _0x20299e=_0x33af[_0x2d2153];return _0x20299e;};'use strict';var util=require('util');var passport=require(_0xf33a('0x0'));var LocalStrategy=require('passport-local')[_0xf33a('0x1')];var jayson=require(_0xf33a('0x2'));var _=require(_0xf33a('0x3'));var rs=require(_0xf33a('0x4'));var moment=require(_0xf33a('0x5'));var db=require(_0xf33a('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xf33a('0x7'));var client=jayson[_0xf33a('0x8')]['http']({'port':0x232b});function localAuthenticate(_0xc0dd13,_0x384b14,_0x1b2b01,_0x2f3730){var _0x2baabb,_0x2cb169;return db['Setting'][_0xf33a('0x9')]({'where':{'id':0x1},'attributes':[_0xf33a('0xa'),_0xf33a('0xb')],'raw':!![]})[_0xf33a('0xc')](function(_0x44ee7f){_0x2baabb=_0x44ee7f;return _0xc0dd13[_0xf33a('0x9')]({'attributes':['id','name','password',_0xf33a('0xd'),_0xf33a('0xe'),_0xf33a('0xf'),_0xf33a('0x10'),_0xf33a('0x11'),'loginAttempts'],'where':{'name':_0x384b14,'role':{'$or':[_0xf33a('0x12'),_0xf33a('0x13'),'agent']}}});})['then'](function(_0x374b01){if(!_0x374b01||_0x374b01&&_0x374b01[_0xf33a('0x14')]!==_0x384b14){throw new Error(_0xf33a('0x15'));}else{_0x2cb169=_0x374b01;return _0x2cb169;}})[_0xf33a('0xc')](function(){_0x2cb169[_0xf33a('0x16')](_0x1b2b01,function(_0xc01217,_0x45e311){var _0x1f2b1b=_0x2cb169['loginAttempts']+0x1;if(_0xc01217){return _0x2f3730(_0xc01217);}else if(!_0x45e311){if(_0x2cb169[_0xf33a('0xf')]){return _0x2f3730(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2baabb[_0xf33a('0xa')]>0x0){if(_0x2cb169[_0xf33a('0x10')]){if(_0x2baabb['blockDuration']>0x0){if(moment(_0x2cb169[_0xf33a('0x11')])[_0xf33a('0x17')](_0x2baabb['blockDuration'],_0xf33a('0x18'))>moment()){return _0x2f3730(null,![],{'message':_0xf33a('0x15')});}else{return utils[_0xf33a('0x19')](_0x2cb169,_0x1f2b1b,![],null)[_0xf33a('0xc')](function(){return _0x2f3730(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x2f3730(null,![],{'message':_0xf33a('0x15')});}}else{if(_0x1f2b1b>=_0x2baabb[_0xf33a('0xa')]){return utils[_0xf33a('0x19')](_0x2cb169,0x0,!![],moment())[_0xf33a('0xc')](function(){return _0x2f3730(null,![],{'message':_0xf33a('0x15')});});}else{return utils[_0xf33a('0x19')](_0x2cb169,_0x1f2b1b,![],null)[_0xf33a('0xc')](function(){return _0x2f3730(null,![],{'message':_0xf33a('0x15')});});}}}else{return _0x2f3730(null,![],{'message':_0xf33a('0x15')});}}else{if(_0x2cb169[_0xf33a('0xf')]){return _0x2f3730(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2baabb[_0xf33a('0xa')]>0x0){if(_0x2cb169[_0xf33a('0x10')]){if(_0x2baabb[_0xf33a('0xb')]>0x0){if(moment(_0x2cb169[_0xf33a('0x11')])[_0xf33a('0x17')](_0x2baabb['blockDuration'],_0xf33a('0x18'))>moment()){return _0x2f3730(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xf33a('0x19')](_0x2cb169,0x0,![],null)[_0xf33a('0xc')](function(){return utils[_0xf33a('0x1a')](_0x2cb169);})[_0xf33a('0xc')](function(){return _0x2f3730(null,_0x2cb169);});}}else{return _0x2f3730(null,![],{'message':_0xf33a('0x15')});}}else{return utils['clearBlockUser'](_0x2cb169,0x0,![],null)[_0xf33a('0xc')](function(){return utils[_0xf33a('0x1a')](_0x2cb169);})['then'](function(){return _0x2f3730(null,_0x2cb169);})['catch'](function(_0x16ef31){return _0x2f3730(null,![],_0x16ef31);});}}else{if(_0x2cb169['blocked']){return _0x2f3730(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xf33a('0x1a')](_0x2cb169)['then'](function(){return _0x2f3730(null,_0x2cb169);});}}}});})[_0xf33a('0x1b')](function(_0x553480){return _0x2f3730(null,![],_0x553480);});}function sendServiceMail(_0x331115){return db[_0xf33a('0x1c')][_0xf33a('0x1d')]({'where':{'service':!![]},'attributes':['id',_0xf33a('0x14'),_0xf33a('0x1e')],'include':[{'model':db[_0xf33a('0x1f')],'as':_0xf33a('0x20')}]})[_0xf33a('0xc')](function(_0x26e81){if(!_0x26e81){throw new Error(_0xf33a('0x21'));}var _0x77b7c1={'tls':{'rejectUnauthorized':![]}};if(_0x26e81[_0xf33a('0x20')][_0xf33a('0x22')]){_0x77b7c1[_0xf33a('0x22')]=_0x26e81[_0xf33a('0x20')]['service'];}else{_0x77b7c1[_0xf33a('0x23')]=_0x26e81[_0xf33a('0x20')][_0xf33a('0x23')];_0x77b7c1[_0xf33a('0x24')]=_0x26e81['Smtp'][_0xf33a('0x24')];_0x77b7c1[_0xf33a('0x25')]=_0x26e81[_0xf33a('0x20')][_0xf33a('0x25')];}if(_0x26e81[_0xf33a('0x20')][_0xf33a('0x26')]){_0x77b7c1['auth']={'user':_0x26e81[_0xf33a('0x20')][_0xf33a('0x13')],'pass':_0x26e81[_0xf33a('0x20')][_0xf33a('0x27')]};}var _0x2036f2={'account':_0x77b7c1,'message':_['merge']({'from':util['format'](_0xf33a('0x28'),_0x26e81['name'],_0x26e81['email']||_0x26e81['Smtp'][_0xf33a('0x13')])},_0x331115)};return client[_0xf33a('0x29')]('SendMail',_0x2036f2);})[_0xf33a('0xc')](function(_0x55f457){if(_0x55f457[_0xf33a('0x2a')]){throw new Error(util[_0xf33a('0x2b')](_0xf33a('0x2c'),_0x55f457[_0xf33a('0x2a')][_0xf33a('0x2d')]||JSON[_0xf33a('0x2e')](_0x55f457['error'])));}return!![];});}function handleError(_0x16ca8b,_0x29a39f,_0x5b8607){return _0x16ca8b[_0xf33a('0x2f')](_0x29a39f||0x1f4)[_0xf33a('0x30')]({'message':_0x5b8607?_0x5b8607[_0xf33a('0x2d')]||_0x5b8607:''});}exports['login']=function(_0x7a06e1,_0x1650c,_0x334bc4){passport[_0xf33a('0x16')](_0xf33a('0x31'),function(_0x7a6aa4,_0x1b4d59,_0x128baf){var _0xd488ef=_0x7a6aa4||_0x128baf;if(_0xd488ef){return handleError(_0x1650c,0x191,_0xd488ef);}if(!_0x1b4d59){return handleError(_0x1650c,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x31028b={'payload':{'id':_0x1b4d59['id'],'role':_0x1b4d59[_0xf33a('0xe')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x31028b)[_0xf33a('0xc')](function(_0x4c6906){_0x1650c['json']({'id':_0x1b4d59['id'],'token':_0x4c6906,'statusCall':'','isAlreadyLogged':_0x1b4d59[_0xf33a('0x32')]});});}})(_0x7a06e1,_0x1650c,_0x334bc4);};exports[_0xf33a('0x33')]=function(_0x4dada1,_0x1db810,_0x1e368f){if(!_0x4dada1[_0xf33a('0x34')]['email']){return handleError(_0x1db810,0x1f4,{'message':_0xf33a('0x35')});}var _0x21b8da=rs['generate']();_0x4dada1[_0xf33a('0x34')][_0xf33a('0x1e')]=_0x4dada1[_0xf33a('0x34')][_0xf33a('0x1e')][_0xf33a('0x36')]()['toLowerCase']();var _0x45ae15;return db[_0xf33a('0x37')][_0xf33a('0x9')]({'where':{'id':0x1},'attributes':[_0xf33a('0xa'),_0xf33a('0xb')],'raw':!![]})['then'](function(_0x175825){_0x45ae15=_0x175825;return db[_0xf33a('0x38')][_0xf33a('0x1d')]({'where':{'email':_0x4dada1['body'][_0xf33a('0x1e')]}});})[_0xf33a('0xc')](function(_0x428d75){if(!_0x428d75){throw new Error(_0xf33a('0x39'));}if(_0x428d75[_0xf33a('0xf')]){throw new Error(_0xf33a('0x3a'));}if(_0x428d75['blocked']){if(moment(_0x428d75[_0xf33a('0x11')])[_0xf33a('0x17')](_0x45ae15[_0xf33a('0xb')],_0xf33a('0x18'))>moment()){throw new Error(_0xf33a('0x3b'));}else{_0x428d75['blocked']=![];_0x428d75[_0xf33a('0x11')]=null;}}_0x428d75[_0xf33a('0x3c')]=_0x21b8da;_0x428d75[_0xf33a('0x3d')]=Date['now']()+0x36ee80;return _0x428d75[_0xf33a('0x3e')]();})[_0xf33a('0xc')](function(){return sendServiceMail({'to':_0x4dada1['body']['email'],'subject':_0xf33a('0x3f'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xf33a('0x40')+_0xf33a('0x41')+_0x4dada1[_0xf33a('0x42')][_0xf33a('0x23')]+_0xf33a('0x43')+_0x21b8da+'\x0a\x0a'+_0xf33a('0x44')});})[_0xf33a('0xc')](function(){_0x1db810[_0xf33a('0x2f')](0xc8)[_0xf33a('0x30')]({'message':_0xf33a('0x45')});})[_0xf33a('0x1b')](function(_0x4107b1){return handleError(_0x1db810,0x1f4,_0x4107b1);});};exports[_0xf33a('0x46')]=function(_0x6b79da,_0xdcb4f8,_0x1a8a4e){return db[_0xf33a('0x38')][_0xf33a('0x1d')]({'where':{'resetPasswordToken':_0x6b79da[_0xf33a('0x47')][_0xf33a('0x48')],'resetPasswordExpires':{'$gt':Date[_0xf33a('0x49')]()}}})[_0xf33a('0xc')](function(_0x3bafbf){if(!_0x3bafbf){throw new Error(_0xf33a('0x4a'));}return db[_0xf33a('0x37')][_0xf33a('0x9')]({'attributes':['id',_0xf33a('0x4b'),_0xf33a('0x4c'),_0xf33a('0x4d')]})['then'](function(_0x349d3f){if(_0x349d3f[_0xf33a('0x4b')])authService['validatePasswordPattern'](_0x6b79da[_0xf33a('0x34')][_0xf33a('0x4e')]);if(!_0x349d3f[_0xf33a('0x4c')]||!_0x3bafbf['previousPasswords'])return _0x3bafbf;authService[_0xf33a('0x4f')](_0x6b79da[_0xf33a('0x34')][_0xf33a('0x4e')],_0x3bafbf['previousPasswords'],_0x349d3f[_0xf33a('0x4d')]);return _0x3bafbf;})['then'](function(){_0x3bafbf[_0xf33a('0x4e')]=_0x6b79da[_0xf33a('0x34')]['password'];_0x3bafbf['resetPasswordToken']=null;_0x3bafbf[_0xf33a('0x3d')]=null;return _0x3bafbf[_0xf33a('0x3e')]();});})[_0xf33a('0xc')](function(){_0xdcb4f8['status'](0xc8)[_0xf33a('0x30')]({'message':_0xf33a('0x50')});})[_0xf33a('0x1b')](function(_0x24f373){return handleError(_0xdcb4f8,0x1f4,_0x24f373);});};passport[_0xf33a('0x51')](new LocalStrategy({'usernameField':_0xf33a('0x14'),'passwordField':_0xf33a('0x4e')},function(_0x5d66a4,_0xa858b4,_0x4fadba){return localAuthenticate(db['User'],_0x5d66a4,_0xa858b4,_0x4fadba);}));
\ No newline at end of file
+var _0xb091=['SendMail','error','stringify','status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','Email\x20parameter\x20is\x20missing','body','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','passwordHistoryLimit','securePassword','password','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','passport','passport-local','Strategy','jayson/promise','randomstring','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','salt','role','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','blocked','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','port','secure','authentication','auth','merge','format','request'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0xb091,0x16e));var _0x1b09=function(_0x3e743d,_0x1dc23f){_0x3e743d=_0x3e743d-0x0;var _0x242ddd=_0xb091[_0x3e743d];return _0x242ddd;};'use strict';var util=require('util');var passport=require(_0x1b09('0x0'));var LocalStrategy=require(_0x1b09('0x1'))[_0x1b09('0x2')];var jayson=require(_0x1b09('0x3'));var _=require('lodash');var rs=require(_0x1b09('0x4'));var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0x1b09('0x5'));var utils=require(_0x1b09('0x6'));var client=jayson['client'][_0x1b09('0x7')]({'port':0x232b});function localAuthenticate(_0x5fa348,_0x2bf4f6,_0x5ce726,_0x142c33){var _0x8c26a5,_0x2f359f;return db[_0x1b09('0x8')][_0x1b09('0x9')]({'where':{'id':0x1},'attributes':[_0x1b09('0xa'),_0x1b09('0xb')],'raw':!![]})[_0x1b09('0xc')](function(_0x3249a1){_0x8c26a5=_0x3249a1;return _0x5fa348[_0x1b09('0x9')]({'attributes':['id',_0x1b09('0xd'),'password',_0x1b09('0xe'),_0x1b09('0xf'),'disabled','blocked',_0x1b09('0x10'),_0x1b09('0x11')],'where':{'name':_0x2bf4f6,'role':{'$or':[_0x1b09('0x12'),_0x1b09('0x13'),_0x1b09('0x14')]}}});})[_0x1b09('0xc')](function(_0x1fd3bc){if(!_0x1fd3bc||_0x1fd3bc&&_0x1fd3bc['name']!==_0x2bf4f6){throw new Error(_0x1b09('0x15'));}else{_0x2f359f=_0x1fd3bc;return _0x2f359f;}})['then'](function(){_0x2f359f[_0x1b09('0x16')](_0x5ce726,function(_0x27a731,_0x11ab46){var _0x37673e=_0x2f359f[_0x1b09('0x11')]+0x1;if(_0x27a731){return _0x142c33(_0x27a731);}else if(!_0x11ab46){if(_0x2f359f[_0x1b09('0x17')]){return _0x142c33(null,![],{'message':_0x1b09('0x15')});}else if(_0x8c26a5[_0x1b09('0xa')]>0x0){if(_0x2f359f[_0x1b09('0x18')]){if(_0x8c26a5[_0x1b09('0xb')]>0x0){if(moment(_0x2f359f[_0x1b09('0x10')])[_0x1b09('0x19')](_0x8c26a5[_0x1b09('0xb')],'minutes')>moment()){return _0x142c33(null,![],{'message':_0x1b09('0x15')});}else{return utils[_0x1b09('0x1a')](_0x2f359f,_0x37673e,![],null)['then'](function(){return _0x142c33(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x142c33(null,![],{'message':_0x1b09('0x15')});}}else{if(_0x37673e>=_0x8c26a5['allowedLoginAttempts']){return utils[_0x1b09('0x1a')](_0x2f359f,0x0,!![],moment())['then'](function(){return _0x142c33(null,![],{'message':_0x1b09('0x15')});});}else{return utils[_0x1b09('0x1a')](_0x2f359f,_0x37673e,![],null)[_0x1b09('0xc')](function(){return _0x142c33(null,![],{'message':_0x1b09('0x15')});});}}}else{return _0x142c33(null,![],{'message':_0x1b09('0x15')});}}else{if(_0x2f359f[_0x1b09('0x17')]){return _0x142c33(null,![],{'message':_0x1b09('0x15')});}else if(_0x8c26a5[_0x1b09('0xa')]>0x0){if(_0x2f359f['blocked']){if(_0x8c26a5['blockDuration']>0x0){if(moment(_0x2f359f[_0x1b09('0x10')])[_0x1b09('0x19')](_0x8c26a5['blockDuration'],_0x1b09('0x1b'))>moment()){return _0x142c33(null,![],{'message':_0x1b09('0x15')});}else{return utils[_0x1b09('0x1a')](_0x2f359f,0x0,![],null)[_0x1b09('0xc')](function(){return utils['getLicense'](_0x2f359f);})[_0x1b09('0xc')](function(){return _0x142c33(null,_0x2f359f);});}}else{return _0x142c33(null,![],{'message':_0x1b09('0x15')});}}else{return utils['clearBlockUser'](_0x2f359f,0x0,![],null)[_0x1b09('0xc')](function(){return utils[_0x1b09('0x1c')](_0x2f359f);})['then'](function(){return _0x142c33(null,_0x2f359f);})[_0x1b09('0x1d')](function(_0x108d80){return _0x142c33(null,![],_0x108d80);});}}else{if(_0x2f359f[_0x1b09('0x18')]){return _0x142c33(null,![],{'message':_0x1b09('0x15')});}else{return utils['getLicense'](_0x2f359f)[_0x1b09('0xc')](function(){return _0x142c33(null,_0x2f359f);});}}}});})[_0x1b09('0x1d')](function(_0x532589){return _0x142c33(null,![],_0x532589);});}function sendServiceMail(_0x2d1ec0){return db[_0x1b09('0x1e')][_0x1b09('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x1b09('0xd'),_0x1b09('0x20')],'include':[{'model':db[_0x1b09('0x21')],'as':_0x1b09('0x22')}]})['then'](function(_0x22e3ee){if(!_0x22e3ee){throw new Error(_0x1b09('0x23'));}var _0x4bf0ad={'tls':{'rejectUnauthorized':![]}};if(_0x22e3ee[_0x1b09('0x22')][_0x1b09('0x24')]){_0x4bf0ad[_0x1b09('0x24')]=_0x22e3ee[_0x1b09('0x22')][_0x1b09('0x24')];}else{_0x4bf0ad['host']=_0x22e3ee[_0x1b09('0x22')]['host'];_0x4bf0ad[_0x1b09('0x25')]=_0x22e3ee['Smtp'][_0x1b09('0x25')];_0x4bf0ad[_0x1b09('0x26')]=_0x22e3ee[_0x1b09('0x22')][_0x1b09('0x26')];}if(_0x22e3ee[_0x1b09('0x22')][_0x1b09('0x27')]){_0x4bf0ad[_0x1b09('0x28')]={'user':_0x22e3ee[_0x1b09('0x22')][_0x1b09('0x13')],'pass':_0x22e3ee[_0x1b09('0x22')]['pass']};}var _0x267b28={'account':_0x4bf0ad,'message':_[_0x1b09('0x29')]({'from':util[_0x1b09('0x2a')]('\x22%s\x22\x20<%s>',_0x22e3ee[_0x1b09('0xd')],_0x22e3ee[_0x1b09('0x20')]||_0x22e3ee[_0x1b09('0x22')][_0x1b09('0x13')])},_0x2d1ec0)};return client[_0x1b09('0x2b')](_0x1b09('0x2c'),_0x267b28);})[_0x1b09('0xc')](function(_0x1fff0b){if(_0x1fff0b['error']){throw new Error(util[_0x1b09('0x2a')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x1fff0b[_0x1b09('0x2d')]['message']||JSON[_0x1b09('0x2e')](_0x1fff0b[_0x1b09('0x2d')])));}return!![];});}function handleError(_0x46e202,_0x2ba156,_0x226cc1){return _0x46e202[_0x1b09('0x2f')](_0x2ba156||0x1f4)[_0x1b09('0x30')]({'message':_0x226cc1?_0x226cc1[_0x1b09('0x31')]||_0x226cc1:''});}exports[_0x1b09('0x32')]=function(_0x68fbfb,_0x1b7b3b,_0x3caa9b){passport[_0x1b09('0x16')]('local',function(_0x588b90,_0x23ce9a,_0xb2ef05){var _0x27a78c=_0x588b90||_0xb2ef05;if(_0x27a78c){return handleError(_0x1b7b3b,0x191,_0x27a78c);}if(!_0x23ce9a){return handleError(_0x1b7b3b,0x194,{'message':_0x1b09('0x33')});}else{var _0x147c2b={'payload':{'id':_0x23ce9a['id'],'role':_0x23ce9a[_0x1b09('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x1b09('0x34')](_0x147c2b)[_0x1b09('0xc')](function(_0x4dd7e2){_0x1b7b3b['json']({'id':_0x23ce9a['id'],'token':_0x4dd7e2,'statusCall':'','isAlreadyLogged':_0x23ce9a[_0x1b09('0x35')]});});}})(_0x68fbfb,_0x1b7b3b,_0x3caa9b);};exports['forgot']=function(_0x966873,_0x31dbfd,_0x1434ef){if(!_0x966873['body'][_0x1b09('0x20')]){return handleError(_0x31dbfd,0x1f4,{'message':_0x1b09('0x36')});}var _0x202b18=rs['generate']();_0x966873[_0x1b09('0x37')][_0x1b09('0x20')]=_0x966873[_0x1b09('0x37')][_0x1b09('0x20')]['trim']()[_0x1b09('0x38')]();var _0x2b2341;return db['Setting'][_0x1b09('0x9')]({'where':{'id':0x1},'attributes':[_0x1b09('0xa'),'blockDuration'],'raw':!![]})['then'](function(_0x4b388d){_0x2b2341=_0x4b388d;return db['User'][_0x1b09('0x1f')]({'where':{'email':_0x966873[_0x1b09('0x37')][_0x1b09('0x20')]}});})['then'](function(_0x207af5){if(!_0x207af5){throw new Error(_0x1b09('0x39'));}if(_0x207af5['disabled']){throw new Error(_0x1b09('0x3a'));}if(_0x207af5[_0x1b09('0x18')]){if(moment(_0x207af5[_0x1b09('0x10')])[_0x1b09('0x19')](_0x2b2341[_0x1b09('0xb')],_0x1b09('0x1b'))>moment()){throw new Error(_0x1b09('0x3b'));}else{_0x207af5[_0x1b09('0x18')]=![];_0x207af5[_0x1b09('0x10')]=null;}}_0x207af5[_0x1b09('0x3c')]=_0x202b18;_0x207af5['resetPasswordExpires']=Date[_0x1b09('0x3d')]()+0x36ee80;return _0x207af5[_0x1b09('0x3e')]();})[_0x1b09('0xc')](function(){return sendServiceMail({'to':_0x966873['body'][_0x1b09('0x20')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x1b09('0x3f')+_0x1b09('0x40')+'https://'+_0x966873[_0x1b09('0x41')][_0x1b09('0x42')]+_0x1b09('0x43')+_0x202b18+'\x0a\x0a'+_0x1b09('0x44')});})[_0x1b09('0xc')](function(){_0x31dbfd[_0x1b09('0x2f')](0xc8)['send']({'message':_0x1b09('0x45')});})['catch'](function(_0x35d9ee){return handleError(_0x31dbfd,0x1f4,_0x35d9ee);});};exports['reset']=function(_0x50a66c,_0x55376,_0x141b98){return db[_0x1b09('0x46')][_0x1b09('0x1f')]({'where':{'resetPasswordToken':_0x50a66c[_0x1b09('0x47')][_0x1b09('0x48')],'resetPasswordExpires':{'$gt':Date[_0x1b09('0x3d')]()}}})[_0x1b09('0xc')](function(_0x5bb402){if(!_0x5bb402){throw new Error(_0x1b09('0x49'));}return db[_0x1b09('0x8')][_0x1b09('0x9')]({'attributes':['id','securePassword','enforcePasswordHistory',_0x1b09('0x4a')]})['then'](function(_0x2abc94){if(_0x2abc94[_0x1b09('0x4b')])authService['validatePasswordPattern'](_0x50a66c[_0x1b09('0x37')][_0x1b09('0x4c')]);if(!_0x2abc94['enforcePasswordHistory']||!_0x5bb402[_0x1b09('0x4d')])return _0x5bb402;authService[_0x1b09('0x4e')](_0x50a66c[_0x1b09('0x37')][_0x1b09('0x4c')],_0x5bb402[_0x1b09('0x4d')],_0x2abc94['passwordHistoryLimit']);return _0x5bb402;})[_0x1b09('0xc')](function(){_0x5bb402[_0x1b09('0x4c')]=_0x50a66c[_0x1b09('0x37')][_0x1b09('0x4c')];_0x5bb402[_0x1b09('0x3c')]=null;_0x5bb402[_0x1b09('0x4f')]=null;return _0x5bb402[_0x1b09('0x3e')]();});})['then'](function(){_0x55376['status'](0xc8)[_0x1b09('0x30')]({'message':_0x1b09('0x50')});})[_0x1b09('0x1d')](function(_0x533eb5){return handleError(_0x55376,0x1f4,_0x533eb5);});};passport[_0x1b09('0x51')](new LocalStrategy({'usernameField':_0x1b09('0xd'),'passwordField':_0x1b09('0x4c')},function(_0x5cc8f7,_0xbcf954,_0x2dcdb6){return localAuthenticate(db[_0x1b09('0x46')],_0x5cc8f7,_0xbcf954,_0x2dcdb6);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index b418f8d..3b6f6f3 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 _0x7a85=['Router','./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset','exports','express'];(function(_0x47f7f5,_0xa5caf){var _0x52fe6b=function(_0x7ee9cf){while(--_0x7ee9cf){_0x47f7f5['push'](_0x47f7f5['shift']());}};_0x52fe6b(++_0xa5caf);}(_0x7a85,0x185));var _0x57a8=function(_0x16d30d,_0x5eb352){_0x16d30d=_0x16d30d-0x0;var _0x1350df=_0x7a85[_0x16d30d];return _0x1350df;};'use strict';var express=require(_0x57a8('0x0'));var router=express[_0x57a8('0x1')]();var controller=require(_0x57a8('0x2'));router[_0x57a8('0x3')]('/',controller[_0x57a8('0x4')]);router[_0x57a8('0x3')](_0x57a8('0x5'),controller[_0x57a8('0x6')]);router[_0x57a8('0x3')](_0x57a8('0x7'),controller[_0x57a8('0x8')]);module[_0x57a8('0x9')]=router;
\ No newline at end of file
+var _0xa835=['/reset/:token','exports','post','login','/forgot'];(function(_0x8323e0,_0x1e856e){var _0x58d579=function(_0x254676){while(--_0x254676){_0x8323e0['push'](_0x8323e0['shift']());}};_0x58d579(++_0x1e856e);}(_0xa835,0x6b));var _0x5a83=function(_0x275aa9,_0x253099){_0x275aa9=_0x275aa9-0x0;var _0x53d36d=_0xa835[_0x275aa9];return _0x53d36d;};'use strict';var express=require('express');var router=express['Router']();var controller=require('./authLocal.controller');router[_0x5a83('0x0')]('/',controller[_0x5a83('0x1')]);router['post'](_0x5a83('0x2'),controller['forgot']);router[_0x5a83('0x0')](_0x5a83('0x3'),controller['reset']);module[_0x5a83('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 7866173..41f3ab0 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 _0x9301=['exports','STRING','INTEGER','sequelize'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x9301,0xe7));var _0x1930=function(_0x2e892c,_0x1b8aba){_0x2e892c=_0x2e892c-0x0;var _0x3ff0fb=_0x9301[_0x2e892c];return _0x3ff0fb;};'use strict';var Sequelize=require(_0x1930('0x0'));module[_0x1930('0x1')]={'name':{'type':Sequelize[_0x1930('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1930('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x1930('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x46ef=['exports','STRING','BOOLEAN','sequelize'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x46ef,0xcf));var _0xf46e=function(_0x405af2,_0x4e13e1){_0x405af2=_0x405af2-0x0;var _0x7c6ef8=_0x46ef[_0x405af2];return _0x7c6ef8;};'use strict';var Sequelize=require(_0xf46e('0x0'));module[_0xf46e('0x1')]={'name':{'type':Sequelize[_0xf46e('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xf46e('0x2')]},'description':{'type':Sequelize[_0xf46e('0x2')]},'status':{'type':Sequelize[_0xf46e('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'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 bcaed5f..c628fe1 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 _0xb7e7=['length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','show','params','include','find','catch','create','destroy','addConditions','Condition','ids','omit','findOne','getConditions','addActions','Action','map','getActions','eml-format','zip-dir','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','name','render','body','message','agent','interaction','index','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x40e139,_0x38b8ce){var _0x2084cf=function(_0x128b7b){while(--_0x128b7b){_0x40e139['push'](_0x40e139['shift']());}};_0x2084cf(++_0x38b8ce);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xb7e7[_0x4c12ec];return _0x3ae42c;};'use strict';var emlformat=require(_0x7b7e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b7e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b7e('0x2'));var moment=require('moment');var BPromise=require(_0x7b7e('0x3'));var Mustache=require('mustache');var util=require(_0x7b7e('0x4'));var path=require(_0x7b7e('0x5'));var sox=require(_0x7b7e('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b7e('0x7'));var _=require(_0x7b7e('0x8'));var squel=require(_0x7b7e('0x9'));var crypto=require('crypto');var jsforce=require(_0x7b7e('0xa'));var deskjs=require(_0x7b7e('0xb'));var toCsv=require(_0x7b7e('0xc'));var querystring=require(_0x7b7e('0xd'));var Papa=require(_0x7b7e('0xe'));var Redis=require(_0x7b7e('0xf'));var authService=require(_0x7b7e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7b7e('0x11'));var hardwareService=require(_0x7b7e('0x12'));var logger=require(_0x7b7e('0x13'))(_0x7b7e('0x14'));var utils=require(_0x7b7e('0x15'));var config=require(_0x7b7e('0x16'));var licenseUtil=require(_0x7b7e('0x17'));var db=require(_0x7b7e('0x18'))['db'];function respondWithStatusCode(_0xaadda,_0x54d8ce){_0x54d8ce=_0x54d8ce||0xcc;return function(_0x267446){if(_0x267446){return _0xaadda[_0x7b7e('0x19')](_0x54d8ce);}return _0xaadda['status'](_0x54d8ce)[_0x7b7e('0x1a')]();};}function respondWithResult(_0x5976ac,_0x4c6011){_0x4c6011=_0x4c6011||0xc8;return function(_0x2889ed){if(_0x2889ed){return _0x5976ac[_0x7b7e('0x1b')](_0x4c6011)[_0x7b7e('0x1c')](_0x2889ed);}};}function respondWithFilteredResult(_0x457ec5,_0x3d2fb2){return function(_0x5703fd){if(_0x5703fd){var _0x51baf6=typeof _0x3d2fb2[_0x7b7e('0x1d')]===_0x7b7e('0x1e')&&typeof _0x3d2fb2[_0x7b7e('0x1f')]===_0x7b7e('0x1e');var _0x2cc400=_0x5703fd[_0x7b7e('0x20')];var _0x242368=_0x51baf6?0x0:_0x3d2fb2[_0x7b7e('0x1d')];var _0x2acb8c=_0x51baf6?_0x5703fd[_0x7b7e('0x20')]:_0x3d2fb2[_0x7b7e('0x1d')]+_0x3d2fb2[_0x7b7e('0x1f')];var _0x448980;if(_0x2acb8c>=_0x2cc400){_0x2acb8c=_0x2cc400;_0x448980=0xc8;}else{_0x448980=0xce;}_0x457ec5[_0x7b7e('0x1b')](_0x448980);return _0x457ec5[_0x7b7e('0x21')](_0x7b7e('0x22'),_0x242368+'-'+_0x2acb8c+'/'+_0x2cc400)[_0x7b7e('0x1c')](_0x5703fd);}return null;};}function patchUpdates(_0x49eddb){return function(_0x69262b){try{jsonpatch[_0x7b7e('0x23')](_0x69262b,_0x49eddb,!![]);}catch(_0x24718c){return BPromise['reject'](_0x24718c);}return _0x69262b[_0x7b7e('0x24')]();};}function saveUpdates(_0xbf0cb3,_0x14243b){return function(_0x200156){if(_0x200156){return _0x200156[_0x7b7e('0x25')](_0xbf0cb3)[_0x7b7e('0x26')](function(_0x28bf43){return _0x28bf43;});}return null;};}function removeEntity(_0x10a66a,_0x53bbb3){return function(_0x5d6215){if(_0x5d6215){return _0x5d6215['destroy']()[_0x7b7e('0x26')](function(){_0x10a66a[_0x7b7e('0x1b')](0xcc)[_0x7b7e('0x1a')]();});}};}function handleEntityNotFound(_0x483c6f,_0x51d3b1){return function(_0x5dadbb){if(!_0x5dadbb){_0x483c6f[_0x7b7e('0x19')](0x194);}return _0x5dadbb;};}function handleError(_0x3c8192,_0x16a3c7){_0x16a3c7=_0x16a3c7||0x1f4;return function(_0x7aa71){logger[_0x7b7e('0x27')](_0x7aa71['stack']);if(_0x7aa71[_0x7b7e('0x28')]){delete _0x7aa71[_0x7b7e('0x28')];}_0x3c8192['status'](_0x16a3c7)['send'](_0x7aa71);};}function getMustacheRender(_0x4e5de7,_0x12ef0b){return Mustache[_0x7b7e('0x29')](_0x4e5de7,_['merge'](_0x12ef0b[_0x7b7e('0x2a')],{'contact':_0x12ef0b['contact'],'message':_0x12ef0b[_0x7b7e('0x2b')],'agent':_0x12ef0b[_0x7b7e('0x2c')],'interaction':_0x12ef0b[_0x7b7e('0x2d')],'account':_0x12ef0b['account']}))||'';}exports[_0x7b7e('0x2e')]=function(_0xe31336,_0x35602a){var _0x326dd2={},_0x33f9a1={},_0x5732ee={'count':0x0,'rows':[]};var _0x41af57=_['map'](db[_0x7b7e('0x2f')][_0x7b7e('0x30')],function(_0x383de5){return{'name':_0x383de5[_0x7b7e('0x31')],'type':_0x383de5[_0x7b7e('0x32')][_0x7b7e('0x33')]};});_0x33f9a1[_0x7b7e('0x34')]=_['map'](_0x41af57,'name');_0x33f9a1[_0x7b7e('0x35')]=_[_0x7b7e('0x36')](_0xe31336['query']);_0x33f9a1[_0x7b7e('0x37')]=_[_0x7b7e('0x38')](_0x33f9a1[_0x7b7e('0x34')],_0x33f9a1['query']);_0x326dd2[_0x7b7e('0x39')]=_[_0x7b7e('0x38')](_0x33f9a1[_0x7b7e('0x34')],qs[_0x7b7e('0x3a')](_0xe31336[_0x7b7e('0x35')][_0x7b7e('0x3a')]));_0x326dd2[_0x7b7e('0x39')]=_0x326dd2[_0x7b7e('0x39')][_0x7b7e('0x3b')]?_0x326dd2[_0x7b7e('0x39')]:_0x33f9a1[_0x7b7e('0x34')];if(!_0xe31336[_0x7b7e('0x35')][_0x7b7e('0x3c')](_0x7b7e('0x3d'))){_0x326dd2[_0x7b7e('0x1f')]=qs[_0x7b7e('0x1f')](_0xe31336['query'][_0x7b7e('0x1f')]);_0x326dd2[_0x7b7e('0x1d')]=qs[_0x7b7e('0x1d')](_0xe31336[_0x7b7e('0x35')][_0x7b7e('0x1d')]);}_0x326dd2[_0x7b7e('0x3e')]=qs[_0x7b7e('0x3f')](_0xe31336[_0x7b7e('0x35')][_0x7b7e('0x3f')]);_0x326dd2[_0x7b7e('0x40')]=qs['filters'](_[_0x7b7e('0x41')](_0xe31336[_0x7b7e('0x35')],_0x33f9a1[_0x7b7e('0x37')]),_0x41af57);if(_0xe31336[_0x7b7e('0x35')]['filter']){_0x326dd2[_0x7b7e('0x40')]=_[_0x7b7e('0x42')](_0x326dd2[_0x7b7e('0x40')],{'$or':_['map'](_0x41af57,function(_0x4a2888){if(_0x4a2888[_0x7b7e('0x32')]!=='VIRTUAL'){var _0x35382c={};_0x35382c[_0x4a2888[_0x7b7e('0x28')]]={'$like':'%'+_0xe31336['query'][_0x7b7e('0x43')]+'%'};return _0x35382c;}})});}_0x326dd2=_[_0x7b7e('0x42')]({},_0x326dd2,_0xe31336[_0x7b7e('0x44')]);var _0x5e7b6b={'where':_0x326dd2[_0x7b7e('0x40')]};return db[_0x7b7e('0x2f')][_0x7b7e('0x20')](_0x5e7b6b)[_0x7b7e('0x26')](function(_0x157871){_0x5732ee['count']=_0x157871;if(_0xe31336['query'][_0x7b7e('0x45')]){_0x326dd2['include']=[{'all':!![]}];}return db[_0x7b7e('0x2f')]['findAll'](_0x326dd2);})['then'](function(_0x356db0){_0x5732ee['rows']=_0x356db0;return _0x5732ee;})[_0x7b7e('0x26')](respondWithFilteredResult(_0x35602a,_0x326dd2))['catch'](handleError(_0x35602a,null));};exports[_0x7b7e('0x46')]=function(_0x3e58be,_0x7ea84c){var _0x231fdf={'raw':![],'where':{'id':_0x3e58be[_0x7b7e('0x47')]['id']}},_0x4fd335={};_0x4fd335[_0x7b7e('0x34')]=_[_0x7b7e('0x36')](db[_0x7b7e('0x2f')][_0x7b7e('0x30')]);_0x4fd335[_0x7b7e('0x35')]=_['keys'](_0x3e58be['query']);_0x4fd335['filters']=_[_0x7b7e('0x38')](_0x4fd335[_0x7b7e('0x34')],_0x4fd335[_0x7b7e('0x35')]);_0x231fdf[_0x7b7e('0x39')]=_[_0x7b7e('0x38')](_0x4fd335[_0x7b7e('0x34')],qs['fields'](_0x3e58be[_0x7b7e('0x35')][_0x7b7e('0x3a')]));_0x231fdf['attributes']=_0x231fdf['attributes'][_0x7b7e('0x3b')]?_0x231fdf[_0x7b7e('0x39')]:_0x4fd335[_0x7b7e('0x34')];if(_0x3e58be[_0x7b7e('0x35')][_0x7b7e('0x45')]){_0x231fdf[_0x7b7e('0x48')]=[{'all':!![]}];}_0x231fdf=_['merge']({},_0x231fdf,_0x3e58be[_0x7b7e('0x44')]);return db['Automation'][_0x7b7e('0x49')](_0x231fdf)[_0x7b7e('0x26')](handleEntityNotFound(_0x7ea84c,null))[_0x7b7e('0x26')](respondWithResult(_0x7ea84c,null))[_0x7b7e('0x4a')](handleError(_0x7ea84c,null));};exports['create']=function(_0x3b649e,_0x1010b3){return db[_0x7b7e('0x2f')][_0x7b7e('0x4b')](_0x3b649e[_0x7b7e('0x2a')],{})['then'](respondWithResult(_0x1010b3,0xc9))[_0x7b7e('0x4a')](handleError(_0x1010b3,null));};exports[_0x7b7e('0x25')]=function(_0x21868a,_0xcb5186){if(_0x21868a[_0x7b7e('0x2a')]['id']){delete _0x21868a['body']['id'];}return db[_0x7b7e('0x2f')][_0x7b7e('0x49')]({'where':{'id':_0x21868a[_0x7b7e('0x47')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0xcb5186,null))[_0x7b7e('0x26')](saveUpdates(_0x21868a[_0x7b7e('0x2a')],null))[_0x7b7e('0x26')](respondWithResult(_0xcb5186,null))['catch'](handleError(_0xcb5186,null));};exports[_0x7b7e('0x4c')]=function(_0x5d7c89,_0x16730c){return db[_0x7b7e('0x2f')]['find']({'where':{'id':_0x5d7c89[_0x7b7e('0x47')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x16730c,null))[_0x7b7e('0x26')](removeEntity(_0x16730c,null))[_0x7b7e('0x4a')](handleError(_0x16730c,null));};exports[_0x7b7e('0x4d')]=function(_0x36ffd4,_0x337d06,_0x5f15ce){return db[_0x7b7e('0x4e')][_0x7b7e('0x49')]({'where':{'id':_0x36ffd4[_0x7b7e('0x47')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x337d06,null))['then'](function(_0x527403){if(_0x527403){return _0x527403['addConditions'](_0x36ffd4[_0x7b7e('0x2a')][_0x7b7e('0x4f')],_[_0x7b7e('0x50')](_0x36ffd4['body'],['ids','id'])||{});}})[_0x7b7e('0x26')](respondWithResult(_0x337d06,null))[_0x7b7e('0x4a')](handleError(_0x337d06,null));};exports['getConditions']=function(_0xf54f87,_0xbe02ed,_0x44c30a){var _0x56ea8a={};var _0x2b0657={};var _0x1d9af5;var _0x4d9a71;return db[_0x7b7e('0x2f')][_0x7b7e('0x51')]({'where':{'id':_0xf54f87[_0x7b7e('0x47')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0xbe02ed,null))[_0x7b7e('0x26')](function(_0x310b9a){if(_0x310b9a){_0x1d9af5=_0x310b9a;_0x2b0657[_0x7b7e('0x34')]=_[_0x7b7e('0x36')](db[_0x7b7e('0x4e')]['rawAttributes']);_0x2b0657[_0x7b7e('0x35')]=_[_0x7b7e('0x36')](_0xf54f87['query']);_0x2b0657[_0x7b7e('0x37')]=_[_0x7b7e('0x38')](_0x2b0657[_0x7b7e('0x34')],_0x2b0657['query']);_0x56ea8a[_0x7b7e('0x39')]=_['intersection'](_0x2b0657[_0x7b7e('0x34')],qs[_0x7b7e('0x3a')](_0xf54f87['query'][_0x7b7e('0x3a')]));_0x56ea8a[_0x7b7e('0x39')]=_0x56ea8a['attributes'][_0x7b7e('0x3b')]?_0x56ea8a[_0x7b7e('0x39')]:_0x2b0657[_0x7b7e('0x34')];_0x56ea8a[_0x7b7e('0x3e')]=qs['sort'](_0xf54f87[_0x7b7e('0x35')][_0x7b7e('0x3f')]);_0x56ea8a[_0x7b7e('0x40')]=qs[_0x7b7e('0x37')](_[_0x7b7e('0x41')](_0xf54f87[_0x7b7e('0x35')],_0x2b0657[_0x7b7e('0x37')]));if(_0xf54f87[_0x7b7e('0x35')][_0x7b7e('0x43')]){_0x56ea8a[_0x7b7e('0x40')]=_['merge'](_0x56ea8a[_0x7b7e('0x40')],{'$or':_['map'](_0x56ea8a['attributes'],function(_0x2b105a){var _0x7cbe6c={};_0x7cbe6c[_0x2b105a]={'$like':'%'+_0xf54f87[_0x7b7e('0x35')][_0x7b7e('0x43')]+'%'};return _0x7cbe6c;})});}_0x56ea8a=_['merge']({},_0x56ea8a,_0xf54f87[_0x7b7e('0x44')]);return _0x1d9af5[_0x7b7e('0x52')](_0x56ea8a);}})[_0x7b7e('0x26')](function(_0x3d4b2d){if(_0x3d4b2d){_0x4d9a71=_0x3d4b2d[_0x7b7e('0x3b')];if(!_0xf54f87[_0x7b7e('0x35')]['hasOwnProperty'](_0x7b7e('0x3d'))){_0x56ea8a['limit']=qs['limit'](_0xf54f87[_0x7b7e('0x35')]['limit']);_0x56ea8a[_0x7b7e('0x1d')]=qs['offset'](_0xf54f87[_0x7b7e('0x35')][_0x7b7e('0x1d')]);}return _0x1d9af5['getConditions'](_0x56ea8a);}})[_0x7b7e('0x26')](function(_0x2da71e){if(_0x2da71e){return _0x2da71e?{'count':_0x4d9a71,'rows':_0x2da71e}:null;}})['then'](respondWithResult(_0xbe02ed,null))[_0x7b7e('0x4a')](handleError(_0xbe02ed,null));};exports[_0x7b7e('0x53')]=function(_0x50184c,_0x430033,_0x36ea09){return db[_0x7b7e('0x54')][_0x7b7e('0x49')]({'where':{'id':_0x50184c[_0x7b7e('0x47')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x430033,null))[_0x7b7e('0x26')](function(_0x589b02){if(_0x589b02){return _0x589b02['addActions'](_0x50184c[_0x7b7e('0x2a')][_0x7b7e('0x4f')],_[_0x7b7e('0x50')](_0x50184c[_0x7b7e('0x2a')],[_0x7b7e('0x4f'),'id'])||{});}})[_0x7b7e('0x26')](respondWithResult(_0x430033,null))[_0x7b7e('0x4a')](handleError(_0x430033,null));};exports['getActions']=function(_0x28e6ac,_0x2aca93,_0x4ff2c8){var _0x3ce80e={};var _0x3f8162={};var _0x2fea85;var _0x271318;return db[_0x7b7e('0x2f')][_0x7b7e('0x51')]({'where':{'id':_0x28e6ac[_0x7b7e('0x47')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x2aca93,null))[_0x7b7e('0x26')](function(_0x3b6bc6){if(_0x3b6bc6){_0x2fea85=_0x3b6bc6;_0x3f8162[_0x7b7e('0x34')]=_['keys'](db[_0x7b7e('0x54')][_0x7b7e('0x30')]);_0x3f8162[_0x7b7e('0x35')]=_[_0x7b7e('0x36')](_0x28e6ac[_0x7b7e('0x35')]);_0x3f8162[_0x7b7e('0x37')]=_[_0x7b7e('0x38')](_0x3f8162['model'],_0x3f8162[_0x7b7e('0x35')]);_0x3ce80e[_0x7b7e('0x39')]=_[_0x7b7e('0x38')](_0x3f8162['model'],qs[_0x7b7e('0x3a')](_0x28e6ac[_0x7b7e('0x35')][_0x7b7e('0x3a')]));_0x3ce80e[_0x7b7e('0x39')]=_0x3ce80e[_0x7b7e('0x39')]['length']?_0x3ce80e['attributes']:_0x3f8162['model'];_0x3ce80e[_0x7b7e('0x3e')]=qs[_0x7b7e('0x3f')](_0x28e6ac[_0x7b7e('0x35')]['sort']);_0x3ce80e[_0x7b7e('0x40')]=qs[_0x7b7e('0x37')](_[_0x7b7e('0x41')](_0x28e6ac['query'],_0x3f8162[_0x7b7e('0x37')]));if(_0x28e6ac[_0x7b7e('0x35')][_0x7b7e('0x43')]){_0x3ce80e[_0x7b7e('0x40')]=_['merge'](_0x3ce80e[_0x7b7e('0x40')],{'$or':_[_0x7b7e('0x55')](_0x3ce80e[_0x7b7e('0x39')],function(_0x259f6e){var _0x4f0745={};_0x4f0745[_0x259f6e]={'$like':'%'+_0x28e6ac['query'][_0x7b7e('0x43')]+'%'};return _0x4f0745;})});}_0x3ce80e=_['merge']({},_0x3ce80e,_0x28e6ac[_0x7b7e('0x44')]);return _0x2fea85[_0x7b7e('0x56')](_0x3ce80e);}})[_0x7b7e('0x26')](function(_0x30b703){if(_0x30b703){_0x271318=_0x30b703['length'];if(!_0x28e6ac[_0x7b7e('0x35')][_0x7b7e('0x3c')](_0x7b7e('0x3d'))){_0x3ce80e[_0x7b7e('0x1f')]=qs[_0x7b7e('0x1f')](_0x28e6ac[_0x7b7e('0x35')][_0x7b7e('0x1f')]);_0x3ce80e[_0x7b7e('0x1d')]=qs[_0x7b7e('0x1d')](_0x28e6ac[_0x7b7e('0x35')][_0x7b7e('0x1d')]);}return _0x2fea85[_0x7b7e('0x56')](_0x3ce80e);}})[_0x7b7e('0x26')](function(_0x24189a){if(_0x24189a){return _0x24189a?{'count':_0x271318,'rows':_0x24189a}:null;}})[_0x7b7e('0x26')](respondWithResult(_0x2aca93,null))[_0x7b7e('0x4a')](handleError(_0x2aca93,null));};
\ No newline at end of file
+var _0xd8b0=['omit','getActions','Action','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','render','body','message','interaction','index','Automation','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','rows','params','rawAttributes','length','includeAll','include','find','catch','create','Condition','ids','getConditions','findOne','pick','addActions'];(function(_0x24516c,_0x59fcd8){var _0xaf2987=function(_0x9f8828){while(--_0x9f8828){_0x24516c['push'](_0x24516c['shift']());}};_0xaf2987(++_0x59fcd8);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x0d8b('0x0'));var rimraf=require(_0x0d8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d8b('0x2'));var BPromise=require(_0x0d8b('0x3'));var Mustache=require(_0x0d8b('0x4'));var util=require(_0x0d8b('0x5'));var path=require(_0x0d8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8b('0x7'));var fs=require('fs');var fs_extra=require(_0x0d8b('0x8'));var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0xc'));var querystring=require(_0x0d8b('0xd'));var Papa=require(_0x0d8b('0xe'));var Redis=require(_0x0d8b('0xf'));var authService=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var as=require(_0x0d8b('0x12'));var hardwareService=require(_0x0d8b('0x13'));var logger=require('../../config/logger')(_0x0d8b('0x14'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x15'));var licenseUtil=require(_0x0d8b('0x16'));var db=require(_0x0d8b('0x17'))['db'];function respondWithStatusCode(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xcc;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0x18')](_0x35a07b);}return _0x92cdd8[_0x0d8b('0x19')](_0x35a07b)[_0x0d8b('0x1a')]();};}function respondWithResult(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xc8;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x19')](_0x5ad086)[_0x0d8b('0x1b')](_0xe65334);}};}function respondWithFilteredResult(_0x4f6f21,_0x23eb7b){return function(_0xa86349){if(_0xa86349){var _0x17f7df=typeof _0x23eb7b[_0x0d8b('0x1c')]===_0x0d8b('0x1d')&&typeof _0x23eb7b['limit']===_0x0d8b('0x1d');var _0x4586c2=_0xa86349[_0x0d8b('0x1e')];var _0x5fecbd=_0x17f7df?0x0:_0x23eb7b[_0x0d8b('0x1c')];var _0x18dd2d=_0x17f7df?_0xa86349[_0x0d8b('0x1e')]:_0x23eb7b[_0x0d8b('0x1c')]+_0x23eb7b['limit'];var _0x27512e;if(_0x18dd2d>=_0x4586c2){_0x18dd2d=_0x4586c2;_0x27512e=0xc8;}else{_0x27512e=0xce;}_0x4f6f21[_0x0d8b('0x19')](_0x27512e);return _0x4f6f21[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x5fecbd+'-'+_0x18dd2d+'/'+_0x4586c2)[_0x0d8b('0x1b')](_0xa86349);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x21')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x22')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x23')](_0x54a9a7)[_0x0d8b('0x24')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x25')]()[_0x0d8b('0x24')](function(){_0x38efc8[_0x0d8b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8bbee,_0x4463ee){return function(_0x5363e3){if(!_0x5363e3){_0xe8bbee[_0x0d8b('0x18')](0x194);}return _0x5363e3;};}function handleError(_0x4a0ae4,_0x3dd149){_0x3dd149=_0x3dd149||0x1f4;return function(_0x234bdd){logger[_0x0d8b('0x26')](_0x234bdd['stack']);if(_0x234bdd['name']){delete _0x234bdd[_0x0d8b('0x27')];}_0x4a0ae4[_0x0d8b('0x19')](_0x3dd149)['send'](_0x234bdd);};}function getMustacheRender(_0xcbc4ac,_0x59aa83){return Mustache[_0x0d8b('0x28')](_0xcbc4ac,_['merge'](_0x59aa83[_0x0d8b('0x29')],{'contact':_0x59aa83['contact'],'message':_0x59aa83[_0x0d8b('0x2a')],'agent':_0x59aa83['agent'],'interaction':_0x59aa83[_0x0d8b('0x2b')],'account':_0x59aa83['account']}))||'';}exports[_0x0d8b('0x2c')]=function(_0x106e4c,_0x2c058d){var _0x56120a={},_0x4c80a2={},_0x51cf32={'count':0x0,'rows':[]};var _0x4e8992=_['map'](db[_0x0d8b('0x2d')]['rawAttributes'],function(_0x5d05fc){return{'name':_0x5d05fc[_0x0d8b('0x2e')],'type':_0x5d05fc[_0x0d8b('0x2f')][_0x0d8b('0x30')]};});_0x4c80a2[_0x0d8b('0x31')]=_[_0x0d8b('0x32')](_0x4e8992,_0x0d8b('0x27'));_0x4c80a2[_0x0d8b('0x33')]=_[_0x0d8b('0x34')](_0x106e4c['query']);_0x4c80a2[_0x0d8b('0x35')]=_[_0x0d8b('0x36')](_0x4c80a2['model'],_0x4c80a2[_0x0d8b('0x33')]);_0x56120a[_0x0d8b('0x37')]=_[_0x0d8b('0x36')](_0x4c80a2['model'],qs[_0x0d8b('0x38')](_0x106e4c[_0x0d8b('0x33')][_0x0d8b('0x38')]));_0x56120a[_0x0d8b('0x37')]=_0x56120a[_0x0d8b('0x37')]['length']?_0x56120a[_0x0d8b('0x37')]:_0x4c80a2[_0x0d8b('0x31')];if(!_0x106e4c['query'][_0x0d8b('0x39')](_0x0d8b('0x3a'))){_0x56120a[_0x0d8b('0x3b')]=qs[_0x0d8b('0x3b')](_0x106e4c[_0x0d8b('0x33')]['limit']);_0x56120a['offset']=qs[_0x0d8b('0x1c')](_0x106e4c['query']['offset']);}_0x56120a[_0x0d8b('0x3c')]=qs[_0x0d8b('0x3d')](_0x106e4c[_0x0d8b('0x33')][_0x0d8b('0x3d')]);_0x56120a[_0x0d8b('0x3e')]=qs[_0x0d8b('0x35')](_['pick'](_0x106e4c[_0x0d8b('0x33')],_0x4c80a2[_0x0d8b('0x35')]),_0x4e8992);if(_0x106e4c[_0x0d8b('0x33')][_0x0d8b('0x3f')]){_0x56120a[_0x0d8b('0x3e')]=_[_0x0d8b('0x40')](_0x56120a[_0x0d8b('0x3e')],{'$or':_['map'](_0x4e8992,function(_0x1d06b6){if(_0x1d06b6[_0x0d8b('0x2f')]!==_0x0d8b('0x41')){var _0x1f196d={};_0x1f196d[_0x1d06b6['name']]={'$like':'%'+_0x106e4c[_0x0d8b('0x33')]['filter']+'%'};return _0x1f196d;}})});}_0x56120a=_[_0x0d8b('0x40')]({},_0x56120a,_0x106e4c[_0x0d8b('0x42')]);var _0x32d7d7={'where':_0x56120a[_0x0d8b('0x3e')]};return db[_0x0d8b('0x2d')][_0x0d8b('0x1e')](_0x32d7d7)[_0x0d8b('0x24')](function(_0x373f69){_0x51cf32[_0x0d8b('0x1e')]=_0x373f69;if(_0x106e4c[_0x0d8b('0x33')]['includeAll']){_0x56120a['include']=[{'all':!![]}];}return db['Automation']['findAll'](_0x56120a);})['then'](function(_0x1a46f6){_0x51cf32[_0x0d8b('0x43')]=_0x1a46f6;return _0x51cf32;})[_0x0d8b('0x24')](respondWithFilteredResult(_0x2c058d,_0x56120a))['catch'](handleError(_0x2c058d,null));};exports['show']=function(_0x1b216d,_0x192de1){var _0x344278={'raw':![],'where':{'id':_0x1b216d[_0x0d8b('0x44')]['id']}},_0x513b93={};_0x513b93[_0x0d8b('0x31')]=_['keys'](db['Automation'][_0x0d8b('0x45')]);_0x513b93['query']=_[_0x0d8b('0x34')](_0x1b216d['query']);_0x513b93['filters']=_[_0x0d8b('0x36')](_0x513b93[_0x0d8b('0x31')],_0x513b93['query']);_0x344278['attributes']=_['intersection'](_0x513b93['model'],qs[_0x0d8b('0x38')](_0x1b216d[_0x0d8b('0x33')][_0x0d8b('0x38')]));_0x344278['attributes']=_0x344278[_0x0d8b('0x37')][_0x0d8b('0x46')]?_0x344278[_0x0d8b('0x37')]:_0x513b93[_0x0d8b('0x31')];if(_0x1b216d[_0x0d8b('0x33')][_0x0d8b('0x47')]){_0x344278[_0x0d8b('0x48')]=[{'all':!![]}];}_0x344278=_[_0x0d8b('0x40')]({},_0x344278,_0x1b216d[_0x0d8b('0x42')]);return db[_0x0d8b('0x2d')][_0x0d8b('0x49')](_0x344278)[_0x0d8b('0x24')](handleEntityNotFound(_0x192de1,null))[_0x0d8b('0x24')](respondWithResult(_0x192de1,null))[_0x0d8b('0x4a')](handleError(_0x192de1,null));};exports[_0x0d8b('0x4b')]=function(_0xdfcf32,_0x245325){return db[_0x0d8b('0x2d')][_0x0d8b('0x4b')](_0xdfcf32['body'],{})[_0x0d8b('0x24')](respondWithResult(_0x245325,0xc9))['catch'](handleError(_0x245325,null));};exports['update']=function(_0x39a31d,_0x113fb7){if(_0x39a31d[_0x0d8b('0x29')]['id']){delete _0x39a31d[_0x0d8b('0x29')]['id'];}return db['Automation'][_0x0d8b('0x49')]({'where':{'id':_0x39a31d[_0x0d8b('0x44')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x113fb7,null))[_0x0d8b('0x24')](saveUpdates(_0x39a31d[_0x0d8b('0x29')],null))['then'](respondWithResult(_0x113fb7,null))['catch'](handleError(_0x113fb7,null));};exports['destroy']=function(_0x573f4f,_0x368ede){return db[_0x0d8b('0x2d')]['find']({'where':{'id':_0x573f4f['params']['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x368ede,null))[_0x0d8b('0x24')](removeEntity(_0x368ede,null))['catch'](handleError(_0x368ede,null));};exports['addConditions']=function(_0x900906,_0xeeefd4,_0x3cd00a){return db[_0x0d8b('0x4c')][_0x0d8b('0x49')]({'where':{'id':_0x900906['params']['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0xeeefd4,null))[_0x0d8b('0x24')](function(_0x5481fc){if(_0x5481fc){return _0x5481fc['addConditions'](_0x900906[_0x0d8b('0x29')][_0x0d8b('0x4d')],_['omit'](_0x900906['body'],[_0x0d8b('0x4d'),'id'])||{});}})[_0x0d8b('0x24')](respondWithResult(_0xeeefd4,null))[_0x0d8b('0x4a')](handleError(_0xeeefd4,null));};exports[_0x0d8b('0x4e')]=function(_0x4a2989,_0x356b3d,_0x598e03){var _0x5c271c={};var _0x38c24e={};var _0x44043b;var _0x54aa03;return db['Automation'][_0x0d8b('0x4f')]({'where':{'id':_0x4a2989[_0x0d8b('0x44')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x356b3d,null))[_0x0d8b('0x24')](function(_0x3afc3a){if(_0x3afc3a){_0x44043b=_0x3afc3a;_0x38c24e[_0x0d8b('0x31')]=_[_0x0d8b('0x34')](db[_0x0d8b('0x4c')]['rawAttributes']);_0x38c24e[_0x0d8b('0x33')]=_[_0x0d8b('0x34')](_0x4a2989[_0x0d8b('0x33')]);_0x38c24e[_0x0d8b('0x35')]=_[_0x0d8b('0x36')](_0x38c24e[_0x0d8b('0x31')],_0x38c24e[_0x0d8b('0x33')]);_0x5c271c[_0x0d8b('0x37')]=_[_0x0d8b('0x36')](_0x38c24e['model'],qs[_0x0d8b('0x38')](_0x4a2989[_0x0d8b('0x33')][_0x0d8b('0x38')]));_0x5c271c[_0x0d8b('0x37')]=_0x5c271c[_0x0d8b('0x37')]['length']?_0x5c271c[_0x0d8b('0x37')]:_0x38c24e[_0x0d8b('0x31')];_0x5c271c[_0x0d8b('0x3c')]=qs[_0x0d8b('0x3d')](_0x4a2989[_0x0d8b('0x33')]['sort']);_0x5c271c['where']=qs[_0x0d8b('0x35')](_[_0x0d8b('0x50')](_0x4a2989[_0x0d8b('0x33')],_0x38c24e[_0x0d8b('0x35')]));if(_0x4a2989['query'][_0x0d8b('0x3f')]){_0x5c271c[_0x0d8b('0x3e')]=_[_0x0d8b('0x40')](_0x5c271c['where'],{'$or':_[_0x0d8b('0x32')](_0x5c271c['attributes'],function(_0x2fce07){var _0x3ed63e={};_0x3ed63e[_0x2fce07]={'$like':'%'+_0x4a2989[_0x0d8b('0x33')][_0x0d8b('0x3f')]+'%'};return _0x3ed63e;})});}_0x5c271c=_[_0x0d8b('0x40')]({},_0x5c271c,_0x4a2989[_0x0d8b('0x42')]);return _0x44043b['getConditions'](_0x5c271c);}})[_0x0d8b('0x24')](function(_0x4c074d){if(_0x4c074d){_0x54aa03=_0x4c074d[_0x0d8b('0x46')];if(!_0x4a2989[_0x0d8b('0x33')][_0x0d8b('0x39')](_0x0d8b('0x3a'))){_0x5c271c['limit']=qs[_0x0d8b('0x3b')](_0x4a2989[_0x0d8b('0x33')][_0x0d8b('0x3b')]);_0x5c271c[_0x0d8b('0x1c')]=qs[_0x0d8b('0x1c')](_0x4a2989[_0x0d8b('0x33')][_0x0d8b('0x1c')]);}return _0x44043b[_0x0d8b('0x4e')](_0x5c271c);}})[_0x0d8b('0x24')](function(_0x34affb){if(_0x34affb){return _0x34affb?{'count':_0x54aa03,'rows':_0x34affb}:null;}})['then'](respondWithResult(_0x356b3d,null))['catch'](handleError(_0x356b3d,null));};exports[_0x0d8b('0x51')]=function(_0x3eb647,_0x53e399,_0xb1aa96){return db['Action']['find']({'where':{'id':_0x3eb647[_0x0d8b('0x44')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x53e399,null))['then'](function(_0x587128){if(_0x587128){return _0x587128[_0x0d8b('0x51')](_0x3eb647[_0x0d8b('0x29')][_0x0d8b('0x4d')],_[_0x0d8b('0x52')](_0x3eb647[_0x0d8b('0x29')],[_0x0d8b('0x4d'),'id'])||{});}})[_0x0d8b('0x24')](respondWithResult(_0x53e399,null))['catch'](handleError(_0x53e399,null));};exports[_0x0d8b('0x53')]=function(_0x5878c2,_0x1a203e,_0x2c6242){var _0x2bb690={};var _0x14a34b={};var _0x49f610;var _0x3fe47d;return db['Automation'][_0x0d8b('0x4f')]({'where':{'id':_0x5878c2[_0x0d8b('0x44')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x1a203e,null))[_0x0d8b('0x24')](function(_0xc5c35f){if(_0xc5c35f){_0x49f610=_0xc5c35f;_0x14a34b[_0x0d8b('0x31')]=_[_0x0d8b('0x34')](db[_0x0d8b('0x54')][_0x0d8b('0x45')]);_0x14a34b[_0x0d8b('0x33')]=_['keys'](_0x5878c2[_0x0d8b('0x33')]);_0x14a34b['filters']=_[_0x0d8b('0x36')](_0x14a34b[_0x0d8b('0x31')],_0x14a34b['query']);_0x2bb690[_0x0d8b('0x37')]=_['intersection'](_0x14a34b[_0x0d8b('0x31')],qs[_0x0d8b('0x38')](_0x5878c2[_0x0d8b('0x33')][_0x0d8b('0x38')]));_0x2bb690[_0x0d8b('0x37')]=_0x2bb690[_0x0d8b('0x37')][_0x0d8b('0x46')]?_0x2bb690[_0x0d8b('0x37')]:_0x14a34b['model'];_0x2bb690[_0x0d8b('0x3c')]=qs[_0x0d8b('0x3d')](_0x5878c2['query'][_0x0d8b('0x3d')]);_0x2bb690[_0x0d8b('0x3e')]=qs[_0x0d8b('0x35')](_[_0x0d8b('0x50')](_0x5878c2[_0x0d8b('0x33')],_0x14a34b[_0x0d8b('0x35')]));if(_0x5878c2[_0x0d8b('0x33')][_0x0d8b('0x3f')]){_0x2bb690[_0x0d8b('0x3e')]=_[_0x0d8b('0x40')](_0x2bb690[_0x0d8b('0x3e')],{'$or':_[_0x0d8b('0x32')](_0x2bb690['attributes'],function(_0x1ece98){var _0x93fc55={};_0x93fc55[_0x1ece98]={'$like':'%'+_0x5878c2[_0x0d8b('0x33')]['filter']+'%'};return _0x93fc55;})});}_0x2bb690=_['merge']({},_0x2bb690,_0x5878c2[_0x0d8b('0x42')]);return _0x49f610[_0x0d8b('0x53')](_0x2bb690);}})[_0x0d8b('0x24')](function(_0x5b76af){if(_0x5b76af){_0x3fe47d=_0x5b76af['length'];if(!_0x5878c2[_0x0d8b('0x33')][_0x0d8b('0x39')](_0x0d8b('0x3a'))){_0x2bb690[_0x0d8b('0x3b')]=qs[_0x0d8b('0x3b')](_0x5878c2[_0x0d8b('0x33')][_0x0d8b('0x3b')]);_0x2bb690[_0x0d8b('0x1c')]=qs[_0x0d8b('0x1c')](_0x5878c2[_0x0d8b('0x33')][_0x0d8b('0x1c')]);}return _0x49f610[_0x0d8b('0x53')](_0x2bb690);}})[_0x0d8b('0x24')](function(_0x5dbc6b){if(_0x5dbc6b){return _0x5dbc6b?{'count':_0x3fe47d,'rows':_0x5dbc6b}:null;}})[_0x0d8b('0x24')](respondWithResult(_0x1a203e,null))[_0x0d8b('0x4a')](handleError(_0x1a203e,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 1e4342d..6a8c3d3 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 _0x112f=['lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','Automation','tools_automations'];(function(_0x132ac4,_0x4433e1){var _0x3c37cb=function(_0x46c973){while(--_0x46c973){_0x132ac4['push'](_0x132ac4['shift']());}};_0x3c37cb(++_0x4433e1);}(_0x112f,0x11e));var _0xf112=function(_0xa48618,_0x5afc11){_0xa48618=_0xa48618-0x0;var _0xf6f6a5=_0x112f[_0xa48618];return _0xf6f6a5;};'use strict';var _=require(_0xf112('0x0'));var util=require('util');var logger=require(_0xf112('0x1'))('api');var moment=require(_0xf112('0x2'));var BPromise=require(_0xf112('0x3'));var rp=require(_0xf112('0x4'));var fs=require('fs');var path=require(_0xf112('0x5'));var rimraf=require('rimraf');var config=require(_0xf112('0x6'));var attributes=require('./automation.attributes');module[_0xf112('0x7')]=function(_0x2ca020,_0x1b060d){return _0x2ca020[_0xf112('0x8')](_0xf112('0x9'),attributes,{'tableName':_0xf112('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x36bd=['./automation.attributes','exports','define','Automation','tools_automations','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x4857a4,_0x34f0f2){var _0xe96904=function(_0x45dc84){while(--_0x45dc84){_0x4857a4['push'](_0x4857a4['shift']());}};_0xe96904(++_0x34f0f2);}(_0x36bd,0x179));var _0xd36b=function(_0x1e7619,_0x7e0a9b){_0x1e7619=_0x1e7619-0x0;var _0x43835e=_0x36bd[_0x1e7619];return _0x43835e;};'use strict';var _=require(_0xd36b('0x0'));var util=require(_0xd36b('0x1'));var logger=require('../../config/logger')(_0xd36b('0x2'));var moment=require(_0xd36b('0x3'));var BPromise=require(_0xd36b('0x4'));var rp=require(_0xd36b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd36b('0x6'));var config=require('../../config/environment');var attributes=require(_0xd36b('0x7'));module[_0xd36b('0x8')]=function(_0x45ddae,_0xdd7308){return _0x45ddae[_0xd36b('0x9')](_0xd36b('0xa'),attributes,{'tableName':_0xd36b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 39b16b8..6081346 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 _0xe52b=['debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','Automation,\x20%s,\x20%s'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe52b,0x11a));var _0xbe52=function(_0x1bc611,_0x57c66e){_0x1bc611=_0x1bc611-0x0;var _0x356f76=_0xe52b[_0x1bc611];return _0x356f76;};'use strict';var _=require(_0xbe52('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe52('0x1'));var fs=require('fs');var Redis=require(_0xbe52('0x2'));var db=require(_0xbe52('0x3'))['db'];var utils=require(_0xbe52('0x4'));var logger=require('../../config/logger')(_0xbe52('0x5'));var config=require('../../config/environment');var jayson=require(_0xbe52('0x6'));var client=jayson[_0xbe52('0x7')][_0xbe52('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x379e1d,_0x5594af,_0x41bf76){return new BPromise(function(_0x310c3f,_0x329d9f){return client[_0xbe52('0x9')](_0x379e1d,_0x41bf76)['then'](function(_0x255657){logger[_0xbe52('0xa')](_0xbe52('0xb'),_0x5594af,'request\x20sent');logger[_0xbe52('0xc')](_0xbe52('0xd'),_0x5594af,_0xbe52('0xe'),JSON[_0xbe52('0xf')](_0x255657));if(_0x255657[_0xbe52('0x10')]){if(_0x255657[_0xbe52('0x10')][_0xbe52('0x11')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x5594af,_0x255657[_0xbe52('0x10')][_0xbe52('0x12')]);return _0x329d9f(_0x255657[_0xbe52('0x10')][_0xbe52('0x12')]);}logger[_0xbe52('0x10')](_0xbe52('0xb'),_0x5594af,_0x255657[_0xbe52('0x10')][_0xbe52('0x12')]);return _0x310c3f(_0x255657['error'][_0xbe52('0x12')]);}else{logger[_0xbe52('0xa')](_0xbe52('0xb'),_0x5594af,_0xbe52('0xe'));_0x310c3f(_0x255657[_0xbe52('0x13')][_0xbe52('0x12')]);}})[_0xbe52('0x14')](function(_0x3aea2f){logger[_0xbe52('0x10')](_0xbe52('0xb'),_0x5594af,_0x3aea2f);_0x329d9f(_0x3aea2f);});});}
\ No newline at end of file
+var _0x9e16=['bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x8769e0,_0x349138){var _0x3668d3=function(_0x34bbe1){while(--_0x34bbe1){_0x8769e0['push'](_0x8769e0['shift']());}};_0x3668d3(++_0x349138);}(_0x9e16,0x19b));var _0x69e1=function(_0x255e94,_0x1fd934){_0x255e94=_0x255e94-0x0;var _0x4d45c7=_0x9e16[_0x255e94];return _0x4d45c7;};'use strict';var _=require(_0x69e1('0x0'));var util=require(_0x69e1('0x1'));var moment=require(_0x69e1('0x2'));var BPromise=require(_0x69e1('0x3'));var rs=require(_0x69e1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x69e1('0x5'))(_0x69e1('0x6'));var config=require(_0x69e1('0x7'));var jayson=require(_0x69e1('0x8'));var client=jayson[_0x69e1('0x9')][_0x69e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x472f65,_0x3b5062,_0x2410be){return new BPromise(function(_0x1c27da,_0xf6a7a1){return client[_0x69e1('0xb')](_0x472f65,_0x2410be)[_0x69e1('0xc')](function(_0x5ef11f){logger[_0x69e1('0xd')](_0x69e1('0xe'),_0x3b5062,_0x69e1('0xf'));logger[_0x69e1('0x10')](_0x69e1('0x11'),_0x3b5062,_0x69e1('0xf'),JSON[_0x69e1('0x12')](_0x5ef11f));if(_0x5ef11f[_0x69e1('0x13')]){if(_0x5ef11f[_0x69e1('0x13')]['code']===0x1f4){logger[_0x69e1('0x13')](_0x69e1('0xe'),_0x3b5062,_0x5ef11f[_0x69e1('0x13')][_0x69e1('0x14')]);return _0xf6a7a1(_0x5ef11f[_0x69e1('0x13')][_0x69e1('0x14')]);}logger[_0x69e1('0x13')](_0x69e1('0xe'),_0x3b5062,_0x5ef11f['error'][_0x69e1('0x14')]);return _0x1c27da(_0x5ef11f[_0x69e1('0x13')][_0x69e1('0x14')]);}else{logger[_0x69e1('0xd')](_0x69e1('0xe'),_0x3b5062,'request\x20sent');_0x1c27da(_0x5ef11f[_0x69e1('0x15')][_0x69e1('0x14')]);}})[_0x69e1('0x16')](function(_0x3bbf61){logger[_0x69e1('0x13')]('Automation,\x20%s,\x20%s',_0x3b5062,_0x3bbf61);_0xf6a7a1(_0x3bbf61);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index e804c24..3df51dc 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 _0xc2a1=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc2a1,0x111));var _0x1c2a=function(_0x304655,_0x15b109){_0x304655=_0x304655-0x0;var _0x2fa58a=_0xc2a1[_0x304655];return _0x2fa58a;};'use strict';var multer=require('multer');var util=require(_0x1c2a('0x0'));var path=require(_0x1c2a('0x1'));var timeout=require(_0x1c2a('0x2'));var express=require(_0x1c2a('0x3'));var router=express[_0x1c2a('0x4')]();var fs_extra=require(_0x1c2a('0x5'));var auth=require(_0x1c2a('0x6'));var interaction=require(_0x1c2a('0x7'));var config=require(_0x1c2a('0x8'));var controller=require(_0x1c2a('0x9'));router[_0x1c2a('0xa')]('/',auth[_0x1c2a('0xb')](),controller[_0x1c2a('0xc')]);router[_0x1c2a('0xa')](_0x1c2a('0xd'),auth[_0x1c2a('0xb')](),controller[_0x1c2a('0xe')]);router[_0x1c2a('0xa')](_0x1c2a('0xf'),auth['isAuthenticated'](),controller['getConditions']);router['get'](_0x1c2a('0x10'),auth[_0x1c2a('0xb')](),controller[_0x1c2a('0x11')]);router[_0x1c2a('0x12')]('/',auth[_0x1c2a('0xb')](),controller[_0x1c2a('0x13')]);router[_0x1c2a('0x12')]('/:id/conditions',auth[_0x1c2a('0xb')](),controller[_0x1c2a('0x14')]);router[_0x1c2a('0x12')](_0x1c2a('0x10'),auth[_0x1c2a('0xb')](),controller[_0x1c2a('0x15')]);router[_0x1c2a('0x16')](_0x1c2a('0xd'),auth[_0x1c2a('0xb')](),controller[_0x1c2a('0x17')]);router[_0x1c2a('0x18')]('/:id',auth[_0x1c2a('0xb')](),controller[_0x1c2a('0x19')]);module[_0x1c2a('0x1a')]=router;
\ No newline at end of file
+var _0x17fb=['getActions','post','create','addConditions','addActions','update','/:id','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions'];(function(_0x21dfd7,_0x5ef1bb){var _0xad6e6f=function(_0x1fd1bd){while(--_0x1fd1bd){_0x21dfd7['push'](_0x21dfd7['shift']());}};_0xad6e6f(++_0x5ef1bb);}(_0x17fb,0xb0));var _0xb17f=function(_0x4bd06e,_0x593701){_0x4bd06e=_0x4bd06e-0x0;var _0x85ebb=_0x17fb[_0x4bd06e];return _0x85ebb;};'use strict';var multer=require('multer');var util=require(_0xb17f('0x0'));var path=require(_0xb17f('0x1'));var timeout=require('connect-timeout');var express=require(_0xb17f('0x2'));var router=express['Router']();var fs_extra=require(_0xb17f('0x3'));var auth=require(_0xb17f('0x4'));var interaction=require(_0xb17f('0x5'));var config=require(_0xb17f('0x6'));var controller=require('./automation.controller');router[_0xb17f('0x7')]('/',auth[_0xb17f('0x8')](),controller['index']);router[_0xb17f('0x7')]('/:id',auth[_0xb17f('0x8')](),controller[_0xb17f('0x9')]);router['get'](_0xb17f('0xa'),auth[_0xb17f('0x8')](),controller[_0xb17f('0xb')]);router['get'](_0xb17f('0xc'),auth[_0xb17f('0x8')](),controller[_0xb17f('0xd')]);router[_0xb17f('0xe')]('/',auth[_0xb17f('0x8')](),controller[_0xb17f('0xf')]);router[_0xb17f('0xe')](_0xb17f('0xa'),auth[_0xb17f('0x8')](),controller[_0xb17f('0x10')]);router['post'](_0xb17f('0xc'),auth['isAuthenticated'](),controller[_0xb17f('0x11')]);router['put']('/:id',auth[_0xb17f('0x8')](),controller[_0xb17f('0x12')]);router['delete'](_0xb17f('0x13'),auth[_0xb17f('0x8')](),controller['destroy']);module[_0xb17f('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index a25e96d..d4241b8 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 _0x591a=['#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence'];(function(_0x5c4b74,_0x240a7c){var _0x237de2=function(_0x2983d0){while(--_0x2983d0){_0x5c4b74['push'](_0x5c4b74['shift']());}};_0x237de2(++_0x240a7c);}(_0x591a,0x7c));var _0xa591=function(_0xf51c06,_0x388e5b){_0xf51c06=_0xf51c06-0x0;var _0x1d5420=_0x591a[_0xf51c06];return _0x1d5420;};'use strict';var Sequelize=require(_0xa591('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xa591('0x1')](_0xa591('0x2')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xa591('0x3')]},'active':{'type':Sequelize[_0xa591('0x4')],'defaultValue':0x0,'comment':_0xa591('0x5')},'limitCalls':{'type':Sequelize[_0xa591('0x6')](0x4)[_0xa591('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xa591('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xa591('0x3')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xa591('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa591('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xa591('0x6')](0x5)[_0xa591('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa591('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xa591('0x6')](0x3)[_0xa591('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa591('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa591('0x6')](0x5)[_0xa591('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa591('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa591('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa591('0x6')](0x5)[_0xa591('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa591('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xa591('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa591('0xe')},'dialTimezone':{'type':Sequelize[_0xa591('0x3')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa591('0x3')],'defaultValue':_0xa591('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xa591('0x1')](_0xa591('0x10'),'never',_0xa591('0x11')),'defaultValue':_0xa591('0x10')},'dialAMDActive':{'type':Sequelize[_0xa591('0x4')],'defaultValue':0x0,'comment':_0xa591('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xa591('0x6')](0x9)[_0xa591('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa591('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xa591('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xa591('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa591('0x6')](0x9)[_0xa591('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa591('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa591('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xa591('0x6')](0x9)[_0xa591('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa591('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa591('0x6')](0x9)[_0xa591('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa591('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xa591('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa591('0x6')](0x5)[_0xa591('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa591('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa591('0x6')](0x9)[_0xa591('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xa591('0x19'),_0xa591('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xa591('0x3')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xa591('0x6')](0x3)[_0xa591('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa591('0x1b')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xa591('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa591('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa591('0x6')](0x3)[_0xa591('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa591('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa591('0x6')](0x5)[_0xa591('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa591('0x1e')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa591('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa591('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0xa591('0x6')](0x5)[_0xa591('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa591('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa591('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa591('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa591('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa591('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0xa591('0x6')](0x5)[_0xa591('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa591('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa591('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa591('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa591('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa591('0x24')}};
\ No newline at end of file
+var _0x4c0f=['Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#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\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\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)'];(function(_0x319b47,_0x31417f){var _0x509211=function(_0x10f2b0){while(--_0x10f2b0){_0x319b47['push'](_0x319b47['shift']());}};_0x509211(++_0x31417f);}(_0x4c0f,0x1a6));var _0xf4c0=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x4c0f[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0xf4c0('0x0'));module[_0xf4c0('0x1')]={'name':{'type':Sequelize[_0xf4c0('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xf4c0('0x3')](_0xf4c0('0x4')),'allowNull':![],'defaultValue':_0xf4c0('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xf4c0('0x5')],'defaultValue':0x0,'comment':_0xf4c0('0x6')},'limitCalls':{'type':Sequelize[_0xf4c0('0x7')](0x4)[_0xf4c0('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf4c0('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf4c0('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf4c0('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xf4c0('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4c0('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf4c0('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4c0('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf4c0('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xf4c0('0x7')](0x3)[_0xf4c0('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4c0('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf4c0('0x7')](0x5)[_0xf4c0('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4c0('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf4c0('0x8')],'defaultValue':0x3,'comment':_0xf4c0('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf4c0('0x7')](0x5)[_0xf4c0('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4c0('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xf4c0('0x7')](0x3)[_0xf4c0('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf4c0('0x10')},'dialTimezone':{'type':Sequelize[_0xf4c0('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf4c0('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xf4c0('0x3')](_0xf4c0('0x11'),'never',_0xf4c0('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xf4c0('0x5')],'defaultValue':0x0,'comment':_0xf4c0('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xf4c0('0x7')](0x9)[_0xf4c0('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf4c0('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xf4c0('0x7')](0x9)[_0xf4c0('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf4c0('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf4c0('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf4c0('0x7')](0x9)[_0xf4c0('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf4c0('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xf4c0('0x7')](0x9)[_0xf4c0('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf4c0('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf4c0('0x7')](0x9)[_0xf4c0('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf4c0('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xf4c0('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xf4c0('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf4c0('0x7')](0x5)[_0xf4c0('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf4c0('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf4c0('0x7')](0x9)[_0xf4c0('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf4c0('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0xf4c0('0x3')](_0xf4c0('0x1d'),'ASC'),'defaultValue':_0xf4c0('0x1d')},'dialPrefix':{'type':Sequelize[_0xf4c0('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf4c0('0x7')](0x3)[_0xf4c0('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf4c0('0x1e')},'dialCutDigit':{'type':Sequelize[_0xf4c0('0x7')](0x3)[_0xf4c0('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xf4c0('0x7')](0x3)[_0xf4c0('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4c0('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf4c0('0x7')](0x5)[_0xf4c0('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4c0('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xf4c0('0x7')](0x3)[_0xf4c0('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4c0('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0xf4c0('0x7')](0x5)[_0xf4c0('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4c0('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf4c0('0x7')](0x3)[_0xf4c0('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf4c0('0x7')](0x5)[_0xf4c0('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4c0('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0xf4c0('0x7')](0x3)[_0xf4c0('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xf4c0('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4c0('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xf4c0('0x7')](0x3)[_0xf4c0('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf4c0('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4c0('0x25')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 88922d1..9739c6b 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 _0x3bd0=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','IvrCampaigns','UserProfileResource','destroy','error','stack','name','send','render','merge','body','account','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','map','VIRTUAL','Campaign','includeAll','include','catch','show','params','options','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','findOne','CmHopper','hasOwnProperty','CampaignId','findAll','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','dialCheckDuplicateType','insert','cm_hopper','fromQuery','phone','scheduledAt','ListId','field','NOW()','ContactId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','from','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','into','phone\x20IS\x20NOT\x20NULL','push','sequelize','all','removeLists','ids','getBlackLists','addBlackLists','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service'];(function(_0x25dcfb,_0x4e0726){var _0x29f87f=function(_0x35e5e9){while(--_0x35e5e9){_0x25dcfb['push'](_0x25dcfb['shift']());}};_0x29f87f(++_0x4e0726);}(_0x3bd0,0xfe));var _0x03bd=function(_0x4453a9,_0x217f6c){_0x4453a9=_0x4453a9-0x0;var _0x2828ea=_0x3bd0[_0x4453a9];return _0x2828ea;};'use strict';var emlformat=require(_0x03bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x03bd('0x1'));var jsonpatch=require(_0x03bd('0x2'));var rp=require(_0x03bd('0x3'));var moment=require(_0x03bd('0x4'));var BPromise=require(_0x03bd('0x5'));var Mustache=require('mustache');var util=require(_0x03bd('0x6'));var path=require('path');var sox=require(_0x03bd('0x7'));var csv=require(_0x03bd('0x8'));var ejs=require(_0x03bd('0x9'));var fs=require('fs');var fs_extra=require(_0x03bd('0xa'));var _=require(_0x03bd('0xb'));var squel=require(_0x03bd('0xc'));var crypto=require(_0x03bd('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x03bd('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x03bd('0xf'));var Redis=require(_0x03bd('0x10'));var authService=require(_0x03bd('0x11'));var qs=require(_0x03bd('0x12'));var as=require(_0x03bd('0x13'));var hardwareService=require(_0x03bd('0x14'));var logger=require(_0x03bd('0x15'))(_0x03bd('0x16'));var utils=require(_0x03bd('0x17'));var config=require(_0x03bd('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x329b8c,_0x4933ff){_0x4933ff=_0x4933ff||0xcc;return function(_0x164759){if(_0x164759){return _0x329b8c[_0x03bd('0x19')](_0x4933ff);}return _0x329b8c[_0x03bd('0x1a')](_0x4933ff)['end']();};}function respondWithResult(_0x3b85ba,_0x1035b2){_0x1035b2=_0x1035b2||0xc8;return function(_0x30845b){if(_0x30845b){return _0x3b85ba[_0x03bd('0x1a')](_0x1035b2)[_0x03bd('0x1b')](_0x30845b);}};}function respondWithFilteredResult(_0x1c9622,_0x1a21b4){return function(_0x327d8c){if(_0x327d8c){var _0x3c5c69=typeof _0x1a21b4[_0x03bd('0x1c')]===_0x03bd('0x1d')&&typeof _0x1a21b4[_0x03bd('0x1e')]===_0x03bd('0x1d');var _0x49457c=_0x327d8c[_0x03bd('0x1f')];var _0x35b908=_0x3c5c69?0x0:_0x1a21b4[_0x03bd('0x1c')];var _0x56e2fb=_0x3c5c69?_0x327d8c[_0x03bd('0x1f')]:_0x1a21b4[_0x03bd('0x1c')]+_0x1a21b4[_0x03bd('0x1e')];var _0x5d3485;if(_0x56e2fb>=_0x49457c){_0x56e2fb=_0x49457c;_0x5d3485=0xc8;}else{_0x5d3485=0xce;}_0x1c9622[_0x03bd('0x1a')](_0x5d3485);return _0x1c9622[_0x03bd('0x20')]('Content-Range',_0x35b908+'-'+_0x56e2fb+'/'+_0x49457c)[_0x03bd('0x1b')](_0x327d8c);}return null;};}function patchUpdates(_0x4b09ad){return function(_0x533866){try{jsonpatch[_0x03bd('0x21')](_0x533866,_0x4b09ad,!![]);}catch(_0x199962){return BPromise[_0x03bd('0x22')](_0x199962);}return _0x533866[_0x03bd('0x23')]();};}function saveUpdates(_0xd73767,_0x46e7d4){return function(_0x266cf1){if(_0x266cf1){return _0x266cf1[_0x03bd('0x24')](_0xd73767)['then'](function(_0x2735f2){return _0x2735f2;});}return null;};}function removeEntity(_0x20f37d,_0x574f85){return function(_0x497118){if(_0x497118){return _0x497118['destroy']()[_0x03bd('0x25')](function(){var _0x3f30e5=_0x497118[_0x03bd('0x26')]({'plain':!![]});var _0x36ae15=_0x03bd('0x27');return db[_0x03bd('0x28')][_0x03bd('0x29')]({'where':{'type':_0x36ae15,'resourceId':_0x3f30e5['id']}})[_0x03bd('0x25')](function(){return _0x497118;});})[_0x03bd('0x25')](function(){_0x20f37d[_0x03bd('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18e052,_0x373708){return function(_0x34d763){if(!_0x34d763){_0x18e052[_0x03bd('0x19')](0x194);}return _0x34d763;};}function handleError(_0x4ef79d,_0x435ad0){_0x435ad0=_0x435ad0||0x1f4;return function(_0x17af64){logger[_0x03bd('0x2a')](_0x17af64[_0x03bd('0x2b')]);if(_0x17af64[_0x03bd('0x2c')]){delete _0x17af64[_0x03bd('0x2c')];}_0x4ef79d[_0x03bd('0x1a')](_0x435ad0)[_0x03bd('0x2d')](_0x17af64);};}function getMustacheRender(_0x1b44b6,_0x3970b6){return Mustache[_0x03bd('0x2e')](_0x1b44b6,_[_0x03bd('0x2f')](_0x3970b6[_0x03bd('0x30')],{'contact':_0x3970b6['contact'],'message':_0x3970b6['message'],'agent':_0x3970b6['agent'],'interaction':_0x3970b6['interaction'],'account':_0x3970b6[_0x03bd('0x31')]}))||'';}exports['index']=function(_0x3fe57f,_0x5cf736){var _0x3c2f3b={},_0x391a7a={},_0x599c70={'count':0x0,'rows':[]};var _0x1cf1fe=_['map'](db['Campaign'][_0x03bd('0x32')],function(_0xb13209){return{'name':_0xb13209['fieldName'],'type':_0xb13209[_0x03bd('0x33')][_0x03bd('0x34')]};});_0x391a7a[_0x03bd('0x35')]=_['map'](_0x1cf1fe,_0x03bd('0x2c'));_0x391a7a[_0x03bd('0x36')]=_[_0x03bd('0x37')](_0x3fe57f[_0x03bd('0x36')]);_0x391a7a[_0x03bd('0x38')]=_['intersection'](_0x391a7a['model'],_0x391a7a[_0x03bd('0x36')]);_0x3c2f3b[_0x03bd('0x39')]=_[_0x03bd('0x3a')](_0x391a7a[_0x03bd('0x35')],qs[_0x03bd('0x3b')](_0x3fe57f[_0x03bd('0x36')][_0x03bd('0x3b')]));_0x3c2f3b[_0x03bd('0x39')]=_0x3c2f3b[_0x03bd('0x39')][_0x03bd('0x3c')]?_0x3c2f3b[_0x03bd('0x39')]:_0x391a7a[_0x03bd('0x35')];if(!_0x3fe57f['query']['hasOwnProperty'](_0x03bd('0x3d'))){_0x3c2f3b['limit']=qs['limit'](_0x3fe57f[_0x03bd('0x36')][_0x03bd('0x1e')]);_0x3c2f3b[_0x03bd('0x1c')]=qs[_0x03bd('0x1c')](_0x3fe57f[_0x03bd('0x36')][_0x03bd('0x1c')]);}_0x3c2f3b[_0x03bd('0x3e')]=qs[_0x03bd('0x3f')](_0x3fe57f['query'][_0x03bd('0x3f')]);_0x3c2f3b['where']=qs[_0x03bd('0x38')](_[_0x03bd('0x40')](_0x3fe57f[_0x03bd('0x36')],_0x391a7a['filters']),_0x1cf1fe);if(_0x3fe57f[_0x03bd('0x36')][_0x03bd('0x41')]){_0x3c2f3b[_0x03bd('0x42')]=_[_0x03bd('0x2f')](_0x3c2f3b[_0x03bd('0x42')],{'$or':_[_0x03bd('0x43')](_0x1cf1fe,function(_0x2c3a79){if(_0x2c3a79[_0x03bd('0x33')]!==_0x03bd('0x44')){var _0x16b2b1={};_0x16b2b1[_0x2c3a79[_0x03bd('0x2c')]]={'$like':'%'+_0x3fe57f['query']['filter']+'%'};return _0x16b2b1;}})});}_0x3c2f3b=_[_0x03bd('0x2f')]({},_0x3c2f3b,_0x3fe57f['options']);var _0x48ce0f={'where':_0x3c2f3b['where']};return db[_0x03bd('0x45')][_0x03bd('0x1f')](_0x48ce0f)[_0x03bd('0x25')](function(_0x54586d){_0x599c70[_0x03bd('0x1f')]=_0x54586d;if(_0x3fe57f['query'][_0x03bd('0x46')]){_0x3c2f3b[_0x03bd('0x47')]=[{'all':!![]}];}return db[_0x03bd('0x45')]['findAll'](_0x3c2f3b);})[_0x03bd('0x25')](function(_0x508d28){_0x599c70['rows']=_0x508d28;return _0x599c70;})[_0x03bd('0x25')](respondWithFilteredResult(_0x5cf736,_0x3c2f3b))[_0x03bd('0x48')](handleError(_0x5cf736,null));};exports[_0x03bd('0x49')]=function(_0x4a9ccd,_0x77482e){var _0x14247a={'raw':![],'where':{'id':_0x4a9ccd[_0x03bd('0x4a')]['id']}},_0x33533f={};_0x33533f['model']=_[_0x03bd('0x37')](db[_0x03bd('0x45')][_0x03bd('0x32')]);_0x33533f[_0x03bd('0x36')]=_[_0x03bd('0x37')](_0x4a9ccd[_0x03bd('0x36')]);_0x33533f[_0x03bd('0x38')]=_[_0x03bd('0x3a')](_0x33533f['model'],_0x33533f['query']);_0x14247a[_0x03bd('0x39')]=_[_0x03bd('0x3a')](_0x33533f[_0x03bd('0x35')],qs[_0x03bd('0x3b')](_0x4a9ccd['query']['fields']));_0x14247a['attributes']=_0x14247a[_0x03bd('0x39')][_0x03bd('0x3c')]?_0x14247a['attributes']:_0x33533f['model'];if(_0x4a9ccd[_0x03bd('0x36')][_0x03bd('0x46')]){_0x14247a[_0x03bd('0x47')]=[{'all':!![]}];}_0x14247a=_[_0x03bd('0x2f')]({},_0x14247a,_0x4a9ccd[_0x03bd('0x4b')]);return db['Campaign'][_0x03bd('0x4c')](_0x14247a)[_0x03bd('0x25')](handleEntityNotFound(_0x77482e,null))[_0x03bd('0x25')](respondWithResult(_0x77482e,null))[_0x03bd('0x48')](handleError(_0x77482e,null));};exports[_0x03bd('0x4d')]=function(_0x4d5e3a,_0x32e847){return db[_0x03bd('0x45')]['create'](_0x4d5e3a['body'],{})[_0x03bd('0x25')](function(_0x3463a8){var _0x2404dd=_0x4d5e3a[_0x03bd('0x4e')][_0x03bd('0x26')]({'plain':!![]});if(!_0x2404dd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2404dd[_0x03bd('0x4f')]===_0x03bd('0x4e')){var _0x34c52b=_0x3463a8['get']({'plain':!![]});var _0x2bebd6=_0x03bd('0x27');return db[_0x03bd('0x50')]['find']({'where':{'name':_0x2bebd6,'userProfileId':_0x2404dd[_0x03bd('0x51')]},'raw':!![]})[_0x03bd('0x25')](function(_0xe20226){if(_0xe20226&&_0xe20226[_0x03bd('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x34c52b[_0x03bd('0x2c')],'resourceId':_0x34c52b['id'],'type':_0xe20226[_0x03bd('0x2c')],'sectionId':_0xe20226['id']},{})['then'](function(){return _0x3463a8;});}else{return _0x3463a8;}})[_0x03bd('0x48')](function(_0x37d4f1){logger[_0x03bd('0x2a')](_0x03bd('0x53'),_0x37d4f1);throw _0x37d4f1;});}return _0x3463a8;})[_0x03bd('0x25')](respondWithResult(_0x32e847,0xc9))[_0x03bd('0x48')](handleError(_0x32e847,null));};exports[_0x03bd('0x54')]=function(_0x417721,_0x2b2f7e){var _0x125c89={'where':{'id':_0x417721[_0x03bd('0x4a')]['id']}},_0x8acc31={};_0x8acc31[_0x03bd('0x35')]=_[_0x03bd('0x37')](db['Campaign'][_0x03bd('0x32')]);_0x125c89['attributes']=_[_0x03bd('0x3a')](_0x8acc31[_0x03bd('0x35')],qs[_0x03bd('0x3b')](_0x417721[_0x03bd('0x36')][_0x03bd('0x3b')]));_0x125c89['attributes']=_0x125c89[_0x03bd('0x39')][_0x03bd('0x3c')]?_0x125c89[_0x03bd('0x39')]:_0x8acc31[_0x03bd('0x35')];if(_0x417721['query'][_0x03bd('0x46')]){_0x125c89['include']=[{'all':!![]}];}_0x125c89=_[_0x03bd('0x2f')]({},_0x125c89,_0x417721[_0x03bd('0x4b')]);return db[_0x03bd('0x45')][_0x03bd('0x4c')](_0x125c89)[_0x03bd('0x25')](handleEntityNotFound(_0x2b2f7e,null))['then'](function(_0x4f1cce){if(_0x4f1cce){var _0x21c1e9=_0x4f1cce[_0x03bd('0x26')]({'plain':!![]});_0x21c1e9=qs[_0x03bd('0x55')](_0x21c1e9,['id',_0x03bd('0x56'),_0x03bd('0x57')]);_0x417721['body']=_[_0x03bd('0x55')](_0x417721['body'],['id',_0x03bd('0x56'),_0x03bd('0x57')]);return db[_0x03bd('0x45')][_0x03bd('0x4d')](_['merge'](_0x21c1e9,_0x417721['body']),{'include':_0x417721[_0x03bd('0x36')][_0x03bd('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x48be56){var _0x193e6e=_0x417721[_0x03bd('0x4e')]['get']({'plain':!![]});if(!_0x193e6e)throw new Error(_0x03bd('0x58'));if(_0x193e6e[_0x03bd('0x4f')]==='user'){var _0x1c6a2b=_0x48be56['get']({'plain':!![]});var _0x32f0b7=_0x03bd('0x27');return db[_0x03bd('0x50')][_0x03bd('0x4c')]({'where':{'name':_0x32f0b7,'userProfileId':_0x193e6e[_0x03bd('0x51')]},'raw':!![]})['then'](function(_0x356986){if(_0x356986&&_0x356986[_0x03bd('0x52')]===0x0){return db[_0x03bd('0x28')]['create']({'name':_0x1c6a2b[_0x03bd('0x2c')],'resourceId':_0x1c6a2b['id'],'type':_0x356986[_0x03bd('0x2c')],'sectionId':_0x356986['id']},{})['then'](function(){return _0x48be56;});}else{return _0x48be56;}})['catch'](function(_0xf9dcb4){logger['error'](_0x03bd('0x53'),_0xf9dcb4);throw _0xf9dcb4;});}return _0x48be56;});}})[_0x03bd('0x25')](respondWithResult(_0x2b2f7e,0xc9))[_0x03bd('0x48')](handleError(_0x2b2f7e,null));};exports[_0x03bd('0x24')]=function(_0x10e8b7,_0x47bc3e){if(_0x10e8b7[_0x03bd('0x30')]['id']){delete _0x10e8b7[_0x03bd('0x30')]['id'];}return db[_0x03bd('0x45')]['find']({'where':{'id':_0x10e8b7[_0x03bd('0x4a')]['id']}})[_0x03bd('0x25')](handleEntityNotFound(_0x47bc3e,null))['then'](saveUpdates(_0x10e8b7[_0x03bd('0x30')],null))[_0x03bd('0x25')](respondWithResult(_0x47bc3e,null))[_0x03bd('0x48')](handleError(_0x47bc3e,null));};exports['destroy']=function(_0x2c8159,_0x11d896){return db[_0x03bd('0x45')][_0x03bd('0x4c')]({'where':{'id':_0x2c8159[_0x03bd('0x4a')]['id']}})[_0x03bd('0x25')](handleEntityNotFound(_0x11d896,null))['then'](removeEntity(_0x11d896,null))[_0x03bd('0x48')](handleError(_0x11d896,null));};exports[_0x03bd('0x59')]=function(_0x3a0de3,_0x16eb65,_0x36c539){var _0x8c64bd={'raw':!![],'where':{}};var _0x31d7a5={};var _0x5eaea6={'count':0x0,'rows':[]};return db[_0x03bd('0x45')][_0x03bd('0x5a')]({'where':{'id':_0x3a0de3[_0x03bd('0x4a')]['id']}})[_0x03bd('0x25')](handleEntityNotFound(_0x16eb65,null))[_0x03bd('0x25')](function(_0x2b6c56){if(_0x2b6c56){_0x31d7a5[_0x03bd('0x35')]=_[_0x03bd('0x37')](db[_0x03bd('0x5b')][_0x03bd('0x32')]);_0x31d7a5[_0x03bd('0x36')]=_['keys'](_0x3a0de3[_0x03bd('0x36')]);_0x31d7a5[_0x03bd('0x38')]=_[_0x03bd('0x3a')](_0x31d7a5['model'],_0x31d7a5['query']);_0x8c64bd[_0x03bd('0x39')]=_['intersection'](_0x31d7a5[_0x03bd('0x35')],qs[_0x03bd('0x3b')](_0x3a0de3['query'][_0x03bd('0x3b')]));_0x8c64bd['attributes']=_0x8c64bd[_0x03bd('0x39')]['length']?_0x8c64bd[_0x03bd('0x39')]:_0x31d7a5[_0x03bd('0x35')];if(!_0x3a0de3[_0x03bd('0x36')][_0x03bd('0x5c')](_0x03bd('0x3d'))){_0x8c64bd[_0x03bd('0x1e')]=qs[_0x03bd('0x1e')](_0x3a0de3[_0x03bd('0x36')][_0x03bd('0x1e')]);_0x8c64bd['offset']=qs[_0x03bd('0x1c')](_0x3a0de3[_0x03bd('0x36')]['offset']);}_0x8c64bd['order']=qs[_0x03bd('0x3f')](_0x3a0de3['query'][_0x03bd('0x3f')]);_0x8c64bd[_0x03bd('0x42')]=qs[_0x03bd('0x38')](_[_0x03bd('0x40')](_0x3a0de3['query'],_0x31d7a5[_0x03bd('0x38')]));_0x8c64bd['where'][_0x03bd('0x5d')]=_0x2b6c56['id'];if(_0x3a0de3['query'][_0x03bd('0x41')]){_0x8c64bd[_0x03bd('0x42')]=_[_0x03bd('0x2f')](_0x8c64bd[_0x03bd('0x42')],{'$or':_[_0x03bd('0x43')](_0x8c64bd['attributes'],function(_0x516ec1){var _0x59aca9={};_0x59aca9[_0x516ec1]={'$like':'%'+_0x3a0de3['query'][_0x03bd('0x41')]+'%'};return _0x59aca9;})});}_0x8c64bd=_[_0x03bd('0x2f')]({},_0x8c64bd,_0x3a0de3[_0x03bd('0x4b')]);return db['CmHopper'][_0x03bd('0x1f')]({'where':_0x8c64bd[_0x03bd('0x42')]})['then'](function(_0x3de667){_0x5eaea6['count']=_0x3de667;if(_0x3a0de3[_0x03bd('0x36')]['includeAll']){_0x8c64bd[_0x03bd('0x47')]=[{'all':!![]}];}return db['CmHopper'][_0x03bd('0x5e')](_0x8c64bd);})[_0x03bd('0x25')](function(_0x3997cb){_0x5eaea6[_0x03bd('0x5f')]=_0x3997cb;return _0x5eaea6;});}})[_0x03bd('0x25')](respondWithFilteredResult(_0x16eb65,_0x8c64bd))[_0x03bd('0x48')](handleError(_0x16eb65,null));};exports[_0x03bd('0x60')]=function(_0x1765f3,_0x4b7e7b,_0x3163a7){var _0x25c356={'raw':!![],'where':{}};var _0x147524={};var _0xe90322={'count':0x0,'rows':[]};return db[_0x03bd('0x45')][_0x03bd('0x5a')]({'where':{'id':_0x1765f3[_0x03bd('0x4a')]['id']}})[_0x03bd('0x25')](handleEntityNotFound(_0x4b7e7b,null))[_0x03bd('0x25')](function(_0x14b285){if(_0x14b285){_0x147524[_0x03bd('0x35')]=_[_0x03bd('0x37')](db[_0x03bd('0x61')][_0x03bd('0x32')]);_0x147524['query']=_['keys'](_0x1765f3[_0x03bd('0x36')]);_0x147524['filters']=_[_0x03bd('0x3a')](_0x147524['model'],_0x147524[_0x03bd('0x36')]);_0x25c356[_0x03bd('0x39')]=_[_0x03bd('0x3a')](_0x147524[_0x03bd('0x35')],qs[_0x03bd('0x3b')](_0x1765f3[_0x03bd('0x36')][_0x03bd('0x3b')]));_0x25c356[_0x03bd('0x39')]=_0x25c356[_0x03bd('0x39')][_0x03bd('0x3c')]?_0x25c356['attributes']:_0x147524['model'];if(!_0x1765f3[_0x03bd('0x36')][_0x03bd('0x5c')](_0x03bd('0x3d'))){_0x25c356['limit']=qs[_0x03bd('0x1e')](_0x1765f3['query'][_0x03bd('0x1e')]);_0x25c356[_0x03bd('0x1c')]=qs[_0x03bd('0x1c')](_0x1765f3[_0x03bd('0x36')]['offset']);}_0x25c356[_0x03bd('0x3e')]=qs[_0x03bd('0x3f')](_0x1765f3[_0x03bd('0x36')][_0x03bd('0x3f')]);_0x25c356['where']=qs[_0x03bd('0x38')](_[_0x03bd('0x40')](_0x1765f3['query'],_0x147524['filters']));_0x25c356[_0x03bd('0x42')][_0x03bd('0x5d')]=_0x14b285['id'];if(_0x1765f3[_0x03bd('0x36')][_0x03bd('0x41')]){_0x25c356[_0x03bd('0x42')]=_[_0x03bd('0x2f')](_0x25c356[_0x03bd('0x42')],{'$or':_[_0x03bd('0x43')](_0x25c356[_0x03bd('0x39')],function(_0x518925){var _0x11c726={};_0x11c726[_0x518925]={'$like':'%'+_0x1765f3[_0x03bd('0x36')][_0x03bd('0x41')]+'%'};return _0x11c726;})});}_0x25c356=_[_0x03bd('0x2f')]({},_0x25c356,_0x1765f3[_0x03bd('0x4b')]);return db[_0x03bd('0x61')][_0x03bd('0x1f')]({'where':_0x25c356[_0x03bd('0x42')]})['then'](function(_0x13843b){_0xe90322[_0x03bd('0x1f')]=_0x13843b;if(_0x1765f3[_0x03bd('0x36')]['includeAll']){_0x25c356[_0x03bd('0x47')]=[{'all':!![]}];}return db[_0x03bd('0x61')][_0x03bd('0x5e')](_0x25c356);})[_0x03bd('0x25')](function(_0x2249af){_0xe90322[_0x03bd('0x5f')]=_0x2249af;return _0xe90322;});}})['then'](respondWithFilteredResult(_0x4b7e7b,_0x25c356))[_0x03bd('0x48')](handleError(_0x4b7e7b,null));};exports['getHopperFinals']=function(_0x43fd22,_0xec1c4d,_0x372693){var _0x47201d={'raw':!![],'where':{}};var _0x4ef890={};var _0x175fac={'count':0x0,'rows':[]};return db[_0x03bd('0x45')][_0x03bd('0x5a')]({'where':{'id':_0x43fd22[_0x03bd('0x4a')]['id']}})['then'](handleEntityNotFound(_0xec1c4d,null))['then'](function(_0x5ab5d7){if(_0x5ab5d7){_0x4ef890[_0x03bd('0x35')]=_[_0x03bd('0x37')](db[_0x03bd('0x62')][_0x03bd('0x32')]);_0x4ef890[_0x03bd('0x36')]=_[_0x03bd('0x37')](_0x43fd22['query']);_0x4ef890[_0x03bd('0x38')]=_[_0x03bd('0x3a')](_0x4ef890[_0x03bd('0x35')],_0x4ef890[_0x03bd('0x36')]);_0x47201d[_0x03bd('0x39')]=_['intersection'](_0x4ef890[_0x03bd('0x35')],qs[_0x03bd('0x3b')](_0x43fd22[_0x03bd('0x36')][_0x03bd('0x3b')]));_0x47201d['attributes']=_0x47201d['attributes'][_0x03bd('0x3c')]?_0x47201d[_0x03bd('0x39')]:_0x4ef890['model'];if(!_0x43fd22[_0x03bd('0x36')]['hasOwnProperty'](_0x03bd('0x3d'))){_0x47201d[_0x03bd('0x1e')]=qs[_0x03bd('0x1e')](_0x43fd22['query'][_0x03bd('0x1e')]);_0x47201d[_0x03bd('0x1c')]=qs[_0x03bd('0x1c')](_0x43fd22[_0x03bd('0x36')][_0x03bd('0x1c')]);}_0x47201d[_0x03bd('0x3e')]=qs[_0x03bd('0x3f')](_0x43fd22[_0x03bd('0x36')][_0x03bd('0x3f')]);_0x47201d[_0x03bd('0x42')]=qs[_0x03bd('0x38')](_[_0x03bd('0x40')](_0x43fd22['query'],_0x4ef890[_0x03bd('0x38')]));_0x47201d['where'][_0x03bd('0x5d')]=_0x5ab5d7['id'];if(_0x43fd22[_0x03bd('0x36')][_0x03bd('0x41')]){_0x47201d['where']=_[_0x03bd('0x2f')](_0x47201d[_0x03bd('0x42')],{'$or':_[_0x03bd('0x43')](_0x47201d[_0x03bd('0x39')],function(_0xb800b1){var _0x22f9e6={};_0x22f9e6[_0xb800b1]={'$like':'%'+_0x43fd22['query'][_0x03bd('0x41')]+'%'};return _0x22f9e6;})});}_0x47201d=_[_0x03bd('0x2f')]({},_0x47201d,_0x43fd22['options']);return db[_0x03bd('0x62')][_0x03bd('0x1f')]({'where':_0x47201d[_0x03bd('0x42')]})[_0x03bd('0x25')](function(_0x26786c){_0x175fac[_0x03bd('0x1f')]=_0x26786c;if(_0x43fd22[_0x03bd('0x36')]['includeAll']){_0x47201d[_0x03bd('0x47')]=[{'all':!![]}];}return db[_0x03bd('0x62')][_0x03bd('0x5e')](_0x47201d);})[_0x03bd('0x25')](function(_0x14b103){_0x175fac['rows']=_0x14b103;return _0x175fac;});}})[_0x03bd('0x25')](respondWithFilteredResult(_0xec1c4d,_0x47201d))[_0x03bd('0x48')](handleError(_0xec1c4d,null));};exports[_0x03bd('0x63')]=function(_0x52cb2c,_0x4dc23a,_0x2c55bb){var _0x356f2a={'raw':!![],'where':{}};var _0x89c70b={};var _0x3f64dd={'count':0x0,'rows':[]};return db['Campaign'][_0x03bd('0x5a')]({'where':{'id':_0x52cb2c['params']['id']}})[_0x03bd('0x25')](handleEntityNotFound(_0x4dc23a,null))[_0x03bd('0x25')](function(_0x17cf11){if(_0x17cf11){_0x89c70b['model']=_['keys'](db['CmHopperBlack'][_0x03bd('0x32')]);_0x89c70b[_0x03bd('0x36')]=_['keys'](_0x52cb2c[_0x03bd('0x36')]);_0x89c70b[_0x03bd('0x38')]=_['intersection'](_0x89c70b[_0x03bd('0x35')],_0x89c70b[_0x03bd('0x36')]);_0x356f2a[_0x03bd('0x39')]=_[_0x03bd('0x3a')](_0x89c70b[_0x03bd('0x35')],qs[_0x03bd('0x3b')](_0x52cb2c[_0x03bd('0x36')]['fields']));_0x356f2a[_0x03bd('0x39')]=_0x356f2a[_0x03bd('0x39')][_0x03bd('0x3c')]?_0x356f2a[_0x03bd('0x39')]:_0x89c70b[_0x03bd('0x35')];if(!_0x52cb2c[_0x03bd('0x36')][_0x03bd('0x5c')](_0x03bd('0x3d'))){_0x356f2a[_0x03bd('0x1e')]=qs['limit'](_0x52cb2c[_0x03bd('0x36')][_0x03bd('0x1e')]);_0x356f2a[_0x03bd('0x1c')]=qs['offset'](_0x52cb2c[_0x03bd('0x36')]['offset']);}_0x356f2a[_0x03bd('0x3e')]=qs[_0x03bd('0x3f')](_0x52cb2c[_0x03bd('0x36')]['sort']);_0x356f2a[_0x03bd('0x42')]=qs[_0x03bd('0x38')](_[_0x03bd('0x40')](_0x52cb2c['query'],_0x89c70b['filters']));_0x356f2a['where'][_0x03bd('0x5d')]=_0x17cf11['id'];if(_0x52cb2c[_0x03bd('0x36')][_0x03bd('0x41')]){_0x356f2a['where']=_[_0x03bd('0x2f')](_0x356f2a[_0x03bd('0x42')],{'$or':_['map'](_0x356f2a[_0x03bd('0x39')],function(_0x290e7c){var _0x50bd27={};_0x50bd27[_0x290e7c]={'$like':'%'+_0x52cb2c['query'][_0x03bd('0x41')]+'%'};return _0x50bd27;})});}_0x356f2a=_[_0x03bd('0x2f')]({},_0x356f2a,_0x52cb2c[_0x03bd('0x4b')]);return db[_0x03bd('0x64')][_0x03bd('0x1f')]({'where':_0x356f2a[_0x03bd('0x42')]})[_0x03bd('0x25')](function(_0x42ac1c){_0x3f64dd[_0x03bd('0x1f')]=_0x42ac1c;if(_0x52cb2c[_0x03bd('0x36')][_0x03bd('0x46')]){_0x356f2a[_0x03bd('0x47')]=[{'all':!![]}];}return db[_0x03bd('0x64')][_0x03bd('0x5e')](_0x356f2a);})['then'](function(_0x10129c){_0x3f64dd[_0x03bd('0x5f')]=_0x10129c;return _0x3f64dd;});}})[_0x03bd('0x25')](respondWithFilteredResult(_0x4dc23a,_0x356f2a))[_0x03bd('0x48')](handleError(_0x4dc23a,null));};exports[_0x03bd('0x65')]=function(_0x30f48e,_0x24a018,_0x42f78b){var _0x24232f={};var _0x317e92={};var _0x74308a;var _0x95dbb8;return db[_0x03bd('0x45')][_0x03bd('0x5a')]({'where':{'id':_0x30f48e[_0x03bd('0x4a')]['id']}})['then'](handleEntityNotFound(_0x24a018,null))[_0x03bd('0x25')](function(_0x43f275){if(_0x43f275){_0x74308a=_0x43f275;_0x317e92[_0x03bd('0x35')]=_['keys'](db[_0x03bd('0x66')][_0x03bd('0x32')]);_0x317e92['query']=_[_0x03bd('0x37')](_0x30f48e[_0x03bd('0x36')]);_0x317e92[_0x03bd('0x38')]=_[_0x03bd('0x3a')](_0x317e92[_0x03bd('0x35')],_0x317e92[_0x03bd('0x36')]);_0x24232f[_0x03bd('0x39')]=_[_0x03bd('0x3a')](_0x317e92[_0x03bd('0x35')],qs[_0x03bd('0x3b')](_0x30f48e[_0x03bd('0x36')]['fields']));_0x24232f[_0x03bd('0x39')]=_0x24232f[_0x03bd('0x39')][_0x03bd('0x3c')]?_0x24232f[_0x03bd('0x39')]:_0x317e92[_0x03bd('0x35')];_0x24232f[_0x03bd('0x3e')]=qs[_0x03bd('0x3f')](_0x30f48e['query'][_0x03bd('0x3f')]);_0x24232f[_0x03bd('0x42')]=qs[_0x03bd('0x38')](_[_0x03bd('0x40')](_0x30f48e[_0x03bd('0x36')],_0x317e92[_0x03bd('0x38')]));if(_0x30f48e['query'][_0x03bd('0x41')]){_0x24232f[_0x03bd('0x42')]=_[_0x03bd('0x2f')](_0x24232f['where'],{'$or':_[_0x03bd('0x43')](_0x24232f['attributes'],function(_0x23fb28){var _0x152c3c={};_0x152c3c[_0x23fb28]={'$like':'%'+_0x30f48e[_0x03bd('0x36')][_0x03bd('0x41')]+'%'};return _0x152c3c;})});}_0x24232f=_[_0x03bd('0x2f')]({},_0x24232f,_0x30f48e[_0x03bd('0x4b')]);return _0x74308a[_0x03bd('0x65')](_0x24232f);}})[_0x03bd('0x25')](function(_0x5d37e8){if(_0x5d37e8){_0x95dbb8=_0x5d37e8[_0x03bd('0x3c')];if(!_0x30f48e[_0x03bd('0x36')][_0x03bd('0x5c')](_0x03bd('0x3d'))){_0x24232f['limit']=qs[_0x03bd('0x1e')](_0x30f48e[_0x03bd('0x36')][_0x03bd('0x1e')]);_0x24232f[_0x03bd('0x1c')]=qs[_0x03bd('0x1c')](_0x30f48e[_0x03bd('0x36')]['offset']);}return _0x74308a[_0x03bd('0x65')](_0x24232f);}})[_0x03bd('0x25')](function(_0x5f7e61){if(_0x5f7e61){return _0x5f7e61?{'count':_0x95dbb8,'rows':_0x5f7e61}:null;}})[_0x03bd('0x25')](respondWithResult(_0x24a018,null))[_0x03bd('0x48')](handleError(_0x24a018,null));};exports[_0x03bd('0x67')]=function(_0x463a80,_0x9c918,_0x2967b0){var _0x15a221,_0x25adc7;return db['Campaign']['find']({'where':{'id':_0x463a80['params']['id']}})[_0x03bd('0x25')](handleEntityNotFound(_0x9c918,null))['then'](function(_0x5cf4da){if(_0x5cf4da){_0x25adc7=_0x5cf4da;return _0x5cf4da[_0x03bd('0x67')](_0x463a80[_0x03bd('0x30')]['ids'],_[_0x03bd('0x55')](_0x463a80[_0x03bd('0x30')],['ids','id'])||{});}return null;})['spread'](function(_0x5d8347){var _0xbceb3c;_0x15a221=_0x5d8347||[];var _0x53c250=[];if(_0x5d8347){for(var _0x12683=0x0;_0x12683<_0x5d8347['length'];_0x12683+=0x1){var _0x31e4bd=_0x5d8347[_0x12683][_0x03bd('0x26')]({'plain':!![]});_0x25adc7[_0x03bd('0x68')]=_0x463a80[_0x03bd('0x30')][_0x03bd('0x68')]?_0x463a80[_0x03bd('0x30')][_0x03bd('0x68')]:_0x25adc7['dialCheckDuplicateType'];switch(_0x25adc7[_0x03bd('0x68')]){case'always':_0xbceb3c=squel[_0x03bd('0x69')]()['into'](_0x03bd('0x6a'))[_0x03bd('0x6b')]([_0x03bd('0x6c'),_0x03bd('0x6d'),'ContactId',_0x03bd('0x6e'),_0x03bd('0x5d'),_0x03bd('0x56'),_0x03bd('0x57')],squel['select']()[_0x03bd('0x6f')](_0x03bd('0x6c'),_0x03bd('0x6c'))[_0x03bd('0x6f')](_0x03bd('0x70'),_0x03bd('0x6d'))[_0x03bd('0x6f')]('id',_0x03bd('0x71'))[_0x03bd('0x6f')](_0x31e4bd['CmListId'][_0x03bd('0x72')](),_0x03bd('0x6e'))[_0x03bd('0x6f')](_0x463a80[_0x03bd('0x4a')]['id'][_0x03bd('0x72')](),'CampaignId')[_0x03bd('0x6f')](_0x03bd('0x70'),'createdAt')[_0x03bd('0x6f')](_0x03bd('0x70'),_0x03bd('0x57'))['from'](_0x03bd('0x73'))[_0x03bd('0x42')](_0x03bd('0x74'))[_0x03bd('0x42')](_0x03bd('0x75'),_0x31e4bd[_0x03bd('0x76')][_0x03bd('0x72')]())[_0x03bd('0x42')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x03bd('0x77'),squel[_0x03bd('0x78')]()[_0x03bd('0x6f')](_0x03bd('0x79'))[_0x03bd('0x7a')]('cm_hopper_final')[_0x03bd('0x42')](_0x03bd('0x7b'),_0x463a80[_0x03bd('0x4a')]['id']['toString']()))[_0x03bd('0x42')](_0x03bd('0x77'),squel['select']()[_0x03bd('0x6f')](_0x03bd('0x7c'))[_0x03bd('0x7a')]('cm_hopper')['where'](_0x03bd('0x7b'),_0x463a80[_0x03bd('0x4a')]['id'][_0x03bd('0x72')]())))[_0x03bd('0x72')]();break;case _0x03bd('0x7d'):_0xbceb3c=squel[_0x03bd('0x69')]()[_0x03bd('0x7e')](_0x03bd('0x6a'))[_0x03bd('0x6b')](['phone',_0x03bd('0x6d'),_0x03bd('0x71'),'ListId','CampaignId',_0x03bd('0x56'),_0x03bd('0x57')],squel[_0x03bd('0x78')]()[_0x03bd('0x6f')]('phone','phone')[_0x03bd('0x6f')]('NOW()',_0x03bd('0x6d'))[_0x03bd('0x6f')]('id',_0x03bd('0x71'))[_0x03bd('0x6f')](_0x31e4bd[_0x03bd('0x76')][_0x03bd('0x72')](),'ListId')['field'](_0x463a80[_0x03bd('0x4a')]['id'][_0x03bd('0x72')](),'CampaignId')['field'](_0x03bd('0x70'),_0x03bd('0x56'))[_0x03bd('0x6f')](_0x03bd('0x70'),'updatedAt')[_0x03bd('0x7a')](_0x03bd('0x73'))['where'](_0x03bd('0x74'))[_0x03bd('0x42')]('ListId\x20=\x20?',_0x31e4bd[_0x03bd('0x76')][_0x03bd('0x72')]())[_0x03bd('0x42')](_0x03bd('0x7f'))['where'](_0x03bd('0x77'),squel[_0x03bd('0x78')]()['field'](_0x03bd('0x7c'))[_0x03bd('0x7a')](_0x03bd('0x6a'))[_0x03bd('0x42')](_0x03bd('0x7b'),_0x463a80['params']['id']['toString']())))[_0x03bd('0x72')]();break;default:_0xbceb3c=squel[_0x03bd('0x69')]()[_0x03bd('0x7e')]('cm_hopper')[_0x03bd('0x6b')]([_0x03bd('0x6c'),'scheduledAt',_0x03bd('0x71'),'ListId','CampaignId',_0x03bd('0x56'),_0x03bd('0x57')],squel[_0x03bd('0x78')]()[_0x03bd('0x6f')](_0x03bd('0x6c'),_0x03bd('0x6c'))[_0x03bd('0x6f')](_0x03bd('0x70'),_0x03bd('0x6d'))[_0x03bd('0x6f')]('id',_0x03bd('0x71'))['field'](_0x31e4bd['CmListId'][_0x03bd('0x72')](),_0x03bd('0x6e'))[_0x03bd('0x6f')](_0x463a80[_0x03bd('0x4a')]['id'][_0x03bd('0x72')](),_0x03bd('0x5d'))['field'](_0x03bd('0x70'),_0x03bd('0x56'))[_0x03bd('0x6f')](_0x03bd('0x70'),'updatedAt')[_0x03bd('0x7a')](_0x03bd('0x73'))[_0x03bd('0x42')]('deletedAt\x20IS\x20NULL')[_0x03bd('0x42')](_0x03bd('0x75'),_0x31e4bd['CmListId']['toString']())['where'](_0x03bd('0x7f')))[_0x03bd('0x72')]();}_0x53c250[_0x03bd('0x80')](db[_0x03bd('0x81')]['query'](_0xbceb3c));}return BPromise[_0x03bd('0x82')](_0x53c250);}})[_0x03bd('0x25')](function(){return _0x15a221;})[_0x03bd('0x25')](respondWithResult(_0x9c918,null))[_0x03bd('0x48')](handleError(_0x9c918,null));};exports[_0x03bd('0x83')]=function(_0x4b6c98,_0x6ac325,_0x506717){return db[_0x03bd('0x45')][_0x03bd('0x4c')]({'where':{'id':_0x4b6c98[_0x03bd('0x4a')]['id']}})[_0x03bd('0x25')](handleEntityNotFound(_0x6ac325,null))[_0x03bd('0x25')](function(_0x5f3edb){if(_0x5f3edb){return _0x5f3edb[_0x03bd('0x83')](_0x4b6c98[_0x03bd('0x36')][_0x03bd('0x84')]);}})[_0x03bd('0x25')](function(_0x14180b){if(_0x14180b){return db['CmHopper'][_0x03bd('0x29')]({'where':{'ListId':_0x4b6c98[_0x03bd('0x36')][_0x03bd('0x84')],'CampaignId':_0x4b6c98[_0x03bd('0x4a')]['id']}})[_0x03bd('0x25')](function(){return _0x14180b;});}})['then'](respondWithStatusCode(_0x6ac325,null))[_0x03bd('0x48')](handleError(_0x6ac325,null));};exports[_0x03bd('0x85')]=function(_0x3f3e34,_0x1d9026,_0x230a0e){var _0x35258d={};var _0x43a2ad={};var _0x15c3b5;var _0xd3de42;return db[_0x03bd('0x45')][_0x03bd('0x5a')]({'where':{'id':_0x3f3e34[_0x03bd('0x4a')]['id']}})[_0x03bd('0x25')](handleEntityNotFound(_0x1d9026,null))[_0x03bd('0x25')](function(_0x4684ed){if(_0x4684ed){_0x15c3b5=_0x4684ed;_0x43a2ad[_0x03bd('0x35')]=_[_0x03bd('0x37')](db[_0x03bd('0x66')]['rawAttributes']);_0x43a2ad[_0x03bd('0x36')]=_['keys'](_0x3f3e34[_0x03bd('0x36')]);_0x43a2ad[_0x03bd('0x38')]=_[_0x03bd('0x3a')](_0x43a2ad[_0x03bd('0x35')],_0x43a2ad[_0x03bd('0x36')]);_0x35258d[_0x03bd('0x39')]=_[_0x03bd('0x3a')](_0x43a2ad[_0x03bd('0x35')],qs[_0x03bd('0x3b')](_0x3f3e34[_0x03bd('0x36')]['fields']));_0x35258d[_0x03bd('0x39')]=_0x35258d[_0x03bd('0x39')][_0x03bd('0x3c')]?_0x35258d[_0x03bd('0x39')]:_0x43a2ad[_0x03bd('0x35')];_0x35258d[_0x03bd('0x3e')]=qs[_0x03bd('0x3f')](_0x3f3e34[_0x03bd('0x36')]['sort']);_0x35258d[_0x03bd('0x42')]=qs[_0x03bd('0x38')](_[_0x03bd('0x40')](_0x3f3e34[_0x03bd('0x36')],_0x43a2ad[_0x03bd('0x38')]));if(_0x3f3e34[_0x03bd('0x36')]['filter']){_0x35258d['where']=_[_0x03bd('0x2f')](_0x35258d['where'],{'$or':_['map'](_0x35258d[_0x03bd('0x39')],function(_0x720d68){var _0x3f8705={};_0x3f8705[_0x720d68]={'$like':'%'+_0x3f3e34['query'][_0x03bd('0x41')]+'%'};return _0x3f8705;})});}_0x35258d=_[_0x03bd('0x2f')]({},_0x35258d,_0x3f3e34[_0x03bd('0x4b')]);return _0x15c3b5[_0x03bd('0x85')](_0x35258d);}})['then'](function(_0x4f3e82){if(_0x4f3e82){_0xd3de42=_0x4f3e82['length'];if(!_0x3f3e34[_0x03bd('0x36')][_0x03bd('0x5c')](_0x03bd('0x3d'))){_0x35258d[_0x03bd('0x1e')]=qs[_0x03bd('0x1e')](_0x3f3e34['query'][_0x03bd('0x1e')]);_0x35258d[_0x03bd('0x1c')]=qs[_0x03bd('0x1c')](_0x3f3e34[_0x03bd('0x36')][_0x03bd('0x1c')]);}return _0x15c3b5[_0x03bd('0x85')](_0x35258d);}})[_0x03bd('0x25')](function(_0x14a48f){if(_0x14a48f){return _0x14a48f?{'count':_0xd3de42,'rows':_0x14a48f}:null;}})['then'](respondWithResult(_0x1d9026,null))['catch'](handleError(_0x1d9026,null));};exports[_0x03bd('0x86')]=function(_0x246db6,_0x3c3c02,_0x510584){var _0x280aaf,_0x36872a;return db[_0x03bd('0x45')][_0x03bd('0x4c')]({'where':{'id':_0x246db6[_0x03bd('0x4a')]['id']}})[_0x03bd('0x25')](handleEntityNotFound(_0x3c3c02,null))[_0x03bd('0x25')](function(_0x54abc8){if(_0x54abc8){_0x36872a=_0x54abc8;return _0x54abc8[_0x03bd('0x86')](_0x246db6[_0x03bd('0x30')][_0x03bd('0x84')],_[_0x03bd('0x55')](_0x246db6[_0x03bd('0x30')],[_0x03bd('0x84'),'id'])||{});}return null;})['spread'](function(_0x4748c2){var _0x5b7cf2;_0x280aaf=_0x4748c2||[];var _0x359eec=[];if(_0x4748c2){for(var _0x54defa=0x0;_0x54defa<_0x4748c2['length'];_0x54defa+=0x1){var _0xcb3ca1=_0x4748c2[_0x54defa][_0x03bd('0x26')]({'plain':!![]});_0x5b7cf2=squel[_0x03bd('0x69')]()[_0x03bd('0x7e')]('cm_hopper_black')[_0x03bd('0x6b')]([_0x03bd('0x6c'),'ContactId',_0x03bd('0x6e'),_0x03bd('0x5d'),_0x03bd('0x56'),_0x03bd('0x57')],squel[_0x03bd('0x78')]()[_0x03bd('0x6f')]('phone',_0x03bd('0x6c'))[_0x03bd('0x6f')]('id','ContactId')[_0x03bd('0x6f')](_0xcb3ca1[_0x03bd('0x76')][_0x03bd('0x72')](),_0x03bd('0x6e'))[_0x03bd('0x6f')](_0x246db6['params']['id'][_0x03bd('0x72')](),'CampaignId')[_0x03bd('0x6f')](_0x03bd('0x70'),_0x03bd('0x56'))[_0x03bd('0x6f')](_0x03bd('0x70'),_0x03bd('0x57'))[_0x03bd('0x7a')]('cm_contacts')['where'](_0x03bd('0x74'))[_0x03bd('0x42')](_0x03bd('0x75'),_0xcb3ca1['CmListId'][_0x03bd('0x72')]())[_0x03bd('0x42')](_0x03bd('0x7f')))[_0x03bd('0x72')]();_0x359eec['push'](db[_0x03bd('0x81')]['query'](_0x5b7cf2));}return BPromise['all'](_0x359eec);}})['then'](function(){return _0x280aaf;})[_0x03bd('0x25')](respondWithResult(_0x3c3c02,null))[_0x03bd('0x48')](handleError(_0x3c3c02,null));};exports[_0x03bd('0x87')]=function(_0x555e7d,_0x1b466c,_0x42fca7){return db['Campaign'][_0x03bd('0x4c')]({'where':{'id':_0x555e7d[_0x03bd('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1b466c,null))['then'](function(_0x4ff497){if(_0x4ff497){return _0x4ff497['removeBlackLists'](_0x555e7d['query']['ids']);}})[_0x03bd('0x25')](function(_0xb6efd7){if(_0xb6efd7){return db[_0x03bd('0x64')]['destroy']({'where':{'ListId':_0x555e7d[_0x03bd('0x36')][_0x03bd('0x84')],'CampaignId':_0x555e7d['params']['id']}})['then'](function(){return _0xb6efd7;});}})[_0x03bd('0x25')](respondWithStatusCode(_0x1b466c,null))['catch'](handleError(_0x1b466c,null));};
\ No newline at end of file
+var _0xc21d=['includeAll','include','findAll','rows','catch','params','create','user','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','getHoppers','findOne','CmHopper','order','CampaignId','getHopperHistories','filter','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','select','field','NOW()','CmListId','toString','cm_contacts','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','sequelize','all','removeLists','getBlackLists','cm_hopper_black','push','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','offset','undefined','count','limit','set','json','reject','save','destroy','then','get','IvrCampaigns','error','stack','name','render','merge','body','contact','message','interaction','map','Campaign','rawAttributes','fieldName','type','key','keys','filters','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','options'];(function(_0x267095,_0xd6b820){var _0x2c31be=function(_0xed99a8){while(--_0xed99a8){_0x267095['push'](_0x267095['shift']());}};_0x2c31be(++_0xd6b820);}(_0xc21d,0x150));var _0xdc21=function(_0x758122,_0x3c9b42){_0x758122=_0x758122-0x0;var _0x3ff10b=_0xc21d[_0x758122];return _0x3ff10b;};'use strict';var emlformat=require(_0xdc21('0x0'));var rimraf=require(_0xdc21('0x1'));var zipdir=require(_0xdc21('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdc21('0x3'));var moment=require('moment');var BPromise=require(_0xdc21('0x4'));var Mustache=require(_0xdc21('0x5'));var util=require(_0xdc21('0x6'));var path=require(_0xdc21('0x7'));var sox=require('sox');var csv=require(_0xdc21('0x8'));var ejs=require(_0xdc21('0x9'));var fs=require('fs');var fs_extra=require(_0xdc21('0xa'));var _=require(_0xdc21('0xb'));var squel=require(_0xdc21('0xc'));var crypto=require('crypto');var jsforce=require(_0xdc21('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdc21('0xe'));var Papa=require(_0xdc21('0xf'));var Redis=require(_0xdc21('0x10'));var authService=require(_0xdc21('0x11'));var qs=require(_0xdc21('0x12'));var as=require(_0xdc21('0x13'));var hardwareService=require(_0xdc21('0x14'));var logger=require(_0xdc21('0x15'))(_0xdc21('0x16'));var utils=require(_0xdc21('0x17'));var config=require(_0xdc21('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a1ad8,_0x1e80c3){_0x1e80c3=_0x1e80c3||0xcc;return function(_0x2eb0c0){if(_0x2eb0c0){return _0x1a1ad8[_0xdc21('0x19')](_0x1e80c3);}return _0x1a1ad8['status'](_0x1e80c3)[_0xdc21('0x1a')]();};}function respondWithResult(_0x44558f,_0x2398c1){_0x2398c1=_0x2398c1||0xc8;return function(_0x3b9688){if(_0x3b9688){return _0x44558f[_0xdc21('0x1b')](_0x2398c1)['json'](_0x3b9688);}};}function respondWithFilteredResult(_0x60ac07,_0x356dbe){return function(_0x44aa27){if(_0x44aa27){var _0x258ff4=typeof _0x356dbe[_0xdc21('0x1c')]===_0xdc21('0x1d')&&typeof _0x356dbe['limit']===_0xdc21('0x1d');var _0x46a019=_0x44aa27['count'];var _0x2878f0=_0x258ff4?0x0:_0x356dbe[_0xdc21('0x1c')];var _0x410c1c=_0x258ff4?_0x44aa27[_0xdc21('0x1e')]:_0x356dbe[_0xdc21('0x1c')]+_0x356dbe[_0xdc21('0x1f')];var _0x3ce518;if(_0x410c1c>=_0x46a019){_0x410c1c=_0x46a019;_0x3ce518=0xc8;}else{_0x3ce518=0xce;}_0x60ac07[_0xdc21('0x1b')](_0x3ce518);return _0x60ac07[_0xdc21('0x20')]('Content-Range',_0x2878f0+'-'+_0x410c1c+'/'+_0x46a019)[_0xdc21('0x21')](_0x44aa27);}return null;};}function patchUpdates(_0x356a5d){return function(_0x516b40){try{jsonpatch['apply'](_0x516b40,_0x356a5d,!![]);}catch(_0x2ac4c2){return BPromise[_0xdc21('0x22')](_0x2ac4c2);}return _0x516b40[_0xdc21('0x23')]();};}function saveUpdates(_0x495c40,_0x340e12){return function(_0x44a332){if(_0x44a332){return _0x44a332['update'](_0x495c40)['then'](function(_0x479cd5){return _0x479cd5;});}return null;};}function removeEntity(_0x1b2008,_0x5ba90a){return function(_0xb02e13){if(_0xb02e13){return _0xb02e13[_0xdc21('0x24')]()[_0xdc21('0x25')](function(){var _0x3b431c=_0xb02e13[_0xdc21('0x26')]({'plain':!![]});var _0x10dac2=_0xdc21('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x10dac2,'resourceId':_0x3b431c['id']}})[_0xdc21('0x25')](function(){return _0xb02e13;});})['then'](function(){_0x1b2008[_0xdc21('0x1b')](0xcc)[_0xdc21('0x1a')]();});}};}function handleEntityNotFound(_0x2a1e36,_0x2389c9){return function(_0x25a774){if(!_0x25a774){_0x2a1e36[_0xdc21('0x19')](0x194);}return _0x25a774;};}function handleError(_0x59e24f,_0x10ba4a){_0x10ba4a=_0x10ba4a||0x1f4;return function(_0x573561){logger[_0xdc21('0x28')](_0x573561[_0xdc21('0x29')]);if(_0x573561[_0xdc21('0x2a')]){delete _0x573561['name'];}_0x59e24f[_0xdc21('0x1b')](_0x10ba4a)['send'](_0x573561);};}function getMustacheRender(_0x5380bd,_0xb350c0){return Mustache[_0xdc21('0x2b')](_0x5380bd,_[_0xdc21('0x2c')](_0xb350c0[_0xdc21('0x2d')],{'contact':_0xb350c0[_0xdc21('0x2e')],'message':_0xb350c0[_0xdc21('0x2f')],'agent':_0xb350c0['agent'],'interaction':_0xb350c0[_0xdc21('0x30')],'account':_0xb350c0['account']}))||'';}exports['index']=function(_0xc335c9,_0x2786b0){var _0x4c7f6b={},_0x5c4e91={},_0x2fa16e={'count':0x0,'rows':[]};var _0x318331=_[_0xdc21('0x31')](db[_0xdc21('0x32')][_0xdc21('0x33')],function(_0x3420d9){return{'name':_0x3420d9[_0xdc21('0x34')],'type':_0x3420d9[_0xdc21('0x35')][_0xdc21('0x36')]};});_0x5c4e91['model']=_[_0xdc21('0x31')](_0x318331,'name');_0x5c4e91['query']=_[_0xdc21('0x37')](_0xc335c9['query']);_0x5c4e91[_0xdc21('0x38')]=_['intersection'](_0x5c4e91[_0xdc21('0x39')],_0x5c4e91[_0xdc21('0x3a')]);_0x4c7f6b[_0xdc21('0x3b')]=_[_0xdc21('0x3c')](_0x5c4e91[_0xdc21('0x39')],qs[_0xdc21('0x3d')](_0xc335c9[_0xdc21('0x3a')][_0xdc21('0x3d')]));_0x4c7f6b[_0xdc21('0x3b')]=_0x4c7f6b[_0xdc21('0x3b')][_0xdc21('0x3e')]?_0x4c7f6b[_0xdc21('0x3b')]:_0x5c4e91[_0xdc21('0x39')];if(!_0xc335c9[_0xdc21('0x3a')][_0xdc21('0x3f')](_0xdc21('0x40'))){_0x4c7f6b['limit']=qs['limit'](_0xc335c9[_0xdc21('0x3a')]['limit']);_0x4c7f6b[_0xdc21('0x1c')]=qs['offset'](_0xc335c9[_0xdc21('0x3a')]['offset']);}_0x4c7f6b['order']=qs['sort'](_0xc335c9[_0xdc21('0x3a')][_0xdc21('0x41')]);_0x4c7f6b[_0xdc21('0x42')]=qs['filters'](_[_0xdc21('0x43')](_0xc335c9[_0xdc21('0x3a')],_0x5c4e91[_0xdc21('0x38')]),_0x318331);if(_0xc335c9['query']['filter']){_0x4c7f6b[_0xdc21('0x42')]=_[_0xdc21('0x2c')](_0x4c7f6b[_0xdc21('0x42')],{'$or':_[_0xdc21('0x31')](_0x318331,function(_0x18bb02){if(_0x18bb02[_0xdc21('0x35')]!=='VIRTUAL'){var _0x599f03={};_0x599f03[_0x18bb02[_0xdc21('0x2a')]]={'$like':'%'+_0xc335c9[_0xdc21('0x3a')]['filter']+'%'};return _0x599f03;}})});}_0x4c7f6b=_[_0xdc21('0x2c')]({},_0x4c7f6b,_0xc335c9[_0xdc21('0x44')]);var _0x2ec1cc={'where':_0x4c7f6b['where']};return db[_0xdc21('0x32')][_0xdc21('0x1e')](_0x2ec1cc)[_0xdc21('0x25')](function(_0x28db6f){_0x2fa16e[_0xdc21('0x1e')]=_0x28db6f;if(_0xc335c9[_0xdc21('0x3a')][_0xdc21('0x45')]){_0x4c7f6b[_0xdc21('0x46')]=[{'all':!![]}];}return db[_0xdc21('0x32')][_0xdc21('0x47')](_0x4c7f6b);})['then'](function(_0x43edc2){_0x2fa16e[_0xdc21('0x48')]=_0x43edc2;return _0x2fa16e;})[_0xdc21('0x25')](respondWithFilteredResult(_0x2786b0,_0x4c7f6b))[_0xdc21('0x49')](handleError(_0x2786b0,null));};exports['show']=function(_0x34142a,_0x32b5e2){var _0x33b010={'raw':![],'where':{'id':_0x34142a[_0xdc21('0x4a')]['id']}},_0x50b7b0={};_0x50b7b0[_0xdc21('0x39')]=_[_0xdc21('0x37')](db[_0xdc21('0x32')][_0xdc21('0x33')]);_0x50b7b0[_0xdc21('0x3a')]=_[_0xdc21('0x37')](_0x34142a[_0xdc21('0x3a')]);_0x50b7b0[_0xdc21('0x38')]=_[_0xdc21('0x3c')](_0x50b7b0['model'],_0x50b7b0[_0xdc21('0x3a')]);_0x33b010['attributes']=_[_0xdc21('0x3c')](_0x50b7b0[_0xdc21('0x39')],qs[_0xdc21('0x3d')](_0x34142a[_0xdc21('0x3a')]['fields']));_0x33b010[_0xdc21('0x3b')]=_0x33b010['attributes'][_0xdc21('0x3e')]?_0x33b010['attributes']:_0x50b7b0[_0xdc21('0x39')];if(_0x34142a[_0xdc21('0x3a')][_0xdc21('0x45')]){_0x33b010[_0xdc21('0x46')]=[{'all':!![]}];}_0x33b010=_['merge']({},_0x33b010,_0x34142a[_0xdc21('0x44')]);return db[_0xdc21('0x32')]['find'](_0x33b010)[_0xdc21('0x25')](handleEntityNotFound(_0x32b5e2,null))[_0xdc21('0x25')](respondWithResult(_0x32b5e2,null))[_0xdc21('0x49')](handleError(_0x32b5e2,null));};exports[_0xdc21('0x4b')]=function(_0x3ec423,_0x4fef74){return db[_0xdc21('0x32')][_0xdc21('0x4b')](_0x3ec423[_0xdc21('0x2d')],{})[_0xdc21('0x25')](function(_0x4a76a1){var _0x3776cf=_0x3ec423[_0xdc21('0x4c')][_0xdc21('0x26')]({'plain':!![]});if(!_0x3776cf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3776cf['role']==='user'){var _0x35d97c=_0x4a76a1[_0xdc21('0x26')]({'plain':!![]});var _0x1b6f1b=_0xdc21('0x27');return db['UserProfileSection'][_0xdc21('0x4d')]({'where':{'name':_0x1b6f1b,'userProfileId':_0x3776cf[_0xdc21('0x4e')]},'raw':!![]})[_0xdc21('0x25')](function(_0x23ddb2){if(_0x23ddb2&&_0x23ddb2['autoAssociation']===0x0){return db[_0xdc21('0x4f')][_0xdc21('0x4b')]({'name':_0x35d97c[_0xdc21('0x2a')],'resourceId':_0x35d97c['id'],'type':_0x23ddb2['name'],'sectionId':_0x23ddb2['id']},{})['then'](function(){return _0x4a76a1;});}else{return _0x4a76a1;}})['catch'](function(_0x88ace){logger[_0xdc21('0x28')](_0xdc21('0x50'),_0x88ace);throw _0x88ace;});}return _0x4a76a1;})[_0xdc21('0x25')](respondWithResult(_0x4fef74,0xc9))[_0xdc21('0x49')](handleError(_0x4fef74,null));};exports['clone']=function(_0x475ac6,_0x284e6b){var _0x2ceffa={'where':{'id':_0x475ac6[_0xdc21('0x4a')]['id']}},_0x2d0fcb={};_0x2d0fcb[_0xdc21('0x39')]=_[_0xdc21('0x37')](db[_0xdc21('0x32')][_0xdc21('0x33')]);_0x2ceffa[_0xdc21('0x3b')]=_[_0xdc21('0x3c')](_0x2d0fcb['model'],qs[_0xdc21('0x3d')](_0x475ac6[_0xdc21('0x3a')][_0xdc21('0x3d')]));_0x2ceffa[_0xdc21('0x3b')]=_0x2ceffa[_0xdc21('0x3b')][_0xdc21('0x3e')]?_0x2ceffa[_0xdc21('0x3b')]:_0x2d0fcb['model'];if(_0x475ac6['query'][_0xdc21('0x45')]){_0x2ceffa[_0xdc21('0x46')]=[{'all':!![]}];}_0x2ceffa=_[_0xdc21('0x2c')]({},_0x2ceffa,_0x475ac6[_0xdc21('0x44')]);return db[_0xdc21('0x32')][_0xdc21('0x4d')](_0x2ceffa)[_0xdc21('0x25')](handleEntityNotFound(_0x284e6b,null))[_0xdc21('0x25')](function(_0x273312){if(_0x273312){var _0x3a4c58=_0x273312['get']({'plain':!![]});_0x3a4c58=qs[_0xdc21('0x51')](_0x3a4c58,['id','createdAt',_0xdc21('0x52')]);_0x475ac6[_0xdc21('0x2d')]=_[_0xdc21('0x51')](_0x475ac6[_0xdc21('0x2d')],['id','createdAt',_0xdc21('0x52')]);return db[_0xdc21('0x32')][_0xdc21('0x4b')](_[_0xdc21('0x2c')](_0x3a4c58,_0x475ac6[_0xdc21('0x2d')]),{'include':_0x475ac6[_0xdc21('0x3a')][_0xdc21('0x45')]?[{'all':!![]}]:undefined})[_0xdc21('0x25')](function(_0x4eaa29){var _0xb47d26=_0x475ac6[_0xdc21('0x4c')][_0xdc21('0x26')]({'plain':!![]});if(!_0xb47d26)throw new Error(_0xdc21('0x53'));if(_0xb47d26[_0xdc21('0x54')]==='user'){var _0x46f553=_0x4eaa29[_0xdc21('0x26')]({'plain':!![]});var _0x3e14be=_0xdc21('0x27');return db[_0xdc21('0x55')][_0xdc21('0x4d')]({'where':{'name':_0x3e14be,'userProfileId':_0xb47d26['userProfileId']},'raw':!![]})['then'](function(_0x47f074){if(_0x47f074&&_0x47f074[_0xdc21('0x56')]===0x0){return db[_0xdc21('0x4f')]['create']({'name':_0x46f553[_0xdc21('0x2a')],'resourceId':_0x46f553['id'],'type':_0x47f074[_0xdc21('0x2a')],'sectionId':_0x47f074['id']},{})[_0xdc21('0x25')](function(){return _0x4eaa29;});}else{return _0x4eaa29;}})[_0xdc21('0x49')](function(_0x387044){logger[_0xdc21('0x28')](_0xdc21('0x50'),_0x387044);throw _0x387044;});}return _0x4eaa29;});}})[_0xdc21('0x25')](respondWithResult(_0x284e6b,0xc9))[_0xdc21('0x49')](handleError(_0x284e6b,null));};exports['update']=function(_0x5cd27c,_0x27983d){if(_0x5cd27c[_0xdc21('0x2d')]['id']){delete _0x5cd27c[_0xdc21('0x2d')]['id'];}return db['Campaign'][_0xdc21('0x4d')]({'where':{'id':_0x5cd27c[_0xdc21('0x4a')]['id']}})['then'](handleEntityNotFound(_0x27983d,null))[_0xdc21('0x25')](saveUpdates(_0x5cd27c[_0xdc21('0x2d')],null))[_0xdc21('0x25')](respondWithResult(_0x27983d,null))[_0xdc21('0x49')](handleError(_0x27983d,null));};exports[_0xdc21('0x24')]=function(_0x22da19,_0x2b3872){return db[_0xdc21('0x32')][_0xdc21('0x4d')]({'where':{'id':_0x22da19['params']['id']}})[_0xdc21('0x25')](handleEntityNotFound(_0x2b3872,null))[_0xdc21('0x25')](removeEntity(_0x2b3872,null))[_0xdc21('0x49')](handleError(_0x2b3872,null));};exports[_0xdc21('0x57')]=function(_0x2d5651,_0x2ff308,_0xc057b9){var _0x2cf457={'raw':!![],'where':{}};var _0x280526={};var _0x10dbc4={'count':0x0,'rows':[]};return db[_0xdc21('0x32')][_0xdc21('0x58')]({'where':{'id':_0x2d5651[_0xdc21('0x4a')]['id']}})[_0xdc21('0x25')](handleEntityNotFound(_0x2ff308,null))[_0xdc21('0x25')](function(_0x50fc13){if(_0x50fc13){_0x280526['model']=_['keys'](db[_0xdc21('0x59')][_0xdc21('0x33')]);_0x280526[_0xdc21('0x3a')]=_['keys'](_0x2d5651['query']);_0x280526[_0xdc21('0x38')]=_['intersection'](_0x280526[_0xdc21('0x39')],_0x280526['query']);_0x2cf457[_0xdc21('0x3b')]=_[_0xdc21('0x3c')](_0x280526['model'],qs[_0xdc21('0x3d')](_0x2d5651[_0xdc21('0x3a')][_0xdc21('0x3d')]));_0x2cf457['attributes']=_0x2cf457[_0xdc21('0x3b')][_0xdc21('0x3e')]?_0x2cf457[_0xdc21('0x3b')]:_0x280526[_0xdc21('0x39')];if(!_0x2d5651[_0xdc21('0x3a')]['hasOwnProperty'](_0xdc21('0x40'))){_0x2cf457[_0xdc21('0x1f')]=qs[_0xdc21('0x1f')](_0x2d5651['query'][_0xdc21('0x1f')]);_0x2cf457['offset']=qs['offset'](_0x2d5651[_0xdc21('0x3a')][_0xdc21('0x1c')]);}_0x2cf457[_0xdc21('0x5a')]=qs[_0xdc21('0x41')](_0x2d5651[_0xdc21('0x3a')][_0xdc21('0x41')]);_0x2cf457[_0xdc21('0x42')]=qs[_0xdc21('0x38')](_['pick'](_0x2d5651[_0xdc21('0x3a')],_0x280526[_0xdc21('0x38')]));_0x2cf457[_0xdc21('0x42')][_0xdc21('0x5b')]=_0x50fc13['id'];if(_0x2d5651[_0xdc21('0x3a')]['filter']){_0x2cf457[_0xdc21('0x42')]=_[_0xdc21('0x2c')](_0x2cf457[_0xdc21('0x42')],{'$or':_[_0xdc21('0x31')](_0x2cf457[_0xdc21('0x3b')],function(_0xa6fce6){var _0x198264={};_0x198264[_0xa6fce6]={'$like':'%'+_0x2d5651['query']['filter']+'%'};return _0x198264;})});}_0x2cf457=_[_0xdc21('0x2c')]({},_0x2cf457,_0x2d5651[_0xdc21('0x44')]);return db['CmHopper']['count']({'where':_0x2cf457['where']})[_0xdc21('0x25')](function(_0xbb2674){_0x10dbc4[_0xdc21('0x1e')]=_0xbb2674;if(_0x2d5651['query'][_0xdc21('0x45')]){_0x2cf457[_0xdc21('0x46')]=[{'all':!![]}];}return db[_0xdc21('0x59')][_0xdc21('0x47')](_0x2cf457);})[_0xdc21('0x25')](function(_0x710428){_0x10dbc4[_0xdc21('0x48')]=_0x710428;return _0x10dbc4;});}})[_0xdc21('0x25')](respondWithFilteredResult(_0x2ff308,_0x2cf457))['catch'](handleError(_0x2ff308,null));};exports[_0xdc21('0x5c')]=function(_0x56d06f,_0x1154a5,_0x5bc5b0){var _0x2e9a16={'raw':!![],'where':{}};var _0x299a5c={};var _0x1708a7={'count':0x0,'rows':[]};return db[_0xdc21('0x32')][_0xdc21('0x58')]({'where':{'id':_0x56d06f['params']['id']}})[_0xdc21('0x25')](handleEntityNotFound(_0x1154a5,null))[_0xdc21('0x25')](function(_0x42f1c6){if(_0x42f1c6){_0x299a5c['model']=_[_0xdc21('0x37')](db['CmHopperHistory']['rawAttributes']);_0x299a5c[_0xdc21('0x3a')]=_[_0xdc21('0x37')](_0x56d06f[_0xdc21('0x3a')]);_0x299a5c['filters']=_['intersection'](_0x299a5c[_0xdc21('0x39')],_0x299a5c[_0xdc21('0x3a')]);_0x2e9a16[_0xdc21('0x3b')]=_[_0xdc21('0x3c')](_0x299a5c['model'],qs[_0xdc21('0x3d')](_0x56d06f[_0xdc21('0x3a')][_0xdc21('0x3d')]));_0x2e9a16[_0xdc21('0x3b')]=_0x2e9a16['attributes'][_0xdc21('0x3e')]?_0x2e9a16['attributes']:_0x299a5c[_0xdc21('0x39')];if(!_0x56d06f[_0xdc21('0x3a')][_0xdc21('0x3f')]('nolimit')){_0x2e9a16[_0xdc21('0x1f')]=qs['limit'](_0x56d06f[_0xdc21('0x3a')][_0xdc21('0x1f')]);_0x2e9a16[_0xdc21('0x1c')]=qs['offset'](_0x56d06f[_0xdc21('0x3a')][_0xdc21('0x1c')]);}_0x2e9a16[_0xdc21('0x5a')]=qs[_0xdc21('0x41')](_0x56d06f[_0xdc21('0x3a')]['sort']);_0x2e9a16[_0xdc21('0x42')]=qs[_0xdc21('0x38')](_[_0xdc21('0x43')](_0x56d06f[_0xdc21('0x3a')],_0x299a5c[_0xdc21('0x38')]));_0x2e9a16['where'][_0xdc21('0x5b')]=_0x42f1c6['id'];if(_0x56d06f[_0xdc21('0x3a')][_0xdc21('0x5d')]){_0x2e9a16['where']=_[_0xdc21('0x2c')](_0x2e9a16['where'],{'$or':_[_0xdc21('0x31')](_0x2e9a16[_0xdc21('0x3b')],function(_0xab9fb6){var _0x168c1c={};_0x168c1c[_0xab9fb6]={'$like':'%'+_0x56d06f[_0xdc21('0x3a')]['filter']+'%'};return _0x168c1c;})});}_0x2e9a16=_[_0xdc21('0x2c')]({},_0x2e9a16,_0x56d06f[_0xdc21('0x44')]);return db[_0xdc21('0x5e')][_0xdc21('0x1e')]({'where':_0x2e9a16[_0xdc21('0x42')]})[_0xdc21('0x25')](function(_0x3a2625){_0x1708a7[_0xdc21('0x1e')]=_0x3a2625;if(_0x56d06f[_0xdc21('0x3a')][_0xdc21('0x45')]){_0x2e9a16['include']=[{'all':!![]}];}return db[_0xdc21('0x5e')][_0xdc21('0x47')](_0x2e9a16);})[_0xdc21('0x25')](function(_0x29a238){_0x1708a7[_0xdc21('0x48')]=_0x29a238;return _0x1708a7;});}})[_0xdc21('0x25')](respondWithFilteredResult(_0x1154a5,_0x2e9a16))[_0xdc21('0x49')](handleError(_0x1154a5,null));};exports['getHopperFinals']=function(_0x3e40ce,_0x592d8d,_0x34087e){var _0x30a06b={'raw':!![],'where':{}};var _0x223ab9={};var _0x28748d={'count':0x0,'rows':[]};return db[_0xdc21('0x32')][_0xdc21('0x58')]({'where':{'id':_0x3e40ce['params']['id']}})[_0xdc21('0x25')](handleEntityNotFound(_0x592d8d,null))[_0xdc21('0x25')](function(_0x1d1815){if(_0x1d1815){_0x223ab9['model']=_['keys'](db[_0xdc21('0x5f')][_0xdc21('0x33')]);_0x223ab9[_0xdc21('0x3a')]=_[_0xdc21('0x37')](_0x3e40ce[_0xdc21('0x3a')]);_0x223ab9['filters']=_[_0xdc21('0x3c')](_0x223ab9[_0xdc21('0x39')],_0x223ab9[_0xdc21('0x3a')]);_0x30a06b[_0xdc21('0x3b')]=_[_0xdc21('0x3c')](_0x223ab9[_0xdc21('0x39')],qs[_0xdc21('0x3d')](_0x3e40ce[_0xdc21('0x3a')][_0xdc21('0x3d')]));_0x30a06b[_0xdc21('0x3b')]=_0x30a06b[_0xdc21('0x3b')]['length']?_0x30a06b['attributes']:_0x223ab9[_0xdc21('0x39')];if(!_0x3e40ce[_0xdc21('0x3a')][_0xdc21('0x3f')](_0xdc21('0x40'))){_0x30a06b['limit']=qs['limit'](_0x3e40ce[_0xdc21('0x3a')]['limit']);_0x30a06b[_0xdc21('0x1c')]=qs[_0xdc21('0x1c')](_0x3e40ce[_0xdc21('0x3a')][_0xdc21('0x1c')]);}_0x30a06b['order']=qs[_0xdc21('0x41')](_0x3e40ce[_0xdc21('0x3a')][_0xdc21('0x41')]);_0x30a06b[_0xdc21('0x42')]=qs[_0xdc21('0x38')](_[_0xdc21('0x43')](_0x3e40ce[_0xdc21('0x3a')],_0x223ab9[_0xdc21('0x38')]));_0x30a06b['where'][_0xdc21('0x5b')]=_0x1d1815['id'];if(_0x3e40ce[_0xdc21('0x3a')][_0xdc21('0x5d')]){_0x30a06b[_0xdc21('0x42')]=_[_0xdc21('0x2c')](_0x30a06b['where'],{'$or':_['map'](_0x30a06b[_0xdc21('0x3b')],function(_0x190121){var _0x42bcd3={};_0x42bcd3[_0x190121]={'$like':'%'+_0x3e40ce['query'][_0xdc21('0x5d')]+'%'};return _0x42bcd3;})});}_0x30a06b=_['merge']({},_0x30a06b,_0x3e40ce[_0xdc21('0x44')]);return db[_0xdc21('0x5f')][_0xdc21('0x1e')]({'where':_0x30a06b[_0xdc21('0x42')]})[_0xdc21('0x25')](function(_0x3943b8){_0x28748d[_0xdc21('0x1e')]=_0x3943b8;if(_0x3e40ce['query'][_0xdc21('0x45')]){_0x30a06b[_0xdc21('0x46')]=[{'all':!![]}];}return db[_0xdc21('0x5f')][_0xdc21('0x47')](_0x30a06b);})[_0xdc21('0x25')](function(_0x46d965){_0x28748d[_0xdc21('0x48')]=_0x46d965;return _0x28748d;});}})[_0xdc21('0x25')](respondWithFilteredResult(_0x592d8d,_0x30a06b))[_0xdc21('0x49')](handleError(_0x592d8d,null));};exports[_0xdc21('0x60')]=function(_0x4d8f1b,_0x47757f,_0x33121d){var _0x21011f={'raw':!![],'where':{}};var _0x1ccfc5={};var _0x3aef7e={'count':0x0,'rows':[]};return db[_0xdc21('0x32')][_0xdc21('0x58')]({'where':{'id':_0x4d8f1b['params']['id']}})[_0xdc21('0x25')](handleEntityNotFound(_0x47757f,null))[_0xdc21('0x25')](function(_0x4f4d61){if(_0x4f4d61){_0x1ccfc5[_0xdc21('0x39')]=_[_0xdc21('0x37')](db[_0xdc21('0x61')][_0xdc21('0x33')]);_0x1ccfc5[_0xdc21('0x3a')]=_[_0xdc21('0x37')](_0x4d8f1b[_0xdc21('0x3a')]);_0x1ccfc5['filters']=_[_0xdc21('0x3c')](_0x1ccfc5[_0xdc21('0x39')],_0x1ccfc5['query']);_0x21011f[_0xdc21('0x3b')]=_[_0xdc21('0x3c')](_0x1ccfc5['model'],qs['fields'](_0x4d8f1b[_0xdc21('0x3a')][_0xdc21('0x3d')]));_0x21011f[_0xdc21('0x3b')]=_0x21011f[_0xdc21('0x3b')][_0xdc21('0x3e')]?_0x21011f[_0xdc21('0x3b')]:_0x1ccfc5[_0xdc21('0x39')];if(!_0x4d8f1b[_0xdc21('0x3a')][_0xdc21('0x3f')]('nolimit')){_0x21011f[_0xdc21('0x1f')]=qs[_0xdc21('0x1f')](_0x4d8f1b[_0xdc21('0x3a')][_0xdc21('0x1f')]);_0x21011f[_0xdc21('0x1c')]=qs[_0xdc21('0x1c')](_0x4d8f1b[_0xdc21('0x3a')][_0xdc21('0x1c')]);}_0x21011f[_0xdc21('0x5a')]=qs['sort'](_0x4d8f1b[_0xdc21('0x3a')][_0xdc21('0x41')]);_0x21011f[_0xdc21('0x42')]=qs[_0xdc21('0x38')](_['pick'](_0x4d8f1b['query'],_0x1ccfc5['filters']));_0x21011f[_0xdc21('0x42')][_0xdc21('0x5b')]=_0x4f4d61['id'];if(_0x4d8f1b['query'][_0xdc21('0x5d')]){_0x21011f[_0xdc21('0x42')]=_['merge'](_0x21011f[_0xdc21('0x42')],{'$or':_[_0xdc21('0x31')](_0x21011f[_0xdc21('0x3b')],function(_0x20c966){var _0x541a90={};_0x541a90[_0x20c966]={'$like':'%'+_0x4d8f1b['query'][_0xdc21('0x5d')]+'%'};return _0x541a90;})});}_0x21011f=_[_0xdc21('0x2c')]({},_0x21011f,_0x4d8f1b['options']);return db[_0xdc21('0x61')][_0xdc21('0x1e')]({'where':_0x21011f[_0xdc21('0x42')]})[_0xdc21('0x25')](function(_0x9cb135){_0x3aef7e[_0xdc21('0x1e')]=_0x9cb135;if(_0x4d8f1b[_0xdc21('0x3a')][_0xdc21('0x45')]){_0x21011f[_0xdc21('0x46')]=[{'all':!![]}];}return db[_0xdc21('0x61')]['findAll'](_0x21011f);})[_0xdc21('0x25')](function(_0x321449){_0x3aef7e[_0xdc21('0x48')]=_0x321449;return _0x3aef7e;});}})[_0xdc21('0x25')](respondWithFilteredResult(_0x47757f,_0x21011f))[_0xdc21('0x49')](handleError(_0x47757f,null));};exports[_0xdc21('0x62')]=function(_0xa3c18b,_0x4f3b7d,_0x2ccb47){var _0x51b57c={};var _0x27b349={};var _0x3529fa;var _0x44384f;return db[_0xdc21('0x32')]['findOne']({'where':{'id':_0xa3c18b[_0xdc21('0x4a')]['id']}})[_0xdc21('0x25')](handleEntityNotFound(_0x4f3b7d,null))['then'](function(_0x47275b){if(_0x47275b){_0x3529fa=_0x47275b;_0x27b349[_0xdc21('0x39')]=_['keys'](db[_0xdc21('0x63')][_0xdc21('0x33')]);_0x27b349[_0xdc21('0x3a')]=_[_0xdc21('0x37')](_0xa3c18b[_0xdc21('0x3a')]);_0x27b349[_0xdc21('0x38')]=_['intersection'](_0x27b349[_0xdc21('0x39')],_0x27b349[_0xdc21('0x3a')]);_0x51b57c[_0xdc21('0x3b')]=_['intersection'](_0x27b349[_0xdc21('0x39')],qs[_0xdc21('0x3d')](_0xa3c18b[_0xdc21('0x3a')][_0xdc21('0x3d')]));_0x51b57c['attributes']=_0x51b57c[_0xdc21('0x3b')][_0xdc21('0x3e')]?_0x51b57c[_0xdc21('0x3b')]:_0x27b349[_0xdc21('0x39')];_0x51b57c[_0xdc21('0x5a')]=qs[_0xdc21('0x41')](_0xa3c18b['query'][_0xdc21('0x41')]);_0x51b57c[_0xdc21('0x42')]=qs[_0xdc21('0x38')](_[_0xdc21('0x43')](_0xa3c18b['query'],_0x27b349[_0xdc21('0x38')]));if(_0xa3c18b['query'][_0xdc21('0x5d')]){_0x51b57c[_0xdc21('0x42')]=_[_0xdc21('0x2c')](_0x51b57c[_0xdc21('0x42')],{'$or':_[_0xdc21('0x31')](_0x51b57c[_0xdc21('0x3b')],function(_0x3fbb64){var _0x165c60={};_0x165c60[_0x3fbb64]={'$like':'%'+_0xa3c18b[_0xdc21('0x3a')][_0xdc21('0x5d')]+'%'};return _0x165c60;})});}_0x51b57c=_[_0xdc21('0x2c')]({},_0x51b57c,_0xa3c18b[_0xdc21('0x44')]);return _0x3529fa[_0xdc21('0x62')](_0x51b57c);}})[_0xdc21('0x25')](function(_0x1462fb){if(_0x1462fb){_0x44384f=_0x1462fb[_0xdc21('0x3e')];if(!_0xa3c18b[_0xdc21('0x3a')][_0xdc21('0x3f')]('nolimit')){_0x51b57c[_0xdc21('0x1f')]=qs['limit'](_0xa3c18b[_0xdc21('0x3a')][_0xdc21('0x1f')]);_0x51b57c['offset']=qs[_0xdc21('0x1c')](_0xa3c18b[_0xdc21('0x3a')][_0xdc21('0x1c')]);}return _0x3529fa['getLists'](_0x51b57c);}})[_0xdc21('0x25')](function(_0x589b09){if(_0x589b09){return _0x589b09?{'count':_0x44384f,'rows':_0x589b09}:null;}})[_0xdc21('0x25')](respondWithResult(_0x4f3b7d,null))['catch'](handleError(_0x4f3b7d,null));};exports[_0xdc21('0x64')]=function(_0xd685fb,_0x5426e3,_0x114961){var _0xe6c75f,_0x51a376;return db[_0xdc21('0x32')]['find']({'where':{'id':_0xd685fb[_0xdc21('0x4a')]['id']}})[_0xdc21('0x25')](handleEntityNotFound(_0x5426e3,null))[_0xdc21('0x25')](function(_0x46e8ea){if(_0x46e8ea){_0x51a376=_0x46e8ea;return _0x46e8ea[_0xdc21('0x64')](_0xd685fb[_0xdc21('0x2d')][_0xdc21('0x65')],_[_0xdc21('0x51')](_0xd685fb[_0xdc21('0x2d')],['ids','id'])||{});}return null;})[_0xdc21('0x66')](function(_0x5f4e8f){var _0xc37072;_0xe6c75f=_0x5f4e8f||[];var _0x3d82e8=[];if(_0x5f4e8f){for(var _0x1259fc=0x0;_0x1259fc<_0x5f4e8f[_0xdc21('0x3e')];_0x1259fc+=0x1){var _0x5e912c=_0x5f4e8f[_0x1259fc][_0xdc21('0x26')]({'plain':!![]});_0x51a376['dialCheckDuplicateType']=_0xd685fb[_0xdc21('0x2d')]['dialCheckDuplicateType']?_0xd685fb[_0xdc21('0x2d')]['dialCheckDuplicateType']:_0x51a376[_0xdc21('0x67')];switch(_0x51a376[_0xdc21('0x67')]){case'always':_0xc37072=squel[_0xdc21('0x68')]()[_0xdc21('0x69')](_0xdc21('0x6a'))[_0xdc21('0x6b')]([_0xdc21('0x6c'),_0xdc21('0x6d'),_0xdc21('0x6e'),_0xdc21('0x6f'),_0xdc21('0x5b'),_0xdc21('0x70'),_0xdc21('0x52')],squel[_0xdc21('0x71')]()[_0xdc21('0x72')](_0xdc21('0x6c'),_0xdc21('0x6c'))['field'](_0xdc21('0x73'),'scheduledAt')[_0xdc21('0x72')]('id',_0xdc21('0x6e'))[_0xdc21('0x72')](_0x5e912c[_0xdc21('0x74')][_0xdc21('0x75')](),_0xdc21('0x6f'))[_0xdc21('0x72')](_0xd685fb[_0xdc21('0x4a')]['id'][_0xdc21('0x75')](),'CampaignId')['field'](_0xdc21('0x73'),_0xdc21('0x70'))[_0xdc21('0x72')](_0xdc21('0x73'),'updatedAt')['from'](_0xdc21('0x76'))[_0xdc21('0x42')]('deletedAt\x20IS\x20NULL')[_0xdc21('0x42')](_0xdc21('0x77'),_0x5e912c[_0xdc21('0x74')]['toString']())[_0xdc21('0x42')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xdc21('0x78'),squel['select']()[_0xdc21('0x72')](_0xdc21('0x79'))[_0xdc21('0x7a')](_0xdc21('0x7b'))[_0xdc21('0x42')](_0xdc21('0x7c'),_0xd685fb[_0xdc21('0x4a')]['id'][_0xdc21('0x75')]()))[_0xdc21('0x42')](_0xdc21('0x78'),squel['select']()[_0xdc21('0x72')]('COALESCE(phone,\x27\x27)')[_0xdc21('0x7a')]('cm_hopper')[_0xdc21('0x42')](_0xdc21('0x7c'),_0xd685fb[_0xdc21('0x4a')]['id'][_0xdc21('0x75')]())))[_0xdc21('0x75')]();break;case _0xdc21('0x7d'):_0xc37072=squel[_0xdc21('0x68')]()['into'](_0xdc21('0x6a'))[_0xdc21('0x6b')](['phone',_0xdc21('0x6d'),_0xdc21('0x6e'),_0xdc21('0x6f'),'CampaignId',_0xdc21('0x70'),_0xdc21('0x52')],squel[_0xdc21('0x71')]()[_0xdc21('0x72')](_0xdc21('0x6c'),_0xdc21('0x6c'))['field'](_0xdc21('0x73'),_0xdc21('0x6d'))[_0xdc21('0x72')]('id',_0xdc21('0x6e'))[_0xdc21('0x72')](_0x5e912c[_0xdc21('0x74')]['toString'](),'ListId')[_0xdc21('0x72')](_0xd685fb[_0xdc21('0x4a')]['id'][_0xdc21('0x75')](),_0xdc21('0x5b'))[_0xdc21('0x72')](_0xdc21('0x73'),_0xdc21('0x70'))['field'](_0xdc21('0x73'),'updatedAt')['from']('cm_contacts')[_0xdc21('0x42')](_0xdc21('0x7e'))[_0xdc21('0x42')](_0xdc21('0x77'),_0x5e912c[_0xdc21('0x74')][_0xdc21('0x75')]())[_0xdc21('0x42')](_0xdc21('0x7f'))[_0xdc21('0x42')](_0xdc21('0x78'),squel['select']()[_0xdc21('0x72')]('COALESCE(phone,\x27\x27)')[_0xdc21('0x7a')](_0xdc21('0x6a'))['where'](_0xdc21('0x7c'),_0xd685fb[_0xdc21('0x4a')]['id'][_0xdc21('0x75')]())))[_0xdc21('0x75')]();break;default:_0xc37072=squel['insert']()[_0xdc21('0x69')](_0xdc21('0x6a'))[_0xdc21('0x6b')]([_0xdc21('0x6c'),_0xdc21('0x6d'),_0xdc21('0x6e'),'ListId',_0xdc21('0x5b'),_0xdc21('0x70'),'updatedAt'],squel[_0xdc21('0x71')]()[_0xdc21('0x72')](_0xdc21('0x6c'),'phone')[_0xdc21('0x72')](_0xdc21('0x73'),_0xdc21('0x6d'))['field']('id',_0xdc21('0x6e'))[_0xdc21('0x72')](_0x5e912c[_0xdc21('0x74')][_0xdc21('0x75')](),'ListId')[_0xdc21('0x72')](_0xd685fb[_0xdc21('0x4a')]['id']['toString'](),'CampaignId')[_0xdc21('0x72')](_0xdc21('0x73'),_0xdc21('0x70'))[_0xdc21('0x72')](_0xdc21('0x73'),_0xdc21('0x52'))['from'](_0xdc21('0x76'))[_0xdc21('0x42')](_0xdc21('0x7e'))[_0xdc21('0x42')](_0xdc21('0x77'),_0x5e912c[_0xdc21('0x74')][_0xdc21('0x75')]())[_0xdc21('0x42')](_0xdc21('0x7f')))[_0xdc21('0x75')]();}_0x3d82e8['push'](db[_0xdc21('0x80')][_0xdc21('0x3a')](_0xc37072));}return BPromise[_0xdc21('0x81')](_0x3d82e8);}})['then'](function(){return _0xe6c75f;})[_0xdc21('0x25')](respondWithResult(_0x5426e3,null))[_0xdc21('0x49')](handleError(_0x5426e3,null));};exports[_0xdc21('0x82')]=function(_0xd5df01,_0x5d2c47,_0x22a9c3){return db['Campaign']['find']({'where':{'id':_0xd5df01[_0xdc21('0x4a')]['id']}})[_0xdc21('0x25')](handleEntityNotFound(_0x5d2c47,null))['then'](function(_0x3999de){if(_0x3999de){return _0x3999de[_0xdc21('0x82')](_0xd5df01[_0xdc21('0x3a')][_0xdc21('0x65')]);}})[_0xdc21('0x25')](function(_0x283297){if(_0x283297){return db[_0xdc21('0x59')][_0xdc21('0x24')]({'where':{'ListId':_0xd5df01[_0xdc21('0x3a')][_0xdc21('0x65')],'CampaignId':_0xd5df01['params']['id']}})[_0xdc21('0x25')](function(){return _0x283297;});}})[_0xdc21('0x25')](respondWithStatusCode(_0x5d2c47,null))[_0xdc21('0x49')](handleError(_0x5d2c47,null));};exports[_0xdc21('0x83')]=function(_0x179519,_0x4d3867,_0x394d00){var _0x5ec883={};var _0x12915e={};var _0x235438;var _0x5caf81;return db[_0xdc21('0x32')][_0xdc21('0x58')]({'where':{'id':_0x179519[_0xdc21('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4d3867,null))[_0xdc21('0x25')](function(_0x30a73b){if(_0x30a73b){_0x235438=_0x30a73b;_0x12915e['model']=_[_0xdc21('0x37')](db[_0xdc21('0x63')][_0xdc21('0x33')]);_0x12915e[_0xdc21('0x3a')]=_[_0xdc21('0x37')](_0x179519['query']);_0x12915e[_0xdc21('0x38')]=_[_0xdc21('0x3c')](_0x12915e[_0xdc21('0x39')],_0x12915e[_0xdc21('0x3a')]);_0x5ec883[_0xdc21('0x3b')]=_[_0xdc21('0x3c')](_0x12915e[_0xdc21('0x39')],qs[_0xdc21('0x3d')](_0x179519['query']['fields']));_0x5ec883[_0xdc21('0x3b')]=_0x5ec883[_0xdc21('0x3b')][_0xdc21('0x3e')]?_0x5ec883[_0xdc21('0x3b')]:_0x12915e[_0xdc21('0x39')];_0x5ec883['order']=qs[_0xdc21('0x41')](_0x179519[_0xdc21('0x3a')][_0xdc21('0x41')]);_0x5ec883[_0xdc21('0x42')]=qs[_0xdc21('0x38')](_['pick'](_0x179519[_0xdc21('0x3a')],_0x12915e[_0xdc21('0x38')]));if(_0x179519['query'][_0xdc21('0x5d')]){_0x5ec883[_0xdc21('0x42')]=_['merge'](_0x5ec883[_0xdc21('0x42')],{'$or':_[_0xdc21('0x31')](_0x5ec883[_0xdc21('0x3b')],function(_0x18b2c1){var _0x43fefd={};_0x43fefd[_0x18b2c1]={'$like':'%'+_0x179519[_0xdc21('0x3a')][_0xdc21('0x5d')]+'%'};return _0x43fefd;})});}_0x5ec883=_['merge']({},_0x5ec883,_0x179519[_0xdc21('0x44')]);return _0x235438[_0xdc21('0x83')](_0x5ec883);}})[_0xdc21('0x25')](function(_0x40d8ce){if(_0x40d8ce){_0x5caf81=_0x40d8ce[_0xdc21('0x3e')];if(!_0x179519[_0xdc21('0x3a')][_0xdc21('0x3f')](_0xdc21('0x40'))){_0x5ec883['limit']=qs['limit'](_0x179519[_0xdc21('0x3a')][_0xdc21('0x1f')]);_0x5ec883[_0xdc21('0x1c')]=qs[_0xdc21('0x1c')](_0x179519[_0xdc21('0x3a')]['offset']);}return _0x235438[_0xdc21('0x83')](_0x5ec883);}})[_0xdc21('0x25')](function(_0x4ec354){if(_0x4ec354){return _0x4ec354?{'count':_0x5caf81,'rows':_0x4ec354}:null;}})[_0xdc21('0x25')](respondWithResult(_0x4d3867,null))[_0xdc21('0x49')](handleError(_0x4d3867,null));};exports['addBlackLists']=function(_0x4470e7,_0x1ad843,_0x2044d9){var _0xfab5a3,_0x150bcb;return db[_0xdc21('0x32')][_0xdc21('0x4d')]({'where':{'id':_0x4470e7[_0xdc21('0x4a')]['id']}})[_0xdc21('0x25')](handleEntityNotFound(_0x1ad843,null))[_0xdc21('0x25')](function(_0x4ad277){if(_0x4ad277){_0x150bcb=_0x4ad277;return _0x4ad277['addBlackLists'](_0x4470e7['body']['ids'],_[_0xdc21('0x51')](_0x4470e7['body'],[_0xdc21('0x65'),'id'])||{});}return null;})[_0xdc21('0x66')](function(_0x594a67){var _0x7b8196;_0xfab5a3=_0x594a67||[];var _0x323b08=[];if(_0x594a67){for(var _0x55b85=0x0;_0x55b85<_0x594a67['length'];_0x55b85+=0x1){var _0x310d71=_0x594a67[_0x55b85][_0xdc21('0x26')]({'plain':!![]});_0x7b8196=squel[_0xdc21('0x68')]()[_0xdc21('0x69')](_0xdc21('0x84'))[_0xdc21('0x6b')]([_0xdc21('0x6c'),_0xdc21('0x6e'),_0xdc21('0x6f'),_0xdc21('0x5b'),_0xdc21('0x70'),_0xdc21('0x52')],squel['select']()['field'](_0xdc21('0x6c'),_0xdc21('0x6c'))['field']('id','ContactId')['field'](_0x310d71[_0xdc21('0x74')]['toString'](),'ListId')['field'](_0x4470e7[_0xdc21('0x4a')]['id'][_0xdc21('0x75')](),_0xdc21('0x5b'))[_0xdc21('0x72')]('NOW()','createdAt')[_0xdc21('0x72')](_0xdc21('0x73'),_0xdc21('0x52'))['from'](_0xdc21('0x76'))[_0xdc21('0x42')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x310d71[_0xdc21('0x74')][_0xdc21('0x75')]())[_0xdc21('0x42')](_0xdc21('0x7f')))[_0xdc21('0x75')]();_0x323b08[_0xdc21('0x85')](db[_0xdc21('0x80')]['query'](_0x7b8196));}return BPromise[_0xdc21('0x81')](_0x323b08);}})[_0xdc21('0x25')](function(){return _0xfab5a3;})[_0xdc21('0x25')](respondWithResult(_0x1ad843,null))[_0xdc21('0x49')](handleError(_0x1ad843,null));};exports[_0xdc21('0x86')]=function(_0x46539d,_0x3b4c98,_0xfea613){return db[_0xdc21('0x32')][_0xdc21('0x4d')]({'where':{'id':_0x46539d['params']['id']}})[_0xdc21('0x25')](handleEntityNotFound(_0x3b4c98,null))[_0xdc21('0x25')](function(_0x2ab778){if(_0x2ab778){return _0x2ab778['removeBlackLists'](_0x46539d['query'][_0xdc21('0x65')]);}})[_0xdc21('0x25')](function(_0x2d350d){if(_0x2d350d){return db[_0xdc21('0x61')]['destroy']({'where':{'ListId':_0x46539d[_0xdc21('0x3a')][_0xdc21('0x65')],'CampaignId':_0x46539d[_0xdc21('0x4a')]['id']}})[_0xdc21('0x25')](function(){return _0x2d350d;});}})['then'](respondWithStatusCode(_0x3b4c98,null))['catch'](handleError(_0x3b4c98,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 5e55016..ae98ade 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 _0x3f36=['../../config/environment','./campaign.attributes','exports','define','Campaign','campaigns','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x301064,_0x1985aa){var _0x5bc841=function(_0x57dffc){while(--_0x57dffc){_0x301064['push'](_0x301064['shift']());}};_0x5bc841(++_0x1985aa);}(_0x3f36,0x18e));var _0x63f3=function(_0x43b08,_0x15f967){_0x43b08=_0x43b08-0x0;var _0x5e05f4=_0x3f36[_0x43b08];return _0x5e05f4;};'use strict';var _=require(_0x63f3('0x0'));var util=require(_0x63f3('0x1'));var logger=require(_0x63f3('0x2'))(_0x63f3('0x3'));var moment=require('moment');var BPromise=require(_0x63f3('0x4'));var rp=require(_0x63f3('0x5'));var fs=require('fs');var path=require(_0x63f3('0x6'));var rimraf=require(_0x63f3('0x7'));var config=require(_0x63f3('0x8'));var attributes=require(_0x63f3('0x9'));module[_0x63f3('0xa')]=function(_0x569a0e,_0x17cf5b){return _0x569a0e[_0x63f3('0xb')](_0x63f3('0xc'),attributes,{'tableName':_0x63f3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8980=['../../config/logger','api','moment','rimraf','../../config/environment','./campaign.attributes','exports','define','Campaign','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8980,0x17b));var _0x0898=function(_0x45262e,_0x1d9c0b){_0x45262e=_0x45262e-0x0;var _0x3b7f60=_0x8980[_0x45262e];return _0x3b7f60;};'use strict';var _=require(_0x0898('0x0'));var util=require('util');var logger=require(_0x0898('0x1'))(_0x0898('0x2'));var moment=require(_0x0898('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0898('0x4'));var config=require(_0x0898('0x5'));var attributes=require(_0x0898('0x6'));module[_0x0898('0x7')]=function(_0x26fe1c,_0x39fd82){return _0x26fe1c[_0x0898('0x8')](_0x0898('0x9'),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 19624aa..f2d8a55 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 _0x9957=['catch','GetCampaign','findAll','raw','options','where','attributes','limit','map','include','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x20b6f3,_0xa60bb7){var _0x38b3fe=function(_0x9be5b6){while(--_0x9be5b6){_0x20b6f3['push'](_0x20b6f3['shift']());}};_0x38b3fe(++_0xa60bb7);}(_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 moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Campaign'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'limit':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')]['include']?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')][_0x7995('0x20')],function(_0x285437){return{'model':db[_0x285437[_0x7995('0x21')]],'as':_0x285437['as'],'attributes':_0x285437[_0x7995('0x1d')],'include':_0x285437[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x285437['include'],function(_0x39df42){return{'model':db[_0x39df42[_0x7995('0x21')]],'as':_0x39df42['as'],'attributes':_0x39df42[_0x7995('0x1d')],'include':_0x39df42[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x39df42[_0x7995('0x20')],function(_0x56691a){return{'model':db[_0x56691a[_0x7995('0x21')]],'as':_0x56691a['as'],'attributes':_0x56691a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0xc')](function(_0x49bc7e){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')]('GetCampaign',_0x291317,JSON[_0x7995('0x12')](_0x49bc7e));_0x37a7d4(_0x49bc7e);})['catch'](function(_0x456a28){logger[_0x7995('0x13')](_0x7995('0x18'),_0x456a28['message'],_0x291317);_0x4faa60(_0x1e1415['error'](0x1f4,_0x456a28['message']));});});};
\ No newline at end of file
+var _0xa9e0=['catch','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x26c88d,_0x3be317){var _0x52f047=function(_0x28d7d0){while(--_0x28d7d0){_0x26c88d['push'](_0x26c88d['shift']());}};_0x52f047(++_0x3be317);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetCampaign']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 301a843..fd0f649 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 _0x0bcc=['getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addBlackLists','update','delete','destroy','removeLists','removeBlackLists','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers'];(function(_0xdbbce6,_0x43883c){var _0x1ba2e7=function(_0x29c2b0){while(--_0x29c2b0){_0xdbbce6['push'](_0xdbbce6['shift']());}};_0x1ba2e7(++_0x43883c);}(_0x0bcc,0xdf));var _0xc0bc=function(_0x389abb,_0x241f9f){_0x389abb=_0x389abb-0x0;var _0x36d5b0=_0x0bcc[_0x389abb];return _0x36d5b0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc0bc('0x0'));var timeout=require(_0xc0bc('0x1'));var express=require(_0xc0bc('0x2'));var router=express[_0xc0bc('0x3')]();var fs_extra=require(_0xc0bc('0x4'));var auth=require(_0xc0bc('0x5'));var interaction=require(_0xc0bc('0x6'));var config=require(_0xc0bc('0x7'));var controller=require(_0xc0bc('0x8'));router[_0xc0bc('0x9')]('/',auth[_0xc0bc('0xa')](),controller[_0xc0bc('0xb')]);router[_0xc0bc('0x9')](_0xc0bc('0xc'),auth['isAuthenticated'](),controller[_0xc0bc('0xd')]);router[_0xc0bc('0x9')](_0xc0bc('0xe'),auth[_0xc0bc('0xa')](),controller[_0xc0bc('0xf')]);router[_0xc0bc('0x9')](_0xc0bc('0x10'),auth[_0xc0bc('0xa')](),controller[_0xc0bc('0x11')]);router[_0xc0bc('0x9')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0xc0bc('0x12')]);router[_0xc0bc('0x9')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0xc0bc('0x13')]);router[_0xc0bc('0x9')](_0xc0bc('0x14'),auth['isAuthenticated'](),controller[_0xc0bc('0x15')]);router['get'](_0xc0bc('0x16'),auth[_0xc0bc('0xa')](),controller[_0xc0bc('0x17')]);router[_0xc0bc('0x18')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc0bc('0x18')](_0xc0bc('0x19'),auth[_0xc0bc('0xa')](),controller[_0xc0bc('0x1a')]);router['post'](_0xc0bc('0x14'),auth[_0xc0bc('0xa')](),controller['addLists']);router[_0xc0bc('0x18')](_0xc0bc('0x16'),auth[_0xc0bc('0xa')](),controller[_0xc0bc('0x1b')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc0bc('0x1c')]);router[_0xc0bc('0x1d')](_0xc0bc('0xc'),auth['isAuthenticated'](),controller[_0xc0bc('0x1e')]);router['delete'](_0xc0bc('0x14'),auth[_0xc0bc('0xa')](),controller[_0xc0bc('0x1f')]);router[_0xc0bc('0x1d')](_0xc0bc('0x16'),auth[_0xc0bc('0xa')](),controller[_0xc0bc('0x20')]);module[_0xc0bc('0x21')]=router;
\ No newline at end of file
+var _0x40c4=['update','delete','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','post','create','/:id/clone','addLists','/:id/blacklists','addBlackLists','put'];(function(_0x32351e,_0x25d53a){var _0xcc55=function(_0x1ce0dd){while(--_0x1ce0dd){_0x32351e['push'](_0x32351e['shift']());}};_0xcc55(++_0x25d53a);}(_0x40c4,0xbe));var _0x440c=function(_0x2a518f,_0x3fff40){_0x2a518f=_0x2a518f-0x0;var _0xb1d1f8=_0x40c4[_0x2a518f];return _0xb1d1f8;};'use strict';var multer=require(_0x440c('0x0'));var util=require(_0x440c('0x1'));var path=require(_0x440c('0x2'));var timeout=require(_0x440c('0x3'));var express=require(_0x440c('0x4'));var router=express[_0x440c('0x5')]();var fs_extra=require(_0x440c('0x6'));var auth=require(_0x440c('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0x440c('0x8')]('/',auth[_0x440c('0x9')](),controller[_0x440c('0xa')]);router['get'](_0x440c('0xb'),auth[_0x440c('0x9')](),controller['show']);router[_0x440c('0x8')](_0x440c('0xc'),auth[_0x440c('0x9')](),controller[_0x440c('0xd')]);router[_0x440c('0x8')](_0x440c('0xe'),auth['isAuthenticated'](),controller['getHopperHistories']);router['get'](_0x440c('0xf'),auth[_0x440c('0x9')](),controller[_0x440c('0x10')]);router[_0x440c('0x8')](_0x440c('0x11'),auth['isAuthenticated'](),controller[_0x440c('0x12')]);router[_0x440c('0x8')](_0x440c('0x13'),auth['isAuthenticated'](),controller['getLists']);router[_0x440c('0x8')]('/:id/blacklists',auth[_0x440c('0x9')](),controller['getBlackLists']);router[_0x440c('0x14')]('/',auth[_0x440c('0x9')](),controller[_0x440c('0x15')]);router[_0x440c('0x14')](_0x440c('0x16'),auth['isAuthenticated'](),controller['clone']);router['post']('/:id/lists',auth['isAuthenticated'](),controller[_0x440c('0x17')]);router[_0x440c('0x14')](_0x440c('0x18'),auth[_0x440c('0x9')](),controller[_0x440c('0x19')]);router[_0x440c('0x1a')](_0x440c('0xb'),auth[_0x440c('0x9')](),controller[_0x440c('0x1b')]);router['delete'](_0x440c('0xb'),auth[_0x440c('0x9')](),controller['destroy']);router['delete'](_0x440c('0x13'),auth[_0x440c('0x9')](),controller['removeLists']);router[_0x440c('0x1c')](_0x440c('0x18'),auth[_0x440c('0x9')](),controller[_0x440c('0x1d')]);module[_0x440c('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index b86c169..2a633f3 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 _0x906b=['getDataValue','key','sequelize','STRING','TEXT','VIRTUAL'];(function(_0x44fc35,_0x2e6c4d){var _0x5610a9=function(_0xee575b){while(--_0xee575b){_0x44fc35['push'](_0x44fc35['shift']());}};_0x5610a9(++_0x2e6c4d);}(_0x906b,0xfe));var _0xb906=function(_0x4063a4,_0x19d730){_0x4063a4=_0x4063a4-0x0;var _0x17908d=_0x906b[_0x4063a4];return _0x17908d;};'use strict';var Sequelize=require(_0xb906('0x0'));module['exports']={'key':{'type':Sequelize[_0xb906('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xb906('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xb906('0x3')],'get':function(){return this[_0xb906('0x4')](_0xb906('0x5'));}}};
\ No newline at end of file
+var _0xc844=['key','sequelize','exports','STRING','TEXT','getDataValue'];(function(_0x4942db,_0x56a8e6){var _0x4b2946=function(_0x1164de){while(--_0x1164de){_0x4942db['push'](_0x4942db['shift']());}};_0x4b2946(++_0x56a8e6);}(_0xc844,0xe5));var _0x4c84=function(_0x5335ba,_0xe07dd7){_0x5335ba=_0x5335ba-0x0;var _0x4ca621=_0xc844[_0x5335ba];return _0x4ca621;};'use strict';var Sequelize=require(_0x4c84('0x0'));module[_0x4c84('0x1')]={'key':{'type':Sequelize[_0x4c84('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x4c84('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x4c84('0x4')](_0x4c84('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 9f430aa..24a48e2 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 _0x6789=['params','rawAttributes','length','includeAll','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','get','CannedAnswers','UserProfileResource','error','stack','name','send','merge','body','contact','message','agent','account','index','map','CannedAnswer','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','include','findAll','catch','show'];(function(_0xe86ed2,_0x389bc9){var _0x374ff1=function(_0x4a8f21){while(--_0x4a8f21){_0xe86ed2['push'](_0xe86ed2['shift']());}};_0x374ff1(++_0x389bc9);}(_0x6789,0xcb));var _0x9678=function(_0x296a3c,_0x22c355){_0x296a3c=_0x296a3c-0x0;var _0x257e73=_0x6789[_0x296a3c];return _0x257e73;};'use strict';var emlformat=require(_0x9678('0x0'));var rimraf=require(_0x9678('0x1'));var zipdir=require(_0x9678('0x2'));var jsonpatch=require(_0x9678('0x3'));var rp=require(_0x9678('0x4'));var moment=require(_0x9678('0x5'));var BPromise=require(_0x9678('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9678('0x7'));var sox=require(_0x9678('0x8'));var csv=require(_0x9678('0x9'));var ejs=require(_0x9678('0xa'));var fs=require('fs');var fs_extra=require(_0x9678('0xb'));var _=require('lodash');var squel=require(_0x9678('0xc'));var crypto=require('crypto');var jsforce=require(_0x9678('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9678('0xe'));var Papa=require(_0x9678('0xf'));var Redis=require(_0x9678('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9678('0x11'));var hardwareService=require(_0x9678('0x12'));var logger=require(_0x9678('0x13'))(_0x9678('0x14'));var utils=require(_0x9678('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9678('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3113bd,_0x3f8a33){_0x3f8a33=_0x3f8a33||0xcc;return function(_0x210a29){if(_0x210a29){return _0x3113bd[_0x9678('0x17')](_0x3f8a33);}return _0x3113bd[_0x9678('0x18')](_0x3f8a33)[_0x9678('0x19')]();};}function respondWithResult(_0x1e5922,_0x3da995){_0x3da995=_0x3da995||0xc8;return function(_0x33b4b4){if(_0x33b4b4){return _0x1e5922['status'](_0x3da995)['json'](_0x33b4b4);}};}function respondWithFilteredResult(_0x3d0f14,_0x3884e8){return function(_0x481973){if(_0x481973){var _0x3c91e2=typeof _0x3884e8['offset']===_0x9678('0x1a')&&typeof _0x3884e8[_0x9678('0x1b')]==='undefined';var _0x37b478=_0x481973[_0x9678('0x1c')];var _0xf79aec=_0x3c91e2?0x0:_0x3884e8['offset'];var _0x4a7a07=_0x3c91e2?_0x481973[_0x9678('0x1c')]:_0x3884e8[_0x9678('0x1d')]+_0x3884e8[_0x9678('0x1b')];var _0x42fdc6;if(_0x4a7a07>=_0x37b478){_0x4a7a07=_0x37b478;_0x42fdc6=0xc8;}else{_0x42fdc6=0xce;}_0x3d0f14['status'](_0x42fdc6);return _0x3d0f14[_0x9678('0x1e')]('Content-Range',_0xf79aec+'-'+_0x4a7a07+'/'+_0x37b478)[_0x9678('0x1f')](_0x481973);}return null;};}function patchUpdates(_0x5733c8){return function(_0x2c8aec){try{jsonpatch[_0x9678('0x20')](_0x2c8aec,_0x5733c8,!![]);}catch(_0x35a78d){return BPromise['reject'](_0x35a78d);}return _0x2c8aec[_0x9678('0x21')]();};}function saveUpdates(_0x1cc6b0,_0x42042b){return function(_0x3f81ba){if(_0x3f81ba){return _0x3f81ba[_0x9678('0x22')](_0x1cc6b0)[_0x9678('0x23')](function(_0x257f15){return _0x257f15;});}return null;};}function removeEntity(_0xe6f467,_0x298e2e){return function(_0x1a2d41){if(_0x1a2d41){return _0x1a2d41['destroy']()[_0x9678('0x23')](function(){var _0x2a62d9=_0x1a2d41[_0x9678('0x24')]({'plain':!![]});var _0xec32c8=_0x9678('0x25');return db[_0x9678('0x26')]['destroy']({'where':{'type':_0xec32c8,'resourceId':_0x2a62d9['id']}})['then'](function(){return _0x1a2d41;});})[_0x9678('0x23')](function(){_0xe6f467['status'](0xcc)[_0x9678('0x19')]();});}};}function handleEntityNotFound(_0x201da7,_0x8bfdb5){return function(_0x2361fb){if(!_0x2361fb){_0x201da7[_0x9678('0x17')](0x194);}return _0x2361fb;};}function handleError(_0x1b94bf,_0x48620d){_0x48620d=_0x48620d||0x1f4;return function(_0xe68f37){logger[_0x9678('0x27')](_0xe68f37[_0x9678('0x28')]);if(_0xe68f37[_0x9678('0x29')]){delete _0xe68f37[_0x9678('0x29')];}_0x1b94bf[_0x9678('0x18')](_0x48620d)[_0x9678('0x2a')](_0xe68f37);};}function getMustacheRender(_0x55c585,_0x446c8a){return Mustache['render'](_0x55c585,_[_0x9678('0x2b')](_0x446c8a[_0x9678('0x2c')],{'contact':_0x446c8a[_0x9678('0x2d')],'message':_0x446c8a[_0x9678('0x2e')],'agent':_0x446c8a[_0x9678('0x2f')],'interaction':_0x446c8a['interaction'],'account':_0x446c8a[_0x9678('0x30')]}))||'';}exports[_0x9678('0x31')]=function(_0x59789b,_0x10f389){var _0x1f3032={},_0x245aaf={},_0x3fcdd9={'count':0x0,'rows':[]};var _0x36d18d=_[_0x9678('0x32')](db[_0x9678('0x33')]['rawAttributes'],function(_0x46fc19){return{'name':_0x46fc19[_0x9678('0x34')],'type':_0x46fc19['type'][_0x9678('0x35')]};});_0x245aaf[_0x9678('0x36')]=_[_0x9678('0x32')](_0x36d18d,_0x9678('0x29'));_0x245aaf[_0x9678('0x37')]=_[_0x9678('0x38')](_0x59789b['query']);_0x245aaf[_0x9678('0x39')]=_[_0x9678('0x3a')](_0x245aaf['model'],_0x245aaf[_0x9678('0x37')]);_0x1f3032['attributes']=_[_0x9678('0x3a')](_0x245aaf[_0x9678('0x36')],qs[_0x9678('0x3b')](_0x59789b['query'][_0x9678('0x3b')]));_0x1f3032[_0x9678('0x3c')]=_0x1f3032[_0x9678('0x3c')]['length']?_0x1f3032[_0x9678('0x3c')]:_0x245aaf['model'];if(!_0x59789b[_0x9678('0x37')][_0x9678('0x3d')](_0x9678('0x3e'))){_0x1f3032[_0x9678('0x1b')]=qs[_0x9678('0x1b')](_0x59789b[_0x9678('0x37')]['limit']);_0x1f3032[_0x9678('0x1d')]=qs[_0x9678('0x1d')](_0x59789b[_0x9678('0x37')][_0x9678('0x1d')]);}_0x1f3032[_0x9678('0x3f')]=qs[_0x9678('0x40')](_0x59789b[_0x9678('0x37')][_0x9678('0x40')]);_0x1f3032[_0x9678('0x41')]=qs['filters'](_[_0x9678('0x42')](_0x59789b[_0x9678('0x37')],_0x245aaf[_0x9678('0x39')]),_0x36d18d);if(_0x59789b[_0x9678('0x37')][_0x9678('0x43')]){_0x1f3032['where']=_[_0x9678('0x2b')](_0x1f3032[_0x9678('0x41')],{'$or':[{'key':{'$like':'%'+_0x59789b['query']['filter']+'%'}},{'value':{'$like':'%'+_0x59789b[_0x9678('0x37')][_0x9678('0x43')]+'%'}}]});}_0x1f3032=_[_0x9678('0x2b')]({},_0x1f3032,_0x59789b[_0x9678('0x44')]);var _0x49cb20={'where':_0x1f3032['where']};return db[_0x9678('0x33')][_0x9678('0x1c')](_0x49cb20)[_0x9678('0x23')](function(_0x186282){_0x3fcdd9[_0x9678('0x1c')]=_0x186282;if(_0x59789b[_0x9678('0x37')]['includeAll']){_0x1f3032[_0x9678('0x45')]=[{'all':!![]}];}return db['CannedAnswer'][_0x9678('0x46')](_0x1f3032);})['then'](function(_0x506eb5){_0x3fcdd9['rows']=_0x506eb5;return _0x3fcdd9;})[_0x9678('0x23')](respondWithFilteredResult(_0x10f389,_0x1f3032))[_0x9678('0x47')](handleError(_0x10f389,null));};exports[_0x9678('0x48')]=function(_0x3cacd8,_0x19371e){var _0x44a671={'raw':!![],'where':{'id':_0x3cacd8[_0x9678('0x49')]['id']}},_0x374ca2={};_0x374ca2['model']=_['keys'](db[_0x9678('0x33')][_0x9678('0x4a')]);_0x374ca2[_0x9678('0x37')]=_['keys'](_0x3cacd8[_0x9678('0x37')]);_0x374ca2[_0x9678('0x39')]=_[_0x9678('0x3a')](_0x374ca2[_0x9678('0x36')],_0x374ca2[_0x9678('0x37')]);_0x44a671['attributes']=_[_0x9678('0x3a')](_0x374ca2[_0x9678('0x36')],qs[_0x9678('0x3b')](_0x3cacd8[_0x9678('0x37')][_0x9678('0x3b')]));_0x44a671[_0x9678('0x3c')]=_0x44a671[_0x9678('0x3c')][_0x9678('0x4b')]?_0x44a671[_0x9678('0x3c')]:_0x374ca2['model'];if(_0x3cacd8[_0x9678('0x37')][_0x9678('0x4c')]){_0x44a671[_0x9678('0x45')]=[{'all':!![]}];}_0x44a671=_['merge']({},_0x44a671,_0x3cacd8[_0x9678('0x44')]);return db[_0x9678('0x33')][_0x9678('0x4d')](_0x44a671)[_0x9678('0x23')](handleEntityNotFound(_0x19371e,null))[_0x9678('0x23')](respondWithResult(_0x19371e,null))[_0x9678('0x47')](handleError(_0x19371e,null));};exports[_0x9678('0x22')]=function(_0x1a75f8,_0x5410fc){if(_0x1a75f8[_0x9678('0x2c')]['id']){delete _0x1a75f8['body']['id'];}return db[_0x9678('0x33')][_0x9678('0x4d')]({'where':{'id':_0x1a75f8[_0x9678('0x49')]['id']}})[_0x9678('0x23')](handleEntityNotFound(_0x5410fc,null))['then'](saveUpdates(_0x1a75f8[_0x9678('0x2c')],null))[_0x9678('0x23')](respondWithResult(_0x5410fc,null))['catch'](handleError(_0x5410fc,null));};exports['destroy']=function(_0x5d5835,_0x4e0067){return db[_0x9678('0x33')][_0x9678('0x4d')]({'where':{'id':_0x5d5835[_0x9678('0x49')]['id']}})['then'](handleEntityNotFound(_0x4e0067,null))['then'](removeEntity(_0x4e0067,null))['catch'](handleError(_0x4e0067,null));};exports[_0x9678('0x4e')]=function(_0x7bb357,_0x262773){var _0x568aca={'key':_0x7bb357[_0x9678('0x2c')][_0x9678('0x35')]};if(_0x7bb357[_0x9678('0x2c')][_0x9678('0x4f')]){_0x568aca[_0x9678('0x4f')]=_0x7bb357[_0x9678('0x2c')][_0x9678('0x4f')];}else if(_0x7bb357['body'][_0x9678('0x50')]){_0x568aca['SmsAccountId']=_0x7bb357[_0x9678('0x2c')][_0x9678('0x50')];}else if(_0x7bb357[_0x9678('0x2c')][_0x9678('0x51')]){_0x568aca['OpenchannelAccountId']=_0x7bb357[_0x9678('0x2c')]['OpenchannelAccountId'];}else if(_0x7bb357['body'][_0x9678('0x52')]){_0x568aca['ChatWebsiteId']=_0x7bb357[_0x9678('0x2c')][_0x9678('0x52')];}return db[_0x9678('0x33')]['find']({'where':_0x568aca})[_0x9678('0x23')](function(_0x2121ce){if(_0x2121ce){throw new db['Sequelize'][(_0x9678('0x53'))](_0x9678('0x54'));}return db[_0x9678('0x33')][_0x9678('0x4e')](_0x7bb357['body']);})['then'](function(_0xb9c16f){var _0xbc9f67=_0x7bb357[_0x9678('0x55')]['get']({'plain':!![]});if(!_0xbc9f67)throw new Error(_0x9678('0x56'));if(_0xbc9f67[_0x9678('0x57')]===_0x9678('0x55')){var _0x1c0a34=_0xb9c16f['get']({'plain':!![]});return db[_0x9678('0x58')][_0x9678('0x4d')]({'where':{'name':'CannedAnswers','userProfileId':_0xbc9f67[_0x9678('0x59')]},'raw':!![]})[_0x9678('0x23')](function(_0x336a40){if(_0x336a40&&_0x336a40[_0x9678('0x5a')]===0x0){return db[_0x9678('0x26')][_0x9678('0x4e')]({'name':_0x1c0a34[_0x9678('0x29')],'resourceId':_0x1c0a34['id'],'type':_0x336a40['name'],'sectionId':_0x336a40['id']},{})[_0x9678('0x23')](function(){return _0xb9c16f;});}else{return _0xb9c16f;}})['catch'](function(_0x53fb50){logger[_0x9678('0x27')](_0x9678('0x5b'),_0x53fb50);throw _0x53fb50;});}return _0xb9c16f;})[_0x9678('0x23')](respondWithResult(_0x262773,0xc9))[_0x9678('0x47')](handleError(_0x262773,null));};
\ No newline at end of file
+var _0x30f9=['show','params','find','catch','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','undefined','count','offset','limit','apply','save','update','destroy','then','get','CannedAnswers','error','stack','name','send','render','body','contact','message','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','CannedAnswer','include','findAll','rows'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0x30f9,0xc5));var _0x930f=function(_0x56f7e2,_0x145392){_0x56f7e2=_0x56f7e2-0x0;var _0x36240b=_0x30f9[_0x56f7e2];return _0x36240b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x930f('0x0'));var jsonpatch=require(_0x930f('0x1'));var rp=require(_0x930f('0x2'));var moment=require(_0x930f('0x3'));var BPromise=require(_0x930f('0x4'));var Mustache=require(_0x930f('0x5'));var util=require(_0x930f('0x6'));var path=require(_0x930f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x930f('0x8'));var fs=require('fs');var fs_extra=require(_0x930f('0x9'));var _=require(_0x930f('0xa'));var squel=require('squel');var crypto=require(_0x930f('0xb'));var jsforce=require(_0x930f('0xc'));var deskjs=require(_0x930f('0xd'));var toCsv=require(_0x930f('0xe'));var querystring=require(_0x930f('0xf'));var Papa=require(_0x930f('0x10'));var Redis=require(_0x930f('0x11'));var authService=require(_0x930f('0x12'));var qs=require(_0x930f('0x13'));var as=require(_0x930f('0x14'));var hardwareService=require(_0x930f('0x15'));var logger=require(_0x930f('0x16'))(_0x930f('0x17'));var utils=require('../../config/utils');var config=require(_0x930f('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2aae22,_0x509ad1){_0x509ad1=_0x509ad1||0xcc;return function(_0x726ed6){if(_0x726ed6){return _0x2aae22[_0x930f('0x19')](_0x509ad1);}return _0x2aae22[_0x930f('0x1a')](_0x509ad1)[_0x930f('0x1b')]();};}function respondWithResult(_0x3760a9,_0x41c747){_0x41c747=_0x41c747||0xc8;return function(_0x3ae186){if(_0x3ae186){return _0x3760a9['status'](_0x41c747)['json'](_0x3ae186);}};}function respondWithFilteredResult(_0x35f2a9,_0x137134){return function(_0x348bcb){if(_0x348bcb){var _0x1c22ac=typeof _0x137134['offset']===_0x930f('0x1c')&&typeof _0x137134['limit']===_0x930f('0x1c');var _0x525d4b=_0x348bcb[_0x930f('0x1d')];var _0x5aac0c=_0x1c22ac?0x0:_0x137134[_0x930f('0x1e')];var _0x175ad5=_0x1c22ac?_0x348bcb[_0x930f('0x1d')]:_0x137134['offset']+_0x137134[_0x930f('0x1f')];var _0x4a4cac;if(_0x175ad5>=_0x525d4b){_0x175ad5=_0x525d4b;_0x4a4cac=0xc8;}else{_0x4a4cac=0xce;}_0x35f2a9[_0x930f('0x1a')](_0x4a4cac);return _0x35f2a9['set']('Content-Range',_0x5aac0c+'-'+_0x175ad5+'/'+_0x525d4b)['json'](_0x348bcb);}return null;};}function patchUpdates(_0x5ee21e){return function(_0x3944a6){try{jsonpatch[_0x930f('0x20')](_0x3944a6,_0x5ee21e,!![]);}catch(_0x3f8567){return BPromise['reject'](_0x3f8567);}return _0x3944a6[_0x930f('0x21')]();};}function saveUpdates(_0x376ee7,_0x9a181f){return function(_0x1b57ab){if(_0x1b57ab){return _0x1b57ab[_0x930f('0x22')](_0x376ee7)['then'](function(_0x33f507){return _0x33f507;});}return null;};}function removeEntity(_0x591f6b,_0x3eeb63){return function(_0x1759cd){if(_0x1759cd){return _0x1759cd[_0x930f('0x23')]()[_0x930f('0x24')](function(){var _0x8c7962=_0x1759cd[_0x930f('0x25')]({'plain':!![]});var _0x4a6058=_0x930f('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x4a6058,'resourceId':_0x8c7962['id']}})[_0x930f('0x24')](function(){return _0x1759cd;});})[_0x930f('0x24')](function(){_0x591f6b[_0x930f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d45e6,_0xb05646){return function(_0xe9cd48){if(!_0xe9cd48){_0x5d45e6[_0x930f('0x19')](0x194);}return _0xe9cd48;};}function handleError(_0x598ac8,_0x5e4c76){_0x5e4c76=_0x5e4c76||0x1f4;return function(_0x569885){logger[_0x930f('0x27')](_0x569885[_0x930f('0x28')]);if(_0x569885['name']){delete _0x569885[_0x930f('0x29')];}_0x598ac8[_0x930f('0x1a')](_0x5e4c76)[_0x930f('0x2a')](_0x569885);};}function getMustacheRender(_0x4f294a,_0x245301){return Mustache[_0x930f('0x2b')](_0x4f294a,_['merge'](_0x245301[_0x930f('0x2c')],{'contact':_0x245301[_0x930f('0x2d')],'message':_0x245301[_0x930f('0x2e')],'agent':_0x245301['agent'],'interaction':_0x245301['interaction'],'account':_0x245301['account']}))||'';}exports[_0x930f('0x2f')]=function(_0x113561,_0x4b483e){var _0x45df16={},_0xd1e94a={},_0x40d9a1={'count':0x0,'rows':[]};var _0x2d9c56=_['map'](db['CannedAnswer'][_0x930f('0x30')],function(_0x465222){return{'name':_0x465222[_0x930f('0x31')],'type':_0x465222['type'][_0x930f('0x32')]};});_0xd1e94a[_0x930f('0x33')]=_[_0x930f('0x34')](_0x2d9c56,_0x930f('0x29'));_0xd1e94a[_0x930f('0x35')]=_[_0x930f('0x36')](_0x113561[_0x930f('0x35')]);_0xd1e94a[_0x930f('0x37')]=_[_0x930f('0x38')](_0xd1e94a[_0x930f('0x33')],_0xd1e94a[_0x930f('0x35')]);_0x45df16[_0x930f('0x39')]=_['intersection'](_0xd1e94a[_0x930f('0x33')],qs[_0x930f('0x3a')](_0x113561[_0x930f('0x35')][_0x930f('0x3a')]));_0x45df16[_0x930f('0x39')]=_0x45df16[_0x930f('0x39')][_0x930f('0x3b')]?_0x45df16[_0x930f('0x39')]:_0xd1e94a[_0x930f('0x33')];if(!_0x113561[_0x930f('0x35')][_0x930f('0x3c')](_0x930f('0x3d'))){_0x45df16['limit']=qs[_0x930f('0x1f')](_0x113561['query']['limit']);_0x45df16['offset']=qs[_0x930f('0x1e')](_0x113561[_0x930f('0x35')][_0x930f('0x1e')]);}_0x45df16[_0x930f('0x3e')]=qs[_0x930f('0x3f')](_0x113561[_0x930f('0x35')]['sort']);_0x45df16[_0x930f('0x40')]=qs[_0x930f('0x37')](_[_0x930f('0x41')](_0x113561['query'],_0xd1e94a[_0x930f('0x37')]),_0x2d9c56);if(_0x113561[_0x930f('0x35')][_0x930f('0x42')]){_0x45df16['where']=_['merge'](_0x45df16[_0x930f('0x40')],{'$or':[{'key':{'$like':'%'+_0x113561['query']['filter']+'%'}},{'value':{'$like':'%'+_0x113561[_0x930f('0x35')][_0x930f('0x42')]+'%'}}]});}_0x45df16=_[_0x930f('0x43')]({},_0x45df16,_0x113561[_0x930f('0x44')]);var _0x2cfdbe={'where':_0x45df16['where']};return db[_0x930f('0x45')]['count'](_0x2cfdbe)['then'](function(_0x352089){_0x40d9a1[_0x930f('0x1d')]=_0x352089;if(_0x113561['query']['includeAll']){_0x45df16[_0x930f('0x46')]=[{'all':!![]}];}return db[_0x930f('0x45')][_0x930f('0x47')](_0x45df16);})['then'](function(_0x504bcd){_0x40d9a1[_0x930f('0x48')]=_0x504bcd;return _0x40d9a1;})[_0x930f('0x24')](respondWithFilteredResult(_0x4b483e,_0x45df16))['catch'](handleError(_0x4b483e,null));};exports[_0x930f('0x49')]=function(_0x4e8794,_0x4c1853){var _0x4ee32c={'raw':!![],'where':{'id':_0x4e8794[_0x930f('0x4a')]['id']}},_0x38e4c6={};_0x38e4c6[_0x930f('0x33')]=_[_0x930f('0x36')](db[_0x930f('0x45')][_0x930f('0x30')]);_0x38e4c6[_0x930f('0x35')]=_[_0x930f('0x36')](_0x4e8794['query']);_0x38e4c6[_0x930f('0x37')]=_[_0x930f('0x38')](_0x38e4c6[_0x930f('0x33')],_0x38e4c6[_0x930f('0x35')]);_0x4ee32c[_0x930f('0x39')]=_[_0x930f('0x38')](_0x38e4c6[_0x930f('0x33')],qs['fields'](_0x4e8794['query'][_0x930f('0x3a')]));_0x4ee32c['attributes']=_0x4ee32c['attributes'][_0x930f('0x3b')]?_0x4ee32c[_0x930f('0x39')]:_0x38e4c6[_0x930f('0x33')];if(_0x4e8794['query']['includeAll']){_0x4ee32c['include']=[{'all':!![]}];}_0x4ee32c=_[_0x930f('0x43')]({},_0x4ee32c,_0x4e8794[_0x930f('0x44')]);return db['CannedAnswer'][_0x930f('0x4b')](_0x4ee32c)['then'](handleEntityNotFound(_0x4c1853,null))['then'](respondWithResult(_0x4c1853,null))[_0x930f('0x4c')](handleError(_0x4c1853,null));};exports[_0x930f('0x22')]=function(_0x3420c4,_0x284dad){if(_0x3420c4[_0x930f('0x2c')]['id']){delete _0x3420c4[_0x930f('0x2c')]['id'];}return db[_0x930f('0x45')][_0x930f('0x4b')]({'where':{'id':_0x3420c4[_0x930f('0x4a')]['id']}})[_0x930f('0x24')](handleEntityNotFound(_0x284dad,null))[_0x930f('0x24')](saveUpdates(_0x3420c4[_0x930f('0x2c')],null))['then'](respondWithResult(_0x284dad,null))[_0x930f('0x4c')](handleError(_0x284dad,null));};exports[_0x930f('0x23')]=function(_0x360b23,_0x1b9a05){return db[_0x930f('0x45')][_0x930f('0x4b')]({'where':{'id':_0x360b23['params']['id']}})[_0x930f('0x24')](handleEntityNotFound(_0x1b9a05,null))[_0x930f('0x24')](removeEntity(_0x1b9a05,null))[_0x930f('0x4c')](handleError(_0x1b9a05,null));};exports[_0x930f('0x4d')]=function(_0x10593e,_0x7c4486){var _0xff8ce={'key':_0x10593e[_0x930f('0x2c')][_0x930f('0x32')]};if(_0x10593e['body'][_0x930f('0x4e')]){_0xff8ce[_0x930f('0x4e')]=_0x10593e[_0x930f('0x2c')][_0x930f('0x4e')];}else if(_0x10593e[_0x930f('0x2c')]['SmsAccountId']){_0xff8ce[_0x930f('0x4f')]=_0x10593e[_0x930f('0x2c')][_0x930f('0x4f')];}else if(_0x10593e['body']['OpenchannelAccountId']){_0xff8ce[_0x930f('0x50')]=_0x10593e[_0x930f('0x2c')]['OpenchannelAccountId'];}else if(_0x10593e[_0x930f('0x2c')]['ChatWebsiteId']){_0xff8ce[_0x930f('0x51')]=_0x10593e[_0x930f('0x2c')][_0x930f('0x51')];}return db[_0x930f('0x45')][_0x930f('0x4b')]({'where':_0xff8ce})[_0x930f('0x24')](function(_0x1f3b85){if(_0x1f3b85){throw new db[(_0x930f('0x52'))]['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer'][_0x930f('0x4d')](_0x10593e[_0x930f('0x2c')]);})[_0x930f('0x24')](function(_0x4c8e37){var _0x1d2833=_0x10593e[_0x930f('0x53')]['get']({'plain':!![]});if(!_0x1d2833)throw new Error(_0x930f('0x54'));if(_0x1d2833[_0x930f('0x55')]==='user'){var _0x3374eb=_0x4c8e37['get']({'plain':!![]});return db[_0x930f('0x56')]['find']({'where':{'name':_0x930f('0x26'),'userProfileId':_0x1d2833[_0x930f('0x57')]},'raw':!![]})[_0x930f('0x24')](function(_0x191058){if(_0x191058&&_0x191058['autoAssociation']===0x0){return db[_0x930f('0x58')][_0x930f('0x4d')]({'name':_0x3374eb[_0x930f('0x29')],'resourceId':_0x3374eb['id'],'type':_0x191058[_0x930f('0x29')],'sectionId':_0x191058['id']},{})[_0x930f('0x24')](function(){return _0x4c8e37;});}else{return _0x4c8e37;}})[_0x930f('0x4c')](function(_0x15000b){logger[_0x930f('0x27')](_0x930f('0x59'),_0x15000b);throw _0x15000b;});}return _0x4c8e37;})[_0x930f('0x24')](respondWithResult(_0x7c4486,0xc9))[_0x930f('0x4c')](handleError(_0x7c4486,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index e1e7055..58b495f 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 _0x0a62=['bluebird','request-promise','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util','../../config/logger','api','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0a62,0x119));var _0x20a6=function(_0x573592,_0x5ef466){_0x573592=_0x573592-0x0;var _0x411ae5=_0x0a62[_0x573592];return _0x411ae5;};'use strict';var _=require(_0x20a6('0x0'));var util=require(_0x20a6('0x1'));var logger=require(_0x20a6('0x2'))(_0x20a6('0x3'));var moment=require(_0x20a6('0x4'));var BPromise=require(_0x20a6('0x5'));var rp=require(_0x20a6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x20a6('0x7'));var attributes=require(_0x20a6('0x8'));module['exports']=function(_0x5629dd,_0x274d40){return _0x5629dd[_0x20a6('0x9')](_0x20a6('0xa'),attributes,{'tableName':_0x20a6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x20a6('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xd64b=['utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','define','CannedAnswer','tools_canned_answers','utf8mb4'];(function(_0x6bbba3,_0x473e95){var _0x7ce6e1=function(_0x2e1649){while(--_0x2e1649){_0x6bbba3['push'](_0x6bbba3['shift']());}};_0x7ce6e1(++_0x473e95);}(_0xd64b,0xc1));var _0xbd64=function(_0x5b041b,_0x39f3a8){_0x5b041b=_0x5b041b-0x0;var _0x345afd=_0xd64b[_0x5b041b];return _0x345afd;};'use strict';var _=require(_0xbd64('0x0'));var util=require('util');var logger=require(_0xbd64('0x1'))('api');var moment=require(_0xbd64('0x2'));var BPromise=require(_0xbd64('0x3'));var rp=require(_0xbd64('0x4'));var fs=require('fs');var path=require(_0xbd64('0x5'));var rimraf=require(_0xbd64('0x6'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x51e87d,_0x58e9e7){return _0x51e87d[_0xbd64('0x7')](_0xbd64('0x8'),attributes,{'tableName':_0xbd64('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbd64('0xa'),'collate':_0xbd64('0xb')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 72ffd47..7ce6fb1 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 _0xe901=['result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CannedAnswer,\x20%s,\x20%s','message'];(function(_0x2e58f5,_0x44502e){var _0x1fd29d=function(_0x56bd8d){while(--_0x56bd8d){_0x2e58f5['push'](_0x2e58f5['shift']());}};_0x1fd29d(++_0x44502e);}(_0xe901,0xfb));var _0x1e90=function(_0x1c7ac2,_0x295452){_0x1c7ac2=_0x1c7ac2-0x0;var _0xa6128f=_0xe901[_0x1c7ac2];return _0xa6128f;};'use strict';var _=require(_0x1e90('0x0'));var util=require(_0x1e90('0x1'));var moment=require(_0x1e90('0x2'));var BPromise=require(_0x1e90('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e90('0x4'));var db=require(_0x1e90('0x5'))['db'];var utils=require(_0x1e90('0x6'));var logger=require(_0x1e90('0x7'))(_0x1e90('0x8'));var config=require(_0x1e90('0x9'));var jayson=require(_0x1e90('0xa'));var client=jayson[_0x1e90('0xb')][_0x1e90('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x29fae8,_0x4e4307,_0x5cae3f){return new BPromise(function(_0x1c71c5,_0x58c9d8){return client[_0x1e90('0xd')](_0x29fae8,_0x5cae3f)[_0x1e90('0xe')](function(_0x9b004d){logger[_0x1e90('0xf')]('CannedAnswer,\x20%s,\x20%s',_0x4e4307,'request\x20sent');logger[_0x1e90('0x10')](_0x1e90('0x11'),_0x4e4307,_0x1e90('0x12'),JSON[_0x1e90('0x13')](_0x9b004d));if(_0x9b004d[_0x1e90('0x14')]){if(_0x9b004d[_0x1e90('0x14')][_0x1e90('0x15')]===0x1f4){logger[_0x1e90('0x14')](_0x1e90('0x16'),_0x4e4307,_0x9b004d[_0x1e90('0x14')][_0x1e90('0x17')]);return _0x58c9d8(_0x9b004d[_0x1e90('0x14')]['message']);}logger[_0x1e90('0x14')](_0x1e90('0x16'),_0x4e4307,_0x9b004d['error'][_0x1e90('0x17')]);return _0x1c71c5(_0x9b004d[_0x1e90('0x14')][_0x1e90('0x17')]);}else{logger[_0x1e90('0xf')]('CannedAnswer,\x20%s,\x20%s',_0x4e4307,_0x1e90('0x12'));_0x1c71c5(_0x9b004d[_0x1e90('0x18')][_0x1e90('0x17')]);}})['catch'](function(_0xcf3a5f){logger[_0x1e90('0x14')](_0x1e90('0x16'),_0x4e4307,_0xcf3a5f);_0x58c9d8(_0xcf3a5f);});});}
\ No newline at end of file
+var _0x1b17=['rpc','../../config/environment','jayson/promise','http','request','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x24fc50,_0x28e0fe){var _0x8befc3=function(_0x4abc08){while(--_0x4abc08){_0x24fc50['push'](_0x24fc50['shift']());}};_0x8befc3(++_0x28e0fe);}(_0x1b17,0x135));var _0x71b1=function(_0x2d3a4d,_0x47561e){_0x2d3a4d=_0x2d3a4d-0x0;var _0x3a94a3=_0x1b17[_0x2d3a4d];return _0x3a94a3;};'use strict';var _=require(_0x71b1('0x0'));var util=require(_0x71b1('0x1'));var moment=require(_0x71b1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x71b1('0x3'));var db=require(_0x71b1('0x4'))['db'];var utils=require(_0x71b1('0x5'));var logger=require('../../config/logger')(_0x71b1('0x6'));var config=require(_0x71b1('0x7'));var jayson=require(_0x71b1('0x8'));var client=jayson['client'][_0x71b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x318285,_0x3161c7,_0x3c9627){return new BPromise(function(_0x32dc4c,_0x5197b8){return client[_0x71b1('0xa')](_0x318285,_0x3c9627)[_0x71b1('0xb')](function(_0x4b3152){logger[_0x71b1('0xc')](_0x71b1('0xd'),_0x3161c7,_0x71b1('0xe'));logger[_0x71b1('0xf')](_0x71b1('0x10'),_0x3161c7,_0x71b1('0xe'),JSON['stringify'](_0x4b3152));if(_0x4b3152[_0x71b1('0x11')]){if(_0x4b3152[_0x71b1('0x11')][_0x71b1('0x12')]===0x1f4){logger[_0x71b1('0x11')](_0x71b1('0xd'),_0x3161c7,_0x4b3152[_0x71b1('0x11')][_0x71b1('0x13')]);return _0x5197b8(_0x4b3152[_0x71b1('0x11')][_0x71b1('0x13')]);}logger[_0x71b1('0x11')](_0x71b1('0xd'),_0x3161c7,_0x4b3152['error']['message']);return _0x32dc4c(_0x4b3152[_0x71b1('0x11')]['message']);}else{logger[_0x71b1('0xc')](_0x71b1('0xd'),_0x3161c7,_0x71b1('0xe'));_0x32dc4c(_0x4b3152[_0x71b1('0x14')]['message']);}})['catch'](function(_0x4a9c58){logger[_0x71b1('0x11')](_0x71b1('0xd'),_0x3161c7,_0x4a9c58);_0x5197b8(_0x4a9c58);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index bfe0c4c..3f0f8a3 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 _0xa0b8=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','show'];(function(_0x18d659,_0x2e92ad){var _0x36cf24=function(_0x3f708a){while(--_0x3f708a){_0x18d659['push'](_0x18d659['shift']());}};_0x36cf24(++_0x2e92ad);}(_0xa0b8,0x133));var _0x8a0b=function(_0x1263cc,_0x34b0a6){_0x1263cc=_0x1263cc-0x0;var _0x4132a0=_0xa0b8[_0x1263cc];return _0x4132a0;};'use strict';var multer=require(_0x8a0b('0x0'));var util=require('util');var path=require(_0x8a0b('0x1'));var timeout=require(_0x8a0b('0x2'));var express=require(_0x8a0b('0x3'));var router=express[_0x8a0b('0x4')]();var fs_extra=require(_0x8a0b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8a0b('0x6'));var config=require(_0x8a0b('0x7'));var controller=require(_0x8a0b('0x8'));router[_0x8a0b('0x9')]('/',auth[_0x8a0b('0xa')](),controller[_0x8a0b('0xb')]);router[_0x8a0b('0x9')]('/:id',auth[_0x8a0b('0xa')](),controller[_0x8a0b('0xc')]);router[_0x8a0b('0xd')]('/',auth[_0x8a0b('0xa')](),controller[_0x8a0b('0xe')]);router[_0x8a0b('0xf')]('/:id',auth[_0x8a0b('0xa')](),controller[_0x8a0b('0x10')]);router[_0x8a0b('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x8a0b('0x12')]);module[_0x8a0b('0x13')]=router;
\ No newline at end of file
+var _0xaf7d=['get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xaf7d,0x6f));var _0xdaf7=function(_0x41b37f,_0x48a056){_0x41b37f=_0x41b37f-0x0;var _0x22d1c7=_0xaf7d[_0x41b37f];return _0x22d1c7;};'use strict';var multer=require('multer');var util=require(_0xdaf7('0x0'));var path=require(_0xdaf7('0x1'));var timeout=require(_0xdaf7('0x2'));var express=require('express');var router=express[_0xdaf7('0x3')]();var fs_extra=require(_0xdaf7('0x4'));var auth=require(_0xdaf7('0x5'));var interaction=require(_0xdaf7('0x6'));var config=require(_0xdaf7('0x7'));var controller=require(_0xdaf7('0x8'));router[_0xdaf7('0x9')]('/',auth[_0xdaf7('0xa')](),controller[_0xdaf7('0xb')]);router['get'](_0xdaf7('0xc'),auth[_0xdaf7('0xa')](),controller[_0xdaf7('0xd')]);router[_0xdaf7('0xe')]('/',auth[_0xdaf7('0xa')](),controller['create']);router[_0xdaf7('0xf')](_0xdaf7('0xc'),auth[_0xdaf7('0xa')](),controller[_0xdaf7('0x10')]);router[_0xdaf7('0x11')](_0xdaf7('0xc'),auth['isAuthenticated'](),controller[_0xdaf7('0x12')]);module[_0xdaf7('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 16f5597..fabc4cf 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 _0xe99d=['INTEGER','sequelize','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x262548,_0x15dc38){var _0x4d16aa=function(_0x9d5663){while(--_0x9d5663){_0x262548['push'](_0x262548['shift']());}};_0x4d16aa(++_0x15dc38);}(_0xe99d,0x137));var _0xde99=function(_0x5873ea,_0x46ced5){_0x5873ea=_0x5873ea-0x0;var _0x56eb2e=_0xe99d[_0x5873ea];return _0x56eb2e;};'use strict';var Sequelize=require(_0xde99('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xde99('0x1')],'allowNull':![],'defaultValue':_0xde99('0x2')},'clid':{'type':Sequelize[_0xde99('0x3')]},'src':{'type':Sequelize[_0xde99('0x3')]},'dst':{'type':Sequelize[_0xde99('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xde99('0x3')]},'dstchannel':{'type':Sequelize[_0xde99('0x3')]},'lastapp':{'type':Sequelize[_0xde99('0x3')]},'lastdata':{'type':Sequelize[_0xde99('0x3')]},'duration':{'type':Sequelize[_0xde99('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xde99('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xde99('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xde99('0x3')]},'uniqueid':{'type':Sequelize[_0xde99('0x3')]},'linkedid':{'type':Sequelize[_0xde99('0x3')]},'sequence':{'type':Sequelize[_0xde99('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xde99('0x3')]}};
\ No newline at end of file
+var _0x1eaf=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x3eab53,_0x326f8a){var _0x2ab3f3=function(_0x3a56ee){while(--_0x3a56ee){_0x3eab53['push'](_0x3eab53['shift']());}};_0x2ab3f3(++_0x326f8a);}(_0x1eaf,0x71));var _0xf1ea=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x1eaf[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0xf1ea('0x0'));module[_0xf1ea('0x1')]={'calldate':{'type':Sequelize[_0xf1ea('0x2')],'allowNull':![],'defaultValue':_0xf1ea('0x3')},'clid':{'type':Sequelize[_0xf1ea('0x4')]},'src':{'type':Sequelize[_0xf1ea('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xf1ea('0x4')]},'channel':{'type':Sequelize[_0xf1ea('0x4')]},'dstchannel':{'type':Sequelize[_0xf1ea('0x4')]},'lastapp':{'type':Sequelize[_0xf1ea('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xf1ea('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xf1ea('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xf1ea('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xf1ea('0x4')]},'userfield':{'type':Sequelize[_0xf1ea('0x4')]},'uniqueid':{'type':Sequelize[_0xf1ea('0x4')]},'linkedid':{'type':Sequelize[_0xf1ea('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xf1ea('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xf1ea('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 466fada..44deffb 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 _0xae87=['apply','reject','save','update','then','destroy','status','error','stack','name','send','render','body','contact','message','agent','interaction','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','findAll','rows','show','keys','length','include','merge','find','catch','create','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','offset','limit','undefined','count','set','Content-Range','json'];(function(_0x76d804,_0xb92a74){var _0x5b6d51=function(_0x8c378){while(--_0x8c378){_0x76d804['push'](_0x76d804['shift']());}};_0x5b6d51(++_0xb92a74);}(_0xae87,0x12f));var _0x7ae8=function(_0x195c21,_0x332612){_0x195c21=_0x195c21-0x0;var _0x3576a8=_0xae87[_0x195c21];return _0x3576a8;};'use strict';var emlformat=require(_0x7ae8('0x0'));var rimraf=require(_0x7ae8('0x1'));var zipdir=require(_0x7ae8('0x2'));var jsonpatch=require(_0x7ae8('0x3'));var rp=require(_0x7ae8('0x4'));var moment=require('moment');var BPromise=require(_0x7ae8('0x5'));var Mustache=require(_0x7ae8('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7ae8('0x7'));var csv=require('to-csv');var ejs=require(_0x7ae8('0x8'));var fs=require('fs');var fs_extra=require(_0x7ae8('0x9'));var _=require(_0x7ae8('0xa'));var squel=require(_0x7ae8('0xb'));var crypto=require(_0x7ae8('0xc'));var jsforce=require(_0x7ae8('0xd'));var deskjs=require(_0x7ae8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7ae8('0xf'));var Papa=require(_0x7ae8('0x10'));var Redis=require(_0x7ae8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7ae8('0x12'));var as=require(_0x7ae8('0x13'));var hardwareService=require(_0x7ae8('0x14'));var logger=require(_0x7ae8('0x15'))(_0x7ae8('0x16'));var utils=require('../../config/utils');var config=require(_0x7ae8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7ae8('0x18'))['db'];function respondWithStatusCode(_0x4741be,_0xe306fb){_0xe306fb=_0xe306fb||0xcc;return function(_0x568e47){if(_0x568e47){return _0x4741be[_0x7ae8('0x19')](_0xe306fb);}return _0x4741be['status'](_0xe306fb)['end']();};}function respondWithResult(_0x4781e9,_0x2ec124){_0x2ec124=_0x2ec124||0xc8;return function(_0x3ca1e4){if(_0x3ca1e4){return _0x4781e9['status'](_0x2ec124)['json'](_0x3ca1e4);}};}function respondWithFilteredResult(_0x3f2671,_0x5e2d80){return function(_0x1bae45){if(_0x1bae45){var _0x1ec565=typeof _0x5e2d80[_0x7ae8('0x1a')]==='undefined'&&typeof _0x5e2d80[_0x7ae8('0x1b')]===_0x7ae8('0x1c');var _0x101ea6=_0x1bae45[_0x7ae8('0x1d')];var _0x240a5f=_0x1ec565?0x0:_0x5e2d80[_0x7ae8('0x1a')];var _0x209d96=_0x1ec565?_0x1bae45['count']:_0x5e2d80[_0x7ae8('0x1a')]+_0x5e2d80[_0x7ae8('0x1b')];var _0x5d53c2;if(_0x209d96>=_0x101ea6){_0x209d96=_0x101ea6;_0x5d53c2=0xc8;}else{_0x5d53c2=0xce;}_0x3f2671['status'](_0x5d53c2);return _0x3f2671[_0x7ae8('0x1e')](_0x7ae8('0x1f'),_0x240a5f+'-'+_0x209d96+'/'+_0x101ea6)[_0x7ae8('0x20')](_0x1bae45);}return null;};}function patchUpdates(_0x655430){return function(_0x5f3fa8){try{jsonpatch[_0x7ae8('0x21')](_0x5f3fa8,_0x655430,!![]);}catch(_0x3567da){return BPromise[_0x7ae8('0x22')](_0x3567da);}return _0x5f3fa8[_0x7ae8('0x23')]();};}function saveUpdates(_0x3068d4,_0x892d27){return function(_0x1838f3){if(_0x1838f3){return _0x1838f3[_0x7ae8('0x24')](_0x3068d4)[_0x7ae8('0x25')](function(_0x566776){return _0x566776;});}return null;};}function removeEntity(_0xfdbda1,_0x1baf58){return function(_0x1c48e2){if(_0x1c48e2){return _0x1c48e2[_0x7ae8('0x26')]()[_0x7ae8('0x25')](function(){_0xfdbda1[_0x7ae8('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58f980,_0xa7a6b8){return function(_0x38875c){if(!_0x38875c){_0x58f980['sendStatus'](0x194);}return _0x38875c;};}function handleError(_0x2c66a8,_0x2ec92d){_0x2ec92d=_0x2ec92d||0x1f4;return function(_0x5fdfa7){logger[_0x7ae8('0x28')](_0x5fdfa7[_0x7ae8('0x29')]);if(_0x5fdfa7[_0x7ae8('0x2a')]){delete _0x5fdfa7[_0x7ae8('0x2a')];}_0x2c66a8['status'](_0x2ec92d)[_0x7ae8('0x2b')](_0x5fdfa7);};}function getMustacheRender(_0x2a5324,_0x56638e){return Mustache[_0x7ae8('0x2c')](_0x2a5324,_['merge'](_0x56638e[_0x7ae8('0x2d')],{'contact':_0x56638e[_0x7ae8('0x2e')],'message':_0x56638e[_0x7ae8('0x2f')],'agent':_0x56638e[_0x7ae8('0x30')],'interaction':_0x56638e[_0x7ae8('0x31')],'account':_0x56638e['account']}))||'';}exports[_0x7ae8('0x32')]=function(_0x287510,_0x42ccfd){var _0x2cd132={},_0x56bc43={},_0x578e45={'count':0x0,'rows':[]};var _0x1ec581=_[_0x7ae8('0x33')](db[_0x7ae8('0x34')][_0x7ae8('0x35')],function(_0x780967){return{'name':_0x780967[_0x7ae8('0x36')],'type':_0x780967[_0x7ae8('0x37')][_0x7ae8('0x38')]};});_0x56bc43[_0x7ae8('0x39')]=_[_0x7ae8('0x33')](_0x1ec581,_0x7ae8('0x2a'));_0x56bc43['query']=_['keys'](_0x287510[_0x7ae8('0x3a')]);_0x56bc43[_0x7ae8('0x3b')]=_[_0x7ae8('0x3c')](_0x56bc43[_0x7ae8('0x39')],_0x56bc43[_0x7ae8('0x3a')]);_0x2cd132['attributes']=_[_0x7ae8('0x3c')](_0x56bc43[_0x7ae8('0x39')],qs[_0x7ae8('0x3d')](_0x287510['query'][_0x7ae8('0x3d')]));_0x2cd132[_0x7ae8('0x3e')]=_0x2cd132[_0x7ae8('0x3e')]['length']?_0x2cd132[_0x7ae8('0x3e')]:_0x56bc43['model'];if(!_0x287510[_0x7ae8('0x3a')][_0x7ae8('0x3f')](_0x7ae8('0x40'))){_0x2cd132['limit']=qs['limit'](_0x287510[_0x7ae8('0x3a')][_0x7ae8('0x1b')]);_0x2cd132[_0x7ae8('0x1a')]=qs[_0x7ae8('0x1a')](_0x287510[_0x7ae8('0x3a')][_0x7ae8('0x1a')]);}_0x2cd132[_0x7ae8('0x41')]=qs['sort'](_0x287510[_0x7ae8('0x3a')][_0x7ae8('0x42')]);_0x2cd132[_0x7ae8('0x43')]=qs[_0x7ae8('0x3b')](_[_0x7ae8('0x44')](_0x287510[_0x7ae8('0x3a')],_0x56bc43[_0x7ae8('0x3b')]),_0x1ec581);if(_0x287510['query'][_0x7ae8('0x45')]){_0x2cd132[_0x7ae8('0x43')]=_['merge'](_0x2cd132['where'],{'$or':_[_0x7ae8('0x33')](_0x1ec581,function(_0x385efc){if(_0x385efc[_0x7ae8('0x37')]!==_0x7ae8('0x46')){var _0x136088={};_0x136088[_0x385efc[_0x7ae8('0x2a')]]={'$like':'%'+_0x287510[_0x7ae8('0x3a')][_0x7ae8('0x45')]+'%'};return _0x136088;}})});}_0x2cd132=_['merge']({},_0x2cd132,_0x287510['options']);var _0x3f25f6={'where':_0x2cd132[_0x7ae8('0x43')]};return db['Cdr'][_0x7ae8('0x1d')](_0x3f25f6)[_0x7ae8('0x25')](function(_0x342db8){_0x578e45[_0x7ae8('0x1d')]=_0x342db8;if(_0x287510['query'][_0x7ae8('0x47')]){_0x2cd132['include']=[{'all':!![]}];}return db[_0x7ae8('0x34')][_0x7ae8('0x48')](_0x2cd132);})[_0x7ae8('0x25')](function(_0x467724){_0x578e45[_0x7ae8('0x49')]=_0x467724;return _0x578e45;})[_0x7ae8('0x25')](respondWithFilteredResult(_0x42ccfd,_0x2cd132))['catch'](handleError(_0x42ccfd,null));};exports[_0x7ae8('0x4a')]=function(_0x25cc4c,_0x36d790){var _0x4c65f8={'raw':!![],'where':{'id':_0x25cc4c['params']['id']}},_0x13134f={};_0x13134f['model']=_[_0x7ae8('0x4b')](db['Cdr'][_0x7ae8('0x35')]);_0x13134f[_0x7ae8('0x3a')]=_[_0x7ae8('0x4b')](_0x25cc4c[_0x7ae8('0x3a')]);_0x13134f[_0x7ae8('0x3b')]=_[_0x7ae8('0x3c')](_0x13134f[_0x7ae8('0x39')],_0x13134f[_0x7ae8('0x3a')]);_0x4c65f8[_0x7ae8('0x3e')]=_['intersection'](_0x13134f[_0x7ae8('0x39')],qs['fields'](_0x25cc4c[_0x7ae8('0x3a')][_0x7ae8('0x3d')]));_0x4c65f8[_0x7ae8('0x3e')]=_0x4c65f8[_0x7ae8('0x3e')][_0x7ae8('0x4c')]?_0x4c65f8[_0x7ae8('0x3e')]:_0x13134f[_0x7ae8('0x39')];if(_0x25cc4c[_0x7ae8('0x3a')][_0x7ae8('0x47')]){_0x4c65f8[_0x7ae8('0x4d')]=[{'all':!![]}];}_0x4c65f8=_[_0x7ae8('0x4e')]({},_0x4c65f8,_0x25cc4c['options']);return db[_0x7ae8('0x34')][_0x7ae8('0x4f')](_0x4c65f8)[_0x7ae8('0x25')](handleEntityNotFound(_0x36d790,null))[_0x7ae8('0x25')](respondWithResult(_0x36d790,null))[_0x7ae8('0x50')](handleError(_0x36d790,null));};exports[_0x7ae8('0x51')]=function(_0x3f7eab,_0x380443){return db[_0x7ae8('0x34')]['create'](_0x3f7eab['body'],{})[_0x7ae8('0x25')](respondWithResult(_0x380443,0xc9))['catch'](handleError(_0x380443,null));};exports[_0x7ae8('0x24')]=function(_0x33f7f4,_0x276a14){if(_0x33f7f4[_0x7ae8('0x2d')]['id']){delete _0x33f7f4[_0x7ae8('0x2d')]['id'];}return db[_0x7ae8('0x34')][_0x7ae8('0x4f')]({'where':{'id':_0x33f7f4[_0x7ae8('0x52')]['id']}})[_0x7ae8('0x25')](handleEntityNotFound(_0x276a14,null))['then'](saveUpdates(_0x33f7f4['body'],null))['then'](respondWithResult(_0x276a14,null))[_0x7ae8('0x50')](handleError(_0x276a14,null));};exports[_0x7ae8('0x26')]=function(_0x5d5948,_0x3775ce){return db[_0x7ae8('0x34')][_0x7ae8('0x4f')]({'where':{'id':_0x5d5948[_0x7ae8('0x52')]['id']}})[_0x7ae8('0x25')](handleEntityNotFound(_0x3775ce,null))[_0x7ae8('0x25')](removeEntity(_0x3775ce,null))[_0x7ae8('0x50')](handleError(_0x3775ce,null));};exports[_0x7ae8('0x53')]=function(_0x1fd8df,_0xdb7a){return db[_0x7ae8('0x34')][_0x7ae8('0x53')]()[_0x7ae8('0x25')](respondWithResult(_0xdb7a,null))[_0x7ae8('0x50')](handleError(_0xdb7a,null));};
\ No newline at end of file
+var _0x6788=['intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','options','includeAll','include','findAll','catch','params','find','create','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','render','merge','body','contact','message','agent','index','map','Cdr','rawAttributes','type','model','keys','query','filters'];(function(_0x53eba7,_0x38744c){var _0x32491b=function(_0x61ea1d){while(--_0x61ea1d){_0x53eba7['push'](_0x53eba7['shift']());}};_0x32491b(++_0x38744c);}(_0x6788,0x159));var _0x8678=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x6788[_0x3070dc];return _0x431489;};'use strict';var emlformat=require(_0x8678('0x0'));var rimraf=require(_0x8678('0x1'));var zipdir=require(_0x8678('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8678('0x3'));var BPromise=require(_0x8678('0x4'));var Mustache=require(_0x8678('0x5'));var util=require(_0x8678('0x6'));var path=require(_0x8678('0x7'));var sox=require('sox');var csv=require(_0x8678('0x8'));var ejs=require(_0x8678('0x9'));var fs=require('fs');var fs_extra=require(_0x8678('0xa'));var _=require(_0x8678('0xb'));var squel=require(_0x8678('0xc'));var crypto=require(_0x8678('0xd'));var jsforce=require(_0x8678('0xe'));var deskjs=require(_0x8678('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8678('0x10'));var Papa=require(_0x8678('0x11'));var Redis=require(_0x8678('0x12'));var authService=require(_0x8678('0x13'));var qs=require(_0x8678('0x14'));var as=require(_0x8678('0x15'));var hardwareService=require(_0x8678('0x16'));var logger=require(_0x8678('0x17'))(_0x8678('0x18'));var utils=require(_0x8678('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x8678('0x1a'));var db=require(_0x8678('0x1b'))['db'];function respondWithStatusCode(_0x3f10b4,_0x92bddc){_0x92bddc=_0x92bddc||0xcc;return function(_0x4d508a){if(_0x4d508a){return _0x3f10b4[_0x8678('0x1c')](_0x92bddc);}return _0x3f10b4[_0x8678('0x1d')](_0x92bddc)[_0x8678('0x1e')]();};}function respondWithResult(_0x5564ba,_0x1b7873){_0x1b7873=_0x1b7873||0xc8;return function(_0x8937b8){if(_0x8937b8){return _0x5564ba['status'](_0x1b7873)[_0x8678('0x1f')](_0x8937b8);}};}function respondWithFilteredResult(_0x1e83ad,_0x498472){return function(_0x4fa7e6){if(_0x4fa7e6){var _0x5df838=typeof _0x498472[_0x8678('0x20')]===_0x8678('0x21')&&typeof _0x498472['limit']===_0x8678('0x21');var _0x3623cb=_0x4fa7e6[_0x8678('0x22')];var _0x486c55=_0x5df838?0x0:_0x498472[_0x8678('0x20')];var _0x24ccf8=_0x5df838?_0x4fa7e6[_0x8678('0x22')]:_0x498472[_0x8678('0x20')]+_0x498472['limit'];var _0x5a61a8;if(_0x24ccf8>=_0x3623cb){_0x24ccf8=_0x3623cb;_0x5a61a8=0xc8;}else{_0x5a61a8=0xce;}_0x1e83ad[_0x8678('0x1d')](_0x5a61a8);return _0x1e83ad['set'](_0x8678('0x23'),_0x486c55+'-'+_0x24ccf8+'/'+_0x3623cb)['json'](_0x4fa7e6);}return null;};}function patchUpdates(_0x373149){return function(_0xdf7ef0){try{jsonpatch[_0x8678('0x24')](_0xdf7ef0,_0x373149,!![]);}catch(_0x297cad){return BPromise['reject'](_0x297cad);}return _0xdf7ef0[_0x8678('0x25')]();};}function saveUpdates(_0x4b3781,_0x2c047f){return function(_0x5e10ae){if(_0x5e10ae){return _0x5e10ae[_0x8678('0x26')](_0x4b3781)[_0x8678('0x27')](function(_0x14816a){return _0x14816a;});}return null;};}function removeEntity(_0x462f59,_0xaaddf2){return function(_0x2277cc){if(_0x2277cc){return _0x2277cc[_0x8678('0x28')]()['then'](function(){_0x462f59['status'](0xcc)[_0x8678('0x1e')]();});}};}function handleEntityNotFound(_0x1ff658,_0x3bf041){return function(_0x34587d){if(!_0x34587d){_0x1ff658[_0x8678('0x1c')](0x194);}return _0x34587d;};}function handleError(_0x2c0fc2,_0xc9e36e){_0xc9e36e=_0xc9e36e||0x1f4;return function(_0x2fbeec){logger[_0x8678('0x29')](_0x2fbeec[_0x8678('0x2a')]);if(_0x2fbeec[_0x8678('0x2b')]){delete _0x2fbeec['name'];}_0x2c0fc2[_0x8678('0x1d')](_0xc9e36e)[_0x8678('0x2c')](_0x2fbeec);};}function getMustacheRender(_0x745507,_0x587241){return Mustache[_0x8678('0x2d')](_0x745507,_[_0x8678('0x2e')](_0x587241[_0x8678('0x2f')],{'contact':_0x587241[_0x8678('0x30')],'message':_0x587241[_0x8678('0x31')],'agent':_0x587241[_0x8678('0x32')],'interaction':_0x587241['interaction'],'account':_0x587241['account']}))||'';}exports[_0x8678('0x33')]=function(_0x5d7a54,_0x3c0b63){var _0x5b00c3={},_0xf05d06={},_0x466edf={'count':0x0,'rows':[]};var _0x2fbec0=_[_0x8678('0x34')](db[_0x8678('0x35')][_0x8678('0x36')],function(_0x5b6f8e){return{'name':_0x5b6f8e['fieldName'],'type':_0x5b6f8e[_0x8678('0x37')]['key']};});_0xf05d06[_0x8678('0x38')]=_[_0x8678('0x34')](_0x2fbec0,_0x8678('0x2b'));_0xf05d06['query']=_[_0x8678('0x39')](_0x5d7a54[_0x8678('0x3a')]);_0xf05d06[_0x8678('0x3b')]=_[_0x8678('0x3c')](_0xf05d06[_0x8678('0x38')],_0xf05d06[_0x8678('0x3a')]);_0x5b00c3['attributes']=_[_0x8678('0x3c')](_0xf05d06[_0x8678('0x38')],qs[_0x8678('0x3d')](_0x5d7a54[_0x8678('0x3a')][_0x8678('0x3d')]));_0x5b00c3[_0x8678('0x3e')]=_0x5b00c3['attributes'][_0x8678('0x3f')]?_0x5b00c3[_0x8678('0x3e')]:_0xf05d06[_0x8678('0x38')];if(!_0x5d7a54[_0x8678('0x3a')][_0x8678('0x40')](_0x8678('0x41'))){_0x5b00c3['limit']=qs[_0x8678('0x42')](_0x5d7a54[_0x8678('0x3a')][_0x8678('0x42')]);_0x5b00c3[_0x8678('0x20')]=qs[_0x8678('0x20')](_0x5d7a54[_0x8678('0x3a')][_0x8678('0x20')]);}_0x5b00c3[_0x8678('0x43')]=qs[_0x8678('0x44')](_0x5d7a54['query'][_0x8678('0x44')]);_0x5b00c3['where']=qs[_0x8678('0x3b')](_[_0x8678('0x45')](_0x5d7a54[_0x8678('0x3a')],_0xf05d06[_0x8678('0x3b')]),_0x2fbec0);if(_0x5d7a54[_0x8678('0x3a')][_0x8678('0x46')]){_0x5b00c3[_0x8678('0x47')]=_[_0x8678('0x2e')](_0x5b00c3['where'],{'$or':_[_0x8678('0x34')](_0x2fbec0,function(_0x10667e){if(_0x10667e[_0x8678('0x37')]!=='VIRTUAL'){var _0x109613={};_0x109613[_0x10667e[_0x8678('0x2b')]]={'$like':'%'+_0x5d7a54[_0x8678('0x3a')]['filter']+'%'};return _0x109613;}})});}_0x5b00c3=_['merge']({},_0x5b00c3,_0x5d7a54[_0x8678('0x48')]);var _0x32bd16={'where':_0x5b00c3[_0x8678('0x47')]};return db['Cdr'][_0x8678('0x22')](_0x32bd16)[_0x8678('0x27')](function(_0x58c60d){_0x466edf[_0x8678('0x22')]=_0x58c60d;if(_0x5d7a54[_0x8678('0x3a')][_0x8678('0x49')]){_0x5b00c3[_0x8678('0x4a')]=[{'all':!![]}];}return db[_0x8678('0x35')][_0x8678('0x4b')](_0x5b00c3);})['then'](function(_0x3023ae){_0x466edf['rows']=_0x3023ae;return _0x466edf;})['then'](respondWithFilteredResult(_0x3c0b63,_0x5b00c3))[_0x8678('0x4c')](handleError(_0x3c0b63,null));};exports['show']=function(_0xd5cd81,_0x48487c){var _0xa467d3={'raw':!![],'where':{'id':_0xd5cd81[_0x8678('0x4d')]['id']}},_0x38b459={};_0x38b459[_0x8678('0x38')]=_[_0x8678('0x39')](db[_0x8678('0x35')][_0x8678('0x36')]);_0x38b459[_0x8678('0x3a')]=_[_0x8678('0x39')](_0xd5cd81[_0x8678('0x3a')]);_0x38b459[_0x8678('0x3b')]=_[_0x8678('0x3c')](_0x38b459[_0x8678('0x38')],_0x38b459[_0x8678('0x3a')]);_0xa467d3[_0x8678('0x3e')]=_[_0x8678('0x3c')](_0x38b459['model'],qs[_0x8678('0x3d')](_0xd5cd81[_0x8678('0x3a')][_0x8678('0x3d')]));_0xa467d3['attributes']=_0xa467d3['attributes'][_0x8678('0x3f')]?_0xa467d3[_0x8678('0x3e')]:_0x38b459[_0x8678('0x38')];if(_0xd5cd81['query'][_0x8678('0x49')]){_0xa467d3[_0x8678('0x4a')]=[{'all':!![]}];}_0xa467d3=_[_0x8678('0x2e')]({},_0xa467d3,_0xd5cd81['options']);return db['Cdr'][_0x8678('0x4e')](_0xa467d3)[_0x8678('0x27')](handleEntityNotFound(_0x48487c,null))[_0x8678('0x27')](respondWithResult(_0x48487c,null))[_0x8678('0x4c')](handleError(_0x48487c,null));};exports[_0x8678('0x4f')]=function(_0x16fe50,_0xa9d254){return db['Cdr'][_0x8678('0x4f')](_0x16fe50[_0x8678('0x2f')],{})['then'](respondWithResult(_0xa9d254,0xc9))[_0x8678('0x4c')](handleError(_0xa9d254,null));};exports[_0x8678('0x26')]=function(_0x37d37a,_0xf974a3){if(_0x37d37a[_0x8678('0x2f')]['id']){delete _0x37d37a[_0x8678('0x2f')]['id'];}return db['Cdr'][_0x8678('0x4e')]({'where':{'id':_0x37d37a[_0x8678('0x4d')]['id']}})[_0x8678('0x27')](handleEntityNotFound(_0xf974a3,null))['then'](saveUpdates(_0x37d37a[_0x8678('0x2f')],null))[_0x8678('0x27')](respondWithResult(_0xf974a3,null))[_0x8678('0x4c')](handleError(_0xf974a3,null));};exports[_0x8678('0x28')]=function(_0x4ab835,_0x5ed278){return db[_0x8678('0x35')]['find']({'where':{'id':_0x4ab835['params']['id']}})[_0x8678('0x27')](handleEntityNotFound(_0x5ed278,null))[_0x8678('0x27')](removeEntity(_0x5ed278,null))[_0x8678('0x4c')](handleError(_0x5ed278,null));};exports[_0x8678('0x50')]=function(_0x2e1c66,_0xe95133){return db['Cdr']['describe']()[_0x8678('0x27')](respondWithResult(_0xe95133,null))[_0x8678('0x4c')](handleError(_0xe95133,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index f631f18..18be60f 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 _0xe3da=['accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cdr.attributes','exports','define','Cdr'];(function(_0x251849,_0x361f8c){var _0xa344ab=function(_0x5a03b8){while(--_0x5a03b8){_0x251849['push'](_0x251849['shift']());}};_0xa344ab(++_0x361f8c);}(_0xe3da,0x1cd));var _0xae3d=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe3da[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var logger=require(_0xae3d('0x2'))(_0xae3d('0x3'));var moment=require(_0xae3d('0x4'));var BPromise=require(_0xae3d('0x5'));var rp=require(_0xae3d('0x6'));var fs=require('fs');var path=require(_0xae3d('0x7'));var rimraf=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var attributes=require(_0xae3d('0xa'));module[_0xae3d('0xb')]=function(_0xa9a1a,_0xa54808){return _0xa9a1a[_0xae3d('0xc')](_0xae3d('0xd'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0xae3d('0xe'),'fields':[_0xae3d('0xe')]},{'name':'calldate','fields':['calldate']},{'name':_0xae3d('0xf'),'fields':[_0xae3d('0xf')]},{'name':_0xae3d('0x10'),'fields':[_0xae3d('0x10')]},{'name':_0xae3d('0x11'),'fields':[_0xae3d('0x11')]},{'name':'uniqueid','fields':[_0xae3d('0x12')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x53ec=['path','../../config/environment','./cdr.attributes','define','Cdr','accountcode','calldate','disposition','dst','src','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x53ec,0x192));var _0xc53e=function(_0x9f295b,_0x5d274d){_0x9f295b=_0x9f295b-0x0;var _0x36d06d=_0x53ec[_0x9f295b];return _0x36d06d;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]},{'name':_0xc53e('0xc'),'fields':[_0xc53e('0xc')]},{'name':_0xc53e('0xd'),'fields':[_0xc53e('0xd')]},{'name':_0xc53e('0xe'),'fields':[_0xc53e('0xe')]},{'name':_0xc53e('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0xc53e('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 830dee6..f4c6685 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 _0x8582=['http','request','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x8582,0xdf));var _0x2858=function(_0x410ab3,_0x3383ce){_0x410ab3=_0x410ab3-0x0;var _0x35a97a=_0x8582[_0x410ab3];return _0x35a97a;};'use strict';var _=require(_0x2858('0x0'));var util=require(_0x2858('0x1'));var moment=require('moment');var BPromise=require(_0x2858('0x2'));var rs=require(_0x2858('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2858('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2858('0x5'));var jayson=require(_0x2858('0x6'));var client=jayson[_0x2858('0x7')][_0x2858('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x6d97fa,_0x2c6a84,_0x53bd97){return new BPromise(function(_0x43e91c,_0x5f3065){return client[_0x2858('0x9')](_0x6d97fa,_0x53bd97)[_0x2858('0xa')](function(_0x58374f){logger[_0x2858('0xb')](_0x2858('0xc'),_0x2c6a84,'request\x20sent');logger[_0x2858('0xd')](_0x2858('0xe'),_0x2c6a84,_0x2858('0xf'),JSON[_0x2858('0x10')](_0x58374f));if(_0x58374f[_0x2858('0x11')]){if(_0x58374f[_0x2858('0x11')]['code']===0x1f4){logger[_0x2858('0x11')](_0x2858('0xc'),_0x2c6a84,_0x58374f[_0x2858('0x11')][_0x2858('0x12')]);return _0x5f3065(_0x58374f[_0x2858('0x11')][_0x2858('0x12')]);}logger[_0x2858('0x11')]('Cdr,\x20%s,\x20%s',_0x2c6a84,_0x58374f[_0x2858('0x11')][_0x2858('0x12')]);return _0x43e91c(_0x58374f[_0x2858('0x11')]['message']);}else{logger[_0x2858('0xb')]('Cdr,\x20%s,\x20%s',_0x2c6a84,_0x2858('0xf'));_0x43e91c(_0x58374f[_0x2858('0x13')][_0x2858('0x12')]);}})[_0x2858('0x14')](function(_0x360ccb){logger[_0x2858('0x11')]('Cdr,\x20%s,\x20%s',_0x2c6a84,_0x360ccb);_0x5f3065(_0x360ccb);});});}
\ No newline at end of file
+var _0x2d45=['jayson/promise','client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','Cdr,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x50d536,_0x41a698){var _0x20dbe7=function(_0x1e5e3a){while(--_0x1e5e3a){_0x50d536['push'](_0x50d536['shift']());}};_0x20dbe7(++_0x41a698);}(_0x2d45,0x109));var _0x52d4=function(_0x49143f,_0x5592de){_0x49143f=_0x49143f-0x0;var _0x181d27=_0x2d45[_0x49143f];return _0x181d27;};'use strict';var _=require(_0x52d4('0x0'));var util=require(_0x52d4('0x1'));var moment=require(_0x52d4('0x2'));var BPromise=require('bluebird');var rs=require(_0x52d4('0x3'));var fs=require('fs');var Redis=require(_0x52d4('0x4'));var db=require(_0x52d4('0x5'))['db'];var utils=require(_0x52d4('0x6'));var logger=require(_0x52d4('0x7'))(_0x52d4('0x8'));var config=require(_0x52d4('0x9'));var jayson=require(_0x52d4('0xa'));var client=jayson[_0x52d4('0xb')][_0x52d4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ddfea,_0x2a43d1,_0x230e6b){return new BPromise(function(_0x3677d0,_0x5480ff){return client[_0x52d4('0xd')](_0x4ddfea,_0x230e6b)[_0x52d4('0xe')](function(_0x4b6247){logger[_0x52d4('0xf')]('Cdr,\x20%s,\x20%s',_0x2a43d1,_0x52d4('0x10'));logger[_0x52d4('0x11')](_0x52d4('0x12'),_0x2a43d1,_0x52d4('0x10'),JSON[_0x52d4('0x13')](_0x4b6247));if(_0x4b6247[_0x52d4('0x14')]){if(_0x4b6247[_0x52d4('0x14')]['code']===0x1f4){logger[_0x52d4('0x14')]('Cdr,\x20%s,\x20%s',_0x2a43d1,_0x4b6247['error'][_0x52d4('0x15')]);return _0x5480ff(_0x4b6247[_0x52d4('0x14')][_0x52d4('0x15')]);}logger[_0x52d4('0x14')](_0x52d4('0x16'),_0x2a43d1,_0x4b6247[_0x52d4('0x14')][_0x52d4('0x15')]);return _0x3677d0(_0x4b6247['error'][_0x52d4('0x15')]);}else{logger[_0x52d4('0xf')](_0x52d4('0x16'),_0x2a43d1,_0x52d4('0x10'));_0x3677d0(_0x4b6247[_0x52d4('0x17')]['message']);}})[_0x52d4('0x18')](function(_0x3c4809){logger[_0x52d4('0x14')](_0x52d4('0x16'),_0x2a43d1,_0x3c4809);_0x5480ff(_0x3c4809);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index c987412..3e3f10c 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 _0x0713=['fs-extra','../../components/interaction/service','../../config/environment','./cdr.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','multer','util','path','connect-timeout','express'];(function(_0x272d58,_0x316e2d){var _0x11b242=function(_0x1dc812){while(--_0x1dc812){_0x272d58['push'](_0x272d58['shift']());}};_0x11b242(++_0x316e2d);}(_0x0713,0x18a));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3071('0x0'));var util=require(_0x3071('0x1'));var path=require(_0x3071('0x2'));var timeout=require(_0x3071('0x3'));var express=require(_0x3071('0x4'));var router=express['Router']();var fs_extra=require(_0x3071('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x6'));var config=require(_0x3071('0x7'));var controller=require(_0x3071('0x8'));router[_0x3071('0x9')]('/',auth[_0x3071('0xa')](),controller[_0x3071('0xb')]);router[_0x3071('0x9')](_0x3071('0xc'),auth['isAuthenticated'](),controller[_0x3071('0xd')]);router[_0x3071('0x9')]('/:id',auth[_0x3071('0xa')](),controller[_0x3071('0xe')]);router[_0x3071('0xf')]('/',auth['isAuthenticated'](),controller[_0x3071('0x10')]);router[_0x3071('0x11')](_0x3071('0x12'),auth['isAuthenticated'](),controller[_0x3071('0x13')]);router[_0x3071('0x14')]('/:id',auth[_0x3071('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x0c52=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cdr.controller','isAuthenticated','index','get','/describe','/:id','show','create','update','delete','destroy','exports'];(function(_0xd4fa88,_0x3f68bf){var _0x1ad003=function(_0x1b77d2){while(--_0x1b77d2){_0xd4fa88['push'](_0xd4fa88['shift']());}};_0x1ad003(++_0x3f68bf);}(_0x0c52,0x1a9));var _0x20c5=function(_0xf5723c,_0x1fbca0){_0xf5723c=_0xf5723c-0x0;var _0x3aa21b=_0x0c52[_0xf5723c];return _0x3aa21b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x20c5('0x0'));var express=require('express');var router=express[_0x20c5('0x1')]();var fs_extra=require(_0x20c5('0x2'));var auth=require(_0x20c5('0x3'));var interaction=require(_0x20c5('0x4'));var config=require('../../config/environment');var controller=require(_0x20c5('0x5'));router['get']('/',auth[_0x20c5('0x6')](),controller[_0x20c5('0x7')]);router[_0x20c5('0x8')](_0x20c5('0x9'),auth[_0x20c5('0x6')](),controller['describe']);router[_0x20c5('0x8')](_0x20c5('0xa'),auth[_0x20c5('0x6')](),controller[_0x20c5('0xb')]);router['post']('/',auth[_0x20c5('0x6')](),controller[_0x20c5('0xc')]);router['put'](_0x20c5('0xa'),auth[_0x20c5('0x6')](),controller[_0x20c5('0xd')]);router[_0x20c5('0xe')]('/:id',auth[_0x20c5('0x6')](),controller[_0x20c5('0xf')]);module[_0x20c5('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 21b3069..094498c 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 _0x34dc=['INTEGER','STRING','noop','TEXT','sequelize','exports'];(function(_0x4bf2d0,_0x4a78f2){var _0x32c4cd=function(_0x2b2681){while(--_0x2b2681){_0x4bf2d0['push'](_0x4bf2d0['shift']());}};_0x32c4cd(++_0x4a78f2);}(_0x34dc,0x124));var _0xc34d=function(_0x339c99,_0x2ff3af){_0x339c99=_0x339c99-0x0;var _0x4a792a=_0x34dc[_0x339c99];return _0x4a792a;};'use strict';var Sequelize=require(_0xc34d('0x0'));module[_0xc34d('0x1')]={'priority':{'type':Sequelize[_0xc34d('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xc34d('0x3')],'allowNull':![],'defaultValue':_0xc34d('0x4')},'appdata':{'type':Sequelize[_0xc34d('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xc34d('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xebf2=['*,*,*,*','sequelize','INTEGER','STRING','TEXT'];(function(_0x263c89,_0x93938d){var _0x38f0a4=function(_0x142b81){while(--_0x142b81){_0x263c89['push'](_0x263c89['shift']());}};_0x38f0a4(++_0x93938d);}(_0xebf2,0x164));var _0x2ebf=function(_0x2ef4f2,_0x16c954){_0x2ef4f2=_0x2ef4f2-0x0;var _0x1dc37f=_0xebf2[_0x2ef4f2];return _0x1dc37f;};'use strict';var Sequelize=require(_0x2ebf('0x0'));module['exports']={'priority':{'type':Sequelize[_0x2ebf('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x2ebf('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2ebf('0x3')]()},'description':{'type':Sequelize[_0x2ebf('0x2')]},'interval':{'type':Sequelize[_0x2ebf('0x2')],'defaultValue':_0x2ebf('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index ed75f2d..c9fdd1a 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 _0x87f1=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','destroy','then','sendStatus','error','stack','name','merge','body','contact','message','agent','account','show','keys','ChatApplication','query','filters','intersection','model','attributes','fields','includeAll','include','options','catch','find','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra'];(function(_0x14c3f5,_0x5093fc){var _0x3699b1=function(_0x230ebe){while(--_0x230ebe){_0x14c3f5['push'](_0x14c3f5['shift']());}};_0x3699b1(++_0x5093fc);}(_0x87f1,0x170));var _0x187f=function(_0x287986,_0x2c9f58){_0x287986=_0x287986-0x0;var _0x3e9532=_0x87f1[_0x287986];return _0x3e9532;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x187f('0x0'));var zipdir=require(_0x187f('0x1'));var jsonpatch=require(_0x187f('0x2'));var rp=require(_0x187f('0x3'));var moment=require(_0x187f('0x4'));var BPromise=require(_0x187f('0x5'));var Mustache=require(_0x187f('0x6'));var util=require('util');var path=require(_0x187f('0x7'));var sox=require('sox');var csv=require(_0x187f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x187f('0x9'));var _=require('lodash');var squel=require(_0x187f('0xa'));var crypto=require(_0x187f('0xb'));var jsforce=require(_0x187f('0xc'));var deskjs=require(_0x187f('0xd'));var toCsv=require(_0x187f('0x8'));var querystring=require(_0x187f('0xe'));var Papa=require('papaparse');var Redis=require(_0x187f('0xf'));var authService=require(_0x187f('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x187f('0x11'));var logger=require(_0x187f('0x12'))(_0x187f('0x13'));var utils=require(_0x187f('0x14'));var config=require(_0x187f('0x15'));var licenseUtil=require(_0x187f('0x16'));var db=require(_0x187f('0x17'))['db'];function respondWithStatusCode(_0x1298f5,_0x7f7067){_0x7f7067=_0x7f7067||0xcc;return function(_0x83b3a0){if(_0x83b3a0){return _0x1298f5['sendStatus'](_0x7f7067);}return _0x1298f5['status'](_0x7f7067)[_0x187f('0x18')]();};}function respondWithResult(_0x176fae,_0x4683fd){_0x4683fd=_0x4683fd||0xc8;return function(_0x2eee87){if(_0x2eee87){return _0x176fae[_0x187f('0x19')](_0x4683fd)[_0x187f('0x1a')](_0x2eee87);}};}function respondWithFilteredResult(_0xf3600,_0x557047){return function(_0x11c254){if(_0x11c254){var _0x4e232d=typeof _0x557047['offset']===_0x187f('0x1b')&&typeof _0x557047[_0x187f('0x1c')]==='undefined';var _0x1d30e8=_0x11c254['count'];var _0x50e6cc=_0x4e232d?0x0:_0x557047[_0x187f('0x1d')];var _0x195931=_0x4e232d?_0x11c254[_0x187f('0x1e')]:_0x557047[_0x187f('0x1d')]+_0x557047['limit'];var _0x5ecdc0;if(_0x195931>=_0x1d30e8){_0x195931=_0x1d30e8;_0x5ecdc0=0xc8;}else{_0x5ecdc0=0xce;}_0xf3600[_0x187f('0x19')](_0x5ecdc0);return _0xf3600[_0x187f('0x1f')](_0x187f('0x20'),_0x50e6cc+'-'+_0x195931+'/'+_0x1d30e8)['json'](_0x11c254);}return null;};}function patchUpdates(_0x546c4c){return function(_0x503101){try{jsonpatch[_0x187f('0x21')](_0x503101,_0x546c4c,!![]);}catch(_0x39d34d){return BPromise['reject'](_0x39d34d);}return _0x503101[_0x187f('0x22')]();};}function saveUpdates(_0xbc434c,_0x354453){return function(_0x4e069b){if(_0x4e069b){return _0x4e069b[_0x187f('0x23')](_0xbc434c)['then'](function(_0x123afe){return _0x123afe;});}return null;};}function removeEntity(_0x1ed126,_0x2a8299){return function(_0x48730e){if(_0x48730e){return _0x48730e[_0x187f('0x24')]()[_0x187f('0x25')](function(){_0x1ed126[_0x187f('0x19')](0xcc)[_0x187f('0x18')]();});}};}function handleEntityNotFound(_0x2b0e76,_0x5d036c){return function(_0x5a3426){if(!_0x5a3426){_0x2b0e76[_0x187f('0x26')](0x194);}return _0x5a3426;};}function handleError(_0x1a58eb,_0x388a58){_0x388a58=_0x388a58||0x1f4;return function(_0x372080){logger[_0x187f('0x27')](_0x372080[_0x187f('0x28')]);if(_0x372080[_0x187f('0x29')]){delete _0x372080[_0x187f('0x29')];}_0x1a58eb[_0x187f('0x19')](_0x388a58)['send'](_0x372080);};}function getMustacheRender(_0x17b3c3,_0x3ad607){return Mustache['render'](_0x17b3c3,_[_0x187f('0x2a')](_0x3ad607[_0x187f('0x2b')],{'contact':_0x3ad607[_0x187f('0x2c')],'message':_0x3ad607[_0x187f('0x2d')],'agent':_0x3ad607[_0x187f('0x2e')],'interaction':_0x3ad607['interaction'],'account':_0x3ad607[_0x187f('0x2f')]}))||'';}exports[_0x187f('0x30')]=function(_0x4943ed,_0x1feac4){var _0x3b48e9={'raw':!![],'where':{'id':_0x4943ed['params']['id']}},_0x38283f={};_0x38283f['model']=_[_0x187f('0x31')](db[_0x187f('0x32')]['rawAttributes']);_0x38283f['query']=_[_0x187f('0x31')](_0x4943ed[_0x187f('0x33')]);_0x38283f[_0x187f('0x34')]=_[_0x187f('0x35')](_0x38283f[_0x187f('0x36')],_0x38283f[_0x187f('0x33')]);_0x3b48e9[_0x187f('0x37')]=_[_0x187f('0x35')](_0x38283f[_0x187f('0x36')],qs[_0x187f('0x38')](_0x4943ed[_0x187f('0x33')][_0x187f('0x38')]));_0x3b48e9[_0x187f('0x37')]=_0x3b48e9[_0x187f('0x37')]['length']?_0x3b48e9['attributes']:_0x38283f[_0x187f('0x36')];if(_0x4943ed[_0x187f('0x33')][_0x187f('0x39')]){_0x3b48e9[_0x187f('0x3a')]=[{'all':!![]}];}_0x3b48e9=_[_0x187f('0x2a')]({},_0x3b48e9,_0x4943ed[_0x187f('0x3b')]);return db[_0x187f('0x32')]['find'](_0x3b48e9)['then'](handleEntityNotFound(_0x1feac4,null))[_0x187f('0x25')](respondWithResult(_0x1feac4,null))[_0x187f('0x3c')](handleError(_0x1feac4,null));};exports['update']=function(_0x3dbc78,_0xd8caa9){if(_0x3dbc78['body']['id']){delete _0x3dbc78[_0x187f('0x2b')]['id'];}return db[_0x187f('0x32')][_0x187f('0x3d')]({'where':{'id':_0x3dbc78[_0x187f('0x3e')]['id']}})[_0x187f('0x25')](handleEntityNotFound(_0xd8caa9,null))[_0x187f('0x25')](saveUpdates(_0x3dbc78[_0x187f('0x2b')],null))['then'](respondWithResult(_0xd8caa9,null))[_0x187f('0x3c')](handleError(_0xd8caa9,null));};exports[_0x187f('0x24')]=function(_0x3ae718,_0x48af52){return db[_0x187f('0x32')][_0x187f('0x3d')]({'where':{'id':_0x3ae718[_0x187f('0x3e')]['id']}})[_0x187f('0x25')](handleEntityNotFound(_0x48af52,null))['then'](removeEntity(_0x48af52,null))[_0x187f('0x3c')](handleError(_0x48af52,null));};
\ No newline at end of file
+var _0xbd0e=['then','end','stack','name','send','body','contact','message','show','params','model','keys','rawAttributes','query','filters','intersection','fields','attributes','includeAll','include','merge','options','ChatApplication','find','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy'];(function(_0x52062b,_0x4c8d6c){var _0x16b303=function(_0x105277){while(--_0x105277){_0x52062b['push'](_0x52062b['shift']());}};_0x16b303(++_0x4c8d6c);}(_0xbd0e,0x187));var _0xebd0=function(_0x2e2857,_0x2c8066){_0x2e2857=_0x2e2857-0x0;var _0x294569=_0xbd0e[_0x2e2857];return _0x294569;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xebd0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xebd0('0x1'));var rp=require(_0xebd0('0x2'));var moment=require(_0xebd0('0x3'));var BPromise=require(_0xebd0('0x4'));var Mustache=require(_0xebd0('0x5'));var util=require(_0xebd0('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xebd0('0x7'));var ejs=require(_0xebd0('0x8'));var fs=require('fs');var fs_extra=require(_0xebd0('0x9'));var _=require(_0xebd0('0xa'));var squel=require(_0xebd0('0xb'));var crypto=require(_0xebd0('0xc'));var jsforce=require(_0xebd0('0xd'));var deskjs=require(_0xebd0('0xe'));var toCsv=require(_0xebd0('0x7'));var querystring=require('querystring');var Papa=require(_0xebd0('0xf'));var Redis=require(_0xebd0('0x10'));var authService=require(_0xebd0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xebd0('0x12'));var hardwareService=require(_0xebd0('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xebd0('0x14'));var config=require(_0xebd0('0x15'));var licenseUtil=require(_0xebd0('0x16'));var db=require(_0xebd0('0x17'))['db'];function respondWithStatusCode(_0xfbd0b7,_0x562df3){_0x562df3=_0x562df3||0xcc;return function(_0x464387){if(_0x464387){return _0xfbd0b7[_0xebd0('0x18')](_0x562df3);}return _0xfbd0b7[_0xebd0('0x19')](_0x562df3)['end']();};}function respondWithResult(_0x298300,_0x22c014){_0x22c014=_0x22c014||0xc8;return function(_0x3ad9ac){if(_0x3ad9ac){return _0x298300[_0xebd0('0x19')](_0x22c014)[_0xebd0('0x1a')](_0x3ad9ac);}};}function respondWithFilteredResult(_0x406cff,_0x2bf066){return function(_0x44822c){if(_0x44822c){var _0x25097c=typeof _0x2bf066[_0xebd0('0x1b')]===_0xebd0('0x1c')&&typeof _0x2bf066[_0xebd0('0x1d')]===_0xebd0('0x1c');var _0x20244d=_0x44822c[_0xebd0('0x1e')];var _0x4791b2=_0x25097c?0x0:_0x2bf066[_0xebd0('0x1b')];var _0x40b14d=_0x25097c?_0x44822c[_0xebd0('0x1e')]:_0x2bf066[_0xebd0('0x1b')]+_0x2bf066['limit'];var _0x37eff9;if(_0x40b14d>=_0x20244d){_0x40b14d=_0x20244d;_0x37eff9=0xc8;}else{_0x37eff9=0xce;}_0x406cff[_0xebd0('0x19')](_0x37eff9);return _0x406cff['set'](_0xebd0('0x1f'),_0x4791b2+'-'+_0x40b14d+'/'+_0x20244d)['json'](_0x44822c);}return null;};}function patchUpdates(_0x4720d5){return function(_0x197b2f){try{jsonpatch[_0xebd0('0x20')](_0x197b2f,_0x4720d5,!![]);}catch(_0x1827ae){return BPromise['reject'](_0x1827ae);}return _0x197b2f[_0xebd0('0x21')]();};}function saveUpdates(_0x4ad73a,_0x2970e7){return function(_0x2d2639){if(_0x2d2639){return _0x2d2639[_0xebd0('0x22')](_0x4ad73a)['then'](function(_0x234548){return _0x234548;});}return null;};}function removeEntity(_0x47fe4,_0x254979){return function(_0x507343){if(_0x507343){return _0x507343[_0xebd0('0x23')]()[_0xebd0('0x24')](function(){_0x47fe4[_0xebd0('0x19')](0xcc)[_0xebd0('0x25')]();});}};}function handleEntityNotFound(_0x4a0deb,_0x4ee6dd){return function(_0x144f13){if(!_0x144f13){_0x4a0deb[_0xebd0('0x18')](0x194);}return _0x144f13;};}function handleError(_0x4210fb,_0x73fd66){_0x73fd66=_0x73fd66||0x1f4;return function(_0x30d96b){logger['error'](_0x30d96b[_0xebd0('0x26')]);if(_0x30d96b[_0xebd0('0x27')]){delete _0x30d96b[_0xebd0('0x27')];}_0x4210fb[_0xebd0('0x19')](_0x73fd66)[_0xebd0('0x28')](_0x30d96b);};}function getMustacheRender(_0x5c3fa2,_0x53169b){return Mustache['render'](_0x5c3fa2,_['merge'](_0x53169b[_0xebd0('0x29')],{'contact':_0x53169b[_0xebd0('0x2a')],'message':_0x53169b[_0xebd0('0x2b')],'agent':_0x53169b['agent'],'interaction':_0x53169b['interaction'],'account':_0x53169b['account']}))||'';}exports[_0xebd0('0x2c')]=function(_0x2d7ac6,_0x30a12a){var _0x1ca045={'raw':!![],'where':{'id':_0x2d7ac6[_0xebd0('0x2d')]['id']}},_0x141fb1={};_0x141fb1[_0xebd0('0x2e')]=_[_0xebd0('0x2f')](db['ChatApplication'][_0xebd0('0x30')]);_0x141fb1[_0xebd0('0x31')]=_[_0xebd0('0x2f')](_0x2d7ac6[_0xebd0('0x31')]);_0x141fb1[_0xebd0('0x32')]=_[_0xebd0('0x33')](_0x141fb1['model'],_0x141fb1[_0xebd0('0x31')]);_0x1ca045['attributes']=_['intersection'](_0x141fb1['model'],qs[_0xebd0('0x34')](_0x2d7ac6[_0xebd0('0x31')][_0xebd0('0x34')]));_0x1ca045[_0xebd0('0x35')]=_0x1ca045[_0xebd0('0x35')]['length']?_0x1ca045[_0xebd0('0x35')]:_0x141fb1[_0xebd0('0x2e')];if(_0x2d7ac6[_0xebd0('0x31')][_0xebd0('0x36')]){_0x1ca045[_0xebd0('0x37')]=[{'all':!![]}];}_0x1ca045=_[_0xebd0('0x38')]({},_0x1ca045,_0x2d7ac6[_0xebd0('0x39')]);return db[_0xebd0('0x3a')][_0xebd0('0x3b')](_0x1ca045)['then'](handleEntityNotFound(_0x30a12a,null))[_0xebd0('0x24')](respondWithResult(_0x30a12a,null))['catch'](handleError(_0x30a12a,null));};exports[_0xebd0('0x22')]=function(_0x20e3b6,_0x296f5c){if(_0x20e3b6['body']['id']){delete _0x20e3b6[_0xebd0('0x29')]['id'];}return db['ChatApplication'][_0xebd0('0x3b')]({'where':{'id':_0x20e3b6[_0xebd0('0x2d')]['id']}})[_0xebd0('0x24')](handleEntityNotFound(_0x296f5c,null))['then'](saveUpdates(_0x20e3b6[_0xebd0('0x29')],null))[_0xebd0('0x24')](respondWithResult(_0x296f5c,null))['catch'](handleError(_0x296f5c,null));};exports[_0xebd0('0x23')]=function(_0x225c66,_0xe0fa97){return db[_0xebd0('0x3a')]['find']({'where':{'id':_0x225c66[_0xebd0('0x2d')]['id']}})[_0xebd0('0x24')](handleEntityNotFound(_0xe0fa97,null))[_0xebd0('0x24')](removeEntity(_0xe0fa97,null))[_0xebd0('0x3c')](handleError(_0xe0fa97,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 8b4bded..6d680b9 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 _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});};
\ No newline at end of file
+var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index a5f8f32..218846a 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 _0xbfcb=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x164422,_0x5c7c11){var _0xaae8dd=function(_0x10fb74){while(--_0x10fb74){_0x164422['push'](_0x164422['shift']());}};_0xaae8dd(++_0x5c7c11);}(_0xbfcb,0x103));var _0xbbfc=function(_0x5588ae,_0x299a83){_0x5588ae=_0x5588ae-0x0;var _0x1de6d5=_0xbfcb[_0x5588ae];return _0x1de6d5;};'use strict';var _=require(_0xbbfc('0x0'));var util=require('util');var moment=require(_0xbbfc('0x1'));var BPromise=require(_0xbbfc('0x2'));var rs=require(_0xbbfc('0x3'));var fs=require('fs');var Redis=require(_0xbbfc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbbfc('0x5'));var logger=require(_0xbbfc('0x6'))('rpc');var config=require(_0xbbfc('0x7'));var jayson=require(_0xbbfc('0x8'));var client=jayson[_0xbbfc('0x9')][_0xbbfc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44605e,_0x24a20a,_0x1c68f4){return new BPromise(function(_0x345da5,_0xb61da7){return client[_0xbbfc('0xb')](_0x44605e,_0x1c68f4)[_0xbbfc('0xc')](function(_0x24f32d){logger[_0xbbfc('0xd')]('ChatApplication,\x20%s,\x20%s',_0x24a20a,_0xbbfc('0xe'));logger[_0xbbfc('0xf')](_0xbbfc('0x10'),_0x24a20a,_0xbbfc('0xe'),JSON[_0xbbfc('0x11')](_0x24f32d));if(_0x24f32d[_0xbbfc('0x12')]){if(_0x24f32d['error'][_0xbbfc('0x13')]===0x1f4){logger[_0xbbfc('0x12')](_0xbbfc('0x14'),_0x24a20a,_0x24f32d[_0xbbfc('0x12')][_0xbbfc('0x15')]);return _0xb61da7(_0x24f32d[_0xbbfc('0x12')][_0xbbfc('0x15')]);}logger[_0xbbfc('0x12')]('ChatApplication,\x20%s,\x20%s',_0x24a20a,_0x24f32d['error'][_0xbbfc('0x15')]);return _0x345da5(_0x24f32d[_0xbbfc('0x12')]['message']);}else{logger['info'](_0xbbfc('0x14'),_0x24a20a,_0xbbfc('0xe'));_0x345da5(_0x24f32d[_0xbbfc('0x16')][_0xbbfc('0x15')]);}})[_0xbbfc('0x17')](function(_0x8add9b){logger[_0xbbfc('0x12')]('ChatApplication,\x20%s,\x20%s',_0x24a20a,_0x8add9b);_0xb61da7(_0x8add9b);});});}
\ No newline at end of file
+var _0xa9e5=['then','info','ChatApplication,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x119388,_0x2fb646){var _0x3b8a53=function(_0x476f16){while(--_0x476f16){_0x119388['push'](_0x119388['shift']());}};_0x3b8a53(++_0x2fb646);}(_0xa9e5,0x1a7));var _0x5a9e=function(_0x5bd3ce,_0x4e7fb3){_0x5bd3ce=_0x5bd3ce-0x0;var _0x382afa=_0xa9e5[_0x5bd3ce];return _0x382afa;};'use strict';var _=require(_0x5a9e('0x0'));var util=require(_0x5a9e('0x1'));var moment=require(_0x5a9e('0x2'));var BPromise=require('bluebird');var rs=require(_0x5a9e('0x3'));var fs=require('fs');var Redis=require(_0x5a9e('0x4'));var db=require(_0x5a9e('0x5'))['db'];var utils=require(_0x5a9e('0x6'));var logger=require(_0x5a9e('0x7'))(_0x5a9e('0x8'));var config=require(_0x5a9e('0x9'));var jayson=require(_0x5a9e('0xa'));var client=jayson[_0x5a9e('0xb')][_0x5a9e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b7484,_0x340872,_0x313a8e){return new BPromise(function(_0x2de9fc,_0x22b2e8){return client[_0x5a9e('0xd')](_0x1b7484,_0x313a8e)[_0x5a9e('0xe')](function(_0x29fc0b){logger[_0x5a9e('0xf')](_0x5a9e('0x10'),_0x340872,'request\x20sent');logger[_0x5a9e('0x11')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x340872,_0x5a9e('0x12'),JSON['stringify'](_0x29fc0b));if(_0x29fc0b['error']){if(_0x29fc0b['error']['code']===0x1f4){logger[_0x5a9e('0x13')](_0x5a9e('0x10'),_0x340872,_0x29fc0b['error'][_0x5a9e('0x14')]);return _0x22b2e8(_0x29fc0b[_0x5a9e('0x13')][_0x5a9e('0x14')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x340872,_0x29fc0b[_0x5a9e('0x13')][_0x5a9e('0x14')]);return _0x2de9fc(_0x29fc0b[_0x5a9e('0x13')][_0x5a9e('0x14')]);}else{logger[_0x5a9e('0xf')]('ChatApplication,\x20%s,\x20%s',_0x340872,_0x5a9e('0x12'));_0x2de9fc(_0x29fc0b[_0x5a9e('0x15')][_0x5a9e('0x14')]);}})[_0x5a9e('0x16')](function(_0x2e9027){logger[_0x5a9e('0x13')](_0x5a9e('0x10'),_0x340872,_0x2e9027);_0x22b2e8(_0x2e9027);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 7924928..2e7d114 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 _0x4326=['../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','show','put','update','isAuthenticated','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x4326,0x1b4));var _0x6432=function(_0x53642d,_0x3a258b){_0x53642d=_0x53642d-0x0;var _0x3b2bec=_0x4326[_0x53642d];return _0x3b2bec;};'use strict';var multer=require('multer');var util=require(_0x6432('0x0'));var path=require(_0x6432('0x1'));var timeout=require(_0x6432('0x2'));var express=require(_0x6432('0x3'));var router=express[_0x6432('0x4')]();var fs_extra=require(_0x6432('0x5'));var auth=require(_0x6432('0x6'));var interaction=require(_0x6432('0x7'));var config=require('../../config/environment');var controller=require(_0x6432('0x8'));router[_0x6432('0x9')](_0x6432('0xa'),auth['isAuthenticated'](),controller[_0x6432('0xb')]);router[_0x6432('0xc')](_0x6432('0xa'),auth['isAuthenticated'](),controller[_0x6432('0xd')]);router['delete'](_0x6432('0xa'),auth[_0x6432('0xe')](),controller[_0x6432('0xf')]);module[_0x6432('0x10')]=router;
\ No newline at end of file
+var _0x75c5=['isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get','/:id'];(function(_0x3207aa,_0xe86a72){var _0x51758f=function(_0x9ff790){while(--_0x9ff790){_0x3207aa['push'](_0x3207aa['shift']());}};_0x51758f(++_0xe86a72);}(_0x75c5,0x97));var _0x575c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x75c5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x575c('0x0'));var util=require(_0x575c('0x1'));var path=require(_0x575c('0x2'));var timeout=require(_0x575c('0x3'));var express=require(_0x575c('0x4'));var router=express[_0x575c('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x575c('0x6'));var controller=require('./chatApplication.controller');router[_0x575c('0x7')](_0x575c('0x8'),auth[_0x575c('0x9')](),controller[_0x575c('0xa')]);router[_0x575c('0xb')]('/:id',auth[_0x575c('0x9')](),controller[_0x575c('0xc')]);router[_0x575c('0xd')](_0x575c('0x8'),auth[_0x575c('0x9')](),controller[_0x575c('0xe')]);module[_0x575c('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index d9b6178..c87a564 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 _0x66c0=['STRING','sequelize','exports'];(function(_0x54ffd8,_0x67b00a){var _0x4b929c=function(_0x8a91af){while(--_0x8a91af){_0x54ffd8['push'](_0x54ffd8['shift']());}};_0x4b929c(++_0x67b00a);}(_0x66c0,0x103));var _0x066c=function(_0x350057,_0x3b4985){_0x350057=_0x350057-0x0;var _0x5efcb1=_0x66c0[_0x350057];return _0x5efcb1;};'use strict';var Sequelize=require(_0x066c('0x0'));module[_0x066c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x066c('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x1940=['BOOLEAN','sequelize','exports','STRING'];(function(_0x2e1998,_0x22dc85){var _0x1a5b29=function(_0x352e21){while(--_0x352e21){_0x2e1998['push'](_0x2e1998['shift']());}};_0x1a5b29(++_0x22dc85);}(_0x1940,0x165));var _0x0194=function(_0x13f980,_0x1e1c56){_0x13f980=_0x13f980-0x0;var _0x27153c=_0x1940[_0x13f980];return _0x27153c;};'use strict';var Sequelize=require(_0x0194('0x0'));module[_0x0194('0x1')]={'name':{'type':Sequelize[_0x0194('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x0194('0x2')]},'write':{'type':Sequelize[_0x0194('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 126d5b7..1cef501 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 _0x64e1=['map','ChatGroup','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','order','removeMembers','addMessage','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','register','client','http','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','render','merge','body','interaction','account','index'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x64e1,0x9a));var _0x164e=function(_0x80b9b8,_0x2a2163){_0x80b9b8=_0x80b9b8-0x0;var _0xb7fe18=_0x64e1[_0x80b9b8];return _0xb7fe18;};'use strict';var emlformat=require(_0x164e('0x0'));var rimraf=require(_0x164e('0x1'));var zipdir=require(_0x164e('0x2'));var jsonpatch=require(_0x164e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x164e('0x4'));var path=require('path');var sox=require(_0x164e('0x5'));var csv=require(_0x164e('0x6'));var ejs=require(_0x164e('0x7'));var fs=require('fs');var fs_extra=require(_0x164e('0x8'));var _=require(_0x164e('0x9'));var squel=require(_0x164e('0xa'));var crypto=require(_0x164e('0xb'));var jsforce=require(_0x164e('0xc'));var deskjs=require(_0x164e('0xd'));var toCsv=require(_0x164e('0x6'));var querystring=require(_0x164e('0xe'));var Papa=require('papaparse');var Redis=require(_0x164e('0xf'));var authService=require(_0x164e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x164e('0x11'));var hardwareService=require(_0x164e('0x12'));var logger=require(_0x164e('0x13'))(_0x164e('0x14'));var utils=require(_0x164e('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x164e('0x16'))['db'];config[_0x164e('0x17')]=_['defaults'](config['redis'],{'host':_0x164e('0x18'),'port':0x18eb});var socket=require(_0x164e('0x19'))(new Redis(config[_0x164e('0x17')]));require('./chatGroup.socket')[_0x164e('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x164e('0x1b')][_0x164e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x2f7f8d,_0x144f24,_0x29811e,_0x14895d){return new BPromise(function(_0x57c1f6,_0x2dc497){var _0x1a3d2=_0x14895d||client;return _0x1a3d2['request'](_0x2f7f8d,_0x29811e)['then'](function(_0x54d36e){logger[_0x164e('0x1d')](_0x164e('0x1e'),_0x144f24,_0x164e('0x1f'));logger[_0x164e('0x20')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x144f24,_0x164e('0x1f'),JSON[_0x164e('0x21')](_0x54d36e));if(_0x54d36e[_0x164e('0x22')]){if(_0x54d36e[_0x164e('0x22')][_0x164e('0x23')]===0x1f4){logger[_0x164e('0x22')](_0x164e('0x1e'),_0x144f24,_0x54d36e[_0x164e('0x22')]['message']);return _0x2dc497(_0x54d36e[_0x164e('0x22')][_0x164e('0x24')]);}logger[_0x164e('0x22')](_0x164e('0x1e'),_0x144f24,_0x54d36e[_0x164e('0x22')]['message']);return _0x57c1f6(_0x54d36e[_0x164e('0x22')][_0x164e('0x24')]);}else{logger[_0x164e('0x1d')](_0x164e('0x1e'),_0x144f24,_0x164e('0x1f'));_0x57c1f6(_0x54d36e[_0x164e('0x25')][_0x164e('0x24')]);}})['catch'](function(_0x5e3e81){logger['error'](_0x164e('0x1e'),_0x144f24,_0x5e3e81);_0x2dc497(_0x5e3e81);});});}function respondWithStatusCode(_0xecb9f9,_0x24428e){_0x24428e=_0x24428e||0xcc;return function(_0x15aac8){if(_0x15aac8){return _0xecb9f9[_0x164e('0x26')](_0x24428e);}return _0xecb9f9[_0x164e('0x27')](_0x24428e)[_0x164e('0x28')]();};}function respondWithResult(_0x14012c,_0x998c6b){_0x998c6b=_0x998c6b||0xc8;return function(_0x3c615f){if(_0x3c615f){return _0x14012c[_0x164e('0x27')](_0x998c6b)[_0x164e('0x29')](_0x3c615f);}};}function respondWithFilteredResult(_0x3cb354,_0x39f735){return function(_0x2e5a43){if(_0x2e5a43){var _0x413341=typeof _0x39f735[_0x164e('0x2a')]===_0x164e('0x2b')&&typeof _0x39f735[_0x164e('0x2c')]===_0x164e('0x2b');var _0x42db4a=_0x2e5a43['count'];var _0x146481=_0x413341?0x0:_0x39f735[_0x164e('0x2a')];var _0x2b24ab=_0x413341?_0x2e5a43[_0x164e('0x2d')]:_0x39f735[_0x164e('0x2a')]+_0x39f735[_0x164e('0x2c')];var _0x2bd7a0;if(_0x2b24ab>=_0x42db4a){_0x2b24ab=_0x42db4a;_0x2bd7a0=0xc8;}else{_0x2bd7a0=0xce;}_0x3cb354['status'](_0x2bd7a0);return _0x3cb354[_0x164e('0x2e')](_0x164e('0x2f'),_0x146481+'-'+_0x2b24ab+'/'+_0x42db4a)[_0x164e('0x29')](_0x2e5a43);}return null;};}function patchUpdates(_0x5ecc1d){return function(_0x429f31){try{jsonpatch[_0x164e('0x30')](_0x429f31,_0x5ecc1d,!![]);}catch(_0x3ebf8a){return BPromise[_0x164e('0x31')](_0x3ebf8a);}return _0x429f31[_0x164e('0x32')]();};}function saveUpdates(_0xc6c4a1,_0x1a881f){return function(_0x57f56c){if(_0x57f56c){return _0x57f56c[_0x164e('0x33')](_0xc6c4a1)[_0x164e('0x34')](function(_0x370d25){return _0x370d25;});}return null;};}function removeEntity(_0xf1b18b,_0x55568f){return function(_0x288aa3){if(_0x288aa3){return _0x288aa3[_0x164e('0x35')]()[_0x164e('0x34')](function(){_0xf1b18b[_0x164e('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x387b05,_0x332056){return function(_0x5bc411){if(!_0x5bc411){_0x387b05[_0x164e('0x26')](0x194);}return _0x5bc411;};}function handleError(_0x263fbe,_0x4cd92b){_0x4cd92b=_0x4cd92b||0x1f4;return function(_0x4fa422){logger['error'](_0x4fa422[_0x164e('0x36')]);if(_0x4fa422[_0x164e('0x37')]){delete _0x4fa422[_0x164e('0x37')];}_0x263fbe[_0x164e('0x27')](_0x4cd92b)['send'](_0x4fa422);};}function getMustacheRender(_0x44a734,_0x23dc18){return Mustache[_0x164e('0x38')](_0x44a734,_[_0x164e('0x39')](_0x23dc18[_0x164e('0x3a')],{'contact':_0x23dc18['contact'],'message':_0x23dc18['message'],'agent':_0x23dc18['agent'],'interaction':_0x23dc18[_0x164e('0x3b')],'account':_0x23dc18[_0x164e('0x3c')]}))||'';}exports[_0x164e('0x3d')]=function(_0x4e0523,_0x46bf99){var _0x361dc0={},_0xe07977={},_0x1beb7a={'count':0x0,'rows':[]};var _0x13d79d=_[_0x164e('0x3e')](db[_0x164e('0x3f')][_0x164e('0x40')],function(_0x200260){return{'name':_0x200260['fieldName'],'type':_0x200260[_0x164e('0x41')]['key']};});_0xe07977[_0x164e('0x42')]=_[_0x164e('0x3e')](_0x13d79d,_0x164e('0x37'));_0xe07977[_0x164e('0x43')]=_[_0x164e('0x44')](_0x4e0523[_0x164e('0x43')]);_0xe07977[_0x164e('0x45')]=_['intersection'](_0xe07977[_0x164e('0x42')],_0xe07977[_0x164e('0x43')]);_0x361dc0[_0x164e('0x46')]=_[_0x164e('0x47')](_0xe07977[_0x164e('0x42')],qs[_0x164e('0x48')](_0x4e0523['query'][_0x164e('0x48')]));_0x361dc0[_0x164e('0x46')]=_0x361dc0[_0x164e('0x46')]['length']?_0x361dc0['attributes']:_0xe07977[_0x164e('0x42')];if(!_0x4e0523['query'][_0x164e('0x49')](_0x164e('0x4a'))){_0x361dc0[_0x164e('0x2c')]=qs[_0x164e('0x2c')](_0x4e0523[_0x164e('0x43')][_0x164e('0x2c')]);_0x361dc0[_0x164e('0x2a')]=qs['offset'](_0x4e0523[_0x164e('0x43')][_0x164e('0x2a')]);}_0x361dc0['order']=qs[_0x164e('0x4b')](_0x4e0523[_0x164e('0x43')]['sort']);_0x361dc0[_0x164e('0x4c')]=qs[_0x164e('0x45')](_[_0x164e('0x4d')](_0x4e0523[_0x164e('0x43')],_0xe07977[_0x164e('0x45')]),_0x13d79d);if(_0x4e0523[_0x164e('0x43')][_0x164e('0x4e')]){_0x361dc0['where']=_[_0x164e('0x39')](_0x361dc0['where'],{'$or':_[_0x164e('0x3e')](_0x13d79d,function(_0x2af42a){if(_0x2af42a[_0x164e('0x41')]!==_0x164e('0x4f')){var _0x323068={};_0x323068[_0x2af42a[_0x164e('0x37')]]={'$like':'%'+_0x4e0523[_0x164e('0x43')]['filter']+'%'};return _0x323068;}})});}_0x361dc0=_[_0x164e('0x39')]({},_0x361dc0,_0x4e0523[_0x164e('0x50')]);var _0x546278={'where':_0x361dc0[_0x164e('0x4c')]};return db[_0x164e('0x3f')]['count'](_0x546278)['then'](function(_0x5d1157){_0x1beb7a['count']=_0x5d1157;if(_0x4e0523[_0x164e('0x43')]['includeAll']){_0x361dc0[_0x164e('0x51')]=[{'all':!![]}];}return db['ChatGroup'][_0x164e('0x52')](_0x361dc0);})[_0x164e('0x34')](function(_0x269de7){_0x1beb7a[_0x164e('0x53')]=_0x269de7;return _0x1beb7a;})[_0x164e('0x34')](respondWithFilteredResult(_0x46bf99,_0x361dc0))[_0x164e('0x54')](handleError(_0x46bf99,null));};exports[_0x164e('0x55')]=function(_0x2cbb8e,_0x2aad14){var _0x1f839d={'raw':!![],'where':{'id':_0x2cbb8e[_0x164e('0x56')]['id']}},_0x2bbe64={};_0x2bbe64['model']=_['keys'](db['ChatGroup']['rawAttributes']);_0x2bbe64[_0x164e('0x43')]=_['keys'](_0x2cbb8e[_0x164e('0x43')]);_0x2bbe64[_0x164e('0x45')]=_[_0x164e('0x47')](_0x2bbe64[_0x164e('0x42')],_0x2bbe64[_0x164e('0x43')]);_0x1f839d[_0x164e('0x46')]=_[_0x164e('0x47')](_0x2bbe64[_0x164e('0x42')],qs[_0x164e('0x48')](_0x2cbb8e[_0x164e('0x43')][_0x164e('0x48')]));_0x1f839d[_0x164e('0x46')]=_0x1f839d['attributes'][_0x164e('0x57')]?_0x1f839d['attributes']:_0x2bbe64[_0x164e('0x42')];if(_0x2cbb8e[_0x164e('0x43')][_0x164e('0x58')]){_0x1f839d[_0x164e('0x51')]=[{'all':!![]}];}_0x1f839d=_[_0x164e('0x39')]({},_0x1f839d,_0x2cbb8e[_0x164e('0x50')]);return db[_0x164e('0x3f')][_0x164e('0x59')](_0x1f839d)[_0x164e('0x34')](handleEntityNotFound(_0x2aad14,null))['then'](respondWithResult(_0x2aad14,null))['catch'](handleError(_0x2aad14,null));};exports[_0x164e('0x5a')]=function(_0x51b282,_0x38879c){return db['ChatGroup']['create'](_0x51b282[_0x164e('0x3a')],{})[_0x164e('0x34')](respondWithResult(_0x38879c,0xc9))[_0x164e('0x54')](handleError(_0x38879c,null));};exports[_0x164e('0x33')]=function(_0x47ce9b,_0x632e21){if(_0x47ce9b[_0x164e('0x3a')]['id']){delete _0x47ce9b[_0x164e('0x3a')]['id'];}return db[_0x164e('0x3f')]['find']({'where':{'id':_0x47ce9b[_0x164e('0x56')]['id']}})[_0x164e('0x34')](handleEntityNotFound(_0x632e21,null))[_0x164e('0x34')](saveUpdates(_0x47ce9b[_0x164e('0x3a')],null))[_0x164e('0x34')](respondWithResult(_0x632e21,null))[_0x164e('0x54')](handleError(_0x632e21,null));};exports['destroy']=function(_0x4d4f02,_0x3e4c61){return db['ChatGroup']['find']({'where':{'id':_0x4d4f02[_0x164e('0x56')]['id']}})[_0x164e('0x34')](handleEntityNotFound(_0x3e4c61,null))[_0x164e('0x34')](removeEntity(_0x3e4c61,null))[_0x164e('0x54')](handleError(_0x3e4c61,null));};exports[_0x164e('0x5b')]=function(_0x2807af,_0x27b3b0){return db[_0x164e('0x3f')]['describe']()[_0x164e('0x34')](respondWithResult(_0x27b3b0,null))[_0x164e('0x54')](handleError(_0x27b3b0,null));};exports[_0x164e('0x5c')]=function(_0x57ac81,_0x336d87,_0x4fbb57){return db[_0x164e('0x5d')]['count']({'where':{'ChatGroupId':_0x57ac81[_0x164e('0x56')]['id'],'ToId':_0x57ac81[_0x164e('0x5e')]['id'],'read':![]}})[_0x164e('0x34')](function(_0x1c7b0f){return{'id':_['toInteger'](_0x57ac81['params']['id']),'count':_0x1c7b0f};})[_0x164e('0x34')](respondWithResult(_0x336d87,null))[_0x164e('0x54')](handleError(_0x336d87,null));};exports[_0x164e('0x5f')]=function(_0x3b56a9,_0x40c42d,_0x7c80de){return db[_0x164e('0x3f')][_0x164e('0x59')]({'where':{'id':_0x3b56a9[_0x164e('0x56')]['id']}})['then'](handleEntityNotFound(_0x40c42d,null))[_0x164e('0x34')](function(_0x4fe6c5){if(_0x4fe6c5){return _0x4fe6c5[_0x164e('0x5f')](_0x3b56a9[_0x164e('0x3a')][_0x164e('0x60')],_[_0x164e('0x61')](_0x3b56a9[_0x164e('0x3a')],[_0x164e('0x60'),'id'])||{});}})[_0x164e('0x34')](respondWithResult(_0x40c42d,null))[_0x164e('0x54')](handleError(_0x40c42d,null));};exports[_0x164e('0x62')]=function(_0x502594,_0x5b23ee,_0x37af5e){var _0xfcbe35={};var _0x26d554={};var _0x53bcdf;var _0x4a27b7;return db[_0x164e('0x3f')][_0x164e('0x63')]({'where':{'id':_0x502594[_0x164e('0x56')]['id']}})[_0x164e('0x34')](handleEntityNotFound(_0x5b23ee,null))['then'](function(_0x383a13){if(_0x383a13){_0x53bcdf=_0x383a13;_0x26d554['model']=_['keys'](db[_0x164e('0x64')][_0x164e('0x40')]);_0x26d554[_0x164e('0x43')]=_[_0x164e('0x44')](_0x502594['query']);_0x26d554['filters']=_[_0x164e('0x47')](_0x26d554[_0x164e('0x42')],_0x26d554[_0x164e('0x43')]);_0xfcbe35[_0x164e('0x46')]=_[_0x164e('0x47')](_0x26d554['model'],qs[_0x164e('0x48')](_0x502594[_0x164e('0x43')]['fields']));_0xfcbe35[_0x164e('0x46')]=_0xfcbe35[_0x164e('0x46')][_0x164e('0x57')]?_0xfcbe35[_0x164e('0x46')]:_0x26d554[_0x164e('0x42')];_0xfcbe35[_0x164e('0x65')]=qs[_0x164e('0x4b')](_0x502594[_0x164e('0x43')][_0x164e('0x4b')]);_0xfcbe35[_0x164e('0x4c')]=qs['filters'](_[_0x164e('0x4d')](_0x502594[_0x164e('0x43')],_0x26d554['filters']));if(_0x502594[_0x164e('0x43')][_0x164e('0x4e')]){_0xfcbe35[_0x164e('0x4c')]=_['merge'](_0xfcbe35[_0x164e('0x4c')],{'$or':_['map'](_0xfcbe35['attributes'],function(_0x99e039){var _0x5da3f0={};_0x5da3f0[_0x99e039]={'$like':'%'+_0x502594[_0x164e('0x43')][_0x164e('0x4e')]+'%'};return _0x5da3f0;})});}_0xfcbe35=_[_0x164e('0x39')]({},_0xfcbe35,_0x502594[_0x164e('0x50')]);return _0x53bcdf['getMembers'](_0xfcbe35);}})[_0x164e('0x34')](function(_0x24d7f5){if(_0x24d7f5){_0x4a27b7=_0x24d7f5[_0x164e('0x57')];if(!_0x502594['query'][_0x164e('0x49')](_0x164e('0x4a'))){_0xfcbe35[_0x164e('0x2c')]=qs['limit'](_0x502594[_0x164e('0x43')][_0x164e('0x2c')]);_0xfcbe35['offset']=qs[_0x164e('0x2a')](_0x502594['query'][_0x164e('0x2a')]);}return _0x53bcdf[_0x164e('0x62')](_0xfcbe35);}})[_0x164e('0x34')](function(_0x1d5b18){if(_0x1d5b18){return _0x1d5b18?{'count':_0x4a27b7,'rows':_0x1d5b18}:null;}})[_0x164e('0x34')](respondWithResult(_0x5b23ee,null))[_0x164e('0x54')](handleError(_0x5b23ee,null));};exports[_0x164e('0x66')]=function(_0x5ead68,_0x53518a,_0x33ca1f){return db[_0x164e('0x3f')]['find']({'where':{'id':_0x5ead68['params']['id']}})['then'](handleEntityNotFound(_0x53518a,null))[_0x164e('0x34')](function(_0x54171d){if(_0x54171d){return _0x54171d[_0x164e('0x66')](_0x5ead68[_0x164e('0x43')][_0x164e('0x60')]);}})['then'](respondWithStatusCode(_0x53518a,null))[_0x164e('0x54')](handleError(_0x53518a,null));};exports[_0x164e('0x67')]=function(_0x115c2a,_0x274f9b,_0x51fd68){if(_0x115c2a[_0x164e('0x3a')]['id']){delete _0x115c2a[_0x164e('0x3a')]['id'];}return db[_0x164e('0x3f')][_0x164e('0x59')]({'where':{'id':_0x115c2a[_0x164e('0x56')]['id']}})['then'](handleEntityNotFound(_0x274f9b,null))[_0x164e('0x34')](function(_0x3cd0ed){if(_0x3cd0ed){_0x115c2a[_0x164e('0x3a')]['ChatGroupId']=_0x3cd0ed['id'];return db['ChatInternalMessage']['create'](_0x115c2a[_0x164e('0x3a')]);}})[_0x164e('0x34')](respondWithResult(_0x274f9b,null))[_0x164e('0x54')](handleError(_0x274f9b,null));};exports[_0x164e('0x68')]=function(_0x562e26,_0x1e801f,_0x5c5361){var _0x5569cc={};var _0x51432e={};var _0x4b1dd9;var _0x4742a0;return db[_0x164e('0x3f')][_0x164e('0x63')]({'where':{'id':_0x562e26[_0x164e('0x56')]['id']}})[_0x164e('0x34')](handleEntityNotFound(_0x1e801f,null))[_0x164e('0x34')](function(_0x25e8b7){if(_0x25e8b7){_0x4b1dd9=_0x25e8b7;_0x51432e[_0x164e('0x42')]=_[_0x164e('0x44')](db[_0x164e('0x5d')][_0x164e('0x40')]);_0x51432e[_0x164e('0x43')]=_[_0x164e('0x44')](_0x562e26[_0x164e('0x43')]);_0x51432e[_0x164e('0x45')]=_[_0x164e('0x47')](_0x51432e['model'],_0x51432e['query']);_0x5569cc[_0x164e('0x46')]=_[_0x164e('0x47')](_0x51432e[_0x164e('0x42')],qs[_0x164e('0x48')](_0x562e26[_0x164e('0x43')][_0x164e('0x48')]));_0x5569cc[_0x164e('0x46')]=_0x5569cc['attributes'][_0x164e('0x57')]?_0x5569cc[_0x164e('0x46')]:_0x51432e[_0x164e('0x42')];_0x5569cc[_0x164e('0x65')]=qs[_0x164e('0x4b')](_0x562e26[_0x164e('0x43')][_0x164e('0x4b')]);_0x5569cc['where']=qs[_0x164e('0x45')](_['pick'](_0x562e26[_0x164e('0x43')],_0x51432e['filters']));if(_0x562e26[_0x164e('0x43')][_0x164e('0x4e')]){_0x5569cc['where']=_[_0x164e('0x39')](_0x5569cc['where'],{'$or':_[_0x164e('0x3e')](_0x5569cc[_0x164e('0x46')],function(_0x3c7c14){var _0x1489e3={};_0x1489e3[_0x3c7c14]={'$like':'%'+_0x562e26[_0x164e('0x43')][_0x164e('0x4e')]+'%'};return _0x1489e3;})});}if(_0x562e26[_0x164e('0x43')][_0x164e('0x69')]){var _0x479d34=_0x562e26[_0x164e('0x43')][_0x164e('0x69')][_0x164e('0x6a')](',');var _0x4c8f03={};_0x4c8f03[_0x479d34[0x0]]={'$gte':moment(_0x479d34[0x1])['format'](_0x164e('0x6b'))};_0x5569cc[_0x164e('0x4c')]=_[_0x164e('0x39')](_0x5569cc['where'],_0x4c8f03);}_0x5569cc=_[_0x164e('0x39')]({},_0x5569cc,_0x562e26[_0x164e('0x50')]);return _0x4b1dd9[_0x164e('0x68')](_0x5569cc);}})[_0x164e('0x34')](function(_0x38980e){if(_0x38980e){_0x4742a0=_0x38980e[_0x164e('0x57')];if(!_0x562e26[_0x164e('0x43')][_0x164e('0x49')](_0x164e('0x4a'))){_0x5569cc[_0x164e('0x2c')]=qs['limit'](_0x562e26[_0x164e('0x43')][_0x164e('0x2c')]);_0x5569cc['offset']=qs[_0x164e('0x2a')](_0x562e26[_0x164e('0x43')][_0x164e('0x2a')]);}return _0x4b1dd9[_0x164e('0x68')](_0x5569cc);}})['then'](function(_0x543cef){if(_0x543cef){return _0x543cef?{'count':_0x4742a0,'rows':_0x543cef}:null;}})[_0x164e('0x34')](respondWithResult(_0x1e801f,null))[_0x164e('0x54')](handleError(_0x1e801f,null));};
\ No newline at end of file
+var _0xa2c5=['find','create','body','describe','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','redis','localhost','socket.io-emitter','./chatGroup.socket','register','client','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','ChatGroup,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','stack','name','send','merge','contact','interaction','account','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0xa2c5,0x7a));var _0x5a2c=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xa2c5[_0x36eaaa];return _0x461349;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5a2c('0x0'));var zipdir=require(_0x5a2c('0x1'));var jsonpatch=require(_0x5a2c('0x2'));var rp=require(_0x5a2c('0x3'));var moment=require('moment');var BPromise=require(_0x5a2c('0x4'));var Mustache=require(_0x5a2c('0x5'));var util=require('util');var path=require(_0x5a2c('0x6'));var sox=require('sox');var csv=require(_0x5a2c('0x7'));var ejs=require(_0x5a2c('0x8'));var fs=require('fs');var fs_extra=require(_0x5a2c('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5a2c('0xa'));var jsforce=require(_0x5a2c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5a2c('0x7'));var querystring=require(_0x5a2c('0xc'));var Papa=require(_0x5a2c('0xd'));var Redis=require(_0x5a2c('0xe'));var authService=require(_0x5a2c('0xf'));var qs=require(_0x5a2c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5a2c('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x5a2c('0x12')]=_['defaults'](config[_0x5a2c('0x12')],{'host':_0x5a2c('0x13'),'port':0x18eb});var socket=require(_0x5a2c('0x14'))(new Redis(config[_0x5a2c('0x12')]));require(_0x5a2c('0x15'))[_0x5a2c('0x16')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5a2c('0x17')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f1d3d,_0x54d891,_0x247312,_0x35e569){return new BPromise(function(_0x2e0f10,_0x1f693e){var _0x32373e=_0x35e569||client;return _0x32373e['request'](_0x5f1d3d,_0x247312)[_0x5a2c('0x18')](function(_0x8a3b78){logger[_0x5a2c('0x19')]('ChatGroup,\x20%s,\x20%s',_0x54d891,_0x5a2c('0x1a'));logger[_0x5a2c('0x1b')](_0x5a2c('0x1c'),_0x54d891,_0x5a2c('0x1a'),JSON[_0x5a2c('0x1d')](_0x8a3b78));if(_0x8a3b78['error']){if(_0x8a3b78[_0x5a2c('0x1e')]['code']===0x1f4){logger[_0x5a2c('0x1e')](_0x5a2c('0x1f'),_0x54d891,_0x8a3b78['error']['message']);return _0x1f693e(_0x8a3b78[_0x5a2c('0x1e')][_0x5a2c('0x20')]);}logger[_0x5a2c('0x1e')](_0x5a2c('0x1f'),_0x54d891,_0x8a3b78[_0x5a2c('0x1e')][_0x5a2c('0x20')]);return _0x2e0f10(_0x8a3b78[_0x5a2c('0x1e')]['message']);}else{logger[_0x5a2c('0x19')](_0x5a2c('0x1f'),_0x54d891,_0x5a2c('0x1a'));_0x2e0f10(_0x8a3b78[_0x5a2c('0x21')][_0x5a2c('0x20')]);}})[_0x5a2c('0x22')](function(_0x380db4){logger['error'](_0x5a2c('0x1f'),_0x54d891,_0x380db4);_0x1f693e(_0x380db4);});});}function respondWithStatusCode(_0x300285,_0x3302d9){_0x3302d9=_0x3302d9||0xcc;return function(_0x25ac8b){if(_0x25ac8b){return _0x300285[_0x5a2c('0x23')](_0x3302d9);}return _0x300285[_0x5a2c('0x24')](_0x3302d9)['end']();};}function respondWithResult(_0x54c298,_0x2d7a9d){_0x2d7a9d=_0x2d7a9d||0xc8;return function(_0x80e62b){if(_0x80e62b){return _0x54c298[_0x5a2c('0x24')](_0x2d7a9d)[_0x5a2c('0x25')](_0x80e62b);}};}function respondWithFilteredResult(_0x225da3,_0x202f4a){return function(_0x3ba50b){if(_0x3ba50b){var _0x5eefcf=typeof _0x202f4a[_0x5a2c('0x26')]===_0x5a2c('0x27')&&typeof _0x202f4a['limit']===_0x5a2c('0x27');var _0x36dfc3=_0x3ba50b[_0x5a2c('0x28')];var _0x22088c=_0x5eefcf?0x0:_0x202f4a[_0x5a2c('0x26')];var _0x48f1dc=_0x5eefcf?_0x3ba50b['count']:_0x202f4a['offset']+_0x202f4a[_0x5a2c('0x29')];var _0x26c465;if(_0x48f1dc>=_0x36dfc3){_0x48f1dc=_0x36dfc3;_0x26c465=0xc8;}else{_0x26c465=0xce;}_0x225da3[_0x5a2c('0x24')](_0x26c465);return _0x225da3[_0x5a2c('0x2a')](_0x5a2c('0x2b'),_0x22088c+'-'+_0x48f1dc+'/'+_0x36dfc3)['json'](_0x3ba50b);}return null;};}function patchUpdates(_0x416dbe){return function(_0xd507b3){try{jsonpatch[_0x5a2c('0x2c')](_0xd507b3,_0x416dbe,!![]);}catch(_0x507eb0){return BPromise['reject'](_0x507eb0);}return _0xd507b3[_0x5a2c('0x2d')]();};}function saveUpdates(_0x316abd,_0x10dbe3){return function(_0x5eccf4){if(_0x5eccf4){return _0x5eccf4[_0x5a2c('0x2e')](_0x316abd)[_0x5a2c('0x18')](function(_0x14cb20){return _0x14cb20;});}return null;};}function removeEntity(_0x4bc80f,_0x5c3582){return function(_0xa02ab){if(_0xa02ab){return _0xa02ab[_0x5a2c('0x2f')]()[_0x5a2c('0x18')](function(){_0x4bc80f[_0x5a2c('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e219a,_0x413f94){return function(_0x1d4be2){if(!_0x1d4be2){_0x1e219a[_0x5a2c('0x23')](0x194);}return _0x1d4be2;};}function handleError(_0xfabc5c,_0x26dfbb){_0x26dfbb=_0x26dfbb||0x1f4;return function(_0x2bf9c2){logger[_0x5a2c('0x1e')](_0x2bf9c2[_0x5a2c('0x30')]);if(_0x2bf9c2[_0x5a2c('0x31')]){delete _0x2bf9c2['name'];}_0xfabc5c['status'](_0x26dfbb)[_0x5a2c('0x32')](_0x2bf9c2);};}function getMustacheRender(_0x5dc68c,_0x78dd00){return Mustache['render'](_0x5dc68c,_[_0x5a2c('0x33')](_0x78dd00['body'],{'contact':_0x78dd00[_0x5a2c('0x34')],'message':_0x78dd00[_0x5a2c('0x20')],'agent':_0x78dd00['agent'],'interaction':_0x78dd00[_0x5a2c('0x35')],'account':_0x78dd00[_0x5a2c('0x36')]}))||'';}exports[_0x5a2c('0x37')]=function(_0x199679,_0x5b1ba2){var _0x2bf5ed={},_0x1c5d59={},_0x1daed8={'count':0x0,'rows':[]};var _0x4eed89=_[_0x5a2c('0x38')](db[_0x5a2c('0x39')][_0x5a2c('0x3a')],function(_0x3461c2){return{'name':_0x3461c2[_0x5a2c('0x3b')],'type':_0x3461c2[_0x5a2c('0x3c')][_0x5a2c('0x3d')]};});_0x1c5d59[_0x5a2c('0x3e')]=_[_0x5a2c('0x38')](_0x4eed89,_0x5a2c('0x31'));_0x1c5d59[_0x5a2c('0x3f')]=_[_0x5a2c('0x40')](_0x199679[_0x5a2c('0x3f')]);_0x1c5d59[_0x5a2c('0x41')]=_[_0x5a2c('0x42')](_0x1c5d59[_0x5a2c('0x3e')],_0x1c5d59[_0x5a2c('0x3f')]);_0x2bf5ed[_0x5a2c('0x43')]=_[_0x5a2c('0x42')](_0x1c5d59['model'],qs[_0x5a2c('0x44')](_0x199679[_0x5a2c('0x3f')]['fields']));_0x2bf5ed[_0x5a2c('0x43')]=_0x2bf5ed[_0x5a2c('0x43')]['length']?_0x2bf5ed[_0x5a2c('0x43')]:_0x1c5d59[_0x5a2c('0x3e')];if(!_0x199679['query'][_0x5a2c('0x45')]('nolimit')){_0x2bf5ed['limit']=qs[_0x5a2c('0x29')](_0x199679[_0x5a2c('0x3f')][_0x5a2c('0x29')]);_0x2bf5ed[_0x5a2c('0x26')]=qs[_0x5a2c('0x26')](_0x199679['query'][_0x5a2c('0x26')]);}_0x2bf5ed[_0x5a2c('0x46')]=qs[_0x5a2c('0x47')](_0x199679['query'][_0x5a2c('0x47')]);_0x2bf5ed['where']=qs[_0x5a2c('0x41')](_[_0x5a2c('0x48')](_0x199679[_0x5a2c('0x3f')],_0x1c5d59[_0x5a2c('0x41')]),_0x4eed89);if(_0x199679[_0x5a2c('0x3f')][_0x5a2c('0x49')]){_0x2bf5ed['where']=_['merge'](_0x2bf5ed[_0x5a2c('0x4a')],{'$or':_[_0x5a2c('0x38')](_0x4eed89,function(_0x42810c){if(_0x42810c[_0x5a2c('0x3c')]!==_0x5a2c('0x4b')){var _0x52fdb8={};_0x52fdb8[_0x42810c[_0x5a2c('0x31')]]={'$like':'%'+_0x199679[_0x5a2c('0x3f')][_0x5a2c('0x49')]+'%'};return _0x52fdb8;}})});}_0x2bf5ed=_[_0x5a2c('0x33')]({},_0x2bf5ed,_0x199679[_0x5a2c('0x4c')]);var _0x5b2356={'where':_0x2bf5ed['where']};return db[_0x5a2c('0x39')][_0x5a2c('0x28')](_0x5b2356)['then'](function(_0x4169e0){_0x1daed8[_0x5a2c('0x28')]=_0x4169e0;if(_0x199679['query'][_0x5a2c('0x4d')]){_0x2bf5ed[_0x5a2c('0x4e')]=[{'all':!![]}];}return db['ChatGroup'][_0x5a2c('0x4f')](_0x2bf5ed);})[_0x5a2c('0x18')](function(_0x226eca){_0x1daed8[_0x5a2c('0x50')]=_0x226eca;return _0x1daed8;})[_0x5a2c('0x18')](respondWithFilteredResult(_0x5b1ba2,_0x2bf5ed))[_0x5a2c('0x22')](handleError(_0x5b1ba2,null));};exports[_0x5a2c('0x51')]=function(_0x1dbef5,_0xc108a0){var _0x50d3c9={'raw':!![],'where':{'id':_0x1dbef5[_0x5a2c('0x52')]['id']}},_0x2f33e5={};_0x2f33e5[_0x5a2c('0x3e')]=_[_0x5a2c('0x40')](db[_0x5a2c('0x39')][_0x5a2c('0x3a')]);_0x2f33e5['query']=_['keys'](_0x1dbef5[_0x5a2c('0x3f')]);_0x2f33e5[_0x5a2c('0x41')]=_[_0x5a2c('0x42')](_0x2f33e5[_0x5a2c('0x3e')],_0x2f33e5[_0x5a2c('0x3f')]);_0x50d3c9[_0x5a2c('0x43')]=_[_0x5a2c('0x42')](_0x2f33e5[_0x5a2c('0x3e')],qs[_0x5a2c('0x44')](_0x1dbef5[_0x5a2c('0x3f')][_0x5a2c('0x44')]));_0x50d3c9[_0x5a2c('0x43')]=_0x50d3c9['attributes'][_0x5a2c('0x53')]?_0x50d3c9[_0x5a2c('0x43')]:_0x2f33e5[_0x5a2c('0x3e')];if(_0x1dbef5[_0x5a2c('0x3f')]['includeAll']){_0x50d3c9[_0x5a2c('0x4e')]=[{'all':!![]}];}_0x50d3c9=_[_0x5a2c('0x33')]({},_0x50d3c9,_0x1dbef5[_0x5a2c('0x4c')]);return db[_0x5a2c('0x39')][_0x5a2c('0x54')](_0x50d3c9)[_0x5a2c('0x18')](handleEntityNotFound(_0xc108a0,null))[_0x5a2c('0x18')](respondWithResult(_0xc108a0,null))['catch'](handleError(_0xc108a0,null));};exports[_0x5a2c('0x55')]=function(_0x14d4a9,_0x339043){return db[_0x5a2c('0x39')][_0x5a2c('0x55')](_0x14d4a9[_0x5a2c('0x56')],{})[_0x5a2c('0x18')](respondWithResult(_0x339043,0xc9))[_0x5a2c('0x22')](handleError(_0x339043,null));};exports[_0x5a2c('0x2e')]=function(_0xef87b8,_0x3ac553){if(_0xef87b8[_0x5a2c('0x56')]['id']){delete _0xef87b8[_0x5a2c('0x56')]['id'];}return db[_0x5a2c('0x39')][_0x5a2c('0x54')]({'where':{'id':_0xef87b8[_0x5a2c('0x52')]['id']}})[_0x5a2c('0x18')](handleEntityNotFound(_0x3ac553,null))[_0x5a2c('0x18')](saveUpdates(_0xef87b8[_0x5a2c('0x56')],null))[_0x5a2c('0x18')](respondWithResult(_0x3ac553,null))[_0x5a2c('0x22')](handleError(_0x3ac553,null));};exports[_0x5a2c('0x2f')]=function(_0x102413,_0x5e418a){return db[_0x5a2c('0x39')][_0x5a2c('0x54')]({'where':{'id':_0x102413[_0x5a2c('0x52')]['id']}})[_0x5a2c('0x18')](handleEntityNotFound(_0x5e418a,null))[_0x5a2c('0x18')](removeEntity(_0x5e418a,null))[_0x5a2c('0x22')](handleError(_0x5e418a,null));};exports[_0x5a2c('0x57')]=function(_0xa10ec,_0x16fe99){return db[_0x5a2c('0x39')][_0x5a2c('0x57')]()[_0x5a2c('0x18')](respondWithResult(_0x16fe99,null))[_0x5a2c('0x22')](handleError(_0x16fe99,null));};exports['getUnread']=function(_0x2310b3,_0x1017ca,_0x20bf54){return db['ChatInternalMessage'][_0x5a2c('0x28')]({'where':{'ChatGroupId':_0x2310b3['params']['id'],'ToId':_0x2310b3[_0x5a2c('0x58')]['id'],'read':![]}})[_0x5a2c('0x18')](function(_0x4a9406){return{'id':_[_0x5a2c('0x59')](_0x2310b3[_0x5a2c('0x52')]['id']),'count':_0x4a9406};})[_0x5a2c('0x18')](respondWithResult(_0x1017ca,null))[_0x5a2c('0x22')](handleError(_0x1017ca,null));};exports[_0x5a2c('0x5a')]=function(_0x5c1072,_0x50f382,_0x15ca24){return db['ChatGroup']['find']({'where':{'id':_0x5c1072[_0x5a2c('0x52')]['id']}})[_0x5a2c('0x18')](handleEntityNotFound(_0x50f382,null))[_0x5a2c('0x18')](function(_0x2c71c0){if(_0x2c71c0){return _0x2c71c0[_0x5a2c('0x5a')](_0x5c1072[_0x5a2c('0x56')][_0x5a2c('0x5b')],_[_0x5a2c('0x5c')](_0x5c1072[_0x5a2c('0x56')],[_0x5a2c('0x5b'),'id'])||{});}})[_0x5a2c('0x18')](respondWithResult(_0x50f382,null))['catch'](handleError(_0x50f382,null));};exports[_0x5a2c('0x5d')]=function(_0x381985,_0x3555b1,_0x56b4d0){var _0x47c5db={};var _0x351f81={};var _0x2e3e34;var _0x14f60c;return db['ChatGroup'][_0x5a2c('0x5e')]({'where':{'id':_0x381985['params']['id']}})[_0x5a2c('0x18')](handleEntityNotFound(_0x3555b1,null))['then'](function(_0x4baa0d){if(_0x4baa0d){_0x2e3e34=_0x4baa0d;_0x351f81[_0x5a2c('0x3e')]=_[_0x5a2c('0x40')](db[_0x5a2c('0x5f')][_0x5a2c('0x3a')]);_0x351f81[_0x5a2c('0x3f')]=_[_0x5a2c('0x40')](_0x381985['query']);_0x351f81[_0x5a2c('0x41')]=_['intersection'](_0x351f81[_0x5a2c('0x3e')],_0x351f81[_0x5a2c('0x3f')]);_0x47c5db[_0x5a2c('0x43')]=_[_0x5a2c('0x42')](_0x351f81[_0x5a2c('0x3e')],qs[_0x5a2c('0x44')](_0x381985[_0x5a2c('0x3f')][_0x5a2c('0x44')]));_0x47c5db[_0x5a2c('0x43')]=_0x47c5db[_0x5a2c('0x43')]['length']?_0x47c5db['attributes']:_0x351f81['model'];_0x47c5db['order']=qs[_0x5a2c('0x47')](_0x381985[_0x5a2c('0x3f')]['sort']);_0x47c5db['where']=qs[_0x5a2c('0x41')](_[_0x5a2c('0x48')](_0x381985[_0x5a2c('0x3f')],_0x351f81[_0x5a2c('0x41')]));if(_0x381985[_0x5a2c('0x3f')][_0x5a2c('0x49')]){_0x47c5db[_0x5a2c('0x4a')]=_[_0x5a2c('0x33')](_0x47c5db[_0x5a2c('0x4a')],{'$or':_[_0x5a2c('0x38')](_0x47c5db['attributes'],function(_0x1f8f8a){var _0x22bf8d={};_0x22bf8d[_0x1f8f8a]={'$like':'%'+_0x381985['query'][_0x5a2c('0x49')]+'%'};return _0x22bf8d;})});}_0x47c5db=_[_0x5a2c('0x33')]({},_0x47c5db,_0x381985[_0x5a2c('0x4c')]);return _0x2e3e34[_0x5a2c('0x5d')](_0x47c5db);}})['then'](function(_0xa486e9){if(_0xa486e9){_0x14f60c=_0xa486e9[_0x5a2c('0x53')];if(!_0x381985['query'][_0x5a2c('0x45')]('nolimit')){_0x47c5db[_0x5a2c('0x29')]=qs['limit'](_0x381985[_0x5a2c('0x3f')]['limit']);_0x47c5db[_0x5a2c('0x26')]=qs[_0x5a2c('0x26')](_0x381985[_0x5a2c('0x3f')][_0x5a2c('0x26')]);}return _0x2e3e34[_0x5a2c('0x5d')](_0x47c5db);}})[_0x5a2c('0x18')](function(_0x3810a5){if(_0x3810a5){return _0x3810a5?{'count':_0x14f60c,'rows':_0x3810a5}:null;}})[_0x5a2c('0x18')](respondWithResult(_0x3555b1,null))[_0x5a2c('0x22')](handleError(_0x3555b1,null));};exports['removeMembers']=function(_0x315a8f,_0x1786b0,_0x21e903){return db[_0x5a2c('0x39')][_0x5a2c('0x54')]({'where':{'id':_0x315a8f[_0x5a2c('0x52')]['id']}})[_0x5a2c('0x18')](handleEntityNotFound(_0x1786b0,null))[_0x5a2c('0x18')](function(_0xed390e){if(_0xed390e){return _0xed390e[_0x5a2c('0x60')](_0x315a8f[_0x5a2c('0x3f')]['ids']);}})[_0x5a2c('0x18')](respondWithStatusCode(_0x1786b0,null))[_0x5a2c('0x22')](handleError(_0x1786b0,null));};exports[_0x5a2c('0x61')]=function(_0x573797,_0x21aca3,_0x19151d){if(_0x573797['body']['id']){delete _0x573797[_0x5a2c('0x56')]['id'];}return db[_0x5a2c('0x39')][_0x5a2c('0x54')]({'where':{'id':_0x573797[_0x5a2c('0x52')]['id']}})[_0x5a2c('0x18')](handleEntityNotFound(_0x21aca3,null))['then'](function(_0x42375a){if(_0x42375a){_0x573797[_0x5a2c('0x56')][_0x5a2c('0x62')]=_0x42375a['id'];return db['ChatInternalMessage'][_0x5a2c('0x55')](_0x573797[_0x5a2c('0x56')]);}})[_0x5a2c('0x18')](respondWithResult(_0x21aca3,null))['catch'](handleError(_0x21aca3,null));};exports['getMessages']=function(_0xbf4886,_0x3adb93,_0x3a58c1){var _0x19bb70={};var _0x403eeb={};var _0x23d97e;var _0x1a42b0;return db[_0x5a2c('0x39')][_0x5a2c('0x5e')]({'where':{'id':_0xbf4886[_0x5a2c('0x52')]['id']}})['then'](handleEntityNotFound(_0x3adb93,null))['then'](function(_0x44a611){if(_0x44a611){_0x23d97e=_0x44a611;_0x403eeb[_0x5a2c('0x3e')]=_[_0x5a2c('0x40')](db['ChatInternalMessage'][_0x5a2c('0x3a')]);_0x403eeb[_0x5a2c('0x3f')]=_['keys'](_0xbf4886[_0x5a2c('0x3f')]);_0x403eeb['filters']=_[_0x5a2c('0x42')](_0x403eeb[_0x5a2c('0x3e')],_0x403eeb[_0x5a2c('0x3f')]);_0x19bb70[_0x5a2c('0x43')]=_[_0x5a2c('0x42')](_0x403eeb[_0x5a2c('0x3e')],qs[_0x5a2c('0x44')](_0xbf4886[_0x5a2c('0x3f')]['fields']));_0x19bb70[_0x5a2c('0x43')]=_0x19bb70['attributes']['length']?_0x19bb70['attributes']:_0x403eeb[_0x5a2c('0x3e')];_0x19bb70[_0x5a2c('0x46')]=qs[_0x5a2c('0x47')](_0xbf4886[_0x5a2c('0x3f')]['sort']);_0x19bb70[_0x5a2c('0x4a')]=qs[_0x5a2c('0x41')](_[_0x5a2c('0x48')](_0xbf4886[_0x5a2c('0x3f')],_0x403eeb[_0x5a2c('0x41')]));if(_0xbf4886[_0x5a2c('0x3f')]['filter']){_0x19bb70[_0x5a2c('0x4a')]=_[_0x5a2c('0x33')](_0x19bb70[_0x5a2c('0x4a')],{'$or':_[_0x5a2c('0x38')](_0x19bb70[_0x5a2c('0x43')],function(_0x44026b){var _0xe1c7bb={};_0xe1c7bb[_0x44026b]={'$like':'%'+_0xbf4886[_0x5a2c('0x3f')][_0x5a2c('0x49')]+'%'};return _0xe1c7bb;})});}if(_0xbf4886[_0x5a2c('0x3f')][_0x5a2c('0x63')]){var _0x50a2bf=_0xbf4886[_0x5a2c('0x3f')][_0x5a2c('0x63')]['split'](',');var _0x49132e={};_0x49132e[_0x50a2bf[0x0]]={'$gte':moment(_0x50a2bf[0x1])[_0x5a2c('0x64')](_0x5a2c('0x65'))};_0x19bb70[_0x5a2c('0x4a')]=_[_0x5a2c('0x33')](_0x19bb70[_0x5a2c('0x4a')],_0x49132e);}_0x19bb70=_['merge']({},_0x19bb70,_0xbf4886[_0x5a2c('0x4c')]);return _0x23d97e[_0x5a2c('0x66')](_0x19bb70);}})[_0x5a2c('0x18')](function(_0x46620d){if(_0x46620d){_0x1a42b0=_0x46620d[_0x5a2c('0x53')];if(!_0xbf4886['query'][_0x5a2c('0x45')]('nolimit')){_0x19bb70['limit']=qs[_0x5a2c('0x29')](_0xbf4886[_0x5a2c('0x3f')][_0x5a2c('0x29')]);_0x19bb70[_0x5a2c('0x26')]=qs[_0x5a2c('0x26')](_0xbf4886[_0x5a2c('0x3f')][_0x5a2c('0x26')]);}return _0x23d97e['getMessages'](_0x19bb70);}})[_0x5a2c('0x18')](function(_0x2c0864){if(_0x2c0864){return _0x2c0864?{'count':_0x1a42b0,'rows':_0x2c0864}:null;}})[_0x5a2c('0x18')](respondWithResult(_0x3adb93,null))['catch'](handleError(_0x3adb93,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index cb26063..ade4bc8 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 _0x2032=['exports','../../mysqldb','ChatGroup','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x251d9c,_0x580977){var _0x16ae64=function(_0x4d3b53){while(--_0x4d3b53){_0x251d9c['push'](_0x251d9c['shift']());}};_0x16ae64(++_0x580977);}(_0x2032,0xd9));var _0x2203=function(_0x13c3f2,_0x2ac6b4){_0x13c3f2=_0x13c3f2-0x0;var _0x478808=_0x2032[_0x13c3f2];return _0x478808;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x2203('0x0'))['db'][_0x2203('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2203('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2203('0x3'),'afterDestroy':_0x2203('0x4')};function emitEvent(_0x4b4c7f){return function(_0x46c49a,_0x880dcd,_0x44ccfd){ChatGroupEvents[_0x2203('0x5')](_0x4b4c7f+':'+_0x46c49a['id'],_0x46c49a);ChatGroupEvents[_0x2203('0x5')](_0x4b4c7f,_0x46c49a);_0x44ccfd(null);};}for(var e in events){if(events[_0x2203('0x6')](e)){var event=events[e];ChatGroup[_0x2203('0x7')](e,emitEvent(event));}}module[_0x2203('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0xadb5=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x1a014b,_0x48acae){var _0x462258=function(_0x1473be){while(--_0x1473be){_0x1a014b['push'](_0x1a014b['shift']());}};_0x462258(++_0x48acae);}(_0xadb5,0xad));var _0x5adb=function(_0x19fe2d,_0x132d1f){_0x19fe2d=_0x19fe2d-0x0;var _0x3c70d5=_0xadb5[_0x19fe2d];return _0x3c70d5;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x5adb('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5adb('0x1')](0x0);var events={'afterCreate':_0x5adb('0x2'),'afterUpdate':_0x5adb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x248dc6){return function(_0x31457,_0x2e3ef4,_0x4cb1d1){ChatGroupEvents[_0x5adb('0x4')](_0x248dc6+':'+_0x31457['id'],_0x31457);ChatGroupEvents[_0x5adb('0x4')](_0x248dc6,_0x31457);_0x4cb1d1(null);};}for(var e in events){if(events[_0x5adb('0x5')](e)){var event=events[e];ChatGroup[_0x5adb('0x6')](e,emitEvent(event));}}module[_0x5adb('0x7')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 8dc3629..9726c0e 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 _0xb2ff=['./chatGroup.attributes','exports','ChatGroup','lodash','util','api','path','../../config/environment'];(function(_0x165468,_0x193334){var _0x2245a4=function(_0x3beaad){while(--_0x3beaad){_0x165468['push'](_0x165468['shift']());}};_0x2245a4(++_0x193334);}(_0xb2ff,0x123));var _0xfb2f=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb2ff[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xfb2f('0x0'));var util=require(_0xfb2f('0x1'));var logger=require('../../config/logger')(_0xfb2f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb2f('0x3'));var rimraf=require('rimraf');var config=require(_0xfb2f('0x4'));var attributes=require(_0xfb2f('0x5'));module[_0xfb2f('0x6')]=function(_0x1d3416,_0x542ce7){return _0x1d3416['define'](_0xfb2f('0x7'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe700=['../../config/environment','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x46323d,_0x166705){var _0xb1e718=function(_0x511b76){while(--_0x511b76){_0x46323d['push'](_0x46323d['shift']());}};_0xb1e718(++_0x166705);}(_0xe700,0x75));var _0x0e70=function(_0x3e9140,_0xe50d2f){_0x3e9140=_0x3e9140-0x0;var _0xb22533=_0xe700[_0x3e9140];return _0xb22533;};'use strict';var _=require(_0x0e70('0x0'));var util=require(_0x0e70('0x1'));var logger=require(_0x0e70('0x2'))(_0x0e70('0x3'));var moment=require(_0x0e70('0x4'));var BPromise=require(_0x0e70('0x5'));var rp=require(_0x0e70('0x6'));var fs=require('fs');var path=require(_0x0e70('0x7'));var rimraf=require(_0x0e70('0x8'));var config=require(_0x0e70('0x9'));var attributes=require('./chatGroup.attributes');module[_0x0e70('0xa')]=function(_0x5e1b28,_0x44a1ee){return _0x5e1b28[_0x0e70('0xb')](_0x0e70('0xc'),attributes,{'tableName':_0x0e70('0xd'),'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 27cf89f..ed832e8 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 _0x2852=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','randomstring','ioredis'];(function(_0x30b0d8,_0x57470c){var _0x459c09=function(_0x5e51b6){while(--_0x5e51b6){_0x30b0d8['push'](_0x30b0d8['shift']());}};_0x459c09(++_0x57470c);}(_0x2852,0x1e3));var _0x2285=function(_0x2505c9,_0x12c77f){_0x2505c9=_0x2505c9-0x0;var _0x357162=_0x2852[_0x2505c9];return _0x357162;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2285('0x0'));var BPromise=require('bluebird');var rs=require(_0x2285('0x1'));var fs=require('fs');var Redis=require(_0x2285('0x2'));var db=require(_0x2285('0x3'))['db'];var utils=require(_0x2285('0x4'));var logger=require(_0x2285('0x5'))(_0x2285('0x6'));var config=require(_0x2285('0x7'));var jayson=require(_0x2285('0x8'));var client=jayson[_0x2285('0x9')][_0x2285('0xa')]({'port':0x232a});config[_0x2285('0xb')]=_[_0x2285('0xc')](config[_0x2285('0xb')],{'host':_0x2285('0xd'),'port':0x18eb});var socket=require(_0x2285('0xe'))(new Redis(config[_0x2285('0xb')]));require('./chatGroup.socket')[_0x2285('0xf')](socket);function respondWithRpcPromise(_0x54edd9,_0x5aa2ca,_0x2b7b42){return new BPromise(function(_0x113e8a,_0x455958){return client['request'](_0x54edd9,_0x2b7b42)[_0x2285('0x10')](function(_0x13eb79){logger[_0x2285('0x11')](_0x2285('0x12'),_0x5aa2ca,_0x2285('0x13'));logger[_0x2285('0x14')](_0x2285('0x15'),_0x5aa2ca,_0x2285('0x13'),JSON[_0x2285('0x16')](_0x13eb79));if(_0x13eb79[_0x2285('0x17')]){if(_0x13eb79[_0x2285('0x17')]['code']===0x1f4){logger[_0x2285('0x17')](_0x2285('0x12'),_0x5aa2ca,_0x13eb79[_0x2285('0x17')][_0x2285('0x18')]);return _0x455958(_0x13eb79[_0x2285('0x17')][_0x2285('0x18')]);}logger['error'](_0x2285('0x12'),_0x5aa2ca,_0x13eb79[_0x2285('0x17')][_0x2285('0x18')]);return _0x113e8a(_0x13eb79['error'][_0x2285('0x18')]);}else{logger[_0x2285('0x11')](_0x2285('0x12'),_0x5aa2ca,'request\x20sent');_0x113e8a(_0x13eb79[_0x2285('0x19')]['message']);}})[_0x2285('0x1a')](function(_0x885269){logger[_0x2285('0x17')](_0x2285('0x12'),_0x5aa2ca,_0x885269);_0x455958(_0x885269);});});}
\ No newline at end of file
+var _0xac22=['../../config/logger','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x1757f2,_0x1b09fa){var _0x5e7212=function(_0x4f1794){while(--_0x4f1794){_0x1757f2['push'](_0x1757f2['shift']());}};_0x5e7212(++_0x1b09fa);}(_0xac22,0x1c2));var _0x2ac2=function(_0x2c896c,_0x3e9bb2){_0x2c896c=_0x2c896c-0x0;var _0x334914=_0xac22[_0x2c896c];return _0x334914;};'use strict';var _=require(_0x2ac2('0x0'));var util=require(_0x2ac2('0x1'));var moment=require(_0x2ac2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ac2('0x3'));var db=require(_0x2ac2('0x4'))['db'];var utils=require(_0x2ac2('0x5'));var logger=require(_0x2ac2('0x6'))('rpc');var config=require(_0x2ac2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2ac2('0x8')]['http']({'port':0x232a});config['redis']=_[_0x2ac2('0x9')](config[_0x2ac2('0xa')],{'host':_0x2ac2('0xb'),'port':0x18eb});var socket=require(_0x2ac2('0xc'))(new Redis(config[_0x2ac2('0xa')]));require('./chatGroup.socket')[_0x2ac2('0xd')](socket);function respondWithRpcPromise(_0x1f2b5d,_0xa8a868,_0x1232f4){return new BPromise(function(_0x30015c,_0x3fdf3f){return client['request'](_0x1f2b5d,_0x1232f4)[_0x2ac2('0xe')](function(_0x681ddc){logger[_0x2ac2('0xf')](_0x2ac2('0x10'),_0xa8a868,_0x2ac2('0x11'));logger[_0x2ac2('0x12')](_0x2ac2('0x13'),_0xa8a868,_0x2ac2('0x11'),JSON['stringify'](_0x681ddc));if(_0x681ddc[_0x2ac2('0x14')]){if(_0x681ddc[_0x2ac2('0x14')][_0x2ac2('0x15')]===0x1f4){logger[_0x2ac2('0x14')](_0x2ac2('0x10'),_0xa8a868,_0x681ddc[_0x2ac2('0x14')][_0x2ac2('0x16')]);return _0x3fdf3f(_0x681ddc[_0x2ac2('0x14')][_0x2ac2('0x16')]);}logger[_0x2ac2('0x14')]('ChatGroup,\x20%s,\x20%s',_0xa8a868,_0x681ddc['error']['message']);return _0x30015c(_0x681ddc[_0x2ac2('0x14')][_0x2ac2('0x16')]);}else{logger[_0x2ac2('0xf')]('ChatGroup,\x20%s,\x20%s',_0xa8a868,_0x2ac2('0x11'));_0x30015c(_0x681ddc['result'][_0x2ac2('0x16')]);}})[_0x2ac2('0x17')](function(_0x44bdd3){logger['error'](_0x2ac2('0x10'),_0xa8a868,_0x44bdd3);_0x3fdf3f(_0x44bdd3);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index ca87cbd..2bb6d40 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 _0x10a8=['removeListener','length','./chatGroup.events','save','update','emit'];(function(_0x201464,_0x42daed){var _0x47f6fc=function(_0x1c3fb5){while(--_0x1c3fb5){_0x201464['push'](_0x201464['shift']());}};_0x47f6fc(++_0x42daed);}(_0x10a8,0xb0));var _0x810a=function(_0x3b3206,_0x499fc4){_0x3b3206=_0x3b3206-0x0;var _0x196eb3=_0x10a8[_0x3b3206];return _0x196eb3;};'use strict';var ChatGroupEvents=require(_0x810a('0x0'));var events=[_0x810a('0x1'),'remove',_0x810a('0x2')];function createListener(_0x3283f1,_0x70070e){return function(_0x2a7f5c){_0x70070e[_0x810a('0x3')](_0x3283f1,_0x2a7f5c);};}function removeListener(_0x103aa3,_0x44e8a6){return function(){ChatGroupEvents[_0x810a('0x4')](_0x103aa3,_0x44e8a6);};}exports['register']=function(_0x966b3d){for(var _0x49f6ad=0x0,_0x563d01=events[_0x810a('0x5')];_0x49f6ad<_0x563d01;_0x49f6ad++){var _0x3c3fdf=events[_0x49f6ad];var _0x17e1c=createListener('chatGroup:'+_0x3c3fdf,_0x966b3d);ChatGroupEvents['on'](_0x3c3fdf,_0x17e1c);}};
\ No newline at end of file
+var _0x1a74=['remove','update','emit','removeListener','register','length','chatGroup:','./chatGroup.events'];(function(_0x32c154,_0xfd915b){var _0x43a11a=function(_0x4e170c){while(--_0x4e170c){_0x32c154['push'](_0x32c154['shift']());}};_0x43a11a(++_0xfd915b);}(_0x1a74,0x1a7));var _0x41a7=function(_0x3b5dc7,_0x3994fe){_0x3b5dc7=_0x3b5dc7-0x0;var _0x3182cd=_0x1a74[_0x3b5dc7];return _0x3182cd;};'use strict';var ChatGroupEvents=require(_0x41a7('0x0'));var events=['save',_0x41a7('0x1'),_0x41a7('0x2')];function createListener(_0x23eb30,_0x43e1ef){return function(_0x358cea){_0x43e1ef[_0x41a7('0x3')](_0x23eb30,_0x358cea);};}function removeListener(_0x24afa4,_0x16994c){return function(){ChatGroupEvents[_0x41a7('0x4')](_0x24afa4,_0x16994c);};}exports[_0x41a7('0x5')]=function(_0x15f094){for(var _0x272f1c=0x0,_0x46ddb6=events[_0x41a7('0x6')];_0x272f1c<_0x46ddb6;_0x272f1c++){var _0x57ee14=events[_0x272f1c];var _0x37a56c=createListener(_0x41a7('0x7')+_0x57ee14,_0x15f094);ChatGroupEvents['on'](_0x57ee14,_0x37a56c);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 5a5c000..1c08f95 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 _0x1d0d=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','create','addMembers','addMessage','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x5092bf,_0x4b05b7){var _0x37a5a6=function(_0x21b7df){while(--_0x21b7df){_0x5092bf['push'](_0x5092bf['shift']());}};_0x37a5a6(++_0x4b05b7);}(_0x1d0d,0x184));var _0xd1d0=function(_0x2f2b7b,_0x4a3468){_0x2f2b7b=_0x2f2b7b-0x0;var _0x1cc434=_0x1d0d[_0x2f2b7b];return _0x1cc434;};'use strict';var multer=require(_0xd1d0('0x0'));var util=require(_0xd1d0('0x1'));var path=require(_0xd1d0('0x2'));var timeout=require(_0xd1d0('0x3'));var express=require('express');var router=express[_0xd1d0('0x4')]();var fs_extra=require(_0xd1d0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd1d0('0x6'));var config=require(_0xd1d0('0x7'));var controller=require('./chatGroup.controller');router[_0xd1d0('0x8')]('/',auth[_0xd1d0('0x9')](),controller['index']);router[_0xd1d0('0x8')](_0xd1d0('0xa'),auth[_0xd1d0('0x9')](),controller[_0xd1d0('0xb')]);router[_0xd1d0('0x8')](_0xd1d0('0xc'),auth[_0xd1d0('0x9')](),controller[_0xd1d0('0xd')]);router[_0xd1d0('0x8')](_0xd1d0('0xe'),auth['isAuthenticated'](),controller[_0xd1d0('0xf')]);router[_0xd1d0('0x8')](_0xd1d0('0x10'),auth[_0xd1d0('0x9')](),controller['getMembers']);router[_0xd1d0('0x8')](_0xd1d0('0x11'),auth[_0xd1d0('0x9')](),controller[_0xd1d0('0x12')]);router[_0xd1d0('0x13')]('/',auth['isAuthenticated'](),controller[_0xd1d0('0x14')]);router[_0xd1d0('0x13')](_0xd1d0('0x10'),auth['isAuthenticated'](),controller[_0xd1d0('0x15')]);router[_0xd1d0('0x13')](_0xd1d0('0x11'),auth[_0xd1d0('0x9')](),controller[_0xd1d0('0x16')]);router[_0xd1d0('0x17')](_0xd1d0('0xc'),auth[_0xd1d0('0x9')](),controller[_0xd1d0('0x18')]);router[_0xd1d0('0x19')](_0xd1d0('0xc'),auth['isAuthenticated'](),controller[_0xd1d0('0x1a')]);router[_0xd1d0('0x19')](_0xd1d0('0x10'),auth['isAuthenticated'](),controller['removeMembers']);module[_0xd1d0('0x1b')]=router;
\ No newline at end of file
+var _0x4329=['../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','show','/:id/unread','/:id/members','/:id/messages','getMessages','create','post','addMessage','put','update','removeMembers','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x299349,_0x4460fa){var _0x113f9d=function(_0x4a1c2f){while(--_0x4a1c2f){_0x299349['push'](_0x299349['shift']());}};_0x113f9d(++_0x4460fa);}(_0x4329,0x13b));var _0x9432=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x4329[_0x5447fd];return _0x15b28a;};'use strict';var multer=require(_0x9432('0x0'));var util=require(_0x9432('0x1'));var path=require(_0x9432('0x2'));var timeout=require(_0x9432('0x3'));var express=require(_0x9432('0x4'));var router=express[_0x9432('0x5')]();var fs_extra=require(_0x9432('0x6'));var auth=require(_0x9432('0x7'));var interaction=require(_0x9432('0x8'));var config=require(_0x9432('0x9'));var controller=require(_0x9432('0xa'));router[_0x9432('0xb')]('/',auth[_0x9432('0xc')](),controller[_0x9432('0xd')]);router['get'](_0x9432('0xe'),auth['isAuthenticated'](),controller[_0x9432('0xf')]);router[_0x9432('0xb')]('/:id',auth[_0x9432('0xc')](),controller[_0x9432('0x10')]);router[_0x9432('0xb')](_0x9432('0x11'),auth[_0x9432('0xc')](),controller['getUnread']);router[_0x9432('0xb')](_0x9432('0x12'),auth['isAuthenticated'](),controller['getMembers']);router[_0x9432('0xb')](_0x9432('0x13'),auth[_0x9432('0xc')](),controller[_0x9432('0x14')]);router['post']('/',auth[_0x9432('0xc')](),controller[_0x9432('0x15')]);router[_0x9432('0x16')](_0x9432('0x12'),auth[_0x9432('0xc')](),controller['addMembers']);router[_0x9432('0x16')](_0x9432('0x13'),auth['isAuthenticated'](),controller[_0x9432('0x17')]);router[_0x9432('0x18')]('/:id',auth[_0x9432('0xc')](),controller[_0x9432('0x19')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x9432('0x12'),auth[_0x9432('0xc')](),controller[_0x9432('0x1a')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index fa46b92..035652f 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 _0xdbbc=['STRING','long','DATE','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','TEXT'];(function(_0x3a7634,_0x2db384){var _0x23bbe9=function(_0x226734){while(--_0x226734){_0x3a7634['push'](_0x3a7634['shift']());}};_0x23bbe9(++_0x2db384);}(_0xdbbc,0x10c));var _0xcdbb=function(_0x5ca81f,_0x26d64c){_0x5ca81f=_0x5ca81f-0x0;var _0x1ea8be=_0xdbbc[_0x5ca81f];return _0x1ea8be;};'use strict';var Sequelize=require(_0xcdbb('0x0'));module[_0xcdbb('0x1')]={'closed':{'type':Sequelize[_0xcdbb('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xcdbb('0x3')]},'ratingType':{'type':Sequelize[_0xcdbb('0x4')](_0xcdbb('0x5'),'thumb'),'defaultValue':_0xcdbb('0x5')},'ratingMessage':{'type':Sequelize[_0xcdbb('0x6')]},'pathTranscript':{'type':Sequelize[_0xcdbb('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xcdbb('0x7')]},'secondDisposition':{'type':Sequelize[_0xcdbb('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xcdbb('0x7')]},'osName':{'type':Sequelize[_0xcdbb('0x7')]},'osVersion':{'type':Sequelize[_0xcdbb('0x7')]},'deviceModel':{'type':Sequelize[_0xcdbb('0x7')]},'deviceVendor':{'type':Sequelize[_0xcdbb('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xcdbb('0x6')]},'customerIp':{'type':Sequelize[_0xcdbb('0x7')]},'formData':{'type':Sequelize[_0xcdbb('0x6')](_0xcdbb('0x8'))},'read1stAt':{'type':Sequelize[_0xcdbb('0x9')]},'lastMsgAt':{'type':Sequelize[_0xcdbb('0x9')]},'lastMsgDirection':{'type':Sequelize[_0xcdbb('0x4')]('in',_0xcdbb('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xcdbb('0x7')]},'customerPort':{'type':Sequelize[_0xcdbb('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xcdbb('0x6')]}};
\ No newline at end of file
+var _0xf16f=['DATE','ENUM','out','sequelize','exports','BOOLEAN','INTEGER','star','thumb','STRING','TEXT','long'];(function(_0x4c0622,_0x5dacaf){var _0x1799d8=function(_0x2ba801){while(--_0x2ba801){_0x4c0622['push'](_0x4c0622['shift']());}};_0x1799d8(++_0x5dacaf);}(_0xf16f,0x147));var _0xff16=function(_0xc950e1,_0x3de1f0){_0xc950e1=_0xc950e1-0x0;var _0x26f3c5=_0xf16f[_0xc950e1];return _0x26f3c5;};'use strict';var Sequelize=require(_0xff16('0x0'));module[_0xff16('0x1')]={'closed':{'type':Sequelize[_0xff16('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xff16('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0xff16('0x4'),_0xff16('0x5')),'defaultValue':_0xff16('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xff16('0x6')]},'secondDisposition':{'type':Sequelize[_0xff16('0x6')]},'thirdDisposition':{'type':Sequelize[_0xff16('0x6')]},'note':{'type':Sequelize[_0xff16('0x6')]},'browserName':{'type':Sequelize[_0xff16('0x6')]},'browserVersion':{'type':Sequelize[_0xff16('0x6')]},'osName':{'type':Sequelize[_0xff16('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xff16('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xff16('0x6')]},'referer':{'type':Sequelize[_0xff16('0x7')]},'customerIp':{'type':Sequelize[_0xff16('0x6')]},'formData':{'type':Sequelize[_0xff16('0x7')](_0xff16('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xff16('0x9')]},'lastMsgDirection':{'type':Sequelize[_0xff16('0xa')]('in',_0xff16('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xff16('0x6')]},'customerPort':{'type':Sequelize[_0xff16('0x6')]},'vidaooSessionId':{'type':Sequelize[_0xff16('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 6b5bd12..668d149 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 _0x5637=['users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','value','having','`\x20>\x200','Contact','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?','ContactId','buildExpression','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','$substring','text','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','agent','getChatWebsites','role','sequelize','toString','keyBy','merge','ChatInteraction','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','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','groupBy','all','rows','show','rawAttributes','includeAll','include','options','create','catch','update','params','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','Attachment','attachmentDownload','ChatOfflineMessageId','root','join','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','ChatWebsite','Messages','%s%d','agentAlias','System','agentIdentifier','website_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ChatInteractionId','getMyMessages','findAll','setTags','ids','omit','spread','emit','chatInteractionTags:save','removeTags','server','files','tmp','attachments','transcript-%d-%s.zip','lastName','secret','Owner','get','mkdirSync','Chat','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','referer','customerIp','customerPort','tail','existsSync','createWriteStream','out','firstName','renderFile','views','transcript-','.pdf','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatInteraction.socket','register','http','client','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','end','name','render','body','contact','interaction','account','Users','fullname','TagIds','split','Tags','push','index','map','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','select','field','color','from','tools_tags','u.fullname','ui.ChatInteractionId','left_join'];(function(_0x5c9087,_0x4f7f8a){var _0x2c8a69=function(_0x46b66c){while(--_0x46b66c){_0x5c9087['push'](_0x5c9087['shift']());}};_0x2c8a69(++_0x4f7f8a);}(_0x5637,0xd6));var _0x7563=function(_0x281ce6,_0x2d50f2){_0x281ce6=_0x281ce6-0x0;var _0x424048=_0x5637[_0x281ce6];return _0x424048;};'use strict';var emlformat=require(_0x7563('0x0'));var rimraf=require(_0x7563('0x1'));var zipdir=require(_0x7563('0x2'));var jsonpatch=require(_0x7563('0x3'));var rp=require(_0x7563('0x4'));var moment=require(_0x7563('0x5'));var BPromise=require(_0x7563('0x6'));var Mustache=require(_0x7563('0x7'));var util=require('util');var path=require(_0x7563('0x8'));var sox=require(_0x7563('0x9'));var csv=require(_0x7563('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7563('0xb'));var _=require(_0x7563('0xc'));var squel=require(_0x7563('0xd'));var crypto=require(_0x7563('0xe'));var jsforce=require(_0x7563('0xf'));var deskjs=require(_0x7563('0x10'));var toCsv=require(_0x7563('0xa'));var querystring=require(_0x7563('0x11'));var Papa=require(_0x7563('0x12'));var Redis=require(_0x7563('0x13'));var authService=require(_0x7563('0x14'));var qs=require(_0x7563('0x15'));var as=require(_0x7563('0x16'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x7563('0x17'));var logger=require(_0x7563('0x18'))(_0x7563('0x19'));var utils=require(_0x7563('0x1a'));var config=require(_0x7563('0x1b'));var licenseUtil=require(_0x7563('0x1c'));var db=require(_0x7563('0x1d'))['db'];config['redis']=_[_0x7563('0x1e')](config[_0x7563('0x1f')],{'host':'localhost','port':0x18eb});var socket=require(_0x7563('0x20'))(new Redis(config[_0x7563('0x1f')]));require(_0x7563('0x21'))[_0x7563('0x22')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x7563('0x23')]({'port':0x232b});var client9004=jayson[_0x7563('0x24')]['http']({'port':0x232c});function respondWithRpcPromise(_0x5b5121,_0x86a695,_0x57146a,_0x4f1f18){return new BPromise(function(_0x7813f8,_0x54d828){var _0x42847a=_0x4f1f18||client;return _0x42847a[_0x7563('0x25')](_0x5b5121,_0x57146a)['then'](function(_0x62c614){logger[_0x7563('0x26')](_0x7563('0x27'),_0x86a695,_0x7563('0x28'));logger['debug'](_0x7563('0x29'),_0x86a695,_0x7563('0x28'),JSON[_0x7563('0x2a')](_0x62c614));if(_0x62c614[_0x7563('0x2b')]){if(_0x62c614['error'][_0x7563('0x2c')]===0x1f4){logger['error'](_0x7563('0x27'),_0x86a695,_0x62c614[_0x7563('0x2b')][_0x7563('0x2d')]);return _0x54d828(_0x62c614[_0x7563('0x2b')][_0x7563('0x2d')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x86a695,_0x62c614['error'][_0x7563('0x2d')]);return _0x7813f8(_0x62c614[_0x7563('0x2b')][_0x7563('0x2d')]);}else{logger[_0x7563('0x26')](_0x7563('0x27'),_0x86a695,_0x7563('0x28'));_0x7813f8(_0x62c614[_0x7563('0x2e')]['message']);}})['catch'](function(_0x3cc29f){logger[_0x7563('0x2b')](_0x7563('0x27'),_0x86a695,_0x3cc29f);_0x54d828(_0x3cc29f);});});}function respondWithStatusCode(_0x398050,_0x34ba95){_0x34ba95=_0x34ba95||0xcc;return function(_0x2678f6){if(_0x2678f6){return _0x398050[_0x7563('0x2f')](_0x34ba95);}return _0x398050[_0x7563('0x30')](_0x34ba95)['end']();};}function respondWithResult(_0x223ca9,_0x137587){_0x137587=_0x137587||0xc8;return function(_0x5a3638){if(_0x5a3638){return _0x223ca9[_0x7563('0x30')](_0x137587)['json'](_0x5a3638);}};}function respondWithFilteredResult(_0x15da54,_0x1f3b6b){return function(_0xcae00a){if(_0xcae00a){var _0xc36791=typeof _0x1f3b6b[_0x7563('0x31')]===_0x7563('0x32')&&typeof _0x1f3b6b[_0x7563('0x33')]===_0x7563('0x32');var _0x76a3f7=_0xcae00a[_0x7563('0x34')];var _0x2c0391=_0xc36791?0x0:_0x1f3b6b[_0x7563('0x31')];var _0x36a427=_0xc36791?_0xcae00a[_0x7563('0x34')]:_0x1f3b6b['offset']+_0x1f3b6b['limit'];var _0x397382;if(_0x36a427>=_0x76a3f7){_0x36a427=_0x76a3f7;_0x397382=0xc8;}else{_0x397382=0xce;}_0x15da54[_0x7563('0x30')](_0x397382);return _0x15da54[_0x7563('0x35')](_0x7563('0x36'),_0x2c0391+'-'+_0x36a427+'/'+_0x76a3f7)[_0x7563('0x37')](_0xcae00a);}return null;};}function patchUpdates(_0x1f0711){return function(_0x1f52a0){try{jsonpatch['apply'](_0x1f52a0,_0x1f0711,!![]);}catch(_0x4b9abd){return BPromise[_0x7563('0x38')](_0x4b9abd);}return _0x1f52a0[_0x7563('0x39')]();};}function saveUpdates(_0x58bb02,_0x2562e0){return function(_0x3dcbbf){if(_0x3dcbbf){return _0x3dcbbf['update'](_0x58bb02)[_0x7563('0x3a')](function(_0x3dab53){return _0x3dab53;});}return null;};}function removeEntity(_0x89aba,_0x1dcffe){return function(_0x1257a1){if(_0x1257a1){return _0x1257a1[_0x7563('0x3b')]()[_0x7563('0x3a')](function(){_0x89aba[_0x7563('0x30')](0xcc)[_0x7563('0x3c')]();});}};}function handleEntityNotFound(_0x2305ab,_0x50a587){return function(_0x31f230){if(!_0x31f230){_0x2305ab[_0x7563('0x2f')](0x194);}return _0x31f230;};}function handleError(_0x2fef9c,_0x1e7cb3){_0x1e7cb3=_0x1e7cb3||0x1f4;return function(_0xd9756e){logger['error'](_0xd9756e['stack']);if(_0xd9756e['name']){delete _0xd9756e[_0x7563('0x3d')];}_0x2fef9c['status'](_0x1e7cb3)['send'](_0xd9756e);};}function getMustacheRender(_0x572401,_0x19fbe9){return Mustache[_0x7563('0x3e')](_0x572401,_['merge'](_0x19fbe9[_0x7563('0x3f')],{'contact':_0x19fbe9[_0x7563('0x40')],'message':_0x19fbe9[_0x7563('0x2d')],'agent':_0x19fbe9['agent'],'interaction':_0x19fbe9[_0x7563('0x41')],'account':_0x19fbe9[_0x7563('0x42')]}))||'';}function getInteractionUsers(_0x4d3c22,_0x337f6c){return new BPromise(function(_0x2e3085,_0x5e4df2){try{if(_0x337f6c[_0x4d3c22['id']]){_0x4d3c22[_0x7563('0x43')]=_['map'](_0x337f6c[_0x4d3c22['id']],function(_0x36cf07){return{'id':_0x36cf07['id'],'fullname':_0x36cf07[_0x7563('0x44')]};});}}catch(_0x2a0c9e){_0x5e4df2(_0x2a0c9e);}_0x2e3085(_0x4d3c22);});}function getInteractionTags(_0x369ba5,_0x3ecf1b){return new BPromise(function(_0x5e4260,_0x3b9a49){try{if(_0x369ba5['TagIds']){_0x369ba5['Tags']=[];_0x369ba5[_0x7563('0x45')][_0x7563('0x46')](',')['forEach'](function(_0x3eaad0){_0x369ba5[_0x7563('0x47')][_0x7563('0x48')](_0x3ecf1b[_0x3eaad0]);});}delete _0x369ba5[_0x7563('0x45')];}catch(_0x24bfd5){_0x3b9a49(_0x24bfd5);}_0x5e4260(_0x369ba5);});}function updateChatInteraction(_0x356dc0,_0x269d7b,_0x4a7950){return new BPromise(function(_0x52a9d1,_0x4bd037){return getInteractionUsers(_0x356dc0,_0x4a7950)[_0x7563('0x3a')](function(_0x5be2cc){return getInteractionTags(_0x5be2cc,_0x269d7b);})[_0x7563('0x3a')](function(_0x2479b6){_0x52a9d1(_0x2479b6);})['catch'](function(_0x376268){_0x4bd037(_0x376268);});});}exports[_0x7563('0x49')]=function(_0x1d5f3e,_0x313ba9){var _0x5700bd={},_0x4ccf0d={},_0x1193cc={'count':0x0,'rows':[]};var _0x2a4e05=_[_0x7563('0x4a')](db['ChatInteraction']['rawAttributes'],function(_0x59471c){return{'name':_0x59471c['fieldName'],'type':_0x59471c[_0x7563('0x4b')][_0x7563('0x4c')]};});_0x4ccf0d[_0x7563('0x4d')]=_['map'](_0x2a4e05,_0x7563('0x3d'));_0x4ccf0d[_0x7563('0x4e')]=_[_0x7563('0x4f')](_0x1d5f3e['query']);_0x4ccf0d['filters']=_[_0x7563('0x50')](_0x4ccf0d[_0x7563('0x4d')],_0x4ccf0d[_0x7563('0x4e')]);_0x5700bd[_0x7563('0x51')]=_[_0x7563('0x50')](_0x4ccf0d['model'],qs['fields'](_0x1d5f3e[_0x7563('0x4e')][_0x7563('0x52')]));_0x5700bd[_0x7563('0x51')]=_0x5700bd['attributes'][_0x7563('0x53')]?_0x5700bd[_0x7563('0x51')]:_0x4ccf0d[_0x7563('0x4d')];if(!_0x1d5f3e['query'][_0x7563('0x54')](_0x7563('0x55'))){_0x5700bd[_0x7563('0x33')]=qs['limit'](_0x1d5f3e[_0x7563('0x4e')][_0x7563('0x33')]);_0x5700bd[_0x7563('0x31')]=qs[_0x7563('0x31')](_0x1d5f3e[_0x7563('0x4e')][_0x7563('0x31')]);}_0x5700bd[_0x7563('0x56')]=qs['sort'](_0x1d5f3e[_0x7563('0x4e')][_0x7563('0x57')]);_0x5700bd[_0x7563('0x58')]=qs['filters'](_[_0x7563('0x59')](_0x1d5f3e[_0x7563('0x4e')],_0x4ccf0d[_0x7563('0x5a')]),_0x2a4e05);var _0x1f9376=[];var _0x2b17de=squel[_0x7563('0x5b')]()[_0x7563('0x5c')]('id')[_0x7563('0x5c')]('name')[_0x7563('0x5c')](_0x7563('0x5d'))[_0x7563('0x5e')](_0x7563('0x5f'));var _0x478a09=squel[_0x7563('0x5b')]()['field']('u.id')[_0x7563('0x5c')](_0x7563('0x60'))['field'](_0x7563('0x61'))[_0x7563('0x5e')]('user_has_chat_interactions','ui')[_0x7563('0x62')](_0x7563('0x63'),'u','u.id\x20=\x20ui.UserId');var _0x3a4b03=squel[_0x7563('0x5b')]()[_0x7563('0x5e')]('chat_interactions','i')[_0x7563('0x62')](_0x7563('0x64'),'c',_0x7563('0x65'))['left_join']('users','o',_0x7563('0x66'))['left_join']('chat_websites','a',_0x7563('0x67'))['left_join'](_0x7563('0x68'),'me',_0x7563('0x69'))[_0x7563('0x62')](_0x7563('0x6a'),'it','it.ChatInteractionId\x20=\x20i.id')[_0x7563('0x62')](_0x7563('0x5f'),'t',_0x7563('0x6b'));var _0x5a4a5f=squel[_0x7563('0x6c')]();var _0x23c1db=[];var _0x323593=squel[_0x7563('0x6c')]();var _0x1d2c10;if(_0x1d5f3e[_0x7563('0x4e')]['search']){_0x1d2c10=as[_0x7563('0x6d')](_0x1d5f3e[_0x7563('0x4e')][_0x7563('0x6e')]);var _0x4318c4=_0x1d2c10[_0x7563('0x6f')];for(var _0x56399d=0x0;_0x56399d<_0x1d2c10[_0x7563('0x70')]['length'];_0x56399d++){var _0x43dc3f=_0x1d2c10[_0x7563('0x70')][_0x56399d];var _0x34809a='i';var _0x499f44=_[_0x7563('0x71')](_0x2a4e05,['name',_0x43dc3f[_0x7563('0x5c')]]);if(!_0x499f44){switch(_0x43dc3f['field']){case'unreadMessages':if(_0x43dc3f[_0x7563('0x72')]==0x1){_0x3a4b03[_0x7563('0x73')]('`'+_0x43dc3f[_0x7563('0x5c')]+'`\x20=\x200');}else{_0x3a4b03[_0x7563('0x73')]('`'+_0x43dc3f[_0x7563('0x5c')]+_0x7563('0x74'));}break;case _0x7563('0x75'):if(_0x43dc3f['operator']==='$substring'){if(_0x43dc3f[_0x7563('0x72')][_0x7563('0x46')]('\x20')[_0x7563('0x53')]>0x1){_0x5a4a5f[_0x4318c4](_0x7563('0x76'),qs[_0x7563('0x77')](_0x43dc3f[_0x7563('0x72')]),null);}else{var _0x522876='%'+_0x43dc3f['value']+'%';_0x5a4a5f[_0x4318c4](_0x7563('0x78'),_0x522876,_0x522876,_0x522876);}}else{_0x499f44=_['find'](_0x2a4e05,[_0x7563('0x3d'),'ContactId']);_0x43dc3f[_0x7563('0x5c')]=_0x7563('0x79');_0x2737d7=as[_0x7563('0x7a')](_0x34809a,_0x499f44[_0x7563('0x4b')],_0x43dc3f);_0x5a4a5f[_0x4318c4](_0x2737d7['text'],_0x2737d7[_0x7563('0x72')][_0x7563('0x7b')],_0x2737d7[_0x7563('0x72')][_0x7563('0x3c')]);}break;case _0x7563('0x7c'):var _0x30f216=_0x43dc3f['value'][_0x7563('0x46')](',')['map'](function(_0x803076){return Number(_0x803076);});_0x30f216[_0x7563('0x7d')](function(_0x276692){_0x323593['or'](_0x7563('0x7e'),'%,'+_0x276692+',%');});_0x23c1db=_[_0x7563('0x7f')](_0x23c1db,_0x30f216);break;case _0x7563('0x80'):if(_0x43dc3f[_0x7563('0x81')]===_0x7563('0x82')){_0x5a4a5f[_0x4318c4]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x43dc3f[_0x7563('0x72')]+'%',null);}else{_0x499f44=_['find'](_0x2a4e05,[_0x7563('0x3d'),'UserId']);_0x43dc3f[_0x7563('0x5c')]='UserId';_0x2737d7=as['buildExpression'](_0x34809a,_0x499f44[_0x7563('0x4b')],_0x43dc3f);_0x5a4a5f[_0x4318c4](_0x2737d7[_0x7563('0x83')],_0x2737d7[_0x7563('0x72')]['start'],_0x2737d7[_0x7563('0x72')][_0x7563('0x3c')]);}break;case _0x7563('0x3f'):_0x2737d7=as[_0x7563('0x7a')]('me',null,_0x43dc3f);_0x5a4a5f[_0x4318c4](_0x2737d7[_0x7563('0x83')],_0x2737d7['value'][_0x7563('0x7b')],_0x2737d7['value'][_0x7563('0x3c')]);break;}}else{var _0x2737d7=as[_0x7563('0x7a')](_0x34809a,_0x499f44[_0x7563('0x4b')],_0x43dc3f);_0x5a4a5f[_0x4318c4](_0x2737d7[_0x7563('0x83')],_0x2737d7[_0x7563('0x72')]['start'],_0x2737d7[_0x7563('0x72')][_0x7563('0x3c')]);}}}else{var _0xe2f784=_(_0x1d5f3e[_0x7563('0x4e')])['keys']()[_0x7563('0x4a')](function(_0x5e3b2f){return _[_0x7563('0x84')](_0x2a4e05,['name',_0x5e3b2f])?_0x5e3b2f:undefined;})[_0x7563('0x85')]()[_0x7563('0x72')]();if(!_[_0x7563('0x86')](_0xe2f784)){_0xe2f784[_0x7563('0x7d')](function(_0x3c2012){if(_0x3c2012==='ChatWebsiteId'){_0x3a4b03['where'](_0x7563('0x87'),[][_0x7563('0x88')](_0x1d5f3e['query'][_0x3c2012]));}else if(_0x3c2012===_0x7563('0x89')){var _0x5843d5=JSON[_0x7563('0x8a')](_0x1d5f3e[_0x7563('0x4e')][_0x3c2012])[_0x7563('0x8b')];var _0x4ad170=JSON[_0x7563('0x8a')](_0x1d5f3e[_0x7563('0x4e')][_0x3c2012])['$lte'];_0x3a4b03['where'](_0x7563('0x8c'),_0x5843d5,_0x4ad170);}else{if(_0x1d5f3e[_0x7563('0x4e')][_0x3c2012]===_0x7563('0x8d')){_0x3a4b03['where']('i.'+_0x3c2012+_0x7563('0x8e'));}else{_0x3a4b03[_0x7563('0x58')]('i.'+_0x3c2012+_0x7563('0x8f'),_0x1d5f3e[_0x7563('0x4e')][_0x3c2012]);}}});}if(_0x1d5f3e[_0x7563('0x4e')][_0x7563('0x90')]){if(_0x1d5f3e[_0x7563('0x4e')][_0x7563('0x90')]==0x1){_0x3a4b03['having']('`unreadMessages`\x20=\x200');}else{_0x3a4b03[_0x7563('0x73')](_0x7563('0x91'));}}if(_0x1d5f3e[_0x7563('0x4e')][_0x7563('0x92')]){_0x23c1db=_[_0x7563('0x93')](_0x1d5f3e[_0x7563('0x4e')][_0x7563('0x92')])?_0x1d5f3e[_0x7563('0x4e')][_0x7563('0x92')]:new Array(_0x1d5f3e[_0x7563('0x4e')]['tag']);_0x23c1db[_0x7563('0x7d')](function(_0x3df3ca){_0x323593['or'](_0x7563('0x7e'),'%,'+_0x3df3ca+',%');});}if(_0x1d5f3e[_0x7563('0x4e')]['filter']){var _0x40e8b7=_0x1d5f3e['query'][_0x7563('0x94')][_0x7563('0x95')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x7563('0x96')](_0x40e8b7)){_0x5a4a5f['or']('i.id\x20LIKE\x20?',_0x40e8b7+'%');}else{_0x5a4a5f['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x7563('0x77')](_0x40e8b7))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x40e8b7+'%');}}}_0x3a4b03[_0x7563('0x58')](_0x5a4a5f);_0x3a4b03[_0x7563('0x97')](_0x7563('0x98'));var _0x392f35={'type':db[_0x7563('0x99')][_0x7563('0x9a')][_0x7563('0x9b')],'raw':!![]};var _0xc4615b=_0x3a4b03[_0x7563('0x9c')]();_0xc4615b['field'](_0x7563('0x98'));_0xc4615b[_0x7563('0x5c')](_0x7563('0x9d'),_0x7563('0x9e'));if(_0x5700bd[_0x7563('0x56')]){_0x5700bd[_0x7563('0x56')][_0x7563('0x7d')](function(_0x7dc11){var _0x3057c7=_0x7dc11[0x0]===_0x7563('0x9f')?_0x7dc11[0x0]:'i.'+_0x7dc11[0x0];_0x3a4b03[_0x7563('0x56')](_0x3057c7,_0x7dc11[0x1]===_0x7563('0xa0')?![]:!![]);});}if(!_[_0x7563('0x86')](_0x23c1db)){_0x3a4b03['having'](_0x323593);_0xc4615b[_0x7563('0x58')](_0x7563('0xa1'),_0x23c1db);}BPromise[_0x7563('0xa2')]()[_0x7563('0x3a')](function(){if(!_0x1d2c10){if(_0x1d5f3e[_0x7563('0x4e')][_0x7563('0xa3')])return;_0xc4615b[_0x7563('0x58')](_0x7563('0xa4'));_0x3a4b03['where'](_0x7563('0xa4'));return;}if(_0x1d5f3e[_0x7563('0xa5')]['role']!==_0x7563('0xa6'))return;return _0x1d5f3e['user'][_0x7563('0xa7')]({'attributes':['id'],'raw':!![]})[_0x7563('0x3a')](function(_0x182d2f){if(_['isEmpty'](_0x182d2f)){_0xc4615b['where']('i.ChatWebsiteId\x20IS\x20NULL');_0x3a4b03[_0x7563('0x58')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0xc4615b[_0x7563('0x58')]('i.ChatWebsiteId\x20IN\x20?',_[_0x7563('0x4a')](_0x182d2f,'id'));_0x3a4b03[_0x7563('0x58')](_0x7563('0x87'),_[_0x7563('0x4a')](_0x182d2f,'id'));}});})[_0x7563('0x3a')](function(){if(_0x1d5f3e[_0x7563('0xa5')][_0x7563('0xa8')]==='agent'&&!_0x1d2c10&&!_0x1d5f3e[_0x7563('0x4e')][_0x7563('0xa3')])return[];return db[_0x7563('0xa9')][_0x7563('0x4e')](_0xc4615b[_0x7563('0xaa')](),_0x392f35);})[_0x7563('0x3a')](function(_0x1d06b5){_0x1193cc[_0x7563('0x34')]=_0x1d06b5[_0x7563('0x53')];if(_0x1193cc[_0x7563('0x34')]===0x0)return[];return db[_0x7563('0xa9')][_0x7563('0x4e')](_0x2b17de[_0x7563('0xaa')](),_0x392f35)[_0x7563('0x3a')](function(_0x4add75){_0x1f9376=_[_0x7563('0xab')](_0x4add75,'id');_0x392f35=_[_0x7563('0xac')](_0x392f35,{'model':db[_0x7563('0xad')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1d5f3e['query']['fields']){_0x5700bd[_0x7563('0x51')][_0x7563('0x7d')](function(_0x3e9e92){_0x3a4b03['field']('i.'+_0x3e9e92);});}else{_0x3a4b03[_0x7563('0x5c')](_0x7563('0x9d'),_0x7563('0x9e'));_0x3a4b03['field']('a.key',_0x7563('0xae'));_0x3a4b03['field'](_0x7563('0xaf'),_0x7563('0xb0'));_0x3a4b03[_0x7563('0x5c')](_0x7563('0xb1'),'contactName');_0x3a4b03[_0x7563('0x5c')](_0x7563('0xb2'));_0x3a4b03[_0x7563('0x5c')](_0x7563('0xb3'),'Contact.firstName');_0x3a4b03[_0x7563('0x5c')]('c.lastName',_0x7563('0xb4'));_0x3a4b03[_0x7563('0x5c')](_0x7563('0xb5'),_0x7563('0xb6'));_0x3a4b03[_0x7563('0x5c')](_0x7563('0xb7'),'Contact.phone');_0x3a4b03[_0x7563('0x5c')](_0x7563('0xb8'),_0x7563('0xb9'));_0x3a4b03[_0x7563('0x5c')](_0x7563('0xba'),_0x7563('0xbb'));_0x3a4b03[_0x7563('0x5c')]('o.fullname','Owner.fullname');_0x3a4b03['field'](_0x7563('0xbc'),_0x7563('0xbd'));_0x3a4b03['field']('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x5700bd[_0x7563('0x33')])_0x3a4b03['limit'](_0x5700bd[_0x7563('0x33')]);if(_0x5700bd[_0x7563('0x31')])_0x3a4b03['offset'](_0x5700bd[_0x7563('0x31')]);return db[_0x7563('0xa9')]['query'](_0x3a4b03[_0x7563('0xaa')](),_0x392f35);})[_0x7563('0x3a')](function(_0x4c1808){if(_0x4c1808['length']>0x0)_0x478a09['where']('ui.ChatInteractionId\x20IN\x20?',_[_0x7563('0x4a')](_0x4c1808,'id'));return db[_0x7563('0xa9')]['query'](_0x478a09[_0x7563('0xaa')](),_0x392f35)[_0x7563('0x3a')](function(_0x1c7b4e){var _0x17d28b=_[_0x7563('0xbe')](_0x1c7b4e,'ChatInteractionId');var _0x5a7acb=[];_0x4c1808['forEach'](function(_0x1147c5){_0x5a7acb[_0x7563('0x48')](updateChatInteraction(_0x1147c5,_0x1f9376,_0x17d28b));});return BPromise[_0x7563('0xbf')](_0x5a7acb);});});})[_0x7563('0x3a')](function(_0x403c5b){_0x1193cc[_0x7563('0xc0')]=_0x403c5b;return _0x1193cc;})[_0x7563('0x3a')](respondWithFilteredResult(_0x313ba9,_0x5700bd))['catch'](handleError(_0x313ba9,null));};exports[_0x7563('0xc1')]=function(_0x2c7e03,_0x268909){var _0x436faf={'raw':![],'where':{'id':_0x2c7e03['params']['id']}},_0x3cbf15={};_0x3cbf15[_0x7563('0x4d')]=_['keys'](db[_0x7563('0xad')][_0x7563('0xc2')]);_0x3cbf15[_0x7563('0x4e')]=_[_0x7563('0x4f')](_0x2c7e03[_0x7563('0x4e')]);_0x3cbf15['filters']=_[_0x7563('0x50')](_0x3cbf15[_0x7563('0x4d')],_0x3cbf15[_0x7563('0x4e')]);_0x436faf[_0x7563('0x51')]=_[_0x7563('0x50')](_0x3cbf15[_0x7563('0x4d')],qs[_0x7563('0x52')](_0x2c7e03['query']['fields']));_0x436faf[_0x7563('0x51')]=_0x436faf['attributes']['length']?_0x436faf['attributes']:_0x3cbf15[_0x7563('0x4d')];if(_0x2c7e03[_0x7563('0x4e')][_0x7563('0xc3')]){_0x436faf[_0x7563('0xc4')]=[{'all':!![]}];}_0x436faf=_[_0x7563('0xac')]({},_0x436faf,_0x2c7e03[_0x7563('0xc5')]);return db[_0x7563('0xad')][_0x7563('0x71')](_0x436faf)[_0x7563('0x3a')](handleEntityNotFound(_0x268909,null))[_0x7563('0x3a')](respondWithResult(_0x268909,null))['catch'](handleError(_0x268909,null));};exports[_0x7563('0xc6')]=function(_0x55c1e8,_0x439821){return db['ChatInteraction'][_0x7563('0xc6')](_0x55c1e8[_0x7563('0x3f')],{})[_0x7563('0x3a')](respondWithResult(_0x439821,0xc9))[_0x7563('0xc7')](handleError(_0x439821,null));};exports[_0x7563('0xc8')]=function(_0x42133b,_0x4b6754){if(_0x42133b[_0x7563('0x3f')]['id']){delete _0x42133b['body']['id'];}return db[_0x7563('0xad')]['find']({'where':{'id':_0x42133b[_0x7563('0xc9')]['id']}})[_0x7563('0x3a')](handleEntityNotFound(_0x4b6754,null))[_0x7563('0x3a')](saveUpdates(_0x42133b[_0x7563('0x3f')],null))[_0x7563('0x3a')](respondWithResult(_0x4b6754,null))[_0x7563('0xc7')](handleError(_0x4b6754,null));};exports[_0x7563('0x3b')]=function(_0x46062e,_0x2256ec){return db['ChatInteraction']['find']({'where':{'id':_0x46062e[_0x7563('0xc9')]['id']}})[_0x7563('0x3a')](handleEntityNotFound(_0x2256ec,null))[_0x7563('0x3a')](removeEntity(_0x2256ec,null))['catch'](handleError(_0x2256ec,null));};exports[_0x7563('0xca')]=function(_0x2f3e7b,_0xb14f47){return db[_0x7563('0xad')][_0x7563('0xca')]()[_0x7563('0x3a')](respondWithResult(_0xb14f47,null))[_0x7563('0xc7')](handleError(_0xb14f47,null));};exports[_0x7563('0xcb')]=function(_0x49d69a,_0x16ee76){var _0x855207=_0x49d69a['params']['id'];var _0x410e7d;var _0x240051;var _0x1ddd27;return db[_0x7563('0xad')][_0x7563('0xcc')]({'where':{'id':_0x855207}})[_0x7563('0x3a')](function(_0x3a5843){_0x410e7d=_0x3a5843;return db['ChatWebsite'][_0x7563('0xcc')]({'where':{'id':_0x3a5843[_0x7563('0xa3')]},'attributes':['id',_0x7563('0xcd'),_0x7563('0xce'),_0x7563('0xcf'),_0x7563('0xd0'),'vidaooMetadata'],'raw':!![]});})[_0x7563('0x3a')](function(_0x548143){if(_0x548143&&_0x548143['vidaooApiKey']&&_0x548143[_0x7563('0xce')]){_0x240051=_0x548143;var _0x49d7f2={'interaction':{'id':_0x855207},'agent':{'id':_0x49d69a[_0x7563('0xa5')]['id'],'name':_0x49d69a[_0x7563('0xa5')][_0x7563('0x3d')],'fullname':_0x49d69a['user'][_0x7563('0x44')],'email':_0x49d69a[_0x7563('0xa5')][_0x7563('0xd1')]},'contact':_0x49d69a[_0x7563('0x3f')][_0x7563('0x40')],'account':_0x49d69a[_0x7563('0x3f')][_0x7563('0x42')]};var _0x2c5e9d={'rejectUnauthorized':![],'method':'POST','url':_0x7563('0xd2'),'headers':{'X-APIKEY':_0x548143[_0x7563('0xcd')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x49d69a[_0x7563('0xa5')][_0x7563('0xd1')]],'buttons':null,'topic':_0x240051['vidaooTopic'],'note':_[_0x7563('0xd3')](_0x240051[_0x7563('0xd0')])?null:getMustacheRender(_0x240051[_0x7563('0xd0')],_0x49d7f2),'metadata':null},'redirect':_0x7563('0xd4'),'json':!![]};try{if(!_[_0x7563('0xd3')](_0x240051[_0x7563('0xd5')])){var _0x15a960=getMustacheRender(_0x240051['vidaooMetadata'],_0x49d7f2);var _0x470dcd=JSON['parse'](_0x15a960);_0x2c5e9d[_0x7563('0x3f')]['metadata']=_0x470dcd;}}catch(_0x951eec){throw new db[(_0x7563('0x99'))][(_0x7563('0xd6'))](_0x7563('0xd7'));}return rp(_0x2c5e9d);}else{throw new db['Sequelize'][(_0x7563('0xd6'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x7563('0x3a')](function(_0x38d2e5){_0x1ddd27=_0x38d2e5;if(_0x1ddd27['id']){var _0x2cfe86={'body':_0x1ddd27['join_url'],'ChatWebsiteId':_0x240051['id'],'ChatInteractionId':_0x410e7d['id'],'direction':'out','UserId':_0x49d69a[_0x7563('0xa5')]['id']};return db[_0x7563('0xd8')][_0x7563('0xc6')](_0x2cfe86,{});}else{throw new db[(_0x7563('0x99'))][(_0x7563('0xd6'))](_0x7563('0xd9'));}})['then'](function(){return _0x410e7d[_0x7563('0xda')]({'vidaooSessionId':_0x1ddd27['id']});})[_0x7563('0x3a')](respondWithResult(_0x16ee76,null))[_0x7563('0xc7')](handleError(_0x16ee76,null));};exports[_0x7563('0xdb')]=function(_0x16df25,_0x1cd406){if(_0x16df25[_0x7563('0x3f')]['id']){delete _0x16df25['body']['id'];}return db['ChatInteraction'][_0x7563('0x71')]({'where':{'id':_0x16df25['params']['id']},'include':[{'model':db[_0x7563('0xdc')],'as':_0x7563('0x75')}]})[_0x7563('0x3a')](handleEntityNotFound(_0x1cd406,null))[_0x7563('0x3a')](saveUpdates(_0x16df25[_0x7563('0x3f')],null))[_0x7563('0x3a')](respondWithResult(_0x1cd406,null))[_0x7563('0xc7')](handleError(_0x1cd406,null));};exports[_0x7563('0xdd')]=function(_0x4310e9,_0x1670b9,_0x1a23df){if(_0x4310e9[_0x7563('0x3f')]['id']){delete _0x4310e9['body']['id'];}return db[_0x7563('0xad')][_0x7563('0x71')]({'where':{'id':_0x4310e9[_0x7563('0xc9')]['id']}})['then'](function(_0x4fb7ec){if(!_0x4fb7ec){logger[_0x7563('0x2b')](_0x7563('0xde'),'abandon',0x194,_0x7563('0xdf'));_0x1670b9[_0x7563('0x2f')](0x194);}else{if(_0x4fb7ec[_0x7563('0xe0')]){throw new db['Sequelize'][(_0x7563('0xd6'))](_0x7563('0xe1'));}}return _0x4fb7ec;})[_0x7563('0x3a')](function(_0x3906ec){if(_0x3906ec){return _0x3906ec[_0x7563('0xc8')]({'closed':_0x4310e9[_0x7563('0x3f')][_0x7563('0xe2')],'disposition':_0x4310e9[_0x7563('0x3f')][_0x7563('0xe3')]})[_0x7563('0x3a')](function(_0x317622){return _0x317622;});}})[_0x7563('0x3a')](function(_0x3448c1){return respondWithRpcPromise(_0x7563('0xe4'),_0x7563('0xdd'),_0x4310e9[_0x7563('0x3f')],client9004);})[_0x7563('0x3a')](respondWithResult(_0x1670b9,null))[_0x7563('0xc7')](handleError(_0x1670b9,null));};exports[_0x7563('0xe5')]=function(_0x50d774,_0x469550,_0x1570a4){_0x50d774[_0x7563('0x3f')][_0x7563('0x3d')]=_0x50d774['file'][_0x7563('0xe6')];_0x50d774[_0x7563('0x3f')][_0x7563('0xe7')]=_0x50d774[_0x7563('0xe8')][_0x7563('0xe9')];_0x50d774[_0x7563('0x3f')][_0x7563('0x4b')]=_0x50d774[_0x7563('0xe8')][_0x7563('0xea')];return db[_0x7563('0xeb')]['create'](_0x50d774[_0x7563('0x3f')])[_0x7563('0x3a')](respondWithResult(_0x469550,0xc9))[_0x7563('0xc7')](handleError(_0x469550,null));};exports[_0x7563('0xec')]=function(_0x25119f,_0x55d4e5,_0x4b725d){return db[_0x7563('0xad')]['findOne']({'where':{'id':_0x25119f[_0x7563('0xc9')]['id']},'raw':!![]})[_0x7563('0x3a')](handleEntityNotFound(_0x55d4e5,null))[_0x7563('0x3a')](function(_0x1d1ed0){if(_0x1d1ed0){if(_0x1d1ed0[_0x7563('0xe2')]){return _0x55d4e5['status'](0x193)[_0x7563('0x37')]({'status':0x193,'message':'Unauthorized'});}return db[_0x7563('0xeb')][_0x7563('0xcc')]({'where':{'id':_0x25119f[_0x7563('0x4e')]['attachId']},'raw':!![]})[_0x7563('0x3a')](handleEntityNotFound(_0x55d4e5,null));}})[_0x7563('0x3a')](function(_0x56dd6f){if(_0x56dd6f){var _0x4db0a6=_0x56dd6f[_0x7563('0xed')]!==null;var _0xadff04=path['join'](config[_0x7563('0xee')],'server/files/attachments/');if(_0x4db0a6){_0xadff04=path[_0x7563('0xef')](_0xadff04,_0x7563('0xf0'));}var _0x40db33=path[_0x7563('0xef')](_0xadff04,_0x56dd6f[_0x7563('0xe7')]);return _0x55d4e5[_0x7563('0xf1')](_0x40db33);}})['catch'](handleError(_0x55d4e5,null));};exports[_0x7563('0xf2')]=function(_0x2e769a,_0x125fad){var _0x5c8259=null;var _0x5eca1d=null;var _0x33bab1=null;var _0x2cc552=null;if(_0x2e769a[_0x7563('0x3f')]['id']){delete _0x2e769a[_0x7563('0x3f')]['id'];}if(_0x2e769a[_0x7563('0x3f')][_0x7563('0xf3')]){_0x2cc552=path[_0x7563('0xef')](config[_0x7563('0xee')],_0x7563('0xf4'),util[_0x7563('0xf5')]('transcript-%s.txt',Date[_0x7563('0xf6')]()));_0x2e769a[_0x7563('0x3f')][_0x7563('0xf7')]=_0x2cc552;}return db['ChatInteraction'][_0x7563('0x71')]({'where':{'id':_0x2e769a[_0x7563('0xc9')]['id']},'include':[{'model':db[_0x7563('0xd8')],'as':'Messages','include':[{'model':db['User'],'as':'User'}]}]})[_0x7563('0x3a')](handleEntityNotFound(_0x125fad,null))[_0x7563('0x3a')](saveUpdates(_0x2e769a[_0x7563('0x3f')],null))[_0x7563('0x3a')](function(_0x356df7){if(_0x356df7){_0x5c8259=_0x356df7;return db[_0x7563('0xf8')][_0x7563('0x71')]({'where':{'id':_0x5c8259[_0x7563('0xa3')]}});}})[_0x7563('0x3a')](function(_0x46542d){if(_0x46542d){_0x33bab1=_0x46542d;return db[_0x7563('0xdc')][_0x7563('0x71')]({'where':{'id':_0x5c8259[_0x7563('0x79')]}});}})[_0x7563('0x3a')](function(_0x5f0ed1){if(_0x5f0ed1){_0x5eca1d=_0x5f0ed1;if(_0x2cc552){var _0x33362e=null;for(var _0x3fe546=0x1;_0x3fe546<_0x5c8259[_0x7563('0xf9')][_0x7563('0x53')];++_0x3fe546){_0x33362e=_0x5c8259[_0x7563('0xf9')][_0x3fe546];var _0x20b3ed=_0x33362e[_0x7563('0xe0')]?util[_0x7563('0xf5')](_0x7563('0xfa'),_0x33bab1[_0x7563('0xfb')],_0x33362e['UserId']):_0x7563('0xfc');var _0x5516f4=_0x2e769a['body']['customer']||util[_0x7563('0xf5')]('%s%d','Visitor',_0x33362e['ContactId']);switch(_0x33bab1[_0x7563('0xfd')]){case _0x7563('0xfe'):_0x20b3ed=_0x33362e[_0x7563('0xe0')]?util['format']('%s%d',_0x33bab1[_0x7563('0xfb')],_0x33362e[_0x7563('0xe0')]):_0x7563('0xfc');break;case'agent_alias':_0x20b3ed=_0x33362e[_0x7563('0xe0')]?_0x33362e[_0x7563('0x80')][_0x7563('0xff')]||_0x33362e[_0x7563('0x80')]['fullname']:'System';break;case _0x7563('0x100'):_0x20b3ed=_0x33362e['UserId']?_0x33362e['User']['fullname']:'System';break;default:_0x20b3ed=_0x33362e[_0x7563('0xe0')]?util[_0x7563('0xf5')](_0x7563('0xfa'),_0x33bab1[_0x7563('0xfb')],_0x33362e['UserId']):_0x7563('0xfc');}var _0xa83934=util['format'](_0x7563('0x101'),moment(_0x33362e[_0x7563('0x89')])[_0x7563('0xf5')]('MM/DD/YYYY\x20HH:mm:ss'),_0x33362e[_0x7563('0x102')]==='in'?_0x5516f4:_0x20b3ed,_0x33362e[_0x7563('0x3f')]);if(!_0x33362e['secret']){fs[_0x7563('0x103')](_0x2cc552,_0xa83934);}}return db[_0x7563('0x104')][_0x7563('0xcc')]({'where':{'service':!![]},'include':[{'model':db[_0x7563('0x105')],'as':_0x7563('0x106'),'raw':!![]}]});}}})[_0x7563('0x3a')](function(_0x1dd3aa){if(_0x1dd3aa&&_0x1dd3aa['Smtp']&&_0x2e769a['body']){var _0x1e37eb={'tls':{'rejectUnauthorized':![]}};if(_0x1dd3aa[_0x7563('0x106')][_0x7563('0x107')]){_0x1e37eb[_0x7563('0x107')]=_0x1dd3aa['Smtp'][_0x7563('0x107')];}else{_0x1e37eb[_0x7563('0x108')]=_0x1dd3aa[_0x7563('0x106')]['host'];_0x1e37eb[_0x7563('0x109')]=_0x1dd3aa['Smtp'][_0x7563('0x109')];_0x1e37eb[_0x7563('0x10a')]=_0x1dd3aa[_0x7563('0x106')]['secure'];}if(_0x1dd3aa[_0x7563('0x106')][_0x7563('0x10b')]){_0x1e37eb[_0x7563('0x10c')]={'user':_0x1dd3aa[_0x7563('0x106')]['user'],'pass':_0x1dd3aa[_0x7563('0x106')][_0x7563('0x10d')]};}return respondWithRpcPromise(_0x7563('0x10e'),'sendMail',{'account':_0x1e37eb,'message':{'from':util[_0x7563('0xf5')](_0x7563('0x10f'),_0x1dd3aa[_0x7563('0x3d')],_0x1dd3aa[_0x7563('0xd1')]||_0x1dd3aa[_0x7563('0x106')][_0x7563('0xa5')]),'to':_0x2e769a[_0x7563('0x3f')][_0x7563('0xf3')],'subject':'Mail\x20Transcript','text':util[_0x7563('0xf5')](_0x7563('0x110'),_0x2e769a[_0x7563('0x3f')]['mailTranscript']),'attachments':[{'path':_0x2cc552}]}})[_0x7563('0x3a')](function(){return _0x5c8259;})[_0x7563('0xc7')](function(_0x405c5d){console[_0x7563('0x2b')](_0x405c5d);});}else{return _0x5c8259;}})[_0x7563('0x3a')](respondWithStatusCode(_0x125fad,0xc8))[_0x7563('0xc7')](handleError(_0x125fad,null));};exports[_0x7563('0x111')]=function(_0x539c09,_0x1803af,_0x4d3d5f){return db[_0x7563('0xd8')][_0x7563('0x71')]({'where':{'id':_0x539c09['params']['id']}})[_0x7563('0x3a')](handleEntityNotFound(_0x1803af,null))['then'](function(_0x4aa4a4){if(_0x4aa4a4){return _0x4aa4a4[_0x7563('0x111')](_0x539c09['body']['ids'],_['omit'](_0x539c09['body'],['ids','id'])||{});}})[_0x7563('0x3a')](respondWithResult(_0x1803af,null))['catch'](handleError(_0x1803af,null));};exports['getMessages']=function(_0x11645b,_0xc01201,_0x5c965a){var _0x55eaf7={'raw':![],'where':{}};var _0x385909={};var _0x41f2d6={'count':0x0,'rows':[]};return db[_0x7563('0xad')][_0x7563('0xcc')]({'where':{'id':_0x11645b[_0x7563('0xc9')]['id']}})[_0x7563('0x3a')](handleEntityNotFound(_0xc01201,null))[_0x7563('0x3a')](function(_0x323777){if(_0x323777){_0x385909[_0x7563('0x4d')]=_['keys'](db['ChatMessage'][_0x7563('0xc2')]);_0x385909[_0x7563('0x4e')]=_[_0x7563('0x4f')](_0x11645b[_0x7563('0x4e')]);_0x385909['filters']=_[_0x7563('0x50')](_0x385909[_0x7563('0x4d')],_0x385909[_0x7563('0x4e')]);_0x55eaf7[_0x7563('0x51')]=_[_0x7563('0x50')](_0x385909[_0x7563('0x4d')],qs[_0x7563('0x52')](_0x11645b['query'][_0x7563('0x52')]));_0x55eaf7[_0x7563('0x51')]=_0x55eaf7[_0x7563('0x51')][_0x7563('0x53')]?_0x55eaf7[_0x7563('0x51')]:_0x385909['model'];if(!_0x11645b[_0x7563('0x4e')]['hasOwnProperty']('nolimit')){_0x55eaf7[_0x7563('0x33')]=qs['limit'](_0x11645b['query']['limit']);_0x55eaf7[_0x7563('0x31')]=qs[_0x7563('0x31')](_0x11645b[_0x7563('0x4e')]['offset']);}_0x55eaf7['order']=qs[_0x7563('0x57')](_0x11645b[_0x7563('0x4e')][_0x7563('0x57')]);_0x55eaf7[_0x7563('0x58')]=qs['filters'](_[_0x7563('0x59')](_0x11645b['query'],_0x385909[_0x7563('0x5a')]));_0x55eaf7[_0x7563('0x58')][_0x7563('0x112')]=_0x323777['id'];if(_0x11645b[_0x7563('0x4e')][_0x7563('0x94')]){_0x55eaf7[_0x7563('0x58')]=_[_0x7563('0xac')](_0x55eaf7[_0x7563('0x58')],{'$or':_[_0x7563('0x4a')](_0x55eaf7['attributes'],function(_0x51a3fc){var _0x1fc25f={};_0x1fc25f[_0x51a3fc]={'$like':'%'+_0x11645b[_0x7563('0x4e')][_0x7563('0x94')]+'%'};return _0x1fc25f;})});}if(_0x11645b[_0x7563('0x4e')][_0x7563('0x8b')]){var _0x2d988a=_0x11645b[_0x7563('0x4e')][_0x7563('0x8b')]['split'](',');var _0x5b09d9={};_0x5b09d9[_0x2d988a[0x0]]={'$gte':moment(_0x2d988a[0x1])[_0x7563('0xf5')]('YYYY-MM-DD\x20HH:mm:ss')};_0x55eaf7[_0x7563('0x58')]=_[_0x7563('0xac')](_0x55eaf7['where'],_0x5b09d9);}_0x55eaf7=_[_0x7563('0xac')]({},_0x55eaf7,_0x11645b[_0x7563('0xc5')]);return db[_0x7563('0xd8')][_0x7563('0x34')]({'where':_0x55eaf7[_0x7563('0x58')]})[_0x7563('0x3a')](function(_0x5c9f24){_0x41f2d6[_0x7563('0x34')]=_0x5c9f24;if(_0x11645b['query'][_0x7563('0xc3')]){_0x55eaf7[_0x7563('0xc4')]=[{'all':!![]}];}return db[_0x7563('0xd8')]['findAll'](_0x55eaf7);})['then'](function(_0x3e1b69){_0x41f2d6[_0x7563('0xc0')]=_0x3e1b69;return _0x41f2d6;});}})['then'](respondWithFilteredResult(_0xc01201,_0x55eaf7))['catch'](handleError(_0xc01201,null));};exports[_0x7563('0x113')]=function(_0x4f66a9,_0x2c122d,_0x3e6b3b){var _0x56b01a={'where':{}},_0xa4a0de={},_0x34c089={'count':0x0,'rows':[]};return db[_0x7563('0xad')][_0x7563('0xcc')]({'where':{'id':_0x4f66a9[_0x7563('0xc9')]['id']}})['then'](handleEntityNotFound(_0x2c122d,null))[_0x7563('0x3a')](function(_0x56b24f){if(_0x56b24f){_0xa4a0de[_0x7563('0x4d')]=_[_0x7563('0x4f')](db['ChatMessage'][_0x7563('0xc2')]);_0xa4a0de[_0x7563('0x4e')]=_[_0x7563('0x4f')](_0x4f66a9[_0x7563('0x4e')]);_0xa4a0de[_0x7563('0x5a')]=_[_0x7563('0x50')](_0xa4a0de[_0x7563('0x4d')],_0xa4a0de[_0x7563('0x4e')]);_0x56b01a['attributes']=_[_0x7563('0x50')](_0xa4a0de[_0x7563('0x4d')],qs[_0x7563('0x52')](_0x4f66a9['query'][_0x7563('0x52')]));_0x56b01a[_0x7563('0x51')]=_0x56b01a['attributes'][_0x7563('0x53')]?_0x56b01a[_0x7563('0x51')]:_0xa4a0de['model'];if(!_0x4f66a9['query']['hasOwnProperty']('nolimit')){_0x56b01a['limit']=qs['limit'](_0x4f66a9[_0x7563('0x4e')][_0x7563('0x33')]);_0x56b01a[_0x7563('0x31')]=qs['offset'](_0x4f66a9[_0x7563('0x4e')][_0x7563('0x31')]);}_0x56b01a['order']=qs['sort'](_0x4f66a9['query'][_0x7563('0x57')]);_0x56b01a[_0x7563('0x58')]=qs[_0x7563('0x5a')](_[_0x7563('0x59')](_0x4f66a9['query'],_0xa4a0de[_0x7563('0x5a')]));_0x56b01a[_0x7563('0x58')][_0x7563('0x112')]=_0x56b24f['id'];if(_0x4f66a9[_0x7563('0x4e')][_0x7563('0x94')]){_0x56b01a['where']=_[_0x7563('0xac')](_0x56b01a[_0x7563('0x58')],{'$or':_[_0x7563('0x4a')](_0x56b01a[_0x7563('0x51')],function(_0x36d485){var _0x1156b5={};_0x1156b5[_0x36d485]={'$like':'%'+_0x4f66a9['query'][_0x7563('0x94')]+'%'};return _0x1156b5;})});}_0x56b01a[_0x7563('0x58')]['secret']=![];if(_0x4f66a9[_0x7563('0x4e')]['id']){_0x56b01a[_0x7563('0x58')]['id']={'$gt':_0x4f66a9['query']['id']};}_0x56b01a=_[_0x7563('0xac')]({},_0x56b01a,_0x4f66a9[_0x7563('0xc5')]);return db[_0x7563('0xd8')][_0x7563('0x34')]({'where':_0x56b01a[_0x7563('0x58')]})[_0x7563('0x3a')](function(_0x2b1729){_0x34c089[_0x7563('0x34')]=_0x2b1729;_0x56b01a[_0x7563('0xc4')]=[];if(_0x4f66a9[_0x7563('0x4e')]['includeAgent']){_0x56b01a[_0x7563('0xc4')]['push']({'model':db[_0x7563('0x80')],'as':_0x7563('0x80'),'attributes':['id',_0x7563('0x44'),_0x7563('0xff')]});}if(_0x4f66a9['query'][_0x7563('0xc3')]){_0x56b01a[_0x7563('0xc4')]=[{'all':!![]}];}return db[_0x7563('0xd8')][_0x7563('0x114')](_0x56b01a);})['then'](function(_0x1eba58){_0x34c089[_0x7563('0xc0')]=_0x1eba58;return _0x34c089;});}})[_0x7563('0x3a')](respondWithFilteredResult(_0x2c122d,_0x56b01a))[_0x7563('0xc7')](handleError(_0x2c122d,null));};exports['addTags']=function(_0x202891,_0x118451,_0x5ad1ef){return db[_0x7563('0xad')][_0x7563('0x71')]({'where':{'id':_0x202891[_0x7563('0xc9')]['id']}})[_0x7563('0x3a')](handleEntityNotFound(_0x118451,null))[_0x7563('0x3a')](function(_0x2977ee){if(_0x2977ee){return _0x2977ee[_0x7563('0x115')](_0x202891[_0x7563('0x3f')][_0x7563('0x116')],_[_0x7563('0x117')](_0x202891[_0x7563('0x3f')],[_0x7563('0x116'),'id'])||{})[_0x7563('0x118')](function(){return db[_0x7563('0x7c')]['findAll']({'attributes':['id',_0x7563('0x3d'),_0x7563('0x5d')],'where':{'id':_0x202891[_0x7563('0x3f')][_0x7563('0x116')]}});})['then'](function(_0x19f7e1){socket[_0x7563('0x119')](_0x7563('0x11a'),{'id':Number(_0x202891[_0x7563('0xc9')]['id']),'tags':_0x19f7e1||[]});return{'id':Number(_0x202891[_0x7563('0xc9')]['id']),'tags':_0x19f7e1||[]};});}})[_0x7563('0x3a')](respondWithResult(_0x118451,null))[_0x7563('0xc7')](handleError(_0x118451,null));};exports[_0x7563('0x11b')]=function(_0x39b3de,_0x582ec,_0x5a4973){return db[_0x7563('0xad')][_0x7563('0x71')]({'where':{'id':_0x39b3de[_0x7563('0xc9')]['id']}})[_0x7563('0x3a')](handleEntityNotFound(_0x582ec,null))[_0x7563('0x3a')](function(_0x258055){if(_0x258055){return _0x258055[_0x7563('0x11b')](_0x39b3de[_0x7563('0x4e')][_0x7563('0x116')]);}})[_0x7563('0x3a')](respondWithStatusCode(_0x582ec,null))[_0x7563('0xc7')](handleError(_0x582ec,null));};exports[_0x7563('0xf1')]=function(_0x4618cb,_0x1d678a){var _0x46a7e0=moment()['unix']()[_0x7563('0xaa')]();var _0x54db48=path[_0x7563('0xef')](config[_0x7563('0xee')],_0x7563('0x11c'),_0x7563('0x11d'),_0x7563('0x11e'));var _0x9b48cd=path[_0x7563('0xef')](config[_0x7563('0xee')],'server','files',_0x7563('0x11f'));var _0x1d00da=path[_0x7563('0xef')](_0x54db48,_0x46a7e0);var _0xfcaff=util[_0x7563('0xf5')](_0x7563('0x120'),_0x4618cb[_0x7563('0xc9')]['id'],_0x46a7e0);var _0x1c1f07=path[_0x7563('0xef')](_0x54db48,_0xfcaff);var _0x20fbf2=[];_0x20fbf2[_0x7563('0x48')]({'model':db[_0x7563('0x80')],'as':_0x7563('0x80'),'attributes':['id','fullname'],'raw':!![]});_0x20fbf2[_0x7563('0x48')]({'model':db[_0x7563('0xdc')],'as':_0x7563('0x75'),'attributes':['id','firstName',_0x7563('0x121')],'raw':!![]});if(_0x4618cb[_0x7563('0x4e')][_0x7563('0x11f')]){_0x20fbf2[_0x7563('0x48')]({'model':db[_0x7563('0xeb')],'as':_0x7563('0xeb'),'raw':!![]});}var _0xbbb338=[{'model':db[_0x7563('0xd8')],'as':_0x7563('0xf9'),'attributes':['id',_0x7563('0x3f'),_0x7563('0x89'),'direction',_0x7563('0x122'),_0x7563('0x90')],'include':_0x20fbf2}];_0xbbb338[_0x7563('0x48')]({'model':db[_0x7563('0xf8')],'as':'Account','attributes':['id',_0x7563('0x3d')]});_0xbbb338[_0x7563('0x48')]({'model':db[_0x7563('0x80')],'as':_0x7563('0x123'),'attributes':['id',_0x7563('0x44')]});return db[_0x7563('0xad')][_0x7563('0x71')]({'where':{'id':_0x4618cb[_0x7563('0xc9')]['id']},'include':_0xbbb338})[_0x7563('0x3a')](handleEntityNotFound(_0x1d678a,null))[_0x7563('0x3a')](function(_0x140c6a){if(_0x140c6a){var _0x5ee527=_0x140c6a[_0x7563('0x124')]({'plain':!![]});fs[_0x7563('0x125')](_0x1d00da);var _0x2862d1={'channel':_0x7563('0x126'),'account':_0x5ee527[_0x7563('0x127')][_0x7563('0x3d')],'agent':_0x5ee527[_0x7563('0x123')]?_0x5ee527['Owner'][_0x7563('0x44')]:_0x7563('0x128'),'createdAt':moment(_0x5ee527[_0x7563('0x89')])[_0x7563('0xf5')](_0x7563('0x129'))[_0x7563('0xaa')](),'closedAt':_0x5ee527[_0x7563('0xe2')]?moment(_0x5ee527[_0x7563('0x12a')])[_0x7563('0xf5')](_0x7563('0x129'))[_0x7563('0xaa')]():'','disposition':_0x5ee527[_0x7563('0xe3')],'chatInfo':{'browser':_0x5ee527['browserName'],'os':_0x5ee527['osName'],'referer':_0x5ee527[_0x7563('0x12b')],'customerIp':_0x5ee527[_0x7563('0x12c')],'customerPort':_0x5ee527[_0x7563('0x12d')]?_0x5ee527[_0x7563('0x12d')]:'N.A.'},'messages':_(_0x5ee527['Messages'])[_0x7563('0x12e')]()[_0x7563('0x94')]({'secret':![]})[_0x7563('0x4a')](function(_0x392b27){if(_0x392b27[_0x7563('0xeb')]){var _0x3b0792=path[_0x7563('0xef')](_0x9b48cd,_0x392b27[_0x7563('0xeb')][_0x7563('0xe7')]);if(fs[_0x7563('0x12f')](_0x3b0792)){fs['createReadStream'](_0x3b0792)['pipe'](fs[_0x7563('0x130')](path['join'](_0x1d00da,_0x392b27['Attachment'][_0x7563('0xe7')])));}}return{'date':moment(_0x392b27[_0x7563('0x89')])[_0x7563('0xf5')](_0x7563('0x129'))[_0x7563('0xaa')](),'sender':_0x392b27[_0x7563('0x102')]===_0x7563('0x131')?_0x392b27[_0x7563('0x80')]?_0x392b27['User'][_0x7563('0x44')]:_0x7563('0xfc'):_0x392b27['Contact'][_0x7563('0x132')]+(_0x392b27[_0x7563('0x75')]['lastName']?'\x20'+_0x392b27[_0x7563('0x75')][_0x7563('0x121')]:''),'body':_0x392b27[_0x7563('0xeb')]?_0x392b27[_0x7563('0xeb')]['basename']:_0x392b27[_0x7563('0x3f')],'direction':_0x392b27['direction']==='out'?'A':'C','secret':_0x392b27[_0x7563('0x122')],'read':_0x392b27[_0x7563('0x90')],'attachment':_0x392b27[_0x7563('0xeb')]};})[_0x7563('0x72')]()};return ejs[_0x7563('0x133')](path['join'](config['root'],_0x7563('0x11c'),_0x7563('0x134'),'downloadInteraction.html'),{'interaction':_0x2862d1})[_0x7563('0x3a')](function(_0x346354){var _0x16c46c=path[_0x7563('0xef')](_0x1d00da,_0x7563('0x135')+_0x5ee527['id']+'-'+_0x46a7e0+_0x7563('0x136'));var _0x513a34={'path':_0x16c46c,'channel':_0x7563('0x126'),'interactionId':_0x5ee527['id']};return pdf['createPdfFromHTML'](_0x346354,_0x513a34);})[_0x7563('0x3a')](function(){return new BPromise(function(_0x2e3e5,_0x48d2b7){zipdir(_0x1d00da,{'saveTo':_0x1c1f07},function(_0x2fbafc,_0x2a4dbc){if(_0x2fbafc)return _0x48d2b7(_0x2fbafc);return _0x2e3e5(_0x2a4dbc);});})[_0x7563('0x3a')](function(){return new BPromise(function(_0x1c8e61,_0x2c3150){rimraf(_0x1d00da,function(_0x536b54){if(_0x536b54)_0x2c3150(_0x536b54);return _0x1c8e61();});});})[_0x7563('0x3a')](function(){return _0x1d678a['download'](_0x1c1f07,_0xfcaff,function(_0x5c7987){if(_0x5c7987){console['log'](_0x7563('0x137'),_0x5c7987);}else{fs[_0x7563('0x138')](_0x1c1f07);}});});});}else{return _0x1d678a[_0x7563('0x2f')](0xc8);}})[_0x7563('0xc7')](handleError(_0x1d678a,null));};
\ No newline at end of file
+var _0xb537=['hasOwnProperty','nolimit','order','sort','select','field','from','tools_tags','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','users','left_join','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','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','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?','ContactId','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','toString','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.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','o.fullname','Owner.fullname','Owner.internal','groupBy','ChatInteractionId','all','params','includeAll','options','create','describe','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','isNull','metadata','ValidationError','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','filename','mimetype','Attachment','Unauthorized','attachId','ChatOfflineMessageId','root','server/files/attachments/','offline-chat/','download','mailTranscript','join','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','CmContact','Messages','%s%d','agentAlias','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','System','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailServerOut','Smtp','service','host','port','secure','auth','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','ids','omit','getMessages','pick','include','findAll','rows','includeAgent','alias','addTags','setTags','emit','chatInteractionTags:save','removeTags','unix','tmp','files','attachments','firstName','lastName','direction','Account','Owner','get','mkdirSync','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','referer','customerPort','tail','basename','existsSync','pipe','createWriteStream','renderFile','server','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','merge','body','contact','agent','account','Users','map','fullname','TagIds','split','push','index','ChatInteraction','rawAttributes','type','key','query','keys','filters','attributes','intersection','fields','length','model'];(function(_0x678e88,_0x595a83){var _0x3d35f4=function(_0x18aa59){while(--_0x18aa59){_0x678e88['push'](_0x678e88['shift']());}};_0x3d35f4(++_0x595a83);}(_0xb537,0xdb));var _0x7b53=function(_0x47d5d4,_0x34b2bc){_0x47d5d4=_0x47d5d4-0x0;var _0x2e6dd6=_0xb537[_0x47d5d4];return _0x2e6dd6;};'use strict';var emlformat=require(_0x7b53('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b53('0x1'));var jsonpatch=require(_0x7b53('0x2'));var rp=require(_0x7b53('0x3'));var moment=require('moment');var BPromise=require(_0x7b53('0x4'));var Mustache=require(_0x7b53('0x5'));var util=require(_0x7b53('0x6'));var path=require(_0x7b53('0x7'));var sox=require(_0x7b53('0x8'));var csv=require(_0x7b53('0x9'));var ejs=require(_0x7b53('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b53('0xb'));var squel=require(_0x7b53('0xc'));var crypto=require('crypto');var jsforce=require(_0x7b53('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7b53('0xe'));var Papa=require(_0x7b53('0xf'));var Redis=require(_0x7b53('0x10'));var authService=require(_0x7b53('0x11'));var qs=require(_0x7b53('0x12'));var as=require(_0x7b53('0x13'));var pdf=require(_0x7b53('0x14'));var hardwareService=require(_0x7b53('0x15'));var logger=require(_0x7b53('0x16'))(_0x7b53('0x17'));var utils=require(_0x7b53('0x18'));var config=require(_0x7b53('0x19'));var licenseUtil=require(_0x7b53('0x1a'));var db=require(_0x7b53('0x1b'))['db'];config[_0x7b53('0x1c')]=_[_0x7b53('0x1d')](config[_0x7b53('0x1c')],{'host':_0x7b53('0x1e'),'port':0x18eb});var socket=require(_0x7b53('0x1f'))(new Redis(config[_0x7b53('0x1c')]));require(_0x7b53('0x20'))[_0x7b53('0x21')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7b53('0x22')]['http']({'port':0x232b});var client9004=jayson[_0x7b53('0x22')][_0x7b53('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x1af064,_0x4f9988,_0x5daa2a,_0x3ed967){return new BPromise(function(_0x4fb699,_0x266873){var _0x53a28a=_0x3ed967||client;return _0x53a28a[_0x7b53('0x24')](_0x1af064,_0x5daa2a)['then'](function(_0xc82456){logger[_0x7b53('0x25')](_0x7b53('0x26'),_0x4f9988,_0x7b53('0x27'));logger[_0x7b53('0x28')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x4f9988,_0x7b53('0x27'),JSON['stringify'](_0xc82456));if(_0xc82456[_0x7b53('0x29')]){if(_0xc82456[_0x7b53('0x29')][_0x7b53('0x2a')]===0x1f4){logger[_0x7b53('0x29')](_0x7b53('0x26'),_0x4f9988,_0xc82456[_0x7b53('0x29')][_0x7b53('0x2b')]);return _0x266873(_0xc82456[_0x7b53('0x29')][_0x7b53('0x2b')]);}logger['error'](_0x7b53('0x26'),_0x4f9988,_0xc82456['error'][_0x7b53('0x2b')]);return _0x4fb699(_0xc82456[_0x7b53('0x29')][_0x7b53('0x2b')]);}else{logger[_0x7b53('0x25')](_0x7b53('0x26'),_0x4f9988,'request\x20sent');_0x4fb699(_0xc82456['result'][_0x7b53('0x2b')]);}})[_0x7b53('0x2c')](function(_0x4d93f9){logger[_0x7b53('0x29')](_0x7b53('0x26'),_0x4f9988,_0x4d93f9);_0x266873(_0x4d93f9);});});}function respondWithStatusCode(_0x5509cc,_0x1cda2b){_0x1cda2b=_0x1cda2b||0xcc;return function(_0x2e2593){if(_0x2e2593){return _0x5509cc[_0x7b53('0x2d')](_0x1cda2b);}return _0x5509cc[_0x7b53('0x2e')](_0x1cda2b)[_0x7b53('0x2f')]();};}function respondWithResult(_0x51f29e,_0x5bc2a3){_0x5bc2a3=_0x5bc2a3||0xc8;return function(_0x207bfe){if(_0x207bfe){return _0x51f29e[_0x7b53('0x2e')](_0x5bc2a3)[_0x7b53('0x30')](_0x207bfe);}};}function respondWithFilteredResult(_0x34cac3,_0x3846fd){return function(_0xfeeffc){if(_0xfeeffc){var _0x5bcedc=typeof _0x3846fd[_0x7b53('0x31')]===_0x7b53('0x32')&&typeof _0x3846fd[_0x7b53('0x33')]===_0x7b53('0x32');var _0x8f7337=_0xfeeffc[_0x7b53('0x34')];var _0x1e2ff0=_0x5bcedc?0x0:_0x3846fd[_0x7b53('0x31')];var _0x3b2375=_0x5bcedc?_0xfeeffc[_0x7b53('0x34')]:_0x3846fd[_0x7b53('0x31')]+_0x3846fd[_0x7b53('0x33')];var _0x4eda26;if(_0x3b2375>=_0x8f7337){_0x3b2375=_0x8f7337;_0x4eda26=0xc8;}else{_0x4eda26=0xce;}_0x34cac3['status'](_0x4eda26);return _0x34cac3[_0x7b53('0x35')](_0x7b53('0x36'),_0x1e2ff0+'-'+_0x3b2375+'/'+_0x8f7337)[_0x7b53('0x30')](_0xfeeffc);}return null;};}function patchUpdates(_0x53d59b){return function(_0x411f5c){try{jsonpatch[_0x7b53('0x37')](_0x411f5c,_0x53d59b,!![]);}catch(_0x598551){return BPromise[_0x7b53('0x38')](_0x598551);}return _0x411f5c[_0x7b53('0x39')]();};}function saveUpdates(_0x2840c3,_0x4460b2){return function(_0x498373){if(_0x498373){return _0x498373[_0x7b53('0x3a')](_0x2840c3)[_0x7b53('0x3b')](function(_0x12b448){return _0x12b448;});}return null;};}function removeEntity(_0x321b2d,_0xdaeb4e){return function(_0x227356){if(_0x227356){return _0x227356[_0x7b53('0x3c')]()['then'](function(){_0x321b2d[_0x7b53('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fe71e,_0x56e2c5){return function(_0x4d5ee3){if(!_0x4d5ee3){_0x4fe71e[_0x7b53('0x2d')](0x194);}return _0x4d5ee3;};}function handleError(_0xd0605f,_0x2e7418){_0x2e7418=_0x2e7418||0x1f4;return function(_0x3b0cbb){logger['error'](_0x3b0cbb[_0x7b53('0x3d')]);if(_0x3b0cbb[_0x7b53('0x3e')]){delete _0x3b0cbb[_0x7b53('0x3e')];}_0xd0605f['status'](_0x2e7418)[_0x7b53('0x3f')](_0x3b0cbb);};}function getMustacheRender(_0x4481b2,_0x488ffd){return Mustache['render'](_0x4481b2,_[_0x7b53('0x40')](_0x488ffd[_0x7b53('0x41')],{'contact':_0x488ffd[_0x7b53('0x42')],'message':_0x488ffd[_0x7b53('0x2b')],'agent':_0x488ffd[_0x7b53('0x43')],'interaction':_0x488ffd['interaction'],'account':_0x488ffd[_0x7b53('0x44')]}))||'';}function getInteractionUsers(_0x19fefe,_0xb92a43){return new BPromise(function(_0x68bb86,_0x40c07e){try{if(_0xb92a43[_0x19fefe['id']]){_0x19fefe[_0x7b53('0x45')]=_[_0x7b53('0x46')](_0xb92a43[_0x19fefe['id']],function(_0x3ab6a3){return{'id':_0x3ab6a3['id'],'fullname':_0x3ab6a3[_0x7b53('0x47')]};});}}catch(_0x583b36){_0x40c07e(_0x583b36);}_0x68bb86(_0x19fefe);});}function getInteractionTags(_0x24cb2b,_0x56a17e){return new BPromise(function(_0x3e0374,_0x1c74d5){try{if(_0x24cb2b[_0x7b53('0x48')]){_0x24cb2b['Tags']=[];_0x24cb2b['TagIds'][_0x7b53('0x49')](',')['forEach'](function(_0x22bfb4){_0x24cb2b['Tags'][_0x7b53('0x4a')](_0x56a17e[_0x22bfb4]);});}delete _0x24cb2b[_0x7b53('0x48')];}catch(_0x1b693e){_0x1c74d5(_0x1b693e);}_0x3e0374(_0x24cb2b);});}function updateChatInteraction(_0x1456ed,_0x4dea74,_0x3acf99){return new BPromise(function(_0x49bee5,_0x452836){return getInteractionUsers(_0x1456ed,_0x3acf99)['then'](function(_0x3403dc){return getInteractionTags(_0x3403dc,_0x4dea74);})[_0x7b53('0x3b')](function(_0x57b3d2){_0x49bee5(_0x57b3d2);})[_0x7b53('0x2c')](function(_0x424204){_0x452836(_0x424204);});});}exports[_0x7b53('0x4b')]=function(_0x4f0ba4,_0x3f0cd5){var _0x23aff2={},_0x144d6b={},_0x3ecf4b={'count':0x0,'rows':[]};var _0x39a1ca=_[_0x7b53('0x46')](db[_0x7b53('0x4c')][_0x7b53('0x4d')],function(_0x1f0de6){return{'name':_0x1f0de6['fieldName'],'type':_0x1f0de6[_0x7b53('0x4e')][_0x7b53('0x4f')]};});_0x144d6b['model']=_[_0x7b53('0x46')](_0x39a1ca,'name');_0x144d6b[_0x7b53('0x50')]=_[_0x7b53('0x51')](_0x4f0ba4[_0x7b53('0x50')]);_0x144d6b[_0x7b53('0x52')]=_['intersection'](_0x144d6b['model'],_0x144d6b['query']);_0x23aff2[_0x7b53('0x53')]=_[_0x7b53('0x54')](_0x144d6b['model'],qs['fields'](_0x4f0ba4[_0x7b53('0x50')][_0x7b53('0x55')]));_0x23aff2[_0x7b53('0x53')]=_0x23aff2[_0x7b53('0x53')][_0x7b53('0x56')]?_0x23aff2[_0x7b53('0x53')]:_0x144d6b[_0x7b53('0x57')];if(!_0x4f0ba4[_0x7b53('0x50')][_0x7b53('0x58')](_0x7b53('0x59'))){_0x23aff2[_0x7b53('0x33')]=qs[_0x7b53('0x33')](_0x4f0ba4[_0x7b53('0x50')][_0x7b53('0x33')]);_0x23aff2[_0x7b53('0x31')]=qs[_0x7b53('0x31')](_0x4f0ba4[_0x7b53('0x50')][_0x7b53('0x31')]);}_0x23aff2[_0x7b53('0x5a')]=qs[_0x7b53('0x5b')](_0x4f0ba4[_0x7b53('0x50')][_0x7b53('0x5b')]);_0x23aff2['where']=qs[_0x7b53('0x52')](_['pick'](_0x4f0ba4[_0x7b53('0x50')],_0x144d6b[_0x7b53('0x52')]),_0x39a1ca);var _0x25c76a=[];var _0x38b916=squel[_0x7b53('0x5c')]()[_0x7b53('0x5d')]('id')[_0x7b53('0x5d')]('name')[_0x7b53('0x5d')]('color')[_0x7b53('0x5e')](_0x7b53('0x5f'));var _0x2ef1b3=squel[_0x7b53('0x5c')]()[_0x7b53('0x5d')]('u.id')['field'](_0x7b53('0x60'))[_0x7b53('0x5d')](_0x7b53('0x61'))[_0x7b53('0x5e')](_0x7b53('0x62'),'ui')['left_join'](_0x7b53('0x63'),'u','u.id\x20=\x20ui.UserId');var _0x945a1d=squel[_0x7b53('0x5c')]()['from']('chat_interactions','i')[_0x7b53('0x64')](_0x7b53('0x65'),'c',_0x7b53('0x66'))['left_join'](_0x7b53('0x63'),'o',_0x7b53('0x67'))[_0x7b53('0x64')](_0x7b53('0x68'),'a',_0x7b53('0x69'))['left_join'](_0x7b53('0x6a'),'me',_0x7b53('0x6b'))[_0x7b53('0x64')]('chat_interaction_has_tags','it',_0x7b53('0x6c'))['left_join']('tools_tags','t',_0x7b53('0x6d'));var _0x813bac=squel[_0x7b53('0x6e')]();var _0x3bc640=[];var _0x470326=squel[_0x7b53('0x6e')]();var _0x4d8d86;if(_0x4f0ba4['query']['search']){_0x4d8d86=as[_0x7b53('0x6f')](_0x4f0ba4[_0x7b53('0x50')]['search']);var _0xb5fbfe=_0x4d8d86[_0x7b53('0x70')];for(var _0xc5517c=0x0;_0xc5517c<_0x4d8d86[_0x7b53('0x71')][_0x7b53('0x56')];_0xc5517c++){var _0x22a53b=_0x4d8d86['conditions'][_0xc5517c];var _0x2ae13e='i';var _0xc7eb34=_[_0x7b53('0x72')](_0x39a1ca,[_0x7b53('0x3e'),_0x22a53b[_0x7b53('0x5d')]]);if(!_0xc7eb34){switch(_0x22a53b['field']){case _0x7b53('0x73'):if(_0x22a53b[_0x7b53('0x74')]==0x1){_0x945a1d[_0x7b53('0x75')]('`'+_0x22a53b[_0x7b53('0x5d')]+'`\x20=\x200');}else{_0x945a1d[_0x7b53('0x75')]('`'+_0x22a53b[_0x7b53('0x5d')]+_0x7b53('0x76'));}break;case _0x7b53('0x77'):if(_0x22a53b[_0x7b53('0x78')]===_0x7b53('0x79')){if(_0x22a53b[_0x7b53('0x74')]['split']('\x20')[_0x7b53('0x56')]>0x1){_0x813bac[_0xb5fbfe](_0x7b53('0x7a'),qs[_0x7b53('0x7b')](_0x22a53b[_0x7b53('0x74')]),null);}else{var _0x1a34e0='%'+_0x22a53b['value']+'%';_0x813bac[_0xb5fbfe](_0x7b53('0x7c'),_0x1a34e0,_0x1a34e0,_0x1a34e0);}}else{_0xc7eb34=_[_0x7b53('0x72')](_0x39a1ca,['name',_0x7b53('0x7d')]);_0x22a53b[_0x7b53('0x5d')]='ContactId';_0xd3087e=as['buildExpression'](_0x2ae13e,_0xc7eb34[_0x7b53('0x4e')],_0x22a53b);_0x813bac[_0xb5fbfe](_0xd3087e[_0x7b53('0x7e')],_0xd3087e[_0x7b53('0x74')][_0x7b53('0x7f')],_0xd3087e['value'][_0x7b53('0x2f')]);}break;case _0x7b53('0x80'):var _0x1ac6c6=_0x22a53b['value'][_0x7b53('0x49')](',')[_0x7b53('0x46')](function(_0x433081){return Number(_0x433081);});_0x1ac6c6[_0x7b53('0x81')](function(_0x3111f0){_0x470326['or'](_0x7b53('0x82'),'%,'+_0x3111f0+',%');});_0x3bc640=_[_0x7b53('0x83')](_0x3bc640,_0x1ac6c6);break;case _0x7b53('0x84'):if(_0x22a53b[_0x7b53('0x78')]===_0x7b53('0x79')){_0x813bac[_0xb5fbfe](_0x7b53('0x85'),'%'+_0x22a53b['value']+'%',null);}else{_0xc7eb34=_['find'](_0x39a1ca,['name','UserId']);_0x22a53b['field']=_0x7b53('0x86');_0xd3087e=as['buildExpression'](_0x2ae13e,_0xc7eb34[_0x7b53('0x4e')],_0x22a53b);_0x813bac[_0xb5fbfe](_0xd3087e['text'],_0xd3087e['value'][_0x7b53('0x7f')],_0xd3087e['value']['end']);}break;case _0x7b53('0x41'):_0xd3087e=as['buildExpression']('me',null,_0x22a53b);_0x813bac[_0xb5fbfe](_0xd3087e[_0x7b53('0x7e')],_0xd3087e[_0x7b53('0x74')][_0x7b53('0x7f')],_0xd3087e['value']['end']);break;}}else{var _0xd3087e=as[_0x7b53('0x87')](_0x2ae13e,_0xc7eb34['type'],_0x22a53b);_0x813bac[_0xb5fbfe](_0xd3087e[_0x7b53('0x7e')],_0xd3087e[_0x7b53('0x74')][_0x7b53('0x7f')],_0xd3087e[_0x7b53('0x74')]['end']);}}}else{var _0x4773e8=_(_0x4f0ba4[_0x7b53('0x50')])[_0x7b53('0x51')]()[_0x7b53('0x46')](function(_0xea8848){return _[_0x7b53('0x88')](_0x39a1ca,['name',_0xea8848])?_0xea8848:undefined;})[_0x7b53('0x89')]()[_0x7b53('0x74')]();if(!_['isEmpty'](_0x4773e8)){_0x4773e8[_0x7b53('0x81')](function(_0x17a1ca){if(_0x17a1ca===_0x7b53('0x8a')){_0x945a1d['where'](_0x7b53('0x8b'),[][_0x7b53('0x8c')](_0x4f0ba4[_0x7b53('0x50')][_0x17a1ca]));}else if(_0x17a1ca===_0x7b53('0x8d')){var _0x7cc2f=JSON[_0x7b53('0x8e')](_0x4f0ba4['query'][_0x17a1ca])[_0x7b53('0x8f')];var _0x54b43c=JSON[_0x7b53('0x8e')](_0x4f0ba4[_0x7b53('0x50')][_0x17a1ca])['$lte'];_0x945a1d[_0x7b53('0x90')](_0x7b53('0x91'),_0x7cc2f,_0x54b43c);}else{if(_0x4f0ba4[_0x7b53('0x50')][_0x17a1ca]===_0x7b53('0x92')){_0x945a1d[_0x7b53('0x90')]('i.'+_0x17a1ca+_0x7b53('0x93'));}else{_0x945a1d[_0x7b53('0x90')]('i.'+_0x17a1ca+_0x7b53('0x94'),_0x4f0ba4[_0x7b53('0x50')][_0x17a1ca]);}}});}if(_0x4f0ba4[_0x7b53('0x50')][_0x7b53('0x95')]){if(_0x4f0ba4[_0x7b53('0x50')][_0x7b53('0x95')]==0x1){_0x945a1d[_0x7b53('0x75')]('`unreadMessages`\x20=\x200');}else{_0x945a1d['having'](_0x7b53('0x96'));}}if(_0x4f0ba4[_0x7b53('0x50')]['tag']){_0x3bc640=_[_0x7b53('0x97')](_0x4f0ba4['query'][_0x7b53('0x98')])?_0x4f0ba4[_0x7b53('0x50')][_0x7b53('0x98')]:new Array(_0x4f0ba4[_0x7b53('0x50')][_0x7b53('0x98')]);_0x3bc640[_0x7b53('0x81')](function(_0x5cc8ef){_0x470326['or'](_0x7b53('0x82'),'%,'+_0x5cc8ef+',%');});}if(_0x4f0ba4[_0x7b53('0x50')][_0x7b53('0x99')]){var _0x28c5b9=_0x4f0ba4[_0x7b53('0x50')][_0x7b53('0x99')][_0x7b53('0x9a')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x7b53('0x9b')](_0x28c5b9)){_0x813bac['or']('i.id\x20LIKE\x20?',_0x28c5b9+'%');}else{_0x813bac['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x28c5b9))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x28c5b9+'%');}}}_0x945a1d[_0x7b53('0x90')](_0x813bac);_0x945a1d['group'](_0x7b53('0x9c'));var _0x2186b7={'type':db[_0x7b53('0x9d')]['QueryTypes'][_0x7b53('0x9e')],'raw':!![]};var _0x1706a6=_0x945a1d['clone']();_0x1706a6[_0x7b53('0x5d')](_0x7b53('0x9c'));_0x1706a6[_0x7b53('0x5d')](_0x7b53('0x9f'),_0x7b53('0x73'));if(_0x23aff2[_0x7b53('0x5a')]){_0x23aff2[_0x7b53('0x5a')][_0x7b53('0x81')](function(_0x3ba64f){var _0x1de2d8=_0x3ba64f[0x0]===_0x7b53('0xa0')?_0x3ba64f[0x0]:'i.'+_0x3ba64f[0x0];_0x945a1d[_0x7b53('0x5a')](_0x1de2d8,_0x3ba64f[0x1]===_0x7b53('0xa1')?![]:!![]);});}if(!_['isEmpty'](_0x3bc640)){_0x945a1d['having'](_0x470326);_0x1706a6[_0x7b53('0x90')](_0x7b53('0xa2'),_0x3bc640);}BPromise[_0x7b53('0xa3')]()[_0x7b53('0x3b')](function(){if(!_0x4d8d86){if(_0x4f0ba4['query'][_0x7b53('0x8a')])return;_0x1706a6['where'](_0x7b53('0xa4'));_0x945a1d[_0x7b53('0x90')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x4f0ba4[_0x7b53('0xa5')]['role']!=='agent')return;return _0x4f0ba4['user'][_0x7b53('0xa6')]({'attributes':['id'],'raw':!![]})[_0x7b53('0x3b')](function(_0x531119){if(_['isEmpty'](_0x531119)){_0x1706a6[_0x7b53('0x90')](_0x7b53('0xa7'));_0x945a1d[_0x7b53('0x90')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x1706a6[_0x7b53('0x90')](_0x7b53('0x8b'),_[_0x7b53('0x46')](_0x531119,'id'));_0x945a1d[_0x7b53('0x90')](_0x7b53('0x8b'),_[_0x7b53('0x46')](_0x531119,'id'));}});})[_0x7b53('0x3b')](function(){if(_0x4f0ba4['user'][_0x7b53('0xa8')]===_0x7b53('0x43')&&!_0x4d8d86&&!_0x4f0ba4[_0x7b53('0x50')]['ChatWebsiteId'])return[];return db[_0x7b53('0xa9')]['query'](_0x1706a6[_0x7b53('0xaa')](),_0x2186b7);})[_0x7b53('0x3b')](function(_0x4c6347){_0x3ecf4b[_0x7b53('0x34')]=_0x4c6347[_0x7b53('0x56')];if(_0x3ecf4b[_0x7b53('0x34')]===0x0)return[];return db['sequelize'][_0x7b53('0x50')](_0x38b916['toString'](),_0x2186b7)[_0x7b53('0x3b')](function(_0x31266e){_0x25c76a=_['keyBy'](_0x31266e,'id');_0x2186b7=_['merge'](_0x2186b7,{'model':db[_0x7b53('0x4c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4f0ba4[_0x7b53('0x50')]['fields']){_0x23aff2[_0x7b53('0x53')][_0x7b53('0x81')](function(_0x345a3c){_0x945a1d[_0x7b53('0x5d')]('i.'+_0x345a3c);});}else{_0x945a1d['field'](_0x7b53('0x9f'),_0x7b53('0x73'));_0x945a1d[_0x7b53('0x5d')]('a.key',_0x7b53('0xab'));_0x945a1d[_0x7b53('0x5d')](_0x7b53('0xac'),_0x7b53('0xad'));_0x945a1d[_0x7b53('0x5d')](_0x7b53('0xae'),'contactName');_0x945a1d[_0x7b53('0x5d')](_0x7b53('0xaf'));_0x945a1d[_0x7b53('0x5d')]('c.firstName',_0x7b53('0xb0'));_0x945a1d[_0x7b53('0x5d')](_0x7b53('0xb1'),_0x7b53('0xb2'));_0x945a1d[_0x7b53('0x5d')](_0x7b53('0xb3'),_0x7b53('0xb4'));_0x945a1d[_0x7b53('0x5d')](_0x7b53('0xb5'),_0x7b53('0xb6'));_0x945a1d[_0x7b53('0x5d')]('c.mobile','Contact.mobile');_0x945a1d['field']('c.fax','Contact.fax');_0x945a1d[_0x7b53('0x5d')](_0x7b53('0xb7'),_0x7b53('0xb8'));_0x945a1d['field']('o.internal',_0x7b53('0xb9'));_0x945a1d[_0x7b53('0x5d')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x7b53('0x48'));}if(_0x23aff2[_0x7b53('0x33')])_0x945a1d['limit'](_0x23aff2[_0x7b53('0x33')]);if(_0x23aff2[_0x7b53('0x31')])_0x945a1d[_0x7b53('0x31')](_0x23aff2[_0x7b53('0x31')]);return db['sequelize']['query'](_0x945a1d[_0x7b53('0xaa')](),_0x2186b7);})['then'](function(_0xfc443b){if(_0xfc443b['length']>0x0)_0x2ef1b3[_0x7b53('0x90')]('ui.ChatInteractionId\x20IN\x20?',_[_0x7b53('0x46')](_0xfc443b,'id'));return db[_0x7b53('0xa9')]['query'](_0x2ef1b3[_0x7b53('0xaa')](),_0x2186b7)[_0x7b53('0x3b')](function(_0x5109e9){var _0x42dd03=_[_0x7b53('0xba')](_0x5109e9,_0x7b53('0xbb'));var _0x5ab300=[];_0xfc443b[_0x7b53('0x81')](function(_0x3444a2){_0x5ab300[_0x7b53('0x4a')](updateChatInteraction(_0x3444a2,_0x25c76a,_0x42dd03));});return BPromise[_0x7b53('0xbc')](_0x5ab300);});});})[_0x7b53('0x3b')](function(_0x40dc20){_0x3ecf4b['rows']=_0x40dc20;return _0x3ecf4b;})[_0x7b53('0x3b')](respondWithFilteredResult(_0x3f0cd5,_0x23aff2))['catch'](handleError(_0x3f0cd5,null));};exports['show']=function(_0x3fa2bb,_0x466d42){var _0x511a68={'raw':![],'where':{'id':_0x3fa2bb[_0x7b53('0xbd')]['id']}},_0x176dea={};_0x176dea[_0x7b53('0x57')]=_[_0x7b53('0x51')](db['ChatInteraction'][_0x7b53('0x4d')]);_0x176dea[_0x7b53('0x50')]=_[_0x7b53('0x51')](_0x3fa2bb[_0x7b53('0x50')]);_0x176dea[_0x7b53('0x52')]=_[_0x7b53('0x54')](_0x176dea[_0x7b53('0x57')],_0x176dea[_0x7b53('0x50')]);_0x511a68[_0x7b53('0x53')]=_['intersection'](_0x176dea['model'],qs[_0x7b53('0x55')](_0x3fa2bb[_0x7b53('0x50')]['fields']));_0x511a68[_0x7b53('0x53')]=_0x511a68[_0x7b53('0x53')][_0x7b53('0x56')]?_0x511a68[_0x7b53('0x53')]:_0x176dea[_0x7b53('0x57')];if(_0x3fa2bb[_0x7b53('0x50')][_0x7b53('0xbe')]){_0x511a68['include']=[{'all':!![]}];}_0x511a68=_[_0x7b53('0x40')]({},_0x511a68,_0x3fa2bb[_0x7b53('0xbf')]);return db[_0x7b53('0x4c')][_0x7b53('0x72')](_0x511a68)[_0x7b53('0x3b')](handleEntityNotFound(_0x466d42,null))['then'](respondWithResult(_0x466d42,null))[_0x7b53('0x2c')](handleError(_0x466d42,null));};exports[_0x7b53('0xc0')]=function(_0x49e077,_0x911c9d){return db['ChatInteraction'][_0x7b53('0xc0')](_0x49e077['body'],{})['then'](respondWithResult(_0x911c9d,0xc9))['catch'](handleError(_0x911c9d,null));};exports['update']=function(_0x1b2927,_0x49e774){if(_0x1b2927[_0x7b53('0x41')]['id']){delete _0x1b2927[_0x7b53('0x41')]['id'];}return db[_0x7b53('0x4c')][_0x7b53('0x72')]({'where':{'id':_0x1b2927[_0x7b53('0xbd')]['id']}})[_0x7b53('0x3b')](handleEntityNotFound(_0x49e774,null))[_0x7b53('0x3b')](saveUpdates(_0x1b2927['body'],null))[_0x7b53('0x3b')](respondWithResult(_0x49e774,null))['catch'](handleError(_0x49e774,null));};exports[_0x7b53('0x3c')]=function(_0x2982a0,_0x53f873){return db[_0x7b53('0x4c')][_0x7b53('0x72')]({'where':{'id':_0x2982a0[_0x7b53('0xbd')]['id']}})[_0x7b53('0x3b')](handleEntityNotFound(_0x53f873,null))[_0x7b53('0x3b')](removeEntity(_0x53f873,null))[_0x7b53('0x2c')](handleError(_0x53f873,null));};exports[_0x7b53('0xc1')]=function(_0x1400eb,_0x2f4df6){return db[_0x7b53('0x4c')][_0x7b53('0xc1')]()[_0x7b53('0x3b')](respondWithResult(_0x2f4df6,null))[_0x7b53('0x2c')](handleError(_0x2f4df6,null));};exports['createVidaooSession']=function(_0x1f50b5,_0x4feed0){var _0x112c17=_0x1f50b5[_0x7b53('0xbd')]['id'];var _0x497ac8;var _0x41ffb4;var _0x489952;return db[_0x7b53('0x4c')][_0x7b53('0xc2')]({'where':{'id':_0x112c17}})[_0x7b53('0x3b')](function(_0x4ef331){_0x497ac8=_0x4ef331;return db[_0x7b53('0xc3')][_0x7b53('0xc2')]({'where':{'id':_0x4ef331[_0x7b53('0x8a')]},'attributes':['id',_0x7b53('0xc4'),_0x7b53('0xc5'),_0x7b53('0xc6'),_0x7b53('0xc7'),_0x7b53('0xc8')],'raw':!![]});})['then'](function(_0x889cd5){if(_0x889cd5&&_0x889cd5[_0x7b53('0xc4')]&&_0x889cd5['vidaooEscalation']){_0x41ffb4=_0x889cd5;var _0xfbac3b={'interaction':{'id':_0x112c17},'agent':{'id':_0x1f50b5['user']['id'],'name':_0x1f50b5['user']['name'],'fullname':_0x1f50b5['user'][_0x7b53('0x47')],'email':_0x1f50b5[_0x7b53('0xa5')][_0x7b53('0xc9')]},'contact':_0x1f50b5[_0x7b53('0x41')][_0x7b53('0x42')],'account':_0x1f50b5[_0x7b53('0x41')][_0x7b53('0x44')]};var _0x14b636={'rejectUnauthorized':![],'method':_0x7b53('0xca'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x889cd5['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1f50b5[_0x7b53('0xa5')][_0x7b53('0xc9')]],'buttons':null,'topic':_0x41ffb4[_0x7b53('0xc6')],'note':_['isNull'](_0x41ffb4['vidaooNote'])?null:getMustacheRender(_0x41ffb4[_0x7b53('0xc7')],_0xfbac3b),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x7b53('0xcb')](_0x41ffb4[_0x7b53('0xc8')])){var _0x59047f=getMustacheRender(_0x41ffb4[_0x7b53('0xc8')],_0xfbac3b);var _0x5656d5=JSON[_0x7b53('0x8e')](_0x59047f);_0x14b636['body'][_0x7b53('0xcc')]=_0x5656d5;}}catch(_0x556035){throw new db[(_0x7b53('0x9d'))][(_0x7b53('0xcd'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x14b636);}else{throw new db[(_0x7b53('0x9d'))][(_0x7b53('0xcd'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x7b53('0x3b')](function(_0x1e993c){_0x489952=_0x1e993c;if(_0x489952['id']){var _0x11bfea={'body':_0x489952[_0x7b53('0xce')],'ChatWebsiteId':_0x41ffb4['id'],'ChatInteractionId':_0x497ac8['id'],'direction':_0x7b53('0xcf'),'UserId':_0x1f50b5['user']['id']};return db[_0x7b53('0xd0')][_0x7b53('0xc0')](_0x11bfea,{});}else{throw new db[(_0x7b53('0x9d'))][(_0x7b53('0xcd'))](_0x7b53('0xd1'));}})[_0x7b53('0x3b')](function(){return _0x497ac8[_0x7b53('0xd2')]({'vidaooSessionId':_0x489952['id']});})[_0x7b53('0x3b')](respondWithResult(_0x4feed0,null))[_0x7b53('0x2c')](handleError(_0x4feed0,null));};exports[_0x7b53('0xd3')]=function(_0x51e8fd,_0x35047f){if(_0x51e8fd['body']['id']){delete _0x51e8fd[_0x7b53('0x41')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x51e8fd[_0x7b53('0xbd')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})['then'](handleEntityNotFound(_0x35047f,null))[_0x7b53('0x3b')](saveUpdates(_0x51e8fd[_0x7b53('0x41')],null))['then'](respondWithResult(_0x35047f,null))[_0x7b53('0x2c')](handleError(_0x35047f,null));};exports['abandon']=function(_0x57e268,_0x458a4f,_0x4b8dca){if(_0x57e268['body']['id']){delete _0x57e268[_0x7b53('0x41')]['id'];}return db[_0x7b53('0x4c')]['find']({'where':{'id':_0x57e268[_0x7b53('0xbd')]['id']}})[_0x7b53('0x3b')](function(_0x2f98d){if(!_0x2f98d){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x7b53('0xd4'),0x194,'entity\x20not\x20found');_0x458a4f['sendStatus'](0x194);}else{if(_0x2f98d[_0x7b53('0x86')]){throw new db['Sequelize'][(_0x7b53('0xcd'))](_0x7b53('0xd5'));}}return _0x2f98d;})['then'](function(_0x2e03ae){if(_0x2e03ae){return _0x2e03ae[_0x7b53('0x3a')]({'closed':_0x57e268[_0x7b53('0x41')][_0x7b53('0xd6')],'disposition':_0x57e268[_0x7b53('0x41')][_0x7b53('0xd7')]})[_0x7b53('0x3b')](function(_0x656f30){return _0x656f30;});}})[_0x7b53('0x3b')](function(_0xe60737){return respondWithRpcPromise(_0x7b53('0xd8'),'abandon',_0x57e268[_0x7b53('0x41')],client9004);})[_0x7b53('0x3b')](respondWithResult(_0x458a4f,null))[_0x7b53('0x2c')](handleError(_0x458a4f,null));};exports[_0x7b53('0xd9')]=function(_0x2b2a82,_0x4661b5,_0x31ccd3){_0x2b2a82['body'][_0x7b53('0x3e')]=_0x2b2a82[_0x7b53('0xda')][_0x7b53('0xdb')];_0x2b2a82['body']['basename']=_0x2b2a82[_0x7b53('0xda')][_0x7b53('0xdc')];_0x2b2a82['body'][_0x7b53('0x4e')]=_0x2b2a82[_0x7b53('0xda')][_0x7b53('0xdd')];return db[_0x7b53('0xde')][_0x7b53('0xc0')](_0x2b2a82['body'])[_0x7b53('0x3b')](respondWithResult(_0x4661b5,0xc9))[_0x7b53('0x2c')](handleError(_0x4661b5,null));};exports['attachmentDownload']=function(_0x4aecc8,_0x584ab6,_0x22724a){return db[_0x7b53('0x4c')]['findOne']({'where':{'id':_0x4aecc8[_0x7b53('0xbd')]['id']},'raw':!![]})[_0x7b53('0x3b')](handleEntityNotFound(_0x584ab6,null))[_0x7b53('0x3b')](function(_0x9e85a8){if(_0x9e85a8){if(_0x9e85a8[_0x7b53('0xd6')]){return _0x584ab6['status'](0x193)[_0x7b53('0x30')]({'status':0x193,'message':_0x7b53('0xdf')});}return db[_0x7b53('0xde')]['findOne']({'where':{'id':_0x4aecc8[_0x7b53('0x50')][_0x7b53('0xe0')]},'raw':!![]})[_0x7b53('0x3b')](handleEntityNotFound(_0x584ab6,null));}})['then'](function(_0xd04f1c){if(_0xd04f1c){var _0x5be993=_0xd04f1c[_0x7b53('0xe1')]!==null;var _0x5a0dfd=path['join'](config[_0x7b53('0xe2')],_0x7b53('0xe3'));if(_0x5be993){_0x5a0dfd=path['join'](_0x5a0dfd,_0x7b53('0xe4'));}var _0x16ff99=path['join'](_0x5a0dfd,_0xd04f1c['basename']);return _0x584ab6[_0x7b53('0xe5')](_0x16ff99);}})['catch'](handleError(_0x584ab6,null));};exports['close']=function(_0x6b6d38,_0x5c19c7){var _0x519546=null;var _0x2b5368=null;var _0x1d85d3=null;var _0x5e5daa=null;if(_0x6b6d38[_0x7b53('0x41')]['id']){delete _0x6b6d38[_0x7b53('0x41')]['id'];}if(_0x6b6d38[_0x7b53('0x41')][_0x7b53('0xe6')]){_0x5e5daa=path[_0x7b53('0xe7')](config['root'],_0x7b53('0xe8'),util[_0x7b53('0xe9')](_0x7b53('0xea'),Date[_0x7b53('0xeb')]()));_0x6b6d38[_0x7b53('0x41')][_0x7b53('0xec')]=_0x5e5daa;}return db[_0x7b53('0x4c')]['find']({'where':{'id':_0x6b6d38[_0x7b53('0xbd')]['id']},'include':[{'model':db[_0x7b53('0xd0')],'as':'Messages','include':[{'model':db[_0x7b53('0x84')],'as':_0x7b53('0x84')}]}]})[_0x7b53('0x3b')](handleEntityNotFound(_0x5c19c7,null))['then'](saveUpdates(_0x6b6d38[_0x7b53('0x41')],null))['then'](function(_0xca0681){if(_0xca0681){_0x519546=_0xca0681;return db[_0x7b53('0xc3')][_0x7b53('0x72')]({'where':{'id':_0x519546[_0x7b53('0x8a')]}});}})[_0x7b53('0x3b')](function(_0xf4c013){if(_0xf4c013){_0x1d85d3=_0xf4c013;return db[_0x7b53('0xed')][_0x7b53('0x72')]({'where':{'id':_0x519546[_0x7b53('0x7d')]}});}})[_0x7b53('0x3b')](function(_0x5b748a){if(_0x5b748a){_0x2b5368=_0x5b748a;if(_0x5e5daa){var _0x11ce0e=null;for(var _0x140972=0x1;_0x140972<_0x519546['Messages'][_0x7b53('0x56')];++_0x140972){_0x11ce0e=_0x519546[_0x7b53('0xee')][_0x140972];var _0x405224=_0x11ce0e['UserId']?util['format'](_0x7b53('0xef'),_0x1d85d3[_0x7b53('0xf0')],_0x11ce0e[_0x7b53('0x86')]):'System';var _0xc1046d=_0x6b6d38['body']['customer']||util[_0x7b53('0xe9')](_0x7b53('0xef'),_0x7b53('0xf1'),_0x11ce0e[_0x7b53('0x7d')]);switch(_0x1d85d3[_0x7b53('0xf2')]){case _0x7b53('0xf3'):_0x405224=_0x11ce0e[_0x7b53('0x86')]?util[_0x7b53('0xe9')](_0x7b53('0xef'),_0x1d85d3[_0x7b53('0xf0')],_0x11ce0e['UserId']):'System';break;case _0x7b53('0xf4'):_0x405224=_0x11ce0e[_0x7b53('0x86')]?_0x11ce0e[_0x7b53('0x84')]['alias']||_0x11ce0e[_0x7b53('0x84')]['fullname']:'System';break;case _0x7b53('0xf5'):_0x405224=_0x11ce0e[_0x7b53('0x86')]?_0x11ce0e[_0x7b53('0x84')]['fullname']:'System';break;default:_0x405224=_0x11ce0e[_0x7b53('0x86')]?util['format'](_0x7b53('0xef'),_0x1d85d3[_0x7b53('0xf0')],_0x11ce0e[_0x7b53('0x86')]):_0x7b53('0xf6');}var _0x57dcab=util[_0x7b53('0xe9')](_0x7b53('0xf7'),moment(_0x11ce0e['createdAt'])[_0x7b53('0xe9')](_0x7b53('0xf8')),_0x11ce0e['direction']==='in'?_0xc1046d:_0x405224,_0x11ce0e[_0x7b53('0x41')]);if(!_0x11ce0e[_0x7b53('0xf9')]){fs[_0x7b53('0xfa')](_0x5e5daa,_0x57dcab);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x7b53('0xfb')],'as':'Smtp','raw':!![]}]});}}})['then'](function(_0x293b09){if(_0x293b09&&_0x293b09[_0x7b53('0xfc')]&&_0x6b6d38[_0x7b53('0x41')]){var _0x200ebd={'tls':{'rejectUnauthorized':![]}};if(_0x293b09[_0x7b53('0xfc')][_0x7b53('0xfd')]){_0x200ebd[_0x7b53('0xfd')]=_0x293b09[_0x7b53('0xfc')]['service'];}else{_0x200ebd[_0x7b53('0xfe')]=_0x293b09[_0x7b53('0xfc')][_0x7b53('0xfe')];_0x200ebd[_0x7b53('0xff')]=_0x293b09[_0x7b53('0xfc')]['port'];_0x200ebd['secure']=_0x293b09[_0x7b53('0xfc')][_0x7b53('0x100')];}if(_0x293b09['Smtp']['authentication']){_0x200ebd[_0x7b53('0x101')]={'user':_0x293b09['Smtp'][_0x7b53('0xa5')],'pass':_0x293b09['Smtp']['pass']};}return respondWithRpcPromise(_0x7b53('0x102'),_0x7b53('0x103'),{'account':_0x200ebd,'message':{'from':util[_0x7b53('0xe9')](_0x7b53('0x104'),_0x293b09[_0x7b53('0x3e')],_0x293b09[_0x7b53('0xc9')]||_0x293b09[_0x7b53('0xfc')][_0x7b53('0xa5')]),'to':_0x6b6d38['body'][_0x7b53('0xe6')],'subject':_0x7b53('0x105'),'text':util[_0x7b53('0xe9')](_0x7b53('0x106'),_0x6b6d38[_0x7b53('0x41')][_0x7b53('0xe6')]),'attachments':[{'path':_0x5e5daa}]}})[_0x7b53('0x3b')](function(){return _0x519546;})['catch'](function(_0x5ea5ee){console[_0x7b53('0x29')](_0x5ea5ee);});}else{return _0x519546;}})[_0x7b53('0x3b')](respondWithStatusCode(_0x5c19c7,0xc8))[_0x7b53('0x2c')](handleError(_0x5c19c7,null));};exports['addMessage']=function(_0x5c231a,_0x7bcd96,_0x462e42){return db[_0x7b53('0xd0')][_0x7b53('0x72')]({'where':{'id':_0x5c231a['params']['id']}})['then'](handleEntityNotFound(_0x7bcd96,null))[_0x7b53('0x3b')](function(_0x414066){if(_0x414066){return _0x414066['addMessage'](_0x5c231a['body'][_0x7b53('0x107')],_[_0x7b53('0x108')](_0x5c231a[_0x7b53('0x41')],[_0x7b53('0x107'),'id'])||{});}})['then'](respondWithResult(_0x7bcd96,null))['catch'](handleError(_0x7bcd96,null));};exports[_0x7b53('0x109')]=function(_0x1915d4,_0x50fdd2,_0x5d138e){var _0x1943e5={'raw':![],'where':{}};var _0x5d3382={};var _0x51cba6={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x1915d4['params']['id']}})['then'](handleEntityNotFound(_0x50fdd2,null))[_0x7b53('0x3b')](function(_0x3e4815){if(_0x3e4815){_0x5d3382['model']=_['keys'](db[_0x7b53('0xd0')][_0x7b53('0x4d')]);_0x5d3382[_0x7b53('0x50')]=_[_0x7b53('0x51')](_0x1915d4[_0x7b53('0x50')]);_0x5d3382[_0x7b53('0x52')]=_[_0x7b53('0x54')](_0x5d3382[_0x7b53('0x57')],_0x5d3382[_0x7b53('0x50')]);_0x1943e5[_0x7b53('0x53')]=_[_0x7b53('0x54')](_0x5d3382[_0x7b53('0x57')],qs[_0x7b53('0x55')](_0x1915d4[_0x7b53('0x50')][_0x7b53('0x55')]));_0x1943e5[_0x7b53('0x53')]=_0x1943e5['attributes'][_0x7b53('0x56')]?_0x1943e5[_0x7b53('0x53')]:_0x5d3382[_0x7b53('0x57')];if(!_0x1915d4[_0x7b53('0x50')]['hasOwnProperty'](_0x7b53('0x59'))){_0x1943e5[_0x7b53('0x33')]=qs['limit'](_0x1915d4['query'][_0x7b53('0x33')]);_0x1943e5['offset']=qs[_0x7b53('0x31')](_0x1915d4['query']['offset']);}_0x1943e5['order']=qs[_0x7b53('0x5b')](_0x1915d4['query'][_0x7b53('0x5b')]);_0x1943e5['where']=qs['filters'](_[_0x7b53('0x10a')](_0x1915d4['query'],_0x5d3382['filters']));_0x1943e5['where'][_0x7b53('0xbb')]=_0x3e4815['id'];if(_0x1915d4[_0x7b53('0x50')][_0x7b53('0x99')]){_0x1943e5[_0x7b53('0x90')]=_[_0x7b53('0x40')](_0x1943e5['where'],{'$or':_['map'](_0x1943e5[_0x7b53('0x53')],function(_0x1f8221){var _0x20838e={};_0x20838e[_0x1f8221]={'$like':'%'+_0x1915d4[_0x7b53('0x50')][_0x7b53('0x99')]+'%'};return _0x20838e;})});}if(_0x1915d4[_0x7b53('0x50')][_0x7b53('0x8f')]){var _0x243e12=_0x1915d4['query']['$gte'][_0x7b53('0x49')](',');var _0x559ea2={};_0x559ea2[_0x243e12[0x0]]={'$gte':moment(_0x243e12[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1943e5[_0x7b53('0x90')]=_[_0x7b53('0x40')](_0x1943e5[_0x7b53('0x90')],_0x559ea2);}_0x1943e5=_['merge']({},_0x1943e5,_0x1915d4['options']);return db[_0x7b53('0xd0')][_0x7b53('0x34')]({'where':_0x1943e5['where']})[_0x7b53('0x3b')](function(_0x4b0765){_0x51cba6[_0x7b53('0x34')]=_0x4b0765;if(_0x1915d4[_0x7b53('0x50')]['includeAll']){_0x1943e5[_0x7b53('0x10b')]=[{'all':!![]}];}return db[_0x7b53('0xd0')][_0x7b53('0x10c')](_0x1943e5);})[_0x7b53('0x3b')](function(_0xc55c0c){_0x51cba6[_0x7b53('0x10d')]=_0xc55c0c;return _0x51cba6;});}})['then'](respondWithFilteredResult(_0x50fdd2,_0x1943e5))[_0x7b53('0x2c')](handleError(_0x50fdd2,null));};exports['getMyMessages']=function(_0x1a7587,_0x3a957b,_0x50d73a){var _0x96e66a={'where':{}},_0xd8e214={},_0x562234={'count':0x0,'rows':[]};return db[_0x7b53('0x4c')]['findOne']({'where':{'id':_0x1a7587[_0x7b53('0xbd')]['id']}})[_0x7b53('0x3b')](handleEntityNotFound(_0x3a957b,null))['then'](function(_0x29c98a){if(_0x29c98a){_0xd8e214[_0x7b53('0x57')]=_[_0x7b53('0x51')](db[_0x7b53('0xd0')][_0x7b53('0x4d')]);_0xd8e214['query']=_[_0x7b53('0x51')](_0x1a7587[_0x7b53('0x50')]);_0xd8e214[_0x7b53('0x52')]=_['intersection'](_0xd8e214['model'],_0xd8e214[_0x7b53('0x50')]);_0x96e66a[_0x7b53('0x53')]=_[_0x7b53('0x54')](_0xd8e214['model'],qs[_0x7b53('0x55')](_0x1a7587[_0x7b53('0x50')][_0x7b53('0x55')]));_0x96e66a[_0x7b53('0x53')]=_0x96e66a[_0x7b53('0x53')][_0x7b53('0x56')]?_0x96e66a['attributes']:_0xd8e214[_0x7b53('0x57')];if(!_0x1a7587[_0x7b53('0x50')][_0x7b53('0x58')](_0x7b53('0x59'))){_0x96e66a[_0x7b53('0x33')]=qs[_0x7b53('0x33')](_0x1a7587[_0x7b53('0x50')][_0x7b53('0x33')]);_0x96e66a['offset']=qs['offset'](_0x1a7587[_0x7b53('0x50')][_0x7b53('0x31')]);}_0x96e66a[_0x7b53('0x5a')]=qs[_0x7b53('0x5b')](_0x1a7587[_0x7b53('0x50')][_0x7b53('0x5b')]);_0x96e66a[_0x7b53('0x90')]=qs[_0x7b53('0x52')](_[_0x7b53('0x10a')](_0x1a7587[_0x7b53('0x50')],_0xd8e214[_0x7b53('0x52')]));_0x96e66a['where'][_0x7b53('0xbb')]=_0x29c98a['id'];if(_0x1a7587['query']['filter']){_0x96e66a[_0x7b53('0x90')]=_[_0x7b53('0x40')](_0x96e66a[_0x7b53('0x90')],{'$or':_[_0x7b53('0x46')](_0x96e66a[_0x7b53('0x53')],function(_0x1e151c){var _0x522641={};_0x522641[_0x1e151c]={'$like':'%'+_0x1a7587[_0x7b53('0x50')][_0x7b53('0x99')]+'%'};return _0x522641;})});}_0x96e66a[_0x7b53('0x90')][_0x7b53('0xf9')]=![];if(_0x1a7587[_0x7b53('0x50')]['id']){_0x96e66a['where']['id']={'$gt':_0x1a7587[_0x7b53('0x50')]['id']};}_0x96e66a=_['merge']({},_0x96e66a,_0x1a7587['options']);return db[_0x7b53('0xd0')]['count']({'where':_0x96e66a['where']})[_0x7b53('0x3b')](function(_0xf2f830){_0x562234[_0x7b53('0x34')]=_0xf2f830;_0x96e66a[_0x7b53('0x10b')]=[];if(_0x1a7587[_0x7b53('0x50')][_0x7b53('0x10e')]){_0x96e66a[_0x7b53('0x10b')][_0x7b53('0x4a')]({'model':db[_0x7b53('0x84')],'as':_0x7b53('0x84'),'attributes':['id',_0x7b53('0x47'),_0x7b53('0x10f')]});}if(_0x1a7587[_0x7b53('0x50')][_0x7b53('0xbe')]){_0x96e66a[_0x7b53('0x10b')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x96e66a);})[_0x7b53('0x3b')](function(_0x3cceec){_0x562234[_0x7b53('0x10d')]=_0x3cceec;return _0x562234;});}})['then'](respondWithFilteredResult(_0x3a957b,_0x96e66a))[_0x7b53('0x2c')](handleError(_0x3a957b,null));};exports[_0x7b53('0x110')]=function(_0x394b17,_0x381eb0,_0x25f928){return db[_0x7b53('0x4c')][_0x7b53('0x72')]({'where':{'id':_0x394b17[_0x7b53('0xbd')]['id']}})['then'](handleEntityNotFound(_0x381eb0,null))[_0x7b53('0x3b')](function(_0x1e1d1c){if(_0x1e1d1c){return _0x1e1d1c[_0x7b53('0x111')](_0x394b17[_0x7b53('0x41')]['ids'],_[_0x7b53('0x108')](_0x394b17[_0x7b53('0x41')],[_0x7b53('0x107'),'id'])||{})['spread'](function(){return db[_0x7b53('0x80')][_0x7b53('0x10c')]({'attributes':['id',_0x7b53('0x3e'),'color'],'where':{'id':_0x394b17[_0x7b53('0x41')][_0x7b53('0x107')]}});})['then'](function(_0x54bd70){socket[_0x7b53('0x112')](_0x7b53('0x113'),{'id':Number(_0x394b17[_0x7b53('0xbd')]['id']),'tags':_0x54bd70||[]});return{'id':Number(_0x394b17[_0x7b53('0xbd')]['id']),'tags':_0x54bd70||[]};});}})[_0x7b53('0x3b')](respondWithResult(_0x381eb0,null))[_0x7b53('0x2c')](handleError(_0x381eb0,null));};exports[_0x7b53('0x114')]=function(_0x5a48ce,_0xbc6452,_0xd42c1e){return db['ChatInteraction'][_0x7b53('0x72')]({'where':{'id':_0x5a48ce[_0x7b53('0xbd')]['id']}})['then'](handleEntityNotFound(_0xbc6452,null))[_0x7b53('0x3b')](function(_0x2eb115){if(_0x2eb115){return _0x2eb115[_0x7b53('0x114')](_0x5a48ce[_0x7b53('0x50')][_0x7b53('0x107')]);}})[_0x7b53('0x3b')](respondWithStatusCode(_0xbc6452,null))['catch'](handleError(_0xbc6452,null));};exports[_0x7b53('0xe5')]=function(_0x663fe4,_0x136973){var _0x45f07b=moment()[_0x7b53('0x115')]()['toString']();var _0x236ea0=path[_0x7b53('0xe7')](config[_0x7b53('0xe2')],'server','files',_0x7b53('0x116'));var _0x1e9b88=path[_0x7b53('0xe7')](config['root'],'server',_0x7b53('0x117'),_0x7b53('0x118'));var _0x1f395a=path[_0x7b53('0xe7')](_0x236ea0,_0x45f07b);var _0x91a467=util[_0x7b53('0xe9')]('transcript-%d-%s.zip',_0x663fe4[_0x7b53('0xbd')]['id'],_0x45f07b);var _0x1148d5=path[_0x7b53('0xe7')](_0x236ea0,_0x91a467);var _0x13895f=[];_0x13895f['push']({'model':db[_0x7b53('0x84')],'as':_0x7b53('0x84'),'attributes':['id',_0x7b53('0x47')],'raw':!![]});_0x13895f[_0x7b53('0x4a')]({'model':db[_0x7b53('0xed')],'as':_0x7b53('0x77'),'attributes':['id',_0x7b53('0x119'),_0x7b53('0x11a')],'raw':!![]});if(_0x663fe4['query'][_0x7b53('0x118')]){_0x13895f[_0x7b53('0x4a')]({'model':db[_0x7b53('0xde')],'as':_0x7b53('0xde'),'raw':!![]});}var _0x81b9d8=[{'model':db[_0x7b53('0xd0')],'as':'Messages','attributes':['id',_0x7b53('0x41'),_0x7b53('0x8d'),_0x7b53('0x11b'),_0x7b53('0xf9'),'read'],'include':_0x13895f}];_0x81b9d8[_0x7b53('0x4a')]({'model':db[_0x7b53('0xc3')],'as':_0x7b53('0x11c'),'attributes':['id',_0x7b53('0x3e')]});_0x81b9d8[_0x7b53('0x4a')]({'model':db['User'],'as':_0x7b53('0x11d'),'attributes':['id',_0x7b53('0x47')]});return db[_0x7b53('0x4c')][_0x7b53('0x72')]({'where':{'id':_0x663fe4[_0x7b53('0xbd')]['id']},'include':_0x81b9d8})['then'](handleEntityNotFound(_0x136973,null))[_0x7b53('0x3b')](function(_0x3caca1){if(_0x3caca1){var _0x504b83=_0x3caca1[_0x7b53('0x11e')]({'plain':!![]});fs[_0x7b53('0x11f')](_0x1f395a);var _0x3a305e={'channel':_0x7b53('0x120'),'account':_0x504b83[_0x7b53('0x11c')][_0x7b53('0x3e')],'agent':_0x504b83[_0x7b53('0x11d')]?_0x504b83[_0x7b53('0x11d')][_0x7b53('0x47')]:_0x7b53('0x121'),'createdAt':moment(_0x504b83[_0x7b53('0x8d')])[_0x7b53('0xe9')](_0x7b53('0x122'))[_0x7b53('0xaa')](),'closedAt':_0x504b83[_0x7b53('0xd6')]?moment(_0x504b83[_0x7b53('0x123')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x7b53('0xaa')]():'','disposition':_0x504b83[_0x7b53('0xd7')],'chatInfo':{'browser':_0x504b83[_0x7b53('0x124')],'os':_0x504b83['osName'],'referer':_0x504b83[_0x7b53('0x125')],'customerIp':_0x504b83['customerIp'],'customerPort':_0x504b83['customerPort']?_0x504b83[_0x7b53('0x126')]:_0x7b53('0x121')},'messages':_(_0x504b83[_0x7b53('0xee')])[_0x7b53('0x127')]()['filter']({'secret':![]})[_0x7b53('0x46')](function(_0x251968){if(_0x251968[_0x7b53('0xde')]){var _0x38bd42=path['join'](_0x1e9b88,_0x251968[_0x7b53('0xde')][_0x7b53('0x128')]);if(fs[_0x7b53('0x129')](_0x38bd42)){fs['createReadStream'](_0x38bd42)[_0x7b53('0x12a')](fs[_0x7b53('0x12b')](path[_0x7b53('0xe7')](_0x1f395a,_0x251968[_0x7b53('0xde')][_0x7b53('0x128')])));}}return{'date':moment(_0x251968[_0x7b53('0x8d')])[_0x7b53('0xe9')]('YYYY-MM-DD\x20HH:mm:ss')[_0x7b53('0xaa')](),'sender':_0x251968[_0x7b53('0x11b')]===_0x7b53('0xcf')?_0x251968[_0x7b53('0x84')]?_0x251968['User'][_0x7b53('0x47')]:_0x7b53('0xf6'):_0x251968[_0x7b53('0x77')][_0x7b53('0x119')]+(_0x251968['Contact'][_0x7b53('0x11a')]?'\x20'+_0x251968[_0x7b53('0x77')][_0x7b53('0x11a')]:''),'body':_0x251968['Attachment']?_0x251968[_0x7b53('0xde')][_0x7b53('0x128')]:_0x251968[_0x7b53('0x41')],'direction':_0x251968['direction']===_0x7b53('0xcf')?'A':'C','secret':_0x251968['secret'],'read':_0x251968[_0x7b53('0x95')],'attachment':_0x251968[_0x7b53('0xde')]};})[_0x7b53('0x74')]()};return ejs[_0x7b53('0x12c')](path[_0x7b53('0xe7')](config[_0x7b53('0xe2')],_0x7b53('0x12d'),'views','downloadInteraction.html'),{'interaction':_0x3a305e})[_0x7b53('0x3b')](function(_0x5a586f){var _0x38d145=path[_0x7b53('0xe7')](_0x1f395a,_0x7b53('0x12e')+_0x504b83['id']+'-'+_0x45f07b+_0x7b53('0x12f'));var _0x2de324={'path':_0x38d145,'channel':_0x7b53('0x120'),'interactionId':_0x504b83['id']};return pdf[_0x7b53('0x130')](_0x5a586f,_0x2de324);})[_0x7b53('0x3b')](function(){return new BPromise(function(_0x17156a,_0x368ed8){zipdir(_0x1f395a,{'saveTo':_0x1148d5},function(_0x579192,_0x133804){if(_0x579192)return _0x368ed8(_0x579192);return _0x17156a(_0x133804);});})[_0x7b53('0x3b')](function(){return new BPromise(function(_0x368264,_0x45213e){rimraf(_0x1f395a,function(_0x42a62c){if(_0x42a62c)_0x45213e(_0x42a62c);return _0x368264();});});})[_0x7b53('0x3b')](function(){return _0x136973[_0x7b53('0xe5')](_0x1148d5,_0x91a467,function(_0x497369){if(_0x497369){console['log'](_0x7b53('0x131'),_0x497369);}else{fs[_0x7b53('0x132')](_0x1148d5);}});});});}else{return _0x136973[_0x7b53('0x2d')](0xc8);}})['catch'](handleError(_0x136973,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index d69888d..8b3796d 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 _0x2d95=['ChatMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','exports','events','ChatInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2d95,0xca));var _0x52d9=function(_0x4a77dc,_0x352436){_0x4a77dc=_0x4a77dc-0x0;var _0x4144bc=_0x2d95[_0x4a77dc];return _0x4144bc;};'use strict';var EventEmitter=require(_0x52d9('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x52d9('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0x52d9('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x52d9('0x3')](0x0);var events={'afterCreate':_0x52d9('0x4'),'afterUpdate':'update','afterDestroy':_0x52d9('0x5')};function emitEvent(_0x7aff8f){return function(_0x38acb9,_0x1d30e2,_0x16eb99){_0x38acb9[_0x52d9('0x6')]({'attributes':['id'],'raw':!![]})[_0x52d9('0x7')](function(_0x8fa664){_0x38acb9[_0x52d9('0x8')](_0x52d9('0x9'),_0x8fa664[_0x52d9('0xa')](function(_0x20991e){return{'id':_0x20991e['id']};}));return ChatMessage[_0x52d9('0xb')]({'where':{'ChatInteractionId':_0x38acb9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x52d9('0x7')](function(_0x5b0892){_0x38acb9['setDataValue']('unreadMessages',_0x5b0892[_0x52d9('0xc')]);ChatInteractionEvents[_0x52d9('0xd')](_0x7aff8f+':'+_0x38acb9['id'],_0x38acb9);ChatInteractionEvents[_0x52d9('0xd')](_0x7aff8f,_0x38acb9);_0x16eb99(null);})[_0x52d9('0xe')](_0x16eb99(null));};}for(var e in events){if(events[_0x52d9('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x52d9('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x0f25=['hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x939d84,_0xe5c706){var _0x4bd8b0=function(_0x388328){while(--_0x388328){_0x939d84['push'](_0x939d84['shift']());}};_0x4bd8b0(++_0xe5c706);}(_0x0f25,0xdf));var _0x50f2=function(_0x28a569,_0x59e3bd){_0x28a569=_0x28a569-0x0;var _0x4e57f6=_0x0f25[_0x28a569];return _0x4e57f6;};'use strict';var EventEmitter=require(_0x50f2('0x0'));var ChatInteraction=require(_0x50f2('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x50f2('0x1'))['db'][_0x50f2('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x50f2('0x3')](0x0);var events={'afterCreate':_0x50f2('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x19e72e){return function(_0x101e24,_0x8a81df,_0x19b8ac){_0x101e24[_0x50f2('0x5')]({'attributes':['id'],'raw':!![]})[_0x50f2('0x6')](function(_0x19e3ce){_0x101e24[_0x50f2('0x7')](_0x50f2('0x8'),_0x19e3ce[_0x50f2('0x9')](function(_0x519b84){return{'id':_0x519b84['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x101e24['id'],'direction':'in','read':![]},'raw':!![]});})[_0x50f2('0x6')](function(_0x29d972){_0x101e24[_0x50f2('0x7')](_0x50f2('0xa'),_0x29d972[_0x50f2('0xb')]);ChatInteractionEvents[_0x50f2('0xc')](_0x19e72e+':'+_0x101e24['id'],_0x101e24);ChatInteractionEvents[_0x50f2('0xc')](_0x19e72e,_0x101e24);_0x19b8ac(null);})[_0x50f2('0xd')](_0x19b8ac(null));};}for(var e in events){if(events[_0x50f2('0xe')](e)){var event=events[e];ChatInteraction[_0x50f2('0xf')](e,emitEvent(event));}}module[_0x50f2('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 2515744..327402a 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 _0xab63=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','changed'];(function(_0x4392af,_0xec5afe){var _0x9fa8eb=function(_0x41d7a4){while(--_0x41d7a4){_0x4392af['push'](_0x4392af['shift']());}};_0x9fa8eb(++_0xec5afe);}(_0xab63,0x1e5));var _0x3ab6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab63[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3ab6('0x0'));var util=require('util');var logger=require(_0x3ab6('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3ab6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3ab6('0x3'));var rimraf=require(_0x3ab6('0x4'));var config=require(_0x3ab6('0x5'));var attributes=require(_0x3ab6('0x6'));module['exports']=function(_0x572932,_0x25ef7c){return _0x572932[_0x3ab6('0x7')](_0x3ab6('0x8'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1f5bbc,_0x3084b2,_0x26cc4c){if(_0x1f5bbc[_0x3ab6('0x9')](_0x3ab6('0xa'))){_0x1f5bbc[_0x3ab6('0xb')]=moment()[_0x3ab6('0xc')](_0x3ab6('0xd'));}_0x26cc4c(null,_0x1f5bbc);}},'charset':'utf8mb4','collate':_0x3ab6('0xe')});};
\ No newline at end of file
+var _0x4b29=['utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x40911a,_0x55ec99){var _0x27e8e3=function(_0x2ba910){while(--_0x2ba910){_0x40911a['push'](_0x40911a['shift']());}};_0x27e8e3(++_0x55ec99);}(_0x4b29,0xbf));var _0x94b2=function(_0x7e4176,_0x26ce05){_0x7e4176=_0x7e4176-0x0;var _0x4ebd2c=_0x4b29[_0x7e4176];return _0x4ebd2c;};'use strict';var _=require(_0x94b2('0x0'));var util=require(_0x94b2('0x1'));var logger=require(_0x94b2('0x2'))(_0x94b2('0x3'));var moment=require(_0x94b2('0x4'));var BPromise=require('bluebird');var rp=require(_0x94b2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x94b2('0x6'));var config=require(_0x94b2('0x7'));var attributes=require(_0x94b2('0x8'));module[_0x94b2('0x9')]=function(_0xf778f8,_0x4b6039){return _0xf778f8[_0x94b2('0xa')](_0x94b2('0xb'),attributes,{'tableName':_0x94b2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x8e822f,_0x7fcdc4,_0x1855f9){if(_0x8e822f[_0x94b2('0xd')](_0x94b2('0xe'))){_0x8e822f[_0x94b2('0xf')]=moment()[_0x94b2('0x10')](_0x94b2('0x11'));}_0x1855f9(null,_0x8e822f);}},'charset':_0x94b2('0x12'),'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 c0d0616..7043df3 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 _0x3a6d=['spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','UpdateChatInteraction','ChatInteraction','body','raw','options','where','attributes','limit','catch','AddTagsToChatInteraction','find','addTags','ids','omit'];(function(_0x506844,_0x540ef7){var _0x30bc09=function(_0x441feb){while(--_0x441feb){_0x506844['push'](_0x506844['shift']());}};_0x30bc09(++_0x540ef7);}(_0x3a6d,0xae));var _0xd3a6=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x3a6d[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var moment=require('moment');var BPromise=require(_0xd3a6('0x2'));var rs=require(_0xd3a6('0x3'));var fs=require('fs');var Redis=require(_0xd3a6('0x4'));var db=require(_0xd3a6('0x5'))['db'];var utils=require(_0xd3a6('0x6'));var logger=require('../../config/logger')(_0xd3a6('0x7'));var config=require('../../config/environment');var jayson=require(_0xd3a6('0x8'));var client=jayson[_0xd3a6('0x9')][_0xd3a6('0xa')]({'port':0x232a});config['redis']=_[_0xd3a6('0xb')](config['redis'],{'host':_0xd3a6('0xc'),'port':0x18eb});var socket=require(_0xd3a6('0xd'))(new Redis(config[_0xd3a6('0xe')]));require(_0xd3a6('0xf'))[_0xd3a6('0x10')](socket);function respondWithRpcPromise(_0x25296a,_0x17ab2a,_0x4b1f2f){return new BPromise(function(_0x5947e5,_0x12713b){return client[_0xd3a6('0x11')](_0x25296a,_0x4b1f2f)[_0xd3a6('0x12')](function(_0x317151){logger[_0xd3a6('0x13')](_0xd3a6('0x14'),_0x17ab2a,_0xd3a6('0x15'));logger[_0xd3a6('0x16')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x17ab2a,_0xd3a6('0x15'),JSON[_0xd3a6('0x17')](_0x317151));if(_0x317151['error']){if(_0x317151[_0xd3a6('0x18')][_0xd3a6('0x19')]===0x1f4){logger[_0xd3a6('0x18')](_0xd3a6('0x14'),_0x17ab2a,_0x317151[_0xd3a6('0x18')]['message']);return _0x12713b(_0x317151[_0xd3a6('0x18')][_0xd3a6('0x1a')]);}logger['error'](_0xd3a6('0x14'),_0x17ab2a,_0x317151[_0xd3a6('0x18')]['message']);return _0x5947e5(_0x317151['error']['message']);}else{logger[_0xd3a6('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x17ab2a,_0xd3a6('0x15'));_0x5947e5(_0x317151['result'][_0xd3a6('0x1a')]);}})['catch'](function(_0x1362d1){logger[_0xd3a6('0x18')](_0xd3a6('0x14'),_0x17ab2a,_0x1362d1);_0x12713b(_0x1362d1);});});}exports[_0xd3a6('0x1b')]=function(_0xe5634e){var _0x551e73=this;return new Promise(function(_0x51e90e,_0x1ed001){return db[_0xd3a6('0x1c')]['update'](_0xe5634e[_0xd3a6('0x1d')],{'raw':_0xe5634e['options']?_0xe5634e['options'][_0xd3a6('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe5634e[_0xd3a6('0x1f')]?_0xe5634e[_0xd3a6('0x1f')][_0xd3a6('0x20')]||null:null,'attributes':_0xe5634e[_0xd3a6('0x1f')]?_0xe5634e[_0xd3a6('0x1f')][_0xd3a6('0x21')]||null:null,'limit':_0xe5634e['options']?_0xe5634e[_0xd3a6('0x1f')][_0xd3a6('0x22')]||null:null})[_0xd3a6('0x12')](function(_0x4edd57){logger[_0xd3a6('0x13')](_0xd3a6('0x1b'),_0xe5634e);logger['debug'](_0xd3a6('0x1b'),_0xe5634e,JSON[_0xd3a6('0x17')](_0x4edd57));_0x51e90e(_0x4edd57);})[_0xd3a6('0x23')](function(_0x1b9e97){logger[_0xd3a6('0x18')](_0xd3a6('0x1b'),_0x1b9e97[_0xd3a6('0x1a')],_0xe5634e);_0x1ed001(_0x551e73[_0xd3a6('0x18')](0x1f4,_0x1b9e97['message']));});});};exports[_0xd3a6('0x24')]=function(_0x5a90cf){return new Promise(function(_0x2ca18c,_0x4003ec){return db[_0xd3a6('0x1c')][_0xd3a6('0x25')]({'where':_0x5a90cf[_0xd3a6('0x1f')]?_0x5a90cf['options']['where']||null:null})[_0xd3a6('0x12')](function(_0x5bbb29){if(_0x5bbb29){return _0x5bbb29[_0xd3a6('0x26')](_0x5a90cf[_0xd3a6('0x1d')][_0xd3a6('0x27')],_[_0xd3a6('0x28')](_0x5a90cf['body'],['ids','id'])||{});}})[_0xd3a6('0x29')](function(_0x4812a0){logger[_0xd3a6('0x13')](_0xd3a6('0x2a'),_0x5a90cf);logger[_0xd3a6('0x16')](_0xd3a6('0x2a'),_0x5a90cf,JSON['stringify'](_0x4812a0));_0x2ca18c(_0x4812a0);})[_0xd3a6('0x23')](function(_0x38f597){logger[_0xd3a6('0x18')](_0xd3a6('0x2a'),_0x38f597['message'],_0x5a90cf);_0x4003ec(_this[_0xd3a6('0x18')](0x1f4,_0x38f597[_0xd3a6('0x1a')]));});});};
\ No newline at end of file
+var _0x4c8e=['localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','where','attributes','limit','AddTagsToChatInteraction','addTags','ids','omit','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x144d3b,_0x139d2d){var _0x29736d=function(_0x405011){while(--_0x405011){_0x144d3b['push'](_0x144d3b['shift']());}};_0x29736d(++_0x139d2d);}(_0x4c8e,0x1c2));var _0xe4c8=function(_0x529a0f,_0x328763){_0x529a0f=_0x529a0f-0x0;var _0x187a88=_0x4c8e[_0x529a0f];return _0x187a88;};'use strict';var _=require(_0xe4c8('0x0'));var util=require(_0xe4c8('0x1'));var moment=require(_0xe4c8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe4c8('0x3'));var db=require(_0xe4c8('0x4'))['db'];var utils=require(_0xe4c8('0x5'));var logger=require('../../config/logger')(_0xe4c8('0x6'));var config=require(_0xe4c8('0x7'));var jayson=require(_0xe4c8('0x8'));var client=jayson[_0xe4c8('0x9')][_0xe4c8('0xa')]({'port':0x232a});config[_0xe4c8('0xb')]=_['defaults'](config['redis'],{'host':_0xe4c8('0xc'),'port':0x18eb});var socket=require(_0xe4c8('0xd'))(new Redis(config[_0xe4c8('0xb')]));require(_0xe4c8('0xe'))['register'](socket);function respondWithRpcPromise(_0x19572a,_0x95c1cf,_0xb3fb12){return new BPromise(function(_0x32c4c4,_0x9ee151){return client[_0xe4c8('0xf')](_0x19572a,_0xb3fb12)[_0xe4c8('0x10')](function(_0x50239d){logger[_0xe4c8('0x11')](_0xe4c8('0x12'),_0x95c1cf,'request\x20sent');logger[_0xe4c8('0x13')](_0xe4c8('0x14'),_0x95c1cf,_0xe4c8('0x15'),JSON[_0xe4c8('0x16')](_0x50239d));if(_0x50239d[_0xe4c8('0x17')]){if(_0x50239d[_0xe4c8('0x17')][_0xe4c8('0x18')]===0x1f4){logger[_0xe4c8('0x17')](_0xe4c8('0x12'),_0x95c1cf,_0x50239d[_0xe4c8('0x17')][_0xe4c8('0x19')]);return _0x9ee151(_0x50239d[_0xe4c8('0x17')]['message']);}logger[_0xe4c8('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x95c1cf,_0x50239d[_0xe4c8('0x17')]['message']);return _0x32c4c4(_0x50239d['error'][_0xe4c8('0x19')]);}else{logger['info'](_0xe4c8('0x12'),_0x95c1cf,_0xe4c8('0x15'));_0x32c4c4(_0x50239d[_0xe4c8('0x1a')]['message']);}})[_0xe4c8('0x1b')](function(_0x507a43){logger['error'](_0xe4c8('0x12'),_0x95c1cf,_0x507a43);_0x9ee151(_0x507a43);});});}exports[_0xe4c8('0x1c')]=function(_0x13e2af){var _0x37e6ad=this;return new Promise(function(_0x2e8e9d,_0x3ad318){return db[_0xe4c8('0x1d')][_0xe4c8('0x1e')](_0x13e2af['body'],{'raw':_0x13e2af[_0xe4c8('0x1f')]?_0x13e2af[_0xe4c8('0x1f')][_0xe4c8('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13e2af[_0xe4c8('0x1f')]?_0x13e2af[_0xe4c8('0x1f')][_0xe4c8('0x21')]||null:null,'attributes':_0x13e2af[_0xe4c8('0x1f')]?_0x13e2af['options'][_0xe4c8('0x22')]||null:null,'limit':_0x13e2af['options']?_0x13e2af['options'][_0xe4c8('0x23')]||null:null})[_0xe4c8('0x10')](function(_0x5c9171){logger[_0xe4c8('0x11')](_0xe4c8('0x1c'),_0x13e2af);logger[_0xe4c8('0x13')](_0xe4c8('0x1c'),_0x13e2af,JSON['stringify'](_0x5c9171));_0x2e8e9d(_0x5c9171);})[_0xe4c8('0x1b')](function(_0x4f8cbe){logger[_0xe4c8('0x17')]('UpdateChatInteraction',_0x4f8cbe['message'],_0x13e2af);_0x3ad318(_0x37e6ad['error'](0x1f4,_0x4f8cbe[_0xe4c8('0x19')]));});});};exports[_0xe4c8('0x24')]=function(_0x2920b9){return new Promise(function(_0x481ce6,_0x19c3a8){return db[_0xe4c8('0x1d')]['find']({'where':_0x2920b9[_0xe4c8('0x1f')]?_0x2920b9[_0xe4c8('0x1f')][_0xe4c8('0x21')]||null:null})['then'](function(_0x2aaa54){if(_0x2aaa54){return _0x2aaa54[_0xe4c8('0x25')](_0x2920b9['body'][_0xe4c8('0x26')],_[_0xe4c8('0x27')](_0x2920b9['body'],['ids','id'])||{});}})[_0xe4c8('0x28')](function(_0x41b0bb){logger[_0xe4c8('0x11')](_0xe4c8('0x29'),_0x2920b9);logger[_0xe4c8('0x13')]('AddTags',_0x2920b9,JSON['stringify'](_0x41b0bb));_0x481ce6(_0x41b0bb);})[_0xe4c8('0x1b')](function(_0x113e61){logger[_0xe4c8('0x17')](_0xe4c8('0x29'),_0x113e61[_0xe4c8('0x19')],_0x2920b9);_0x19c3a8(_this[_0xe4c8('0x17')](0x1f4,_0x113e61[_0xe4c8('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 8284f8d..f309eab 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 _0xcbfb=['update','emit','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x30e344,_0x5ba1dd){var _0x45013c=function(_0x612c30){while(--_0x612c30){_0x30e344['push'](_0x30e344['shift']());}};_0x45013c(++_0x5ba1dd);}(_0xcbfb,0x12a));var _0xbcbf=function(_0x8db583,_0x5bb1b3){_0x8db583=_0x8db583-0x0;var _0x276f94=_0xcbfb[_0x8db583];return _0x276f94;};'use strict';var ChatInteractionEvents=require(_0xbcbf('0x0'));var events=[_0xbcbf('0x1'),'remove',_0xbcbf('0x2')];function createListener(_0x276333,_0x22b68d){return function(_0x96f38){_0x22b68d[_0xbcbf('0x3')](_0x276333,_0x96f38);};}function removeListener(_0x29b55c,_0x2500cd){return function(){ChatInteractionEvents['removeListener'](_0x29b55c,_0x2500cd);};}exports['register']=function(_0x25f98f){for(var _0x27368e=0x0,_0x145187=events[_0xbcbf('0x4')];_0x27368e<_0x145187;_0x27368e++){var _0x2d781b=events[_0x27368e];var _0x31d7d8=createListener(_0xbcbf('0x5')+_0x2d781b,_0x25f98f);ChatInteractionEvents['on'](_0x2d781b,_0x31d7d8);}};
\ No newline at end of file
+var _0xeb6c=['save','remove','update','emit','removeListener','length','chatInteraction:','./chatInteraction.events'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xeb6c,0x1a7));var _0xceb6=function(_0x4a6eeb,_0x3da661){_0x4a6eeb=_0x4a6eeb-0x0;var _0x38acad=_0xeb6c[_0x4a6eeb];return _0x38acad;};'use strict';var ChatInteractionEvents=require(_0xceb6('0x0'));var events=[_0xceb6('0x1'),_0xceb6('0x2'),_0xceb6('0x3')];function createListener(_0x33d20f,_0x9f4699){return function(_0x5eba2e){_0x9f4699[_0xceb6('0x4')](_0x33d20f,_0x5eba2e);};}function removeListener(_0x348f47,_0x5ebbd5){return function(){ChatInteractionEvents[_0xceb6('0x5')](_0x348f47,_0x5ebbd5);};}exports['register']=function(_0x5d7835){for(var _0x357010=0x0,_0x17ea10=events[_0xceb6('0x6')];_0x357010<_0x17ea10;_0x357010++){var _0x358563=events[_0x357010];var _0x46fa5e=createListener(_0xceb6('0x7')+_0x358563,_0x5d7835);ChatInteractionEvents['on'](_0x358563,_0x46fa5e);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index dee14f8..6304c6d 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 _0xc857=['/:id/custom_update','abandon','close','delete','chatinteraction:destroy','destroy','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','diskStorage','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','addMessage','tracked','chatinteraction:addtags','addTags','put','chat','chatinteraction:update','update'];(function(_0x1a89ca,_0x27394b){var _0x29cbb2=function(_0x31e1f4){while(--_0x31e1f4){_0x1a89ca['push'](_0x1a89ca['shift']());}};_0x29cbb2(++_0x27394b);}(_0xc857,0x1ad));var _0x7c85=function(_0x16c8eb,_0xf75e2c){_0x16c8eb=_0x16c8eb-0x0;var _0x383f0d=_0xc857[_0x16c8eb];return _0x383f0d;};'use strict';var multer=require(_0x7c85('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7c85('0x1')]();var fs_extra=require(_0x7c85('0x2'));var auth=require(_0x7c85('0x3'));var interaction=require(_0x7c85('0x4'));var config=require(_0x7c85('0x5'));var controller=require(_0x7c85('0x6'));router[_0x7c85('0x7')]('/',auth[_0x7c85('0x8')](),controller['index']);router['get'](_0x7c85('0x9'),auth['isAuthenticated'](),controller[_0x7c85('0xa')]);router[_0x7c85('0x7')](_0x7c85('0xb'),auth[_0x7c85('0xc')](),controller['show']);router['get'](_0x7c85('0xd'),auth[_0x7c85('0xc')](),controller[_0x7c85('0xe')]);router[_0x7c85('0x7')](_0x7c85('0xf'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x7c85('0x10'),auth[_0x7c85('0xc')](),controller[_0x7c85('0x11')]);router['get'](_0x7c85('0x12'),auth['isAuthenticated'](),controller[_0x7c85('0x13')]);router[_0x7c85('0x14')]('/',auth[_0x7c85('0x8')](),controller[_0x7c85('0x15')]);router[_0x7c85('0x14')](_0x7c85('0x16'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x7c85('0x17')]({'destination':function(_0x52b269,_0xddef03,_0x28bc1e){_0x28bc1e(null,path['join'](config[_0x7c85('0x18')],_0x7c85('0x19')));},'filename':function(_0x28d6b8,_0x303a99,_0x3546b2){_0x3546b2(null,util[_0x7c85('0x1a')](_0x7c85('0x1b'),Date[_0x7c85('0x1c')](),_0x303a99[_0x7c85('0x1d')][_0x7c85('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x7c85('0x14')](_0x7c85('0x1f'),upload[_0x7c85('0x20')]('file'),controller['attachmentUpload']);router[_0x7c85('0x14')]('/:id/messages',auth[_0x7c85('0xc')](),controller[_0x7c85('0x21')]);router['post']('/:id/tags',auth[_0x7c85('0x8')](),interaction[_0x7c85('0x22')]('chat',_0x7c85('0x23')),controller[_0x7c85('0x24')]);router[_0x7c85('0x25')](_0x7c85('0xb'),auth[_0x7c85('0x8')](),interaction[_0x7c85('0x22')](_0x7c85('0x26'),_0x7c85('0x27')),controller[_0x7c85('0x28')]);router[_0x7c85('0x25')](_0x7c85('0x29'),controller['customUpdate']);router[_0x7c85('0x25')]('/:id/abandon',auth[_0x7c85('0xc')](),controller[_0x7c85('0x2a')]);router[_0x7c85('0x25')]('/:id/close',controller[_0x7c85('0x2b')]);router[_0x7c85('0x2c')](_0x7c85('0xb'),auth['isAuthenticated'](),interaction[_0x7c85('0x22')]('chat',_0x7c85('0x2d')),controller[_0x7c85('0x2e')]);router[_0x7c85('0x2c')]('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
+var _0x0975=['replace','/:id/attachment_upload','single','file','addMessage','/:id/tags','tracked','chatinteraction:addtags','addTags','put','/:id','chat','chatinteraction:update','customUpdate','/:id/abandon','/:id/close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','index','/describe','isAuthenticated','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','download','create','post','createVidaooSession','join','format','%s-%s','now'];(function(_0x3a8afd,_0x50a5e9){var _0x7d89e9=function(_0x515247){while(--_0x515247){_0x3a8afd['push'](_0x3a8afd['shift']());}};_0x7d89e9(++_0x50a5e9);}(_0x0975,0x1e9));var _0x5097=function(_0x4e31c1,_0xe002f8){_0x4e31c1=_0x4e31c1-0x0;var _0x3bd306=_0x0975[_0x4e31c1];return _0x3bd306;};'use strict';var multer=require(_0x5097('0x0'));var util=require(_0x5097('0x1'));var path=require(_0x5097('0x2'));var timeout=require(_0x5097('0x3'));var express=require(_0x5097('0x4'));var router=express[_0x5097('0x5')]();var fs_extra=require(_0x5097('0x6'));var auth=require(_0x5097('0x7'));var interaction=require(_0x5097('0x8'));var config=require('../../config/environment');var controller=require(_0x5097('0x9'));router[_0x5097('0xa')]('/',auth['isAuthenticated'](),controller[_0x5097('0xb')]);router[_0x5097('0xa')](_0x5097('0xc'),auth[_0x5097('0xd')](),controller[_0x5097('0xe')]);router[_0x5097('0xa')]('/:id',auth[_0x5097('0xf')](),controller[_0x5097('0x10')]);router[_0x5097('0xa')](_0x5097('0x11'),auth[_0x5097('0xf')](),controller[_0x5097('0x12')]);router[_0x5097('0xa')](_0x5097('0x13'),auth['isAuthenticated'](),controller[_0x5097('0x14')]);router['get'](_0x5097('0x15'),auth[_0x5097('0xf')](),controller[_0x5097('0x16')]);router['get']('/:id/download',auth[_0x5097('0xd')](),controller[_0x5097('0x17')]);router['post']('/',auth[_0x5097('0xd')](),controller[_0x5097('0x18')]);router[_0x5097('0x19')]('/:id/vidaoo',auth[_0x5097('0xd')](),controller[_0x5097('0x1a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1f36df,_0x714d0,_0x2d4b3e){_0x2d4b3e(null,path[_0x5097('0x1b')](config['root'],'server/files/attachments/'));},'filename':function(_0x3e18b8,_0x339ca3,_0x7bbd03){_0x7bbd03(null,util[_0x5097('0x1c')](_0x5097('0x1d'),Date[_0x5097('0x1e')](),_0x339ca3['originalname'][_0x5097('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x5097('0x20'),upload[_0x5097('0x21')](_0x5097('0x22')),controller['attachmentUpload']);router[_0x5097('0x19')](_0x5097('0x13'),auth[_0x5097('0xf')](),controller[_0x5097('0x23')]);router['post'](_0x5097('0x24'),auth[_0x5097('0xd')](),interaction[_0x5097('0x25')]('chat',_0x5097('0x26')),controller[_0x5097('0x27')]);router[_0x5097('0x28')](_0x5097('0x29'),auth[_0x5097('0xd')](),interaction[_0x5097('0x25')](_0x5097('0x2a'),_0x5097('0x2b')),controller['update']);router[_0x5097('0x28')]('/:id/custom_update',controller[_0x5097('0x2c')]);router['put'](_0x5097('0x2d'),auth[_0x5097('0xf')](),controller['abandon']);router['put'](_0x5097('0x2e'),controller['close']);router[_0x5097('0x2f')](_0x5097('0x29'),auth[_0x5097('0xd')](),interaction[_0x5097('0x25')](_0x5097('0x2a'),_0x5097('0x30')),controller[_0x5097('0x31')]);router[_0x5097('0x2f')](_0x5097('0x24'),auth[_0x5097('0xd')](),controller[_0x5097('0x32')]);module[_0x5097('0x33')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 8bc8b9a..456f5a9 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 _0x7a54=['BOOLEAN','INTEGER','sequelize','exports','TEXT'];(function(_0x1597e2,_0x388d3e){var _0x4c8c0a=function(_0x3d4795){while(--_0x3d4795){_0x1597e2['push'](_0x1597e2['shift']());}};_0x4c8c0a(++_0x388d3e);}(_0x7a54,0x106));var _0x47a5=function(_0x1085b0,_0x338354){_0x1085b0=_0x1085b0-0x0;var _0x3a1e04=_0x7a54[_0x1085b0];return _0x3a1e04;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'body':{'type':Sequelize[_0x47a5('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x47a5('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
+var _0x4975=['TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4975,0x86));var _0x5497=function(_0x2d090e,_0x2a9ff7){_0x2d090e=_0x2d090e-0x0;var _0x5b9297=_0x4975[_0x2d090e];return _0x5b9297;};'use strict';var Sequelize=require(_0x5497('0x0'));module['exports']={'body':{'type':Sequelize[_0x5497('0x1')](_0x5497('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5497('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x5497('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 40ce43b..1f5a834 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 _0x5636=['catch','show','params','find','create','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','user','fullname','role','internal','online','showWebBar','-online','VoiceQueue','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','FromId','-createdAt','all','eml-format','rimraf','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','end','json','limit','undefined','count','offset','status','set','apply','save','update','then','error','stack','name','render','merge','body','contact','message','agent','interaction','account','index','map','ChatInternalMessage','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x1a1096,_0x3ba666){var _0x5b970c=function(_0x4b2b92){while(--_0x4b2b92){_0x1a1096['push'](_0x1a1096['shift']());}};_0x5b970c(++_0x3ba666);}(_0x5636,0x102));var _0x6563=function(_0x2bdde9,_0x270c2f){_0x2bdde9=_0x2bdde9-0x0;var _0x5da617=_0x5636[_0x2bdde9];return _0x5da617;};'use strict';var emlformat=require(_0x6563('0x0'));var rimraf=require(_0x6563('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6563('0x2'));var BPromise=require(_0x6563('0x3'));var Mustache=require(_0x6563('0x4'));var util=require('util');var path=require(_0x6563('0x5'));var sox=require(_0x6563('0x6'));var csv=require(_0x6563('0x7'));var ejs=require(_0x6563('0x8'));var fs=require('fs');var fs_extra=require(_0x6563('0x9'));var _=require(_0x6563('0xa'));var squel=require(_0x6563('0xb'));var crypto=require(_0x6563('0xc'));var jsforce=require(_0x6563('0xd'));var deskjs=require(_0x6563('0xe'));var toCsv=require(_0x6563('0x7'));var querystring=require(_0x6563('0xf'));var Papa=require(_0x6563('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6563('0x11'));var as=require(_0x6563('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6563('0x13'));var config=require(_0x6563('0x14'));var licenseUtil=require(_0x6563('0x15'));var db=require(_0x6563('0x16'))['db'];config[_0x6563('0x17')]=_[_0x6563('0x18')](config[_0x6563('0x17')],{'host':_0x6563('0x19'),'port':0x18eb});var socket=require(_0x6563('0x1a'))(new Redis(config['redis']));require(_0x6563('0x1b'))['register'](socket);function respondWithStatusCode(_0x37131e,_0x59bee1){_0x59bee1=_0x59bee1||0xcc;return function(_0x33f8e4){if(_0x33f8e4){return _0x37131e[_0x6563('0x1c')](_0x59bee1);}return _0x37131e['status'](_0x59bee1)[_0x6563('0x1d')]();};}function respondWithResult(_0x11baa2,_0x477d9b){_0x477d9b=_0x477d9b||0xc8;return function(_0xd398ce){if(_0xd398ce){return _0x11baa2['status'](_0x477d9b)[_0x6563('0x1e')](_0xd398ce);}};}function respondWithFilteredResult(_0x589632,_0x502694){return function(_0x47972a){if(_0x47972a){var _0x14c6a6=typeof _0x502694['offset']==='undefined'&&typeof _0x502694[_0x6563('0x1f')]===_0x6563('0x20');var _0x17a29f=_0x47972a[_0x6563('0x21')];var _0xf8b544=_0x14c6a6?0x0:_0x502694[_0x6563('0x22')];var _0x37ba3=_0x14c6a6?_0x47972a[_0x6563('0x21')]:_0x502694[_0x6563('0x22')]+_0x502694['limit'];var _0x2f2905;if(_0x37ba3>=_0x17a29f){_0x37ba3=_0x17a29f;_0x2f2905=0xc8;}else{_0x2f2905=0xce;}_0x589632[_0x6563('0x23')](_0x2f2905);return _0x589632[_0x6563('0x24')]('Content-Range',_0xf8b544+'-'+_0x37ba3+'/'+_0x17a29f)[_0x6563('0x1e')](_0x47972a);}return null;};}function patchUpdates(_0x5c37bb){return function(_0x5953c5){try{jsonpatch[_0x6563('0x25')](_0x5953c5,_0x5c37bb,!![]);}catch(_0x5610b0){return BPromise['reject'](_0x5610b0);}return _0x5953c5[_0x6563('0x26')]();};}function saveUpdates(_0x492f45,_0x1097d0){return function(_0x19f34e){if(_0x19f34e){return _0x19f34e[_0x6563('0x27')](_0x492f45)['then'](function(_0xd860d5){return _0xd860d5;});}return null;};}function removeEntity(_0x51ff06,_0x7ea857){return function(_0x1590e6){if(_0x1590e6){return _0x1590e6['destroy']()[_0x6563('0x28')](function(){_0x51ff06[_0x6563('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ddb2b,_0x5b03a7){return function(_0x1fe1cb){if(!_0x1fe1cb){_0x2ddb2b['sendStatus'](0x194);}return _0x1fe1cb;};}function handleError(_0x480408,_0x30f05a){_0x30f05a=_0x30f05a||0x1f4;return function(_0x118d31){logger[_0x6563('0x29')](_0x118d31[_0x6563('0x2a')]);if(_0x118d31[_0x6563('0x2b')]){delete _0x118d31['name'];}_0x480408[_0x6563('0x23')](_0x30f05a)['send'](_0x118d31);};}function getMustacheRender(_0x5b100b,_0x3582c9){return Mustache[_0x6563('0x2c')](_0x5b100b,_[_0x6563('0x2d')](_0x3582c9[_0x6563('0x2e')],{'contact':_0x3582c9[_0x6563('0x2f')],'message':_0x3582c9[_0x6563('0x30')],'agent':_0x3582c9[_0x6563('0x31')],'interaction':_0x3582c9[_0x6563('0x32')],'account':_0x3582c9[_0x6563('0x33')]}))||'';}exports[_0x6563('0x34')]=function(_0x59b1a6,_0x9b3d86){var _0x30b67c={},_0x29fb9d={},_0x1558fb={'count':0x0,'rows':[]};var _0x29ab06=_[_0x6563('0x35')](db[_0x6563('0x36')]['rawAttributes'],function(_0x8cf1){return{'name':_0x8cf1[_0x6563('0x37')],'type':_0x8cf1[_0x6563('0x38')][_0x6563('0x39')]};});_0x29fb9d[_0x6563('0x3a')]=_[_0x6563('0x35')](_0x29ab06,'name');_0x29fb9d[_0x6563('0x3b')]=_[_0x6563('0x3c')](_0x59b1a6[_0x6563('0x3b')]);_0x29fb9d[_0x6563('0x3d')]=_[_0x6563('0x3e')](_0x29fb9d[_0x6563('0x3a')],_0x29fb9d[_0x6563('0x3b')]);_0x30b67c['attributes']=_[_0x6563('0x3e')](_0x29fb9d[_0x6563('0x3a')],qs['fields'](_0x59b1a6[_0x6563('0x3b')][_0x6563('0x3f')]));_0x30b67c['attributes']=_0x30b67c['attributes'][_0x6563('0x40')]?_0x30b67c[_0x6563('0x41')]:_0x29fb9d[_0x6563('0x3a')];if(!_0x59b1a6[_0x6563('0x3b')]['hasOwnProperty'](_0x6563('0x42'))){_0x30b67c[_0x6563('0x1f')]=qs['limit'](_0x59b1a6[_0x6563('0x3b')][_0x6563('0x1f')]);_0x30b67c[_0x6563('0x22')]=qs[_0x6563('0x22')](_0x59b1a6[_0x6563('0x3b')][_0x6563('0x22')]);}_0x30b67c[_0x6563('0x43')]=qs[_0x6563('0x44')](_0x59b1a6[_0x6563('0x3b')]['sort']);_0x30b67c[_0x6563('0x45')]=qs[_0x6563('0x3d')](_[_0x6563('0x46')](_0x59b1a6[_0x6563('0x3b')],_0x29fb9d['filters']),_0x29ab06);if(_0x59b1a6['query'][_0x6563('0x47')]){_0x30b67c[_0x6563('0x45')]=_[_0x6563('0x2d')](_0x30b67c['where'],{'$or':_[_0x6563('0x35')](_0x29ab06,function(_0x50c3ce){if(_0x50c3ce[_0x6563('0x38')]!==_0x6563('0x48')){var _0x57c1bf={};_0x57c1bf[_0x50c3ce[_0x6563('0x2b')]]={'$like':'%'+_0x59b1a6[_0x6563('0x3b')][_0x6563('0x47')]+'%'};return _0x57c1bf;}})});}_0x30b67c=_[_0x6563('0x2d')]({},_0x30b67c,_0x59b1a6[_0x6563('0x49')]);var _0x1d742f={'where':_0x30b67c[_0x6563('0x45')]};return db[_0x6563('0x36')][_0x6563('0x21')](_0x1d742f)[_0x6563('0x28')](function(_0x2acb52){_0x1558fb['count']=_0x2acb52;if(_0x59b1a6['query'][_0x6563('0x4a')]){_0x30b67c[_0x6563('0x4b')]=[{'all':!![]}];}return db[_0x6563('0x36')][_0x6563('0x4c')](_0x30b67c);})[_0x6563('0x28')](function(_0x464d45){_0x1558fb[_0x6563('0x4d')]=_0x464d45;return _0x1558fb;})['then'](respondWithFilteredResult(_0x9b3d86,_0x30b67c))[_0x6563('0x4e')](handleError(_0x9b3d86,null));};exports[_0x6563('0x4f')]=function(_0x41fff0,_0xdb9a23){var _0x4c56ad={'raw':!![],'where':{'id':_0x41fff0[_0x6563('0x50')]['id']}},_0x355c97={};_0x355c97[_0x6563('0x3a')]=_[_0x6563('0x3c')](db[_0x6563('0x36')]['rawAttributes']);_0x355c97['query']=_[_0x6563('0x3c')](_0x41fff0[_0x6563('0x3b')]);_0x355c97[_0x6563('0x3d')]=_['intersection'](_0x355c97[_0x6563('0x3a')],_0x355c97[_0x6563('0x3b')]);_0x4c56ad[_0x6563('0x41')]=_[_0x6563('0x3e')](_0x355c97['model'],qs[_0x6563('0x3f')](_0x41fff0[_0x6563('0x3b')][_0x6563('0x3f')]));_0x4c56ad['attributes']=_0x4c56ad[_0x6563('0x41')]['length']?_0x4c56ad[_0x6563('0x41')]:_0x355c97['model'];if(_0x41fff0['query'][_0x6563('0x4a')]){_0x4c56ad[_0x6563('0x4b')]=[{'all':!![]}];}_0x4c56ad=_[_0x6563('0x2d')]({},_0x4c56ad,_0x41fff0[_0x6563('0x49')]);return db[_0x6563('0x36')][_0x6563('0x51')](_0x4c56ad)[_0x6563('0x28')](handleEntityNotFound(_0xdb9a23,null))[_0x6563('0x28')](respondWithResult(_0xdb9a23,null))[_0x6563('0x4e')](handleError(_0xdb9a23,null));};exports[_0x6563('0x52')]=function(_0x4951a6,_0x9469fe){return db['ChatInternalMessage'][_0x6563('0x52')](_0x4951a6[_0x6563('0x2e')],{})[_0x6563('0x28')](respondWithResult(_0x9469fe,0xc9))['catch'](handleError(_0x9469fe,null));};exports[_0x6563('0x27')]=function(_0x141f0c,_0x4f9884){if(_0x141f0c[_0x6563('0x2e')]['id']){delete _0x141f0c[_0x6563('0x2e')]['id'];}return db[_0x6563('0x36')][_0x6563('0x51')]({'where':{'id':_0x141f0c[_0x6563('0x50')]['id']}})['then'](handleEntityNotFound(_0x4f9884,null))[_0x6563('0x28')](saveUpdates(_0x141f0c['body'],null))[_0x6563('0x28')](respondWithResult(_0x4f9884,null))['catch'](handleError(_0x4f9884,null));};exports[_0x6563('0x53')]=function(_0x5992c8,_0x55e002){return db['ChatInternalMessage']['find']({'where':{'id':_0x5992c8[_0x6563('0x50')]['id']}})['then'](handleEntityNotFound(_0x55e002,null))[_0x6563('0x28')](removeEntity(_0x55e002,null))['catch'](handleError(_0x55e002,null));};exports[_0x6563('0x54')]=function(_0x10a127,_0x426664){return db[_0x6563('0x36')][_0x6563('0x54')]()[_0x6563('0x28')](respondWithResult(_0x426664,null))[_0x6563('0x4e')](handleError(_0x426664,null));};function wrapUser(_0xdc94f8){return function(_0x31623f){var _0x5827da=_0xdc94f8[_0x6563('0x55')]({'plain':!![]});_0x5827da[_0x6563('0x56')]=[];if(_0x31623f){_0x5827da[_0x6563('0x57')]=_0x31623f[_0x6563('0x58')];_0x5827da[_0x6563('0x59')]=_0x31623f;}else{_0x5827da[_0x6563('0x57')]=moment(0x0)[_0x6563('0x5a')](_0x6563('0x5b'));_0x5827da[_0x6563('0x59')]={};}return _0x5827da;};}exports[_0x6563('0x5c')]=function(_0x1fc431,_0x5c456b,_0x1a3317){var _0x1a6adb=[];return db[_0x6563('0x5d')][_0x6563('0x4c')]({'where':{'role':[_0x6563('0x31'),_0x6563('0x5e'),_0x6563('0x5f')]},'attributes':['id',_0x6563('0x60'),'name',_0x6563('0x61'),'userpic',_0x6563('0x62'),_0x6563('0x63'),'lastLoginAt','allowmessenger',_0x6563('0x64')],'order':qs[_0x6563('0x44')](_0x6563('0x65')),'include':[{'model':db[_0x6563('0x66')],'as':'VoiceQueues','attributes':['id',_0x6563('0x2b'),'type'],'through':{'attributes':[]}}]})[_0x6563('0x28')](function(_0x29aecb){if(_0x29aecb){var _0x5b0fe8=_0x1fc431['user'][_0x6563('0x55')]({'plain':!![]});if(!_0x5b0fe8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b0fe8['role']===_0x6563('0x5f')){return db['UserProfileSection'][_0x6563('0x51')]({'where':{'name':_0x6563('0x67'),'userProfileId':_0x5b0fe8[_0x6563('0x68')]},'raw':!![]})[_0x6563('0x28')](function(_0x4829ab){if(_0x4829ab){if(_0x4829ab[_0x6563('0x69')]===0x0){return db[_0x6563('0x6a')][_0x6563('0x4c')]({'where':{'sectionId':_0x4829ab['id']},'raw':!![]})[_0x6563('0x28')](function(_0x3ffb7f){var _0x2d4694=[];if(_[_0x6563('0x6b')](_0x3ffb7f)){_0x2d4694=_[_0x6563('0x47')](_0x29aecb,function(_0x58728d){if(_0x58728d['role']!==_0x6563('0x31')){return _0x58728d;}});return _0x2d4694;}else{for(var _0x3a756a=0x0;_0x3a756a<_0x29aecb['length'];_0x3a756a++){var _0x5924a3=_0x29aecb[_0x3a756a];if(_0x5924a3['role']===_0x6563('0x31')){var _0x2c02d6=_[_0x6563('0x51')](_0x3ffb7f,function(_0x149b74){return _0x149b74['resourceId']===_0x5924a3['id'];});if(_0x2c02d6)_0x2d4694[_0x6563('0x6c')](_0x5924a3);}else{_0x2d4694[_0x6563('0x6c')](_0x5924a3);}}return _0x2d4694;}});}else{return _0x29aecb;}}else{var _0x386597=_[_0x6563('0x47')](_0x29aecb,function(_0xb55389){if(_0xb55389['role']!=='agent'){return _0xb55389;}});return _0x386597;}});}else{return _0x29aecb;}}})[_0x6563('0x28')](function(_0x1d7b5d){var _0x2426cd=[];if(_0x1d7b5d){_0x1a6adb=_0x1d7b5d;for(var _0x5d365e=0x0;_0x5d365e<_0x1d7b5d[_0x6563('0x40')];_0x5d365e+=0x1){_0x1a6adb[_0x5d365e]['messages']=[];_0x2426cd[_0x6563('0x6c')](db[_0x6563('0x36')][_0x6563('0x51')]({'where':{'FromId':[_0x1fc431[_0x6563('0x5f')]['id'],_0x1d7b5d[_0x5d365e]['id']],'ToId':[_0x1fc431[_0x6563('0x5f')]['id'],_0x1d7b5d[_0x5d365e]['id']],'ChatGroupId':null},'attributes':['id',_0x6563('0x58'),_0x6563('0x6d'),'ToId','read',_0x6563('0x2e')],'order':qs[_0x6563('0x44')](_0x6563('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x6563('0x28')](wrapUser(_0x1d7b5d[_0x5d365e])));}return BPromise[_0x6563('0x6f')](_0x2426cd);}return[];})[_0x6563('0x28')](function(_0x515e98){return{'rows':_0x515e98,'count':_0x515e98['length']};})['then'](respondWithResult(_0x5c456b,null))[_0x6563('0x4e')](handleError(_0x5c456b,null));};
\ No newline at end of file
+var _0x3667=['localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','merge','body','account','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','ChatInternalMessage','count','includeAll','include','findAll','rows','catch','params','length','options','find','create','update','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','fullname','role','userpic','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','user','userProfileId','autoAssociation','isEmpty','resourceId','push','FromId','ToId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7366('0x0'));var rimraf=require(_0x7366('0x1'));var zipdir=require(_0x7366('0x2'));var jsonpatch=require(_0x7366('0x3'));var rp=require(_0x7366('0x4'));var moment=require('moment');var BPromise=require(_0x7366('0x5'));var Mustache=require(_0x7366('0x6'));var util=require('util');var path=require(_0x7366('0x7'));var sox=require(_0x7366('0x8'));var csv=require(_0x7366('0x9'));var ejs=require(_0x7366('0xa'));var fs=require('fs');var fs_extra=require(_0x7366('0xb'));var _=require('lodash');var squel=require(_0x7366('0xc'));var crypto=require(_0x7366('0xd'));var jsforce=require(_0x7366('0xe'));var deskjs=require(_0x7366('0xf'));var toCsv=require(_0x7366('0x9'));var querystring=require(_0x7366('0x10'));var Papa=require(_0x7366('0x11'));var Redis=require(_0x7366('0x12'));var authService=require(_0x7366('0x13'));var qs=require(_0x7366('0x14'));var as=require(_0x7366('0x15'));var hardwareService=require(_0x7366('0x16'));var logger=require(_0x7366('0x17'))(_0x7366('0x18'));var utils=require(_0x7366('0x19'));var config=require(_0x7366('0x1a'));var licenseUtil=require(_0x7366('0x1b'));var db=require(_0x7366('0x1c'))['db'];config[_0x7366('0x1d')]=_[_0x7366('0x1e')](config[_0x7366('0x1d')],{'host':_0x7366('0x1f'),'port':0x18eb});var socket=require(_0x7366('0x20'))(new Redis(config[_0x7366('0x1d')]));require(_0x7366('0x21'))[_0x7366('0x22')](socket);function respondWithStatusCode(_0x22562f,_0xf4114){_0xf4114=_0xf4114||0xcc;return function(_0x4dd111){if(_0x4dd111){return _0x22562f[_0x7366('0x23')](_0xf4114);}return _0x22562f[_0x7366('0x24')](_0xf4114)[_0x7366('0x25')]();};}function respondWithResult(_0x2c0422,_0xe2c87b){_0xe2c87b=_0xe2c87b||0xc8;return function(_0x431c01){if(_0x431c01){return _0x2c0422[_0x7366('0x24')](_0xe2c87b)[_0x7366('0x26')](_0x431c01);}};}function respondWithFilteredResult(_0x83e5d5,_0x41113f){return function(_0x1a71f5){if(_0x1a71f5){var _0x49e50b=typeof _0x41113f[_0x7366('0x27')]==='undefined'&&typeof _0x41113f[_0x7366('0x28')]===_0x7366('0x29');var _0x3f23cd=_0x1a71f5['count'];var _0x29f725=_0x49e50b?0x0:_0x41113f[_0x7366('0x27')];var _0x3cfde9=_0x49e50b?_0x1a71f5['count']:_0x41113f[_0x7366('0x27')]+_0x41113f[_0x7366('0x28')];var _0x482946;if(_0x3cfde9>=_0x3f23cd){_0x3cfde9=_0x3f23cd;_0x482946=0xc8;}else{_0x482946=0xce;}_0x83e5d5[_0x7366('0x24')](_0x482946);return _0x83e5d5[_0x7366('0x2a')](_0x7366('0x2b'),_0x29f725+'-'+_0x3cfde9+'/'+_0x3f23cd)[_0x7366('0x26')](_0x1a71f5);}return null;};}function patchUpdates(_0x3c30a2){return function(_0x1d3139){try{jsonpatch[_0x7366('0x2c')](_0x1d3139,_0x3c30a2,!![]);}catch(_0x22ed7e){return BPromise[_0x7366('0x2d')](_0x22ed7e);}return _0x1d3139[_0x7366('0x2e')]();};}function saveUpdates(_0x12aed6,_0x1dc875){return function(_0x36903f){if(_0x36903f){return _0x36903f['update'](_0x12aed6)[_0x7366('0x2f')](function(_0x4fe7cf){return _0x4fe7cf;});}return null;};}function removeEntity(_0x379146,_0x4ab987){return function(_0x5e30fb){if(_0x5e30fb){return _0x5e30fb[_0x7366('0x30')]()['then'](function(){_0x379146[_0x7366('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x256633,_0x191177){return function(_0x5c37e2){if(!_0x5c37e2){_0x256633[_0x7366('0x23')](0x194);}return _0x5c37e2;};}function handleError(_0x565aa7,_0x31c642){_0x31c642=_0x31c642||0x1f4;return function(_0x2b61af){logger['error'](_0x2b61af[_0x7366('0x31')]);if(_0x2b61af['name']){delete _0x2b61af[_0x7366('0x32')];}_0x565aa7[_0x7366('0x24')](_0x31c642)[_0x7366('0x33')](_0x2b61af);};}function getMustacheRender(_0x28386f,_0x2dda4b){return Mustache['render'](_0x28386f,_[_0x7366('0x34')](_0x2dda4b[_0x7366('0x35')],{'contact':_0x2dda4b['contact'],'message':_0x2dda4b['message'],'agent':_0x2dda4b['agent'],'interaction':_0x2dda4b['interaction'],'account':_0x2dda4b[_0x7366('0x36')]}))||'';}exports[_0x7366('0x37')]=function(_0x163a29,_0x15286a){var _0x59f032={},_0x3ca5e6={},_0x2abf10={'count':0x0,'rows':[]};var _0xdaffd3=_[_0x7366('0x38')](db['ChatInternalMessage'][_0x7366('0x39')],function(_0x311dab){return{'name':_0x311dab['fieldName'],'type':_0x311dab[_0x7366('0x3a')][_0x7366('0x3b')]};});_0x3ca5e6[_0x7366('0x3c')]=_[_0x7366('0x38')](_0xdaffd3,_0x7366('0x32'));_0x3ca5e6[_0x7366('0x3d')]=_[_0x7366('0x3e')](_0x163a29[_0x7366('0x3d')]);_0x3ca5e6[_0x7366('0x3f')]=_['intersection'](_0x3ca5e6[_0x7366('0x3c')],_0x3ca5e6[_0x7366('0x3d')]);_0x59f032['attributes']=_[_0x7366('0x40')](_0x3ca5e6[_0x7366('0x3c')],qs[_0x7366('0x41')](_0x163a29['query'][_0x7366('0x41')]));_0x59f032['attributes']=_0x59f032[_0x7366('0x42')]['length']?_0x59f032['attributes']:_0x3ca5e6[_0x7366('0x3c')];if(!_0x163a29['query'][_0x7366('0x43')](_0x7366('0x44'))){_0x59f032['limit']=qs[_0x7366('0x28')](_0x163a29['query'][_0x7366('0x28')]);_0x59f032[_0x7366('0x27')]=qs[_0x7366('0x27')](_0x163a29[_0x7366('0x3d')]['offset']);}_0x59f032[_0x7366('0x45')]=qs[_0x7366('0x46')](_0x163a29[_0x7366('0x3d')]['sort']);_0x59f032[_0x7366('0x47')]=qs[_0x7366('0x3f')](_[_0x7366('0x48')](_0x163a29[_0x7366('0x3d')],_0x3ca5e6[_0x7366('0x3f')]),_0xdaffd3);if(_0x163a29[_0x7366('0x3d')][_0x7366('0x49')]){_0x59f032['where']=_['merge'](_0x59f032[_0x7366('0x47')],{'$or':_[_0x7366('0x38')](_0xdaffd3,function(_0x59cd9a){if(_0x59cd9a[_0x7366('0x3a')]!==_0x7366('0x4a')){var _0x550fe2={};_0x550fe2[_0x59cd9a[_0x7366('0x32')]]={'$like':'%'+_0x163a29['query'][_0x7366('0x49')]+'%'};return _0x550fe2;}})});}_0x59f032=_[_0x7366('0x34')]({},_0x59f032,_0x163a29['options']);var _0x5b5a95={'where':_0x59f032[_0x7366('0x47')]};return db[_0x7366('0x4b')][_0x7366('0x4c')](_0x5b5a95)[_0x7366('0x2f')](function(_0x4d3df0){_0x2abf10[_0x7366('0x4c')]=_0x4d3df0;if(_0x163a29[_0x7366('0x3d')][_0x7366('0x4d')]){_0x59f032[_0x7366('0x4e')]=[{'all':!![]}];}return db[_0x7366('0x4b')][_0x7366('0x4f')](_0x59f032);})[_0x7366('0x2f')](function(_0x593a71){_0x2abf10[_0x7366('0x50')]=_0x593a71;return _0x2abf10;})[_0x7366('0x2f')](respondWithFilteredResult(_0x15286a,_0x59f032))[_0x7366('0x51')](handleError(_0x15286a,null));};exports['show']=function(_0x85e16,_0x16861e){var _0x5c3e45={'raw':!![],'where':{'id':_0x85e16[_0x7366('0x52')]['id']}},_0x135ad2={};_0x135ad2[_0x7366('0x3c')]=_['keys'](db[_0x7366('0x4b')][_0x7366('0x39')]);_0x135ad2[_0x7366('0x3d')]=_['keys'](_0x85e16[_0x7366('0x3d')]);_0x135ad2[_0x7366('0x3f')]=_[_0x7366('0x40')](_0x135ad2['model'],_0x135ad2[_0x7366('0x3d')]);_0x5c3e45[_0x7366('0x42')]=_[_0x7366('0x40')](_0x135ad2[_0x7366('0x3c')],qs['fields'](_0x85e16[_0x7366('0x3d')][_0x7366('0x41')]));_0x5c3e45[_0x7366('0x42')]=_0x5c3e45[_0x7366('0x42')][_0x7366('0x53')]?_0x5c3e45[_0x7366('0x42')]:_0x135ad2[_0x7366('0x3c')];if(_0x85e16[_0x7366('0x3d')][_0x7366('0x4d')]){_0x5c3e45['include']=[{'all':!![]}];}_0x5c3e45=_[_0x7366('0x34')]({},_0x5c3e45,_0x85e16[_0x7366('0x54')]);return db['ChatInternalMessage'][_0x7366('0x55')](_0x5c3e45)[_0x7366('0x2f')](handleEntityNotFound(_0x16861e,null))['then'](respondWithResult(_0x16861e,null))[_0x7366('0x51')](handleError(_0x16861e,null));};exports['create']=function(_0x3a16d6,_0x24411c){return db[_0x7366('0x4b')][_0x7366('0x56')](_0x3a16d6['body'],{})[_0x7366('0x2f')](respondWithResult(_0x24411c,0xc9))[_0x7366('0x51')](handleError(_0x24411c,null));};exports[_0x7366('0x57')]=function(_0x46a532,_0x1de0a7){if(_0x46a532[_0x7366('0x35')]['id']){delete _0x46a532[_0x7366('0x35')]['id'];}return db[_0x7366('0x4b')][_0x7366('0x55')]({'where':{'id':_0x46a532[_0x7366('0x52')]['id']}})[_0x7366('0x2f')](handleEntityNotFound(_0x1de0a7,null))[_0x7366('0x2f')](saveUpdates(_0x46a532['body'],null))[_0x7366('0x2f')](respondWithResult(_0x1de0a7,null))['catch'](handleError(_0x1de0a7,null));};exports['destroy']=function(_0x1d488b,_0xf8248f){return db['ChatInternalMessage'][_0x7366('0x55')]({'where':{'id':_0x1d488b[_0x7366('0x52')]['id']}})['then'](handleEntityNotFound(_0xf8248f,null))['then'](removeEntity(_0xf8248f,null))[_0x7366('0x51')](handleError(_0xf8248f,null));};exports['describe']=function(_0x178e71,_0x3eb766){return db['ChatInternalMessage'][_0x7366('0x58')]()[_0x7366('0x2f')](respondWithResult(_0x3eb766,null))[_0x7366('0x51')](handleError(_0x3eb766,null));};function wrapUser(_0x5506e7){return function(_0x2f678a){var _0x3b1daa=_0x5506e7[_0x7366('0x59')]({'plain':!![]});_0x3b1daa[_0x7366('0x5a')]=[];if(_0x2f678a){_0x3b1daa['lastMessageAt']=_0x2f678a[_0x7366('0x5b')];_0x3b1daa[_0x7366('0x5c')]=_0x2f678a;}else{_0x3b1daa[_0x7366('0x5d')]=moment(0x0)[_0x7366('0x5e')](_0x7366('0x5f'));_0x3b1daa['lastMessage']={};}return _0x3b1daa;};}exports[_0x7366('0x60')]=function(_0x9080f4,_0x5b3160,_0x1ec71e){var _0x54c117=[];return db[_0x7366('0x61')]['findAll']({'where':{'role':[_0x7366('0x62'),_0x7366('0x63'),'user']},'attributes':['id',_0x7366('0x64'),_0x7366('0x32'),_0x7366('0x65'),_0x7366('0x66'),'internal','online',_0x7366('0x67'),'allowmessenger',_0x7366('0x68')],'order':qs[_0x7366('0x46')](_0x7366('0x69')),'include':[{'model':db[_0x7366('0x6a')],'as':_0x7366('0x6b'),'attributes':['id',_0x7366('0x32'),_0x7366('0x3a')],'through':{'attributes':[]}}]})[_0x7366('0x2f')](function(_0x2abe8d){if(_0x2abe8d){var _0x4ce411=_0x9080f4[_0x7366('0x6c')]['get']({'plain':!![]});if(!_0x4ce411)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ce411['role']===_0x7366('0x6c')){return db['UserProfileSection'][_0x7366('0x55')]({'where':{'name':'Agents','userProfileId':_0x4ce411[_0x7366('0x6d')]},'raw':!![]})['then'](function(_0x32e6d5){if(_0x32e6d5){if(_0x32e6d5[_0x7366('0x6e')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x32e6d5['id']},'raw':!![]})[_0x7366('0x2f')](function(_0x22ad58){var _0x3f7b82=[];if(_[_0x7366('0x6f')](_0x22ad58)){_0x3f7b82=_['filter'](_0x2abe8d,function(_0x349bd2){if(_0x349bd2[_0x7366('0x65')]!==_0x7366('0x62')){return _0x349bd2;}});return _0x3f7b82;}else{for(var _0x5d5f01=0x0;_0x5d5f01<_0x2abe8d['length'];_0x5d5f01++){var _0x26ab9b=_0x2abe8d[_0x5d5f01];if(_0x26ab9b[_0x7366('0x65')]===_0x7366('0x62')){var _0x4e0cae=_[_0x7366('0x55')](_0x22ad58,function(_0x1e121f){return _0x1e121f[_0x7366('0x70')]===_0x26ab9b['id'];});if(_0x4e0cae)_0x3f7b82[_0x7366('0x71')](_0x26ab9b);}else{_0x3f7b82[_0x7366('0x71')](_0x26ab9b);}}return _0x3f7b82;}});}else{return _0x2abe8d;}}else{var _0x795971=_[_0x7366('0x49')](_0x2abe8d,function(_0x38c65b){if(_0x38c65b[_0x7366('0x65')]!==_0x7366('0x62')){return _0x38c65b;}});return _0x795971;}});}else{return _0x2abe8d;}}})[_0x7366('0x2f')](function(_0x5d5c2e){var _0x15d111=[];if(_0x5d5c2e){_0x54c117=_0x5d5c2e;for(var _0x866cda=0x0;_0x866cda<_0x5d5c2e['length'];_0x866cda+=0x1){_0x54c117[_0x866cda][_0x7366('0x5a')]=[];_0x15d111['push'](db['ChatInternalMessage'][_0x7366('0x55')]({'where':{'FromId':[_0x9080f4[_0x7366('0x6c')]['id'],_0x5d5c2e[_0x866cda]['id']],'ToId':[_0x9080f4[_0x7366('0x6c')]['id'],_0x5d5c2e[_0x866cda]['id']],'ChatGroupId':null},'attributes':['id',_0x7366('0x5b'),_0x7366('0x72'),_0x7366('0x73'),'read',_0x7366('0x35')],'order':qs[_0x7366('0x46')](_0x7366('0x74')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x5d5c2e[_0x866cda])));}return BPromise[_0x7366('0x75')](_0x15d111);}return[];})['then'](function(_0x495adb){return{'rows':_0x495adb,'count':_0x495adb[_0x7366('0x53')]};})['then'](respondWithResult(_0x5b3160,null))[_0x7366('0x51')](handleError(_0x5b3160,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index d671077..2759f1b 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 _0x8aaa=['update','remove','emit','hasOwnProperty','events','../../mysqldb','ChatInternalMessage','save'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x8aaa,0x64));var _0xa8aa=function(_0xbf09ab,_0x251a19){_0xbf09ab=_0xbf09ab-0x0;var _0x2a9aef=_0x8aaa[_0xbf09ab];return _0x2a9aef;};'use strict';var EventEmitter=require(_0xa8aa('0x0'));var ChatInternalMessage=require(_0xa8aa('0x1'))['db'][_0xa8aa('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa8aa('0x3'),'afterUpdate':_0xa8aa('0x4'),'afterDestroy':_0xa8aa('0x5')};function emitEvent(_0x2c074e){return function(_0x28fa1b,_0x3443c7,_0x1ae929){ChatInternalMessageEvents[_0xa8aa('0x6')](_0x2c074e+':'+_0x28fa1b['id'],_0x28fa1b);ChatInternalMessageEvents['emit'](_0x2c074e,_0x28fa1b);_0x1ae929(null);};}for(var e in events){if(events[_0xa8aa('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x4aa3=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0xbf1132,_0x176b34){var _0xe63ce4=function(_0x52d8ed){while(--_0x52d8ed){_0xbf1132['push'](_0xbf1132['shift']());}};_0xe63ce4(++_0x176b34);}(_0x4aa3,0x174));var _0x34aa=function(_0x4ebb0f,_0x5031cb){_0x4ebb0f=_0x4ebb0f-0x0;var _0x39a2c5=_0x4aa3[_0x4ebb0f];return _0x39a2c5;};'use strict';var EventEmitter=require(_0x34aa('0x0'));var ChatInternalMessage=require(_0x34aa('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x34aa('0x2')](0x0);var events={'afterCreate':_0x34aa('0x3'),'afterUpdate':'update','afterDestroy':_0x34aa('0x4')};function emitEvent(_0x3c70d9){return function(_0x4a81e7,_0x3f367e,_0x384e96){ChatInternalMessageEvents[_0x34aa('0x5')](_0x3c70d9+':'+_0x4a81e7['id'],_0x4a81e7);ChatInternalMessageEvents['emit'](_0x3c70d9,_0x4a81e7);_0x384e96(null);};}for(var e in events){if(events[_0x34aa('0x6')](e)){var event=events[e];ChatInternalMessage[_0x34aa('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 2d9fc7f..0e8b9b1 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 _0xa9e0=['define','ChatInternalMessage','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});};
\ No newline at end of file
+var _0xb7e7=['ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','define'];(function(_0x56ac35,_0x555584){var _0x1f6cad=function(_0x3c11d2){while(--_0x3c11d2){_0x56ac35['push'](_0x56ac35['shift']());}};_0x1f6cad(++_0x555584);}(_0xb7e7,0x121));var _0x7b7e=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xb7e7[_0x13b8f3];return _0x1a6d06;};'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':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7b7e('0x9'),'collate':_0x7b7e('0xa')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 0a281c2..b419b35 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 _0xd308=['rpc','../../config/environment','jayson/promise','http','redis','defaults','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd308,0x118));var _0x8d30=function(_0x4dcf75,_0x12dbfa){_0x4dcf75=_0x4dcf75-0x0;var _0x38ea00=_0xd308[_0x4dcf75];return _0x38ea00;};'use strict';var _=require(_0x8d30('0x0'));var util=require(_0x8d30('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8d30('0x2'));var fs=require('fs');var Redis=require(_0x8d30('0x3'));var db=require(_0x8d30('0x4'))['db'];var utils=require(_0x8d30('0x5'));var logger=require('../../config/logger')(_0x8d30('0x6'));var config=require(_0x8d30('0x7'));var jayson=require(_0x8d30('0x8'));var client=jayson['client'][_0x8d30('0x9')]({'port':0x232a});config[_0x8d30('0xa')]=_[_0x8d30('0xb')](config[_0x8d30('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8d30('0xa')]));require(_0x8d30('0xc'))['register'](socket);function respondWithRpcPromise(_0x48b458,_0x318fc7,_0x16eb27){return new BPromise(function(_0x314d0a,_0x2895ee){return client[_0x8d30('0xd')](_0x48b458,_0x16eb27)[_0x8d30('0xe')](function(_0x399428){logger[_0x8d30('0xf')](_0x8d30('0x10'),_0x318fc7,_0x8d30('0x11'));logger[_0x8d30('0x12')](_0x8d30('0x13'),_0x318fc7,_0x8d30('0x11'),JSON[_0x8d30('0x14')](_0x399428));if(_0x399428[_0x8d30('0x15')]){if(_0x399428['error'][_0x8d30('0x16')]===0x1f4){logger[_0x8d30('0x15')](_0x8d30('0x10'),_0x318fc7,_0x399428[_0x8d30('0x15')][_0x8d30('0x17')]);return _0x2895ee(_0x399428[_0x8d30('0x15')]['message']);}logger[_0x8d30('0x15')](_0x8d30('0x10'),_0x318fc7,_0x399428['error'][_0x8d30('0x17')]);return _0x314d0a(_0x399428[_0x8d30('0x15')][_0x8d30('0x17')]);}else{logger[_0x8d30('0xf')](_0x8d30('0x10'),_0x318fc7,_0x8d30('0x11'));_0x314d0a(_0x399428[_0x8d30('0x18')][_0x8d30('0x17')]);}})[_0x8d30('0x19')](function(_0x5f248b){logger[_0x8d30('0x15')](_0x8d30('0x10'),_0x318fc7,_0x5f248b);_0x2895ee(_0x5f248b);});});}
\ No newline at end of file
+var _0x6743=['stringify','error','code','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s'];(function(_0x260ce2,_0x2e22b8){var _0x16b105=function(_0x260a06){while(--_0x260a06){_0x260ce2['push'](_0x260ce2['shift']());}};_0x16b105(++_0x2e22b8);}(_0x6743,0x19a));var _0x3674=function(_0xf7c208,_0x5cbc84){_0xf7c208=_0xf7c208-0x0;var _0x16992d=_0x6743[_0xf7c208];return _0x16992d;};'use strict';var _=require(_0x3674('0x0'));var util=require(_0x3674('0x1'));var moment=require(_0x3674('0x2'));var BPromise=require('bluebird');var rs=require(_0x3674('0x3'));var fs=require('fs');var Redis=require(_0x3674('0x4'));var db=require(_0x3674('0x5'))['db'];var utils=require(_0x3674('0x6'));var logger=require(_0x3674('0x7'))(_0x3674('0x8'));var config=require(_0x3674('0x9'));var jayson=require(_0x3674('0xa'));var client=jayson[_0x3674('0xb')][_0x3674('0xc')]({'port':0x232a});config[_0x3674('0xd')]=_[_0x3674('0xe')](config[_0x3674('0xd')],{'host':_0x3674('0xf'),'port':0x18eb});var socket=require(_0x3674('0x10'))(new Redis(config[_0x3674('0xd')]));require('./chatInternalMessage.socket')[_0x3674('0x11')](socket);function respondWithRpcPromise(_0x2e6c63,_0x5f1878,_0x384bcf){return new BPromise(function(_0x9d3c7b,_0x5862b9){return client[_0x3674('0x12')](_0x2e6c63,_0x384bcf)[_0x3674('0x13')](function(_0x416771){logger[_0x3674('0x14')](_0x3674('0x15'),_0x5f1878,_0x3674('0x16'));logger[_0x3674('0x17')](_0x3674('0x18'),_0x5f1878,_0x3674('0x16'),JSON[_0x3674('0x19')](_0x416771));if(_0x416771[_0x3674('0x1a')]){if(_0x416771['error'][_0x3674('0x1b')]===0x1f4){logger[_0x3674('0x1a')]('ChatInternalMessage,\x20%s,\x20%s',_0x5f1878,_0x416771[_0x3674('0x1a')][_0x3674('0x1c')]);return _0x5862b9(_0x416771[_0x3674('0x1a')][_0x3674('0x1c')]);}logger['error'](_0x3674('0x15'),_0x5f1878,_0x416771[_0x3674('0x1a')][_0x3674('0x1c')]);return _0x9d3c7b(_0x416771['error'][_0x3674('0x1c')]);}else{logger['info'](_0x3674('0x15'),_0x5f1878,_0x3674('0x16'));_0x9d3c7b(_0x416771['result'][_0x3674('0x1c')]);}})['catch'](function(_0x177f04){logger[_0x3674('0x1a')](_0x3674('0x15'),_0x5f1878,_0x177f04);_0x5862b9(_0x177f04);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 9816a35..6ee7d47 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 _0xe189=['update','removeListener','register','length','./chatInternalMessage.events'];(function(_0xbd7f4c,_0xe1119c){var _0x2fa90a=function(_0x28267b){while(--_0x28267b){_0xbd7f4c['push'](_0xbd7f4c['shift']());}};_0x2fa90a(++_0xe1119c);}(_0xe189,0x194));var _0x9e18=function(_0x2e869b,_0x10d65){_0x2e869b=_0x2e869b-0x0;var _0x31cd0f=_0xe189[_0x2e869b];return _0x31cd0f;};'use strict';var ChatInternalMessageEvents=require(_0x9e18('0x0'));var events=['save','remove',_0x9e18('0x1')];function createListener(_0x2bc037,_0x22eac1){return function(_0x30a009){_0x22eac1['emit'](_0x2bc037,_0x30a009);};}function removeListener(_0x49b0f7,_0x1c652d){return function(){ChatInternalMessageEvents[_0x9e18('0x2')](_0x49b0f7,_0x1c652d);};}exports[_0x9e18('0x3')]=function(_0x53d7c9){for(var _0x3e6881=0x0,_0x5e6097=events[_0x9e18('0x4')];_0x3e6881<_0x5e6097;_0x3e6881++){var _0x2e4691=events[_0x3e6881];var _0x4656a4=createListener('chatInternalMessage:'+_0x2e4691,_0x53d7c9);ChatInternalMessageEvents['on'](_0x2e4691,_0x4656a4);}};
\ No newline at end of file
+var _0x86dd=['update','emit','removeListener','register','save'];(function(_0x34412f,_0x116bea){var _0x4b4b5a=function(_0x56fc5b){while(--_0x56fc5b){_0x34412f['push'](_0x34412f['shift']());}};_0x4b4b5a(++_0x116bea);}(_0x86dd,0x1ee));var _0xd86d=function(_0x556ffd,_0x2f6c54){_0x556ffd=_0x556ffd-0x0;var _0x45d593=_0x86dd[_0x556ffd];return _0x45d593;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xd86d('0x0'),'remove',_0xd86d('0x1')];function createListener(_0x2cb4b4,_0x287d1d){return function(_0x217373){_0x287d1d[_0xd86d('0x2')](_0x2cb4b4,_0x217373);};}function removeListener(_0x30a31c,_0x2e82a9){return function(){ChatInternalMessageEvents[_0xd86d('0x3')](_0x30a31c,_0x2e82a9);};}exports[_0xd86d('0x4')]=function(_0x1d5ffc){for(var _0x3b13f9=0x0,_0x4274f8=events['length'];_0x3b13f9<_0x4274f8;_0x3b13f9++){var _0x341335=events[_0x3b13f9];var _0xfcba94=createListener('chatInternalMessage:'+_0x341335,_0x1d5ffc);ChatInternalMessageEvents['on'](_0x341335,_0xfcba94);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 877df3a..3f2ebb4 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 _0x54ba=['isAuthenticated','/describe','describe','/users','getUsers','/:id','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get'];(function(_0x13d77c,_0x2e59c5){var _0x2d6df2=function(_0x3f0b7e){while(--_0x3f0b7e){_0x13d77c['push'](_0x13d77c['shift']());}};_0x2d6df2(++_0x2e59c5);}(_0x54ba,0x170));var _0xa54b=function(_0x509db5,_0x1db2f6){_0x509db5=_0x509db5-0x0;var _0x4f7431=_0x54ba[_0x509db5];return _0x4f7431;};'use strict';var multer=require(_0xa54b('0x0'));var util=require(_0xa54b('0x1'));var path=require(_0xa54b('0x2'));var timeout=require(_0xa54b('0x3'));var express=require(_0xa54b('0x4'));var router=express[_0xa54b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa54b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa54b('0x7'));var controller=require(_0xa54b('0x8'));router[_0xa54b('0x9')]('/',auth[_0xa54b('0xa')](),controller['index']);router['get'](_0xa54b('0xb'),auth[_0xa54b('0xa')](),controller[_0xa54b('0xc')]);router[_0xa54b('0x9')](_0xa54b('0xd'),auth[_0xa54b('0xa')](),controller[_0xa54b('0xe')]);router[_0xa54b('0x9')](_0xa54b('0xf'),auth[_0xa54b('0xa')](),controller['show']);router[_0xa54b('0x10')]('/',auth[_0xa54b('0xa')](),controller['create']);router[_0xa54b('0x11')](_0xa54b('0xf'),controller[_0xa54b('0x12')]);router['delete'](_0xa54b('0xf'),auth['isAuthenticated'](),controller[_0xa54b('0x13')]);module[_0xa54b('0x14')]=router;
\ No newline at end of file
+var _0x6b21=['get','/describe','describe','isAuthenticated','getUsers','/:id','show','post','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller'];(function(_0x597fcd,_0x4ccbe7){var _0x497a5a=function(_0x5d5564){while(--_0x5d5564){_0x597fcd['push'](_0x597fcd['shift']());}};_0x497a5a(++_0x4ccbe7);}(_0x6b21,0x75));var _0x16b2=function(_0x717d7f,_0x464dda){_0x717d7f=_0x717d7f-0x0;var _0x3277c2=_0x6b21[_0x717d7f];return _0x3277c2;};'use strict';var multer=require(_0x16b2('0x0'));var util=require(_0x16b2('0x1'));var path=require(_0x16b2('0x2'));var timeout=require(_0x16b2('0x3'));var express=require('express');var router=express[_0x16b2('0x4')]();var fs_extra=require(_0x16b2('0x5'));var auth=require(_0x16b2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x16b2('0x7'));var controller=require(_0x16b2('0x8'));router[_0x16b2('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x16b2('0xa'),auth['isAuthenticated'](),controller[_0x16b2('0xb')]);router['get']('/users',auth[_0x16b2('0xc')](),controller[_0x16b2('0xd')]);router[_0x16b2('0x9')](_0x16b2('0xe'),auth[_0x16b2('0xc')](),controller[_0x16b2('0xf')]);router[_0x16b2('0x10')]('/',auth[_0x16b2('0xc')](),controller['create']);router[_0x16b2('0x11')](_0x16b2('0xe'),controller[_0x16b2('0x12')]);router[_0x16b2('0x13')](_0x16b2('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x16b2('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 1c8342b..97fc222 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 _0xe01f=['medium','BOOLEAN','out','DATE','STRING','TEXT'];(function(_0x3ff685,_0x304b9e){var _0x2046c9=function(_0x7a10e9){while(--_0x7a10e9){_0x3ff685['push'](_0x3ff685['shift']());}};_0x2046c9(++_0x304b9e);}(_0xe01f,0x1d9));var _0xfe01=function(_0x4bd838,_0x5b87d9){_0x4bd838=_0x4bd838-0x0;var _0x50ba73=_0xe01f[_0x4bd838];return _0x50ba73;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xfe01('0x0')](_0xfe01('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xfe01('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xfe01('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xfe01('0x3')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xfe01('0x4')]},'providerName':{'type':Sequelize[_0xfe01('0x5')]},'providerResponse':{'type':Sequelize[_0xfe01('0x0')]}};
\ No newline at end of file
+var _0x86c5=['exports','TEXT','BOOLEAN','out','DATE','sequelize'];(function(_0x3a91f9,_0x22b14e){var _0x2e0ac2=function(_0x22a25d){while(--_0x22a25d){_0x3a91f9['push'](_0x3a91f9['shift']());}};_0x2e0ac2(++_0x22b14e);}(_0x86c5,0xe3));var _0x586c=function(_0x35036f,_0x59da0a){_0x35036f=_0x35036f-0x0;var _0x55a141=_0x86c5[_0x35036f];return _0x55a141;};'use strict';var Sequelize=require(_0x586c('0x0'));module[_0x586c('0x1')]={'body':{'type':Sequelize[_0x586c('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x586c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x586c('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x586c('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x586c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index df37ee1..7202f3e 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=['query','keys','intersection','attributes','fields','length','order','sort','filters','pick','filter','where','type','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','../../config/logger','chat-interactions','accept','chat','read','readAt','format','UserId','user','CmContact','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','role','acceptMessage','manual','interface','channel','event','EventManager','acceptmessage','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','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','render','merge','body','agent','interaction','index','ChatMessage','rawAttributes','fieldName','model','map'];(function(_0x16ea87,_0x378d8b){var _0x6e7b1c=function(_0x26306e){while(--_0x26306e){_0x16ea87['push'](_0x16ea87['shift']());}};_0x6e7b1c(++_0x378d8b);}(_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);};}function getMustacheRender(_0x5640eb,_0x24936a){return Mustache[_0x0a9e('0x3a')](_0x5640eb,_[_0x0a9e('0x3b')](_0x24936a[_0x0a9e('0x3c')],{'contact':_0x24936a['contact'],'message':_0x24936a[_0x0a9e('0x26')],'agent':_0x24936a[_0x0a9e('0x3d')],'interaction':_0x24936a[_0x0a9e('0x3e')],'account':_0x24936a['account']}))||'';}exports[_0x0a9e('0x3f')]=function(_0x1a180b,_0x289467){var _0x4c1c0e={},_0x546ef8={},_0x11b61d={'count':0x0,'rows':[]};var _0x40d766=_['map'](db[_0x0a9e('0x40')][_0x0a9e('0x41')],function(_0x2e1b3a){return{'name':_0x2e1b3a[_0x0a9e('0x42')],'type':_0x2e1b3a['type']['key']};});_0x546ef8[_0x0a9e('0x43')]=_[_0x0a9e('0x44')](_0x40d766,'name');_0x546ef8[_0x0a9e('0x45')]=_[_0x0a9e('0x46')](_0x1a180b[_0x0a9e('0x45')]);_0x546ef8['filters']=_[_0x0a9e('0x47')](_0x546ef8[_0x0a9e('0x43')],_0x546ef8[_0x0a9e('0x45')]);_0x4c1c0e[_0x0a9e('0x48')]=_[_0x0a9e('0x47')](_0x546ef8[_0x0a9e('0x43')],qs[_0x0a9e('0x49')](_0x1a180b[_0x0a9e('0x45')][_0x0a9e('0x49')]));_0x4c1c0e[_0x0a9e('0x48')]=_0x4c1c0e[_0x0a9e('0x48')][_0x0a9e('0x4a')]?_0x4c1c0e[_0x0a9e('0x48')]:_0x546ef8[_0x0a9e('0x43')];if(!_0x1a180b[_0x0a9e('0x45')]['hasOwnProperty']('nolimit')){_0x4c1c0e[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x1a180b[_0x0a9e('0x45')][_0x0a9e('0x30')]);_0x4c1c0e[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x1a180b[_0x0a9e('0x45')][_0x0a9e('0x2d')]);}_0x4c1c0e[_0x0a9e('0x4b')]=qs[_0x0a9e('0x4c')](_0x1a180b[_0x0a9e('0x45')][_0x0a9e('0x4c')]);_0x4c1c0e['where']=qs[_0x0a9e('0x4d')](_[_0x0a9e('0x4e')](_0x1a180b[_0x0a9e('0x45')],_0x546ef8[_0x0a9e('0x4d')]),_0x40d766);if(_0x1a180b[_0x0a9e('0x45')][_0x0a9e('0x4f')]){_0x4c1c0e[_0x0a9e('0x50')]=_[_0x0a9e('0x3b')](_0x4c1c0e['where'],{'$or':_[_0x0a9e('0x44')](_0x40d766,function(_0x48fd45){if(_0x48fd45[_0x0a9e('0x51')]!==_0x0a9e('0x52')){var _0x8d6dd1={};_0x8d6dd1[_0x48fd45['name']]={'$like':'%'+_0x1a180b[_0x0a9e('0x45')][_0x0a9e('0x4f')]+'%'};return _0x8d6dd1;}})});}_0x4c1c0e=_[_0x0a9e('0x3b')]({},_0x4c1c0e,_0x1a180b[_0x0a9e('0x53')]);var _0x45c845={'where':_0x4c1c0e[_0x0a9e('0x50')]};return db[_0x0a9e('0x40')]['count'](_0x45c845)[_0x0a9e('0x1d')](function(_0x1bde3c){_0x11b61d[_0x0a9e('0x2f')]=_0x1bde3c;if(_0x1a180b[_0x0a9e('0x45')][_0x0a9e('0x54')]){_0x4c1c0e[_0x0a9e('0x55')]=[{'all':!![]}];}return db[_0x0a9e('0x40')][_0x0a9e('0x56')](_0x4c1c0e);})[_0x0a9e('0x1d')](function(_0x58a5c2){_0x11b61d[_0x0a9e('0x57')]=_0x58a5c2;return _0x11b61d;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x289467,_0x4c1c0e))['catch'](handleError(_0x289467,null));};exports['show']=function(_0x5ddf84,_0x1adfee){var _0x4317e3={'raw':!![],'where':{'id':_0x5ddf84[_0x0a9e('0x58')]['id']}},_0x37edaa={};_0x37edaa[_0x0a9e('0x43')]=_[_0x0a9e('0x46')](db[_0x0a9e('0x40')][_0x0a9e('0x41')]);_0x37edaa['query']=_['keys'](_0x5ddf84['query']);_0x37edaa[_0x0a9e('0x4d')]=_[_0x0a9e('0x47')](_0x37edaa[_0x0a9e('0x43')],_0x37edaa['query']);_0x4317e3[_0x0a9e('0x48')]=_[_0x0a9e('0x47')](_0x37edaa['model'],qs['fields'](_0x5ddf84[_0x0a9e('0x45')]['fields']));_0x4317e3[_0x0a9e('0x48')]=_0x4317e3['attributes'][_0x0a9e('0x4a')]?_0x4317e3[_0x0a9e('0x48')]:_0x37edaa[_0x0a9e('0x43')];if(_0x5ddf84['query'][_0x0a9e('0x54')]){_0x4317e3[_0x0a9e('0x55')]=[{'all':!![]}];}_0x4317e3=_['merge']({},_0x4317e3,_0x5ddf84['options']);return db[_0x0a9e('0x40')][_0x0a9e('0x59')](_0x4317e3)['then'](handleEntityNotFound(_0x1adfee,null))[_0x0a9e('0x1d')](respondWithResult(_0x1adfee,null))['catch'](handleError(_0x1adfee,null));};exports[_0x0a9e('0x5a')]=function(_0x523cd2,_0xe22ccc){return db['ChatMessage']['create'](_0x523cd2['body'],{})[_0x0a9e('0x1d')](respondWithResult(_0xe22ccc,0xc9))['catch'](handleError(_0xe22ccc,null));};exports[_0x0a9e('0x35')]=function(_0x65432,_0x3cfd00){if(_0x65432[_0x0a9e('0x3c')]['id']){delete _0x65432[_0x0a9e('0x3c')]['id'];}return db[_0x0a9e('0x40')][_0x0a9e('0x59')]({'where':{'id':_0x65432[_0x0a9e('0x58')]['id']}})['then'](handleEntityNotFound(_0x3cfd00,null))[_0x0a9e('0x1d')](saveUpdates(_0x65432[_0x0a9e('0x3c')],null))[_0x0a9e('0x1d')](respondWithResult(_0x3cfd00,null))[_0x0a9e('0x28')](handleError(_0x3cfd00,null));};exports[_0x0a9e('0x36')]=function(_0x156662,_0x5d86e9){return db[_0x0a9e('0x40')][_0x0a9e('0x59')]({'where':{'id':_0x156662['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x5d86e9,null))['then'](removeEntity(_0x5d86e9,null))[_0x0a9e('0x28')](handleError(_0x5d86e9,null));};exports['describe']=function(_0x4b3c1a,_0x5674ee){return db[_0x0a9e('0x40')]['describe']()[_0x0a9e('0x1d')](respondWithResult(_0x5674ee,null))[_0x0a9e('0x28')](handleError(_0x5674ee,null));};var interaction_log=require(_0x0a9e('0x5b'))(_0x0a9e('0x5c'));exports[_0x0a9e('0x5d')]=function(_0x26d7db,_0x49eed0,_0x1627a7){var _0x5854cc={'agent':{},'channel':_0x0a9e('0x5e')};if(_0x26d7db[_0x0a9e('0x3c')]['id']){delete _0x26d7db[_0x0a9e('0x3c')]['id'];}_0x26d7db['body'][_0x0a9e('0x5f')]=!![];_0x26d7db[_0x0a9e('0x3c')][_0x0a9e('0x60')]=moment()[_0x0a9e('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x26d7db[_0x0a9e('0x3c')][_0x0a9e('0x62')]=_0x26d7db['body'][_0x0a9e('0x62')]||_0x26d7db[_0x0a9e('0x63')]['id'];_0x5854cc[_0x0a9e('0x3d')]['id']=_0x26d7db[_0x0a9e('0x3c')][_0x0a9e('0x62')];return db['ChatMessage'][_0x0a9e('0x59')]({'where':{'id':_0x26d7db[_0x0a9e('0x58')]['id'],'UserId':null},'include':[{'model':db[_0x0a9e('0x64')],'as':'Contact'}]})[_0x0a9e('0x1d')](handleEntityNotFound(_0x49eed0,null))['then'](saveUpdates(_0x26d7db['body'],null))[_0x0a9e('0x1d')](function(_0x4556c5){if(_0x4556c5){_0x5854cc[_0x0a9e('0x26')]=_0x4556c5[_0x0a9e('0x65')]({'plain':!![]});return db[_0x0a9e('0x66')][_0x0a9e('0x59')]({'where':{'id':_0x4556c5[_0x0a9e('0x67')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x49eed0,null))[_0x0a9e('0x1d')](function(_0x1cc4f3){if(_0x1cc4f3){return _0x1cc4f3[_0x0a9e('0x35')]({'UserId':_0x26d7db[_0x0a9e('0x3c')][_0x0a9e('0x62')],'read1stAt':_[_0x0a9e('0x68')](_0x1cc4f3[_0x0a9e('0x69')])?moment()[_0x0a9e('0x61')](_0x0a9e('0x6a')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x5150a4){if(_0x5150a4){_0x5854cc[_0x0a9e('0x3e')]=_0x5150a4[_0x0a9e('0x65')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x26d7db[_0x0a9e('0x63')]['id'],_0x26d7db[_0x0a9e('0x63')]['name'],_0x26d7db[_0x0a9e('0x63')][_0x0a9e('0x6b')],_0x5854cc[_0x0a9e('0x3e')]['id'],_0x26d7db[_0x0a9e('0x3c')]?JSON[_0x0a9e('0x23')](_0x26d7db['body']):'null');return respondWithRpcPromise('AcceptMessage',_0x0a9e('0x6c'),_0x5854cc);}return null;})[_0x0a9e('0x1d')](function(_0x1104ad){if(_0x1104ad){if(_0x26d7db[_0x0a9e('0x3c')][_0x0a9e('0x6d')]){_0x5854cc[_0x0a9e('0x26')][_0x0a9e('0x6e')]=util[_0x0a9e('0x61')]('SIP/%s',_0x26d7db[_0x0a9e('0x63')][_0x0a9e('0x38')]);_0x5854cc[_0x0a9e('0x26')]['channel']=_0x5854cc[_0x0a9e('0x6f')];_0x5854cc['message'][_0x0a9e('0x70')]=_0x0a9e('0x5d');return respondWithRpcPromise('EventManager',_0x0a9e('0x71'),{'event':_0x0a9e('0x72'),'message':_[_0x0a9e('0x3b')](_0x5854cc[_0x0a9e('0x26')],JSON['parse'](_0x5854cc[_0x0a9e('0x3e')][_0x0a9e('0x73')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x5854cc;});}return _0x5854cc;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x49eed0,null))['catch'](handleError(_0x49eed0,null));};var interaction_log=require(_0x0a9e('0x5b'))(_0x0a9e('0x5c'));exports[_0x0a9e('0x33')]=function(_0x361b21,_0x4abc8f,_0x290d43){var _0x3511c9={'agent':{},'channel':_0x0a9e('0x5e')};if(_0x361b21[_0x0a9e('0x3c')]['id']){delete _0x361b21[_0x0a9e('0x3c')]['id'];}_0x361b21[_0x0a9e('0x3c')][_0x0a9e('0x62')]=_0x361b21[_0x0a9e('0x3c')][_0x0a9e('0x62')]||_0x361b21[_0x0a9e('0x63')]['id'];_0x3511c9[_0x0a9e('0x3d')]['id']=_0x361b21[_0x0a9e('0x3c')][_0x0a9e('0x62')];return db[_0x0a9e('0x40')]['find']({'where':{'id':_0x361b21[_0x0a9e('0x58')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4abc8f,null))[_0x0a9e('0x1d')](function(_0x563627){if(_0x563627){_0x3511c9[_0x0a9e('0x26')]=_0x563627[_0x0a9e('0x65')]({'plain':!![]});return db[_0x0a9e('0x66')][_0x0a9e('0x59')]({'where':{'id':_0x563627['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x4abc8f,null))[_0x0a9e('0x1d')](function(_0x2bbdb5){if(_0x2bbdb5){_0x3511c9['interaction']=_0x2bbdb5[_0x0a9e('0x65')]({'plain':!![]});interaction_log['info'](_0x0a9e('0x74'),_0x361b21[_0x0a9e('0x63')]['id'],_0x361b21['user'][_0x0a9e('0x38')],_0x361b21[_0x0a9e('0x63')][_0x0a9e('0x6b')],_0x3511c9[_0x0a9e('0x3e')]['id'],_0x361b21[_0x0a9e('0x3c')]?JSON[_0x0a9e('0x23')](_0x361b21[_0x0a9e('0x3c')]):'null');return respondWithRpcPromise(_0x0a9e('0x75'),_0x0a9e('0x76'),_0x3511c9);}return null;})[_0x0a9e('0x1d')](function(_0x16e5b9){if(_0x16e5b9){_0x16e5b9['message'][_0x0a9e('0x6e')]=util[_0x0a9e('0x61')]('SIP/%s',_0x361b21[_0x0a9e('0x63')]['name']);_0x16e5b9[_0x0a9e('0x26')][_0x0a9e('0x6f')]=_0x3511c9[_0x0a9e('0x6f')];_0x16e5b9[_0x0a9e('0x26')]['event']='reject';respondWithRpcPromise(_0x0a9e('0x71'),_0x0a9e('0x71'),{'event':_0x0a9e('0x77'),'message':_0x16e5b9['message']},client9002);return _0x3511c9;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4abc8f,null))[_0x0a9e('0x28')](handleError(_0x4abc8f,null));};
\ No newline at end of file
+var _0xa9e0=['query','keys','intersection','attributes','fields','length','order','sort','filters','pick','filter','where','type','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','../../config/logger','chat-interactions','accept','chat','read','readAt','format','UserId','user','CmContact','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','role','acceptMessage','manual','interface','channel','event','EventManager','acceptmessage','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','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','render','merge','body','agent','interaction','index','ChatMessage','rawAttributes','fieldName','model','map'];(function(_0x1324ec,_0x3c781b){var _0x2c76e1=function(_0x2edac6){while(--_0x2edac6){_0x1324ec['push'](_0x1324ec['shift']());}};_0x2c76e1(++_0x3c781b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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);};}function getMustacheRender(_0x5640eb,_0x24936a){return Mustache[_0x0a9e('0x3a')](_0x5640eb,_[_0x0a9e('0x3b')](_0x24936a[_0x0a9e('0x3c')],{'contact':_0x24936a['contact'],'message':_0x24936a[_0x0a9e('0x26')],'agent':_0x24936a[_0x0a9e('0x3d')],'interaction':_0x24936a[_0x0a9e('0x3e')],'account':_0x24936a['account']}))||'';}exports[_0x0a9e('0x3f')]=function(_0x1a180b,_0x289467){var _0x4c1c0e={},_0x546ef8={},_0x11b61d={'count':0x0,'rows':[]};var _0x40d766=_['map'](db[_0x0a9e('0x40')][_0x0a9e('0x41')],function(_0x2e1b3a){return{'name':_0x2e1b3a[_0x0a9e('0x42')],'type':_0x2e1b3a['type']['key']};});_0x546ef8[_0x0a9e('0x43')]=_[_0x0a9e('0x44')](_0x40d766,'name');_0x546ef8[_0x0a9e('0x45')]=_[_0x0a9e('0x46')](_0x1a180b[_0x0a9e('0x45')]);_0x546ef8['filters']=_[_0x0a9e('0x47')](_0x546ef8[_0x0a9e('0x43')],_0x546ef8[_0x0a9e('0x45')]);_0x4c1c0e[_0x0a9e('0x48')]=_[_0x0a9e('0x47')](_0x546ef8[_0x0a9e('0x43')],qs[_0x0a9e('0x49')](_0x1a180b[_0x0a9e('0x45')][_0x0a9e('0x49')]));_0x4c1c0e[_0x0a9e('0x48')]=_0x4c1c0e[_0x0a9e('0x48')][_0x0a9e('0x4a')]?_0x4c1c0e[_0x0a9e('0x48')]:_0x546ef8[_0x0a9e('0x43')];if(!_0x1a180b[_0x0a9e('0x45')]['hasOwnProperty']('nolimit')){_0x4c1c0e[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x1a180b[_0x0a9e('0x45')][_0x0a9e('0x30')]);_0x4c1c0e[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x1a180b[_0x0a9e('0x45')][_0x0a9e('0x2d')]);}_0x4c1c0e[_0x0a9e('0x4b')]=qs[_0x0a9e('0x4c')](_0x1a180b[_0x0a9e('0x45')][_0x0a9e('0x4c')]);_0x4c1c0e['where']=qs[_0x0a9e('0x4d')](_[_0x0a9e('0x4e')](_0x1a180b[_0x0a9e('0x45')],_0x546ef8[_0x0a9e('0x4d')]),_0x40d766);if(_0x1a180b[_0x0a9e('0x45')][_0x0a9e('0x4f')]){_0x4c1c0e[_0x0a9e('0x50')]=_[_0x0a9e('0x3b')](_0x4c1c0e['where'],{'$or':_[_0x0a9e('0x44')](_0x40d766,function(_0x48fd45){if(_0x48fd45[_0x0a9e('0x51')]!==_0x0a9e('0x52')){var _0x8d6dd1={};_0x8d6dd1[_0x48fd45['name']]={'$like':'%'+_0x1a180b[_0x0a9e('0x45')][_0x0a9e('0x4f')]+'%'};return _0x8d6dd1;}})});}_0x4c1c0e=_[_0x0a9e('0x3b')]({},_0x4c1c0e,_0x1a180b[_0x0a9e('0x53')]);var _0x45c845={'where':_0x4c1c0e[_0x0a9e('0x50')]};return db[_0x0a9e('0x40')]['count'](_0x45c845)[_0x0a9e('0x1d')](function(_0x1bde3c){_0x11b61d[_0x0a9e('0x2f')]=_0x1bde3c;if(_0x1a180b[_0x0a9e('0x45')][_0x0a9e('0x54')]){_0x4c1c0e[_0x0a9e('0x55')]=[{'all':!![]}];}return db[_0x0a9e('0x40')][_0x0a9e('0x56')](_0x4c1c0e);})[_0x0a9e('0x1d')](function(_0x58a5c2){_0x11b61d[_0x0a9e('0x57')]=_0x58a5c2;return _0x11b61d;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x289467,_0x4c1c0e))['catch'](handleError(_0x289467,null));};exports['show']=function(_0x5ddf84,_0x1adfee){var _0x4317e3={'raw':!![],'where':{'id':_0x5ddf84[_0x0a9e('0x58')]['id']}},_0x37edaa={};_0x37edaa[_0x0a9e('0x43')]=_[_0x0a9e('0x46')](db[_0x0a9e('0x40')][_0x0a9e('0x41')]);_0x37edaa['query']=_['keys'](_0x5ddf84['query']);_0x37edaa[_0x0a9e('0x4d')]=_[_0x0a9e('0x47')](_0x37edaa[_0x0a9e('0x43')],_0x37edaa['query']);_0x4317e3[_0x0a9e('0x48')]=_[_0x0a9e('0x47')](_0x37edaa['model'],qs['fields'](_0x5ddf84[_0x0a9e('0x45')]['fields']));_0x4317e3[_0x0a9e('0x48')]=_0x4317e3['attributes'][_0x0a9e('0x4a')]?_0x4317e3[_0x0a9e('0x48')]:_0x37edaa[_0x0a9e('0x43')];if(_0x5ddf84['query'][_0x0a9e('0x54')]){_0x4317e3[_0x0a9e('0x55')]=[{'all':!![]}];}_0x4317e3=_['merge']({},_0x4317e3,_0x5ddf84['options']);return db[_0x0a9e('0x40')][_0x0a9e('0x59')](_0x4317e3)['then'](handleEntityNotFound(_0x1adfee,null))[_0x0a9e('0x1d')](respondWithResult(_0x1adfee,null))['catch'](handleError(_0x1adfee,null));};exports[_0x0a9e('0x5a')]=function(_0x523cd2,_0xe22ccc){return db['ChatMessage']['create'](_0x523cd2['body'],{})[_0x0a9e('0x1d')](respondWithResult(_0xe22ccc,0xc9))['catch'](handleError(_0xe22ccc,null));};exports[_0x0a9e('0x35')]=function(_0x65432,_0x3cfd00){if(_0x65432[_0x0a9e('0x3c')]['id']){delete _0x65432[_0x0a9e('0x3c')]['id'];}return db[_0x0a9e('0x40')][_0x0a9e('0x59')]({'where':{'id':_0x65432[_0x0a9e('0x58')]['id']}})['then'](handleEntityNotFound(_0x3cfd00,null))[_0x0a9e('0x1d')](saveUpdates(_0x65432[_0x0a9e('0x3c')],null))[_0x0a9e('0x1d')](respondWithResult(_0x3cfd00,null))[_0x0a9e('0x28')](handleError(_0x3cfd00,null));};exports[_0x0a9e('0x36')]=function(_0x156662,_0x5d86e9){return db[_0x0a9e('0x40')][_0x0a9e('0x59')]({'where':{'id':_0x156662['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x5d86e9,null))['then'](removeEntity(_0x5d86e9,null))[_0x0a9e('0x28')](handleError(_0x5d86e9,null));};exports['describe']=function(_0x4b3c1a,_0x5674ee){return db[_0x0a9e('0x40')]['describe']()[_0x0a9e('0x1d')](respondWithResult(_0x5674ee,null))[_0x0a9e('0x28')](handleError(_0x5674ee,null));};var interaction_log=require(_0x0a9e('0x5b'))(_0x0a9e('0x5c'));exports[_0x0a9e('0x5d')]=function(_0x26d7db,_0x49eed0,_0x1627a7){var _0x5854cc={'agent':{},'channel':_0x0a9e('0x5e')};if(_0x26d7db[_0x0a9e('0x3c')]['id']){delete _0x26d7db[_0x0a9e('0x3c')]['id'];}_0x26d7db['body'][_0x0a9e('0x5f')]=!![];_0x26d7db[_0x0a9e('0x3c')][_0x0a9e('0x60')]=moment()[_0x0a9e('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x26d7db[_0x0a9e('0x3c')][_0x0a9e('0x62')]=_0x26d7db['body'][_0x0a9e('0x62')]||_0x26d7db[_0x0a9e('0x63')]['id'];_0x5854cc[_0x0a9e('0x3d')]['id']=_0x26d7db[_0x0a9e('0x3c')][_0x0a9e('0x62')];return db['ChatMessage'][_0x0a9e('0x59')]({'where':{'id':_0x26d7db[_0x0a9e('0x58')]['id'],'UserId':null},'include':[{'model':db[_0x0a9e('0x64')],'as':'Contact'}]})[_0x0a9e('0x1d')](handleEntityNotFound(_0x49eed0,null))['then'](saveUpdates(_0x26d7db['body'],null))[_0x0a9e('0x1d')](function(_0x4556c5){if(_0x4556c5){_0x5854cc[_0x0a9e('0x26')]=_0x4556c5[_0x0a9e('0x65')]({'plain':!![]});return db[_0x0a9e('0x66')][_0x0a9e('0x59')]({'where':{'id':_0x4556c5[_0x0a9e('0x67')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x49eed0,null))[_0x0a9e('0x1d')](function(_0x1cc4f3){if(_0x1cc4f3){return _0x1cc4f3[_0x0a9e('0x35')]({'UserId':_0x26d7db[_0x0a9e('0x3c')][_0x0a9e('0x62')],'read1stAt':_[_0x0a9e('0x68')](_0x1cc4f3[_0x0a9e('0x69')])?moment()[_0x0a9e('0x61')](_0x0a9e('0x6a')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x5150a4){if(_0x5150a4){_0x5854cc[_0x0a9e('0x3e')]=_0x5150a4[_0x0a9e('0x65')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x26d7db[_0x0a9e('0x63')]['id'],_0x26d7db[_0x0a9e('0x63')]['name'],_0x26d7db[_0x0a9e('0x63')][_0x0a9e('0x6b')],_0x5854cc[_0x0a9e('0x3e')]['id'],_0x26d7db[_0x0a9e('0x3c')]?JSON[_0x0a9e('0x23')](_0x26d7db['body']):'null');return respondWithRpcPromise('AcceptMessage',_0x0a9e('0x6c'),_0x5854cc);}return null;})[_0x0a9e('0x1d')](function(_0x1104ad){if(_0x1104ad){if(_0x26d7db[_0x0a9e('0x3c')][_0x0a9e('0x6d')]){_0x5854cc[_0x0a9e('0x26')][_0x0a9e('0x6e')]=util[_0x0a9e('0x61')]('SIP/%s',_0x26d7db[_0x0a9e('0x63')][_0x0a9e('0x38')]);_0x5854cc[_0x0a9e('0x26')]['channel']=_0x5854cc[_0x0a9e('0x6f')];_0x5854cc['message'][_0x0a9e('0x70')]=_0x0a9e('0x5d');return respondWithRpcPromise('EventManager',_0x0a9e('0x71'),{'event':_0x0a9e('0x72'),'message':_[_0x0a9e('0x3b')](_0x5854cc[_0x0a9e('0x26')],JSON['parse'](_0x5854cc[_0x0a9e('0x3e')][_0x0a9e('0x73')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x5854cc;});}return _0x5854cc;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x49eed0,null))['catch'](handleError(_0x49eed0,null));};var interaction_log=require(_0x0a9e('0x5b'))(_0x0a9e('0x5c'));exports[_0x0a9e('0x33')]=function(_0x361b21,_0x4abc8f,_0x290d43){var _0x3511c9={'agent':{},'channel':_0x0a9e('0x5e')};if(_0x361b21[_0x0a9e('0x3c')]['id']){delete _0x361b21[_0x0a9e('0x3c')]['id'];}_0x361b21[_0x0a9e('0x3c')][_0x0a9e('0x62')]=_0x361b21[_0x0a9e('0x3c')][_0x0a9e('0x62')]||_0x361b21[_0x0a9e('0x63')]['id'];_0x3511c9[_0x0a9e('0x3d')]['id']=_0x361b21[_0x0a9e('0x3c')][_0x0a9e('0x62')];return db[_0x0a9e('0x40')]['find']({'where':{'id':_0x361b21[_0x0a9e('0x58')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4abc8f,null))[_0x0a9e('0x1d')](function(_0x563627){if(_0x563627){_0x3511c9[_0x0a9e('0x26')]=_0x563627[_0x0a9e('0x65')]({'plain':!![]});return db[_0x0a9e('0x66')][_0x0a9e('0x59')]({'where':{'id':_0x563627['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x4abc8f,null))[_0x0a9e('0x1d')](function(_0x2bbdb5){if(_0x2bbdb5){_0x3511c9['interaction']=_0x2bbdb5[_0x0a9e('0x65')]({'plain':!![]});interaction_log['info'](_0x0a9e('0x74'),_0x361b21[_0x0a9e('0x63')]['id'],_0x361b21['user'][_0x0a9e('0x38')],_0x361b21[_0x0a9e('0x63')][_0x0a9e('0x6b')],_0x3511c9[_0x0a9e('0x3e')]['id'],_0x361b21[_0x0a9e('0x3c')]?JSON[_0x0a9e('0x23')](_0x361b21[_0x0a9e('0x3c')]):'null');return respondWithRpcPromise(_0x0a9e('0x75'),_0x0a9e('0x76'),_0x3511c9);}return null;})[_0x0a9e('0x1d')](function(_0x16e5b9){if(_0x16e5b9){_0x16e5b9['message'][_0x0a9e('0x6e')]=util[_0x0a9e('0x61')]('SIP/%s',_0x361b21[_0x0a9e('0x63')]['name']);_0x16e5b9[_0x0a9e('0x26')][_0x0a9e('0x6f')]=_0x3511c9[_0x0a9e('0x6f')];_0x16e5b9[_0x0a9e('0x26')]['event']='reject';respondWithRpcPromise(_0x0a9e('0x71'),_0x0a9e('0x71'),{'event':_0x0a9e('0x77'),'message':_0x16e5b9['message']},client9002);return _0x3511c9;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4abc8f,null))[_0x0a9e('0x28')](handleError(_0x4abc8f,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index f7c21f3..8742747 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 _0x428a=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage'];(function(_0x414344,_0x4e1ecb){var _0x19654d=function(_0x5955de){while(--_0x5955de){_0x414344['push'](_0x414344['shift']());}};_0x19654d(++_0x4e1ecb);}(_0x428a,0xcc));var _0xa428=function(_0x5ba07c,_0x1f598c){_0x5ba07c=_0x5ba07c-0x0;var _0x111c38=_0x428a[_0x5ba07c];return _0x111c38;};'use strict';var EventEmitter=require(_0xa428('0x0'));var ChatMessage=require(_0xa428('0x1'))['db'][_0xa428('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa428('0x3'),'afterUpdate':_0xa428('0x4'),'afterDestroy':'remove'};function emitEvent(_0xdaee2){return function(_0x3e74c6,_0x5a0f32,_0x5a5702){ChatMessageEvents[_0xa428('0x5')](_0xdaee2+':'+_0x3e74c6['id'],_0x3e74c6);ChatMessageEvents['emit'](_0xdaee2,_0x3e74c6);_0x5a5702(null);};}for(var e in events){if(events[_0xa428('0x6')](e)){var event=events[e];ChatMessage[_0xa428('0x7')](e,emitEvent(event));}}module[_0xa428('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0xf0ca=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage'];(function(_0x24318e,_0x6773ba){var _0x267948=function(_0x1c34be){while(--_0x1c34be){_0x24318e['push'](_0x24318e['shift']());}};_0x267948(++_0x6773ba);}(_0xf0ca,0x9d));var _0xaf0c=function(_0xfbe06e,_0x2fb7ab){_0xfbe06e=_0xfbe06e-0x0;var _0x24e5b6=_0xf0ca[_0xfbe06e];return _0x24e5b6;};'use strict';var EventEmitter=require(_0xaf0c('0x0'));var ChatMessage=require(_0xaf0c('0x1'))['db'][_0xaf0c('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xaf0c('0x3')};function emitEvent(_0xf20402){return function(_0x50c5fd,_0x13e122,_0x36ccc4){ChatMessageEvents['emit'](_0xf20402+':'+_0x50c5fd['id'],_0x50c5fd);ChatMessageEvents[_0xaf0c('0x4')](_0xf20402,_0x50c5fd);_0x36ccc4(null);};}for(var e in events){if(events[_0xaf0c('0x5')](e)){var event=events[e];ChatMessage[_0xaf0c('0x6')](e,emitEvent(event));}}module[_0xaf0c('0x7')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index bfb13c0..4887754 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 _0xdded=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId','then','update','createdAt','catch'];(function(_0x5c22ec,_0x3e5608){var _0x57727b=function(_0x980b74){while(--_0x980b74){_0x5c22ec['push'](_0x5c22ec['shift']());}};_0x57727b(++_0x3e5608);}(_0xdded,0x17a));var _0xddde=function(_0x5dd6d6,_0x438e51){_0x5dd6d6=_0x5dd6d6-0x0;var _0x358982=_0xdded[_0x5dd6d6];return _0x358982;};'use strict';var _=require(_0xddde('0x0'));var util=require(_0xddde('0x1'));var logger=require(_0xddde('0x2'))(_0xddde('0x3'));var moment=require(_0xddde('0x4'));var BPromise=require(_0xddde('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xddde('0x6'));var rimraf=require(_0xddde('0x7'));var config=require(_0xddde('0x8'));var attributes=require(_0xddde('0x9'));module[_0xddde('0xa')]=function(_0x39fd85,_0x3c3021){return _0x39fd85[_0xddde('0xb')](_0xddde('0xc'),attributes,{'tableName':_0xddde('0xd'),'paranoid':![],'indexes':[{'name':_0xddde('0xe'),'fields':['body'],'type':_0xddde('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4f0f3c,_0x48dd55,_0x4820a5){var _0x438f74=_0x39fd85['models'];var _0x247097=_0x4f0f3c['get']({'plain':!![]});if(_0x247097[_0xddde('0x10')][_0xddde('0x11')]()==='in'||_0x247097[_0xddde('0x10')][_0xddde('0x11')]()===_0xddde('0x12')&&!_0x247097[_0xddde('0x13')]&&!_[_0xddde('0x14')](_0x247097[_0xddde('0x15')])){_0x438f74['ChatInteraction'][_0xddde('0x16')]({'where':{'id':_0x247097[_0xddde('0x17')]}})[_0xddde('0x18')](function(_0x860ff4){if(_0x860ff4){_0x860ff4[_0xddde('0x19')]({'lastMsgAt':_0x247097[_0xddde('0x1a')],'lastMsgDirection':_0x247097['direction'][_0xddde('0x11')]()});}})[_0xddde('0x1b')](function(_0x3698d4){console['error'](_0x3698d4);});}_0x4820a5();}},'charset':'utf8mb4','collate':_0xddde('0x1c')});};
\ No newline at end of file
+var _0x42b0=['get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','api','bluebird','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','FULLTEXT','models'];(function(_0x1753e0,_0x32ccd4){var _0xc9f908=function(_0x342122){while(--_0x342122){_0x1753e0['push'](_0x1753e0['shift']());}};_0xc9f908(++_0x32ccd4);}(_0x42b0,0xbc));var _0x042b=function(_0x52e64,_0x6ba4e8){_0x52e64=_0x52e64-0x0;var _0x282b80=_0x42b0[_0x52e64];return _0x282b80;};'use strict';var _=require(_0x042b('0x0'));var util=require(_0x042b('0x1'));var logger=require('../../config/logger')(_0x042b('0x2'));var moment=require('moment');var BPromise=require(_0x042b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x042b('0x4'));var config=require(_0x042b('0x5'));var attributes=require(_0x042b('0x6'));module[_0x042b('0x7')]=function(_0x135bc1,_0x5d194a){return _0x135bc1['define'](_0x042b('0x8'),attributes,{'tableName':_0x042b('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0x042b('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x54a585,_0x8fd46a,_0x5686b7){var _0x3f01e1=_0x135bc1[_0x042b('0xb')];var _0x1d2796=_0x54a585[_0x042b('0xc')]({'plain':!![]});if(_0x1d2796[_0x042b('0xd')][_0x042b('0xe')]()==='in'||_0x1d2796[_0x042b('0xd')][_0x042b('0xe')]()===_0x042b('0xf')&&!_0x1d2796[_0x042b('0x10')]&&!_[_0x042b('0x11')](_0x1d2796[_0x042b('0x12')])){_0x3f01e1[_0x042b('0x13')]['findOne']({'where':{'id':_0x1d2796[_0x042b('0x14')]}})['then'](function(_0x1e5626){if(_0x1e5626){_0x1e5626['update']({'lastMsgAt':_0x1d2796[_0x042b('0x15')],'lastMsgDirection':_0x1d2796[_0x042b('0xd')][_0x042b('0xe')]()});}})[_0x042b('0x16')](function(_0x30c86f){console[_0x042b('0x17')](_0x30c86f);});}_0x5686b7();}},'charset':'utf8mb4','collate':_0x042b('0x18')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 4726d78..8506b41 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 _0x593e=['request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','catch','CreateChatMessage','ChatMessage','create','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register'];(function(_0x368aa8,_0x266626){var _0x34d435=function(_0x25e2b8){while(--_0x25e2b8){_0x368aa8['push'](_0x368aa8['shift']());}};_0x34d435(++_0x266626);}(_0x593e,0x1b1));var _0xe593=function(_0x5649ef,_0x3745d5){_0x5649ef=_0x5649ef-0x0;var _0x97109=_0x593e[_0x5649ef];return _0x97109;};'use strict';var _=require(_0xe593('0x0'));var util=require('util');var moment=require(_0xe593('0x1'));var BPromise=require(_0xe593('0x2'));var rs=require(_0xe593('0x3'));var fs=require('fs');var Redis=require(_0xe593('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe593('0x5'));var logger=require('../../config/logger')(_0xe593('0x6'));var config=require(_0xe593('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe593('0x8')][_0xe593('0x9')]({'port':0x232a});config[_0xe593('0xa')]=_['defaults'](config['redis'],{'host':_0xe593('0xb'),'port':0x18eb});var socket=require(_0xe593('0xc'))(new Redis(config[_0xe593('0xa')]));require(_0xe593('0xd'))[_0xe593('0xe')](socket);function respondWithRpcPromise(_0x35a138,_0x4d4920,_0x3b563a){return new BPromise(function(_0xdbe051,_0x51f4fc){return client[_0xe593('0xf')](_0x35a138,_0x3b563a)[_0xe593('0x10')](function(_0x2667ff){logger[_0xe593('0x11')]('ChatMessage,\x20%s,\x20%s',_0x4d4920,_0xe593('0x12'));logger[_0xe593('0x13')](_0xe593('0x14'),_0x4d4920,_0xe593('0x12'),JSON[_0xe593('0x15')](_0x2667ff));if(_0x2667ff[_0xe593('0x16')]){if(_0x2667ff[_0xe593('0x16')][_0xe593('0x17')]===0x1f4){logger['error'](_0xe593('0x18'),_0x4d4920,_0x2667ff[_0xe593('0x16')][_0xe593('0x19')]);return _0x51f4fc(_0x2667ff['error'][_0xe593('0x19')]);}logger[_0xe593('0x16')](_0xe593('0x18'),_0x4d4920,_0x2667ff[_0xe593('0x16')][_0xe593('0x19')]);return _0xdbe051(_0x2667ff[_0xe593('0x16')][_0xe593('0x19')]);}else{logger[_0xe593('0x11')](_0xe593('0x18'),_0x4d4920,'request\x20sent');_0xdbe051(_0x2667ff['result'][_0xe593('0x19')]);}})[_0xe593('0x1a')](function(_0x5ccecb){logger[_0xe593('0x16')]('ChatMessage,\x20%s,\x20%s',_0x4d4920,_0x5ccecb);_0x51f4fc(_0x5ccecb);});});}exports[_0xe593('0x1b')]=function(_0x25c0d5){var _0x269e24=this;return new Promise(function(_0x60e336,_0x4701e0){return db[_0xe593('0x1c')][_0xe593('0x1d')](_0x25c0d5['body'],{'raw':_0x25c0d5[_0xe593('0x1e')]?_0x25c0d5[_0xe593('0x1e')][_0xe593('0x1f')]===undefined?!![]:![]:!![]})[_0xe593('0x10')](function(_0x353207){logger[_0xe593('0x11')](_0xe593('0x1b'),_0x25c0d5);logger[_0xe593('0x13')]('CreateChatMessage',_0x25c0d5,JSON[_0xe593('0x15')](_0x353207));_0x60e336(_0x353207);})[_0xe593('0x1a')](function(_0x37e53f){logger[_0xe593('0x16')](_0xe593('0x1b'),_0x37e53f[_0xe593('0x19')],_0x25c0d5);_0x4701e0(_0x269e24['error'](0x1f4,_0x37e53f[_0xe593('0x19')]));});});};
\ No newline at end of file
+var _0xf841=['info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateChatMessage','ChatMessage','body','options','raw','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatMessage.socket','register','then'];(function(_0x246227,_0x12bfcb){var _0x37bd4a=function(_0x4670f4){while(--_0x4670f4){_0x246227['push'](_0x246227['shift']());}};_0x37bd4a(++_0x12bfcb);}(_0xf841,0x1ee));var _0x1f84=function(_0x4a858b,_0x270c1c){_0x4a858b=_0x4a858b-0x0;var _0x5ae6a0=_0xf841[_0x4a858b];return _0x5ae6a0;};'use strict';var _=require('lodash');var util=require(_0x1f84('0x0'));var moment=require('moment');var BPromise=require(_0x1f84('0x1'));var rs=require(_0x1f84('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f84('0x3'))['db'];var utils=require(_0x1f84('0x4'));var logger=require(_0x1f84('0x5'))(_0x1f84('0x6'));var config=require(_0x1f84('0x7'));var jayson=require(_0x1f84('0x8'));var client=jayson[_0x1f84('0x9')][_0x1f84('0xa')]({'port':0x232a});config[_0x1f84('0xb')]=_['defaults'](config[_0x1f84('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1f84('0xc'))(new Redis(config[_0x1f84('0xb')]));require(_0x1f84('0xd'))[_0x1f84('0xe')](socket);function respondWithRpcPromise(_0xf5926b,_0x34973d,_0x4799a9){return new BPromise(function(_0x1d0694,_0x4217f7){return client['request'](_0xf5926b,_0x4799a9)[_0x1f84('0xf')](function(_0x27e0e6){logger[_0x1f84('0x10')](_0x1f84('0x11'),_0x34973d,_0x1f84('0x12'));logger[_0x1f84('0x13')](_0x1f84('0x14'),_0x34973d,_0x1f84('0x12'),JSON[_0x1f84('0x15')](_0x27e0e6));if(_0x27e0e6[_0x1f84('0x16')]){if(_0x27e0e6[_0x1f84('0x16')][_0x1f84('0x17')]===0x1f4){logger[_0x1f84('0x16')](_0x1f84('0x11'),_0x34973d,_0x27e0e6['error'][_0x1f84('0x18')]);return _0x4217f7(_0x27e0e6[_0x1f84('0x16')][_0x1f84('0x18')]);}logger['error'](_0x1f84('0x11'),_0x34973d,_0x27e0e6['error']['message']);return _0x1d0694(_0x27e0e6[_0x1f84('0x16')][_0x1f84('0x18')]);}else{logger['info'](_0x1f84('0x11'),_0x34973d,_0x1f84('0x12'));_0x1d0694(_0x27e0e6['result'][_0x1f84('0x18')]);}})['catch'](function(_0x59c512){logger[_0x1f84('0x16')]('ChatMessage,\x20%s,\x20%s',_0x34973d,_0x59c512);_0x4217f7(_0x59c512);});});}exports[_0x1f84('0x19')]=function(_0x451495){var _0x39b3b1=this;return new Promise(function(_0x5c0a61,_0x4c2caa){return db[_0x1f84('0x1a')]['create'](_0x451495[_0x1f84('0x1b')],{'raw':_0x451495['options']?_0x451495[_0x1f84('0x1c')][_0x1f84('0x1d')]===undefined?!![]:![]:!![]})[_0x1f84('0xf')](function(_0x467fe9){logger[_0x1f84('0x10')](_0x1f84('0x19'),_0x451495);logger['debug']('CreateChatMessage',_0x451495,JSON[_0x1f84('0x15')](_0x467fe9));_0x5c0a61(_0x467fe9);})['catch'](function(_0x129b16){logger[_0x1f84('0x16')](_0x1f84('0x19'),_0x129b16[_0x1f84('0x18')],_0x451495);_0x4c2caa(_0x39b3b1[_0x1f84('0x16')](0x1f4,_0x129b16['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 8ed1165..d225fd1 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 _0x4137=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','update'];(function(_0x4b06a5,_0x2f274f){var _0x4a7690=function(_0x3f98b7){while(--_0x3f98b7){_0x4b06a5['push'](_0x4b06a5['shift']());}};_0x4a7690(++_0x2f274f);}(_0x4137,0xf8));var _0x7413=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x4137[_0x57b54c];return _0x59cc19;};'use strict';var ChatMessageEvents=require(_0x7413('0x0'));var events=[_0x7413('0x1'),_0x7413('0x2'),_0x7413('0x3')];function createListener(_0x392ebc,_0x410971){return function(_0x2e6df7){_0x410971[_0x7413('0x4')](_0x392ebc,_0x2e6df7);};}function removeListener(_0x258255,_0x3dc48a){return function(){ChatMessageEvents[_0x7413('0x5')](_0x258255,_0x3dc48a);};}exports[_0x7413('0x6')]=function(_0x4fbade){for(var _0xc808cd=0x0,_0x188d89=events[_0x7413('0x7')];_0xc808cd<_0x188d89;_0xc808cd++){var _0x15af0d=events[_0xc808cd];var _0x5f4cd0=createListener(_0x7413('0x8')+_0x15af0d,_0x4fbade);ChatMessageEvents['on'](_0x15af0d,_0x5f4cd0);}};
\ No newline at end of file
+var _0x71ab=['length','chatMessage:','save','update','emit','removeListener','register'];(function(_0x150aef,_0x580edd){var _0x26c7ff=function(_0x426e06){while(--_0x426e06){_0x150aef['push'](_0x150aef['shift']());}};_0x26c7ff(++_0x580edd);}(_0x71ab,0x64));var _0xb71a=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x71ab[_0x13d07a];return _0x5ee0ee;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xb71a('0x0'),'remove',_0xb71a('0x1')];function createListener(_0x5bdf89,_0x3e985a){return function(_0x3f0529){_0x3e985a[_0xb71a('0x2')](_0x5bdf89,_0x3f0529);};}function removeListener(_0x4094b2,_0x37ce74){return function(){ChatMessageEvents[_0xb71a('0x3')](_0x4094b2,_0x37ce74);};}exports[_0xb71a('0x4')]=function(_0x38d931){for(var _0x22c072=0x0,_0x35a84e=events[_0xb71a('0x5')];_0x22c072<_0x35a84e;_0x22c072++){var _0x2a4c86=events[_0x22c072];var _0x43ca14=createListener(_0xb71a('0x6')+_0x2a4c86,_0x38d931);ChatMessageEvents['on'](_0x2a4c86,_0x43ca14);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 84e43b0..d5659ff 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 _0x777d=['delete','exports','util','path','connect-timeout','Router','fs-extra','./chatMessage.controller','isAuthenticated','get','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/reject','reject'];(function(_0x86c6cb,_0x30bb53){var _0x1b1592=function(_0x19e1c9){while(--_0x19e1c9){_0x86c6cb['push'](_0x86c6cb['shift']());}};_0x1b1592(++_0x30bb53);}(_0x777d,0xe9));var _0xd777=function(_0x21f3bf,_0xfb0f59){_0x21f3bf=_0x21f3bf-0x0;var _0x249d08=_0x777d[_0x21f3bf];return _0x249d08;};'use strict';var multer=require('multer');var util=require(_0xd777('0x0'));var path=require(_0xd777('0x1'));var timeout=require(_0xd777('0x2'));var express=require('express');var router=express[_0xd777('0x3')]();var fs_extra=require(_0xd777('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd777('0x5'));router['get']('/',auth[_0xd777('0x6')](),controller['index']);router[_0xd777('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xd777('0x7')](_0xd777('0x8'),auth[_0xd777('0x6')](),controller[_0xd777('0x9')]);router[_0xd777('0xa')]('/',auth[_0xd777('0x6')](),interaction[_0xd777('0xb')](_0xd777('0xc'),_0xd777('0xd')),controller[_0xd777('0xe')]);router[_0xd777('0xf')](_0xd777('0x8'),controller[_0xd777('0x10')]);router['put']('/:id/accept',auth[_0xd777('0x6')](),controller['accept']);router[_0xd777('0xf')](_0xd777('0x11'),auth[_0xd777('0x6')](),controller[_0xd777('0x12')]);router[_0xd777('0x13')]('/:id',auth[_0xd777('0x6')](),controller['destroy']);module[_0xd777('0x14')]=router;
\ No newline at end of file
+var _0x91a7=['isAuthenticated','/:id','show','post','tracked','chat','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','./chatMessage.controller','get','index','/describe'];(function(_0x456471,_0x5d22e1){var _0x118671=function(_0x57c48a){while(--_0x57c48a){_0x456471['push'](_0x456471['shift']());}};_0x118671(++_0x5d22e1);}(_0x91a7,0xe7));var _0x791a=function(_0xa62357,_0x40d75d){_0xa62357=_0xa62357-0x0;var _0x18f7b5=_0x91a7[_0xa62357];return _0x18f7b5;};'use strict';var multer=require('multer');var util=require(_0x791a('0x0'));var path=require(_0x791a('0x1'));var timeout=require(_0x791a('0x2'));var express=require('express');var router=express[_0x791a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x791a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x791a('0x5'));router[_0x791a('0x6')]('/',auth['isAuthenticated'](),controller[_0x791a('0x7')]);router['get'](_0x791a('0x8'),auth[_0x791a('0x9')](),controller['describe']);router[_0x791a('0x6')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0xb')]);router[_0x791a('0xc')]('/',auth['isAuthenticated'](),interaction[_0x791a('0xd')](_0x791a('0xe'),'chatmessage:create'),controller[_0x791a('0xf')]);router[_0x791a('0x10')](_0x791a('0xa'),controller[_0x791a('0x11')]);router[_0x791a('0x10')](_0x791a('0x12'),auth['isAuthenticated'](),controller['accept']);router[_0x791a('0x10')](_0x791a('0x13'),auth['isAuthenticated'](),controller[_0x791a('0x14')]);router[_0x791a('0x15')]('/:id',auth[_0x791a('0x9')](),controller[_0x791a('0x16')]);module[_0x791a('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index b322cdf..934f0a3 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 _0x955a=['exports','TEXT','medium','sequelize'];(function(_0x5b38c8,_0x1cb4a3){var _0x2f4739=function(_0x3c29e8){while(--_0x3c29e8){_0x5b38c8['push'](_0x5b38c8['shift']());}};_0x2f4739(++_0x1cb4a3);}(_0x955a,0xdb));var _0xa955=function(_0x41f352,_0x59ae37){_0x41f352=_0x41f352-0x0;var _0x1b8cf8=_0x955a[_0x41f352];return _0x1b8cf8;};'use strict';var Sequelize=require(_0xa955('0x0'));module[_0xa955('0x1')]={'body':{'type':Sequelize[_0xa955('0x2')](_0xa955('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x334c=['medium','sequelize','TEXT'];(function(_0x4260f3,_0x4988d6){var _0x31b726=function(_0x5a5513){while(--_0x5a5513){_0x4260f3['push'](_0x4260f3['shift']());}};_0x31b726(++_0x4988d6);}(_0x334c,0x166));var _0xc334=function(_0x231dda,_0x5b04cc){_0x231dda=_0x231dda-0x0;var _0x3f88cb=_0x334c[_0x231dda];return _0x3f88cb;};'use strict';var Sequelize=require(_0xc334('0x0'));module['exports']={'body':{'type':Sequelize[_0xc334('0x1')](_0xc334('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 66f8091..940e73e 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 _0xb10b=['rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','sort','where','VIRTUAL','filter','options','includeAll','include','catch','params','keys','find','create','Attachment','findAll','join','root','server','files','attachments','offline-chat','basename','existsSync','remove','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','render','merge','body','contact','message','agent','account','ChatOfflineMessage'];(function(_0x288a82,_0x3cfd2c){var _0x219ed9=function(_0x28238d){while(--_0x28238d){_0x288a82['push'](_0x288a82['shift']());}};_0x219ed9(++_0x3cfd2c);}(_0xb10b,0x12a));var _0xbb10=function(_0x3a13cf,_0x478c62){_0x3a13cf=_0x3a13cf-0x0;var _0x4817c=_0xb10b[_0x3a13cf];return _0x4817c;};'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 hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x1824b7[_0xbb10('0x19')](0xcc)[_0xbb10('0x25')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x26')](_0x4e25ff[_0xbb10('0x27')]);if(_0x4e25ff[_0xbb10('0x28')]){delete _0x4e25ff[_0xbb10('0x28')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x29')](_0x4e25ff);};}function getMustacheRender(_0x2a0e8b,_0x4aabb9){return Mustache[_0xbb10('0x2a')](_0x2a0e8b,_[_0xbb10('0x2b')](_0x4aabb9[_0xbb10('0x2c')],{'contact':_0x4aabb9[_0xbb10('0x2d')],'message':_0x4aabb9[_0xbb10('0x2e')],'agent':_0x4aabb9[_0xbb10('0x2f')],'interaction':_0x4aabb9['interaction'],'account':_0x4aabb9[_0xbb10('0x30')]}))||'';}exports['index']=function(_0x448d5c,_0x56f2da){var _0x16ad2a={},_0x1dcc9c={},_0x1b59f9={'count':0x0,'rows':[]};var _0x491db4=_['map'](db[_0xbb10('0x31')][_0xbb10('0x32')],function(_0x4f590d){return{'name':_0x4f590d[_0xbb10('0x33')],'type':_0x4f590d[_0xbb10('0x34')][_0xbb10('0x35')]};});_0x1dcc9c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x491db4,_0xbb10('0x28'));_0x1dcc9c[_0xbb10('0x38')]=_['keys'](_0x448d5c[_0xbb10('0x38')]);_0x1dcc9c[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x1dcc9c[_0xbb10('0x36')],_0x1dcc9c[_0xbb10('0x38')]);_0x16ad2a[_0xbb10('0x3b')]=_[_0xbb10('0x3a')](_0x1dcc9c[_0xbb10('0x36')],qs[_0xbb10('0x3c')](_0x448d5c['query'][_0xbb10('0x3c')]));_0x16ad2a[_0xbb10('0x3b')]=_0x16ad2a[_0xbb10('0x3b')][_0xbb10('0x3d')]?_0x16ad2a['attributes']:_0x1dcc9c[_0xbb10('0x36')];if(!_0x448d5c['query']['hasOwnProperty'](_0xbb10('0x3e'))){_0x16ad2a[_0xbb10('0x1c')]=qs[_0xbb10('0x1c')](_0x448d5c[_0xbb10('0x38')][_0xbb10('0x1c')]);_0x16ad2a[_0xbb10('0x1b')]=qs['offset'](_0x448d5c[_0xbb10('0x38')][_0xbb10('0x1b')]);}_0x16ad2a['order']=qs['sort'](_0x448d5c['query'][_0xbb10('0x3f')]);_0x16ad2a[_0xbb10('0x40')]=qs[_0xbb10('0x39')](_['pick'](_0x448d5c[_0xbb10('0x38')],_0x1dcc9c[_0xbb10('0x39')]),_0x491db4);if(_0x448d5c[_0xbb10('0x38')]['filter']){_0x16ad2a[_0xbb10('0x40')]=_[_0xbb10('0x2b')](_0x16ad2a[_0xbb10('0x40')],{'$or':_[_0xbb10('0x37')](_0x491db4,function(_0x4f1cdd){if(_0x4f1cdd[_0xbb10('0x34')]!==_0xbb10('0x41')){var _0x5835fd={};_0x5835fd[_0x4f1cdd[_0xbb10('0x28')]]={'$like':'%'+_0x448d5c[_0xbb10('0x38')][_0xbb10('0x42')]+'%'};return _0x5835fd;}})});}_0x16ad2a=_[_0xbb10('0x2b')]({},_0x16ad2a,_0x448d5c[_0xbb10('0x43')]);var _0x185a52={'where':_0x16ad2a['where']};return db[_0xbb10('0x31')][_0xbb10('0x1e')](_0x185a52)[_0xbb10('0x23')](function(_0x3d3c41){_0x1b59f9['count']=_0x3d3c41;if(_0x448d5c[_0xbb10('0x38')][_0xbb10('0x44')]){_0x16ad2a[_0xbb10('0x45')]=[{'all':!![]}];}return db[_0xbb10('0x31')]['findAll'](_0x16ad2a);})[_0xbb10('0x23')](function(_0x202c60){_0x1b59f9['rows']=_0x202c60;return _0x1b59f9;})['then'](respondWithFilteredResult(_0x56f2da,_0x16ad2a))[_0xbb10('0x46')](handleError(_0x56f2da,null));};exports['show']=function(_0x318984,_0x180933){var _0x4c66d8={'raw':!![],'where':{'id':_0x318984[_0xbb10('0x47')]['id']}},_0x366608={};_0x366608[_0xbb10('0x36')]=_['keys'](db[_0xbb10('0x31')][_0xbb10('0x32')]);_0x366608[_0xbb10('0x38')]=_[_0xbb10('0x48')](_0x318984[_0xbb10('0x38')]);_0x366608[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x366608[_0xbb10('0x36')],_0x366608[_0xbb10('0x38')]);_0x4c66d8[_0xbb10('0x3b')]=_[_0xbb10('0x3a')](_0x366608[_0xbb10('0x36')],qs['fields'](_0x318984[_0xbb10('0x38')][_0xbb10('0x3c')]));_0x4c66d8['attributes']=_0x4c66d8[_0xbb10('0x3b')][_0xbb10('0x3d')]?_0x4c66d8[_0xbb10('0x3b')]:_0x366608[_0xbb10('0x36')];if(_0x318984[_0xbb10('0x38')][_0xbb10('0x44')]){_0x4c66d8[_0xbb10('0x45')]=[{'all':!![]}];}_0x4c66d8=_['merge']({},_0x4c66d8,_0x318984['options']);return db[_0xbb10('0x31')][_0xbb10('0x49')](_0x4c66d8)[_0xbb10('0x23')](handleEntityNotFound(_0x180933,null))['then'](respondWithResult(_0x180933,null))['catch'](handleError(_0x180933,null));};exports[_0xbb10('0x4a')]=function(_0x34cf4e,_0x1bd054){return db[_0xbb10('0x31')][_0xbb10('0x4a')](_0x34cf4e[_0xbb10('0x2c')],{})[_0xbb10('0x23')](respondWithResult(_0x1bd054,0xc9))[_0xbb10('0x46')](handleError(_0x1bd054,null));};exports[_0xbb10('0x22')]=function(_0x3d7e7e,_0x550111){if(_0x3d7e7e['body']['id']){delete _0x3d7e7e[_0xbb10('0x2c')]['id'];}return db[_0xbb10('0x31')][_0xbb10('0x49')]({'where':{'id':_0x3d7e7e[_0xbb10('0x47')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x550111,null))[_0xbb10('0x23')](saveUpdates(_0x3d7e7e[_0xbb10('0x2c')],null))[_0xbb10('0x23')](respondWithResult(_0x550111,null))[_0xbb10('0x46')](handleError(_0x550111,null));};exports[_0xbb10('0x24')]=function(_0x19ca3e,_0x20e18a){return db[_0xbb10('0x4b')][_0xbb10('0x4c')]({'where':{'ChatOfflineMessageId':_0x19ca3e[_0xbb10('0x47')]['id']},'raw':!![]})['then'](function(_0x124052){_0x124052['forEach'](function(_0x33d60a){var _0x2e21a0=path[_0xbb10('0x4d')](config[_0xbb10('0x4e')],_0xbb10('0x4f'),_0xbb10('0x50'),_0xbb10('0x51'),_0xbb10('0x52'),_0x33d60a[_0xbb10('0x53')]);var _0x3d71e=fs[_0xbb10('0x54')](_0x2e21a0);if(_0x3d71e)fs_extra[_0xbb10('0x55')](_0x2e21a0);});})[_0xbb10('0x23')](function(){return db[_0xbb10('0x31')][_0xbb10('0x49')]({'where':{'id':_0x19ca3e['params']['id']},'individualHooks':!![]});})[_0xbb10('0x23')](handleEntityNotFound(_0x20e18a,null))[_0xbb10('0x23')](removeEntity(_0x20e18a,null))[_0xbb10('0x46')](handleError(_0x20e18a,null));};exports[_0xbb10('0x56')]=function(_0xbffa3c,_0x379d8c){return db['ChatOfflineMessage'][_0xbb10('0x56')]()[_0xbb10('0x23')](respondWithResult(_0x379d8c,null))[_0xbb10('0x46')](handleError(_0x379d8c,null));};
\ No newline at end of file
+var _0x757a=['then','end','sendStatus','error','stack','name','render','body','contact','agent','account','index','map','ChatOfflineMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','show','params','catch','create','find','destroy','forEach','join','root','server','files','offline-chat','basename','existsSync','remove','describe','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','status','json','offset','undefined','count','limit','Content-Range','apply','update'];(function(_0xd6afce,_0x40123e){var _0x7a718b=function(_0x406156){while(--_0x406156){_0xd6afce['push'](_0xd6afce['shift']());}};_0x7a718b(++_0x40123e);}(_0x757a,0xde));var _0xa757=function(_0xdc4c72,_0x188a4e){_0xdc4c72=_0xdc4c72-0x0;var _0x3e7a65=_0x757a[_0xdc4c72];return _0x3e7a65;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa757('0x0'));var zipdir=require(_0xa757('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa757('0x2'));var Mustache=require(_0xa757('0x3'));var util=require(_0xa757('0x4'));var path=require(_0xa757('0x5'));var sox=require(_0xa757('0x6'));var csv=require(_0xa757('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa757('0x8'));var _=require(_0xa757('0x9'));var squel=require('squel');var crypto=require(_0xa757('0xa'));var jsforce=require(_0xa757('0xb'));var deskjs=require(_0xa757('0xc'));var toCsv=require(_0xa757('0x7'));var querystring=require(_0xa757('0xd'));var Papa=require('papaparse');var Redis=require(_0xa757('0xe'));var authService=require(_0xa757('0xf'));var qs=require(_0xa757('0x10'));var as=require(_0xa757('0x11'));var hardwareService=require(_0xa757('0x12'));var logger=require(_0xa757('0x13'))(_0xa757('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4db68e,_0x421040){_0x421040=_0x421040||0xcc;return function(_0x544b45){if(_0x544b45){return _0x4db68e['sendStatus'](_0x421040);}return _0x4db68e[_0xa757('0x15')](_0x421040)['end']();};}function respondWithResult(_0x481508,_0x32112b){_0x32112b=_0x32112b||0xc8;return function(_0x1b670e){if(_0x1b670e){return _0x481508[_0xa757('0x15')](_0x32112b)[_0xa757('0x16')](_0x1b670e);}};}function respondWithFilteredResult(_0x86abd,_0x31cfd2){return function(_0xf12b68){if(_0xf12b68){var _0x2f7947=typeof _0x31cfd2[_0xa757('0x17')]===_0xa757('0x18')&&typeof _0x31cfd2['limit']===_0xa757('0x18');var _0x44eab8=_0xf12b68[_0xa757('0x19')];var _0x4d9f58=_0x2f7947?0x0:_0x31cfd2['offset'];var _0x151c04=_0x2f7947?_0xf12b68[_0xa757('0x19')]:_0x31cfd2[_0xa757('0x17')]+_0x31cfd2[_0xa757('0x1a')];var _0x27f4ba;if(_0x151c04>=_0x44eab8){_0x151c04=_0x44eab8;_0x27f4ba=0xc8;}else{_0x27f4ba=0xce;}_0x86abd[_0xa757('0x15')](_0x27f4ba);return _0x86abd['set'](_0xa757('0x1b'),_0x4d9f58+'-'+_0x151c04+'/'+_0x44eab8)['json'](_0xf12b68);}return null;};}function patchUpdates(_0x32c2a1){return function(_0x167640){try{jsonpatch[_0xa757('0x1c')](_0x167640,_0x32c2a1,!![]);}catch(_0x2c9ec6){return BPromise['reject'](_0x2c9ec6);}return _0x167640['save']();};}function saveUpdates(_0x40ec48,_0x2159cf){return function(_0x2ba923){if(_0x2ba923){return _0x2ba923[_0xa757('0x1d')](_0x40ec48)[_0xa757('0x1e')](function(_0x40562f){return _0x40562f;});}return null;};}function removeEntity(_0x2ca10d,_0x21f1af){return function(_0x2bf276){if(_0x2bf276){return _0x2bf276['destroy']()[_0xa757('0x1e')](function(){_0x2ca10d['status'](0xcc)[_0xa757('0x1f')]();});}};}function handleEntityNotFound(_0x47903b,_0x40551d){return function(_0x3859ce){if(!_0x3859ce){_0x47903b[_0xa757('0x20')](0x194);}return _0x3859ce;};}function handleError(_0x4d58a4,_0x2b19d5){_0x2b19d5=_0x2b19d5||0x1f4;return function(_0xcd98bd){logger[_0xa757('0x21')](_0xcd98bd[_0xa757('0x22')]);if(_0xcd98bd['name']){delete _0xcd98bd[_0xa757('0x23')];}_0x4d58a4['status'](_0x2b19d5)['send'](_0xcd98bd);};}function getMustacheRender(_0x54b75e,_0x4f8de2){return Mustache[_0xa757('0x24')](_0x54b75e,_['merge'](_0x4f8de2[_0xa757('0x25')],{'contact':_0x4f8de2[_0xa757('0x26')],'message':_0x4f8de2['message'],'agent':_0x4f8de2[_0xa757('0x27')],'interaction':_0x4f8de2['interaction'],'account':_0x4f8de2[_0xa757('0x28')]}))||'';}exports[_0xa757('0x29')]=function(_0x5307c3,_0x235e54){var _0x5ade7b={},_0x3a4a66={},_0x27b3e2={'count':0x0,'rows':[]};var _0x458974=_[_0xa757('0x2a')](db[_0xa757('0x2b')][_0xa757('0x2c')],function(_0x1a44a9){return{'name':_0x1a44a9[_0xa757('0x2d')],'type':_0x1a44a9[_0xa757('0x2e')][_0xa757('0x2f')]};});_0x3a4a66[_0xa757('0x30')]=_[_0xa757('0x2a')](_0x458974,_0xa757('0x23'));_0x3a4a66[_0xa757('0x31')]=_[_0xa757('0x32')](_0x5307c3[_0xa757('0x31')]);_0x3a4a66[_0xa757('0x33')]=_[_0xa757('0x34')](_0x3a4a66[_0xa757('0x30')],_0x3a4a66[_0xa757('0x31')]);_0x5ade7b[_0xa757('0x35')]=_[_0xa757('0x34')](_0x3a4a66[_0xa757('0x30')],qs[_0xa757('0x36')](_0x5307c3['query'][_0xa757('0x36')]));_0x5ade7b[_0xa757('0x35')]=_0x5ade7b[_0xa757('0x35')][_0xa757('0x37')]?_0x5ade7b[_0xa757('0x35')]:_0x3a4a66['model'];if(!_0x5307c3[_0xa757('0x31')][_0xa757('0x38')](_0xa757('0x39'))){_0x5ade7b[_0xa757('0x1a')]=qs[_0xa757('0x1a')](_0x5307c3[_0xa757('0x31')]['limit']);_0x5ade7b[_0xa757('0x17')]=qs[_0xa757('0x17')](_0x5307c3[_0xa757('0x31')][_0xa757('0x17')]);}_0x5ade7b[_0xa757('0x3a')]=qs[_0xa757('0x3b')](_0x5307c3[_0xa757('0x31')][_0xa757('0x3b')]);_0x5ade7b[_0xa757('0x3c')]=qs['filters'](_[_0xa757('0x3d')](_0x5307c3[_0xa757('0x31')],_0x3a4a66[_0xa757('0x33')]),_0x458974);if(_0x5307c3[_0xa757('0x31')][_0xa757('0x3e')]){_0x5ade7b[_0xa757('0x3c')]=_['merge'](_0x5ade7b[_0xa757('0x3c')],{'$or':_[_0xa757('0x2a')](_0x458974,function(_0x48cde9){if(_0x48cde9['type']!==_0xa757('0x3f')){var _0x6193bf={};_0x6193bf[_0x48cde9['name']]={'$like':'%'+_0x5307c3['query'][_0xa757('0x3e')]+'%'};return _0x6193bf;}})});}_0x5ade7b=_[_0xa757('0x40')]({},_0x5ade7b,_0x5307c3[_0xa757('0x41')]);var _0x59d699={'where':_0x5ade7b[_0xa757('0x3c')]};return db[_0xa757('0x2b')][_0xa757('0x19')](_0x59d699)[_0xa757('0x1e')](function(_0x104e6b){_0x27b3e2['count']=_0x104e6b;if(_0x5307c3[_0xa757('0x31')]['includeAll']){_0x5ade7b['include']=[{'all':!![]}];}return db[_0xa757('0x2b')][_0xa757('0x42')](_0x5ade7b);})[_0xa757('0x1e')](function(_0x626b1f){_0x27b3e2[_0xa757('0x43')]=_0x626b1f;return _0x27b3e2;})['then'](respondWithFilteredResult(_0x235e54,_0x5ade7b))['catch'](handleError(_0x235e54,null));};exports[_0xa757('0x44')]=function(_0x129d77,_0x2b171c){var _0xe03a3c={'raw':!![],'where':{'id':_0x129d77[_0xa757('0x45')]['id']}},_0xc063db={};_0xc063db['model']=_[_0xa757('0x32')](db[_0xa757('0x2b')]['rawAttributes']);_0xc063db[_0xa757('0x31')]=_['keys'](_0x129d77[_0xa757('0x31')]);_0xc063db[_0xa757('0x33')]=_['intersection'](_0xc063db[_0xa757('0x30')],_0xc063db[_0xa757('0x31')]);_0xe03a3c['attributes']=_[_0xa757('0x34')](_0xc063db[_0xa757('0x30')],qs[_0xa757('0x36')](_0x129d77[_0xa757('0x31')]['fields']));_0xe03a3c[_0xa757('0x35')]=_0xe03a3c[_0xa757('0x35')][_0xa757('0x37')]?_0xe03a3c[_0xa757('0x35')]:_0xc063db['model'];if(_0x129d77[_0xa757('0x31')]['includeAll']){_0xe03a3c['include']=[{'all':!![]}];}_0xe03a3c=_[_0xa757('0x40')]({},_0xe03a3c,_0x129d77[_0xa757('0x41')]);return db[_0xa757('0x2b')]['find'](_0xe03a3c)[_0xa757('0x1e')](handleEntityNotFound(_0x2b171c,null))['then'](respondWithResult(_0x2b171c,null))[_0xa757('0x46')](handleError(_0x2b171c,null));};exports[_0xa757('0x47')]=function(_0x265793,_0xbef575){return db[_0xa757('0x2b')][_0xa757('0x47')](_0x265793[_0xa757('0x25')],{})[_0xa757('0x1e')](respondWithResult(_0xbef575,0xc9))['catch'](handleError(_0xbef575,null));};exports[_0xa757('0x1d')]=function(_0x7411a3,_0x33347a){if(_0x7411a3[_0xa757('0x25')]['id']){delete _0x7411a3[_0xa757('0x25')]['id'];}return db[_0xa757('0x2b')][_0xa757('0x48')]({'where':{'id':_0x7411a3[_0xa757('0x45')]['id']}})[_0xa757('0x1e')](handleEntityNotFound(_0x33347a,null))[_0xa757('0x1e')](saveUpdates(_0x7411a3[_0xa757('0x25')],null))[_0xa757('0x1e')](respondWithResult(_0x33347a,null))[_0xa757('0x46')](handleError(_0x33347a,null));};exports[_0xa757('0x49')]=function(_0x388573,_0x23caca){return db['Attachment'][_0xa757('0x42')]({'where':{'ChatOfflineMessageId':_0x388573['params']['id']},'raw':!![]})[_0xa757('0x1e')](function(_0x311c25){_0x311c25[_0xa757('0x4a')](function(_0x24c0ad){var _0x4cb461=path[_0xa757('0x4b')](config[_0xa757('0x4c')],_0xa757('0x4d'),_0xa757('0x4e'),'attachments',_0xa757('0x4f'),_0x24c0ad[_0xa757('0x50')]);var _0x216b32=fs[_0xa757('0x51')](_0x4cb461);if(_0x216b32)fs_extra[_0xa757('0x52')](_0x4cb461);});})[_0xa757('0x1e')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x388573['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x23caca,null))[_0xa757('0x1e')](removeEntity(_0x23caca,null))[_0xa757('0x46')](handleError(_0x23caca,null));};exports[_0xa757('0x53')]=function(_0x32313b,_0x1e31ef){return db[_0xa757('0x2b')]['describe']()[_0xa757('0x1e')](respondWithResult(_0x1e31ef,null))[_0xa757('0x46')](handleError(_0x1e31ef,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index f704b89..c19b8df 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 _0x0e85=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','rimraf','./chatOfflineMessage.attributes','exports','ChatOfflineMessage'];(function(_0x125ad9,_0x26f949){var _0x167be2=function(_0x5d02ac){while(--_0x5d02ac){_0x125ad9['push'](_0x125ad9['shift']());}};_0x167be2(++_0x26f949);}(_0x0e85,0x7c));var _0x50e8=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x0e85[_0x31a371];return _0x2a5bd6;};'use strict';var _=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var logger=require('../../config/logger')(_0x50e8('0x2'));var moment=require(_0x50e8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x50e8('0x4'));var config=require('../../config/environment');var attributes=require(_0x50e8('0x5'));module[_0x50e8('0x6')]=function(_0xe3151e,_0xfde42){return _0xe3151e['define'](_0x50e8('0x7'),attributes,{'tableName':_0x50e8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x50e8('0x9'),'collate':_0x50e8('0xa')});};
\ No newline at end of file
+var _0x34e8=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0xbc4560,_0x4020b8){var _0x298cfb=function(_0x254423){while(--_0x254423){_0xbc4560['push'](_0xbc4560['shift']());}};_0x298cfb(++_0x4020b8);}(_0x34e8,0x12c));var _0x834e=function(_0x5113a7,_0x5e7852){_0x5113a7=_0x5113a7-0x0;var _0x2056d0=_0x34e8[_0x5113a7];return _0x2056d0;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x834e('0xd'),'collate':_0x834e('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index daaf2ab..f8e983d 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 _0x4b0e=['ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x5f3a87,_0x5170c8){var _0x3749ac=function(_0x13c7ec){while(--_0x13c7ec){_0x5f3a87['push'](_0x5f3a87['shift']());}};_0x3749ac(++_0x5170c8);}(_0x4b0e,0xc3));var _0xe4b0=function(_0x1a1eab,_0x28d992){_0x1a1eab=_0x1a1eab-0x0;var _0x260bb7=_0x4b0e[_0x1a1eab];return _0x260bb7;};'use strict';var _=require('lodash');var util=require(_0xe4b0('0x0'));var moment=require('moment');var BPromise=require(_0xe4b0('0x1'));var rs=require(_0xe4b0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4b0('0x3'))['db'];var utils=require(_0xe4b0('0x4'));var logger=require(_0xe4b0('0x5'))(_0xe4b0('0x6'));var config=require(_0xe4b0('0x7'));var jayson=require(_0xe4b0('0x8'));var client=jayson[_0xe4b0('0x9')][_0xe4b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32b21b,_0x29348a,_0xc923bc){return new BPromise(function(_0x384e2d,_0xca9f01){return client[_0xe4b0('0xb')](_0x32b21b,_0xc923bc)['then'](function(_0x556900){logger['info'](_0xe4b0('0xc'),_0x29348a,_0xe4b0('0xd'));logger[_0xe4b0('0xe')](_0xe4b0('0xf'),_0x29348a,'request\x20sent',JSON[_0xe4b0('0x10')](_0x556900));if(_0x556900['error']){if(_0x556900[_0xe4b0('0x11')][_0xe4b0('0x12')]===0x1f4){logger[_0xe4b0('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x29348a,_0x556900[_0xe4b0('0x11')][_0xe4b0('0x13')]);return _0xca9f01(_0x556900[_0xe4b0('0x11')][_0xe4b0('0x13')]);}logger[_0xe4b0('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x29348a,_0x556900[_0xe4b0('0x11')][_0xe4b0('0x13')]);return _0x384e2d(_0x556900['error']['message']);}else{logger[_0xe4b0('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x29348a,_0xe4b0('0xd'));_0x384e2d(_0x556900[_0xe4b0('0x15')]['message']);}})[_0xe4b0('0x16')](function(_0xf364ca){logger['error'](_0xe4b0('0xc'),_0x29348a,_0xf364ca);_0xca9f01(_0xf364ca);});});}
\ No newline at end of file
+var _0xb1f9=['debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x5f13d4,_0x4188c4){var _0x2732d6=function(_0x45b719){while(--_0x45b719){_0x5f13d4['push'](_0x5f13d4['shift']());}};_0x2732d6(++_0x4188c4);}(_0xb1f9,0x111));var _0x9b1f=function(_0x4b196a,_0x35f101){_0x4b196a=_0x4b196a-0x0;var _0xcd766c=_0xb1f9[_0x4b196a];return _0xcd766c;};'use strict';var _=require(_0x9b1f('0x0'));var util=require(_0x9b1f('0x1'));var moment=require(_0x9b1f('0x2'));var BPromise=require(_0x9b1f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9b1f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9b1f('0x5'));var config=require(_0x9b1f('0x6'));var jayson=require(_0x9b1f('0x7'));var client=jayson[_0x9b1f('0x8')][_0x9b1f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a6d0,_0x4125b1,_0x5000e8){return new BPromise(function(_0x35c632,_0x289d13){return client[_0x9b1f('0xa')](_0x2a6d0,_0x5000e8)[_0x9b1f('0xb')](function(_0x370bd5){logger['info'](_0x9b1f('0xc'),_0x4125b1,'request\x20sent');logger[_0x9b1f('0xd')](_0x9b1f('0xe'),_0x4125b1,_0x9b1f('0xf'),JSON[_0x9b1f('0x10')](_0x370bd5));if(_0x370bd5[_0x9b1f('0x11')]){if(_0x370bd5[_0x9b1f('0x11')]['code']===0x1f4){logger[_0x9b1f('0x11')](_0x9b1f('0xc'),_0x4125b1,_0x370bd5['error'][_0x9b1f('0x12')]);return _0x289d13(_0x370bd5['error']['message']);}logger[_0x9b1f('0x11')](_0x9b1f('0xc'),_0x4125b1,_0x370bd5['error'][_0x9b1f('0x12')]);return _0x35c632(_0x370bd5[_0x9b1f('0x11')]['message']);}else{logger[_0x9b1f('0x13')](_0x9b1f('0xc'),_0x4125b1,'request\x20sent');_0x35c632(_0x370bd5[_0x9b1f('0x14')][_0x9b1f('0x12')]);}})[_0x9b1f('0x15')](function(_0x3b6e66){logger[_0x9b1f('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4125b1,_0x3b6e66);_0x289d13(_0x3b6e66);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index e7b41c9..c789b6f 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 _0x8b1e=['post','/:id','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','show'];(function(_0x147914,_0x2cbf3b){var _0xfc1621=function(_0x550567){while(--_0x550567){_0x147914['push'](_0x147914['shift']());}};_0xfc1621(++_0x2cbf3b);}(_0x8b1e,0x16e));var _0xe8b1=function(_0x162905,_0x3ffe0e){_0x162905=_0x162905-0x0;var _0x50a69e=_0x8b1e[_0x162905];return _0x50a69e;};'use strict';var multer=require(_0xe8b1('0x0'));var util=require(_0xe8b1('0x1'));var path=require(_0xe8b1('0x2'));var timeout=require(_0xe8b1('0x3'));var express=require('express');var router=express[_0xe8b1('0x4')]();var fs_extra=require(_0xe8b1('0x5'));var auth=require(_0xe8b1('0x6'));var interaction=require(_0xe8b1('0x7'));var config=require(_0xe8b1('0x8'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth[_0xe8b1('0x9')](),controller[_0xe8b1('0xa')]);router[_0xe8b1('0xb')](_0xe8b1('0xc'),auth[_0xe8b1('0x9')](),controller['describe']);router[_0xe8b1('0xb')]('/:id',auth[_0xe8b1('0x9')](),controller[_0xe8b1('0xd')]);router[_0xe8b1('0xe')]('/',auth[_0xe8b1('0x9')](),controller['create']);router['put'](_0xe8b1('0xf'),auth[_0xe8b1('0x9')](),controller[_0xe8b1('0x10')]);router[_0xe8b1('0x11')](_0xe8b1('0xf'),auth[_0xe8b1('0x9')](),controller[_0xe8b1('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xd8e2=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','post','create','/:id','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0xc12c20,_0x2facd4){var _0x2e349d=function(_0x58cdeb){while(--_0x58cdeb){_0xc12c20['push'](_0xc12c20['shift']());}};_0x2e349d(++_0x2facd4);}(_0xd8e2,0x18a));var _0x2d8e=function(_0x17ff7a,_0x268521){_0x17ff7a=_0x17ff7a-0x0;var _0x4e6081=_0xd8e2[_0x17ff7a];return _0x4e6081;};'use strict';var multer=require(_0x2d8e('0x0'));var util=require(_0x2d8e('0x1'));var path=require(_0x2d8e('0x2'));var timeout=require(_0x2d8e('0x3'));var express=require(_0x2d8e('0x4'));var router=express[_0x2d8e('0x5')]();var fs_extra=require(_0x2d8e('0x6'));var auth=require(_0x2d8e('0x7'));var interaction=require(_0x2d8e('0x8'));var config=require('../../config/environment');var controller=require(_0x2d8e('0x9'));router[_0x2d8e('0xa')]('/',auth[_0x2d8e('0xb')](),controller[_0x2d8e('0xc')]);router[_0x2d8e('0xa')](_0x2d8e('0xd'),auth['isAuthenticated'](),controller[_0x2d8e('0xe')]);router[_0x2d8e('0xa')]('/:id',auth[_0x2d8e('0xb')](),controller['show']);router[_0x2d8e('0xf')]('/',auth['isAuthenticated'](),controller[_0x2d8e('0x10')]);router['put'](_0x2d8e('0x11'),auth[_0x2d8e('0xb')](),controller[_0x2d8e('0x12')]);router[_0x2d8e('0x13')](_0x2d8e('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x2d8e('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 4cbceac..1eb3550 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 _0xb4ff=['INTEGER','sequelize','ENUM','mouseOver','timeout','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb4ff,0x19f));var _0xfb4f=function(_0x1747ef,_0x28ea62){_0x1747ef=_0x1747ef-0x0;var _0x40fa56=_0xb4ff[_0x1747ef];return _0x40fa56;};'use strict';var Sequelize=require(_0xfb4f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xfb4f('0x1')](_0xfb4f('0x2'),_0xfb4f('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xfb4f('0x4')]},'timeout':{'type':Sequelize[_0xfb4f('0x5')]}};
\ No newline at end of file
+var _0xf1da=['exports','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x5d02a2,_0x45984a){var _0x49346e=function(_0x5b3725){while(--_0x5b3725){_0x5d02a2['push'](_0x5d02a2['shift']());}};_0x49346e(++_0x45984a);}(_0xf1da,0x1bc));var _0xaf1d=function(_0x58a296,_0x2127e3){_0x58a296=_0x58a296-0x0;var _0x55c222=_0xf1da[_0x58a296];return _0x55c222;};'use strict';var Sequelize=require('sequelize');module[_0xaf1d('0x0')]={'name':{'type':Sequelize[_0xaf1d('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xaf1d('0x2')](_0xaf1d('0x3'),_0xaf1d('0x4')),'defaultValue':_0xaf1d('0x3')},'selector':{'type':Sequelize[_0xaf1d('0x1')]},'timeout':{'type':Sequelize[_0xaf1d('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 1763e57..3a43143 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 _0x50ed=['catch','create','update','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','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','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','then','error','name','send','render','body','message','agent','interaction','account','show','model','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find'];(function(_0x560d2a,_0x4a9f54){var _0x3df62d=function(_0x1ce1ec){while(--_0x1ce1ec){_0x560d2a['push'](_0x560d2a['shift']());}};_0x3df62d(++_0x4a9f54);}(_0x50ed,0x8e));var _0xd50e=function(_0x57f481,_0x15e15e){_0x57f481=_0x57f481-0x0;var _0x5f1f5e=_0x50ed[_0x57f481];return _0x5f1f5e;};'use strict';var emlformat=require(_0xd50e('0x0'));var rimraf=require(_0xd50e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd50e('0x2'));var rp=require(_0xd50e('0x3'));var moment=require(_0xd50e('0x4'));var BPromise=require(_0xd50e('0x5'));var Mustache=require('mustache');var util=require(_0xd50e('0x6'));var path=require(_0xd50e('0x7'));var sox=require('sox');var csv=require(_0xd50e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd50e('0x9'));var _=require(_0xd50e('0xa'));var squel=require(_0xd50e('0xb'));var crypto=require('crypto');var jsforce=require(_0xd50e('0xc'));var deskjs=require(_0xd50e('0xd'));var toCsv=require(_0xd50e('0x8'));var querystring=require(_0xd50e('0xe'));var Papa=require(_0xd50e('0xf'));var Redis=require(_0xd50e('0x10'));var authService=require(_0xd50e('0x11'));var qs=require(_0xd50e('0x12'));var as=require(_0xd50e('0x13'));var hardwareService=require(_0xd50e('0x14'));var logger=require(_0xd50e('0x15'))(_0xd50e('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd50e('0x17'));var db=require(_0xd50e('0x18'))['db'];function respondWithStatusCode(_0x1bf4be,_0x5a4a4c){_0x5a4a4c=_0x5a4a4c||0xcc;return function(_0x3f69b7){if(_0x3f69b7){return _0x1bf4be[_0xd50e('0x19')](_0x5a4a4c);}return _0x1bf4be[_0xd50e('0x1a')](_0x5a4a4c)[_0xd50e('0x1b')]();};}function respondWithResult(_0x2a0165,_0x119e81){_0x119e81=_0x119e81||0xc8;return function(_0x28c06d){if(_0x28c06d){return _0x2a0165[_0xd50e('0x1a')](_0x119e81)[_0xd50e('0x1c')](_0x28c06d);}};}function respondWithFilteredResult(_0x33449b,_0x62c4b5){return function(_0x3deb7f){if(_0x3deb7f){var _0x417f41=typeof _0x62c4b5['offset']===_0xd50e('0x1d')&&typeof _0x62c4b5[_0xd50e('0x1e')]===_0xd50e('0x1d');var _0x582299=_0x3deb7f[_0xd50e('0x1f')];var _0x5b481a=_0x417f41?0x0:_0x62c4b5['offset'];var _0x4dbdfb=_0x417f41?_0x3deb7f[_0xd50e('0x1f')]:_0x62c4b5[_0xd50e('0x20')]+_0x62c4b5[_0xd50e('0x1e')];var _0x688a93;if(_0x4dbdfb>=_0x582299){_0x4dbdfb=_0x582299;_0x688a93=0xc8;}else{_0x688a93=0xce;}_0x33449b[_0xd50e('0x1a')](_0x688a93);return _0x33449b[_0xd50e('0x21')](_0xd50e('0x22'),_0x5b481a+'-'+_0x4dbdfb+'/'+_0x582299)[_0xd50e('0x1c')](_0x3deb7f);}return null;};}function patchUpdates(_0xb1427b){return function(_0x489c17){try{jsonpatch[_0xd50e('0x23')](_0x489c17,_0xb1427b,!![]);}catch(_0x181ba1){return BPromise[_0xd50e('0x24')](_0x181ba1);}return _0x489c17[_0xd50e('0x25')]();};}function saveUpdates(_0x17ef69,_0x33a3f7){return function(_0xa19f99){if(_0xa19f99){return _0xa19f99['update'](_0x17ef69)['then'](function(_0x3c5b19){return _0x3c5b19;});}return null;};}function removeEntity(_0xfa26f1,_0x4f85e9){return function(_0x175618){if(_0x175618){return _0x175618[_0xd50e('0x26')]()[_0xd50e('0x27')](function(){_0xfa26f1[_0xd50e('0x1a')](0xcc)[_0xd50e('0x1b')]();});}};}function handleEntityNotFound(_0x4401aa,_0x463fe2){return function(_0x2f6c95){if(!_0x2f6c95){_0x4401aa[_0xd50e('0x19')](0x194);}return _0x2f6c95;};}function handleError(_0x521500,_0x17934d){_0x17934d=_0x17934d||0x1f4;return function(_0x12bd44){logger[_0xd50e('0x28')](_0x12bd44['stack']);if(_0x12bd44['name']){delete _0x12bd44[_0xd50e('0x29')];}_0x521500[_0xd50e('0x1a')](_0x17934d)[_0xd50e('0x2a')](_0x12bd44);};}function getMustacheRender(_0x4a400a,_0x4b7cf6){return Mustache[_0xd50e('0x2b')](_0x4a400a,_['merge'](_0x4b7cf6[_0xd50e('0x2c')],{'contact':_0x4b7cf6['contact'],'message':_0x4b7cf6[_0xd50e('0x2d')],'agent':_0x4b7cf6[_0xd50e('0x2e')],'interaction':_0x4b7cf6[_0xd50e('0x2f')],'account':_0x4b7cf6[_0xd50e('0x30')]}))||'';}exports[_0xd50e('0x31')]=function(_0x3becd7,_0x316a68){var _0x557f3e={'raw':!![],'where':{'id':_0x3becd7['params']['id']}},_0x2703e={};_0x2703e[_0xd50e('0x32')]=_['keys'](db[_0xd50e('0x33')][_0xd50e('0x34')]);_0x2703e[_0xd50e('0x35')]=_[_0xd50e('0x36')](_0x3becd7['query']);_0x2703e[_0xd50e('0x37')]=_[_0xd50e('0x38')](_0x2703e[_0xd50e('0x32')],_0x2703e[_0xd50e('0x35')]);_0x557f3e[_0xd50e('0x39')]=_[_0xd50e('0x38')](_0x2703e[_0xd50e('0x32')],qs['fields'](_0x3becd7['query'][_0xd50e('0x3a')]));_0x557f3e[_0xd50e('0x39')]=_0x557f3e[_0xd50e('0x39')][_0xd50e('0x3b')]?_0x557f3e['attributes']:_0x2703e[_0xd50e('0x32')];if(_0x3becd7[_0xd50e('0x35')][_0xd50e('0x3c')]){_0x557f3e[_0xd50e('0x3d')]=[{'all':!![]}];}_0x557f3e=_[_0xd50e('0x3e')]({},_0x557f3e,_0x3becd7[_0xd50e('0x3f')]);return db['ChatProactiveAction'][_0xd50e('0x40')](_0x557f3e)[_0xd50e('0x27')](handleEntityNotFound(_0x316a68,null))[_0xd50e('0x27')](respondWithResult(_0x316a68,null))[_0xd50e('0x41')](handleError(_0x316a68,null));};exports['create']=function(_0x4ff001,_0x2f68db){return db['ChatProactiveAction'][_0xd50e('0x42')](_0x4ff001[_0xd50e('0x2c')],{})[_0xd50e('0x27')](respondWithResult(_0x2f68db,0xc9))[_0xd50e('0x41')](handleError(_0x2f68db,null));};exports[_0xd50e('0x43')]=function(_0x23b4bc,_0x241080){if(_0x23b4bc[_0xd50e('0x2c')]['id']){delete _0x23b4bc['body']['id'];}return db['ChatProactiveAction'][_0xd50e('0x40')]({'where':{'id':_0x23b4bc[_0xd50e('0x44')]['id']}})[_0xd50e('0x27')](handleEntityNotFound(_0x241080,null))[_0xd50e('0x27')](saveUpdates(_0x23b4bc[_0xd50e('0x2c')],null))[_0xd50e('0x27')](respondWithResult(_0x241080,null))['catch'](handleError(_0x241080,null));};exports[_0xd50e('0x26')]=function(_0x379adb,_0x449377){return db[_0xd50e('0x33')][_0xd50e('0x40')]({'where':{'id':_0x379adb[_0xd50e('0x44')]['id']}})[_0xd50e('0x27')](handleEntityNotFound(_0x449377,null))[_0xd50e('0x27')](removeEntity(_0x449377,null))[_0xd50e('0x41')](handleError(_0x449377,null));};
\ No newline at end of file
+var _0x603f=['../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','reject','save','then','destroy','stack','name','send','render','merge','body','message','agent','interaction','account','show','params','model','keys','ChatProactiveAction','query','filters','intersection','attributes','includeAll','include','options','find','catch','update','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x101600,_0x2da5bb){var _0x46cc54=function(_0xbbde18){while(--_0xbbde18){_0x101600['push'](_0x101600['shift']());}};_0x46cc54(++_0x2da5bb);}(_0x603f,0x65));var _0xf603=function(_0x892b21,_0x121961){_0x892b21=_0x892b21-0x0;var _0x1e3e1=_0x603f[_0x892b21];return _0x1e3e1;};'use strict';var emlformat=require(_0xf603('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf603('0x1'));var jsonpatch=require(_0xf603('0x2'));var rp=require(_0xf603('0x3'));var moment=require('moment');var BPromise=require(_0xf603('0x4'));var Mustache=require(_0xf603('0x5'));var util=require('util');var path=require(_0xf603('0x6'));var sox=require(_0xf603('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf603('0x8'));var _=require(_0xf603('0x9'));var squel=require(_0xf603('0xa'));var crypto=require(_0xf603('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf603('0xc'));var toCsv=require(_0xf603('0xd'));var querystring=require('querystring');var Papa=require(_0xf603('0xe'));var Redis=require(_0xf603('0xf'));var authService=require(_0xf603('0x10'));var qs=require(_0xf603('0x11'));var as=require(_0xf603('0x12'));var hardwareService=require(_0xf603('0x13'));var logger=require(_0xf603('0x14'))(_0xf603('0x15'));var utils=require(_0xf603('0x16'));var config=require(_0xf603('0x17'));var licenseUtil=require(_0xf603('0x18'));var db=require(_0xf603('0x19'))['db'];function respondWithStatusCode(_0xfc3f21,_0x2e86b6){_0x2e86b6=_0x2e86b6||0xcc;return function(_0x1961d4){if(_0x1961d4){return _0xfc3f21[_0xf603('0x1a')](_0x2e86b6);}return _0xfc3f21[_0xf603('0x1b')](_0x2e86b6)['end']();};}function respondWithResult(_0x277a96,_0x274bfb){_0x274bfb=_0x274bfb||0xc8;return function(_0x200478){if(_0x200478){return _0x277a96[_0xf603('0x1b')](_0x274bfb)[_0xf603('0x1c')](_0x200478);}};}function respondWithFilteredResult(_0x550b07,_0x2364ba){return function(_0x2934b5){if(_0x2934b5){var _0x3a2bb8=typeof _0x2364ba[_0xf603('0x1d')]===_0xf603('0x1e')&&typeof _0x2364ba['limit']===_0xf603('0x1e');var _0x4a9caa=_0x2934b5[_0xf603('0x1f')];var _0x56340f=_0x3a2bb8?0x0:_0x2364ba[_0xf603('0x1d')];var _0x33a0af=_0x3a2bb8?_0x2934b5[_0xf603('0x1f')]:_0x2364ba[_0xf603('0x1d')]+_0x2364ba[_0xf603('0x20')];var _0x1f785b;if(_0x33a0af>=_0x4a9caa){_0x33a0af=_0x4a9caa;_0x1f785b=0xc8;}else{_0x1f785b=0xce;}_0x550b07[_0xf603('0x1b')](_0x1f785b);return _0x550b07[_0xf603('0x21')]('Content-Range',_0x56340f+'-'+_0x33a0af+'/'+_0x4a9caa)['json'](_0x2934b5);}return null;};}function patchUpdates(_0x5be48e){return function(_0x503e1b){try{jsonpatch['apply'](_0x503e1b,_0x5be48e,!![]);}catch(_0x16511e){return BPromise[_0xf603('0x22')](_0x16511e);}return _0x503e1b[_0xf603('0x23')]();};}function saveUpdates(_0x2174e6,_0x3221b3){return function(_0x5284dc){if(_0x5284dc){return _0x5284dc['update'](_0x2174e6)[_0xf603('0x24')](function(_0x5bbbad){return _0x5bbbad;});}return null;};}function removeEntity(_0x25f35b,_0x1afcad){return function(_0x14d7ce){if(_0x14d7ce){return _0x14d7ce[_0xf603('0x25')]()[_0xf603('0x24')](function(){_0x25f35b[_0xf603('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20e46d,_0x2f2157){return function(_0x20d9f4){if(!_0x20d9f4){_0x20e46d[_0xf603('0x1a')](0x194);}return _0x20d9f4;};}function handleError(_0x1f060d,_0x55ff40){_0x55ff40=_0x55ff40||0x1f4;return function(_0x20dc36){logger['error'](_0x20dc36[_0xf603('0x26')]);if(_0x20dc36[_0xf603('0x27')]){delete _0x20dc36[_0xf603('0x27')];}_0x1f060d['status'](_0x55ff40)[_0xf603('0x28')](_0x20dc36);};}function getMustacheRender(_0x52702f,_0x1f69dd){return Mustache[_0xf603('0x29')](_0x52702f,_[_0xf603('0x2a')](_0x1f69dd[_0xf603('0x2b')],{'contact':_0x1f69dd['contact'],'message':_0x1f69dd[_0xf603('0x2c')],'agent':_0x1f69dd[_0xf603('0x2d')],'interaction':_0x1f69dd[_0xf603('0x2e')],'account':_0x1f69dd[_0xf603('0x2f')]}))||'';}exports[_0xf603('0x30')]=function(_0x5f3045,_0x36a06a){var _0x3564fd={'raw':!![],'where':{'id':_0x5f3045[_0xf603('0x31')]['id']}},_0x34197d={};_0x34197d[_0xf603('0x32')]=_[_0xf603('0x33')](db[_0xf603('0x34')]['rawAttributes']);_0x34197d[_0xf603('0x35')]=_[_0xf603('0x33')](_0x5f3045['query']);_0x34197d[_0xf603('0x36')]=_[_0xf603('0x37')](_0x34197d[_0xf603('0x32')],_0x34197d[_0xf603('0x35')]);_0x3564fd[_0xf603('0x38')]=_[_0xf603('0x37')](_0x34197d[_0xf603('0x32')],qs['fields'](_0x5f3045['query']['fields']));_0x3564fd[_0xf603('0x38')]=_0x3564fd[_0xf603('0x38')]['length']?_0x3564fd[_0xf603('0x38')]:_0x34197d[_0xf603('0x32')];if(_0x5f3045['query'][_0xf603('0x39')]){_0x3564fd[_0xf603('0x3a')]=[{'all':!![]}];}_0x3564fd=_[_0xf603('0x2a')]({},_0x3564fd,_0x5f3045[_0xf603('0x3b')]);return db[_0xf603('0x34')][_0xf603('0x3c')](_0x3564fd)['then'](handleEntityNotFound(_0x36a06a,null))[_0xf603('0x24')](respondWithResult(_0x36a06a,null))[_0xf603('0x3d')](handleError(_0x36a06a,null));};exports['create']=function(_0x36908a,_0x1d21d7){return db[_0xf603('0x34')]['create'](_0x36908a[_0xf603('0x2b')],{})[_0xf603('0x24')](respondWithResult(_0x1d21d7,0xc9))['catch'](handleError(_0x1d21d7,null));};exports[_0xf603('0x3e')]=function(_0x418ea8,_0x5cc05b){if(_0x418ea8[_0xf603('0x2b')]['id']){delete _0x418ea8[_0xf603('0x2b')]['id'];}return db[_0xf603('0x34')][_0xf603('0x3c')]({'where':{'id':_0x418ea8[_0xf603('0x31')]['id']}})[_0xf603('0x24')](handleEntityNotFound(_0x5cc05b,null))['then'](saveUpdates(_0x418ea8['body'],null))['then'](respondWithResult(_0x5cc05b,null))['catch'](handleError(_0x5cc05b,null));};exports[_0xf603('0x25')]=function(_0x5012e2,_0x1a11e4){return db[_0xf603('0x34')][_0xf603('0x3c')]({'where':{'id':_0x5012e2[_0xf603('0x31')]['id']}})[_0xf603('0x24')](handleEntityNotFound(_0x1a11e4,null))['then'](removeEntity(_0x1a11e4,null))[_0xf603('0x3d')](handleError(_0x1a11e4,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index c0ad98c..e42360e 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 _0xc841=['api','moment','bluebird','rimraf','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util'];(function(_0x3e4387,_0x2120b1){var _0x29ef48=function(_0x1105fd){while(--_0x1105fd){_0x3e4387['push'](_0x3e4387['shift']());}};_0x29ef48(++_0x2120b1);}(_0xc841,0x153));var _0x1c84=function(_0xd6ee02,_0x33a6aa){_0xd6ee02=_0xd6ee02-0x0;var _0x11087d=_0xc841[_0xd6ee02];return _0x11087d;};'use strict';var _=require(_0x1c84('0x0'));var util=require(_0x1c84('0x1'));var logger=require('../../config/logger')(_0x1c84('0x2'));var moment=require(_0x1c84('0x3'));var BPromise=require(_0x1c84('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1c84('0x5'));var config=require(_0x1c84('0x6'));var attributes=require(_0x1c84('0x7'));module['exports']=function(_0x394b6c,_0x237eab){return _0x394b6c[_0x1c84('0x8')](_0x1c84('0x9'),attributes,{'tableName':_0x1c84('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8774=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction'];(function(_0x51ab83,_0x2721b9){var _0x14b6de=function(_0x243483){while(--_0x243483){_0x51ab83['push'](_0x51ab83['shift']());}};_0x14b6de(++_0x2721b9);}(_0x8774,0x1e0));var _0x4877=function(_0x3ac684,_0x161532){_0x3ac684=_0x3ac684-0x0;var _0x5bc94b=_0x8774[_0x3ac684];return _0x5bc94b;};'use strict';var _=require(_0x4877('0x0'));var util=require(_0x4877('0x1'));var logger=require(_0x4877('0x2'))(_0x4877('0x3'));var moment=require(_0x4877('0x4'));var BPromise=require(_0x4877('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4877('0x6'));var rimraf=require(_0x4877('0x7'));var config=require('../../config/environment');var attributes=require(_0x4877('0x8'));module[_0x4877('0x9')]=function(_0x313adc,_0x5a53fd){return _0x313adc[_0x4877('0xa')](_0x4877('0xb'),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 3dac7b2..8ce6fdb 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 _0xfc85=['client','http','request','ChatProactiveAction,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x58ab89,_0xf01b2d){var _0xb93c04=function(_0x29e1b2){while(--_0x29e1b2){_0x58ab89['push'](_0x58ab89['shift']());}};_0xb93c04(++_0xf01b2d);}(_0xfc85,0x1d9));var _0x5fc8=function(_0x210d93,_0x1e6dba){_0x210d93=_0x210d93-0x0;var _0x10601a=_0xfc85[_0x210d93];return _0x10601a;};'use strict';var _=require(_0x5fc8('0x0'));var util=require(_0x5fc8('0x1'));var moment=require(_0x5fc8('0x2'));var BPromise=require(_0x5fc8('0x3'));var rs=require(_0x5fc8('0x4'));var fs=require('fs');var Redis=require(_0x5fc8('0x5'));var db=require(_0x5fc8('0x6'))['db'];var utils=require(_0x5fc8('0x7'));var logger=require(_0x5fc8('0x8'))('rpc');var config=require(_0x5fc8('0x9'));var jayson=require(_0x5fc8('0xa'));var client=jayson[_0x5fc8('0xb')][_0x5fc8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2c3d13,_0x2a132d,_0x60a58a){return new BPromise(function(_0x4e7b97,_0x5683b0){return client[_0x5fc8('0xd')](_0x2c3d13,_0x60a58a)['then'](function(_0x10af14){logger['info'](_0x5fc8('0xe'),_0x2a132d,'request\x20sent');logger[_0x5fc8('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x2a132d,_0x5fc8('0x10'),JSON['stringify'](_0x10af14));if(_0x10af14[_0x5fc8('0x11')]){if(_0x10af14[_0x5fc8('0x11')][_0x5fc8('0x12')]===0x1f4){logger['error'](_0x5fc8('0xe'),_0x2a132d,_0x10af14[_0x5fc8('0x11')][_0x5fc8('0x13')]);return _0x5683b0(_0x10af14[_0x5fc8('0x11')]['message']);}logger['error'](_0x5fc8('0xe'),_0x2a132d,_0x10af14[_0x5fc8('0x11')]['message']);return _0x4e7b97(_0x10af14['error'][_0x5fc8('0x13')]);}else{logger[_0x5fc8('0x14')](_0x5fc8('0xe'),_0x2a132d,_0x5fc8('0x10'));_0x4e7b97(_0x10af14['result'][_0x5fc8('0x13')]);}})[_0x5fc8('0x15')](function(_0xcce242){logger[_0x5fc8('0x11')](_0x5fc8('0xe'),_0x2a132d,_0xcce242);_0x5683b0(_0xcce242);});});}
\ No newline at end of file
+var _0xd571=['../../config/environment','client','http','request','then','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','info','catch','lodash','randomstring','ioredis','../../config/utils'];(function(_0x22dac7,_0x45d32a){var _0x3e6cfa=function(_0x4c2e9d){while(--_0x4c2e9d){_0x22dac7['push'](_0x22dac7['shift']());}};_0x3e6cfa(++_0x45d32a);}(_0xd571,0x94));var _0x1d57=function(_0x1e4cbf,_0x34e2a1){_0x1e4cbf=_0x1e4cbf-0x0;var _0x5bf4d4=_0xd571[_0x1e4cbf];return _0x5bf4d4;};'use strict';var _=require(_0x1d57('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1d57('0x1'));var fs=require('fs');var Redis=require(_0x1d57('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1d57('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x1d57('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x1d57('0x5')][_0x1d57('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x511697,_0x5d5cdf,_0xa5e411){return new BPromise(function(_0x160613,_0x25f92a){return client[_0x1d57('0x7')](_0x511697,_0xa5e411)[_0x1d57('0x8')](function(_0x338d05){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x5d5cdf,_0x1d57('0x9'));logger[_0x1d57('0xa')](_0x1d57('0xb'),_0x5d5cdf,_0x1d57('0x9'),JSON[_0x1d57('0xc')](_0x338d05));if(_0x338d05[_0x1d57('0xd')]){if(_0x338d05[_0x1d57('0xd')][_0x1d57('0xe')]===0x1f4){logger['error'](_0x1d57('0xf'),_0x5d5cdf,_0x338d05[_0x1d57('0xd')][_0x1d57('0x10')]);return _0x25f92a(_0x338d05['error'][_0x1d57('0x10')]);}logger['error'](_0x1d57('0xf'),_0x5d5cdf,_0x338d05[_0x1d57('0xd')]['message']);return _0x160613(_0x338d05['error'][_0x1d57('0x10')]);}else{logger[_0x1d57('0x11')](_0x1d57('0xf'),_0x5d5cdf,_0x1d57('0x9'));_0x160613(_0x338d05['result']['message']);}})[_0x1d57('0x12')](function(_0x5f0d3f){logger[_0x1d57('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x5d5cdf,_0x5f0d3f);_0x25f92a(_0x5f0d3f);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 18bc995..9cc58d1 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 _0x39c5=['exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','show','isAuthenticated','create','put','update','delete','destroy'];(function(_0x523a03,_0x47d6d3){var _0x1f6f00=function(_0x3396ca){while(--_0x3396ca){_0x523a03['push'](_0x523a03['shift']());}};_0x1f6f00(++_0x47d6d3);}(_0x39c5,0x145));var _0x539c=function(_0x80785c,_0x16b54d){_0x80785c=_0x80785c-0x0;var _0x1ae31a=_0x39c5[_0x80785c];return _0x1ae31a;};'use strict';var multer=require(_0x539c('0x0'));var util=require(_0x539c('0x1'));var path=require('path');var timeout=require(_0x539c('0x2'));var express=require(_0x539c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x539c('0x4'));var interaction=require(_0x539c('0x5'));var config=require(_0x539c('0x6'));var controller=require(_0x539c('0x7'));router[_0x539c('0x8')](_0x539c('0x9'),auth['isAuthenticated'](),controller[_0x539c('0xa')]);router['post']('/',auth[_0x539c('0xb')](),controller[_0x539c('0xc')]);router[_0x539c('0xd')]('/:id',auth[_0x539c('0xb')](),controller[_0x539c('0xe')]);router[_0x539c('0xf')](_0x539c('0x9'),auth[_0x539c('0xb')](),controller[_0x539c('0x10')]);module[_0x539c('0x11')]=router;
\ No newline at end of file
+var _0xfeb6=['post','create','put','update','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated'];(function(_0x31ab89,_0x339e8e){var _0x3dac45=function(_0x5f431a){while(--_0x5f431a){_0x31ab89['push'](_0x31ab89['shift']());}};_0x3dac45(++_0x339e8e);}(_0xfeb6,0x9f));var _0x6feb=function(_0x257b45,_0x16f984){_0x257b45=_0x257b45-0x0;var _0x501ca4=_0xfeb6[_0x257b45];return _0x501ca4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6feb('0x0'));var timeout=require('connect-timeout');var express=require(_0x6feb('0x1'));var router=express[_0x6feb('0x2')]();var fs_extra=require(_0x6feb('0x3'));var auth=require(_0x6feb('0x4'));var interaction=require(_0x6feb('0x5'));var config=require(_0x6feb('0x6'));var controller=require(_0x6feb('0x7'));router[_0x6feb('0x8')](_0x6feb('0x9'),auth[_0x6feb('0xa')](),controller['show']);router[_0x6feb('0xb')]('/',auth[_0x6feb('0xa')](),controller[_0x6feb('0xc')]);router[_0x6feb('0xd')](_0x6feb('0x9'),auth[_0x6feb('0xa')](),controller[_0x6feb('0xe')]);router['delete'](_0x6feb('0x9'),auth[_0x6feb('0xa')](),controller[_0x6feb('0xf')]);module[_0x6feb('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 69910f3..8659a64 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 _0x17fd=['exports','STRING','name','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x17fd,0xf7));var _0xd17f=function(_0x3f192e,_0x1cd39e){_0x3f192e=_0x3f192e-0x0;var _0x2b55ff=_0x17fd[_0x3f192e];return _0x2b55ff;};'use strict';var Sequelize=require(_0xd17f('0x0'));module[_0xd17f('0x1')]={'name':{'type':Sequelize[_0xd17f('0x2')],'unique':_0xd17f('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd17f('0x2')]},'timeout':{'type':Sequelize[_0xd17f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd17f('0x5')](_0xd17f('0x6'),'beepall',_0xd17f('0x7'))}};
\ No newline at end of file
+var _0xfc2e=['roundrobin','sequelize','name','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x247fa1,_0x4ec37c){var _0x244f35=function(_0xfb98be){while(--_0xfb98be){_0x247fa1['push'](_0x247fa1['shift']());}};_0x244f35(++_0x4ec37c);}(_0xfc2e,0x179));var _0xefc2=function(_0x4e9f1f,_0x1b1068){_0x4e9f1f=_0x4e9f1f-0x0;var _0x40f102=_0xfc2e[_0x4e9f1f];return _0x40f102;};'use strict';var Sequelize=require(_0xefc2('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xefc2('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xefc2('0x2')]},'timeout':{'type':Sequelize[_0xefc2('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xefc2('0x4')](_0xefc2('0x5'),_0xefc2('0x6'),_0xefc2('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 8d27f6f..25ef983 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 _0xe626=['ChatQueueId\x20=\x20?','QueryTypes','SELECT','TeamId','all','union','compact','value','isEmpty','removeAgents','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','status','json','limit','offset','count','reject','update','destroy','get','ChatQueues','UserProfileResource','name','send','render','merge','body','agent','index','ChatQueue','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','map','options','includeAll','include','findAll','rows','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','describe','getMembers','findOne','UserChatQueue','nolimit','ChatQueueId','User','findAndCountAll','UserId','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','Team','Agents','online','interface','flatMap','sequelize','transaction','forEach','emit','userChatQueue:save','removeTeams','ids','select','field','from','team_has_chat_queues','join','user_has_teams'];(function(_0x2e7fee,_0x6b0532){var _0x508040=function(_0x5ce51a){while(--_0x5ce51a){_0x2e7fee['push'](_0x2e7fee['shift']());}};_0x508040(++_0x6b0532);}(_0xe626,0x9d));var _0x6e62=function(_0x11c328,_0x1f5158){_0x11c328=_0x11c328-0x0;var _0x4f608c=_0xe626[_0x11c328];return _0x4f608c;};'use strict';var emlformat=require(_0x6e62('0x0'));var rimraf=require(_0x6e62('0x1'));var zipdir=require(_0x6e62('0x2'));var jsonpatch=require(_0x6e62('0x3'));var rp=require('request-promise');var moment=require(_0x6e62('0x4'));var BPromise=require(_0x6e62('0x5'));var Mustache=require(_0x6e62('0x6'));var util=require(_0x6e62('0x7'));var path=require(_0x6e62('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6e62('0x9'));var _=require(_0x6e62('0xa'));var squel=require('squel');var crypto=require(_0x6e62('0xb'));var jsforce=require(_0x6e62('0xc'));var deskjs=require(_0x6e62('0xd'));var toCsv=require(_0x6e62('0xe'));var querystring=require('querystring');var Papa=require(_0x6e62('0xf'));var Redis=require(_0x6e62('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6e62('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6e62('0x12'));var logger=require('../../config/logger')(_0x6e62('0x13'));var utils=require('../../config/utils');var config=require(_0x6e62('0x14'));var licenseUtil=require(_0x6e62('0x15'));var db=require(_0x6e62('0x16'))['db'];config[_0x6e62('0x17')]=_[_0x6e62('0x18')](config[_0x6e62('0x17')],{'host':_0x6e62('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6e62('0x1a'))[_0x6e62('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6e62('0x1c')][_0x6e62('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x19a80d,_0x3f4e35,_0x58d84e,_0x416158){return new BPromise(function(_0x19deb1,_0x8aef1b){var _0x35748b=_0x416158||client;return _0x35748b[_0x6e62('0x1e')](_0x19a80d,_0x58d84e)[_0x6e62('0x1f')](function(_0x42c2ea){logger[_0x6e62('0x20')](_0x6e62('0x21'),_0x3f4e35,_0x6e62('0x22'));logger['debug'](_0x6e62('0x23'),_0x3f4e35,_0x6e62('0x22'),JSON['stringify'](_0x42c2ea));if(_0x42c2ea[_0x6e62('0x24')]){if(_0x42c2ea['error'][_0x6e62('0x25')]===0x1f4){logger[_0x6e62('0x24')](_0x6e62('0x21'),_0x3f4e35,_0x42c2ea[_0x6e62('0x24')][_0x6e62('0x26')]);return _0x8aef1b(_0x42c2ea[_0x6e62('0x24')][_0x6e62('0x26')]);}logger[_0x6e62('0x24')](_0x6e62('0x21'),_0x3f4e35,_0x42c2ea[_0x6e62('0x24')][_0x6e62('0x26')]);return _0x19deb1(_0x42c2ea['error'][_0x6e62('0x26')]);}else{logger['info'](_0x6e62('0x21'),_0x3f4e35,_0x6e62('0x22'));_0x19deb1(_0x42c2ea[_0x6e62('0x27')][_0x6e62('0x26')]);}})[_0x6e62('0x28')](function(_0x425d1c){logger[_0x6e62('0x24')](_0x6e62('0x21'),_0x3f4e35,_0x425d1c);_0x8aef1b(_0x425d1c);});});}function respondWithStatusCode(_0x2e4fe1,_0x448691){_0x448691=_0x448691||0xcc;return function(_0x5a6ffa){if(_0x5a6ffa){return _0x2e4fe1[_0x6e62('0x29')](_0x448691);}return _0x2e4fe1['status'](_0x448691)[_0x6e62('0x2a')]();};}function respondWithResult(_0x2f9baf,_0x318fc3){_0x318fc3=_0x318fc3||0xc8;return function(_0x17fee0){if(_0x17fee0){return _0x2f9baf[_0x6e62('0x2b')](_0x318fc3)[_0x6e62('0x2c')](_0x17fee0);}};}function respondWithFilteredResult(_0x4ecc45,_0x958169){return function(_0x26c991){if(_0x26c991){var _0x14cd51=typeof _0x958169['offset']==='undefined'&&typeof _0x958169[_0x6e62('0x2d')]==='undefined';var _0x479b12=_0x26c991['count'];var _0x5656d8=_0x14cd51?0x0:_0x958169[_0x6e62('0x2e')];var _0x4c6af1=_0x14cd51?_0x26c991[_0x6e62('0x2f')]:_0x958169['offset']+_0x958169[_0x6e62('0x2d')];var _0x2fb5ce;if(_0x4c6af1>=_0x479b12){_0x4c6af1=_0x479b12;_0x2fb5ce=0xc8;}else{_0x2fb5ce=0xce;}_0x4ecc45[_0x6e62('0x2b')](_0x2fb5ce);return _0x4ecc45['set']('Content-Range',_0x5656d8+'-'+_0x4c6af1+'/'+_0x479b12)[_0x6e62('0x2c')](_0x26c991);}return null;};}function patchUpdates(_0xb8d42e){return function(_0x578607){try{jsonpatch['apply'](_0x578607,_0xb8d42e,!![]);}catch(_0x53dfaa){return BPromise[_0x6e62('0x30')](_0x53dfaa);}return _0x578607['save']();};}function saveUpdates(_0xde2488,_0x6af555){return function(_0x3dc663){if(_0x3dc663){return _0x3dc663[_0x6e62('0x31')](_0xde2488)[_0x6e62('0x1f')](function(_0x4c8ed1){return _0x4c8ed1;});}return null;};}function removeEntity(_0x4b8397,_0x451e19){return function(_0x3e33e5){if(_0x3e33e5){return _0x3e33e5[_0x6e62('0x32')]()[_0x6e62('0x1f')](function(){var _0xf650a=_0x3e33e5[_0x6e62('0x33')]({'plain':!![]});var _0x9c62b=_0x6e62('0x34');return db[_0x6e62('0x35')]['destroy']({'where':{'type':_0x9c62b,'resourceId':_0xf650a['id']}})[_0x6e62('0x1f')](function(){return _0x3e33e5;});})[_0x6e62('0x1f')](function(){_0x4b8397[_0x6e62('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x134efd,_0x1e751d){return function(_0x504593){if(!_0x504593){_0x134efd[_0x6e62('0x29')](0x194);}return _0x504593;};}function handleError(_0x231120,_0x186e3c){_0x186e3c=_0x186e3c||0x1f4;return function(_0xa4f73a){logger[_0x6e62('0x24')](_0xa4f73a['stack']);if(_0xa4f73a[_0x6e62('0x36')]){delete _0xa4f73a[_0x6e62('0x36')];}_0x231120[_0x6e62('0x2b')](_0x186e3c)[_0x6e62('0x37')](_0xa4f73a);};}function getMustacheRender(_0x3f069c,_0x4900b0){return Mustache[_0x6e62('0x38')](_0x3f069c,_[_0x6e62('0x39')](_0x4900b0[_0x6e62('0x3a')],{'contact':_0x4900b0['contact'],'message':_0x4900b0[_0x6e62('0x26')],'agent':_0x4900b0[_0x6e62('0x3b')],'interaction':_0x4900b0['interaction'],'account':_0x4900b0['account']}))||'';}exports[_0x6e62('0x3c')]=function(_0x1c2ee1,_0x458ec0){var _0x5257be={},_0x5133a2={},_0x1ef318={'count':0x0,'rows':[]};var _0x4ac790=_['map'](db[_0x6e62('0x3d')][_0x6e62('0x3e')],function(_0xd07973){return{'name':_0xd07973[_0x6e62('0x3f')],'type':_0xd07973[_0x6e62('0x40')]['key']};});_0x5133a2[_0x6e62('0x41')]=_['map'](_0x4ac790,'name');_0x5133a2[_0x6e62('0x42')]=_[_0x6e62('0x43')](_0x1c2ee1[_0x6e62('0x42')]);_0x5133a2['filters']=_[_0x6e62('0x44')](_0x5133a2['model'],_0x5133a2[_0x6e62('0x42')]);_0x5257be[_0x6e62('0x45')]=_[_0x6e62('0x44')](_0x5133a2[_0x6e62('0x41')],qs[_0x6e62('0x46')](_0x1c2ee1[_0x6e62('0x42')][_0x6e62('0x46')]));_0x5257be[_0x6e62('0x45')]=_0x5257be[_0x6e62('0x45')][_0x6e62('0x47')]?_0x5257be['attributes']:_0x5133a2['model'];if(!_0x1c2ee1['query'][_0x6e62('0x48')]('nolimit')){_0x5257be[_0x6e62('0x2d')]=qs[_0x6e62('0x2d')](_0x1c2ee1['query'][_0x6e62('0x2d')]);_0x5257be[_0x6e62('0x2e')]=qs[_0x6e62('0x2e')](_0x1c2ee1[_0x6e62('0x42')][_0x6e62('0x2e')]);}_0x5257be[_0x6e62('0x49')]=qs[_0x6e62('0x4a')](_0x1c2ee1[_0x6e62('0x42')][_0x6e62('0x4a')]);_0x5257be[_0x6e62('0x4b')]=qs[_0x6e62('0x4c')](_[_0x6e62('0x4d')](_0x1c2ee1[_0x6e62('0x42')],_0x5133a2['filters']),_0x4ac790);if(_0x1c2ee1[_0x6e62('0x42')][_0x6e62('0x4e')]){_0x5257be['where']=_[_0x6e62('0x39')](_0x5257be['where'],{'$or':_[_0x6e62('0x4f')](_0x4ac790,function(_0x1aaec8){if(_0x1aaec8[_0x6e62('0x40')]!=='VIRTUAL'){var _0x447fc2={};_0x447fc2[_0x1aaec8[_0x6e62('0x36')]]={'$like':'%'+_0x1c2ee1[_0x6e62('0x42')][_0x6e62('0x4e')]+'%'};return _0x447fc2;}})});}_0x5257be=_[_0x6e62('0x39')]({},_0x5257be,_0x1c2ee1[_0x6e62('0x50')]);var _0x20ec84={'where':_0x5257be[_0x6e62('0x4b')]};return db[_0x6e62('0x3d')][_0x6e62('0x2f')](_0x20ec84)[_0x6e62('0x1f')](function(_0x5613a0){_0x1ef318['count']=_0x5613a0;if(_0x1c2ee1[_0x6e62('0x42')][_0x6e62('0x51')]){_0x5257be[_0x6e62('0x52')]=[{'all':!![]}];}return db[_0x6e62('0x3d')][_0x6e62('0x53')](_0x5257be);})[_0x6e62('0x1f')](function(_0x5b474f){_0x1ef318[_0x6e62('0x54')]=_0x5b474f;return _0x1ef318;})['then'](respondWithFilteredResult(_0x458ec0,_0x5257be))[_0x6e62('0x28')](handleError(_0x458ec0,null));};exports[_0x6e62('0x55')]=function(_0x3f9dd5,_0x7463fd){var _0x43afc9={'raw':!![],'where':{'id':_0x3f9dd5[_0x6e62('0x56')]['id']}},_0x498f95={};_0x498f95[_0x6e62('0x41')]=_[_0x6e62('0x43')](db[_0x6e62('0x3d')]['rawAttributes']);_0x498f95[_0x6e62('0x42')]=_['keys'](_0x3f9dd5[_0x6e62('0x42')]);_0x498f95[_0x6e62('0x4c')]=_[_0x6e62('0x44')](_0x498f95[_0x6e62('0x41')],_0x498f95[_0x6e62('0x42')]);_0x43afc9[_0x6e62('0x45')]=_[_0x6e62('0x44')](_0x498f95['model'],qs[_0x6e62('0x46')](_0x3f9dd5['query'][_0x6e62('0x46')]));_0x43afc9[_0x6e62('0x45')]=_0x43afc9[_0x6e62('0x45')][_0x6e62('0x47')]?_0x43afc9[_0x6e62('0x45')]:_0x498f95['model'];if(_0x3f9dd5[_0x6e62('0x42')]['includeAll']){_0x43afc9[_0x6e62('0x52')]=[{'all':!![]}];}_0x43afc9=_[_0x6e62('0x39')]({},_0x43afc9,_0x3f9dd5[_0x6e62('0x50')]);return db['ChatQueue'][_0x6e62('0x57')](_0x43afc9)[_0x6e62('0x1f')](handleEntityNotFound(_0x7463fd,null))['then'](respondWithResult(_0x7463fd,null))[_0x6e62('0x28')](handleError(_0x7463fd,null));};exports['create']=function(_0x3de583,_0x5bf3ef){return db[_0x6e62('0x3d')][_0x6e62('0x58')](_0x3de583['body'],{})[_0x6e62('0x1f')](function(_0x2f4f20){var _0x58b2e2=_0x3de583['user'][_0x6e62('0x33')]({'plain':!![]});if(!_0x58b2e2)throw new Error(_0x6e62('0x59'));if(_0x58b2e2[_0x6e62('0x5a')]===_0x6e62('0x5b')){var _0x171686=_0x2f4f20[_0x6e62('0x33')]({'plain':!![]});var _0x21b99c='ChatQueues';return db[_0x6e62('0x5c')][_0x6e62('0x57')]({'where':{'name':_0x21b99c,'userProfileId':_0x58b2e2[_0x6e62('0x5d')]},'raw':!![]})[_0x6e62('0x1f')](function(_0x109ff5){if(_0x109ff5&&_0x109ff5['autoAssociation']===0x0){return db[_0x6e62('0x35')][_0x6e62('0x58')]({'name':_0x171686['name'],'resourceId':_0x171686['id'],'type':_0x109ff5[_0x6e62('0x36')],'sectionId':_0x109ff5['id']},{})[_0x6e62('0x1f')](function(){return _0x2f4f20;});}else{return _0x2f4f20;}})[_0x6e62('0x28')](function(_0x2656cd){logger[_0x6e62('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2656cd);throw _0x2656cd;});}return _0x2f4f20;})[_0x6e62('0x1f')](respondWithResult(_0x5bf3ef,0xc9))[_0x6e62('0x28')](handleError(_0x5bf3ef,null));};exports[_0x6e62('0x31')]=function(_0x537cac,_0x2254ea){if(_0x537cac[_0x6e62('0x3a')]['id']){delete _0x537cac['body']['id'];}return db[_0x6e62('0x3d')]['find']({'where':{'id':_0x537cac[_0x6e62('0x56')]['id']}})[_0x6e62('0x1f')](handleEntityNotFound(_0x2254ea,null))[_0x6e62('0x1f')](saveUpdates(_0x537cac['body'],null))['then'](respondWithResult(_0x2254ea,null))[_0x6e62('0x28')](handleError(_0x2254ea,null));};exports[_0x6e62('0x32')]=function(_0x24e7d0,_0x92811d){return db[_0x6e62('0x3d')][_0x6e62('0x57')]({'where':{'id':_0x24e7d0[_0x6e62('0x56')]['id']}})[_0x6e62('0x1f')](handleEntityNotFound(_0x92811d,null))['then'](removeEntity(_0x92811d,null))[_0x6e62('0x28')](handleError(_0x92811d,null));};exports[_0x6e62('0x5e')]=function(_0x4e7ba3,_0x420455){return db['ChatQueue'][_0x6e62('0x5e')]()[_0x6e62('0x1f')](respondWithResult(_0x420455,null))[_0x6e62('0x28')](handleError(_0x420455,null));};exports[_0x6e62('0x5f')]=function(_0x5bbea0,_0x597a20,_0x1c4c3c){var _0xa15705={'raw':!![],'where':{}},_0x1a637b={},_0x1ccbff;return db[_0x6e62('0x3d')][_0x6e62('0x60')]({'where':{'id':_0x5bbea0[_0x6e62('0x56')]['id']}})[_0x6e62('0x1f')](handleEntityNotFound(_0x597a20,null))['then'](function(_0x1785bc){if(_0x1785bc){_0x1ccbff=_0x1785bc[_0x6e62('0x33')]({'plain':!![]});_0x1a637b[_0x6e62('0x41')]=_[_0x6e62('0x43')](db[_0x6e62('0x61')][_0x6e62('0x3e')]);_0x1a637b[_0x6e62('0x42')]=_[_0x6e62('0x43')](_0x5bbea0[_0x6e62('0x42')]);_0x1a637b['filters']=_[_0x6e62('0x44')](_0x1a637b[_0x6e62('0x41')],_0x1a637b[_0x6e62('0x42')]);_0xa15705[_0x6e62('0x45')]=_[_0x6e62('0x44')](_0x1a637b[_0x6e62('0x41')],qs[_0x6e62('0x46')](_0x5bbea0[_0x6e62('0x42')][_0x6e62('0x46')]));_0xa15705[_0x6e62('0x45')]=_0xa15705[_0x6e62('0x45')][_0x6e62('0x47')]?_0xa15705[_0x6e62('0x45')]:_0x1a637b[_0x6e62('0x41')];if(!_0x5bbea0[_0x6e62('0x42')][_0x6e62('0x48')](_0x6e62('0x62'))){_0xa15705['limit']=qs[_0x6e62('0x2d')](_0x5bbea0[_0x6e62('0x42')][_0x6e62('0x2d')]);_0xa15705[_0x6e62('0x2e')]=qs['offset'](_0x5bbea0[_0x6e62('0x42')][_0x6e62('0x2e')]);}_0xa15705[_0x6e62('0x49')]=qs['sort'](_0x5bbea0[_0x6e62('0x42')][_0x6e62('0x4a')]);_0xa15705[_0x6e62('0x4b')]=qs[_0x6e62('0x4c')](_['pick'](_0x5bbea0[_0x6e62('0x42')],_0x1a637b[_0x6e62('0x4c')]));_0xa15705[_0x6e62('0x4b')][_0x6e62('0x63')]=_0x1785bc['id'];if(_0x5bbea0[_0x6e62('0x42')][_0x6e62('0x4e')]){_0xa15705[_0x6e62('0x4b')]=_[_0x6e62('0x39')](_0xa15705[_0x6e62('0x4b')],{'$or':_[_0x6e62('0x4f')](_0xa15705[_0x6e62('0x45')],function(_0x25daa9){var _0x1cd07e={};_0x1cd07e[_0x25daa9]={'$like':'%'+_0x5bbea0[_0x6e62('0x42')]['filter']+'%'};return _0x1cd07e;})});}_0xa15705=_[_0x6e62('0x39')]({},_0xa15705,_0x5bbea0[_0x6e62('0x50')]);return db[_0x6e62('0x61')][_0x6e62('0x53')](_0xa15705);}})[_0x6e62('0x1f')](function(_0x26a242){if(_0x26a242){return db[_0x6e62('0x64')][_0x6e62('0x65')]({'where':{'id':_['map'](_0x26a242,_0x6e62('0x66')),'role':_0x6e62('0x3b')},'attributes':['id',_0x6e62('0x36'),_0x6e62('0x67'),_0x6e62('0x68'),_0x6e62('0x69')]});}})[_0x6e62('0x1f')](function(_0x489e44){if(_0x489e44){return{'count':_0x489e44[_0x6e62('0x2f')],'rows':_[_0x6e62('0x4f')](_0x489e44[_0x6e62('0x54')],function(_0x12bf32){return{'membername':_0x12bf32[_0x6e62('0x36')],'UserId':_0x12bf32['id'],'queue_name':_0x1ccbff[_0x6e62('0x36')],'ChatQueueId':_0x1ccbff['id'],'interface':util[_0x6e62('0x6a')](_0x6e62('0x6b'),_0x6e62('0x6c'),_0x12bf32[_0x6e62('0x36')]),'penalty':0x0,'paused':_0x12bf32[_0x6e62('0x67')],'createdAt':_0x12bf32[_0x6e62('0x69')],'updatedAt':_0x12bf32[_0x6e62('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6e62('0x1f')](respondWithFilteredResult(_0x597a20,_0xa15705))[_0x6e62('0x28')](handleError(_0x597a20,null));};exports[_0x6e62('0x6d')]=function(_0x4577c0,_0x46f419,_0x4cfd7b){var _0x349d64={};var _0x1a1303={};var _0x263105;var _0x28a758;return db[_0x6e62('0x3d')][_0x6e62('0x60')]({'where':{'id':_0x4577c0['params']['id']}})[_0x6e62('0x1f')](handleEntityNotFound(_0x46f419,null))[_0x6e62('0x1f')](function(_0x518213){if(_0x518213){_0x263105=_0x518213;_0x1a1303[_0x6e62('0x41')]=_['keys'](db['Team'][_0x6e62('0x3e')]);_0x1a1303[_0x6e62('0x42')]=_[_0x6e62('0x43')](_0x4577c0[_0x6e62('0x42')]);_0x1a1303['filters']=_[_0x6e62('0x44')](_0x1a1303[_0x6e62('0x41')],_0x1a1303[_0x6e62('0x42')]);_0x349d64[_0x6e62('0x45')]=_['intersection'](_0x1a1303[_0x6e62('0x41')],qs[_0x6e62('0x46')](_0x4577c0[_0x6e62('0x42')]['fields']));_0x349d64[_0x6e62('0x45')]=_0x349d64['attributes']['length']?_0x349d64[_0x6e62('0x45')]:_0x1a1303[_0x6e62('0x41')];_0x349d64[_0x6e62('0x49')]=qs['sort'](_0x4577c0['query'][_0x6e62('0x4a')]);_0x349d64[_0x6e62('0x4b')]=qs[_0x6e62('0x4c')](_[_0x6e62('0x4d')](_0x4577c0[_0x6e62('0x42')],_0x1a1303['filters']));if(_0x4577c0[_0x6e62('0x42')][_0x6e62('0x4e')]){_0x349d64[_0x6e62('0x4b')]=_[_0x6e62('0x39')](_0x349d64['where'],{'$or':_['map'](_0x349d64[_0x6e62('0x45')],function(_0x33003b){var _0x5f1e80={};_0x5f1e80[_0x33003b]={'$like':'%'+_0x4577c0['query'][_0x6e62('0x4e')]+'%'};return _0x5f1e80;})});}_0x349d64=_[_0x6e62('0x39')]({},_0x349d64,_0x4577c0[_0x6e62('0x50')]);return _0x263105[_0x6e62('0x6d')](_0x349d64);}})[_0x6e62('0x1f')](function(_0x288955){if(_0x288955){_0x28a758=_0x288955[_0x6e62('0x47')];if(!_0x4577c0[_0x6e62('0x42')][_0x6e62('0x48')]('nolimit')){_0x349d64[_0x6e62('0x2d')]=qs[_0x6e62('0x2d')](_0x4577c0[_0x6e62('0x42')]['limit']);_0x349d64[_0x6e62('0x2e')]=qs['offset'](_0x4577c0[_0x6e62('0x42')][_0x6e62('0x2e')]);}return _0x263105['getTeams'](_0x349d64);}})[_0x6e62('0x1f')](function(_0x19879c){if(_0x19879c){return _0x19879c?{'count':_0x28a758,'rows':_0x19879c}:null;}})[_0x6e62('0x1f')](respondWithResult(_0x46f419,null))[_0x6e62('0x28')](handleError(_0x46f419,null));};exports[_0x6e62('0x6e')]=function(_0x35f31b,_0x162750,_0x519e98){var _0x5e14a2=_0x35f31b[_0x6e62('0x3a')]['ids'];return db[_0x6e62('0x6f')][_0x6e62('0x53')]({'where':{'id':_0x5e14a2},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6e62('0x70'),'attributes':['id','name',_0x6e62('0x71'),'voicePause',_0x6e62('0x72')],'raw':!![]}]})['then'](function(_0x1dfd45){if(_0x1dfd45){var _0x1161cd=_[_0x6e62('0x73')](_0x1dfd45,function(_0x47745e){var _0x45f361=_0x47745e['get']({'plain':!![]});return _0x45f361[_0x6e62('0x70')];});return db[_0x6e62('0x3d')][_0x6e62('0x57')]({'where':{'id':_0x35f31b[_0x6e62('0x56')]['id']}})[_0x6e62('0x1f')](function(_0x2049e4){return db[_0x6e62('0x74')][_0x6e62('0x75')](function(_0x7fa90b){return _0x2049e4[_0x6e62('0x6e')](_0x5e14a2,{'transaction':_0x7fa90b})[_0x6e62('0x1f')](function(){return BPromise['each'](_0x1161cd,function(_0x3db7f6){return db[_0x6e62('0x61')]['findOrCreate']({'where':{'UserId':_0x3db7f6['id'],'ChatQueueId':_0x35f31b['params']['id']},'transaction':_0x7fa90b});});})['then'](function(){_0x1161cd[_0x6e62('0x76')](function(_0x6f6e16){socket[_0x6e62('0x77')](_0x6e62('0x78'),{'UserId':_0x6f6e16['id'],'ChatQueueId':_0x2049e4['id']});});});});});}})['then'](respondWithStatusCode(_0x162750,null))['catch'](handleError(_0x162750,null));};exports[_0x6e62('0x79')]=function(_0x22cfd7,_0x3571f5,_0x23b57e){return db[_0x6e62('0x6f')][_0x6e62('0x53')]({'where':{'id':_0x22cfd7[_0x6e62('0x42')][_0x6e62('0x7a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6e62('0x70'),'attributes':['id'],'raw':!![]}]})[_0x6e62('0x1f')](handleEntityNotFound(_0x3571f5,null))[_0x6e62('0x1f')](function(_0x2164d2){var _0x156723=_[_0x6e62('0x4f')](_0x2164d2,'id');var _0x5849c9=[];var _0x4a617e=[];var _0x1f7fdb=squel[_0x6e62('0x7b')]();_0x1f7fdb[_0x6e62('0x7c')]('tq.TeamId')[_0x6e62('0x7d')](_0x6e62('0x7e'),'tq')[_0x6e62('0x7f')](_0x6e62('0x80'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x6e62('0x81'),_0x22cfd7[_0x6e62('0x56')]['id']);for(var _0x959380=0x0;_0x959380<_0x2164d2['length'];_0x959380+=0x1){let _0x519dbb=_0x2164d2[_0x959380];for(var _0xe836d8=0x0;_0xe836d8<_0x519dbb[_0x6e62('0x70')]['length'];_0xe836d8+=0x1){let _0x28d0fc=_0x519dbb[_0x6e62('0x70')][_0xe836d8];var _0x5ef47f=_0x1f7fdb['clone']();_0x5ef47f['where']('ut.UserId\x20=\x20?',_0x28d0fc['id']);_0x4a617e['push'](db['sequelize'][_0x6e62('0x42')](_0x5ef47f['toString'](),{'type':db[_0x6e62('0x74')][_0x6e62('0x82')][_0x6e62('0x83')]})[_0x6e62('0x1f')](function(_0x2809db){if(_0x2809db[_0x6e62('0x47')]===0x1){return _0x28d0fc['id'];}else{var _0x43c6b6=_['every'](_[_0x6e62('0x4f')](_0x2809db,_0x6e62('0x84')),function(_0x5cd737){return _['includes'](_0x156723,_0x5cd737);});if(_0x43c6b6){return _0x28d0fc['id'];}}}));}}return BPromise[_0x6e62('0x85')](_0x4a617e)[_0x6e62('0x1f')](function(_0x4e7ff9){_0x5849c9=_(_0x5849c9)[_0x6e62('0x86')](_0x4e7ff9)[_0x6e62('0x87')]()[_0x6e62('0x88')]();return db['ChatQueue'][_0x6e62('0x57')]({'where':{'id':_0x22cfd7['params']['id']}})[_0x6e62('0x1f')](function(_0x3f0e1f){return db[_0x6e62('0x74')][_0x6e62('0x75')](function(_0x231d19){return _0x3f0e1f[_0x6e62('0x79')](_0x22cfd7[_0x6e62('0x42')][_0x6e62('0x7a')],{'transaction':_0x231d19})['then'](function(){if(!_[_0x6e62('0x89')](_0x5849c9)){return _0x3f0e1f[_0x6e62('0x8a')](_0x5849c9,{'transaction':_0x231d19});}})['then'](function(){_0x5849c9[_0x6e62('0x76')](function(_0x159d5a){socket[_0x6e62('0x77')]('userChatQueue:remove',{'UserId':_0x159d5a,'ChatQueueId':_0x3f0e1f['id']});});});});});});})[_0x6e62('0x1f')](respondWithStatusCode(_0x3571f5,null))['catch'](handleError(_0x3571f5,null));};exports[_0x6e62('0x8b')]=function(_0x361b0c,_0x2eafde,_0x437c38){return db[_0x6e62('0x3d')]['find']({'where':{'id':_0x361b0c[_0x6e62('0x56')]['id']}})[_0x6e62('0x1f')](handleEntityNotFound(_0x2eafde,null))[_0x6e62('0x1f')](function(_0x3229f2){if(_0x3229f2){return _0x3229f2[_0x6e62('0x8b')](_0x361b0c['body']['ids'],_['omit'](_0x361b0c[_0x6e62('0x3a')],[_0x6e62('0x7a'),'id'])||{})[_0x6e62('0x8c')](function(_0x2749f7){for(var _0x5dd09a=0x0;_0x5dd09a<_0x361b0c['body'][_0x6e62('0x7a')][_0x6e62('0x47')];_0x5dd09a+=0x1){socket['emit'](_0x6e62('0x78'),{'UserId':_0x361b0c['body']['ids'][_0x5dd09a],'ChatQueueId':_0x361b0c['params']['id']});}return _0x2749f7;});}})[_0x6e62('0x1f')](respondWithResult(_0x2eafde,null))[_0x6e62('0x28')](handleError(_0x2eafde,null));};exports['removeAgents']=function(_0x11961d,_0x3ae486,_0x14de92){return db['ChatQueue'][_0x6e62('0x57')]({'where':{'id':_0x11961d[_0x6e62('0x56')]['id']}})['then'](handleEntityNotFound(_0x3ae486,null))[_0x6e62('0x1f')](function(_0x4151c3){if(_0x4151c3){return _0x4151c3[_0x6e62('0x8a')](_0x11961d['query'][_0x6e62('0x7a')])[_0x6e62('0x1f')](function(){if(_[_0x6e62('0x8d')](_0x11961d['query']['ids'])){for(var _0x5d8fde=0x0;_0x5d8fde<_0x11961d[_0x6e62('0x42')][_0x6e62('0x7a')]['length'];_0x5d8fde+=0x1){socket[_0x6e62('0x77')]('userChatQueue:remove',{'UserId':Number(_0x11961d[_0x6e62('0x42')]['ids'][_0x5d8fde]),'ChatQueueId':Number(_0x11961d[_0x6e62('0x56')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x11961d[_0x6e62('0x42')][_0x6e62('0x7a')]),'ChatQueueId':Number(_0x11961d[_0x6e62('0x56')]['id'])});}});}})[_0x6e62('0x1f')](respondWithStatusCode(_0x3ae486,null))[_0x6e62('0x28')](handleError(_0x3ae486,null));};exports[_0x6e62('0x8e')]=function(_0x3b2d26,_0x5a1d40,_0x3856c8){var _0x2a9bd6={};var _0x3ae5c0={};var _0x36283d;var _0x59a413;return db[_0x6e62('0x3d')]['findOne']({'where':{'id':_0x3b2d26[_0x6e62('0x56')]['id']}})['then'](handleEntityNotFound(_0x5a1d40,null))['then'](function(_0x4f2140){if(_0x4f2140){_0x36283d=_0x4f2140;_0x3ae5c0[_0x6e62('0x41')]=_[_0x6e62('0x43')](db[_0x6e62('0x64')]['rawAttributes']);_0x3ae5c0[_0x6e62('0x42')]=_['keys'](_0x3b2d26['query']);_0x3ae5c0[_0x6e62('0x4c')]=_[_0x6e62('0x44')](_0x3ae5c0['model'],_0x3ae5c0[_0x6e62('0x42')]);_0x2a9bd6[_0x6e62('0x45')]=_['intersection'](_0x3ae5c0['model'],qs[_0x6e62('0x46')](_0x3b2d26['query']['fields']));_0x2a9bd6[_0x6e62('0x45')]=_0x2a9bd6[_0x6e62('0x45')][_0x6e62('0x47')]?_0x2a9bd6[_0x6e62('0x45')]:_0x3ae5c0['model'];_0x2a9bd6[_0x6e62('0x49')]=qs[_0x6e62('0x4a')](_0x3b2d26[_0x6e62('0x42')][_0x6e62('0x4a')]);_0x2a9bd6['where']=qs[_0x6e62('0x4c')](_[_0x6e62('0x4d')](_0x3b2d26['query'],_0x3ae5c0[_0x6e62('0x4c')]));if(_0x3b2d26[_0x6e62('0x42')][_0x6e62('0x4e')]){_0x2a9bd6[_0x6e62('0x4b')]=_['merge'](_0x2a9bd6['where'],{'$or':_[_0x6e62('0x4f')](_0x2a9bd6[_0x6e62('0x45')],function(_0x58b4b9){var _0x5629ad={};_0x5629ad[_0x58b4b9]={'$like':'%'+_0x3b2d26['query']['filter']+'%'};return _0x5629ad;})});}_0x2a9bd6=_[_0x6e62('0x39')]({},_0x2a9bd6,_0x3b2d26[_0x6e62('0x50')]);return _0x36283d[_0x6e62('0x8e')](_0x2a9bd6);}})[_0x6e62('0x1f')](function(_0x1d89d7){if(_0x1d89d7){_0x59a413=_0x1d89d7['length'];if(!_0x3b2d26[_0x6e62('0x42')]['hasOwnProperty'](_0x6e62('0x62'))){_0x2a9bd6[_0x6e62('0x2d')]=qs[_0x6e62('0x2d')](_0x3b2d26['query'][_0x6e62('0x2d')]);_0x2a9bd6[_0x6e62('0x2e')]=qs['offset'](_0x3b2d26[_0x6e62('0x42')]['offset']);}return _0x36283d[_0x6e62('0x8e')](_0x2a9bd6);}})[_0x6e62('0x1f')](function(_0x1750de){if(_0x1750de){return _0x1750de?{'count':_0x59a413,'rows':_0x1750de}:null;}})[_0x6e62('0x1f')](respondWithResult(_0x5a1d40,null))[_0x6e62('0x28')](handleError(_0x5a1d40,null));};
\ No newline at end of file
+var _0xef17=['user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','QueryTypes','SELECT','TeamId','all','union','compact','value','isEmpty','userChatQueue:remove','addAgents','userChatQueue:save','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','then','info','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatQueue,\x20%s,\x20%s','request\x20sent','result','catch','sendStatus','status','json','undefined','limit','count','offset','apply','reject','update','destroy','ChatQueues','end','stack','name','send','merge','body','contact','agent','interaction','account','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','ChatQueue','includeAll','params','include','options','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','order','User','findAndCountAll','UserId','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','addTeams','findAll','Agents','online','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','ids','field','tq.TeamId','from','team_has_chat_queues','join'];(function(_0x12184f,_0x59c61c){var _0x8c3283=function(_0x1aaabb){while(--_0x1aaabb){_0x12184f['push'](_0x12184f['shift']());}};_0x8c3283(++_0x59c61c);}(_0xef17,0x136));var _0x7ef1=function(_0x4eee5e,_0x199407){_0x4eee5e=_0x4eee5e-0x0;var _0x1537ee=_0xef17[_0x4eee5e];return _0x1537ee;};'use strict';var emlformat=require(_0x7ef1('0x0'));var rimraf=require(_0x7ef1('0x1'));var zipdir=require(_0x7ef1('0x2'));var jsonpatch=require(_0x7ef1('0x3'));var rp=require(_0x7ef1('0x4'));var moment=require(_0x7ef1('0x5'));var BPromise=require(_0x7ef1('0x6'));var Mustache=require(_0x7ef1('0x7'));var util=require(_0x7ef1('0x8'));var path=require('path');var sox=require(_0x7ef1('0x9'));var csv=require('to-csv');var ejs=require(_0x7ef1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7ef1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7ef1('0xc'));var deskjs=require(_0x7ef1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7ef1('0xe'));var Papa=require(_0x7ef1('0xf'));var Redis=require(_0x7ef1('0x10'));var authService=require(_0x7ef1('0x11'));var qs=require(_0x7ef1('0x12'));var as=require(_0x7ef1('0x13'));var hardwareService=require(_0x7ef1('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x7ef1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x7ef1('0x16')]=_['defaults'](config[_0x7ef1('0x16')],{'host':_0x7ef1('0x17'),'port':0x18eb});var socket=require(_0x7ef1('0x18'))(new Redis(config[_0x7ef1('0x16')]));require(_0x7ef1('0x19'))[_0x7ef1('0x1a')](socket);var jayson=require(_0x7ef1('0x1b'));var client=jayson[_0x7ef1('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4de80f,_0x267f0e,_0x5d0499,_0x20b843){return new BPromise(function(_0x3ae268,_0x55e84e){var _0x4e26d1=_0x20b843||client;return _0x4e26d1['request'](_0x4de80f,_0x5d0499)[_0x7ef1('0x1d')](function(_0x4da0fa){logger[_0x7ef1('0x1e')]('ChatQueue,\x20%s,\x20%s',_0x267f0e,'request\x20sent');logger['debug'](_0x7ef1('0x1f'),_0x267f0e,'request\x20sent',JSON[_0x7ef1('0x20')](_0x4da0fa));if(_0x4da0fa[_0x7ef1('0x21')]){if(_0x4da0fa['error']['code']===0x1f4){logger[_0x7ef1('0x21')]('ChatQueue,\x20%s,\x20%s',_0x267f0e,_0x4da0fa[_0x7ef1('0x21')][_0x7ef1('0x22')]);return _0x55e84e(_0x4da0fa[_0x7ef1('0x21')][_0x7ef1('0x22')]);}logger[_0x7ef1('0x21')](_0x7ef1('0x23'),_0x267f0e,_0x4da0fa[_0x7ef1('0x21')][_0x7ef1('0x22')]);return _0x3ae268(_0x4da0fa['error'][_0x7ef1('0x22')]);}else{logger[_0x7ef1('0x1e')](_0x7ef1('0x23'),_0x267f0e,_0x7ef1('0x24'));_0x3ae268(_0x4da0fa[_0x7ef1('0x25')][_0x7ef1('0x22')]);}})[_0x7ef1('0x26')](function(_0x144e74){logger['error']('ChatQueue,\x20%s,\x20%s',_0x267f0e,_0x144e74);_0x55e84e(_0x144e74);});});}function respondWithStatusCode(_0x33e008,_0x12ef5a){_0x12ef5a=_0x12ef5a||0xcc;return function(_0x132f2e){if(_0x132f2e){return _0x33e008[_0x7ef1('0x27')](_0x12ef5a);}return _0x33e008[_0x7ef1('0x28')](_0x12ef5a)['end']();};}function respondWithResult(_0x2e62a4,_0x9eca93){_0x9eca93=_0x9eca93||0xc8;return function(_0x445902){if(_0x445902){return _0x2e62a4[_0x7ef1('0x28')](_0x9eca93)[_0x7ef1('0x29')](_0x445902);}};}function respondWithFilteredResult(_0x238fdc,_0x21e8c5){return function(_0x58e7ee){if(_0x58e7ee){var _0x2e8f1b=typeof _0x21e8c5['offset']===_0x7ef1('0x2a')&&typeof _0x21e8c5[_0x7ef1('0x2b')]==='undefined';var _0x5f25de=_0x58e7ee[_0x7ef1('0x2c')];var _0x1136dc=_0x2e8f1b?0x0:_0x21e8c5['offset'];var _0xbf918d=_0x2e8f1b?_0x58e7ee['count']:_0x21e8c5[_0x7ef1('0x2d')]+_0x21e8c5['limit'];var _0x122999;if(_0xbf918d>=_0x5f25de){_0xbf918d=_0x5f25de;_0x122999=0xc8;}else{_0x122999=0xce;}_0x238fdc[_0x7ef1('0x28')](_0x122999);return _0x238fdc['set']('Content-Range',_0x1136dc+'-'+_0xbf918d+'/'+_0x5f25de)['json'](_0x58e7ee);}return null;};}function patchUpdates(_0x5f2976){return function(_0x1b72a1){try{jsonpatch[_0x7ef1('0x2e')](_0x1b72a1,_0x5f2976,!![]);}catch(_0x596abe){return BPromise[_0x7ef1('0x2f')](_0x596abe);}return _0x1b72a1['save']();};}function saveUpdates(_0x49fe6a,_0x2831cb){return function(_0x5c23ce){if(_0x5c23ce){return _0x5c23ce[_0x7ef1('0x30')](_0x49fe6a)[_0x7ef1('0x1d')](function(_0x112c22){return _0x112c22;});}return null;};}function removeEntity(_0x1bfa7b,_0x47e0e1){return function(_0x191575){if(_0x191575){return _0x191575[_0x7ef1('0x31')]()['then'](function(){var _0x52cf62=_0x191575['get']({'plain':!![]});var _0x507053=_0x7ef1('0x32');return db['UserProfileResource'][_0x7ef1('0x31')]({'where':{'type':_0x507053,'resourceId':_0x52cf62['id']}})[_0x7ef1('0x1d')](function(){return _0x191575;});})[_0x7ef1('0x1d')](function(){_0x1bfa7b[_0x7ef1('0x28')](0xcc)[_0x7ef1('0x33')]();});}};}function handleEntityNotFound(_0x29dd39,_0x43c6c4){return function(_0x278aaf){if(!_0x278aaf){_0x29dd39[_0x7ef1('0x27')](0x194);}return _0x278aaf;};}function handleError(_0x3eb9a3,_0x32becc){_0x32becc=_0x32becc||0x1f4;return function(_0x49bb71){logger[_0x7ef1('0x21')](_0x49bb71[_0x7ef1('0x34')]);if(_0x49bb71['name']){delete _0x49bb71[_0x7ef1('0x35')];}_0x3eb9a3[_0x7ef1('0x28')](_0x32becc)[_0x7ef1('0x36')](_0x49bb71);};}function getMustacheRender(_0x273bf1,_0x8ef5b3){return Mustache['render'](_0x273bf1,_[_0x7ef1('0x37')](_0x8ef5b3[_0x7ef1('0x38')],{'contact':_0x8ef5b3[_0x7ef1('0x39')],'message':_0x8ef5b3[_0x7ef1('0x22')],'agent':_0x8ef5b3[_0x7ef1('0x3a')],'interaction':_0x8ef5b3[_0x7ef1('0x3b')],'account':_0x8ef5b3[_0x7ef1('0x3c')]}))||'';}exports[_0x7ef1('0x3d')]=function(_0x1433df,_0x2ec2b8){var _0x252176={},_0x40977b={},_0x2da912={'count':0x0,'rows':[]};var _0x39b280=_[_0x7ef1('0x3e')](db['ChatQueue'][_0x7ef1('0x3f')],function(_0x1e3d07){return{'name':_0x1e3d07[_0x7ef1('0x40')],'type':_0x1e3d07[_0x7ef1('0x41')][_0x7ef1('0x42')]};});_0x40977b[_0x7ef1('0x43')]=_[_0x7ef1('0x3e')](_0x39b280,_0x7ef1('0x35'));_0x40977b[_0x7ef1('0x44')]=_[_0x7ef1('0x45')](_0x1433df[_0x7ef1('0x44')]);_0x40977b[_0x7ef1('0x46')]=_[_0x7ef1('0x47')](_0x40977b['model'],_0x40977b[_0x7ef1('0x44')]);_0x252176[_0x7ef1('0x48')]=_[_0x7ef1('0x47')](_0x40977b[_0x7ef1('0x43')],qs[_0x7ef1('0x49')](_0x1433df[_0x7ef1('0x44')]['fields']));_0x252176[_0x7ef1('0x48')]=_0x252176[_0x7ef1('0x48')][_0x7ef1('0x4a')]?_0x252176[_0x7ef1('0x48')]:_0x40977b[_0x7ef1('0x43')];if(!_0x1433df[_0x7ef1('0x44')]['hasOwnProperty'](_0x7ef1('0x4b'))){_0x252176[_0x7ef1('0x2b')]=qs[_0x7ef1('0x2b')](_0x1433df[_0x7ef1('0x44')]['limit']);_0x252176[_0x7ef1('0x2d')]=qs['offset'](_0x1433df['query'][_0x7ef1('0x2d')]);}_0x252176['order']=qs[_0x7ef1('0x4c')](_0x1433df['query'][_0x7ef1('0x4c')]);_0x252176[_0x7ef1('0x4d')]=qs[_0x7ef1('0x46')](_[_0x7ef1('0x4e')](_0x1433df[_0x7ef1('0x44')],_0x40977b[_0x7ef1('0x46')]),_0x39b280);if(_0x1433df[_0x7ef1('0x44')][_0x7ef1('0x4f')]){_0x252176['where']=_['merge'](_0x252176[_0x7ef1('0x4d')],{'$or':_[_0x7ef1('0x3e')](_0x39b280,function(_0x5bf125){if(_0x5bf125[_0x7ef1('0x41')]!==_0x7ef1('0x50')){var _0xd06ca9={};_0xd06ca9[_0x5bf125['name']]={'$like':'%'+_0x1433df['query'][_0x7ef1('0x4f')]+'%'};return _0xd06ca9;}})});}_0x252176=_['merge']({},_0x252176,_0x1433df['options']);var _0x2845d9={'where':_0x252176[_0x7ef1('0x4d')]};return db[_0x7ef1('0x51')][_0x7ef1('0x2c')](_0x2845d9)[_0x7ef1('0x1d')](function(_0x4f5696){_0x2da912[_0x7ef1('0x2c')]=_0x4f5696;if(_0x1433df['query'][_0x7ef1('0x52')]){_0x252176['include']=[{'all':!![]}];}return db[_0x7ef1('0x51')]['findAll'](_0x252176);})['then'](function(_0x832c5f){_0x2da912['rows']=_0x832c5f;return _0x2da912;})[_0x7ef1('0x1d')](respondWithFilteredResult(_0x2ec2b8,_0x252176))[_0x7ef1('0x26')](handleError(_0x2ec2b8,null));};exports['show']=function(_0xf2e252,_0x738ab6){var _0x2d996f={'raw':!![],'where':{'id':_0xf2e252[_0x7ef1('0x53')]['id']}},_0x50b4b9={};_0x50b4b9[_0x7ef1('0x43')]=_['keys'](db[_0x7ef1('0x51')][_0x7ef1('0x3f')]);_0x50b4b9[_0x7ef1('0x44')]=_[_0x7ef1('0x45')](_0xf2e252[_0x7ef1('0x44')]);_0x50b4b9[_0x7ef1('0x46')]=_[_0x7ef1('0x47')](_0x50b4b9['model'],_0x50b4b9['query']);_0x2d996f[_0x7ef1('0x48')]=_[_0x7ef1('0x47')](_0x50b4b9[_0x7ef1('0x43')],qs[_0x7ef1('0x49')](_0xf2e252[_0x7ef1('0x44')][_0x7ef1('0x49')]));_0x2d996f[_0x7ef1('0x48')]=_0x2d996f[_0x7ef1('0x48')][_0x7ef1('0x4a')]?_0x2d996f[_0x7ef1('0x48')]:_0x50b4b9[_0x7ef1('0x43')];if(_0xf2e252['query'][_0x7ef1('0x52')]){_0x2d996f[_0x7ef1('0x54')]=[{'all':!![]}];}_0x2d996f=_[_0x7ef1('0x37')]({},_0x2d996f,_0xf2e252[_0x7ef1('0x55')]);return db[_0x7ef1('0x51')]['find'](_0x2d996f)[_0x7ef1('0x1d')](handleEntityNotFound(_0x738ab6,null))[_0x7ef1('0x1d')](respondWithResult(_0x738ab6,null))[_0x7ef1('0x26')](handleError(_0x738ab6,null));};exports['create']=function(_0xfa8316,_0x3e054e){return db['ChatQueue'][_0x7ef1('0x56')](_0xfa8316[_0x7ef1('0x38')],{})[_0x7ef1('0x1d')](function(_0x2d285f){var _0x1510df=_0xfa8316[_0x7ef1('0x57')][_0x7ef1('0x58')]({'plain':!![]});if(!_0x1510df)throw new Error(_0x7ef1('0x59'));if(_0x1510df[_0x7ef1('0x5a')]===_0x7ef1('0x57')){var _0x210ff7=_0x2d285f['get']({'plain':!![]});var _0xd002d2=_0x7ef1('0x32');return db['UserProfileSection'][_0x7ef1('0x5b')]({'where':{'name':_0xd002d2,'userProfileId':_0x1510df[_0x7ef1('0x5c')]},'raw':!![]})[_0x7ef1('0x1d')](function(_0x592a11){if(_0x592a11&&_0x592a11[_0x7ef1('0x5d')]===0x0){return db[_0x7ef1('0x5e')]['create']({'name':_0x210ff7[_0x7ef1('0x35')],'resourceId':_0x210ff7['id'],'type':_0x592a11[_0x7ef1('0x35')],'sectionId':_0x592a11['id']},{})[_0x7ef1('0x1d')](function(){return _0x2d285f;});}else{return _0x2d285f;}})['catch'](function(_0x10648c){logger[_0x7ef1('0x21')](_0x7ef1('0x5f'),_0x10648c);throw _0x10648c;});}return _0x2d285f;})['then'](respondWithResult(_0x3e054e,0xc9))[_0x7ef1('0x26')](handleError(_0x3e054e,null));};exports[_0x7ef1('0x30')]=function(_0x3fe784,_0x499783){if(_0x3fe784[_0x7ef1('0x38')]['id']){delete _0x3fe784[_0x7ef1('0x38')]['id'];}return db['ChatQueue'][_0x7ef1('0x5b')]({'where':{'id':_0x3fe784[_0x7ef1('0x53')]['id']}})[_0x7ef1('0x1d')](handleEntityNotFound(_0x499783,null))[_0x7ef1('0x1d')](saveUpdates(_0x3fe784[_0x7ef1('0x38')],null))[_0x7ef1('0x1d')](respondWithResult(_0x499783,null))[_0x7ef1('0x26')](handleError(_0x499783,null));};exports[_0x7ef1('0x31')]=function(_0x19d380,_0x530bbe){return db[_0x7ef1('0x51')]['find']({'where':{'id':_0x19d380[_0x7ef1('0x53')]['id']}})['then'](handleEntityNotFound(_0x530bbe,null))[_0x7ef1('0x1d')](removeEntity(_0x530bbe,null))[_0x7ef1('0x26')](handleError(_0x530bbe,null));};exports[_0x7ef1('0x60')]=function(_0x6e6068,_0x4cdfa0){return db[_0x7ef1('0x51')][_0x7ef1('0x60')]()[_0x7ef1('0x1d')](respondWithResult(_0x4cdfa0,null))[_0x7ef1('0x26')](handleError(_0x4cdfa0,null));};exports[_0x7ef1('0x61')]=function(_0x5ce81e,_0x134399,_0x59d157){var _0x4876c7={'raw':!![],'where':{}},_0x3712f2={},_0xf91f9c;return db[_0x7ef1('0x51')][_0x7ef1('0x62')]({'where':{'id':_0x5ce81e[_0x7ef1('0x53')]['id']}})['then'](handleEntityNotFound(_0x134399,null))[_0x7ef1('0x1d')](function(_0x31e175){if(_0x31e175){_0xf91f9c=_0x31e175['get']({'plain':!![]});_0x3712f2[_0x7ef1('0x43')]=_[_0x7ef1('0x45')](db[_0x7ef1('0x63')][_0x7ef1('0x3f')]);_0x3712f2['query']=_[_0x7ef1('0x45')](_0x5ce81e[_0x7ef1('0x44')]);_0x3712f2[_0x7ef1('0x46')]=_[_0x7ef1('0x47')](_0x3712f2['model'],_0x3712f2['query']);_0x4876c7[_0x7ef1('0x48')]=_[_0x7ef1('0x47')](_0x3712f2[_0x7ef1('0x43')],qs[_0x7ef1('0x49')](_0x5ce81e[_0x7ef1('0x44')][_0x7ef1('0x49')]));_0x4876c7['attributes']=_0x4876c7['attributes']['length']?_0x4876c7[_0x7ef1('0x48')]:_0x3712f2['model'];if(!_0x5ce81e['query'][_0x7ef1('0x64')](_0x7ef1('0x4b'))){_0x4876c7['limit']=qs[_0x7ef1('0x2b')](_0x5ce81e[_0x7ef1('0x44')][_0x7ef1('0x2b')]);_0x4876c7[_0x7ef1('0x2d')]=qs[_0x7ef1('0x2d')](_0x5ce81e[_0x7ef1('0x44')][_0x7ef1('0x2d')]);}_0x4876c7[_0x7ef1('0x65')]=qs[_0x7ef1('0x4c')](_0x5ce81e[_0x7ef1('0x44')][_0x7ef1('0x4c')]);_0x4876c7[_0x7ef1('0x4d')]=qs['filters'](_[_0x7ef1('0x4e')](_0x5ce81e['query'],_0x3712f2[_0x7ef1('0x46')]));_0x4876c7['where']['ChatQueueId']=_0x31e175['id'];if(_0x5ce81e[_0x7ef1('0x44')][_0x7ef1('0x4f')]){_0x4876c7[_0x7ef1('0x4d')]=_[_0x7ef1('0x37')](_0x4876c7[_0x7ef1('0x4d')],{'$or':_[_0x7ef1('0x3e')](_0x4876c7['attributes'],function(_0xa904b8){var _0x3afee0={};_0x3afee0[_0xa904b8]={'$like':'%'+_0x5ce81e[_0x7ef1('0x44')][_0x7ef1('0x4f')]+'%'};return _0x3afee0;})});}_0x4876c7=_[_0x7ef1('0x37')]({},_0x4876c7,_0x5ce81e[_0x7ef1('0x55')]);return db[_0x7ef1('0x63')]['findAll'](_0x4876c7);}})['then'](function(_0x326eb3){if(_0x326eb3){return db[_0x7ef1('0x66')][_0x7ef1('0x67')]({'where':{'id':_[_0x7ef1('0x3e')](_0x326eb3,_0x7ef1('0x68')),'role':_0x7ef1('0x3a')},'attributes':['id',_0x7ef1('0x35'),'chatPause',_0x7ef1('0x69'),_0x7ef1('0x6a')]});}})[_0x7ef1('0x1d')](function(_0x5db8a0){if(_0x5db8a0){return{'count':_0x5db8a0['count'],'rows':_[_0x7ef1('0x3e')](_0x5db8a0[_0x7ef1('0x6b')],function(_0x163d5c){return{'membername':_0x163d5c[_0x7ef1('0x35')],'UserId':_0x163d5c['id'],'queue_name':_0xf91f9c['name'],'ChatQueueId':_0xf91f9c['id'],'interface':util[_0x7ef1('0x6c')](_0x7ef1('0x6d'),_0x7ef1('0x6e'),_0x163d5c['name']),'penalty':0x0,'paused':_0x163d5c['chatPause'],'createdAt':_0x163d5c['createdAt'],'updatedAt':_0x163d5c['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7ef1('0x1d')](respondWithFilteredResult(_0x134399,_0x4876c7))[_0x7ef1('0x26')](handleError(_0x134399,null));};exports[_0x7ef1('0x6f')]=function(_0x3a21a1,_0x2be8aa,_0x3763ed){var _0x29462a={};var _0x50109c={};var _0x3190b7;var _0x3a1bcb;return db['ChatQueue']['findOne']({'where':{'id':_0x3a21a1[_0x7ef1('0x53')]['id']}})[_0x7ef1('0x1d')](handleEntityNotFound(_0x2be8aa,null))[_0x7ef1('0x1d')](function(_0x478d2a){if(_0x478d2a){_0x3190b7=_0x478d2a;_0x50109c[_0x7ef1('0x43')]=_[_0x7ef1('0x45')](db[_0x7ef1('0x70')][_0x7ef1('0x3f')]);_0x50109c[_0x7ef1('0x44')]=_[_0x7ef1('0x45')](_0x3a21a1['query']);_0x50109c['filters']=_[_0x7ef1('0x47')](_0x50109c[_0x7ef1('0x43')],_0x50109c[_0x7ef1('0x44')]);_0x29462a[_0x7ef1('0x48')]=_[_0x7ef1('0x47')](_0x50109c[_0x7ef1('0x43')],qs[_0x7ef1('0x49')](_0x3a21a1[_0x7ef1('0x44')][_0x7ef1('0x49')]));_0x29462a[_0x7ef1('0x48')]=_0x29462a[_0x7ef1('0x48')][_0x7ef1('0x4a')]?_0x29462a[_0x7ef1('0x48')]:_0x50109c['model'];_0x29462a[_0x7ef1('0x65')]=qs[_0x7ef1('0x4c')](_0x3a21a1[_0x7ef1('0x44')][_0x7ef1('0x4c')]);_0x29462a[_0x7ef1('0x4d')]=qs[_0x7ef1('0x46')](_[_0x7ef1('0x4e')](_0x3a21a1[_0x7ef1('0x44')],_0x50109c[_0x7ef1('0x46')]));if(_0x3a21a1[_0x7ef1('0x44')][_0x7ef1('0x4f')]){_0x29462a[_0x7ef1('0x4d')]=_[_0x7ef1('0x37')](_0x29462a['where'],{'$or':_[_0x7ef1('0x3e')](_0x29462a[_0x7ef1('0x48')],function(_0x373f6d){var _0x4aa8e1={};_0x4aa8e1[_0x373f6d]={'$like':'%'+_0x3a21a1[_0x7ef1('0x44')][_0x7ef1('0x4f')]+'%'};return _0x4aa8e1;})});}_0x29462a=_[_0x7ef1('0x37')]({},_0x29462a,_0x3a21a1[_0x7ef1('0x55')]);return _0x3190b7[_0x7ef1('0x6f')](_0x29462a);}})['then'](function(_0x42121d){if(_0x42121d){_0x3a1bcb=_0x42121d[_0x7ef1('0x4a')];if(!_0x3a21a1[_0x7ef1('0x44')][_0x7ef1('0x64')]('nolimit')){_0x29462a[_0x7ef1('0x2b')]=qs[_0x7ef1('0x2b')](_0x3a21a1[_0x7ef1('0x44')][_0x7ef1('0x2b')]);_0x29462a[_0x7ef1('0x2d')]=qs['offset'](_0x3a21a1[_0x7ef1('0x44')][_0x7ef1('0x2d')]);}return _0x3190b7[_0x7ef1('0x6f')](_0x29462a);}})[_0x7ef1('0x1d')](function(_0x55cd1f){if(_0x55cd1f){return _0x55cd1f?{'count':_0x3a1bcb,'rows':_0x55cd1f}:null;}})['then'](respondWithResult(_0x2be8aa,null))[_0x7ef1('0x26')](handleError(_0x2be8aa,null));};exports[_0x7ef1('0x71')]=function(_0x1b72cb,_0x1a0040,_0x2857da){var _0xbfeff8=_0x1b72cb[_0x7ef1('0x38')]['ids'];return db['Team'][_0x7ef1('0x72')]({'where':{'id':_0xbfeff8},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7ef1('0x73'),'attributes':['id',_0x7ef1('0x35'),_0x7ef1('0x74'),'voicePause','interface'],'raw':!![]}]})[_0x7ef1('0x1d')](function(_0x51347e){if(_0x51347e){var _0x15cd23=_[_0x7ef1('0x75')](_0x51347e,function(_0x3db6a1){var _0x227dc4=_0x3db6a1[_0x7ef1('0x58')]({'plain':!![]});return _0x227dc4[_0x7ef1('0x73')];});return db[_0x7ef1('0x51')]['find']({'where':{'id':_0x1b72cb['params']['id']}})[_0x7ef1('0x1d')](function(_0x5b0110){return db[_0x7ef1('0x76')][_0x7ef1('0x77')](function(_0x4bb8aa){return _0x5b0110['addTeams'](_0xbfeff8,{'transaction':_0x4bb8aa})[_0x7ef1('0x1d')](function(){return BPromise[_0x7ef1('0x78')](_0x15cd23,function(_0x2be912){return db['UserChatQueue'][_0x7ef1('0x79')]({'where':{'UserId':_0x2be912['id'],'ChatQueueId':_0x1b72cb['params']['id']},'transaction':_0x4bb8aa});});})['then'](function(){_0x15cd23[_0x7ef1('0x7a')](function(_0x1f83d0){socket[_0x7ef1('0x7b')]('userChatQueue:save',{'UserId':_0x1f83d0['id'],'ChatQueueId':_0x5b0110['id']});});});});});}})['then'](respondWithStatusCode(_0x1a0040,null))['catch'](handleError(_0x1a0040,null));};exports[_0x7ef1('0x7c')]=function(_0x2dfa67,_0x3c4fd3,_0x4a70ed){return db[_0x7ef1('0x70')][_0x7ef1('0x72')]({'where':{'id':_0x2dfa67[_0x7ef1('0x44')][_0x7ef1('0x7d')]},'attributes':['id'],'include':[{'model':db[_0x7ef1('0x66')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x7ef1('0x1d')](handleEntityNotFound(_0x3c4fd3,null))[_0x7ef1('0x1d')](function(_0x2f285e){var _0x9d2b2a=_[_0x7ef1('0x3e')](_0x2f285e,'id');var _0x1f0b79=[];var _0x253176=[];var _0x28515d=squel['select']();_0x28515d[_0x7ef1('0x7e')](_0x7ef1('0x7f'))[_0x7ef1('0x80')](_0x7ef1('0x81'),'tq')[_0x7ef1('0x82')](_0x7ef1('0x83'),'ut',_0x7ef1('0x84'))[_0x7ef1('0x4d')]('ChatQueueId\x20=\x20?',_0x2dfa67[_0x7ef1('0x53')]['id']);for(var _0x5a2fc0=0x0;_0x5a2fc0<_0x2f285e[_0x7ef1('0x4a')];_0x5a2fc0+=0x1){let _0x5b06b4=_0x2f285e[_0x5a2fc0];for(var _0xa2a0d5=0x0;_0xa2a0d5<_0x5b06b4[_0x7ef1('0x73')][_0x7ef1('0x4a')];_0xa2a0d5+=0x1){let _0xfb87bd=_0x5b06b4['Agents'][_0xa2a0d5];var _0x5b836e=_0x28515d['clone']();_0x5b836e[_0x7ef1('0x4d')]('ut.UserId\x20=\x20?',_0xfb87bd['id']);_0x253176[_0x7ef1('0x85')](db[_0x7ef1('0x76')][_0x7ef1('0x44')](_0x5b836e['toString'](),{'type':db[_0x7ef1('0x76')][_0x7ef1('0x86')][_0x7ef1('0x87')]})[_0x7ef1('0x1d')](function(_0xae57ee){if(_0xae57ee['length']===0x1){return _0xfb87bd['id'];}else{var _0x4c36f9=_['every'](_[_0x7ef1('0x3e')](_0xae57ee,_0x7ef1('0x88')),function(_0x2204f4){return _['includes'](_0x9d2b2a,_0x2204f4);});if(_0x4c36f9){return _0xfb87bd['id'];}}}));}}return BPromise[_0x7ef1('0x89')](_0x253176)[_0x7ef1('0x1d')](function(_0x1611b3){_0x1f0b79=_(_0x1f0b79)[_0x7ef1('0x8a')](_0x1611b3)[_0x7ef1('0x8b')]()[_0x7ef1('0x8c')]();return db[_0x7ef1('0x51')][_0x7ef1('0x5b')]({'where':{'id':_0x2dfa67[_0x7ef1('0x53')]['id']}})[_0x7ef1('0x1d')](function(_0x2b941a){return db[_0x7ef1('0x76')][_0x7ef1('0x77')](function(_0x27c165){return _0x2b941a[_0x7ef1('0x7c')](_0x2dfa67[_0x7ef1('0x44')]['ids'],{'transaction':_0x27c165})['then'](function(){if(!_[_0x7ef1('0x8d')](_0x1f0b79)){return _0x2b941a['removeAgents'](_0x1f0b79,{'transaction':_0x27c165});}})[_0x7ef1('0x1d')](function(){_0x1f0b79[_0x7ef1('0x7a')](function(_0x4da84e){socket[_0x7ef1('0x7b')](_0x7ef1('0x8e'),{'UserId':_0x4da84e,'ChatQueueId':_0x2b941a['id']});});});});});});})[_0x7ef1('0x1d')](respondWithStatusCode(_0x3c4fd3,null))['catch'](handleError(_0x3c4fd3,null));};exports[_0x7ef1('0x8f')]=function(_0x13092c,_0x13d51a,_0x473d55){return db[_0x7ef1('0x51')][_0x7ef1('0x5b')]({'where':{'id':_0x13092c[_0x7ef1('0x53')]['id']}})[_0x7ef1('0x1d')](handleEntityNotFound(_0x13d51a,null))[_0x7ef1('0x1d')](function(_0x34bdca){if(_0x34bdca){return _0x34bdca[_0x7ef1('0x8f')](_0x13092c['body']['ids'],_['omit'](_0x13092c[_0x7ef1('0x38')],['ids','id'])||{})['spread'](function(_0x4c193e){for(var _0x4552b1=0x0;_0x4552b1<_0x13092c[_0x7ef1('0x38')][_0x7ef1('0x7d')][_0x7ef1('0x4a')];_0x4552b1+=0x1){socket['emit'](_0x7ef1('0x90'),{'UserId':_0x13092c[_0x7ef1('0x38')]['ids'][_0x4552b1],'ChatQueueId':_0x13092c['params']['id']});}return _0x4c193e;});}})[_0x7ef1('0x1d')](respondWithResult(_0x13d51a,null))[_0x7ef1('0x26')](handleError(_0x13d51a,null));};exports[_0x7ef1('0x91')]=function(_0x45c152,_0x53ede0,_0x78b93d){return db[_0x7ef1('0x51')][_0x7ef1('0x5b')]({'where':{'id':_0x45c152[_0x7ef1('0x53')]['id']}})[_0x7ef1('0x1d')](handleEntityNotFound(_0x53ede0,null))[_0x7ef1('0x1d')](function(_0x15e058){if(_0x15e058){return _0x15e058[_0x7ef1('0x91')](_0x45c152[_0x7ef1('0x44')][_0x7ef1('0x7d')])[_0x7ef1('0x1d')](function(){if(_['isArray'](_0x45c152[_0x7ef1('0x44')][_0x7ef1('0x7d')])){for(var _0x49ef70=0x0;_0x49ef70<_0x45c152['query'][_0x7ef1('0x7d')][_0x7ef1('0x4a')];_0x49ef70+=0x1){socket['emit'](_0x7ef1('0x8e'),{'UserId':Number(_0x45c152[_0x7ef1('0x44')][_0x7ef1('0x7d')][_0x49ef70]),'ChatQueueId':Number(_0x45c152['params']['id'])});}}else{socket[_0x7ef1('0x7b')](_0x7ef1('0x8e'),{'UserId':Number(_0x45c152['query'][_0x7ef1('0x7d')]),'ChatQueueId':Number(_0x45c152[_0x7ef1('0x53')]['id'])});}});}})[_0x7ef1('0x1d')](respondWithStatusCode(_0x53ede0,null))[_0x7ef1('0x26')](handleError(_0x53ede0,null));};exports[_0x7ef1('0x92')]=function(_0x3be47d,_0x384cb3,_0xa7e21){var _0x1e5360={};var _0x127dcf={};var _0x25d6ea;var _0x1ab9d5;return db[_0x7ef1('0x51')][_0x7ef1('0x62')]({'where':{'id':_0x3be47d['params']['id']}})[_0x7ef1('0x1d')](handleEntityNotFound(_0x384cb3,null))[_0x7ef1('0x1d')](function(_0x5f0642){if(_0x5f0642){_0x25d6ea=_0x5f0642;_0x127dcf[_0x7ef1('0x43')]=_[_0x7ef1('0x45')](db[_0x7ef1('0x66')][_0x7ef1('0x3f')]);_0x127dcf[_0x7ef1('0x44')]=_['keys'](_0x3be47d[_0x7ef1('0x44')]);_0x127dcf[_0x7ef1('0x46')]=_[_0x7ef1('0x47')](_0x127dcf[_0x7ef1('0x43')],_0x127dcf[_0x7ef1('0x44')]);_0x1e5360[_0x7ef1('0x48')]=_[_0x7ef1('0x47')](_0x127dcf[_0x7ef1('0x43')],qs[_0x7ef1('0x49')](_0x3be47d[_0x7ef1('0x44')][_0x7ef1('0x49')]));_0x1e5360[_0x7ef1('0x48')]=_0x1e5360[_0x7ef1('0x48')][_0x7ef1('0x4a')]?_0x1e5360['attributes']:_0x127dcf[_0x7ef1('0x43')];_0x1e5360[_0x7ef1('0x65')]=qs[_0x7ef1('0x4c')](_0x3be47d[_0x7ef1('0x44')][_0x7ef1('0x4c')]);_0x1e5360[_0x7ef1('0x4d')]=qs['filters'](_[_0x7ef1('0x4e')](_0x3be47d['query'],_0x127dcf['filters']));if(_0x3be47d['query'][_0x7ef1('0x4f')]){_0x1e5360[_0x7ef1('0x4d')]=_[_0x7ef1('0x37')](_0x1e5360[_0x7ef1('0x4d')],{'$or':_['map'](_0x1e5360[_0x7ef1('0x48')],function(_0x2ef0d0){var _0x2b992a={};_0x2b992a[_0x2ef0d0]={'$like':'%'+_0x3be47d[_0x7ef1('0x44')][_0x7ef1('0x4f')]+'%'};return _0x2b992a;})});}_0x1e5360=_[_0x7ef1('0x37')]({},_0x1e5360,_0x3be47d[_0x7ef1('0x55')]);return _0x25d6ea[_0x7ef1('0x92')](_0x1e5360);}})['then'](function(_0x498673){if(_0x498673){_0x1ab9d5=_0x498673[_0x7ef1('0x4a')];if(!_0x3be47d[_0x7ef1('0x44')][_0x7ef1('0x64')](_0x7ef1('0x4b'))){_0x1e5360[_0x7ef1('0x2b')]=qs[_0x7ef1('0x2b')](_0x3be47d['query'][_0x7ef1('0x2b')]);_0x1e5360[_0x7ef1('0x2d')]=qs[_0x7ef1('0x2d')](_0x3be47d[_0x7ef1('0x44')][_0x7ef1('0x2d')]);}return _0x25d6ea[_0x7ef1('0x92')](_0x1e5360);}})[_0x7ef1('0x1d')](function(_0x4883fa){if(_0x4883fa){return _0x4883fa?{'count':_0x1ab9d5,'rows':_0x4883fa}:null;}})['then'](respondWithResult(_0x384cb3,null))[_0x7ef1('0x26')](handleError(_0x384cb3,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 034e46f..5d75073 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 _0xb10b=['hasOwnProperty','hook','events','ChatQueue','setMaxListeners','save','remove','emit'];(function(_0x56435f,_0xbc6554){var _0x39c91e=function(_0x5c483b){while(--_0x5c483b){_0x56435f['push'](_0x56435f['shift']());}};_0x39c91e(++_0xbc6554);}(_0xb10b,0x12a));var _0xbb10=function(_0x3d773f,_0x3462b3){_0x3d773f=_0x3d773f-0x0;var _0x22bf3a=_0xb10b[_0x3d773f];return _0x22bf3a;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatQueueEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatQueueEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatQueue[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x393cbc,_0x5d132c){var _0x10fd85=function(_0x4c0dd0){while(--_0x4c0dd0){_0x393cbc['push'](_0x393cbc['shift']());}};_0x10fd85(++_0x5d132c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x208ca0,_0xf46ead){_0x208ca0=_0x208ca0-0x0;var _0x313645=_0x5f2f[_0x208ca0];return _0x313645;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var ChatQueue=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){ChatQueueEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);ChatQueueEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];ChatQueue[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 0b55dee..085bb08 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 _0x19e9=['path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','request-promise'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0x19e9,0x68));var _0x919e=function(_0x5d02c1,_0x429981){_0x5d02c1=_0x5d02c1-0x0;var _0x23d71a=_0x19e9[_0x5d02c1];return _0x23d71a;};'use strict';var _=require(_0x919e('0x0'));var util=require(_0x919e('0x1'));var logger=require(_0x919e('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x919e('0x3'));var fs=require('fs');var path=require(_0x919e('0x4'));var rimraf=require(_0x919e('0x5'));var config=require(_0x919e('0x6'));var attributes=require(_0x919e('0x7'));module[_0x919e('0x8')]=function(_0x2ca965,_0x4cdac){return _0x2ca965[_0x919e('0x9')](_0x919e('0xa'),attributes,{'tableName':_0x919e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc887=['define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./chatQueue.attributes','exports'];(function(_0x70abd9,_0x6ae334){var _0x3a2e17=function(_0x599839){while(--_0x599839){_0x70abd9['push'](_0x70abd9['shift']());}};_0x3a2e17(++_0x6ae334);}(_0xc887,0x1e3));var _0x7c88=function(_0x544b14,_0x4d6d4b){_0x544b14=_0x544b14-0x0;var _0x14264e=_0xc887[_0x544b14];return _0x14264e;};'use strict';var _=require(_0x7c88('0x0'));var util=require(_0x7c88('0x1'));var logger=require(_0x7c88('0x2'))(_0x7c88('0x3'));var moment=require('moment');var BPromise=require(_0x7c88('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c88('0x5'));var rimraf=require('rimraf');var config=require(_0x7c88('0x6'));var attributes=require(_0x7c88('0x7'));module[_0x7c88('0x8')]=function(_0x3c8100,_0x1f03b0){return _0x3c8100[_0x7c88('0x9')](_0x7c88('0xa'),attributes,{'tableName':_0x7c88('0xb'),'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 d2a7c1c..4c621ba 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 _0x349f=['model','map','ChatQueue','ShowChatQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','info','catch','GetChatQueue','findAll','options','where','attributes','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x349f,0xa8));var _0xf349=function(_0x55b6cc,_0x33f45a){_0x55b6cc=_0x55b6cc-0x0;var _0xa7dee3=_0x349f[_0x55b6cc];return _0xa7dee3;};'use strict';var _=require(_0xf349('0x0'));var util=require(_0xf349('0x1'));var moment=require(_0xf349('0x2'));var BPromise=require('bluebird');var rs=require(_0xf349('0x3'));var fs=require('fs');var Redis=require(_0xf349('0x4'));var db=require(_0xf349('0x5'))['db'];var utils=require(_0xf349('0x6'));var logger=require(_0xf349('0x7'))(_0xf349('0x8'));var config=require(_0xf349('0x9'));var jayson=require(_0xf349('0xa'));var client=jayson[_0xf349('0xb')][_0xf349('0xc')]({'port':0x232a});config['redis']=_[_0xf349('0xd')](config[_0xf349('0xe')],{'host':_0xf349('0xf'),'port':0x18eb});var socket=require(_0xf349('0x10'))(new Redis(config[_0xf349('0xe')]));require(_0xf349('0x11'))[_0xf349('0x12')](socket);function respondWithRpcPromise(_0x5e30ef,_0x50652e,_0x1e2abf){return new BPromise(function(_0x2eb18e,_0x459747){return client[_0xf349('0x13')](_0x5e30ef,_0x1e2abf)[_0xf349('0x14')](function(_0x497611){logger['info']('ChatQueue,\x20%s,\x20%s',_0x50652e,_0xf349('0x15'));logger[_0xf349('0x16')](_0xf349('0x17'),_0x50652e,_0xf349('0x15'),JSON[_0xf349('0x18')](_0x497611));if(_0x497611['error']){if(_0x497611[_0xf349('0x19')][_0xf349('0x1a')]===0x1f4){logger['error'](_0xf349('0x1b'),_0x50652e,_0x497611[_0xf349('0x19')]['message']);return _0x459747(_0x497611[_0xf349('0x19')]['message']);}logger[_0xf349('0x19')](_0xf349('0x1b'),_0x50652e,_0x497611[_0xf349('0x19')][_0xf349('0x1c')]);return _0x2eb18e(_0x497611[_0xf349('0x19')][_0xf349('0x1c')]);}else{logger[_0xf349('0x1d')]('ChatQueue,\x20%s,\x20%s',_0x50652e,_0xf349('0x15'));_0x2eb18e(_0x497611['result'][_0xf349('0x1c')]);}})[_0xf349('0x1e')](function(_0x296894){logger[_0xf349('0x19')](_0xf349('0x1b'),_0x50652e,_0x296894);_0x459747(_0x296894);});});}exports[_0xf349('0x1f')]=function(_0x27c6de){var _0x104f9b=this;return new Promise(function(_0x5ccd87,_0x282cc8){return db['ChatQueue'][_0xf349('0x20')]({'raw':_0x27c6de[_0xf349('0x21')]?_0x27c6de[_0xf349('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x27c6de[_0xf349('0x21')]?_0x27c6de[_0xf349('0x21')][_0xf349('0x22')]||null:null,'attributes':_0x27c6de['options']?_0x27c6de[_0xf349('0x21')][_0xf349('0x23')]||null:null,'limit':_0x27c6de['options']?_0x27c6de['options']['limit']||null:null,'include':_0x27c6de[_0xf349('0x21')]?_0x27c6de[_0xf349('0x21')][_0xf349('0x24')]?_['map'](_0x27c6de[_0xf349('0x21')][_0xf349('0x24')],function(_0x11dc06){return{'model':db[_0x11dc06[_0xf349('0x25')]],'as':_0x11dc06['as'],'attributes':_0x11dc06[_0xf349('0x23')],'include':_0x11dc06[_0xf349('0x24')]?_[_0xf349('0x26')](_0x11dc06[_0xf349('0x24')],function(_0x439d32){return{'model':db[_0x439d32[_0xf349('0x25')]],'as':_0x439d32['as'],'attributes':_0x439d32[_0xf349('0x23')],'include':_0x439d32[_0xf349('0x24')]?_[_0xf349('0x26')](_0x439d32[_0xf349('0x24')],function(_0x53aa55){return{'model':db[_0x53aa55['model']],'as':_0x53aa55['as'],'attributes':_0x53aa55['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x38d1e5){logger['info'](_0xf349('0x1f'),_0x27c6de);logger['debug']('GetChatQueue',_0x27c6de,JSON['stringify'](_0x38d1e5));_0x5ccd87(_0x38d1e5);})['catch'](function(_0x1a3ec6){logger[_0xf349('0x19')](_0xf349('0x1f'),_0x1a3ec6[_0xf349('0x1c')],_0x27c6de);_0x282cc8(_0x104f9b[_0xf349('0x19')](0x1f4,_0x1a3ec6['message']));});});};exports['ShowChatQueue']=function(_0x2c0f9c){var _0x1b9b26=this;return new Promise(function(_0xa25152,_0x3c104a){return db[_0xf349('0x27')]['find']({'raw':_0x2c0f9c[_0xf349('0x21')]?_0x2c0f9c[_0xf349('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x2c0f9c['options']?_0x2c0f9c['options'][_0xf349('0x22')]||null:null,'attributes':_0x2c0f9c[_0xf349('0x21')]?_0x2c0f9c[_0xf349('0x21')]['attributes']||null:null,'include':_0x2c0f9c[_0xf349('0x21')]?_0x2c0f9c[_0xf349('0x21')][_0xf349('0x24')]?_[_0xf349('0x26')](_0x2c0f9c[_0xf349('0x21')]['include'],function(_0x6dea95){return{'model':db[_0x6dea95['model']],'as':_0x6dea95['as'],'attributes':_0x6dea95[_0xf349('0x23')],'include':_0x6dea95[_0xf349('0x24')]?_[_0xf349('0x26')](_0x6dea95[_0xf349('0x24')],function(_0x125de4){return{'model':db[_0x125de4[_0xf349('0x25')]],'as':_0x125de4['as'],'attributes':_0x125de4[_0xf349('0x23')],'include':_0x125de4['include']?_['map'](_0x125de4['include'],function(_0x3f7bc8){return{'model':db[_0x3f7bc8[_0xf349('0x25')]],'as':_0x3f7bc8['as'],'attributes':_0x3f7bc8['attributes']};}):[]};}):[]};}):[]:[]})[_0xf349('0x14')](function(_0x1159dc){logger['info'](_0xf349('0x28'),_0x2c0f9c);logger[_0xf349('0x16')](_0xf349('0x28'),_0x2c0f9c,JSON[_0xf349('0x18')](_0x1159dc));_0xa25152(_0x1159dc);})[_0xf349('0x1e')](function(_0x452249){logger['error'](_0xf349('0x28'),_0x452249['message'],_0x2c0f9c);_0x3c104a(_0x1b9b26['error'](0x1f4,_0x452249[_0xf349('0x1c')]));});});};
\ No newline at end of file
+var _0x9f95=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','register','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','findAll','options','where','limit','map','include','model','attributes','GetChatQueue','ShowChatQueue','raw','lodash'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x9f95,0x97));var _0x59f9=function(_0x513dc3,_0x4fc984){_0x513dc3=_0x513dc3-0x0;var _0x2123f8=_0x9f95[_0x513dc3];return _0x2123f8;};'use strict';var _=require(_0x59f9('0x0'));var util=require('util');var moment=require(_0x59f9('0x1'));var BPromise=require(_0x59f9('0x2'));var rs=require(_0x59f9('0x3'));var fs=require('fs');var Redis=require(_0x59f9('0x4'));var db=require(_0x59f9('0x5'))['db'];var utils=require(_0x59f9('0x6'));var logger=require(_0x59f9('0x7'))('rpc');var config=require(_0x59f9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x59f9('0x9')]['http']({'port':0x232a});config['redis']=_[_0x59f9('0xa')](config[_0x59f9('0xb')],{'host':_0x59f9('0xc'),'port':0x18eb});var socket=require(_0x59f9('0xd'))(new Redis(config[_0x59f9('0xb')]));require('./chatQueue.socket')[_0x59f9('0xe')](socket);function respondWithRpcPromise(_0x5289dd,_0x3376f5,_0x527bdf){return new BPromise(function(_0x41b875,_0x42dee0){return client['request'](_0x5289dd,_0x527bdf)[_0x59f9('0xf')](function(_0x3ce834){logger[_0x59f9('0x10')]('ChatQueue,\x20%s,\x20%s',_0x3376f5,_0x59f9('0x11'));logger[_0x59f9('0x12')](_0x59f9('0x13'),_0x3376f5,_0x59f9('0x11'),JSON[_0x59f9('0x14')](_0x3ce834));if(_0x3ce834['error']){if(_0x3ce834[_0x59f9('0x15')][_0x59f9('0x16')]===0x1f4){logger['error'](_0x59f9('0x17'),_0x3376f5,_0x3ce834['error'][_0x59f9('0x18')]);return _0x42dee0(_0x3ce834['error'][_0x59f9('0x18')]);}logger[_0x59f9('0x15')]('ChatQueue,\x20%s,\x20%s',_0x3376f5,_0x3ce834[_0x59f9('0x15')][_0x59f9('0x18')]);return _0x41b875(_0x3ce834[_0x59f9('0x15')][_0x59f9('0x18')]);}else{logger[_0x59f9('0x10')](_0x59f9('0x17'),_0x3376f5,_0x59f9('0x11'));_0x41b875(_0x3ce834[_0x59f9('0x19')]['message']);}})[_0x59f9('0x1a')](function(_0x2d9eec){logger[_0x59f9('0x15')](_0x59f9('0x17'),_0x3376f5,_0x2d9eec);_0x42dee0(_0x2d9eec);});});}exports['GetChatQueue']=function(_0x2ba943){var _0x53aecb=this;return new Promise(function(_0x5c2c85,_0x510159){return db['ChatQueue'][_0x59f9('0x1b')]({'raw':_0x2ba943[_0x59f9('0x1c')]?_0x2ba943[_0x59f9('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2ba943['options']?_0x2ba943['options'][_0x59f9('0x1d')]||null:null,'attributes':_0x2ba943['options']?_0x2ba943[_0x59f9('0x1c')]['attributes']||null:null,'limit':_0x2ba943[_0x59f9('0x1c')]?_0x2ba943[_0x59f9('0x1c')][_0x59f9('0x1e')]||null:null,'include':_0x2ba943[_0x59f9('0x1c')]?_0x2ba943[_0x59f9('0x1c')]['include']?_[_0x59f9('0x1f')](_0x2ba943[_0x59f9('0x1c')][_0x59f9('0x20')],function(_0x5bd4f1){return{'model':db[_0x5bd4f1[_0x59f9('0x21')]],'as':_0x5bd4f1['as'],'attributes':_0x5bd4f1[_0x59f9('0x22')],'include':_0x5bd4f1['include']?_[_0x59f9('0x1f')](_0x5bd4f1[_0x59f9('0x20')],function(_0xb099e9){return{'model':db[_0xb099e9[_0x59f9('0x21')]],'as':_0xb099e9['as'],'attributes':_0xb099e9[_0x59f9('0x22')],'include':_0xb099e9[_0x59f9('0x20')]?_[_0x59f9('0x1f')](_0xb099e9[_0x59f9('0x20')],function(_0x459624){return{'model':db[_0x459624['model']],'as':_0x459624['as'],'attributes':_0x459624[_0x59f9('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x545e8e){logger['info'](_0x59f9('0x23'),_0x2ba943);logger[_0x59f9('0x12')](_0x59f9('0x23'),_0x2ba943,JSON[_0x59f9('0x14')](_0x545e8e));_0x5c2c85(_0x545e8e);})[_0x59f9('0x1a')](function(_0x5e7f10){logger[_0x59f9('0x15')](_0x59f9('0x23'),_0x5e7f10['message'],_0x2ba943);_0x510159(_0x53aecb[_0x59f9('0x15')](0x1f4,_0x5e7f10['message']));});});};exports[_0x59f9('0x24')]=function(_0x2bad87){var _0x2f935a=this;return new Promise(function(_0x87577b,_0x133d9a){return db['ChatQueue']['find']({'raw':_0x2bad87['options']?_0x2bad87['options'][_0x59f9('0x25')]===undefined?!![]:![]:!![],'where':_0x2bad87['options']?_0x2bad87[_0x59f9('0x1c')][_0x59f9('0x1d')]||null:null,'attributes':_0x2bad87[_0x59f9('0x1c')]?_0x2bad87['options'][_0x59f9('0x22')]||null:null,'include':_0x2bad87['options']?_0x2bad87[_0x59f9('0x1c')][_0x59f9('0x20')]?_[_0x59f9('0x1f')](_0x2bad87[_0x59f9('0x1c')][_0x59f9('0x20')],function(_0x54e19f){return{'model':db[_0x54e19f[_0x59f9('0x21')]],'as':_0x54e19f['as'],'attributes':_0x54e19f[_0x59f9('0x22')],'include':_0x54e19f[_0x59f9('0x20')]?_[_0x59f9('0x1f')](_0x54e19f[_0x59f9('0x20')],function(_0x1a8376){return{'model':db[_0x1a8376['model']],'as':_0x1a8376['as'],'attributes':_0x1a8376[_0x59f9('0x22')],'include':_0x1a8376[_0x59f9('0x20')]?_[_0x59f9('0x1f')](_0x1a8376[_0x59f9('0x20')],function(_0x1f42ba){return{'model':db[_0x1f42ba[_0x59f9('0x21')]],'as':_0x1f42ba['as'],'attributes':_0x1f42ba['attributes']};}):[]};}):[]};}):[]:[]})[_0x59f9('0xf')](function(_0x232275){logger[_0x59f9('0x10')](_0x59f9('0x24'),_0x2bad87);logger[_0x59f9('0x12')]('ShowChatQueue',_0x2bad87,JSON[_0x59f9('0x14')](_0x232275));_0x87577b(_0x232275);})['catch'](function(_0x4c7e8e){logger[_0x59f9('0x15')]('ShowChatQueue',_0x4c7e8e['message'],_0x2bad87);_0x133d9a(_0x2f935a[_0x59f9('0x15')](0x1f4,_0x4c7e8e[_0x59f9('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index da77109..b2b2fb5 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 _0x5f2f=['remove','update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x540687,_0x1f5277){var _0x53e71a=function(_0x2ea95a){while(--_0x2ea95a){_0x540687['push'](_0x540687['shift']());}};_0x53e71a(++_0x1f5277);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2ea5d0,_0x3e4cba){_0x2ea5d0=_0x2ea5d0-0x0;var _0x47d4b2=_0x5f2f[_0x2ea5d0];return _0x47d4b2;};'use strict';var ChatQueueEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatQueueEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatQueueEvents['on'](_0x5907aa,_0x466882);}};
\ No newline at end of file
+var _0x5f2f=['remove','update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x5f2f,0x73));var _0xf5f2=function(_0x68f005,_0x1c7f4f){_0x68f005=_0x68f005-0x0;var _0x23cc8d=_0x5f2f[_0x68f005];return _0x23cc8d;};'use strict';var ChatQueueEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatQueueEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatQueueEvents['on'](_0x5907aa,_0x466882);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 686e0ee..dd7d805 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 _0x8a34=['/:id/teams','post','/:id/users','addAgents','update','delete','destroy','removeTeams','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getTeams','getAgents'];(function(_0x784f8d,_0x1d61c9){var _0x59760e=function(_0x20c916){while(--_0x20c916){_0x784f8d['push'](_0x784f8d['shift']());}};_0x59760e(++_0x1d61c9);}(_0x8a34,0x127));var _0x48a3=function(_0x21c504,_0x3e00c6){_0x21c504=_0x21c504-0x0;var _0x51b5c3=_0x8a34[_0x21c504];return _0x51b5c3;};'use strict';var multer=require(_0x48a3('0x0'));var util=require(_0x48a3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x48a3('0x2'));var router=express[_0x48a3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x48a3('0x4'));var interaction=require(_0x48a3('0x5'));var config=require(_0x48a3('0x6'));var controller=require(_0x48a3('0x7'));router[_0x48a3('0x8')]('/',auth[_0x48a3('0x9')](),controller['index']);router[_0x48a3('0x8')](_0x48a3('0xa'),auth[_0x48a3('0x9')](),controller[_0x48a3('0xb')]);router[_0x48a3('0x8')](_0x48a3('0xc'),auth['isAuthenticated'](),controller[_0x48a3('0xd')]);router['get'](_0x48a3('0xe'),auth['isAuthenticated'](),controller['getMembers']);router[_0x48a3('0x8')]('/:id/teams',auth['isAuthenticated'](),controller[_0x48a3('0xf')]);router[_0x48a3('0x8')]('/:id/users',auth[_0x48a3('0x9')](),controller[_0x48a3('0x10')]);router['post']('/',auth[_0x48a3('0x9')](),controller['create']);router['post'](_0x48a3('0x11'),auth['isAuthenticated'](),controller['addTeams']);router[_0x48a3('0x12')](_0x48a3('0x13'),auth[_0x48a3('0x9')](),controller[_0x48a3('0x14')]);router['put'](_0x48a3('0xc'),auth[_0x48a3('0x9')](),controller[_0x48a3('0x15')]);router[_0x48a3('0x16')](_0x48a3('0xc'),auth[_0x48a3('0x9')](),controller[_0x48a3('0x17')]);router[_0x48a3('0x16')]('/:id/teams',auth[_0x48a3('0x9')](),controller[_0x48a3('0x18')]);router[_0x48a3('0x16')](_0x48a3('0x13'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x48a3('0x19')]=router;
\ No newline at end of file
+var _0x153c=['show','/:id/members','getMembers','getTeams','/:id/users','create','post','addTeams','addAgents','update','delete','/:id','destroy','/:id/teams','removeTeams','removeAgents','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x5e2bdb,_0x13ca36){var _0x350187=function(_0x3bfcaf){while(--_0x3bfcaf){_0x5e2bdb['push'](_0x5e2bdb['shift']());}};_0x350187(++_0x13ca36);}(_0x153c,0x8c));var _0xc153=function(_0x40269f,_0x57e378){_0x40269f=_0x40269f-0x0;var _0x58daa6=_0x153c[_0x40269f];return _0x58daa6;};'use strict';var multer=require(_0xc153('0x0'));var util=require(_0xc153('0x1'));var path=require(_0xc153('0x2'));var timeout=require(_0xc153('0x3'));var express=require('express');var router=express[_0xc153('0x4')]();var fs_extra=require(_0xc153('0x5'));var auth=require(_0xc153('0x6'));var interaction=require(_0xc153('0x7'));var config=require(_0xc153('0x8'));var controller=require(_0xc153('0x9'));router[_0xc153('0xa')]('/',auth['isAuthenticated'](),controller[_0xc153('0xb')]);router[_0xc153('0xa')](_0xc153('0xc'),auth[_0xc153('0xd')](),controller[_0xc153('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc153('0xf')]);router[_0xc153('0xa')](_0xc153('0x10'),auth[_0xc153('0xd')](),controller[_0xc153('0x11')]);router['get']('/:id/teams',auth[_0xc153('0xd')](),controller[_0xc153('0x12')]);router['get'](_0xc153('0x13'),auth[_0xc153('0xd')](),controller['getAgents']);router['post']('/',auth[_0xc153('0xd')](),controller[_0xc153('0x14')]);router[_0xc153('0x15')]('/:id/teams',auth[_0xc153('0xd')](),controller[_0xc153('0x16')]);router[_0xc153('0x15')]('/:id/users',auth[_0xc153('0xd')](),controller[_0xc153('0x17')]);router['put']('/:id',auth[_0xc153('0xd')](),controller[_0xc153('0x18')]);router[_0xc153('0x19')](_0xc153('0x1a'),auth[_0xc153('0xd')](),controller[_0xc153('0x1b')]);router[_0xc153('0x19')](_0xc153('0x1c'),auth['isAuthenticated'](),controller[_0xc153('0x1d')]);router[_0xc153('0x19')](_0xc153('0x13'),auth['isAuthenticated'](),controller[_0xc153('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 6db333f..3dbea7a 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 _0x2496=['exports','STRING','DATE','sequelize'];(function(_0x1a2a4a,_0x5e6b05){var _0x2ef0ab=function(_0x28bc78){while(--_0x28bc78){_0x1a2a4a['push'](_0x1a2a4a['shift']());}};_0x2ef0ab(++_0x5e6b05);}(_0x2496,0x1cf));var _0x6249=function(_0x4156d3,_0x1f399b){_0x4156d3=_0x4156d3-0x0;var _0x461a9b=_0x2496[_0x4156d3];return _0x461a9b;};'use strict';var moment=require('moment');var Sequelize=require(_0x6249('0x0'));module[_0x6249('0x1')]={'uniqueid':{'type':Sequelize[_0x6249('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x6249('0x2')]},'joinAt':{'type':Sequelize[_0x6249('0x3')]},'leaveAt':{'type':Sequelize[_0x6249('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x6249('0x3')]},'reason':{'type':Sequelize[_0x6249('0x2')]}};
\ No newline at end of file
+var _0xd66d=['moment','exports','STRING','DATE'];(function(_0x32402d,_0x59f975){var _0x1a6368=function(_0x45bec9){while(--_0x45bec9){_0x32402d['push'](_0x32402d['shift']());}};_0x1a6368(++_0x59f975);}(_0xd66d,0xc8));var _0xdd66=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0xd66d[_0x20a558];return _0x53d3f7;};'use strict';var moment=require(_0xdd66('0x0'));var Sequelize=require('sequelize');module[_0xdd66('0x1')]={'uniqueid':{'type':Sequelize[_0xdd66('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xdd66('0x3')]},'leaveAt':{'type':Sequelize[_0xdd66('0x3')]},'acceptAt':{'type':Sequelize[_0xdd66('0x3')]},'exitAt':{'type':Sequelize[_0xdd66('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index e8ba717..ff18441 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 _0xeb8d=['length','nolimit','order','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','render','merge','contact','message','agent','index','ChatQueueReport','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields'];(function(_0x1470c0,_0x230b38){var _0x28a594=function(_0x4ea2d1){while(--_0x4ea2d1){_0x1470c0['push'](_0x1470c0['shift']());}};_0x28a594(++_0x230b38);}(_0xeb8d,0xfb));var _0xdeb8=function(_0x48180b,_0x4ace07){_0x48180b=_0x48180b-0x0;var _0x5b44a4=_0xeb8d[_0x48180b];return _0x5b44a4;};'use strict';var emlformat=require(_0xdeb8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdeb8('0x1'));var jsonpatch=require(_0xdeb8('0x2'));var rp=require('request-promise');var moment=require(_0xdeb8('0x3'));var BPromise=require(_0xdeb8('0x4'));var Mustache=require(_0xdeb8('0x5'));var util=require(_0xdeb8('0x6'));var path=require(_0xdeb8('0x7'));var sox=require('sox');var csv=require(_0xdeb8('0x8'));var ejs=require(_0xdeb8('0x9'));var fs=require('fs');var fs_extra=require(_0xdeb8('0xa'));var _=require(_0xdeb8('0xb'));var squel=require('squel');var crypto=require(_0xdeb8('0xc'));var jsforce=require(_0xdeb8('0xd'));var deskjs=require(_0xdeb8('0xe'));var toCsv=require(_0xdeb8('0x8'));var querystring=require(_0xdeb8('0xf'));var Papa=require(_0xdeb8('0x10'));var Redis=require(_0xdeb8('0x11'));var authService=require(_0xdeb8('0x12'));var qs=require(_0xdeb8('0x13'));var as=require(_0xdeb8('0x14'));var hardwareService=require(_0xdeb8('0x15'));var logger=require(_0xdeb8('0x16'))(_0xdeb8('0x17'));var utils=require('../../config/utils');var config=require(_0xdeb8('0x18'));var licenseUtil=require(_0xdeb8('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f1ff3,_0x4d7ef0){_0x4d7ef0=_0x4d7ef0||0xcc;return function(_0x5ed24a){if(_0x5ed24a){return _0x1f1ff3[_0xdeb8('0x1a')](_0x4d7ef0);}return _0x1f1ff3[_0xdeb8('0x1b')](_0x4d7ef0)['end']();};}function respondWithResult(_0x1be6ab,_0x4614c9){_0x4614c9=_0x4614c9||0xc8;return function(_0x3987db){if(_0x3987db){return _0x1be6ab[_0xdeb8('0x1b')](_0x4614c9)[_0xdeb8('0x1c')](_0x3987db);}};}function respondWithFilteredResult(_0x5af056,_0x2e43e7){return function(_0x1172a1){if(_0x1172a1){var _0x51c4b2=typeof _0x2e43e7['offset']===_0xdeb8('0x1d')&&typeof _0x2e43e7[_0xdeb8('0x1e')]===_0xdeb8('0x1d');var _0x522eef=_0x1172a1[_0xdeb8('0x1f')];var _0x3990e9=_0x51c4b2?0x0:_0x2e43e7[_0xdeb8('0x20')];var _0x4f15f0=_0x51c4b2?_0x1172a1[_0xdeb8('0x1f')]:_0x2e43e7[_0xdeb8('0x20')]+_0x2e43e7[_0xdeb8('0x1e')];var _0xb3b0ed;if(_0x4f15f0>=_0x522eef){_0x4f15f0=_0x522eef;_0xb3b0ed=0xc8;}else{_0xb3b0ed=0xce;}_0x5af056[_0xdeb8('0x1b')](_0xb3b0ed);return _0x5af056[_0xdeb8('0x21')](_0xdeb8('0x22'),_0x3990e9+'-'+_0x4f15f0+'/'+_0x522eef)[_0xdeb8('0x1c')](_0x1172a1);}return null;};}function patchUpdates(_0x50e36d){return function(_0x15f013){try{jsonpatch[_0xdeb8('0x23')](_0x15f013,_0x50e36d,!![]);}catch(_0x27dc1a){return BPromise[_0xdeb8('0x24')](_0x27dc1a);}return _0x15f013[_0xdeb8('0x25')]();};}function saveUpdates(_0x5bf442,_0x545686){return function(_0xe274f5){if(_0xe274f5){return _0xe274f5[_0xdeb8('0x26')](_0x5bf442)[_0xdeb8('0x27')](function(_0x41bb1e){return _0x41bb1e;});}return null;};}function removeEntity(_0x4a071d,_0x4b662c){return function(_0x45874c){if(_0x45874c){return _0x45874c[_0xdeb8('0x28')]()['then'](function(){_0x4a071d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x298ce4,_0xd2a732){return function(_0x58ed15){if(!_0x58ed15){_0x298ce4[_0xdeb8('0x1a')](0x194);}return _0x58ed15;};}function handleError(_0x18e674,_0x47174a){_0x47174a=_0x47174a||0x1f4;return function(_0x32040a){logger[_0xdeb8('0x29')](_0x32040a[_0xdeb8('0x2a')]);if(_0x32040a[_0xdeb8('0x2b')]){delete _0x32040a[_0xdeb8('0x2b')];}_0x18e674[_0xdeb8('0x1b')](_0x47174a)['send'](_0x32040a);};}function getMustacheRender(_0x4fd753,_0x46e9d1){return Mustache[_0xdeb8('0x2c')](_0x4fd753,_[_0xdeb8('0x2d')](_0x46e9d1['body'],{'contact':_0x46e9d1[_0xdeb8('0x2e')],'message':_0x46e9d1[_0xdeb8('0x2f')],'agent':_0x46e9d1[_0xdeb8('0x30')],'interaction':_0x46e9d1['interaction'],'account':_0x46e9d1['account']}))||'';}exports[_0xdeb8('0x31')]=function(_0x323d8a,_0x409251){var _0x2a9b00={},_0x45d04d={},_0x1b22a2={'count':0x0,'rows':[]};var _0x5a7ea8=_['map'](db[_0xdeb8('0x32')][_0xdeb8('0x33')],function(_0x1173df){return{'name':_0x1173df[_0xdeb8('0x34')],'type':_0x1173df[_0xdeb8('0x35')]['key']};});_0x45d04d['model']=_['map'](_0x5a7ea8,_0xdeb8('0x2b'));_0x45d04d['query']=_[_0xdeb8('0x36')](_0x323d8a[_0xdeb8('0x37')]);_0x45d04d[_0xdeb8('0x38')]=_[_0xdeb8('0x39')](_0x45d04d[_0xdeb8('0x3a')],_0x45d04d[_0xdeb8('0x37')]);_0x2a9b00[_0xdeb8('0x3b')]=_[_0xdeb8('0x39')](_0x45d04d[_0xdeb8('0x3a')],qs[_0xdeb8('0x3c')](_0x323d8a['query'][_0xdeb8('0x3c')]));_0x2a9b00['attributes']=_0x2a9b00[_0xdeb8('0x3b')][_0xdeb8('0x3d')]?_0x2a9b00[_0xdeb8('0x3b')]:_0x45d04d[_0xdeb8('0x3a')];if(!_0x323d8a[_0xdeb8('0x37')]['hasOwnProperty'](_0xdeb8('0x3e'))){_0x2a9b00[_0xdeb8('0x1e')]=qs[_0xdeb8('0x1e')](_0x323d8a[_0xdeb8('0x37')][_0xdeb8('0x1e')]);_0x2a9b00[_0xdeb8('0x20')]=qs[_0xdeb8('0x20')](_0x323d8a[_0xdeb8('0x37')][_0xdeb8('0x20')]);}_0x2a9b00[_0xdeb8('0x3f')]=qs['sort'](_0x323d8a[_0xdeb8('0x37')]['sort']);_0x2a9b00['where']=qs[_0xdeb8('0x38')](_['pick'](_0x323d8a[_0xdeb8('0x37')],_0x45d04d['filters']),_0x5a7ea8);if(_0x323d8a[_0xdeb8('0x37')][_0xdeb8('0x40')]){_0x2a9b00[_0xdeb8('0x41')]=_[_0xdeb8('0x2d')](_0x2a9b00[_0xdeb8('0x41')],{'$or':_['map'](_0x5a7ea8,function(_0x4adae0){if(_0x4adae0[_0xdeb8('0x35')]!==_0xdeb8('0x42')){var _0x1430a7={};_0x1430a7[_0x4adae0[_0xdeb8('0x2b')]]={'$like':'%'+_0x323d8a[_0xdeb8('0x37')][_0xdeb8('0x40')]+'%'};return _0x1430a7;}})});}_0x2a9b00=_[_0xdeb8('0x2d')]({},_0x2a9b00,_0x323d8a[_0xdeb8('0x43')]);var _0x46da4a={'where':_0x2a9b00['where']};return db[_0xdeb8('0x32')][_0xdeb8('0x1f')](_0x46da4a)[_0xdeb8('0x27')](function(_0x1e8820){_0x1b22a2[_0xdeb8('0x1f')]=_0x1e8820;if(_0x323d8a[_0xdeb8('0x37')][_0xdeb8('0x44')]){_0x2a9b00[_0xdeb8('0x45')]=[{'all':!![]}];}return db[_0xdeb8('0x32')][_0xdeb8('0x46')](_0x2a9b00);})[_0xdeb8('0x27')](function(_0xdc6932){_0x1b22a2['rows']=_0xdc6932;return _0x1b22a2;})['then'](respondWithFilteredResult(_0x409251,_0x2a9b00))[_0xdeb8('0x47')](handleError(_0x409251,null));};exports[_0xdeb8('0x48')]=function(_0x4dde62,_0x584ddb){var _0x410cd7={'raw':!![],'where':{'id':_0x4dde62[_0xdeb8('0x49')]['id']}},_0x17112a={};_0x17112a[_0xdeb8('0x3a')]=_[_0xdeb8('0x36')](db[_0xdeb8('0x32')][_0xdeb8('0x33')]);_0x17112a[_0xdeb8('0x37')]=_[_0xdeb8('0x36')](_0x4dde62['query']);_0x17112a[_0xdeb8('0x38')]=_[_0xdeb8('0x39')](_0x17112a[_0xdeb8('0x3a')],_0x17112a[_0xdeb8('0x37')]);_0x410cd7['attributes']=_[_0xdeb8('0x39')](_0x17112a['model'],qs[_0xdeb8('0x3c')](_0x4dde62[_0xdeb8('0x37')]['fields']));_0x410cd7[_0xdeb8('0x3b')]=_0x410cd7[_0xdeb8('0x3b')][_0xdeb8('0x3d')]?_0x410cd7['attributes']:_0x17112a['model'];if(_0x4dde62[_0xdeb8('0x37')][_0xdeb8('0x44')]){_0x410cd7[_0xdeb8('0x45')]=[{'all':!![]}];}_0x410cd7=_[_0xdeb8('0x2d')]({},_0x410cd7,_0x4dde62['options']);return db['ChatQueueReport'][_0xdeb8('0x4a')](_0x410cd7)['then'](handleEntityNotFound(_0x584ddb,null))[_0xdeb8('0x27')](respondWithResult(_0x584ddb,null))['catch'](handleError(_0x584ddb,null));};exports['create']=function(_0xe18b5c,_0x3c5e2a){return db[_0xdeb8('0x32')][_0xdeb8('0x4b')](_0xe18b5c[_0xdeb8('0x4c')],{})[_0xdeb8('0x27')](respondWithResult(_0x3c5e2a,0xc9))['catch'](handleError(_0x3c5e2a,null));};exports[_0xdeb8('0x26')]=function(_0x159d4a,_0x38cd79){if(_0x159d4a['body']['id']){delete _0x159d4a['body']['id'];}return db[_0xdeb8('0x32')][_0xdeb8('0x4a')]({'where':{'id':_0x159d4a[_0xdeb8('0x49')]['id']}})['then'](handleEntityNotFound(_0x38cd79,null))[_0xdeb8('0x27')](saveUpdates(_0x159d4a['body'],null))['then'](respondWithResult(_0x38cd79,null))[_0xdeb8('0x47')](handleError(_0x38cd79,null));};exports[_0xdeb8('0x28')]=function(_0x34b7e2,_0x37c4d9){return db['ChatQueueReport']['find']({'where':{'id':_0x34b7e2[_0xdeb8('0x49')]['id']}})[_0xdeb8('0x27')](handleEntityNotFound(_0x37c4d9,null))['then'](removeEntity(_0x37c4d9,null))[_0xdeb8('0x47')](handleError(_0x37c4d9,null));};exports[_0xdeb8('0x4d')]=function(_0x1571cb,_0x407c14){return db['ChatQueueReport'][_0xdeb8('0x4d')]()['then'](respondWithResult(_0x407c14,null))[_0xdeb8('0x47')](handleError(_0x407c14,null));};
\ No newline at end of file
+var _0xb9c9=['mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','apply','reject','update','then','destroy','error','stack','name','send','merge','body','contact','agent','interaction','account','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','VIRTUAL','options','include','rows','params','keys','includeAll','find','catch','create','describe','eml-format','fast-json-patch','bluebird'];(function(_0x5f3f78,_0x214d16){var _0x9a71c0=function(_0xdd06c3){while(--_0xdd06c3){_0x5f3f78['push'](_0x5f3f78['shift']());}};_0x9a71c0(++_0x214d16);}(_0xb9c9,0x95));var _0x9b9c=function(_0x276b5e,_0x45a3d3){_0x276b5e=_0x276b5e-0x0;var _0x4aa2a1=_0xb9c9[_0x276b5e];return _0x4aa2a1;};'use strict';var emlformat=require(_0x9b9c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9b9c('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9b9c('0x2'));var Mustache=require(_0x9b9c('0x3'));var util=require(_0x9b9c('0x4'));var path=require(_0x9b9c('0x5'));var sox=require(_0x9b9c('0x6'));var csv=require(_0x9b9c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9b9c('0x8'));var _=require(_0x9b9c('0x9'));var squel=require(_0x9b9c('0xa'));var crypto=require(_0x9b9c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9b9c('0xc'));var Papa=require(_0x9b9c('0xd'));var Redis=require(_0x9b9c('0xe'));var authService=require(_0x9b9c('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b9c('0x10'));var logger=require('../../config/logger')(_0x9b9c('0x11'));var utils=require(_0x9b9c('0x12'));var config=require(_0x9b9c('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9b9c('0x14'))['db'];function respondWithStatusCode(_0x43164e,_0x3647f9){_0x3647f9=_0x3647f9||0xcc;return function(_0x24ae2f){if(_0x24ae2f){return _0x43164e[_0x9b9c('0x15')](_0x3647f9);}return _0x43164e[_0x9b9c('0x16')](_0x3647f9)[_0x9b9c('0x17')]();};}function respondWithResult(_0x1e9bcf,_0x3f6efb){_0x3f6efb=_0x3f6efb||0xc8;return function(_0x566d30){if(_0x566d30){return _0x1e9bcf['status'](_0x3f6efb)[_0x9b9c('0x18')](_0x566d30);}};}function respondWithFilteredResult(_0x3df1eb,_0x440573){return function(_0x58cb49){if(_0x58cb49){var _0x58ea24=typeof _0x440573['offset']===_0x9b9c('0x19')&&typeof _0x440573[_0x9b9c('0x1a')]===_0x9b9c('0x19');var _0x12e57f=_0x58cb49[_0x9b9c('0x1b')];var _0x519644=_0x58ea24?0x0:_0x440573['offset'];var _0x60dd08=_0x58ea24?_0x58cb49[_0x9b9c('0x1b')]:_0x440573['offset']+_0x440573[_0x9b9c('0x1a')];var _0x5d34dd;if(_0x60dd08>=_0x12e57f){_0x60dd08=_0x12e57f;_0x5d34dd=0xc8;}else{_0x5d34dd=0xce;}_0x3df1eb[_0x9b9c('0x16')](_0x5d34dd);return _0x3df1eb['set']('Content-Range',_0x519644+'-'+_0x60dd08+'/'+_0x12e57f)['json'](_0x58cb49);}return null;};}function patchUpdates(_0xdccd24){return function(_0x3f163a){try{jsonpatch[_0x9b9c('0x1c')](_0x3f163a,_0xdccd24,!![]);}catch(_0x29639e){return BPromise[_0x9b9c('0x1d')](_0x29639e);}return _0x3f163a['save']();};}function saveUpdates(_0x261f0d,_0x41645a){return function(_0x31f36c){if(_0x31f36c){return _0x31f36c[_0x9b9c('0x1e')](_0x261f0d)[_0x9b9c('0x1f')](function(_0x16737d){return _0x16737d;});}return null;};}function removeEntity(_0x27e484,_0x23e89f){return function(_0x1b89ff){if(_0x1b89ff){return _0x1b89ff[_0x9b9c('0x20')]()['then'](function(){_0x27e484[_0x9b9c('0x16')](0xcc)[_0x9b9c('0x17')]();});}};}function handleEntityNotFound(_0x487731,_0x3a5fc4){return function(_0x3cbafa){if(!_0x3cbafa){_0x487731['sendStatus'](0x194);}return _0x3cbafa;};}function handleError(_0x38fcd9,_0x50b33e){_0x50b33e=_0x50b33e||0x1f4;return function(_0x322b4c){logger[_0x9b9c('0x21')](_0x322b4c[_0x9b9c('0x22')]);if(_0x322b4c[_0x9b9c('0x23')]){delete _0x322b4c['name'];}_0x38fcd9[_0x9b9c('0x16')](_0x50b33e)[_0x9b9c('0x24')](_0x322b4c);};}function getMustacheRender(_0x3e21e9,_0x393f49){return Mustache['render'](_0x3e21e9,_[_0x9b9c('0x25')](_0x393f49[_0x9b9c('0x26')],{'contact':_0x393f49[_0x9b9c('0x27')],'message':_0x393f49['message'],'agent':_0x393f49[_0x9b9c('0x28')],'interaction':_0x393f49[_0x9b9c('0x29')],'account':_0x393f49[_0x9b9c('0x2a')]}))||'';}exports[_0x9b9c('0x2b')]=function(_0x35f5f4,_0x235272){var _0x38d46b={},_0x8b96c4={},_0x2dfde9={'count':0x0,'rows':[]};var _0xe7ef0c=_[_0x9b9c('0x2c')](db[_0x9b9c('0x2d')][_0x9b9c('0x2e')],function(_0x108e9e){return{'name':_0x108e9e[_0x9b9c('0x2f')],'type':_0x108e9e[_0x9b9c('0x30')][_0x9b9c('0x31')]};});_0x8b96c4[_0x9b9c('0x32')]=_[_0x9b9c('0x2c')](_0xe7ef0c,_0x9b9c('0x23'));_0x8b96c4[_0x9b9c('0x33')]=_['keys'](_0x35f5f4[_0x9b9c('0x33')]);_0x8b96c4[_0x9b9c('0x34')]=_['intersection'](_0x8b96c4[_0x9b9c('0x32')],_0x8b96c4[_0x9b9c('0x33')]);_0x38d46b[_0x9b9c('0x35')]=_[_0x9b9c('0x36')](_0x8b96c4[_0x9b9c('0x32')],qs[_0x9b9c('0x37')](_0x35f5f4[_0x9b9c('0x33')][_0x9b9c('0x37')]));_0x38d46b[_0x9b9c('0x35')]=_0x38d46b[_0x9b9c('0x35')][_0x9b9c('0x38')]?_0x38d46b['attributes']:_0x8b96c4['model'];if(!_0x35f5f4[_0x9b9c('0x33')][_0x9b9c('0x39')](_0x9b9c('0x3a'))){_0x38d46b['limit']=qs[_0x9b9c('0x1a')](_0x35f5f4[_0x9b9c('0x33')][_0x9b9c('0x1a')]);_0x38d46b[_0x9b9c('0x3b')]=qs['offset'](_0x35f5f4['query'][_0x9b9c('0x3b')]);}_0x38d46b[_0x9b9c('0x3c')]=qs[_0x9b9c('0x3d')](_0x35f5f4[_0x9b9c('0x33')][_0x9b9c('0x3d')]);_0x38d46b[_0x9b9c('0x3e')]=qs[_0x9b9c('0x34')](_[_0x9b9c('0x3f')](_0x35f5f4[_0x9b9c('0x33')],_0x8b96c4[_0x9b9c('0x34')]),_0xe7ef0c);if(_0x35f5f4[_0x9b9c('0x33')][_0x9b9c('0x40')]){_0x38d46b[_0x9b9c('0x3e')]=_[_0x9b9c('0x25')](_0x38d46b[_0x9b9c('0x3e')],{'$or':_[_0x9b9c('0x2c')](_0xe7ef0c,function(_0x430524){if(_0x430524[_0x9b9c('0x30')]!==_0x9b9c('0x41')){var _0x13f46f={};_0x13f46f[_0x430524[_0x9b9c('0x23')]]={'$like':'%'+_0x35f5f4[_0x9b9c('0x33')][_0x9b9c('0x40')]+'%'};return _0x13f46f;}})});}_0x38d46b=_[_0x9b9c('0x25')]({},_0x38d46b,_0x35f5f4[_0x9b9c('0x42')]);var _0x1b461e={'where':_0x38d46b[_0x9b9c('0x3e')]};return db['ChatQueueReport']['count'](_0x1b461e)[_0x9b9c('0x1f')](function(_0x3254d8){_0x2dfde9['count']=_0x3254d8;if(_0x35f5f4['query']['includeAll']){_0x38d46b[_0x9b9c('0x43')]=[{'all':!![]}];}return db[_0x9b9c('0x2d')]['findAll'](_0x38d46b);})[_0x9b9c('0x1f')](function(_0x49d16c){_0x2dfde9[_0x9b9c('0x44')]=_0x49d16c;return _0x2dfde9;})[_0x9b9c('0x1f')](respondWithFilteredResult(_0x235272,_0x38d46b))['catch'](handleError(_0x235272,null));};exports['show']=function(_0x1ddf5a,_0x515b99){var _0x506f8a={'raw':!![],'where':{'id':_0x1ddf5a[_0x9b9c('0x45')]['id']}},_0x3ed4a1={};_0x3ed4a1[_0x9b9c('0x32')]=_[_0x9b9c('0x46')](db[_0x9b9c('0x2d')][_0x9b9c('0x2e')]);_0x3ed4a1[_0x9b9c('0x33')]=_[_0x9b9c('0x46')](_0x1ddf5a[_0x9b9c('0x33')]);_0x3ed4a1[_0x9b9c('0x34')]=_[_0x9b9c('0x36')](_0x3ed4a1['model'],_0x3ed4a1['query']);_0x506f8a[_0x9b9c('0x35')]=_[_0x9b9c('0x36')](_0x3ed4a1[_0x9b9c('0x32')],qs[_0x9b9c('0x37')](_0x1ddf5a[_0x9b9c('0x33')][_0x9b9c('0x37')]));_0x506f8a['attributes']=_0x506f8a[_0x9b9c('0x35')][_0x9b9c('0x38')]?_0x506f8a[_0x9b9c('0x35')]:_0x3ed4a1[_0x9b9c('0x32')];if(_0x1ddf5a['query'][_0x9b9c('0x47')]){_0x506f8a[_0x9b9c('0x43')]=[{'all':!![]}];}_0x506f8a=_['merge']({},_0x506f8a,_0x1ddf5a[_0x9b9c('0x42')]);return db['ChatQueueReport'][_0x9b9c('0x48')](_0x506f8a)[_0x9b9c('0x1f')](handleEntityNotFound(_0x515b99,null))[_0x9b9c('0x1f')](respondWithResult(_0x515b99,null))[_0x9b9c('0x49')](handleError(_0x515b99,null));};exports[_0x9b9c('0x4a')]=function(_0x193260,_0x32f599){return db['ChatQueueReport'][_0x9b9c('0x4a')](_0x193260[_0x9b9c('0x26')],{})['then'](respondWithResult(_0x32f599,0xc9))['catch'](handleError(_0x32f599,null));};exports[_0x9b9c('0x1e')]=function(_0x1a214d,_0x2c880b){if(_0x1a214d[_0x9b9c('0x26')]['id']){delete _0x1a214d[_0x9b9c('0x26')]['id'];}return db[_0x9b9c('0x2d')][_0x9b9c('0x48')]({'where':{'id':_0x1a214d['params']['id']}})[_0x9b9c('0x1f')](handleEntityNotFound(_0x2c880b,null))[_0x9b9c('0x1f')](saveUpdates(_0x1a214d[_0x9b9c('0x26')],null))[_0x9b9c('0x1f')](respondWithResult(_0x2c880b,null))['catch'](handleError(_0x2c880b,null));};exports['destroy']=function(_0x2da7cc,_0x5df295){return db[_0x9b9c('0x2d')][_0x9b9c('0x48')]({'where':{'id':_0x2da7cc['params']['id']}})[_0x9b9c('0x1f')](handleEntityNotFound(_0x5df295,null))['then'](removeEntity(_0x5df295,null))[_0x9b9c('0x49')](handleError(_0x5df295,null));};exports[_0x9b9c('0x4b')]=function(_0x2b6f79,_0x27bfb6){return db[_0x9b9c('0x2d')][_0x9b9c('0x4b')]()[_0x9b9c('0x1f')](respondWithResult(_0x27bfb6,null))[_0x9b9c('0x49')](handleError(_0x27bfb6,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 794df13..0715184 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 _0x5942=['exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x46e3af,_0x5bc4b7){var _0x2b002f=function(_0x107230){while(--_0x107230){_0x46e3af['push'](_0x46e3af['shift']());}};_0x2b002f(++_0x5bc4b7);}(_0x5942,0x19d));var _0x2594=function(_0x4bbec7,_0x25ecbc){_0x4bbec7=_0x4bbec7-0x0;var _0x4c52d1=_0x5942[_0x4bbec7];return _0x4c52d1;};'use strict';var _=require(_0x2594('0x0'));var util=require('util');var logger=require(_0x2594('0x1'))(_0x2594('0x2'));var moment=require('moment');var BPromise=require(_0x2594('0x3'));var rp=require(_0x2594('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2594('0x5'));var config=require(_0x2594('0x6'));var attributes=require('./chatQueueReport.attributes');module[_0x2594('0x7')]=function(_0x3f4555,_0x5be5cb){return _0x3f4555[_0x2594('0x8')](_0x2594('0x9'),attributes,{'tableName':_0x2594('0xa'),'paranoid':![],'indexes':[{'name':_0x2594('0xb'),'fields':[_0x2594('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe4b5=['exports','ChatQueueReport','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes'];(function(_0x36f241,_0x5e5e56){var _0x2dcf34=function(_0x3fec0b){while(--_0x3fec0b){_0x36f241['push'](_0x36f241['shift']());}};_0x2dcf34(++_0x5e5e56);}(_0xe4b5,0x121));var _0x5e4b=function(_0x1583d4,_0x5112e4){_0x1583d4=_0x1583d4-0x0;var _0x54b097=_0xe4b5[_0x1583d4];return _0x54b097;};'use strict';var _=require(_0x5e4b('0x0'));var util=require(_0x5e4b('0x1'));var logger=require('../../config/logger')(_0x5e4b('0x2'));var moment=require(_0x5e4b('0x3'));var BPromise=require(_0x5e4b('0x4'));var rp=require(_0x5e4b('0x5'));var fs=require('fs');var path=require(_0x5e4b('0x6'));var rimraf=require(_0x5e4b('0x7'));var config=require(_0x5e4b('0x8'));var attributes=require(_0x5e4b('0x9'));module[_0x5e4b('0xa')]=function(_0x361b87,_0x1e49bb){return _0x361b87['define'](_0x5e4b('0xb'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x5e4b('0xc'),'fields':[_0x5e4b('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 940d3a7..39faaf5 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 _0xaa97=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','ChatQueueReport','create','body','options','raw','debug','CreateChatQueueReport','where','attributes','UpdateChatQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x4c245f,_0x2bb619){var _0x4a2b5a=function(_0x5b1279){while(--_0x5b1279){_0x4c245f['push'](_0x4c245f['shift']());}};_0x4a2b5a(++_0x2bb619);}(_0xaa97,0x126));var _0x7aa9=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xaa97[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x7aa9('0x0'));var util=require('util');var moment=require(_0x7aa9('0x1'));var BPromise=require(_0x7aa9('0x2'));var rs=require(_0x7aa9('0x3'));var fs=require('fs');var Redis=require(_0x7aa9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7aa9('0x5'));var logger=require(_0x7aa9('0x6'))(_0x7aa9('0x7'));var config=require(_0x7aa9('0x8'));var jayson=require(_0x7aa9('0x9'));var client=jayson[_0x7aa9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x281490,_0x5683ce,_0x22e8a8){return new BPromise(function(_0x25ab84,_0x459710){return client[_0x7aa9('0xb')](_0x281490,_0x22e8a8)[_0x7aa9('0xc')](function(_0x39043b){logger[_0x7aa9('0xd')](_0x7aa9('0xe'),_0x5683ce,_0x7aa9('0xf'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x5683ce,'request\x20sent',JSON[_0x7aa9('0x10')](_0x39043b));if(_0x39043b[_0x7aa9('0x11')]){if(_0x39043b[_0x7aa9('0x11')]['code']===0x1f4){logger[_0x7aa9('0x11')](_0x7aa9('0xe'),_0x5683ce,_0x39043b[_0x7aa9('0x11')]['message']);return _0x459710(_0x39043b[_0x7aa9('0x11')][_0x7aa9('0x12')]);}logger[_0x7aa9('0x11')](_0x7aa9('0xe'),_0x5683ce,_0x39043b[_0x7aa9('0x11')]['message']);return _0x25ab84(_0x39043b[_0x7aa9('0x11')][_0x7aa9('0x12')]);}else{logger[_0x7aa9('0xd')](_0x7aa9('0xe'),_0x5683ce,_0x7aa9('0xf'));_0x25ab84(_0x39043b['result'][_0x7aa9('0x12')]);}})[_0x7aa9('0x13')](function(_0x1e4066){logger[_0x7aa9('0x11')](_0x7aa9('0xe'),_0x5683ce,_0x1e4066);_0x459710(_0x1e4066);});});}exports['CreateChatQueueReport']=function(_0x223773){var _0xcce176=this;return new Promise(function(_0x32c288,_0x7bc9cf){return db[_0x7aa9('0x14')][_0x7aa9('0x15')](_0x223773[_0x7aa9('0x16')],{'raw':_0x223773['options']?_0x223773[_0x7aa9('0x17')][_0x7aa9('0x18')]===undefined?!![]:![]:!![]})[_0x7aa9('0xc')](function(_0x33fdd3){logger['info']('CreateChatQueueReport',_0x223773);logger[_0x7aa9('0x19')](_0x7aa9('0x1a'),_0x223773,JSON[_0x7aa9('0x10')](_0x33fdd3));_0x32c288(_0x33fdd3);})[_0x7aa9('0x13')](function(_0x14dbbe){logger[_0x7aa9('0x11')]('CreateChatQueueReport',_0x14dbbe[_0x7aa9('0x12')],_0x223773);_0x7bc9cf(_0xcce176[_0x7aa9('0x11')](0x1f4,_0x14dbbe['message']));});});};exports['UpdateChatQueueReport']=function(_0x1084e8){var _0x31e1c3=this;return new Promise(function(_0x6f6b5e,_0x2be032){return db[_0x7aa9('0x14')]['update'](_0x1084e8['body'],{'raw':_0x1084e8['options']?_0x1084e8['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1084e8[_0x7aa9('0x17')]?_0x1084e8['options'][_0x7aa9('0x1b')]||null:null,'attributes':_0x1084e8[_0x7aa9('0x17')]?_0x1084e8[_0x7aa9('0x17')][_0x7aa9('0x1c')]||null:null,'limit':_0x1084e8['options']?_0x1084e8['options']['limit']||null:null})[_0x7aa9('0xc')](function(_0x476325){logger[_0x7aa9('0xd')](_0x7aa9('0x1d'),_0x1084e8);logger[_0x7aa9('0x19')](_0x7aa9('0x1d'),_0x1084e8,JSON['stringify'](_0x476325));_0x6f6b5e(_0x476325);})[_0x7aa9('0x13')](function(_0x1b00fc){logger['error']('UpdateChatQueueReport',_0x1b00fc[_0x7aa9('0x12')],_0x1084e8);_0x2be032(_0x31e1c3[_0x7aa9('0x11')](0x1f4,_0x1b00fc[_0x7aa9('0x12')]));});});};
\ No newline at end of file
+var _0x8100=['CreateChatQueueReport','ChatQueueReport','create','body','options','raw','stringify','UpdateChatQueueReport','update','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','request','then','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch'];(function(_0xc5427d,_0x434d17){var _0x5184c1=function(_0x5c140f){while(--_0x5c140f){_0xc5427d['push'](_0xc5427d['shift']());}};_0x5184c1(++_0x434d17);}(_0x8100,0x19d));var _0x0810=function(_0x5119c4,_0x1b1dd7){_0x5119c4=_0x5119c4-0x0;var _0x3fc072=_0x8100[_0x5119c4];return _0x3fc072;};'use strict';var _=require(_0x0810('0x0'));var util=require('util');var moment=require(_0x0810('0x1'));var BPromise=require(_0x0810('0x2'));var rs=require(_0x0810('0x3'));var fs=require('fs');var Redis=require(_0x0810('0x4'));var db=require(_0x0810('0x5'))['db'];var utils=require(_0x0810('0x6'));var logger=require('../../config/logger')(_0x0810('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0810('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc3d55a,_0x1e9bd8,_0x13d2dd){return new BPromise(function(_0x3e95fb,_0x457ef0){return client[_0x0810('0x9')](_0xc3d55a,_0x13d2dd)[_0x0810('0xa')](function(_0x18b74d){logger[_0x0810('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x1e9bd8,_0x0810('0xc'));logger[_0x0810('0xd')](_0x0810('0xe'),_0x1e9bd8,'request\x20sent',JSON['stringify'](_0x18b74d));if(_0x18b74d[_0x0810('0xf')]){if(_0x18b74d[_0x0810('0xf')][_0x0810('0x10')]===0x1f4){logger[_0x0810('0xf')](_0x0810('0x11'),_0x1e9bd8,_0x18b74d[_0x0810('0xf')]['message']);return _0x457ef0(_0x18b74d[_0x0810('0xf')][_0x0810('0x12')]);}logger[_0x0810('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x1e9bd8,_0x18b74d['error'][_0x0810('0x12')]);return _0x3e95fb(_0x18b74d['error'][_0x0810('0x12')]);}else{logger[_0x0810('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x1e9bd8,_0x0810('0xc'));_0x3e95fb(_0x18b74d[_0x0810('0x13')][_0x0810('0x12')]);}})[_0x0810('0x14')](function(_0x1c2a11){logger[_0x0810('0xf')](_0x0810('0x11'),_0x1e9bd8,_0x1c2a11);_0x457ef0(_0x1c2a11);});});}exports[_0x0810('0x15')]=function(_0x5cf7f3){var _0x265ab1=this;return new Promise(function(_0x597194,_0x1adbc9){return db[_0x0810('0x16')][_0x0810('0x17')](_0x5cf7f3[_0x0810('0x18')],{'raw':_0x5cf7f3['options']?_0x5cf7f3[_0x0810('0x19')][_0x0810('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x5a37f7){logger[_0x0810('0xb')](_0x0810('0x15'),_0x5cf7f3);logger[_0x0810('0xd')](_0x0810('0x15'),_0x5cf7f3,JSON[_0x0810('0x1b')](_0x5a37f7));_0x597194(_0x5a37f7);})[_0x0810('0x14')](function(_0x5b7d21){logger['error']('CreateChatQueueReport',_0x5b7d21[_0x0810('0x12')],_0x5cf7f3);_0x1adbc9(_0x265ab1[_0x0810('0xf')](0x1f4,_0x5b7d21[_0x0810('0x12')]));});});};exports[_0x0810('0x1c')]=function(_0x34b156){var _0x10f81c=this;return new Promise(function(_0x326b3c,_0x23565a){return db[_0x0810('0x16')][_0x0810('0x1d')](_0x34b156[_0x0810('0x18')],{'raw':_0x34b156[_0x0810('0x19')]?_0x34b156[_0x0810('0x19')][_0x0810('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34b156[_0x0810('0x19')]?_0x34b156[_0x0810('0x19')][_0x0810('0x1e')]||null:null,'attributes':_0x34b156[_0x0810('0x19')]?_0x34b156[_0x0810('0x19')]['attributes']||null:null,'limit':_0x34b156[_0x0810('0x19')]?_0x34b156[_0x0810('0x19')]['limit']||null:null})[_0x0810('0xa')](function(_0x4922e4){logger[_0x0810('0xb')](_0x0810('0x1c'),_0x34b156);logger[_0x0810('0xd')](_0x0810('0x1c'),_0x34b156,JSON['stringify'](_0x4922e4));_0x326b3c(_0x4922e4);})[_0x0810('0x14')](function(_0x1cf632){logger[_0x0810('0xf')](_0x0810('0x1c'),_0x1cf632['message'],_0x34b156);_0x23565a(_0x10f81c['error'](0x1f4,_0x1cf632[_0x0810('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 5e94a89..aed5c93 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 _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','post','put','update','delete','/:id'];(function(_0x2d82d4,_0x2338ae){var _0x9fb857=function(_0x31b0b2){while(--_0x31b0b2){_0x2d82d4['push'](_0x2d82d4['shift']());}};_0x9fb857(++_0x2338ae);}(_0x7a54,0x106));var _0x47a5=function(_0x39dd6e,_0x380a53){_0x39dd6e=_0x39dd6e-0x0;var _0x160178=_0x7a54[_0x39dd6e];return _0x160178;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0x11'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);module[_0x47a5('0x13')]=router;
\ No newline at end of file
+var _0x2ef3=['express','Router','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','update','delete','exports','multer','util','path','connect-timeout'];(function(_0xbb8432,_0x3b9a00){var _0x5a1594=function(_0x3c9097){while(--_0x3c9097){_0xbb8432['push'](_0xbb8432['shift']());}};_0x5a1594(++_0x3b9a00);}(_0x2ef3,0xba));var _0x32ef=function(_0x24e17e,_0x22109a){_0x24e17e=_0x24e17e-0x0;var _0x136b32=_0x2ef3[_0x24e17e];return _0x136b32;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0xf')]('/',auth[_0x32ef('0xb')](),controller['create']);router['put'](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x10')]);router[_0x32ef('0x11')]('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 0bd5dc2..cd79a79 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 _0x8471=['sequelize','exports','ENUM','queue'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x8471,0x160));var _0x1847=function(_0x14a921,_0x5db732){_0x14a921=_0x14a921-0x0;var _0x17272b=_0x8471[_0x14a921];return _0x17272b;};'use strict';var moment=require('moment');var Sequelize=require(_0x1847('0x0'));module[_0x1847('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x1847('0x2')]('account','agent','queue'),'allowNull':![],'defaultValue':_0x1847('0x3')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0x4435=['ENUM','account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x5b8bec,_0x127b5f){var _0x98a1c6=function(_0x42a2bc){while(--_0x42a2bc){_0x5b8bec['push'](_0x5b8bec['shift']());}};_0x98a1c6(++_0x127b5f);}(_0x4435,0x11e));var _0x5443=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x4435[_0x11ce46];return _0x368a1e;};'use strict';var moment=require(_0x5443('0x0'));var Sequelize=require(_0x5443('0x1'));module[_0x5443('0x2')]={'uniqueid':{'type':Sequelize[_0x5443('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x5443('0x4')](_0x5443('0x5'),_0x5443('0x6'),_0x5443('0x7')),'allowNull':![],'defaultValue':_0x5443('0x7')},'transferredAt':{'type':Sequelize[_0x5443('0x8')],'allowNull':![],'defaultValue':Sequelize[_0x5443('0x9')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 9bf22c2..7a0a2aa 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 _0xfe41=['body','contact','agent','interaction','account','index','rawAttributes','fieldName','type','map','query','keys','model','attributes','intersection','fields','length','nolimit','order','where','filters','pick','VIRTUAL','filter','ChatTransferReport','include','findAll','rows','catch','show','params','includeAll','create','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','render','merge'];(function(_0x3dbd50,_0x99ad82){var _0x1c1da0=function(_0x19a0bb){while(--_0x19a0bb){_0x3dbd50['push'](_0x3dbd50['shift']());}};_0x1c1da0(++_0x99ad82);}(_0xfe41,0x10a));var _0x1fe4=function(_0x49b14d,_0x578d07){_0x49b14d=_0x49b14d-0x0;var _0x3d2488=_0xfe41[_0x49b14d];return _0x3d2488;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1fe4('0x0'));var zipdir=require(_0x1fe4('0x1'));var jsonpatch=require(_0x1fe4('0x2'));var rp=require(_0x1fe4('0x3'));var moment=require(_0x1fe4('0x4'));var BPromise=require(_0x1fe4('0x5'));var Mustache=require(_0x1fe4('0x6'));var util=require(_0x1fe4('0x7'));var path=require('path');var sox=require(_0x1fe4('0x8'));var csv=require(_0x1fe4('0x9'));var ejs=require(_0x1fe4('0xa'));var fs=require('fs');var fs_extra=require(_0x1fe4('0xb'));var _=require(_0x1fe4('0xc'));var squel=require(_0x1fe4('0xd'));var crypto=require(_0x1fe4('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1fe4('0xf'));var toCsv=require(_0x1fe4('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1fe4('0x10'));var authService=require(_0x1fe4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1fe4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1fe4('0x13'))(_0x1fe4('0x14'));var utils=require('../../config/utils');var config=require(_0x1fe4('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1fe4('0x16'))['db'];function respondWithStatusCode(_0x4414a2,_0x4e108c){_0x4e108c=_0x4e108c||0xcc;return function(_0x504263){if(_0x504263){return _0x4414a2['sendStatus'](_0x4e108c);}return _0x4414a2['status'](_0x4e108c)[_0x1fe4('0x17')]();};}function respondWithResult(_0x28f810,_0x26cab9){_0x26cab9=_0x26cab9||0xc8;return function(_0x462372){if(_0x462372){return _0x28f810[_0x1fe4('0x18')](_0x26cab9)[_0x1fe4('0x19')](_0x462372);}};}function respondWithFilteredResult(_0xedd23c,_0x3ece07){return function(_0x1484f3){if(_0x1484f3){var _0x57a8ea=typeof _0x3ece07[_0x1fe4('0x1a')]===_0x1fe4('0x1b')&&typeof _0x3ece07[_0x1fe4('0x1c')]===_0x1fe4('0x1b');var _0xa38ea3=_0x1484f3[_0x1fe4('0x1d')];var _0x20052a=_0x57a8ea?0x0:_0x3ece07[_0x1fe4('0x1a')];var _0x47f9ba=_0x57a8ea?_0x1484f3[_0x1fe4('0x1d')]:_0x3ece07[_0x1fe4('0x1a')]+_0x3ece07[_0x1fe4('0x1c')];var _0x4ba9ec;if(_0x47f9ba>=_0xa38ea3){_0x47f9ba=_0xa38ea3;_0x4ba9ec=0xc8;}else{_0x4ba9ec=0xce;}_0xedd23c[_0x1fe4('0x18')](_0x4ba9ec);return _0xedd23c['set'](_0x1fe4('0x1e'),_0x20052a+'-'+_0x47f9ba+'/'+_0xa38ea3)[_0x1fe4('0x19')](_0x1484f3);}return null;};}function patchUpdates(_0x4c590a){return function(_0xb41c98){try{jsonpatch[_0x1fe4('0x1f')](_0xb41c98,_0x4c590a,!![]);}catch(_0x1bfd8c){return BPromise[_0x1fe4('0x20')](_0x1bfd8c);}return _0xb41c98['save']();};}function saveUpdates(_0x240155,_0x41360c){return function(_0x9410fc){if(_0x9410fc){return _0x9410fc[_0x1fe4('0x21')](_0x240155)[_0x1fe4('0x22')](function(_0x472b5a){return _0x472b5a;});}return null;};}function removeEntity(_0x362284,_0x1c07f7){return function(_0x17ea79){if(_0x17ea79){return _0x17ea79[_0x1fe4('0x23')]()[_0x1fe4('0x22')](function(){_0x362284[_0x1fe4('0x18')](0xcc)[_0x1fe4('0x17')]();});}};}function handleEntityNotFound(_0x2966f6,_0x48b8cc){return function(_0x14bb41){if(!_0x14bb41){_0x2966f6['sendStatus'](0x194);}return _0x14bb41;};}function handleError(_0xefb67a,_0x595585){_0x595585=_0x595585||0x1f4;return function(_0x5d93eb){logger[_0x1fe4('0x24')](_0x5d93eb[_0x1fe4('0x25')]);if(_0x5d93eb[_0x1fe4('0x26')]){delete _0x5d93eb['name'];}_0xefb67a['status'](_0x595585)[_0x1fe4('0x27')](_0x5d93eb);};}function getMustacheRender(_0x51204f,_0x5a5ac6){return Mustache[_0x1fe4('0x28')](_0x51204f,_[_0x1fe4('0x29')](_0x5a5ac6[_0x1fe4('0x2a')],{'contact':_0x5a5ac6[_0x1fe4('0x2b')],'message':_0x5a5ac6['message'],'agent':_0x5a5ac6[_0x1fe4('0x2c')],'interaction':_0x5a5ac6[_0x1fe4('0x2d')],'account':_0x5a5ac6[_0x1fe4('0x2e')]}))||'';}exports[_0x1fe4('0x2f')]=function(_0x4f1579,_0xcd5a31){var _0x45d42b={},_0x4170ff={},_0x403b12={'count':0x0,'rows':[]};var _0x476c1f=_['map'](db['ChatTransferReport'][_0x1fe4('0x30')],function(_0x322b83){return{'name':_0x322b83[_0x1fe4('0x31')],'type':_0x322b83[_0x1fe4('0x32')]['key']};});_0x4170ff['model']=_[_0x1fe4('0x33')](_0x476c1f,_0x1fe4('0x26'));_0x4170ff[_0x1fe4('0x34')]=_[_0x1fe4('0x35')](_0x4f1579['query']);_0x4170ff['filters']=_['intersection'](_0x4170ff[_0x1fe4('0x36')],_0x4170ff[_0x1fe4('0x34')]);_0x45d42b[_0x1fe4('0x37')]=_[_0x1fe4('0x38')](_0x4170ff[_0x1fe4('0x36')],qs[_0x1fe4('0x39')](_0x4f1579[_0x1fe4('0x34')]['fields']));_0x45d42b[_0x1fe4('0x37')]=_0x45d42b[_0x1fe4('0x37')][_0x1fe4('0x3a')]?_0x45d42b[_0x1fe4('0x37')]:_0x4170ff[_0x1fe4('0x36')];if(!_0x4f1579[_0x1fe4('0x34')]['hasOwnProperty'](_0x1fe4('0x3b'))){_0x45d42b[_0x1fe4('0x1c')]=qs['limit'](_0x4f1579['query'][_0x1fe4('0x1c')]);_0x45d42b[_0x1fe4('0x1a')]=qs[_0x1fe4('0x1a')](_0x4f1579[_0x1fe4('0x34')][_0x1fe4('0x1a')]);}_0x45d42b[_0x1fe4('0x3c')]=qs['sort'](_0x4f1579[_0x1fe4('0x34')]['sort']);_0x45d42b[_0x1fe4('0x3d')]=qs[_0x1fe4('0x3e')](_[_0x1fe4('0x3f')](_0x4f1579['query'],_0x4170ff[_0x1fe4('0x3e')]),_0x476c1f);if(_0x4f1579[_0x1fe4('0x34')]['filter']){_0x45d42b[_0x1fe4('0x3d')]=_[_0x1fe4('0x29')](_0x45d42b[_0x1fe4('0x3d')],{'$or':_['map'](_0x476c1f,function(_0x11ed6f){if(_0x11ed6f[_0x1fe4('0x32')]!==_0x1fe4('0x40')){var _0x2c948e={};_0x2c948e[_0x11ed6f[_0x1fe4('0x26')]]={'$like':'%'+_0x4f1579[_0x1fe4('0x34')][_0x1fe4('0x41')]+'%'};return _0x2c948e;}})});}_0x45d42b=_[_0x1fe4('0x29')]({},_0x45d42b,_0x4f1579['options']);var _0x1429be={'where':_0x45d42b[_0x1fe4('0x3d')]};return db[_0x1fe4('0x42')][_0x1fe4('0x1d')](_0x1429be)[_0x1fe4('0x22')](function(_0x2f13d4){_0x403b12[_0x1fe4('0x1d')]=_0x2f13d4;if(_0x4f1579[_0x1fe4('0x34')]['includeAll']){_0x45d42b[_0x1fe4('0x43')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x1fe4('0x44')](_0x45d42b);})[_0x1fe4('0x22')](function(_0x5cf77c){_0x403b12[_0x1fe4('0x45')]=_0x5cf77c;return _0x403b12;})[_0x1fe4('0x22')](respondWithFilteredResult(_0xcd5a31,_0x45d42b))[_0x1fe4('0x46')](handleError(_0xcd5a31,null));};exports[_0x1fe4('0x47')]=function(_0x42c57d,_0x1e5610){var _0x327e6c={'raw':!![],'where':{'id':_0x42c57d[_0x1fe4('0x48')]['id']}},_0x528d92={};_0x528d92[_0x1fe4('0x36')]=_['keys'](db['ChatTransferReport']['rawAttributes']);_0x528d92[_0x1fe4('0x34')]=_[_0x1fe4('0x35')](_0x42c57d['query']);_0x528d92[_0x1fe4('0x3e')]=_['intersection'](_0x528d92[_0x1fe4('0x36')],_0x528d92['query']);_0x327e6c[_0x1fe4('0x37')]=_[_0x1fe4('0x38')](_0x528d92[_0x1fe4('0x36')],qs[_0x1fe4('0x39')](_0x42c57d[_0x1fe4('0x34')]['fields']));_0x327e6c[_0x1fe4('0x37')]=_0x327e6c[_0x1fe4('0x37')][_0x1fe4('0x3a')]?_0x327e6c[_0x1fe4('0x37')]:_0x528d92['model'];if(_0x42c57d[_0x1fe4('0x34')][_0x1fe4('0x49')]){_0x327e6c[_0x1fe4('0x43')]=[{'all':!![]}];}_0x327e6c=_[_0x1fe4('0x29')]({},_0x327e6c,_0x42c57d['options']);return db[_0x1fe4('0x42')]['find'](_0x327e6c)['then'](handleEntityNotFound(_0x1e5610,null))[_0x1fe4('0x22')](respondWithResult(_0x1e5610,null))[_0x1fe4('0x46')](handleError(_0x1e5610,null));};exports['create']=function(_0x56616c,_0x438e33){return db[_0x1fe4('0x42')][_0x1fe4('0x4a')](_0x56616c[_0x1fe4('0x2a')],{})[_0x1fe4('0x22')](respondWithResult(_0x438e33,0xc9))[_0x1fe4('0x46')](handleError(_0x438e33,null));};exports[_0x1fe4('0x21')]=function(_0x388d96,_0x29b54b){if(_0x388d96[_0x1fe4('0x2a')]['id']){delete _0x388d96[_0x1fe4('0x2a')]['id'];}return db[_0x1fe4('0x42')][_0x1fe4('0x4b')]({'where':{'id':_0x388d96[_0x1fe4('0x48')]['id']}})[_0x1fe4('0x22')](handleEntityNotFound(_0x29b54b,null))['then'](saveUpdates(_0x388d96[_0x1fe4('0x2a')],null))[_0x1fe4('0x22')](respondWithResult(_0x29b54b,null))[_0x1fe4('0x46')](handleError(_0x29b54b,null));};exports[_0x1fe4('0x23')]=function(_0x4d622c,_0x74615){return db[_0x1fe4('0x42')][_0x1fe4('0x4b')]({'where':{'id':_0x4d622c[_0x1fe4('0x48')]['id']}})[_0x1fe4('0x22')](handleEntityNotFound(_0x74615,null))['then'](removeEntity(_0x74615,null))[_0x1fe4('0x46')](handleError(_0x74615,null));};exports['describe']=function(_0x419088,_0x25195b){return db[_0x1fe4('0x42')][_0x1fe4('0x4c')]()['then'](respondWithResult(_0x25195b,null))[_0x1fe4('0x46')](handleError(_0x25195b,null));};
\ No newline at end of file
+var _0xb417=['lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','render','merge','body','contact','message','agent','interaction','account','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','ejs'];(function(_0x3e828b,_0x4d6449){var _0x21dfe2=function(_0x28d024){while(--_0x28d024){_0x3e828b['push'](_0x3e828b['shift']());}};_0x21dfe2(++_0x4d6449);}(_0xb417,0x9b));var _0x7b41=function(_0x460b11,_0x13637f){_0x460b11=_0x460b11-0x0;var _0x2562a8=_0xb417[_0x460b11];return _0x2562a8;};'use strict';var emlformat=require(_0x7b41('0x0'));var rimraf=require(_0x7b41('0x1'));var zipdir=require(_0x7b41('0x2'));var jsonpatch=require(_0x7b41('0x3'));var rp=require(_0x7b41('0x4'));var moment=require(_0x7b41('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7b41('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b41('0x7'));var squel=require(_0x7b41('0x8'));var crypto=require(_0x7b41('0x9'));var jsforce=require(_0x7b41('0xa'));var deskjs=require(_0x7b41('0xb'));var toCsv=require(_0x7b41('0xc'));var querystring=require(_0x7b41('0xd'));var Papa=require(_0x7b41('0xe'));var Redis=require(_0x7b41('0xf'));var authService=require(_0x7b41('0x10'));var qs=require(_0x7b41('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b41('0x12'));var logger=require(_0x7b41('0x13'))(_0x7b41('0x14'));var utils=require(_0x7b41('0x15'));var config=require(_0x7b41('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2326ee,_0x4f6438){_0x4f6438=_0x4f6438||0xcc;return function(_0x254628){if(_0x254628){return _0x2326ee[_0x7b41('0x17')](_0x4f6438);}return _0x2326ee['status'](_0x4f6438)[_0x7b41('0x18')]();};}function respondWithResult(_0xcc4470,_0x1b5e19){_0x1b5e19=_0x1b5e19||0xc8;return function(_0x378a02){if(_0x378a02){return _0xcc4470[_0x7b41('0x19')](_0x1b5e19)[_0x7b41('0x1a')](_0x378a02);}};}function respondWithFilteredResult(_0x2c2e40,_0x3b10fa){return function(_0x389a54){if(_0x389a54){var _0x1d3497=typeof _0x3b10fa[_0x7b41('0x1b')]===_0x7b41('0x1c')&&typeof _0x3b10fa[_0x7b41('0x1d')]===_0x7b41('0x1c');var _0x17b41f=_0x389a54[_0x7b41('0x1e')];var _0x1f2230=_0x1d3497?0x0:_0x3b10fa[_0x7b41('0x1b')];var _0x27afee=_0x1d3497?_0x389a54[_0x7b41('0x1e')]:_0x3b10fa[_0x7b41('0x1b')]+_0x3b10fa[_0x7b41('0x1d')];var _0x5bf03e;if(_0x27afee>=_0x17b41f){_0x27afee=_0x17b41f;_0x5bf03e=0xc8;}else{_0x5bf03e=0xce;}_0x2c2e40['status'](_0x5bf03e);return _0x2c2e40[_0x7b41('0x1f')]('Content-Range',_0x1f2230+'-'+_0x27afee+'/'+_0x17b41f)['json'](_0x389a54);}return null;};}function patchUpdates(_0x29370b){return function(_0x238dba){try{jsonpatch[_0x7b41('0x20')](_0x238dba,_0x29370b,!![]);}catch(_0x2b7caf){return BPromise[_0x7b41('0x21')](_0x2b7caf);}return _0x238dba[_0x7b41('0x22')]();};}function saveUpdates(_0x2bb73f,_0x2896c1){return function(_0x41ba3e){if(_0x41ba3e){return _0x41ba3e[_0x7b41('0x23')](_0x2bb73f)[_0x7b41('0x24')](function(_0xe4da44){return _0xe4da44;});}return null;};}function removeEntity(_0x1f967a,_0x43b4cc){return function(_0xb90a14){if(_0xb90a14){return _0xb90a14[_0x7b41('0x25')]()[_0x7b41('0x24')](function(){_0x1f967a['status'](0xcc)[_0x7b41('0x18')]();});}};}function handleEntityNotFound(_0x2ecc14,_0x4d9396){return function(_0xc8e5c7){if(!_0xc8e5c7){_0x2ecc14[_0x7b41('0x17')](0x194);}return _0xc8e5c7;};}function handleError(_0x8e6c24,_0x401144){_0x401144=_0x401144||0x1f4;return function(_0x3bf8fb){logger[_0x7b41('0x26')](_0x3bf8fb[_0x7b41('0x27')]);if(_0x3bf8fb['name']){delete _0x3bf8fb[_0x7b41('0x28')];}_0x8e6c24[_0x7b41('0x19')](_0x401144)[_0x7b41('0x29')](_0x3bf8fb);};}function getMustacheRender(_0x5a2d7f,_0x2fb2c1){return Mustache[_0x7b41('0x2a')](_0x5a2d7f,_[_0x7b41('0x2b')](_0x2fb2c1[_0x7b41('0x2c')],{'contact':_0x2fb2c1[_0x7b41('0x2d')],'message':_0x2fb2c1[_0x7b41('0x2e')],'agent':_0x2fb2c1[_0x7b41('0x2f')],'interaction':_0x2fb2c1[_0x7b41('0x30')],'account':_0x2fb2c1[_0x7b41('0x31')]}))||'';}exports['index']=function(_0x5a2331,_0x3369b6){var _0x1135be={},_0x33c3e5={},_0x1aa751={'count':0x0,'rows':[]};var _0x19a293=_[_0x7b41('0x32')](db[_0x7b41('0x33')][_0x7b41('0x34')],function(_0x135b9e){return{'name':_0x135b9e[_0x7b41('0x35')],'type':_0x135b9e[_0x7b41('0x36')][_0x7b41('0x37')]};});_0x33c3e5[_0x7b41('0x38')]=_[_0x7b41('0x32')](_0x19a293,_0x7b41('0x28'));_0x33c3e5['query']=_[_0x7b41('0x39')](_0x5a2331[_0x7b41('0x3a')]);_0x33c3e5[_0x7b41('0x3b')]=_['intersection'](_0x33c3e5[_0x7b41('0x38')],_0x33c3e5['query']);_0x1135be['attributes']=_[_0x7b41('0x3c')](_0x33c3e5['model'],qs[_0x7b41('0x3d')](_0x5a2331[_0x7b41('0x3a')][_0x7b41('0x3d')]));_0x1135be['attributes']=_0x1135be['attributes'][_0x7b41('0x3e')]?_0x1135be[_0x7b41('0x3f')]:_0x33c3e5[_0x7b41('0x38')];if(!_0x5a2331[_0x7b41('0x3a')][_0x7b41('0x40')]('nolimit')){_0x1135be['limit']=qs[_0x7b41('0x1d')](_0x5a2331[_0x7b41('0x3a')][_0x7b41('0x1d')]);_0x1135be['offset']=qs[_0x7b41('0x1b')](_0x5a2331[_0x7b41('0x3a')][_0x7b41('0x1b')]);}_0x1135be[_0x7b41('0x41')]=qs[_0x7b41('0x42')](_0x5a2331[_0x7b41('0x3a')][_0x7b41('0x42')]);_0x1135be[_0x7b41('0x43')]=qs['filters'](_[_0x7b41('0x44')](_0x5a2331[_0x7b41('0x3a')],_0x33c3e5[_0x7b41('0x3b')]),_0x19a293);if(_0x5a2331[_0x7b41('0x3a')][_0x7b41('0x45')]){_0x1135be[_0x7b41('0x43')]=_[_0x7b41('0x2b')](_0x1135be['where'],{'$or':_[_0x7b41('0x32')](_0x19a293,function(_0x364c34){if(_0x364c34['type']!==_0x7b41('0x46')){var _0xa11fc7={};_0xa11fc7[_0x364c34[_0x7b41('0x28')]]={'$like':'%'+_0x5a2331[_0x7b41('0x3a')][_0x7b41('0x45')]+'%'};return _0xa11fc7;}})});}_0x1135be=_[_0x7b41('0x2b')]({},_0x1135be,_0x5a2331[_0x7b41('0x47')]);var _0x222ce6={'where':_0x1135be['where']};return db['ChatTransferReport']['count'](_0x222ce6)[_0x7b41('0x24')](function(_0x4a5969){_0x1aa751['count']=_0x4a5969;if(_0x5a2331[_0x7b41('0x3a')]['includeAll']){_0x1135be[_0x7b41('0x48')]=[{'all':!![]}];}return db[_0x7b41('0x33')][_0x7b41('0x49')](_0x1135be);})['then'](function(_0x3caa71){_0x1aa751[_0x7b41('0x4a')]=_0x3caa71;return _0x1aa751;})['then'](respondWithFilteredResult(_0x3369b6,_0x1135be))[_0x7b41('0x4b')](handleError(_0x3369b6,null));};exports[_0x7b41('0x4c')]=function(_0x17d79c,_0xf98b3c){var _0x2a9a65={'raw':!![],'where':{'id':_0x17d79c[_0x7b41('0x4d')]['id']}},_0x4af61f={};_0x4af61f[_0x7b41('0x38')]=_[_0x7b41('0x39')](db[_0x7b41('0x33')][_0x7b41('0x34')]);_0x4af61f[_0x7b41('0x3a')]=_[_0x7b41('0x39')](_0x17d79c[_0x7b41('0x3a')]);_0x4af61f[_0x7b41('0x3b')]=_['intersection'](_0x4af61f[_0x7b41('0x38')],_0x4af61f['query']);_0x2a9a65['attributes']=_[_0x7b41('0x3c')](_0x4af61f[_0x7b41('0x38')],qs[_0x7b41('0x3d')](_0x17d79c[_0x7b41('0x3a')][_0x7b41('0x3d')]));_0x2a9a65[_0x7b41('0x3f')]=_0x2a9a65[_0x7b41('0x3f')][_0x7b41('0x3e')]?_0x2a9a65[_0x7b41('0x3f')]:_0x4af61f[_0x7b41('0x38')];if(_0x17d79c[_0x7b41('0x3a')]['includeAll']){_0x2a9a65[_0x7b41('0x48')]=[{'all':!![]}];}_0x2a9a65=_[_0x7b41('0x2b')]({},_0x2a9a65,_0x17d79c[_0x7b41('0x47')]);return db[_0x7b41('0x33')][_0x7b41('0x4e')](_0x2a9a65)['then'](handleEntityNotFound(_0xf98b3c,null))[_0x7b41('0x24')](respondWithResult(_0xf98b3c,null))['catch'](handleError(_0xf98b3c,null));};exports[_0x7b41('0x4f')]=function(_0x537d56,_0x4c5cfb){return db[_0x7b41('0x33')][_0x7b41('0x4f')](_0x537d56['body'],{})[_0x7b41('0x24')](respondWithResult(_0x4c5cfb,0xc9))['catch'](handleError(_0x4c5cfb,null));};exports[_0x7b41('0x23')]=function(_0x3347bd,_0x481806){if(_0x3347bd[_0x7b41('0x2c')]['id']){delete _0x3347bd[_0x7b41('0x2c')]['id'];}return db[_0x7b41('0x33')][_0x7b41('0x4e')]({'where':{'id':_0x3347bd['params']['id']}})[_0x7b41('0x24')](handleEntityNotFound(_0x481806,null))[_0x7b41('0x24')](saveUpdates(_0x3347bd['body'],null))[_0x7b41('0x24')](respondWithResult(_0x481806,null))[_0x7b41('0x4b')](handleError(_0x481806,null));};exports[_0x7b41('0x25')]=function(_0x17926e,_0x5afca5){return db[_0x7b41('0x33')]['find']({'where':{'id':_0x17926e[_0x7b41('0x4d')]['id']}})[_0x7b41('0x24')](handleEntityNotFound(_0x5afca5,null))[_0x7b41('0x24')](removeEntity(_0x5afca5,null))[_0x7b41('0x4b')](handleError(_0x5afca5,null));};exports[_0x7b41('0x50')]=function(_0x379c70,_0x11dc23){return db[_0x7b41('0x33')][_0x7b41('0x50')]()[_0x7b41('0x24')](respondWithResult(_0x11dc23,null))[_0x7b41('0x4b')](handleError(_0x11dc23,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 3da747c..def7c23 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 _0x9c39=['define','report_chat_transfer','uniqueid','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports'];(function(_0x4f3095,_0x44de67){var _0x3c3159=function(_0x25f827){while(--_0x25f827){_0x4f3095['push'](_0x4f3095['shift']());}};_0x3c3159(++_0x44de67);}(_0x9c39,0xe7));var _0x99c3=function(_0x307086,_0x3bfe4e){_0x307086=_0x307086-0x0;var _0x699043=_0x9c39[_0x307086];return _0x699043;};'use strict';var _=require(_0x99c3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x99c3('0x1'));var moment=require(_0x99c3('0x2'));var BPromise=require(_0x99c3('0x3'));var rp=require(_0x99c3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x99c3('0x5'));var config=require(_0x99c3('0x6'));var attributes=require(_0x99c3('0x7'));module[_0x99c3('0x8')]=function(_0x1ebab8,_0x271f22){return _0x1ebab8[_0x99c3('0x9')]('ChatTransferReport',attributes,{'tableName':_0x99c3('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x99c3('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x511e=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','ChatTransferReport','report_chat_transfer','uniqueid'];(function(_0x435b6b,_0x34e4d4){var _0x233d51=function(_0x2c3787){while(--_0x2c3787){_0x435b6b['push'](_0x435b6b['shift']());}};_0x233d51(++_0x34e4d4);}(_0x511e,0xea));var _0xe511=function(_0x4e8401,_0x51b328){_0x4e8401=_0x4e8401-0x0;var _0x17269f=_0x511e[_0x4e8401];return _0x17269f;};'use strict';var _=require(_0xe511('0x0'));var util=require(_0xe511('0x1'));var logger=require(_0xe511('0x2'))(_0xe511('0x3'));var moment=require(_0xe511('0x4'));var BPromise=require(_0xe511('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe511('0x6'));var rimraf=require(_0xe511('0x7'));var config=require(_0xe511('0x8'));var attributes=require('./chatTransferReport.attributes');module[_0xe511('0x9')]=function(_0x2214d7,_0x54d587){return _0x2214d7['define'](_0xe511('0xa'),attributes,{'tableName':_0xe511('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe511('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index b1db6e6..0632362 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 _0x76af=['ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info'];(function(_0x36285a,_0xce9b4f){var _0x15a48e=function(_0xccf8e1){while(--_0xccf8e1){_0x36285a['push'](_0x36285a['shift']());}};_0x15a48e(++_0xce9b4f);}(_0x76af,0xb1));var _0xf76a=function(_0xd2d54,_0x5329f7){_0xd2d54=_0xd2d54-0x0;var _0x78b113=_0x76af[_0xd2d54];return _0x78b113;};'use strict';var _=require(_0xf76a('0x0'));var util=require(_0xf76a('0x1'));var moment=require(_0xf76a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf76a('0x3'));var db=require(_0xf76a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf76a('0x5'))(_0xf76a('0x6'));var config=require(_0xf76a('0x7'));var jayson=require(_0xf76a('0x8'));var client=jayson['client'][_0xf76a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x196b3b,_0x41c55a,_0xe3f870){return new BPromise(function(_0x2eec67,_0x5d0cc2){return client[_0xf76a('0xa')](_0x196b3b,_0xe3f870)['then'](function(_0x487fb5){logger[_0xf76a('0xb')](_0xf76a('0xc'),_0x41c55a,'request\x20sent');logger[_0xf76a('0xd')](_0xf76a('0xe'),_0x41c55a,_0xf76a('0xf'),JSON['stringify'](_0x487fb5));if(_0x487fb5['error']){if(_0x487fb5[_0xf76a('0x10')][_0xf76a('0x11')]===0x1f4){logger[_0xf76a('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x41c55a,_0x487fb5[_0xf76a('0x10')][_0xf76a('0x12')]);return _0x5d0cc2(_0x487fb5[_0xf76a('0x10')][_0xf76a('0x12')]);}logger[_0xf76a('0x10')](_0xf76a('0xc'),_0x41c55a,_0x487fb5[_0xf76a('0x10')][_0xf76a('0x12')]);return _0x2eec67(_0x487fb5[_0xf76a('0x10')][_0xf76a('0x12')]);}else{logger['info'](_0xf76a('0xc'),_0x41c55a,_0xf76a('0xf'));_0x2eec67(_0x487fb5[_0xf76a('0x13')][_0xf76a('0x12')]);}})[_0xf76a('0x14')](function(_0x4797ea){logger[_0xf76a('0x10')](_0xf76a('0xc'),_0x41c55a,_0x4797ea);_0x5d0cc2(_0x4797ea);});});}
\ No newline at end of file
+var _0x0b9f=['error','code','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x56daff,_0xadca9a){var _0x132c82=function(_0x19e0d7){while(--_0x19e0d7){_0x56daff['push'](_0x56daff['shift']());}};_0x132c82(++_0xadca9a);}(_0x0b9f,0xa7));var _0xf0b9=function(_0x58e8dd,_0x1ef6ff){_0x58e8dd=_0x58e8dd-0x0;var _0x14989f=_0x0b9f[_0x58e8dd];return _0x14989f;};'use strict';var _=require(_0xf0b9('0x0'));var util=require(_0xf0b9('0x1'));var moment=require(_0xf0b9('0x2'));var BPromise=require('bluebird');var rs=require(_0xf0b9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0b9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0b9('0x5'))(_0xf0b9('0x6'));var config=require(_0xf0b9('0x7'));var jayson=require(_0xf0b9('0x8'));var client=jayson['client'][_0xf0b9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a44cd,_0x5cef53,_0x3dbc8d){return new BPromise(function(_0x564223,_0x5e2200){return client[_0xf0b9('0xa')](_0x2a44cd,_0x3dbc8d)[_0xf0b9('0xb')](function(_0x429737){logger[_0xf0b9('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x5cef53,_0xf0b9('0xd'));logger[_0xf0b9('0xe')](_0xf0b9('0xf'),_0x5cef53,_0xf0b9('0xd'),JSON[_0xf0b9('0x10')](_0x429737));if(_0x429737[_0xf0b9('0x11')]){if(_0x429737[_0xf0b9('0x11')][_0xf0b9('0x12')]===0x1f4){logger['error'](_0xf0b9('0x13'),_0x5cef53,_0x429737[_0xf0b9('0x11')][_0xf0b9('0x14')]);return _0x5e2200(_0x429737[_0xf0b9('0x11')][_0xf0b9('0x14')]);}logger[_0xf0b9('0x11')](_0xf0b9('0x13'),_0x5cef53,_0x429737[_0xf0b9('0x11')]['message']);return _0x564223(_0x429737[_0xf0b9('0x11')][_0xf0b9('0x14')]);}else{logger[_0xf0b9('0xc')](_0xf0b9('0x13'),_0x5cef53,_0xf0b9('0xd'));_0x564223(_0x429737[_0xf0b9('0x15')][_0xf0b9('0x14')]);}})[_0xf0b9('0x16')](function(_0x42a877){logger['error'](_0xf0b9('0x13'),_0x5cef53,_0x42a877);_0x5e2200(_0x42a877);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index bc6e1d4..ca04581 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 _0x24a9=['/describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated'];(function(_0x1fcde8,_0x44c01d){var _0x5b3541=function(_0x577ef6){while(--_0x577ef6){_0x1fcde8['push'](_0x1fcde8['shift']());}};_0x5b3541(++_0x44c01d);}(_0x24a9,0xf9));var _0x924a=function(_0x514040,_0x3493b5){_0x514040=_0x514040-0x0;var _0x185acd=_0x24a9[_0x514040];return _0x185acd;};'use strict';var multer=require(_0x924a('0x0'));var util=require(_0x924a('0x1'));var path=require('path');var timeout=require(_0x924a('0x2'));var express=require(_0x924a('0x3'));var router=express[_0x924a('0x4')]();var fs_extra=require(_0x924a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x924a('0x6'));var config=require(_0x924a('0x7'));var controller=require(_0x924a('0x8'));router[_0x924a('0x9')]('/',auth[_0x924a('0xa')](),controller['index']);router[_0x924a('0x9')](_0x924a('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x924a('0xc'),auth['isAuthenticated'](),controller[_0x924a('0xd')]);router[_0x924a('0xe')]('/',auth[_0x924a('0xa')](),controller[_0x924a('0xf')]);router['put'](_0x924a('0xc'),auth[_0x924a('0xa')](),controller[_0x924a('0x10')]);router[_0x924a('0x11')](_0x924a('0xc'),auth['isAuthenticated'](),controller[_0x924a('0x12')]);module[_0x924a('0x13')]=router;
\ No newline at end of file
+var _0x4e34=['/:id','show','post','put','delete','destroy','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','index','get','/describe','isAuthenticated','describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4e34,0x19e));var _0x44e3=function(_0x319285,_0x5ebbd9){_0x319285=_0x319285-0x0;var _0x447dea=_0x4e34[_0x319285];return _0x447dea;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x44e3('0x0'));var timeout=require(_0x44e3('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x44e3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x44e3('0x3'));var config=require(_0x44e3('0x4'));var controller=require(_0x44e3('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x44e3('0x6')]);router[_0x44e3('0x7')](_0x44e3('0x8'),auth[_0x44e3('0x9')](),controller[_0x44e3('0xa')]);router[_0x44e3('0x7')](_0x44e3('0xb'),auth['isAuthenticated'](),controller[_0x44e3('0xc')]);router[_0x44e3('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x44e3('0xe')](_0x44e3('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x44e3('0xf')](_0x44e3('0xb'),auth[_0x44e3('0x9')](),controller[_0x44e3('0x10')]);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 894e63b..d19ae0c 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 _0x26d8=['Leave\x20your\x20comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','email','#011F6A','INTEGER','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','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!','Skip','Feedback','star','thumb','stringify','name','input','getDataValue','parse','onlineForm','setDataValue','textarea','Comments'];(function(_0x5d412b,_0x524f80){var _0x32cc6a=function(_0x3a0a27){while(--_0x3a0a27){_0x5d412b['push'](_0x5d412b['shift']());}};_0x32cc6a(++_0x524f80);}(_0x26d8,0xae));var _0x826d=function(_0x457dd5,_0x219753){_0x457dd5=_0x457dd5-0x0;var _0x913641=_0x26d8[_0x457dd5];return _0x913641;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x826d('0x0'));module[_0x826d('0x1')]={'name':{'type':Sequelize[_0x826d('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x826d('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x826d('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x826d('0x3')},'mapKeyOffline':{'type':Sequelize[_0x826d('0x2')],'defaultValue':_0x826d('0x3')},'key':{'type':Sequelize[_0x826d('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x826d('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x826d('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x826d('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x826d('0x2')],'allowNull':![],'defaultValue':_0x826d('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x826d('0x5')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x826d('0x2')]},'animation':{'type':Sequelize[_0x826d('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x826d('0x7')]('rounded',_0x826d('0x8')),'defaultValue':_0x826d('0x9')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x826d('0xa')},'start_chat_button':{'type':Sequelize[_0x826d('0x2')],'defaultValue':_0x826d('0xb')},'offline_chat_button':{'type':Sequelize[_0x826d('0x2')],'defaultValue':_0x826d('0xc')},'header_offline':{'type':Sequelize[_0x826d('0x2')],'defaultValue':_0x826d('0xd')},'download_transcript':{'type':Sequelize[_0x826d('0x6')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x826d('0x5')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x826d('0x2')],'defaultValue':_0x826d('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x826d('0xf')]},'closingQuestion':{'type':Sequelize[_0x826d('0x2')],'defaultValue':_0x826d('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x826d('0x2')],'defaultValue':_0x826d('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x826d('0x2')],'defaultValue':_0x826d('0x12')},'noteTitle':{'type':Sequelize[_0x826d('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x826d('0x2')],'defaultValue':_0x826d('0x13')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x826d('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x826d('0x2')],'defaultValue':_0x826d('0x15')},'conditionAgreement':{'type':Sequelize[_0x826d('0x6')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x826d('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x826d('0x16')},'ratingType':{'type':Sequelize[_0x826d('0x7')](_0x826d('0x17'),_0x826d('0x18')),'defaultValue':_0x826d('0x17')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x826d('0xf')],'defaultValue':function(){return JSON[_0x826d('0x19')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x826d('0x1a'),'type':'text','required':!![]},'props':{'title':_0x826d('0x1a'),'helpText':''}},{'type':_0x826d('0x1b'),'props':{'title':_0x826d('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x826d('0x3'),'type':_0x826d('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x826d('0x1c')]('onlineForm')?JSON[_0x826d('0x1d')](this[_0x826d('0x1c')](_0x826d('0x1e'))):{};},'set':function(_0xffaea){return this[_0x826d('0x1f')]('onlineForm',JSON[_0x826d('0x19')](_0xffaea));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x826d('0x1b'),'props':{'title':_0x826d('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x826d('0x3'),'type':_0x826d('0x3')},'variable':null},{'type':_0x826d('0x20'),'config':{'placeholder':_0x826d('0x21')},'props':{'title':'Comments','helpText':_0x826d('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x826d('0x1c')](_0x826d('0x23'))?JSON[_0x826d('0x1d')](this[_0x826d('0x1c')]('offlineForm')):{};},'set':function(_0x5923e2){return this['setDataValue'](_0x826d('0x23'),JSON[_0x826d('0x19')](_0x5923e2));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x826d('0x24')]();}},'autoclose':{'type':Sequelize[_0x826d('0x6')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x826d('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x826d('0x6')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x826d('0x2')]},'forwardOffline':{'type':Sequelize[_0x826d('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x826d('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x826d('0x2')],'defaultValue':_0x826d('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x826d('0x2')],'defaultValue':_0x826d('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x826d('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x826d('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x826d('0x2')],'defaultValue':_0x826d('0x15')},'sendUnmanaged':{'type':Sequelize[_0x826d('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x826d('0x6')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x826d('0x6')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x826d('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x826d('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x826d('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x826d('0x28');}},'notificationSound':{'type':Sequelize[_0x826d('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x826d('0x6')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x826d('0x6')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x826d('0x2')],'defaultValue':_0x826d('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x826d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x826d('0x2')],'defaultValue':_0x826d('0x2a')},'verticalAlignment':{'type':Sequelize[_0x826d('0x5')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x826d('0x2')],'defaultValue':_0x826d('0x2b')},'defaultTitle':{'type':Sequelize[_0x826d('0x2')]},'customerAvatar':{'type':Sequelize[_0x826d('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x826d('0x6')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x826d('0x5')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x826d('0x2')],'allowNull':![],'defaultValue':_0x826d('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x826d('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x826d('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x826d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x826d('0x2')],'defaultValue':_0x826d('0x2d')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x826d('0x5')],'comment':_0x826d('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x826d('0x6')],'defaultValue':![],'comment':_0x826d('0x2f'),'set':function(_0x2fc6e6){if(!_0x2fc6e6)this[_0x826d('0x1f')](_0x826d('0x30'),null);this[_0x826d('0x1f')](_0x826d('0x31'),_0x2fc6e6);}},'vidaooEscalation':{'type':Sequelize[_0x826d('0x6')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING'],'defaultValue':![]},'vidaooTopic':{'type':Sequelize[_0x826d('0x2')],'allowNull':![],'defaultValue':_0x826d('0x32')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x826d('0x33');}},'vidaooMetadata':{'type':Sequelize[_0x826d('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x826d('0x6')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x826d('0xf')]}};
\ No newline at end of file
+var _0xc690=['Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','address','email','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Send','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','stringify','input','name','text','getDataValue','parse','onlineForm','textarea','Comments','setDataValue','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'];(function(_0xa911d,_0x184eaa){var _0x2877ff=function(_0x2c648c){while(--_0x2c648c){_0xa911d['push'](_0xa911d['shift']());}};_0x2877ff(++_0x184eaa);}(_0xc690,0xea));var _0x0c69=function(_0x41d196,_0x169a6a){_0x41d196=_0x41d196-0x0;var _0xe6b8c8=_0xc690[_0x41d196];return _0xe6b8c8;};'use strict';var Sequelize=require(_0x0c69('0x0'));var rs=require(_0x0c69('0x1'));module[_0x0c69('0x2')]={'name':{'type':Sequelize[_0x0c69('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x0c69('0x3')],'allowNull':![],'unique':_0x0c69('0x4')},'description':{'type':Sequelize[_0x0c69('0x3')]},'mapKey':{'type':Sequelize[_0x0c69('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x0c69('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x0c69('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x0c69('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x0c69('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0c69('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x0c69('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x0c69('0x3')]},'animation':{'type':Sequelize[_0x0c69('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x0c69('0x9')](_0x0c69('0xa'),_0x0c69('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x0c69('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x0c69('0xc')},'header_offline':{'type':Sequelize[_0x0c69('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x0c69('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x0c69('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x0c69('0x3')],'defaultValue':_0x0c69('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x0c69('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0c69('0xe')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x0c69('0xf')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0c69('0x10')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x0c69('0x11')},'placeholderMessage':{'type':Sequelize[_0x0c69('0x3')],'defaultValue':_0x0c69('0x12')},'closingMessage':{'type':Sequelize[_0x0c69('0x3')],'defaultValue':_0x0c69('0x13')},'closingMessageButton':{'type':Sequelize[_0x0c69('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x0c69('0x3')],'defaultValue':_0x0c69('0x14')},'conditionAgreement':{'type':Sequelize[_0x0c69('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x0c69('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0c69('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x0c69('0x9')](_0x0c69('0x15'),_0x0c69('0x16')),'defaultValue':_0x0c69('0x15')},'ratingStarsNumber':{'type':Sequelize[_0x0c69('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x0c69('0xe')],'defaultValue':function(){return JSON[_0x0c69('0x17')]({'items':[{'type':_0x0c69('0x18'),'variable':null,'config':{'placeholder':_0x0c69('0x19'),'type':_0x0c69('0x1a'),'required':!![]},'props':{'title':_0x0c69('0x19'),'helpText':''}},{'type':_0x0c69('0x18'),'props':{'title':_0x0c69('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x0c69('0x5'),'type':_0x0c69('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0c69('0x1b')]('onlineForm')?JSON[_0x0c69('0x1c')](this[_0x0c69('0x1b')](_0x0c69('0x1d'))):{};},'set':function(_0x2b7c49){return this['setDataValue'](_0x0c69('0x1d'),JSON[_0x0c69('0x17')](_0x2b7c49));}},'offlineForm':{'type':Sequelize[_0x0c69('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x0c69('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null},{'type':_0x0c69('0x1e'),'config':{'placeholder':_0x0c69('0x1f')},'props':{'title':_0x0c69('0x1f'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x0c69('0x1b')]('offlineForm')?JSON[_0x0c69('0x1c')](this[_0x0c69('0x1b')]('offlineForm')):{};},'set':function(_0x201f4a){return this[_0x0c69('0x20')](_0x0c69('0x21'),JSON[_0x0c69('0x17')](_0x201f4a));}},'token':{'type':Sequelize[_0x0c69('0x3')],'defaultValue':function(){return rs[_0x0c69('0x22')]();}},'autoclose':{'type':Sequelize[_0x0c69('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x0c69('0x3')]},'forwardOffline':{'type':Sequelize[_0x0c69('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0c69('0x3')]},'waitingTitle':{'type':Sequelize[_0x0c69('0x3')],'defaultValue':_0x0c69('0x23')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0c69('0x24')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x0c69('0x25')},'offlineMessageBody':{'type':Sequelize[_0x0c69('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x0c69('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x0c69('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x0c69('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x0c69('0x3')],'defaultValue':_0x0c69('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x0c69('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x0c69('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x0c69('0xe')]},'showAgentAvatar':{'type':Sequelize[_0x0c69('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x0c69('0x3')]},'notificationTemplate':{'type':Sequelize[_0x0c69('0xe')],'defaultValue':function(){return _0x0c69('0x26');}},'notificationSound':{'type':Sequelize[_0x0c69('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0c69('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x0c69('0x3')],'defaultValue':_0x0c69('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x0c69('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x0c69('0x3')],'defaultValue':_0x0c69('0x28')},'verticalAlignment':{'type':Sequelize[_0x0c69('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x0c69('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x0c69('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0x0c69('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x0c69('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x0c69('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x0c69('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0c69('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0c69('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0c69('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x0c69('0x3')],'defaultValue':_0x0c69('0x29')},'systemAvatar':{'type':Sequelize[_0x0c69('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x0c69('0x2a')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2fcad5){if(!_0x2fcad5)this[_0x0c69('0x20')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x0c69('0x2b'),_0x2fcad5);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x0c69('0x3')],'defaultValue':![]},'vidaooTopic':{'type':Sequelize[_0x0c69('0x3')],'allowNull':![],'defaultValue':_0x0c69('0x2c')},'vidaooNote':{'type':Sequelize[_0x0c69('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x0c69('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x0c69('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x0c69('0xe')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 5c83eb1..b19e672 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 _0x3f40=['applications','list','orderBy','priority','asc','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','ContactId','spread','lastName','messageId','created','autoclose','push','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','Start','startRouting','EventManager','offline','createdAt','CompanyId','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','server','files','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','bulkCreate','forwardOfflineAddress','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','subjectOffline','toPairsIn','mapValues','Chat','MailAccountId','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','Command','iftime\x20%s,%s','interval','timezone','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','No\x20timezone','inspect','getSnippet','Interval','Intervals','virtual','custom','chatLicenseExceeded','all','some','readFileSync','server/files/chat/iframe.js','remote','replace','verticalAlignment','textColor','color_button','backgroundColor','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','online','false','items','fromKey','getOfflineMessages','Attachment','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','ChatWebsites','UserProfileResource','end','stack','name','send','render','merge','body','contact','interaction','account','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','map','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','pick','where','type','filter','options','includeAll','include','findAll','catch','show','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','params','describe','addDisposition','ChatWebsiteId','Disposition','hasOwnProperty','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','root','../../config/license/util','getLicense','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Contacts','DESC','ChatApplication','Applications'];(function(_0x20d54d,_0x1adc8e){var _0x516e8b=function(_0x2754e1){while(--_0x2754e1){_0x20d54d['push'](_0x20d54d['shift']());}};_0x516e8b(++_0x1adc8e);}(_0x3f40,0x1bb));var _0x03f4=function(_0x183c48,_0x406657){_0x183c48=_0x183c48-0x0;var _0x45dce8=_0x3f40[_0x183c48];return _0x45dce8;};'use strict';var emlformat=require(_0x03f4('0x0'));var rimraf=require(_0x03f4('0x1'));var zipdir=require(_0x03f4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x03f4('0x3'));var moment=require(_0x03f4('0x4'));var BPromise=require(_0x03f4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x03f4('0x6'));var sox=require(_0x03f4('0x7'));var csv=require('to-csv');var ejs=require(_0x03f4('0x8'));var fs=require('fs');var fs_extra=require(_0x03f4('0x9'));var _=require(_0x03f4('0xa'));var squel=require(_0x03f4('0xb'));var crypto=require(_0x03f4('0xc'));var jsforce=require(_0x03f4('0xd'));var deskjs=require(_0x03f4('0xe'));var toCsv=require(_0x03f4('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x03f4('0x10'));var qs=require(_0x03f4('0x11'));var as=require(_0x03f4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x03f4('0x13'));var utils=require('../../config/utils');var config=require(_0x03f4('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x03f4('0x15'))['db'];config[_0x03f4('0x16')]=_[_0x03f4('0x17')](config[_0x03f4('0x16')],{'host':_0x03f4('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x03f4('0x16')]));require(_0x03f4('0x19'))[_0x03f4('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x03f4('0x1b')][_0x03f4('0x1c')]({'port':0x232c});var client9002=jayson[_0x03f4('0x1b')]['http']({'port':0x232a});var client9003=jayson[_0x03f4('0x1b')][_0x03f4('0x1c')]({'port':0x232b});var client9001=jayson[_0x03f4('0x1b')][_0x03f4('0x1c')]({'port':0x2329});function respondWithRpcPromise(_0x5a50f1,_0x367d34,_0x3c2b8d,_0x130258){return new BPromise(function(_0x4c183d,_0x27f437){var _0xd1827e=_0x130258||client;return _0xd1827e[_0x03f4('0x1d')](_0x5a50f1,_0x3c2b8d)[_0x03f4('0x1e')](function(_0x1d4f17){logger[_0x03f4('0x1f')](_0x03f4('0x20'),_0x367d34,'request\x20sent');logger['debug'](_0x03f4('0x21'),_0x367d34,_0x03f4('0x22'),JSON[_0x03f4('0x23')](_0x1d4f17));if(_0x1d4f17[_0x03f4('0x24')]){if(_0x1d4f17[_0x03f4('0x24')][_0x03f4('0x25')]===0x1f4){logger[_0x03f4('0x24')](_0x03f4('0x20'),_0x367d34,_0x1d4f17['error'][_0x03f4('0x26')]);return _0x27f437(_0x1d4f17['error'][_0x03f4('0x26')]);}logger['error'](_0x03f4('0x20'),_0x367d34,_0x1d4f17[_0x03f4('0x24')][_0x03f4('0x26')]);return _0x4c183d(_0x1d4f17[_0x03f4('0x24')][_0x03f4('0x26')]);}else{logger[_0x03f4('0x1f')](_0x03f4('0x20'),_0x367d34,_0x03f4('0x22'));_0x4c183d(_0x1d4f17['result'][_0x03f4('0x26')]);}})['catch'](function(_0x158329){logger['error'](_0x03f4('0x20'),_0x367d34,_0x158329);_0x27f437(_0x158329);});});}function respondWithStatusCode(_0x18f6ef,_0x13f842){_0x13f842=_0x13f842||0xcc;return function(_0x5853c0){if(_0x5853c0){return _0x18f6ef[_0x03f4('0x27')](_0x13f842);}return _0x18f6ef[_0x03f4('0x28')](_0x13f842)['end']();};}function respondWithResult(_0x194758,_0x5a5c29){_0x5a5c29=_0x5a5c29||0xc8;return function(_0x1ea018){if(_0x1ea018){return _0x194758[_0x03f4('0x28')](_0x5a5c29)[_0x03f4('0x29')](_0x1ea018);}};}function respondWithFilteredResult(_0x1b347c,_0x481e56){return function(_0x527f9d){if(_0x527f9d){var _0x528cd4=typeof _0x481e56['offset']===_0x03f4('0x2a')&&typeof _0x481e56[_0x03f4('0x2b')]===_0x03f4('0x2a');var _0x3b9745=_0x527f9d['count'];var _0x59a3cd=_0x528cd4?0x0:_0x481e56['offset'];var _0x5976c1=_0x528cd4?_0x527f9d[_0x03f4('0x2c')]:_0x481e56[_0x03f4('0x2d')]+_0x481e56[_0x03f4('0x2b')];var _0x4f0d50;if(_0x5976c1>=_0x3b9745){_0x5976c1=_0x3b9745;_0x4f0d50=0xc8;}else{_0x4f0d50=0xce;}_0x1b347c[_0x03f4('0x28')](_0x4f0d50);return _0x1b347c[_0x03f4('0x2e')](_0x03f4('0x2f'),_0x59a3cd+'-'+_0x5976c1+'/'+_0x3b9745)['json'](_0x527f9d);}return null;};}function patchUpdates(_0x357739){return function(_0x59234f){try{jsonpatch[_0x03f4('0x30')](_0x59234f,_0x357739,!![]);}catch(_0x45c790){return BPromise[_0x03f4('0x31')](_0x45c790);}return _0x59234f[_0x03f4('0x32')]();};}function saveUpdates(_0x4a5dbd,_0xa3043e){return function(_0x1850b8){if(_0x1850b8){return _0x1850b8[_0x03f4('0x33')](_0x4a5dbd)['then'](function(_0x479137){return _0x479137;});}return null;};}function removeEntity(_0x41a035,_0x5083e1){return function(_0x135194){if(_0x135194){return _0x135194[_0x03f4('0x34')]()[_0x03f4('0x1e')](function(){var _0x1178cf=_0x135194[_0x03f4('0x35')]({'plain':!![]});var _0x56aa1a=_0x03f4('0x36');return db[_0x03f4('0x37')][_0x03f4('0x34')]({'where':{'type':_0x56aa1a,'resourceId':_0x1178cf['id']}})[_0x03f4('0x1e')](function(){return _0x135194;});})[_0x03f4('0x1e')](function(){_0x41a035[_0x03f4('0x28')](0xcc)[_0x03f4('0x38')]();});}};}function handleEntityNotFound(_0x5e32ff,_0x1fbd10){return function(_0xde1d23){if(!_0xde1d23){_0x5e32ff[_0x03f4('0x27')](0x194);}return _0xde1d23;};}function handleError(_0x1967fc,_0xb9bf0b){_0xb9bf0b=_0xb9bf0b||0x1f4;return function(_0x39027c){logger[_0x03f4('0x24')](_0x39027c[_0x03f4('0x39')]);if(_0x39027c['name']){delete _0x39027c[_0x03f4('0x3a')];}_0x1967fc[_0x03f4('0x28')](_0xb9bf0b)[_0x03f4('0x3b')](_0x39027c);};}function getMustacheRender(_0x3fdfe6,_0x1ed72b){return Mustache[_0x03f4('0x3c')](_0x3fdfe6,_[_0x03f4('0x3d')](_0x1ed72b[_0x03f4('0x3e')],{'contact':_0x1ed72b[_0x03f4('0x3f')],'message':_0x1ed72b[_0x03f4('0x26')],'agent':_0x1ed72b['agent'],'interaction':_0x1ed72b[_0x03f4('0x40')],'account':_0x1ed72b[_0x03f4('0x41')]}))||'';}exports[_0x03f4('0x42')]=function(_0x36a7bb,_0x570325){var _0x2d8230={'include':[{'model':db[_0x03f4('0x43')],'as':_0x03f4('0x44')}]},_0x52eee9={},_0x23740b={'count':0x0,'rows':[]};var _0x115741=_['map'](db[_0x03f4('0x45')][_0x03f4('0x46')],function(_0x4fb76b){return{'name':_0x4fb76b[_0x03f4('0x47')],'type':_0x4fb76b['type']['key']};});_0x52eee9['model']=_[_0x03f4('0x48')](_0x115741,_0x03f4('0x3a'));_0x52eee9[_0x03f4('0x49')]=_[_0x03f4('0x4a')](_0x36a7bb[_0x03f4('0x49')]);_0x52eee9[_0x03f4('0x4b')]=_[_0x03f4('0x4c')](_0x52eee9[_0x03f4('0x4d')],_0x52eee9[_0x03f4('0x49')]);_0x2d8230['attributes']=_[_0x03f4('0x4c')](_0x52eee9[_0x03f4('0x4d')],qs[_0x03f4('0x4e')](_0x36a7bb['query'][_0x03f4('0x4e')]));_0x2d8230[_0x03f4('0x4f')]=_0x2d8230[_0x03f4('0x4f')][_0x03f4('0x50')]?_0x2d8230[_0x03f4('0x4f')]:_0x52eee9[_0x03f4('0x4d')];if(!_0x36a7bb[_0x03f4('0x49')]['hasOwnProperty'](_0x03f4('0x51'))){_0x2d8230['limit']=qs[_0x03f4('0x2b')](_0x36a7bb['query'][_0x03f4('0x2b')]);_0x2d8230[_0x03f4('0x2d')]=qs[_0x03f4('0x2d')](_0x36a7bb[_0x03f4('0x49')][_0x03f4('0x2d')]);}_0x2d8230[_0x03f4('0x52')]=qs[_0x03f4('0x53')](_0x36a7bb[_0x03f4('0x49')][_0x03f4('0x53')]);_0x2d8230['where']=qs[_0x03f4('0x4b')](_[_0x03f4('0x54')](_0x36a7bb[_0x03f4('0x49')],_0x52eee9['filters']),_0x115741);if(_0x36a7bb[_0x03f4('0x49')]['filter']){_0x2d8230['where']=_[_0x03f4('0x3d')](_0x2d8230[_0x03f4('0x55')],{'$or':_[_0x03f4('0x48')](_0x115741,function(_0x45c132){if(_0x45c132[_0x03f4('0x56')]!=='VIRTUAL'){var _0x290819={};_0x290819[_0x45c132['name']]={'$like':'%'+_0x36a7bb['query'][_0x03f4('0x57')]+'%'};return _0x290819;}})});}_0x2d8230=_[_0x03f4('0x3d')]({},_0x2d8230,_0x36a7bb[_0x03f4('0x58')]);var _0x4e03e0={'where':_0x2d8230['where']};return db['ChatWebsite'][_0x03f4('0x2c')](_0x4e03e0)[_0x03f4('0x1e')](function(_0x5841d6){_0x23740b[_0x03f4('0x2c')]=_0x5841d6;if(_0x36a7bb['query'][_0x03f4('0x59')]){_0x2d8230[_0x03f4('0x5a')]=[{'all':!![]}];}return db['ChatWebsite'][_0x03f4('0x5b')](_0x2d8230);})[_0x03f4('0x1e')](function(_0x2dd2a1){_0x23740b['rows']=_0x2dd2a1;return _0x23740b;})[_0x03f4('0x1e')](respondWithFilteredResult(_0x570325,_0x2d8230))[_0x03f4('0x5c')](handleError(_0x570325,null));};exports[_0x03f4('0x5d')]=function(_0xe4a2cc,_0x5955c4){var _0x5434f2={'raw':![],'where':{'id':_0xe4a2cc['params']['id']},'include':[{'model':db['Pause'],'as':_0x03f4('0x44')}]},_0x4a463b={};_0x4a463b[_0x03f4('0x4d')]=_['keys'](db[_0x03f4('0x45')][_0x03f4('0x46')]);_0x4a463b[_0x03f4('0x49')]=_['keys'](_0xe4a2cc[_0x03f4('0x49')]);_0x4a463b[_0x03f4('0x4b')]=_['intersection'](_0x4a463b[_0x03f4('0x4d')],_0x4a463b[_0x03f4('0x49')]);_0x5434f2[_0x03f4('0x4f')]=_[_0x03f4('0x4c')](_0x4a463b[_0x03f4('0x4d')],qs[_0x03f4('0x4e')](_0xe4a2cc[_0x03f4('0x49')][_0x03f4('0x4e')]));_0x5434f2[_0x03f4('0x4f')]=_0x5434f2[_0x03f4('0x4f')]['length']?_0x5434f2[_0x03f4('0x4f')]:_0x4a463b[_0x03f4('0x4d')];if(_0xe4a2cc[_0x03f4('0x49')][_0x03f4('0x59')]){_0x5434f2[_0x03f4('0x5a')]=[{'all':!![]}];}_0x5434f2=_[_0x03f4('0x3d')]({},_0x5434f2,_0xe4a2cc['options']);return db['ChatWebsite'][_0x03f4('0x5e')](_0x5434f2)['then'](handleEntityNotFound(_0x5955c4,null))[_0x03f4('0x1e')](respondWithResult(_0x5955c4,null))[_0x03f4('0x5c')](handleError(_0x5955c4,null));};exports[_0x03f4('0x5f')]=function(_0x262ee8,_0x671354){return db[_0x03f4('0x45')][_0x03f4('0x5f')](_0x262ee8[_0x03f4('0x3e')],{})[_0x03f4('0x1e')](function(_0x1e705b){var _0x3612f2=_0x262ee8[_0x03f4('0x60')][_0x03f4('0x35')]({'plain':!![]});if(!_0x3612f2)throw new Error(_0x03f4('0x61'));if(_0x3612f2['role']==='user'){var _0x305946=_0x1e705b[_0x03f4('0x35')]({'plain':!![]});var _0x32dfd5='ChatWebsites';return db[_0x03f4('0x62')][_0x03f4('0x5e')]({'where':{'name':_0x32dfd5,'userProfileId':_0x3612f2['userProfileId']},'raw':!![]})[_0x03f4('0x1e')](function(_0x89667a){if(_0x89667a&&_0x89667a[_0x03f4('0x63')]===0x0){return db[_0x03f4('0x37')]['create']({'name':_0x305946[_0x03f4('0x3a')],'resourceId':_0x305946['id'],'type':_0x89667a[_0x03f4('0x3a')],'sectionId':_0x89667a['id']},{})[_0x03f4('0x1e')](function(){return _0x1e705b;});}else{return _0x1e705b;}})[_0x03f4('0x5c')](function(_0x50cda6){logger[_0x03f4('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50cda6);throw _0x50cda6;});}return _0x1e705b;})[_0x03f4('0x1e')](respondWithResult(_0x671354,0xc9))[_0x03f4('0x5c')](handleError(_0x671354,null));};exports[_0x03f4('0x33')]=function(_0x511c0f,_0x1070de){if(_0x511c0f[_0x03f4('0x3e')]['id']){delete _0x511c0f[_0x03f4('0x3e')]['id'];}return db['ChatWebsite'][_0x03f4('0x5e')]({'where':{'id':_0x511c0f[_0x03f4('0x64')]['id']},'include':[{'model':db['Pause'],'as':_0x03f4('0x44')}]})[_0x03f4('0x1e')](handleEntityNotFound(_0x1070de,null))[_0x03f4('0x1e')](saveUpdates(_0x511c0f['body'],null))[_0x03f4('0x1e')](respondWithResult(_0x1070de,null))[_0x03f4('0x5c')](handleError(_0x1070de,null));};exports[_0x03f4('0x34')]=function(_0x11bbae,_0x250359){return db[_0x03f4('0x45')][_0x03f4('0x5e')]({'where':{'id':_0x11bbae[_0x03f4('0x64')]['id']}})['then'](handleEntityNotFound(_0x250359,null))['then'](removeEntity(_0x250359,null))[_0x03f4('0x5c')](handleError(_0x250359,null));};exports['describe']=function(_0x27538b,_0x495235){return db[_0x03f4('0x45')][_0x03f4('0x65')]()[_0x03f4('0x1e')](respondWithResult(_0x495235,null))[_0x03f4('0x5c')](handleError(_0x495235,null));};exports[_0x03f4('0x66')]=function(_0x2ffdbe,_0x4196e3,_0x38dde2){if(_0x2ffdbe[_0x03f4('0x3e')]['id']){delete _0x2ffdbe['body']['id'];}return db[_0x03f4('0x45')][_0x03f4('0x5e')]({'where':{'id':_0x2ffdbe[_0x03f4('0x64')]['id']}})['then'](handleEntityNotFound(_0x4196e3,null))['then'](function(_0x33d063){if(_0x33d063){_0x2ffdbe[_0x03f4('0x3e')][_0x03f4('0x67')]=_0x33d063['id'];return db[_0x03f4('0x68')][_0x03f4('0x5f')](_0x2ffdbe[_0x03f4('0x3e')]);}})[_0x03f4('0x1e')](respondWithResult(_0x4196e3,null))[_0x03f4('0x5c')](handleError(_0x4196e3,null));};exports['getDispositions']=function(_0x110571,_0x4e848c,_0x4fa801){var _0x5d3e1d={'raw':![],'where':{}};var _0x15d388={};var _0x56c398={'count':0x0,'rows':[]};return db[_0x03f4('0x45')]['findOne']({'where':{'id':_0x110571[_0x03f4('0x64')]['id']}})[_0x03f4('0x1e')](handleEntityNotFound(_0x4e848c,null))[_0x03f4('0x1e')](function(_0x4d6c90){if(_0x4d6c90){_0x15d388['model']=_['keys'](db[_0x03f4('0x68')]['rawAttributes']);_0x15d388[_0x03f4('0x49')]=_[_0x03f4('0x4a')](_0x110571[_0x03f4('0x49')]);_0x15d388[_0x03f4('0x4b')]=_[_0x03f4('0x4c')](_0x15d388[_0x03f4('0x4d')],_0x15d388[_0x03f4('0x49')]);_0x5d3e1d['attributes']=_['intersection'](_0x15d388[_0x03f4('0x4d')],qs[_0x03f4('0x4e')](_0x110571[_0x03f4('0x49')]['fields']));_0x5d3e1d[_0x03f4('0x4f')]=_0x5d3e1d['attributes']['length']?_0x5d3e1d[_0x03f4('0x4f')]:_0x15d388[_0x03f4('0x4d')];if(!_0x110571[_0x03f4('0x49')][_0x03f4('0x69')](_0x03f4('0x51'))){_0x5d3e1d[_0x03f4('0x2b')]=qs['limit'](_0x110571[_0x03f4('0x49')]['limit']);_0x5d3e1d['offset']=qs['offset'](_0x110571[_0x03f4('0x49')][_0x03f4('0x2d')]);}_0x5d3e1d[_0x03f4('0x52')]=qs[_0x03f4('0x53')](_0x110571[_0x03f4('0x49')]['sort']);_0x5d3e1d[_0x03f4('0x55')]=qs[_0x03f4('0x4b')](_['pick'](_0x110571['query'],_0x15d388[_0x03f4('0x4b')]));_0x5d3e1d[_0x03f4('0x55')][_0x03f4('0x67')]=_0x4d6c90['id'];if(_0x110571['query'][_0x03f4('0x57')]){_0x5d3e1d['where']=_[_0x03f4('0x3d')](_0x5d3e1d[_0x03f4('0x55')],{'$or':_[_0x03f4('0x48')](_0x5d3e1d['attributes'],function(_0x99fe47){var _0x5bf66b={};_0x5bf66b[_0x99fe47]={'$like':'%'+_0x110571[_0x03f4('0x49')]['filter']+'%'};return _0x5bf66b;})});}_0x5d3e1d=_[_0x03f4('0x3d')]({},_0x5d3e1d,_0x110571[_0x03f4('0x58')]);return db[_0x03f4('0x68')][_0x03f4('0x2c')]({'where':_0x5d3e1d['where']})[_0x03f4('0x1e')](function(_0x113853){_0x56c398[_0x03f4('0x2c')]=_0x113853;if(_0x110571['query'][_0x03f4('0x59')]){_0x5d3e1d[_0x03f4('0x5a')]=[{'all':!![]}];}return db[_0x03f4('0x68')]['findAll'](_0x5d3e1d);})[_0x03f4('0x1e')](function(_0x2e8ee2){_0x56c398[_0x03f4('0x6a')]=_0x2e8ee2;return _0x56c398;});}})[_0x03f4('0x1e')](respondWithFilteredResult(_0x4e848c,_0x5d3e1d))[_0x03f4('0x5c')](handleError(_0x4e848c,null));};exports[_0x03f4('0x6b')]=function(_0x1f3fdf,_0x178449,_0x287e35){return db[_0x03f4('0x45')][_0x03f4('0x5e')]({'where':{'id':_0x1f3fdf[_0x03f4('0x64')]['id']}})[_0x03f4('0x1e')](handleEntityNotFound(_0x178449,null))[_0x03f4('0x1e')](function(_0x2b5885){if(_0x2b5885){return _0x2b5885[_0x03f4('0x6b')](_0x1f3fdf['query'][_0x03f4('0x6c')]);}})['then'](respondWithStatusCode(_0x178449,null))['catch'](handleError(_0x178449,null));};exports[_0x03f4('0x6d')]=function(_0xcb51d1,_0xb78a54,_0x4b4b8c){if(_0xcb51d1[_0x03f4('0x3e')]['id']){delete _0xcb51d1[_0x03f4('0x3e')]['id'];}return db[_0x03f4('0x45')][_0x03f4('0x5e')]({'where':{'id':_0xcb51d1['params']['id']}})[_0x03f4('0x1e')](handleEntityNotFound(_0xb78a54,null))[_0x03f4('0x1e')](function(_0x57dce6){if(_0x57dce6){_0xcb51d1[_0x03f4('0x3e')]['ChatWebsiteId']=_0x57dce6['id'];return db[_0x03f4('0x6e')][_0x03f4('0x5f')](_0xcb51d1[_0x03f4('0x3e')]);}})[_0x03f4('0x1e')](respondWithResult(_0xb78a54,null))[_0x03f4('0x5c')](handleError(_0xb78a54,null));};exports[_0x03f4('0x6f')]=function(_0x4b04f2,_0x339858,_0x4b10e9){var _0x3773f8={'raw':![],'where':{}};var _0x45ee1c={};var _0x4720d8={'count':0x0,'rows':[]};return db[_0x03f4('0x45')][_0x03f4('0x70')]({'where':{'id':_0x4b04f2['params']['id']}})[_0x03f4('0x1e')](handleEntityNotFound(_0x339858,null))[_0x03f4('0x1e')](function(_0xd4cb1c){if(_0xd4cb1c){_0x45ee1c['model']=_[_0x03f4('0x4a')](db[_0x03f4('0x6e')][_0x03f4('0x46')]);_0x45ee1c[_0x03f4('0x49')]=_[_0x03f4('0x4a')](_0x4b04f2[_0x03f4('0x49')]);_0x45ee1c[_0x03f4('0x4b')]=_[_0x03f4('0x4c')](_0x45ee1c['model'],_0x45ee1c['query']);_0x3773f8[_0x03f4('0x4f')]=_['intersection'](_0x45ee1c[_0x03f4('0x4d')],qs[_0x03f4('0x4e')](_0x4b04f2[_0x03f4('0x49')]['fields']));_0x3773f8[_0x03f4('0x4f')]=_0x3773f8[_0x03f4('0x4f')][_0x03f4('0x50')]?_0x3773f8[_0x03f4('0x4f')]:_0x45ee1c[_0x03f4('0x4d')];if(!_0x4b04f2[_0x03f4('0x49')][_0x03f4('0x69')](_0x03f4('0x51'))){_0x3773f8[_0x03f4('0x2b')]=qs['limit'](_0x4b04f2['query'][_0x03f4('0x2b')]);_0x3773f8[_0x03f4('0x2d')]=qs[_0x03f4('0x2d')](_0x4b04f2[_0x03f4('0x49')][_0x03f4('0x2d')]);}_0x3773f8[_0x03f4('0x52')]=qs[_0x03f4('0x53')](_0x4b04f2['query'][_0x03f4('0x53')]);_0x3773f8[_0x03f4('0x55')]=qs[_0x03f4('0x4b')](_['pick'](_0x4b04f2['query'],_0x45ee1c[_0x03f4('0x4b')]));_0x3773f8['where'][_0x03f4('0x67')]=_0xd4cb1c['id'];if(_0x4b04f2['query']['filter']){_0x3773f8[_0x03f4('0x55')]=_[_0x03f4('0x3d')](_0x3773f8['where'],{'$or':_['map'](_0x3773f8[_0x03f4('0x4f')],function(_0x5e14e7){var _0x1ac1c4={};_0x1ac1c4[_0x5e14e7]={'$like':'%'+_0x4b04f2['query'][_0x03f4('0x57')]+'%'};return _0x1ac1c4;})});}_0x3773f8=_['merge']({},_0x3773f8,_0x4b04f2['options']);return db['CannedAnswer']['count']({'where':_0x3773f8[_0x03f4('0x55')]})[_0x03f4('0x1e')](function(_0x1d78ea){_0x4720d8[_0x03f4('0x2c')]=_0x1d78ea;if(_0x4b04f2[_0x03f4('0x49')]['includeAll']){_0x3773f8[_0x03f4('0x5a')]=[{'all':!![]}];}return db[_0x03f4('0x6e')][_0x03f4('0x5b')](_0x3773f8);})[_0x03f4('0x1e')](function(_0x5a291d){_0x4720d8[_0x03f4('0x6a')]=_0x5a291d;return _0x4720d8;});}})['then'](respondWithFilteredResult(_0x339858,_0x3773f8))[_0x03f4('0x5c')](handleError(_0x339858,null));};exports[_0x03f4('0x71')]=function(_0x9a974f,_0x3ced47,_0x1dc581){return db['ChatWebsite'][_0x03f4('0x5e')]({'where':{'id':_0x9a974f[_0x03f4('0x64')]['id']}})[_0x03f4('0x1e')](handleEntityNotFound(_0x3ced47,null))[_0x03f4('0x1e')](function(_0x3bb4f1){if(_0x3bb4f1){return _0x3bb4f1[_0x03f4('0x71')](_0x9a974f[_0x03f4('0x49')][_0x03f4('0x6c')]);}})['then'](respondWithStatusCode(_0x3ced47,null))['catch'](handleError(_0x3ced47,null));};exports['addLogo']=function(_0x350fbb,_0x861226,_0x153264){_0x350fbb[_0x03f4('0x3e')][_0x03f4('0x72')]=_0x350fbb[_0x03f4('0x73')][_0x03f4('0x74')];return db['ChatWebsite'][_0x03f4('0x5e')]({'where':{'id':_0x350fbb['params']['id']}})[_0x03f4('0x1e')](handleEntityNotFound(_0x861226,null))['then'](saveUpdates(_0x350fbb[_0x03f4('0x3e')],null))[_0x03f4('0x1e')](respondWithResult(_0x861226,null))[_0x03f4('0x5c')](handleError(_0x861226,null));};exports[_0x03f4('0x75')]=function(_0x1a4b3c,_0x270867,_0x56cc79){_0x1a4b3c['body'][_0x03f4('0x76')]=_0x1a4b3c['file'][_0x03f4('0x74')];return db['ChatWebsite'][_0x03f4('0x5e')]({'where':{'id':_0x1a4b3c[_0x03f4('0x64')]['id']}})[_0x03f4('0x1e')](handleEntityNotFound(_0x270867,null))['then'](saveUpdates(_0x1a4b3c[_0x03f4('0x3e')],null))[_0x03f4('0x1e')](respondWithResult(_0x270867,null))[_0x03f4('0x5c')](handleError(_0x270867,null));};exports[_0x03f4('0x77')]=function(_0x3f23b4,_0x4f7ce4,_0x2067f1){_0x3f23b4[_0x03f4('0x3e')][_0x03f4('0x78')]=_0x3f23b4[_0x03f4('0x73')]['filename'];return db[_0x03f4('0x45')][_0x03f4('0x5e')]({'where':{'id':_0x3f23b4['params']['id']}})[_0x03f4('0x1e')](handleEntityNotFound(_0x4f7ce4,null))[_0x03f4('0x1e')](saveUpdates(_0x3f23b4[_0x03f4('0x3e')],null))[_0x03f4('0x1e')](respondWithResult(_0x4f7ce4,null))['catch'](handleError(_0x4f7ce4,null));};exports[_0x03f4('0x79')]=function(_0x4847c3,_0x257d2c,_0x22aae8){_0x4847c3[_0x03f4('0x3e')]['systemAvatar']=_0x4847c3[_0x03f4('0x73')]['filename'];return db[_0x03f4('0x45')][_0x03f4('0x5e')]({'where':{'id':_0x4847c3['params']['id']}})[_0x03f4('0x1e')](handleEntityNotFound(_0x257d2c,null))[_0x03f4('0x1e')](saveUpdates(_0x4847c3[_0x03f4('0x3e')],null))[_0x03f4('0x1e')](respondWithResult(_0x257d2c,null))[_0x03f4('0x5c')](handleError(_0x257d2c,null));};exports[_0x03f4('0x7a')]=function(_0x9ba660,_0x3add8a,_0x3d36dd){var _0x41b5d6=path[_0x03f4('0x7b')](config[_0x03f4('0x7c')],'server/files/images/logos/default_logo.svg');var _0x4198bd={'where':{'id':_0x9ba660[_0x03f4('0x64')]['id']},'attributes':['id',_0x03f4('0x72')],'raw':!![]};var _0x2d63fd=![];return require(_0x03f4('0x7d'))[_0x03f4('0x7e')]()[_0x03f4('0x1e')](function(_0x656efe){if(_0x656efe){_0x2d63fd=_0x656efe['custom'];}})['then'](function(){return db[_0x03f4('0x45')][_0x03f4('0x5e')](_0x4198bd);})['then'](handleEntityNotFound(_0x3add8a,null))[_0x03f4('0x1e')](function(_0xd0b93d){if(_0xd0b93d){if(!_[_0x03f4('0x7f')](_0xd0b93d[_0x03f4('0x72')])){if(fs[_0x03f4('0x80')](path[_0x03f4('0x7b')](config[_0x03f4('0x7c')],_0x03f4('0x81'),_0xd0b93d[_0x03f4('0x72')]))&&_0x2d63fd){_0x41b5d6=path[_0x03f4('0x7b')](config['root'],'server/files/images/logos/',_0xd0b93d[_0x03f4('0x72')]);}}return _0x3add8a[_0x03f4('0x82')](_0x41b5d6);}})[_0x03f4('0x5c')](handleError(_0x3add8a,null));};exports[_0x03f4('0x83')]=function(_0xea2207,_0x12af53,_0x3966db){var _0x3fc9d4=path['join'](config[_0x03f4('0x7c')],_0x03f4('0x84'));var _0x3377f1={'where':{'id':_0xea2207[_0x03f4('0x64')]['id']},'attributes':['id',_0x03f4('0x76')],'raw':!![]};return db[_0x03f4('0x45')][_0x03f4('0x5e')](_0x3377f1)[_0x03f4('0x1e')](handleEntityNotFound(_0x12af53,null))[_0x03f4('0x1e')](function(_0x3a2161){if(_0x3a2161){if(!_[_0x03f4('0x7f')](_0x3a2161[_0x03f4('0x76')])){if(fs['existsSync'](path['join'](config['root'],_0x03f4('0x85'),_0x3a2161[_0x03f4('0x76')]))){_0x3fc9d4=path[_0x03f4('0x7b')](config['root'],'server/files/images/avatars/',_0x3a2161['agentAvatar']);}}return _0x12af53[_0x03f4('0x82')](_0x3fc9d4);}})['catch'](handleError(_0x12af53,null));};exports[_0x03f4('0x86')]=function(_0x5942ff,_0x3b7ab9,_0x3736f1){var _0x4225f7=path[_0x03f4('0x7b')](config[_0x03f4('0x7c')],_0x03f4('0x87'));var _0x211fa3={'where':{'id':_0x5942ff[_0x03f4('0x64')]['id']},'attributes':['id',_0x03f4('0x78'),_0x03f4('0x88')],'raw':!![]};return db[_0x03f4('0x45')]['find'](_0x211fa3)[_0x03f4('0x1e')](handleEntityNotFound(_0x3b7ab9,null))[_0x03f4('0x1e')](function(_0x304800){if(_0x304800){if(!_[_0x03f4('0x7f')](_0x304800[_0x03f4('0x78')])){if(fs[_0x03f4('0x80')](path[_0x03f4('0x7b')](config[_0x03f4('0x7c')],_0x03f4('0x85'),_0x304800[_0x03f4('0x78')]))&&_0x304800['showCustomerAvatar']){_0x4225f7=path['join'](config[_0x03f4('0x7c')],_0x03f4('0x85'),_0x304800[_0x03f4('0x78')]);}}return _0x3b7ab9[_0x03f4('0x82')](_0x4225f7);}})[_0x03f4('0x5c')](handleError(_0x3b7ab9,null));};exports[_0x03f4('0x89')]=function(_0xcbf157,_0x225c34,_0x231438){var _0xf91bf6=path[_0x03f4('0x7b')](config[_0x03f4('0x7c')],_0x03f4('0x8a'));var _0x3cf212={'where':{'id':_0xcbf157[_0x03f4('0x64')]['id']},'attributes':['id',_0x03f4('0x8b')],'raw':!![]};return db['ChatWebsite'][_0x03f4('0x5e')](_0x3cf212)[_0x03f4('0x1e')](handleEntityNotFound(_0x225c34,null))[_0x03f4('0x1e')](function(_0x2d8ece){if(_0x2d8ece){if(!_[_0x03f4('0x7f')](_0x2d8ece[_0x03f4('0x8b')])){if(fs['existsSync'](path['join'](config[_0x03f4('0x7c')],_0x03f4('0x85'),_0x2d8ece[_0x03f4('0x8b')]))){_0xf91bf6=path[_0x03f4('0x7b')](config[_0x03f4('0x7c')],_0x03f4('0x85'),_0x2d8ece[_0x03f4('0x8b')]);}}return _0x225c34[_0x03f4('0x82')](_0xf91bf6);}})['catch'](handleError(_0x225c34,null));};exports[_0x03f4('0x8c')]=function(_0x639336,_0x5a019e,_0x5d1461){var _0x561170=require(_0x03f4('0x8d'));var _0x248fc7=new _0x561170();var _0x595ccc=_0x248fc7[_0x03f4('0x8e')](_0x639336[_0x03f4('0x8f')][_0x03f4('0x90')])['getResult']();var _0x3bf50f={'body':_0x639336[_0x03f4('0x3e')],'channel':_0x03f4('0x91')};var _0xe59123=[];var _0x3b7ada=[];var _0x183740={};var _0x324fe0=![];return db[_0x03f4('0x92')][_0x03f4('0x65')]()['then'](function(_0x3770bc){if(!_0x3770bc){throw new db[(_0x03f4('0x93'))][(_0x03f4('0x94'))](_0x03f4('0x95'));}_0xe59123=_[_0x03f4('0x96')](_[_0x03f4('0x4a')](_0x3770bc),['createdAt','updatedAt']);_0x3b7ada=_['difference'](_[_0x03f4('0x4a')](_0x3770bc),['createdAt',_0x03f4('0x97'),'CompanyId',_0x03f4('0x98')]);if(_0x639336[_0x03f4('0x3e')]['id']){delete _0x639336[_0x03f4('0x3e')]['id'];}if(_['isNil'](_0x639336[_0x03f4('0x3e')][_0x03f4('0x99')])){throw new db['Sequelize'][(_0x03f4('0x94'))](_0x03f4('0x9a'));}if(_['isNil'](_0x639336[_0x03f4('0x3e')][_0x03f4('0x3e')])||_0x639336[_0x03f4('0x3e')][_0x03f4('0x3e')]===''){throw new db['Sequelize'][(_0x03f4('0x94'))](_0x03f4('0x9b'));}if(_[_0x03f4('0x7f')](_0x639336[_0x03f4('0x3e')][_0x03f4('0x9c')])){throw new db[(_0x03f4('0x93'))][(_0x03f4('0x94'))](_0x03f4('0x9d')+_0x3b7ada);}if(!_[_0x03f4('0x9e')](_0x3b7ada,_0x639336['body'][_0x03f4('0x9c')])){throw new db[(_0x03f4('0x93'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3b7ada);}_0x183740[_0x639336[_0x03f4('0x3e')]['mapKey']]=_0x639336['body'][_0x03f4('0x99')];})[_0x03f4('0x1e')](function(){return db[_0x03f4('0x45')]['find']({'where':{'id':_0x639336[_0x03f4('0x64')]['id']},'include':[{'model':db[_0x03f4('0x9f')],'as':_0x03f4('0xa0'),'include':[{'model':db[_0x03f4('0x92')],'as':_0x03f4('0xa1'),'where':_0x183740,'limit':0x1,'order':[[_0x03f4('0x97'),_0x03f4('0xa2')]]}]},{'model':db[_0x03f4('0xa3')],'as':_0x03f4('0xa4')}]});})[_0x03f4('0x1e')](handleEntityNotFound(_0x5a019e,null))['then'](function(_0x4b2524){if(_0x4b2524&&_0x4b2524['List']){_0x3bf50f[_0x03f4('0x41')]=_0x4b2524;_0x3bf50f[_0x03f4('0xa5')]=_0x4b2524[_0x03f4('0xa4')];_0x3bf50f[_0x03f4('0xa6')]=_0x4b2524[_0x03f4('0xa0')];_0x3bf50f[_0x03f4('0xa5')]=_[_0x03f4('0xa7')](_0x3bf50f['applications'],[_0x03f4('0xa8')],[_0x03f4('0xa9')]);if(_0x3bf50f['account'][_0x03f4('0xa4')]){delete _0x3bf50f[_0x03f4('0x41')][_0x03f4('0xa4')];}if(_0x3bf50f[_0x03f4('0x41')][_0x03f4('0xa0')]&&_0x3bf50f[_0x03f4('0x41')][_0x03f4('0xa0')][_0x03f4('0xa1')]['length']){return _0x3bf50f['account']['List']['Contacts'][0x0];}var _0x2f9181=_[_0x03f4('0x17')](_0x639336['body'],{'firstName':_0x639336[_0x03f4('0x3e')][_0x03f4('0x99')],'ListId':_0x4b2524[_0x03f4('0x98')]});_0x2f9181[_0x639336[_0x03f4('0x3e')][_0x03f4('0x9c')]]=_0x639336['body'][_0x03f4('0x99')];return db[_0x03f4('0x92')][_0x03f4('0x5f')](_0x2f9181,{'fields':_0xe59123,'raw':!![]});}})[_0x03f4('0x1e')](handleEntityNotFound(_0x5a019e,null))[_0x03f4('0x1e')](function(_0x141b85){_0x3bf50f[_0x03f4('0x3f')]=_0x141b85;var _0x2fda67=_0x639336[_0x03f4('0x3e')][_0x03f4('0xaa')];if(_0x639336['headers'][_0x03f4('0xab')]){_0x2fda67=_0x639336[_0x03f4('0x8f')][_0x03f4('0xab')];}else if(_0x639336[_0x03f4('0x8f')][_0x03f4('0xac')]){_0x2fda67=_['first'](_0x639336[_0x03f4('0x8f')]['x-forwarded-for'][_0x03f4('0xad')](','));}if(_0x141b85){var _0x52c23f={'ContactId':_0x141b85['id'],'ChatWebsiteId':_0x639336[_0x03f4('0x64')]['id'],'from':(_0x141b85[_0x03f4('0xae')]||'')+'\x20'+(_0x141b85['lastName']||''),'customerIp':_0x2fda67,'customerPort':_0x639336[_0x03f4('0x8f')][_0x03f4('0xaf')]?_0x639336[_0x03f4('0x8f')][_0x03f4('0xaf')]:null,'referer':_0x639336[_0x03f4('0x3e')][_0x03f4('0xb0')],'browserName':_0x595ccc[_0x03f4('0xb1')][_0x03f4('0x3a')]&&_0x595ccc[_0x03f4('0xb1')][_0x03f4('0xb2')]?util[_0x03f4('0xb3')](_0x03f4('0xb4'),_0x595ccc[_0x03f4('0xb1')][_0x03f4('0x3a')],_0x595ccc[_0x03f4('0xb1')][_0x03f4('0xb2')]):_0x03f4('0xb5'),'browserVersion':_0x595ccc['browser'][_0x03f4('0xb2')]||_0x03f4('0xb5'),'osName':util[_0x03f4('0xb3')](_0x03f4('0xb4'),_0x595ccc['os'][_0x03f4('0x3a')],_0x595ccc['os'][_0x03f4('0xb2')]),'osVersion':_0x595ccc['os'][_0x03f4('0xb2')],'deviceModel':_0x595ccc[_0x03f4('0xb6')][_0x03f4('0x4d')]&&_0x595ccc[_0x03f4('0xb6')][_0x03f4('0xb7')]?util[_0x03f4('0xb3')](_0x03f4('0xb8'),_0x595ccc[_0x03f4('0xb6')][_0x03f4('0x4d')],_0x595ccc[_0x03f4('0xb6')][_0x03f4('0xb7')],_0x595ccc[_0x03f4('0xb6')][_0x03f4('0x56')]):null,'deviceVendor':_0x595ccc[_0x03f4('0xb6')][_0x03f4('0xb7')],'deviceType':_0x595ccc[_0x03f4('0xb6')][_0x03f4('0x56')],'formData':JSON['stringify'](_0x639336[_0x03f4('0x3e')])};var _0x127d62={'ChatWebsiteId':_0x639336['params']['id'],'closed':![]};if(_0x639336['body']['threadId']){_0x127d62['threadId']=_0x639336[_0x03f4('0x3e')][_0x03f4('0xb9')];return db[_0x03f4('0xba')][_0x03f4('0x5e')]({'where':_0x127d62})['then'](function(_0x1751b4){if(_0x1751b4){return[_0x1751b4,![]];}_0x52c23f[_0x03f4('0xb9')]=_0x639336['body'][_0x03f4('0xb9')];_0x52c23f['externalUrl']=_0x639336[_0x03f4('0x3e')]['externalUrl'];return db['ChatInteraction']['create'](_0x52c23f)[_0x03f4('0x1e')](function(_0x2932c4){return[_0x2932c4,!![]];});});}_0x127d62[_0x03f4('0xbb')]=_0x141b85['id'];if(_0x639336[_0x03f4('0x3e')]['interaction']&&_0x639336[_0x03f4('0x3e')][_0x03f4('0x40')]['id']){_0x127d62['id']=_0x639336[_0x03f4('0x3e')][_0x03f4('0x40')]['id'];return db[_0x03f4('0xba')][_0x03f4('0x5e')]({'where':_0x127d62})[_0x03f4('0x1e')](function(_0x2028b8){if(_0x2028b8){return[_0x2028b8,![]];}return db[_0x03f4('0xba')]['create'](_0x52c23f)[_0x03f4('0x1e')](function(_0x5e6703){return[_0x5e6703,!![]];});});}return db['ChatInteraction'][_0x03f4('0x5f')](_0x52c23f)['then'](function(_0x2a69e3){return[_0x2a69e3,!![]];});}})[_0x03f4('0xbc')](function(_0xfb3a0f,_0x49817d){if(_0xfb3a0f){_0x324fe0=_0x49817d;if(!_0x49817d){var _0x5e752b={'from':(_0x3bf50f[_0x03f4('0x3f')]['firstName']||'')+'\x20'+(_0x3bf50f['contact'][_0x03f4('0xbd')]||'')};if(_0x639336['body'][_0x03f4('0xb9')]&&_0x639336[_0x03f4('0x3e')][_0x03f4('0xbe')]&&_0x639336[_0x03f4('0x3e')]['threadId']!=_0x639336[_0x03f4('0x3e')]['messageId']){_0x5e752b[_0x03f4('0xb9')]=_0x639336['body'][_0x03f4('0xbe')];}return _0xfb3a0f['update'](_0x5e752b);}else{return _0xfb3a0f;}}})[_0x03f4('0x1e')](function(_0x165e51){_0x3bf50f[_0x03f4('0x40')]=_0x165e51['get']({'plain':!![]});_0x3bf50f[_0x03f4('0x40')][_0x03f4('0xbf')]=_0x324fe0;if(_0x3bf50f[_0x03f4('0x40')][_0x03f4('0xbf')]){if(_0x3bf50f[_0x03f4('0x41')][_0x03f4('0xc0')]){_0x3bf50f[_0x03f4('0xa5')][_0x03f4('0xc1')]({'id':0x0,'priority':_0x3bf50f[_0x03f4('0xa5')]['length']+0x1,'app':_0x03f4('0xc2'),'appdata':_0x03f4('0xc3'),'interval':'*,*,*,*'});}}return db[_0x03f4('0xc4')][_0x03f4('0x5f')]({'body':_0x639336[_0x03f4('0x3e')]['body'],'ChatWebsiteId':_0x639336[_0x03f4('0x64')]['id'],'ChatInteractionId':_0x165e51['id'],'direction':'in','ContactId':_0x3bf50f[_0x03f4('0x3f')]['id'],'AttachmentId':_0x639336[_0x03f4('0x3e')][_0x03f4('0xc5')]});})['then'](function(_0x5e135c){_0x3bf50f[_0x03f4('0x26')]=_0x5e135c;if(_0x3bf50f[_0x03f4('0x40')][_0x03f4('0xc6')]){return db[_0x03f4('0xc7')][_0x03f4('0x5e')]({'attributes':['id',_0x03f4('0x3a')],'where':{'id':_0x3bf50f['interaction'][_0x03f4('0xc6')]}})['then'](function(_0x2c1504){if(_0x2c1504){_0x3bf50f['applications'][_0x03f4('0xc8')]({'id':0x0,'priority':0x0,'app':_0x03f4('0xc9'),'appdata':_0x2c1504['name']+','+(_0x3bf50f['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x3bf50f[_0x03f4('0xca')]=!![];}return respondWithRpcPromise(_0x03f4('0xcb'),_0x03f4('0xcc'),_0x3bf50f);});}return respondWithRpcPromise(_0x03f4('0xcb'),'startRouting',_0x3bf50f);})[_0x03f4('0x1e')](function(_0x1234da){respondWithRpcPromise(_0x03f4('0xcd'),'EventManager',{'event':_0x03f4('0x8c'),'message':_0x1234da},client9002);return _0x1234da;})['then'](respondWithResult(_0x5a019e,null))[_0x03f4('0x5c')](handleError(_0x5a019e,null));};exports[_0x03f4('0xce')]=function(_0x2fb01e,_0x1cabb4,_0x455828){var _0x19f62e,_0x55517d,_0x4e01ae;var _0x4de400=[];var _0x3c3648=[];var _0xd96f25={};var _0x2b1935=_0x2fb01e['files']||[];var _0x2956ed=[];var _0xd32b80;return db[_0x03f4('0x92')][_0x03f4('0x65')]()[_0x03f4('0x1e')](function(_0x2bd15b){if(!_0x2bd15b){throw new db[(_0x03f4('0x93'))][(_0x03f4('0x94'))](_0x03f4('0x95'));}_0x3c3648=_[_0x03f4('0x96')](_[_0x03f4('0x4a')](_0x2bd15b),[_0x03f4('0xcf'),_0x03f4('0x97')]);_0x4de400=_['difference'](_['keys'](_0x2bd15b),[_0x03f4('0xcf'),_0x03f4('0x97'),_0x03f4('0xd0'),_0x03f4('0x98')]);if(_0x2fb01e[_0x03f4('0x3e')]['id']){delete _0x2fb01e[_0x03f4('0x3e')]['id'];}if(_[_0x03f4('0x7f')](_0x2fb01e['body'][_0x03f4('0x99')])){throw _0x1cabb4[_0x03f4('0x28')](0x1f4)[_0x03f4('0x3b')](new db['Sequelize'][(_0x03f4('0x94'))]('from\x20is\x20mandatory'));}if(_[_0x03f4('0x7f')](_0x2fb01e[_0x03f4('0x3e')][_0x03f4('0x3e')])||_0x2fb01e[_0x03f4('0x3e')][_0x03f4('0x3e')]===''){throw _0x1cabb4['status'](0x1f4)[_0x03f4('0x3b')](new db[(_0x03f4('0x93'))]['ValidationError'](_0x03f4('0x9b')));}if(_[_0x03f4('0x7f')](_0x2fb01e[_0x03f4('0x3e')]['mapKeyOffline'])){throw _0x1cabb4[_0x03f4('0x28')](0x1f4)['send'](new db[(_0x03f4('0x93'))][(_0x03f4('0x94'))](_0x03f4('0xd1')+_0x4de400));}if(!_['includes'](_0x4de400,_0x2fb01e[_0x03f4('0x3e')][_0x03f4('0xd2')])){throw _0x1cabb4[_0x03f4('0x28')](0x1f4)[_0x03f4('0x3b')](new db[(_0x03f4('0x93'))][(_0x03f4('0x94'))](_0x03f4('0xd3')+_0x4de400));}_0xd96f25[_0x2fb01e[_0x03f4('0x3e')]['mapKeyOffline']]=_0x2fb01e['body'][_0x03f4('0x99')];})[_0x03f4('0x1e')](function(){return db['ChatWebsite'][_0x03f4('0x5e')]({'where':{'id':_0x2fb01e[_0x03f4('0x64')]['id']},'include':[{'model':db[_0x03f4('0x9f')],'as':_0x03f4('0xa0')},{'model':db[_0x03f4('0xd4')],'as':_0x03f4('0xd4')}]});})[_0x03f4('0x1e')](handleEntityNotFound(_0x1cabb4,null))[_0x03f4('0x1e')](function(_0x5c8781){if(_0x5c8781&&_0x5c8781[_0x03f4('0xa0')]){_0x55517d=_0x5c8781;var _0x34821a=_['defaults'](_0x2fb01e[_0x03f4('0x3e')],{'firstName':_0x2fb01e[_0x03f4('0x3e')]['from'],'phone':_0x2fb01e[_0x03f4('0x3e')][_0x03f4('0x99')],'ListId':_0x5c8781['ListId']});_0x34821a[_0x2fb01e[_0x03f4('0x3e')][_0x03f4('0xd2')]]=_0x2fb01e[_0x03f4('0x3e')]['from'];return db[_0x03f4('0x92')][_0x03f4('0xd5')]({'where':_0xd96f25,'defaults':_0x34821a});}})['spread'](function(_0x45251e){if(_0x45251e){_0x4e01ae=_0x45251e;var _0x9262c4=fs['readFileSync'](path[_0x03f4('0x7b')](config[_0x03f4('0x7c')],_0x03f4('0xd6')),_0x03f4('0xd7'));var _0x4fa94a=ejs['render'](_0x9262c4,{'body':_[_0x03f4('0xd8')](_0x2fb01e[_0x03f4('0x3e')][_0x03f4('0x3e')]),'bodyTitle':_0x55517d[_0x03f4('0xd9')]});return db[_0x03f4('0xda')][_0x03f4('0x5f')]({'body':_0x4fa94a,'ContactId':_0x45251e['id'],'ChatWebsiteId':_0x55517d['id']});}})[_0x03f4('0x1e')](function(_0x10c92e){_0xd32b80=_0x10c92e;if(_0x2b1935[_0x03f4('0x50')]){var _0xeb24d=_0x2b1935[_0x03f4('0x48')](function(_0x43379e){return{'name':_0x43379e['originalname'],'basename':_0x43379e['filename'],'type':_0x43379e['mimetype'],'ChatOfflineMessageId':_0x10c92e['id']};});_0x2956ed=_0xeb24d[_0x03f4('0x48')](_0x40799b=>{var _0x3fbcf4={'filename':_0x40799b[_0x03f4('0x3a')],'path':path['join'](config['root'],_0x03f4('0xdb'),_0x03f4('0xdc'),_0x03f4('0xdd'),_0x03f4('0xde'),_0x40799b[_0x03f4('0xdf')])};return _0x3fbcf4;});if(!_0x55517d[_0x03f4('0xe0')]){return db[_0x03f4('0xe1')][_0x03f4('0xe2')](function(_0x1b9d16){return db['Attachment'][_0x03f4('0xe3')](_0xeb24d,{'transaction':_0x1b9d16});});}}})[_0x03f4('0x1e')](function(){if(_0xd32b80){_0x19f62e=_0xd32b80;return db['MailAccount'][_0x03f4('0x70')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})['then'](function(_0x50b274){if(_0x50b274&&_0x50b274['Smtp']&&_0x55517d['forwardOffline']&&_0x55517d[_0x03f4('0xe4')]){var _0x540a14={'tls':{'rejectUnauthorized':![]}};if(_0x50b274[_0x03f4('0xe5')][_0x03f4('0xe6')]){_0x540a14[_0x03f4('0xe6')]=_0x50b274[_0x03f4('0xe5')]['service'];}else{_0x540a14[_0x03f4('0xe7')]=_0x50b274[_0x03f4('0xe5')][_0x03f4('0xe7')];_0x540a14[_0x03f4('0xe8')]=_0x50b274[_0x03f4('0xe5')][_0x03f4('0xe8')];_0x540a14[_0x03f4('0xe9')]=_0x50b274['Smtp']['secure'];}if(_0x50b274['Smtp'][_0x03f4('0xea')]){_0x540a14['auth']={'user':_0x50b274['Smtp'][_0x03f4('0x60')],'pass':_0x50b274[_0x03f4('0xe5')][_0x03f4('0xeb')]};}return respondWithRpcPromise(_0x03f4('0xec'),_0x03f4('0xed'),{'account':_0x540a14,'message':{'from':util['format'](_0x03f4('0xee'),_0x50b274[_0x03f4('0x3a')],_0x50b274[_0x03f4('0xef')]||_0x50b274[_0x03f4('0xe5')][_0x03f4('0x60')]),'to':_0x55517d[_0x03f4('0xe4')],'subject':_0x55517d[_0x03f4('0xf0')],'html':_0x19f62e[_0x03f4('0x3e')],'attachments':_0x2956ed}},client9003)[_0x03f4('0x1e')](function(){return _0x19f62e;})[_0x03f4('0x5c')](function(_0x2f8b95){console['error'](_0x2f8b95);});}})[_0x03f4('0x1e')](function(){if(_0x55517d&&_0x55517d[_0x03f4('0xe0')]&&_0x55517d['MailAccountId']){var _0x422f3e=[];if(_0x2b1935[_0x03f4('0x50')]){_0x422f3e=_0x2b1935[_0x03f4('0x48')](function(_0xe1a8c6){return{'name':_0xe1a8c6['originalname'],'basename':_0xe1a8c6[_0x03f4('0x74')],'type':_0xe1a8c6['mimetype'],'ChatOfflineMessageId':_0xd32b80['id']};});}var _0x350632;if(!_[_0x03f4('0x7f')](_0x55517d[_0x03f4('0xf1')])){var _0x207c57=_['map'](_0x2fb01e['body'],function(_0x3d026b){return _0x3d026b;});var _0x51afa0=_[_0x03f4('0xf2')](_0x207c57)[0x0];var _0x3d32fb=_[_0x03f4('0xf3')](_0x51afa0,function(_0x13b3a1){return _0x13b3a1;});_0x350632=_0x3d32fb[0x1][_0x55517d['subjectOffline']];}var _0x40254f={'from':_0x4e01ae[_0x03f4('0xef')],'firstName':_0x4e01ae[_0x03f4('0xae')],'lastName':_0x4e01ae['lastName'],'mapKey':_0x03f4('0xef'),'message':{'from':_0x4e01ae['email'],'to':_0x55517d['MailAccount']['email'],'cc':'','subject':_[_0x03f4('0x7f')](_0x350632)?_0x55517d['offlineMessageSubject']:_0x350632,'messageId':'','sentAt':new Date(),'attach':_0x422f3e['length'],'attachments':_0x422f3e,'originChannel':_0x03f4('0xf4'),'ChatWebsiteId':_0x55517d['id'],'ChatOfflineMessageId':_0x19f62e['id'],'originTo':_0x55517d[_0x03f4('0xd4')][_0x03f4('0xef')]},'body':_0x19f62e[_0x03f4('0x3e')]};var _0x3b8544={'account':{'id':_0x55517d[_0x03f4('0xf5')]},'body':_0x40254f,'log':_0x03f4('0xf6')};return respondWithRpcPromise(_0x03f4('0xf6'),_0x03f4('0xf7'),_0x3b8544,client9001)[_0x03f4('0x1e')](function(){return _0x19f62e;})[_0x03f4('0x5c')](function(_0x4b96ee){console['error'](_0x4b96ee);});}return;})[_0x03f4('0x1e')](function(){if(_0x19f62e){return _0x19f62e;}})[_0x03f4('0x1e')](respondWithResult(_0x1cabb4,null))[_0x03f4('0x5c')](function(_0x13b4b8){console[_0x03f4('0x24')](_0x03f4('0x5c'),_0x13b4b8);for(var _0x4d7576 of _0x2b1935){var _0x3ba128=path[_0x03f4('0x7b')](config[_0x03f4('0x7c')],_0x03f4('0xdb'),_0x03f4('0xdc'),_0x03f4('0xdd'),_0x03f4('0xde'),_0x4d7576[_0x03f4('0x74')]);fs_extra[_0x03f4('0xf8')](_0x3ba128)[_0x03f4('0x5c')](function(_0x18d092){console[_0x03f4('0x24')](_0x03f4('0xf9'),_0x3ba128,_0x18d092);});}});};exports[_0x03f4('0xfa')]=function(_0x52487c,_0x5eedfd,_0x2543cb){return db[_0x03f4('0xba')][_0x03f4('0x5e')]({'where':{'id':_0x52487c[_0x03f4('0x64')]['id']}})['then'](handleEntityNotFound(_0x5eedfd,null))['then'](function(_0x4759c4){if(_0x4759c4){return _0x4759c4[_0x03f4('0xfa')](_0x52487c[_0x03f4('0x3e')][_0x03f4('0x6c')],_[_0x03f4('0xfb')](_0x52487c[_0x03f4('0x3e')],[_0x03f4('0x6c'),'id'])||{});}})[_0x03f4('0x1e')](respondWithResult(_0x5eedfd,null))[_0x03f4('0x5c')](handleError(_0x5eedfd,null));};exports[_0x03f4('0xfc')]=function(_0x1538d1,_0x86c6a8,_0x54ab24){var _0x3288ac={'raw':![],'where':{}};var _0x5f156b={};var _0x2edcb5={'count':0x0,'rows':[]};return db[_0x03f4('0x45')]['findOne']({'where':{'id':_0x1538d1[_0x03f4('0x64')]['id']}})[_0x03f4('0x1e')](handleEntityNotFound(_0x86c6a8,null))[_0x03f4('0x1e')](function(_0x12322a){if(_0x12322a){_0x5f156b['model']=_[_0x03f4('0x4a')](db[_0x03f4('0xba')][_0x03f4('0x46')]);_0x5f156b['query']=_[_0x03f4('0x4a')](_0x1538d1[_0x03f4('0x49')]);_0x5f156b[_0x03f4('0x4b')]=_[_0x03f4('0x4c')](_0x5f156b[_0x03f4('0x4d')],_0x5f156b[_0x03f4('0x49')]);_0x3288ac[_0x03f4('0x4f')]=_[_0x03f4('0x4c')](_0x5f156b[_0x03f4('0x4d')],qs[_0x03f4('0x4e')](_0x1538d1['query'][_0x03f4('0x4e')]));_0x3288ac[_0x03f4('0x4f')]=_0x3288ac['attributes'][_0x03f4('0x50')]?_0x3288ac[_0x03f4('0x4f')]:_0x5f156b[_0x03f4('0x4d')];if(!_0x1538d1['query'][_0x03f4('0x69')](_0x03f4('0x51'))){_0x3288ac['limit']=qs['limit'](_0x1538d1['query']['limit']);_0x3288ac[_0x03f4('0x2d')]=qs[_0x03f4('0x2d')](_0x1538d1[_0x03f4('0x49')][_0x03f4('0x2d')]);}_0x3288ac[_0x03f4('0x52')]=qs[_0x03f4('0x53')](_0x1538d1['query'][_0x03f4('0x53')]);_0x3288ac[_0x03f4('0x55')]=qs[_0x03f4('0x4b')](_[_0x03f4('0x54')](_0x1538d1[_0x03f4('0x49')],_0x5f156b[_0x03f4('0x4b')]));_0x3288ac['where'][_0x03f4('0x67')]=_0x12322a['id'];if(_0x1538d1['query']['filter']){_0x3288ac['where']=_['merge'](_0x3288ac[_0x03f4('0x55')],{'$or':_[_0x03f4('0x48')](_0x3288ac[_0x03f4('0x4f')],function(_0x5608c6){var _0x35517b={};_0x35517b[_0x5608c6]={'$like':'%'+_0x1538d1['query']['filter']+'%'};return _0x35517b;})});}_0x3288ac=_[_0x03f4('0x3d')]({},_0x3288ac,_0x1538d1[_0x03f4('0x58')]);return db[_0x03f4('0xba')][_0x03f4('0x2c')]({'where':_0x3288ac[_0x03f4('0x55')]})[_0x03f4('0x1e')](function(_0x35f036){_0x2edcb5['count']=_0x35f036;if(_0x1538d1[_0x03f4('0x49')]['includeAll']){_0x3288ac[_0x03f4('0x5a')]=[{'model':db[_0x03f4('0x92')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x03f4('0xfd'),'attributes':[_0x03f4('0x3a'),_0x03f4('0xfe'),_0x03f4('0xff')],'required':![]},{'model':db[_0x03f4('0x100')],'as':_0x03f4('0x101'),'attributes':['id','name',_0x03f4('0x102')],'where':_0x1538d1[_0x03f4('0x49')]['tag']?{'id':_0x1538d1[_0x03f4('0x49')][_0x03f4('0x103')]}:undefined,'required':_0x1538d1[_0x03f4('0x49')]['tag']?!![]:![]}];}return db[_0x03f4('0xba')]['findAll'](_0x3288ac);})[_0x03f4('0x1e')](function(_0x485f85){_0x2edcb5['rows']=_0x485f85;return _0x2edcb5;});}})[_0x03f4('0x1e')](respondWithFilteredResult(_0x86c6a8,_0x3288ac))[_0x03f4('0x5c')](handleError(_0x86c6a8,null));};function iftimePromise(_0x42aace,_0x2c20dc){return respondWithRpcPromise(_0x03f4('0x104'),'getSnippet',{'command':_0x2c20dc['timezone']?util[_0x03f4('0xb3')](_0x03f4('0x105'),_0x42aace[_0x03f4('0x106')],_0x2c20dc[_0x03f4('0x107')]):util[_0x03f4('0xb3')](_0x03f4('0x108'),_0x42aace[_0x03f4('0x106')])},client9002)[_0x03f4('0x1e')](function(_0x294c9e){var _0x21bba0=_0x294c9e&&_0x294c9e['indexOf'](_0x03f4('0x109'))>=0x0?!![]:![];logger[_0x03f4('0x1f')](_0x03f4('0x10a'),_0x2c20dc['id'],_0x42aace['id'],_0x42aace[_0x03f4('0x106')],_0x21bba0?'ONLINE':'OFFLINE',_0x2c20dc[_0x03f4('0x107')]?_0x2c20dc[_0x03f4('0x107')]:_0x03f4('0x10b'));return _0x21bba0;})[_0x03f4('0x5c')](function(_0x3df8d5){logger[_0x03f4('0x24')](_0x03f4('0x10a'),_0x2c20dc['id'],_0x42aace['id'],_0x42aace[_0x03f4('0x106')],util[_0x03f4('0x10c')](_0x3df8d5,{'showHidden':![],'depth':null}),_0x2c20dc[_0x03f4('0x107')]?_0x2c20dc['timezone']:_0x03f4('0x10b'));return![];});}exports[_0x03f4('0x10d')]=function(_0x2f9949,_0x111f5f,_0x2b8cea){var _0x2e0aa8=0x0;var _0x23d370=0x0;var _0x30ff0e=![];var _0x44451b;var _0x104cf2;return db[_0x03f4('0x45')]['find']({'where':{'id':_0x2f9949['params']['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x03f4('0x10e')],'as':_0x03f4('0x10f'),'attributes':['id',_0x03f4('0x106')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x111f5f,null))[_0x03f4('0x1e')](function(_0x1f7aa7){if(_0x1f7aa7){_0x44451b=_0x1f7aa7;return _0x1f7aa7['getProactiveActions']({'raw':!![]});}})[_0x03f4('0x1e')](function(_0x437212){if(_0x44451b){if(_0x437212){_0x104cf2=_0x437212;}}return require('../../config/license/util')['getLicense']();})[_0x03f4('0x1e')](function(_0x2fa960){if(_0x2fa960){_0x23d370=_0x2fa960[_0x03f4('0x110')];_0x30ff0e=_0x2fa960[_0x03f4('0x111')];}})[_0x03f4('0x1e')](function(){return db[_0x03f4('0xba')][_0x03f4('0x2c')]({'where':{'closed':![]}});})[_0x03f4('0x1e')](function(_0xbf88ef){_0x2e0aa8=_0xbf88ef;if(_0x23d370&&_0xbf88ef>_0x23d370){return db['License'][_0x03f4('0x70')]({'where':{'id':0x1}})[_0x03f4('0x1e')](function(_0x2d3100){if(_0x2d3100){_0x2d3100['increment'](_0x03f4('0x112'));}});}})[_0x03f4('0x1e')](function(){if(_0x44451b['Interval']&&_0x44451b['Interval']['Intervals']){var _0xd78f2b=[];for(var _0x4b5eb5=0x0;_0x4b5eb5<_0x44451b[_0x03f4('0x10e')]['Intervals'][_0x03f4('0x50')];_0x4b5eb5++){var _0x34428b=_0x44451b[_0x03f4('0x10e')][_0x03f4('0x10f')][_0x4b5eb5][_0x03f4('0x35')]({'plain':!![]});_0xd78f2b[_0x03f4('0xc1')](iftimePromise(_0x34428b,_0x44451b));}return BPromise[_0x03f4('0x113')](_0xd78f2b)[_0x03f4('0x1e')](function(_0x377073){return _[_0x03f4('0x114')](_0x377073);});}else{return!![];}})[_0x03f4('0x1e')](function(_0x456aa2){var _0x409135=fs[_0x03f4('0x115')](path[_0x03f4('0x7b')](config[_0x03f4('0x7c')],_0x03f4('0x116')),_0x03f4('0xd7'));var _0x4a902e={'remote':_0x44451b[_0x03f4('0x117')],'query':querystring[_0x03f4('0x23')](_[_0x03f4('0x3d')](_0x44451b[_0x03f4('0x35')]({'plain':!![]}),{'customerIp':_0x2f9949[_0x03f4('0x8f')][_0x03f4('0xac')]||_0x2f9949['headers']['x-real-ip']||_0x2f9949['connection']['remoteAddress']||_0x2f9949['ip'],'referer':_0x2f9949[_0x03f4('0x8f')][_0x03f4('0xb0')],'openedInteractions':_0x2e0aa8,'maxInteractions':_0x23d370,'virtual':_0x30ff0e[_0x03f4('0x110')],'online':_0x456aa2,'custom':_0x30ff0e}))[_0x03f4('0x118')](/'/g,'\x5c\x27')};_0x111f5f[_0x03f4('0x3b')](ejs['render'](Mustache[_0x03f4('0x3c')](_0x409135,_0x4a902e),{'proactiveActions':_0x104cf2,'alignment':_0x44451b['alignment'],'verticalAlignment':_0x44451b[_0x03f4('0x119')],'div_color':_0x44451b[_0x03f4('0x102')],'text_color':_0x44451b[_0x03f4('0x11a')],'button_color':_0x44451b[_0x03f4('0x11b')],'background_color':_0x44451b[_0x03f4('0x11c')]}));})['catch'](handleError(_0x111f5f,null));};exports['addApplications']=function(_0x47a1b9,_0x4d62e8,_0x115440){return db['ChatWebsite'][_0x03f4('0x70')]({'where':{'id':_0x47a1b9[_0x03f4('0x64')]['id']}})[_0x03f4('0x1e')](handleEntityNotFound(_0x4d62e8,null))['then'](function(_0x3e5e42){if(_0x3e5e42){return db[_0x03f4('0xe1')]['transaction'](function(_0x23c287){return db['ChatApplication'][_0x03f4('0x34')]({'where':{'ChatWebsiteId':_0x47a1b9['params']['id']},'transaction':_0x23c287})[_0x03f4('0x1e')](function(_0x5f1e12){var _0x5cdd12=_[_0x03f4('0x48')](_0x47a1b9['body'],function(_0x1f68a4){_0x1f68a4['ChatWebsiteId']=_0x47a1b9['params']['id'];return _0x1f68a4;});return db[_0x03f4('0xa3')][_0x03f4('0xe3')](_0x5cdd12,{'transaction':_0x23c287});});})['then'](function(){return db['ChatApplication'][_0x03f4('0x11d')]({'where':{'ChatWebsiteId':_0x47a1b9[_0x03f4('0x64')]['id']},'order':_0x03f4('0xa8')});});}})[_0x03f4('0x1e')](respondWithResult(_0x4d62e8,null))[_0x03f4('0x5c')](handleError(_0x4d62e8,null));};exports[_0x03f4('0x11e')]=function(_0x616bc9,_0x158eed,_0x5f4544){var _0x4c4f1b={};var _0x57ecd2={};var _0x3721e8;var _0x16d902;return db['ChatWebsite']['findOne']({'where':{'id':_0x616bc9['params']['id']}})[_0x03f4('0x1e')](handleEntityNotFound(_0x158eed,null))[_0x03f4('0x1e')](function(_0x2e18fb){if(_0x2e18fb){_0x3721e8=_0x2e18fb;_0x57ecd2[_0x03f4('0x4d')]=_[_0x03f4('0x4a')](db[_0x03f4('0xa3')][_0x03f4('0x46')]);_0x57ecd2[_0x03f4('0x49')]=_[_0x03f4('0x4a')](_0x616bc9[_0x03f4('0x49')]);_0x57ecd2[_0x03f4('0x4b')]=_[_0x03f4('0x4c')](_0x57ecd2['model'],_0x57ecd2[_0x03f4('0x49')]);_0x4c4f1b[_0x03f4('0x4f')]=_[_0x03f4('0x4c')](_0x57ecd2['model'],qs['fields'](_0x616bc9[_0x03f4('0x49')]['fields']));_0x4c4f1b['attributes']=_0x4c4f1b[_0x03f4('0x4f')][_0x03f4('0x50')]?_0x4c4f1b[_0x03f4('0x4f')]:_0x57ecd2['model'];_0x4c4f1b['order']=qs[_0x03f4('0x53')](_0x616bc9[_0x03f4('0x49')][_0x03f4('0x53')]);_0x4c4f1b[_0x03f4('0x55')]=qs['filters'](_[_0x03f4('0x54')](_0x616bc9[_0x03f4('0x49')],_0x57ecd2['filters']));if(_0x616bc9[_0x03f4('0x49')]['filter']){_0x4c4f1b[_0x03f4('0x55')]=_[_0x03f4('0x3d')](_0x4c4f1b[_0x03f4('0x55')],{'$or':_[_0x03f4('0x48')](_0x4c4f1b[_0x03f4('0x4f')],function(_0x2a4403){var _0x1b95f6={};_0x1b95f6[_0x2a4403]={'$like':'%'+_0x616bc9[_0x03f4('0x49')]['filter']+'%'};return _0x1b95f6;})});}_0x4c4f1b=_[_0x03f4('0x3d')]({},_0x4c4f1b,_0x616bc9[_0x03f4('0x58')]);return _0x3721e8[_0x03f4('0x11e')](_0x4c4f1b);}})[_0x03f4('0x1e')](function(_0x47b382){if(_0x47b382){_0x16d902=_0x47b382[_0x03f4('0x50')];if(!_0x616bc9[_0x03f4('0x49')][_0x03f4('0x69')](_0x03f4('0x51'))){_0x4c4f1b['limit']=qs['limit'](_0x616bc9[_0x03f4('0x49')]['limit']);_0x4c4f1b['offset']=qs[_0x03f4('0x2d')](_0x616bc9[_0x03f4('0x49')]['offset']);}return _0x3721e8['getApplications'](_0x4c4f1b);}})[_0x03f4('0x1e')](function(_0x400180){if(_0x400180){return _0x400180?{'count':_0x16d902,'rows':_0x400180}:null;}})[_0x03f4('0x1e')](respondWithResult(_0x158eed,null))['catch'](handleError(_0x158eed,null));};exports[_0x03f4('0x11f')]=function(_0x11bc83,_0x5ecdcd,_0x4e75f6){return db[_0x03f4('0x120')]['find']({'where':{'id':_0x11bc83['params']['id']}})[_0x03f4('0x1e')](handleEntityNotFound(_0x5ecdcd,null))[_0x03f4('0x1e')](function(_0x1d974d){if(_0x1d974d){return _0x1d974d[_0x03f4('0x11f')](_0x11bc83[_0x03f4('0x3e')][_0x03f4('0x6c')],_['omit'](_0x11bc83[_0x03f4('0x3e')],['ids','id'])||{});}})[_0x03f4('0x1e')](respondWithResult(_0x5ecdcd,null))[_0x03f4('0x5c')](handleError(_0x5ecdcd,null));};exports[_0x03f4('0x121')]=function(_0x458119,_0x24b538,_0x18b29b){var _0x41caf1={};var _0x3a1b15={};var _0x11c69b;var _0x6b2bf;return db[_0x03f4('0x45')][_0x03f4('0x70')]({'where':{'id':_0x458119[_0x03f4('0x64')]['id']}})[_0x03f4('0x1e')](handleEntityNotFound(_0x24b538,null))[_0x03f4('0x1e')](function(_0x4ea726){if(_0x4ea726){_0x11c69b=_0x4ea726;_0x3a1b15['model']=_['keys'](db[_0x03f4('0x122')][_0x03f4('0x46')]);_0x3a1b15[_0x03f4('0x49')]=_[_0x03f4('0x4a')](_0x458119[_0x03f4('0x49')]);_0x3a1b15['filters']=_[_0x03f4('0x4c')](_0x3a1b15['model'],_0x3a1b15[_0x03f4('0x49')]);_0x41caf1[_0x03f4('0x4f')]=_[_0x03f4('0x4c')](_0x3a1b15[_0x03f4('0x4d')],qs['fields'](_0x458119[_0x03f4('0x49')][_0x03f4('0x4e')]));_0x41caf1[_0x03f4('0x4f')]=_0x41caf1['attributes']['length']?_0x41caf1[_0x03f4('0x4f')]:_0x3a1b15['model'];_0x41caf1[_0x03f4('0x52')]=qs[_0x03f4('0x53')](_0x458119[_0x03f4('0x49')][_0x03f4('0x53')]);_0x41caf1[_0x03f4('0x55')]=qs[_0x03f4('0x4b')](_['pick'](_0x458119[_0x03f4('0x49')],_0x3a1b15[_0x03f4('0x4b')]));if(_0x458119[_0x03f4('0x49')][_0x03f4('0x57')]){_0x41caf1[_0x03f4('0x55')]=_[_0x03f4('0x3d')](_0x41caf1[_0x03f4('0x55')],{'$or':_['map'](_0x41caf1[_0x03f4('0x4f')],function(_0xeb9ebd){var _0x1b545a={};_0x1b545a[_0xeb9ebd]={'$like':'%'+_0x458119[_0x03f4('0x49')][_0x03f4('0x57')]+'%'};return _0x1b545a;})});}_0x41caf1=_[_0x03f4('0x3d')]({},_0x41caf1,_0x458119[_0x03f4('0x58')]);return _0x11c69b[_0x03f4('0x121')](_0x41caf1);}})[_0x03f4('0x1e')](function(_0x37c1e8){if(_0x37c1e8){_0x6b2bf=_0x37c1e8['length'];if(!_0x458119[_0x03f4('0x49')][_0x03f4('0x69')](_0x03f4('0x51'))){_0x41caf1[_0x03f4('0x2b')]=qs[_0x03f4('0x2b')](_0x458119[_0x03f4('0x49')][_0x03f4('0x2b')]);_0x41caf1[_0x03f4('0x2d')]=qs[_0x03f4('0x2d')](_0x458119[_0x03f4('0x49')][_0x03f4('0x2d')]);}return _0x11c69b['getProactiveActions'](_0x41caf1);}})[_0x03f4('0x1e')](function(_0x5c021b){if(_0x5c021b){return _0x5c021b?{'count':_0x6b2bf,'rows':_0x5c021b}:null;}})[_0x03f4('0x1e')](respondWithResult(_0x24b538,null))[_0x03f4('0x5c')](handleError(_0x24b538,null));};exports['getFields']=function(_0x39633e,_0x3afd11,_0x3211cd){var _0x545dd3=_0x39633e[_0x03f4('0x49')][_0x03f4('0x123')]===_0x03f4('0x124')?'offlineForm':'onlineForm';return db[_0x03f4('0x45')][_0x03f4('0x5e')]({'attributes':['id',_0x545dd3],'where':{'id':_0x39633e['params']['id']}})[_0x03f4('0x1e')](handleEntityNotFound(_0x3afd11,null))[_0x03f4('0x1e')](function(_0x7381d2){if(_0x7381d2){var _0x265cba=_0x7381d2[_0x545dd3];var _0x5172bb=_0x265cba&&_0x265cba[_0x03f4('0x125')]?_0x265cba[_0x03f4('0x125')]:[];_0x3afd11['send']({'fromKey':_['isNil'](_0x265cba['fromKey'])?undefined:_0x265cba[_0x03f4('0x126')],'count':_0x5172bb['length'],'rows':_0x5172bb});}})[_0x03f4('0x5c')](handleError(_0x3afd11,null));};exports[_0x03f4('0x127')]=function(_0x2c1153,_0x448d56,_0x34531e){var _0x3cfd56={'raw':![],'where':{}};var _0x4e2d39={};var _0x1f4b35={'count':0x0,'rows':[]};return db[_0x03f4('0x45')][_0x03f4('0x70')]({'where':{'id':_0x2c1153[_0x03f4('0x64')]['id']}})[_0x03f4('0x1e')](handleEntityNotFound(_0x448d56,null))[_0x03f4('0x1e')](function(_0x4ee1c7){if(_0x4ee1c7){_0x4e2d39[_0x03f4('0x4d')]=_['keys'](db[_0x03f4('0xda')][_0x03f4('0x46')]);_0x4e2d39['query']=_[_0x03f4('0x4a')](_0x2c1153[_0x03f4('0x49')]);_0x4e2d39[_0x03f4('0x4b')]=_[_0x03f4('0x4c')](_0x4e2d39[_0x03f4('0x4d')],_0x4e2d39[_0x03f4('0x49')]);_0x3cfd56[_0x03f4('0x4f')]=_['intersection'](_0x4e2d39['model'],qs[_0x03f4('0x4e')](_0x2c1153[_0x03f4('0x49')]['fields']));_0x3cfd56[_0x03f4('0x4f')]=_0x3cfd56['attributes']['length']?_0x3cfd56['attributes']:_0x4e2d39[_0x03f4('0x4d')];if(!_0x2c1153['query'][_0x03f4('0x69')](_0x03f4('0x51'))){_0x3cfd56[_0x03f4('0x2b')]=qs[_0x03f4('0x2b')](_0x2c1153['query'][_0x03f4('0x2b')]);_0x3cfd56[_0x03f4('0x2d')]=qs[_0x03f4('0x2d')](_0x2c1153[_0x03f4('0x49')][_0x03f4('0x2d')]);}_0x3cfd56[_0x03f4('0x52')]=qs[_0x03f4('0x53')](_0x2c1153[_0x03f4('0x49')][_0x03f4('0x53')]);_0x3cfd56['where']=qs[_0x03f4('0x4b')](_[_0x03f4('0x54')](_0x2c1153[_0x03f4('0x49')],_0x4e2d39[_0x03f4('0x4b')]));_0x3cfd56[_0x03f4('0x55')][_0x03f4('0x67')]=_0x4ee1c7['id'];if(_0x2c1153[_0x03f4('0x49')][_0x03f4('0x57')]){_0x3cfd56[_0x03f4('0x55')]=_[_0x03f4('0x3d')](_0x3cfd56[_0x03f4('0x55')],{'$or':_[_0x03f4('0x48')](_0x3cfd56['attributes'],function(_0x2b465d){var _0x3b9e69={};_0x3b9e69[_0x2b465d]={'$like':'%'+_0x2c1153[_0x03f4('0x49')][_0x03f4('0x57')]+'%'};return _0x3b9e69;})});}_0x3cfd56=_['merge']({},_0x3cfd56,_0x2c1153[_0x03f4('0x58')]);return db['ChatOfflineMessage']['count']({'where':_0x3cfd56[_0x03f4('0x55')]})[_0x03f4('0x1e')](function(_0x4186bc){_0x1f4b35['count']=_0x4186bc;if(_0x2c1153[_0x03f4('0x49')][_0x03f4('0x59')]){_0x3cfd56[_0x03f4('0x5a')]=[{'all':!![]}];}else{_0x3cfd56[_0x03f4('0x5a')]=[{'model':db[_0x03f4('0x92')],'as':'Contact','required':![]},{'model':db[_0x03f4('0x128')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x3cfd56);})[_0x03f4('0x1e')](function(_0x1bf109){_0x1f4b35[_0x03f4('0x6a')]=_0x1bf109;return _0x1f4b35;});}})[_0x03f4('0x1e')](respondWithFilteredResult(_0x448d56,_0x3cfd56))[_0x03f4('0x5c')](handleError(_0x448d56,null));};exports[_0x03f4('0x129')]=function(_0x76c722,_0x4dae7f,_0x29b23a){return db[_0x03f4('0x45')]['find']({'where':{'id':_0x76c722['params']['id']}})[_0x03f4('0x1e')](handleEntityNotFound(_0x4dae7f,null))[_0x03f4('0x1e')](function(_0x2e4819){if(_0x2e4819){return _0x2e4819[_0x03f4('0x129')](_0x76c722[_0x03f4('0x3e')][_0x03f4('0x6c')],_[_0x03f4('0xfb')](_0x76c722[_0x03f4('0x3e')],['ids','id'])||{})[_0x03f4('0xbc')](function(_0x15d586){for(var _0x2e87e2=0x0;_0x2e87e2<_0x76c722[_0x03f4('0x3e')][_0x03f4('0x6c')]['length'];_0x2e87e2+=0x1){socket['emit'](_0x03f4('0x12a'),{'UserId':_0x76c722[_0x03f4('0x3e')][_0x03f4('0x6c')][_0x2e87e2],'ChatWebsiteId':_0x76c722[_0x03f4('0x64')]['id']});}return _0x15d586;});}})[_0x03f4('0x1e')](respondWithResult(_0x4dae7f,null))[_0x03f4('0x5c')](handleError(_0x4dae7f,null));};exports[_0x03f4('0x12b')]=function(_0x3f8882,_0x2ac22e,_0xfd01fd){return db[_0x03f4('0x45')]['find']({'where':{'id':_0x3f8882[_0x03f4('0x64')]['id']}})[_0x03f4('0x1e')](handleEntityNotFound(_0x2ac22e,null))[_0x03f4('0x1e')](function(_0x1d8a40){if(_0x1d8a40){return _0x1d8a40[_0x03f4('0x12b')](_0x3f8882['query'][_0x03f4('0x6c')])[_0x03f4('0x1e')](function(){if(_[_0x03f4('0x12c')](_0x3f8882[_0x03f4('0x49')][_0x03f4('0x6c')])){for(var _0x29c76e=0x0;_0x29c76e<_0x3f8882['query']['ids']['length'];_0x29c76e+=0x1){socket[_0x03f4('0x12d')](_0x03f4('0x12e'),{'UserId':Number(_0x3f8882[_0x03f4('0x49')][_0x03f4('0x6c')][_0x29c76e]),'ChatWebsiteId':Number(_0x3f8882[_0x03f4('0x64')]['id'])});}}else{socket[_0x03f4('0x12d')](_0x03f4('0x12e'),{'UserId':Number(_0x3f8882[_0x03f4('0x49')][_0x03f4('0x6c')]),'ChatWebsiteId':Number(_0x3f8882[_0x03f4('0x64')]['id'])});}});}})[_0x03f4('0x1e')](respondWithStatusCode(_0x2ac22e,null))[_0x03f4('0x5c')](handleError(_0x2ac22e,null));};exports[_0x03f4('0x12f')]=function(_0x132026,_0x3cf7f8,_0xc67977){var _0x47c63b={};var _0x3b418f={};var _0x19c61f;var _0x562541;return db[_0x03f4('0x45')]['findOne']({'where':{'id':_0x132026['params']['id']}})[_0x03f4('0x1e')](handleEntityNotFound(_0x3cf7f8,null))['then'](function(_0x26741e){if(_0x26741e){_0x19c61f=_0x26741e;_0x3b418f[_0x03f4('0x4d')]=_['keys'](db['User'][_0x03f4('0x46')]);_0x3b418f[_0x03f4('0x49')]=_[_0x03f4('0x4a')](_0x132026[_0x03f4('0x49')]);_0x3b418f[_0x03f4('0x4b')]=_[_0x03f4('0x4c')](_0x3b418f['model'],_0x3b418f[_0x03f4('0x49')]);_0x47c63b['attributes']=_[_0x03f4('0x4c')](_0x3b418f['model'],qs[_0x03f4('0x4e')](_0x132026[_0x03f4('0x49')]['fields']));_0x47c63b[_0x03f4('0x4f')]=_0x47c63b[_0x03f4('0x4f')][_0x03f4('0x50')]?_0x47c63b[_0x03f4('0x4f')]:_0x3b418f[_0x03f4('0x4d')];_0x47c63b['order']=qs['sort'](_0x132026['query']['sort']);_0x47c63b[_0x03f4('0x55')]=qs[_0x03f4('0x4b')](_[_0x03f4('0x54')](_0x132026[_0x03f4('0x49')],_0x3b418f[_0x03f4('0x4b')]));if(_0x132026[_0x03f4('0x49')][_0x03f4('0x57')]){_0x47c63b[_0x03f4('0x55')]=_[_0x03f4('0x3d')](_0x47c63b['where'],{'$or':_[_0x03f4('0x48')](_0x47c63b[_0x03f4('0x4f')],function(_0x1b4eef){var _0x5b6c49={};_0x5b6c49[_0x1b4eef]={'$like':'%'+_0x132026[_0x03f4('0x49')]['filter']+'%'};return _0x5b6c49;})});}_0x47c63b=_[_0x03f4('0x3d')]({},_0x47c63b,_0x132026[_0x03f4('0x58')]);return _0x19c61f[_0x03f4('0x12f')](_0x47c63b);}})[_0x03f4('0x1e')](function(_0x948c31){if(_0x948c31){_0x562541=_0x948c31[_0x03f4('0x50')];if(!_0x132026['query'][_0x03f4('0x69')](_0x03f4('0x51'))){_0x47c63b['limit']=qs[_0x03f4('0x2b')](_0x132026[_0x03f4('0x49')][_0x03f4('0x2b')]);_0x47c63b[_0x03f4('0x2d')]=qs['offset'](_0x132026['query'][_0x03f4('0x2d')]);}return _0x19c61f[_0x03f4('0x12f')](_0x47c63b);}})['then'](function(_0x836e7b){if(_0x836e7b){return _0x836e7b?{'count':_0x562541,'rows':_0x836e7b}:null;}})[_0x03f4('0x1e')](respondWithResult(_0x3cf7f8,null))['catch'](handleError(_0x3cf7f8,null));};
\ No newline at end of file
+var _0xf258=['getDispositions','findOne','order','ChatWebsiteId','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','agentAvatar','filename','addCustomerAvatar','systemAvatar','join','server/files/images/logos/default_logo.svg','getLicense','isNil','existsSync','root','server/files/images/logos/','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','headers','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','Applications','applications','list','orderBy','priority','asc','contact','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','%s\x20%s','version','unknown','format','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','Start','startRouting','EventManager','offline','files','CompanyId','ListId','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','forwardOffline','forwardOfflineAddress','Smtp','service','host','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','subjectOffline','mapValues','email','Chat','NotifyMailAccount','remove','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','interval','iftime\x20%s','true','ONLINE','OFFLINE','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','No\x20timezone','Intervals','getProactiveActions','virtual','custom','License','increment','chatLicenseExceeded','Interval','all','some','server/files/chat/iframe.js','remote','x-real-ip','remoteAddress','replace','alignment','verticalAlignment','textColor','color_button','backgroundColor','ChatApplication','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','getFields','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','client','http','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','status','end','json','offset','limit','count','apply','reject','update','get','ChatWebsites','UserProfileResource','destroy','sendStatus','name','send','render','merge','body','agent','interaction','account','Pause','map','ChatWebsite','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','options','rows','show','params','mandatoryDispositionPause','includeAll','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','describe','addDisposition','Disposition'];(function(_0x53c281,_0x549f6a){var _0x3ab8c4=function(_0x5f0a13){while(--_0x5f0a13){_0x53c281['push'](_0x53c281['shift']());}};_0x3ab8c4(++_0x549f6a);}(_0xf258,0xc6));var _0x8f25=function(_0x3600b1,_0x49f5fa){_0x3600b1=_0x3600b1-0x0;var _0x10c03b=_0xf258[_0x3600b1];return _0x10c03b;};'use strict';var emlformat=require(_0x8f25('0x0'));var rimraf=require(_0x8f25('0x1'));var zipdir=require(_0x8f25('0x2'));var jsonpatch=require(_0x8f25('0x3'));var rp=require('request-promise');var moment=require(_0x8f25('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8f25('0x5'));var util=require('util');var path=require(_0x8f25('0x6'));var sox=require(_0x8f25('0x7'));var csv=require('to-csv');var ejs=require(_0x8f25('0x8'));var fs=require('fs');var fs_extra=require(_0x8f25('0x9'));var _=require(_0x8f25('0xa'));var squel=require(_0x8f25('0xb'));var crypto=require(_0x8f25('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8f25('0xd'));var toCsv=require(_0x8f25('0xe'));var querystring=require(_0x8f25('0xf'));var Papa=require(_0x8f25('0x10'));var Redis=require(_0x8f25('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8f25('0x12'));var as=require(_0x8f25('0x13'));var hardwareService=require(_0x8f25('0x14'));var logger=require(_0x8f25('0x15'))(_0x8f25('0x16'));var utils=require(_0x8f25('0x17'));var config=require(_0x8f25('0x18'));var licenseUtil=require(_0x8f25('0x19'));var db=require(_0x8f25('0x1a'))['db'];config['redis']=_[_0x8f25('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8f25('0x1c')]));require('./chatWebsite.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x8f25('0x1d')][_0x8f25('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x8f25('0x1e')]({'port':0x232a});var client9003=jayson[_0x8f25('0x1d')][_0x8f25('0x1e')]({'port':0x232b});var client9001=jayson[_0x8f25('0x1d')]['http']({'port':0x2329});function respondWithRpcPromise(_0x975a49,_0x5dda8c,_0x203185,_0x5ccb85){return new BPromise(function(_0x21a384,_0x3d4e05){var _0x3378e7=_0x5ccb85||client;return _0x3378e7['request'](_0x975a49,_0x203185)[_0x8f25('0x1f')](function(_0x2ad9b6){logger[_0x8f25('0x20')]('ChatWebsite,\x20%s,\x20%s',_0x5dda8c,_0x8f25('0x21'));logger[_0x8f25('0x22')](_0x8f25('0x23'),_0x5dda8c,_0x8f25('0x21'),JSON[_0x8f25('0x24')](_0x2ad9b6));if(_0x2ad9b6[_0x8f25('0x25')]){if(_0x2ad9b6[_0x8f25('0x25')][_0x8f25('0x26')]===0x1f4){logger[_0x8f25('0x25')](_0x8f25('0x27'),_0x5dda8c,_0x2ad9b6[_0x8f25('0x25')][_0x8f25('0x28')]);return _0x3d4e05(_0x2ad9b6['error'][_0x8f25('0x28')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x5dda8c,_0x2ad9b6[_0x8f25('0x25')]['message']);return _0x21a384(_0x2ad9b6['error']['message']);}else{logger[_0x8f25('0x20')](_0x8f25('0x27'),_0x5dda8c,'request\x20sent');_0x21a384(_0x2ad9b6[_0x8f25('0x29')][_0x8f25('0x28')]);}})[_0x8f25('0x2a')](function(_0x4396d1){logger[_0x8f25('0x25')](_0x8f25('0x27'),_0x5dda8c,_0x4396d1);_0x3d4e05(_0x4396d1);});});}function respondWithStatusCode(_0x10927e,_0x18cf17){_0x18cf17=_0x18cf17||0xcc;return function(_0x165cbf){if(_0x165cbf){return _0x10927e['sendStatus'](_0x18cf17);}return _0x10927e[_0x8f25('0x2b')](_0x18cf17)[_0x8f25('0x2c')]();};}function respondWithResult(_0x2c401f,_0x5049d7){_0x5049d7=_0x5049d7||0xc8;return function(_0x3f36d1){if(_0x3f36d1){return _0x2c401f[_0x8f25('0x2b')](_0x5049d7)[_0x8f25('0x2d')](_0x3f36d1);}};}function respondWithFilteredResult(_0x4da1cb,_0x4fb283){return function(_0x36b58a){if(_0x36b58a){var _0x4d92cc=typeof _0x4fb283[_0x8f25('0x2e')]==='undefined'&&typeof _0x4fb283[_0x8f25('0x2f')]==='undefined';var _0x5d266a=_0x36b58a[_0x8f25('0x30')];var _0x11eb50=_0x4d92cc?0x0:_0x4fb283[_0x8f25('0x2e')];var _0x56e928=_0x4d92cc?_0x36b58a[_0x8f25('0x30')]:_0x4fb283[_0x8f25('0x2e')]+_0x4fb283[_0x8f25('0x2f')];var _0x1afdb5;if(_0x56e928>=_0x5d266a){_0x56e928=_0x5d266a;_0x1afdb5=0xc8;}else{_0x1afdb5=0xce;}_0x4da1cb[_0x8f25('0x2b')](_0x1afdb5);return _0x4da1cb['set']('Content-Range',_0x11eb50+'-'+_0x56e928+'/'+_0x5d266a)[_0x8f25('0x2d')](_0x36b58a);}return null;};}function patchUpdates(_0x1649f0){return function(_0x205754){try{jsonpatch[_0x8f25('0x31')](_0x205754,_0x1649f0,!![]);}catch(_0x403966){return BPromise[_0x8f25('0x32')](_0x403966);}return _0x205754['save']();};}function saveUpdates(_0x3eabf8,_0x286cb0){return function(_0x24d3bf){if(_0x24d3bf){return _0x24d3bf[_0x8f25('0x33')](_0x3eabf8)[_0x8f25('0x1f')](function(_0x1cf683){return _0x1cf683;});}return null;};}function removeEntity(_0x262552,_0x52f471){return function(_0x86cf7e){if(_0x86cf7e){return _0x86cf7e['destroy']()['then'](function(){var _0x142e10=_0x86cf7e[_0x8f25('0x34')]({'plain':!![]});var _0x515610=_0x8f25('0x35');return db[_0x8f25('0x36')][_0x8f25('0x37')]({'where':{'type':_0x515610,'resourceId':_0x142e10['id']}})[_0x8f25('0x1f')](function(){return _0x86cf7e;});})[_0x8f25('0x1f')](function(){_0x262552[_0x8f25('0x2b')](0xcc)[_0x8f25('0x2c')]();});}};}function handleEntityNotFound(_0x2fcb1c,_0x1f78cb){return function(_0x59ec17){if(!_0x59ec17){_0x2fcb1c[_0x8f25('0x38')](0x194);}return _0x59ec17;};}function handleError(_0x5e185a,_0x4af2bf){_0x4af2bf=_0x4af2bf||0x1f4;return function(_0xacdee3){logger[_0x8f25('0x25')](_0xacdee3['stack']);if(_0xacdee3[_0x8f25('0x39')]){delete _0xacdee3[_0x8f25('0x39')];}_0x5e185a['status'](_0x4af2bf)[_0x8f25('0x3a')](_0xacdee3);};}function getMustacheRender(_0x341bd7,_0x23f10d){return Mustache[_0x8f25('0x3b')](_0x341bd7,_[_0x8f25('0x3c')](_0x23f10d[_0x8f25('0x3d')],{'contact':_0x23f10d['contact'],'message':_0x23f10d[_0x8f25('0x28')],'agent':_0x23f10d[_0x8f25('0x3e')],'interaction':_0x23f10d[_0x8f25('0x3f')],'account':_0x23f10d[_0x8f25('0x40')]}))||'';}exports['index']=function(_0x1349e8,_0x28d27f){var _0x5f4c02={'include':[{'model':db[_0x8f25('0x41')],'as':'mandatoryDispositionPause'}]},_0x13adf5={},_0x8b201d={'count':0x0,'rows':[]};var _0x1db211=_[_0x8f25('0x42')](db[_0x8f25('0x43')][_0x8f25('0x44')],function(_0x1c70b3){return{'name':_0x1c70b3[_0x8f25('0x45')],'type':_0x1c70b3[_0x8f25('0x46')]['key']};});_0x13adf5[_0x8f25('0x47')]=_[_0x8f25('0x42')](_0x1db211,_0x8f25('0x39'));_0x13adf5['query']=_[_0x8f25('0x48')](_0x1349e8[_0x8f25('0x49')]);_0x13adf5[_0x8f25('0x4a')]=_[_0x8f25('0x4b')](_0x13adf5[_0x8f25('0x47')],_0x13adf5[_0x8f25('0x49')]);_0x5f4c02[_0x8f25('0x4c')]=_['intersection'](_0x13adf5[_0x8f25('0x47')],qs['fields'](_0x1349e8[_0x8f25('0x49')][_0x8f25('0x4d')]));_0x5f4c02[_0x8f25('0x4c')]=_0x5f4c02['attributes'][_0x8f25('0x4e')]?_0x5f4c02['attributes']:_0x13adf5[_0x8f25('0x47')];if(!_0x1349e8[_0x8f25('0x49')][_0x8f25('0x4f')](_0x8f25('0x50'))){_0x5f4c02[_0x8f25('0x2f')]=qs['limit'](_0x1349e8[_0x8f25('0x49')]['limit']);_0x5f4c02['offset']=qs[_0x8f25('0x2e')](_0x1349e8[_0x8f25('0x49')]['offset']);}_0x5f4c02['order']=qs[_0x8f25('0x51')](_0x1349e8[_0x8f25('0x49')][_0x8f25('0x51')]);_0x5f4c02[_0x8f25('0x52')]=qs[_0x8f25('0x4a')](_[_0x8f25('0x53')](_0x1349e8[_0x8f25('0x49')],_0x13adf5[_0x8f25('0x4a')]),_0x1db211);if(_0x1349e8['query']['filter']){_0x5f4c02[_0x8f25('0x52')]=_['merge'](_0x5f4c02[_0x8f25('0x52')],{'$or':_[_0x8f25('0x42')](_0x1db211,function(_0x6b924e){if(_0x6b924e[_0x8f25('0x46')]!=='VIRTUAL'){var _0x3c79db={};_0x3c79db[_0x6b924e[_0x8f25('0x39')]]={'$like':'%'+_0x1349e8[_0x8f25('0x49')][_0x8f25('0x54')]+'%'};return _0x3c79db;}})});}_0x5f4c02=_[_0x8f25('0x3c')]({},_0x5f4c02,_0x1349e8[_0x8f25('0x55')]);var _0x522446={'where':_0x5f4c02[_0x8f25('0x52')]};return db['ChatWebsite']['count'](_0x522446)[_0x8f25('0x1f')](function(_0x141307){_0x8b201d['count']=_0x141307;if(_0x1349e8[_0x8f25('0x49')]['includeAll']){_0x5f4c02['include']=[{'all':!![]}];}return db[_0x8f25('0x43')]['findAll'](_0x5f4c02);})[_0x8f25('0x1f')](function(_0x5371d8){_0x8b201d[_0x8f25('0x56')]=_0x5371d8;return _0x8b201d;})[_0x8f25('0x1f')](respondWithFilteredResult(_0x28d27f,_0x5f4c02))[_0x8f25('0x2a')](handleError(_0x28d27f,null));};exports[_0x8f25('0x57')]=function(_0x363466,_0x2e7126){var _0x3c72ea={'raw':![],'where':{'id':_0x363466[_0x8f25('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x8f25('0x59')}]},_0x578567={};_0x578567['model']=_[_0x8f25('0x48')](db[_0x8f25('0x43')][_0x8f25('0x44')]);_0x578567['query']=_[_0x8f25('0x48')](_0x363466[_0x8f25('0x49')]);_0x578567[_0x8f25('0x4a')]=_['intersection'](_0x578567[_0x8f25('0x47')],_0x578567['query']);_0x3c72ea[_0x8f25('0x4c')]=_['intersection'](_0x578567[_0x8f25('0x47')],qs['fields'](_0x363466[_0x8f25('0x49')][_0x8f25('0x4d')]));_0x3c72ea['attributes']=_0x3c72ea['attributes'][_0x8f25('0x4e')]?_0x3c72ea[_0x8f25('0x4c')]:_0x578567[_0x8f25('0x47')];if(_0x363466[_0x8f25('0x49')][_0x8f25('0x5a')]){_0x3c72ea[_0x8f25('0x5b')]=[{'all':!![]}];}_0x3c72ea=_['merge']({},_0x3c72ea,_0x363466[_0x8f25('0x55')]);return db[_0x8f25('0x43')][_0x8f25('0x5c')](_0x3c72ea)[_0x8f25('0x1f')](handleEntityNotFound(_0x2e7126,null))[_0x8f25('0x1f')](respondWithResult(_0x2e7126,null))[_0x8f25('0x2a')](handleError(_0x2e7126,null));};exports[_0x8f25('0x5d')]=function(_0x3435a7,_0x9f6f03){return db[_0x8f25('0x43')][_0x8f25('0x5d')](_0x3435a7['body'],{})[_0x8f25('0x1f')](function(_0x26a35b){var _0x4ef6d3=_0x3435a7[_0x8f25('0x5e')][_0x8f25('0x34')]({'plain':!![]});if(!_0x4ef6d3)throw new Error(_0x8f25('0x5f'));if(_0x4ef6d3[_0x8f25('0x60')]===_0x8f25('0x5e')){var _0x1cd4c6=_0x26a35b[_0x8f25('0x34')]({'plain':!![]});var _0x21a8c1='ChatWebsites';return db[_0x8f25('0x61')][_0x8f25('0x5c')]({'where':{'name':_0x21a8c1,'userProfileId':_0x4ef6d3['userProfileId']},'raw':!![]})['then'](function(_0x1f1319){if(_0x1f1319&&_0x1f1319[_0x8f25('0x62')]===0x0){return db[_0x8f25('0x36')]['create']({'name':_0x1cd4c6['name'],'resourceId':_0x1cd4c6['id'],'type':_0x1f1319[_0x8f25('0x39')],'sectionId':_0x1f1319['id']},{})[_0x8f25('0x1f')](function(){return _0x26a35b;});}else{return _0x26a35b;}})[_0x8f25('0x2a')](function(_0x13d98b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13d98b);throw _0x13d98b;});}return _0x26a35b;})[_0x8f25('0x1f')](respondWithResult(_0x9f6f03,0xc9))['catch'](handleError(_0x9f6f03,null));};exports['update']=function(_0x45f73e,_0x51fa19){if(_0x45f73e[_0x8f25('0x3d')]['id']){delete _0x45f73e[_0x8f25('0x3d')]['id'];}return db[_0x8f25('0x43')][_0x8f25('0x5c')]({'where':{'id':_0x45f73e['params']['id']},'include':[{'model':db['Pause'],'as':_0x8f25('0x59')}]})[_0x8f25('0x1f')](handleEntityNotFound(_0x51fa19,null))['then'](saveUpdates(_0x45f73e['body'],null))[_0x8f25('0x1f')](respondWithResult(_0x51fa19,null))[_0x8f25('0x2a')](handleError(_0x51fa19,null));};exports[_0x8f25('0x37')]=function(_0x18ee19,_0x5cdd75){return db[_0x8f25('0x43')][_0x8f25('0x5c')]({'where':{'id':_0x18ee19[_0x8f25('0x58')]['id']}})[_0x8f25('0x1f')](handleEntityNotFound(_0x5cdd75,null))[_0x8f25('0x1f')](removeEntity(_0x5cdd75,null))[_0x8f25('0x2a')](handleError(_0x5cdd75,null));};exports['describe']=function(_0x2e8787,_0x13ff9a){return db[_0x8f25('0x43')][_0x8f25('0x63')]()[_0x8f25('0x1f')](respondWithResult(_0x13ff9a,null))[_0x8f25('0x2a')](handleError(_0x13ff9a,null));};exports[_0x8f25('0x64')]=function(_0xb1f4da,_0x367f1c,_0x5c0b8c){if(_0xb1f4da[_0x8f25('0x3d')]['id']){delete _0xb1f4da['body']['id'];}return db[_0x8f25('0x43')]['find']({'where':{'id':_0xb1f4da[_0x8f25('0x58')]['id']}})['then'](handleEntityNotFound(_0x367f1c,null))[_0x8f25('0x1f')](function(_0x4de65d){if(_0x4de65d){_0xb1f4da['body']['ChatWebsiteId']=_0x4de65d['id'];return db[_0x8f25('0x65')]['create'](_0xb1f4da[_0x8f25('0x3d')]);}})[_0x8f25('0x1f')](respondWithResult(_0x367f1c,null))[_0x8f25('0x2a')](handleError(_0x367f1c,null));};exports[_0x8f25('0x66')]=function(_0x566c3a,_0x5500a2,_0x12430a){var _0xae819d={'raw':![],'where':{}};var _0xa34b7e={};var _0x347d96={'count':0x0,'rows':[]};return db[_0x8f25('0x43')][_0x8f25('0x67')]({'where':{'id':_0x566c3a[_0x8f25('0x58')]['id']}})[_0x8f25('0x1f')](handleEntityNotFound(_0x5500a2,null))[_0x8f25('0x1f')](function(_0x1f9f7e){if(_0x1f9f7e){_0xa34b7e[_0x8f25('0x47')]=_[_0x8f25('0x48')](db['Disposition'][_0x8f25('0x44')]);_0xa34b7e['query']=_[_0x8f25('0x48')](_0x566c3a[_0x8f25('0x49')]);_0xa34b7e['filters']=_[_0x8f25('0x4b')](_0xa34b7e[_0x8f25('0x47')],_0xa34b7e['query']);_0xae819d['attributes']=_[_0x8f25('0x4b')](_0xa34b7e[_0x8f25('0x47')],qs['fields'](_0x566c3a[_0x8f25('0x49')]['fields']));_0xae819d[_0x8f25('0x4c')]=_0xae819d['attributes'][_0x8f25('0x4e')]?_0xae819d[_0x8f25('0x4c')]:_0xa34b7e[_0x8f25('0x47')];if(!_0x566c3a['query'][_0x8f25('0x4f')]('nolimit')){_0xae819d[_0x8f25('0x2f')]=qs['limit'](_0x566c3a['query']['limit']);_0xae819d[_0x8f25('0x2e')]=qs[_0x8f25('0x2e')](_0x566c3a[_0x8f25('0x49')][_0x8f25('0x2e')]);}_0xae819d[_0x8f25('0x68')]=qs[_0x8f25('0x51')](_0x566c3a[_0x8f25('0x49')]['sort']);_0xae819d[_0x8f25('0x52')]=qs[_0x8f25('0x4a')](_[_0x8f25('0x53')](_0x566c3a['query'],_0xa34b7e[_0x8f25('0x4a')]));_0xae819d[_0x8f25('0x52')][_0x8f25('0x69')]=_0x1f9f7e['id'];if(_0x566c3a['query'][_0x8f25('0x54')]){_0xae819d[_0x8f25('0x52')]=_['merge'](_0xae819d['where'],{'$or':_[_0x8f25('0x42')](_0xae819d[_0x8f25('0x4c')],function(_0x2ef6ea){var _0x3c9071={};_0x3c9071[_0x2ef6ea]={'$like':'%'+_0x566c3a[_0x8f25('0x49')][_0x8f25('0x54')]+'%'};return _0x3c9071;})});}_0xae819d=_[_0x8f25('0x3c')]({},_0xae819d,_0x566c3a[_0x8f25('0x55')]);return db[_0x8f25('0x65')]['count']({'where':_0xae819d['where']})[_0x8f25('0x1f')](function(_0xe9d3f3){_0x347d96['count']=_0xe9d3f3;if(_0x566c3a['query'][_0x8f25('0x5a')]){_0xae819d[_0x8f25('0x5b')]=[{'all':!![]}];}return db[_0x8f25('0x65')][_0x8f25('0x6a')](_0xae819d);})[_0x8f25('0x1f')](function(_0x5dba9b){_0x347d96['rows']=_0x5dba9b;return _0x347d96;});}})[_0x8f25('0x1f')](respondWithFilteredResult(_0x5500a2,_0xae819d))[_0x8f25('0x2a')](handleError(_0x5500a2,null));};exports[_0x8f25('0x6b')]=function(_0x4faf34,_0xc1363b,_0x78e537){return db[_0x8f25('0x43')][_0x8f25('0x5c')]({'where':{'id':_0x4faf34[_0x8f25('0x58')]['id']}})['then'](handleEntityNotFound(_0xc1363b,null))['then'](function(_0x6864){if(_0x6864){return _0x6864['removeDispositions'](_0x4faf34['query'][_0x8f25('0x6c')]);}})[_0x8f25('0x1f')](respondWithStatusCode(_0xc1363b,null))[_0x8f25('0x2a')](handleError(_0xc1363b,null));};exports[_0x8f25('0x6d')]=function(_0x2f7c84,_0x182aa8,_0x5b96b6){if(_0x2f7c84[_0x8f25('0x3d')]['id']){delete _0x2f7c84[_0x8f25('0x3d')]['id'];}return db[_0x8f25('0x43')]['find']({'where':{'id':_0x2f7c84[_0x8f25('0x58')]['id']}})[_0x8f25('0x1f')](handleEntityNotFound(_0x182aa8,null))[_0x8f25('0x1f')](function(_0x48a872){if(_0x48a872){_0x2f7c84[_0x8f25('0x3d')][_0x8f25('0x69')]=_0x48a872['id'];return db[_0x8f25('0x6e')]['create'](_0x2f7c84['body']);}})[_0x8f25('0x1f')](respondWithResult(_0x182aa8,null))[_0x8f25('0x2a')](handleError(_0x182aa8,null));};exports[_0x8f25('0x6f')]=function(_0x134c9e,_0x13d927,_0x2b1703){var _0x5cf461={'raw':![],'where':{}};var _0x2dfcdf={};var _0x40a95c={'count':0x0,'rows':[]};return db[_0x8f25('0x43')]['findOne']({'where':{'id':_0x134c9e[_0x8f25('0x58')]['id']}})[_0x8f25('0x1f')](handleEntityNotFound(_0x13d927,null))[_0x8f25('0x1f')](function(_0x2ad775){if(_0x2ad775){_0x2dfcdf[_0x8f25('0x47')]=_[_0x8f25('0x48')](db[_0x8f25('0x6e')]['rawAttributes']);_0x2dfcdf[_0x8f25('0x49')]=_[_0x8f25('0x48')](_0x134c9e[_0x8f25('0x49')]);_0x2dfcdf[_0x8f25('0x4a')]=_['intersection'](_0x2dfcdf[_0x8f25('0x47')],_0x2dfcdf[_0x8f25('0x49')]);_0x5cf461['attributes']=_['intersection'](_0x2dfcdf[_0x8f25('0x47')],qs[_0x8f25('0x4d')](_0x134c9e[_0x8f25('0x49')][_0x8f25('0x4d')]));_0x5cf461[_0x8f25('0x4c')]=_0x5cf461['attributes'][_0x8f25('0x4e')]?_0x5cf461[_0x8f25('0x4c')]:_0x2dfcdf[_0x8f25('0x47')];if(!_0x134c9e[_0x8f25('0x49')][_0x8f25('0x4f')]('nolimit')){_0x5cf461[_0x8f25('0x2f')]=qs['limit'](_0x134c9e[_0x8f25('0x49')]['limit']);_0x5cf461['offset']=qs[_0x8f25('0x2e')](_0x134c9e[_0x8f25('0x49')][_0x8f25('0x2e')]);}_0x5cf461[_0x8f25('0x68')]=qs[_0x8f25('0x51')](_0x134c9e[_0x8f25('0x49')][_0x8f25('0x51')]);_0x5cf461[_0x8f25('0x52')]=qs[_0x8f25('0x4a')](_[_0x8f25('0x53')](_0x134c9e['query'],_0x2dfcdf['filters']));_0x5cf461[_0x8f25('0x52')][_0x8f25('0x69')]=_0x2ad775['id'];if(_0x134c9e[_0x8f25('0x49')]['filter']){_0x5cf461[_0x8f25('0x52')]=_['merge'](_0x5cf461[_0x8f25('0x52')],{'$or':_[_0x8f25('0x42')](_0x5cf461[_0x8f25('0x4c')],function(_0x11cc33){var _0x598541={};_0x598541[_0x11cc33]={'$like':'%'+_0x134c9e[_0x8f25('0x49')][_0x8f25('0x54')]+'%'};return _0x598541;})});}_0x5cf461=_[_0x8f25('0x3c')]({},_0x5cf461,_0x134c9e[_0x8f25('0x55')]);return db['CannedAnswer']['count']({'where':_0x5cf461[_0x8f25('0x52')]})['then'](function(_0x5e0c2b){_0x40a95c[_0x8f25('0x30')]=_0x5e0c2b;if(_0x134c9e[_0x8f25('0x49')]['includeAll']){_0x5cf461[_0x8f25('0x5b')]=[{'all':!![]}];}return db[_0x8f25('0x6e')][_0x8f25('0x6a')](_0x5cf461);})[_0x8f25('0x1f')](function(_0x181a03){_0x40a95c[_0x8f25('0x56')]=_0x181a03;return _0x40a95c;});}})['then'](respondWithFilteredResult(_0x13d927,_0x5cf461))[_0x8f25('0x2a')](handleError(_0x13d927,null));};exports[_0x8f25('0x70')]=function(_0x532a6d,_0x22c4d7,_0x5025b1){return db['ChatWebsite'][_0x8f25('0x5c')]({'where':{'id':_0x532a6d['params']['id']}})[_0x8f25('0x1f')](handleEntityNotFound(_0x22c4d7,null))[_0x8f25('0x1f')](function(_0x1d955c){if(_0x1d955c){return _0x1d955c[_0x8f25('0x70')](_0x532a6d['query'][_0x8f25('0x6c')]);}})['then'](respondWithStatusCode(_0x22c4d7,null))[_0x8f25('0x2a')](handleError(_0x22c4d7,null));};exports[_0x8f25('0x71')]=function(_0x500142,_0x2bbd6b,_0x25d2bf){_0x500142[_0x8f25('0x3d')][_0x8f25('0x72')]=_0x500142[_0x8f25('0x73')]['filename'];return db[_0x8f25('0x43')][_0x8f25('0x5c')]({'where':{'id':_0x500142['params']['id']}})[_0x8f25('0x1f')](handleEntityNotFound(_0x2bbd6b,null))[_0x8f25('0x1f')](saveUpdates(_0x500142[_0x8f25('0x3d')],null))['then'](respondWithResult(_0x2bbd6b,null))[_0x8f25('0x2a')](handleError(_0x2bbd6b,null));};exports['addAvatar']=function(_0x591151,_0x476925,_0x187ab9){_0x591151['body'][_0x8f25('0x74')]=_0x591151[_0x8f25('0x73')][_0x8f25('0x75')];return db[_0x8f25('0x43')][_0x8f25('0x5c')]({'where':{'id':_0x591151[_0x8f25('0x58')]['id']}})[_0x8f25('0x1f')](handleEntityNotFound(_0x476925,null))[_0x8f25('0x1f')](saveUpdates(_0x591151[_0x8f25('0x3d')],null))[_0x8f25('0x1f')](respondWithResult(_0x476925,null))['catch'](handleError(_0x476925,null));};exports[_0x8f25('0x76')]=function(_0xe506ec,_0x1d7655,_0x18a44e){_0xe506ec[_0x8f25('0x3d')]['customerAvatar']=_0xe506ec[_0x8f25('0x73')][_0x8f25('0x75')];return db['ChatWebsite']['find']({'where':{'id':_0xe506ec[_0x8f25('0x58')]['id']}})[_0x8f25('0x1f')](handleEntityNotFound(_0x1d7655,null))[_0x8f25('0x1f')](saveUpdates(_0xe506ec[_0x8f25('0x3d')],null))[_0x8f25('0x1f')](respondWithResult(_0x1d7655,null))['catch'](handleError(_0x1d7655,null));};exports['addSystemAvatar']=function(_0x29de46,_0x4cf46a,_0x4d510b){_0x29de46[_0x8f25('0x3d')][_0x8f25('0x77')]=_0x29de46[_0x8f25('0x73')][_0x8f25('0x75')];return db[_0x8f25('0x43')][_0x8f25('0x5c')]({'where':{'id':_0x29de46[_0x8f25('0x58')]['id']}})[_0x8f25('0x1f')](handleEntityNotFound(_0x4cf46a,null))[_0x8f25('0x1f')](saveUpdates(_0x29de46[_0x8f25('0x3d')],null))[_0x8f25('0x1f')](respondWithResult(_0x4cf46a,null))['catch'](handleError(_0x4cf46a,null));};exports['getLogo']=function(_0x14cbdf,_0x20be9e,_0x3347bb){var _0x2d07ae=path[_0x8f25('0x78')](config['root'],_0x8f25('0x79'));var _0x379f67={'where':{'id':_0x14cbdf[_0x8f25('0x58')]['id']},'attributes':['id',_0x8f25('0x72')],'raw':!![]};var _0x3bb2fb=![];return require(_0x8f25('0x19'))[_0x8f25('0x7a')]()[_0x8f25('0x1f')](function(_0x331dfa){if(_0x331dfa){_0x3bb2fb=_0x331dfa['custom'];}})[_0x8f25('0x1f')](function(){return db['ChatWebsite']['find'](_0x379f67);})[_0x8f25('0x1f')](handleEntityNotFound(_0x20be9e,null))[_0x8f25('0x1f')](function(_0xf63592){if(_0xf63592){if(!_[_0x8f25('0x7b')](_0xf63592[_0x8f25('0x72')])){if(fs[_0x8f25('0x7c')](path[_0x8f25('0x78')](config[_0x8f25('0x7d')],_0x8f25('0x7e'),_0xf63592[_0x8f25('0x72')]))&&_0x3bb2fb){_0x2d07ae=path[_0x8f25('0x78')](config[_0x8f25('0x7d')],_0x8f25('0x7e'),_0xf63592[_0x8f25('0x72')]);}}return _0x20be9e['download'](_0x2d07ae);}})['catch'](handleError(_0x20be9e,null));};exports['getAvatar']=function(_0x345394,_0x56ed79,_0x187ce1){var _0x3fc3c3=path[_0x8f25('0x78')](config['root'],_0x8f25('0x7f'));var _0x5ad870={'where':{'id':_0x345394['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x8f25('0x43')]['find'](_0x5ad870)[_0x8f25('0x1f')](handleEntityNotFound(_0x56ed79,null))['then'](function(_0x4ee3a9){if(_0x4ee3a9){if(!_['isNil'](_0x4ee3a9[_0x8f25('0x74')])){if(fs[_0x8f25('0x7c')](path[_0x8f25('0x78')](config[_0x8f25('0x7d')],_0x8f25('0x80'),_0x4ee3a9[_0x8f25('0x74')]))){_0x3fc3c3=path['join'](config[_0x8f25('0x7d')],_0x8f25('0x80'),_0x4ee3a9['agentAvatar']);}}return _0x56ed79[_0x8f25('0x81')](_0x3fc3c3);}})[_0x8f25('0x2a')](handleError(_0x56ed79,null));};exports[_0x8f25('0x82')]=function(_0x313a08,_0x397a38,_0x27ad5a){var _0x1fb3bb=path[_0x8f25('0x78')](config['root'],_0x8f25('0x83'));var _0x4a2aaa={'where':{'id':_0x313a08[_0x8f25('0x58')]['id']},'attributes':['id',_0x8f25('0x84'),_0x8f25('0x85')],'raw':!![]};return db[_0x8f25('0x43')]['find'](_0x4a2aaa)[_0x8f25('0x1f')](handleEntityNotFound(_0x397a38,null))[_0x8f25('0x1f')](function(_0x2166c3){if(_0x2166c3){if(!_[_0x8f25('0x7b')](_0x2166c3[_0x8f25('0x84')])){if(fs[_0x8f25('0x7c')](path[_0x8f25('0x78')](config[_0x8f25('0x7d')],'server/files/images/avatars/',_0x2166c3[_0x8f25('0x84')]))&&_0x2166c3['showCustomerAvatar']){_0x1fb3bb=path[_0x8f25('0x78')](config['root'],_0x8f25('0x80'),_0x2166c3[_0x8f25('0x84')]);}}return _0x397a38[_0x8f25('0x81')](_0x1fb3bb);}})[_0x8f25('0x2a')](handleError(_0x397a38,null));};exports['getSystemAvatar']=function(_0x431c99,_0x5b5bbb,_0x2f8971){var _0x1b347c=path[_0x8f25('0x78')](config[_0x8f25('0x7d')],_0x8f25('0x86'));var _0x314867={'where':{'id':_0x431c99[_0x8f25('0x58')]['id']},'attributes':['id',_0x8f25('0x77')],'raw':!![]};return db[_0x8f25('0x43')][_0x8f25('0x5c')](_0x314867)['then'](handleEntityNotFound(_0x5b5bbb,null))['then'](function(_0x152c54){if(_0x152c54){if(!_['isNil'](_0x152c54[_0x8f25('0x77')])){if(fs['existsSync'](path['join'](config[_0x8f25('0x7d')],_0x8f25('0x80'),_0x152c54[_0x8f25('0x77')]))){_0x1b347c=path[_0x8f25('0x78')](config[_0x8f25('0x7d')],_0x8f25('0x80'),_0x152c54[_0x8f25('0x77')]);}}return _0x5b5bbb[_0x8f25('0x81')](_0x1b347c);}})[_0x8f25('0x2a')](handleError(_0x5b5bbb,null));};exports[_0x8f25('0x87')]=function(_0x581374,_0x2eebc4,_0x1e419f){var _0x148621=require(_0x8f25('0x88'));var _0x2baa62=new _0x148621();var _0x2afa3c=_0x2baa62['setUA'](_0x581374[_0x8f25('0x89')]['user-agent'])['getResult']();var _0x1f3d88={'body':_0x581374['body'],'channel':_0x8f25('0x8a')};var _0x50196d=[];var _0x55b420=[];var _0x575077={};var _0x4a5117=![];return db[_0x8f25('0x8b')][_0x8f25('0x63')]()[_0x8f25('0x1f')](function(_0x5289b5){if(!_0x5289b5){throw new db[(_0x8f25('0x8c'))][(_0x8f25('0x8d'))](_0x8f25('0x8e'));}_0x50196d=_[_0x8f25('0x8f')](_['keys'](_0x5289b5),[_0x8f25('0x90'),'updatedAt']);_0x55b420=_[_0x8f25('0x8f')](_[_0x8f25('0x48')](_0x5289b5),[_0x8f25('0x90'),_0x8f25('0x91'),'CompanyId','ListId']);if(_0x581374['body']['id']){delete _0x581374['body']['id'];}if(_[_0x8f25('0x7b')](_0x581374[_0x8f25('0x3d')][_0x8f25('0x92')])){throw new db['Sequelize']['ValidationError'](_0x8f25('0x93'));}if(_['isNil'](_0x581374[_0x8f25('0x3d')][_0x8f25('0x3d')])||_0x581374['body'][_0x8f25('0x3d')]===''){throw new db[(_0x8f25('0x8c'))][(_0x8f25('0x8d'))](_0x8f25('0x94'));}if(_['isNil'](_0x581374[_0x8f25('0x3d')][_0x8f25('0x95')])){throw new db['Sequelize'][(_0x8f25('0x8d'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x55b420);}if(!_[_0x8f25('0x96')](_0x55b420,_0x581374['body'][_0x8f25('0x95')])){throw new db[(_0x8f25('0x8c'))][(_0x8f25('0x8d'))](_0x8f25('0x97')+_0x55b420);}_0x575077[_0x581374[_0x8f25('0x3d')][_0x8f25('0x95')]]=_0x581374[_0x8f25('0x3d')][_0x8f25('0x92')];})[_0x8f25('0x1f')](function(){return db[_0x8f25('0x43')][_0x8f25('0x5c')]({'where':{'id':_0x581374['params']['id']},'include':[{'model':db['CmList'],'as':_0x8f25('0x98'),'include':[{'model':db['CmContact'],'as':_0x8f25('0x99'),'where':_0x575077,'limit':0x1,'order':[[_0x8f25('0x91'),_0x8f25('0x9a')]]}]},{'model':db['ChatApplication'],'as':_0x8f25('0x9b')}]});})['then'](handleEntityNotFound(_0x2eebc4,null))[_0x8f25('0x1f')](function(_0x2280a6){if(_0x2280a6&&_0x2280a6[_0x8f25('0x98')]){_0x1f3d88['account']=_0x2280a6;_0x1f3d88[_0x8f25('0x9c')]=_0x2280a6[_0x8f25('0x9b')];_0x1f3d88[_0x8f25('0x9d')]=_0x2280a6['List'];_0x1f3d88[_0x8f25('0x9c')]=_[_0x8f25('0x9e')](_0x1f3d88['applications'],[_0x8f25('0x9f')],[_0x8f25('0xa0')]);if(_0x1f3d88[_0x8f25('0x40')][_0x8f25('0x9b')]){delete _0x1f3d88['account'][_0x8f25('0x9b')];}if(_0x1f3d88[_0x8f25('0x40')]['List']&&_0x1f3d88[_0x8f25('0x40')][_0x8f25('0x98')][_0x8f25('0x99')][_0x8f25('0x4e')]){return _0x1f3d88[_0x8f25('0x40')]['List']['Contacts'][0x0];}var _0x157f26=_[_0x8f25('0x1b')](_0x581374[_0x8f25('0x3d')],{'firstName':_0x581374[_0x8f25('0x3d')]['from'],'ListId':_0x2280a6['ListId']});_0x157f26[_0x581374['body'][_0x8f25('0x95')]]=_0x581374['body'][_0x8f25('0x92')];return db[_0x8f25('0x8b')][_0x8f25('0x5d')](_0x157f26,{'fields':_0x50196d,'raw':!![]});}})['then'](handleEntityNotFound(_0x2eebc4,null))[_0x8f25('0x1f')](function(_0x39812a){_0x1f3d88[_0x8f25('0xa1')]=_0x39812a;var _0x380391=_0x581374[_0x8f25('0x3d')]['customerIp'];if(_0x581374['headers'][_0x8f25('0xa2')]){_0x380391=_0x581374['headers']['cf-connecting-ip'];}else if(_0x581374[_0x8f25('0x89')][_0x8f25('0xa3')]){_0x380391=_[_0x8f25('0xa4')](_0x581374[_0x8f25('0x89')]['x-forwarded-for']['split'](','));}if(_0x39812a){var _0xbb6f21={'ContactId':_0x39812a['id'],'ChatWebsiteId':_0x581374[_0x8f25('0x58')]['id'],'from':(_0x39812a[_0x8f25('0xa5')]||'')+'\x20'+(_0x39812a[_0x8f25('0xa6')]||''),'customerIp':_0x380391,'customerPort':_0x581374['headers'][_0x8f25('0xa7')]?_0x581374[_0x8f25('0x89')][_0x8f25('0xa7')]:null,'referer':_0x581374[_0x8f25('0x3d')][_0x8f25('0xa8')],'browserName':_0x2afa3c[_0x8f25('0xa9')][_0x8f25('0x39')]&&_0x2afa3c['browser']['version']?util['format'](_0x8f25('0xaa'),_0x2afa3c[_0x8f25('0xa9')]['name'],_0x2afa3c['browser'][_0x8f25('0xab')]):_0x8f25('0xac'),'browserVersion':_0x2afa3c[_0x8f25('0xa9')]['version']||_0x8f25('0xac'),'osName':util[_0x8f25('0xad')](_0x8f25('0xaa'),_0x2afa3c['os'][_0x8f25('0x39')],_0x2afa3c['os'][_0x8f25('0xab')]),'osVersion':_0x2afa3c['os'][_0x8f25('0xab')],'deviceModel':_0x2afa3c[_0x8f25('0xae')][_0x8f25('0x47')]&&_0x2afa3c[_0x8f25('0xae')][_0x8f25('0xaf')]?util[_0x8f25('0xad')]('%s\x20%s\x20%s',_0x2afa3c[_0x8f25('0xae')][_0x8f25('0x47')],_0x2afa3c[_0x8f25('0xae')][_0x8f25('0xaf')],_0x2afa3c[_0x8f25('0xae')][_0x8f25('0x46')]):null,'deviceVendor':_0x2afa3c['device'][_0x8f25('0xaf')],'deviceType':_0x2afa3c[_0x8f25('0xae')][_0x8f25('0x46')],'formData':JSON[_0x8f25('0x24')](_0x581374[_0x8f25('0x3d')])};var _0x1c026d={'ChatWebsiteId':_0x581374[_0x8f25('0x58')]['id'],'closed':![]};if(_0x581374[_0x8f25('0x3d')][_0x8f25('0xb0')]){_0x1c026d['threadId']=_0x581374[_0x8f25('0x3d')][_0x8f25('0xb0')];return db[_0x8f25('0xb1')]['find']({'where':_0x1c026d})[_0x8f25('0x1f')](function(_0x3bba92){if(_0x3bba92){return[_0x3bba92,![]];}_0xbb6f21[_0x8f25('0xb0')]=_0x581374['body'][_0x8f25('0xb0')];_0xbb6f21['externalUrl']=_0x581374[_0x8f25('0x3d')][_0x8f25('0xb2')];return db['ChatInteraction'][_0x8f25('0x5d')](_0xbb6f21)[_0x8f25('0x1f')](function(_0x53a89d){return[_0x53a89d,!![]];});});}_0x1c026d[_0x8f25('0xb3')]=_0x39812a['id'];if(_0x581374[_0x8f25('0x3d')][_0x8f25('0x3f')]&&_0x581374[_0x8f25('0x3d')][_0x8f25('0x3f')]['id']){_0x1c026d['id']=_0x581374[_0x8f25('0x3d')][_0x8f25('0x3f')]['id'];return db[_0x8f25('0xb1')][_0x8f25('0x5c')]({'where':_0x1c026d})[_0x8f25('0x1f')](function(_0x696702){if(_0x696702){return[_0x696702,![]];}return db[_0x8f25('0xb1')][_0x8f25('0x5d')](_0xbb6f21)['then'](function(_0x5ab22b){return[_0x5ab22b,!![]];});});}return db['ChatInteraction']['create'](_0xbb6f21)['then'](function(_0x9909aa){return[_0x9909aa,!![]];});}})[_0x8f25('0xb4')](function(_0x3d8b9f,_0x5587f9){if(_0x3d8b9f){_0x4a5117=_0x5587f9;if(!_0x5587f9){var _0x2b927f={'from':(_0x1f3d88['contact'][_0x8f25('0xa5')]||'')+'\x20'+(_0x1f3d88[_0x8f25('0xa1')][_0x8f25('0xa6')]||'')};if(_0x581374[_0x8f25('0x3d')][_0x8f25('0xb0')]&&_0x581374[_0x8f25('0x3d')]['messageId']&&_0x581374[_0x8f25('0x3d')][_0x8f25('0xb0')]!=_0x581374['body'][_0x8f25('0xb5')]){_0x2b927f[_0x8f25('0xb0')]=_0x581374[_0x8f25('0x3d')][_0x8f25('0xb5')];}return _0x3d8b9f[_0x8f25('0x33')](_0x2b927f);}else{return _0x3d8b9f;}}})['then'](function(_0xfbc583){_0x1f3d88[_0x8f25('0x3f')]=_0xfbc583['get']({'plain':!![]});_0x1f3d88['interaction'][_0x8f25('0xb6')]=_0x4a5117;if(_0x1f3d88[_0x8f25('0x3f')]['created']){if(_0x1f3d88[_0x8f25('0x40')][_0x8f25('0xb7')]){_0x1f3d88[_0x8f25('0x9c')][_0x8f25('0xb8')]({'id':0x0,'priority':_0x1f3d88['applications'][_0x8f25('0x4e')]+0x1,'app':_0x8f25('0xb9'),'appdata':_0x8f25('0xba'),'interval':_0x8f25('0xbb')});}}return db[_0x8f25('0xbc')][_0x8f25('0x5d')]({'body':_0x581374['body'][_0x8f25('0x3d')],'ChatWebsiteId':_0x581374[_0x8f25('0x58')]['id'],'ChatInteractionId':_0xfbc583['id'],'direction':'in','ContactId':_0x1f3d88['contact']['id'],'AttachmentId':_0x581374[_0x8f25('0x3d')][_0x8f25('0xbd')]});})['then'](function(_0x57c796){_0x1f3d88[_0x8f25('0x28')]=_0x57c796;if(_0x1f3d88[_0x8f25('0x3f')][_0x8f25('0xbe')]){return db[_0x8f25('0xbf')][_0x8f25('0x5c')]({'attributes':['id',_0x8f25('0x39')],'where':{'id':_0x1f3d88[_0x8f25('0x3f')][_0x8f25('0xbe')]}})[_0x8f25('0x1f')](function(_0x172441){if(_0x172441){_0x1f3d88[_0x8f25('0x9c')][_0x8f25('0xc0')]({'id':0x0,'priority':0x0,'app':_0x8f25('0x3e'),'appdata':_0x172441[_0x8f25('0x39')]+','+(_0x1f3d88[_0x8f25('0x40')][_0x8f25('0xc1')]||0xa),'interval':_0x8f25('0xbb')});_0x1f3d88['forcedOwnership']=!![];}return respondWithRpcPromise(_0x8f25('0xc2'),_0x8f25('0xc3'),_0x1f3d88);});}return respondWithRpcPromise(_0x8f25('0xc2'),_0x8f25('0xc3'),_0x1f3d88);})[_0x8f25('0x1f')](function(_0x4e88b3){respondWithRpcPromise('EventManager',_0x8f25('0xc4'),{'event':_0x8f25('0x87'),'message':_0x4e88b3},client9002);return _0x4e88b3;})[_0x8f25('0x1f')](respondWithResult(_0x2eebc4,null))[_0x8f25('0x2a')](handleError(_0x2eebc4,null));};exports[_0x8f25('0xc5')]=function(_0x807e30,_0x342f2b,_0x3fa80d){var _0x44ea62,_0x282f21,_0x782c32;var _0x4395d3=[];var _0x2c4c09=[];var _0x271149={};var _0x18f474=_0x807e30[_0x8f25('0xc6')]||[];var _0x366506=[];var _0x2b23d2;return db['CmContact'][_0x8f25('0x63')]()[_0x8f25('0x1f')](function(_0x1142d9){if(!_0x1142d9){throw new db[(_0x8f25('0x8c'))][(_0x8f25('0x8d'))](_0x8f25('0x8e'));}_0x2c4c09=_[_0x8f25('0x8f')](_['keys'](_0x1142d9),[_0x8f25('0x90'),_0x8f25('0x91')]);_0x4395d3=_[_0x8f25('0x8f')](_[_0x8f25('0x48')](_0x1142d9),[_0x8f25('0x90'),_0x8f25('0x91'),_0x8f25('0xc7'),_0x8f25('0xc8')]);if(_0x807e30[_0x8f25('0x3d')]['id']){delete _0x807e30['body']['id'];}if(_[_0x8f25('0x7b')](_0x807e30[_0x8f25('0x3d')][_0x8f25('0x92')])){throw _0x342f2b[_0x8f25('0x2b')](0x1f4)[_0x8f25('0x3a')](new db[(_0x8f25('0x8c'))][(_0x8f25('0x8d'))](_0x8f25('0x93')));}if(_[_0x8f25('0x7b')](_0x807e30['body'][_0x8f25('0x3d')])||_0x807e30[_0x8f25('0x3d')]['body']===''){throw _0x342f2b[_0x8f25('0x2b')](0x1f4)[_0x8f25('0x3a')](new db[(_0x8f25('0x8c'))][(_0x8f25('0x8d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x807e30[_0x8f25('0x3d')][_0x8f25('0xc9')])){throw _0x342f2b[_0x8f25('0x2b')](0x1f4)['send'](new db['Sequelize']['ValidationError'](_0x8f25('0xca')+_0x4395d3));}if(!_[_0x8f25('0x96')](_0x4395d3,_0x807e30[_0x8f25('0x3d')]['mapKeyOffline'])){throw _0x342f2b[_0x8f25('0x2b')](0x1f4)[_0x8f25('0x3a')](new db[(_0x8f25('0x8c'))][(_0x8f25('0x8d'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4395d3));}_0x271149[_0x807e30[_0x8f25('0x3d')]['mapKeyOffline']]=_0x807e30['body'][_0x8f25('0x92')];})['then'](function(){return db[_0x8f25('0x43')]['find']({'where':{'id':_0x807e30[_0x8f25('0x58')]['id']},'include':[{'model':db[_0x8f25('0xcb')],'as':_0x8f25('0x98')},{'model':db['MailAccount'],'as':_0x8f25('0xcc')}]});})[_0x8f25('0x1f')](handleEntityNotFound(_0x342f2b,null))[_0x8f25('0x1f')](function(_0x17e861){if(_0x17e861&&_0x17e861['List']){_0x282f21=_0x17e861;var _0x2a7e84=_['defaults'](_0x807e30[_0x8f25('0x3d')],{'firstName':_0x807e30[_0x8f25('0x3d')][_0x8f25('0x92')],'phone':_0x807e30[_0x8f25('0x3d')][_0x8f25('0x92')],'ListId':_0x17e861['ListId']});_0x2a7e84[_0x807e30[_0x8f25('0x3d')][_0x8f25('0xc9')]]=_0x807e30[_0x8f25('0x3d')][_0x8f25('0x92')];return db[_0x8f25('0x8b')][_0x8f25('0xcd')]({'where':_0x271149,'defaults':_0x2a7e84});}})[_0x8f25('0xb4')](function(_0x1c5f1d){if(_0x1c5f1d){_0x782c32=_0x1c5f1d;var _0x4358c0=fs[_0x8f25('0xce')](path[_0x8f25('0x78')](config[_0x8f25('0x7d')],_0x8f25('0xcf')),_0x8f25('0xd0'));var _0x189ea8=ejs[_0x8f25('0x3b')](_0x4358c0,{'body':_['toPairs'](_0x807e30[_0x8f25('0x3d')][_0x8f25('0x3d')]),'bodyTitle':_0x282f21[_0x8f25('0xd1')]});return db[_0x8f25('0xd2')][_0x8f25('0x5d')]({'body':_0x189ea8,'ContactId':_0x1c5f1d['id'],'ChatWebsiteId':_0x282f21['id']});}})[_0x8f25('0x1f')](function(_0x43cd02){_0x2b23d2=_0x43cd02;if(_0x18f474[_0x8f25('0x4e')]){var _0x3e76a3=_0x18f474['map'](function(_0x2367a0){return{'name':_0x2367a0[_0x8f25('0xd3')],'basename':_0x2367a0[_0x8f25('0x75')],'type':_0x2367a0[_0x8f25('0xd4')],'ChatOfflineMessageId':_0x43cd02['id']};});_0x366506=_0x3e76a3[_0x8f25('0x42')](_0x1e6cba=>{var _0x1f2269={'filename':_0x1e6cba['name'],'path':path[_0x8f25('0x78')](config['root'],_0x8f25('0xd5'),_0x8f25('0xc6'),'attachments','offline-chat',_0x1e6cba[_0x8f25('0xd6')])};return _0x1f2269;});if(!_0x282f21[_0x8f25('0xd7')]){return db[_0x8f25('0xd8')][_0x8f25('0xd9')](function(_0x43a536){return db[_0x8f25('0xda')][_0x8f25('0xdb')](_0x3e76a3,{'transaction':_0x43a536});});}}})[_0x8f25('0x1f')](function(){if(_0x2b23d2){_0x44ea62=_0x2b23d2;return db[_0x8f25('0xcc')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0x8f25('0xdc')],'as':'Smtp','raw':!![]}]});}})[_0x8f25('0x1f')](function(_0x1b8e73){if(_0x1b8e73&&_0x1b8e73['Smtp']&&_0x282f21[_0x8f25('0xdd')]&&_0x282f21[_0x8f25('0xde')]){var _0x5d0689={'tls':{'rejectUnauthorized':![]}};if(_0x1b8e73[_0x8f25('0xdf')][_0x8f25('0xe0')]){_0x5d0689[_0x8f25('0xe0')]=_0x1b8e73[_0x8f25('0xdf')]['service'];}else{_0x5d0689['host']=_0x1b8e73[_0x8f25('0xdf')][_0x8f25('0xe1')];_0x5d0689[_0x8f25('0xe2')]=_0x1b8e73[_0x8f25('0xdf')][_0x8f25('0xe2')];_0x5d0689['secure']=_0x1b8e73[_0x8f25('0xdf')][_0x8f25('0xe3')];}if(_0x1b8e73[_0x8f25('0xdf')][_0x8f25('0xe4')]){_0x5d0689[_0x8f25('0xe5')]={'user':_0x1b8e73[_0x8f25('0xdf')][_0x8f25('0x5e')],'pass':_0x1b8e73[_0x8f25('0xdf')][_0x8f25('0xe6')]};}return respondWithRpcPromise('SendMail',_0x8f25('0xe7'),{'account':_0x5d0689,'message':{'from':util['format'](_0x8f25('0xe8'),_0x1b8e73[_0x8f25('0x39')],_0x1b8e73['email']||_0x1b8e73[_0x8f25('0xdf')][_0x8f25('0x5e')]),'to':_0x282f21[_0x8f25('0xde')],'subject':_0x282f21[_0x8f25('0xe9')],'html':_0x44ea62['body'],'attachments':_0x366506}},client9003)[_0x8f25('0x1f')](function(){return _0x44ea62;})[_0x8f25('0x2a')](function(_0x194604){console[_0x8f25('0x25')](_0x194604);});}})[_0x8f25('0x1f')](function(){if(_0x282f21&&_0x282f21[_0x8f25('0xd7')]&&_0x282f21[_0x8f25('0xea')]){var _0x871d0a=[];if(_0x18f474[_0x8f25('0x4e')]){_0x871d0a=_0x18f474[_0x8f25('0x42')](function(_0x3b6769){return{'name':_0x3b6769[_0x8f25('0xd3')],'basename':_0x3b6769['filename'],'type':_0x3b6769[_0x8f25('0xd4')],'ChatOfflineMessageId':_0x2b23d2['id']};});}var _0x2a9133;if(!_[_0x8f25('0x7b')](_0x282f21[_0x8f25('0xeb')])){var _0x7d97f6=_['map'](_0x807e30['body'],function(_0x5da4e6){return _0x5da4e6;});var _0x3ba503=_['toPairsIn'](_0x7d97f6)[0x0];var _0x1a4ba8=_[_0x8f25('0xec')](_0x3ba503,function(_0x31d311){return _0x31d311;});_0x2a9133=_0x1a4ba8[0x1][_0x282f21[_0x8f25('0xeb')]];}var _0x233cda={'from':_0x782c32['email'],'firstName':_0x782c32[_0x8f25('0xa5')],'lastName':_0x782c32['lastName'],'mapKey':_0x8f25('0xed'),'message':{'from':_0x782c32[_0x8f25('0xed')],'to':_0x282f21['MailAccount'][_0x8f25('0xed')],'cc':'','subject':_[_0x8f25('0x7b')](_0x2a9133)?_0x282f21[_0x8f25('0xe9')]:_0x2a9133,'messageId':'','sentAt':new Date(),'attach':_0x871d0a[_0x8f25('0x4e')],'attachments':_0x871d0a,'originChannel':_0x8f25('0xee'),'ChatWebsiteId':_0x282f21['id'],'ChatOfflineMessageId':_0x44ea62['id'],'originTo':_0x282f21[_0x8f25('0xcc')][_0x8f25('0xed')]},'body':_0x44ea62[_0x8f25('0x3d')]};var _0x354ef3={'account':{'id':_0x282f21[_0x8f25('0xea')]},'body':_0x233cda,'log':_0x8f25('0xef')};return respondWithRpcPromise(_0x8f25('0xef'),'notifyMail',_0x354ef3,client9001)[_0x8f25('0x1f')](function(){return _0x44ea62;})[_0x8f25('0x2a')](function(_0x4953cf){console[_0x8f25('0x25')](_0x4953cf);});}return;})[_0x8f25('0x1f')](function(){if(_0x44ea62){return _0x44ea62;}})[_0x8f25('0x1f')](respondWithResult(_0x342f2b,null))[_0x8f25('0x2a')](function(_0x22644d){console['error'](_0x8f25('0x2a'),_0x22644d);for(var _0x2a49f7 of _0x18f474){var _0x45c8c7=path[_0x8f25('0x78')](config[_0x8f25('0x7d')],_0x8f25('0xd5'),'files','attachments','offline-chat',_0x2a49f7[_0x8f25('0x75')]);fs_extra[_0x8f25('0xf0')](_0x45c8c7)[_0x8f25('0x2a')](function(_0x554f8c){console[_0x8f25('0x25')]('Could\x20not\x20remove\x20attachment\x20file',_0x45c8c7,_0x554f8c);});}});};exports['addInteraction']=function(_0x25020e,_0x38dfa7,_0xafa32c){return db[_0x8f25('0xb1')][_0x8f25('0x5c')]({'where':{'id':_0x25020e['params']['id']}})[_0x8f25('0x1f')](handleEntityNotFound(_0x38dfa7,null))[_0x8f25('0x1f')](function(_0x5ed6de){if(_0x5ed6de){return _0x5ed6de[_0x8f25('0xf1')](_0x25020e[_0x8f25('0x3d')][_0x8f25('0x6c')],_[_0x8f25('0xf2')](_0x25020e['body'],[_0x8f25('0x6c'),'id'])||{});}})['then'](respondWithResult(_0x38dfa7,null))[_0x8f25('0x2a')](handleError(_0x38dfa7,null));};exports[_0x8f25('0xf3')]=function(_0xb64585,_0x3da399,_0x123162){var _0x464c07={'raw':![],'where':{}};var _0x4f4bb2={};var _0x296497={'count':0x0,'rows':[]};return db[_0x8f25('0x43')][_0x8f25('0x67')]({'where':{'id':_0xb64585[_0x8f25('0x58')]['id']}})['then'](handleEntityNotFound(_0x3da399,null))['then'](function(_0x5e2604){if(_0x5e2604){_0x4f4bb2[_0x8f25('0x47')]=_[_0x8f25('0x48')](db['ChatInteraction'][_0x8f25('0x44')]);_0x4f4bb2[_0x8f25('0x49')]=_[_0x8f25('0x48')](_0xb64585[_0x8f25('0x49')]);_0x4f4bb2[_0x8f25('0x4a')]=_[_0x8f25('0x4b')](_0x4f4bb2[_0x8f25('0x47')],_0x4f4bb2['query']);_0x464c07[_0x8f25('0x4c')]=_['intersection'](_0x4f4bb2[_0x8f25('0x47')],qs[_0x8f25('0x4d')](_0xb64585['query']['fields']));_0x464c07[_0x8f25('0x4c')]=_0x464c07[_0x8f25('0x4c')][_0x8f25('0x4e')]?_0x464c07[_0x8f25('0x4c')]:_0x4f4bb2[_0x8f25('0x47')];if(!_0xb64585['query']['hasOwnProperty'](_0x8f25('0x50'))){_0x464c07[_0x8f25('0x2f')]=qs[_0x8f25('0x2f')](_0xb64585[_0x8f25('0x49')][_0x8f25('0x2f')]);_0x464c07['offset']=qs['offset'](_0xb64585[_0x8f25('0x49')][_0x8f25('0x2e')]);}_0x464c07['order']=qs['sort'](_0xb64585[_0x8f25('0x49')]['sort']);_0x464c07[_0x8f25('0x52')]=qs[_0x8f25('0x4a')](_[_0x8f25('0x53')](_0xb64585[_0x8f25('0x49')],_0x4f4bb2[_0x8f25('0x4a')]));_0x464c07[_0x8f25('0x52')][_0x8f25('0x69')]=_0x5e2604['id'];if(_0xb64585['query']['filter']){_0x464c07[_0x8f25('0x52')]=_[_0x8f25('0x3c')](_0x464c07[_0x8f25('0x52')],{'$or':_['map'](_0x464c07[_0x8f25('0x4c')],function(_0x33dce0){var _0xc6518={};_0xc6518[_0x33dce0]={'$like':'%'+_0xb64585[_0x8f25('0x49')]['filter']+'%'};return _0xc6518;})});}_0x464c07=_[_0x8f25('0x3c')]({},_0x464c07,_0xb64585[_0x8f25('0x55')]);return db[_0x8f25('0xb1')]['count']({'where':_0x464c07['where']})['then'](function(_0x2fa82f){_0x296497['count']=_0x2fa82f;if(_0xb64585[_0x8f25('0x49')][_0x8f25('0x5a')]){_0x464c07[_0x8f25('0x5b')]=[{'model':db['CmContact'],'as':_0x8f25('0xf4'),'required':![]},{'model':db[_0x8f25('0xbf')],'as':_0x8f25('0xf5'),'attributes':[_0x8f25('0x39'),_0x8f25('0xf6'),_0x8f25('0xf7')],'required':![]},{'model':db[_0x8f25('0xf8')],'as':_0x8f25('0xf9'),'attributes':['id','name',_0x8f25('0xfa')],'where':_0xb64585['query'][_0x8f25('0xfb')]?{'id':_0xb64585['query']['tag']}:undefined,'required':_0xb64585['query'][_0x8f25('0xfb')]?!![]:![]}];}return db[_0x8f25('0xb1')][_0x8f25('0x6a')](_0x464c07);})[_0x8f25('0x1f')](function(_0x46573e){_0x296497[_0x8f25('0x56')]=_0x46573e;return _0x296497;});}})[_0x8f25('0x1f')](respondWithFilteredResult(_0x3da399,_0x464c07))[_0x8f25('0x2a')](handleError(_0x3da399,null));};function iftimePromise(_0x7e5b28,_0x32659f){return respondWithRpcPromise(_0x8f25('0xfc'),_0x8f25('0xfd'),{'command':_0x32659f[_0x8f25('0xfe')]?util[_0x8f25('0xad')]('iftime\x20%s,%s',_0x7e5b28[_0x8f25('0xff')],_0x32659f[_0x8f25('0xfe')]):util[_0x8f25('0xad')](_0x8f25('0x100'),_0x7e5b28[_0x8f25('0xff')])},client9002)['then'](function(_0x4e3dd4){var _0x5fa412=_0x4e3dd4&&_0x4e3dd4['indexOf'](_0x8f25('0x101'))>=0x0?!![]:![];logger[_0x8f25('0x20')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x32659f['id'],_0x7e5b28['id'],_0x7e5b28[_0x8f25('0xff')],_0x5fa412?_0x8f25('0x102'):_0x8f25('0x103'),_0x32659f[_0x8f25('0xfe')]?_0x32659f[_0x8f25('0xfe')]:'No\x20timezone');return _0x5fa412;})[_0x8f25('0x2a')](function(_0x5db1b3){logger[_0x8f25('0x25')](_0x8f25('0x104'),_0x32659f['id'],_0x7e5b28['id'],_0x7e5b28['interval'],util[_0x8f25('0x105')](_0x5db1b3,{'showHidden':![],'depth':null}),_0x32659f[_0x8f25('0xfe')]?_0x32659f[_0x8f25('0xfe')]:_0x8f25('0x106'));return![];});}exports[_0x8f25('0xfd')]=function(_0x465238,_0x345ceb,_0x5cb447){var _0x41f38f=0x0;var _0xb876f=0x0;var _0xf50902=![];var _0x57e6d6;var _0x15df94;return db[_0x8f25('0x43')][_0x8f25('0x5c')]({'where':{'id':_0x465238[_0x8f25('0x58')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db['Interval'],'as':_0x8f25('0x107'),'attributes':['id',_0x8f25('0xff')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x345ceb,null))[_0x8f25('0x1f')](function(_0x425602){if(_0x425602){_0x57e6d6=_0x425602;return _0x425602[_0x8f25('0x108')]({'raw':!![]});}})[_0x8f25('0x1f')](function(_0x929e0d){if(_0x57e6d6){if(_0x929e0d){_0x15df94=_0x929e0d;}}return require('../../config/license/util')['getLicense']();})[_0x8f25('0x1f')](function(_0x150934){if(_0x150934){_0xb876f=_0x150934[_0x8f25('0x109')];_0xf50902=_0x150934[_0x8f25('0x10a')];}})[_0x8f25('0x1f')](function(){return db[_0x8f25('0xb1')]['count']({'where':{'closed':![]}});})['then'](function(_0xf75a33){_0x41f38f=_0xf75a33;if(_0xb876f&&_0xf75a33>_0xb876f){return db[_0x8f25('0x10b')][_0x8f25('0x67')]({'where':{'id':0x1}})[_0x8f25('0x1f')](function(_0xe7a991){if(_0xe7a991){_0xe7a991[_0x8f25('0x10c')](_0x8f25('0x10d'));}});}})[_0x8f25('0x1f')](function(){if(_0x57e6d6[_0x8f25('0x10e')]&&_0x57e6d6[_0x8f25('0x10e')]['Intervals']){var _0x222a73=[];for(var _0x482706=0x0;_0x482706<_0x57e6d6[_0x8f25('0x10e')][_0x8f25('0x107')][_0x8f25('0x4e')];_0x482706++){var _0x1eb4fa=_0x57e6d6[_0x8f25('0x10e')][_0x8f25('0x107')][_0x482706][_0x8f25('0x34')]({'plain':!![]});_0x222a73[_0x8f25('0xb8')](iftimePromise(_0x1eb4fa,_0x57e6d6));}return BPromise[_0x8f25('0x10f')](_0x222a73)[_0x8f25('0x1f')](function(_0xf3d973){return _[_0x8f25('0x110')](_0xf3d973);});}else{return!![];}})[_0x8f25('0x1f')](function(_0x2d960b){var _0x228866=fs[_0x8f25('0xce')](path['join'](config[_0x8f25('0x7d')],_0x8f25('0x111')),_0x8f25('0xd0'));var _0x2656ba={'remote':_0x57e6d6[_0x8f25('0x112')],'query':querystring[_0x8f25('0x24')](_[_0x8f25('0x3c')](_0x57e6d6['get']({'plain':!![]}),{'customerIp':_0x465238['headers']['x-forwarded-for']||_0x465238[_0x8f25('0x89')][_0x8f25('0x113')]||_0x465238['connection'][_0x8f25('0x114')]||_0x465238['ip'],'referer':_0x465238[_0x8f25('0x89')][_0x8f25('0xa8')],'openedInteractions':_0x41f38f,'maxInteractions':_0xb876f,'virtual':_0xf50902[_0x8f25('0x109')],'online':_0x2d960b,'custom':_0xf50902}))[_0x8f25('0x115')](/'/g,'\x5c\x27')};_0x345ceb['send'](ejs['render'](Mustache[_0x8f25('0x3b')](_0x228866,_0x2656ba),{'proactiveActions':_0x15df94,'alignment':_0x57e6d6[_0x8f25('0x116')],'verticalAlignment':_0x57e6d6[_0x8f25('0x117')],'div_color':_0x57e6d6[_0x8f25('0xfa')],'text_color':_0x57e6d6[_0x8f25('0x118')],'button_color':_0x57e6d6[_0x8f25('0x119')],'background_color':_0x57e6d6[_0x8f25('0x11a')]}));})[_0x8f25('0x2a')](handleError(_0x345ceb,null));};exports['addApplications']=function(_0x28b627,_0x15ef4d,_0x2b228c){return db[_0x8f25('0x43')][_0x8f25('0x67')]({'where':{'id':_0x28b627[_0x8f25('0x58')]['id']}})[_0x8f25('0x1f')](handleEntityNotFound(_0x15ef4d,null))[_0x8f25('0x1f')](function(_0x27707c){if(_0x27707c){return db[_0x8f25('0xd8')][_0x8f25('0xd9')](function(_0x5bb95b){return db[_0x8f25('0x11b')]['destroy']({'where':{'ChatWebsiteId':_0x28b627[_0x8f25('0x58')]['id']},'transaction':_0x5bb95b})[_0x8f25('0x1f')](function(_0x35c61e){var _0xea0153=_[_0x8f25('0x42')](_0x28b627[_0x8f25('0x3d')],function(_0x2c59a9){_0x2c59a9[_0x8f25('0x69')]=_0x28b627[_0x8f25('0x58')]['id'];return _0x2c59a9;});return db[_0x8f25('0x11b')]['bulkCreate'](_0xea0153,{'transaction':_0x5bb95b});});})[_0x8f25('0x1f')](function(){return db['ChatApplication'][_0x8f25('0x11c')]({'where':{'ChatWebsiteId':_0x28b627[_0x8f25('0x58')]['id']},'order':_0x8f25('0x9f')});});}})[_0x8f25('0x1f')](respondWithResult(_0x15ef4d,null))[_0x8f25('0x2a')](handleError(_0x15ef4d,null));};exports[_0x8f25('0x11d')]=function(_0x32c79c,_0x34932e,_0x10fce7){var _0x3dca9c={};var _0x428de6={};var _0x303fb9;var _0x5363e1;return db[_0x8f25('0x43')]['findOne']({'where':{'id':_0x32c79c[_0x8f25('0x58')]['id']}})[_0x8f25('0x1f')](handleEntityNotFound(_0x34932e,null))[_0x8f25('0x1f')](function(_0x615fee){if(_0x615fee){_0x303fb9=_0x615fee;_0x428de6[_0x8f25('0x47')]=_[_0x8f25('0x48')](db['ChatApplication'][_0x8f25('0x44')]);_0x428de6[_0x8f25('0x49')]=_[_0x8f25('0x48')](_0x32c79c[_0x8f25('0x49')]);_0x428de6[_0x8f25('0x4a')]=_[_0x8f25('0x4b')](_0x428de6[_0x8f25('0x47')],_0x428de6[_0x8f25('0x49')]);_0x3dca9c['attributes']=_[_0x8f25('0x4b')](_0x428de6[_0x8f25('0x47')],qs['fields'](_0x32c79c[_0x8f25('0x49')][_0x8f25('0x4d')]));_0x3dca9c[_0x8f25('0x4c')]=_0x3dca9c['attributes']['length']?_0x3dca9c[_0x8f25('0x4c')]:_0x428de6[_0x8f25('0x47')];_0x3dca9c[_0x8f25('0x68')]=qs['sort'](_0x32c79c['query'][_0x8f25('0x51')]);_0x3dca9c[_0x8f25('0x52')]=qs[_0x8f25('0x4a')](_[_0x8f25('0x53')](_0x32c79c['query'],_0x428de6[_0x8f25('0x4a')]));if(_0x32c79c[_0x8f25('0x49')]['filter']){_0x3dca9c[_0x8f25('0x52')]=_[_0x8f25('0x3c')](_0x3dca9c[_0x8f25('0x52')],{'$or':_[_0x8f25('0x42')](_0x3dca9c[_0x8f25('0x4c')],function(_0x2513c6){var _0x2db249={};_0x2db249[_0x2513c6]={'$like':'%'+_0x32c79c['query'][_0x8f25('0x54')]+'%'};return _0x2db249;})});}_0x3dca9c=_['merge']({},_0x3dca9c,_0x32c79c['options']);return _0x303fb9[_0x8f25('0x11d')](_0x3dca9c);}})[_0x8f25('0x1f')](function(_0x2d4ac8){if(_0x2d4ac8){_0x5363e1=_0x2d4ac8[_0x8f25('0x4e')];if(!_0x32c79c[_0x8f25('0x49')][_0x8f25('0x4f')](_0x8f25('0x50'))){_0x3dca9c['limit']=qs[_0x8f25('0x2f')](_0x32c79c[_0x8f25('0x49')][_0x8f25('0x2f')]);_0x3dca9c[_0x8f25('0x2e')]=qs[_0x8f25('0x2e')](_0x32c79c[_0x8f25('0x49')]['offset']);}return _0x303fb9[_0x8f25('0x11d')](_0x3dca9c);}})[_0x8f25('0x1f')](function(_0x304c4a){if(_0x304c4a){return _0x304c4a?{'count':_0x5363e1,'rows':_0x304c4a}:null;}})['then'](respondWithResult(_0x34932e,null))[_0x8f25('0x2a')](handleError(_0x34932e,null));};exports[_0x8f25('0x11e')]=function(_0x35b83a,_0x5d9a7c,_0x331206){return db[_0x8f25('0x11f')][_0x8f25('0x5c')]({'where':{'id':_0x35b83a[_0x8f25('0x58')]['id']}})[_0x8f25('0x1f')](handleEntityNotFound(_0x5d9a7c,null))['then'](function(_0x219a6e){if(_0x219a6e){return _0x219a6e[_0x8f25('0x11e')](_0x35b83a[_0x8f25('0x3d')][_0x8f25('0x6c')],_[_0x8f25('0xf2')](_0x35b83a[_0x8f25('0x3d')],[_0x8f25('0x6c'),'id'])||{});}})[_0x8f25('0x1f')](respondWithResult(_0x5d9a7c,null))['catch'](handleError(_0x5d9a7c,null));};exports['getProactiveActions']=function(_0x3c00e7,_0x5aff06,_0x1572cc){var _0x3aadf9={};var _0xc9f9b={};var _0x5203b3;var _0x2029d6;return db[_0x8f25('0x43')][_0x8f25('0x67')]({'where':{'id':_0x3c00e7['params']['id']}})['then'](handleEntityNotFound(_0x5aff06,null))[_0x8f25('0x1f')](function(_0x2bfc20){if(_0x2bfc20){_0x5203b3=_0x2bfc20;_0xc9f9b[_0x8f25('0x47')]=_['keys'](db['ChatProactiveAction'][_0x8f25('0x44')]);_0xc9f9b[_0x8f25('0x49')]=_[_0x8f25('0x48')](_0x3c00e7[_0x8f25('0x49')]);_0xc9f9b['filters']=_['intersection'](_0xc9f9b[_0x8f25('0x47')],_0xc9f9b[_0x8f25('0x49')]);_0x3aadf9[_0x8f25('0x4c')]=_[_0x8f25('0x4b')](_0xc9f9b[_0x8f25('0x47')],qs['fields'](_0x3c00e7[_0x8f25('0x49')][_0x8f25('0x4d')]));_0x3aadf9[_0x8f25('0x4c')]=_0x3aadf9[_0x8f25('0x4c')][_0x8f25('0x4e')]?_0x3aadf9[_0x8f25('0x4c')]:_0xc9f9b['model'];_0x3aadf9[_0x8f25('0x68')]=qs['sort'](_0x3c00e7[_0x8f25('0x49')][_0x8f25('0x51')]);_0x3aadf9[_0x8f25('0x52')]=qs[_0x8f25('0x4a')](_[_0x8f25('0x53')](_0x3c00e7[_0x8f25('0x49')],_0xc9f9b[_0x8f25('0x4a')]));if(_0x3c00e7[_0x8f25('0x49')][_0x8f25('0x54')]){_0x3aadf9[_0x8f25('0x52')]=_[_0x8f25('0x3c')](_0x3aadf9[_0x8f25('0x52')],{'$or':_[_0x8f25('0x42')](_0x3aadf9[_0x8f25('0x4c')],function(_0x3e8518){var _0x3cf0d5={};_0x3cf0d5[_0x3e8518]={'$like':'%'+_0x3c00e7[_0x8f25('0x49')]['filter']+'%'};return _0x3cf0d5;})});}_0x3aadf9=_[_0x8f25('0x3c')]({},_0x3aadf9,_0x3c00e7[_0x8f25('0x55')]);return _0x5203b3['getProactiveActions'](_0x3aadf9);}})[_0x8f25('0x1f')](function(_0xb98347){if(_0xb98347){_0x2029d6=_0xb98347[_0x8f25('0x4e')];if(!_0x3c00e7[_0x8f25('0x49')][_0x8f25('0x4f')]('nolimit')){_0x3aadf9[_0x8f25('0x2f')]=qs[_0x8f25('0x2f')](_0x3c00e7[_0x8f25('0x49')][_0x8f25('0x2f')]);_0x3aadf9['offset']=qs[_0x8f25('0x2e')](_0x3c00e7[_0x8f25('0x49')][_0x8f25('0x2e')]);}return _0x5203b3[_0x8f25('0x108')](_0x3aadf9);}})[_0x8f25('0x1f')](function(_0x36ff65){if(_0x36ff65){return _0x36ff65?{'count':_0x2029d6,'rows':_0x36ff65}:null;}})['then'](respondWithResult(_0x5aff06,null))[_0x8f25('0x2a')](handleError(_0x5aff06,null));};exports[_0x8f25('0x120')]=function(_0x24b06d,_0x57e562,_0x4cc21d){var _0x53fe36=_0x24b06d[_0x8f25('0x49')]['online']==='false'?_0x8f25('0x121'):_0x8f25('0x122');return db[_0x8f25('0x43')]['find']({'attributes':['id',_0x53fe36],'where':{'id':_0x24b06d[_0x8f25('0x58')]['id']}})[_0x8f25('0x1f')](handleEntityNotFound(_0x57e562,null))[_0x8f25('0x1f')](function(_0x145a8d){if(_0x145a8d){var _0x5971bd=_0x145a8d[_0x53fe36];var _0x4eec31=_0x5971bd&&_0x5971bd[_0x8f25('0x123')]?_0x5971bd[_0x8f25('0x123')]:[];_0x57e562[_0x8f25('0x3a')]({'fromKey':_[_0x8f25('0x7b')](_0x5971bd[_0x8f25('0x124')])?undefined:_0x5971bd['fromKey'],'count':_0x4eec31['length'],'rows':_0x4eec31});}})[_0x8f25('0x2a')](handleError(_0x57e562,null));};exports[_0x8f25('0x125')]=function(_0xaafce6,_0x2a6d42,_0x43fee6){var _0x50eb58={'raw':![],'where':{}};var _0x5637b2={};var _0x2c664c={'count':0x0,'rows':[]};return db[_0x8f25('0x43')][_0x8f25('0x67')]({'where':{'id':_0xaafce6[_0x8f25('0x58')]['id']}})[_0x8f25('0x1f')](handleEntityNotFound(_0x2a6d42,null))['then'](function(_0x1d3b2a){if(_0x1d3b2a){_0x5637b2['model']=_[_0x8f25('0x48')](db[_0x8f25('0xd2')][_0x8f25('0x44')]);_0x5637b2['query']=_[_0x8f25('0x48')](_0xaafce6[_0x8f25('0x49')]);_0x5637b2[_0x8f25('0x4a')]=_[_0x8f25('0x4b')](_0x5637b2[_0x8f25('0x47')],_0x5637b2[_0x8f25('0x49')]);_0x50eb58[_0x8f25('0x4c')]=_['intersection'](_0x5637b2[_0x8f25('0x47')],qs[_0x8f25('0x4d')](_0xaafce6[_0x8f25('0x49')][_0x8f25('0x4d')]));_0x50eb58[_0x8f25('0x4c')]=_0x50eb58['attributes']['length']?_0x50eb58[_0x8f25('0x4c')]:_0x5637b2[_0x8f25('0x47')];if(!_0xaafce6[_0x8f25('0x49')][_0x8f25('0x4f')](_0x8f25('0x50'))){_0x50eb58['limit']=qs[_0x8f25('0x2f')](_0xaafce6[_0x8f25('0x49')][_0x8f25('0x2f')]);_0x50eb58['offset']=qs[_0x8f25('0x2e')](_0xaafce6[_0x8f25('0x49')][_0x8f25('0x2e')]);}_0x50eb58['order']=qs[_0x8f25('0x51')](_0xaafce6[_0x8f25('0x49')][_0x8f25('0x51')]);_0x50eb58[_0x8f25('0x52')]=qs[_0x8f25('0x4a')](_['pick'](_0xaafce6[_0x8f25('0x49')],_0x5637b2[_0x8f25('0x4a')]));_0x50eb58[_0x8f25('0x52')][_0x8f25('0x69')]=_0x1d3b2a['id'];if(_0xaafce6[_0x8f25('0x49')]['filter']){_0x50eb58['where']=_['merge'](_0x50eb58['where'],{'$or':_[_0x8f25('0x42')](_0x50eb58[_0x8f25('0x4c')],function(_0x18313b){var _0x211a48={};_0x211a48[_0x18313b]={'$like':'%'+_0xaafce6[_0x8f25('0x49')]['filter']+'%'};return _0x211a48;})});}_0x50eb58=_['merge']({},_0x50eb58,_0xaafce6['options']);return db[_0x8f25('0xd2')]['count']({'where':_0x50eb58[_0x8f25('0x52')]})[_0x8f25('0x1f')](function(_0x5eab51){_0x2c664c[_0x8f25('0x30')]=_0x5eab51;if(_0xaafce6[_0x8f25('0x49')]['includeAll']){_0x50eb58[_0x8f25('0x5b')]=[{'all':!![]}];}else{_0x50eb58[_0x8f25('0x5b')]=[{'model':db[_0x8f25('0x8b')],'as':_0x8f25('0xf4'),'required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0x8f25('0x6a')](_0x50eb58);})['then'](function(_0x1a786a){_0x2c664c[_0x8f25('0x56')]=_0x1a786a;return _0x2c664c;});}})['then'](respondWithFilteredResult(_0x2a6d42,_0x50eb58))[_0x8f25('0x2a')](handleError(_0x2a6d42,null));};exports[_0x8f25('0x126')]=function(_0x4c1349,_0x4eea0d,_0x2d047f){return db[_0x8f25('0x43')]['find']({'where':{'id':_0x4c1349['params']['id']}})[_0x8f25('0x1f')](handleEntityNotFound(_0x4eea0d,null))[_0x8f25('0x1f')](function(_0x331975){if(_0x331975){return _0x331975[_0x8f25('0x126')](_0x4c1349[_0x8f25('0x3d')]['ids'],_[_0x8f25('0xf2')](_0x4c1349['body'],[_0x8f25('0x6c'),'id'])||{})[_0x8f25('0xb4')](function(_0x1d014b){for(var _0x4aeb09=0x0;_0x4aeb09<_0x4c1349[_0x8f25('0x3d')][_0x8f25('0x6c')][_0x8f25('0x4e')];_0x4aeb09+=0x1){socket[_0x8f25('0x127')](_0x8f25('0x128'),{'UserId':_0x4c1349['body'][_0x8f25('0x6c')][_0x4aeb09],'ChatWebsiteId':_0x4c1349[_0x8f25('0x58')]['id']});}return _0x1d014b;});}})['then'](respondWithResult(_0x4eea0d,null))[_0x8f25('0x2a')](handleError(_0x4eea0d,null));};exports[_0x8f25('0x129')]=function(_0x3e1fed,_0x5b3ada,_0x3ca2f0){return db['ChatWebsite'][_0x8f25('0x5c')]({'where':{'id':_0x3e1fed[_0x8f25('0x58')]['id']}})[_0x8f25('0x1f')](handleEntityNotFound(_0x5b3ada,null))['then'](function(_0x4494eb){if(_0x4494eb){return _0x4494eb[_0x8f25('0x129')](_0x3e1fed[_0x8f25('0x49')][_0x8f25('0x6c')])[_0x8f25('0x1f')](function(){if(_['isArray'](_0x3e1fed[_0x8f25('0x49')][_0x8f25('0x6c')])){for(var _0x215553=0x0;_0x215553<_0x3e1fed[_0x8f25('0x49')][_0x8f25('0x6c')]['length'];_0x215553+=0x1){socket[_0x8f25('0x127')]('userChatWebsite:remove',{'UserId':Number(_0x3e1fed[_0x8f25('0x49')][_0x8f25('0x6c')][_0x215553]),'ChatWebsiteId':Number(_0x3e1fed['params']['id'])});}}else{socket[_0x8f25('0x127')](_0x8f25('0x12a'),{'UserId':Number(_0x3e1fed[_0x8f25('0x49')][_0x8f25('0x6c')]),'ChatWebsiteId':Number(_0x3e1fed['params']['id'])});}});}})['then'](respondWithStatusCode(_0x5b3ada,null))['catch'](handleError(_0x5b3ada,null));};exports[_0x8f25('0x12b')]=function(_0x5463c5,_0x46cb6c,_0x867fc8){var _0x5b29a8={};var _0x3928e4={};var _0x21ee90;var _0x2bd2f2;return db[_0x8f25('0x43')][_0x8f25('0x67')]({'where':{'id':_0x5463c5[_0x8f25('0x58')]['id']}})[_0x8f25('0x1f')](handleEntityNotFound(_0x46cb6c,null))[_0x8f25('0x1f')](function(_0x6ce54c){if(_0x6ce54c){_0x21ee90=_0x6ce54c;_0x3928e4[_0x8f25('0x47')]=_['keys'](db[_0x8f25('0xbf')][_0x8f25('0x44')]);_0x3928e4['query']=_[_0x8f25('0x48')](_0x5463c5[_0x8f25('0x49')]);_0x3928e4['filters']=_[_0x8f25('0x4b')](_0x3928e4[_0x8f25('0x47')],_0x3928e4[_0x8f25('0x49')]);_0x5b29a8[_0x8f25('0x4c')]=_['intersection'](_0x3928e4['model'],qs[_0x8f25('0x4d')](_0x5463c5[_0x8f25('0x49')][_0x8f25('0x4d')]));_0x5b29a8['attributes']=_0x5b29a8[_0x8f25('0x4c')][_0x8f25('0x4e')]?_0x5b29a8['attributes']:_0x3928e4['model'];_0x5b29a8[_0x8f25('0x68')]=qs['sort'](_0x5463c5[_0x8f25('0x49')]['sort']);_0x5b29a8[_0x8f25('0x52')]=qs[_0x8f25('0x4a')](_['pick'](_0x5463c5[_0x8f25('0x49')],_0x3928e4[_0x8f25('0x4a')]));if(_0x5463c5['query'][_0x8f25('0x54')]){_0x5b29a8['where']=_[_0x8f25('0x3c')](_0x5b29a8[_0x8f25('0x52')],{'$or':_[_0x8f25('0x42')](_0x5b29a8['attributes'],function(_0x4882e6){var _0x28b1a6={};_0x28b1a6[_0x4882e6]={'$like':'%'+_0x5463c5[_0x8f25('0x49')][_0x8f25('0x54')]+'%'};return _0x28b1a6;})});}_0x5b29a8=_[_0x8f25('0x3c')]({},_0x5b29a8,_0x5463c5[_0x8f25('0x55')]);return _0x21ee90['getAgents'](_0x5b29a8);}})[_0x8f25('0x1f')](function(_0x159af2){if(_0x159af2){_0x2bd2f2=_0x159af2[_0x8f25('0x4e')];if(!_0x5463c5[_0x8f25('0x49')]['hasOwnProperty'](_0x8f25('0x50'))){_0x5b29a8['limit']=qs[_0x8f25('0x2f')](_0x5463c5[_0x8f25('0x49')][_0x8f25('0x2f')]);_0x5b29a8[_0x8f25('0x2e')]=qs[_0x8f25('0x2e')](_0x5463c5[_0x8f25('0x49')][_0x8f25('0x2e')]);}return _0x21ee90['getAgents'](_0x5b29a8);}})[_0x8f25('0x1f')](function(_0x393380){if(_0x393380){return _0x393380?{'count':_0x2bd2f2,'rows':_0x393380}:null;}})['then'](respondWithResult(_0x46cb6c,null))[_0x8f25('0x2a')](handleError(_0x46cb6c,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 21d6094..bc196b6 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 _0x3074=['save','remove','emit','hasOwnProperty','exports','events','ChatWebsite','setMaxListeners'];(function(_0x1ff4ec,_0xf218c){var _0x2b4634=function(_0x3dfec7){while(--_0x3dfec7){_0x1ff4ec['push'](_0x1ff4ec['shift']());}};_0x2b4634(++_0xf218c);}(_0x3074,0x1dd));var _0x4307=function(_0x51c5b7,_0x37cb6b){_0x51c5b7=_0x51c5b7-0x0;var _0x421479=_0x3074[_0x51c5b7];return _0x421479;};'use strict';var EventEmitter=require(_0x4307('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x4307('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x4307('0x2')](0x0);var events={'afterCreate':_0x4307('0x3'),'afterUpdate':'update','afterDestroy':_0x4307('0x4')};function emitEvent(_0x5c5161){return function(_0x256692,_0x31bf86,_0x5a2543){ChatWebsiteEvents[_0x4307('0x5')](_0x5c5161+':'+_0x256692['id'],_0x256692);ChatWebsiteEvents[_0x4307('0x5')](_0x5c5161,_0x256692);_0x5a2543(null);};}for(var e in events){if(events[_0x4307('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x4307('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x3051=['remove','emit','hasOwnProperty','hook','exports','setMaxListeners','save','update'];(function(_0x744633,_0x4a120b){var _0x1965c7=function(_0x1c7ba3){while(--_0x1c7ba3){_0x744633['push'](_0x744633['shift']());}};_0x1965c7(++_0x4a120b);}(_0x3051,0x85));var _0x1305=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3051[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1305('0x0')](0x0);var events={'afterCreate':_0x1305('0x1'),'afterUpdate':_0x1305('0x2'),'afterDestroy':_0x1305('0x3')};function emitEvent(_0x57aaab){return function(_0x535fb7,_0x1fcf8f,_0x84b3ee){ChatWebsiteEvents[_0x1305('0x4')](_0x57aaab+':'+_0x535fb7['id'],_0x535fb7);ChatWebsiteEvents[_0x1305('0x4')](_0x57aaab,_0x535fb7);_0x84b3ee(null);};}for(var e in events){if(events[_0x1305('0x5')](e)){var event=events[e];ChatWebsite[_0x1305('0x6')](e,emitEvent(event));}}module[_0x1305('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index d67bf8a..7a3271f 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 _0x3eec=['request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','bluebird'];(function(_0x55c00d,_0x520cb6){var _0x254a8f=function(_0x2b3378){while(--_0x2b3378){_0x55c00d['push'](_0x55c00d['shift']());}};_0x254a8f(++_0x520cb6);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x3718a3,_0x664e09){_0x3718a3=_0x3718a3-0x0;var _0xd538e6=_0x3eec[_0x3718a3];return _0xd538e6;};'use strict';var _=require(_0xc3ee('0x0'));var util=require(_0xc3ee('0x1'));var logger=require(_0xc3ee('0x2'))(_0xc3ee('0x3'));var moment=require('moment');var BPromise=require(_0xc3ee('0x4'));var rp=require(_0xc3ee('0x5'));var fs=require('fs');var path=require(_0xc3ee('0x6'));var rimraf=require(_0xc3ee('0x7'));var config=require(_0xc3ee('0x8'));var attributes=require(_0xc3ee('0x9'));module['exports']=function(_0x471de7,_0xbd5b6){return _0x471de7[_0xc3ee('0xa')](_0xc3ee('0xb'),attributes,{'tableName':_0xc3ee('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xde2c=['api','moment','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','util','../../config/logger'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xde2c,0x7f));var _0xcde2=function(_0x72a33d,_0x5691da){_0x72a33d=_0x72a33d-0x0;var _0x2621d5=_0xde2c[_0x72a33d];return _0x2621d5;};'use strict';var _=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var logger=require(_0xcde2('0x2'))(_0xcde2('0x3'));var moment=require(_0xcde2('0x4'));var BPromise=require(_0xcde2('0x5'));var rp=require(_0xcde2('0x6'));var fs=require('fs');var path=require(_0xcde2('0x7'));var rimraf=require('rimraf');var config=require(_0xcde2('0x8'));var attributes=require(_0xcde2('0x9'));module[_0xcde2('0xa')]=function(_0x1398de,_0x401b16){return _0x1398de['define'](_0xcde2('0xb'),attributes,{'tableName':_0xcde2('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 da0b708..f2a5e36 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 _0x187d=['stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s'];(function(_0x273f65,_0x3bb05d){var _0x1b8eae=function(_0x36ae2d){while(--_0x36ae2d){_0x273f65['push'](_0x273f65['shift']());}};_0x1b8eae(++_0x3bb05d);}(_0x187d,0x93));var _0xd187=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x187d[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var moment=require(_0xd187('0x1'));var BPromise=require(_0xd187('0x2'));var rs=require(_0xd187('0x3'));var fs=require('fs');var Redis=require(_0xd187('0x4'));var db=require(_0xd187('0x5'))['db'];var utils=require(_0xd187('0x6'));var logger=require('../../config/logger')(_0xd187('0x7'));var config=require(_0xd187('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd187('0x9')][_0xd187('0xa')]({'port':0x232a});config[_0xd187('0xb')]=_[_0xd187('0xc')](config[_0xd187('0xb')],{'host':_0xd187('0xd'),'port':0x18eb});var socket=require(_0xd187('0xe'))(new Redis(config[_0xd187('0xb')]));require('./chatWebsite.socket')[_0xd187('0xf')](socket);function respondWithRpcPromise(_0x42848b,_0x4039f6,_0x473866){return new BPromise(function(_0x33ca45,_0x2a61a4){return client['request'](_0x42848b,_0x473866)[_0xd187('0x10')](function(_0x412ccf){logger[_0xd187('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x4039f6,_0xd187('0x12'));logger[_0xd187('0x13')](_0xd187('0x14'),_0x4039f6,'request\x20sent',JSON[_0xd187('0x15')](_0x412ccf));if(_0x412ccf[_0xd187('0x16')]){if(_0x412ccf[_0xd187('0x16')][_0xd187('0x17')]===0x1f4){logger['error'](_0xd187('0x18'),_0x4039f6,_0x412ccf[_0xd187('0x16')][_0xd187('0x19')]);return _0x2a61a4(_0x412ccf[_0xd187('0x16')]['message']);}logger[_0xd187('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x4039f6,_0x412ccf['error'][_0xd187('0x19')]);return _0x33ca45(_0x412ccf['error']['message']);}else{logger[_0xd187('0x11')](_0xd187('0x18'),_0x4039f6,_0xd187('0x12'));_0x33ca45(_0x412ccf[_0xd187('0x1a')][_0xd187('0x19')]);}})[_0xd187('0x1b')](function(_0x12b388){logger[_0xd187('0x16')](_0xd187('0x18'),_0x4039f6,_0x12b388);_0x2a61a4(_0x12b388);});});}
\ No newline at end of file
+var _0x524e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','moment'];(function(_0x45319d,_0x5a0653){var _0x20f076=function(_0x3da82c){while(--_0x3da82c){_0x45319d['push'](_0x45319d['shift']());}};_0x20f076(++_0x5a0653);}(_0x524e,0x15e));var _0xe524=function(_0x1c1904,_0x429424){_0x1c1904=_0x1c1904-0x0;var _0x4a9de9=_0x524e[_0x1c1904];return _0x4a9de9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});config[_0xe524('0xb')]=_[_0xe524('0xc')](config['redis'],{'host':_0xe524('0xd'),'port':0x18eb});var socket=require(_0xe524('0xe'))(new Redis(config[_0xe524('0xb')]));require(_0xe524('0xf'))[_0xe524('0x10')](socket);function respondWithRpcPromise(_0x4082b1,_0x1a08e2,_0xb3eb9f){return new BPromise(function(_0x1b75bd,_0x1641ec){return client[_0xe524('0x11')](_0x4082b1,_0xb3eb9f)[_0xe524('0x12')](function(_0x1184df){logger[_0xe524('0x13')](_0xe524('0x14'),_0x1a08e2,_0xe524('0x15'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1a08e2,_0xe524('0x15'),JSON[_0xe524('0x16')](_0x1184df));if(_0x1184df[_0xe524('0x17')]){if(_0x1184df[_0xe524('0x17')][_0xe524('0x18')]===0x1f4){logger['error'](_0xe524('0x14'),_0x1a08e2,_0x1184df['error'][_0xe524('0x19')]);return _0x1641ec(_0x1184df[_0xe524('0x17')]['message']);}logger[_0xe524('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x1a08e2,_0x1184df[_0xe524('0x17')]['message']);return _0x1b75bd(_0x1184df[_0xe524('0x17')]['message']);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x1a08e2,_0xe524('0x15'));_0x1b75bd(_0x1184df['result'][_0xe524('0x19')]);}})[_0xe524('0x1a')](function(_0x278de9){logger[_0xe524('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x1a08e2,_0x278de9);_0x1641ec(_0x278de9);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 131511a..083de1d 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 _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x1460ab,_0x74d06e){var _0x1eeb5c=function(_0x28de38){while(--_0x28de38){_0x1460ab['push'](_0x1460ab['shift']());}};_0x1eeb5c(++_0x74d06e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x446180,_0x1496bc){_0x446180=_0x446180-0x0;var _0x82d27f=_0x5f2f[_0x446180];return _0x82d27f;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}};
\ No newline at end of file
+var _0xb10b=['emit','removeListener','register','chatWebsite:','./chatWebsite.events','remove','update'];(function(_0x5ebcda,_0x5aaa0a){var _0x179c8e=function(_0x253a48){while(--_0x253a48){_0x5ebcda['push'](_0x5ebcda['shift']());}};_0x179c8e(++_0x5aaa0a);}(_0xb10b,0x12a));var _0xbb10=function(_0x16ca8e,_0x60f267){_0x16ca8e=_0x16ca8e-0x0;var _0x4c560e=_0xb10b[_0x16ca8e];return _0x4c560e;};'use strict';var ChatWebsiteEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatWebsiteEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatWebsiteEvents['on'](_0x1b9e94,_0x3fb675);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 25065a8..a9b1dd3 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 _0x1c4c=['../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/users','getAgents','post','create','addDisposition','join','root','server/files/images/logos/','now','originalname','/:id/logo','single','file','addLogo','diskStorage','format','%s-%s','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','replace','any','addInteraction','addApplications','addProactiveActions','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x1c4c,0xc6));var _0xc1c4=function(_0x55d829,_0x43f06c){_0x55d829=_0x55d829-0x0;var _0x52163b=_0x1c4c[_0x55d829];return _0x52163b;};'use strict';var multer=require(_0xc1c4('0x0'));var util=require(_0xc1c4('0x1'));var path=require(_0xc1c4('0x2'));var timeout=require(_0xc1c4('0x3'));var express=require(_0xc1c4('0x4'));var router=express[_0xc1c4('0x5')]();var fs_extra=require(_0xc1c4('0x6'));var auth=require(_0xc1c4('0x7'));var interaction=require(_0xc1c4('0x8'));var config=require(_0xc1c4('0x9'));var controller=require(_0xc1c4('0xa'));router['get']('/',auth[_0xc1c4('0xb')](),controller[_0xc1c4('0xc')]);router[_0xc1c4('0xd')](_0xc1c4('0xe'),auth['isAuthenticated'](),controller['describe']);router[_0xc1c4('0xd')](_0xc1c4('0xf'),auth[_0xc1c4('0xb')](),controller['show']);router[_0xc1c4('0xd')](_0xc1c4('0x10'),auth[_0xc1c4('0xb')](),controller[_0xc1c4('0x11')]);router['get'](_0xc1c4('0x12'),auth['isAuthenticated'](),controller['getAnswers']);router['get']('/:id/logo',controller[_0xc1c4('0x13')]);router[_0xc1c4('0xd')](_0xc1c4('0x14'),controller['getAvatar']);router[_0xc1c4('0xd')](_0xc1c4('0x15'),controller[_0xc1c4('0x16')]);router[_0xc1c4('0xd')](_0xc1c4('0x17'),controller['getSystemAvatar']);router[_0xc1c4('0xd')](_0xc1c4('0x18'),auth[_0xc1c4('0xb')](),controller[_0xc1c4('0x19')]);router[_0xc1c4('0xd')](_0xc1c4('0x1a'),controller[_0xc1c4('0x1b')]);router['get'](_0xc1c4('0x1c'),auth['isAuthenticated'](),controller[_0xc1c4('0x1d')]);router[_0xc1c4('0xd')](_0xc1c4('0x1e'),auth[_0xc1c4('0xb')](),controller[_0xc1c4('0x1f')]);router[_0xc1c4('0xd')]('/:id/fields',controller['getFields']);router[_0xc1c4('0xd')]('/:id/offline_messages',auth['isAuthenticated'](),controller['getOfflineMessages']);router[_0xc1c4('0xd')](_0xc1c4('0x20'),auth[_0xc1c4('0xb')](),controller[_0xc1c4('0x21')]);router[_0xc1c4('0x22')]('/',auth[_0xc1c4('0xb')](),controller[_0xc1c4('0x23')]);router[_0xc1c4('0x22')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xc1c4('0x24')]);router['post']('/:id/canned_answers',auth[_0xc1c4('0xb')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3e58ee,_0x3899b4,_0x501a07){_0x501a07(null,path[_0xc1c4('0x25')](config[_0xc1c4('0x26')],_0xc1c4('0x27')));},'filename':function(_0x4e14f7,_0x3ac403,_0x30a39b){_0x30a39b(null,util['format']('%s-%s',Date[_0xc1c4('0x28')](),_0x3ac403[_0xc1c4('0x29')]));}})});router['post'](_0xc1c4('0x2a'),upload[_0xc1c4('0x2b')](_0xc1c4('0x2c')),controller[_0xc1c4('0x2d')]);var upload=multer({'storage':multer[_0xc1c4('0x2e')]({'destination':function(_0x688405,_0x1fa5ea,_0x372821){_0x372821(null,path[_0xc1c4('0x25')](config[_0xc1c4('0x26')],'server/files/images/avatars/'));},'filename':function(_0x380fda,_0x2dc842,_0x572597){_0x572597(null,util[_0xc1c4('0x2f')](_0xc1c4('0x30'),Date[_0xc1c4('0x28')](),_0x2dc842['originalname']));}})});router[_0xc1c4('0x22')]('/:id/avatar',upload['single']('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0xc1c4('0x2e')]({'destination':function(_0x503dd2,_0x4f26d3,_0x4e692a){_0x4e692a(null,path[_0xc1c4('0x25')](config[_0xc1c4('0x26')],_0xc1c4('0x31')));},'filename':function(_0x3f3173,_0x8c8dd7,_0x5c2805){_0x5c2805(null,util['format'](_0xc1c4('0x30'),Date[_0xc1c4('0x28')](),_0x8c8dd7[_0xc1c4('0x29')]));}})});router[_0xc1c4('0x22')](_0xc1c4('0x15'),upload['single'](_0xc1c4('0x2c')),controller[_0xc1c4('0x32')]);var upload=multer({'storage':multer[_0xc1c4('0x2e')]({'destination':function(_0x1b54ec,_0x5ed00e,_0x1c2c73){_0x1c2c73(null,path[_0xc1c4('0x25')](config[_0xc1c4('0x26')],_0xc1c4('0x31')));},'filename':function(_0x2e373d,_0xcd4084,_0x420abd){_0x420abd(null,util[_0xc1c4('0x2f')]('%s-%s',Date[_0xc1c4('0x28')](),_0xcd4084['originalname']));}})});router[_0xc1c4('0x22')](_0xc1c4('0x17'),upload[_0xc1c4('0x2b')](_0xc1c4('0x2c')),controller[_0xc1c4('0x33')]);router[_0xc1c4('0x22')](_0xc1c4('0x34'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xc1c4('0x2e')]({'destination':function(_0x19018c,_0x201bb5,_0x4f6cf6){const _0xbb624b=path['join'](config[_0xc1c4('0x26')],_0xc1c4('0x35'),_0xc1c4('0x36'),_0xc1c4('0x37'));fs_extra[_0xc1c4('0x38')](_0xbb624b,function(){_0x4f6cf6(null,_0xbb624b);});},'filename':function(_0x221862,_0x46ca80,_0x49cc22){const _0x23e3b7=_0x46ca80[_0xc1c4('0x29')][_0xc1c4('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x385242=path['extname'](_0x23e3b7);const _0x3f3a14=Date['now']()+'-'+_0x23e3b7[_0xc1c4('0x39')](_0x385242,'')+_0x385242;_0x49cc22(null,_0x3f3a14);}})});router[_0xc1c4('0x22')]('/:id/offline',offlineUploadMulter[_0xc1c4('0x3a')](),controller['offline']);router[_0xc1c4('0x22')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xc1c4('0x3b')]);router['post']('/:id/applications',auth[_0xc1c4('0xb')](),controller[_0xc1c4('0x3c')]);router[_0xc1c4('0x22')]('/:id/proactive_actions',auth[_0xc1c4('0xb')](),controller[_0xc1c4('0x3d')]);router[_0xc1c4('0x22')](_0xc1c4('0x20'),auth['isAuthenticated'](),controller['addAgents']);router[_0xc1c4('0x3e')](_0xc1c4('0xf'),auth['isAuthenticated'](),controller[_0xc1c4('0x3f')]);router['delete']('/:id',auth[_0xc1c4('0xb')](),controller[_0xc1c4('0x40')]);router[_0xc1c4('0x41')](_0xc1c4('0x10'),auth[_0xc1c4('0xb')](),controller[_0xc1c4('0x42')]);router['delete'](_0xc1c4('0x12'),auth['isAuthenticated'](),controller[_0xc1c4('0x43')]);router[_0xc1c4('0x41')]('/:id/users',auth[_0xc1c4('0xb')](),controller[_0xc1c4('0x44')]);module['exports']=router;
\ No newline at end of file
+var _0xb9b1=['getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addAnswer','join','root','server/files/images/logos/','format','now','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','%s-%s','addCustomerAvatar','addSystemAvatar','notify','server/files','attachments','offline-chat','replace','extname','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','delete','destroy','removeAnswers','removeAgents','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/avatar'];(function(_0x275d0d,_0x276bff){var _0x242262=function(_0x5b2a16){while(--_0x5b2a16){_0x275d0d['push'](_0x275d0d['shift']());}};_0x242262(++_0x276bff);}(_0xb9b1,0x10d));var _0x1b9b=function(_0x47d4c8,_0x4a7b98){_0x47d4c8=_0x47d4c8-0x0;var _0xe42fb6=_0xb9b1[_0x47d4c8];return _0xe42fb6;};'use strict';var multer=require(_0x1b9b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1b9b('0x1'));var express=require(_0x1b9b('0x2'));var router=express[_0x1b9b('0x3')]();var fs_extra=require(_0x1b9b('0x4'));var auth=require(_0x1b9b('0x5'));var interaction=require(_0x1b9b('0x6'));var config=require(_0x1b9b('0x7'));var controller=require(_0x1b9b('0x8'));router[_0x1b9b('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x1b9b('0xa'),auth[_0x1b9b('0xb')](),controller['describe']);router[_0x1b9b('0x9')](_0x1b9b('0xc'),auth[_0x1b9b('0xb')](),controller[_0x1b9b('0xd')]);router[_0x1b9b('0x9')](_0x1b9b('0xe'),auth[_0x1b9b('0xb')](),controller[_0x1b9b('0xf')]);router[_0x1b9b('0x9')](_0x1b9b('0x10'),auth['isAuthenticated'](),controller[_0x1b9b('0x11')]);router['get']('/:id/logo',controller['getLogo']);router['get'](_0x1b9b('0x12'),controller[_0x1b9b('0x13')]);router[_0x1b9b('0x9')](_0x1b9b('0x14'),controller[_0x1b9b('0x15')]);router[_0x1b9b('0x9')](_0x1b9b('0x16'),controller[_0x1b9b('0x17')]);router[_0x1b9b('0x9')](_0x1b9b('0x18'),auth['isAuthenticated'](),controller[_0x1b9b('0x19')]);router['get'](_0x1b9b('0x1a'),controller[_0x1b9b('0x1b')]);router[_0x1b9b('0x9')](_0x1b9b('0x1c'),auth[_0x1b9b('0xb')](),controller[_0x1b9b('0x1d')]);router[_0x1b9b('0x9')](_0x1b9b('0x1e'),auth[_0x1b9b('0xb')](),controller[_0x1b9b('0x1f')]);router[_0x1b9b('0x9')](_0x1b9b('0x20'),controller[_0x1b9b('0x21')]);router[_0x1b9b('0x9')](_0x1b9b('0x22'),auth[_0x1b9b('0xb')](),controller[_0x1b9b('0x23')]);router['get'](_0x1b9b('0x24'),auth[_0x1b9b('0xb')](),controller[_0x1b9b('0x25')]);router[_0x1b9b('0x26')]('/',auth['isAuthenticated'](),controller[_0x1b9b('0x27')]);router[_0x1b9b('0x26')](_0x1b9b('0xe'),auth[_0x1b9b('0xb')](),controller['addDisposition']);router[_0x1b9b('0x26')](_0x1b9b('0x10'),auth[_0x1b9b('0xb')](),controller[_0x1b9b('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x139d2d,_0x522f84,_0x22deea){_0x22deea(null,path[_0x1b9b('0x29')](config[_0x1b9b('0x2a')],_0x1b9b('0x2b')));},'filename':function(_0x421557,_0x3d4111,_0x2a13bb){_0x2a13bb(null,util[_0x1b9b('0x2c')]('%s-%s',Date[_0x1b9b('0x2d')](),_0x3d4111[_0x1b9b('0x2e')]));}})});router[_0x1b9b('0x26')]('/:id/logo',upload[_0x1b9b('0x2f')](_0x1b9b('0x30')),controller[_0x1b9b('0x31')]);var upload=multer({'storage':multer[_0x1b9b('0x32')]({'destination':function(_0x306058,_0x1b242b,_0x4c83e4){_0x4c83e4(null,path[_0x1b9b('0x29')](config[_0x1b9b('0x2a')],_0x1b9b('0x33')));},'filename':function(_0x4eec53,_0x1a5b4a,_0x356448){_0x356448(null,util[_0x1b9b('0x2c')](_0x1b9b('0x34'),Date[_0x1b9b('0x2d')](),_0x1a5b4a['originalname']));}})});router[_0x1b9b('0x26')](_0x1b9b('0x12'),upload[_0x1b9b('0x2f')](_0x1b9b('0x30')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x446cd3,_0xec1016,_0x5030a5){_0x5030a5(null,path[_0x1b9b('0x29')](config[_0x1b9b('0x2a')],_0x1b9b('0x33')));},'filename':function(_0x2eeb9d,_0x4867d8,_0x594060){_0x594060(null,util[_0x1b9b('0x2c')](_0x1b9b('0x34'),Date[_0x1b9b('0x2d')](),_0x4867d8[_0x1b9b('0x2e')]));}})});router['post'](_0x1b9b('0x14'),upload['single'](_0x1b9b('0x30')),controller[_0x1b9b('0x35')]);var upload=multer({'storage':multer[_0x1b9b('0x32')]({'destination':function(_0x9e7a3e,_0x5c7157,_0x475f50){_0x475f50(null,path[_0x1b9b('0x29')](config[_0x1b9b('0x2a')],_0x1b9b('0x33')));},'filename':function(_0x208287,_0x26d55b,_0xf6dd4d){_0xf6dd4d(null,util[_0x1b9b('0x2c')](_0x1b9b('0x34'),Date[_0x1b9b('0x2d')](),_0x26d55b[_0x1b9b('0x2e')]));}})});router['post'](_0x1b9b('0x16'),upload[_0x1b9b('0x2f')](_0x1b9b('0x30')),controller[_0x1b9b('0x36')]);router['post']('/:id/notify',controller[_0x1b9b('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x1b9b('0x32')]({'destination':function(_0x156735,_0x9d840d,_0x125d42){const _0x220590=path[_0x1b9b('0x29')](config[_0x1b9b('0x2a')],_0x1b9b('0x38'),_0x1b9b('0x39'),_0x1b9b('0x3a'));fs_extra['ensureDir'](_0x220590,function(){_0x125d42(null,_0x220590);});},'filename':function(_0xe8cc06,_0x22003b,_0xae2e43){const _0x4443d5=_0x22003b[_0x1b9b('0x2e')][_0x1b9b('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3973e1=path[_0x1b9b('0x3c')](_0x4443d5);const _0x532f27=Date[_0x1b9b('0x2d')]()+'-'+_0x4443d5[_0x1b9b('0x3b')](_0x3973e1,'')+_0x3973e1;_0xae2e43(null,_0x532f27);}})});router[_0x1b9b('0x26')]('/:id/offline',offlineUploadMulter['any'](),controller[_0x1b9b('0x3d')]);router[_0x1b9b('0x26')](_0x1b9b('0x18'),auth[_0x1b9b('0xb')](),controller[_0x1b9b('0x3e')]);router[_0x1b9b('0x26')]('/:id/applications',auth[_0x1b9b('0xb')](),controller[_0x1b9b('0x3f')]);router['post'](_0x1b9b('0x1e'),auth[_0x1b9b('0xb')](),controller[_0x1b9b('0x40')]);router[_0x1b9b('0x26')]('/:id/users',auth['isAuthenticated'](),controller[_0x1b9b('0x41')]);router[_0x1b9b('0x42')](_0x1b9b('0xc'),auth[_0x1b9b('0xb')](),controller['update']);router[_0x1b9b('0x43')](_0x1b9b('0xc'),auth[_0x1b9b('0xb')](),controller[_0x1b9b('0x44')]);router[_0x1b9b('0x43')](_0x1b9b('0xe'),auth[_0x1b9b('0xb')](),controller['removeDispositions']);router[_0x1b9b('0x43')](_0x1b9b('0x10'),auth[_0x1b9b('0xb')](),controller[_0x1b9b('0x45')]);router['delete']('/:id/users',auth[_0x1b9b('0xb')](),controller[_0x1b9b('0x46')]);module[_0x1b9b('0x47')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index e9dac98..99655fb 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 _0xfb65=['AmazonAWS','exports','STRING'];(function(_0x4f557f,_0x5e4fb5){var _0x20cab5=function(_0x256930){while(--_0x256930){_0x4f557f['push'](_0x4f557f['shift']());}};_0x20cab5(++_0x5e4fb5);}(_0xfb65,0x82));var _0x5fb6=function(_0x58319a,_0x145060){_0x58319a=_0x58319a-0x0;var _0x4cf654=_0xfb65[_0x58319a];return _0x4cf654;};'use strict';var Sequelize=require('sequelize');module[_0x5fb6('0x0')]={'name':{'type':Sequelize[_0x5fb6('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x5fb6('0x2'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x5fb6('0x1')]},'data2':{'type':Sequelize[_0x5fb6('0x1')]}};
\ No newline at end of file
+var _0x1af5=['Google','sequelize','STRING','ENUM','AmazonAWS'];(function(_0x47cade,_0x123077){var _0x5ab52f=function(_0x4f078b){while(--_0x4f078b){_0x47cade['push'](_0x47cade['shift']());}};_0x5ab52f(++_0x123077);}(_0x1af5,0x17d));var _0x51af=function(_0x322c9b,_0x27931a){_0x322c9b=_0x322c9b-0x0;var _0x5f4d6a=_0x1af5[_0x322c9b];return _0x5f4d6a;};'use strict';var Sequelize=require(_0x51af('0x0'));module['exports']={'name':{'type':Sequelize[_0x51af('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x51af('0x2')](_0x51af('0x3'),_0x51af('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x51af('0x1')]},'data2':{'type':Sequelize[_0x51af('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index d03f7c7..d211e2b 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 _0xfe8e=['keys','filters','intersection','model','attributes','fields','length','order','pick','where','type','VIRTUAL','filter','include','findAll','rows','catch','show','options','create','find','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','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','sendStatus','status','end','offset','undefined','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','render','merge','body','contact','message','index','map','CloudProvider','rawAttributes','fieldName','key','query'];(function(_0x44c700,_0x33b366){var _0x16fab0=function(_0x1be720){while(--_0x1be720){_0x44c700['push'](_0x44c700['shift']());}};_0x16fab0(++_0x33b366);}(_0xfe8e,0x1a1));var _0xefe8=function(_0x1667df,_0x266940){_0x1667df=_0x1667df-0x0;var _0x341abf=_0xfe8e[_0x1667df];return _0x341abf;};'use strict';var emlformat=require(_0xefe8('0x0'));var rimraf=require(_0xefe8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xefe8('0x2'));var rp=require(_0xefe8('0x3'));var moment=require(_0xefe8('0x4'));var BPromise=require(_0xefe8('0x5'));var Mustache=require(_0xefe8('0x6'));var util=require(_0xefe8('0x7'));var path=require(_0xefe8('0x8'));var sox=require(_0xefe8('0x9'));var csv=require('to-csv');var ejs=require(_0xefe8('0xa'));var fs=require('fs');var fs_extra=require(_0xefe8('0xb'));var _=require(_0xefe8('0xc'));var squel=require('squel');var crypto=require(_0xefe8('0xd'));var jsforce=require(_0xefe8('0xe'));var deskjs=require(_0xefe8('0xf'));var toCsv=require('to-csv');var querystring=require(_0xefe8('0x10'));var Papa=require(_0xefe8('0x11'));var Redis=require(_0xefe8('0x12'));var authService=require(_0xefe8('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xefe8('0x14'));var hardwareService=require(_0xefe8('0x15'));var logger=require(_0xefe8('0x16'))(_0xefe8('0x17'));var utils=require(_0xefe8('0x18'));var config=require(_0xefe8('0x19'));var licenseUtil=require(_0xefe8('0x1a'));var db=require(_0xefe8('0x1b'))['db'];function respondWithStatusCode(_0xfaea6d,_0x372419){_0x372419=_0x372419||0xcc;return function(_0x4df7b2){if(_0x4df7b2){return _0xfaea6d[_0xefe8('0x1c')](_0x372419);}return _0xfaea6d[_0xefe8('0x1d')](_0x372419)[_0xefe8('0x1e')]();};}function respondWithResult(_0x590d65,_0x14c23d){_0x14c23d=_0x14c23d||0xc8;return function(_0x26fc1d){if(_0x26fc1d){return _0x590d65[_0xefe8('0x1d')](_0x14c23d)['json'](_0x26fc1d);}};}function respondWithFilteredResult(_0xd65ccb,_0x3a54e9){return function(_0x5ecf79){if(_0x5ecf79){var _0x495442=typeof _0x3a54e9[_0xefe8('0x1f')]===_0xefe8('0x20')&&typeof _0x3a54e9[_0xefe8('0x21')]==='undefined';var _0x190801=_0x5ecf79['count'];var _0x1c0f28=_0x495442?0x0:_0x3a54e9['offset'];var _0x5198f4=_0x495442?_0x5ecf79['count']:_0x3a54e9[_0xefe8('0x1f')]+_0x3a54e9[_0xefe8('0x21')];var _0x296ec6;if(_0x5198f4>=_0x190801){_0x5198f4=_0x190801;_0x296ec6=0xc8;}else{_0x296ec6=0xce;}_0xd65ccb[_0xefe8('0x1d')](_0x296ec6);return _0xd65ccb[_0xefe8('0x22')](_0xefe8('0x23'),_0x1c0f28+'-'+_0x5198f4+'/'+_0x190801)['json'](_0x5ecf79);}return null;};}function patchUpdates(_0x5b5312){return function(_0x25ff37){try{jsonpatch[_0xefe8('0x24')](_0x25ff37,_0x5b5312,!![]);}catch(_0x182c94){return BPromise['reject'](_0x182c94);}return _0x25ff37[_0xefe8('0x25')]();};}function saveUpdates(_0x2141a1,_0x46a50e){return function(_0x21acd3){if(_0x21acd3){return _0x21acd3[_0xefe8('0x26')](_0x2141a1)['then'](function(_0x1ae684){return _0x1ae684;});}return null;};}function removeEntity(_0x10d176,_0x369748){return function(_0x2b244a){if(_0x2b244a){return _0x2b244a[_0xefe8('0x27')]()[_0xefe8('0x28')](function(){_0x10d176[_0xefe8('0x1d')](0xcc)[_0xefe8('0x1e')]();});}};}function handleEntityNotFound(_0x235017,_0x64b13b){return function(_0x5e50c9){if(!_0x5e50c9){_0x235017[_0xefe8('0x1c')](0x194);}return _0x5e50c9;};}function handleError(_0x4118e1,_0x53677a){_0x53677a=_0x53677a||0x1f4;return function(_0x4b6f8c){logger[_0xefe8('0x29')](_0x4b6f8c[_0xefe8('0x2a')]);if(_0x4b6f8c[_0xefe8('0x2b')]){delete _0x4b6f8c['name'];}_0x4118e1[_0xefe8('0x1d')](_0x53677a)[_0xefe8('0x2c')](_0x4b6f8c);};}function getMustacheRender(_0x5af737,_0x246759){return Mustache[_0xefe8('0x2d')](_0x5af737,_[_0xefe8('0x2e')](_0x246759[_0xefe8('0x2f')],{'contact':_0x246759[_0xefe8('0x30')],'message':_0x246759[_0xefe8('0x31')],'agent':_0x246759['agent'],'interaction':_0x246759['interaction'],'account':_0x246759['account']}))||'';}exports[_0xefe8('0x32')]=function(_0x3a679d,_0x589cb9){var _0x1db931={},_0x33e533={},_0x132723={'count':0x0,'rows':[]};var _0x1561aa=_[_0xefe8('0x33')](db[_0xefe8('0x34')][_0xefe8('0x35')],function(_0x8c1b6a){return{'name':_0x8c1b6a[_0xefe8('0x36')],'type':_0x8c1b6a['type'][_0xefe8('0x37')]};});_0x33e533['model']=_['map'](_0x1561aa,_0xefe8('0x2b'));_0x33e533[_0xefe8('0x38')]=_[_0xefe8('0x39')](_0x3a679d[_0xefe8('0x38')]);_0x33e533[_0xefe8('0x3a')]=_[_0xefe8('0x3b')](_0x33e533[_0xefe8('0x3c')],_0x33e533[_0xefe8('0x38')]);_0x1db931[_0xefe8('0x3d')]=_[_0xefe8('0x3b')](_0x33e533[_0xefe8('0x3c')],qs['fields'](_0x3a679d[_0xefe8('0x38')][_0xefe8('0x3e')]));_0x1db931[_0xefe8('0x3d')]=_0x1db931['attributes'][_0xefe8('0x3f')]?_0x1db931[_0xefe8('0x3d')]:_0x33e533[_0xefe8('0x3c')];if(!_0x3a679d[_0xefe8('0x38')]['hasOwnProperty']('nolimit')){_0x1db931[_0xefe8('0x21')]=qs[_0xefe8('0x21')](_0x3a679d[_0xefe8('0x38')][_0xefe8('0x21')]);_0x1db931[_0xefe8('0x1f')]=qs['offset'](_0x3a679d[_0xefe8('0x38')][_0xefe8('0x1f')]);}_0x1db931[_0xefe8('0x40')]=qs['sort'](_0x3a679d[_0xefe8('0x38')]['sort']);_0x1db931['where']=qs[_0xefe8('0x3a')](_[_0xefe8('0x41')](_0x3a679d[_0xefe8('0x38')],_0x33e533['filters']),_0x1561aa);if(_0x3a679d['query']['filter']){_0x1db931[_0xefe8('0x42')]=_[_0xefe8('0x2e')](_0x1db931[_0xefe8('0x42')],{'$or':_['map'](_0x1561aa,function(_0x3ae615){if(_0x3ae615[_0xefe8('0x43')]!==_0xefe8('0x44')){var _0x342af7={};_0x342af7[_0x3ae615[_0xefe8('0x2b')]]={'$like':'%'+_0x3a679d[_0xefe8('0x38')][_0xefe8('0x45')]+'%'};return _0x342af7;}})});}_0x1db931=_['merge']({},_0x1db931,_0x3a679d['options']);var _0x3542fc={'where':_0x1db931['where']};return db[_0xefe8('0x34')]['count'](_0x3542fc)[_0xefe8('0x28')](function(_0x1c2a53){_0x132723['count']=_0x1c2a53;if(_0x3a679d['query']['includeAll']){_0x1db931[_0xefe8('0x46')]=[{'all':!![]}];}return db['CloudProvider'][_0xefe8('0x47')](_0x1db931);})[_0xefe8('0x28')](function(_0x31ffe7){_0x132723[_0xefe8('0x48')]=_0x31ffe7;return _0x132723;})[_0xefe8('0x28')](respondWithFilteredResult(_0x589cb9,_0x1db931))[_0xefe8('0x49')](handleError(_0x589cb9,null));};exports[_0xefe8('0x4a')]=function(_0x5130e3,_0x1d99fa){var _0x2c2b8e={'raw':!![],'where':{'id':_0x5130e3['params']['id']}},_0x5921dd={};_0x5921dd[_0xefe8('0x3c')]=_[_0xefe8('0x39')](db['CloudProvider'][_0xefe8('0x35')]);_0x5921dd[_0xefe8('0x38')]=_[_0xefe8('0x39')](_0x5130e3[_0xefe8('0x38')]);_0x5921dd[_0xefe8('0x3a')]=_[_0xefe8('0x3b')](_0x5921dd[_0xefe8('0x3c')],_0x5921dd[_0xefe8('0x38')]);_0x2c2b8e[_0xefe8('0x3d')]=_[_0xefe8('0x3b')](_0x5921dd[_0xefe8('0x3c')],qs[_0xefe8('0x3e')](_0x5130e3[_0xefe8('0x38')][_0xefe8('0x3e')]));_0x2c2b8e['attributes']=_0x2c2b8e[_0xefe8('0x3d')]['length']?_0x2c2b8e[_0xefe8('0x3d')]:_0x5921dd[_0xefe8('0x3c')];if(_0x5130e3[_0xefe8('0x38')]['includeAll']){_0x2c2b8e[_0xefe8('0x46')]=[{'all':!![]}];}_0x2c2b8e=_[_0xefe8('0x2e')]({},_0x2c2b8e,_0x5130e3[_0xefe8('0x4b')]);return db[_0xefe8('0x34')]['find'](_0x2c2b8e)[_0xefe8('0x28')](handleEntityNotFound(_0x1d99fa,null))[_0xefe8('0x28')](respondWithResult(_0x1d99fa,null))['catch'](handleError(_0x1d99fa,null));};exports[_0xefe8('0x4c')]=function(_0x28ab17,_0xf9eefc){return db[_0xefe8('0x34')]['create'](_0x28ab17['body'],{})[_0xefe8('0x28')](respondWithResult(_0xf9eefc,0xc9))[_0xefe8('0x49')](handleError(_0xf9eefc,null));};exports[_0xefe8('0x26')]=function(_0x4a2c23,_0x44d43c){if(_0x4a2c23[_0xefe8('0x2f')]['id']){delete _0x4a2c23[_0xefe8('0x2f')]['id'];}return db[_0xefe8('0x34')]['find']({'where':{'id':_0x4a2c23['params']['id']}})[_0xefe8('0x28')](handleEntityNotFound(_0x44d43c,null))[_0xefe8('0x28')](saveUpdates(_0x4a2c23['body'],null))[_0xefe8('0x28')](respondWithResult(_0x44d43c,null))[_0xefe8('0x49')](handleError(_0x44d43c,null));};exports[_0xefe8('0x27')]=function(_0x25a81c,_0x16aa95){return db[_0xefe8('0x34')][_0xefe8('0x4d')]({'where':{'id':_0x25a81c[_0xefe8('0x4e')]['id']}})[_0xefe8('0x28')](handleEntityNotFound(_0x16aa95,null))[_0xefe8('0x28')](removeEntity(_0x16aa95,null))[_0xefe8('0x49')](handleError(_0x16aa95,null));};
\ No newline at end of file
+var _0x3281=['bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','destroy','then','end','stack','name','send','render','merge','body','message','agent','interaction','account','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','length','find','eml-format','zip-dir','fast-json-patch','moment'];(function(_0x4abcb6,_0x29463f){var _0x29fb14=function(_0x3fe809){while(--_0x3fe809){_0x4abcb6['push'](_0x4abcb6['shift']());}};_0x29fb14(++_0x29463f);}(_0x3281,0x128));var _0x1328=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x3281[_0x5c351c];return _0x26f3b3;};'use strict';var emlformat=require(_0x1328('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1328('0x1'));var jsonpatch=require(_0x1328('0x2'));var rp=require('request-promise');var moment=require(_0x1328('0x3'));var BPromise=require(_0x1328('0x4'));var Mustache=require('mustache');var util=require(_0x1328('0x5'));var path=require(_0x1328('0x6'));var sox=require(_0x1328('0x7'));var csv=require(_0x1328('0x8'));var ejs=require(_0x1328('0x9'));var fs=require('fs');var fs_extra=require(_0x1328('0xa'));var _=require(_0x1328('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1328('0xc'));var toCsv=require(_0x1328('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1328('0xd'));var qs=require(_0x1328('0xe'));var as=require(_0x1328('0xf'));var hardwareService=require(_0x1328('0x10'));var logger=require(_0x1328('0x11'))('api');var utils=require(_0x1328('0x12'));var config=require(_0x1328('0x13'));var licenseUtil=require(_0x1328('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x356686,_0x3b25a4){_0x3b25a4=_0x3b25a4||0xcc;return function(_0x4cf286){if(_0x4cf286){return _0x356686[_0x1328('0x15')](_0x3b25a4);}return _0x356686[_0x1328('0x16')](_0x3b25a4)['end']();};}function respondWithResult(_0x411b76,_0x37c6b0){_0x37c6b0=_0x37c6b0||0xc8;return function(_0x530cd9){if(_0x530cd9){return _0x411b76['status'](_0x37c6b0)['json'](_0x530cd9);}};}function respondWithFilteredResult(_0xe26752,_0x24c7cb){return function(_0x14f5d4){if(_0x14f5d4){var _0x3eeeaa=typeof _0x24c7cb[_0x1328('0x17')]==='undefined'&&typeof _0x24c7cb[_0x1328('0x18')]===_0x1328('0x19');var _0x2f0692=_0x14f5d4[_0x1328('0x1a')];var _0x557bde=_0x3eeeaa?0x0:_0x24c7cb['offset'];var _0x224a3f=_0x3eeeaa?_0x14f5d4[_0x1328('0x1a')]:_0x24c7cb[_0x1328('0x17')]+_0x24c7cb[_0x1328('0x18')];var _0x4b7dc4;if(_0x224a3f>=_0x2f0692){_0x224a3f=_0x2f0692;_0x4b7dc4=0xc8;}else{_0x4b7dc4=0xce;}_0xe26752[_0x1328('0x16')](_0x4b7dc4);return _0xe26752['set'](_0x1328('0x1b'),_0x557bde+'-'+_0x224a3f+'/'+_0x2f0692)[_0x1328('0x1c')](_0x14f5d4);}return null;};}function patchUpdates(_0x206d9a){return function(_0x38c232){try{jsonpatch[_0x1328('0x1d')](_0x38c232,_0x206d9a,!![]);}catch(_0x2e346b){return BPromise[_0x1328('0x1e')](_0x2e346b);}return _0x38c232[_0x1328('0x1f')]();};}function saveUpdates(_0x278a6e,_0x2128d0){return function(_0x219773){if(_0x219773){return _0x219773[_0x1328('0x20')](_0x278a6e)['then'](function(_0x57d86e){return _0x57d86e;});}return null;};}function removeEntity(_0x372b63,_0x2e65fb){return function(_0x4bffe5){if(_0x4bffe5){return _0x4bffe5[_0x1328('0x21')]()[_0x1328('0x22')](function(){_0x372b63[_0x1328('0x16')](0xcc)[_0x1328('0x23')]();});}};}function handleEntityNotFound(_0x5d4ecb,_0x3b5cb5){return function(_0x380e0d){if(!_0x380e0d){_0x5d4ecb['sendStatus'](0x194);}return _0x380e0d;};}function handleError(_0x2484ba,_0xd0fdac){_0xd0fdac=_0xd0fdac||0x1f4;return function(_0x298eae){logger['error'](_0x298eae[_0x1328('0x24')]);if(_0x298eae[_0x1328('0x25')]){delete _0x298eae[_0x1328('0x25')];}_0x2484ba[_0x1328('0x16')](_0xd0fdac)[_0x1328('0x26')](_0x298eae);};}function getMustacheRender(_0x4f7c29,_0xf8c421){return Mustache[_0x1328('0x27')](_0x4f7c29,_[_0x1328('0x28')](_0xf8c421[_0x1328('0x29')],{'contact':_0xf8c421['contact'],'message':_0xf8c421[_0x1328('0x2a')],'agent':_0xf8c421[_0x1328('0x2b')],'interaction':_0xf8c421[_0x1328('0x2c')],'account':_0xf8c421[_0x1328('0x2d')]}))||'';}exports[_0x1328('0x2e')]=function(_0x113014,_0x1682cf){var _0xf44fbf={},_0x56f390={},_0x43061f={'count':0x0,'rows':[]};var _0x3f2096=_[_0x1328('0x2f')](db[_0x1328('0x30')][_0x1328('0x31')],function(_0x3c13c4){return{'name':_0x3c13c4[_0x1328('0x32')],'type':_0x3c13c4[_0x1328('0x33')][_0x1328('0x34')]};});_0x56f390[_0x1328('0x35')]=_[_0x1328('0x2f')](_0x3f2096,_0x1328('0x25'));_0x56f390[_0x1328('0x36')]=_[_0x1328('0x37')](_0x113014['query']);_0x56f390[_0x1328('0x38')]=_[_0x1328('0x39')](_0x56f390['model'],_0x56f390[_0x1328('0x36')]);_0xf44fbf[_0x1328('0x3a')]=_[_0x1328('0x39')](_0x56f390['model'],qs[_0x1328('0x3b')](_0x113014[_0x1328('0x36')][_0x1328('0x3b')]));_0xf44fbf[_0x1328('0x3a')]=_0xf44fbf['attributes']['length']?_0xf44fbf[_0x1328('0x3a')]:_0x56f390[_0x1328('0x35')];if(!_0x113014['query']['hasOwnProperty']('nolimit')){_0xf44fbf[_0x1328('0x18')]=qs[_0x1328('0x18')](_0x113014[_0x1328('0x36')][_0x1328('0x18')]);_0xf44fbf[_0x1328('0x17')]=qs[_0x1328('0x17')](_0x113014[_0x1328('0x36')]['offset']);}_0xf44fbf[_0x1328('0x3c')]=qs['sort'](_0x113014[_0x1328('0x36')][_0x1328('0x3d')]);_0xf44fbf[_0x1328('0x3e')]=qs[_0x1328('0x38')](_[_0x1328('0x3f')](_0x113014[_0x1328('0x36')],_0x56f390[_0x1328('0x38')]),_0x3f2096);if(_0x113014['query']['filter']){_0xf44fbf[_0x1328('0x3e')]=_[_0x1328('0x28')](_0xf44fbf[_0x1328('0x3e')],{'$or':_['map'](_0x3f2096,function(_0x4cd45c){if(_0x4cd45c[_0x1328('0x33')]!==_0x1328('0x40')){var _0x364266={};_0x364266[_0x4cd45c['name']]={'$like':'%'+_0x113014[_0x1328('0x36')][_0x1328('0x41')]+'%'};return _0x364266;}})});}_0xf44fbf=_[_0x1328('0x28')]({},_0xf44fbf,_0x113014[_0x1328('0x42')]);var _0x523a3b={'where':_0xf44fbf[_0x1328('0x3e')]};return db[_0x1328('0x30')][_0x1328('0x1a')](_0x523a3b)['then'](function(_0x5c7425){_0x43061f[_0x1328('0x1a')]=_0x5c7425;if(_0x113014[_0x1328('0x36')][_0x1328('0x43')]){_0xf44fbf[_0x1328('0x44')]=[{'all':!![]}];}return db[_0x1328('0x30')]['findAll'](_0xf44fbf);})[_0x1328('0x22')](function(_0x37f194){_0x43061f[_0x1328('0x45')]=_0x37f194;return _0x43061f;})['then'](respondWithFilteredResult(_0x1682cf,_0xf44fbf))[_0x1328('0x46')](handleError(_0x1682cf,null));};exports[_0x1328('0x47')]=function(_0x376178,_0x536ff6){var _0x1d971e={'raw':!![],'where':{'id':_0x376178[_0x1328('0x48')]['id']}},_0x44224c={};_0x44224c[_0x1328('0x35')]=_[_0x1328('0x37')](db[_0x1328('0x30')]['rawAttributes']);_0x44224c[_0x1328('0x36')]=_['keys'](_0x376178['query']);_0x44224c[_0x1328('0x38')]=_['intersection'](_0x44224c['model'],_0x44224c['query']);_0x1d971e[_0x1328('0x3a')]=_[_0x1328('0x39')](_0x44224c[_0x1328('0x35')],qs[_0x1328('0x3b')](_0x376178[_0x1328('0x36')][_0x1328('0x3b')]));_0x1d971e[_0x1328('0x3a')]=_0x1d971e[_0x1328('0x3a')][_0x1328('0x49')]?_0x1d971e[_0x1328('0x3a')]:_0x44224c[_0x1328('0x35')];if(_0x376178['query'][_0x1328('0x43')]){_0x1d971e[_0x1328('0x44')]=[{'all':!![]}];}_0x1d971e=_[_0x1328('0x28')]({},_0x1d971e,_0x376178[_0x1328('0x42')]);return db[_0x1328('0x30')][_0x1328('0x4a')](_0x1d971e)[_0x1328('0x22')](handleEntityNotFound(_0x536ff6,null))[_0x1328('0x22')](respondWithResult(_0x536ff6,null))['catch'](handleError(_0x536ff6,null));};exports['create']=function(_0x29d9af,_0x44b5f8){return db[_0x1328('0x30')]['create'](_0x29d9af[_0x1328('0x29')],{})[_0x1328('0x22')](respondWithResult(_0x44b5f8,0xc9))[_0x1328('0x46')](handleError(_0x44b5f8,null));};exports[_0x1328('0x20')]=function(_0x17b71b,_0x495d8a){if(_0x17b71b[_0x1328('0x29')]['id']){delete _0x17b71b[_0x1328('0x29')]['id'];}return db[_0x1328('0x30')][_0x1328('0x4a')]({'where':{'id':_0x17b71b[_0x1328('0x48')]['id']}})['then'](handleEntityNotFound(_0x495d8a,null))[_0x1328('0x22')](saveUpdates(_0x17b71b[_0x1328('0x29')],null))['then'](respondWithResult(_0x495d8a,null))[_0x1328('0x46')](handleError(_0x495d8a,null));};exports[_0x1328('0x21')]=function(_0x51b95d,_0x5f3397){return db['CloudProvider'][_0x1328('0x4a')]({'where':{'id':_0x51b95d[_0x1328('0x48')]['id']}})[_0x1328('0x22')](handleEntityNotFound(_0x5f3397,null))[_0x1328('0x22')](removeEntity(_0x5f3397,null))[_0x1328('0x46')](handleError(_0x5f3397,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 0b6e321..5bf79b8 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 _0xf992=['exports','define','CloudProvider','cloud_providers','util','../../config/logger','moment','bluebird','request-promise','rimraf','./cloudProvider.attributes'];(function(_0x28129a,_0x26bb9c){var _0x41cc0d=function(_0x596e94){while(--_0x596e94){_0x28129a['push'](_0x28129a['shift']());}};_0x41cc0d(++_0x26bb9c);}(_0xf992,0xbf));var _0x2f99=function(_0x5e06a1,_0x352289){_0x5e06a1=_0x5e06a1-0x0;var _0x240dec=_0xf992[_0x5e06a1];return _0x240dec;};'use strict';var _=require('lodash');var util=require(_0x2f99('0x0'));var logger=require(_0x2f99('0x1'))('api');var moment=require(_0x2f99('0x2'));var BPromise=require(_0x2f99('0x3'));var rp=require(_0x2f99('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2f99('0x5'));var config=require('../../config/environment');var attributes=require(_0x2f99('0x6'));module[_0x2f99('0x7')]=function(_0xbd877d,_0x4ff7d8){return _0xbd877d[_0x2f99('0x8')](_0x2f99('0x9'),attributes,{'tableName':_0x2f99('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x97d1=['rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x97d1,0x1b9));var _0x197d=function(_0x267096,_0x549583){_0x267096=_0x267096-0x0;var _0x4c4847=_0x97d1[_0x267096];return _0x4c4847;};'use strict';var _=require(_0x197d('0x0'));var util=require(_0x197d('0x1'));var logger=require('../../config/logger')(_0x197d('0x2'));var moment=require(_0x197d('0x3'));var BPromise=require(_0x197d('0x4'));var rp=require(_0x197d('0x5'));var fs=require('fs');var path=require(_0x197d('0x6'));var rimraf=require(_0x197d('0x7'));var config=require(_0x197d('0x8'));var attributes=require(_0x197d('0x9'));module[_0x197d('0xa')]=function(_0x4c1bc,_0xbf67df){return _0x4c1bc[_0x197d('0xb')](_0x197d('0xc'),attributes,{'tableName':_0x197d('0xd'),'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 b5dbfbc..3932d3f 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 _0x0940=['../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','CloudProvider,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x11a566,_0x4b82c5){var _0x2395ac=function(_0x2344ef){while(--_0x2344ef){_0x11a566['push'](_0x11a566['shift']());}};_0x2395ac(++_0x4b82c5);}(_0x0940,0x13d));var _0x0094=function(_0x421433,_0x39cd10){_0x421433=_0x421433-0x0;var _0x5512e5=_0x0940[_0x421433];return _0x5512e5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0094('0x0'));var BPromise=require(_0x0094('0x1'));var rs=require(_0x0094('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0094('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0094('0x4'))(_0x0094('0x5'));var config=require(_0x0094('0x6'));var jayson=require(_0x0094('0x7'));var client=jayson['client'][_0x0094('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x419dd5,_0x40c698,_0x57f889){return new BPromise(function(_0x2191f1,_0x2791db){return client['request'](_0x419dd5,_0x57f889)[_0x0094('0x9')](function(_0x278767){logger[_0x0094('0xa')]('CloudProvider,\x20%s,\x20%s',_0x40c698,_0x0094('0xb'));logger[_0x0094('0xc')](_0x0094('0xd'),_0x40c698,_0x0094('0xb'),JSON['stringify'](_0x278767));if(_0x278767[_0x0094('0xe')]){if(_0x278767[_0x0094('0xe')]['code']===0x1f4){logger[_0x0094('0xe')](_0x0094('0xf'),_0x40c698,_0x278767['error'][_0x0094('0x10')]);return _0x2791db(_0x278767[_0x0094('0xe')][_0x0094('0x10')]);}logger[_0x0094('0xe')](_0x0094('0xf'),_0x40c698,_0x278767['error'][_0x0094('0x10')]);return _0x2191f1(_0x278767[_0x0094('0xe')][_0x0094('0x10')]);}else{logger['info'](_0x0094('0xf'),_0x40c698,'request\x20sent');_0x2191f1(_0x278767[_0x0094('0x11')]['message']);}})[_0x0094('0x12')](function(_0x2060a7){logger[_0x0094('0xe')](_0x0094('0xf'),_0x40c698,_0x2060a7);_0x2791db(_0x2060a7);});});}
\ No newline at end of file
+var _0x9c9f=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util'];(function(_0x2ff39d,_0x2d4180){var _0x239930=function(_0x2ec18d){while(--_0x2ec18d){_0x2ff39d['push'](_0x2ff39d['shift']());}};_0x239930(++_0x2d4180);}(_0x9c9f,0x1f2));var _0xf9c9=function(_0x34c1e4,_0x38b4ef){_0x34c1e4=_0x34c1e4-0x0;var _0xa9ff0c=_0x9c9f[_0x34c1e4];return _0xa9ff0c;};'use strict';var _=require(_0xf9c9('0x0'));var util=require(_0xf9c9('0x1'));var moment=require(_0xf9c9('0x2'));var BPromise=require(_0xf9c9('0x3'));var rs=require(_0xf9c9('0x4'));var fs=require('fs');var Redis=require(_0xf9c9('0x5'));var db=require(_0xf9c9('0x6'))['db'];var utils=require(_0xf9c9('0x7'));var logger=require(_0xf9c9('0x8'))(_0xf9c9('0x9'));var config=require(_0xf9c9('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf9c9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18c40b,_0xf14c70,_0x2ca043){return new BPromise(function(_0x2cb376,_0x50657d){return client[_0xf9c9('0xc')](_0x18c40b,_0x2ca043)[_0xf9c9('0xd')](function(_0x5aec9c){logger['info'](_0xf9c9('0xe'),_0xf14c70,_0xf9c9('0xf'));logger[_0xf9c9('0x10')](_0xf9c9('0x11'),_0xf14c70,_0xf9c9('0xf'),JSON[_0xf9c9('0x12')](_0x5aec9c));if(_0x5aec9c[_0xf9c9('0x13')]){if(_0x5aec9c[_0xf9c9('0x13')][_0xf9c9('0x14')]===0x1f4){logger[_0xf9c9('0x13')](_0xf9c9('0xe'),_0xf14c70,_0x5aec9c[_0xf9c9('0x13')][_0xf9c9('0x15')]);return _0x50657d(_0x5aec9c['error'][_0xf9c9('0x15')]);}logger[_0xf9c9('0x13')](_0xf9c9('0xe'),_0xf14c70,_0x5aec9c[_0xf9c9('0x13')][_0xf9c9('0x15')]);return _0x2cb376(_0x5aec9c['error'][_0xf9c9('0x15')]);}else{logger[_0xf9c9('0x16')]('CloudProvider,\x20%s,\x20%s',_0xf14c70,_0xf9c9('0xf'));_0x2cb376(_0x5aec9c[_0xf9c9('0x17')]['message']);}})[_0xf9c9('0x18')](function(_0xac1efd){logger['error']('CloudProvider,\x20%s,\x20%s',_0xf14c70,_0xac1efd);_0x50657d(_0xac1efd);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index ad353c3..eed565b 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 _0x47c1=['post','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show'];(function(_0xb333,_0x3cd32c){var _0x29158a=function(_0x4f0977){while(--_0x4f0977){_0xb333['push'](_0xb333['shift']());}};_0x29158a(++_0x3cd32c);}(_0x47c1,0x128));var _0x147c=function(_0xa5d896,_0x263a1d){_0xa5d896=_0xa5d896-0x0;var _0x1c31f8=_0x47c1[_0xa5d896];return _0x1c31f8;};'use strict';var multer=require(_0x147c('0x0'));var util=require('util');var path=require(_0x147c('0x1'));var timeout=require(_0x147c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x147c('0x3'));var auth=require(_0x147c('0x4'));var interaction=require(_0x147c('0x5'));var config=require(_0x147c('0x6'));var controller=require('./cloudProvider.controller');router[_0x147c('0x7')]('/',auth[_0x147c('0x8')](),controller['index']);router[_0x147c('0x7')]('/:id',auth[_0x147c('0x8')](),controller[_0x147c('0x9')]);router[_0x147c('0xa')]('/',auth[_0x147c('0x8')](),controller[_0x147c('0xb')]);router[_0x147c('0xc')](_0x147c('0xd'),auth[_0x147c('0x8')](),controller[_0x147c('0xe')]);router['delete'](_0x147c('0xd'),auth[_0x147c('0x8')](),controller[_0x147c('0xf')]);module[_0x147c('0x10')]=router;
\ No newline at end of file
+var _0x5a69=['multer','util','connect-timeout','fs-extra','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports'];(function(_0x56e641,_0x4902db){var _0x23e7b9=function(_0x5ca9c8){while(--_0x5ca9c8){_0x56e641['push'](_0x56e641['shift']());}};_0x23e7b9(++_0x4902db);}(_0x5a69,0x1c0));var _0x95a6=function(_0x40c12e,_0x58a6ca){_0x40c12e=_0x40c12e-0x0;var _0x771bfd=_0x5a69[_0x40c12e];return _0x771bfd;};'use strict';var multer=require(_0x95a6('0x0'));var util=require(_0x95a6('0x1'));var path=require('path');var timeout=require(_0x95a6('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x95a6('0x3'));var auth=require(_0x95a6('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x95a6('0x5'));router[_0x95a6('0x6')]('/',auth[_0x95a6('0x7')](),controller[_0x95a6('0x8')]);router[_0x95a6('0x6')](_0x95a6('0x9'),auth['isAuthenticated'](),controller[_0x95a6('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x95a6('0xb')]);router[_0x95a6('0xc')](_0x95a6('0x9'),auth[_0x95a6('0x7')](),controller['update']);router[_0x95a6('0xd')](_0x95a6('0x9'),auth[_0x95a6('0x7')](),controller[_0x95a6('0xe')]);module[_0x95a6('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 78779b9..f72f3c5 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 _0x6907=['STRING'];(function(_0x160e58,_0xb15cf1){var _0x142b55=function(_0x236b4e){while(--_0x236b4e){_0x160e58['push'](_0x160e58['shift']());}};_0x142b55(++_0xb15cf1);}(_0x6907,0x116));var _0x7690=function(_0x5be21,_0x54e342){_0x5be21=_0x5be21-0x0;var _0x550193=_0x6907[_0x5be21];return _0x550193;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7690('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x7690('0x0')]},'companyId':{'type':Sequelize[_0x7690('0x0')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x7690('0x0')]},'type':{'type':Sequelize[_0x7690('0x0')]},'street':{'type':Sequelize[_0x7690('0x0')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x7690('0x0')]},'email':{'type':Sequelize[_0x7690('0x0')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x7690('0x0')]},'sPostalCode':{'type':Sequelize[_0x7690('0x0')]},'sCity':{'type':Sequelize[_0x7690('0x0')]},'sCountry':{'type':Sequelize[_0x7690('0x0')]},'description':{'type':Sequelize[_0x7690('0x0')]}};
\ No newline at end of file
+var _0xa8f1=['name','sequelize','exports','STRING'];(function(_0x3ee70c,_0x58e0d4){var _0x1fa06a=function(_0x178165){while(--_0x178165){_0x3ee70c['push'](_0x3ee70c['shift']());}};_0x1fa06a(++_0x58e0d4);}(_0xa8f1,0x99));var _0x1a8f=function(_0x135cf5,_0x5e4072){_0x135cf5=_0x135cf5-0x0;var _0x280981=_0xa8f1[_0x135cf5];return _0x280981;};'use strict';var Sequelize=require(_0x1a8f('0x0'));module[_0x1a8f('0x1')]={'name':{'type':Sequelize[_0x1a8f('0x2')],'unique':_0x1a8f('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x1a8f('0x2')]},'companyId':{'type':Sequelize[_0x1a8f('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x1a8f('0x2')]},'fax':{'type':Sequelize[_0x1a8f('0x2')]},'type':{'type':Sequelize[_0x1a8f('0x2')]},'street':{'type':Sequelize[_0x1a8f('0x2')]},'postalCode':{'type':Sequelize[_0x1a8f('0x2')]},'city':{'type':Sequelize[_0x1a8f('0x2')]},'country':{'type':Sequelize[_0x1a8f('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x1a8f('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x1a8f('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1a8f('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 2324160..306c68c 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 _0x5736=['filters','intersection','model','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','describe','addContacts','CmContact','ids','omit','getContacts','fields','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','Companies','UserProfileResource','end','error','name','send','render','merge','contact','interaction','account','index','CmCompany','query','keys'];(function(_0x1ad584,_0x42c84d){var _0x4af40f=function(_0x462f0a){while(--_0x462f0a){_0x1ad584['push'](_0x1ad584['shift']());}};_0x4af40f(++_0x42c84d);}(_0x5736,0x13c));var _0x6573=function(_0x393083,_0x42154f){_0x393083=_0x393083-0x0;var _0x5f2fc6=_0x5736[_0x393083];return _0x5f2fc6;};'use strict';var emlformat=require(_0x6573('0x0'));var rimraf=require(_0x6573('0x1'));var zipdir=require(_0x6573('0x2'));var jsonpatch=require(_0x6573('0x3'));var rp=require(_0x6573('0x4'));var moment=require(_0x6573('0x5'));var BPromise=require(_0x6573('0x6'));var Mustache=require(_0x6573('0x7'));var util=require(_0x6573('0x8'));var path=require(_0x6573('0x9'));var sox=require('sox');var csv=require(_0x6573('0xa'));var ejs=require(_0x6573('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6573('0xc'));var crypto=require('crypto');var jsforce=require(_0x6573('0xd'));var deskjs=require(_0x6573('0xe'));var toCsv=require(_0x6573('0xa'));var querystring=require(_0x6573('0xf'));var Papa=require(_0x6573('0x10'));var Redis=require('ioredis');var authService=require(_0x6573('0x11'));var qs=require(_0x6573('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6573('0x13'))('api');var utils=require(_0x6573('0x14'));var config=require(_0x6573('0x15'));var licenseUtil=require(_0x6573('0x16'));var db=require(_0x6573('0x17'))['db'];function respondWithStatusCode(_0x445862,_0x11ccfe){_0x11ccfe=_0x11ccfe||0xcc;return function(_0x2656be){if(_0x2656be){return _0x445862[_0x6573('0x18')](_0x11ccfe);}return _0x445862['status'](_0x11ccfe)['end']();};}function respondWithResult(_0xc232f2,_0x1d5246){_0x1d5246=_0x1d5246||0xc8;return function(_0x2045c2){if(_0x2045c2){return _0xc232f2[_0x6573('0x19')](_0x1d5246)[_0x6573('0x1a')](_0x2045c2);}};}function respondWithFilteredResult(_0x1b99c5,_0x18f530){return function(_0x283612){if(_0x283612){var _0x3a335a=typeof _0x18f530[_0x6573('0x1b')]===_0x6573('0x1c')&&typeof _0x18f530['limit']===_0x6573('0x1c');var _0x55b6fb=_0x283612[_0x6573('0x1d')];var _0x365355=_0x3a335a?0x0:_0x18f530[_0x6573('0x1b')];var _0x59b978=_0x3a335a?_0x283612[_0x6573('0x1d')]:_0x18f530[_0x6573('0x1b')]+_0x18f530[_0x6573('0x1e')];var _0x2801e2;if(_0x59b978>=_0x55b6fb){_0x59b978=_0x55b6fb;_0x2801e2=0xc8;}else{_0x2801e2=0xce;}_0x1b99c5[_0x6573('0x19')](_0x2801e2);return _0x1b99c5[_0x6573('0x1f')](_0x6573('0x20'),_0x365355+'-'+_0x59b978+'/'+_0x55b6fb)[_0x6573('0x1a')](_0x283612);}return null;};}function patchUpdates(_0x1b8681){return function(_0x5c43dd){try{jsonpatch[_0x6573('0x21')](_0x5c43dd,_0x1b8681,!![]);}catch(_0x87a880){return BPromise['reject'](_0x87a880);}return _0x5c43dd[_0x6573('0x22')]();};}function saveUpdates(_0x527926,_0x2de13d){return function(_0x49d6b7){if(_0x49d6b7){return _0x49d6b7['update'](_0x527926)[_0x6573('0x23')](function(_0x52e0b9){return _0x52e0b9;});}return null;};}function removeEntity(_0x560571,_0x23e5e7){return function(_0x4319bb){if(_0x4319bb){return _0x4319bb[_0x6573('0x24')]()[_0x6573('0x23')](function(){var _0x365c51=_0x4319bb['get']({'plain':!![]});var _0xf3074d=_0x6573('0x25');return db[_0x6573('0x26')][_0x6573('0x24')]({'where':{'type':_0xf3074d,'resourceId':_0x365c51['id']}})[_0x6573('0x23')](function(){return _0x4319bb;});})[_0x6573('0x23')](function(){_0x560571[_0x6573('0x19')](0xcc)[_0x6573('0x27')]();});}};}function handleEntityNotFound(_0x58accd,_0x392780){return function(_0x31ed39){if(!_0x31ed39){_0x58accd[_0x6573('0x18')](0x194);}return _0x31ed39;};}function handleError(_0x35cfc6,_0x545426){_0x545426=_0x545426||0x1f4;return function(_0x2d0c39){logger[_0x6573('0x28')](_0x2d0c39['stack']);if(_0x2d0c39[_0x6573('0x29')]){delete _0x2d0c39[_0x6573('0x29')];}_0x35cfc6[_0x6573('0x19')](_0x545426)[_0x6573('0x2a')](_0x2d0c39);};}function getMustacheRender(_0xb4900e,_0x2ee8e6){return Mustache[_0x6573('0x2b')](_0xb4900e,_[_0x6573('0x2c')](_0x2ee8e6['body'],{'contact':_0x2ee8e6[_0x6573('0x2d')],'message':_0x2ee8e6['message'],'agent':_0x2ee8e6['agent'],'interaction':_0x2ee8e6[_0x6573('0x2e')],'account':_0x2ee8e6[_0x6573('0x2f')]}))||'';}exports[_0x6573('0x30')]=function(_0x27fc5c,_0x30fdff){var _0x4db6fe={},_0xaaf790={},_0x5383d6={'count':0x0,'rows':[]};return db[_0x6573('0x31')]['describe']()[_0x6573('0x23')](function(_0x5caf2f){_0xaaf790['model']=_['keys'](_0x5caf2f);_0xaaf790[_0x6573('0x32')]=_[_0x6573('0x33')](_0x27fc5c[_0x6573('0x32')]);_0xaaf790[_0x6573('0x34')]=_[_0x6573('0x35')](_0xaaf790[_0x6573('0x36')],_0xaaf790['query']);_0x4db6fe['attributes']=_[_0x6573('0x35')](_0xaaf790[_0x6573('0x36')],qs['fields'](_0x27fc5c[_0x6573('0x32')]['fields']));_0x4db6fe[_0x6573('0x37')]=_0x4db6fe[_0x6573('0x37')]['length']?_0x4db6fe[_0x6573('0x37')]:_0xaaf790['model'];if(!_0x27fc5c[_0x6573('0x32')][_0x6573('0x38')](_0x6573('0x39'))){_0x4db6fe[_0x6573('0x1e')]=qs[_0x6573('0x1e')](_0x27fc5c['query'][_0x6573('0x1e')]);_0x4db6fe[_0x6573('0x1b')]=qs['offset'](_0x27fc5c[_0x6573('0x32')][_0x6573('0x1b')]);}_0x4db6fe[_0x6573('0x3a')]=qs['sort'](_0x27fc5c['query'][_0x6573('0x3b')]);_0x4db6fe[_0x6573('0x3c')]=qs['filters'](_[_0x6573('0x3d')](_0x27fc5c[_0x6573('0x32')],_0xaaf790['filters']),_0x5caf2f);if(_0x27fc5c[_0x6573('0x32')][_0x6573('0x3e')]){_0x4db6fe[_0x6573('0x3c')]=_['merge'](_0x4db6fe['where'],{'$or':_['map'](_0x4db6fe[_0x6573('0x37')],function(_0x3f062c){var _0x16a50c={};_0x16a50c[_0x3f062c]={'$like':'%'+_0x27fc5c[_0x6573('0x32')][_0x6573('0x3e')]+'%'};return _0x16a50c;})});}_0x4db6fe=_[_0x6573('0x2c')]({},_0x4db6fe,_0x27fc5c[_0x6573('0x3f')]);var _0x1bc30e={'where':_0x4db6fe[_0x6573('0x3c')]};return db['CmCompany'][_0x6573('0x1d')](_0x1bc30e)['then'](function(_0x4a739c){_0x5383d6['count']=_0x4a739c;if(_0x27fc5c[_0x6573('0x32')][_0x6573('0x40')]){_0x4db6fe[_0x6573('0x41')]=[{'all':!![]}];}return db['CmCompany'][_0x6573('0x42')](_0x4db6fe);})[_0x6573('0x23')](function(_0x5e1ff7){_0x5383d6[_0x6573('0x43')]=_0x5e1ff7;return _0x5383d6;})[_0x6573('0x23')](respondWithFilteredResult(_0x30fdff,_0x4db6fe))[_0x6573('0x44')](handleError(_0x30fdff,null));})[_0x6573('0x44')](handleError(_0x30fdff,null));};exports[_0x6573('0x45')]=function(_0x5e2115,_0x31a58d){var _0x363ef3={'raw':![],'where':{'id':_0x5e2115[_0x6573('0x46')]['id']}},_0x5d7651={};_0x5d7651[_0x6573('0x36')]=_['keys'](db[_0x6573('0x31')][_0x6573('0x47')]);_0x5d7651['query']=_[_0x6573('0x33')](_0x5e2115[_0x6573('0x32')]);_0x5d7651['filters']=_[_0x6573('0x35')](_0x5d7651[_0x6573('0x36')],_0x5d7651[_0x6573('0x32')]);_0x363ef3['attributes']=_[_0x6573('0x35')](_0x5d7651[_0x6573('0x36')],qs['fields'](_0x5e2115['query']['fields']));_0x363ef3[_0x6573('0x37')]=_0x363ef3['attributes'][_0x6573('0x48')]?_0x363ef3[_0x6573('0x37')]:_0x5d7651['model'];if(_0x5e2115[_0x6573('0x32')]['includeAll']){_0x363ef3[_0x6573('0x41')]=[{'all':!![]}];}_0x363ef3=_['merge']({},_0x363ef3,_0x5e2115['options']);return db[_0x6573('0x31')][_0x6573('0x49')](_0x363ef3)['then'](handleEntityNotFound(_0x31a58d,null))['then'](respondWithResult(_0x31a58d,null))[_0x6573('0x44')](handleError(_0x31a58d,null));};exports['create']=function(_0x5d3026,_0x3f858f){return db['CmCompany'][_0x6573('0x4a')](_0x5d3026[_0x6573('0x4b')],{})[_0x6573('0x23')](function(_0x4198ea){var _0x3bc348=_0x5d3026['user'][_0x6573('0x4c')]({'plain':!![]});if(!_0x3bc348)throw new Error(_0x6573('0x4d'));if(_0x3bc348[_0x6573('0x4e')]===_0x6573('0x4f')){var _0x2c87a8=_0x4198ea[_0x6573('0x4c')]({'plain':!![]});var _0x104575=_0x6573('0x25');return db[_0x6573('0x50')][_0x6573('0x49')]({'where':{'name':_0x104575,'userProfileId':_0x3bc348[_0x6573('0x51')]},'raw':!![]})[_0x6573('0x23')](function(_0x5cd70b){if(_0x5cd70b&&_0x5cd70b[_0x6573('0x52')]===0x0){return db[_0x6573('0x26')]['create']({'name':_0x2c87a8[_0x6573('0x29')],'resourceId':_0x2c87a8['id'],'type':_0x5cd70b['name'],'sectionId':_0x5cd70b['id']},{})[_0x6573('0x23')](function(){return _0x4198ea;});}else{return _0x4198ea;}})[_0x6573('0x44')](function(_0x3f9fba){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f9fba);throw _0x3f9fba;});}return _0x4198ea;})['then'](respondWithResult(_0x3f858f,0xc9))[_0x6573('0x44')](handleError(_0x3f858f,null));};exports[_0x6573('0x53')]=function(_0x1864bc,_0x4aa67d){if(_0x1864bc[_0x6573('0x4b')]['id']){delete _0x1864bc['body']['id'];}return db[_0x6573('0x31')][_0x6573('0x49')]({'where':{'id':_0x1864bc['params']['id']}})[_0x6573('0x23')](handleEntityNotFound(_0x4aa67d,null))[_0x6573('0x23')](saveUpdates(_0x1864bc[_0x6573('0x4b')],null))[_0x6573('0x23')](respondWithResult(_0x4aa67d,null))[_0x6573('0x44')](handleError(_0x4aa67d,null));};exports[_0x6573('0x24')]=function(_0x32043b,_0x7011){return db[_0x6573('0x31')]['find']({'where':{'id':_0x32043b[_0x6573('0x46')]['id']}})[_0x6573('0x23')](handleEntityNotFound(_0x7011,null))[_0x6573('0x23')](removeEntity(_0x7011,null))[_0x6573('0x44')](handleError(_0x7011,null));};exports[_0x6573('0x54')]=function(_0x4d5dcf,_0x5912f9){return db[_0x6573('0x31')][_0x6573('0x54')]()[_0x6573('0x23')](respondWithResult(_0x5912f9,null))[_0x6573('0x44')](handleError(_0x5912f9,null));};exports[_0x6573('0x55')]=function(_0x5de8e6,_0x3adf2b,_0xefc726){return db[_0x6573('0x56')][_0x6573('0x49')]({'where':{'id':_0x5de8e6[_0x6573('0x46')]['id']}})['then'](handleEntityNotFound(_0x3adf2b,null))['then'](function(_0x3608fc){if(_0x3608fc){return _0x3608fc[_0x6573('0x55')](_0x5de8e6[_0x6573('0x4b')][_0x6573('0x57')],_[_0x6573('0x58')](_0x5de8e6[_0x6573('0x4b')],[_0x6573('0x57'),'id'])||{});}})[_0x6573('0x23')](respondWithResult(_0x3adf2b,null))['catch'](handleError(_0x3adf2b,null));};exports[_0x6573('0x59')]=function(_0x20af89,_0x37e5b6,_0x4653a3){var _0x3dab66={};var _0x49b06e={};var _0x50d753;var _0x3310e5;return db[_0x6573('0x31')]['findOne']({'where':{'id':_0x20af89[_0x6573('0x46')]['id']}})[_0x6573('0x23')](handleEntityNotFound(_0x37e5b6,null))[_0x6573('0x23')](function(_0x52b3d6){if(_0x52b3d6){_0x50d753=_0x52b3d6;_0x49b06e[_0x6573('0x36')]=_['keys'](db[_0x6573('0x56')][_0x6573('0x47')]);_0x49b06e[_0x6573('0x32')]=_[_0x6573('0x33')](_0x20af89['query']);_0x49b06e[_0x6573('0x34')]=_[_0x6573('0x35')](_0x49b06e[_0x6573('0x36')],_0x49b06e['query']);_0x3dab66[_0x6573('0x37')]=_[_0x6573('0x35')](_0x49b06e['model'],qs[_0x6573('0x5a')](_0x20af89[_0x6573('0x32')]['fields']));_0x3dab66[_0x6573('0x37')]=_0x3dab66[_0x6573('0x37')][_0x6573('0x48')]?_0x3dab66['attributes']:_0x49b06e[_0x6573('0x36')];_0x3dab66[_0x6573('0x3a')]=qs[_0x6573('0x3b')](_0x20af89[_0x6573('0x32')][_0x6573('0x3b')]);_0x3dab66[_0x6573('0x3c')]=qs[_0x6573('0x34')](_[_0x6573('0x3d')](_0x20af89[_0x6573('0x32')],_0x49b06e[_0x6573('0x34')]));if(_0x20af89[_0x6573('0x32')][_0x6573('0x3e')]){_0x3dab66[_0x6573('0x3c')]=_[_0x6573('0x2c')](_0x3dab66[_0x6573('0x3c')],{'$or':_[_0x6573('0x5b')](_0x3dab66[_0x6573('0x37')],function(_0x522510){var _0x1c0adb={};_0x1c0adb[_0x522510]={'$like':'%'+_0x20af89['query']['filter']+'%'};return _0x1c0adb;})});}_0x3dab66=_['merge']({},_0x3dab66,_0x20af89[_0x6573('0x3f')]);return _0x50d753[_0x6573('0x59')](_0x3dab66);}})[_0x6573('0x23')](function(_0xe828f1){if(_0xe828f1){_0x3310e5=_0xe828f1[_0x6573('0x48')];if(!_0x20af89[_0x6573('0x32')]['hasOwnProperty'](_0x6573('0x39'))){_0x3dab66[_0x6573('0x1e')]=qs['limit'](_0x20af89['query'][_0x6573('0x1e')]);_0x3dab66[_0x6573('0x1b')]=qs['offset'](_0x20af89[_0x6573('0x32')][_0x6573('0x1b')]);}return _0x50d753['getContacts'](_0x3dab66);}})['then'](function(_0x5ee93a){if(_0x5ee93a){return _0x5ee93a?{'count':_0x3310e5,'rows':_0x5ee93a}:null;}})[_0x6573('0x23')](respondWithResult(_0x37e5b6,null))[_0x6573('0x44')](handleError(_0x37e5b6,null));};
\ No newline at end of file
+var _0x033a=['desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','Companies','destroy','error','name','body','contact','message','interaction','account','index','CmCompany','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','create','user','get','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addContacts','CmContact','ids','omit','getContacts','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto'];(function(_0x3edd9a,_0x1dddcc){var _0x258cd1=function(_0x2d9273){while(--_0x2d9273){_0x3edd9a['push'](_0x3edd9a['shift']());}};_0x258cd1(++_0x1dddcc);}(_0x033a,0x19d));var _0xa033=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x033a[_0x4a3898];return _0x25ceb0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa033('0x0'));var zipdir=require(_0xa033('0x1'));var jsonpatch=require(_0xa033('0x2'));var rp=require(_0xa033('0x3'));var moment=require('moment');var BPromise=require(_0xa033('0x4'));var Mustache=require(_0xa033('0x5'));var util=require('util');var path=require(_0xa033('0x6'));var sox=require(_0xa033('0x7'));var csv=require(_0xa033('0x8'));var ejs=require(_0xa033('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa033('0xa'));var crypto=require(_0xa033('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa033('0xc'));var toCsv=require(_0xa033('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa033('0xd'));var authService=require(_0xa033('0xe'));var qs=require(_0xa033('0xf'));var as=require(_0xa033('0x10'));var hardwareService=require(_0xa033('0x11'));var logger=require('../../config/logger')(_0xa033('0x12'));var utils=require('../../config/utils');var config=require(_0xa033('0x13'));var licenseUtil=require(_0xa033('0x14'));var db=require(_0xa033('0x15'))['db'];function respondWithStatusCode(_0x23807f,_0x101777){_0x101777=_0x101777||0xcc;return function(_0x3eb052){if(_0x3eb052){return _0x23807f[_0xa033('0x16')](_0x101777);}return _0x23807f[_0xa033('0x17')](_0x101777)[_0xa033('0x18')]();};}function respondWithResult(_0x1af8a3,_0x5367ab){_0x5367ab=_0x5367ab||0xc8;return function(_0x1ae8a6){if(_0x1ae8a6){return _0x1af8a3['status'](_0x5367ab)[_0xa033('0x19')](_0x1ae8a6);}};}function respondWithFilteredResult(_0x353cfd,_0x2436cf){return function(_0x491151){if(_0x491151){var _0x184392=typeof _0x2436cf[_0xa033('0x1a')]===_0xa033('0x1b')&&typeof _0x2436cf[_0xa033('0x1c')]===_0xa033('0x1b');var _0x484548=_0x491151[_0xa033('0x1d')];var _0xb7fb3=_0x184392?0x0:_0x2436cf[_0xa033('0x1a')];var _0x3b172c=_0x184392?_0x491151[_0xa033('0x1d')]:_0x2436cf[_0xa033('0x1a')]+_0x2436cf[_0xa033('0x1c')];var _0x55e16a;if(_0x3b172c>=_0x484548){_0x3b172c=_0x484548;_0x55e16a=0xc8;}else{_0x55e16a=0xce;}_0x353cfd[_0xa033('0x17')](_0x55e16a);return _0x353cfd['set'](_0xa033('0x1e'),_0xb7fb3+'-'+_0x3b172c+'/'+_0x484548)[_0xa033('0x19')](_0x491151);}return null;};}function patchUpdates(_0xbdcab3){return function(_0x359d9b){try{jsonpatch[_0xa033('0x1f')](_0x359d9b,_0xbdcab3,!![]);}catch(_0x420245){return BPromise['reject'](_0x420245);}return _0x359d9b[_0xa033('0x20')]();};}function saveUpdates(_0x4440e3,_0x3f7111){return function(_0x4c8922){if(_0x4c8922){return _0x4c8922[_0xa033('0x21')](_0x4440e3)[_0xa033('0x22')](function(_0x581c89){return _0x581c89;});}return null;};}function removeEntity(_0x89d2ec,_0x3ceace){return function(_0x21d8f1){if(_0x21d8f1){return _0x21d8f1['destroy']()['then'](function(){var _0x30a6a3=_0x21d8f1['get']({'plain':!![]});var _0x2fcdbd=_0xa033('0x23');return db['UserProfileResource'][_0xa033('0x24')]({'where':{'type':_0x2fcdbd,'resourceId':_0x30a6a3['id']}})[_0xa033('0x22')](function(){return _0x21d8f1;});})[_0xa033('0x22')](function(){_0x89d2ec[_0xa033('0x17')](0xcc)[_0xa033('0x18')]();});}};}function handleEntityNotFound(_0xf51779,_0x16d9c1){return function(_0x59b93b){if(!_0x59b93b){_0xf51779['sendStatus'](0x194);}return _0x59b93b;};}function handleError(_0x491428,_0x122997){_0x122997=_0x122997||0x1f4;return function(_0x5aa7f9){logger[_0xa033('0x25')](_0x5aa7f9['stack']);if(_0x5aa7f9[_0xa033('0x26')]){delete _0x5aa7f9[_0xa033('0x26')];}_0x491428[_0xa033('0x17')](_0x122997)['send'](_0x5aa7f9);};}function getMustacheRender(_0xc49c69,_0x176255){return Mustache['render'](_0xc49c69,_['merge'](_0x176255[_0xa033('0x27')],{'contact':_0x176255[_0xa033('0x28')],'message':_0x176255[_0xa033('0x29')],'agent':_0x176255['agent'],'interaction':_0x176255[_0xa033('0x2a')],'account':_0x176255[_0xa033('0x2b')]}))||'';}exports[_0xa033('0x2c')]=function(_0x56aa8e,_0x302923){var _0x5a60e4={},_0x280cb8={},_0x2a6c8c={'count':0x0,'rows':[]};return db[_0xa033('0x2d')]['describe']()[_0xa033('0x22')](function(_0x1a6881){_0x280cb8[_0xa033('0x2e')]=_[_0xa033('0x2f')](_0x1a6881);_0x280cb8[_0xa033('0x30')]=_['keys'](_0x56aa8e['query']);_0x280cb8[_0xa033('0x31')]=_[_0xa033('0x32')](_0x280cb8[_0xa033('0x2e')],_0x280cb8[_0xa033('0x30')]);_0x5a60e4[_0xa033('0x33')]=_[_0xa033('0x32')](_0x280cb8['model'],qs['fields'](_0x56aa8e[_0xa033('0x30')][_0xa033('0x34')]));_0x5a60e4['attributes']=_0x5a60e4['attributes'][_0xa033('0x35')]?_0x5a60e4[_0xa033('0x33')]:_0x280cb8[_0xa033('0x2e')];if(!_0x56aa8e[_0xa033('0x30')][_0xa033('0x36')](_0xa033('0x37'))){_0x5a60e4[_0xa033('0x1c')]=qs['limit'](_0x56aa8e[_0xa033('0x30')][_0xa033('0x1c')]);_0x5a60e4['offset']=qs[_0xa033('0x1a')](_0x56aa8e['query']['offset']);}_0x5a60e4[_0xa033('0x38')]=qs[_0xa033('0x39')](_0x56aa8e['query'][_0xa033('0x39')]);_0x5a60e4[_0xa033('0x3a')]=qs['filters'](_[_0xa033('0x3b')](_0x56aa8e[_0xa033('0x30')],_0x280cb8[_0xa033('0x31')]),_0x1a6881);if(_0x56aa8e['query'][_0xa033('0x3c')]){_0x5a60e4[_0xa033('0x3a')]=_['merge'](_0x5a60e4[_0xa033('0x3a')],{'$or':_[_0xa033('0x3d')](_0x5a60e4['attributes'],function(_0x46e646){var _0x4d158b={};_0x4d158b[_0x46e646]={'$like':'%'+_0x56aa8e[_0xa033('0x30')][_0xa033('0x3c')]+'%'};return _0x4d158b;})});}_0x5a60e4=_[_0xa033('0x3e')]({},_0x5a60e4,_0x56aa8e[_0xa033('0x3f')]);var _0x487ecf={'where':_0x5a60e4[_0xa033('0x3a')]};return db[_0xa033('0x2d')]['count'](_0x487ecf)[_0xa033('0x22')](function(_0x11a4a5){_0x2a6c8c[_0xa033('0x1d')]=_0x11a4a5;if(_0x56aa8e['query'][_0xa033('0x40')]){_0x5a60e4[_0xa033('0x41')]=[{'all':!![]}];}return db[_0xa033('0x2d')]['findAll'](_0x5a60e4);})[_0xa033('0x22')](function(_0x37092a){_0x2a6c8c[_0xa033('0x42')]=_0x37092a;return _0x2a6c8c;})[_0xa033('0x22')](respondWithFilteredResult(_0x302923,_0x5a60e4))[_0xa033('0x43')](handleError(_0x302923,null));})[_0xa033('0x43')](handleError(_0x302923,null));};exports[_0xa033('0x44')]=function(_0x4c3b01,_0x9ceb16){var _0x42b9f8={'raw':![],'where':{'id':_0x4c3b01[_0xa033('0x45')]['id']}},_0xe2ebbb={};_0xe2ebbb[_0xa033('0x2e')]=_[_0xa033('0x2f')](db[_0xa033('0x2d')][_0xa033('0x46')]);_0xe2ebbb['query']=_[_0xa033('0x2f')](_0x4c3b01[_0xa033('0x30')]);_0xe2ebbb[_0xa033('0x31')]=_[_0xa033('0x32')](_0xe2ebbb[_0xa033('0x2e')],_0xe2ebbb['query']);_0x42b9f8[_0xa033('0x33')]=_[_0xa033('0x32')](_0xe2ebbb[_0xa033('0x2e')],qs[_0xa033('0x34')](_0x4c3b01['query']['fields']));_0x42b9f8['attributes']=_0x42b9f8['attributes'][_0xa033('0x35')]?_0x42b9f8[_0xa033('0x33')]:_0xe2ebbb[_0xa033('0x2e')];if(_0x4c3b01[_0xa033('0x30')][_0xa033('0x40')]){_0x42b9f8['include']=[{'all':!![]}];}_0x42b9f8=_[_0xa033('0x3e')]({},_0x42b9f8,_0x4c3b01[_0xa033('0x3f')]);return db[_0xa033('0x2d')]['find'](_0x42b9f8)[_0xa033('0x22')](handleEntityNotFound(_0x9ceb16,null))[_0xa033('0x22')](respondWithResult(_0x9ceb16,null))[_0xa033('0x43')](handleError(_0x9ceb16,null));};exports[_0xa033('0x47')]=function(_0x4f25e1,_0x236e53){return db[_0xa033('0x2d')][_0xa033('0x47')](_0x4f25e1['body'],{})[_0xa033('0x22')](function(_0x232b68){var _0x3bc6c3=_0x4f25e1[_0xa033('0x48')][_0xa033('0x49')]({'plain':!![]});if(!_0x3bc6c3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3bc6c3['role']===_0xa033('0x48')){var _0x5db3a4=_0x232b68[_0xa033('0x49')]({'plain':!![]});var _0x3cae07='Companies';return db[_0xa033('0x4a')]['find']({'where':{'name':_0x3cae07,'userProfileId':_0x3bc6c3['userProfileId']},'raw':!![]})['then'](function(_0x2d7957){if(_0x2d7957&&_0x2d7957[_0xa033('0x4b')]===0x0){return db[_0xa033('0x4c')][_0xa033('0x47')]({'name':_0x5db3a4[_0xa033('0x26')],'resourceId':_0x5db3a4['id'],'type':_0x2d7957[_0xa033('0x26')],'sectionId':_0x2d7957['id']},{})[_0xa033('0x22')](function(){return _0x232b68;});}else{return _0x232b68;}})[_0xa033('0x43')](function(_0x382cf1){logger[_0xa033('0x25')](_0xa033('0x4d'),_0x382cf1);throw _0x382cf1;});}return _0x232b68;})['then'](respondWithResult(_0x236e53,0xc9))[_0xa033('0x43')](handleError(_0x236e53,null));};exports['update']=function(_0x2f641e,_0xbf06a6){if(_0x2f641e[_0xa033('0x27')]['id']){delete _0x2f641e[_0xa033('0x27')]['id'];}return db[_0xa033('0x2d')][_0xa033('0x4e')]({'where':{'id':_0x2f641e[_0xa033('0x45')]['id']}})[_0xa033('0x22')](handleEntityNotFound(_0xbf06a6,null))['then'](saveUpdates(_0x2f641e[_0xa033('0x27')],null))['then'](respondWithResult(_0xbf06a6,null))[_0xa033('0x43')](handleError(_0xbf06a6,null));};exports['destroy']=function(_0x5d879e,_0x30db57){return db[_0xa033('0x2d')][_0xa033('0x4e')]({'where':{'id':_0x5d879e[_0xa033('0x45')]['id']}})[_0xa033('0x22')](handleEntityNotFound(_0x30db57,null))[_0xa033('0x22')](removeEntity(_0x30db57,null))[_0xa033('0x43')](handleError(_0x30db57,null));};exports[_0xa033('0x4f')]=function(_0x5dc8b5,_0x4f607a){return db[_0xa033('0x2d')]['describe']()[_0xa033('0x22')](respondWithResult(_0x4f607a,null))[_0xa033('0x43')](handleError(_0x4f607a,null));};exports[_0xa033('0x50')]=function(_0x3b61cc,_0x54536e,_0x535d49){return db[_0xa033('0x51')]['find']({'where':{'id':_0x3b61cc[_0xa033('0x45')]['id']}})[_0xa033('0x22')](handleEntityNotFound(_0x54536e,null))[_0xa033('0x22')](function(_0x264945){if(_0x264945){return _0x264945[_0xa033('0x50')](_0x3b61cc[_0xa033('0x27')][_0xa033('0x52')],_[_0xa033('0x53')](_0x3b61cc[_0xa033('0x27')],[_0xa033('0x52'),'id'])||{});}})[_0xa033('0x22')](respondWithResult(_0x54536e,null))['catch'](handleError(_0x54536e,null));};exports[_0xa033('0x54')]=function(_0x25b615,_0x37196f,_0x32daa4){var _0x2b4d22={};var _0x2cc738={};var _0x18e5a0;var _0xe930e8;return db['CmCompany']['findOne']({'where':{'id':_0x25b615[_0xa033('0x45')]['id']}})[_0xa033('0x22')](handleEntityNotFound(_0x37196f,null))['then'](function(_0x4806e9){if(_0x4806e9){_0x18e5a0=_0x4806e9;_0x2cc738[_0xa033('0x2e')]=_['keys'](db[_0xa033('0x51')][_0xa033('0x46')]);_0x2cc738[_0xa033('0x30')]=_['keys'](_0x25b615[_0xa033('0x30')]);_0x2cc738[_0xa033('0x31')]=_[_0xa033('0x32')](_0x2cc738[_0xa033('0x2e')],_0x2cc738[_0xa033('0x30')]);_0x2b4d22[_0xa033('0x33')]=_[_0xa033('0x32')](_0x2cc738[_0xa033('0x2e')],qs[_0xa033('0x34')](_0x25b615['query']['fields']));_0x2b4d22[_0xa033('0x33')]=_0x2b4d22[_0xa033('0x33')]['length']?_0x2b4d22[_0xa033('0x33')]:_0x2cc738[_0xa033('0x2e')];_0x2b4d22[_0xa033('0x38')]=qs[_0xa033('0x39')](_0x25b615[_0xa033('0x30')][_0xa033('0x39')]);_0x2b4d22[_0xa033('0x3a')]=qs['filters'](_[_0xa033('0x3b')](_0x25b615[_0xa033('0x30')],_0x2cc738[_0xa033('0x31')]));if(_0x25b615[_0xa033('0x30')][_0xa033('0x3c')]){_0x2b4d22[_0xa033('0x3a')]=_[_0xa033('0x3e')](_0x2b4d22[_0xa033('0x3a')],{'$or':_[_0xa033('0x3d')](_0x2b4d22[_0xa033('0x33')],function(_0x3a3ce9){var _0x341655={};_0x341655[_0x3a3ce9]={'$like':'%'+_0x25b615[_0xa033('0x30')][_0xa033('0x3c')]+'%'};return _0x341655;})});}_0x2b4d22=_[_0xa033('0x3e')]({},_0x2b4d22,_0x25b615['options']);return _0x18e5a0[_0xa033('0x54')](_0x2b4d22);}})[_0xa033('0x22')](function(_0x44d9bd){if(_0x44d9bd){_0xe930e8=_0x44d9bd[_0xa033('0x35')];if(!_0x25b615['query'][_0xa033('0x36')](_0xa033('0x37'))){_0x2b4d22[_0xa033('0x1c')]=qs[_0xa033('0x1c')](_0x25b615[_0xa033('0x30')][_0xa033('0x1c')]);_0x2b4d22[_0xa033('0x1a')]=qs[_0xa033('0x1a')](_0x25b615[_0xa033('0x30')][_0xa033('0x1a')]);}return _0x18e5a0[_0xa033('0x54')](_0x2b4d22);}})['then'](function(_0x5f6c7c){if(_0x5f6c7c){return _0x5f6c7c?{'count':_0xe930e8,'rows':_0x5f6c7c}:null;}})[_0xa033('0x22')](respondWithResult(_0x37196f,null))[_0xa033('0x43')](handleError(_0x37196f,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index a616217..f77280e 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 _0x448b=['path','rimraf','../../config/environment','./cmCompany.attributes','exports','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x448b,0x125));var _0xb448=function(_0x2f51bf,_0x12cb5a){_0x2f51bf=_0x2f51bf-0x0;var _0x3a4d09=_0x448b[_0x2f51bf];return _0x3a4d09;};'use strict';var _=require(_0xb448('0x0'));var util=require(_0xb448('0x1'));var logger=require(_0xb448('0x2'))(_0xb448('0x3'));var moment=require(_0xb448('0x4'));var BPromise=require(_0xb448('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb448('0x6'));var rimraf=require(_0xb448('0x7'));var config=require(_0xb448('0x8'));var attributes=require(_0xb448('0x9'));module[_0xb448('0xa')]=function(_0x276466,_0x3670cb){return _0x276466['define'](_0xb448('0xb'),attributes,{'tableName':_0xb448('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4bc3=['./cmCompany.attributes','exports','define','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x4735ff,_0x14f93e){var _0x3028d8=function(_0x48df83){while(--_0x48df83){_0x4735ff['push'](_0x4735ff['shift']());}};_0x3028d8(++_0x14f93e);}(_0x4bc3,0x16e));var _0x34bc=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x4bc3[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var logger=require('../../config/logger')(_0x34bc('0x2'));var moment=require(_0x34bc('0x3'));var BPromise=require('bluebird');var rp=require(_0x34bc('0x4'));var fs=require('fs');var path=require(_0x34bc('0x5'));var rimraf=require(_0x34bc('0x6'));var config=require(_0x34bc('0x7'));var attributes=require(_0x34bc('0x8'));module[_0x34bc('0x9')]=function(_0x2cc9c2,_0x4c63a1){return _0x2cc9c2[_0x34bc('0xa')]('CmCompany',attributes,{'tableName':'cm_companies','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 89fe624..c65c473 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 _0xf0b9=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','CmCompany,\x20%s,\x20%s','message','info','result','util','randomstring','ioredis'];(function(_0x386e88,_0x26ac2e){var _0x2b3208=function(_0x42b498){while(--_0x42b498){_0x386e88['push'](_0x386e88['shift']());}};_0x2b3208(++_0x26ac2e);}(_0xf0b9,0x140));var _0x9f0b=function(_0x304aa0,_0x48b6dd){_0x304aa0=_0x304aa0-0x0;var _0x23fa38=_0xf0b9[_0x304aa0];return _0x23fa38;};'use strict';var _=require('lodash');var util=require(_0x9f0b('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9f0b('0x1'));var fs=require('fs');var Redis=require(_0x9f0b('0x2'));var db=require(_0x9f0b('0x3'))['db'];var utils=require(_0x9f0b('0x4'));var logger=require(_0x9f0b('0x5'))(_0x9f0b('0x6'));var config=require(_0x9f0b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9f0b('0x8')][_0x9f0b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20625c,_0x3fa6b7,_0x35ef61){return new BPromise(function(_0x49d1ed,_0x453aa9){return client['request'](_0x20625c,_0x35ef61)['then'](function(_0x167379){logger['info']('CmCompany,\x20%s,\x20%s',_0x3fa6b7,_0x9f0b('0xa'));logger[_0x9f0b('0xb')](_0x9f0b('0xc'),_0x3fa6b7,'request\x20sent',JSON['stringify'](_0x167379));if(_0x167379[_0x9f0b('0xd')]){if(_0x167379['error'][_0x9f0b('0xe')]===0x1f4){logger[_0x9f0b('0xd')](_0x9f0b('0xf'),_0x3fa6b7,_0x167379['error'][_0x9f0b('0x10')]);return _0x453aa9(_0x167379[_0x9f0b('0xd')][_0x9f0b('0x10')]);}logger[_0x9f0b('0xd')](_0x9f0b('0xf'),_0x3fa6b7,_0x167379[_0x9f0b('0xd')]['message']);return _0x49d1ed(_0x167379[_0x9f0b('0xd')][_0x9f0b('0x10')]);}else{logger[_0x9f0b('0x11')](_0x9f0b('0xf'),_0x3fa6b7,'request\x20sent');_0x49d1ed(_0x167379[_0x9f0b('0x12')][_0x9f0b('0x10')]);}})['catch'](function(_0x57d182){logger[_0x9f0b('0xd')](_0x9f0b('0xf'),_0x3fa6b7,_0x57d182);_0x453aa9(_0x57d182);});});}
\ No newline at end of file
+var _0x7b5f=['../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5944e9,_0xf3da60){var _0x1098b8=function(_0x265f4){while(--_0x265f4){_0x5944e9['push'](_0x5944e9['shift']());}};_0x1098b8(++_0xf3da60);}(_0x7b5f,0x92));var _0xf7b5=function(_0x523cef,_0x3f95e2){_0x523cef=_0x523cef-0x0;var _0x28def2=_0x7b5f[_0x523cef];return _0x28def2;};'use strict';var _=require(_0xf7b5('0x0'));var util=require(_0xf7b5('0x1'));var moment=require(_0xf7b5('0x2'));var BPromise=require(_0xf7b5('0x3'));var rs=require(_0xf7b5('0x4'));var fs=require('fs');var Redis=require(_0xf7b5('0x5'));var db=require(_0xf7b5('0x6'))['db'];var utils=require(_0xf7b5('0x7'));var logger=require(_0xf7b5('0x8'))(_0xf7b5('0x9'));var config=require(_0xf7b5('0xa'));var jayson=require(_0xf7b5('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x30a203,_0x5edd90,_0x474a12){return new BPromise(function(_0x56ac37,_0xcc1409){return client[_0xf7b5('0xc')](_0x30a203,_0x474a12)[_0xf7b5('0xd')](function(_0x421a63){logger[_0xf7b5('0xe')](_0xf7b5('0xf'),_0x5edd90,_0xf7b5('0x10'));logger['debug'](_0xf7b5('0x11'),_0x5edd90,'request\x20sent',JSON['stringify'](_0x421a63));if(_0x421a63[_0xf7b5('0x12')]){if(_0x421a63[_0xf7b5('0x12')]['code']===0x1f4){logger[_0xf7b5('0x12')](_0xf7b5('0xf'),_0x5edd90,_0x421a63[_0xf7b5('0x12')][_0xf7b5('0x13')]);return _0xcc1409(_0x421a63[_0xf7b5('0x12')][_0xf7b5('0x13')]);}logger[_0xf7b5('0x12')]('CmCompany,\x20%s,\x20%s',_0x5edd90,_0x421a63['error'][_0xf7b5('0x13')]);return _0x56ac37(_0x421a63['error'][_0xf7b5('0x13')]);}else{logger[_0xf7b5('0xe')](_0xf7b5('0xf'),_0x5edd90,_0xf7b5('0x10'));_0x56ac37(_0x421a63[_0xf7b5('0x14')][_0xf7b5('0x13')]);}})[_0xf7b5('0x15')](function(_0x52d21a){logger[_0xf7b5('0x12')](_0xf7b5('0xf'),_0x5edd90,_0x52d21a);_0xcc1409(_0x52d21a);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index d260533..b7c5f63 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 _0x42b9=['update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','/:id','/:id/contacts','getContacts','create','post','put'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x42b9,0x17f));var _0x942b=function(_0x59987a,_0x399e11){_0x59987a=_0x59987a-0x0;var _0x460646=_0x42b9[_0x59987a];return _0x460646;};'use strict';var multer=require(_0x942b('0x0'));var util=require(_0x942b('0x1'));var path=require('path');var timeout=require(_0x942b('0x2'));var express=require(_0x942b('0x3'));var router=express[_0x942b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x942b('0x5'));var config=require(_0x942b('0x6'));var controller=require(_0x942b('0x7'));router[_0x942b('0x8')]('/',auth[_0x942b('0x9')](),controller['index']);router[_0x942b('0x8')](_0x942b('0xa'),auth[_0x942b('0x9')](),controller['describe']);router['get'](_0x942b('0xb'),auth[_0x942b('0x9')](),controller['show']);router['get'](_0x942b('0xc'),auth['isAuthenticated'](),controller[_0x942b('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x942b('0xe')]);router[_0x942b('0xf')]('/:id/contacts',auth['isAuthenticated'](),controller['addContacts']);router[_0x942b('0x10')](_0x942b('0xb'),auth[_0x942b('0x9')](),controller[_0x942b('0x11')]);router[_0x942b('0x12')](_0x942b('0xb'),auth['isAuthenticated'](),controller[_0x942b('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xe6c7=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','show','/:id/contacts','getContacts','create','post','addContacts','put','/:id','update','delete','destroy','exports','multer'];(function(_0x1a9c61,_0x4733b1){var _0x39183f=function(_0x4e23a1){while(--_0x4e23a1){_0x1a9c61['push'](_0x1a9c61['shift']());}};_0x39183f(++_0x4733b1);}(_0xe6c7,0x1af));var _0x7e6c=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xe6c7[_0x1ccdf7];return _0x52a0ae;};'use strict';var multer=require(_0x7e6c('0x0'));var util=require(_0x7e6c('0x1'));var path=require(_0x7e6c('0x2'));var timeout=require(_0x7e6c('0x3'));var express=require('express');var router=express[_0x7e6c('0x4')]();var fs_extra=require(_0x7e6c('0x5'));var auth=require(_0x7e6c('0x6'));var interaction=require(_0x7e6c('0x7'));var config=require(_0x7e6c('0x8'));var controller=require(_0x7e6c('0x9'));router[_0x7e6c('0xa')]('/',auth[_0x7e6c('0xb')](),controller[_0x7e6c('0xc')]);router['get'](_0x7e6c('0xd'),auth['isAuthenticated'](),controller[_0x7e6c('0xe')]);router[_0x7e6c('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x7e6c('0xf')]);router[_0x7e6c('0xa')](_0x7e6c('0x10'),auth[_0x7e6c('0xb')](),controller[_0x7e6c('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7e6c('0x12')]);router[_0x7e6c('0x13')](_0x7e6c('0x10'),auth[_0x7e6c('0xb')](),controller[_0x7e6c('0x14')]);router[_0x7e6c('0x15')](_0x7e6c('0x16'),auth[_0x7e6c('0xb')](),controller[_0x7e6c('0x17')]);router[_0x7e6c('0x18')](_0x7e6c('0x16'),auth['isAuthenticated'](),controller[_0x7e6c('0x19')]);module[_0x7e6c('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 8937499..77217fb 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 _0xa94d=['UNSIGNED','NOW','lodash','sequelize','exports','STRING','INTEGER'];(function(_0x49dfcb,_0x241f6d){var _0x52761b=function(_0x5d007c){while(--_0x5d007c){_0x49dfcb['push'](_0x49dfcb['shift']());}};_0x52761b(++_0x241f6d);}(_0xa94d,0x80));var _0xda94=function(_0x2c5b54,_0x467a1c){_0x2c5b54=_0x2c5b54-0x0;var _0x29138a=_0xa94d[_0x2c5b54];return _0x29138a;};'use strict';var _=require(_0xda94('0x0'));var Sequelize=require(_0xda94('0x1'));module[_0xda94('0x2')]={'firstName':{'type':Sequelize[_0xda94('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xda94('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xda94('0x3')]},'country':{'type':Sequelize[_0xda94('0x3')]},'dateOfBirth':{'type':Sequelize[_0xda94('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xda94('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xda94('0x3')]},'email':{'type':Sequelize[_0xda94('0x3')]},'url':{'type':Sequelize[_0xda94('0x3')]},'facebook':{'type':Sequelize[_0xda94('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xda94('0x3')]},'skype':{'type':Sequelize[_0xda94('0x3')]},'teams':{'type':Sequelize[_0xda94('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xda94('0x3')]},'wechat':{'type':Sequelize[_0xda94('0x3')]},'telegram':{'type':Sequelize[_0xda94('0x3')]},'UserId':{'type':Sequelize[_0xda94('0x4')]},'priority':{'type':Sequelize[_0xda94('0x4')](0x2)[_0xda94('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xda94('0x6')]}};
\ No newline at end of file
+var _0x73f8=['STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','exports'];(function(_0x4eb043,_0x55e8c2){var _0x3da0dc=function(_0x5314e9){while(--_0x5314e9){_0x4eb043['push'](_0x4eb043['shift']());}};_0x3da0dc(++_0x55e8c2);}(_0x73f8,0x156));var _0x873f=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x73f8[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x873f('0x0'));var Sequelize=require('sequelize');module[_0x873f('0x1')]={'firstName':{'type':Sequelize[_0x873f('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x873f('0x2')]},'street':{'type':Sequelize[_0x873f('0x2')]},'postalCode':{'type':Sequelize[_0x873f('0x2')]},'city':{'type':Sequelize[_0x873f('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x873f('0x2')]},'description':{'type':Sequelize[_0x873f('0x3')]},'phone':{'type':Sequelize[_0x873f('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x873f('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x873f('0x2')]},'teams':{'type':Sequelize[_0x873f('0x2')]},'viber':{'type':Sequelize[_0x873f('0x2')]},'line':{'type':Sequelize[_0x873f('0x2')]},'wechat':{'type':Sequelize[_0x873f('0x2')]},'telegram':{'type':Sequelize[_0x873f('0x2')]},'UserId':{'type':Sequelize[_0x873f('0x4')]},'priority':{'type':Sequelize[_0x873f('0x4')](0x2)[_0x873f('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x873f('0x6')],'defaultValue':Sequelize[_0x873f('0x7')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 4e86049..0626b7a 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 _0x119f=['stack','name','send','body','contact','agent','interaction','account','CmContact','describe','keys','startsWith','cf_','push','CmCustomField','findOne','length','fieldType','type','query','filters','intersection','attributes','model','fields','nolimit','order','sort','where','pick','field','color','from','tools_tags','left_join','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','Tag','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','uc.UserId\x20=\x20?','value','dateOfBirth','datetime','castTo','DATE','buildExpression','text','start','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','isArray','tag','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?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','group','c.id','QueryTypes','clone','DESC','having','t.id\x20IN\x20?','user','role','some','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','c.firstName','c.lastName','c.phone','c.mobile','c.ListId','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','find','params','catch','tags','columnName','findAll','displayName','alias','values','hasOwnProperty','merge','get','mergeWith','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','ChatInteraction','ChatMessage','ChatOfflineMessage','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','join','bulkCreate','each','duplicates','$or','spread','show','$and','format','cf_%d','omit','pickBy','table','cm_contacts','setFields','id\x20=\x20?','toParam','phone','getTags','rawAttributes','setTags','ids','options','includeAll','getHopperHistories','getHopperFinals','ContactId','include','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','socket_timestamp','pid','upload','createReadStream','parse','binding','firstName','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','mail','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','Invalid\x20channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','source','destination','callerid','endtime','duration','note','createdAt','userSecondDisposition','userThirdDisposition','UserId','fullname','startCase','chat','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','key','Owner','browserName','customerIp','osName','ratingType','referer','reverse','slice','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','error'];(function(_0x5295d3,_0x3020e4){var _0x3404ca=function(_0x249ae5){while(--_0x249ae5){_0x5295d3['push'](_0x5295d3['shift']());}};_0x3404ca(++_0x3020e4);}(_0x119f,0xf5));var _0xf119=function(_0x4d01f9,_0x5d2388){_0x4d01f9=_0x4d01f9-0x0;var _0x34a38c=_0x119f[_0x4d01f9];return _0x34a38c;};'use strict';var emlformat=require(_0xf119('0x0'));var rimraf=require(_0xf119('0x1'));var zipdir=require(_0xf119('0x2'));var jsonpatch=require(_0xf119('0x3'));var rp=require(_0xf119('0x4'));var moment=require('moment');var BPromise=require(_0xf119('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf119('0x6'));var sox=require('sox');var csv=require(_0xf119('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf119('0x8'));var _=require('lodash');var squel=require(_0xf119('0x9'));var crypto=require(_0xf119('0xa'));var jsforce=require(_0xf119('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf119('0x7'));var querystring=require('querystring');var Papa=require(_0xf119('0xc'));var Redis=require(_0xf119('0xd'));var authService=require(_0xf119('0xe'));var qs=require(_0xf119('0xf'));var as=require(_0xf119('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf119('0x11'))('api');var utils=require(_0xf119('0x12'));var config=require(_0xf119('0x13'));var licenseUtil=require(_0xf119('0x14'));var db=require(_0xf119('0x15'))['db'];config[_0xf119('0x16')]=_[_0xf119('0x17')](config[_0xf119('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xf119('0x18'))(new Redis(config[_0xf119('0x16')]));require('./cmContact.socket')[_0xf119('0x19')](socket);function respondWithStatusCode(_0x42d515,_0x599ac7){_0x599ac7=_0x599ac7||0xcc;return function(_0x26239e){if(_0x26239e){return _0x42d515[_0xf119('0x1a')](_0x599ac7);}return _0x42d515[_0xf119('0x1b')](_0x599ac7)[_0xf119('0x1c')]();};}function respondWithResult(_0xeb20b6,_0x226b25){_0x226b25=_0x226b25||0xc8;return function(_0x274e42){if(_0x274e42){return _0xeb20b6[_0xf119('0x1b')](_0x226b25)['json'](_0x274e42);}};}function respondWithFilteredResult(_0xaf885e,_0x3f3946){return function(_0x145d78){if(_0x145d78){var _0x414eaf=typeof _0x3f3946[_0xf119('0x1d')]===_0xf119('0x1e')&&typeof _0x3f3946[_0xf119('0x1f')]==='undefined';var _0x2678ac=_0x145d78['count'];var _0x53a04d=_0x414eaf?0x0:_0x3f3946['offset'];var _0x53a77b=_0x414eaf?_0x145d78[_0xf119('0x20')]:_0x3f3946[_0xf119('0x1d')]+_0x3f3946['limit'];var _0x43304e;if(_0x53a77b>=_0x2678ac){_0x53a77b=_0x2678ac;_0x43304e=0xc8;}else{_0x43304e=0xce;}_0xaf885e['status'](_0x43304e);return _0xaf885e[_0xf119('0x21')]('Content-Range',_0x53a04d+'-'+_0x53a77b+'/'+_0x2678ac)[_0xf119('0x22')](_0x145d78);}return null;};}function patchUpdates(_0x1ff4e9){return function(_0xe24243){try{jsonpatch['apply'](_0xe24243,_0x1ff4e9,!![]);}catch(_0x371826){return BPromise[_0xf119('0x23')](_0x371826);}return _0xe24243[_0xf119('0x24')]();};}function saveUpdates(_0xb466e0,_0x2994f3){return function(_0x464eb1){if(_0x464eb1){return _0x464eb1[_0xf119('0x25')](_0xb466e0)[_0xf119('0x26')](function(_0x500dec){return _0x500dec;});}return null;};}function removeEntity(_0x460271,_0x2a67e9){return function(_0x557acf){if(_0x557acf){return _0x557acf[_0xf119('0x27')]()['then'](function(){_0x460271[_0xf119('0x1b')](0xcc)[_0xf119('0x1c')]();});}};}function handleEntityNotFound(_0x511a22,_0x599c87){return function(_0x3028a2){if(!_0x3028a2){_0x511a22[_0xf119('0x1a')](0x194);}return _0x3028a2;};}function handleError(_0x8748e9,_0x4f90d6){_0x4f90d6=_0x4f90d6||0x1f4;return function(_0x408b9a){logger[_0xf119('0x28')](_0x408b9a[_0xf119('0x29')]);if(_0x408b9a[_0xf119('0x2a')]){delete _0x408b9a[_0xf119('0x2a')];}_0x8748e9['status'](_0x4f90d6)[_0xf119('0x2b')](_0x408b9a);};}function getMustacheRender(_0x515775,_0x295f54){return Mustache['render'](_0x515775,_['merge'](_0x295f54[_0xf119('0x2c')],{'contact':_0x295f54[_0xf119('0x2d')],'message':_0x295f54['message'],'agent':_0x295f54[_0xf119('0x2e')],'interaction':_0x295f54[_0xf119('0x2f')],'account':_0x295f54[_0xf119('0x30')]}))||'';}exports['index']=function(_0x258894,_0x16d158){var _0x34ecfc={},_0x1c0b48={},_0x3b6ed0={'count':0x0,'rows':[]};return db[_0xf119('0x31')][_0xf119('0x32')]()[_0xf119('0x26')](function(_0x40df08){var _0x980f23=[];for(var _0x2e826c=0x0;_0x2e826c
','Attachments','Title','Data','getHost','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com'];(function(_0x47c241,_0x303b4b){var _0x2bf94f=function(_0x267285){while(--_0x267285){_0x47c241['push'](_0x47c241['shift']());}};_0x2bf94f(++_0x303b4b);}(_0xcc00,0x159));var _0x0cc0=function(_0x1597e2,_0x388d3e){_0x1597e2=_0x1597e2-0x0;var _0x4c8c0a=_0xcc00[_0x1597e2];return _0x4c8c0a;};'use strict';var _=require(_0x0cc0('0x0'));var moment=require(_0x0cc0('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x0cc0('0x2'));var util=require(_0x0cc0('0x3'));var tnef=require(_0x0cc0('0x4'));var logger=require('../../../config/logger')(_0x0cc0('0x5'));var config=require(_0x0cc0('0x6'));function getAddress(_0x7d07b5){var _0x354b9b=_['head'](_0x7d07b5['value']);return _0x354b9b&&_0x354b9b[_0x0cc0('0x7')]?_0x354b9b[_0x0cc0('0x7')]:'anonymous'+random[_0x0cc0('0x8')](0x6)+'@xcally.com';}function getFirstName(_0x351c35){var _0x263aa0=_[_0x0cc0('0x9')](_0x351c35[_0x0cc0('0xa')]);if(_0x263aa0&&_0x263aa0['name']){var _0x10f9a4=_0x263aa0['name']['split'](/\s+/);return _0x10f9a4['length']?_0x10f9a4[_0x0cc0('0xb')](0x0,-0x1)[_0x0cc0('0xc')]('\x20'):_0x263aa0[_0x0cc0('0xd')];}return _0x0cc0('0xe');}function getLastName(_0x238fa5){var _0x5614d8=_[_0x0cc0('0x9')](_0x238fa5[_0x0cc0('0xa')]);if(_0x5614d8&&_0x5614d8['name']){var _0x1dc96=_0x5614d8['name'][_0x0cc0('0xf')](/\s+/);return _0x1dc96[_0x0cc0('0x10')]>0x1?_0x1dc96['pop']():'';}return'';}function getMails(_0x401cda,_0x53b7ab){var _0xaa974a='';for(var _0x1fc2aa=0x0;_0x1fc2aa<_0x53b7ab[_0x0cc0('0xa')][_0x0cc0('0x10')];_0x1fc2aa+=0x1){if(_0x53b7ab[_0x0cc0('0xa')][_0x1fc2aa]['address']!==_0x401cda){if(!_[_0x0cc0('0x11')](_0xaa974a)){_0xaa974a+=',';}_0xaa974a+=_0x53b7ab[_0x0cc0('0xa')][_0x1fc2aa][_0x0cc0('0xd')]||_0x53b7ab['value'][_0x1fc2aa][_0x0cc0('0x7')]||'';_0xaa974a+='\x20<';_0xaa974a+=_0x53b7ab['value'][_0x1fc2aa][_0x0cc0('0x7')]?_0x53b7ab['value'][_0x1fc2aa][_0x0cc0('0x7')]:_0x0cc0('0x12')+random[_0x0cc0('0x8')](0x6)+_0x0cc0('0x13');_0xaa974a+='>';}}return _0xaa974a;}function parseEmail(_0x5eb92b,_0x33d285,_0x59460c){if(_0x33d285[_0x0cc0('0x14')]){var _0x52d938=/