From: Andrea Bianco
Date: Tue, 11 Jan 2022 11:43:48 +0000 (+0100)
Subject: Built motion from commit fda31434.|2.5.44
X-Git-Url: http://repos.xcallymotion.com/?a=commitdiff_plain;h=2e31c218a901103f37844aa0b6300187da81ec56;p=motion2.git
Built motion from commit fda31434.|2.5.44
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 8a4667d..d070563 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-01-10T17:27:50.727Z",
+ "time": "2022-01-11T11:34:17.811Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index a653553..a8f21a4 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-01-10T17:27:50.727Z",
+ "time": "2022-01-11T11:34:17.811Z",
"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 a1cbd46..563c479 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 _0x9534=['jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[body]','sequelize','exports','VIRTUAL','action','STRING','contactManager','integration','urlForward','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x30eecf,_0x30cfdb){var _0x10bb61=function(_0x35b4fc){while(--_0x35b4fc){_0x30eecf['push'](_0x30eecf['shift']());}};_0x10bb61(++_0x30cfdb);}(_0x9534,0xc6));var _0x4953=function(_0x152c9a,_0x15db16){_0x152c9a=_0x152c9a-0x0;var _0x43a214=_0x9534[_0x152c9a];return _0x43a214;};'use strict';var Sequelize=require(_0x4953('0x0'));module[_0x4953('0x1')]={'name':{'type':Sequelize[_0x4953('0x2')],'get':function(_0x401bb5){return this['getDataValue'](_0x4953('0x3'));}},'action':{'type':Sequelize[_0x4953('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x4953('0x5'),_0x4953('0x6'),'motionbar','jscripty',_0x4953('0x7'),'browser',_0x4953('0x8'),'script']],'msg':_0x4953('0x9')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x4953('0x4')](0x1000),'comment':_0x4953('0xa')},'data2':{'type':Sequelize[_0x4953('0x4')](0x1000),'comment':_0x4953('0xb')},'data3':{'type':Sequelize[_0x4953('0x4')](0x1000),'comment':_0x4953('0xc')},'data4':{'type':Sequelize[_0x4953('0x4')](0x1000),'comments':_0x4953('0xd')},'data5':{'type':Sequelize[_0x4953('0x4')](0x1000),'comments':_0x4953('0xe')},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':_0x4953('0xf')}};
\ No newline at end of file
+var _0xc86f=['getDataValue','action','STRING','contactManager','integration','motionbar','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','sequelize','exports'];(function(_0x1f3244,_0x23cd4f){var _0x14c9c0=function(_0x2b87b2){while(--_0x2b87b2){_0x1f3244['push'](_0x1f3244['shift']());}};_0x14c9c0(++_0x23cd4f);}(_0xc86f,0xce));var _0xfc86=function(_0x59dfec,_0x2409e7){_0x59dfec=_0x59dfec-0x0;var _0x1e194a=_0xc86f[_0x59dfec];return _0x1e194a;};'use strict';var Sequelize=require(_0xfc86('0x0'));module[_0xfc86('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3fbf8e){return this[_0xfc86('0x2')](_0xfc86('0x3'));}},'action':{'type':Sequelize[_0xfc86('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xfc86('0x5'),_0xfc86('0x6'),_0xfc86('0x7'),'jscripty',_0xfc86('0x8'),_0xfc86('0x9'),_0xfc86('0xa'),_0xfc86('0xb')]],'msg':_0xfc86('0xc')}},'comment':_0xfc86('0xc')},'data1':{'type':Sequelize[_0xfc86('0x4')](0x1000),'comment':_0xfc86('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xfc86('0xe')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xfc86('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xfc86('0x4')](0x1000),'comments':_0xfc86('0xf')},'data6':{'type':Sequelize[_0xfc86('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 48629d1..e62eb06 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 _0xde9e=['find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','body','Action'];(function(_0x3f5522,_0x28e324){var _0x4731f1=function(_0xfe154){while(--_0xfe154){_0x3f5522['push'](_0x3f5522['shift']());}};_0x4731f1(++_0x28e324);}(_0xde9e,0x18b));var _0xede9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde9e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xede9('0x0'));var rimraf=require(_0xede9('0x1'));var zipdir=require(_0xede9('0x2'));var jsonpatch=require(_0xede9('0x3'));var rp=require(_0xede9('0x4'));var moment=require(_0xede9('0x5'));var BPromise=require(_0xede9('0x6'));var Mustache=require(_0xede9('0x7'));var util=require(_0xede9('0x8'));var path=require(_0xede9('0x9'));var sox=require(_0xede9('0xa'));var csv=require(_0xede9('0xb'));var ejs=require(_0xede9('0xc'));var fs=require('fs');var fs_extra=require(_0xede9('0xd'));var _=require(_0xede9('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xede9('0xf'));var deskjs=require(_0xede9('0x10'));var toCsv=require(_0xede9('0xb'));var querystring=require(_0xede9('0x11'));var Papa=require(_0xede9('0x12'));var Redis=require(_0xede9('0x13'));var authService=require(_0xede9('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xede9('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xede9('0x16'));var utils=require(_0xede9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xede9('0x18'));var db=require(_0xede9('0x19'))['db'];function respondWithStatusCode(_0x5db679,_0x283d46){_0x283d46=_0x283d46||0xcc;return function(_0x4b8cba){if(_0x4b8cba){return _0x5db679[_0xede9('0x1a')](_0x283d46);}return _0x5db679[_0xede9('0x1b')](_0x283d46)[_0xede9('0x1c')]();};}function respondWithResult(_0x16b5ed,_0x1d9da7){_0x1d9da7=_0x1d9da7||0xc8;return function(_0x114074){if(_0x114074){return _0x16b5ed['status'](_0x1d9da7)[_0xede9('0x1d')](_0x114074);}};}function respondWithFilteredResult(_0x590ac4,_0x4aa27c){return function(_0x399796){if(_0x399796){var _0x20c9a6=typeof _0x4aa27c['offset']===_0xede9('0x1e')&&typeof _0x4aa27c[_0xede9('0x1f')]==='undefined';var _0x468f93=_0x399796['count'];var _0x46a785=_0x20c9a6?0x0:_0x4aa27c[_0xede9('0x20')];var _0x27e47e=_0x20c9a6?_0x399796[_0xede9('0x21')]:_0x4aa27c['offset']+_0x4aa27c[_0xede9('0x1f')];var _0x4c0181;if(_0x27e47e>=_0x468f93){_0x27e47e=_0x468f93;_0x4c0181=0xc8;}else{_0x4c0181=0xce;}_0x590ac4[_0xede9('0x1b')](_0x4c0181);return _0x590ac4[_0xede9('0x22')](_0xede9('0x23'),_0x46a785+'-'+_0x27e47e+'/'+_0x468f93)[_0xede9('0x1d')](_0x399796);}return null;};}function patchUpdates(_0x1ab444){return function(_0x8fc1ba){try{jsonpatch[_0xede9('0x24')](_0x8fc1ba,_0x1ab444,!![]);}catch(_0x39c878){return BPromise[_0xede9('0x25')](_0x39c878);}return _0x8fc1ba[_0xede9('0x26')]();};}function saveUpdates(_0x36f182,_0x2f333f){return function(_0x16e97){if(_0x16e97){return _0x16e97[_0xede9('0x27')](_0x36f182)[_0xede9('0x28')](function(_0x2f797a){return _0x2f797a;});}return null;};}function removeEntity(_0x3793d3,_0x3ecbf3){return function(_0x1e0692){if(_0x1e0692){return _0x1e0692[_0xede9('0x29')]()[_0xede9('0x28')](function(){_0x3793d3[_0xede9('0x1b')](0xcc)[_0xede9('0x1c')]();});}};}function handleEntityNotFound(_0x473dad,_0x3f2b76){return function(_0x4e3aba){if(!_0x4e3aba){_0x473dad[_0xede9('0x1a')](0x194);}return _0x4e3aba;};}function handleError(_0x742a22,_0x1c9117){_0x1c9117=_0x1c9117||0x1f4;return function(_0x1f9c4b){logger['error'](_0x1f9c4b['stack']);if(_0x1f9c4b[_0xede9('0x2a')]){delete _0x1f9c4b[_0xede9('0x2a')];}_0x742a22['status'](_0x1c9117)[_0xede9('0x2b')](_0x1f9c4b);};}exports[_0xede9('0x27')]=function(_0x482110,_0x5ebabe){if(_0x482110[_0xede9('0x2c')]['id']){delete _0x482110['body']['id'];}return db[_0xede9('0x2d')][_0xede9('0x2e')]({'where':{'id':_0x482110[_0xede9('0x2f')]['id']}})[_0xede9('0x28')](handleEntityNotFound(_0x5ebabe,null))[_0xede9('0x28')](saveUpdates(_0x482110[_0xede9('0x2c')],null))[_0xede9('0x28')](respondWithResult(_0x5ebabe,null))[_0xede9('0x30')](handleError(_0x5ebabe,null));};exports['destroy']=function(_0x553580,_0x2485e2){return db[_0xede9('0x2d')]['find']({'where':{'id':_0x553580[_0xede9('0x2f')]['id']}})[_0xede9('0x28')](handleEntityNotFound(_0x2485e2,null))[_0xede9('0x28')](removeEntity(_0x2485e2,null))[_0xede9('0x30')](handleError(_0x2485e2,null));};
\ No newline at end of file
+var _0x68d1=['update','body','Action','find','params','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','limit','set','Content-Range','apply','reject','save','then','stack','name','send'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x68d1,0x9a));var _0x168d=function(_0x4046f7,_0x3e6ba7){_0x4046f7=_0x4046f7-0x0;var _0x584402=_0x68d1[_0x4046f7];return _0x584402;};'use strict';var emlformat=require(_0x168d('0x0'));var rimraf=require(_0x168d('0x1'));var zipdir=require(_0x168d('0x2'));var jsonpatch=require(_0x168d('0x3'));var rp=require(_0x168d('0x4'));var moment=require(_0x168d('0x5'));var BPromise=require(_0x168d('0x6'));var Mustache=require('mustache');var util=require(_0x168d('0x7'));var path=require(_0x168d('0x8'));var sox=require(_0x168d('0x9'));var csv=require('to-csv');var ejs=require(_0x168d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x168d('0xb'));var squel=require(_0x168d('0xc'));var crypto=require('crypto');var jsforce=require(_0x168d('0xd'));var deskjs=require(_0x168d('0xe'));var toCsv=require(_0x168d('0xf'));var querystring=require(_0x168d('0x10'));var Papa=require(_0x168d('0x11'));var Redis=require('ioredis');var authService=require(_0x168d('0x12'));var qs=require(_0x168d('0x13'));var as=require(_0x168d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x168d('0x15'))(_0x168d('0x16'));var utils=require('../../config/utils');var config=require(_0x168d('0x17'));var licenseUtil=require(_0x168d('0x18'));var db=require(_0x168d('0x19'))['db'];function respondWithStatusCode(_0x155481,_0x1b4cb8){_0x1b4cb8=_0x1b4cb8||0xcc;return function(_0x188a62){if(_0x188a62){return _0x155481[_0x168d('0x1a')](_0x1b4cb8);}return _0x155481[_0x168d('0x1b')](_0x1b4cb8)[_0x168d('0x1c')]();};}function respondWithResult(_0x13ed0b,_0x3d6600){_0x3d6600=_0x3d6600||0xc8;return function(_0x31f2c0){if(_0x31f2c0){return _0x13ed0b[_0x168d('0x1b')](_0x3d6600)[_0x168d('0x1d')](_0x31f2c0);}};}function respondWithFilteredResult(_0x4d3f88,_0x513fb9){return function(_0x3f3702){if(_0x3f3702){var _0x35656f=typeof _0x513fb9['offset']===_0x168d('0x1e')&&typeof _0x513fb9['limit']===_0x168d('0x1e');var _0x41ceab=_0x3f3702[_0x168d('0x1f')];var _0x5476cf=_0x35656f?0x0:_0x513fb9['offset'];var _0x338829=_0x35656f?_0x3f3702[_0x168d('0x1f')]:_0x513fb9['offset']+_0x513fb9[_0x168d('0x20')];var _0x53ca4d;if(_0x338829>=_0x41ceab){_0x338829=_0x41ceab;_0x53ca4d=0xc8;}else{_0x53ca4d=0xce;}_0x4d3f88[_0x168d('0x1b')](_0x53ca4d);return _0x4d3f88[_0x168d('0x21')](_0x168d('0x22'),_0x5476cf+'-'+_0x338829+'/'+_0x41ceab)[_0x168d('0x1d')](_0x3f3702);}return null;};}function patchUpdates(_0xf98a70){return function(_0x274e25){try{jsonpatch[_0x168d('0x23')](_0x274e25,_0xf98a70,!![]);}catch(_0x2c340e){return BPromise[_0x168d('0x24')](_0x2c340e);}return _0x274e25[_0x168d('0x25')]();};}function saveUpdates(_0x3d3ef3,_0x514a09){return function(_0x491b2a){if(_0x491b2a){return _0x491b2a['update'](_0x3d3ef3)[_0x168d('0x26')](function(_0x3b1fa4){return _0x3b1fa4;});}return null;};}function removeEntity(_0x136bea,_0x1c2ff4){return function(_0x3a6b5a){if(_0x3a6b5a){return _0x3a6b5a['destroy']()['then'](function(){_0x136bea[_0x168d('0x1b')](0xcc)[_0x168d('0x1c')]();});}};}function handleEntityNotFound(_0x1e1477,_0x4a716f){return function(_0x2422bb){if(!_0x2422bb){_0x1e1477[_0x168d('0x1a')](0x194);}return _0x2422bb;};}function handleError(_0x2d3350,_0xf5f239){_0xf5f239=_0xf5f239||0x1f4;return function(_0x345c72){logger['error'](_0x345c72[_0x168d('0x27')]);if(_0x345c72['name']){delete _0x345c72[_0x168d('0x28')];}_0x2d3350[_0x168d('0x1b')](_0xf5f239)[_0x168d('0x29')](_0x345c72);};}exports[_0x168d('0x2a')]=function(_0x556af5,_0x38ee30){if(_0x556af5[_0x168d('0x2b')]['id']){delete _0x556af5[_0x168d('0x2b')]['id'];}return db[_0x168d('0x2c')][_0x168d('0x2d')]({'where':{'id':_0x556af5[_0x168d('0x2e')]['id']}})[_0x168d('0x26')](handleEntityNotFound(_0x38ee30,null))['then'](saveUpdates(_0x556af5[_0x168d('0x2b')],null))['then'](respondWithResult(_0x38ee30,null))[_0x168d('0x2f')](handleError(_0x38ee30,null));};exports[_0x168d('0x30')]=function(_0x3a8899,_0x5a349a){return db['Action'][_0x168d('0x2d')]({'where':{'id':_0x3a8899[_0x168d('0x2e')]['id']}})[_0x168d('0x26')](handleEntityNotFound(_0x5a349a,null))['then'](removeEntity(_0x5a349a,null))['catch'](handleError(_0x5a349a,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 22a246e..3ee96a5 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 _0xe23a=['../../config/environment','./action.attributes','exports','define','Action','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x26a490,_0x1d54cf){var _0x4f14c1=function(_0x47922f){while(--_0x47922f){_0x26a490['push'](_0x26a490['shift']());}};_0x4f14c1(++_0x1d54cf);}(_0xe23a,0x165));var _0xae23=function(_0x37a7c6,_0x3a84b6){_0x37a7c6=_0x37a7c6-0x0;var _0x539905=_0xe23a[_0x37a7c6];return _0x539905;};'use strict';var _=require(_0xae23('0x0'));var util=require(_0xae23('0x1'));var logger=require(_0xae23('0x2'))(_0xae23('0x3'));var moment=require(_0xae23('0x4'));var BPromise=require('bluebird');var rp=require(_0xae23('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xae23('0x6'));var attributes=require(_0xae23('0x7'));module[_0xae23('0x8')]=function(_0x2a6b82,_0x8a5ecf){return _0x2a6b82[_0xae23('0x9')](_0xae23('0xa'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x10d0=['path','rimraf','../../config/environment','exports','Action','tools_actions','lodash','util','api','bluebird'];(function(_0x23b5b6,_0x88ba37){var _0x20392d=function(_0x1c0398){while(--_0x1c0398){_0x23b5b6['push'](_0x23b5b6['shift']());}};_0x20392d(++_0x88ba37);}(_0x10d0,0x13c));var _0x010d=function(_0x13fc10,_0x35a13c){_0x13fc10=_0x13fc10-0x0;var _0x211d0d=_0x10d0[_0x13fc10];return _0x211d0d;};'use strict';var _=require(_0x010d('0x0'));var util=require(_0x010d('0x1'));var logger=require('../../config/logger')(_0x010d('0x2'));var moment=require('moment');var BPromise=require(_0x010d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x010d('0x4'));var rimraf=require(_0x010d('0x5'));var config=require(_0x010d('0x6'));var attributes=require('./action.attributes');module[_0x010d('0x7')]=function(_0x17a8f6,_0x4335fc){return _0x17a8f6['define'](_0x010d('0x8'),attributes,{'tableName':_0x010d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 332fd58..fd2ee3b 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 _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x7217,0x19e));var _0x7721=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x7217[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}
\ No newline at end of file
+var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x4975,0x86));var _0x5497=function(_0xfe1276,_0x59fd1e){_0xfe1276=_0xfe1276-0x0;var _0x47d5ba=_0x4975[_0xfe1276];return _0x47d5ba;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 82c52b0..c834abc 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 _0xa955=['../../components/auth/service','../../config/environment','put','/:id','isAuthenticated','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xa955,0x15a));var _0x5a95=function(_0x2e1e32,_0x467539){_0x2e1e32=_0x2e1e32-0x0;var _0x5b7e9d=_0xa955[_0x2e1e32];return _0x5b7e9d;};'use strict';var multer=require(_0x5a95('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5a95('0x1'));var express=require(_0x5a95('0x2'));var router=express[_0x5a95('0x3')]();var fs_extra=require(_0x5a95('0x4'));var auth=require(_0x5a95('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5a95('0x6'));var controller=require('./action.controller');router[_0x5a95('0x7')](_0x5a95('0x8'),auth[_0x5a95('0x9')](),controller[_0x5a95('0xa')]);router[_0x5a95('0xb')](_0x5a95('0x8'),auth[_0x5a95('0x9')](),controller[_0x5a95('0xc')]);module['exports']=router;
\ No newline at end of file
+var _0x1366=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','./action.controller','put','/:id','isAuthenticated'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x1366,0x1a4));var _0x6136=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1366[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0x6136('0x0'));var util=require('util');var path=require(_0x6136('0x1'));var timeout=require(_0x6136('0x2'));var express=require(_0x6136('0x3'));var router=express[_0x6136('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6136('0x5'));router[_0x6136('0x6')](_0x6136('0x7'),auth[_0x6136('0x8')](),controller[_0x6136('0x9')]);router[_0x6136('0xa')](_0x6136('0x7'),auth[_0x6136('0x8')](),controller[_0x6136('0xb')]);module[_0x6136('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index f134f66..fa296c6 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 _0x6aa7=['TEXT','sequelize','STRING'];(function(_0x14090e,_0x30c2f7){var _0x554da7=function(_0x165d16){while(--_0x165d16){_0x14090e['push'](_0x14090e['shift']());}};_0x554da7(++_0x30c2f7);}(_0x6aa7,0x178));var _0x76aa=function(_0x449f15,_0x315f99){_0x449f15=_0x449f15-0x0;var _0x1fb5f4=_0x6aa7[_0x449f15];return _0x1fb5f4;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'name':{'type':Sequelize[_0x76aa('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x76aa('0x1')]},'parent':{'type':Sequelize[_0x76aa('0x1')]},'table':{'type':Sequelize[_0x76aa('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x76aa('0x2')]}};
\ No newline at end of file
+var _0x24ca=['sequelize','STRING','TEXT'];(function(_0x267095,_0xd6b820){var _0x2c31be=function(_0xed99a8){while(--_0xed99a8){_0x267095['push'](_0x267095['shift']());}};_0x2c31be(++_0xd6b820);}(_0x24ca,0x1bc));var _0xa24c=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0x24ca[_0x48d6a3];return _0x38bfa0;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa24c('0x1')]},'parent':{'type':Sequelize[_0xa24c('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xa24c('0x2')]},'joins':{'type':Sequelize[_0xa24c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index a53a4a9..92c12f7 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 _0xa1ab=['GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','keyBy','select','from','table','MetricId','metric','function','format','replace','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','sequelize','toString','QueryTypes','SELECT','SEC_TO_TIME(%s)','IS\x20NULL','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','web','fullPath','%s-%s.%s','generate','output','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','run','MIN(%s)','Limited\x20Query:','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','get','CustomReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','AnalyticCustomReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)'];(function(_0x595284,_0x2b5c86){var _0x1e948f=function(_0x16c7ff){while(--_0x16c7ff){_0x595284['push'](_0x595284['shift']());}};_0x1e948f(++_0x2b5c86);}(_0xa1ab,0x1a1));var _0xba1a=function(_0x329dc8,_0x98b7cb){_0x329dc8=_0x329dc8-0x0;var _0x1a34c2=_0xa1ab[_0x329dc8];return _0x1a34c2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xba1a('0x0'));var zipdir=require(_0xba1a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xba1a('0x2'));var BPromise=require(_0xba1a('0x3'));var Mustache=require(_0xba1a('0x4'));var util=require(_0xba1a('0x5'));var path=require(_0xba1a('0x6'));var sox=require(_0xba1a('0x7'));var csv=require('to-csv');var ejs=require(_0xba1a('0x8'));var fs=require('fs');var fs_extra=require(_0xba1a('0x9'));var _=require(_0xba1a('0xa'));var squel=require(_0xba1a('0xb'));var crypto=require(_0xba1a('0xc'));var jsforce=require(_0xba1a('0xd'));var deskjs=require(_0xba1a('0xe'));var toCsv=require(_0xba1a('0xf'));var querystring=require(_0xba1a('0x10'));var Papa=require(_0xba1a('0x11'));var Redis=require(_0xba1a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xba1a('0x13'));var as=require(_0xba1a('0x14'));var hardwareService=require(_0xba1a('0x15'));var logger=require(_0xba1a('0x16'))(_0xba1a('0x17'));var utils=require('../../config/utils');var config=require(_0xba1a('0x18'));var licenseUtil=require(_0xba1a('0x19'));var db=require(_0xba1a('0x1a'))['db'];var dbH=require(_0xba1a('0x1a'))[_0xba1a('0x1b')];function respondWithStatusCode(_0x2e086c,_0x428a3d){_0x428a3d=_0x428a3d||0xcc;return function(_0x160131){if(_0x160131){return _0x2e086c[_0xba1a('0x1c')](_0x428a3d);}return _0x2e086c[_0xba1a('0x1d')](_0x428a3d)['end']();};}function respondWithResult(_0x984dc1,_0x3a24b3){_0x3a24b3=_0x3a24b3||0xc8;return function(_0x32e884){if(_0x32e884){return _0x984dc1['status'](_0x3a24b3)['json'](_0x32e884);}};}function respondWithFilteredResult(_0x4ee554,_0xeda5){return function(_0x428c94){if(_0x428c94){var _0x1dd592=typeof _0xeda5[_0xba1a('0x1e')]===_0xba1a('0x1f')&&typeof _0xeda5[_0xba1a('0x20')]===_0xba1a('0x1f');var _0x1b91a3=_0x428c94[_0xba1a('0x21')];var _0x390ceb=_0x1dd592?0x0:_0xeda5[_0xba1a('0x1e')];var _0x142f72=_0x1dd592?_0x428c94[_0xba1a('0x21')]:_0xeda5[_0xba1a('0x1e')]+_0xeda5[_0xba1a('0x20')];var _0x1d2b1d;if(_0x142f72>=_0x1b91a3){_0x142f72=_0x1b91a3;_0x1d2b1d=0xc8;}else{_0x1d2b1d=0xce;}_0x4ee554[_0xba1a('0x1d')](_0x1d2b1d);return _0x4ee554[_0xba1a('0x22')](_0xba1a('0x23'),_0x390ceb+'-'+_0x142f72+'/'+_0x1b91a3)[_0xba1a('0x24')](_0x428c94);}return null;};}function patchUpdates(_0x130d10){return function(_0x122131){try{jsonpatch[_0xba1a('0x25')](_0x122131,_0x130d10,!![]);}catch(_0x26413b){return BPromise['reject'](_0x26413b);}return _0x122131['save']();};}function saveUpdates(_0x28cedb,_0x12eb44){return function(_0x45ac95){if(_0x45ac95){return _0x45ac95[_0xba1a('0x26')](_0x28cedb)[_0xba1a('0x27')](function(_0x212abc){return _0x212abc;});}return null;};}function removeEntity(_0x1ad725,_0x216e1d){return function(_0x379fe8){if(_0x379fe8){return _0x379fe8[_0xba1a('0x28')]()[_0xba1a('0x27')](function(){var _0x3ea4f3=_0x379fe8[_0xba1a('0x29')]({'plain':!![]});var _0x310e2e=_0xba1a('0x2a');return db[_0xba1a('0x2b')][_0xba1a('0x28')]({'where':{'type':_0x310e2e,'resourceId':_0x3ea4f3['id']}})[_0xba1a('0x27')](function(){return _0x379fe8;});})[_0xba1a('0x27')](function(){_0x1ad725[_0xba1a('0x1d')](0xcc)[_0xba1a('0x2c')]();});}};}function handleEntityNotFound(_0x3d473b,_0xe5b1c0){return function(_0x3c56a4){if(!_0x3c56a4){_0x3d473b[_0xba1a('0x1c')](0x194);}return _0x3c56a4;};}function handleError(_0x206021,_0x4b906d){_0x4b906d=_0x4b906d||0x1f4;return function(_0x7cc229){logger[_0xba1a('0x2d')](_0x7cc229[_0xba1a('0x2e')]);if(_0x7cc229['name']){delete _0x7cc229[_0xba1a('0x2f')];}_0x206021[_0xba1a('0x1d')](_0x4b906d)[_0xba1a('0x30')](_0x7cc229);};}exports[_0xba1a('0x31')]=function(_0x9ee4dc,_0x5c843b){var _0x38bdf8={},_0x13a85a={},_0x26cc5e={'count':0x0,'rows':[]};var _0xd648a4=_[_0xba1a('0x32')](db['AnalyticCustomReport'][_0xba1a('0x33')],function(_0x235fdf){return{'name':_0x235fdf[_0xba1a('0x34')],'type':_0x235fdf[_0xba1a('0x35')][_0xba1a('0x36')]};});_0x13a85a[_0xba1a('0x37')]=_[_0xba1a('0x32')](_0xd648a4,_0xba1a('0x2f'));_0x13a85a['query']=_['keys'](_0x9ee4dc[_0xba1a('0x38')]);_0x13a85a[_0xba1a('0x39')]=_[_0xba1a('0x3a')](_0x13a85a[_0xba1a('0x37')],_0x13a85a[_0xba1a('0x38')]);_0x38bdf8[_0xba1a('0x3b')]=_['intersection'](_0x13a85a[_0xba1a('0x37')],qs[_0xba1a('0x3c')](_0x9ee4dc[_0xba1a('0x38')][_0xba1a('0x3c')]));_0x38bdf8[_0xba1a('0x3b')]=_0x38bdf8[_0xba1a('0x3b')][_0xba1a('0x3d')]?_0x38bdf8[_0xba1a('0x3b')]:_0x13a85a[_0xba1a('0x37')];if(!_0x9ee4dc[_0xba1a('0x38')]['hasOwnProperty']('nolimit')){_0x38bdf8[_0xba1a('0x20')]=qs[_0xba1a('0x20')](_0x9ee4dc[_0xba1a('0x38')][_0xba1a('0x20')]);_0x38bdf8[_0xba1a('0x1e')]=qs[_0xba1a('0x1e')](_0x9ee4dc[_0xba1a('0x38')][_0xba1a('0x1e')]);}_0x38bdf8[_0xba1a('0x3e')]=qs['sort'](_0x9ee4dc[_0xba1a('0x38')][_0xba1a('0x3f')]);_0x38bdf8[_0xba1a('0x40')]=qs[_0xba1a('0x39')](_[_0xba1a('0x41')](_0x9ee4dc[_0xba1a('0x38')],_0x13a85a[_0xba1a('0x39')]),_0xd648a4);if(_0x9ee4dc[_0xba1a('0x38')][_0xba1a('0x42')]){_0x38bdf8[_0xba1a('0x40')]=_['merge'](_0x38bdf8[_0xba1a('0x40')],{'$or':_[_0xba1a('0x32')](_0xd648a4,function(_0x56a970){if(_0x56a970[_0xba1a('0x35')]!==_0xba1a('0x43')){var _0x4e1d3b={};_0x4e1d3b[_0x56a970['name']]={'$like':'%'+_0x9ee4dc[_0xba1a('0x38')][_0xba1a('0x42')]+'%'};return _0x4e1d3b;}})});}_0x38bdf8=_[_0xba1a('0x44')]({},_0x38bdf8,_0x9ee4dc[_0xba1a('0x45')]);var _0x3d7a34={'where':_0x38bdf8[_0xba1a('0x40')]};return db[_0xba1a('0x46')][_0xba1a('0x21')](_0x3d7a34)[_0xba1a('0x27')](function(_0x493a10){_0x26cc5e[_0xba1a('0x21')]=_0x493a10;if(_0x9ee4dc[_0xba1a('0x38')][_0xba1a('0x47')]){_0x38bdf8[_0xba1a('0x48')]=[{'all':!![]}];}return db[_0xba1a('0x46')][_0xba1a('0x49')](_0x38bdf8);})[_0xba1a('0x27')](function(_0x1dd149){_0x26cc5e[_0xba1a('0x4a')]=_0x1dd149;return _0x26cc5e;})[_0xba1a('0x27')](respondWithFilteredResult(_0x5c843b,_0x38bdf8))[_0xba1a('0x4b')](handleError(_0x5c843b,null));};exports[_0xba1a('0x4c')]=function(_0xdd00fe,_0x2865e4){var _0x44cc24={'raw':![],'where':{'id':_0xdd00fe[_0xba1a('0x4d')]['id']}},_0x31a957={};_0x31a957[_0xba1a('0x37')]=_[_0xba1a('0x4e')](db['AnalyticCustomReport'][_0xba1a('0x33')]);_0x31a957[_0xba1a('0x38')]=_[_0xba1a('0x4e')](_0xdd00fe['query']);_0x31a957[_0xba1a('0x39')]=_[_0xba1a('0x3a')](_0x31a957['model'],_0x31a957[_0xba1a('0x38')]);_0x44cc24[_0xba1a('0x3b')]=_[_0xba1a('0x3a')](_0x31a957[_0xba1a('0x37')],qs[_0xba1a('0x3c')](_0xdd00fe[_0xba1a('0x38')][_0xba1a('0x3c')]));_0x44cc24[_0xba1a('0x3b')]=_0x44cc24['attributes'][_0xba1a('0x3d')]?_0x44cc24[_0xba1a('0x3b')]:_0x31a957['model'];if(_0xdd00fe['query'][_0xba1a('0x47')]){_0x44cc24[_0xba1a('0x48')]=[{'all':!![]}];}_0x44cc24=_[_0xba1a('0x44')]({},_0x44cc24,_0xdd00fe[_0xba1a('0x45')]);return db[_0xba1a('0x46')][_0xba1a('0x4f')](_0x44cc24)[_0xba1a('0x27')](handleEntityNotFound(_0x2865e4,null))['then'](respondWithResult(_0x2865e4,null))[_0xba1a('0x4b')](handleError(_0x2865e4,null));};exports[_0xba1a('0x50')]=function(_0x4b77ff,_0x35ec7d){return db[_0xba1a('0x46')][_0xba1a('0x50')](_0x4b77ff['body'],{})[_0xba1a('0x27')](function(_0x2947a3){var _0x5a8714=_0x4b77ff[_0xba1a('0x51')][_0xba1a('0x29')]({'plain':!![]});if(!_0x5a8714)throw new Error(_0xba1a('0x52'));if(_0x5a8714[_0xba1a('0x53')]===_0xba1a('0x51')){var _0x37b445=_0x2947a3[_0xba1a('0x29')]({'plain':!![]});var _0x46f348=_0xba1a('0x54');return db[_0xba1a('0x55')][_0xba1a('0x4f')]({'where':{'name':_0x46f348,'userProfileId':_0x5a8714[_0xba1a('0x56')]},'raw':!![]})[_0xba1a('0x27')](function(_0x1b25c9){if(_0x1b25c9&&_0x1b25c9[_0xba1a('0x57')]===0x0){return db[_0xba1a('0x2b')][_0xba1a('0x50')]({'name':_0x37b445[_0xba1a('0x2f')],'resourceId':_0x37b445['id'],'type':_0xba1a('0x2a'),'sectionId':_0x1b25c9['id']},{})[_0xba1a('0x27')](function(){return _0x2947a3;});}else{return _0x2947a3;}})[_0xba1a('0x4b')](function(_0x1c724c){logger[_0xba1a('0x2d')](_0xba1a('0x58'),_0x1c724c);throw _0x1c724c;});}return _0x2947a3;})[_0xba1a('0x27')](respondWithResult(_0x35ec7d,0xc9))[_0xba1a('0x4b')](handleError(_0x35ec7d,null));};exports['update']=function(_0x476883,_0x2c2711){if(_0x476883[_0xba1a('0x59')]['id']){delete _0x476883[_0xba1a('0x59')]['id'];}return db[_0xba1a('0x46')][_0xba1a('0x4f')]({'where':{'id':_0x476883['params']['id']}})[_0xba1a('0x27')](handleEntityNotFound(_0x2c2711,null))[_0xba1a('0x27')](saveUpdates(_0x476883[_0xba1a('0x59')],null))[_0xba1a('0x27')](respondWithResult(_0x2c2711,null))[_0xba1a('0x4b')](handleError(_0x2c2711,null));};exports['destroy']=function(_0x42e1ec,_0x537336){return db['AnalyticCustomReport']['find']({'where':{'id':_0x42e1ec[_0xba1a('0x4d')]['id']}})[_0xba1a('0x27')](handleEntityNotFound(_0x537336,null))[_0xba1a('0x27')](removeEntity(_0x537336,null))[_0xba1a('0x4b')](handleError(_0x537336,null));};exports['preview']=function(_0x3381c3,_0x5e1303){var _0x46872e=0xa;var _0x152316=[_0xba1a('0x5a'),_0xba1a('0x5b'),_0xba1a('0x5c'),_0xba1a('0x5d')];var _0x1e6d48={'SUM':_0xba1a('0x5e'),'COUNT':_0xba1a('0x5f'),'COUNT DISTINCT':_0xba1a('0x60'),'MAX':_0xba1a('0x61'),'MIN':'MIN(%s)','AVG':_0xba1a('0x62'),'GROUP_CONCAT':_0xba1a('0x63'),'GROUP_CONCAT ASC':_0xba1a('0x64'),'GROUP_CONCAT DESC':_0xba1a('0x65')};var _0x560747={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xba1a('0x66'),'HOUR':_0xba1a('0x67'),'ROUND':_0xba1a('0x68'),'UNIX_TIMESTAMP':_0xba1a('0x69')};var _0x416ab6=function(_0x2d2d83){return!_[_0xba1a('0x6a')](['IS\x20NULL',_0xba1a('0x6b'),_0xba1a('0x6c'),_0xba1a('0x6d')],_0x2d2d83);};var _0xb84e9a=function(_0x16e0d0){if(!_0x16e0d0||!_0x16e0d0[_0xba1a('0x6e')]['length']){return'';}for(var _0x39fefb='(',_0x4d828b=0x0;_0x4d828b<_0x16e0d0['rules'][_0xba1a('0x3d')];_0x4d828b+=0x1){_0x4d828b>0x0&&(_0x39fefb+='\x20'+_0x16e0d0[_0xba1a('0x6f')]+'\x20');_0x39fefb+=_0x16e0d0['rules'][_0x4d828b][_0xba1a('0x70')]?_0xb84e9a(_0x16e0d0['rules'][_0x4d828b][_0xba1a('0x70')]):_0x16e0d0[_0xba1a('0x6e')][_0x4d828b][_0xba1a('0x71')]+'\x20'+_0x16e0d0[_0xba1a('0x6e')][_0x4d828b][_0xba1a('0x72')]+(_0x416ab6(_0x16e0d0[_0xba1a('0x6e')][_0x4d828b][_0xba1a('0x72')])?'\x20'+_0x16e0d0[_0xba1a('0x6e')][_0x4d828b]['value']:'');}return _0x39fefb+')';};var _0xb8c40b={'where':{'id':_0x3381c3[_0xba1a('0x4d')]['id']}},_0x101067,_0x17d3da,_0x583d30,_0xdc43cd,_0x513d64;_0xb8c40b=_[_0xba1a('0x44')]({},_0xb8c40b,_0x3381c3['options']);return db[_0xba1a('0x46')][_0xba1a('0x4f')](_0xb8c40b)[_0xba1a('0x27')](function(_0x38f1f1){if(_0x38f1f1){_0x101067=_0x38f1f1;return _0x38f1f1[_0xba1a('0x73')]();}return null;})[_0xba1a('0x27')](function(_0x3a64f3){if(_0x3a64f3){if(!_0x3a64f3[_0xba1a('0x3d')]){throw new db[(_0xba1a('0x74'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x17d3da=_0x3a64f3;return db['AnalyticMetric'][_0xba1a('0x49')]({'raw':!![]});}return null;})[_0xba1a('0x27')](function(_0x4d3961){if(_0x4d3961){_0x583d30=_[_0xba1a('0x75')](_0x4d3961,'id');var _0x26c815;var _0x406a05=squel[_0xba1a('0x76')]();_0x406a05[_0xba1a('0x77')](_0x101067[_0xba1a('0x78')]);for(var _0x346237=0x0;_0x346237<_0x17d3da[_0xba1a('0x3d')];_0x346237+=0x1){_0x26c815=_0x17d3da[_0x346237][_0xba1a('0x79')]?_0x583d30[_0x17d3da[_0x346237]['MetricId']][_0xba1a('0x7a')]:_0x17d3da[_0x346237][_0xba1a('0x71')];_0x26c815=_0x17d3da[_0x346237]['function']?_['replace'](_0x1e6d48[_0x17d3da[_0x346237][_0xba1a('0x7b')]],'%s',_0x26c815):_0x26c815;_0x26c815=_0x17d3da[_0x346237][_0xba1a('0x7c')]?_[_0xba1a('0x7d')](_0x560747[_0x17d3da[_0x346237][_0xba1a('0x7c')]],'%s',_0x26c815):_0x26c815;if(_0x17d3da[_0x346237][_0xba1a('0x7e')]){_0x406a05[_0xba1a('0x70')](_0x26c815);}_0x17d3da[_0x346237]['orderBy']&&_0x406a05['order'](_0x26c815,_0x17d3da[_0x346237][_0xba1a('0x7f')]===_0xba1a('0x80')?![]:!![]);_0x406a05['field'](_0x26c815,_0x17d3da[_0x346237][_0xba1a('0x81')]||_0x26c815);}if(_0x101067[_0xba1a('0x82')]){_0x101067[_0xba1a('0x82')]=JSON['parse'](_0x101067['joins']);for(var _0x508a50=0x0;_0x508a50<_0x101067[_0xba1a('0x82')][_0xba1a('0x3d')];_0x508a50+=0x1){if(_0x101067[_0xba1a('0x82')][_0x508a50][_0xba1a('0x35')]&&_[_0xba1a('0x6a')](_0x152316,_0x101067[_0xba1a('0x82')][_0x508a50]['type'])&&_0x101067[_0xba1a('0x82')][_0x508a50][_0xba1a('0x83')]&&_0x101067[_0xba1a('0x82')][_0x508a50][_0xba1a('0x84')]&&_0x101067[_0xba1a('0x82')][_0x508a50][_0xba1a('0x85')]){_0x406a05[_0x101067[_0xba1a('0x82')][_0x508a50][_0xba1a('0x35')]](_0x101067[_0xba1a('0x82')][_0x508a50][_0xba1a('0x84')],null,util[_0xba1a('0x7c')](_0xba1a('0x86'),_0x101067[_0xba1a('0x78')],_0x101067[_0xba1a('0x82')][_0x508a50][_0xba1a('0x83')],_0x101067['joins'][_0x508a50][_0xba1a('0x84')],_0x101067[_0xba1a('0x82')][_0x508a50]['foreignKey']));}}}if(_0x101067[_0xba1a('0x87')]){_0x101067[_0xba1a('0x87')]=JSON[_0xba1a('0x88')](_0x101067[_0xba1a('0x87')]);_0x406a05[_0xba1a('0x40')](_0xb84e9a(_0x101067['conditions']['group']));}_0x513d64=_0x406a05[_0xba1a('0x89')]();_0x406a05[_0xba1a('0x20')](_0x46872e);_0x406a05[_0xba1a('0x1e')](0x0);logger[_0xba1a('0x8a')]('Limited\x20Query:',_0x406a05['toString']());return dbH[_0xba1a('0x8b')][_0xba1a('0x38')](_0x406a05[_0xba1a('0x8c')](),{'type':dbH[_0xba1a('0x8b')][_0xba1a('0x8d')][_0xba1a('0x8e')]});}})['then'](respondWithResult(_0x5e1303,null))[_0xba1a('0x4b')](handleError(_0x5e1303,null));};function runReport(_0xb11ada,_0x360e74,_0x5b358a){var _0x25dfa2=_0x360e74[_0xba1a('0x2f')];var _0x3f7500=0xa;var _0x4403e2=['join',_0xba1a('0x5b'),_0xba1a('0x5c'),_0xba1a('0x5d')];var _0x5c1b4c={'SUM':_0xba1a('0x5e'),'COUNT':_0xba1a('0x5f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xba1a('0x61'),'MIN':'MIN(%s)','AVG':_0xba1a('0x62'),'GROUP_CONCAT':_0xba1a('0x63'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x41dab7={'SEC_TO_TIME':_0xba1a('0x8f'),'DATE':_0xba1a('0x66'),'HOUR':_0xba1a('0x67'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xba1a('0x69')};var _0x10195f=function(_0x37b3ae){return!_[_0xba1a('0x6a')]([_0xba1a('0x90'),_0xba1a('0x6b'),_0xba1a('0x6c'),'IS\x20NOT\x20EMPTY'],_0x37b3ae);};var _0xcd9b99=function(_0x52707f){if(!_0x52707f||!_0x52707f[_0xba1a('0x6e')][_0xba1a('0x3d')]){return'';}for(var _0x50eece='(',_0x3861d1=0x0;_0x3861d1<_0x52707f[_0xba1a('0x6e')][_0xba1a('0x3d')];_0x3861d1+=0x1){_0x3861d1>0x0&&(_0x50eece+='\x20'+_0x52707f[_0xba1a('0x6f')]+'\x20');_0x50eece+=_0x52707f[_0xba1a('0x6e')][_0x3861d1][_0xba1a('0x70')]?_0xcd9b99(_0x52707f['rules'][_0x3861d1][_0xba1a('0x70')]):_0x52707f['rules'][_0x3861d1][_0xba1a('0x71')]+'\x20'+_0x52707f[_0xba1a('0x6e')][_0x3861d1][_0xba1a('0x72')]+(_0x10195f(_0x52707f[_0xba1a('0x6e')][_0x3861d1][_0xba1a('0x72')])?'\x20'+_0x52707f[_0xba1a('0x6e')][_0x3861d1][_0xba1a('0x91')]:'');}return _0x50eece+')';};var _0x308d9d={'where':{'id':_0xb11ada['id']}},_0x4e92d1,_0x32bd94,_0x14a028,_0x20fe59,_0x20ad83;_0x308d9d=_[_0xba1a('0x44')]({},_0x308d9d,_0x5b358a);return db[_0xba1a('0x46')][_0xba1a('0x4f')](_0x308d9d)[_0xba1a('0x27')](function(_0x47f484){if(_0x47f484){_0x4e92d1=_0x47f484;return _0x47f484[_0xba1a('0x73')]();}return null;})[_0xba1a('0x27')](function(_0x5cf1db){if(_0x5cf1db){if(!_0x5cf1db['length']){throw new db[(_0xba1a('0x74'))][(_0xba1a('0x92'))](_0xba1a('0x93'),0x193);}_0x32bd94=_0x5cf1db;return db[_0xba1a('0x94')][_0xba1a('0x49')]({'raw':!![]});}return null;})[_0xba1a('0x27')](function(_0x14c0f0){if(_0x14c0f0){_0x14a028=_[_0xba1a('0x75')](_0x14c0f0,'id');var _0x362540;var _0x2bbef2=squel[_0xba1a('0x76')]();_0x2bbef2[_0xba1a('0x77')](_0x4e92d1[_0xba1a('0x78')]);for(var _0x2736ba=0x0;_0x2736ba<_0x32bd94['length'];_0x2736ba+=0x1){_0x362540=_0x32bd94[_0x2736ba][_0xba1a('0x79')]?_0x14a028[_0x32bd94[_0x2736ba][_0xba1a('0x79')]]['metric']:_0x32bd94[_0x2736ba]['field'];_0x362540=_0x32bd94[_0x2736ba][_0xba1a('0x7b')]?_['replace'](_0x5c1b4c[_0x32bd94[_0x2736ba][_0xba1a('0x7b')]],'%s',_0x362540):_0x362540;_0x362540=_0x32bd94[_0x2736ba]['format']?_['replace'](_0x41dab7[_0x32bd94[_0x2736ba][_0xba1a('0x7c')]],'%s',_0x362540):_0x362540;if(_0x32bd94[_0x2736ba][_0xba1a('0x7e')]){_0x2bbef2[_0xba1a('0x70')](_0x362540);}_0x32bd94[_0x2736ba][_0xba1a('0x7f')]&&_0x2bbef2[_0xba1a('0x3e')](_0x362540,_0x32bd94[_0x2736ba][_0xba1a('0x7f')]===_0xba1a('0x80')?![]:!![]);_0x2bbef2[_0xba1a('0x71')](_0x362540,_0x32bd94[_0x2736ba][_0xba1a('0x81')]||_0x362540);}if(_0x4e92d1['joins']){_0x4e92d1['joins']=JSON[_0xba1a('0x88')](_0x4e92d1[_0xba1a('0x82')]);for(var _0x43141f=0x0;_0x43141f<_0x4e92d1['joins'][_0xba1a('0x3d')];_0x43141f+=0x1){if(_0x4e92d1[_0xba1a('0x82')][_0x43141f][_0xba1a('0x35')]&&_[_0xba1a('0x6a')](_0x4403e2,_0x4e92d1[_0xba1a('0x82')][_0x43141f][_0xba1a('0x35')])&&_0x4e92d1[_0xba1a('0x82')][_0x43141f][_0xba1a('0x83')]&&_0x4e92d1[_0xba1a('0x82')][_0x43141f][_0xba1a('0x84')]&&_0x4e92d1[_0xba1a('0x82')][_0x43141f][_0xba1a('0x85')]){_0x2bbef2[_0x4e92d1[_0xba1a('0x82')][_0x43141f][_0xba1a('0x35')]](_0x4e92d1[_0xba1a('0x82')][_0x43141f][_0xba1a('0x84')],null,util[_0xba1a('0x7c')](_0xba1a('0x86'),_0x4e92d1[_0xba1a('0x78')],_0x4e92d1['joins'][_0x43141f]['parentKey'],_0x4e92d1['joins'][_0x43141f][_0xba1a('0x84')],_0x4e92d1['joins'][_0x43141f][_0xba1a('0x85')]));}}}if(_0x4e92d1[_0xba1a('0x87')]){_0x4e92d1['conditions']=JSON[_0xba1a('0x88')](_0x4e92d1[_0xba1a('0x87')]);_0x2bbef2[_0xba1a('0x40')](_0xcd9b99(_0x4e92d1[_0xba1a('0x87')][_0xba1a('0x70')]));}_0x20ad83=_0x2bbef2[_0xba1a('0x89')]();_0x2bbef2[_0xba1a('0x20')](_0x3f7500);_0x2bbef2[_0xba1a('0x1e')](0x0);return;}})[_0xba1a('0x27')](function(){if(_0x360e74['output']===_0xba1a('0x95')){return null;}var _0x5cad85=_[_0xba1a('0x44')](_0x360e74,{'name':_0x360e74[_0xba1a('0x96')]||_0x360e74[_0xba1a('0x2f')]||_0x4e92d1[_0xba1a('0x2f')],'basename':_0x25dfa2,'savename':util[_0xba1a('0x7c')](_0xba1a('0x97'),_0x360e74[_0xba1a('0x2f')]||_0x4e92d1[_0xba1a('0x2f')],require('randomstring')[_0xba1a('0x98')](0x4),_0x360e74[_0xba1a('0x99')]||_0xba1a('0x9a')),'reportId':_0x4e92d1['id'],'reportType':_0xba1a('0x9b')});return db['AnalyticExtractedReport']['create'](_0x5cad85,{'raw':!![]});})[_0xba1a('0x27')](function(_0x4f215e){if(_0x4e92d1[_0xba1a('0x78')]===_0xba1a('0x9c')){_0x20ad83[_0xba1a('0x40')](_0x4e92d1[_0xba1a('0x78')]+_0xba1a('0x9d'),_0x360e74[_0xba1a('0x9e')],_0x360e74[_0xba1a('0x9f')]);}else{_0x20ad83['where'](_0x4e92d1['table']+_0xba1a('0xa0'),_0x360e74[_0xba1a('0x9e')],_0x360e74[_0xba1a('0x9f')]);}if(_0x4f215e){logger[_0xba1a('0xa1')](_0xba1a('0xa2'),_0x20ad83[_0xba1a('0x8c')]());require(_0xba1a('0xa3'))[_0xba1a('0xa4')](path[_0xba1a('0x5a')](__dirname,'../../components/export/',_0x4f215e['output']),[_0x4f215e['id'],_0x20ad83['toString'](),path[_0xba1a('0x5a')](__dirname,_0xba1a('0xa5'),_0x4f215e[_0xba1a('0xa6')]),_0x25dfa2]);return _0x4f215e;}else{var _0x47891b=squel[_0xba1a('0x76')]();_0x47891b[_0xba1a('0x77')]('('+_0x20ad83[_0xba1a('0x8c')]()+')',_0xba1a('0xa7'));_0x47891b['field'](_0xba1a('0xa8'),_0xba1a('0x21'));_0x20ad83['limit'](_0x360e74['limit']||_0x3f7500);_0x20ad83[_0xba1a('0x1e')](_0x360e74[_0xba1a('0x1e')]||0x0);return dbH['sequelize'][_0xba1a('0x38')](_0x47891b[_0xba1a('0x8c')](),{'type':dbH[_0xba1a('0x8b')][_0xba1a('0x8d')][_0xba1a('0x8e')]})[_0xba1a('0x27')](function(_0x17f333){if(!_0x17f333['length']){_0x20fe59=0x0;}else{_0x20fe59=_0x17f333[0x0][_0xba1a('0x21')]||0x0;}return dbH['sequelize']['query'](_0x20ad83[_0xba1a('0x8c')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0xba1a('0x27')](function(_0x1d6bdf){return{'rows':_0x1d6bdf||[],'count':_0x20fe59};});}});}exports[_0xba1a('0xa9')]=function(_0x5c79cb,_0x1a8e43){return runReport(_0x5c79cb[_0xba1a('0x4d')],_0x5c79cb[_0xba1a('0x38')],_0x5c79cb[_0xba1a('0x45')])[_0xba1a('0x27')](respondWithResult(_0x1a8e43,null))[_0xba1a('0x4b')](handleError(_0x1a8e43,null));};exports['runReport']=runReport;exports[_0xba1a('0x38')]=function(_0x56e673,_0x1a6ef6){var _0x4a4818=0xa;var _0x109552=[_0xba1a('0x5a'),_0xba1a('0x5b'),_0xba1a('0x5c'),_0xba1a('0x5d')];var _0x4c306f={'SUM':'SUM(%s)','COUNT':_0xba1a('0x5f'),'COUNT DISTINCT':_0xba1a('0x60'),'MAX':_0xba1a('0x61'),'MIN':_0xba1a('0xaa'),'AVG':_0xba1a('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xba1a('0x64'),'GROUP_CONCAT DESC':_0xba1a('0x65')};var _0x4b2388={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xba1a('0x66'),'HOUR':_0xba1a('0x67'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2a0cc1=function(_0xf7fa59){return!_[_0xba1a('0x6a')](['IS\x20NULL',_0xba1a('0x6b'),_0xba1a('0x6c'),'IS\x20NOT\x20EMPTY'],_0xf7fa59);};var _0x5a3680=function(_0x5991bc){if(!_0x5991bc||!_0x5991bc[_0xba1a('0x6e')][_0xba1a('0x3d')]){return'';}for(var _0x5e14f4='(',_0x561b93=0x0;_0x561b93<_0x5991bc[_0xba1a('0x6e')][_0xba1a('0x3d')];_0x561b93+=0x1){_0x561b93>0x0&&(_0x5e14f4+='\x20'+_0x5991bc[_0xba1a('0x6f')]+'\x20');_0x5e14f4+=_0x5991bc[_0xba1a('0x6e')][_0x561b93][_0xba1a('0x70')]?_0x5a3680(_0x5991bc[_0xba1a('0x6e')][_0x561b93][_0xba1a('0x70')]):_0x5991bc[_0xba1a('0x6e')][_0x561b93]['field']+'\x20'+_0x5991bc[_0xba1a('0x6e')][_0x561b93][_0xba1a('0x72')]+(_0x2a0cc1(_0x5991bc['rules'][_0x561b93][_0xba1a('0x72')])?'\x20'+_0x5991bc[_0xba1a('0x6e')][_0x561b93][_0xba1a('0x91')]:'');}return _0x5e14f4+')';};var _0x513993={'where':{'id':_0x56e673[_0xba1a('0x4d')]['id']}},_0x54baa4,_0x1aeacf,_0x625f79,_0x3be5b3,_0x4d6524;_0x513993=_['merge']({},_0x513993,_0x56e673[_0xba1a('0x45')]);return db[_0xba1a('0x46')]['find'](_0x513993)[_0xba1a('0x27')](function(_0x57005a){if(_0x57005a){_0x54baa4=_0x57005a;return _0x57005a['getFields']();}return null;})['then'](function(_0x180293){if(_0x180293){if(!_0x180293[_0xba1a('0x3d')]){throw new db['Sequelize'][(_0xba1a('0x92'))](_0xba1a('0x93'),0x193);}_0x1aeacf=_0x180293;return db['AnalyticMetric'][_0xba1a('0x49')]({'raw':!![]});}return null;})[_0xba1a('0x27')](function(_0x1768e7){if(_0x1768e7){_0x625f79=_[_0xba1a('0x75')](_0x1768e7,'id');var _0x313bf4;var _0x24d330=squel[_0xba1a('0x76')]();_0x24d330[_0xba1a('0x77')](_0x54baa4['table']);for(var _0x17d743=0x0;_0x17d743<_0x1aeacf[_0xba1a('0x3d')];_0x17d743+=0x1){_0x313bf4=_0x1aeacf[_0x17d743][_0xba1a('0x79')]?_0x625f79[_0x1aeacf[_0x17d743][_0xba1a('0x79')]]['metric']:_0x1aeacf[_0x17d743]['field'];_0x313bf4=_0x1aeacf[_0x17d743][_0xba1a('0x7b')]?_[_0xba1a('0x7d')](_0x4c306f[_0x1aeacf[_0x17d743]['function']],'%s',_0x313bf4):_0x313bf4;_0x313bf4=_0x1aeacf[_0x17d743][_0xba1a('0x7c')]?_[_0xba1a('0x7d')](_0x4b2388[_0x1aeacf[_0x17d743]['format']],'%s',_0x313bf4):_0x313bf4;if(_0x1aeacf[_0x17d743][_0xba1a('0x7e')]){_0x24d330['group'](_0x313bf4);}_0x1aeacf[_0x17d743][_0xba1a('0x7f')]&&_0x24d330['order'](_0x313bf4,_0x1aeacf[_0x17d743][_0xba1a('0x7f')]===_0xba1a('0x80')?![]:!![]);_0x24d330['field'](_0x313bf4,_0x1aeacf[_0x17d743][_0xba1a('0x81')]||_0x313bf4);}if(_0x54baa4[_0xba1a('0x82')]){_0x54baa4['joins']=JSON['parse'](_0x54baa4[_0xba1a('0x82')]);for(var _0x2ee27f=0x0;_0x2ee27f<_0x54baa4[_0xba1a('0x82')][_0xba1a('0x3d')];_0x2ee27f+=0x1){if(_0x54baa4[_0xba1a('0x82')][_0x2ee27f][_0xba1a('0x35')]&&_[_0xba1a('0x6a')](_0x109552,_0x54baa4[_0xba1a('0x82')][_0x2ee27f][_0xba1a('0x35')])&&_0x54baa4[_0xba1a('0x82')][_0x2ee27f][_0xba1a('0x83')]&&_0x54baa4[_0xba1a('0x82')][_0x2ee27f][_0xba1a('0x84')]&&_0x54baa4[_0xba1a('0x82')][_0x2ee27f]['foreignKey']){_0x24d330[_0x54baa4[_0xba1a('0x82')][_0x2ee27f][_0xba1a('0x35')]](_0x54baa4[_0xba1a('0x82')][_0x2ee27f]['foreignTable'],null,util[_0xba1a('0x7c')]('%s.%s\x20=\x20%s.%s',_0x54baa4['table'],_0x54baa4[_0xba1a('0x82')][_0x2ee27f][_0xba1a('0x83')],_0x54baa4[_0xba1a('0x82')][_0x2ee27f][_0xba1a('0x84')],_0x54baa4['joins'][_0x2ee27f][_0xba1a('0x85')]));}}}if(_0x54baa4['conditions']){_0x54baa4[_0xba1a('0x87')]=JSON[_0xba1a('0x88')](_0x54baa4['conditions']);_0x24d330[_0xba1a('0x40')](_0x5a3680(_0x54baa4[_0xba1a('0x87')][_0xba1a('0x70')]));}_0x4d6524=_0x24d330[_0xba1a('0x89')]();_0x24d330[_0xba1a('0x20')](_0x4a4818);_0x24d330[_0xba1a('0x1e')](0x0);logger['debug'](_0xba1a('0xab'),_0x24d330[_0xba1a('0x8c')]());return dbH[_0xba1a('0x8b')][_0xba1a('0x38')](_0x24d330[_0xba1a('0x8c')](),{'type':dbH[_0xba1a('0x8b')][_0xba1a('0x8d')][_0xba1a('0x8e')]});}})['then'](function(){return{'sql':_0x4d6524[_0xba1a('0x8c')]()};})['then'](respondWithResult(_0x1a6ef6,null))[_0xba1a('0x4b')](handleError(_0x1a6ef6,null));};
\ No newline at end of file
+var _0x0603=['undefined','offset','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','error','stack','name','index','map','AnalyticCustomReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','count','includeAll','findAll','catch','show','rawAttributes','create','body','user','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','update','find','params','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','condition','options','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','clone','limit','debug','toString','sequelize','SELECT','join','DATE(%s)','IS\x20NOT\x20EMPTY','operator','value','Sequelize','DESC','parentKey','output','web','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../files/reports','savename','QueryTypes','run','runReport','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0xf5d71c,_0x2613a6){var _0x5af672=function(_0x191f52){while(--_0x191f52){_0xf5d71c['push'](_0xf5d71c['shift']());}};_0x5af672(++_0x2613a6);}(_0x0603,0x1cb));var _0x3060=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x0603[_0xa148b7];return _0x51efd3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3060('0x0'));var zipdir=require(_0x3060('0x1'));var jsonpatch=require(_0x3060('0x2'));var rp=require('request-promise');var moment=require(_0x3060('0x3'));var BPromise=require(_0x3060('0x4'));var Mustache=require(_0x3060('0x5'));var util=require(_0x3060('0x6'));var path=require(_0x3060('0x7'));var sox=require(_0x3060('0x8'));var csv=require(_0x3060('0x9'));var ejs=require(_0x3060('0xa'));var fs=require('fs');var fs_extra=require(_0x3060('0xb'));var _=require('lodash');var squel=require(_0x3060('0xc'));var crypto=require(_0x3060('0xd'));var jsforce=require(_0x3060('0xe'));var deskjs=require(_0x3060('0xf'));var toCsv=require(_0x3060('0x9'));var querystring=require(_0x3060('0x10'));var Papa=require(_0x3060('0x11'));var Redis=require(_0x3060('0x12'));var authService=require(_0x3060('0x13'));var qs=require(_0x3060('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3060('0x15'));var utils=require(_0x3060('0x16'));var config=require(_0x3060('0x17'));var licenseUtil=require(_0x3060('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x3060('0x19'))['dbH'];function respondWithStatusCode(_0x1b0b23,_0x3cee17){_0x3cee17=_0x3cee17||0xcc;return function(_0x4ce1c3){if(_0x4ce1c3){return _0x1b0b23[_0x3060('0x1a')](_0x3cee17);}return _0x1b0b23[_0x3060('0x1b')](_0x3cee17)[_0x3060('0x1c')]();};}function respondWithResult(_0x3911ca,_0x951062){_0x951062=_0x951062||0xc8;return function(_0x356bcf){if(_0x356bcf){return _0x3911ca['status'](_0x951062)[_0x3060('0x1d')](_0x356bcf);}};}function respondWithFilteredResult(_0x60daa4,_0x5be196){return function(_0x1f0311){if(_0x1f0311){var _0x5ee358=typeof _0x5be196['offset']===_0x3060('0x1e')&&typeof _0x5be196['limit']===_0x3060('0x1e');var _0x30f308=_0x1f0311['count'];var _0x3eb387=_0x5ee358?0x0:_0x5be196[_0x3060('0x1f')];var _0xbd463b=_0x5ee358?_0x1f0311['count']:_0x5be196[_0x3060('0x1f')]+_0x5be196['limit'];var _0x1006aa;if(_0xbd463b>=_0x30f308){_0xbd463b=_0x30f308;_0x1006aa=0xc8;}else{_0x1006aa=0xce;}_0x60daa4[_0x3060('0x1b')](_0x1006aa);return _0x60daa4['set'](_0x3060('0x20'),_0x3eb387+'-'+_0xbd463b+'/'+_0x30f308)['json'](_0x1f0311);}return null;};}function patchUpdates(_0x38c65d){return function(_0x4e640a){try{jsonpatch[_0x3060('0x21')](_0x4e640a,_0x38c65d,!![]);}catch(_0x43de69){return BPromise[_0x3060('0x22')](_0x43de69);}return _0x4e640a[_0x3060('0x23')]();};}function saveUpdates(_0x5d6b37,_0x5eba9b){return function(_0x270a3b){if(_0x270a3b){return _0x270a3b['update'](_0x5d6b37)[_0x3060('0x24')](function(_0x414d60){return _0x414d60;});}return null;};}function removeEntity(_0x2f56e4,_0x39aa77){return function(_0x15b829){if(_0x15b829){return _0x15b829['destroy']()['then'](function(){var _0x28b195=_0x15b829[_0x3060('0x25')]({'plain':!![]});var _0x22a637='CustomReports';return db[_0x3060('0x26')][_0x3060('0x27')]({'where':{'type':_0x22a637,'resourceId':_0x28b195['id']}})['then'](function(){return _0x15b829;});})[_0x3060('0x24')](function(){_0x2f56e4[_0x3060('0x1b')](0xcc)[_0x3060('0x1c')]();});}};}function handleEntityNotFound(_0x552e38,_0xb5b40f){return function(_0x5e8483){if(!_0x5e8483){_0x552e38[_0x3060('0x1a')](0x194);}return _0x5e8483;};}function handleError(_0xb05d3,_0x2999e4){_0x2999e4=_0x2999e4||0x1f4;return function(_0x7e792f){logger[_0x3060('0x28')](_0x7e792f[_0x3060('0x29')]);if(_0x7e792f[_0x3060('0x2a')]){delete _0x7e792f[_0x3060('0x2a')];}_0xb05d3[_0x3060('0x1b')](_0x2999e4)['send'](_0x7e792f);};}exports[_0x3060('0x2b')]=function(_0x2f456c,_0x3cdb1c){var _0x472d72={},_0x331d63={},_0x3b61cc={'count':0x0,'rows':[]};var _0x158b19=_[_0x3060('0x2c')](db[_0x3060('0x2d')]['rawAttributes'],function(_0x382078){return{'name':_0x382078[_0x3060('0x2e')],'type':_0x382078[_0x3060('0x2f')][_0x3060('0x30')]};});_0x331d63[_0x3060('0x31')]=_[_0x3060('0x2c')](_0x158b19,'name');_0x331d63[_0x3060('0x32')]=_[_0x3060('0x33')](_0x2f456c[_0x3060('0x32')]);_0x331d63[_0x3060('0x34')]=_[_0x3060('0x35')](_0x331d63['model'],_0x331d63['query']);_0x472d72[_0x3060('0x36')]=_[_0x3060('0x35')](_0x331d63[_0x3060('0x31')],qs[_0x3060('0x37')](_0x2f456c[_0x3060('0x32')][_0x3060('0x37')]));_0x472d72['attributes']=_0x472d72[_0x3060('0x36')][_0x3060('0x38')]?_0x472d72[_0x3060('0x36')]:_0x331d63[_0x3060('0x31')];if(!_0x2f456c[_0x3060('0x32')][_0x3060('0x39')]('nolimit')){_0x472d72['limit']=qs['limit'](_0x2f456c[_0x3060('0x32')]['limit']);_0x472d72[_0x3060('0x1f')]=qs[_0x3060('0x1f')](_0x2f456c[_0x3060('0x32')][_0x3060('0x1f')]);}_0x472d72[_0x3060('0x3a')]=qs[_0x3060('0x3b')](_0x2f456c[_0x3060('0x32')][_0x3060('0x3b')]);_0x472d72[_0x3060('0x3c')]=qs[_0x3060('0x34')](_['pick'](_0x2f456c[_0x3060('0x32')],_0x331d63[_0x3060('0x34')]),_0x158b19);if(_0x2f456c[_0x3060('0x32')][_0x3060('0x3d')]){_0x472d72[_0x3060('0x3c')]=_[_0x3060('0x3e')](_0x472d72[_0x3060('0x3c')],{'$or':_[_0x3060('0x2c')](_0x158b19,function(_0x4c202e){if(_0x4c202e[_0x3060('0x2f')]!==_0x3060('0x3f')){var _0x378dc8={};_0x378dc8[_0x4c202e[_0x3060('0x2a')]]={'$like':'%'+_0x2f456c[_0x3060('0x32')]['filter']+'%'};return _0x378dc8;}})});}_0x472d72=_[_0x3060('0x3e')]({},_0x472d72,_0x2f456c['options']);var _0x4ebdc5={'where':_0x472d72[_0x3060('0x3c')]};return db[_0x3060('0x2d')][_0x3060('0x40')](_0x4ebdc5)['then'](function(_0x13b71d){_0x3b61cc['count']=_0x13b71d;if(_0x2f456c[_0x3060('0x32')][_0x3060('0x41')]){_0x472d72['include']=[{'all':!![]}];}return db[_0x3060('0x2d')][_0x3060('0x42')](_0x472d72);})[_0x3060('0x24')](function(_0x79e373){_0x3b61cc['rows']=_0x79e373;return _0x3b61cc;})[_0x3060('0x24')](respondWithFilteredResult(_0x3cdb1c,_0x472d72))[_0x3060('0x43')](handleError(_0x3cdb1c,null));};exports[_0x3060('0x44')]=function(_0x242dbc,_0x170042){var _0x31909b={'raw':![],'where':{'id':_0x242dbc['params']['id']}},_0x1991a3={};_0x1991a3[_0x3060('0x31')]=_[_0x3060('0x33')](db['AnalyticCustomReport'][_0x3060('0x45')]);_0x1991a3[_0x3060('0x32')]=_[_0x3060('0x33')](_0x242dbc[_0x3060('0x32')]);_0x1991a3[_0x3060('0x34')]=_['intersection'](_0x1991a3[_0x3060('0x31')],_0x1991a3[_0x3060('0x32')]);_0x31909b[_0x3060('0x36')]=_[_0x3060('0x35')](_0x1991a3[_0x3060('0x31')],qs[_0x3060('0x37')](_0x242dbc['query'][_0x3060('0x37')]));_0x31909b[_0x3060('0x36')]=_0x31909b['attributes'][_0x3060('0x38')]?_0x31909b[_0x3060('0x36')]:_0x1991a3['model'];if(_0x242dbc[_0x3060('0x32')]['includeAll']){_0x31909b['include']=[{'all':!![]}];}_0x31909b=_[_0x3060('0x3e')]({},_0x31909b,_0x242dbc['options']);return db['AnalyticCustomReport']['find'](_0x31909b)[_0x3060('0x24')](handleEntityNotFound(_0x170042,null))[_0x3060('0x24')](respondWithResult(_0x170042,null))[_0x3060('0x43')](handleError(_0x170042,null));};exports['create']=function(_0x2c7420,_0x3fd8ee){return db[_0x3060('0x2d')][_0x3060('0x46')](_0x2c7420[_0x3060('0x47')],{})[_0x3060('0x24')](function(_0x1f7d72){var _0x3fc889=_0x2c7420[_0x3060('0x48')][_0x3060('0x25')]({'plain':!![]});if(!_0x3fc889)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3fc889['role']===_0x3060('0x48')){var _0x5967d5=_0x1f7d72[_0x3060('0x25')]({'plain':!![]});var _0x8b295b=_0x3060('0x49');return db[_0x3060('0x4a')]['find']({'where':{'name':_0x8b295b,'userProfileId':_0x3fc889[_0x3060('0x4b')]},'raw':!![]})['then'](function(_0x33efed){if(_0x33efed&&_0x33efed[_0x3060('0x4c')]===0x0){return db['UserProfileResource'][_0x3060('0x46')]({'name':_0x5967d5[_0x3060('0x2a')],'resourceId':_0x5967d5['id'],'type':_0x3060('0x4d'),'sectionId':_0x33efed['id']},{})['then'](function(){return _0x1f7d72;});}else{return _0x1f7d72;}})['catch'](function(_0x4720f2){logger[_0x3060('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4720f2);throw _0x4720f2;});}return _0x1f7d72;})['then'](respondWithResult(_0x3fd8ee,0xc9))[_0x3060('0x43')](handleError(_0x3fd8ee,null));};exports[_0x3060('0x4e')]=function(_0x4b0635,_0x37a57d){if(_0x4b0635[_0x3060('0x47')]['id']){delete _0x4b0635[_0x3060('0x47')]['id'];}return db[_0x3060('0x2d')][_0x3060('0x4f')]({'where':{'id':_0x4b0635['params']['id']}})[_0x3060('0x24')](handleEntityNotFound(_0x37a57d,null))[_0x3060('0x24')](saveUpdates(_0x4b0635[_0x3060('0x47')],null))[_0x3060('0x24')](respondWithResult(_0x37a57d,null))[_0x3060('0x43')](handleError(_0x37a57d,null));};exports['destroy']=function(_0x52e946,_0x3c4659){return db['AnalyticCustomReport']['find']({'where':{'id':_0x52e946[_0x3060('0x50')]['id']}})[_0x3060('0x24')](handleEntityNotFound(_0x3c4659,null))['then'](removeEntity(_0x3c4659,null))[_0x3060('0x43')](handleError(_0x3c4659,null));};exports[_0x3060('0x51')]=function(_0x358037,_0x5c9c12){var _0x5120cd=0xa;var _0x1524e2=['join',_0x3060('0x52'),_0x3060('0x53'),_0x3060('0x54')];var _0x5f08c2={'SUM':_0x3060('0x55'),'COUNT':_0x3060('0x56'),'COUNT DISTINCT':_0x3060('0x57'),'MAX':_0x3060('0x58'),'MIN':_0x3060('0x59'),'AVG':_0x3060('0x5a'),'GROUP_CONCAT':_0x3060('0x5b'),'GROUP_CONCAT ASC':_0x3060('0x5c'),'GROUP_CONCAT DESC':_0x3060('0x5d')};var _0x10fa68={'SEC_TO_TIME':_0x3060('0x5e'),'DATE':'DATE(%s)','HOUR':_0x3060('0x5f'),'ROUND':_0x3060('0x60'),'UNIX_TIMESTAMP':_0x3060('0x61')};var _0x5a7b3a=function(_0x2129ab){return!_[_0x3060('0x62')]([_0x3060('0x63'),_0x3060('0x64'),_0x3060('0x65'),'IS\x20NOT\x20EMPTY'],_0x2129ab);};var _0x40e6b4=function(_0x49222b){if(!_0x49222b||!_0x49222b['rules'][_0x3060('0x38')]){return'';}for(var _0xa1bd0='(',_0x454552=0x0;_0x454552<_0x49222b[_0x3060('0x66')][_0x3060('0x38')];_0x454552+=0x1){_0x454552>0x0&&(_0xa1bd0+='\x20'+_0x49222b['operator']+'\x20');_0xa1bd0+=_0x49222b[_0x3060('0x66')][_0x454552]['group']?_0x40e6b4(_0x49222b['rules'][_0x454552][_0x3060('0x67')]):_0x49222b['rules'][_0x454552][_0x3060('0x68')]+'\x20'+_0x49222b[_0x3060('0x66')][_0x454552][_0x3060('0x69')]+(_0x5a7b3a(_0x49222b[_0x3060('0x66')][_0x454552]['condition'])?'\x20'+_0x49222b[_0x3060('0x66')][_0x454552]['value']:'');}return _0xa1bd0+')';};var _0x5d0e28={'where':{'id':_0x358037[_0x3060('0x50')]['id']}},_0x1b9b71,_0x30da1d,_0x4d85c5,_0x4df653,_0xd00efe;_0x5d0e28=_['merge']({},_0x5d0e28,_0x358037[_0x3060('0x6a')]);return db['AnalyticCustomReport'][_0x3060('0x4f')](_0x5d0e28)[_0x3060('0x24')](function(_0x44a634){if(_0x44a634){_0x1b9b71=_0x44a634;return _0x44a634[_0x3060('0x6b')]();}return null;})['then'](function(_0x2b0ec2){if(_0x2b0ec2){if(!_0x2b0ec2[_0x3060('0x38')]){throw new db['Sequelize'][(_0x3060('0x6c'))](_0x3060('0x6d'),0x193);}_0x30da1d=_0x2b0ec2;return db[_0x3060('0x6e')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x29a7b5){if(_0x29a7b5){_0x4d85c5=_[_0x3060('0x6f')](_0x29a7b5,'id');var _0x1f3583;var _0x2178ec=squel[_0x3060('0x70')]();_0x2178ec[_0x3060('0x71')](_0x1b9b71['table']);for(var _0x1e210c=0x0;_0x1e210c<_0x30da1d[_0x3060('0x38')];_0x1e210c+=0x1){_0x1f3583=_0x30da1d[_0x1e210c][_0x3060('0x72')]?_0x4d85c5[_0x30da1d[_0x1e210c][_0x3060('0x72')]][_0x3060('0x73')]:_0x30da1d[_0x1e210c][_0x3060('0x68')];_0x1f3583=_0x30da1d[_0x1e210c][_0x3060('0x74')]?_[_0x3060('0x75')](_0x5f08c2[_0x30da1d[_0x1e210c][_0x3060('0x74')]],'%s',_0x1f3583):_0x1f3583;_0x1f3583=_0x30da1d[_0x1e210c][_0x3060('0x76')]?_[_0x3060('0x75')](_0x10fa68[_0x30da1d[_0x1e210c][_0x3060('0x76')]],'%s',_0x1f3583):_0x1f3583;if(_0x30da1d[_0x1e210c][_0x3060('0x77')]){_0x2178ec[_0x3060('0x67')](_0x1f3583);}_0x30da1d[_0x1e210c]['orderBy']&&_0x2178ec[_0x3060('0x3a')](_0x1f3583,_0x30da1d[_0x1e210c][_0x3060('0x78')]==='DESC'?![]:!![]);_0x2178ec[_0x3060('0x68')](_0x1f3583,_0x30da1d[_0x1e210c][_0x3060('0x79')]||_0x1f3583);}if(_0x1b9b71[_0x3060('0x7a')]){_0x1b9b71[_0x3060('0x7a')]=JSON[_0x3060('0x7b')](_0x1b9b71['joins']);for(var _0x45e584=0x0;_0x45e584<_0x1b9b71[_0x3060('0x7a')]['length'];_0x45e584+=0x1){if(_0x1b9b71[_0x3060('0x7a')][_0x45e584]['type']&&_[_0x3060('0x62')](_0x1524e2,_0x1b9b71[_0x3060('0x7a')][_0x45e584][_0x3060('0x2f')])&&_0x1b9b71['joins'][_0x45e584]['parentKey']&&_0x1b9b71[_0x3060('0x7a')][_0x45e584]['foreignTable']&&_0x1b9b71[_0x3060('0x7a')][_0x45e584]['foreignKey']){_0x2178ec[_0x1b9b71[_0x3060('0x7a')][_0x45e584]['type']](_0x1b9b71['joins'][_0x45e584][_0x3060('0x7c')],null,util[_0x3060('0x76')](_0x3060('0x7d'),_0x1b9b71[_0x3060('0x7e')],_0x1b9b71[_0x3060('0x7a')][_0x45e584]['parentKey'],_0x1b9b71[_0x3060('0x7a')][_0x45e584][_0x3060('0x7c')],_0x1b9b71[_0x3060('0x7a')][_0x45e584][_0x3060('0x7f')]));}}}if(_0x1b9b71[_0x3060('0x80')]){_0x1b9b71[_0x3060('0x80')]=JSON[_0x3060('0x7b')](_0x1b9b71['conditions']);_0x2178ec['where'](_0x40e6b4(_0x1b9b71[_0x3060('0x80')][_0x3060('0x67')]));}_0xd00efe=_0x2178ec[_0x3060('0x81')]();_0x2178ec[_0x3060('0x82')](_0x5120cd);_0x2178ec[_0x3060('0x1f')](0x0);logger[_0x3060('0x83')]('Limited\x20Query:',_0x2178ec[_0x3060('0x84')]());return dbH[_0x3060('0x85')][_0x3060('0x32')](_0x2178ec[_0x3060('0x84')](),{'type':dbH[_0x3060('0x85')]['QueryTypes'][_0x3060('0x86')]});}})[_0x3060('0x24')](respondWithResult(_0x5c9c12,null))['catch'](handleError(_0x5c9c12,null));};function runReport(_0x32d30e,_0x3a3feb,_0x35a122){var _0x589e6b=_0x3a3feb[_0x3060('0x2a')];var _0xd53265=0xa;var _0x486e19=[_0x3060('0x87'),'left_join',_0x3060('0x53'),'cross_join'];var _0x5f5d78={'SUM':_0x3060('0x55'),'COUNT':_0x3060('0x56'),'COUNT DISTINCT':_0x3060('0x57'),'MAX':_0x3060('0x58'),'MIN':_0x3060('0x59'),'AVG':_0x3060('0x5a'),'GROUP_CONCAT':_0x3060('0x5b'),'GROUP_CONCAT ASC':_0x3060('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x30245d={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x3060('0x88'),'HOUR':_0x3060('0x5f'),'ROUND':_0x3060('0x60'),'UNIX_TIMESTAMP':_0x3060('0x61')};var _0x11db3f=function(_0x42a7a7){return!_[_0x3060('0x62')]([_0x3060('0x63'),_0x3060('0x64'),'IS\x20EMPTY',_0x3060('0x89')],_0x42a7a7);};var _0x34b664=function(_0x360017){if(!_0x360017||!_0x360017[_0x3060('0x66')]['length']){return'';}for(var _0x3143e1='(',_0x1b2f99=0x0;_0x1b2f99<_0x360017[_0x3060('0x66')][_0x3060('0x38')];_0x1b2f99+=0x1){_0x1b2f99>0x0&&(_0x3143e1+='\x20'+_0x360017[_0x3060('0x8a')]+'\x20');_0x3143e1+=_0x360017[_0x3060('0x66')][_0x1b2f99][_0x3060('0x67')]?_0x34b664(_0x360017[_0x3060('0x66')][_0x1b2f99][_0x3060('0x67')]):_0x360017[_0x3060('0x66')][_0x1b2f99][_0x3060('0x68')]+'\x20'+_0x360017['rules'][_0x1b2f99]['condition']+(_0x11db3f(_0x360017[_0x3060('0x66')][_0x1b2f99][_0x3060('0x69')])?'\x20'+_0x360017['rules'][_0x1b2f99][_0x3060('0x8b')]:'');}return _0x3143e1+')';};var _0x3944ff={'where':{'id':_0x32d30e['id']}},_0x3f7f68,_0x4f7a3d,_0x2579e9,_0x33e987,_0xb42a26;_0x3944ff=_[_0x3060('0x3e')]({},_0x3944ff,_0x35a122);return db[_0x3060('0x2d')]['find'](_0x3944ff)[_0x3060('0x24')](function(_0x42eacd){if(_0x42eacd){_0x3f7f68=_0x42eacd;return _0x42eacd[_0x3060('0x6b')]();}return null;})['then'](function(_0x2b87ba){if(_0x2b87ba){if(!_0x2b87ba[_0x3060('0x38')]){throw new db[(_0x3060('0x8c'))][(_0x3060('0x6c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4f7a3d=_0x2b87ba;return db[_0x3060('0x6e')]['findAll']({'raw':!![]});}return null;})[_0x3060('0x24')](function(_0x362743){if(_0x362743){_0x2579e9=_[_0x3060('0x6f')](_0x362743,'id');var _0x5169bd;var _0x20d074=squel[_0x3060('0x70')]();_0x20d074[_0x3060('0x71')](_0x3f7f68[_0x3060('0x7e')]);for(var _0x21cdea=0x0;_0x21cdea<_0x4f7a3d['length'];_0x21cdea+=0x1){_0x5169bd=_0x4f7a3d[_0x21cdea]['MetricId']?_0x2579e9[_0x4f7a3d[_0x21cdea][_0x3060('0x72')]]['metric']:_0x4f7a3d[_0x21cdea][_0x3060('0x68')];_0x5169bd=_0x4f7a3d[_0x21cdea][_0x3060('0x74')]?_[_0x3060('0x75')](_0x5f5d78[_0x4f7a3d[_0x21cdea][_0x3060('0x74')]],'%s',_0x5169bd):_0x5169bd;_0x5169bd=_0x4f7a3d[_0x21cdea][_0x3060('0x76')]?_[_0x3060('0x75')](_0x30245d[_0x4f7a3d[_0x21cdea][_0x3060('0x76')]],'%s',_0x5169bd):_0x5169bd;if(_0x4f7a3d[_0x21cdea][_0x3060('0x77')]){_0x20d074[_0x3060('0x67')](_0x5169bd);}_0x4f7a3d[_0x21cdea][_0x3060('0x78')]&&_0x20d074[_0x3060('0x3a')](_0x5169bd,_0x4f7a3d[_0x21cdea]['orderBy']===_0x3060('0x8d')?![]:!![]);_0x20d074[_0x3060('0x68')](_0x5169bd,_0x4f7a3d[_0x21cdea][_0x3060('0x79')]||_0x5169bd);}if(_0x3f7f68[_0x3060('0x7a')]){_0x3f7f68[_0x3060('0x7a')]=JSON[_0x3060('0x7b')](_0x3f7f68[_0x3060('0x7a')]);for(var _0x1dedb1=0x0;_0x1dedb1<_0x3f7f68[_0x3060('0x7a')][_0x3060('0x38')];_0x1dedb1+=0x1){if(_0x3f7f68[_0x3060('0x7a')][_0x1dedb1][_0x3060('0x2f')]&&_['includes'](_0x486e19,_0x3f7f68['joins'][_0x1dedb1]['type'])&&_0x3f7f68[_0x3060('0x7a')][_0x1dedb1][_0x3060('0x8e')]&&_0x3f7f68['joins'][_0x1dedb1][_0x3060('0x7c')]&&_0x3f7f68[_0x3060('0x7a')][_0x1dedb1][_0x3060('0x7f')]){_0x20d074[_0x3f7f68['joins'][_0x1dedb1]['type']](_0x3f7f68[_0x3060('0x7a')][_0x1dedb1][_0x3060('0x7c')],null,util[_0x3060('0x76')](_0x3060('0x7d'),_0x3f7f68[_0x3060('0x7e')],_0x3f7f68[_0x3060('0x7a')][_0x1dedb1][_0x3060('0x8e')],_0x3f7f68[_0x3060('0x7a')][_0x1dedb1][_0x3060('0x7c')],_0x3f7f68[_0x3060('0x7a')][_0x1dedb1][_0x3060('0x7f')]));}}}if(_0x3f7f68[_0x3060('0x80')]){_0x3f7f68[_0x3060('0x80')]=JSON[_0x3060('0x7b')](_0x3f7f68[_0x3060('0x80')]);_0x20d074['where'](_0x34b664(_0x3f7f68[_0x3060('0x80')][_0x3060('0x67')]));}_0xb42a26=_0x20d074[_0x3060('0x81')]();_0x20d074[_0x3060('0x82')](_0xd53265);_0x20d074[_0x3060('0x1f')](0x0);return;}})[_0x3060('0x24')](function(){if(_0x3a3feb[_0x3060('0x8f')]===_0x3060('0x90')){return null;}var _0x3b7c90=_['merge'](_0x3a3feb,{'name':_0x3a3feb['fullPath']||_0x3a3feb[_0x3060('0x2a')]||_0x3f7f68['name'],'basename':_0x589e6b,'savename':util[_0x3060('0x76')](_0x3060('0x91'),_0x3a3feb[_0x3060('0x2a')]||_0x3f7f68['name'],require(_0x3060('0x92'))[_0x3060('0x93')](0x4),_0x3a3feb[_0x3060('0x8f')]||_0x3060('0x94')),'reportId':_0x3f7f68['id'],'reportType':_0x3060('0x95')});return db[_0x3060('0x96')][_0x3060('0x46')](_0x3b7c90,{'raw':!![]});})['then'](function(_0x34fe44){if(_0x3f7f68[_0x3060('0x7e')]===_0x3060('0x97')){_0xb42a26[_0x3060('0x3c')](_0x3f7f68[_0x3060('0x7e')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3a3feb[_0x3060('0x98')],_0x3a3feb[_0x3060('0x99')]);}else{_0xb42a26[_0x3060('0x3c')](_0x3f7f68[_0x3060('0x7e')]+_0x3060('0x9a'),_0x3a3feb[_0x3060('0x98')],_0x3a3feb[_0x3060('0x99')]);}if(_0x34fe44){logger[_0x3060('0x9b')]('Run\x20Query:',_0xb42a26[_0x3060('0x84')]());require(_0x3060('0x9c'))[_0x3060('0x9d')](path['join'](__dirname,'../../components/export/',_0x34fe44[_0x3060('0x8f')]),[_0x34fe44['id'],_0xb42a26[_0x3060('0x84')](),path[_0x3060('0x87')](__dirname,_0x3060('0x9e'),_0x34fe44[_0x3060('0x9f')]),_0x589e6b]);return _0x34fe44;}else{var _0x37b934=squel['select']();_0x37b934[_0x3060('0x71')]('('+_0xb42a26[_0x3060('0x84')]()+')','countTable');_0x37b934['field']('COUNT(*)',_0x3060('0x40'));_0xb42a26['limit'](_0x3a3feb['limit']||_0xd53265);_0xb42a26['offset'](_0x3a3feb['offset']||0x0);return dbH['sequelize'][_0x3060('0x32')](_0x37b934[_0x3060('0x84')](),{'type':dbH[_0x3060('0x85')][_0x3060('0xa0')][_0x3060('0x86')]})[_0x3060('0x24')](function(_0x378dd0){if(!_0x378dd0['length']){_0x33e987=0x0;}else{_0x33e987=_0x378dd0[0x0][_0x3060('0x40')]||0x0;}return dbH[_0x3060('0x85')][_0x3060('0x32')](_0xb42a26[_0x3060('0x84')](),{'type':dbH['sequelize']['QueryTypes'][_0x3060('0x86')]});})[_0x3060('0x24')](function(_0x1dcc58){return{'rows':_0x1dcc58||[],'count':_0x33e987};});}});}exports[_0x3060('0xa1')]=function(_0x35b9d3,_0x40c45c){return runReport(_0x35b9d3[_0x3060('0x50')],_0x35b9d3[_0x3060('0x32')],_0x35b9d3['options'])[_0x3060('0x24')](respondWithResult(_0x40c45c,null))[_0x3060('0x43')](handleError(_0x40c45c,null));};exports[_0x3060('0xa2')]=runReport;exports['query']=function(_0x20ebfe,_0x1eed0a){var _0x1d4c20=0xa;var _0x4f75c3=[_0x3060('0x87'),_0x3060('0x52'),'right_join',_0x3060('0x54')];var _0x49d23c={'SUM':'SUM(%s)','COUNT':_0x3060('0x56'),'COUNT DISTINCT':_0x3060('0x57'),'MAX':_0x3060('0x58'),'MIN':_0x3060('0x59'),'AVG':_0x3060('0x5a'),'GROUP_CONCAT':_0x3060('0x5b'),'GROUP_CONCAT ASC':_0x3060('0x5c'),'GROUP_CONCAT DESC':_0x3060('0x5d')};var _0x489743={'SEC_TO_TIME':_0x3060('0x5e'),'DATE':_0x3060('0x88'),'HOUR':_0x3060('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x3060('0x61')};var _0x4c9ab2=function(_0x266cbe){return!_['includes'](['IS\x20NULL',_0x3060('0x64'),_0x3060('0x65'),'IS\x20NOT\x20EMPTY'],_0x266cbe);};var _0x380109=function(_0x419123){if(!_0x419123||!_0x419123['rules'][_0x3060('0x38')]){return'';}for(var _0x370648='(',_0x13e274=0x0;_0x13e274<_0x419123[_0x3060('0x66')][_0x3060('0x38')];_0x13e274+=0x1){_0x13e274>0x0&&(_0x370648+='\x20'+_0x419123[_0x3060('0x8a')]+'\x20');_0x370648+=_0x419123['rules'][_0x13e274]['group']?_0x380109(_0x419123['rules'][_0x13e274]['group']):_0x419123[_0x3060('0x66')][_0x13e274][_0x3060('0x68')]+'\x20'+_0x419123[_0x3060('0x66')][_0x13e274]['condition']+(_0x4c9ab2(_0x419123[_0x3060('0x66')][_0x13e274][_0x3060('0x69')])?'\x20'+_0x419123[_0x3060('0x66')][_0x13e274][_0x3060('0x8b')]:'');}return _0x370648+')';};var _0x4a667e={'where':{'id':_0x20ebfe[_0x3060('0x50')]['id']}},_0x1ab720,_0x37fd4a,_0x368981,_0x437775,_0x5ea90b;_0x4a667e=_[_0x3060('0x3e')]({},_0x4a667e,_0x20ebfe[_0x3060('0x6a')]);return db['AnalyticCustomReport'][_0x3060('0x4f')](_0x4a667e)[_0x3060('0x24')](function(_0x1a01a2){if(_0x1a01a2){_0x1ab720=_0x1a01a2;return _0x1a01a2[_0x3060('0x6b')]();}return null;})[_0x3060('0x24')](function(_0x161d5f){if(_0x161d5f){if(!_0x161d5f[_0x3060('0x38')]){throw new db['Sequelize'][(_0x3060('0x6c'))](_0x3060('0x6d'),0x193);}_0x37fd4a=_0x161d5f;return db[_0x3060('0x6e')][_0x3060('0x42')]({'raw':!![]});}return null;})[_0x3060('0x24')](function(_0x2ae288){if(_0x2ae288){_0x368981=_[_0x3060('0x6f')](_0x2ae288,'id');var _0x2c4c60;var _0x30994c=squel[_0x3060('0x70')]();_0x30994c[_0x3060('0x71')](_0x1ab720['table']);for(var _0x243ea7=0x0;_0x243ea7<_0x37fd4a[_0x3060('0x38')];_0x243ea7+=0x1){_0x2c4c60=_0x37fd4a[_0x243ea7][_0x3060('0x72')]?_0x368981[_0x37fd4a[_0x243ea7][_0x3060('0x72')]]['metric']:_0x37fd4a[_0x243ea7][_0x3060('0x68')];_0x2c4c60=_0x37fd4a[_0x243ea7][_0x3060('0x74')]?_[_0x3060('0x75')](_0x49d23c[_0x37fd4a[_0x243ea7][_0x3060('0x74')]],'%s',_0x2c4c60):_0x2c4c60;_0x2c4c60=_0x37fd4a[_0x243ea7]['format']?_['replace'](_0x489743[_0x37fd4a[_0x243ea7]['format']],'%s',_0x2c4c60):_0x2c4c60;if(_0x37fd4a[_0x243ea7][_0x3060('0x77')]){_0x30994c['group'](_0x2c4c60);}_0x37fd4a[_0x243ea7]['orderBy']&&_0x30994c['order'](_0x2c4c60,_0x37fd4a[_0x243ea7][_0x3060('0x78')]==='DESC'?![]:!![]);_0x30994c[_0x3060('0x68')](_0x2c4c60,_0x37fd4a[_0x243ea7]['alias']||_0x2c4c60);}if(_0x1ab720['joins']){_0x1ab720[_0x3060('0x7a')]=JSON['parse'](_0x1ab720[_0x3060('0x7a')]);for(var _0x5f394d=0x0;_0x5f394d<_0x1ab720[_0x3060('0x7a')]['length'];_0x5f394d+=0x1){if(_0x1ab720[_0x3060('0x7a')][_0x5f394d][_0x3060('0x2f')]&&_[_0x3060('0x62')](_0x4f75c3,_0x1ab720[_0x3060('0x7a')][_0x5f394d]['type'])&&_0x1ab720[_0x3060('0x7a')][_0x5f394d][_0x3060('0x8e')]&&_0x1ab720[_0x3060('0x7a')][_0x5f394d][_0x3060('0x7c')]&&_0x1ab720[_0x3060('0x7a')][_0x5f394d][_0x3060('0x7f')]){_0x30994c[_0x1ab720[_0x3060('0x7a')][_0x5f394d][_0x3060('0x2f')]](_0x1ab720[_0x3060('0x7a')][_0x5f394d][_0x3060('0x7c')],null,util['format'](_0x3060('0x7d'),_0x1ab720[_0x3060('0x7e')],_0x1ab720['joins'][_0x5f394d][_0x3060('0x8e')],_0x1ab720[_0x3060('0x7a')][_0x5f394d][_0x3060('0x7c')],_0x1ab720['joins'][_0x5f394d][_0x3060('0x7f')]));}}}if(_0x1ab720[_0x3060('0x80')]){_0x1ab720['conditions']=JSON[_0x3060('0x7b')](_0x1ab720['conditions']);_0x30994c[_0x3060('0x3c')](_0x380109(_0x1ab720[_0x3060('0x80')][_0x3060('0x67')]));}_0x5ea90b=_0x30994c[_0x3060('0x81')]();_0x30994c['limit'](_0x1d4c20);_0x30994c[_0x3060('0x1f')](0x0);logger[_0x3060('0x83')]('Limited\x20Query:',_0x30994c[_0x3060('0x84')]());return dbH[_0x3060('0x85')]['query'](_0x30994c['toString'](),{'type':dbH['sequelize'][_0x3060('0xa0')][_0x3060('0x86')]});}})[_0x3060('0x24')](function(){return{'sql':_0x5ea90b['toString']()};})['then'](respondWithResult(_0x1eed0a,null))[_0x3060('0x43')](handleError(_0x1eed0a,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 44ecf85..17d9925 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 _0x43f2=['define','AnalyticCustomReport','analytics_custom_reports','util','moment','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes'];(function(_0xaaf2e2,_0x19d28a){var _0x28bc36=function(_0x53bdb5){while(--_0x53bdb5){_0xaaf2e2['push'](_0xaaf2e2['shift']());}};_0x28bc36(++_0x19d28a);}(_0x43f2,0x19d));var _0x243f=function(_0x4b357a,_0x26a686){_0x4b357a=_0x4b357a-0x0;var _0x488c3c=_0x43f2[_0x4b357a];return _0x488c3c;};'use strict';var _=require('lodash');var util=require(_0x243f('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x243f('0x1'));var BPromise=require(_0x243f('0x2'));var rp=require(_0x243f('0x3'));var fs=require('fs');var path=require(_0x243f('0x4'));var rimraf=require('rimraf');var config=require(_0x243f('0x5'));var attributes=require(_0x243f('0x6'));module['exports']=function(_0x2f8ea4,_0x47b7c4){return _0x2f8ea4[_0x243f('0x7')](_0x243f('0x8'),attributes,{'tableName':_0x243f('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x98ba=['bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api'];(function(_0xa5bd84,_0x287943){var _0x22bcca=function(_0x13f6f4){while(--_0x13f6f4){_0xa5bd84['push'](_0xa5bd84['shift']());}};_0x22bcca(++_0x287943);}(_0x98ba,0x141));var _0xa98b=function(_0x339981,_0x53680c){_0x339981=_0x339981-0x0;var _0x3f9bf3=_0x98ba[_0x339981];return _0x3f9bf3;};'use strict';var _=require(_0xa98b('0x0'));var util=require(_0xa98b('0x1'));var logger=require(_0xa98b('0x2'))(_0xa98b('0x3'));var moment=require('moment');var BPromise=require(_0xa98b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa98b('0x5'));var rimraf=require(_0xa98b('0x6'));var config=require(_0xa98b('0x7'));var attributes=require(_0xa98b('0x8'));module[_0xa98b('0x9')]=function(_0x57d117,_0x421b61){return _0x57d117[_0xa98b('0xa')](_0xa98b('0xb'),attributes,{'tableName':_0xa98b('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index f636b01..ffdafb3 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 _0x4545=['client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x4b449e,_0x42468e){var _0x23d5c3=function(_0x349e31){while(--_0x349e31){_0x4b449e['push'](_0x4b449e['shift']());}};_0x23d5c3(++_0x42468e);}(_0x4545,0x6e));var _0x5454=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4545[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x5454('0x0'));var util=require(_0x5454('0x1'));var moment=require(_0x5454('0x2'));var BPromise=require(_0x5454('0x3'));var rs=require(_0x5454('0x4'));var fs=require('fs');var Redis=require(_0x5454('0x5'));var db=require(_0x5454('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5454('0x7'))(_0x5454('0x8'));var config=require(_0x5454('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5454('0xa')][_0x5454('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54c558,_0x144c73,_0x388142){return new BPromise(function(_0x35f4a6,_0x18be25){return client[_0x5454('0xc')](_0x54c558,_0x388142)[_0x5454('0xd')](function(_0x2c84eb){logger[_0x5454('0xe')](_0x5454('0xf'),_0x144c73,_0x5454('0x10'));logger[_0x5454('0x11')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x144c73,_0x5454('0x10'),JSON[_0x5454('0x12')](_0x2c84eb));if(_0x2c84eb['error']){if(_0x2c84eb['error'][_0x5454('0x13')]===0x1f4){logger[_0x5454('0x14')](_0x5454('0xf'),_0x144c73,_0x2c84eb[_0x5454('0x14')][_0x5454('0x15')]);return _0x18be25(_0x2c84eb[_0x5454('0x14')]['message']);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x144c73,_0x2c84eb[_0x5454('0x14')][_0x5454('0x15')]);return _0x35f4a6(_0x2c84eb[_0x5454('0x14')]['message']);}else{logger[_0x5454('0xe')](_0x5454('0xf'),_0x144c73,_0x5454('0x10'));_0x35f4a6(_0x2c84eb[_0x5454('0x16')][_0x5454('0x15')]);}})[_0x5454('0x17')](function(_0x41c73d){logger[_0x5454('0x14')](_0x5454('0xf'),_0x144c73,_0x41c73d);_0x18be25(_0x41c73d);});});}
\ No newline at end of file
+var _0x94ed=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','info','result','catch','lodash','util','moment','randomstring'];(function(_0x372590,_0x1ebb65){var _0x21abe6=function(_0xce83f4){while(--_0xce83f4){_0x372590['push'](_0x372590['shift']());}};_0x21abe6(++_0x1ebb65);}(_0x94ed,0x15a));var _0xd94e=function(_0x307d2b,_0x3796e0){_0x307d2b=_0x307d2b-0x0;var _0xe82587=_0x94ed[_0x307d2b];return _0xe82587;};'use strict';var _=require(_0xd94e('0x0'));var util=require(_0xd94e('0x1'));var moment=require(_0xd94e('0x2'));var BPromise=require('bluebird');var rs=require(_0xd94e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd94e('0x4'))['db'];var utils=require(_0xd94e('0x5'));var logger=require(_0xd94e('0x6'))(_0xd94e('0x7'));var config=require(_0xd94e('0x8'));var jayson=require(_0xd94e('0x9'));var client=jayson[_0xd94e('0xa')][_0xd94e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa66d47,_0xf33958,_0x5e3b7d){return new BPromise(function(_0x45cc86,_0x2dc96d){return client[_0xd94e('0xc')](_0xa66d47,_0x5e3b7d)[_0xd94e('0xd')](function(_0x387b8c){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0xf33958,_0xd94e('0xe'));logger[_0xd94e('0xf')](_0xd94e('0x10'),_0xf33958,_0xd94e('0xe'),JSON[_0xd94e('0x11')](_0x387b8c));if(_0x387b8c['error']){if(_0x387b8c[_0xd94e('0x12')][_0xd94e('0x13')]===0x1f4){logger[_0xd94e('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0xf33958,_0x387b8c[_0xd94e('0x12')]['message']);return _0x2dc96d(_0x387b8c[_0xd94e('0x12')][_0xd94e('0x14')]);}logger[_0xd94e('0x12')](_0xd94e('0x15'),_0xf33958,_0x387b8c[_0xd94e('0x12')][_0xd94e('0x14')]);return _0x45cc86(_0x387b8c[_0xd94e('0x12')][_0xd94e('0x14')]);}else{logger[_0xd94e('0x16')](_0xd94e('0x15'),_0xf33958,_0xd94e('0xe'));_0x45cc86(_0x387b8c[_0xd94e('0x17')]['message']);}})[_0xd94e('0x18')](function(_0x77f3d4){logger[_0xd94e('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0xf33958,_0x77f3d4);_0x2dc96d(_0x77f3d4);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 33ea503..3782760 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 _0xa7f4=['get','isAuthenticated','/:id','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller'];(function(_0x363050,_0x24b3ac){var _0x31f581=function(_0x576f64){while(--_0x576f64){_0x363050['push'](_0x363050['shift']());}};_0x31f581(++_0x24b3ac);}(_0xa7f4,0x1c7));var _0x4a7f=function(_0x4d86de,_0x52bed5){_0x4d86de=_0x4d86de-0x0;var _0x487f71=_0xa7f4[_0x4d86de];return _0x487f71;};'use strict';var multer=require(_0x4a7f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4a7f('0x1'));var express=require('express');var router=express[_0x4a7f('0x2')]();var fs_extra=require(_0x4a7f('0x3'));var auth=require(_0x4a7f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4a7f('0x5'));var controller=require(_0x4a7f('0x6'));router[_0x4a7f('0x7')]('/',auth[_0x4a7f('0x8')](),controller['index']);router['get'](_0x4a7f('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x4a7f('0x7')](_0x4a7f('0xa'),auth[_0x4a7f('0x8')](),controller[_0x4a7f('0xb')]);router[_0x4a7f('0x7')](_0x4a7f('0xc'),auth[_0x4a7f('0x8')](),controller[_0x4a7f('0xd')]);router[_0x4a7f('0x7')](_0x4a7f('0xe'),auth[_0x4a7f('0x8')](),controller[_0x4a7f('0xf')]);router[_0x4a7f('0x10')]('/',auth[_0x4a7f('0x8')](),controller[_0x4a7f('0x11')]);router[_0x4a7f('0x12')](_0x4a7f('0x9'),auth[_0x4a7f('0x8')](),controller['update']);router[_0x4a7f('0x13')](_0x4a7f('0x9'),auth[_0x4a7f('0x8')](),controller[_0x4a7f('0x14')]);module[_0x4a7f('0x15')]=router;
\ No newline at end of file
+var _0x01cd=['../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','/:id/preview','preview','/:id/run','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x25f359,_0x45d884){var _0x32185e=function(_0x1ab66c){while(--_0x1ab66c){_0x25f359['push'](_0x25f359['shift']());}};_0x32185e(++_0x45d884);}(_0x01cd,0xf6));var _0xd01c=function(_0x1b0a38,_0x1c0b07){_0x1b0a38=_0x1b0a38-0x0;var _0x588b5c=_0x01cd[_0x1b0a38];return _0x588b5c;};'use strict';var multer=require(_0xd01c('0x0'));var util=require(_0xd01c('0x1'));var path=require(_0xd01c('0x2'));var timeout=require(_0xd01c('0x3'));var express=require('express');var router=express[_0xd01c('0x4')]();var fs_extra=require(_0xd01c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd01c('0x6'));var config=require('../../config/environment');var controller=require(_0xd01c('0x7'));router[_0xd01c('0x8')]('/',auth[_0xd01c('0x9')](),controller['index']);router[_0xd01c('0x8')]('/:id',auth[_0xd01c('0x9')](),controller['show']);router[_0xd01c('0x8')](_0xd01c('0xa'),auth[_0xd01c('0x9')](),controller[_0xd01c('0xb')]);router['get'](_0xd01c('0xc'),auth['isAuthenticated'](),controller['run']);router[_0xd01c('0x8')]('/:id/query',auth[_0xd01c('0x9')](),controller['query']);router[_0xd01c('0xd')]('/',auth[_0xd01c('0x9')](),controller[_0xd01c('0xe')]);router[_0xd01c('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xd01c('0x10')]);router[_0xd01c('0x11')](_0xd01c('0x12'),auth[_0xd01c('0x9')](),controller[_0xd01c('0x13')]);module[_0xd01c('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 78cc567..a1416a5 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 _0xeec6=['STRING','TEXT','sequelize','exports'];(function(_0x26964c,_0x167e0d){var _0x44fca=function(_0x57d484){while(--_0x57d484){_0x26964c['push'](_0x26964c['shift']());}};_0x44fca(++_0x167e0d);}(_0xeec6,0x1c2));var _0x6eec=function(_0x53b594,_0x559767){_0x53b594=_0x53b594-0x0;var _0x1e616f=_0xeec6[_0x53b594];return _0x1e616f;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'name':{'type':Sequelize[_0x6eec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6eec('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x6eec('0x2')]},'conditions':{'type':Sequelize[_0x6eec('0x3')]},'joins':{'type':Sequelize[_0x6eec('0x3')]}};
\ No newline at end of file
+var _0x7fbe=['STRING','TEXT'];(function(_0x31f207,_0x33353a){var _0x1089ef=function(_0xdaaf31){while(--_0xdaaf31){_0x31f207['push'](_0x31f207['shift']());}};_0x1089ef(++_0x33353a);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x3fccbb,_0x473396){_0x3fccbb=_0x3fccbb-0x0;var _0x11df6e=_0x7fbe[_0x3fccbb];return _0x11df6e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe7fb('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xe7fb('0x0')]},'parent':{'type':Sequelize[_0xe7fb('0x0')]},'table':{'type':Sequelize[_0xe7fb('0x0')]},'conditions':{'type':Sequelize[_0xe7fb('0x1')]},'joins':{'type':Sequelize[_0xe7fb('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index c99549c..b6dd923 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 _0x2542=['getFields','ValidationErrorItem','metric','format','DESC','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','sequelize','SELECT','run','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','set','save','destroy','then','get','end','error','stack','name','send','index','map','AnalyticDefaultReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','field','replace','function','groupBy','orderBy','alias','parse','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','QueryTypes','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','value'];(function(_0x174a6c,_0x2818a0){var _0x5f37f9=function(_0x1e6e6c){while(--_0x1e6e6c){_0x174a6c['push'](_0x174a6c['shift']());}};_0x5f37f9(++_0x2818a0);}(_0x2542,0x169));var _0x2254=function(_0x563e46,_0x127714){_0x563e46=_0x563e46-0x0;var _0x18b414=_0x2542[_0x563e46];return _0x18b414;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];var dbH=require(_0x2254('0x19'))[_0x2254('0x1a')];function respondWithStatusCode(_0x3c326b,_0x381efe){_0x381efe=_0x381efe||0xcc;return function(_0x592a4f){if(_0x592a4f){return _0x3c326b[_0x2254('0x1b')](_0x381efe);}return _0x3c326b[_0x2254('0x1c')](_0x381efe)['end']();};}function respondWithResult(_0x2f4de,_0x1e582d){_0x1e582d=_0x1e582d||0xc8;return function(_0xfb23cb){if(_0xfb23cb){return _0x2f4de[_0x2254('0x1c')](_0x1e582d)[_0x2254('0x1d')](_0xfb23cb);}};}function respondWithFilteredResult(_0xbc5548,_0x50f137){return function(_0x18baf4){if(_0x18baf4){var _0x57247a=typeof _0x50f137[_0x2254('0x1e')]===_0x2254('0x1f')&&typeof _0x50f137[_0x2254('0x20')]===_0x2254('0x1f');var _0x1ae11e=_0x18baf4[_0x2254('0x21')];var _0x497724=_0x57247a?0x0:_0x50f137['offset'];var _0x5ec98d=_0x57247a?_0x18baf4[_0x2254('0x21')]:_0x50f137[_0x2254('0x1e')]+_0x50f137[_0x2254('0x20')];var _0x1f1163;if(_0x5ec98d>=_0x1ae11e){_0x5ec98d=_0x1ae11e;_0x1f1163=0xc8;}else{_0x1f1163=0xce;}_0xbc5548[_0x2254('0x1c')](_0x1f1163);return _0xbc5548[_0x2254('0x22')]('Content-Range',_0x497724+'-'+_0x5ec98d+'/'+_0x1ae11e)[_0x2254('0x1d')](_0x18baf4);}return null;};}function patchUpdates(_0x16148d){return function(_0x906cde){try{jsonpatch['apply'](_0x906cde,_0x16148d,!![]);}catch(_0x52fedc){return BPromise['reject'](_0x52fedc);}return _0x906cde[_0x2254('0x23')]();};}function saveUpdates(_0x559af4,_0xf88b56){return function(_0x56b91e){if(_0x56b91e){return _0x56b91e['update'](_0x559af4)['then'](function(_0x540020){return _0x540020;});}return null;};}function removeEntity(_0x5e5edb,_0x4f797d){return function(_0x1aa71f){if(_0x1aa71f){return _0x1aa71f[_0x2254('0x24')]()[_0x2254('0x25')](function(){var _0x265467=_0x1aa71f[_0x2254('0x26')]({'plain':!![]});var _0x1349c9='DefaultReports';return db['UserProfileResource'][_0x2254('0x24')]({'where':{'type':_0x1349c9,'resourceId':_0x265467['id']}})['then'](function(){return _0x1aa71f;});})[_0x2254('0x25')](function(){_0x5e5edb[_0x2254('0x1c')](0xcc)[_0x2254('0x27')]();});}};}function handleEntityNotFound(_0x3aa0bd,_0x19043b){return function(_0x482688){if(!_0x482688){_0x3aa0bd[_0x2254('0x1b')](0x194);}return _0x482688;};}function handleError(_0x2a789b,_0x21285d){_0x21285d=_0x21285d||0x1f4;return function(_0x37af8b){logger[_0x2254('0x28')](_0x37af8b[_0x2254('0x29')]);if(_0x37af8b[_0x2254('0x2a')]){delete _0x37af8b[_0x2254('0x2a')];}_0x2a789b[_0x2254('0x1c')](_0x21285d)[_0x2254('0x2b')](_0x37af8b);};}exports[_0x2254('0x2c')]=function(_0xad7774,_0x220f2a){var _0x27d30a={},_0x4577f4={},_0x1b16c8={'count':0x0,'rows':[]};var _0x2c929f=_[_0x2254('0x2d')](db[_0x2254('0x2e')]['rawAttributes'],function(_0xe29526){return{'name':_0xe29526[_0x2254('0x2f')],'type':_0xe29526[_0x2254('0x30')][_0x2254('0x31')]};});_0x4577f4[_0x2254('0x32')]=_[_0x2254('0x2d')](_0x2c929f,_0x2254('0x2a'));_0x4577f4[_0x2254('0x33')]=_[_0x2254('0x34')](_0xad7774['query']);_0x4577f4[_0x2254('0x35')]=_[_0x2254('0x36')](_0x4577f4['model'],_0x4577f4[_0x2254('0x33')]);_0x27d30a[_0x2254('0x37')]=_[_0x2254('0x36')](_0x4577f4[_0x2254('0x32')],qs['fields'](_0xad7774['query'][_0x2254('0x38')]));_0x27d30a['attributes']=_0x27d30a[_0x2254('0x37')][_0x2254('0x39')]?_0x27d30a[_0x2254('0x37')]:_0x4577f4[_0x2254('0x32')];if(!_0xad7774[_0x2254('0x33')][_0x2254('0x3a')](_0x2254('0x3b'))){_0x27d30a['limit']=qs[_0x2254('0x20')](_0xad7774[_0x2254('0x33')][_0x2254('0x20')]);_0x27d30a[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0xad7774[_0x2254('0x33')][_0x2254('0x1e')]);}_0x27d30a[_0x2254('0x3c')]=qs[_0x2254('0x3d')](_0xad7774[_0x2254('0x33')]['sort']);_0x27d30a[_0x2254('0x3e')]=qs[_0x2254('0x35')](_[_0x2254('0x3f')](_0xad7774[_0x2254('0x33')],_0x4577f4['filters']),_0x2c929f);if(_0xad7774[_0x2254('0x33')][_0x2254('0x40')]){_0x27d30a[_0x2254('0x3e')]=_[_0x2254('0x41')](_0x27d30a[_0x2254('0x3e')],{'$or':_[_0x2254('0x2d')](_0x2c929f,function(_0x423377){if(_0x423377[_0x2254('0x30')]!=='VIRTUAL'){var _0x362ad1={};_0x362ad1[_0x423377['name']]={'$like':'%'+_0xad7774[_0x2254('0x33')][_0x2254('0x40')]+'%'};return _0x362ad1;}})});}_0x27d30a=_[_0x2254('0x41')]({},_0x27d30a,_0xad7774[_0x2254('0x42')]);var _0x460bb3={'where':_0x27d30a[_0x2254('0x3e')]};return db[_0x2254('0x2e')]['count'](_0x460bb3)[_0x2254('0x25')](function(_0x2f1ff9){_0x1b16c8[_0x2254('0x21')]=_0x2f1ff9;if(_0xad7774[_0x2254('0x33')][_0x2254('0x43')]){_0x27d30a['include']=[{'all':!![]}];}return db[_0x2254('0x2e')][_0x2254('0x44')](_0x27d30a);})[_0x2254('0x25')](function(_0x135ed8){_0x1b16c8[_0x2254('0x45')]=_0x135ed8;return _0x1b16c8;})['then'](respondWithFilteredResult(_0x220f2a,_0x27d30a))[_0x2254('0x46')](handleError(_0x220f2a,null));};exports['show']=function(_0x91e091,_0x1ded9a){var _0xb4d042={'raw':!![],'where':{'id':_0x91e091[_0x2254('0x47')]['id']}},_0x31c31e={};_0x31c31e[_0x2254('0x32')]=_[_0x2254('0x34')](db[_0x2254('0x2e')][_0x2254('0x48')]);_0x31c31e[_0x2254('0x33')]=_[_0x2254('0x34')](_0x91e091[_0x2254('0x33')]);_0x31c31e[_0x2254('0x35')]=_['intersection'](_0x31c31e[_0x2254('0x32')],_0x31c31e[_0x2254('0x33')]);_0xb4d042[_0x2254('0x37')]=_['intersection'](_0x31c31e[_0x2254('0x32')],qs[_0x2254('0x38')](_0x91e091[_0x2254('0x33')][_0x2254('0x38')]));_0xb4d042[_0x2254('0x37')]=_0xb4d042[_0x2254('0x37')][_0x2254('0x39')]?_0xb4d042[_0x2254('0x37')]:_0x31c31e[_0x2254('0x32')];if(_0x91e091['query'][_0x2254('0x43')]){_0xb4d042[_0x2254('0x49')]=[{'all':!![]}];}_0xb4d042=_[_0x2254('0x41')]({},_0xb4d042,_0x91e091[_0x2254('0x42')]);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0xb4d042)[_0x2254('0x25')](handleEntityNotFound(_0x1ded9a,null))[_0x2254('0x25')](respondWithResult(_0x1ded9a,null))[_0x2254('0x46')](handleError(_0x1ded9a,null));};exports[_0x2254('0x4b')]=function(_0x5b14c5,_0x36b977){return db[_0x2254('0x2e')]['create'](_0x5b14c5[_0x2254('0x4c')],{})[_0x2254('0x25')](function(_0x12e2ff){var _0x4331a9=_0x5b14c5['user'][_0x2254('0x26')]({'plain':!![]});if(!_0x4331a9)throw new Error(_0x2254('0x4d'));if(_0x4331a9['role']===_0x2254('0x4e')){var _0x3f0670=_0x12e2ff[_0x2254('0x26')]({'plain':!![]});var _0x43bb88='Reports';return db[_0x2254('0x4f')][_0x2254('0x4a')]({'where':{'name':_0x43bb88,'userProfileId':_0x4331a9[_0x2254('0x50')]},'raw':!![]})['then'](function(_0x4cc18a){if(_0x4cc18a&&_0x4cc18a[_0x2254('0x51')]===0x0){return db[_0x2254('0x52')]['create']({'name':_0x3f0670[_0x2254('0x2a')],'resourceId':_0x3f0670['id'],'type':'DefaultReports','sectionId':_0x4cc18a['id']},{})['then'](function(){return _0x12e2ff;});}else{return _0x12e2ff;}})[_0x2254('0x46')](function(_0x135962){logger[_0x2254('0x28')](_0x2254('0x53'),_0x135962);throw _0x135962;});}return _0x12e2ff;})[_0x2254('0x25')](respondWithResult(_0x36b977,0xc9))['catch'](handleError(_0x36b977,null));};exports['update']=function(_0x1bd988,_0x5e3fbc){if(_0x1bd988[_0x2254('0x4c')]['id']){delete _0x1bd988[_0x2254('0x4c')]['id'];}return db[_0x2254('0x2e')][_0x2254('0x4a')]({'where':{'id':_0x1bd988['params']['id']}})[_0x2254('0x25')](handleEntityNotFound(_0x5e3fbc,null))[_0x2254('0x25')](saveUpdates(_0x1bd988['body'],null))['then'](respondWithResult(_0x5e3fbc,null))[_0x2254('0x46')](handleError(_0x5e3fbc,null));};exports['destroy']=function(_0x2cc59c,_0x305ace){return db[_0x2254('0x2e')][_0x2254('0x4a')]({'where':{'id':_0x2cc59c[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x305ace,null))['then'](removeEntity(_0x305ace,null))[_0x2254('0x46')](handleError(_0x305ace,null));};exports['preview']=function(_0x335c66,_0x510fe0){var _0x4da493=0xa;var _0x5999c8=[_0x2254('0x54'),_0x2254('0x55'),_0x2254('0x56'),_0x2254('0x57')];var _0x13606e={'SUM':_0x2254('0x58'),'COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':_0x2254('0x5b'),'MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':_0x2254('0x5e'),'GROUP_CONCAT ASC':_0x2254('0x5f'),'GROUP_CONCAT DESC':_0x2254('0x60')};var _0x2f391d={'SEC_TO_TIME':_0x2254('0x61'),'DATE':_0x2254('0x62'),'HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x329378=function(_0xae171c){return!_[_0x2254('0x65')]([_0x2254('0x66'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x2254('0x67')],_0xae171c);};var _0x423c17=function(_0x1d73a3){if(!_0x1d73a3||!_0x1d73a3[_0x2254('0x68')][_0x2254('0x39')]){return'';}for(var _0x53b55b='(',_0x45b7bd=0x0;_0x45b7bd<_0x1d73a3[_0x2254('0x68')][_0x2254('0x39')];_0x45b7bd+=0x1){_0x45b7bd>0x0&&(_0x53b55b+='\x20'+_0x1d73a3['operator']+'\x20');_0x53b55b+=_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x69')]?_0x423c17(_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x69')]):_0x1d73a3[_0x2254('0x68')][_0x45b7bd]['field']+'\x20'+_0x1d73a3[_0x2254('0x68')][_0x45b7bd][_0x2254('0x6a')]+(_0x329378(_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x6a')])?'\x20'+_0x1d73a3[_0x2254('0x68')][_0x45b7bd]['value']:'');}return _0x53b55b+')';};var _0x5cc6bd={'where':{'id':_0x335c66['params']['id']}},_0xde4e7,_0xa159a4,_0x486b82,_0x506d95,_0x48406e;_0x5cc6bd=_[_0x2254('0x41')]({},_0x5cc6bd,_0x335c66['options']);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0x5cc6bd)[_0x2254('0x25')](function(_0x1ed6b9){if(_0x1ed6b9){_0xde4e7=_0x1ed6b9;return _0x1ed6b9['getFields']();}return null;})[_0x2254('0x25')](function(_0x5ecf82){if(_0x5ecf82){if(!_0x5ecf82[_0x2254('0x39')]){throw new db[(_0x2254('0x6b'))]['ValidationErrorItem'](_0x2254('0x6c'),0x193);}_0xa159a4=_0x5ecf82;return db[_0x2254('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x3b3b20){if(_0x3b3b20){_0x486b82=_[_0x2254('0x6e')](_0x3b3b20,'id');var _0x3cefbe;var _0x4f77e5=squel[_0x2254('0x6f')]();_0x4f77e5[_0x2254('0x70')](_0xde4e7['table']);for(var _0x1ac8ff=0x0;_0x1ac8ff<_0xa159a4[_0x2254('0x39')];_0x1ac8ff+=0x1){_0x3cefbe=_0xa159a4[_0x1ac8ff]['MetricId']?_0x486b82[_0xa159a4[_0x1ac8ff][_0x2254('0x71')]]['metric']:_0xa159a4[_0x1ac8ff][_0x2254('0x72')];_0x3cefbe=_0xa159a4[_0x1ac8ff]['function']?_[_0x2254('0x73')](_0x13606e[_0xa159a4[_0x1ac8ff][_0x2254('0x74')]],'%s',_0x3cefbe):_0x3cefbe;_0x3cefbe=_0xa159a4[_0x1ac8ff]['format']?_[_0x2254('0x73')](_0x2f391d[_0xa159a4[_0x1ac8ff]['format']],'%s',_0x3cefbe):_0x3cefbe;if(_0xa159a4[_0x1ac8ff][_0x2254('0x75')]){_0x4f77e5[_0x2254('0x69')](_0x3cefbe);}_0xa159a4[_0x1ac8ff][_0x2254('0x76')]&&_0x4f77e5['order'](_0x3cefbe,_0xa159a4[_0x1ac8ff][_0x2254('0x76')]==='DESC'?![]:!![]);_0x4f77e5[_0x2254('0x72')](_0x3cefbe,_0xa159a4[_0x1ac8ff][_0x2254('0x77')]||_0x3cefbe);}if(_0xde4e7['joins']){_0xde4e7['joins']=JSON[_0x2254('0x78')](_0xde4e7[_0x2254('0x79')]);for(var _0x451520=0x0;_0x451520<_0xde4e7[_0x2254('0x79')]['length'];_0x451520+=0x1){if(_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x30')]&&_[_0x2254('0x65')](_0x5999c8,_0xde4e7[_0x2254('0x79')][_0x451520]['type'])&&_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7a')]&&_0xde4e7['joins'][_0x451520][_0x2254('0x7b')]&&_0xde4e7['joins'][_0x451520][_0x2254('0x7c')]){_0x4f77e5[_0xde4e7['joins'][_0x451520]['type']](_0xde4e7['joins'][_0x451520][_0x2254('0x7b')],null,util['format'](_0x2254('0x7d'),_0xde4e7[_0x2254('0x7e')],_0xde4e7['joins'][_0x451520][_0x2254('0x7a')],_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7b')],_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7c')]));}}}if(_0xde4e7[_0x2254('0x7f')]){_0xde4e7['conditions']=JSON['parse'](_0xde4e7[_0x2254('0x7f')]);_0x4f77e5[_0x2254('0x3e')](_0x423c17(_0xde4e7[_0x2254('0x7f')][_0x2254('0x69')]));}_0x48406e=_0x4f77e5[_0x2254('0x80')]();_0x4f77e5[_0x2254('0x20')](_0x4da493);_0x4f77e5[_0x2254('0x1e')](0x0);logger[_0x2254('0x81')](_0x2254('0x82'),_0x4f77e5[_0x2254('0x83')]());return dbH['sequelize'][_0x2254('0x33')](_0x4f77e5[_0x2254('0x83')](),{'type':dbH['sequelize'][_0x2254('0x84')]['SELECT']});}})[_0x2254('0x25')](respondWithResult(_0x510fe0,null))[_0x2254('0x46')](handleError(_0x510fe0,null));};function runReport(_0x4dfcb4,_0x1c317b,_0x4e699c){var _0x2ad519=_0x1c317b[_0x2254('0x2a')];var _0x30f2c9=0xa;var _0x1f7a48=['join',_0x2254('0x55'),_0x2254('0x56'),_0x2254('0x57')];var _0x3a8d4f={'SUM':'SUM(%s)','COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':'MAX(%s)','MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x2254('0x60')};var _0x2f3650={'SEC_TO_TIME':_0x2254('0x61'),'DATE':_0x2254('0x62'),'HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':_0x2254('0x85')};var _0x251d70=function(_0x2c7705){return!_['includes']([_0x2254('0x66'),'IS\x20NOT\x20NULL',_0x2254('0x86'),'IS\x20NOT\x20EMPTY'],_0x2c7705);};var _0x36d121=function(_0x207a09){if(!_0x207a09||!_0x207a09[_0x2254('0x68')]['length']){return'';}for(var _0x8a3656='(',_0x1554f1=0x0;_0x1554f1<_0x207a09[_0x2254('0x68')][_0x2254('0x39')];_0x1554f1+=0x1){_0x1554f1>0x0&&(_0x8a3656+='\x20'+_0x207a09[_0x2254('0x87')]+'\x20');_0x8a3656+=_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x69')]?_0x36d121(_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x69')]):_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x72')]+'\x20'+_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x6a')]+(_0x251d70(_0x207a09['rules'][_0x1554f1][_0x2254('0x6a')])?'\x20'+_0x207a09['rules'][_0x1554f1][_0x2254('0x88')]:'');}return _0x8a3656+')';};var _0xb98b40={'where':{'id':_0x4dfcb4['id']}},_0x3b1d5c,_0x2c907a,_0x23b78c,_0x2b5dba,_0x30307a;_0xb98b40=_['merge']({},_0xb98b40,_0x4e699c);return db[_0x2254('0x2e')]['find'](_0xb98b40)[_0x2254('0x25')](function(_0x52712d){if(_0x52712d){_0x3b1d5c=_0x52712d;return _0x52712d[_0x2254('0x89')]();}return null;})[_0x2254('0x25')](function(_0x1d0c8f){if(_0x1d0c8f){if(!_0x1d0c8f['length']){throw new db[(_0x2254('0x6b'))][(_0x2254('0x8a'))](_0x2254('0x6c'),0x193);}_0x2c907a=_0x1d0c8f;return db[_0x2254('0x6d')][_0x2254('0x44')]({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x34185c){if(_0x34185c){_0x23b78c=_[_0x2254('0x6e')](_0x34185c,'id');var _0x5e94b6;var _0x56239e=squel[_0x2254('0x6f')]();_0x56239e['from'](_0x3b1d5c[_0x2254('0x7e')]);for(var _0x3a1365=0x0;_0x3a1365<_0x2c907a[_0x2254('0x39')];_0x3a1365+=0x1){_0x5e94b6=_0x2c907a[_0x3a1365][_0x2254('0x71')]?_0x23b78c[_0x2c907a[_0x3a1365][_0x2254('0x71')]][_0x2254('0x8b')]:_0x2c907a[_0x3a1365][_0x2254('0x72')];_0x5e94b6=_0x2c907a[_0x3a1365]['function']?_[_0x2254('0x73')](_0x3a8d4f[_0x2c907a[_0x3a1365][_0x2254('0x74')]],'%s',_0x5e94b6):_0x5e94b6;_0x5e94b6=_0x2c907a[_0x3a1365][_0x2254('0x8c')]?_['replace'](_0x2f3650[_0x2c907a[_0x3a1365][_0x2254('0x8c')]],'%s',_0x5e94b6):_0x5e94b6;if(_0x2c907a[_0x3a1365][_0x2254('0x75')]){_0x56239e[_0x2254('0x69')](_0x5e94b6);}_0x2c907a[_0x3a1365][_0x2254('0x76')]&&_0x56239e[_0x2254('0x3c')](_0x5e94b6,_0x2c907a[_0x3a1365][_0x2254('0x76')]===_0x2254('0x8d')?![]:!![]);_0x56239e[_0x2254('0x72')](_0x5e94b6,_0x2c907a[_0x3a1365][_0x2254('0x77')]||_0x5e94b6);}if(_0x3b1d5c['joins']){_0x3b1d5c[_0x2254('0x79')]=JSON[_0x2254('0x78')](_0x3b1d5c['joins']);for(var _0x4cec5b=0x0;_0x4cec5b<_0x3b1d5c[_0x2254('0x79')]['length'];_0x4cec5b+=0x1){if(_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')]&&_[_0x2254('0x65')](_0x1f7a48,_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')])&&_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7a')]&&_0x3b1d5c[_0x2254('0x79')][_0x4cec5b]['foreignTable']&&_0x3b1d5c['joins'][_0x4cec5b][_0x2254('0x7c')]){_0x56239e[_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')]](_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3b1d5c[_0x2254('0x7e')],_0x3b1d5c['joins'][_0x4cec5b][_0x2254('0x7a')],_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7b')],_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7c')]));}}}if(_0x3b1d5c[_0x2254('0x7f')]){_0x3b1d5c[_0x2254('0x7f')]=JSON['parse'](_0x3b1d5c[_0x2254('0x7f')]);_0x56239e[_0x2254('0x3e')](_0x36d121(_0x3b1d5c['conditions'][_0x2254('0x69')]));}_0x30307a=_0x56239e[_0x2254('0x80')]();_0x56239e[_0x2254('0x20')](_0x30f2c9);_0x56239e[_0x2254('0x1e')](0x0);return;}})[_0x2254('0x25')](function(){if(_0x1c317b[_0x2254('0x8e')]===_0x2254('0x8f')){return null;}var _0x38e2df=_[_0x2254('0x41')](_0x1c317b,{'name':_0x1c317b[_0x2254('0x90')]||_0x1c317b[_0x2254('0x2a')]||_0x3b1d5c['name'],'basename':_0x2ad519,'savename':util[_0x2254('0x8c')](_0x2254('0x91'),_0x1c317b[_0x2254('0x2a')]||_0x3b1d5c[_0x2254('0x2a')],require(_0x2254('0x92'))[_0x2254('0x93')](0x4),_0x1c317b[_0x2254('0x8e')]||'csv'),'reportId':_0x3b1d5c['id'],'reportType':_0x2254('0x94')});return db[_0x2254('0x95')][_0x2254('0x4b')](_0x38e2df,{'raw':!![]});})['then'](function(_0x60f5ac){if(_0x3b1d5c[_0x2254('0x7e')]===_0x2254('0x96')){_0x30307a[_0x2254('0x3e')](_0x3b1d5c[_0x2254('0x7e')]+_0x2254('0x97'),_0x1c317b['startDate'],_0x1c317b[_0x2254('0x98')]);}else{_0x30307a[_0x2254('0x3e')](_0x3b1d5c[_0x2254('0x7e')]+_0x2254('0x99'),_0x1c317b[_0x2254('0x9a')],_0x1c317b['endDate']);}if(_0x60f5ac){logger['info'](_0x2254('0x9b'),_0x30307a['toString']());require(_0x2254('0x9c'))[_0x2254('0x9d')](path[_0x2254('0x54')](__dirname,_0x2254('0x9e'),_0x60f5ac[_0x2254('0x8e')]),[_0x60f5ac['id'],_0x30307a[_0x2254('0x83')](),path['join'](__dirname,'../../files/reports',_0x60f5ac[_0x2254('0x9f')]),_0x2ad519]);return _0x60f5ac;}else{var _0x3317d4=squel[_0x2254('0x6f')]();_0x3317d4[_0x2254('0x70')]('('+_0x30307a['toString']()+')',_0x2254('0xa0'));_0x3317d4[_0x2254('0x72')](_0x2254('0xa1'),_0x2254('0x21'));_0x30307a[_0x2254('0x20')](_0x1c317b[_0x2254('0x20')]||_0x30f2c9);_0x30307a[_0x2254('0x1e')](_0x1c317b[_0x2254('0x1e')]||0x0);return dbH[_0x2254('0xa2')]['query'](_0x3317d4[_0x2254('0x83')](),{'type':dbH[_0x2254('0xa2')][_0x2254('0x84')]['SELECT']})[_0x2254('0x25')](function(_0xe38a28){if(!_0xe38a28[_0x2254('0x39')]){_0x2b5dba=0x0;}else{_0x2b5dba=_0xe38a28[0x0]['count']||0x0;}return dbH['sequelize'][_0x2254('0x33')](_0x30307a[_0x2254('0x83')](),{'type':dbH[_0x2254('0xa2')][_0x2254('0x84')][_0x2254('0xa3')]});})[_0x2254('0x25')](function(_0x4011de){return{'rows':_0x4011de||[],'count':_0x2b5dba};});}});}exports[_0x2254('0xa4')]=function(_0x5cb3d1,_0x1d8238){return runReport(_0x5cb3d1[_0x2254('0x47')],_0x5cb3d1[_0x2254('0x33')],_0x5cb3d1[_0x2254('0x42')])[_0x2254('0x25')](respondWithResult(_0x1d8238,null))[_0x2254('0x46')](handleError(_0x1d8238,null));};exports['runReport']=runReport;exports['query']=function(_0x40339d,_0x4b3b96){var _0x59b8af=0xa;var _0x408695=[_0x2254('0x54'),_0x2254('0x55'),_0x2254('0x56'),'cross_join'];var _0x596eae={'SUM':_0x2254('0x58'),'COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':'MAX(%s)','MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':_0x2254('0x5e'),'GROUP_CONCAT ASC':_0x2254('0x5f'),'GROUP_CONCAT DESC':_0x2254('0x60')};var _0x739a29={'SEC_TO_TIME':_0x2254('0x61'),'DATE':'DATE(%s)','HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':_0x2254('0x85')};var _0x243466=function(_0x1b8587){return!_[_0x2254('0x65')]([_0x2254('0x66'),_0x2254('0xa5'),_0x2254('0x86'),'IS\x20NOT\x20EMPTY'],_0x1b8587);};var _0xbec5d0=function(_0x18f841){if(!_0x18f841||!_0x18f841[_0x2254('0x68')][_0x2254('0x39')]){return'';}for(var _0x275b56='(',_0x315add=0x0;_0x315add<_0x18f841['rules']['length'];_0x315add+=0x1){_0x315add>0x0&&(_0x275b56+='\x20'+_0x18f841[_0x2254('0x87')]+'\x20');_0x275b56+=_0x18f841['rules'][_0x315add][_0x2254('0x69')]?_0xbec5d0(_0x18f841[_0x2254('0x68')][_0x315add][_0x2254('0x69')]):_0x18f841[_0x2254('0x68')][_0x315add]['field']+'\x20'+_0x18f841[_0x2254('0x68')][_0x315add][_0x2254('0x6a')]+(_0x243466(_0x18f841[_0x2254('0x68')][_0x315add]['condition'])?'\x20'+_0x18f841['rules'][_0x315add][_0x2254('0x88')]:'');}return _0x275b56+')';};var _0x51b02a={'where':{'id':_0x40339d[_0x2254('0x47')]['id']}},_0x3e7642,_0xe1abb6,_0x1a44d0,_0x4af6a7,_0x539aba;_0x51b02a=_[_0x2254('0x41')]({},_0x51b02a,_0x40339d[_0x2254('0x42')]);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0x51b02a)['then'](function(_0x34e28b){if(_0x34e28b){_0x3e7642=_0x34e28b;return _0x34e28b[_0x2254('0x89')]();}return null;})[_0x2254('0x25')](function(_0x5d373){if(_0x5d373){if(!_0x5d373[_0x2254('0x39')]){throw new db[(_0x2254('0x6b'))]['ValidationErrorItem'](_0x2254('0x6c'),0x193);}_0xe1abb6=_0x5d373;return db[_0x2254('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x56a7ce){if(_0x56a7ce){_0x1a44d0=_[_0x2254('0x6e')](_0x56a7ce,'id');var _0x34bf19;var _0x4965c7=squel[_0x2254('0x6f')]();_0x4965c7[_0x2254('0x70')](_0x3e7642[_0x2254('0x7e')]);for(var _0x45541b=0x0;_0x45541b<_0xe1abb6[_0x2254('0x39')];_0x45541b+=0x1){_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x71')]?_0x1a44d0[_0xe1abb6[_0x45541b][_0x2254('0x71')]][_0x2254('0x8b')]:_0xe1abb6[_0x45541b][_0x2254('0x72')];_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x74')]?_[_0x2254('0x73')](_0x596eae[_0xe1abb6[_0x45541b][_0x2254('0x74')]],'%s',_0x34bf19):_0x34bf19;_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x8c')]?_[_0x2254('0x73')](_0x739a29[_0xe1abb6[_0x45541b]['format']],'%s',_0x34bf19):_0x34bf19;if(_0xe1abb6[_0x45541b][_0x2254('0x75')]){_0x4965c7[_0x2254('0x69')](_0x34bf19);}_0xe1abb6[_0x45541b]['orderBy']&&_0x4965c7['order'](_0x34bf19,_0xe1abb6[_0x45541b][_0x2254('0x76')]===_0x2254('0x8d')?![]:!![]);_0x4965c7[_0x2254('0x72')](_0x34bf19,_0xe1abb6[_0x45541b][_0x2254('0x77')]||_0x34bf19);}if(_0x3e7642['joins']){_0x3e7642[_0x2254('0x79')]=JSON['parse'](_0x3e7642['joins']);for(var _0x40fec0=0x0;_0x40fec0<_0x3e7642[_0x2254('0x79')][_0x2254('0x39')];_0x40fec0+=0x1){if(_0x3e7642[_0x2254('0x79')][_0x40fec0]['type']&&_[_0x2254('0x65')](_0x408695,_0x3e7642['joins'][_0x40fec0][_0x2254('0x30')])&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7a')]&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')]&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7c')]){_0x4965c7[_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x30')]](_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')],null,util['format'](_0x2254('0x7d'),_0x3e7642[_0x2254('0x7e')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7a')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7c')]));}}}if(_0x3e7642['conditions']){_0x3e7642[_0x2254('0x7f')]=JSON[_0x2254('0x78')](_0x3e7642[_0x2254('0x7f')]);_0x4965c7[_0x2254('0x3e')](_0xbec5d0(_0x3e7642[_0x2254('0x7f')]['group']));}_0x539aba=_0x4965c7[_0x2254('0x80')]();_0x4965c7[_0x2254('0x20')](_0x59b8af);_0x4965c7['offset'](0x0);logger[_0x2254('0x81')](_0x2254('0x82'),_0x4965c7[_0x2254('0x83')]());return dbH['sequelize'][_0x2254('0x33')](_0x4965c7[_0x2254('0x83')](),{'type':dbH['sequelize'][_0x2254('0x84')][_0x2254('0xa3')]});}})[_0x2254('0x25')](function(){return{'sql':_0x539aba[_0x2254('0x83')]()};})['then'](respondWithResult(_0x4b3b96,null))[_0x2254('0x46')](handleError(_0x4b3b96,null));};
\ No newline at end of file
+var _0xf494=['name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','includeAll','find','create','body','user','Reports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','left_join','cross_join','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)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NULL','operator','condition','getFields','groupBy','clone','output','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','IS\x20NOT\x20EMPTY','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','DefaultReports','error','stack'];(function(_0x3f922a,_0x405a7e){var _0xed5abb=function(_0x54f9f1){while(--_0x54f9f1){_0x3f922a['push'](_0x3f922a['shift']());}};_0xed5abb(++_0x405a7e);}(_0xf494,0x1c6));var _0x4f49=function(_0x47077d,_0x16ad9f){_0x47077d=_0x47077d-0x0;var _0x2cf416=_0xf494[_0x47077d];return _0x2cf416;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];var dbH=require(_0x4f49('0x18'))['dbH'];function respondWithStatusCode(_0x1e1c37,_0x111a8b){_0x111a8b=_0x111a8b||0xcc;return function(_0x1b9145){if(_0x1b9145){return _0x1e1c37[_0x4f49('0x19')](_0x111a8b);}return _0x1e1c37[_0x4f49('0x1a')](_0x111a8b)[_0x4f49('0x1b')]();};}function respondWithResult(_0xfdb477,_0x5c373e){_0x5c373e=_0x5c373e||0xc8;return function(_0x515ace){if(_0x515ace){return _0xfdb477[_0x4f49('0x1a')](_0x5c373e)[_0x4f49('0x1c')](_0x515ace);}};}function respondWithFilteredResult(_0x5878f4,_0x5bdfaf){return function(_0x2f0a0d){if(_0x2f0a0d){var _0x2ecaaa=typeof _0x5bdfaf[_0x4f49('0x1d')]==='undefined'&&typeof _0x5bdfaf[_0x4f49('0x1e')]===_0x4f49('0x1f');var _0x4e85df=_0x2f0a0d['count'];var _0x5bb23b=_0x2ecaaa?0x0:_0x5bdfaf['offset'];var _0x47f1e8=_0x2ecaaa?_0x2f0a0d[_0x4f49('0x20')]:_0x5bdfaf[_0x4f49('0x1d')]+_0x5bdfaf[_0x4f49('0x1e')];var _0x407042;if(_0x47f1e8>=_0x4e85df){_0x47f1e8=_0x4e85df;_0x407042=0xc8;}else{_0x407042=0xce;}_0x5878f4['status'](_0x407042);return _0x5878f4[_0x4f49('0x21')](_0x4f49('0x22'),_0x5bb23b+'-'+_0x47f1e8+'/'+_0x4e85df)[_0x4f49('0x1c')](_0x2f0a0d);}return null;};}function patchUpdates(_0xaab5e7){return function(_0xea82f8){try{jsonpatch['apply'](_0xea82f8,_0xaab5e7,!![]);}catch(_0x3e7e28){return BPromise[_0x4f49('0x23')](_0x3e7e28);}return _0xea82f8[_0x4f49('0x24')]();};}function saveUpdates(_0x53b57d,_0x40755e){return function(_0x1d70a7){if(_0x1d70a7){return _0x1d70a7[_0x4f49('0x25')](_0x53b57d)[_0x4f49('0x26')](function(_0x9d30aa){return _0x9d30aa;});}return null;};}function removeEntity(_0x36187b,_0x559d98){return function(_0x4e9041){if(_0x4e9041){return _0x4e9041[_0x4f49('0x27')]()[_0x4f49('0x26')](function(){var _0x4fedbb=_0x4e9041[_0x4f49('0x28')]({'plain':!![]});var _0x2c1519=_0x4f49('0x29');return db['UserProfileResource'][_0x4f49('0x27')]({'where':{'type':_0x2c1519,'resourceId':_0x4fedbb['id']}})[_0x4f49('0x26')](function(){return _0x4e9041;});})[_0x4f49('0x26')](function(){_0x36187b[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x122404,_0x4915af){return function(_0x50c571){if(!_0x50c571){_0x122404[_0x4f49('0x19')](0x194);}return _0x50c571;};}function handleError(_0x2c00ee,_0x605c91){_0x605c91=_0x605c91||0x1f4;return function(_0x560050){logger[_0x4f49('0x2a')](_0x560050[_0x4f49('0x2b')]);if(_0x560050[_0x4f49('0x2c')]){delete _0x560050['name'];}_0x2c00ee['status'](_0x605c91)[_0x4f49('0x2d')](_0x560050);};}exports[_0x4f49('0x2e')]=function(_0x7a6ea0,_0x5e7076){var _0x1eaac6={},_0x35aa33={},_0x173657={'count':0x0,'rows':[]};var _0x2ceda4=_[_0x4f49('0x2f')](db[_0x4f49('0x30')][_0x4f49('0x31')],function(_0x45ae19){return{'name':_0x45ae19[_0x4f49('0x32')],'type':_0x45ae19[_0x4f49('0x33')][_0x4f49('0x34')]};});_0x35aa33[_0x4f49('0x35')]=_[_0x4f49('0x2f')](_0x2ceda4,_0x4f49('0x2c'));_0x35aa33[_0x4f49('0x36')]=_[_0x4f49('0x37')](_0x7a6ea0[_0x4f49('0x36')]);_0x35aa33[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x35aa33['model'],_0x35aa33[_0x4f49('0x36')]);_0x1eaac6[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x35aa33[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3b')]));_0x1eaac6[_0x4f49('0x3a')]=_0x1eaac6[_0x4f49('0x3a')][_0x4f49('0x3c')]?_0x1eaac6[_0x4f49('0x3a')]:_0x35aa33[_0x4f49('0x35')];if(!_0x7a6ea0[_0x4f49('0x36')]['hasOwnProperty'](_0x4f49('0x3d'))){_0x1eaac6[_0x4f49('0x1e')]=qs[_0x4f49('0x1e')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1e')]);_0x1eaac6[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1d')]);}_0x1eaac6[_0x4f49('0x3e')]=qs[_0x4f49('0x3f')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3f')]);_0x1eaac6[_0x4f49('0x40')]=qs['filters'](_[_0x4f49('0x41')](_0x7a6ea0[_0x4f49('0x36')],_0x35aa33['filters']),_0x2ceda4);if(_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x42')]){_0x1eaac6['where']=_[_0x4f49('0x43')](_0x1eaac6[_0x4f49('0x40')],{'$or':_[_0x4f49('0x2f')](_0x2ceda4,function(_0x200b1d){if(_0x200b1d[_0x4f49('0x33')]!==_0x4f49('0x44')){var _0x29e910={};_0x29e910[_0x200b1d['name']]={'$like':'%'+_0x7a6ea0['query']['filter']+'%'};return _0x29e910;}})});}_0x1eaac6=_[_0x4f49('0x43')]({},_0x1eaac6,_0x7a6ea0[_0x4f49('0x45')]);var _0x2e4355={'where':_0x1eaac6[_0x4f49('0x40')]};return db[_0x4f49('0x30')][_0x4f49('0x20')](_0x2e4355)[_0x4f49('0x26')](function(_0x23720a){_0x173657[_0x4f49('0x20')]=_0x23720a;if(_0x7a6ea0['query']['includeAll']){_0x1eaac6[_0x4f49('0x46')]=[{'all':!![]}];}return db[_0x4f49('0x30')][_0x4f49('0x47')](_0x1eaac6);})['then'](function(_0x2d6b56){_0x173657['rows']=_0x2d6b56;return _0x173657;})['then'](respondWithFilteredResult(_0x5e7076,_0x1eaac6))[_0x4f49('0x48')](handleError(_0x5e7076,null));};exports[_0x4f49('0x49')]=function(_0x40eadc,_0x497cb8){var _0x287781={'raw':!![],'where':{'id':_0x40eadc['params']['id']}},_0x11b4df={};_0x11b4df[_0x4f49('0x35')]=_['keys'](db[_0x4f49('0x30')][_0x4f49('0x31')]);_0x11b4df[_0x4f49('0x36')]=_['keys'](_0x40eadc[_0x4f49('0x36')]);_0x11b4df[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],_0x11b4df[_0x4f49('0x36')]);_0x287781[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x40eadc[_0x4f49('0x36')]['fields']));_0x287781[_0x4f49('0x3a')]=_0x287781[_0x4f49('0x3a')]['length']?_0x287781[_0x4f49('0x3a')]:_0x11b4df['model'];if(_0x40eadc[_0x4f49('0x36')][_0x4f49('0x4a')]){_0x287781[_0x4f49('0x46')]=[{'all':!![]}];}_0x287781=_[_0x4f49('0x43')]({},_0x287781,_0x40eadc['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x287781)[_0x4f49('0x26')](handleEntityNotFound(_0x497cb8,null))[_0x4f49('0x26')](respondWithResult(_0x497cb8,null))[_0x4f49('0x48')](handleError(_0x497cb8,null));};exports[_0x4f49('0x4c')]=function(_0x37fdb7,_0xd282c){return db[_0x4f49('0x30')][_0x4f49('0x4c')](_0x37fdb7[_0x4f49('0x4d')],{})[_0x4f49('0x26')](function(_0x148031){var _0x2104d0=_0x37fdb7[_0x4f49('0x4e')][_0x4f49('0x28')]({'plain':!![]});if(!_0x2104d0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2104d0['role']===_0x4f49('0x4e')){var _0x197670=_0x148031[_0x4f49('0x28')]({'plain':!![]});var _0xe46c90=_0x4f49('0x4f');return db[_0x4f49('0x50')][_0x4f49('0x4b')]({'where':{'name':_0xe46c90,'userProfileId':_0x2104d0['userProfileId']},'raw':!![]})[_0x4f49('0x26')](function(_0x4ff0a2){if(_0x4ff0a2&&_0x4ff0a2[_0x4f49('0x51')]===0x0){return db[_0x4f49('0x52')][_0x4f49('0x4c')]({'name':_0x197670[_0x4f49('0x2c')],'resourceId':_0x197670['id'],'type':'DefaultReports','sectionId':_0x4ff0a2['id']},{})[_0x4f49('0x26')](function(){return _0x148031;});}else{return _0x148031;}})['catch'](function(_0x52d18c){logger[_0x4f49('0x2a')](_0x4f49('0x53'),_0x52d18c);throw _0x52d18c;});}return _0x148031;})[_0x4f49('0x26')](respondWithResult(_0xd282c,0xc9))[_0x4f49('0x48')](handleError(_0xd282c,null));};exports['update']=function(_0x599c51,_0xd7f47b){if(_0x599c51[_0x4f49('0x4d')]['id']){delete _0x599c51['body']['id'];}return db[_0x4f49('0x30')]['find']({'where':{'id':_0x599c51['params']['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0xd7f47b,null))['then'](saveUpdates(_0x599c51[_0x4f49('0x4d')],null))['then'](respondWithResult(_0xd7f47b,null))[_0x4f49('0x48')](handleError(_0xd7f47b,null));};exports[_0x4f49('0x27')]=function(_0x2472c9,_0x883408){return db[_0x4f49('0x30')][_0x4f49('0x4b')]({'where':{'id':_0x2472c9[_0x4f49('0x54')]['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0x883408,null))['then'](removeEntity(_0x883408,null))[_0x4f49('0x48')](handleError(_0x883408,null));};exports['preview']=function(_0x213608,_0x1f640d){var _0xc4fc6b=0xa;var _0x467f12=[_0x4f49('0x55'),_0x4f49('0x56'),'right_join',_0x4f49('0x57')];var _0xd3689c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x564bf5={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x21807e=function(_0x265988){return!_[_0x4f49('0x62')](['IS\x20NULL',_0x4f49('0x63'),_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x265988);};var _0x293839=function(_0x17b15){if(!_0x17b15||!_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x28ea73='(',_0x1b80f2=0x0;_0x1b80f2<_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')];_0x1b80f2+=0x1){_0x1b80f2>0x0&&(_0x28ea73+='\x20'+_0x17b15['operator']+'\x20');_0x28ea73+=_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]?_0x293839(_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]):_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x67')]+'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition']+(_0x21807e(_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition'])?'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x68')]:'');}return _0x28ea73+')';};var _0x4714c7={'where':{'id':_0x213608[_0x4f49('0x54')]['id']}},_0xf29378,_0xc7743e,_0x3f2f3f,_0x61a565,_0x297698;_0x4714c7=_[_0x4f49('0x43')]({},_0x4714c7,_0x213608['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x4714c7)[_0x4f49('0x26')](function(_0x2cdaa4){if(_0x2cdaa4){_0xf29378=_0x2cdaa4;return _0x2cdaa4['getFields']();}return null;})['then'](function(_0x28e8ae){if(_0x28e8ae){if(!_0x28e8ae['length']){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0xc7743e=_0x28e8ae;return db[_0x4f49('0x6c')][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x179431){if(_0x179431){_0x3f2f3f=_[_0x4f49('0x6d')](_0x179431,'id');var _0x3823f0;var _0x3e9b47=squel[_0x4f49('0x6e')]();_0x3e9b47[_0x4f49('0x6f')](_0xf29378[_0x4f49('0x70')]);for(var _0xd53de8=0x0;_0xd53de8<_0xc7743e[_0x4f49('0x3c')];_0xd53de8+=0x1){_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x71')]?_0x3f2f3f[_0xc7743e[_0xd53de8][_0x4f49('0x71')]][_0x4f49('0x72')]:_0xc7743e[_0xd53de8][_0x4f49('0x67')];_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0xd3689c[_0xc7743e[_0xd53de8][_0x4f49('0x73')]],'%s',_0x3823f0):_0x3823f0;_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x564bf5[_0xc7743e[_0xd53de8][_0x4f49('0x75')]],'%s',_0x3823f0):_0x3823f0;if(_0xc7743e[_0xd53de8]['groupBy']){_0x3e9b47[_0x4f49('0x66')](_0x3823f0);}_0xc7743e[_0xd53de8]['orderBy']&&_0x3e9b47[_0x4f49('0x3e')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x76')]===_0x4f49('0x77')?![]:!![]);_0x3e9b47[_0x4f49('0x67')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x78')]||_0x3823f0);}if(_0xf29378[_0x4f49('0x79')]){_0xf29378[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0xf29378[_0x4f49('0x79')]);for(var _0x541ac6=0x0;_0x541ac6<_0xf29378['joins'][_0x4f49('0x3c')];_0x541ac6+=0x1){if(_0xf29378['joins'][_0x541ac6][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x467f12,_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')])&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['parentKey']&&_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')]&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['foreignKey']){_0x3e9b47[_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')]](_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')],null,util['format'](_0x4f49('0x7c'),_0xf29378[_0x4f49('0x70')],_0xf29378['joins'][_0x541ac6][_0x4f49('0x7d')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7b')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7e')]));}}}if(_0xf29378[_0x4f49('0x7f')]){_0xf29378['conditions']=JSON[_0x4f49('0x7a')](_0xf29378['conditions']);_0x3e9b47[_0x4f49('0x40')](_0x293839(_0xf29378['conditions'][_0x4f49('0x66')]));}_0x297698=_0x3e9b47['clone']();_0x3e9b47[_0x4f49('0x1e')](_0xc4fc6b);_0x3e9b47[_0x4f49('0x1d')](0x0);logger[_0x4f49('0x80')](_0x4f49('0x81'),_0x3e9b47['toString']());return dbH[_0x4f49('0x82')]['query'](_0x3e9b47[_0x4f49('0x83')](),{'type':dbH['sequelize'][_0x4f49('0x84')]['SELECT']});}})['then'](respondWithResult(_0x1f640d,null))[_0x4f49('0x48')](handleError(_0x1f640d,null));};function runReport(_0x20b2be,_0x16cb4d,_0x4c0e7a){var _0x289810=_0x16cb4d[_0x4f49('0x2c')];var _0x5c33c9=0xa;var _0x5d52ae=['join',_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x87439={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x2902a1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x389679=function(_0x5304c3){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),'IS\x20NOT\x20NULL',_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x5304c3);};var _0x351a33=function(_0x4d72a0){if(!_0x4d72a0||!_0x4d72a0[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x2ef19e='(',_0x6ad599=0x0;_0x6ad599<_0x4d72a0[_0x4f49('0x65')]['length'];_0x6ad599+=0x1){_0x6ad599>0x0&&(_0x2ef19e+='\x20'+_0x4d72a0[_0x4f49('0x8a')]+'\x20');_0x2ef19e+=_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x66')]?_0x351a33(_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['group']):_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['field']+'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['condition']+(_0x389679(_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x8b')])?'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x68')]:'');}return _0x2ef19e+')';};var _0x111e90={'where':{'id':_0x20b2be['id']}},_0xd253ed,_0x323a3a,_0xe0adc3,_0x3a26ff,_0x64f0ee;_0x111e90=_['merge']({},_0x111e90,_0x4c0e7a);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x111e90)[_0x4f49('0x26')](function(_0x299849){if(_0x299849){_0xd253ed=_0x299849;return _0x299849[_0x4f49('0x8c')]();}return null;})[_0x4f49('0x26')](function(_0x55b28b){if(_0x55b28b){if(!_0x55b28b[_0x4f49('0x3c')]){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x323a3a=_0x55b28b;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})['then'](function(_0x3c4e88){if(_0x3c4e88){_0xe0adc3=_[_0x4f49('0x6d')](_0x3c4e88,'id');var _0x5c5d2;var _0xa880a2=squel['select']();_0xa880a2[_0x4f49('0x6f')](_0xd253ed[_0x4f49('0x70')]);for(var _0x11c0a0=0x0;_0x11c0a0<_0x323a3a[_0x4f49('0x3c')];_0x11c0a0+=0x1){_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x71')]?_0xe0adc3[_0x323a3a[_0x11c0a0][_0x4f49('0x71')]][_0x4f49('0x72')]:_0x323a3a[_0x11c0a0][_0x4f49('0x67')];_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0x87439[_0x323a3a[_0x11c0a0][_0x4f49('0x73')]],'%s',_0x5c5d2):_0x5c5d2;_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x2902a1[_0x323a3a[_0x11c0a0][_0x4f49('0x75')]],'%s',_0x5c5d2):_0x5c5d2;if(_0x323a3a[_0x11c0a0][_0x4f49('0x8d')]){_0xa880a2[_0x4f49('0x66')](_0x5c5d2);}_0x323a3a[_0x11c0a0][_0x4f49('0x76')]&&_0xa880a2[_0x4f49('0x3e')](_0x5c5d2,_0x323a3a[_0x11c0a0]['orderBy']===_0x4f49('0x77')?![]:!![]);_0xa880a2[_0x4f49('0x67')](_0x5c5d2,_0x323a3a[_0x11c0a0][_0x4f49('0x78')]||_0x5c5d2);}if(_0xd253ed[_0x4f49('0x79')]){_0xd253ed['joins']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x79')]);for(var _0x594460=0x0;_0x594460<_0xd253ed[_0x4f49('0x79')]['length'];_0x594460+=0x1){if(_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x5d52ae,_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')])&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7d')]&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')]&&_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']){_0xa880a2[_0xd253ed['joins'][_0x594460][_0x4f49('0x33')]](_0xd253ed['joins'][_0x594460][_0x4f49('0x7b')],null,util[_0x4f49('0x75')]('%s.%s\x20=\x20%s.%s',_0xd253ed['table'],_0xd253ed[_0x4f49('0x79')][_0x594460]['parentKey'],_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')],_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']));}}}if(_0xd253ed[_0x4f49('0x7f')]){_0xd253ed['conditions']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x7f')]);_0xa880a2[_0x4f49('0x40')](_0x351a33(_0xd253ed['conditions'][_0x4f49('0x66')]));}_0x64f0ee=_0xa880a2[_0x4f49('0x8e')]();_0xa880a2[_0x4f49('0x1e')](_0x5c33c9);_0xa880a2['offset'](0x0);return;}})['then'](function(){if(_0x16cb4d[_0x4f49('0x8f')]==='web'){return null;}var _0x2bc9df=_[_0x4f49('0x43')](_0x16cb4d,{'name':_0x16cb4d[_0x4f49('0x90')]||_0x16cb4d['name']||_0xd253ed[_0x4f49('0x2c')],'basename':_0x289810,'savename':util['format'](_0x4f49('0x91'),_0x16cb4d[_0x4f49('0x2c')]||_0xd253ed[_0x4f49('0x2c')],require('randomstring')[_0x4f49('0x92')](0x4),_0x16cb4d[_0x4f49('0x8f')]||_0x4f49('0x93')),'reportId':_0xd253ed['id'],'reportType':_0x4f49('0x94')});return db[_0x4f49('0x95')][_0x4f49('0x4c')](_0x2bc9df,{'raw':!![]});})['then'](function(_0x5b6ac7){if(_0xd253ed[_0x4f49('0x70')]===_0x4f49('0x96')){_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+_0x4f49('0x97'),_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}else{_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}if(_0x5b6ac7){logger[_0x4f49('0x9a')]('Run\x20Query:',_0x64f0ee[_0x4f49('0x83')]());require(_0x4f49('0x9b'))[_0x4f49('0x9c')](path['join'](__dirname,_0x4f49('0x9d'),_0x5b6ac7[_0x4f49('0x8f')]),[_0x5b6ac7['id'],_0x64f0ee[_0x4f49('0x83')](),path['join'](__dirname,_0x4f49('0x9e'),_0x5b6ac7[_0x4f49('0x9f')]),_0x289810]);return _0x5b6ac7;}else{var _0x5efb11=squel['select']();_0x5efb11[_0x4f49('0x6f')]('('+_0x64f0ee[_0x4f49('0x83')]()+')',_0x4f49('0xa0'));_0x5efb11[_0x4f49('0x67')](_0x4f49('0xa1'),_0x4f49('0x20'));_0x64f0ee['limit'](_0x16cb4d['limit']||_0x5c33c9);_0x64f0ee['offset'](_0x16cb4d[_0x4f49('0x1d')]||0x0);return dbH[_0x4f49('0x82')]['query'](_0x5efb11[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')]['SELECT']})['then'](function(_0x3633b5){if(!_0x3633b5['length']){_0x3a26ff=0x0;}else{_0x3a26ff=_0x3633b5[0x0][_0x4f49('0x20')]||0x0;}return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x64f0ee[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')]['QueryTypes'][_0x4f49('0xa2')]});})[_0x4f49('0x26')](function(_0x45c938){return{'rows':_0x45c938||[],'count':_0x3a26ff};});}});}exports[_0x4f49('0xa3')]=function(_0x4a4d75,_0x93e85d){return runReport(_0x4a4d75[_0x4f49('0x54')],_0x4a4d75['query'],_0x4a4d75[_0x4f49('0x45')])[_0x4f49('0x26')](respondWithResult(_0x93e85d,null))[_0x4f49('0x48')](handleError(_0x93e85d,null));};exports[_0x4f49('0xa4')]=runReport;exports[_0x4f49('0x36')]=function(_0x40991b,_0x56290f){var _0x4994b6=0xa;var _0x1c7d87=[_0x4f49('0x55'),_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x5cd00a={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0xd876f1={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x1ae2c9=function(_0x566634){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),_0x4f49('0x63'),'IS\x20EMPTY',_0x4f49('0xa5')],_0x566634);};var _0x541dc2=function(_0x4061bf){if(!_0x4061bf||!_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x1bc18d='(',_0x5e6103=0x0;_0x5e6103<_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')];_0x5e6103+=0x1){_0x5e6103>0x0&&(_0x1bc18d+='\x20'+_0x4061bf[_0x4f49('0x8a')]+'\x20');_0x1bc18d+=_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]?_0x541dc2(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]):_0x4061bf[_0x4f49('0x65')][_0x5e6103]['field']+'\x20'+_0x4061bf['rules'][_0x5e6103][_0x4f49('0x8b')]+(_0x1ae2c9(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x8b')])?'\x20'+_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x68')]:'');}return _0x1bc18d+')';};var _0x29dbab={'where':{'id':_0x40991b[_0x4f49('0x54')]['id']}},_0x5f459b,_0x1d090f,_0x37d2f4,_0x5bcb36,_0x3f04fa;_0x29dbab=_[_0x4f49('0x43')]({},_0x29dbab,_0x40991b['options']);return db['AnalyticDefaultReport'][_0x4f49('0x4b')](_0x29dbab)[_0x4f49('0x26')](function(_0x200848){if(_0x200848){_0x5f459b=_0x200848;return _0x200848['getFields']();}return null;})[_0x4f49('0x26')](function(_0x48f4bc){if(_0x48f4bc){if(!_0x48f4bc[_0x4f49('0x3c')]){throw new db['Sequelize'][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x1d090f=_0x48f4bc;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x513bc9){if(_0x513bc9){_0x37d2f4=_[_0x4f49('0x6d')](_0x513bc9,'id');var _0x47567c;var _0x5f1538=squel[_0x4f49('0x6e')]();_0x5f1538[_0x4f49('0x6f')](_0x5f459b[_0x4f49('0x70')]);for(var _0xd91e48=0x0;_0xd91e48<_0x1d090f[_0x4f49('0x3c')];_0xd91e48+=0x1){_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x71')]?_0x37d2f4[_0x1d090f[_0xd91e48]['MetricId']][_0x4f49('0x72')]:_0x1d090f[_0xd91e48][_0x4f49('0x67')];_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x73')]?_['replace'](_0x5cd00a[_0x1d090f[_0xd91e48][_0x4f49('0x73')]],'%s',_0x47567c):_0x47567c;_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0xd876f1[_0x1d090f[_0xd91e48][_0x4f49('0x75')]],'%s',_0x47567c):_0x47567c;if(_0x1d090f[_0xd91e48][_0x4f49('0x8d')]){_0x5f1538[_0x4f49('0x66')](_0x47567c);}_0x1d090f[_0xd91e48][_0x4f49('0x76')]&&_0x5f1538['order'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x76')]==='DESC'?![]:!![]);_0x5f1538['field'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x78')]||_0x47567c);}if(_0x5f459b['joins']){_0x5f459b[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x79')]);for(var _0x85eb3f=0x0;_0x85eb3f<_0x5f459b[_0x4f49('0x79')][_0x4f49('0x3c')];_0x85eb3f+=0x1){if(_0x5f459b['joins'][_0x85eb3f][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x1c7d87,_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')])&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')]&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable']&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]){_0x5f1538[_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')]](_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7b')],null,util[_0x4f49('0x75')](_0x4f49('0x7c'),_0x5f459b[_0x4f49('0x70')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable'],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]));}}}if(_0x5f459b['conditions']){_0x5f459b[_0x4f49('0x7f')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x7f')]);_0x5f1538[_0x4f49('0x40')](_0x541dc2(_0x5f459b[_0x4f49('0x7f')][_0x4f49('0x66')]));}_0x3f04fa=_0x5f1538['clone']();_0x5f1538['limit'](_0x4994b6);_0x5f1538['offset'](0x0);logger['debug'](_0x4f49('0x81'),_0x5f1538['toString']());return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x5f1538[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')][_0x4f49('0xa2')]});}})['then'](function(){return{'sql':_0x3f04fa[_0x4f49('0x83')]()};})['then'](respondWithResult(_0x56290f,null))[_0x4f49('0x48')](handleError(_0x56290f,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index f33d4c9..95e5b66 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 _0x0759=['api','bluebird','request-promise','path','rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','util'];(function(_0x5a7dcf,_0x233849){var _0x5ca6b6=function(_0x1aef7d){while(--_0x1aef7d){_0x5a7dcf['push'](_0x5a7dcf['shift']());}};_0x5ca6b6(++_0x233849);}(_0x0759,0x167));var _0x9075=function(_0x3926d,_0x4e2a07){_0x3926d=_0x3926d-0x0;var _0x1add48=_0x0759[_0x3926d];return _0x1add48;};'use strict';var _=require('lodash');var util=require(_0x9075('0x0'));var logger=require('../../config/logger')(_0x9075('0x1'));var moment=require('moment');var BPromise=require(_0x9075('0x2'));var rp=require(_0x9075('0x3'));var fs=require('fs');var path=require(_0x9075('0x4'));var rimraf=require(_0x9075('0x5'));var config=require('../../config/environment');var attributes=require(_0x9075('0x6'));module[_0x9075('0x7')]=function(_0x17a95c,_0x5b4abe){return _0x17a95c[_0x9075('0x8')](_0x9075('0x9'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5e39=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','AnalyticDefaultReport','analytics_default_reports','util'];(function(_0x3f14cc,_0x4ec13e){var _0x494737=function(_0x1bd326){while(--_0x1bd326){_0x3f14cc['push'](_0x3f14cc['shift']());}};_0x494737(++_0x4ec13e);}(_0x5e39,0x78));var _0x95e3=function(_0x34cf01,_0x226b5c){_0x34cf01=_0x34cf01-0x0;var _0x3d3fca=_0x5e39[_0x34cf01];return _0x3d3fca;};'use strict';var _=require('lodash');var util=require(_0x95e3('0x0'));var logger=require(_0x95e3('0x1'))(_0x95e3('0x2'));var moment=require('moment');var BPromise=require(_0x95e3('0x3'));var rp=require(_0x95e3('0x4'));var fs=require('fs');var path=require(_0x95e3('0x5'));var rimraf=require(_0x95e3('0x6'));var config=require(_0x95e3('0x7'));var attributes=require('./analyticDefaultReport.attributes');module[_0x95e3('0x8')]=function(_0xc40ba7,_0x56a7b9){return _0xc40ba7['define'](_0x95e3('0x9'),attributes,{'tableName':_0x95e3('0xa'),'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 f190ac9..b0c1e3e 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 _0x27bd=['then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x212a37,_0xf35b2e){var _0x5d0bf9=function(_0x51850f){while(--_0x51850f){_0x212a37['push'](_0x212a37['shift']());}};_0x5d0bf9(++_0xf35b2e);}(_0x27bd,0x12a));var _0xd27b=function(_0xbd82fc,_0xca905c){_0xbd82fc=_0xbd82fc-0x0;var _0x4859ed=_0x27bd[_0xbd82fc];return _0x4859ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd27b('0x0'));var BPromise=require('bluebird');var rs=require(_0xd27b('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd27b('0x2'))(_0xd27b('0x3'));var config=require(_0xd27b('0x4'));var jayson=require(_0xd27b('0x5'));var client=jayson['client'][_0xd27b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x468dbb,_0x2bc99c,_0x53d04f){return new BPromise(function(_0xec0675,_0x513b20){return client[_0xd27b('0x7')](_0x468dbb,_0x53d04f)[_0xd27b('0x8')](function(_0x59c160){logger[_0xd27b('0x9')](_0xd27b('0xa'),_0x2bc99c,_0xd27b('0xb'));logger[_0xd27b('0xc')](_0xd27b('0xd'),_0x2bc99c,_0xd27b('0xb'),JSON['stringify'](_0x59c160));if(_0x59c160['error']){if(_0x59c160[_0xd27b('0xe')]['code']===0x1f4){logger[_0xd27b('0xe')](_0xd27b('0xa'),_0x2bc99c,_0x59c160[_0xd27b('0xe')][_0xd27b('0xf')]);return _0x513b20(_0x59c160['error'][_0xd27b('0xf')]);}logger['error'](_0xd27b('0xa'),_0x2bc99c,_0x59c160[_0xd27b('0xe')][_0xd27b('0xf')]);return _0xec0675(_0x59c160[_0xd27b('0xe')]['message']);}else{logger[_0xd27b('0x9')](_0xd27b('0xa'),_0x2bc99c,_0xd27b('0xb'));_0xec0675(_0x59c160[_0xd27b('0x10')]['message']);}})[_0xd27b('0x11')](function(_0x250ed3){logger[_0xd27b('0xe')](_0xd27b('0xa'),_0x2bc99c,_0x250ed3);_0x513b20(_0x250ed3);});});}
\ No newline at end of file
+var _0x3c67=['request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x241066,_0x259d25){var _0x154003=function(_0x6b9d0d){while(--_0x6b9d0d){_0x241066['push'](_0x241066['shift']());}};_0x154003(++_0x259d25);}(_0x3c67,0x10d));var _0x73c6=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x3c67[_0x255d5b];return _0x3e141a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x73c6('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x73c6('0x1'));var db=require(_0x73c6('0x2'))['db'];var utils=require(_0x73c6('0x3'));var logger=require(_0x73c6('0x4'))(_0x73c6('0x5'));var config=require(_0x73c6('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x73c6('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c1687,_0x1a93ca,_0x138b69){return new BPromise(function(_0x18df16,_0x102f07){return client[_0x73c6('0x8')](_0x2c1687,_0x138b69)[_0x73c6('0x9')](function(_0x10dda3){logger['info'](_0x73c6('0xa'),_0x1a93ca,_0x73c6('0xb'));logger[_0x73c6('0xc')](_0x73c6('0xd'),_0x1a93ca,'request\x20sent',JSON[_0x73c6('0xe')](_0x10dda3));if(_0x10dda3['error']){if(_0x10dda3[_0x73c6('0xf')]['code']===0x1f4){logger[_0x73c6('0xf')](_0x73c6('0xa'),_0x1a93ca,_0x10dda3['error'][_0x73c6('0x10')]);return _0x102f07(_0x10dda3['error']['message']);}logger[_0x73c6('0xf')](_0x73c6('0xa'),_0x1a93ca,_0x10dda3[_0x73c6('0xf')][_0x73c6('0x10')]);return _0x18df16(_0x10dda3[_0x73c6('0xf')][_0x73c6('0x10')]);}else{logger[_0x73c6('0x11')](_0x73c6('0xa'),_0x1a93ca,'request\x20sent');_0x18df16(_0x10dda3[_0x73c6('0x12')]['message']);}})[_0x73c6('0x13')](function(_0x34ba56){logger['error'](_0x73c6('0xa'),_0x1a93ca,_0x34ba56);_0x102f07(_0x34ba56);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index c951d06..d0e0a7a 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 _0xc21d=['../../config/environment','get','isAuthenticated','/:id','show','/:id/preview','/:id/run','run','/:id/query','query','post','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x68359d,_0x51477f){var _0x15d875=function(_0x5efef8){while(--_0x5efef8){_0x68359d['push'](_0x68359d['shift']());}};_0x15d875(++_0x51477f);}(_0xc21d,0xdf));var _0xdc21=function(_0x29678a,_0xd09044){_0x29678a=_0x29678a-0x0;var _0xd762b6=_0xc21d[_0x29678a];return _0xd762b6;};'use strict';var multer=require(_0xdc21('0x0'));var util=require(_0xdc21('0x1'));var path=require(_0xdc21('0x2'));var timeout=require('connect-timeout');var express=require(_0xdc21('0x3'));var router=express[_0xdc21('0x4')]();var fs_extra=require(_0xdc21('0x5'));var auth=require(_0xdc21('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdc21('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0xdc21('0x8')]('/',auth[_0xdc21('0x9')](),controller['index']);router['get'](_0xdc21('0xa'),auth[_0xdc21('0x9')](),controller[_0xdc21('0xb')]);router[_0xdc21('0x8')](_0xdc21('0xc'),auth[_0xdc21('0x9')](),controller['preview']);router['get'](_0xdc21('0xd'),auth['isAuthenticated'](),controller[_0xdc21('0xe')]);router[_0xdc21('0x8')](_0xdc21('0xf'),auth[_0xdc21('0x9')](),controller[_0xdc21('0x10')]);router[_0xdc21('0x11')]('/',auth[_0xdc21('0x9')](),controller[_0xdc21('0x12')]);router[_0xdc21('0x13')](_0xdc21('0xa'),auth[_0xdc21('0x9')](),controller[_0xdc21('0x14')]);router['delete'](_0xdc21('0xa'),auth[_0xdc21('0x9')](),controller[_0xdc21('0x15')]);module[_0xdc21('0x16')]=router;
\ No newline at end of file
+var _0x204c=['show','/:id/preview','isAuthenticated','/:id/run','run','query','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id'];(function(_0xa6fdc4,_0x592600){var _0x54cd78=function(_0x280660){while(--_0x280660){_0xa6fdc4['push'](_0xa6fdc4['shift']());}};_0x54cd78(++_0x592600);}(_0x204c,0xdc));var _0xc204=function(_0x599c13,_0x3a49c6){_0x599c13=_0x599c13-0x0;var _0x163768=_0x204c[_0x599c13];return _0x163768;};'use strict';var multer=require(_0xc204('0x0'));var util=require(_0xc204('0x1'));var path=require(_0xc204('0x2'));var timeout=require(_0xc204('0x3'));var express=require(_0xc204('0x4'));var router=express[_0xc204('0x5')]();var fs_extra=require(_0xc204('0x6'));var auth=require(_0xc204('0x7'));var interaction=require(_0xc204('0x8'));var config=require(_0xc204('0x9'));var controller=require(_0xc204('0xa'));router[_0xc204('0xb')]('/',auth['isAuthenticated'](),controller[_0xc204('0xc')]);router[_0xc204('0xb')](_0xc204('0xd'),auth['isAuthenticated'](),controller[_0xc204('0xe')]);router['get'](_0xc204('0xf'),auth[_0xc204('0x10')](),controller['preview']);router[_0xc204('0xb')](_0xc204('0x11'),auth[_0xc204('0x10')](),controller[_0xc204('0x12')]);router[_0xc204('0xb')]('/:id/query',auth[_0xc204('0x10')](),controller[_0xc204('0x13')]);router[_0xc204('0x14')]('/',auth['isAuthenticated'](),controller[_0xc204('0x15')]);router['put']('/:id',auth[_0xc204('0x10')](),controller[_0xc204('0x16')]);router[_0xc204('0x17')]('/:id',auth[_0xc204('0x10')](),controller[_0xc204('0x18')]);module[_0xc204('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index fbdfe34..2a73597 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 _0x9f58=['pdf','xlsx','csv','DATE','Loading','manual','scheduled','UNSIGNED','sequelize','moment','exports','STRING','ENUM'];(function(_0x2c931f,_0x12d1c9){var _0x5f1470=function(_0x3b5d03){while(--_0x3b5d03){_0x2c931f['push'](_0x2c931f['shift']());}};_0x5f1470(++_0x12d1c9);}(_0x9f58,0x167));var _0x89f5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9f58[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x89f5('0x0'));var moment=require(_0x89f5('0x1'));module[_0x89f5('0x2')]={'name':{'type':Sequelize[_0x89f5('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x89f5('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x89f5('0x4')]('csv',_0x89f5('0x5'),_0x89f5('0x6')),'allowNull':![],'defaultValue':_0x89f5('0x7')},'savename':{'type':Sequelize[_0x89f5('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x89f5('0x8')]},'status':{'type':Sequelize[_0x89f5('0x3')],'defaultValue':_0x89f5('0x9')},'type':{'type':Sequelize[_0x89f5('0x4')](_0x89f5('0xa'),_0x89f5('0xb')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x89f5('0xc')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0e1e=['Loading','manual','scheduled','INTEGER','UNSIGNED','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE'];(function(_0x3ed0df,_0x1c8083){var _0x47cee4=function(_0x11e879){while(--_0x11e879){_0x3ed0df['push'](_0x3ed0df['shift']());}};_0x47cee4(++_0x1c8083);}(_0x0e1e,0x7a));var _0xe0e1=function(_0x579982,_0x4efe5b){_0x579982=_0x579982-0x0;var _0x1e6345=_0x0e1e[_0x579982];return _0x1e6345;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xe0e1('0x0'));module[_0xe0e1('0x1')]={'name':{'type':Sequelize[_0xe0e1('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xe0e1('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xe0e1('0x3')](_0xe0e1('0x4'),_0xe0e1('0x5'),_0xe0e1('0x6')),'allowNull':![],'defaultValue':_0xe0e1('0x4')},'savename':{'type':Sequelize[_0xe0e1('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xe0e1('0x7')]},'endDate':{'type':Sequelize[_0xe0e1('0x7')]},'status':{'type':Sequelize[_0xe0e1('0x2')],'defaultValue':_0xe0e1('0x8')},'type':{'type':Sequelize[_0xe0e1('0x3')](_0xe0e1('0x9'),_0xe0e1('0xa')),'allowNull':![],'defaultValue':_0xe0e1('0x9')},'reportId':{'type':Sequelize[_0xe0e1('0xb')](0xb)[_0xe0e1('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 73dcd7c..b7aa167 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 _0xefe2=['key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','existsSync','join','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','output','eml-format','zip-dir','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','get','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xefe2,0x19f));var _0x2efe=function(_0x101013,_0x1c64ed){_0x101013=_0x101013-0x0;var _0x40d26b=_0xefe2[_0x101013];return _0x40d26b;};'use strict';var emlformat=require(_0x2efe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2efe('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2efe('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2efe('0x3'));var util=require(_0x2efe('0x4'));var path=require('path');var sox=require(_0x2efe('0x5'));var csv=require(_0x2efe('0x6'));var ejs=require(_0x2efe('0x7'));var fs=require('fs');var fs_extra=require(_0x2efe('0x8'));var _=require('lodash');var squel=require(_0x2efe('0x9'));var crypto=require(_0x2efe('0xa'));var jsforce=require(_0x2efe('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2efe('0x6'));var querystring=require('querystring');var Papa=require(_0x2efe('0xc'));var Redis=require(_0x2efe('0xd'));var authService=require(_0x2efe('0xe'));var qs=require(_0x2efe('0xf'));var as=require(_0x2efe('0x10'));var hardwareService=require(_0x2efe('0x11'));var logger=require('../../config/logger')(_0x2efe('0x12'));var utils=require(_0x2efe('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2efe('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x404a96,_0x291719){_0x291719=_0x291719||0xcc;return function(_0x3bda91){if(_0x3bda91){return _0x404a96[_0x2efe('0x15')](_0x291719);}return _0x404a96[_0x2efe('0x16')](_0x291719)[_0x2efe('0x17')]();};}function respondWithResult(_0x25b2c2,_0x4bab36){_0x4bab36=_0x4bab36||0xc8;return function(_0x39a608){if(_0x39a608){return _0x25b2c2[_0x2efe('0x16')](_0x4bab36)[_0x2efe('0x18')](_0x39a608);}};}function respondWithFilteredResult(_0x5f158b,_0xd8c448){return function(_0x4e5bb){if(_0x4e5bb){var _0x30b43b=typeof _0xd8c448[_0x2efe('0x19')]===_0x2efe('0x1a')&&typeof _0xd8c448[_0x2efe('0x1b')]==='undefined';var _0x3f70be=_0x4e5bb['count'];var _0x10c5a8=_0x30b43b?0x0:_0xd8c448[_0x2efe('0x19')];var _0x8652eb=_0x30b43b?_0x4e5bb[_0x2efe('0x1c')]:_0xd8c448[_0x2efe('0x19')]+_0xd8c448[_0x2efe('0x1b')];var _0x333abb;if(_0x8652eb>=_0x3f70be){_0x8652eb=_0x3f70be;_0x333abb=0xc8;}else{_0x333abb=0xce;}_0x5f158b[_0x2efe('0x16')](_0x333abb);return _0x5f158b[_0x2efe('0x1d')]('Content-Range',_0x10c5a8+'-'+_0x8652eb+'/'+_0x3f70be)[_0x2efe('0x18')](_0x4e5bb);}return null;};}function patchUpdates(_0x3647fc){return function(_0x326321){try{jsonpatch[_0x2efe('0x1e')](_0x326321,_0x3647fc,!![]);}catch(_0x95049b){return BPromise[_0x2efe('0x1f')](_0x95049b);}return _0x326321[_0x2efe('0x20')]();};}function saveUpdates(_0x32a55a,_0x390ba3){return function(_0x5accf3){if(_0x5accf3){return _0x5accf3['update'](_0x32a55a)[_0x2efe('0x21')](function(_0x3cfe31){return _0x3cfe31;});}return null;};}function removeEntity(_0x1452be,_0x33cb7f){return function(_0x1c9b64){if(_0x1c9b64){return _0x1c9b64[_0x2efe('0x22')]()[_0x2efe('0x21')](function(){var _0x5e6d5=_0x1c9b64[_0x2efe('0x23')]({'plain':!![]});var _0x2c54d5='ExtractedReports';return db['UserProfileResource'][_0x2efe('0x22')]({'where':{'type':_0x2c54d5,'resourceId':_0x5e6d5['id']}})[_0x2efe('0x21')](function(){return _0x1c9b64;});})[_0x2efe('0x21')](function(){_0x1452be[_0x2efe('0x16')](0xcc)[_0x2efe('0x17')]();});}};}function handleEntityNotFound(_0x1fcf9b,_0x5aecb4){return function(_0x5150a4){if(!_0x5150a4){_0x1fcf9b['sendStatus'](0x194);}return _0x5150a4;};}function handleError(_0x48990c,_0x147439){_0x147439=_0x147439||0x1f4;return function(_0x4a02fa){logger['error'](_0x4a02fa[_0x2efe('0x24')]);if(_0x4a02fa[_0x2efe('0x25')]){delete _0x4a02fa['name'];}_0x48990c[_0x2efe('0x16')](_0x147439)[_0x2efe('0x26')](_0x4a02fa);};}exports[_0x2efe('0x27')]=function(_0x3fe097,_0x272734){var _0x4decdb={},_0x48d07b={},_0x1c1a17={'count':0x0,'rows':[]};var _0x2a3d35=_[_0x2efe('0x28')](db[_0x2efe('0x29')][_0x2efe('0x2a')],function(_0x397cef){return{'name':_0x397cef[_0x2efe('0x2b')],'type':_0x397cef[_0x2efe('0x2c')][_0x2efe('0x2d')]};});_0x48d07b['model']=_['map'](_0x2a3d35,_0x2efe('0x25'));_0x48d07b[_0x2efe('0x2e')]=_[_0x2efe('0x2f')](_0x3fe097[_0x2efe('0x2e')]);_0x48d07b[_0x2efe('0x30')]=_[_0x2efe('0x31')](_0x48d07b[_0x2efe('0x32')],_0x48d07b['query']);_0x4decdb[_0x2efe('0x33')]=_['intersection'](_0x48d07b[_0x2efe('0x32')],qs[_0x2efe('0x34')](_0x3fe097[_0x2efe('0x2e')][_0x2efe('0x34')]));_0x4decdb['attributes']=_0x4decdb[_0x2efe('0x33')][_0x2efe('0x35')]?_0x4decdb[_0x2efe('0x33')]:_0x48d07b[_0x2efe('0x32')];if(!_0x3fe097[_0x2efe('0x2e')][_0x2efe('0x36')](_0x2efe('0x37'))){_0x4decdb[_0x2efe('0x1b')]=qs['limit'](_0x3fe097[_0x2efe('0x2e')]['limit']);_0x4decdb['offset']=qs[_0x2efe('0x19')](_0x3fe097[_0x2efe('0x2e')][_0x2efe('0x19')]);}_0x4decdb[_0x2efe('0x38')]=qs[_0x2efe('0x39')](_0x3fe097[_0x2efe('0x2e')][_0x2efe('0x39')]);_0x4decdb[_0x2efe('0x3a')]=qs[_0x2efe('0x30')](_['pick'](_0x3fe097[_0x2efe('0x2e')],_0x48d07b[_0x2efe('0x30')]),_0x2a3d35);if(_0x3fe097[_0x2efe('0x2e')][_0x2efe('0x3b')]){_0x4decdb['where']=_[_0x2efe('0x3c')](_0x4decdb[_0x2efe('0x3a')],{'$or':_[_0x2efe('0x28')](_0x2a3d35,function(_0xdd9e87){if(_0xdd9e87[_0x2efe('0x2c')]!==_0x2efe('0x3d')){var _0x410a1b={};_0x410a1b[_0xdd9e87['name']]={'$like':'%'+_0x3fe097['query']['filter']+'%'};return _0x410a1b;}})});}_0x4decdb=_[_0x2efe('0x3c')]({},_0x4decdb,_0x3fe097[_0x2efe('0x3e')]);var _0x267bdc={'where':_0x4decdb['where']};return db[_0x2efe('0x29')][_0x2efe('0x1c')](_0x267bdc)[_0x2efe('0x21')](function(_0x188c21){_0x1c1a17[_0x2efe('0x1c')]=_0x188c21;if(_0x3fe097['query'][_0x2efe('0x3f')]){_0x4decdb[_0x2efe('0x40')]=[{'all':!![]}];}return db[_0x2efe('0x29')][_0x2efe('0x41')](_0x4decdb);})['then'](function(_0x18629d){_0x1c1a17[_0x2efe('0x42')]=_0x18629d;return _0x1c1a17;})[_0x2efe('0x21')](respondWithFilteredResult(_0x272734,_0x4decdb))['catch'](handleError(_0x272734,null));};exports[_0x2efe('0x43')]=function(_0x2eca8a,_0x18c125){var _0x57c1bd={'raw':!![],'where':{'id':_0x2eca8a[_0x2efe('0x44')]['id']}},_0x30e94c={};_0x30e94c['model']=_[_0x2efe('0x2f')](db['AnalyticExtractedReport'][_0x2efe('0x2a')]);_0x30e94c[_0x2efe('0x2e')]=_[_0x2efe('0x2f')](_0x2eca8a[_0x2efe('0x2e')]);_0x30e94c[_0x2efe('0x30')]=_[_0x2efe('0x31')](_0x30e94c[_0x2efe('0x32')],_0x30e94c[_0x2efe('0x2e')]);_0x57c1bd['attributes']=_[_0x2efe('0x31')](_0x30e94c['model'],qs[_0x2efe('0x34')](_0x2eca8a[_0x2efe('0x2e')]['fields']));_0x57c1bd['attributes']=_0x57c1bd[_0x2efe('0x33')][_0x2efe('0x35')]?_0x57c1bd[_0x2efe('0x33')]:_0x30e94c['model'];if(_0x2eca8a[_0x2efe('0x2e')]['includeAll']){_0x57c1bd[_0x2efe('0x40')]=[{'all':!![]}];}_0x57c1bd=_[_0x2efe('0x3c')]({},_0x57c1bd,_0x2eca8a[_0x2efe('0x3e')]);return db[_0x2efe('0x29')][_0x2efe('0x45')](_0x57c1bd)[_0x2efe('0x21')](handleEntityNotFound(_0x18c125,null))['then'](respondWithResult(_0x18c125,null))[_0x2efe('0x46')](handleError(_0x18c125,null));};exports[_0x2efe('0x47')]=function(_0xdfcdfc,_0xf5cb32){return db[_0x2efe('0x29')][_0x2efe('0x47')](_0xdfcdfc[_0x2efe('0x48')],{})['then'](function(_0x2574d4){var _0x2cabd2=_0xdfcdfc[_0x2efe('0x49')][_0x2efe('0x23')]({'plain':!![]});if(!_0x2cabd2)throw new Error(_0x2efe('0x4a'));if(_0x2cabd2[_0x2efe('0x4b')]==='user'){var _0x2b68ce=_0x2574d4['get']({'plain':!![]});var _0x196e47=_0x2efe('0x4c');return db[_0x2efe('0x4d')][_0x2efe('0x45')]({'where':{'name':_0x196e47,'userProfileId':_0x2cabd2[_0x2efe('0x4e')]},'raw':!![]})[_0x2efe('0x21')](function(_0x3c8cf6){if(_0x3c8cf6&&_0x3c8cf6[_0x2efe('0x4f')]===0x0){return db['UserProfileResource'][_0x2efe('0x47')]({'name':_0x2b68ce[_0x2efe('0x25')],'resourceId':_0x2b68ce['id'],'type':_0x3c8cf6[_0x2efe('0x25')],'sectionId':_0x3c8cf6['id']},{})[_0x2efe('0x21')](function(){return _0x2574d4;});}else{return _0x2574d4;}})[_0x2efe('0x46')](function(_0x5a4ce5){logger['error'](_0x2efe('0x50'),_0x5a4ce5);throw _0x5a4ce5;});}return _0x2574d4;})['then'](respondWithResult(_0xf5cb32,0xc9))[_0x2efe('0x46')](handleError(_0xf5cb32,null));};exports[_0x2efe('0x51')]=function(_0xdcb254,_0xe1c96e){if(_0xdcb254[_0x2efe('0x48')]['id']){delete _0xdcb254[_0x2efe('0x48')]['id'];}return db[_0x2efe('0x29')][_0x2efe('0x45')]({'where':{'id':_0xdcb254['params']['id']}})[_0x2efe('0x21')](handleEntityNotFound(_0xe1c96e,null))[_0x2efe('0x21')](saveUpdates(_0xdcb254[_0x2efe('0x48')],null))[_0x2efe('0x21')](respondWithResult(_0xe1c96e,null))[_0x2efe('0x46')](handleError(_0xe1c96e,null));};exports['destroy']=function(_0x28d724,_0x48adea){return db[_0x2efe('0x29')][_0x2efe('0x45')]({'where':{'id':_0x28d724[_0x2efe('0x44')]['id']}})['then'](handleEntityNotFound(_0x48adea,null))[_0x2efe('0x21')](removeEntity(_0x48adea,null))[_0x2efe('0x46')](handleError(_0x48adea,null));};exports[_0x2efe('0x52')]=function(_0x3ff6f8,_0x5227f3,_0x1900fb){return db[_0x2efe('0x29')]['find']({'where':{'id':_0x3ff6f8['params']['id']},'attributes':[_0x2efe('0x25'),'basename','savename','output'],'raw':!![]})[_0x2efe('0x21')](handleEntityNotFound(_0x5227f3,null))[_0x2efe('0x21')](function(_0x547903){if(_0x547903){if(!fs[_0x2efe('0x53')](path[_0x2efe('0x54')](config['root'],_0x2efe('0x55'),_0x547903[_0x2efe('0x56')]))){throw new db[(_0x2efe('0x57'))][(_0x2efe('0x58'))](_0x2efe('0x59'));}if(_0x3ff6f8[_0x2efe('0x2e')][_0x2efe('0x5a')]){return _0x5227f3[_0x2efe('0x15')](0xc8);}return _0x5227f3[_0x2efe('0x52')](path[_0x2efe('0x54')](config['root'],'server/files/reports',_0x547903[_0x2efe('0x56')]),util['format']('%s.%s',_0x547903['basename']||_0x547903[_0x2efe('0x25')],_0x547903[_0x2efe('0x5b')]['toLowerCase']()));}})[_0x2efe('0x46')](handleError(_0x5227f3,null));};
\ No newline at end of file
+var _0x4089=['Report\x20not\x20found\x20or\x20empty','exists','join','format','%s.%s','output','toLowerCase','eml-format','fast-json-patch','request-promise','moment','path','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','sendStatus','name','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','where','pick','filter','merge','type','VIRTUAL','options','AnalyticExtractedReport','includeAll','include','rows','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','UserProfileSection','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','savename','existsSync','root','server/files/reports','Sequelize','ValidationError'];(function(_0x3bca43,_0x1af273){var _0xc44228=function(_0x44db93){while(--_0x44db93){_0x3bca43['push'](_0x3bca43['shift']());}};_0xc44228(++_0x1af273);}(_0x4089,0x1bf));var _0x9408=function(_0x2af409,_0x54a91c){_0x2af409=_0x2af409-0x0;var _0x299b77=_0x4089[_0x2af409];return _0x299b77;};'use strict';var emlformat=require(_0x9408('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9408('0x1'));var rp=require(_0x9408('0x2'));var moment=require(_0x9408('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x9408('0x4'));var sox=require(_0x9408('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9408('0x6'));var squel=require(_0x9408('0x7'));var crypto=require('crypto');var jsforce=require(_0x9408('0x8'));var deskjs=require(_0x9408('0x9'));var toCsv=require(_0x9408('0xa'));var querystring=require(_0x9408('0xb'));var Papa=require(_0x9408('0xc'));var Redis=require(_0x9408('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9408('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9408('0xf'))('api');var utils=require('../../config/utils');var config=require(_0x9408('0x10'));var licenseUtil=require(_0x9408('0x11'));var db=require(_0x9408('0x12'))['db'];function respondWithStatusCode(_0x231d35,_0x20ea01){_0x20ea01=_0x20ea01||0xcc;return function(_0x39e11b){if(_0x39e11b){return _0x231d35['sendStatus'](_0x20ea01);}return _0x231d35[_0x9408('0x13')](_0x20ea01)[_0x9408('0x14')]();};}function respondWithResult(_0x2063bb,_0x9f3b2d){_0x9f3b2d=_0x9f3b2d||0xc8;return function(_0x1bf413){if(_0x1bf413){return _0x2063bb[_0x9408('0x13')](_0x9f3b2d)[_0x9408('0x15')](_0x1bf413);}};}function respondWithFilteredResult(_0x2469d2,_0x13eeb5){return function(_0x1e7d52){if(_0x1e7d52){var _0x37bb6d=typeof _0x13eeb5[_0x9408('0x16')]===_0x9408('0x17')&&typeof _0x13eeb5[_0x9408('0x18')]==='undefined';var _0x27c000=_0x1e7d52[_0x9408('0x19')];var _0x3c60b2=_0x37bb6d?0x0:_0x13eeb5['offset'];var _0x586874=_0x37bb6d?_0x1e7d52['count']:_0x13eeb5[_0x9408('0x16')]+_0x13eeb5['limit'];var _0x19d139;if(_0x586874>=_0x27c000){_0x586874=_0x27c000;_0x19d139=0xc8;}else{_0x19d139=0xce;}_0x2469d2[_0x9408('0x13')](_0x19d139);return _0x2469d2[_0x9408('0x1a')](_0x9408('0x1b'),_0x3c60b2+'-'+_0x586874+'/'+_0x27c000)[_0x9408('0x15')](_0x1e7d52);}return null;};}function patchUpdates(_0x51ce73){return function(_0x51504a){try{jsonpatch[_0x9408('0x1c')](_0x51504a,_0x51ce73,!![]);}catch(_0xbf4163){return BPromise['reject'](_0xbf4163);}return _0x51504a[_0x9408('0x1d')]();};}function saveUpdates(_0x6382eb,_0x524821){return function(_0x2c3af9){if(_0x2c3af9){return _0x2c3af9[_0x9408('0x1e')](_0x6382eb)[_0x9408('0x1f')](function(_0x14d2b3){return _0x14d2b3;});}return null;};}function removeEntity(_0x1b5a36,_0x2ead69){return function(_0x169a55){if(_0x169a55){return _0x169a55[_0x9408('0x20')]()['then'](function(){var _0x2f915c=_0x169a55[_0x9408('0x21')]({'plain':!![]});var _0x120eb7='ExtractedReports';return db['UserProfileResource'][_0x9408('0x20')]({'where':{'type':_0x120eb7,'resourceId':_0x2f915c['id']}})[_0x9408('0x1f')](function(){return _0x169a55;});})[_0x9408('0x1f')](function(){_0x1b5a36[_0x9408('0x13')](0xcc)[_0x9408('0x14')]();});}};}function handleEntityNotFound(_0x45407e,_0x5b2cc6){return function(_0x4f73f0){if(!_0x4f73f0){_0x45407e[_0x9408('0x22')](0x194);}return _0x4f73f0;};}function handleError(_0x4ebecd,_0x5b7a1e){_0x5b7a1e=_0x5b7a1e||0x1f4;return function(_0x4c7622){logger['error'](_0x4c7622['stack']);if(_0x4c7622[_0x9408('0x23')]){delete _0x4c7622[_0x9408('0x23')];}_0x4ebecd[_0x9408('0x13')](_0x5b7a1e)['send'](_0x4c7622);};}exports['index']=function(_0x1d2f69,_0x880843){var _0x2162b9={},_0x3e7b35={},_0x1aab62={'count':0x0,'rows':[]};var _0x238672=_['map'](db['AnalyticExtractedReport'][_0x9408('0x24')],function(_0x1a546b){return{'name':_0x1a546b[_0x9408('0x25')],'type':_0x1a546b['type'][_0x9408('0x26')]};});_0x3e7b35[_0x9408('0x27')]=_[_0x9408('0x28')](_0x238672,_0x9408('0x23'));_0x3e7b35[_0x9408('0x29')]=_[_0x9408('0x2a')](_0x1d2f69[_0x9408('0x29')]);_0x3e7b35[_0x9408('0x2b')]=_[_0x9408('0x2c')](_0x3e7b35[_0x9408('0x27')],_0x3e7b35[_0x9408('0x29')]);_0x2162b9[_0x9408('0x2d')]=_['intersection'](_0x3e7b35['model'],qs[_0x9408('0x2e')](_0x1d2f69[_0x9408('0x29')][_0x9408('0x2e')]));_0x2162b9[_0x9408('0x2d')]=_0x2162b9['attributes'][_0x9408('0x2f')]?_0x2162b9['attributes']:_0x3e7b35[_0x9408('0x27')];if(!_0x1d2f69[_0x9408('0x29')]['hasOwnProperty']('nolimit')){_0x2162b9[_0x9408('0x18')]=qs[_0x9408('0x18')](_0x1d2f69[_0x9408('0x29')]['limit']);_0x2162b9[_0x9408('0x16')]=qs[_0x9408('0x16')](_0x1d2f69[_0x9408('0x29')][_0x9408('0x16')]);}_0x2162b9[_0x9408('0x30')]=qs['sort'](_0x1d2f69[_0x9408('0x29')]['sort']);_0x2162b9[_0x9408('0x31')]=qs['filters'](_[_0x9408('0x32')](_0x1d2f69[_0x9408('0x29')],_0x3e7b35[_0x9408('0x2b')]),_0x238672);if(_0x1d2f69['query'][_0x9408('0x33')]){_0x2162b9[_0x9408('0x31')]=_[_0x9408('0x34')](_0x2162b9['where'],{'$or':_[_0x9408('0x28')](_0x238672,function(_0x4d93b2){if(_0x4d93b2[_0x9408('0x35')]!==_0x9408('0x36')){var _0x3730e9={};_0x3730e9[_0x4d93b2['name']]={'$like':'%'+_0x1d2f69[_0x9408('0x29')][_0x9408('0x33')]+'%'};return _0x3730e9;}})});}_0x2162b9=_[_0x9408('0x34')]({},_0x2162b9,_0x1d2f69[_0x9408('0x37')]);var _0x582acd={'where':_0x2162b9[_0x9408('0x31')]};return db[_0x9408('0x38')]['count'](_0x582acd)[_0x9408('0x1f')](function(_0x4d4daa){_0x1aab62[_0x9408('0x19')]=_0x4d4daa;if(_0x1d2f69[_0x9408('0x29')][_0x9408('0x39')]){_0x2162b9[_0x9408('0x3a')]=[{'all':!![]}];}return db[_0x9408('0x38')]['findAll'](_0x2162b9);})[_0x9408('0x1f')](function(_0x479fb8){_0x1aab62[_0x9408('0x3b')]=_0x479fb8;return _0x1aab62;})['then'](respondWithFilteredResult(_0x880843,_0x2162b9))[_0x9408('0x3c')](handleError(_0x880843,null));};exports['show']=function(_0x504142,_0x2732b3){var _0x554a5d={'raw':!![],'where':{'id':_0x504142['params']['id']}},_0x411869={};_0x411869[_0x9408('0x27')]=_['keys'](db['AnalyticExtractedReport']['rawAttributes']);_0x411869[_0x9408('0x29')]=_[_0x9408('0x2a')](_0x504142['query']);_0x411869[_0x9408('0x2b')]=_[_0x9408('0x2c')](_0x411869['model'],_0x411869[_0x9408('0x29')]);_0x554a5d['attributes']=_[_0x9408('0x2c')](_0x411869[_0x9408('0x27')],qs[_0x9408('0x2e')](_0x504142[_0x9408('0x29')]['fields']));_0x554a5d[_0x9408('0x2d')]=_0x554a5d[_0x9408('0x2d')][_0x9408('0x2f')]?_0x554a5d[_0x9408('0x2d')]:_0x411869['model'];if(_0x504142[_0x9408('0x29')][_0x9408('0x39')]){_0x554a5d[_0x9408('0x3a')]=[{'all':!![]}];}_0x554a5d=_[_0x9408('0x34')]({},_0x554a5d,_0x504142[_0x9408('0x37')]);return db[_0x9408('0x38')][_0x9408('0x3d')](_0x554a5d)[_0x9408('0x1f')](handleEntityNotFound(_0x2732b3,null))['then'](respondWithResult(_0x2732b3,null))[_0x9408('0x3c')](handleError(_0x2732b3,null));};exports[_0x9408('0x3e')]=function(_0x6da154,_0x1774ad){return db['AnalyticExtractedReport'][_0x9408('0x3e')](_0x6da154[_0x9408('0x3f')],{})['then'](function(_0x106392){var _0x1dab53=_0x6da154[_0x9408('0x40')]['get']({'plain':!![]});if(!_0x1dab53)throw new Error(_0x9408('0x41'));if(_0x1dab53[_0x9408('0x42')]===_0x9408('0x40')){var _0x55ad3d=_0x106392[_0x9408('0x21')]({'plain':!![]});var _0x526999=_0x9408('0x43');return db[_0x9408('0x44')][_0x9408('0x3d')]({'where':{'name':_0x526999,'userProfileId':_0x1dab53['userProfileId']},'raw':!![]})[_0x9408('0x1f')](function(_0x1441df){if(_0x1441df&&_0x1441df['autoAssociation']===0x0){return db[_0x9408('0x45')][_0x9408('0x3e')]({'name':_0x55ad3d['name'],'resourceId':_0x55ad3d['id'],'type':_0x1441df[_0x9408('0x23')],'sectionId':_0x1441df['id']},{})[_0x9408('0x1f')](function(){return _0x106392;});}else{return _0x106392;}})['catch'](function(_0xc2971e){logger[_0x9408('0x46')](_0x9408('0x47'),_0xc2971e);throw _0xc2971e;});}return _0x106392;})[_0x9408('0x1f')](respondWithResult(_0x1774ad,0xc9))['catch'](handleError(_0x1774ad,null));};exports[_0x9408('0x1e')]=function(_0x927909,_0x418146){if(_0x927909[_0x9408('0x3f')]['id']){delete _0x927909['body']['id'];}return db[_0x9408('0x38')][_0x9408('0x3d')]({'where':{'id':_0x927909[_0x9408('0x48')]['id']}})['then'](handleEntityNotFound(_0x418146,null))[_0x9408('0x1f')](saveUpdates(_0x927909[_0x9408('0x3f')],null))['then'](respondWithResult(_0x418146,null))[_0x9408('0x3c')](handleError(_0x418146,null));};exports['destroy']=function(_0x2ae610,_0xb04c75){return db[_0x9408('0x38')][_0x9408('0x3d')]({'where':{'id':_0x2ae610[_0x9408('0x48')]['id']}})[_0x9408('0x1f')](handleEntityNotFound(_0xb04c75,null))[_0x9408('0x1f')](removeEntity(_0xb04c75,null))[_0x9408('0x3c')](handleError(_0xb04c75,null));};exports[_0x9408('0x49')]=function(_0x4cfd41,_0x5ad4db,_0x1e8079){return db[_0x9408('0x38')][_0x9408('0x3d')]({'where':{'id':_0x4cfd41[_0x9408('0x48')]['id']},'attributes':['name',_0x9408('0x4a'),_0x9408('0x4b'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x5ad4db,null))[_0x9408('0x1f')](function(_0x1d8167){if(_0x1d8167){if(!fs[_0x9408('0x4c')](path['join'](config[_0x9408('0x4d')],_0x9408('0x4e'),_0x1d8167[_0x9408('0x4b')]))){throw new db[(_0x9408('0x4f'))][(_0x9408('0x50'))](_0x9408('0x51'));}if(_0x4cfd41['query'][_0x9408('0x52')]){return _0x5ad4db[_0x9408('0x22')](0xc8);}return _0x5ad4db[_0x9408('0x49')](path[_0x9408('0x53')](config['root'],_0x9408('0x4e'),_0x1d8167['savename']),util[_0x9408('0x54')](_0x9408('0x55'),_0x1d8167[_0x9408('0x4a')]||_0x1d8167[_0x9408('0x23')],_0x1d8167[_0x9408('0x56')][_0x9408('0x57')]()));}})['catch'](handleError(_0x5ad4db,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 9228a6b..3bbc07b 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 _0xd683=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','util','../../config/logger','api','moment'];(function(_0x7f7401,_0xa49bd8){var _0x301bca=function(_0x3cab42){while(--_0x3cab42){_0x7f7401['push'](_0x7f7401['shift']());}};_0x301bca(++_0xa49bd8);}(_0xd683,0x10d));var _0x3d68=function(_0xfaf51b,_0x4b9c2b){_0xfaf51b=_0xfaf51b-0x0;var _0x4b71e8=_0xd683[_0xfaf51b];return _0x4b71e8;};'use strict';var _=require('lodash');var util=require(_0x3d68('0x0'));var logger=require(_0x3d68('0x1'))(_0x3d68('0x2'));var moment=require(_0x3d68('0x3'));var BPromise=require(_0x3d68('0x4'));var rp=require(_0x3d68('0x5'));var fs=require('fs');var path=require(_0x3d68('0x6'));var rimraf=require(_0x3d68('0x7'));var config=require(_0x3d68('0x8'));var attributes=require(_0x3d68('0x9'));module[_0x3d68('0xa')]=function(_0x12f021,_0x2247c1){return _0x12f021[_0x3d68('0xb')](_0x3d68('0xc'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4f0d=['request-promise','path','rimraf','../../config/environment','define','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5d2aee,_0x4912f8){var _0x43b7f8=function(_0x247425){while(--_0x247425){_0x5d2aee['push'](_0x5d2aee['shift']());}};_0x43b7f8(++_0x4912f8);}(_0x4f0d,0xba));var _0xd4f0=function(_0x3aaf97,_0x4fa2e8){_0x3aaf97=_0x3aaf97-0x0;var _0xeba75e=_0x4f0d[_0x3aaf97];return _0xeba75e;};'use strict';var _=require(_0xd4f0('0x0'));var util=require(_0xd4f0('0x1'));var logger=require(_0xd4f0('0x2'))(_0xd4f0('0x3'));var moment=require(_0xd4f0('0x4'));var BPromise=require(_0xd4f0('0x5'));var rp=require(_0xd4f0('0x6'));var fs=require('fs');var path=require(_0xd4f0('0x7'));var rimraf=require(_0xd4f0('0x8'));var config=require(_0xd4f0('0x9'));var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x1604d5,_0x3d15c0){return _0x1604d5[_0xd4f0('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0xd4f0('0xb'),'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 fa58491..275c7b5 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 _0x3521=['info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','lodash','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x3521,0x183));var _0x1352=function(_0x4f7742,_0x15ce9a){_0x4f7742=_0x4f7742-0x0;var _0x270a53=_0x3521[_0x4f7742];return _0x270a53;};'use strict';var _=require(_0x1352('0x0'));var util=require(_0x1352('0x1'));var moment=require('moment');var BPromise=require(_0x1352('0x2'));var rs=require(_0x1352('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1352('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1352('0x5'));var config=require(_0x1352('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1352('0x7')][_0x1352('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3006d3,_0x4c481f,_0x2e1c91){return new BPromise(function(_0x1cbfcf,_0x21db13){return client['request'](_0x3006d3,_0x2e1c91)['then'](function(_0x212e2c){logger[_0x1352('0x9')](_0x1352('0xa'),_0x4c481f,'request\x20sent');logger[_0x1352('0xb')](_0x1352('0xc'),_0x4c481f,'request\x20sent',JSON[_0x1352('0xd')](_0x212e2c));if(_0x212e2c[_0x1352('0xe')]){if(_0x212e2c[_0x1352('0xe')][_0x1352('0xf')]===0x1f4){logger[_0x1352('0xe')](_0x1352('0xa'),_0x4c481f,_0x212e2c[_0x1352('0xe')][_0x1352('0x10')]);return _0x21db13(_0x212e2c[_0x1352('0xe')][_0x1352('0x10')]);}logger[_0x1352('0xe')](_0x1352('0xa'),_0x4c481f,_0x212e2c['error'][_0x1352('0x10')]);return _0x1cbfcf(_0x212e2c[_0x1352('0xe')][_0x1352('0x10')]);}else{logger[_0x1352('0x9')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4c481f,_0x1352('0x11'));_0x1cbfcf(_0x212e2c['result'][_0x1352('0x10')]);}})['catch'](function(_0x193f1c){logger['error'](_0x1352('0xa'),_0x4c481f,_0x193f1c);_0x21db13(_0x193f1c);});});}
\ No newline at end of file
+var _0xc366=['client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1eac42,_0x555028){var _0x2004d0=function(_0x564a1c){while(--_0x564a1c){_0x1eac42['push'](_0x1eac42['shift']());}};_0x2004d0(++_0x555028);}(_0xc366,0xb6));var _0x6c36=function(_0x22084b,_0x1d5154){_0x22084b=_0x22084b-0x0;var _0x6dca4c=_0xc366[_0x22084b];return _0x6dca4c;};'use strict';var _=require(_0x6c36('0x0'));var util=require(_0x6c36('0x1'));var moment=require(_0x6c36('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c36('0x3'));var fs=require('fs');var Redis=require(_0x6c36('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6c36('0x5'));var logger=require(_0x6c36('0x6'))(_0x6c36('0x7'));var config=require(_0x6c36('0x8'));var jayson=require(_0x6c36('0x9'));var client=jayson[_0x6c36('0xa')][_0x6c36('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7e786b,_0x1b2031,_0x5f3d53){return new BPromise(function(_0x100658,_0x247591){return client[_0x6c36('0xc')](_0x7e786b,_0x5f3d53)[_0x6c36('0xd')](function(_0x4e03d0){logger[_0x6c36('0xe')](_0x6c36('0xf'),_0x1b2031,_0x6c36('0x10'));logger[_0x6c36('0x11')](_0x6c36('0x12'),_0x1b2031,_0x6c36('0x10'),JSON[_0x6c36('0x13')](_0x4e03d0));if(_0x4e03d0[_0x6c36('0x14')]){if(_0x4e03d0[_0x6c36('0x14')][_0x6c36('0x15')]===0x1f4){logger[_0x6c36('0x14')](_0x6c36('0xf'),_0x1b2031,_0x4e03d0['error'][_0x6c36('0x16')]);return _0x247591(_0x4e03d0[_0x6c36('0x14')][_0x6c36('0x16')]);}logger[_0x6c36('0x14')](_0x6c36('0xf'),_0x1b2031,_0x4e03d0[_0x6c36('0x14')][_0x6c36('0x16')]);return _0x100658(_0x4e03d0[_0x6c36('0x14')][_0x6c36('0x16')]);}else{logger[_0x6c36('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1b2031,_0x6c36('0x10'));_0x100658(_0x4e03d0['result']['message']);}})[_0x6c36('0x17')](function(_0x5babbf){logger[_0x6c36('0x14')](_0x6c36('0xf'),_0x1b2031,_0x5babbf);_0x247591(_0x5babbf);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index e9d974b..f3ee26c 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 _0xf32a=['index','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xf32a,0x186));var _0xaf32=function(_0xf7dc4d,_0x49f0d4){_0xf7dc4d=_0xf7dc4d-0x0;var _0x1781bd=_0xf32a[_0xf7dc4d];return _0x1781bd;};'use strict';var multer=require(_0xaf32('0x0'));var util=require(_0xaf32('0x1'));var path=require(_0xaf32('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf32('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xaf32('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xaf32('0x5'));var controller=require(_0xaf32('0x6'));router[_0xaf32('0x7')]('/',auth[_0xaf32('0x8')](),controller[_0xaf32('0x9')]);router[_0xaf32('0x7')](_0xaf32('0xa'),auth[_0xaf32('0x8')](),controller[_0xaf32('0xb')]);router[_0xaf32('0x7')](_0xaf32('0xc'),auth[_0xaf32('0x8')](),controller[_0xaf32('0xd')]);router[_0xaf32('0xe')]('/',auth[_0xaf32('0x8')](),controller[_0xaf32('0xf')]);router[_0xaf32('0x10')](_0xaf32('0xa'),auth[_0xaf32('0x8')](),controller[_0xaf32('0x11')]);router[_0xaf32('0x12')]('/:id',auth[_0xaf32('0x8')](),controller[_0xaf32('0x13')]);module[_0xaf32('0x14')]=router;
\ No newline at end of file
+var _0xafe1=['show','/:id/download','post','create','put','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','index','get','/:id','isAuthenticated'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xafe1,0x1ab));var _0x1afe=function(_0x44ac1e,_0x63343b){_0x44ac1e=_0x44ac1e-0x0;var _0x2e0adf=_0xafe1[_0x44ac1e];return _0x2e0adf;};'use strict';var multer=require('multer');var util=require(_0x1afe('0x0'));var path=require(_0x1afe('0x1'));var timeout=require(_0x1afe('0x2'));var express=require(_0x1afe('0x3'));var router=express[_0x1afe('0x4')]();var fs_extra=require(_0x1afe('0x5'));var auth=require(_0x1afe('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1afe('0x7'));var controller=require(_0x1afe('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x1afe('0x9')]);router[_0x1afe('0xa')](_0x1afe('0xb'),auth[_0x1afe('0xc')](),controller[_0x1afe('0xd')]);router[_0x1afe('0xa')](_0x1afe('0xe'),auth[_0x1afe('0xc')](),controller['download']);router[_0x1afe('0xf')]('/',auth['isAuthenticated'](),controller[_0x1afe('0x10')]);router[_0x1afe('0x11')](_0x1afe('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x1afe('0x12')](_0x1afe('0xb'),auth[_0x1afe('0xc')](),controller[_0x1afe('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 2ecb56e..de56bbe 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 _0x2712=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0x5b1877,_0x474eda){var _0x2887a8=function(_0x4805cc){while(--_0x4805cc){_0x5b1877['push'](_0x5b1877['shift']());}};_0x2887a8(++_0x474eda);}(_0x2712,0xb9));var _0x2271=function(_0x5e2abb,_0x1b768c){_0x5e2abb=_0x5e2abb-0x0;var _0xb1b934=_0x2712[_0x5e2abb];return _0xb1b934;};'use strict';var Sequelize=require(_0x2271('0x0'));module['exports']={'field':{'type':Sequelize[_0x2271('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x2271('0x2')]},'groupBy':{'type':Sequelize[_0x2271('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x2271('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x6838=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x2cde2a,_0x4325c4){var _0x110f55=function(_0x4927f5){while(--_0x4927f5){_0x2cde2a['push'](_0x2cde2a['shift']());}};_0x110f55(++_0x4325c4);}(_0x6838,0x96));var _0x8683=function(_0x19e38e,_0xb15cc7){_0x19e38e=_0x19e38e-0x0;var _0x14bec3=_0x6838[_0x19e38e];return _0x14bec3;};'use strict';var Sequelize=require(_0x8683('0x0'));module[_0x8683('0x1')]={'field':{'type':Sequelize[_0x8683('0x2')]},'alias':{'type':Sequelize[_0x8683('0x3')]},'function':{'type':Sequelize[_0x8683('0x3')]},'format':{'type':Sequelize[_0x8683('0x3')]},'groupBy':{'type':Sequelize[_0x8683('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x8683('0x3')]},'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 af8bda5..197b14e 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 _0x7202=['addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','options','create','bulkCreate','body','find','bulkDestroy','ids'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x7202,0x1af));var _0x2720=function(_0x1d4e36,_0x54fde6){_0x1d4e36=_0x1d4e36-0x0;var _0x4dab8c=_0x7202[_0x1d4e36];return _0x4dab8c;};'use strict';var emlformat=require(_0x2720('0x0'));var rimraf=require(_0x2720('0x1'));var zipdir=require(_0x2720('0x2'));var jsonpatch=require(_0x2720('0x3'));var rp=require(_0x2720('0x4'));var moment=require(_0x2720('0x5'));var BPromise=require(_0x2720('0x6'));var Mustache=require(_0x2720('0x7'));var util=require(_0x2720('0x8'));var path=require('path');var sox=require(_0x2720('0x9'));var csv=require(_0x2720('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2720('0xb'));var _=require('lodash');var squel=require(_0x2720('0xc'));var crypto=require('crypto');var jsforce=require(_0x2720('0xd'));var deskjs=require(_0x2720('0xe'));var toCsv=require(_0x2720('0xa'));var querystring=require(_0x2720('0xf'));var Papa=require('papaparse');var Redis=require(_0x2720('0x10'));var authService=require(_0x2720('0x11'));var qs=require(_0x2720('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2720('0x13'));var logger=require(_0x2720('0x14'))(_0x2720('0x15'));var utils=require(_0x2720('0x16'));var config=require(_0x2720('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x2720('0x18'))['db'];function respondWithStatusCode(_0x38b91c,_0x2d094f){_0x2d094f=_0x2d094f||0xcc;return function(_0x12b1ab){if(_0x12b1ab){return _0x38b91c[_0x2720('0x19')](_0x2d094f);}return _0x38b91c[_0x2720('0x1a')](_0x2d094f)[_0x2720('0x1b')]();};}function respondWithResult(_0x2a86ea,_0x296d5c){_0x296d5c=_0x296d5c||0xc8;return function(_0x364603){if(_0x364603){return _0x2a86ea[_0x2720('0x1a')](_0x296d5c)[_0x2720('0x1c')](_0x364603);}};}function respondWithFilteredResult(_0x9e612b,_0x556138){return function(_0xcef845){if(_0xcef845){var _0x44485a=typeof _0x556138[_0x2720('0x1d')]===_0x2720('0x1e')&&typeof _0x556138[_0x2720('0x1f')]===_0x2720('0x1e');var _0x320efe=_0xcef845[_0x2720('0x20')];var _0x30b3a0=_0x44485a?0x0:_0x556138[_0x2720('0x1d')];var _0x3282f8=_0x44485a?_0xcef845[_0x2720('0x20')]:_0x556138[_0x2720('0x1d')]+_0x556138[_0x2720('0x1f')];var _0xe2997c;if(_0x3282f8>=_0x320efe){_0x3282f8=_0x320efe;_0xe2997c=0xc8;}else{_0xe2997c=0xce;}_0x9e612b[_0x2720('0x1a')](_0xe2997c);return _0x9e612b[_0x2720('0x21')](_0x2720('0x22'),_0x30b3a0+'-'+_0x3282f8+'/'+_0x320efe)[_0x2720('0x1c')](_0xcef845);}return null;};}function patchUpdates(_0x341a28){return function(_0x50ef34){try{jsonpatch[_0x2720('0x23')](_0x50ef34,_0x341a28,!![]);}catch(_0x59ea77){return BPromise[_0x2720('0x24')](_0x59ea77);}return _0x50ef34['save']();};}function saveUpdates(_0x54997f,_0x893bad){return function(_0x247549){if(_0x247549){return _0x247549['update'](_0x54997f)[_0x2720('0x25')](function(_0xaa15ea){return _0xaa15ea;});}return null;};}function removeEntity(_0x269948,_0x3bda6a){return function(_0x4ae61c){if(_0x4ae61c){return _0x4ae61c[_0x2720('0x26')]()[_0x2720('0x25')](function(){_0x269948['status'](0xcc)[_0x2720('0x1b')]();});}};}function handleEntityNotFound(_0xc876f0,_0x3a889a){return function(_0x45b7ad){if(!_0x45b7ad){_0xc876f0[_0x2720('0x19')](0x194);}return _0x45b7ad;};}function handleError(_0x9a75ca,_0x2d1610){_0x2d1610=_0x2d1610||0x1f4;return function(_0x36b71f){logger[_0x2720('0x27')](_0x36b71f['stack']);if(_0x36b71f['name']){delete _0x36b71f[_0x2720('0x28')];}_0x9a75ca[_0x2720('0x1a')](_0x2d1610)[_0x2720('0x29')](_0x36b71f);};}exports[_0x2720('0x2a')]=function(_0x39fe5a,_0x14947d){var _0x11bc88={},_0x58d743={},_0x83e7b1={'count':0x0,'rows':[]};var _0x4ae70c=_[_0x2720('0x2b')](db[_0x2720('0x2c')][_0x2720('0x2d')],function(_0x14ab15){return{'name':_0x14ab15[_0x2720('0x2e')],'type':_0x14ab15[_0x2720('0x2f')][_0x2720('0x30')]};});_0x58d743[_0x2720('0x31')]=_[_0x2720('0x2b')](_0x4ae70c,_0x2720('0x28'));_0x58d743[_0x2720('0x32')]=_[_0x2720('0x33')](_0x39fe5a['query']);_0x58d743['filters']=_[_0x2720('0x34')](_0x58d743[_0x2720('0x31')],_0x58d743['query']);_0x11bc88[_0x2720('0x35')]=_[_0x2720('0x34')](_0x58d743[_0x2720('0x31')],qs[_0x2720('0x36')](_0x39fe5a['query']['fields']));_0x11bc88['attributes']=_0x11bc88[_0x2720('0x35')][_0x2720('0x37')]?_0x11bc88[_0x2720('0x35')]:_0x58d743['model'];if(!_0x39fe5a[_0x2720('0x32')][_0x2720('0x38')](_0x2720('0x39'))){_0x11bc88[_0x2720('0x1f')]=qs[_0x2720('0x1f')](_0x39fe5a[_0x2720('0x32')][_0x2720('0x1f')]);_0x11bc88[_0x2720('0x1d')]=qs[_0x2720('0x1d')](_0x39fe5a['query'][_0x2720('0x1d')]);}_0x11bc88['order']=qs[_0x2720('0x3a')](_0x39fe5a[_0x2720('0x32')][_0x2720('0x3a')]);_0x11bc88[_0x2720('0x3b')]=qs[_0x2720('0x3c')](_[_0x2720('0x3d')](_0x39fe5a[_0x2720('0x32')],_0x58d743['filters']),_0x4ae70c);if(_0x39fe5a[_0x2720('0x32')][_0x2720('0x3e')]){_0x11bc88[_0x2720('0x3b')]=_[_0x2720('0x3f')](_0x11bc88[_0x2720('0x3b')],{'$or':_['map'](_0x4ae70c,function(_0x19b902){if(_0x19b902[_0x2720('0x2f')]!==_0x2720('0x40')){var _0x3aa077={};_0x3aa077[_0x19b902[_0x2720('0x28')]]={'$like':'%'+_0x39fe5a[_0x2720('0x32')][_0x2720('0x3e')]+'%'};return _0x3aa077;}})});}_0x11bc88=_['merge']({},_0x11bc88,_0x39fe5a['options']);var _0xdaf033={'where':_0x11bc88[_0x2720('0x3b')]};return db['AnalyticFieldReport'][_0x2720('0x20')](_0xdaf033)[_0x2720('0x25')](function(_0x491cc7){_0x83e7b1[_0x2720('0x20')]=_0x491cc7;if(_0x39fe5a['query']['includeAll']){_0x11bc88[_0x2720('0x41')]=[{'all':!![]}];}return db[_0x2720('0x2c')][_0x2720('0x42')](_0x11bc88);})['then'](function(_0x242ae3){_0x83e7b1[_0x2720('0x43')]=_0x242ae3;return _0x83e7b1;})[_0x2720('0x25')](respondWithFilteredResult(_0x14947d,_0x11bc88))[_0x2720('0x44')](handleError(_0x14947d,null));};exports[_0x2720('0x45')]=function(_0x343767,_0x2ba86c){var _0x3d3e12={'raw':![],'where':{'id':_0x343767[_0x2720('0x46')]['id']}},_0x39e645={};_0x39e645[_0x2720('0x31')]=_['keys'](db['AnalyticFieldReport'][_0x2720('0x2d')]);_0x39e645[_0x2720('0x32')]=_[_0x2720('0x33')](_0x343767['query']);_0x39e645[_0x2720('0x3c')]=_[_0x2720('0x34')](_0x39e645[_0x2720('0x31')],_0x39e645[_0x2720('0x32')]);_0x3d3e12['attributes']=_['intersection'](_0x39e645[_0x2720('0x31')],qs[_0x2720('0x36')](_0x343767[_0x2720('0x32')][_0x2720('0x36')]));_0x3d3e12[_0x2720('0x35')]=_0x3d3e12[_0x2720('0x35')][_0x2720('0x37')]?_0x3d3e12[_0x2720('0x35')]:_0x39e645[_0x2720('0x31')];if(_0x343767[_0x2720('0x32')][_0x2720('0x47')]){_0x3d3e12[_0x2720('0x41')]=[{'all':!![]}];}_0x3d3e12=_[_0x2720('0x3f')]({},_0x3d3e12,_0x343767[_0x2720('0x48')]);return db[_0x2720('0x2c')]['find'](_0x3d3e12)['then'](handleEntityNotFound(_0x2ba86c,null))['then'](respondWithResult(_0x2ba86c,null))[_0x2720('0x44')](handleError(_0x2ba86c,null));};exports[_0x2720('0x49')]=function(_0x104da6,_0x1ea7cc){return db['AnalyticFieldReport'][_0x2720('0x49')](_0x104da6['body'],{})[_0x2720('0x25')](respondWithResult(_0x1ea7cc,0xc9))[_0x2720('0x44')](handleError(_0x1ea7cc,null));};exports[_0x2720('0x4a')]=function(_0x5a97f6,_0x43a42d){return db['AnalyticFieldReport'][_0x2720('0x4a')](_0x5a97f6[_0x2720('0x4b')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x43a42d,0xc9))['catch'](handleError(_0x43a42d,null));};exports['update']=function(_0x22fb4a,_0x4fb89a){if(_0x22fb4a['body']['id']){delete _0x22fb4a[_0x2720('0x4b')]['id'];}return db[_0x2720('0x2c')][_0x2720('0x4c')]({'where':{'id':_0x22fb4a['params']['id']}})['then'](handleEntityNotFound(_0x4fb89a,null))[_0x2720('0x25')](saveUpdates(_0x22fb4a[_0x2720('0x4b')],null))[_0x2720('0x25')](respondWithResult(_0x4fb89a,null))[_0x2720('0x44')](handleError(_0x4fb89a,null));};exports[_0x2720('0x26')]=function(_0x2d7e7f,_0x278b11){return db[_0x2720('0x2c')]['find']({'where':{'id':_0x2d7e7f[_0x2720('0x46')]['id']}})[_0x2720('0x25')](handleEntityNotFound(_0x278b11,null))[_0x2720('0x25')](removeEntity(_0x278b11,null))['catch'](handleError(_0x278b11,null));};exports[_0x2720('0x4d')]=function(_0x3dddc4,_0xce6c9b){return db[_0x2720('0x2c')]['destroy']({'where':{'id':_0x3dddc4[_0x2720('0x32')][_0x2720('0x4e')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0xce6c9b,0xcc))[_0x2720('0x44')](handleError(_0xce6c9b,null));};exports[_0x2720('0x4f')]=function(_0x192650,_0x198375,_0x1e804a){return db[_0x2720('0x50')][_0x2720('0x51')]({'where':{'id':_0x192650[_0x2720('0x46')]['id']}})[_0x2720('0x25')](handleEntityNotFound(_0x198375,null))[_0x2720('0x25')](function(_0xb1c333){if(_0xb1c333){return db[_0x2720('0x52')][_0x2720('0x53')](function(_0x2efb96){return db[_0x2720('0x2c')][_0x2720('0x26')]({'where':{'CustomReportId':_0x192650[_0x2720('0x46')]['id']},'transaction':_0x2efb96})[_0x2720('0x25')](function(_0x5cc4c9){var _0x3103b2=_[_0x2720('0x2b')](_0x192650['body'],function(_0x59da52){delete _0x59da52['id'];_0x59da52[_0x2720('0x54')]=_0x192650['params']['id'];return _0x59da52;});return db[_0x2720('0x2c')][_0x2720('0x4a')](_0x3103b2,{'transaction':_0x2efb96});});})['then'](function(){return db[_0x2720('0x2c')][_0x2720('0x42')]({'where':{'CustomReportId':_0x192650[_0x2720('0x46')]['id']}});});}})[_0x2720('0x25')](respondWithResult(_0x198375,null))['catch'](handleError(_0x198375,null));};
\ No newline at end of file
+var _0xb783=['create','bulkCreate','body','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','find','catch'];(function(_0x25fa4a,_0x200e19){var _0x2faa7b=function(_0x10b98d){while(--_0x10b98d){_0x25fa4a['push'](_0x25fa4a['shift']());}};_0x2faa7b(++_0x200e19);}(_0xb783,0x154));var _0x3b78=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xb783[_0x1694f5];return _0x5b4321;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3b78('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3b78('0x1'));var rp=require(_0x3b78('0x2'));var moment=require(_0x3b78('0x3'));var BPromise=require(_0x3b78('0x4'));var Mustache=require(_0x3b78('0x5'));var util=require(_0x3b78('0x6'));var path=require(_0x3b78('0x7'));var sox=require(_0x3b78('0x8'));var csv=require(_0x3b78('0x9'));var ejs=require(_0x3b78('0xa'));var fs=require('fs');var fs_extra=require(_0x3b78('0xb'));var _=require('lodash');var squel=require(_0x3b78('0xc'));var crypto=require('crypto');var jsforce=require(_0x3b78('0xd'));var deskjs=require(_0x3b78('0xe'));var toCsv=require(_0x3b78('0x9'));var querystring=require(_0x3b78('0xf'));var Papa=require('papaparse');var Redis=require(_0x3b78('0x10'));var authService=require(_0x3b78('0x11'));var qs=require(_0x3b78('0x12'));var as=require(_0x3b78('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3b78('0x14'));var licenseUtil=require(_0x3b78('0x15'));var db=require(_0x3b78('0x16'))['db'];function respondWithStatusCode(_0x1339ba,_0x57f1fe){_0x57f1fe=_0x57f1fe||0xcc;return function(_0x2c7fc0){if(_0x2c7fc0){return _0x1339ba[_0x3b78('0x17')](_0x57f1fe);}return _0x1339ba['status'](_0x57f1fe)['end']();};}function respondWithResult(_0x4c5a3d,_0x147dd2){_0x147dd2=_0x147dd2||0xc8;return function(_0x15700e){if(_0x15700e){return _0x4c5a3d[_0x3b78('0x18')](_0x147dd2)[_0x3b78('0x19')](_0x15700e);}};}function respondWithFilteredResult(_0x4a0b9a,_0x3581f8){return function(_0x310f74){if(_0x310f74){var _0x3e976f=typeof _0x3581f8[_0x3b78('0x1a')]==='undefined'&&typeof _0x3581f8['limit']===_0x3b78('0x1b');var _0x4bac18=_0x310f74[_0x3b78('0x1c')];var _0x349f69=_0x3e976f?0x0:_0x3581f8['offset'];var _0x2702d6=_0x3e976f?_0x310f74['count']:_0x3581f8[_0x3b78('0x1a')]+_0x3581f8['limit'];var _0x1903fc;if(_0x2702d6>=_0x4bac18){_0x2702d6=_0x4bac18;_0x1903fc=0xc8;}else{_0x1903fc=0xce;}_0x4a0b9a[_0x3b78('0x18')](_0x1903fc);return _0x4a0b9a[_0x3b78('0x1d')](_0x3b78('0x1e'),_0x349f69+'-'+_0x2702d6+'/'+_0x4bac18)[_0x3b78('0x19')](_0x310f74);}return null;};}function patchUpdates(_0x4eaf75){return function(_0x44a540){try{jsonpatch[_0x3b78('0x1f')](_0x44a540,_0x4eaf75,!![]);}catch(_0xf46f80){return BPromise[_0x3b78('0x20')](_0xf46f80);}return _0x44a540['save']();};}function saveUpdates(_0x2b9fab,_0x525c99){return function(_0x1b737c){if(_0x1b737c){return _0x1b737c[_0x3b78('0x21')](_0x2b9fab)[_0x3b78('0x22')](function(_0x466c1d){return _0x466c1d;});}return null;};}function removeEntity(_0x39b93e,_0x2d6956){return function(_0x1ce94d){if(_0x1ce94d){return _0x1ce94d[_0x3b78('0x23')]()[_0x3b78('0x22')](function(){_0x39b93e['status'](0xcc)[_0x3b78('0x24')]();});}};}function handleEntityNotFound(_0x1528e5,_0xc4bfd3){return function(_0x3f82cd){if(!_0x3f82cd){_0x1528e5[_0x3b78('0x17')](0x194);}return _0x3f82cd;};}function handleError(_0x568549,_0x3a949d){_0x3a949d=_0x3a949d||0x1f4;return function(_0x1c74b1){logger['error'](_0x1c74b1[_0x3b78('0x25')]);if(_0x1c74b1[_0x3b78('0x26')]){delete _0x1c74b1[_0x3b78('0x26')];}_0x568549[_0x3b78('0x18')](_0x3a949d)[_0x3b78('0x27')](_0x1c74b1);};}exports[_0x3b78('0x28')]=function(_0x17bfa0,_0xce6d01){var _0x3d0f50={},_0x5c68e4={},_0x4b45ab={'count':0x0,'rows':[]};var _0x48a1de=_[_0x3b78('0x29')](db[_0x3b78('0x2a')][_0x3b78('0x2b')],function(_0x228512){return{'name':_0x228512[_0x3b78('0x2c')],'type':_0x228512[_0x3b78('0x2d')]['key']};});_0x5c68e4[_0x3b78('0x2e')]=_[_0x3b78('0x29')](_0x48a1de,_0x3b78('0x26'));_0x5c68e4[_0x3b78('0x2f')]=_['keys'](_0x17bfa0[_0x3b78('0x2f')]);_0x5c68e4[_0x3b78('0x30')]=_[_0x3b78('0x31')](_0x5c68e4[_0x3b78('0x2e')],_0x5c68e4['query']);_0x3d0f50[_0x3b78('0x32')]=_[_0x3b78('0x31')](_0x5c68e4['model'],qs[_0x3b78('0x33')](_0x17bfa0['query']['fields']));_0x3d0f50[_0x3b78('0x32')]=_0x3d0f50[_0x3b78('0x32')][_0x3b78('0x34')]?_0x3d0f50[_0x3b78('0x32')]:_0x5c68e4[_0x3b78('0x2e')];if(!_0x17bfa0[_0x3b78('0x2f')][_0x3b78('0x35')](_0x3b78('0x36'))){_0x3d0f50[_0x3b78('0x37')]=qs['limit'](_0x17bfa0[_0x3b78('0x2f')][_0x3b78('0x37')]);_0x3d0f50[_0x3b78('0x1a')]=qs[_0x3b78('0x1a')](_0x17bfa0[_0x3b78('0x2f')][_0x3b78('0x1a')]);}_0x3d0f50[_0x3b78('0x38')]=qs['sort'](_0x17bfa0['query']['sort']);_0x3d0f50['where']=qs[_0x3b78('0x30')](_['pick'](_0x17bfa0['query'],_0x5c68e4['filters']),_0x48a1de);if(_0x17bfa0[_0x3b78('0x2f')][_0x3b78('0x39')]){_0x3d0f50[_0x3b78('0x3a')]=_[_0x3b78('0x3b')](_0x3d0f50[_0x3b78('0x3a')],{'$or':_[_0x3b78('0x29')](_0x48a1de,function(_0x22d4e1){if(_0x22d4e1[_0x3b78('0x2d')]!==_0x3b78('0x3c')){var _0x115b07={};_0x115b07[_0x22d4e1['name']]={'$like':'%'+_0x17bfa0[_0x3b78('0x2f')][_0x3b78('0x39')]+'%'};return _0x115b07;}})});}_0x3d0f50=_[_0x3b78('0x3b')]({},_0x3d0f50,_0x17bfa0[_0x3b78('0x3d')]);var _0x1472a2={'where':_0x3d0f50[_0x3b78('0x3a')]};return db[_0x3b78('0x2a')][_0x3b78('0x1c')](_0x1472a2)[_0x3b78('0x22')](function(_0x95c981){_0x4b45ab[_0x3b78('0x1c')]=_0x95c981;if(_0x17bfa0[_0x3b78('0x2f')][_0x3b78('0x3e')]){_0x3d0f50[_0x3b78('0x3f')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x3b78('0x40')](_0x3d0f50);})[_0x3b78('0x22')](function(_0x246a37){_0x4b45ab[_0x3b78('0x41')]=_0x246a37;return _0x4b45ab;})[_0x3b78('0x22')](respondWithFilteredResult(_0xce6d01,_0x3d0f50))['catch'](handleError(_0xce6d01,null));};exports[_0x3b78('0x42')]=function(_0x2bd9a7,_0xd6aad){var _0x162d7f={'raw':![],'where':{'id':_0x2bd9a7['params']['id']}},_0x20cf11={};_0x20cf11[_0x3b78('0x2e')]=_[_0x3b78('0x43')](db[_0x3b78('0x2a')][_0x3b78('0x2b')]);_0x20cf11[_0x3b78('0x2f')]=_['keys'](_0x2bd9a7[_0x3b78('0x2f')]);_0x20cf11[_0x3b78('0x30')]=_['intersection'](_0x20cf11['model'],_0x20cf11[_0x3b78('0x2f')]);_0x162d7f['attributes']=_[_0x3b78('0x31')](_0x20cf11[_0x3b78('0x2e')],qs[_0x3b78('0x33')](_0x2bd9a7[_0x3b78('0x2f')][_0x3b78('0x33')]));_0x162d7f[_0x3b78('0x32')]=_0x162d7f['attributes'][_0x3b78('0x34')]?_0x162d7f['attributes']:_0x20cf11[_0x3b78('0x2e')];if(_0x2bd9a7[_0x3b78('0x2f')][_0x3b78('0x3e')]){_0x162d7f[_0x3b78('0x3f')]=[{'all':!![]}];}_0x162d7f=_[_0x3b78('0x3b')]({},_0x162d7f,_0x2bd9a7[_0x3b78('0x3d')]);return db[_0x3b78('0x2a')][_0x3b78('0x44')](_0x162d7f)[_0x3b78('0x22')](handleEntityNotFound(_0xd6aad,null))['then'](respondWithResult(_0xd6aad,null))[_0x3b78('0x45')](handleError(_0xd6aad,null));};exports[_0x3b78('0x46')]=function(_0x49717c,_0x542e73){return db[_0x3b78('0x2a')][_0x3b78('0x46')](_0x49717c['body'],{})['then'](respondWithResult(_0x542e73,0xc9))[_0x3b78('0x45')](handleError(_0x542e73,null));};exports[_0x3b78('0x47')]=function(_0x3c66e2,_0x398b14){return db[_0x3b78('0x2a')][_0x3b78('0x47')](_0x3c66e2[_0x3b78('0x48')],{'raw':![],'individualHooks':!![]})[_0x3b78('0x22')](respondWithResult(_0x398b14,0xc9))[_0x3b78('0x45')](handleError(_0x398b14,null));};exports[_0x3b78('0x21')]=function(_0xac17d7,_0x52e009){if(_0xac17d7[_0x3b78('0x48')]['id']){delete _0xac17d7[_0x3b78('0x48')]['id'];}return db['AnalyticFieldReport'][_0x3b78('0x44')]({'where':{'id':_0xac17d7[_0x3b78('0x49')]['id']}})[_0x3b78('0x22')](handleEntityNotFound(_0x52e009,null))[_0x3b78('0x22')](saveUpdates(_0xac17d7[_0x3b78('0x48')],null))[_0x3b78('0x22')](respondWithResult(_0x52e009,null))['catch'](handleError(_0x52e009,null));};exports['destroy']=function(_0x16c7be,_0x252d17){return db[_0x3b78('0x2a')]['find']({'where':{'id':_0x16c7be[_0x3b78('0x49')]['id']}})[_0x3b78('0x22')](handleEntityNotFound(_0x252d17,null))[_0x3b78('0x22')](removeEntity(_0x252d17,null))[_0x3b78('0x45')](handleError(_0x252d17,null));};exports[_0x3b78('0x4a')]=function(_0x4d291b,_0x1cf4b8){return db['AnalyticFieldReport'][_0x3b78('0x23')]({'where':{'id':_0x4d291b[_0x3b78('0x2f')][_0x3b78('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x3b78('0x22')](respondWithResult(_0x1cf4b8,0xcc))[_0x3b78('0x45')](handleError(_0x1cf4b8,null));};exports[_0x3b78('0x4c')]=function(_0x17128f,_0x246e68,_0x2cdb8b){return db[_0x3b78('0x4d')][_0x3b78('0x4e')]({'where':{'id':_0x17128f[_0x3b78('0x49')]['id']}})[_0x3b78('0x22')](handleEntityNotFound(_0x246e68,null))['then'](function(_0x598abf){if(_0x598abf){return db[_0x3b78('0x4f')][_0x3b78('0x50')](function(_0x255fe6){return db['AnalyticFieldReport'][_0x3b78('0x23')]({'where':{'CustomReportId':_0x17128f[_0x3b78('0x49')]['id']},'transaction':_0x255fe6})[_0x3b78('0x22')](function(_0x3a68ed){var _0x3b8f78=_[_0x3b78('0x29')](_0x17128f['body'],function(_0x4b881d){delete _0x4b881d['id'];_0x4b881d[_0x3b78('0x51')]=_0x17128f[_0x3b78('0x49')]['id'];return _0x4b881d;});return db[_0x3b78('0x2a')][_0x3b78('0x47')](_0x3b8f78,{'transaction':_0x255fe6});});})['then'](function(){return db[_0x3b78('0x2a')][_0x3b78('0x40')]({'where':{'CustomReportId':_0x17128f[_0x3b78('0x49')]['id']}});});}})['then'](respondWithResult(_0x246e68,null))['catch'](handleError(_0x246e68,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index b559c2d..1ed1e2a 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 _0x230d=['./analyticFieldReport.attributes','exports','define','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x273a62,_0x476b33){var _0x29222d=function(_0x1862ca){while(--_0x1862ca){_0x273a62['push'](_0x273a62['shift']());}};_0x29222d(++_0x476b33);}(_0x230d,0x16b));var _0xd230=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x230d[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xd230('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd230('0x1'));var moment=require('moment');var BPromise=require(_0xd230('0x2'));var rp=require(_0xd230('0x3'));var fs=require('fs');var path=require(_0xd230('0x4'));var rimraf=require(_0xd230('0x5'));var config=require(_0xd230('0x6'));var attributes=require(_0xd230('0x7'));module[_0xd230('0x8')]=function(_0x1fc42d,_0x5b3245){return _0x1fc42d[_0xd230('0x9')]('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x30b2=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x30b2,0xb6));var _0x230b=function(_0xea8c60,_0xb2a815){_0xea8c60=_0xea8c60-0x0;var _0x2a6e18=_0x30b2[_0xea8c60];return _0x2a6e18;};'use strict';var _=require(_0x230b('0x0'));var util=require(_0x230b('0x1'));var logger=require(_0x230b('0x2'))(_0x230b('0x3'));var moment=require(_0x230b('0x4'));var BPromise=require(_0x230b('0x5'));var rp=require(_0x230b('0x6'));var fs=require('fs');var path=require(_0x230b('0x7'));var rimraf=require(_0x230b('0x8'));var config=require(_0x230b('0x9'));var attributes=require(_0x230b('0xa'));module[_0x230b('0xb')]=function(_0x11ecd5,_0x43d67c){return _0x11ecd5[_0x230b('0xc')]('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','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 a0abdee..b38a3ab 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 _0x5754=['rpc','../../config/environment','jayson/promise','request','then','info','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticFieldReport,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','../../mysqldb','../../config/logger'];(function(_0x43d691,_0x16829c){var _0x428ff7=function(_0x22c902){while(--_0x22c902){_0x43d691['push'](_0x43d691['shift']());}};_0x428ff7(++_0x16829c);}(_0x5754,0x1db));var _0x4575=function(_0x52669a,_0xbab1e0){_0x52669a=_0x52669a-0x0;var _0x49c514=_0x5754[_0x52669a];return _0x49c514;};'use strict';var _=require(_0x4575('0x0'));var util=require(_0x4575('0x1'));var moment=require(_0x4575('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4575('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4575('0x4'))(_0x4575('0x5'));var config=require(_0x4575('0x6'));var jayson=require(_0x4575('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x31bda0,_0x244cdb,_0x3cc6ba){return new BPromise(function(_0x4b9bc4,_0x9898c1){return client[_0x4575('0x8')](_0x31bda0,_0x3cc6ba)[_0x4575('0x9')](function(_0x5b9120){logger[_0x4575('0xa')]('AnalyticFieldReport,\x20%s,\x20%s',_0x244cdb,'request\x20sent');logger[_0x4575('0xb')](_0x4575('0xc'),_0x244cdb,'request\x20sent',JSON[_0x4575('0xd')](_0x5b9120));if(_0x5b9120[_0x4575('0xe')]){if(_0x5b9120[_0x4575('0xe')]['code']===0x1f4){logger[_0x4575('0xe')](_0x4575('0xf'),_0x244cdb,_0x5b9120[_0x4575('0xe')][_0x4575('0x10')]);return _0x9898c1(_0x5b9120[_0x4575('0xe')][_0x4575('0x10')]);}logger[_0x4575('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x244cdb,_0x5b9120['error']['message']);return _0x4b9bc4(_0x5b9120[_0x4575('0xe')][_0x4575('0x10')]);}else{logger[_0x4575('0xa')](_0x4575('0xf'),_0x244cdb,_0x4575('0x11'));_0x4b9bc4(_0x5b9120[_0x4575('0x12')]['message']);}})[_0x4575('0x13')](function(_0xeb93d4){logger[_0x4575('0xe')](_0x4575('0xf'),_0x244cdb,_0xeb93d4);_0x9898c1(_0xeb93d4);});});}
\ No newline at end of file
+var _0x4fcf=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x51b661,_0x566ef8){var _0x5d1971=function(_0x5cc6b8){while(--_0x5cc6b8){_0x51b661['push'](_0x51b661['shift']());}};_0x5d1971(++_0x566ef8);}(_0x4fcf,0x83));var _0xf4fc=function(_0x2c2439,_0x325167){_0x2c2439=_0x2c2439-0x0;var _0x2db2ef=_0x4fcf[_0x2c2439];return _0x2db2ef;};'use strict';var _=require(_0xf4fc('0x0'));var util=require(_0xf4fc('0x1'));var moment=require(_0xf4fc('0x2'));var BPromise=require(_0xf4fc('0x3'));var rs=require(_0xf4fc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf4fc('0x5'))['db'];var utils=require(_0xf4fc('0x6'));var logger=require('../../config/logger')(_0xf4fc('0x7'));var config=require(_0xf4fc('0x8'));var jayson=require(_0xf4fc('0x9'));var client=jayson['client'][_0xf4fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x252c51,_0x26f07b,_0x5e6819){return new BPromise(function(_0x55a00f,_0x13f6bf){return client[_0xf4fc('0xb')](_0x252c51,_0x5e6819)[_0xf4fc('0xc')](function(_0x7c564b){logger[_0xf4fc('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x26f07b,_0xf4fc('0xe'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x26f07b,_0xf4fc('0xe'),JSON[_0xf4fc('0xf')](_0x7c564b));if(_0x7c564b[_0xf4fc('0x10')]){if(_0x7c564b[_0xf4fc('0x10')][_0xf4fc('0x11')]===0x1f4){logger[_0xf4fc('0x10')](_0xf4fc('0x12'),_0x26f07b,_0x7c564b['error']['message']);return _0x13f6bf(_0x7c564b[_0xf4fc('0x10')]['message']);}logger['error'](_0xf4fc('0x12'),_0x26f07b,_0x7c564b['error'][_0xf4fc('0x13')]);return _0x55a00f(_0x7c564b[_0xf4fc('0x10')][_0xf4fc('0x13')]);}else{logger[_0xf4fc('0xd')](_0xf4fc('0x12'),_0x26f07b,'request\x20sent');_0x55a00f(_0x7c564b[_0xf4fc('0x14')][_0xf4fc('0x13')]);}})[_0xf4fc('0x15')](function(_0x545391){logger[_0xf4fc('0x10')](_0xf4fc('0x12'),_0x26f07b,_0x545391);_0x13f6bf(_0x545391);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index f190dfe..7321747 100644
--- a/server/api/analyticFieldReport/index.js
+++ b/server/api/analyticFieldReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x419a97,_0x19fe2f){var _0x421d39=function(_0xd4afc4){while(--_0xd4afc4){_0x419a97['push'](_0x419a97['shift']());}};_0x421d39(++_0x19fe2f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
+var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x5b1ffc,_0xcb589c){var _0xce73b0=function(_0x3f6ff4){while(--_0x3f6ff4){_0x5b1ffc['push'](_0x5b1ffc['shift']());}};_0xce73b0(++_0xcb589c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js
index ce7828a..d08ea32 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 _0x2cbd=['exports','name','STRING','TEXT','sequelize'];(function(_0x3c166f,_0x56520f){var _0xf2c083=function(_0x17409a){while(--_0x17409a){_0x3c166f['push'](_0x3c166f['shift']());}};_0xf2c083(++_0x56520f);}(_0x2cbd,0x19e));var _0xd2cb=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x2cbd[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0xd2cb('0x0'));module[_0xd2cb('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd2cb('0x2')},'table':{'type':Sequelize[_0xd2cb('0x3')]},'metric':{'type':Sequelize[_0xd2cb('0x4')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xe9e8=['name','TEXT','sequelize','exports','STRING'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xe9e8,0x6b));var _0x8e9e=function(_0x3b1cf8,_0x2068f1){_0x3b1cf8=_0x3b1cf8-0x0;var _0x5bd2e0=_0xe9e8[_0x3b1cf8];return _0x5bd2e0;};'use strict';var Sequelize=require(_0x8e9e('0x0'));module[_0x8e9e('0x1')]={'name':{'type':Sequelize[_0x8e9e('0x2')],'allowNull':![],'unique':_0x8e9e('0x3')},'table':{'type':Sequelize[_0x8e9e('0x2')]},'metric':{'type':Sequelize[_0x8e9e('0x4')]},'description':{'type':Sequelize[_0x8e9e('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 5f74b10..9489a45 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 _0x1cb9=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','show','params','keys','length','find','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x162e6c,_0x40cee6){_0x162e6c=_0x162e6c-0x0;var _0x36b22d=_0x1cb9[_0x162e6c];return _0x36b22d;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];function respondWithStatusCode(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xcc;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0x19')](_0x4ba2f2);}return _0x366f09[_0x91cb('0x1a')](_0x4ba2f2)[_0x91cb('0x1b')]();};}function respondWithResult(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0xc8;return function(_0x4aae25){if(_0x4aae25){return _0x4a7d45[_0x91cb('0x1a')](_0x4cc6ef)['json'](_0x4aae25);}};}function respondWithFilteredResult(_0x528f73,_0x576369){return function(_0xc3629e){if(_0xc3629e){var _0x347980=typeof _0x576369['offset']===_0x91cb('0x1c')&&typeof _0x576369[_0x91cb('0x1d')]==='undefined';var _0xc594e3=_0xc3629e[_0x91cb('0x1e')];var _0x1cd34b=_0x347980?0x0:_0x576369[_0x91cb('0x1f')];var _0x5cc1c3=_0x347980?_0xc3629e[_0x91cb('0x1e')]:_0x576369[_0x91cb('0x1f')]+_0x576369['limit'];var _0x123847;if(_0x5cc1c3>=_0xc594e3){_0x5cc1c3=_0xc594e3;_0x123847=0xc8;}else{_0x123847=0xce;}_0x528f73['status'](_0x123847);return _0x528f73['set'](_0x91cb('0x20'),_0x1cd34b+'-'+_0x5cc1c3+'/'+_0xc594e3)[_0x91cb('0x21')](_0xc3629e);}return null;};}function patchUpdates(_0x56e409){return function(_0x51a1d5){try{jsonpatch['apply'](_0x51a1d5,_0x56e409,!![]);}catch(_0x438162){return BPromise[_0x91cb('0x22')](_0x438162);}return _0x51a1d5[_0x91cb('0x23')]();};}function saveUpdates(_0x1dbee2,_0x5c6a15){return function(_0x45c4b3){if(_0x45c4b3){return _0x45c4b3[_0x91cb('0x24')](_0x1dbee2)[_0x91cb('0x25')](function(_0x55fa78){return _0x55fa78;});}return null;};}function removeEntity(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(_0x2447e7){return _0x2447e7[_0x91cb('0x26')]()[_0x91cb('0x25')](function(){var _0x7ad361=_0x2447e7[_0x91cb('0x27')]({'plain':!![]});var _0x423c4f=_0x91cb('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x423c4f,'resourceId':_0x7ad361['id']}})[_0x91cb('0x25')](function(){return _0x2447e7;});})['then'](function(){_0x26f18f[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();});}};}function handleEntityNotFound(_0x318031,_0x5595c5){return function(_0x9b26a6){if(!_0x9b26a6){_0x318031['sendStatus'](0x194);}return _0x9b26a6;};}function handleError(_0x4572f6,_0x308e8c){_0x308e8c=_0x308e8c||0x1f4;return function(_0x3b3ee6){logger[_0x91cb('0x29')](_0x3b3ee6[_0x91cb('0x2a')]);if(_0x3b3ee6['name']){delete _0x3b3ee6[_0x91cb('0x2b')];}_0x4572f6['status'](_0x308e8c)[_0x91cb('0x2c')](_0x3b3ee6);};}exports[_0x91cb('0x2d')]=function(_0x445fe1,_0x4944bd){var _0x775c25={},_0x146e1f={},_0x25bbf9={'count':0x0,'rows':[]};var _0x361e4c=_[_0x91cb('0x2e')](db[_0x91cb('0x2f')][_0x91cb('0x30')],function(_0x3bbde3){return{'name':_0x3bbde3[_0x91cb('0x31')],'type':_0x3bbde3['type'][_0x91cb('0x32')]};});_0x146e1f[_0x91cb('0x33')]=_[_0x91cb('0x2e')](_0x361e4c,_0x91cb('0x2b'));_0x146e1f[_0x91cb('0x34')]=_['keys'](_0x445fe1[_0x91cb('0x34')]);_0x146e1f[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x146e1f[_0x91cb('0x33')],_0x146e1f[_0x91cb('0x34')]);_0x775c25['attributes']=_[_0x91cb('0x36')](_0x146e1f['model'],qs['fields'](_0x445fe1['query'][_0x91cb('0x37')]));_0x775c25['attributes']=_0x775c25[_0x91cb('0x38')]['length']?_0x775c25['attributes']:_0x146e1f[_0x91cb('0x33')];if(!_0x445fe1[_0x91cb('0x34')][_0x91cb('0x39')](_0x91cb('0x3a'))){_0x775c25[_0x91cb('0x1d')]=qs['limit'](_0x445fe1[_0x91cb('0x34')][_0x91cb('0x1d')]);_0x775c25[_0x91cb('0x1f')]=qs[_0x91cb('0x1f')](_0x445fe1['query']['offset']);}_0x775c25[_0x91cb('0x3b')]=qs[_0x91cb('0x3c')](_0x445fe1['query'][_0x91cb('0x3c')]);_0x775c25[_0x91cb('0x3d')]=qs['filters'](_[_0x91cb('0x3e')](_0x445fe1[_0x91cb('0x34')],_0x146e1f['filters']),_0x361e4c);if(_0x445fe1[_0x91cb('0x34')]['filter']){_0x775c25[_0x91cb('0x3d')]=_[_0x91cb('0x3f')](_0x775c25[_0x91cb('0x3d')],{'$or':_[_0x91cb('0x2e')](_0x361e4c,function(_0x51d0ea){if(_0x51d0ea[_0x91cb('0x40')]!=='VIRTUAL'){var _0xa90111={};_0xa90111[_0x51d0ea[_0x91cb('0x2b')]]={'$like':'%'+_0x445fe1['query'][_0x91cb('0x41')]+'%'};return _0xa90111;}})});}_0x775c25=_['merge']({},_0x775c25,_0x445fe1[_0x91cb('0x42')]);var _0x2eac87={'where':_0x775c25[_0x91cb('0x3d')]};return db[_0x91cb('0x2f')]['count'](_0x2eac87)[_0x91cb('0x25')](function(_0x5af0e6){_0x25bbf9[_0x91cb('0x1e')]=_0x5af0e6;if(_0x445fe1[_0x91cb('0x34')][_0x91cb('0x43')]){_0x775c25[_0x91cb('0x44')]=[{'all':!![]}];}return db[_0x91cb('0x2f')][_0x91cb('0x45')](_0x775c25);})[_0x91cb('0x25')](function(_0x3cc4c1){_0x25bbf9['rows']=_0x3cc4c1;return _0x25bbf9;})[_0x91cb('0x25')](respondWithFilteredResult(_0x4944bd,_0x775c25))['catch'](handleError(_0x4944bd,null));};exports[_0x91cb('0x46')]=function(_0x5537a0,_0x335879){var _0x52e82c={'raw':!![],'where':{'id':_0x5537a0[_0x91cb('0x47')]['id']}},_0x138f48={};_0x138f48[_0x91cb('0x33')]=_[_0x91cb('0x48')](db['AnalyticMetric'][_0x91cb('0x30')]);_0x138f48[_0x91cb('0x34')]=_['keys'](_0x5537a0[_0x91cb('0x34')]);_0x138f48[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],_0x138f48[_0x91cb('0x34')]);_0x52e82c[_0x91cb('0x38')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],qs[_0x91cb('0x37')](_0x5537a0['query'][_0x91cb('0x37')]));_0x52e82c[_0x91cb('0x38')]=_0x52e82c[_0x91cb('0x38')][_0x91cb('0x49')]?_0x52e82c[_0x91cb('0x38')]:_0x138f48[_0x91cb('0x33')];if(_0x5537a0[_0x91cb('0x34')][_0x91cb('0x43')]){_0x52e82c['include']=[{'all':!![]}];}_0x52e82c=_[_0x91cb('0x3f')]({},_0x52e82c,_0x5537a0[_0x91cb('0x42')]);return db[_0x91cb('0x2f')][_0x91cb('0x4a')](_0x52e82c)['then'](handleEntityNotFound(_0x335879,null))[_0x91cb('0x25')](respondWithResult(_0x335879,null))[_0x91cb('0x4b')](handleError(_0x335879,null));};exports['create']=function(_0x212473,_0x47cdb7){return db[_0x91cb('0x2f')]['create'](_0x212473['body'],{})['then'](function(_0x98245b){var _0xff3d11=_0x212473[_0x91cb('0x4c')][_0x91cb('0x27')]({'plain':!![]});if(!_0xff3d11)throw new Error(_0x91cb('0x4d'));if(_0xff3d11['role']==='user'){var _0x1d26b8=_0x98245b[_0x91cb('0x27')]({'plain':!![]});var _0x140994=_0x91cb('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x140994,'userProfileId':_0xff3d11['userProfileId']},'raw':!![]})[_0x91cb('0x25')](function(_0x490417){if(_0x490417&&_0x490417[_0x91cb('0x4e')]===0x0){return db['UserProfileResource'][_0x91cb('0x4f')]({'name':_0x1d26b8[_0x91cb('0x2b')],'resourceId':_0x1d26b8['id'],'type':_0x490417[_0x91cb('0x2b')],'sectionId':_0x490417['id']},{})[_0x91cb('0x25')](function(){return _0x98245b;});}else{return _0x98245b;}})[_0x91cb('0x4b')](function(_0x362532){logger[_0x91cb('0x29')](_0x91cb('0x50'),_0x362532);throw _0x362532;});}return _0x98245b;})[_0x91cb('0x25')](respondWithResult(_0x47cdb7,0xc9))[_0x91cb('0x4b')](handleError(_0x47cdb7,null));};exports[_0x91cb('0x24')]=function(_0x5752ed,_0x1e445a){if(_0x5752ed[_0x91cb('0x51')]['id']){delete _0x5752ed['body']['id'];}return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x5752ed['params']['id']}})[_0x91cb('0x25')](handleEntityNotFound(_0x1e445a,null))[_0x91cb('0x25')](saveUpdates(_0x5752ed[_0x91cb('0x51')],null))[_0x91cb('0x25')](respondWithResult(_0x1e445a,null))[_0x91cb('0x4b')](handleError(_0x1e445a,null));};exports[_0x91cb('0x26')]=function(_0x1d4b96,_0x274fff){return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x1d4b96[_0x91cb('0x47')]['id']}})['then'](handleEntityNotFound(_0x274fff,null))[_0x91cb('0x25')](removeEntity(_0x274fff,null))['catch'](handleError(_0x274fff,null));};
\ No newline at end of file
+var _0x3e74=['status','set','Content-Range','apply','save','update','then','destroy','get','Metrics','sendStatus','stack','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','params','rawAttributes','length','includeAll','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count'];(function(_0x14eba6,_0x395ec9){var _0x37f5ad=function(_0x445d2c){while(--_0x445d2c){_0x14eba6['push'](_0x14eba6['shift']());}};_0x37f5ad(++_0x395ec9);}(_0x3e74,0x175));var _0x43e7=function(_0xb6f35c,_0x2d32b0){_0xb6f35c=_0xb6f35c-0x0;var _0xb539a8=_0x3e74[_0xb6f35c];return _0xb539a8;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){var _0x4b2b9f=_0x4c9df3[_0x43e7('0x23')]({'plain':!![]});var _0x4ca5cf=_0x43e7('0x24');return db['UserProfileResource'][_0x43e7('0x22')]({'where':{'type':_0x4ca5cf,'resourceId':_0x4b2b9f['id']}})[_0x43e7('0x21')](function(){return _0x4c9df3;});})[_0x43e7('0x21')](function(){_0x454359[_0x43e7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52b7b3,_0x805b54){return function(_0x501551){if(!_0x501551){_0x52b7b3[_0x43e7('0x25')](0x194);}return _0x501551;};}function handleError(_0x40dc8f,_0x3565cf){_0x3565cf=_0x3565cf||0x1f4;return function(_0xb1fc63){logger['error'](_0xb1fc63[_0x43e7('0x26')]);if(_0xb1fc63[_0x43e7('0x27')]){delete _0xb1fc63[_0x43e7('0x27')];}_0x40dc8f[_0x43e7('0x1b')](_0x3565cf)[_0x43e7('0x28')](_0xb1fc63);};}exports[_0x43e7('0x29')]=function(_0x2b85a5,_0x31b2a6){var _0x3bf475={},_0x35dbcd={},_0x17df44={'count':0x0,'rows':[]};var _0x19725a=_[_0x43e7('0x2a')](db[_0x43e7('0x2b')]['rawAttributes'],function(_0x238321){return{'name':_0x238321[_0x43e7('0x2c')],'type':_0x238321[_0x43e7('0x2d')][_0x43e7('0x2e')]};});_0x35dbcd[_0x43e7('0x2f')]=_['map'](_0x19725a,_0x43e7('0x27'));_0x35dbcd[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x2b85a5[_0x43e7('0x30')]);_0x35dbcd['filters']=_['intersection'](_0x35dbcd['model'],_0x35dbcd[_0x43e7('0x30')]);_0x3bf475[_0x43e7('0x32')]=_[_0x43e7('0x33')](_0x35dbcd[_0x43e7('0x2f')],qs[_0x43e7('0x34')](_0x2b85a5[_0x43e7('0x30')]['fields']));_0x3bf475['attributes']=_0x3bf475['attributes']['length']?_0x3bf475['attributes']:_0x35dbcd['model'];if(!_0x2b85a5['query'][_0x43e7('0x35')]('nolimit')){_0x3bf475[_0x43e7('0x18')]=qs[_0x43e7('0x18')](_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x18')]);_0x3bf475[_0x43e7('0x19')]=qs[_0x43e7('0x19')](_0x2b85a5[_0x43e7('0x30')]['offset']);}_0x3bf475['order']=qs['sort'](_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x36')]);_0x3bf475[_0x43e7('0x37')]=qs[_0x43e7('0x38')](_[_0x43e7('0x39')](_0x2b85a5[_0x43e7('0x30')],_0x35dbcd[_0x43e7('0x38')]),_0x19725a);if(_0x2b85a5[_0x43e7('0x30')]['filter']){_0x3bf475[_0x43e7('0x37')]=_[_0x43e7('0x3a')](_0x3bf475['where'],{'$or':_[_0x43e7('0x2a')](_0x19725a,function(_0x4c0c7a){if(_0x4c0c7a[_0x43e7('0x2d')]!==_0x43e7('0x3b')){var _0x1c6f45={};_0x1c6f45[_0x4c0c7a[_0x43e7('0x27')]]={'$like':'%'+_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x3c')]+'%'};return _0x1c6f45;}})});}_0x3bf475=_['merge']({},_0x3bf475,_0x2b85a5['options']);var _0x30dfa9={'where':_0x3bf475[_0x43e7('0x37')]};return db[_0x43e7('0x2b')][_0x43e7('0x1a')](_0x30dfa9)[_0x43e7('0x21')](function(_0x4a4a85){_0x17df44[_0x43e7('0x1a')]=_0x4a4a85;if(_0x2b85a5[_0x43e7('0x30')]['includeAll']){_0x3bf475[_0x43e7('0x3d')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x43e7('0x3e')](_0x3bf475);})['then'](function(_0x3d81ae){_0x17df44[_0x43e7('0x3f')]=_0x3d81ae;return _0x17df44;})[_0x43e7('0x21')](respondWithFilteredResult(_0x31b2a6,_0x3bf475))[_0x43e7('0x40')](handleError(_0x31b2a6,null));};exports['show']=function(_0x47d6a1,_0x103393){var _0x40c509={'raw':!![],'where':{'id':_0x47d6a1[_0x43e7('0x41')]['id']}},_0xe979b5={};_0xe979b5['model']=_['keys'](db['AnalyticMetric'][_0x43e7('0x42')]);_0xe979b5['query']=_[_0x43e7('0x31')](_0x47d6a1['query']);_0xe979b5['filters']=_[_0x43e7('0x33')](_0xe979b5['model'],_0xe979b5[_0x43e7('0x30')]);_0x40c509[_0x43e7('0x32')]=_[_0x43e7('0x33')](_0xe979b5[_0x43e7('0x2f')],qs['fields'](_0x47d6a1[_0x43e7('0x30')][_0x43e7('0x34')]));_0x40c509[_0x43e7('0x32')]=_0x40c509[_0x43e7('0x32')][_0x43e7('0x43')]?_0x40c509[_0x43e7('0x32')]:_0xe979b5['model'];if(_0x47d6a1['query'][_0x43e7('0x44')]){_0x40c509[_0x43e7('0x3d')]=[{'all':!![]}];}_0x40c509=_[_0x43e7('0x3a')]({},_0x40c509,_0x47d6a1['options']);return db['AnalyticMetric']['find'](_0x40c509)[_0x43e7('0x21')](handleEntityNotFound(_0x103393,null))[_0x43e7('0x21')](respondWithResult(_0x103393,null))['catch'](handleError(_0x103393,null));};exports[_0x43e7('0x45')]=function(_0x47686e,_0x3c96fe){return db['AnalyticMetric']['create'](_0x47686e['body'],{})['then'](function(_0x214e7e){var _0xe955fc=_0x47686e['user'][_0x43e7('0x23')]({'plain':!![]});if(!_0xe955fc)throw new Error(_0x43e7('0x46'));if(_0xe955fc[_0x43e7('0x47')]===_0x43e7('0x48')){var _0x4a0ce5=_0x214e7e[_0x43e7('0x23')]({'plain':!![]});var _0x483f20='Metrics';return db[_0x43e7('0x49')][_0x43e7('0x4a')]({'where':{'name':_0x483f20,'userProfileId':_0xe955fc[_0x43e7('0x4b')]},'raw':!![]})[_0x43e7('0x21')](function(_0x13503c){if(_0x13503c&&_0x13503c[_0x43e7('0x4c')]===0x0){return db[_0x43e7('0x4d')][_0x43e7('0x45')]({'name':_0x4a0ce5[_0x43e7('0x27')],'resourceId':_0x4a0ce5['id'],'type':_0x13503c[_0x43e7('0x27')],'sectionId':_0x13503c['id']},{})['then'](function(){return _0x214e7e;});}else{return _0x214e7e;}})[_0x43e7('0x40')](function(_0x46c910){logger['error'](_0x43e7('0x4e'),_0x46c910);throw _0x46c910;});}return _0x214e7e;})['then'](respondWithResult(_0x3c96fe,0xc9))[_0x43e7('0x40')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x20')]=function(_0x34e2ec,_0x1f561f){if(_0x34e2ec[_0x43e7('0x4f')]['id']){delete _0x34e2ec['body']['id'];}return db['AnalyticMetric'][_0x43e7('0x4a')]({'where':{'id':_0x34e2ec[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x1f561f,null))[_0x43e7('0x21')](saveUpdates(_0x34e2ec[_0x43e7('0x4f')],null))[_0x43e7('0x21')](respondWithResult(_0x1f561f,null))[_0x43e7('0x40')](handleError(_0x1f561f,null));};exports[_0x43e7('0x22')]=function(_0x26d86c,_0x24e758){return db[_0x43e7('0x2b')]['find']({'where':{'id':_0x26d86c[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x24e758,null))['then'](removeEntity(_0x24e758,null))[_0x43e7('0x40')](handleError(_0x24e758,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index fd62309..2b5a776 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 _0x1c88=['./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x589c08,_0x264b33){var _0xc21d72=function(_0x33a9ea){while(--_0x33a9ea){_0x589c08['push'](_0x589c08['shift']());}};_0xc21d72(++_0x264b33);}(_0x1c88,0x1a9));var _0x81c8=function(_0x3b3750,_0x28f3b8){_0x3b3750=_0x3b3750-0x0;var _0x1b9e8b=_0x1c88[_0x3b3750];return _0x1b9e8b;};'use strict';var _=require(_0x81c8('0x0'));var util=require('util');var logger=require(_0x81c8('0x1'))(_0x81c8('0x2'));var moment=require(_0x81c8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x81c8('0x4'));var rimraf=require(_0x81c8('0x5'));var config=require(_0x81c8('0x6'));var attributes=require(_0x81c8('0x7'));module[_0x81c8('0x8')]=function(_0x3e5721,_0x3f4e27){return _0x3e5721[_0x81c8('0x9')](_0x81c8('0xa'),attributes,{'tableName':_0x81c8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x446c=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','analytics_metrics'];(function(_0x422218,_0x5618bb){var _0x3e46cb=function(_0x5434d2){while(--_0x5434d2){_0x422218['push'](_0x422218['shift']());}};_0x3e46cb(++_0x5618bb);}(_0x446c,0x156));var _0xc446=function(_0x33c1b1,_0x2355fb){_0x33c1b1=_0x33c1b1-0x0;var _0x2c2037=_0x446c[_0x33c1b1];return _0x2c2037;};'use strict';var _=require(_0xc446('0x0'));var util=require(_0xc446('0x1'));var logger=require(_0xc446('0x2'))(_0xc446('0x3'));var moment=require('moment');var BPromise=require(_0xc446('0x4'));var rp=require(_0xc446('0x5'));var fs=require('fs');var path=require(_0xc446('0x6'));var rimraf=require('rimraf');var config=require(_0xc446('0x7'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x115a9e,_0x235050){return _0x115a9e['define']('AnalyticMetric',attributes,{'tableName':_0xc446('0x8'),'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 948ac6b..dfc7614 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 _0xe93c=['jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x4b558c,_0x2e639b){var _0x394f88=function(_0x3a61fc){while(--_0x3a61fc){_0x4b558c['push'](_0x4b558c['shift']());}};_0x394f88(++_0x2e639b);}(_0xe93c,0x67));var _0xce93=function(_0x3ba4a9,_0x2478e7){_0x3ba4a9=_0x3ba4a9-0x0;var _0x2bc1e4=_0xe93c[_0x3ba4a9];return _0x2bc1e4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xce93('0x0'));var BPromise=require(_0xce93('0x1'));var rs=require(_0xce93('0x2'));var fs=require('fs');var Redis=require(_0xce93('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xce93('0x4'))(_0xce93('0x5'));var config=require(_0xce93('0x6'));var jayson=require(_0xce93('0x7'));var client=jayson[_0xce93('0x8')][_0xce93('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x367445,_0x2791c6,_0x25ad76){return new BPromise(function(_0x56c77a,_0x2faf62){return client[_0xce93('0xa')](_0x367445,_0x25ad76)[_0xce93('0xb')](function(_0xb85aed){logger[_0xce93('0xc')](_0xce93('0xd'),_0x2791c6,_0xce93('0xe'));logger[_0xce93('0xf')](_0xce93('0x10'),_0x2791c6,'request\x20sent',JSON[_0xce93('0x11')](_0xb85aed));if(_0xb85aed[_0xce93('0x12')]){if(_0xb85aed['error'][_0xce93('0x13')]===0x1f4){logger[_0xce93('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x2791c6,_0xb85aed[_0xce93('0x12')][_0xce93('0x14')]);return _0x2faf62(_0xb85aed['error'][_0xce93('0x14')]);}logger[_0xce93('0x12')](_0xce93('0xd'),_0x2791c6,_0xb85aed[_0xce93('0x12')][_0xce93('0x14')]);return _0x56c77a(_0xb85aed[_0xce93('0x12')][_0xce93('0x14')]);}else{logger['info'](_0xce93('0xd'),_0x2791c6,_0xce93('0xe'));_0x56c77a(_0xb85aed['result']['message']);}})[_0xce93('0x15')](function(_0x22b4ff){logger[_0xce93('0x12')](_0xce93('0xd'),_0x2791c6,_0x22b4ff);_0x2faf62(_0x22b4ff);});});}
\ No newline at end of file
+var _0x9261=['info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x478072,_0x4c1438){var _0x2bc255=function(_0x3ab9c2){while(--_0x3ab9c2){_0x478072['push'](_0x478072['shift']());}};_0x2bc255(++_0x4c1438);}(_0x9261,0xf5));var _0x1926=function(_0x3a94e1,_0x22e4fd){_0x3a94e1=_0x3a94e1-0x0;var _0x6a09d5=_0x9261[_0x3a94e1];return _0x6a09d5;};'use strict';var _=require('lodash');var util=require(_0x1926('0x0'));var moment=require(_0x1926('0x1'));var BPromise=require(_0x1926('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1926('0x3'));var db=require(_0x1926('0x4'))['db'];var utils=require(_0x1926('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x1926('0x6'));var jayson=require(_0x1926('0x7'));var client=jayson[_0x1926('0x8')][_0x1926('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c9986,_0x32ff56,_0x521d55){return new BPromise(function(_0x49d364,_0x23bb75){return client[_0x1926('0xa')](_0x1c9986,_0x521d55)[_0x1926('0xb')](function(_0x3e2f3e){logger['info'](_0x1926('0xc'),_0x32ff56,_0x1926('0xd'));logger[_0x1926('0xe')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x32ff56,_0x1926('0xd'),JSON[_0x1926('0xf')](_0x3e2f3e));if(_0x3e2f3e[_0x1926('0x10')]){if(_0x3e2f3e['error'][_0x1926('0x11')]===0x1f4){logger[_0x1926('0x10')](_0x1926('0xc'),_0x32ff56,_0x3e2f3e[_0x1926('0x10')]['message']);return _0x23bb75(_0x3e2f3e['error'][_0x1926('0x12')]);}logger[_0x1926('0x10')](_0x1926('0xc'),_0x32ff56,_0x3e2f3e[_0x1926('0x10')]['message']);return _0x49d364(_0x3e2f3e[_0x1926('0x10')][_0x1926('0x12')]);}else{logger[_0x1926('0x13')](_0x1926('0xc'),_0x32ff56,'request\x20sent');_0x49d364(_0x3e2f3e[_0x1926('0x14')][_0x1926('0x12')]);}})[_0x1926('0x15')](function(_0x3a9239){logger[_0x1926('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x32ff56,_0x3a9239);_0x23bb75(_0x3a9239);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 4e5aa30..7b8e2a4 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 _0x032e=['show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id'];(function(_0x971946,_0x583576){var _0x204592=function(_0x2447ac){while(--_0x2447ac){_0x971946['push'](_0x971946['shift']());}};_0x204592(++_0x583576);}(_0x032e,0x124));var _0xe032=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x032e[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')]('/',auth[_0xe032('0x9')](),controller[_0xe032('0xa')]);router[_0xe032('0x8')](_0xe032('0xb'),auth[_0xe032('0x9')](),controller[_0xe032('0xc')]);router[_0xe032('0xd')]('/',auth[_0xe032('0x9')](),controller[_0xe032('0xe')]);router[_0xe032('0xf')](_0xe032('0xb'),auth[_0xe032('0x9')](),controller['update']);router[_0xe032('0x10')](_0xe032('0xb'),auth[_0xe032('0x9')](),controller[_0xe032('0x11')]);module[_0xe032('0x12')]=router;
\ No newline at end of file
+var _0xd072=['post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','show'];(function(_0x17c0ec,_0x2cb3f7){var _0x4b4577=function(_0x59d39c){while(--_0x59d39c){_0x17c0ec['push'](_0x17c0ec['shift']());}};_0x4b4577(++_0x2cb3f7);}(_0xd072,0x132));var _0x2d07=function(_0x240594,_0x13f678){_0x240594=_0x240594-0x0;var _0x1a5798=_0xd072[_0x240594];return _0x1a5798;};'use strict';var multer=require(_0x2d07('0x0'));var util=require(_0x2d07('0x1'));var path=require(_0x2d07('0x2'));var timeout=require(_0x2d07('0x3'));var express=require(_0x2d07('0x4'));var router=express[_0x2d07('0x5')]();var fs_extra=require(_0x2d07('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2d07('0x7'));var config=require(_0x2d07('0x8'));var controller=require(_0x2d07('0x9'));router[_0x2d07('0xa')]('/',auth[_0x2d07('0xb')](),controller['index']);router[_0x2d07('0xa')](_0x2d07('0xc'),auth[_0x2d07('0xb')](),controller[_0x2d07('0xd')]);router[_0x2d07('0xe')]('/',auth[_0x2d07('0xb')](),controller[_0x2d07('0xf')]);router['put'](_0x2d07('0xc'),auth[_0x2d07('0xb')](),controller[_0x2d07('0x10')]);router[_0x2d07('0x11')](_0x2d07('0xc'),auth[_0x2d07('0xb')](),controller[_0x2d07('0x12')]);module[_0x2d07('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 146f1a5..20e2379 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 _0x06c9=['TEXT','sequelize'];(function(_0x2e9b66,_0xc92c1f){var _0x17438f=function(_0x37326c){while(--_0x37326c){_0x2e9b66['push'](_0x2e9b66['shift']());}};_0x17438f(++_0xc92c1f);}(_0x06c9,0x15f));var _0x906c=function(_0x3be8e1,_0x53ca98){_0x3be8e1=_0x3be8e1-0x0;var _0x424a5a=_0x06c9[_0x3be8e1];return _0x424a5a;};'use strict';var Sequelize=require(_0x906c('0x0'));module['exports']={'tree':{'type':Sequelize[_0x906c('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x0c9c=['exports','TEXT','sequelize'];(function(_0xbb51f3,_0x50f4aa){var _0x4261ef=function(_0x3eec19){while(--_0x3eec19){_0xbb51f3['push'](_0xbb51f3['shift']());}};_0x4261ef(++_0x50f4aa);}(_0x0c9c,0x98));var _0xc0c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c9c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc0c9('0x0'));module[_0xc0c9('0x1')]={'tree':{'type':Sequelize[_0xc0c9('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 6e9c883..b2a8d93 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 _0x54e6=['model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','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/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type'];(function(_0x36fe00,_0x3ff5d0){var _0x34e1c2=function(_0xc7dc03){while(--_0xc7dc03){_0x36fe00['push'](_0x36fe00['shift']());}};_0x34e1c2(++_0x3ff5d0);}(_0x54e6,0x154));var _0x654e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x54e6[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x654e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x654e('0x1'));var moment=require(_0x654e('0x2'));var BPromise=require(_0x654e('0x3'));var Mustache=require(_0x654e('0x4'));var util=require(_0x654e('0x5'));var path=require(_0x654e('0x6'));var sox=require(_0x654e('0x7'));var csv=require(_0x654e('0x8'));var ejs=require(_0x654e('0x9'));var fs=require('fs');var fs_extra=require(_0x654e('0xa'));var _=require(_0x654e('0xb'));var squel=require(_0x654e('0xc'));var crypto=require(_0x654e('0xd'));var jsforce=require(_0x654e('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x654e('0xf'));var Papa=require(_0x654e('0x10'));var Redis=require('ioredis');var authService=require(_0x654e('0x11'));var qs=require(_0x654e('0x12'));var as=require(_0x654e('0x13'));var hardwareService=require(_0x654e('0x14'));var logger=require(_0x654e('0x15'))(_0x654e('0x16'));var utils=require(_0x654e('0x17'));var config=require(_0x654e('0x18'));var licenseUtil=require(_0x654e('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x200889,_0x4c9d34){_0x4c9d34=_0x4c9d34||0xcc;return function(_0x5ce86f){if(_0x5ce86f){return _0x200889[_0x654e('0x1a')](_0x4c9d34);}return _0x200889[_0x654e('0x1b')](_0x4c9d34)[_0x654e('0x1c')]();};}function respondWithResult(_0x4a7585,_0x32fb3d){_0x32fb3d=_0x32fb3d||0xc8;return function(_0xf48492){if(_0xf48492){return _0x4a7585[_0x654e('0x1b')](_0x32fb3d)[_0x654e('0x1d')](_0xf48492);}};}function respondWithFilteredResult(_0x4b7c14,_0xc26dbe){return function(_0x15e2e4){if(_0x15e2e4){var _0x471dad=typeof _0xc26dbe['offset']===_0x654e('0x1e')&&typeof _0xc26dbe[_0x654e('0x1f')]===_0x654e('0x1e');var _0x51cdb7=_0x15e2e4[_0x654e('0x20')];var _0xe4a853=_0x471dad?0x0:_0xc26dbe[_0x654e('0x21')];var _0x233869=_0x471dad?_0x15e2e4[_0x654e('0x20')]:_0xc26dbe['offset']+_0xc26dbe['limit'];var _0x2f00d0;if(_0x233869>=_0x51cdb7){_0x233869=_0x51cdb7;_0x2f00d0=0xc8;}else{_0x2f00d0=0xce;}_0x4b7c14[_0x654e('0x1b')](_0x2f00d0);return _0x4b7c14[_0x654e('0x22')](_0x654e('0x23'),_0xe4a853+'-'+_0x233869+'/'+_0x51cdb7)[_0x654e('0x1d')](_0x15e2e4);}return null;};}function patchUpdates(_0x5d2d40){return function(_0x2e73c0){try{jsonpatch[_0x654e('0x24')](_0x2e73c0,_0x5d2d40,!![]);}catch(_0x30fa8c){return BPromise[_0x654e('0x25')](_0x30fa8c);}return _0x2e73c0['save']();};}function saveUpdates(_0x51945d,_0x542b02){return function(_0xb08c04){if(_0xb08c04){return _0xb08c04['update'](_0x51945d)[_0x654e('0x26')](function(_0x306371){return _0x306371;});}return null;};}function removeEntity(_0x68af24,_0x4cb503){return function(_0x587bc9){if(_0x587bc9){return _0x587bc9[_0x654e('0x27')]()['then'](function(){_0x68af24[_0x654e('0x1b')](0xcc)[_0x654e('0x1c')]();});}};}function handleEntityNotFound(_0x13bd1d,_0x137b96){return function(_0xa416ca){if(!_0xa416ca){_0x13bd1d[_0x654e('0x1a')](0x194);}return _0xa416ca;};}function handleError(_0x58682d,_0x440003){_0x440003=_0x440003||0x1f4;return function(_0x14ee81){logger[_0x654e('0x28')](_0x14ee81[_0x654e('0x29')]);if(_0x14ee81[_0x654e('0x2a')]){delete _0x14ee81['name'];}_0x58682d[_0x654e('0x1b')](_0x440003)[_0x654e('0x2b')](_0x14ee81);};}exports[_0x654e('0x2c')]=function(_0x1a4164,_0x29cd33){var _0x3dd297={},_0x1c6224={},_0x2f60b7={'count':0x0,'rows':[]};var _0x1ed7ee=_[_0x654e('0x2d')](db[_0x654e('0x2e')][_0x654e('0x2f')],function(_0x52c5f5){return{'name':_0x52c5f5[_0x654e('0x30')],'type':_0x52c5f5[_0x654e('0x31')]['key']};});_0x1c6224[_0x654e('0x32')]=_[_0x654e('0x2d')](_0x1ed7ee,_0x654e('0x2a'));_0x1c6224['query']=_[_0x654e('0x33')](_0x1a4164[_0x654e('0x34')]);_0x1c6224[_0x654e('0x35')]=_[_0x654e('0x36')](_0x1c6224[_0x654e('0x32')],_0x1c6224[_0x654e('0x34')]);_0x3dd297[_0x654e('0x37')]=_['intersection'](_0x1c6224[_0x654e('0x32')],qs[_0x654e('0x38')](_0x1a4164[_0x654e('0x34')]['fields']));_0x3dd297[_0x654e('0x37')]=_0x3dd297['attributes'][_0x654e('0x39')]?_0x3dd297[_0x654e('0x37')]:_0x1c6224[_0x654e('0x32')];if(!_0x1a4164['query'][_0x654e('0x3a')](_0x654e('0x3b'))){_0x3dd297[_0x654e('0x1f')]=qs['limit'](_0x1a4164['query'][_0x654e('0x1f')]);_0x3dd297['offset']=qs['offset'](_0x1a4164[_0x654e('0x34')][_0x654e('0x21')]);}_0x3dd297[_0x654e('0x3c')]=qs[_0x654e('0x3d')](_0x1a4164['query'][_0x654e('0x3d')]);_0x3dd297[_0x654e('0x3e')]=qs[_0x654e('0x35')](_[_0x654e('0x3f')](_0x1a4164[_0x654e('0x34')],_0x1c6224[_0x654e('0x35')]),_0x1ed7ee);if(_0x1a4164[_0x654e('0x34')]['filter']){_0x3dd297[_0x654e('0x3e')]=_[_0x654e('0x40')](_0x3dd297[_0x654e('0x3e')],{'$or':_['map'](_0x1ed7ee,function(_0x5bd7a5){if(_0x5bd7a5[_0x654e('0x31')]!==_0x654e('0x41')){var _0x4ff315={};_0x4ff315[_0x5bd7a5[_0x654e('0x2a')]]={'$like':'%'+_0x1a4164[_0x654e('0x34')][_0x654e('0x42')]+'%'};return _0x4ff315;}})});}_0x3dd297=_[_0x654e('0x40')]({},_0x3dd297,_0x1a4164['options']);var _0x2aae02={'where':_0x3dd297['where']};return db[_0x654e('0x2e')][_0x654e('0x20')](_0x2aae02)[_0x654e('0x26')](function(_0x13baa8){_0x2f60b7[_0x654e('0x20')]=_0x13baa8;if(_0x1a4164[_0x654e('0x34')][_0x654e('0x43')]){_0x3dd297[_0x654e('0x44')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x654e('0x45')](_0x3dd297);})['then'](function(_0x51e2e8){_0x2f60b7[_0x654e('0x46')]=_0x51e2e8;return _0x2f60b7;})['then'](respondWithFilteredResult(_0x29cd33,_0x3dd297))[_0x654e('0x47')](handleError(_0x29cd33,null));};exports[_0x654e('0x48')]=function(_0x879e55,_0x23b57e){var _0x18f713={'raw':!![],'where':{'id':_0x879e55['params']['id']}},_0x57f18f={};_0x57f18f['model']=_[_0x654e('0x33')](db[_0x654e('0x2e')][_0x654e('0x2f')]);_0x57f18f[_0x654e('0x34')]=_[_0x654e('0x33')](_0x879e55['query']);_0x57f18f[_0x654e('0x35')]=_[_0x654e('0x36')](_0x57f18f[_0x654e('0x32')],_0x57f18f[_0x654e('0x34')]);_0x18f713['attributes']=_[_0x654e('0x36')](_0x57f18f['model'],qs[_0x654e('0x38')](_0x879e55[_0x654e('0x34')][_0x654e('0x38')]));_0x18f713[_0x654e('0x37')]=_0x18f713[_0x654e('0x37')][_0x654e('0x39')]?_0x18f713[_0x654e('0x37')]:_0x57f18f[_0x654e('0x32')];if(_0x879e55['query'][_0x654e('0x43')]){_0x18f713[_0x654e('0x44')]=[{'all':!![]}];}_0x18f713=_['merge']({},_0x18f713,_0x879e55[_0x654e('0x49')]);return db[_0x654e('0x2e')][_0x654e('0x4a')](_0x18f713)[_0x654e('0x26')](handleEntityNotFound(_0x23b57e,null))[_0x654e('0x26')](respondWithResult(_0x23b57e,null))[_0x654e('0x47')](handleError(_0x23b57e,null));};exports[_0x654e('0x4b')]=function(_0x3441b1,_0x3fbad5){return db['AnalyticTreeReport'][_0x654e('0x4b')](_0x3441b1[_0x654e('0x4c')],{})['then'](respondWithResult(_0x3fbad5,0xc9))[_0x654e('0x47')](handleError(_0x3fbad5,null));};exports['update']=function(_0x46e509,_0x1ea2f4){if(_0x46e509[_0x654e('0x4c')]['id']){delete _0x46e509[_0x654e('0x4c')]['id'];}return db[_0x654e('0x2e')][_0x654e('0x4a')]({'where':{'id':_0x46e509[_0x654e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1ea2f4,null))[_0x654e('0x26')](saveUpdates(_0x46e509[_0x654e('0x4c')],null))[_0x654e('0x26')](respondWithResult(_0x1ea2f4,null))[_0x654e('0x47')](handleError(_0x1ea2f4,null));};exports[_0x654e('0x27')]=function(_0x4f677e,_0x2ebb3c){return db[_0x654e('0x2e')]['find']({'where':{'id':_0x4f677e['params']['id']}})[_0x654e('0x26')](handleEntityNotFound(_0x2ebb3c,null))[_0x654e('0x26')](removeEntity(_0x2ebb3c,null))[_0x654e('0x47')](handleError(_0x2ebb3c,null));};
\ No newline at end of file
+var _0x1bf9=['count','set','Content-Range','save','update','then','sendStatus','error','name','map','AnalyticTreeReport','fieldName','type','key','query','keys','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','filter','options','include','findAll','catch','show','rawAttributes','length','includeAll','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit'];(function(_0x46cc29,_0x473f8e){var _0x5ea06f=function(_0x1051e7){while(--_0x1051e7){_0x46cc29['push'](_0x46cc29['shift']());}};_0x5ea06f(++_0x473f8e);}(_0x1bf9,0x1e5));var _0x91bf=function(_0x3d440d,_0x22372f){_0x3d440d=_0x3d440d-0x0;var _0x1ea28b=_0x1bf9[_0x3d440d];return _0x1ea28b;};'use strict';var emlformat=require(_0x91bf('0x0'));var rimraf=require(_0x91bf('0x1'));var zipdir=require(_0x91bf('0x2'));var jsonpatch=require(_0x91bf('0x3'));var rp=require(_0x91bf('0x4'));var moment=require(_0x91bf('0x5'));var BPromise=require(_0x91bf('0x6'));var Mustache=require(_0x91bf('0x7'));var util=require(_0x91bf('0x8'));var path=require(_0x91bf('0x9'));var sox=require('sox');var csv=require(_0x91bf('0xa'));var ejs=require(_0x91bf('0xb'));var fs=require('fs');var fs_extra=require(_0x91bf('0xc'));var _=require(_0x91bf('0xd'));var squel=require('squel');var crypto=require(_0x91bf('0xe'));var jsforce=require(_0x91bf('0xf'));var deskjs=require(_0x91bf('0x10'));var toCsv=require(_0x91bf('0xa'));var querystring=require(_0x91bf('0x11'));var Papa=require('papaparse');var Redis=require(_0x91bf('0x12'));var authService=require(_0x91bf('0x13'));var qs=require(_0x91bf('0x14'));var as=require(_0x91bf('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x91bf('0x16'))(_0x91bf('0x17'));var utils=require('../../config/utils');var config=require(_0x91bf('0x18'));var licenseUtil=require(_0x91bf('0x19'));var db=require(_0x91bf('0x1a'))['db'];function respondWithStatusCode(_0x20a216,_0x2314c6){_0x2314c6=_0x2314c6||0xcc;return function(_0x455c3b){if(_0x455c3b){return _0x20a216['sendStatus'](_0x2314c6);}return _0x20a216[_0x91bf('0x1b')](_0x2314c6)[_0x91bf('0x1c')]();};}function respondWithResult(_0x16c311,_0x317c97){_0x317c97=_0x317c97||0xc8;return function(_0x37786e){if(_0x37786e){return _0x16c311['status'](_0x317c97)[_0x91bf('0x1d')](_0x37786e);}};}function respondWithFilteredResult(_0x2bfe89,_0x2fd915){return function(_0x6f7e8b){if(_0x6f7e8b){var _0x5c49ae=typeof _0x2fd915[_0x91bf('0x1e')]===_0x91bf('0x1f')&&typeof _0x2fd915[_0x91bf('0x20')]===_0x91bf('0x1f');var _0x18d646=_0x6f7e8b[_0x91bf('0x21')];var _0xdeb2a0=_0x5c49ae?0x0:_0x2fd915['offset'];var _0x2010a0=_0x5c49ae?_0x6f7e8b[_0x91bf('0x21')]:_0x2fd915[_0x91bf('0x1e')]+_0x2fd915[_0x91bf('0x20')];var _0x4f22ba;if(_0x2010a0>=_0x18d646){_0x2010a0=_0x18d646;_0x4f22ba=0xc8;}else{_0x4f22ba=0xce;}_0x2bfe89['status'](_0x4f22ba);return _0x2bfe89[_0x91bf('0x22')](_0x91bf('0x23'),_0xdeb2a0+'-'+_0x2010a0+'/'+_0x18d646)[_0x91bf('0x1d')](_0x6f7e8b);}return null;};}function patchUpdates(_0x3460f8){return function(_0x4b9105){try{jsonpatch['apply'](_0x4b9105,_0x3460f8,!![]);}catch(_0x4b8cb0){return BPromise['reject'](_0x4b8cb0);}return _0x4b9105[_0x91bf('0x24')]();};}function saveUpdates(_0xc6282c,_0x5ed77c){return function(_0x175274){if(_0x175274){return _0x175274[_0x91bf('0x25')](_0xc6282c)['then'](function(_0x132758){return _0x132758;});}return null;};}function removeEntity(_0x4395d1,_0x1be8bc){return function(_0x31a63b){if(_0x31a63b){return _0x31a63b['destroy']()[_0x91bf('0x26')](function(){_0x4395d1[_0x91bf('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3519a5,_0x4c0e59){return function(_0x4d1320){if(!_0x4d1320){_0x3519a5[_0x91bf('0x27')](0x194);}return _0x4d1320;};}function handleError(_0x25d434,_0xf5df84){_0xf5df84=_0xf5df84||0x1f4;return function(_0x49f675){logger[_0x91bf('0x28')](_0x49f675['stack']);if(_0x49f675[_0x91bf('0x29')]){delete _0x49f675[_0x91bf('0x29')];}_0x25d434['status'](_0xf5df84)['send'](_0x49f675);};}exports['index']=function(_0x2ce5a5,_0x379692){var _0x4c7c25={},_0x10b5f9={},_0x1674e2={'count':0x0,'rows':[]};var _0x4b6dbe=_[_0x91bf('0x2a')](db[_0x91bf('0x2b')]['rawAttributes'],function(_0x4f16f8){return{'name':_0x4f16f8[_0x91bf('0x2c')],'type':_0x4f16f8[_0x91bf('0x2d')][_0x91bf('0x2e')]};});_0x10b5f9['model']=_[_0x91bf('0x2a')](_0x4b6dbe,'name');_0x10b5f9[_0x91bf('0x2f')]=_[_0x91bf('0x30')](_0x2ce5a5[_0x91bf('0x2f')]);_0x10b5f9['filters']=_[_0x91bf('0x31')](_0x10b5f9['model'],_0x10b5f9[_0x91bf('0x2f')]);_0x4c7c25[_0x91bf('0x32')]=_[_0x91bf('0x31')](_0x10b5f9['model'],qs[_0x91bf('0x33')](_0x2ce5a5[_0x91bf('0x2f')]['fields']));_0x4c7c25[_0x91bf('0x32')]=_0x4c7c25[_0x91bf('0x32')]['length']?_0x4c7c25[_0x91bf('0x32')]:_0x10b5f9[_0x91bf('0x34')];if(!_0x2ce5a5[_0x91bf('0x2f')][_0x91bf('0x35')](_0x91bf('0x36'))){_0x4c7c25[_0x91bf('0x20')]=qs[_0x91bf('0x20')](_0x2ce5a5[_0x91bf('0x2f')][_0x91bf('0x20')]);_0x4c7c25[_0x91bf('0x1e')]=qs['offset'](_0x2ce5a5['query'][_0x91bf('0x1e')]);}_0x4c7c25[_0x91bf('0x37')]=qs[_0x91bf('0x38')](_0x2ce5a5['query'][_0x91bf('0x38')]);_0x4c7c25[_0x91bf('0x39')]=qs['filters'](_[_0x91bf('0x3a')](_0x2ce5a5['query'],_0x10b5f9[_0x91bf('0x3b')]),_0x4b6dbe);if(_0x2ce5a5[_0x91bf('0x2f')]['filter']){_0x4c7c25[_0x91bf('0x39')]=_[_0x91bf('0x3c')](_0x4c7c25[_0x91bf('0x39')],{'$or':_[_0x91bf('0x2a')](_0x4b6dbe,function(_0x4bf14f){if(_0x4bf14f['type']!=='VIRTUAL'){var _0x3b15de={};_0x3b15de[_0x4bf14f['name']]={'$like':'%'+_0x2ce5a5['query'][_0x91bf('0x3d')]+'%'};return _0x3b15de;}})});}_0x4c7c25=_['merge']({},_0x4c7c25,_0x2ce5a5[_0x91bf('0x3e')]);var _0x17b51b={'where':_0x4c7c25[_0x91bf('0x39')]};return db['AnalyticTreeReport'][_0x91bf('0x21')](_0x17b51b)['then'](function(_0x14649d){_0x1674e2[_0x91bf('0x21')]=_0x14649d;if(_0x2ce5a5['query']['includeAll']){_0x4c7c25[_0x91bf('0x3f')]=[{'all':!![]}];}return db[_0x91bf('0x2b')][_0x91bf('0x40')](_0x4c7c25);})[_0x91bf('0x26')](function(_0x523d1f){_0x1674e2['rows']=_0x523d1f;return _0x1674e2;})[_0x91bf('0x26')](respondWithFilteredResult(_0x379692,_0x4c7c25))[_0x91bf('0x41')](handleError(_0x379692,null));};exports[_0x91bf('0x42')]=function(_0x4ef72e,_0x4f2e3e){var _0x17060f={'raw':!![],'where':{'id':_0x4ef72e['params']['id']}},_0x3b161c={};_0x3b161c[_0x91bf('0x34')]=_[_0x91bf('0x30')](db[_0x91bf('0x2b')][_0x91bf('0x43')]);_0x3b161c[_0x91bf('0x2f')]=_[_0x91bf('0x30')](_0x4ef72e[_0x91bf('0x2f')]);_0x3b161c[_0x91bf('0x3b')]=_[_0x91bf('0x31')](_0x3b161c[_0x91bf('0x34')],_0x3b161c[_0x91bf('0x2f')]);_0x17060f['attributes']=_[_0x91bf('0x31')](_0x3b161c['model'],qs[_0x91bf('0x33')](_0x4ef72e[_0x91bf('0x2f')][_0x91bf('0x33')]));_0x17060f[_0x91bf('0x32')]=_0x17060f[_0x91bf('0x32')][_0x91bf('0x44')]?_0x17060f['attributes']:_0x3b161c[_0x91bf('0x34')];if(_0x4ef72e[_0x91bf('0x2f')][_0x91bf('0x45')]){_0x17060f['include']=[{'all':!![]}];}_0x17060f=_[_0x91bf('0x3c')]({},_0x17060f,_0x4ef72e[_0x91bf('0x3e')]);return db[_0x91bf('0x2b')][_0x91bf('0x46')](_0x17060f)[_0x91bf('0x26')](handleEntityNotFound(_0x4f2e3e,null))[_0x91bf('0x26')](respondWithResult(_0x4f2e3e,null))[_0x91bf('0x41')](handleError(_0x4f2e3e,null));};exports[_0x91bf('0x47')]=function(_0x444fbc,_0x3d73d7){return db[_0x91bf('0x2b')][_0x91bf('0x47')](_0x444fbc['body'],{})[_0x91bf('0x26')](respondWithResult(_0x3d73d7,0xc9))['catch'](handleError(_0x3d73d7,null));};exports[_0x91bf('0x25')]=function(_0x195255,_0x158527){if(_0x195255['body']['id']){delete _0x195255[_0x91bf('0x48')]['id'];}return db[_0x91bf('0x2b')][_0x91bf('0x46')]({'where':{'id':_0x195255['params']['id']}})[_0x91bf('0x26')](handleEntityNotFound(_0x158527,null))[_0x91bf('0x26')](saveUpdates(_0x195255['body'],null))[_0x91bf('0x26')](respondWithResult(_0x158527,null))[_0x91bf('0x41')](handleError(_0x158527,null));};exports['destroy']=function(_0x2cf90c,_0x5a1e5e){return db[_0x91bf('0x2b')][_0x91bf('0x46')]({'where':{'id':_0x2cf90c[_0x91bf('0x49')]['id']}})[_0x91bf('0x26')](handleEntityNotFound(_0x5a1e5e,null))[_0x91bf('0x26')](removeEntity(_0x5a1e5e,null))[_0x91bf('0x41')](handleError(_0x5a1e5e,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index ccd0168..c3d6999 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 _0xfeef=['../../config/logger','moment','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfeef,0x153));var _0xffee=function(_0x2178be,_0x56a488){_0x2178be=_0x2178be-0x0;var _0x15d55b=_0xfeef[_0x2178be];return _0x15d55b;};'use strict';var _=require(_0xffee('0x0'));var util=require(_0xffee('0x1'));var logger=require(_0xffee('0x2'))('api');var moment=require(_0xffee('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xffee('0x4'));var rimraf=require(_0xffee('0x5'));var config=require(_0xffee('0x6'));var attributes=require(_0xffee('0x7'));module[_0xffee('0x8')]=function(_0x2bce72,_0x3050fa){return _0x2bce72[_0xffee('0x9')]('AnalyticTreeReport',attributes,{'tableName':_0xffee('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4f47=['analytics_report_trees','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define'];(function(_0x535e91,_0x3a3fd0){var _0x46a492=function(_0x18efa0){while(--_0x18efa0){_0x535e91['push'](_0x535e91['shift']());}};_0x46a492(++_0x3a3fd0);}(_0x4f47,0x109));var _0x74f4=function(_0x90631,_0x48e587){_0x90631=_0x90631-0x0;var _0x495bf8=_0x4f47[_0x90631];return _0x495bf8;};'use strict';var _=require(_0x74f4('0x0'));var util=require(_0x74f4('0x1'));var logger=require(_0x74f4('0x2'))(_0x74f4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x74f4('0x4'));var fs=require('fs');var path=require(_0x74f4('0x5'));var rimraf=require(_0x74f4('0x6'));var config=require(_0x74f4('0x7'));var attributes=require(_0x74f4('0x8'));module[_0x74f4('0x9')]=function(_0x58dacf,_0x21f599){return _0x58dacf[_0x74f4('0xa')]('AnalyticTreeReport',attributes,{'tableName':_0x74f4('0xb'),'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 9005dbe..1f6c386 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x1797fd,_0x46e5ee){var _0x1aafc7=function(_0x4ae89a){while(--_0x4ae89a){_0x1797fd['push'](_0x1797fd['shift']());}};_0x1aafc7(++_0x46e5ee);}(_0xdb28,0x106));var _0x8db2=function(_0x560185,_0x29c35f){_0x560185=_0x560185-0x0;var _0x1e0f29=_0xdb28[_0x560185];return _0x1e0f29;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
+var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x50b293,_0x2186e3){var _0x36c290=function(_0x334280){while(--_0x334280){_0x50b293['push'](_0x50b293['shift']());}};_0x36c290(++_0x2186e3);}(_0x2ef3,0xba));var _0x32ef=function(_0x47e2ff,_0x3a7b6f){_0x47e2ff=_0x47e2ff-0x0;var _0x53aa8d=_0x2ef3[_0x47e2ff];return _0x53aa8d;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index a0e9b1e..69cdc9b 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 _0x7f26=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','show','post','isAuthenticated','create','put','/:id'];(function(_0x178856,_0x41f045){var _0x3c7fe7=function(_0x4d9ce4){while(--_0x4d9ce4){_0x178856['push'](_0x178856['shift']());}};_0x3c7fe7(++_0x41f045);}(_0x7f26,0xf2));var _0x67f2=function(_0xb807e0,_0x28ef88){_0xb807e0=_0xb807e0-0x0;var _0x29c8cf=_0x7f26[_0xb807e0];return _0x29c8cf;};'use strict';var multer=require('multer');var util=require(_0x67f2('0x0'));var path=require(_0x67f2('0x1'));var timeout=require(_0x67f2('0x2'));var express=require(_0x67f2('0x3'));var router=express[_0x67f2('0x4')]();var fs_extra=require(_0x67f2('0x5'));var auth=require(_0x67f2('0x6'));var interaction=require(_0x67f2('0x7'));var config=require(_0x67f2('0x8'));var controller=require(_0x67f2('0x9'));router[_0x67f2('0xa')]('/',auth['isAuthenticated'](),controller[_0x67f2('0xb')]);router[_0x67f2('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x67f2('0xc')]);router[_0x67f2('0xd')]('/',auth[_0x67f2('0xe')](),controller[_0x67f2('0xf')]);router[_0x67f2('0x10')](_0x67f2('0x11'),auth[_0x67f2('0xe')](),controller['update']);router['delete'](_0x67f2('0x11'),auth[_0x67f2('0xe')](),controller[_0x67f2('0x12')]);module[_0x67f2('0x13')]=router;
\ No newline at end of file
+var _0xf441=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','put','update','destroy','exports','multer','util'];(function(_0x30dec0,_0x2bd4ac){var _0xada67a=function(_0xa17931){while(--_0xa17931){_0x30dec0['push'](_0x30dec0['shift']());}};_0xada67a(++_0x2bd4ac);}(_0xf441,0xfa));var _0x1f44=function(_0x1ad7fc,_0x444145){_0x1ad7fc=_0x1ad7fc-0x0;var _0x3bb433=_0xf441[_0x1ad7fc];return _0x3bb433;};'use strict';var multer=require(_0x1f44('0x0'));var util=require(_0x1f44('0x1'));var path=require(_0x1f44('0x2'));var timeout=require(_0x1f44('0x3'));var express=require('express');var router=express[_0x1f44('0x4')]();var fs_extra=require(_0x1f44('0x5'));var auth=require(_0x1f44('0x6'));var interaction=require(_0x1f44('0x7'));var config=require(_0x1f44('0x8'));var controller=require('./analyticTreeReport.controller');router[_0x1f44('0x9')]('/',auth[_0x1f44('0xa')](),controller[_0x1f44('0xb')]);router['get'](_0x1f44('0xc'),auth[_0x1f44('0xa')](),controller['show']);router[_0x1f44('0xd')]('/',auth[_0x1f44('0xa')](),controller['create']);router[_0x1f44('0xe')](_0x1f44('0xc'),auth[_0x1f44('0xa')](),controller[_0x1f44('0xf')]);router['delete'](_0x1f44('0xc'),auth[_0x1f44('0xa')](),controller[_0x1f44('0x10')]);module[_0x1f44('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 733a596..fb58591 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 _0xaefc=['exports','STRING','sequelize'];(function(_0x5ca58f,_0x31ee9a){var _0x59eefb=function(_0x5c90fb){while(--_0x5c90fb){_0x5ca58f['push'](_0x5ca58f['shift']());}};_0x59eefb(++_0x31ee9a);}(_0xaefc,0xc8));var _0xcaef=function(_0x199fe8,_0x2f737e){_0x199fe8=_0x199fe8-0x0;var _0x44e5dc=_0xaefc[_0x199fe8];return _0x44e5dc;};'use strict';var Sequelize=require(_0xcaef('0x0'));module[_0xcaef('0x1')]={'name':{'type':Sequelize[_0xcaef('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xcaef('0x2')]}};
\ No newline at end of file
+var _0x5900=['exports','STRING'];(function(_0x447127,_0xbe4ade){var _0x358a25=function(_0x44fead){while(--_0x44fead){_0x447127['push'](_0x447127['shift']());}};_0x358a25(++_0xbe4ade);}(_0x5900,0xd2));var _0x0590=function(_0x427cb4,_0x3c154b){_0x427cb4=_0x427cb4-0x0;var _0x43f775=_0x5900[_0x427cb4];return _0x43f775;};'use strict';var Sequelize=require('sequelize');module[_0x0590('0x0')]={'name':{'type':Sequelize[_0x0590('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0590('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 89d38f3..71f88b2 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 _0x508b=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','omit','createdAt','body','updatedAt','create','originalname','file','filename','mimetype','download','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','index','map','Attachment','fieldName','type'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x508b,0x83));var _0xb508=function(_0xc48869,_0x56b37b){_0xc48869=_0xc48869-0x0;var _0x1f5dca=_0x508b[_0xc48869];return _0x1f5dca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb508('0x0'));var zipdir=require(_0xb508('0x1'));var jsonpatch=require(_0xb508('0x2'));var rp=require(_0xb508('0x3'));var moment=require(_0xb508('0x4'));var BPromise=require(_0xb508('0x5'));var Mustache=require(_0xb508('0x6'));var util=require(_0xb508('0x7'));var path=require(_0xb508('0x8'));var sox=require(_0xb508('0x9'));var csv=require(_0xb508('0xa'));var ejs=require(_0xb508('0xb'));var fs=require('fs');var fs_extra=require(_0xb508('0xc'));var _=require(_0xb508('0xd'));var squel=require(_0xb508('0xe'));var crypto=require(_0xb508('0xf'));var jsforce=require(_0xb508('0x10'));var deskjs=require(_0xb508('0x11'));var toCsv=require(_0xb508('0xa'));var querystring=require('querystring');var Papa=require(_0xb508('0x12'));var Redis=require('ioredis');var authService=require(_0xb508('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb508('0x14'));var logger=require(_0xb508('0x15'))(_0xb508('0x16'));var utils=require(_0xb508('0x17'));var config=require(_0xb508('0x18'));var licenseUtil=require(_0xb508('0x19'));var db=require(_0xb508('0x1a'))['db'];function respondWithStatusCode(_0x43155e,_0x53a7ba){_0x53a7ba=_0x53a7ba||0xcc;return function(_0x1cfbfe){if(_0x1cfbfe){return _0x43155e['sendStatus'](_0x53a7ba);}return _0x43155e[_0xb508('0x1b')](_0x53a7ba)[_0xb508('0x1c')]();};}function respondWithResult(_0x508310,_0x4f7050){_0x4f7050=_0x4f7050||0xc8;return function(_0xa84ed7){if(_0xa84ed7){return _0x508310[_0xb508('0x1b')](_0x4f7050)[_0xb508('0x1d')](_0xa84ed7);}};}function respondWithFilteredResult(_0x4be777,_0xf2b28b){return function(_0x408571){if(_0x408571){var _0x38da26=typeof _0xf2b28b[_0xb508('0x1e')]===_0xb508('0x1f')&&typeof _0xf2b28b['limit']===_0xb508('0x1f');var _0xa652a2=_0x408571[_0xb508('0x20')];var _0xb9c9f6=_0x38da26?0x0:_0xf2b28b[_0xb508('0x1e')];var _0x650617=_0x38da26?_0x408571['count']:_0xf2b28b[_0xb508('0x1e')]+_0xf2b28b[_0xb508('0x21')];var _0x1c98f2;if(_0x650617>=_0xa652a2){_0x650617=_0xa652a2;_0x1c98f2=0xc8;}else{_0x1c98f2=0xce;}_0x4be777['status'](_0x1c98f2);return _0x4be777['set'](_0xb508('0x22'),_0xb9c9f6+'-'+_0x650617+'/'+_0xa652a2)[_0xb508('0x1d')](_0x408571);}return null;};}function patchUpdates(_0x680aab){return function(_0x4faa68){try{jsonpatch[_0xb508('0x23')](_0x4faa68,_0x680aab,!![]);}catch(_0x4f6930){return BPromise['reject'](_0x4f6930);}return _0x4faa68[_0xb508('0x24')]();};}function saveUpdates(_0x3ce38d,_0x243b3b){return function(_0x373568){if(_0x373568){return _0x373568[_0xb508('0x25')](_0x3ce38d)[_0xb508('0x26')](function(_0x1b651f){return _0x1b651f;});}return null;};}function removeEntity(_0x764299,_0x53c650){return function(_0x2ffe36){if(_0x2ffe36){return _0x2ffe36[_0xb508('0x27')]()['then'](function(){_0x764299[_0xb508('0x1b')](0xcc)[_0xb508('0x1c')]();});}};}function handleEntityNotFound(_0x5e1596,_0x1065b4){return function(_0x294d76){if(!_0x294d76){_0x5e1596[_0xb508('0x28')](0x194);}return _0x294d76;};}function handleError(_0x2fd0e3,_0x3b970e){_0x3b970e=_0x3b970e||0x1f4;return function(_0x30b00b){logger[_0xb508('0x29')](_0x30b00b[_0xb508('0x2a')]);if(_0x30b00b[_0xb508('0x2b')]){delete _0x30b00b[_0xb508('0x2b')];}_0x2fd0e3['status'](_0x3b970e)['send'](_0x30b00b);};}exports[_0xb508('0x2c')]=function(_0x3fb29c,_0x504fc5){var _0x4bddec={},_0x138b2={},_0x5152b3={'count':0x0,'rows':[]};var _0x5e6831=_[_0xb508('0x2d')](db[_0xb508('0x2e')]['rawAttributes'],function(_0x3beeb4){return{'name':_0x3beeb4[_0xb508('0x2f')],'type':_0x3beeb4[_0xb508('0x30')][_0xb508('0x31')]};});_0x138b2[_0xb508('0x32')]=_[_0xb508('0x2d')](_0x5e6831,_0xb508('0x2b'));_0x138b2[_0xb508('0x33')]=_[_0xb508('0x34')](_0x3fb29c[_0xb508('0x33')]);_0x138b2[_0xb508('0x35')]=_[_0xb508('0x36')](_0x138b2[_0xb508('0x32')],_0x138b2[_0xb508('0x33')]);_0x4bddec[_0xb508('0x37')]=_[_0xb508('0x36')](_0x138b2[_0xb508('0x32')],qs['fields'](_0x3fb29c[_0xb508('0x33')][_0xb508('0x38')]));_0x4bddec[_0xb508('0x37')]=_0x4bddec[_0xb508('0x37')][_0xb508('0x39')]?_0x4bddec[_0xb508('0x37')]:_0x138b2[_0xb508('0x32')];if(!_0x3fb29c[_0xb508('0x33')][_0xb508('0x3a')]('nolimit')){_0x4bddec['limit']=qs[_0xb508('0x21')](_0x3fb29c[_0xb508('0x33')][_0xb508('0x21')]);_0x4bddec['offset']=qs['offset'](_0x3fb29c['query'][_0xb508('0x1e')]);}_0x4bddec[_0xb508('0x3b')]=qs['sort'](_0x3fb29c[_0xb508('0x33')][_0xb508('0x3c')]);_0x4bddec[_0xb508('0x3d')]=qs[_0xb508('0x35')](_[_0xb508('0x3e')](_0x3fb29c[_0xb508('0x33')],_0x138b2[_0xb508('0x35')]),_0x5e6831);if(_0x3fb29c[_0xb508('0x33')][_0xb508('0x3f')]){_0x4bddec[_0xb508('0x3d')]=_[_0xb508('0x40')](_0x4bddec[_0xb508('0x3d')],{'$or':_['map'](_0x5e6831,function(_0x1c16a4){if(_0x1c16a4[_0xb508('0x30')]!==_0xb508('0x41')){var _0x4c1ab4={};_0x4c1ab4[_0x1c16a4['name']]={'$like':'%'+_0x3fb29c[_0xb508('0x33')]['filter']+'%'};return _0x4c1ab4;}})});}_0x4bddec=_[_0xb508('0x40')]({},_0x4bddec,_0x3fb29c[_0xb508('0x42')]);var _0x46002d={'where':_0x4bddec[_0xb508('0x3d')]};return db[_0xb508('0x2e')][_0xb508('0x20')](_0x46002d)[_0xb508('0x26')](function(_0x53bcd5){_0x5152b3[_0xb508('0x20')]=_0x53bcd5;if(_0x3fb29c['query'][_0xb508('0x43')]){_0x4bddec[_0xb508('0x44')]=[{'all':!![]}];}return db[_0xb508('0x2e')]['findAll'](_0x4bddec);})[_0xb508('0x26')](function(_0xcee9d0){_0x5152b3[_0xb508('0x45')]=_0xcee9d0;return _0x5152b3;})[_0xb508('0x26')](respondWithFilteredResult(_0x504fc5,_0x4bddec))[_0xb508('0x46')](handleError(_0x504fc5,null));};exports[_0xb508('0x47')]=function(_0x5436d2,_0x362369){var _0x38080e={'raw':!![],'where':{'id':_0x5436d2[_0xb508('0x48')]['id']}},_0x114c47={};_0x114c47[_0xb508('0x32')]=_[_0xb508('0x34')](db[_0xb508('0x2e')][_0xb508('0x49')]);_0x114c47[_0xb508('0x33')]=_[_0xb508('0x34')](_0x5436d2[_0xb508('0x33')]);_0x114c47[_0xb508('0x35')]=_['intersection'](_0x114c47['model'],_0x114c47[_0xb508('0x33')]);_0x38080e['attributes']=_[_0xb508('0x36')](_0x114c47['model'],qs[_0xb508('0x38')](_0x5436d2[_0xb508('0x33')][_0xb508('0x38')]));_0x38080e[_0xb508('0x37')]=_0x38080e['attributes']['length']?_0x38080e['attributes']:_0x114c47[_0xb508('0x32')];if(_0x5436d2[_0xb508('0x33')][_0xb508('0x43')]){_0x38080e[_0xb508('0x44')]=[{'all':!![]}];}_0x38080e=_[_0xb508('0x40')]({},_0x38080e,_0x5436d2[_0xb508('0x42')]);return db[_0xb508('0x2e')][_0xb508('0x4a')](_0x38080e)['then'](handleEntityNotFound(_0x362369,null))[_0xb508('0x26')](respondWithResult(_0x362369,null))['catch'](handleError(_0x362369,null));};exports['clone']=function(_0x12b47,_0x532fa5){var _0x56badb={'where':{'id':_0x12b47[_0xb508('0x48')]['id']}},_0x1e963b={};_0x1e963b[_0xb508('0x32')]=_[_0xb508('0x34')](db[_0xb508('0x2e')]['rawAttributes']);_0x56badb[_0xb508('0x37')]=_['intersection'](_0x1e963b['model'],qs[_0xb508('0x38')](_0x12b47[_0xb508('0x33')]['fields']));_0x56badb[_0xb508('0x37')]=_0x56badb['attributes']['length']?_0x56badb[_0xb508('0x37')]:_0x1e963b[_0xb508('0x32')];if(_0x12b47[_0xb508('0x33')][_0xb508('0x43')]){_0x56badb[_0xb508('0x44')]=[{'all':!![]}];}_0x56badb=_['merge']({},_0x56badb,_0x12b47[_0xb508('0x42')]);return db['Attachment'][_0xb508('0x4a')](_0x56badb)[_0xb508('0x26')](handleEntityNotFound(_0x532fa5,null))[_0xb508('0x26')](function(_0x4d2528){if(_0x4d2528){var _0x4b3804=_0x4d2528['get']({'plain':!![]});_0x4b3804=qs[_0xb508('0x4b')](_0x4b3804,['id',_0xb508('0x4c'),'updatedAt']);_0x12b47['body']=_[_0xb508('0x4b')](_0x12b47[_0xb508('0x4d')],['id',_0xb508('0x4c'),_0xb508('0x4e')]);return db[_0xb508('0x2e')]['create'](_['merge'](_0x4b3804,_0x12b47[_0xb508('0x4d')]),{'include':_0x12b47[_0xb508('0x33')][_0xb508('0x43')]?[{'all':!![]}]:undefined});}})[_0xb508('0x26')](respondWithResult(_0x532fa5,0xc9))[_0xb508('0x46')](handleError(_0x532fa5,null));};exports['update']=function(_0x3fbb2c,_0x177c78){if(_0x3fbb2c[_0xb508('0x4d')]['id']){delete _0x3fbb2c['body']['id'];}return db[_0xb508('0x2e')][_0xb508('0x4a')]({'where':{'id':_0x3fbb2c[_0xb508('0x48')]['id']}})[_0xb508('0x26')](handleEntityNotFound(_0x177c78,null))['then'](saveUpdates(_0x3fbb2c[_0xb508('0x4d')],null))['then'](respondWithResult(_0x177c78,null))['catch'](handleError(_0x177c78,null));};exports[_0xb508('0x27')]=function(_0x387caa,_0x6e7568){return db[_0xb508('0x2e')][_0xb508('0x4a')]({'where':{'id':_0x387caa[_0xb508('0x48')]['id']}})[_0xb508('0x26')](handleEntityNotFound(_0x6e7568,null))['then'](removeEntity(_0x6e7568,null))['catch'](handleError(_0x6e7568,null));};exports[_0xb508('0x4f')]=function(_0x30ee78,_0x1a54f9,_0x3f3d20){_0x30ee78[_0xb508('0x4d')][_0xb508('0x2b')]=_0x30ee78['file'][_0xb508('0x50')];_0x30ee78['body']['basename']=_0x30ee78[_0xb508('0x51')][_0xb508('0x52')];_0x30ee78[_0xb508('0x4d')][_0xb508('0x30')]=_0x30ee78['file'][_0xb508('0x53')];return db['Attachment'][_0xb508('0x4f')](_0x30ee78[_0xb508('0x4d')])[_0xb508('0x26')](respondWithResult(_0x1a54f9,0xc9))['catch'](handleError(_0x1a54f9,null));};exports[_0xb508('0x54')]=function(_0x482a57,_0x46fc67,_0x7af0bf){return db['Attachment']['findOne']({'where':{'id':_0x482a57[_0xb508('0x48')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x46fc67,null))[_0xb508('0x26')](function(_0x3c7e30){if(_0x3c7e30){var _0x395e81=_0x3c7e30[_0xb508('0x55')]!==null;var _0x31fdf8=path[_0xb508('0x56')](config[_0xb508('0x57')],_0xb508('0x58'));if(_0x395e81){_0x31fdf8=path['join'](_0x31fdf8,_0xb508('0x59'));}var _0x32207=path[_0xb508('0x56')](_0x31fdf8,_0x3c7e30['basename']);return _0x46fc67[_0xb508('0x54')](_0x32207);}})[_0xb508('0x46')](handleError(_0x46fc67,null));};
\ No newline at end of file
+var _0x3ba0=['Content-Range','apply','save','then','end','error','stack','name','send','rawAttributes','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','Attachment','includeAll','include','rows','catch','show','find','clone','params','options','get','omit','createdAt','updatedAt','body','create','update','destroy','originalname','basename','file','filename','type','download','findOne','join','root','offline-chat/','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x5ab2b4,_0x288fab){var _0x326806=function(_0x3ad9d5){while(--_0x3ad9d5){_0x5ab2b4['push'](_0x5ab2b4['shift']());}};_0x326806(++_0x288fab);}(_0x3ba0,0x8c));var _0x03ba=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3ba0[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x03ba('0x0'));var zipdir=require(_0x03ba('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x03ba('0x2'));var moment=require(_0x03ba('0x3'));var BPromise=require(_0x03ba('0x4'));var Mustache=require(_0x03ba('0x5'));var util=require(_0x03ba('0x6'));var path=require('path');var sox=require(_0x03ba('0x7'));var csv=require(_0x03ba('0x8'));var ejs=require(_0x03ba('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x03ba('0xa'));var crypto=require(_0x03ba('0xb'));var jsforce=require(_0x03ba('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x03ba('0x8'));var querystring=require('querystring');var Papa=require(_0x03ba('0xd'));var Redis=require(_0x03ba('0xe'));var authService=require(_0x03ba('0xf'));var qs=require(_0x03ba('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x03ba('0x11'));var logger=require(_0x03ba('0x12'))(_0x03ba('0x13'));var utils=require(_0x03ba('0x14'));var config=require(_0x03ba('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x03ba('0x16'))['db'];function respondWithStatusCode(_0x3d8c0d,_0x33243d){_0x33243d=_0x33243d||0xcc;return function(_0x4fcb8a){if(_0x4fcb8a){return _0x3d8c0d[_0x03ba('0x17')](_0x33243d);}return _0x3d8c0d[_0x03ba('0x18')](_0x33243d)['end']();};}function respondWithResult(_0x23e749,_0x2df88a){_0x2df88a=_0x2df88a||0xc8;return function(_0x4c84b2){if(_0x4c84b2){return _0x23e749['status'](_0x2df88a)[_0x03ba('0x19')](_0x4c84b2);}};}function respondWithFilteredResult(_0x1bc995,_0x17cc59){return function(_0x11feb0){if(_0x11feb0){var _0x402a02=typeof _0x17cc59[_0x03ba('0x1a')]===_0x03ba('0x1b')&&typeof _0x17cc59[_0x03ba('0x1c')]===_0x03ba('0x1b');var _0x19d00e=_0x11feb0[_0x03ba('0x1d')];var _0x311544=_0x402a02?0x0:_0x17cc59[_0x03ba('0x1a')];var _0x226640=_0x402a02?_0x11feb0[_0x03ba('0x1d')]:_0x17cc59[_0x03ba('0x1a')]+_0x17cc59[_0x03ba('0x1c')];var _0xb3d57e;if(_0x226640>=_0x19d00e){_0x226640=_0x19d00e;_0xb3d57e=0xc8;}else{_0xb3d57e=0xce;}_0x1bc995['status'](_0xb3d57e);return _0x1bc995['set'](_0x03ba('0x1e'),_0x311544+'-'+_0x226640+'/'+_0x19d00e)[_0x03ba('0x19')](_0x11feb0);}return null;};}function patchUpdates(_0x3fbee2){return function(_0x451076){try{jsonpatch[_0x03ba('0x1f')](_0x451076,_0x3fbee2,!![]);}catch(_0x3a3280){return BPromise['reject'](_0x3a3280);}return _0x451076[_0x03ba('0x20')]();};}function saveUpdates(_0x4fe24b,_0x266bfc){return function(_0x59e80b){if(_0x59e80b){return _0x59e80b['update'](_0x4fe24b)[_0x03ba('0x21')](function(_0x177e1d){return _0x177e1d;});}return null;};}function removeEntity(_0x3532d4,_0x36fd0b){return function(_0x421cdb){if(_0x421cdb){return _0x421cdb['destroy']()['then'](function(){_0x3532d4[_0x03ba('0x18')](0xcc)[_0x03ba('0x22')]();});}};}function handleEntityNotFound(_0x5046c3,_0xb39d83){return function(_0xfba6a2){if(!_0xfba6a2){_0x5046c3['sendStatus'](0x194);}return _0xfba6a2;};}function handleError(_0x1511b9,_0x6aeeb9){_0x6aeeb9=_0x6aeeb9||0x1f4;return function(_0x4b13d8){logger[_0x03ba('0x23')](_0x4b13d8[_0x03ba('0x24')]);if(_0x4b13d8[_0x03ba('0x25')]){delete _0x4b13d8[_0x03ba('0x25')];}_0x1511b9[_0x03ba('0x18')](_0x6aeeb9)[_0x03ba('0x26')](_0x4b13d8);};}exports['index']=function(_0x5cbc85,_0x46636b){var _0x1d4654={},_0x22cdf3={},_0x1ac050={'count':0x0,'rows':[]};var _0x962aff=_['map'](db['Attachment'][_0x03ba('0x27')],function(_0x596399){return{'name':_0x596399['fieldName'],'type':_0x596399['type']['key']};});_0x22cdf3[_0x03ba('0x28')]=_[_0x03ba('0x29')](_0x962aff,_0x03ba('0x25'));_0x22cdf3['query']=_[_0x03ba('0x2a')](_0x5cbc85[_0x03ba('0x2b')]);_0x22cdf3[_0x03ba('0x2c')]=_[_0x03ba('0x2d')](_0x22cdf3['model'],_0x22cdf3[_0x03ba('0x2b')]);_0x1d4654[_0x03ba('0x2e')]=_[_0x03ba('0x2d')](_0x22cdf3[_0x03ba('0x28')],qs[_0x03ba('0x2f')](_0x5cbc85[_0x03ba('0x2b')]['fields']));_0x1d4654[_0x03ba('0x2e')]=_0x1d4654['attributes'][_0x03ba('0x30')]?_0x1d4654[_0x03ba('0x2e')]:_0x22cdf3[_0x03ba('0x28')];if(!_0x5cbc85['query'][_0x03ba('0x31')](_0x03ba('0x32'))){_0x1d4654[_0x03ba('0x1c')]=qs[_0x03ba('0x1c')](_0x5cbc85['query'][_0x03ba('0x1c')]);_0x1d4654[_0x03ba('0x1a')]=qs['offset'](_0x5cbc85['query'][_0x03ba('0x1a')]);}_0x1d4654[_0x03ba('0x33')]=qs[_0x03ba('0x34')](_0x5cbc85[_0x03ba('0x2b')]['sort']);_0x1d4654[_0x03ba('0x35')]=qs['filters'](_[_0x03ba('0x36')](_0x5cbc85[_0x03ba('0x2b')],_0x22cdf3[_0x03ba('0x2c')]),_0x962aff);if(_0x5cbc85['query']['filter']){_0x1d4654[_0x03ba('0x35')]=_[_0x03ba('0x37')](_0x1d4654[_0x03ba('0x35')],{'$or':_[_0x03ba('0x29')](_0x962aff,function(_0x3b36ad){if(_0x3b36ad['type']!=='VIRTUAL'){var _0x2a2fdd={};_0x2a2fdd[_0x3b36ad[_0x03ba('0x25')]]={'$like':'%'+_0x5cbc85[_0x03ba('0x2b')][_0x03ba('0x38')]+'%'};return _0x2a2fdd;}})});}_0x1d4654=_[_0x03ba('0x37')]({},_0x1d4654,_0x5cbc85['options']);var _0x2277f2={'where':_0x1d4654['where']};return db[_0x03ba('0x39')]['count'](_0x2277f2)[_0x03ba('0x21')](function(_0x484328){_0x1ac050[_0x03ba('0x1d')]=_0x484328;if(_0x5cbc85[_0x03ba('0x2b')][_0x03ba('0x3a')]){_0x1d4654[_0x03ba('0x3b')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x1d4654);})['then'](function(_0x21cda){_0x1ac050[_0x03ba('0x3c')]=_0x21cda;return _0x1ac050;})['then'](respondWithFilteredResult(_0x46636b,_0x1d4654))[_0x03ba('0x3d')](handleError(_0x46636b,null));};exports[_0x03ba('0x3e')]=function(_0x4fe7eb,_0x52eefe){var _0xbfffb={'raw':!![],'where':{'id':_0x4fe7eb['params']['id']}},_0x36cc6b={};_0x36cc6b[_0x03ba('0x28')]=_[_0x03ba('0x2a')](db[_0x03ba('0x39')][_0x03ba('0x27')]);_0x36cc6b[_0x03ba('0x2b')]=_[_0x03ba('0x2a')](_0x4fe7eb[_0x03ba('0x2b')]);_0x36cc6b[_0x03ba('0x2c')]=_[_0x03ba('0x2d')](_0x36cc6b[_0x03ba('0x28')],_0x36cc6b['query']);_0xbfffb[_0x03ba('0x2e')]=_['intersection'](_0x36cc6b[_0x03ba('0x28')],qs['fields'](_0x4fe7eb[_0x03ba('0x2b')][_0x03ba('0x2f')]));_0xbfffb[_0x03ba('0x2e')]=_0xbfffb[_0x03ba('0x2e')]['length']?_0xbfffb[_0x03ba('0x2e')]:_0x36cc6b[_0x03ba('0x28')];if(_0x4fe7eb[_0x03ba('0x2b')][_0x03ba('0x3a')]){_0xbfffb[_0x03ba('0x3b')]=[{'all':!![]}];}_0xbfffb=_['merge']({},_0xbfffb,_0x4fe7eb['options']);return db['Attachment'][_0x03ba('0x3f')](_0xbfffb)[_0x03ba('0x21')](handleEntityNotFound(_0x52eefe,null))[_0x03ba('0x21')](respondWithResult(_0x52eefe,null))[_0x03ba('0x3d')](handleError(_0x52eefe,null));};exports[_0x03ba('0x40')]=function(_0x1d252,_0x52e8a2){var _0x2b49f7={'where':{'id':_0x1d252[_0x03ba('0x41')]['id']}},_0x36ced6={};_0x36ced6['model']=_[_0x03ba('0x2a')](db[_0x03ba('0x39')][_0x03ba('0x27')]);_0x2b49f7[_0x03ba('0x2e')]=_['intersection'](_0x36ced6[_0x03ba('0x28')],qs[_0x03ba('0x2f')](_0x1d252[_0x03ba('0x2b')]['fields']));_0x2b49f7['attributes']=_0x2b49f7['attributes']['length']?_0x2b49f7[_0x03ba('0x2e')]:_0x36ced6['model'];if(_0x1d252['query'][_0x03ba('0x3a')]){_0x2b49f7[_0x03ba('0x3b')]=[{'all':!![]}];}_0x2b49f7=_[_0x03ba('0x37')]({},_0x2b49f7,_0x1d252[_0x03ba('0x42')]);return db[_0x03ba('0x39')][_0x03ba('0x3f')](_0x2b49f7)['then'](handleEntityNotFound(_0x52e8a2,null))[_0x03ba('0x21')](function(_0x43c7f3){if(_0x43c7f3){var _0x39a4d9=_0x43c7f3[_0x03ba('0x43')]({'plain':!![]});_0x39a4d9=qs[_0x03ba('0x44')](_0x39a4d9,['id',_0x03ba('0x45'),_0x03ba('0x46')]);_0x1d252[_0x03ba('0x47')]=_[_0x03ba('0x44')](_0x1d252[_0x03ba('0x47')],['id',_0x03ba('0x45'),_0x03ba('0x46')]);return db['Attachment'][_0x03ba('0x48')](_[_0x03ba('0x37')](_0x39a4d9,_0x1d252[_0x03ba('0x47')]),{'include':_0x1d252[_0x03ba('0x2b')][_0x03ba('0x3a')]?[{'all':!![]}]:undefined});}})[_0x03ba('0x21')](respondWithResult(_0x52e8a2,0xc9))['catch'](handleError(_0x52e8a2,null));};exports[_0x03ba('0x49')]=function(_0x2099ec,_0x4c043e){if(_0x2099ec[_0x03ba('0x47')]['id']){delete _0x2099ec['body']['id'];}return db['Attachment']['find']({'where':{'id':_0x2099ec[_0x03ba('0x41')]['id']}})[_0x03ba('0x21')](handleEntityNotFound(_0x4c043e,null))['then'](saveUpdates(_0x2099ec[_0x03ba('0x47')],null))[_0x03ba('0x21')](respondWithResult(_0x4c043e,null))[_0x03ba('0x3d')](handleError(_0x4c043e,null));};exports[_0x03ba('0x4a')]=function(_0x189adf,_0x38272b){return db[_0x03ba('0x39')][_0x03ba('0x3f')]({'where':{'id':_0x189adf[_0x03ba('0x41')]['id']}})[_0x03ba('0x21')](handleEntityNotFound(_0x38272b,null))['then'](removeEntity(_0x38272b,null))[_0x03ba('0x3d')](handleError(_0x38272b,null));};exports[_0x03ba('0x48')]=function(_0x226a17,_0x2a53b3,_0x446007){_0x226a17[_0x03ba('0x47')][_0x03ba('0x25')]=_0x226a17['file'][_0x03ba('0x4b')];_0x226a17[_0x03ba('0x47')][_0x03ba('0x4c')]=_0x226a17[_0x03ba('0x4d')][_0x03ba('0x4e')];_0x226a17[_0x03ba('0x47')][_0x03ba('0x4f')]=_0x226a17[_0x03ba('0x4d')]['mimetype'];return db[_0x03ba('0x39')][_0x03ba('0x48')](_0x226a17[_0x03ba('0x47')])['then'](respondWithResult(_0x2a53b3,0xc9))[_0x03ba('0x3d')](handleError(_0x2a53b3,null));};exports[_0x03ba('0x50')]=function(_0x3d06ea,_0x46b43c,_0x2c5f93){return db['Attachment'][_0x03ba('0x51')]({'where':{'id':_0x3d06ea[_0x03ba('0x41')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x46b43c,null))[_0x03ba('0x21')](function(_0x26ad9b){if(_0x26ad9b){var _0x4ccf38=_0x26ad9b['ChatOfflineMessageId']!==null;var _0x203b49=path[_0x03ba('0x52')](config[_0x03ba('0x53')],'server/files/attachments/');if(_0x4ccf38){_0x203b49=path['join'](_0x203b49,_0x03ba('0x54'));}var _0x10983f=path[_0x03ba('0x52')](_0x203b49,_0x26ad9b['basename']);return _0x46b43c[_0x03ba('0x50')](_0x10983f);}})[_0x03ba('0x3d')](handleError(_0x46b43c,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index b2002ff..fa0ca5c 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 _0xeaff=['../../config/environment','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x263a5c,_0x461a5e){var _0x19c4de=function(_0x13db9f){while(--_0x13db9f){_0x263a5c['push'](_0x263a5c['shift']());}};_0x19c4de(++_0x461a5e);}(_0xeaff,0x131));var _0xfeaf=function(_0x43a639,_0x20225c){_0x43a639=_0x43a639-0x0;var _0x51ec84=_0xeaff[_0x43a639];return _0x51ec84;};'use strict';var _=require(_0xfeaf('0x0'));var util=require(_0xfeaf('0x1'));var logger=require(_0xfeaf('0x2'))(_0xfeaf('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfeaf('0x4'));var fs=require('fs');var path=require(_0xfeaf('0x5'));var rimraf=require(_0xfeaf('0x6'));var config=require(_0xfeaf('0x7'));var attributes=require('./attachment.attributes');module[_0xfeaf('0x8')]=function(_0x26ee7c,_0x4e0bce){return _0x26ee7c[_0xfeaf('0x9')](_0xfeaf('0xa'),attributes,{'tableName':_0xfeaf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf1b4=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','lodash'];(function(_0x510b98,_0x4c4cbb){var _0x45e775=function(_0x29ec11){while(--_0x29ec11){_0x510b98['push'](_0x510b98['shift']());}};_0x45e775(++_0x4c4cbb);}(_0xf1b4,0x173));var _0x4f1b=function(_0x1e520,_0x48d019){_0x1e520=_0x1e520-0x0;var _0x382f02=_0xf1b4[_0x1e520];return _0x382f02;};'use strict';var _=require(_0x4f1b('0x0'));var util=require(_0x4f1b('0x1'));var logger=require(_0x4f1b('0x2'))(_0x4f1b('0x3'));var moment=require(_0x4f1b('0x4'));var BPromise=require(_0x4f1b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4f1b('0x6'));var config=require(_0x4f1b('0x7'));var attributes=require(_0x4f1b('0x8'));module[_0x4f1b('0x9')]=function(_0x203810,_0x5bcc8c){return _0x203810[_0x4f1b('0xa')](_0x4f1b('0xb'),attributes,{'tableName':'attachments','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 fdcc0b0..ec54190 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 _0xee39=['create','body','options','raw','then','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Attachment,\x20%s,\x20%s','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateAttachment','Attachment'];(function(_0x606961,_0x14eb5e){var _0x1b63ed=function(_0x44e380){while(--_0x44e380){_0x606961['push'](_0x606961['shift']());}};_0x1b63ed(++_0x14eb5e);}(_0xee39,0x1e6));var _0x9ee3=function(_0x5efbfc,_0x5c1e32){_0x5efbfc=_0x5efbfc-0x0;var _0x286883=_0xee39[_0x5efbfc];return _0x286883;};'use strict';var _=require(_0x9ee3('0x0'));var util=require(_0x9ee3('0x1'));var moment=require(_0x9ee3('0x2'));var BPromise=require('bluebird');var rs=require(_0x9ee3('0x3'));var fs=require('fs');var Redis=require(_0x9ee3('0x4'));var db=require(_0x9ee3('0x5'))['db'];var utils=require(_0x9ee3('0x6'));var logger=require(_0x9ee3('0x7'))(_0x9ee3('0x8'));var config=require(_0x9ee3('0x9'));var jayson=require(_0x9ee3('0xa'));var client=jayson[_0x9ee3('0xb')][_0x9ee3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4dc1eb,_0x10e9e6,_0x22264c){return new BPromise(function(_0x22c8fc,_0x4d1a57){return client[_0x9ee3('0xd')](_0x4dc1eb,_0x22264c)['then'](function(_0x1bde67){logger['info'](_0x9ee3('0xe'),_0x10e9e6,'request\x20sent');logger['debug'](_0x9ee3('0xf'),_0x10e9e6,'request\x20sent',JSON[_0x9ee3('0x10')](_0x1bde67));if(_0x1bde67['error']){if(_0x1bde67[_0x9ee3('0x11')][_0x9ee3('0x12')]===0x1f4){logger[_0x9ee3('0x11')](_0x9ee3('0xe'),_0x10e9e6,_0x1bde67[_0x9ee3('0x11')][_0x9ee3('0x13')]);return _0x4d1a57(_0x1bde67[_0x9ee3('0x11')]['message']);}logger[_0x9ee3('0x11')](_0x9ee3('0xe'),_0x10e9e6,_0x1bde67[_0x9ee3('0x11')]['message']);return _0x22c8fc(_0x1bde67[_0x9ee3('0x11')][_0x9ee3('0x13')]);}else{logger[_0x9ee3('0x14')](_0x9ee3('0xe'),_0x10e9e6,'request\x20sent');_0x22c8fc(_0x1bde67['result'][_0x9ee3('0x13')]);}})[_0x9ee3('0x15')](function(_0x456bf7){logger[_0x9ee3('0x11')](_0x9ee3('0xe'),_0x10e9e6,_0x456bf7);_0x4d1a57(_0x456bf7);});});}exports[_0x9ee3('0x16')]=function(_0x4a0de5){var _0x4a987a=this;return new Promise(function(_0x1f937f,_0x1342e2){return db[_0x9ee3('0x17')][_0x9ee3('0x18')](_0x4a0de5[_0x9ee3('0x19')],{'raw':_0x4a0de5[_0x9ee3('0x1a')]?_0x4a0de5[_0x9ee3('0x1a')][_0x9ee3('0x1b')]===undefined?!![]:![]:!![]})[_0x9ee3('0x1c')](function(_0x80671d){logger['info'](_0x9ee3('0x16'),_0x4a0de5);logger[_0x9ee3('0x1d')](_0x9ee3('0x16'),_0x4a0de5,JSON[_0x9ee3('0x10')](_0x80671d));_0x1f937f(_0x80671d);})[_0x9ee3('0x15')](function(_0x44bc5a){logger['error'](_0x9ee3('0x16'),_0x44bc5a[_0x9ee3('0x13')],_0x4a0de5);_0x1342e2(_0x4a987a[_0x9ee3('0x11')](0x1f4,_0x44bc5a[_0x9ee3('0x13')]));});});};
\ No newline at end of file
+var _0x76dc=['code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','create','body','options','then','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','info','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x76dc,0x1f2));var _0xc76d=function(_0x5d1445,_0xed27f2){_0x5d1445=_0x5d1445-0x0;var _0xe6c508=_0x76dc[_0x5d1445];return _0xe6c508;};'use strict';var _=require(_0xc76d('0x0'));var util=require(_0xc76d('0x1'));var moment=require(_0xc76d('0x2'));var BPromise=require(_0xc76d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc76d('0x4'));var db=require(_0xc76d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc76d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc76d('0x7'));var client=jayson[_0xc76d('0x8')][_0xc76d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4832bd,_0x4ce0bd,_0x119f38){return new BPromise(function(_0x114572,_0x18574f){return client['request'](_0x4832bd,_0x119f38)['then'](function(_0x1dc996){logger[_0xc76d('0xa')]('Attachment,\x20%s,\x20%s',_0x4ce0bd,_0xc76d('0xb'));logger['debug'](_0xc76d('0xc'),_0x4ce0bd,_0xc76d('0xb'),JSON[_0xc76d('0xd')](_0x1dc996));if(_0x1dc996[_0xc76d('0xe')]){if(_0x1dc996[_0xc76d('0xe')][_0xc76d('0xf')]===0x1f4){logger[_0xc76d('0xe')](_0xc76d('0x10'),_0x4ce0bd,_0x1dc996[_0xc76d('0xe')][_0xc76d('0x11')]);return _0x18574f(_0x1dc996[_0xc76d('0xe')][_0xc76d('0x11')]);}logger[_0xc76d('0xe')](_0xc76d('0x10'),_0x4ce0bd,_0x1dc996['error'][_0xc76d('0x11')]);return _0x114572(_0x1dc996[_0xc76d('0xe')]['message']);}else{logger[_0xc76d('0xa')](_0xc76d('0x10'),_0x4ce0bd,_0xc76d('0xb'));_0x114572(_0x1dc996[_0xc76d('0x12')]['message']);}})[_0xc76d('0x13')](function(_0x5d881c){logger['error'](_0xc76d('0x10'),_0x4ce0bd,_0x5d881c);_0x18574f(_0x5d881c);});});}exports[_0xc76d('0x14')]=function(_0x339623){var _0x23f3ca=this;return new Promise(function(_0xd1d16f,_0x4b0402){return db[_0xc76d('0x15')][_0xc76d('0x16')](_0x339623[_0xc76d('0x17')],{'raw':_0x339623[_0xc76d('0x18')]?_0x339623[_0xc76d('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xc76d('0x19')](function(_0x324db7){logger['info'](_0xc76d('0x14'),_0x339623);logger[_0xc76d('0x1a')](_0xc76d('0x14'),_0x339623,JSON[_0xc76d('0xd')](_0x324db7));_0xd1d16f(_0x324db7);})[_0xc76d('0x13')](function(_0x3d357b){logger[_0xc76d('0xe')](_0xc76d('0x14'),_0x3d357b[_0xc76d('0x11')],_0x339623);_0x4b0402(_0x23f3ca[_0xc76d('0xe')](0x1f4,_0x3d357b[_0xc76d('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 3d2c943..92af615 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x263965,_0x5e0cb8){var _0x41f0fe=function(_0x33acad){while(--_0x33acad){_0x263965['push'](_0x263965['shift']());}};_0x41f0fe(++_0x5e0cb8);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1c540d,_0x16c677){_0x1c540d=_0x1c540d-0x0;var _0x23ea63=_0x5f2f[_0x1c540d];return _0x23ea63;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
+var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x0b0e,0x187));var _0xe0b0=function(_0x52684f,_0xff73fc){_0x52684f=_0x52684f-0x0;var _0x4a55f0=_0x0b0e[_0x52684f];return _0x4a55f0;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 3330d35..81b9f4a 100644
--- a/server/api/authActiveDirectory/authActiveDirectory.controller.js
+++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x93dd=['Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','online','admin','user','agent','add','minutes','getLicense','catch','status','message','login','ad-login','signToken','json','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','undefined','activedirectory','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','blockDuration','then','adSsoEnabled'];(function(_0x572ae6,_0x5590fd){var _0x43423a=function(_0x165b05){while(--_0x165b05){_0x572ae6['push'](_0x572ae6['shift']());}};_0x43423a(++_0x5590fd);}(_0x93dd,0x14f));var _0xd93d=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x93dd[_0x51020b];return _0x371e47;};'use strict';var passport=require(_0xd93d('0x0'));var LocalStrategy=require(_0xd93d('0x1'))[_0xd93d('0x2')];var moment=require(_0xd93d('0x3'));var ActiveDirectory=require(_0xd93d('0x4'));var BPromise=require(_0xd93d('0x5'));var util=require(_0xd93d('0x6'));var db=require(_0xd93d('0x7'))['db'];var authService=require(_0xd93d('0x8'));var utils=require(_0xd93d('0x9'));var config=require(_0xd93d('0xa'));var logger=require(_0xd93d('0xb'))(_0xd93d('0xc'));function isActiveDirectoryConfigured(_0x1380e8){var _0xa57b97=![];if(typeof _0x1380e8['activedirectory']!==_0xd93d('0xd')){_0xa57b97=_0x1380e8[_0xd93d('0xe')][_0xd93d('0xf')]&&_0x1380e8['activedirectory'][_0xd93d('0x10')]&&_0x1380e8[_0xd93d('0xe')][_0xd93d('0x11')];}return _0xa57b97;}function adAuthenticate(_0x5320a4,_0x2e325b,_0x3cbd42){return new BPromise(function(_0x1c4aa0,_0x4a4cbf){try{var _0x25216f=new ActiveDirectory(_0x5320a4);_0x25216f[_0xd93d('0x12')](_0x2e325b,_0x3cbd42,function(_0xebb4e,_0x1cac67){if(_0xebb4e){logger[_0xd93d('0x13')](_0xd93d('0x14'),_0x2e325b,util[_0xd93d('0x15')](_0xebb4e,{'showHidden':![],'depth':null}));_0x4a4cbf('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x1cac67){logger['error'](_0xd93d('0x16'),_0x2e325b);_0x4a4cbf(_0xd93d('0x17'));}else{_0x1c4aa0(_0x1cac67);}});}catch(_0x45da81){_0x4a4cbf(_0x45da81);}});}function ActiveDirectoryAuthenticate(_0x18d0a7,_0x54405f,_0x35d0ee,_0x307619){var _0x2f625a,_0x55a716;if(!isActiveDirectoryConfigured(config)){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x54405f);return _0x307619(null,![],{'message':_0xd93d('0x17')});}return db[_0xd93d('0x18')][_0xd93d('0x19')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xd93d('0x1a')],'raw':!![]})[_0xd93d('0x1b')](function(_0x5b7fbd){_0x2f625a=_0x5b7fbd;if(!_0x2f625a[_0xd93d('0x1c')]){logger[_0xd93d('0x13')](_0xd93d('0x1d'),_0x54405f);throw new Error(_0xd93d('0x17'));}return _0x18d0a7[_0xd93d('0x19')]({'logging':!![],'attributes':['id',_0xd93d('0x1e'),_0xd93d('0x1f'),_0xd93d('0x20'),_0xd93d('0x21'),_0xd93d('0x22'),_0xd93d('0x23'),_0xd93d('0x24'),_0xd93d('0x25')],'where':{'name':_0x54405f,'role':{'$or':[_0xd93d('0x26'),_0xd93d('0x27'),_0xd93d('0x28')]},'adSsoEnabled':!![]}});})[_0xd93d('0x1b')](function(_0x21465c){if(!_0x21465c||_0x21465c&&_0x21465c['name']!==_0x54405f){throw new Error(_0xd93d('0x17'));}_0x55a716=_0x21465c;var _0x3f2030=_0x55a716[_0xd93d('0x1e')]+'@'+config['activedirectory'][_0xd93d('0x11')];return adAuthenticate(config[_0xd93d('0xe')],_0x3f2030,_0x35d0ee);})['then'](function(_0x13d156){if(_0x55a716[_0xd93d('0x22')]){throw new Error(_0xd93d('0x17'));}if(_0x2f625a[_0xd93d('0x1a')]>0x0){if(_0x55a716[_0xd93d('0x23')]){if(moment(_0x55a716[_0xd93d('0x24')])[_0xd93d('0x29')](_0x2f625a['blockDuration'],_0xd93d('0x2a'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0x55a716,0x0,![],null)['then'](function(){return utils[_0xd93d('0x2b')](_0x55a716);})[_0xd93d('0x1b')](function(){return _0x307619(null,_0x55a716);});}else{return utils[_0xd93d('0x2b')](_0x55a716)['then'](function(){return _0x307619(null,_0x55a716);});}}else{return utils[_0xd93d('0x2b')](_0x55a716)[_0xd93d('0x1b')](function(){return _0x307619(null,_0x55a716);});}})[_0xd93d('0x2c')](function(_0x2e5042){return _0x307619(null,![],_0x2e5042);});}function handleError(_0x2877cc,_0x3f3277,_0x25a0fd){return _0x2877cc[_0xd93d('0x2d')](_0x3f3277||0x1f4)['send']({'message':_0x25a0fd?_0x25a0fd[_0xd93d('0x2e')]||_0x25a0fd:''});}exports[_0xd93d('0x2f')]=function(_0x8ca457,_0x33eeea,_0x31cf8d){passport[_0xd93d('0x12')](_0xd93d('0x30'),function(_0x31ab26,_0x38884b,_0x42c3e7){var _0x59ee93=_0x31ab26||_0x42c3e7;if(_0x59ee93){return handleError(_0x33eeea,0x191,_0x59ee93);}if(!_0x38884b){return handleError(_0x33eeea,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x1fda2a={'payload':{'id':_0x38884b['id'],'role':_0x38884b[_0xd93d('0x21')]},'options':{'expiresIn':0x15180}};return authService[_0xd93d('0x31')](_0x1fda2a)[_0xd93d('0x1b')](function(_0x33466c){_0x33eeea[_0xd93d('0x32')]({'id':_0x38884b['id'],'token':_0x33466c,'statusCall':'','isAlreadyLogged':_0x38884b[_0xd93d('0x25')]});});}})(_0x8ca457,_0x33eeea,_0x31cf8d);};passport['use'](_0xd93d('0x30'),new LocalStrategy({'usernameField':'name','passwordField':_0xd93d('0x1f')},function(_0x109a3f,_0xbc63f5,_0x29ef8b){return ActiveDirectoryAuthenticate(db[_0xd93d('0x33')],_0x109a3f,_0xbc63f5,_0x29ef8b);}));
\ No newline at end of file
+var _0x086d=['bluebird','util','../../mysqldb','../../components/auth/service','../../config/logger','api','activedirectory','undefined','domain','error','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','blockedAt','admin','user','agent','disabled','add','minutes','getLicense','status','send','message','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','User','passport','moment','activedirectory2'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x086d,0x81));var _0xd086=function(_0x52e590,_0x52d936){_0x52e590=_0x52e590-0x0;var _0x376559=_0x086d[_0x52e590];return _0x376559;};'use strict';var passport=require(_0xd086('0x0'));var LocalStrategy=require('passport-local')['Strategy'];var moment=require(_0xd086('0x1'));var ActiveDirectory=require(_0xd086('0x2'));var BPromise=require(_0xd086('0x3'));var util=require(_0xd086('0x4'));var db=require(_0xd086('0x5'))['db'];var authService=require(_0xd086('0x6'));var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require(_0xd086('0x7'))(_0xd086('0x8'));function isActiveDirectoryConfigured(_0x45fefe){var _0x513cf5=![];if(typeof _0x45fefe[_0xd086('0x9')]!==_0xd086('0xa')){_0x513cf5=_0x45fefe[_0xd086('0x9')]['baseDN']&&_0x45fefe[_0xd086('0x9')]['url']&&_0x45fefe[_0xd086('0x9')][_0xd086('0xb')];}return _0x513cf5;}function adAuthenticate(_0x12d5ab,_0x4fd624,_0x35f7fd){return new BPromise(function(_0x125b96,_0x22a7da){try{var _0x36573e=new ActiveDirectory(_0x12d5ab);_0x36573e['authenticate'](_0x4fd624,_0x35f7fd,function(_0xf01b5e,_0x151292){if(_0xf01b5e){logger[_0xd086('0xc')]('Error\x20authenticate\x20%s:\x20%s',_0x4fd624,util['inspect'](_0xf01b5e,{'showHidden':![],'depth':null}));_0x22a7da(_0xd086('0xd'));}else if(!_0x151292){logger[_0xd086('0xc')](_0xd086('0xe'),_0x4fd624);_0x22a7da(_0xd086('0xd'));}else{_0x125b96(_0x151292);}});}catch(_0x227f15){_0x22a7da(_0x227f15);}});}function ActiveDirectoryAuthenticate(_0x55449a,_0x46b66d,_0x1a1116,_0x585d18){var _0x2ace02,_0xb63b46;if(!isActiveDirectoryConfigured(config)){logger[_0xd086('0xc')](_0xd086('0xf'),_0x46b66d);return _0x585d18(null,![],{'message':_0xd086('0xd')});}return db[_0xd086('0x10')][_0xd086('0x11')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xd086('0x12')],'raw':!![]})[_0xd086('0x13')](function(_0x52f0a4){_0x2ace02=_0x52f0a4;if(!_0x2ace02[_0xd086('0x14')]){logger['error'](_0xd086('0x15'),_0x46b66d);throw new Error(_0xd086('0xd'));}return _0x55449a[_0xd086('0x11')]({'logging':!![],'attributes':['id',_0xd086('0x16'),_0xd086('0x17'),_0xd086('0x18'),_0xd086('0x19'),'disabled',_0xd086('0x1a'),_0xd086('0x1b'),'online'],'where':{'name':_0x46b66d,'role':{'$or':[_0xd086('0x1c'),_0xd086('0x1d'),_0xd086('0x1e')]},'adSsoEnabled':!![]}});})[_0xd086('0x13')](function(_0x46c56d){if(!_0x46c56d||_0x46c56d&&_0x46c56d[_0xd086('0x16')]!==_0x46b66d){throw new Error(_0xd086('0xd'));}_0xb63b46=_0x46c56d;var _0x190cd1=_0xb63b46['name']+'@'+config['activedirectory'][_0xd086('0xb')];return adAuthenticate(config[_0xd086('0x9')],_0x190cd1,_0x1a1116);})[_0xd086('0x13')](function(_0x43159b){if(_0xb63b46[_0xd086('0x1f')]){throw new Error(_0xd086('0xd'));}if(_0x2ace02[_0xd086('0x12')]>0x0){if(_0xb63b46[_0xd086('0x1a')]){if(moment(_0xb63b46['blockedAt'])[_0xd086('0x20')](_0x2ace02[_0xd086('0x12')],_0xd086('0x21'))>moment()){throw new Error(_0xd086('0xd'));}return utils['clearBlockUser'](_0xb63b46,0x0,![],null)[_0xd086('0x13')](function(){return utils[_0xd086('0x22')](_0xb63b46);})['then'](function(){return _0x585d18(null,_0xb63b46);});}else{return utils[_0xd086('0x22')](_0xb63b46)[_0xd086('0x13')](function(){return _0x585d18(null,_0xb63b46);});}}else{return utils[_0xd086('0x22')](_0xb63b46)[_0xd086('0x13')](function(){return _0x585d18(null,_0xb63b46);});}})['catch'](function(_0x1a412a){return _0x585d18(null,![],_0x1a412a);});}function handleError(_0x3e9063,_0x462ad6,_0x12dd9f){return _0x3e9063[_0xd086('0x23')](_0x462ad6||0x1f4)[_0xd086('0x24')]({'message':_0x12dd9f?_0x12dd9f[_0xd086('0x25')]||_0x12dd9f:''});}exports['login']=function(_0x1f7430,_0x45662e,_0x504d3e){passport[_0xd086('0x26')](_0xd086('0x27'),function(_0x2a0717,_0x5be14e,_0x24bedd){var _0xd35f31=_0x2a0717||_0x24bedd;if(_0xd35f31){return handleError(_0x45662e,0x191,_0xd35f31);}if(!_0x5be14e){return handleError(_0x45662e,0x194,{'message':_0xd086('0x28')});}else{var _0x294ed4={'payload':{'id':_0x5be14e['id'],'role':_0x5be14e[_0xd086('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x294ed4)[_0xd086('0x13')](function(_0x56c3a5){_0x45662e[_0xd086('0x29')]({'id':_0x5be14e['id'],'token':_0x56c3a5,'statusCall':'','isAlreadyLogged':_0x5be14e[_0xd086('0x2a')]});});}})(_0x1f7430,_0x45662e,_0x504d3e);};passport['use'](_0xd086('0x27'),new LocalStrategy({'usernameField':_0xd086('0x16'),'passwordField':_0xd086('0x17')},function(_0x5eb285,_0x4cd870,_0x193a0e){return ActiveDirectoryAuthenticate(db[_0xd086('0x2b')],_0x5eb285,_0x4cd870,_0x193a0e);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index be056c1..2b88dca 100644
--- a/server/api/authActiveDirectory/index.js
+++ b/server/api/authActiveDirectory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb4e1=['login','express','Router','./authActiveDirectory.controller','post'];(function(_0x2b9242,_0x43ae35){var _0x3a833a=function(_0x254242){while(--_0x254242){_0x2b9242['push'](_0x2b9242['shift']());}};_0x3a833a(++_0x43ae35);}(_0xb4e1,0x1d2));var _0x1b4e=function(_0x5c77b9,_0x21ce72){_0x5c77b9=_0x5c77b9-0x0;var _0x350ca6=_0xb4e1[_0x5c77b9];return _0x350ca6;};'use strict';var express=require(_0x1b4e('0x0'));var router=express[_0x1b4e('0x1')]();var controller=require(_0x1b4e('0x2'));router[_0x1b4e('0x3')]('/',controller[_0x1b4e('0x4')]);module['exports']=router;
\ No newline at end of file
+var _0xcc62=['express','exports'];(function(_0x5a6e32,_0x573b46){var _0x168e07=function(_0x427e62){while(--_0x427e62){_0x5a6e32['push'](_0x5a6e32['shift']());}};_0x168e07(++_0x573b46);}(_0xcc62,0x172));var _0x2cc6=function(_0x1b224e,_0x3d63bf){_0x1b224e=_0x1b224e-0x0;var _0x9a6667=_0xcc62[_0x1b224e];return _0x9a6667;};'use strict';var express=require(_0x2cc6('0x0'));var router=express['Router']();var controller=require('./authActiveDirectory.controller');router['post']('/',controller['login']);module[_0x2cc6('0x1')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 417fd7d..9b7f9ff 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x7a54,0x106));var _0x47a5=function(_0x1f56fc,_0x376bee){_0x1f56fc=_0x1f56fc-0x0;var _0x58ae7c=_0x7a54[_0x1f56fc];return _0x58ae7c;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x7a54,0x106));var _0x47a5=function(_0x3a3ec9,_0x5a5b4f){_0x3a3ec9=_0x3a3ec9-0x0;var _0x289755=_0x7a54[_0x3a3ec9];return _0x289755;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 13cfba1..90be8c0 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 _0x204d=['express','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login','get','isMiddleware'];(function(_0x3471b7,_0x3aaa34){var _0xe4b843=function(_0x14e455){while(--_0x14e455){_0x3471b7['push'](_0x3471b7['shift']());}};_0xe4b843(++_0x3aaa34);}(_0x204d,0x150));var _0xd204=function(_0xe8129c,_0x2fb03c){_0xe8129c=_0xe8129c-0x0;var _0x709fc5=_0x204d[_0xe8129c];return _0x709fc5;};'use strict';var express=require(_0xd204('0x0'));var passport=require('passport');var router=express['Router']();var controller=require(_0xd204('0x1'));var userController=require(_0xd204('0x2'));var authService=require(_0xd204('0x3'));router['get']('/',controller[_0xd204('0x4')]);router[_0xd204('0x5')]('/callback',controller['callback'],authService[_0xd204('0x6')],userController[_0xd204('0x4')],authService['setTokenCookie']);module['exports']=router;
\ No newline at end of file
+var _0xde5f=['../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','express','passport','Router','./authGoogle.controller','../user/user.controller.js'];(function(_0x12093a,_0x4f85e3){var _0x21940c=function(_0xba825a){while(--_0xba825a){_0x12093a['push'](_0x12093a['shift']());}};_0x21940c(++_0x4f85e3);}(_0xde5f,0x97));var _0xfde5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde5f[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xfde5('0x0'));var passport=require(_0xfde5('0x1'));var router=express[_0xfde5('0x2')]();var controller=require(_0xfde5('0x3'));var userController=require(_0xfde5('0x4'));var authService=require(_0xfde5('0x5'));router[_0xfde5('0x6')]('/',controller[_0xfde5('0x7')]);router[_0xfde5('0x6')](_0xfde5('0x8'),controller[_0xfde5('0x9')],authService[_0xfde5('0xa')],userController[_0xfde5('0x7')],authService[_0xfde5('0xb')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 89d6237..bb41e99 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 _0x0504=['You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','token','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','previousPasswords','Password\x20reset!','use','User','passport','passport-local','Strategy','lodash','randomstring','moment','../../config/utils','client','http','allowedLoginAttempts','then','findOne','name','password','salt','role','disabled','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','minutes','clearBlockUser','add','getLicense','catch','blocked','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','user','merge','\x22%s\x22\x20<%s>','request','SendMail','error','format','message','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset'];(function(_0x175ee9,_0x2de806){var _0x475b96=function(_0x98c9ec){while(--_0x98c9ec){_0x175ee9['push'](_0x175ee9['shift']());}};_0x475b96(++_0x2de806);}(_0x0504,0x1c3));var _0x4050=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x0504[_0xb0f7c3];return _0x28ea68;};'use strict';var util=require('util');var passport=require(_0x4050('0x0'));var LocalStrategy=require(_0x4050('0x1'))[_0x4050('0x2')];var jayson=require('jayson/promise');var _=require(_0x4050('0x3'));var rs=require(_0x4050('0x4'));var moment=require(_0x4050('0x5'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x4050('0x6'));var client=jayson[_0x4050('0x7')][_0x4050('0x8')]({'port':0x232b});function localAuthenticate(_0x4b86c4,_0x307538,_0x321748,_0x1d7eb0){var _0x4276cc,_0x21b34d;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x4050('0x9'),'blockDuration'],'raw':!![]})[_0x4050('0xa')](function(_0x55f2fa){_0x4276cc=_0x55f2fa;return _0x4b86c4[_0x4050('0xb')]({'attributes':['id',_0x4050('0xc'),_0x4050('0xd'),_0x4050('0xe'),_0x4050('0xf'),_0x4050('0x10'),'blocked',_0x4050('0x11'),_0x4050('0x12')],'where':{'name':_0x307538,'role':{'$or':[_0x4050('0x13'),'user',_0x4050('0x14')]}}});})[_0x4050('0xa')](function(_0x57be0e){if(!_0x57be0e||_0x57be0e&&_0x57be0e['name']!==_0x307538){throw new Error(_0x4050('0x15'));}else{_0x21b34d=_0x57be0e;return _0x21b34d;}})[_0x4050('0xa')](function(){_0x21b34d[_0x4050('0x16')](_0x321748,function(_0x49cbdb,_0x4f632a){var _0x56c435=_0x21b34d[_0x4050('0x12')]+0x1;if(_0x49cbdb){return _0x1d7eb0(_0x49cbdb);}else if(!_0x4f632a){if(_0x21b34d[_0x4050('0x10')]){return _0x1d7eb0(null,![],{'message':_0x4050('0x15')});}else if(_0x4276cc[_0x4050('0x9')]>0x0){if(_0x21b34d['blocked']){if(_0x4276cc[_0x4050('0x17')]>0x0){if(moment(_0x21b34d[_0x4050('0x11')])['add'](_0x4276cc[_0x4050('0x17')],_0x4050('0x18'))>moment()){return _0x1d7eb0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x4050('0x19')](_0x21b34d,_0x56c435,![],null)[_0x4050('0xa')](function(){return _0x1d7eb0(null,![],{'message':_0x4050('0x15')});});}}else{return _0x1d7eb0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x56c435>=_0x4276cc['allowedLoginAttempts']){return utils[_0x4050('0x19')](_0x21b34d,0x0,!![],moment())[_0x4050('0xa')](function(){return _0x1d7eb0(null,![],{'message':_0x4050('0x15')});});}else{return utils['clearBlockUser'](_0x21b34d,_0x56c435,![],null)[_0x4050('0xa')](function(){return _0x1d7eb0(null,![],{'message':_0x4050('0x15')});});}}}else{return _0x1d7eb0(null,![],{'message':_0x4050('0x15')});}}else{if(_0x21b34d['disabled']){return _0x1d7eb0(null,![],{'message':_0x4050('0x15')});}else if(_0x4276cc['allowedLoginAttempts']>0x0){if(_0x21b34d['blocked']){if(_0x4276cc[_0x4050('0x17')]>0x0){if(moment(_0x21b34d['blockedAt'])[_0x4050('0x1a')](_0x4276cc[_0x4050('0x17')],_0x4050('0x18'))>moment()){return _0x1d7eb0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x4050('0x19')](_0x21b34d,0x0,![],null)['then'](function(){return utils[_0x4050('0x1b')](_0x21b34d);})['then'](function(){return _0x1d7eb0(null,_0x21b34d);});}}else{return _0x1d7eb0(null,![],{'message':_0x4050('0x15')});}}else{return utils[_0x4050('0x19')](_0x21b34d,0x0,![],null)[_0x4050('0xa')](function(){return utils[_0x4050('0x1b')](_0x21b34d);})['then'](function(){return _0x1d7eb0(null,_0x21b34d);})[_0x4050('0x1c')](function(_0xa592d9){return _0x1d7eb0(null,![],_0xa592d9);});}}else{if(_0x21b34d[_0x4050('0x1d')]){return _0x1d7eb0(null,![],{'message':_0x4050('0x15')});}else{return utils[_0x4050('0x1b')](_0x21b34d)[_0x4050('0xa')](function(){return _0x1d7eb0(null,_0x21b34d);});}}}});})[_0x4050('0x1c')](function(_0x34e6af){return _0x1d7eb0(null,![],_0x34e6af);});}function sendServiceMail(_0xb6fe4){return db[_0x4050('0x1e')][_0x4050('0x1f')]({'where':{'service':!![]},'attributes':['id','name',_0x4050('0x20')],'include':[{'model':db[_0x4050('0x21')],'as':_0x4050('0x22')}]})[_0x4050('0xa')](function(_0x1783ad){if(!_0x1783ad){throw new Error(_0x4050('0x23'));}var _0x5f4142={'tls':{'rejectUnauthorized':![]}};if(_0x1783ad['Smtp'][_0x4050('0x24')]){_0x5f4142[_0x4050('0x24')]=_0x1783ad[_0x4050('0x22')]['service'];}else{_0x5f4142[_0x4050('0x25')]=_0x1783ad[_0x4050('0x22')][_0x4050('0x25')];_0x5f4142['port']=_0x1783ad[_0x4050('0x22')][_0x4050('0x26')];_0x5f4142[_0x4050('0x27')]=_0x1783ad['Smtp'][_0x4050('0x27')];}if(_0x1783ad[_0x4050('0x22')][_0x4050('0x28')]){_0x5f4142[_0x4050('0x29')]={'user':_0x1783ad[_0x4050('0x22')][_0x4050('0x2a')],'pass':_0x1783ad['Smtp']['pass']};}var _0x1f3860={'account':_0x5f4142,'message':_[_0x4050('0x2b')]({'from':util['format'](_0x4050('0x2c'),_0x1783ad[_0x4050('0xc')],_0x1783ad[_0x4050('0x20')]||_0x1783ad[_0x4050('0x22')][_0x4050('0x2a')])},_0xb6fe4)};return client[_0x4050('0x2d')](_0x4050('0x2e'),_0x1f3860);})[_0x4050('0xa')](function(_0x1fb041){if(_0x1fb041[_0x4050('0x2f')]){throw new Error(util[_0x4050('0x30')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x1fb041[_0x4050('0x2f')][_0x4050('0x31')]||JSON['stringify'](_0x1fb041['error'])));}return!![];});}function handleError(_0x5673b1,_0x5577da,_0x14acf3){return _0x5673b1['status'](_0x5577da||0x1f4)[_0x4050('0x32')]({'message':_0x14acf3?_0x14acf3[_0x4050('0x31')]||_0x14acf3:''});}exports[_0x4050('0x33')]=function(_0x45c739,_0x46b415,_0x24e37a){passport['authenticate'](_0x4050('0x34'),function(_0x2ac8fd,_0x182351,_0x26a480){var _0x43155a=_0x2ac8fd||_0x26a480;if(_0x43155a){return handleError(_0x46b415,0x191,_0x43155a);}if(!_0x182351){return handleError(_0x46b415,0x194,{'message':_0x4050('0x35')});}else{var _0x1ed4ed={'payload':{'id':_0x182351['id'],'role':_0x182351[_0x4050('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x4050('0x36')](_0x1ed4ed)[_0x4050('0xa')](function(_0x1e9a0c){_0x46b415[_0x4050('0x37')]({'id':_0x182351['id'],'token':_0x1e9a0c,'statusCall':'','isAlreadyLogged':_0x182351[_0x4050('0x38')]});});}})(_0x45c739,_0x46b415,_0x24e37a);};exports[_0x4050('0x39')]=function(_0x48b16,_0x2bfc6b,_0x929dea){if(!_0x48b16[_0x4050('0x3a')][_0x4050('0x20')]){return handleError(_0x2bfc6b,0x1f4,{'message':_0x4050('0x3b')});}var _0x12624f=rs[_0x4050('0x3c')]();_0x48b16['body'][_0x4050('0x20')]=_0x48b16[_0x4050('0x3a')][_0x4050('0x20')][_0x4050('0x3d')]()[_0x4050('0x3e')]();var _0x514fe8;return db[_0x4050('0x3f')][_0x4050('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x4050('0x17')],'raw':!![]})[_0x4050('0xa')](function(_0x41f3b4){_0x514fe8=_0x41f3b4;return db['User']['find']({'where':{'email':_0x48b16['body'][_0x4050('0x20')]}});})[_0x4050('0xa')](function(_0x1d256e){if(!_0x1d256e){throw new Error(_0x4050('0x40'));}if(_0x1d256e['disabled']){throw new Error(_0x4050('0x41'));}if(_0x1d256e[_0x4050('0x1d')]){if(moment(_0x1d256e[_0x4050('0x11')])[_0x4050('0x1a')](_0x514fe8[_0x4050('0x17')],_0x4050('0x18'))>moment()){throw new Error(_0x4050('0x42'));}else{_0x1d256e[_0x4050('0x1d')]=![];_0x1d256e[_0x4050('0x11')]=null;}}_0x1d256e[_0x4050('0x43')]=_0x12624f;_0x1d256e[_0x4050('0x44')]=Date[_0x4050('0x45')]()+0x36ee80;return _0x1d256e['save']();})['then'](function(){return sendServiceMail({'to':_0x48b16['body']['email'],'subject':_0x4050('0x46'),'text':_0x4050('0x47')+_0x4050('0x48')+_0x4050('0x49')+_0x48b16['headers'][_0x4050('0x25')]+_0x4050('0x4a')+_0x12624f+'\x0a\x0a'+_0x4050('0x4b')});})[_0x4050('0xa')](function(){_0x2bfc6b[_0x4050('0x4c')](0xc8)[_0x4050('0x32')]({'message':_0x4050('0x4d')});})['catch'](function(_0x3a7c0a){return handleError(_0x2bfc6b,0x1f4,_0x3a7c0a);});};exports['reset']=function(_0x2b4996,_0x58bf2e,_0x1b49a9){return db['User'][_0x4050('0x1f')]({'where':{'resetPasswordToken':_0x2b4996['params'][_0x4050('0x4e')],'resetPasswordExpires':{'$gt':Date[_0x4050('0x45')]()}}})[_0x4050('0xa')](function(_0x3fcfc3){if(!_0x3fcfc3){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x4050('0x3f')]['findOne']({'attributes':['id',_0x4050('0x4f'),'enforcePasswordHistory',_0x4050('0x50')]})[_0x4050('0xa')](function(_0x3e229f){if(_0x3e229f[_0x4050('0x4f')])authService[_0x4050('0x51')](_0x2b4996[_0x4050('0x3a')][_0x4050('0xd')]);if(!_0x3e229f[_0x4050('0x52')]||!_0x3fcfc3[_0x4050('0x53')])return _0x3fcfc3;authService['validatePasswordHistory'](_0x2b4996[_0x4050('0x3a')][_0x4050('0xd')],_0x3fcfc3[_0x4050('0x53')],_0x3e229f[_0x4050('0x50')]);return _0x3fcfc3;})[_0x4050('0xa')](function(){_0x3fcfc3['password']=_0x2b4996[_0x4050('0x3a')][_0x4050('0xd')];_0x3fcfc3[_0x4050('0x43')]=null;_0x3fcfc3[_0x4050('0x44')]=null;return _0x3fcfc3['save']();});})['then'](function(){_0x58bf2e[_0x4050('0x4c')](0xc8)[_0x4050('0x32')]({'message':_0x4050('0x54')});})['catch'](function(_0x5c7693){return handleError(_0x58bf2e,0x1f4,_0x5c7693);});};passport[_0x4050('0x55')](_0x4050('0x34'),new LocalStrategy({'usernameField':_0x4050('0xc'),'passwordField':_0x4050('0xd')},function(_0x25ab86,_0x33cdfa,_0x2bca79){return localAuthenticate(db[_0x4050('0x56')],_0x25ab86,_0x33cdfa,_0x2bca79);}));
\ No newline at end of file
+var _0x253f=['agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','catch','MailAccount','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','Email\x20parameter\x20is\x20missing','body','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordExpires','save','Password\x20reset!','use','util','passport','passport-local','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','client','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','disabled','blocked','blockedAt','loginAttempts','admin','user'];(function(_0x1d3758,_0x6d8928){var _0x161087=function(_0x46f67f){while(--_0x46f67f){_0x1d3758['push'](_0x1d3758['shift']());}};_0x161087(++_0x6d8928);}(_0x253f,0x1ee));var _0xf253=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x253f[_0x16d10f];return _0x50c823;};'use strict';var util=require(_0xf253('0x0'));var passport=require(_0xf253('0x1'));var LocalStrategy=require(_0xf253('0x2'))['Strategy'];var jayson=require(_0xf253('0x3'));var _=require(_0xf253('0x4'));var rs=require(_0xf253('0x5'));var moment=require('moment');var db=require(_0xf253('0x6'))['db'];var authService=require(_0xf253('0x7'));var utils=require('../../config/utils');var client=jayson[_0xf253('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x59e72c,_0x487cef,_0x161fab,_0x5200ce){var _0x4f6753,_0x3effc5;return db['Setting'][_0xf253('0x9')]({'where':{'id':0x1},'attributes':[_0xf253('0xa'),_0xf253('0xb')],'raw':!![]})[_0xf253('0xc')](function(_0x5dcef1){_0x4f6753=_0x5dcef1;return _0x59e72c[_0xf253('0x9')]({'attributes':['id',_0xf253('0xd'),_0xf253('0xe'),_0xf253('0xf'),'role',_0xf253('0x10'),_0xf253('0x11'),_0xf253('0x12'),_0xf253('0x13')],'where':{'name':_0x487cef,'role':{'$or':[_0xf253('0x14'),_0xf253('0x15'),_0xf253('0x16')]}}});})[_0xf253('0xc')](function(_0x191021){if(!_0x191021||_0x191021&&_0x191021[_0xf253('0xd')]!==_0x487cef){throw new Error(_0xf253('0x17'));}else{_0x3effc5=_0x191021;return _0x3effc5;}})['then'](function(){_0x3effc5[_0xf253('0x18')](_0x161fab,function(_0x3a06bc,_0x50421a){var _0x50522e=_0x3effc5['loginAttempts']+0x1;if(_0x3a06bc){return _0x5200ce(_0x3a06bc);}else if(!_0x50421a){if(_0x3effc5[_0xf253('0x10')]){return _0x5200ce(null,![],{'message':_0xf253('0x17')});}else if(_0x4f6753['allowedLoginAttempts']>0x0){if(_0x3effc5[_0xf253('0x11')]){if(_0x4f6753[_0xf253('0xb')]>0x0){if(moment(_0x3effc5['blockedAt'])[_0xf253('0x19')](_0x4f6753['blockDuration'],_0xf253('0x1a'))>moment()){return _0x5200ce(null,![],{'message':_0xf253('0x17')});}else{return utils[_0xf253('0x1b')](_0x3effc5,_0x50522e,![],null)[_0xf253('0xc')](function(){return _0x5200ce(null,![],{'message':_0xf253('0x17')});});}}else{return _0x5200ce(null,![],{'message':_0xf253('0x17')});}}else{if(_0x50522e>=_0x4f6753['allowedLoginAttempts']){return utils[_0xf253('0x1b')](_0x3effc5,0x0,!![],moment())[_0xf253('0xc')](function(){return _0x5200ce(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xf253('0x1b')](_0x3effc5,_0x50522e,![],null)[_0xf253('0xc')](function(){return _0x5200ce(null,![],{'message':_0xf253('0x17')});});}}}else{return _0x5200ce(null,![],{'message':_0xf253('0x17')});}}else{if(_0x3effc5[_0xf253('0x10')]){return _0x5200ce(null,![],{'message':_0xf253('0x17')});}else if(_0x4f6753[_0xf253('0xa')]>0x0){if(_0x3effc5[_0xf253('0x11')]){if(_0x4f6753[_0xf253('0xb')]>0x0){if(moment(_0x3effc5['blockedAt'])['add'](_0x4f6753['blockDuration'],_0xf253('0x1a'))>moment()){return _0x5200ce(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xf253('0x1b')](_0x3effc5,0x0,![],null)[_0xf253('0xc')](function(){return utils['getLicense'](_0x3effc5);})[_0xf253('0xc')](function(){return _0x5200ce(null,_0x3effc5);});}}else{return _0x5200ce(null,![],{'message':_0xf253('0x17')});}}else{return utils[_0xf253('0x1b')](_0x3effc5,0x0,![],null)[_0xf253('0xc')](function(){return utils['getLicense'](_0x3effc5);})['then'](function(){return _0x5200ce(null,_0x3effc5);})[_0xf253('0x1c')](function(_0x33f905){return _0x5200ce(null,![],_0x33f905);});}}else{if(_0x3effc5[_0xf253('0x11')]){return _0x5200ce(null,![],{'message':_0xf253('0x17')});}else{return utils['getLicense'](_0x3effc5)[_0xf253('0xc')](function(){return _0x5200ce(null,_0x3effc5);});}}}});})[_0xf253('0x1c')](function(_0x23f684){return _0x5200ce(null,![],_0x23f684);});}function sendServiceMail(_0x56074a){return db[_0xf253('0x1d')][_0xf253('0x1e')]({'where':{'service':!![]},'attributes':['id',_0xf253('0xd'),_0xf253('0x1f')],'include':[{'model':db['MailServerOut'],'as':_0xf253('0x20')}]})['then'](function(_0x2db280){if(!_0x2db280){throw new Error(_0xf253('0x21'));}var _0x3f1adc={'tls':{'rejectUnauthorized':![]}};if(_0x2db280[_0xf253('0x20')][_0xf253('0x22')]){_0x3f1adc[_0xf253('0x22')]=_0x2db280[_0xf253('0x20')]['service'];}else{_0x3f1adc['host']=_0x2db280['Smtp'][_0xf253('0x23')];_0x3f1adc[_0xf253('0x24')]=_0x2db280[_0xf253('0x20')][_0xf253('0x24')];_0x3f1adc[_0xf253('0x25')]=_0x2db280['Smtp']['secure'];}if(_0x2db280[_0xf253('0x20')][_0xf253('0x26')]){_0x3f1adc['auth']={'user':_0x2db280[_0xf253('0x20')][_0xf253('0x15')],'pass':_0x2db280['Smtp']['pass']};}var _0x1b0642={'account':_0x3f1adc,'message':_[_0xf253('0x27')]({'from':util[_0xf253('0x28')](_0xf253('0x29'),_0x2db280[_0xf253('0xd')],_0x2db280[_0xf253('0x1f')]||_0x2db280[_0xf253('0x20')][_0xf253('0x15')])},_0x56074a)};return client[_0xf253('0x2a')](_0xf253('0x2b'),_0x1b0642);})['then'](function(_0x4489c8){if(_0x4489c8[_0xf253('0x2c')]){throw new Error(util['format'](_0xf253('0x2d'),_0x4489c8[_0xf253('0x2c')][_0xf253('0x2e')]||JSON[_0xf253('0x2f')](_0x4489c8['error'])));}return!![];});}function handleError(_0x4b875d,_0x3873c8,_0x9f41da){return _0x4b875d['status'](_0x3873c8||0x1f4)[_0xf253('0x30')]({'message':_0x9f41da?_0x9f41da[_0xf253('0x2e')]||_0x9f41da:''});}exports[_0xf253('0x31')]=function(_0x443052,_0x2b66be,_0x128883){passport[_0xf253('0x18')](_0xf253('0x32'),function(_0x869bef,_0x24dd54,_0xe878c0){var _0x2cc65d=_0x869bef||_0xe878c0;if(_0x2cc65d){return handleError(_0x2b66be,0x191,_0x2cc65d);}if(!_0x24dd54){return handleError(_0x2b66be,0x194,{'message':_0xf253('0x33')});}else{var _0x58f4da={'payload':{'id':_0x24dd54['id'],'role':_0x24dd54['role']},'options':{'expiresIn':0x15180}};return authService[_0xf253('0x34')](_0x58f4da)[_0xf253('0xc')](function(_0x43e378){_0x2b66be[_0xf253('0x35')]({'id':_0x24dd54['id'],'token':_0x43e378,'statusCall':'','isAlreadyLogged':_0x24dd54[_0xf253('0x36')]});});}})(_0x443052,_0x2b66be,_0x128883);};exports['forgot']=function(_0x1249de,_0x10b68d,_0x25a27f){if(!_0x1249de['body'][_0xf253('0x1f')]){return handleError(_0x10b68d,0x1f4,{'message':_0xf253('0x37')});}var _0xa81d69=rs['generate']();_0x1249de[_0xf253('0x38')][_0xf253('0x1f')]=_0x1249de[_0xf253('0x38')][_0xf253('0x1f')][_0xf253('0x39')]()[_0xf253('0x3a')]();var _0xd7169d;return db[_0xf253('0x3b')][_0xf253('0x9')]({'where':{'id':0x1},'attributes':[_0xf253('0xa'),_0xf253('0xb')],'raw':!![]})[_0xf253('0xc')](function(_0x2e06b4){_0xd7169d=_0x2e06b4;return db[_0xf253('0x3c')][_0xf253('0x1e')]({'where':{'email':_0x1249de[_0xf253('0x38')][_0xf253('0x1f')]}});})[_0xf253('0xc')](function(_0x1e9ce3){if(!_0x1e9ce3){throw new Error(_0xf253('0x3d'));}if(_0x1e9ce3[_0xf253('0x10')]){throw new Error(_0xf253('0x3e'));}if(_0x1e9ce3['blocked']){if(moment(_0x1e9ce3[_0xf253('0x12')])[_0xf253('0x19')](_0xd7169d[_0xf253('0xb')],_0xf253('0x1a'))>moment()){throw new Error(_0xf253('0x3f'));}else{_0x1e9ce3[_0xf253('0x11')]=![];_0x1e9ce3[_0xf253('0x12')]=null;}}_0x1e9ce3[_0xf253('0x40')]=_0xa81d69;_0x1e9ce3['resetPasswordExpires']=Date[_0xf253('0x41')]()+0x36ee80;return _0x1e9ce3['save']();})[_0xf253('0xc')](function(){return sendServiceMail({'to':_0x1249de[_0xf253('0x38')]['email'],'subject':_0xf253('0x42'),'text':_0xf253('0x43')+_0xf253('0x44')+'https://'+_0x1249de[_0xf253('0x45')][_0xf253('0x23')]+_0xf253('0x46')+_0xa81d69+'\x0a\x0a'+_0xf253('0x47')});})[_0xf253('0xc')](function(){_0x10b68d[_0xf253('0x48')](0xc8)[_0xf253('0x30')]({'message':_0xf253('0x49')});})[_0xf253('0x1c')](function(_0x28f431){return handleError(_0x10b68d,0x1f4,_0x28f431);});};exports['reset']=function(_0x3086fd,_0x5d9c92,_0x218c63){return db['User'][_0xf253('0x1e')]({'where':{'resetPasswordToken':_0x3086fd[_0xf253('0x4a')][_0xf253('0x4b')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xf253('0xc')](function(_0x11c0bf){if(!_0x11c0bf){throw new Error(_0xf253('0x4c'));}return db[_0xf253('0x3b')][_0xf253('0x9')]({'attributes':['id',_0xf253('0x4d'),_0xf253('0x4e'),'passwordHistoryLimit']})[_0xf253('0xc')](function(_0x4ef208){if(_0x4ef208[_0xf253('0x4d')])authService['validatePasswordPattern'](_0x3086fd['body']['password']);if(!_0x4ef208['enforcePasswordHistory']||!_0x11c0bf[_0xf253('0x4f')])return _0x11c0bf;authService[_0xf253('0x50')](_0x3086fd[_0xf253('0x38')]['password'],_0x11c0bf['previousPasswords'],_0x4ef208[_0xf253('0x51')]);return _0x11c0bf;})['then'](function(){_0x11c0bf['password']=_0x3086fd[_0xf253('0x38')]['password'];_0x11c0bf[_0xf253('0x40')]=null;_0x11c0bf[_0xf253('0x52')]=null;return _0x11c0bf[_0xf253('0x53')]();});})[_0xf253('0xc')](function(){_0x5d9c92['status'](0xc8)[_0xf253('0x30')]({'message':_0xf253('0x54')});})[_0xf253('0x1c')](function(_0x1bf3b1){return handleError(_0x5d9c92,0x1f4,_0x1bf3b1);});};passport[_0xf253('0x55')](_0xf253('0x32'),new LocalStrategy({'usernameField':_0xf253('0xd'),'passwordField':_0xf253('0xe')},function(_0xbaa29e,_0x3fec08,_0x59cc38){return localAuthenticate(db[_0xf253('0x3c')],_0xbaa29e,_0x3fec08,_0x59cc38);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index ca963a0..14c4a10 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 _0x1f01=['./authLocal.controller','post','login','/forgot','reset','exports','Router'];(function(_0xaaea0a,_0x45bc95){var _0x5c3546=function(_0x580f5c){while(--_0x580f5c){_0xaaea0a['push'](_0xaaea0a['shift']());}};_0x5c3546(++_0x45bc95);}(_0x1f01,0xa0));var _0x11f0=function(_0x5ab238,_0x4ddda9){_0x5ab238=_0x5ab238-0x0;var _0x236db6=_0x1f01[_0x5ab238];return _0x236db6;};'use strict';var express=require('express');var router=express[_0x11f0('0x0')]();var controller=require(_0x11f0('0x1'));router[_0x11f0('0x2')]('/',controller[_0x11f0('0x3')]);router[_0x11f0('0x2')](_0x11f0('0x4'),controller['forgot']);router[_0x11f0('0x2')]('/reset/:token',controller[_0x11f0('0x5')]);module[_0x11f0('0x6')]=router;
\ No newline at end of file
+var _0x24a4=['exports','express','Router','./authLocal.controller','post','login','/forgot','/reset/:token','reset'];(function(_0xa547ca,_0x514951){var _0xd5e1c1=function(_0x400751){while(--_0x400751){_0xa547ca['push'](_0xa547ca['shift']());}};_0xd5e1c1(++_0x514951);}(_0x24a4,0x157));var _0x424a=function(_0x2d63e7,_0x3dda73){_0x2d63e7=_0x2d63e7-0x0;var _0x5e8406=_0x24a4[_0x2d63e7];return _0x5e8406;};'use strict';var express=require(_0x424a('0x0'));var router=express[_0x424a('0x1')]();var controller=require(_0x424a('0x2'));router[_0x424a('0x3')]('/',controller[_0x424a('0x4')]);router[_0x424a('0x3')](_0x424a('0x5'),controller['forgot']);router['post'](_0x424a('0x6'),controller[_0x424a('0x7')]);module[_0x424a('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index ff523d6..2d96316 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 _0x2b83=['sequelize','STRING','BOOLEAN','INTEGER'];(function(_0x183c00,_0x5327b8){var _0x4a8361=function(_0x126739){while(--_0x126739){_0x183c00['push'](_0x183c00['shift']());}};_0x4a8361(++_0x5327b8);}(_0x2b83,0xe0));var _0x32b8=function(_0x1602de,_0x294c96){_0x1602de=_0x1602de-0x0;var _0x6e66c8=_0x2b83[_0x1602de];return _0x6e66c8;};'use strict';var Sequelize=require(_0x32b8('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x32b8('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x32b8('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x32b8('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x93c0=['STRING','sequelize','exports'];(function(_0x5ac92d,_0x14061b){var _0x1abd6e=function(_0x241e4e){while(--_0x241e4e){_0x5ac92d['push'](_0x5ac92d['shift']());}};_0x1abd6e(++_0x14061b);}(_0x93c0,0xe5));var _0x093c=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x93c0[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x093c('0x0'));module[_0x093c('0x1')]={'name':{'type':Sequelize[_0x093c('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x093c('0x2')]},'description':{'type':Sequelize[_0x093c('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'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 1e10dbd..faa3ee0 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 _0xb63a=['../../config/environment','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','end','stack','name','send','index','map','Automation','fieldName','type','key','model','query','filters','intersection','attributes','fields','order','sort','pick','merge','VIRTUAL','filter','options','where','includeAll','findAll','catch','show','params','rawAttributes','keys','length','include','find','create','body','addConditions','Condition','ids','omit','findOne','getConditions','hasOwnProperty','nolimit','addActions','getActions','Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils'];(function(_0x114f39,_0x329501){var _0x2df275=function(_0x502383){while(--_0x502383){_0x114f39['push'](_0x114f39['shift']());}};_0x2df275(++_0x329501);}(_0xb63a,0x139));var _0xab63=function(_0x193ddf,_0x6f30bb){_0x193ddf=_0x193ddf-0x0;var _0x5bc6df=_0xb63a[_0x193ddf];return _0x5bc6df;};'use strict';var emlformat=require(_0xab63('0x0'));var rimraf=require(_0xab63('0x1'));var zipdir=require(_0xab63('0x2'));var jsonpatch=require(_0xab63('0x3'));var rp=require(_0xab63('0x4'));var moment=require('moment');var BPromise=require(_0xab63('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xab63('0x6'));var sox=require(_0xab63('0x7'));var csv=require(_0xab63('0x8'));var ejs=require(_0xab63('0x9'));var fs=require('fs');var fs_extra=require(_0xab63('0xa'));var _=require(_0xab63('0xb'));var squel=require(_0xab63('0xc'));var crypto=require(_0xab63('0xd'));var jsforce=require(_0xab63('0xe'));var deskjs=require(_0xab63('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xab63('0x10'));var authService=require(_0xab63('0x11'));var qs=require(_0xab63('0x12'));var as=require(_0xab63('0x13'));var hardwareService=require(_0xab63('0x14'));var logger=require('../../config/logger')(_0xab63('0x15'));var utils=require(_0xab63('0x16'));var config=require(_0xab63('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x625e34,_0x34881c){_0x34881c=_0x34881c||0xcc;return function(_0x467e7b){if(_0x467e7b){return _0x625e34[_0xab63('0x18')](_0x34881c);}return _0x625e34[_0xab63('0x19')](_0x34881c)['end']();};}function respondWithResult(_0x2422e6,_0x146339){_0x146339=_0x146339||0xc8;return function(_0x384064){if(_0x384064){return _0x2422e6[_0xab63('0x19')](_0x146339)[_0xab63('0x1a')](_0x384064);}};}function respondWithFilteredResult(_0x48247f,_0x5a9fdc){return function(_0x18766d){if(_0x18766d){var _0x6453ed=typeof _0x5a9fdc[_0xab63('0x1b')]==='undefined'&&typeof _0x5a9fdc[_0xab63('0x1c')]===_0xab63('0x1d');var _0x39af0f=_0x18766d[_0xab63('0x1e')];var _0x2b2cde=_0x6453ed?0x0:_0x5a9fdc['offset'];var _0x13ed72=_0x6453ed?_0x18766d[_0xab63('0x1e')]:_0x5a9fdc['offset']+_0x5a9fdc[_0xab63('0x1c')];var _0x3d7120;if(_0x13ed72>=_0x39af0f){_0x13ed72=_0x39af0f;_0x3d7120=0xc8;}else{_0x3d7120=0xce;}_0x48247f['status'](_0x3d7120);return _0x48247f[_0xab63('0x1f')]('Content-Range',_0x2b2cde+'-'+_0x13ed72+'/'+_0x39af0f)[_0xab63('0x1a')](_0x18766d);}return null;};}function patchUpdates(_0x20e260){return function(_0x17ed42){try{jsonpatch[_0xab63('0x20')](_0x17ed42,_0x20e260,!![]);}catch(_0x38a588){return BPromise[_0xab63('0x21')](_0x38a588);}return _0x17ed42['save']();};}function saveUpdates(_0x4b85a2,_0x5c0edf){return function(_0x1de266){if(_0x1de266){return _0x1de266[_0xab63('0x22')](_0x4b85a2)[_0xab63('0x23')](function(_0x3d4d25){return _0x3d4d25;});}return null;};}function removeEntity(_0x56a1f2,_0x178579){return function(_0x32de43){if(_0x32de43){return _0x32de43[_0xab63('0x24')]()['then'](function(){_0x56a1f2['status'](0xcc)[_0xab63('0x25')]();});}};}function handleEntityNotFound(_0x3c690c,_0x5dda7a){return function(_0x23c819){if(!_0x23c819){_0x3c690c[_0xab63('0x18')](0x194);}return _0x23c819;};}function handleError(_0x42243d,_0x1287c0){_0x1287c0=_0x1287c0||0x1f4;return function(_0x427e26){logger['error'](_0x427e26[_0xab63('0x26')]);if(_0x427e26[_0xab63('0x27')]){delete _0x427e26[_0xab63('0x27')];}_0x42243d['status'](_0x1287c0)[_0xab63('0x28')](_0x427e26);};}exports[_0xab63('0x29')]=function(_0x228c63,_0x2dca30){var _0x10f607={},_0x42238d={},_0x5043ec={'count':0x0,'rows':[]};var _0x1f01be=_[_0xab63('0x2a')](db[_0xab63('0x2b')]['rawAttributes'],function(_0x42b897){return{'name':_0x42b897[_0xab63('0x2c')],'type':_0x42b897[_0xab63('0x2d')][_0xab63('0x2e')]};});_0x42238d[_0xab63('0x2f')]=_['map'](_0x1f01be,'name');_0x42238d[_0xab63('0x30')]=_['keys'](_0x228c63[_0xab63('0x30')]);_0x42238d[_0xab63('0x31')]=_[_0xab63('0x32')](_0x42238d['model'],_0x42238d[_0xab63('0x30')]);_0x10f607[_0xab63('0x33')]=_[_0xab63('0x32')](_0x42238d[_0xab63('0x2f')],qs[_0xab63('0x34')](_0x228c63[_0xab63('0x30')]['fields']));_0x10f607[_0xab63('0x33')]=_0x10f607[_0xab63('0x33')]['length']?_0x10f607[_0xab63('0x33')]:_0x42238d[_0xab63('0x2f')];if(!_0x228c63['query']['hasOwnProperty']('nolimit')){_0x10f607[_0xab63('0x1c')]=qs['limit'](_0x228c63[_0xab63('0x30')]['limit']);_0x10f607[_0xab63('0x1b')]=qs[_0xab63('0x1b')](_0x228c63[_0xab63('0x30')]['offset']);}_0x10f607[_0xab63('0x35')]=qs[_0xab63('0x36')](_0x228c63[_0xab63('0x30')][_0xab63('0x36')]);_0x10f607['where']=qs['filters'](_[_0xab63('0x37')](_0x228c63['query'],_0x42238d['filters']),_0x1f01be);if(_0x228c63[_0xab63('0x30')]['filter']){_0x10f607['where']=_[_0xab63('0x38')](_0x10f607['where'],{'$or':_[_0xab63('0x2a')](_0x1f01be,function(_0x2df0a5){if(_0x2df0a5[_0xab63('0x2d')]!==_0xab63('0x39')){var _0x1f2f17={};_0x1f2f17[_0x2df0a5[_0xab63('0x27')]]={'$like':'%'+_0x228c63['query'][_0xab63('0x3a')]+'%'};return _0x1f2f17;}})});}_0x10f607=_[_0xab63('0x38')]({},_0x10f607,_0x228c63[_0xab63('0x3b')]);var _0x4eedca={'where':_0x10f607[_0xab63('0x3c')]};return db['Automation']['count'](_0x4eedca)['then'](function(_0x379845){_0x5043ec[_0xab63('0x1e')]=_0x379845;if(_0x228c63[_0xab63('0x30')][_0xab63('0x3d')]){_0x10f607['include']=[{'all':!![]}];}return db['Automation'][_0xab63('0x3e')](_0x10f607);})[_0xab63('0x23')](function(_0x47385c){_0x5043ec['rows']=_0x47385c;return _0x5043ec;})[_0xab63('0x23')](respondWithFilteredResult(_0x2dca30,_0x10f607))[_0xab63('0x3f')](handleError(_0x2dca30,null));};exports[_0xab63('0x40')]=function(_0x4eb694,_0x1e498f){var _0x5bda10={'raw':![],'where':{'id':_0x4eb694[_0xab63('0x41')]['id']}},_0x4c9c9b={};_0x4c9c9b[_0xab63('0x2f')]=_['keys'](db[_0xab63('0x2b')][_0xab63('0x42')]);_0x4c9c9b[_0xab63('0x30')]=_[_0xab63('0x43')](_0x4eb694[_0xab63('0x30')]);_0x4c9c9b['filters']=_[_0xab63('0x32')](_0x4c9c9b['model'],_0x4c9c9b[_0xab63('0x30')]);_0x5bda10[_0xab63('0x33')]=_[_0xab63('0x32')](_0x4c9c9b[_0xab63('0x2f')],qs[_0xab63('0x34')](_0x4eb694[_0xab63('0x30')][_0xab63('0x34')]));_0x5bda10[_0xab63('0x33')]=_0x5bda10[_0xab63('0x33')][_0xab63('0x44')]?_0x5bda10['attributes']:_0x4c9c9b[_0xab63('0x2f')];if(_0x4eb694[_0xab63('0x30')]['includeAll']){_0x5bda10[_0xab63('0x45')]=[{'all':!![]}];}_0x5bda10=_[_0xab63('0x38')]({},_0x5bda10,_0x4eb694['options']);return db[_0xab63('0x2b')][_0xab63('0x46')](_0x5bda10)['then'](handleEntityNotFound(_0x1e498f,null))[_0xab63('0x23')](respondWithResult(_0x1e498f,null))[_0xab63('0x3f')](handleError(_0x1e498f,null));};exports[_0xab63('0x47')]=function(_0x547812,_0x2aa996){return db[_0xab63('0x2b')][_0xab63('0x47')](_0x547812[_0xab63('0x48')],{})[_0xab63('0x23')](respondWithResult(_0x2aa996,0xc9))[_0xab63('0x3f')](handleError(_0x2aa996,null));};exports[_0xab63('0x22')]=function(_0x1dee17,_0x1a1e6b){if(_0x1dee17['body']['id']){delete _0x1dee17['body']['id'];}return db[_0xab63('0x2b')][_0xab63('0x46')]({'where':{'id':_0x1dee17[_0xab63('0x41')]['id']}})[_0xab63('0x23')](handleEntityNotFound(_0x1a1e6b,null))[_0xab63('0x23')](saveUpdates(_0x1dee17[_0xab63('0x48')],null))[_0xab63('0x23')](respondWithResult(_0x1a1e6b,null))['catch'](handleError(_0x1a1e6b,null));};exports['destroy']=function(_0x2a8744,_0x49ce2a){return db['Automation'][_0xab63('0x46')]({'where':{'id':_0x2a8744[_0xab63('0x41')]['id']}})[_0xab63('0x23')](handleEntityNotFound(_0x49ce2a,null))[_0xab63('0x23')](removeEntity(_0x49ce2a,null))[_0xab63('0x3f')](handleError(_0x49ce2a,null));};exports[_0xab63('0x49')]=function(_0x3df9b6,_0x281912,_0x385eba){return db[_0xab63('0x4a')][_0xab63('0x46')]({'where':{'id':_0x3df9b6[_0xab63('0x41')]['id']}})[_0xab63('0x23')](handleEntityNotFound(_0x281912,null))['then'](function(_0x2ff7e3){if(_0x2ff7e3){return _0x2ff7e3[_0xab63('0x49')](_0x3df9b6['body'][_0xab63('0x4b')],_[_0xab63('0x4c')](_0x3df9b6[_0xab63('0x48')],['ids','id'])||{});}})['then'](respondWithResult(_0x281912,null))[_0xab63('0x3f')](handleError(_0x281912,null));};exports['getConditions']=function(_0x4b540c,_0x4b42b6,_0x2a7171){var _0x296525={};var _0x280a2a={};var _0x430db8;var _0x1a2b7a;return db['Automation'][_0xab63('0x4d')]({'where':{'id':_0x4b540c[_0xab63('0x41')]['id']}})[_0xab63('0x23')](handleEntityNotFound(_0x4b42b6,null))[_0xab63('0x23')](function(_0x4187b3){if(_0x4187b3){_0x430db8=_0x4187b3;_0x280a2a[_0xab63('0x2f')]=_[_0xab63('0x43')](db[_0xab63('0x4a')][_0xab63('0x42')]);_0x280a2a[_0xab63('0x30')]=_[_0xab63('0x43')](_0x4b540c[_0xab63('0x30')]);_0x280a2a['filters']=_[_0xab63('0x32')](_0x280a2a[_0xab63('0x2f')],_0x280a2a[_0xab63('0x30')]);_0x296525[_0xab63('0x33')]=_[_0xab63('0x32')](_0x280a2a[_0xab63('0x2f')],qs[_0xab63('0x34')](_0x4b540c[_0xab63('0x30')][_0xab63('0x34')]));_0x296525[_0xab63('0x33')]=_0x296525[_0xab63('0x33')][_0xab63('0x44')]?_0x296525[_0xab63('0x33')]:_0x280a2a[_0xab63('0x2f')];_0x296525[_0xab63('0x35')]=qs[_0xab63('0x36')](_0x4b540c[_0xab63('0x30')]['sort']);_0x296525[_0xab63('0x3c')]=qs['filters'](_[_0xab63('0x37')](_0x4b540c[_0xab63('0x30')],_0x280a2a[_0xab63('0x31')]));if(_0x4b540c[_0xab63('0x30')][_0xab63('0x3a')]){_0x296525['where']=_['merge'](_0x296525[_0xab63('0x3c')],{'$or':_[_0xab63('0x2a')](_0x296525[_0xab63('0x33')],function(_0x8d5be6){var _0x9085cc={};_0x9085cc[_0x8d5be6]={'$like':'%'+_0x4b540c[_0xab63('0x30')][_0xab63('0x3a')]+'%'};return _0x9085cc;})});}_0x296525=_[_0xab63('0x38')]({},_0x296525,_0x4b540c[_0xab63('0x3b')]);return _0x430db8[_0xab63('0x4e')](_0x296525);}})[_0xab63('0x23')](function(_0x402d2a){if(_0x402d2a){_0x1a2b7a=_0x402d2a[_0xab63('0x44')];if(!_0x4b540c[_0xab63('0x30')][_0xab63('0x4f')](_0xab63('0x50'))){_0x296525[_0xab63('0x1c')]=qs[_0xab63('0x1c')](_0x4b540c[_0xab63('0x30')]['limit']);_0x296525[_0xab63('0x1b')]=qs[_0xab63('0x1b')](_0x4b540c[_0xab63('0x30')]['offset']);}return _0x430db8[_0xab63('0x4e')](_0x296525);}})[_0xab63('0x23')](function(_0x4db8ec){if(_0x4db8ec){return _0x4db8ec?{'count':_0x1a2b7a,'rows':_0x4db8ec}:null;}})[_0xab63('0x23')](respondWithResult(_0x4b42b6,null))[_0xab63('0x3f')](handleError(_0x4b42b6,null));};exports[_0xab63('0x51')]=function(_0x3df5b7,_0x4bf4fc,_0x48f3c7){return db['Action']['find']({'where':{'id':_0x3df5b7[_0xab63('0x41')]['id']}})[_0xab63('0x23')](handleEntityNotFound(_0x4bf4fc,null))[_0xab63('0x23')](function(_0x3a5858){if(_0x3a5858){return _0x3a5858[_0xab63('0x51')](_0x3df5b7[_0xab63('0x48')][_0xab63('0x4b')],_['omit'](_0x3df5b7[_0xab63('0x48')],[_0xab63('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x4bf4fc,null))[_0xab63('0x3f')](handleError(_0x4bf4fc,null));};exports[_0xab63('0x52')]=function(_0x3143b2,_0x479493,_0x5ad6d4){var _0x122f04={};var _0x5c3c6e={};var _0x41278a;var _0x2a856e;return db[_0xab63('0x2b')][_0xab63('0x4d')]({'where':{'id':_0x3143b2['params']['id']}})[_0xab63('0x23')](handleEntityNotFound(_0x479493,null))[_0xab63('0x23')](function(_0x1966a9){if(_0x1966a9){_0x41278a=_0x1966a9;_0x5c3c6e['model']=_[_0xab63('0x43')](db[_0xab63('0x53')][_0xab63('0x42')]);_0x5c3c6e[_0xab63('0x30')]=_[_0xab63('0x43')](_0x3143b2[_0xab63('0x30')]);_0x5c3c6e[_0xab63('0x31')]=_['intersection'](_0x5c3c6e[_0xab63('0x2f')],_0x5c3c6e[_0xab63('0x30')]);_0x122f04['attributes']=_[_0xab63('0x32')](_0x5c3c6e['model'],qs[_0xab63('0x34')](_0x3143b2[_0xab63('0x30')][_0xab63('0x34')]));_0x122f04[_0xab63('0x33')]=_0x122f04['attributes']['length']?_0x122f04[_0xab63('0x33')]:_0x5c3c6e[_0xab63('0x2f')];_0x122f04[_0xab63('0x35')]=qs['sort'](_0x3143b2['query'][_0xab63('0x36')]);_0x122f04[_0xab63('0x3c')]=qs[_0xab63('0x31')](_[_0xab63('0x37')](_0x3143b2[_0xab63('0x30')],_0x5c3c6e['filters']));if(_0x3143b2[_0xab63('0x30')]['filter']){_0x122f04['where']=_[_0xab63('0x38')](_0x122f04[_0xab63('0x3c')],{'$or':_[_0xab63('0x2a')](_0x122f04['attributes'],function(_0x51a496){var _0x5f0335={};_0x5f0335[_0x51a496]={'$like':'%'+_0x3143b2['query'][_0xab63('0x3a')]+'%'};return _0x5f0335;})});}_0x122f04=_[_0xab63('0x38')]({},_0x122f04,_0x3143b2[_0xab63('0x3b')]);return _0x41278a[_0xab63('0x52')](_0x122f04);}})['then'](function(_0x5ae21f){if(_0x5ae21f){_0x2a856e=_0x5ae21f[_0xab63('0x44')];if(!_0x3143b2[_0xab63('0x30')][_0xab63('0x4f')](_0xab63('0x50'))){_0x122f04[_0xab63('0x1c')]=qs[_0xab63('0x1c')](_0x3143b2[_0xab63('0x30')]['limit']);_0x122f04['offset']=qs['offset'](_0x3143b2['query'][_0xab63('0x1b')]);}return _0x41278a[_0xab63('0x52')](_0x122f04);}})['then'](function(_0x54731c){if(_0x54731c){return _0x54731c?{'count':_0x2a856e,'rows':_0x54731c}:null;}})['then'](respondWithResult(_0x479493,null))[_0xab63('0x3f')](handleError(_0x479493,null));};
\ No newline at end of file
+var _0xed2f=['mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','end','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','catch','show','params','length','create','body','find','addConditions','Condition','ids','omit','getConditions','findOne','hasOwnProperty','addActions','Action','getActions','zip-dir','request-promise','moment','bluebird'];(function(_0x43ebd4,_0x3b3630){var _0x218876=function(_0xcd1b78){while(--_0xcd1b78){_0x43ebd4['push'](_0x43ebd4['shift']());}};_0x218876(++_0x3b3630);}(_0xed2f,0x144));var _0xfed2=function(_0x2d0eb9,_0x3c2bd7){_0x2d0eb9=_0x2d0eb9-0x0;var _0x3b362f=_0xed2f[_0x2d0eb9];return _0x3b362f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfed2('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfed2('0x1'));var moment=require(_0xfed2('0x2'));var BPromise=require(_0xfed2('0x3'));var Mustache=require(_0xfed2('0x4'));var util=require(_0xfed2('0x5'));var path=require('path');var sox=require(_0xfed2('0x6'));var csv=require(_0xfed2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfed2('0x8'));var _=require('lodash');var squel=require(_0xfed2('0x9'));var crypto=require(_0xfed2('0xa'));var jsforce=require(_0xfed2('0xb'));var deskjs=require(_0xfed2('0xc'));var toCsv=require(_0xfed2('0x7'));var querystring=require(_0xfed2('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfed2('0xe'));var qs=require(_0xfed2('0xf'));var as=require(_0xfed2('0x10'));var hardwareService=require(_0xfed2('0x11'));var logger=require(_0xfed2('0x12'))(_0xfed2('0x13'));var utils=require(_0xfed2('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfed2('0x15'))['db'];function respondWithStatusCode(_0x1f1fe2,_0x152e6e){_0x152e6e=_0x152e6e||0xcc;return function(_0x273da0){if(_0x273da0){return _0x1f1fe2[_0xfed2('0x16')](_0x152e6e);}return _0x1f1fe2[_0xfed2('0x17')](_0x152e6e)['end']();};}function respondWithResult(_0x214836,_0x5a1d08){_0x5a1d08=_0x5a1d08||0xc8;return function(_0x4fd9b3){if(_0x4fd9b3){return _0x214836[_0xfed2('0x17')](_0x5a1d08)[_0xfed2('0x18')](_0x4fd9b3);}};}function respondWithFilteredResult(_0x45ab4a,_0x2a849d){return function(_0x4bfa61){if(_0x4bfa61){var _0x5cfbcc=typeof _0x2a849d[_0xfed2('0x19')]===_0xfed2('0x1a')&&typeof _0x2a849d['limit']==='undefined';var _0x2e3df5=_0x4bfa61['count'];var _0x26c0b8=_0x5cfbcc?0x0:_0x2a849d[_0xfed2('0x19')];var _0x175475=_0x5cfbcc?_0x4bfa61['count']:_0x2a849d[_0xfed2('0x19')]+_0x2a849d[_0xfed2('0x1b')];var _0x2ce5d4;if(_0x175475>=_0x2e3df5){_0x175475=_0x2e3df5;_0x2ce5d4=0xc8;}else{_0x2ce5d4=0xce;}_0x45ab4a[_0xfed2('0x17')](_0x2ce5d4);return _0x45ab4a[_0xfed2('0x1c')](_0xfed2('0x1d'),_0x26c0b8+'-'+_0x175475+'/'+_0x2e3df5)['json'](_0x4bfa61);}return null;};}function patchUpdates(_0x10c298){return function(_0x43fb9f){try{jsonpatch['apply'](_0x43fb9f,_0x10c298,!![]);}catch(_0x3599ec){return BPromise[_0xfed2('0x1e')](_0x3599ec);}return _0x43fb9f[_0xfed2('0x1f')]();};}function saveUpdates(_0x5dbcf8,_0x2572b5){return function(_0x5c6fae){if(_0x5c6fae){return _0x5c6fae[_0xfed2('0x20')](_0x5dbcf8)[_0xfed2('0x21')](function(_0x3a7ee7){return _0x3a7ee7;});}return null;};}function removeEntity(_0x4a13ce,_0x5ccb72){return function(_0x326a9c){if(_0x326a9c){return _0x326a9c['destroy']()[_0xfed2('0x21')](function(){_0x4a13ce[_0xfed2('0x17')](0xcc)[_0xfed2('0x22')]();});}};}function handleEntityNotFound(_0x46cd71,_0x4050cc){return function(_0x375600){if(!_0x375600){_0x46cd71['sendStatus'](0x194);}return _0x375600;};}function handleError(_0x4b08d0,_0x4aa93a){_0x4aa93a=_0x4aa93a||0x1f4;return function(_0x3b2085){logger[_0xfed2('0x23')](_0x3b2085[_0xfed2('0x24')]);if(_0x3b2085['name']){delete _0x3b2085[_0xfed2('0x25')];}_0x4b08d0[_0xfed2('0x17')](_0x4aa93a)[_0xfed2('0x26')](_0x3b2085);};}exports[_0xfed2('0x27')]=function(_0x1958e2,_0x34c990){var _0x1a85bf={},_0x202c7d={},_0x4e1745={'count':0x0,'rows':[]};var _0x5c0d9a=_[_0xfed2('0x28')](db[_0xfed2('0x29')][_0xfed2('0x2a')],function(_0x23150b){return{'name':_0x23150b[_0xfed2('0x2b')],'type':_0x23150b[_0xfed2('0x2c')][_0xfed2('0x2d')]};});_0x202c7d['model']=_[_0xfed2('0x28')](_0x5c0d9a,'name');_0x202c7d[_0xfed2('0x2e')]=_[_0xfed2('0x2f')](_0x1958e2[_0xfed2('0x2e')]);_0x202c7d['filters']=_[_0xfed2('0x30')](_0x202c7d[_0xfed2('0x31')],_0x202c7d[_0xfed2('0x2e')]);_0x1a85bf[_0xfed2('0x32')]=_[_0xfed2('0x30')](_0x202c7d['model'],qs[_0xfed2('0x33')](_0x1958e2[_0xfed2('0x2e')]['fields']));_0x1a85bf['attributes']=_0x1a85bf[_0xfed2('0x32')]['length']?_0x1a85bf[_0xfed2('0x32')]:_0x202c7d[_0xfed2('0x31')];if(!_0x1958e2[_0xfed2('0x2e')]['hasOwnProperty'](_0xfed2('0x34'))){_0x1a85bf[_0xfed2('0x1b')]=qs[_0xfed2('0x1b')](_0x1958e2[_0xfed2('0x2e')][_0xfed2('0x1b')]);_0x1a85bf[_0xfed2('0x19')]=qs[_0xfed2('0x19')](_0x1958e2[_0xfed2('0x2e')][_0xfed2('0x19')]);}_0x1a85bf[_0xfed2('0x35')]=qs[_0xfed2('0x36')](_0x1958e2[_0xfed2('0x2e')][_0xfed2('0x36')]);_0x1a85bf[_0xfed2('0x37')]=qs[_0xfed2('0x38')](_[_0xfed2('0x39')](_0x1958e2[_0xfed2('0x2e')],_0x202c7d[_0xfed2('0x38')]),_0x5c0d9a);if(_0x1958e2[_0xfed2('0x2e')][_0xfed2('0x3a')]){_0x1a85bf[_0xfed2('0x37')]=_[_0xfed2('0x3b')](_0x1a85bf[_0xfed2('0x37')],{'$or':_[_0xfed2('0x28')](_0x5c0d9a,function(_0x377ce7){if(_0x377ce7[_0xfed2('0x2c')]!==_0xfed2('0x3c')){var _0x2afe4c={};_0x2afe4c[_0x377ce7[_0xfed2('0x25')]]={'$like':'%'+_0x1958e2[_0xfed2('0x2e')][_0xfed2('0x3a')]+'%'};return _0x2afe4c;}})});}_0x1a85bf=_[_0xfed2('0x3b')]({},_0x1a85bf,_0x1958e2[_0xfed2('0x3d')]);var _0x439e3f={'where':_0x1a85bf[_0xfed2('0x37')]};return db[_0xfed2('0x29')][_0xfed2('0x3e')](_0x439e3f)[_0xfed2('0x21')](function(_0x4acc43){_0x4e1745[_0xfed2('0x3e')]=_0x4acc43;if(_0x1958e2[_0xfed2('0x2e')][_0xfed2('0x3f')]){_0x1a85bf[_0xfed2('0x40')]=[{'all':!![]}];}return db[_0xfed2('0x29')]['findAll'](_0x1a85bf);})[_0xfed2('0x21')](function(_0x10a672){_0x4e1745['rows']=_0x10a672;return _0x4e1745;})[_0xfed2('0x21')](respondWithFilteredResult(_0x34c990,_0x1a85bf))[_0xfed2('0x41')](handleError(_0x34c990,null));};exports[_0xfed2('0x42')]=function(_0x38f696,_0xbc3ec0){var _0x139c57={'raw':![],'where':{'id':_0x38f696[_0xfed2('0x43')]['id']}},_0xdfd24d={};_0xdfd24d[_0xfed2('0x31')]=_[_0xfed2('0x2f')](db[_0xfed2('0x29')][_0xfed2('0x2a')]);_0xdfd24d['query']=_[_0xfed2('0x2f')](_0x38f696[_0xfed2('0x2e')]);_0xdfd24d[_0xfed2('0x38')]=_['intersection'](_0xdfd24d['model'],_0xdfd24d[_0xfed2('0x2e')]);_0x139c57[_0xfed2('0x32')]=_['intersection'](_0xdfd24d[_0xfed2('0x31')],qs[_0xfed2('0x33')](_0x38f696[_0xfed2('0x2e')][_0xfed2('0x33')]));_0x139c57[_0xfed2('0x32')]=_0x139c57[_0xfed2('0x32')][_0xfed2('0x44')]?_0x139c57['attributes']:_0xdfd24d[_0xfed2('0x31')];if(_0x38f696[_0xfed2('0x2e')][_0xfed2('0x3f')]){_0x139c57[_0xfed2('0x40')]=[{'all':!![]}];}_0x139c57=_['merge']({},_0x139c57,_0x38f696['options']);return db['Automation']['find'](_0x139c57)[_0xfed2('0x21')](handleEntityNotFound(_0xbc3ec0,null))[_0xfed2('0x21')](respondWithResult(_0xbc3ec0,null))[_0xfed2('0x41')](handleError(_0xbc3ec0,null));};exports[_0xfed2('0x45')]=function(_0x58c632,_0x4eb3e4){return db[_0xfed2('0x29')][_0xfed2('0x45')](_0x58c632['body'],{})[_0xfed2('0x21')](respondWithResult(_0x4eb3e4,0xc9))[_0xfed2('0x41')](handleError(_0x4eb3e4,null));};exports[_0xfed2('0x20')]=function(_0x18703f,_0x5ba565){if(_0x18703f[_0xfed2('0x46')]['id']){delete _0x18703f[_0xfed2('0x46')]['id'];}return db['Automation'][_0xfed2('0x47')]({'where':{'id':_0x18703f[_0xfed2('0x43')]['id']}})[_0xfed2('0x21')](handleEntityNotFound(_0x5ba565,null))['then'](saveUpdates(_0x18703f['body'],null))[_0xfed2('0x21')](respondWithResult(_0x5ba565,null))[_0xfed2('0x41')](handleError(_0x5ba565,null));};exports['destroy']=function(_0xa9bc5,_0xdd165){return db[_0xfed2('0x29')][_0xfed2('0x47')]({'where':{'id':_0xa9bc5[_0xfed2('0x43')]['id']}})[_0xfed2('0x21')](handleEntityNotFound(_0xdd165,null))['then'](removeEntity(_0xdd165,null))[_0xfed2('0x41')](handleError(_0xdd165,null));};exports[_0xfed2('0x48')]=function(_0x3e756b,_0x2bb4b0,_0x325c88){return db[_0xfed2('0x49')][_0xfed2('0x47')]({'where':{'id':_0x3e756b[_0xfed2('0x43')]['id']}})['then'](handleEntityNotFound(_0x2bb4b0,null))[_0xfed2('0x21')](function(_0x321720){if(_0x321720){return _0x321720[_0xfed2('0x48')](_0x3e756b[_0xfed2('0x46')][_0xfed2('0x4a')],_[_0xfed2('0x4b')](_0x3e756b[_0xfed2('0x46')],[_0xfed2('0x4a'),'id'])||{});}})[_0xfed2('0x21')](respondWithResult(_0x2bb4b0,null))[_0xfed2('0x41')](handleError(_0x2bb4b0,null));};exports[_0xfed2('0x4c')]=function(_0x13b0a1,_0x472e94,_0x507567){var _0x5c9abf={};var _0x548834={};var _0x2a68a2;var _0x145e57;return db[_0xfed2('0x29')][_0xfed2('0x4d')]({'where':{'id':_0x13b0a1[_0xfed2('0x43')]['id']}})[_0xfed2('0x21')](handleEntityNotFound(_0x472e94,null))['then'](function(_0x4a1c7f){if(_0x4a1c7f){_0x2a68a2=_0x4a1c7f;_0x548834['model']=_[_0xfed2('0x2f')](db[_0xfed2('0x49')][_0xfed2('0x2a')]);_0x548834[_0xfed2('0x2e')]=_[_0xfed2('0x2f')](_0x13b0a1[_0xfed2('0x2e')]);_0x548834['filters']=_[_0xfed2('0x30')](_0x548834[_0xfed2('0x31')],_0x548834[_0xfed2('0x2e')]);_0x5c9abf['attributes']=_[_0xfed2('0x30')](_0x548834[_0xfed2('0x31')],qs[_0xfed2('0x33')](_0x13b0a1[_0xfed2('0x2e')]['fields']));_0x5c9abf[_0xfed2('0x32')]=_0x5c9abf[_0xfed2('0x32')][_0xfed2('0x44')]?_0x5c9abf[_0xfed2('0x32')]:_0x548834[_0xfed2('0x31')];_0x5c9abf[_0xfed2('0x35')]=qs[_0xfed2('0x36')](_0x13b0a1[_0xfed2('0x2e')][_0xfed2('0x36')]);_0x5c9abf['where']=qs['filters'](_['pick'](_0x13b0a1['query'],_0x548834[_0xfed2('0x38')]));if(_0x13b0a1['query']['filter']){_0x5c9abf[_0xfed2('0x37')]=_['merge'](_0x5c9abf[_0xfed2('0x37')],{'$or':_[_0xfed2('0x28')](_0x5c9abf[_0xfed2('0x32')],function(_0x379139){var _0x1f1a4b={};_0x1f1a4b[_0x379139]={'$like':'%'+_0x13b0a1[_0xfed2('0x2e')][_0xfed2('0x3a')]+'%'};return _0x1f1a4b;})});}_0x5c9abf=_[_0xfed2('0x3b')]({},_0x5c9abf,_0x13b0a1[_0xfed2('0x3d')]);return _0x2a68a2[_0xfed2('0x4c')](_0x5c9abf);}})[_0xfed2('0x21')](function(_0x4c2e35){if(_0x4c2e35){_0x145e57=_0x4c2e35[_0xfed2('0x44')];if(!_0x13b0a1['query'][_0xfed2('0x4e')](_0xfed2('0x34'))){_0x5c9abf[_0xfed2('0x1b')]=qs[_0xfed2('0x1b')](_0x13b0a1['query'][_0xfed2('0x1b')]);_0x5c9abf[_0xfed2('0x19')]=qs[_0xfed2('0x19')](_0x13b0a1[_0xfed2('0x2e')]['offset']);}return _0x2a68a2[_0xfed2('0x4c')](_0x5c9abf);}})[_0xfed2('0x21')](function(_0x4fdda4){if(_0x4fdda4){return _0x4fdda4?{'count':_0x145e57,'rows':_0x4fdda4}:null;}})[_0xfed2('0x21')](respondWithResult(_0x472e94,null))[_0xfed2('0x41')](handleError(_0x472e94,null));};exports[_0xfed2('0x4f')]=function(_0x4ea45c,_0x5a1e4a,_0x4f1dcf){return db[_0xfed2('0x50')][_0xfed2('0x47')]({'where':{'id':_0x4ea45c['params']['id']}})['then'](handleEntityNotFound(_0x5a1e4a,null))[_0xfed2('0x21')](function(_0x229d53){if(_0x229d53){return _0x229d53['addActions'](_0x4ea45c['body']['ids'],_[_0xfed2('0x4b')](_0x4ea45c[_0xfed2('0x46')],[_0xfed2('0x4a'),'id'])||{});}})[_0xfed2('0x21')](respondWithResult(_0x5a1e4a,null))['catch'](handleError(_0x5a1e4a,null));};exports['getActions']=function(_0x28165d,_0x5f3b76,_0x2afaf9){var _0x244093={};var _0x31d66a={};var _0x12de3d;var _0x482a67;return db['Automation'][_0xfed2('0x4d')]({'where':{'id':_0x28165d[_0xfed2('0x43')]['id']}})['then'](handleEntityNotFound(_0x5f3b76,null))[_0xfed2('0x21')](function(_0x1fefb7){if(_0x1fefb7){_0x12de3d=_0x1fefb7;_0x31d66a[_0xfed2('0x31')]=_[_0xfed2('0x2f')](db['Action'][_0xfed2('0x2a')]);_0x31d66a[_0xfed2('0x2e')]=_[_0xfed2('0x2f')](_0x28165d[_0xfed2('0x2e')]);_0x31d66a['filters']=_[_0xfed2('0x30')](_0x31d66a[_0xfed2('0x31')],_0x31d66a[_0xfed2('0x2e')]);_0x244093[_0xfed2('0x32')]=_['intersection'](_0x31d66a['model'],qs[_0xfed2('0x33')](_0x28165d[_0xfed2('0x2e')][_0xfed2('0x33')]));_0x244093[_0xfed2('0x32')]=_0x244093[_0xfed2('0x32')][_0xfed2('0x44')]?_0x244093['attributes']:_0x31d66a[_0xfed2('0x31')];_0x244093[_0xfed2('0x35')]=qs['sort'](_0x28165d['query'][_0xfed2('0x36')]);_0x244093[_0xfed2('0x37')]=qs['filters'](_['pick'](_0x28165d[_0xfed2('0x2e')],_0x31d66a[_0xfed2('0x38')]));if(_0x28165d[_0xfed2('0x2e')]['filter']){_0x244093['where']=_[_0xfed2('0x3b')](_0x244093[_0xfed2('0x37')],{'$or':_[_0xfed2('0x28')](_0x244093[_0xfed2('0x32')],function(_0x4ec94b){var _0x347697={};_0x347697[_0x4ec94b]={'$like':'%'+_0x28165d[_0xfed2('0x2e')]['filter']+'%'};return _0x347697;})});}_0x244093=_[_0xfed2('0x3b')]({},_0x244093,_0x28165d[_0xfed2('0x3d')]);return _0x12de3d[_0xfed2('0x51')](_0x244093);}})['then'](function(_0x3f8623){if(_0x3f8623){_0x482a67=_0x3f8623[_0xfed2('0x44')];if(!_0x28165d['query'][_0xfed2('0x4e')](_0xfed2('0x34'))){_0x244093[_0xfed2('0x1b')]=qs[_0xfed2('0x1b')](_0x28165d[_0xfed2('0x2e')]['limit']);_0x244093[_0xfed2('0x19')]=qs['offset'](_0x28165d[_0xfed2('0x2e')][_0xfed2('0x19')]);}return _0x12de3d[_0xfed2('0x51')](_0x244093);}})[_0xfed2('0x21')](function(_0x330966){if(_0x330966){return _0x330966?{'count':_0x482a67,'rows':_0x330966}:null;}})[_0xfed2('0x21')](respondWithResult(_0x5f3b76,null))[_0xfed2('0x41')](handleError(_0x5f3b76,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 567af26..1c59a25 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 _0x4f32=['bluebird','request-promise','path','../../config/environment','./automation.attributes','exports','define','tools_automations','lodash','../../config/logger','api','moment'];(function(_0x170cb1,_0x283ec6){var _0x17d3a4=function(_0x31db9f){while(--_0x31db9f){_0x170cb1['push'](_0x170cb1['shift']());}};_0x17d3a4(++_0x283ec6);}(_0x4f32,0x74));var _0x24f3=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4f32[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x24f3('0x0'));var util=require('util');var logger=require(_0x24f3('0x1'))(_0x24f3('0x2'));var moment=require(_0x24f3('0x3'));var BPromise=require(_0x24f3('0x4'));var rp=require(_0x24f3('0x5'));var fs=require('fs');var path=require(_0x24f3('0x6'));var rimraf=require('rimraf');var config=require(_0x24f3('0x7'));var attributes=require(_0x24f3('0x8'));module[_0x24f3('0x9')]=function(_0x39942f,_0x96957c){return _0x39942f[_0x24f3('0xa')]('Automation',attributes,{'tableName':_0x24f3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf8d8=['rimraf','../../config/environment','exports','Automation','tools_automations','lodash','api','moment','bluebird','request-promise','path'];(function(_0x26be9c,_0x142905){var _0x13a443=function(_0xa65ff1){while(--_0xa65ff1){_0x26be9c['push'](_0x26be9c['shift']());}};_0x13a443(++_0x142905);}(_0xf8d8,0x94));var _0x8f8d=function(_0x8e74c4,_0x4c3b72){_0x8e74c4=_0x8e74c4-0x0;var _0x50e53f=_0xf8d8[_0x8e74c4];return _0x50e53f;};'use strict';var _=require(_0x8f8d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8f8d('0x1'));var moment=require(_0x8f8d('0x2'));var BPromise=require(_0x8f8d('0x3'));var rp=require(_0x8f8d('0x4'));var fs=require('fs');var path=require(_0x8f8d('0x5'));var rimraf=require(_0x8f8d('0x6'));var config=require(_0x8f8d('0x7'));var attributes=require('./automation.attributes');module[_0x8f8d('0x8')]=function(_0x316e5b,_0x1d0632){return _0x316e5b['define'](_0x8f8d('0x9'),attributes,{'tableName':_0x8f8d('0xa'),'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 e53c859..8241287 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 _0x8212=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x1b7442,_0x392128){var _0x15ef34=function(_0x415bd6){while(--_0x415bd6){_0x1b7442['push'](_0x1b7442['shift']());}};_0x15ef34(++_0x392128);}(_0x8212,0xb3));var _0x2821=function(_0x315860,_0x142502){_0x315860=_0x315860-0x0;var _0x4a60f4=_0x8212[_0x315860];return _0x4a60f4;};'use strict';var _=require(_0x2821('0x0'));var util=require(_0x2821('0x1'));var moment=require('moment');var BPromise=require(_0x2821('0x2'));var rs=require(_0x2821('0x3'));var fs=require('fs');var Redis=require(_0x2821('0x4'));var db=require(_0x2821('0x5'))['db'];var utils=require(_0x2821('0x6'));var logger=require(_0x2821('0x7'))(_0x2821('0x8'));var config=require(_0x2821('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2821('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x376c57,_0x1dc078,_0x4ea6d5){return new BPromise(function(_0x3644aa,_0x201069){return client[_0x2821('0xb')](_0x376c57,_0x4ea6d5)[_0x2821('0xc')](function(_0x16003f){logger[_0x2821('0xd')](_0x2821('0xe'),_0x1dc078,_0x2821('0xf'));logger[_0x2821('0x10')]('Automation,\x20%s,\x20%s,\x20%s',_0x1dc078,_0x2821('0xf'),JSON[_0x2821('0x11')](_0x16003f));if(_0x16003f[_0x2821('0x12')]){if(_0x16003f['error']['code']===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x1dc078,_0x16003f[_0x2821('0x12')][_0x2821('0x13')]);return _0x201069(_0x16003f[_0x2821('0x12')][_0x2821('0x13')]);}logger[_0x2821('0x12')](_0x2821('0xe'),_0x1dc078,_0x16003f['error'][_0x2821('0x13')]);return _0x3644aa(_0x16003f['error']['message']);}else{logger[_0x2821('0xd')](_0x2821('0xe'),_0x1dc078,_0x2821('0xf'));_0x3644aa(_0x16003f[_0x2821('0x14')]['message']);}})[_0x2821('0x15')](function(_0x5c2aa7){logger[_0x2821('0x12')](_0x2821('0xe'),_0x1dc078,_0x5c2aa7);_0x201069(_0x5c2aa7);});});}
\ No newline at end of file
+var _0xfbbb=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x2dedea,_0x3dc336){var _0x363838=function(_0x2c422c){while(--_0x2c422c){_0x2dedea['push'](_0x2dedea['shift']());}};_0x363838(++_0x3dc336);}(_0xfbbb,0x1b3));var _0xbfbb=function(_0x373e22,_0x7cc6d1){_0x373e22=_0x373e22-0x0;var _0x3e06b5=_0xfbbb[_0x373e22];return _0x3e06b5;};'use strict';var _=require(_0xbfbb('0x0'));var util=require(_0xbfbb('0x1'));var moment=require(_0xbfbb('0x2'));var BPromise=require(_0xbfbb('0x3'));var rs=require(_0xbfbb('0x4'));var fs=require('fs');var Redis=require(_0xbfbb('0x5'));var db=require(_0xbfbb('0x6'))['db'];var utils=require(_0xbfbb('0x7'));var logger=require(_0xbfbb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbfbb('0x9'));var client=jayson['client'][_0xbfbb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16c6cc,_0x16a41c,_0x5a69b3){return new BPromise(function(_0x1f2c31,_0x3260a7){return client[_0xbfbb('0xb')](_0x16c6cc,_0x5a69b3)[_0xbfbb('0xc')](function(_0x1baefa){logger[_0xbfbb('0xd')]('Automation,\x20%s,\x20%s',_0x16a41c,_0xbfbb('0xe'));logger[_0xbfbb('0xf')](_0xbfbb('0x10'),_0x16a41c,_0xbfbb('0xe'),JSON['stringify'](_0x1baefa));if(_0x1baefa[_0xbfbb('0x11')]){if(_0x1baefa[_0xbfbb('0x11')][_0xbfbb('0x12')]===0x1f4){logger[_0xbfbb('0x11')](_0xbfbb('0x13'),_0x16a41c,_0x1baefa[_0xbfbb('0x11')][_0xbfbb('0x14')]);return _0x3260a7(_0x1baefa[_0xbfbb('0x11')]['message']);}logger[_0xbfbb('0x11')](_0xbfbb('0x13'),_0x16a41c,_0x1baefa[_0xbfbb('0x11')][_0xbfbb('0x14')]);return _0x1f2c31(_0x1baefa[_0xbfbb('0x11')]['message']);}else{logger[_0xbfbb('0xd')](_0xbfbb('0x13'),_0x16a41c,_0xbfbb('0xe'));_0x1f2c31(_0x1baefa[_0xbfbb('0x15')][_0xbfbb('0x14')]);}})[_0xbfbb('0x16')](function(_0x2f49e5){logger['error']('Automation,\x20%s,\x20%s',_0x16a41c,_0x2f49e5);_0x3260a7(_0x2f49e5);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index afe0b1a..4f68f73 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 _0x0faf=['../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','/:id/conditions','/:id/actions','getActions','post','create','addActions','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x0faf,0x132));var _0xf0fa=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x0faf[_0x2faddb];return _0x273c05;};'use strict';var multer=require(_0xf0fa('0x0'));var util=require('util');var path=require(_0xf0fa('0x1'));var timeout=require(_0xf0fa('0x2'));var express=require(_0xf0fa('0x3'));var router=express[_0xf0fa('0x4')]();var fs_extra=require(_0xf0fa('0x5'));var auth=require(_0xf0fa('0x6'));var interaction=require(_0xf0fa('0x7'));var config=require(_0xf0fa('0x8'));var controller=require(_0xf0fa('0x9'));router['get']('/',auth[_0xf0fa('0xa')](),controller[_0xf0fa('0xb')]);router[_0xf0fa('0xc')](_0xf0fa('0xd'),auth[_0xf0fa('0xa')](),controller['show']);router[_0xf0fa('0xc')](_0xf0fa('0xe'),auth['isAuthenticated'](),controller['getConditions']);router[_0xf0fa('0xc')](_0xf0fa('0xf'),auth[_0xf0fa('0xa')](),controller[_0xf0fa('0x10')]);router[_0xf0fa('0x11')]('/',auth[_0xf0fa('0xa')](),controller[_0xf0fa('0x12')]);router[_0xf0fa('0x11')]('/:id/conditions',auth[_0xf0fa('0xa')](),controller['addConditions']);router[_0xf0fa('0x11')]('/:id/actions',auth[_0xf0fa('0xa')](),controller[_0xf0fa('0x13')]);router[_0xf0fa('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xf0fa('0x15')]);router['delete'](_0xf0fa('0xd'),auth[_0xf0fa('0xa')](),controller[_0xf0fa('0x16')]);module[_0xf0fa('0x17')]=router;
\ No newline at end of file
+var _0xb701=['update','delete','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put'];(function(_0x23a8f9,_0x21c7c4){var _0x3a89ec=function(_0x4e52ee){while(--_0x4e52ee){_0x23a8f9['push'](_0x23a8f9['shift']());}};_0x3a89ec(++_0x21c7c4);}(_0xb701,0x144));var _0x1b70=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xb701[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require('multer');var util=require(_0x1b70('0x0'));var path=require('path');var timeout=require(_0x1b70('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1b70('0x2'));var auth=require(_0x1b70('0x3'));var interaction=require(_0x1b70('0x4'));var config=require(_0x1b70('0x5'));var controller=require(_0x1b70('0x6'));router[_0x1b70('0x7')]('/',auth[_0x1b70('0x8')](),controller[_0x1b70('0x9')]);router[_0x1b70('0x7')](_0x1b70('0xa'),auth['isAuthenticated'](),controller[_0x1b70('0xb')]);router[_0x1b70('0x7')](_0x1b70('0xc'),auth[_0x1b70('0x8')](),controller[_0x1b70('0xd')]);router[_0x1b70('0x7')](_0x1b70('0xe'),auth['isAuthenticated'](),controller[_0x1b70('0xf')]);router[_0x1b70('0x10')]('/',auth[_0x1b70('0x8')](),controller[_0x1b70('0x11')]);router[_0x1b70('0x10')](_0x1b70('0xc'),auth[_0x1b70('0x8')](),controller[_0x1b70('0x12')]);router[_0x1b70('0x10')](_0x1b70('0xe'),auth[_0x1b70('0x8')](),controller[_0x1b70('0x13')]);router[_0x1b70('0x14')]('/:id',auth[_0x1b70('0x8')](),controller[_0x1b70('0x15')]);router[_0x1b70('0x16')](_0x1b70('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index f362370..db46922 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 _0xa3cb=['Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','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)'];(function(_0x1b8524,_0x1bb669){var _0x81418d=function(_0x5f5795){while(--_0x5f5795){_0x1b8524['push'](_0x1b8524['shift']());}};_0x81418d(++_0x1bb669);}(_0xa3cb,0x1e0));var _0xba3c=function(_0x2bc3f4,_0x470b26){_0x2bc3f4=_0x2bc3f4-0x0;var _0x14ac53=_0xa3cb[_0x2bc3f4];return _0x14ac53;};'use strict';var Sequelize=require(_0xba3c('0x0'));module['exports']={'name':{'type':Sequelize[_0xba3c('0x1')],'unique':_0xba3c('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xba3c('0x3')](_0xba3c('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xba3c('0x1')]},'active':{'type':Sequelize[_0xba3c('0x5')],'defaultValue':0x0,'comment':_0xba3c('0x6')},'limitCalls':{'type':Sequelize[_0xba3c('0x7')](0x4)[_0xba3c('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xba3c('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xba3c('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xba3c('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xba3c('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xba3c('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xba3c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xba3c('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xba3c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xba3c('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0xba3c('0x7')](0x3)[_0xba3c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xba3c('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0xba3c('0x7')](0x5)[_0xba3c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xba3c('0x7')](0x3)[_0xba3c('0x8')],'defaultValue':0x3,'comment':_0xba3c('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xba3c('0x7')](0x5)[_0xba3c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xba3c('0x7')](0x3)[_0xba3c('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xba3c('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xba3c('0x1')],'defaultValue':_0xba3c('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xba3c('0x11'),_0xba3c('0x12'),_0xba3c('0x13')),'defaultValue':_0xba3c('0x11')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xba3c('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xba3c('0x7')](0x9)[_0xba3c('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xba3c('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xba3c('0x7')](0x9)[_0xba3c('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xba3c('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xba3c('0x7')](0x9)[_0xba3c('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xba3c('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xba3c('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xba3c('0x7')](0x9)[_0xba3c('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xba3c('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xba3c('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xba3c('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xba3c('0x7')](0x9)[_0xba3c('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xba3c('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xba3c('0x7')](0x5)[_0xba3c('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xba3c('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xba3c('0x3')](_0xba3c('0x1c'),_0xba3c('0x1d')),'defaultValue':_0xba3c('0x1c')},'dialPrefix':{'type':Sequelize[_0xba3c('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xba3c('0x7')](0x3)[_0xba3c('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xba3c('0x1e')},'dialCutDigit':{'type':Sequelize[_0xba3c('0x7')](0x3)[_0xba3c('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xba3c('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xba3c('0x7')](0x3)[_0xba3c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xba3c('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xba3c('0x7')](0x5)[_0xba3c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xba3c('0x21')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xba3c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xba3c('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0xba3c('0x7')](0x5)[_0xba3c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xba3c('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xba3c('0x7')](0x3)[_0xba3c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xba3c('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xba3c('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xba3c('0x25')},'dialMachineMaxRetry':{'type':Sequelize[_0xba3c('0x7')](0x3)[_0xba3c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xba3c('0x26')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xba3c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xba3c('0x27')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xba3c('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xba3c('0x28')}};
\ No newline at end of file
+var _0x1d16=['#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ENUM','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#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','never','onlyIfOpen','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time'];(function(_0x47b7c9,_0x3848b2){var _0x435aaf=function(_0x3befc4){while(--_0x3befc4){_0x47b7c9['push'](_0x47b7c9['shift']());}};_0x435aaf(++_0x3848b2);}(_0x1d16,0xa8));var _0x61d1=function(_0x4f1749,_0x998e73){_0x4f1749=_0x4f1749-0x0;var _0x9a9ab3=_0x1d16[_0x4f1749];return _0x9a9ab3;};'use strict';var Sequelize=require('sequelize');module[_0x61d1('0x0')]={'name':{'type':Sequelize[_0x61d1('0x1')],'unique':_0x61d1('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x61d1('0x3')),'allowNull':![],'defaultValue':_0x61d1('0x3')},'description':{'type':Sequelize[_0x61d1('0x1')]},'active':{'type':Sequelize[_0x61d1('0x4')],'defaultValue':0x0,'comment':_0x61d1('0x5')},'limitCalls':{'type':Sequelize[_0x61d1('0x6')](0x4)[_0x61d1('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x61d1('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x61d1('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x61d1('0x6')](0x3)[_0x61d1('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x61d1('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x61d1('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x61d1('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x61d1('0x6')](0x5)[_0x61d1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x61d1('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x61d1('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x61d1('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x61d1('0x6')](0x5)[_0x61d1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x61d1('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x61d1('0x7')],'defaultValue':0x3,'comment':_0x61d1('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x61d1('0x6')](0x5)[_0x61d1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x61d1('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x61d1('0x6')](0x3)[_0x61d1('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x61d1('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x61d1('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x61d1('0x10'),_0x61d1('0x11'),_0x61d1('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x61d1('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x61d1('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x61d1('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x61d1('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x61d1('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x61d1('0x6')](0x9)[_0x61d1('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x61d1('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x61d1('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x61d1('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x61d1('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x61d1('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x61d1('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x61d1('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x61d1('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x61d1('0x6')](0x9)[_0x61d1('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x61d1('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x61d1('0x1a')](_0x61d1('0x1b'),_0x61d1('0x1c')),'defaultValue':_0x61d1('0x1b')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x61d1('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x61d1('0x1d')},'dialCutDigit':{'type':Sequelize[_0x61d1('0x6')](0x3)[_0x61d1('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x61d1('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x61d1('0x6')](0x3)[_0x61d1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x61d1('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x61d1('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x61d1('0x6')](0x3)[_0x61d1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x61d1('0x21')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x61d1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x61d1('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x61d1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x61d1('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x61d1('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x61d1('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x61d1('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x61d1('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x61d1('0x6')](0x3)[_0x61d1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x61d1('0x6')](0x5)[_0x61d1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x61d1('0x25')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 395b3f9..2258b82 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 _0xb583=['hasOwnProperty','nolimit','CampaignId','CmHopperHistory','pick','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','ContactId','ListId','createdAt','field','phone','NOW()','scheduledAt','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','from','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','get','IvrCampaigns','UserProfileResource','then','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','update','findOne','CmHopper'];(function(_0x3a8db5,_0x31cff7){var _0x2c03cd=function(_0x47dba0){while(--_0x47dba0){_0x3a8db5['push'](_0x3a8db5['shift']());}};_0x2c03cd(++_0x31cff7);}(_0xb583,0x1b9));var _0x3b58=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb583[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x3b58('0x0'));var rimraf=require(_0x3b58('0x1'));var zipdir=require(_0x3b58('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3b58('0x3'));var BPromise=require(_0x3b58('0x4'));var Mustache=require(_0x3b58('0x5'));var util=require(_0x3b58('0x6'));var path=require(_0x3b58('0x7'));var sox=require(_0x3b58('0x8'));var csv=require(_0x3b58('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3b58('0xa'));var _=require('lodash');var squel=require(_0x3b58('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3b58('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3b58('0xd'));var Papa=require('papaparse');var Redis=require(_0x3b58('0xe'));var authService=require(_0x3b58('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3b58('0x10'));var hardwareService=require(_0x3b58('0x11'));var logger=require(_0x3b58('0x12'))('api');var utils=require(_0x3b58('0x13'));var config=require(_0x3b58('0x14'));var licenseUtil=require(_0x3b58('0x15'));var db=require(_0x3b58('0x16'))['db'];function respondWithStatusCode(_0x5f4a83,_0x2dc4c1){_0x2dc4c1=_0x2dc4c1||0xcc;return function(_0x4c14bf){if(_0x4c14bf){return _0x5f4a83[_0x3b58('0x17')](_0x2dc4c1);}return _0x5f4a83['status'](_0x2dc4c1)[_0x3b58('0x18')]();};}function respondWithResult(_0x42584d,_0x4b6e85){_0x4b6e85=_0x4b6e85||0xc8;return function(_0x2df66a){if(_0x2df66a){return _0x42584d[_0x3b58('0x19')](_0x4b6e85)[_0x3b58('0x1a')](_0x2df66a);}};}function respondWithFilteredResult(_0x29ca0a,_0x39ff5d){return function(_0x490db5){if(_0x490db5){var _0x151ed0=typeof _0x39ff5d[_0x3b58('0x1b')]===_0x3b58('0x1c')&&typeof _0x39ff5d['limit']===_0x3b58('0x1c');var _0x4feeea=_0x490db5['count'];var _0x175929=_0x151ed0?0x0:_0x39ff5d[_0x3b58('0x1b')];var _0xfbcc21=_0x151ed0?_0x490db5[_0x3b58('0x1d')]:_0x39ff5d[_0x3b58('0x1b')]+_0x39ff5d[_0x3b58('0x1e')];var _0x1aac09;if(_0xfbcc21>=_0x4feeea){_0xfbcc21=_0x4feeea;_0x1aac09=0xc8;}else{_0x1aac09=0xce;}_0x29ca0a[_0x3b58('0x19')](_0x1aac09);return _0x29ca0a[_0x3b58('0x1f')](_0x3b58('0x20'),_0x175929+'-'+_0xfbcc21+'/'+_0x4feeea)[_0x3b58('0x1a')](_0x490db5);}return null;};}function patchUpdates(_0x43ef7c){return function(_0x22a87b){try{jsonpatch[_0x3b58('0x21')](_0x22a87b,_0x43ef7c,!![]);}catch(_0x524ae0){return BPromise[_0x3b58('0x22')](_0x524ae0);}return _0x22a87b[_0x3b58('0x23')]();};}function saveUpdates(_0x388a70,_0x5a0fb0){return function(_0x3c68d1){if(_0x3c68d1){return _0x3c68d1['update'](_0x388a70)['then'](function(_0x3a3067){return _0x3a3067;});}return null;};}function removeEntity(_0x5354ff,_0xe76df5){return function(_0x161f7a){if(_0x161f7a){return _0x161f7a[_0x3b58('0x24')]()['then'](function(){var _0x2cd0fe=_0x161f7a[_0x3b58('0x25')]({'plain':!![]});var _0xa45017=_0x3b58('0x26');return db[_0x3b58('0x27')][_0x3b58('0x24')]({'where':{'type':_0xa45017,'resourceId':_0x2cd0fe['id']}})[_0x3b58('0x28')](function(){return _0x161f7a;});})[_0x3b58('0x28')](function(){_0x5354ff[_0x3b58('0x19')](0xcc)[_0x3b58('0x18')]();});}};}function handleEntityNotFound(_0x3e1134,_0x5d2c5d){return function(_0x4f03ca){if(!_0x4f03ca){_0x3e1134[_0x3b58('0x17')](0x194);}return _0x4f03ca;};}function handleError(_0x3dcc49,_0x3511ec){_0x3511ec=_0x3511ec||0x1f4;return function(_0x3df8e4){logger[_0x3b58('0x29')](_0x3df8e4[_0x3b58('0x2a')]);if(_0x3df8e4[_0x3b58('0x2b')]){delete _0x3df8e4[_0x3b58('0x2b')];}_0x3dcc49['status'](_0x3511ec)[_0x3b58('0x2c')](_0x3df8e4);};}exports[_0x3b58('0x2d')]=function(_0x4bec55,_0x578e0f){var _0x3abb12={},_0x54d935={},_0x42d2dc={'count':0x0,'rows':[]};var _0x585573=_[_0x3b58('0x2e')](db[_0x3b58('0x2f')][_0x3b58('0x30')],function(_0x27a74b){return{'name':_0x27a74b[_0x3b58('0x31')],'type':_0x27a74b[_0x3b58('0x32')][_0x3b58('0x33')]};});_0x54d935[_0x3b58('0x34')]=_[_0x3b58('0x2e')](_0x585573,_0x3b58('0x2b'));_0x54d935[_0x3b58('0x35')]=_[_0x3b58('0x36')](_0x4bec55[_0x3b58('0x35')]);_0x54d935['filters']=_[_0x3b58('0x37')](_0x54d935['model'],_0x54d935['query']);_0x3abb12[_0x3b58('0x38')]=_[_0x3b58('0x37')](_0x54d935['model'],qs[_0x3b58('0x39')](_0x4bec55['query'][_0x3b58('0x39')]));_0x3abb12[_0x3b58('0x38')]=_0x3abb12[_0x3b58('0x38')]['length']?_0x3abb12['attributes']:_0x54d935[_0x3b58('0x34')];if(!_0x4bec55[_0x3b58('0x35')]['hasOwnProperty']('nolimit')){_0x3abb12[_0x3b58('0x1e')]=qs[_0x3b58('0x1e')](_0x4bec55[_0x3b58('0x35')][_0x3b58('0x1e')]);_0x3abb12['offset']=qs[_0x3b58('0x1b')](_0x4bec55['query'][_0x3b58('0x1b')]);}_0x3abb12[_0x3b58('0x3a')]=qs[_0x3b58('0x3b')](_0x4bec55['query'][_0x3b58('0x3b')]);_0x3abb12[_0x3b58('0x3c')]=qs[_0x3b58('0x3d')](_['pick'](_0x4bec55[_0x3b58('0x35')],_0x54d935[_0x3b58('0x3d')]),_0x585573);if(_0x4bec55[_0x3b58('0x35')][_0x3b58('0x3e')]){_0x3abb12[_0x3b58('0x3c')]=_[_0x3b58('0x3f')](_0x3abb12[_0x3b58('0x3c')],{'$or':_[_0x3b58('0x2e')](_0x585573,function(_0x2bae1a){if(_0x2bae1a[_0x3b58('0x32')]!=='VIRTUAL'){var _0x2347e7={};_0x2347e7[_0x2bae1a[_0x3b58('0x2b')]]={'$like':'%'+_0x4bec55[_0x3b58('0x35')][_0x3b58('0x3e')]+'%'};return _0x2347e7;}})});}_0x3abb12=_[_0x3b58('0x3f')]({},_0x3abb12,_0x4bec55[_0x3b58('0x40')]);var _0x383464={'where':_0x3abb12[_0x3b58('0x3c')]};return db['Campaign'][_0x3b58('0x1d')](_0x383464)[_0x3b58('0x28')](function(_0x3475c5){_0x42d2dc[_0x3b58('0x1d')]=_0x3475c5;if(_0x4bec55[_0x3b58('0x35')][_0x3b58('0x41')]){_0x3abb12[_0x3b58('0x42')]=[{'all':!![]}];}return db[_0x3b58('0x2f')][_0x3b58('0x43')](_0x3abb12);})[_0x3b58('0x28')](function(_0x925886){_0x42d2dc[_0x3b58('0x44')]=_0x925886;return _0x42d2dc;})[_0x3b58('0x28')](respondWithFilteredResult(_0x578e0f,_0x3abb12))[_0x3b58('0x45')](handleError(_0x578e0f,null));};exports['show']=function(_0x1291be,_0x41f486){var _0x3bdf61={'raw':![],'where':{'id':_0x1291be[_0x3b58('0x46')]['id']}},_0xe2c57d={};_0xe2c57d[_0x3b58('0x34')]=_[_0x3b58('0x36')](db[_0x3b58('0x2f')]['rawAttributes']);_0xe2c57d[_0x3b58('0x35')]=_[_0x3b58('0x36')](_0x1291be[_0x3b58('0x35')]);_0xe2c57d[_0x3b58('0x3d')]=_[_0x3b58('0x37')](_0xe2c57d[_0x3b58('0x34')],_0xe2c57d['query']);_0x3bdf61[_0x3b58('0x38')]=_[_0x3b58('0x37')](_0xe2c57d[_0x3b58('0x34')],qs[_0x3b58('0x39')](_0x1291be['query'][_0x3b58('0x39')]));_0x3bdf61[_0x3b58('0x38')]=_0x3bdf61[_0x3b58('0x38')][_0x3b58('0x47')]?_0x3bdf61[_0x3b58('0x38')]:_0xe2c57d[_0x3b58('0x34')];if(_0x1291be['query']['includeAll']){_0x3bdf61[_0x3b58('0x42')]=[{'all':!![]}];}_0x3bdf61=_[_0x3b58('0x3f')]({},_0x3bdf61,_0x1291be[_0x3b58('0x40')]);return db['Campaign'][_0x3b58('0x48')](_0x3bdf61)[_0x3b58('0x28')](handleEntityNotFound(_0x41f486,null))[_0x3b58('0x28')](respondWithResult(_0x41f486,null))[_0x3b58('0x45')](handleError(_0x41f486,null));};exports[_0x3b58('0x49')]=function(_0x4f39e5,_0x40defc){return db[_0x3b58('0x2f')][_0x3b58('0x49')](_0x4f39e5[_0x3b58('0x4a')],{})[_0x3b58('0x28')](function(_0x11fb74){var _0x12a019=_0x4f39e5[_0x3b58('0x4b')][_0x3b58('0x25')]({'plain':!![]});if(!_0x12a019)throw new Error(_0x3b58('0x4c'));if(_0x12a019[_0x3b58('0x4d')]===_0x3b58('0x4b')){var _0x3d5af7=_0x11fb74[_0x3b58('0x25')]({'plain':!![]});var _0x473989=_0x3b58('0x26');return db[_0x3b58('0x4e')][_0x3b58('0x48')]({'where':{'name':_0x473989,'userProfileId':_0x12a019[_0x3b58('0x4f')]},'raw':!![]})[_0x3b58('0x28')](function(_0x2e909){if(_0x2e909&&_0x2e909['autoAssociation']===0x0){return db[_0x3b58('0x27')][_0x3b58('0x49')]({'name':_0x3d5af7[_0x3b58('0x2b')],'resourceId':_0x3d5af7['id'],'type':_0x2e909['name'],'sectionId':_0x2e909['id']},{})['then'](function(){return _0x11fb74;});}else{return _0x11fb74;}})[_0x3b58('0x45')](function(_0x15c634){logger['error'](_0x3b58('0x50'),_0x15c634);throw _0x15c634;});}return _0x11fb74;})[_0x3b58('0x28')](respondWithResult(_0x40defc,0xc9))[_0x3b58('0x45')](handleError(_0x40defc,null));};exports[_0x3b58('0x51')]=function(_0x3adcf0,_0x8261e5){var _0x24f0b4={'where':{'id':_0x3adcf0[_0x3b58('0x46')]['id']}},_0x13f92d={};_0x13f92d[_0x3b58('0x34')]=_[_0x3b58('0x36')](db[_0x3b58('0x2f')][_0x3b58('0x30')]);_0x24f0b4[_0x3b58('0x38')]=_[_0x3b58('0x37')](_0x13f92d['model'],qs['fields'](_0x3adcf0[_0x3b58('0x35')][_0x3b58('0x39')]));_0x24f0b4[_0x3b58('0x38')]=_0x24f0b4['attributes'][_0x3b58('0x47')]?_0x24f0b4[_0x3b58('0x38')]:_0x13f92d[_0x3b58('0x34')];if(_0x3adcf0['query'][_0x3b58('0x41')]){_0x24f0b4[_0x3b58('0x42')]=[{'all':!![]}];}_0x24f0b4=_['merge']({},_0x24f0b4,_0x3adcf0[_0x3b58('0x40')]);return db[_0x3b58('0x2f')][_0x3b58('0x48')](_0x24f0b4)['then'](handleEntityNotFound(_0x8261e5,null))[_0x3b58('0x28')](function(_0x509c6c){if(_0x509c6c){var _0x504e34=_0x509c6c[_0x3b58('0x25')]({'plain':!![]});_0x504e34=qs[_0x3b58('0x52')](_0x504e34,['id','createdAt',_0x3b58('0x53')]);_0x3adcf0['body']=_[_0x3b58('0x52')](_0x3adcf0['body'],['id','createdAt','updatedAt']);return db['Campaign'][_0x3b58('0x49')](_[_0x3b58('0x3f')](_0x504e34,_0x3adcf0['body']),{'include':_0x3adcf0[_0x3b58('0x35')][_0x3b58('0x41')]?[{'all':!![]}]:undefined})[_0x3b58('0x28')](function(_0x1c6726){var _0x4c22e3=_0x3adcf0['user'][_0x3b58('0x25')]({'plain':!![]});if(!_0x4c22e3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c22e3[_0x3b58('0x4d')]===_0x3b58('0x4b')){var _0x4c67c2=_0x1c6726[_0x3b58('0x25')]({'plain':!![]});var _0x102032=_0x3b58('0x26');return db[_0x3b58('0x4e')][_0x3b58('0x48')]({'where':{'name':_0x102032,'userProfileId':_0x4c22e3['userProfileId']},'raw':!![]})[_0x3b58('0x28')](function(_0x4903b5){if(_0x4903b5&&_0x4903b5['autoAssociation']===0x0){return db[_0x3b58('0x27')][_0x3b58('0x49')]({'name':_0x4c67c2[_0x3b58('0x2b')],'resourceId':_0x4c67c2['id'],'type':_0x4903b5[_0x3b58('0x2b')],'sectionId':_0x4903b5['id']},{})[_0x3b58('0x28')](function(){return _0x1c6726;});}else{return _0x1c6726;}})[_0x3b58('0x45')](function(_0xbc9309){logger[_0x3b58('0x29')](_0x3b58('0x50'),_0xbc9309);throw _0xbc9309;});}return _0x1c6726;});}})[_0x3b58('0x28')](respondWithResult(_0x8261e5,0xc9))[_0x3b58('0x45')](handleError(_0x8261e5,null));};exports[_0x3b58('0x54')]=function(_0x4250ee,_0x2bb0a1){if(_0x4250ee['body']['id']){delete _0x4250ee['body']['id'];}return db[_0x3b58('0x2f')][_0x3b58('0x48')]({'where':{'id':_0x4250ee[_0x3b58('0x46')]['id']}})[_0x3b58('0x28')](handleEntityNotFound(_0x2bb0a1,null))[_0x3b58('0x28')](saveUpdates(_0x4250ee[_0x3b58('0x4a')],null))[_0x3b58('0x28')](respondWithResult(_0x2bb0a1,null))[_0x3b58('0x45')](handleError(_0x2bb0a1,null));};exports[_0x3b58('0x24')]=function(_0x281344,_0x1a6c43){return db[_0x3b58('0x2f')][_0x3b58('0x48')]({'where':{'id':_0x281344[_0x3b58('0x46')]['id']}})['then'](handleEntityNotFound(_0x1a6c43,null))[_0x3b58('0x28')](removeEntity(_0x1a6c43,null))['catch'](handleError(_0x1a6c43,null));};exports['getHoppers']=function(_0x307e62,_0x61e582,_0x13b68f){var _0x14e509={'raw':!![],'where':{}};var _0x4b306f={};var _0x213c3f={'count':0x0,'rows':[]};return db['Campaign'][_0x3b58('0x55')]({'where':{'id':_0x307e62[_0x3b58('0x46')]['id']}})[_0x3b58('0x28')](handleEntityNotFound(_0x61e582,null))[_0x3b58('0x28')](function(_0xc04ad9){if(_0xc04ad9){_0x4b306f['model']=_[_0x3b58('0x36')](db[_0x3b58('0x56')]['rawAttributes']);_0x4b306f['query']=_['keys'](_0x307e62[_0x3b58('0x35')]);_0x4b306f[_0x3b58('0x3d')]=_[_0x3b58('0x37')](_0x4b306f[_0x3b58('0x34')],_0x4b306f[_0x3b58('0x35')]);_0x14e509[_0x3b58('0x38')]=_[_0x3b58('0x37')](_0x4b306f[_0x3b58('0x34')],qs[_0x3b58('0x39')](_0x307e62[_0x3b58('0x35')]['fields']));_0x14e509[_0x3b58('0x38')]=_0x14e509[_0x3b58('0x38')]['length']?_0x14e509[_0x3b58('0x38')]:_0x4b306f[_0x3b58('0x34')];if(!_0x307e62[_0x3b58('0x35')][_0x3b58('0x57')](_0x3b58('0x58'))){_0x14e509[_0x3b58('0x1e')]=qs[_0x3b58('0x1e')](_0x307e62[_0x3b58('0x35')]['limit']);_0x14e509[_0x3b58('0x1b')]=qs['offset'](_0x307e62[_0x3b58('0x35')][_0x3b58('0x1b')]);}_0x14e509['order']=qs[_0x3b58('0x3b')](_0x307e62[_0x3b58('0x35')][_0x3b58('0x3b')]);_0x14e509[_0x3b58('0x3c')]=qs[_0x3b58('0x3d')](_['pick'](_0x307e62[_0x3b58('0x35')],_0x4b306f[_0x3b58('0x3d')]));_0x14e509[_0x3b58('0x3c')][_0x3b58('0x59')]=_0xc04ad9['id'];if(_0x307e62['query'][_0x3b58('0x3e')]){_0x14e509[_0x3b58('0x3c')]=_[_0x3b58('0x3f')](_0x14e509[_0x3b58('0x3c')],{'$or':_[_0x3b58('0x2e')](_0x14e509[_0x3b58('0x38')],function(_0x4ed516){var _0x358a53={};_0x358a53[_0x4ed516]={'$like':'%'+_0x307e62['query'][_0x3b58('0x3e')]+'%'};return _0x358a53;})});}_0x14e509=_['merge']({},_0x14e509,_0x307e62[_0x3b58('0x40')]);return db[_0x3b58('0x56')][_0x3b58('0x1d')]({'where':_0x14e509[_0x3b58('0x3c')]})[_0x3b58('0x28')](function(_0x3052da){_0x213c3f['count']=_0x3052da;if(_0x307e62[_0x3b58('0x35')][_0x3b58('0x41')]){_0x14e509[_0x3b58('0x42')]=[{'all':!![]}];}return db[_0x3b58('0x56')]['findAll'](_0x14e509);})['then'](function(_0x57dc9c){_0x213c3f['rows']=_0x57dc9c;return _0x213c3f;});}})[_0x3b58('0x28')](respondWithFilteredResult(_0x61e582,_0x14e509))[_0x3b58('0x45')](handleError(_0x61e582,null));};exports['getHopperHistories']=function(_0xec19d4,_0x37be5c,_0x46fe9b){var _0x1cfa26={'raw':!![],'where':{}};var _0x45aaa9={};var _0x1e3196={'count':0x0,'rows':[]};return db['Campaign'][_0x3b58('0x55')]({'where':{'id':_0xec19d4[_0x3b58('0x46')]['id']}})[_0x3b58('0x28')](handleEntityNotFound(_0x37be5c,null))[_0x3b58('0x28')](function(_0x51c031){if(_0x51c031){_0x45aaa9['model']=_['keys'](db[_0x3b58('0x5a')][_0x3b58('0x30')]);_0x45aaa9['query']=_[_0x3b58('0x36')](_0xec19d4[_0x3b58('0x35')]);_0x45aaa9[_0x3b58('0x3d')]=_['intersection'](_0x45aaa9[_0x3b58('0x34')],_0x45aaa9[_0x3b58('0x35')]);_0x1cfa26['attributes']=_['intersection'](_0x45aaa9['model'],qs['fields'](_0xec19d4[_0x3b58('0x35')]['fields']));_0x1cfa26[_0x3b58('0x38')]=_0x1cfa26[_0x3b58('0x38')][_0x3b58('0x47')]?_0x1cfa26[_0x3b58('0x38')]:_0x45aaa9[_0x3b58('0x34')];if(!_0xec19d4[_0x3b58('0x35')][_0x3b58('0x57')](_0x3b58('0x58'))){_0x1cfa26[_0x3b58('0x1e')]=qs['limit'](_0xec19d4['query'][_0x3b58('0x1e')]);_0x1cfa26[_0x3b58('0x1b')]=qs['offset'](_0xec19d4[_0x3b58('0x35')][_0x3b58('0x1b')]);}_0x1cfa26[_0x3b58('0x3a')]=qs[_0x3b58('0x3b')](_0xec19d4[_0x3b58('0x35')][_0x3b58('0x3b')]);_0x1cfa26[_0x3b58('0x3c')]=qs['filters'](_[_0x3b58('0x5b')](_0xec19d4['query'],_0x45aaa9[_0x3b58('0x3d')]));_0x1cfa26[_0x3b58('0x3c')][_0x3b58('0x59')]=_0x51c031['id'];if(_0xec19d4[_0x3b58('0x35')][_0x3b58('0x3e')]){_0x1cfa26[_0x3b58('0x3c')]=_[_0x3b58('0x3f')](_0x1cfa26[_0x3b58('0x3c')],{'$or':_[_0x3b58('0x2e')](_0x1cfa26[_0x3b58('0x38')],function(_0x2e2804){var _0x3f249e={};_0x3f249e[_0x2e2804]={'$like':'%'+_0xec19d4[_0x3b58('0x35')]['filter']+'%'};return _0x3f249e;})});}_0x1cfa26=_[_0x3b58('0x3f')]({},_0x1cfa26,_0xec19d4[_0x3b58('0x40')]);return db[_0x3b58('0x5a')][_0x3b58('0x1d')]({'where':_0x1cfa26[_0x3b58('0x3c')]})[_0x3b58('0x28')](function(_0x298a6e){_0x1e3196[_0x3b58('0x1d')]=_0x298a6e;if(_0xec19d4[_0x3b58('0x35')][_0x3b58('0x41')]){_0x1cfa26['include']=[{'all':!![]}];}return db[_0x3b58('0x5a')][_0x3b58('0x43')](_0x1cfa26);})['then'](function(_0x2ed388){_0x1e3196['rows']=_0x2ed388;return _0x1e3196;});}})['then'](respondWithFilteredResult(_0x37be5c,_0x1cfa26))[_0x3b58('0x45')](handleError(_0x37be5c,null));};exports[_0x3b58('0x5c')]=function(_0x96ae8e,_0x16af4d,_0x213f44){var _0x1baeab={'raw':!![],'where':{}};var _0x52c98c={};var _0x43650f={'count':0x0,'rows':[]};return db[_0x3b58('0x2f')][_0x3b58('0x55')]({'where':{'id':_0x96ae8e[_0x3b58('0x46')]['id']}})['then'](handleEntityNotFound(_0x16af4d,null))['then'](function(_0x31b6b8){if(_0x31b6b8){_0x52c98c[_0x3b58('0x34')]=_[_0x3b58('0x36')](db[_0x3b58('0x5d')][_0x3b58('0x30')]);_0x52c98c[_0x3b58('0x35')]=_['keys'](_0x96ae8e[_0x3b58('0x35')]);_0x52c98c['filters']=_[_0x3b58('0x37')](_0x52c98c[_0x3b58('0x34')],_0x52c98c[_0x3b58('0x35')]);_0x1baeab[_0x3b58('0x38')]=_['intersection'](_0x52c98c['model'],qs[_0x3b58('0x39')](_0x96ae8e['query'][_0x3b58('0x39')]));_0x1baeab[_0x3b58('0x38')]=_0x1baeab[_0x3b58('0x38')][_0x3b58('0x47')]?_0x1baeab[_0x3b58('0x38')]:_0x52c98c[_0x3b58('0x34')];if(!_0x96ae8e[_0x3b58('0x35')][_0x3b58('0x57')](_0x3b58('0x58'))){_0x1baeab[_0x3b58('0x1e')]=qs[_0x3b58('0x1e')](_0x96ae8e['query']['limit']);_0x1baeab[_0x3b58('0x1b')]=qs['offset'](_0x96ae8e[_0x3b58('0x35')][_0x3b58('0x1b')]);}_0x1baeab[_0x3b58('0x3a')]=qs[_0x3b58('0x3b')](_0x96ae8e['query']['sort']);_0x1baeab[_0x3b58('0x3c')]=qs['filters'](_[_0x3b58('0x5b')](_0x96ae8e['query'],_0x52c98c[_0x3b58('0x3d')]));_0x1baeab[_0x3b58('0x3c')]['CampaignId']=_0x31b6b8['id'];if(_0x96ae8e[_0x3b58('0x35')][_0x3b58('0x3e')]){_0x1baeab['where']=_[_0x3b58('0x3f')](_0x1baeab[_0x3b58('0x3c')],{'$or':_['map'](_0x1baeab[_0x3b58('0x38')],function(_0x49b96c){var _0x298a4e={};_0x298a4e[_0x49b96c]={'$like':'%'+_0x96ae8e['query'][_0x3b58('0x3e')]+'%'};return _0x298a4e;})});}_0x1baeab=_[_0x3b58('0x3f')]({},_0x1baeab,_0x96ae8e['options']);return db[_0x3b58('0x5d')][_0x3b58('0x1d')]({'where':_0x1baeab[_0x3b58('0x3c')]})[_0x3b58('0x28')](function(_0x4712d7){_0x43650f[_0x3b58('0x1d')]=_0x4712d7;if(_0x96ae8e[_0x3b58('0x35')][_0x3b58('0x41')]){_0x1baeab[_0x3b58('0x42')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x3b58('0x43')](_0x1baeab);})['then'](function(_0x5727d2){_0x43650f['rows']=_0x5727d2;return _0x43650f;});}})['then'](respondWithFilteredResult(_0x16af4d,_0x1baeab))[_0x3b58('0x45')](handleError(_0x16af4d,null));};exports[_0x3b58('0x5e')]=function(_0x3651b2,_0x20005b,_0x32e402){var _0x122c05={'raw':!![],'where':{}};var _0x266123={};var _0x4569d9={'count':0x0,'rows':[]};return db[_0x3b58('0x2f')][_0x3b58('0x55')]({'where':{'id':_0x3651b2[_0x3b58('0x46')]['id']}})[_0x3b58('0x28')](handleEntityNotFound(_0x20005b,null))[_0x3b58('0x28')](function(_0x4c6e55){if(_0x4c6e55){_0x266123[_0x3b58('0x34')]=_[_0x3b58('0x36')](db[_0x3b58('0x5f')][_0x3b58('0x30')]);_0x266123[_0x3b58('0x35')]=_[_0x3b58('0x36')](_0x3651b2['query']);_0x266123[_0x3b58('0x3d')]=_[_0x3b58('0x37')](_0x266123[_0x3b58('0x34')],_0x266123[_0x3b58('0x35')]);_0x122c05[_0x3b58('0x38')]=_['intersection'](_0x266123['model'],qs['fields'](_0x3651b2[_0x3b58('0x35')]['fields']));_0x122c05['attributes']=_0x122c05['attributes'][_0x3b58('0x47')]?_0x122c05[_0x3b58('0x38')]:_0x266123[_0x3b58('0x34')];if(!_0x3651b2['query']['hasOwnProperty'](_0x3b58('0x58'))){_0x122c05[_0x3b58('0x1e')]=qs[_0x3b58('0x1e')](_0x3651b2[_0x3b58('0x35')]['limit']);_0x122c05[_0x3b58('0x1b')]=qs[_0x3b58('0x1b')](_0x3651b2[_0x3b58('0x35')][_0x3b58('0x1b')]);}_0x122c05[_0x3b58('0x3a')]=qs['sort'](_0x3651b2['query']['sort']);_0x122c05[_0x3b58('0x3c')]=qs[_0x3b58('0x3d')](_['pick'](_0x3651b2[_0x3b58('0x35')],_0x266123['filters']));_0x122c05[_0x3b58('0x3c')][_0x3b58('0x59')]=_0x4c6e55['id'];if(_0x3651b2[_0x3b58('0x35')][_0x3b58('0x3e')]){_0x122c05[_0x3b58('0x3c')]=_[_0x3b58('0x3f')](_0x122c05[_0x3b58('0x3c')],{'$or':_[_0x3b58('0x2e')](_0x122c05[_0x3b58('0x38')],function(_0x150d68){var _0x13d441={};_0x13d441[_0x150d68]={'$like':'%'+_0x3651b2[_0x3b58('0x35')][_0x3b58('0x3e')]+'%'};return _0x13d441;})});}_0x122c05=_[_0x3b58('0x3f')]({},_0x122c05,_0x3651b2['options']);return db[_0x3b58('0x5f')][_0x3b58('0x1d')]({'where':_0x122c05[_0x3b58('0x3c')]})['then'](function(_0xc91177){_0x4569d9[_0x3b58('0x1d')]=_0xc91177;if(_0x3651b2[_0x3b58('0x35')][_0x3b58('0x41')]){_0x122c05['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x3b58('0x43')](_0x122c05);})[_0x3b58('0x28')](function(_0x5a74ab){_0x4569d9[_0x3b58('0x44')]=_0x5a74ab;return _0x4569d9;});}})[_0x3b58('0x28')](respondWithFilteredResult(_0x20005b,_0x122c05))[_0x3b58('0x45')](handleError(_0x20005b,null));};exports[_0x3b58('0x60')]=function(_0x2c2ad5,_0x5d88e0,_0x5b53b0){var _0x1a7d62={};var _0xffaa8c={};var _0x3d218d;var _0x4c55b1;return db[_0x3b58('0x2f')][_0x3b58('0x55')]({'where':{'id':_0x2c2ad5[_0x3b58('0x46')]['id']}})['then'](handleEntityNotFound(_0x5d88e0,null))[_0x3b58('0x28')](function(_0x449a6c){if(_0x449a6c){_0x3d218d=_0x449a6c;_0xffaa8c[_0x3b58('0x34')]=_['keys'](db[_0x3b58('0x61')][_0x3b58('0x30')]);_0xffaa8c['query']=_['keys'](_0x2c2ad5[_0x3b58('0x35')]);_0xffaa8c[_0x3b58('0x3d')]=_[_0x3b58('0x37')](_0xffaa8c[_0x3b58('0x34')],_0xffaa8c[_0x3b58('0x35')]);_0x1a7d62[_0x3b58('0x38')]=_['intersection'](_0xffaa8c[_0x3b58('0x34')],qs['fields'](_0x2c2ad5[_0x3b58('0x35')]['fields']));_0x1a7d62['attributes']=_0x1a7d62[_0x3b58('0x38')][_0x3b58('0x47')]?_0x1a7d62[_0x3b58('0x38')]:_0xffaa8c[_0x3b58('0x34')];_0x1a7d62['order']=qs[_0x3b58('0x3b')](_0x2c2ad5[_0x3b58('0x35')][_0x3b58('0x3b')]);_0x1a7d62[_0x3b58('0x3c')]=qs['filters'](_[_0x3b58('0x5b')](_0x2c2ad5[_0x3b58('0x35')],_0xffaa8c[_0x3b58('0x3d')]));if(_0x2c2ad5[_0x3b58('0x35')][_0x3b58('0x3e')]){_0x1a7d62['where']=_[_0x3b58('0x3f')](_0x1a7d62[_0x3b58('0x3c')],{'$or':_[_0x3b58('0x2e')](_0x1a7d62['attributes'],function(_0x13f558){var _0x14bd62={};_0x14bd62[_0x13f558]={'$like':'%'+_0x2c2ad5[_0x3b58('0x35')]['filter']+'%'};return _0x14bd62;})});}_0x1a7d62=_[_0x3b58('0x3f')]({},_0x1a7d62,_0x2c2ad5[_0x3b58('0x40')]);return _0x3d218d[_0x3b58('0x60')](_0x1a7d62);}})[_0x3b58('0x28')](function(_0x2b06ac){if(_0x2b06ac){_0x4c55b1=_0x2b06ac[_0x3b58('0x47')];if(!_0x2c2ad5[_0x3b58('0x35')][_0x3b58('0x57')](_0x3b58('0x58'))){_0x1a7d62[_0x3b58('0x1e')]=qs[_0x3b58('0x1e')](_0x2c2ad5['query'][_0x3b58('0x1e')]);_0x1a7d62[_0x3b58('0x1b')]=qs[_0x3b58('0x1b')](_0x2c2ad5[_0x3b58('0x35')][_0x3b58('0x1b')]);}return _0x3d218d['getLists'](_0x1a7d62);}})[_0x3b58('0x28')](function(_0x4e4a6a){if(_0x4e4a6a){return _0x4e4a6a?{'count':_0x4c55b1,'rows':_0x4e4a6a}:null;}})['then'](respondWithResult(_0x5d88e0,null))['catch'](handleError(_0x5d88e0,null));};exports[_0x3b58('0x62')]=function(_0x1441fa,_0x2dd0e5,_0x2e2eee){var _0x1bfd7f,_0x35289f;return db[_0x3b58('0x2f')][_0x3b58('0x48')]({'where':{'id':_0x1441fa[_0x3b58('0x46')]['id']}})[_0x3b58('0x28')](handleEntityNotFound(_0x2dd0e5,null))['then'](function(_0x46c467){if(_0x46c467){_0x35289f=_0x46c467;return _0x46c467[_0x3b58('0x62')](_0x1441fa['body'][_0x3b58('0x63')],_[_0x3b58('0x52')](_0x1441fa[_0x3b58('0x4a')],[_0x3b58('0x63'),'id'])||{});}return null;})['spread'](function(_0x13bdb8){var _0x3b7bda;_0x1bfd7f=_0x13bdb8||[];var _0x3ac218=[];if(_0x13bdb8){for(var _0x57d22e=0x0;_0x57d22e<_0x13bdb8[_0x3b58('0x47')];_0x57d22e+=0x1){var _0x1c765b=_0x13bdb8[_0x57d22e][_0x3b58('0x25')]({'plain':!![]});_0x35289f['dialCheckDuplicateType']=_0x1441fa[_0x3b58('0x4a')][_0x3b58('0x64')]?_0x1441fa[_0x3b58('0x4a')][_0x3b58('0x64')]:_0x35289f['dialCheckDuplicateType'];switch(_0x35289f[_0x3b58('0x64')]){case'always':_0x3b7bda=squel[_0x3b58('0x65')]()[_0x3b58('0x66')](_0x3b58('0x67'))[_0x3b58('0x68')](['phone','scheduledAt',_0x3b58('0x69'),_0x3b58('0x6a'),'CampaignId',_0x3b58('0x6b'),_0x3b58('0x53')],squel['select']()[_0x3b58('0x6c')](_0x3b58('0x6d'),'phone')['field'](_0x3b58('0x6e'),_0x3b58('0x6f'))[_0x3b58('0x6c')]('id','ContactId')[_0x3b58('0x6c')](_0x1c765b[_0x3b58('0x70')][_0x3b58('0x71')](),_0x3b58('0x6a'))[_0x3b58('0x6c')](_0x1441fa[_0x3b58('0x46')]['id'][_0x3b58('0x71')](),'CampaignId')['field']('NOW()',_0x3b58('0x6b'))[_0x3b58('0x6c')](_0x3b58('0x6e'),_0x3b58('0x53'))['from'](_0x3b58('0x72'))['where'](_0x3b58('0x73'))['where'](_0x3b58('0x74'),_0x1c765b['CmListId'][_0x3b58('0x71')]())[_0x3b58('0x3c')](_0x3b58('0x75'))[_0x3b58('0x3c')](_0x3b58('0x76'),squel[_0x3b58('0x77')]()[_0x3b58('0x6c')]('COALESCE(calleridnum,\x27\x27)')[_0x3b58('0x78')](_0x3b58('0x79'))[_0x3b58('0x3c')](_0x3b58('0x7a'),_0x1441fa[_0x3b58('0x46')]['id'][_0x3b58('0x71')]()))[_0x3b58('0x3c')](_0x3b58('0x76'),squel[_0x3b58('0x77')]()[_0x3b58('0x6c')]('COALESCE(phone,\x27\x27)')[_0x3b58('0x78')](_0x3b58('0x67'))[_0x3b58('0x3c')](_0x3b58('0x7a'),_0x1441fa[_0x3b58('0x46')]['id'][_0x3b58('0x71')]())))[_0x3b58('0x71')]();break;case _0x3b58('0x7b'):_0x3b7bda=squel['insert']()['into'](_0x3b58('0x67'))[_0x3b58('0x68')]([_0x3b58('0x6d'),_0x3b58('0x6f'),_0x3b58('0x69'),'ListId',_0x3b58('0x59'),_0x3b58('0x6b'),_0x3b58('0x53')],squel['select']()[_0x3b58('0x6c')](_0x3b58('0x6d'),'phone')[_0x3b58('0x6c')](_0x3b58('0x6e'),_0x3b58('0x6f'))['field']('id',_0x3b58('0x69'))['field'](_0x1c765b[_0x3b58('0x70')][_0x3b58('0x71')](),'ListId')[_0x3b58('0x6c')](_0x1441fa[_0x3b58('0x46')]['id'][_0x3b58('0x71')](),_0x3b58('0x59'))[_0x3b58('0x6c')](_0x3b58('0x6e'),_0x3b58('0x6b'))['field'](_0x3b58('0x6e'),_0x3b58('0x53'))[_0x3b58('0x78')]('cm_contacts')[_0x3b58('0x3c')](_0x3b58('0x73'))[_0x3b58('0x3c')](_0x3b58('0x74'),_0x1c765b['CmListId']['toString']())['where'](_0x3b58('0x75'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x3b58('0x77')]()['field']('COALESCE(phone,\x27\x27)')[_0x3b58('0x78')](_0x3b58('0x67'))['where'](_0x3b58('0x7a'),_0x1441fa[_0x3b58('0x46')]['id']['toString']())))[_0x3b58('0x71')]();break;default:_0x3b7bda=squel['insert']()[_0x3b58('0x66')](_0x3b58('0x67'))[_0x3b58('0x68')](['phone','scheduledAt',_0x3b58('0x69'),_0x3b58('0x6a'),'CampaignId',_0x3b58('0x6b'),_0x3b58('0x53')],squel[_0x3b58('0x77')]()[_0x3b58('0x6c')](_0x3b58('0x6d'),'phone')[_0x3b58('0x6c')](_0x3b58('0x6e'),_0x3b58('0x6f'))[_0x3b58('0x6c')]('id',_0x3b58('0x69'))[_0x3b58('0x6c')](_0x1c765b['CmListId']['toString'](),_0x3b58('0x6a'))[_0x3b58('0x6c')](_0x1441fa[_0x3b58('0x46')]['id']['toString'](),_0x3b58('0x59'))[_0x3b58('0x6c')]('NOW()',_0x3b58('0x6b'))[_0x3b58('0x6c')]('NOW()',_0x3b58('0x53'))[_0x3b58('0x78')]('cm_contacts')['where'](_0x3b58('0x73'))[_0x3b58('0x3c')](_0x3b58('0x74'),_0x1c765b[_0x3b58('0x70')]['toString']())[_0x3b58('0x3c')]('phone\x20IS\x20NOT\x20NULL'))[_0x3b58('0x71')]();}_0x3ac218[_0x3b58('0x7c')](db[_0x3b58('0x7d')][_0x3b58('0x35')](_0x3b7bda));}return BPromise[_0x3b58('0x7e')](_0x3ac218);}})[_0x3b58('0x28')](function(){return _0x1bfd7f;})['then'](respondWithResult(_0x2dd0e5,null))[_0x3b58('0x45')](handleError(_0x2dd0e5,null));};exports[_0x3b58('0x7f')]=function(_0xe12bfa,_0x43c81f,_0x5eb016){return db[_0x3b58('0x2f')][_0x3b58('0x48')]({'where':{'id':_0xe12bfa[_0x3b58('0x46')]['id']}})[_0x3b58('0x28')](handleEntityNotFound(_0x43c81f,null))['then'](function(_0x57387c){if(_0x57387c){return _0x57387c[_0x3b58('0x7f')](_0xe12bfa[_0x3b58('0x35')][_0x3b58('0x63')]);}})[_0x3b58('0x28')](function(_0x439208){if(_0x439208){return db[_0x3b58('0x56')][_0x3b58('0x24')]({'where':{'ListId':_0xe12bfa[_0x3b58('0x35')][_0x3b58('0x63')],'CampaignId':_0xe12bfa['params']['id']}})[_0x3b58('0x28')](function(){return _0x439208;});}})[_0x3b58('0x28')](respondWithStatusCode(_0x43c81f,null))[_0x3b58('0x45')](handleError(_0x43c81f,null));};exports[_0x3b58('0x80')]=function(_0x6dc35c,_0xb629de,_0x5a9aba){var _0x539d14={};var _0x339a2b={};var _0xf10bfb;var _0x583782;return db[_0x3b58('0x2f')][_0x3b58('0x55')]({'where':{'id':_0x6dc35c[_0x3b58('0x46')]['id']}})[_0x3b58('0x28')](handleEntityNotFound(_0xb629de,null))[_0x3b58('0x28')](function(_0xfc12c1){if(_0xfc12c1){_0xf10bfb=_0xfc12c1;_0x339a2b[_0x3b58('0x34')]=_[_0x3b58('0x36')](db[_0x3b58('0x61')]['rawAttributes']);_0x339a2b[_0x3b58('0x35')]=_[_0x3b58('0x36')](_0x6dc35c['query']);_0x339a2b['filters']=_[_0x3b58('0x37')](_0x339a2b[_0x3b58('0x34')],_0x339a2b[_0x3b58('0x35')]);_0x539d14[_0x3b58('0x38')]=_[_0x3b58('0x37')](_0x339a2b[_0x3b58('0x34')],qs[_0x3b58('0x39')](_0x6dc35c[_0x3b58('0x35')][_0x3b58('0x39')]));_0x539d14['attributes']=_0x539d14[_0x3b58('0x38')]['length']?_0x539d14[_0x3b58('0x38')]:_0x339a2b[_0x3b58('0x34')];_0x539d14[_0x3b58('0x3a')]=qs[_0x3b58('0x3b')](_0x6dc35c[_0x3b58('0x35')]['sort']);_0x539d14[_0x3b58('0x3c')]=qs[_0x3b58('0x3d')](_['pick'](_0x6dc35c['query'],_0x339a2b[_0x3b58('0x3d')]));if(_0x6dc35c[_0x3b58('0x35')][_0x3b58('0x3e')]){_0x539d14[_0x3b58('0x3c')]=_[_0x3b58('0x3f')](_0x539d14[_0x3b58('0x3c')],{'$or':_[_0x3b58('0x2e')](_0x539d14[_0x3b58('0x38')],function(_0x3238a4){var _0x4f652c={};_0x4f652c[_0x3238a4]={'$like':'%'+_0x6dc35c['query'][_0x3b58('0x3e')]+'%'};return _0x4f652c;})});}_0x539d14=_['merge']({},_0x539d14,_0x6dc35c[_0x3b58('0x40')]);return _0xf10bfb[_0x3b58('0x80')](_0x539d14);}})[_0x3b58('0x28')](function(_0x4f001b){if(_0x4f001b){_0x583782=_0x4f001b['length'];if(!_0x6dc35c[_0x3b58('0x35')][_0x3b58('0x57')](_0x3b58('0x58'))){_0x539d14[_0x3b58('0x1e')]=qs[_0x3b58('0x1e')](_0x6dc35c[_0x3b58('0x35')][_0x3b58('0x1e')]);_0x539d14[_0x3b58('0x1b')]=qs[_0x3b58('0x1b')](_0x6dc35c[_0x3b58('0x35')][_0x3b58('0x1b')]);}return _0xf10bfb['getBlackLists'](_0x539d14);}})['then'](function(_0x30621b){if(_0x30621b){return _0x30621b?{'count':_0x583782,'rows':_0x30621b}:null;}})[_0x3b58('0x28')](respondWithResult(_0xb629de,null))[_0x3b58('0x45')](handleError(_0xb629de,null));};exports[_0x3b58('0x81')]=function(_0x4dc66e,_0x2f4fec,_0x4ac536){var _0x2e920c,_0x19dc4c;return db[_0x3b58('0x2f')]['find']({'where':{'id':_0x4dc66e['params']['id']}})['then'](handleEntityNotFound(_0x2f4fec,null))['then'](function(_0x4df684){if(_0x4df684){_0x19dc4c=_0x4df684;return _0x4df684[_0x3b58('0x81')](_0x4dc66e[_0x3b58('0x4a')]['ids'],_[_0x3b58('0x52')](_0x4dc66e[_0x3b58('0x4a')],[_0x3b58('0x63'),'id'])||{});}return null;})['spread'](function(_0x22b175){var _0x1a528a;_0x2e920c=_0x22b175||[];var _0x4e9995=[];if(_0x22b175){for(var _0x237a9e=0x0;_0x237a9e<_0x22b175[_0x3b58('0x47')];_0x237a9e+=0x1){var _0x49b4d9=_0x22b175[_0x237a9e]['get']({'plain':!![]});_0x1a528a=squel[_0x3b58('0x65')]()[_0x3b58('0x66')](_0x3b58('0x82'))[_0x3b58('0x68')]([_0x3b58('0x6d'),_0x3b58('0x69'),_0x3b58('0x6a'),_0x3b58('0x59'),_0x3b58('0x6b'),'updatedAt'],squel[_0x3b58('0x77')]()['field'](_0x3b58('0x6d'),'phone')['field']('id',_0x3b58('0x69'))['field'](_0x49b4d9[_0x3b58('0x70')][_0x3b58('0x71')](),'ListId')[_0x3b58('0x6c')](_0x4dc66e[_0x3b58('0x46')]['id']['toString'](),_0x3b58('0x59'))['field'](_0x3b58('0x6e'),_0x3b58('0x6b'))['field'](_0x3b58('0x6e'),'updatedAt')['from'](_0x3b58('0x72'))['where'](_0x3b58('0x73'))[_0x3b58('0x3c')](_0x3b58('0x74'),_0x49b4d9[_0x3b58('0x70')][_0x3b58('0x71')]())[_0x3b58('0x3c')](_0x3b58('0x75')))[_0x3b58('0x71')]();_0x4e9995['push'](db['sequelize']['query'](_0x1a528a));}return BPromise[_0x3b58('0x7e')](_0x4e9995);}})[_0x3b58('0x28')](function(){return _0x2e920c;})['then'](respondWithResult(_0x2f4fec,null))[_0x3b58('0x45')](handleError(_0x2f4fec,null));};exports[_0x3b58('0x83')]=function(_0x418208,_0x2e6cf6,_0x40ca6b){return db['Campaign']['find']({'where':{'id':_0x418208[_0x3b58('0x46')]['id']}})['then'](handleEntityNotFound(_0x2e6cf6,null))[_0x3b58('0x28')](function(_0x19a7f7){if(_0x19a7f7){return _0x19a7f7[_0x3b58('0x83')](_0x418208[_0x3b58('0x35')][_0x3b58('0x63')]);}})['then'](function(_0x53900b){if(_0x53900b){return db[_0x3b58('0x5f')][_0x3b58('0x24')]({'where':{'ListId':_0x418208[_0x3b58('0x35')]['ids'],'CampaignId':_0x418208['params']['id']}})['then'](function(){return _0x53900b;});}})[_0x3b58('0x28')](respondWithStatusCode(_0x2e6cf6,null))[_0x3b58('0x45')](handleError(_0x2e6cf6,null));};
\ No newline at end of file
+var _0xa418=['merge','VIRTUAL','includeAll','include','findAll','rows','show','keys','options','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','clone','params','omit','updatedAt','body','createdAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CmHopper','pick','where','CampaignId','CmHopperHistory','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','from','cm_contacts','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','select','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','into','push','sequelize','all','ids','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','IvrCampaigns','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter'];(function(_0x20dace,_0xf23e25){var _0x4ccf52=function(_0x4de8ca){while(--_0x4de8ca){_0x20dace['push'](_0x20dace['shift']());}};_0x4ccf52(++_0xf23e25);}(_0xa418,0x14e));var _0x8a41=function(_0x15bf14,_0x1bf16e){_0x15bf14=_0x15bf14-0x0;var _0x4da42a=_0xa418[_0x15bf14];return _0x4da42a;};'use strict';var emlformat=require(_0x8a41('0x0'));var rimraf=require(_0x8a41('0x1'));var zipdir=require(_0x8a41('0x2'));var jsonpatch=require(_0x8a41('0x3'));var rp=require('request-promise');var moment=require(_0x8a41('0x4'));var BPromise=require(_0x8a41('0x5'));var Mustache=require(_0x8a41('0x6'));var util=require('util');var path=require(_0x8a41('0x7'));var sox=require(_0x8a41('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a41('0x9'));var _=require(_0x8a41('0xa'));var squel=require(_0x8a41('0xb'));var crypto=require('crypto');var jsforce=require(_0x8a41('0xc'));var deskjs=require(_0x8a41('0xd'));var toCsv=require(_0x8a41('0xe'));var querystring=require(_0x8a41('0xf'));var Papa=require(_0x8a41('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a41('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x8a41('0x12'));var config=require(_0x8a41('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x179a13,_0x477715){_0x477715=_0x477715||0xcc;return function(_0x2dcd32){if(_0x2dcd32){return _0x179a13[_0x8a41('0x14')](_0x477715);}return _0x179a13['status'](_0x477715)[_0x8a41('0x15')]();};}function respondWithResult(_0x2faafa,_0x4843e5){_0x4843e5=_0x4843e5||0xc8;return function(_0x39865d){if(_0x39865d){return _0x2faafa[_0x8a41('0x16')](_0x4843e5)[_0x8a41('0x17')](_0x39865d);}};}function respondWithFilteredResult(_0x1fc189,_0x5e4cfd){return function(_0x473669){if(_0x473669){var _0x57e786=typeof _0x5e4cfd[_0x8a41('0x18')]===_0x8a41('0x19')&&typeof _0x5e4cfd[_0x8a41('0x1a')]==='undefined';var _0x1fc621=_0x473669[_0x8a41('0x1b')];var _0x5da0cf=_0x57e786?0x0:_0x5e4cfd[_0x8a41('0x18')];var _0x4e092a=_0x57e786?_0x473669[_0x8a41('0x1b')]:_0x5e4cfd[_0x8a41('0x18')]+_0x5e4cfd[_0x8a41('0x1a')];var _0xb20c61;if(_0x4e092a>=_0x1fc621){_0x4e092a=_0x1fc621;_0xb20c61=0xc8;}else{_0xb20c61=0xce;}_0x1fc189[_0x8a41('0x16')](_0xb20c61);return _0x1fc189[_0x8a41('0x1c')](_0x8a41('0x1d'),_0x5da0cf+'-'+_0x4e092a+'/'+_0x1fc621)[_0x8a41('0x17')](_0x473669);}return null;};}function patchUpdates(_0x30e282){return function(_0x57346d){try{jsonpatch['apply'](_0x57346d,_0x30e282,!![]);}catch(_0xb3c4a5){return BPromise[_0x8a41('0x1e')](_0xb3c4a5);}return _0x57346d[_0x8a41('0x1f')]();};}function saveUpdates(_0x2a5233,_0x3fba8f){return function(_0x16584d){if(_0x16584d){return _0x16584d[_0x8a41('0x20')](_0x2a5233)[_0x8a41('0x21')](function(_0x1453f3){return _0x1453f3;});}return null;};}function removeEntity(_0x234890,_0x4c48ac){return function(_0x3230f7){if(_0x3230f7){return _0x3230f7[_0x8a41('0x22')]()[_0x8a41('0x21')](function(){var _0x5ad14b=_0x3230f7['get']({'plain':!![]});var _0x4885b9=_0x8a41('0x23');return db['UserProfileResource'][_0x8a41('0x22')]({'where':{'type':_0x4885b9,'resourceId':_0x5ad14b['id']}})['then'](function(){return _0x3230f7;});})[_0x8a41('0x21')](function(){_0x234890[_0x8a41('0x16')](0xcc)[_0x8a41('0x15')]();});}};}function handleEntityNotFound(_0x53ca9f,_0x51e4ba){return function(_0x32ee82){if(!_0x32ee82){_0x53ca9f[_0x8a41('0x14')](0x194);}return _0x32ee82;};}function handleError(_0x357167,_0x3bf6d3){_0x3bf6d3=_0x3bf6d3||0x1f4;return function(_0x28aad0){logger[_0x8a41('0x24')](_0x28aad0[_0x8a41('0x25')]);if(_0x28aad0[_0x8a41('0x26')]){delete _0x28aad0[_0x8a41('0x26')];}_0x357167[_0x8a41('0x16')](_0x3bf6d3)[_0x8a41('0x27')](_0x28aad0);};}exports[_0x8a41('0x28')]=function(_0x2ce97f,_0x48d5cc){var _0x2facb6={},_0x1d2e17={},_0x1dbb1b={'count':0x0,'rows':[]};var _0xdc8ac4=_[_0x8a41('0x29')](db[_0x8a41('0x2a')][_0x8a41('0x2b')],function(_0x1128e1){return{'name':_0x1128e1[_0x8a41('0x2c')],'type':_0x1128e1[_0x8a41('0x2d')][_0x8a41('0x2e')]};});_0x1d2e17['model']=_[_0x8a41('0x29')](_0xdc8ac4,_0x8a41('0x26'));_0x1d2e17[_0x8a41('0x2f')]=_['keys'](_0x2ce97f[_0x8a41('0x2f')]);_0x1d2e17[_0x8a41('0x30')]=_['intersection'](_0x1d2e17[_0x8a41('0x31')],_0x1d2e17[_0x8a41('0x2f')]);_0x2facb6[_0x8a41('0x32')]=_[_0x8a41('0x33')](_0x1d2e17[_0x8a41('0x31')],qs[_0x8a41('0x34')](_0x2ce97f[_0x8a41('0x2f')][_0x8a41('0x34')]));_0x2facb6[_0x8a41('0x32')]=_0x2facb6[_0x8a41('0x32')][_0x8a41('0x35')]?_0x2facb6[_0x8a41('0x32')]:_0x1d2e17['model'];if(!_0x2ce97f['query'][_0x8a41('0x36')](_0x8a41('0x37'))){_0x2facb6['limit']=qs[_0x8a41('0x1a')](_0x2ce97f[_0x8a41('0x2f')]['limit']);_0x2facb6[_0x8a41('0x18')]=qs['offset'](_0x2ce97f[_0x8a41('0x2f')][_0x8a41('0x18')]);}_0x2facb6[_0x8a41('0x38')]=qs[_0x8a41('0x39')](_0x2ce97f[_0x8a41('0x2f')][_0x8a41('0x39')]);_0x2facb6['where']=qs[_0x8a41('0x30')](_['pick'](_0x2ce97f[_0x8a41('0x2f')],_0x1d2e17[_0x8a41('0x30')]),_0xdc8ac4);if(_0x2ce97f[_0x8a41('0x2f')][_0x8a41('0x3a')]){_0x2facb6['where']=_[_0x8a41('0x3b')](_0x2facb6['where'],{'$or':_[_0x8a41('0x29')](_0xdc8ac4,function(_0x1f1295){if(_0x1f1295[_0x8a41('0x2d')]!==_0x8a41('0x3c')){var _0x5aade8={};_0x5aade8[_0x1f1295[_0x8a41('0x26')]]={'$like':'%'+_0x2ce97f['query'][_0x8a41('0x3a')]+'%'};return _0x5aade8;}})});}_0x2facb6=_[_0x8a41('0x3b')]({},_0x2facb6,_0x2ce97f['options']);var _0x3a269e={'where':_0x2facb6['where']};return db['Campaign'][_0x8a41('0x1b')](_0x3a269e)[_0x8a41('0x21')](function(_0x36458c){_0x1dbb1b['count']=_0x36458c;if(_0x2ce97f[_0x8a41('0x2f')][_0x8a41('0x3d')]){_0x2facb6[_0x8a41('0x3e')]=[{'all':!![]}];}return db[_0x8a41('0x2a')][_0x8a41('0x3f')](_0x2facb6);})[_0x8a41('0x21')](function(_0x4b198e){_0x1dbb1b[_0x8a41('0x40')]=_0x4b198e;return _0x1dbb1b;})[_0x8a41('0x21')](respondWithFilteredResult(_0x48d5cc,_0x2facb6))['catch'](handleError(_0x48d5cc,null));};exports[_0x8a41('0x41')]=function(_0x5aaa77,_0xc246ab){var _0x882072={'raw':![],'where':{'id':_0x5aaa77['params']['id']}},_0x3cd0cf={};_0x3cd0cf[_0x8a41('0x31')]=_[_0x8a41('0x42')](db[_0x8a41('0x2a')][_0x8a41('0x2b')]);_0x3cd0cf['query']=_[_0x8a41('0x42')](_0x5aaa77[_0x8a41('0x2f')]);_0x3cd0cf[_0x8a41('0x30')]=_[_0x8a41('0x33')](_0x3cd0cf['model'],_0x3cd0cf['query']);_0x882072[_0x8a41('0x32')]=_[_0x8a41('0x33')](_0x3cd0cf['model'],qs[_0x8a41('0x34')](_0x5aaa77[_0x8a41('0x2f')][_0x8a41('0x34')]));_0x882072[_0x8a41('0x32')]=_0x882072[_0x8a41('0x32')][_0x8a41('0x35')]?_0x882072['attributes']:_0x3cd0cf[_0x8a41('0x31')];if(_0x5aaa77[_0x8a41('0x2f')][_0x8a41('0x3d')]){_0x882072[_0x8a41('0x3e')]=[{'all':!![]}];}_0x882072=_[_0x8a41('0x3b')]({},_0x882072,_0x5aaa77[_0x8a41('0x43')]);return db['Campaign']['find'](_0x882072)[_0x8a41('0x21')](handleEntityNotFound(_0xc246ab,null))[_0x8a41('0x21')](respondWithResult(_0xc246ab,null))[_0x8a41('0x44')](handleError(_0xc246ab,null));};exports[_0x8a41('0x45')]=function(_0x1e645,_0x5d780e){return db[_0x8a41('0x2a')][_0x8a41('0x45')](_0x1e645['body'],{})[_0x8a41('0x21')](function(_0x3d5891){var _0x290036=_0x1e645[_0x8a41('0x46')][_0x8a41('0x47')]({'plain':!![]});if(!_0x290036)throw new Error(_0x8a41('0x48'));if(_0x290036[_0x8a41('0x49')]===_0x8a41('0x46')){var _0x58f6d3=_0x3d5891[_0x8a41('0x47')]({'plain':!![]});var _0x427cc2=_0x8a41('0x23');return db[_0x8a41('0x4a')][_0x8a41('0x4b')]({'where':{'name':_0x427cc2,'userProfileId':_0x290036[_0x8a41('0x4c')]},'raw':!![]})[_0x8a41('0x21')](function(_0x4cf439){if(_0x4cf439&&_0x4cf439[_0x8a41('0x4d')]===0x0){return db[_0x8a41('0x4e')][_0x8a41('0x45')]({'name':_0x58f6d3[_0x8a41('0x26')],'resourceId':_0x58f6d3['id'],'type':_0x4cf439[_0x8a41('0x26')],'sectionId':_0x4cf439['id']},{})[_0x8a41('0x21')](function(){return _0x3d5891;});}else{return _0x3d5891;}})[_0x8a41('0x44')](function(_0x3e4ac0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e4ac0);throw _0x3e4ac0;});}return _0x3d5891;})['then'](respondWithResult(_0x5d780e,0xc9))[_0x8a41('0x44')](handleError(_0x5d780e,null));};exports[_0x8a41('0x4f')]=function(_0x3b6047,_0x2d4dd2){var _0x497ae3={'where':{'id':_0x3b6047[_0x8a41('0x50')]['id']}},_0x2791c6={};_0x2791c6[_0x8a41('0x31')]=_['keys'](db[_0x8a41('0x2a')][_0x8a41('0x2b')]);_0x497ae3[_0x8a41('0x32')]=_['intersection'](_0x2791c6['model'],qs[_0x8a41('0x34')](_0x3b6047[_0x8a41('0x2f')][_0x8a41('0x34')]));_0x497ae3[_0x8a41('0x32')]=_0x497ae3[_0x8a41('0x32')][_0x8a41('0x35')]?_0x497ae3['attributes']:_0x2791c6['model'];if(_0x3b6047[_0x8a41('0x2f')][_0x8a41('0x3d')]){_0x497ae3[_0x8a41('0x3e')]=[{'all':!![]}];}_0x497ae3=_[_0x8a41('0x3b')]({},_0x497ae3,_0x3b6047[_0x8a41('0x43')]);return db[_0x8a41('0x2a')][_0x8a41('0x4b')](_0x497ae3)['then'](handleEntityNotFound(_0x2d4dd2,null))[_0x8a41('0x21')](function(_0x1f075d){if(_0x1f075d){var _0x482de4=_0x1f075d[_0x8a41('0x47')]({'plain':!![]});_0x482de4=qs[_0x8a41('0x51')](_0x482de4,['id','createdAt',_0x8a41('0x52')]);_0x3b6047[_0x8a41('0x53')]=_[_0x8a41('0x51')](_0x3b6047[_0x8a41('0x53')],['id',_0x8a41('0x54'),_0x8a41('0x52')]);return db['Campaign'][_0x8a41('0x45')](_[_0x8a41('0x3b')](_0x482de4,_0x3b6047[_0x8a41('0x53')]),{'include':_0x3b6047[_0x8a41('0x2f')][_0x8a41('0x3d')]?[{'all':!![]}]:undefined})[_0x8a41('0x21')](function(_0x13de31){var _0x131909=_0x3b6047[_0x8a41('0x46')]['get']({'plain':!![]});if(!_0x131909)throw new Error(_0x8a41('0x48'));if(_0x131909[_0x8a41('0x49')]==='user'){var _0x3c3f0e=_0x13de31['get']({'plain':!![]});var _0x1dc8cd=_0x8a41('0x23');return db['UserProfileSection'][_0x8a41('0x4b')]({'where':{'name':_0x1dc8cd,'userProfileId':_0x131909[_0x8a41('0x4c')]},'raw':!![]})[_0x8a41('0x21')](function(_0x43ab2a){if(_0x43ab2a&&_0x43ab2a[_0x8a41('0x4d')]===0x0){return db[_0x8a41('0x4e')][_0x8a41('0x45')]({'name':_0x3c3f0e['name'],'resourceId':_0x3c3f0e['id'],'type':_0x43ab2a[_0x8a41('0x26')],'sectionId':_0x43ab2a['id']},{})[_0x8a41('0x21')](function(){return _0x13de31;});}else{return _0x13de31;}})[_0x8a41('0x44')](function(_0x3dfc11){logger[_0x8a41('0x24')](_0x8a41('0x55'),_0x3dfc11);throw _0x3dfc11;});}return _0x13de31;});}})['then'](respondWithResult(_0x2d4dd2,0xc9))[_0x8a41('0x44')](handleError(_0x2d4dd2,null));};exports[_0x8a41('0x20')]=function(_0x1aa8cb,_0x14a668){if(_0x1aa8cb[_0x8a41('0x53')]['id']){delete _0x1aa8cb[_0x8a41('0x53')]['id'];}return db[_0x8a41('0x2a')][_0x8a41('0x4b')]({'where':{'id':_0x1aa8cb[_0x8a41('0x50')]['id']}})['then'](handleEntityNotFound(_0x14a668,null))[_0x8a41('0x21')](saveUpdates(_0x1aa8cb[_0x8a41('0x53')],null))[_0x8a41('0x21')](respondWithResult(_0x14a668,null))['catch'](handleError(_0x14a668,null));};exports[_0x8a41('0x22')]=function(_0x257954,_0x5bf899){return db[_0x8a41('0x2a')]['find']({'where':{'id':_0x257954[_0x8a41('0x50')]['id']}})[_0x8a41('0x21')](handleEntityNotFound(_0x5bf899,null))['then'](removeEntity(_0x5bf899,null))[_0x8a41('0x44')](handleError(_0x5bf899,null));};exports['getHoppers']=function(_0x5714b7,_0x47b1de,_0x2580c5){var _0xfa9996={'raw':!![],'where':{}};var _0x323e8e={};var _0x3befec={'count':0x0,'rows':[]};return db[_0x8a41('0x2a')][_0x8a41('0x56')]({'where':{'id':_0x5714b7[_0x8a41('0x50')]['id']}})[_0x8a41('0x21')](handleEntityNotFound(_0x47b1de,null))[_0x8a41('0x21')](function(_0xf68562){if(_0xf68562){_0x323e8e[_0x8a41('0x31')]=_['keys'](db[_0x8a41('0x57')][_0x8a41('0x2b')]);_0x323e8e[_0x8a41('0x2f')]=_[_0x8a41('0x42')](_0x5714b7[_0x8a41('0x2f')]);_0x323e8e[_0x8a41('0x30')]=_[_0x8a41('0x33')](_0x323e8e[_0x8a41('0x31')],_0x323e8e[_0x8a41('0x2f')]);_0xfa9996[_0x8a41('0x32')]=_[_0x8a41('0x33')](_0x323e8e[_0x8a41('0x31')],qs[_0x8a41('0x34')](_0x5714b7['query'][_0x8a41('0x34')]));_0xfa9996['attributes']=_0xfa9996['attributes'][_0x8a41('0x35')]?_0xfa9996[_0x8a41('0x32')]:_0x323e8e[_0x8a41('0x31')];if(!_0x5714b7['query']['hasOwnProperty'](_0x8a41('0x37'))){_0xfa9996['limit']=qs['limit'](_0x5714b7[_0x8a41('0x2f')][_0x8a41('0x1a')]);_0xfa9996[_0x8a41('0x18')]=qs['offset'](_0x5714b7[_0x8a41('0x2f')][_0x8a41('0x18')]);}_0xfa9996[_0x8a41('0x38')]=qs[_0x8a41('0x39')](_0x5714b7[_0x8a41('0x2f')][_0x8a41('0x39')]);_0xfa9996['where']=qs[_0x8a41('0x30')](_[_0x8a41('0x58')](_0x5714b7[_0x8a41('0x2f')],_0x323e8e[_0x8a41('0x30')]));_0xfa9996[_0x8a41('0x59')][_0x8a41('0x5a')]=_0xf68562['id'];if(_0x5714b7['query'][_0x8a41('0x3a')]){_0xfa9996[_0x8a41('0x59')]=_[_0x8a41('0x3b')](_0xfa9996[_0x8a41('0x59')],{'$or':_['map'](_0xfa9996[_0x8a41('0x32')],function(_0x2c183f){var _0x516ca5={};_0x516ca5[_0x2c183f]={'$like':'%'+_0x5714b7[_0x8a41('0x2f')][_0x8a41('0x3a')]+'%'};return _0x516ca5;})});}_0xfa9996=_[_0x8a41('0x3b')]({},_0xfa9996,_0x5714b7[_0x8a41('0x43')]);return db[_0x8a41('0x57')]['count']({'where':_0xfa9996[_0x8a41('0x59')]})[_0x8a41('0x21')](function(_0x2a7039){_0x3befec[_0x8a41('0x1b')]=_0x2a7039;if(_0x5714b7[_0x8a41('0x2f')][_0x8a41('0x3d')]){_0xfa9996['include']=[{'all':!![]}];}return db['CmHopper'][_0x8a41('0x3f')](_0xfa9996);})[_0x8a41('0x21')](function(_0x12dddb){_0x3befec[_0x8a41('0x40')]=_0x12dddb;return _0x3befec;});}})[_0x8a41('0x21')](respondWithFilteredResult(_0x47b1de,_0xfa9996))[_0x8a41('0x44')](handleError(_0x47b1de,null));};exports['getHopperHistories']=function(_0x130b71,_0x46acac,_0x2bfa4){var _0x1f644f={'raw':!![],'where':{}};var _0x26eca3={};var _0x2672df={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x130b71[_0x8a41('0x50')]['id']}})['then'](handleEntityNotFound(_0x46acac,null))['then'](function(_0x2f9e4b){if(_0x2f9e4b){_0x26eca3[_0x8a41('0x31')]=_['keys'](db['CmHopperHistory'][_0x8a41('0x2b')]);_0x26eca3[_0x8a41('0x2f')]=_['keys'](_0x130b71[_0x8a41('0x2f')]);_0x26eca3[_0x8a41('0x30')]=_['intersection'](_0x26eca3[_0x8a41('0x31')],_0x26eca3[_0x8a41('0x2f')]);_0x1f644f[_0x8a41('0x32')]=_[_0x8a41('0x33')](_0x26eca3[_0x8a41('0x31')],qs[_0x8a41('0x34')](_0x130b71[_0x8a41('0x2f')][_0x8a41('0x34')]));_0x1f644f[_0x8a41('0x32')]=_0x1f644f[_0x8a41('0x32')][_0x8a41('0x35')]?_0x1f644f['attributes']:_0x26eca3['model'];if(!_0x130b71[_0x8a41('0x2f')][_0x8a41('0x36')](_0x8a41('0x37'))){_0x1f644f[_0x8a41('0x1a')]=qs[_0x8a41('0x1a')](_0x130b71[_0x8a41('0x2f')][_0x8a41('0x1a')]);_0x1f644f['offset']=qs['offset'](_0x130b71[_0x8a41('0x2f')][_0x8a41('0x18')]);}_0x1f644f[_0x8a41('0x38')]=qs[_0x8a41('0x39')](_0x130b71[_0x8a41('0x2f')][_0x8a41('0x39')]);_0x1f644f[_0x8a41('0x59')]=qs[_0x8a41('0x30')](_[_0x8a41('0x58')](_0x130b71[_0x8a41('0x2f')],_0x26eca3[_0x8a41('0x30')]));_0x1f644f['where']['CampaignId']=_0x2f9e4b['id'];if(_0x130b71[_0x8a41('0x2f')][_0x8a41('0x3a')]){_0x1f644f[_0x8a41('0x59')]=_['merge'](_0x1f644f[_0x8a41('0x59')],{'$or':_['map'](_0x1f644f['attributes'],function(_0x11cea0){var _0x438318={};_0x438318[_0x11cea0]={'$like':'%'+_0x130b71[_0x8a41('0x2f')][_0x8a41('0x3a')]+'%'};return _0x438318;})});}_0x1f644f=_[_0x8a41('0x3b')]({},_0x1f644f,_0x130b71[_0x8a41('0x43')]);return db[_0x8a41('0x5b')][_0x8a41('0x1b')]({'where':_0x1f644f['where']})[_0x8a41('0x21')](function(_0x5c8e7f){_0x2672df['count']=_0x5c8e7f;if(_0x130b71[_0x8a41('0x2f')]['includeAll']){_0x1f644f[_0x8a41('0x3e')]=[{'all':!![]}];}return db[_0x8a41('0x5b')][_0x8a41('0x3f')](_0x1f644f);})['then'](function(_0x1639f8){_0x2672df['rows']=_0x1639f8;return _0x2672df;});}})[_0x8a41('0x21')](respondWithFilteredResult(_0x46acac,_0x1f644f))[_0x8a41('0x44')](handleError(_0x46acac,null));};exports['getHopperFinals']=function(_0x574085,_0x45d669,_0x1de92c){var _0x172883={'raw':!![],'where':{}};var _0x25bb58={};var _0x9e08be={'count':0x0,'rows':[]};return db[_0x8a41('0x2a')][_0x8a41('0x56')]({'where':{'id':_0x574085[_0x8a41('0x50')]['id']}})[_0x8a41('0x21')](handleEntityNotFound(_0x45d669,null))[_0x8a41('0x21')](function(_0x1260e8){if(_0x1260e8){_0x25bb58[_0x8a41('0x31')]=_[_0x8a41('0x42')](db['CmHopperFinal'][_0x8a41('0x2b')]);_0x25bb58[_0x8a41('0x2f')]=_['keys'](_0x574085[_0x8a41('0x2f')]);_0x25bb58['filters']=_[_0x8a41('0x33')](_0x25bb58[_0x8a41('0x31')],_0x25bb58[_0x8a41('0x2f')]);_0x172883[_0x8a41('0x32')]=_[_0x8a41('0x33')](_0x25bb58['model'],qs[_0x8a41('0x34')](_0x574085[_0x8a41('0x2f')][_0x8a41('0x34')]));_0x172883[_0x8a41('0x32')]=_0x172883[_0x8a41('0x32')][_0x8a41('0x35')]?_0x172883[_0x8a41('0x32')]:_0x25bb58[_0x8a41('0x31')];if(!_0x574085[_0x8a41('0x2f')]['hasOwnProperty'](_0x8a41('0x37'))){_0x172883[_0x8a41('0x1a')]=qs['limit'](_0x574085[_0x8a41('0x2f')]['limit']);_0x172883[_0x8a41('0x18')]=qs[_0x8a41('0x18')](_0x574085[_0x8a41('0x2f')][_0x8a41('0x18')]);}_0x172883[_0x8a41('0x38')]=qs[_0x8a41('0x39')](_0x574085[_0x8a41('0x2f')][_0x8a41('0x39')]);_0x172883[_0x8a41('0x59')]=qs[_0x8a41('0x30')](_[_0x8a41('0x58')](_0x574085[_0x8a41('0x2f')],_0x25bb58[_0x8a41('0x30')]));_0x172883[_0x8a41('0x59')][_0x8a41('0x5a')]=_0x1260e8['id'];if(_0x574085[_0x8a41('0x2f')][_0x8a41('0x3a')]){_0x172883['where']=_[_0x8a41('0x3b')](_0x172883[_0x8a41('0x59')],{'$or':_[_0x8a41('0x29')](_0x172883[_0x8a41('0x32')],function(_0x172893){var _0x56c9e6={};_0x56c9e6[_0x172893]={'$like':'%'+_0x574085[_0x8a41('0x2f')][_0x8a41('0x3a')]+'%'};return _0x56c9e6;})});}_0x172883=_[_0x8a41('0x3b')]({},_0x172883,_0x574085[_0x8a41('0x43')]);return db[_0x8a41('0x5c')][_0x8a41('0x1b')]({'where':_0x172883[_0x8a41('0x59')]})[_0x8a41('0x21')](function(_0xe65db0){_0x9e08be[_0x8a41('0x1b')]=_0xe65db0;if(_0x574085['query'][_0x8a41('0x3d')]){_0x172883['include']=[{'all':!![]}];}return db[_0x8a41('0x5c')][_0x8a41('0x3f')](_0x172883);})[_0x8a41('0x21')](function(_0x7e408d){_0x9e08be[_0x8a41('0x40')]=_0x7e408d;return _0x9e08be;});}})[_0x8a41('0x21')](respondWithFilteredResult(_0x45d669,_0x172883))[_0x8a41('0x44')](handleError(_0x45d669,null));};exports['getHopperBlacks']=function(_0x52e5f5,_0x3ac221,_0x3c7fe7){var _0x3492df={'raw':!![],'where':{}};var _0x4720ca={};var _0x3f7b6e={'count':0x0,'rows':[]};return db[_0x8a41('0x2a')][_0x8a41('0x56')]({'where':{'id':_0x52e5f5[_0x8a41('0x50')]['id']}})['then'](handleEntityNotFound(_0x3ac221,null))[_0x8a41('0x21')](function(_0x30d2f6){if(_0x30d2f6){_0x4720ca[_0x8a41('0x31')]=_[_0x8a41('0x42')](db[_0x8a41('0x5d')][_0x8a41('0x2b')]);_0x4720ca[_0x8a41('0x2f')]=_[_0x8a41('0x42')](_0x52e5f5[_0x8a41('0x2f')]);_0x4720ca[_0x8a41('0x30')]=_['intersection'](_0x4720ca[_0x8a41('0x31')],_0x4720ca[_0x8a41('0x2f')]);_0x3492df['attributes']=_[_0x8a41('0x33')](_0x4720ca['model'],qs[_0x8a41('0x34')](_0x52e5f5['query'][_0x8a41('0x34')]));_0x3492df[_0x8a41('0x32')]=_0x3492df[_0x8a41('0x32')]['length']?_0x3492df[_0x8a41('0x32')]:_0x4720ca[_0x8a41('0x31')];if(!_0x52e5f5[_0x8a41('0x2f')][_0x8a41('0x36')](_0x8a41('0x37'))){_0x3492df[_0x8a41('0x1a')]=qs[_0x8a41('0x1a')](_0x52e5f5[_0x8a41('0x2f')][_0x8a41('0x1a')]);_0x3492df[_0x8a41('0x18')]=qs[_0x8a41('0x18')](_0x52e5f5[_0x8a41('0x2f')][_0x8a41('0x18')]);}_0x3492df[_0x8a41('0x38')]=qs[_0x8a41('0x39')](_0x52e5f5[_0x8a41('0x2f')][_0x8a41('0x39')]);_0x3492df[_0x8a41('0x59')]=qs[_0x8a41('0x30')](_['pick'](_0x52e5f5['query'],_0x4720ca['filters']));_0x3492df[_0x8a41('0x59')][_0x8a41('0x5a')]=_0x30d2f6['id'];if(_0x52e5f5[_0x8a41('0x2f')]['filter']){_0x3492df[_0x8a41('0x59')]=_[_0x8a41('0x3b')](_0x3492df['where'],{'$or':_[_0x8a41('0x29')](_0x3492df[_0x8a41('0x32')],function(_0x4a06be){var _0xadd953={};_0xadd953[_0x4a06be]={'$like':'%'+_0x52e5f5[_0x8a41('0x2f')][_0x8a41('0x3a')]+'%'};return _0xadd953;})});}_0x3492df=_[_0x8a41('0x3b')]({},_0x3492df,_0x52e5f5[_0x8a41('0x43')]);return db[_0x8a41('0x5d')]['count']({'where':_0x3492df[_0x8a41('0x59')]})[_0x8a41('0x21')](function(_0x20217f){_0x3f7b6e['count']=_0x20217f;if(_0x52e5f5[_0x8a41('0x2f')][_0x8a41('0x3d')]){_0x3492df[_0x8a41('0x3e')]=[{'all':!![]}];}return db[_0x8a41('0x5d')]['findAll'](_0x3492df);})[_0x8a41('0x21')](function(_0xe64f2){_0x3f7b6e[_0x8a41('0x40')]=_0xe64f2;return _0x3f7b6e;});}})['then'](respondWithFilteredResult(_0x3ac221,_0x3492df))[_0x8a41('0x44')](handleError(_0x3ac221,null));};exports[_0x8a41('0x5e')]=function(_0x7905f5,_0x524a34,_0x119704){var _0x3e3dff={};var _0x13ed90={};var _0x17fceb;var _0x2999cf;return db[_0x8a41('0x2a')][_0x8a41('0x56')]({'where':{'id':_0x7905f5['params']['id']}})['then'](handleEntityNotFound(_0x524a34,null))[_0x8a41('0x21')](function(_0x25afa9){if(_0x25afa9){_0x17fceb=_0x25afa9;_0x13ed90[_0x8a41('0x31')]=_['keys'](db[_0x8a41('0x5f')]['rawAttributes']);_0x13ed90['query']=_[_0x8a41('0x42')](_0x7905f5[_0x8a41('0x2f')]);_0x13ed90['filters']=_[_0x8a41('0x33')](_0x13ed90[_0x8a41('0x31')],_0x13ed90[_0x8a41('0x2f')]);_0x3e3dff[_0x8a41('0x32')]=_[_0x8a41('0x33')](_0x13ed90[_0x8a41('0x31')],qs[_0x8a41('0x34')](_0x7905f5[_0x8a41('0x2f')]['fields']));_0x3e3dff[_0x8a41('0x32')]=_0x3e3dff['attributes']['length']?_0x3e3dff[_0x8a41('0x32')]:_0x13ed90[_0x8a41('0x31')];_0x3e3dff[_0x8a41('0x38')]=qs['sort'](_0x7905f5[_0x8a41('0x2f')]['sort']);_0x3e3dff[_0x8a41('0x59')]=qs['filters'](_[_0x8a41('0x58')](_0x7905f5['query'],_0x13ed90['filters']));if(_0x7905f5[_0x8a41('0x2f')][_0x8a41('0x3a')]){_0x3e3dff[_0x8a41('0x59')]=_[_0x8a41('0x3b')](_0x3e3dff[_0x8a41('0x59')],{'$or':_[_0x8a41('0x29')](_0x3e3dff[_0x8a41('0x32')],function(_0x3e5d5d){var _0x584f7c={};_0x584f7c[_0x3e5d5d]={'$like':'%'+_0x7905f5[_0x8a41('0x2f')]['filter']+'%'};return _0x584f7c;})});}_0x3e3dff=_['merge']({},_0x3e3dff,_0x7905f5[_0x8a41('0x43')]);return _0x17fceb[_0x8a41('0x5e')](_0x3e3dff);}})[_0x8a41('0x21')](function(_0x2433fd){if(_0x2433fd){_0x2999cf=_0x2433fd['length'];if(!_0x7905f5['query'][_0x8a41('0x36')](_0x8a41('0x37'))){_0x3e3dff[_0x8a41('0x1a')]=qs[_0x8a41('0x1a')](_0x7905f5[_0x8a41('0x2f')]['limit']);_0x3e3dff['offset']=qs[_0x8a41('0x18')](_0x7905f5[_0x8a41('0x2f')][_0x8a41('0x18')]);}return _0x17fceb[_0x8a41('0x5e')](_0x3e3dff);}})[_0x8a41('0x21')](function(_0xb43052){if(_0xb43052){return _0xb43052?{'count':_0x2999cf,'rows':_0xb43052}:null;}})[_0x8a41('0x21')](respondWithResult(_0x524a34,null))[_0x8a41('0x44')](handleError(_0x524a34,null));};exports['addLists']=function(_0xd02357,_0x49053d,_0x2a6c52){var _0x4fd7d0,_0x40c9a4;return db[_0x8a41('0x2a')][_0x8a41('0x4b')]({'where':{'id':_0xd02357[_0x8a41('0x50')]['id']}})[_0x8a41('0x21')](handleEntityNotFound(_0x49053d,null))['then'](function(_0x352102){if(_0x352102){_0x40c9a4=_0x352102;return _0x352102[_0x8a41('0x60')](_0xd02357[_0x8a41('0x53')]['ids'],_[_0x8a41('0x51')](_0xd02357[_0x8a41('0x53')],['ids','id'])||{});}return null;})[_0x8a41('0x61')](function(_0x46a2ac){var _0x2721df;_0x4fd7d0=_0x46a2ac||[];var _0x410f39=[];if(_0x46a2ac){for(var _0x3f0173=0x0;_0x3f0173<_0x46a2ac[_0x8a41('0x35')];_0x3f0173+=0x1){var _0x2f62c2=_0x46a2ac[_0x3f0173]['get']({'plain':!![]});_0x40c9a4['dialCheckDuplicateType']=_0xd02357[_0x8a41('0x53')][_0x8a41('0x62')]?_0xd02357[_0x8a41('0x53')][_0x8a41('0x62')]:_0x40c9a4[_0x8a41('0x62')];switch(_0x40c9a4['dialCheckDuplicateType']){case _0x8a41('0x63'):_0x2721df=squel[_0x8a41('0x64')]()['into'](_0x8a41('0x65'))[_0x8a41('0x66')]([_0x8a41('0x67'),_0x8a41('0x68'),_0x8a41('0x69'),_0x8a41('0x6a'),_0x8a41('0x5a'),_0x8a41('0x54'),'updatedAt'],squel['select']()[_0x8a41('0x6b')](_0x8a41('0x67'),_0x8a41('0x67'))[_0x8a41('0x6b')](_0x8a41('0x6c'),_0x8a41('0x68'))[_0x8a41('0x6b')]('id',_0x8a41('0x69'))[_0x8a41('0x6b')](_0x2f62c2[_0x8a41('0x6d')][_0x8a41('0x6e')](),'ListId')[_0x8a41('0x6b')](_0xd02357['params']['id'][_0x8a41('0x6e')](),_0x8a41('0x5a'))[_0x8a41('0x6b')](_0x8a41('0x6c'),_0x8a41('0x54'))[_0x8a41('0x6b')](_0x8a41('0x6c'),_0x8a41('0x52'))[_0x8a41('0x6f')](_0x8a41('0x70'))[_0x8a41('0x59')]('deletedAt\x20IS\x20NULL')[_0x8a41('0x59')]('ListId\x20=\x20?',_0x2f62c2[_0x8a41('0x6d')][_0x8a41('0x6e')]())['where'](_0x8a41('0x71'))['where'](_0x8a41('0x72'),squel['select']()['field'](_0x8a41('0x73'))['from'](_0x8a41('0x74'))[_0x8a41('0x59')]('CampaignId\x20=\x20?',_0xd02357[_0x8a41('0x50')]['id'][_0x8a41('0x6e')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x8a41('0x75')]()['field'](_0x8a41('0x76'))['from'](_0x8a41('0x65'))[_0x8a41('0x59')](_0x8a41('0x77'),_0xd02357[_0x8a41('0x50')]['id']['toString']())))[_0x8a41('0x6e')]();break;case _0x8a41('0x78'):_0x2721df=squel['insert']()['into'](_0x8a41('0x65'))[_0x8a41('0x66')]([_0x8a41('0x67'),_0x8a41('0x68'),_0x8a41('0x69'),_0x8a41('0x6a'),'CampaignId',_0x8a41('0x54'),_0x8a41('0x52')],squel['select']()[_0x8a41('0x6b')](_0x8a41('0x67'),_0x8a41('0x67'))['field'](_0x8a41('0x6c'),_0x8a41('0x68'))[_0x8a41('0x6b')]('id',_0x8a41('0x69'))[_0x8a41('0x6b')](_0x2f62c2['CmListId']['toString'](),_0x8a41('0x6a'))['field'](_0xd02357[_0x8a41('0x50')]['id'][_0x8a41('0x6e')](),_0x8a41('0x5a'))[_0x8a41('0x6b')](_0x8a41('0x6c'),_0x8a41('0x54'))[_0x8a41('0x6b')](_0x8a41('0x6c'),_0x8a41('0x52'))[_0x8a41('0x6f')](_0x8a41('0x70'))['where'](_0x8a41('0x79'))[_0x8a41('0x59')](_0x8a41('0x7a'),_0x2f62c2['CmListId']['toString']())[_0x8a41('0x59')]('phone\x20IS\x20NOT\x20NULL')[_0x8a41('0x59')](_0x8a41('0x72'),squel[_0x8a41('0x75')]()[_0x8a41('0x6b')](_0x8a41('0x76'))[_0x8a41('0x6f')](_0x8a41('0x65'))[_0x8a41('0x59')](_0x8a41('0x77'),_0xd02357[_0x8a41('0x50')]['id'][_0x8a41('0x6e')]())))[_0x8a41('0x6e')]();break;default:_0x2721df=squel[_0x8a41('0x64')]()[_0x8a41('0x7b')]('cm_hopper')[_0x8a41('0x66')]([_0x8a41('0x67'),_0x8a41('0x68'),'ContactId',_0x8a41('0x6a'),_0x8a41('0x5a'),_0x8a41('0x54'),'updatedAt'],squel[_0x8a41('0x75')]()[_0x8a41('0x6b')](_0x8a41('0x67'),'phone')['field'](_0x8a41('0x6c'),_0x8a41('0x68'))[_0x8a41('0x6b')]('id',_0x8a41('0x69'))[_0x8a41('0x6b')](_0x2f62c2[_0x8a41('0x6d')][_0x8a41('0x6e')](),_0x8a41('0x6a'))[_0x8a41('0x6b')](_0xd02357[_0x8a41('0x50')]['id'][_0x8a41('0x6e')](),_0x8a41('0x5a'))[_0x8a41('0x6b')]('NOW()',_0x8a41('0x54'))[_0x8a41('0x6b')]('NOW()',_0x8a41('0x52'))[_0x8a41('0x6f')](_0x8a41('0x70'))['where'](_0x8a41('0x79'))[_0x8a41('0x59')](_0x8a41('0x7a'),_0x2f62c2['CmListId']['toString']())[_0x8a41('0x59')](_0x8a41('0x71')))['toString']();}_0x410f39[_0x8a41('0x7c')](db[_0x8a41('0x7d')][_0x8a41('0x2f')](_0x2721df));}return BPromise[_0x8a41('0x7e')](_0x410f39);}})[_0x8a41('0x21')](function(){return _0x4fd7d0;})['then'](respondWithResult(_0x49053d,null))[_0x8a41('0x44')](handleError(_0x49053d,null));};exports['removeLists']=function(_0x426fc2,_0x17a601,_0x36d2f6){return db[_0x8a41('0x2a')][_0x8a41('0x4b')]({'where':{'id':_0x426fc2[_0x8a41('0x50')]['id']}})[_0x8a41('0x21')](handleEntityNotFound(_0x17a601,null))[_0x8a41('0x21')](function(_0x4669a3){if(_0x4669a3){return _0x4669a3['removeLists'](_0x426fc2['query']['ids']);}})['then'](function(_0x3ee4ab){if(_0x3ee4ab){return db[_0x8a41('0x57')][_0x8a41('0x22')]({'where':{'ListId':_0x426fc2[_0x8a41('0x2f')][_0x8a41('0x7f')],'CampaignId':_0x426fc2['params']['id']}})[_0x8a41('0x21')](function(){return _0x3ee4ab;});}})[_0x8a41('0x21')](respondWithStatusCode(_0x17a601,null))[_0x8a41('0x44')](handleError(_0x17a601,null));};exports['getBlackLists']=function(_0x3b2a05,_0x398f00,_0xfecbad){var _0x32dcf5={};var _0x248efd={};var _0x47d0e8;var _0x375e83;return db[_0x8a41('0x2a')][_0x8a41('0x56')]({'where':{'id':_0x3b2a05['params']['id']}})[_0x8a41('0x21')](handleEntityNotFound(_0x398f00,null))[_0x8a41('0x21')](function(_0x4826e0){if(_0x4826e0){_0x47d0e8=_0x4826e0;_0x248efd[_0x8a41('0x31')]=_[_0x8a41('0x42')](db['CmList'][_0x8a41('0x2b')]);_0x248efd[_0x8a41('0x2f')]=_[_0x8a41('0x42')](_0x3b2a05['query']);_0x248efd[_0x8a41('0x30')]=_[_0x8a41('0x33')](_0x248efd[_0x8a41('0x31')],_0x248efd['query']);_0x32dcf5['attributes']=_[_0x8a41('0x33')](_0x248efd[_0x8a41('0x31')],qs[_0x8a41('0x34')](_0x3b2a05[_0x8a41('0x2f')][_0x8a41('0x34')]));_0x32dcf5[_0x8a41('0x32')]=_0x32dcf5['attributes'][_0x8a41('0x35')]?_0x32dcf5[_0x8a41('0x32')]:_0x248efd[_0x8a41('0x31')];_0x32dcf5[_0x8a41('0x38')]=qs[_0x8a41('0x39')](_0x3b2a05[_0x8a41('0x2f')][_0x8a41('0x39')]);_0x32dcf5['where']=qs[_0x8a41('0x30')](_[_0x8a41('0x58')](_0x3b2a05['query'],_0x248efd[_0x8a41('0x30')]));if(_0x3b2a05[_0x8a41('0x2f')]['filter']){_0x32dcf5[_0x8a41('0x59')]=_[_0x8a41('0x3b')](_0x32dcf5[_0x8a41('0x59')],{'$or':_[_0x8a41('0x29')](_0x32dcf5['attributes'],function(_0x1cf13f){var _0x37c48d={};_0x37c48d[_0x1cf13f]={'$like':'%'+_0x3b2a05['query'][_0x8a41('0x3a')]+'%'};return _0x37c48d;})});}_0x32dcf5=_[_0x8a41('0x3b')]({},_0x32dcf5,_0x3b2a05[_0x8a41('0x43')]);return _0x47d0e8[_0x8a41('0x80')](_0x32dcf5);}})['then'](function(_0xe94410){if(_0xe94410){_0x375e83=_0xe94410['length'];if(!_0x3b2a05[_0x8a41('0x2f')][_0x8a41('0x36')](_0x8a41('0x37'))){_0x32dcf5[_0x8a41('0x1a')]=qs['limit'](_0x3b2a05[_0x8a41('0x2f')]['limit']);_0x32dcf5[_0x8a41('0x18')]=qs[_0x8a41('0x18')](_0x3b2a05[_0x8a41('0x2f')]['offset']);}return _0x47d0e8[_0x8a41('0x80')](_0x32dcf5);}})['then'](function(_0x17a975){if(_0x17a975){return _0x17a975?{'count':_0x375e83,'rows':_0x17a975}:null;}})[_0x8a41('0x21')](respondWithResult(_0x398f00,null))[_0x8a41('0x44')](handleError(_0x398f00,null));};exports['addBlackLists']=function(_0x4ed465,_0x4fc157,_0x600db){var _0x5b9d22,_0x562623;return db['Campaign'][_0x8a41('0x4b')]({'where':{'id':_0x4ed465[_0x8a41('0x50')]['id']}})[_0x8a41('0x21')](handleEntityNotFound(_0x4fc157,null))['then'](function(_0x458307){if(_0x458307){_0x562623=_0x458307;return _0x458307[_0x8a41('0x81')](_0x4ed465[_0x8a41('0x53')][_0x8a41('0x7f')],_[_0x8a41('0x51')](_0x4ed465['body'],['ids','id'])||{});}return null;})[_0x8a41('0x61')](function(_0x4d1afe){var _0x82580b;_0x5b9d22=_0x4d1afe||[];var _0x24fa88=[];if(_0x4d1afe){for(var _0x550932=0x0;_0x550932<_0x4d1afe[_0x8a41('0x35')];_0x550932+=0x1){var _0x7524fc=_0x4d1afe[_0x550932]['get']({'plain':!![]});_0x82580b=squel[_0x8a41('0x64')]()[_0x8a41('0x7b')]('cm_hopper_black')[_0x8a41('0x66')]([_0x8a41('0x67'),_0x8a41('0x69'),_0x8a41('0x6a'),_0x8a41('0x5a'),_0x8a41('0x54'),_0x8a41('0x52')],squel['select']()[_0x8a41('0x6b')](_0x8a41('0x67'),_0x8a41('0x67'))[_0x8a41('0x6b')]('id',_0x8a41('0x69'))['field'](_0x7524fc['CmListId'][_0x8a41('0x6e')](),_0x8a41('0x6a'))[_0x8a41('0x6b')](_0x4ed465[_0x8a41('0x50')]['id'][_0x8a41('0x6e')](),_0x8a41('0x5a'))[_0x8a41('0x6b')]('NOW()','createdAt')['field'](_0x8a41('0x6c'),_0x8a41('0x52'))[_0x8a41('0x6f')](_0x8a41('0x70'))[_0x8a41('0x59')](_0x8a41('0x79'))[_0x8a41('0x59')]('ListId\x20=\x20?',_0x7524fc['CmListId'][_0x8a41('0x6e')]())[_0x8a41('0x59')](_0x8a41('0x71')))[_0x8a41('0x6e')]();_0x24fa88['push'](db[_0x8a41('0x7d')][_0x8a41('0x2f')](_0x82580b));}return BPromise[_0x8a41('0x7e')](_0x24fa88);}})[_0x8a41('0x21')](function(){return _0x5b9d22;})[_0x8a41('0x21')](respondWithResult(_0x4fc157,null))[_0x8a41('0x44')](handleError(_0x4fc157,null));};exports[_0x8a41('0x82')]=function(_0x2f67ea,_0x182974,_0xc29391){return db[_0x8a41('0x2a')][_0x8a41('0x4b')]({'where':{'id':_0x2f67ea[_0x8a41('0x50')]['id']}})[_0x8a41('0x21')](handleEntityNotFound(_0x182974,null))[_0x8a41('0x21')](function(_0x28df36){if(_0x28df36){return _0x28df36[_0x8a41('0x82')](_0x2f67ea[_0x8a41('0x2f')]['ids']);}})[_0x8a41('0x21')](function(_0x4cba9e){if(_0x4cba9e){return db[_0x8a41('0x5d')]['destroy']({'where':{'ListId':_0x2f67ea[_0x8a41('0x2f')][_0x8a41('0x7f')],'CampaignId':_0x2f67ea[_0x8a41('0x50')]['id']}})[_0x8a41('0x21')](function(){return _0x4cba9e;});}})[_0x8a41('0x21')](respondWithStatusCode(_0x182974,null))[_0x8a41('0x44')](handleError(_0x182974,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 03855a8..da712d4 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x2a05bf,_0x55e3a4){var _0x38a62e=function(_0x28d868){while(--_0x28d868){_0x2a05bf['push'](_0x2a05bf['shift']());}};_0x38a62e(++_0x55e3a4);}(_0x7a54,0x106));var _0x47a5=function(_0x38b875,_0xaf5112){_0x38b875=_0x38b875-0x0;var _0x49071c=_0x7a54[_0x38b875];return _0x49071c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x2d06ef,_0x2b609d){var _0x5ea499=function(_0x3cd37a){while(--_0x3cd37a){_0x2d06ef['push'](_0x2d06ef['shift']());}};_0x5ea499(++_0x2b609d);}(_0x7a54,0x106));var _0x47a5=function(_0x4e9b75,_0x20463d){_0x4e9b75=_0x4e9b75-0x0;var _0x215b0f=_0x7a54[_0x4e9b75];return _0x215b0f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index d7f87d5..bb8e0df 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 _0x98b8=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','Campaign','findAll','options','raw','where','limit','include','map','model','attributes','GetCampaign','lodash'];(function(_0x255be9,_0x3345d9){var _0x34fedf=function(_0x2e198c){while(--_0x2e198c){_0x255be9['push'](_0x255be9['shift']());}};_0x34fedf(++_0x3345d9);}(_0x98b8,0x93));var _0x898b=function(_0xb4df7d,_0xd352df){_0xb4df7d=_0xb4df7d-0x0;var _0x43bdc0=_0x98b8[_0xb4df7d];return _0x43bdc0;};'use strict';var _=require(_0x898b('0x0'));var util=require(_0x898b('0x1'));var moment=require(_0x898b('0x2'));var BPromise=require(_0x898b('0x3'));var rs=require(_0x898b('0x4'));var fs=require('fs');var Redis=require(_0x898b('0x5'));var db=require(_0x898b('0x6'))['db'];var utils=require(_0x898b('0x7'));var logger=require(_0x898b('0x8'))(_0x898b('0x9'));var config=require(_0x898b('0xa'));var jayson=require(_0x898b('0xb'));var client=jayson[_0x898b('0xc')][_0x898b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x124030,_0x4e9410,_0x3989f9){return new BPromise(function(_0x32e2e,_0x4220a7){return client[_0x898b('0xe')](_0x124030,_0x3989f9)[_0x898b('0xf')](function(_0x46118b){logger[_0x898b('0x10')](_0x898b('0x11'),_0x4e9410,'request\x20sent');logger[_0x898b('0x12')]('Campaign,\x20%s,\x20%s,\x20%s',_0x4e9410,'request\x20sent',JSON[_0x898b('0x13')](_0x46118b));if(_0x46118b[_0x898b('0x14')]){if(_0x46118b[_0x898b('0x14')][_0x898b('0x15')]===0x1f4){logger[_0x898b('0x14')](_0x898b('0x11'),_0x4e9410,_0x46118b[_0x898b('0x14')][_0x898b('0x16')]);return _0x4220a7(_0x46118b[_0x898b('0x14')][_0x898b('0x16')]);}logger[_0x898b('0x14')](_0x898b('0x11'),_0x4e9410,_0x46118b['error'][_0x898b('0x16')]);return _0x32e2e(_0x46118b[_0x898b('0x14')][_0x898b('0x16')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x4e9410,_0x898b('0x17'));_0x32e2e(_0x46118b[_0x898b('0x18')][_0x898b('0x16')]);}})[_0x898b('0x19')](function(_0x54cd3b){logger[_0x898b('0x14')]('Campaign,\x20%s,\x20%s',_0x4e9410,_0x54cd3b);_0x4220a7(_0x54cd3b);});});}exports['GetCampaign']=function(_0x3ad191){var _0x250349=this;return new Promise(function(_0x3f001a,_0x4b1a40){return db[_0x898b('0x1a')][_0x898b('0x1b')]({'raw':_0x3ad191[_0x898b('0x1c')]?_0x3ad191[_0x898b('0x1c')][_0x898b('0x1d')]===undefined?!![]:![]:!![],'where':_0x3ad191[_0x898b('0x1c')]?_0x3ad191[_0x898b('0x1c')][_0x898b('0x1e')]||null:null,'attributes':_0x3ad191[_0x898b('0x1c')]?_0x3ad191[_0x898b('0x1c')]['attributes']||null:null,'limit':_0x3ad191['options']?_0x3ad191[_0x898b('0x1c')][_0x898b('0x1f')]||null:null,'include':_0x3ad191['options']?_0x3ad191[_0x898b('0x1c')][_0x898b('0x20')]?_[_0x898b('0x21')](_0x3ad191['options']['include'],function(_0x66101f){return{'model':db[_0x66101f[_0x898b('0x22')]],'as':_0x66101f['as'],'attributes':_0x66101f[_0x898b('0x23')],'include':_0x66101f[_0x898b('0x20')]?_[_0x898b('0x21')](_0x66101f[_0x898b('0x20')],function(_0x11c558){return{'model':db[_0x11c558[_0x898b('0x22')]],'as':_0x11c558['as'],'attributes':_0x11c558[_0x898b('0x23')],'include':_0x11c558[_0x898b('0x20')]?_[_0x898b('0x21')](_0x11c558[_0x898b('0x20')],function(_0x163a6c){return{'model':db[_0x163a6c['model']],'as':_0x163a6c['as'],'attributes':_0x163a6c['attributes']};}):[]};}):[]};}):[]:[]})[_0x898b('0xf')](function(_0xb5c11){logger[_0x898b('0x10')](_0x898b('0x24'),_0x3ad191);logger[_0x898b('0x12')](_0x898b('0x24'),_0x3ad191,JSON[_0x898b('0x13')](_0xb5c11));_0x3f001a(_0xb5c11);})[_0x898b('0x19')](function(_0x320237){logger[_0x898b('0x14')]('GetCampaign',_0x320237['message'],_0x3ad191);_0x4b1a40(_0x250349[_0x898b('0x14')](0x1f4,_0x320237[_0x898b('0x16')]));});});};
\ No newline at end of file
+var _0xac65=['limit','include','map','model','attributes','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xac65,0x11d));var _0x5ac6=function(_0x5098a0,_0x100da0){_0x5098a0=_0x5098a0-0x0;var _0x2cfe61=_0xac65[_0x5098a0];return _0x2cfe61;};'use strict';var _=require(_0x5ac6('0x0'));var util=require(_0x5ac6('0x1'));var moment=require(_0x5ac6('0x2'));var BPromise=require('bluebird');var rs=require(_0x5ac6('0x3'));var fs=require('fs');var Redis=require(_0x5ac6('0x4'));var db=require(_0x5ac6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5ac6('0x6'))(_0x5ac6('0x7'));var config=require(_0x5ac6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5ac6('0x9')][_0x5ac6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x130661,_0x402f26,_0xa61e6f){return new BPromise(function(_0x932f6f,_0x3a90a6){return client[_0x5ac6('0xb')](_0x130661,_0xa61e6f)[_0x5ac6('0xc')](function(_0x3b04ab){logger[_0x5ac6('0xd')](_0x5ac6('0xe'),_0x402f26,_0x5ac6('0xf'));logger[_0x5ac6('0x10')](_0x5ac6('0x11'),_0x402f26,_0x5ac6('0xf'),JSON[_0x5ac6('0x12')](_0x3b04ab));if(_0x3b04ab[_0x5ac6('0x13')]){if(_0x3b04ab[_0x5ac6('0x13')][_0x5ac6('0x14')]===0x1f4){logger[_0x5ac6('0x13')](_0x5ac6('0xe'),_0x402f26,_0x3b04ab[_0x5ac6('0x13')][_0x5ac6('0x15')]);return _0x3a90a6(_0x3b04ab[_0x5ac6('0x13')][_0x5ac6('0x15')]);}logger['error'](_0x5ac6('0xe'),_0x402f26,_0x3b04ab[_0x5ac6('0x13')][_0x5ac6('0x15')]);return _0x932f6f(_0x3b04ab['error'][_0x5ac6('0x15')]);}else{logger[_0x5ac6('0xd')](_0x5ac6('0xe'),_0x402f26,_0x5ac6('0xf'));_0x932f6f(_0x3b04ab[_0x5ac6('0x16')]['message']);}})[_0x5ac6('0x17')](function(_0x5e4885){logger['error'](_0x5ac6('0xe'),_0x402f26,_0x5e4885);_0x3a90a6(_0x5e4885);});});}exports[_0x5ac6('0x18')]=function(_0x2e62d9){var _0x3a88a1=this;return new Promise(function(_0x24ccd2,_0x3759dd){return db[_0x5ac6('0x19')][_0x5ac6('0x1a')]({'raw':_0x2e62d9[_0x5ac6('0x1b')]?_0x2e62d9['options'][_0x5ac6('0x1c')]===undefined?!![]:![]:!![],'where':_0x2e62d9[_0x5ac6('0x1b')]?_0x2e62d9[_0x5ac6('0x1b')][_0x5ac6('0x1d')]||null:null,'attributes':_0x2e62d9['options']?_0x2e62d9[_0x5ac6('0x1b')]['attributes']||null:null,'limit':_0x2e62d9[_0x5ac6('0x1b')]?_0x2e62d9['options'][_0x5ac6('0x1e')]||null:null,'include':_0x2e62d9[_0x5ac6('0x1b')]?_0x2e62d9['options'][_0x5ac6('0x1f')]?_[_0x5ac6('0x20')](_0x2e62d9['options'][_0x5ac6('0x1f')],function(_0x4c07d6){return{'model':db[_0x4c07d6[_0x5ac6('0x21')]],'as':_0x4c07d6['as'],'attributes':_0x4c07d6[_0x5ac6('0x22')],'include':_0x4c07d6[_0x5ac6('0x1f')]?_[_0x5ac6('0x20')](_0x4c07d6[_0x5ac6('0x1f')],function(_0x3da323){return{'model':db[_0x3da323[_0x5ac6('0x21')]],'as':_0x3da323['as'],'attributes':_0x3da323['attributes'],'include':_0x3da323[_0x5ac6('0x1f')]?_[_0x5ac6('0x20')](_0x3da323['include'],function(_0x333464){return{'model':db[_0x333464['model']],'as':_0x333464['as'],'attributes':_0x333464[_0x5ac6('0x22')]};}):[]};}):[]};}):[]:[]})[_0x5ac6('0xc')](function(_0x51fdf4){logger[_0x5ac6('0xd')]('GetCampaign',_0x2e62d9);logger['debug'](_0x5ac6('0x18'),_0x2e62d9,JSON['stringify'](_0x51fdf4));_0x24ccd2(_0x51fdf4);})[_0x5ac6('0x17')](function(_0x2c02f7){logger['error']('GetCampaign',_0x2c02f7[_0x5ac6('0x15')],_0x2e62d9);_0x3759dd(_0x3a88a1['error'](0x1f4,_0x2c02f7[_0x5ac6('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 4f3b307..de4990f 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 _0xe306=['/:id/hoppers','isAuthenticated','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addBlackLists','put','/:id/lists','removeLists','delete','removeBlackLists','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./campaign.controller','index','get','/:id','show'];(function(_0x4b05d0,_0x6e2c9c){var _0x4b8be0=function(_0x2c7102){while(--_0x2c7102){_0x4b05d0['push'](_0x4b05d0['shift']());}};_0x4b8be0(++_0x6e2c9c);}(_0xe306,0x180));var _0x6e30=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xe306[_0x521929];return _0x632436;};'use strict';var multer=require(_0x6e30('0x0'));var util=require(_0x6e30('0x1'));var path=require(_0x6e30('0x2'));var timeout=require(_0x6e30('0x3'));var express=require(_0x6e30('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6e30('0x5'));var interaction=require(_0x6e30('0x6'));var config=require('../../config/environment');var controller=require(_0x6e30('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6e30('0x8')]);router[_0x6e30('0x9')](_0x6e30('0xa'),auth['isAuthenticated'](),controller[_0x6e30('0xb')]);router[_0x6e30('0x9')](_0x6e30('0xc'),auth[_0x6e30('0xd')](),controller[_0x6e30('0xe')]);router[_0x6e30('0x9')](_0x6e30('0xf'),auth[_0x6e30('0xd')](),controller[_0x6e30('0x10')]);router[_0x6e30('0x9')](_0x6e30('0x11'),auth['isAuthenticated'](),controller[_0x6e30('0x12')]);router[_0x6e30('0x9')](_0x6e30('0x13'),auth[_0x6e30('0xd')](),controller['getHopperBlacks']);router[_0x6e30('0x9')]('/:id/lists',auth[_0x6e30('0xd')](),controller[_0x6e30('0x14')]);router[_0x6e30('0x9')](_0x6e30('0x15'),auth['isAuthenticated'](),controller[_0x6e30('0x16')]);router[_0x6e30('0x17')]('/',auth[_0x6e30('0xd')](),controller[_0x6e30('0x18')]);router[_0x6e30('0x17')](_0x6e30('0x19'),auth[_0x6e30('0xd')](),controller['clone']);router[_0x6e30('0x17')]('/:id/lists',auth['isAuthenticated'](),controller['addLists']);router['post'](_0x6e30('0x15'),auth['isAuthenticated'](),controller[_0x6e30('0x1a')]);router[_0x6e30('0x1b')](_0x6e30('0xa'),auth[_0x6e30('0xd')](),controller['update']);router['delete']('/:id',auth[_0x6e30('0xd')](),controller['destroy']);router['delete'](_0x6e30('0x1c'),auth[_0x6e30('0xd')](),controller[_0x6e30('0x1d')]);router[_0x6e30('0x1e')](_0x6e30('0x15'),auth[_0x6e30('0xd')](),controller[_0x6e30('0x1f')]);module[_0x6e30('0x20')]=router;
\ No newline at end of file
+var _0x93b3=['/:id/blacklists','create','/:id/clone','post','addLists','addBlackLists','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getLists'];(function(_0x3521b1,_0x19755a){var _0x35d82d=function(_0x19dafc){while(--_0x19dafc){_0x3521b1['push'](_0x3521b1['shift']());}};_0x35d82d(++_0x19755a);}(_0x93b3,0x1c6));var _0x393b=function(_0x1c97c8,_0x28d564){_0x1c97c8=_0x1c97c8-0x0;var _0x2c096d=_0x93b3[_0x1c97c8];return _0x2c096d;};'use strict';var multer=require(_0x393b('0x0'));var util=require(_0x393b('0x1'));var path=require(_0x393b('0x2'));var timeout=require(_0x393b('0x3'));var express=require('express');var router=express[_0x393b('0x4')]();var fs_extra=require(_0x393b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x393b('0x6'));var config=require(_0x393b('0x7'));var controller=require(_0x393b('0x8'));router[_0x393b('0x9')]('/',auth[_0x393b('0xa')](),controller['index']);router[_0x393b('0x9')](_0x393b('0xb'),auth[_0x393b('0xa')](),controller[_0x393b('0xc')]);router[_0x393b('0x9')](_0x393b('0xd'),auth[_0x393b('0xa')](),controller[_0x393b('0xe')]);router[_0x393b('0x9')](_0x393b('0xf'),auth[_0x393b('0xa')](),controller[_0x393b('0x10')]);router['get'](_0x393b('0x11'),auth[_0x393b('0xa')](),controller[_0x393b('0x12')]);router[_0x393b('0x9')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x393b('0x13')]);router[_0x393b('0x9')](_0x393b('0x14'),auth[_0x393b('0xa')](),controller[_0x393b('0x15')]);router[_0x393b('0x9')](_0x393b('0x16'),auth[_0x393b('0xa')](),controller['getBlackLists']);router['post']('/',auth[_0x393b('0xa')](),controller[_0x393b('0x17')]);router['post'](_0x393b('0x18'),auth[_0x393b('0xa')](),controller['clone']);router[_0x393b('0x19')](_0x393b('0x14'),auth[_0x393b('0xa')](),controller[_0x393b('0x1a')]);router[_0x393b('0x19')]('/:id/blacklists',auth[_0x393b('0xa')](),controller[_0x393b('0x1b')]);router['put'](_0x393b('0xb'),auth[_0x393b('0xa')](),controller[_0x393b('0x1c')]);router[_0x393b('0x1d')](_0x393b('0xb'),auth[_0x393b('0xa')](),controller[_0x393b('0x1e')]);router['delete'](_0x393b('0x14'),auth[_0x393b('0xa')](),controller[_0x393b('0x1f')]);router['delete'](_0x393b('0x16'),auth['isAuthenticated'](),controller[_0x393b('0x20')]);module[_0x393b('0x21')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 6c36d09..c085e3e 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 _0xbacf=['sequelize','exports','STRING','getDataValue'];(function(_0x27a5bb,_0x3f4cfb){var _0x2e17ea=function(_0x22912d){while(--_0x22912d){_0x27a5bb['push'](_0x27a5bb['shift']());}};_0x2e17ea(++_0x3f4cfb);}(_0xbacf,0x6c));var _0xfbac=function(_0x999b85,_0x1edc2b){_0x999b85=_0x999b85-0x0;var _0x1d7124=_0xbacf[_0x999b85];return _0x1d7124;};'use strict';var Sequelize=require(_0xfbac('0x0'));module[_0xfbac('0x1')]={'key':{'type':Sequelize[_0xfbac('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xfbac('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xfbac('0x3')]('key');}}};
\ No newline at end of file
+var _0x1cf7=['sequelize','exports','STRING','getDataValue'];(function(_0x2df523,_0x11b09e){var _0x43f919=function(_0x53c3d6){while(--_0x53c3d6){_0x2df523['push'](_0x2df523['shift']());}};_0x43f919(++_0x11b09e);}(_0x1cf7,0x68));var _0x71cf=function(_0x303de5,_0x4d510c){_0x303de5=_0x303de5-0x0;var _0x9d6e42=_0x1cf7[_0x303de5];return _0x9d6e42;};'use strict';var Sequelize=require(_0x71cf('0x0'));module[_0x71cf('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x71cf('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x71cf('0x3')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 1c6b522..c769168 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 _0xe940=['moment','util','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','end','status','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','stack','name','send','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','params','keys','length','includeAll','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x2a63bd,_0x2974e7){var _0x416d78=function(_0x1bbf83){while(--_0x1bbf83){_0x2a63bd['push'](_0x2a63bd['shift']());}};_0x416d78(++_0x2974e7);}(_0xe940,0x1af));var _0x0e94=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe940[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0e94('0x0'));var zipdir=require(_0x0e94('0x1'));var jsonpatch=require(_0x0e94('0x2'));var rp=require(_0x0e94('0x3'));var moment=require(_0x0e94('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0e94('0x5'));var path=require('path');var sox=require(_0x0e94('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0e94('0x7'));var _=require(_0x0e94('0x8'));var squel=require('squel');var crypto=require(_0x0e94('0x9'));var jsforce=require(_0x0e94('0xa'));var deskjs=require(_0x0e94('0xb'));var toCsv=require(_0x0e94('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0e94('0xd'));var authService=require(_0x0e94('0xe'));var qs=require(_0x0e94('0xf'));var as=require(_0x0e94('0x10'));var hardwareService=require(_0x0e94('0x11'));var logger=require('../../config/logger')(_0x0e94('0x12'));var utils=require(_0x0e94('0x13'));var config=require(_0x0e94('0x14'));var licenseUtil=require(_0x0e94('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa30021,_0x2aa48c){_0x2aa48c=_0x2aa48c||0xcc;return function(_0x59b042){if(_0x59b042){return _0xa30021['sendStatus'](_0x2aa48c);}return _0xa30021['status'](_0x2aa48c)[_0x0e94('0x16')]();};}function respondWithResult(_0x45b5ab,_0x4b8897){_0x4b8897=_0x4b8897||0xc8;return function(_0x80a14c){if(_0x80a14c){return _0x45b5ab[_0x0e94('0x17')](_0x4b8897)['json'](_0x80a14c);}};}function respondWithFilteredResult(_0x5f42e0,_0x21b36b){return function(_0x31be23){if(_0x31be23){var _0x1ee020=typeof _0x21b36b[_0x0e94('0x18')]===_0x0e94('0x19')&&typeof _0x21b36b['limit']===_0x0e94('0x19');var _0x34e116=_0x31be23[_0x0e94('0x1a')];var _0x5d5dec=_0x1ee020?0x0:_0x21b36b[_0x0e94('0x18')];var _0x4fae1d=_0x1ee020?_0x31be23[_0x0e94('0x1a')]:_0x21b36b['offset']+_0x21b36b[_0x0e94('0x1b')];var _0x116dab;if(_0x4fae1d>=_0x34e116){_0x4fae1d=_0x34e116;_0x116dab=0xc8;}else{_0x116dab=0xce;}_0x5f42e0[_0x0e94('0x17')](_0x116dab);return _0x5f42e0[_0x0e94('0x1c')](_0x0e94('0x1d'),_0x5d5dec+'-'+_0x4fae1d+'/'+_0x34e116)['json'](_0x31be23);}return null;};}function patchUpdates(_0x5f3bad){return function(_0x5a6c45){try{jsonpatch[_0x0e94('0x1e')](_0x5a6c45,_0x5f3bad,!![]);}catch(_0x1a1630){return BPromise[_0x0e94('0x1f')](_0x1a1630);}return _0x5a6c45[_0x0e94('0x20')]();};}function saveUpdates(_0x536e8a,_0x3bdb4f){return function(_0x8093c1){if(_0x8093c1){return _0x8093c1[_0x0e94('0x21')](_0x536e8a)[_0x0e94('0x22')](function(_0x1bb2fa){return _0x1bb2fa;});}return null;};}function removeEntity(_0x49c54a,_0x12833e){return function(_0x1e6348){if(_0x1e6348){return _0x1e6348[_0x0e94('0x23')]()[_0x0e94('0x22')](function(){var _0x4eccc0=_0x1e6348[_0x0e94('0x24')]({'plain':!![]});var _0xfd2c6d=_0x0e94('0x25');return db[_0x0e94('0x26')][_0x0e94('0x23')]({'where':{'type':_0xfd2c6d,'resourceId':_0x4eccc0['id']}})[_0x0e94('0x22')](function(){return _0x1e6348;});})['then'](function(){_0x49c54a[_0x0e94('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe5e03f,_0x1c04c6){return function(_0x295e72){if(!_0x295e72){_0xe5e03f[_0x0e94('0x27')](0x194);}return _0x295e72;};}function handleError(_0x4e8c6f,_0x375ad3){_0x375ad3=_0x375ad3||0x1f4;return function(_0x9daf63){logger['error'](_0x9daf63[_0x0e94('0x28')]);if(_0x9daf63[_0x0e94('0x29')]){delete _0x9daf63[_0x0e94('0x29')];}_0x4e8c6f[_0x0e94('0x17')](_0x375ad3)[_0x0e94('0x2a')](_0x9daf63);};}exports['index']=function(_0x32d75a,_0x416087){var _0x1f116a={},_0x2f97d6={},_0x463545={'count':0x0,'rows':[]};var _0x58b4ab=_[_0x0e94('0x2b')](db[_0x0e94('0x2c')][_0x0e94('0x2d')],function(_0x16dec1){return{'name':_0x16dec1[_0x0e94('0x2e')],'type':_0x16dec1[_0x0e94('0x2f')][_0x0e94('0x30')]};});_0x2f97d6[_0x0e94('0x31')]=_['map'](_0x58b4ab,'name');_0x2f97d6[_0x0e94('0x32')]=_['keys'](_0x32d75a[_0x0e94('0x32')]);_0x2f97d6[_0x0e94('0x33')]=_['intersection'](_0x2f97d6[_0x0e94('0x31')],_0x2f97d6[_0x0e94('0x32')]);_0x1f116a[_0x0e94('0x34')]=_[_0x0e94('0x35')](_0x2f97d6[_0x0e94('0x31')],qs['fields'](_0x32d75a['query'][_0x0e94('0x36')]));_0x1f116a[_0x0e94('0x34')]=_0x1f116a['attributes']['length']?_0x1f116a[_0x0e94('0x34')]:_0x2f97d6['model'];if(!_0x32d75a['query']['hasOwnProperty'](_0x0e94('0x37'))){_0x1f116a[_0x0e94('0x1b')]=qs[_0x0e94('0x1b')](_0x32d75a[_0x0e94('0x32')]['limit']);_0x1f116a[_0x0e94('0x18')]=qs[_0x0e94('0x18')](_0x32d75a[_0x0e94('0x32')][_0x0e94('0x18')]);}_0x1f116a[_0x0e94('0x38')]=qs[_0x0e94('0x39')](_0x32d75a[_0x0e94('0x32')][_0x0e94('0x39')]);_0x1f116a[_0x0e94('0x3a')]=qs['filters'](_[_0x0e94('0x3b')](_0x32d75a['query'],_0x2f97d6[_0x0e94('0x33')]),_0x58b4ab);if(_0x32d75a[_0x0e94('0x32')][_0x0e94('0x3c')]){_0x1f116a['where']=_[_0x0e94('0x3d')](_0x1f116a[_0x0e94('0x3a')],{'$or':[{'key':{'$like':'%'+_0x32d75a[_0x0e94('0x32')][_0x0e94('0x3c')]+'%'}},{'value':{'$like':'%'+_0x32d75a[_0x0e94('0x32')][_0x0e94('0x3c')]+'%'}}]});}_0x1f116a=_[_0x0e94('0x3d')]({},_0x1f116a,_0x32d75a[_0x0e94('0x3e')]);var _0x22abff={'where':_0x1f116a[_0x0e94('0x3a')]};return db[_0x0e94('0x2c')][_0x0e94('0x1a')](_0x22abff)['then'](function(_0x1c3b13){_0x463545[_0x0e94('0x1a')]=_0x1c3b13;if(_0x32d75a['query']['includeAll']){_0x1f116a[_0x0e94('0x3f')]=[{'all':!![]}];}return db[_0x0e94('0x2c')][_0x0e94('0x40')](_0x1f116a);})['then'](function(_0x11037c){_0x463545[_0x0e94('0x41')]=_0x11037c;return _0x463545;})['then'](respondWithFilteredResult(_0x416087,_0x1f116a))[_0x0e94('0x42')](handleError(_0x416087,null));};exports['show']=function(_0x4eb650,_0x4b6963){var _0x4cac6a={'raw':!![],'where':{'id':_0x4eb650[_0x0e94('0x43')]['id']}},_0x2890dc={};_0x2890dc[_0x0e94('0x31')]=_[_0x0e94('0x44')](db['CannedAnswer'][_0x0e94('0x2d')]);_0x2890dc['query']=_[_0x0e94('0x44')](_0x4eb650[_0x0e94('0x32')]);_0x2890dc[_0x0e94('0x33')]=_[_0x0e94('0x35')](_0x2890dc[_0x0e94('0x31')],_0x2890dc[_0x0e94('0x32')]);_0x4cac6a[_0x0e94('0x34')]=_[_0x0e94('0x35')](_0x2890dc[_0x0e94('0x31')],qs[_0x0e94('0x36')](_0x4eb650[_0x0e94('0x32')][_0x0e94('0x36')]));_0x4cac6a['attributes']=_0x4cac6a[_0x0e94('0x34')][_0x0e94('0x45')]?_0x4cac6a[_0x0e94('0x34')]:_0x2890dc[_0x0e94('0x31')];if(_0x4eb650[_0x0e94('0x32')][_0x0e94('0x46')]){_0x4cac6a['include']=[{'all':!![]}];}_0x4cac6a=_[_0x0e94('0x3d')]({},_0x4cac6a,_0x4eb650[_0x0e94('0x3e')]);return db[_0x0e94('0x2c')][_0x0e94('0x47')](_0x4cac6a)[_0x0e94('0x22')](handleEntityNotFound(_0x4b6963,null))['then'](respondWithResult(_0x4b6963,null))[_0x0e94('0x42')](handleError(_0x4b6963,null));};exports[_0x0e94('0x21')]=function(_0x39b36d,_0x43b231){if(_0x39b36d['body']['id']){delete _0x39b36d['body']['id'];}return db[_0x0e94('0x2c')][_0x0e94('0x47')]({'where':{'id':_0x39b36d[_0x0e94('0x43')]['id']}})[_0x0e94('0x22')](handleEntityNotFound(_0x43b231,null))['then'](saveUpdates(_0x39b36d['body'],null))[_0x0e94('0x22')](respondWithResult(_0x43b231,null))['catch'](handleError(_0x43b231,null));};exports[_0x0e94('0x23')]=function(_0x27e1a3,_0x47f84b){return db['CannedAnswer'][_0x0e94('0x47')]({'where':{'id':_0x27e1a3[_0x0e94('0x43')]['id']}})['then'](handleEntityNotFound(_0x47f84b,null))['then'](removeEntity(_0x47f84b,null))[_0x0e94('0x42')](handleError(_0x47f84b,null));};exports['create']=function(_0x17a4a2,_0x55e757){var _0x2bf0dd={'key':_0x17a4a2['body']['key']};if(_0x17a4a2[_0x0e94('0x48')][_0x0e94('0x49')]){_0x2bf0dd[_0x0e94('0x49')]=_0x17a4a2[_0x0e94('0x48')][_0x0e94('0x49')];}else if(_0x17a4a2['body'][_0x0e94('0x4a')]){_0x2bf0dd['SmsAccountId']=_0x17a4a2[_0x0e94('0x48')]['SmsAccountId'];}else if(_0x17a4a2[_0x0e94('0x48')][_0x0e94('0x4b')]){_0x2bf0dd[_0x0e94('0x4b')]=_0x17a4a2[_0x0e94('0x48')][_0x0e94('0x4b')];}else if(_0x17a4a2[_0x0e94('0x48')][_0x0e94('0x4c')]){_0x2bf0dd['ChatWebsiteId']=_0x17a4a2[_0x0e94('0x48')][_0x0e94('0x4c')];}return db[_0x0e94('0x2c')][_0x0e94('0x47')]({'where':_0x2bf0dd})['then'](function(_0xc92e60){if(_0xc92e60){throw new db[(_0x0e94('0x4d'))][(_0x0e94('0x4e'))](_0x0e94('0x4f'));}return db[_0x0e94('0x2c')][_0x0e94('0x50')](_0x17a4a2[_0x0e94('0x48')]);})['then'](function(_0x3d2d00){var _0x553332=_0x17a4a2[_0x0e94('0x51')][_0x0e94('0x24')]({'plain':!![]});if(!_0x553332)throw new Error(_0x0e94('0x52'));if(_0x553332[_0x0e94('0x53')]==='user'){var _0x5e2f2e=_0x3d2d00[_0x0e94('0x24')]({'plain':!![]});return db['UserProfileSection'][_0x0e94('0x47')]({'where':{'name':_0x0e94('0x25'),'userProfileId':_0x553332[_0x0e94('0x54')]},'raw':!![]})[_0x0e94('0x22')](function(_0x4ab43){if(_0x4ab43&&_0x4ab43[_0x0e94('0x55')]===0x0){return db['UserProfileResource'][_0x0e94('0x50')]({'name':_0x5e2f2e[_0x0e94('0x29')],'resourceId':_0x5e2f2e['id'],'type':_0x4ab43['name'],'sectionId':_0x4ab43['id']},{})[_0x0e94('0x22')](function(){return _0x3d2d00;});}else{return _0x3d2d00;}})[_0x0e94('0x42')](function(_0x3464e9){logger['error'](_0x0e94('0x56'),_0x3464e9);throw _0x3464e9;});}return _0x3d2d00;})[_0x0e94('0x22')](respondWithResult(_0x55e757,0xc9))[_0x0e94('0x42')](handleError(_0x55e757,null));};
\ No newline at end of file
+var _0xa7c0=['../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','get','CannedAnswers','destroy','end','error','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','rows','catch','show','params','find','update','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','moment','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x4d7a61,_0x3fb6e6){var _0x186f73=function(_0x4eeeeb){while(--_0x4eeeeb){_0x4d7a61['push'](_0x4d7a61['shift']());}};_0x186f73(++_0x3fb6e6);}(_0xa7c0,0x9e));var _0x0a7c=function(_0x56a200,_0x4f3117){_0x56a200=_0x56a200-0x0;var _0x16f4e0=_0xa7c0[_0x56a200];return _0x16f4e0;};'use strict';var emlformat=require(_0x0a7c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0a7c('0x1'));var jsonpatch=require(_0x0a7c('0x2'));var rp=require('request-promise');var moment=require(_0x0a7c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a7c('0x4'));var util=require(_0x0a7c('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x0a7c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a7c('0x7'));var _=require(_0x0a7c('0x8'));var squel=require(_0x0a7c('0x9'));var crypto=require(_0x0a7c('0xa'));var jsforce=require(_0x0a7c('0xb'));var deskjs=require(_0x0a7c('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0a7c('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x0a7c('0xe'));var as=require(_0x0a7c('0xf'));var hardwareService=require(_0x0a7c('0x10'));var logger=require(_0x0a7c('0x11'))(_0x0a7c('0x12'));var utils=require(_0x0a7c('0x13'));var config=require(_0x0a7c('0x14'));var licenseUtil=require(_0x0a7c('0x15'));var db=require(_0x0a7c('0x16'))['db'];function respondWithStatusCode(_0x50e3a5,_0x4d3a31){_0x4d3a31=_0x4d3a31||0xcc;return function(_0x1d3ee3){if(_0x1d3ee3){return _0x50e3a5[_0x0a7c('0x17')](_0x4d3a31);}return _0x50e3a5['status'](_0x4d3a31)['end']();};}function respondWithResult(_0x47e829,_0x1bacf1){_0x1bacf1=_0x1bacf1||0xc8;return function(_0x4df775){if(_0x4df775){return _0x47e829[_0x0a7c('0x18')](_0x1bacf1)[_0x0a7c('0x19')](_0x4df775);}};}function respondWithFilteredResult(_0x42044f,_0x1bd4e0){return function(_0x110afd){if(_0x110afd){var _0xbd1c53=typeof _0x1bd4e0[_0x0a7c('0x1a')]===_0x0a7c('0x1b')&&typeof _0x1bd4e0[_0x0a7c('0x1c')]==='undefined';var _0x3841a9=_0x110afd['count'];var _0x44a9c7=_0xbd1c53?0x0:_0x1bd4e0['offset'];var _0x353ae2=_0xbd1c53?_0x110afd[_0x0a7c('0x1d')]:_0x1bd4e0['offset']+_0x1bd4e0[_0x0a7c('0x1c')];var _0x3f6bd4;if(_0x353ae2>=_0x3841a9){_0x353ae2=_0x3841a9;_0x3f6bd4=0xc8;}else{_0x3f6bd4=0xce;}_0x42044f['status'](_0x3f6bd4);return _0x42044f[_0x0a7c('0x1e')](_0x0a7c('0x1f'),_0x44a9c7+'-'+_0x353ae2+'/'+_0x3841a9)['json'](_0x110afd);}return null;};}function patchUpdates(_0x7f14e9){return function(_0x4c8f91){try{jsonpatch[_0x0a7c('0x20')](_0x4c8f91,_0x7f14e9,!![]);}catch(_0xf40e15){return BPromise['reject'](_0xf40e15);}return _0x4c8f91[_0x0a7c('0x21')]();};}function saveUpdates(_0x3c4058,_0x4ba972){return function(_0x2b3346){if(_0x2b3346){return _0x2b3346['update'](_0x3c4058)[_0x0a7c('0x22')](function(_0x21ae2b){return _0x21ae2b;});}return null;};}function removeEntity(_0x1c61b9,_0x202c09){return function(_0x2dbb7d){if(_0x2dbb7d){return _0x2dbb7d['destroy']()[_0x0a7c('0x22')](function(){var _0x41d945=_0x2dbb7d[_0x0a7c('0x23')]({'plain':!![]});var _0x1ad857=_0x0a7c('0x24');return db['UserProfileResource'][_0x0a7c('0x25')]({'where':{'type':_0x1ad857,'resourceId':_0x41d945['id']}})['then'](function(){return _0x2dbb7d;});})[_0x0a7c('0x22')](function(){_0x1c61b9[_0x0a7c('0x18')](0xcc)[_0x0a7c('0x26')]();});}};}function handleEntityNotFound(_0x42073e,_0x25ece3){return function(_0x4831d2){if(!_0x4831d2){_0x42073e[_0x0a7c('0x17')](0x194);}return _0x4831d2;};}function handleError(_0x5d1770,_0x589d36){_0x589d36=_0x589d36||0x1f4;return function(_0x1e9243){logger[_0x0a7c('0x27')](_0x1e9243[_0x0a7c('0x28')]);if(_0x1e9243[_0x0a7c('0x29')]){delete _0x1e9243[_0x0a7c('0x29')];}_0x5d1770[_0x0a7c('0x18')](_0x589d36)[_0x0a7c('0x2a')](_0x1e9243);};}exports[_0x0a7c('0x2b')]=function(_0x428f35,_0x267052){var _0x37c6e7={},_0x15e691={},_0x1cdbfe={'count':0x0,'rows':[]};var _0x2db58e=_['map'](db[_0x0a7c('0x2c')][_0x0a7c('0x2d')],function(_0x23efc7){return{'name':_0x23efc7[_0x0a7c('0x2e')],'type':_0x23efc7[_0x0a7c('0x2f')][_0x0a7c('0x30')]};});_0x15e691['model']=_[_0x0a7c('0x31')](_0x2db58e,'name');_0x15e691[_0x0a7c('0x32')]=_[_0x0a7c('0x33')](_0x428f35[_0x0a7c('0x32')]);_0x15e691[_0x0a7c('0x34')]=_[_0x0a7c('0x35')](_0x15e691['model'],_0x15e691[_0x0a7c('0x32')]);_0x37c6e7['attributes']=_['intersection'](_0x15e691[_0x0a7c('0x36')],qs['fields'](_0x428f35[_0x0a7c('0x32')][_0x0a7c('0x37')]));_0x37c6e7['attributes']=_0x37c6e7[_0x0a7c('0x38')][_0x0a7c('0x39')]?_0x37c6e7[_0x0a7c('0x38')]:_0x15e691[_0x0a7c('0x36')];if(!_0x428f35['query'][_0x0a7c('0x3a')](_0x0a7c('0x3b'))){_0x37c6e7[_0x0a7c('0x1c')]=qs[_0x0a7c('0x1c')](_0x428f35['query'][_0x0a7c('0x1c')]);_0x37c6e7[_0x0a7c('0x1a')]=qs[_0x0a7c('0x1a')](_0x428f35[_0x0a7c('0x32')][_0x0a7c('0x1a')]);}_0x37c6e7[_0x0a7c('0x3c')]=qs[_0x0a7c('0x3d')](_0x428f35[_0x0a7c('0x32')][_0x0a7c('0x3d')]);_0x37c6e7[_0x0a7c('0x3e')]=qs[_0x0a7c('0x34')](_[_0x0a7c('0x3f')](_0x428f35['query'],_0x15e691[_0x0a7c('0x34')]),_0x2db58e);if(_0x428f35[_0x0a7c('0x32')]['filter']){_0x37c6e7[_0x0a7c('0x3e')]=_[_0x0a7c('0x40')](_0x37c6e7[_0x0a7c('0x3e')],{'$or':[{'key':{'$like':'%'+_0x428f35[_0x0a7c('0x32')][_0x0a7c('0x41')]+'%'}},{'value':{'$like':'%'+_0x428f35[_0x0a7c('0x32')][_0x0a7c('0x41')]+'%'}}]});}_0x37c6e7=_['merge']({},_0x37c6e7,_0x428f35[_0x0a7c('0x42')]);var _0x10507d={'where':_0x37c6e7[_0x0a7c('0x3e')]};return db[_0x0a7c('0x2c')][_0x0a7c('0x1d')](_0x10507d)[_0x0a7c('0x22')](function(_0x346468){_0x1cdbfe['count']=_0x346468;if(_0x428f35['query'][_0x0a7c('0x43')]){_0x37c6e7[_0x0a7c('0x44')]=[{'all':!![]}];}return db[_0x0a7c('0x2c')]['findAll'](_0x37c6e7);})['then'](function(_0x49b815){_0x1cdbfe[_0x0a7c('0x45')]=_0x49b815;return _0x1cdbfe;})['then'](respondWithFilteredResult(_0x267052,_0x37c6e7))[_0x0a7c('0x46')](handleError(_0x267052,null));};exports[_0x0a7c('0x47')]=function(_0x4c37c3,_0x9e5b7){var _0x29c673={'raw':!![],'where':{'id':_0x4c37c3[_0x0a7c('0x48')]['id']}},_0x26f550={};_0x26f550['model']=_[_0x0a7c('0x33')](db[_0x0a7c('0x2c')][_0x0a7c('0x2d')]);_0x26f550[_0x0a7c('0x32')]=_[_0x0a7c('0x33')](_0x4c37c3[_0x0a7c('0x32')]);_0x26f550[_0x0a7c('0x34')]=_[_0x0a7c('0x35')](_0x26f550['model'],_0x26f550[_0x0a7c('0x32')]);_0x29c673[_0x0a7c('0x38')]=_['intersection'](_0x26f550[_0x0a7c('0x36')],qs[_0x0a7c('0x37')](_0x4c37c3[_0x0a7c('0x32')][_0x0a7c('0x37')]));_0x29c673['attributes']=_0x29c673[_0x0a7c('0x38')]['length']?_0x29c673['attributes']:_0x26f550[_0x0a7c('0x36')];if(_0x4c37c3[_0x0a7c('0x32')]['includeAll']){_0x29c673[_0x0a7c('0x44')]=[{'all':!![]}];}_0x29c673=_[_0x0a7c('0x40')]({},_0x29c673,_0x4c37c3['options']);return db['CannedAnswer'][_0x0a7c('0x49')](_0x29c673)[_0x0a7c('0x22')](handleEntityNotFound(_0x9e5b7,null))['then'](respondWithResult(_0x9e5b7,null))[_0x0a7c('0x46')](handleError(_0x9e5b7,null));};exports[_0x0a7c('0x4a')]=function(_0x349af3,_0x5e4b91){if(_0x349af3[_0x0a7c('0x4b')]['id']){delete _0x349af3['body']['id'];}return db[_0x0a7c('0x2c')]['find']({'where':{'id':_0x349af3[_0x0a7c('0x48')]['id']}})[_0x0a7c('0x22')](handleEntityNotFound(_0x5e4b91,null))[_0x0a7c('0x22')](saveUpdates(_0x349af3['body'],null))[_0x0a7c('0x22')](respondWithResult(_0x5e4b91,null))['catch'](handleError(_0x5e4b91,null));};exports[_0x0a7c('0x25')]=function(_0xae90c7,_0x2580f4){return db['CannedAnswer'][_0x0a7c('0x49')]({'where':{'id':_0xae90c7[_0x0a7c('0x48')]['id']}})['then'](handleEntityNotFound(_0x2580f4,null))[_0x0a7c('0x22')](removeEntity(_0x2580f4,null))['catch'](handleError(_0x2580f4,null));};exports['create']=function(_0x5be837,_0xdd6652){var _0x8e6bfa={'key':_0x5be837[_0x0a7c('0x4b')][_0x0a7c('0x30')]};if(_0x5be837['body'][_0x0a7c('0x4c')]){_0x8e6bfa[_0x0a7c('0x4c')]=_0x5be837[_0x0a7c('0x4b')][_0x0a7c('0x4c')];}else if(_0x5be837['body'][_0x0a7c('0x4d')]){_0x8e6bfa['SmsAccountId']=_0x5be837[_0x0a7c('0x4b')][_0x0a7c('0x4d')];}else if(_0x5be837[_0x0a7c('0x4b')][_0x0a7c('0x4e')]){_0x8e6bfa['OpenchannelAccountId']=_0x5be837[_0x0a7c('0x4b')][_0x0a7c('0x4e')];}else if(_0x5be837['body'][_0x0a7c('0x4f')]){_0x8e6bfa[_0x0a7c('0x4f')]=_0x5be837[_0x0a7c('0x4b')]['ChatWebsiteId'];}return db[_0x0a7c('0x2c')]['find']({'where':_0x8e6bfa})[_0x0a7c('0x22')](function(_0xab411){if(_0xab411){throw new db['Sequelize']['ValidationError'](_0x0a7c('0x50'));}return db[_0x0a7c('0x2c')][_0x0a7c('0x51')](_0x5be837['body']);})[_0x0a7c('0x22')](function(_0x5ae88b){var _0x232a58=_0x5be837[_0x0a7c('0x52')]['get']({'plain':!![]});if(!_0x232a58)throw new Error(_0x0a7c('0x53'));if(_0x232a58[_0x0a7c('0x54')]===_0x0a7c('0x52')){var _0x4000d9=_0x5ae88b['get']({'plain':!![]});return db[_0x0a7c('0x55')][_0x0a7c('0x49')]({'where':{'name':_0x0a7c('0x24'),'userProfileId':_0x232a58[_0x0a7c('0x56')]},'raw':!![]})[_0x0a7c('0x22')](function(_0x58ba59){if(_0x58ba59&&_0x58ba59[_0x0a7c('0x57')]===0x0){return db[_0x0a7c('0x58')]['create']({'name':_0x4000d9[_0x0a7c('0x29')],'resourceId':_0x4000d9['id'],'type':_0x58ba59[_0x0a7c('0x29')],'sectionId':_0x58ba59['id']},{})['then'](function(){return _0x5ae88b;});}else{return _0x5ae88b;}})[_0x0a7c('0x46')](function(_0x218d30){logger['error'](_0x0a7c('0x59'),_0x218d30);throw _0x218d30;});}return _0x5ae88b;})[_0x0a7c('0x22')](respondWithResult(_0xdd6652,0xc9))[_0x0a7c('0x46')](handleError(_0xdd6652,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 686f53c..a6fcf37 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 _0x7537=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util'];(function(_0x47e1f7,_0x295566){var _0x4687b3=function(_0x3d841d){while(--_0x3d841d){_0x47e1f7['push'](_0x47e1f7['shift']());}};_0x4687b3(++_0x295566);}(_0x7537,0x7c));var _0x7753=function(_0x42816e,_0x4d4e12){_0x42816e=_0x42816e-0x0;var _0x4d7c35=_0x7537[_0x42816e];return _0x4d7c35;};'use strict';var _=require(_0x7753('0x0'));var util=require(_0x7753('0x1'));var logger=require(_0x7753('0x2'))(_0x7753('0x3'));var moment=require(_0x7753('0x4'));var BPromise=require(_0x7753('0x5'));var rp=require(_0x7753('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7753('0x7'));var config=require('../../config/environment');var attributes=require(_0x7753('0x8'));module[_0x7753('0x9')]=function(_0x645ea2,_0x495904){return _0x645ea2[_0x7753('0xa')](_0x7753('0xb'),attributes,{'tableName':_0x7753('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7753('0xd')});};
\ No newline at end of file
+var _0x1899=['./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x1899,0x148));var _0x9189=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x1899[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x9189('0x0'));var util=require('util');var logger=require(_0x9189('0x1'))(_0x9189('0x2'));var moment=require(_0x9189('0x3'));var BPromise=require(_0x9189('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9189('0x5'));var rimraf=require(_0x9189('0x6'));var config=require(_0x9189('0x7'));var attributes=require(_0x9189('0x8'));module[_0x9189('0x9')]=function(_0x452750,_0x19394c){return _0x452750['define'](_0x9189('0xa'),attributes,{'tableName':_0x9189('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9189('0xc'),'collate':_0x9189('0xd')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 9dec99b..d04bc26 100644
--- a/server/api/cannedAnswer/cannedAnswer.rpc.js
+++ b/server/api/cannedAnswer/cannedAnswer.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x13aab3,_0x47ae1c){var _0x4520fe=function(_0x46ba7d){while(--_0x46ba7d){_0x13aab3['push'](_0x13aab3['shift']());}};_0x4520fe(++_0x47ae1c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xf02e80,_0x23fae1){var _0x3ecba0=function(_0x15035c){while(--_0x15035c){_0xf02e80['push'](_0xf02e80['shift']());}};_0x3ecba0(++_0x23fae1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index 8ecdb04..889e105 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 _0xdfbd=['multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','destroy','exports'];(function(_0x22fd8d,_0x52ba52){var _0x1fe685=function(_0x17db14){while(--_0x17db14){_0x22fd8d['push'](_0x22fd8d['shift']());}};_0x1fe685(++_0x52ba52);}(_0xdfbd,0xea));var _0xddfb=function(_0x4805b5,_0x546114){_0x4805b5=_0x4805b5-0x0;var _0x28cb53=_0xdfbd[_0x4805b5];return _0x28cb53;};'use strict';var multer=require(_0xddfb('0x0'));var util=require(_0xddfb('0x1'));var path=require(_0xddfb('0x2'));var timeout=require('connect-timeout');var express=require(_0xddfb('0x3'));var router=express[_0xddfb('0x4')]();var fs_extra=require(_0xddfb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xddfb('0x6'));var config=require(_0xddfb('0x7'));var controller=require('./cannedAnswer.controller');router[_0xddfb('0x8')]('/',auth[_0xddfb('0x9')](),controller[_0xddfb('0xa')]);router[_0xddfb('0x8')]('/:id',auth[_0xddfb('0x9')](),controller[_0xddfb('0xb')]);router[_0xddfb('0xc')]('/',auth['isAuthenticated'](),controller[_0xddfb('0xd')]);router[_0xddfb('0xe')](_0xddfb('0xf'),auth[_0xddfb('0x9')](),controller['update']);router['delete'](_0xddfb('0xf'),auth['isAuthenticated'](),controller[_0xddfb('0x10')]);module[_0xddfb('0x11')]=router;
\ No newline at end of file
+var _0x6094=['../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x57878e,_0x2b0acf){var _0xacb6e1=function(_0x9ec3e1){while(--_0x9ec3e1){_0x57878e['push'](_0x57878e['shift']());}};_0xacb6e1(++_0x2b0acf);}(_0x6094,0xc5));var _0x4609=function(_0x5ceb6e,_0x18ecd0){_0x5ceb6e=_0x5ceb6e-0x0;var _0x48cb26=_0x6094[_0x5ceb6e];return _0x48cb26;};'use strict';var multer=require(_0x4609('0x0'));var util=require(_0x4609('0x1'));var path=require(_0x4609('0x2'));var timeout=require(_0x4609('0x3'));var express=require(_0x4609('0x4'));var router=express[_0x4609('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4609('0x6'));var interaction=require(_0x4609('0x7'));var config=require(_0x4609('0x8'));var controller=require('./cannedAnswer.controller');router[_0x4609('0x9')]('/',auth['isAuthenticated'](),controller[_0x4609('0xa')]);router[_0x4609('0x9')](_0x4609('0xb'),auth[_0x4609('0xc')](),controller['show']);router['post']('/',auth[_0x4609('0xc')](),controller[_0x4609('0xd')]);router[_0x4609('0xe')](_0x4609('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x4609('0xf')]('/:id',auth[_0x4609('0xc')](),controller['destroy']);module[_0x4609('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index eec3eb5..b3e922e 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 _0x3d0a=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x12af32,_0x8d8b5a){var _0x27d9e3=function(_0x199cee){while(--_0x199cee){_0x12af32['push'](_0x12af32['shift']());}};_0x27d9e3(++_0x8d8b5a);}(_0x3d0a,0xa9));var _0xa3d0=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x3d0a[_0x5bd426];return _0x23a7eb;};'use strict';var Sequelize=require(_0xa3d0('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xa3d0('0x1')],'allowNull':![],'defaultValue':_0xa3d0('0x2')},'clid':{'type':Sequelize[_0xa3d0('0x3')]},'src':{'type':Sequelize[_0xa3d0('0x3')]},'dst':{'type':Sequelize[_0xa3d0('0x3')]},'dcontext':{'type':Sequelize[_0xa3d0('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xa3d0('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xa3d0('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xa3d0('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xa3d0('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xa3d0('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa3d0('0x3')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x1b0b=['INTEGER','sequelize','exports','DATE','STRING'];(function(_0xf16b1,_0x33c637){var _0x26f94d=function(_0x5643d7){while(--_0x5643d7){_0xf16b1['push'](_0xf16b1['shift']());}};_0x26f94d(++_0x33c637);}(_0x1b0b,0x173));var _0xb1b0=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x1b0b[_0x16b9ed];return _0x66b1f8;};'use strict';var Sequelize=require(_0xb1b0('0x0'));module[_0xb1b0('0x1')]={'calldate':{'type':Sequelize[_0xb1b0('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xb1b0('0x3')]},'src':{'type':Sequelize[_0xb1b0('0x3')]},'dst':{'type':Sequelize[_0xb1b0('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xb1b0('0x3')]},'lastdata':{'type':Sequelize[_0xb1b0('0x3')]},'duration':{'type':Sequelize[_0xb1b0('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xb1b0('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb1b0('0x3')]},'amaflags':{'type':Sequelize[_0xb1b0('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb1b0('0x3')]},'userfield':{'type':Sequelize[_0xb1b0('0x3')]},'uniqueid':{'type':Sequelize[_0xb1b0('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xb1b0('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xb1b0('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index b51cfff..6dcd160 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 _0xa1f6=['error','stack','name','send','index','map','Cdr','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','create','body','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then'];(function(_0x44ca6e,_0x5e2c91){var _0x2edab2=function(_0x3afa91){while(--_0x3afa91){_0x44ca6e['push'](_0x44ca6e['shift']());}};_0x2edab2(++_0x5e2c91);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x3815c2,_0x1f54e3){_0x3815c2=_0x3815c2-0x0;var _0x271f88=_0xa1f6[_0x3815c2];return _0x271f88;};'use strict';var emlformat=require(_0x6a1f('0x0'));var rimraf=require(_0x6a1f('0x1'));var zipdir=require(_0x6a1f('0x2'));var jsonpatch=require(_0x6a1f('0x3'));var rp=require(_0x6a1f('0x4'));var moment=require(_0x6a1f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6a1f('0x6'));var ejs=require(_0x6a1f('0x7'));var fs=require('fs');var fs_extra=require(_0x6a1f('0x8'));var _=require(_0x6a1f('0x9'));var squel=require(_0x6a1f('0xa'));var crypto=require(_0x6a1f('0xb'));var jsforce=require(_0x6a1f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6a1f('0x6'));var querystring=require(_0x6a1f('0xd'));var Papa=require(_0x6a1f('0xe'));var Redis=require(_0x6a1f('0xf'));var authService=require(_0x6a1f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6a1f('0x11'));var hardwareService=require(_0x6a1f('0x12'));var logger=require(_0x6a1f('0x13'))(_0x6a1f('0x14'));var utils=require('../../config/utils');var config=require(_0x6a1f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6a1f('0x16'))['db'];function respondWithStatusCode(_0x17edb6,_0x2a4e94){_0x2a4e94=_0x2a4e94||0xcc;return function(_0x442576){if(_0x442576){return _0x17edb6[_0x6a1f('0x17')](_0x2a4e94);}return _0x17edb6[_0x6a1f('0x18')](_0x2a4e94)[_0x6a1f('0x19')]();};}function respondWithResult(_0x8c3a36,_0x1918c6){_0x1918c6=_0x1918c6||0xc8;return function(_0x27d8f8){if(_0x27d8f8){return _0x8c3a36[_0x6a1f('0x18')](_0x1918c6)[_0x6a1f('0x1a')](_0x27d8f8);}};}function respondWithFilteredResult(_0x253305,_0x2677c1){return function(_0x14ecec){if(_0x14ecec){var _0x11ee0e=typeof _0x2677c1[_0x6a1f('0x1b')]===_0x6a1f('0x1c')&&typeof _0x2677c1[_0x6a1f('0x1d')]==='undefined';var _0x392ccb=_0x14ecec[_0x6a1f('0x1e')];var _0x1ccbed=_0x11ee0e?0x0:_0x2677c1[_0x6a1f('0x1b')];var _0x21d268=_0x11ee0e?_0x14ecec[_0x6a1f('0x1e')]:_0x2677c1[_0x6a1f('0x1b')]+_0x2677c1[_0x6a1f('0x1d')];var _0x5cb044;if(_0x21d268>=_0x392ccb){_0x21d268=_0x392ccb;_0x5cb044=0xc8;}else{_0x5cb044=0xce;}_0x253305[_0x6a1f('0x18')](_0x5cb044);return _0x253305['set'](_0x6a1f('0x1f'),_0x1ccbed+'-'+_0x21d268+'/'+_0x392ccb)[_0x6a1f('0x1a')](_0x14ecec);}return null;};}function patchUpdates(_0x3c7ed0){return function(_0x1b5856){try{jsonpatch[_0x6a1f('0x20')](_0x1b5856,_0x3c7ed0,!![]);}catch(_0x4eae7f){return BPromise[_0x6a1f('0x21')](_0x4eae7f);}return _0x1b5856[_0x6a1f('0x22')]();};}function saveUpdates(_0xa43cd5,_0x1be0c3){return function(_0x312e75){if(_0x312e75){return _0x312e75[_0x6a1f('0x23')](_0xa43cd5)[_0x6a1f('0x24')](function(_0x2736ab){return _0x2736ab;});}return null;};}function removeEntity(_0x53229b,_0x1eb146){return function(_0x3d953d){if(_0x3d953d){return _0x3d953d['destroy']()['then'](function(){_0x53229b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ea158,_0x5e6013){return function(_0x5abe40){if(!_0x5abe40){_0x3ea158[_0x6a1f('0x17')](0x194);}return _0x5abe40;};}function handleError(_0x286d1d,_0x2b53ca){_0x2b53ca=_0x2b53ca||0x1f4;return function(_0x1e8db8){logger[_0x6a1f('0x25')](_0x1e8db8[_0x6a1f('0x26')]);if(_0x1e8db8[_0x6a1f('0x27')]){delete _0x1e8db8[_0x6a1f('0x27')];}_0x286d1d['status'](_0x2b53ca)[_0x6a1f('0x28')](_0x1e8db8);};}exports[_0x6a1f('0x29')]=function(_0x3f0730,_0x574d80){var _0x1e951c={},_0x155c58={},_0x257cee={'count':0x0,'rows':[]};var _0x113422=_[_0x6a1f('0x2a')](db[_0x6a1f('0x2b')][_0x6a1f('0x2c')],function(_0x58d879){return{'name':_0x58d879['fieldName'],'type':_0x58d879[_0x6a1f('0x2d')][_0x6a1f('0x2e')]};});_0x155c58[_0x6a1f('0x2f')]=_[_0x6a1f('0x2a')](_0x113422,_0x6a1f('0x27'));_0x155c58[_0x6a1f('0x30')]=_[_0x6a1f('0x31')](_0x3f0730['query']);_0x155c58[_0x6a1f('0x32')]=_[_0x6a1f('0x33')](_0x155c58['model'],_0x155c58[_0x6a1f('0x30')]);_0x1e951c[_0x6a1f('0x34')]=_[_0x6a1f('0x33')](_0x155c58['model'],qs['fields'](_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x35')]));_0x1e951c[_0x6a1f('0x34')]=_0x1e951c['attributes']['length']?_0x1e951c[_0x6a1f('0x34')]:_0x155c58[_0x6a1f('0x2f')];if(!_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x36')](_0x6a1f('0x37'))){_0x1e951c[_0x6a1f('0x1d')]=qs[_0x6a1f('0x1d')](_0x3f0730['query'][_0x6a1f('0x1d')]);_0x1e951c['offset']=qs[_0x6a1f('0x1b')](_0x3f0730[_0x6a1f('0x30')]['offset']);}_0x1e951c[_0x6a1f('0x38')]=qs[_0x6a1f('0x39')](_0x3f0730['query'][_0x6a1f('0x39')]);_0x1e951c['where']=qs[_0x6a1f('0x32')](_['pick'](_0x3f0730[_0x6a1f('0x30')],_0x155c58['filters']),_0x113422);if(_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x3a')]){_0x1e951c['where']=_[_0x6a1f('0x3b')](_0x1e951c[_0x6a1f('0x3c')],{'$or':_['map'](_0x113422,function(_0x5beb28){if(_0x5beb28[_0x6a1f('0x2d')]!==_0x6a1f('0x3d')){var _0x314fef={};_0x314fef[_0x5beb28[_0x6a1f('0x27')]]={'$like':'%'+_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x3a')]+'%'};return _0x314fef;}})});}_0x1e951c=_['merge']({},_0x1e951c,_0x3f0730[_0x6a1f('0x3e')]);var _0x2da23a={'where':_0x1e951c[_0x6a1f('0x3c')]};return db[_0x6a1f('0x2b')][_0x6a1f('0x1e')](_0x2da23a)[_0x6a1f('0x24')](function(_0x27be0a){_0x257cee[_0x6a1f('0x1e')]=_0x27be0a;if(_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x3f')]){_0x1e951c[_0x6a1f('0x40')]=[{'all':!![]}];}return db['Cdr'][_0x6a1f('0x41')](_0x1e951c);})[_0x6a1f('0x24')](function(_0x334fc4){_0x257cee[_0x6a1f('0x42')]=_0x334fc4;return _0x257cee;})[_0x6a1f('0x24')](respondWithFilteredResult(_0x574d80,_0x1e951c))[_0x6a1f('0x43')](handleError(_0x574d80,null));};exports['show']=function(_0x211009,_0x482c3a){var _0x3a6f80={'raw':!![],'where':{'id':_0x211009[_0x6a1f('0x44')]['id']}},_0x33208d={};_0x33208d[_0x6a1f('0x2f')]=_[_0x6a1f('0x31')](db[_0x6a1f('0x2b')]['rawAttributes']);_0x33208d[_0x6a1f('0x30')]=_[_0x6a1f('0x31')](_0x211009[_0x6a1f('0x30')]);_0x33208d[_0x6a1f('0x32')]=_[_0x6a1f('0x33')](_0x33208d[_0x6a1f('0x2f')],_0x33208d[_0x6a1f('0x30')]);_0x3a6f80[_0x6a1f('0x34')]=_[_0x6a1f('0x33')](_0x33208d[_0x6a1f('0x2f')],qs['fields'](_0x211009['query']['fields']));_0x3a6f80[_0x6a1f('0x34')]=_0x3a6f80[_0x6a1f('0x34')][_0x6a1f('0x45')]?_0x3a6f80[_0x6a1f('0x34')]:_0x33208d[_0x6a1f('0x2f')];if(_0x211009[_0x6a1f('0x30')]['includeAll']){_0x3a6f80[_0x6a1f('0x40')]=[{'all':!![]}];}_0x3a6f80=_['merge']({},_0x3a6f80,_0x211009[_0x6a1f('0x3e')]);return db[_0x6a1f('0x2b')]['find'](_0x3a6f80)[_0x6a1f('0x24')](handleEntityNotFound(_0x482c3a,null))['then'](respondWithResult(_0x482c3a,null))[_0x6a1f('0x43')](handleError(_0x482c3a,null));};exports[_0x6a1f('0x46')]=function(_0xa864f3,_0x4318fd){return db[_0x6a1f('0x2b')][_0x6a1f('0x46')](_0xa864f3['body'],{})[_0x6a1f('0x24')](respondWithResult(_0x4318fd,0xc9))[_0x6a1f('0x43')](handleError(_0x4318fd,null));};exports[_0x6a1f('0x23')]=function(_0x2bea1a,_0x34fa17){if(_0x2bea1a[_0x6a1f('0x47')]['id']){delete _0x2bea1a[_0x6a1f('0x47')]['id'];}return db[_0x6a1f('0x2b')]['find']({'where':{'id':_0x2bea1a[_0x6a1f('0x44')]['id']}})[_0x6a1f('0x24')](handleEntityNotFound(_0x34fa17,null))[_0x6a1f('0x24')](saveUpdates(_0x2bea1a['body'],null))[_0x6a1f('0x24')](respondWithResult(_0x34fa17,null))['catch'](handleError(_0x34fa17,null));};exports[_0x6a1f('0x48')]=function(_0x52c262,_0x366a60){return db['Cdr'][_0x6a1f('0x49')]({'where':{'id':_0x52c262[_0x6a1f('0x44')]['id']}})[_0x6a1f('0x24')](handleEntityNotFound(_0x366a60,null))['then'](removeEntity(_0x366a60,null))[_0x6a1f('0x43')](handleError(_0x366a60,null));};exports['describe']=function(_0x143873,_0x55d114){return db['Cdr'][_0x6a1f('0x4a')]()[_0x6a1f('0x24')](respondWithResult(_0x55d114,null))['catch'](handleError(_0x55d114,null));};
\ No newline at end of file
+var _0xbeea=['stack','name','index','map','Cdr','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filters','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','length','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','apply','save','update','destroy','then','sendStatus'];(function(_0x5cba0e,_0x4fb1a6){var _0x5e1e19=function(_0x76779c){while(--_0x76779c){_0x5cba0e['push'](_0x5cba0e['shift']());}};_0x5e1e19(++_0x4fb1a6);}(_0xbeea,0xb1));var _0xabee=function(_0x4925de,_0x71d11d){_0x4925de=_0x4925de-0x0;var _0x6683df=_0xbeea[_0x4925de];return _0x6683df;};'use strict';var emlformat=require(_0xabee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xabee('0x1'));var jsonpatch=require(_0xabee('0x2'));var rp=require(_0xabee('0x3'));var moment=require('moment');var BPromise=require(_0xabee('0x4'));var Mustache=require('mustache');var util=require(_0xabee('0x5'));var path=require(_0xabee('0x6'));var sox=require(_0xabee('0x7'));var csv=require(_0xabee('0x8'));var ejs=require(_0xabee('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xabee('0xa'));var crypto=require(_0xabee('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xabee('0xc'));var toCsv=require('to-csv');var querystring=require(_0xabee('0xd'));var Papa=require(_0xabee('0xe'));var Redis=require(_0xabee('0xf'));var authService=require(_0xabee('0x10'));var qs=require(_0xabee('0x11'));var as=require(_0xabee('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xabee('0x13'))(_0xabee('0x14'));var utils=require(_0xabee('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xabee('0x16'));var db=require(_0xabee('0x17'))['db'];function respondWithStatusCode(_0x16d6a5,_0x49fb73){_0x49fb73=_0x49fb73||0xcc;return function(_0x5915a1){if(_0x5915a1){return _0x16d6a5['sendStatus'](_0x49fb73);}return _0x16d6a5['status'](_0x49fb73)['end']();};}function respondWithResult(_0x113c5c,_0x370a4e){_0x370a4e=_0x370a4e||0xc8;return function(_0x38ba29){if(_0x38ba29){return _0x113c5c[_0xabee('0x18')](_0x370a4e)[_0xabee('0x19')](_0x38ba29);}};}function respondWithFilteredResult(_0x5e94ff,_0x177670){return function(_0x2d85a4){if(_0x2d85a4){var _0x2f1107=typeof _0x177670[_0xabee('0x1a')]===_0xabee('0x1b')&&typeof _0x177670[_0xabee('0x1c')]===_0xabee('0x1b');var _0x5a9562=_0x2d85a4[_0xabee('0x1d')];var _0x112bb9=_0x2f1107?0x0:_0x177670[_0xabee('0x1a')];var _0x471b24=_0x2f1107?_0x2d85a4[_0xabee('0x1d')]:_0x177670[_0xabee('0x1a')]+_0x177670['limit'];var _0x47fa3f;if(_0x471b24>=_0x5a9562){_0x471b24=_0x5a9562;_0x47fa3f=0xc8;}else{_0x47fa3f=0xce;}_0x5e94ff[_0xabee('0x18')](_0x47fa3f);return _0x5e94ff['set']('Content-Range',_0x112bb9+'-'+_0x471b24+'/'+_0x5a9562)[_0xabee('0x19')](_0x2d85a4);}return null;};}function patchUpdates(_0x443301){return function(_0x3dd1ff){try{jsonpatch[_0xabee('0x1e')](_0x3dd1ff,_0x443301,!![]);}catch(_0x2b66f5){return BPromise['reject'](_0x2b66f5);}return _0x3dd1ff[_0xabee('0x1f')]();};}function saveUpdates(_0x54014d,_0x4f5501){return function(_0x4926d7){if(_0x4926d7){return _0x4926d7[_0xabee('0x20')](_0x54014d)['then'](function(_0x870569){return _0x870569;});}return null;};}function removeEntity(_0x2834e3,_0x520bc){return function(_0x15a36c){if(_0x15a36c){return _0x15a36c[_0xabee('0x21')]()[_0xabee('0x22')](function(){_0x2834e3[_0xabee('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdbbf57,_0xfc419d){return function(_0x42277e){if(!_0x42277e){_0xdbbf57[_0xabee('0x23')](0x194);}return _0x42277e;};}function handleError(_0x4ae65e,_0x2aa470){_0x2aa470=_0x2aa470||0x1f4;return function(_0x123d58){logger['error'](_0x123d58[_0xabee('0x24')]);if(_0x123d58[_0xabee('0x25')]){delete _0x123d58[_0xabee('0x25')];}_0x4ae65e[_0xabee('0x18')](_0x2aa470)['send'](_0x123d58);};}exports[_0xabee('0x26')]=function(_0x2b7464,_0x1b5aee){var _0x37e780={},_0x1c4f51={},_0x116e41={'count':0x0,'rows':[]};var _0x3df00d=_[_0xabee('0x27')](db[_0xabee('0x28')]['rawAttributes'],function(_0x2a2441){return{'name':_0x2a2441['fieldName'],'type':_0x2a2441[_0xabee('0x29')][_0xabee('0x2a')]};});_0x1c4f51[_0xabee('0x2b')]=_[_0xabee('0x27')](_0x3df00d,'name');_0x1c4f51[_0xabee('0x2c')]=_['keys'](_0x2b7464[_0xabee('0x2c')]);_0x1c4f51['filters']=_[_0xabee('0x2d')](_0x1c4f51['model'],_0x1c4f51['query']);_0x37e780[_0xabee('0x2e')]=_[_0xabee('0x2d')](_0x1c4f51[_0xabee('0x2b')],qs[_0xabee('0x2f')](_0x2b7464[_0xabee('0x2c')][_0xabee('0x2f')]));_0x37e780[_0xabee('0x2e')]=_0x37e780[_0xabee('0x2e')]['length']?_0x37e780[_0xabee('0x2e')]:_0x1c4f51[_0xabee('0x2b')];if(!_0x2b7464[_0xabee('0x2c')][_0xabee('0x30')](_0xabee('0x31'))){_0x37e780[_0xabee('0x1c')]=qs[_0xabee('0x1c')](_0x2b7464[_0xabee('0x2c')][_0xabee('0x1c')]);_0x37e780[_0xabee('0x1a')]=qs[_0xabee('0x1a')](_0x2b7464[_0xabee('0x2c')][_0xabee('0x1a')]);}_0x37e780[_0xabee('0x32')]=qs[_0xabee('0x33')](_0x2b7464[_0xabee('0x2c')][_0xabee('0x33')]);_0x37e780['where']=qs['filters'](_[_0xabee('0x34')](_0x2b7464[_0xabee('0x2c')],_0x1c4f51[_0xabee('0x35')]),_0x3df00d);if(_0x2b7464[_0xabee('0x2c')]['filter']){_0x37e780[_0xabee('0x36')]=_[_0xabee('0x37')](_0x37e780[_0xabee('0x36')],{'$or':_['map'](_0x3df00d,function(_0x1a48d5){if(_0x1a48d5['type']!==_0xabee('0x38')){var _0x879d31={};_0x879d31[_0x1a48d5[_0xabee('0x25')]]={'$like':'%'+_0x2b7464[_0xabee('0x2c')]['filter']+'%'};return _0x879d31;}})});}_0x37e780=_['merge']({},_0x37e780,_0x2b7464[_0xabee('0x39')]);var _0xb76b1d={'where':_0x37e780[_0xabee('0x36')]};return db[_0xabee('0x28')][_0xabee('0x1d')](_0xb76b1d)['then'](function(_0x229b00){_0x116e41[_0xabee('0x1d')]=_0x229b00;if(_0x2b7464['query'][_0xabee('0x3a')]){_0x37e780[_0xabee('0x3b')]=[{'all':!![]}];}return db['Cdr'][_0xabee('0x3c')](_0x37e780);})[_0xabee('0x22')](function(_0x3f05ee){_0x116e41[_0xabee('0x3d')]=_0x3f05ee;return _0x116e41;})[_0xabee('0x22')](respondWithFilteredResult(_0x1b5aee,_0x37e780))[_0xabee('0x3e')](handleError(_0x1b5aee,null));};exports[_0xabee('0x3f')]=function(_0x4ee7e6,_0x36fc07){var _0x22fc91={'raw':!![],'where':{'id':_0x4ee7e6['params']['id']}},_0x206350={};_0x206350[_0xabee('0x2b')]=_[_0xabee('0x40')](db['Cdr'][_0xabee('0x41')]);_0x206350[_0xabee('0x2c')]=_['keys'](_0x4ee7e6[_0xabee('0x2c')]);_0x206350[_0xabee('0x35')]=_[_0xabee('0x2d')](_0x206350[_0xabee('0x2b')],_0x206350[_0xabee('0x2c')]);_0x22fc91[_0xabee('0x2e')]=_[_0xabee('0x2d')](_0x206350['model'],qs[_0xabee('0x2f')](_0x4ee7e6[_0xabee('0x2c')][_0xabee('0x2f')]));_0x22fc91['attributes']=_0x22fc91[_0xabee('0x2e')][_0xabee('0x42')]?_0x22fc91['attributes']:_0x206350['model'];if(_0x4ee7e6['query'][_0xabee('0x3a')]){_0x22fc91[_0xabee('0x3b')]=[{'all':!![]}];}_0x22fc91=_['merge']({},_0x22fc91,_0x4ee7e6['options']);return db[_0xabee('0x28')][_0xabee('0x43')](_0x22fc91)[_0xabee('0x22')](handleEntityNotFound(_0x36fc07,null))[_0xabee('0x22')](respondWithResult(_0x36fc07,null))[_0xabee('0x3e')](handleError(_0x36fc07,null));};exports[_0xabee('0x44')]=function(_0x430b08,_0x307d34){return db[_0xabee('0x28')][_0xabee('0x44')](_0x430b08[_0xabee('0x45')],{})[_0xabee('0x22')](respondWithResult(_0x307d34,0xc9))[_0xabee('0x3e')](handleError(_0x307d34,null));};exports[_0xabee('0x20')]=function(_0x3e277d,_0x252f60){if(_0x3e277d[_0xabee('0x45')]['id']){delete _0x3e277d[_0xabee('0x45')]['id'];}return db['Cdr'][_0xabee('0x43')]({'where':{'id':_0x3e277d[_0xabee('0x46')]['id']}})['then'](handleEntityNotFound(_0x252f60,null))['then'](saveUpdates(_0x3e277d[_0xabee('0x45')],null))[_0xabee('0x22')](respondWithResult(_0x252f60,null))[_0xabee('0x3e')](handleError(_0x252f60,null));};exports[_0xabee('0x21')]=function(_0xe2433f,_0x3d819a){return db[_0xabee('0x28')]['find']({'where':{'id':_0xe2433f[_0xabee('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d819a,null))[_0xabee('0x22')](removeEntity(_0x3d819a,null))[_0xabee('0x3e')](handleError(_0x3d819a,null));};exports['describe']=function(_0x3ebd50,_0x3aaf14){return db[_0xabee('0x28')]['describe']()[_0xabee('0x22')](respondWithResult(_0x3aaf14,null))['catch'](handleError(_0x3aaf14,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index c21391a..ba57417 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x148c5c,_0x1b5c70){var _0x5ec287=function(_0x3a3c19){while(--_0x3a3c19){_0x148c5c['push'](_0x148c5c['shift']());}};_0x5ec287(++_0x1b5c70);}(_0x7a54,0x106));var _0x47a5=function(_0x55803d,_0x4c9027){_0x55803d=_0x55803d-0x0;var _0x3504ba=_0x7a54[_0x55803d];return _0x3504ba;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x2854f9,_0x10c35f){var _0x331008=function(_0x16820d){while(--_0x16820d){_0x2854f9['push'](_0x2854f9['shift']());}};_0x331008(++_0x10c35f);}(_0x7a54,0x106));var _0x47a5=function(_0x409b10,_0x4d8646){_0x409b10=_0x409b10-0x0;var _0x4e5f05=_0x7a54[_0x409b10];return _0x4e5f05;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index d5a606e..f2e180c 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 _0xc604=['request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','ioredis','../../mysqldb','../../config/logger','client','http','request','then','info','Cdr,\x20%s,\x20%s'];(function(_0x4214b1,_0x228fa4){var _0x2abe03=function(_0x1670cf){while(--_0x1670cf){_0x4214b1['push'](_0x4214b1['shift']());}};_0x2abe03(++_0x228fa4);}(_0xc604,0xed));var _0x4c60=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc604[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4c60('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c60('0x1'));var db=require(_0x4c60('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c60('0x3'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4c60('0x4')][_0x4c60('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x342f99,_0x3fc1b1,_0x437898){return new BPromise(function(_0x1664d5,_0x58f72a){return client[_0x4c60('0x6')](_0x342f99,_0x437898)[_0x4c60('0x7')](function(_0x2a95f2){logger[_0x4c60('0x8')](_0x4c60('0x9'),_0x3fc1b1,_0x4c60('0xa'));logger[_0x4c60('0xb')](_0x4c60('0xc'),_0x3fc1b1,_0x4c60('0xa'),JSON[_0x4c60('0xd')](_0x2a95f2));if(_0x2a95f2[_0x4c60('0xe')]){if(_0x2a95f2[_0x4c60('0xe')][_0x4c60('0xf')]===0x1f4){logger[_0x4c60('0xe')](_0x4c60('0x9'),_0x3fc1b1,_0x2a95f2['error']['message']);return _0x58f72a(_0x2a95f2[_0x4c60('0xe')][_0x4c60('0x10')]);}logger[_0x4c60('0xe')](_0x4c60('0x9'),_0x3fc1b1,_0x2a95f2[_0x4c60('0xe')][_0x4c60('0x10')]);return _0x1664d5(_0x2a95f2[_0x4c60('0xe')][_0x4c60('0x10')]);}else{logger[_0x4c60('0x8')](_0x4c60('0x9'),_0x3fc1b1,'request\x20sent');_0x1664d5(_0x2a95f2[_0x4c60('0x11')][_0x4c60('0x10')]);}})[_0x4c60('0x12')](function(_0x5d9424){logger[_0x4c60('0xe')](_0x4c60('0x9'),_0x3fc1b1,_0x5d9424);_0x58f72a(_0x5d9424);});});}
\ No newline at end of file
+var _0xe307=['code','message','result','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x563023,_0x33bbbb){var _0x8e7784=function(_0x563a92){while(--_0x563a92){_0x563023['push'](_0x563023['shift']());}};_0x8e7784(++_0x33bbbb);}(_0xe307,0xd4));var _0x7e30=function(_0x226bc5,_0x29fb55){_0x226bc5=_0x226bc5-0x0;var _0x50d54d=_0xe307[_0x226bc5];return _0x50d54d;};'use strict';var _=require(_0x7e30('0x0'));var util=require('util');var moment=require(_0x7e30('0x1'));var BPromise=require(_0x7e30('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e30('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7e30('0x4'))(_0x7e30('0x5'));var config=require('../../config/environment');var jayson=require(_0x7e30('0x6'));var client=jayson[_0x7e30('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x289f77,_0x399102,_0x5e9840){return new BPromise(function(_0x5bc961,_0x4bbe5a){return client[_0x7e30('0x8')](_0x289f77,_0x5e9840)[_0x7e30('0x9')](function(_0x3491c3){logger[_0x7e30('0xa')](_0x7e30('0xb'),_0x399102,_0x7e30('0xc'));logger[_0x7e30('0xd')]('Cdr,\x20%s,\x20%s,\x20%s',_0x399102,_0x7e30('0xc'),JSON[_0x7e30('0xe')](_0x3491c3));if(_0x3491c3[_0x7e30('0xf')]){if(_0x3491c3[_0x7e30('0xf')][_0x7e30('0x10')]===0x1f4){logger[_0x7e30('0xf')]('Cdr,\x20%s,\x20%s',_0x399102,_0x3491c3[_0x7e30('0xf')][_0x7e30('0x11')]);return _0x4bbe5a(_0x3491c3[_0x7e30('0xf')][_0x7e30('0x11')]);}logger[_0x7e30('0xf')](_0x7e30('0xb'),_0x399102,_0x3491c3[_0x7e30('0xf')]['message']);return _0x5bc961(_0x3491c3['error']['message']);}else{logger['info'](_0x7e30('0xb'),_0x399102,_0x7e30('0xc'));_0x5bc961(_0x3491c3[_0x7e30('0x12')]['message']);}})['catch'](function(_0x51172b){logger['error'](_0x7e30('0xb'),_0x399102,_0x51172b);_0x4bbe5a(_0x51172b);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 80a087c..d7d5e11 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x47cfa0,_0x176b87){var _0x386b1d=function(_0x5785e5){while(--_0x5785e5){_0x47cfa0['push'](_0x47cfa0['shift']());}};_0x386b1d(++_0x176b87);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x251895,_0x414adb){var _0x70b2dd=function(_0x340030){while(--_0x340030){_0x251895['push'](_0x251895['shift']());}};_0x70b2dd(++_0x414adb);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index a634850..7e8d80d 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 _0xeb88=['STRING','INTEGER','TEXT'];(function(_0x33ff0c,_0x448c2a){var _0x44bdc2=function(_0x4f8652){while(--_0x4f8652){_0x33ff0c['push'](_0x33ff0c['shift']());}};_0x44bdc2(++_0x448c2a);}(_0xeb88,0x124));var _0x8eb8=function(_0x2f89eb,_0x5623d2){_0x2f89eb=_0x2f89eb-0x0;var _0x53edbc=_0xeb88[_0x2f89eb];return _0x53edbc;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x8eb8('0x0')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x8eb8('0x1')]()},'description':{'type':Sequelize[_0x8eb8('0x2')]},'interval':{'type':Sequelize[_0x8eb8('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x17d3=['*,*,*,*','sequelize','STRING','noop'];(function(_0x1df32f,_0x37dca3){var _0x40ec9a=function(_0xfe2fec){while(--_0xfe2fec){_0x1df32f['push'](_0x1df32f['shift']());}};_0x40ec9a(++_0x37dca3);}(_0x17d3,0x71));var _0x317d=function(_0x2bb776,_0x51d4a2){_0x2bb776=_0x2bb776-0x0;var _0x34654b=_0x17d3[_0x2bb776];return _0x34654b;};'use strict';var Sequelize=require(_0x317d('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x317d('0x1')],'allowNull':![],'defaultValue':_0x317d('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x317d('0x1')],'defaultValue':_0x317d('0x3')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 740d39c..7ab1bf9 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 _0x4977=['fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','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','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','name','send','show','params','keys','ChatApplication','query','intersection','attributes','model','fields','length','includeAll','options','body','catch','find','eml-format','rimraf','zip-dir'];(function(_0x10dfdf,_0x36b623){var _0x4d857d=function(_0x4683ee){while(--_0x4683ee){_0x10dfdf['push'](_0x10dfdf['shift']());}};_0x4d857d(++_0x36b623);}(_0x4977,0x1cd));var _0x7497=function(_0x1d9b56,_0x1f3422){_0x1d9b56=_0x1d9b56-0x0;var _0x3af3cb=_0x4977[_0x1d9b56];return _0x3af3cb;};'use strict';var emlformat=require(_0x7497('0x0'));var rimraf=require(_0x7497('0x1'));var zipdir=require(_0x7497('0x2'));var jsonpatch=require(_0x7497('0x3'));var rp=require(_0x7497('0x4'));var moment=require('moment');var BPromise=require(_0x7497('0x5'));var Mustache=require(_0x7497('0x6'));var util=require(_0x7497('0x7'));var path=require(_0x7497('0x8'));var sox=require(_0x7497('0x9'));var csv=require(_0x7497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7497('0xb'));var _=require(_0x7497('0xc'));var squel=require(_0x7497('0xd'));var crypto=require(_0x7497('0xe'));var jsforce=require(_0x7497('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7497('0xa'));var querystring=require(_0x7497('0x10'));var Papa=require('papaparse');var Redis=require(_0x7497('0x11'));var authService=require(_0x7497('0x12'));var qs=require(_0x7497('0x13'));var as=require(_0x7497('0x14'));var hardwareService=require(_0x7497('0x15'));var logger=require(_0x7497('0x16'))(_0x7497('0x17'));var utils=require(_0x7497('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7497('0x19'));var db=require(_0x7497('0x1a'))['db'];function respondWithStatusCode(_0x5e327f,_0x5be343){_0x5be343=_0x5be343||0xcc;return function(_0x1845c9){if(_0x1845c9){return _0x5e327f[_0x7497('0x1b')](_0x5be343);}return _0x5e327f[_0x7497('0x1c')](_0x5be343)[_0x7497('0x1d')]();};}function respondWithResult(_0x20faeb,_0x5242b3){_0x5242b3=_0x5242b3||0xc8;return function(_0x454656){if(_0x454656){return _0x20faeb['status'](_0x5242b3)[_0x7497('0x1e')](_0x454656);}};}function respondWithFilteredResult(_0x366ee3,_0x1b240e){return function(_0x44c562){if(_0x44c562){var _0x2f3dce=typeof _0x1b240e['offset']===_0x7497('0x1f')&&typeof _0x1b240e[_0x7497('0x20')]===_0x7497('0x1f');var _0x72b64d=_0x44c562[_0x7497('0x21')];var _0x5a2995=_0x2f3dce?0x0:_0x1b240e['offset'];var _0x41269c=_0x2f3dce?_0x44c562[_0x7497('0x21')]:_0x1b240e[_0x7497('0x22')]+_0x1b240e[_0x7497('0x20')];var _0x324ab3;if(_0x41269c>=_0x72b64d){_0x41269c=_0x72b64d;_0x324ab3=0xc8;}else{_0x324ab3=0xce;}_0x366ee3[_0x7497('0x1c')](_0x324ab3);return _0x366ee3['set'](_0x7497('0x23'),_0x5a2995+'-'+_0x41269c+'/'+_0x72b64d)[_0x7497('0x1e')](_0x44c562);}return null;};}function patchUpdates(_0x142ce0){return function(_0x43910d){try{jsonpatch['apply'](_0x43910d,_0x142ce0,!![]);}catch(_0x456b5d){return BPromise[_0x7497('0x24')](_0x456b5d);}return _0x43910d[_0x7497('0x25')]();};}function saveUpdates(_0x31a354,_0x37c1f8){return function(_0x1fe043){if(_0x1fe043){return _0x1fe043[_0x7497('0x26')](_0x31a354)[_0x7497('0x27')](function(_0x4ee3f0){return _0x4ee3f0;});}return null;};}function removeEntity(_0x5a78ce,_0x16ef09){return function(_0x45b4bc){if(_0x45b4bc){return _0x45b4bc[_0x7497('0x28')]()[_0x7497('0x27')](function(){_0x5a78ce[_0x7497('0x1c')](0xcc)[_0x7497('0x1d')]();});}};}function handleEntityNotFound(_0x17b9ad,_0x5775d4){return function(_0x18a5dd){if(!_0x18a5dd){_0x17b9ad[_0x7497('0x1b')](0x194);}return _0x18a5dd;};}function handleError(_0x3dd18d,_0x3d1d50){_0x3d1d50=_0x3d1d50||0x1f4;return function(_0x18ce8d){logger['error'](_0x18ce8d['stack']);if(_0x18ce8d[_0x7497('0x29')]){delete _0x18ce8d[_0x7497('0x29')];}_0x3dd18d[_0x7497('0x1c')](_0x3d1d50)[_0x7497('0x2a')](_0x18ce8d);};}exports[_0x7497('0x2b')]=function(_0x452142,_0xea2a5){var _0xdbcbc1={'raw':!![],'where':{'id':_0x452142[_0x7497('0x2c')]['id']}},_0x4e4c05={};_0x4e4c05['model']=_[_0x7497('0x2d')](db[_0x7497('0x2e')]['rawAttributes']);_0x4e4c05['query']=_[_0x7497('0x2d')](_0x452142[_0x7497('0x2f')]);_0x4e4c05['filters']=_[_0x7497('0x30')](_0x4e4c05['model'],_0x4e4c05[_0x7497('0x2f')]);_0xdbcbc1[_0x7497('0x31')]=_[_0x7497('0x30')](_0x4e4c05[_0x7497('0x32')],qs[_0x7497('0x33')](_0x452142[_0x7497('0x2f')][_0x7497('0x33')]));_0xdbcbc1['attributes']=_0xdbcbc1[_0x7497('0x31')][_0x7497('0x34')]?_0xdbcbc1[_0x7497('0x31')]:_0x4e4c05['model'];if(_0x452142[_0x7497('0x2f')][_0x7497('0x35')]){_0xdbcbc1['include']=[{'all':!![]}];}_0xdbcbc1=_['merge']({},_0xdbcbc1,_0x452142[_0x7497('0x36')]);return db[_0x7497('0x2e')]['find'](_0xdbcbc1)[_0x7497('0x27')](handleEntityNotFound(_0xea2a5,null))['then'](respondWithResult(_0xea2a5,null))['catch'](handleError(_0xea2a5,null));};exports[_0x7497('0x26')]=function(_0x1c15c9,_0x157cad){if(_0x1c15c9[_0x7497('0x37')]['id']){delete _0x1c15c9['body']['id'];}return db[_0x7497('0x2e')]['find']({'where':{'id':_0x1c15c9[_0x7497('0x2c')]['id']}})[_0x7497('0x27')](handleEntityNotFound(_0x157cad,null))[_0x7497('0x27')](saveUpdates(_0x1c15c9[_0x7497('0x37')],null))[_0x7497('0x27')](respondWithResult(_0x157cad,null))[_0x7497('0x38')](handleError(_0x157cad,null));};exports[_0x7497('0x28')]=function(_0x257a13,_0x9dccd9){return db[_0x7497('0x2e')][_0x7497('0x39')]({'where':{'id':_0x257a13[_0x7497('0x2c')]['id']}})[_0x7497('0x27')](handleEntityNotFound(_0x9dccd9,null))['then'](removeEntity(_0x9dccd9,null))[_0x7497('0x38')](handleError(_0x9dccd9,null));};
\ No newline at end of file
+var _0x235a=['offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','show','ChatApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length','model','includeAll','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x235a,0x1ef));var _0xa235=function(_0x1e60cc,_0x31bed7){_0x1e60cc=_0x1e60cc-0x0;var _0x473266=_0x235a[_0x1e60cc];return _0x473266;};'use strict';var emlformat=require(_0xa235('0x0'));var rimraf=require(_0xa235('0x1'));var zipdir=require(_0xa235('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa235('0x3'));var moment=require('moment');var BPromise=require(_0xa235('0x4'));var Mustache=require(_0xa235('0x5'));var util=require(_0xa235('0x6'));var path=require(_0xa235('0x7'));var sox=require(_0xa235('0x8'));var csv=require(_0xa235('0x9'));var ejs=require(_0xa235('0xa'));var fs=require('fs');var fs_extra=require(_0xa235('0xb'));var _=require('lodash');var squel=require(_0xa235('0xc'));var crypto=require(_0xa235('0xd'));var jsforce=require(_0xa235('0xe'));var deskjs=require(_0xa235('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa235('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa235('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa235('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa235('0x13'));var config=require(_0xa235('0x14'));var licenseUtil=require(_0xa235('0x15'));var db=require(_0xa235('0x16'))['db'];function respondWithStatusCode(_0x5330db,_0x5510ff){_0x5510ff=_0x5510ff||0xcc;return function(_0x47aad7){if(_0x47aad7){return _0x5330db[_0xa235('0x17')](_0x5510ff);}return _0x5330db[_0xa235('0x18')](_0x5510ff)[_0xa235('0x19')]();};}function respondWithResult(_0x3bf6fc,_0x36b4b1){_0x36b4b1=_0x36b4b1||0xc8;return function(_0x44ea6a){if(_0x44ea6a){return _0x3bf6fc[_0xa235('0x18')](_0x36b4b1)[_0xa235('0x1a')](_0x44ea6a);}};}function respondWithFilteredResult(_0x1369de,_0x4aceee){return function(_0x352463){if(_0x352463){var _0x20cd67=typeof _0x4aceee[_0xa235('0x1b')]===_0xa235('0x1c')&&typeof _0x4aceee[_0xa235('0x1d')]===_0xa235('0x1c');var _0x5c6e95=_0x352463['count'];var _0x446ea2=_0x20cd67?0x0:_0x4aceee[_0xa235('0x1b')];var _0x2b3769=_0x20cd67?_0x352463['count']:_0x4aceee[_0xa235('0x1b')]+_0x4aceee[_0xa235('0x1d')];var _0x3ca514;if(_0x2b3769>=_0x5c6e95){_0x2b3769=_0x5c6e95;_0x3ca514=0xc8;}else{_0x3ca514=0xce;}_0x1369de[_0xa235('0x18')](_0x3ca514);return _0x1369de[_0xa235('0x1e')](_0xa235('0x1f'),_0x446ea2+'-'+_0x2b3769+'/'+_0x5c6e95)[_0xa235('0x1a')](_0x352463);}return null;};}function patchUpdates(_0x483771){return function(_0x5a3bea){try{jsonpatch[_0xa235('0x20')](_0x5a3bea,_0x483771,!![]);}catch(_0x21940f){return BPromise[_0xa235('0x21')](_0x21940f);}return _0x5a3bea[_0xa235('0x22')]();};}function saveUpdates(_0x2e38e,_0x3deeea){return function(_0x3d9f70){if(_0x3d9f70){return _0x3d9f70[_0xa235('0x23')](_0x2e38e)[_0xa235('0x24')](function(_0x216083){return _0x216083;});}return null;};}function removeEntity(_0x3219f1,_0x20292c){return function(_0xee45e1){if(_0xee45e1){return _0xee45e1[_0xa235('0x25')]()[_0xa235('0x24')](function(){_0x3219f1[_0xa235('0x18')](0xcc)[_0xa235('0x19')]();});}};}function handleEntityNotFound(_0x13c868,_0x976c9f){return function(_0x1cb892){if(!_0x1cb892){_0x13c868[_0xa235('0x17')](0x194);}return _0x1cb892;};}function handleError(_0x57f591,_0xe1176c){_0xe1176c=_0xe1176c||0x1f4;return function(_0x533b15){logger[_0xa235('0x26')](_0x533b15['stack']);if(_0x533b15[_0xa235('0x27')]){delete _0x533b15[_0xa235('0x27')];}_0x57f591[_0xa235('0x18')](_0xe1176c)[_0xa235('0x28')](_0x533b15);};}exports[_0xa235('0x29')]=function(_0x5d811a,_0x2585c7){var _0x612f2={'raw':!![],'where':{'id':_0x5d811a['params']['id']}},_0x55a21e={};_0x55a21e['model']=_['keys'](db[_0xa235('0x2a')][_0xa235('0x2b')]);_0x55a21e[_0xa235('0x2c')]=_[_0xa235('0x2d')](_0x5d811a[_0xa235('0x2c')]);_0x55a21e[_0xa235('0x2e')]=_[_0xa235('0x2f')](_0x55a21e['model'],_0x55a21e['query']);_0x612f2[_0xa235('0x30')]=_[_0xa235('0x2f')](_0x55a21e['model'],qs[_0xa235('0x31')](_0x5d811a[_0xa235('0x2c')][_0xa235('0x31')]));_0x612f2[_0xa235('0x30')]=_0x612f2[_0xa235('0x30')][_0xa235('0x32')]?_0x612f2[_0xa235('0x30')]:_0x55a21e[_0xa235('0x33')];if(_0x5d811a['query'][_0xa235('0x34')]){_0x612f2['include']=[{'all':!![]}];}_0x612f2=_[_0xa235('0x35')]({},_0x612f2,_0x5d811a[_0xa235('0x36')]);return db[_0xa235('0x2a')][_0xa235('0x37')](_0x612f2)[_0xa235('0x24')](handleEntityNotFound(_0x2585c7,null))[_0xa235('0x24')](respondWithResult(_0x2585c7,null))[_0xa235('0x38')](handleError(_0x2585c7,null));};exports[_0xa235('0x23')]=function(_0xa1b9d2,_0x34bba1){if(_0xa1b9d2[_0xa235('0x39')]['id']){delete _0xa1b9d2[_0xa235('0x39')]['id'];}return db[_0xa235('0x2a')]['find']({'where':{'id':_0xa1b9d2['params']['id']}})['then'](handleEntityNotFound(_0x34bba1,null))[_0xa235('0x24')](saveUpdates(_0xa1b9d2['body'],null))[_0xa235('0x24')](respondWithResult(_0x34bba1,null))[_0xa235('0x38')](handleError(_0x34bba1,null));};exports[_0xa235('0x25')]=function(_0x21a835,_0x473af7){return db[_0xa235('0x2a')][_0xa235('0x37')]({'where':{'id':_0x21a835['params']['id']}})[_0xa235('0x24')](handleEntityNotFound(_0x473af7,null))[_0xa235('0x24')](removeEntity(_0x473af7,null))['catch'](handleError(_0x473af7,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index fc67dfc..99b32d6 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 _0x5693=['ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x4c825d,_0x10ec2b){var _0x43de87=function(_0xcab4a3){while(--_0xcab4a3){_0x4c825d['push'](_0x4c825d['shift']());}};_0x43de87(++_0x10ec2b);}(_0x5693,0x1d2));var _0x3569=function(_0x14a69f,_0x159b4e){_0x14a69f=_0x14a69f-0x0;var _0x4d542c=_0x5693[_0x14a69f];return _0x4d542c;};'use strict';var _=require(_0x3569('0x0'));var util=require(_0x3569('0x1'));var logger=require(_0x3569('0x2'))('api');var moment=require(_0x3569('0x3'));var BPromise=require(_0x3569('0x4'));var rp=require(_0x3569('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3569('0x6'));var config=require(_0x3569('0x7'));var attributes=require('./chatApplication.attributes');module[_0x3569('0x8')]=function(_0x4376ef,_0x502b41){return _0x4376ef[_0x3569('0x9')](_0x3569('0xa'),attributes,{'tableName':_0x3569('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3569('0xc'),'collate':_0x3569('0xd')});};
\ No newline at end of file
+var _0x6c91=['define','ChatApplication','chat_applications','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes'];(function(_0x48c8fe,_0x5e89a5){var _0xaa78ca=function(_0x140b38){while(--_0x140b38){_0x48c8fe['push'](_0x48c8fe['shift']());}};_0xaa78ca(++_0x5e89a5);}(_0x6c91,0x85));var _0x16c9=function(_0x3f127e,_0x5724f2){_0x3f127e=_0x3f127e-0x0;var _0x23e0ff=_0x6c91[_0x3f127e];return _0x23e0ff;};'use strict';var _=require(_0x16c9('0x0'));var util=require(_0x16c9('0x1'));var logger=require(_0x16c9('0x2'))(_0x16c9('0x3'));var moment=require(_0x16c9('0x4'));var BPromise=require('bluebird');var rp=require(_0x16c9('0x5'));var fs=require('fs');var path=require(_0x16c9('0x6'));var rimraf=require(_0x16c9('0x7'));var config=require(_0x16c9('0x8'));var attributes=require(_0x16c9('0x9'));module['exports']=function(_0x53391b,_0x47bdb6){return _0x53391b[_0x16c9('0xa')](_0x16c9('0xb'),attributes,{'tableName':_0x16c9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 458e2ec..62d4be4 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 _0xbedd=['util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','lodash'];(function(_0x659eb6,_0x264282){var _0x252fbe=function(_0x3967a7){while(--_0x3967a7){_0x659eb6['push'](_0x659eb6['shift']());}};_0x252fbe(++_0x264282);}(_0xbedd,0x17b));var _0xdbed=function(_0x3e7ae6,_0x2e14d9){_0x3e7ae6=_0x3e7ae6-0x0;var _0xdfaa19=_0xbedd[_0x3e7ae6];return _0xdfaa19;};'use strict';var _=require(_0xdbed('0x0'));var util=require(_0xdbed('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdbed('0x2'));var fs=require('fs');var Redis=require(_0xdbed('0x3'));var db=require(_0xdbed('0x4'))['db'];var utils=require(_0xdbed('0x5'));var logger=require('../../config/logger')(_0xdbed('0x6'));var config=require('../../config/environment');var jayson=require(_0xdbed('0x7'));var client=jayson[_0xdbed('0x8')][_0xdbed('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x410d51,_0x365980,_0x4a3cb5){return new BPromise(function(_0x509e5c,_0x33e95f){return client['request'](_0x410d51,_0x4a3cb5)[_0xdbed('0xa')](function(_0x582919){logger['info'](_0xdbed('0xb'),_0x365980,_0xdbed('0xc'));logger[_0xdbed('0xd')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x365980,_0xdbed('0xc'),JSON[_0xdbed('0xe')](_0x582919));if(_0x582919[_0xdbed('0xf')]){if(_0x582919[_0xdbed('0xf')]['code']===0x1f4){logger[_0xdbed('0xf')](_0xdbed('0xb'),_0x365980,_0x582919['error'][_0xdbed('0x10')]);return _0x33e95f(_0x582919[_0xdbed('0xf')]['message']);}logger[_0xdbed('0xf')](_0xdbed('0xb'),_0x365980,_0x582919['error']['message']);return _0x509e5c(_0x582919[_0xdbed('0xf')]['message']);}else{logger[_0xdbed('0x11')](_0xdbed('0xb'),_0x365980,'request\x20sent');_0x509e5c(_0x582919['result']['message']);}})[_0xdbed('0x12')](function(_0x39d13e){logger['error'](_0xdbed('0xb'),_0x365980,_0x39d13e);_0x33e95f(_0x39d13e);});});}
\ No newline at end of file
+var _0x39fd=['moment','bluebird','ioredis','../../config/utils','rpc','client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0xdac5f,_0x1c39c7){var _0x5ea6c3=function(_0x4e3ebb){while(--_0x4e3ebb){_0xdac5f['push'](_0xdac5f['shift']());}};_0x5ea6c3(++_0x1c39c7);}(_0x39fd,0xc6));var _0xd39f=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x39fd[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xd39f('0x0'));var util=require(_0xd39f('0x1'));var moment=require(_0xd39f('0x2'));var BPromise=require(_0xd39f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd39f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd39f('0x5'));var logger=require('../../config/logger')(_0xd39f('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd39f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c8e24,_0x555b81,_0x43510e){return new BPromise(function(_0x40489c,_0x2a688e){return client[_0xd39f('0x8')](_0x3c8e24,_0x43510e)[_0xd39f('0x9')](function(_0x335eae){logger[_0xd39f('0xa')](_0xd39f('0xb'),_0x555b81,_0xd39f('0xc'));logger[_0xd39f('0xd')](_0xd39f('0xe'),_0x555b81,_0xd39f('0xc'),JSON['stringify'](_0x335eae));if(_0x335eae[_0xd39f('0xf')]){if(_0x335eae[_0xd39f('0xf')][_0xd39f('0x10')]===0x1f4){logger[_0xd39f('0xf')](_0xd39f('0xb'),_0x555b81,_0x335eae[_0xd39f('0xf')][_0xd39f('0x11')]);return _0x2a688e(_0x335eae[_0xd39f('0xf')][_0xd39f('0x11')]);}logger[_0xd39f('0xf')](_0xd39f('0xb'),_0x555b81,_0x335eae['error'][_0xd39f('0x11')]);return _0x40489c(_0x335eae['error']['message']);}else{logger[_0xd39f('0xa')](_0xd39f('0xb'),_0x555b81,_0xd39f('0xc'));_0x40489c(_0x335eae[_0xd39f('0x12')][_0xd39f('0x11')]);}})[_0xd39f('0x13')](function(_0x245997){logger['error'](_0xd39f('0xb'),_0x555b81,_0x245997);_0x2a688e(_0x245997);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index f7022a9..8d9d860 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 _0x0d2d=['get','/:id','isAuthenticated','show','put','delete','destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x0d2d,0x71));var _0xd0d2=function(_0x112ecc,_0x316376){_0x112ecc=_0x112ecc-0x0;var _0x24e59b=_0x0d2d[_0x112ecc];return _0x24e59b;};'use strict';var multer=require('multer');var util=require(_0xd0d2('0x0'));var path=require(_0xd0d2('0x1'));var timeout=require('connect-timeout');var express=require(_0xd0d2('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd0d2('0x3'));var interaction=require(_0xd0d2('0x4'));var config=require(_0xd0d2('0x5'));var controller=require(_0xd0d2('0x6'));router[_0xd0d2('0x7')](_0xd0d2('0x8'),auth[_0xd0d2('0x9')](),controller[_0xd0d2('0xa')]);router[_0xd0d2('0xb')](_0xd0d2('0x8'),auth[_0xd0d2('0x9')](),controller['update']);router[_0xd0d2('0xc')](_0xd0d2('0x8'),auth[_0xd0d2('0x9')](),controller[_0xd0d2('0xd')]);module[_0xd0d2('0xe')]=router;
\ No newline at end of file
+var _0x33d4=['../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','show','put','isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x33d4,0x107));var _0x433d=function(_0x4fbd7c,_0x4c77fc){_0x4fbd7c=_0x4fbd7c-0x0;var _0x20fdfe=_0x33d4[_0x4fbd7c];return _0x20fdfe;};'use strict';var multer=require(_0x433d('0x0'));var util=require(_0x433d('0x1'));var path=require(_0x433d('0x2'));var timeout=require(_0x433d('0x3'));var express=require(_0x433d('0x4'));var router=express[_0x433d('0x5')]();var fs_extra=require(_0x433d('0x6'));var auth=require(_0x433d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x433d('0x8'));var controller=require(_0x433d('0x9'));router[_0x433d('0xa')](_0x433d('0xb'),auth['isAuthenticated'](),controller[_0x433d('0xc')]);router[_0x433d('0xd')](_0x433d('0xb'),auth[_0x433d('0xe')](),controller[_0x433d('0xf')]);router[_0x433d('0x10')](_0x433d('0xb'),auth[_0x433d('0xe')](),controller[_0x433d('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 84079ed..a745292 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 _0x71ad=['STRING','sequelize','exports'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x71ad,0xee));var _0xd71a=function(_0x5b4648,_0x31adb9){_0x5b4648=_0x5b4648-0x0;var _0x9e6d94=_0x71ad[_0x5b4648];return _0x9e6d94;};'use strict';var Sequelize=require(_0xd71a('0x0'));module[_0xd71a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd71a('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x9219=['STRING','BOOLEAN','exports'];(function(_0x241b9c,_0x10f3ce){var _0x34af06=function(_0x4366f3){while(--_0x4366f3){_0x241b9c['push'](_0x241b9c['shift']());}};_0x34af06(++_0x10f3ce);}(_0x9219,0x1cd));var _0x9921=function(_0x1fc032,_0x4af4a2){_0x1fc032=_0x1fc032-0x0;var _0x3155ae=_0x9219[_0x1fc032];return _0x3155ae;};'use strict';var Sequelize=require('sequelize');module[_0x9921('0x0')]={'name':{'type':Sequelize[_0x9921('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9921('0x1')]},'write':{'type':Sequelize[_0x9921('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 4d28515..c220b03 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 _0xa010=['squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','save','update','then','error','name','send','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','ChatGroup','includeAll','include','findAll','catch','find','create','body','params','destroy','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','findOne','User','rawAttributes','removeMembers','addMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra'];(function(_0x5806c3,_0x5105d8){var _0x48ac77=function(_0x4826ec){while(--_0x4826ec){_0x5806c3['push'](_0x5806c3['shift']());}};_0x48ac77(++_0x5105d8);}(_0xa010,0xb0));var _0x0a01=function(_0x327b49,_0xc232b8){_0x327b49=_0x327b49-0x0;var _0x4e7265=_0xa010[_0x327b49];return _0x4e7265;};'use strict';var emlformat=require(_0x0a01('0x0'));var rimraf=require(_0x0a01('0x1'));var zipdir=require(_0x0a01('0x2'));var jsonpatch=require(_0x0a01('0x3'));var rp=require(_0x0a01('0x4'));var moment=require(_0x0a01('0x5'));var BPromise=require(_0x0a01('0x6'));var Mustache=require('mustache');var util=require(_0x0a01('0x7'));var path=require('path');var sox=require(_0x0a01('0x8'));var csv=require(_0x0a01('0x9'));var ejs=require(_0x0a01('0xa'));var fs=require('fs');var fs_extra=require(_0x0a01('0xb'));var _=require('lodash');var squel=require(_0x0a01('0xc'));var crypto=require(_0x0a01('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0a01('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a01('0xf'));var Redis=require(_0x0a01('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0a01('0x11'));var as=require(_0x0a01('0x12'));var hardwareService=require(_0x0a01('0x13'));var logger=require('../../config/logger')(_0x0a01('0x14'));var utils=require(_0x0a01('0x15'));var config=require(_0x0a01('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0a01('0x17'))['db'];config[_0x0a01('0x18')]=_[_0x0a01('0x19')](config[_0x0a01('0x18')],{'host':_0x0a01('0x1a'),'port':0x18eb});var socket=require(_0x0a01('0x1b'))(new Redis(config[_0x0a01('0x18')]));require('./chatGroup.socket')[_0x0a01('0x1c')](socket);function respondWithStatusCode(_0x26eb66,_0x2ac3ea){_0x2ac3ea=_0x2ac3ea||0xcc;return function(_0x11f75b){if(_0x11f75b){return _0x26eb66['sendStatus'](_0x2ac3ea);}return _0x26eb66['status'](_0x2ac3ea)[_0x0a01('0x1d')]();};}function respondWithResult(_0x37a298,_0x4a6dfc){_0x4a6dfc=_0x4a6dfc||0xc8;return function(_0x31beaa){if(_0x31beaa){return _0x37a298['status'](_0x4a6dfc)[_0x0a01('0x1e')](_0x31beaa);}};}function respondWithFilteredResult(_0x2106f6,_0x21fd3e){return function(_0x2d826a){if(_0x2d826a){var _0x2c436d=typeof _0x21fd3e[_0x0a01('0x1f')]===_0x0a01('0x20')&&typeof _0x21fd3e['limit']==='undefined';var _0x174ba9=_0x2d826a[_0x0a01('0x21')];var _0x292a88=_0x2c436d?0x0:_0x21fd3e[_0x0a01('0x1f')];var _0x2a8c79=_0x2c436d?_0x2d826a[_0x0a01('0x21')]:_0x21fd3e[_0x0a01('0x1f')]+_0x21fd3e[_0x0a01('0x22')];var _0x2d75ac;if(_0x2a8c79>=_0x174ba9){_0x2a8c79=_0x174ba9;_0x2d75ac=0xc8;}else{_0x2d75ac=0xce;}_0x2106f6[_0x0a01('0x23')](_0x2d75ac);return _0x2106f6[_0x0a01('0x24')](_0x0a01('0x25'),_0x292a88+'-'+_0x2a8c79+'/'+_0x174ba9)[_0x0a01('0x1e')](_0x2d826a);}return null;};}function patchUpdates(_0x2ddc99){return function(_0x331f11){try{jsonpatch[_0x0a01('0x26')](_0x331f11,_0x2ddc99,!![]);}catch(_0x2ce5af){return BPromise['reject'](_0x2ce5af);}return _0x331f11[_0x0a01('0x27')]();};}function saveUpdates(_0x18d91b,_0x29297a){return function(_0x3b5b2b){if(_0x3b5b2b){return _0x3b5b2b[_0x0a01('0x28')](_0x18d91b)[_0x0a01('0x29')](function(_0x3cca57){return _0x3cca57;});}return null;};}function removeEntity(_0x291d14,_0x33fcce){return function(_0x34520e){if(_0x34520e){return _0x34520e['destroy']()[_0x0a01('0x29')](function(){_0x291d14[_0x0a01('0x23')](0xcc)[_0x0a01('0x1d')]();});}};}function handleEntityNotFound(_0x2636df,_0xfa6e9b){return function(_0x1fb245){if(!_0x1fb245){_0x2636df['sendStatus'](0x194);}return _0x1fb245;};}function handleError(_0x44ad41,_0x4b0044){_0x4b0044=_0x4b0044||0x1f4;return function(_0x11ba13){logger[_0x0a01('0x2a')](_0x11ba13['stack']);if(_0x11ba13[_0x0a01('0x2b')]){delete _0x11ba13['name'];}_0x44ad41[_0x0a01('0x23')](_0x4b0044)[_0x0a01('0x2c')](_0x11ba13);};}exports['index']=function(_0x4f97fa,_0x4bc6f3){var _0x5aaa1e={},_0x36af2e={},_0x1419fc={'count':0x0,'rows':[]};var _0x338105=_[_0x0a01('0x2d')](db['ChatGroup']['rawAttributes'],function(_0x28588c){return{'name':_0x28588c['fieldName'],'type':_0x28588c[_0x0a01('0x2e')][_0x0a01('0x2f')]};});_0x36af2e[_0x0a01('0x30')]=_[_0x0a01('0x2d')](_0x338105,_0x0a01('0x2b'));_0x36af2e[_0x0a01('0x31')]=_[_0x0a01('0x32')](_0x4f97fa['query']);_0x36af2e[_0x0a01('0x33')]=_[_0x0a01('0x34')](_0x36af2e[_0x0a01('0x30')],_0x36af2e[_0x0a01('0x31')]);_0x5aaa1e[_0x0a01('0x35')]=_[_0x0a01('0x34')](_0x36af2e[_0x0a01('0x30')],qs[_0x0a01('0x36')](_0x4f97fa[_0x0a01('0x31')]['fields']));_0x5aaa1e[_0x0a01('0x35')]=_0x5aaa1e[_0x0a01('0x35')][_0x0a01('0x37')]?_0x5aaa1e[_0x0a01('0x35')]:_0x36af2e[_0x0a01('0x30')];if(!_0x4f97fa['query'][_0x0a01('0x38')]('nolimit')){_0x5aaa1e[_0x0a01('0x22')]=qs['limit'](_0x4f97fa[_0x0a01('0x31')]['limit']);_0x5aaa1e['offset']=qs['offset'](_0x4f97fa[_0x0a01('0x31')][_0x0a01('0x1f')]);}_0x5aaa1e[_0x0a01('0x39')]=qs['sort'](_0x4f97fa[_0x0a01('0x31')][_0x0a01('0x3a')]);_0x5aaa1e[_0x0a01('0x3b')]=qs[_0x0a01('0x33')](_[_0x0a01('0x3c')](_0x4f97fa[_0x0a01('0x31')],_0x36af2e[_0x0a01('0x33')]),_0x338105);if(_0x4f97fa[_0x0a01('0x31')][_0x0a01('0x3d')]){_0x5aaa1e[_0x0a01('0x3b')]=_['merge'](_0x5aaa1e[_0x0a01('0x3b')],{'$or':_[_0x0a01('0x2d')](_0x338105,function(_0xf22f72){if(_0xf22f72[_0x0a01('0x2e')]!==_0x0a01('0x3e')){var _0x4727af={};_0x4727af[_0xf22f72[_0x0a01('0x2b')]]={'$like':'%'+_0x4f97fa[_0x0a01('0x31')][_0x0a01('0x3d')]+'%'};return _0x4727af;}})});}_0x5aaa1e=_[_0x0a01('0x3f')]({},_0x5aaa1e,_0x4f97fa[_0x0a01('0x40')]);var _0x5ea1e9={'where':_0x5aaa1e['where']};return db[_0x0a01('0x41')][_0x0a01('0x21')](_0x5ea1e9)[_0x0a01('0x29')](function(_0x4eb51){_0x1419fc[_0x0a01('0x21')]=_0x4eb51;if(_0x4f97fa[_0x0a01('0x31')][_0x0a01('0x42')]){_0x5aaa1e[_0x0a01('0x43')]=[{'all':!![]}];}return db['ChatGroup'][_0x0a01('0x44')](_0x5aaa1e);})[_0x0a01('0x29')](function(_0x525b48){_0x1419fc['rows']=_0x525b48;return _0x1419fc;})[_0x0a01('0x29')](respondWithFilteredResult(_0x4bc6f3,_0x5aaa1e))[_0x0a01('0x45')](handleError(_0x4bc6f3,null));};exports['show']=function(_0x337dcc,_0x36afb0){var _0x3906ed={'raw':!![],'where':{'id':_0x337dcc['params']['id']}},_0x5b7757={};_0x5b7757[_0x0a01('0x30')]=_['keys'](db[_0x0a01('0x41')]['rawAttributes']);_0x5b7757[_0x0a01('0x31')]=_[_0x0a01('0x32')](_0x337dcc[_0x0a01('0x31')]);_0x5b7757[_0x0a01('0x33')]=_[_0x0a01('0x34')](_0x5b7757[_0x0a01('0x30')],_0x5b7757[_0x0a01('0x31')]);_0x3906ed['attributes']=_[_0x0a01('0x34')](_0x5b7757[_0x0a01('0x30')],qs[_0x0a01('0x36')](_0x337dcc[_0x0a01('0x31')][_0x0a01('0x36')]));_0x3906ed[_0x0a01('0x35')]=_0x3906ed[_0x0a01('0x35')][_0x0a01('0x37')]?_0x3906ed[_0x0a01('0x35')]:_0x5b7757[_0x0a01('0x30')];if(_0x337dcc[_0x0a01('0x31')][_0x0a01('0x42')]){_0x3906ed[_0x0a01('0x43')]=[{'all':!![]}];}_0x3906ed=_[_0x0a01('0x3f')]({},_0x3906ed,_0x337dcc['options']);return db[_0x0a01('0x41')][_0x0a01('0x46')](_0x3906ed)[_0x0a01('0x29')](handleEntityNotFound(_0x36afb0,null))[_0x0a01('0x29')](respondWithResult(_0x36afb0,null))['catch'](handleError(_0x36afb0,null));};exports[_0x0a01('0x47')]=function(_0x5487da,_0x572a6b){return db[_0x0a01('0x41')][_0x0a01('0x47')](_0x5487da['body'],{})[_0x0a01('0x29')](respondWithResult(_0x572a6b,0xc9))[_0x0a01('0x45')](handleError(_0x572a6b,null));};exports['update']=function(_0x51e6b8,_0x44f9c7){if(_0x51e6b8[_0x0a01('0x48')]['id']){delete _0x51e6b8[_0x0a01('0x48')]['id'];}return db['ChatGroup'][_0x0a01('0x46')]({'where':{'id':_0x51e6b8[_0x0a01('0x49')]['id']}})[_0x0a01('0x29')](handleEntityNotFound(_0x44f9c7,null))['then'](saveUpdates(_0x51e6b8['body'],null))[_0x0a01('0x29')](respondWithResult(_0x44f9c7,null))[_0x0a01('0x45')](handleError(_0x44f9c7,null));};exports[_0x0a01('0x4a')]=function(_0x1e0460,_0x25ef78){return db[_0x0a01('0x41')][_0x0a01('0x46')]({'where':{'id':_0x1e0460[_0x0a01('0x49')]['id']}})[_0x0a01('0x29')](handleEntityNotFound(_0x25ef78,null))[_0x0a01('0x29')](removeEntity(_0x25ef78,null))[_0x0a01('0x45')](handleError(_0x25ef78,null));};exports[_0x0a01('0x4b')]=function(_0x117811,_0x5a261f){return db[_0x0a01('0x41')][_0x0a01('0x4b')]()[_0x0a01('0x29')](respondWithResult(_0x5a261f,null))['catch'](handleError(_0x5a261f,null));};exports[_0x0a01('0x4c')]=function(_0x22e1db,_0x6b3e61,_0x2307e7){return db[_0x0a01('0x4d')][_0x0a01('0x21')]({'where':{'ChatGroupId':_0x22e1db[_0x0a01('0x49')]['id'],'ToId':_0x22e1db['user']['id'],'read':![]}})[_0x0a01('0x29')](function(_0x3bd110){return{'id':_[_0x0a01('0x4e')](_0x22e1db['params']['id']),'count':_0x3bd110};})[_0x0a01('0x29')](respondWithResult(_0x6b3e61,null))[_0x0a01('0x45')](handleError(_0x6b3e61,null));};exports['addMembers']=function(_0x459183,_0x276e92,_0x41085d){return db[_0x0a01('0x41')]['find']({'where':{'id':_0x459183[_0x0a01('0x49')]['id']}})['then'](handleEntityNotFound(_0x276e92,null))['then'](function(_0x336416){if(_0x336416){return _0x336416[_0x0a01('0x4f')](_0x459183['body'][_0x0a01('0x50')],_[_0x0a01('0x51')](_0x459183[_0x0a01('0x48')],[_0x0a01('0x50'),'id'])||{});}})[_0x0a01('0x29')](respondWithResult(_0x276e92,null))[_0x0a01('0x45')](handleError(_0x276e92,null));};exports[_0x0a01('0x52')]=function(_0x453a9b,_0x567bf4,_0x44908b){var _0x10f125={};var _0x8870b9={};var _0x333ac9;var _0x30fdc9;return db['ChatGroup'][_0x0a01('0x53')]({'where':{'id':_0x453a9b[_0x0a01('0x49')]['id']}})[_0x0a01('0x29')](handleEntityNotFound(_0x567bf4,null))[_0x0a01('0x29')](function(_0x1b5048){if(_0x1b5048){_0x333ac9=_0x1b5048;_0x8870b9[_0x0a01('0x30')]=_[_0x0a01('0x32')](db[_0x0a01('0x54')][_0x0a01('0x55')]);_0x8870b9[_0x0a01('0x31')]=_[_0x0a01('0x32')](_0x453a9b[_0x0a01('0x31')]);_0x8870b9[_0x0a01('0x33')]=_[_0x0a01('0x34')](_0x8870b9[_0x0a01('0x30')],_0x8870b9[_0x0a01('0x31')]);_0x10f125[_0x0a01('0x35')]=_['intersection'](_0x8870b9[_0x0a01('0x30')],qs[_0x0a01('0x36')](_0x453a9b['query'][_0x0a01('0x36')]));_0x10f125[_0x0a01('0x35')]=_0x10f125[_0x0a01('0x35')]['length']?_0x10f125[_0x0a01('0x35')]:_0x8870b9[_0x0a01('0x30')];_0x10f125[_0x0a01('0x39')]=qs[_0x0a01('0x3a')](_0x453a9b[_0x0a01('0x31')][_0x0a01('0x3a')]);_0x10f125[_0x0a01('0x3b')]=qs['filters'](_['pick'](_0x453a9b['query'],_0x8870b9[_0x0a01('0x33')]));if(_0x453a9b['query']['filter']){_0x10f125[_0x0a01('0x3b')]=_[_0x0a01('0x3f')](_0x10f125['where'],{'$or':_['map'](_0x10f125[_0x0a01('0x35')],function(_0x9b2049){var _0x44f67a={};_0x44f67a[_0x9b2049]={'$like':'%'+_0x453a9b[_0x0a01('0x31')]['filter']+'%'};return _0x44f67a;})});}_0x10f125=_[_0x0a01('0x3f')]({},_0x10f125,_0x453a9b[_0x0a01('0x40')]);return _0x333ac9['getMembers'](_0x10f125);}})[_0x0a01('0x29')](function(_0x2157ef){if(_0x2157ef){_0x30fdc9=_0x2157ef['length'];if(!_0x453a9b[_0x0a01('0x31')][_0x0a01('0x38')]('nolimit')){_0x10f125[_0x0a01('0x22')]=qs['limit'](_0x453a9b['query'][_0x0a01('0x22')]);_0x10f125[_0x0a01('0x1f')]=qs[_0x0a01('0x1f')](_0x453a9b[_0x0a01('0x31')][_0x0a01('0x1f')]);}return _0x333ac9[_0x0a01('0x52')](_0x10f125);}})['then'](function(_0x3334c1){if(_0x3334c1){return _0x3334c1?{'count':_0x30fdc9,'rows':_0x3334c1}:null;}})['then'](respondWithResult(_0x567bf4,null))[_0x0a01('0x45')](handleError(_0x567bf4,null));};exports[_0x0a01('0x56')]=function(_0x26f338,_0x2b425a,_0x398996){return db['ChatGroup'][_0x0a01('0x46')]({'where':{'id':_0x26f338[_0x0a01('0x49')]['id']}})[_0x0a01('0x29')](handleEntityNotFound(_0x2b425a,null))[_0x0a01('0x29')](function(_0x1dcca8){if(_0x1dcca8){return _0x1dcca8[_0x0a01('0x56')](_0x26f338[_0x0a01('0x31')][_0x0a01('0x50')]);}})['then'](respondWithStatusCode(_0x2b425a,null))['catch'](handleError(_0x2b425a,null));};exports[_0x0a01('0x57')]=function(_0x109665,_0x19742b,_0x457fa0){if(_0x109665[_0x0a01('0x48')]['id']){delete _0x109665[_0x0a01('0x48')]['id'];}return db['ChatGroup'][_0x0a01('0x46')]({'where':{'id':_0x109665[_0x0a01('0x49')]['id']}})[_0x0a01('0x29')](handleEntityNotFound(_0x19742b,null))['then'](function(_0x4621b0){if(_0x4621b0){_0x109665[_0x0a01('0x48')]['ChatGroupId']=_0x4621b0['id'];return db[_0x0a01('0x4d')][_0x0a01('0x47')](_0x109665['body']);}})['then'](respondWithResult(_0x19742b,null))[_0x0a01('0x45')](handleError(_0x19742b,null));};exports[_0x0a01('0x58')]=function(_0x1e27ce,_0xddb5c4,_0x2711b7){var _0x11ee75={};var _0x3e943d={};var _0x6533ff;var _0x1be833;return db[_0x0a01('0x41')]['findOne']({'where':{'id':_0x1e27ce[_0x0a01('0x49')]['id']}})[_0x0a01('0x29')](handleEntityNotFound(_0xddb5c4,null))['then'](function(_0x289d4b){if(_0x289d4b){_0x6533ff=_0x289d4b;_0x3e943d[_0x0a01('0x30')]=_['keys'](db[_0x0a01('0x4d')][_0x0a01('0x55')]);_0x3e943d[_0x0a01('0x31')]=_[_0x0a01('0x32')](_0x1e27ce['query']);_0x3e943d[_0x0a01('0x33')]=_['intersection'](_0x3e943d[_0x0a01('0x30')],_0x3e943d['query']);_0x11ee75['attributes']=_[_0x0a01('0x34')](_0x3e943d[_0x0a01('0x30')],qs[_0x0a01('0x36')](_0x1e27ce[_0x0a01('0x31')]['fields']));_0x11ee75[_0x0a01('0x35')]=_0x11ee75[_0x0a01('0x35')]['length']?_0x11ee75['attributes']:_0x3e943d[_0x0a01('0x30')];_0x11ee75[_0x0a01('0x39')]=qs[_0x0a01('0x3a')](_0x1e27ce[_0x0a01('0x31')][_0x0a01('0x3a')]);_0x11ee75[_0x0a01('0x3b')]=qs[_0x0a01('0x33')](_[_0x0a01('0x3c')](_0x1e27ce['query'],_0x3e943d[_0x0a01('0x33')]));if(_0x1e27ce[_0x0a01('0x31')][_0x0a01('0x3d')]){_0x11ee75[_0x0a01('0x3b')]=_['merge'](_0x11ee75[_0x0a01('0x3b')],{'$or':_['map'](_0x11ee75['attributes'],function(_0x3d6cf5){var _0x3a0a24={};_0x3a0a24[_0x3d6cf5]={'$like':'%'+_0x1e27ce[_0x0a01('0x31')][_0x0a01('0x3d')]+'%'};return _0x3a0a24;})});}if(_0x1e27ce['query'][_0x0a01('0x59')]){var _0x3670e1=_0x1e27ce[_0x0a01('0x31')][_0x0a01('0x59')][_0x0a01('0x5a')](',');var _0x3017d7={};_0x3017d7[_0x3670e1[0x0]]={'$gte':moment(_0x3670e1[0x1])[_0x0a01('0x5b')](_0x0a01('0x5c'))};_0x11ee75[_0x0a01('0x3b')]=_[_0x0a01('0x3f')](_0x11ee75[_0x0a01('0x3b')],_0x3017d7);}_0x11ee75=_[_0x0a01('0x3f')]({},_0x11ee75,_0x1e27ce[_0x0a01('0x40')]);return _0x6533ff[_0x0a01('0x58')](_0x11ee75);}})[_0x0a01('0x29')](function(_0x26fc14){if(_0x26fc14){_0x1be833=_0x26fc14[_0x0a01('0x37')];if(!_0x1e27ce[_0x0a01('0x31')][_0x0a01('0x38')](_0x0a01('0x5d'))){_0x11ee75['limit']=qs['limit'](_0x1e27ce[_0x0a01('0x31')]['limit']);_0x11ee75[_0x0a01('0x1f')]=qs['offset'](_0x1e27ce[_0x0a01('0x31')][_0x0a01('0x1f')]);}return _0x6533ff['getMessages'](_0x11ee75);}})['then'](function(_0x14eec8){if(_0x14eec8){return _0x14eec8?{'count':_0x1be833,'rows':_0x14eec8}:null;}})['then'](respondWithResult(_0xddb5c4,null))[_0x0a01('0x45')](handleError(_0xddb5c4,null));};
\ No newline at end of file
+var _0xaf76=['keys','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','findAll','catch','show','fields','includeAll','include','options','find','create','body','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','query'];(function(_0x26362d,_0x518e22){var _0x1d8b46=function(_0x48adbb){while(--_0x48adbb){_0x26362d['push'](_0x26362d['shift']());}};_0x1d8b46(++_0x518e22);}(_0xaf76,0xea));var _0x6af7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaf76[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6af7('0x0'));var zipdir=require(_0x6af7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6af7('0x2'));var Mustache=require(_0x6af7('0x3'));var util=require(_0x6af7('0x4'));var path=require('path');var sox=require(_0x6af7('0x5'));var csv=require(_0x6af7('0x6'));var ejs=require(_0x6af7('0x7'));var fs=require('fs');var fs_extra=require(_0x6af7('0x8'));var _=require(_0x6af7('0x9'));var squel=require('squel');var crypto=require(_0x6af7('0xa'));var jsforce=require(_0x6af7('0xb'));var deskjs=require(_0x6af7('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6af7('0xd'));var Redis=require(_0x6af7('0xe'));var authService=require(_0x6af7('0xf'));var qs=require(_0x6af7('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6af7('0x11'));var logger=require(_0x6af7('0x12'))(_0x6af7('0x13'));var utils=require(_0x6af7('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6af7('0x15'));var db=require('../../mysqldb')['db'];config[_0x6af7('0x16')]=_[_0x6af7('0x17')](config[_0x6af7('0x16')],{'host':_0x6af7('0x18'),'port':0x18eb});var socket=require(_0x6af7('0x19'))(new Redis(config[_0x6af7('0x16')]));require(_0x6af7('0x1a'))[_0x6af7('0x1b')](socket);function respondWithStatusCode(_0x162d8b,_0x2750bc){_0x2750bc=_0x2750bc||0xcc;return function(_0x1cab02){if(_0x1cab02){return _0x162d8b[_0x6af7('0x1c')](_0x2750bc);}return _0x162d8b[_0x6af7('0x1d')](_0x2750bc)['end']();};}function respondWithResult(_0x2688b5,_0x192ffe){_0x192ffe=_0x192ffe||0xc8;return function(_0x49d8df){if(_0x49d8df){return _0x2688b5[_0x6af7('0x1d')](_0x192ffe)[_0x6af7('0x1e')](_0x49d8df);}};}function respondWithFilteredResult(_0x350552,_0xab3963){return function(_0x3b8e8c){if(_0x3b8e8c){var _0x573eb9=typeof _0xab3963[_0x6af7('0x1f')]==='undefined'&&typeof _0xab3963['limit']===_0x6af7('0x20');var _0x2ea309=_0x3b8e8c['count'];var _0x5c3630=_0x573eb9?0x0:_0xab3963[_0x6af7('0x1f')];var _0x1ffe96=_0x573eb9?_0x3b8e8c[_0x6af7('0x21')]:_0xab3963[_0x6af7('0x1f')]+_0xab3963[_0x6af7('0x22')];var _0x245eb9;if(_0x1ffe96>=_0x2ea309){_0x1ffe96=_0x2ea309;_0x245eb9=0xc8;}else{_0x245eb9=0xce;}_0x350552[_0x6af7('0x1d')](_0x245eb9);return _0x350552[_0x6af7('0x23')](_0x6af7('0x24'),_0x5c3630+'-'+_0x1ffe96+'/'+_0x2ea309)[_0x6af7('0x1e')](_0x3b8e8c);}return null;};}function patchUpdates(_0x4f20ee){return function(_0x4031d7){try{jsonpatch['apply'](_0x4031d7,_0x4f20ee,!![]);}catch(_0x46ee97){return BPromise[_0x6af7('0x25')](_0x46ee97);}return _0x4031d7[_0x6af7('0x26')]();};}function saveUpdates(_0x43b942,_0x2d17c0){return function(_0x3a9afa){if(_0x3a9afa){return _0x3a9afa[_0x6af7('0x27')](_0x43b942)[_0x6af7('0x28')](function(_0x2f8e59){return _0x2f8e59;});}return null;};}function removeEntity(_0x1d5f33,_0x11a1c9){return function(_0x3aa096){if(_0x3aa096){return _0x3aa096[_0x6af7('0x29')]()[_0x6af7('0x28')](function(){_0x1d5f33[_0x6af7('0x1d')](0xcc)[_0x6af7('0x2a')]();});}};}function handleEntityNotFound(_0x82e45f,_0x1141db){return function(_0x3db8f0){if(!_0x3db8f0){_0x82e45f[_0x6af7('0x1c')](0x194);}return _0x3db8f0;};}function handleError(_0x4f8f55,_0x1fee4b){_0x1fee4b=_0x1fee4b||0x1f4;return function(_0x4d8955){logger[_0x6af7('0x2b')](_0x4d8955[_0x6af7('0x2c')]);if(_0x4d8955[_0x6af7('0x2d')]){delete _0x4d8955[_0x6af7('0x2d')];}_0x4f8f55[_0x6af7('0x1d')](_0x1fee4b)[_0x6af7('0x2e')](_0x4d8955);};}exports[_0x6af7('0x2f')]=function(_0x1a0288,_0x257c8c){var _0x2190b3={},_0x1159fd={},_0x530cef={'count':0x0,'rows':[]};var _0x5176fd=_[_0x6af7('0x30')](db[_0x6af7('0x31')][_0x6af7('0x32')],function(_0x55fe80){return{'name':_0x55fe80[_0x6af7('0x33')],'type':_0x55fe80[_0x6af7('0x34')]['key']};});_0x1159fd['model']=_['map'](_0x5176fd,_0x6af7('0x2d'));_0x1159fd[_0x6af7('0x35')]=_[_0x6af7('0x36')](_0x1a0288[_0x6af7('0x35')]);_0x1159fd[_0x6af7('0x37')]=_['intersection'](_0x1159fd[_0x6af7('0x38')],_0x1159fd['query']);_0x2190b3[_0x6af7('0x39')]=_[_0x6af7('0x3a')](_0x1159fd[_0x6af7('0x38')],qs['fields'](_0x1a0288[_0x6af7('0x35')]['fields']));_0x2190b3[_0x6af7('0x39')]=_0x2190b3[_0x6af7('0x39')][_0x6af7('0x3b')]?_0x2190b3['attributes']:_0x1159fd[_0x6af7('0x38')];if(!_0x1a0288[_0x6af7('0x35')][_0x6af7('0x3c')](_0x6af7('0x3d'))){_0x2190b3[_0x6af7('0x22')]=qs['limit'](_0x1a0288[_0x6af7('0x35')][_0x6af7('0x22')]);_0x2190b3[_0x6af7('0x1f')]=qs['offset'](_0x1a0288[_0x6af7('0x35')][_0x6af7('0x1f')]);}_0x2190b3[_0x6af7('0x3e')]=qs[_0x6af7('0x3f')](_0x1a0288[_0x6af7('0x35')][_0x6af7('0x3f')]);_0x2190b3['where']=qs['filters'](_['pick'](_0x1a0288[_0x6af7('0x35')],_0x1159fd[_0x6af7('0x37')]),_0x5176fd);if(_0x1a0288[_0x6af7('0x35')][_0x6af7('0x40')]){_0x2190b3[_0x6af7('0x41')]=_[_0x6af7('0x42')](_0x2190b3[_0x6af7('0x41')],{'$or':_[_0x6af7('0x30')](_0x5176fd,function(_0x303e1b){if(_0x303e1b[_0x6af7('0x34')]!==_0x6af7('0x43')){var _0x14ed90={};_0x14ed90[_0x303e1b['name']]={'$like':'%'+_0x1a0288[_0x6af7('0x35')][_0x6af7('0x40')]+'%'};return _0x14ed90;}})});}_0x2190b3=_[_0x6af7('0x42')]({},_0x2190b3,_0x1a0288['options']);var _0x582370={'where':_0x2190b3[_0x6af7('0x41')]};return db[_0x6af7('0x31')]['count'](_0x582370)[_0x6af7('0x28')](function(_0xfb1f5){_0x530cef['count']=_0xfb1f5;if(_0x1a0288[_0x6af7('0x35')]['includeAll']){_0x2190b3['include']=[{'all':!![]}];}return db[_0x6af7('0x31')][_0x6af7('0x44')](_0x2190b3);})['then'](function(_0x5a2dec){_0x530cef['rows']=_0x5a2dec;return _0x530cef;})['then'](respondWithFilteredResult(_0x257c8c,_0x2190b3))[_0x6af7('0x45')](handleError(_0x257c8c,null));};exports[_0x6af7('0x46')]=function(_0x10945e,_0x5ca71c){var _0x4e8272={'raw':!![],'where':{'id':_0x10945e['params']['id']}},_0x52b3de={};_0x52b3de[_0x6af7('0x38')]=_[_0x6af7('0x36')](db[_0x6af7('0x31')]['rawAttributes']);_0x52b3de[_0x6af7('0x35')]=_[_0x6af7('0x36')](_0x10945e[_0x6af7('0x35')]);_0x52b3de[_0x6af7('0x37')]=_[_0x6af7('0x3a')](_0x52b3de[_0x6af7('0x38')],_0x52b3de[_0x6af7('0x35')]);_0x4e8272[_0x6af7('0x39')]=_[_0x6af7('0x3a')](_0x52b3de[_0x6af7('0x38')],qs[_0x6af7('0x47')](_0x10945e[_0x6af7('0x35')]['fields']));_0x4e8272[_0x6af7('0x39')]=_0x4e8272[_0x6af7('0x39')]['length']?_0x4e8272['attributes']:_0x52b3de[_0x6af7('0x38')];if(_0x10945e[_0x6af7('0x35')][_0x6af7('0x48')]){_0x4e8272[_0x6af7('0x49')]=[{'all':!![]}];}_0x4e8272=_[_0x6af7('0x42')]({},_0x4e8272,_0x10945e[_0x6af7('0x4a')]);return db[_0x6af7('0x31')][_0x6af7('0x4b')](_0x4e8272)[_0x6af7('0x28')](handleEntityNotFound(_0x5ca71c,null))[_0x6af7('0x28')](respondWithResult(_0x5ca71c,null))['catch'](handleError(_0x5ca71c,null));};exports[_0x6af7('0x4c')]=function(_0x58383b,_0x410ef0){return db['ChatGroup']['create'](_0x58383b[_0x6af7('0x4d')],{})[_0x6af7('0x28')](respondWithResult(_0x410ef0,0xc9))[_0x6af7('0x45')](handleError(_0x410ef0,null));};exports[_0x6af7('0x27')]=function(_0x52cc48,_0x2b88a0){if(_0x52cc48[_0x6af7('0x4d')]['id']){delete _0x52cc48[_0x6af7('0x4d')]['id'];}return db[_0x6af7('0x31')]['find']({'where':{'id':_0x52cc48[_0x6af7('0x4e')]['id']}})[_0x6af7('0x28')](handleEntityNotFound(_0x2b88a0,null))[_0x6af7('0x28')](saveUpdates(_0x52cc48[_0x6af7('0x4d')],null))[_0x6af7('0x28')](respondWithResult(_0x2b88a0,null))['catch'](handleError(_0x2b88a0,null));};exports['destroy']=function(_0x42de3,_0x4ad614){return db[_0x6af7('0x31')][_0x6af7('0x4b')]({'where':{'id':_0x42de3[_0x6af7('0x4e')]['id']}})[_0x6af7('0x28')](handleEntityNotFound(_0x4ad614,null))['then'](removeEntity(_0x4ad614,null))[_0x6af7('0x45')](handleError(_0x4ad614,null));};exports[_0x6af7('0x4f')]=function(_0x3aa3ca,_0x4b1fe8){return db[_0x6af7('0x31')]['describe']()[_0x6af7('0x28')](respondWithResult(_0x4b1fe8,null))[_0x6af7('0x45')](handleError(_0x4b1fe8,null));};exports[_0x6af7('0x50')]=function(_0x4174d7,_0x27689e,_0x40ae55){return db[_0x6af7('0x51')][_0x6af7('0x21')]({'where':{'ChatGroupId':_0x4174d7[_0x6af7('0x4e')]['id'],'ToId':_0x4174d7[_0x6af7('0x52')]['id'],'read':![]}})[_0x6af7('0x28')](function(_0x86b214){return{'id':_[_0x6af7('0x53')](_0x4174d7[_0x6af7('0x4e')]['id']),'count':_0x86b214};})[_0x6af7('0x28')](respondWithResult(_0x27689e,null))[_0x6af7('0x45')](handleError(_0x27689e,null));};exports[_0x6af7('0x54')]=function(_0x12438e,_0x1768cc,_0x1b41e0){return db[_0x6af7('0x31')][_0x6af7('0x4b')]({'where':{'id':_0x12438e[_0x6af7('0x4e')]['id']}})[_0x6af7('0x28')](handleEntityNotFound(_0x1768cc,null))[_0x6af7('0x28')](function(_0x38daab){if(_0x38daab){return _0x38daab['addMembers'](_0x12438e[_0x6af7('0x4d')][_0x6af7('0x55')],_[_0x6af7('0x56')](_0x12438e[_0x6af7('0x4d')],[_0x6af7('0x55'),'id'])||{});}})['then'](respondWithResult(_0x1768cc,null))[_0x6af7('0x45')](handleError(_0x1768cc,null));};exports[_0x6af7('0x57')]=function(_0x1c441a,_0x31016a,_0x41d5c3){var _0x5eef6b={};var _0x3202ab={};var _0x5ec47e;var _0x52fd6f;return db[_0x6af7('0x31')][_0x6af7('0x58')]({'where':{'id':_0x1c441a['params']['id']}})[_0x6af7('0x28')](handleEntityNotFound(_0x31016a,null))[_0x6af7('0x28')](function(_0x29b17d){if(_0x29b17d){_0x5ec47e=_0x29b17d;_0x3202ab['model']=_['keys'](db[_0x6af7('0x59')][_0x6af7('0x32')]);_0x3202ab['query']=_[_0x6af7('0x36')](_0x1c441a[_0x6af7('0x35')]);_0x3202ab[_0x6af7('0x37')]=_[_0x6af7('0x3a')](_0x3202ab[_0x6af7('0x38')],_0x3202ab[_0x6af7('0x35')]);_0x5eef6b[_0x6af7('0x39')]=_[_0x6af7('0x3a')](_0x3202ab[_0x6af7('0x38')],qs[_0x6af7('0x47')](_0x1c441a[_0x6af7('0x35')][_0x6af7('0x47')]));_0x5eef6b[_0x6af7('0x39')]=_0x5eef6b[_0x6af7('0x39')]['length']?_0x5eef6b[_0x6af7('0x39')]:_0x3202ab[_0x6af7('0x38')];_0x5eef6b[_0x6af7('0x3e')]=qs[_0x6af7('0x3f')](_0x1c441a[_0x6af7('0x35')][_0x6af7('0x3f')]);_0x5eef6b['where']=qs[_0x6af7('0x37')](_['pick'](_0x1c441a['query'],_0x3202ab[_0x6af7('0x37')]));if(_0x1c441a[_0x6af7('0x35')][_0x6af7('0x40')]){_0x5eef6b[_0x6af7('0x41')]=_[_0x6af7('0x42')](_0x5eef6b['where'],{'$or':_[_0x6af7('0x30')](_0x5eef6b[_0x6af7('0x39')],function(_0x3738ad){var _0x58e230={};_0x58e230[_0x3738ad]={'$like':'%'+_0x1c441a['query'][_0x6af7('0x40')]+'%'};return _0x58e230;})});}_0x5eef6b=_[_0x6af7('0x42')]({},_0x5eef6b,_0x1c441a[_0x6af7('0x4a')]);return _0x5ec47e[_0x6af7('0x57')](_0x5eef6b);}})[_0x6af7('0x28')](function(_0x2115f4){if(_0x2115f4){_0x52fd6f=_0x2115f4[_0x6af7('0x3b')];if(!_0x1c441a['query']['hasOwnProperty'](_0x6af7('0x3d'))){_0x5eef6b['limit']=qs['limit'](_0x1c441a[_0x6af7('0x35')][_0x6af7('0x22')]);_0x5eef6b['offset']=qs[_0x6af7('0x1f')](_0x1c441a[_0x6af7('0x35')][_0x6af7('0x1f')]);}return _0x5ec47e[_0x6af7('0x57')](_0x5eef6b);}})['then'](function(_0xeb42e){if(_0xeb42e){return _0xeb42e?{'count':_0x52fd6f,'rows':_0xeb42e}:null;}})[_0x6af7('0x28')](respondWithResult(_0x31016a,null))[_0x6af7('0x45')](handleError(_0x31016a,null));};exports[_0x6af7('0x5a')]=function(_0x53f5c3,_0x2be882,_0x26b60c){return db[_0x6af7('0x31')][_0x6af7('0x4b')]({'where':{'id':_0x53f5c3[_0x6af7('0x4e')]['id']}})[_0x6af7('0x28')](handleEntityNotFound(_0x2be882,null))[_0x6af7('0x28')](function(_0x447c50){if(_0x447c50){return _0x447c50[_0x6af7('0x5a')](_0x53f5c3[_0x6af7('0x35')][_0x6af7('0x55')]);}})[_0x6af7('0x28')](respondWithStatusCode(_0x2be882,null))['catch'](handleError(_0x2be882,null));};exports[_0x6af7('0x5b')]=function(_0x435c57,_0x3b5b67,_0x1d7fdf){if(_0x435c57[_0x6af7('0x4d')]['id']){delete _0x435c57[_0x6af7('0x4d')]['id'];}return db[_0x6af7('0x31')][_0x6af7('0x4b')]({'where':{'id':_0x435c57[_0x6af7('0x4e')]['id']}})[_0x6af7('0x28')](handleEntityNotFound(_0x3b5b67,null))[_0x6af7('0x28')](function(_0x124bfc){if(_0x124bfc){_0x435c57[_0x6af7('0x4d')][_0x6af7('0x5c')]=_0x124bfc['id'];return db[_0x6af7('0x51')][_0x6af7('0x4c')](_0x435c57[_0x6af7('0x4d')]);}})[_0x6af7('0x28')](respondWithResult(_0x3b5b67,null))['catch'](handleError(_0x3b5b67,null));};exports[_0x6af7('0x5d')]=function(_0x58b727,_0x23da3f,_0x42ba63){var _0x5e64a7={};var _0x279f76={};var _0x17586f;var _0x21081c;return db[_0x6af7('0x31')][_0x6af7('0x58')]({'where':{'id':_0x58b727[_0x6af7('0x4e')]['id']}})['then'](handleEntityNotFound(_0x23da3f,null))['then'](function(_0x282d59){if(_0x282d59){_0x17586f=_0x282d59;_0x279f76[_0x6af7('0x38')]=_[_0x6af7('0x36')](db[_0x6af7('0x51')][_0x6af7('0x32')]);_0x279f76['query']=_[_0x6af7('0x36')](_0x58b727['query']);_0x279f76[_0x6af7('0x37')]=_[_0x6af7('0x3a')](_0x279f76[_0x6af7('0x38')],_0x279f76[_0x6af7('0x35')]);_0x5e64a7[_0x6af7('0x39')]=_[_0x6af7('0x3a')](_0x279f76['model'],qs['fields'](_0x58b727[_0x6af7('0x35')][_0x6af7('0x47')]));_0x5e64a7[_0x6af7('0x39')]=_0x5e64a7[_0x6af7('0x39')]['length']?_0x5e64a7[_0x6af7('0x39')]:_0x279f76[_0x6af7('0x38')];_0x5e64a7[_0x6af7('0x3e')]=qs[_0x6af7('0x3f')](_0x58b727['query'][_0x6af7('0x3f')]);_0x5e64a7[_0x6af7('0x41')]=qs[_0x6af7('0x37')](_['pick'](_0x58b727['query'],_0x279f76[_0x6af7('0x37')]));if(_0x58b727[_0x6af7('0x35')][_0x6af7('0x40')]){_0x5e64a7[_0x6af7('0x41')]=_[_0x6af7('0x42')](_0x5e64a7[_0x6af7('0x41')],{'$or':_['map'](_0x5e64a7['attributes'],function(_0x25cd02){var _0x2e5a74={};_0x2e5a74[_0x25cd02]={'$like':'%'+_0x58b727[_0x6af7('0x35')]['filter']+'%'};return _0x2e5a74;})});}if(_0x58b727[_0x6af7('0x35')][_0x6af7('0x5e')]){var _0x3d4a5a=_0x58b727[_0x6af7('0x35')][_0x6af7('0x5e')]['split'](',');var _0x3b725e={};_0x3b725e[_0x3d4a5a[0x0]]={'$gte':moment(_0x3d4a5a[0x1])['format'](_0x6af7('0x5f'))};_0x5e64a7[_0x6af7('0x41')]=_[_0x6af7('0x42')](_0x5e64a7[_0x6af7('0x41')],_0x3b725e);}_0x5e64a7=_[_0x6af7('0x42')]({},_0x5e64a7,_0x58b727[_0x6af7('0x4a')]);return _0x17586f['getMessages'](_0x5e64a7);}})['then'](function(_0x56c142){if(_0x56c142){_0x21081c=_0x56c142[_0x6af7('0x3b')];if(!_0x58b727[_0x6af7('0x35')][_0x6af7('0x3c')](_0x6af7('0x3d'))){_0x5e64a7[_0x6af7('0x22')]=qs[_0x6af7('0x22')](_0x58b727[_0x6af7('0x35')][_0x6af7('0x22')]);_0x5e64a7['offset']=qs[_0x6af7('0x1f')](_0x58b727['query'][_0x6af7('0x1f')]);}return _0x17586f[_0x6af7('0x5d')](_0x5e64a7);}})['then'](function(_0x160a13){if(_0x160a13){return _0x160a13?{'count':_0x21081c,'rows':_0x160a13}:null;}})[_0x6af7('0x28')](respondWithResult(_0x23da3f,null))[_0x6af7('0x45')](handleError(_0x23da3f,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 9cdd646..1f1075c 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 _0x6bd1=['emit','events','../../mysqldb','ChatGroup','setMaxListeners','save','update'];(function(_0x287184,_0x1231a7){var _0x1b59f3=function(_0x28ba9a){while(--_0x28ba9a){_0x287184['push'](_0x287184['shift']());}};_0x1b59f3(++_0x1231a7);}(_0x6bd1,0xe8));var _0x16bd=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x6bd1[_0x46698a];return _0x356db0;};'use strict';var EventEmitter=require(_0x16bd('0x0'));var ChatGroup=require(_0x16bd('0x1'))['db'][_0x16bd('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x16bd('0x3')](0x0);var events={'afterCreate':_0x16bd('0x4'),'afterUpdate':_0x16bd('0x5'),'afterDestroy':'remove'};function emitEvent(_0x42c392){return function(_0x13490f,_0x167f73,_0x5943a3){ChatGroupEvents[_0x16bd('0x6')](_0x42c392+':'+_0x13490f['id'],_0x13490f);ChatGroupEvents[_0x16bd('0x6')](_0x42c392,_0x13490f);_0x5943a3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0xe969=['hasOwnProperty','hook','../../mysqldb','ChatGroup','setMaxListeners','update','remove','emit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe969,0x11a));var _0x9e96=function(_0x59ded6,_0x2d75a6){_0x59ded6=_0x59ded6-0x0;var _0x370563=_0xe969[_0x59ded6];return _0x370563;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x9e96('0x0'))['db'][_0x9e96('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x9e96('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9e96('0x3'),'afterDestroy':_0x9e96('0x4')};function emitEvent(_0x73d180){return function(_0x4adb1d,_0x38694b,_0x5a0c99){ChatGroupEvents[_0x9e96('0x5')](_0x73d180+':'+_0x4adb1d['id'],_0x4adb1d);ChatGroupEvents[_0x9e96('0x5')](_0x73d180,_0x4adb1d);_0x5a0c99(null);};}for(var e in events){if(events[_0x9e96('0x6')](e)){var event=events[e];ChatGroup[_0x9e96('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index f1556b2..c0f8a00 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 _0xe1b1=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups'];(function(_0x2bac49,_0x1ff679){var _0x2fba36=function(_0x262320){while(--_0x262320){_0x2bac49['push'](_0x2bac49['shift']());}};_0x2fba36(++_0x1ff679);}(_0xe1b1,0x69));var _0x1e1b=function(_0x110844,_0x372560){_0x110844=_0x110844-0x0;var _0x55c2c6=_0xe1b1[_0x110844];return _0x55c2c6;};'use strict';var _=require(_0x1e1b('0x0'));var util=require(_0x1e1b('0x1'));var logger=require(_0x1e1b('0x2'))(_0x1e1b('0x3'));var moment=require(_0x1e1b('0x4'));var BPromise=require(_0x1e1b('0x5'));var rp=require(_0x1e1b('0x6'));var fs=require('fs');var path=require(_0x1e1b('0x7'));var rimraf=require(_0x1e1b('0x8'));var config=require(_0x1e1b('0x9'));var attributes=require(_0x1e1b('0xa'));module[_0x1e1b('0xb')]=function(_0xf6d9b5,_0x4fd1c8){return _0xf6d9b5[_0x1e1b('0xc')](_0x1e1b('0xd'),attributes,{'tableName':_0x1e1b('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9cf0=['./chatGroup.attributes','define','ChatGroup','lodash','util','api','moment','request-promise','rimraf'];(function(_0x53e29e,_0x17c540){var _0x54c118=function(_0x45b1bf){while(--_0x45b1bf){_0x53e29e['push'](_0x53e29e['shift']());}};_0x54c118(++_0x17c540);}(_0x9cf0,0xe4));var _0x09cf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9cf0[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x09cf('0x0'));var util=require(_0x09cf('0x1'));var logger=require('../../config/logger')(_0x09cf('0x2'));var moment=require(_0x09cf('0x3'));var BPromise=require('bluebird');var rp=require(_0x09cf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x09cf('0x5'));var config=require('../../config/environment');var attributes=require(_0x09cf('0x6'));module['exports']=function(_0x310539,_0x4de535){return _0x310539[_0x09cf('0x7')](_0x09cf('0x8'),attributes,{'tableName':'chat_groups','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 9dcd6e0..f656055 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 _0x8f9e=['socket.io-emitter','./chatGroup.socket','register','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x193e28,_0x3dac1d){var _0x20ef59=function(_0x48047e){while(--_0x48047e){_0x193e28['push'](_0x193e28['shift']());}};_0x20ef59(++_0x3dac1d);}(_0x8f9e,0x160));var _0xe8f9=function(_0x491d38,_0xf06ba1){_0x491d38=_0x491d38-0x0;var _0xc066de=_0x8f9e[_0x491d38];return _0xc066de;};'use strict';var _=require(_0xe8f9('0x0'));var util=require(_0xe8f9('0x1'));var moment=require('moment');var BPromise=require(_0xe8f9('0x2'));var rs=require(_0xe8f9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe8f9('0x4'))('rpc');var config=require(_0xe8f9('0x5'));var jayson=require(_0xe8f9('0x6'));var client=jayson[_0xe8f9('0x7')][_0xe8f9('0x8')]({'port':0x232a});config[_0xe8f9('0x9')]=_[_0xe8f9('0xa')](config['redis'],{'host':_0xe8f9('0xb'),'port':0x18eb});var socket=require(_0xe8f9('0xc'))(new Redis(config[_0xe8f9('0x9')]));require(_0xe8f9('0xd'))[_0xe8f9('0xe')](socket);function respondWithRpcPromise(_0x4b2417,_0x8c8658,_0x88109d){return new BPromise(function(_0x7ce949,_0x404b2b){return client[_0xe8f9('0xf')](_0x4b2417,_0x88109d)[_0xe8f9('0x10')](function(_0x59b0ca){logger[_0xe8f9('0x11')]('ChatGroup,\x20%s,\x20%s',_0x8c8658,_0xe8f9('0x12'));logger[_0xe8f9('0x13')](_0xe8f9('0x14'),_0x8c8658,'request\x20sent',JSON[_0xe8f9('0x15')](_0x59b0ca));if(_0x59b0ca[_0xe8f9('0x16')]){if(_0x59b0ca['error'][_0xe8f9('0x17')]===0x1f4){logger['error'](_0xe8f9('0x18'),_0x8c8658,_0x59b0ca['error'][_0xe8f9('0x19')]);return _0x404b2b(_0x59b0ca[_0xe8f9('0x16')][_0xe8f9('0x19')]);}logger[_0xe8f9('0x16')](_0xe8f9('0x18'),_0x8c8658,_0x59b0ca[_0xe8f9('0x16')][_0xe8f9('0x19')]);return _0x7ce949(_0x59b0ca[_0xe8f9('0x16')][_0xe8f9('0x19')]);}else{logger[_0xe8f9('0x11')](_0xe8f9('0x18'),_0x8c8658,_0xe8f9('0x12'));_0x7ce949(_0x59b0ca[_0xe8f9('0x1a')][_0xe8f9('0x19')]);}})[_0xe8f9('0x1b')](function(_0x3309de){logger['error'](_0xe8f9('0x18'),_0x8c8658,_0x3309de);_0x404b2b(_0x3309de);});});}
\ No newline at end of file
+var _0x3435=['register','request','info','ChatGroup,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','defaults','redis','localhost','socket.io-emitter'];(function(_0x3c2d00,_0xb9f383){var _0xa3c945=function(_0x28d0fc){while(--_0x28d0fc){_0x3c2d00['push'](_0x3c2d00['shift']());}};_0xa3c945(++_0xb9f383);}(_0x3435,0xfa));var _0x5343=function(_0x178856,_0x41f045){_0x178856=_0x178856-0x0;var _0x3c7fe7=_0x3435[_0x178856];return _0x3c7fe7;};'use strict';var _=require(_0x5343('0x0'));var util=require(_0x5343('0x1'));var moment=require(_0x5343('0x2'));var BPromise=require(_0x5343('0x3'));var rs=require(_0x5343('0x4'));var fs=require('fs');var Redis=require(_0x5343('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5343('0x6'));var logger=require(_0x5343('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5343('0x8'));var client=jayson[_0x5343('0x9')]['http']({'port':0x232a});config['redis']=_[_0x5343('0xa')](config[_0x5343('0xb')],{'host':_0x5343('0xc'),'port':0x18eb});var socket=require(_0x5343('0xd'))(new Redis(config[_0x5343('0xb')]));require('./chatGroup.socket')[_0x5343('0xe')](socket);function respondWithRpcPromise(_0x50d857,_0x1b310a,_0x328e54){return new BPromise(function(_0x27ed68,_0x2e6df1){return client[_0x5343('0xf')](_0x50d857,_0x328e54)['then'](function(_0x42a94a){logger[_0x5343('0x10')](_0x5343('0x11'),_0x1b310a,'request\x20sent');logger[_0x5343('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x1b310a,_0x5343('0x13'),JSON[_0x5343('0x14')](_0x42a94a));if(_0x42a94a['error']){if(_0x42a94a[_0x5343('0x15')]['code']===0x1f4){logger[_0x5343('0x15')](_0x5343('0x11'),_0x1b310a,_0x42a94a[_0x5343('0x15')][_0x5343('0x16')]);return _0x2e6df1(_0x42a94a['error'][_0x5343('0x16')]);}logger[_0x5343('0x15')](_0x5343('0x11'),_0x1b310a,_0x42a94a[_0x5343('0x15')][_0x5343('0x16')]);return _0x27ed68(_0x42a94a[_0x5343('0x15')][_0x5343('0x16')]);}else{logger[_0x5343('0x10')]('ChatGroup,\x20%s,\x20%s',_0x1b310a,_0x5343('0x13'));_0x27ed68(_0x42a94a[_0x5343('0x17')][_0x5343('0x16')]);}})['catch'](function(_0x1eb3bd){logger[_0x5343('0x15')](_0x5343('0x11'),_0x1b310a,_0x1eb3bd);_0x2e6df1(_0x1eb3bd);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 1fd494c..3e3ea0d 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 _0x14e6=['update','emit','register','length','chatGroup:','./chatGroup.events','save','remove'];(function(_0x288b0c,_0x320f29){var _0x4c4681=function(_0x1cf78c){while(--_0x1cf78c){_0x288b0c['push'](_0x288b0c['shift']());}};_0x4c4681(++_0x320f29);}(_0x14e6,0xa5));var _0x614e=function(_0x4ae024,_0x2e3bfc){_0x4ae024=_0x4ae024-0x0;var _0x1b0f81=_0x14e6[_0x4ae024];return _0x1b0f81;};'use strict';var ChatGroupEvents=require(_0x614e('0x0'));var events=[_0x614e('0x1'),_0x614e('0x2'),_0x614e('0x3')];function createListener(_0x3eb157,_0x258c26){return function(_0x1c8267){_0x258c26[_0x614e('0x4')](_0x3eb157,_0x1c8267);};}function removeListener(_0x34f133,_0x18dbd1){return function(){ChatGroupEvents['removeListener'](_0x34f133,_0x18dbd1);};}exports[_0x614e('0x5')]=function(_0x3a08c0){for(var _0x2bd04d=0x0,_0x93f318=events[_0x614e('0x6')];_0x2bd04d<_0x93f318;_0x2bd04d++){var _0x5723af=events[_0x2bd04d];var _0x41a010=createListener(_0x614e('0x7')+_0x5723af,_0x3a08c0);ChatGroupEvents['on'](_0x5723af,_0x41a010);}};
\ No newline at end of file
+var _0x82cf=['removeListener','register','length','chatGroup:','./chatGroup.events','save','remove','update','emit'];(function(_0xe8129c,_0x2fb03c){var _0x709fc5=function(_0xb8e0c6){while(--_0xb8e0c6){_0xe8129c['push'](_0xe8129c['shift']());}};_0x709fc5(++_0x2fb03c);}(_0x82cf,0x79));var _0xf82c=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x82cf[_0x2d7f0e];return _0x110b07;};'use strict';var ChatGroupEvents=require(_0xf82c('0x0'));var events=[_0xf82c('0x1'),_0xf82c('0x2'),_0xf82c('0x3')];function createListener(_0x482c9e,_0x522146){return function(_0x1d9514){_0x522146[_0xf82c('0x4')](_0x482c9e,_0x1d9514);};}function removeListener(_0x19575f,_0x1eec85){return function(){ChatGroupEvents[_0xf82c('0x5')](_0x19575f,_0x1eec85);};}exports[_0xf82c('0x6')]=function(_0x1746c4){for(var _0xf8d72a=0x0,_0x3e5163=events[_0xf82c('0x7')];_0xf8d72a<_0x3e5163;_0xf8d72a++){var _0x2839c2=events[_0xf8d72a];var _0x39862d=createListener(_0xf82c('0x8')+_0x2839c2,_0x1746c4);ChatGroupEvents['on'](_0x2839c2,_0x39862d);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index da90d47..52c2467 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 _0xaee8=['/:id','show','/:id/unread','getUnread','getMembers','/:id/messages','getMessages','post','/:id/members','delete','removeMembers','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','/describe','isAuthenticated','describe'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xaee8,0x143));var _0x8aee=function(_0x41fcb8,_0x12c1e9){_0x41fcb8=_0x41fcb8-0x0;var _0x3c7d62=_0xaee8[_0x41fcb8];return _0x3c7d62;};'use strict';var multer=require(_0x8aee('0x0'));var util=require(_0x8aee('0x1'));var path=require(_0x8aee('0x2'));var timeout=require(_0x8aee('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8aee('0x4'));var auth=require(_0x8aee('0x5'));var interaction=require(_0x8aee('0x6'));var config=require(_0x8aee('0x7'));var controller=require(_0x8aee('0x8'));router[_0x8aee('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8aee('0xa'),auth[_0x8aee('0xb')](),controller[_0x8aee('0xc')]);router[_0x8aee('0x9')](_0x8aee('0xd'),auth[_0x8aee('0xb')](),controller[_0x8aee('0xe')]);router[_0x8aee('0x9')](_0x8aee('0xf'),auth[_0x8aee('0xb')](),controller[_0x8aee('0x10')]);router['get']('/:id/members',auth[_0x8aee('0xb')](),controller[_0x8aee('0x11')]);router[_0x8aee('0x9')](_0x8aee('0x12'),auth['isAuthenticated'](),controller[_0x8aee('0x13')]);router['post']('/',auth[_0x8aee('0xb')](),controller['create']);router[_0x8aee('0x14')](_0x8aee('0x15'),auth[_0x8aee('0xb')](),controller['addMembers']);router[_0x8aee('0x14')](_0x8aee('0x12'),auth[_0x8aee('0xb')](),controller['addMessage']);router['put'](_0x8aee('0xd'),auth[_0x8aee('0xb')](),controller['update']);router[_0x8aee('0x16')]('/:id',auth[_0x8aee('0xb')](),controller['destroy']);router[_0x8aee('0x16')](_0x8aee('0x15'),auth[_0x8aee('0xb')](),controller[_0x8aee('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x9c6c=['get','isAuthenticated','describe','/:id/unread','getUnread','/:id/members','getMembers','getMessages','post','create','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','fs-extra'];(function(_0x350d9e,_0x1d8afb){var _0x6cc933=function(_0x5344b2){while(--_0x5344b2){_0x350d9e['push'](_0x350d9e['shift']());}};_0x6cc933(++_0x1d8afb);}(_0x9c6c,0x113));var _0xc9c6=function(_0x42ec17,_0x2758a0){_0x42ec17=_0x42ec17-0x0;var _0x5bae9e=_0x9c6c[_0x42ec17];return _0x5bae9e;};'use strict';var multer=require(_0xc9c6('0x0'));var util=require('util');var path=require(_0xc9c6('0x1'));var timeout=require(_0xc9c6('0x2'));var express=require(_0xc9c6('0x3'));var router=express['Router']();var fs_extra=require(_0xc9c6('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatGroup.controller');router[_0xc9c6('0x5')]('/',auth[_0xc9c6('0x6')](),controller['index']);router[_0xc9c6('0x5')]('/describe',auth['isAuthenticated'](),controller[_0xc9c6('0x7')]);router['get']('/:id',auth[_0xc9c6('0x6')](),controller['show']);router[_0xc9c6('0x5')](_0xc9c6('0x8'),auth[_0xc9c6('0x6')](),controller[_0xc9c6('0x9')]);router['get'](_0xc9c6('0xa'),auth[_0xc9c6('0x6')](),controller[_0xc9c6('0xb')]);router[_0xc9c6('0x5')]('/:id/messages',auth[_0xc9c6('0x6')](),controller[_0xc9c6('0xc')]);router[_0xc9c6('0xd')]('/',auth[_0xc9c6('0x6')](),controller[_0xc9c6('0xe')]);router['post'](_0xc9c6('0xa'),auth['isAuthenticated'](),controller['addMembers']);router['post']('/:id/messages',auth[_0xc9c6('0x6')](),controller['addMessage']);router[_0xc9c6('0xf')](_0xc9c6('0x10'),auth[_0xc9c6('0x6')](),controller[_0xc9c6('0x11')]);router[_0xc9c6('0x12')](_0xc9c6('0x10'),auth['isAuthenticated'](),controller[_0xc9c6('0x13')]);router[_0xc9c6('0x12')](_0xc9c6('0xa'),auth[_0xc9c6('0x6')](),controller['removeMembers']);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 ea53bff..4ce12a1 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 _0x00ea=['BOOLEAN','ENUM','star','thumb','TEXT','DATE','STRING','long','exports'];(function(_0xcd5a3d,_0x3c5b33){var _0xd43207=function(_0x17d976){while(--_0x17d976){_0xcd5a3d['push'](_0xcd5a3d['shift']());}};_0xd43207(++_0x3c5b33);}(_0x00ea,0x19d));var _0xa00e=function(_0x12e0d9,_0xf9817c){_0x12e0d9=_0x12e0d9-0x0;var _0x53b561=_0x00ea[_0x12e0d9];return _0x53b561;};'use strict';var Sequelize=require('sequelize');module[_0xa00e('0x0')]={'closed':{'type':Sequelize[_0xa00e('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xa00e('0x2')](_0xa00e('0x3'),_0xa00e('0x4')),'defaultValue':_0xa00e('0x3')},'ratingMessage':{'type':Sequelize[_0xa00e('0x5')]},'pathTranscript':{'type':Sequelize[_0xa00e('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xa00e('0x6')]},'disposition':{'type':Sequelize[_0xa00e('0x7')]},'secondDisposition':{'type':Sequelize[_0xa00e('0x7')]},'thirdDisposition':{'type':Sequelize[_0xa00e('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xa00e('0x7')]},'browserVersion':{'type':Sequelize[_0xa00e('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xa00e('0x7')]},'deviceModel':{'type':Sequelize[_0xa00e('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xa00e('0x7')]},'referer':{'type':Sequelize[_0xa00e('0x5')]},'customerIp':{'type':Sequelize[_0xa00e('0x7')]},'formData':{'type':Sequelize['TEXT'](_0xa00e('0x8'))},'read1stAt':{'type':Sequelize[_0xa00e('0x6')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xa00e('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xa00e('0x7')]},'customerPort':{'type':Sequelize[_0xa00e('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xa00e('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0xa00e('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0x1beb=['ENUM','star','TEXT','STRING','DATE','long','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x50521a,_0x59dd5e){var _0x4c3aa1=function(_0x15a28b){while(--_0x15a28b){_0x50521a['push'](_0x50521a['shift']());}};_0x4c3aa1(++_0x59dd5e);}(_0x1beb,0x165));var _0xb1be=function(_0x16176e,_0x82a1b2){_0x16176e=_0x16176e-0x0;var _0x3769f4=_0x1beb[_0x16176e];return _0x3769f4;};'use strict';var Sequelize=require(_0xb1be('0x0'));module[_0xb1be('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xb1be('0x2')]},'ratingType':{'type':Sequelize[_0xb1be('0x3')](_0xb1be('0x4'),'thumb'),'defaultValue':_0xb1be('0x4')},'ratingMessage':{'type':Sequelize[_0xb1be('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xb1be('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xb1be('0x7')]},'disposition':{'type':Sequelize[_0xb1be('0x6')]},'secondDisposition':{'type':Sequelize[_0xb1be('0x6')]},'thirdDisposition':{'type':Sequelize[_0xb1be('0x6')]},'note':{'type':Sequelize[_0xb1be('0x6')]},'browserName':{'type':Sequelize[_0xb1be('0x6')]},'browserVersion':{'type':Sequelize[_0xb1be('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xb1be('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xb1be('0x6')]},'referer':{'type':Sequelize[_0xb1be('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0xb1be('0x8'))},'read1stAt':{'type':Sequelize[_0xb1be('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xb1be('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xb1be('0x6')]},'customerPort':{'type':Sequelize[_0xb1be('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xb1be('0x9')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 03854bd..d8c9619 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 _0xddda=['basename','existsSync','createReadStream','pipe','createWriteStream','firstName','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','render','merge','body','contact','agent','interaction','Users','map','fullname','TagIds','forEach','push','waiting','talking','answered','unmanaged','abandoned','total','UserId','disposition','ChatInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','field','color','tools_tags','select','u.fullname','from','user_has_chat_interactions','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','users','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','split','getFullTextValue','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','toString','sequelize','keyBy','Account.key','a.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.firstName','Contact.lastName','Contact.email','Contact.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','include','catch','create','describe','findOne','ChatWebsite','vidaooApiKey','vidaooTopic','vidaooNote','vidaooEscalation','email','account','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','AbandonInteraction','file','originalname','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','Messages','System','%s%d','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ChatMessage','ids','omit','getMessages','nolimit','order','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','getMyMessages','includeAgent','alias','addTags','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','lastName','direction','Account','Owner','get','mkdirSync','N.A.','closedAt','browserName','referer','customerIp','customerPort'];(function(_0x166f3c,_0x5770af){var _0x58e68b=function(_0x3242ca){while(--_0x3242ca){_0x166f3c['push'](_0x166f3c['shift']());}};_0x58e68b(++_0x5770af);}(_0xddda,0x14a));var _0xaddd=function(_0x1c0847,_0x5e4a){_0x1c0847=_0x1c0847-0x0;var _0xd43a48=_0xddda[_0x1c0847];return _0xd43a48;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaddd('0x0'));var zipdir=require(_0xaddd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaddd('0x2'));var BPromise=require(_0xaddd('0x3'));var Mustache=require(_0xaddd('0x4'));var util=require(_0xaddd('0x5'));var path=require(_0xaddd('0x6'));var sox=require(_0xaddd('0x7'));var csv=require(_0xaddd('0x8'));var ejs=require(_0xaddd('0x9'));var fs=require('fs');var fs_extra=require(_0xaddd('0xa'));var _=require('lodash');var squel=require(_0xaddd('0xb'));var crypto=require(_0xaddd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xaddd('0xd'));var toCsv=require('to-csv');var querystring=require(_0xaddd('0xe'));var Papa=require(_0xaddd('0xf'));var Redis=require('ioredis');var authService=require(_0xaddd('0x10'));var qs=require(_0xaddd('0x11'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xaddd('0x12'));var hardwareService=require(_0xaddd('0x13'));var logger=require(_0xaddd('0x14'))(_0xaddd('0x15'));var utils=require(_0xaddd('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaddd('0x17'))['db'];config[_0xaddd('0x18')]=_['defaults'](config['redis'],{'host':_0xaddd('0x19'),'port':0x18eb});var socket=require(_0xaddd('0x1a'))(new Redis(config[_0xaddd('0x18')]));require(_0xaddd('0x1b'))[_0xaddd('0x1c')](socket);var jayson=require(_0xaddd('0x1d'));var client=jayson['client'][_0xaddd('0x1e')]({'port':0x232b});var client9004=jayson[_0xaddd('0x1f')][_0xaddd('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x35fd61,_0x3deb31,_0x45ba06,_0x506ba3){return new BPromise(function(_0x2b18f3,_0x28b897){var _0x144449=_0x506ba3||client;return _0x144449[_0xaddd('0x20')](_0x35fd61,_0x45ba06)['then'](function(_0x263a84){logger[_0xaddd('0x21')](_0xaddd('0x22'),_0x3deb31,_0xaddd('0x23'));logger['debug'](_0xaddd('0x24'),_0x3deb31,_0xaddd('0x23'),JSON['stringify'](_0x263a84));if(_0x263a84[_0xaddd('0x25')]){if(_0x263a84[_0xaddd('0x25')][_0xaddd('0x26')]===0x1f4){logger[_0xaddd('0x25')](_0xaddd('0x22'),_0x3deb31,_0x263a84[_0xaddd('0x25')][_0xaddd('0x27')]);return _0x28b897(_0x263a84[_0xaddd('0x25')]['message']);}logger['error'](_0xaddd('0x22'),_0x3deb31,_0x263a84[_0xaddd('0x25')][_0xaddd('0x27')]);return _0x2b18f3(_0x263a84['error'][_0xaddd('0x27')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x3deb31,_0xaddd('0x23'));_0x2b18f3(_0x263a84['result'][_0xaddd('0x27')]);}})['catch'](function(_0x589b46){logger[_0xaddd('0x25')](_0xaddd('0x22'),_0x3deb31,_0x589b46);_0x28b897(_0x589b46);});});}function respondWithStatusCode(_0x1b42ba,_0x3f7a99){_0x3f7a99=_0x3f7a99||0xcc;return function(_0xffed69){if(_0xffed69){return _0x1b42ba[_0xaddd('0x28')](_0x3f7a99);}return _0x1b42ba[_0xaddd('0x29')](_0x3f7a99)[_0xaddd('0x2a')]();};}function respondWithResult(_0x593f37,_0x224acf){_0x224acf=_0x224acf||0xc8;return function(_0x4832b2){if(_0x4832b2){return _0x593f37[_0xaddd('0x29')](_0x224acf)[_0xaddd('0x2b')](_0x4832b2);}};}function respondWithFilteredResult(_0x4d4c96,_0x169a89){return function(_0x48bd8a){if(_0x48bd8a){var _0x20f386=typeof _0x169a89[_0xaddd('0x2c')]===_0xaddd('0x2d')&&typeof _0x169a89[_0xaddd('0x2e')]===_0xaddd('0x2d');var _0x3b9724=_0x48bd8a['count'];var _0x4c3308=_0x20f386?0x0:_0x169a89[_0xaddd('0x2c')];var _0x382444=_0x20f386?_0x48bd8a[_0xaddd('0x2f')]:_0x169a89['offset']+_0x169a89[_0xaddd('0x2e')];var _0x2d2be4;if(_0x382444>=_0x3b9724){_0x382444=_0x3b9724;_0x2d2be4=0xc8;}else{_0x2d2be4=0xce;}_0x4d4c96[_0xaddd('0x29')](_0x2d2be4);return _0x4d4c96[_0xaddd('0x30')]('Content-Range',_0x4c3308+'-'+_0x382444+'/'+_0x3b9724)[_0xaddd('0x2b')](_0x48bd8a);}return null;};}function patchUpdates(_0x323e46){return function(_0x2c2927){try{jsonpatch[_0xaddd('0x31')](_0x2c2927,_0x323e46,!![]);}catch(_0x23bd8e){return BPromise[_0xaddd('0x32')](_0x23bd8e);}return _0x2c2927[_0xaddd('0x33')]();};}function saveUpdates(_0x167c20,_0x267d1d){return function(_0x5744ec){if(_0x5744ec){return _0x5744ec[_0xaddd('0x34')](_0x167c20)[_0xaddd('0x35')](function(_0x44f79e){return _0x44f79e;});}return null;};}function removeEntity(_0x147246,_0x5ad3e3){return function(_0x45dc01){if(_0x45dc01){return _0x45dc01[_0xaddd('0x36')]()[_0xaddd('0x35')](function(){_0x147246['status'](0xcc)[_0xaddd('0x2a')]();});}};}function handleEntityNotFound(_0x37f699,_0x135239){return function(_0x18f74b){if(!_0x18f74b){_0x37f699['sendStatus'](0x194);}return _0x18f74b;};}function handleError(_0x1e84e0,_0x424737){_0x424737=_0x424737||0x1f4;return function(_0x312b6f){logger[_0xaddd('0x25')](_0x312b6f[_0xaddd('0x37')]);if(_0x312b6f[_0xaddd('0x38')]){delete _0x312b6f[_0xaddd('0x38')];}_0x1e84e0[_0xaddd('0x29')](_0x424737)[_0xaddd('0x39')](_0x312b6f);};}function getMustacheRender(_0x1575f0,_0x4836c1){return Mustache[_0xaddd('0x3a')](_0x1575f0,_[_0xaddd('0x3b')](_0x4836c1[_0xaddd('0x3c')],{'contact':_0x4836c1[_0xaddd('0x3d')],'message':_0x4836c1[_0xaddd('0x27')],'agent':_0x4836c1[_0xaddd('0x3e')],'interaction':_0x4836c1[_0xaddd('0x3f')],'account':_0x4836c1['account']}))||'';}function getInteractionUsers(_0x15efd3,_0x2dd198){return new BPromise(function(_0x1a4c6d,_0x4d9539){try{if(_0x2dd198[_0x15efd3['id']]){_0x15efd3[_0xaddd('0x40')]=_[_0xaddd('0x41')](_0x2dd198[_0x15efd3['id']],function(_0x500247){return{'id':_0x500247['id'],'fullname':_0x500247[_0xaddd('0x42')]};});}}catch(_0x18f9e2){_0x4d9539(_0x18f9e2);}_0x1a4c6d(_0x15efd3);});}function getInteractionTags(_0x2e9f37,_0x465231){return new BPromise(function(_0x57835d,_0x498aae){try{if(_0x2e9f37['TagIds']){_0x2e9f37['Tags']=[];_0x2e9f37[_0xaddd('0x43')]['split'](',')[_0xaddd('0x44')](function(_0x24be45){_0x2e9f37['Tags'][_0xaddd('0x45')](_0x465231[_0x24be45]);});}delete _0x2e9f37['TagIds'];}catch(_0x32b573){_0x498aae(_0x32b573);}_0x57835d(_0x2e9f37);});}function updateChatInteraction(_0x5bd0ef,_0x34dfb5,_0x70afd8){return new BPromise(function(_0x3f1db4,_0x22649a){return getInteractionUsers(_0x5bd0ef,_0x70afd8)[_0xaddd('0x35')](function(_0x2a2437){return getInteractionTags(_0x2a2437,_0x34dfb5);})[_0xaddd('0x35')](function(_0x58ef5f){return getStateInteraction(_0x58ef5f);})[_0xaddd('0x35')](function(_0x2b0954){_0x3f1db4(_0x2b0954);})['catch'](function(_0x1b01ce){_0x22649a(_0x1b01ce);});});}function getStateInteraction(_0x3b4053){return new BPromise(function(_0x58578c){_0x3b4053[_0xaddd('0x46')]=0x0;_0x3b4053[_0xaddd('0x47')]=0x0;_0x3b4053[_0xaddd('0x48')]=0x0;_0x3b4053[_0xaddd('0x49')]=0x0;_0x3b4053[_0xaddd('0x4a')]=0x0;_0x3b4053[_0xaddd('0x4b')]=0x0;if(!_0x3b4053['closed']&&!_0x3b4053[_0xaddd('0x4c')]){_0x3b4053['waiting']+=0x1;}if(!_0x3b4053['closed']&&_0x3b4053[_0xaddd('0x4c')]){_0x3b4053[_0xaddd('0x47')]+=0x1;if(_0x3b4053[_0xaddd('0x46')]){_0x3b4053[_0xaddd('0x46')]-=0x1;}}if(_0x3b4053['closed']&&_0x3b4053[_0xaddd('0x4d')]===_0xaddd('0x4a')){_0x3b4053[_0xaddd('0x4a')]+=0x1;if(_0x3b4053[_0xaddd('0x46')]){_0x3b4053['waiting']-=0x1;}}else if(_0x3b4053['closed']&&!_0x3b4053[_0xaddd('0x4c')]&&_0x3b4053['disposition']){_0x3b4053[_0xaddd('0x49')]+=0x1;if(_0x3b4053[_0xaddd('0x46')]){_0x3b4053[_0xaddd('0x46')]-=0x1;}}else if(_0x3b4053['closed']&&_0x3b4053[_0xaddd('0x4c')]){_0x3b4053[_0xaddd('0x48')]+=0x1;if(_0x3b4053[_0xaddd('0x47')]){_0x3b4053[_0xaddd('0x47')]-=0x1;}}_0x3b4053[_0xaddd('0x4b')]+=0x1;_0x58578c(_0x3b4053);});}exports['index']=function(_0x5a93e8,_0x36b971){var _0x1b2c59={},_0x7e5ec8={},_0x2fbca2={'count':0x0,'rows':[]};var _0x3d4236=_[_0xaddd('0x41')](db[_0xaddd('0x4e')][_0xaddd('0x4f')],function(_0x5a1c34){return{'name':_0x5a1c34[_0xaddd('0x50')],'type':_0x5a1c34[_0xaddd('0x51')][_0xaddd('0x52')]};});_0x7e5ec8[_0xaddd('0x53')]=_['map'](_0x3d4236,_0xaddd('0x38'));_0x7e5ec8[_0xaddd('0x54')]=_[_0xaddd('0x55')](_0x5a93e8[_0xaddd('0x54')]);_0x7e5ec8[_0xaddd('0x56')]=_[_0xaddd('0x57')](_0x7e5ec8[_0xaddd('0x53')],_0x7e5ec8[_0xaddd('0x54')]);_0x1b2c59[_0xaddd('0x58')]=_[_0xaddd('0x57')](_0x7e5ec8[_0xaddd('0x53')],qs[_0xaddd('0x59')](_0x5a93e8[_0xaddd('0x54')][_0xaddd('0x59')]));_0x1b2c59[_0xaddd('0x58')]=_0x1b2c59[_0xaddd('0x58')][_0xaddd('0x5a')]?_0x1b2c59[_0xaddd('0x58')]:_0x7e5ec8['model'];if(!_0x5a93e8[_0xaddd('0x54')][_0xaddd('0x5b')]('nolimit')){_0x1b2c59[_0xaddd('0x2e')]=qs[_0xaddd('0x2e')](_0x5a93e8['query'][_0xaddd('0x2e')]);_0x1b2c59[_0xaddd('0x2c')]=qs['offset'](_0x5a93e8[_0xaddd('0x54')][_0xaddd('0x2c')]);}_0x1b2c59['order']=qs[_0xaddd('0x5c')](_0x5a93e8[_0xaddd('0x54')][_0xaddd('0x5c')]);_0x1b2c59[_0xaddd('0x5d')]=qs[_0xaddd('0x56')](_[_0xaddd('0x5e')](_0x5a93e8[_0xaddd('0x54')],_0x7e5ec8[_0xaddd('0x56')]),_0x3d4236);var _0x4a3a93=[];var _0x11a2b8=squel['select']()[_0xaddd('0x5f')]('id')[_0xaddd('0x5f')](_0xaddd('0x38'))[_0xaddd('0x5f')](_0xaddd('0x60'))['from'](_0xaddd('0x61'));var _0x2789a6=squel[_0xaddd('0x62')]()[_0xaddd('0x5f')]('u.id')['field'](_0xaddd('0x63'))[_0xaddd('0x5f')]('ui.ChatInteractionId')[_0xaddd('0x64')](_0xaddd('0x65'),'ui')['left_join']('users','u',_0xaddd('0x66'));var _0x1ea112=squel[_0xaddd('0x62')]()[_0xaddd('0x64')]('chat_interactions','i')['left_join'](_0xaddd('0x67'),'c',_0xaddd('0x68'))[_0xaddd('0x69')](_0xaddd('0x6a'),'o','o.id\x20=\x20i.UserId')[_0xaddd('0x69')](_0xaddd('0x6b'),'a',_0xaddd('0x6c'))[_0xaddd('0x69')](_0xaddd('0x6d'),'me','me.ChatInteractionId\x20=\x20i.id')['left_join']('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id')[_0xaddd('0x69')](_0xaddd('0x61'),'t',_0xaddd('0x6e'));var _0x1cbc4b=squel[_0xaddd('0x6f')]();var _0x22182d=[];var _0x3d9d67=squel[_0xaddd('0x6f')]();var _0x1232dc;if(_0x5a93e8[_0xaddd('0x54')][_0xaddd('0x70')]){_0x1232dc=as[_0xaddd('0x71')](_0x5a93e8[_0xaddd('0x54')][_0xaddd('0x70')]);var _0x4044df=_0x1232dc[_0xaddd('0x72')];for(var _0x473659=0x0;_0x473659<_0x1232dc[_0xaddd('0x73')][_0xaddd('0x5a')];_0x473659++){var _0x3e199e=_0x1232dc[_0xaddd('0x73')][_0x473659];var _0x2316bc='i';var _0x10ee86=_[_0xaddd('0x74')](_0x3d4236,[_0xaddd('0x38'),_0x3e199e[_0xaddd('0x5f')]]);if(!_0x10ee86){switch(_0x3e199e[_0xaddd('0x5f')]){case _0xaddd('0x75'):if(_0x3e199e['value']==0x1){_0x1ea112[_0xaddd('0x76')]('`'+_0x3e199e['field']+_0xaddd('0x77'));}else{_0x1ea112[_0xaddd('0x76')]('`'+_0x3e199e[_0xaddd('0x5f')]+_0xaddd('0x78'));}break;case _0xaddd('0x79'):if(_0x3e199e[_0xaddd('0x7a')]===_0xaddd('0x7b')){if(_0x3e199e[_0xaddd('0x7c')][_0xaddd('0x7d')]('\x20')[_0xaddd('0x5a')]>0x1){_0x1cbc4b[_0x4044df]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xaddd('0x7e')](_0x3e199e[_0xaddd('0x7c')]),null);}else{var _0x5ccfc0='%'+_0x3e199e[_0xaddd('0x7c')]+'%';_0x1cbc4b[_0x4044df]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x5ccfc0,_0x5ccfc0,_0x5ccfc0);}}else{_0x10ee86=_[_0xaddd('0x74')](_0x3d4236,[_0xaddd('0x38'),_0xaddd('0x7f')]);_0x3e199e[_0xaddd('0x5f')]=_0xaddd('0x7f');_0x4b45c1=as[_0xaddd('0x80')](_0x2316bc,_0x10ee86['type'],_0x3e199e);_0x1cbc4b[_0x4044df](_0x4b45c1[_0xaddd('0x81')],_0x4b45c1[_0xaddd('0x7c')][_0xaddd('0x82')],_0x4b45c1[_0xaddd('0x7c')][_0xaddd('0x2a')]);}break;case _0xaddd('0x83'):var _0x129fbb=_0x3e199e[_0xaddd('0x7c')]['split'](',')[_0xaddd('0x41')](function(_0x5a65c3){return Number(_0x5a65c3);});_0x129fbb[_0xaddd('0x44')](function(_0x5a5f1f){_0x3d9d67['or'](_0xaddd('0x84'),'%,'+_0x5a5f1f+',%');});_0x22182d=_['union'](_0x22182d,_0x129fbb);break;case _0xaddd('0x85'):if(_0x3e199e[_0xaddd('0x7a')]===_0xaddd('0x7b')){_0x1cbc4b[_0x4044df](_0xaddd('0x86'),'%'+_0x3e199e[_0xaddd('0x7c')]+'%',null);}else{_0x10ee86=_[_0xaddd('0x74')](_0x3d4236,[_0xaddd('0x38'),_0xaddd('0x4c')]);_0x3e199e[_0xaddd('0x5f')]='UserId';_0x4b45c1=as['buildExpression'](_0x2316bc,_0x10ee86[_0xaddd('0x51')],_0x3e199e);_0x1cbc4b[_0x4044df](_0x4b45c1[_0xaddd('0x81')],_0x4b45c1[_0xaddd('0x7c')][_0xaddd('0x82')],_0x4b45c1['value'][_0xaddd('0x2a')]);}break;case _0xaddd('0x3c'):_0x4b45c1=as[_0xaddd('0x80')]('me',null,_0x3e199e);_0x1cbc4b[_0x4044df](_0x4b45c1[_0xaddd('0x81')],_0x4b45c1[_0xaddd('0x7c')][_0xaddd('0x82')],_0x4b45c1[_0xaddd('0x7c')]['end']);break;}}else{var _0x4b45c1=as['buildExpression'](_0x2316bc,_0x10ee86['type'],_0x3e199e);_0x1cbc4b[_0x4044df](_0x4b45c1['text'],_0x4b45c1[_0xaddd('0x7c')][_0xaddd('0x82')],_0x4b45c1['value'][_0xaddd('0x2a')]);}}}else{var _0x123bf1=_(_0x5a93e8[_0xaddd('0x54')])[_0xaddd('0x55')]()['map'](function(_0x2d5157){return _[_0xaddd('0x87')](_0x3d4236,[_0xaddd('0x38'),_0x2d5157])?_0x2d5157:undefined;})[_0xaddd('0x88')]()[_0xaddd('0x7c')]();if(!_[_0xaddd('0x89')](_0x123bf1)){_0x123bf1['forEach'](function(_0x5222a2){if(_0x5222a2===_0xaddd('0x8a')){_0x1ea112[_0xaddd('0x5d')]('i.ChatWebsiteId\x20IN\x20?',[][_0xaddd('0x8b')](_0x5a93e8[_0xaddd('0x54')][_0x5222a2]));}else if(_0x5222a2===_0xaddd('0x8c')){var _0x4ac0a2=JSON[_0xaddd('0x8d')](_0x5a93e8[_0xaddd('0x54')][_0x5222a2])[_0xaddd('0x8e')];var _0x55c312=JSON[_0xaddd('0x8d')](_0x5a93e8[_0xaddd('0x54')][_0x5222a2])['$lte'];_0x1ea112[_0xaddd('0x5d')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4ac0a2,_0x55c312);}else{if(_0x5a93e8[_0xaddd('0x54')][_0x5222a2]===_0xaddd('0x8f')){_0x1ea112['where']('i.'+_0x5222a2+_0xaddd('0x90'));}else{_0x1ea112[_0xaddd('0x5d')]('i.'+_0x5222a2+_0xaddd('0x91'),_0x5a93e8[_0xaddd('0x54')][_0x5222a2]);}}});}if(_0x5a93e8[_0xaddd('0x54')][_0xaddd('0x92')]){if(_0x5a93e8[_0xaddd('0x54')][_0xaddd('0x92')]==0x1){_0x1ea112[_0xaddd('0x76')]('`unreadMessages`\x20=\x200');}else{_0x1ea112[_0xaddd('0x76')](_0xaddd('0x93'));}}if(_0x5a93e8['query'][_0xaddd('0x94')]){_0x22182d=_[_0xaddd('0x95')](_0x5a93e8[_0xaddd('0x54')]['tag'])?_0x5a93e8[_0xaddd('0x54')][_0xaddd('0x94')]:new Array(_0x5a93e8[_0xaddd('0x54')][_0xaddd('0x94')]);_0x22182d[_0xaddd('0x44')](function(_0x2cc17d){_0x3d9d67['or'](_0xaddd('0x84'),'%,'+_0x2cc17d+',%');});}if(_0x5a93e8[_0xaddd('0x54')][_0xaddd('0x96')]){var _0x3429d8=_0x5a93e8['query'][_0xaddd('0x96')]['replace']('\x5c','\x5c\x5c')[_0xaddd('0x97')](/'/g,'\x27\x27');if(qs[_0xaddd('0x98')](_0x3429d8)){_0x1cbc4b['or']('i.id\x20LIKE\x20?',_0x3429d8+'%');}else{_0x1cbc4b['or'](_0xaddd('0x99'),qs[_0xaddd('0x7e')](_0x3429d8))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3429d8+'%');}}}_0x1ea112[_0xaddd('0x5d')](_0x1cbc4b);_0x1ea112[_0xaddd('0x9a')](_0xaddd('0x9b'));var _0x8a3af0={'type':db[_0xaddd('0x9c')]['QueryTypes']['SELECT'],'raw':!![]};var _0x1e51da=_0x1ea112['clone']();_0x1e51da['field'](_0xaddd('0x9b'));_0x1e51da[_0xaddd('0x5f')](_0xaddd('0x9d'),_0xaddd('0x75'));if(_0x1b2c59['order']){_0x1b2c59['order'][_0xaddd('0x44')](function(_0x174151){var _0x2dbcc6=_0x174151[0x0]===_0xaddd('0x9e')?_0x174151[0x0]:'i.'+_0x174151[0x0];_0x1ea112['order'](_0x2dbcc6,_0x174151[0x1]===_0xaddd('0x9f')?![]:!![]);});}if(!_[_0xaddd('0x89')](_0x22182d)){_0x1ea112[_0xaddd('0x76')](_0x3d9d67);_0x1e51da[_0xaddd('0x5d')]('t.id\x20IN\x20?',_0x22182d);}BPromise[_0xaddd('0xa0')]()[_0xaddd('0x35')](function(){if(!_0x1232dc){if(_0x5a93e8['query']['ChatWebsiteId'])return;_0x1e51da[_0xaddd('0x5d')](_0xaddd('0xa1'));_0x1ea112['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x5a93e8[_0xaddd('0xa2')][_0xaddd('0xa3')]!==_0xaddd('0x3e'))return;return _0x5a93e8[_0xaddd('0xa2')][_0xaddd('0xa4')]({'attributes':['id'],'raw':!![]})[_0xaddd('0x35')](function(_0xf04589){if(_[_0xaddd('0x89')](_0xf04589)){_0x1e51da[_0xaddd('0x5d')]('i.ChatWebsiteId\x20IS\x20NULL');_0x1ea112[_0xaddd('0x5d')](_0xaddd('0xa5'));}else{_0x1e51da[_0xaddd('0x5d')](_0xaddd('0xa6'),_['map'](_0xf04589,'id'));_0x1ea112[_0xaddd('0x5d')](_0xaddd('0xa6'),_[_0xaddd('0x41')](_0xf04589,'id'));}});})['then'](function(){if(_0x5a93e8[_0xaddd('0xa2')]['role']===_0xaddd('0x3e')&&!_0x1232dc&&!_0x5a93e8[_0xaddd('0x54')]['ChatWebsiteId'])return[];return db['sequelize'][_0xaddd('0x54')](_0x1e51da[_0xaddd('0xa7')](),_0x8a3af0);})['then'](function(_0x32755e){_0x2fbca2[_0xaddd('0x2f')]=_0x32755e[_0xaddd('0x5a')];if(_0x2fbca2[_0xaddd('0x2f')]===0x0)return[];return db[_0xaddd('0xa8')][_0xaddd('0x54')](_0x11a2b8[_0xaddd('0xa7')](),_0x8a3af0)['then'](function(_0x3bf2f7){_0x4a3a93=_[_0xaddd('0xa9')](_0x3bf2f7,'id');_0x8a3af0=_['merge'](_0x8a3af0,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5a93e8[_0xaddd('0x54')][_0xaddd('0x59')]){_0x1b2c59[_0xaddd('0x58')][_0xaddd('0x44')](function(_0x4ec5d5){_0x1ea112[_0xaddd('0x5f')]('i.'+_0x4ec5d5);});}else{_0x1ea112[_0xaddd('0x5f')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xaddd('0x75'));_0x1ea112[_0xaddd('0x5f')]('a.key',_0xaddd('0xaa'));_0x1ea112[_0xaddd('0x5f')](_0xaddd('0xab'),'Account.mandatoryDisposition');_0x1ea112['field'](_0xaddd('0xac'),_0xaddd('0x9e'));_0x1ea112[_0xaddd('0x5f')](_0xaddd('0xad'));_0x1ea112[_0xaddd('0x5f')](_0xaddd('0xae'),_0xaddd('0xaf'));_0x1ea112[_0xaddd('0x5f')]('c.lastName',_0xaddd('0xb0'));_0x1ea112['field']('c.email',_0xaddd('0xb1'));_0x1ea112[_0xaddd('0x5f')]('c.phone',_0xaddd('0xb2'));_0x1ea112[_0xaddd('0x5f')](_0xaddd('0xb3'),'Contact.mobile');_0x1ea112[_0xaddd('0x5f')](_0xaddd('0xb4'),_0xaddd('0xb5'));_0x1ea112[_0xaddd('0x5f')]('o.fullname',_0xaddd('0xb6'));_0x1ea112[_0xaddd('0x5f')](_0xaddd('0xb7'),_0xaddd('0xb8'));_0x1ea112['field'](_0xaddd('0xb9'),_0xaddd('0x43'));}if(_0x1b2c59[_0xaddd('0x2e')])_0x1ea112['limit'](_0x1b2c59[_0xaddd('0x2e')]);if(_0x1b2c59[_0xaddd('0x2c')])_0x1ea112['offset'](_0x1b2c59[_0xaddd('0x2c')]);return db[_0xaddd('0xa8')][_0xaddd('0x54')](_0x1ea112['toString'](),_0x8a3af0);})['then'](function(_0x5eb1bb){if(_0x5eb1bb[_0xaddd('0x5a')]>0x0)_0x2789a6[_0xaddd('0x5d')](_0xaddd('0xba'),_[_0xaddd('0x41')](_0x5eb1bb,'id'));return db[_0xaddd('0xa8')][_0xaddd('0x54')](_0x2789a6[_0xaddd('0xa7')](),_0x8a3af0)[_0xaddd('0x35')](function(_0x571e13){var _0x219e5b=_[_0xaddd('0xbb')](_0x571e13,_0xaddd('0xbc'));var _0x4baa3f=[];_0x5eb1bb[_0xaddd('0x44')](function(_0x19d551){_0x4baa3f['push'](updateChatInteraction(_0x19d551,_0x4a3a93,_0x219e5b));});return BPromise[_0xaddd('0xbd')](_0x4baa3f);});});})['then'](function(_0x138ae1){_0x2fbca2[_0xaddd('0xbe')]=_0x138ae1;return _0x2fbca2;})['then'](respondWithFilteredResult(_0x36b971,_0x1b2c59))['catch'](handleError(_0x36b971,null));};exports[_0xaddd('0xbf')]=function(_0x3950ef,_0xa0745){var _0x3118f4={'raw':![],'where':{'id':_0x3950ef[_0xaddd('0xc0')]['id']}},_0x54e91d={};_0x54e91d[_0xaddd('0x53')]=_[_0xaddd('0x55')](db[_0xaddd('0x4e')]['rawAttributes']);_0x54e91d[_0xaddd('0x54')]=_[_0xaddd('0x55')](_0x3950ef[_0xaddd('0x54')]);_0x54e91d[_0xaddd('0x56')]=_[_0xaddd('0x57')](_0x54e91d['model'],_0x54e91d[_0xaddd('0x54')]);_0x3118f4[_0xaddd('0x58')]=_[_0xaddd('0x57')](_0x54e91d['model'],qs[_0xaddd('0x59')](_0x3950ef[_0xaddd('0x54')][_0xaddd('0x59')]));_0x3118f4[_0xaddd('0x58')]=_0x3118f4['attributes'][_0xaddd('0x5a')]?_0x3118f4[_0xaddd('0x58')]:_0x54e91d[_0xaddd('0x53')];if(_0x3950ef[_0xaddd('0x54')]['includeAll']){_0x3118f4[_0xaddd('0xc1')]=[{'all':!![]}];}_0x3118f4=_[_0xaddd('0x3b')]({},_0x3118f4,_0x3950ef['options']);return db[_0xaddd('0x4e')]['find'](_0x3118f4)[_0xaddd('0x35')](handleEntityNotFound(_0xa0745,null))[_0xaddd('0x35')](respondWithResult(_0xa0745,null))[_0xaddd('0xc2')](handleError(_0xa0745,null));};exports[_0xaddd('0xc3')]=function(_0x169dd7,_0x1efa31){return db[_0xaddd('0x4e')][_0xaddd('0xc3')](_0x169dd7[_0xaddd('0x3c')],{})[_0xaddd('0x35')](respondWithResult(_0x1efa31,0xc9))[_0xaddd('0xc2')](handleError(_0x1efa31,null));};exports[_0xaddd('0x34')]=function(_0x1be4ec,_0x31678f){if(_0x1be4ec[_0xaddd('0x3c')]['id']){delete _0x1be4ec[_0xaddd('0x3c')]['id'];}return db[_0xaddd('0x4e')][_0xaddd('0x74')]({'where':{'id':_0x1be4ec[_0xaddd('0xc0')]['id']}})[_0xaddd('0x35')](handleEntityNotFound(_0x31678f,null))[_0xaddd('0x35')](saveUpdates(_0x1be4ec['body'],null))['then'](respondWithResult(_0x31678f,null))[_0xaddd('0xc2')](handleError(_0x31678f,null));};exports[_0xaddd('0x36')]=function(_0x3b177d,_0x5c88ed){return db['ChatInteraction'][_0xaddd('0x74')]({'where':{'id':_0x3b177d['params']['id']}})[_0xaddd('0x35')](handleEntityNotFound(_0x5c88ed,null))['then'](removeEntity(_0x5c88ed,null))['catch'](handleError(_0x5c88ed,null));};exports[_0xaddd('0xc4')]=function(_0x151f03,_0x1e1377){return db['ChatInteraction'][_0xaddd('0xc4')]()[_0xaddd('0x35')](respondWithResult(_0x1e1377,null))[_0xaddd('0xc2')](handleError(_0x1e1377,null));};exports['createVidaooSession']=function(_0x5457b5,_0x56726f){var _0x33d126=_0x5457b5[_0xaddd('0xc0')]['id'];var _0x4ac955;var _0x5d06db;var _0x8cf1a;return db[_0xaddd('0x4e')][_0xaddd('0xc5')]({'where':{'id':_0x33d126}})['then'](function(_0x9c6a44){_0x4ac955=_0x9c6a44;return db[_0xaddd('0xc6')][_0xaddd('0xc5')]({'where':{'id':_0x9c6a44[_0xaddd('0x8a')]},'attributes':['id',_0xaddd('0xc7'),'vidaooEscalation',_0xaddd('0xc8'),_0xaddd('0xc9'),'vidaooMetadata'],'raw':!![]});})[_0xaddd('0x35')](function(_0x27d0d0){if(_0x27d0d0&&_0x27d0d0[_0xaddd('0xc7')]&&_0x27d0d0[_0xaddd('0xca')]){_0x5d06db=_0x27d0d0;var _0x4df1f0={'interaction':{'id':_0x33d126},'agent':{'id':_0x5457b5[_0xaddd('0xa2')]['id'],'name':_0x5457b5[_0xaddd('0xa2')]['name'],'fullname':_0x5457b5['user'][_0xaddd('0x42')],'email':_0x5457b5[_0xaddd('0xa2')][_0xaddd('0xcb')]},'contact':_0x5457b5[_0xaddd('0x3c')]['contact'],'account':_0x5457b5[_0xaddd('0x3c')][_0xaddd('0xcc')]};var _0x593db4={'rejectUnauthorized':![],'method':'POST','url':_0xaddd('0xcd'),'headers':{'X-APIKEY':_0x27d0d0[_0xaddd('0xc7')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5457b5[_0xaddd('0xa2')][_0xaddd('0xcb')]],'buttons':null,'topic':_0x5d06db[_0xaddd('0xc8')],'note':_[_0xaddd('0xce')](_0x5d06db[_0xaddd('0xc9')])?null:getMustacheRender(_0x5d06db['vidaooNote'],_0x4df1f0),'metadata':null},'redirect':_0xaddd('0xcf'),'json':!![]};try{if(!_[_0xaddd('0xce')](_0x5d06db[_0xaddd('0xd0')])){var _0x2f449a=getMustacheRender(_0x5d06db[_0xaddd('0xd0')],_0x4df1f0);var _0x32b8c5=JSON[_0xaddd('0x8d')](_0x2f449a);_0x593db4[_0xaddd('0x3c')][_0xaddd('0xd1')]=_0x32b8c5;}}catch(_0x41173e){throw new db[(_0xaddd('0x9c'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x593db4);}else{throw new db[(_0xaddd('0x9c'))][(_0xaddd('0xd2'))](_0xaddd('0xd3'));}})[_0xaddd('0x35')](function(_0x39577c){_0x8cf1a=_0x39577c;if(_0x8cf1a['id']){var _0x2ade70={'body':_0x8cf1a[_0xaddd('0xd4')],'ChatWebsiteId':_0x5d06db['id'],'ChatInteractionId':_0x4ac955['id'],'direction':_0xaddd('0xd5'),'UserId':_0x5457b5[_0xaddd('0xa2')]['id']};return db['ChatMessage'][_0xaddd('0xc3')](_0x2ade70,{});}else{throw new db['Sequelize'][(_0xaddd('0xd2'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xaddd('0x35')](function(){return _0x4ac955[_0xaddd('0xd6')]({'vidaooSessionId':_0x8cf1a['id']});})[_0xaddd('0x35')](respondWithResult(_0x56726f,null))[_0xaddd('0xc2')](handleError(_0x56726f,null));};exports[_0xaddd('0xd7')]=function(_0x1ed5d3,_0x13c8af){if(_0x1ed5d3[_0xaddd('0x3c')]['id']){delete _0x1ed5d3['body']['id'];}return db[_0xaddd('0x4e')][_0xaddd('0x74')]({'where':{'id':_0x1ed5d3[_0xaddd('0xc0')]['id']},'include':[{'model':db[_0xaddd('0xd8')],'as':_0xaddd('0x79')}]})[_0xaddd('0x35')](handleEntityNotFound(_0x13c8af,null))[_0xaddd('0x35')](saveUpdates(_0x1ed5d3[_0xaddd('0x3c')],null))[_0xaddd('0x35')](respondWithResult(_0x13c8af,null))[_0xaddd('0xc2')](handleError(_0x13c8af,null));};exports[_0xaddd('0xd9')]=function(_0x523523,_0x4a2dfc,_0x15a67b){if(_0x523523[_0xaddd('0x3c')]['id']){delete _0x523523['body']['id'];}return db[_0xaddd('0x4e')]['find']({'where':{'id':_0x523523[_0xaddd('0xc0')]['id']}})[_0xaddd('0x35')](function(_0x178166){if(!_0x178166){logger[_0xaddd('0x25')](_0xaddd('0xda'),'abandon',0x194,_0xaddd('0xdb'));_0x4a2dfc[_0xaddd('0x28')](0x194);}else{if(_0x178166['UserId']){throw new db[(_0xaddd('0x9c'))][(_0xaddd('0xd2'))](_0xaddd('0xdc'));}}return _0x178166;})['then'](function(_0x335511){if(_0x335511){return _0x335511['update']({'closed':_0x523523[_0xaddd('0x3c')][_0xaddd('0xdd')],'disposition':_0x523523[_0xaddd('0x3c')][_0xaddd('0x4d')]})[_0xaddd('0x35')](function(_0x1250f7){return _0x1250f7;});}})['then'](function(_0x160775){return respondWithRpcPromise(_0xaddd('0xde'),'abandon',_0x523523[_0xaddd('0x3c')],client9004);})[_0xaddd('0x35')](respondWithResult(_0x4a2dfc,null))[_0xaddd('0xc2')](handleError(_0x4a2dfc,null));};exports['attachmentUpload']=function(_0x30475a,_0x18b591,_0x15bfd9){_0x30475a[_0xaddd('0x3c')][_0xaddd('0x38')]=_0x30475a[_0xaddd('0xdf')][_0xaddd('0xe0')];_0x30475a[_0xaddd('0x3c')]['basename']=_0x30475a[_0xaddd('0xdf')][_0xaddd('0xe1')];_0x30475a['body'][_0xaddd('0x51')]=_0x30475a['file'][_0xaddd('0xe2')];return db[_0xaddd('0xe3')][_0xaddd('0xc3')](_0x30475a['body'])[_0xaddd('0x35')](respondWithResult(_0x18b591,0xc9))['catch'](handleError(_0x18b591,null));};exports[_0xaddd('0xe4')]=function(_0xf72efd,_0x1849d6,_0xde282a){return db['ChatInteraction'][_0xaddd('0xc5')]({'where':{'id':_0xf72efd[_0xaddd('0xc0')]['id']},'raw':!![]})[_0xaddd('0x35')](handleEntityNotFound(_0x1849d6,null))[_0xaddd('0x35')](function(_0xfd177a){if(_0xfd177a){if(_0xfd177a['closed']){return _0x1849d6['status'](0x193)[_0xaddd('0x2b')]({'status':0x193,'message':_0xaddd('0xe5')});}return db['Attachment']['findOne']({'where':{'id':_0xf72efd['query'][_0xaddd('0xe6')]},'raw':!![]})[_0xaddd('0x35')](handleEntityNotFound(_0x1849d6,null));}})[_0xaddd('0x35')](function(_0x3207d5){if(_0x3207d5){var _0x5aa307=_0x3207d5[_0xaddd('0xe7')]!==null;var _0x263aaf=path[_0xaddd('0xe8')](config[_0xaddd('0xe9')],'server/files/attachments/');if(_0x5aa307){_0x263aaf=path[_0xaddd('0xe8')](_0x263aaf,_0xaddd('0xea'));}var _0x35d62b=path[_0xaddd('0xe8')](_0x263aaf,_0x3207d5['basename']);return _0x1849d6[_0xaddd('0xeb')](_0x35d62b);}})[_0xaddd('0xc2')](handleError(_0x1849d6,null));};exports[_0xaddd('0xec')]=function(_0x253cf8,_0x2a3757){var _0x1a906d=null;var _0xb37a84=null;var _0x175459=null;var _0x3a4c39=null;if(_0x253cf8[_0xaddd('0x3c')]['id']){delete _0x253cf8[_0xaddd('0x3c')]['id'];}if(_0x253cf8[_0xaddd('0x3c')][_0xaddd('0xed')]){_0x3a4c39=path[_0xaddd('0xe8')](config[_0xaddd('0xe9')],_0xaddd('0xee'),util[_0xaddd('0xef')]('transcript-%s.txt',Date[_0xaddd('0xf0')]()));_0x253cf8[_0xaddd('0x3c')][_0xaddd('0xf1')]=_0x3a4c39;}return db['ChatInteraction'][_0xaddd('0x74')]({'where':{'id':_0x253cf8['params']['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0xaddd('0x85')],'as':'User'}]}]})['then'](handleEntityNotFound(_0x2a3757,null))['then'](saveUpdates(_0x253cf8[_0xaddd('0x3c')],null))[_0xaddd('0x35')](function(_0x43bdb0){if(_0x43bdb0){_0x1a906d=_0x43bdb0;return db[_0xaddd('0xc6')][_0xaddd('0x74')]({'where':{'id':_0x1a906d['ChatWebsiteId']}});}})[_0xaddd('0x35')](function(_0x240c0c){if(_0x240c0c){_0x175459=_0x240c0c;return db[_0xaddd('0xd8')]['find']({'where':{'id':_0x1a906d[_0xaddd('0x7f')]}});}})[_0xaddd('0x35')](function(_0x10553c){if(_0x10553c){_0xb37a84=_0x10553c;if(_0x3a4c39){var _0x1b5c0b=null;for(var _0x18e936=0x1;_0x18e936<_0x1a906d[_0xaddd('0xf2')][_0xaddd('0x5a')];++_0x18e936){_0x1b5c0b=_0x1a906d[_0xaddd('0xf2')][_0x18e936];var _0x5d8ce5=_0x1b5c0b[_0xaddd('0x4c')]?util[_0xaddd('0xef')]('%s%d',_0x175459['agentAlias'],_0x1b5c0b[_0xaddd('0x4c')]):_0xaddd('0xf3');var _0x5ae97d=_0x253cf8[_0xaddd('0x3c')]['customer']||util['format'](_0xaddd('0xf4'),_0xaddd('0xf5'),_0x1b5c0b[_0xaddd('0x7f')]);switch(_0x175459[_0xaddd('0xf6')]){case _0xaddd('0xf7'):_0x5d8ce5=_0x1b5c0b['UserId']?util['format'](_0xaddd('0xf4'),_0x175459[_0xaddd('0xf8')],_0x1b5c0b[_0xaddd('0x4c')]):_0xaddd('0xf3');break;case _0xaddd('0xf9'):_0x5d8ce5=_0x1b5c0b[_0xaddd('0x4c')]?_0x1b5c0b[_0xaddd('0x85')]['alias']||_0x1b5c0b['User'][_0xaddd('0x42')]:_0xaddd('0xf3');break;case _0xaddd('0xfa'):_0x5d8ce5=_0x1b5c0b[_0xaddd('0x4c')]?_0x1b5c0b['User'][_0xaddd('0x42')]:_0xaddd('0xf3');break;default:_0x5d8ce5=_0x1b5c0b[_0xaddd('0x4c')]?util[_0xaddd('0xef')]('%s%d',_0x175459[_0xaddd('0xf8')],_0x1b5c0b[_0xaddd('0x4c')]):_0xaddd('0xf3');}var _0x4ab318=util['format'](_0xaddd('0xfb'),moment(_0x1b5c0b[_0xaddd('0x8c')])[_0xaddd('0xef')](_0xaddd('0xfc')),_0x1b5c0b['direction']==='in'?_0x5ae97d:_0x5d8ce5,_0x1b5c0b[_0xaddd('0x3c')]);if(!_0x1b5c0b[_0xaddd('0xfd')]){fs[_0xaddd('0xfe')](_0x3a4c39,_0x4ab318);}}return db[_0xaddd('0xff')][_0xaddd('0xc5')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xaddd('0x100'),'raw':!![]}]});}}})[_0xaddd('0x35')](function(_0x58fcb1){if(_0x58fcb1&&_0x58fcb1[_0xaddd('0x100')]&&_0x253cf8[_0xaddd('0x3c')]){var _0x29f865={'tls':{'rejectUnauthorized':![]}};if(_0x58fcb1['Smtp'][_0xaddd('0x101')]){_0x29f865[_0xaddd('0x101')]=_0x58fcb1[_0xaddd('0x100')][_0xaddd('0x101')];}else{_0x29f865[_0xaddd('0x102')]=_0x58fcb1[_0xaddd('0x100')][_0xaddd('0x102')];_0x29f865[_0xaddd('0x103')]=_0x58fcb1[_0xaddd('0x100')][_0xaddd('0x103')];_0x29f865[_0xaddd('0x104')]=_0x58fcb1['Smtp'][_0xaddd('0x104')];}if(_0x58fcb1[_0xaddd('0x100')][_0xaddd('0x105')]){_0x29f865[_0xaddd('0x106')]={'user':_0x58fcb1['Smtp'][_0xaddd('0xa2')],'pass':_0x58fcb1['Smtp'][_0xaddd('0x107')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x29f865,'message':{'from':util[_0xaddd('0xef')](_0xaddd('0x108'),_0x58fcb1[_0xaddd('0x38')],_0x58fcb1[_0xaddd('0xcb')]||_0x58fcb1[_0xaddd('0x100')][_0xaddd('0xa2')]),'to':_0x253cf8[_0xaddd('0x3c')]['mailTranscript'],'subject':_0xaddd('0x109'),'text':util[_0xaddd('0xef')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x253cf8[_0xaddd('0x3c')][_0xaddd('0xed')]),'attachments':[{'path':_0x3a4c39}]}})[_0xaddd('0x35')](function(){return _0x1a906d;})['catch'](function(_0x7ec3e9){console[_0xaddd('0x25')](_0x7ec3e9);});}else{return _0x1a906d;}})[_0xaddd('0x35')](respondWithStatusCode(_0x2a3757,0xc8))[_0xaddd('0xc2')](handleError(_0x2a3757,null));};exports[_0xaddd('0x10a')]=function(_0x4aacdb,_0x1cf762,_0x48611a){return db[_0xaddd('0x10b')]['find']({'where':{'id':_0x4aacdb[_0xaddd('0xc0')]['id']}})[_0xaddd('0x35')](handleEntityNotFound(_0x1cf762,null))[_0xaddd('0x35')](function(_0x491d90){if(_0x491d90){return _0x491d90[_0xaddd('0x10a')](_0x4aacdb[_0xaddd('0x3c')][_0xaddd('0x10c')],_[_0xaddd('0x10d')](_0x4aacdb['body'],[_0xaddd('0x10c'),'id'])||{});}})[_0xaddd('0x35')](respondWithResult(_0x1cf762,null))[_0xaddd('0xc2')](handleError(_0x1cf762,null));};exports[_0xaddd('0x10e')]=function(_0x4cb7ea,_0x180c15,_0x2909f5){var _0x95448={'raw':![],'where':{}};var _0xb4e4df={};var _0x471fa0={'count':0x0,'rows':[]};return db[_0xaddd('0x4e')]['findOne']({'where':{'id':_0x4cb7ea[_0xaddd('0xc0')]['id']}})['then'](handleEntityNotFound(_0x180c15,null))['then'](function(_0x474fff){if(_0x474fff){_0xb4e4df[_0xaddd('0x53')]=_[_0xaddd('0x55')](db[_0xaddd('0x10b')][_0xaddd('0x4f')]);_0xb4e4df[_0xaddd('0x54')]=_['keys'](_0x4cb7ea[_0xaddd('0x54')]);_0xb4e4df[_0xaddd('0x56')]=_[_0xaddd('0x57')](_0xb4e4df[_0xaddd('0x53')],_0xb4e4df['query']);_0x95448[_0xaddd('0x58')]=_[_0xaddd('0x57')](_0xb4e4df[_0xaddd('0x53')],qs[_0xaddd('0x59')](_0x4cb7ea[_0xaddd('0x54')][_0xaddd('0x59')]));_0x95448['attributes']=_0x95448[_0xaddd('0x58')][_0xaddd('0x5a')]?_0x95448[_0xaddd('0x58')]:_0xb4e4df['model'];if(!_0x4cb7ea[_0xaddd('0x54')][_0xaddd('0x5b')](_0xaddd('0x10f'))){_0x95448['limit']=qs[_0xaddd('0x2e')](_0x4cb7ea[_0xaddd('0x54')][_0xaddd('0x2e')]);_0x95448[_0xaddd('0x2c')]=qs[_0xaddd('0x2c')](_0x4cb7ea[_0xaddd('0x54')][_0xaddd('0x2c')]);}_0x95448[_0xaddd('0x110')]=qs[_0xaddd('0x5c')](_0x4cb7ea[_0xaddd('0x54')][_0xaddd('0x5c')]);_0x95448[_0xaddd('0x5d')]=qs[_0xaddd('0x56')](_[_0xaddd('0x5e')](_0x4cb7ea['query'],_0xb4e4df[_0xaddd('0x56')]));_0x95448[_0xaddd('0x5d')][_0xaddd('0xbc')]=_0x474fff['id'];if(_0x4cb7ea['query']['filter']){_0x95448['where']=_['merge'](_0x95448[_0xaddd('0x5d')],{'$or':_[_0xaddd('0x41')](_0x95448[_0xaddd('0x58')],function(_0x1ead76){var _0x5dc2b7={};_0x5dc2b7[_0x1ead76]={'$like':'%'+_0x4cb7ea[_0xaddd('0x54')][_0xaddd('0x96')]+'%'};return _0x5dc2b7;})});}if(_0x4cb7ea[_0xaddd('0x54')]['$gte']){var _0x2ea7f4=_0x4cb7ea[_0xaddd('0x54')][_0xaddd('0x8e')]['split'](',');var _0xd81e3b={};_0xd81e3b[_0x2ea7f4[0x0]]={'$gte':moment(_0x2ea7f4[0x1])[_0xaddd('0xef')](_0xaddd('0x111'))};_0x95448[_0xaddd('0x5d')]=_[_0xaddd('0x3b')](_0x95448['where'],_0xd81e3b);}_0x95448=_[_0xaddd('0x3b')]({},_0x95448,_0x4cb7ea[_0xaddd('0x112')]);return db[_0xaddd('0x10b')][_0xaddd('0x2f')]({'where':_0x95448[_0xaddd('0x5d')]})[_0xaddd('0x35')](function(_0x95cfe5){_0x471fa0['count']=_0x95cfe5;if(_0x4cb7ea['query'][_0xaddd('0x113')]){_0x95448[_0xaddd('0xc1')]=[{'all':!![]}];}return db[_0xaddd('0x10b')][_0xaddd('0x114')](_0x95448);})[_0xaddd('0x35')](function(_0x83335b){_0x471fa0[_0xaddd('0xbe')]=_0x83335b;return _0x471fa0;});}})[_0xaddd('0x35')](respondWithFilteredResult(_0x180c15,_0x95448))[_0xaddd('0xc2')](handleError(_0x180c15,null));};exports[_0xaddd('0x115')]=function(_0x124ab0,_0x2387e9,_0x1885bb){var _0x1be44b={'where':{}},_0x286228={},_0x5efbd1={'count':0x0,'rows':[]};return db[_0xaddd('0x4e')][_0xaddd('0xc5')]({'where':{'id':_0x124ab0[_0xaddd('0xc0')]['id']}})[_0xaddd('0x35')](handleEntityNotFound(_0x2387e9,null))[_0xaddd('0x35')](function(_0x50aed7){if(_0x50aed7){_0x286228[_0xaddd('0x53')]=_[_0xaddd('0x55')](db['ChatMessage'][_0xaddd('0x4f')]);_0x286228[_0xaddd('0x54')]=_[_0xaddd('0x55')](_0x124ab0[_0xaddd('0x54')]);_0x286228[_0xaddd('0x56')]=_[_0xaddd('0x57')](_0x286228['model'],_0x286228[_0xaddd('0x54')]);_0x1be44b['attributes']=_[_0xaddd('0x57')](_0x286228[_0xaddd('0x53')],qs[_0xaddd('0x59')](_0x124ab0[_0xaddd('0x54')][_0xaddd('0x59')]));_0x1be44b[_0xaddd('0x58')]=_0x1be44b['attributes'][_0xaddd('0x5a')]?_0x1be44b[_0xaddd('0x58')]:_0x286228[_0xaddd('0x53')];if(!_0x124ab0[_0xaddd('0x54')]['hasOwnProperty'](_0xaddd('0x10f'))){_0x1be44b[_0xaddd('0x2e')]=qs[_0xaddd('0x2e')](_0x124ab0['query'][_0xaddd('0x2e')]);_0x1be44b[_0xaddd('0x2c')]=qs['offset'](_0x124ab0[_0xaddd('0x54')]['offset']);}_0x1be44b[_0xaddd('0x110')]=qs['sort'](_0x124ab0[_0xaddd('0x54')]['sort']);_0x1be44b[_0xaddd('0x5d')]=qs[_0xaddd('0x56')](_[_0xaddd('0x5e')](_0x124ab0[_0xaddd('0x54')],_0x286228[_0xaddd('0x56')]));_0x1be44b['where'][_0xaddd('0xbc')]=_0x50aed7['id'];if(_0x124ab0[_0xaddd('0x54')]['filter']){_0x1be44b[_0xaddd('0x5d')]=_[_0xaddd('0x3b')](_0x1be44b['where'],{'$or':_[_0xaddd('0x41')](_0x1be44b['attributes'],function(_0x472098){var _0x279606={};_0x279606[_0x472098]={'$like':'%'+_0x124ab0[_0xaddd('0x54')][_0xaddd('0x96')]+'%'};return _0x279606;})});}_0x1be44b[_0xaddd('0x5d')][_0xaddd('0xfd')]=![];if(_0x124ab0[_0xaddd('0x54')]['id']){_0x1be44b['where']['id']={'$gt':_0x124ab0[_0xaddd('0x54')]['id']};}_0x1be44b=_[_0xaddd('0x3b')]({},_0x1be44b,_0x124ab0[_0xaddd('0x112')]);return db[_0xaddd('0x10b')][_0xaddd('0x2f')]({'where':_0x1be44b[_0xaddd('0x5d')]})[_0xaddd('0x35')](function(_0x4890f9){_0x5efbd1[_0xaddd('0x2f')]=_0x4890f9;_0x1be44b[_0xaddd('0xc1')]=[];if(_0x124ab0[_0xaddd('0x54')][_0xaddd('0x116')]){_0x1be44b[_0xaddd('0xc1')]['push']({'model':db[_0xaddd('0x85')],'as':_0xaddd('0x85'),'attributes':['id',_0xaddd('0x42'),_0xaddd('0x117')]});}if(_0x124ab0[_0xaddd('0x54')]['includeAll']){_0x1be44b['include']=[{'all':!![]}];}return db[_0xaddd('0x10b')][_0xaddd('0x114')](_0x1be44b);})['then'](function(_0x1e80c7){_0x5efbd1['rows']=_0x1e80c7;return _0x5efbd1;});}})[_0xaddd('0x35')](respondWithFilteredResult(_0x2387e9,_0x1be44b))[_0xaddd('0xc2')](handleError(_0x2387e9,null));};exports[_0xaddd('0x118')]=function(_0x30b74d,_0x1822c8,_0x1ac681){return db[_0xaddd('0x4e')]['find']({'where':{'id':_0x30b74d[_0xaddd('0xc0')]['id']}})[_0xaddd('0x35')](handleEntityNotFound(_0x1822c8,null))[_0xaddd('0x35')](function(_0x204f99){if(_0x204f99){return _0x204f99['setTags'](_0x30b74d[_0xaddd('0x3c')]['ids'],_[_0xaddd('0x10d')](_0x30b74d[_0xaddd('0x3c')],[_0xaddd('0x10c'),'id'])||{})['spread'](function(){return db[_0xaddd('0x83')][_0xaddd('0x114')]({'attributes':['id',_0xaddd('0x38'),'color'],'where':{'id':_0x30b74d[_0xaddd('0x3c')][_0xaddd('0x10c')]}});})[_0xaddd('0x35')](function(_0x12b3ea){socket[_0xaddd('0x119')](_0xaddd('0x11a'),{'id':Number(_0x30b74d['params']['id']),'tags':_0x12b3ea||[]});return{'id':Number(_0x30b74d[_0xaddd('0xc0')]['id']),'tags':_0x12b3ea||[]};});}})['then'](respondWithResult(_0x1822c8,null))[_0xaddd('0xc2')](handleError(_0x1822c8,null));};exports[_0xaddd('0x11b')]=function(_0x433033,_0x2daeb1,_0x21209f){return db[_0xaddd('0x4e')][_0xaddd('0x74')]({'where':{'id':_0x433033[_0xaddd('0xc0')]['id']}})[_0xaddd('0x35')](handleEntityNotFound(_0x2daeb1,null))[_0xaddd('0x35')](function(_0x328c40){if(_0x328c40){return _0x328c40[_0xaddd('0x11b')](_0x433033[_0xaddd('0x54')]['ids']);}})[_0xaddd('0x35')](respondWithStatusCode(_0x2daeb1,null))[_0xaddd('0xc2')](handleError(_0x2daeb1,null));};exports['download']=function(_0x4eef78,_0x55e93d){var _0x19a536=moment()[_0xaddd('0x11c')]()[_0xaddd('0xa7')]();var _0x32c9e1=path[_0xaddd('0xe8')](config['root'],_0xaddd('0x11d'),_0xaddd('0x11e'),_0xaddd('0x11f'));var _0x4d6aa0=path[_0xaddd('0xe8')](config[_0xaddd('0xe9')],'server',_0xaddd('0x11e'),_0xaddd('0x120'));var _0x40a5ba=path[_0xaddd('0xe8')](_0x32c9e1,_0x19a536);var _0x124ff6=util[_0xaddd('0xef')](_0xaddd('0x121'),_0x4eef78[_0xaddd('0xc0')]['id'],_0x19a536);var _0x5cd6e5=path['join'](_0x32c9e1,_0x124ff6);var _0x3d03e9=[];_0x3d03e9[_0xaddd('0x45')]({'model':db['User'],'as':'User','attributes':['id',_0xaddd('0x42')],'raw':!![]});_0x3d03e9['push']({'model':db[_0xaddd('0xd8')],'as':'Contact','attributes':['id','firstName',_0xaddd('0x122')],'raw':!![]});if(_0x4eef78['query'][_0xaddd('0x120')]){_0x3d03e9[_0xaddd('0x45')]({'model':db['Attachment'],'as':_0xaddd('0xe3'),'raw':!![]});}var _0x66ef3b=[{'model':db[_0xaddd('0x10b')],'as':_0xaddd('0xf2'),'attributes':['id',_0xaddd('0x3c'),_0xaddd('0x8c'),_0xaddd('0x123'),_0xaddd('0xfd'),_0xaddd('0x92')],'include':_0x3d03e9}];_0x66ef3b[_0xaddd('0x45')]({'model':db[_0xaddd('0xc6')],'as':_0xaddd('0x124'),'attributes':['id',_0xaddd('0x38')]});_0x66ef3b['push']({'model':db[_0xaddd('0x85')],'as':_0xaddd('0x125'),'attributes':['id',_0xaddd('0x42')]});return db[_0xaddd('0x4e')]['find']({'where':{'id':_0x4eef78[_0xaddd('0xc0')]['id']},'include':_0x66ef3b})[_0xaddd('0x35')](handleEntityNotFound(_0x55e93d,null))[_0xaddd('0x35')](function(_0x2a15d4){if(_0x2a15d4){var _0x114c1b=_0x2a15d4[_0xaddd('0x126')]({'plain':!![]});fs[_0xaddd('0x127')](_0x40a5ba);var _0x31e89d={'channel':'Chat','account':_0x114c1b[_0xaddd('0x124')]['name'],'agent':_0x114c1b[_0xaddd('0x125')]?_0x114c1b[_0xaddd('0x125')][_0xaddd('0x42')]:_0xaddd('0x128'),'createdAt':moment(_0x114c1b[_0xaddd('0x8c')])[_0xaddd('0xef')](_0xaddd('0x111'))[_0xaddd('0xa7')](),'closedAt':_0x114c1b[_0xaddd('0xdd')]?moment(_0x114c1b[_0xaddd('0x129')])[_0xaddd('0xef')](_0xaddd('0x111'))[_0xaddd('0xa7')]():'','disposition':_0x114c1b[_0xaddd('0x4d')],'chatInfo':{'browser':_0x114c1b[_0xaddd('0x12a')],'os':_0x114c1b['osName'],'referer':_0x114c1b[_0xaddd('0x12b')],'customerIp':_0x114c1b[_0xaddd('0x12c')],'customerPort':_0x114c1b[_0xaddd('0x12d')]?_0x114c1b[_0xaddd('0x12d')]:_0xaddd('0x128')},'messages':_(_0x114c1b[_0xaddd('0xf2')])['tail']()[_0xaddd('0x96')]({'secret':![]})[_0xaddd('0x41')](function(_0x379237){if(_0x379237[_0xaddd('0xe3')]){var _0x5ab18b=path[_0xaddd('0xe8')](_0x4d6aa0,_0x379237['Attachment'][_0xaddd('0x12e')]);if(fs[_0xaddd('0x12f')](_0x5ab18b)){fs[_0xaddd('0x130')](_0x5ab18b)[_0xaddd('0x131')](fs[_0xaddd('0x132')](path[_0xaddd('0xe8')](_0x40a5ba,_0x379237[_0xaddd('0xe3')][_0xaddd('0x12e')])));}}return{'date':moment(_0x379237['createdAt'])[_0xaddd('0xef')](_0xaddd('0x111'))[_0xaddd('0xa7')](),'sender':_0x379237[_0xaddd('0x123')]==='out'?_0x379237['User']?_0x379237[_0xaddd('0x85')]['fullname']:_0xaddd('0xf3'):_0x379237[_0xaddd('0x79')][_0xaddd('0x133')]+(_0x379237[_0xaddd('0x79')][_0xaddd('0x122')]?'\x20'+_0x379237[_0xaddd('0x79')][_0xaddd('0x122')]:''),'body':_0x379237[_0xaddd('0xe3')]?_0x379237[_0xaddd('0xe3')]['basename']:_0x379237[_0xaddd('0x3c')],'direction':_0x379237[_0xaddd('0x123')]==='out'?'A':'C','secret':_0x379237[_0xaddd('0xfd')],'read':_0x379237[_0xaddd('0x92')],'attachment':_0x379237[_0xaddd('0xe3')]};})[_0xaddd('0x7c')]()};return ejs[_0xaddd('0x134')](path[_0xaddd('0xe8')](config[_0xaddd('0xe9')],_0xaddd('0x11d'),_0xaddd('0x135'),_0xaddd('0x136')),{'interaction':_0x31e89d})[_0xaddd('0x35')](function(_0x40ae45){var _0x222f77=path[_0xaddd('0xe8')](_0x40a5ba,_0xaddd('0x137')+_0x114c1b['id']+'-'+_0x19a536+'.pdf');var _0x51667b={'path':_0x222f77,'channel':'Chat','interactionId':_0x114c1b['id']};return pdf[_0xaddd('0x138')](_0x40ae45,_0x51667b);})['then'](function(){return new BPromise(function(_0x552f6c,_0x26010a){zipdir(_0x40a5ba,{'saveTo':_0x5cd6e5},function(_0x4d3ae3,_0x3a4313){if(_0x4d3ae3)return _0x26010a(_0x4d3ae3);return _0x552f6c(_0x3a4313);});})[_0xaddd('0x35')](function(){return new BPromise(function(_0x5de6da,_0x2cdb51){rimraf(_0x40a5ba,function(_0x337a24){if(_0x337a24)_0x2cdb51(_0x337a24);return _0x5de6da();});});})[_0xaddd('0x35')](function(){return _0x55e93d[_0xaddd('0xeb')](_0x5cd6e5,_0x124ff6,function(_0x41f307){if(_0x41f307){console[_0xaddd('0x139')](_0xaddd('0x13a'),_0x41f307);}else{fs[_0xaddd('0x13b')](_0x5cd6e5);}});});});}else{return _0x55e93d[_0xaddd('0x28')](0xc8);}})[_0xaddd('0xc2')](handleError(_0x55e93d,null));};
\ No newline at end of file
+var _0xa061=['where','select','field','color','tools_tags','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','from','chat_interactions','o.id\x20=\x20i.UserId','chat_websites','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','count','keyBy','merge','ChatInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','show','includeAll','options','create','body','params','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooTopic','vidaooNote','vidaooMetadata','user','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','metadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','entity\x20not\x20found','attachmentUpload','file','originalname','basename','filename','Attachment','Unauthorized','attachId','ChatOfflineMessageId','join','offline-chat/','close','mailTranscript','root','server/files/chat/upload/','format','pathTranscript','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','pick','split','YYYY-MM-DD\x20HH:mm:ss','include','findAll','getMyMessages','includeAgent','alias','addTags','spread','removeTags','download','unix','server','files','CmContact','lastName','Owner','mkdirSync','Chat','Account','N.A.','osName','referer','customerIp','tail','existsSync','createReadStream','pipe','createWriteStream','firstName','out','renderFile','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./chatInteraction.socket','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject','save','update','destroy','stack','name','send','render','contact','agent','interaction','account','Users','map','Tags','TagIds','forEach','push','waiting','talking','answered','unmanaged','abandoned','total','UserId','closed','disposition','index','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x25ed4,_0x3f8b40){var _0x13df04=function(_0x5a3ecc){while(--_0x5a3ecc){_0x25ed4['push'](_0x25ed4['shift']());}};_0x13df04(++_0x3f8b40);}(_0xa061,0xe2));var _0x1a06=function(_0x5f51d2,_0x4f0133){_0x5f51d2=_0x5f51d2-0x0;var _0x24bf08=_0xa061[_0x5f51d2];return _0x24bf08;};'use strict';var emlformat=require(_0x1a06('0x0'));var rimraf=require(_0x1a06('0x1'));var zipdir=require(_0x1a06('0x2'));var jsonpatch=require(_0x1a06('0x3'));var rp=require(_0x1a06('0x4'));var moment=require('moment');var BPromise=require(_0x1a06('0x5'));var Mustache=require(_0x1a06('0x6'));var util=require(_0x1a06('0x7'));var path=require(_0x1a06('0x8'));var sox=require(_0x1a06('0x9'));var csv=require(_0x1a06('0xa'));var ejs=require(_0x1a06('0xb'));var fs=require('fs');var fs_extra=require(_0x1a06('0xc'));var _=require(_0x1a06('0xd'));var squel=require('squel');var crypto=require(_0x1a06('0xe'));var jsforce=require(_0x1a06('0xf'));var deskjs=require(_0x1a06('0x10'));var toCsv=require('to-csv');var querystring=require(_0x1a06('0x11'));var Papa=require('papaparse');var Redis=require(_0x1a06('0x12'));var authService=require(_0x1a06('0x13'));var qs=require(_0x1a06('0x14'));var as=require(_0x1a06('0x15'));var pdf=require(_0x1a06('0x16'));var hardwareService=require(_0x1a06('0x17'));var logger=require(_0x1a06('0x18'))(_0x1a06('0x19'));var utils=require('../../config/utils');var config=require(_0x1a06('0x1a'));var licenseUtil=require(_0x1a06('0x1b'));var db=require(_0x1a06('0x1c'))['db'];config[_0x1a06('0x1d')]=_[_0x1a06('0x1e')](config[_0x1a06('0x1d')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1a06('0x1f'))[_0x1a06('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x1a06('0x21')][_0x1a06('0x22')]({'port':0x232b});var client9004=jayson[_0x1a06('0x21')][_0x1a06('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x2f0979,_0x527d89,_0x281b05,_0x134d16){return new BPromise(function(_0x58c908,_0x2dd45b){var _0x204b17=_0x134d16||client;return _0x204b17[_0x1a06('0x23')](_0x2f0979,_0x281b05)[_0x1a06('0x24')](function(_0x411e5d){logger[_0x1a06('0x25')](_0x1a06('0x26'),_0x527d89,_0x1a06('0x27'));logger['debug'](_0x1a06('0x28'),_0x527d89,_0x1a06('0x27'),JSON[_0x1a06('0x29')](_0x411e5d));if(_0x411e5d[_0x1a06('0x2a')]){if(_0x411e5d[_0x1a06('0x2a')][_0x1a06('0x2b')]===0x1f4){logger['error'](_0x1a06('0x26'),_0x527d89,_0x411e5d[_0x1a06('0x2a')][_0x1a06('0x2c')]);return _0x2dd45b(_0x411e5d[_0x1a06('0x2a')][_0x1a06('0x2c')]);}logger['error'](_0x1a06('0x26'),_0x527d89,_0x411e5d[_0x1a06('0x2a')][_0x1a06('0x2c')]);return _0x58c908(_0x411e5d[_0x1a06('0x2a')][_0x1a06('0x2c')]);}else{logger['info'](_0x1a06('0x26'),_0x527d89,'request\x20sent');_0x58c908(_0x411e5d[_0x1a06('0x2d')]['message']);}})[_0x1a06('0x2e')](function(_0xb078de){logger[_0x1a06('0x2a')](_0x1a06('0x26'),_0x527d89,_0xb078de);_0x2dd45b(_0xb078de);});});}function respondWithStatusCode(_0x35ffa7,_0x8a55e8){_0x8a55e8=_0x8a55e8||0xcc;return function(_0x336b0f){if(_0x336b0f){return _0x35ffa7[_0x1a06('0x2f')](_0x8a55e8);}return _0x35ffa7[_0x1a06('0x30')](_0x8a55e8)[_0x1a06('0x31')]();};}function respondWithResult(_0x5c3dad,_0x319b31){_0x319b31=_0x319b31||0xc8;return function(_0x26bd71){if(_0x26bd71){return _0x5c3dad[_0x1a06('0x30')](_0x319b31)[_0x1a06('0x32')](_0x26bd71);}};}function respondWithFilteredResult(_0x401c83,_0x4ba9f7){return function(_0x258323){if(_0x258323){var _0x1cba8a=typeof _0x4ba9f7[_0x1a06('0x33')]==='undefined'&&typeof _0x4ba9f7[_0x1a06('0x34')]===_0x1a06('0x35');var _0x21adab=_0x258323['count'];var _0xeff454=_0x1cba8a?0x0:_0x4ba9f7[_0x1a06('0x33')];var _0x548caf=_0x1cba8a?_0x258323['count']:_0x4ba9f7[_0x1a06('0x33')]+_0x4ba9f7['limit'];var _0x56567a;if(_0x548caf>=_0x21adab){_0x548caf=_0x21adab;_0x56567a=0xc8;}else{_0x56567a=0xce;}_0x401c83[_0x1a06('0x30')](_0x56567a);return _0x401c83[_0x1a06('0x36')]('Content-Range',_0xeff454+'-'+_0x548caf+'/'+_0x21adab)['json'](_0x258323);}return null;};}function patchUpdates(_0x387ff5){return function(_0x1c8f93){try{jsonpatch[_0x1a06('0x37')](_0x1c8f93,_0x387ff5,!![]);}catch(_0x355542){return BPromise[_0x1a06('0x38')](_0x355542);}return _0x1c8f93[_0x1a06('0x39')]();};}function saveUpdates(_0x17646f,_0x3b52f3){return function(_0xca754c){if(_0xca754c){return _0xca754c[_0x1a06('0x3a')](_0x17646f)[_0x1a06('0x24')](function(_0x35d7c4){return _0x35d7c4;});}return null;};}function removeEntity(_0x2b3ad8,_0x499682){return function(_0x296021){if(_0x296021){return _0x296021[_0x1a06('0x3b')]()[_0x1a06('0x24')](function(){_0x2b3ad8['status'](0xcc)[_0x1a06('0x31')]();});}};}function handleEntityNotFound(_0x46d21c,_0x496fc9){return function(_0x4259df){if(!_0x4259df){_0x46d21c[_0x1a06('0x2f')](0x194);}return _0x4259df;};}function handleError(_0x6ed15f,_0x35dd2f){_0x35dd2f=_0x35dd2f||0x1f4;return function(_0xeedb5b){logger[_0x1a06('0x2a')](_0xeedb5b[_0x1a06('0x3c')]);if(_0xeedb5b['name']){delete _0xeedb5b[_0x1a06('0x3d')];}_0x6ed15f['status'](_0x35dd2f)[_0x1a06('0x3e')](_0xeedb5b);};}function getMustacheRender(_0x1e239d,_0x349227){return Mustache[_0x1a06('0x3f')](_0x1e239d,_['merge'](_0x349227['body'],{'contact':_0x349227[_0x1a06('0x40')],'message':_0x349227[_0x1a06('0x2c')],'agent':_0x349227[_0x1a06('0x41')],'interaction':_0x349227[_0x1a06('0x42')],'account':_0x349227[_0x1a06('0x43')]}))||'';}function getInteractionUsers(_0x5ef272,_0x1adc4d){return new BPromise(function(_0x2d6077,_0x501e05){try{if(_0x1adc4d[_0x5ef272['id']]){_0x5ef272[_0x1a06('0x44')]=_[_0x1a06('0x45')](_0x1adc4d[_0x5ef272['id']],function(_0x363e87){return{'id':_0x363e87['id'],'fullname':_0x363e87['fullname']};});}}catch(_0x427460){_0x501e05(_0x427460);}_0x2d6077(_0x5ef272);});}function getInteractionTags(_0x409502,_0xf608dc){return new BPromise(function(_0xa5930f,_0x24eaf4){try{if(_0x409502['TagIds']){_0x409502[_0x1a06('0x46')]=[];_0x409502[_0x1a06('0x47')]['split'](',')[_0x1a06('0x48')](function(_0xd31ec8){_0x409502[_0x1a06('0x46')][_0x1a06('0x49')](_0xf608dc[_0xd31ec8]);});}delete _0x409502[_0x1a06('0x47')];}catch(_0x2c66a3){_0x24eaf4(_0x2c66a3);}_0xa5930f(_0x409502);});}function updateChatInteraction(_0x29399a,_0x17a6d1,_0x3f8753){return new BPromise(function(_0xa3b1bc,_0x4ad190){return getInteractionUsers(_0x29399a,_0x3f8753)[_0x1a06('0x24')](function(_0x38cdd0){return getInteractionTags(_0x38cdd0,_0x17a6d1);})[_0x1a06('0x24')](function(_0x2a2d83){return getStateInteraction(_0x2a2d83);})[_0x1a06('0x24')](function(_0x482bee){_0xa3b1bc(_0x482bee);})[_0x1a06('0x2e')](function(_0x4bbe6e){_0x4ad190(_0x4bbe6e);});});}function getStateInteraction(_0x51b85b){return new BPromise(function(_0x4839ee){_0x51b85b[_0x1a06('0x4a')]=0x0;_0x51b85b[_0x1a06('0x4b')]=0x0;_0x51b85b[_0x1a06('0x4c')]=0x0;_0x51b85b[_0x1a06('0x4d')]=0x0;_0x51b85b[_0x1a06('0x4e')]=0x0;_0x51b85b[_0x1a06('0x4f')]=0x0;if(!_0x51b85b['closed']&&!_0x51b85b[_0x1a06('0x50')]){_0x51b85b['waiting']+=0x1;}if(!_0x51b85b['closed']&&_0x51b85b[_0x1a06('0x50')]){_0x51b85b['talking']+=0x1;if(_0x51b85b[_0x1a06('0x4a')]){_0x51b85b[_0x1a06('0x4a')]-=0x1;}}if(_0x51b85b[_0x1a06('0x51')]&&_0x51b85b['disposition']==='abandoned'){_0x51b85b[_0x1a06('0x4e')]+=0x1;if(_0x51b85b[_0x1a06('0x4a')]){_0x51b85b['waiting']-=0x1;}}else if(_0x51b85b[_0x1a06('0x51')]&&!_0x51b85b[_0x1a06('0x50')]&&_0x51b85b[_0x1a06('0x52')]){_0x51b85b['unmanaged']+=0x1;if(_0x51b85b[_0x1a06('0x4a')]){_0x51b85b['waiting']-=0x1;}}else if(_0x51b85b[_0x1a06('0x51')]&&_0x51b85b['UserId']){_0x51b85b['answered']+=0x1;if(_0x51b85b[_0x1a06('0x4b')]){_0x51b85b[_0x1a06('0x4b')]-=0x1;}}_0x51b85b['total']+=0x1;_0x4839ee(_0x51b85b);});}exports[_0x1a06('0x53')]=function(_0x452fae,_0x4e431d){var _0x42adc3={},_0x41b614={},_0x348d03={'count':0x0,'rows':[]};var _0x256d8f=_[_0x1a06('0x45')](db['ChatInteraction'][_0x1a06('0x54')],function(_0x39fd98){return{'name':_0x39fd98[_0x1a06('0x55')],'type':_0x39fd98[_0x1a06('0x56')][_0x1a06('0x57')]};});_0x41b614[_0x1a06('0x58')]=_[_0x1a06('0x45')](_0x256d8f,_0x1a06('0x3d'));_0x41b614[_0x1a06('0x59')]=_[_0x1a06('0x5a')](_0x452fae[_0x1a06('0x59')]);_0x41b614[_0x1a06('0x5b')]=_['intersection'](_0x41b614[_0x1a06('0x58')],_0x41b614[_0x1a06('0x59')]);_0x42adc3[_0x1a06('0x5c')]=_[_0x1a06('0x5d')](_0x41b614[_0x1a06('0x58')],qs['fields'](_0x452fae[_0x1a06('0x59')][_0x1a06('0x5e')]));_0x42adc3[_0x1a06('0x5c')]=_0x42adc3[_0x1a06('0x5c')]['length']?_0x42adc3[_0x1a06('0x5c')]:_0x41b614[_0x1a06('0x58')];if(!_0x452fae[_0x1a06('0x59')][_0x1a06('0x5f')](_0x1a06('0x60'))){_0x42adc3['limit']=qs[_0x1a06('0x34')](_0x452fae[_0x1a06('0x59')]['limit']);_0x42adc3['offset']=qs[_0x1a06('0x33')](_0x452fae['query']['offset']);}_0x42adc3[_0x1a06('0x61')]=qs[_0x1a06('0x62')](_0x452fae[_0x1a06('0x59')]['sort']);_0x42adc3[_0x1a06('0x63')]=qs['filters'](_['pick'](_0x452fae[_0x1a06('0x59')],_0x41b614[_0x1a06('0x5b')]),_0x256d8f);var _0x946fe9=[];var _0x427485=squel[_0x1a06('0x64')]()[_0x1a06('0x65')]('id')[_0x1a06('0x65')](_0x1a06('0x3d'))[_0x1a06('0x65')](_0x1a06('0x66'))['from'](_0x1a06('0x67'));var _0x259fac=squel[_0x1a06('0x64')]()['field'](_0x1a06('0x68'))['field'](_0x1a06('0x69'))['field'](_0x1a06('0x6a'))['from'](_0x1a06('0x6b'),'ui')[_0x1a06('0x6c')](_0x1a06('0x6d'),'u','u.id\x20=\x20ui.UserId');var _0x529140=squel['select']()[_0x1a06('0x6e')](_0x1a06('0x6f'),'i')[_0x1a06('0x6c')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x1a06('0x6c')](_0x1a06('0x6d'),'o',_0x1a06('0x70'))['left_join'](_0x1a06('0x71'),'a','a.id\x20=\x20i.ChatWebsiteId')['left_join']('chat_messages','me','me.ChatInteractionId\x20=\x20i.id')[_0x1a06('0x6c')](_0x1a06('0x72'),'it','it.ChatInteractionId\x20=\x20i.id')['left_join']('tools_tags','t',_0x1a06('0x73'));var _0x4c55be=squel[_0x1a06('0x74')]();var _0x49bf7a=[];var _0x402219=squel['expr']();var _0x12bd22;if(_0x452fae[_0x1a06('0x59')][_0x1a06('0x75')]){_0x12bd22=as['parseSearch'](_0x452fae['query'][_0x1a06('0x75')]);var _0x3d8298=_0x12bd22[_0x1a06('0x76')];for(var _0x5a6c09=0x0;_0x5a6c09<_0x12bd22[_0x1a06('0x77')][_0x1a06('0x78')];_0x5a6c09++){var _0x2609dc=_0x12bd22[_0x1a06('0x77')][_0x5a6c09];var _0x2e5acd='i';var _0x28e0d1=_[_0x1a06('0x79')](_0x256d8f,[_0x1a06('0x3d'),_0x2609dc[_0x1a06('0x65')]]);if(!_0x28e0d1){switch(_0x2609dc[_0x1a06('0x65')]){case _0x1a06('0x7a'):if(_0x2609dc[_0x1a06('0x7b')]==0x1){_0x529140[_0x1a06('0x7c')]('`'+_0x2609dc['field']+_0x1a06('0x7d'));}else{_0x529140['having']('`'+_0x2609dc[_0x1a06('0x65')]+_0x1a06('0x7e'));}break;case'Contact':if(_0x2609dc['operator']===_0x1a06('0x7f')){if(_0x2609dc[_0x1a06('0x7b')]['split']('\x20')['length']>0x1){_0x4c55be[_0x3d8298](_0x1a06('0x80'),qs['getFullTextValue'](_0x2609dc[_0x1a06('0x7b')]),null);}else{var _0x2602b1='%'+_0x2609dc['value']+'%';_0x4c55be[_0x3d8298](_0x1a06('0x81'),_0x2602b1,_0x2602b1,_0x2602b1);}}else{_0x28e0d1=_[_0x1a06('0x79')](_0x256d8f,['name',_0x1a06('0x82')]);_0x2609dc[_0x1a06('0x65')]=_0x1a06('0x82');_0x4520df=as[_0x1a06('0x83')](_0x2e5acd,_0x28e0d1[_0x1a06('0x56')],_0x2609dc);_0x4c55be[_0x3d8298](_0x4520df['text'],_0x4520df[_0x1a06('0x7b')][_0x1a06('0x84')],_0x4520df[_0x1a06('0x7b')]['end']);}break;case _0x1a06('0x85'):var _0x17776c=_0x2609dc[_0x1a06('0x7b')]['split'](',')[_0x1a06('0x45')](function(_0x3526f2){return Number(_0x3526f2);});_0x17776c[_0x1a06('0x48')](function(_0x5de9bf){_0x402219['or'](_0x1a06('0x86'),'%,'+_0x5de9bf+',%');});_0x49bf7a=_[_0x1a06('0x87')](_0x49bf7a,_0x17776c);break;case _0x1a06('0x88'):if(_0x2609dc[_0x1a06('0x89')]==='$substring'){_0x4c55be[_0x3d8298](_0x1a06('0x8a'),'%'+_0x2609dc[_0x1a06('0x7b')]+'%',null);}else{_0x28e0d1=_[_0x1a06('0x79')](_0x256d8f,[_0x1a06('0x3d'),_0x1a06('0x50')]);_0x2609dc[_0x1a06('0x65')]='UserId';_0x4520df=as[_0x1a06('0x83')](_0x2e5acd,_0x28e0d1[_0x1a06('0x56')],_0x2609dc);_0x4c55be[_0x3d8298](_0x4520df[_0x1a06('0x8b')],_0x4520df[_0x1a06('0x7b')]['start'],_0x4520df[_0x1a06('0x7b')]['end']);}break;case'body':_0x4520df=as[_0x1a06('0x83')]('me',null,_0x2609dc);_0x4c55be[_0x3d8298](_0x4520df[_0x1a06('0x8b')],_0x4520df[_0x1a06('0x7b')][_0x1a06('0x84')],_0x4520df[_0x1a06('0x7b')][_0x1a06('0x31')]);break;}}else{var _0x4520df=as[_0x1a06('0x83')](_0x2e5acd,_0x28e0d1[_0x1a06('0x56')],_0x2609dc);_0x4c55be[_0x3d8298](_0x4520df[_0x1a06('0x8b')],_0x4520df[_0x1a06('0x7b')][_0x1a06('0x84')],_0x4520df[_0x1a06('0x7b')][_0x1a06('0x31')]);}}}else{var _0x62103f=_(_0x452fae[_0x1a06('0x59')])['keys']()['map'](function(_0x4b6d96){return _['some'](_0x256d8f,[_0x1a06('0x3d'),_0x4b6d96])?_0x4b6d96:undefined;})[_0x1a06('0x8c')]()['value']();if(!_[_0x1a06('0x8d')](_0x62103f)){_0x62103f[_0x1a06('0x48')](function(_0x433793){if(_0x433793===_0x1a06('0x8e')){_0x529140[_0x1a06('0x63')](_0x1a06('0x8f'),[]['concat'](_0x452fae[_0x1a06('0x59')][_0x433793]));}else if(_0x433793===_0x1a06('0x90')){var _0x109c5a=JSON[_0x1a06('0x91')](_0x452fae[_0x1a06('0x59')][_0x433793])[_0x1a06('0x92')];var _0x411057=JSON['parse'](_0x452fae[_0x1a06('0x59')][_0x433793])[_0x1a06('0x93')];_0x529140['where'](_0x1a06('0x94'),_0x109c5a,_0x411057);}else{if(_0x452fae[_0x1a06('0x59')][_0x433793]===_0x1a06('0x95')){_0x529140[_0x1a06('0x63')]('i.'+_0x433793+_0x1a06('0x96'));}else{_0x529140['where']('i.'+_0x433793+_0x1a06('0x97'),_0x452fae[_0x1a06('0x59')][_0x433793]);}}});}if(_0x452fae[_0x1a06('0x59')][_0x1a06('0x98')]){if(_0x452fae[_0x1a06('0x59')][_0x1a06('0x98')]==0x1){_0x529140[_0x1a06('0x7c')](_0x1a06('0x99'));}else{_0x529140[_0x1a06('0x7c')](_0x1a06('0x9a'));}}if(_0x452fae[_0x1a06('0x59')]['tag']){_0x49bf7a=_[_0x1a06('0x9b')](_0x452fae[_0x1a06('0x59')]['tag'])?_0x452fae['query']['tag']:new Array(_0x452fae[_0x1a06('0x59')][_0x1a06('0x9c')]);_0x49bf7a[_0x1a06('0x48')](function(_0x44cc1b){_0x402219['or'](_0x1a06('0x86'),'%,'+_0x44cc1b+',%');});}if(_0x452fae['query'][_0x1a06('0x9d')]){var _0x850cbe=_0x452fae[_0x1a06('0x59')]['filter'][_0x1a06('0x9e')]('\x5c','\x5c\x5c')[_0x1a06('0x9e')](/'/g,'\x27\x27');if(qs[_0x1a06('0x9f')](_0x850cbe)){_0x4c55be['or'](_0x1a06('0xa0'),_0x850cbe+'%');}else{_0x4c55be['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x1a06('0xa1')](_0x850cbe))['or'](_0x1a06('0xa2'),_0x850cbe+'%');}}}_0x529140['where'](_0x4c55be);_0x529140[_0x1a06('0xa3')](_0x1a06('0xa4'));var _0x5b4fce={'type':db[_0x1a06('0xa5')][_0x1a06('0xa6')][_0x1a06('0xa7')],'raw':!![]};var _0xf9e91=_0x529140[_0x1a06('0xa8')]();_0xf9e91[_0x1a06('0x65')](_0x1a06('0xa4'));_0xf9e91['field'](_0x1a06('0xa9'),_0x1a06('0x7a'));if(_0x42adc3['order']){_0x42adc3[_0x1a06('0x61')][_0x1a06('0x48')](function(_0x899562){var _0x2a396d=_0x899562[0x0]===_0x1a06('0xaa')?_0x899562[0x0]:'i.'+_0x899562[0x0];_0x529140[_0x1a06('0x61')](_0x2a396d,_0x899562[0x1]===_0x1a06('0xab')?![]:!![]);});}if(!_[_0x1a06('0x8d')](_0x49bf7a)){_0x529140['having'](_0x402219);_0xf9e91[_0x1a06('0x63')](_0x1a06('0xac'),_0x49bf7a);}BPromise[_0x1a06('0xad')]()[_0x1a06('0x24')](function(){if(!_0x12bd22){if(_0x452fae[_0x1a06('0x59')][_0x1a06('0x8e')])return;_0xf9e91['where'](_0x1a06('0xae'));_0x529140['where'](_0x1a06('0xae'));return;}if(_0x452fae['user'][_0x1a06('0xaf')]!==_0x1a06('0x41'))return;return _0x452fae['user'][_0x1a06('0xb0')]({'attributes':['id'],'raw':!![]})[_0x1a06('0x24')](function(_0x5c848c){if(_[_0x1a06('0x8d')](_0x5c848c)){_0xf9e91[_0x1a06('0x63')]('i.ChatWebsiteId\x20IS\x20NULL');_0x529140['where'](_0x1a06('0xb1'));}else{_0xf9e91['where'](_0x1a06('0x8f'),_[_0x1a06('0x45')](_0x5c848c,'id'));_0x529140[_0x1a06('0x63')](_0x1a06('0x8f'),_['map'](_0x5c848c,'id'));}});})[_0x1a06('0x24')](function(){if(_0x452fae['user'][_0x1a06('0xaf')]===_0x1a06('0x41')&&!_0x12bd22&&!_0x452fae[_0x1a06('0x59')]['ChatWebsiteId'])return[];return db[_0x1a06('0xb2')][_0x1a06('0x59')](_0xf9e91[_0x1a06('0xb3')](),_0x5b4fce);})[_0x1a06('0x24')](function(_0x2a20b9){_0x348d03[_0x1a06('0xb4')]=_0x2a20b9[_0x1a06('0x78')];if(_0x348d03[_0x1a06('0xb4')]===0x0)return[];return db[_0x1a06('0xb2')][_0x1a06('0x59')](_0x427485[_0x1a06('0xb3')](),_0x5b4fce)[_0x1a06('0x24')](function(_0x4c4e2a){_0x946fe9=_[_0x1a06('0xb5')](_0x4c4e2a,'id');_0x5b4fce=_[_0x1a06('0xb6')](_0x5b4fce,{'model':db[_0x1a06('0xb7')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x452fae['query'][_0x1a06('0x5e')]){_0x42adc3[_0x1a06('0x5c')][_0x1a06('0x48')](function(_0x21bb85){_0x529140['field']('i.'+_0x21bb85);});}else{_0x529140[_0x1a06('0x65')](_0x1a06('0xa9'),'unreadMessages');_0x529140[_0x1a06('0x65')](_0x1a06('0xb8'),_0x1a06('0xb9'));_0x529140[_0x1a06('0x65')](_0x1a06('0xba'),_0x1a06('0xbb'));_0x529140[_0x1a06('0x65')](_0x1a06('0xbc'),_0x1a06('0xaa'));_0x529140['field'](_0x1a06('0xbd'));_0x529140[_0x1a06('0x65')]('c.firstName',_0x1a06('0xbe'));_0x529140[_0x1a06('0x65')](_0x1a06('0xbf'),'Contact.lastName');_0x529140['field'](_0x1a06('0xc0'),_0x1a06('0xc1'));_0x529140[_0x1a06('0x65')](_0x1a06('0xc2'),_0x1a06('0xc3'));_0x529140[_0x1a06('0x65')](_0x1a06('0xc4'),'Contact.mobile');_0x529140[_0x1a06('0x65')](_0x1a06('0xc5'),_0x1a06('0xc6'));_0x529140['field'](_0x1a06('0xc7'),_0x1a06('0xc8'));_0x529140[_0x1a06('0x65')](_0x1a06('0xc9'),_0x1a06('0xca'));_0x529140['field']('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x42adc3[_0x1a06('0x34')])_0x529140[_0x1a06('0x34')](_0x42adc3[_0x1a06('0x34')]);if(_0x42adc3[_0x1a06('0x33')])_0x529140[_0x1a06('0x33')](_0x42adc3[_0x1a06('0x33')]);return db[_0x1a06('0xb2')][_0x1a06('0x59')](_0x529140['toString'](),_0x5b4fce);})['then'](function(_0x2d5c00){if(_0x2d5c00['length']>0x0)_0x259fac[_0x1a06('0x63')](_0x1a06('0xcb'),_[_0x1a06('0x45')](_0x2d5c00,'id'));return db[_0x1a06('0xb2')][_0x1a06('0x59')](_0x259fac[_0x1a06('0xb3')](),_0x5b4fce)['then'](function(_0x49a3ab){var _0x468e2f=_['groupBy'](_0x49a3ab,_0x1a06('0xcc'));var _0x390d2d=[];_0x2d5c00[_0x1a06('0x48')](function(_0x28f694){_0x390d2d['push'](updateChatInteraction(_0x28f694,_0x946fe9,_0x468e2f));});return BPromise[_0x1a06('0xcd')](_0x390d2d);});});})[_0x1a06('0x24')](function(_0x544e25){_0x348d03[_0x1a06('0xce')]=_0x544e25;return _0x348d03;})[_0x1a06('0x24')](respondWithFilteredResult(_0x4e431d,_0x42adc3))[_0x1a06('0x2e')](handleError(_0x4e431d,null));};exports[_0x1a06('0xcf')]=function(_0xda1d4b,_0x453d96){var _0x447138={'raw':![],'where':{'id':_0xda1d4b['params']['id']}},_0x3e9a17={};_0x3e9a17[_0x1a06('0x58')]=_[_0x1a06('0x5a')](db['ChatInteraction'][_0x1a06('0x54')]);_0x3e9a17[_0x1a06('0x59')]=_[_0x1a06('0x5a')](_0xda1d4b['query']);_0x3e9a17[_0x1a06('0x5b')]=_[_0x1a06('0x5d')](_0x3e9a17[_0x1a06('0x58')],_0x3e9a17[_0x1a06('0x59')]);_0x447138[_0x1a06('0x5c')]=_[_0x1a06('0x5d')](_0x3e9a17[_0x1a06('0x58')],qs['fields'](_0xda1d4b[_0x1a06('0x59')]['fields']));_0x447138[_0x1a06('0x5c')]=_0x447138['attributes'][_0x1a06('0x78')]?_0x447138[_0x1a06('0x5c')]:_0x3e9a17[_0x1a06('0x58')];if(_0xda1d4b['query'][_0x1a06('0xd0')]){_0x447138['include']=[{'all':!![]}];}_0x447138=_['merge']({},_0x447138,_0xda1d4b[_0x1a06('0xd1')]);return db['ChatInteraction'][_0x1a06('0x79')](_0x447138)[_0x1a06('0x24')](handleEntityNotFound(_0x453d96,null))[_0x1a06('0x24')](respondWithResult(_0x453d96,null))[_0x1a06('0x2e')](handleError(_0x453d96,null));};exports[_0x1a06('0xd2')]=function(_0x3328b0,_0x640c4f){return db[_0x1a06('0xb7')]['create'](_0x3328b0[_0x1a06('0xd3')],{})[_0x1a06('0x24')](respondWithResult(_0x640c4f,0xc9))['catch'](handleError(_0x640c4f,null));};exports[_0x1a06('0x3a')]=function(_0x38838c,_0x556e39){if(_0x38838c['body']['id']){delete _0x38838c[_0x1a06('0xd3')]['id'];}return db[_0x1a06('0xb7')][_0x1a06('0x79')]({'where':{'id':_0x38838c[_0x1a06('0xd4')]['id']}})[_0x1a06('0x24')](handleEntityNotFound(_0x556e39,null))['then'](saveUpdates(_0x38838c[_0x1a06('0xd3')],null))[_0x1a06('0x24')](respondWithResult(_0x556e39,null))[_0x1a06('0x2e')](handleError(_0x556e39,null));};exports['destroy']=function(_0x1bae4d,_0x2900a5){return db[_0x1a06('0xb7')][_0x1a06('0x79')]({'where':{'id':_0x1bae4d[_0x1a06('0xd4')]['id']}})[_0x1a06('0x24')](handleEntityNotFound(_0x2900a5,null))[_0x1a06('0x24')](removeEntity(_0x2900a5,null))[_0x1a06('0x2e')](handleError(_0x2900a5,null));};exports['describe']=function(_0x38c41b,_0xcc6c14){return db['ChatInteraction'][_0x1a06('0xd5')]()[_0x1a06('0x24')](respondWithResult(_0xcc6c14,null))[_0x1a06('0x2e')](handleError(_0xcc6c14,null));};exports[_0x1a06('0xd6')]=function(_0x224eaf,_0x3db1ea){var _0x2138ae=_0x224eaf['params']['id'];var _0x2675e7;var _0x5190aa;var _0x23e335;return db[_0x1a06('0xb7')][_0x1a06('0xd7')]({'where':{'id':_0x2138ae}})[_0x1a06('0x24')](function(_0x5d7f6f){_0x2675e7=_0x5d7f6f;return db[_0x1a06('0xd8')][_0x1a06('0xd7')]({'where':{'id':_0x5d7f6f['ChatWebsiteId']},'attributes':['id',_0x1a06('0xd9'),'vidaooEscalation',_0x1a06('0xda'),_0x1a06('0xdb'),_0x1a06('0xdc')],'raw':!![]});})[_0x1a06('0x24')](function(_0x1c39d2){if(_0x1c39d2&&_0x1c39d2[_0x1a06('0xd9')]&&_0x1c39d2['vidaooEscalation']){_0x5190aa=_0x1c39d2;var _0x45bc85={'interaction':{'id':_0x2138ae},'agent':{'id':_0x224eaf[_0x1a06('0xdd')]['id'],'name':_0x224eaf['user'][_0x1a06('0x3d')],'fullname':_0x224eaf[_0x1a06('0xdd')]['fullname'],'email':_0x224eaf[_0x1a06('0xdd')]['email']},'contact':_0x224eaf[_0x1a06('0xd3')]['contact'],'account':_0x224eaf[_0x1a06('0xd3')]['account']};var _0x31edde={'rejectUnauthorized':![],'method':_0x1a06('0xde'),'url':_0x1a06('0xdf'),'headers':{'X-APIKEY':_0x1c39d2[_0x1a06('0xd9')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x224eaf[_0x1a06('0xdd')][_0x1a06('0xe0')]],'buttons':null,'topic':_0x5190aa[_0x1a06('0xda')],'note':_[_0x1a06('0xe1')](_0x5190aa['vidaooNote'])?null:getMustacheRender(_0x5190aa[_0x1a06('0xdb')],_0x45bc85),'metadata':null},'redirect':_0x1a06('0xe2'),'json':!![]};try{if(!_[_0x1a06('0xe1')](_0x5190aa[_0x1a06('0xdc')])){var _0x206cb0=getMustacheRender(_0x5190aa['vidaooMetadata'],_0x45bc85);var _0x46bcf5=JSON[_0x1a06('0x91')](_0x206cb0);_0x31edde[_0x1a06('0xd3')][_0x1a06('0xe3')]=_0x46bcf5;}}catch(_0x4e499b){throw new db[(_0x1a06('0xa5'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x31edde);}else{throw new db[(_0x1a06('0xa5'))][(_0x1a06('0xe4'))](_0x1a06('0xe5'));}})[_0x1a06('0x24')](function(_0x1b2552){_0x23e335=_0x1b2552;if(_0x23e335['id']){var _0x597675={'body':_0x23e335[_0x1a06('0xe6')],'ChatWebsiteId':_0x5190aa['id'],'ChatInteractionId':_0x2675e7['id'],'direction':'out','UserId':_0x224eaf[_0x1a06('0xdd')]['id']};return db[_0x1a06('0xe7')][_0x1a06('0xd2')](_0x597675,{});}else{throw new db[(_0x1a06('0xa5'))][(_0x1a06('0xe4'))](_0x1a06('0xe8'));}})[_0x1a06('0x24')](function(){return _0x2675e7[_0x1a06('0xe9')]({'vidaooSessionId':_0x23e335['id']});})[_0x1a06('0x24')](respondWithResult(_0x3db1ea,null))[_0x1a06('0x2e')](handleError(_0x3db1ea,null));};exports[_0x1a06('0xea')]=function(_0x10a37b,_0x559843){if(_0x10a37b[_0x1a06('0xd3')]['id']){delete _0x10a37b['body']['id'];}return db[_0x1a06('0xb7')][_0x1a06('0x79')]({'where':{'id':_0x10a37b[_0x1a06('0xd4')]['id']},'include':[{'model':db['CmContact'],'as':_0x1a06('0xeb')}]})[_0x1a06('0x24')](handleEntityNotFound(_0x559843,null))[_0x1a06('0x24')](saveUpdates(_0x10a37b['body'],null))['then'](respondWithResult(_0x559843,null))[_0x1a06('0x2e')](handleError(_0x559843,null));};exports[_0x1a06('0xec')]=function(_0x2e9da2,_0x3c0c5f,_0x4f9978){if(_0x2e9da2[_0x1a06('0xd3')]['id']){delete _0x2e9da2[_0x1a06('0xd3')]['id'];}return db['ChatInteraction'][_0x1a06('0x79')]({'where':{'id':_0x2e9da2['params']['id']}})[_0x1a06('0x24')](function(_0x15f38d){if(!_0x15f38d){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x1a06('0xec'),0x194,_0x1a06('0xed'));_0x3c0c5f[_0x1a06('0x2f')](0x194);}else{if(_0x15f38d[_0x1a06('0x50')]){throw new db[(_0x1a06('0xa5'))][(_0x1a06('0xe4'))]('Interaction\x20already\x20assigned');}}return _0x15f38d;})[_0x1a06('0x24')](function(_0x17329a){if(_0x17329a){return _0x17329a[_0x1a06('0x3a')]({'closed':_0x2e9da2[_0x1a06('0xd3')][_0x1a06('0x51')],'disposition':_0x2e9da2['body'][_0x1a06('0x52')]})['then'](function(_0x4fdbdd){return _0x4fdbdd;});}})[_0x1a06('0x24')](function(_0x354b87){return respondWithRpcPromise('AbandonInteraction',_0x1a06('0xec'),_0x2e9da2[_0x1a06('0xd3')],client9004);})['then'](respondWithResult(_0x3c0c5f,null))[_0x1a06('0x2e')](handleError(_0x3c0c5f,null));};exports[_0x1a06('0xee')]=function(_0x56a527,_0x9449cd,_0x5e16e9){_0x56a527[_0x1a06('0xd3')][_0x1a06('0x3d')]=_0x56a527[_0x1a06('0xef')][_0x1a06('0xf0')];_0x56a527[_0x1a06('0xd3')][_0x1a06('0xf1')]=_0x56a527[_0x1a06('0xef')][_0x1a06('0xf2')];_0x56a527[_0x1a06('0xd3')][_0x1a06('0x56')]=_0x56a527[_0x1a06('0xef')]['mimetype'];return db[_0x1a06('0xf3')]['create'](_0x56a527['body'])[_0x1a06('0x24')](respondWithResult(_0x9449cd,0xc9))[_0x1a06('0x2e')](handleError(_0x9449cd,null));};exports['attachmentDownload']=function(_0x1f400c,_0x2cef96,_0x507d27){return db[_0x1a06('0xb7')][_0x1a06('0xd7')]({'where':{'id':_0x1f400c['params']['id']},'raw':!![]})[_0x1a06('0x24')](handleEntityNotFound(_0x2cef96,null))[_0x1a06('0x24')](function(_0x2b2bf8){if(_0x2b2bf8){if(_0x2b2bf8[_0x1a06('0x51')]){return _0x2cef96[_0x1a06('0x30')](0x193)[_0x1a06('0x32')]({'status':0x193,'message':_0x1a06('0xf4')});}return db[_0x1a06('0xf3')][_0x1a06('0xd7')]({'where':{'id':_0x1f400c[_0x1a06('0x59')][_0x1a06('0xf5')]},'raw':!![]})[_0x1a06('0x24')](handleEntityNotFound(_0x2cef96,null));}})[_0x1a06('0x24')](function(_0x1bf835){if(_0x1bf835){var _0x44f60e=_0x1bf835[_0x1a06('0xf6')]!==null;var _0x3e9d60=path[_0x1a06('0xf7')](config['root'],'server/files/attachments/');if(_0x44f60e){_0x3e9d60=path[_0x1a06('0xf7')](_0x3e9d60,_0x1a06('0xf8'));}var _0x353ba8=path['join'](_0x3e9d60,_0x1bf835[_0x1a06('0xf1')]);return _0x2cef96['download'](_0x353ba8);}})['catch'](handleError(_0x2cef96,null));};exports[_0x1a06('0xf9')]=function(_0x2ff915,_0x260519){var _0x465e6c=null;var _0x3a4498=null;var _0x3f3bd4=null;var _0x2cef06=null;if(_0x2ff915['body']['id']){delete _0x2ff915[_0x1a06('0xd3')]['id'];}if(_0x2ff915[_0x1a06('0xd3')][_0x1a06('0xfa')]){_0x2cef06=path[_0x1a06('0xf7')](config[_0x1a06('0xfb')],_0x1a06('0xfc'),util[_0x1a06('0xfd')]('transcript-%s.txt',Date['now']()));_0x2ff915['body'][_0x1a06('0xfe')]=_0x2cef06;}return db[_0x1a06('0xb7')][_0x1a06('0x79')]({'where':{'id':_0x2ff915[_0x1a06('0xd4')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x1a06('0xff'),'include':[{'model':db['User'],'as':'User'}]}]})['then'](handleEntityNotFound(_0x260519,null))[_0x1a06('0x24')](saveUpdates(_0x2ff915[_0x1a06('0xd3')],null))[_0x1a06('0x24')](function(_0x110d29){if(_0x110d29){_0x465e6c=_0x110d29;return db[_0x1a06('0xd8')][_0x1a06('0x79')]({'where':{'id':_0x465e6c[_0x1a06('0x8e')]}});}})[_0x1a06('0x24')](function(_0x5db4b6){if(_0x5db4b6){_0x3f3bd4=_0x5db4b6;return db['CmContact'][_0x1a06('0x79')]({'where':{'id':_0x465e6c[_0x1a06('0x82')]}});}})[_0x1a06('0x24')](function(_0x382055){if(_0x382055){_0x3a4498=_0x382055;if(_0x2cef06){var _0x17a153=null;for(var _0x237745=0x1;_0x237745<_0x465e6c[_0x1a06('0xff')][_0x1a06('0x78')];++_0x237745){_0x17a153=_0x465e6c[_0x1a06('0xff')][_0x237745];var _0x44e43a=_0x17a153[_0x1a06('0x50')]?util['format'](_0x1a06('0x100'),_0x3f3bd4[_0x1a06('0x101')],_0x17a153[_0x1a06('0x50')]):_0x1a06('0x102');var _0x1323b3=_0x2ff915[_0x1a06('0xd3')][_0x1a06('0x103')]||util[_0x1a06('0xfd')](_0x1a06('0x100'),_0x1a06('0x104'),_0x17a153[_0x1a06('0x82')]);switch(_0x3f3bd4[_0x1a06('0x105')]){case _0x1a06('0x106'):_0x44e43a=_0x17a153[_0x1a06('0x50')]?util[_0x1a06('0xfd')](_0x1a06('0x100'),_0x3f3bd4[_0x1a06('0x101')],_0x17a153[_0x1a06('0x50')]):_0x1a06('0x102');break;case _0x1a06('0x107'):_0x44e43a=_0x17a153[_0x1a06('0x50')]?_0x17a153['User']['alias']||_0x17a153[_0x1a06('0x88')][_0x1a06('0x108')]:_0x1a06('0x102');break;case _0x1a06('0x109'):_0x44e43a=_0x17a153[_0x1a06('0x50')]?_0x17a153['User'][_0x1a06('0x108')]:_0x1a06('0x102');break;default:_0x44e43a=_0x17a153[_0x1a06('0x50')]?util[_0x1a06('0xfd')](_0x1a06('0x100'),_0x3f3bd4[_0x1a06('0x101')],_0x17a153[_0x1a06('0x50')]):_0x1a06('0x102');}var _0x43d52c=util[_0x1a06('0xfd')](_0x1a06('0x10a'),moment(_0x17a153[_0x1a06('0x90')])[_0x1a06('0xfd')](_0x1a06('0x10b')),_0x17a153[_0x1a06('0x10c')]==='in'?_0x1323b3:_0x44e43a,_0x17a153['body']);if(!_0x17a153[_0x1a06('0x10d')]){fs['appendFileSync'](_0x2cef06,_0x43d52c);}}return db[_0x1a06('0x10e')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x1a06('0x10f')],'as':_0x1a06('0x110'),'raw':!![]}]});}}})[_0x1a06('0x24')](function(_0x1404b3){if(_0x1404b3&&_0x1404b3[_0x1a06('0x110')]&&_0x2ff915[_0x1a06('0xd3')]){var _0x2990f8={'tls':{'rejectUnauthorized':![]}};if(_0x1404b3[_0x1a06('0x110')][_0x1a06('0x111')]){_0x2990f8[_0x1a06('0x111')]=_0x1404b3[_0x1a06('0x110')][_0x1a06('0x111')];}else{_0x2990f8['host']=_0x1404b3[_0x1a06('0x110')][_0x1a06('0x112')];_0x2990f8[_0x1a06('0x113')]=_0x1404b3[_0x1a06('0x110')][_0x1a06('0x113')];_0x2990f8[_0x1a06('0x114')]=_0x1404b3[_0x1a06('0x110')][_0x1a06('0x114')];}if(_0x1404b3[_0x1a06('0x110')][_0x1a06('0x115')]){_0x2990f8[_0x1a06('0x116')]={'user':_0x1404b3[_0x1a06('0x110')]['user'],'pass':_0x1404b3[_0x1a06('0x110')][_0x1a06('0x117')]};}return respondWithRpcPromise('SendMail',_0x1a06('0x118'),{'account':_0x2990f8,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x1404b3[_0x1a06('0x3d')],_0x1404b3[_0x1a06('0xe0')]||_0x1404b3[_0x1a06('0x110')][_0x1a06('0xdd')]),'to':_0x2ff915[_0x1a06('0xd3')]['mailTranscript'],'subject':_0x1a06('0x119'),'text':util[_0x1a06('0xfd')](_0x1a06('0x11a'),_0x2ff915['body'][_0x1a06('0xfa')]),'attachments':[{'path':_0x2cef06}]}})[_0x1a06('0x24')](function(){return _0x465e6c;})[_0x1a06('0x2e')](function(_0x2a4a73){console[_0x1a06('0x2a')](_0x2a4a73);});}else{return _0x465e6c;}})[_0x1a06('0x24')](respondWithStatusCode(_0x260519,0xc8))['catch'](handleError(_0x260519,null));};exports[_0x1a06('0x11b')]=function(_0x324445,_0x48070c,_0x1717ad){return db[_0x1a06('0xe7')]['find']({'where':{'id':_0x324445['params']['id']}})[_0x1a06('0x24')](handleEntityNotFound(_0x48070c,null))[_0x1a06('0x24')](function(_0x3a44d2){if(_0x3a44d2){return _0x3a44d2[_0x1a06('0x11b')](_0x324445[_0x1a06('0xd3')][_0x1a06('0x11c')],_[_0x1a06('0x11d')](_0x324445['body'],[_0x1a06('0x11c'),'id'])||{});}})['then'](respondWithResult(_0x48070c,null))['catch'](handleError(_0x48070c,null));};exports[_0x1a06('0x11e')]=function(_0x42c638,_0x2feeb9,_0x443f0e){var _0x125773={'raw':![],'where':{}};var _0x25b86f={};var _0x26ef9e={'count':0x0,'rows':[]};return db[_0x1a06('0xb7')][_0x1a06('0xd7')]({'where':{'id':_0x42c638[_0x1a06('0xd4')]['id']}})[_0x1a06('0x24')](handleEntityNotFound(_0x2feeb9,null))['then'](function(_0x2bc392){if(_0x2bc392){_0x25b86f[_0x1a06('0x58')]=_[_0x1a06('0x5a')](db[_0x1a06('0xe7')][_0x1a06('0x54')]);_0x25b86f['query']=_['keys'](_0x42c638[_0x1a06('0x59')]);_0x25b86f[_0x1a06('0x5b')]=_[_0x1a06('0x5d')](_0x25b86f[_0x1a06('0x58')],_0x25b86f[_0x1a06('0x59')]);_0x125773[_0x1a06('0x5c')]=_[_0x1a06('0x5d')](_0x25b86f[_0x1a06('0x58')],qs[_0x1a06('0x5e')](_0x42c638[_0x1a06('0x59')][_0x1a06('0x5e')]));_0x125773[_0x1a06('0x5c')]=_0x125773[_0x1a06('0x5c')][_0x1a06('0x78')]?_0x125773[_0x1a06('0x5c')]:_0x25b86f['model'];if(!_0x42c638[_0x1a06('0x59')][_0x1a06('0x5f')](_0x1a06('0x60'))){_0x125773[_0x1a06('0x34')]=qs[_0x1a06('0x34')](_0x42c638[_0x1a06('0x59')][_0x1a06('0x34')]);_0x125773[_0x1a06('0x33')]=qs[_0x1a06('0x33')](_0x42c638[_0x1a06('0x59')][_0x1a06('0x33')]);}_0x125773[_0x1a06('0x61')]=qs[_0x1a06('0x62')](_0x42c638[_0x1a06('0x59')][_0x1a06('0x62')]);_0x125773[_0x1a06('0x63')]=qs['filters'](_[_0x1a06('0x11f')](_0x42c638[_0x1a06('0x59')],_0x25b86f[_0x1a06('0x5b')]));_0x125773[_0x1a06('0x63')][_0x1a06('0xcc')]=_0x2bc392['id'];if(_0x42c638[_0x1a06('0x59')]['filter']){_0x125773['where']=_[_0x1a06('0xb6')](_0x125773[_0x1a06('0x63')],{'$or':_['map'](_0x125773[_0x1a06('0x5c')],function(_0x5b28e4){var _0x493b6e={};_0x493b6e[_0x5b28e4]={'$like':'%'+_0x42c638[_0x1a06('0x59')][_0x1a06('0x9d')]+'%'};return _0x493b6e;})});}if(_0x42c638[_0x1a06('0x59')][_0x1a06('0x92')]){var _0x1d4031=_0x42c638[_0x1a06('0x59')][_0x1a06('0x92')][_0x1a06('0x120')](',');var _0x471868={};_0x471868[_0x1d4031[0x0]]={'$gte':moment(_0x1d4031[0x1])[_0x1a06('0xfd')](_0x1a06('0x121'))};_0x125773[_0x1a06('0x63')]=_['merge'](_0x125773[_0x1a06('0x63')],_0x471868);}_0x125773=_[_0x1a06('0xb6')]({},_0x125773,_0x42c638[_0x1a06('0xd1')]);return db[_0x1a06('0xe7')][_0x1a06('0xb4')]({'where':_0x125773[_0x1a06('0x63')]})[_0x1a06('0x24')](function(_0x396c0f){_0x26ef9e[_0x1a06('0xb4')]=_0x396c0f;if(_0x42c638[_0x1a06('0x59')][_0x1a06('0xd0')]){_0x125773[_0x1a06('0x122')]=[{'all':!![]}];}return db[_0x1a06('0xe7')][_0x1a06('0x123')](_0x125773);})[_0x1a06('0x24')](function(_0x17d0c1){_0x26ef9e[_0x1a06('0xce')]=_0x17d0c1;return _0x26ef9e;});}})[_0x1a06('0x24')](respondWithFilteredResult(_0x2feeb9,_0x125773))[_0x1a06('0x2e')](handleError(_0x2feeb9,null));};exports[_0x1a06('0x124')]=function(_0x37dfc5,_0x27671d,_0x3750cb){var _0x23ba17={'where':{}},_0x491977={},_0x409a1e={'count':0x0,'rows':[]};return db[_0x1a06('0xb7')]['findOne']({'where':{'id':_0x37dfc5[_0x1a06('0xd4')]['id']}})['then'](handleEntityNotFound(_0x27671d,null))['then'](function(_0x2e7200){if(_0x2e7200){_0x491977[_0x1a06('0x58')]=_[_0x1a06('0x5a')](db[_0x1a06('0xe7')][_0x1a06('0x54')]);_0x491977[_0x1a06('0x59')]=_[_0x1a06('0x5a')](_0x37dfc5[_0x1a06('0x59')]);_0x491977['filters']=_[_0x1a06('0x5d')](_0x491977[_0x1a06('0x58')],_0x491977['query']);_0x23ba17[_0x1a06('0x5c')]=_[_0x1a06('0x5d')](_0x491977['model'],qs[_0x1a06('0x5e')](_0x37dfc5[_0x1a06('0x59')][_0x1a06('0x5e')]));_0x23ba17[_0x1a06('0x5c')]=_0x23ba17[_0x1a06('0x5c')][_0x1a06('0x78')]?_0x23ba17['attributes']:_0x491977[_0x1a06('0x58')];if(!_0x37dfc5['query']['hasOwnProperty']('nolimit')){_0x23ba17[_0x1a06('0x34')]=qs[_0x1a06('0x34')](_0x37dfc5[_0x1a06('0x59')][_0x1a06('0x34')]);_0x23ba17[_0x1a06('0x33')]=qs['offset'](_0x37dfc5[_0x1a06('0x59')][_0x1a06('0x33')]);}_0x23ba17['order']=qs['sort'](_0x37dfc5[_0x1a06('0x59')][_0x1a06('0x62')]);_0x23ba17[_0x1a06('0x63')]=qs[_0x1a06('0x5b')](_[_0x1a06('0x11f')](_0x37dfc5[_0x1a06('0x59')],_0x491977[_0x1a06('0x5b')]));_0x23ba17[_0x1a06('0x63')][_0x1a06('0xcc')]=_0x2e7200['id'];if(_0x37dfc5['query'][_0x1a06('0x9d')]){_0x23ba17[_0x1a06('0x63')]=_['merge'](_0x23ba17[_0x1a06('0x63')],{'$or':_['map'](_0x23ba17[_0x1a06('0x5c')],function(_0x17ad33){var _0x31e307={};_0x31e307[_0x17ad33]={'$like':'%'+_0x37dfc5[_0x1a06('0x59')][_0x1a06('0x9d')]+'%'};return _0x31e307;})});}_0x23ba17[_0x1a06('0x63')]['secret']=![];if(_0x37dfc5[_0x1a06('0x59')]['id']){_0x23ba17[_0x1a06('0x63')]['id']={'$gt':_0x37dfc5[_0x1a06('0x59')]['id']};}_0x23ba17=_[_0x1a06('0xb6')]({},_0x23ba17,_0x37dfc5[_0x1a06('0xd1')]);return db[_0x1a06('0xe7')]['count']({'where':_0x23ba17[_0x1a06('0x63')]})[_0x1a06('0x24')](function(_0xd74098){_0x409a1e[_0x1a06('0xb4')]=_0xd74098;_0x23ba17['include']=[];if(_0x37dfc5[_0x1a06('0x59')][_0x1a06('0x125')]){_0x23ba17[_0x1a06('0x122')][_0x1a06('0x49')]({'model':db[_0x1a06('0x88')],'as':'User','attributes':['id',_0x1a06('0x108'),_0x1a06('0x126')]});}if(_0x37dfc5[_0x1a06('0x59')][_0x1a06('0xd0')]){_0x23ba17[_0x1a06('0x122')]=[{'all':!![]}];}return db[_0x1a06('0xe7')][_0x1a06('0x123')](_0x23ba17);})[_0x1a06('0x24')](function(_0x31ea63){_0x409a1e[_0x1a06('0xce')]=_0x31ea63;return _0x409a1e;});}})[_0x1a06('0x24')](respondWithFilteredResult(_0x27671d,_0x23ba17))[_0x1a06('0x2e')](handleError(_0x27671d,null));};exports[_0x1a06('0x127')]=function(_0x3b7249,_0x45bf66,_0xa4f688){return db[_0x1a06('0xb7')][_0x1a06('0x79')]({'where':{'id':_0x3b7249[_0x1a06('0xd4')]['id']}})['then'](handleEntityNotFound(_0x45bf66,null))['then'](function(_0x4c5a19){if(_0x4c5a19){return _0x4c5a19['setTags'](_0x3b7249['body'][_0x1a06('0x11c')],_['omit'](_0x3b7249[_0x1a06('0xd3')],['ids','id'])||{})[_0x1a06('0x128')](function(){return db[_0x1a06('0x85')]['findAll']({'attributes':['id',_0x1a06('0x3d'),_0x1a06('0x66')],'where':{'id':_0x3b7249[_0x1a06('0xd3')][_0x1a06('0x11c')]}});})[_0x1a06('0x24')](function(_0x36c557){socket['emit']('chatInteractionTags:save',{'id':Number(_0x3b7249[_0x1a06('0xd4')]['id']),'tags':_0x36c557||[]});return{'id':Number(_0x3b7249['params']['id']),'tags':_0x36c557||[]};});}})[_0x1a06('0x24')](respondWithResult(_0x45bf66,null))[_0x1a06('0x2e')](handleError(_0x45bf66,null));};exports[_0x1a06('0x129')]=function(_0x55b37c,_0x1a027e,_0x57517c){return db[_0x1a06('0xb7')][_0x1a06('0x79')]({'where':{'id':_0x55b37c[_0x1a06('0xd4')]['id']}})[_0x1a06('0x24')](handleEntityNotFound(_0x1a027e,null))[_0x1a06('0x24')](function(_0x2c7078){if(_0x2c7078){return _0x2c7078[_0x1a06('0x129')](_0x55b37c[_0x1a06('0x59')][_0x1a06('0x11c')]);}})[_0x1a06('0x24')](respondWithStatusCode(_0x1a027e,null))[_0x1a06('0x2e')](handleError(_0x1a027e,null));};exports[_0x1a06('0x12a')]=function(_0x1f59de,_0x129413){var _0x5636b0=moment()[_0x1a06('0x12b')]()['toString']();var _0xfa4803=path[_0x1a06('0xf7')](config[_0x1a06('0xfb')],_0x1a06('0x12c'),_0x1a06('0x12d'),'tmp');var _0x3e656e=path[_0x1a06('0xf7')](config[_0x1a06('0xfb')],'server',_0x1a06('0x12d'),'attachments');var _0x456d85=path[_0x1a06('0xf7')](_0xfa4803,_0x5636b0);var _0x594fc4=util[_0x1a06('0xfd')]('transcript-%d-%s.zip',_0x1f59de[_0x1a06('0xd4')]['id'],_0x5636b0);var _0x37209e=path[_0x1a06('0xf7')](_0xfa4803,_0x594fc4);var _0xc7de2d=[];_0xc7de2d[_0x1a06('0x49')]({'model':db[_0x1a06('0x88')],'as':_0x1a06('0x88'),'attributes':['id',_0x1a06('0x108')],'raw':!![]});_0xc7de2d[_0x1a06('0x49')]({'model':db[_0x1a06('0x12e')],'as':'Contact','attributes':['id','firstName',_0x1a06('0x12f')],'raw':!![]});if(_0x1f59de[_0x1a06('0x59')]['attachments']){_0xc7de2d[_0x1a06('0x49')]({'model':db[_0x1a06('0xf3')],'as':_0x1a06('0xf3'),'raw':!![]});}var _0x294bcd=[{'model':db['ChatMessage'],'as':_0x1a06('0xff'),'attributes':['id',_0x1a06('0xd3'),_0x1a06('0x90'),_0x1a06('0x10c'),_0x1a06('0x10d'),_0x1a06('0x98')],'include':_0xc7de2d}];_0x294bcd[_0x1a06('0x49')]({'model':db['ChatWebsite'],'as':'Account','attributes':['id',_0x1a06('0x3d')]});_0x294bcd[_0x1a06('0x49')]({'model':db[_0x1a06('0x88')],'as':_0x1a06('0x130'),'attributes':['id',_0x1a06('0x108')]});return db[_0x1a06('0xb7')]['find']({'where':{'id':_0x1f59de[_0x1a06('0xd4')]['id']},'include':_0x294bcd})[_0x1a06('0x24')](handleEntityNotFound(_0x129413,null))[_0x1a06('0x24')](function(_0x2540ec){if(_0x2540ec){var _0x264e26=_0x2540ec['get']({'plain':!![]});fs[_0x1a06('0x131')](_0x456d85);var _0x4f1196={'channel':_0x1a06('0x132'),'account':_0x264e26[_0x1a06('0x133')][_0x1a06('0x3d')],'agent':_0x264e26[_0x1a06('0x130')]?_0x264e26[_0x1a06('0x130')][_0x1a06('0x108')]:_0x1a06('0x134'),'createdAt':moment(_0x264e26[_0x1a06('0x90')])['format'](_0x1a06('0x121'))[_0x1a06('0xb3')](),'closedAt':_0x264e26['closed']?moment(_0x264e26['closedAt'])[_0x1a06('0xfd')](_0x1a06('0x121'))[_0x1a06('0xb3')]():'','disposition':_0x264e26['disposition'],'chatInfo':{'browser':_0x264e26['browserName'],'os':_0x264e26[_0x1a06('0x135')],'referer':_0x264e26[_0x1a06('0x136')],'customerIp':_0x264e26[_0x1a06('0x137')],'customerPort':_0x264e26['customerPort']?_0x264e26['customerPort']:_0x1a06('0x134')},'messages':_(_0x264e26[_0x1a06('0xff')])[_0x1a06('0x138')]()['filter']({'secret':![]})[_0x1a06('0x45')](function(_0xdf67){if(_0xdf67[_0x1a06('0xf3')]){var _0x57b20f=path[_0x1a06('0xf7')](_0x3e656e,_0xdf67[_0x1a06('0xf3')][_0x1a06('0xf1')]);if(fs[_0x1a06('0x139')](_0x57b20f)){fs[_0x1a06('0x13a')](_0x57b20f)[_0x1a06('0x13b')](fs[_0x1a06('0x13c')](path[_0x1a06('0xf7')](_0x456d85,_0xdf67['Attachment'][_0x1a06('0xf1')])));}}return{'date':moment(_0xdf67[_0x1a06('0x90')])[_0x1a06('0xfd')](_0x1a06('0x121'))['toString'](),'sender':_0xdf67[_0x1a06('0x10c')]==='out'?_0xdf67[_0x1a06('0x88')]?_0xdf67[_0x1a06('0x88')][_0x1a06('0x108')]:_0x1a06('0x102'):_0xdf67['Contact'][_0x1a06('0x13d')]+(_0xdf67[_0x1a06('0xeb')][_0x1a06('0x12f')]?'\x20'+_0xdf67[_0x1a06('0xeb')]['lastName']:''),'body':_0xdf67['Attachment']?_0xdf67[_0x1a06('0xf3')][_0x1a06('0xf1')]:_0xdf67[_0x1a06('0xd3')],'direction':_0xdf67['direction']===_0x1a06('0x13e')?'A':'C','secret':_0xdf67[_0x1a06('0x10d')],'read':_0xdf67['read'],'attachment':_0xdf67[_0x1a06('0xf3')]};})[_0x1a06('0x7b')]()};return ejs[_0x1a06('0x13f')](path['join'](config['root'],_0x1a06('0x12c'),'views',_0x1a06('0x140')),{'interaction':_0x4f1196})[_0x1a06('0x24')](function(_0x1b6951){var _0x539c44=path[_0x1a06('0xf7')](_0x456d85,_0x1a06('0x141')+_0x264e26['id']+'-'+_0x5636b0+'.pdf');var _0x3e9a72={'path':_0x539c44,'channel':_0x1a06('0x132'),'interactionId':_0x264e26['id']};return pdf[_0x1a06('0x142')](_0x1b6951,_0x3e9a72);})[_0x1a06('0x24')](function(){return new BPromise(function(_0x1789fd,_0x116cd9){zipdir(_0x456d85,{'saveTo':_0x37209e},function(_0x590233,_0x5678b2){if(_0x590233)return _0x116cd9(_0x590233);return _0x1789fd(_0x5678b2);});})[_0x1a06('0x24')](function(){return new BPromise(function(_0x66edf1,_0x35e645){rimraf(_0x456d85,function(_0x16a5da){if(_0x16a5da)_0x35e645(_0x16a5da);return _0x66edf1();});});})[_0x1a06('0x24')](function(){return _0x129413[_0x1a06('0x12a')](_0x37209e,_0x594fc4,function(_0x4d734a){if(_0x4d734a){console[_0x1a06('0x143')]('err',_0x4d734a);}else{fs[_0x1a06('0x144')](_0x37209e);}});});});}else{return _0x129413[_0x1a06('0x2f')](0xc8);}})[_0x1a06('0x2e')](handleError(_0x129413,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 170e0fd..2411a64 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 _0x9fb4=['update','remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','ChatMessage','setMaxListeners','save'];(function(_0x4bf591,_0x48b450){var _0x18f0df=function(_0x4754ea){while(--_0x4754ea){_0x4bf591['push'](_0x4bf591['shift']());}};_0x18f0df(++_0x48b450);}(_0x9fb4,0x113));var _0x49fb=function(_0xb1cf84,_0x813740){_0xb1cf84=_0xb1cf84-0x0;var _0x4bad2e=_0x9fb4[_0xb1cf84];return _0x4bad2e;};'use strict';var EventEmitter=require(_0x49fb('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x49fb('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0x49fb('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x49fb('0x3')](0x0);var events={'afterCreate':_0x49fb('0x4'),'afterUpdate':_0x49fb('0x5'),'afterDestroy':_0x49fb('0x6')};function emitEvent(_0x2f1f32){return function(_0x34baf1,_0x592b4a,_0x3d25d9){_0x34baf1[_0x49fb('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x44e802){_0x34baf1[_0x49fb('0x8')](_0x49fb('0x9'),_0x44e802[_0x49fb('0xa')](function(_0x1f3834){return{'id':_0x1f3834['id']};}));return ChatMessage[_0x49fb('0xb')]({'where':{'ChatInteractionId':_0x34baf1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x49fb('0xc')](function(_0x10e3b2){_0x34baf1[_0x49fb('0x8')](_0x49fb('0xd'),_0x10e3b2[_0x49fb('0xe')]);ChatInteractionEvents[_0x49fb('0xf')](_0x2f1f32+':'+_0x34baf1['id'],_0x34baf1);ChatInteractionEvents[_0x49fb('0xf')](_0x2f1f32,_0x34baf1);_0x3d25d9(null);})[_0x49fb('0x10')](_0x3d25d9(null));};}for(var e in events){if(events[_0x49fb('0x11')](e)){var event=events[e];ChatInteraction[_0x49fb('0x12')](e,emitEvent(event));}}module[_0x49fb('0x13')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xde47=['unreadMessages','emit','catch','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','remove','getUsers','Users','setDataValue'];(function(_0x2e8400,_0x1e3452){var _0x5f0a16=function(_0x5b3894){while(--_0x5b3894){_0x2e8400['push'](_0x2e8400['shift']());}};_0x5f0a16(++_0x1e3452);}(_0xde47,0x1a9));var _0x7de4=function(_0xdeac17,_0x19ad66){_0xdeac17=_0xdeac17-0x0;var _0x33aabd=_0xde47[_0xdeac17];return _0x33aabd;};'use strict';var EventEmitter=require(_0x7de4('0x0'));var ChatInteraction=require(_0x7de4('0x1'))['db'][_0x7de4('0x2')];var ChatMessage=require(_0x7de4('0x1'))['db'][_0x7de4('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x7de4('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7de4('0x5')};function emitEvent(_0x2e074f){return function(_0x1d945e,_0x2d2288,_0x20c847){_0x1d945e[_0x7de4('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x445a02){_0x1d945e['setDataValue'](_0x7de4('0x7'),_0x445a02['map'](function(_0x4433ca){return{'id':_0x4433ca['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x1d945e['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x40f467){_0x1d945e[_0x7de4('0x8')](_0x7de4('0x9'),_0x40f467['length']);ChatInteractionEvents[_0x7de4('0xa')](_0x2e074f+':'+_0x1d945e['id'],_0x1d945e);ChatInteractionEvents['emit'](_0x2e074f,_0x1d945e);_0x20c847(null);})[_0x7de4('0xb')](_0x20c847(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x7de4('0xc')](e,emitEvent(event));}}module[_0x7de4('0xd')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index c45f4c2..ecf9767 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 _0x39db=['util','../../config/logger','moment','bluebird','request-promise','./chatInteraction.attributes','exports','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash'];(function(_0xaa62bc,_0xae360e){var _0x225a7a=function(_0x1364c8){while(--_0x1364c8){_0xaa62bc['push'](_0xaa62bc['shift']());}};_0x225a7a(++_0xae360e);}(_0x39db,0x141));var _0xb39d=function(_0x47e7dd,_0x51b041){_0x47e7dd=_0x47e7dd-0x0;var _0x38501f=_0x39db[_0x47e7dd];return _0x38501f;};'use strict';var _=require(_0xb39d('0x0'));var util=require(_0xb39d('0x1'));var logger=require(_0xb39d('0x2'))('api');var moment=require(_0xb39d('0x3'));var BPromise=require(_0xb39d('0x4'));var rp=require(_0xb39d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb39d('0x6'));module[_0xb39d('0x7')]=function(_0x15ea03,_0xd7a4a4){return _0x15ea03['define']('ChatInteraction',attributes,{'tableName':_0xb39d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xf93573,_0x3e9c25,_0x168080){if(_0xf93573[_0xb39d('0x9')](_0xb39d('0xa'))){_0xf93573['closedAt']=moment()[_0xb39d('0xb')](_0xb39d('0xc'));}_0x168080(null,_0xf93573);}},'charset':'utf8mb4','collate':_0xb39d('0xd')});};
\ No newline at end of file
+var _0xfb57=['bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closed','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x1529f2,_0x45ecfa){var _0x4189e8=function(_0x5879ce){while(--_0x5879ce){_0x1529f2['push'](_0x1529f2['shift']());}};_0x4189e8(++_0x45ecfa);}(_0xfb57,0x13f));var _0x7fb5=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xfb57[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0x7fb5('0x0'));var util=require(_0x7fb5('0x1'));var logger=require(_0x7fb5('0x2'))(_0x7fb5('0x3'));var moment=require(_0x7fb5('0x4'));var BPromise=require(_0x7fb5('0x5'));var rp=require(_0x7fb5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7fb5('0x7'));var config=require(_0x7fb5('0x8'));var attributes=require(_0x7fb5('0x9'));module[_0x7fb5('0xa')]=function(_0x4c494b,_0x4fab4f){return _0x4c494b[_0x7fb5('0xb')](_0x7fb5('0xc'),attributes,{'tableName':_0x7fb5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x36a868,_0x59efbe,_0x350928){if(_0x36a868['changed'](_0x7fb5('0xe'))){_0x36a868['closedAt']=moment()[_0x7fb5('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x350928(null,_0x36a868);}},'charset':_0x7fb5('0x10'),'collate':_0x7fb5('0x11')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index ffcf0ee..6efee49 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 _0x558a=['rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','limit','AddTagsToChatInteraction','find','where','AddTags','util','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x5a9199,_0x96b786){var _0x2c5cef=function(_0x546133){while(--_0x546133){_0x5a9199['push'](_0x5a9199['shift']());}};_0x2c5cef(++_0x96b786);}(_0x558a,0xde));var _0xa558=function(_0x59bad4,_0x504318){_0x59bad4=_0x59bad4-0x0;var _0x2b4fde=_0x558a[_0x59bad4];return _0x2b4fde;};'use strict';var _=require('lodash');var util=require(_0xa558('0x0'));var moment=require(_0xa558('0x1'));var BPromise=require('bluebird');var rs=require(_0xa558('0x2'));var fs=require('fs');var Redis=require(_0xa558('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa558('0x4'));var logger=require(_0xa558('0x5'))(_0xa558('0x6'));var config=require(_0xa558('0x7'));var jayson=require(_0xa558('0x8'));var client=jayson[_0xa558('0x9')]['http']({'port':0x232a});config['redis']=_[_0xa558('0xa')](config[_0xa558('0xb')],{'host':_0xa558('0xc'),'port':0x18eb});var socket=require(_0xa558('0xd'))(new Redis(config[_0xa558('0xb')]));require('./chatInteraction.socket')[_0xa558('0xe')](socket);function respondWithRpcPromise(_0x2c9345,_0x5a5c3b,_0x34529c){return new BPromise(function(_0x133657,_0x1d1eb3){return client['request'](_0x2c9345,_0x34529c)[_0xa558('0xf')](function(_0x5546db){logger['info'](_0xa558('0x10'),_0x5a5c3b,_0xa558('0x11'));logger[_0xa558('0x12')](_0xa558('0x13'),_0x5a5c3b,_0xa558('0x11'),JSON[_0xa558('0x14')](_0x5546db));if(_0x5546db[_0xa558('0x15')]){if(_0x5546db[_0xa558('0x15')][_0xa558('0x16')]===0x1f4){logger['error'](_0xa558('0x10'),_0x5a5c3b,_0x5546db['error']['message']);return _0x1d1eb3(_0x5546db[_0xa558('0x15')][_0xa558('0x17')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x5a5c3b,_0x5546db['error']['message']);return _0x133657(_0x5546db[_0xa558('0x15')][_0xa558('0x17')]);}else{logger[_0xa558('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x5a5c3b,'request\x20sent');_0x133657(_0x5546db[_0xa558('0x19')][_0xa558('0x17')]);}})[_0xa558('0x1a')](function(_0x17584c){logger[_0xa558('0x15')](_0xa558('0x10'),_0x5a5c3b,_0x17584c);_0x1d1eb3(_0x17584c);});});}exports[_0xa558('0x1b')]=function(_0x3c7ab5){var _0x1e696c=this;return new Promise(function(_0x3ba962,_0x507b96){return db[_0xa558('0x1c')][_0xa558('0x1d')](_0x3c7ab5[_0xa558('0x1e')],{'raw':_0x3c7ab5['options']?_0x3c7ab5[_0xa558('0x1f')][_0xa558('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c7ab5[_0xa558('0x1f')]?_0x3c7ab5['options']['where']||null:null,'attributes':_0x3c7ab5[_0xa558('0x1f')]?_0x3c7ab5[_0xa558('0x1f')]['attributes']||null:null,'limit':_0x3c7ab5[_0xa558('0x1f')]?_0x3c7ab5['options'][_0xa558('0x21')]||null:null})[_0xa558('0xf')](function(_0x5bdb51){logger[_0xa558('0x18')](_0xa558('0x1b'),_0x3c7ab5);logger['debug']('UpdateChatInteraction',_0x3c7ab5,JSON[_0xa558('0x14')](_0x5bdb51));_0x3ba962(_0x5bdb51);})['catch'](function(_0x34628f){logger['error'](_0xa558('0x1b'),_0x34628f[_0xa558('0x17')],_0x3c7ab5);_0x507b96(_0x1e696c[_0xa558('0x15')](0x1f4,_0x34628f[_0xa558('0x17')]));});});};exports[_0xa558('0x22')]=function(_0x35e51b){return new Promise(function(_0x162e2e,_0x3515ab){return db[_0xa558('0x1c')][_0xa558('0x23')]({'where':_0x35e51b['options']?_0x35e51b[_0xa558('0x1f')][_0xa558('0x24')]||null:null})[_0xa558('0xf')](function(_0x43851f){if(_0x43851f){return _0x43851f['addTags'](_0x35e51b[_0xa558('0x1e')]['ids'],_['omit'](_0x35e51b[_0xa558('0x1e')],['ids','id'])||{});}})['spread'](function(_0x123051){logger[_0xa558('0x18')]('AddTags',_0x35e51b);logger[_0xa558('0x12')](_0xa558('0x25'),_0x35e51b,JSON[_0xa558('0x14')](_0x123051));_0x162e2e(_0x123051);})[_0xa558('0x1a')](function(_0x2aa431){logger[_0xa558('0x15')](_0xa558('0x25'),_0x2aa431[_0xa558('0x17')],_0x35e51b);_0x3515ab(_this['error'](0x1f4,_0x2aa431[_0xa558('0x17')]));});});};
\ No newline at end of file
+var _0x0745=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ChatInteraction','update','body','options','raw','attributes','limit','UpdateChatInteraction','debug','find','where','addTags','ids','omit','AddTags','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0745,0x12c));var _0x5074=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x0745[_0x1cc8fe];return _0x230054;};'use strict';var _=require('lodash');var util=require(_0x5074('0x0'));var moment=require(_0x5074('0x1'));var BPromise=require(_0x5074('0x2'));var rs=require(_0x5074('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5074('0x4'))['db'];var utils=require(_0x5074('0x5'));var logger=require(_0x5074('0x6'))(_0x5074('0x7'));var config=require(_0x5074('0x8'));var jayson=require(_0x5074('0x9'));var client=jayson[_0x5074('0xa')][_0x5074('0xb')]({'port':0x232a});config[_0x5074('0xc')]=_['defaults'](config[_0x5074('0xc')],{'host':_0x5074('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5074('0xc')]));require(_0x5074('0xe'))[_0x5074('0xf')](socket);function respondWithRpcPromise(_0x1555df,_0x27666a,_0x45e87a){return new BPromise(function(_0x45ed45,_0x5cc47b){return client[_0x5074('0x10')](_0x1555df,_0x45e87a)[_0x5074('0x11')](function(_0x1c03be){logger[_0x5074('0x12')](_0x5074('0x13'),_0x27666a,'request\x20sent');logger['debug'](_0x5074('0x14'),_0x27666a,_0x5074('0x15'),JSON[_0x5074('0x16')](_0x1c03be));if(_0x1c03be[_0x5074('0x17')]){if(_0x1c03be[_0x5074('0x17')][_0x5074('0x18')]===0x1f4){logger[_0x5074('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x27666a,_0x1c03be[_0x5074('0x17')][_0x5074('0x19')]);return _0x5cc47b(_0x1c03be['error'][_0x5074('0x19')]);}logger[_0x5074('0x17')](_0x5074('0x13'),_0x27666a,_0x1c03be[_0x5074('0x17')][_0x5074('0x19')]);return _0x45ed45(_0x1c03be[_0x5074('0x17')][_0x5074('0x19')]);}else{logger[_0x5074('0x12')](_0x5074('0x13'),_0x27666a,'request\x20sent');_0x45ed45(_0x1c03be[_0x5074('0x1a')]['message']);}})[_0x5074('0x1b')](function(_0x50617f){logger[_0x5074('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x27666a,_0x50617f);_0x5cc47b(_0x50617f);});});}exports['UpdateChatInteraction']=function(_0x22a9e5){var _0x3c57a2=this;return new Promise(function(_0x8976ae,_0x462069){return db[_0x5074('0x1c')][_0x5074('0x1d')](_0x22a9e5[_0x5074('0x1e')],{'raw':_0x22a9e5[_0x5074('0x1f')]?_0x22a9e5[_0x5074('0x1f')][_0x5074('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22a9e5[_0x5074('0x1f')]?_0x22a9e5[_0x5074('0x1f')]['where']||null:null,'attributes':_0x22a9e5[_0x5074('0x1f')]?_0x22a9e5['options'][_0x5074('0x21')]||null:null,'limit':_0x22a9e5['options']?_0x22a9e5['options'][_0x5074('0x22')]||null:null})[_0x5074('0x11')](function(_0x1c51c8){logger[_0x5074('0x12')](_0x5074('0x23'),_0x22a9e5);logger[_0x5074('0x24')](_0x5074('0x23'),_0x22a9e5,JSON[_0x5074('0x16')](_0x1c51c8));_0x8976ae(_0x1c51c8);})[_0x5074('0x1b')](function(_0x4267b5){logger[_0x5074('0x17')]('UpdateChatInteraction',_0x4267b5['message'],_0x22a9e5);_0x462069(_0x3c57a2[_0x5074('0x17')](0x1f4,_0x4267b5[_0x5074('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x55e470){return new Promise(function(_0x1ad5e8,_0xac7548){return db[_0x5074('0x1c')][_0x5074('0x25')]({'where':_0x55e470[_0x5074('0x1f')]?_0x55e470['options'][_0x5074('0x26')]||null:null})[_0x5074('0x11')](function(_0x5a4fde){if(_0x5a4fde){return _0x5a4fde[_0x5074('0x27')](_0x55e470[_0x5074('0x1e')][_0x5074('0x28')],_[_0x5074('0x29')](_0x55e470[_0x5074('0x1e')],[_0x5074('0x28'),'id'])||{});}})['spread'](function(_0xfda978){logger[_0x5074('0x12')](_0x5074('0x2a'),_0x55e470);logger[_0x5074('0x24')](_0x5074('0x2a'),_0x55e470,JSON[_0x5074('0x16')](_0xfda978));_0x1ad5e8(_0xfda978);})[_0x5074('0x1b')](function(_0x91c06f){logger[_0x5074('0x17')](_0x5074('0x2a'),_0x91c06f[_0x5074('0x19')],_0x55e470);_0xac7548(_this[_0x5074('0x17')](0x1f4,_0x91c06f['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index c128409..da7effe 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 _0x8367=['./chatInteraction.events','save','remove','emit','register','chatInteraction:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8367,0xa2));var _0x7836=function(_0x3b0e76,_0x239221){_0x3b0e76=_0x3b0e76-0x0;var _0x1e4af4=_0x8367[_0x3b0e76];return _0x1e4af4;};'use strict';var ChatInteractionEvents=require(_0x7836('0x0'));var events=[_0x7836('0x1'),_0x7836('0x2'),'update'];function createListener(_0xac80f2,_0x2c811f){return function(_0x543252){_0x2c811f[_0x7836('0x3')](_0xac80f2,_0x543252);};}function removeListener(_0x101eb7,_0x5dffbb){return function(){ChatInteractionEvents['removeListener'](_0x101eb7,_0x5dffbb);};}exports[_0x7836('0x4')]=function(_0x12246d){for(var _0x4132be=0x0,_0x10685b=events['length'];_0x4132be<_0x10685b;_0x4132be++){var _0x36cf2d=events[_0x4132be];var _0x1ba296=createListener(_0x7836('0x5')+_0x36cf2d,_0x12246d);ChatInteractionEvents['on'](_0x36cf2d,_0x1ba296);}};
\ No newline at end of file
+var _0xe84f=['chatInteraction:','./chatInteraction.events','save','remove','update','emit','register'];(function(_0x46fae8,_0x4f06cf){var _0xe8c45d=function(_0x4e82c2){while(--_0x4e82c2){_0x46fae8['push'](_0x46fae8['shift']());}};_0xe8c45d(++_0x4f06cf);}(_0xe84f,0x190));var _0xfe84=function(_0x2d04b1,_0x3127f2){_0x2d04b1=_0x2d04b1-0x0;var _0xd7df28=_0xe84f[_0x2d04b1];return _0xd7df28;};'use strict';var ChatInteractionEvents=require(_0xfe84('0x0'));var events=[_0xfe84('0x1'),_0xfe84('0x2'),_0xfe84('0x3')];function createListener(_0x224953,_0x16af3f){return function(_0x142512){_0x16af3f[_0xfe84('0x4')](_0x224953,_0x142512);};}function removeListener(_0x312906,_0x331f24){return function(){ChatInteractionEvents['removeListener'](_0x312906,_0x331f24);};}exports[_0xfe84('0x5')]=function(_0x310230){for(var _0x55febf=0x0,_0x4000a0=events['length'];_0x55febf<_0x4000a0;_0x55febf++){var _0x39ae6d=events[_0x55febf];var _0x471e9b=createListener(_0xfe84('0x6')+_0x39ae6d,_0x310230);ChatInteractionEvents['on'](_0x39ae6d,_0x471e9b);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 300e93a..514a268 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 _0xc003=['../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','isAuthenticated','index','get','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/download','download','post','create','/:id/vidaoo','diskStorage','join','root','server/files/attachments/','format','now','/:id/attachment_upload','single','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','chatinteraction:update','update','/:id/custom_update','customUpdate','put','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5ca82d,_0x7d11a0){var _0x397661=function(_0x4ce955){while(--_0x4ce955){_0x5ca82d['push'](_0x5ca82d['shift']());}};_0x397661(++_0x7d11a0);}(_0xc003,0xc5));var _0x3c00=function(_0x30ff44,_0x143800){_0x30ff44=_0x30ff44-0x0;var _0x126c3c=_0xc003[_0x30ff44];return _0x126c3c;};'use strict';var multer=require(_0x3c00('0x0'));var util=require(_0x3c00('0x1'));var path=require(_0x3c00('0x2'));var timeout=require(_0x3c00('0x3'));var express=require(_0x3c00('0x4'));var router=express[_0x3c00('0x5')]();var fs_extra=require(_0x3c00('0x6'));var auth=require(_0x3c00('0x7'));var interaction=require(_0x3c00('0x8'));var config=require('../../config/environment');var controller=require(_0x3c00('0x9'));router['get']('/',auth[_0x3c00('0xa')](),controller[_0x3c00('0xb')]);router[_0x3c00('0xc')]('/describe',auth[_0x3c00('0xa')](),controller['describe']);router[_0x3c00('0xc')](_0x3c00('0xd'),auth[_0x3c00('0xe')](),controller[_0x3c00('0xf')]);router[_0x3c00('0xc')](_0x3c00('0x10'),auth[_0x3c00('0xe')](),controller[_0x3c00('0x11')]);router['get'](_0x3c00('0x12'),auth[_0x3c00('0xa')](),controller[_0x3c00('0x13')]);router[_0x3c00('0xc')]('/:id/my_messages',auth[_0x3c00('0xe')](),controller['getMyMessages']);router[_0x3c00('0xc')](_0x3c00('0x14'),auth[_0x3c00('0xa')](),controller[_0x3c00('0x15')]);router[_0x3c00('0x16')]('/',auth[_0x3c00('0xa')](),controller[_0x3c00('0x17')]);router[_0x3c00('0x16')](_0x3c00('0x18'),auth[_0x3c00('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x3c00('0x19')]({'destination':function(_0xa758a9,_0xadcd86,_0x4f05d7){_0x4f05d7(null,path[_0x3c00('0x1a')](config[_0x3c00('0x1b')],_0x3c00('0x1c')));},'filename':function(_0x1d2af8,_0x3a3183,_0x43ccb7){_0x43ccb7(null,util[_0x3c00('0x1d')]('%s-%s',Date[_0x3c00('0x1e')](),_0x3a3183['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3c00('0x16')](_0x3c00('0x1f'),upload[_0x3c00('0x20')]('file'),controller['attachmentUpload']);router[_0x3c00('0x16')](_0x3c00('0x12'),auth[_0x3c00('0xe')](),controller[_0x3c00('0x21')]);router[_0x3c00('0x16')](_0x3c00('0x22'),auth[_0x3c00('0xa')](),interaction[_0x3c00('0x23')](_0x3c00('0x24'),_0x3c00('0x25')),controller['addTags']);router['put'](_0x3c00('0xd'),auth[_0x3c00('0xa')](),interaction['tracked'](_0x3c00('0x24'),_0x3c00('0x26')),controller[_0x3c00('0x27')]);router['put'](_0x3c00('0x28'),controller[_0x3c00('0x29')]);router[_0x3c00('0x2a')](_0x3c00('0x2b'),auth[_0x3c00('0xe')](),controller['abandon']);router[_0x3c00('0x2a')](_0x3c00('0x2c'),controller[_0x3c00('0x2d')]);router[_0x3c00('0x2e')](_0x3c00('0xd'),auth[_0x3c00('0xa')](),interaction[_0x3c00('0x23')]('chat',_0x3c00('0x2f')),controller[_0x3c00('0x30')]);router[_0x3c00('0x2e')]('/:id/tags',auth[_0x3c00('0xa')](),controller[_0x3c00('0x31')]);module[_0x3c00('0x32')]=router;
\ No newline at end of file
+var _0x2d92=['/:id','chatinteraction:update','update','/:id/abandon','close','delete','destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','download','post','create','createVidaooSession','diskStorage','root','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put'];(function(_0x3dc360,_0x300711){var _0x78df64=function(_0xd9e0d4){while(--_0xd9e0d4){_0x3dc360['push'](_0x3dc360['shift']());}};_0x78df64(++_0x300711);}(_0x2d92,0x9c));var _0x22d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2d92[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x22d9('0x0'));var util=require(_0x22d9('0x1'));var path=require(_0x22d9('0x2'));var timeout=require('connect-timeout');var express=require(_0x22d9('0x3'));var router=express[_0x22d9('0x4')]();var fs_extra=require(_0x22d9('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x22d9('0x6'));var controller=require(_0x22d9('0x7'));router[_0x22d9('0x8')]('/',auth[_0x22d9('0x9')](),controller[_0x22d9('0xa')]);router[_0x22d9('0x8')](_0x22d9('0xb'),auth[_0x22d9('0x9')](),controller['describe']);router['get']('/:id',auth['isChatInteractionAuthorized'](),controller['show']);router['get']('/:id/attachment_download',auth[_0x22d9('0xc')](),controller[_0x22d9('0xd')]);router[_0x22d9('0x8')](_0x22d9('0xe'),auth[_0x22d9('0x9')](),controller[_0x22d9('0xf')]);router[_0x22d9('0x8')]('/:id/my_messages',auth[_0x22d9('0xc')](),controller[_0x22d9('0x10')]);router[_0x22d9('0x8')](_0x22d9('0x11'),auth['isAuthenticated'](),controller[_0x22d9('0x12')]);router[_0x22d9('0x13')]('/',auth[_0x22d9('0x9')](),controller[_0x22d9('0x14')]);router['post']('/:id/vidaoo',auth[_0x22d9('0x9')](),controller[_0x22d9('0x15')]);var upload=multer({'storage':multer[_0x22d9('0x16')]({'destination':function(_0x297c32,_0x194f98,_0x1e7557){_0x1e7557(null,path['join'](config[_0x22d9('0x17')],'server/files/attachments/'));},'filename':function(_0x56b2f2,_0xf55a2b,_0x133c77){_0x133c77(null,util[_0x22d9('0x18')](_0x22d9('0x19'),Date[_0x22d9('0x1a')](),_0xf55a2b[_0x22d9('0x1b')][_0x22d9('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x22d9('0x1d'),upload[_0x22d9('0x1e')](_0x22d9('0x1f')),controller[_0x22d9('0x20')]);router[_0x22d9('0x13')]('/:id/messages',auth[_0x22d9('0xc')](),controller[_0x22d9('0x21')]);router['post'](_0x22d9('0x22'),auth['isAuthenticated'](),interaction[_0x22d9('0x23')](_0x22d9('0x24'),_0x22d9('0x25')),controller[_0x22d9('0x26')]);router[_0x22d9('0x27')](_0x22d9('0x28'),auth[_0x22d9('0x9')](),interaction[_0x22d9('0x23')](_0x22d9('0x24'),_0x22d9('0x29')),controller[_0x22d9('0x2a')]);router[_0x22d9('0x27')]('/:id/custom_update',controller['customUpdate']);router[_0x22d9('0x27')](_0x22d9('0x2b'),auth['isChatInteractionAuthorized'](),controller['abandon']);router['put']('/:id/close',controller[_0x22d9('0x2c')]);router[_0x22d9('0x2d')]('/:id',auth[_0x22d9('0x9')](),interaction[_0x22d9('0x23')](_0x22d9('0x24'),'chatinteraction:destroy'),controller[_0x22d9('0x2e')]);router['delete'](_0x22d9('0x22'),auth[_0x22d9('0x9')](),controller[_0x22d9('0x2f')]);module[_0x22d9('0x30')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index cc53042..d1d4ff4 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 _0xd68d=['INTEGER','sequelize','TEXT','medium'];(function(_0x139dee,_0x598861){var _0x194876=function(_0x119e13){while(--_0x119e13){_0x139dee['push'](_0x139dee['shift']());}};_0x194876(++_0x598861);}(_0xd68d,0x1ed));var _0xdd68=function(_0x2e5201,_0x16ca50){_0x2e5201=_0x2e5201-0x0;var _0x375733=_0xd68d[_0x2e5201];return _0x375733;};'use strict';var Sequelize=require(_0xdd68('0x0'));module['exports']={'body':{'type':Sequelize[_0xdd68('0x1')](_0xdd68('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xdd68('0x3')]}};
\ No newline at end of file
+var _0xe26d=['BOOLEAN','sequelize','exports','TEXT','medium'];(function(_0x2471ca,_0xfbc1cd){var _0x561a14=function(_0x1e5438){while(--_0x1e5438){_0x2471ca['push'](_0x2471ca['shift']());}};_0x561a14(++_0xfbc1cd);}(_0xe26d,0x123));var _0xde26=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe26d[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xde26('0x0'));module[_0xde26('0x1')]={'body':{'type':Sequelize[_0xde26('0x2')](_0xde26('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xde26('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index ffb1200..c85359e 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 _0x103d=['localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','index','map','ChatInternalMessage','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','params','includeAll','find','catch','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','length','push','FromId','ToId','-createdAt','all','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','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','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults'];(function(_0xf6aaa,_0x3d7d4b){var _0x1dc0ce=function(_0x539f46){while(--_0x539f46){_0xf6aaa['push'](_0xf6aaa['shift']());}};_0x1dc0ce(++_0x3d7d4b);}(_0x103d,0xc7));var _0xd103=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x103d[_0x5834bc];return _0x3e183a;};'use strict';var emlformat=require(_0xd103('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd103('0x1'));var rp=require(_0xd103('0x2'));var moment=require('moment');var BPromise=require(_0xd103('0x3'));var Mustache=require(_0xd103('0x4'));var util=require(_0xd103('0x5'));var path=require(_0xd103('0x6'));var sox=require('sox');var csv=require(_0xd103('0x7'));var ejs=require(_0xd103('0x8'));var fs=require('fs');var fs_extra=require(_0xd103('0x9'));var _=require('lodash');var squel=require(_0xd103('0xa'));var crypto=require(_0xd103('0xb'));var jsforce=require(_0xd103('0xc'));var deskjs=require(_0xd103('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd103('0xe'));var Papa=require(_0xd103('0xf'));var Redis=require(_0xd103('0x10'));var authService=require(_0xd103('0x11'));var qs=require(_0xd103('0x12'));var as=require(_0xd103('0x13'));var hardwareService=require(_0xd103('0x14'));var logger=require(_0xd103('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xd103('0x16'));var licenseUtil=require(_0xd103('0x17'));var db=require(_0xd103('0x18'))['db'];config[_0xd103('0x19')]=_[_0xd103('0x1a')](config['redis'],{'host':_0xd103('0x1b'),'port':0x18eb});var socket=require(_0xd103('0x1c'))(new Redis(config[_0xd103('0x19')]));require(_0xd103('0x1d'))[_0xd103('0x1e')](socket);function respondWithStatusCode(_0x441c1a,_0x43a79c){_0x43a79c=_0x43a79c||0xcc;return function(_0x3883de){if(_0x3883de){return _0x441c1a[_0xd103('0x1f')](_0x43a79c);}return _0x441c1a['status'](_0x43a79c)[_0xd103('0x20')]();};}function respondWithResult(_0x21b82c,_0x339300){_0x339300=_0x339300||0xc8;return function(_0x16e493){if(_0x16e493){return _0x21b82c[_0xd103('0x21')](_0x339300)[_0xd103('0x22')](_0x16e493);}};}function respondWithFilteredResult(_0x58a394,_0x3a82c7){return function(_0x52ff95){if(_0x52ff95){var _0x52e4e4=typeof _0x3a82c7['offset']===_0xd103('0x23')&&typeof _0x3a82c7[_0xd103('0x24')]===_0xd103('0x23');var _0x26a50b=_0x52ff95[_0xd103('0x25')];var _0x3cfb64=_0x52e4e4?0x0:_0x3a82c7[_0xd103('0x26')];var _0x54dec3=_0x52e4e4?_0x52ff95[_0xd103('0x25')]:_0x3a82c7[_0xd103('0x26')]+_0x3a82c7[_0xd103('0x24')];var _0x19df9d;if(_0x54dec3>=_0x26a50b){_0x54dec3=_0x26a50b;_0x19df9d=0xc8;}else{_0x19df9d=0xce;}_0x58a394[_0xd103('0x21')](_0x19df9d);return _0x58a394[_0xd103('0x27')]('Content-Range',_0x3cfb64+'-'+_0x54dec3+'/'+_0x26a50b)['json'](_0x52ff95);}return null;};}function patchUpdates(_0x18f599){return function(_0x1ae50e){try{jsonpatch[_0xd103('0x28')](_0x1ae50e,_0x18f599,!![]);}catch(_0x532eaa){return BPromise[_0xd103('0x29')](_0x532eaa);}return _0x1ae50e[_0xd103('0x2a')]();};}function saveUpdates(_0x15ffda,_0xf55d2d){return function(_0x1c91ba){if(_0x1c91ba){return _0x1c91ba[_0xd103('0x2b')](_0x15ffda)[_0xd103('0x2c')](function(_0xc0cc2c){return _0xc0cc2c;});}return null;};}function removeEntity(_0x353c4b,_0x50a2aa){return function(_0x510d4b){if(_0x510d4b){return _0x510d4b[_0xd103('0x2d')]()['then'](function(){_0x353c4b[_0xd103('0x21')](0xcc)[_0xd103('0x20')]();});}};}function handleEntityNotFound(_0x2b0d73,_0x50d85b){return function(_0x468634){if(!_0x468634){_0x2b0d73[_0xd103('0x1f')](0x194);}return _0x468634;};}function handleError(_0x26cfbf,_0x5db012){_0x5db012=_0x5db012||0x1f4;return function(_0x4dad5f){logger[_0xd103('0x2e')](_0x4dad5f[_0xd103('0x2f')]);if(_0x4dad5f[_0xd103('0x30')]){delete _0x4dad5f['name'];}_0x26cfbf[_0xd103('0x21')](_0x5db012)['send'](_0x4dad5f);};}exports[_0xd103('0x31')]=function(_0x2a3e77,_0x3b7c62){var _0x3c2789={},_0xc2ad2f={},_0x49deec={'count':0x0,'rows':[]};var _0x226e54=_[_0xd103('0x32')](db[_0xd103('0x33')][_0xd103('0x34')],function(_0x7cf73){return{'name':_0x7cf73['fieldName'],'type':_0x7cf73[_0xd103('0x35')][_0xd103('0x36')]};});_0xc2ad2f[_0xd103('0x37')]=_[_0xd103('0x32')](_0x226e54,'name');_0xc2ad2f[_0xd103('0x38')]=_[_0xd103('0x39')](_0x2a3e77[_0xd103('0x38')]);_0xc2ad2f['filters']=_[_0xd103('0x3a')](_0xc2ad2f[_0xd103('0x37')],_0xc2ad2f['query']);_0x3c2789['attributes']=_[_0xd103('0x3a')](_0xc2ad2f[_0xd103('0x37')],qs[_0xd103('0x3b')](_0x2a3e77[_0xd103('0x38')]['fields']));_0x3c2789['attributes']=_0x3c2789[_0xd103('0x3c')]['length']?_0x3c2789[_0xd103('0x3c')]:_0xc2ad2f[_0xd103('0x37')];if(!_0x2a3e77[_0xd103('0x38')][_0xd103('0x3d')]('nolimit')){_0x3c2789['limit']=qs['limit'](_0x2a3e77[_0xd103('0x38')]['limit']);_0x3c2789['offset']=qs[_0xd103('0x26')](_0x2a3e77[_0xd103('0x38')][_0xd103('0x26')]);}_0x3c2789['order']=qs[_0xd103('0x3e')](_0x2a3e77[_0xd103('0x38')][_0xd103('0x3e')]);_0x3c2789[_0xd103('0x3f')]=qs[_0xd103('0x40')](_['pick'](_0x2a3e77[_0xd103('0x38')],_0xc2ad2f[_0xd103('0x40')]),_0x226e54);if(_0x2a3e77['query'][_0xd103('0x41')]){_0x3c2789[_0xd103('0x3f')]=_[_0xd103('0x42')](_0x3c2789['where'],{'$or':_[_0xd103('0x32')](_0x226e54,function(_0x1e8f98){if(_0x1e8f98[_0xd103('0x35')]!==_0xd103('0x43')){var _0x2e987b={};_0x2e987b[_0x1e8f98['name']]={'$like':'%'+_0x2a3e77[_0xd103('0x38')][_0xd103('0x41')]+'%'};return _0x2e987b;}})});}_0x3c2789=_['merge']({},_0x3c2789,_0x2a3e77[_0xd103('0x44')]);var _0x521824={'where':_0x3c2789[_0xd103('0x3f')]};return db[_0xd103('0x33')][_0xd103('0x25')](_0x521824)[_0xd103('0x2c')](function(_0x5d6ae5){_0x49deec[_0xd103('0x25')]=_0x5d6ae5;if(_0x2a3e77[_0xd103('0x38')]['includeAll']){_0x3c2789[_0xd103('0x45')]=[{'all':!![]}];}return db[_0xd103('0x33')][_0xd103('0x46')](_0x3c2789);})[_0xd103('0x2c')](function(_0x3a45eb){_0x49deec[_0xd103('0x47')]=_0x3a45eb;return _0x49deec;})[_0xd103('0x2c')](respondWithFilteredResult(_0x3b7c62,_0x3c2789))['catch'](handleError(_0x3b7c62,null));};exports['show']=function(_0x39a7d7,_0x1d17fd){var _0x5880b9={'raw':!![],'where':{'id':_0x39a7d7[_0xd103('0x48')]['id']}},_0xe34faa={};_0xe34faa['model']=_[_0xd103('0x39')](db[_0xd103('0x33')][_0xd103('0x34')]);_0xe34faa[_0xd103('0x38')]=_[_0xd103('0x39')](_0x39a7d7[_0xd103('0x38')]);_0xe34faa[_0xd103('0x40')]=_[_0xd103('0x3a')](_0xe34faa[_0xd103('0x37')],_0xe34faa[_0xd103('0x38')]);_0x5880b9['attributes']=_[_0xd103('0x3a')](_0xe34faa['model'],qs[_0xd103('0x3b')](_0x39a7d7[_0xd103('0x38')][_0xd103('0x3b')]));_0x5880b9[_0xd103('0x3c')]=_0x5880b9[_0xd103('0x3c')]['length']?_0x5880b9['attributes']:_0xe34faa[_0xd103('0x37')];if(_0x39a7d7[_0xd103('0x38')][_0xd103('0x49')]){_0x5880b9[_0xd103('0x45')]=[{'all':!![]}];}_0x5880b9=_[_0xd103('0x42')]({},_0x5880b9,_0x39a7d7[_0xd103('0x44')]);return db[_0xd103('0x33')][_0xd103('0x4a')](_0x5880b9)[_0xd103('0x2c')](handleEntityNotFound(_0x1d17fd,null))['then'](respondWithResult(_0x1d17fd,null))[_0xd103('0x4b')](handleError(_0x1d17fd,null));};exports[_0xd103('0x4c')]=function(_0xd1c107,_0x135450){return db['ChatInternalMessage']['create'](_0xd1c107[_0xd103('0x4d')],{})[_0xd103('0x2c')](respondWithResult(_0x135450,0xc9))['catch'](handleError(_0x135450,null));};exports['update']=function(_0x20e6f3,_0x59a5e2){if(_0x20e6f3[_0xd103('0x4d')]['id']){delete _0x20e6f3['body']['id'];}return db['ChatInternalMessage'][_0xd103('0x4a')]({'where':{'id':_0x20e6f3[_0xd103('0x48')]['id']}})[_0xd103('0x2c')](handleEntityNotFound(_0x59a5e2,null))[_0xd103('0x2c')](saveUpdates(_0x20e6f3[_0xd103('0x4d')],null))['then'](respondWithResult(_0x59a5e2,null))[_0xd103('0x4b')](handleError(_0x59a5e2,null));};exports[_0xd103('0x2d')]=function(_0x487a1d,_0x451197){return db[_0xd103('0x33')][_0xd103('0x4a')]({'where':{'id':_0x487a1d[_0xd103('0x48')]['id']}})[_0xd103('0x2c')](handleEntityNotFound(_0x451197,null))[_0xd103('0x2c')](removeEntity(_0x451197,null))['catch'](handleError(_0x451197,null));};exports[_0xd103('0x4e')]=function(_0x1aac7e,_0x501b68){return db[_0xd103('0x33')][_0xd103('0x4e')]()['then'](respondWithResult(_0x501b68,null))[_0xd103('0x4b')](handleError(_0x501b68,null));};function wrapUser(_0x23bf23){return function(_0x3b27ed){var _0x38990c=_0x23bf23[_0xd103('0x4f')]({'plain':!![]});_0x38990c[_0xd103('0x50')]=[];if(_0x3b27ed){_0x38990c[_0xd103('0x51')]=_0x3b27ed[_0xd103('0x52')];_0x38990c[_0xd103('0x53')]=_0x3b27ed;}else{_0x38990c[_0xd103('0x51')]=moment(0x0)[_0xd103('0x54')](_0xd103('0x55'));_0x38990c[_0xd103('0x53')]={};}return _0x38990c;};}exports[_0xd103('0x56')]=function(_0x59b80a,_0x1e71ac,_0x310907){var _0x47d279=[];return db['User'][_0xd103('0x46')]({'where':{'role':['agent',_0xd103('0x57'),_0xd103('0x58')]},'attributes':['id',_0xd103('0x59'),_0xd103('0x30'),_0xd103('0x5a'),_0xd103('0x5b'),_0xd103('0x5c'),_0xd103('0x5d'),_0xd103('0x5e'),_0xd103('0x5f'),_0xd103('0x60')],'order':qs[_0xd103('0x3e')](_0xd103('0x61')),'include':[{'model':db['VoiceQueue'],'as':_0xd103('0x62'),'attributes':['id',_0xd103('0x30'),_0xd103('0x35')],'through':{'attributes':[]}}]})[_0xd103('0x2c')](function(_0x3dbbcb){if(_0x3dbbcb){var _0x36a65e=_0x59b80a[_0xd103('0x58')][_0xd103('0x4f')]({'plain':!![]});if(!_0x36a65e)throw new Error(_0xd103('0x63'));if(_0x36a65e[_0xd103('0x5a')]===_0xd103('0x58')){return db[_0xd103('0x64')][_0xd103('0x4a')]({'where':{'name':_0xd103('0x65'),'userProfileId':_0x36a65e[_0xd103('0x66')]},'raw':!![]})[_0xd103('0x2c')](function(_0x18f182){if(_0x18f182){if(_0x18f182[_0xd103('0x67')]===0x0){return db[_0xd103('0x68')][_0xd103('0x46')]({'where':{'sectionId':_0x18f182['id']},'raw':!![]})['then'](function(_0x2bd9e6){var _0x5ef027=[];if(_[_0xd103('0x69')](_0x2bd9e6)){_0x5ef027=_[_0xd103('0x41')](_0x3dbbcb,function(_0x5300fc){if(_0x5300fc[_0xd103('0x5a')]!==_0xd103('0x6a')){return _0x5300fc;}});return _0x5ef027;}else{for(var _0x539296=0x0;_0x539296<_0x3dbbcb[_0xd103('0x6b')];_0x539296++){var _0x258abc=_0x3dbbcb[_0x539296];if(_0x258abc[_0xd103('0x5a')]==='agent'){var _0xb923ad=_[_0xd103('0x4a')](_0x2bd9e6,function(_0x5be166){return _0x5be166['resourceId']===_0x258abc['id'];});if(_0xb923ad)_0x5ef027['push'](_0x258abc);}else{_0x5ef027[_0xd103('0x6c')](_0x258abc);}}return _0x5ef027;}});}else{return _0x3dbbcb;}}else{var _0xce26c4=_[_0xd103('0x41')](_0x3dbbcb,function(_0x15e968){if(_0x15e968[_0xd103('0x5a')]!==_0xd103('0x6a')){return _0x15e968;}});return _0xce26c4;}});}else{return _0x3dbbcb;}}})[_0xd103('0x2c')](function(_0x1b4d36){var _0x351973=[];if(_0x1b4d36){_0x47d279=_0x1b4d36;for(var _0x40b471=0x0;_0x40b471<_0x1b4d36[_0xd103('0x6b')];_0x40b471+=0x1){_0x47d279[_0x40b471][_0xd103('0x50')]=[];_0x351973[_0xd103('0x6c')](db[_0xd103('0x33')]['find']({'where':{'FromId':[_0x59b80a[_0xd103('0x58')]['id'],_0x1b4d36[_0x40b471]['id']],'ToId':[_0x59b80a['user']['id'],_0x1b4d36[_0x40b471]['id']],'ChatGroupId':null},'attributes':['id',_0xd103('0x52'),_0xd103('0x6d'),_0xd103('0x6e'),'read','body'],'order':qs[_0xd103('0x3e')](_0xd103('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xd103('0x2c')](wrapUser(_0x1b4d36[_0x40b471])));}return BPromise[_0xd103('0x70')](_0x351973);}return[];})['then'](function(_0x1298ea){return{'rows':_0x1298ea,'count':_0x1298ea[_0xd103('0x6b')]};})[_0xd103('0x2c')](respondWithResult(_0x1e71ac,null))[_0xd103('0x4b')](handleError(_0x1e71ac,null));};
\ No newline at end of file
+var _0x94bc=['autoAssociation','UserProfileResource','resourceId','push','messages','FromId','all','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','./chatInternalMessage.socket','end','json','undefined','limit','count','offset','status','set','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','create','body','find','describe','get','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','user','role','userpic','online','lastLoginAt','allowmessenger','VoiceQueue','UserProfileSection','userProfileId'];(function(_0x36ed9f,_0x57262c){var _0x4fedc4=function(_0x4048c7){while(--_0x4048c7){_0x36ed9f['push'](_0x36ed9f['shift']());}};_0x4fedc4(++_0x57262c);}(_0x94bc,0x136));var _0xc94b=function(_0x5de967,_0x515918){_0x5de967=_0x5de967-0x0;var _0x5b07a3=_0x94bc[_0x5de967];return _0x5b07a3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc94b('0x0'));var zipdir=require(_0xc94b('0x1'));var jsonpatch=require(_0xc94b('0x2'));var rp=require(_0xc94b('0x3'));var moment=require(_0xc94b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc94b('0x5'));var path=require(_0xc94b('0x6'));var sox=require(_0xc94b('0x7'));var csv=require(_0xc94b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc94b('0x9'));var _=require(_0xc94b('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc94b('0xb'));var deskjs=require(_0xc94b('0xc'));var toCsv=require(_0xc94b('0x8'));var querystring=require('querystring');var Papa=require(_0xc94b('0xd'));var Redis=require('ioredis');var authService=require(_0xc94b('0xe'));var qs=require(_0xc94b('0xf'));var as=require(_0xc94b('0x10'));var hardwareService=require(_0xc94b('0x11'));var logger=require(_0xc94b('0x12'))(_0xc94b('0x13'));var utils=require(_0xc94b('0x14'));var config=require(_0xc94b('0x15'));var licenseUtil=require(_0xc94b('0x16'));var db=require('../../mysqldb')['db'];config[_0xc94b('0x17')]=_[_0xc94b('0x18')](config[_0xc94b('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc94b('0x17')]));require(_0xc94b('0x19'))['register'](socket);function respondWithStatusCode(_0x17d5b2,_0xc99dbf){_0xc99dbf=_0xc99dbf||0xcc;return function(_0x2595a9){if(_0x2595a9){return _0x17d5b2['sendStatus'](_0xc99dbf);}return _0x17d5b2['status'](_0xc99dbf)[_0xc94b('0x1a')]();};}function respondWithResult(_0x3e22ba,_0x31e687){_0x31e687=_0x31e687||0xc8;return function(_0x559569){if(_0x559569){return _0x3e22ba['status'](_0x31e687)[_0xc94b('0x1b')](_0x559569);}};}function respondWithFilteredResult(_0x613f2a,_0x49f577){return function(_0x3f1840){if(_0x3f1840){var _0x44a2b2=typeof _0x49f577['offset']===_0xc94b('0x1c')&&typeof _0x49f577[_0xc94b('0x1d')]==='undefined';var _0x2ce57=_0x3f1840[_0xc94b('0x1e')];var _0xa1bafd=_0x44a2b2?0x0:_0x49f577[_0xc94b('0x1f')];var _0x238b84=_0x44a2b2?_0x3f1840[_0xc94b('0x1e')]:_0x49f577[_0xc94b('0x1f')]+_0x49f577[_0xc94b('0x1d')];var _0x4eafd4;if(_0x238b84>=_0x2ce57){_0x238b84=_0x2ce57;_0x4eafd4=0xc8;}else{_0x4eafd4=0xce;}_0x613f2a[_0xc94b('0x20')](_0x4eafd4);return _0x613f2a[_0xc94b('0x21')]('Content-Range',_0xa1bafd+'-'+_0x238b84+'/'+_0x2ce57)[_0xc94b('0x1b')](_0x3f1840);}return null;};}function patchUpdates(_0x1cd88f){return function(_0x2a21b9){try{jsonpatch[_0xc94b('0x22')](_0x2a21b9,_0x1cd88f,!![]);}catch(_0x44677e){return BPromise[_0xc94b('0x23')](_0x44677e);}return _0x2a21b9[_0xc94b('0x24')]();};}function saveUpdates(_0x1b7e44,_0x2a2ae2){return function(_0xd57223){if(_0xd57223){return _0xd57223[_0xc94b('0x25')](_0x1b7e44)[_0xc94b('0x26')](function(_0x577af5){return _0x577af5;});}return null;};}function removeEntity(_0x523d51,_0x10b5c8){return function(_0x321e20){if(_0x321e20){return _0x321e20['destroy']()['then'](function(){_0x523d51[_0xc94b('0x20')](0xcc)[_0xc94b('0x1a')]();});}};}function handleEntityNotFound(_0x15f051,_0xb57979){return function(_0x52ad32){if(!_0x52ad32){_0x15f051[_0xc94b('0x27')](0x194);}return _0x52ad32;};}function handleError(_0x30f068,_0x87f3b6){_0x87f3b6=_0x87f3b6||0x1f4;return function(_0x2e1e6a){logger['error'](_0x2e1e6a[_0xc94b('0x28')]);if(_0x2e1e6a[_0xc94b('0x29')]){delete _0x2e1e6a['name'];}_0x30f068[_0xc94b('0x20')](_0x87f3b6)[_0xc94b('0x2a')](_0x2e1e6a);};}exports[_0xc94b('0x2b')]=function(_0x58d300,_0x50c33b){var _0x5278c3={},_0x4098e5={},_0x31c996={'count':0x0,'rows':[]};var _0x448bcf=_[_0xc94b('0x2c')](db[_0xc94b('0x2d')][_0xc94b('0x2e')],function(_0x2583ba){return{'name':_0x2583ba[_0xc94b('0x2f')],'type':_0x2583ba['type']['key']};});_0x4098e5['model']=_[_0xc94b('0x2c')](_0x448bcf,_0xc94b('0x29'));_0x4098e5[_0xc94b('0x30')]=_[_0xc94b('0x31')](_0x58d300['query']);_0x4098e5[_0xc94b('0x32')]=_[_0xc94b('0x33')](_0x4098e5[_0xc94b('0x34')],_0x4098e5[_0xc94b('0x30')]);_0x5278c3['attributes']=_[_0xc94b('0x33')](_0x4098e5[_0xc94b('0x34')],qs[_0xc94b('0x35')](_0x58d300['query'][_0xc94b('0x35')]));_0x5278c3[_0xc94b('0x36')]=_0x5278c3[_0xc94b('0x36')][_0xc94b('0x37')]?_0x5278c3[_0xc94b('0x36')]:_0x4098e5[_0xc94b('0x34')];if(!_0x58d300[_0xc94b('0x30')][_0xc94b('0x38')](_0xc94b('0x39'))){_0x5278c3['limit']=qs[_0xc94b('0x1d')](_0x58d300[_0xc94b('0x30')][_0xc94b('0x1d')]);_0x5278c3[_0xc94b('0x1f')]=qs[_0xc94b('0x1f')](_0x58d300[_0xc94b('0x30')][_0xc94b('0x1f')]);}_0x5278c3[_0xc94b('0x3a')]=qs[_0xc94b('0x3b')](_0x58d300[_0xc94b('0x30')][_0xc94b('0x3b')]);_0x5278c3[_0xc94b('0x3c')]=qs['filters'](_['pick'](_0x58d300[_0xc94b('0x30')],_0x4098e5['filters']),_0x448bcf);if(_0x58d300[_0xc94b('0x30')][_0xc94b('0x3d')]){_0x5278c3[_0xc94b('0x3c')]=_[_0xc94b('0x3e')](_0x5278c3['where'],{'$or':_['map'](_0x448bcf,function(_0x2d0ed5){if(_0x2d0ed5[_0xc94b('0x3f')]!==_0xc94b('0x40')){var _0xae197={};_0xae197[_0x2d0ed5[_0xc94b('0x29')]]={'$like':'%'+_0x58d300[_0xc94b('0x30')][_0xc94b('0x3d')]+'%'};return _0xae197;}})});}_0x5278c3=_['merge']({},_0x5278c3,_0x58d300['options']);var _0x195fae={'where':_0x5278c3[_0xc94b('0x3c')]};return db[_0xc94b('0x2d')][_0xc94b('0x1e')](_0x195fae)[_0xc94b('0x26')](function(_0x5c1b31){_0x31c996['count']=_0x5c1b31;if(_0x58d300['query'][_0xc94b('0x41')]){_0x5278c3[_0xc94b('0x42')]=[{'all':!![]}];}return db[_0xc94b('0x2d')][_0xc94b('0x43')](_0x5278c3);})[_0xc94b('0x26')](function(_0x58fb27){_0x31c996[_0xc94b('0x44')]=_0x58fb27;return _0x31c996;})[_0xc94b('0x26')](respondWithFilteredResult(_0x50c33b,_0x5278c3))[_0xc94b('0x45')](handleError(_0x50c33b,null));};exports[_0xc94b('0x46')]=function(_0x3f0580,_0x1f58d9){var _0x534185={'raw':!![],'where':{'id':_0x3f0580[_0xc94b('0x47')]['id']}},_0x1d58be={};_0x1d58be[_0xc94b('0x34')]=_[_0xc94b('0x31')](db['ChatInternalMessage'][_0xc94b('0x2e')]);_0x1d58be[_0xc94b('0x30')]=_[_0xc94b('0x31')](_0x3f0580[_0xc94b('0x30')]);_0x1d58be[_0xc94b('0x32')]=_[_0xc94b('0x33')](_0x1d58be[_0xc94b('0x34')],_0x1d58be[_0xc94b('0x30')]);_0x534185[_0xc94b('0x36')]=_['intersection'](_0x1d58be[_0xc94b('0x34')],qs[_0xc94b('0x35')](_0x3f0580[_0xc94b('0x30')][_0xc94b('0x35')]));_0x534185[_0xc94b('0x36')]=_0x534185[_0xc94b('0x36')]['length']?_0x534185['attributes']:_0x1d58be[_0xc94b('0x34')];if(_0x3f0580['query']['includeAll']){_0x534185[_0xc94b('0x42')]=[{'all':!![]}];}_0x534185=_[_0xc94b('0x3e')]({},_0x534185,_0x3f0580[_0xc94b('0x48')]);return db['ChatInternalMessage']['find'](_0x534185)['then'](handleEntityNotFound(_0x1f58d9,null))[_0xc94b('0x26')](respondWithResult(_0x1f58d9,null))[_0xc94b('0x45')](handleError(_0x1f58d9,null));};exports[_0xc94b('0x49')]=function(_0x1334d8,_0x41114c){return db[_0xc94b('0x2d')][_0xc94b('0x49')](_0x1334d8[_0xc94b('0x4a')],{})['then'](respondWithResult(_0x41114c,0xc9))[_0xc94b('0x45')](handleError(_0x41114c,null));};exports[_0xc94b('0x25')]=function(_0x297cdb,_0x5a77a0){if(_0x297cdb[_0xc94b('0x4a')]['id']){delete _0x297cdb[_0xc94b('0x4a')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x297cdb[_0xc94b('0x47')]['id']}})[_0xc94b('0x26')](handleEntityNotFound(_0x5a77a0,null))[_0xc94b('0x26')](saveUpdates(_0x297cdb[_0xc94b('0x4a')],null))[_0xc94b('0x26')](respondWithResult(_0x5a77a0,null))[_0xc94b('0x45')](handleError(_0x5a77a0,null));};exports['destroy']=function(_0x16ac1e,_0x47048b){return db[_0xc94b('0x2d')][_0xc94b('0x4b')]({'where':{'id':_0x16ac1e[_0xc94b('0x47')]['id']}})[_0xc94b('0x26')](handleEntityNotFound(_0x47048b,null))['then'](removeEntity(_0x47048b,null))[_0xc94b('0x45')](handleError(_0x47048b,null));};exports[_0xc94b('0x4c')]=function(_0x175da6,_0xe42b37){return db['ChatInternalMessage']['describe']()[_0xc94b('0x26')](respondWithResult(_0xe42b37,null))[_0xc94b('0x45')](handleError(_0xe42b37,null));};function wrapUser(_0x53a411){return function(_0x5c4b76){var _0x15e1d6=_0x53a411[_0xc94b('0x4d')]({'plain':!![]});_0x15e1d6['messages']=[];if(_0x5c4b76){_0x15e1d6[_0xc94b('0x4e')]=_0x5c4b76['createdAt'];_0x15e1d6[_0xc94b('0x4f')]=_0x5c4b76;}else{_0x15e1d6[_0xc94b('0x4e')]=moment(0x0)[_0xc94b('0x50')](_0xc94b('0x51'));_0x15e1d6['lastMessage']={};}return _0x15e1d6;};}exports[_0xc94b('0x52')]=function(_0x3233d8,_0x420388,_0x3704b7){var _0x154921=[];return db['User']['findAll']({'where':{'role':[_0xc94b('0x53'),_0xc94b('0x54'),_0xc94b('0x55')]},'attributes':['id','fullname',_0xc94b('0x29'),_0xc94b('0x56'),_0xc94b('0x57'),'internal',_0xc94b('0x58'),_0xc94b('0x59'),_0xc94b('0x5a'),'showWebBar'],'order':qs[_0xc94b('0x3b')]('-online'),'include':[{'model':db[_0xc94b('0x5b')],'as':'VoiceQueues','attributes':['id',_0xc94b('0x29'),_0xc94b('0x3f')],'through':{'attributes':[]}}]})[_0xc94b('0x26')](function(_0x26f7de){if(_0x26f7de){var _0x326649=_0x3233d8['user'][_0xc94b('0x4d')]({'plain':!![]});if(!_0x326649)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x326649[_0xc94b('0x56')]===_0xc94b('0x55')){return db[_0xc94b('0x5c')][_0xc94b('0x4b')]({'where':{'name':'Agents','userProfileId':_0x326649[_0xc94b('0x5d')]},'raw':!![]})[_0xc94b('0x26')](function(_0x374273){if(_0x374273){if(_0x374273[_0xc94b('0x5e')]===0x0){return db[_0xc94b('0x5f')]['findAll']({'where':{'sectionId':_0x374273['id']},'raw':!![]})[_0xc94b('0x26')](function(_0x38420a){var _0x2f19be=[];if(_['isEmpty'](_0x38420a)){_0x2f19be=_[_0xc94b('0x3d')](_0x26f7de,function(_0x28b942){if(_0x28b942[_0xc94b('0x56')]!=='agent'){return _0x28b942;}});return _0x2f19be;}else{for(var _0x3a692d=0x0;_0x3a692d<_0x26f7de[_0xc94b('0x37')];_0x3a692d++){var _0x50129a=_0x26f7de[_0x3a692d];if(_0x50129a[_0xc94b('0x56')]==='agent'){var _0x5b31fe=_[_0xc94b('0x4b')](_0x38420a,function(_0x1588f1){return _0x1588f1[_0xc94b('0x60')]===_0x50129a['id'];});if(_0x5b31fe)_0x2f19be[_0xc94b('0x61')](_0x50129a);}else{_0x2f19be[_0xc94b('0x61')](_0x50129a);}}return _0x2f19be;}});}else{return _0x26f7de;}}else{var _0x2bf306=_[_0xc94b('0x3d')](_0x26f7de,function(_0x2746e3){if(_0x2746e3[_0xc94b('0x56')]!==_0xc94b('0x53')){return _0x2746e3;}});return _0x2bf306;}});}else{return _0x26f7de;}}})[_0xc94b('0x26')](function(_0x594060){var _0x59ce4e=[];if(_0x594060){_0x154921=_0x594060;for(var _0x4e13f0=0x0;_0x4e13f0<_0x594060['length'];_0x4e13f0+=0x1){_0x154921[_0x4e13f0][_0xc94b('0x62')]=[];_0x59ce4e[_0xc94b('0x61')](db[_0xc94b('0x2d')]['find']({'where':{'FromId':[_0x3233d8[_0xc94b('0x55')]['id'],_0x594060[_0x4e13f0]['id']],'ToId':[_0x3233d8[_0xc94b('0x55')]['id'],_0x594060[_0x4e13f0]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xc94b('0x63'),'ToId','read',_0xc94b('0x4a')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xc94b('0x26')](wrapUser(_0x594060[_0x4e13f0])));}return BPromise[_0xc94b('0x64')](_0x59ce4e);}return[];})[_0xc94b('0x26')](function(_0x4fde1f){return{'rows':_0x4fde1f,'count':_0x4fde1f[_0xc94b('0x37')]};})[_0xc94b('0x26')](respondWithResult(_0x420388,null))[_0xc94b('0x45')](handleError(_0x420388,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 2cc43b0..942a8ba 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 _0x2793=['remove','emit','exports','ChatInternalMessage'];(function(_0x50aef9,_0x196485){var _0x3d1f16=function(_0x3903dd){while(--_0x3903dd){_0x50aef9['push'](_0x50aef9['shift']());}};_0x3d1f16(++_0x196485);}(_0x2793,0x147));var _0x3279=function(_0x6b25ac,_0xe9fa01){_0x6b25ac=_0x6b25ac-0x0;var _0x4c84e9=_0x2793[_0x6b25ac];return _0x4c84e9;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0x3279('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3279('0x1')};function emitEvent(_0x25c864){return function(_0x1cb72b,_0xd5b6da,_0x5d5b3a){ChatInternalMessageEvents[_0x3279('0x2')](_0x25c864+':'+_0x1cb72b['id'],_0x1cb72b);ChatInternalMessageEvents[_0x3279('0x2')](_0x25c864,_0x1cb72b);_0x5d5b3a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x3279('0x3')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xc2ff=['events','../../mysqldb','ChatInternalMessage','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xc2ff,0x195));var _0xfc2f=function(_0x4735a0,_0x3c892b){_0x4735a0=_0x4735a0-0x0;var _0x27b931=_0xc2ff[_0x4735a0];return _0x27b931;};'use strict';var EventEmitter=require(_0xfc2f('0x0'));var ChatInternalMessage=require(_0xfc2f('0x1'))['db'][_0xfc2f('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfc2f('0x3'),'afterUpdate':_0xfc2f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x37e9db){return function(_0x42a6c4,_0x17063e,_0x3719fa){ChatInternalMessageEvents[_0xfc2f('0x5')](_0x37e9db+':'+_0x42a6c4['id'],_0x42a6c4);ChatInternalMessageEvents[_0xfc2f('0x5')](_0x37e9db,_0x42a6c4);_0x3719fa(null);};}for(var e in events){if(events[_0xfc2f('0x6')](e)){var event=events[e];ChatInternalMessage[_0xfc2f('0x7')](e,emitEvent(event));}}module[_0xfc2f('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 3d099a4..206807b 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 _0x0b8c=['rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird','request-promise','path'];(function(_0x1098db,_0x39ba6b){var _0x14f090=function(_0x473ffe){while(--_0x473ffe){_0x1098db['push'](_0x1098db['shift']());}};_0x14f090(++_0x39ba6b);}(_0x0b8c,0x13d));var _0xc0b8=function(_0x160662,_0x458682){_0x160662=_0x160662-0x0;var _0x4bd9cd=_0x0b8c[_0x160662];return _0x4bd9cd;};'use strict';var _=require(_0xc0b8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc0b8('0x1'));var moment=require('moment');var BPromise=require(_0xc0b8('0x2'));var rp=require(_0xc0b8('0x3'));var fs=require('fs');var path=require(_0xc0b8('0x4'));var rimraf=require(_0xc0b8('0x5'));var config=require(_0xc0b8('0x6'));var attributes=require(_0xc0b8('0x7'));module[_0xc0b8('0x8')]=function(_0x42fd81,_0xc8e11a){return _0x42fd81[_0xc0b8('0x9')](_0xc0b8('0xa'),attributes,{'tableName':_0xc0b8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc0b8('0xc'),'collate':_0xc0b8('0xd')});};
\ No newline at end of file
+var _0xc64a=['utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4'];(function(_0x4653f2,_0x21dbcd){var _0x404e19=function(_0x5b7899){while(--_0x5b7899){_0x4653f2['push'](_0x4653f2['shift']());}};_0x404e19(++_0x21dbcd);}(_0xc64a,0x1ae));var _0xac64=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xc64a[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xac64('0x0'));var util=require(_0xac64('0x1'));var logger=require('../../config/logger')(_0xac64('0x2'));var moment=require('moment');var BPromise=require(_0xac64('0x3'));var rp=require(_0xac64('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac64('0x5'));var attributes=require(_0xac64('0x6'));module[_0xac64('0x7')]=function(_0x1a4aa3,_0x3255e1){return _0x1a4aa3[_0xac64('0x8')](_0xac64('0x9'),attributes,{'tableName':_0xac64('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xac64('0xb'),'collate':_0xac64('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 983b3b0..b8945fd 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 _0xb328=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0xb328,0xcc));var _0x8b32=function(_0x3dfbab,_0x3c72ab){_0x3dfbab=_0x3dfbab-0x0;var _0x5e5f9e=_0xb328[_0x3dfbab];return _0x5e5f9e;};'use strict';var _=require(_0x8b32('0x0'));var util=require(_0x8b32('0x1'));var moment=require(_0x8b32('0x2'));var BPromise=require('bluebird');var rs=require(_0x8b32('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8b32('0x4'));var logger=require(_0x8b32('0x5'))('rpc');var config=require(_0x8b32('0x6'));var jayson=require(_0x8b32('0x7'));var client=jayson[_0x8b32('0x8')][_0x8b32('0x9')]({'port':0x232a});config[_0x8b32('0xa')]=_[_0x8b32('0xb')](config[_0x8b32('0xa')],{'host':_0x8b32('0xc'),'port':0x18eb});var socket=require(_0x8b32('0xd'))(new Redis(config['redis']));require(_0x8b32('0xe'))[_0x8b32('0xf')](socket);function respondWithRpcPromise(_0xe0b9ac,_0x4626ea,_0x3f8b02){return new BPromise(function(_0x2e15bc,_0x369685){return client[_0x8b32('0x10')](_0xe0b9ac,_0x3f8b02)[_0x8b32('0x11')](function(_0x6ee6f1){logger[_0x8b32('0x12')](_0x8b32('0x13'),_0x4626ea,_0x8b32('0x14'));logger[_0x8b32('0x15')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x4626ea,_0x8b32('0x14'),JSON[_0x8b32('0x16')](_0x6ee6f1));if(_0x6ee6f1[_0x8b32('0x17')]){if(_0x6ee6f1['error'][_0x8b32('0x18')]===0x1f4){logger[_0x8b32('0x17')](_0x8b32('0x13'),_0x4626ea,_0x6ee6f1['error']['message']);return _0x369685(_0x6ee6f1[_0x8b32('0x17')][_0x8b32('0x19')]);}logger['error'](_0x8b32('0x13'),_0x4626ea,_0x6ee6f1[_0x8b32('0x17')][_0x8b32('0x19')]);return _0x2e15bc(_0x6ee6f1['error'][_0x8b32('0x19')]);}else{logger[_0x8b32('0x12')](_0x8b32('0x13'),_0x4626ea,_0x8b32('0x14'));_0x2e15bc(_0x6ee6f1[_0x8b32('0x1a')][_0x8b32('0x19')]);}})[_0x8b32('0x1b')](function(_0x21fba0){logger[_0x8b32('0x17')](_0x8b32('0x13'),_0x4626ea,_0x21fba0);_0x369685(_0x21fba0);});});}
\ No newline at end of file
+var _0x1500=['message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','then','info','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','ChatInternalMessage,\x20%s,\x20%s'];(function(_0x10cd30,_0x4b81ff){var _0x3ddb1f=function(_0x31ed6e){while(--_0x31ed6e){_0x10cd30['push'](_0x10cd30['shift']());}};_0x3ddb1f(++_0x4b81ff);}(_0x1500,0x191));var _0x0150=function(_0x4ece98,_0x1e27fe){_0x4ece98=_0x4ece98-0x0;var _0x3ea267=_0x1500[_0x4ece98];return _0x3ea267;};'use strict';var _=require('lodash');var util=require(_0x0150('0x0'));var moment=require(_0x0150('0x1'));var BPromise=require('bluebird');var rs=require(_0x0150('0x2'));var fs=require('fs');var Redis=require(_0x0150('0x3'));var db=require(_0x0150('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0150('0x5'))('rpc');var config=require(_0x0150('0x6'));var jayson=require(_0x0150('0x7'));var client=jayson[_0x0150('0x8')][_0x0150('0x9')]({'port':0x232a});config[_0x0150('0xa')]=_[_0x0150('0xb')](config[_0x0150('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x0150('0xc'))(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a7c48,_0x19eccc,_0x3b7892){return new BPromise(function(_0x480898,_0x5bc7ed){return client['request'](_0x2a7c48,_0x3b7892)[_0x0150('0xd')](function(_0x3a2c1a){logger[_0x0150('0xe')]('ChatInternalMessage,\x20%s,\x20%s',_0x19eccc,_0x0150('0xf'));logger['debug'](_0x0150('0x10'),_0x19eccc,_0x0150('0xf'),JSON['stringify'](_0x3a2c1a));if(_0x3a2c1a[_0x0150('0x11')]){if(_0x3a2c1a['error']['code']===0x1f4){logger[_0x0150('0x11')](_0x0150('0x12'),_0x19eccc,_0x3a2c1a['error'][_0x0150('0x13')]);return _0x5bc7ed(_0x3a2c1a[_0x0150('0x11')][_0x0150('0x13')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x19eccc,_0x3a2c1a[_0x0150('0x11')][_0x0150('0x13')]);return _0x480898(_0x3a2c1a['error']['message']);}else{logger[_0x0150('0xe')](_0x0150('0x12'),_0x19eccc,_0x0150('0xf'));_0x480898(_0x3a2c1a['result'][_0x0150('0x13')]);}})[_0x0150('0x14')](function(_0x3d3d68){logger[_0x0150('0x11')](_0x0150('0x12'),_0x19eccc,_0x3d3d68);_0x5bc7ed(_0x3d3d68);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 4ff625f..587deb9 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 _0x0cde=['register','length','./chatInternalMessage.events','save','remove','update','removeListener'];(function(_0x5de6c3,_0xed0683){var _0x56aef2=function(_0x369c6f){while(--_0x369c6f){_0x5de6c3['push'](_0x5de6c3['shift']());}};_0x56aef2(++_0xed0683);}(_0x0cde,0x160));var _0xe0cd=function(_0x4a69d2,_0x2a5b1c){_0x4a69d2=_0x4a69d2-0x0;var _0x1e526a=_0x0cde[_0x4a69d2];return _0x1e526a;};'use strict';var ChatInternalMessageEvents=require(_0xe0cd('0x0'));var events=[_0xe0cd('0x1'),_0xe0cd('0x2'),_0xe0cd('0x3')];function createListener(_0x62c92a,_0x3d75bb){return function(_0x5dddbc){_0x3d75bb['emit'](_0x62c92a,_0x5dddbc);};}function removeListener(_0x3a7956,_0x47f17c){return function(){ChatInternalMessageEvents[_0xe0cd('0x4')](_0x3a7956,_0x47f17c);};}exports[_0xe0cd('0x5')]=function(_0x2a2772){for(var _0x1cb633=0x0,_0x466f08=events[_0xe0cd('0x6')];_0x1cb633<_0x466f08;_0x1cb633++){var _0x114237=events[_0x1cb633];var _0x740481=createListener('chatInternalMessage:'+_0x114237,_0x2a2772);ChatInternalMessageEvents['on'](_0x114237,_0x740481);}};
\ No newline at end of file
+var _0x0beb=['update','emit','removeListener','length','save','remove'];(function(_0x20fcb9,_0x9378f9){var _0x310541=function(_0x2cc9fa){while(--_0x2cc9fa){_0x20fcb9['push'](_0x20fcb9['shift']());}};_0x310541(++_0x9378f9);}(_0x0beb,0x64));var _0xb0be=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x0beb[_0x8c43de];return _0xa6591b;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xb0be('0x0'),_0xb0be('0x1'),_0xb0be('0x2')];function createListener(_0x4a5ea7,_0x249d8b){return function(_0x42e4ea){_0x249d8b[_0xb0be('0x3')](_0x4a5ea7,_0x42e4ea);};}function removeListener(_0x4d7d86,_0x9445bb){return function(){ChatInternalMessageEvents[_0xb0be('0x4')](_0x4d7d86,_0x9445bb);};}exports['register']=function(_0xb34aaf){for(var _0x2283dc=0x0,_0x38047b=events[_0xb0be('0x5')];_0x2283dc<_0x38047b;_0x2283dc++){var _0x3ef08e=events[_0x2283dc];var _0x45ac6c=createListener('chatInternalMessage:'+_0x3ef08e,_0xb34aaf);ChatInternalMessageEvents['on'](_0x3ef08e,_0x45ac6c);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 5554343..7b7a188 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 _0x7b6e=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/users','getUsers','/:id','show','post','put'];(function(_0x1df3c2,_0x1d6965){var _0x14c889=function(_0x3219f0){while(--_0x3219f0){_0x1df3c2['push'](_0x1df3c2['shift']());}};_0x14c889(++_0x1d6965);}(_0x7b6e,0x15d));var _0xe7b6=function(_0x17e3c4,_0x821010){_0x17e3c4=_0x17e3c4-0x0;var _0x2211b9=_0x7b6e[_0x17e3c4];return _0x2211b9;};'use strict';var multer=require(_0xe7b6('0x0'));var util=require(_0xe7b6('0x1'));var path=require(_0xe7b6('0x2'));var timeout=require(_0xe7b6('0x3'));var express=require('express');var router=express[_0xe7b6('0x4')]();var fs_extra=require(_0xe7b6('0x5'));var auth=require(_0xe7b6('0x6'));var interaction=require(_0xe7b6('0x7'));var config=require(_0xe7b6('0x8'));var controller=require('./chatInternalMessage.controller');router[_0xe7b6('0x9')]('/',auth[_0xe7b6('0xa')](),controller[_0xe7b6('0xb')]);router[_0xe7b6('0x9')]('/describe',auth[_0xe7b6('0xa')](),controller[_0xe7b6('0xc')]);router[_0xe7b6('0x9')](_0xe7b6('0xd'),auth['isAuthenticated'](),controller[_0xe7b6('0xe')]);router[_0xe7b6('0x9')](_0xe7b6('0xf'),auth['isAuthenticated'](),controller[_0xe7b6('0x10')]);router[_0xe7b6('0x11')]('/',auth[_0xe7b6('0xa')](),controller['create']);router[_0xe7b6('0x12')]('/:id',controller[_0xe7b6('0x13')]);router[_0xe7b6('0x14')](_0xe7b6('0xf'),auth[_0xe7b6('0xa')](),controller[_0xe7b6('0x15')]);module[_0xe7b6('0x16')]=router;
\ No newline at end of file
+var _0xe885=['/users','/:id','show','isAuthenticated','create','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','index','get','/describe','describe'];(function(_0x44a4cd,_0xf7df2d){var _0x34b7db=function(_0x11ab4e){while(--_0x11ab4e){_0x44a4cd['push'](_0x44a4cd['shift']());}};_0x34b7db(++_0xf7df2d);}(_0xe885,0x1bc));var _0x5e88=function(_0x909083,_0x4f84a8){_0x909083=_0x909083-0x0;var _0x5a4a19=_0xe885[_0x909083];return _0x5a4a19;};'use strict';var multer=require(_0x5e88('0x0'));var util=require(_0x5e88('0x1'));var path=require('path');var timeout=require(_0x5e88('0x2'));var express=require(_0x5e88('0x3'));var router=express['Router']();var fs_extra=require(_0x5e88('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5e88('0x5'));var config=require(_0x5e88('0x6'));var controller=require(_0x5e88('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x5e88('0x8')]);router[_0x5e88('0x9')](_0x5e88('0xa'),auth['isAuthenticated'](),controller[_0x5e88('0xb')]);router[_0x5e88('0x9')](_0x5e88('0xc'),auth['isAuthenticated'](),controller['getUsers']);router[_0x5e88('0x9')](_0x5e88('0xd'),auth['isAuthenticated'](),controller[_0x5e88('0xe')]);router['post']('/',auth[_0x5e88('0xf')](),controller[_0x5e88('0x10')]);router['put']('/:id',controller['update']);router[_0x5e88('0x11')](_0x5e88('0xd'),auth[_0x5e88('0xf')](),controller[_0x5e88('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 653b687..4b7a21b 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 _0xd509=['STRING','TEXT','medium','BOOLEAN','out'];(function(_0x1792ae,_0x3738a3){var _0x379871=function(_0x5d5195){while(--_0x5d5195){_0x1792ae['push'](_0x1792ae['shift']());}};_0x379871(++_0x3738a3);}(_0xd509,0xc9));var _0x9d50=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd509[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x9d50('0x0')](_0x9d50('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x9d50('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x9d50('0x3')),'defaultValue':_0x9d50('0x3'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x9d50('0x4')]},'providerResponse':{'type':Sequelize[_0x9d50('0x0')]}};
\ No newline at end of file
+var _0x585e=['out','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x36ee93,_0x502135){var _0x2a936c=function(_0xb6659c){while(--_0xb6659c){_0x36ee93['push'](_0x36ee93['shift']());}};_0x2a936c(++_0x502135);}(_0x585e,0x1c2));var _0xe585=function(_0x46ac62,_0x1124dd){_0x46ac62=_0x46ac62-0x0;var _0x935f5c=_0x585e[_0x46ac62];return _0x935f5c;};'use strict';var Sequelize=require(_0xe585('0x0'));module[_0xe585('0x1')]={'body':{'type':Sequelize[_0xe585('0x2')](_0xe585('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xe585('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xe585('0x5')),'defaultValue':_0xe585('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xe585('0x6')]},'providerResponse':{'type':Sequelize[_0xe585('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 8f1f821..5d41e1e 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 _0x995d=['length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','name','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','internal','rejectmessage','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','send','index','map','ChatMessage','fieldName','type','model','query','filters','intersection','attributes','fields'];(function(_0x5c4691,_0x348823){var _0x4d8745=function(_0x34ea97){while(--_0x34ea97){_0x5c4691['push'](_0x5c4691['shift']());}};_0x4d8745(++_0x348823);}(_0x995d,0xc6));var _0xd995=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x995d[_0x6cf19c];return _0xce14f3;};'use strict';var emlformat=require(_0xd995('0x0'));var rimraf=require(_0xd995('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd995('0x2'));var rp=require('request-promise');var moment=require(_0xd995('0x3'));var BPromise=require(_0xd995('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd995('0x5'));var sox=require(_0xd995('0x6'));var csv=require(_0xd995('0x7'));var ejs=require(_0xd995('0x8'));var fs=require('fs');var fs_extra=require(_0xd995('0x9'));var _=require(_0xd995('0xa'));var squel=require('squel');var crypto=require(_0xd995('0xb'));var jsforce=require(_0xd995('0xc'));var deskjs=require(_0xd995('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd995('0xe'));var Papa=require(_0xd995('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd995('0x10'));var as=require(_0xd995('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd995('0x12'))(_0xd995('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd995('0x14'));var db=require('../../mysqldb')['db'];config[_0xd995('0x15')]=_[_0xd995('0x16')](config['redis'],{'host':_0xd995('0x17'),'port':0x18eb});var socket=require(_0xd995('0x18'))(new Redis(config[_0xd995('0x15')]));require('./chatMessage.socket')['register'](socket);var jayson=require(_0xd995('0x19'));var client=jayson[_0xd995('0x1a')]['http']({'port':0x232c});var client9002=jayson['client'][_0xd995('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x19d2b3,_0xf2fb86,_0x2e5243,_0x279a9e){return new BPromise(function(_0x3d093b,_0x2f5518){var _0x4db916=_0x279a9e||client;return _0x4db916['request'](_0x19d2b3,_0x2e5243)['then'](function(_0x100934){logger[_0xd995('0x1c')](_0xd995('0x1d'),_0xf2fb86,'request\x20sent');logger[_0xd995('0x1e')](_0xd995('0x1f'),_0xf2fb86,'request\x20sent',JSON[_0xd995('0x20')](_0x100934));if(_0x100934[_0xd995('0x21')]){if(_0x100934['error']['code']===0x1f4){logger[_0xd995('0x21')](_0xd995('0x1d'),_0xf2fb86,_0x100934[_0xd995('0x21')]['message']);return _0x2f5518(_0x100934[_0xd995('0x21')][_0xd995('0x22')]);}logger[_0xd995('0x21')]('ChatMessage,\x20%s,\x20%s',_0xf2fb86,_0x100934[_0xd995('0x21')]['message']);return _0x3d093b(_0x100934[_0xd995('0x21')][_0xd995('0x22')]);}else{logger[_0xd995('0x1c')]('ChatMessage,\x20%s,\x20%s',_0xf2fb86,_0xd995('0x23'));_0x3d093b(_0x100934[_0xd995('0x24')]['message']);}})[_0xd995('0x25')](function(_0x57c119){logger['error'](_0xd995('0x1d'),_0xf2fb86,_0x57c119);_0x2f5518(_0x57c119);});});}function respondWithStatusCode(_0x44cd00,_0x29bf7a){_0x29bf7a=_0x29bf7a||0xcc;return function(_0x16658a){if(_0x16658a){return _0x44cd00[_0xd995('0x26')](_0x29bf7a);}return _0x44cd00[_0xd995('0x27')](_0x29bf7a)[_0xd995('0x28')]();};}function respondWithResult(_0x237808,_0xefcdfb){_0xefcdfb=_0xefcdfb||0xc8;return function(_0xd5cf5c){if(_0xd5cf5c){return _0x237808[_0xd995('0x27')](_0xefcdfb)['json'](_0xd5cf5c);}};}function respondWithFilteredResult(_0x3da293,_0x3c1828){return function(_0x16bb83){if(_0x16bb83){var _0x380146=typeof _0x3c1828[_0xd995('0x29')]==='undefined'&&typeof _0x3c1828[_0xd995('0x2a')]===_0xd995('0x2b');var _0x4d916a=_0x16bb83[_0xd995('0x2c')];var _0x1b9259=_0x380146?0x0:_0x3c1828[_0xd995('0x29')];var _0x5928bf=_0x380146?_0x16bb83['count']:_0x3c1828[_0xd995('0x29')]+_0x3c1828[_0xd995('0x2a')];var _0x3002b5;if(_0x5928bf>=_0x4d916a){_0x5928bf=_0x4d916a;_0x3002b5=0xc8;}else{_0x3002b5=0xce;}_0x3da293[_0xd995('0x27')](_0x3002b5);return _0x3da293[_0xd995('0x2d')](_0xd995('0x2e'),_0x1b9259+'-'+_0x5928bf+'/'+_0x4d916a)[_0xd995('0x2f')](_0x16bb83);}return null;};}function patchUpdates(_0x541940){return function(_0x53d27b){try{jsonpatch[_0xd995('0x30')](_0x53d27b,_0x541940,!![]);}catch(_0x17a802){return BPromise[_0xd995('0x31')](_0x17a802);}return _0x53d27b['save']();};}function saveUpdates(_0x395259,_0x5d06d1){return function(_0x9c9da){if(_0x9c9da){return _0x9c9da[_0xd995('0x32')](_0x395259)['then'](function(_0x211f8b){return _0x211f8b;});}return null;};}function removeEntity(_0x186b16,_0xac9a3b){return function(_0x4dd94b){if(_0x4dd94b){return _0x4dd94b['destroy']()[_0xd995('0x33')](function(){_0x186b16[_0xd995('0x27')](0xcc)[_0xd995('0x28')]();});}};}function handleEntityNotFound(_0x3c545b,_0x16ad9b){return function(_0x314d8c){if(!_0x314d8c){_0x3c545b['sendStatus'](0x194);}return _0x314d8c;};}function handleError(_0x3ce6a3,_0x3409ee){_0x3409ee=_0x3409ee||0x1f4;return function(_0x4267d3){logger[_0xd995('0x21')](_0x4267d3['stack']);if(_0x4267d3['name']){delete _0x4267d3['name'];}_0x3ce6a3['status'](_0x3409ee)[_0xd995('0x34')](_0x4267d3);};}exports[_0xd995('0x35')]=function(_0x494d17,_0x48a638){var _0x184e46={},_0x568994={},_0x58bcba={'count':0x0,'rows':[]};var _0x41d9ac=_[_0xd995('0x36')](db[_0xd995('0x37')]['rawAttributes'],function(_0x502caf){return{'name':_0x502caf[_0xd995('0x38')],'type':_0x502caf[_0xd995('0x39')]['key']};});_0x568994[_0xd995('0x3a')]=_[_0xd995('0x36')](_0x41d9ac,'name');_0x568994[_0xd995('0x3b')]=_['keys'](_0x494d17[_0xd995('0x3b')]);_0x568994[_0xd995('0x3c')]=_[_0xd995('0x3d')](_0x568994['model'],_0x568994[_0xd995('0x3b')]);_0x184e46[_0xd995('0x3e')]=_[_0xd995('0x3d')](_0x568994['model'],qs[_0xd995('0x3f')](_0x494d17[_0xd995('0x3b')][_0xd995('0x3f')]));_0x184e46[_0xd995('0x3e')]=_0x184e46[_0xd995('0x3e')][_0xd995('0x40')]?_0x184e46[_0xd995('0x3e')]:_0x568994['model'];if(!_0x494d17[_0xd995('0x3b')][_0xd995('0x41')](_0xd995('0x42'))){_0x184e46[_0xd995('0x2a')]=qs[_0xd995('0x2a')](_0x494d17[_0xd995('0x3b')][_0xd995('0x2a')]);_0x184e46[_0xd995('0x29')]=qs[_0xd995('0x29')](_0x494d17[_0xd995('0x3b')][_0xd995('0x29')]);}_0x184e46[_0xd995('0x43')]=qs[_0xd995('0x44')](_0x494d17[_0xd995('0x3b')][_0xd995('0x44')]);_0x184e46['where']=qs[_0xd995('0x3c')](_[_0xd995('0x45')](_0x494d17[_0xd995('0x3b')],_0x568994[_0xd995('0x3c')]),_0x41d9ac);if(_0x494d17['query'][_0xd995('0x46')]){_0x184e46[_0xd995('0x47')]=_[_0xd995('0x48')](_0x184e46[_0xd995('0x47')],{'$or':_[_0xd995('0x36')](_0x41d9ac,function(_0x1b5adc){if(_0x1b5adc['type']!==_0xd995('0x49')){var _0x33aabf={};_0x33aabf[_0x1b5adc[_0xd995('0x4a')]]={'$like':'%'+_0x494d17['query'][_0xd995('0x46')]+'%'};return _0x33aabf;}})});}_0x184e46=_[_0xd995('0x48')]({},_0x184e46,_0x494d17[_0xd995('0x4b')]);var _0xa3b593={'where':_0x184e46[_0xd995('0x47')]};return db[_0xd995('0x37')]['count'](_0xa3b593)[_0xd995('0x33')](function(_0x1c5453){_0x58bcba[_0xd995('0x2c')]=_0x1c5453;if(_0x494d17[_0xd995('0x3b')]['includeAll']){_0x184e46[_0xd995('0x4c')]=[{'all':!![]}];}return db['ChatMessage'][_0xd995('0x4d')](_0x184e46);})[_0xd995('0x33')](function(_0x414bea){_0x58bcba[_0xd995('0x4e')]=_0x414bea;return _0x58bcba;})['then'](respondWithFilteredResult(_0x48a638,_0x184e46))[_0xd995('0x25')](handleError(_0x48a638,null));};exports[_0xd995('0x4f')]=function(_0x117470,_0x231748){var _0x2deb14={'raw':!![],'where':{'id':_0x117470[_0xd995('0x50')]['id']}},_0x3d3bad={};_0x3d3bad[_0xd995('0x3a')]=_[_0xd995('0x51')](db[_0xd995('0x37')][_0xd995('0x52')]);_0x3d3bad[_0xd995('0x3b')]=_[_0xd995('0x51')](_0x117470[_0xd995('0x3b')]);_0x3d3bad[_0xd995('0x3c')]=_['intersection'](_0x3d3bad[_0xd995('0x3a')],_0x3d3bad[_0xd995('0x3b')]);_0x2deb14['attributes']=_[_0xd995('0x3d')](_0x3d3bad[_0xd995('0x3a')],qs[_0xd995('0x3f')](_0x117470[_0xd995('0x3b')]['fields']));_0x2deb14['attributes']=_0x2deb14[_0xd995('0x3e')][_0xd995('0x40')]?_0x2deb14[_0xd995('0x3e')]:_0x3d3bad[_0xd995('0x3a')];if(_0x117470['query'][_0xd995('0x53')]){_0x2deb14[_0xd995('0x4c')]=[{'all':!![]}];}_0x2deb14=_[_0xd995('0x48')]({},_0x2deb14,_0x117470['options']);return db[_0xd995('0x37')][_0xd995('0x54')](_0x2deb14)[_0xd995('0x33')](handleEntityNotFound(_0x231748,null))[_0xd995('0x33')](respondWithResult(_0x231748,null))[_0xd995('0x25')](handleError(_0x231748,null));};exports[_0xd995('0x55')]=function(_0x2fd728,_0x540cc7){return db[_0xd995('0x37')][_0xd995('0x55')](_0x2fd728[_0xd995('0x56')],{})[_0xd995('0x33')](respondWithResult(_0x540cc7,0xc9))[_0xd995('0x25')](handleError(_0x540cc7,null));};exports[_0xd995('0x32')]=function(_0x3b28f0,_0x3c0e45){if(_0x3b28f0[_0xd995('0x56')]['id']){delete _0x3b28f0[_0xd995('0x56')]['id'];}return db[_0xd995('0x37')][_0xd995('0x54')]({'where':{'id':_0x3b28f0[_0xd995('0x50')]['id']}})['then'](handleEntityNotFound(_0x3c0e45,null))['then'](saveUpdates(_0x3b28f0[_0xd995('0x56')],null))['then'](respondWithResult(_0x3c0e45,null))[_0xd995('0x25')](handleError(_0x3c0e45,null));};exports['destroy']=function(_0xb3a5ee,_0x51fafb){return db['ChatMessage']['find']({'where':{'id':_0xb3a5ee[_0xd995('0x50')]['id']}})[_0xd995('0x33')](handleEntityNotFound(_0x51fafb,null))['then'](removeEntity(_0x51fafb,null))[_0xd995('0x25')](handleError(_0x51fafb,null));};exports[_0xd995('0x57')]=function(_0x1d0fc3,_0x51d0b7){return db[_0xd995('0x37')]['describe']()[_0xd995('0x33')](respondWithResult(_0x51d0b7,null))['catch'](handleError(_0x51d0b7,null));};var interaction_log=require(_0xd995('0x12'))(_0xd995('0x58'));exports[_0xd995('0x59')]=function(_0x4b30da,_0x37803d,_0x507740){var _0x26d531={'agent':{},'channel':_0xd995('0x5a')};if(_0x4b30da[_0xd995('0x56')]['id']){delete _0x4b30da[_0xd995('0x56')]['id'];}_0x4b30da[_0xd995('0x56')][_0xd995('0x5b')]=!![];_0x4b30da[_0xd995('0x56')][_0xd995('0x5c')]=moment()[_0xd995('0x5d')](_0xd995('0x5e'));_0x4b30da['body']['UserId']=_0x4b30da[_0xd995('0x56')][_0xd995('0x5f')]||_0x4b30da[_0xd995('0x60')]['id'];_0x26d531[_0xd995('0x61')]['id']=_0x4b30da[_0xd995('0x56')]['UserId'];return db['ChatMessage']['find']({'where':{'id':_0x4b30da[_0xd995('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x37803d,null))['then'](saveUpdates(_0x4b30da['body'],null))[_0xd995('0x33')](function(_0x26f8d2){if(_0x26f8d2){_0x26d531['message']=_0x26f8d2[_0xd995('0x62')]({'plain':!![]});return db['ChatInteraction'][_0xd995('0x54')]({'where':{'id':_0x26f8d2[_0xd995('0x63')]}});}return null;})[_0xd995('0x33')](handleEntityNotFound(_0x37803d,null))['then'](function(_0x4de3dc){if(_0x4de3dc){return _0x4de3dc[_0xd995('0x32')]({'UserId':_0x4b30da['body']['UserId'],'read1stAt':_[_0xd995('0x64')](_0x4de3dc[_0xd995('0x65')])?moment()[_0xd995('0x5d')](_0xd995('0x5e')):undefined});}return null;})['then'](function(_0xd9f5a){if(_0xd9f5a){_0x26d531['interaction']=_0xd9f5a[_0xd995('0x62')]({'plain':!![]});interaction_log[_0xd995('0x1c')](_0xd995('0x66'),_0x4b30da['user']['id'],_0x4b30da[_0xd995('0x60')]['name'],_0x4b30da[_0xd995('0x60')][_0xd995('0x67')],_0x26d531[_0xd995('0x68')]['id'],_0x4b30da[_0xd995('0x56')]?JSON[_0xd995('0x20')](_0x4b30da[_0xd995('0x56')]):'null');return respondWithRpcPromise('AcceptMessage',_0xd995('0x69'),_0x26d531);}return null;})[_0xd995('0x33')](function(_0xf061f0){var _0x16728c=_0xd995('0x6a')+_0xf061f0[_0xd995('0x22')][_0xd995('0x6b')];return db[_0xd995('0x6c')][_0xd995('0x3b')](_0x16728c,{'type':db[_0xd995('0x6d')][_0xd995('0x6e')][_0xd995('0x6f')],'raw':!![]})['then'](function(_0xefe774){return _0xefe774;});})[_0xd995('0x33')](function(_0x41c11a){if(_0x41c11a){_0x26d531[_0xd995('0x22')][_0xd995('0x70')]=_0x41c11a[0x0];if(!_0x4b30da[_0xd995('0x56')][_0xd995('0x5f')])return;return db[_0xd995('0x71')][_0xd995('0x54')]({'where':{'id':_0x4b30da[_0xd995('0x56')][_0xd995('0x5f')],'role':_0xd995('0x61')},'attributes':['id',_0xd995('0x4a'),_0xd995('0x72'),_0xd995('0x73'),'internal'],'raw':!![]});}return null;})[_0xd995('0x33')](function(_0xcfb040){if(!_0xcfb040)return null;_0x26d531[_0xd995('0x22')][_0xd995('0x61')]=_0xcfb040;return _0x26d531;})[_0xd995('0x33')](function(_0x62663){if(_0x62663){if(_0x4b30da['body'][_0xd995('0x74')]){_0x26d531['message'][_0xd995('0x75')]=util[_0xd995('0x5d')](_0xd995('0x76'),_0x4b30da['user'][_0xd995('0x4a')]);_0x26d531[_0xd995('0x22')][_0xd995('0x77')]=_0x26d531[_0xd995('0x77')];_0x26d531[_0xd995('0x22')][_0xd995('0x78')]=_0x26d531['channel'];_0x26d531[_0xd995('0x22')][_0xd995('0x79')]='accept';return respondWithRpcPromise(_0xd995('0x7a'),_0xd995('0x7a'),{'event':_0xd995('0x7b'),'message':_['merge'](_0x26d531[_0xd995('0x22')],JSON['parse'](_0x26d531[_0xd995('0x68')][_0xd995('0x7c')]))},client9002)['then'](function(){return _0x26d531;});}return _0x26d531;}return null;})[_0xd995('0x33')](respondWithResult(_0x37803d,null))[_0xd995('0x25')](handleError(_0x37803d,null));};var interaction_log=require(_0xd995('0x12'))('chat-interactions');exports['reject']=function(_0x54d980,_0x5ce67e,_0x30cb01){var _0x4039b8={'agent':{},'channel':_0xd995('0x5a')};if(_0x54d980[_0xd995('0x56')]['id']){delete _0x54d980[_0xd995('0x56')]['id'];}_0x54d980[_0xd995('0x56')][_0xd995('0x5f')]=_0x54d980['body'][_0xd995('0x5f')]||_0x54d980['user']['id'];_0x4039b8['agent']['id']=_0x54d980[_0xd995('0x56')][_0xd995('0x5f')];return db[_0xd995('0x37')][_0xd995('0x54')]({'where':{'id':_0x54d980[_0xd995('0x50')]['id'],'UserId':null}})[_0xd995('0x33')](handleEntityNotFound(_0x5ce67e,null))[_0xd995('0x33')](function(_0x225708){if(_0x225708){_0x4039b8['message']=_0x225708[_0xd995('0x62')]({'plain':!![]});return db[_0xd995('0x7d')][_0xd995('0x54')]({'where':{'id':_0x225708['ChatInteractionId']}});}return null;})[_0xd995('0x33')](handleEntityNotFound(_0x5ce67e,null))[_0xd995('0x33')](function(_0x4b325f){if(_0x4b325f){_0x4039b8[_0xd995('0x68')]=_0x4b325f[_0xd995('0x62')]({'plain':!![]});interaction_log[_0xd995('0x1c')](_0xd995('0x7e'),_0x54d980[_0xd995('0x60')]['id'],_0x54d980['user'][_0xd995('0x4a')],_0x54d980[_0xd995('0x60')][_0xd995('0x67')],_0x4039b8[_0xd995('0x68')]['id'],_0x54d980['body']?JSON[_0xd995('0x20')](_0x54d980[_0xd995('0x56')]):_0xd995('0x7f'));return respondWithRpcPromise('RejectMessage',_0xd995('0x80'),_0x4039b8);}return null;})[_0xd995('0x33')](function(_0x469adc){var _0x5b4c00='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x469adc['message'][_0xd995('0x6b')];return db[_0xd995('0x6c')][_0xd995('0x3b')](_0x5b4c00,{'type':db[_0xd995('0x6d')][_0xd995('0x6e')]['SELECT'],'raw':!![]})['then'](function(_0xa07f8){return _0xa07f8;});})[_0xd995('0x33')](function(_0x441edf){if(_0x441edf){_0x4039b8[_0xd995('0x22')][_0xd995('0x70')]=_0x441edf[0x0];if(!_0x54d980[_0xd995('0x56')][_0xd995('0x5f')])return;return db[_0xd995('0x71')][_0xd995('0x54')]({'where':{'id':_0x54d980['body'][_0xd995('0x5f')],'role':_0xd995('0x61')},'attributes':['id',_0xd995('0x4a'),_0xd995('0x72'),'email',_0xd995('0x81')],'raw':!![]});}return null;})['then'](function(_0x4eb70c){if(!_0x4eb70c)return null;_0x4039b8[_0xd995('0x22')][_0xd995('0x61')]=_0x4eb70c;return _0x4039b8;})[_0xd995('0x33')](function(_0x4dfc30){if(_0x4dfc30){_0x4dfc30[_0xd995('0x22')][_0xd995('0x75')]=util['format'](_0xd995('0x76'),_0x54d980['user'][_0xd995('0x4a')]);_0x4dfc30[_0xd995('0x22')]['channel']=_0x4039b8['channel'];_0x4dfc30[_0xd995('0x22')][_0xd995('0x78')]=_0x4039b8[_0xd995('0x77')];_0x4dfc30['message'][_0xd995('0x79')]=_0xd995('0x31');respondWithRpcPromise(_0xd995('0x7a'),'EventManager',{'event':_0xd995('0x82'),'message':_[_0xd995('0x48')](_0x4039b8['message'],JSON['parse'](_0x4039b8[_0xd995('0x68')]['formData']))},client9002);return _0x4039b8;}return null;})[_0xd995('0x33')](respondWithResult(_0x5ce67e,null))[_0xd995('0x25')](handleError(_0x5ce67e,null));};
\ No newline at end of file
+var _0x0a8a=['../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','http','client','then','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','index','ChatMessage','rawAttributes','fieldName','type','model','map','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','options','include','findAll','rows','params','length','includeAll','create','body','find','describe','chat-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','stringify','acceptMessage','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','channel','motionChannel','event','EventManager','parse','formData','chat','ChatInteractionId','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','internal','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0xfab3ef,_0x36ef33){var _0x59de7a=function(_0x3654d1){while(--_0x3654d1){_0xfab3ef['push'](_0xfab3ef['shift']());}};_0x59de7a(++_0x36ef33);}(_0x0a8a,0xee));var _0xa0a8=function(_0x2a607c,_0x2c0ede){_0x2a607c=_0x2a607c-0x0;var _0x46f19a=_0x0a8a[_0x2a607c];return _0x46f19a;};'use strict';var emlformat=require(_0xa0a8('0x0'));var rimraf=require(_0xa0a8('0x1'));var zipdir=require(_0xa0a8('0x2'));var jsonpatch=require(_0xa0a8('0x3'));var rp=require(_0xa0a8('0x4'));var moment=require('moment');var BPromise=require(_0xa0a8('0x5'));var Mustache=require(_0xa0a8('0x6'));var util=require(_0xa0a8('0x7'));var path=require('path');var sox=require(_0xa0a8('0x8'));var csv=require(_0xa0a8('0x9'));var ejs=require(_0xa0a8('0xa'));var fs=require('fs');var fs_extra=require(_0xa0a8('0xb'));var _=require(_0xa0a8('0xc'));var squel=require(_0xa0a8('0xd'));var crypto=require(_0xa0a8('0xe'));var jsforce=require(_0xa0a8('0xf'));var deskjs=require(_0xa0a8('0x10'));var toCsv=require(_0xa0a8('0x9'));var querystring=require(_0xa0a8('0x11'));var Papa=require(_0xa0a8('0x12'));var Redis=require(_0xa0a8('0x13'));var authService=require(_0xa0a8('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xa0a8('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa0a8('0x16'))('api');var utils=require(_0xa0a8('0x17'));var config=require(_0xa0a8('0x18'));var licenseUtil=require(_0xa0a8('0x19'));var db=require(_0xa0a8('0x1a'))['db'];config['redis']=_[_0xa0a8('0x1b')](config[_0xa0a8('0x1c')],{'host':_0xa0a8('0x1d'),'port':0x18eb});var socket=require(_0xa0a8('0x1e'))(new Redis(config[_0xa0a8('0x1c')]));require(_0xa0a8('0x1f'))['register'](socket);var jayson=require(_0xa0a8('0x20'));var client=jayson['client'][_0xa0a8('0x21')]({'port':0x232c});var client9002=jayson[_0xa0a8('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e8071,_0x2a4cac,_0x314183,_0x1a114c){return new BPromise(function(_0x249c6a,_0x2bd500){var _0x160471=_0x1a114c||client;return _0x160471['request'](_0x2e8071,_0x314183)[_0xa0a8('0x23')](function(_0x431407){logger['info'](_0xa0a8('0x24'),_0x2a4cac,'request\x20sent');logger[_0xa0a8('0x25')](_0xa0a8('0x26'),_0x2a4cac,_0xa0a8('0x27'),JSON['stringify'](_0x431407));if(_0x431407['error']){if(_0x431407[_0xa0a8('0x28')]['code']===0x1f4){logger[_0xa0a8('0x28')](_0xa0a8('0x24'),_0x2a4cac,_0x431407[_0xa0a8('0x28')][_0xa0a8('0x29')]);return _0x2bd500(_0x431407[_0xa0a8('0x28')][_0xa0a8('0x29')]);}logger[_0xa0a8('0x28')](_0xa0a8('0x24'),_0x2a4cac,_0x431407[_0xa0a8('0x28')][_0xa0a8('0x29')]);return _0x249c6a(_0x431407[_0xa0a8('0x28')][_0xa0a8('0x29')]);}else{logger[_0xa0a8('0x2a')](_0xa0a8('0x24'),_0x2a4cac,_0xa0a8('0x27'));_0x249c6a(_0x431407['result'][_0xa0a8('0x29')]);}})[_0xa0a8('0x2b')](function(_0x59b526){logger[_0xa0a8('0x28')]('ChatMessage,\x20%s,\x20%s',_0x2a4cac,_0x59b526);_0x2bd500(_0x59b526);});});}function respondWithStatusCode(_0xc7d660,_0x4a63c6){_0x4a63c6=_0x4a63c6||0xcc;return function(_0x13e735){if(_0x13e735){return _0xc7d660[_0xa0a8('0x2c')](_0x4a63c6);}return _0xc7d660['status'](_0x4a63c6)[_0xa0a8('0x2d')]();};}function respondWithResult(_0x14569a,_0x3eaa36){_0x3eaa36=_0x3eaa36||0xc8;return function(_0xa3e19e){if(_0xa3e19e){return _0x14569a[_0xa0a8('0x2e')](_0x3eaa36)[_0xa0a8('0x2f')](_0xa3e19e);}};}function respondWithFilteredResult(_0x113284,_0x51e8d9){return function(_0x29965d){if(_0x29965d){var _0x44bfff=typeof _0x51e8d9[_0xa0a8('0x30')]===_0xa0a8('0x31')&&typeof _0x51e8d9['limit']===_0xa0a8('0x31');var _0x2c86ab=_0x29965d[_0xa0a8('0x32')];var _0x20586f=_0x44bfff?0x0:_0x51e8d9[_0xa0a8('0x30')];var _0x188ec8=_0x44bfff?_0x29965d[_0xa0a8('0x32')]:_0x51e8d9[_0xa0a8('0x30')]+_0x51e8d9[_0xa0a8('0x33')];var _0x4e0353;if(_0x188ec8>=_0x2c86ab){_0x188ec8=_0x2c86ab;_0x4e0353=0xc8;}else{_0x4e0353=0xce;}_0x113284[_0xa0a8('0x2e')](_0x4e0353);return _0x113284[_0xa0a8('0x34')](_0xa0a8('0x35'),_0x20586f+'-'+_0x188ec8+'/'+_0x2c86ab)['json'](_0x29965d);}return null;};}function patchUpdates(_0x5a964b){return function(_0x3a8e76){try{jsonpatch['apply'](_0x3a8e76,_0x5a964b,!![]);}catch(_0x2a11f7){return BPromise[_0xa0a8('0x36')](_0x2a11f7);}return _0x3a8e76[_0xa0a8('0x37')]();};}function saveUpdates(_0x456545,_0x849801){return function(_0x506c9b){if(_0x506c9b){return _0x506c9b[_0xa0a8('0x38')](_0x456545)[_0xa0a8('0x23')](function(_0x1be9f7){return _0x1be9f7;});}return null;};}function removeEntity(_0x1b8367,_0x1d19bb){return function(_0x30e996){if(_0x30e996){return _0x30e996[_0xa0a8('0x39')]()['then'](function(){_0x1b8367[_0xa0a8('0x2e')](0xcc)[_0xa0a8('0x2d')]();});}};}function handleEntityNotFound(_0x3bb556,_0x8dcf30){return function(_0x2719fc){if(!_0x2719fc){_0x3bb556[_0xa0a8('0x2c')](0x194);}return _0x2719fc;};}function handleError(_0x2b8a4f,_0x2c6e22){_0x2c6e22=_0x2c6e22||0x1f4;return function(_0x4b809d){logger[_0xa0a8('0x28')](_0x4b809d[_0xa0a8('0x3a')]);if(_0x4b809d['name']){delete _0x4b809d[_0xa0a8('0x3b')];}_0x2b8a4f[_0xa0a8('0x2e')](_0x2c6e22)['send'](_0x4b809d);};}exports[_0xa0a8('0x3c')]=function(_0x477604,_0x33515c){var _0x524a76={},_0x44eae9={},_0x1757c0={'count':0x0,'rows':[]};var _0x5404cf=_['map'](db[_0xa0a8('0x3d')][_0xa0a8('0x3e')],function(_0x3f23c6){return{'name':_0x3f23c6[_0xa0a8('0x3f')],'type':_0x3f23c6[_0xa0a8('0x40')]['key']};});_0x44eae9[_0xa0a8('0x41')]=_[_0xa0a8('0x42')](_0x5404cf,_0xa0a8('0x3b'));_0x44eae9[_0xa0a8('0x43')]=_[_0xa0a8('0x44')](_0x477604[_0xa0a8('0x43')]);_0x44eae9['filters']=_['intersection'](_0x44eae9[_0xa0a8('0x41')],_0x44eae9['query']);_0x524a76[_0xa0a8('0x45')]=_[_0xa0a8('0x46')](_0x44eae9[_0xa0a8('0x41')],qs['fields'](_0x477604[_0xa0a8('0x43')][_0xa0a8('0x47')]));_0x524a76[_0xa0a8('0x45')]=_0x524a76['attributes']['length']?_0x524a76[_0xa0a8('0x45')]:_0x44eae9[_0xa0a8('0x41')];if(!_0x477604[_0xa0a8('0x43')][_0xa0a8('0x48')](_0xa0a8('0x49'))){_0x524a76[_0xa0a8('0x33')]=qs[_0xa0a8('0x33')](_0x477604[_0xa0a8('0x43')][_0xa0a8('0x33')]);_0x524a76['offset']=qs['offset'](_0x477604[_0xa0a8('0x43')][_0xa0a8('0x30')]);}_0x524a76[_0xa0a8('0x4a')]=qs['sort'](_0x477604[_0xa0a8('0x43')]['sort']);_0x524a76[_0xa0a8('0x4b')]=qs[_0xa0a8('0x4c')](_[_0xa0a8('0x4d')](_0x477604[_0xa0a8('0x43')],_0x44eae9[_0xa0a8('0x4c')]),_0x5404cf);if(_0x477604['query'][_0xa0a8('0x4e')]){_0x524a76['where']=_[_0xa0a8('0x4f')](_0x524a76['where'],{'$or':_[_0xa0a8('0x42')](_0x5404cf,function(_0x2d5b08){if(_0x2d5b08[_0xa0a8('0x40')]!=='VIRTUAL'){var _0x41db7e={};_0x41db7e[_0x2d5b08[_0xa0a8('0x3b')]]={'$like':'%'+_0x477604[_0xa0a8('0x43')]['filter']+'%'};return _0x41db7e;}})});}_0x524a76=_[_0xa0a8('0x4f')]({},_0x524a76,_0x477604[_0xa0a8('0x50')]);var _0x23c391={'where':_0x524a76[_0xa0a8('0x4b')]};return db[_0xa0a8('0x3d')]['count'](_0x23c391)['then'](function(_0x849d9d){_0x1757c0['count']=_0x849d9d;if(_0x477604[_0xa0a8('0x43')]['includeAll']){_0x524a76[_0xa0a8('0x51')]=[{'all':!![]}];}return db['ChatMessage'][_0xa0a8('0x52')](_0x524a76);})[_0xa0a8('0x23')](function(_0x48dd7f){_0x1757c0[_0xa0a8('0x53')]=_0x48dd7f;return _0x1757c0;})[_0xa0a8('0x23')](respondWithFilteredResult(_0x33515c,_0x524a76))[_0xa0a8('0x2b')](handleError(_0x33515c,null));};exports['show']=function(_0x29e966,_0x35b938){var _0x2b106c={'raw':!![],'where':{'id':_0x29e966[_0xa0a8('0x54')]['id']}},_0x1e4094={};_0x1e4094[_0xa0a8('0x41')]=_['keys'](db[_0xa0a8('0x3d')][_0xa0a8('0x3e')]);_0x1e4094[_0xa0a8('0x43')]=_['keys'](_0x29e966[_0xa0a8('0x43')]);_0x1e4094[_0xa0a8('0x4c')]=_[_0xa0a8('0x46')](_0x1e4094[_0xa0a8('0x41')],_0x1e4094[_0xa0a8('0x43')]);_0x2b106c[_0xa0a8('0x45')]=_[_0xa0a8('0x46')](_0x1e4094[_0xa0a8('0x41')],qs['fields'](_0x29e966[_0xa0a8('0x43')][_0xa0a8('0x47')]));_0x2b106c[_0xa0a8('0x45')]=_0x2b106c['attributes'][_0xa0a8('0x55')]?_0x2b106c['attributes']:_0x1e4094[_0xa0a8('0x41')];if(_0x29e966[_0xa0a8('0x43')][_0xa0a8('0x56')]){_0x2b106c[_0xa0a8('0x51')]=[{'all':!![]}];}_0x2b106c=_['merge']({},_0x2b106c,_0x29e966[_0xa0a8('0x50')]);return db['ChatMessage']['find'](_0x2b106c)[_0xa0a8('0x23')](handleEntityNotFound(_0x35b938,null))[_0xa0a8('0x23')](respondWithResult(_0x35b938,null))[_0xa0a8('0x2b')](handleError(_0x35b938,null));};exports[_0xa0a8('0x57')]=function(_0x5cd022,_0x1cc445){return db['ChatMessage'][_0xa0a8('0x57')](_0x5cd022[_0xa0a8('0x58')],{})[_0xa0a8('0x23')](respondWithResult(_0x1cc445,0xc9))['catch'](handleError(_0x1cc445,null));};exports[_0xa0a8('0x38')]=function(_0x2c1402,_0x2b195e){if(_0x2c1402['body']['id']){delete _0x2c1402['body']['id'];}return db['ChatMessage'][_0xa0a8('0x59')]({'where':{'id':_0x2c1402[_0xa0a8('0x54')]['id']}})[_0xa0a8('0x23')](handleEntityNotFound(_0x2b195e,null))[_0xa0a8('0x23')](saveUpdates(_0x2c1402[_0xa0a8('0x58')],null))['then'](respondWithResult(_0x2b195e,null))[_0xa0a8('0x2b')](handleError(_0x2b195e,null));};exports[_0xa0a8('0x39')]=function(_0x5aef42,_0x11f82d){return db['ChatMessage'][_0xa0a8('0x59')]({'where':{'id':_0x5aef42[_0xa0a8('0x54')]['id']}})['then'](handleEntityNotFound(_0x11f82d,null))['then'](removeEntity(_0x11f82d,null))[_0xa0a8('0x2b')](handleError(_0x11f82d,null));};exports[_0xa0a8('0x5a')]=function(_0x9a922a,_0xb476aa){return db[_0xa0a8('0x3d')][_0xa0a8('0x5a')]()['then'](respondWithResult(_0xb476aa,null))[_0xa0a8('0x2b')](handleError(_0xb476aa,null));};var interaction_log=require(_0xa0a8('0x16'))(_0xa0a8('0x5b'));exports[_0xa0a8('0x5c')]=function(_0x1def63,_0x32a72a,_0x568bf5){var _0x3a8d84={'agent':{},'channel':'chat'};if(_0x1def63[_0xa0a8('0x58')]['id']){delete _0x1def63[_0xa0a8('0x58')]['id'];}_0x1def63[_0xa0a8('0x58')][_0xa0a8('0x5d')]=!![];_0x1def63[_0xa0a8('0x58')]['readAt']=moment()[_0xa0a8('0x5e')](_0xa0a8('0x5f'));_0x1def63[_0xa0a8('0x58')][_0xa0a8('0x60')]=_0x1def63[_0xa0a8('0x58')][_0xa0a8('0x60')]||_0x1def63['user']['id'];_0x3a8d84[_0xa0a8('0x61')]['id']=_0x1def63[_0xa0a8('0x58')][_0xa0a8('0x60')];return db[_0xa0a8('0x3d')][_0xa0a8('0x59')]({'where':{'id':_0x1def63[_0xa0a8('0x54')]['id'],'UserId':null}})[_0xa0a8('0x23')](handleEntityNotFound(_0x32a72a,null))[_0xa0a8('0x23')](saveUpdates(_0x1def63[_0xa0a8('0x58')],null))[_0xa0a8('0x23')](function(_0x694328){if(_0x694328){_0x3a8d84[_0xa0a8('0x29')]=_0x694328[_0xa0a8('0x62')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x694328['ChatInteractionId']}});}return null;})[_0xa0a8('0x23')](handleEntityNotFound(_0x32a72a,null))[_0xa0a8('0x23')](function(_0x12104c){if(_0x12104c){return _0x12104c[_0xa0a8('0x38')]({'UserId':_0x1def63[_0xa0a8('0x58')]['UserId'],'read1stAt':_[_0xa0a8('0x63')](_0x12104c[_0xa0a8('0x64')])?moment()['format'](_0xa0a8('0x5f')):undefined});}return null;})[_0xa0a8('0x23')](function(_0x46ba55){if(_0x46ba55){_0x3a8d84['interaction']=_0x46ba55[_0xa0a8('0x62')]({'plain':!![]});interaction_log[_0xa0a8('0x2a')](_0xa0a8('0x65'),_0x1def63['user']['id'],_0x1def63[_0xa0a8('0x66')][_0xa0a8('0x3b')],_0x1def63[_0xa0a8('0x66')][_0xa0a8('0x67')],_0x3a8d84[_0xa0a8('0x68')]['id'],_0x1def63[_0xa0a8('0x58')]?JSON[_0xa0a8('0x69')](_0x1def63[_0xa0a8('0x58')]):'null');return respondWithRpcPromise('AcceptMessage',_0xa0a8('0x6a'),_0x3a8d84);}return null;})['then'](function(_0xeb8a84){var _0x55fa56='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xeb8a84[_0xa0a8('0x29')]['ContactId'];return db['sequelize'][_0xa0a8('0x43')](_0x55fa56,{'type':db['Sequelize'][_0xa0a8('0x6b')][_0xa0a8('0x6c')],'raw':!![]})['then'](function(_0x258731){return _0x258731;});})[_0xa0a8('0x23')](function(_0x195607){if(_0x195607){_0x3a8d84[_0xa0a8('0x29')][_0xa0a8('0x6d')]=_0x195607[0x0];if(!_0x1def63[_0xa0a8('0x58')][_0xa0a8('0x60')])return;return db[_0xa0a8('0x6e')][_0xa0a8('0x59')]({'where':{'id':_0x1def63['body'][_0xa0a8('0x60')],'role':_0xa0a8('0x61')},'attributes':['id',_0xa0a8('0x3b'),_0xa0a8('0x6f'),_0xa0a8('0x70'),'internal'],'raw':!![]});}return null;})[_0xa0a8('0x23')](function(_0x52a20f){if(!_0x52a20f)return null;_0x3a8d84[_0xa0a8('0x29')][_0xa0a8('0x61')]=_0x52a20f;return _0x3a8d84;})[_0xa0a8('0x23')](function(_0x175554){if(_0x175554){if(_0x1def63[_0xa0a8('0x58')][_0xa0a8('0x71')]){_0x3a8d84[_0xa0a8('0x29')][_0xa0a8('0x72')]=util[_0xa0a8('0x5e')]('SIP/%s',_0x1def63['user'][_0xa0a8('0x3b')]);_0x3a8d84[_0xa0a8('0x29')][_0xa0a8('0x73')]=_0x3a8d84[_0xa0a8('0x73')];_0x3a8d84[_0xa0a8('0x29')][_0xa0a8('0x74')]=_0x3a8d84[_0xa0a8('0x73')];_0x3a8d84[_0xa0a8('0x29')][_0xa0a8('0x75')]=_0xa0a8('0x5c');return respondWithRpcPromise(_0xa0a8('0x76'),_0xa0a8('0x76'),{'event':'acceptmessage','message':_[_0xa0a8('0x4f')](_0x3a8d84[_0xa0a8('0x29')],JSON[_0xa0a8('0x77')](_0x3a8d84[_0xa0a8('0x68')][_0xa0a8('0x78')]))},client9002)[_0xa0a8('0x23')](function(){return _0x3a8d84;});}return _0x3a8d84;}return null;})['then'](respondWithResult(_0x32a72a,null))[_0xa0a8('0x2b')](handleError(_0x32a72a,null));};var interaction_log=require(_0xa0a8('0x16'))(_0xa0a8('0x5b'));exports['reject']=function(_0x557926,_0x4f5f4f,_0x2b6579){var _0x4491f8={'agent':{},'channel':_0xa0a8('0x79')};if(_0x557926[_0xa0a8('0x58')]['id']){delete _0x557926[_0xa0a8('0x58')]['id'];}_0x557926[_0xa0a8('0x58')][_0xa0a8('0x60')]=_0x557926[_0xa0a8('0x58')][_0xa0a8('0x60')]||_0x557926[_0xa0a8('0x66')]['id'];_0x4491f8[_0xa0a8('0x61')]['id']=_0x557926[_0xa0a8('0x58')][_0xa0a8('0x60')];return db[_0xa0a8('0x3d')][_0xa0a8('0x59')]({'where':{'id':_0x557926[_0xa0a8('0x54')]['id'],'UserId':null}})[_0xa0a8('0x23')](handleEntityNotFound(_0x4f5f4f,null))[_0xa0a8('0x23')](function(_0x53c21a){if(_0x53c21a){_0x4491f8['message']=_0x53c21a[_0xa0a8('0x62')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x53c21a[_0xa0a8('0x7a')]}});}return null;})['then'](handleEntityNotFound(_0x4f5f4f,null))[_0xa0a8('0x23')](function(_0x3423c8){if(_0x3423c8){_0x4491f8[_0xa0a8('0x68')]=_0x3423c8[_0xa0a8('0x62')]({'plain':!![]});interaction_log[_0xa0a8('0x2a')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x557926[_0xa0a8('0x66')]['id'],_0x557926[_0xa0a8('0x66')][_0xa0a8('0x3b')],_0x557926[_0xa0a8('0x66')]['role'],_0x4491f8[_0xa0a8('0x68')]['id'],_0x557926[_0xa0a8('0x58')]?JSON[_0xa0a8('0x69')](_0x557926[_0xa0a8('0x58')]):_0xa0a8('0x7b'));return respondWithRpcPromise(_0xa0a8('0x7c'),_0xa0a8('0x7d'),_0x4491f8);}return null;})['then'](function(_0x4a2f52){var _0x52e2fa=_0xa0a8('0x7e')+_0x4a2f52['message'][_0xa0a8('0x7f')];return db[_0xa0a8('0x80')][_0xa0a8('0x43')](_0x52e2fa,{'type':db[_0xa0a8('0x81')]['QueryTypes'][_0xa0a8('0x6c')],'raw':!![]})['then'](function(_0x56df63){return _0x56df63;});})[_0xa0a8('0x23')](function(_0x56928f){if(_0x56928f){_0x4491f8[_0xa0a8('0x29')][_0xa0a8('0x6d')]=_0x56928f[0x0];if(!_0x557926[_0xa0a8('0x58')]['UserId'])return;return db[_0xa0a8('0x6e')]['find']({'where':{'id':_0x557926[_0xa0a8('0x58')][_0xa0a8('0x60')],'role':'agent'},'attributes':['id','name',_0xa0a8('0x6f'),_0xa0a8('0x70'),_0xa0a8('0x82')],'raw':!![]});}return null;})[_0xa0a8('0x23')](function(_0x11f9d9){if(!_0x11f9d9)return null;_0x4491f8[_0xa0a8('0x29')]['agent']=_0x11f9d9;return _0x4491f8;})[_0xa0a8('0x23')](function(_0x9bb737){if(_0x9bb737){_0x9bb737[_0xa0a8('0x29')]['interface']=util[_0xa0a8('0x5e')]('SIP/%s',_0x557926['user']['name']);_0x9bb737[_0xa0a8('0x29')]['channel']=_0x4491f8[_0xa0a8('0x73')];_0x9bb737[_0xa0a8('0x29')][_0xa0a8('0x74')]=_0x4491f8['channel'];_0x9bb737[_0xa0a8('0x29')][_0xa0a8('0x75')]='reject';respondWithRpcPromise(_0xa0a8('0x76'),'EventManager',{'event':_0xa0a8('0x83'),'message':_[_0xa0a8('0x4f')](_0x4491f8[_0xa0a8('0x29')],JSON[_0xa0a8('0x77')](_0x4491f8['interaction'][_0xa0a8('0x78')]))},client9002);return _0x4491f8;}return null;})[_0xa0a8('0x23')](respondWithResult(_0x4f5f4f,null))['catch'](handleError(_0x4f5f4f,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index b24110b..f2875fc 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 _0xff10=['hasOwnProperty','hook','exports','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit'];(function(_0x543cb2,_0x1ae3ff){var _0x59e643=function(_0x5610bc){while(--_0x5610bc){_0x543cb2['push'](_0x543cb2['shift']());}};_0x59e643(++_0x1ae3ff);}(_0xff10,0x1e3));var _0x0ff1=function(_0x37358a,_0x4f1d21){_0x37358a=_0x37358a-0x0;var _0x511fbc=_0xff10[_0x37358a];return _0x511fbc;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x0ff1('0x0'))['db'][_0x0ff1('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x0ff1('0x2')](0x0);var events={'afterCreate':_0x0ff1('0x3'),'afterUpdate':_0x0ff1('0x4'),'afterDestroy':_0x0ff1('0x5')};function emitEvent(_0x1e3efe){return function(_0x3dde9f,_0x2980af,_0x1d40ff){ChatMessageEvents['emit'](_0x1e3efe+':'+_0x3dde9f['id'],_0x3dde9f);ChatMessageEvents[_0x0ff1('0x6')](_0x1e3efe,_0x3dde9f);_0x1d40ff(null);};}for(var e in events){if(events[_0x0ff1('0x7')](e)){var event=events[e];ChatMessage[_0x0ff1('0x8')](e,emitEvent(event));}}module[_0x0ff1('0x9')]=ChatMessageEvents;
\ No newline at end of file
+var _0x2c4b=['events','../../mysqldb','ChatMessage','setMaxListeners','update','remove','hasOwnProperty','hook','exports'];(function(_0x1394a2,_0x533264){var _0x31dcd1=function(_0x58c693){while(--_0x58c693){_0x1394a2['push'](_0x1394a2['shift']());}};_0x31dcd1(++_0x533264);}(_0x2c4b,0x1c2));var _0xb2c4=function(_0x1911bc,_0x10c83e){_0x1911bc=_0x1911bc-0x0;var _0x51ec6c=_0x2c4b[_0x1911bc];return _0x51ec6c;};'use strict';var EventEmitter=require(_0xb2c4('0x0'));var ChatMessage=require(_0xb2c4('0x1'))['db'][_0xb2c4('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xb2c4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb2c4('0x4'),'afterDestroy':_0xb2c4('0x5')};function emitEvent(_0x5d1f9){return function(_0x30faec,_0x3b883b,_0x4de247){ChatMessageEvents['emit'](_0x5d1f9+':'+_0x30faec['id'],_0x30faec);ChatMessageEvents['emit'](_0x5d1f9,_0x30faec);_0x4de247(null);};}for(var e in events){if(events[_0xb2c4('0x6')](e)){var event=events[e];ChatMessage[_0xb2c4('0x7')](e,emitEvent(event));}}module[_0xb2c4('0x8')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 392b3d1..6b47f84 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 _0xea04=['chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1bb812,_0x23eacc){var _0x372adb=function(_0x5ad456){while(--_0x5ad456){_0x1bb812['push'](_0x1bb812['shift']());}};_0x372adb(++_0x23eacc);}(_0xea04,0x1d1));var _0x4ea0=function(_0x2d126e,_0x1e8257){_0x2d126e=_0x2d126e-0x0;var _0xcb04d3=_0xea04[_0x2d126e];return _0xcb04d3;};'use strict';var _=require(_0x4ea0('0x0'));var util=require(_0x4ea0('0x1'));var logger=require(_0x4ea0('0x2'))(_0x4ea0('0x3'));var moment=require('moment');var BPromise=require(_0x4ea0('0x4'));var rp=require(_0x4ea0('0x5'));var fs=require('fs');var path=require(_0x4ea0('0x6'));var rimraf=require(_0x4ea0('0x7'));var config=require(_0x4ea0('0x8'));var attributes=require('./chatMessage.attributes');module[_0x4ea0('0x9')]=function(_0x34752d,_0x565e45){return _0x34752d[_0x4ea0('0xa')]('ChatMessage',attributes,{'tableName':_0x4ea0('0xb'),'paranoid':![],'indexes':[{'name':_0x4ea0('0xc'),'fields':[_0x4ea0('0xd')],'type':_0x4ea0('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5ac837,_0x3650d4,_0x436299){var _0x142be1=_0x34752d['models'];var _0x26666e=_0x5ac837[_0x4ea0('0xf')]({'plain':!![]});if(_0x26666e[_0x4ea0('0x10')]['toLowerCase']()==='in'||_0x26666e[_0x4ea0('0x10')][_0x4ea0('0x11')]()===_0x4ea0('0x12')&&!_0x26666e['secret']&&!_[_0x4ea0('0x13')](_0x26666e[_0x4ea0('0x14')])){_0x142be1[_0x4ea0('0x15')][_0x4ea0('0x16')]({'where':{'id':_0x26666e[_0x4ea0('0x17')]}})[_0x4ea0('0x18')](function(_0x55077a){if(_0x55077a){_0x55077a['update']({'lastMsgAt':_0x26666e[_0x4ea0('0x19')],'lastMsgDirection':_0x26666e[_0x4ea0('0x10')][_0x4ea0('0x11')]()});}})['catch'](function(_0x38efa7){console[_0x4ea0('0x1a')](_0x38efa7);});}_0x436299();}},'charset':'utf8mb4','collate':_0x4ea0('0x1b')});};
\ No newline at end of file
+var _0x8185=['FULLTEXT','get','toLowerCase','direction','out','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4','lodash','util','request-promise','rimraf','../../config/environment','exports','ChatMessage','chat_messages','body'];(function(_0xe84685,_0x595534){var _0x140b52=function(_0x5b9890){while(--_0x5b9890){_0xe84685['push'](_0xe84685['shift']());}};_0x140b52(++_0x595534);}(_0x8185,0xc6));var _0x5818=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x8185[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0x5818('0x0'));var util=require(_0x5818('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5818('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5818('0x3'));var config=require(_0x5818('0x4'));var attributes=require('./chatMessage.attributes');module[_0x5818('0x5')]=function(_0xbc4a17,_0x378891){return _0xbc4a17['define'](_0x5818('0x6'),attributes,{'tableName':_0x5818('0x7'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x5818('0x8')],'type':_0x5818('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x395d47,_0x5b6dcb,_0x388eb9){var _0x38cdea=_0xbc4a17['models'];var _0x22d280=_0x395d47[_0x5818('0xa')]({'plain':!![]});if(_0x22d280['direction'][_0x5818('0xb')]()==='in'||_0x22d280[_0x5818('0xc')][_0x5818('0xb')]()===_0x5818('0xd')&&!_0x22d280['secret']&&!_['isNil'](_0x22d280[_0x5818('0xe')])){_0x38cdea[_0x5818('0xf')][_0x5818('0x10')]({'where':{'id':_0x22d280[_0x5818('0x11')]}})[_0x5818('0x12')](function(_0x237211){if(_0x237211){_0x237211[_0x5818('0x13')]({'lastMsgAt':_0x22d280[_0x5818('0x14')],'lastMsgDirection':_0x22d280['direction']['toLowerCase']()});}})[_0x5818('0x15')](function(_0x1e62cd){console['error'](_0x1e62cd);});}_0x388eb9();}},'charset':_0x5818('0x16'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 005ff2f..3d8d30f 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 _0x2e08=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','options','raw'];(function(_0x2d3f32,_0xb531aa){var _0x26ab09=function(_0x4256c2){while(--_0x4256c2){_0x2d3f32['push'](_0x2d3f32['shift']());}};_0x26ab09(++_0xb531aa);}(_0x2e08,0x1ad));var _0x82e0=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x2e08[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x82e0('0x0'));var util=require('util');var moment=require(_0x82e0('0x1'));var BPromise=require(_0x82e0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x82e0('0x3'));var db=require(_0x82e0('0x4'))['db'];var utils=require(_0x82e0('0x5'));var logger=require(_0x82e0('0x6'))(_0x82e0('0x7'));var config=require(_0x82e0('0x8'));var jayson=require(_0x82e0('0x9'));var client=jayson['client'][_0x82e0('0xa')]({'port':0x232a});config[_0x82e0('0xb')]=_[_0x82e0('0xc')](config[_0x82e0('0xb')],{'host':_0x82e0('0xd'),'port':0x18eb});var socket=require(_0x82e0('0xe'))(new Redis(config[_0x82e0('0xb')]));require(_0x82e0('0xf'))['register'](socket);function respondWithRpcPromise(_0x578ed5,_0x5d846c,_0x51718e){return new BPromise(function(_0x1b7487,_0x5dea7c){return client['request'](_0x578ed5,_0x51718e)[_0x82e0('0x10')](function(_0x5dd63e){logger[_0x82e0('0x11')](_0x82e0('0x12'),_0x5d846c,_0x82e0('0x13'));logger[_0x82e0('0x14')](_0x82e0('0x15'),_0x5d846c,_0x82e0('0x13'),JSON[_0x82e0('0x16')](_0x5dd63e));if(_0x5dd63e['error']){if(_0x5dd63e[_0x82e0('0x17')][_0x82e0('0x18')]===0x1f4){logger[_0x82e0('0x17')](_0x82e0('0x12'),_0x5d846c,_0x5dd63e['error'][_0x82e0('0x19')]);return _0x5dea7c(_0x5dd63e[_0x82e0('0x17')][_0x82e0('0x19')]);}logger[_0x82e0('0x17')](_0x82e0('0x12'),_0x5d846c,_0x5dd63e[_0x82e0('0x17')][_0x82e0('0x19')]);return _0x1b7487(_0x5dd63e[_0x82e0('0x17')]['message']);}else{logger['info'](_0x82e0('0x12'),_0x5d846c,_0x82e0('0x13'));_0x1b7487(_0x5dd63e[_0x82e0('0x1a')][_0x82e0('0x19')]);}})[_0x82e0('0x1b')](function(_0x47fa17){logger[_0x82e0('0x17')]('ChatMessage,\x20%s,\x20%s',_0x5d846c,_0x47fa17);_0x5dea7c(_0x47fa17);});});}exports[_0x82e0('0x1c')]=function(_0x464bbe){var _0x16033b=this;return new Promise(function(_0x167e5f,_0x4fc214){return db[_0x82e0('0x1d')][_0x82e0('0x1e')](_0x464bbe['body'],{'raw':_0x464bbe['options']?_0x464bbe[_0x82e0('0x1f')][_0x82e0('0x20')]===undefined?!![]:![]:!![]})[_0x82e0('0x10')](function(_0x4ceeff){logger[_0x82e0('0x11')](_0x82e0('0x1c'),_0x464bbe);logger['debug']('CreateChatMessage',_0x464bbe,JSON[_0x82e0('0x16')](_0x4ceeff));_0x167e5f(_0x4ceeff);})[_0x82e0('0x1b')](function(_0x2f48e9){logger[_0x82e0('0x17')](_0x82e0('0x1c'),_0x2f48e9[_0x82e0('0x19')],_0x464bbe);_0x4fc214(_0x16033b[_0x82e0('0x17')](0x1f4,_0x2f48e9[_0x82e0('0x19')]));});});};
\ No newline at end of file
+var _0x2db5=['../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','create','body','options','CreateChatMessage','util','randomstring','../../mysqldb','../../config/logger'];(function(_0x22867f,_0x458cf6){var _0x277c48=function(_0x5352c9){while(--_0x5352c9){_0x22867f['push'](_0x22867f['shift']());}};_0x277c48(++_0x458cf6);}(_0x2db5,0x168));var _0x52db=function(_0x6ca7f4,_0x51a5df){_0x6ca7f4=_0x6ca7f4-0x0;var _0x494fa6=_0x2db5[_0x6ca7f4];return _0x494fa6;};'use strict';var _=require('lodash');var util=require(_0x52db('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x52db('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x52db('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x52db('0x3'))('rpc');var config=require(_0x52db('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x52db('0x5')][_0x52db('0x6')]({'port':0x232a});config[_0x52db('0x7')]=_[_0x52db('0x8')](config[_0x52db('0x7')],{'host':_0x52db('0x9'),'port':0x18eb});var socket=require(_0x52db('0xa'))(new Redis(config[_0x52db('0x7')]));require(_0x52db('0xb'))['register'](socket);function respondWithRpcPromise(_0x282668,_0x30bd02,_0x5bb510){return new BPromise(function(_0x4813a0,_0x2d1801){return client[_0x52db('0xc')](_0x282668,_0x5bb510)[_0x52db('0xd')](function(_0x1a24b2){logger[_0x52db('0xe')](_0x52db('0xf'),_0x30bd02,'request\x20sent');logger[_0x52db('0x10')](_0x52db('0x11'),_0x30bd02,_0x52db('0x12'),JSON[_0x52db('0x13')](_0x1a24b2));if(_0x1a24b2['error']){if(_0x1a24b2[_0x52db('0x14')]['code']===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x30bd02,_0x1a24b2[_0x52db('0x14')][_0x52db('0x15')]);return _0x2d1801(_0x1a24b2['error'][_0x52db('0x15')]);}logger[_0x52db('0x14')]('ChatMessage,\x20%s,\x20%s',_0x30bd02,_0x1a24b2[_0x52db('0x14')][_0x52db('0x15')]);return _0x4813a0(_0x1a24b2['error']['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x30bd02,'request\x20sent');_0x4813a0(_0x1a24b2[_0x52db('0x16')]['message']);}})[_0x52db('0x17')](function(_0x15876b){logger['error'](_0x52db('0xf'),_0x30bd02,_0x15876b);_0x2d1801(_0x15876b);});});}exports['CreateChatMessage']=function(_0x2ab8c1){var _0x15b870=this;return new Promise(function(_0x3afed4,_0xf3bd26){return db['ChatMessage'][_0x52db('0x18')](_0x2ab8c1[_0x52db('0x19')],{'raw':_0x2ab8c1[_0x52db('0x1a')]?_0x2ab8c1[_0x52db('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x52db('0xd')](function(_0x47034f){logger[_0x52db('0xe')](_0x52db('0x1b'),_0x2ab8c1);logger[_0x52db('0x10')](_0x52db('0x1b'),_0x2ab8c1,JSON[_0x52db('0x13')](_0x47034f));_0x3afed4(_0x47034f);})[_0x52db('0x17')](function(_0x3864ea){logger[_0x52db('0x14')](_0x52db('0x1b'),_0x3864ea[_0x52db('0x15')],_0x2ab8c1);_0xf3bd26(_0x15b870['error'](0x1f4,_0x3864ea[_0x52db('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 06314ca..ab4b763 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 _0x1d25=['register','chatMessage:','./chatMessage.events','save','remove','update','emit','removeListener'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x1d25,0xba));var _0x51d2=function(_0x4cce65,_0x40021e){_0x4cce65=_0x4cce65-0x0;var _0x4d1b45=_0x1d25[_0x4cce65];return _0x4d1b45;};'use strict';var ChatMessageEvents=require(_0x51d2('0x0'));var events=[_0x51d2('0x1'),_0x51d2('0x2'),_0x51d2('0x3')];function createListener(_0x17f896,_0x5aac21){return function(_0x1b276e){_0x5aac21[_0x51d2('0x4')](_0x17f896,_0x1b276e);};}function removeListener(_0x4c93f2,_0x1f9fc8){return function(){ChatMessageEvents[_0x51d2('0x5')](_0x4c93f2,_0x1f9fc8);};}exports[_0x51d2('0x6')]=function(_0x407091){for(var _0x449fec=0x0,_0x2e6956=events['length'];_0x449fec<_0x2e6956;_0x449fec++){var _0x18e8a9=events[_0x449fec];var _0x5a6b5f=createListener(_0x51d2('0x7')+_0x18e8a9,_0x407091);ChatMessageEvents['on'](_0x18e8a9,_0x5a6b5f);}};
\ No newline at end of file
+var _0xc949=['chatMessage:','./chatMessage.events','remove','update','emit','removeListener','register','length'];(function(_0x5eabd8,_0x528881){var _0x516fff=function(_0x1dd206){while(--_0x1dd206){_0x5eabd8['push'](_0x5eabd8['shift']());}};_0x516fff(++_0x528881);}(_0xc949,0x181));var _0x9c94=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xc949[_0x92c450];return _0x2a9599;};'use strict';var ChatMessageEvents=require(_0x9c94('0x0'));var events=['save',_0x9c94('0x1'),_0x9c94('0x2')];function createListener(_0x209cd8,_0x27613f){return function(_0x54facf){_0x27613f[_0x9c94('0x3')](_0x209cd8,_0x54facf);};}function removeListener(_0x231762,_0x528a17){return function(){ChatMessageEvents[_0x9c94('0x4')](_0x231762,_0x528a17);};}exports[_0x9c94('0x5')]=function(_0x46d560){for(var _0x1357ac=0x0,_0x57fcd7=events[_0x9c94('0x6')];_0x1357ac<_0x57fcd7;_0x1357ac++){var _0x360e7b=events[_0x1357ac];var _0x25ecd0=createListener(_0x9c94('0x7')+_0x360e7b,_0x46d560);ChatMessageEvents['on'](_0x360e7b,_0x25ecd0);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 5edc8d2..04cc122 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 _0x9d61=['Router','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','describe','/:id','show','post','tracked','chat','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x3cdc14,_0x4e660f){var _0x59576c=function(_0x522f9c){while(--_0x522f9c){_0x3cdc14['push'](_0x3cdc14['shift']());}};_0x59576c(++_0x4e660f);}(_0x9d61,0xef));var _0x19d6=function(_0x3d805b,_0x46fe6d){_0x3d805b=_0x3d805b-0x0;var _0x5ddaf6=_0x9d61[_0x3d805b];return _0x5ddaf6;};'use strict';var multer=require('multer');var util=require(_0x19d6('0x0'));var path=require(_0x19d6('0x1'));var timeout=require(_0x19d6('0x2'));var express=require(_0x19d6('0x3'));var router=express[_0x19d6('0x4')]();var fs_extra=require(_0x19d6('0x5'));var auth=require(_0x19d6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x19d6('0x7'));var controller=require(_0x19d6('0x8'));router[_0x19d6('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x19d6('0x9')]('/describe',auth[_0x19d6('0xa')](),controller[_0x19d6('0xb')]);router[_0x19d6('0x9')](_0x19d6('0xc'),auth[_0x19d6('0xa')](),controller[_0x19d6('0xd')]);router[_0x19d6('0xe')]('/',auth['isAuthenticated'](),interaction[_0x19d6('0xf')](_0x19d6('0x10'),'chatmessage:create'),controller[_0x19d6('0x11')]);router[_0x19d6('0x12')]('/:id',controller[_0x19d6('0x13')]);router['put'](_0x19d6('0x14'),auth['isAuthenticated'](),controller[_0x19d6('0x15')]);router[_0x19d6('0x12')](_0x19d6('0x16'),auth[_0x19d6('0xa')](),controller[_0x19d6('0x17')]);router[_0x19d6('0x18')](_0x19d6('0xc'),auth[_0x19d6('0xa')](),controller[_0x19d6('0x19')]);module[_0x19d6('0x1a')]=router;
\ No newline at end of file
+var _0x564a=['util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer'];(function(_0x5b0f2d,_0x1c4b73){var _0x5eb577=function(_0x1db0cf){while(--_0x1db0cf){_0x5b0f2d['push'](_0x5b0f2d['shift']());}};_0x5eb577(++_0x1c4b73);}(_0x564a,0x1b9));var _0xa564=function(_0x2de98d,_0x4e4d8a){_0x2de98d=_0x2de98d-0x0;var _0x2068aa=_0x564a[_0x2de98d];return _0x2068aa;};'use strict';var multer=require(_0xa564('0x0'));var util=require(_0xa564('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa564('0x2'));var router=express['Router']();var fs_extra=require(_0xa564('0x3'));var auth=require(_0xa564('0x4'));var interaction=require(_0xa564('0x5'));var config=require(_0xa564('0x6'));var controller=require('./chatMessage.controller');router[_0xa564('0x7')]('/',auth[_0xa564('0x8')](),controller[_0xa564('0x9')]);router[_0xa564('0x7')](_0xa564('0xa'),auth[_0xa564('0x8')](),controller[_0xa564('0xb')]);router[_0xa564('0x7')](_0xa564('0xc'),auth[_0xa564('0x8')](),controller[_0xa564('0xd')]);router[_0xa564('0xe')]('/',auth[_0xa564('0x8')](),interaction[_0xa564('0xf')](_0xa564('0x10'),_0xa564('0x11')),controller['create']);router['put'](_0xa564('0xc'),controller['update']);router[_0xa564('0x12')](_0xa564('0x13'),auth[_0xa564('0x8')](),controller[_0xa564('0x14')]);router[_0xa564('0x12')](_0xa564('0x15'),auth[_0xa564('0x8')](),controller[_0xa564('0x16')]);router[_0xa564('0x17')](_0xa564('0xc'),auth[_0xa564('0x8')](),controller[_0xa564('0x18')]);module[_0xa564('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index cefbcd5..3fea8d0 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 _0xadb5=['medium','TEXT','exports'];(function(_0x5d93ba,_0x94099a){var _0x2a9700=function(_0x59349e){while(--_0x59349e){_0x5d93ba['push'](_0x5d93ba['shift']());}};_0x2a9700(++_0x94099a);}(_0xadb5,0xad));var _0x5adb=function(_0x1ef775,_0x3385cc){_0x1ef775=_0x1ef775-0x0;var _0x7d5bb5=_0xadb5[_0x1ef775];return _0x7d5bb5;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5d6270,_0x83b57a){_0x5d6270=_0x5d6270-0x0;var _0x168f26=_0x0b0e[_0x5d6270];return _0x168f26;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index a65b764..6390df5 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x7a54,0x106));var _0x47a5=function(_0x124059,_0xbb6646){_0x124059=_0x124059-0x0;var _0x2ec940=_0x7a54[_0x124059];return _0x2ec940;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0xcdb486,_0x3acddd){var _0xff64cc=function(_0x2fec2a){while(--_0x2fec2a){_0xcdb486['push'](_0xcdb486['shift']());}};_0xff64cc(++_0x3acddd);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index a9c5983..4bc446c 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6f08=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','emit'];(function(_0x13d0e0,_0x2a661b){var _0x18deff=function(_0x396cd1){while(--_0x396cd1){_0x13d0e0['push'](_0x13d0e0['shift']());}};_0x18deff(++_0x2a661b);}(_0x6f08,0x9c));var _0x86f0=function(_0x133df4,_0x8e2c46){_0x133df4=_0x133df4-0x0;var _0xcd2945=_0x6f08[_0x133df4];return _0xcd2945;};'use strict';var EventEmitter=require(_0x86f0('0x0'));var ChatOfflineMessage=require(_0x86f0('0x1'))['db'][_0x86f0('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x86f0('0x3')](0x0);var events={'afterCreate':_0x86f0('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x145e17){return function(_0x5bd276,_0x167900,_0x1a07a6){ChatOfflineMessageEvents[_0x86f0('0x5')](_0x145e17+':'+_0x5bd276['id'],_0x5bd276);ChatOfflineMessageEvents[_0x86f0('0x5')](_0x145e17,_0x5bd276);_0x1a07a6(null);};}for(var e in events){if(events[_0x86f0('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x86f0('0x7')](e,emitEvent(event));}}module[_0x86f0('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x71d8=['setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb','ChatOfflineMessage'];(function(_0x743701,_0x3e67bb){var _0x5a141d=function(_0x4b198d){while(--_0x4b198d){_0x743701['push'](_0x743701['shift']());}};_0x5a141d(++_0x3e67bb);}(_0x71d8,0x8d));var _0x871d=function(_0x40de6f,_0x34678d){_0x40de6f=_0x40de6f-0x0;var _0x5504a4=_0x71d8[_0x40de6f];return _0x5504a4;};'use strict';var EventEmitter=require(_0x871d('0x0'));var ChatOfflineMessage=require(_0x871d('0x1'))['db'][_0x871d('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x871d('0x3')](0x0);var events={'afterCreate':_0x871d('0x4'),'afterUpdate':_0x871d('0x5'),'afterDestroy':_0x871d('0x6')};function emitEvent(_0x36c79b){return function(_0x2c0dbf,_0x3fbfb0,_0x5ae963){ChatOfflineMessageEvents[_0x871d('0x7')](_0x36c79b+':'+_0x2c0dbf['id'],_0x2c0dbf);ChatOfflineMessageEvents[_0x871d('0x7')](_0x36c79b,_0x2c0dbf);_0x5ae963(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x871d('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index c2549cf..c5ebcaa 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 _0x2f57=['./chatOfflineMessage.attributes','exports','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci'];(function(_0x27a55b,_0x14515b){var _0x2858b1=function(_0x42cf4b){while(--_0x42cf4b){_0x27a55b['push'](_0x27a55b['shift']());}};_0x2858b1(++_0x14515b);}(_0x2f57,0x17c));var _0x72f5=function(_0x3daf10,_0x297173){_0x3daf10=_0x3daf10-0x0;var _0x52eab6=_0x2f57[_0x3daf10];return _0x52eab6;};'use strict';var attributes=require(_0x72f5('0x0'));module[_0x72f5('0x1')]=function(_0xc45d7b){return _0xc45d7b['define'](_0x72f5('0x2'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x72f5('0x3'),'collate':_0x72f5('0x4')});};
\ No newline at end of file
+var _0x19ff=['chat_offline_messages','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x19ff,0xb1));var _0xf19f=function(_0x25dc3a,_0x1680bf){_0x25dc3a=_0x25dc3a-0x0;var _0x308ae4=_0x19ff[_0x25dc3a];return _0x308ae4;};'use strict';var attributes=require(_0xf19f('0x0'));module[_0xf19f('0x1')]=function(_0x306752){return _0x306752[_0xf19f('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0xf19f('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf19f('0x4')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 246ae4d..919734a 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 _0xca1d=['../../config/utils','../../config/logger','../../config/environment','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','moment','randomstring','../../mysqldb'];(function(_0x2c90d4,_0x5abd07){var _0x1cbdfc=function(_0x29ed88){while(--_0x29ed88){_0x2c90d4['push'](_0x2c90d4['shift']());}};_0x1cbdfc(++_0x5abd07);}(_0xca1d,0x73));var _0xdca1=function(_0x1cc8fa,_0x317251){_0x1cc8fa=_0x1cc8fa-0x0;var _0x253909=_0xca1d[_0x1cc8fa];return _0x253909;};'use strict';var _=require(_0xdca1('0x0'));var util=require('util');var moment=require(_0xdca1('0x1'));var BPromise=require('bluebird');var rs=require(_0xdca1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdca1('0x3'))['db'];var utils=require(_0xdca1('0x4'));var logger=require(_0xdca1('0x5'))('rpc');var config=require(_0xdca1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xdca1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa1b001,_0x5da7ee,_0x40c56d){return new BPromise(function(_0x4d20be,_0x1907ad){return client[_0xdca1('0x8')](_0xa1b001,_0x40c56d)[_0xdca1('0x9')](function(_0x235744){logger[_0xdca1('0xa')](_0xdca1('0xb'),_0x5da7ee,_0xdca1('0xc'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x5da7ee,_0xdca1('0xc'),JSON[_0xdca1('0xd')](_0x235744));if(_0x235744[_0xdca1('0xe')]){if(_0x235744[_0xdca1('0xe')]['code']===0x1f4){logger[_0xdca1('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5da7ee,_0x235744[_0xdca1('0xe')][_0xdca1('0xf')]);return _0x1907ad(_0x235744[_0xdca1('0xe')][_0xdca1('0xf')]);}logger[_0xdca1('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5da7ee,_0x235744['error'][_0xdca1('0xf')]);return _0x4d20be(_0x235744['error'][_0xdca1('0xf')]);}else{logger[_0xdca1('0xa')](_0xdca1('0xb'),_0x5da7ee,_0xdca1('0xc'));_0x4d20be(_0x235744[_0xdca1('0x10')][_0xdca1('0xf')]);}})['catch'](function(_0x187da2){logger[_0xdca1('0xe')](_0xdca1('0xb'),_0x5da7ee,_0x187da2);_0x1907ad(_0x187da2);});});}
\ No newline at end of file
+var _0x6dc0=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x57f59b,_0x42714b){var _0x5af741=function(_0x3b1029){while(--_0x3b1029){_0x57f59b['push'](_0x57f59b['shift']());}};_0x5af741(++_0x42714b);}(_0x6dc0,0x18c));var _0x06dc=function(_0x54f978,_0x3a6b7e){_0x54f978=_0x54f978-0x0;var _0x5d40b3=_0x6dc0[_0x54f978];return _0x5d40b3;};'use strict';var _=require(_0x06dc('0x0'));var util=require('util');var moment=require(_0x06dc('0x1'));var BPromise=require(_0x06dc('0x2'));var rs=require(_0x06dc('0x3'));var fs=require('fs');var Redis=require(_0x06dc('0x4'));var db=require(_0x06dc('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x06dc('0x6'));var config=require(_0x06dc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x06dc('0x8')][_0x06dc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ac3b4,_0x1a34e5,_0x523fb5){return new BPromise(function(_0xeac52b,_0x428751){return client[_0x06dc('0xa')](_0x4ac3b4,_0x523fb5)[_0x06dc('0xb')](function(_0x4539c2){logger['info'](_0x06dc('0xc'),_0x1a34e5,'request\x20sent');logger[_0x06dc('0xd')](_0x06dc('0xe'),_0x1a34e5,'request\x20sent',JSON[_0x06dc('0xf')](_0x4539c2));if(_0x4539c2[_0x06dc('0x10')]){if(_0x4539c2[_0x06dc('0x10')][_0x06dc('0x11')]===0x1f4){logger['error'](_0x06dc('0xc'),_0x1a34e5,_0x4539c2[_0x06dc('0x10')][_0x06dc('0x12')]);return _0x428751(_0x4539c2[_0x06dc('0x10')][_0x06dc('0x12')]);}logger['error'](_0x06dc('0xc'),_0x1a34e5,_0x4539c2[_0x06dc('0x10')][_0x06dc('0x12')]);return _0xeac52b(_0x4539c2[_0x06dc('0x10')][_0x06dc('0x12')]);}else{logger[_0x06dc('0x13')](_0x06dc('0xc'),_0x1a34e5,'request\x20sent');_0xeac52b(_0x4539c2[_0x06dc('0x14')][_0x06dc('0x12')]);}})[_0x06dc('0x15')](function(_0x5bc9d9){logger[_0x06dc('0x10')](_0x06dc('0xc'),_0x1a34e5,_0x5bc9d9);_0x428751(_0x5bc9d9);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 37470dc..b448c4d 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 _0xaba2=['describe','show','post','create','put','/:id','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaba2,0x121));var _0x2aba=function(_0x835816,_0x280a54){_0x835816=_0x835816-0x0;var _0x1f24b2=_0xaba2[_0x835816];return _0x1f24b2;};'use strict';var multer=require('multer');var util=require(_0x2aba('0x0'));var path=require('path');var timeout=require(_0x2aba('0x1'));var express=require(_0x2aba('0x2'));var router=express[_0x2aba('0x3')]();var fs_extra=require(_0x2aba('0x4'));var auth=require(_0x2aba('0x5'));var interaction=require(_0x2aba('0x6'));var config=require(_0x2aba('0x7'));var controller=require('./chatOfflineMessage.controller');router[_0x2aba('0x8')]('/',auth[_0x2aba('0x9')](),controller[_0x2aba('0xa')]);router[_0x2aba('0x8')]('/describe',auth[_0x2aba('0x9')](),controller[_0x2aba('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2aba('0xc')]);router[_0x2aba('0xd')]('/',auth[_0x2aba('0x9')](),controller[_0x2aba('0xe')]);router[_0x2aba('0xf')](_0x2aba('0x10'),auth[_0x2aba('0x9')](),controller[_0x2aba('0x11')]);router['delete'](_0x2aba('0x10'),auth[_0x2aba('0x9')](),controller[_0x2aba('0x12')]);module[_0x2aba('0x13')]=router;
\ No newline at end of file
+var _0xefea=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0xefea,0x1b7));var _0xaefe=function(_0xb4faab,_0x75ad0a){_0xb4faab=_0xb4faab-0x0;var _0x169347=_0xefea[_0xb4faab];return _0x169347;};'use strict';var multer=require(_0xaefe('0x0'));var util=require(_0xaefe('0x1'));var path=require(_0xaefe('0x2'));var timeout=require(_0xaefe('0x3'));var express=require(_0xaefe('0x4'));var router=express['Router']();var fs_extra=require(_0xaefe('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xaefe('0x6'));var config=require(_0xaefe('0x7'));var controller=require(_0xaefe('0x8'));router[_0xaefe('0x9')]('/',auth[_0xaefe('0xa')](),controller[_0xaefe('0xb')]);router[_0xaefe('0x9')](_0xaefe('0xc'),auth[_0xaefe('0xa')](),controller[_0xaefe('0xd')]);router[_0xaefe('0x9')](_0xaefe('0xe'),auth[_0xaefe('0xa')](),controller[_0xaefe('0xf')]);router[_0xaefe('0x10')]('/',auth['isAuthenticated'](),controller[_0xaefe('0x11')]);router[_0xaefe('0x12')](_0xaefe('0xe'),auth[_0xaefe('0xa')](),controller[_0xaefe('0x13')]);router[_0xaefe('0x14')]('/:id',auth[_0xaefe('0xa')](),controller[_0xaefe('0x15')]);module[_0xaefe('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index b9f35eb..d26017f 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 _0x4184=['timeout','exports'];(function(_0x1ffe50,_0x3070ff){var _0x4e5bf0=function(_0x4d6af8){while(--_0x4d6af8){_0x1ffe50['push'](_0x1ffe50['shift']());}};_0x4e5bf0(++_0x3070ff);}(_0x4184,0x18f));var _0x4418=function(_0x558bae,_0x387878){_0x558bae=_0x558bae-0x0;var _0x34cc15=_0x4184[_0x558bae];return _0x34cc15;};'use strict';var Sequelize=require('sequelize');module[_0x4418('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0x4418('0x1')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xdb78=['ENUM','mouseOver','INTEGER','sequelize','exports','STRING'];(function(_0x44e372,_0x145cb8){var _0x48eedb=function(_0x316f3d){while(--_0x316f3d){_0x44e372['push'](_0x44e372['shift']());}};_0x48eedb(++_0x145cb8);}(_0xdb78,0xd5));var _0x8db7=function(_0x14fb9c,_0x28415b){_0x14fb9c=_0x14fb9c-0x0;var _0x20bb3c=_0xdb78[_0x14fb9c];return _0x20bb3c;};'use strict';var Sequelize=require(_0x8db7('0x0'));module[_0x8db7('0x1')]={'name':{'type':Sequelize[_0x8db7('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8db7('0x3')](_0x8db7('0x4'),'timeout'),'defaultValue':_0x8db7('0x4')},'selector':{'type':Sequelize[_0x8db7('0x2')]},'timeout':{'type':Sequelize[_0x8db7('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 20b8b1e..21eb39c 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 _0x26d1=['stack','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','merge','options','find','catch','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','update','then','destroy','error'];(function(_0x521276,_0x4ea725){var _0x291e1f=function(_0x1153ab){while(--_0x1153ab){_0x521276['push'](_0x521276['shift']());}};_0x291e1f(++_0x4ea725);}(_0x26d1,0x8e));var _0x126d=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x26d1[_0x138adb];return _0x1b27f2;};'use strict';var emlformat=require(_0x126d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x126d('0x1'));var jsonpatch=require(_0x126d('0x2'));var rp=require(_0x126d('0x3'));var moment=require(_0x126d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x126d('0x5'));var path=require('path');var sox=require(_0x126d('0x6'));var csv=require(_0x126d('0x7'));var ejs=require(_0x126d('0x8'));var fs=require('fs');var fs_extra=require(_0x126d('0x9'));var _=require(_0x126d('0xa'));var squel=require('squel');var crypto=require(_0x126d('0xb'));var jsforce=require(_0x126d('0xc'));var deskjs=require(_0x126d('0xd'));var toCsv=require(_0x126d('0x7'));var querystring=require(_0x126d('0xe'));var Papa=require(_0x126d('0xf'));var Redis=require(_0x126d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x126d('0x11'));var as=require(_0x126d('0x12'));var hardwareService=require(_0x126d('0x13'));var logger=require(_0x126d('0x14'))(_0x126d('0x15'));var utils=require('../../config/utils');var config=require(_0x126d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x126d('0x17'))['db'];function respondWithStatusCode(_0x2b755f,_0x455539){_0x455539=_0x455539||0xcc;return function(_0x55bf88){if(_0x55bf88){return _0x2b755f[_0x126d('0x18')](_0x455539);}return _0x2b755f[_0x126d('0x19')](_0x455539)[_0x126d('0x1a')]();};}function respondWithResult(_0x56c1e3,_0x5afc73){_0x5afc73=_0x5afc73||0xc8;return function(_0x2593c2){if(_0x2593c2){return _0x56c1e3[_0x126d('0x19')](_0x5afc73)[_0x126d('0x1b')](_0x2593c2);}};}function respondWithFilteredResult(_0x138223,_0x391eb2){return function(_0x2fa3c7){if(_0x2fa3c7){var _0x517b88=typeof _0x391eb2[_0x126d('0x1c')]==='undefined'&&typeof _0x391eb2[_0x126d('0x1d')]==='undefined';var _0x2915a4=_0x2fa3c7[_0x126d('0x1e')];var _0x55aa9d=_0x517b88?0x0:_0x391eb2[_0x126d('0x1c')];var _0x52d014=_0x517b88?_0x2fa3c7[_0x126d('0x1e')]:_0x391eb2['offset']+_0x391eb2['limit'];var _0x49bf93;if(_0x52d014>=_0x2915a4){_0x52d014=_0x2915a4;_0x49bf93=0xc8;}else{_0x49bf93=0xce;}_0x138223[_0x126d('0x19')](_0x49bf93);return _0x138223[_0x126d('0x1f')](_0x126d('0x20'),_0x55aa9d+'-'+_0x52d014+'/'+_0x2915a4)[_0x126d('0x1b')](_0x2fa3c7);}return null;};}function patchUpdates(_0x50ced7){return function(_0x1b64d8){try{jsonpatch[_0x126d('0x21')](_0x1b64d8,_0x50ced7,!![]);}catch(_0x50508e){return BPromise['reject'](_0x50508e);}return _0x1b64d8['save']();};}function saveUpdates(_0x1c2a07,_0x30593f){return function(_0x485d57){if(_0x485d57){return _0x485d57[_0x126d('0x22')](_0x1c2a07)[_0x126d('0x23')](function(_0x36603e){return _0x36603e;});}return null;};}function removeEntity(_0x307345,_0x4fd847){return function(_0x2ae562){if(_0x2ae562){return _0x2ae562[_0x126d('0x24')]()[_0x126d('0x23')](function(){_0x307345[_0x126d('0x19')](0xcc)[_0x126d('0x1a')]();});}};}function handleEntityNotFound(_0x2b1734,_0x55fb97){return function(_0x5e8f95){if(!_0x5e8f95){_0x2b1734[_0x126d('0x18')](0x194);}return _0x5e8f95;};}function handleError(_0x4d7b36,_0x5d8ad9){_0x5d8ad9=_0x5d8ad9||0x1f4;return function(_0x269588){logger[_0x126d('0x25')](_0x269588[_0x126d('0x26')]);if(_0x269588[_0x126d('0x27')]){delete _0x269588[_0x126d('0x27')];}_0x4d7b36[_0x126d('0x19')](_0x5d8ad9)[_0x126d('0x28')](_0x269588);};}exports[_0x126d('0x29')]=function(_0x26a6b9,_0x3f2c3d){var _0x288868={'raw':!![],'where':{'id':_0x26a6b9['params']['id']}},_0x12e553={};_0x12e553[_0x126d('0x2a')]=_[_0x126d('0x2b')](db[_0x126d('0x2c')][_0x126d('0x2d')]);_0x12e553[_0x126d('0x2e')]=_[_0x126d('0x2b')](_0x26a6b9[_0x126d('0x2e')]);_0x12e553[_0x126d('0x2f')]=_['intersection'](_0x12e553[_0x126d('0x2a')],_0x12e553[_0x126d('0x2e')]);_0x288868[_0x126d('0x30')]=_[_0x126d('0x31')](_0x12e553[_0x126d('0x2a')],qs[_0x126d('0x32')](_0x26a6b9['query'][_0x126d('0x32')]));_0x288868[_0x126d('0x30')]=_0x288868[_0x126d('0x30')][_0x126d('0x33')]?_0x288868[_0x126d('0x30')]:_0x12e553['model'];if(_0x26a6b9[_0x126d('0x2e')][_0x126d('0x34')]){_0x288868['include']=[{'all':!![]}];}_0x288868=_[_0x126d('0x35')]({},_0x288868,_0x26a6b9[_0x126d('0x36')]);return db[_0x126d('0x2c')][_0x126d('0x37')](_0x288868)[_0x126d('0x23')](handleEntityNotFound(_0x3f2c3d,null))[_0x126d('0x23')](respondWithResult(_0x3f2c3d,null))[_0x126d('0x38')](handleError(_0x3f2c3d,null));};exports['create']=function(_0x4e19ee,_0x322c91){return db[_0x126d('0x2c')][_0x126d('0x39')](_0x4e19ee[_0x126d('0x3a')],{})['then'](respondWithResult(_0x322c91,0xc9))[_0x126d('0x38')](handleError(_0x322c91,null));};exports[_0x126d('0x22')]=function(_0x16b61a,_0x10ee01){if(_0x16b61a[_0x126d('0x3a')]['id']){delete _0x16b61a[_0x126d('0x3a')]['id'];}return db['ChatProactiveAction'][_0x126d('0x37')]({'where':{'id':_0x16b61a[_0x126d('0x3b')]['id']}})[_0x126d('0x23')](handleEntityNotFound(_0x10ee01,null))[_0x126d('0x23')](saveUpdates(_0x16b61a[_0x126d('0x3a')],null))[_0x126d('0x23')](respondWithResult(_0x10ee01,null))['catch'](handleError(_0x10ee01,null));};exports[_0x126d('0x24')]=function(_0x13dffa,_0x1572bc){return db[_0x126d('0x2c')][_0x126d('0x37')]({'where':{'id':_0x13dffa['params']['id']}})[_0x126d('0x23')](handleEntityNotFound(_0x1572bc,null))[_0x126d('0x23')](removeEntity(_0x1572bc,null))['catch'](handleError(_0x1572bc,null));};
\ No newline at end of file
+var _0x28e3=['reject','save','update','then','destroy','error','name','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','find','create','body','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x28e3,0x106));var _0x328e=function(_0x32b993,_0x1c5989){_0x32b993=_0x32b993-0x0;var _0x482780=_0x28e3[_0x32b993];return _0x482780;};'use strict';var emlformat=require(_0x328e('0x0'));var rimraf=require(_0x328e('0x1'));var zipdir=require(_0x328e('0x2'));var jsonpatch=require(_0x328e('0x3'));var rp=require('request-promise');var moment=require(_0x328e('0x4'));var BPromise=require(_0x328e('0x5'));var Mustache=require(_0x328e('0x6'));var util=require(_0x328e('0x7'));var path=require(_0x328e('0x8'));var sox=require(_0x328e('0x9'));var csv=require(_0x328e('0xa'));var ejs=require(_0x328e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x328e('0xc'));var jsforce=require(_0x328e('0xd'));var deskjs=require(_0x328e('0xe'));var toCsv=require(_0x328e('0xa'));var querystring=require(_0x328e('0xf'));var Papa=require('papaparse');var Redis=require(_0x328e('0x10'));var authService=require(_0x328e('0x11'));var qs=require(_0x328e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x328e('0x13'));var utils=require(_0x328e('0x14'));var config=require(_0x328e('0x15'));var licenseUtil=require(_0x328e('0x16'));var db=require(_0x328e('0x17'))['db'];function respondWithStatusCode(_0x45cda0,_0x4699ec){_0x4699ec=_0x4699ec||0xcc;return function(_0x39338e){if(_0x39338e){return _0x45cda0[_0x328e('0x18')](_0x4699ec);}return _0x45cda0[_0x328e('0x19')](_0x4699ec)[_0x328e('0x1a')]();};}function respondWithResult(_0x4abd75,_0x89600b){_0x89600b=_0x89600b||0xc8;return function(_0x1cddc3){if(_0x1cddc3){return _0x4abd75[_0x328e('0x19')](_0x89600b)[_0x328e('0x1b')](_0x1cddc3);}};}function respondWithFilteredResult(_0x29f8bf,_0x397b16){return function(_0x2a8096){if(_0x2a8096){var _0x3c5b37=typeof _0x397b16[_0x328e('0x1c')]==='undefined'&&typeof _0x397b16[_0x328e('0x1d')]===_0x328e('0x1e');var _0x116f46=_0x2a8096[_0x328e('0x1f')];var _0xf69c0f=_0x3c5b37?0x0:_0x397b16[_0x328e('0x1c')];var _0x41a6bb=_0x3c5b37?_0x2a8096['count']:_0x397b16[_0x328e('0x1c')]+_0x397b16[_0x328e('0x1d')];var _0x448f5a;if(_0x41a6bb>=_0x116f46){_0x41a6bb=_0x116f46;_0x448f5a=0xc8;}else{_0x448f5a=0xce;}_0x29f8bf[_0x328e('0x19')](_0x448f5a);return _0x29f8bf[_0x328e('0x20')]('Content-Range',_0xf69c0f+'-'+_0x41a6bb+'/'+_0x116f46)[_0x328e('0x1b')](_0x2a8096);}return null;};}function patchUpdates(_0x1c5551){return function(_0x3d876b){try{jsonpatch['apply'](_0x3d876b,_0x1c5551,!![]);}catch(_0x35da3b){return BPromise[_0x328e('0x21')](_0x35da3b);}return _0x3d876b[_0x328e('0x22')]();};}function saveUpdates(_0x273b45,_0x233bd3){return function(_0x1c43f8){if(_0x1c43f8){return _0x1c43f8[_0x328e('0x23')](_0x273b45)[_0x328e('0x24')](function(_0x3878d7){return _0x3878d7;});}return null;};}function removeEntity(_0x5cbc7f,_0x4e1d4c){return function(_0x139ef3){if(_0x139ef3){return _0x139ef3[_0x328e('0x25')]()[_0x328e('0x24')](function(){_0x5cbc7f[_0x328e('0x19')](0xcc)[_0x328e('0x1a')]();});}};}function handleEntityNotFound(_0x4a62a8,_0x23fda2){return function(_0x48a854){if(!_0x48a854){_0x4a62a8[_0x328e('0x18')](0x194);}return _0x48a854;};}function handleError(_0x476b6a,_0x28da22){_0x28da22=_0x28da22||0x1f4;return function(_0x2fab5a){logger[_0x328e('0x26')](_0x2fab5a['stack']);if(_0x2fab5a['name']){delete _0x2fab5a[_0x328e('0x27')];}_0x476b6a['status'](_0x28da22)['send'](_0x2fab5a);};}exports[_0x328e('0x28')]=function(_0x270d58,_0x5873d1){var _0x232ec7={'raw':!![],'where':{'id':_0x270d58['params']['id']}},_0x1fdc4d={};_0x1fdc4d[_0x328e('0x29')]=_[_0x328e('0x2a')](db[_0x328e('0x2b')][_0x328e('0x2c')]);_0x1fdc4d[_0x328e('0x2d')]=_['keys'](_0x270d58[_0x328e('0x2d')]);_0x1fdc4d[_0x328e('0x2e')]=_[_0x328e('0x2f')](_0x1fdc4d[_0x328e('0x29')],_0x1fdc4d[_0x328e('0x2d')]);_0x232ec7[_0x328e('0x30')]=_[_0x328e('0x2f')](_0x1fdc4d[_0x328e('0x29')],qs[_0x328e('0x31')](_0x270d58['query']['fields']));_0x232ec7[_0x328e('0x30')]=_0x232ec7[_0x328e('0x30')]['length']?_0x232ec7['attributes']:_0x1fdc4d['model'];if(_0x270d58[_0x328e('0x2d')][_0x328e('0x32')]){_0x232ec7[_0x328e('0x33')]=[{'all':!![]}];}_0x232ec7=_[_0x328e('0x34')]({},_0x232ec7,_0x270d58[_0x328e('0x35')]);return db[_0x328e('0x2b')][_0x328e('0x36')](_0x232ec7)['then'](handleEntityNotFound(_0x5873d1,null))[_0x328e('0x24')](respondWithResult(_0x5873d1,null))['catch'](handleError(_0x5873d1,null));};exports['create']=function(_0x25f1ba,_0x479bda){return db[_0x328e('0x2b')][_0x328e('0x37')](_0x25f1ba[_0x328e('0x38')],{})['then'](respondWithResult(_0x479bda,0xc9))[_0x328e('0x39')](handleError(_0x479bda,null));};exports['update']=function(_0x2ba70c,_0x38ebdc){if(_0x2ba70c[_0x328e('0x38')]['id']){delete _0x2ba70c[_0x328e('0x38')]['id'];}return db['ChatProactiveAction'][_0x328e('0x36')]({'where':{'id':_0x2ba70c['params']['id']}})[_0x328e('0x24')](handleEntityNotFound(_0x38ebdc,null))['then'](saveUpdates(_0x2ba70c['body'],null))[_0x328e('0x24')](respondWithResult(_0x38ebdc,null))['catch'](handleError(_0x38ebdc,null));};exports[_0x328e('0x25')]=function(_0x3c8a91,_0x1892e0){return db[_0x328e('0x2b')]['find']({'where':{'id':_0x3c8a91[_0x328e('0x3a')]['id']}})[_0x328e('0x24')](handleEntityNotFound(_0x1892e0,null))[_0x328e('0x24')](removeEntity(_0x1892e0,null))[_0x328e('0x39')](handleError(_0x1892e0,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 0914ee7..6d620ff 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 _0x3b35=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash'];(function(_0x35f281,_0x29a43a){var _0x24fc38=function(_0x153bbc){while(--_0x153bbc){_0x35f281['push'](_0x35f281['shift']());}};_0x24fc38(++_0x29a43a);}(_0x3b35,0x16b));var _0x53b3=function(_0x177411,_0x1d7f65){_0x177411=_0x177411-0x0;var _0x228e40=_0x3b35[_0x177411];return _0x228e40;};'use strict';var _=require(_0x53b3('0x0'));var util=require(_0x53b3('0x1'));var logger=require(_0x53b3('0x2'))(_0x53b3('0x3'));var moment=require('moment');var BPromise=require(_0x53b3('0x4'));var rp=require(_0x53b3('0x5'));var fs=require('fs');var path=require(_0x53b3('0x6'));var rimraf=require(_0x53b3('0x7'));var config=require(_0x53b3('0x8'));var attributes=require(_0x53b3('0x9'));module[_0x53b3('0xa')]=function(_0x2cf15d,_0x5ac6e2){return _0x2cf15d[_0x53b3('0xb')](_0x53b3('0xc'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x16ec=['rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3c16c8,_0x55e700){var _0x341900=function(_0x3c2147){while(--_0x3c2147){_0x3c16c8['push'](_0x3c16c8['shift']());}};_0x341900(++_0x55e700);}(_0x16ec,0xf7));var _0xc16e=function(_0x43372b,_0x3b6502){_0x43372b=_0x43372b-0x0;var _0x436caa=_0x16ec[_0x43372b];return _0x436caa;};'use strict';var _=require(_0xc16e('0x0'));var util=require(_0xc16e('0x1'));var logger=require(_0xc16e('0x2'))(_0xc16e('0x3'));var moment=require(_0xc16e('0x4'));var BPromise=require(_0xc16e('0x5'));var rp=require(_0xc16e('0x6'));var fs=require('fs');var path=require(_0xc16e('0x7'));var rimraf=require(_0xc16e('0x8'));var config=require(_0xc16e('0x9'));var attributes=require(_0xc16e('0xa'));module[_0xc16e('0xb')]=function(_0x14086f,_0x3aad42){return _0x14086f[_0xc16e('0xc')](_0xc16e('0xd'),attributes,{'tableName':_0xc16e('0xe'),'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 0b8ba2b..c865d6e 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 _0xd804=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','request','then','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x3b8e21,_0x382a4f){var _0x4aa19d=function(_0x4c91df){while(--_0x4c91df){_0x3b8e21['push'](_0x3b8e21['shift']());}};_0x4aa19d(++_0x382a4f);}(_0xd804,0xc5));var _0x4d80=function(_0xc971e4,_0x52e221){_0xc971e4=_0xc971e4-0x0;var _0x2a1649=_0xd804[_0xc971e4];return _0x2a1649;};'use strict';var _=require(_0x4d80('0x0'));var util=require(_0x4d80('0x1'));var moment=require(_0x4d80('0x2'));var BPromise=require('bluebird');var rs=require(_0x4d80('0x3'));var fs=require('fs');var Redis=require(_0x4d80('0x4'));var db=require(_0x4d80('0x5'))['db'];var utils=require(_0x4d80('0x6'));var logger=require('../../config/logger')(_0x4d80('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4d80('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2df209,_0x293237,_0x77efd9){return new BPromise(function(_0x1a4da5,_0x4e08df){return client[_0x4d80('0x9')](_0x2df209,_0x77efd9)[_0x4d80('0xa')](function(_0xf916e5){logger[_0x4d80('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x293237,_0x4d80('0xc'));logger[_0x4d80('0xd')](_0x4d80('0xe'),_0x293237,_0x4d80('0xc'),JSON[_0x4d80('0xf')](_0xf916e5));if(_0xf916e5['error']){if(_0xf916e5[_0x4d80('0x10')][_0x4d80('0x11')]===0x1f4){logger[_0x4d80('0x10')](_0x4d80('0x12'),_0x293237,_0xf916e5[_0x4d80('0x10')]['message']);return _0x4e08df(_0xf916e5[_0x4d80('0x10')][_0x4d80('0x13')]);}logger[_0x4d80('0x10')](_0x4d80('0x12'),_0x293237,_0xf916e5[_0x4d80('0x10')][_0x4d80('0x13')]);return _0x1a4da5(_0xf916e5['error']['message']);}else{logger[_0x4d80('0xb')](_0x4d80('0x12'),_0x293237,_0x4d80('0xc'));_0x1a4da5(_0xf916e5[_0x4d80('0x14')][_0x4d80('0x13')]);}})[_0x4d80('0x15')](function(_0x4fd90c){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x293237,_0x4fd90c);_0x4e08df(_0x4fd90c);});});}
\ No newline at end of file
+var _0x3685=['stringify','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s'];(function(_0xab9f3d,_0xb336fa){var _0x5283bf=function(_0x505e6c){while(--_0x505e6c){_0xab9f3d['push'](_0xab9f3d['shift']());}};_0x5283bf(++_0xb336fa);}(_0x3685,0x1aa));var _0x5368=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3685[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x5368('0x0'));var util=require(_0x5368('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5368('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5368('0x3'))['db'];var utils=require(_0x5368('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x5368('0x5'));var client=jayson[_0x5368('0x6')][_0x5368('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1a379a,_0x516024,_0x9f14be){return new BPromise(function(_0x594bf7,_0x2ee81b){return client[_0x5368('0x8')](_0x1a379a,_0x9f14be)[_0x5368('0x9')](function(_0x3ea215){logger[_0x5368('0xa')](_0x5368('0xb'),_0x516024,_0x5368('0xc'));logger['debug'](_0x5368('0xd'),_0x516024,'request\x20sent',JSON[_0x5368('0xe')](_0x3ea215));if(_0x3ea215['error']){if(_0x3ea215[_0x5368('0xf')][_0x5368('0x10')]===0x1f4){logger[_0x5368('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x516024,_0x3ea215[_0x5368('0xf')]['message']);return _0x2ee81b(_0x3ea215[_0x5368('0xf')][_0x5368('0x11')]);}logger[_0x5368('0xf')](_0x5368('0xb'),_0x516024,_0x3ea215[_0x5368('0xf')][_0x5368('0x11')]);return _0x594bf7(_0x3ea215['error']['message']);}else{logger[_0x5368('0xa')](_0x5368('0xb'),_0x516024,_0x5368('0xc'));_0x594bf7(_0x3ea215[_0x5368('0x12')][_0x5368('0x11')]);}})[_0x5368('0x13')](function(_0xd0a9ca){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x516024,_0xd0a9ca);_0x2ee81b(_0xd0a9ca);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index c8baf24..2c9bc58 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 _0xfdbd=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','/:id','isAuthenticated'];(function(_0x5059d9,_0x2d9c56){var _0x59d9c8=function(_0x15c243){while(--_0x15c243){_0x5059d9['push'](_0x5059d9['shift']());}};_0x59d9c8(++_0x2d9c56);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x40d8d7,_0x30dd5e){_0x40d8d7=_0x40d8d7-0x0;var _0x3454cc=_0xfdbd[_0x40d8d7];return _0x3454cc;};'use strict';var multer=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var path=require(_0xdfdb('0x2'));var timeout=require(_0xdfdb('0x3'));var express=require(_0xdfdb('0x4'));var router=express[_0xdfdb('0x5')]();var fs_extra=require(_0xdfdb('0x6'));var auth=require(_0xdfdb('0x7'));var interaction=require(_0xdfdb('0x8'));var config=require('../../config/environment');var controller=require(_0xdfdb('0x9'));router['get'](_0xdfdb('0xa'),auth[_0xdfdb('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xdfdb('0xc')]);router[_0xdfdb('0xd')]('/:id',auth[_0xdfdb('0xb')](),controller[_0xdfdb('0xe')]);router[_0xdfdb('0xf')](_0xdfdb('0xa'),auth[_0xdfdb('0xb')](),controller[_0xdfdb('0x10')]);module[_0xdfdb('0x11')]=router;
\ No newline at end of file
+var _0x326f=['../../config/environment','./chatProactiveAction.controller','get','/:id','show','post','isAuthenticated','create','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3d3cd2,_0xe04f7){var _0xf8db8b=function(_0x2bcc34){while(--_0x2bcc34){_0x3d3cd2['push'](_0x3d3cd2['shift']());}};_0xf8db8b(++_0xe04f7);}(_0x326f,0xd1));var _0xf326=function(_0x181622,_0x4bff32){_0x181622=_0x181622-0x0;var _0xf8ec15=_0x326f[_0x181622];return _0xf8ec15;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')](_0xf326('0xa'),auth['isAuthenticated'](),controller[_0xf326('0xb')]);router[_0xf326('0xc')]('/',auth[_0xf326('0xd')](),controller[_0xf326('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xf')]);router[_0xf326('0x10')](_0xf326('0xa'),auth[_0xf326('0xd')](),controller[_0xf326('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index f2b1d9a..0b36035 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 _0xf91f=['exports','STRING','name','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x1bce05,_0x34a0ab){var _0x188b85=function(_0x46e8cb){while(--_0x46e8cb){_0x1bce05['push'](_0x1bce05['shift']());}};_0x188b85(++_0x34a0ab);}(_0xf91f,0x9f));var _0xff91=function(_0x449625,_0x1f1387){_0x449625=_0x449625-0x0;var _0x37c2b7=_0xf91f[_0x449625];return _0x37c2b7;};'use strict';var Sequelize=require(_0xff91('0x0'));module[_0xff91('0x1')]={'name':{'type':Sequelize[_0xff91('0x2')],'unique':_0xff91('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xff91('0x4')](_0xff91('0x5'),_0xff91('0x6'),_0xff91('0x7'))}};
\ No newline at end of file
+var _0x75b2=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x30d897,_0x7554fd){var _0x5a875c=function(_0x5c3968){while(--_0x5c3968){_0x30d897['push'](_0x30d897['shift']());}};_0x5a875c(++_0x7554fd);}(_0x75b2,0x150));var _0x275b=function(_0x4127cb,_0x508a52){_0x4127cb=_0x4127cb-0x0;var _0x2143af=_0x75b2[_0x4127cb];return _0x2143af;};'use strict';var Sequelize=require(_0x275b('0x0'));module[_0x275b('0x1')]={'name':{'type':Sequelize[_0x275b('0x2')],'unique':_0x275b('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x275b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x275b('0x5')](_0x275b('0x6'),'beepall',_0x275b('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 12e9e47..838c8da 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 _0x3199=['Agents','voicePause','interface','sequelize','transaction','forEach','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','emit','addAgents','omit','spread','isArray','userChatQueue:remove','getAgents','nolimit','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','request','info','debug','request\x20sent','stringify','error','ChatQueue,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','destroy','then','get','ChatQueues','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','where','pick','filter','VIRTUAL','options','includeAll','include','ChatQueue','rows','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','sort','merge','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids'];(function(_0x5498c9,_0x5492ba){var _0x7325c0=function(_0x54565d){while(--_0x54565d){_0x5498c9['push'](_0x5498c9['shift']());}};_0x7325c0(++_0x5492ba);}(_0x3199,0x14d));var _0x9319=function(_0x1a9cb7,_0x29d53a){_0x1a9cb7=_0x1a9cb7-0x0;var _0xdd724e=_0x3199[_0x1a9cb7];return _0xdd724e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9319('0x0'));var rp=require(_0x9319('0x1'));var moment=require(_0x9319('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9319('0x3'));var path=require('path');var sox=require(_0x9319('0x4'));var csv=require(_0x9319('0x5'));var ejs=require(_0x9319('0x6'));var fs=require('fs');var fs_extra=require(_0x9319('0x7'));var _=require(_0x9319('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9319('0x9'));var toCsv=require(_0x9319('0x5'));var querystring=require(_0x9319('0xa'));var Papa=require(_0x9319('0xb'));var Redis=require(_0x9319('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9319('0xd'));var hardwareService=require(_0x9319('0xe'));var logger=require(_0x9319('0xf'))(_0x9319('0x10'));var utils=require(_0x9319('0x11'));var config=require(_0x9319('0x12'));var licenseUtil=require(_0x9319('0x13'));var db=require(_0x9319('0x14'))['db'];config[_0x9319('0x15')]=_['defaults'](config[_0x9319('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x9319('0x16'))(new Redis(config[_0x9319('0x15')]));require(_0x9319('0x17'))[_0x9319('0x18')](socket);var jayson=require(_0x9319('0x19'));var client=jayson[_0x9319('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x156eaa,_0x37ab18,_0x52ae2a,_0x3ae268){return new BPromise(function(_0x7ab64,_0x1e11ec){var _0x297fe5=_0x3ae268||client;return _0x297fe5[_0x9319('0x1b')](_0x156eaa,_0x52ae2a)['then'](function(_0x159809){logger[_0x9319('0x1c')]('ChatQueue,\x20%s,\x20%s',_0x37ab18,'request\x20sent');logger[_0x9319('0x1d')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x37ab18,_0x9319('0x1e'),JSON[_0x9319('0x1f')](_0x159809));if(_0x159809[_0x9319('0x20')]){if(_0x159809['error']['code']===0x1f4){logger[_0x9319('0x20')](_0x9319('0x21'),_0x37ab18,_0x159809[_0x9319('0x20')][_0x9319('0x22')]);return _0x1e11ec(_0x159809[_0x9319('0x20')][_0x9319('0x22')]);}logger[_0x9319('0x20')](_0x9319('0x21'),_0x37ab18,_0x159809[_0x9319('0x20')][_0x9319('0x22')]);return _0x7ab64(_0x159809[_0x9319('0x20')][_0x9319('0x22')]);}else{logger[_0x9319('0x1c')](_0x9319('0x21'),_0x37ab18,_0x9319('0x1e'));_0x7ab64(_0x159809['result']['message']);}})[_0x9319('0x23')](function(_0x1300d6){logger[_0x9319('0x20')]('ChatQueue,\x20%s,\x20%s',_0x37ab18,_0x1300d6);_0x1e11ec(_0x1300d6);});});}function respondWithStatusCode(_0x51eede,_0x1ff838){_0x1ff838=_0x1ff838||0xcc;return function(_0x442a60){if(_0x442a60){return _0x51eede[_0x9319('0x24')](_0x1ff838);}return _0x51eede[_0x9319('0x25')](_0x1ff838)[_0x9319('0x26')]();};}function respondWithResult(_0x4aed03,_0x59ce04){_0x59ce04=_0x59ce04||0xc8;return function(_0x4bffca){if(_0x4bffca){return _0x4aed03[_0x9319('0x25')](_0x59ce04)[_0x9319('0x27')](_0x4bffca);}};}function respondWithFilteredResult(_0x3e51c1,_0x4f80a3){return function(_0x2cbdce){if(_0x2cbdce){var _0x1796fe=typeof _0x4f80a3['offset']===_0x9319('0x28')&&typeof _0x4f80a3[_0x9319('0x29')]===_0x9319('0x28');var _0x4687c4=_0x2cbdce['count'];var _0x95a1c5=_0x1796fe?0x0:_0x4f80a3[_0x9319('0x2a')];var _0xbf1023=_0x1796fe?_0x2cbdce[_0x9319('0x2b')]:_0x4f80a3[_0x9319('0x2a')]+_0x4f80a3[_0x9319('0x29')];var _0x4d814c;if(_0xbf1023>=_0x4687c4){_0xbf1023=_0x4687c4;_0x4d814c=0xc8;}else{_0x4d814c=0xce;}_0x3e51c1[_0x9319('0x25')](_0x4d814c);return _0x3e51c1[_0x9319('0x2c')](_0x9319('0x2d'),_0x95a1c5+'-'+_0xbf1023+'/'+_0x4687c4)[_0x9319('0x27')](_0x2cbdce);}return null;};}function patchUpdates(_0x2a54b9){return function(_0x586837){try{jsonpatch[_0x9319('0x2e')](_0x586837,_0x2a54b9,!![]);}catch(_0x13acad){return BPromise['reject'](_0x13acad);}return _0x586837[_0x9319('0x2f')]();};}function saveUpdates(_0x540615,_0x4a6a1b){return function(_0x191267){if(_0x191267){return _0x191267[_0x9319('0x30')](_0x540615)['then'](function(_0x354db8){return _0x354db8;});}return null;};}function removeEntity(_0x501945,_0x1a6359){return function(_0x4b5b1d){if(_0x4b5b1d){return _0x4b5b1d[_0x9319('0x31')]()[_0x9319('0x32')](function(){var _0x13b6a7=_0x4b5b1d[_0x9319('0x33')]({'plain':!![]});var _0x909fcc=_0x9319('0x34');return db[_0x9319('0x35')][_0x9319('0x31')]({'where':{'type':_0x909fcc,'resourceId':_0x13b6a7['id']}})[_0x9319('0x32')](function(){return _0x4b5b1d;});})[_0x9319('0x32')](function(){_0x501945[_0x9319('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0xaecafe,_0xc77a41){return function(_0x573bc6){if(!_0x573bc6){_0xaecafe[_0x9319('0x24')](0x194);}return _0x573bc6;};}function handleError(_0x3174ab,_0x964447){_0x964447=_0x964447||0x1f4;return function(_0x35cdfb){logger[_0x9319('0x20')](_0x35cdfb[_0x9319('0x36')]);if(_0x35cdfb['name']){delete _0x35cdfb[_0x9319('0x37')];}_0x3174ab[_0x9319('0x25')](_0x964447)[_0x9319('0x38')](_0x35cdfb);};}exports[_0x9319('0x39')]=function(_0x5af9b6,_0x472295){var _0x5321e8={},_0x43cbb4={},_0x55017d={'count':0x0,'rows':[]};var _0x4b6e48=_[_0x9319('0x3a')](db['ChatQueue'][_0x9319('0x3b')],function(_0x500a90){return{'name':_0x500a90[_0x9319('0x3c')],'type':_0x500a90[_0x9319('0x3d')][_0x9319('0x3e')]};});_0x43cbb4[_0x9319('0x3f')]=_['map'](_0x4b6e48,_0x9319('0x37'));_0x43cbb4[_0x9319('0x40')]=_[_0x9319('0x41')](_0x5af9b6[_0x9319('0x40')]);_0x43cbb4[_0x9319('0x42')]=_[_0x9319('0x43')](_0x43cbb4[_0x9319('0x3f')],_0x43cbb4[_0x9319('0x40')]);_0x5321e8[_0x9319('0x44')]=_[_0x9319('0x43')](_0x43cbb4[_0x9319('0x3f')],qs['fields'](_0x5af9b6[_0x9319('0x40')][_0x9319('0x45')]));_0x5321e8[_0x9319('0x44')]=_0x5321e8[_0x9319('0x44')][_0x9319('0x46')]?_0x5321e8[_0x9319('0x44')]:_0x43cbb4['model'];if(!_0x5af9b6[_0x9319('0x40')]['hasOwnProperty']('nolimit')){_0x5321e8[_0x9319('0x29')]=qs[_0x9319('0x29')](_0x5af9b6[_0x9319('0x40')][_0x9319('0x29')]);_0x5321e8[_0x9319('0x2a')]=qs['offset'](_0x5af9b6['query'][_0x9319('0x2a')]);}_0x5321e8[_0x9319('0x47')]=qs['sort'](_0x5af9b6['query']['sort']);_0x5321e8[_0x9319('0x48')]=qs['filters'](_[_0x9319('0x49')](_0x5af9b6['query'],_0x43cbb4['filters']),_0x4b6e48);if(_0x5af9b6[_0x9319('0x40')][_0x9319('0x4a')]){_0x5321e8[_0x9319('0x48')]=_['merge'](_0x5321e8[_0x9319('0x48')],{'$or':_['map'](_0x4b6e48,function(_0x5c43d6){if(_0x5c43d6[_0x9319('0x3d')]!==_0x9319('0x4b')){var _0x29ec75={};_0x29ec75[_0x5c43d6[_0x9319('0x37')]]={'$like':'%'+_0x5af9b6[_0x9319('0x40')][_0x9319('0x4a')]+'%'};return _0x29ec75;}})});}_0x5321e8=_['merge']({},_0x5321e8,_0x5af9b6[_0x9319('0x4c')]);var _0x46e4b5={'where':_0x5321e8[_0x9319('0x48')]};return db['ChatQueue'][_0x9319('0x2b')](_0x46e4b5)['then'](function(_0x39bfe5){_0x55017d[_0x9319('0x2b')]=_0x39bfe5;if(_0x5af9b6[_0x9319('0x40')][_0x9319('0x4d')]){_0x5321e8[_0x9319('0x4e')]=[{'all':!![]}];}return db[_0x9319('0x4f')]['findAll'](_0x5321e8);})['then'](function(_0x3e4209){_0x55017d[_0x9319('0x50')]=_0x3e4209;return _0x55017d;})[_0x9319('0x32')](respondWithFilteredResult(_0x472295,_0x5321e8))[_0x9319('0x23')](handleError(_0x472295,null));};exports['show']=function(_0x5a776e,_0x2df129){var _0x8de4b9={'raw':!![],'where':{'id':_0x5a776e[_0x9319('0x51')]['id']}},_0x2754dc={};_0x2754dc['model']=_['keys'](db['ChatQueue']['rawAttributes']);_0x2754dc[_0x9319('0x40')]=_[_0x9319('0x41')](_0x5a776e['query']);_0x2754dc[_0x9319('0x42')]=_[_0x9319('0x43')](_0x2754dc[_0x9319('0x3f')],_0x2754dc[_0x9319('0x40')]);_0x8de4b9[_0x9319('0x44')]=_[_0x9319('0x43')](_0x2754dc[_0x9319('0x3f')],qs[_0x9319('0x45')](_0x5a776e[_0x9319('0x40')][_0x9319('0x45')]));_0x8de4b9[_0x9319('0x44')]=_0x8de4b9[_0x9319('0x44')][_0x9319('0x46')]?_0x8de4b9['attributes']:_0x2754dc['model'];if(_0x5a776e[_0x9319('0x40')][_0x9319('0x4d')]){_0x8de4b9['include']=[{'all':!![]}];}_0x8de4b9=_['merge']({},_0x8de4b9,_0x5a776e[_0x9319('0x4c')]);return db[_0x9319('0x4f')][_0x9319('0x52')](_0x8de4b9)['then'](handleEntityNotFound(_0x2df129,null))[_0x9319('0x32')](respondWithResult(_0x2df129,null))[_0x9319('0x23')](handleError(_0x2df129,null));};exports[_0x9319('0x53')]=function(_0x548a96,_0x51f567){return db[_0x9319('0x4f')][_0x9319('0x53')](_0x548a96['body'],{})[_0x9319('0x32')](function(_0x3ad391){var _0x5be8b5=_0x548a96[_0x9319('0x54')][_0x9319('0x33')]({'plain':!![]});if(!_0x5be8b5)throw new Error(_0x9319('0x55'));if(_0x5be8b5[_0x9319('0x56')]==='user'){var _0x137fb9=_0x3ad391['get']({'plain':!![]});var _0x2a5eae=_0x9319('0x34');return db[_0x9319('0x57')][_0x9319('0x52')]({'where':{'name':_0x2a5eae,'userProfileId':_0x5be8b5[_0x9319('0x58')]},'raw':!![]})['then'](function(_0x3d80ae){if(_0x3d80ae&&_0x3d80ae[_0x9319('0x59')]===0x0){return db[_0x9319('0x35')][_0x9319('0x53')]({'name':_0x137fb9[_0x9319('0x37')],'resourceId':_0x137fb9['id'],'type':_0x3d80ae['name'],'sectionId':_0x3d80ae['id']},{})[_0x9319('0x32')](function(){return _0x3ad391;});}else{return _0x3ad391;}})['catch'](function(_0x370061){logger[_0x9319('0x20')](_0x9319('0x5a'),_0x370061);throw _0x370061;});}return _0x3ad391;})[_0x9319('0x32')](respondWithResult(_0x51f567,0xc9))['catch'](handleError(_0x51f567,null));};exports[_0x9319('0x30')]=function(_0x2ee7aa,_0x190ade){if(_0x2ee7aa[_0x9319('0x5b')]['id']){delete _0x2ee7aa[_0x9319('0x5b')]['id'];}return db[_0x9319('0x4f')][_0x9319('0x52')]({'where':{'id':_0x2ee7aa['params']['id']}})[_0x9319('0x32')](handleEntityNotFound(_0x190ade,null))[_0x9319('0x32')](saveUpdates(_0x2ee7aa[_0x9319('0x5b')],null))[_0x9319('0x32')](respondWithResult(_0x190ade,null))[_0x9319('0x23')](handleError(_0x190ade,null));};exports['destroy']=function(_0xf8f6c7,_0x53cbbf){return db[_0x9319('0x4f')][_0x9319('0x52')]({'where':{'id':_0xf8f6c7[_0x9319('0x51')]['id']}})[_0x9319('0x32')](handleEntityNotFound(_0x53cbbf,null))[_0x9319('0x32')](removeEntity(_0x53cbbf,null))[_0x9319('0x23')](handleError(_0x53cbbf,null));};exports[_0x9319('0x5c')]=function(_0x1b17be,_0x57f4d3){return db[_0x9319('0x4f')][_0x9319('0x5c')]()[_0x9319('0x32')](respondWithResult(_0x57f4d3,null))[_0x9319('0x23')](handleError(_0x57f4d3,null));};exports[_0x9319('0x5d')]=function(_0x3196c1,_0x3d2ee6,_0x57e701){var _0x4eae2b={'raw':!![],'where':{}},_0x566ba5={},_0x1288d9;return db[_0x9319('0x4f')][_0x9319('0x5e')]({'where':{'id':_0x3196c1['params']['id']}})[_0x9319('0x32')](handleEntityNotFound(_0x3d2ee6,null))[_0x9319('0x32')](function(_0x18211f){if(_0x18211f){_0x1288d9=_0x18211f['get']({'plain':!![]});_0x566ba5['model']=_[_0x9319('0x41')](db[_0x9319('0x5f')]['rawAttributes']);_0x566ba5[_0x9319('0x40')]=_['keys'](_0x3196c1['query']);_0x566ba5[_0x9319('0x42')]=_['intersection'](_0x566ba5[_0x9319('0x3f')],_0x566ba5[_0x9319('0x40')]);_0x4eae2b['attributes']=_[_0x9319('0x43')](_0x566ba5[_0x9319('0x3f')],qs[_0x9319('0x45')](_0x3196c1[_0x9319('0x40')][_0x9319('0x45')]));_0x4eae2b[_0x9319('0x44')]=_0x4eae2b[_0x9319('0x44')]['length']?_0x4eae2b[_0x9319('0x44')]:_0x566ba5[_0x9319('0x3f')];if(!_0x3196c1[_0x9319('0x40')][_0x9319('0x60')]('nolimit')){_0x4eae2b[_0x9319('0x29')]=qs[_0x9319('0x29')](_0x3196c1[_0x9319('0x40')][_0x9319('0x29')]);_0x4eae2b['offset']=qs[_0x9319('0x2a')](_0x3196c1['query'][_0x9319('0x2a')]);}_0x4eae2b['order']=qs[_0x9319('0x61')](_0x3196c1[_0x9319('0x40')][_0x9319('0x61')]);_0x4eae2b[_0x9319('0x48')]=qs[_0x9319('0x42')](_['pick'](_0x3196c1[_0x9319('0x40')],_0x566ba5[_0x9319('0x42')]));_0x4eae2b[_0x9319('0x48')]['ChatQueueId']=_0x18211f['id'];if(_0x3196c1[_0x9319('0x40')][_0x9319('0x4a')]){_0x4eae2b[_0x9319('0x48')]=_[_0x9319('0x62')](_0x4eae2b[_0x9319('0x48')],{'$or':_[_0x9319('0x3a')](_0x4eae2b[_0x9319('0x44')],function(_0x5f1cfc){var _0x6f0f23={};_0x6f0f23[_0x5f1cfc]={'$like':'%'+_0x3196c1[_0x9319('0x40')][_0x9319('0x4a')]+'%'};return _0x6f0f23;})});}_0x4eae2b=_[_0x9319('0x62')]({},_0x4eae2b,_0x3196c1['options']);return db['UserChatQueue'][_0x9319('0x63')](_0x4eae2b);}})[_0x9319('0x32')](function(_0x3ef8f2){if(_0x3ef8f2){return db[_0x9319('0x64')][_0x9319('0x65')]({'where':{'id':_[_0x9319('0x3a')](_0x3ef8f2,_0x9319('0x66')),'role':_0x9319('0x67')},'attributes':['id',_0x9319('0x37'),_0x9319('0x68'),_0x9319('0x69'),_0x9319('0x6a')]});}})['then'](function(_0x2457d5){if(_0x2457d5){return{'count':_0x2457d5[_0x9319('0x2b')],'rows':_[_0x9319('0x3a')](_0x2457d5['rows'],function(_0x4d9737){return{'membername':_0x4d9737[_0x9319('0x37')],'UserId':_0x4d9737['id'],'queue_name':_0x1288d9['name'],'ChatQueueId':_0x1288d9['id'],'interface':util[_0x9319('0x6b')](_0x9319('0x6c'),_0x9319('0x6d'),_0x4d9737[_0x9319('0x37')]),'penalty':0x0,'paused':_0x4d9737['chatPause'],'createdAt':_0x4d9737[_0x9319('0x6a')],'updatedAt':_0x4d9737[_0x9319('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9319('0x32')](respondWithFilteredResult(_0x3d2ee6,_0x4eae2b))[_0x9319('0x23')](handleError(_0x3d2ee6,null));};exports[_0x9319('0x6e')]=function(_0x1624eb,_0x28f8cd,_0x2424e1){var _0x751719={};var _0x1f0331={};var _0x19fbea;var _0x1d2fc6;return db['ChatQueue'][_0x9319('0x5e')]({'where':{'id':_0x1624eb[_0x9319('0x51')]['id']}})['then'](handleEntityNotFound(_0x28f8cd,null))['then'](function(_0x45c79b){if(_0x45c79b){_0x19fbea=_0x45c79b;_0x1f0331[_0x9319('0x3f')]=_[_0x9319('0x41')](db[_0x9319('0x6f')][_0x9319('0x3b')]);_0x1f0331[_0x9319('0x40')]=_[_0x9319('0x41')](_0x1624eb['query']);_0x1f0331[_0x9319('0x42')]=_[_0x9319('0x43')](_0x1f0331[_0x9319('0x3f')],_0x1f0331[_0x9319('0x40')]);_0x751719['attributes']=_[_0x9319('0x43')](_0x1f0331[_0x9319('0x3f')],qs[_0x9319('0x45')](_0x1624eb[_0x9319('0x40')]['fields']));_0x751719[_0x9319('0x44')]=_0x751719[_0x9319('0x44')][_0x9319('0x46')]?_0x751719[_0x9319('0x44')]:_0x1f0331['model'];_0x751719['order']=qs[_0x9319('0x61')](_0x1624eb['query'][_0x9319('0x61')]);_0x751719['where']=qs[_0x9319('0x42')](_[_0x9319('0x49')](_0x1624eb[_0x9319('0x40')],_0x1f0331[_0x9319('0x42')]));if(_0x1624eb[_0x9319('0x40')]['filter']){_0x751719[_0x9319('0x48')]=_[_0x9319('0x62')](_0x751719[_0x9319('0x48')],{'$or':_[_0x9319('0x3a')](_0x751719[_0x9319('0x44')],function(_0x1c39f0){var _0xa61009={};_0xa61009[_0x1c39f0]={'$like':'%'+_0x1624eb['query'][_0x9319('0x4a')]+'%'};return _0xa61009;})});}_0x751719=_['merge']({},_0x751719,_0x1624eb[_0x9319('0x4c')]);return _0x19fbea[_0x9319('0x6e')](_0x751719);}})['then'](function(_0x1011df){if(_0x1011df){_0x1d2fc6=_0x1011df['length'];if(!_0x1624eb[_0x9319('0x40')][_0x9319('0x60')]('nolimit')){_0x751719[_0x9319('0x29')]=qs[_0x9319('0x29')](_0x1624eb[_0x9319('0x40')][_0x9319('0x29')]);_0x751719[_0x9319('0x2a')]=qs['offset'](_0x1624eb[_0x9319('0x40')][_0x9319('0x2a')]);}return _0x19fbea['getTeams'](_0x751719);}})[_0x9319('0x32')](function(_0x4f360b){if(_0x4f360b){return _0x4f360b?{'count':_0x1d2fc6,'rows':_0x4f360b}:null;}})[_0x9319('0x32')](respondWithResult(_0x28f8cd,null))['catch'](handleError(_0x28f8cd,null));};exports[_0x9319('0x70')]=function(_0x95474d,_0x1443ae,_0x105028){var _0x4fc4a5=_0x95474d[_0x9319('0x5b')][_0x9319('0x71')];return db[_0x9319('0x6f')][_0x9319('0x63')]({'where':{'id':_0x4fc4a5},'attributes':['id'],'include':[{'model':db[_0x9319('0x64')],'as':_0x9319('0x72'),'attributes':['id',_0x9319('0x37'),'online',_0x9319('0x73'),_0x9319('0x74')],'raw':!![]}]})[_0x9319('0x32')](function(_0x4c6cb1){if(_0x4c6cb1){var _0x2b6f53=_['flatMap'](_0x4c6cb1,function(_0x2bf96a){var _0x58f11b=_0x2bf96a[_0x9319('0x33')]({'plain':!![]});return _0x58f11b['Agents'];});return db[_0x9319('0x4f')][_0x9319('0x52')]({'where':{'id':_0x95474d[_0x9319('0x51')]['id']}})[_0x9319('0x32')](function(_0x35d55a){return db[_0x9319('0x75')][_0x9319('0x76')](function(_0x19decf){return _0x35d55a[_0x9319('0x70')](_0x4fc4a5,{'transaction':_0x19decf})[_0x9319('0x32')](function(){return BPromise['each'](_0x2b6f53,function(_0x8486ee){return db[_0x9319('0x5f')]['findOrCreate']({'where':{'UserId':_0x8486ee['id'],'ChatQueueId':_0x95474d['params']['id']},'transaction':_0x19decf});});})['then'](function(){_0x2b6f53[_0x9319('0x77')](function(_0x2bd24f){socket['emit']('userChatQueue:save',{'UserId':_0x2bd24f['id'],'ChatQueueId':_0x35d55a['id']});});});});});}})[_0x9319('0x32')](respondWithStatusCode(_0x1443ae,null))[_0x9319('0x23')](handleError(_0x1443ae,null));};exports['removeTeams']=function(_0x5a1e28,_0x30d15f,_0x14841f){return db['Team'][_0x9319('0x63')]({'where':{'id':_0x5a1e28[_0x9319('0x40')][_0x9319('0x71')]},'attributes':['id'],'include':[{'model':db[_0x9319('0x64')],'as':_0x9319('0x72'),'attributes':['id'],'raw':!![]}]})[_0x9319('0x32')](handleEntityNotFound(_0x30d15f,null))[_0x9319('0x32')](function(_0x2d8b5b){var _0x48adfe=_[_0x9319('0x3a')](_0x2d8b5b,'id');var _0x3298c=[];var _0x2d6bd3=[];var _0x5708b4=squel['select']();_0x5708b4['field'](_0x9319('0x78'))['from'](_0x9319('0x79'),'tq')[_0x9319('0x7a')](_0x9319('0x7b'),'ut',_0x9319('0x7c'))[_0x9319('0x48')]('ChatQueueId\x20=\x20?',_0x5a1e28[_0x9319('0x51')]['id']);for(var _0x572a43=0x0;_0x572a43<_0x2d8b5b['length'];_0x572a43+=0x1){let _0x10ebe2=_0x2d8b5b[_0x572a43];for(var _0x151310=0x0;_0x151310<_0x10ebe2[_0x9319('0x72')][_0x9319('0x46')];_0x151310+=0x1){let _0x4121e4=_0x10ebe2[_0x9319('0x72')][_0x151310];var _0x5b5dbf=_0x5708b4[_0x9319('0x7d')]();_0x5b5dbf[_0x9319('0x48')](_0x9319('0x7e'),_0x4121e4['id']);_0x2d6bd3[_0x9319('0x7f')](db['sequelize'][_0x9319('0x40')](_0x5b5dbf[_0x9319('0x80')](),{'type':db[_0x9319('0x75')][_0x9319('0x81')][_0x9319('0x82')]})['then'](function(_0x166c77){if(_0x166c77[_0x9319('0x46')]===0x1){return _0x4121e4['id'];}else{var _0x3fbeca=_[_0x9319('0x83')](_[_0x9319('0x3a')](_0x166c77,_0x9319('0x84')),function(_0x1a3460){return _[_0x9319('0x85')](_0x48adfe,_0x1a3460);});if(_0x3fbeca){return _0x4121e4['id'];}}}));}}return BPromise[_0x9319('0x86')](_0x2d6bd3)[_0x9319('0x32')](function(_0x38ee00){_0x3298c=_(_0x3298c)[_0x9319('0x87')](_0x38ee00)[_0x9319('0x88')]()[_0x9319('0x89')]();return db['ChatQueue'][_0x9319('0x52')]({'where':{'id':_0x5a1e28[_0x9319('0x51')]['id']}})[_0x9319('0x32')](function(_0x231188){return db[_0x9319('0x75')][_0x9319('0x76')](function(_0x1b44e0){return _0x231188[_0x9319('0x8a')](_0x5a1e28[_0x9319('0x40')][_0x9319('0x71')],{'transaction':_0x1b44e0})['then'](function(){if(!_[_0x9319('0x8b')](_0x3298c)){return _0x231188[_0x9319('0x8c')](_0x3298c,{'transaction':_0x1b44e0});}})[_0x9319('0x32')](function(){_0x3298c[_0x9319('0x77')](function(_0x35afa4){socket[_0x9319('0x8d')]('userChatQueue:remove',{'UserId':_0x35afa4,'ChatQueueId':_0x231188['id']});});});});});});})[_0x9319('0x32')](respondWithStatusCode(_0x30d15f,null))[_0x9319('0x23')](handleError(_0x30d15f,null));};exports[_0x9319('0x8e')]=function(_0x401d9c,_0x3c7127,_0x3b0a9f){return db[_0x9319('0x4f')][_0x9319('0x52')]({'where':{'id':_0x401d9c[_0x9319('0x51')]['id']}})[_0x9319('0x32')](handleEntityNotFound(_0x3c7127,null))[_0x9319('0x32')](function(_0x3225fa){if(_0x3225fa){return _0x3225fa[_0x9319('0x8e')](_0x401d9c['body'][_0x9319('0x71')],_[_0x9319('0x8f')](_0x401d9c[_0x9319('0x5b')],[_0x9319('0x71'),'id'])||{})[_0x9319('0x90')](function(_0x2093ba){for(var _0x142f81=0x0;_0x142f81<_0x401d9c[_0x9319('0x5b')][_0x9319('0x71')][_0x9319('0x46')];_0x142f81+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x401d9c[_0x9319('0x5b')][_0x9319('0x71')][_0x142f81]),'ChatQueueId':Number(_0x401d9c['params']['id'])});}return _0x2093ba;});}})[_0x9319('0x32')](respondWithResult(_0x3c7127,null))['catch'](handleError(_0x3c7127,null));};exports['removeAgents']=function(_0x56c2a9,_0x195966,_0x3c1b40){return db['ChatQueue'][_0x9319('0x52')]({'where':{'id':_0x56c2a9[_0x9319('0x51')]['id']}})[_0x9319('0x32')](handleEntityNotFound(_0x195966,null))[_0x9319('0x32')](function(_0x318b76){if(_0x318b76){return _0x318b76[_0x9319('0x8c')](_0x56c2a9['query'][_0x9319('0x71')])[_0x9319('0x32')](function(){if(_[_0x9319('0x91')](_0x56c2a9['query'][_0x9319('0x71')])){for(var _0x265c45=0x0;_0x265c45<_0x56c2a9[_0x9319('0x40')][_0x9319('0x71')][_0x9319('0x46')];_0x265c45+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x56c2a9[_0x9319('0x40')][_0x9319('0x71')][_0x265c45]),'ChatQueueId':Number(_0x56c2a9[_0x9319('0x51')]['id'])});}}else{socket['emit'](_0x9319('0x92'),{'UserId':Number(_0x56c2a9[_0x9319('0x40')][_0x9319('0x71')]),'ChatQueueId':Number(_0x56c2a9[_0x9319('0x51')]['id'])});}});}})[_0x9319('0x32')](respondWithStatusCode(_0x195966,null))[_0x9319('0x23')](handleError(_0x195966,null));};exports[_0x9319('0x93')]=function(_0x3b53e3,_0x51aacb,_0x234e77){var _0x5347a7={};var _0x74b2bb={};var _0x3d0c3b;var _0x38d23f;return db['ChatQueue'][_0x9319('0x5e')]({'where':{'id':_0x3b53e3[_0x9319('0x51')]['id']}})['then'](handleEntityNotFound(_0x51aacb,null))['then'](function(_0x279ccd){if(_0x279ccd){_0x3d0c3b=_0x279ccd;_0x74b2bb[_0x9319('0x3f')]=_[_0x9319('0x41')](db['User']['rawAttributes']);_0x74b2bb['query']=_[_0x9319('0x41')](_0x3b53e3[_0x9319('0x40')]);_0x74b2bb[_0x9319('0x42')]=_[_0x9319('0x43')](_0x74b2bb['model'],_0x74b2bb[_0x9319('0x40')]);_0x5347a7[_0x9319('0x44')]=_[_0x9319('0x43')](_0x74b2bb[_0x9319('0x3f')],qs[_0x9319('0x45')](_0x3b53e3[_0x9319('0x40')][_0x9319('0x45')]));_0x5347a7[_0x9319('0x44')]=_0x5347a7[_0x9319('0x44')][_0x9319('0x46')]?_0x5347a7[_0x9319('0x44')]:_0x74b2bb['model'];_0x5347a7[_0x9319('0x47')]=qs[_0x9319('0x61')](_0x3b53e3[_0x9319('0x40')][_0x9319('0x61')]);_0x5347a7[_0x9319('0x48')]=qs[_0x9319('0x42')](_[_0x9319('0x49')](_0x3b53e3[_0x9319('0x40')],_0x74b2bb[_0x9319('0x42')]));if(_0x3b53e3[_0x9319('0x40')]['filter']){_0x5347a7[_0x9319('0x48')]=_[_0x9319('0x62')](_0x5347a7['where'],{'$or':_[_0x9319('0x3a')](_0x5347a7[_0x9319('0x44')],function(_0x23a91c){var _0x2980a3={};_0x2980a3[_0x23a91c]={'$like':'%'+_0x3b53e3[_0x9319('0x40')]['filter']+'%'};return _0x2980a3;})});}_0x5347a7=_[_0x9319('0x62')]({},_0x5347a7,_0x3b53e3[_0x9319('0x4c')]);return _0x3d0c3b[_0x9319('0x93')](_0x5347a7);}})[_0x9319('0x32')](function(_0x8bd107){if(_0x8bd107){_0x38d23f=_0x8bd107[_0x9319('0x46')];if(!_0x3b53e3[_0x9319('0x40')][_0x9319('0x60')](_0x9319('0x94'))){_0x5347a7[_0x9319('0x29')]=qs[_0x9319('0x29')](_0x3b53e3[_0x9319('0x40')][_0x9319('0x29')]);_0x5347a7[_0x9319('0x2a')]=qs[_0x9319('0x2a')](_0x3b53e3[_0x9319('0x40')][_0x9319('0x2a')]);}return _0x3d0c3b[_0x9319('0x93')](_0x5347a7);}})[_0x9319('0x32')](function(_0x5e8cf1){if(_0x5e8cf1){return _0x5e8cf1?{'count':_0x38d23f,'rows':_0x5e8cf1}:null;}})['then'](respondWithResult(_0x51aacb,null))['catch'](handleError(_0x51aacb,null));};
\ No newline at end of file
+var _0x8f65=['Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','removeTeams','User','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','ids','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','userChatQueue:save','isArray','emit','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','./chatQueue.socket','register','jayson/promise','client','http','then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','status','end','json','undefined','count','offset','limit','set','apply','save','destroy','get','UserProfileResource','sendStatus','stack','name','ChatQueue','fieldName','type','key','model','map','query','filters','attributes','intersection','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','fields','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatQueues','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','rawAttributes','nolimit','ChatQueueId','UserChatQueue','UserId','chatPause','updatedAt','createdAt','format','SIP','getTeams'];(function(_0x1f7839,_0x2a26e6){var _0x36b42e=function(_0x553222){while(--_0x553222){_0x1f7839['push'](_0x1f7839['shift']());}};_0x36b42e(++_0x2a26e6);}(_0x8f65,0x15e));var _0x58f6=function(_0x229cf6,_0x5a68d3){_0x229cf6=_0x229cf6-0x0;var _0x2a3b7f=_0x8f65[_0x229cf6];return _0x2a3b7f;};'use strict';var emlformat=require(_0x58f6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x58f6('0x1'));var rp=require(_0x58f6('0x2'));var moment=require(_0x58f6('0x3'));var BPromise=require(_0x58f6('0x4'));var Mustache=require(_0x58f6('0x5'));var util=require(_0x58f6('0x6'));var path=require(_0x58f6('0x7'));var sox=require(_0x58f6('0x8'));var csv=require(_0x58f6('0x9'));var ejs=require(_0x58f6('0xa'));var fs=require('fs');var fs_extra=require(_0x58f6('0xb'));var _=require(_0x58f6('0xc'));var squel=require(_0x58f6('0xd'));var crypto=require('crypto');var jsforce=require(_0x58f6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x58f6('0x9'));var querystring=require('querystring');var Papa=require(_0x58f6('0xf'));var Redis=require(_0x58f6('0x10'));var authService=require(_0x58f6('0x11'));var qs=require(_0x58f6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x58f6('0x13'))(_0x58f6('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x58f6('0x15'));var db=require(_0x58f6('0x16'))['db'];config[_0x58f6('0x17')]=_['defaults'](config[_0x58f6('0x17')],{'host':_0x58f6('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x58f6('0x17')]));require(_0x58f6('0x19'))[_0x58f6('0x1a')](socket);var jayson=require(_0x58f6('0x1b'));var client=jayson[_0x58f6('0x1c')][_0x58f6('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x444bea,_0x24dff7,_0x4a31ef,_0xf7719f){return new BPromise(function(_0x5ed96b,_0x36033a){var _0x588be2=_0xf7719f||client;return _0x588be2['request'](_0x444bea,_0x4a31ef)[_0x58f6('0x1e')](function(_0x3e2c88){logger[_0x58f6('0x1f')]('ChatQueue,\x20%s,\x20%s',_0x24dff7,_0x58f6('0x20'));logger['debug'](_0x58f6('0x21'),_0x24dff7,_0x58f6('0x20'),JSON[_0x58f6('0x22')](_0x3e2c88));if(_0x3e2c88['error']){if(_0x3e2c88[_0x58f6('0x23')][_0x58f6('0x24')]===0x1f4){logger[_0x58f6('0x23')](_0x58f6('0x25'),_0x24dff7,_0x3e2c88[_0x58f6('0x23')][_0x58f6('0x26')]);return _0x36033a(_0x3e2c88['error'][_0x58f6('0x26')]);}logger[_0x58f6('0x23')](_0x58f6('0x25'),_0x24dff7,_0x3e2c88[_0x58f6('0x23')][_0x58f6('0x26')]);return _0x5ed96b(_0x3e2c88[_0x58f6('0x23')][_0x58f6('0x26')]);}else{logger[_0x58f6('0x1f')](_0x58f6('0x25'),_0x24dff7,_0x58f6('0x20'));_0x5ed96b(_0x3e2c88[_0x58f6('0x27')][_0x58f6('0x26')]);}})[_0x58f6('0x28')](function(_0x39451d){logger[_0x58f6('0x23')](_0x58f6('0x25'),_0x24dff7,_0x39451d);_0x36033a(_0x39451d);});});}function respondWithStatusCode(_0x1ea454,_0x2886ef){_0x2886ef=_0x2886ef||0xcc;return function(_0x4210d6){if(_0x4210d6){return _0x1ea454['sendStatus'](_0x2886ef);}return _0x1ea454[_0x58f6('0x29')](_0x2886ef)[_0x58f6('0x2a')]();};}function respondWithResult(_0x55b087,_0x38d0be){_0x38d0be=_0x38d0be||0xc8;return function(_0x4aa29e){if(_0x4aa29e){return _0x55b087[_0x58f6('0x29')](_0x38d0be)[_0x58f6('0x2b')](_0x4aa29e);}};}function respondWithFilteredResult(_0x56aecf,_0x37fec3){return function(_0x43eca0){if(_0x43eca0){var _0x3a983e=typeof _0x37fec3['offset']===_0x58f6('0x2c')&&typeof _0x37fec3['limit']==='undefined';var _0x1e2248=_0x43eca0[_0x58f6('0x2d')];var _0x25c0f1=_0x3a983e?0x0:_0x37fec3[_0x58f6('0x2e')];var _0x11b547=_0x3a983e?_0x43eca0[_0x58f6('0x2d')]:_0x37fec3[_0x58f6('0x2e')]+_0x37fec3[_0x58f6('0x2f')];var _0x3a3acf;if(_0x11b547>=_0x1e2248){_0x11b547=_0x1e2248;_0x3a3acf=0xc8;}else{_0x3a3acf=0xce;}_0x56aecf[_0x58f6('0x29')](_0x3a3acf);return _0x56aecf[_0x58f6('0x30')]('Content-Range',_0x25c0f1+'-'+_0x11b547+'/'+_0x1e2248)[_0x58f6('0x2b')](_0x43eca0);}return null;};}function patchUpdates(_0x523b20){return function(_0x531c23){try{jsonpatch[_0x58f6('0x31')](_0x531c23,_0x523b20,!![]);}catch(_0x4851f9){return BPromise['reject'](_0x4851f9);}return _0x531c23[_0x58f6('0x32')]();};}function saveUpdates(_0x5466d8,_0x49ae02){return function(_0xdf80f0){if(_0xdf80f0){return _0xdf80f0['update'](_0x5466d8)[_0x58f6('0x1e')](function(_0x2a95fe){return _0x2a95fe;});}return null;};}function removeEntity(_0x48c985,_0x5c1e13){return function(_0xf71584){if(_0xf71584){return _0xf71584[_0x58f6('0x33')]()[_0x58f6('0x1e')](function(){var _0x232add=_0xf71584[_0x58f6('0x34')]({'plain':!![]});var _0x58f521='ChatQueues';return db[_0x58f6('0x35')][_0x58f6('0x33')]({'where':{'type':_0x58f521,'resourceId':_0x232add['id']}})[_0x58f6('0x1e')](function(){return _0xf71584;});})[_0x58f6('0x1e')](function(){_0x48c985['status'](0xcc)[_0x58f6('0x2a')]();});}};}function handleEntityNotFound(_0x2d1565,_0x108675){return function(_0x4eae04){if(!_0x4eae04){_0x2d1565[_0x58f6('0x36')](0x194);}return _0x4eae04;};}function handleError(_0x4d9b0b,_0x347270){_0x347270=_0x347270||0x1f4;return function(_0x1bc626){logger[_0x58f6('0x23')](_0x1bc626[_0x58f6('0x37')]);if(_0x1bc626[_0x58f6('0x38')]){delete _0x1bc626[_0x58f6('0x38')];}_0x4d9b0b[_0x58f6('0x29')](_0x347270)['send'](_0x1bc626);};}exports['index']=function(_0x564f84,_0x31d270){var _0x458469={},_0x5c4308={},_0x5cfd46={'count':0x0,'rows':[]};var _0x3d558b=_['map'](db[_0x58f6('0x39')]['rawAttributes'],function(_0xc55fc2){return{'name':_0xc55fc2[_0x58f6('0x3a')],'type':_0xc55fc2[_0x58f6('0x3b')][_0x58f6('0x3c')]};});_0x5c4308[_0x58f6('0x3d')]=_[_0x58f6('0x3e')](_0x3d558b,_0x58f6('0x38'));_0x5c4308[_0x58f6('0x3f')]=_['keys'](_0x564f84[_0x58f6('0x3f')]);_0x5c4308[_0x58f6('0x40')]=_['intersection'](_0x5c4308[_0x58f6('0x3d')],_0x5c4308[_0x58f6('0x3f')]);_0x458469[_0x58f6('0x41')]=_[_0x58f6('0x42')](_0x5c4308[_0x58f6('0x3d')],qs['fields'](_0x564f84[_0x58f6('0x3f')]['fields']));_0x458469[_0x58f6('0x41')]=_0x458469[_0x58f6('0x41')]['length']?_0x458469['attributes']:_0x5c4308[_0x58f6('0x3d')];if(!_0x564f84[_0x58f6('0x3f')][_0x58f6('0x43')]('nolimit')){_0x458469[_0x58f6('0x2f')]=qs['limit'](_0x564f84[_0x58f6('0x3f')][_0x58f6('0x2f')]);_0x458469[_0x58f6('0x2e')]=qs[_0x58f6('0x2e')](_0x564f84[_0x58f6('0x3f')][_0x58f6('0x2e')]);}_0x458469[_0x58f6('0x44')]=qs[_0x58f6('0x45')](_0x564f84[_0x58f6('0x3f')]['sort']);_0x458469['where']=qs[_0x58f6('0x40')](_[_0x58f6('0x46')](_0x564f84[_0x58f6('0x3f')],_0x5c4308[_0x58f6('0x40')]),_0x3d558b);if(_0x564f84[_0x58f6('0x3f')][_0x58f6('0x47')]){_0x458469[_0x58f6('0x48')]=_[_0x58f6('0x49')](_0x458469[_0x58f6('0x48')],{'$or':_[_0x58f6('0x3e')](_0x3d558b,function(_0x2c3d8a){if(_0x2c3d8a[_0x58f6('0x3b')]!==_0x58f6('0x4a')){var _0x2366f4={};_0x2366f4[_0x2c3d8a[_0x58f6('0x38')]]={'$like':'%'+_0x564f84[_0x58f6('0x3f')][_0x58f6('0x47')]+'%'};return _0x2366f4;}})});}_0x458469=_[_0x58f6('0x49')]({},_0x458469,_0x564f84[_0x58f6('0x4b')]);var _0x430db2={'where':_0x458469[_0x58f6('0x48')]};return db[_0x58f6('0x39')]['count'](_0x430db2)[_0x58f6('0x1e')](function(_0x16fadf){_0x5cfd46[_0x58f6('0x2d')]=_0x16fadf;if(_0x564f84[_0x58f6('0x3f')][_0x58f6('0x4c')]){_0x458469['include']=[{'all':!![]}];}return db[_0x58f6('0x39')][_0x58f6('0x4d')](_0x458469);})[_0x58f6('0x1e')](function(_0x37d652){_0x5cfd46[_0x58f6('0x4e')]=_0x37d652;return _0x5cfd46;})[_0x58f6('0x1e')](respondWithFilteredResult(_0x31d270,_0x458469))['catch'](handleError(_0x31d270,null));};exports[_0x58f6('0x4f')]=function(_0x5abe6f,_0x5b2ee0){var _0x32de4f={'raw':!![],'where':{'id':_0x5abe6f[_0x58f6('0x50')]['id']}},_0x54031a={};_0x54031a[_0x58f6('0x3d')]=_[_0x58f6('0x51')](db[_0x58f6('0x39')]['rawAttributes']);_0x54031a[_0x58f6('0x3f')]=_[_0x58f6('0x51')](_0x5abe6f[_0x58f6('0x3f')]);_0x54031a[_0x58f6('0x40')]=_[_0x58f6('0x42')](_0x54031a[_0x58f6('0x3d')],_0x54031a['query']);_0x32de4f[_0x58f6('0x41')]=_[_0x58f6('0x42')](_0x54031a[_0x58f6('0x3d')],qs[_0x58f6('0x52')](_0x5abe6f[_0x58f6('0x3f')][_0x58f6('0x52')]));_0x32de4f[_0x58f6('0x41')]=_0x32de4f['attributes'][_0x58f6('0x53')]?_0x32de4f[_0x58f6('0x41')]:_0x54031a[_0x58f6('0x3d')];if(_0x5abe6f['query'][_0x58f6('0x4c')]){_0x32de4f[_0x58f6('0x54')]=[{'all':!![]}];}_0x32de4f=_[_0x58f6('0x49')]({},_0x32de4f,_0x5abe6f[_0x58f6('0x4b')]);return db['ChatQueue'][_0x58f6('0x55')](_0x32de4f)[_0x58f6('0x1e')](handleEntityNotFound(_0x5b2ee0,null))[_0x58f6('0x1e')](respondWithResult(_0x5b2ee0,null))[_0x58f6('0x28')](handleError(_0x5b2ee0,null));};exports[_0x58f6('0x56')]=function(_0x416245,_0x30d4c6){return db[_0x58f6('0x39')][_0x58f6('0x56')](_0x416245[_0x58f6('0x57')],{})[_0x58f6('0x1e')](function(_0xdde841){var _0x239d0c=_0x416245[_0x58f6('0x58')]['get']({'plain':!![]});if(!_0x239d0c)throw new Error(_0x58f6('0x59'));if(_0x239d0c['role']===_0x58f6('0x58')){var _0x35c2dd=_0xdde841[_0x58f6('0x34')]({'plain':!![]});var _0x5ae710=_0x58f6('0x5a');return db[_0x58f6('0x5b')][_0x58f6('0x55')]({'where':{'name':_0x5ae710,'userProfileId':_0x239d0c['userProfileId']},'raw':!![]})[_0x58f6('0x1e')](function(_0x38879c){if(_0x38879c&&_0x38879c[_0x58f6('0x5c')]===0x0){return db[_0x58f6('0x35')][_0x58f6('0x56')]({'name':_0x35c2dd['name'],'resourceId':_0x35c2dd['id'],'type':_0x38879c[_0x58f6('0x38')],'sectionId':_0x38879c['id']},{})['then'](function(){return _0xdde841;});}else{return _0xdde841;}})[_0x58f6('0x28')](function(_0xf4d52d){logger['error'](_0x58f6('0x5d'),_0xf4d52d);throw _0xf4d52d;});}return _0xdde841;})[_0x58f6('0x1e')](respondWithResult(_0x30d4c6,0xc9))[_0x58f6('0x28')](handleError(_0x30d4c6,null));};exports[_0x58f6('0x5e')]=function(_0x9a0e11,_0x316a8c){if(_0x9a0e11[_0x58f6('0x57')]['id']){delete _0x9a0e11[_0x58f6('0x57')]['id'];}return db[_0x58f6('0x39')][_0x58f6('0x55')]({'where':{'id':_0x9a0e11[_0x58f6('0x50')]['id']}})[_0x58f6('0x1e')](handleEntityNotFound(_0x316a8c,null))[_0x58f6('0x1e')](saveUpdates(_0x9a0e11[_0x58f6('0x57')],null))[_0x58f6('0x1e')](respondWithResult(_0x316a8c,null))[_0x58f6('0x28')](handleError(_0x316a8c,null));};exports[_0x58f6('0x33')]=function(_0x5702cb,_0x5a6afd){return db[_0x58f6('0x39')][_0x58f6('0x55')]({'where':{'id':_0x5702cb[_0x58f6('0x50')]['id']}})[_0x58f6('0x1e')](handleEntityNotFound(_0x5a6afd,null))[_0x58f6('0x1e')](removeEntity(_0x5a6afd,null))[_0x58f6('0x28')](handleError(_0x5a6afd,null));};exports[_0x58f6('0x5f')]=function(_0x1e32c9,_0x23964a){return db[_0x58f6('0x39')][_0x58f6('0x5f')]()[_0x58f6('0x1e')](respondWithResult(_0x23964a,null))['catch'](handleError(_0x23964a,null));};exports[_0x58f6('0x60')]=function(_0x469b49,_0x29348a,_0x488174){var _0x289be7={'raw':!![],'where':{}},_0x48ea82={},_0x58c43e;return db['ChatQueue'][_0x58f6('0x61')]({'where':{'id':_0x469b49[_0x58f6('0x50')]['id']}})['then'](handleEntityNotFound(_0x29348a,null))[_0x58f6('0x1e')](function(_0x308080){if(_0x308080){_0x58c43e=_0x308080[_0x58f6('0x34')]({'plain':!![]});_0x48ea82['model']=_['keys'](db['UserChatQueue'][_0x58f6('0x62')]);_0x48ea82[_0x58f6('0x3f')]=_[_0x58f6('0x51')](_0x469b49['query']);_0x48ea82[_0x58f6('0x40')]=_[_0x58f6('0x42')](_0x48ea82['model'],_0x48ea82[_0x58f6('0x3f')]);_0x289be7[_0x58f6('0x41')]=_[_0x58f6('0x42')](_0x48ea82['model'],qs[_0x58f6('0x52')](_0x469b49[_0x58f6('0x3f')]['fields']));_0x289be7[_0x58f6('0x41')]=_0x289be7['attributes']['length']?_0x289be7[_0x58f6('0x41')]:_0x48ea82[_0x58f6('0x3d')];if(!_0x469b49[_0x58f6('0x3f')][_0x58f6('0x43')](_0x58f6('0x63'))){_0x289be7['limit']=qs['limit'](_0x469b49[_0x58f6('0x3f')]['limit']);_0x289be7[_0x58f6('0x2e')]=qs[_0x58f6('0x2e')](_0x469b49[_0x58f6('0x3f')][_0x58f6('0x2e')]);}_0x289be7[_0x58f6('0x44')]=qs[_0x58f6('0x45')](_0x469b49['query'][_0x58f6('0x45')]);_0x289be7[_0x58f6('0x48')]=qs[_0x58f6('0x40')](_[_0x58f6('0x46')](_0x469b49['query'],_0x48ea82[_0x58f6('0x40')]));_0x289be7[_0x58f6('0x48')][_0x58f6('0x64')]=_0x308080['id'];if(_0x469b49['query'][_0x58f6('0x47')]){_0x289be7['where']=_[_0x58f6('0x49')](_0x289be7[_0x58f6('0x48')],{'$or':_[_0x58f6('0x3e')](_0x289be7[_0x58f6('0x41')],function(_0x3a455e){var _0x3c019d={};_0x3c019d[_0x3a455e]={'$like':'%'+_0x469b49[_0x58f6('0x3f')][_0x58f6('0x47')]+'%'};return _0x3c019d;})});}_0x289be7=_[_0x58f6('0x49')]({},_0x289be7,_0x469b49[_0x58f6('0x4b')]);return db[_0x58f6('0x65')][_0x58f6('0x4d')](_0x289be7);}})[_0x58f6('0x1e')](function(_0x44dfdf){if(_0x44dfdf){return db['User']['findAndCountAll']({'where':{'id':_[_0x58f6('0x3e')](_0x44dfdf,_0x58f6('0x66')),'role':'agent'},'attributes':['id',_0x58f6('0x38'),_0x58f6('0x67'),_0x58f6('0x68'),_0x58f6('0x69')]});}})[_0x58f6('0x1e')](function(_0x35b58b){if(_0x35b58b){return{'count':_0x35b58b['count'],'rows':_[_0x58f6('0x3e')](_0x35b58b[_0x58f6('0x4e')],function(_0x31b6e5){return{'membername':_0x31b6e5['name'],'UserId':_0x31b6e5['id'],'queue_name':_0x58c43e[_0x58f6('0x38')],'ChatQueueId':_0x58c43e['id'],'interface':util[_0x58f6('0x6a')]('%s/%s',_0x58f6('0x6b'),_0x31b6e5['name']),'penalty':0x0,'paused':_0x31b6e5['chatPause'],'createdAt':_0x31b6e5['createdAt'],'updatedAt':_0x31b6e5[_0x58f6('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x58f6('0x1e')](respondWithFilteredResult(_0x29348a,_0x289be7))[_0x58f6('0x28')](handleError(_0x29348a,null));};exports[_0x58f6('0x6c')]=function(_0x1db16e,_0x3f52d1,_0x829074){var _0x41e7d3={};var _0x18c3e8={};var _0xfe9ea8;var _0x2d7039;return db[_0x58f6('0x39')][_0x58f6('0x61')]({'where':{'id':_0x1db16e[_0x58f6('0x50')]['id']}})[_0x58f6('0x1e')](handleEntityNotFound(_0x3f52d1,null))[_0x58f6('0x1e')](function(_0x15f810){if(_0x15f810){_0xfe9ea8=_0x15f810;_0x18c3e8[_0x58f6('0x3d')]=_[_0x58f6('0x51')](db['Team'][_0x58f6('0x62')]);_0x18c3e8[_0x58f6('0x3f')]=_[_0x58f6('0x51')](_0x1db16e['query']);_0x18c3e8[_0x58f6('0x40')]=_[_0x58f6('0x42')](_0x18c3e8[_0x58f6('0x3d')],_0x18c3e8[_0x58f6('0x3f')]);_0x41e7d3[_0x58f6('0x41')]=_['intersection'](_0x18c3e8[_0x58f6('0x3d')],qs[_0x58f6('0x52')](_0x1db16e['query'][_0x58f6('0x52')]));_0x41e7d3[_0x58f6('0x41')]=_0x41e7d3[_0x58f6('0x41')][_0x58f6('0x53')]?_0x41e7d3['attributes']:_0x18c3e8[_0x58f6('0x3d')];_0x41e7d3[_0x58f6('0x44')]=qs['sort'](_0x1db16e[_0x58f6('0x3f')][_0x58f6('0x45')]);_0x41e7d3[_0x58f6('0x48')]=qs[_0x58f6('0x40')](_[_0x58f6('0x46')](_0x1db16e[_0x58f6('0x3f')],_0x18c3e8[_0x58f6('0x40')]));if(_0x1db16e[_0x58f6('0x3f')][_0x58f6('0x47')]){_0x41e7d3[_0x58f6('0x48')]=_[_0x58f6('0x49')](_0x41e7d3[_0x58f6('0x48')],{'$or':_[_0x58f6('0x3e')](_0x41e7d3[_0x58f6('0x41')],function(_0x2e2845){var _0x25f621={};_0x25f621[_0x2e2845]={'$like':'%'+_0x1db16e[_0x58f6('0x3f')][_0x58f6('0x47')]+'%'};return _0x25f621;})});}_0x41e7d3=_[_0x58f6('0x49')]({},_0x41e7d3,_0x1db16e[_0x58f6('0x4b')]);return _0xfe9ea8[_0x58f6('0x6c')](_0x41e7d3);}})['then'](function(_0x434e8a){if(_0x434e8a){_0x2d7039=_0x434e8a['length'];if(!_0x1db16e['query']['hasOwnProperty']('nolimit')){_0x41e7d3[_0x58f6('0x2f')]=qs['limit'](_0x1db16e[_0x58f6('0x3f')][_0x58f6('0x2f')]);_0x41e7d3[_0x58f6('0x2e')]=qs['offset'](_0x1db16e[_0x58f6('0x3f')][_0x58f6('0x2e')]);}return _0xfe9ea8[_0x58f6('0x6c')](_0x41e7d3);}})['then'](function(_0x2e11dd){if(_0x2e11dd){return _0x2e11dd?{'count':_0x2d7039,'rows':_0x2e11dd}:null;}})[_0x58f6('0x1e')](respondWithResult(_0x3f52d1,null))['catch'](handleError(_0x3f52d1,null));};exports['addTeams']=function(_0x536c77,_0x5c5cc0,_0x48e4c8){var _0xbc04d1=_0x536c77[_0x58f6('0x57')]['ids'];return db[_0x58f6('0x6d')][_0x58f6('0x4d')]({'where':{'id':_0xbc04d1},'attributes':['id'],'include':[{'model':db['User'],'as':_0x58f6('0x6e'),'attributes':['id',_0x58f6('0x38'),_0x58f6('0x6f'),_0x58f6('0x70'),_0x58f6('0x71')],'raw':!![]}]})[_0x58f6('0x1e')](function(_0x44cd42){if(_0x44cd42){var _0x42acbe=_[_0x58f6('0x72')](_0x44cd42,function(_0xa9c3e7){var _0x4354af=_0xa9c3e7[_0x58f6('0x34')]({'plain':!![]});return _0x4354af[_0x58f6('0x6e')];});return db['ChatQueue']['find']({'where':{'id':_0x536c77[_0x58f6('0x50')]['id']}})[_0x58f6('0x1e')](function(_0xf644fd){return db[_0x58f6('0x73')][_0x58f6('0x74')](function(_0x39f443){return _0xf644fd[_0x58f6('0x75')](_0xbc04d1,{'transaction':_0x39f443})[_0x58f6('0x1e')](function(){return BPromise[_0x58f6('0x76')](_0x42acbe,function(_0x5f5403){return db['UserChatQueue'][_0x58f6('0x77')]({'where':{'UserId':_0x5f5403['id'],'ChatQueueId':_0x536c77[_0x58f6('0x50')]['id']},'transaction':_0x39f443});});})[_0x58f6('0x1e')](function(){_0x42acbe[_0x58f6('0x78')](function(_0x518673){socket['emit']('userChatQueue:save',{'UserId':_0x518673['id'],'ChatQueueId':_0xf644fd['id']});});});});});}})[_0x58f6('0x1e')](respondWithStatusCode(_0x5c5cc0,null))[_0x58f6('0x28')](handleError(_0x5c5cc0,null));};exports[_0x58f6('0x79')]=function(_0x55d2ac,_0x3e821c,_0x2c38a2){return db['Team'][_0x58f6('0x4d')]({'where':{'id':_0x55d2ac[_0x58f6('0x3f')]['ids']},'attributes':['id'],'include':[{'model':db[_0x58f6('0x7a')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x58f6('0x1e')](handleEntityNotFound(_0x3e821c,null))['then'](function(_0x467d3e){var _0x4a4948=_[_0x58f6('0x3e')](_0x467d3e,'id');var _0x267785=[];var _0x1de4bb=[];var _0x1c5957=squel[_0x58f6('0x7b')]();_0x1c5957[_0x58f6('0x7c')](_0x58f6('0x7d'))[_0x58f6('0x7e')](_0x58f6('0x7f'),'tq')[_0x58f6('0x80')]('user_has_teams','ut',_0x58f6('0x81'))[_0x58f6('0x48')](_0x58f6('0x82'),_0x55d2ac[_0x58f6('0x50')]['id']);for(var _0x24e041=0x0;_0x24e041<_0x467d3e[_0x58f6('0x53')];_0x24e041+=0x1){let _0x38829d=_0x467d3e[_0x24e041];for(var _0x4f8efc=0x0;_0x4f8efc<_0x38829d[_0x58f6('0x6e')]['length'];_0x4f8efc+=0x1){let _0x35e0ab=_0x38829d[_0x58f6('0x6e')][_0x4f8efc];var _0x2cc7d5=_0x1c5957[_0x58f6('0x83')]();_0x2cc7d5[_0x58f6('0x48')]('ut.UserId\x20=\x20?',_0x35e0ab['id']);_0x1de4bb[_0x58f6('0x84')](db['sequelize'][_0x58f6('0x3f')](_0x2cc7d5[_0x58f6('0x85')](),{'type':db[_0x58f6('0x73')][_0x58f6('0x86')][_0x58f6('0x87')]})[_0x58f6('0x1e')](function(_0x2a1eaf){if(_0x2a1eaf['length']===0x1){return _0x35e0ab['id'];}else{var _0x3a90a9=_[_0x58f6('0x88')](_[_0x58f6('0x3e')](_0x2a1eaf,_0x58f6('0x89')),function(_0x5080a1){return _[_0x58f6('0x8a')](_0x4a4948,_0x5080a1);});if(_0x3a90a9){return _0x35e0ab['id'];}}}));}}return BPromise[_0x58f6('0x8b')](_0x1de4bb)[_0x58f6('0x1e')](function(_0x12ff08){_0x267785=_(_0x267785)[_0x58f6('0x8c')](_0x12ff08)[_0x58f6('0x8d')]()[_0x58f6('0x8e')]();return db[_0x58f6('0x39')][_0x58f6('0x55')]({'where':{'id':_0x55d2ac[_0x58f6('0x50')]['id']}})[_0x58f6('0x1e')](function(_0x2b4960){return db['sequelize'][_0x58f6('0x74')](function(_0x281420){return _0x2b4960[_0x58f6('0x79')](_0x55d2ac['query'][_0x58f6('0x8f')],{'transaction':_0x281420})[_0x58f6('0x1e')](function(){if(!_[_0x58f6('0x90')](_0x267785)){return _0x2b4960[_0x58f6('0x91')](_0x267785,{'transaction':_0x281420});}})['then'](function(){_0x267785[_0x58f6('0x78')](function(_0x1f7bc9){socket['emit'](_0x58f6('0x92'),{'UserId':_0x1f7bc9,'ChatQueueId':_0x2b4960['id']});});});});});});})[_0x58f6('0x1e')](respondWithStatusCode(_0x3e821c,null))[_0x58f6('0x28')](handleError(_0x3e821c,null));};exports[_0x58f6('0x93')]=function(_0x501d3e,_0x16b6e4,_0x3cc108){return db[_0x58f6('0x39')][_0x58f6('0x55')]({'where':{'id':_0x501d3e[_0x58f6('0x50')]['id']}})['then'](handleEntityNotFound(_0x16b6e4,null))['then'](function(_0x215c9b){if(_0x215c9b){return _0x215c9b['addAgents'](_0x501d3e['body'][_0x58f6('0x8f')],_['omit'](_0x501d3e[_0x58f6('0x57')],[_0x58f6('0x8f'),'id'])||{})[_0x58f6('0x94')](function(_0x473049){for(var _0x4bed5f=0x0;_0x4bed5f<_0x501d3e[_0x58f6('0x57')][_0x58f6('0x8f')]['length'];_0x4bed5f+=0x1){socket['emit'](_0x58f6('0x95'),{'UserId':Number(_0x501d3e[_0x58f6('0x57')][_0x58f6('0x8f')][_0x4bed5f]),'ChatQueueId':Number(_0x501d3e[_0x58f6('0x50')]['id'])});}return _0x473049;});}})[_0x58f6('0x1e')](respondWithResult(_0x16b6e4,null))['catch'](handleError(_0x16b6e4,null));};exports[_0x58f6('0x91')]=function(_0x16f7d0,_0x9c062c,_0x3e5d40){return db[_0x58f6('0x39')][_0x58f6('0x55')]({'where':{'id':_0x16f7d0[_0x58f6('0x50')]['id']}})[_0x58f6('0x1e')](handleEntityNotFound(_0x9c062c,null))[_0x58f6('0x1e')](function(_0x260fec){if(_0x260fec){return _0x260fec[_0x58f6('0x91')](_0x16f7d0[_0x58f6('0x3f')][_0x58f6('0x8f')])[_0x58f6('0x1e')](function(){if(_[_0x58f6('0x96')](_0x16f7d0[_0x58f6('0x3f')]['ids'])){for(var _0x2d8f62=0x0;_0x2d8f62<_0x16f7d0['query'][_0x58f6('0x8f')]['length'];_0x2d8f62+=0x1){socket[_0x58f6('0x97')](_0x58f6('0x92'),{'UserId':Number(_0x16f7d0['query'][_0x58f6('0x8f')][_0x2d8f62]),'ChatQueueId':Number(_0x16f7d0[_0x58f6('0x50')]['id'])});}}else{socket[_0x58f6('0x97')](_0x58f6('0x92'),{'UserId':Number(_0x16f7d0[_0x58f6('0x3f')]['ids']),'ChatQueueId':Number(_0x16f7d0[_0x58f6('0x50')]['id'])});}});}})[_0x58f6('0x1e')](respondWithStatusCode(_0x9c062c,null))[_0x58f6('0x28')](handleError(_0x9c062c,null));};exports[_0x58f6('0x98')]=function(_0x32c085,_0x6eaa52,_0x1c3d8e){var _0x405e98={};var _0x2dc9f0={};var _0x3910f5;var _0x55b080;return db['ChatQueue'][_0x58f6('0x61')]({'where':{'id':_0x32c085[_0x58f6('0x50')]['id']}})[_0x58f6('0x1e')](handleEntityNotFound(_0x6eaa52,null))[_0x58f6('0x1e')](function(_0x2a49c2){if(_0x2a49c2){_0x3910f5=_0x2a49c2;_0x2dc9f0[_0x58f6('0x3d')]=_[_0x58f6('0x51')](db[_0x58f6('0x7a')][_0x58f6('0x62')]);_0x2dc9f0[_0x58f6('0x3f')]=_[_0x58f6('0x51')](_0x32c085[_0x58f6('0x3f')]);_0x2dc9f0['filters']=_[_0x58f6('0x42')](_0x2dc9f0[_0x58f6('0x3d')],_0x2dc9f0[_0x58f6('0x3f')]);_0x405e98[_0x58f6('0x41')]=_[_0x58f6('0x42')](_0x2dc9f0[_0x58f6('0x3d')],qs[_0x58f6('0x52')](_0x32c085['query'][_0x58f6('0x52')]));_0x405e98[_0x58f6('0x41')]=_0x405e98[_0x58f6('0x41')][_0x58f6('0x53')]?_0x405e98[_0x58f6('0x41')]:_0x2dc9f0[_0x58f6('0x3d')];_0x405e98['order']=qs[_0x58f6('0x45')](_0x32c085['query'][_0x58f6('0x45')]);_0x405e98[_0x58f6('0x48')]=qs['filters'](_['pick'](_0x32c085[_0x58f6('0x3f')],_0x2dc9f0['filters']));if(_0x32c085[_0x58f6('0x3f')]['filter']){_0x405e98[_0x58f6('0x48')]=_[_0x58f6('0x49')](_0x405e98[_0x58f6('0x48')],{'$or':_[_0x58f6('0x3e')](_0x405e98[_0x58f6('0x41')],function(_0x4906fa){var _0x44f547={};_0x44f547[_0x4906fa]={'$like':'%'+_0x32c085[_0x58f6('0x3f')][_0x58f6('0x47')]+'%'};return _0x44f547;})});}_0x405e98=_['merge']({},_0x405e98,_0x32c085[_0x58f6('0x4b')]);return _0x3910f5[_0x58f6('0x98')](_0x405e98);}})[_0x58f6('0x1e')](function(_0x5eabc7){if(_0x5eabc7){_0x55b080=_0x5eabc7[_0x58f6('0x53')];if(!_0x32c085[_0x58f6('0x3f')][_0x58f6('0x43')](_0x58f6('0x63'))){_0x405e98[_0x58f6('0x2f')]=qs[_0x58f6('0x2f')](_0x32c085[_0x58f6('0x3f')]['limit']);_0x405e98[_0x58f6('0x2e')]=qs['offset'](_0x32c085[_0x58f6('0x3f')][_0x58f6('0x2e')]);}return _0x3910f5[_0x58f6('0x98')](_0x405e98);}})[_0x58f6('0x1e')](function(_0x3461ac){if(_0x3461ac){return _0x3461ac?{'count':_0x55b080,'rows':_0x3461ac}:null;}})[_0x58f6('0x1e')](respondWithResult(_0x6eaa52,null))[_0x58f6('0x28')](handleError(_0x6eaa52,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 20cdd20..819b57c 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 _0x5400=['exports','events','../../mysqldb','emit','hook'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x5400,0x15f));var _0x0540=function(_0x19c1c9,_0x238c89){_0x19c1c9=_0x19c1c9-0x0;var _0x1c64dd=_0x5400[_0x19c1c9];return _0x1c64dd;};'use strict';var EventEmitter=require(_0x0540('0x0'));var ChatQueue=require(_0x0540('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x388ed6){return function(_0x48b1bf,_0x5ea2b3,_0x4f5fb3){ChatQueueEvents[_0x0540('0x2')](_0x388ed6+':'+_0x48b1bf['id'],_0x48b1bf);ChatQueueEvents[_0x0540('0x2')](_0x388ed6,_0x48b1bf);_0x4f5fb3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x0540('0x3')](e,emitEvent(event));}}module[_0x0540('0x4')]=ChatQueueEvents;
\ No newline at end of file
+var _0x1d18=['../../mysqldb','ChatQueue','setMaxListeners','save','remove','emit','hook','exports','events'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x1d18,0x10d));var _0x81d1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d18[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x81d1('0x0'));var ChatQueue=require(_0x81d1('0x1'))['db'][_0x81d1('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x81d1('0x3')](0x0);var events={'afterCreate':_0x81d1('0x4'),'afterUpdate':'update','afterDestroy':_0x81d1('0x5')};function emitEvent(_0x486ff4){return function(_0x45bba6,_0x25d207,_0x5c62b3){ChatQueueEvents[_0x81d1('0x6')](_0x486ff4+':'+_0x45bba6['id'],_0x45bba6);ChatQueueEvents[_0x81d1('0x6')](_0x486ff4,_0x45bba6);_0x5c62b3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x81d1('0x7')](e,emitEvent(event));}}module[_0x81d1('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 7a254a3..f3aeec3 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 _0x0878=['ChatQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueue.attributes','exports','define'];(function(_0xec7ddf,_0x41a30c){var _0x1145a6=function(_0x216256){while(--_0x216256){_0xec7ddf['push'](_0xec7ddf['shift']());}};_0x1145a6(++_0x41a30c);}(_0x0878,0x105));var _0x8087=function(_0x5cc834,_0x109903){_0x5cc834=_0x5cc834-0x0;var _0x5125b6=_0x0878[_0x5cc834];return _0x5125b6;};'use strict';var _=require(_0x8087('0x0'));var util=require(_0x8087('0x1'));var logger=require(_0x8087('0x2'))(_0x8087('0x3'));var moment=require(_0x8087('0x4'));var BPromise=require(_0x8087('0x5'));var rp=require(_0x8087('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8087('0x7'));var config=require(_0x8087('0x8'));var attributes=require(_0x8087('0x9'));module[_0x8087('0xa')]=function(_0x126cd0,_0x55c8ca){return _0x126cd0[_0x8087('0xb')](_0x8087('0xc'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x667c=['chat_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','exports','ChatQueue'];(function(_0x305e84,_0x48ef99){var _0x4e38eb=function(_0x585143){while(--_0x585143){_0x305e84['push'](_0x305e84['shift']());}};_0x4e38eb(++_0x48ef99);}(_0x667c,0x141));var _0xc667=function(_0x507e29,_0x8897aa){_0x507e29=_0x507e29-0x0;var _0x4f1ef9=_0x667c[_0x507e29];return _0x4f1ef9;};'use strict';var _=require(_0xc667('0x0'));var util=require(_0xc667('0x1'));var logger=require(_0xc667('0x2'))(_0xc667('0x3'));var moment=require('moment');var BPromise=require(_0xc667('0x4'));var rp=require(_0xc667('0x5'));var fs=require('fs');var path=require(_0xc667('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0xc667('0x7')]=function(_0x54eeba,_0x34b4ee){return _0x54eeba['define'](_0xc667('0x8'),attributes,{'tableName':_0xc667('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 488a117..e48d348 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 _0x2e16=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatQueue','options','raw','where','attributes','limit','include','map','model','debug','GetChatQueue','catch','ShowChatQueue','lodash','randomstring','ioredis'];(function(_0x34d812,_0x36c464){var _0x1cd40b=function(_0x40b78d){while(--_0x40b78d){_0x34d812['push'](_0x34d812['shift']());}};_0x1cd40b(++_0x36c464);}(_0x2e16,0x8d));var _0x62e1=function(_0x3e9507,_0x111f53){_0x3e9507=_0x3e9507-0x0;var _0x2fb7df=_0x2e16[_0x3e9507];return _0x2fb7df;};'use strict';var _=require(_0x62e1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x62e1('0x1'));var fs=require('fs');var Redis=require(_0x62e1('0x2'));var db=require(_0x62e1('0x3'))['db'];var utils=require(_0x62e1('0x4'));var logger=require('../../config/logger')(_0x62e1('0x5'));var config=require(_0x62e1('0x6'));var jayson=require(_0x62e1('0x7'));var client=jayson[_0x62e1('0x8')][_0x62e1('0x9')]({'port':0x232a});config[_0x62e1('0xa')]=_[_0x62e1('0xb')](config[_0x62e1('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x62e1('0xc'))(new Redis(config[_0x62e1('0xa')]));require('./chatQueue.socket')[_0x62e1('0xd')](socket);function respondWithRpcPromise(_0x528ec6,_0x4f66e4,_0x2bd27c){return new BPromise(function(_0xbc14e4,_0x3d741f){return client[_0x62e1('0xe')](_0x528ec6,_0x2bd27c)[_0x62e1('0xf')](function(_0xab7486){logger[_0x62e1('0x10')](_0x62e1('0x11'),_0x4f66e4,_0x62e1('0x12'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4f66e4,_0x62e1('0x12'),JSON[_0x62e1('0x13')](_0xab7486));if(_0xab7486[_0x62e1('0x14')]){if(_0xab7486[_0x62e1('0x14')][_0x62e1('0x15')]===0x1f4){logger[_0x62e1('0x14')]('ChatQueue,\x20%s,\x20%s',_0x4f66e4,_0xab7486[_0x62e1('0x14')][_0x62e1('0x16')]);return _0x3d741f(_0xab7486['error'][_0x62e1('0x16')]);}logger[_0x62e1('0x14')]('ChatQueue,\x20%s,\x20%s',_0x4f66e4,_0xab7486[_0x62e1('0x14')][_0x62e1('0x16')]);return _0xbc14e4(_0xab7486['error'][_0x62e1('0x16')]);}else{logger['info'](_0x62e1('0x11'),_0x4f66e4,_0x62e1('0x12'));_0xbc14e4(_0xab7486['result']['message']);}})['catch'](function(_0x4d63a0){logger[_0x62e1('0x14')](_0x62e1('0x11'),_0x4f66e4,_0x4d63a0);_0x3d741f(_0x4d63a0);});});}exports['GetChatQueue']=function(_0x295f93){var _0x3bdf8e=this;return new Promise(function(_0x5d1142,_0x3a232a){return db[_0x62e1('0x17')]['findAll']({'raw':_0x295f93[_0x62e1('0x18')]?_0x295f93[_0x62e1('0x18')][_0x62e1('0x19')]===undefined?!![]:![]:!![],'where':_0x295f93['options']?_0x295f93[_0x62e1('0x18')][_0x62e1('0x1a')]||null:null,'attributes':_0x295f93[_0x62e1('0x18')]?_0x295f93[_0x62e1('0x18')][_0x62e1('0x1b')]||null:null,'limit':_0x295f93[_0x62e1('0x18')]?_0x295f93[_0x62e1('0x18')][_0x62e1('0x1c')]||null:null,'include':_0x295f93[_0x62e1('0x18')]?_0x295f93['options'][_0x62e1('0x1d')]?_['map'](_0x295f93[_0x62e1('0x18')][_0x62e1('0x1d')],function(_0xba9310){return{'model':db[_0xba9310['model']],'as':_0xba9310['as'],'attributes':_0xba9310[_0x62e1('0x1b')],'include':_0xba9310[_0x62e1('0x1d')]?_[_0x62e1('0x1e')](_0xba9310['include'],function(_0x563338){return{'model':db[_0x563338['model']],'as':_0x563338['as'],'attributes':_0x563338['attributes'],'include':_0x563338[_0x62e1('0x1d')]?_[_0x62e1('0x1e')](_0x563338[_0x62e1('0x1d')],function(_0x48cb73){return{'model':db[_0x48cb73[_0x62e1('0x1f')]],'as':_0x48cb73['as'],'attributes':_0x48cb73[_0x62e1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x62e1('0xf')](function(_0x9b39f2){logger[_0x62e1('0x10')]('GetChatQueue',_0x295f93);logger[_0x62e1('0x20')](_0x62e1('0x21'),_0x295f93,JSON[_0x62e1('0x13')](_0x9b39f2));_0x5d1142(_0x9b39f2);})[_0x62e1('0x22')](function(_0x4482d8){logger['error'](_0x62e1('0x21'),_0x4482d8[_0x62e1('0x16')],_0x295f93);_0x3a232a(_0x3bdf8e[_0x62e1('0x14')](0x1f4,_0x4482d8[_0x62e1('0x16')]));});});};exports[_0x62e1('0x23')]=function(_0x4c0d52){var _0x24cdb5=this;return new Promise(function(_0x405981,_0x48cb78){return db[_0x62e1('0x17')]['find']({'raw':_0x4c0d52[_0x62e1('0x18')]?_0x4c0d52['options'][_0x62e1('0x19')]===undefined?!![]:![]:!![],'where':_0x4c0d52[_0x62e1('0x18')]?_0x4c0d52[_0x62e1('0x18')][_0x62e1('0x1a')]||null:null,'attributes':_0x4c0d52[_0x62e1('0x18')]?_0x4c0d52[_0x62e1('0x18')][_0x62e1('0x1b')]||null:null,'include':_0x4c0d52[_0x62e1('0x18')]?_0x4c0d52['options'][_0x62e1('0x1d')]?_[_0x62e1('0x1e')](_0x4c0d52['options'][_0x62e1('0x1d')],function(_0x421d76){return{'model':db[_0x421d76[_0x62e1('0x1f')]],'as':_0x421d76['as'],'attributes':_0x421d76[_0x62e1('0x1b')],'include':_0x421d76[_0x62e1('0x1d')]?_[_0x62e1('0x1e')](_0x421d76[_0x62e1('0x1d')],function(_0x5393c2){return{'model':db[_0x5393c2[_0x62e1('0x1f')]],'as':_0x5393c2['as'],'attributes':_0x5393c2[_0x62e1('0x1b')],'include':_0x5393c2[_0x62e1('0x1d')]?_['map'](_0x5393c2[_0x62e1('0x1d')],function(_0x4a5b91){return{'model':db[_0x4a5b91[_0x62e1('0x1f')]],'as':_0x4a5b91['as'],'attributes':_0x4a5b91[_0x62e1('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35e413){logger['info'](_0x62e1('0x23'),_0x4c0d52);logger[_0x62e1('0x20')]('ShowChatQueue',_0x4c0d52,JSON[_0x62e1('0x13')](_0x35e413));_0x405981(_0x35e413);})[_0x62e1('0x22')](function(_0x28a416){logger['error'](_0x62e1('0x23'),_0x28a416[_0x62e1('0x16')],_0x4c0d52);_0x48cb78(_0x24cdb5[_0x62e1('0x14')](0x1f4,_0x28a416[_0x62e1('0x16')]));});});};
\ No newline at end of file
+var _0xf7a1=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','redis','defaults','socket.io-emitter','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetChatQueue','ChatQueue','findAll','raw','options','where','attributes','limit','include','map','model','catch','ShowChatQueue','find','lodash','util','moment'];(function(_0x3f30bb,_0x147ea7){var _0x370835=function(_0x459ff6){while(--_0x459ff6){_0x3f30bb['push'](_0x3f30bb['shift']());}};_0x370835(++_0x147ea7);}(_0xf7a1,0xed));var _0x1f7a=function(_0x1dfce3,_0x491d21){_0x1dfce3=_0x1dfce3-0x0;var _0x127504=_0xf7a1[_0x1dfce3];return _0x127504;};'use strict';var _=require(_0x1f7a('0x0'));var util=require(_0x1f7a('0x1'));var moment=require(_0x1f7a('0x2'));var BPromise=require(_0x1f7a('0x3'));var rs=require(_0x1f7a('0x4'));var fs=require('fs');var Redis=require(_0x1f7a('0x5'));var db=require(_0x1f7a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1f7a('0x7'))('rpc');var config=require(_0x1f7a('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1f7a('0x9')]({'port':0x232a});config[_0x1f7a('0xa')]=_[_0x1f7a('0xb')](config[_0x1f7a('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x1f7a('0xc'))(new Redis(config[_0x1f7a('0xa')]));require(_0x1f7a('0xd'))[_0x1f7a('0xe')](socket);function respondWithRpcPromise(_0x5d357a,_0x527b0a,_0x4d0838){return new BPromise(function(_0x1cc3b8,_0xd2296){return client['request'](_0x5d357a,_0x4d0838)[_0x1f7a('0xf')](function(_0x57deac){logger[_0x1f7a('0x10')](_0x1f7a('0x11'),_0x527b0a,_0x1f7a('0x12'));logger[_0x1f7a('0x13')](_0x1f7a('0x14'),_0x527b0a,_0x1f7a('0x12'),JSON[_0x1f7a('0x15')](_0x57deac));if(_0x57deac[_0x1f7a('0x16')]){if(_0x57deac[_0x1f7a('0x16')][_0x1f7a('0x17')]===0x1f4){logger[_0x1f7a('0x16')](_0x1f7a('0x11'),_0x527b0a,_0x57deac[_0x1f7a('0x16')][_0x1f7a('0x18')]);return _0xd2296(_0x57deac[_0x1f7a('0x16')][_0x1f7a('0x18')]);}logger['error'](_0x1f7a('0x11'),_0x527b0a,_0x57deac[_0x1f7a('0x16')][_0x1f7a('0x18')]);return _0x1cc3b8(_0x57deac['error']['message']);}else{logger['info'](_0x1f7a('0x11'),_0x527b0a,_0x1f7a('0x12'));_0x1cc3b8(_0x57deac[_0x1f7a('0x19')]['message']);}})['catch'](function(_0x2998ab){logger[_0x1f7a('0x16')](_0x1f7a('0x11'),_0x527b0a,_0x2998ab);_0xd2296(_0x2998ab);});});}exports[_0x1f7a('0x1a')]=function(_0x4f1a32){var _0x33151b=this;return new Promise(function(_0x92fcc0,_0x68bd8e){return db[_0x1f7a('0x1b')][_0x1f7a('0x1c')]({'raw':_0x4f1a32['options']?_0x4f1a32['options'][_0x1f7a('0x1d')]===undefined?!![]:![]:!![],'where':_0x4f1a32[_0x1f7a('0x1e')]?_0x4f1a32[_0x1f7a('0x1e')][_0x1f7a('0x1f')]||null:null,'attributes':_0x4f1a32[_0x1f7a('0x1e')]?_0x4f1a32['options'][_0x1f7a('0x20')]||null:null,'limit':_0x4f1a32[_0x1f7a('0x1e')]?_0x4f1a32[_0x1f7a('0x1e')][_0x1f7a('0x21')]||null:null,'include':_0x4f1a32[_0x1f7a('0x1e')]?_0x4f1a32[_0x1f7a('0x1e')][_0x1f7a('0x22')]?_[_0x1f7a('0x23')](_0x4f1a32[_0x1f7a('0x1e')][_0x1f7a('0x22')],function(_0x112c6a){return{'model':db[_0x112c6a['model']],'as':_0x112c6a['as'],'attributes':_0x112c6a[_0x1f7a('0x20')],'include':_0x112c6a['include']?_['map'](_0x112c6a[_0x1f7a('0x22')],function(_0x4060ed){return{'model':db[_0x4060ed[_0x1f7a('0x24')]],'as':_0x4060ed['as'],'attributes':_0x4060ed['attributes'],'include':_0x4060ed['include']?_[_0x1f7a('0x23')](_0x4060ed[_0x1f7a('0x22')],function(_0x20d580){return{'model':db[_0x20d580[_0x1f7a('0x24')]],'as':_0x20d580['as'],'attributes':_0x20d580[_0x1f7a('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5f5add){logger['info'](_0x1f7a('0x1a'),_0x4f1a32);logger[_0x1f7a('0x13')](_0x1f7a('0x1a'),_0x4f1a32,JSON['stringify'](_0x5f5add));_0x92fcc0(_0x5f5add);})[_0x1f7a('0x25')](function(_0x25fe34){logger[_0x1f7a('0x16')](_0x1f7a('0x1a'),_0x25fe34[_0x1f7a('0x18')],_0x4f1a32);_0x68bd8e(_0x33151b[_0x1f7a('0x16')](0x1f4,_0x25fe34[_0x1f7a('0x18')]));});});};exports[_0x1f7a('0x26')]=function(_0x2d13b0){var _0x238b09=this;return new Promise(function(_0x4caf76,_0x2746e8){return db[_0x1f7a('0x1b')][_0x1f7a('0x27')]({'raw':_0x2d13b0[_0x1f7a('0x1e')]?_0x2d13b0[_0x1f7a('0x1e')][_0x1f7a('0x1d')]===undefined?!![]:![]:!![],'where':_0x2d13b0[_0x1f7a('0x1e')]?_0x2d13b0[_0x1f7a('0x1e')]['where']||null:null,'attributes':_0x2d13b0[_0x1f7a('0x1e')]?_0x2d13b0[_0x1f7a('0x1e')][_0x1f7a('0x20')]||null:null,'include':_0x2d13b0[_0x1f7a('0x1e')]?_0x2d13b0[_0x1f7a('0x1e')][_0x1f7a('0x22')]?_[_0x1f7a('0x23')](_0x2d13b0['options']['include'],function(_0x662a0a){return{'model':db[_0x662a0a[_0x1f7a('0x24')]],'as':_0x662a0a['as'],'attributes':_0x662a0a[_0x1f7a('0x20')],'include':_0x662a0a['include']?_[_0x1f7a('0x23')](_0x662a0a['include'],function(_0x378364){return{'model':db[_0x378364['model']],'as':_0x378364['as'],'attributes':_0x378364[_0x1f7a('0x20')],'include':_0x378364[_0x1f7a('0x22')]?_[_0x1f7a('0x23')](_0x378364[_0x1f7a('0x22')],function(_0x359936){return{'model':db[_0x359936[_0x1f7a('0x24')]],'as':_0x359936['as'],'attributes':_0x359936[_0x1f7a('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1f7a('0xf')](function(_0x25214d){logger[_0x1f7a('0x10')](_0x1f7a('0x26'),_0x2d13b0);logger[_0x1f7a('0x13')](_0x1f7a('0x26'),_0x2d13b0,JSON['stringify'](_0x25214d));_0x4caf76(_0x25214d);})[_0x1f7a('0x25')](function(_0x21de85){logger[_0x1f7a('0x16')](_0x1f7a('0x26'),_0x21de85[_0x1f7a('0x18')],_0x2d13b0);_0x2746e8(_0x238b09['error'](0x1f4,_0x21de85[_0x1f7a('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 77a8268..dc30b94 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 _0x2dae=['remove','update','removeListener','register','length','chatQueue:','./chatQueue.events'];(function(_0x2e6ac8,_0x2803a7){var _0x359f61=function(_0x5c5edb){while(--_0x5c5edb){_0x2e6ac8['push'](_0x2e6ac8['shift']());}};_0x359f61(++_0x2803a7);}(_0x2dae,0xc3));var _0xe2da=function(_0xf34b0a,_0x11e116){_0xf34b0a=_0xf34b0a-0x0;var _0x5021e1=_0x2dae[_0xf34b0a];return _0x5021e1;};'use strict';var ChatQueueEvents=require(_0xe2da('0x0'));var events=['save',_0xe2da('0x1'),_0xe2da('0x2')];function createListener(_0xcd0055,_0x167432){return function(_0x99b46f){_0x167432['emit'](_0xcd0055,_0x99b46f);};}function removeListener(_0x25b9f2,_0x439b5d){return function(){ChatQueueEvents[_0xe2da('0x3')](_0x25b9f2,_0x439b5d);};}exports[_0xe2da('0x4')]=function(_0x523c60){for(var _0x3e3e25=0x0,_0x89c70b=events[_0xe2da('0x5')];_0x3e3e25<_0x89c70b;_0x3e3e25++){var _0x2efbd8=events[_0x3e3e25];var _0x238da3=createListener(_0xe2da('0x6')+_0x2efbd8,_0x523c60);ChatQueueEvents['on'](_0x2efbd8,_0x238da3);}};
\ No newline at end of file
+var _0x34e8=['register','length','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x34e8,0x12c));var _0x834e=function(_0x52bc93,_0x20248e){_0x52bc93=_0x52bc93-0x0;var _0x1bf392=_0x34e8[_0x52bc93];return _0x1bf392;};'use strict';var ChatQueueEvents=require(_0x834e('0x0'));var events=[_0x834e('0x1'),_0x834e('0x2'),_0x834e('0x3')];function createListener(_0x530939,_0x832422){return function(_0x21e2e0){_0x832422[_0x834e('0x4')](_0x530939,_0x21e2e0);};}function removeListener(_0x31bf20,_0x289ef2){return function(){ChatQueueEvents[_0x834e('0x5')](_0x31bf20,_0x289ef2);};}exports[_0x834e('0x6')]=function(_0x4a2018){for(var _0x858aa1=0x0,_0x52056d=events[_0x834e('0x7')];_0x858aa1<_0x52056d;_0x858aa1++){var _0x3cc2e3=events[_0x858aa1];var _0x3a3ef6=createListener(_0x834e('0x8')+_0x3cc2e3,_0x4a2018);ChatQueueEvents['on'](_0x3cc2e3,_0x3a3ef6);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 0ad7b2f..5d6a00c 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x203e08,_0x15d5c5){var _0x3a0493=function(_0x272f51){while(--_0x272f51){_0x203e08['push'](_0x203e08['shift']());}};_0x3a0493(++_0x15d5c5);}(_0xe14b,0x93));var _0xbe14=function(_0x2da8c2,_0x372428){_0x2da8c2=_0x2da8c2-0x0;var _0x230adb=_0xe14b[_0x2da8c2];return _0x230adb;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
+var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x2dc942,_0x583b72){var _0x5e89f5=function(_0x27bab4){while(--_0x27bab4){_0x2dc942['push'](_0x2dc942['shift']());}};_0x5e89f5(++_0x583b72);}(_0xe14b,0x93));var _0xbe14=function(_0x5804c8,_0x57af4d){_0x5804c8=_0x5804c8-0x0;var _0x33d432=_0xe14b[_0x5804c8];return _0x33d432;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index c0feb84..145e696 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 _0x557b=['exports','STRING','DATE'];(function(_0x56e4e7,_0x1db098){var _0x383618=function(_0xb088c6){while(--_0xb088c6){_0x56e4e7['push'](_0x56e4e7['shift']());}};_0x383618(++_0x1db098);}(_0x557b,0x1b9));var _0xb557=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x557b[_0x278e3c];return _0x3e2d9b;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xb557('0x0')]={'uniqueid':{'type':Sequelize[_0xb557('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xb557('0x1')]},'joinAt':{'type':Sequelize[_0xb557('0x2')]},'leaveAt':{'type':Sequelize[_0xb557('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xb557('0x2')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xe58a=['DATE','moment','STRING'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0xe58a,0x115));var _0xae58=function(_0x375105,_0x3807ab){_0x375105=_0x375105-0x0;var _0x316092=_0xe58a[_0x375105];return _0x316092;};'use strict';var moment=require(_0xae58('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xae58('0x1')]},'joinAt':{'type':Sequelize[_0xae58('0x2')]},'leaveAt':{'type':Sequelize[_0xae58('0x2')]},'acceptAt':{'type':Sequelize[_0xae58('0x2')]},'exitAt':{'type':Sequelize[_0xae58('0x2')]},'reason':{'type':Sequelize[_0xae58('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 6877842..8a8e481 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 _0x7f27=['body','describe','eml-format','rimraf','request-promise','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','ChatQueueReport','rawAttributes','type','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','fields','find','create'];(function(_0x36cecf,_0x4f952f){var _0x11bc23=function(_0x3d46da){while(--_0x3d46da){_0x36cecf['push'](_0x36cecf['shift']());}};_0x11bc23(++_0x4f952f);}(_0x7f27,0x12e));var _0x77f2=function(_0x437f10,_0x19556e){_0x437f10=_0x437f10-0x0;var _0x5a8640=_0x7f27[_0x437f10];return _0x5a8640;};'use strict';var emlformat=require(_0x77f2('0x0'));var rimraf=require(_0x77f2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x77f2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x77f2('0x3'));var util=require(_0x77f2('0x4'));var path=require(_0x77f2('0x5'));var sox=require('sox');var csv=require(_0x77f2('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x77f2('0x7'));var _=require(_0x77f2('0x8'));var squel=require('squel');var crypto=require(_0x77f2('0x9'));var jsforce=require(_0x77f2('0xa'));var deskjs=require(_0x77f2('0xb'));var toCsv=require(_0x77f2('0x6'));var querystring=require('querystring');var Papa=require(_0x77f2('0xc'));var Redis=require(_0x77f2('0xd'));var authService=require(_0x77f2('0xe'));var qs=require(_0x77f2('0xf'));var as=require(_0x77f2('0x10'));var hardwareService=require(_0x77f2('0x11'));var logger=require(_0x77f2('0x12'))(_0x77f2('0x13'));var utils=require(_0x77f2('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x77f2('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d9f74,_0x22b2fb){_0x22b2fb=_0x22b2fb||0xcc;return function(_0x2fda15){if(_0x2fda15){return _0x5d9f74[_0x77f2('0x16')](_0x22b2fb);}return _0x5d9f74[_0x77f2('0x17')](_0x22b2fb)[_0x77f2('0x18')]();};}function respondWithResult(_0x1ee66f,_0x4d5ab5){_0x4d5ab5=_0x4d5ab5||0xc8;return function(_0x330e80){if(_0x330e80){return _0x1ee66f[_0x77f2('0x17')](_0x4d5ab5)[_0x77f2('0x19')](_0x330e80);}};}function respondWithFilteredResult(_0x1c6edf,_0x178a9a){return function(_0xf437f2){if(_0xf437f2){var _0x64471d=typeof _0x178a9a[_0x77f2('0x1a')]===_0x77f2('0x1b')&&typeof _0x178a9a['limit']===_0x77f2('0x1b');var _0x528f02=_0xf437f2[_0x77f2('0x1c')];var _0xffdf18=_0x64471d?0x0:_0x178a9a[_0x77f2('0x1a')];var _0x4db73f=_0x64471d?_0xf437f2[_0x77f2('0x1c')]:_0x178a9a[_0x77f2('0x1a')]+_0x178a9a[_0x77f2('0x1d')];var _0x270ba7;if(_0x4db73f>=_0x528f02){_0x4db73f=_0x528f02;_0x270ba7=0xc8;}else{_0x270ba7=0xce;}_0x1c6edf[_0x77f2('0x17')](_0x270ba7);return _0x1c6edf[_0x77f2('0x1e')](_0x77f2('0x1f'),_0xffdf18+'-'+_0x4db73f+'/'+_0x528f02)[_0x77f2('0x19')](_0xf437f2);}return null;};}function patchUpdates(_0x3a8ce2){return function(_0x3c5848){try{jsonpatch[_0x77f2('0x20')](_0x3c5848,_0x3a8ce2,!![]);}catch(_0x460941){return BPromise[_0x77f2('0x21')](_0x460941);}return _0x3c5848[_0x77f2('0x22')]();};}function saveUpdates(_0x369eb1,_0x4a2599){return function(_0x3db6d2){if(_0x3db6d2){return _0x3db6d2[_0x77f2('0x23')](_0x369eb1)[_0x77f2('0x24')](function(_0x897e3c){return _0x897e3c;});}return null;};}function removeEntity(_0x1d30e4,_0x4970d7){return function(_0x2afa88){if(_0x2afa88){return _0x2afa88[_0x77f2('0x25')]()[_0x77f2('0x24')](function(){_0x1d30e4[_0x77f2('0x17')](0xcc)[_0x77f2('0x18')]();});}};}function handleEntityNotFound(_0x37fba4,_0x311e2b){return function(_0x42f510){if(!_0x42f510){_0x37fba4['sendStatus'](0x194);}return _0x42f510;};}function handleError(_0xc29e22,_0x427cab){_0x427cab=_0x427cab||0x1f4;return function(_0x256f8b){logger[_0x77f2('0x26')](_0x256f8b['stack']);if(_0x256f8b[_0x77f2('0x27')]){delete _0x256f8b[_0x77f2('0x27')];}_0xc29e22[_0x77f2('0x17')](_0x427cab)[_0x77f2('0x28')](_0x256f8b);};}exports[_0x77f2('0x29')]=function(_0x5a260f,_0x572121){var _0x57f467={},_0x341f63={},_0x4c173e={'count':0x0,'rows':[]};var _0x325af6=_[_0x77f2('0x2a')](db[_0x77f2('0x2b')][_0x77f2('0x2c')],function(_0x5402b2){return{'name':_0x5402b2['fieldName'],'type':_0x5402b2[_0x77f2('0x2d')]['key']};});_0x341f63[_0x77f2('0x2e')]=_[_0x77f2('0x2a')](_0x325af6,_0x77f2('0x27'));_0x341f63[_0x77f2('0x2f')]=_[_0x77f2('0x30')](_0x5a260f[_0x77f2('0x2f')]);_0x341f63[_0x77f2('0x31')]=_['intersection'](_0x341f63['model'],_0x341f63[_0x77f2('0x2f')]);_0x57f467[_0x77f2('0x32')]=_['intersection'](_0x341f63[_0x77f2('0x2e')],qs['fields'](_0x5a260f[_0x77f2('0x2f')]['fields']));_0x57f467['attributes']=_0x57f467['attributes'][_0x77f2('0x33')]?_0x57f467[_0x77f2('0x32')]:_0x341f63[_0x77f2('0x2e')];if(!_0x5a260f['query'][_0x77f2('0x34')](_0x77f2('0x35'))){_0x57f467['limit']=qs['limit'](_0x5a260f[_0x77f2('0x2f')][_0x77f2('0x1d')]);_0x57f467[_0x77f2('0x1a')]=qs[_0x77f2('0x1a')](_0x5a260f[_0x77f2('0x2f')][_0x77f2('0x1a')]);}_0x57f467[_0x77f2('0x36')]=qs[_0x77f2('0x37')](_0x5a260f[_0x77f2('0x2f')]['sort']);_0x57f467['where']=qs['filters'](_[_0x77f2('0x38')](_0x5a260f[_0x77f2('0x2f')],_0x341f63['filters']),_0x325af6);if(_0x5a260f[_0x77f2('0x2f')][_0x77f2('0x39')]){_0x57f467[_0x77f2('0x3a')]=_[_0x77f2('0x3b')](_0x57f467[_0x77f2('0x3a')],{'$or':_[_0x77f2('0x2a')](_0x325af6,function(_0x14de24){if(_0x14de24[_0x77f2('0x2d')]!==_0x77f2('0x3c')){var _0x3df75a={};_0x3df75a[_0x14de24[_0x77f2('0x27')]]={'$like':'%'+_0x5a260f[_0x77f2('0x2f')]['filter']+'%'};return _0x3df75a;}})});}_0x57f467=_['merge']({},_0x57f467,_0x5a260f[_0x77f2('0x3d')]);var _0x15b4d0={'where':_0x57f467[_0x77f2('0x3a')]};return db['ChatQueueReport'][_0x77f2('0x1c')](_0x15b4d0)[_0x77f2('0x24')](function(_0x194599){_0x4c173e['count']=_0x194599;if(_0x5a260f[_0x77f2('0x2f')][_0x77f2('0x3e')]){_0x57f467[_0x77f2('0x3f')]=[{'all':!![]}];}return db[_0x77f2('0x2b')][_0x77f2('0x40')](_0x57f467);})[_0x77f2('0x24')](function(_0x1207c1){_0x4c173e[_0x77f2('0x41')]=_0x1207c1;return _0x4c173e;})[_0x77f2('0x24')](respondWithFilteredResult(_0x572121,_0x57f467))[_0x77f2('0x42')](handleError(_0x572121,null));};exports[_0x77f2('0x43')]=function(_0x4fb849,_0x50d6db){var _0x3edbe1={'raw':!![],'where':{'id':_0x4fb849[_0x77f2('0x44')]['id']}},_0x12cb58={};_0x12cb58[_0x77f2('0x2e')]=_[_0x77f2('0x30')](db[_0x77f2('0x2b')][_0x77f2('0x2c')]);_0x12cb58['query']=_[_0x77f2('0x30')](_0x4fb849[_0x77f2('0x2f')]);_0x12cb58[_0x77f2('0x31')]=_[_0x77f2('0x45')](_0x12cb58[_0x77f2('0x2e')],_0x12cb58[_0x77f2('0x2f')]);_0x3edbe1[_0x77f2('0x32')]=_[_0x77f2('0x45')](_0x12cb58[_0x77f2('0x2e')],qs['fields'](_0x4fb849[_0x77f2('0x2f')][_0x77f2('0x46')]));_0x3edbe1[_0x77f2('0x32')]=_0x3edbe1[_0x77f2('0x32')][_0x77f2('0x33')]?_0x3edbe1[_0x77f2('0x32')]:_0x12cb58[_0x77f2('0x2e')];if(_0x4fb849[_0x77f2('0x2f')][_0x77f2('0x3e')]){_0x3edbe1[_0x77f2('0x3f')]=[{'all':!![]}];}_0x3edbe1=_[_0x77f2('0x3b')]({},_0x3edbe1,_0x4fb849[_0x77f2('0x3d')]);return db[_0x77f2('0x2b')][_0x77f2('0x47')](_0x3edbe1)[_0x77f2('0x24')](handleEntityNotFound(_0x50d6db,null))['then'](respondWithResult(_0x50d6db,null))[_0x77f2('0x42')](handleError(_0x50d6db,null));};exports[_0x77f2('0x48')]=function(_0x3ab443,_0x1b8afa){return db['ChatQueueReport'][_0x77f2('0x48')](_0x3ab443[_0x77f2('0x49')],{})[_0x77f2('0x24')](respondWithResult(_0x1b8afa,0xc9))['catch'](handleError(_0x1b8afa,null));};exports[_0x77f2('0x23')]=function(_0x2b50ac,_0x3156fb){if(_0x2b50ac[_0x77f2('0x49')]['id']){delete _0x2b50ac[_0x77f2('0x49')]['id'];}return db[_0x77f2('0x2b')][_0x77f2('0x47')]({'where':{'id':_0x2b50ac['params']['id']}})['then'](handleEntityNotFound(_0x3156fb,null))[_0x77f2('0x24')](saveUpdates(_0x2b50ac[_0x77f2('0x49')],null))[_0x77f2('0x24')](respondWithResult(_0x3156fb,null))[_0x77f2('0x42')](handleError(_0x3156fb,null));};exports[_0x77f2('0x25')]=function(_0xfa5b6a,_0x2a94ac){return db['ChatQueueReport'][_0x77f2('0x47')]({'where':{'id':_0xfa5b6a[_0x77f2('0x44')]['id']}})[_0x77f2('0x24')](handleEntityNotFound(_0x2a94ac,null))['then'](removeEntity(_0x2a94ac,null))['catch'](handleError(_0x2a94ac,null));};exports[_0x77f2('0x4a')]=function(_0x1a9883,_0x50e1c2){return db[_0x77f2('0x2b')][_0x77f2('0x4a')]()[_0x77f2('0x24')](respondWithResult(_0x50e1c2,null))[_0x77f2('0x42')](handleError(_0x50e1c2,null));};
\ No newline at end of file
+var _0x905a=['pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','catch','create','body','find','params','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','ChatQueueReport','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0x905a,0xeb));var _0xa905=function(_0x19059c,_0x343ca8){_0x19059c=_0x19059c-0x0;var _0xf73ece=_0x905a[_0x19059c];return _0xf73ece;};'use strict';var emlformat=require(_0xa905('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa905('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa905('0x2'));var BPromise=require(_0xa905('0x3'));var Mustache=require(_0xa905('0x4'));var util=require(_0xa905('0x5'));var path=require(_0xa905('0x6'));var sox=require(_0xa905('0x7'));var csv=require(_0xa905('0x8'));var ejs=require(_0xa905('0x9'));var fs=require('fs');var fs_extra=require(_0xa905('0xa'));var _=require(_0xa905('0xb'));var squel=require(_0xa905('0xc'));var crypto=require(_0xa905('0xd'));var jsforce=require(_0xa905('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa905('0x8'));var querystring=require('querystring');var Papa=require(_0xa905('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa905('0x10'));var as=require(_0xa905('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa905('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xa905('0x13'));var licenseUtil=require(_0xa905('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54e06c,_0x3272df){_0x3272df=_0x3272df||0xcc;return function(_0x1caa49){if(_0x1caa49){return _0x54e06c[_0xa905('0x15')](_0x3272df);}return _0x54e06c[_0xa905('0x16')](_0x3272df)[_0xa905('0x17')]();};}function respondWithResult(_0xbe0d64,_0x4c42a4){_0x4c42a4=_0x4c42a4||0xc8;return function(_0x3ec259){if(_0x3ec259){return _0xbe0d64['status'](_0x4c42a4)[_0xa905('0x18')](_0x3ec259);}};}function respondWithFilteredResult(_0x97332d,_0x5990c8){return function(_0x58341f){if(_0x58341f){var _0x5b7b12=typeof _0x5990c8[_0xa905('0x19')]===_0xa905('0x1a')&&typeof _0x5990c8[_0xa905('0x1b')]===_0xa905('0x1a');var _0x185c1c=_0x58341f[_0xa905('0x1c')];var _0x1439d5=_0x5b7b12?0x0:_0x5990c8[_0xa905('0x19')];var _0xa59b33=_0x5b7b12?_0x58341f[_0xa905('0x1c')]:_0x5990c8[_0xa905('0x19')]+_0x5990c8[_0xa905('0x1b')];var _0x56c09f;if(_0xa59b33>=_0x185c1c){_0xa59b33=_0x185c1c;_0x56c09f=0xc8;}else{_0x56c09f=0xce;}_0x97332d[_0xa905('0x16')](_0x56c09f);return _0x97332d[_0xa905('0x1d')](_0xa905('0x1e'),_0x1439d5+'-'+_0xa59b33+'/'+_0x185c1c)[_0xa905('0x18')](_0x58341f);}return null;};}function patchUpdates(_0x14930d){return function(_0x36e094){try{jsonpatch['apply'](_0x36e094,_0x14930d,!![]);}catch(_0x4194a8){return BPromise[_0xa905('0x1f')](_0x4194a8);}return _0x36e094[_0xa905('0x20')]();};}function saveUpdates(_0x3193ca,_0x5c4b50){return function(_0x1da420){if(_0x1da420){return _0x1da420[_0xa905('0x21')](_0x3193ca)[_0xa905('0x22')](function(_0x1689a5){return _0x1689a5;});}return null;};}function removeEntity(_0x50a44a,_0x53d476){return function(_0x23fb4e){if(_0x23fb4e){return _0x23fb4e[_0xa905('0x23')]()['then'](function(){_0x50a44a[_0xa905('0x16')](0xcc)[_0xa905('0x17')]();});}};}function handleEntityNotFound(_0x447f6c,_0x182967){return function(_0x59fb12){if(!_0x59fb12){_0x447f6c[_0xa905('0x15')](0x194);}return _0x59fb12;};}function handleError(_0x3ad10c,_0x4bed6e){_0x4bed6e=_0x4bed6e||0x1f4;return function(_0x3e3067){logger[_0xa905('0x24')](_0x3e3067[_0xa905('0x25')]);if(_0x3e3067[_0xa905('0x26')]){delete _0x3e3067[_0xa905('0x26')];}_0x3ad10c[_0xa905('0x16')](_0x4bed6e)[_0xa905('0x27')](_0x3e3067);};}exports['index']=function(_0x3f391d,_0x32cf90){var _0x38c35d={},_0x4071c0={},_0x2713db={'count':0x0,'rows':[]};var _0x5d99eb=_['map'](db[_0xa905('0x28')][_0xa905('0x29')],function(_0x951d2e){return{'name':_0x951d2e[_0xa905('0x2a')],'type':_0x951d2e['type'][_0xa905('0x2b')]};});_0x4071c0[_0xa905('0x2c')]=_[_0xa905('0x2d')](_0x5d99eb,_0xa905('0x26'));_0x4071c0[_0xa905('0x2e')]=_['keys'](_0x3f391d[_0xa905('0x2e')]);_0x4071c0[_0xa905('0x2f')]=_[_0xa905('0x30')](_0x4071c0[_0xa905('0x2c')],_0x4071c0[_0xa905('0x2e')]);_0x38c35d[_0xa905('0x31')]=_['intersection'](_0x4071c0[_0xa905('0x2c')],qs[_0xa905('0x32')](_0x3f391d[_0xa905('0x2e')][_0xa905('0x32')]));_0x38c35d[_0xa905('0x31')]=_0x38c35d['attributes'][_0xa905('0x33')]?_0x38c35d['attributes']:_0x4071c0[_0xa905('0x2c')];if(!_0x3f391d[_0xa905('0x2e')][_0xa905('0x34')](_0xa905('0x35'))){_0x38c35d['limit']=qs[_0xa905('0x1b')](_0x3f391d[_0xa905('0x2e')]['limit']);_0x38c35d[_0xa905('0x19')]=qs['offset'](_0x3f391d[_0xa905('0x2e')]['offset']);}_0x38c35d[_0xa905('0x36')]=qs['sort'](_0x3f391d[_0xa905('0x2e')][_0xa905('0x37')]);_0x38c35d[_0xa905('0x38')]=qs[_0xa905('0x2f')](_[_0xa905('0x39')](_0x3f391d[_0xa905('0x2e')],_0x4071c0[_0xa905('0x2f')]),_0x5d99eb);if(_0x3f391d[_0xa905('0x2e')][_0xa905('0x3a')]){_0x38c35d[_0xa905('0x38')]=_[_0xa905('0x3b')](_0x38c35d['where'],{'$or':_[_0xa905('0x2d')](_0x5d99eb,function(_0xe08a81){if(_0xe08a81['type']!==_0xa905('0x3c')){var _0x271c32={};_0x271c32[_0xe08a81['name']]={'$like':'%'+_0x3f391d[_0xa905('0x2e')][_0xa905('0x3a')]+'%'};return _0x271c32;}})});}_0x38c35d=_['merge']({},_0x38c35d,_0x3f391d[_0xa905('0x3d')]);var _0x4b22f9={'where':_0x38c35d[_0xa905('0x38')]};return db[_0xa905('0x28')]['count'](_0x4b22f9)[_0xa905('0x22')](function(_0x4a8f02){_0x2713db[_0xa905('0x1c')]=_0x4a8f02;if(_0x3f391d['query'][_0xa905('0x3e')]){_0x38c35d[_0xa905('0x3f')]=[{'all':!![]}];}return db[_0xa905('0x28')][_0xa905('0x40')](_0x38c35d);})[_0xa905('0x22')](function(_0x193edc){_0x2713db[_0xa905('0x41')]=_0x193edc;return _0x2713db;})[_0xa905('0x22')](respondWithFilteredResult(_0x32cf90,_0x38c35d))['catch'](handleError(_0x32cf90,null));};exports[_0xa905('0x42')]=function(_0x1e10a7,_0x5a44dc){var _0x274f7a={'raw':!![],'where':{'id':_0x1e10a7['params']['id']}},_0x1d6033={};_0x1d6033[_0xa905('0x2c')]=_[_0xa905('0x43')](db['ChatQueueReport'][_0xa905('0x29')]);_0x1d6033[_0xa905('0x2e')]=_[_0xa905('0x43')](_0x1e10a7[_0xa905('0x2e')]);_0x1d6033[_0xa905('0x2f')]=_[_0xa905('0x30')](_0x1d6033[_0xa905('0x2c')],_0x1d6033[_0xa905('0x2e')]);_0x274f7a[_0xa905('0x31')]=_[_0xa905('0x30')](_0x1d6033[_0xa905('0x2c')],qs['fields'](_0x1e10a7[_0xa905('0x2e')]['fields']));_0x274f7a['attributes']=_0x274f7a[_0xa905('0x31')]['length']?_0x274f7a[_0xa905('0x31')]:_0x1d6033['model'];if(_0x1e10a7['query'][_0xa905('0x3e')]){_0x274f7a['include']=[{'all':!![]}];}_0x274f7a=_[_0xa905('0x3b')]({},_0x274f7a,_0x1e10a7['options']);return db['ChatQueueReport']['find'](_0x274f7a)['then'](handleEntityNotFound(_0x5a44dc,null))[_0xa905('0x22')](respondWithResult(_0x5a44dc,null))[_0xa905('0x44')](handleError(_0x5a44dc,null));};exports[_0xa905('0x45')]=function(_0x2ca873,_0x5c9e8a){return db[_0xa905('0x28')]['create'](_0x2ca873['body'],{})[_0xa905('0x22')](respondWithResult(_0x5c9e8a,0xc9))[_0xa905('0x44')](handleError(_0x5c9e8a,null));};exports[_0xa905('0x21')]=function(_0x1e1089,_0x10e0b7){if(_0x1e1089[_0xa905('0x46')]['id']){delete _0x1e1089[_0xa905('0x46')]['id'];}return db[_0xa905('0x28')][_0xa905('0x47')]({'where':{'id':_0x1e1089[_0xa905('0x48')]['id']}})[_0xa905('0x22')](handleEntityNotFound(_0x10e0b7,null))[_0xa905('0x22')](saveUpdates(_0x1e1089[_0xa905('0x46')],null))[_0xa905('0x22')](respondWithResult(_0x10e0b7,null))[_0xa905('0x44')](handleError(_0x10e0b7,null));};exports[_0xa905('0x23')]=function(_0x29d44a,_0x2af289){return db[_0xa905('0x28')][_0xa905('0x47')]({'where':{'id':_0x29d44a[_0xa905('0x48')]['id']}})[_0xa905('0x22')](handleEntityNotFound(_0x2af289,null))[_0xa905('0x22')](removeEntity(_0x2af289,null))[_0xa905('0x44')](handleError(_0x2af289,null));};exports['describe']=function(_0x9d2c41,_0x3e32e6){return db['ChatQueueReport']['describe']()[_0xa905('0x22')](respondWithResult(_0x3e32e6,null))[_0xa905('0x44')](handleError(_0x3e32e6,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 122dddc..d9b7b53 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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x369fb6,_0x4702f6){var _0x58cfdb=function(_0x42be27){while(--_0x42be27){_0x369fb6['push'](_0x369fb6['shift']());}};_0x58cfdb(++_0x4702f6);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xb10b,0x12a));var _0xbb10=function(_0x5b8646,_0x3e1589){_0x5b8646=_0x5b8646-0x0;var _0x363e4c=_0xb10b[_0x5b8646];return _0x363e4c;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index f32231b..68587ff 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 _0x70de=['ChatQueueReport,\x20%s,\x20%s','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','message','info','request\x20sent','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','debug','stringify','UpdateChatQueueReport','attributes','limit','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then'];(function(_0x2fe1f8,_0x1eef7c){var _0xf9dc91=function(_0x2e51e0){while(--_0x2e51e0){_0x2fe1f8['push'](_0x2fe1f8['shift']());}};_0xf9dc91(++_0x1eef7c);}(_0x70de,0xb3));var _0xe70d=function(_0x5f382f,_0x3f1432){_0x5f382f=_0x5f382f-0x0;var _0x3bb11b=_0x70de[_0x5f382f];return _0x3bb11b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe70d('0x0'));var BPromise=require('bluebird');var rs=require(_0xe70d('0x1'));var fs=require('fs');var Redis=require(_0xe70d('0x2'));var db=require(_0xe70d('0x3'))['db'];var utils=require(_0xe70d('0x4'));var logger=require('../../config/logger')(_0xe70d('0x5'));var config=require(_0xe70d('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe70d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4110d0,_0x4e87de,_0x2f8642){return new BPromise(function(_0x35c75c,_0x28e73c){return client[_0xe70d('0x8')](_0x4110d0,_0x2f8642)[_0xe70d('0x9')](function(_0x446f6a){logger['info'](_0xe70d('0xa'),_0x4e87de,'request\x20sent');logger['debug'](_0xe70d('0xb'),_0x4e87de,'request\x20sent',JSON['stringify'](_0x446f6a));if(_0x446f6a[_0xe70d('0xc')]){if(_0x446f6a[_0xe70d('0xc')]['code']===0x1f4){logger[_0xe70d('0xc')](_0xe70d('0xa'),_0x4e87de,_0x446f6a[_0xe70d('0xc')][_0xe70d('0xd')]);return _0x28e73c(_0x446f6a[_0xe70d('0xc')][_0xe70d('0xd')]);}logger[_0xe70d('0xc')](_0xe70d('0xa'),_0x4e87de,_0x446f6a[_0xe70d('0xc')][_0xe70d('0xd')]);return _0x35c75c(_0x446f6a['error'][_0xe70d('0xd')]);}else{logger[_0xe70d('0xe')](_0xe70d('0xa'),_0x4e87de,_0xe70d('0xf'));_0x35c75c(_0x446f6a[_0xe70d('0x10')][_0xe70d('0xd')]);}})[_0xe70d('0x11')](function(_0x2b21a9){logger['error'](_0xe70d('0xa'),_0x4e87de,_0x2b21a9);_0x28e73c(_0x2b21a9);});});}exports[_0xe70d('0x12')]=function(_0x225ac9){var _0x1a3b43=this;return new Promise(function(_0x19dece,_0x43c7f8){return db[_0xe70d('0x13')][_0xe70d('0x14')](_0x225ac9['body'],{'raw':_0x225ac9['options']?_0x225ac9[_0xe70d('0x15')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x53548c){logger[_0xe70d('0xe')](_0xe70d('0x12'),_0x225ac9);logger[_0xe70d('0x16')](_0xe70d('0x12'),_0x225ac9,JSON[_0xe70d('0x17')](_0x53548c));_0x19dece(_0x53548c);})[_0xe70d('0x11')](function(_0x38b7a2){logger[_0xe70d('0xc')](_0xe70d('0x12'),_0x38b7a2['message'],_0x225ac9);_0x43c7f8(_0x1a3b43['error'](0x1f4,_0x38b7a2[_0xe70d('0xd')]));});});};exports[_0xe70d('0x18')]=function(_0x149504){var _0x25e332=this;return new Promise(function(_0x1ffe51,_0x5524ed){return db[_0xe70d('0x13')]['update'](_0x149504['body'],{'raw':_0x149504['options']?_0x149504[_0xe70d('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x149504['options']?_0x149504[_0xe70d('0x15')]['where']||null:null,'attributes':_0x149504[_0xe70d('0x15')]?_0x149504[_0xe70d('0x15')][_0xe70d('0x19')]||null:null,'limit':_0x149504[_0xe70d('0x15')]?_0x149504[_0xe70d('0x15')][_0xe70d('0x1a')]||null:null})['then'](function(_0x486955){logger['info'](_0xe70d('0x18'),_0x149504);logger['debug'](_0xe70d('0x18'),_0x149504,JSON[_0xe70d('0x17')](_0x486955));_0x1ffe51(_0x486955);})[_0xe70d('0x11')](function(_0x3e21a2){logger[_0xe70d('0xc')](_0xe70d('0x18'),_0x3e21a2[_0xe70d('0xd')],_0x149504);_0x5524ed(_0x25e332[_0xe70d('0xc')](0x1f4,_0x3e21a2[_0xe70d('0xd')]));});});};
\ No newline at end of file
+var _0xc1e4=['ChatQueueReport','create','body','options','raw','then','UpdateChatQueueReport','update','where','attributes','limit','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateChatQueueReport'];(function(_0x229cd0,_0x2665cb){var _0x436329=function(_0x2fb4f1){while(--_0x2fb4f1){_0x229cd0['push'](_0x229cd0['shift']());}};_0x436329(++_0x2665cb);}(_0xc1e4,0x78));var _0x4c1e=function(_0x2a585e,_0x349c5a){_0x2a585e=_0x2a585e-0x0;var _0x11a9ac=_0xc1e4[_0x2a585e];return _0x11a9ac;};'use strict';var _=require(_0x4c1e('0x0'));var util=require(_0x4c1e('0x1'));var moment=require(_0x4c1e('0x2'));var BPromise=require(_0x4c1e('0x3'));var rs=require(_0x4c1e('0x4'));var fs=require('fs');var Redis=require(_0x4c1e('0x5'));var db=require(_0x4c1e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c1e('0x7'))('rpc');var config=require(_0x4c1e('0x8'));var jayson=require(_0x4c1e('0x9'));var client=jayson[_0x4c1e('0xa')][_0x4c1e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22b210,_0x5288b6,_0x5e31d1){return new BPromise(function(_0x585f70,_0x3c1df8){return client[_0x4c1e('0xc')](_0x22b210,_0x5e31d1)['then'](function(_0x3f94e4){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x5288b6,_0x4c1e('0xd'));logger['debug'](_0x4c1e('0xe'),_0x5288b6,_0x4c1e('0xd'),JSON[_0x4c1e('0xf')](_0x3f94e4));if(_0x3f94e4[_0x4c1e('0x10')]){if(_0x3f94e4['error'][_0x4c1e('0x11')]===0x1f4){logger['error'](_0x4c1e('0x12'),_0x5288b6,_0x3f94e4['error']['message']);return _0x3c1df8(_0x3f94e4[_0x4c1e('0x10')][_0x4c1e('0x13')]);}logger['error'](_0x4c1e('0x12'),_0x5288b6,_0x3f94e4[_0x4c1e('0x10')][_0x4c1e('0x13')]);return _0x585f70(_0x3f94e4[_0x4c1e('0x10')][_0x4c1e('0x13')]);}else{logger[_0x4c1e('0x14')](_0x4c1e('0x12'),_0x5288b6,'request\x20sent');_0x585f70(_0x3f94e4[_0x4c1e('0x15')][_0x4c1e('0x13')]);}})[_0x4c1e('0x16')](function(_0x4536fb){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x5288b6,_0x4536fb);_0x3c1df8(_0x4536fb);});});}exports[_0x4c1e('0x17')]=function(_0x557438){var _0x395557=this;return new Promise(function(_0x1bd866,_0x3be776){return db[_0x4c1e('0x18')][_0x4c1e('0x19')](_0x557438[_0x4c1e('0x1a')],{'raw':_0x557438[_0x4c1e('0x1b')]?_0x557438['options'][_0x4c1e('0x1c')]===undefined?!![]:![]:!![]})[_0x4c1e('0x1d')](function(_0x876586){logger[_0x4c1e('0x14')]('CreateChatQueueReport',_0x557438);logger['debug'](_0x4c1e('0x17'),_0x557438,JSON[_0x4c1e('0xf')](_0x876586));_0x1bd866(_0x876586);})[_0x4c1e('0x16')](function(_0x3fe88e){logger[_0x4c1e('0x10')](_0x4c1e('0x17'),_0x3fe88e[_0x4c1e('0x13')],_0x557438);_0x3be776(_0x395557[_0x4c1e('0x10')](0x1f4,_0x3fe88e[_0x4c1e('0x13')]));});});};exports[_0x4c1e('0x1e')]=function(_0x39e10a){var _0x18ab83=this;return new Promise(function(_0x5421a8,_0x1e1174){return db['ChatQueueReport'][_0x4c1e('0x1f')](_0x39e10a[_0x4c1e('0x1a')],{'raw':_0x39e10a[_0x4c1e('0x1b')]?_0x39e10a[_0x4c1e('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39e10a[_0x4c1e('0x1b')]?_0x39e10a[_0x4c1e('0x1b')][_0x4c1e('0x20')]||null:null,'attributes':_0x39e10a[_0x4c1e('0x1b')]?_0x39e10a[_0x4c1e('0x1b')][_0x4c1e('0x21')]||null:null,'limit':_0x39e10a['options']?_0x39e10a['options'][_0x4c1e('0x22')]||null:null})[_0x4c1e('0x1d')](function(_0x338ede){logger[_0x4c1e('0x14')](_0x4c1e('0x1e'),_0x39e10a);logger[_0x4c1e('0x23')](_0x4c1e('0x1e'),_0x39e10a,JSON['stringify'](_0x338ede));_0x5421a8(_0x338ede);})[_0x4c1e('0x16')](function(_0x498ce8){logger[_0x4c1e('0x10')](_0x4c1e('0x1e'),_0x498ce8[_0x4c1e('0x13')],_0x39e10a);_0x1e1174(_0x18ab83['error'](0x1f4,_0x498ce8[_0x4c1e('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 48e97d4..76574a3 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 _0x40d0=['isAuthenticated','index','describe','show','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get'];(function(_0x63662c,_0x1cfecb){var _0x274b68=function(_0x321537){while(--_0x321537){_0x63662c['push'](_0x63662c['shift']());}};_0x274b68(++_0x1cfecb);}(_0x40d0,0x89));var _0x040d=function(_0x45a356,_0x30f68f){_0x45a356=_0x45a356-0x0;var _0x52850b=_0x40d0[_0x45a356];return _0x52850b;};'use strict';var multer=require(_0x040d('0x0'));var util=require(_0x040d('0x1'));var path=require(_0x040d('0x2'));var timeout=require(_0x040d('0x3'));var express=require(_0x040d('0x4'));var router=express[_0x040d('0x5')]();var fs_extra=require(_0x040d('0x6'));var auth=require(_0x040d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x040d('0x8'));var controller=require('./chatQueueReport.controller');router[_0x040d('0x9')]('/',auth[_0x040d('0xa')](),controller[_0x040d('0xb')]);router[_0x040d('0x9')]('/describe',auth[_0x040d('0xa')](),controller[_0x040d('0xc')]);router[_0x040d('0x9')]('/:id',auth[_0x040d('0xa')](),controller[_0x040d('0xd')]);router[_0x040d('0xe')]('/',auth[_0x040d('0xa')](),controller[_0x040d('0xf')]);router[_0x040d('0x10')](_0x040d('0x11'),auth['isAuthenticated'](),controller[_0x040d('0x12')]);router['delete']('/:id',auth[_0x040d('0xa')](),controller[_0x040d('0x13')]);module[_0x040d('0x14')]=router;
\ No newline at end of file
+var _0x8d19=['describe','show','post','create','put','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8d19,0x18f));var _0x98d1=function(_0x39fd11,_0x5d7883){_0x39fd11=_0x39fd11-0x0;var _0x302799=_0x8d19[_0x39fd11];return _0x302799;};'use strict';var multer=require(_0x98d1('0x0'));var util=require(_0x98d1('0x1'));var path=require(_0x98d1('0x2'));var timeout=require(_0x98d1('0x3'));var express=require(_0x98d1('0x4'));var router=express[_0x98d1('0x5')]();var fs_extra=require(_0x98d1('0x6'));var auth=require(_0x98d1('0x7'));var interaction=require(_0x98d1('0x8'));var config=require(_0x98d1('0x9'));var controller=require(_0x98d1('0xa'));router[_0x98d1('0xb')]('/',auth[_0x98d1('0xc')](),controller[_0x98d1('0xd')]);router[_0x98d1('0xb')](_0x98d1('0xe'),auth['isAuthenticated'](),controller[_0x98d1('0xf')]);router[_0x98d1('0xb')]('/:id',auth[_0x98d1('0xc')](),controller[_0x98d1('0x10')]);router[_0x98d1('0x11')]('/',auth[_0x98d1('0xc')](),controller[_0x98d1('0x12')]);router[_0x98d1('0x13')]('/:id',auth[_0x98d1('0xc')](),controller['update']);router['delete'](_0x98d1('0x14'),auth['isAuthenticated'](),controller[_0x98d1('0x15')]);module[_0x98d1('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index b806756..3cc0cd9 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x5141a1,_0x509811){var _0x236ce1=function(_0x1505ef){while(--_0x1505ef){_0x5141a1['push'](_0x5141a1['shift']());}};_0x236ce1(++_0x509811);}(_0x008c,0x188));var _0xc008=function(_0x46066f,_0x23105c){_0x46066f=_0x46066f-0x0;var _0x411977=_0x008c[_0x46066f];return _0x411977;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
+var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x589c08,_0x264b33){var _0xc21d72=function(_0x33a9ea){while(--_0x33a9ea){_0x589c08['push'](_0x589c08['shift']());}};_0xc21d72(++_0x264b33);}(_0x34e8,0x12c));var _0x834e=function(_0x2a9235,_0x8ee5f6){_0x2a9235=_0x2a9235-0x0;var _0x11b7f3=_0x34e8[_0x2a9235];return _0x11b7f3;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 74da037..ba7c974 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 _0x918e=['limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','findAll','rows','catch','params','keys','filters','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined'];(function(_0x1a8192,_0x3453f2){var _0x131de2=function(_0x50ab1c){while(--_0x50ab1c){_0x1a8192['push'](_0x1a8192['shift']());}};_0x131de2(++_0x3453f2);}(_0x918e,0x173));var _0xe918=function(_0x412b85,_0x13cf8c){_0x412b85=_0x412b85-0x0;var _0x1bfb7c=_0x918e[_0x412b85];return _0x1bfb7c;};'use strict';var emlformat=require(_0xe918('0x0'));var rimraf=require(_0xe918('0x1'));var zipdir=require(_0xe918('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe918('0x3'));var moment=require(_0xe918('0x4'));var BPromise=require(_0xe918('0x5'));var Mustache=require(_0xe918('0x6'));var util=require(_0xe918('0x7'));var path=require(_0xe918('0x8'));var sox=require(_0xe918('0x9'));var csv=require(_0xe918('0xa'));var ejs=require(_0xe918('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe918('0xc'));var squel=require('squel');var crypto=require(_0xe918('0xd'));var jsforce=require(_0xe918('0xe'));var deskjs=require(_0xe918('0xf'));var toCsv=require(_0xe918('0xa'));var querystring=require(_0xe918('0x10'));var Papa=require(_0xe918('0x11'));var Redis=require(_0xe918('0x12'));var authService=require(_0xe918('0x13'));var qs=require(_0xe918('0x14'));var as=require(_0xe918('0x15'));var hardwareService=require(_0xe918('0x16'));var logger=require(_0xe918('0x17'))(_0xe918('0x18'));var utils=require(_0xe918('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xe918('0x1a'));var db=require(_0xe918('0x1b'))['db'];function respondWithStatusCode(_0x34359c,_0x337fc6){_0x337fc6=_0x337fc6||0xcc;return function(_0x1e3718){if(_0x1e3718){return _0x34359c[_0xe918('0x1c')](_0x337fc6);}return _0x34359c['status'](_0x337fc6)[_0xe918('0x1d')]();};}function respondWithResult(_0x2436c4,_0x13f37e){_0x13f37e=_0x13f37e||0xc8;return function(_0x1120a9){if(_0x1120a9){return _0x2436c4[_0xe918('0x1e')](_0x13f37e)[_0xe918('0x1f')](_0x1120a9);}};}function respondWithFilteredResult(_0x4d88ac,_0x1f38ef){return function(_0x4a4233){if(_0x4a4233){var _0x1eb754=typeof _0x1f38ef[_0xe918('0x20')]===_0xe918('0x21')&&typeof _0x1f38ef[_0xe918('0x22')]===_0xe918('0x21');var _0x4f3ac7=_0x4a4233[_0xe918('0x23')];var _0x3d97f9=_0x1eb754?0x0:_0x1f38ef[_0xe918('0x20')];var _0x2c4116=_0x1eb754?_0x4a4233['count']:_0x1f38ef[_0xe918('0x20')]+_0x1f38ef[_0xe918('0x22')];var _0x2fccff;if(_0x2c4116>=_0x4f3ac7){_0x2c4116=_0x4f3ac7;_0x2fccff=0xc8;}else{_0x2fccff=0xce;}_0x4d88ac[_0xe918('0x1e')](_0x2fccff);return _0x4d88ac[_0xe918('0x24')](_0xe918('0x25'),_0x3d97f9+'-'+_0x2c4116+'/'+_0x4f3ac7)[_0xe918('0x1f')](_0x4a4233);}return null;};}function patchUpdates(_0x548f40){return function(_0x2b5874){try{jsonpatch[_0xe918('0x26')](_0x2b5874,_0x548f40,!![]);}catch(_0x31d593){return BPromise[_0xe918('0x27')](_0x31d593);}return _0x2b5874[_0xe918('0x28')]();};}function saveUpdates(_0x425dbc,_0xec955b){return function(_0x2c7c25){if(_0x2c7c25){return _0x2c7c25[_0xe918('0x29')](_0x425dbc)[_0xe918('0x2a')](function(_0x41d794){return _0x41d794;});}return null;};}function removeEntity(_0x4c66a3,_0x46fc75){return function(_0x52d0aa){if(_0x52d0aa){return _0x52d0aa[_0xe918('0x2b')]()[_0xe918('0x2a')](function(){_0x4c66a3[_0xe918('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bd3bb,_0x15c72b){return function(_0x2c6730){if(!_0x2c6730){_0x2bd3bb['sendStatus'](0x194);}return _0x2c6730;};}function handleError(_0x17ace3,_0x17acb1){_0x17acb1=_0x17acb1||0x1f4;return function(_0x2400ae){logger[_0xe918('0x2c')](_0x2400ae[_0xe918('0x2d')]);if(_0x2400ae[_0xe918('0x2e')]){delete _0x2400ae['name'];}_0x17ace3['status'](_0x17acb1)['send'](_0x2400ae);};}exports[_0xe918('0x2f')]=function(_0x436514,_0x5d6922){var _0x3151f5={},_0x9972c4={},_0x949ee2={'count':0x0,'rows':[]};var _0x1007c7=_[_0xe918('0x30')](db[_0xe918('0x31')][_0xe918('0x32')],function(_0x1a79c2){return{'name':_0x1a79c2[_0xe918('0x33')],'type':_0x1a79c2['type'][_0xe918('0x34')]};});_0x9972c4[_0xe918('0x35')]=_[_0xe918('0x30')](_0x1007c7,_0xe918('0x2e'));_0x9972c4[_0xe918('0x36')]=_['keys'](_0x436514['query']);_0x9972c4['filters']=_[_0xe918('0x37')](_0x9972c4[_0xe918('0x35')],_0x9972c4[_0xe918('0x36')]);_0x3151f5['attributes']=_[_0xe918('0x37')](_0x9972c4['model'],qs[_0xe918('0x38')](_0x436514['query'][_0xe918('0x38')]));_0x3151f5[_0xe918('0x39')]=_0x3151f5['attributes'][_0xe918('0x3a')]?_0x3151f5[_0xe918('0x39')]:_0x9972c4['model'];if(!_0x436514[_0xe918('0x36')][_0xe918('0x3b')](_0xe918('0x3c'))){_0x3151f5[_0xe918('0x22')]=qs[_0xe918('0x22')](_0x436514[_0xe918('0x36')]['limit']);_0x3151f5[_0xe918('0x20')]=qs[_0xe918('0x20')](_0x436514['query'][_0xe918('0x20')]);}_0x3151f5[_0xe918('0x3d')]=qs['sort'](_0x436514['query'][_0xe918('0x3e')]);_0x3151f5[_0xe918('0x3f')]=qs['filters'](_[_0xe918('0x40')](_0x436514[_0xe918('0x36')],_0x9972c4['filters']),_0x1007c7);if(_0x436514['query'][_0xe918('0x41')]){_0x3151f5[_0xe918('0x3f')]=_['merge'](_0x3151f5[_0xe918('0x3f')],{'$or':_[_0xe918('0x30')](_0x1007c7,function(_0x122fb5){if(_0x122fb5[_0xe918('0x42')]!==_0xe918('0x43')){var _0x181413={};_0x181413[_0x122fb5['name']]={'$like':'%'+_0x436514[_0xe918('0x36')][_0xe918('0x41')]+'%'};return _0x181413;}})});}_0x3151f5=_[_0xe918('0x44')]({},_0x3151f5,_0x436514[_0xe918('0x45')]);var _0x428fc7={'where':_0x3151f5[_0xe918('0x3f')]};return db[_0xe918('0x31')][_0xe918('0x23')](_0x428fc7)[_0xe918('0x2a')](function(_0x45c59b){_0x949ee2[_0xe918('0x23')]=_0x45c59b;if(_0x436514['query']['includeAll']){_0x3151f5['include']=[{'all':!![]}];}return db[_0xe918('0x31')][_0xe918('0x46')](_0x3151f5);})[_0xe918('0x2a')](function(_0x1e0ffb){_0x949ee2[_0xe918('0x47')]=_0x1e0ffb;return _0x949ee2;})[_0xe918('0x2a')](respondWithFilteredResult(_0x5d6922,_0x3151f5))[_0xe918('0x48')](handleError(_0x5d6922,null));};exports['show']=function(_0x24da99,_0x278ac2){var _0x378b3d={'raw':!![],'where':{'id':_0x24da99[_0xe918('0x49')]['id']}},_0x423237={};_0x423237[_0xe918('0x35')]=_[_0xe918('0x4a')](db['ChatTransferReport'][_0xe918('0x32')]);_0x423237[_0xe918('0x36')]=_[_0xe918('0x4a')](_0x24da99[_0xe918('0x36')]);_0x423237[_0xe918('0x4b')]=_[_0xe918('0x37')](_0x423237[_0xe918('0x35')],_0x423237['query']);_0x378b3d['attributes']=_[_0xe918('0x37')](_0x423237['model'],qs[_0xe918('0x38')](_0x24da99[_0xe918('0x36')]['fields']));_0x378b3d[_0xe918('0x39')]=_0x378b3d[_0xe918('0x39')][_0xe918('0x3a')]?_0x378b3d[_0xe918('0x39')]:_0x423237[_0xe918('0x35')];if(_0x24da99[_0xe918('0x36')][_0xe918('0x4c')]){_0x378b3d['include']=[{'all':!![]}];}_0x378b3d=_[_0xe918('0x44')]({},_0x378b3d,_0x24da99[_0xe918('0x45')]);return db['ChatTransferReport'][_0xe918('0x4d')](_0x378b3d)['then'](handleEntityNotFound(_0x278ac2,null))[_0xe918('0x2a')](respondWithResult(_0x278ac2,null))[_0xe918('0x48')](handleError(_0x278ac2,null));};exports[_0xe918('0x4e')]=function(_0x22a79c,_0x4d7114){return db['ChatTransferReport'][_0xe918('0x4e')](_0x22a79c['body'],{})[_0xe918('0x2a')](respondWithResult(_0x4d7114,0xc9))['catch'](handleError(_0x4d7114,null));};exports[_0xe918('0x29')]=function(_0x45db35,_0x3408bd){if(_0x45db35[_0xe918('0x4f')]['id']){delete _0x45db35[_0xe918('0x4f')]['id'];}return db['ChatTransferReport'][_0xe918('0x4d')]({'where':{'id':_0x45db35[_0xe918('0x49')]['id']}})[_0xe918('0x2a')](handleEntityNotFound(_0x3408bd,null))[_0xe918('0x2a')](saveUpdates(_0x45db35[_0xe918('0x4f')],null))[_0xe918('0x2a')](respondWithResult(_0x3408bd,null))[_0xe918('0x48')](handleError(_0x3408bd,null));};exports['destroy']=function(_0x2c62c4,_0x3be432){return db['ChatTransferReport']['find']({'where':{'id':_0x2c62c4[_0xe918('0x49')]['id']}})[_0xe918('0x2a')](handleEntityNotFound(_0x3be432,null))[_0xe918('0x2a')](removeEntity(_0x3be432,null))['catch'](handleError(_0x3be432,null));};exports[_0xe918('0x50')]=function(_0x2a4fb4,_0x319ee8){return db[_0xe918('0x31')][_0xe918('0x50')]()[_0xe918('0x2a')](respondWithResult(_0x319ee8,null))[_0xe918('0x48')](handleError(_0x319ee8,null));};
\ No newline at end of file
+var _0x43f2=['../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','length','options','create','body','destroy','find','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils'];(function(_0x448f9a,_0xc4f46){var _0x1ff030=function(_0x1b80da){while(--_0x1b80da){_0x448f9a['push'](_0x448f9a['shift']());}};_0x1ff030(++_0xc4f46);}(_0x43f2,0x7e));var _0x243f=function(_0x1fa3f2,_0x54c4c4){_0x1fa3f2=_0x1fa3f2-0x0;var _0x5932dc=_0x43f2[_0x1fa3f2];return _0x5932dc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x243f('0x0'));var zipdir=require(_0x243f('0x1'));var jsonpatch=require(_0x243f('0x2'));var rp=require('request-promise');var moment=require(_0x243f('0x3'));var BPromise=require(_0x243f('0x4'));var Mustache=require('mustache');var util=require(_0x243f('0x5'));var path=require(_0x243f('0x6'));var sox=require(_0x243f('0x7'));var csv=require(_0x243f('0x8'));var ejs=require(_0x243f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x243f('0xa'));var squel=require('squel');var crypto=require(_0x243f('0xb'));var jsforce=require(_0x243f('0xc'));var deskjs=require(_0x243f('0xd'));var toCsv=require(_0x243f('0x8'));var querystring=require(_0x243f('0xe'));var Papa=require('papaparse');var Redis=require(_0x243f('0xf'));var authService=require(_0x243f('0x10'));var qs=require(_0x243f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x243f('0x12'))('api');var utils=require(_0x243f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x243f('0x14'));var db=require(_0x243f('0x15'))['db'];function respondWithStatusCode(_0x2c5120,_0x5db8c4){_0x5db8c4=_0x5db8c4||0xcc;return function(_0x12104a){if(_0x12104a){return _0x2c5120['sendStatus'](_0x5db8c4);}return _0x2c5120[_0x243f('0x16')](_0x5db8c4)[_0x243f('0x17')]();};}function respondWithResult(_0x36cb50,_0x167b9e){_0x167b9e=_0x167b9e||0xc8;return function(_0xd0906d){if(_0xd0906d){return _0x36cb50[_0x243f('0x16')](_0x167b9e)[_0x243f('0x18')](_0xd0906d);}};}function respondWithFilteredResult(_0x4c73f4,_0x1a4735){return function(_0x34958d){if(_0x34958d){var _0x111bbf=typeof _0x1a4735[_0x243f('0x19')]==='undefined'&&typeof _0x1a4735[_0x243f('0x1a')]===_0x243f('0x1b');var _0xca9ff9=_0x34958d[_0x243f('0x1c')];var _0x7102b2=_0x111bbf?0x0:_0x1a4735[_0x243f('0x19')];var _0x5afd18=_0x111bbf?_0x34958d[_0x243f('0x1c')]:_0x1a4735[_0x243f('0x19')]+_0x1a4735[_0x243f('0x1a')];var _0x560c21;if(_0x5afd18>=_0xca9ff9){_0x5afd18=_0xca9ff9;_0x560c21=0xc8;}else{_0x560c21=0xce;}_0x4c73f4['status'](_0x560c21);return _0x4c73f4[_0x243f('0x1d')](_0x243f('0x1e'),_0x7102b2+'-'+_0x5afd18+'/'+_0xca9ff9)['json'](_0x34958d);}return null;};}function patchUpdates(_0x4005e8){return function(_0x585442){try{jsonpatch[_0x243f('0x1f')](_0x585442,_0x4005e8,!![]);}catch(_0x109785){return BPromise[_0x243f('0x20')](_0x109785);}return _0x585442[_0x243f('0x21')]();};}function saveUpdates(_0x9ae02b,_0x3675d6){return function(_0x494063){if(_0x494063){return _0x494063[_0x243f('0x22')](_0x9ae02b)[_0x243f('0x23')](function(_0x1721fb){return _0x1721fb;});}return null;};}function removeEntity(_0x342ba1,_0x511025){return function(_0x5956bc){if(_0x5956bc){return _0x5956bc['destroy']()[_0x243f('0x23')](function(){_0x342ba1[_0x243f('0x16')](0xcc)[_0x243f('0x17')]();});}};}function handleEntityNotFound(_0x27681a,_0x24ca69){return function(_0x66e680){if(!_0x66e680){_0x27681a[_0x243f('0x24')](0x194);}return _0x66e680;};}function handleError(_0x32d891,_0x1edefb){_0x1edefb=_0x1edefb||0x1f4;return function(_0x2e1277){logger[_0x243f('0x25')](_0x2e1277['stack']);if(_0x2e1277['name']){delete _0x2e1277[_0x243f('0x26')];}_0x32d891[_0x243f('0x16')](_0x1edefb)['send'](_0x2e1277);};}exports[_0x243f('0x27')]=function(_0x424fea,_0x3d0587){var _0x28751f={},_0x3cc3ab={},_0x320846={'count':0x0,'rows':[]};var _0x3ee721=_[_0x243f('0x28')](db[_0x243f('0x29')][_0x243f('0x2a')],function(_0x3d8d42){return{'name':_0x3d8d42[_0x243f('0x2b')],'type':_0x3d8d42[_0x243f('0x2c')][_0x243f('0x2d')]};});_0x3cc3ab['model']=_[_0x243f('0x28')](_0x3ee721,_0x243f('0x26'));_0x3cc3ab[_0x243f('0x2e')]=_[_0x243f('0x2f')](_0x424fea[_0x243f('0x2e')]);_0x3cc3ab['filters']=_[_0x243f('0x30')](_0x3cc3ab[_0x243f('0x31')],_0x3cc3ab[_0x243f('0x2e')]);_0x28751f[_0x243f('0x32')]=_[_0x243f('0x30')](_0x3cc3ab['model'],qs[_0x243f('0x33')](_0x424fea[_0x243f('0x2e')][_0x243f('0x33')]));_0x28751f[_0x243f('0x32')]=_0x28751f[_0x243f('0x32')]['length']?_0x28751f[_0x243f('0x32')]:_0x3cc3ab[_0x243f('0x31')];if(!_0x424fea[_0x243f('0x2e')][_0x243f('0x34')](_0x243f('0x35'))){_0x28751f[_0x243f('0x1a')]=qs[_0x243f('0x1a')](_0x424fea[_0x243f('0x2e')]['limit']);_0x28751f['offset']=qs[_0x243f('0x19')](_0x424fea[_0x243f('0x2e')][_0x243f('0x19')]);}_0x28751f['order']=qs[_0x243f('0x36')](_0x424fea[_0x243f('0x2e')][_0x243f('0x36')]);_0x28751f[_0x243f('0x37')]=qs[_0x243f('0x38')](_[_0x243f('0x39')](_0x424fea['query'],_0x3cc3ab['filters']),_0x3ee721);if(_0x424fea[_0x243f('0x2e')][_0x243f('0x3a')]){_0x28751f[_0x243f('0x37')]=_[_0x243f('0x3b')](_0x28751f[_0x243f('0x37')],{'$or':_['map'](_0x3ee721,function(_0x1f379e){if(_0x1f379e[_0x243f('0x2c')]!==_0x243f('0x3c')){var _0x56ab8a={};_0x56ab8a[_0x1f379e[_0x243f('0x26')]]={'$like':'%'+_0x424fea[_0x243f('0x2e')][_0x243f('0x3a')]+'%'};return _0x56ab8a;}})});}_0x28751f=_['merge']({},_0x28751f,_0x424fea['options']);var _0xbbe74={'where':_0x28751f['where']};return db[_0x243f('0x29')]['count'](_0xbbe74)[_0x243f('0x23')](function(_0x5c6999){_0x320846[_0x243f('0x1c')]=_0x5c6999;if(_0x424fea[_0x243f('0x2e')][_0x243f('0x3d')]){_0x28751f[_0x243f('0x3e')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x28751f);})['then'](function(_0x44cb3a){_0x320846[_0x243f('0x3f')]=_0x44cb3a;return _0x320846;})[_0x243f('0x23')](respondWithFilteredResult(_0x3d0587,_0x28751f))[_0x243f('0x40')](handleError(_0x3d0587,null));};exports['show']=function(_0x57e909,_0x25f6aa){var _0x245d34={'raw':!![],'where':{'id':_0x57e909[_0x243f('0x41')]['id']}},_0x2a36cf={};_0x2a36cf['model']=_['keys'](db['ChatTransferReport']['rawAttributes']);_0x2a36cf[_0x243f('0x2e')]=_[_0x243f('0x2f')](_0x57e909[_0x243f('0x2e')]);_0x2a36cf[_0x243f('0x38')]=_[_0x243f('0x30')](_0x2a36cf['model'],_0x2a36cf[_0x243f('0x2e')]);_0x245d34[_0x243f('0x32')]=_[_0x243f('0x30')](_0x2a36cf[_0x243f('0x31')],qs[_0x243f('0x33')](_0x57e909['query'][_0x243f('0x33')]));_0x245d34[_0x243f('0x32')]=_0x245d34[_0x243f('0x32')][_0x243f('0x42')]?_0x245d34[_0x243f('0x32')]:_0x2a36cf[_0x243f('0x31')];if(_0x57e909['query'][_0x243f('0x3d')]){_0x245d34[_0x243f('0x3e')]=[{'all':!![]}];}_0x245d34=_['merge']({},_0x245d34,_0x57e909[_0x243f('0x43')]);return db['ChatTransferReport']['find'](_0x245d34)[_0x243f('0x23')](handleEntityNotFound(_0x25f6aa,null))['then'](respondWithResult(_0x25f6aa,null))['catch'](handleError(_0x25f6aa,null));};exports[_0x243f('0x44')]=function(_0x1e8b49,_0x163e14){return db[_0x243f('0x29')][_0x243f('0x44')](_0x1e8b49['body'],{})[_0x243f('0x23')](respondWithResult(_0x163e14,0xc9))['catch'](handleError(_0x163e14,null));};exports[_0x243f('0x22')]=function(_0x345791,_0x249ca5){if(_0x345791['body']['id']){delete _0x345791[_0x243f('0x45')]['id'];}return db[_0x243f('0x29')]['find']({'where':{'id':_0x345791[_0x243f('0x41')]['id']}})['then'](handleEntityNotFound(_0x249ca5,null))[_0x243f('0x23')](saveUpdates(_0x345791[_0x243f('0x45')],null))[_0x243f('0x23')](respondWithResult(_0x249ca5,null))[_0x243f('0x40')](handleError(_0x249ca5,null));};exports[_0x243f('0x46')]=function(_0x2cee8d,_0x3d8f90){return db[_0x243f('0x29')][_0x243f('0x47')]({'where':{'id':_0x2cee8d[_0x243f('0x41')]['id']}})['then'](handleEntityNotFound(_0x3d8f90,null))['then'](removeEntity(_0x3d8f90,null))[_0x243f('0x40')](handleError(_0x3d8f90,null));};exports['describe']=function(_0x28d4eb,_0x159c92){return db[_0x243f('0x29')][_0x243f('0x48')]()[_0x243f('0x23')](respondWithResult(_0x159c92,null))['catch'](handleError(_0x159c92,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 2caddb2..53adc6b 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 _0x48b8=['../../config/environment','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x519d1c,_0x1935a2){var _0x1662e4=function(_0x569df3){while(--_0x569df3){_0x519d1c['push'](_0x519d1c['shift']());}};_0x1662e4(++_0x1935a2);}(_0x48b8,0xb5));var _0x848b=function(_0x1a8d3c,_0x321276){_0x1a8d3c=_0x1a8d3c-0x0;var _0x2f4140=_0x48b8[_0x1a8d3c];return _0x2f4140;};'use strict';var _=require(_0x848b('0x0'));var util=require(_0x848b('0x1'));var logger=require(_0x848b('0x2'))('api');var moment=require(_0x848b('0x3'));var BPromise=require('bluebird');var rp=require(_0x848b('0x4'));var fs=require('fs');var path=require(_0x848b('0x5'));var rimraf=require('rimraf');var config=require(_0x848b('0x6'));var attributes=require('./chatTransferReport.attributes');module[_0x848b('0x7')]=function(_0x3472de,_0x20a9c7){return _0x3472de['define'](_0x848b('0x8'),attributes,{'tableName':_0x848b('0x9'),'paranoid':![],'indexes':[{'name':_0x848b('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf8a9=['request-promise','path','./chatTransferReport.attributes','ChatTransferReport','report_chat_transfer','uniqueid','lodash','moment','bluebird'];(function(_0xacede0,_0x285b86){var _0x2296a3=function(_0x3debff){while(--_0x3debff){_0xacede0['push'](_0xacede0['shift']());}};_0x2296a3(++_0x285b86);}(_0xf8a9,0x138));var _0x9f8a=function(_0x2cb77c,_0x5ac8d7){_0x2cb77c=_0x2cb77c-0x0;var _0x562dc1=_0xf8a9[_0x2cb77c];return _0x562dc1;};'use strict';var _=require(_0x9f8a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x9f8a('0x1'));var BPromise=require(_0x9f8a('0x2'));var rp=require(_0x9f8a('0x3'));var fs=require('fs');var path=require(_0x9f8a('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9f8a('0x5'));module['exports']=function(_0x530a3a,_0x298fa2){return _0x530a3a['define'](_0x9f8a('0x6'),attributes,{'tableName':_0x9f8a('0x7'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9f8a('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index ce64b91..94d3e85 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 _0x3051=['message','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x3051,0x17d));var _0x1305=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3051[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1305('0x0'));var util=require(_0x1305('0x1'));var moment=require(_0x1305('0x2'));var BPromise=require(_0x1305('0x3'));var rs=require(_0x1305('0x4'));var fs=require('fs');var Redis=require(_0x1305('0x5'));var db=require(_0x1305('0x6'))['db'];var utils=require(_0x1305('0x7'));var logger=require('../../config/logger')(_0x1305('0x8'));var config=require(_0x1305('0x9'));var jayson=require(_0x1305('0xa'));var client=jayson[_0x1305('0xb')][_0x1305('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x883ffe,_0x3b8c84,_0x424d1d){return new BPromise(function(_0x3b3be9,_0x8775a4){return client[_0x1305('0xd')](_0x883ffe,_0x424d1d)['then'](function(_0x4ff389){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x3b8c84,'request\x20sent');logger[_0x1305('0xe')](_0x1305('0xf'),_0x3b8c84,'request\x20sent',JSON[_0x1305('0x10')](_0x4ff389));if(_0x4ff389[_0x1305('0x11')]){if(_0x4ff389[_0x1305('0x11')][_0x1305('0x12')]===0x1f4){logger[_0x1305('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x3b8c84,_0x4ff389[_0x1305('0x11')][_0x1305('0x13')]);return _0x8775a4(_0x4ff389[_0x1305('0x11')]['message']);}logger[_0x1305('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x3b8c84,_0x4ff389[_0x1305('0x11')][_0x1305('0x13')]);return _0x3b3be9(_0x4ff389['error'][_0x1305('0x13')]);}else{logger[_0x1305('0x14')](_0x1305('0x15'),_0x3b8c84,_0x1305('0x16'));_0x3b3be9(_0x4ff389[_0x1305('0x17')]['message']);}})[_0x1305('0x18')](function(_0x5e7791){logger[_0x1305('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x3b8c84,_0x5e7791);_0x8775a4(_0x5e7791);});});}
\ No newline at end of file
+var _0x2785=['http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x47e9d5,_0xe21a96){var _0x1cff20=function(_0x1af5f1){while(--_0x1af5f1){_0x47e9d5['push'](_0x47e9d5['shift']());}};_0x1cff20(++_0xe21a96);}(_0x2785,0x1f1));var _0x5278=function(_0x276167,_0x21086e){_0x276167=_0x276167-0x0;var _0x27a866=_0x2785[_0x276167];return _0x27a866;};'use strict';var _=require(_0x5278('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5278('0x1'));var fs=require('fs');var Redis=require(_0x5278('0x2'));var db=require(_0x5278('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5278('0x4'))(_0x5278('0x5'));var config=require(_0x5278('0x6'));var jayson=require(_0x5278('0x7'));var client=jayson[_0x5278('0x8')][_0x5278('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x124021,_0x202c50,_0x30c1dc){return new BPromise(function(_0x276970,_0x11296d){return client[_0x5278('0xa')](_0x124021,_0x30c1dc)[_0x5278('0xb')](function(_0x499e3e){logger[_0x5278('0xc')](_0x5278('0xd'),_0x202c50,_0x5278('0xe'));logger[_0x5278('0xf')](_0x5278('0x10'),_0x202c50,_0x5278('0xe'),JSON[_0x5278('0x11')](_0x499e3e));if(_0x499e3e[_0x5278('0x12')]){if(_0x499e3e[_0x5278('0x12')]['code']===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x202c50,_0x499e3e['error']['message']);return _0x11296d(_0x499e3e[_0x5278('0x12')][_0x5278('0x13')]);}logger[_0x5278('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x202c50,_0x499e3e[_0x5278('0x12')]['message']);return _0x276970(_0x499e3e[_0x5278('0x12')][_0x5278('0x13')]);}else{logger['info'](_0x5278('0xd'),_0x202c50,'request\x20sent');_0x276970(_0x499e3e[_0x5278('0x14')][_0x5278('0x13')]);}})[_0x5278('0x15')](function(_0x47fae6){logger[_0x5278('0x12')](_0x5278('0xd'),_0x202c50,_0x47fae6);_0x11296d(_0x47fae6);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index f43f133..adcb42a 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 _0x59f0=['index','/describe','isAuthenticated','/:id','show','put','update','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0xe7c3f1,_0x12326f){var _0x1a0934=function(_0x2c3300){while(--_0x2c3300){_0xe7c3f1['push'](_0xe7c3f1['shift']());}};_0x1a0934(++_0x12326f);}(_0x59f0,0x1cc));var _0x059f=function(_0x526de6,_0x5a13a4){_0x526de6=_0x526de6-0x0;var _0x455a12=_0x59f0[_0x526de6];return _0x455a12;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x059f('0x0'));var timeout=require(_0x059f('0x1'));var express=require(_0x059f('0x2'));var router=express['Router']();var fs_extra=require(_0x059f('0x3'));var auth=require(_0x059f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x059f('0x5'));var controller=require(_0x059f('0x6'));router[_0x059f('0x7')]('/',auth['isAuthenticated'](),controller[_0x059f('0x8')]);router[_0x059f('0x7')](_0x059f('0x9'),auth[_0x059f('0xa')](),controller['describe']);router[_0x059f('0x7')](_0x059f('0xb'),auth[_0x059f('0xa')](),controller[_0x059f('0xc')]);router['post']('/',auth[_0x059f('0xa')](),controller['create']);router[_0x059f('0xd')](_0x059f('0xb'),auth[_0x059f('0xa')](),controller[_0x059f('0xe')]);router[_0x059f('0xf')](_0x059f('0xb'),auth[_0x059f('0xa')](),controller[_0x059f('0x10')]);module[_0x059f('0x11')]=router;
\ No newline at end of file
+var _0xc2fb=['post','create','put','/:id','update','destroy','exports','multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','/describe'];(function(_0x38b14f,_0xd08fa8){var _0x22a324=function(_0x4bbb05){while(--_0x4bbb05){_0x38b14f['push'](_0x38b14f['shift']());}};_0x22a324(++_0xd08fa8);}(_0xc2fb,0x181));var _0xbc2f=function(_0x1a6ba3,_0x31b05f){_0x1a6ba3=_0x1a6ba3-0x0;var _0x205c97=_0xc2fb[_0x1a6ba3];return _0x205c97;};'use strict';var multer=require(_0xbc2f('0x0'));var util=require(_0xbc2f('0x1'));var path=require(_0xbc2f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbc2f('0x3'));var interaction=require(_0xbc2f('0x4'));var config=require(_0xbc2f('0x5'));var controller=require(_0xbc2f('0x6'));router['get']('/',auth[_0xbc2f('0x7')](),controller[_0xbc2f('0x8')]);router[_0xbc2f('0x9')](_0xbc2f('0xa'),auth[_0xbc2f('0x7')](),controller['describe']);router[_0xbc2f('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xbc2f('0xb')]('/',auth['isAuthenticated'](),controller[_0xbc2f('0xc')]);router[_0xbc2f('0xd')](_0xbc2f('0xe'),auth[_0xbc2f('0x7')](),controller[_0xbc2f('0xf')]);router['delete'](_0xbc2f('0xe'),auth['isAuthenticated'](),controller[_0xbc2f('0x10')]);module[_0xbc2f('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 6fd906c..3c3e3f1 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 _0xb440=['Comments','Leave\x20your\x20comments','getDataValue','offlineForm','parse','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','INTEGER','BOOLEAN','ENUM','squared','rounded','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','name','text','input','onlineForm','setDataValue','stringify','textarea'];(function(_0x226097,_0x1a2762){var _0x3a343d=function(_0x120b32){while(--_0x120b32){_0x226097['push'](_0x226097['shift']());}};_0x3a343d(++_0x1a2762);}(_0xb440,0xa9));var _0x0b44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb440[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0b44('0x0'));var rs=require(_0x0b44('0x1'));module[_0x0b44('0x2')]={'name':{'type':Sequelize[_0x0b44('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x0b44('0x3')],'allowNull':![],'unique':_0x0b44('0x4')},'description':{'type':Sequelize[_0x0b44('0x3')]},'mapKey':{'type':Sequelize[_0x0b44('0x3')],'defaultValue':_0x0b44('0x5')},'mapKeyOffline':{'type':Sequelize[_0x0b44('0x3')],'defaultValue':_0x0b44('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x0b44('0x3')],'defaultValue':_0x0b44('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x0b44('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x0b44('0x3')],'allowNull':![],'defaultValue':_0x0b44('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x0b44('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x0b44('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x0b44('0x3')]},'animation':{'type':Sequelize[_0x0b44('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x0b44('0xa')]('rounded',_0x0b44('0xb')),'defaultValue':_0x0b44('0xc')},'header_online':{'type':Sequelize[_0x0b44('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x0b44('0xd')},'offline_chat_button':{'type':Sequelize[_0x0b44('0x3')],'defaultValue':_0x0b44('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x0b44('0xf')},'download_transcript':{'type':Sequelize[_0x0b44('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x0b44('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x0b44('0x3')],'defaultValue':_0x0b44('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x0b44('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0b44('0x11')]},'closingQuestion':{'type':Sequelize[_0x0b44('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x0b44('0x3')],'defaultValue':_0x0b44('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x0b44('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x0b44('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0b44('0x13')},'closingMessage':{'type':Sequelize[_0x0b44('0x3')],'defaultValue':_0x0b44('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x0b44('0x3')],'defaultValue':_0x0b44('0x15')},'conditionAgreement':{'type':Sequelize[_0x0b44('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x0b44('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0b44('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x0b44('0x3')],'defaultValue':_0x0b44('0x16')},'ratingType':{'type':Sequelize[_0x0b44('0xa')]('star',_0x0b44('0x17')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x0b44('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x0b44('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x0b44('0x18'),'type':_0x0b44('0x19'),'required':!![]},'props':{'title':_0x0b44('0x18'),'helpText':''}},{'type':_0x0b44('0x1a'),'props':{'title':_0x0b44('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x0b44('0x5'),'type':_0x0b44('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON['parse'](this['getDataValue'](_0x0b44('0x1b'))):{};},'set':function(_0x55a30c){return this[_0x0b44('0x1c')]('onlineForm',JSON[_0x0b44('0x1d')](_0x55a30c));}},'offlineForm':{'type':Sequelize[_0x0b44('0x11')],'defaultValue':function(){return JSON[_0x0b44('0x1d')]({'items':[{'type':_0x0b44('0x1a'),'props':{'title':_0x0b44('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x0b44('0x5'),'type':_0x0b44('0x5')},'variable':null},{'type':_0x0b44('0x1e'),'config':{'placeholder':_0x0b44('0x1f')},'props':{'title':'Comments','helpText':_0x0b44('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x0b44('0x21')](_0x0b44('0x22'))?JSON[_0x0b44('0x23')](this['getDataValue'](_0x0b44('0x22'))):{};},'set':function(_0x10a98c){return this[_0x0b44('0x1c')]('offlineForm',JSON[_0x0b44('0x1d')](_0x10a98c));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x0b44('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x0b44('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x0b44('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x0b44('0x3')]},'forwardOffline':{'type':Sequelize[_0x0b44('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0b44('0x3')]},'waitingTitle':{'type':Sequelize[_0x0b44('0x3')],'defaultValue':_0x0b44('0x24')},'waitingMessage':{'type':Sequelize[_0x0b44('0x3')],'defaultValue':_0x0b44('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x0b44('0x3')],'defaultValue':_0x0b44('0x26')},'offlineMessageBody':{'type':Sequelize[_0x0b44('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x0b44('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x0b44('0x3')],'defaultValue':_0x0b44('0x27')},'skipUnmanaged':{'type':Sequelize[_0x0b44('0x3')],'defaultValue':_0x0b44('0x15')},'sendUnmanaged':{'type':Sequelize[_0x0b44('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x0b44('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x0b44('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x0b44('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x0b44('0x3')]},'notificationTemplate':{'type':Sequelize[_0x0b44('0x11')],'defaultValue':function(){return _0x0b44('0x28');}},'notificationSound':{'type':Sequelize[_0x0b44('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x0b44('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x0b44('0x3')],'defaultValue':_0x0b44('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x0b44('0x3')],'defaultValue':_0x0b44('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x0b44('0x2b')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x0b44('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x0b44('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x0b44('0x3')],'allowNull':![],'defaultValue':_0x0b44('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x0b44('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0b44('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0b44('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x0b44('0x3')],'defaultValue':_0x0b44('0x2d')},'systemAvatar':{'type':Sequelize[_0x0b44('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0b44('0x2e'),'set':function(_0x395de6){if(!_0x395de6)this[_0x0b44('0x1c')](_0x0b44('0x2f'),null);this['setDataValue']('mandatoryDisposition',_0x395de6);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x0b44('0x3')]},'vidaooTopic':{'type':Sequelize[_0x0b44('0x3')],'allowNull':![],'defaultValue':_0x0b44('0x30')},'vidaooNote':{'type':Sequelize[_0x0b44('0x3')],'defaultValue':function(){return _0x0b44('0x31');}},'vidaooMetadata':{'type':Sequelize[_0x0b44('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x0b44('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x0b44('0x11')]}};
\ No newline at end of file
+var _0x369d=['#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Skip','Feedback','star','stringify','input','text','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x369d,0x16b));var _0xd369=function(_0x1774bd,_0x3fedfb){_0x1774bd=_0x1774bd-0x0;var _0x3a28ab=_0x369d[_0x1774bd];return _0x3a28ab;};'use strict';var Sequelize=require(_0xd369('0x0'));var rs=require(_0xd369('0x1'));module[_0xd369('0x2')]={'name':{'type':Sequelize[_0xd369('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd369('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xd369('0x3')],'defaultValue':_0xd369('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xd369('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xd369('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xd369('0x3')],'allowNull':![],'defaultValue':_0xd369('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xd369('0x3')],'allowNull':![],'defaultValue':_0xd369('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xd369('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xd369('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xd369('0xb')](_0xd369('0xc'),_0xd369('0xd')),'defaultValue':_0xd369('0xc')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xd369('0xe')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xd369('0xf')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xd369('0x10')},'header_offline':{'type':Sequelize[_0xd369('0x3')],'defaultValue':_0xd369('0x11')},'download_transcript':{'type':Sequelize[_0xd369('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xd369('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xd369('0x3')],'defaultValue':_0xd369('0x12')},'defaultWhiteLabel':{'type':Sequelize[_0xd369('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xd369('0x13')]},'closingQuestion':{'type':Sequelize[_0xd369('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xd369('0x3')],'defaultValue':_0xd369('0x14')},'formSubmitFailureMessage':{'type':Sequelize[_0xd369('0x3')],'defaultValue':_0xd369('0x15')},'noteTitle':{'type':Sequelize[_0xd369('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xd369('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xd369('0x3')],'defaultValue':_0xd369('0x10')},'skipMessageButton':{'type':Sequelize[_0xd369('0x3')],'defaultValue':_0xd369('0x16')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd369('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xd369('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xd369('0x17')},'ratingType':{'type':Sequelize[_0xd369('0xb')](_0xd369('0x18'),'thumb'),'defaultValue':_0xd369('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xd369('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xd369('0x13')],'defaultValue':function(){return JSON[_0xd369('0x19')]({'items':[{'type':_0xd369('0x1a'),'variable':null,'config':{'placeholder':'name','type':_0xd369('0x1b'),'required':!![]},'props':{'title':_0xd369('0x1c'),'helpText':''}},{'type':_0xd369('0x1a'),'props':{'title':_0xd369('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xd369('0x5'),'type':_0xd369('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xd369('0x1d')](_0xd369('0x1e'))?JSON[_0xd369('0x1f')](this[_0xd369('0x1d')](_0xd369('0x1e'))):{};},'set':function(_0x715a98){return this[_0xd369('0x20')](_0xd369('0x1e'),JSON['stringify'](_0x715a98));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xd369('0x19')]({'items':[{'type':_0xd369('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xd369('0x5'),'type':_0xd369('0x5')},'variable':null},{'type':_0xd369('0x21'),'config':{'placeholder':_0xd369('0x22')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xd369('0x1d')](_0xd369('0x23'))?JSON[_0xd369('0x1f')](this[_0xd369('0x1d')]('offlineForm')):{};},'set':function(_0x171b19){return this[_0xd369('0x20')](_0xd369('0x23'),JSON[_0xd369('0x19')](_0x171b19));}},'token':{'type':Sequelize[_0xd369('0x3')],'defaultValue':function(){return rs[_0xd369('0x24')]();}},'autoclose':{'type':Sequelize[_0xd369('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd369('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xd369('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd369('0x3')]},'forwardOffline':{'type':Sequelize[_0xd369('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xd369('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xd369('0x25')},'waitingMessage':{'type':Sequelize[_0xd369('0x3')],'defaultValue':_0xd369('0x26')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xd369('0x3')],'defaultValue':_0xd369('0x27')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xd369('0x3')],'defaultValue':_0xd369('0x28')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xd369('0x16')},'sendUnmanaged':{'type':Sequelize[_0xd369('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xd369('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xd369('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xd369('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xd369('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd369('0x29');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd369('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xd369('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd369('0x3')],'defaultValue':_0xd369('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0xd369('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xd369('0x3')],'defaultValue':_0xd369('0x2b')},'verticalAlignment':{'type':Sequelize[_0xd369('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0xd369('0x2c')},'messagesAlignment':{'type':Sequelize[_0xd369('0x3')],'defaultValue':_0xd369('0x2d')},'defaultTitle':{'type':Sequelize[_0xd369('0x3')]},'customerAvatar':{'type':Sequelize[_0xd369('0x13')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xd369('0x3')],'allowNull':![],'defaultValue':_0xd369('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xd369('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd369('0x3')],'defaultValue':_0xd369('0x2f')},'systemAvatar':{'type':Sequelize[_0xd369('0x13')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd369('0x9')],'comment':_0xd369('0x30')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xd369('0x31'),'set':function(_0x2d259a){if(!_0x2d259a)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xd369('0x20')](_0xd369('0x32'),_0x2d259a);}},'vidaooEscalation':{'type':Sequelize[_0xd369('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xd369('0x3')]},'vidaooTopic':{'type':Sequelize[_0xd369('0x3')],'allowNull':![],'defaultValue':_0xd369('0x33')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xd369('0x34');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xd369('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xd369('0x13')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 0992989..199d822 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 _0xee24=['messageId','update','created','autoclose','close','ChatMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','EventManager','offline','files','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','attachments','offline-chat','basename','openNewInteraction','transaction','Attachment','bulkCreate','findOne','Smtp','forwardOffline','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','originalname','mapValues','subjectOffline','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','internal','Tag','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','virtual','License','chatLicenseExceeded','push','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','verticalAlignment','labelText','textColor','backgroundColor','hideWhenOffline','addApplications','sequelize','Transaction','ISOLATION_LEVELS','ChatApplication','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','getFields','false','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','ejs','fs-extra','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','then','get','ChatWebsites','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','ChatWebsite','includeAll','include','findAll','rows','length','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','params','describe','ChatWebsiteId','Disposition','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','pick','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','../../config/license/util','getLicense','custom','existsSync','root','server/files/images/logos/','download','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','getSystemAvatar','notify','setUA','headers','user-agent','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','mapKey','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','applications','Applications','orderBy','priority','asc','account','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread'];(function(_0x3825a8,_0x2ce1a2){var _0xabc9bc=function(_0x101073){while(--_0x101073){_0x3825a8['push'](_0x3825a8['shift']());}};_0xabc9bc(++_0x2ce1a2);}(_0xee24,0x1a6));var _0x4ee2=function(_0x5b6293,_0x13b4d3){_0x5b6293=_0x5b6293-0x0;var _0x2ab78a=_0xee24[_0x5b6293];return _0x2ab78a;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x4ee2('0x0'));var util=require(_0x4ee2('0x1'));var path=require('path');var ejs=require(_0x4ee2('0x2'));var fs=require('fs');var fs_extra=require(_0x4ee2('0x3'));var _=require(_0x4ee2('0x4'));var querystring=require(_0x4ee2('0x5'));var Redis=require('ioredis');var qs=require(_0x4ee2('0x6'));var logger=require(_0x4ee2('0x7'))(_0x4ee2('0x8'));var config=require(_0x4ee2('0x9'));var db=require('../../mysqldb')['db'];config[_0x4ee2('0xa')]=_[_0x4ee2('0xb')](config[_0x4ee2('0xa')],{'host':_0x4ee2('0xc'),'port':0x18eb});var socket=require(_0x4ee2('0xd'))(new Redis(config[_0x4ee2('0xa')]));require(_0x4ee2('0xe'))[_0x4ee2('0xf')](socket);var htmlToText=require('html-to-text');var jayson=require('jayson/promise');var client=jayson[_0x4ee2('0x10')][_0x4ee2('0x11')]({'port':0x232c});var client9002=jayson[_0x4ee2('0x10')][_0x4ee2('0x11')]({'port':0x232a});var client9003=jayson[_0x4ee2('0x10')]['http']({'port':0x232b});var client9001=jayson[_0x4ee2('0x10')][_0x4ee2('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x111aeb,_0x322780,_0x51f09d,_0x1f7125){return new BPromise(function(_0x2e4f35,_0x665d4d){var _0x23c1c9=_0x1f7125||client;return _0x23c1c9['request'](_0x111aeb,_0x51f09d)['then'](function(_0x2357c5){logger[_0x4ee2('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x322780,_0x4ee2('0x13'));logger[_0x4ee2('0x14')](_0x4ee2('0x15'),_0x322780,_0x4ee2('0x13'),JSON[_0x4ee2('0x16')](_0x2357c5));if(_0x2357c5[_0x4ee2('0x17')]){if(_0x2357c5['error'][_0x4ee2('0x18')]===0x1f4){logger[_0x4ee2('0x17')](_0x4ee2('0x19'),_0x322780,_0x2357c5['error'][_0x4ee2('0x1a')]);return _0x665d4d(_0x2357c5[_0x4ee2('0x17')][_0x4ee2('0x1a')]);}logger[_0x4ee2('0x17')](_0x4ee2('0x19'),_0x322780,_0x2357c5[_0x4ee2('0x17')][_0x4ee2('0x1a')]);return _0x2e4f35(_0x2357c5[_0x4ee2('0x17')]['message']);}else{logger['info'](_0x4ee2('0x19'),_0x322780,'request\x20sent');_0x2e4f35(_0x2357c5[_0x4ee2('0x1b')][_0x4ee2('0x1a')]);}})[_0x4ee2('0x1c')](function(_0x416a78){logger[_0x4ee2('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x322780,_0x416a78);_0x665d4d(_0x416a78);});});}function respondWithStatusCode(_0x1d5037,_0x4d74a0){_0x4d74a0=_0x4d74a0||0xcc;return function(_0x1feac6){if(_0x1feac6){return _0x1d5037[_0x4ee2('0x1d')](_0x4d74a0);}return _0x1d5037[_0x4ee2('0x1e')](_0x4d74a0)[_0x4ee2('0x1f')]();};}function respondWithResult(_0x1ca982,_0x1f9750){_0x1f9750=_0x1f9750||0xc8;return function(_0x381b3c){if(_0x381b3c){return _0x1ca982['status'](_0x1f9750)[_0x4ee2('0x20')](_0x381b3c);}};}function respondWithFilteredResult(_0x5127b8,_0x58f27e){return function(_0xebd95f){if(_0xebd95f){var _0x291734=typeof _0x58f27e[_0x4ee2('0x21')]===_0x4ee2('0x22')&&typeof _0x58f27e[_0x4ee2('0x23')]==='undefined';var _0x50005e=_0xebd95f[_0x4ee2('0x24')];var _0x2a078f=_0x291734?0x0:_0x58f27e['offset'];var _0x2fe02a=_0x291734?_0xebd95f['count']:_0x58f27e['offset']+_0x58f27e['limit'];var _0x45dc43;if(_0x2fe02a>=_0x50005e){_0x2fe02a=_0x50005e;_0x45dc43=0xc8;}else{_0x45dc43=0xce;}_0x5127b8[_0x4ee2('0x1e')](_0x45dc43);return _0x5127b8['set'](_0x4ee2('0x25'),_0x2a078f+'-'+_0x2fe02a+'/'+_0x50005e)[_0x4ee2('0x20')](_0xebd95f);}return null;};}function saveUpdates(_0x52db7b){return function(_0xc7df80){if(_0xc7df80){return _0xc7df80['update'](_0x52db7b)[_0x4ee2('0x26')](function(_0x3a0881){return _0x3a0881;});}return null;};}function removeEntity(_0x1fea65){return function(_0x4da154){if(_0x4da154){return _0x4da154['destroy']()[_0x4ee2('0x26')](function(){var _0x14f164=_0x4da154[_0x4ee2('0x27')]({'plain':!![]});var _0x502465=_0x4ee2('0x28');return db[_0x4ee2('0x29')][_0x4ee2('0x2a')]({'where':{'type':_0x502465,'resourceId':_0x14f164['id']}})[_0x4ee2('0x26')](function(){return _0x4da154;});})[_0x4ee2('0x26')](function(){_0x1fea65[_0x4ee2('0x1e')](0xcc)[_0x4ee2('0x1f')]();});}};}function handleEntityNotFound(_0x250fc7){return function(_0x256bea){if(!_0x256bea){_0x250fc7[_0x4ee2('0x1d')](0x194);}return _0x256bea;};}function handleError(_0x3ecedb,_0x25db8f){_0x25db8f=_0x25db8f||0x1f4;return function(_0x5a758f){logger[_0x4ee2('0x17')](_0x5a758f[_0x4ee2('0x2b')]);if(_0x5a758f['name']){delete _0x5a758f[_0x4ee2('0x2c')];}_0x3ecedb[_0x4ee2('0x1e')](_0x25db8f)[_0x4ee2('0x2d')](_0x5a758f);};}exports[_0x4ee2('0x2e')]=function(_0x3f8416,_0x429a90){var _0x2c1308={'include':[{'model':db[_0x4ee2('0x2f')],'as':_0x4ee2('0x30')}]},_0x5b1c58={},_0x455258={'count':0x0,'rows':[]};var _0x59e885=_[_0x4ee2('0x31')](db['ChatWebsite'][_0x4ee2('0x32')],function(_0x3f833d){return{'name':_0x3f833d[_0x4ee2('0x33')],'type':_0x3f833d[_0x4ee2('0x34')][_0x4ee2('0x35')]};});_0x5b1c58[_0x4ee2('0x36')]=_['map'](_0x59e885,'name');_0x5b1c58[_0x4ee2('0x37')]=_[_0x4ee2('0x38')](_0x3f8416[_0x4ee2('0x37')]);_0x5b1c58[_0x4ee2('0x39')]=_[_0x4ee2('0x3a')](_0x5b1c58[_0x4ee2('0x36')],_0x5b1c58[_0x4ee2('0x37')]);_0x2c1308[_0x4ee2('0x3b')]=_[_0x4ee2('0x3a')](_0x5b1c58[_0x4ee2('0x36')],qs['fields'](_0x3f8416['query'][_0x4ee2('0x3c')]));_0x2c1308[_0x4ee2('0x3b')]=_0x2c1308[_0x4ee2('0x3b')]['length']?_0x2c1308[_0x4ee2('0x3b')]:_0x5b1c58[_0x4ee2('0x36')];if(!_0x3f8416[_0x4ee2('0x37')][_0x4ee2('0x3d')](_0x4ee2('0x3e'))){_0x2c1308[_0x4ee2('0x23')]=qs[_0x4ee2('0x23')](_0x3f8416[_0x4ee2('0x37')][_0x4ee2('0x23')]);_0x2c1308[_0x4ee2('0x21')]=qs['offset'](_0x3f8416['query'][_0x4ee2('0x21')]);}_0x2c1308[_0x4ee2('0x3f')]=qs[_0x4ee2('0x40')](_0x3f8416['query'][_0x4ee2('0x40')]);_0x2c1308['where']=qs[_0x4ee2('0x39')](_['pick'](_0x3f8416[_0x4ee2('0x37')],_0x5b1c58[_0x4ee2('0x39')]),_0x59e885);if(_0x3f8416[_0x4ee2('0x37')]['filter']){_0x2c1308[_0x4ee2('0x41')]=_['merge'](_0x2c1308[_0x4ee2('0x41')],{'$or':_[_0x4ee2('0x31')](_0x59e885,function(_0x2ba4a5){if(_0x2ba4a5[_0x4ee2('0x34')]!=='VIRTUAL'){var _0x28374e={};_0x28374e[_0x2ba4a5[_0x4ee2('0x2c')]]={'$like':'%'+_0x3f8416['query'][_0x4ee2('0x42')]+'%'};return _0x28374e;}})});}_0x2c1308=_['merge']({},_0x2c1308,_0x3f8416['options']);var _0x11cd7a={'where':_0x2c1308['where']};return db[_0x4ee2('0x43')]['count'](_0x11cd7a)[_0x4ee2('0x26')](function(_0x4641b8){_0x455258[_0x4ee2('0x24')]=_0x4641b8;if(_0x3f8416['query'][_0x4ee2('0x44')]){_0x2c1308[_0x4ee2('0x45')]=[{'all':!![]}];}return db[_0x4ee2('0x43')][_0x4ee2('0x46')](_0x2c1308);})[_0x4ee2('0x26')](function(_0x513354){_0x455258[_0x4ee2('0x47')]=_0x513354;return _0x455258;})[_0x4ee2('0x26')](respondWithFilteredResult(_0x429a90,_0x2c1308))['catch'](handleError(_0x429a90,null));};exports['show']=function(_0x253d0e,_0x54e734){var _0x4480f3={'raw':![],'where':{'id':_0x253d0e['params']['id']},'include':[{'model':db[_0x4ee2('0x2f')],'as':_0x4ee2('0x30')}]},_0x1117cf={};_0x1117cf[_0x4ee2('0x36')]=_['keys'](db[_0x4ee2('0x43')][_0x4ee2('0x32')]);_0x1117cf['query']=_['keys'](_0x253d0e['query']);_0x1117cf['filters']=_[_0x4ee2('0x3a')](_0x1117cf[_0x4ee2('0x36')],_0x1117cf['query']);_0x4480f3[_0x4ee2('0x3b')]=_[_0x4ee2('0x3a')](_0x1117cf[_0x4ee2('0x36')],qs[_0x4ee2('0x3c')](_0x253d0e[_0x4ee2('0x37')][_0x4ee2('0x3c')]));_0x4480f3[_0x4ee2('0x3b')]=_0x4480f3['attributes'][_0x4ee2('0x48')]?_0x4480f3['attributes']:_0x1117cf[_0x4ee2('0x36')];if(_0x253d0e[_0x4ee2('0x37')][_0x4ee2('0x44')]){_0x4480f3['include']=[{'all':!![]}];}_0x4480f3=_[_0x4ee2('0x49')]({},_0x4480f3,_0x253d0e[_0x4ee2('0x4a')]);return db[_0x4ee2('0x43')]['find'](_0x4480f3)['then'](handleEntityNotFound(_0x54e734,null))[_0x4ee2('0x26')](respondWithResult(_0x54e734,null))[_0x4ee2('0x1c')](handleError(_0x54e734,null));};exports[_0x4ee2('0x4b')]=function(_0x3df5b3,_0x5ee68c){return db[_0x4ee2('0x43')][_0x4ee2('0x4b')](_0x3df5b3[_0x4ee2('0x4c')],{})[_0x4ee2('0x26')](function(_0x14b634){var _0x47405f=_0x3df5b3[_0x4ee2('0x4d')][_0x4ee2('0x27')]({'plain':!![]});if(!_0x47405f)throw new Error(_0x4ee2('0x4e'));if(_0x47405f[_0x4ee2('0x4f')]===_0x4ee2('0x4d')){var _0x1a1021=_0x14b634['get']({'plain':!![]});var _0x59fb25=_0x4ee2('0x28');return db[_0x4ee2('0x50')][_0x4ee2('0x51')]({'where':{'name':_0x59fb25,'userProfileId':_0x47405f['userProfileId']},'raw':!![]})['then'](function(_0x325ff3){if(_0x325ff3&&_0x325ff3[_0x4ee2('0x52')]===0x0){return db[_0x4ee2('0x29')]['create']({'name':_0x1a1021[_0x4ee2('0x2c')],'resourceId':_0x1a1021['id'],'type':_0x325ff3[_0x4ee2('0x2c')],'sectionId':_0x325ff3['id']},{})[_0x4ee2('0x26')](function(){return _0x14b634;});}else{return _0x14b634;}})[_0x4ee2('0x1c')](function(_0x430dfc){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x430dfc);throw _0x430dfc;});}return _0x14b634;})[_0x4ee2('0x26')](respondWithResult(_0x5ee68c,0xc9))[_0x4ee2('0x1c')](handleError(_0x5ee68c,null));};exports['update']=function(_0x3c4120,_0xdf70bd){if(_0x3c4120[_0x4ee2('0x4c')]['id']){delete _0x3c4120[_0x4ee2('0x4c')]['id'];}return db[_0x4ee2('0x43')]['find']({'where':{'id':_0x3c4120[_0x4ee2('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0x4ee2('0x30')}]})[_0x4ee2('0x26')](handleEntityNotFound(_0xdf70bd,null))['then'](saveUpdates(_0x3c4120[_0x4ee2('0x4c')],null))[_0x4ee2('0x26')](respondWithResult(_0xdf70bd,null))[_0x4ee2('0x1c')](handleError(_0xdf70bd,null));};exports[_0x4ee2('0x2a')]=function(_0x592ce6,_0x360fc8){return db[_0x4ee2('0x43')]['find']({'where':{'id':_0x592ce6[_0x4ee2('0x53')]['id']}})[_0x4ee2('0x26')](handleEntityNotFound(_0x360fc8,null))[_0x4ee2('0x26')](removeEntity(_0x360fc8,null))[_0x4ee2('0x1c')](handleError(_0x360fc8,null));};exports['describe']=function(_0x39a1b5,_0x3b3723){return db[_0x4ee2('0x43')][_0x4ee2('0x54')]()[_0x4ee2('0x26')](respondWithResult(_0x3b3723,null))[_0x4ee2('0x1c')](handleError(_0x3b3723,null));};exports['addDisposition']=function(_0x211e6d,_0x19d41b){if(_0x211e6d[_0x4ee2('0x4c')]['id']){delete _0x211e6d[_0x4ee2('0x4c')]['id'];}return db[_0x4ee2('0x43')][_0x4ee2('0x51')]({'where':{'id':_0x211e6d[_0x4ee2('0x53')]['id']}})[_0x4ee2('0x26')](handleEntityNotFound(_0x19d41b,null))['then'](function(_0x4a0b79){if(_0x4a0b79){_0x211e6d['body'][_0x4ee2('0x55')]=_0x4a0b79['id'];return db['Disposition'][_0x4ee2('0x4b')](_0x211e6d[_0x4ee2('0x4c')]);}})[_0x4ee2('0x26')](respondWithResult(_0x19d41b,null))['catch'](handleError(_0x19d41b,null));};exports['getDispositions']=function(_0x3d57d6,_0x2d0f3a){var _0x4217f9={'raw':![],'where':{}};var _0x373ad4={};var _0x1bfd79={'count':0x0,'rows':[]};return db[_0x4ee2('0x43')]['findOne']({'where':{'id':_0x3d57d6[_0x4ee2('0x53')]['id']}})[_0x4ee2('0x26')](handleEntityNotFound(_0x2d0f3a,null))[_0x4ee2('0x26')](function(_0x4a1656){if(_0x4a1656){_0x373ad4[_0x4ee2('0x36')]=_[_0x4ee2('0x38')](db[_0x4ee2('0x56')][_0x4ee2('0x32')]);_0x373ad4[_0x4ee2('0x37')]=_['keys'](_0x3d57d6['query']);_0x373ad4[_0x4ee2('0x39')]=_['intersection'](_0x373ad4[_0x4ee2('0x36')],_0x373ad4['query']);_0x4217f9['attributes']=_[_0x4ee2('0x3a')](_0x373ad4[_0x4ee2('0x36')],qs['fields'](_0x3d57d6[_0x4ee2('0x37')]['fields']));_0x4217f9[_0x4ee2('0x3b')]=_0x4217f9[_0x4ee2('0x3b')][_0x4ee2('0x48')]?_0x4217f9['attributes']:_0x373ad4[_0x4ee2('0x36')];if(!_0x3d57d6[_0x4ee2('0x37')]['hasOwnProperty'](_0x4ee2('0x3e'))){_0x4217f9[_0x4ee2('0x23')]=qs[_0x4ee2('0x23')](_0x3d57d6[_0x4ee2('0x37')][_0x4ee2('0x23')]);_0x4217f9[_0x4ee2('0x21')]=qs[_0x4ee2('0x21')](_0x3d57d6['query']['offset']);}_0x4217f9[_0x4ee2('0x3f')]=qs[_0x4ee2('0x40')](_0x3d57d6[_0x4ee2('0x37')]['sort']);_0x4217f9[_0x4ee2('0x41')]=qs[_0x4ee2('0x39')](_['pick'](_0x3d57d6['query'],_0x373ad4[_0x4ee2('0x39')]));_0x4217f9['where'][_0x4ee2('0x55')]=_0x4a1656['id'];if(_0x3d57d6[_0x4ee2('0x37')]['filter']){_0x4217f9[_0x4ee2('0x41')]=_[_0x4ee2('0x49')](_0x4217f9[_0x4ee2('0x41')],{'$or':_[_0x4ee2('0x31')](_0x4217f9[_0x4ee2('0x3b')],function(_0x14abad){var _0x1e093a={};_0x1e093a[_0x14abad]={'$like':'%'+_0x3d57d6[_0x4ee2('0x37')][_0x4ee2('0x42')]+'%'};return _0x1e093a;})});}_0x4217f9=_[_0x4ee2('0x49')]({},_0x4217f9,_0x3d57d6[_0x4ee2('0x4a')]);return db[_0x4ee2('0x56')][_0x4ee2('0x24')]({'where':_0x4217f9[_0x4ee2('0x41')]})[_0x4ee2('0x26')](function(_0x421c65){_0x1bfd79[_0x4ee2('0x24')]=_0x421c65;if(_0x3d57d6[_0x4ee2('0x37')][_0x4ee2('0x44')]){_0x4217f9[_0x4ee2('0x45')]=[{'all':!![]}];}return db[_0x4ee2('0x56')][_0x4ee2('0x46')](_0x4217f9);})['then'](function(_0x4312b9){_0x1bfd79[_0x4ee2('0x47')]=_0x4312b9;return _0x1bfd79;});}})[_0x4ee2('0x26')](respondWithFilteredResult(_0x2d0f3a,_0x4217f9))[_0x4ee2('0x1c')](handleError(_0x2d0f3a,null));};exports[_0x4ee2('0x57')]=function(_0x373f35,_0x315a89){return db[_0x4ee2('0x43')][_0x4ee2('0x51')]({'where':{'id':_0x373f35[_0x4ee2('0x53')]['id']}})['then'](handleEntityNotFound(_0x315a89,null))[_0x4ee2('0x26')](function(_0x27de1d){if(_0x27de1d){return _0x27de1d[_0x4ee2('0x57')](_0x373f35['query'][_0x4ee2('0x58')]);}})[_0x4ee2('0x26')](respondWithStatusCode(_0x315a89,null))[_0x4ee2('0x1c')](handleError(_0x315a89,null));};exports[_0x4ee2('0x59')]=function(_0x327543,_0x3eb440){if(_0x327543[_0x4ee2('0x4c')]['id']){delete _0x327543[_0x4ee2('0x4c')]['id'];}return db[_0x4ee2('0x43')][_0x4ee2('0x51')]({'where':{'id':_0x327543[_0x4ee2('0x53')]['id']}})['then'](handleEntityNotFound(_0x3eb440,null))[_0x4ee2('0x26')](function(_0xac4561){if(_0xac4561){_0x327543['body']['ChatWebsiteId']=_0xac4561['id'];return db['CannedAnswer'][_0x4ee2('0x4b')](_0x327543[_0x4ee2('0x4c')]);}})[_0x4ee2('0x26')](respondWithResult(_0x3eb440,null))[_0x4ee2('0x1c')](handleError(_0x3eb440,null));};exports[_0x4ee2('0x5a')]=function(_0x123b2f,_0x2138c0){var _0x24bb46={'raw':![],'where':{}};var _0x41b2cd={};var _0x3a9a66={'count':0x0,'rows':[]};return db[_0x4ee2('0x43')]['findOne']({'where':{'id':_0x123b2f[_0x4ee2('0x53')]['id']}})['then'](handleEntityNotFound(_0x2138c0,null))[_0x4ee2('0x26')](function(_0x43c331){if(_0x43c331){_0x41b2cd[_0x4ee2('0x36')]=_[_0x4ee2('0x38')](db[_0x4ee2('0x5b')][_0x4ee2('0x32')]);_0x41b2cd[_0x4ee2('0x37')]=_[_0x4ee2('0x38')](_0x123b2f[_0x4ee2('0x37')]);_0x41b2cd[_0x4ee2('0x39')]=_[_0x4ee2('0x3a')](_0x41b2cd[_0x4ee2('0x36')],_0x41b2cd[_0x4ee2('0x37')]);_0x24bb46[_0x4ee2('0x3b')]=_[_0x4ee2('0x3a')](_0x41b2cd[_0x4ee2('0x36')],qs[_0x4ee2('0x3c')](_0x123b2f['query'][_0x4ee2('0x3c')]));_0x24bb46[_0x4ee2('0x3b')]=_0x24bb46[_0x4ee2('0x3b')][_0x4ee2('0x48')]?_0x24bb46[_0x4ee2('0x3b')]:_0x41b2cd['model'];if(!_0x123b2f[_0x4ee2('0x37')][_0x4ee2('0x3d')](_0x4ee2('0x3e'))){_0x24bb46[_0x4ee2('0x23')]=qs['limit'](_0x123b2f[_0x4ee2('0x37')][_0x4ee2('0x23')]);_0x24bb46[_0x4ee2('0x21')]=qs['offset'](_0x123b2f[_0x4ee2('0x37')][_0x4ee2('0x21')]);}_0x24bb46[_0x4ee2('0x3f')]=qs[_0x4ee2('0x40')](_0x123b2f['query'][_0x4ee2('0x40')]);_0x24bb46[_0x4ee2('0x41')]=qs[_0x4ee2('0x39')](_[_0x4ee2('0x5c')](_0x123b2f[_0x4ee2('0x37')],_0x41b2cd[_0x4ee2('0x39')]));_0x24bb46[_0x4ee2('0x41')]['ChatWebsiteId']=_0x43c331['id'];if(_0x123b2f[_0x4ee2('0x37')][_0x4ee2('0x42')]){_0x24bb46[_0x4ee2('0x41')]=_[_0x4ee2('0x49')](_0x24bb46[_0x4ee2('0x41')],{'$or':_[_0x4ee2('0x31')](_0x24bb46['attributes'],function(_0x3769d1){var _0x1994e0={};_0x1994e0[_0x3769d1]={'$like':'%'+_0x123b2f[_0x4ee2('0x37')][_0x4ee2('0x42')]+'%'};return _0x1994e0;})});}_0x24bb46=_['merge']({},_0x24bb46,_0x123b2f[_0x4ee2('0x4a')]);return db['CannedAnswer']['count']({'where':_0x24bb46[_0x4ee2('0x41')]})['then'](function(_0x10ab57){_0x3a9a66[_0x4ee2('0x24')]=_0x10ab57;if(_0x123b2f['query'][_0x4ee2('0x44')]){_0x24bb46[_0x4ee2('0x45')]=[{'all':!![]}];}return db[_0x4ee2('0x5b')]['findAll'](_0x24bb46);})[_0x4ee2('0x26')](function(_0x2d5c17){_0x3a9a66[_0x4ee2('0x47')]=_0x2d5c17;return _0x3a9a66;});}})['then'](respondWithFilteredResult(_0x2138c0,_0x24bb46))[_0x4ee2('0x1c')](handleError(_0x2138c0,null));};exports[_0x4ee2('0x5d')]=function(_0x4f3344,_0x30347f){return db[_0x4ee2('0x43')]['find']({'where':{'id':_0x4f3344[_0x4ee2('0x53')]['id']}})['then'](handleEntityNotFound(_0x30347f,null))[_0x4ee2('0x26')](function(_0x1d8341){if(_0x1d8341){return _0x1d8341[_0x4ee2('0x5d')](_0x4f3344[_0x4ee2('0x37')][_0x4ee2('0x58')]);}})[_0x4ee2('0x26')](respondWithStatusCode(_0x30347f,null))[_0x4ee2('0x1c')](handleError(_0x30347f,null));};exports[_0x4ee2('0x5e')]=function(_0x51ee21,_0x42663f){_0x51ee21[_0x4ee2('0x4c')][_0x4ee2('0x5f')]=_0x51ee21[_0x4ee2('0x60')][_0x4ee2('0x61')];return db['ChatWebsite'][_0x4ee2('0x51')]({'where':{'id':_0x51ee21[_0x4ee2('0x53')]['id']}})[_0x4ee2('0x26')](handleEntityNotFound(_0x42663f,null))['then'](saveUpdates(_0x51ee21[_0x4ee2('0x4c')],null))['then'](respondWithResult(_0x42663f,null))[_0x4ee2('0x1c')](handleError(_0x42663f,null));};exports[_0x4ee2('0x62')]=function(_0x48f431,_0x13a431){_0x48f431[_0x4ee2('0x4c')][_0x4ee2('0x63')]=_0x48f431[_0x4ee2('0x60')]['filename'];return db[_0x4ee2('0x43')]['find']({'where':{'id':_0x48f431[_0x4ee2('0x53')]['id']}})[_0x4ee2('0x26')](handleEntityNotFound(_0x13a431,null))[_0x4ee2('0x26')](saveUpdates(_0x48f431['body'],null))[_0x4ee2('0x26')](respondWithResult(_0x13a431,null))['catch'](handleError(_0x13a431,null));};exports[_0x4ee2('0x64')]=function(_0x31e4c1,_0x3fde30){_0x31e4c1[_0x4ee2('0x4c')][_0x4ee2('0x65')]=_0x31e4c1[_0x4ee2('0x60')][_0x4ee2('0x61')];return db[_0x4ee2('0x43')][_0x4ee2('0x51')]({'where':{'id':_0x31e4c1[_0x4ee2('0x53')]['id']}})[_0x4ee2('0x26')](handleEntityNotFound(_0x3fde30,null))['then'](saveUpdates(_0x31e4c1[_0x4ee2('0x4c')],null))[_0x4ee2('0x26')](respondWithResult(_0x3fde30,null))[_0x4ee2('0x1c')](handleError(_0x3fde30,null));};exports[_0x4ee2('0x66')]=function(_0x536290,_0x407229){_0x536290[_0x4ee2('0x4c')][_0x4ee2('0x67')]=_0x536290[_0x4ee2('0x60')][_0x4ee2('0x61')];return db[_0x4ee2('0x43')][_0x4ee2('0x51')]({'where':{'id':_0x536290['params']['id']}})[_0x4ee2('0x26')](handleEntityNotFound(_0x407229,null))['then'](saveUpdates(_0x536290[_0x4ee2('0x4c')],null))[_0x4ee2('0x26')](respondWithResult(_0x407229,null))[_0x4ee2('0x1c')](handleError(_0x407229,null));};exports[_0x4ee2('0x68')]=function(_0x2d4ac2,_0x5a7671){var _0x31a436=path[_0x4ee2('0x69')](config['root'],'server/files/images/logos/default_logo.svg');var _0x59fe80={'where':{'id':_0x2d4ac2['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x40d990=![];return require(_0x4ee2('0x6a'))[_0x4ee2('0x6b')]()[_0x4ee2('0x26')](function(_0x23dc9d){if(_0x23dc9d){_0x40d990=_0x23dc9d[_0x4ee2('0x6c')];}})[_0x4ee2('0x26')](function(){return db[_0x4ee2('0x43')][_0x4ee2('0x51')](_0x59fe80);})['then'](handleEntityNotFound(_0x5a7671,null))[_0x4ee2('0x26')](function(_0x23ce68){if(_0x23ce68){if(!_['isNil'](_0x23ce68[_0x4ee2('0x5f')])){if(fs[_0x4ee2('0x6d')](path[_0x4ee2('0x69')](config[_0x4ee2('0x6e')],'server/files/images/logos/',_0x23ce68[_0x4ee2('0x5f')]))&&_0x40d990){_0x31a436=path[_0x4ee2('0x69')](config[_0x4ee2('0x6e')],_0x4ee2('0x6f'),_0x23ce68['sitepic']);}}return _0x5a7671[_0x4ee2('0x70')](_0x31a436);}})[_0x4ee2('0x1c')](handleError(_0x5a7671,null));};exports['getAvatar']=function(_0x358a30,_0x3d1d35){var _0x14aec4=path[_0x4ee2('0x69')](config[_0x4ee2('0x6e')],'server/files/images/avatars/default_avatar.png');var _0x13f585={'where':{'id':_0x358a30[_0x4ee2('0x53')]['id']},'attributes':['id',_0x4ee2('0x63')],'raw':!![]};return db[_0x4ee2('0x43')][_0x4ee2('0x51')](_0x13f585)[_0x4ee2('0x26')](handleEntityNotFound(_0x3d1d35,null))[_0x4ee2('0x26')](function(_0x3421e7){if(_0x3421e7){if(!_[_0x4ee2('0x71')](_0x3421e7[_0x4ee2('0x63')])){if(fs[_0x4ee2('0x6d')](path[_0x4ee2('0x69')](config['root'],_0x4ee2('0x72'),_0x3421e7[_0x4ee2('0x63')]))){_0x14aec4=path['join'](config[_0x4ee2('0x6e')],_0x4ee2('0x72'),_0x3421e7[_0x4ee2('0x63')]);}}return _0x3d1d35[_0x4ee2('0x70')](_0x14aec4);}})[_0x4ee2('0x1c')](handleError(_0x3d1d35,null));};exports[_0x4ee2('0x73')]=function(_0x4bb70d,_0x5b93e6){var _0x2e4bec=path[_0x4ee2('0x69')](config[_0x4ee2('0x6e')],_0x4ee2('0x74'));var _0x33eadb={'where':{'id':_0x4bb70d[_0x4ee2('0x53')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0x4ee2('0x43')]['find'](_0x33eadb)[_0x4ee2('0x26')](handleEntityNotFound(_0x5b93e6,null))[_0x4ee2('0x26')](function(_0x139446){if(_0x139446){if(!_['isNil'](_0x139446[_0x4ee2('0x65')])){if(fs['existsSync'](path[_0x4ee2('0x69')](config[_0x4ee2('0x6e')],_0x4ee2('0x72'),_0x139446['customerAvatar']))&&_0x139446['showCustomerAvatar']){_0x2e4bec=path['join'](config['root'],_0x4ee2('0x72'),_0x139446[_0x4ee2('0x65')]);}}return _0x5b93e6[_0x4ee2('0x70')](_0x2e4bec);}})['catch'](handleError(_0x5b93e6,null));};exports[_0x4ee2('0x75')]=function(_0x554191,_0x47a37a){var _0x158dcf=path[_0x4ee2('0x69')](config[_0x4ee2('0x6e')],'server/files/images/avatars/system_avatar.png');var _0x4a62de={'where':{'id':_0x554191[_0x4ee2('0x53')]['id']},'attributes':['id',_0x4ee2('0x67')],'raw':!![]};return db[_0x4ee2('0x43')][_0x4ee2('0x51')](_0x4a62de)[_0x4ee2('0x26')](handleEntityNotFound(_0x47a37a,null))[_0x4ee2('0x26')](function(_0x4e8af6){if(_0x4e8af6){if(!_['isNil'](_0x4e8af6[_0x4ee2('0x67')])){if(fs[_0x4ee2('0x6d')](path[_0x4ee2('0x69')](config[_0x4ee2('0x6e')],_0x4ee2('0x72'),_0x4e8af6[_0x4ee2('0x67')]))){_0x158dcf=path[_0x4ee2('0x69')](config[_0x4ee2('0x6e')],'server/files/images/avatars/',_0x4e8af6[_0x4ee2('0x67')]);}}return _0x47a37a[_0x4ee2('0x70')](_0x158dcf);}})[_0x4ee2('0x1c')](handleError(_0x47a37a,null));};exports[_0x4ee2('0x76')]=function(_0x3b97d1,_0x4b4c68){var _0x6eeda8=require('user-agent-parser');var _0x25276b=new _0x6eeda8();var _0x3c673e=_0x25276b[_0x4ee2('0x77')](_0x3b97d1[_0x4ee2('0x78')][_0x4ee2('0x79')])['getResult']();var _0x53ac13={'body':_0x3b97d1[_0x4ee2('0x4c')],'channel':_0x4ee2('0x7a')};var _0x121b70=[];var _0x1f16e2=[];var _0x4fc99f={};var _0x1df2b7=![];return db[_0x4ee2('0x7b')][_0x4ee2('0x54')]()[_0x4ee2('0x26')](function(_0x5515f8){if(!_0x5515f8){throw new db[(_0x4ee2('0x7c'))]['ValidationError'](_0x4ee2('0x7d'));}_0x121b70=_[_0x4ee2('0x7e')](_[_0x4ee2('0x38')](_0x5515f8),[_0x4ee2('0x7f'),_0x4ee2('0x80')]);_0x1f16e2=_[_0x4ee2('0x7e')](_[_0x4ee2('0x38')](_0x5515f8),['createdAt',_0x4ee2('0x80'),_0x4ee2('0x81'),_0x4ee2('0x82')]);if(_0x3b97d1[_0x4ee2('0x4c')]['id']){delete _0x3b97d1[_0x4ee2('0x4c')]['id'];}if(_[_0x4ee2('0x71')](_0x3b97d1[_0x4ee2('0x4c')][_0x4ee2('0x83')])){throw new db[(_0x4ee2('0x7c'))]['ValidationError'](_0x4ee2('0x84'));}if(_[_0x4ee2('0x71')](_0x3b97d1[_0x4ee2('0x4c')][_0x4ee2('0x4c')])||_0x3b97d1[_0x4ee2('0x4c')][_0x4ee2('0x4c')]===''){throw new db[(_0x4ee2('0x7c'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x3b97d1[_0x4ee2('0x4c')][_0x4ee2('0x85')])){throw new db[(_0x4ee2('0x7c'))][(_0x4ee2('0x86'))](_0x4ee2('0x87')+_0x1f16e2);}if(!_['includes'](_0x1f16e2,_0x3b97d1[_0x4ee2('0x4c')][_0x4ee2('0x85')])){throw new db[(_0x4ee2('0x7c'))][(_0x4ee2('0x86'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1f16e2);}_0x4fc99f[_0x3b97d1['body'][_0x4ee2('0x85')]]=_0x3b97d1['body']['from'];})[_0x4ee2('0x26')](function(){return db[_0x4ee2('0x43')][_0x4ee2('0x51')]({'where':{'id':_0x3b97d1[_0x4ee2('0x53')]['id']},'include':[{'model':db['CmList'],'as':_0x4ee2('0x88'),'include':[{'model':db[_0x4ee2('0x7b')],'as':_0x4ee2('0x89'),'where':_0x4fc99f,'limit':0x1,'order':[[_0x4ee2('0x80'),_0x4ee2('0x8a')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x4b4c68,null))[_0x4ee2('0x26')](function(_0x2358b4){if(_0x2358b4&&_0x2358b4['List']){_0x53ac13['account']=_0x2358b4;_0x53ac13[_0x4ee2('0x8b')]=_0x2358b4[_0x4ee2('0x8c')];_0x53ac13['list']=_0x2358b4[_0x4ee2('0x88')];_0x53ac13[_0x4ee2('0x8b')]=_[_0x4ee2('0x8d')](_0x53ac13[_0x4ee2('0x8b')],[_0x4ee2('0x8e')],[_0x4ee2('0x8f')]);if(_0x53ac13['account'][_0x4ee2('0x8c')]){delete _0x53ac13[_0x4ee2('0x90')][_0x4ee2('0x8c')];}if(_0x53ac13[_0x4ee2('0x90')]['List']&&_0x53ac13[_0x4ee2('0x90')][_0x4ee2('0x88')][_0x4ee2('0x89')]['length']){return _0x53ac13[_0x4ee2('0x90')]['List'][_0x4ee2('0x89')][0x0];}var _0x307db5=_[_0x4ee2('0xb')](_0x3b97d1[_0x4ee2('0x4c')],{'firstName':_0x3b97d1[_0x4ee2('0x4c')][_0x4ee2('0x83')],'ListId':_0x2358b4[_0x4ee2('0x82')]});_0x307db5[_0x3b97d1[_0x4ee2('0x4c')][_0x4ee2('0x85')]]=_0x3b97d1[_0x4ee2('0x4c')]['from'];return db['CmContact'][_0x4ee2('0x4b')](_0x307db5,{'fields':_0x121b70,'raw':!![]});}})[_0x4ee2('0x26')](handleEntityNotFound(_0x4b4c68,null))['then'](function(_0x5591a1){_0x53ac13[_0x4ee2('0x91')]=_0x5591a1;var _0x3788db=_0x3b97d1[_0x4ee2('0x4c')][_0x4ee2('0x92')];if(_0x3b97d1[_0x4ee2('0x78')]['cf-connecting-ip']){_0x3788db=_0x3b97d1[_0x4ee2('0x78')][_0x4ee2('0x93')];}else if(_0x3b97d1[_0x4ee2('0x78')]['x-forwarded-for']){_0x3788db=_[_0x4ee2('0x94')](_0x3b97d1[_0x4ee2('0x78')][_0x4ee2('0x95')][_0x4ee2('0x96')](','));}if(_0x5591a1){var _0x1f0841={'ContactId':_0x5591a1['id'],'ChatWebsiteId':_0x3b97d1[_0x4ee2('0x53')]['id'],'from':(_0x5591a1[_0x4ee2('0x97')]||'')+'\x20'+(_0x5591a1[_0x4ee2('0x98')]||''),'customerIp':_0x3788db,'customerPort':_0x3b97d1[_0x4ee2('0x78')][_0x4ee2('0x99')]?_0x3b97d1[_0x4ee2('0x78')][_0x4ee2('0x99')]:null,'referer':_0x3b97d1[_0x4ee2('0x4c')][_0x4ee2('0x9a')],'browserName':_0x3c673e[_0x4ee2('0x9b')]['name']&&_0x3c673e['browser']['version']?util[_0x4ee2('0x9c')](_0x4ee2('0x9d'),_0x3c673e[_0x4ee2('0x9b')][_0x4ee2('0x2c')],_0x3c673e[_0x4ee2('0x9b')][_0x4ee2('0x9e')]):_0x4ee2('0x9f'),'browserVersion':_0x3c673e['browser']['version']||_0x4ee2('0x9f'),'osName':util[_0x4ee2('0x9c')](_0x4ee2('0x9d'),_0x3c673e['os'][_0x4ee2('0x2c')],_0x3c673e['os'][_0x4ee2('0x9e')]),'osVersion':_0x3c673e['os'][_0x4ee2('0x9e')],'deviceModel':_0x3c673e[_0x4ee2('0xa0')][_0x4ee2('0x36')]&&_0x3c673e[_0x4ee2('0xa0')][_0x4ee2('0xa1')]?util['format']('%s\x20%s\x20%s',_0x3c673e['device'][_0x4ee2('0x36')],_0x3c673e[_0x4ee2('0xa0')][_0x4ee2('0xa1')],_0x3c673e[_0x4ee2('0xa0')][_0x4ee2('0x34')]):null,'deviceVendor':_0x3c673e['device'][_0x4ee2('0xa1')],'deviceType':_0x3c673e[_0x4ee2('0xa0')]['type'],'formData':JSON['stringify'](_0x3b97d1[_0x4ee2('0x4c')])};var _0xd8ef45={'ChatWebsiteId':_0x3b97d1['params']['id'],'closed':![]};if(_0x3b97d1[_0x4ee2('0x4c')]['threadId']){_0xd8ef45[_0x4ee2('0xa2')]=_0x3b97d1['body'][_0x4ee2('0xa2')];return db[_0x4ee2('0xa3')]['find']({'where':_0xd8ef45})[_0x4ee2('0x26')](function(_0x29a528){if(_0x29a528){return[_0x29a528,![]];}_0x1f0841['threadId']=_0x3b97d1[_0x4ee2('0x4c')][_0x4ee2('0xa2')];_0x1f0841[_0x4ee2('0xa4')]=_0x3b97d1['body']['externalUrl'];return db[_0x4ee2('0xa3')]['create'](_0x1f0841)['then'](function(_0x349709){return[_0x349709,!![]];});});}_0xd8ef45[_0x4ee2('0xa5')]=_0x5591a1['id'];if(_0x3b97d1[_0x4ee2('0x4c')][_0x4ee2('0xa6')]&&_0x3b97d1[_0x4ee2('0x4c')][_0x4ee2('0xa6')]['id']){_0xd8ef45['id']=_0x3b97d1['body'][_0x4ee2('0xa6')]['id'];return db['ChatInteraction']['find']({'where':_0xd8ef45})[_0x4ee2('0x26')](function(_0x48f896){if(_0x48f896){return[_0x48f896,![]];}return db[_0x4ee2('0xa3')][_0x4ee2('0x4b')](_0x1f0841)['then'](function(_0xcc2bad){return[_0xcc2bad,!![]];});});}return db[_0x4ee2('0xa3')][_0x4ee2('0x4b')](_0x1f0841)['then'](function(_0xc4505c){return[_0xc4505c,!![]];});}})[_0x4ee2('0xa7')](function(_0x4f2a6c,_0x2baf02){if(_0x4f2a6c){_0x1df2b7=_0x2baf02;if(!_0x2baf02){var _0xe63466={'from':(_0x53ac13[_0x4ee2('0x91')]['firstName']||'')+'\x20'+(_0x53ac13['contact'][_0x4ee2('0x98')]||'')};if(_0x3b97d1[_0x4ee2('0x4c')][_0x4ee2('0xa2')]&&_0x3b97d1[_0x4ee2('0x4c')][_0x4ee2('0xa8')]&&_0x3b97d1[_0x4ee2('0x4c')][_0x4ee2('0xa2')]!=_0x3b97d1[_0x4ee2('0x4c')][_0x4ee2('0xa8')]){_0xe63466[_0x4ee2('0xa2')]=_0x3b97d1[_0x4ee2('0x4c')][_0x4ee2('0xa8')];}return _0x4f2a6c[_0x4ee2('0xa9')](_0xe63466);}else{return _0x4f2a6c;}}})[_0x4ee2('0x26')](function(_0x510393){_0x53ac13['interaction']=_0x510393['get']({'plain':!![]});_0x53ac13[_0x4ee2('0xa6')][_0x4ee2('0xaa')]=_0x1df2b7;if(_0x53ac13[_0x4ee2('0xa6')]['created']){if(_0x53ac13[_0x4ee2('0x90')][_0x4ee2('0xab')]){_0x53ac13[_0x4ee2('0x8b')]['push']({'id':0x0,'priority':_0x53ac13[_0x4ee2('0x8b')][_0x4ee2('0x48')]+0x1,'app':_0x4ee2('0xac'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x4ee2('0xad')]['create']({'body':_0x3b97d1['body'][_0x4ee2('0x4c')],'ChatWebsiteId':_0x3b97d1[_0x4ee2('0x53')]['id'],'ChatInteractionId':_0x510393['id'],'direction':'in','ContactId':_0x53ac13[_0x4ee2('0x91')]['id'],'AttachmentId':_0x3b97d1[_0x4ee2('0x4c')][_0x4ee2('0xae')]});})['then'](function(_0x1ad056){_0x53ac13['message']=_0x1ad056;if(_0x53ac13['interaction']['UserId']){return db[_0x4ee2('0xaf')]['find']({'attributes':['id',_0x4ee2('0x2c')],'where':{'id':_0x53ac13[_0x4ee2('0xa6')][_0x4ee2('0xb0')]}})[_0x4ee2('0x26')](function(_0x1391f0){if(_0x1391f0){_0x53ac13[_0x4ee2('0x8b')][_0x4ee2('0xb1')]({'id':0x0,'priority':0x0,'app':_0x4ee2('0xb2'),'appdata':_0x1391f0[_0x4ee2('0x2c')]+','+(_0x53ac13[_0x4ee2('0x90')][_0x4ee2('0xb3')]||0xa),'interval':_0x4ee2('0xb4')});_0x53ac13['forcedOwnership']=!![];}return respondWithRpcPromise(_0x4ee2('0xb5'),_0x4ee2('0xb6'),_0x53ac13);});}return respondWithRpcPromise('Start',_0x4ee2('0xb6'),_0x53ac13);})['then'](function(_0x24a2b0){respondWithRpcPromise(_0x4ee2('0xb7'),_0x4ee2('0xb7'),{'event':_0x4ee2('0x76'),'message':_0x24a2b0},client9002);return _0x24a2b0;})[_0x4ee2('0x26')](respondWithResult(_0x4b4c68,null))[_0x4ee2('0x1c')](handleError(_0x4b4c68,null));};exports[_0x4ee2('0xb8')]=function(_0xc19783,_0x2c8afb){var _0x4ad9df,_0x3c68aa,_0x52038c;var _0x438597=[];var _0x2d3fa6={};var _0x201ee7=_0xc19783[_0x4ee2('0xb9')]||[];var _0x273639=[];var _0x13a423;return db[_0x4ee2('0x7b')][_0x4ee2('0x54')]()[_0x4ee2('0x26')](function(_0x4b0737){if(!_0x4b0737){throw new db['Sequelize']['ValidationError'](_0x4ee2('0x7d'));}_0x438597=_[_0x4ee2('0x7e')](_[_0x4ee2('0x38')](_0x4b0737),[_0x4ee2('0x7f'),_0x4ee2('0x80'),_0x4ee2('0x81'),'ListId']);if(_0xc19783['body']['id']){delete _0xc19783['body']['id'];}if(_[_0x4ee2('0x71')](_0xc19783[_0x4ee2('0x4c')][_0x4ee2('0x83')])){throw _0x2c8afb[_0x4ee2('0x1e')](0x1f4)[_0x4ee2('0x2d')](new db[(_0x4ee2('0x7c'))][(_0x4ee2('0x86'))]('from\x20is\x20mandatory'));}if(_[_0x4ee2('0x71')](_0xc19783['body'][_0x4ee2('0x4c')])||_0xc19783['body'][_0x4ee2('0x4c')]===''){throw _0x2c8afb['status'](0x1f4)[_0x4ee2('0x2d')](new db['Sequelize']['ValidationError'](_0x4ee2('0xba')));}if(_[_0x4ee2('0x71')](_0xc19783[_0x4ee2('0x4c')][_0x4ee2('0xbb')])){throw _0x2c8afb['status'](0x1f4)[_0x4ee2('0x2d')](new db[(_0x4ee2('0x7c'))][(_0x4ee2('0x86'))](_0x4ee2('0xbc')+_0x438597));}if(!_[_0x4ee2('0xbd')](_0x438597,_0xc19783['body'][_0x4ee2('0xbb')])){throw _0x2c8afb['status'](0x1f4)[_0x4ee2('0x2d')](new db[(_0x4ee2('0x7c'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x438597));}_0x2d3fa6[_0xc19783[_0x4ee2('0x4c')][_0x4ee2('0xbb')]]=_0xc19783[_0x4ee2('0x4c')][_0x4ee2('0x83')];})[_0x4ee2('0x26')](function(){return db[_0x4ee2('0x43')][_0x4ee2('0x51')]({'where':{'id':_0xc19783[_0x4ee2('0x53')]['id']},'include':[{'model':db[_0x4ee2('0xbe')],'as':'List'},{'model':db[_0x4ee2('0xbf')],'as':_0x4ee2('0xbf')}]});})['then'](handleEntityNotFound(_0x2c8afb,null))[_0x4ee2('0x26')](function(_0x373a14){if(_0x373a14&&_0x373a14[_0x4ee2('0x88')]){_0x3c68aa=_0x373a14;var _0x31d0e1=_[_0x4ee2('0xb')](_0xc19783[_0x4ee2('0x4c')],{'firstName':_0xc19783['body'][_0x4ee2('0x83')],'phone':_0xc19783['body'][_0x4ee2('0x83')],'ListId':_0x373a14['ListId']});_0x31d0e1[_0xc19783[_0x4ee2('0x4c')]['mapKeyOffline']]=_0xc19783[_0x4ee2('0x4c')]['from'];return db[_0x4ee2('0x7b')][_0x4ee2('0xc0')]({'where':_0x2d3fa6,'defaults':_0x31d0e1});}})[_0x4ee2('0xa7')](function(_0x2e13c2){if(_0x2e13c2){_0x52038c=_0x2e13c2;var _0xbf6c7d=fs['readFileSync'](path[_0x4ee2('0x69')](config[_0x4ee2('0x6e')],_0x4ee2('0xc1')),_0x4ee2('0xc2'));var _0x386f4c=ejs[_0x4ee2('0xc3')](_0xbf6c7d,{'body':_[_0x4ee2('0xc4')](_0xc19783[_0x4ee2('0x4c')][_0x4ee2('0x4c')]),'bodyTitle':_0x3c68aa[_0x4ee2('0xc5')]});return db[_0x4ee2('0xc6')]['create']({'body':_0x386f4c,'plainBody':htmlToText[_0x4ee2('0xc7')](_0x386f4c),'ContactId':_0x2e13c2['id'],'ChatWebsiteId':_0x3c68aa['id']});}})[_0x4ee2('0x26')](function(_0x491bbf){_0x13a423=_0x491bbf;if(_0x201ee7['length']){var _0x2a6c5a=_0x201ee7['map'](function(_0x2c6639){return{'name':_0x2c6639['originalname'],'basename':_0x2c6639['filename'],'type':_0x2c6639[_0x4ee2('0xc8')],'ChatOfflineMessageId':_0x491bbf['id']};});_0x273639=_0x2a6c5a['map'](_0x2a2096=>{var _0x5bc7a2={'filename':_0x2a2096[_0x4ee2('0x2c')],'path':path[_0x4ee2('0x69')](config[_0x4ee2('0x6e')],'server',_0x4ee2('0xb9'),_0x4ee2('0xc9'),_0x4ee2('0xca'),_0x2a2096[_0x4ee2('0xcb')])};return _0x5bc7a2;});if(!_0x3c68aa[_0x4ee2('0xcc')]){return db['sequelize'][_0x4ee2('0xcd')](function(_0x5b03df){return db[_0x4ee2('0xce')][_0x4ee2('0xcf')](_0x2a6c5a,{'transaction':_0x5b03df});});}}})[_0x4ee2('0x26')](function(){if(_0x13a423){_0x4ad9df=_0x13a423;return db[_0x4ee2('0xbf')][_0x4ee2('0xd0')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x4ee2('0xd1'),'raw':!![]}]});}})[_0x4ee2('0x26')](function(_0x39d425){if(_0x39d425&&_0x39d425[_0x4ee2('0xd1')]&&_0x3c68aa[_0x4ee2('0xd2')]&&_0x3c68aa['forwardOfflineAddress']){var _0x24c7d3={'tls':{'rejectUnauthorized':![]}};if(_0x39d425[_0x4ee2('0xd1')][_0x4ee2('0xd3')]){_0x24c7d3['service']=_0x39d425[_0x4ee2('0xd1')][_0x4ee2('0xd3')];}else{_0x24c7d3['host']=_0x39d425[_0x4ee2('0xd1')][_0x4ee2('0xd4')];_0x24c7d3[_0x4ee2('0xd5')]=_0x39d425[_0x4ee2('0xd1')]['port'];_0x24c7d3[_0x4ee2('0xd6')]=_0x39d425[_0x4ee2('0xd1')][_0x4ee2('0xd6')];}if(_0x39d425['Smtp'][_0x4ee2('0xd7')]){_0x24c7d3[_0x4ee2('0xd8')]={'user':_0x39d425[_0x4ee2('0xd1')][_0x4ee2('0x4d')],'pass':_0x39d425['Smtp'][_0x4ee2('0xd9')]};}return respondWithRpcPromise(_0x4ee2('0xda'),_0x4ee2('0xdb'),{'account':_0x24c7d3,'message':{'from':util[_0x4ee2('0x9c')](_0x4ee2('0xdc'),_0x39d425['name'],_0x39d425[_0x4ee2('0xdd')]||_0x39d425[_0x4ee2('0xd1')][_0x4ee2('0x4d')]),'to':_0x3c68aa[_0x4ee2('0xde')],'subject':_0x3c68aa[_0x4ee2('0xdf')],'html':_0x4ad9df[_0x4ee2('0x4c')],'attachments':_0x273639}},client9003)[_0x4ee2('0x26')](function(){return _0x4ad9df;})[_0x4ee2('0x1c')](function(_0x71103a){console['error'](_0x71103a);});}})[_0x4ee2('0x26')](function(){if(_0x3c68aa&&_0x3c68aa[_0x4ee2('0xcc')]&&_0x3c68aa[_0x4ee2('0xe0')]){var _0x1ebe1d=[];if(_0x201ee7[_0x4ee2('0x48')]){_0x1ebe1d=_0x201ee7[_0x4ee2('0x31')](function(_0x3f0bc6){return{'name':_0x3f0bc6[_0x4ee2('0xe1')],'basename':_0x3f0bc6['filename'],'type':_0x3f0bc6['mimetype'],'ChatOfflineMessageId':_0x13a423['id']};});}var _0x164466;if(!_[_0x4ee2('0x71')](_0x3c68aa['subjectOffline'])){var _0x2d6774=_[_0x4ee2('0x31')](_0xc19783[_0x4ee2('0x4c')],function(_0x26c93c){return _0x26c93c;});var _0x41a9fa=_['toPairsIn'](_0x2d6774)[0x0];var _0x546d6f=_[_0x4ee2('0xe2')](_0x41a9fa,function(_0x19a947){return _0x19a947;});_0x164466=_0x546d6f[0x1][_0x3c68aa[_0x4ee2('0xe3')]];}var _0x1d5c75={'from':_0x52038c[_0x4ee2('0xdd')],'firstName':_0x52038c[_0x4ee2('0x97')],'lastName':_0x52038c[_0x4ee2('0x98')],'mapKey':_0x4ee2('0xdd'),'message':{'from':_0x52038c[_0x4ee2('0xdd')],'to':_0x3c68aa[_0x4ee2('0xbf')][_0x4ee2('0xdd')],'cc':'','subject':_[_0x4ee2('0x71')](_0x164466)?_0x3c68aa[_0x4ee2('0xdf')]:_0x164466,'messageId':'','sentAt':new Date(),'attach':_0x1ebe1d[_0x4ee2('0x48')],'attachments':_0x1ebe1d,'originChannel':'Chat','ChatWebsiteId':_0x3c68aa['id'],'ChatOfflineMessageId':_0x4ad9df['id'],'originTo':_0x3c68aa[_0x4ee2('0xbf')]['email']},'body':_0x4ad9df['body']};var _0x4bdb89={'account':{'id':_0x3c68aa[_0x4ee2('0xe0')]},'body':_0x1d5c75,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x4ee2('0xe4'),_0x4ee2('0xe5'),_0x4bdb89,client9001)[_0x4ee2('0x26')](function(){return _0x4ad9df;})['catch'](function(_0x458915){console['error'](_0x458915);});}return;})[_0x4ee2('0x26')](function(){if(_0x4ad9df){return _0x4ad9df;}})['then'](respondWithResult(_0x2c8afb,null))[_0x4ee2('0x1c')](function(_0xa395a0){console[_0x4ee2('0x17')](_0x4ee2('0x1c'),_0xa395a0);for(var _0x44ba1d of _0x201ee7){var _0x5974f5=path[_0x4ee2('0x69')](config[_0x4ee2('0x6e')],'server',_0x4ee2('0xb9'),_0x4ee2('0xc9'),_0x4ee2('0xca'),_0x44ba1d['filename']);fs_extra[_0x4ee2('0xe6')](_0x5974f5)['catch'](function(_0x3204a0){console[_0x4ee2('0x17')](_0x4ee2('0xe7'),_0x5974f5,_0x3204a0);});}});};exports['addInteraction']=function(_0x5c5352,_0x1d8a78){return db[_0x4ee2('0xa3')][_0x4ee2('0x51')]({'where':{'id':_0x5c5352[_0x4ee2('0x53')]['id']}})['then'](handleEntityNotFound(_0x1d8a78,null))[_0x4ee2('0x26')](function(_0x2fe165){if(_0x2fe165){return _0x2fe165[_0x4ee2('0xe8')](_0x5c5352[_0x4ee2('0x4c')]['ids'],_[_0x4ee2('0xe9')](_0x5c5352[_0x4ee2('0x4c')],[_0x4ee2('0x58'),'id'])||{});}})[_0x4ee2('0x26')](respondWithResult(_0x1d8a78,null))[_0x4ee2('0x1c')](handleError(_0x1d8a78,null));};exports[_0x4ee2('0xea')]=function(_0xffb036,_0x4be1b7){var _0x59e316={'raw':![],'where':{}};var _0x3ba1cc={};var _0x2a99f2={'count':0x0,'rows':[]};return db[_0x4ee2('0x43')]['findOne']({'where':{'id':_0xffb036[_0x4ee2('0x53')]['id']}})[_0x4ee2('0x26')](handleEntityNotFound(_0x4be1b7,null))[_0x4ee2('0x26')](function(_0x1805b0){if(_0x1805b0){_0x3ba1cc[_0x4ee2('0x36')]=_[_0x4ee2('0x38')](db['ChatInteraction'][_0x4ee2('0x32')]);_0x3ba1cc['query']=_[_0x4ee2('0x38')](_0xffb036['query']);_0x3ba1cc[_0x4ee2('0x39')]=_['intersection'](_0x3ba1cc[_0x4ee2('0x36')],_0x3ba1cc['query']);_0x59e316[_0x4ee2('0x3b')]=_[_0x4ee2('0x3a')](_0x3ba1cc['model'],qs['fields'](_0xffb036['query'][_0x4ee2('0x3c')]));_0x59e316['attributes']=_0x59e316[_0x4ee2('0x3b')][_0x4ee2('0x48')]?_0x59e316[_0x4ee2('0x3b')]:_0x3ba1cc['model'];if(!_0xffb036[_0x4ee2('0x37')][_0x4ee2('0x3d')]('nolimit')){_0x59e316[_0x4ee2('0x23')]=qs[_0x4ee2('0x23')](_0xffb036[_0x4ee2('0x37')][_0x4ee2('0x23')]);_0x59e316[_0x4ee2('0x21')]=qs[_0x4ee2('0x21')](_0xffb036['query'][_0x4ee2('0x21')]);}_0x59e316[_0x4ee2('0x3f')]=qs[_0x4ee2('0x40')](_0xffb036[_0x4ee2('0x37')]['sort']);_0x59e316['where']=qs['filters'](_[_0x4ee2('0x5c')](_0xffb036[_0x4ee2('0x37')],_0x3ba1cc[_0x4ee2('0x39')]));_0x59e316[_0x4ee2('0x41')][_0x4ee2('0x55')]=_0x1805b0['id'];if(_0xffb036[_0x4ee2('0x37')]['filter']){_0x59e316[_0x4ee2('0x41')]=_[_0x4ee2('0x49')](_0x59e316[_0x4ee2('0x41')],{'$or':_['map'](_0x59e316['attributes'],function(_0x1d104a){var _0x20f931={};_0x20f931[_0x1d104a]={'$like':'%'+_0xffb036[_0x4ee2('0x37')]['filter']+'%'};return _0x20f931;})});}_0x59e316=_[_0x4ee2('0x49')]({},_0x59e316,_0xffb036[_0x4ee2('0x4a')]);return db[_0x4ee2('0xa3')][_0x4ee2('0x24')]({'where':_0x59e316[_0x4ee2('0x41')]})['then'](function(_0x59eefe){_0x2a99f2['count']=_0x59eefe;if(_0xffb036[_0x4ee2('0x37')][_0x4ee2('0x44')]){_0x59e316[_0x4ee2('0x45')]=[{'model':db[_0x4ee2('0x7b')],'as':_0x4ee2('0xeb'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x4ee2('0x2c'),'fullname',_0x4ee2('0xec')],'required':![]},{'model':db[_0x4ee2('0xed')],'as':'Tags','attributes':['id',_0x4ee2('0x2c'),_0x4ee2('0xee')],'where':_0xffb036[_0x4ee2('0x37')][_0x4ee2('0xef')]?{'id':_0xffb036['query'][_0x4ee2('0xef')]}:undefined,'required':_0xffb036[_0x4ee2('0x37')][_0x4ee2('0xef')]?!![]:![]}];}return db[_0x4ee2('0xa3')][_0x4ee2('0x46')](_0x59e316);})[_0x4ee2('0x26')](function(_0x986929){_0x2a99f2['rows']=_0x986929;return _0x2a99f2;});}})['then'](respondWithFilteredResult(_0x4be1b7,_0x59e316))[_0x4ee2('0x1c')](handleError(_0x4be1b7,null));};function iftimePromise(_0x425319,_0x464d17){return respondWithRpcPromise(_0x4ee2('0xf0'),_0x4ee2('0xf1'),{'command':_0x464d17[_0x4ee2('0xf2')]?util['format'](_0x4ee2('0xf3'),_0x425319[_0x4ee2('0xf4')],_0x464d17[_0x4ee2('0xf2')]):util[_0x4ee2('0x9c')](_0x4ee2('0xf5'),_0x425319[_0x4ee2('0xf4')])},client9002)[_0x4ee2('0x26')](function(_0x572169){var _0x25433c=_0x572169&&_0x572169['indexOf'](_0x4ee2('0xf6'))>=0x0?!![]:![];logger[_0x4ee2('0x12')](_0x4ee2('0xf7'),_0x464d17['id'],_0x425319['id'],_0x425319[_0x4ee2('0xf4')],_0x25433c?_0x4ee2('0xf8'):'OFFLINE',_0x464d17['timezone']?_0x464d17[_0x4ee2('0xf2')]:_0x4ee2('0xf9'));return _0x25433c;})[_0x4ee2('0x1c')](function(_0x3f3b09){logger['error'](_0x4ee2('0xf7'),_0x464d17['id'],_0x425319['id'],_0x425319[_0x4ee2('0xf4')],util[_0x4ee2('0xfa')](_0x3f3b09,{'showHidden':![],'depth':null}),_0x464d17['timezone']?_0x464d17[_0x4ee2('0xf2')]:_0x4ee2('0xf9'));return![];});}exports[_0x4ee2('0xf1')]=function(_0x3e0189,_0x3e10b8){var _0x42ebb7=0x0;var _0x3da453=0x0;var _0x176f98=![];var _0x42d872;var _0x3ce758;return db[_0x4ee2('0x43')][_0x4ee2('0x51')]({'where':{'id':_0x3e0189[_0x4ee2('0x53')]['id']},'include':[{'model':db[_0x4ee2('0xfb')],'as':_0x4ee2('0xfb'),'include':[{'model':db[_0x4ee2('0xfb')],'as':_0x4ee2('0xfc'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x4ee2('0x26')](handleEntityNotFound(_0x3e10b8,null))['then'](function(_0x5d0e1b){if(_0x5d0e1b){_0x42d872=_0x5d0e1b;return _0x5d0e1b['getProactiveActions']({'raw':!![]});}})['then'](function(_0x4b7796){if(_0x42d872){if(_0x4b7796){_0x3ce758=_0x4b7796;}}return require(_0x4ee2('0x6a'))[_0x4ee2('0x6b')]();})[_0x4ee2('0x26')](function(_0x33c1bf){if(_0x33c1bf){_0x3da453=_0x33c1bf[_0x4ee2('0xfd')];_0x176f98=_0x33c1bf[_0x4ee2('0x6c')];}})[_0x4ee2('0x26')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0x4ee2('0x26')](function(_0x2da13f){_0x42ebb7=_0x2da13f;if(_0x3da453&&_0x2da13f>_0x3da453){return db[_0x4ee2('0xfe')]['findOne']({'where':{'id':0x1}})[_0x4ee2('0x26')](function(_0x589046){if(_0x589046){_0x589046['increment'](_0x4ee2('0xff'));}});}})[_0x4ee2('0x26')](function(){if(_0x42d872[_0x4ee2('0xfb')]&&_0x42d872['Interval'][_0x4ee2('0xfc')]){var _0x202d22=[];for(var _0x5f18a0=0x0;_0x5f18a0<_0x42d872[_0x4ee2('0xfb')]['Intervals']['length'];_0x5f18a0++){var _0x2e74d3=_0x42d872[_0x4ee2('0xfb')][_0x4ee2('0xfc')][_0x5f18a0][_0x4ee2('0x27')]({'plain':!![]});_0x202d22[_0x4ee2('0x100')](iftimePromise(_0x2e74d3,_0x42d872));}return BPromise[_0x4ee2('0x101')](_0x202d22)['then'](function(_0x127be6){return _[_0x4ee2('0x102')](_0x127be6);});}else{return!![];}})['then'](function(_0xab588f){var _0x31f480=fs['readFileSync'](path[_0x4ee2('0x69')](config[_0x4ee2('0x6e')],_0x4ee2('0x103')),_0x4ee2('0xc2'));var _0x298f4a={'remote':_0x42d872[_0x4ee2('0x104')],'query':querystring[_0x4ee2('0x16')](_['merge'](_0x42d872[_0x4ee2('0x27')]({'plain':!![]}),{'customerIp':_0x3e0189[_0x4ee2('0x78')][_0x4ee2('0x95')]||_0x3e0189['headers'][_0x4ee2('0x105')]||_0x3e0189[_0x4ee2('0x106')][_0x4ee2('0x107')]||_0x3e0189['ip'],'referer':_0x3e0189[_0x4ee2('0x78')][_0x4ee2('0x9a')],'openedInteractions':_0x42ebb7,'maxInteractions':_0x3da453,'virtual':_0x176f98[_0x4ee2('0xfd')],'online':_0xab588f,'custom':_0x176f98}))[_0x4ee2('0x108')](/'/g,'\x5c\x27')};_0x3e10b8[_0x4ee2('0x2d')](ejs[_0x4ee2('0xc3')](Mustache[_0x4ee2('0xc3')](_0x31f480,_0x298f4a),{'proactiveActions':_0x3ce758,'alignment':_0x42d872['alignment'],'verticalAlignment':_0x42d872[_0x4ee2('0x109')],'div_color':_0x42d872[_0x4ee2('0xee')],'labelText':_0x42d872[_0x4ee2('0x10a')],'text_color':_0x42d872[_0x4ee2('0x10b')],'button_color':_0x42d872['color_button'],'background_color':_0x42d872[_0x4ee2('0x10c')],'hideWhenOffline':_0x42d872[_0x4ee2('0x10d')],'interval':_0x42d872['IntervalId']}));})[_0x4ee2('0x1c')](handleError(_0x3e10b8,null));};exports[_0x4ee2('0x10e')]=function(_0x242ba8,_0xf9574b){var _0x5af3be=_0x242ba8['params']['id'];var _0x33c93a=_0x242ba8[_0x4ee2('0x4c')];var _0x43e94c=0xc8;var _0x21273d=null;return db[_0x4ee2('0x10f')][_0x4ee2('0xcd')]({'isolationLevel':db[_0x4ee2('0x10f')][_0x4ee2('0x110')][_0x4ee2('0x111')]['READ_COMMITTED']},function(_0x38ad7b){return db[_0x4ee2('0x43')][_0x4ee2('0xd0')]({'where':{'id':_0x5af3be},'transaction':_0x38ad7b})[_0x4ee2('0x26')](function(_0x3664af){if(_0x3664af){return db['ChatApplication'][_0x4ee2('0x2a')]({'where':{'ChatWebsiteId':_0x5af3be},'transaction':_0x38ad7b})[_0x4ee2('0x26')](function(){var _0x123ca3=_[_0x4ee2('0x31')](_0x33c93a,function(_0x5d9fee){_0x5d9fee['ChatWebsiteId']=_0x5af3be;return _0x5d9fee;});return db['ChatApplication'][_0x4ee2('0xcf')](_0x123ca3,{'transaction':_0x38ad7b});});}else{_0x43e94c=0x194;_0x21273d=[];}});})[_0x4ee2('0x26')](function(){if(_0x43e94c!==0x194){return db[_0x4ee2('0x112')][_0x4ee2('0x113')]({'where':{'ChatWebsiteId':_0x5af3be},'order':_0x4ee2('0x8e')})['then'](function(_0x597b0d){_0x21273d=_0x597b0d;});}})[_0x4ee2('0x1c')](function(_0x42a88d){_0x43e94c=0x1f4;logger[_0x4ee2('0x17')](_0x42a88d[_0x4ee2('0x2b')]);if(_0x42a88d[_0x4ee2('0x2c')]){delete _0x42a88d['name'];}_0x21273d=_0x42a88d;})[_0x4ee2('0x114')](function(){if(_0x21273d===null){_0xf9574b['sendStatus'](_0x43e94c);}else{if(_0x43e94c===0x1f4){_0xf9574b[_0x4ee2('0x1e')](_0x43e94c)[_0x4ee2('0x2d')](_0x21273d);}else{_0xf9574b[_0x4ee2('0x1e')](_0x43e94c)[_0x4ee2('0x20')](_0x21273d);}}});};exports[_0x4ee2('0x115')]=function(_0x19a83d,_0x5dfc98){var _0x41fcc3={};var _0x1b5fb3={};var _0x3ac887;var _0x22a87e;return db[_0x4ee2('0x43')][_0x4ee2('0xd0')]({'where':{'id':_0x19a83d[_0x4ee2('0x53')]['id']}})['then'](handleEntityNotFound(_0x5dfc98,null))['then'](function(_0x4718db){if(_0x4718db){_0x3ac887=_0x4718db;_0x1b5fb3['model']=_['keys'](db[_0x4ee2('0x112')][_0x4ee2('0x32')]);_0x1b5fb3[_0x4ee2('0x37')]=_['keys'](_0x19a83d['query']);_0x1b5fb3[_0x4ee2('0x39')]=_['intersection'](_0x1b5fb3[_0x4ee2('0x36')],_0x1b5fb3[_0x4ee2('0x37')]);_0x41fcc3[_0x4ee2('0x3b')]=_[_0x4ee2('0x3a')](_0x1b5fb3[_0x4ee2('0x36')],qs['fields'](_0x19a83d[_0x4ee2('0x37')]['fields']));_0x41fcc3[_0x4ee2('0x3b')]=_0x41fcc3[_0x4ee2('0x3b')][_0x4ee2('0x48')]?_0x41fcc3['attributes']:_0x1b5fb3[_0x4ee2('0x36')];_0x41fcc3['order']=qs[_0x4ee2('0x40')](_0x19a83d[_0x4ee2('0x37')][_0x4ee2('0x40')]);_0x41fcc3[_0x4ee2('0x41')]=qs[_0x4ee2('0x39')](_[_0x4ee2('0x5c')](_0x19a83d['query'],_0x1b5fb3[_0x4ee2('0x39')]));if(_0x19a83d['query']['filter']){_0x41fcc3[_0x4ee2('0x41')]=_['merge'](_0x41fcc3[_0x4ee2('0x41')],{'$or':_[_0x4ee2('0x31')](_0x41fcc3[_0x4ee2('0x3b')],function(_0x287ca3){var _0x26d57a={};_0x26d57a[_0x287ca3]={'$like':'%'+_0x19a83d[_0x4ee2('0x37')]['filter']+'%'};return _0x26d57a;})});}_0x41fcc3=_[_0x4ee2('0x49')]({},_0x41fcc3,_0x19a83d[_0x4ee2('0x4a')]);return _0x3ac887[_0x4ee2('0x115')](_0x41fcc3);}})[_0x4ee2('0x26')](function(_0x394f23){if(_0x394f23){_0x22a87e=_0x394f23[_0x4ee2('0x48')];if(!_0x19a83d['query'][_0x4ee2('0x3d')]('nolimit')){_0x41fcc3['limit']=qs['limit'](_0x19a83d['query'][_0x4ee2('0x23')]);_0x41fcc3['offset']=qs[_0x4ee2('0x21')](_0x19a83d[_0x4ee2('0x37')][_0x4ee2('0x21')]);}return _0x3ac887[_0x4ee2('0x115')](_0x41fcc3);}})['then'](function(_0x136864){if(_0x136864){return _0x136864?{'count':_0x22a87e,'rows':_0x136864}:null;}})[_0x4ee2('0x26')](respondWithResult(_0x5dfc98,null))[_0x4ee2('0x1c')](handleError(_0x5dfc98,null));};exports[_0x4ee2('0x116')]=function(_0x341c8b,_0x5814bd){return db[_0x4ee2('0x117')][_0x4ee2('0x51')]({'where':{'id':_0x341c8b[_0x4ee2('0x53')]['id']}})['then'](handleEntityNotFound(_0x5814bd,null))[_0x4ee2('0x26')](function(_0x3eae02){if(_0x3eae02){return _0x3eae02[_0x4ee2('0x116')](_0x341c8b[_0x4ee2('0x4c')][_0x4ee2('0x58')],_[_0x4ee2('0xe9')](_0x341c8b['body'],[_0x4ee2('0x58'),'id'])||{});}})[_0x4ee2('0x26')](respondWithResult(_0x5814bd,null))[_0x4ee2('0x1c')](handleError(_0x5814bd,null));};exports['getProactiveActions']=function(_0xf7586f,_0x404160){var _0x3e7694={};var _0x2f6366={};var _0x363658;var _0x596d2c;return db[_0x4ee2('0x43')][_0x4ee2('0xd0')]({'where':{'id':_0xf7586f[_0x4ee2('0x53')]['id']}})['then'](handleEntityNotFound(_0x404160,null))[_0x4ee2('0x26')](function(_0x460e3e){if(_0x460e3e){_0x363658=_0x460e3e;_0x2f6366[_0x4ee2('0x36')]=_[_0x4ee2('0x38')](db['ChatProactiveAction'][_0x4ee2('0x32')]);_0x2f6366[_0x4ee2('0x37')]=_[_0x4ee2('0x38')](_0xf7586f['query']);_0x2f6366[_0x4ee2('0x39')]=_[_0x4ee2('0x3a')](_0x2f6366['model'],_0x2f6366[_0x4ee2('0x37')]);_0x3e7694['attributes']=_['intersection'](_0x2f6366[_0x4ee2('0x36')],qs[_0x4ee2('0x3c')](_0xf7586f[_0x4ee2('0x37')]['fields']));_0x3e7694[_0x4ee2('0x3b')]=_0x3e7694['attributes'][_0x4ee2('0x48')]?_0x3e7694[_0x4ee2('0x3b')]:_0x2f6366[_0x4ee2('0x36')];_0x3e7694[_0x4ee2('0x3f')]=qs[_0x4ee2('0x40')](_0xf7586f['query'][_0x4ee2('0x40')]);_0x3e7694['where']=qs[_0x4ee2('0x39')](_[_0x4ee2('0x5c')](_0xf7586f['query'],_0x2f6366[_0x4ee2('0x39')]));if(_0xf7586f[_0x4ee2('0x37')][_0x4ee2('0x42')]){_0x3e7694[_0x4ee2('0x41')]=_['merge'](_0x3e7694[_0x4ee2('0x41')],{'$or':_[_0x4ee2('0x31')](_0x3e7694[_0x4ee2('0x3b')],function(_0x27ba4e){var _0x24f0b3={};_0x24f0b3[_0x27ba4e]={'$like':'%'+_0xf7586f[_0x4ee2('0x37')][_0x4ee2('0x42')]+'%'};return _0x24f0b3;})});}_0x3e7694=_[_0x4ee2('0x49')]({},_0x3e7694,_0xf7586f['options']);return _0x363658[_0x4ee2('0x118')](_0x3e7694);}})[_0x4ee2('0x26')](function(_0xce62f1){if(_0xce62f1){_0x596d2c=_0xce62f1[_0x4ee2('0x48')];if(!_0xf7586f[_0x4ee2('0x37')][_0x4ee2('0x3d')](_0x4ee2('0x3e'))){_0x3e7694['limit']=qs[_0x4ee2('0x23')](_0xf7586f['query'][_0x4ee2('0x23')]);_0x3e7694[_0x4ee2('0x21')]=qs[_0x4ee2('0x21')](_0xf7586f[_0x4ee2('0x37')][_0x4ee2('0x21')]);}return _0x363658[_0x4ee2('0x118')](_0x3e7694);}})[_0x4ee2('0x26')](function(_0x1fe01b){if(_0x1fe01b){return _0x1fe01b?{'count':_0x596d2c,'rows':_0x1fe01b}:null;}})[_0x4ee2('0x26')](respondWithResult(_0x404160,null))[_0x4ee2('0x1c')](handleError(_0x404160,null));};exports[_0x4ee2('0x119')]=function(_0x24c1fc,_0x1f386a){var _0x2d3950=_0x24c1fc[_0x4ee2('0x37')]['online']===_0x4ee2('0x11a')?'offlineForm':_0x4ee2('0x11b');return db[_0x4ee2('0x43')][_0x4ee2('0x51')]({'attributes':['id',_0x2d3950],'where':{'id':_0x24c1fc[_0x4ee2('0x53')]['id']}})[_0x4ee2('0x26')](handleEntityNotFound(_0x1f386a,null))[_0x4ee2('0x26')](function(_0x43c585){if(_0x43c585){var _0x3590a3=_0x43c585[_0x2d3950];var _0xd98e1c=_0x3590a3&&_0x3590a3[_0x4ee2('0x11c')]?_0x3590a3[_0x4ee2('0x11c')]:[];_0x1f386a[_0x4ee2('0x2d')]({'fromKey':_[_0x4ee2('0x71')](_0x3590a3[_0x4ee2('0x11d')])?undefined:_0x3590a3[_0x4ee2('0x11d')],'count':_0xd98e1c[_0x4ee2('0x48')],'rows':_0xd98e1c});}})[_0x4ee2('0x1c')](handleError(_0x1f386a,null));};exports[_0x4ee2('0x11e')]=function(_0x2ac091,_0x4cab9c){var _0x3c3919={'raw':![],'where':{}};var _0xf134a5={};var _0x50bfd3={'count':0x0,'rows':[]};return db[_0x4ee2('0x43')][_0x4ee2('0xd0')]({'where':{'id':_0x2ac091['params']['id']}})['then'](handleEntityNotFound(_0x4cab9c,null))[_0x4ee2('0x26')](function(_0x8fb76a){if(_0x8fb76a){_0xf134a5[_0x4ee2('0x36')]=_[_0x4ee2('0x38')](db[_0x4ee2('0xc6')][_0x4ee2('0x32')]);_0xf134a5[_0x4ee2('0x37')]=_['keys'](_0x2ac091[_0x4ee2('0x37')]);_0xf134a5[_0x4ee2('0x39')]=_['intersection'](_0xf134a5[_0x4ee2('0x36')],_0xf134a5[_0x4ee2('0x37')]);_0x3c3919[_0x4ee2('0x3b')]=_[_0x4ee2('0x3a')](_0xf134a5['model'],qs['fields'](_0x2ac091['query'][_0x4ee2('0x3c')]));_0x3c3919[_0x4ee2('0x3b')]=_0x3c3919[_0x4ee2('0x3b')][_0x4ee2('0x48')]?_0x3c3919[_0x4ee2('0x3b')]:_0xf134a5[_0x4ee2('0x36')];if(!_0x2ac091[_0x4ee2('0x37')][_0x4ee2('0x3d')](_0x4ee2('0x3e'))){_0x3c3919[_0x4ee2('0x23')]=qs['limit'](_0x2ac091['query'][_0x4ee2('0x23')]);_0x3c3919[_0x4ee2('0x21')]=qs[_0x4ee2('0x21')](_0x2ac091[_0x4ee2('0x37')]['offset']);}_0x3c3919['order']=qs['sort'](_0x2ac091[_0x4ee2('0x37')]['sort']);_0x3c3919[_0x4ee2('0x41')]=qs['filters'](_[_0x4ee2('0x5c')](_0x2ac091[_0x4ee2('0x37')],_0xf134a5['filters']));_0x3c3919['where']['ChatWebsiteId']=_0x8fb76a['id'];if(_0x2ac091[_0x4ee2('0x37')][_0x4ee2('0x42')]){_0x3c3919['where']=_[_0x4ee2('0x49')](_0x3c3919[_0x4ee2('0x41')],{'$or':_[_0x4ee2('0x31')](_0x3c3919['attributes'],function(_0x1c3ffe){var _0x187790={};_0x187790[_0x1c3ffe]={'$like':'%'+_0x2ac091[_0x4ee2('0x37')][_0x4ee2('0x42')]+'%'};return _0x187790;})});}_0x3c3919=_[_0x4ee2('0x49')]({},_0x3c3919,_0x2ac091[_0x4ee2('0x4a')]);return db[_0x4ee2('0xc6')][_0x4ee2('0x24')]({'where':_0x3c3919[_0x4ee2('0x41')]})[_0x4ee2('0x26')](function(_0x3d3bb0){_0x50bfd3['count']=_0x3d3bb0;if(_0x2ac091[_0x4ee2('0x37')][_0x4ee2('0x44')]){_0x3c3919[_0x4ee2('0x45')]=[{'all':!![]}];}else{_0x3c3919[_0x4ee2('0x45')]=[{'model':db['CmContact'],'as':_0x4ee2('0xeb'),'required':![]},{'model':db[_0x4ee2('0xce')],'as':_0x4ee2('0x11f'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x3c3919);})[_0x4ee2('0x26')](function(_0x4a5fe1){_0x50bfd3['rows']=_0x4a5fe1;return _0x50bfd3;});}})[_0x4ee2('0x26')](respondWithFilteredResult(_0x4cab9c,_0x3c3919))[_0x4ee2('0x1c')](handleError(_0x4cab9c,null));};exports[_0x4ee2('0x120')]=function(_0x2e2d85,_0x3971aa){return db[_0x4ee2('0x43')][_0x4ee2('0x51')]({'where':{'id':_0x2e2d85[_0x4ee2('0x53')]['id']}})[_0x4ee2('0x26')](handleEntityNotFound(_0x3971aa,null))[_0x4ee2('0x26')](function(_0x402f46){if(_0x402f46){return _0x402f46[_0x4ee2('0x120')](_0x2e2d85[_0x4ee2('0x4c')][_0x4ee2('0x58')],_[_0x4ee2('0xe9')](_0x2e2d85['body'],[_0x4ee2('0x58'),'id'])||{})[_0x4ee2('0xa7')](function(_0x1296ff){for(var _0xdfb870=0x0;_0xdfb870<_0x2e2d85[_0x4ee2('0x4c')]['ids'][_0x4ee2('0x48')];_0xdfb870+=0x1){socket[_0x4ee2('0x121')](_0x4ee2('0x122'),{'UserId':Number(_0x2e2d85[_0x4ee2('0x4c')][_0x4ee2('0x58')][_0xdfb870]),'ChatWebsiteId':Number(_0x2e2d85[_0x4ee2('0x53')]['id'])});}return _0x1296ff;});}})[_0x4ee2('0x26')](respondWithResult(_0x3971aa,null))[_0x4ee2('0x1c')](handleError(_0x3971aa,null));};exports[_0x4ee2('0x123')]=function(_0x1c331b,_0x257df4){return db['ChatWebsite'][_0x4ee2('0x51')]({'where':{'id':_0x1c331b[_0x4ee2('0x53')]['id']}})[_0x4ee2('0x26')](handleEntityNotFound(_0x257df4,null))['then'](function(_0x10acd8){if(_0x10acd8){return _0x10acd8[_0x4ee2('0x123')](_0x1c331b['query']['ids'])[_0x4ee2('0x26')](function(){if(_[_0x4ee2('0x124')](_0x1c331b['query'][_0x4ee2('0x58')])){for(var _0x3745f7=0x0;_0x3745f7<_0x1c331b[_0x4ee2('0x37')][_0x4ee2('0x58')][_0x4ee2('0x48')];_0x3745f7+=0x1){socket['emit'](_0x4ee2('0x125'),{'UserId':Number(_0x1c331b[_0x4ee2('0x37')][_0x4ee2('0x58')][_0x3745f7]),'ChatWebsiteId':Number(_0x1c331b[_0x4ee2('0x53')]['id'])});}}else{socket[_0x4ee2('0x121')](_0x4ee2('0x125'),{'UserId':Number(_0x1c331b[_0x4ee2('0x37')][_0x4ee2('0x58')]),'ChatWebsiteId':Number(_0x1c331b[_0x4ee2('0x53')]['id'])});}});}})[_0x4ee2('0x26')](respondWithStatusCode(_0x257df4,null))['catch'](handleError(_0x257df4,null));};exports[_0x4ee2('0x126')]=function(_0x1cdd2f,_0x3ca5db){var _0x44388f={};var _0x29ee5f={};var _0x3402ff;var _0x5c1eaa;return db[_0x4ee2('0x43')][_0x4ee2('0xd0')]({'where':{'id':_0x1cdd2f[_0x4ee2('0x53')]['id']}})['then'](handleEntityNotFound(_0x3ca5db,null))[_0x4ee2('0x26')](function(_0x4ed452){if(_0x4ed452){_0x3402ff=_0x4ed452;_0x29ee5f[_0x4ee2('0x36')]=_[_0x4ee2('0x38')](db[_0x4ee2('0xaf')][_0x4ee2('0x32')]);_0x29ee5f[_0x4ee2('0x37')]=_[_0x4ee2('0x38')](_0x1cdd2f['query']);_0x29ee5f['filters']=_[_0x4ee2('0x3a')](_0x29ee5f[_0x4ee2('0x36')],_0x29ee5f[_0x4ee2('0x37')]);_0x44388f['attributes']=_[_0x4ee2('0x3a')](_0x29ee5f['model'],qs[_0x4ee2('0x3c')](_0x1cdd2f['query']['fields']));_0x44388f[_0x4ee2('0x3b')]=_0x44388f[_0x4ee2('0x3b')][_0x4ee2('0x48')]?_0x44388f[_0x4ee2('0x3b')]:_0x29ee5f[_0x4ee2('0x36')];_0x44388f['order']=qs[_0x4ee2('0x40')](_0x1cdd2f[_0x4ee2('0x37')][_0x4ee2('0x40')]);_0x44388f['where']=qs[_0x4ee2('0x39')](_[_0x4ee2('0x5c')](_0x1cdd2f[_0x4ee2('0x37')],_0x29ee5f[_0x4ee2('0x39')]));if(_0x1cdd2f['query'][_0x4ee2('0x42')]){_0x44388f['where']=_['merge'](_0x44388f[_0x4ee2('0x41')],{'$or':_[_0x4ee2('0x31')](_0x44388f['attributes'],function(_0x4ee525){var _0x26b469={};_0x26b469[_0x4ee525]={'$like':'%'+_0x1cdd2f['query']['filter']+'%'};return _0x26b469;})});}_0x44388f=_[_0x4ee2('0x49')]({},_0x44388f,_0x1cdd2f[_0x4ee2('0x4a')]);return _0x3402ff[_0x4ee2('0x126')](_0x44388f);}})[_0x4ee2('0x26')](function(_0x349f94){if(_0x349f94){_0x5c1eaa=_0x349f94[_0x4ee2('0x48')];if(!_0x1cdd2f[_0x4ee2('0x37')][_0x4ee2('0x3d')](_0x4ee2('0x3e'))){_0x44388f[_0x4ee2('0x23')]=qs['limit'](_0x1cdd2f[_0x4ee2('0x37')]['limit']);_0x44388f[_0x4ee2('0x21')]=qs[_0x4ee2('0x21')](_0x1cdd2f[_0x4ee2('0x37')][_0x4ee2('0x21')]);}return _0x3402ff[_0x4ee2('0x126')](_0x44388f);}})[_0x4ee2('0x26')](function(_0x3c95a4){if(_0x3c95a4){return _0x3c95a4?{'count':_0x5c1eaa,'rows':_0x3c95a4}:null;}})[_0x4ee2('0x26')](respondWithResult(_0x3ca5db,null))[_0x4ee2('0x1c')](handleError(_0x3ca5db,null));};
\ No newline at end of file
+var _0x12cc=['addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','../../config/license/util','getLicense','join','server/files/images/logos/','root','download','agentAvatar','isNil','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','notify','setUA','headers','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','CompanyId','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','orderBy','priority','asc','ListId','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','lastName','x-real-port','referer','browser','%s\x20%s','version','unknown','format','device','vendor','stringify','ChatInteraction','threadId','externalUrl','interaction','spread','firstName','created','autoclose','close','unmanaged','ChatMessage','UserId','User','unshift','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','files','updatedAt','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','basename','openNewInteraction','sequelize','transaction','bulkCreate','MailServerOut','Smtp','forwardOffline','service','host','port','secure','auth','pass','SendMail','sendMail','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','mapValues','Chat','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','internal','Tags','color','tag','getSnippet','timezone','interval','iftime\x20%s','indexOf','true','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','Intervals','getProactiveActions','custom','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','alignment','verticalAlignment','labelText','textColor','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','onlineForm','items','fromKey','Attachments','findAll','addAgents','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','emit','getAgents','mustache','util','path','ejs','fs-extra','ioredis','../../components/parsers/qs','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','html-to-text','jayson/promise','client','http','then','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','update','destroy','get','ChatWebsites','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','limit','order','sort','where','filter','merge','type','options','includeAll','include','rows','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','describe','Disposition','getDispositions','findOne','hasOwnProperty','pick','ChatWebsiteId','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers'];(function(_0x10f78d,_0x16760c){var _0x264298=function(_0x476e67){while(--_0x476e67){_0x10f78d['push'](_0x10f78d['shift']());}};_0x264298(++_0x16760c);}(_0x12cc,0xc2));var _0xc12c=function(_0x31a15b,_0x5b0cca){_0x31a15b=_0x31a15b-0x0;var _0x5925a4=_0x12cc[_0x31a15b];return _0x5925a4;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xc12c('0x0'));var util=require(_0xc12c('0x1'));var path=require(_0xc12c('0x2'));var ejs=require(_0xc12c('0x3'));var fs=require('fs');var fs_extra=require(_0xc12c('0x4'));var _=require('lodash');var querystring=require('querystring');var Redis=require(_0xc12c('0x5'));var qs=require(_0xc12c('0x6'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0xc12c('0x7'))['db'];config[_0xc12c('0x8')]=_[_0xc12c('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc12c('0xa'))(new Redis(config[_0xc12c('0x8')]));require(_0xc12c('0xb'))['register'](socket);var htmlToText=require(_0xc12c('0xc'));var jayson=require(_0xc12c('0xd'));var client=jayson[_0xc12c('0xe')]['http']({'port':0x232c});var client9002=jayson[_0xc12c('0xe')][_0xc12c('0xf')]({'port':0x232a});var client9003=jayson[_0xc12c('0xe')][_0xc12c('0xf')]({'port':0x232b});var client9001=jayson[_0xc12c('0xe')][_0xc12c('0xf')]({'port':0x2329});function respondWithRpcPromise(_0x5f474d,_0x18dd8b,_0x103ea6,_0x126a25){return new BPromise(function(_0x54aa3e,_0x57bbf4){var _0x3e526e=_0x126a25||client;return _0x3e526e['request'](_0x5f474d,_0x103ea6)[_0xc12c('0x10')](function(_0x1a7627){logger['info'](_0xc12c('0x11'),_0x18dd8b,'request\x20sent');logger[_0xc12c('0x12')](_0xc12c('0x13'),_0x18dd8b,'request\x20sent',JSON['stringify'](_0x1a7627));if(_0x1a7627[_0xc12c('0x14')]){if(_0x1a7627[_0xc12c('0x14')]['code']===0x1f4){logger[_0xc12c('0x14')](_0xc12c('0x11'),_0x18dd8b,_0x1a7627[_0xc12c('0x14')][_0xc12c('0x15')]);return _0x57bbf4(_0x1a7627[_0xc12c('0x14')]['message']);}logger[_0xc12c('0x14')](_0xc12c('0x11'),_0x18dd8b,_0x1a7627[_0xc12c('0x14')]['message']);return _0x54aa3e(_0x1a7627[_0xc12c('0x14')][_0xc12c('0x15')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x18dd8b,'request\x20sent');_0x54aa3e(_0x1a7627[_0xc12c('0x16')][_0xc12c('0x15')]);}})[_0xc12c('0x17')](function(_0x2c718d){logger[_0xc12c('0x14')](_0xc12c('0x11'),_0x18dd8b,_0x2c718d);_0x57bbf4(_0x2c718d);});});}function respondWithStatusCode(_0x2b13db,_0x5f19ea){_0x5f19ea=_0x5f19ea||0xcc;return function(_0x4518a9){if(_0x4518a9){return _0x2b13db[_0xc12c('0x18')](_0x5f19ea);}return _0x2b13db[_0xc12c('0x19')](_0x5f19ea)[_0xc12c('0x1a')]();};}function respondWithResult(_0x41e5f7,_0x423bbd){_0x423bbd=_0x423bbd||0xc8;return function(_0x8e4d35){if(_0x8e4d35){return _0x41e5f7[_0xc12c('0x19')](_0x423bbd)[_0xc12c('0x1b')](_0x8e4d35);}};}function respondWithFilteredResult(_0x42d01c,_0x6552e7){return function(_0x8acdfc){if(_0x8acdfc){var _0xe5cee4=typeof _0x6552e7[_0xc12c('0x1c')]===_0xc12c('0x1d')&&typeof _0x6552e7['limit']==='undefined';var _0x148373=_0x8acdfc[_0xc12c('0x1e')];var _0x5b2e7e=_0xe5cee4?0x0:_0x6552e7[_0xc12c('0x1c')];var _0x39a976=_0xe5cee4?_0x8acdfc[_0xc12c('0x1e')]:_0x6552e7[_0xc12c('0x1c')]+_0x6552e7['limit'];var _0x9b77d6;if(_0x39a976>=_0x148373){_0x39a976=_0x148373;_0x9b77d6=0xc8;}else{_0x9b77d6=0xce;}_0x42d01c[_0xc12c('0x19')](_0x9b77d6);return _0x42d01c[_0xc12c('0x1f')](_0xc12c('0x20'),_0x5b2e7e+'-'+_0x39a976+'/'+_0x148373)['json'](_0x8acdfc);}return null;};}function saveUpdates(_0x57a566){return function(_0x51e763){if(_0x51e763){return _0x51e763[_0xc12c('0x21')](_0x57a566)[_0xc12c('0x10')](function(_0x8919a2){return _0x8919a2;});}return null;};}function removeEntity(_0x214d5e){return function(_0x550fc6){if(_0x550fc6){return _0x550fc6[_0xc12c('0x22')]()[_0xc12c('0x10')](function(){var _0x697b1f=_0x550fc6[_0xc12c('0x23')]({'plain':!![]});var _0x5e9aaf=_0xc12c('0x24');return db['UserProfileResource'][_0xc12c('0x22')]({'where':{'type':_0x5e9aaf,'resourceId':_0x697b1f['id']}})[_0xc12c('0x10')](function(){return _0x550fc6;});})[_0xc12c('0x10')](function(){_0x214d5e['status'](0xcc)[_0xc12c('0x1a')]();});}};}function handleEntityNotFound(_0x2d1ddb){return function(_0x14efa2){if(!_0x14efa2){_0x2d1ddb['sendStatus'](0x194);}return _0x14efa2;};}function handleError(_0x1109e1,_0x2852ef){_0x2852ef=_0x2852ef||0x1f4;return function(_0x4a1c9f){logger[_0xc12c('0x14')](_0x4a1c9f[_0xc12c('0x25')]);if(_0x4a1c9f['name']){delete _0x4a1c9f[_0xc12c('0x26')];}_0x1109e1['status'](_0x2852ef)['send'](_0x4a1c9f);};}exports[_0xc12c('0x27')]=function(_0x552711,_0x4ec490){var _0x491cf6={'include':[{'model':db[_0xc12c('0x28')],'as':_0xc12c('0x29')}]},_0x1598a3={},_0x2cfe41={'count':0x0,'rows':[]};var _0x42be6f=_[_0xc12c('0x2a')](db[_0xc12c('0x2b')][_0xc12c('0x2c')],function(_0x52ad79){return{'name':_0x52ad79[_0xc12c('0x2d')],'type':_0x52ad79['type'][_0xc12c('0x2e')]};});_0x1598a3['model']=_['map'](_0x42be6f,_0xc12c('0x26'));_0x1598a3[_0xc12c('0x2f')]=_[_0xc12c('0x30')](_0x552711[_0xc12c('0x2f')]);_0x1598a3[_0xc12c('0x31')]=_[_0xc12c('0x32')](_0x1598a3[_0xc12c('0x33')],_0x1598a3[_0xc12c('0x2f')]);_0x491cf6['attributes']=_[_0xc12c('0x32')](_0x1598a3['model'],qs[_0xc12c('0x34')](_0x552711[_0xc12c('0x2f')][_0xc12c('0x34')]));_0x491cf6[_0xc12c('0x35')]=_0x491cf6[_0xc12c('0x35')][_0xc12c('0x36')]?_0x491cf6[_0xc12c('0x35')]:_0x1598a3[_0xc12c('0x33')];if(!_0x552711['query']['hasOwnProperty'](_0xc12c('0x37'))){_0x491cf6[_0xc12c('0x38')]=qs[_0xc12c('0x38')](_0x552711[_0xc12c('0x2f')][_0xc12c('0x38')]);_0x491cf6['offset']=qs[_0xc12c('0x1c')](_0x552711['query'][_0xc12c('0x1c')]);}_0x491cf6[_0xc12c('0x39')]=qs[_0xc12c('0x3a')](_0x552711['query'][_0xc12c('0x3a')]);_0x491cf6[_0xc12c('0x3b')]=qs[_0xc12c('0x31')](_['pick'](_0x552711[_0xc12c('0x2f')],_0x1598a3[_0xc12c('0x31')]),_0x42be6f);if(_0x552711[_0xc12c('0x2f')][_0xc12c('0x3c')]){_0x491cf6['where']=_[_0xc12c('0x3d')](_0x491cf6[_0xc12c('0x3b')],{'$or':_[_0xc12c('0x2a')](_0x42be6f,function(_0x530a0a){if(_0x530a0a[_0xc12c('0x3e')]!=='VIRTUAL'){var _0x2cb7bd={};_0x2cb7bd[_0x530a0a[_0xc12c('0x26')]]={'$like':'%'+_0x552711[_0xc12c('0x2f')]['filter']+'%'};return _0x2cb7bd;}})});}_0x491cf6=_[_0xc12c('0x3d')]({},_0x491cf6,_0x552711[_0xc12c('0x3f')]);var _0x164add={'where':_0x491cf6[_0xc12c('0x3b')]};return db[_0xc12c('0x2b')][_0xc12c('0x1e')](_0x164add)['then'](function(_0x3adbfc){_0x2cfe41[_0xc12c('0x1e')]=_0x3adbfc;if(_0x552711[_0xc12c('0x2f')][_0xc12c('0x40')]){_0x491cf6[_0xc12c('0x41')]=[{'all':!![]}];}return db[_0xc12c('0x2b')]['findAll'](_0x491cf6);})[_0xc12c('0x10')](function(_0x50068b){_0x2cfe41[_0xc12c('0x42')]=_0x50068b;return _0x2cfe41;})[_0xc12c('0x10')](respondWithFilteredResult(_0x4ec490,_0x491cf6))[_0xc12c('0x17')](handleError(_0x4ec490,null));};exports[_0xc12c('0x43')]=function(_0x43a277,_0x515f60){var _0x1e4430={'raw':![],'where':{'id':_0x43a277[_0xc12c('0x44')]['id']},'include':[{'model':db[_0xc12c('0x28')],'as':'mandatoryDispositionPause'}]},_0x2af517={};_0x2af517[_0xc12c('0x33')]=_[_0xc12c('0x30')](db[_0xc12c('0x2b')][_0xc12c('0x2c')]);_0x2af517[_0xc12c('0x2f')]=_[_0xc12c('0x30')](_0x43a277[_0xc12c('0x2f')]);_0x2af517[_0xc12c('0x31')]=_['intersection'](_0x2af517[_0xc12c('0x33')],_0x2af517[_0xc12c('0x2f')]);_0x1e4430['attributes']=_[_0xc12c('0x32')](_0x2af517[_0xc12c('0x33')],qs[_0xc12c('0x34')](_0x43a277[_0xc12c('0x2f')][_0xc12c('0x34')]));_0x1e4430[_0xc12c('0x35')]=_0x1e4430[_0xc12c('0x35')][_0xc12c('0x36')]?_0x1e4430[_0xc12c('0x35')]:_0x2af517['model'];if(_0x43a277[_0xc12c('0x2f')][_0xc12c('0x40')]){_0x1e4430[_0xc12c('0x41')]=[{'all':!![]}];}_0x1e4430=_[_0xc12c('0x3d')]({},_0x1e4430,_0x43a277[_0xc12c('0x3f')]);return db[_0xc12c('0x2b')]['find'](_0x1e4430)[_0xc12c('0x10')](handleEntityNotFound(_0x515f60,null))[_0xc12c('0x10')](respondWithResult(_0x515f60,null))[_0xc12c('0x17')](handleError(_0x515f60,null));};exports[_0xc12c('0x45')]=function(_0x23bf9c,_0x9cc6dc){return db[_0xc12c('0x2b')][_0xc12c('0x45')](_0x23bf9c[_0xc12c('0x46')],{})[_0xc12c('0x10')](function(_0x2ab80c){var _0x1d0bfa=_0x23bf9c[_0xc12c('0x47')][_0xc12c('0x23')]({'plain':!![]});if(!_0x1d0bfa)throw new Error(_0xc12c('0x48'));if(_0x1d0bfa['role']==='user'){var _0x517b61=_0x2ab80c[_0xc12c('0x23')]({'plain':!![]});var _0x17c5f4='ChatWebsites';return db[_0xc12c('0x49')][_0xc12c('0x4a')]({'where':{'name':_0x17c5f4,'userProfileId':_0x1d0bfa['userProfileId']},'raw':!![]})[_0xc12c('0x10')](function(_0x3c0c70){if(_0x3c0c70&&_0x3c0c70[_0xc12c('0x4b')]===0x0){return db['UserProfileResource'][_0xc12c('0x45')]({'name':_0x517b61[_0xc12c('0x26')],'resourceId':_0x517b61['id'],'type':_0x3c0c70['name'],'sectionId':_0x3c0c70['id']},{})[_0xc12c('0x10')](function(){return _0x2ab80c;});}else{return _0x2ab80c;}})[_0xc12c('0x17')](function(_0x4ff65e){logger[_0xc12c('0x14')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ff65e);throw _0x4ff65e;});}return _0x2ab80c;})[_0xc12c('0x10')](respondWithResult(_0x9cc6dc,0xc9))[_0xc12c('0x17')](handleError(_0x9cc6dc,null));};exports[_0xc12c('0x21')]=function(_0x52a300,_0x3f7e42){if(_0x52a300[_0xc12c('0x46')]['id']){delete _0x52a300[_0xc12c('0x46')]['id'];}return db[_0xc12c('0x2b')][_0xc12c('0x4a')]({'where':{'id':_0x52a300[_0xc12c('0x44')]['id']},'include':[{'model':db[_0xc12c('0x28')],'as':'mandatoryDispositionPause'}]})[_0xc12c('0x10')](handleEntityNotFound(_0x3f7e42,null))[_0xc12c('0x10')](saveUpdates(_0x52a300['body'],null))[_0xc12c('0x10')](respondWithResult(_0x3f7e42,null))[_0xc12c('0x17')](handleError(_0x3f7e42,null));};exports[_0xc12c('0x22')]=function(_0x50daf5,_0x4cf000){return db[_0xc12c('0x2b')][_0xc12c('0x4a')]({'where':{'id':_0x50daf5[_0xc12c('0x44')]['id']}})[_0xc12c('0x10')](handleEntityNotFound(_0x4cf000,null))[_0xc12c('0x10')](removeEntity(_0x4cf000,null))[_0xc12c('0x17')](handleError(_0x4cf000,null));};exports[_0xc12c('0x4c')]=function(_0x1667a9,_0x42dc72){return db[_0xc12c('0x2b')][_0xc12c('0x4c')]()[_0xc12c('0x10')](respondWithResult(_0x42dc72,null))[_0xc12c('0x17')](handleError(_0x42dc72,null));};exports['addDisposition']=function(_0x5f1beb,_0x13c642){if(_0x5f1beb['body']['id']){delete _0x5f1beb[_0xc12c('0x46')]['id'];}return db['ChatWebsite'][_0xc12c('0x4a')]({'where':{'id':_0x5f1beb['params']['id']}})[_0xc12c('0x10')](handleEntityNotFound(_0x13c642,null))['then'](function(_0x41c520){if(_0x41c520){_0x5f1beb[_0xc12c('0x46')]['ChatWebsiteId']=_0x41c520['id'];return db[_0xc12c('0x4d')]['create'](_0x5f1beb['body']);}})[_0xc12c('0x10')](respondWithResult(_0x13c642,null))[_0xc12c('0x17')](handleError(_0x13c642,null));};exports[_0xc12c('0x4e')]=function(_0x16f367,_0x25aae4){var _0x2af18e={'raw':![],'where':{}};var _0x572c71={};var _0x2d4b74={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc12c('0x4f')]({'where':{'id':_0x16f367['params']['id']}})[_0xc12c('0x10')](handleEntityNotFound(_0x25aae4,null))[_0xc12c('0x10')](function(_0x29f630){if(_0x29f630){_0x572c71[_0xc12c('0x33')]=_[_0xc12c('0x30')](db['Disposition'][_0xc12c('0x2c')]);_0x572c71['query']=_['keys'](_0x16f367['query']);_0x572c71[_0xc12c('0x31')]=_[_0xc12c('0x32')](_0x572c71[_0xc12c('0x33')],_0x572c71['query']);_0x2af18e[_0xc12c('0x35')]=_['intersection'](_0x572c71['model'],qs[_0xc12c('0x34')](_0x16f367['query'][_0xc12c('0x34')]));_0x2af18e[_0xc12c('0x35')]=_0x2af18e[_0xc12c('0x35')][_0xc12c('0x36')]?_0x2af18e['attributes']:_0x572c71['model'];if(!_0x16f367[_0xc12c('0x2f')][_0xc12c('0x50')](_0xc12c('0x37'))){_0x2af18e[_0xc12c('0x38')]=qs['limit'](_0x16f367[_0xc12c('0x2f')]['limit']);_0x2af18e[_0xc12c('0x1c')]=qs[_0xc12c('0x1c')](_0x16f367['query']['offset']);}_0x2af18e[_0xc12c('0x39')]=qs[_0xc12c('0x3a')](_0x16f367['query'][_0xc12c('0x3a')]);_0x2af18e['where']=qs['filters'](_[_0xc12c('0x51')](_0x16f367[_0xc12c('0x2f')],_0x572c71['filters']));_0x2af18e[_0xc12c('0x3b')][_0xc12c('0x52')]=_0x29f630['id'];if(_0x16f367[_0xc12c('0x2f')][_0xc12c('0x3c')]){_0x2af18e['where']=_[_0xc12c('0x3d')](_0x2af18e['where'],{'$or':_[_0xc12c('0x2a')](_0x2af18e['attributes'],function(_0xdca7b3){var _0x58e149={};_0x58e149[_0xdca7b3]={'$like':'%'+_0x16f367[_0xc12c('0x2f')][_0xc12c('0x3c')]+'%'};return _0x58e149;})});}_0x2af18e=_[_0xc12c('0x3d')]({},_0x2af18e,_0x16f367['options']);return db[_0xc12c('0x4d')][_0xc12c('0x1e')]({'where':_0x2af18e['where']})[_0xc12c('0x10')](function(_0xf81594){_0x2d4b74[_0xc12c('0x1e')]=_0xf81594;if(_0x16f367[_0xc12c('0x2f')]['includeAll']){_0x2af18e[_0xc12c('0x41')]=[{'all':!![]}];}return db[_0xc12c('0x4d')]['findAll'](_0x2af18e);})['then'](function(_0x154f20){_0x2d4b74[_0xc12c('0x42')]=_0x154f20;return _0x2d4b74;});}})['then'](respondWithFilteredResult(_0x25aae4,_0x2af18e))[_0xc12c('0x17')](handleError(_0x25aae4,null));};exports[_0xc12c('0x53')]=function(_0xe18233,_0xc00e0f){return db[_0xc12c('0x2b')][_0xc12c('0x4a')]({'where':{'id':_0xe18233[_0xc12c('0x44')]['id']}})[_0xc12c('0x10')](handleEntityNotFound(_0xc00e0f,null))[_0xc12c('0x10')](function(_0x4d935c){if(_0x4d935c){return _0x4d935c['removeDispositions'](_0xe18233['query'][_0xc12c('0x54')]);}})[_0xc12c('0x10')](respondWithStatusCode(_0xc00e0f,null))[_0xc12c('0x17')](handleError(_0xc00e0f,null));};exports['addAnswer']=function(_0x42edec,_0xf703ab){if(_0x42edec['body']['id']){delete _0x42edec[_0xc12c('0x46')]['id'];}return db[_0xc12c('0x2b')]['find']({'where':{'id':_0x42edec['params']['id']}})[_0xc12c('0x10')](handleEntityNotFound(_0xf703ab,null))[_0xc12c('0x10')](function(_0x2ee298){if(_0x2ee298){_0x42edec[_0xc12c('0x46')][_0xc12c('0x52')]=_0x2ee298['id'];return db['CannedAnswer']['create'](_0x42edec['body']);}})[_0xc12c('0x10')](respondWithResult(_0xf703ab,null))[_0xc12c('0x17')](handleError(_0xf703ab,null));};exports[_0xc12c('0x55')]=function(_0x1939b6,_0x548fc2){var _0x2f0ef3={'raw':![],'where':{}};var _0x19df73={};var _0x1a418b={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc12c('0x4f')]({'where':{'id':_0x1939b6['params']['id']}})[_0xc12c('0x10')](handleEntityNotFound(_0x548fc2,null))[_0xc12c('0x10')](function(_0x5c314e){if(_0x5c314e){_0x19df73[_0xc12c('0x33')]=_[_0xc12c('0x30')](db['CannedAnswer'][_0xc12c('0x2c')]);_0x19df73[_0xc12c('0x2f')]=_[_0xc12c('0x30')](_0x1939b6['query']);_0x19df73[_0xc12c('0x31')]=_['intersection'](_0x19df73[_0xc12c('0x33')],_0x19df73[_0xc12c('0x2f')]);_0x2f0ef3['attributes']=_['intersection'](_0x19df73['model'],qs['fields'](_0x1939b6[_0xc12c('0x2f')][_0xc12c('0x34')]));_0x2f0ef3[_0xc12c('0x35')]=_0x2f0ef3['attributes'][_0xc12c('0x36')]?_0x2f0ef3[_0xc12c('0x35')]:_0x19df73['model'];if(!_0x1939b6[_0xc12c('0x2f')][_0xc12c('0x50')](_0xc12c('0x37'))){_0x2f0ef3[_0xc12c('0x38')]=qs[_0xc12c('0x38')](_0x1939b6['query'][_0xc12c('0x38')]);_0x2f0ef3[_0xc12c('0x1c')]=qs[_0xc12c('0x1c')](_0x1939b6['query'][_0xc12c('0x1c')]);}_0x2f0ef3[_0xc12c('0x39')]=qs[_0xc12c('0x3a')](_0x1939b6[_0xc12c('0x2f')]['sort']);_0x2f0ef3['where']=qs[_0xc12c('0x31')](_[_0xc12c('0x51')](_0x1939b6[_0xc12c('0x2f')],_0x19df73['filters']));_0x2f0ef3['where'][_0xc12c('0x52')]=_0x5c314e['id'];if(_0x1939b6[_0xc12c('0x2f')]['filter']){_0x2f0ef3[_0xc12c('0x3b')]=_[_0xc12c('0x3d')](_0x2f0ef3['where'],{'$or':_[_0xc12c('0x2a')](_0x2f0ef3['attributes'],function(_0x3618f7){var _0x6551a1={};_0x6551a1[_0x3618f7]={'$like':'%'+_0x1939b6[_0xc12c('0x2f')][_0xc12c('0x3c')]+'%'};return _0x6551a1;})});}_0x2f0ef3=_[_0xc12c('0x3d')]({},_0x2f0ef3,_0x1939b6[_0xc12c('0x3f')]);return db[_0xc12c('0x56')][_0xc12c('0x1e')]({'where':_0x2f0ef3[_0xc12c('0x3b')]})['then'](function(_0x26e180){_0x1a418b[_0xc12c('0x1e')]=_0x26e180;if(_0x1939b6[_0xc12c('0x2f')][_0xc12c('0x40')]){_0x2f0ef3[_0xc12c('0x41')]=[{'all':!![]}];}return db[_0xc12c('0x56')]['findAll'](_0x2f0ef3);})['then'](function(_0x448e87){_0x1a418b[_0xc12c('0x42')]=_0x448e87;return _0x1a418b;});}})['then'](respondWithFilteredResult(_0x548fc2,_0x2f0ef3))['catch'](handleError(_0x548fc2,null));};exports[_0xc12c('0x57')]=function(_0x817af6,_0x1fe8dc){return db[_0xc12c('0x2b')][_0xc12c('0x4a')]({'where':{'id':_0x817af6[_0xc12c('0x44')]['id']}})[_0xc12c('0x10')](handleEntityNotFound(_0x1fe8dc,null))['then'](function(_0x57f464){if(_0x57f464){return _0x57f464['removeAnswers'](_0x817af6[_0xc12c('0x2f')][_0xc12c('0x54')]);}})[_0xc12c('0x10')](respondWithStatusCode(_0x1fe8dc,null))[_0xc12c('0x17')](handleError(_0x1fe8dc,null));};exports[_0xc12c('0x58')]=function(_0x514035,_0x5f2d5d){_0x514035[_0xc12c('0x46')][_0xc12c('0x59')]=_0x514035[_0xc12c('0x5a')][_0xc12c('0x5b')];return db[_0xc12c('0x2b')]['find']({'where':{'id':_0x514035[_0xc12c('0x44')]['id']}})['then'](handleEntityNotFound(_0x5f2d5d,null))['then'](saveUpdates(_0x514035[_0xc12c('0x46')],null))['then'](respondWithResult(_0x5f2d5d,null))[_0xc12c('0x17')](handleError(_0x5f2d5d,null));};exports[_0xc12c('0x5c')]=function(_0x4c2fc1,_0x2ae25f){_0x4c2fc1[_0xc12c('0x46')]['agentAvatar']=_0x4c2fc1['file'][_0xc12c('0x5b')];return db[_0xc12c('0x2b')][_0xc12c('0x4a')]({'where':{'id':_0x4c2fc1[_0xc12c('0x44')]['id']}})[_0xc12c('0x10')](handleEntityNotFound(_0x2ae25f,null))[_0xc12c('0x10')](saveUpdates(_0x4c2fc1['body'],null))[_0xc12c('0x10')](respondWithResult(_0x2ae25f,null))[_0xc12c('0x17')](handleError(_0x2ae25f,null));};exports[_0xc12c('0x5d')]=function(_0x22b7d2,_0x4481e7){_0x22b7d2[_0xc12c('0x46')][_0xc12c('0x5e')]=_0x22b7d2[_0xc12c('0x5a')][_0xc12c('0x5b')];return db['ChatWebsite'][_0xc12c('0x4a')]({'where':{'id':_0x22b7d2[_0xc12c('0x44')]['id']}})[_0xc12c('0x10')](handleEntityNotFound(_0x4481e7,null))[_0xc12c('0x10')](saveUpdates(_0x22b7d2[_0xc12c('0x46')],null))[_0xc12c('0x10')](respondWithResult(_0x4481e7,null))[_0xc12c('0x17')](handleError(_0x4481e7,null));};exports[_0xc12c('0x5f')]=function(_0x265209,_0x46a137){_0x265209[_0xc12c('0x46')][_0xc12c('0x60')]=_0x265209[_0xc12c('0x5a')][_0xc12c('0x5b')];return db[_0xc12c('0x2b')][_0xc12c('0x4a')]({'where':{'id':_0x265209[_0xc12c('0x44')]['id']}})[_0xc12c('0x10')](handleEntityNotFound(_0x46a137,null))['then'](saveUpdates(_0x265209['body'],null))[_0xc12c('0x10')](respondWithResult(_0x46a137,null))[_0xc12c('0x17')](handleError(_0x46a137,null));};exports['getLogo']=function(_0xedb756,_0x300599){var _0x4a2514=path['join'](config['root'],'server/files/images/logos/default_logo.svg');var _0x255d36={'where':{'id':_0xedb756[_0xc12c('0x44')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0xfdd7a7=![];return require(_0xc12c('0x61'))[_0xc12c('0x62')]()['then'](function(_0x2a40a8){if(_0x2a40a8){_0xfdd7a7=_0x2a40a8['custom'];}})['then'](function(){return db['ChatWebsite'][_0xc12c('0x4a')](_0x255d36);})[_0xc12c('0x10')](handleEntityNotFound(_0x300599,null))[_0xc12c('0x10')](function(_0x5ec231){if(_0x5ec231){if(!_['isNil'](_0x5ec231[_0xc12c('0x59')])){if(fs['existsSync'](path[_0xc12c('0x63')](config['root'],_0xc12c('0x64'),_0x5ec231[_0xc12c('0x59')]))&&_0xfdd7a7){_0x4a2514=path['join'](config[_0xc12c('0x65')],_0xc12c('0x64'),_0x5ec231[_0xc12c('0x59')]);}}return _0x300599[_0xc12c('0x66')](_0x4a2514);}})['catch'](handleError(_0x300599,null));};exports['getAvatar']=function(_0x2857c8,_0x1ae54c){var _0x25d7d7=path[_0xc12c('0x63')](config[_0xc12c('0x65')],'server/files/images/avatars/default_avatar.png');var _0x3a886b={'where':{'id':_0x2857c8['params']['id']},'attributes':['id',_0xc12c('0x67')],'raw':!![]};return db['ChatWebsite'][_0xc12c('0x4a')](_0x3a886b)[_0xc12c('0x10')](handleEntityNotFound(_0x1ae54c,null))[_0xc12c('0x10')](function(_0x338ed0){if(_0x338ed0){if(!_[_0xc12c('0x68')](_0x338ed0['agentAvatar'])){if(fs[_0xc12c('0x69')](path[_0xc12c('0x63')](config['root'],'server/files/images/avatars/',_0x338ed0[_0xc12c('0x67')]))){_0x25d7d7=path[_0xc12c('0x63')](config[_0xc12c('0x65')],_0xc12c('0x6a'),_0x338ed0[_0xc12c('0x67')]);}}return _0x1ae54c[_0xc12c('0x66')](_0x25d7d7);}})[_0xc12c('0x17')](handleError(_0x1ae54c,null));};exports[_0xc12c('0x6b')]=function(_0x25de8d,_0x21a4ed){var _0x3f3951=path[_0xc12c('0x63')](config[_0xc12c('0x65')],_0xc12c('0x6c'));var _0x329f00={'where':{'id':_0x25de8d[_0xc12c('0x44')]['id']},'attributes':['id',_0xc12c('0x5e'),_0xc12c('0x6d')],'raw':!![]};return db[_0xc12c('0x2b')]['find'](_0x329f00)[_0xc12c('0x10')](handleEntityNotFound(_0x21a4ed,null))[_0xc12c('0x10')](function(_0x41233e){if(_0x41233e){if(!_[_0xc12c('0x68')](_0x41233e[_0xc12c('0x5e')])){if(fs['existsSync'](path[_0xc12c('0x63')](config[_0xc12c('0x65')],_0xc12c('0x6a'),_0x41233e[_0xc12c('0x5e')]))&&_0x41233e['showCustomerAvatar']){_0x3f3951=path['join'](config[_0xc12c('0x65')],_0xc12c('0x6a'),_0x41233e['customerAvatar']);}}return _0x21a4ed[_0xc12c('0x66')](_0x3f3951);}})[_0xc12c('0x17')](handleError(_0x21a4ed,null));};exports[_0xc12c('0x6e')]=function(_0x5d04e1,_0x3314f2){var _0x2847e6=path['join'](config['root'],'server/files/images/avatars/system_avatar.png');var _0x9e3d77={'where':{'id':_0x5d04e1[_0xc12c('0x44')]['id']},'attributes':['id',_0xc12c('0x60')],'raw':!![]};return db[_0xc12c('0x2b')][_0xc12c('0x4a')](_0x9e3d77)['then'](handleEntityNotFound(_0x3314f2,null))[_0xc12c('0x10')](function(_0xb74c29){if(_0xb74c29){if(!_[_0xc12c('0x68')](_0xb74c29[_0xc12c('0x60')])){if(fs[_0xc12c('0x69')](path[_0xc12c('0x63')](config['root'],_0xc12c('0x6a'),_0xb74c29[_0xc12c('0x60')]))){_0x2847e6=path[_0xc12c('0x63')](config[_0xc12c('0x65')],_0xc12c('0x6a'),_0xb74c29['systemAvatar']);}}return _0x3314f2[_0xc12c('0x66')](_0x2847e6);}})[_0xc12c('0x17')](handleError(_0x3314f2,null));};exports[_0xc12c('0x6f')]=function(_0x45976e,_0x1fbaba){var _0x5dfd43=require('user-agent-parser');var _0x54e153=new _0x5dfd43();var _0x3ba022=_0x54e153[_0xc12c('0x70')](_0x45976e[_0xc12c('0x71')]['user-agent'])[_0xc12c('0x72')]();var _0x284c20={'body':_0x45976e[_0xc12c('0x46')],'channel':_0xc12c('0x73')};var _0x55a3cd=[];var _0x4c19d2=[];var _0x325e4d={};var _0x3f9ba7=![];return db[_0xc12c('0x74')][_0xc12c('0x4c')]()[_0xc12c('0x10')](function(_0x1cd0ba){if(!_0x1cd0ba){throw new db[(_0xc12c('0x75'))]['ValidationError'](_0xc12c('0x76'));}_0x55a3cd=_[_0xc12c('0x77')](_[_0xc12c('0x30')](_0x1cd0ba),[_0xc12c('0x78'),'updatedAt']);_0x4c19d2=_['difference'](_[_0xc12c('0x30')](_0x1cd0ba),[_0xc12c('0x78'),'updatedAt',_0xc12c('0x79'),'ListId']);if(_0x45976e[_0xc12c('0x46')]['id']){delete _0x45976e['body']['id'];}if(_[_0xc12c('0x68')](_0x45976e[_0xc12c('0x46')]['from'])){throw new db[(_0xc12c('0x75'))][(_0xc12c('0x7a'))](_0xc12c('0x7b'));}if(_['isNil'](_0x45976e['body']['body'])||_0x45976e[_0xc12c('0x46')][_0xc12c('0x46')]===''){throw new db[(_0xc12c('0x75'))][(_0xc12c('0x7a'))](_0xc12c('0x7c'));}if(_[_0xc12c('0x68')](_0x45976e['body'][_0xc12c('0x7d')])){throw new db[(_0xc12c('0x75'))]['ValidationError'](_0xc12c('0x7e')+_0x4c19d2);}if(!_[_0xc12c('0x7f')](_0x4c19d2,_0x45976e[_0xc12c('0x46')][_0xc12c('0x7d')])){throw new db['Sequelize'][(_0xc12c('0x7a'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4c19d2);}_0x325e4d[_0x45976e[_0xc12c('0x46')][_0xc12c('0x7d')]]=_0x45976e['body'][_0xc12c('0x80')];})['then'](function(){return db['ChatWebsite']['find']({'where':{'id':_0x45976e[_0xc12c('0x44')]['id']},'include':[{'model':db[_0xc12c('0x81')],'as':_0xc12c('0x82'),'include':[{'model':db[_0xc12c('0x74')],'as':_0xc12c('0x83'),'where':_0x325e4d,'limit':0x1,'order':[['updatedAt',_0xc12c('0x84')]]}]},{'model':db[_0xc12c('0x85')],'as':_0xc12c('0x86')}]});})['then'](handleEntityNotFound(_0x1fbaba,null))[_0xc12c('0x10')](function(_0x4a2586){if(_0x4a2586&&_0x4a2586[_0xc12c('0x82')]){_0x284c20[_0xc12c('0x87')]=_0x4a2586;_0x284c20[_0xc12c('0x88')]=_0x4a2586[_0xc12c('0x86')];_0x284c20['list']=_0x4a2586[_0xc12c('0x82')];_0x284c20[_0xc12c('0x88')]=_[_0xc12c('0x89')](_0x284c20[_0xc12c('0x88')],[_0xc12c('0x8a')],[_0xc12c('0x8b')]);if(_0x284c20[_0xc12c('0x87')][_0xc12c('0x86')]){delete _0x284c20[_0xc12c('0x87')][_0xc12c('0x86')];}if(_0x284c20[_0xc12c('0x87')]['List']&&_0x284c20['account']['List'][_0xc12c('0x83')]['length']){return _0x284c20[_0xc12c('0x87')][_0xc12c('0x82')][_0xc12c('0x83')][0x0];}var _0x304b24=_[_0xc12c('0x9')](_0x45976e['body'],{'firstName':_0x45976e[_0xc12c('0x46')][_0xc12c('0x80')],'ListId':_0x4a2586[_0xc12c('0x8c')]});_0x304b24[_0x45976e[_0xc12c('0x46')]['mapKey']]=_0x45976e['body'][_0xc12c('0x80')];return db[_0xc12c('0x74')]['create'](_0x304b24,{'fields':_0x55a3cd,'raw':!![]});}})[_0xc12c('0x10')](handleEntityNotFound(_0x1fbaba,null))['then'](function(_0x372cad){_0x284c20[_0xc12c('0x8d')]=_0x372cad;var _0x141706=_0x45976e[_0xc12c('0x46')][_0xc12c('0x8e')];if(_0x45976e[_0xc12c('0x71')][_0xc12c('0x8f')]){_0x141706=_0x45976e['headers'][_0xc12c('0x8f')];}else if(_0x45976e[_0xc12c('0x71')]['x-forwarded-for']){_0x141706=_[_0xc12c('0x90')](_0x45976e[_0xc12c('0x71')][_0xc12c('0x91')][_0xc12c('0x92')](','));}if(_0x372cad){var _0x1a0c88={'ContactId':_0x372cad['id'],'ChatWebsiteId':_0x45976e[_0xc12c('0x44')]['id'],'from':(_0x372cad['firstName']||'')+'\x20'+(_0x372cad[_0xc12c('0x93')]||''),'customerIp':_0x141706,'customerPort':_0x45976e[_0xc12c('0x71')][_0xc12c('0x94')]?_0x45976e[_0xc12c('0x71')][_0xc12c('0x94')]:null,'referer':_0x45976e['body'][_0xc12c('0x95')],'browserName':_0x3ba022[_0xc12c('0x96')][_0xc12c('0x26')]&&_0x3ba022['browser']['version']?util['format'](_0xc12c('0x97'),_0x3ba022[_0xc12c('0x96')]['name'],_0x3ba022[_0xc12c('0x96')][_0xc12c('0x98')]):_0xc12c('0x99'),'browserVersion':_0x3ba022[_0xc12c('0x96')][_0xc12c('0x98')]||_0xc12c('0x99'),'osName':util[_0xc12c('0x9a')](_0xc12c('0x97'),_0x3ba022['os'][_0xc12c('0x26')],_0x3ba022['os'][_0xc12c('0x98')]),'osVersion':_0x3ba022['os'][_0xc12c('0x98')],'deviceModel':_0x3ba022['device'][_0xc12c('0x33')]&&_0x3ba022['device']['vendor']?util[_0xc12c('0x9a')]('%s\x20%s\x20%s',_0x3ba022[_0xc12c('0x9b')]['model'],_0x3ba022[_0xc12c('0x9b')][_0xc12c('0x9c')],_0x3ba022[_0xc12c('0x9b')][_0xc12c('0x3e')]):null,'deviceVendor':_0x3ba022['device'][_0xc12c('0x9c')],'deviceType':_0x3ba022[_0xc12c('0x9b')][_0xc12c('0x3e')],'formData':JSON[_0xc12c('0x9d')](_0x45976e[_0xc12c('0x46')])};var _0x5a26cd={'ChatWebsiteId':_0x45976e[_0xc12c('0x44')]['id'],'closed':![]};if(_0x45976e['body']['threadId']){_0x5a26cd['threadId']=_0x45976e[_0xc12c('0x46')]['threadId'];return db[_0xc12c('0x9e')][_0xc12c('0x4a')]({'where':_0x5a26cd})['then'](function(_0x2d4f2b){if(_0x2d4f2b){return[_0x2d4f2b,![]];}_0x1a0c88[_0xc12c('0x9f')]=_0x45976e[_0xc12c('0x46')][_0xc12c('0x9f')];_0x1a0c88['externalUrl']=_0x45976e['body'][_0xc12c('0xa0')];return db['ChatInteraction']['create'](_0x1a0c88)[_0xc12c('0x10')](function(_0x32f9f5){return[_0x32f9f5,!![]];});});}_0x5a26cd['ContactId']=_0x372cad['id'];if(_0x45976e[_0xc12c('0x46')]['interaction']&&_0x45976e[_0xc12c('0x46')][_0xc12c('0xa1')]['id']){_0x5a26cd['id']=_0x45976e[_0xc12c('0x46')][_0xc12c('0xa1')]['id'];return db[_0xc12c('0x9e')][_0xc12c('0x4a')]({'where':_0x5a26cd})[_0xc12c('0x10')](function(_0x4ae676){if(_0x4ae676){return[_0x4ae676,![]];}return db[_0xc12c('0x9e')][_0xc12c('0x45')](_0x1a0c88)[_0xc12c('0x10')](function(_0x1cf182){return[_0x1cf182,!![]];});});}return db[_0xc12c('0x9e')][_0xc12c('0x45')](_0x1a0c88)[_0xc12c('0x10')](function(_0x193bf1){return[_0x193bf1,!![]];});}})[_0xc12c('0xa2')](function(_0x796bec,_0x1e64d7){if(_0x796bec){_0x3f9ba7=_0x1e64d7;if(!_0x1e64d7){var _0x61c1e1={'from':(_0x284c20[_0xc12c('0x8d')][_0xc12c('0xa3')]||'')+'\x20'+(_0x284c20['contact'][_0xc12c('0x93')]||'')};if(_0x45976e[_0xc12c('0x46')][_0xc12c('0x9f')]&&_0x45976e[_0xc12c('0x46')]['messageId']&&_0x45976e['body'][_0xc12c('0x9f')]!=_0x45976e[_0xc12c('0x46')]['messageId']){_0x61c1e1[_0xc12c('0x9f')]=_0x45976e['body']['messageId'];}return _0x796bec[_0xc12c('0x21')](_0x61c1e1);}else{return _0x796bec;}}})['then'](function(_0x24a6b2){_0x284c20['interaction']=_0x24a6b2[_0xc12c('0x23')]({'plain':!![]});_0x284c20[_0xc12c('0xa1')]['created']=_0x3f9ba7;if(_0x284c20[_0xc12c('0xa1')][_0xc12c('0xa4')]){if(_0x284c20[_0xc12c('0x87')][_0xc12c('0xa5')]){_0x284c20['applications']['push']({'id':0x0,'priority':_0x284c20[_0xc12c('0x88')]['length']+0x1,'app':_0xc12c('0xa6'),'appdata':_0xc12c('0xa7'),'interval':'*,*,*,*'});}}return db[_0xc12c('0xa8')][_0xc12c('0x45')]({'body':_0x45976e[_0xc12c('0x46')][_0xc12c('0x46')],'ChatWebsiteId':_0x45976e['params']['id'],'ChatInteractionId':_0x24a6b2['id'],'direction':'in','ContactId':_0x284c20[_0xc12c('0x8d')]['id'],'AttachmentId':_0x45976e[_0xc12c('0x46')]['AttachmentId']});})[_0xc12c('0x10')](function(_0x473ecf){_0x284c20[_0xc12c('0x15')]=_0x473ecf;if(_0x284c20['interaction'][_0xc12c('0xa9')]){return db[_0xc12c('0xaa')][_0xc12c('0x4a')]({'attributes':['id','name'],'where':{'id':_0x284c20['interaction']['UserId']}})[_0xc12c('0x10')](function(_0x51ff6a){if(_0x51ff6a){_0x284c20[_0xc12c('0x88')][_0xc12c('0xab')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x51ff6a[_0xc12c('0x26')]+','+(_0x284c20['account'][_0xc12c('0xac')]||0xa),'interval':_0xc12c('0xad')});_0x284c20[_0xc12c('0xae')]=!![];}return respondWithRpcPromise(_0xc12c('0xaf'),_0xc12c('0xb0'),_0x284c20);});}return respondWithRpcPromise('Start','startRouting',_0x284c20);})[_0xc12c('0x10')](function(_0xea83e7){respondWithRpcPromise('EventManager','EventManager',{'event':_0xc12c('0x6f'),'message':_0xea83e7},client9002);return _0xea83e7;})[_0xc12c('0x10')](respondWithResult(_0x1fbaba,null))[_0xc12c('0x17')](handleError(_0x1fbaba,null));};exports['offline']=function(_0x3a11aa,_0xecde15){var _0x269e6e,_0x4ac794,_0x492584;var _0x3fae34=[];var _0x5647d6={};var _0x571bd4=_0x3a11aa[_0xc12c('0xb1')]||[];var _0x1037d9=[];var _0x47bab9;return db['CmContact'][_0xc12c('0x4c')]()[_0xc12c('0x10')](function(_0x404203){if(!_0x404203){throw new db[(_0xc12c('0x75'))][(_0xc12c('0x7a'))]('no\x20available\x20attributes');}_0x3fae34=_[_0xc12c('0x77')](_[_0xc12c('0x30')](_0x404203),[_0xc12c('0x78'),_0xc12c('0xb2'),_0xc12c('0x79'),'ListId']);if(_0x3a11aa[_0xc12c('0x46')]['id']){delete _0x3a11aa['body']['id'];}if(_[_0xc12c('0x68')](_0x3a11aa[_0xc12c('0x46')][_0xc12c('0x80')])){throw _0xecde15[_0xc12c('0x19')](0x1f4)['send'](new db[(_0xc12c('0x75'))][(_0xc12c('0x7a'))](_0xc12c('0x7b')));}if(_['isNil'](_0x3a11aa[_0xc12c('0x46')][_0xc12c('0x46')])||_0x3a11aa[_0xc12c('0x46')][_0xc12c('0x46')]===''){throw _0xecde15['status'](0x1f4)[_0xc12c('0xb3')](new db[(_0xc12c('0x75'))][(_0xc12c('0x7a'))](_0xc12c('0x7c')));}if(_['isNil'](_0x3a11aa[_0xc12c('0x46')][_0xc12c('0xb4')])){throw _0xecde15[_0xc12c('0x19')](0x1f4)[_0xc12c('0xb3')](new db['Sequelize'][(_0xc12c('0x7a'))](_0xc12c('0xb5')+_0x3fae34));}if(!_[_0xc12c('0x7f')](_0x3fae34,_0x3a11aa[_0xc12c('0x46')]['mapKeyOffline'])){throw _0xecde15['status'](0x1f4)[_0xc12c('0xb3')](new db[(_0xc12c('0x75'))][(_0xc12c('0x7a'))](_0xc12c('0xb6')+_0x3fae34));}_0x5647d6[_0x3a11aa[_0xc12c('0x46')][_0xc12c('0xb4')]]=_0x3a11aa[_0xc12c('0x46')][_0xc12c('0x80')];})[_0xc12c('0x10')](function(){return db[_0xc12c('0x2b')][_0xc12c('0x4a')]({'where':{'id':_0x3a11aa[_0xc12c('0x44')]['id']},'include':[{'model':db[_0xc12c('0x81')],'as':_0xc12c('0x82')},{'model':db[_0xc12c('0xb7')],'as':_0xc12c('0xb7')}]});})[_0xc12c('0x10')](handleEntityNotFound(_0xecde15,null))[_0xc12c('0x10')](function(_0x42074c){if(_0x42074c&&_0x42074c[_0xc12c('0x82')]){_0x4ac794=_0x42074c;var _0x1f50db=_[_0xc12c('0x9')](_0x3a11aa[_0xc12c('0x46')],{'firstName':_0x3a11aa['body'][_0xc12c('0x80')],'phone':_0x3a11aa['body']['from'],'ListId':_0x42074c[_0xc12c('0x8c')]});_0x1f50db[_0x3a11aa[_0xc12c('0x46')][_0xc12c('0xb4')]]=_0x3a11aa[_0xc12c('0x46')][_0xc12c('0x80')];return db[_0xc12c('0x74')][_0xc12c('0xb8')]({'where':_0x5647d6,'defaults':_0x1f50db});}})[_0xc12c('0xa2')](function(_0x5eb70d){if(_0x5eb70d){_0x492584=_0x5eb70d;var _0x25690a=fs[_0xc12c('0xb9')](path[_0xc12c('0x63')](config[_0xc12c('0x65')],_0xc12c('0xba')),'utf8');var _0x113b33=ejs[_0xc12c('0xbb')](_0x25690a,{'body':_[_0xc12c('0xbc')](_0x3a11aa[_0xc12c('0x46')][_0xc12c('0x46')]),'bodyTitle':_0x4ac794[_0xc12c('0xbd')]});return db[_0xc12c('0xbe')][_0xc12c('0x45')]({'body':_0x113b33,'plainBody':htmlToText['fromString'](_0x113b33),'ContactId':_0x5eb70d['id'],'ChatWebsiteId':_0x4ac794['id']});}})[_0xc12c('0x10')](function(_0x92c40b){_0x47bab9=_0x92c40b;if(_0x571bd4['length']){var _0x14faa0=_0x571bd4[_0xc12c('0x2a')](function(_0x20eee0){return{'name':_0x20eee0[_0xc12c('0xbf')],'basename':_0x20eee0[_0xc12c('0x5b')],'type':_0x20eee0[_0xc12c('0xc0')],'ChatOfflineMessageId':_0x92c40b['id']};});_0x1037d9=_0x14faa0['map'](_0x583e15=>{var _0x20205f={'filename':_0x583e15['name'],'path':path[_0xc12c('0x63')](config[_0xc12c('0x65')],_0xc12c('0xc1'),_0xc12c('0xb1'),_0xc12c('0xc2'),'offline-chat',_0x583e15[_0xc12c('0xc3')])};return _0x20205f;});if(!_0x4ac794[_0xc12c('0xc4')]){return db[_0xc12c('0xc5')][_0xc12c('0xc6')](function(_0x11318c){return db['Attachment'][_0xc12c('0xc7')](_0x14faa0,{'transaction':_0x11318c});});}}})[_0xc12c('0x10')](function(){if(_0x47bab9){_0x269e6e=_0x47bab9;return db[_0xc12c('0xb7')][_0xc12c('0x4f')]({'where':{'active':!![]},'include':[{'model':db[_0xc12c('0xc8')],'as':_0xc12c('0xc9'),'raw':!![]}]});}})[_0xc12c('0x10')](function(_0x7c78e){if(_0x7c78e&&_0x7c78e[_0xc12c('0xc9')]&&_0x4ac794[_0xc12c('0xca')]&&_0x4ac794['forwardOfflineAddress']){var _0x3baa5e={'tls':{'rejectUnauthorized':![]}};if(_0x7c78e[_0xc12c('0xc9')][_0xc12c('0xcb')]){_0x3baa5e['service']=_0x7c78e[_0xc12c('0xc9')]['service'];}else{_0x3baa5e[_0xc12c('0xcc')]=_0x7c78e[_0xc12c('0xc9')]['host'];_0x3baa5e[_0xc12c('0xcd')]=_0x7c78e[_0xc12c('0xc9')]['port'];_0x3baa5e[_0xc12c('0xce')]=_0x7c78e[_0xc12c('0xc9')][_0xc12c('0xce')];}if(_0x7c78e[_0xc12c('0xc9')]['authentication']){_0x3baa5e[_0xc12c('0xcf')]={'user':_0x7c78e[_0xc12c('0xc9')][_0xc12c('0x47')],'pass':_0x7c78e[_0xc12c('0xc9')][_0xc12c('0xd0')]};}return respondWithRpcPromise(_0xc12c('0xd1'),_0xc12c('0xd2'),{'account':_0x3baa5e,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x7c78e['name'],_0x7c78e[_0xc12c('0xd3')]||_0x7c78e['Smtp']['user']),'to':_0x4ac794[_0xc12c('0xd4')],'subject':_0x4ac794[_0xc12c('0xd5')],'html':_0x269e6e[_0xc12c('0x46')],'attachments':_0x1037d9}},client9003)[_0xc12c('0x10')](function(){return _0x269e6e;})[_0xc12c('0x17')](function(_0x4dd743){console[_0xc12c('0x14')](_0x4dd743);});}})[_0xc12c('0x10')](function(){if(_0x4ac794&&_0x4ac794['openNewInteraction']&&_0x4ac794[_0xc12c('0xd6')]){var _0x3308d7=[];if(_0x571bd4[_0xc12c('0x36')]){_0x3308d7=_0x571bd4[_0xc12c('0x2a')](function(_0x38c9d4){return{'name':_0x38c9d4['originalname'],'basename':_0x38c9d4['filename'],'type':_0x38c9d4[_0xc12c('0xc0')],'ChatOfflineMessageId':_0x47bab9['id']};});}var _0x20ecc7;if(!_[_0xc12c('0x68')](_0x4ac794[_0xc12c('0xd7')])){var _0x281153=_[_0xc12c('0x2a')](_0x3a11aa['body'],function(_0x47e8fe){return _0x47e8fe;});var _0xa3bcce=_['toPairsIn'](_0x281153)[0x0];var _0x2f70f6=_[_0xc12c('0xd8')](_0xa3bcce,function(_0xa96fa1){return _0xa96fa1;});_0x20ecc7=_0x2f70f6[0x1][_0x4ac794[_0xc12c('0xd7')]];}var _0x443f99={'from':_0x492584[_0xc12c('0xd3')],'firstName':_0x492584['firstName'],'lastName':_0x492584[_0xc12c('0x93')],'mapKey':'email','message':{'from':_0x492584[_0xc12c('0xd3')],'to':_0x4ac794[_0xc12c('0xb7')]['email'],'cc':'','subject':_[_0xc12c('0x68')](_0x20ecc7)?_0x4ac794[_0xc12c('0xd5')]:_0x20ecc7,'messageId':'','sentAt':new Date(),'attach':_0x3308d7[_0xc12c('0x36')],'attachments':_0x3308d7,'originChannel':_0xc12c('0xd9'),'ChatWebsiteId':_0x4ac794['id'],'ChatOfflineMessageId':_0x269e6e['id'],'originTo':_0x4ac794[_0xc12c('0xb7')][_0xc12c('0xd3')]},'body':_0x269e6e[_0xc12c('0x46')]};var _0x350525={'account':{'id':_0x4ac794[_0xc12c('0xd6')]},'body':_0x443f99,'log':_0xc12c('0xda')};return respondWithRpcPromise(_0xc12c('0xda'),_0xc12c('0xdb'),_0x350525,client9001)['then'](function(){return _0x269e6e;})[_0xc12c('0x17')](function(_0x52f36a){console[_0xc12c('0x14')](_0x52f36a);});}return;})[_0xc12c('0x10')](function(){if(_0x269e6e){return _0x269e6e;}})[_0xc12c('0x10')](respondWithResult(_0xecde15,null))[_0xc12c('0x17')](function(_0x240cda){console[_0xc12c('0x14')](_0xc12c('0x17'),_0x240cda);for(var _0x3a31d0 of _0x571bd4){var _0x99f88c=path[_0xc12c('0x63')](config[_0xc12c('0x65')],_0xc12c('0xc1'),_0xc12c('0xb1'),_0xc12c('0xc2'),_0xc12c('0xdc'),_0x3a31d0[_0xc12c('0x5b')]);fs_extra[_0xc12c('0xdd')](_0x99f88c)['catch'](function(_0x2c642b){console['error'](_0xc12c('0xde'),_0x99f88c,_0x2c642b);});}});};exports[_0xc12c('0xdf')]=function(_0x58d1b8,_0x3da722){return db[_0xc12c('0x9e')][_0xc12c('0x4a')]({'where':{'id':_0x58d1b8[_0xc12c('0x44')]['id']}})[_0xc12c('0x10')](handleEntityNotFound(_0x3da722,null))[_0xc12c('0x10')](function(_0x1fd859){if(_0x1fd859){return _0x1fd859[_0xc12c('0xdf')](_0x58d1b8[_0xc12c('0x46')][_0xc12c('0x54')],_[_0xc12c('0xe0')](_0x58d1b8[_0xc12c('0x46')],[_0xc12c('0x54'),'id'])||{});}})['then'](respondWithResult(_0x3da722,null))['catch'](handleError(_0x3da722,null));};exports['getInteractions']=function(_0x2209c5,_0x5668d8){var _0x1f3a20={'raw':![],'where':{}};var _0xae9dcb={};var _0x29ea47={'count':0x0,'rows':[]};return db[_0xc12c('0x2b')][_0xc12c('0x4f')]({'where':{'id':_0x2209c5[_0xc12c('0x44')]['id']}})[_0xc12c('0x10')](handleEntityNotFound(_0x5668d8,null))[_0xc12c('0x10')](function(_0x4c67a1){if(_0x4c67a1){_0xae9dcb[_0xc12c('0x33')]=_[_0xc12c('0x30')](db['ChatInteraction'][_0xc12c('0x2c')]);_0xae9dcb[_0xc12c('0x2f')]=_[_0xc12c('0x30')](_0x2209c5[_0xc12c('0x2f')]);_0xae9dcb['filters']=_[_0xc12c('0x32')](_0xae9dcb['model'],_0xae9dcb['query']);_0x1f3a20[_0xc12c('0x35')]=_[_0xc12c('0x32')](_0xae9dcb[_0xc12c('0x33')],qs['fields'](_0x2209c5['query'][_0xc12c('0x34')]));_0x1f3a20['attributes']=_0x1f3a20[_0xc12c('0x35')][_0xc12c('0x36')]?_0x1f3a20[_0xc12c('0x35')]:_0xae9dcb[_0xc12c('0x33')];if(!_0x2209c5[_0xc12c('0x2f')][_0xc12c('0x50')](_0xc12c('0x37'))){_0x1f3a20[_0xc12c('0x38')]=qs[_0xc12c('0x38')](_0x2209c5[_0xc12c('0x2f')][_0xc12c('0x38')]);_0x1f3a20[_0xc12c('0x1c')]=qs[_0xc12c('0x1c')](_0x2209c5[_0xc12c('0x2f')][_0xc12c('0x1c')]);}_0x1f3a20[_0xc12c('0x39')]=qs[_0xc12c('0x3a')](_0x2209c5[_0xc12c('0x2f')][_0xc12c('0x3a')]);_0x1f3a20[_0xc12c('0x3b')]=qs[_0xc12c('0x31')](_[_0xc12c('0x51')](_0x2209c5[_0xc12c('0x2f')],_0xae9dcb['filters']));_0x1f3a20[_0xc12c('0x3b')]['ChatWebsiteId']=_0x4c67a1['id'];if(_0x2209c5[_0xc12c('0x2f')][_0xc12c('0x3c')]){_0x1f3a20[_0xc12c('0x3b')]=_['merge'](_0x1f3a20[_0xc12c('0x3b')],{'$or':_['map'](_0x1f3a20[_0xc12c('0x35')],function(_0x5a9b92){var _0xcdfd2e={};_0xcdfd2e[_0x5a9b92]={'$like':'%'+_0x2209c5[_0xc12c('0x2f')]['filter']+'%'};return _0xcdfd2e;})});}_0x1f3a20=_[_0xc12c('0x3d')]({},_0x1f3a20,_0x2209c5[_0xc12c('0x3f')]);return db['ChatInteraction'][_0xc12c('0x1e')]({'where':_0x1f3a20[_0xc12c('0x3b')]})[_0xc12c('0x10')](function(_0x1f85a8){_0x29ea47['count']=_0x1f85a8;if(_0x2209c5[_0xc12c('0x2f')][_0xc12c('0x40')]){_0x1f3a20[_0xc12c('0x41')]=[{'model':db[_0xc12c('0x74')],'as':_0xc12c('0xe1'),'required':![]},{'model':db[_0xc12c('0xaa')],'as':'Owner','attributes':[_0xc12c('0x26'),'fullname',_0xc12c('0xe2')],'required':![]},{'model':db['Tag'],'as':_0xc12c('0xe3'),'attributes':['id',_0xc12c('0x26'),_0xc12c('0xe4')],'where':_0x2209c5[_0xc12c('0x2f')]['tag']?{'id':_0x2209c5[_0xc12c('0x2f')][_0xc12c('0xe5')]}:undefined,'required':_0x2209c5[_0xc12c('0x2f')][_0xc12c('0xe5')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x1f3a20);})['then'](function(_0x41d994){_0x29ea47[_0xc12c('0x42')]=_0x41d994;return _0x29ea47;});}})['then'](respondWithFilteredResult(_0x5668d8,_0x1f3a20))[_0xc12c('0x17')](handleError(_0x5668d8,null));};function iftimePromise(_0x436dbe,_0x46fd3b){return respondWithRpcPromise('Command',_0xc12c('0xe6'),{'command':_0x46fd3b[_0xc12c('0xe7')]?util[_0xc12c('0x9a')]('iftime\x20%s,%s',_0x436dbe[_0xc12c('0xe8')],_0x46fd3b[_0xc12c('0xe7')]):util['format'](_0xc12c('0xe9'),_0x436dbe[_0xc12c('0xe8')])},client9002)['then'](function(_0x11d85d){var _0x1a0905=_0x11d85d&&_0x11d85d[_0xc12c('0xea')](_0xc12c('0xeb'))>=0x0?!![]:![];logger[_0xc12c('0xec')](_0xc12c('0xed'),_0x46fd3b['id'],_0x436dbe['id'],_0x436dbe[_0xc12c('0xe8')],_0x1a0905?_0xc12c('0xee'):_0xc12c('0xef'),_0x46fd3b[_0xc12c('0xe7')]?_0x46fd3b[_0xc12c('0xe7')]:_0xc12c('0xf0'));return _0x1a0905;})[_0xc12c('0x17')](function(_0x5d3234){logger[_0xc12c('0x14')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x46fd3b['id'],_0x436dbe['id'],_0x436dbe[_0xc12c('0xe8')],util['inspect'](_0x5d3234,{'showHidden':![],'depth':null}),_0x46fd3b[_0xc12c('0xe7')]?_0x46fd3b[_0xc12c('0xe7')]:_0xc12c('0xf0'));return![];});}exports[_0xc12c('0xe6')]=function(_0x551598,_0x9dfbd){var _0x433897=0x0;var _0x48e668=0x0;var _0x1d6b47=![];var _0x17650f;var _0x1f3534;return db['ChatWebsite']['find']({'where':{'id':_0x551598[_0xc12c('0x44')]['id']},'include':[{'model':db[_0xc12c('0xf1')],'as':_0xc12c('0xf1'),'include':[{'model':db[_0xc12c('0xf1')],'as':_0xc12c('0xf2'),'attributes':['id',_0xc12c('0xe8')],'raw':!![]}]}]})[_0xc12c('0x10')](handleEntityNotFound(_0x9dfbd,null))[_0xc12c('0x10')](function(_0x1a3e2f){if(_0x1a3e2f){_0x17650f=_0x1a3e2f;return _0x1a3e2f[_0xc12c('0xf3')]({'raw':!![]});}})['then'](function(_0x10842f){if(_0x17650f){if(_0x10842f){_0x1f3534=_0x10842f;}}return require(_0xc12c('0x61'))[_0xc12c('0x62')]();})['then'](function(_0x91ebe4){if(_0x91ebe4){_0x48e668=_0x91ebe4['virtual'];_0x1d6b47=_0x91ebe4[_0xc12c('0xf4')];}})[_0xc12c('0x10')](function(){return db['ChatInteraction'][_0xc12c('0x1e')]({'where':{'closed':![]}});})[_0xc12c('0x10')](function(_0x210e4c){_0x433897=_0x210e4c;if(_0x48e668&&_0x210e4c>_0x48e668){return db['License']['findOne']({'where':{'id':0x1}})[_0xc12c('0x10')](function(_0x280bc6){if(_0x280bc6){_0x280bc6[_0xc12c('0xf5')](_0xc12c('0xf6'));}});}})[_0xc12c('0x10')](function(){if(_0x17650f[_0xc12c('0xf1')]&&_0x17650f[_0xc12c('0xf1')]['Intervals']){var _0x2d12af=[];for(var _0x14c48d=0x0;_0x14c48d<_0x17650f[_0xc12c('0xf1')]['Intervals'][_0xc12c('0x36')];_0x14c48d++){var _0x56075e=_0x17650f[_0xc12c('0xf1')][_0xc12c('0xf2')][_0x14c48d][_0xc12c('0x23')]({'plain':!![]});_0x2d12af['push'](iftimePromise(_0x56075e,_0x17650f));}return BPromise[_0xc12c('0xf7')](_0x2d12af)[_0xc12c('0x10')](function(_0x44cecd){return _[_0xc12c('0xf8')](_0x44cecd);});}else{return!![];}})[_0xc12c('0x10')](function(_0x311432){var _0x46f54a=fs[_0xc12c('0xb9')](path[_0xc12c('0x63')](config[_0xc12c('0x65')],_0xc12c('0xf9')),'utf8');var _0x2ae8b0={'remote':_0x17650f[_0xc12c('0xfa')],'query':querystring[_0xc12c('0x9d')](_[_0xc12c('0x3d')](_0x17650f[_0xc12c('0x23')]({'plain':!![]}),{'customerIp':_0x551598[_0xc12c('0x71')][_0xc12c('0x91')]||_0x551598[_0xc12c('0x71')][_0xc12c('0xfb')]||_0x551598[_0xc12c('0xfc')]['remoteAddress']||_0x551598['ip'],'referer':_0x551598[_0xc12c('0x71')][_0xc12c('0x95')],'openedInteractions':_0x433897,'maxInteractions':_0x48e668,'virtual':_0x1d6b47['virtual'],'online':_0x311432,'custom':_0x1d6b47}))['replace'](/'/g,'\x5c\x27')};_0x9dfbd[_0xc12c('0xb3')](ejs['render'](Mustache['render'](_0x46f54a,_0x2ae8b0),{'proactiveActions':_0x1f3534,'alignment':_0x17650f[_0xc12c('0xfd')],'verticalAlignment':_0x17650f[_0xc12c('0xfe')],'div_color':_0x17650f[_0xc12c('0xe4')],'labelText':_0x17650f[_0xc12c('0xff')],'text_color':_0x17650f[_0xc12c('0x100')],'button_color':_0x17650f['color_button'],'background_color':_0x17650f['backgroundColor'],'hideWhenOffline':_0x17650f['hideWhenOffline'],'interval':_0x17650f[_0xc12c('0x101')]}));})[_0xc12c('0x17')](handleError(_0x9dfbd,null));};exports[_0xc12c('0x102')]=function(_0x59f5ac,_0x3b7dfb){var _0x51ee61=_0x59f5ac[_0xc12c('0x44')]['id'];var _0xca1c24=_0x59f5ac[_0xc12c('0x46')];var _0xe155cf=0xc8;var _0x3b1da2=null;return db[_0xc12c('0xc5')][_0xc12c('0xc6')]({'isolationLevel':db[_0xc12c('0xc5')][_0xc12c('0x103')][_0xc12c('0x104')][_0xc12c('0x105')]},function(_0xb2313d){return db[_0xc12c('0x2b')][_0xc12c('0x4f')]({'where':{'id':_0x51ee61},'transaction':_0xb2313d})[_0xc12c('0x10')](function(_0x28091c){if(_0x28091c){return db[_0xc12c('0x85')]['destroy']({'where':{'ChatWebsiteId':_0x51ee61},'transaction':_0xb2313d})[_0xc12c('0x10')](function(){var _0x1e44a7=_[_0xc12c('0x2a')](_0xca1c24,function(_0x2e811f){_0x2e811f['ChatWebsiteId']=_0x51ee61;return _0x2e811f;});return db[_0xc12c('0x85')][_0xc12c('0xc7')](_0x1e44a7,{'transaction':_0xb2313d});});}else{_0xe155cf=0x194;_0x3b1da2=[];}});})[_0xc12c('0x10')](function(){if(_0xe155cf!==0x194){return db[_0xc12c('0x85')][_0xc12c('0x106')]({'where':{'ChatWebsiteId':_0x51ee61},'order':'priority'})[_0xc12c('0x10')](function(_0x491049){_0x3b1da2=_0x491049;});}})[_0xc12c('0x17')](function(_0x3dddb1){_0xe155cf=0x1f4;logger[_0xc12c('0x14')](_0x3dddb1[_0xc12c('0x25')]);if(_0x3dddb1[_0xc12c('0x26')]){delete _0x3dddb1[_0xc12c('0x26')];}_0x3b1da2=_0x3dddb1;})[_0xc12c('0x107')](function(){if(_0x3b1da2===null){_0x3b7dfb[_0xc12c('0x18')](_0xe155cf);}else{if(_0xe155cf===0x1f4){_0x3b7dfb[_0xc12c('0x19')](_0xe155cf)['send'](_0x3b1da2);}else{_0x3b7dfb[_0xc12c('0x19')](_0xe155cf)[_0xc12c('0x1b')](_0x3b1da2);}}});};exports[_0xc12c('0x108')]=function(_0x17451f,_0x25cef5){var _0x5d92e7={};var _0x24e64e={};var _0xc9bd2;var _0x2b4bf1;return db['ChatWebsite'][_0xc12c('0x4f')]({'where':{'id':_0x17451f[_0xc12c('0x44')]['id']}})[_0xc12c('0x10')](handleEntityNotFound(_0x25cef5,null))['then'](function(_0x5c025b){if(_0x5c025b){_0xc9bd2=_0x5c025b;_0x24e64e[_0xc12c('0x33')]=_[_0xc12c('0x30')](db[_0xc12c('0x85')]['rawAttributes']);_0x24e64e[_0xc12c('0x2f')]=_[_0xc12c('0x30')](_0x17451f[_0xc12c('0x2f')]);_0x24e64e['filters']=_[_0xc12c('0x32')](_0x24e64e[_0xc12c('0x33')],_0x24e64e['query']);_0x5d92e7[_0xc12c('0x35')]=_[_0xc12c('0x32')](_0x24e64e[_0xc12c('0x33')],qs[_0xc12c('0x34')](_0x17451f['query'][_0xc12c('0x34')]));_0x5d92e7[_0xc12c('0x35')]=_0x5d92e7['attributes'][_0xc12c('0x36')]?_0x5d92e7[_0xc12c('0x35')]:_0x24e64e['model'];_0x5d92e7[_0xc12c('0x39')]=qs[_0xc12c('0x3a')](_0x17451f['query']['sort']);_0x5d92e7[_0xc12c('0x3b')]=qs['filters'](_['pick'](_0x17451f[_0xc12c('0x2f')],_0x24e64e[_0xc12c('0x31')]));if(_0x17451f[_0xc12c('0x2f')]['filter']){_0x5d92e7['where']=_[_0xc12c('0x3d')](_0x5d92e7[_0xc12c('0x3b')],{'$or':_[_0xc12c('0x2a')](_0x5d92e7['attributes'],function(_0x40f898){var _0x4ef6a2={};_0x4ef6a2[_0x40f898]={'$like':'%'+_0x17451f[_0xc12c('0x2f')][_0xc12c('0x3c')]+'%'};return _0x4ef6a2;})});}_0x5d92e7=_[_0xc12c('0x3d')]({},_0x5d92e7,_0x17451f[_0xc12c('0x3f')]);return _0xc9bd2['getApplications'](_0x5d92e7);}})[_0xc12c('0x10')](function(_0x1bec6e){if(_0x1bec6e){_0x2b4bf1=_0x1bec6e[_0xc12c('0x36')];if(!_0x17451f[_0xc12c('0x2f')][_0xc12c('0x50')](_0xc12c('0x37'))){_0x5d92e7[_0xc12c('0x38')]=qs[_0xc12c('0x38')](_0x17451f['query'][_0xc12c('0x38')]);_0x5d92e7[_0xc12c('0x1c')]=qs[_0xc12c('0x1c')](_0x17451f[_0xc12c('0x2f')][_0xc12c('0x1c')]);}return _0xc9bd2[_0xc12c('0x108')](_0x5d92e7);}})['then'](function(_0x5853ec){if(_0x5853ec){return _0x5853ec?{'count':_0x2b4bf1,'rows':_0x5853ec}:null;}})['then'](respondWithResult(_0x25cef5,null))['catch'](handleError(_0x25cef5,null));};exports[_0xc12c('0x109')]=function(_0x473866,_0x73fdc){return db[_0xc12c('0x10a')][_0xc12c('0x4a')]({'where':{'id':_0x473866['params']['id']}})[_0xc12c('0x10')](handleEntityNotFound(_0x73fdc,null))['then'](function(_0x56e0ff){if(_0x56e0ff){return _0x56e0ff[_0xc12c('0x109')](_0x473866['body']['ids'],_['omit'](_0x473866[_0xc12c('0x46')],[_0xc12c('0x54'),'id'])||{});}})[_0xc12c('0x10')](respondWithResult(_0x73fdc,null))[_0xc12c('0x17')](handleError(_0x73fdc,null));};exports[_0xc12c('0xf3')]=function(_0x2833be,_0x37b49a){var _0x5e7521={};var _0x48b157={};var _0x2de13f;var _0x4547c4;return db[_0xc12c('0x2b')][_0xc12c('0x4f')]({'where':{'id':_0x2833be[_0xc12c('0x44')]['id']}})[_0xc12c('0x10')](handleEntityNotFound(_0x37b49a,null))[_0xc12c('0x10')](function(_0x311464){if(_0x311464){_0x2de13f=_0x311464;_0x48b157[_0xc12c('0x33')]=_[_0xc12c('0x30')](db[_0xc12c('0x10b')]['rawAttributes']);_0x48b157[_0xc12c('0x2f')]=_[_0xc12c('0x30')](_0x2833be[_0xc12c('0x2f')]);_0x48b157[_0xc12c('0x31')]=_['intersection'](_0x48b157[_0xc12c('0x33')],_0x48b157['query']);_0x5e7521['attributes']=_['intersection'](_0x48b157[_0xc12c('0x33')],qs[_0xc12c('0x34')](_0x2833be[_0xc12c('0x2f')]['fields']));_0x5e7521[_0xc12c('0x35')]=_0x5e7521[_0xc12c('0x35')]['length']?_0x5e7521[_0xc12c('0x35')]:_0x48b157[_0xc12c('0x33')];_0x5e7521[_0xc12c('0x39')]=qs[_0xc12c('0x3a')](_0x2833be[_0xc12c('0x2f')][_0xc12c('0x3a')]);_0x5e7521[_0xc12c('0x3b')]=qs[_0xc12c('0x31')](_[_0xc12c('0x51')](_0x2833be['query'],_0x48b157[_0xc12c('0x31')]));if(_0x2833be['query']['filter']){_0x5e7521[_0xc12c('0x3b')]=_[_0xc12c('0x3d')](_0x5e7521[_0xc12c('0x3b')],{'$or':_[_0xc12c('0x2a')](_0x5e7521[_0xc12c('0x35')],function(_0x4df230){var _0x271e2d={};_0x271e2d[_0x4df230]={'$like':'%'+_0x2833be['query'][_0xc12c('0x3c')]+'%'};return _0x271e2d;})});}_0x5e7521=_[_0xc12c('0x3d')]({},_0x5e7521,_0x2833be[_0xc12c('0x3f')]);return _0x2de13f['getProactiveActions'](_0x5e7521);}})['then'](function(_0x48da31){if(_0x48da31){_0x4547c4=_0x48da31['length'];if(!_0x2833be['query'][_0xc12c('0x50')]('nolimit')){_0x5e7521['limit']=qs['limit'](_0x2833be[_0xc12c('0x2f')][_0xc12c('0x38')]);_0x5e7521['offset']=qs[_0xc12c('0x1c')](_0x2833be[_0xc12c('0x2f')][_0xc12c('0x1c')]);}return _0x2de13f['getProactiveActions'](_0x5e7521);}})[_0xc12c('0x10')](function(_0x10d26a){if(_0x10d26a){return _0x10d26a?{'count':_0x4547c4,'rows':_0x10d26a}:null;}})[_0xc12c('0x10')](respondWithResult(_0x37b49a,null))[_0xc12c('0x17')](handleError(_0x37b49a,null));};exports[_0xc12c('0x10c')]=function(_0x469563,_0x1c6276){var _0xce2505=_0x469563[_0xc12c('0x2f')][_0xc12c('0x10d')]==='false'?'offlineForm':_0xc12c('0x10e');return db['ChatWebsite'][_0xc12c('0x4a')]({'attributes':['id',_0xce2505],'where':{'id':_0x469563[_0xc12c('0x44')]['id']}})['then'](handleEntityNotFound(_0x1c6276,null))[_0xc12c('0x10')](function(_0x46023d){if(_0x46023d){var _0x39914e=_0x46023d[_0xce2505];var _0x400b0c=_0x39914e&&_0x39914e[_0xc12c('0x10f')]?_0x39914e[_0xc12c('0x10f')]:[];_0x1c6276[_0xc12c('0xb3')]({'fromKey':_['isNil'](_0x39914e['fromKey'])?undefined:_0x39914e[_0xc12c('0x110')],'count':_0x400b0c['length'],'rows':_0x400b0c});}})[_0xc12c('0x17')](handleError(_0x1c6276,null));};exports['getOfflineMessages']=function(_0x10f2c4,_0x489c18){var _0x58e915={'raw':![],'where':{}};var _0x14a25d={};var _0x19b34c={'count':0x0,'rows':[]};return db[_0xc12c('0x2b')]['findOne']({'where':{'id':_0x10f2c4[_0xc12c('0x44')]['id']}})[_0xc12c('0x10')](handleEntityNotFound(_0x489c18,null))[_0xc12c('0x10')](function(_0x13ad60){if(_0x13ad60){_0x14a25d['model']=_[_0xc12c('0x30')](db[_0xc12c('0xbe')][_0xc12c('0x2c')]);_0x14a25d[_0xc12c('0x2f')]=_['keys'](_0x10f2c4['query']);_0x14a25d[_0xc12c('0x31')]=_[_0xc12c('0x32')](_0x14a25d['model'],_0x14a25d[_0xc12c('0x2f')]);_0x58e915['attributes']=_[_0xc12c('0x32')](_0x14a25d['model'],qs['fields'](_0x10f2c4[_0xc12c('0x2f')]['fields']));_0x58e915['attributes']=_0x58e915[_0xc12c('0x35')]['length']?_0x58e915[_0xc12c('0x35')]:_0x14a25d['model'];if(!_0x10f2c4[_0xc12c('0x2f')][_0xc12c('0x50')](_0xc12c('0x37'))){_0x58e915[_0xc12c('0x38')]=qs['limit'](_0x10f2c4[_0xc12c('0x2f')]['limit']);_0x58e915[_0xc12c('0x1c')]=qs[_0xc12c('0x1c')](_0x10f2c4[_0xc12c('0x2f')][_0xc12c('0x1c')]);}_0x58e915['order']=qs[_0xc12c('0x3a')](_0x10f2c4['query']['sort']);_0x58e915['where']=qs[_0xc12c('0x31')](_[_0xc12c('0x51')](_0x10f2c4[_0xc12c('0x2f')],_0x14a25d[_0xc12c('0x31')]));_0x58e915[_0xc12c('0x3b')][_0xc12c('0x52')]=_0x13ad60['id'];if(_0x10f2c4[_0xc12c('0x2f')][_0xc12c('0x3c')]){_0x58e915[_0xc12c('0x3b')]=_['merge'](_0x58e915[_0xc12c('0x3b')],{'$or':_[_0xc12c('0x2a')](_0x58e915[_0xc12c('0x35')],function(_0x2bbda2){var _0x4bb996={};_0x4bb996[_0x2bbda2]={'$like':'%'+_0x10f2c4[_0xc12c('0x2f')][_0xc12c('0x3c')]+'%'};return _0x4bb996;})});}_0x58e915=_[_0xc12c('0x3d')]({},_0x58e915,_0x10f2c4[_0xc12c('0x3f')]);return db[_0xc12c('0xbe')]['count']({'where':_0x58e915[_0xc12c('0x3b')]})[_0xc12c('0x10')](function(_0x2a42fe){_0x19b34c['count']=_0x2a42fe;if(_0x10f2c4[_0xc12c('0x2f')]['includeAll']){_0x58e915['include']=[{'all':!![]}];}else{_0x58e915[_0xc12c('0x41')]=[{'model':db[_0xc12c('0x74')],'as':_0xc12c('0xe1'),'required':![]},{'model':db['Attachment'],'as':_0xc12c('0x111'),'required':![]}];}return db[_0xc12c('0xbe')][_0xc12c('0x112')](_0x58e915);})[_0xc12c('0x10')](function(_0x55ead3){_0x19b34c[_0xc12c('0x42')]=_0x55ead3;return _0x19b34c;});}})['then'](respondWithFilteredResult(_0x489c18,_0x58e915))[_0xc12c('0x17')](handleError(_0x489c18,null));};exports[_0xc12c('0x113')]=function(_0x3d883d,_0xa97e76){return db[_0xc12c('0x2b')][_0xc12c('0x4a')]({'where':{'id':_0x3d883d[_0xc12c('0x44')]['id']}})[_0xc12c('0x10')](handleEntityNotFound(_0xa97e76,null))['then'](function(_0x2b1145){if(_0x2b1145){return _0x2b1145[_0xc12c('0x113')](_0x3d883d['body'][_0xc12c('0x54')],_['omit'](_0x3d883d[_0xc12c('0x46')],[_0xc12c('0x54'),'id'])||{})[_0xc12c('0xa2')](function(_0x1b8e11){for(var _0x27212c=0x0;_0x27212c<_0x3d883d['body'][_0xc12c('0x54')][_0xc12c('0x36')];_0x27212c+=0x1){socket['emit'](_0xc12c('0x114'),{'UserId':Number(_0x3d883d[_0xc12c('0x46')][_0xc12c('0x54')][_0x27212c]),'ChatWebsiteId':Number(_0x3d883d['params']['id'])});}return _0x1b8e11;});}})[_0xc12c('0x10')](respondWithResult(_0xa97e76,null))[_0xc12c('0x17')](handleError(_0xa97e76,null));};exports[_0xc12c('0x115')]=function(_0x346f6b,_0x26e0f0){return db[_0xc12c('0x2b')][_0xc12c('0x4a')]({'where':{'id':_0x346f6b['params']['id']}})[_0xc12c('0x10')](handleEntityNotFound(_0x26e0f0,null))[_0xc12c('0x10')](function(_0x500e03){if(_0x500e03){return _0x500e03[_0xc12c('0x115')](_0x346f6b[_0xc12c('0x2f')][_0xc12c('0x54')])[_0xc12c('0x10')](function(){if(_[_0xc12c('0x116')](_0x346f6b[_0xc12c('0x2f')][_0xc12c('0x54')])){for(var _0x2332a8=0x0;_0x2332a8<_0x346f6b[_0xc12c('0x2f')][_0xc12c('0x54')][_0xc12c('0x36')];_0x2332a8+=0x1){socket['emit'](_0xc12c('0x117'),{'UserId':Number(_0x346f6b['query']['ids'][_0x2332a8]),'ChatWebsiteId':Number(_0x346f6b[_0xc12c('0x44')]['id'])});}}else{socket[_0xc12c('0x118')](_0xc12c('0x117'),{'UserId':Number(_0x346f6b[_0xc12c('0x2f')]['ids']),'ChatWebsiteId':Number(_0x346f6b['params']['id'])});}});}})[_0xc12c('0x10')](respondWithStatusCode(_0x26e0f0,null))['catch'](handleError(_0x26e0f0,null));};exports[_0xc12c('0x119')]=function(_0x473c7f,_0x1cd581){var _0x366027={};var _0x5e7424={};var _0x235e8e;var _0x66c769;return db['ChatWebsite'][_0xc12c('0x4f')]({'where':{'id':_0x473c7f[_0xc12c('0x44')]['id']}})[_0xc12c('0x10')](handleEntityNotFound(_0x1cd581,null))[_0xc12c('0x10')](function(_0x5c325c){if(_0x5c325c){_0x235e8e=_0x5c325c;_0x5e7424[_0xc12c('0x33')]=_[_0xc12c('0x30')](db[_0xc12c('0xaa')]['rawAttributes']);_0x5e7424[_0xc12c('0x2f')]=_[_0xc12c('0x30')](_0x473c7f['query']);_0x5e7424[_0xc12c('0x31')]=_[_0xc12c('0x32')](_0x5e7424[_0xc12c('0x33')],_0x5e7424[_0xc12c('0x2f')]);_0x366027['attributes']=_['intersection'](_0x5e7424[_0xc12c('0x33')],qs[_0xc12c('0x34')](_0x473c7f[_0xc12c('0x2f')][_0xc12c('0x34')]));_0x366027[_0xc12c('0x35')]=_0x366027[_0xc12c('0x35')][_0xc12c('0x36')]?_0x366027[_0xc12c('0x35')]:_0x5e7424['model'];_0x366027[_0xc12c('0x39')]=qs[_0xc12c('0x3a')](_0x473c7f[_0xc12c('0x2f')]['sort']);_0x366027[_0xc12c('0x3b')]=qs['filters'](_[_0xc12c('0x51')](_0x473c7f[_0xc12c('0x2f')],_0x5e7424[_0xc12c('0x31')]));if(_0x473c7f['query']['filter']){_0x366027['where']=_[_0xc12c('0x3d')](_0x366027[_0xc12c('0x3b')],{'$or':_[_0xc12c('0x2a')](_0x366027[_0xc12c('0x35')],function(_0x596255){var _0x519992={};_0x519992[_0x596255]={'$like':'%'+_0x473c7f[_0xc12c('0x2f')]['filter']+'%'};return _0x519992;})});}_0x366027=_[_0xc12c('0x3d')]({},_0x366027,_0x473c7f['options']);return _0x235e8e[_0xc12c('0x119')](_0x366027);}})[_0xc12c('0x10')](function(_0x97ad69){if(_0x97ad69){_0x66c769=_0x97ad69[_0xc12c('0x36')];if(!_0x473c7f[_0xc12c('0x2f')]['hasOwnProperty'](_0xc12c('0x37'))){_0x366027['limit']=qs[_0xc12c('0x38')](_0x473c7f['query'][_0xc12c('0x38')]);_0x366027['offset']=qs[_0xc12c('0x1c')](_0x473c7f[_0xc12c('0x2f')][_0xc12c('0x1c')]);}return _0x235e8e['getAgents'](_0x366027);}})[_0xc12c('0x10')](function(_0x251ed8){if(_0x251ed8){return _0x251ed8?{'count':_0x66c769,'rows':_0x251ed8}:null;}})['then'](respondWithResult(_0x1cd581,null))[_0xc12c('0x17')](handleError(_0x1cd581,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 9bcf35b..6b7e1ea 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 _0xae1c=['hasOwnProperty','hook','exports','save','update','remove','emit'];(function(_0x1e2c73,_0x12cd55){var _0x46f8d5=function(_0xe5a2fd){while(--_0xe5a2fd){_0x1e2c73['push'](_0x1e2c73['shift']());}};_0x46f8d5(++_0x12cd55);}(_0xae1c,0xff));var _0xcae1=function(_0x21ba41,_0x4727db){_0x21ba41=_0x21ba41-0x0;var _0x293e00=_0xae1c[_0x21ba41];return _0x293e00;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcae1('0x0'),'afterUpdate':_0xcae1('0x1'),'afterDestroy':_0xcae1('0x2')};function emitEvent(_0x32bfaa){return function(_0x1d37db,_0x2b6b57,_0x3d11cb){ChatWebsiteEvents[_0xcae1('0x3')](_0x32bfaa+':'+_0x1d37db['id'],_0x1d37db);ChatWebsiteEvents[_0xcae1('0x3')](_0x32bfaa,_0x1d37db);_0x3d11cb(null);};}for(var e in events){if(events[_0xcae1('0x4')](e)){var event=events[e];ChatWebsite[_0xcae1('0x5')](e,emitEvent(event));}}module[_0xcae1('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x7d9f=['save','remove','hasOwnProperty','hook','events','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x41407d,_0x4ca526){var _0x9c2cf1=function(_0x1cbfb6){while(--_0x1cbfb6){_0x41407d['push'](_0x41407d['shift']());}};_0x9c2cf1(++_0x4ca526);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x274d4b,_0x128681){_0x274d4b=_0x274d4b-0x0;var _0x1a1f03=_0x7d9f[_0x274d4b];return _0x1a1f03;};'use strict';var EventEmitter=require(_0xf7d9('0x0'));var ChatWebsite=require(_0xf7d9('0x1'))['db'][_0xf7d9('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xf7d9('0x3')](0x0);var events={'afterCreate':_0xf7d9('0x4'),'afterUpdate':'update','afterDestroy':_0xf7d9('0x5')};function emitEvent(_0x1051a9){return function(_0xd43b74,_0x159e95,_0x23cb4c){ChatWebsiteEvents['emit'](_0x1051a9+':'+_0xd43b74['id'],_0xd43b74);ChatWebsiteEvents['emit'](_0x1051a9,_0xd43b74);_0x23cb4c(null);};}for(var e in events){if(events[_0xf7d9('0x6')](e)){var event=events[e];ChatWebsite[_0xf7d9('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index c108120..7e46a9e 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 _0xb582=['moment','bluebird','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','chat_websites','../../config/logger','api'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xb582,0x1cc));var _0x2b58=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xb582[_0x1035c1];return _0x308d67;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2b58('0x0'))(_0x2b58('0x1'));var moment=require(_0x2b58('0x2'));var BPromise=require(_0x2b58('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b58('0x4'));var rimraf=require(_0x2b58('0x5'));var config=require(_0x2b58('0x6'));var attributes=require(_0x2b58('0x7'));module[_0x2b58('0x8')]=function(_0x3ac6f4,_0x2d763c){return _0x3ac6f4[_0x2b58('0x9')]('ChatWebsite',attributes,{'tableName':_0x2b58('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa60f=['bluebird','request-promise','path','./chatWebsite.attributes','exports','chat_websites','lodash','../../config/logger','api','moment'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0xa60f,0x100));var _0xfa60=function(_0x474636,_0x36958e){_0x474636=_0x474636-0x0;var _0x554e6b=_0xa60f[_0x474636];return _0x554e6b;};'use strict';var _=require(_0xfa60('0x0'));var util=require('util');var logger=require(_0xfa60('0x1'))(_0xfa60('0x2'));var moment=require(_0xfa60('0x3'));var BPromise=require(_0xfa60('0x4'));var rp=require(_0xfa60('0x5'));var fs=require('fs');var path=require(_0xfa60('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfa60('0x7'));module[_0xfa60('0x8')]=function(_0x28655e,_0x55f98e){return _0x28655e['define']('ChatWebsite',attributes,{'tableName':_0xfa60('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 9b14f89..48788fc 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 _0x234a=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0xc7fc03,_0x3950a8){var _0x3d962a=function(_0x2bfa14){while(--_0x2bfa14){_0xc7fc03['push'](_0xc7fc03['shift']());}};_0x3d962a(++_0x3950a8);}(_0x234a,0x1db));var _0xa234=function(_0x43eb54,_0x35e944){_0x43eb54=_0x43eb54-0x0;var _0x3892ac=_0x234a[_0x43eb54];return _0x3892ac;};'use strict';var _=require(_0xa234('0x0'));var util=require(_0xa234('0x1'));var moment=require(_0xa234('0x2'));var BPromise=require(_0xa234('0x3'));var rs=require(_0xa234('0x4'));var fs=require('fs');var Redis=require(_0xa234('0x5'));var db=require(_0xa234('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa234('0x7'))(_0xa234('0x8'));var config=require(_0xa234('0x9'));var jayson=require(_0xa234('0xa'));var client=jayson[_0xa234('0xb')][_0xa234('0xc')]({'port':0x232a});config['redis']=_[_0xa234('0xd')](config[_0xa234('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa234('0xe')]));require('./chatWebsite.socket')[_0xa234('0xf')](socket);function respondWithRpcPromise(_0x193584,_0x14e283,_0x2a1d73){return new BPromise(function(_0x21096c,_0xdd8736){return client[_0xa234('0x10')](_0x193584,_0x2a1d73)[_0xa234('0x11')](function(_0x5cbca2){logger['info'](_0xa234('0x12'),_0x14e283,_0xa234('0x13'));logger[_0xa234('0x14')](_0xa234('0x15'),_0x14e283,'request\x20sent',JSON[_0xa234('0x16')](_0x5cbca2));if(_0x5cbca2[_0xa234('0x17')]){if(_0x5cbca2['error'][_0xa234('0x18')]===0x1f4){logger[_0xa234('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x14e283,_0x5cbca2['error'][_0xa234('0x19')]);return _0xdd8736(_0x5cbca2[_0xa234('0x17')][_0xa234('0x19')]);}logger[_0xa234('0x17')](_0xa234('0x12'),_0x14e283,_0x5cbca2['error'][_0xa234('0x19')]);return _0x21096c(_0x5cbca2[_0xa234('0x17')][_0xa234('0x19')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x14e283,_0xa234('0x13'));_0x21096c(_0x5cbca2[_0xa234('0x1a')][_0xa234('0x19')]);}})[_0xa234('0x1b')](function(_0x1c7edd){logger[_0xa234('0x17')](_0xa234('0x12'),_0x14e283,_0x1c7edd);_0xdd8736(_0x1c7edd);});});}
\ No newline at end of file
+var _0x0cac=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','info'];(function(_0xa16075,_0x31ac3b){var _0x452281=function(_0x5d7665){while(--_0x5d7665){_0xa16075['push'](_0xa16075['shift']());}};_0x452281(++_0x31ac3b);}(_0x0cac,0x1de));var _0xc0ca=function(_0x14735c,_0x56c131){_0x14735c=_0x14735c-0x0;var _0x44e4f4=_0x0cac[_0x14735c];return _0x44e4f4;};'use strict';var _=require(_0xc0ca('0x0'));var util=require(_0xc0ca('0x1'));var moment=require(_0xc0ca('0x2'));var BPromise=require(_0xc0ca('0x3'));var rs=require(_0xc0ca('0x4'));var fs=require('fs');var Redis=require(_0xc0ca('0x5'));var db=require(_0xc0ca('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc0ca('0x7'))(_0xc0ca('0x8'));var config=require(_0xc0ca('0x9'));var jayson=require(_0xc0ca('0xa'));var client=jayson[_0xc0ca('0xb')]['http']({'port':0x232a});config[_0xc0ca('0xc')]=_[_0xc0ca('0xd')](config[_0xc0ca('0xc')],{'host':_0xc0ca('0xe'),'port':0x18eb});var socket=require(_0xc0ca('0xf'))(new Redis(config[_0xc0ca('0xc')]));require(_0xc0ca('0x10'))['register'](socket);function respondWithRpcPromise(_0x53f326,_0x23164c,_0x3f5558){return new BPromise(function(_0x3eed2a,_0x20fe5e){return client[_0xc0ca('0x11')](_0x53f326,_0x3f5558)['then'](function(_0xd3e829){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x23164c,_0xc0ca('0x12'));logger['debug'](_0xc0ca('0x13'),_0x23164c,_0xc0ca('0x12'),JSON[_0xc0ca('0x14')](_0xd3e829));if(_0xd3e829[_0xc0ca('0x15')]){if(_0xd3e829['error'][_0xc0ca('0x16')]===0x1f4){logger[_0xc0ca('0x15')](_0xc0ca('0x17'),_0x23164c,_0xd3e829[_0xc0ca('0x15')][_0xc0ca('0x18')]);return _0x20fe5e(_0xd3e829[_0xc0ca('0x15')][_0xc0ca('0x18')]);}logger[_0xc0ca('0x15')](_0xc0ca('0x17'),_0x23164c,_0xd3e829[_0xc0ca('0x15')]['message']);return _0x3eed2a(_0xd3e829['error']['message']);}else{logger[_0xc0ca('0x19')](_0xc0ca('0x17'),_0x23164c,'request\x20sent');_0x3eed2a(_0xd3e829[_0xc0ca('0x1a')]['message']);}})[_0xc0ca('0x1b')](function(_0x243d53){logger[_0xc0ca('0x15')](_0xc0ca('0x17'),_0x23164c,_0x243d53);_0x20fe5e(_0x243d53);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 8475d4d..9157420 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 _0x463b=['emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x463b,0x101));var _0xb463=function(_0x1f7e00,_0x1c9d00){_0x1f7e00=_0x1f7e00-0x0;var _0x3c5a23=_0x463b[_0x1f7e00];return _0x3c5a23;};'use strict';var ChatWebsiteEvents=require(_0xb463('0x0'));var events=[_0xb463('0x1'),_0xb463('0x2'),_0xb463('0x3')];function createListener(_0x29b477,_0x9c4435){return function(_0x4fc061){_0x9c4435[_0xb463('0x4')](_0x29b477,_0x4fc061);};}function removeListener(_0x4e336f,_0x479845){return function(){ChatWebsiteEvents[_0xb463('0x5')](_0x4e336f,_0x479845);};}exports[_0xb463('0x6')]=function(_0x3411f6){for(var _0x2bf0e3=0x0,_0x390360=events[_0xb463('0x7')];_0x2bf0e3<_0x390360;_0x2bf0e3++){var _0x50ead9=events[_0x2bf0e3];var _0x25dde5=createListener(_0xb463('0x8')+_0x50ead9,_0x3411f6);ChatWebsiteEvents['on'](_0x50ead9,_0x25dde5);}};
\ No newline at end of file
+var _0x07cc=['length','./chatWebsite.events','save','update','emit','removeListener','register'];(function(_0xb09c2,_0x2a04d1){var _0x5ecc6b=function(_0x51e5f2){while(--_0x51e5f2){_0xb09c2['push'](_0xb09c2['shift']());}};_0x5ecc6b(++_0x2a04d1);}(_0x07cc,0xd3));var _0xc07c=function(_0x959539,_0x484a9e){_0x959539=_0x959539-0x0;var _0x30873a=_0x07cc[_0x959539];return _0x30873a;};'use strict';var ChatWebsiteEvents=require(_0xc07c('0x0'));var events=[_0xc07c('0x1'),'remove',_0xc07c('0x2')];function createListener(_0x1fb517,_0x1a6f30){return function(_0x4fb04e){_0x1a6f30[_0xc07c('0x3')](_0x1fb517,_0x4fb04e);};}function removeListener(_0xfdec23,_0x1ea051){return function(){ChatWebsiteEvents[_0xc07c('0x4')](_0xfdec23,_0x1ea051);};}exports[_0xc07c('0x5')]=function(_0x1a78c5){for(var _0x5a4a88=0x0,_0xd26bbe=events[_0xc07c('0x6')];_0x5a4a88<_0xd26bbe;_0x5a4a88++){var _0x237512=events[_0x5a4a88];var _0x36e27b=createListener('chatWebsite:'+_0x237512,_0x1a78c5);ChatWebsiteEvents['on'](_0x237512,_0x36e27b);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index e9bd27f..6eb131c 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 _0xf01f=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','show','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','getFields','getOfflineMessages','/:id/users','post','create','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','join','addAvatar','server/files/images/avatars/','addCustomerAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','extname','replace','/:id/offline','any','offline','addInteraction','/:id/applications','addAgents','put','update','delete','/:id/dispositions','removeDispositions','removeAnswers','removeAgents','exports','multer','util'];(function(_0x1c688b,_0x4df102){var _0x4d4577=function(_0x29a41b){while(--_0x29a41b){_0x1c688b['push'](_0x1c688b['shift']());}};_0x4d4577(++_0x4df102);}(_0xf01f,0xd3));var _0xff01=function(_0x2d789c,_0x366140){_0x2d789c=_0x2d789c-0x0;var _0xc5d1d5=_0xf01f[_0x2d789c];return _0xc5d1d5;};'use strict';var multer=require(_0xff01('0x0'));var util=require(_0xff01('0x1'));var path=require(_0xff01('0x2'));var timeout=require('connect-timeout');var express=require(_0xff01('0x3'));var router=express['Router']();var fs_extra=require(_0xff01('0x4'));var auth=require(_0xff01('0x5'));var interaction=require(_0xff01('0x6'));var config=require(_0xff01('0x7'));var controller=require(_0xff01('0x8'));router[_0xff01('0x9')]('/',auth[_0xff01('0xa')](),controller['index']);router[_0xff01('0x9')](_0xff01('0xb'),auth[_0xff01('0xa')](),controller[_0xff01('0xc')]);router[_0xff01('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xff01('0xd')]);router[_0xff01('0x9')]('/:id/dispositions',auth[_0xff01('0xa')](),controller['getDispositions']);router['get'](_0xff01('0xe'),auth[_0xff01('0xa')](),controller[_0xff01('0xf')]);router[_0xff01('0x9')](_0xff01('0x10'),controller[_0xff01('0x11')]);router[_0xff01('0x9')]('/:id/avatar',controller[_0xff01('0x12')]);router[_0xff01('0x9')](_0xff01('0x13'),controller['getCustomerAvatar']);router[_0xff01('0x9')](_0xff01('0x14'),controller[_0xff01('0x15')]);router['get']('/:id/interactions',auth['isAuthenticated'](),controller[_0xff01('0x16')]);router['get'](_0xff01('0x17'),controller[_0xff01('0x18')]);router[_0xff01('0x9')]('/:id/applications',auth[_0xff01('0xa')](),controller[_0xff01('0x19')]);router[_0xff01('0x9')](_0xff01('0x1a'),auth[_0xff01('0xa')](),controller[_0xff01('0x1b')]);router[_0xff01('0x9')]('/:id/fields',controller[_0xff01('0x1c')]);router[_0xff01('0x9')]('/:id/offline_messages',auth[_0xff01('0xa')](),controller[_0xff01('0x1d')]);router[_0xff01('0x9')](_0xff01('0x1e'),auth[_0xff01('0xa')](),controller['getAgents']);router[_0xff01('0x1f')]('/',auth[_0xff01('0xa')](),controller[_0xff01('0x20')]);router[_0xff01('0x1f')]('/:id/dispositions',auth[_0xff01('0xa')](),controller[_0xff01('0x21')]);router[_0xff01('0x1f')](_0xff01('0xe'),auth[_0xff01('0xa')](),controller[_0xff01('0x22')]);var upload=multer({'storage':multer[_0xff01('0x23')]({'destination':function(_0x2f9f12,_0x2de305,_0x15c139){_0x15c139(null,path['join'](config[_0xff01('0x24')],_0xff01('0x25')));},'filename':function(_0x5b0d54,_0x46ed6a,_0x69b934){_0x69b934(null,util[_0xff01('0x26')](_0xff01('0x27'),Date[_0xff01('0x28')](),_0x46ed6a[_0xff01('0x29')]));}})});router[_0xff01('0x1f')](_0xff01('0x10'),upload[_0xff01('0x2a')](_0xff01('0x2b')),controller[_0xff01('0x2c')]);var upload=multer({'storage':multer[_0xff01('0x23')]({'destination':function(_0x2477c8,_0x4d6283,_0x55b655){_0x55b655(null,path[_0xff01('0x2d')](config[_0xff01('0x24')],'server/files/images/avatars/'));},'filename':function(_0xd9d330,_0x5f14b9,_0x3050fd){_0x3050fd(null,util[_0xff01('0x26')]('%s-%s',Date[_0xff01('0x28')](),_0x5f14b9['originalname']));}})});router[_0xff01('0x1f')]('/:id/avatar',upload[_0xff01('0x2a')](_0xff01('0x2b')),controller[_0xff01('0x2e')]);var upload=multer({'storage':multer[_0xff01('0x23')]({'destination':function(_0x41242a,_0xcfa602,_0x641537){_0x641537(null,path['join'](config[_0xff01('0x24')],_0xff01('0x2f')));},'filename':function(_0x1b3280,_0x2037e4,_0x1a2903){_0x1a2903(null,util[_0xff01('0x26')](_0xff01('0x27'),Date['now'](),_0x2037e4[_0xff01('0x29')]));}})});router['post'](_0xff01('0x13'),upload['single'](_0xff01('0x2b')),controller[_0xff01('0x30')]);var upload=multer({'storage':multer[_0xff01('0x23')]({'destination':function(_0x292075,_0x57728b,_0x5e2eb4){_0x5e2eb4(null,path[_0xff01('0x2d')](config[_0xff01('0x24')],'server/files/images/avatars/'));},'filename':function(_0x12c7be,_0x28c8cc,_0x805752){_0x805752(null,util[_0xff01('0x26')](_0xff01('0x27'),Date['now'](),_0x28c8cc['originalname']));}})});router[_0xff01('0x1f')]('/:id/system_avatar',upload[_0xff01('0x2a')]('file'),controller['addSystemAvatar']);router[_0xff01('0x1f')](_0xff01('0x31'),controller[_0xff01('0x32')]);const offlineUploadMulter=multer({'storage':multer[_0xff01('0x23')]({'destination':function(_0x1699d3,_0x2ad094,_0x43acd4){const _0xd6074f=path[_0xff01('0x2d')](config[_0xff01('0x24')],_0xff01('0x33'),_0xff01('0x34'),_0xff01('0x35'));fs_extra[_0xff01('0x36')](_0xd6074f,function(){_0x43acd4(null,_0xd6074f);});},'filename':function(_0x48a415,_0x4661fb,_0x343e6e){const _0x533783=_0x4661fb[_0xff01('0x29')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x23e2c0=path[_0xff01('0x37')](_0x533783);const _0x8c9e1b=Date['now']()+'-'+_0x533783[_0xff01('0x38')](_0x23e2c0,'')+_0x23e2c0;_0x343e6e(null,_0x8c9e1b);}})});router[_0xff01('0x1f')](_0xff01('0x39'),offlineUploadMulter[_0xff01('0x3a')](),controller[_0xff01('0x3b')]);router['post']('/:id/interactions',auth['isAuthenticated'](),controller[_0xff01('0x3c')]);router[_0xff01('0x1f')](_0xff01('0x3d'),auth[_0xff01('0xa')](),controller['addApplications']);router[_0xff01('0x1f')](_0xff01('0x1a'),auth['isAuthenticated'](),controller['addProactiveActions']);router[_0xff01('0x1f')](_0xff01('0x1e'),auth[_0xff01('0xa')](),controller[_0xff01('0x3e')]);router[_0xff01('0x3f')]('/:id',auth[_0xff01('0xa')](),controller[_0xff01('0x40')]);router[_0xff01('0x41')]('/:id',auth[_0xff01('0xa')](),controller['destroy']);router[_0xff01('0x41')](_0xff01('0x42'),auth['isAuthenticated'](),controller[_0xff01('0x43')]);router[_0xff01('0x41')](_0xff01('0xe'),auth[_0xff01('0xa')](),controller[_0xff01('0x44')]);router[_0xff01('0x41')](_0xff01('0x1e'),auth['isAuthenticated'](),controller[_0xff01('0x45')]);module[_0xff01('0x46')]=router;
\ No newline at end of file
+var _0xacba=['index','get','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/proactive_actions','getProactiveActions','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','join','root','server/files/images/logos/','now','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','%s-%s','addAvatar','format','addCustomerAvatar','addSystemAvatar','server/files','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','/:id/dispositions','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xacba,0xd5));var _0xaacb=function(_0x597c94,_0x2a00ba){_0x597c94=_0x597c94-0x0;var _0x26258d=_0xacba[_0x597c94];return _0x26258d;};'use strict';var multer=require(_0xaacb('0x0'));var util=require(_0xaacb('0x1'));var path=require('path');var timeout=require(_0xaacb('0x2'));var express=require(_0xaacb('0x3'));var router=express[_0xaacb('0x4')]();var fs_extra=require(_0xaacb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xaacb('0x6'));var config=require(_0xaacb('0x7'));var controller=require('./chatWebsite.controller');router['get']('/',auth[_0xaacb('0x8')](),controller[_0xaacb('0x9')]);router[_0xaacb('0xa')](_0xaacb('0xb'),auth[_0xaacb('0x8')](),controller[_0xaacb('0xc')]);router[_0xaacb('0xa')](_0xaacb('0xd'),auth['isAuthenticated'](),controller[_0xaacb('0xe')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xaacb('0xf')]);router[_0xaacb('0xa')](_0xaacb('0x10'),auth[_0xaacb('0x8')](),controller[_0xaacb('0x11')]);router[_0xaacb('0xa')](_0xaacb('0x12'),controller[_0xaacb('0x13')]);router[_0xaacb('0xa')](_0xaacb('0x14'),controller[_0xaacb('0x15')]);router[_0xaacb('0xa')](_0xaacb('0x16'),controller[_0xaacb('0x17')]);router['get'](_0xaacb('0x18'),controller[_0xaacb('0x19')]);router[_0xaacb('0xa')](_0xaacb('0x1a'),auth['isAuthenticated'](),controller['getInteractions']);router['get'](_0xaacb('0x1b'),controller[_0xaacb('0x1c')]);router[_0xaacb('0xa')]('/:id/applications',auth[_0xaacb('0x8')](),controller['getApplications']);router[_0xaacb('0xa')](_0xaacb('0x1d'),auth[_0xaacb('0x8')](),controller[_0xaacb('0x1e')]);router['get']('/:id/fields',controller['getFields']);router['get'](_0xaacb('0x1f'),auth['isAuthenticated'](),controller[_0xaacb('0x20')]);router[_0xaacb('0xa')](_0xaacb('0x21'),auth[_0xaacb('0x8')](),controller[_0xaacb('0x22')]);router[_0xaacb('0x23')]('/',auth['isAuthenticated'](),controller[_0xaacb('0x24')]);router[_0xaacb('0x23')]('/:id/dispositions',auth[_0xaacb('0x8')](),controller[_0xaacb('0x25')]);router[_0xaacb('0x23')]('/:id/canned_answers',auth[_0xaacb('0x8')](),controller[_0xaacb('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x33984f,_0x2bd2d5,_0x208f36){_0x208f36(null,path[_0xaacb('0x27')](config[_0xaacb('0x28')],_0xaacb('0x29')));},'filename':function(_0x4f8525,_0x249d0e,_0x3f4eb8){_0x3f4eb8(null,util['format']('%s-%s',Date[_0xaacb('0x2a')](),_0x249d0e[_0xaacb('0x2b')]));}})});router['post'](_0xaacb('0x12'),upload[_0xaacb('0x2c')](_0xaacb('0x2d')),controller[_0xaacb('0x2e')]);var upload=multer({'storage':multer[_0xaacb('0x2f')]({'destination':function(_0x5126ca,_0x139ff4,_0x14eaa2){_0x14eaa2(null,path[_0xaacb('0x27')](config[_0xaacb('0x28')],_0xaacb('0x30')));},'filename':function(_0x35bbfb,_0xcb0562,_0x5e0c2b){_0x5e0c2b(null,util['format'](_0xaacb('0x31'),Date[_0xaacb('0x2a')](),_0xcb0562[_0xaacb('0x2b')]));}})});router[_0xaacb('0x23')](_0xaacb('0x14'),upload[_0xaacb('0x2c')](_0xaacb('0x2d')),controller[_0xaacb('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xeca509,_0x2796d7,_0xecce27){_0xecce27(null,path['join'](config['root'],_0xaacb('0x30')));},'filename':function(_0xbe2467,_0x3f72f7,_0x234a3b){_0x234a3b(null,util[_0xaacb('0x33')]('%s-%s',Date[_0xaacb('0x2a')](),_0x3f72f7['originalname']));}})});router[_0xaacb('0x23')](_0xaacb('0x16'),upload[_0xaacb('0x2c')]('file'),controller[_0xaacb('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x171917,_0x400de7,_0x86dc28){_0x86dc28(null,path[_0xaacb('0x27')](config[_0xaacb('0x28')],_0xaacb('0x30')));},'filename':function(_0x246a6a,_0x525733,_0x5ac8ff){_0x5ac8ff(null,util[_0xaacb('0x33')](_0xaacb('0x31'),Date[_0xaacb('0x2a')](),_0x525733[_0xaacb('0x2b')]));}})});router[_0xaacb('0x23')](_0xaacb('0x18'),upload[_0xaacb('0x2c')]('file'),controller[_0xaacb('0x35')]);router[_0xaacb('0x23')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x2ec3f2,_0x1263a9,_0x3eec42){const _0x34c8af=path[_0xaacb('0x27')](config[_0xaacb('0x28')],_0xaacb('0x36'),'attachments',_0xaacb('0x37'));fs_extra[_0xaacb('0x38')](_0x34c8af,function(){_0x3eec42(null,_0x34c8af);});},'filename':function(_0x34cd00,_0x4b52ab,_0x188ea0){const _0x257048=_0x4b52ab[_0xaacb('0x2b')][_0xaacb('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2a213b=path[_0xaacb('0x3a')](_0x257048);const _0x5056a6=Date['now']()+'-'+_0x257048[_0xaacb('0x39')](_0x2a213b,'')+_0x2a213b;_0x188ea0(null,_0x5056a6);}})});router[_0xaacb('0x23')](_0xaacb('0x3b'),offlineUploadMulter[_0xaacb('0x3c')](),controller[_0xaacb('0x3d')]);router['post']('/:id/interactions',auth[_0xaacb('0x8')](),controller['addInteraction']);router[_0xaacb('0x23')]('/:id/applications',auth[_0xaacb('0x8')](),controller[_0xaacb('0x3e')]);router[_0xaacb('0x23')]('/:id/proactive_actions',auth[_0xaacb('0x8')](),controller[_0xaacb('0x3f')]);router[_0xaacb('0x23')]('/:id/users',auth[_0xaacb('0x8')](),controller[_0xaacb('0x40')]);router[_0xaacb('0x41')](_0xaacb('0xd'),auth['isAuthenticated'](),controller[_0xaacb('0x42')]);router[_0xaacb('0x43')](_0xaacb('0xd'),auth[_0xaacb('0x8')](),controller[_0xaacb('0x44')]);router[_0xaacb('0x43')](_0xaacb('0x45'),auth[_0xaacb('0x8')](),controller[_0xaacb('0x46')]);router[_0xaacb('0x43')]('/:id/canned_answers',auth[_0xaacb('0x8')](),controller[_0xaacb('0x47')]);router[_0xaacb('0x43')](_0xaacb('0x21'),auth['isAuthenticated'](),controller[_0xaacb('0x48')]);module[_0xaacb('0x49')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index fdd674d..0a56903 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x37f6=['expressEndpoint','/client-logs','use','exports','beaver-logger/server','../components/auth/service','../config/environment','Router','env','get','Client-Side\x20logger\x20not\x20found!'];(function(_0x595808,_0x2a5dd0){var _0x4db818=function(_0x560899){while(--_0x560899){_0x595808['push'](_0x595808['shift']());}};_0x4db818(++_0x2a5dd0);}(_0x37f6,0x19b));var _0x637f=function(_0x487131,_0x2c86e8){_0x487131=_0x487131-0x0;var _0xf320ff=_0x37f6[_0x487131];return _0xf320ff;};var beaverLogger=require(_0x637f('0x0'));var express=require('express');var auth=require(_0x637f('0x1'));var config=require(_0x637f('0x2'));var router=express[_0x637f('0x3')]();var isProduction=config[_0x637f('0x4')]==='production'||![];function clientSideLogs(_0x8c82c8,_0x4c138b,_0xad6aea){var _0x3172f1=_0x8c82c8['app'][_0x637f('0x5')]('client-side-logger');if(!_0x3172f1){throw new Error(_0x637f('0x6'));}return beaverLogger[_0x637f('0x7')]({'uri':_0x637f('0x8'),'logger':_0x3172f1,'enableCors':!isProduction})(_0x8c82c8,_0x4c138b,_0xad6aea);}router[_0x637f('0x9')](auth['isAuthenticated'](),clientSideLogs);module[_0x637f('0xa')]=router;
\ No newline at end of file
+var _0x996f=['beaver-logger/server','express','../components/auth/service','../config/environment','Router','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','/client-logs'];(function(_0x44cad0,_0x229ce2){var _0x360e6f=function(_0x5a185e){while(--_0x5a185e){_0x44cad0['push'](_0x44cad0['shift']());}};_0x360e6f(++_0x229ce2);}(_0x996f,0x117));var _0xf996=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x996f[_0x17d9e3];return _0x14192d;};var beaverLogger=require(_0xf996('0x0'));var express=require(_0xf996('0x1'));var auth=require(_0xf996('0x2'));var config=require(_0xf996('0x3'));var router=express[_0xf996('0x4')]();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x473c7f,_0x16f0d6,_0x3c4ffb){var _0xb4cc40=_0x473c7f['app'][_0xf996('0x5')](_0xf996('0x6'));if(!_0xb4cc40){throw new Error(_0xf996('0x7'));}return beaverLogger['expressEndpoint']({'uri':_0xf996('0x8'),'logger':_0xb4cc40,'enableCors':!isProduction})(_0x473c7f,_0x16f0d6,_0x3c4ffb);}router['use'](auth['isAuthenticated'](),clientSideLogs);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 3e81f7f..83bd21a 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 _0x8477=['MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','ENUM','AmazonAWS','MicrosoftAzure','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x8477,0x69));var _0x7847=function(_0x2aee2f,_0xad9887){_0x2aee2f=_0x2aee2f-0x0;var _0x19337f=_0x8477[_0x2aee2f];return _0x19337f;};'use strict';var Sequelize=require(_0x7847('0x0'));module[_0x7847('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x7847('0x2')](_0x7847('0x3'),'Google',_0x7847('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x7847('0x2')](_0x7847('0x5'),_0x7847('0x6'))},'data1':{'type':Sequelize[_0x7847('0x7')],'comment':_0x7847('0x8')},'data2':{'type':Sequelize[_0x7847('0x7')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x7847('0x7')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x7847('0x7')],'comment':_0x7847('0x9')},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x7847('0xa')],'comment':_0x7847('0xb')},'data7':{'type':Sequelize['TEXT'],'comment':_0x7847('0xc')}};
\ No newline at end of file
+var _0x0eaa=['sequelize','STRING','ENUM','AmazonAWS','Google','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'];(function(_0x3f60ce,_0x28c636){var _0x191f4f=function(_0x113a79){while(--_0x113a79){_0x3f60ce['push'](_0x3f60ce['shift']());}};_0x191f4f(++_0x28c636);}(_0x0eaa,0x9c));var _0xa0ea=function(_0x21273e,_0x29e20f){_0x21273e=_0x21273e-0x0;var _0x380679=_0x0eaa[_0x21273e];return _0x380679;};'use strict';var Sequelize=require(_0xa0ea('0x0'));module['exports']={'name':{'type':Sequelize[_0xa0ea('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xa0ea('0x2')](_0xa0ea('0x3'),_0xa0ea('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xa0ea('0x2')](_0xa0ea('0x5'),_0xa0ea('0x6'))},'data1':{'type':Sequelize[_0xa0ea('0x1')],'comment':_0xa0ea('0x7')},'data2':{'type':Sequelize[_0xa0ea('0x1')],'comment':_0xa0ea('0x8')},'data3':{'type':Sequelize[_0xa0ea('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0xa0ea('0x1')],'comment':_0xa0ea('0x9')},'data5':{'type':Sequelize[_0xa0ea('0xa')],'comment':_0xa0ea('0xb')},'data6':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xa0ea('0xa')],'comment':_0xa0ea('0xc')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 80c7c80..a7bb38e 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 _0x9fe7=['undefined','limit','count','Content-Range','update','then','destroy','error','stack','name','send','padEnd','CloudProvider','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','service','MicrosoftAzure','decryptString','data3','catch','show','params','keys','filters','options','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','get','Invalid\x20state\x20parameter','parse','from','state','base64','ascii','isValidIdToken','oauth2Claims','del','code','data5','data6','refresh_token','startRefreshInterval','microsoftAuthorization:success','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset'];(function(_0x256454,_0x13d265){var _0x26172b=function(_0xce4ef9){while(--_0xce4ef9){_0x256454['push'](_0x256454['shift']());}};_0x26172b(++_0x13d265);}(_0x9fe7,0x1cb));var _0x79fe=function(_0x15c663,_0x1d67fd){_0x15c663=_0x15c663-0x0;var _0x1cd1a7=_0x9fe7[_0x15c663];return _0x1cd1a7;};'use strict';var _=require('lodash');var Redis=require(_0x79fe('0x0'));var qs=require(_0x79fe('0x1'));var encryptor=require(_0x79fe('0x2'));var config=require(_0x79fe('0x3'));var logger=require(_0x79fe('0x4'))(_0x79fe('0x5'));var db=require(_0x79fe('0x6'))['db'];var oauth=require(_0x79fe('0x7'));config[_0x79fe('0x8')]=_[_0x79fe('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x79fe('0xa'))(new Redis(config['redis']));var redis=new Redis(config[_0x79fe('0x8')]);function respondWithStatusCode(_0x29c60e,_0x2a4c3d){_0x2a4c3d=_0x2a4c3d||0xcc;return function(_0x3b03d7){if(_0x3b03d7){return _0x29c60e[_0x79fe('0xb')](_0x2a4c3d);}return _0x29c60e[_0x79fe('0xc')](_0x2a4c3d)[_0x79fe('0xd')]();};}function respondWithResult(_0x44a7d3,_0x4bdaea){_0x4bdaea=_0x4bdaea||0xc8;return function(_0xa7a57a){if(_0xa7a57a){return _0x44a7d3[_0x79fe('0xc')](_0x4bdaea)[_0x79fe('0xe')](_0xa7a57a);}};}function respondWithFilteredResult(_0x4911c7,_0x1b9182){return function(_0x2b7c7a){if(_0x2b7c7a){var _0x44d5d0=typeof _0x1b9182[_0x79fe('0xf')]===_0x79fe('0x10')&&typeof _0x1b9182[_0x79fe('0x11')]===_0x79fe('0x10');var _0x34230e=_0x2b7c7a[_0x79fe('0x12')];var _0x5e3925=_0x44d5d0?0x0:_0x1b9182[_0x79fe('0xf')];var _0x5637ab=_0x44d5d0?_0x2b7c7a[_0x79fe('0x12')]:_0x1b9182[_0x79fe('0xf')]+_0x1b9182[_0x79fe('0x11')];var _0x317440;if(_0x5637ab>=_0x34230e){_0x5637ab=_0x34230e;_0x317440=0xc8;}else{_0x317440=0xce;}_0x4911c7[_0x79fe('0xc')](_0x317440);return _0x4911c7['set'](_0x79fe('0x13'),_0x5e3925+'-'+_0x5637ab+'/'+_0x34230e)[_0x79fe('0xe')](_0x2b7c7a);}return null;};}function saveUpdates(_0x4c0151){return function(_0x6081e6){if(_0x6081e6){return _0x6081e6[_0x79fe('0x14')](_0x4c0151)[_0x79fe('0x15')](function(_0x47466e){return _0x47466e;});}return null;};}function removeEntity(_0x3bed71){return function(_0x1ee774){if(_0x1ee774){return _0x1ee774[_0x79fe('0x16')]()[_0x79fe('0x15')](function(){_0x3bed71[_0x79fe('0xc')](0xcc)[_0x79fe('0xd')]();});}};}function handleEntityNotFound(_0xff0a5c){return function(_0x4a3c71){if(!_0x4a3c71){_0xff0a5c['sendStatus'](0x194);}return _0x4a3c71;};}function handleError(_0x1b11f7,_0x48c920){_0x48c920=_0x48c920||0x1f4;return function(_0x98cf4c){logger[_0x79fe('0x17')](_0x98cf4c[_0x79fe('0x18')]);if(_0x98cf4c[_0x79fe('0x19')]){delete _0x98cf4c[_0x79fe('0x19')];}_0x1b11f7['status'](_0x48c920)[_0x79fe('0x1a')](_0x98cf4c);};}function maskClientSecret(_0x5be6f5){return _[_0x79fe('0x1b')](_0x5be6f5['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0x4cb45e,_0x1ef7f8){var _0x2b92ce={},_0x3ca7c5={},_0x4da1a1={'count':0x0,'rows':[]};var _0x30c831=_['map'](db[_0x79fe('0x1c')][_0x79fe('0x1d')],function(_0x3b70dc){return{'name':_0x3b70dc[_0x79fe('0x1e')],'type':_0x3b70dc[_0x79fe('0x1f')][_0x79fe('0x20')]};});_0x3ca7c5[_0x79fe('0x21')]=_[_0x79fe('0x22')](_0x30c831,_0x79fe('0x19'));_0x3ca7c5[_0x79fe('0x23')]=_['keys'](_0x4cb45e['query']);_0x3ca7c5['filters']=_[_0x79fe('0x24')](_0x3ca7c5[_0x79fe('0x21')],_0x3ca7c5[_0x79fe('0x23')]);_0x2b92ce[_0x79fe('0x25')]=_[_0x79fe('0x24')](_0x3ca7c5[_0x79fe('0x21')],qs[_0x79fe('0x26')](_0x4cb45e[_0x79fe('0x23')][_0x79fe('0x26')]));_0x2b92ce['attributes']=_0x2b92ce[_0x79fe('0x25')][_0x79fe('0x27')]?_0x2b92ce[_0x79fe('0x25')]:_0x3ca7c5[_0x79fe('0x21')];if(!_0x4cb45e[_0x79fe('0x23')][_0x79fe('0x28')](_0x79fe('0x29'))){_0x2b92ce['limit']=qs[_0x79fe('0x11')](_0x4cb45e['query'][_0x79fe('0x11')]);_0x2b92ce[_0x79fe('0xf')]=qs[_0x79fe('0xf')](_0x4cb45e['query'][_0x79fe('0xf')]);}_0x2b92ce['order']=qs[_0x79fe('0x2a')](_0x4cb45e[_0x79fe('0x23')][_0x79fe('0x2a')]);_0x2b92ce[_0x79fe('0x2b')]=qs['filters'](_[_0x79fe('0x2c')](_0x4cb45e[_0x79fe('0x23')],_0x3ca7c5['filters']),_0x30c831);if(_0x4cb45e[_0x79fe('0x23')][_0x79fe('0x2d')]){_0x2b92ce['where']=_[_0x79fe('0x2e')](_0x2b92ce[_0x79fe('0x2b')],{'$or':_['map'](_0x30c831,function(_0x21842e){if(_0x21842e[_0x79fe('0x1f')]!==_0x79fe('0x2f')){var _0xc5c049={};_0xc5c049[_0x21842e[_0x79fe('0x19')]]={'$like':'%'+_0x4cb45e['query'][_0x79fe('0x2d')]+'%'};return _0xc5c049;}})});}_0x2b92ce=_['merge']({},_0x2b92ce,_0x4cb45e['options']);var _0x1b4064={'where':_0x2b92ce['where']};return db['CloudProvider'][_0x79fe('0x12')](_0x1b4064)[_0x79fe('0x15')](function(_0x353490){_0x4da1a1[_0x79fe('0x12')]=_0x353490;if(_0x4cb45e[_0x79fe('0x23')][_0x79fe('0x30')]){_0x2b92ce[_0x79fe('0x31')]=[{'all':!![]}];}return db[_0x79fe('0x1c')][_0x79fe('0x32')](_0x2b92ce);})['then'](function(_0x307127){_0x4da1a1['rows']=_[_0x79fe('0x22')](_0x307127,function(_0x38f037){if(_0x38f037[_0x79fe('0x33')]===_0x79fe('0x34')){var _0x44edfe=encryptor[_0x79fe('0x35')](_0x38f037[_0x79fe('0x36')]);_0x38f037[_0x79fe('0x36')]=maskClientSecret(_0x44edfe);}return _0x38f037;});return _0x4da1a1;})[_0x79fe('0x15')](respondWithFilteredResult(_0x1ef7f8,_0x2b92ce))[_0x79fe('0x37')](handleError(_0x1ef7f8,null));};exports[_0x79fe('0x38')]=function(_0x48e6b6,_0x42b889){var _0x3d6486={'raw':!![],'where':{'id':_0x48e6b6[_0x79fe('0x39')]['id']}},_0x806f8c={};_0x806f8c['model']=_['keys'](db['CloudProvider'][_0x79fe('0x1d')]);_0x806f8c[_0x79fe('0x23')]=_[_0x79fe('0x3a')](_0x48e6b6[_0x79fe('0x23')]);_0x806f8c[_0x79fe('0x3b')]=_[_0x79fe('0x24')](_0x806f8c['model'],_0x806f8c[_0x79fe('0x23')]);_0x3d6486[_0x79fe('0x25')]=_[_0x79fe('0x24')](_0x806f8c[_0x79fe('0x21')],qs[_0x79fe('0x26')](_0x48e6b6[_0x79fe('0x23')]['fields']));_0x3d6486[_0x79fe('0x25')]=_0x3d6486[_0x79fe('0x25')]['length']?_0x3d6486[_0x79fe('0x25')]:_0x806f8c[_0x79fe('0x21')];if(_0x48e6b6['query']['includeAll']){_0x3d6486[_0x79fe('0x31')]=[{'all':!![]}];}_0x3d6486=_['merge']({},_0x3d6486,_0x48e6b6[_0x79fe('0x3c')]);return db['CloudProvider'][_0x79fe('0x3d')](_0x3d6486)[_0x79fe('0x15')](handleEntityNotFound(_0x42b889,null))['then'](function(_0xef580f){if(_0xef580f['service']===_0x79fe('0x34')){var _0x1de438=encryptor[_0x79fe('0x35')](_0xef580f[_0x79fe('0x36')]);_0xef580f[_0x79fe('0x36')]=maskClientSecret(_0x1de438);}return _0xef580f;})[_0x79fe('0x15')](respondWithResult(_0x42b889,null))['catch'](handleError(_0x42b889,null));};exports[_0x79fe('0x3e')]=function(_0x44a388,_0x5b7674){if(!_0x44a388[_0x79fe('0x3f')]['name'])throw new Error(_0x79fe('0x40'));if(!_0x44a388[_0x79fe('0x3f')][_0x79fe('0x33')])throw new Error(_0x79fe('0x41'));var _0x20844d=db['CloudProvider'][_0x79fe('0x1d')][_0x79fe('0x33')]['values'];if(!_0x20844d[_0x79fe('0x42')](_0x44a388[_0x79fe('0x3f')][_0x79fe('0x33')]))throw new Error(_0x79fe('0x43')+_0x20844d[_0x79fe('0x44')](',\x20'));if(_0x44a388[_0x79fe('0x3f')][_0x79fe('0x33')]===_0x79fe('0x34')&&_0x44a388[_0x79fe('0x3f')][_0x79fe('0x36')]){_0x44a388[_0x79fe('0x3f')]['data3']=encryptor[_0x79fe('0x45')](_0x44a388['body'][_0x79fe('0x36')]);}return db['CloudProvider'][_0x79fe('0x3e')](_0x44a388['body'],{})[_0x79fe('0x15')](respondWithResult(_0x5b7674,0xc9))[_0x79fe('0x37')](handleError(_0x5b7674,null));};exports[_0x79fe('0x14')]=function(_0xc3c6a9,_0x666aa1){if(_0xc3c6a9['body']['id']){delete _0xc3c6a9[_0x79fe('0x3f')]['id'];}return db[_0x79fe('0x1c')][_0x79fe('0x3d')]({'where':{'id':_0xc3c6a9[_0x79fe('0x39')]['id']}})[_0x79fe('0x15')](handleEntityNotFound(_0x666aa1,null))[_0x79fe('0x15')](function(_0x469686){if(_0x469686[_0x79fe('0x33')]===_0x79fe('0x34')&&_0xc3c6a9[_0x79fe('0x3f')][_0x79fe('0x36')]){_0xc3c6a9['body'][_0x79fe('0x36')]=encryptor['encryptString'](_0xc3c6a9['body'][_0x79fe('0x36')]);}return _0x469686;})['then'](saveUpdates(_0xc3c6a9[_0x79fe('0x3f')],null))[_0x79fe('0x15')](respondWithResult(_0x666aa1,null))[_0x79fe('0x37')](handleError(_0x666aa1,null));};exports[_0x79fe('0x16')]=function(_0xc4f798,_0x165c65){return db[_0x79fe('0x1c')][_0x79fe('0x3d')]({'where':{'id':_0xc4f798['params']['id']}})[_0x79fe('0x15')](handleEntityNotFound(_0x165c65,null))['then'](removeEntity(_0x165c65,null))[_0x79fe('0x37')](handleError(_0x165c65,null));};exports[_0x79fe('0x46')]=function(_0x4b3cb7,_0x1e89dc){return db[_0x79fe('0x1c')][_0x79fe('0x47')]({'where':{'id':_0x4b3cb7[_0x79fe('0x39')]['id']},'raw':!![]})[_0x79fe('0x15')](function(_0x53dd6c){if(!_0x53dd6c)return _0x1e89dc['sendStatus'](0x194);return{'url':oauth[_0x79fe('0x48')](_0x53dd6c,_0x4b3cb7[_0x79fe('0x49')]['id'])};})[_0x79fe('0x15')](respondWithResult(_0x1e89dc,null))[_0x79fe('0x37')](handleError(_0x1e89dc,null));};exports['oauth2MicrosoftCallback']=function(_0x1a13f7,_0x5cc57e){var _0x25f5b9=_0x1a13f7[_0x79fe('0x3f')];var _0x531770;var _0x1fc46a;if(_0x25f5b9[_0x79fe('0x17')])throw _0x25f5b9;redis[_0x79fe('0x4a')](_0x25f5b9['state'])[_0x79fe('0x15')](function(_0x9ba262){if(!_0x9ba262)throw new Error(_0x79fe('0x4b'));_0x531770=JSON[_0x79fe('0x4c')](_0x9ba262);var _0x4def11=Buffer[_0x79fe('0x4d')](_0x25f5b9[_0x79fe('0x4e')],_0x79fe('0x4f'))['toString'](_0x79fe('0x50'));_0x1fc46a=JSON[_0x79fe('0x4c')](_0x4def11);if(!oauth[_0x79fe('0x51')](_0x25f5b9['id_token'],_0x531770[_0x79fe('0x52')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x79fe('0x53')](_0x25f5b9['state']);return oauth['getOauth2MicrosoftAccessToken'](_0x25f5b9[_0x79fe('0x54')],_0x531770);})[_0x79fe('0x15')](function(_0x12eb4d){_0x531770[_0x79fe('0x55')]=_0x12eb4d['access_token'];_0x531770[_0x79fe('0x56')]=_0x12eb4d[_0x79fe('0x57')];return db[_0x79fe('0x1c')]['update']({'data5':_0x531770[_0x79fe('0x55')],'data6':_0x531770[_0x79fe('0x56')]},{'where':{'id':_0x531770['id']}});})[_0x79fe('0x15')](function(){oauth[_0x79fe('0x58')](_0x531770);socket['emit'](_0x79fe('0x59'),{'id':_0x1fc46a['id']});return;})['then'](respondWithStatusCode(_0x5cc57e,null))[_0x79fe('0x37')](function(_0x3573de){if(_0x1fc46a){socket[_0x79fe('0x5a')](_0x79fe('0x5b'),{'id':_0x1fc46a['id']});}if(!_0x531770){logger[_0x79fe('0x17')](_0x79fe('0x5c'),_0x3573de);return _0x5cc57e[_0x79fe('0xc')](0x1f4)[_0x79fe('0x1a')](_0x3573de[_0x79fe('0x5d')]);}logger[_0x79fe('0x17')](_0x79fe('0x5e'),_0x531770['id'],JSON['stringify'](_0x3573de));});};
\ No newline at end of file
+var _0xa8e7=['message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','destroy','then','error','stack','name','send','slice','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','includeAll','include','findAll','rows','service','decryptString','data3','catch','show','params','CloudProvider','options','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','join','MicrosoftAzure','encryptString','update','findOne','generateMicrosoftAuthorizationUrl','user','get','Invalid\x20state\x20parameter','parse','from','base64','isValidIdToken','oauth2Claims','del','getOauth2MicrosoftAccessToken','access_token','data6','refresh_token','data5','startRefreshInterval','emit','microsoftAuthorization:error'];(function(_0x32e320,_0x2ad238){var _0x1728d8=function(_0x15890c){while(--_0x15890c){_0x32e320['push'](_0x32e320['shift']());}};_0x1728d8(++_0x2ad238);}(_0xa8e7,0xbb));var _0x7a8e=function(_0x216948,_0xf6d435){_0x216948=_0x216948-0x0;var _0xeea7d8=_0xa8e7[_0x216948];return _0xeea7d8;};'use strict';var _=require(_0x7a8e('0x0'));var Redis=require('ioredis');var qs=require(_0x7a8e('0x1'));var encryptor=require('../../components/encryptor');var config=require(_0x7a8e('0x2'));var logger=require(_0x7a8e('0x3'))(_0x7a8e('0x4'));var db=require(_0x7a8e('0x5'))['db'];var oauth=require(_0x7a8e('0x6'));config['redis']=_[_0x7a8e('0x7')](config[_0x7a8e('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x7a8e('0x9'))(new Redis(config['redis']));var redis=new Redis(config[_0x7a8e('0x8')]);function respondWithStatusCode(_0x11f81b,_0x18af3a){_0x18af3a=_0x18af3a||0xcc;return function(_0x12bbc2){if(_0x12bbc2){return _0x11f81b[_0x7a8e('0xa')](_0x18af3a);}return _0x11f81b[_0x7a8e('0xb')](_0x18af3a)[_0x7a8e('0xc')]();};}function respondWithResult(_0x5e5cc2,_0x460d0e){_0x460d0e=_0x460d0e||0xc8;return function(_0x587dda){if(_0x587dda){return _0x5e5cc2[_0x7a8e('0xb')](_0x460d0e)['json'](_0x587dda);}};}function respondWithFilteredResult(_0x14ef3b,_0x5d8fbe){return function(_0x4f41a1){if(_0x4f41a1){var _0x392cda=typeof _0x5d8fbe[_0x7a8e('0xd')]===_0x7a8e('0xe')&&typeof _0x5d8fbe[_0x7a8e('0xf')]===_0x7a8e('0xe');var _0x4330c6=_0x4f41a1[_0x7a8e('0x10')];var _0x4d9d1d=_0x392cda?0x0:_0x5d8fbe[_0x7a8e('0xd')];var _0x53227a=_0x392cda?_0x4f41a1[_0x7a8e('0x10')]:_0x5d8fbe['offset']+_0x5d8fbe['limit'];var _0x38ee9f;if(_0x53227a>=_0x4330c6){_0x53227a=_0x4330c6;_0x38ee9f=0xc8;}else{_0x38ee9f=0xce;}_0x14ef3b[_0x7a8e('0xb')](_0x38ee9f);return _0x14ef3b['set'](_0x7a8e('0x11'),_0x4d9d1d+'-'+_0x53227a+'/'+_0x4330c6)[_0x7a8e('0x12')](_0x4f41a1);}return null;};}function saveUpdates(_0x1183f7){return function(_0x5513fb){if(_0x5513fb){return _0x5513fb['update'](_0x1183f7)['then'](function(_0x3f8090){return _0x3f8090;});}return null;};}function removeEntity(_0x437c90){return function(_0x543b8b){if(_0x543b8b){return _0x543b8b[_0x7a8e('0x13')]()[_0x7a8e('0x14')](function(){_0x437c90[_0x7a8e('0xb')](0xcc)[_0x7a8e('0xc')]();});}};}function handleEntityNotFound(_0x2b6237){return function(_0x56beb1){if(!_0x56beb1){_0x2b6237['sendStatus'](0x194);}return _0x56beb1;};}function handleError(_0x9de9ad,_0x396606){_0x396606=_0x396606||0x1f4;return function(_0x3b3710){logger[_0x7a8e('0x15')](_0x3b3710[_0x7a8e('0x16')]);if(_0x3b3710[_0x7a8e('0x17')]){delete _0x3b3710[_0x7a8e('0x17')];}_0x9de9ad[_0x7a8e('0xb')](_0x396606)[_0x7a8e('0x18')](_0x3b3710);};}function maskClientSecret(_0x5da981){return _['padEnd'](_0x5da981[_0x7a8e('0x19')](0x0,0x3),0x14,'*');}exports[_0x7a8e('0x1a')]=function(_0x2743d3,_0x4b6f59){var _0x14b6d0={},_0x5d7eb0={},_0x683a5c={'count':0x0,'rows':[]};var _0xd9642a=_['map'](db['CloudProvider'][_0x7a8e('0x1b')],function(_0x547c96){return{'name':_0x547c96[_0x7a8e('0x1c')],'type':_0x547c96[_0x7a8e('0x1d')][_0x7a8e('0x1e')]};});_0x5d7eb0[_0x7a8e('0x1f')]=_[_0x7a8e('0x20')](_0xd9642a,_0x7a8e('0x17'));_0x5d7eb0[_0x7a8e('0x21')]=_[_0x7a8e('0x22')](_0x2743d3[_0x7a8e('0x21')]);_0x5d7eb0[_0x7a8e('0x23')]=_[_0x7a8e('0x24')](_0x5d7eb0[_0x7a8e('0x1f')],_0x5d7eb0[_0x7a8e('0x21')]);_0x14b6d0[_0x7a8e('0x25')]=_[_0x7a8e('0x24')](_0x5d7eb0[_0x7a8e('0x1f')],qs[_0x7a8e('0x26')](_0x2743d3['query']['fields']));_0x14b6d0[_0x7a8e('0x25')]=_0x14b6d0['attributes'][_0x7a8e('0x27')]?_0x14b6d0[_0x7a8e('0x25')]:_0x5d7eb0[_0x7a8e('0x1f')];if(!_0x2743d3[_0x7a8e('0x21')][_0x7a8e('0x28')](_0x7a8e('0x29'))){_0x14b6d0[_0x7a8e('0xf')]=qs['limit'](_0x2743d3['query']['limit']);_0x14b6d0[_0x7a8e('0xd')]=qs['offset'](_0x2743d3[_0x7a8e('0x21')]['offset']);}_0x14b6d0['order']=qs['sort'](_0x2743d3[_0x7a8e('0x21')][_0x7a8e('0x2a')]);_0x14b6d0['where']=qs[_0x7a8e('0x23')](_[_0x7a8e('0x2b')](_0x2743d3[_0x7a8e('0x21')],_0x5d7eb0[_0x7a8e('0x23')]),_0xd9642a);if(_0x2743d3[_0x7a8e('0x21')][_0x7a8e('0x2c')]){_0x14b6d0['where']=_[_0x7a8e('0x2d')](_0x14b6d0[_0x7a8e('0x2e')],{'$or':_['map'](_0xd9642a,function(_0x28bccd){if(_0x28bccd[_0x7a8e('0x1d')]!=='VIRTUAL'){var _0x3c062b={};_0x3c062b[_0x28bccd[_0x7a8e('0x17')]]={'$like':'%'+_0x2743d3[_0x7a8e('0x21')]['filter']+'%'};return _0x3c062b;}})});}_0x14b6d0=_['merge']({},_0x14b6d0,_0x2743d3['options']);var _0x2fc195={'where':_0x14b6d0[_0x7a8e('0x2e')]};return db['CloudProvider']['count'](_0x2fc195)[_0x7a8e('0x14')](function(_0x3d77c1){_0x683a5c[_0x7a8e('0x10')]=_0x3d77c1;if(_0x2743d3[_0x7a8e('0x21')][_0x7a8e('0x2f')]){_0x14b6d0[_0x7a8e('0x30')]=[{'all':!![]}];}return db['CloudProvider'][_0x7a8e('0x31')](_0x14b6d0);})[_0x7a8e('0x14')](function(_0xed8eec){_0x683a5c[_0x7a8e('0x32')]=_[_0x7a8e('0x20')](_0xed8eec,function(_0x521247){if(_0x521247[_0x7a8e('0x33')]==='MicrosoftAzure'){var _0x1c50bf=encryptor[_0x7a8e('0x34')](_0x521247[_0x7a8e('0x35')]);_0x521247[_0x7a8e('0x35')]=maskClientSecret(_0x1c50bf);}return _0x521247;});return _0x683a5c;})['then'](respondWithFilteredResult(_0x4b6f59,_0x14b6d0))[_0x7a8e('0x36')](handleError(_0x4b6f59,null));};exports[_0x7a8e('0x37')]=function(_0x1fae17,_0x1049b1){var _0x5116ca={'raw':!![],'where':{'id':_0x1fae17[_0x7a8e('0x38')]['id']}},_0x449c1b={};_0x449c1b[_0x7a8e('0x1f')]=_[_0x7a8e('0x22')](db[_0x7a8e('0x39')]['rawAttributes']);_0x449c1b['query']=_[_0x7a8e('0x22')](_0x1fae17[_0x7a8e('0x21')]);_0x449c1b[_0x7a8e('0x23')]=_['intersection'](_0x449c1b[_0x7a8e('0x1f')],_0x449c1b[_0x7a8e('0x21')]);_0x5116ca['attributes']=_[_0x7a8e('0x24')](_0x449c1b[_0x7a8e('0x1f')],qs['fields'](_0x1fae17['query'][_0x7a8e('0x26')]));_0x5116ca[_0x7a8e('0x25')]=_0x5116ca[_0x7a8e('0x25')][_0x7a8e('0x27')]?_0x5116ca[_0x7a8e('0x25')]:_0x449c1b[_0x7a8e('0x1f')];if(_0x1fae17[_0x7a8e('0x21')][_0x7a8e('0x2f')]){_0x5116ca['include']=[{'all':!![]}];}_0x5116ca=_[_0x7a8e('0x2d')]({},_0x5116ca,_0x1fae17[_0x7a8e('0x3a')]);return db[_0x7a8e('0x39')][_0x7a8e('0x3b')](_0x5116ca)[_0x7a8e('0x14')](handleEntityNotFound(_0x1049b1,null))[_0x7a8e('0x14')](function(_0x37c626){if(_0x37c626[_0x7a8e('0x33')]==='MicrosoftAzure'){var _0x3e2483=encryptor[_0x7a8e('0x34')](_0x37c626[_0x7a8e('0x35')]);_0x37c626[_0x7a8e('0x35')]=maskClientSecret(_0x3e2483);}return _0x37c626;})[_0x7a8e('0x14')](respondWithResult(_0x1049b1,null))[_0x7a8e('0x36')](handleError(_0x1049b1,null));};exports[_0x7a8e('0x3c')]=function(_0x1a4818,_0x9a589e){if(!_0x1a4818[_0x7a8e('0x3d')][_0x7a8e('0x17')])throw new Error(_0x7a8e('0x3e'));if(!_0x1a4818[_0x7a8e('0x3d')][_0x7a8e('0x33')])throw new Error(_0x7a8e('0x3f'));var _0x2c5609=db[_0x7a8e('0x39')][_0x7a8e('0x1b')]['service'][_0x7a8e('0x40')];if(!_0x2c5609[_0x7a8e('0x41')](_0x1a4818[_0x7a8e('0x3d')][_0x7a8e('0x33')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x2c5609[_0x7a8e('0x42')](',\x20'));if(_0x1a4818[_0x7a8e('0x3d')][_0x7a8e('0x33')]===_0x7a8e('0x43')&&_0x1a4818['body'][_0x7a8e('0x35')]){_0x1a4818[_0x7a8e('0x3d')][_0x7a8e('0x35')]=encryptor[_0x7a8e('0x44')](_0x1a4818[_0x7a8e('0x3d')]['data3']);}return db[_0x7a8e('0x39')][_0x7a8e('0x3c')](_0x1a4818[_0x7a8e('0x3d')],{})[_0x7a8e('0x14')](respondWithResult(_0x9a589e,0xc9))[_0x7a8e('0x36')](handleError(_0x9a589e,null));};exports[_0x7a8e('0x45')]=function(_0x30c612,_0x14258d){if(_0x30c612[_0x7a8e('0x3d')]['id']){delete _0x30c612[_0x7a8e('0x3d')]['id'];}return db[_0x7a8e('0x39')][_0x7a8e('0x3b')]({'where':{'id':_0x30c612['params']['id']}})[_0x7a8e('0x14')](handleEntityNotFound(_0x14258d,null))[_0x7a8e('0x14')](function(_0xa9174){if(_0xa9174[_0x7a8e('0x33')]===_0x7a8e('0x43')&&_0x30c612[_0x7a8e('0x3d')][_0x7a8e('0x35')]){_0x30c612[_0x7a8e('0x3d')]['data3']=encryptor[_0x7a8e('0x44')](_0x30c612['body'][_0x7a8e('0x35')]);}return _0xa9174;})['then'](saveUpdates(_0x30c612[_0x7a8e('0x3d')],null))['then'](respondWithResult(_0x14258d,null))[_0x7a8e('0x36')](handleError(_0x14258d,null));};exports[_0x7a8e('0x13')]=function(_0x49342f,_0x3c4e69){return db[_0x7a8e('0x39')][_0x7a8e('0x3b')]({'where':{'id':_0x49342f[_0x7a8e('0x38')]['id']}})[_0x7a8e('0x14')](handleEntityNotFound(_0x3c4e69,null))[_0x7a8e('0x14')](removeEntity(_0x3c4e69,null))['catch'](handleError(_0x3c4e69,null));};exports['oauth2MicrosoftAuthorize']=function(_0x3528bf,_0x3ece9c){return db[_0x7a8e('0x39')][_0x7a8e('0x46')]({'where':{'id':_0x3528bf['params']['id']},'raw':!![]})[_0x7a8e('0x14')](function(_0x31ccbc){if(!_0x31ccbc)return _0x3ece9c[_0x7a8e('0xa')](0x194);return{'url':oauth[_0x7a8e('0x47')](_0x31ccbc,_0x3528bf[_0x7a8e('0x48')]['id'])};})[_0x7a8e('0x14')](respondWithResult(_0x3ece9c,null))[_0x7a8e('0x36')](handleError(_0x3ece9c,null));};exports['oauth2MicrosoftCallback']=function(_0x2661a9,_0x5ed0a1){var _0x1bd797=_0x2661a9[_0x7a8e('0x3d')];var _0x2d84e8;var _0x395b06;if(_0x1bd797[_0x7a8e('0x15')])throw _0x1bd797;redis[_0x7a8e('0x49')](_0x1bd797['state'])['then'](function(_0x48b295){if(!_0x48b295)throw new Error(_0x7a8e('0x4a'));_0x2d84e8=JSON[_0x7a8e('0x4b')](_0x48b295);var _0x5f31bb=Buffer[_0x7a8e('0x4c')](_0x1bd797['state'],_0x7a8e('0x4d'))['toString']('ascii');_0x395b06=JSON['parse'](_0x5f31bb);if(!oauth[_0x7a8e('0x4e')](_0x1bd797['id_token'],_0x2d84e8[_0x7a8e('0x4f')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x7a8e('0x50')](_0x1bd797['state']);return oauth[_0x7a8e('0x51')](_0x1bd797['code'],_0x2d84e8);})['then'](function(_0xd542ce){_0x2d84e8['data5']=_0xd542ce[_0x7a8e('0x52')];_0x2d84e8[_0x7a8e('0x53')]=_0xd542ce[_0x7a8e('0x54')];return db[_0x7a8e('0x39')][_0x7a8e('0x45')]({'data5':_0x2d84e8[_0x7a8e('0x55')],'data6':_0x2d84e8[_0x7a8e('0x53')]},{'where':{'id':_0x2d84e8['id']}});})['then'](function(){oauth[_0x7a8e('0x56')](_0x2d84e8);socket[_0x7a8e('0x57')]('microsoftAuthorization:success',{'id':_0x395b06['id']});return;})[_0x7a8e('0x14')](respondWithStatusCode(_0x5ed0a1,null))[_0x7a8e('0x36')](function(_0x39ad2f){if(_0x395b06){socket[_0x7a8e('0x57')](_0x7a8e('0x58'),{'id':_0x395b06['id']});}if(!_0x2d84e8){logger[_0x7a8e('0x15')]('Invalid\x20authentication\x20state\x20parameter',_0x39ad2f);return _0x5ed0a1[_0x7a8e('0xb')](0x1f4)[_0x7a8e('0x18')](_0x39ad2f[_0x7a8e('0x59')]);}logger[_0x7a8e('0x15')](_0x7a8e('0x5a'),_0x2d84e8['id'],JSON[_0x7a8e('0x5b')](_0x39ad2f));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 858151d..1422848 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 _0x255f=['../../config/environment','./cloudProvider.attributes','exports','define','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x42a5df,_0x363535){var _0x1c7939=function(_0x3723bb){while(--_0x3723bb){_0x42a5df['push'](_0x42a5df['shift']());}};_0x1c7939(++_0x363535);}(_0x255f,0x185));var _0xf255=function(_0x4078f2,_0x1c4054){_0x4078f2=_0x4078f2-0x0;var _0xc72235=_0x255f[_0x4078f2];return _0xc72235;};'use strict';var _=require(_0xf255('0x0'));var util=require('util');var logger=require(_0xf255('0x1'))(_0xf255('0x2'));var moment=require(_0xf255('0x3'));var BPromise=require('bluebird');var rp=require(_0xf255('0x4'));var fs=require('fs');var path=require(_0xf255('0x5'));var rimraf=require(_0xf255('0x6'));var config=require(_0xf255('0x7'));var attributes=require(_0xf255('0x8'));module[_0xf255('0x9')]=function(_0xc1d19f,_0x5bbed0){return _0xc1d19f[_0xf255('0xa')]('CloudProvider',attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa23e=['cloud_providers','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./cloudProvider.attributes','exports','define','CloudProvider'];(function(_0xcb5d1,_0x453ddd){var _0x1fa45e=function(_0x1e2eb1){while(--_0x1e2eb1){_0xcb5d1['push'](_0xcb5d1['shift']());}};_0x1fa45e(++_0x453ddd);}(_0xa23e,0x1e1));var _0xea23=function(_0x298259,_0xeb3a87){_0x298259=_0x298259-0x0;var _0x2ffc2e=_0xa23e[_0x298259];return _0x2ffc2e;};'use strict';var _=require(_0xea23('0x0'));var util=require(_0xea23('0x1'));var logger=require(_0xea23('0x2'))('api');var moment=require(_0xea23('0x3'));var BPromise=require('bluebird');var rp=require(_0xea23('0x4'));var fs=require('fs');var path=require(_0xea23('0x5'));var rimraf=require(_0xea23('0x6'));var config=require('../../config/environment');var attributes=require(_0xea23('0x7'));module[_0xea23('0x8')]=function(_0x13e57d,_0x57f90c){return _0x13e57d[_0xea23('0x9')](_0xea23('0xa'),attributes,{'tableName':_0xea23('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index b730b2c..51bb291 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1acc=['lodash','jsonwebtoken','moment','ioredis','request-promise','util','../../config/environment','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','/token','map','type','Dynamics365','data7','/.default','Outlook365','{TENANT_ID}','data2','code','from','stringify','toString','base64','randomBytes','hex','response_type','redirect_uri','form_post','scope','nonce','prompt','login','key','join','oauth2Claims','replace','oauth2/','data1','iss','issuer','aud','audience','isAfter','unix','resolve','data3','CloudProvider','then','refresh_token','data6','data4','decryptString','POST','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','bind','intervals','findAll','all','inspect','exports'];(function(_0x1c1747,_0x5ee61a){var _0x389ff3=function(_0x164bab){while(--_0x164bab){_0x1c1747['push'](_0x1c1747['shift']());}};_0x389ff3(++_0x5ee61a);}(_0x1acc,0x98));var _0xc1ac=function(_0x242e4b,_0x4fecfb){_0x242e4b=_0x242e4b-0x0;var _0x3e8438=_0x1acc[_0x242e4b];return _0x3e8438;};'use strict';var _=require(_0xc1ac('0x0'));var crypto=require('crypto');var jwt=require(_0xc1ac('0x1'));var moment=require(_0xc1ac('0x2'));var Redis=require(_0xc1ac('0x3'));var rp=require(_0xc1ac('0x4'));var util=require(_0xc1ac('0x5'));var encryptor=require('../../components/encryptor');var config=require(_0xc1ac('0x6'));var logger=require('../../config/logger')(_0xc1ac('0x7'));var schedule=require(_0xc1ac('0x8'));var db=require(_0xc1ac('0x9'))['db'];config[_0xc1ac('0xa')]=_[_0xc1ac('0xb')](config[_0xc1ac('0xa')],{'host':_0xc1ac('0xc'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0xc1ac('0xd'),_0xc1ac('0xe'),_0xc1ac('0xf'),'offline_access',_0xc1ac('0x10'),'https://outlook.office.com/POP.AccessAsUser.All',_0xc1ac('0x11')],'Dynamics365':['openid',_0xc1ac('0x12')]};var MICROSOFT_AUTH_ENDPOINT=_0xc1ac('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0xc1ac('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x12ccd9){var _0x1c96f4=_[_0xc1ac('0x15')](AZURE_AUTH_SCOPES[_0x12ccd9[_0xc1ac('0x16')]]);if(_0x12ccd9[_0xc1ac('0x16')]===_0xc1ac('0x17'))_0x1c96f4['push'](_0x12ccd9[_0xc1ac('0x18')]+_0xc1ac('0x19'));return _0x1c96f4['join']('\x20');}function getAccessTokenScope(_0x2ec098){if(_0x2ec098[_0xc1ac('0x16')]===_0xc1ac('0x1a'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x2ec098[_0xc1ac('0x16')]===_0xc1ac('0x17'))return _0x2ec098[_0xc1ac('0x18')]+_0xc1ac('0x19');}function generateMicrosoftAuthorizationUrl(_0x53881a,_0x2d84aa){var _0x5ec7f2=MICROSOFT_AUTH_URL['replace'](_0xc1ac('0x1b'),_0x53881a[_0xc1ac('0x1c')]);var _0x494d56=[_0xc1ac('0x1d'),'id_token'];var _0x16f21a=Buffer[_0xc1ac('0x1e')](JSON[_0xc1ac('0x1f')]({'id':_0x2d84aa}))[_0xc1ac('0x20')](_0xc1ac('0x21'));var _0x704798=crypto[_0xc1ac('0x22')](0x10)[_0xc1ac('0x20')](_0xc1ac('0x23'));var _0x47dd66=getAuthorizationScopes(_0x53881a);var _0x1bc553=[{'key':'client_id','value':_0x53881a['data1']},{'key':_0xc1ac('0x24'),'value':encodeURIComponent(_0x494d56['join']('\x20'))},{'key':_0xc1ac('0x25'),'value':_0x53881a['data4']},{'key':'response_mode','value':_0xc1ac('0x26')},{'key':_0xc1ac('0x27'),'value':encodeURIComponent(_0x47dd66)},{'key':'state','value':_0x16f21a},{'key':_0xc1ac('0x28'),'value':_0x704798},{'key':_0xc1ac('0x29'),'value':_0xc1ac('0x2a')}];var _0x3031f9=_0x5ec7f2+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xc1ac('0x15')](_0x1bc553,function(_0x2fc770){return _0x2fc770[_0xc1ac('0x2b')]+'='+_0x2fc770['value'];})[_0xc1ac('0x2c')]('&');_0x53881a[_0xc1ac('0x2d')]={'issuer':_0x5ec7f2[_0xc1ac('0x2e')](_0xc1ac('0x2f'),''),'audience':_0x53881a[_0xc1ac('0x30')],'state':_0x16f21a,'nonce':_0x704798};redis['set'](_0x16f21a,JSON[_0xc1ac('0x1f')](_0x53881a));return _0x3031f9;}function isValidIdToken(_0x35b537,_0x1541f7){try{var _0x159f55=jwt['decode'](_0x35b537,{'complete':!![]});var _0x21bd0c=_0x159f55['payload'];if(_0x21bd0c[_0xc1ac('0x31')]!==_0x1541f7[_0xc1ac('0x32')])return![];if(_0x21bd0c[_0xc1ac('0x33')]!==_0x1541f7[_0xc1ac('0x34')])return![];if(_0x21bd0c['nonce']!==_0x1541f7[_0xc1ac('0x28')])return![];if(moment()[_0xc1ac('0x35')](moment[_0xc1ac('0x36')](_0x21bd0c['exp'])))return![];return!![];}catch(_0x4d4f8c){throw _0x4d4f8c;}}function refreshOauth2MicrosoftAccessToken(_0x632e71){return Promise[_0xc1ac('0x37')]()['then'](function(){if(_0x632e71[_0xc1ac('0x38')])return _0x632e71;return db[_0xc1ac('0x39')]['findOne']({'where':{'id':_0x632e71['id']},'raw':!![]});})[_0xc1ac('0x3a')](function(_0x3d9e68){var _0x231e76={'grant_type':_0xc1ac('0x3b'),'refresh_token':_0x3d9e68[_0xc1ac('0x3c')],'scope':getAccessTokenScope(_0x3d9e68),'redirect_uri':_0x3d9e68[_0xc1ac('0x3d')],'client_id':_0x3d9e68[_0xc1ac('0x30')],'client_secret':encryptor[_0xc1ac('0x3e')](_0x3d9e68[_0xc1ac('0x38')])};var _0x1a00a7={'method':_0xc1ac('0x3f'),'uri':MICROSOFT_AUTH_URL[_0xc1ac('0x2e')](_0xc1ac('0x1b'),_0x3d9e68[_0xc1ac('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x231e76,'json':!![]};return rp(_0x1a00a7);})[_0xc1ac('0x3a')](function(_0x578c51){_0x632e71[_0xc1ac('0x40')]=_0x578c51[_0xc1ac('0x41')];_0x632e71['data6']=_0x578c51[_0xc1ac('0x3b')];return db['CloudProvider'][_0xc1ac('0x42')]({'data5':_0x632e71[_0xc1ac('0x40')],'data6':_0x632e71[_0xc1ac('0x3c')]},{'where':{'id':_0x632e71['id']}});})[_0xc1ac('0x3a')](function(){return _0x632e71;})[_0xc1ac('0x43')](function(_0x571204){logger[_0xc1ac('0x44')](_0xc1ac('0x45'),_0x632e71['id'],_0x571204);});}function getOauth2MicrosoftAccessToken(_0x5e48f4,_0x17645f){var _0x312ca9={'grant_type':'authorization_code','code':_0x5e48f4,'scope':getAccessTokenScope(_0x17645f),'redirect_uri':_0x17645f['data4'],'client_id':_0x17645f[_0xc1ac('0x30')],'client_secret':encryptor[_0xc1ac('0x3e')](_0x17645f[_0xc1ac('0x38')])};var _0x25dba0={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xc1ac('0x2e')]('{TENANT_ID}',_0x17645f[_0xc1ac('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x312ca9,'json':!![]};return rp(_0x25dba0);}function startRefreshInterval(_0xbaf531){var _0x26d26b=schedule['intervals'];if(_0x26d26b[_0xbaf531['id']])clearInterval(_0x26d26b[_0xbaf531['id']]);_0x26d26b[_0xbaf531['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xc1ac('0x46')](this,{'id':_0xbaf531['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xc1ac('0x47')]=_0x26d26b;}function startAllRefreshIntervals(){return db[_0xc1ac('0x39')][_0xc1ac('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xc1ac('0x3a')](function(_0x1acffc){var _0x247a0e=_0x1acffc[_0xc1ac('0x15')](function(_0x4671e5){return refreshOauth2MicrosoftAccessToken(_0x4671e5)[_0xc1ac('0x3a')](function(_0x55768b){startRefreshInterval(_0x55768b);});});return Promise[_0xc1ac('0x49')](_0x247a0e);})[_0xc1ac('0x43')](function(_0x19bae6){var _0x513a95=_0x19bae6?util[_0xc1ac('0x4a')](_0x19bae6,{'showHidden':![],'depth':null}):'';logger[_0xc1ac('0x44')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x513a95);});}module[_0xc1ac('0x4b')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xce68=['{TENANT_ID}','intervals','bind','findAll','all','error','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','/token','type','Dynamics365','push','data7','/.default','Outlook365','replace','data2','from','stringify','toString','hex','client_id','data1','redirect_uri','data4','scope','state','nonce','login','map','key','value','join','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','aud','isAfter','unix','exp','then','CloudProvider','findOne','refresh_token','data6','decryptString','data3','POST','access_token','update','data5','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code'];(function(_0x18f12c,_0x46e6d0){var _0x4f9382=function(_0x395bd3){while(--_0x395bd3){_0x18f12c['push'](_0x18f12c['shift']());}};_0x4f9382(++_0x46e6d0);}(_0xce68,0xa1));var _0x8ce6=function(_0x2b44ba,_0xa823cc){_0x2b44ba=_0x2b44ba-0x0;var _0xb20c1c=_0xce68[_0x2b44ba];return _0xb20c1c;};'use strict';var _=require(_0x8ce6('0x0'));var crypto=require(_0x8ce6('0x1'));var jwt=require(_0x8ce6('0x2'));var moment=require(_0x8ce6('0x3'));var Redis=require(_0x8ce6('0x4'));var rp=require(_0x8ce6('0x5'));var util=require(_0x8ce6('0x6'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0x8ce6('0x7'))(_0x8ce6('0x8'));var schedule=require(_0x8ce6('0x9'));var db=require(_0x8ce6('0xa'))['db'];config['redis']=_[_0x8ce6('0xb')](config[_0x8ce6('0xc')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x8ce6('0xc')]);var MICROSOFT_AUTH_URL=_0x8ce6('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x8ce6('0xe'),_0x8ce6('0xf'),_0x8ce6('0x10'),'offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All',_0x8ce6('0x11'),_0x8ce6('0x12')],'Dynamics365':[_0x8ce6('0xe'),_0x8ce6('0x13')]};var MICROSOFT_AUTH_ENDPOINT=_0x8ce6('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x8ce6('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x44860b){var _0x328183=_['map'](AZURE_AUTH_SCOPES[_0x44860b[_0x8ce6('0x16')]]);if(_0x44860b[_0x8ce6('0x16')]===_0x8ce6('0x17'))_0x328183[_0x8ce6('0x18')](_0x44860b[_0x8ce6('0x19')]+_0x8ce6('0x1a'));return _0x328183['join']('\x20');}function getAccessTokenScope(_0x2efdb0){if(_0x2efdb0[_0x8ce6('0x16')]===_0x8ce6('0x1b'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x2efdb0['type']===_0x8ce6('0x17'))return _0x2efdb0[_0x8ce6('0x19')]+_0x8ce6('0x1a');}function generateMicrosoftAuthorizationUrl(_0x1757c7,_0x38d71d){var _0x5a94fd=MICROSOFT_AUTH_URL[_0x8ce6('0x1c')]('{TENANT_ID}',_0x1757c7[_0x8ce6('0x1d')]);var _0x5c79bc=['code','id_token'];var _0x3aaec9=Buffer[_0x8ce6('0x1e')](JSON[_0x8ce6('0x1f')]({'id':_0x38d71d}))['toString']('base64');var _0x30c4bd=crypto['randomBytes'](0x10)[_0x8ce6('0x20')](_0x8ce6('0x21'));var _0x21805b=getAuthorizationScopes(_0x1757c7);var _0x3a7ba0=[{'key':_0x8ce6('0x22'),'value':_0x1757c7[_0x8ce6('0x23')]},{'key':'response_type','value':encodeURIComponent(_0x5c79bc['join']('\x20'))},{'key':_0x8ce6('0x24'),'value':_0x1757c7[_0x8ce6('0x25')]},{'key':'response_mode','value':'form_post'},{'key':_0x8ce6('0x26'),'value':encodeURIComponent(_0x21805b)},{'key':_0x8ce6('0x27'),'value':_0x3aaec9},{'key':_0x8ce6('0x28'),'value':_0x30c4bd},{'key':'prompt','value':_0x8ce6('0x29')}];var _0x3c6df3=_0x5a94fd+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x8ce6('0x2a')](_0x3a7ba0,function(_0x3ceb3b){return _0x3ceb3b[_0x8ce6('0x2b')]+'='+_0x3ceb3b[_0x8ce6('0x2c')];})[_0x8ce6('0x2d')]('&');_0x1757c7[_0x8ce6('0x2e')]={'issuer':_0x5a94fd[_0x8ce6('0x1c')](_0x8ce6('0x2f'),''),'audience':_0x1757c7[_0x8ce6('0x23')],'state':_0x3aaec9,'nonce':_0x30c4bd};redis[_0x8ce6('0x30')](_0x3aaec9,JSON[_0x8ce6('0x1f')](_0x1757c7));return _0x3c6df3;}function isValidIdToken(_0xdcc2d6,_0x24ed65){try{var _0x43e6ba=jwt[_0x8ce6('0x31')](_0xdcc2d6,{'complete':!![]});var _0x454802=_0x43e6ba[_0x8ce6('0x32')];if(_0x454802[_0x8ce6('0x33')]!==_0x24ed65[_0x8ce6('0x34')])return![];if(_0x454802[_0x8ce6('0x35')]!==_0x24ed65['audience'])return![];if(_0x454802[_0x8ce6('0x28')]!==_0x24ed65[_0x8ce6('0x28')])return![];if(moment()[_0x8ce6('0x36')](moment[_0x8ce6('0x37')](_0x454802[_0x8ce6('0x38')])))return![];return!![];}catch(_0x490933){throw _0x490933;}}function refreshOauth2MicrosoftAccessToken(_0x3530c0){return Promise['resolve']()[_0x8ce6('0x39')](function(){if(_0x3530c0['data3'])return _0x3530c0;return db[_0x8ce6('0x3a')][_0x8ce6('0x3b')]({'where':{'id':_0x3530c0['id']},'raw':!![]});})[_0x8ce6('0x39')](function(_0x152ab0){var _0x5d82b1={'grant_type':_0x8ce6('0x3c'),'refresh_token':_0x152ab0[_0x8ce6('0x3d')],'scope':getAccessTokenScope(_0x152ab0),'redirect_uri':_0x152ab0[_0x8ce6('0x25')],'client_id':_0x152ab0[_0x8ce6('0x23')],'client_secret':encryptor[_0x8ce6('0x3e')](_0x152ab0[_0x8ce6('0x3f')])};var _0x1a1f52={'method':_0x8ce6('0x40'),'uri':MICROSOFT_AUTH_URL[_0x8ce6('0x1c')]('{TENANT_ID}',_0x152ab0[_0x8ce6('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5d82b1,'json':!![]};return rp(_0x1a1f52);})[_0x8ce6('0x39')](function(_0x3a05f2){_0x3530c0['data5']=_0x3a05f2[_0x8ce6('0x41')];_0x3530c0[_0x8ce6('0x3d')]=_0x3a05f2['refresh_token'];return db['CloudProvider'][_0x8ce6('0x42')]({'data5':_0x3530c0[_0x8ce6('0x43')],'data6':_0x3530c0[_0x8ce6('0x3d')]},{'where':{'id':_0x3530c0['id']}});})[_0x8ce6('0x39')](function(){return _0x3530c0;})['catch'](function(_0x2bcc71){logger['error'](_0x8ce6('0x44'),_0x3530c0['id'],_0x2bcc71);});}function getOauth2MicrosoftAccessToken(_0x4ac5c3,_0x59c43c){var _0x332e20={'grant_type':_0x8ce6('0x45'),'code':_0x4ac5c3,'scope':getAccessTokenScope(_0x59c43c),'redirect_uri':_0x59c43c[_0x8ce6('0x25')],'client_id':_0x59c43c[_0x8ce6('0x23')],'client_secret':encryptor['decryptString'](_0x59c43c[_0x8ce6('0x3f')])};var _0x4005c2={'method':_0x8ce6('0x40'),'uri':MICROSOFT_AUTH_URL[_0x8ce6('0x1c')](_0x8ce6('0x46'),_0x59c43c['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x332e20,'json':!![]};return rp(_0x4005c2);}function startRefreshInterval(_0x5709b8){var _0x59daa2=schedule[_0x8ce6('0x47')];if(_0x59daa2[_0x5709b8['id']])clearInterval(_0x59daa2[_0x5709b8['id']]);_0x59daa2[_0x5709b8['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x8ce6('0x48')](this,{'id':_0x5709b8['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x8ce6('0x47')]=_0x59daa2;}function startAllRefreshIntervals(){return db[_0x8ce6('0x3a')][_0x8ce6('0x49')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x8ce6('0x39')](function(_0x16dc0c){var _0x11999e=_0x16dc0c['map'](function(_0x4bd0b9){return refreshOauth2MicrosoftAccessToken(_0x4bd0b9)['then'](function(_0x17327b){startRefreshInterval(_0x17327b);});});return Promise[_0x8ce6('0x4a')](_0x11999e);})['catch'](function(_0x243d64){var _0x3de3aa=_0x243d64?util['inspect'](_0x243d64,{'showHidden':![],'depth':null}):'';logger[_0x8ce6('0x4b')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x3de3aa);});}module[_0x8ce6('0x4c')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 31b2714..f6da2f5 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 _0xee87=['error','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x3d5df9,_0x5b3623){var _0x50ba39=function(_0x3c0de0){while(--_0x3c0de0){_0x3d5df9['push'](_0x3d5df9['shift']());}};_0x50ba39(++_0x5b3623);}(_0xee87,0x10d));var _0x7ee8=function(_0x1670a8,_0x2184c5){_0x1670a8=_0x1670a8-0x0;var _0x44e1a9=_0xee87[_0x1670a8];return _0x44e1a9;};'use strict';var _=require('lodash');var util=require(_0x7ee8('0x0'));var moment=require(_0x7ee8('0x1'));var BPromise=require(_0x7ee8('0x2'));var rs=require(_0x7ee8('0x3'));var fs=require('fs');var Redis=require(_0x7ee8('0x4'));var db=require(_0x7ee8('0x5'))['db'];var utils=require(_0x7ee8('0x6'));var logger=require(_0x7ee8('0x7'))(_0x7ee8('0x8'));var config=require(_0x7ee8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7ee8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2dfed7,_0x4241bf,_0x2a9ea3){return new BPromise(function(_0x4275fc,_0x287224){return client['request'](_0x2dfed7,_0x2a9ea3)['then'](function(_0x3d984c){logger['info'](_0x7ee8('0xb'),_0x4241bf,_0x7ee8('0xc'));logger[_0x7ee8('0xd')](_0x7ee8('0xe'),_0x4241bf,_0x7ee8('0xc'),JSON[_0x7ee8('0xf')](_0x3d984c));if(_0x3d984c['error']){if(_0x3d984c['error'][_0x7ee8('0x10')]===0x1f4){logger[_0x7ee8('0x11')](_0x7ee8('0xb'),_0x4241bf,_0x3d984c[_0x7ee8('0x11')][_0x7ee8('0x12')]);return _0x287224(_0x3d984c[_0x7ee8('0x11')][_0x7ee8('0x12')]);}logger[_0x7ee8('0x11')](_0x7ee8('0xb'),_0x4241bf,_0x3d984c[_0x7ee8('0x11')][_0x7ee8('0x12')]);return _0x4275fc(_0x3d984c[_0x7ee8('0x11')][_0x7ee8('0x12')]);}else{logger[_0x7ee8('0x13')](_0x7ee8('0xb'),_0x4241bf,_0x7ee8('0xc'));_0x4275fc(_0x3d984c[_0x7ee8('0x14')][_0x7ee8('0x12')]);}})[_0x7ee8('0x15')](function(_0x3de0b8){logger[_0x7ee8('0x11')](_0x7ee8('0xb'),_0x4241bf,_0x3de0b8);_0x287224(_0x3de0b8);});});}
\ No newline at end of file
+var _0xe2cf=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x1520fb,_0x3e0f16){var _0x2ff6f9=function(_0x4a7b09){while(--_0x4a7b09){_0x1520fb['push'](_0x1520fb['shift']());}};_0x2ff6f9(++_0x3e0f16);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x5525a7,_0x3437c2){_0x5525a7=_0x5525a7-0x0;var _0x3503dc=_0xe2cf[_0x5525a7];return _0x3503dc;};'use strict';var _=require('lodash');var util=require(_0xfe2c('0x0'));var moment=require('moment');var BPromise=require(_0xfe2c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe2c('0x2'));var db=require(_0xfe2c('0x3'))['db'];var utils=require(_0xfe2c('0x4'));var logger=require(_0xfe2c('0x5'))('rpc');var config=require(_0xfe2c('0x6'));var jayson=require(_0xfe2c('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e0b97,_0x417bc4,_0x5e5b46){return new BPromise(function(_0x485a24,_0x30aafe){return client[_0xfe2c('0x8')](_0x4e0b97,_0x5e5b46)[_0xfe2c('0x9')](function(_0x562414){logger['info'](_0xfe2c('0xa'),_0x417bc4,_0xfe2c('0xb'));logger['debug'](_0xfe2c('0xc'),_0x417bc4,_0xfe2c('0xb'),JSON[_0xfe2c('0xd')](_0x562414));if(_0x562414[_0xfe2c('0xe')]){if(_0x562414[_0xfe2c('0xe')][_0xfe2c('0xf')]===0x1f4){logger[_0xfe2c('0xe')]('CloudProvider,\x20%s,\x20%s',_0x417bc4,_0x562414['error']['message']);return _0x30aafe(_0x562414['error'][_0xfe2c('0x10')]);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x417bc4,_0x562414[_0xfe2c('0xe')][_0xfe2c('0x10')]);return _0x485a24(_0x562414[_0xfe2c('0xe')][_0xfe2c('0x10')]);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0x417bc4,_0xfe2c('0xb'));_0x485a24(_0x562414[_0xfe2c('0x11')][_0xfe2c('0x10')]);}})[_0xfe2c('0x12')](function(_0x565f40){logger[_0xfe2c('0xe')](_0xfe2c('0xa'),_0x417bc4,_0x565f40);_0x30aafe(_0x565f40);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 4dcc7cc..569b321 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x37cc52,_0x459a9b){var _0x2b4a90=function(_0xabcfc7){while(--_0xabcfc7){_0x37cc52['push'](_0x37cc52['shift']());}};_0x2b4a90(++_0x459a9b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4a524a,_0x15c3c8){_0x4a524a=_0x4a524a-0x0;var _0x172f82=_0x5f2f[_0x4a524a];return _0x172f82;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router;
\ No newline at end of file
+var _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x325073,_0x12ef03){var _0x114ad0=function(_0x3df1db){while(--_0x3df1db){_0x325073['push'](_0x325073['shift']());}};_0x114ad0(++_0x12ef03);}(_0xdb28,0x106));var _0x8db2=function(_0x18e1fe,_0x133ecf){_0x18e1fe=_0x18e1fe-0x0;var _0x2c0861=_0xdb28[_0x18e1fe];return _0x2c0861;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 355fe4f..c0b8671 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 _0xe86b=['name','sequelize','exports','STRING'];(function(_0x9f4380,_0xd3505c){var _0x8375a=function(_0x1e61f4){while(--_0x1e61f4){_0x9f4380['push'](_0x9f4380['shift']());}};_0x8375a(++_0xd3505c);}(_0xe86b,0x1c9));var _0xbe86=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xe86b[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0xbe86('0x0'));module[_0xbe86('0x1')]={'name':{'type':Sequelize[_0xbe86('0x2')],'unique':_0xbe86('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xbe86('0x2')]},'companyId':{'type':Sequelize[_0xbe86('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xbe86('0x2')]},'fax':{'type':Sequelize[_0xbe86('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xbe86('0x2')]},'postalCode':{'type':Sequelize[_0xbe86('0x2')]},'city':{'type':Sequelize[_0xbe86('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xbe86('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xbe86('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xbe86('0x2')]},'sCity':{'type':Sequelize[_0xbe86('0x2')]},'sCountry':{'type':Sequelize[_0xbe86('0x2')]},'description':{'type':Sequelize[_0xbe86('0x2')]}};
\ No newline at end of file
+var _0xb017=['sequelize','exports','STRING','name'];(function(_0x528396,_0x468b1b){var _0x5941dd=function(_0x2af6f9){while(--_0x2af6f9){_0x528396['push'](_0x528396['shift']());}};_0x5941dd(++_0x468b1b);}(_0xb017,0x178));var _0x7b01=function(_0x258e56,_0x173e54){_0x258e56=_0x258e56-0x0;var _0x459d1e=_0xb017[_0x258e56];return _0x459d1e;};'use strict';var Sequelize=require(_0x7b01('0x0'));module[_0x7b01('0x1')]={'name':{'type':Sequelize[_0x7b01('0x2')],'unique':_0x7b01('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x7b01('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x7b01('0x2')]},'phone':{'type':Sequelize[_0x7b01('0x2')]},'fax':{'type':Sequelize[_0x7b01('0x2')]},'type':{'type':Sequelize[_0x7b01('0x2')]},'street':{'type':Sequelize[_0x7b01('0x2')]},'postalCode':{'type':Sequelize[_0x7b01('0x2')]},'city':{'type':Sequelize[_0x7b01('0x2')]},'country':{'type':Sequelize[_0x7b01('0x2')]},'email':{'type':Sequelize[_0x7b01('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x7b01('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x7b01('0x2')]},'sCountry':{'type':Sequelize[_0x7b01('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 4b8802c..ac1406b 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 _0x64bc=['squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','UserProfileResource','error','name','send','index','describe','keys','query','model','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','filter','options','CmCompany','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','addContacts','CmContact','ids','omit','getContacts','findOne','rawAttributes','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash'];(function(_0x1217ba,_0x5a4279){var _0x384efc=function(_0x317313){while(--_0x317313){_0x1217ba['push'](_0x1217ba['shift']());}};_0x384efc(++_0x5a4279);}(_0x64bc,0xfa));var _0xc64b=function(_0x29ff6c,_0x28c51e){_0x29ff6c=_0x29ff6c-0x0;var _0x40c33d=_0x64bc[_0x29ff6c];return _0x40c33d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc64b('0x0'));var zipdir=require(_0xc64b('0x1'));var jsonpatch=require(_0xc64b('0x2'));var rp=require('request-promise');var moment=require(_0xc64b('0x3'));var BPromise=require(_0xc64b('0x4'));var Mustache=require('mustache');var util=require(_0xc64b('0x5'));var path=require(_0xc64b('0x6'));var sox=require(_0xc64b('0x7'));var csv=require('to-csv');var ejs=require(_0xc64b('0x8'));var fs=require('fs');var fs_extra=require(_0xc64b('0x9'));var _=require(_0xc64b('0xa'));var squel=require(_0xc64b('0xb'));var crypto=require(_0xc64b('0xc'));var jsforce=require(_0xc64b('0xd'));var deskjs=require(_0xc64b('0xe'));var toCsv=require(_0xc64b('0xf'));var querystring=require(_0xc64b('0x10'));var Papa=require('papaparse');var Redis=require(_0xc64b('0x11'));var authService=require(_0xc64b('0x12'));var qs=require(_0xc64b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc64b('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc64b('0x15'));var licenseUtil=require(_0xc64b('0x16'));var db=require(_0xc64b('0x17'))['db'];function respondWithStatusCode(_0x226da8,_0x430b5f){_0x430b5f=_0x430b5f||0xcc;return function(_0x2e318e){if(_0x2e318e){return _0x226da8[_0xc64b('0x18')](_0x430b5f);}return _0x226da8[_0xc64b('0x19')](_0x430b5f)[_0xc64b('0x1a')]();};}function respondWithResult(_0x26c760,_0x3e8fd1){_0x3e8fd1=_0x3e8fd1||0xc8;return function(_0x279012){if(_0x279012){return _0x26c760[_0xc64b('0x19')](_0x3e8fd1)[_0xc64b('0x1b')](_0x279012);}};}function respondWithFilteredResult(_0x21a0fc,_0x4fb469){return function(_0x56211d){if(_0x56211d){var _0xfb0b57=typeof _0x4fb469[_0xc64b('0x1c')]==='undefined'&&typeof _0x4fb469[_0xc64b('0x1d')]===_0xc64b('0x1e');var _0x5d702e=_0x56211d[_0xc64b('0x1f')];var _0x473840=_0xfb0b57?0x0:_0x4fb469[_0xc64b('0x1c')];var _0x47ddb4=_0xfb0b57?_0x56211d[_0xc64b('0x1f')]:_0x4fb469['offset']+_0x4fb469['limit'];var _0x500383;if(_0x47ddb4>=_0x5d702e){_0x47ddb4=_0x5d702e;_0x500383=0xc8;}else{_0x500383=0xce;}_0x21a0fc[_0xc64b('0x19')](_0x500383);return _0x21a0fc[_0xc64b('0x20')](_0xc64b('0x21'),_0x473840+'-'+_0x47ddb4+'/'+_0x5d702e)[_0xc64b('0x1b')](_0x56211d);}return null;};}function patchUpdates(_0x2eb005){return function(_0x4ef7b2){try{jsonpatch[_0xc64b('0x22')](_0x4ef7b2,_0x2eb005,!![]);}catch(_0x4ad8cb){return BPromise[_0xc64b('0x23')](_0x4ad8cb);}return _0x4ef7b2[_0xc64b('0x24')]();};}function saveUpdates(_0x1d58d6,_0x1640db){return function(_0x398471){if(_0x398471){return _0x398471[_0xc64b('0x25')](_0x1d58d6)[_0xc64b('0x26')](function(_0x1e24c9){return _0x1e24c9;});}return null;};}function removeEntity(_0x3bd1b9,_0x3cdd5c){return function(_0x29230b){if(_0x29230b){return _0x29230b['destroy']()['then'](function(){var _0x3839d9=_0x29230b['get']({'plain':!![]});var _0x36e8fc='Companies';return db[_0xc64b('0x27')]['destroy']({'where':{'type':_0x36e8fc,'resourceId':_0x3839d9['id']}})['then'](function(){return _0x29230b;});})[_0xc64b('0x26')](function(){_0x3bd1b9['status'](0xcc)[_0xc64b('0x1a')]();});}};}function handleEntityNotFound(_0x3bb548,_0x129eb1){return function(_0x527793){if(!_0x527793){_0x3bb548[_0xc64b('0x18')](0x194);}return _0x527793;};}function handleError(_0x4f86c4,_0x2d9580){_0x2d9580=_0x2d9580||0x1f4;return function(_0x207202){logger[_0xc64b('0x28')](_0x207202['stack']);if(_0x207202[_0xc64b('0x29')]){delete _0x207202[_0xc64b('0x29')];}_0x4f86c4[_0xc64b('0x19')](_0x2d9580)[_0xc64b('0x2a')](_0x207202);};}exports[_0xc64b('0x2b')]=function(_0x375e70,_0x42a4ef){var _0x4fbabc={},_0x552534={},_0x298d05={'count':0x0,'rows':[]};return db['CmCompany'][_0xc64b('0x2c')]()[_0xc64b('0x26')](function(_0x119c39){_0x552534['model']=_[_0xc64b('0x2d')](_0x119c39);_0x552534[_0xc64b('0x2e')]=_['keys'](_0x375e70[_0xc64b('0x2e')]);_0x552534['filters']=_['intersection'](_0x552534[_0xc64b('0x2f')],_0x552534[_0xc64b('0x2e')]);_0x4fbabc['attributes']=_[_0xc64b('0x30')](_0x552534['model'],qs['fields'](_0x375e70['query']['fields']));_0x4fbabc[_0xc64b('0x31')]=_0x4fbabc[_0xc64b('0x31')][_0xc64b('0x32')]?_0x4fbabc[_0xc64b('0x31')]:_0x552534['model'];if(!_0x375e70['query'][_0xc64b('0x33')](_0xc64b('0x34'))){_0x4fbabc[_0xc64b('0x1d')]=qs[_0xc64b('0x1d')](_0x375e70[_0xc64b('0x2e')][_0xc64b('0x1d')]);_0x4fbabc['offset']=qs['offset'](_0x375e70[_0xc64b('0x2e')][_0xc64b('0x1c')]);}_0x4fbabc[_0xc64b('0x35')]=qs[_0xc64b('0x36')](_0x375e70[_0xc64b('0x2e')][_0xc64b('0x36')]);_0x4fbabc[_0xc64b('0x37')]=qs[_0xc64b('0x38')](_[_0xc64b('0x39')](_0x375e70['query'],_0x552534[_0xc64b('0x38')]),_0x119c39);if(_0x375e70['query']['filter']){_0x4fbabc['where']=_[_0xc64b('0x3a')](_0x4fbabc['where'],{'$or':_[_0xc64b('0x3b')](_0x4fbabc[_0xc64b('0x31')],function(_0x265e32){var _0x25fb97={};_0x25fb97[_0x265e32]={'$like':'%'+_0x375e70[_0xc64b('0x2e')][_0xc64b('0x3c')]+'%'};return _0x25fb97;})});}_0x4fbabc=_[_0xc64b('0x3a')]({},_0x4fbabc,_0x375e70[_0xc64b('0x3d')]);var _0x2042d6={'where':_0x4fbabc['where']};return db[_0xc64b('0x3e')]['count'](_0x2042d6)[_0xc64b('0x26')](function(_0x49e257){_0x298d05[_0xc64b('0x1f')]=_0x49e257;if(_0x375e70['query'][_0xc64b('0x3f')]){_0x4fbabc[_0xc64b('0x40')]=[{'all':!![]}];}return db[_0xc64b('0x3e')][_0xc64b('0x41')](_0x4fbabc);})[_0xc64b('0x26')](function(_0x38ab4f){_0x298d05[_0xc64b('0x42')]=_0x38ab4f;return _0x298d05;})[_0xc64b('0x26')](respondWithFilteredResult(_0x42a4ef,_0x4fbabc))[_0xc64b('0x43')](handleError(_0x42a4ef,null));})[_0xc64b('0x43')](handleError(_0x42a4ef,null));};exports[_0xc64b('0x44')]=function(_0x5de4d4,_0x38477a){var _0x4e7f3a={'raw':![],'where':{'id':_0x5de4d4[_0xc64b('0x45')]['id']}},_0x56fb87={};_0x56fb87[_0xc64b('0x2f')]=_[_0xc64b('0x2d')](db[_0xc64b('0x3e')]['rawAttributes']);_0x56fb87[_0xc64b('0x2e')]=_['keys'](_0x5de4d4[_0xc64b('0x2e')]);_0x56fb87[_0xc64b('0x38')]=_[_0xc64b('0x30')](_0x56fb87[_0xc64b('0x2f')],_0x56fb87['query']);_0x4e7f3a[_0xc64b('0x31')]=_[_0xc64b('0x30')](_0x56fb87[_0xc64b('0x2f')],qs[_0xc64b('0x46')](_0x5de4d4[_0xc64b('0x2e')][_0xc64b('0x46')]));_0x4e7f3a['attributes']=_0x4e7f3a['attributes'][_0xc64b('0x32')]?_0x4e7f3a[_0xc64b('0x31')]:_0x56fb87['model'];if(_0x5de4d4[_0xc64b('0x2e')][_0xc64b('0x3f')]){_0x4e7f3a['include']=[{'all':!![]}];}_0x4e7f3a=_[_0xc64b('0x3a')]({},_0x4e7f3a,_0x5de4d4[_0xc64b('0x3d')]);return db[_0xc64b('0x3e')][_0xc64b('0x47')](_0x4e7f3a)['then'](handleEntityNotFound(_0x38477a,null))[_0xc64b('0x26')](respondWithResult(_0x38477a,null))[_0xc64b('0x43')](handleError(_0x38477a,null));};exports[_0xc64b('0x48')]=function(_0x1f1c19,_0x2df6d0){return db[_0xc64b('0x3e')]['create'](_0x1f1c19[_0xc64b('0x49')],{})[_0xc64b('0x26')](function(_0x353d3d){var _0x33c14b=_0x1f1c19[_0xc64b('0x4a')][_0xc64b('0x4b')]({'plain':!![]});if(!_0x33c14b)throw new Error(_0xc64b('0x4c'));if(_0x33c14b[_0xc64b('0x4d')]===_0xc64b('0x4a')){var _0xdb1f3e=_0x353d3d['get']({'plain':!![]});var _0x416de7=_0xc64b('0x4e');return db[_0xc64b('0x4f')][_0xc64b('0x47')]({'where':{'name':_0x416de7,'userProfileId':_0x33c14b['userProfileId']},'raw':!![]})[_0xc64b('0x26')](function(_0x2a3871){if(_0x2a3871&&_0x2a3871['autoAssociation']===0x0){return db[_0xc64b('0x27')][_0xc64b('0x48')]({'name':_0xdb1f3e[_0xc64b('0x29')],'resourceId':_0xdb1f3e['id'],'type':_0x2a3871[_0xc64b('0x29')],'sectionId':_0x2a3871['id']},{})[_0xc64b('0x26')](function(){return _0x353d3d;});}else{return _0x353d3d;}})[_0xc64b('0x43')](function(_0x4bd4d8){logger[_0xc64b('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bd4d8);throw _0x4bd4d8;});}return _0x353d3d;})[_0xc64b('0x26')](respondWithResult(_0x2df6d0,0xc9))[_0xc64b('0x43')](handleError(_0x2df6d0,null));};exports[_0xc64b('0x25')]=function(_0x58adf6,_0x353b60){if(_0x58adf6[_0xc64b('0x49')]['id']){delete _0x58adf6['body']['id'];}return db[_0xc64b('0x3e')][_0xc64b('0x47')]({'where':{'id':_0x58adf6[_0xc64b('0x45')]['id']}})[_0xc64b('0x26')](handleEntityNotFound(_0x353b60,null))['then'](saveUpdates(_0x58adf6[_0xc64b('0x49')],null))[_0xc64b('0x26')](respondWithResult(_0x353b60,null))[_0xc64b('0x43')](handleError(_0x353b60,null));};exports['destroy']=function(_0xc77ecb,_0x11cf51){return db[_0xc64b('0x3e')][_0xc64b('0x47')]({'where':{'id':_0xc77ecb[_0xc64b('0x45')]['id']}})[_0xc64b('0x26')](handleEntityNotFound(_0x11cf51,null))['then'](removeEntity(_0x11cf51,null))[_0xc64b('0x43')](handleError(_0x11cf51,null));};exports[_0xc64b('0x2c')]=function(_0x497429,_0x3f9645){return db['CmCompany'][_0xc64b('0x2c')]()[_0xc64b('0x26')](respondWithResult(_0x3f9645,null))['catch'](handleError(_0x3f9645,null));};exports[_0xc64b('0x50')]=function(_0x31aaef,_0x762592,_0x4bc2da){return db[_0xc64b('0x51')][_0xc64b('0x47')]({'where':{'id':_0x31aaef[_0xc64b('0x45')]['id']}})[_0xc64b('0x26')](handleEntityNotFound(_0x762592,null))['then'](function(_0x24240f){if(_0x24240f){return _0x24240f[_0xc64b('0x50')](_0x31aaef[_0xc64b('0x49')][_0xc64b('0x52')],_[_0xc64b('0x53')](_0x31aaef[_0xc64b('0x49')],[_0xc64b('0x52'),'id'])||{});}})['then'](respondWithResult(_0x762592,null))[_0xc64b('0x43')](handleError(_0x762592,null));};exports[_0xc64b('0x54')]=function(_0x2cc040,_0x67ce7f,_0x53289a){var _0x1e2ea1={};var _0x3f0c9e={};var _0x36881b;var _0x234cdc;return db[_0xc64b('0x3e')][_0xc64b('0x55')]({'where':{'id':_0x2cc040['params']['id']}})['then'](handleEntityNotFound(_0x67ce7f,null))[_0xc64b('0x26')](function(_0x2b38c7){if(_0x2b38c7){_0x36881b=_0x2b38c7;_0x3f0c9e[_0xc64b('0x2f')]=_[_0xc64b('0x2d')](db[_0xc64b('0x51')][_0xc64b('0x56')]);_0x3f0c9e['query']=_['keys'](_0x2cc040['query']);_0x3f0c9e[_0xc64b('0x38')]=_[_0xc64b('0x30')](_0x3f0c9e[_0xc64b('0x2f')],_0x3f0c9e[_0xc64b('0x2e')]);_0x1e2ea1[_0xc64b('0x31')]=_[_0xc64b('0x30')](_0x3f0c9e[_0xc64b('0x2f')],qs['fields'](_0x2cc040[_0xc64b('0x2e')]['fields']));_0x1e2ea1['attributes']=_0x1e2ea1[_0xc64b('0x31')][_0xc64b('0x32')]?_0x1e2ea1[_0xc64b('0x31')]:_0x3f0c9e[_0xc64b('0x2f')];_0x1e2ea1['order']=qs[_0xc64b('0x36')](_0x2cc040[_0xc64b('0x2e')][_0xc64b('0x36')]);_0x1e2ea1['where']=qs[_0xc64b('0x38')](_['pick'](_0x2cc040['query'],_0x3f0c9e['filters']));if(_0x2cc040[_0xc64b('0x2e')][_0xc64b('0x3c')]){_0x1e2ea1[_0xc64b('0x37')]=_[_0xc64b('0x3a')](_0x1e2ea1['where'],{'$or':_[_0xc64b('0x3b')](_0x1e2ea1[_0xc64b('0x31')],function(_0x5c727d){var _0x19299d={};_0x19299d[_0x5c727d]={'$like':'%'+_0x2cc040[_0xc64b('0x2e')][_0xc64b('0x3c')]+'%'};return _0x19299d;})});}_0x1e2ea1=_[_0xc64b('0x3a')]({},_0x1e2ea1,_0x2cc040[_0xc64b('0x3d')]);return _0x36881b[_0xc64b('0x54')](_0x1e2ea1);}})[_0xc64b('0x26')](function(_0x3a46dd){if(_0x3a46dd){_0x234cdc=_0x3a46dd['length'];if(!_0x2cc040['query'][_0xc64b('0x33')](_0xc64b('0x34'))){_0x1e2ea1[_0xc64b('0x1d')]=qs['limit'](_0x2cc040[_0xc64b('0x2e')]['limit']);_0x1e2ea1[_0xc64b('0x1c')]=qs[_0xc64b('0x1c')](_0x2cc040[_0xc64b('0x2e')][_0xc64b('0x1c')]);}return _0x36881b[_0xc64b('0x54')](_0x1e2ea1);}})['then'](function(_0x4430b5){if(_0x4430b5){return _0x4430b5?{'count':_0x234cdc,'rows':_0x4430b5}:null;}})[_0xc64b('0x26')](respondWithResult(_0x67ce7f,null))[_0xc64b('0x43')](handleError(_0x67ce7f,null));};
\ No newline at end of file
+var _0x191e=['autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','ids','omit','getContacts','findOne','CmContact','order','map','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','then','destroy','get','Companies','error','stack','name','send','index','CmCompany','describe','model','keys','query','intersection','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','rawAttributes','fields','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x191e,0xc1));var _0xe191=function(_0x1443c4,_0x291ebe){_0x1443c4=_0x1443c4-0x0;var _0x493131=_0x191e[_0x1443c4];return _0x493131;};'use strict';var emlformat=require(_0xe191('0x0'));var rimraf=require(_0xe191('0x1'));var zipdir=require(_0xe191('0x2'));var jsonpatch=require(_0xe191('0x3'));var rp=require(_0xe191('0x4'));var moment=require(_0xe191('0x5'));var BPromise=require(_0xe191('0x6'));var Mustache=require(_0xe191('0x7'));var util=require('util');var path=require(_0xe191('0x8'));var sox=require(_0xe191('0x9'));var csv=require(_0xe191('0xa'));var ejs=require(_0xe191('0xb'));var fs=require('fs');var fs_extra=require(_0xe191('0xc'));var _=require(_0xe191('0xd'));var squel=require(_0xe191('0xe'));var crypto=require(_0xe191('0xf'));var jsforce=require(_0xe191('0x10'));var deskjs=require(_0xe191('0x11'));var toCsv=require(_0xe191('0xa'));var querystring=require(_0xe191('0x12'));var Papa=require(_0xe191('0x13'));var Redis=require(_0xe191('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xe191('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe191('0x16'))(_0xe191('0x17'));var utils=require(_0xe191('0x18'));var config=require(_0xe191('0x19'));var licenseUtil=require(_0xe191('0x1a'));var db=require(_0xe191('0x1b'))['db'];function respondWithStatusCode(_0x3ad2c2,_0xc1b3ae){_0xc1b3ae=_0xc1b3ae||0xcc;return function(_0x22017f){if(_0x22017f){return _0x3ad2c2[_0xe191('0x1c')](_0xc1b3ae);}return _0x3ad2c2[_0xe191('0x1d')](_0xc1b3ae)[_0xe191('0x1e')]();};}function respondWithResult(_0xa2e321,_0x13b1b1){_0x13b1b1=_0x13b1b1||0xc8;return function(_0x57d2be){if(_0x57d2be){return _0xa2e321[_0xe191('0x1d')](_0x13b1b1)[_0xe191('0x1f')](_0x57d2be);}};}function respondWithFilteredResult(_0x1b8f5b,_0xd378ff){return function(_0x46f956){if(_0x46f956){var _0x2629aa=typeof _0xd378ff[_0xe191('0x20')]===_0xe191('0x21')&&typeof _0xd378ff[_0xe191('0x22')]==='undefined';var _0x187ab8=_0x46f956[_0xe191('0x23')];var _0x11970e=_0x2629aa?0x0:_0xd378ff['offset'];var _0x554b80=_0x2629aa?_0x46f956['count']:_0xd378ff['offset']+_0xd378ff[_0xe191('0x22')];var _0xdacc3b;if(_0x554b80>=_0x187ab8){_0x554b80=_0x187ab8;_0xdacc3b=0xc8;}else{_0xdacc3b=0xce;}_0x1b8f5b[_0xe191('0x1d')](_0xdacc3b);return _0x1b8f5b[_0xe191('0x24')]('Content-Range',_0x11970e+'-'+_0x554b80+'/'+_0x187ab8)[_0xe191('0x1f')](_0x46f956);}return null;};}function patchUpdates(_0x38d3b2){return function(_0x3f8723){try{jsonpatch['apply'](_0x3f8723,_0x38d3b2,!![]);}catch(_0x555d68){return BPromise[_0xe191('0x25')](_0x555d68);}return _0x3f8723[_0xe191('0x26')]();};}function saveUpdates(_0x22b4b9,_0x47a8a5){return function(_0x3e36a4){if(_0x3e36a4){return _0x3e36a4['update'](_0x22b4b9)[_0xe191('0x27')](function(_0x400cb2){return _0x400cb2;});}return null;};}function removeEntity(_0x3cafe9,_0x33ba4b){return function(_0x383436){if(_0x383436){return _0x383436[_0xe191('0x28')]()[_0xe191('0x27')](function(){var _0x2c0636=_0x383436[_0xe191('0x29')]({'plain':!![]});var _0x52904d=_0xe191('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x52904d,'resourceId':_0x2c0636['id']}})[_0xe191('0x27')](function(){return _0x383436;});})[_0xe191('0x27')](function(){_0x3cafe9[_0xe191('0x1d')](0xcc)[_0xe191('0x1e')]();});}};}function handleEntityNotFound(_0x5a3d16,_0x308020){return function(_0x39d312){if(!_0x39d312){_0x5a3d16[_0xe191('0x1c')](0x194);}return _0x39d312;};}function handleError(_0x49dea5,_0x43b79e){_0x43b79e=_0x43b79e||0x1f4;return function(_0x126058){logger[_0xe191('0x2b')](_0x126058[_0xe191('0x2c')]);if(_0x126058[_0xe191('0x2d')]){delete _0x126058['name'];}_0x49dea5['status'](_0x43b79e)[_0xe191('0x2e')](_0x126058);};}exports[_0xe191('0x2f')]=function(_0x196364,_0x5e2022){var _0x1e87b0={},_0x45efd4={},_0x4620cf={'count':0x0,'rows':[]};return db[_0xe191('0x30')][_0xe191('0x31')]()['then'](function(_0x456a33){_0x45efd4[_0xe191('0x32')]=_[_0xe191('0x33')](_0x456a33);_0x45efd4[_0xe191('0x34')]=_[_0xe191('0x33')](_0x196364['query']);_0x45efd4['filters']=_[_0xe191('0x35')](_0x45efd4[_0xe191('0x32')],_0x45efd4[_0xe191('0x34')]);_0x1e87b0[_0xe191('0x36')]=_[_0xe191('0x35')](_0x45efd4['model'],qs['fields'](_0x196364[_0xe191('0x34')]['fields']));_0x1e87b0[_0xe191('0x36')]=_0x1e87b0[_0xe191('0x36')][_0xe191('0x37')]?_0x1e87b0[_0xe191('0x36')]:_0x45efd4[_0xe191('0x32')];if(!_0x196364[_0xe191('0x34')][_0xe191('0x38')]('nolimit')){_0x1e87b0[_0xe191('0x22')]=qs[_0xe191('0x22')](_0x196364[_0xe191('0x34')][_0xe191('0x22')]);_0x1e87b0[_0xe191('0x20')]=qs[_0xe191('0x20')](_0x196364[_0xe191('0x34')]['offset']);}_0x1e87b0['order']=qs[_0xe191('0x39')](_0x196364[_0xe191('0x34')][_0xe191('0x39')]);_0x1e87b0[_0xe191('0x3a')]=qs[_0xe191('0x3b')](_[_0xe191('0x3c')](_0x196364[_0xe191('0x34')],_0x45efd4[_0xe191('0x3b')]),_0x456a33);if(_0x196364['query'][_0xe191('0x3d')]){_0x1e87b0[_0xe191('0x3a')]=_[_0xe191('0x3e')](_0x1e87b0[_0xe191('0x3a')],{'$or':_['map'](_0x1e87b0[_0xe191('0x36')],function(_0x178b89){var _0x45980a={};_0x45980a[_0x178b89]={'$like':'%'+_0x196364[_0xe191('0x34')][_0xe191('0x3d')]+'%'};return _0x45980a;})});}_0x1e87b0=_[_0xe191('0x3e')]({},_0x1e87b0,_0x196364[_0xe191('0x3f')]);var _0x21a350={'where':_0x1e87b0[_0xe191('0x3a')]};return db[_0xe191('0x30')][_0xe191('0x23')](_0x21a350)['then'](function(_0x2dcd1c){_0x4620cf[_0xe191('0x23')]=_0x2dcd1c;if(_0x196364[_0xe191('0x34')][_0xe191('0x40')]){_0x1e87b0[_0xe191('0x41')]=[{'all':!![]}];}return db[_0xe191('0x30')][_0xe191('0x42')](_0x1e87b0);})[_0xe191('0x27')](function(_0x425c21){_0x4620cf[_0xe191('0x43')]=_0x425c21;return _0x4620cf;})['then'](respondWithFilteredResult(_0x5e2022,_0x1e87b0))['catch'](handleError(_0x5e2022,null));})['catch'](handleError(_0x5e2022,null));};exports['show']=function(_0x35f3db,_0x465ee4){var _0x3135f7={'raw':![],'where':{'id':_0x35f3db['params']['id']}},_0x19e280={};_0x19e280[_0xe191('0x32')]=_['keys'](db['CmCompany'][_0xe191('0x44')]);_0x19e280['query']=_['keys'](_0x35f3db[_0xe191('0x34')]);_0x19e280[_0xe191('0x3b')]=_[_0xe191('0x35')](_0x19e280['model'],_0x19e280['query']);_0x3135f7[_0xe191('0x36')]=_[_0xe191('0x35')](_0x19e280[_0xe191('0x32')],qs['fields'](_0x35f3db['query'][_0xe191('0x45')]));_0x3135f7['attributes']=_0x3135f7['attributes'][_0xe191('0x37')]?_0x3135f7[_0xe191('0x36')]:_0x19e280[_0xe191('0x32')];if(_0x35f3db['query'][_0xe191('0x40')]){_0x3135f7['include']=[{'all':!![]}];}_0x3135f7=_[_0xe191('0x3e')]({},_0x3135f7,_0x35f3db[_0xe191('0x3f')]);return db[_0xe191('0x30')][_0xe191('0x46')](_0x3135f7)[_0xe191('0x27')](handleEntityNotFound(_0x465ee4,null))['then'](respondWithResult(_0x465ee4,null))[_0xe191('0x47')](handleError(_0x465ee4,null));};exports['create']=function(_0x3ce482,_0x555d79){return db[_0xe191('0x30')][_0xe191('0x48')](_0x3ce482[_0xe191('0x49')],{})[_0xe191('0x27')](function(_0x4ed0ae){var _0x537776=_0x3ce482[_0xe191('0x4a')][_0xe191('0x29')]({'plain':!![]});if(!_0x537776)throw new Error(_0xe191('0x4b'));if(_0x537776[_0xe191('0x4c')]===_0xe191('0x4a')){var _0x1931ea=_0x4ed0ae[_0xe191('0x29')]({'plain':!![]});var _0xe23641=_0xe191('0x2a');return db['UserProfileSection'][_0xe191('0x46')]({'where':{'name':_0xe23641,'userProfileId':_0x537776['userProfileId']},'raw':!![]})[_0xe191('0x27')](function(_0x1ed318){if(_0x1ed318&&_0x1ed318[_0xe191('0x4d')]===0x0){return db[_0xe191('0x4e')]['create']({'name':_0x1931ea[_0xe191('0x2d')],'resourceId':_0x1931ea['id'],'type':_0x1ed318[_0xe191('0x2d')],'sectionId':_0x1ed318['id']},{})[_0xe191('0x27')](function(){return _0x4ed0ae;});}else{return _0x4ed0ae;}})['catch'](function(_0x308cf5){logger[_0xe191('0x2b')](_0xe191('0x4f'),_0x308cf5);throw _0x308cf5;});}return _0x4ed0ae;})[_0xe191('0x27')](respondWithResult(_0x555d79,0xc9))[_0xe191('0x47')](handleError(_0x555d79,null));};exports['update']=function(_0x302ff2,_0x286f0a){if(_0x302ff2['body']['id']){delete _0x302ff2[_0xe191('0x49')]['id'];}return db[_0xe191('0x30')][_0xe191('0x46')]({'where':{'id':_0x302ff2[_0xe191('0x50')]['id']}})[_0xe191('0x27')](handleEntityNotFound(_0x286f0a,null))[_0xe191('0x27')](saveUpdates(_0x302ff2[_0xe191('0x49')],null))[_0xe191('0x27')](respondWithResult(_0x286f0a,null))[_0xe191('0x47')](handleError(_0x286f0a,null));};exports['destroy']=function(_0xdb339a,_0x260b22){return db[_0xe191('0x30')][_0xe191('0x46')]({'where':{'id':_0xdb339a['params']['id']}})[_0xe191('0x27')](handleEntityNotFound(_0x260b22,null))[_0xe191('0x27')](removeEntity(_0x260b22,null))['catch'](handleError(_0x260b22,null));};exports[_0xe191('0x31')]=function(_0x4da099,_0x1bcb40){return db[_0xe191('0x30')][_0xe191('0x31')]()[_0xe191('0x27')](respondWithResult(_0x1bcb40,null))[_0xe191('0x47')](handleError(_0x1bcb40,null));};exports[_0xe191('0x51')]=function(_0x31eac0,_0x15a25e,_0x3287b4){return db['CmContact'][_0xe191('0x46')]({'where':{'id':_0x31eac0['params']['id']}})[_0xe191('0x27')](handleEntityNotFound(_0x15a25e,null))[_0xe191('0x27')](function(_0x561003){if(_0x561003){return _0x561003[_0xe191('0x51')](_0x31eac0[_0xe191('0x49')][_0xe191('0x52')],_[_0xe191('0x53')](_0x31eac0[_0xe191('0x49')],['ids','id'])||{});}})[_0xe191('0x27')](respondWithResult(_0x15a25e,null))[_0xe191('0x47')](handleError(_0x15a25e,null));};exports[_0xe191('0x54')]=function(_0x4331e9,_0x34e2d6,_0x2dc04e){var _0xac1edc={};var _0x1a6f14={};var _0x24b5fe;var _0x284f25;return db[_0xe191('0x30')][_0xe191('0x55')]({'where':{'id':_0x4331e9[_0xe191('0x50')]['id']}})[_0xe191('0x27')](handleEntityNotFound(_0x34e2d6,null))[_0xe191('0x27')](function(_0x391c59){if(_0x391c59){_0x24b5fe=_0x391c59;_0x1a6f14[_0xe191('0x32')]=_[_0xe191('0x33')](db[_0xe191('0x56')][_0xe191('0x44')]);_0x1a6f14[_0xe191('0x34')]=_[_0xe191('0x33')](_0x4331e9[_0xe191('0x34')]);_0x1a6f14[_0xe191('0x3b')]=_['intersection'](_0x1a6f14[_0xe191('0x32')],_0x1a6f14[_0xe191('0x34')]);_0xac1edc[_0xe191('0x36')]=_[_0xe191('0x35')](_0x1a6f14[_0xe191('0x32')],qs['fields'](_0x4331e9[_0xe191('0x34')]['fields']));_0xac1edc['attributes']=_0xac1edc['attributes'][_0xe191('0x37')]?_0xac1edc['attributes']:_0x1a6f14[_0xe191('0x32')];_0xac1edc[_0xe191('0x57')]=qs[_0xe191('0x39')](_0x4331e9[_0xe191('0x34')][_0xe191('0x39')]);_0xac1edc[_0xe191('0x3a')]=qs[_0xe191('0x3b')](_['pick'](_0x4331e9[_0xe191('0x34')],_0x1a6f14[_0xe191('0x3b')]));if(_0x4331e9[_0xe191('0x34')][_0xe191('0x3d')]){_0xac1edc['where']=_[_0xe191('0x3e')](_0xac1edc[_0xe191('0x3a')],{'$or':_[_0xe191('0x58')](_0xac1edc[_0xe191('0x36')],function(_0x8b6426){var _0x384ef1={};_0x384ef1[_0x8b6426]={'$like':'%'+_0x4331e9[_0xe191('0x34')]['filter']+'%'};return _0x384ef1;})});}_0xac1edc=_[_0xe191('0x3e')]({},_0xac1edc,_0x4331e9['options']);return _0x24b5fe[_0xe191('0x54')](_0xac1edc);}})[_0xe191('0x27')](function(_0x484d8c){if(_0x484d8c){_0x284f25=_0x484d8c[_0xe191('0x37')];if(!_0x4331e9[_0xe191('0x34')][_0xe191('0x38')](_0xe191('0x59'))){_0xac1edc[_0xe191('0x22')]=qs[_0xe191('0x22')](_0x4331e9[_0xe191('0x34')][_0xe191('0x22')]);_0xac1edc['offset']=qs[_0xe191('0x20')](_0x4331e9['query'][_0xe191('0x20')]);}return _0x24b5fe[_0xe191('0x54')](_0xac1edc);}})[_0xe191('0x27')](function(_0x11cad2){if(_0x11cad2){return _0x11cad2?{'count':_0x284f25,'rows':_0x11cad2}:null;}})[_0xe191('0x27')](respondWithResult(_0x34e2d6,null))['catch'](handleError(_0x34e2d6,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index ad20ede..e319ab2 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 _0x584b=['../../config/environment','./cmCompany.attributes','exports','CmCompany','cm_companies','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x584b,0xe2));var _0xb584=function(_0xfbdff6,_0x2af690){_0xfbdff6=_0xfbdff6-0x0;var _0x4cb9be=_0x584b[_0xfbdff6];return _0x4cb9be;};'use strict';var _=require(_0xb584('0x0'));var util=require(_0xb584('0x1'));var logger=require('../../config/logger')(_0xb584('0x2'));var moment=require(_0xb584('0x3'));var BPromise=require(_0xb584('0x4'));var rp=require(_0xb584('0x5'));var fs=require('fs');var path=require(_0xb584('0x6'));var rimraf=require(_0xb584('0x7'));var config=require(_0xb584('0x8'));var attributes=require(_0xb584('0x9'));module[_0xb584('0xa')]=function(_0x2804a2,_0x312250){return _0x2804a2['define'](_0xb584('0xb'),attributes,{'tableName':_0xb584('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1757=['define','CmCompany','cm_companies','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x353ad2,_0x307542){var _0xe19cb3=function(_0x21d7d2){while(--_0x21d7d2){_0x353ad2['push'](_0x353ad2['shift']());}};_0xe19cb3(++_0x307542);}(_0x1757,0xf5));var _0x7175=function(_0x3b38e5,_0x1f625d){_0x3b38e5=_0x3b38e5-0x0;var _0x496518=_0x1757[_0x3b38e5];return _0x496518;};'use strict';var _=require(_0x7175('0x0'));var util=require(_0x7175('0x1'));var logger=require(_0x7175('0x2'))(_0x7175('0x3'));var moment=require('moment');var BPromise=require(_0x7175('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7175('0x5'));var rimraf=require(_0x7175('0x6'));var config=require(_0x7175('0x7'));var attributes=require('./cmCompany.attributes');module['exports']=function(_0x2cfd9c,_0x2de6ea){return _0x2cfd9c[_0x7175('0x8')](_0x7175('0x9'),attributes,{'tableName':_0x7175('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index ae1858b..a75819a 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 _0x257d=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','message','error','result','catch','lodash','util'];(function(_0x11e82c,_0x4bbc77){var _0x4b3360=function(_0x28246a){while(--_0x28246a){_0x11e82c['push'](_0x11e82c['shift']());}};_0x4b3360(++_0x4bbc77);}(_0x257d,0xd0));var _0xd257=function(_0x9b343a,_0x1bb484){_0x9b343a=_0x9b343a-0x0;var _0x1f4f2b=_0x257d[_0x9b343a];return _0x1f4f2b;};'use strict';var _=require(_0xd257('0x0'));var util=require(_0xd257('0x1'));var moment=require(_0xd257('0x2'));var BPromise=require(_0xd257('0x3'));var rs=require(_0xd257('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd257('0x5'))['db'];var utils=require(_0xd257('0x6'));var logger=require(_0xd257('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd257('0x8')][_0xd257('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e8e02,_0x222fca,_0x134c4b){return new BPromise(function(_0x1a7354,_0x284cc4){return client[_0xd257('0xa')](_0x2e8e02,_0x134c4b)[_0xd257('0xb')](function(_0x583bd1){logger[_0xd257('0xc')](_0xd257('0xd'),_0x222fca,'request\x20sent');logger[_0xd257('0xe')](_0xd257('0xf'),_0x222fca,_0xd257('0x10'),JSON['stringify'](_0x583bd1));if(_0x583bd1['error']){if(_0x583bd1['error']['code']===0x1f4){logger['error'](_0xd257('0xd'),_0x222fca,_0x583bd1['error'][_0xd257('0x11')]);return _0x284cc4(_0x583bd1[_0xd257('0x12')][_0xd257('0x11')]);}logger[_0xd257('0x12')](_0xd257('0xd'),_0x222fca,_0x583bd1['error'][_0xd257('0x11')]);return _0x1a7354(_0x583bd1[_0xd257('0x12')][_0xd257('0x11')]);}else{logger[_0xd257('0xc')]('CmCompany,\x20%s,\x20%s',_0x222fca,_0xd257('0x10'));_0x1a7354(_0x583bd1[_0xd257('0x13')][_0xd257('0x11')]);}})[_0xd257('0x14')](function(_0x5ba8c7){logger[_0xd257('0x12')]('CmCompany,\x20%s,\x20%s',_0x222fca,_0x5ba8c7);_0x284cc4(_0x5ba8c7);});});}
\ No newline at end of file
+var _0x798d=['rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','catch','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x798d,0xba));var _0xd798=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x798d[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd798('0x0'));var BPromise=require(_0xd798('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd798('0x2'))['db'];var utils=require(_0xd798('0x3'));var logger=require('../../config/logger')(_0xd798('0x4'));var config=require(_0xd798('0x5'));var jayson=require(_0xd798('0x6'));var client=jayson[_0xd798('0x7')][_0xd798('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c9aba,_0x36f01f,_0x2786e9){return new BPromise(function(_0x25a6cf,_0x5cd513){return client[_0xd798('0x9')](_0x1c9aba,_0x2786e9)['then'](function(_0x58ad7d){logger[_0xd798('0xa')]('CmCompany,\x20%s,\x20%s',_0x36f01f,_0xd798('0xb'));logger['debug'](_0xd798('0xc'),_0x36f01f,_0xd798('0xb'),JSON[_0xd798('0xd')](_0x58ad7d));if(_0x58ad7d['error']){if(_0x58ad7d[_0xd798('0xe')][_0xd798('0xf')]===0x1f4){logger[_0xd798('0xe')](_0xd798('0x10'),_0x36f01f,_0x58ad7d[_0xd798('0xe')][_0xd798('0x11')]);return _0x5cd513(_0x58ad7d[_0xd798('0xe')][_0xd798('0x11')]);}logger[_0xd798('0xe')](_0xd798('0x10'),_0x36f01f,_0x58ad7d[_0xd798('0xe')][_0xd798('0x11')]);return _0x25a6cf(_0x58ad7d['error'][_0xd798('0x11')]);}else{logger[_0xd798('0xa')]('CmCompany,\x20%s,\x20%s',_0x36f01f,_0xd798('0xb'));_0x25a6cf(_0x58ad7d['result']['message']);}})[_0xd798('0x12')](function(_0x8420cc){logger['error'](_0xd798('0x10'),_0x36f01f,_0x8420cc);_0x5cd513(_0x8420cc);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 1380617..70896c6 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 _0xedc0=['addContacts','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','index','isAuthenticated','/:id','show','/:id/contacts','post','create'];(function(_0x2d2949,_0x24c559){var _0x4bb11f=function(_0x2a75d7){while(--_0x2a75d7){_0x2d2949['push'](_0x2d2949['shift']());}};_0x4bb11f(++_0x24c559);}(_0xedc0,0xf5));var _0x0edc=function(_0xa4f636,_0xaca1b6){_0xa4f636=_0xa4f636-0x0;var _0x37e02a=_0xedc0[_0xa4f636];return _0x37e02a;};'use strict';var multer=require(_0x0edc('0x0'));var util=require('util');var path=require(_0x0edc('0x1'));var timeout=require(_0x0edc('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0edc('0x3'));var auth=require(_0x0edc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0edc('0x5'));var controller=require(_0x0edc('0x6'));router[_0x0edc('0x7')]('/',auth['isAuthenticated'](),controller[_0x0edc('0x8')]);router['get']('/describe',auth[_0x0edc('0x9')](),controller['describe']);router[_0x0edc('0x7')](_0x0edc('0xa'),auth[_0x0edc('0x9')](),controller[_0x0edc('0xb')]);router[_0x0edc('0x7')](_0x0edc('0xc'),auth[_0x0edc('0x9')](),controller['getContacts']);router[_0x0edc('0xd')]('/',auth[_0x0edc('0x9')](),controller[_0x0edc('0xe')]);router[_0x0edc('0xd')](_0x0edc('0xc'),auth['isAuthenticated'](),controller[_0x0edc('0xf')]);router['put']('/:id',auth[_0x0edc('0x9')](),controller[_0x0edc('0x10')]);router[_0x0edc('0x11')](_0x0edc('0xa'),auth[_0x0edc('0x9')](),controller[_0x0edc('0x12')]);module[_0x0edc('0x13')]=router;
\ No newline at end of file
+var _0xfa00=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','post','/:id/contacts','put','update','delete','destroy','exports','multer','util'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0xfa00,0x129));var _0x0fa0=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xfa00[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x0fa0('0x0'));var util=require(_0x0fa0('0x1'));var path=require(_0x0fa0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0fa0('0x3')]();var fs_extra=require(_0x0fa0('0x4'));var auth=require(_0x0fa0('0x5'));var interaction=require(_0x0fa0('0x6'));var config=require(_0x0fa0('0x7'));var controller=require('./cmCompany.controller');router[_0x0fa0('0x8')]('/',auth[_0x0fa0('0x9')](),controller[_0x0fa0('0xa')]);router[_0x0fa0('0x8')](_0x0fa0('0xb'),auth[_0x0fa0('0x9')](),controller[_0x0fa0('0xc')]);router[_0x0fa0('0x8')](_0x0fa0('0xd'),auth[_0x0fa0('0x9')](),controller[_0x0fa0('0xe')]);router['get']('/:id/contacts',auth[_0x0fa0('0x9')](),controller['getContacts']);router['post']('/',auth[_0x0fa0('0x9')](),controller[_0x0fa0('0xf')]);router[_0x0fa0('0x10')](_0x0fa0('0x11'),auth[_0x0fa0('0x9')](),controller['addContacts']);router[_0x0fa0('0x12')](_0x0fa0('0xd'),auth['isAuthenticated'](),controller[_0x0fa0('0x13')]);router[_0x0fa0('0x14')](_0x0fa0('0xd'),auth[_0x0fa0('0x9')](),controller[_0x0fa0('0x15')]);module[_0x0fa0('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 24b58be..33ee115 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 _0x5f66=['sequelize','STRING','INTEGER','DATE'];(function(_0xf6aec0,_0x51ffd6){var _0x59a51b=function(_0x57adc6){while(--_0x57adc6){_0xf6aec0['push'](_0xf6aec0['shift']());}};_0x59a51b(++_0x51ffd6);}(_0x5f66,0x1a0));var _0x65f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5f66[_0x164eca];return _0x2ce562;};'use strict';var _=require('lodash');var Sequelize=require(_0x65f6('0x0'));module['exports']={'firstName':{'type':Sequelize[_0x65f6('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0x65f6('0x1')]},'street':{'type':Sequelize[_0x65f6('0x1')]},'postalCode':{'type':Sequelize[_0x65f6('0x1')]},'city':{'type':Sequelize[_0x65f6('0x1')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x65f6('0x1')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x65f6('0x1')]},'mobile':{'type':Sequelize[_0x65f6('0x1')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x65f6('0x1')]},'facebook':{'type':Sequelize[_0x65f6('0x1')]},'fb_data':{'type':Sequelize[_0x65f6('0x1')]},'twitter':{'type':Sequelize[_0x65f6('0x1')]},'skype':{'type':Sequelize[_0x65f6('0x1')]},'teams':{'type':Sequelize[_0x65f6('0x1')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x65f6('0x1')]},'telegram':{'type':Sequelize[_0x65f6('0x1')]},'UserId':{'type':Sequelize[_0x65f6('0x2')]},'priority':{'type':Sequelize[_0x65f6('0x2')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x65f6('0x3')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x65f6('0x2')]}};
\ No newline at end of file
+var _0x0b0e=['exports','STRING','TEXT','INTEGER','DATE','NOW','lodash'];(function(_0x3a6c69,_0x3c1e13){var _0x26fd6a=function(_0x3d78d6){while(--_0x3d78d6){_0x3a6c69['push'](_0x3a6c69['shift']());}};_0x26fd6a(++_0x3c1e13);}(_0x0b0e,0x187));var _0xe0b0=function(_0x133296,_0xe8ff9a){_0x133296=_0x133296-0x0;var _0x193517=_0x0b0e[_0x133296];return _0x193517;};'use strict';var _=require(_0xe0b0('0x0'));var Sequelize=require('sequelize');module[_0xe0b0('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xe0b0('0x2')]},'street':{'type':Sequelize[_0xe0b0('0x2')]},'postalCode':{'type':Sequelize[_0xe0b0('0x2')]},'city':{'type':Sequelize[_0xe0b0('0x2')]},'country':{'type':Sequelize[_0xe0b0('0x2')]},'dateOfBirth':{'type':Sequelize[_0xe0b0('0x2')]},'description':{'type':Sequelize[_0xe0b0('0x3')]},'phone':{'type':Sequelize[_0xe0b0('0x2')]},'mobile':{'type':Sequelize[_0xe0b0('0x2')]},'fax':{'type':Sequelize[_0xe0b0('0x2')]},'email':{'type':Sequelize[_0xe0b0('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xe0b0('0x2')]},'twitter':{'type':Sequelize[_0xe0b0('0x2')]},'skype':{'type':Sequelize[_0xe0b0('0x2')]},'teams':{'type':Sequelize[_0xe0b0('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xe0b0('0x2')]},'wechat':{'type':Sequelize[_0xe0b0('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xe0b0('0x4')]},'priority':{'type':Sequelize[_0xe0b0('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':Sequelize[_0xe0b0('0x6')]},'dialTimezone':{'type':Sequelize[_0xe0b0('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 362d2af..7ee2152 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 _0xdb9b=['dialTimezone','utcOffset','each','duplicates','$or','show','Tag','omit','format','cf_%d','timezones','$and','pickBy','isEmpty','table','setFields','id\x20=\x20?','toParam','phone','getTags','rawAttributes','merge','options','setTags','ids','getHoppers','includeAll','include','getHopperFinals','ContactId','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','fork','../../components/import/cm/csv','CompanyId','socket_timestamp','json','pid','upload','createReadStream','parse','meta','import','binding','child_process','stringify','exit','getJourney','mail','chat','sms','fax','whatsapp','-createdAt','includes','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','duration','note','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','createdAt','findAndCountAll','Website','Account','closed','closedAt','thirdDisposition','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','openchannel','startCase','Interaction','flatten','slice','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','defaults','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','send','index','CmContact','describe','keys','startsWith','cf_','push','CmCustomField','findOne','trimStart','all','fieldType','type','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','select','field','name','color','from','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','ct.CmContactId\x20=\x20c.id','tools_tags','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','value','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','text','start','filter','isNil','Contact','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','SELECT','clone','DESC','having','t.id\x20IN\x20?','resolve','user','agent','getLists','c.ListId\x20IS\x20NULL','role','sequelize','toString','keyBy','fields','c.firstName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','columnName','displayName','findAll','custom','values','body','get','mergeWith','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappQueueReport'];(function(_0x2a31d1,_0x4a3e5a){var _0x59b150=function(_0x4c601e){while(--_0x4c601e){_0x2a31d1['push'](_0x2a31d1['shift']());}};_0x59b150(++_0x4a3e5a);}(_0xdb9b,0x72));var _0xbdb9=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xdb9b[_0x1035c1];return _0x308d67;};'use strict';var moment=require('moment');var BPromise=require(_0xbdb9('0x0'));var util=require(_0xbdb9('0x1'));var path=require(_0xbdb9('0x2'));var fs=require('fs');var _=require(_0xbdb9('0x3'));var squel=require(_0xbdb9('0x4'));var Papa=require(_0xbdb9('0x5'));var Redis=require(_0xbdb9('0x6'));var qs=require(_0xbdb9('0x7'));var as=require(_0xbdb9('0x8'));var logger=require('../../config/logger')('api');var config=require(_0xbdb9('0x9'));var shared=require('../../config/environment/shared');var db=require('../../mysqldb')['db'];config['redis']=_[_0xbdb9('0xa')](config[_0xbdb9('0xb')],{'host':_0xbdb9('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbdb9('0xb')]));require(_0xbdb9('0xd'))[_0xbdb9('0xe')](socket);function respondWithResult(_0x30b41b,_0x902e1a){_0x902e1a=_0x902e1a||0xc8;return function(_0x1fb63f){if(_0x1fb63f){return _0x30b41b[_0xbdb9('0xf')](_0x902e1a)['json'](_0x1fb63f);}};}function respondWithFilteredResult(_0x24281c,_0x69fb63){return function(_0x1a08eb){if(_0x1a08eb){var _0x1e0a37=typeof _0x69fb63[_0xbdb9('0x10')]===_0xbdb9('0x11')&&typeof _0x69fb63[_0xbdb9('0x12')]===_0xbdb9('0x11');var _0x45fc5a=_0x1a08eb[_0xbdb9('0x13')];var _0x2f8090=_0x1e0a37?0x0:_0x69fb63[_0xbdb9('0x10')];var _0x26b04b=_0x1e0a37?_0x1a08eb['count']:_0x69fb63[_0xbdb9('0x10')]+_0x69fb63[_0xbdb9('0x12')];var _0xbb00cd;if(_0x26b04b>=_0x45fc5a){_0x26b04b=_0x45fc5a;_0xbb00cd=0xc8;}else{_0xbb00cd=0xce;}_0x24281c[_0xbdb9('0xf')](_0xbb00cd);return _0x24281c[_0xbdb9('0x14')](_0xbdb9('0x15'),_0x2f8090+'-'+_0x26b04b+'/'+_0x45fc5a)['json'](_0x1a08eb);}return null;};}function saveUpdates(_0x26e18c){return function(_0x441ead){if(_0x441ead){return _0x441ead[_0xbdb9('0x16')](_0x26e18c)[_0xbdb9('0x17')](function(_0x48ecb0){return _0x48ecb0;});}return null;};}function removeEntity(_0x3b53d5){return function(_0x25da47){if(_0x25da47){return _0x25da47[_0xbdb9('0x18')]()['then'](function(){_0x3b53d5['status'](0xcc)[_0xbdb9('0x19')]();});}};}function handleEntityNotFound(_0x4c25c0){return function(_0xc1048c){if(!_0xc1048c){_0x4c25c0[_0xbdb9('0x1a')](0x194);}return _0xc1048c;};}function handleError(_0x207a12,_0x5ad0ff){_0x5ad0ff=_0x5ad0ff||0x1f4;return function(_0x3b9ba2){logger[_0xbdb9('0x1b')](_0x3b9ba2['stack']);if(_0x3b9ba2['name']){delete _0x3b9ba2['name'];}_0x207a12['status'](_0x5ad0ff)[_0xbdb9('0x1c')](_0x3b9ba2);};}exports[_0xbdb9('0x1d')]=function(_0x2a4117,_0x2c41e2){var _0x3097da={},_0x286724={},_0x433d68={'count':0x0,'rows':[]};return db[_0xbdb9('0x1e')][_0xbdb9('0x1f')]()[_0xbdb9('0x17')](function(_0x136c00){var _0x11fe55=[];for(var _0x422991=0x0;_0x422991
','gmail','yahoo','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','user=','base64','lodash','moment','path','util','node-tnef','../../../config/logger','email','value','address','anonymous','generate','@xcally.com','head','name','substring','indexOf','length','slice','join','Anonymous','split','pop','isEmpty'];(function(_0x768ab5,_0x321eaa){var _0x29001c=function(_0x453c7c){while(--_0x453c7c){_0x768ab5['push'](_0x768ab5['shift']());}};_0x29001c(++_0x321eaa);}(_0xbcb0,0x1a5));var _0x0bcb=function(_0x843ea0,_0x1e859d){_0x843ea0=_0x843ea0-0x0;var _0x300e54=_0xbcb0[_0x843ea0];return _0x300e54;};'use strict';var _=require(_0x0bcb('0x0'));var moment=require(_0x0bcb('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x0bcb('0x2'));var util=require(_0x0bcb('0x3'));var tnef=require(_0x0bcb('0x4'));var logger=require(_0x0bcb('0x5'))(_0x0bcb('0x6'));var config=require('../../../config/environment');function getAddress(_0x5097e5){var _0x21cccd=_['head'](_0x5097e5[_0x0bcb('0x7')]);return _0x21cccd&&_0x21cccd[_0x0bcb('0x8')]?_0x21cccd[_0x0bcb('0x8')]:_0x0bcb('0x9')+random[_0x0bcb('0xa')](0x6)+_0x0bcb('0xb');}function getFirstName(_0x12fa20){var _0x1e98a2=_[_0x0bcb('0xc')](_0x12fa20['value']);if(_0x1e98a2&&_0x1e98a2['name']){if(_0x1e98a2[_0x0bcb('0xd')]==_0x1e98a2[_0x0bcb('0x8')]){return _0x1e98a2[_0x0bcb('0xd')][_0x0bcb('0xe')](0x0,_0x1e98a2[_0x0bcb('0xd')][_0x0bcb('0xf')]('@'));}var _0x505b56=_0x1e98a2[_0x0bcb('0xd')]['split'](/\s+/);return _0x505b56[_0x0bcb('0x10')]>0x1?_0x505b56[_0x0bcb('0x11')](0x0,-0x1)[_0x0bcb('0x12')]('\x20'):_0x1e98a2[_0x0bcb('0xd')];}return _0x0bcb('0x13');}function getLastName(_0x3d6fc3){var _0x35c8be=_[_0x0bcb('0xc')](_0x3d6fc3['value']);if(_0x35c8be&&_0x35c8be[_0x0bcb('0xd')]){var _0x8e2a47=_0x35c8be[_0x0bcb('0xd')][_0x0bcb('0x14')](/\s+/);return _0x8e2a47[_0x0bcb('0x10')]>0x1?_0x8e2a47[_0x0bcb('0x15')]():'';}return'';}function getMails(_0x1f6e16,_0x26d8c3){var _0x3ed9c8='';for(var _0x453818=0x0;_0x453818<_0x26d8c3['value'][_0x0bcb('0x10')];_0x453818+=0x1){if(_0x26d8c3['value'][_0x453818][_0x0bcb('0x8')]!==_0x1f6e16){if(!_[_0x0bcb('0x16')](_0x3ed9c8)){_0x3ed9c8+=',';}_0x3ed9c8+=_0x26d8c3[_0x0bcb('0x7')][_0x453818]['name']||_0x26d8c3[_0x0bcb('0x7')][_0x453818][_0x0bcb('0x8')]||'';_0x3ed9c8+='\x20<';_0x3ed9c8+=_0x26d8c3['value'][_0x453818][_0x0bcb('0x8')]?_0x26d8c3[_0x0bcb('0x7')][_0x453818]['address']:_0x0bcb('0x9')+random[_0x0bcb('0xa')](0x6)+_0x0bcb('0xb');_0x3ed9c8+='>';}}return _0x3ed9c8;}function parseEmail(_0x41c2f3,_0x3ecedb,_0x2ec835){if(_0x3ecedb['html']){var _0x25655b=/