From: Andrea Bianco
Date: Sun, 26 Sep 2021 14:38:17 +0000 (+0200)
Subject: Built motion from commit 5248409e.|2.5.36
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;/%22card-image.png//%27?a=commitdiff_plain;h=1e0989f52f5a9c6cf7df76b28bd8e4c784c73889;p=motion2.git
Built motion from commit 5248409e.|2.5.36
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 4374b04..3c11400 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-09-26T13:12:57.862Z",
+ "time": "2021-09-26T14:20:19.594Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index a95558f..51810bf 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-09-26T13:12:57.862Z",
+ "time": "2021-09-26T14:20:19.594Z",
"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 e4e6f8c..c2d3f03 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 _0x668b=['integration','jscripty','urlForward','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','STRING','contactManager'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x668b,0x1b5));var _0xb668=function(_0x45ce08,_0x59dcc7){_0x45ce08=_0x45ce08-0x0;var _0x23dff2=_0x668b[_0x45ce08];return _0x23dff2;};'use strict';var Sequelize=require(_0xb668('0x0'));module[_0xb668('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xe2fd15){return this[_0xb668('0x2')]('action');}},'action':{'type':Sequelize[_0xb668('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xb668('0x4'),_0xb668('0x5'),'motionbar',_0xb668('0x6'),_0xb668('0x7'),'browser','bot',_0xb668('0x8')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xb668('0x9')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xb668('0xa')},'data2':{'type':Sequelize[_0xb668('0x3')](0x1000),'comment':_0xb668('0xb')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xb668('0xc')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xb668('0x3')](0x1000),'comments':_0xb668('0xd')},'data6':{'type':Sequelize[_0xb668('0x3')],'comments':_0xb668('0xe')},'data7':{'type':Sequelize[_0xb668('0xf')],'comments':_0xb668('0x10')}};
\ No newline at end of file
+var _0x8a54=['jscripty','urlForward','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[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','STRING','contactManager','integration'];(function(_0x25b33e,_0x591343){var _0x3f9855=function(_0x3a77a0){while(--_0x3a77a0){_0x25b33e['push'](_0x25b33e['shift']());}};_0x3f9855(++_0x591343);}(_0x8a54,0xca));var _0x48a5=function(_0x599629,_0x352681){_0x599629=_0x599629-0x0;var _0xaa16e9=_0x8a54[_0x599629];return _0xaa16e9;};'use strict';var Sequelize=require(_0x48a5('0x0'));module[_0x48a5('0x1')]={'name':{'type':Sequelize[_0x48a5('0x2')],'get':function(_0x1a488e){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x48a5('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x48a5('0x4'),_0x48a5('0x5'),'motionbar',_0x48a5('0x6'),_0x48a5('0x7'),'browser','bot',_0x48a5('0x8')]],'msg':_0x48a5('0x9')}},'comment':_0x48a5('0x9')},'data1':{'type':Sequelize[_0x48a5('0x3')](0x1000),'comment':_0x48a5('0xa')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x48a5('0x3')](0x1000),'comment':_0x48a5('0xb')},'data4':{'type':Sequelize[_0x48a5('0x3')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x48a5('0x3')](0x1000),'comments':_0x48a5('0xc')},'data6':{'type':Sequelize['STRING'],'comments':_0x48a5('0xd')},'data7':{'type':Sequelize[_0x48a5('0xe')],'comments':_0x48a5('0xf')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 3bf3752..bcf0ac5 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 _0x343e=['error','stack','send','body','Action','params','find','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','count','set','apply','reject','save','update','then','destroy','end'];(function(_0x25d542,_0x462ad9){var _0x377a7e=function(_0x5bd8ee){while(--_0x5bd8ee){_0x25d542['push'](_0x25d542['shift']());}};_0x377a7e(++_0x462ad9);}(_0x343e,0xd9));var _0xe343=function(_0x434848,_0x26e2bb){_0x434848=_0x434848-0x0;var _0x448e06=_0x343e[_0x434848];return _0x448e06;};'use strict';var emlformat=require(_0xe343('0x0'));var rimraf=require(_0xe343('0x1'));var zipdir=require(_0xe343('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe343('0x3'));var moment=require('moment');var BPromise=require(_0xe343('0x4'));var Mustache=require('mustache');var util=require(_0xe343('0x5'));var path=require(_0xe343('0x6'));var sox=require('sox');var csv=require(_0xe343('0x7'));var ejs=require(_0xe343('0x8'));var fs=require('fs');var fs_extra=require(_0xe343('0x9'));var _=require(_0xe343('0xa'));var squel=require('squel');var crypto=require(_0xe343('0xb'));var jsforce=require(_0xe343('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe343('0x7'));var querystring=require(_0xe343('0xd'));var Papa=require('papaparse');var Redis=require(_0xe343('0xe'));var authService=require(_0xe343('0xf'));var qs=require(_0xe343('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe343('0x11'));var logger=require(_0xe343('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xe343('0x13'));var licenseUtil=require(_0xe343('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x260246,_0x4d0138){_0x4d0138=_0x4d0138||0xcc;return function(_0x1f473d){if(_0x1f473d){return _0x260246[_0xe343('0x15')](_0x4d0138);}return _0x260246[_0xe343('0x16')](_0x4d0138)['end']();};}function respondWithResult(_0x4f8c97,_0x13208b){_0x13208b=_0x13208b||0xc8;return function(_0x308144){if(_0x308144){return _0x4f8c97[_0xe343('0x16')](_0x13208b)[_0xe343('0x17')](_0x308144);}};}function respondWithFilteredResult(_0x390dbc,_0x54c531){return function(_0x10d775){if(_0x10d775){var _0x31632b=typeof _0x54c531[_0xe343('0x18')]==='undefined'&&typeof _0x54c531[_0xe343('0x19')]==='undefined';var _0x583e61=_0x10d775[_0xe343('0x1a')];var _0x429bbe=_0x31632b?0x0:_0x54c531[_0xe343('0x18')];var _0x3d5116=_0x31632b?_0x10d775['count']:_0x54c531[_0xe343('0x18')]+_0x54c531[_0xe343('0x19')];var _0x5bc48b;if(_0x3d5116>=_0x583e61){_0x3d5116=_0x583e61;_0x5bc48b=0xc8;}else{_0x5bc48b=0xce;}_0x390dbc['status'](_0x5bc48b);return _0x390dbc[_0xe343('0x1b')]('Content-Range',_0x429bbe+'-'+_0x3d5116+'/'+_0x583e61)['json'](_0x10d775);}return null;};}function patchUpdates(_0x154215){return function(_0x5d6ded){try{jsonpatch[_0xe343('0x1c')](_0x5d6ded,_0x154215,!![]);}catch(_0xc913fa){return BPromise[_0xe343('0x1d')](_0xc913fa);}return _0x5d6ded[_0xe343('0x1e')]();};}function saveUpdates(_0xc8b6d5,_0x44c597){return function(_0x3ea569){if(_0x3ea569){return _0x3ea569[_0xe343('0x1f')](_0xc8b6d5)[_0xe343('0x20')](function(_0x30f72f){return _0x30f72f;});}return null;};}function removeEntity(_0x4b6b71,_0x25d25a){return function(_0x2ad457){if(_0x2ad457){return _0x2ad457[_0xe343('0x21')]()[_0xe343('0x20')](function(){_0x4b6b71[_0xe343('0x16')](0xcc)[_0xe343('0x22')]();});}};}function handleEntityNotFound(_0x3ae003,_0x15bf1a){return function(_0x55b390){if(!_0x55b390){_0x3ae003[_0xe343('0x15')](0x194);}return _0x55b390;};}function handleError(_0x183426,_0x5b662c){_0x5b662c=_0x5b662c||0x1f4;return function(_0x213f61){logger[_0xe343('0x23')](_0x213f61[_0xe343('0x24')]);if(_0x213f61['name']){delete _0x213f61['name'];}_0x183426[_0xe343('0x16')](_0x5b662c)[_0xe343('0x25')](_0x213f61);};}exports['update']=function(_0x220746,_0x16cc39){if(_0x220746[_0xe343('0x26')]['id']){delete _0x220746['body']['id'];}return db[_0xe343('0x27')]['find']({'where':{'id':_0x220746[_0xe343('0x28')]['id']}})[_0xe343('0x20')](handleEntityNotFound(_0x16cc39,null))[_0xe343('0x20')](saveUpdates(_0x220746[_0xe343('0x26')],null))[_0xe343('0x20')](respondWithResult(_0x16cc39,null))['catch'](handleError(_0x16cc39,null));};exports[_0xe343('0x21')]=function(_0xfd7ff9,_0x23361c){return db[_0xe343('0x27')][_0xe343('0x29')]({'where':{'id':_0xfd7ff9[_0xe343('0x28')]['id']}})[_0xe343('0x20')](handleEntityNotFound(_0x23361c,null))[_0xe343('0x20')](removeEntity(_0x23361c,null))['catch'](handleError(_0x23361c,null));};
\ No newline at end of file
+var _0x4523=['../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','body','Action','find','destroy','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x1d899c,_0x269675){var _0x52ea1f=function(_0x541867){while(--_0x541867){_0x1d899c['push'](_0x1d899c['shift']());}};_0x52ea1f(++_0x269675);}(_0x4523,0x7f));var _0x3452=function(_0x262e4e,_0x16d198){_0x262e4e=_0x262e4e-0x0;var _0x34c5e8=_0x4523[_0x262e4e];return _0x34c5e8;};'use strict';var emlformat=require(_0x3452('0x0'));var rimraf=require(_0x3452('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3452('0x2'));var rp=require(_0x3452('0x3'));var moment=require(_0x3452('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3452('0x5'));var util=require(_0x3452('0x6'));var path=require(_0x3452('0x7'));var sox=require(_0x3452('0x8'));var csv=require('to-csv');var ejs=require(_0x3452('0x9'));var fs=require('fs');var fs_extra=require(_0x3452('0xa'));var _=require(_0x3452('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3452('0xc'));var deskjs=require(_0x3452('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3452('0xe'));var Papa=require(_0x3452('0xf'));var Redis=require(_0x3452('0x10'));var authService=require(_0x3452('0x11'));var qs=require(_0x3452('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3452('0x13'))(_0x3452('0x14'));var utils=require(_0x3452('0x15'));var config=require(_0x3452('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3452('0x17'))['db'];function respondWithStatusCode(_0x421679,_0x176e44){_0x176e44=_0x176e44||0xcc;return function(_0x34be74){if(_0x34be74){return _0x421679['sendStatus'](_0x176e44);}return _0x421679[_0x3452('0x18')](_0x176e44)['end']();};}function respondWithResult(_0x43102b,_0x50c32a){_0x50c32a=_0x50c32a||0xc8;return function(_0x54d06f){if(_0x54d06f){return _0x43102b[_0x3452('0x18')](_0x50c32a)[_0x3452('0x19')](_0x54d06f);}};}function respondWithFilteredResult(_0x119c6a,_0x436d41){return function(_0x494168){if(_0x494168){var _0x22748c=typeof _0x436d41['offset']===_0x3452('0x1a')&&typeof _0x436d41[_0x3452('0x1b')]===_0x3452('0x1a');var _0x3e6f84=_0x494168[_0x3452('0x1c')];var _0x1ddcb3=_0x22748c?0x0:_0x436d41[_0x3452('0x1d')];var _0x1812a6=_0x22748c?_0x494168['count']:_0x436d41[_0x3452('0x1d')]+_0x436d41[_0x3452('0x1b')];var _0x1a1af5;if(_0x1812a6>=_0x3e6f84){_0x1812a6=_0x3e6f84;_0x1a1af5=0xc8;}else{_0x1a1af5=0xce;}_0x119c6a['status'](_0x1a1af5);return _0x119c6a[_0x3452('0x1e')](_0x3452('0x1f'),_0x1ddcb3+'-'+_0x1812a6+'/'+_0x3e6f84)[_0x3452('0x19')](_0x494168);}return null;};}function patchUpdates(_0x52f9a9){return function(_0x5aa601){try{jsonpatch[_0x3452('0x20')](_0x5aa601,_0x52f9a9,!![]);}catch(_0x659014){return BPromise[_0x3452('0x21')](_0x659014);}return _0x5aa601[_0x3452('0x22')]();};}function saveUpdates(_0x4bbb2c,_0x33d963){return function(_0x350ffe){if(_0x350ffe){return _0x350ffe[_0x3452('0x23')](_0x4bbb2c)[_0x3452('0x24')](function(_0x4401a2){return _0x4401a2;});}return null;};}function removeEntity(_0xa05a48,_0x45fd8b){return function(_0x1173ec){if(_0x1173ec){return _0x1173ec['destroy']()['then'](function(){_0xa05a48[_0x3452('0x18')](0xcc)[_0x3452('0x25')]();});}};}function handleEntityNotFound(_0x1fd6a0,_0x94738a){return function(_0xd5e970){if(!_0xd5e970){_0x1fd6a0[_0x3452('0x26')](0x194);}return _0xd5e970;};}function handleError(_0xaf30f,_0x429d2a){_0x429d2a=_0x429d2a||0x1f4;return function(_0x21f593){logger[_0x3452('0x27')](_0x21f593[_0x3452('0x28')]);if(_0x21f593['name']){delete _0x21f593[_0x3452('0x29')];}_0xaf30f['status'](_0x429d2a)[_0x3452('0x2a')](_0x21f593);};}exports[_0x3452('0x23')]=function(_0x3476d6,_0x14c603){if(_0x3476d6[_0x3452('0x2b')]['id']){delete _0x3476d6[_0x3452('0x2b')]['id'];}return db[_0x3452('0x2c')][_0x3452('0x2d')]({'where':{'id':_0x3476d6['params']['id']}})[_0x3452('0x24')](handleEntityNotFound(_0x14c603,null))[_0x3452('0x24')](saveUpdates(_0x3476d6[_0x3452('0x2b')],null))[_0x3452('0x24')](respondWithResult(_0x14c603,null))['catch'](handleError(_0x14c603,null));};exports[_0x3452('0x2e')]=function(_0x3f3736,_0x8e25f9){return db[_0x3452('0x2c')]['find']({'where':{'id':_0x3f3736['params']['id']}})[_0x3452('0x24')](handleEntityNotFound(_0x8e25f9,null))['then'](removeEntity(_0x8e25f9,null))[_0x3452('0x2f')](handleError(_0x8e25f9,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 907021c..26ad41d 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 _0x728e=['define','Action','tools_actions','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./action.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x728e,0x153));var _0xe728=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x728e[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xe728('0x0'));var util=require(_0xe728('0x1'));var logger=require(_0xe728('0x2'))(_0xe728('0x3'));var moment=require(_0xe728('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe728('0x5'));var rimraf=require(_0xe728('0x6'));var config=require(_0xe728('0x7'));var attributes=require(_0xe728('0x8'));module['exports']=function(_0x57c328,_0x4c8f92){return _0x57c328[_0xe728('0x9')](_0xe728('0xa'),attributes,{'tableName':_0xe728('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8fbe=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./action.attributes','exports','define','Action','lodash','util'];(function(_0x52572f,_0x117f95){var _0x2e9a29=function(_0x10d002){while(--_0x10d002){_0x52572f['push'](_0x52572f['shift']());}};_0x2e9a29(++_0x117f95);}(_0x8fbe,0x1c6));var _0xe8fb=function(_0x3439fd,_0x42a898){_0x3439fd=_0x3439fd-0x0;var _0xe01bdf=_0x8fbe[_0x3439fd];return _0xe01bdf;};'use strict';var _=require(_0xe8fb('0x0'));var util=require(_0xe8fb('0x1'));var logger=require(_0xe8fb('0x2'))(_0xe8fb('0x3'));var moment=require(_0xe8fb('0x4'));var BPromise=require(_0xe8fb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe8fb('0x6'));var config=require(_0xe8fb('0x7'));var attributes=require(_0xe8fb('0x8'));module[_0xe8fb('0x9')]=function(_0x138073,_0x24dff1){return _0x138073[_0xe8fb('0xa')](_0xe8fb('0xb'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 8bae6b9..6790724 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 _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x814b,0x1a2));var _0xb814=function(_0x295143,_0x105ade){_0x295143=_0x295143-0x0;var _0x7982e4=_0x814b[_0x295143];return _0x7982e4;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}
\ No newline at end of file
+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(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x7217,0x19e));var _0x7721=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x7217[_0x1cfa0d];return _0xe33279;};'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
diff --git a/server/api/action/index.js b/server/api/action/index.js
index d66a101..9383300 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 _0x3cff=['delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update'];(function(_0x28db4a,_0x6d6d5a){var _0x3bf87e=function(_0x3e0f75){while(--_0x3e0f75){_0x28db4a['push'](_0x28db4a['shift']());}};_0x3bf87e(++_0x6d6d5a);}(_0x3cff,0x198));var _0xf3cf=function(_0x281e5e,_0xf320e2){_0x281e5e=_0x281e5e-0x0;var _0x5a22d2=_0x3cff[_0x281e5e];return _0x5a22d2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf3cf('0x0'));var timeout=require(_0xf3cf('0x1'));var express=require(_0xf3cf('0x2'));var router=express[_0xf3cf('0x3')]();var fs_extra=require(_0xf3cf('0x4'));var auth=require(_0xf3cf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf3cf('0x6'));var controller=require(_0xf3cf('0x7'));router[_0xf3cf('0x8')](_0xf3cf('0x9'),auth[_0xf3cf('0xa')](),controller[_0xf3cf('0xb')]);router[_0xf3cf('0xc')](_0xf3cf('0x9'),auth[_0xf3cf('0xa')](),controller[_0xf3cf('0xd')]);module[_0xf3cf('0xe')]=router;
\ No newline at end of file
+var _0xf439=['put','/:id','isAuthenticated','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./action.controller'];(function(_0x588f0b,_0x5baaae){var _0x31cff1=function(_0x20eccc){while(--_0x20eccc){_0x588f0b['push'](_0x588f0b['shift']());}};_0x31cff1(++_0x5baaae);}(_0xf439,0x163));var _0x9f43=function(_0x1ac5a3,_0x20e1ae){_0x1ac5a3=_0x1ac5a3-0x0;var _0x47035d=_0xf439[_0x1ac5a3];return _0x47035d;};'use strict';var multer=require(_0x9f43('0x0'));var util=require(_0x9f43('0x1'));var path=require(_0x9f43('0x2'));var timeout=require(_0x9f43('0x3'));var express=require(_0x9f43('0x4'));var router=express[_0x9f43('0x5')]();var fs_extra=require(_0x9f43('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9f43('0x7'));var config=require('../../config/environment');var controller=require(_0x9f43('0x8'));router[_0x9f43('0x9')](_0x9f43('0xa'),auth[_0x9f43('0xb')](),controller['update']);router[_0x9f43('0xc')](_0x9f43('0xa'),auth[_0x9f43('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index a057960..a8a7a8c 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 _0x5fd1=['STRING','TEXT','sequelize'];(function(_0x32e649,_0x228649){var _0x14d386=function(_0x3fb3ed){while(--_0x3fb3ed){_0x32e649['push'](_0x32e649['shift']());}};_0x14d386(++_0x228649);}(_0x5fd1,0x155));var _0x15fd=function(_0x52b80b,_0x14ccde){_0x52b80b=_0x52b80b-0x0;var _0x44e670=_0x5fd1[_0x52b80b];return _0x44e670;};'use strict';var Sequelize=require(_0x15fd('0x0'));module['exports']={'name':{'type':Sequelize[_0x15fd('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x15fd('0x1')]},'parent':{'type':Sequelize[_0x15fd('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x15fd('0x2')]}};
\ No newline at end of file
+var _0x326f=['STRING','TEXT','sequelize'];(function(_0xa2c90b,_0x993a19){var _0x18b9c3=function(_0x301949){while(--_0x301949){_0xa2c90b['push'](_0xa2c90b['shift']());}};_0x18b9c3(++_0x993a19);}(_0x326f,0xd1));var _0xf326=function(_0x67fcd4,_0x76752){_0x67fcd4=_0x67fcd4-0x0;var _0x3efaea=_0x326f[_0x67fcd4];return _0x3efaea;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf326('0x1')]},'parent':{'type':Sequelize[_0xf326('0x1')]},'table':{'type':Sequelize[_0xf326('0x1')]},'conditions':{'type':Sequelize[_0xf326('0x2')]},'joins':{'type':Sequelize[_0xf326('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 2a6dc89..3cbc98f 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 _0xcd30=['jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','destroy','then','get','UserProfileResource','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','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','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','MAX(%s)','IS\x20NULL','ValidationErrorItem','select','from','output','web','generate','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','SEC_TO_TIME(%s)','value','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','crypto'];(function(_0x46e5a4,_0x236467){var _0x592eaa=function(_0x1bb855){while(--_0x1bb855){_0x46e5a4['push'](_0x46e5a4['shift']());}};_0x592eaa(++_0x236467);}(_0xcd30,0x1e8));var _0x0cd3=function(_0x14ee59,_0x236373){_0x14ee59=_0x14ee59-0x0;var _0x46dcd3=_0xcd30[_0x14ee59];return _0x46dcd3;};'use strict';var emlformat=require(_0x0cd3('0x0'));var rimraf=require(_0x0cd3('0x1'));var zipdir=require(_0x0cd3('0x2'));var jsonpatch=require(_0x0cd3('0x3'));var rp=require(_0x0cd3('0x4'));var moment=require(_0x0cd3('0x5'));var BPromise=require(_0x0cd3('0x6'));var Mustache=require('mustache');var util=require(_0x0cd3('0x7'));var path=require(_0x0cd3('0x8'));var sox=require(_0x0cd3('0x9'));var csv=require('to-csv');var ejs=require(_0x0cd3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0cd3('0xb'));var squel=require('squel');var crypto=require(_0x0cd3('0xc'));var jsforce=require(_0x0cd3('0xd'));var deskjs=require(_0x0cd3('0xe'));var toCsv=require(_0x0cd3('0xf'));var querystring=require('querystring');var Papa=require(_0x0cd3('0x10'));var Redis=require(_0x0cd3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0cd3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0cd3('0x13'));var logger=require(_0x0cd3('0x14'))(_0x0cd3('0x15'));var utils=require(_0x0cd3('0x16'));var config=require(_0x0cd3('0x17'));var licenseUtil=require(_0x0cd3('0x18'));var db=require(_0x0cd3('0x19'))['db'];var dbH=require(_0x0cd3('0x19'))[_0x0cd3('0x1a')];function respondWithStatusCode(_0x30bc8d,_0x3b450c){_0x3b450c=_0x3b450c||0xcc;return function(_0x250c55){if(_0x250c55){return _0x30bc8d[_0x0cd3('0x1b')](_0x3b450c);}return _0x30bc8d[_0x0cd3('0x1c')](_0x3b450c)[_0x0cd3('0x1d')]();};}function respondWithResult(_0x3e2ec0,_0x5e93c7){_0x5e93c7=_0x5e93c7||0xc8;return function(_0x16e713){if(_0x16e713){return _0x3e2ec0[_0x0cd3('0x1c')](_0x5e93c7)['json'](_0x16e713);}};}function respondWithFilteredResult(_0x1d778a,_0x1e0153){return function(_0x12c0d8){if(_0x12c0d8){var _0x12944d=typeof _0x1e0153[_0x0cd3('0x1e')]===_0x0cd3('0x1f')&&typeof _0x1e0153[_0x0cd3('0x20')]==='undefined';var _0xb95aa1=_0x12c0d8[_0x0cd3('0x21')];var _0x16aae0=_0x12944d?0x0:_0x1e0153[_0x0cd3('0x1e')];var _0x415b4f=_0x12944d?_0x12c0d8[_0x0cd3('0x21')]:_0x1e0153[_0x0cd3('0x1e')]+_0x1e0153[_0x0cd3('0x20')];var _0x59e6b8;if(_0x415b4f>=_0xb95aa1){_0x415b4f=_0xb95aa1;_0x59e6b8=0xc8;}else{_0x59e6b8=0xce;}_0x1d778a['status'](_0x59e6b8);return _0x1d778a[_0x0cd3('0x22')](_0x0cd3('0x23'),_0x16aae0+'-'+_0x415b4f+'/'+_0xb95aa1)[_0x0cd3('0x24')](_0x12c0d8);}return null;};}function patchUpdates(_0x3ddb12){return function(_0x5a7306){try{jsonpatch['apply'](_0x5a7306,_0x3ddb12,!![]);}catch(_0x2e2971){return BPromise[_0x0cd3('0x25')](_0x2e2971);}return _0x5a7306[_0x0cd3('0x26')]();};}function saveUpdates(_0x3e3073,_0x175ff9){return function(_0x2a41d4){if(_0x2a41d4){return _0x2a41d4['update'](_0x3e3073)['then'](function(_0x127bb1){return _0x127bb1;});}return null;};}function removeEntity(_0x1ebc70,_0x24db04){return function(_0x525979){if(_0x525979){return _0x525979[_0x0cd3('0x27')]()[_0x0cd3('0x28')](function(){var _0x59e759=_0x525979[_0x0cd3('0x29')]({'plain':!![]});var _0x83686='CustomReports';return db[_0x0cd3('0x2a')][_0x0cd3('0x27')]({'where':{'type':_0x83686,'resourceId':_0x59e759['id']}})[_0x0cd3('0x28')](function(){return _0x525979;});})[_0x0cd3('0x28')](function(){_0x1ebc70[_0x0cd3('0x1c')](0xcc)[_0x0cd3('0x1d')]();});}};}function handleEntityNotFound(_0x468a13,_0x56e28d){return function(_0x51eab0){if(!_0x51eab0){_0x468a13[_0x0cd3('0x1b')](0x194);}return _0x51eab0;};}function handleError(_0x5f04c1,_0x226c97){_0x226c97=_0x226c97||0x1f4;return function(_0x54d886){logger['error'](_0x54d886[_0x0cd3('0x2b')]);if(_0x54d886['name']){delete _0x54d886[_0x0cd3('0x2c')];}_0x5f04c1[_0x0cd3('0x1c')](_0x226c97)[_0x0cd3('0x2d')](_0x54d886);};}exports[_0x0cd3('0x2e')]=function(_0x2b697e,_0x385193){var _0x88808b={},_0x46e3e5={},_0x5baef2={'count':0x0,'rows':[]};var _0x41c83a=_[_0x0cd3('0x2f')](db[_0x0cd3('0x30')][_0x0cd3('0x31')],function(_0x64a7aa){return{'name':_0x64a7aa[_0x0cd3('0x32')],'type':_0x64a7aa[_0x0cd3('0x33')][_0x0cd3('0x34')]};});_0x46e3e5[_0x0cd3('0x35')]=_[_0x0cd3('0x2f')](_0x41c83a,'name');_0x46e3e5['query']=_[_0x0cd3('0x36')](_0x2b697e[_0x0cd3('0x37')]);_0x46e3e5[_0x0cd3('0x38')]=_[_0x0cd3('0x39')](_0x46e3e5[_0x0cd3('0x35')],_0x46e3e5[_0x0cd3('0x37')]);_0x88808b[_0x0cd3('0x3a')]=_[_0x0cd3('0x39')](_0x46e3e5[_0x0cd3('0x35')],qs['fields'](_0x2b697e['query'][_0x0cd3('0x3b')]));_0x88808b[_0x0cd3('0x3a')]=_0x88808b['attributes'][_0x0cd3('0x3c')]?_0x88808b[_0x0cd3('0x3a')]:_0x46e3e5[_0x0cd3('0x35')];if(!_0x2b697e[_0x0cd3('0x37')][_0x0cd3('0x3d')](_0x0cd3('0x3e'))){_0x88808b[_0x0cd3('0x20')]=qs['limit'](_0x2b697e[_0x0cd3('0x37')]['limit']);_0x88808b[_0x0cd3('0x1e')]=qs[_0x0cd3('0x1e')](_0x2b697e[_0x0cd3('0x37')]['offset']);}_0x88808b['order']=qs[_0x0cd3('0x3f')](_0x2b697e[_0x0cd3('0x37')][_0x0cd3('0x3f')]);_0x88808b[_0x0cd3('0x40')]=qs[_0x0cd3('0x38')](_[_0x0cd3('0x41')](_0x2b697e['query'],_0x46e3e5[_0x0cd3('0x38')]),_0x41c83a);if(_0x2b697e[_0x0cd3('0x37')][_0x0cd3('0x42')]){_0x88808b[_0x0cd3('0x40')]=_[_0x0cd3('0x43')](_0x88808b[_0x0cd3('0x40')],{'$or':_[_0x0cd3('0x2f')](_0x41c83a,function(_0x3d5e35){if(_0x3d5e35[_0x0cd3('0x33')]!==_0x0cd3('0x44')){var _0x4b90fc={};_0x4b90fc[_0x3d5e35[_0x0cd3('0x2c')]]={'$like':'%'+_0x2b697e[_0x0cd3('0x37')][_0x0cd3('0x42')]+'%'};return _0x4b90fc;}})});}_0x88808b=_[_0x0cd3('0x43')]({},_0x88808b,_0x2b697e[_0x0cd3('0x45')]);var _0x20726d={'where':_0x88808b['where']};return db[_0x0cd3('0x30')]['count'](_0x20726d)['then'](function(_0x47f8c9){_0x5baef2[_0x0cd3('0x21')]=_0x47f8c9;if(_0x2b697e[_0x0cd3('0x37')][_0x0cd3('0x46')]){_0x88808b['include']=[{'all':!![]}];}return db[_0x0cd3('0x30')][_0x0cd3('0x47')](_0x88808b);})['then'](function(_0x1e7a1a){_0x5baef2['rows']=_0x1e7a1a;return _0x5baef2;})[_0x0cd3('0x28')](respondWithFilteredResult(_0x385193,_0x88808b))[_0x0cd3('0x48')](handleError(_0x385193,null));};exports[_0x0cd3('0x49')]=function(_0xc94b,_0x20d6a3){var _0x5c3197={'raw':![],'where':{'id':_0xc94b['params']['id']}},_0x2f8676={};_0x2f8676[_0x0cd3('0x35')]=_[_0x0cd3('0x36')](db['AnalyticCustomReport'][_0x0cd3('0x31')]);_0x2f8676[_0x0cd3('0x37')]=_[_0x0cd3('0x36')](_0xc94b[_0x0cd3('0x37')]);_0x2f8676[_0x0cd3('0x38')]=_['intersection'](_0x2f8676[_0x0cd3('0x35')],_0x2f8676[_0x0cd3('0x37')]);_0x5c3197[_0x0cd3('0x3a')]=_[_0x0cd3('0x39')](_0x2f8676['model'],qs[_0x0cd3('0x3b')](_0xc94b[_0x0cd3('0x37')]['fields']));_0x5c3197[_0x0cd3('0x3a')]=_0x5c3197[_0x0cd3('0x3a')][_0x0cd3('0x3c')]?_0x5c3197[_0x0cd3('0x3a')]:_0x2f8676[_0x0cd3('0x35')];if(_0xc94b[_0x0cd3('0x37')][_0x0cd3('0x46')]){_0x5c3197[_0x0cd3('0x4a')]=[{'all':!![]}];}_0x5c3197=_[_0x0cd3('0x43')]({},_0x5c3197,_0xc94b[_0x0cd3('0x45')]);return db[_0x0cd3('0x30')][_0x0cd3('0x4b')](_0x5c3197)['then'](handleEntityNotFound(_0x20d6a3,null))[_0x0cd3('0x28')](respondWithResult(_0x20d6a3,null))[_0x0cd3('0x48')](handleError(_0x20d6a3,null));};exports[_0x0cd3('0x4c')]=function(_0x33dbd2,_0x4164ab){return db['AnalyticCustomReport']['create'](_0x33dbd2[_0x0cd3('0x4d')],{})[_0x0cd3('0x28')](function(_0x5b1e20){var _0x1f721c=_0x33dbd2[_0x0cd3('0x4e')][_0x0cd3('0x29')]({'plain':!![]});if(!_0x1f721c)throw new Error(_0x0cd3('0x4f'));if(_0x1f721c[_0x0cd3('0x50')]===_0x0cd3('0x4e')){var _0x339d06=_0x5b1e20['get']({'plain':!![]});var _0x4f48f2='Reports';return db[_0x0cd3('0x51')][_0x0cd3('0x4b')]({'where':{'name':_0x4f48f2,'userProfileId':_0x1f721c['userProfileId']},'raw':!![]})[_0x0cd3('0x28')](function(_0x53219b){if(_0x53219b&&_0x53219b[_0x0cd3('0x52')]===0x0){return db[_0x0cd3('0x2a')][_0x0cd3('0x4c')]({'name':_0x339d06[_0x0cd3('0x2c')],'resourceId':_0x339d06['id'],'type':'CustomReports','sectionId':_0x53219b['id']},{})[_0x0cd3('0x28')](function(){return _0x5b1e20;});}else{return _0x5b1e20;}})[_0x0cd3('0x48')](function(_0x3a31f1){logger[_0x0cd3('0x53')](_0x0cd3('0x54'),_0x3a31f1);throw _0x3a31f1;});}return _0x5b1e20;})['then'](respondWithResult(_0x4164ab,0xc9))['catch'](handleError(_0x4164ab,null));};exports[_0x0cd3('0x55')]=function(_0x394c16,_0x55a7c0){if(_0x394c16[_0x0cd3('0x4d')]['id']){delete _0x394c16[_0x0cd3('0x4d')]['id'];}return db['AnalyticCustomReport'][_0x0cd3('0x4b')]({'where':{'id':_0x394c16[_0x0cd3('0x56')]['id']}})[_0x0cd3('0x28')](handleEntityNotFound(_0x55a7c0,null))[_0x0cd3('0x28')](saveUpdates(_0x394c16[_0x0cd3('0x4d')],null))[_0x0cd3('0x28')](respondWithResult(_0x55a7c0,null))[_0x0cd3('0x48')](handleError(_0x55a7c0,null));};exports['destroy']=function(_0x405fdc,_0x3ca002){return db['AnalyticCustomReport'][_0x0cd3('0x4b')]({'where':{'id':_0x405fdc['params']['id']}})[_0x0cd3('0x28')](handleEntityNotFound(_0x3ca002,null))['then'](removeEntity(_0x3ca002,null))['catch'](handleError(_0x3ca002,null));};exports[_0x0cd3('0x57')]=function(_0x1f30e6,_0x270604){var _0x349602=0xa;var _0x3a782f=[_0x0cd3('0x58'),_0x0cd3('0x59'),_0x0cd3('0x5a'),_0x0cd3('0x5b')];var _0x298197={'SUM':_0x0cd3('0x5c'),'COUNT':_0x0cd3('0x5d'),'COUNT DISTINCT':_0x0cd3('0x5e'),'MAX':'MAX(%s)','MIN':_0x0cd3('0x5f'),'AVG':_0x0cd3('0x60'),'GROUP_CONCAT':_0x0cd3('0x61'),'GROUP_CONCAT ASC':_0x0cd3('0x62'),'GROUP_CONCAT DESC':_0x0cd3('0x63')};var _0x1178bd={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x0cd3('0x64'),'HOUR':_0x0cd3('0x65'),'ROUND':_0x0cd3('0x66'),'UNIX_TIMESTAMP':_0x0cd3('0x67')};var _0x40e338=function(_0x453944){return!_[_0x0cd3('0x68')](['IS\x20NULL',_0x0cd3('0x69'),_0x0cd3('0x6a'),_0x0cd3('0x6b')],_0x453944);};var _0xe6c6c9=function(_0x3cd2ba){if(!_0x3cd2ba||!_0x3cd2ba[_0x0cd3('0x6c')][_0x0cd3('0x3c')]){return'';}for(var _0xad79f4='(',_0x2761d5=0x0;_0x2761d5<_0x3cd2ba[_0x0cd3('0x6c')][_0x0cd3('0x3c')];_0x2761d5+=0x1){_0x2761d5>0x0&&(_0xad79f4+='\x20'+_0x3cd2ba[_0x0cd3('0x6d')]+'\x20');_0xad79f4+=_0x3cd2ba['rules'][_0x2761d5][_0x0cd3('0x6e')]?_0xe6c6c9(_0x3cd2ba['rules'][_0x2761d5][_0x0cd3('0x6e')]):_0x3cd2ba[_0x0cd3('0x6c')][_0x2761d5][_0x0cd3('0x6f')]+'\x20'+_0x3cd2ba['rules'][_0x2761d5]['condition']+(_0x40e338(_0x3cd2ba['rules'][_0x2761d5][_0x0cd3('0x70')])?'\x20'+_0x3cd2ba[_0x0cd3('0x6c')][_0x2761d5]['value']:'');}return _0xad79f4+')';};var _0x619299={'where':{'id':_0x1f30e6[_0x0cd3('0x56')]['id']}},_0x456049,_0x496c55,_0x49cceb,_0xdba078,_0x2265c3;_0x619299=_[_0x0cd3('0x43')]({},_0x619299,_0x1f30e6[_0x0cd3('0x45')]);return db[_0x0cd3('0x30')]['find'](_0x619299)[_0x0cd3('0x28')](function(_0x1a337e){if(_0x1a337e){_0x456049=_0x1a337e;return _0x1a337e[_0x0cd3('0x71')]();}return null;})[_0x0cd3('0x28')](function(_0x477964){if(_0x477964){if(!_0x477964['length']){throw new db[(_0x0cd3('0x72'))]['ValidationErrorItem'](_0x0cd3('0x73'),0x193);}_0x496c55=_0x477964;return db[_0x0cd3('0x74')]['findAll']({'raw':!![]});}return null;})[_0x0cd3('0x28')](function(_0x275a85){if(_0x275a85){_0x49cceb=_[_0x0cd3('0x75')](_0x275a85,'id');var _0x55cfaa;var _0x53c6af=squel['select']();_0x53c6af['from'](_0x456049[_0x0cd3('0x76')]);for(var _0xdf50af=0x0;_0xdf50af<_0x496c55['length'];_0xdf50af+=0x1){_0x55cfaa=_0x496c55[_0xdf50af]['MetricId']?_0x49cceb[_0x496c55[_0xdf50af][_0x0cd3('0x77')]][_0x0cd3('0x78')]:_0x496c55[_0xdf50af]['field'];_0x55cfaa=_0x496c55[_0xdf50af][_0x0cd3('0x79')]?_[_0x0cd3('0x7a')](_0x298197[_0x496c55[_0xdf50af][_0x0cd3('0x79')]],'%s',_0x55cfaa):_0x55cfaa;_0x55cfaa=_0x496c55[_0xdf50af][_0x0cd3('0x7b')]?_[_0x0cd3('0x7a')](_0x1178bd[_0x496c55[_0xdf50af]['format']],'%s',_0x55cfaa):_0x55cfaa;if(_0x496c55[_0xdf50af][_0x0cd3('0x7c')]){_0x53c6af[_0x0cd3('0x6e')](_0x55cfaa);}_0x496c55[_0xdf50af][_0x0cd3('0x7d')]&&_0x53c6af['order'](_0x55cfaa,_0x496c55[_0xdf50af][_0x0cd3('0x7d')]===_0x0cd3('0x7e')?![]:!![]);_0x53c6af['field'](_0x55cfaa,_0x496c55[_0xdf50af][_0x0cd3('0x7f')]||_0x55cfaa);}if(_0x456049['joins']){_0x456049[_0x0cd3('0x80')]=JSON['parse'](_0x456049['joins']);for(var _0x51eef2=0x0;_0x51eef2<_0x456049[_0x0cd3('0x80')][_0x0cd3('0x3c')];_0x51eef2+=0x1){if(_0x456049[_0x0cd3('0x80')][_0x51eef2]['type']&&_[_0x0cd3('0x68')](_0x3a782f,_0x456049[_0x0cd3('0x80')][_0x51eef2][_0x0cd3('0x33')])&&_0x456049[_0x0cd3('0x80')][_0x51eef2][_0x0cd3('0x81')]&&_0x456049[_0x0cd3('0x80')][_0x51eef2][_0x0cd3('0x82')]&&_0x456049[_0x0cd3('0x80')][_0x51eef2][_0x0cd3('0x83')]){_0x53c6af[_0x456049['joins'][_0x51eef2][_0x0cd3('0x33')]](_0x456049[_0x0cd3('0x80')][_0x51eef2][_0x0cd3('0x82')],null,util[_0x0cd3('0x7b')](_0x0cd3('0x84'),_0x456049[_0x0cd3('0x76')],_0x456049[_0x0cd3('0x80')][_0x51eef2]['parentKey'],_0x456049['joins'][_0x51eef2][_0x0cd3('0x82')],_0x456049[_0x0cd3('0x80')][_0x51eef2][_0x0cd3('0x83')]));}}}if(_0x456049[_0x0cd3('0x85')]){_0x456049['conditions']=JSON[_0x0cd3('0x86')](_0x456049[_0x0cd3('0x85')]);_0x53c6af[_0x0cd3('0x40')](_0xe6c6c9(_0x456049['conditions'][_0x0cd3('0x6e')]));}_0x2265c3=_0x53c6af[_0x0cd3('0x87')]();_0x53c6af[_0x0cd3('0x20')](_0x349602);_0x53c6af[_0x0cd3('0x1e')](0x0);logger[_0x0cd3('0x88')](_0x0cd3('0x89'),_0x53c6af[_0x0cd3('0x8a')]());return dbH[_0x0cd3('0x8b')]['query'](_0x53c6af[_0x0cd3('0x8a')](),{'type':dbH[_0x0cd3('0x8b')][_0x0cd3('0x8c')][_0x0cd3('0x8d')]});}})[_0x0cd3('0x28')](respondWithResult(_0x270604,null))[_0x0cd3('0x48')](handleError(_0x270604,null));};function runReport(_0x22fc24,_0x1dee21,_0x2c8984){var _0x16874f=_0x1dee21[_0x0cd3('0x2c')];var _0x4ab7c4=0xa;var _0x258aa7=[_0x0cd3('0x58'),_0x0cd3('0x59'),_0x0cd3('0x5a'),_0x0cd3('0x5b')];var _0x129444={'SUM':_0x0cd3('0x5c'),'COUNT':_0x0cd3('0x5d'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x0cd3('0x8e'),'MIN':_0x0cd3('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x0cd3('0x61'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2ff4ce={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x0cd3('0x64'),'HOUR':_0x0cd3('0x65'),'ROUND':_0x0cd3('0x66'),'UNIX_TIMESTAMP':_0x0cd3('0x67')};var _0x4531d4=function(_0x1a0839){return!_[_0x0cd3('0x68')]([_0x0cd3('0x8f'),'IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x1a0839);};var _0x4d25ee=function(_0x262be9){if(!_0x262be9||!_0x262be9[_0x0cd3('0x6c')][_0x0cd3('0x3c')]){return'';}for(var _0x12390b='(',_0x409354=0x0;_0x409354<_0x262be9['rules']['length'];_0x409354+=0x1){_0x409354>0x0&&(_0x12390b+='\x20'+_0x262be9['operator']+'\x20');_0x12390b+=_0x262be9['rules'][_0x409354][_0x0cd3('0x6e')]?_0x4d25ee(_0x262be9[_0x0cd3('0x6c')][_0x409354][_0x0cd3('0x6e')]):_0x262be9[_0x0cd3('0x6c')][_0x409354][_0x0cd3('0x6f')]+'\x20'+_0x262be9['rules'][_0x409354]['condition']+(_0x4531d4(_0x262be9[_0x0cd3('0x6c')][_0x409354][_0x0cd3('0x70')])?'\x20'+_0x262be9[_0x0cd3('0x6c')][_0x409354]['value']:'');}return _0x12390b+')';};var _0x1cabbd={'where':{'id':_0x22fc24['id']}},_0x2fde5a,_0x1a1543,_0x20619a,_0x2234d0,_0x5d59e1;_0x1cabbd=_['merge']({},_0x1cabbd,_0x2c8984);return db[_0x0cd3('0x30')][_0x0cd3('0x4b')](_0x1cabbd)[_0x0cd3('0x28')](function(_0x3a2709){if(_0x3a2709){_0x2fde5a=_0x3a2709;return _0x3a2709['getFields']();}return null;})[_0x0cd3('0x28')](function(_0x57d564){if(_0x57d564){if(!_0x57d564[_0x0cd3('0x3c')]){throw new db[(_0x0cd3('0x72'))][(_0x0cd3('0x90'))](_0x0cd3('0x73'),0x193);}_0x1a1543=_0x57d564;return db[_0x0cd3('0x74')][_0x0cd3('0x47')]({'raw':!![]});}return null;})[_0x0cd3('0x28')](function(_0x5791d8){if(_0x5791d8){_0x20619a=_[_0x0cd3('0x75')](_0x5791d8,'id');var _0x632595;var _0x73528d=squel[_0x0cd3('0x91')]();_0x73528d[_0x0cd3('0x92')](_0x2fde5a[_0x0cd3('0x76')]);for(var _0x556af0=0x0;_0x556af0<_0x1a1543[_0x0cd3('0x3c')];_0x556af0+=0x1){_0x632595=_0x1a1543[_0x556af0][_0x0cd3('0x77')]?_0x20619a[_0x1a1543[_0x556af0][_0x0cd3('0x77')]][_0x0cd3('0x78')]:_0x1a1543[_0x556af0][_0x0cd3('0x6f')];_0x632595=_0x1a1543[_0x556af0]['function']?_[_0x0cd3('0x7a')](_0x129444[_0x1a1543[_0x556af0][_0x0cd3('0x79')]],'%s',_0x632595):_0x632595;_0x632595=_0x1a1543[_0x556af0]['format']?_[_0x0cd3('0x7a')](_0x2ff4ce[_0x1a1543[_0x556af0][_0x0cd3('0x7b')]],'%s',_0x632595):_0x632595;if(_0x1a1543[_0x556af0][_0x0cd3('0x7c')]){_0x73528d[_0x0cd3('0x6e')](_0x632595);}_0x1a1543[_0x556af0][_0x0cd3('0x7d')]&&_0x73528d['order'](_0x632595,_0x1a1543[_0x556af0][_0x0cd3('0x7d')]===_0x0cd3('0x7e')?![]:!![]);_0x73528d[_0x0cd3('0x6f')](_0x632595,_0x1a1543[_0x556af0][_0x0cd3('0x7f')]||_0x632595);}if(_0x2fde5a[_0x0cd3('0x80')]){_0x2fde5a[_0x0cd3('0x80')]=JSON[_0x0cd3('0x86')](_0x2fde5a[_0x0cd3('0x80')]);for(var _0xcd113f=0x0;_0xcd113f<_0x2fde5a[_0x0cd3('0x80')]['length'];_0xcd113f+=0x1){if(_0x2fde5a['joins'][_0xcd113f][_0x0cd3('0x33')]&&_['includes'](_0x258aa7,_0x2fde5a[_0x0cd3('0x80')][_0xcd113f][_0x0cd3('0x33')])&&_0x2fde5a[_0x0cd3('0x80')][_0xcd113f][_0x0cd3('0x81')]&&_0x2fde5a['joins'][_0xcd113f][_0x0cd3('0x82')]&&_0x2fde5a['joins'][_0xcd113f]['foreignKey']){_0x73528d[_0x2fde5a[_0x0cd3('0x80')][_0xcd113f]['type']](_0x2fde5a['joins'][_0xcd113f][_0x0cd3('0x82')],null,util['format'](_0x0cd3('0x84'),_0x2fde5a[_0x0cd3('0x76')],_0x2fde5a[_0x0cd3('0x80')][_0xcd113f][_0x0cd3('0x81')],_0x2fde5a[_0x0cd3('0x80')][_0xcd113f][_0x0cd3('0x82')],_0x2fde5a['joins'][_0xcd113f][_0x0cd3('0x83')]));}}}if(_0x2fde5a[_0x0cd3('0x85')]){_0x2fde5a[_0x0cd3('0x85')]=JSON['parse'](_0x2fde5a[_0x0cd3('0x85')]);_0x73528d[_0x0cd3('0x40')](_0x4d25ee(_0x2fde5a[_0x0cd3('0x85')]['group']));}_0x5d59e1=_0x73528d[_0x0cd3('0x87')]();_0x73528d['limit'](_0x4ab7c4);_0x73528d[_0x0cd3('0x1e')](0x0);return;}})['then'](function(){if(_0x1dee21[_0x0cd3('0x93')]===_0x0cd3('0x94')){return null;}var _0x39cfa4=_['merge'](_0x1dee21,{'name':_0x1dee21['fullPath']||_0x1dee21['name']||_0x2fde5a[_0x0cd3('0x2c')],'basename':_0x16874f,'savename':util[_0x0cd3('0x7b')]('%s-%s.%s',_0x1dee21[_0x0cd3('0x2c')]||_0x2fde5a[_0x0cd3('0x2c')],require('randomstring')[_0x0cd3('0x95')](0x4),_0x1dee21[_0x0cd3('0x93')]||'csv'),'reportId':_0x2fde5a['id'],'reportType':_0x0cd3('0x96')});return db[_0x0cd3('0x97')][_0x0cd3('0x4c')](_0x39cfa4,{'raw':!![]});})[_0x0cd3('0x28')](function(_0x2aab61){if(_0x2fde5a['table']===_0x0cd3('0x98')){_0x5d59e1['where'](_0x2fde5a[_0x0cd3('0x76')]+_0x0cd3('0x99'),_0x1dee21[_0x0cd3('0x9a')],_0x1dee21['endDate']);}else{_0x5d59e1[_0x0cd3('0x40')](_0x2fde5a[_0x0cd3('0x76')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1dee21[_0x0cd3('0x9a')],_0x1dee21['endDate']);}if(_0x2aab61){logger[_0x0cd3('0x9b')](_0x0cd3('0x9c'),_0x5d59e1['toString']());require(_0x0cd3('0x9d'))['fork'](path[_0x0cd3('0x58')](__dirname,_0x0cd3('0x9e'),_0x2aab61[_0x0cd3('0x93')]),[_0x2aab61['id'],_0x5d59e1[_0x0cd3('0x8a')](),path[_0x0cd3('0x58')](__dirname,_0x0cd3('0x9f'),_0x2aab61[_0x0cd3('0xa0')]),_0x16874f]);return _0x2aab61;}else{var _0x333c41=squel['select']();_0x333c41['from']('('+_0x5d59e1[_0x0cd3('0x8a')]()+')',_0x0cd3('0xa1'));_0x333c41[_0x0cd3('0x6f')](_0x0cd3('0xa2'),_0x0cd3('0x21'));_0x5d59e1[_0x0cd3('0x20')](_0x1dee21[_0x0cd3('0x20')]||_0x4ab7c4);_0x5d59e1['offset'](_0x1dee21['offset']||0x0);return dbH[_0x0cd3('0x8b')][_0x0cd3('0x37')](_0x333c41[_0x0cd3('0x8a')](),{'type':dbH[_0x0cd3('0x8b')][_0x0cd3('0x8c')][_0x0cd3('0x8d')]})[_0x0cd3('0x28')](function(_0x502de9){if(!_0x502de9[_0x0cd3('0x3c')]){_0x2234d0=0x0;}else{_0x2234d0=_0x502de9[0x0]['count']||0x0;}return dbH[_0x0cd3('0x8b')][_0x0cd3('0x37')](_0x5d59e1['toString'](),{'type':dbH[_0x0cd3('0x8b')]['QueryTypes'][_0x0cd3('0x8d')]});})[_0x0cd3('0x28')](function(_0x1bc34a){return{'rows':_0x1bc34a||[],'count':_0x2234d0};});}});}exports['run']=function(_0x38a163,_0x1cf57c){return runReport(_0x38a163['params'],_0x38a163[_0x0cd3('0x37')],_0x38a163[_0x0cd3('0x45')])['then'](respondWithResult(_0x1cf57c,null))[_0x0cd3('0x48')](handleError(_0x1cf57c,null));};exports[_0x0cd3('0xa3')]=runReport;exports['query']=function(_0x407c4f,_0x503598){var _0x5bb574=0xa;var _0x589df5=[_0x0cd3('0x58'),'left_join',_0x0cd3('0x5a'),'cross_join'];var _0x5cfafa={'SUM':_0x0cd3('0x5c'),'COUNT':_0x0cd3('0x5d'),'COUNT DISTINCT':_0x0cd3('0x5e'),'MAX':_0x0cd3('0x8e'),'MIN':_0x0cd3('0x5f'),'AVG':_0x0cd3('0x60'),'GROUP_CONCAT':_0x0cd3('0x61'),'GROUP_CONCAT ASC':_0x0cd3('0x62'),'GROUP_CONCAT DESC':_0x0cd3('0x63')};var _0x5c83db={'SEC_TO_TIME':_0x0cd3('0xa4'),'DATE':_0x0cd3('0x64'),'HOUR':_0x0cd3('0x65'),'ROUND':_0x0cd3('0x66'),'UNIX_TIMESTAMP':_0x0cd3('0x67')};var _0x1e1ac1=function(_0x25aa30){return!_[_0x0cd3('0x68')]([_0x0cd3('0x8f'),'IS\x20NOT\x20NULL',_0x0cd3('0x6a'),_0x0cd3('0x6b')],_0x25aa30);};var _0x2f3083=function(_0x227867){if(!_0x227867||!_0x227867[_0x0cd3('0x6c')][_0x0cd3('0x3c')]){return'';}for(var _0x5ed122='(',_0x993966=0x0;_0x993966<_0x227867[_0x0cd3('0x6c')][_0x0cd3('0x3c')];_0x993966+=0x1){_0x993966>0x0&&(_0x5ed122+='\x20'+_0x227867[_0x0cd3('0x6d')]+'\x20');_0x5ed122+=_0x227867[_0x0cd3('0x6c')][_0x993966][_0x0cd3('0x6e')]?_0x2f3083(_0x227867[_0x0cd3('0x6c')][_0x993966][_0x0cd3('0x6e')]):_0x227867[_0x0cd3('0x6c')][_0x993966]['field']+'\x20'+_0x227867[_0x0cd3('0x6c')][_0x993966]['condition']+(_0x1e1ac1(_0x227867['rules'][_0x993966][_0x0cd3('0x70')])?'\x20'+_0x227867['rules'][_0x993966][_0x0cd3('0xa5')]:'');}return _0x5ed122+')';};var _0x47c455={'where':{'id':_0x407c4f[_0x0cd3('0x56')]['id']}},_0x43ecbc,_0x58b72b,_0xb51e09,_0x16f259,_0x301fca;_0x47c455=_[_0x0cd3('0x43')]({},_0x47c455,_0x407c4f[_0x0cd3('0x45')]);return db[_0x0cd3('0x30')][_0x0cd3('0x4b')](_0x47c455)[_0x0cd3('0x28')](function(_0x5b8b79){if(_0x5b8b79){_0x43ecbc=_0x5b8b79;return _0x5b8b79['getFields']();}return null;})[_0x0cd3('0x28')](function(_0x5e761a){if(_0x5e761a){if(!_0x5e761a[_0x0cd3('0x3c')]){throw new db[(_0x0cd3('0x72'))][(_0x0cd3('0x90'))](_0x0cd3('0x73'),0x193);}_0x58b72b=_0x5e761a;return db[_0x0cd3('0x74')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x4a980d){if(_0x4a980d){_0xb51e09=_['keyBy'](_0x4a980d,'id');var _0x26c51b;var _0x6b5679=squel[_0x0cd3('0x91')]();_0x6b5679['from'](_0x43ecbc['table']);for(var _0x5ec839=0x0;_0x5ec839<_0x58b72b[_0x0cd3('0x3c')];_0x5ec839+=0x1){_0x26c51b=_0x58b72b[_0x5ec839][_0x0cd3('0x77')]?_0xb51e09[_0x58b72b[_0x5ec839][_0x0cd3('0x77')]][_0x0cd3('0x78')]:_0x58b72b[_0x5ec839]['field'];_0x26c51b=_0x58b72b[_0x5ec839]['function']?_[_0x0cd3('0x7a')](_0x5cfafa[_0x58b72b[_0x5ec839][_0x0cd3('0x79')]],'%s',_0x26c51b):_0x26c51b;_0x26c51b=_0x58b72b[_0x5ec839][_0x0cd3('0x7b')]?_[_0x0cd3('0x7a')](_0x5c83db[_0x58b72b[_0x5ec839]['format']],'%s',_0x26c51b):_0x26c51b;if(_0x58b72b[_0x5ec839]['groupBy']){_0x6b5679[_0x0cd3('0x6e')](_0x26c51b);}_0x58b72b[_0x5ec839][_0x0cd3('0x7d')]&&_0x6b5679[_0x0cd3('0xa6')](_0x26c51b,_0x58b72b[_0x5ec839]['orderBy']===_0x0cd3('0x7e')?![]:!![]);_0x6b5679[_0x0cd3('0x6f')](_0x26c51b,_0x58b72b[_0x5ec839][_0x0cd3('0x7f')]||_0x26c51b);}if(_0x43ecbc[_0x0cd3('0x80')]){_0x43ecbc['joins']=JSON['parse'](_0x43ecbc['joins']);for(var _0x3ecb33=0x0;_0x3ecb33<_0x43ecbc[_0x0cd3('0x80')][_0x0cd3('0x3c')];_0x3ecb33+=0x1){if(_0x43ecbc[_0x0cd3('0x80')][_0x3ecb33]['type']&&_[_0x0cd3('0x68')](_0x589df5,_0x43ecbc[_0x0cd3('0x80')][_0x3ecb33]['type'])&&_0x43ecbc[_0x0cd3('0x80')][_0x3ecb33][_0x0cd3('0x81')]&&_0x43ecbc[_0x0cd3('0x80')][_0x3ecb33][_0x0cd3('0x82')]&&_0x43ecbc[_0x0cd3('0x80')][_0x3ecb33]['foreignKey']){_0x6b5679[_0x43ecbc[_0x0cd3('0x80')][_0x3ecb33][_0x0cd3('0x33')]](_0x43ecbc[_0x0cd3('0x80')][_0x3ecb33][_0x0cd3('0x82')],null,util[_0x0cd3('0x7b')](_0x0cd3('0x84'),_0x43ecbc[_0x0cd3('0x76')],_0x43ecbc[_0x0cd3('0x80')][_0x3ecb33]['parentKey'],_0x43ecbc[_0x0cd3('0x80')][_0x3ecb33][_0x0cd3('0x82')],_0x43ecbc[_0x0cd3('0x80')][_0x3ecb33][_0x0cd3('0x83')]));}}}if(_0x43ecbc['conditions']){_0x43ecbc['conditions']=JSON[_0x0cd3('0x86')](_0x43ecbc['conditions']);_0x6b5679[_0x0cd3('0x40')](_0x2f3083(_0x43ecbc[_0x0cd3('0x85')][_0x0cd3('0x6e')]));}_0x301fca=_0x6b5679['clone']();_0x6b5679[_0x0cd3('0x20')](_0x5bb574);_0x6b5679['offset'](0x0);logger[_0x0cd3('0x88')](_0x0cd3('0x89'),_0x6b5679[_0x0cd3('0x8a')]());return dbH['sequelize']['query'](_0x6b5679[_0x0cd3('0x8a')](),{'type':dbH[_0x0cd3('0x8b')][_0x0cd3('0x8c')][_0x0cd3('0x8d')]});}})[_0x0cd3('0x28')](function(){return{'sql':_0x301fca[_0x0cd3('0x8a')]()};})[_0x0cd3('0x28')](respondWithResult(_0x503598,null))[_0x0cd3('0x48')](handleError(_0x503598,null));};
\ No newline at end of file
+var _0xe1d1=['api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','reject','update','then','destroy','CustomReports','name','index','map','AnalyticCustomReport','fieldName','model','keys','query','filters','attributes','intersection','fields','nolimit','order','sort','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','find','create','body','get','user','Reports','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','table','MetricId','function','replace','format','groupBy','group','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignKey','foreignTable','conditions','clone','debug','toString','sequelize','SELECT','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','operator','Please\x20insert\x20at\x20least\x20one\x20field','from','metric','%s.%s\x20=\x20%s.%s','output','web','randomstring','generate','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','countTable','COUNT(*)','QueryTypes','run','runReport','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','Limited\x20Query:','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x2e0286,_0x46fa17){var _0x5b374b=function(_0xaa54ea){while(--_0xaa54ea){_0x2e0286['push'](_0x2e0286['shift']());}};_0x5b374b(++_0x46fa17);}(_0xe1d1,0x131));var _0x1e1d=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xe1d1[_0x2064e5];return _0x21a233;};'use strict';var emlformat=require(_0x1e1d('0x0'));var rimraf=require(_0x1e1d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1e1d('0x2'));var rp=require(_0x1e1d('0x3'));var moment=require(_0x1e1d('0x4'));var BPromise=require(_0x1e1d('0x5'));var Mustache=require('mustache');var util=require(_0x1e1d('0x6'));var path=require(_0x1e1d('0x7'));var sox=require(_0x1e1d('0x8'));var csv=require(_0x1e1d('0x9'));var ejs=require(_0x1e1d('0xa'));var fs=require('fs');var fs_extra=require(_0x1e1d('0xb'));var _=require('lodash');var squel=require(_0x1e1d('0xc'));var crypto=require(_0x1e1d('0xd'));var jsforce=require(_0x1e1d('0xe'));var deskjs=require(_0x1e1d('0xf'));var toCsv=require(_0x1e1d('0x9'));var querystring=require(_0x1e1d('0x10'));var Papa=require('papaparse');var Redis=require(_0x1e1d('0x11'));var authService=require(_0x1e1d('0x12'));var qs=require(_0x1e1d('0x13'));var as=require(_0x1e1d('0x14'));var hardwareService=require(_0x1e1d('0x15'));var logger=require(_0x1e1d('0x16'))(_0x1e1d('0x17'));var utils=require('../../config/utils');var config=require(_0x1e1d('0x18'));var licenseUtil=require(_0x1e1d('0x19'));var db=require(_0x1e1d('0x1a'))['db'];var dbH=require(_0x1e1d('0x1a'))[_0x1e1d('0x1b')];function respondWithStatusCode(_0x5b5449,_0x16e635){_0x16e635=_0x16e635||0xcc;return function(_0x1ee02c){if(_0x1ee02c){return _0x5b5449[_0x1e1d('0x1c')](_0x16e635);}return _0x5b5449['status'](_0x16e635)[_0x1e1d('0x1d')]();};}function respondWithResult(_0xc77de4,_0x173620){_0x173620=_0x173620||0xc8;return function(_0x119a87){if(_0x119a87){return _0xc77de4[_0x1e1d('0x1e')](_0x173620)['json'](_0x119a87);}};}function respondWithFilteredResult(_0x16cdf5,_0x466bdb){return function(_0x2bc2cf){if(_0x2bc2cf){var _0x274b76=typeof _0x466bdb[_0x1e1d('0x1f')]===_0x1e1d('0x20')&&typeof _0x466bdb[_0x1e1d('0x21')]===_0x1e1d('0x20');var _0x48d79f=_0x2bc2cf[_0x1e1d('0x22')];var _0x5dc4fa=_0x274b76?0x0:_0x466bdb[_0x1e1d('0x1f')];var _0x5eae62=_0x274b76?_0x2bc2cf[_0x1e1d('0x22')]:_0x466bdb[_0x1e1d('0x1f')]+_0x466bdb[_0x1e1d('0x21')];var _0x309589;if(_0x5eae62>=_0x48d79f){_0x5eae62=_0x48d79f;_0x309589=0xc8;}else{_0x309589=0xce;}_0x16cdf5[_0x1e1d('0x1e')](_0x309589);return _0x16cdf5['set'](_0x1e1d('0x23'),_0x5dc4fa+'-'+_0x5eae62+'/'+_0x48d79f)[_0x1e1d('0x24')](_0x2bc2cf);}return null;};}function patchUpdates(_0x152f33){return function(_0x48719c){try{jsonpatch['apply'](_0x48719c,_0x152f33,!![]);}catch(_0x747fc7){return BPromise[_0x1e1d('0x25')](_0x747fc7);}return _0x48719c['save']();};}function saveUpdates(_0xe5ada6,_0x3c1ab6){return function(_0x3b9e6e){if(_0x3b9e6e){return _0x3b9e6e[_0x1e1d('0x26')](_0xe5ada6)[_0x1e1d('0x27')](function(_0x59124f){return _0x59124f;});}return null;};}function removeEntity(_0x1a11dc,_0x559ba5){return function(_0x5f05f1){if(_0x5f05f1){return _0x5f05f1[_0x1e1d('0x28')]()[_0x1e1d('0x27')](function(){var _0x513371=_0x5f05f1['get']({'plain':!![]});var _0x1ff918=_0x1e1d('0x29');return db['UserProfileResource'][_0x1e1d('0x28')]({'where':{'type':_0x1ff918,'resourceId':_0x513371['id']}})[_0x1e1d('0x27')](function(){return _0x5f05f1;});})[_0x1e1d('0x27')](function(){_0x1a11dc[_0x1e1d('0x1e')](0xcc)[_0x1e1d('0x1d')]();});}};}function handleEntityNotFound(_0x15f703,_0x3c1181){return function(_0x47cb5f){if(!_0x47cb5f){_0x15f703[_0x1e1d('0x1c')](0x194);}return _0x47cb5f;};}function handleError(_0x136dc1,_0x3f93b8){_0x3f93b8=_0x3f93b8||0x1f4;return function(_0xb1388b){logger['error'](_0xb1388b['stack']);if(_0xb1388b[_0x1e1d('0x2a')]){delete _0xb1388b[_0x1e1d('0x2a')];}_0x136dc1[_0x1e1d('0x1e')](_0x3f93b8)['send'](_0xb1388b);};}exports[_0x1e1d('0x2b')]=function(_0x5959d7,_0x16ca2e){var _0x45a41f={},_0x28d48f={},_0x3b2e0e={'count':0x0,'rows':[]};var _0x434ee4=_[_0x1e1d('0x2c')](db[_0x1e1d('0x2d')]['rawAttributes'],function(_0x5eaf97){return{'name':_0x5eaf97[_0x1e1d('0x2e')],'type':_0x5eaf97['type']['key']};});_0x28d48f[_0x1e1d('0x2f')]=_[_0x1e1d('0x2c')](_0x434ee4,_0x1e1d('0x2a'));_0x28d48f['query']=_[_0x1e1d('0x30')](_0x5959d7[_0x1e1d('0x31')]);_0x28d48f[_0x1e1d('0x32')]=_['intersection'](_0x28d48f['model'],_0x28d48f[_0x1e1d('0x31')]);_0x45a41f[_0x1e1d('0x33')]=_[_0x1e1d('0x34')](_0x28d48f['model'],qs['fields'](_0x5959d7[_0x1e1d('0x31')][_0x1e1d('0x35')]));_0x45a41f[_0x1e1d('0x33')]=_0x45a41f[_0x1e1d('0x33')]['length']?_0x45a41f[_0x1e1d('0x33')]:_0x28d48f['model'];if(!_0x5959d7[_0x1e1d('0x31')]['hasOwnProperty'](_0x1e1d('0x36'))){_0x45a41f[_0x1e1d('0x21')]=qs[_0x1e1d('0x21')](_0x5959d7[_0x1e1d('0x31')]['limit']);_0x45a41f[_0x1e1d('0x1f')]=qs['offset'](_0x5959d7[_0x1e1d('0x31')]['offset']);}_0x45a41f[_0x1e1d('0x37')]=qs[_0x1e1d('0x38')](_0x5959d7[_0x1e1d('0x31')][_0x1e1d('0x38')]);_0x45a41f['where']=qs['filters'](_['pick'](_0x5959d7[_0x1e1d('0x31')],_0x28d48f[_0x1e1d('0x32')]),_0x434ee4);if(_0x5959d7['query'][_0x1e1d('0x39')]){_0x45a41f[_0x1e1d('0x3a')]=_[_0x1e1d('0x3b')](_0x45a41f[_0x1e1d('0x3a')],{'$or':_['map'](_0x434ee4,function(_0x1b83b8){if(_0x1b83b8[_0x1e1d('0x3c')]!==_0x1e1d('0x3d')){var _0x4812ca={};_0x4812ca[_0x1b83b8[_0x1e1d('0x2a')]]={'$like':'%'+_0x5959d7['query'][_0x1e1d('0x39')]+'%'};return _0x4812ca;}})});}_0x45a41f=_[_0x1e1d('0x3b')]({},_0x45a41f,_0x5959d7['options']);var _0x398f4d={'where':_0x45a41f[_0x1e1d('0x3a')]};return db[_0x1e1d('0x2d')][_0x1e1d('0x22')](_0x398f4d)[_0x1e1d('0x27')](function(_0x53a8e0){_0x3b2e0e[_0x1e1d('0x22')]=_0x53a8e0;if(_0x5959d7['query'][_0x1e1d('0x3e')]){_0x45a41f[_0x1e1d('0x3f')]=[{'all':!![]}];}return db[_0x1e1d('0x2d')][_0x1e1d('0x40')](_0x45a41f);})['then'](function(_0x5724bc){_0x3b2e0e[_0x1e1d('0x41')]=_0x5724bc;return _0x3b2e0e;})[_0x1e1d('0x27')](respondWithFilteredResult(_0x16ca2e,_0x45a41f))[_0x1e1d('0x42')](handleError(_0x16ca2e,null));};exports[_0x1e1d('0x43')]=function(_0xb9ad40,_0x568dc2){var _0x253448={'raw':![],'where':{'id':_0xb9ad40[_0x1e1d('0x44')]['id']}},_0x4c6657={};_0x4c6657[_0x1e1d('0x2f')]=_[_0x1e1d('0x30')](db[_0x1e1d('0x2d')][_0x1e1d('0x45')]);_0x4c6657[_0x1e1d('0x31')]=_[_0x1e1d('0x30')](_0xb9ad40[_0x1e1d('0x31')]);_0x4c6657[_0x1e1d('0x32')]=_[_0x1e1d('0x34')](_0x4c6657[_0x1e1d('0x2f')],_0x4c6657[_0x1e1d('0x31')]);_0x253448[_0x1e1d('0x33')]=_[_0x1e1d('0x34')](_0x4c6657[_0x1e1d('0x2f')],qs['fields'](_0xb9ad40['query']['fields']));_0x253448[_0x1e1d('0x33')]=_0x253448[_0x1e1d('0x33')][_0x1e1d('0x46')]?_0x253448['attributes']:_0x4c6657['model'];if(_0xb9ad40[_0x1e1d('0x31')]['includeAll']){_0x253448[_0x1e1d('0x3f')]=[{'all':!![]}];}_0x253448=_[_0x1e1d('0x3b')]({},_0x253448,_0xb9ad40[_0x1e1d('0x47')]);return db['AnalyticCustomReport'][_0x1e1d('0x48')](_0x253448)[_0x1e1d('0x27')](handleEntityNotFound(_0x568dc2,null))[_0x1e1d('0x27')](respondWithResult(_0x568dc2,null))[_0x1e1d('0x42')](handleError(_0x568dc2,null));};exports[_0x1e1d('0x49')]=function(_0x3e8ee2,_0x189f9b){return db[_0x1e1d('0x2d')][_0x1e1d('0x49')](_0x3e8ee2[_0x1e1d('0x4a')],{})[_0x1e1d('0x27')](function(_0x146650){var _0x126923=_0x3e8ee2['user'][_0x1e1d('0x4b')]({'plain':!![]});if(!_0x126923)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x126923['role']===_0x1e1d('0x4c')){var _0x5fd2e1=_0x146650[_0x1e1d('0x4b')]({'plain':!![]});var _0x258576=_0x1e1d('0x4d');return db['UserProfileSection'][_0x1e1d('0x48')]({'where':{'name':_0x258576,'userProfileId':_0x126923[_0x1e1d('0x4e')]},'raw':!![]})[_0x1e1d('0x27')](function(_0x42327b){if(_0x42327b&&_0x42327b[_0x1e1d('0x4f')]===0x0){return db[_0x1e1d('0x50')][_0x1e1d('0x49')]({'name':_0x5fd2e1[_0x1e1d('0x2a')],'resourceId':_0x5fd2e1['id'],'type':_0x1e1d('0x29'),'sectionId':_0x42327b['id']},{})['then'](function(){return _0x146650;});}else{return _0x146650;}})[_0x1e1d('0x42')](function(_0x342360){logger[_0x1e1d('0x51')](_0x1e1d('0x52'),_0x342360);throw _0x342360;});}return _0x146650;})['then'](respondWithResult(_0x189f9b,0xc9))[_0x1e1d('0x42')](handleError(_0x189f9b,null));};exports['update']=function(_0x163950,_0x4edf43){if(_0x163950[_0x1e1d('0x4a')]['id']){delete _0x163950['body']['id'];}return db[_0x1e1d('0x2d')][_0x1e1d('0x48')]({'where':{'id':_0x163950[_0x1e1d('0x44')]['id']}})[_0x1e1d('0x27')](handleEntityNotFound(_0x4edf43,null))[_0x1e1d('0x27')](saveUpdates(_0x163950[_0x1e1d('0x4a')],null))[_0x1e1d('0x27')](respondWithResult(_0x4edf43,null))['catch'](handleError(_0x4edf43,null));};exports[_0x1e1d('0x28')]=function(_0x266b75,_0x311425){return db['AnalyticCustomReport'][_0x1e1d('0x48')]({'where':{'id':_0x266b75[_0x1e1d('0x44')]['id']}})[_0x1e1d('0x27')](handleEntityNotFound(_0x311425,null))[_0x1e1d('0x27')](removeEntity(_0x311425,null))[_0x1e1d('0x42')](handleError(_0x311425,null));};exports[_0x1e1d('0x53')]=function(_0x33017c,_0x29cf69){var _0x5aba5c=0xa;var _0x312e95=[_0x1e1d('0x54'),_0x1e1d('0x55'),_0x1e1d('0x56'),_0x1e1d('0x57')];var _0x43070b={'SUM':'SUM(%s)','COUNT':_0x1e1d('0x58'),'COUNT DISTINCT':_0x1e1d('0x59'),'MAX':'MAX(%s)','MIN':_0x1e1d('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1e1d('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x250cb9={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x1e1d('0x5c'),'HOUR':_0x1e1d('0x5d'),'ROUND':_0x1e1d('0x5e'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2c2bff=function(_0x355070){return!_['includes'](['IS\x20NULL',_0x1e1d('0x5f'),_0x1e1d('0x60'),_0x1e1d('0x61')],_0x355070);};var _0x236cb6=function(_0x378ed6){if(!_0x378ed6||!_0x378ed6['rules'][_0x1e1d('0x46')]){return'';}for(var _0x585955='(',_0x83f831=0x0;_0x83f831<_0x378ed6[_0x1e1d('0x62')]['length'];_0x83f831+=0x1){_0x83f831>0x0&&(_0x585955+='\x20'+_0x378ed6['operator']+'\x20');_0x585955+=_0x378ed6[_0x1e1d('0x62')][_0x83f831]['group']?_0x236cb6(_0x378ed6[_0x1e1d('0x62')][_0x83f831]['group']):_0x378ed6['rules'][_0x83f831][_0x1e1d('0x63')]+'\x20'+_0x378ed6[_0x1e1d('0x62')][_0x83f831][_0x1e1d('0x64')]+(_0x2c2bff(_0x378ed6[_0x1e1d('0x62')][_0x83f831][_0x1e1d('0x64')])?'\x20'+_0x378ed6['rules'][_0x83f831][_0x1e1d('0x65')]:'');}return _0x585955+')';};var _0x270af8={'where':{'id':_0x33017c['params']['id']}},_0x4d0748,_0xc53ad9,_0x4c64ae,_0x3fc4de,_0x592061;_0x270af8=_[_0x1e1d('0x3b')]({},_0x270af8,_0x33017c[_0x1e1d('0x47')]);return db[_0x1e1d('0x2d')][_0x1e1d('0x48')](_0x270af8)['then'](function(_0x408628){if(_0x408628){_0x4d0748=_0x408628;return _0x408628[_0x1e1d('0x66')]();}return null;})[_0x1e1d('0x27')](function(_0x252041){if(_0x252041){if(!_0x252041[_0x1e1d('0x46')]){throw new db[(_0x1e1d('0x67'))][(_0x1e1d('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xc53ad9=_0x252041;return db[_0x1e1d('0x69')][_0x1e1d('0x40')]({'raw':!![]});}return null;})[_0x1e1d('0x27')](function(_0x5776b6){if(_0x5776b6){_0x4c64ae=_[_0x1e1d('0x6a')](_0x5776b6,'id');var _0x1cc924;var _0x5efcbc=squel[_0x1e1d('0x6b')]();_0x5efcbc['from'](_0x4d0748[_0x1e1d('0x6c')]);for(var _0x2bfc70=0x0;_0x2bfc70<_0xc53ad9['length'];_0x2bfc70+=0x1){_0x1cc924=_0xc53ad9[_0x2bfc70][_0x1e1d('0x6d')]?_0x4c64ae[_0xc53ad9[_0x2bfc70][_0x1e1d('0x6d')]]['metric']:_0xc53ad9[_0x2bfc70]['field'];_0x1cc924=_0xc53ad9[_0x2bfc70][_0x1e1d('0x6e')]?_[_0x1e1d('0x6f')](_0x43070b[_0xc53ad9[_0x2bfc70][_0x1e1d('0x6e')]],'%s',_0x1cc924):_0x1cc924;_0x1cc924=_0xc53ad9[_0x2bfc70][_0x1e1d('0x70')]?_[_0x1e1d('0x6f')](_0x250cb9[_0xc53ad9[_0x2bfc70][_0x1e1d('0x70')]],'%s',_0x1cc924):_0x1cc924;if(_0xc53ad9[_0x2bfc70][_0x1e1d('0x71')]){_0x5efcbc[_0x1e1d('0x72')](_0x1cc924);}_0xc53ad9[_0x2bfc70][_0x1e1d('0x73')]&&_0x5efcbc[_0x1e1d('0x37')](_0x1cc924,_0xc53ad9[_0x2bfc70][_0x1e1d('0x73')]===_0x1e1d('0x74')?![]:!![]);_0x5efcbc['field'](_0x1cc924,_0xc53ad9[_0x2bfc70][_0x1e1d('0x75')]||_0x1cc924);}if(_0x4d0748[_0x1e1d('0x76')]){_0x4d0748[_0x1e1d('0x76')]=JSON[_0x1e1d('0x77')](_0x4d0748[_0x1e1d('0x76')]);for(var _0x36361e=0x0;_0x36361e<_0x4d0748[_0x1e1d('0x76')][_0x1e1d('0x46')];_0x36361e+=0x1){if(_0x4d0748['joins'][_0x36361e]['type']&&_[_0x1e1d('0x78')](_0x312e95,_0x4d0748[_0x1e1d('0x76')][_0x36361e][_0x1e1d('0x3c')])&&_0x4d0748['joins'][_0x36361e][_0x1e1d('0x79')]&&_0x4d0748['joins'][_0x36361e]['foreignTable']&&_0x4d0748[_0x1e1d('0x76')][_0x36361e][_0x1e1d('0x7a')]){_0x5efcbc[_0x4d0748['joins'][_0x36361e]['type']](_0x4d0748[_0x1e1d('0x76')][_0x36361e][_0x1e1d('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x4d0748[_0x1e1d('0x6c')],_0x4d0748[_0x1e1d('0x76')][_0x36361e][_0x1e1d('0x79')],_0x4d0748['joins'][_0x36361e][_0x1e1d('0x7b')],_0x4d0748[_0x1e1d('0x76')][_0x36361e][_0x1e1d('0x7a')]));}}}if(_0x4d0748[_0x1e1d('0x7c')]){_0x4d0748[_0x1e1d('0x7c')]=JSON['parse'](_0x4d0748['conditions']);_0x5efcbc[_0x1e1d('0x3a')](_0x236cb6(_0x4d0748[_0x1e1d('0x7c')][_0x1e1d('0x72')]));}_0x592061=_0x5efcbc[_0x1e1d('0x7d')]();_0x5efcbc[_0x1e1d('0x21')](_0x5aba5c);_0x5efcbc[_0x1e1d('0x1f')](0x0);logger[_0x1e1d('0x7e')]('Limited\x20Query:',_0x5efcbc[_0x1e1d('0x7f')]());return dbH[_0x1e1d('0x80')][_0x1e1d('0x31')](_0x5efcbc[_0x1e1d('0x7f')](),{'type':dbH[_0x1e1d('0x80')]['QueryTypes'][_0x1e1d('0x81')]});}})[_0x1e1d('0x27')](respondWithResult(_0x29cf69,null))[_0x1e1d('0x42')](handleError(_0x29cf69,null));};function runReport(_0x26ba67,_0x467af0,_0x128d0e){var _0x31f3e7=_0x467af0[_0x1e1d('0x2a')];var _0x1c1c39=0xa;var _0x1e6ec6=['join',_0x1e1d('0x55'),_0x1e1d('0x56'),_0x1e1d('0x57')];var _0xded4fa={'SUM':'SUM(%s)','COUNT':_0x1e1d('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x1e1d('0x82'),'MIN':'MIN(%s)','AVG':_0x1e1d('0x83'),'GROUP_CONCAT':_0x1e1d('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4822f1={'SEC_TO_TIME':_0x1e1d('0x84'),'DATE':_0x1e1d('0x5c'),'HOUR':_0x1e1d('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x1e1d('0x85')};var _0x40d924=function(_0x5deacd){return!_['includes']([_0x1e1d('0x86'),_0x1e1d('0x5f'),_0x1e1d('0x60'),_0x1e1d('0x61')],_0x5deacd);};var _0x60d32d=function(_0x110bd7){if(!_0x110bd7||!_0x110bd7['rules'][_0x1e1d('0x46')]){return'';}for(var _0x47dbb7='(',_0x26906d=0x0;_0x26906d<_0x110bd7[_0x1e1d('0x62')]['length'];_0x26906d+=0x1){_0x26906d>0x0&&(_0x47dbb7+='\x20'+_0x110bd7[_0x1e1d('0x87')]+'\x20');_0x47dbb7+=_0x110bd7[_0x1e1d('0x62')][_0x26906d][_0x1e1d('0x72')]?_0x60d32d(_0x110bd7[_0x1e1d('0x62')][_0x26906d][_0x1e1d('0x72')]):_0x110bd7[_0x1e1d('0x62')][_0x26906d][_0x1e1d('0x63')]+'\x20'+_0x110bd7['rules'][_0x26906d][_0x1e1d('0x64')]+(_0x40d924(_0x110bd7[_0x1e1d('0x62')][_0x26906d]['condition'])?'\x20'+_0x110bd7[_0x1e1d('0x62')][_0x26906d]['value']:'');}return _0x47dbb7+')';};var _0x486720={'where':{'id':_0x26ba67['id']}},_0x583382,_0x58dc9c,_0x5c4369,_0x22f5ca,_0x434793;_0x486720=_[_0x1e1d('0x3b')]({},_0x486720,_0x128d0e);return db[_0x1e1d('0x2d')][_0x1e1d('0x48')](_0x486720)[_0x1e1d('0x27')](function(_0x539603){if(_0x539603){_0x583382=_0x539603;return _0x539603[_0x1e1d('0x66')]();}return null;})[_0x1e1d('0x27')](function(_0x424436){if(_0x424436){if(!_0x424436['length']){throw new db[(_0x1e1d('0x67'))]['ValidationErrorItem'](_0x1e1d('0x88'),0x193);}_0x58dc9c=_0x424436;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x1e1d('0x27')](function(_0x2825fe){if(_0x2825fe){_0x5c4369=_[_0x1e1d('0x6a')](_0x2825fe,'id');var _0xa0cc56;var _0x131af9=squel['select']();_0x131af9[_0x1e1d('0x89')](_0x583382[_0x1e1d('0x6c')]);for(var _0xfc326c=0x0;_0xfc326c<_0x58dc9c[_0x1e1d('0x46')];_0xfc326c+=0x1){_0xa0cc56=_0x58dc9c[_0xfc326c][_0x1e1d('0x6d')]?_0x5c4369[_0x58dc9c[_0xfc326c]['MetricId']][_0x1e1d('0x8a')]:_0x58dc9c[_0xfc326c][_0x1e1d('0x63')];_0xa0cc56=_0x58dc9c[_0xfc326c][_0x1e1d('0x6e')]?_[_0x1e1d('0x6f')](_0xded4fa[_0x58dc9c[_0xfc326c][_0x1e1d('0x6e')]],'%s',_0xa0cc56):_0xa0cc56;_0xa0cc56=_0x58dc9c[_0xfc326c]['format']?_['replace'](_0x4822f1[_0x58dc9c[_0xfc326c][_0x1e1d('0x70')]],'%s',_0xa0cc56):_0xa0cc56;if(_0x58dc9c[_0xfc326c][_0x1e1d('0x71')]){_0x131af9[_0x1e1d('0x72')](_0xa0cc56);}_0x58dc9c[_0xfc326c][_0x1e1d('0x73')]&&_0x131af9[_0x1e1d('0x37')](_0xa0cc56,_0x58dc9c[_0xfc326c][_0x1e1d('0x73')]===_0x1e1d('0x74')?![]:!![]);_0x131af9[_0x1e1d('0x63')](_0xa0cc56,_0x58dc9c[_0xfc326c][_0x1e1d('0x75')]||_0xa0cc56);}if(_0x583382[_0x1e1d('0x76')]){_0x583382[_0x1e1d('0x76')]=JSON['parse'](_0x583382['joins']);for(var _0x3befdd=0x0;_0x3befdd<_0x583382[_0x1e1d('0x76')][_0x1e1d('0x46')];_0x3befdd+=0x1){if(_0x583382[_0x1e1d('0x76')][_0x3befdd]['type']&&_[_0x1e1d('0x78')](_0x1e6ec6,_0x583382[_0x1e1d('0x76')][_0x3befdd]['type'])&&_0x583382[_0x1e1d('0x76')][_0x3befdd][_0x1e1d('0x79')]&&_0x583382[_0x1e1d('0x76')][_0x3befdd][_0x1e1d('0x7b')]&&_0x583382[_0x1e1d('0x76')][_0x3befdd][_0x1e1d('0x7a')]){_0x131af9[_0x583382['joins'][_0x3befdd]['type']](_0x583382[_0x1e1d('0x76')][_0x3befdd]['foreignTable'],null,util[_0x1e1d('0x70')](_0x1e1d('0x8b'),_0x583382[_0x1e1d('0x6c')],_0x583382[_0x1e1d('0x76')][_0x3befdd][_0x1e1d('0x79')],_0x583382[_0x1e1d('0x76')][_0x3befdd][_0x1e1d('0x7b')],_0x583382['joins'][_0x3befdd][_0x1e1d('0x7a')]));}}}if(_0x583382['conditions']){_0x583382[_0x1e1d('0x7c')]=JSON['parse'](_0x583382[_0x1e1d('0x7c')]);_0x131af9['where'](_0x60d32d(_0x583382[_0x1e1d('0x7c')][_0x1e1d('0x72')]));}_0x434793=_0x131af9[_0x1e1d('0x7d')]();_0x131af9[_0x1e1d('0x21')](_0x1c1c39);_0x131af9['offset'](0x0);return;}})[_0x1e1d('0x27')](function(){if(_0x467af0[_0x1e1d('0x8c')]===_0x1e1d('0x8d')){return null;}var _0x2af1c6=_['merge'](_0x467af0,{'name':_0x467af0['fullPath']||_0x467af0[_0x1e1d('0x2a')]||_0x583382['name'],'basename':_0x31f3e7,'savename':util['format']('%s-%s.%s',_0x467af0[_0x1e1d('0x2a')]||_0x583382[_0x1e1d('0x2a')],require(_0x1e1d('0x8e'))[_0x1e1d('0x8f')](0x4),_0x467af0[_0x1e1d('0x8c')]||'csv'),'reportId':_0x583382['id'],'reportType':_0x1e1d('0x90')});return db[_0x1e1d('0x91')][_0x1e1d('0x49')](_0x2af1c6,{'raw':!![]});})['then'](function(_0x2dbce3){if(_0x583382['table']===_0x1e1d('0x92')){_0x434793[_0x1e1d('0x3a')](_0x583382['table']+_0x1e1d('0x93'),_0x467af0[_0x1e1d('0x94')],_0x467af0[_0x1e1d('0x95')]);}else{_0x434793[_0x1e1d('0x3a')](_0x583382[_0x1e1d('0x6c')]+_0x1e1d('0x96'),_0x467af0[_0x1e1d('0x94')],_0x467af0['endDate']);}if(_0x2dbce3){logger[_0x1e1d('0x97')](_0x1e1d('0x98'),_0x434793[_0x1e1d('0x7f')]());require(_0x1e1d('0x99'))[_0x1e1d('0x9a')](path[_0x1e1d('0x54')](__dirname,'../../components/export/',_0x2dbce3[_0x1e1d('0x8c')]),[_0x2dbce3['id'],_0x434793[_0x1e1d('0x7f')](),path[_0x1e1d('0x54')](__dirname,_0x1e1d('0x9b'),_0x2dbce3['savename']),_0x31f3e7]);return _0x2dbce3;}else{var _0x17fb2f=squel[_0x1e1d('0x6b')]();_0x17fb2f['from']('('+_0x434793[_0x1e1d('0x7f')]()+')',_0x1e1d('0x9c'));_0x17fb2f['field'](_0x1e1d('0x9d'),'count');_0x434793[_0x1e1d('0x21')](_0x467af0['limit']||_0x1c1c39);_0x434793[_0x1e1d('0x1f')](_0x467af0[_0x1e1d('0x1f')]||0x0);return dbH[_0x1e1d('0x80')][_0x1e1d('0x31')](_0x17fb2f[_0x1e1d('0x7f')](),{'type':dbH['sequelize'][_0x1e1d('0x9e')]['SELECT']})[_0x1e1d('0x27')](function(_0x7f4f33){if(!_0x7f4f33['length']){_0x22f5ca=0x0;}else{_0x22f5ca=_0x7f4f33[0x0][_0x1e1d('0x22')]||0x0;}return dbH[_0x1e1d('0x80')][_0x1e1d('0x31')](_0x434793[_0x1e1d('0x7f')](),{'type':dbH[_0x1e1d('0x80')][_0x1e1d('0x9e')][_0x1e1d('0x81')]});})[_0x1e1d('0x27')](function(_0xc4e95b){return{'rows':_0xc4e95b||[],'count':_0x22f5ca};});}});}exports[_0x1e1d('0x9f')]=function(_0x318404,_0x118929){return runReport(_0x318404[_0x1e1d('0x44')],_0x318404[_0x1e1d('0x31')],_0x318404[_0x1e1d('0x47')])[_0x1e1d('0x27')](respondWithResult(_0x118929,null))[_0x1e1d('0x42')](handleError(_0x118929,null));};exports[_0x1e1d('0xa0')]=runReport;exports[_0x1e1d('0x31')]=function(_0x328e6f,_0x5a6c49){var _0x268ccf=0xa;var _0x159205=[_0x1e1d('0x54'),'left_join',_0x1e1d('0x56'),_0x1e1d('0x57')];var _0x24b9e2={'SUM':_0x1e1d('0xa1'),'COUNT':_0x1e1d('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x1e1d('0x82'),'MIN':_0x1e1d('0x5a'),'AVG':_0x1e1d('0x83'),'GROUP_CONCAT':_0x1e1d('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x1e1d('0xa2')};var _0x504faf={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x1e1d('0x5c'),'HOUR':_0x1e1d('0x5d'),'ROUND':_0x1e1d('0x5e'),'UNIX_TIMESTAMP':_0x1e1d('0x85')};var _0xbe6fba=function(_0x1b01af){return!_[_0x1e1d('0x78')]([_0x1e1d('0x86'),_0x1e1d('0x5f'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x1b01af);};var _0x2d89a3=function(_0x42a395){if(!_0x42a395||!_0x42a395[_0x1e1d('0x62')][_0x1e1d('0x46')]){return'';}for(var _0x3980c4='(',_0x28ef8f=0x0;_0x28ef8f<_0x42a395['rules'][_0x1e1d('0x46')];_0x28ef8f+=0x1){_0x28ef8f>0x0&&(_0x3980c4+='\x20'+_0x42a395[_0x1e1d('0x87')]+'\x20');_0x3980c4+=_0x42a395[_0x1e1d('0x62')][_0x28ef8f][_0x1e1d('0x72')]?_0x2d89a3(_0x42a395[_0x1e1d('0x62')][_0x28ef8f][_0x1e1d('0x72')]):_0x42a395[_0x1e1d('0x62')][_0x28ef8f][_0x1e1d('0x63')]+'\x20'+_0x42a395[_0x1e1d('0x62')][_0x28ef8f][_0x1e1d('0x64')]+(_0xbe6fba(_0x42a395[_0x1e1d('0x62')][_0x28ef8f][_0x1e1d('0x64')])?'\x20'+_0x42a395['rules'][_0x28ef8f][_0x1e1d('0x65')]:'');}return _0x3980c4+')';};var _0x50fe8d={'where':{'id':_0x328e6f[_0x1e1d('0x44')]['id']}},_0x22158f,_0x7c7aa0,_0x376991,_0x1cc2db,_0xb43c67;_0x50fe8d=_[_0x1e1d('0x3b')]({},_0x50fe8d,_0x328e6f[_0x1e1d('0x47')]);return db[_0x1e1d('0x2d')][_0x1e1d('0x48')](_0x50fe8d)[_0x1e1d('0x27')](function(_0x4fbc2c){if(_0x4fbc2c){_0x22158f=_0x4fbc2c;return _0x4fbc2c[_0x1e1d('0x66')]();}return null;})[_0x1e1d('0x27')](function(_0x54fdeb){if(_0x54fdeb){if(!_0x54fdeb[_0x1e1d('0x46')]){throw new db[(_0x1e1d('0x67'))]['ValidationErrorItem'](_0x1e1d('0x88'),0x193);}_0x7c7aa0=_0x54fdeb;return db[_0x1e1d('0x69')][_0x1e1d('0x40')]({'raw':!![]});}return null;})[_0x1e1d('0x27')](function(_0x3f485d){if(_0x3f485d){_0x376991=_[_0x1e1d('0x6a')](_0x3f485d,'id');var _0xcc99c8;var _0x1c59d2=squel[_0x1e1d('0x6b')]();_0x1c59d2[_0x1e1d('0x89')](_0x22158f[_0x1e1d('0x6c')]);for(var _0x2d3120=0x0;_0x2d3120<_0x7c7aa0[_0x1e1d('0x46')];_0x2d3120+=0x1){_0xcc99c8=_0x7c7aa0[_0x2d3120]['MetricId']?_0x376991[_0x7c7aa0[_0x2d3120][_0x1e1d('0x6d')]]['metric']:_0x7c7aa0[_0x2d3120][_0x1e1d('0x63')];_0xcc99c8=_0x7c7aa0[_0x2d3120][_0x1e1d('0x6e')]?_['replace'](_0x24b9e2[_0x7c7aa0[_0x2d3120][_0x1e1d('0x6e')]],'%s',_0xcc99c8):_0xcc99c8;_0xcc99c8=_0x7c7aa0[_0x2d3120]['format']?_[_0x1e1d('0x6f')](_0x504faf[_0x7c7aa0[_0x2d3120][_0x1e1d('0x70')]],'%s',_0xcc99c8):_0xcc99c8;if(_0x7c7aa0[_0x2d3120][_0x1e1d('0x71')]){_0x1c59d2['group'](_0xcc99c8);}_0x7c7aa0[_0x2d3120][_0x1e1d('0x73')]&&_0x1c59d2['order'](_0xcc99c8,_0x7c7aa0[_0x2d3120][_0x1e1d('0x73')]===_0x1e1d('0x74')?![]:!![]);_0x1c59d2['field'](_0xcc99c8,_0x7c7aa0[_0x2d3120][_0x1e1d('0x75')]||_0xcc99c8);}if(_0x22158f[_0x1e1d('0x76')]){_0x22158f[_0x1e1d('0x76')]=JSON[_0x1e1d('0x77')](_0x22158f[_0x1e1d('0x76')]);for(var _0x16c61d=0x0;_0x16c61d<_0x22158f[_0x1e1d('0x76')][_0x1e1d('0x46')];_0x16c61d+=0x1){if(_0x22158f[_0x1e1d('0x76')][_0x16c61d][_0x1e1d('0x3c')]&&_[_0x1e1d('0x78')](_0x159205,_0x22158f['joins'][_0x16c61d][_0x1e1d('0x3c')])&&_0x22158f[_0x1e1d('0x76')][_0x16c61d]['parentKey']&&_0x22158f['joins'][_0x16c61d]['foreignTable']&&_0x22158f[_0x1e1d('0x76')][_0x16c61d][_0x1e1d('0x7a')]){_0x1c59d2[_0x22158f['joins'][_0x16c61d]['type']](_0x22158f['joins'][_0x16c61d][_0x1e1d('0x7b')],null,util[_0x1e1d('0x70')](_0x1e1d('0x8b'),_0x22158f[_0x1e1d('0x6c')],_0x22158f[_0x1e1d('0x76')][_0x16c61d][_0x1e1d('0x79')],_0x22158f['joins'][_0x16c61d]['foreignTable'],_0x22158f[_0x1e1d('0x76')][_0x16c61d][_0x1e1d('0x7a')]));}}}if(_0x22158f['conditions']){_0x22158f[_0x1e1d('0x7c')]=JSON[_0x1e1d('0x77')](_0x22158f[_0x1e1d('0x7c')]);_0x1c59d2['where'](_0x2d89a3(_0x22158f[_0x1e1d('0x7c')][_0x1e1d('0x72')]));}_0xb43c67=_0x1c59d2[_0x1e1d('0x7d')]();_0x1c59d2[_0x1e1d('0x21')](_0x268ccf);_0x1c59d2[_0x1e1d('0x1f')](0x0);logger[_0x1e1d('0x7e')](_0x1e1d('0xa3'),_0x1c59d2[_0x1e1d('0x7f')]());return dbH[_0x1e1d('0x80')]['query'](_0x1c59d2[_0x1e1d('0x7f')](),{'type':dbH[_0x1e1d('0x80')][_0x1e1d('0x9e')][_0x1e1d('0x81')]});}})['then'](function(){return{'sql':_0xb43c67['toString']()};})[_0x1e1d('0x27')](respondWithResult(_0x5a6c49,null))[_0x1e1d('0x42')](handleError(_0x5a6c49,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index fd1dc43..66a848d 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 _0x72bd=['request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','api'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x72bd,0xcf));var _0xd72b=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x72bd[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0xd72b('0x0'));var util=require('util');var logger=require(_0xd72b('0x1'))(_0xd72b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd72b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd72b('0x4'));var config=require(_0xd72b('0x5'));var attributes=require(_0xd72b('0x6'));module['exports']=function(_0x3f3b04,_0x1668d8){return _0x3f3b04[_0xd72b('0x7')](_0xd72b('0x8'),attributes,{'tableName':_0xd72b('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf59c=['path','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','api','moment','bluebird'];(function(_0x53930c,_0x407eb1){var _0x3d5db2=function(_0x2d247c){while(--_0x2d247c){_0x53930c['push'](_0x53930c['shift']());}};_0x3d5db2(++_0x407eb1);}(_0xf59c,0x127));var _0xcf59=function(_0xa4405e,_0x4b5af1){_0xa4405e=_0xa4405e-0x0;var _0x29e6a5=_0xf59c[_0xa4405e];return _0x29e6a5;};'use strict';var _=require(_0xcf59('0x0'));var util=require(_0xcf59('0x1'));var logger=require('../../config/logger')(_0xcf59('0x2'));var moment=require(_0xcf59('0x3'));var BPromise=require(_0xcf59('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf59('0x5'));var rimraf=require(_0xcf59('0x6'));var config=require('../../config/environment');var attributes=require(_0xcf59('0x7'));module[_0xcf59('0x8')]=function(_0x110816,_0x18f214){return _0x110816[_0xcf59('0x9')](_0xcf59('0xa'),attributes,{'tableName':_0xcf59('0xb'),'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 7723650..3cf8770 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 _0x5433=['result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x292f4a,_0x556180){var _0x4dcf71=function(_0x3bb767){while(--_0x3bb767){_0x292f4a['push'](_0x292f4a['shift']());}};_0x4dcf71(++_0x556180);}(_0x5433,0x167));var _0x3543=function(_0x25d6c5,_0x262eb0){_0x25d6c5=_0x25d6c5-0x0;var _0x78eb4b=_0x5433[_0x25d6c5];return _0x78eb4b;};'use strict';var _=require('lodash');var util=require(_0x3543('0x0'));var moment=require(_0x3543('0x1'));var BPromise=require(_0x3543('0x2'));var rs=require(_0x3543('0x3'));var fs=require('fs');var Redis=require(_0x3543('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3543('0x5'))(_0x3543('0x6'));var config=require(_0x3543('0x7'));var jayson=require(_0x3543('0x8'));var client=jayson[_0x3543('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a5729,_0xf1f114,_0x46630f){return new BPromise(function(_0x4d6567,_0x1e37ab){return client[_0x3543('0xa')](_0x3a5729,_0x46630f)[_0x3543('0xb')](function(_0x3e6620){logger[_0x3543('0xc')](_0x3543('0xd'),_0xf1f114,_0x3543('0xe'));logger[_0x3543('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0xf1f114,_0x3543('0xe'),JSON[_0x3543('0x10')](_0x3e6620));if(_0x3e6620[_0x3543('0x11')]){if(_0x3e6620[_0x3543('0x11')]['code']===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0xf1f114,_0x3e6620['error'][_0x3543('0x12')]);return _0x1e37ab(_0x3e6620[_0x3543('0x11')][_0x3543('0x12')]);}logger['error'](_0x3543('0xd'),_0xf1f114,_0x3e6620[_0x3543('0x11')][_0x3543('0x12')]);return _0x4d6567(_0x3e6620[_0x3543('0x11')][_0x3543('0x12')]);}else{logger[_0x3543('0xc')](_0x3543('0xd'),_0xf1f114,_0x3543('0xe'));_0x4d6567(_0x3e6620[_0x3543('0x13')][_0x3543('0x12')]);}})[_0x3543('0x14')](function(_0x1c5354){logger[_0x3543('0x11')](_0x3543('0xd'),_0xf1f114,_0x1c5354);_0x1e37ab(_0x1c5354);});});}
\ No newline at end of file
+var _0x974a=['stringify','error','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s'];(function(_0x51c976,_0x10016f){var _0x4d1da8=function(_0x1783f5){while(--_0x1783f5){_0x51c976['push'](_0x51c976['shift']());}};_0x4d1da8(++_0x10016f);}(_0x974a,0x10e));var _0xa974=function(_0x506bc5,_0x5ab7c7){_0x506bc5=_0x506bc5-0x0;var _0x3ce96b=_0x974a[_0x506bc5];return _0x3ce96b;};'use strict';var _=require(_0xa974('0x0'));var util=require('util');var moment=require(_0xa974('0x1'));var BPromise=require('bluebird');var rs=require(_0xa974('0x2'));var fs=require('fs');var Redis=require(_0xa974('0x3'));var db=require(_0xa974('0x4'))['db'];var utils=require(_0xa974('0x5'));var logger=require(_0xa974('0x6'))(_0xa974('0x7'));var config=require(_0xa974('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa974('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ac3f4,_0x1ef05c,_0x4ad1b9){return new BPromise(function(_0x1814f3,_0x49cda7){return client[_0xa974('0xa')](_0x5ac3f4,_0x4ad1b9)[_0xa974('0xb')](function(_0x406cf3){logger[_0xa974('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1ef05c,_0xa974('0xd'));logger[_0xa974('0xe')](_0xa974('0xf'),_0x1ef05c,'request\x20sent',JSON[_0xa974('0x10')](_0x406cf3));if(_0x406cf3[_0xa974('0x11')]){if(_0x406cf3[_0xa974('0x11')]['code']===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x1ef05c,_0x406cf3['error'][_0xa974('0x12')]);return _0x49cda7(_0x406cf3[_0xa974('0x11')][_0xa974('0x12')]);}logger[_0xa974('0x11')](_0xa974('0x13'),_0x1ef05c,_0x406cf3[_0xa974('0x11')][_0xa974('0x12')]);return _0x1814f3(_0x406cf3[_0xa974('0x11')]['message']);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x1ef05c,_0xa974('0xd'));_0x1814f3(_0x406cf3[_0xa974('0x14')]['message']);}})[_0xa974('0x15')](function(_0x3059bf){logger[_0xa974('0x11')](_0xa974('0x13'),_0x1ef05c,_0x3059bf);_0x49cda7(_0x3059bf);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index b66d8fb..3897bf7 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 _0xa2ec=['destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','/:id','isAuthenticated','/:id/preview','preview','/:id/run','query','post','create','put'];(function(_0x4838d5,_0x5e0bd8){var _0x34c70f=function(_0x44d011){while(--_0x44d011){_0x4838d5['push'](_0x4838d5['shift']());}};_0x34c70f(++_0x5e0bd8);}(_0xa2ec,0x1e2));var _0xca2e=function(_0x22d655,_0x3941dd){_0x22d655=_0x22d655-0x0;var _0x257739=_0xa2ec[_0x22d655];return _0x257739;};'use strict';var multer=require(_0xca2e('0x0'));var util=require(_0xca2e('0x1'));var path=require('path');var timeout=require(_0xca2e('0x2'));var express=require(_0xca2e('0x3'));var router=express[_0xca2e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xca2e('0x5'));var interaction=require(_0xca2e('0x6'));var config=require('../../config/environment');var controller=require(_0xca2e('0x7'));router[_0xca2e('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xca2e('0x8')](_0xca2e('0x9'),auth[_0xca2e('0xa')](),controller['show']);router[_0xca2e('0x8')](_0xca2e('0xb'),auth['isAuthenticated'](),controller[_0xca2e('0xc')]);router['get'](_0xca2e('0xd'),auth['isAuthenticated'](),controller['run']);router[_0xca2e('0x8')]('/:id/query',auth[_0xca2e('0xa')](),controller[_0xca2e('0xe')]);router[_0xca2e('0xf')]('/',auth[_0xca2e('0xa')](),controller[_0xca2e('0x10')]);router[_0xca2e('0x11')](_0xca2e('0x9'),auth[_0xca2e('0xa')](),controller['update']);router['delete'](_0xca2e('0x9'),auth['isAuthenticated'](),controller[_0xca2e('0x12')]);module[_0xca2e('0x13')]=router;
\ No newline at end of file
+var _0x7109=['fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','delete','destroy','multer','util','path','express','Router'];(function(_0x1b26ac,_0x5ea577){var _0x2d88ec=function(_0x4d6110){while(--_0x4d6110){_0x1b26ac['push'](_0x1b26ac['shift']());}};_0x2d88ec(++_0x5ea577);}(_0x7109,0x73));var _0x9710=function(_0x70fd53,_0x2a95a6){_0x70fd53=_0x70fd53-0x0;var _0x4b71c5=_0x7109[_0x70fd53];return _0x4b71c5;};'use strict';var multer=require(_0x9710('0x0'));var util=require(_0x9710('0x1'));var path=require(_0x9710('0x2'));var timeout=require('connect-timeout');var express=require(_0x9710('0x3'));var router=express[_0x9710('0x4')]();var fs_extra=require(_0x9710('0x5'));var auth=require(_0x9710('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9710('0x7'));var controller=require(_0x9710('0x8'));router[_0x9710('0x9')]('/',auth['isAuthenticated'](),controller[_0x9710('0xa')]);router['get'](_0x9710('0xb'),auth[_0x9710('0xc')](),controller[_0x9710('0xd')]);router[_0x9710('0x9')](_0x9710('0xe'),auth[_0x9710('0xc')](),controller[_0x9710('0xf')]);router['get'](_0x9710('0x10'),auth[_0x9710('0xc')](),controller[_0x9710('0x11')]);router['get'](_0x9710('0x12'),auth[_0x9710('0xc')](),controller[_0x9710('0x13')]);router[_0x9710('0x14')]('/',auth[_0x9710('0xc')](),controller[_0x9710('0x15')]);router['put'](_0x9710('0xb'),auth[_0x9710('0xc')](),controller['update']);router[_0x9710('0x16')](_0x9710('0xb'),auth[_0x9710('0xc')](),controller[_0x9710('0x17')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 1622248..3358daa 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 _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x296187,_0x66707b){var _0x4565d2=function(_0xb3f7cb){while(--_0xb3f7cb){_0x296187['push'](_0x296187['shift']());}};_0x4565d2(++_0x66707b);}(_0x5fab,0x177));var _0xb5fa=function(_0x4706a6,_0x5a1c63){_0x4706a6=_0x4706a6-0x0;var _0x1bb705=_0x5fab[_0x4706a6];return _0x1bb705;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}};
\ No newline at end of file
+var _0x24ca=['sequelize','STRING','TEXT'];(function(_0x1c5835,_0x20431a){var _0x558ebf=function(_0x2bc9da){while(--_0x2bc9da){_0x1c5835['push'](_0x1c5835['shift']());}};_0x558ebf(++_0x20431a);}(_0x24ca,0x1bc));var _0xa24c=function(_0x53b133,_0x176261){_0x53b133=_0x53b133-0x0;var _0x5647e0=_0x24ca[_0x53b133];return _0x5647e0;};'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/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 9f333cc..fd62ccc 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x513047,_0x2199c5){var _0x15b779=function(_0x412fd5){while(--_0x412fd5){_0x513047['push'](_0x513047['shift']());}};_0x15b779(++_0x2199c5);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc4aa[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));};
\ No newline at end of file
+var _0xba34=['save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%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\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','AVG(%s)','IS\x20NOT\x20NULL','value','order','output','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','fork','countTable','QueryTypes','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject'];(function(_0x1a9ed0,_0x1085fc){var _0x47bbd6=function(_0x27bd1c){while(--_0x27bd1c){_0x1a9ed0['push'](_0x1a9ed0['shift']());}};_0x47bbd6(++_0x1085fc);}(_0xba34,0x119));var _0x4ba3=function(_0x492e80,_0xd87aba){_0x492e80=_0x492e80-0x0;var _0x413d79=_0xba34[_0x492e80];return _0x413d79;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4ba3('0x19'))['dbH'];function respondWithStatusCode(_0x256f02,_0x4419b4){_0x4419b4=_0x4419b4||0xcc;return function(_0x29e498){if(_0x29e498){return _0x256f02[_0x4ba3('0x1a')](_0x4419b4);}return _0x256f02[_0x4ba3('0x1b')](_0x4419b4)[_0x4ba3('0x1c')]();};}function respondWithResult(_0x3a74f7,_0x12ac90){_0x12ac90=_0x12ac90||0xc8;return function(_0x1dec48){if(_0x1dec48){return _0x3a74f7[_0x4ba3('0x1b')](_0x12ac90)[_0x4ba3('0x1d')](_0x1dec48);}};}function respondWithFilteredResult(_0x301359,_0x29a9d1){return function(_0x25f584){if(_0x25f584){var _0x40e75b=typeof _0x29a9d1[_0x4ba3('0x1e')]==='undefined'&&typeof _0x29a9d1[_0x4ba3('0x1f')]===_0x4ba3('0x20');var _0x5ff7ce=_0x25f584[_0x4ba3('0x21')];var _0x556290=_0x40e75b?0x0:_0x29a9d1[_0x4ba3('0x1e')];var _0xe4eff9=_0x40e75b?_0x25f584[_0x4ba3('0x21')]:_0x29a9d1[_0x4ba3('0x1e')]+_0x29a9d1[_0x4ba3('0x1f')];var _0x125944;if(_0xe4eff9>=_0x5ff7ce){_0xe4eff9=_0x5ff7ce;_0x125944=0xc8;}else{_0x125944=0xce;}_0x301359['status'](_0x125944);return _0x301359['set'](_0x4ba3('0x22'),_0x556290+'-'+_0xe4eff9+'/'+_0x5ff7ce)['json'](_0x25f584);}return null;};}function patchUpdates(_0x18dff5){return function(_0x163967){try{jsonpatch[_0x4ba3('0x23')](_0x163967,_0x18dff5,!![]);}catch(_0xbc7023){return BPromise[_0x4ba3('0x24')](_0xbc7023);}return _0x163967[_0x4ba3('0x25')]();};}function saveUpdates(_0x4a0823,_0x143c78){return function(_0x1f87e1){if(_0x1f87e1){return _0x1f87e1['update'](_0x4a0823)[_0x4ba3('0x26')](function(_0x4ffe39){return _0x4ffe39;});}return null;};}function removeEntity(_0x1ae4de,_0x18abb3){return function(_0x11a917){if(_0x11a917){return _0x11a917[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){var _0xe29a49=_0x11a917[_0x4ba3('0x28')]({'plain':!![]});var _0xe1f7d2=_0x4ba3('0x29');return db[_0x4ba3('0x2a')]['destroy']({'where':{'type':_0xe1f7d2,'resourceId':_0xe29a49['id']}})[_0x4ba3('0x26')](function(){return _0x11a917;});})[_0x4ba3('0x26')](function(){_0x1ae4de[_0x4ba3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10537e,_0x1fe5e2){return function(_0x44d78c){if(!_0x44d78c){_0x10537e['sendStatus'](0x194);}return _0x44d78c;};}function handleError(_0x10cae6,_0x843276){_0x843276=_0x843276||0x1f4;return function(_0x34ecb4){logger[_0x4ba3('0x2b')](_0x34ecb4['stack']);if(_0x34ecb4['name']){delete _0x34ecb4[_0x4ba3('0x2c')];}_0x10cae6[_0x4ba3('0x1b')](_0x843276)[_0x4ba3('0x2d')](_0x34ecb4);};}exports[_0x4ba3('0x2e')]=function(_0x2cb5d5,_0x11f88f){var _0x48b3b7={},_0x27444b={},_0x28f36c={'count':0x0,'rows':[]};var _0x24d8fc=_[_0x4ba3('0x2f')](db[_0x4ba3('0x30')][_0x4ba3('0x31')],function(_0x457236){return{'name':_0x457236[_0x4ba3('0x32')],'type':_0x457236[_0x4ba3('0x33')][_0x4ba3('0x34')]};});_0x27444b['model']=_['map'](_0x24d8fc,'name');_0x27444b[_0x4ba3('0x35')]=_[_0x4ba3('0x36')](_0x2cb5d5[_0x4ba3('0x35')]);_0x27444b[_0x4ba3('0x37')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],_0x27444b[_0x4ba3('0x35')]);_0x48b3b7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x2cb5d5[_0x4ba3('0x35')]['fields']));_0x48b3b7[_0x4ba3('0x3a')]=_0x48b3b7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x48b3b7['attributes']:_0x27444b[_0x4ba3('0x39')];if(!_0x2cb5d5['query'][_0x4ba3('0x3d')](_0x4ba3('0x3e'))){_0x48b3b7[_0x4ba3('0x1f')]=qs[_0x4ba3('0x1f')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1f')]);_0x48b3b7['offset']=qs[_0x4ba3('0x1e')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1e')]);}_0x48b3b7['order']=qs[_0x4ba3('0x3f')](_0x2cb5d5[_0x4ba3('0x35')]['sort']);_0x48b3b7[_0x4ba3('0x40')]=qs['filters'](_['pick'](_0x2cb5d5[_0x4ba3('0x35')],_0x27444b[_0x4ba3('0x37')]),_0x24d8fc);if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x41')]){_0x48b3b7[_0x4ba3('0x40')]=_['merge'](_0x48b3b7[_0x4ba3('0x40')],{'$or':_[_0x4ba3('0x2f')](_0x24d8fc,function(_0x46d2ca){if(_0x46d2ca[_0x4ba3('0x33')]!==_0x4ba3('0x42')){var _0x2acc92={};_0x2acc92[_0x46d2ca[_0x4ba3('0x2c')]]={'$like':'%'+_0x2cb5d5[_0x4ba3('0x35')]['filter']+'%'};return _0x2acc92;}})});}_0x48b3b7=_[_0x4ba3('0x43')]({},_0x48b3b7,_0x2cb5d5[_0x4ba3('0x44')]);var _0x3cb07f={'where':_0x48b3b7[_0x4ba3('0x40')]};return db[_0x4ba3('0x30')][_0x4ba3('0x21')](_0x3cb07f)[_0x4ba3('0x26')](function(_0xdcc2a2){_0x28f36c[_0x4ba3('0x21')]=_0xdcc2a2;if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x45')]){_0x48b3b7[_0x4ba3('0x46')]=[{'all':!![]}];}return db[_0x4ba3('0x30')][_0x4ba3('0x47')](_0x48b3b7);})['then'](function(_0x5af671){_0x28f36c['rows']=_0x5af671;return _0x28f36c;})['then'](respondWithFilteredResult(_0x11f88f,_0x48b3b7))['catch'](handleError(_0x11f88f,null));};exports[_0x4ba3('0x48')]=function(_0x5c4659,_0x29e74d){var _0x5567c7={'raw':!![],'where':{'id':_0x5c4659[_0x4ba3('0x49')]['id']}},_0x53d6eb={};_0x53d6eb[_0x4ba3('0x39')]=_[_0x4ba3('0x36')](db[_0x4ba3('0x30')]['rawAttributes']);_0x53d6eb[_0x4ba3('0x35')]=_['keys'](_0x5c4659[_0x4ba3('0x35')]);_0x53d6eb['filters']=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],_0x53d6eb[_0x4ba3('0x35')]);_0x5567c7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x5c4659['query'][_0x4ba3('0x3b')]));_0x5567c7[_0x4ba3('0x3a')]=_0x5567c7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x5567c7[_0x4ba3('0x3a')]:_0x53d6eb['model'];if(_0x5c4659['query'][_0x4ba3('0x45')]){_0x5567c7[_0x4ba3('0x46')]=[{'all':!![]}];}_0x5567c7=_[_0x4ba3('0x43')]({},_0x5567c7,_0x5c4659['options']);return db[_0x4ba3('0x30')][_0x4ba3('0x4a')](_0x5567c7)[_0x4ba3('0x26')](handleEntityNotFound(_0x29e74d,null))['then'](respondWithResult(_0x29e74d,null))['catch'](handleError(_0x29e74d,null));};exports[_0x4ba3('0x4b')]=function(_0x482a83,_0x439acf){return db[_0x4ba3('0x30')][_0x4ba3('0x4b')](_0x482a83[_0x4ba3('0x4c')],{})[_0x4ba3('0x26')](function(_0x213eb0){var _0x590739=_0x482a83[_0x4ba3('0x4d')][_0x4ba3('0x28')]({'plain':!![]});if(!_0x590739)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x590739[_0x4ba3('0x4e')]===_0x4ba3('0x4d')){var _0x156c2d=_0x213eb0[_0x4ba3('0x28')]({'plain':!![]});var _0x360472='Reports';return db[_0x4ba3('0x4f')][_0x4ba3('0x4a')]({'where':{'name':_0x360472,'userProfileId':_0x590739['userProfileId']},'raw':!![]})[_0x4ba3('0x26')](function(_0x19d70f){if(_0x19d70f&&_0x19d70f[_0x4ba3('0x50')]===0x0){return db[_0x4ba3('0x2a')][_0x4ba3('0x4b')]({'name':_0x156c2d[_0x4ba3('0x2c')],'resourceId':_0x156c2d['id'],'type':_0x4ba3('0x29'),'sectionId':_0x19d70f['id']},{})[_0x4ba3('0x26')](function(){return _0x213eb0;});}else{return _0x213eb0;}})[_0x4ba3('0x51')](function(_0x428a27){logger[_0x4ba3('0x2b')](_0x4ba3('0x52'),_0x428a27);throw _0x428a27;});}return _0x213eb0;})[_0x4ba3('0x26')](respondWithResult(_0x439acf,0xc9))[_0x4ba3('0x51')](handleError(_0x439acf,null));};exports[_0x4ba3('0x53')]=function(_0x48a3d4,_0x5e7ed5){if(_0x48a3d4['body']['id']){delete _0x48a3d4[_0x4ba3('0x4c')]['id'];}return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x48a3d4[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5e7ed5,null))['then'](saveUpdates(_0x48a3d4[_0x4ba3('0x4c')],null))[_0x4ba3('0x26')](respondWithResult(_0x5e7ed5,null))[_0x4ba3('0x51')](handleError(_0x5e7ed5,null));};exports[_0x4ba3('0x27')]=function(_0x5359d1,_0x1e83fb){return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x5359d1[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x1e83fb,null))[_0x4ba3('0x26')](removeEntity(_0x1e83fb,null))[_0x4ba3('0x51')](handleError(_0x1e83fb,null));};exports[_0x4ba3('0x54')]=function(_0x328314,_0x4fa64d){var _0x20c849=0xa;var _0x42bb4b=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x40827a={'SUM':_0x4ba3('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':_0x4ba3('0x5b'),'MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x4cc10a={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4ba3('0x62')};var _0xaef1b=function(_0x2a48fe){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),'IS\x20NOT\x20NULL',_0x4ba3('0x65'),_0x4ba3('0x66')],_0x2a48fe);};var _0x34cc21=function(_0x469ef0){if(!_0x469ef0||!_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')]){return'';}for(var _0x3fdf7f='(',_0x38699e=0x0;_0x38699e<_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')];_0x38699e+=0x1){_0x38699e>0x0&&(_0x3fdf7f+='\x20'+_0x469ef0[_0x4ba3('0x68')]+'\x20');_0x3fdf7f+=_0x469ef0['rules'][_0x38699e][_0x4ba3('0x69')]?_0x34cc21(_0x469ef0[_0x4ba3('0x67')][_0x38699e]['group']):_0x469ef0['rules'][_0x38699e][_0x4ba3('0x6a')]+'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['condition']+(_0xaef1b(_0x469ef0[_0x4ba3('0x67')][_0x38699e][_0x4ba3('0x6b')])?'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['value']:'');}return _0x3fdf7f+')';};var _0x1f5815={'where':{'id':_0x328314['params']['id']}},_0x46224,_0x1af489,_0x11209b,_0x24a75a,_0x3a4838;_0x1f5815=_[_0x4ba3('0x43')]({},_0x1f5815,_0x328314[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x1f5815)[_0x4ba3('0x26')](function(_0x2f8bcc){if(_0x2f8bcc){_0x46224=_0x2f8bcc;return _0x2f8bcc[_0x4ba3('0x6c')]();}return null;})[_0x4ba3('0x26')](function(_0x21c8b1){if(_0x21c8b1){if(!_0x21c8b1[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1af489=_0x21c8b1;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})['then'](function(_0x13ee2c){if(_0x13ee2c){_0x11209b=_[_0x4ba3('0x6f')](_0x13ee2c,'id');var _0x442d66;var _0x5c7fc2=squel[_0x4ba3('0x70')]();_0x5c7fc2[_0x4ba3('0x71')](_0x46224[_0x4ba3('0x72')]);for(var _0x5baf26=0x0;_0x5baf26<_0x1af489[_0x4ba3('0x3c')];_0x5baf26+=0x1){_0x442d66=_0x1af489[_0x5baf26]['MetricId']?_0x11209b[_0x1af489[_0x5baf26][_0x4ba3('0x73')]][_0x4ba3('0x74')]:_0x1af489[_0x5baf26]['field'];_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x40827a[_0x1af489[_0x5baf26][_0x4ba3('0x75')]],'%s',_0x442d66):_0x442d66;_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x4cc10a[_0x1af489[_0x5baf26][_0x4ba3('0x77')]],'%s',_0x442d66):_0x442d66;if(_0x1af489[_0x5baf26][_0x4ba3('0x78')]){_0x5c7fc2[_0x4ba3('0x69')](_0x442d66);}_0x1af489[_0x5baf26][_0x4ba3('0x79')]&&_0x5c7fc2['order'](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x5c7fc2[_0x4ba3('0x6a')](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x7b')]||_0x442d66);}if(_0x46224[_0x4ba3('0x7c')]){_0x46224[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x7c')]);for(var _0x365d94=0x0;_0x365d94<_0x46224[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x365d94+=0x1){if(_0x46224[_0x4ba3('0x7c')][_0x365d94]['type']&&_[_0x4ba3('0x63')](_0x42bb4b,_0x46224[_0x4ba3('0x7c')][_0x365d94]['type'])&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7e')]&&_0x46224['joins'][_0x365d94]['foreignTable']&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]){_0x5c7fc2[_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x33')]](_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x46224['table'],_0x46224[_0x4ba3('0x7c')][_0x365d94]['parentKey'],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]));}}}if(_0x46224[_0x4ba3('0x82')]){_0x46224[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x82')]);_0x5c7fc2['where'](_0x34cc21(_0x46224[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x3a4838=_0x5c7fc2[_0x4ba3('0x83')]();_0x5c7fc2['limit'](_0x20c849);_0x5c7fc2[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x5c7fc2[_0x4ba3('0x86')]());return dbH[_0x4ba3('0x87')][_0x4ba3('0x35')](_0x5c7fc2[_0x4ba3('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x4ba3('0x88')]});}})['then'](respondWithResult(_0x4fa64d,null))[_0x4ba3('0x51')](handleError(_0x4fa64d,null));};function runReport(_0x15508f,_0x108679,_0x20f7db){var _0x5a3c63=_0x108679['name'];var _0x2d16e5=0xa;var _0x2b2132=['join',_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x1e8232={'SUM':_0x4ba3('0x59'),'COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':_0x4ba3('0x8a'),'GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x13dbc4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5aa412=function(_0x4ec70e){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),_0x4ba3('0x65'),_0x4ba3('0x66')],_0x4ec70e);};var _0x333a97=function(_0x30d7a9){if(!_0x30d7a9||!_0x30d7a9['rules'][_0x4ba3('0x3c')]){return'';}for(var _0x4cd4a2='(',_0x31a725=0x0;_0x31a725<_0x30d7a9['rules'][_0x4ba3('0x3c')];_0x31a725+=0x1){_0x31a725>0x0&&(_0x4cd4a2+='\x20'+_0x30d7a9[_0x4ba3('0x68')]+'\x20');_0x4cd4a2+=_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x69')]?_0x333a97(_0x30d7a9[_0x4ba3('0x67')][_0x31a725]['group']):_0x30d7a9['rules'][_0x31a725][_0x4ba3('0x6a')]+'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')]+(_0x5aa412(_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')])?'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x8c')]:'');}return _0x4cd4a2+')';};var _0x3d8606={'where':{'id':_0x15508f['id']}},_0x2d00e3,_0x35441e,_0x217ea4,_0x40dcee,_0x5ea9d0;_0x3d8606=_[_0x4ba3('0x43')]({},_0x3d8606,_0x20f7db);return db['AnalyticDefaultReport'][_0x4ba3('0x4a')](_0x3d8606)[_0x4ba3('0x26')](function(_0x17b970){if(_0x17b970){_0x2d00e3=_0x17b970;return _0x17b970[_0x4ba3('0x6c')]();}return null;})['then'](function(_0x2a2dc2){if(_0x2a2dc2){if(!_0x2a2dc2[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x35441e=_0x2a2dc2;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0x3188c8){if(_0x3188c8){_0x217ea4=_['keyBy'](_0x3188c8,'id');var _0x2f793a;var _0x1194a5=squel[_0x4ba3('0x70')]();_0x1194a5[_0x4ba3('0x71')](_0x2d00e3[_0x4ba3('0x72')]);for(var _0x1e2134=0x0;_0x1e2134<_0x35441e['length'];_0x1e2134+=0x1){_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x73')]?_0x217ea4[_0x35441e[_0x1e2134]['MetricId']][_0x4ba3('0x74')]:_0x35441e[_0x1e2134][_0x4ba3('0x6a')];_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x1e8232[_0x35441e[_0x1e2134]['function']],'%s',_0x2f793a):_0x2f793a;_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x13dbc4[_0x35441e[_0x1e2134]['format']],'%s',_0x2f793a):_0x2f793a;if(_0x35441e[_0x1e2134][_0x4ba3('0x78')]){_0x1194a5['group'](_0x2f793a);}_0x35441e[_0x1e2134][_0x4ba3('0x79')]&&_0x1194a5[_0x4ba3('0x8d')](_0x2f793a,_0x35441e[_0x1e2134][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x1194a5[_0x4ba3('0x6a')](_0x2f793a,_0x35441e[_0x1e2134]['alias']||_0x2f793a);}if(_0x2d00e3['joins']){_0x2d00e3[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x7c')]);for(var _0x56244e=0x0;_0x56244e<_0x2d00e3[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x56244e+=0x1){if(_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x2b2132,_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')])&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')]&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')]&&_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x7f')]){_0x1194a5[_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')]](_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x2d00e3[_0x4ba3('0x72')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e]['foreignKey']));}}}if(_0x2d00e3['conditions']){_0x2d00e3[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x82')]);_0x1194a5[_0x4ba3('0x40')](_0x333a97(_0x2d00e3[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x5ea9d0=_0x1194a5[_0x4ba3('0x83')]();_0x1194a5['limit'](_0x2d16e5);_0x1194a5['offset'](0x0);return;}})[_0x4ba3('0x26')](function(){if(_0x108679[_0x4ba3('0x8e')]==='web'){return null;}var _0x4fb6b5=_['merge'](_0x108679,{'name':_0x108679['fullPath']||_0x108679[_0x4ba3('0x2c')]||_0x2d00e3[_0x4ba3('0x2c')],'basename':_0x5a3c63,'savename':util[_0x4ba3('0x77')](_0x4ba3('0x8f'),_0x108679[_0x4ba3('0x2c')]||_0x2d00e3['name'],require(_0x4ba3('0x90'))[_0x4ba3('0x91')](0x4),_0x108679[_0x4ba3('0x8e')]||'csv'),'reportId':_0x2d00e3['id'],'reportType':'default'});return db['AnalyticExtractedReport']['create'](_0x4fb6b5,{'raw':!![]});})[_0x4ba3('0x26')](function(_0x17d501){if(_0x2d00e3[_0x4ba3('0x72')]===_0x4ba3('0x92')){_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3['table']+_0x4ba3('0x93'),_0x108679['startDate'],_0x108679[_0x4ba3('0x94')]);}else{_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3[_0x4ba3('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x108679[_0x4ba3('0x95')],_0x108679[_0x4ba3('0x94')]);}if(_0x17d501){logger[_0x4ba3('0x96')](_0x4ba3('0x97'),_0x5ea9d0['toString']());require('child_process')[_0x4ba3('0x98')](path[_0x4ba3('0x55')](__dirname,'../../components/export/',_0x17d501[_0x4ba3('0x8e')]),[_0x17d501['id'],_0x5ea9d0['toString'](),path['join'](__dirname,'../../files/reports',_0x17d501['savename']),_0x5a3c63]);return _0x17d501;}else{var _0x2d2ca3=squel[_0x4ba3('0x70')]();_0x2d2ca3[_0x4ba3('0x71')]('('+_0x5ea9d0[_0x4ba3('0x86')]()+')',_0x4ba3('0x99'));_0x2d2ca3['field']('COUNT(*)',_0x4ba3('0x21'));_0x5ea9d0['limit'](_0x108679[_0x4ba3('0x1f')]||_0x2d16e5);_0x5ea9d0[_0x4ba3('0x1e')](_0x108679[_0x4ba3('0x1e')]||0x0);return dbH['sequelize'][_0x4ba3('0x35')](_0x2d2ca3[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]})[_0x4ba3('0x26')](function(_0xc938c){if(!_0xc938c[_0x4ba3('0x3c')]){_0x40dcee=0x0;}else{_0x40dcee=_0xc938c[0x0][_0x4ba3('0x21')]||0x0;}return dbH['sequelize']['query'](_0x5ea9d0[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]});})[_0x4ba3('0x26')](function(_0xd97c26){return{'rows':_0xd97c26||[],'count':_0x40dcee};});}});}exports['run']=function(_0x1fbdc7,_0x9e45ec){return runReport(_0x1fbdc7['params'],_0x1fbdc7[_0x4ba3('0x35')],_0x1fbdc7[_0x4ba3('0x44')])[_0x4ba3('0x26')](respondWithResult(_0x9e45ec,null))[_0x4ba3('0x51')](handleError(_0x9e45ec,null));};exports[_0x4ba3('0x9b')]=runReport;exports[_0x4ba3('0x35')]=function(_0xddfb0c,_0x41c531){var _0x25bf75=0xa;var _0x18bd77=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x2e812b={'SUM':'SUM(%s)','COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':_0x4ba3('0x9c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5dc74f={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':'DATE(%s)','HOUR':_0x4ba3('0x61'),'ROUND':_0x4ba3('0x9d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1590f0=function(_0x5efab9){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),'IS\x20EMPTY',_0x4ba3('0x66')],_0x5efab9);};var _0x4d3262=function(_0x4ad4d3){if(!_0x4ad4d3||!_0x4ad4d3[_0x4ba3('0x67')]['length']){return'';}for(var _0x4529a3='(',_0x9b9c64=0x0;_0x9b9c64<_0x4ad4d3[_0x4ba3('0x67')]['length'];_0x9b9c64+=0x1){_0x9b9c64>0x0&&(_0x4529a3+='\x20'+_0x4ad4d3['operator']+'\x20');_0x4529a3+=_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]?_0x4d3262(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]):_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64]['field']+'\x20'+_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')]+(_0x1590f0(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')])?'\x20'+_0x4ad4d3['rules'][_0x9b9c64][_0x4ba3('0x8c')]:'');}return _0x4529a3+')';};var _0x3073c5={'where':{'id':_0xddfb0c[_0x4ba3('0x49')]['id']}},_0x3d1c11,_0xa41747,_0x25c92c,_0x422a8d,_0x225746;_0x3073c5=_[_0x4ba3('0x43')]({},_0x3073c5,_0xddfb0c[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x3073c5)[_0x4ba3('0x26')](function(_0x3db4c2){if(_0x3db4c2){_0x3d1c11=_0x3db4c2;return _0x3db4c2['getFields']();}return null;})[_0x4ba3('0x26')](function(_0x4a8449){if(_0x4a8449){if(!_0x4a8449[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))](_0x4ba3('0x9e'),0x193);}_0xa41747=_0x4a8449;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0xfaf98a){if(_0xfaf98a){_0x25c92c=_['keyBy'](_0xfaf98a,'id');var _0x30c904;var _0x267801=squel[_0x4ba3('0x70')]();_0x267801[_0x4ba3('0x71')](_0x3d1c11['table']);for(var _0x1bae1b=0x0;_0x1bae1b<_0xa41747[_0x4ba3('0x3c')];_0x1bae1b+=0x1){_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x73')]?_0x25c92c[_0xa41747[_0x1bae1b][_0x4ba3('0x73')]]['metric']:_0xa41747[_0x1bae1b][_0x4ba3('0x6a')];_0x30c904=_0xa41747[_0x1bae1b]['function']?_[_0x4ba3('0x76')](_0x2e812b[_0xa41747[_0x1bae1b][_0x4ba3('0x75')]],'%s',_0x30c904):_0x30c904;_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x5dc74f[_0xa41747[_0x1bae1b]['format']],'%s',_0x30c904):_0x30c904;if(_0xa41747[_0x1bae1b]['groupBy']){_0x267801[_0x4ba3('0x69')](_0x30c904);}_0xa41747[_0x1bae1b][_0x4ba3('0x79')]&&_0x267801[_0x4ba3('0x8d')](_0x30c904,_0xa41747[_0x1bae1b]['orderBy']==='DESC'?![]:!![]);_0x267801[_0x4ba3('0x6a')](_0x30c904,_0xa41747[_0x1bae1b][_0x4ba3('0x7b')]||_0x30c904);}if(_0x3d1c11[_0x4ba3('0x7c')]){_0x3d1c11[_0x4ba3('0x7c')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x7c')]);for(var _0x2f4966=0x0;_0x2f4966<_0x3d1c11[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x2f4966+=0x1){if(_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x18bd77,_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')])&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x80')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7f')]){_0x267801[_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]](_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x3d1c11[_0x4ba3('0x72')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],_0x3d1c11['joins'][_0x2f4966][_0x4ba3('0x7f')]));}}}if(_0x3d1c11[_0x4ba3('0x82')]){_0x3d1c11[_0x4ba3('0x82')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x82')]);_0x267801[_0x4ba3('0x40')](_0x4d3262(_0x3d1c11[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x225746=_0x267801[_0x4ba3('0x83')]();_0x267801[_0x4ba3('0x1f')](_0x25bf75);_0x267801[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x267801['toString']());return dbH[_0x4ba3('0x87')]['query'](_0x267801['toString'](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')]['SELECT']});}})[_0x4ba3('0x26')](function(){return{'sql':_0x225746[_0x4ba3('0x86')]()};})[_0x4ba3('0x26')](respondWithResult(_0x41c531,null))[_0x4ba3('0x51')](handleError(_0x41c531,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 767b8f9..cd7d135 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 _0x27d8=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports'];(function(_0x1f6994,_0x2b4985){var _0x592e20=function(_0x3457e0){while(--_0x3457e0){_0x1f6994['push'](_0x1f6994['shift']());}};_0x592e20(++_0x2b4985);}(_0x27d8,0x138));var _0x827d=function(_0x3b632f,_0x453380){_0x3b632f=_0x3b632f-0x0;var _0x10e788=_0x27d8[_0x3b632f];return _0x10e788;};'use strict';var _=require(_0x827d('0x0'));var util=require(_0x827d('0x1'));var logger=require(_0x827d('0x2'))(_0x827d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x827d('0x4'));var fs=require('fs');var path=require(_0x827d('0x5'));var rimraf=require(_0x827d('0x6'));var config=require(_0x827d('0x7'));var attributes=require(_0x827d('0x8'));module[_0x827d('0x9')]=function(_0x5c9d71,_0x3f9756){return _0x5c9d71[_0x827d('0xa')](_0x827d('0xb'),attributes,{'tableName':_0x827d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3df9=['request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4b99b2,_0x4f3b64){var _0x21b2ab=function(_0x5baf59){while(--_0x5baf59){_0x4b99b2['push'](_0x4b99b2['shift']());}};_0x21b2ab(++_0x4f3b64);}(_0x3df9,0x1cf));var _0x93df=function(_0x11df98,_0x55313e){_0x11df98=_0x11df98-0x0;var _0x3d313a=_0x3df9[_0x11df98];return _0x3d313a;};'use strict';var _=require(_0x93df('0x0'));var util=require('util');var logger=require(_0x93df('0x1'))(_0x93df('0x2'));var moment=require(_0x93df('0x3'));var BPromise=require(_0x93df('0x4'));var rp=require(_0x93df('0x5'));var fs=require('fs');var path=require(_0x93df('0x6'));var rimraf=require(_0x93df('0x7'));var config=require(_0x93df('0x8'));var attributes=require(_0x93df('0x9'));module[_0x93df('0xa')]=function(_0xf0ea9d,_0x86dda4){return _0xf0ea9d[_0x93df('0xb')]('AnalyticDefaultReport',attributes,{'tableName':_0x93df('0xc'),'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 0aafc8e..0220dd1 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 _0xacbe=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','randomstring'];(function(_0x570fff,_0x145cff){var _0x4b1a44=function(_0x48c874){while(--_0x48c874){_0x570fff['push'](_0x570fff['shift']());}};_0x4b1a44(++_0x145cff);}(_0xacbe,0x128));var _0xeacb=function(_0x3f17b5,_0x429d58){_0x3f17b5=_0x3f17b5-0x0;var _0x5685bc=_0xacbe[_0x3f17b5];return _0x5685bc;};'use strict';var _=require(_0xeacb('0x0'));var util=require(_0xeacb('0x1'));var moment=require(_0xeacb('0x2'));var BPromise=require('bluebird');var rs=require(_0xeacb('0x3'));var fs=require('fs');var Redis=require(_0xeacb('0x4'));var db=require(_0xeacb('0x5'))['db'];var utils=require(_0xeacb('0x6'));var logger=require(_0xeacb('0x7'))(_0xeacb('0x8'));var config=require('../../config/environment');var jayson=require(_0xeacb('0x9'));var client=jayson['client'][_0xeacb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x189e1c,_0x5be16e,_0x136272){return new BPromise(function(_0x3e41b0,_0x5348fe){return client[_0xeacb('0xb')](_0x189e1c,_0x136272)['then'](function(_0x2309ae){logger[_0xeacb('0xc')](_0xeacb('0xd'),_0x5be16e,_0xeacb('0xe'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x5be16e,_0xeacb('0xe'),JSON[_0xeacb('0xf')](_0x2309ae));if(_0x2309ae[_0xeacb('0x10')]){if(_0x2309ae[_0xeacb('0x10')]['code']===0x1f4){logger[_0xeacb('0x10')](_0xeacb('0xd'),_0x5be16e,_0x2309ae[_0xeacb('0x10')][_0xeacb('0x11')]);return _0x5348fe(_0x2309ae[_0xeacb('0x10')][_0xeacb('0x11')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x5be16e,_0x2309ae['error'][_0xeacb('0x11')]);return _0x3e41b0(_0x2309ae[_0xeacb('0x10')][_0xeacb('0x11')]);}else{logger['info'](_0xeacb('0xd'),_0x5be16e,_0xeacb('0xe'));_0x3e41b0(_0x2309ae[_0xeacb('0x12')]['message']);}})[_0xeacb('0x13')](function(_0x3b0464){logger[_0xeacb('0x10')](_0xeacb('0xd'),_0x5be16e,_0x3b0464);_0x5348fe(_0x3b0464);});});}
\ No newline at end of file
+var _0xaa05=['http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x26b313,_0x271a5d){var _0x5f2ab1=function(_0x573c30){while(--_0x573c30){_0x26b313['push'](_0x26b313['shift']());}};_0x5f2ab1(++_0x271a5d);}(_0xaa05,0xc3));var _0x5aa0=function(_0xbc4659,_0x578fba){_0xbc4659=_0xbc4659-0x0;var _0x5831f9=_0xaa05[_0xbc4659];return _0x5831f9;};'use strict';var _=require(_0x5aa0('0x0'));var util=require(_0x5aa0('0x1'));var moment=require(_0x5aa0('0x2'));var BPromise=require(_0x5aa0('0x3'));var rs=require(_0x5aa0('0x4'));var fs=require('fs');var Redis=require(_0x5aa0('0x5'));var db=require(_0x5aa0('0x6'))['db'];var utils=require(_0x5aa0('0x7'));var logger=require(_0x5aa0('0x8'))(_0x5aa0('0x9'));var config=require(_0x5aa0('0xa'));var jayson=require(_0x5aa0('0xb'));var client=jayson['client'][_0x5aa0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x728510,_0x3a62d9,_0x397c4c){return new BPromise(function(_0x52c49a,_0x1da94c){return client[_0x5aa0('0xd')](_0x728510,_0x397c4c)[_0x5aa0('0xe')](function(_0x45fcce){logger['info'](_0x5aa0('0xf'),_0x3a62d9,'request\x20sent');logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x3a62d9,_0x5aa0('0x10'),JSON[_0x5aa0('0x11')](_0x45fcce));if(_0x45fcce[_0x5aa0('0x12')]){if(_0x45fcce[_0x5aa0('0x12')][_0x5aa0('0x13')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x3a62d9,_0x45fcce['error']['message']);return _0x1da94c(_0x45fcce[_0x5aa0('0x12')][_0x5aa0('0x14')]);}logger[_0x5aa0('0x12')](_0x5aa0('0xf'),_0x3a62d9,_0x45fcce[_0x5aa0('0x12')][_0x5aa0('0x14')]);return _0x52c49a(_0x45fcce[_0x5aa0('0x12')][_0x5aa0('0x14')]);}else{logger['info'](_0x5aa0('0xf'),_0x3a62d9,_0x5aa0('0x10'));_0x52c49a(_0x45fcce[_0x5aa0('0x15')][_0x5aa0('0x14')]);}})[_0x5aa0('0x16')](function(_0x4844f8){logger[_0x5aa0('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3a62d9,_0x4844f8);_0x1da94c(_0x4844f8);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index fdf62d1..927c1cc 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 _0x2a14=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x2d8d69,_0x8e47ff){var _0x39ae22=function(_0xd7935e){while(--_0xd7935e){_0x2d8d69['push'](_0x2d8d69['shift']());}};_0x39ae22(++_0x8e47ff);}(_0x2a14,0x123));var _0x42a1=function(_0x4bba58,_0x50859e){_0x4bba58=_0x4bba58-0x0;var _0x2f43f0=_0x2a14[_0x4bba58];return _0x2f43f0;};'use strict';var multer=require(_0x42a1('0x0'));var util=require(_0x42a1('0x1'));var path=require('path');var timeout=require(_0x42a1('0x2'));var express=require(_0x42a1('0x3'));var router=express[_0x42a1('0x4')]();var fs_extra=require(_0x42a1('0x5'));var auth=require(_0x42a1('0x6'));var interaction=require(_0x42a1('0x7'));var config=require(_0x42a1('0x8'));var controller=require(_0x42a1('0x9'));router[_0x42a1('0xa')]('/',auth[_0x42a1('0xb')](),controller[_0x42a1('0xc')]);router[_0x42a1('0xa')]('/:id',auth[_0x42a1('0xb')](),controller[_0x42a1('0xd')]);router['get'](_0x42a1('0xe'),auth[_0x42a1('0xb')](),controller[_0x42a1('0xf')]);router['get'](_0x42a1('0x10'),auth[_0x42a1('0xb')](),controller['run']);router['get'](_0x42a1('0x11'),auth[_0x42a1('0xb')](),controller[_0x42a1('0x12')]);router[_0x42a1('0x13')]('/',auth[_0x42a1('0xb')](),controller[_0x42a1('0x14')]);router[_0x42a1('0x15')](_0x42a1('0x16'),auth[_0x42a1('0xb')](),controller[_0x42a1('0x17')]);router[_0x42a1('0x18')]('/:id',auth[_0x42a1('0xb')](),controller[_0x42a1('0x19')]);module[_0x42a1('0x1a')]=router;
\ No newline at end of file
+var _0xd488=['post','put','/:id','delete','destroy','util','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id/preview','preview','/:id/run','run'];(function(_0x6b44d2,_0x7b7c2e){var _0x52f6f2=function(_0x5cd6ed){while(--_0x5cd6ed){_0x6b44d2['push'](_0x6b44d2['shift']());}};_0x52f6f2(++_0x7b7c2e);}(_0xd488,0x104));var _0x8d48=function(_0xab8668,_0x5204ac){_0xab8668=_0xab8668-0x0;var _0x571c10=_0xd488[_0xab8668];return _0x571c10;};'use strict';var multer=require('multer');var util=require(_0x8d48('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8d48('0x1')]();var fs_extra=require(_0x8d48('0x2'));var auth=require(_0x8d48('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x8d48('0x4'));var controller=require(_0x8d48('0x5'));router[_0x8d48('0x6')]('/',auth[_0x8d48('0x7')](),controller['index']);router['get']('/:id',auth[_0x8d48('0x7')](),controller['show']);router[_0x8d48('0x6')](_0x8d48('0x8'),auth[_0x8d48('0x7')](),controller[_0x8d48('0x9')]);router[_0x8d48('0x6')](_0x8d48('0xa'),auth[_0x8d48('0x7')](),controller[_0x8d48('0xb')]);router[_0x8d48('0x6')]('/:id/query',auth[_0x8d48('0x7')](),controller['query']);router[_0x8d48('0xc')]('/',auth[_0x8d48('0x7')](),controller['create']);router[_0x8d48('0xd')](_0x8d48('0xe'),auth[_0x8d48('0x7')](),controller['update']);router[_0x8d48('0xf')](_0x8d48('0xe'),auth['isAuthenticated'](),controller[_0x8d48('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index cb47389..5f8aedf 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 _0x0b69=['sequelize','STRING','ENUM','csv','pdf','DATE','Loading','manual','INTEGER','UNSIGNED'];(function(_0x30eb02,_0x269f7c){var _0x288ac1=function(_0x21a7ac){while(--_0x21a7ac){_0x30eb02['push'](_0x30eb02['shift']());}};_0x288ac1(++_0x269f7c);}(_0x0b69,0x19a));var _0x90b6=function(_0x3ae429,_0x1ec8a4){_0x3ae429=_0x3ae429-0x0;var _0xf22047=_0x0b69[_0x3ae429];return _0xf22047;};'use strict';var Sequelize=require(_0x90b6('0x0'));var moment=require('moment');module['exports']={'name':{'type':Sequelize[_0x90b6('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x90b6('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x90b6('0x2')](_0x90b6('0x3'),_0x90b6('0x4'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x90b6('0x1')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x90b6('0x5')]},'status':{'type':Sequelize[_0x90b6('0x1')],'defaultValue':_0x90b6('0x6')},'type':{'type':Sequelize[_0x90b6('0x2')](_0x90b6('0x7'),'scheduled'),'allowNull':![],'defaultValue':_0x90b6('0x7')},'reportId':{'type':Sequelize[_0x90b6('0x8')](0xb)[_0x90b6('0x9')]},'reportType':{'type':Sequelize[_0x90b6('0x1')]}};
\ No newline at end of file
+var _0x4ef6=['manual','scheduled','sequelize','moment','STRING','ENUM','csv','pdf','xlsx','DATE'];(function(_0xf2bfa7,_0x1e326f){var _0x3254ec=function(_0x42abd5){while(--_0x42abd5){_0xf2bfa7['push'](_0xf2bfa7['shift']());}};_0x3254ec(++_0x1e326f);}(_0x4ef6,0x7a));var _0x64ef=function(_0xe1a3a5,_0xd3e341){_0xe1a3a5=_0xe1a3a5-0x0;var _0x362646=_0x4ef6[_0xe1a3a5];return _0x362646;};'use strict';var Sequelize=require(_0x64ef('0x0'));var moment=require(_0x64ef('0x1'));module['exports']={'name':{'type':Sequelize[_0x64ef('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x64ef('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x64ef('0x3')](_0x64ef('0x4'),_0x64ef('0x5'),_0x64ef('0x6')),'allowNull':![],'defaultValue':_0x64ef('0x4')},'savename':{'type':Sequelize[_0x64ef('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x64ef('0x7')]},'endDate':{'type':Sequelize[_0x64ef('0x7')]},'status':{'type':Sequelize[_0x64ef('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x64ef('0x3')](_0x64ef('0x8'),_0x64ef('0x9')),'allowNull':![],'defaultValue':_0x64ef('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x64ef('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 73402ef..af81744 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 _0x3fa3=['jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','AnalyticExtractedReport','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','autoAssociation','download','basename','savename','join','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','sendStatus','root','format','%s.%s','output','toLowerCase','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto'];(function(_0x5c3194,_0x2ebfec){var _0x402748=function(_0x52a8b4){while(--_0x52a8b4){_0x5c3194['push'](_0x5c3194['shift']());}};_0x402748(++_0x2ebfec);}(_0x3fa3,0x1c5));var _0x33fa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3fa3[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x33fa('0x0'));var rimraf=require(_0x33fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x33fa('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x33fa('0x3'));var Mustache=require(_0x33fa('0x4'));var util=require(_0x33fa('0x5'));var path=require(_0x33fa('0x6'));var sox=require(_0x33fa('0x7'));var csv=require('to-csv');var ejs=require(_0x33fa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x33fa('0x9'));var squel=require(_0x33fa('0xa'));var crypto=require(_0x33fa('0xb'));var jsforce=require(_0x33fa('0xc'));var deskjs=require(_0x33fa('0xd'));var toCsv=require(_0x33fa('0xe'));var querystring=require(_0x33fa('0xf'));var Papa=require(_0x33fa('0x10'));var Redis=require('ioredis');var authService=require(_0x33fa('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x33fa('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x33fa('0x13'))('api');var utils=require(_0x33fa('0x14'));var config=require(_0x33fa('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x33fa('0x16'))['db'];function respondWithStatusCode(_0x4f5db8,_0x57a3c8){_0x57a3c8=_0x57a3c8||0xcc;return function(_0x3c016a){if(_0x3c016a){return _0x4f5db8['sendStatus'](_0x57a3c8);}return _0x4f5db8[_0x33fa('0x17')](_0x57a3c8)[_0x33fa('0x18')]();};}function respondWithResult(_0x3f28f5,_0x5cdd1e){_0x5cdd1e=_0x5cdd1e||0xc8;return function(_0x3599ae){if(_0x3599ae){return _0x3f28f5['status'](_0x5cdd1e)[_0x33fa('0x19')](_0x3599ae);}};}function respondWithFilteredResult(_0x316481,_0x4c0e53){return function(_0xfdd9a7){if(_0xfdd9a7){var _0x322d06=typeof _0x4c0e53[_0x33fa('0x1a')]===_0x33fa('0x1b')&&typeof _0x4c0e53[_0x33fa('0x1c')]===_0x33fa('0x1b');var _0x25fbba=_0xfdd9a7[_0x33fa('0x1d')];var _0x29db92=_0x322d06?0x0:_0x4c0e53[_0x33fa('0x1a')];var _0x47ac74=_0x322d06?_0xfdd9a7[_0x33fa('0x1d')]:_0x4c0e53[_0x33fa('0x1a')]+_0x4c0e53[_0x33fa('0x1c')];var _0x12992a;if(_0x47ac74>=_0x25fbba){_0x47ac74=_0x25fbba;_0x12992a=0xc8;}else{_0x12992a=0xce;}_0x316481[_0x33fa('0x17')](_0x12992a);return _0x316481[_0x33fa('0x1e')]('Content-Range',_0x29db92+'-'+_0x47ac74+'/'+_0x25fbba)[_0x33fa('0x19')](_0xfdd9a7);}return null;};}function patchUpdates(_0x1c4f94){return function(_0x3e0f99){try{jsonpatch[_0x33fa('0x1f')](_0x3e0f99,_0x1c4f94,!![]);}catch(_0x24f30e){return BPromise[_0x33fa('0x20')](_0x24f30e);}return _0x3e0f99['save']();};}function saveUpdates(_0x5a87da,_0x314a78){return function(_0x1e0044){if(_0x1e0044){return _0x1e0044[_0x33fa('0x21')](_0x5a87da)[_0x33fa('0x22')](function(_0x58d064){return _0x58d064;});}return null;};}function removeEntity(_0x49ee2b,_0xea152c){return function(_0x9f67ea){if(_0x9f67ea){return _0x9f67ea[_0x33fa('0x23')]()[_0x33fa('0x22')](function(){var _0x17d235=_0x9f67ea['get']({'plain':!![]});var _0x3ead5a='ExtractedReports';return db['UserProfileResource'][_0x33fa('0x23')]({'where':{'type':_0x3ead5a,'resourceId':_0x17d235['id']}})['then'](function(){return _0x9f67ea;});})[_0x33fa('0x22')](function(){_0x49ee2b[_0x33fa('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f1682,_0x195bc4){return function(_0x18a8d2){if(!_0x18a8d2){_0x2f1682['sendStatus'](0x194);}return _0x18a8d2;};}function handleError(_0x2216cd,_0x28ef5e){_0x28ef5e=_0x28ef5e||0x1f4;return function(_0x589482){logger[_0x33fa('0x24')](_0x589482[_0x33fa('0x25')]);if(_0x589482[_0x33fa('0x26')]){delete _0x589482[_0x33fa('0x26')];}_0x2216cd[_0x33fa('0x17')](_0x28ef5e)[_0x33fa('0x27')](_0x589482);};}exports[_0x33fa('0x28')]=function(_0x3a642d,_0x12ffeb){var _0x5cb39f={},_0xdd056={},_0x156ed3={'count':0x0,'rows':[]};var _0x1535e3=_[_0x33fa('0x29')](db['AnalyticExtractedReport'][_0x33fa('0x2a')],function(_0x1642d7){return{'name':_0x1642d7[_0x33fa('0x2b')],'type':_0x1642d7[_0x33fa('0x2c')]['key']};});_0xdd056[_0x33fa('0x2d')]=_[_0x33fa('0x29')](_0x1535e3,'name');_0xdd056[_0x33fa('0x2e')]=_[_0x33fa('0x2f')](_0x3a642d['query']);_0xdd056[_0x33fa('0x30')]=_[_0x33fa('0x31')](_0xdd056[_0x33fa('0x2d')],_0xdd056[_0x33fa('0x2e')]);_0x5cb39f[_0x33fa('0x32')]=_[_0x33fa('0x31')](_0xdd056[_0x33fa('0x2d')],qs[_0x33fa('0x33')](_0x3a642d['query'][_0x33fa('0x33')]));_0x5cb39f['attributes']=_0x5cb39f['attributes'][_0x33fa('0x34')]?_0x5cb39f[_0x33fa('0x32')]:_0xdd056[_0x33fa('0x2d')];if(!_0x3a642d[_0x33fa('0x2e')][_0x33fa('0x35')](_0x33fa('0x36'))){_0x5cb39f[_0x33fa('0x1c')]=qs['limit'](_0x3a642d[_0x33fa('0x2e')][_0x33fa('0x1c')]);_0x5cb39f[_0x33fa('0x1a')]=qs[_0x33fa('0x1a')](_0x3a642d[_0x33fa('0x2e')][_0x33fa('0x1a')]);}_0x5cb39f[_0x33fa('0x37')]=qs['sort'](_0x3a642d[_0x33fa('0x2e')][_0x33fa('0x38')]);_0x5cb39f[_0x33fa('0x39')]=qs[_0x33fa('0x30')](_[_0x33fa('0x3a')](_0x3a642d[_0x33fa('0x2e')],_0xdd056[_0x33fa('0x30')]),_0x1535e3);if(_0x3a642d[_0x33fa('0x2e')][_0x33fa('0x3b')]){_0x5cb39f[_0x33fa('0x39')]=_[_0x33fa('0x3c')](_0x5cb39f[_0x33fa('0x39')],{'$or':_['map'](_0x1535e3,function(_0x4bb511){if(_0x4bb511[_0x33fa('0x2c')]!=='VIRTUAL'){var _0x421b2c={};_0x421b2c[_0x4bb511['name']]={'$like':'%'+_0x3a642d['query']['filter']+'%'};return _0x421b2c;}})});}_0x5cb39f=_[_0x33fa('0x3c')]({},_0x5cb39f,_0x3a642d[_0x33fa('0x3d')]);var _0x30d397={'where':_0x5cb39f[_0x33fa('0x39')]};return db[_0x33fa('0x3e')][_0x33fa('0x1d')](_0x30d397)[_0x33fa('0x22')](function(_0x984cea){_0x156ed3['count']=_0x984cea;if(_0x3a642d[_0x33fa('0x2e')][_0x33fa('0x3f')]){_0x5cb39f[_0x33fa('0x40')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x33fa('0x41')](_0x5cb39f);})['then'](function(_0x4fb893){_0x156ed3['rows']=_0x4fb893;return _0x156ed3;})[_0x33fa('0x22')](respondWithFilteredResult(_0x12ffeb,_0x5cb39f))[_0x33fa('0x42')](handleError(_0x12ffeb,null));};exports[_0x33fa('0x43')]=function(_0x306be6,_0x5e8776){var _0x42e522={'raw':!![],'where':{'id':_0x306be6[_0x33fa('0x44')]['id']}},_0x43bf0a={};_0x43bf0a[_0x33fa('0x2d')]=_['keys'](db[_0x33fa('0x3e')][_0x33fa('0x2a')]);_0x43bf0a[_0x33fa('0x2e')]=_[_0x33fa('0x2f')](_0x306be6[_0x33fa('0x2e')]);_0x43bf0a[_0x33fa('0x30')]=_[_0x33fa('0x31')](_0x43bf0a[_0x33fa('0x2d')],_0x43bf0a['query']);_0x42e522[_0x33fa('0x32')]=_[_0x33fa('0x31')](_0x43bf0a['model'],qs[_0x33fa('0x33')](_0x306be6['query'][_0x33fa('0x33')]));_0x42e522[_0x33fa('0x32')]=_0x42e522[_0x33fa('0x32')][_0x33fa('0x34')]?_0x42e522['attributes']:_0x43bf0a[_0x33fa('0x2d')];if(_0x306be6[_0x33fa('0x2e')][_0x33fa('0x3f')]){_0x42e522[_0x33fa('0x40')]=[{'all':!![]}];}_0x42e522=_['merge']({},_0x42e522,_0x306be6[_0x33fa('0x3d')]);return db[_0x33fa('0x3e')][_0x33fa('0x45')](_0x42e522)[_0x33fa('0x22')](handleEntityNotFound(_0x5e8776,null))[_0x33fa('0x22')](respondWithResult(_0x5e8776,null))[_0x33fa('0x42')](handleError(_0x5e8776,null));};exports[_0x33fa('0x46')]=function(_0x94fa82,_0x115e23){return db[_0x33fa('0x3e')][_0x33fa('0x46')](_0x94fa82[_0x33fa('0x47')],{})[_0x33fa('0x22')](function(_0x338e02){var _0xdaa64f=_0x94fa82['user']['get']({'plain':!![]});if(!_0xdaa64f)throw new Error(_0x33fa('0x48'));if(_0xdaa64f[_0x33fa('0x49')]===_0x33fa('0x4a')){var _0x2a147b=_0x338e02[_0x33fa('0x4b')]({'plain':!![]});var _0x4ba331='ExtractedReports';return db[_0x33fa('0x4c')][_0x33fa('0x45')]({'where':{'name':_0x4ba331,'userProfileId':_0xdaa64f[_0x33fa('0x4d')]},'raw':!![]})[_0x33fa('0x22')](function(_0x4b47b4){if(_0x4b47b4&&_0x4b47b4[_0x33fa('0x4e')]===0x0){return db['UserProfileResource'][_0x33fa('0x46')]({'name':_0x2a147b['name'],'resourceId':_0x2a147b['id'],'type':_0x4b47b4[_0x33fa('0x26')],'sectionId':_0x4b47b4['id']},{})['then'](function(){return _0x338e02;});}else{return _0x338e02;}})[_0x33fa('0x42')](function(_0x40fd33){logger[_0x33fa('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40fd33);throw _0x40fd33;});}return _0x338e02;})[_0x33fa('0x22')](respondWithResult(_0x115e23,0xc9))[_0x33fa('0x42')](handleError(_0x115e23,null));};exports[_0x33fa('0x21')]=function(_0x2336c7,_0x303e3e){if(_0x2336c7[_0x33fa('0x47')]['id']){delete _0x2336c7[_0x33fa('0x47')]['id'];}return db[_0x33fa('0x3e')][_0x33fa('0x45')]({'where':{'id':_0x2336c7['params']['id']}})[_0x33fa('0x22')](handleEntityNotFound(_0x303e3e,null))[_0x33fa('0x22')](saveUpdates(_0x2336c7[_0x33fa('0x47')],null))[_0x33fa('0x22')](respondWithResult(_0x303e3e,null))['catch'](handleError(_0x303e3e,null));};exports[_0x33fa('0x23')]=function(_0x53e2fd,_0x3da217){return db['AnalyticExtractedReport'][_0x33fa('0x45')]({'where':{'id':_0x53e2fd[_0x33fa('0x44')]['id']}})[_0x33fa('0x22')](handleEntityNotFound(_0x3da217,null))[_0x33fa('0x22')](removeEntity(_0x3da217,null))[_0x33fa('0x42')](handleError(_0x3da217,null));};exports[_0x33fa('0x4f')]=function(_0x3d697d,_0x2fedbf,_0x1697a1){return db[_0x33fa('0x3e')]['find']({'where':{'id':_0x3d697d['params']['id']},'attributes':['name',_0x33fa('0x50'),_0x33fa('0x51'),'output'],'raw':!![]})[_0x33fa('0x22')](handleEntityNotFound(_0x2fedbf,null))[_0x33fa('0x22')](function(_0x438ac1){if(_0x438ac1){if(!fs['existsSync'](path[_0x33fa('0x52')](config['root'],'server/files/reports',_0x438ac1['savename']))){throw new db[(_0x33fa('0x53'))][(_0x33fa('0x54'))](_0x33fa('0x55'));}if(_0x3d697d[_0x33fa('0x2e')][_0x33fa('0x56')]){return _0x2fedbf[_0x33fa('0x57')](0xc8);}return _0x2fedbf[_0x33fa('0x4f')](path[_0x33fa('0x52')](config[_0x33fa('0x58')],'server/files/reports',_0x438ac1[_0x33fa('0x51')]),util[_0x33fa('0x59')](_0x33fa('0x5a'),_0x438ac1[_0x33fa('0x50')]||_0x438ac1[_0x33fa('0x26')],_0x438ac1[_0x33fa('0x5b')][_0x33fa('0x5c')]()));}})['catch'](handleError(_0x2fedbf,null));};
\ No newline at end of file
+var _0xbb51=['include','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','savename','output','existsSync','join','root','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','format','%s.%s','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll'];(function(_0xea6c7f,_0x18302f){var _0x3ae97e=function(_0x5dc40b){while(--_0x5dc40b){_0xea6c7f['push'](_0xea6c7f['shift']());}};_0x3ae97e(++_0x18302f);}(_0xbb51,0x1b7));var _0x1bb5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb51[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1bb5('0x0'));var rimraf=require(_0x1bb5('0x1'));var zipdir=require(_0x1bb5('0x2'));var jsonpatch=require(_0x1bb5('0x3'));var rp=require(_0x1bb5('0x4'));var moment=require(_0x1bb5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1bb5('0x6'));var util=require(_0x1bb5('0x7'));var path=require(_0x1bb5('0x8'));var sox=require(_0x1bb5('0x9'));var csv=require('to-csv');var ejs=require(_0x1bb5('0xa'));var fs=require('fs');var fs_extra=require(_0x1bb5('0xb'));var _=require('lodash');var squel=require(_0x1bb5('0xc'));var crypto=require(_0x1bb5('0xd'));var jsforce=require(_0x1bb5('0xe'));var deskjs=require(_0x1bb5('0xf'));var toCsv=require(_0x1bb5('0x10'));var querystring=require(_0x1bb5('0x11'));var Papa=require(_0x1bb5('0x12'));var Redis=require(_0x1bb5('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x1bb5('0x14'));var as=require(_0x1bb5('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1bb5('0x16'))(_0x1bb5('0x17'));var utils=require('../../config/utils');var config=require(_0x1bb5('0x18'));var licenseUtil=require(_0x1bb5('0x19'));var db=require(_0x1bb5('0x1a'))['db'];function respondWithStatusCode(_0x2b7c3f,_0x5911c2){_0x5911c2=_0x5911c2||0xcc;return function(_0x487d23){if(_0x487d23){return _0x2b7c3f[_0x1bb5('0x1b')](_0x5911c2);}return _0x2b7c3f[_0x1bb5('0x1c')](_0x5911c2)[_0x1bb5('0x1d')]();};}function respondWithResult(_0x17b298,_0x2c5b40){_0x2c5b40=_0x2c5b40||0xc8;return function(_0x43a4b8){if(_0x43a4b8){return _0x17b298[_0x1bb5('0x1c')](_0x2c5b40)[_0x1bb5('0x1e')](_0x43a4b8);}};}function respondWithFilteredResult(_0x14420a,_0x3c4bb2){return function(_0x2e6042){if(_0x2e6042){var _0x1b6746=typeof _0x3c4bb2[_0x1bb5('0x1f')]===_0x1bb5('0x20')&&typeof _0x3c4bb2[_0x1bb5('0x21')]===_0x1bb5('0x20');var _0x4e0f77=_0x2e6042['count'];var _0xbfbf70=_0x1b6746?0x0:_0x3c4bb2[_0x1bb5('0x1f')];var _0x116eb2=_0x1b6746?_0x2e6042[_0x1bb5('0x22')]:_0x3c4bb2['offset']+_0x3c4bb2[_0x1bb5('0x21')];var _0x178ad6;if(_0x116eb2>=_0x4e0f77){_0x116eb2=_0x4e0f77;_0x178ad6=0xc8;}else{_0x178ad6=0xce;}_0x14420a[_0x1bb5('0x1c')](_0x178ad6);return _0x14420a[_0x1bb5('0x23')](_0x1bb5('0x24'),_0xbfbf70+'-'+_0x116eb2+'/'+_0x4e0f77)[_0x1bb5('0x1e')](_0x2e6042);}return null;};}function patchUpdates(_0x42c8b4){return function(_0x5d1f1a){try{jsonpatch['apply'](_0x5d1f1a,_0x42c8b4,!![]);}catch(_0x4544be){return BPromise[_0x1bb5('0x25')](_0x4544be);}return _0x5d1f1a[_0x1bb5('0x26')]();};}function saveUpdates(_0x3ca782,_0xd2e139){return function(_0x57294f){if(_0x57294f){return _0x57294f[_0x1bb5('0x27')](_0x3ca782)[_0x1bb5('0x28')](function(_0x5e11a7){return _0x5e11a7;});}return null;};}function removeEntity(_0x265d2b,_0x5e90ef){return function(_0x57abfb){if(_0x57abfb){return _0x57abfb[_0x1bb5('0x29')]()[_0x1bb5('0x28')](function(){var _0x2a179e=_0x57abfb[_0x1bb5('0x2a')]({'plain':!![]});var _0x224c87='ExtractedReports';return db['UserProfileResource']['destroy']({'where':{'type':_0x224c87,'resourceId':_0x2a179e['id']}})['then'](function(){return _0x57abfb;});})[_0x1bb5('0x28')](function(){_0x265d2b[_0x1bb5('0x1c')](0xcc)[_0x1bb5('0x1d')]();});}};}function handleEntityNotFound(_0xdc7653,_0x5c6479){return function(_0x48d7ab){if(!_0x48d7ab){_0xdc7653[_0x1bb5('0x1b')](0x194);}return _0x48d7ab;};}function handleError(_0x25f8cb,_0x258305){_0x258305=_0x258305||0x1f4;return function(_0x119956){logger[_0x1bb5('0x2b')](_0x119956[_0x1bb5('0x2c')]);if(_0x119956[_0x1bb5('0x2d')]){delete _0x119956[_0x1bb5('0x2d')];}_0x25f8cb[_0x1bb5('0x1c')](_0x258305)[_0x1bb5('0x2e')](_0x119956);};}exports[_0x1bb5('0x2f')]=function(_0x122bf1,_0x37c6a3){var _0x5be849={},_0x206952={},_0x2b16f8={'count':0x0,'rows':[]};var _0x1b345e=_[_0x1bb5('0x30')](db[_0x1bb5('0x31')][_0x1bb5('0x32')],function(_0x355aa3){return{'name':_0x355aa3['fieldName'],'type':_0x355aa3[_0x1bb5('0x33')]['key']};});_0x206952[_0x1bb5('0x34')]=_['map'](_0x1b345e,_0x1bb5('0x2d'));_0x206952[_0x1bb5('0x35')]=_[_0x1bb5('0x36')](_0x122bf1[_0x1bb5('0x35')]);_0x206952['filters']=_[_0x1bb5('0x37')](_0x206952[_0x1bb5('0x34')],_0x206952[_0x1bb5('0x35')]);_0x5be849[_0x1bb5('0x38')]=_[_0x1bb5('0x37')](_0x206952['model'],qs[_0x1bb5('0x39')](_0x122bf1[_0x1bb5('0x35')][_0x1bb5('0x39')]));_0x5be849[_0x1bb5('0x38')]=_0x5be849[_0x1bb5('0x38')][_0x1bb5('0x3a')]?_0x5be849[_0x1bb5('0x38')]:_0x206952[_0x1bb5('0x34')];if(!_0x122bf1[_0x1bb5('0x35')][_0x1bb5('0x3b')](_0x1bb5('0x3c'))){_0x5be849['limit']=qs[_0x1bb5('0x21')](_0x122bf1['query'][_0x1bb5('0x21')]);_0x5be849[_0x1bb5('0x1f')]=qs[_0x1bb5('0x1f')](_0x122bf1[_0x1bb5('0x35')][_0x1bb5('0x1f')]);}_0x5be849[_0x1bb5('0x3d')]=qs[_0x1bb5('0x3e')](_0x122bf1[_0x1bb5('0x35')][_0x1bb5('0x3e')]);_0x5be849[_0x1bb5('0x3f')]=qs['filters'](_[_0x1bb5('0x40')](_0x122bf1[_0x1bb5('0x35')],_0x206952[_0x1bb5('0x41')]),_0x1b345e);if(_0x122bf1[_0x1bb5('0x35')][_0x1bb5('0x42')]){_0x5be849[_0x1bb5('0x3f')]=_[_0x1bb5('0x43')](_0x5be849[_0x1bb5('0x3f')],{'$or':_[_0x1bb5('0x30')](_0x1b345e,function(_0x8af2e0){if(_0x8af2e0[_0x1bb5('0x33')]!==_0x1bb5('0x44')){var _0x1e0024={};_0x1e0024[_0x8af2e0[_0x1bb5('0x2d')]]={'$like':'%'+_0x122bf1[_0x1bb5('0x35')][_0x1bb5('0x42')]+'%'};return _0x1e0024;}})});}_0x5be849=_[_0x1bb5('0x43')]({},_0x5be849,_0x122bf1[_0x1bb5('0x45')]);var _0x3918aa={'where':_0x5be849[_0x1bb5('0x3f')]};return db['AnalyticExtractedReport'][_0x1bb5('0x22')](_0x3918aa)[_0x1bb5('0x28')](function(_0x2f14e5){_0x2b16f8[_0x1bb5('0x22')]=_0x2f14e5;if(_0x122bf1[_0x1bb5('0x35')][_0x1bb5('0x46')]){_0x5be849[_0x1bb5('0x47')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x5be849);})[_0x1bb5('0x28')](function(_0x1df9d1){_0x2b16f8[_0x1bb5('0x48')]=_0x1df9d1;return _0x2b16f8;})[_0x1bb5('0x28')](respondWithFilteredResult(_0x37c6a3,_0x5be849))[_0x1bb5('0x49')](handleError(_0x37c6a3,null));};exports[_0x1bb5('0x4a')]=function(_0x2eff57,_0x66f710){var _0x2905d8={'raw':!![],'where':{'id':_0x2eff57[_0x1bb5('0x4b')]['id']}},_0x4d82eb={};_0x4d82eb[_0x1bb5('0x34')]=_[_0x1bb5('0x36')](db[_0x1bb5('0x31')][_0x1bb5('0x32')]);_0x4d82eb[_0x1bb5('0x35')]=_[_0x1bb5('0x36')](_0x2eff57['query']);_0x4d82eb[_0x1bb5('0x41')]=_['intersection'](_0x4d82eb[_0x1bb5('0x34')],_0x4d82eb['query']);_0x2905d8[_0x1bb5('0x38')]=_['intersection'](_0x4d82eb[_0x1bb5('0x34')],qs['fields'](_0x2eff57[_0x1bb5('0x35')][_0x1bb5('0x39')]));_0x2905d8[_0x1bb5('0x38')]=_0x2905d8[_0x1bb5('0x38')][_0x1bb5('0x3a')]?_0x2905d8[_0x1bb5('0x38')]:_0x4d82eb[_0x1bb5('0x34')];if(_0x2eff57[_0x1bb5('0x35')][_0x1bb5('0x46')]){_0x2905d8[_0x1bb5('0x47')]=[{'all':!![]}];}_0x2905d8=_['merge']({},_0x2905d8,_0x2eff57[_0x1bb5('0x45')]);return db[_0x1bb5('0x31')][_0x1bb5('0x4c')](_0x2905d8)[_0x1bb5('0x28')](handleEntityNotFound(_0x66f710,null))[_0x1bb5('0x28')](respondWithResult(_0x66f710,null))[_0x1bb5('0x49')](handleError(_0x66f710,null));};exports[_0x1bb5('0x4d')]=function(_0x3040b0,_0x84b50e){return db[_0x1bb5('0x31')]['create'](_0x3040b0[_0x1bb5('0x4e')],{})[_0x1bb5('0x28')](function(_0x2a39ab){var _0x138f06=_0x3040b0['user'][_0x1bb5('0x2a')]({'plain':!![]});if(!_0x138f06)throw new Error(_0x1bb5('0x4f'));if(_0x138f06[_0x1bb5('0x50')]===_0x1bb5('0x51')){var _0x20cdf6=_0x2a39ab[_0x1bb5('0x2a')]({'plain':!![]});var _0x234ab2=_0x1bb5('0x52');return db[_0x1bb5('0x53')][_0x1bb5('0x4c')]({'where':{'name':_0x234ab2,'userProfileId':_0x138f06[_0x1bb5('0x54')]},'raw':!![]})[_0x1bb5('0x28')](function(_0x2dc896){if(_0x2dc896&&_0x2dc896[_0x1bb5('0x55')]===0x0){return db[_0x1bb5('0x56')][_0x1bb5('0x4d')]({'name':_0x20cdf6['name'],'resourceId':_0x20cdf6['id'],'type':_0x2dc896['name'],'sectionId':_0x2dc896['id']},{})[_0x1bb5('0x28')](function(){return _0x2a39ab;});}else{return _0x2a39ab;}})[_0x1bb5('0x49')](function(_0x35bd16){logger[_0x1bb5('0x2b')](_0x1bb5('0x57'),_0x35bd16);throw _0x35bd16;});}return _0x2a39ab;})[_0x1bb5('0x28')](respondWithResult(_0x84b50e,0xc9))[_0x1bb5('0x49')](handleError(_0x84b50e,null));};exports[_0x1bb5('0x27')]=function(_0x165229,_0x9d6e1d){if(_0x165229[_0x1bb5('0x4e')]['id']){delete _0x165229['body']['id'];}return db[_0x1bb5('0x31')]['find']({'where':{'id':_0x165229[_0x1bb5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x9d6e1d,null))[_0x1bb5('0x28')](saveUpdates(_0x165229[_0x1bb5('0x4e')],null))[_0x1bb5('0x28')](respondWithResult(_0x9d6e1d,null))[_0x1bb5('0x49')](handleError(_0x9d6e1d,null));};exports['destroy']=function(_0x3d02ac,_0x56fef5){return db[_0x1bb5('0x31')][_0x1bb5('0x4c')]({'where':{'id':_0x3d02ac[_0x1bb5('0x4b')]['id']}})[_0x1bb5('0x28')](handleEntityNotFound(_0x56fef5,null))[_0x1bb5('0x28')](removeEntity(_0x56fef5,null))[_0x1bb5('0x49')](handleError(_0x56fef5,null));};exports[_0x1bb5('0x58')]=function(_0x491d9b,_0x4b5d52,_0x4e4a2d){return db[_0x1bb5('0x31')][_0x1bb5('0x4c')]({'where':{'id':_0x491d9b[_0x1bb5('0x4b')]['id']},'attributes':[_0x1bb5('0x2d'),'basename',_0x1bb5('0x59'),_0x1bb5('0x5a')],'raw':!![]})[_0x1bb5('0x28')](handleEntityNotFound(_0x4b5d52,null))[_0x1bb5('0x28')](function(_0x26ba73){if(_0x26ba73){if(!fs[_0x1bb5('0x5b')](path[_0x1bb5('0x5c')](config[_0x1bb5('0x5d')],'server/files/reports',_0x26ba73[_0x1bb5('0x59')]))){throw new db['Sequelize'][(_0x1bb5('0x5e'))](_0x1bb5('0x5f'));}if(_0x491d9b['query'][_0x1bb5('0x60')]){return _0x4b5d52['sendStatus'](0xc8);}return _0x4b5d52[_0x1bb5('0x58')](path[_0x1bb5('0x5c')](config[_0x1bb5('0x5d')],_0x1bb5('0x61'),_0x26ba73[_0x1bb5('0x59')]),util[_0x1bb5('0x62')](_0x1bb5('0x63'),_0x26ba73[_0x1bb5('0x64')]||_0x26ba73[_0x1bb5('0x2d')],_0x26ba73[_0x1bb5('0x5a')][_0x1bb5('0x65')]()));}})['catch'](handleError(_0x4b5d52,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index b7ad941..408ae7c 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 _0x8a4a=['../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','util','../../config/logger','api','moment','request-promise','path'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x8a4a,0x14f));var _0xa8a4=function(_0x20118a,_0x3dbdf3){_0x20118a=_0x20118a-0x0;var _0x538b5f=_0x8a4a[_0x20118a];return _0x538b5f;};'use strict';var _=require('lodash');var util=require(_0xa8a4('0x0'));var logger=require(_0xa8a4('0x1'))(_0xa8a4('0x2'));var moment=require(_0xa8a4('0x3'));var BPromise=require('bluebird');var rp=require(_0xa8a4('0x4'));var fs=require('fs');var path=require(_0xa8a4('0x5'));var rimraf=require('rimraf');var config=require(_0xa8a4('0x6'));var attributes=require(_0xa8a4('0x7'));module[_0xa8a4('0x8')]=function(_0x116470,_0x22f208){return _0x116470[_0xa8a4('0x9')]('AnalyticExtractedReport',attributes,{'tableName':_0xa8a4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x213a=['exports','define','AnalyticExtractedReport','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x2f7af4,_0x27308a){var _0x59b7eb=function(_0x543240){while(--_0x543240){_0x2f7af4['push'](_0x2f7af4['shift']());}};_0x59b7eb(++_0x27308a);}(_0x213a,0x107));var _0xa213=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x213a[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0xa213('0x0'));var logger=require(_0xa213('0x1'))(_0xa213('0x2'));var moment=require(_0xa213('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa213('0x4'));var rimraf=require(_0xa213('0x5'));var config=require(_0xa213('0x6'));var attributes=require('./analyticExtractedReport.attributes');module[_0xa213('0x7')]=function(_0x5025ed,_0x2ad619){return _0x5025ed[_0xa213('0x8')](_0xa213('0x9'),attributes,{'tableName':'analytics_extracted_reports','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 f3a827f..4baed53 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 _0x3b45=['client','request','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3b45,0x68));var _0x53b4=function(_0x58604d,_0xf3c833){_0x58604d=_0x58604d-0x0;var _0x4c27a8=_0x3b45[_0x58604d];return _0x4c27a8;};'use strict';var _=require(_0x53b4('0x0'));var util=require(_0x53b4('0x1'));var moment=require(_0x53b4('0x2'));var BPromise=require(_0x53b4('0x3'));var rs=require(_0x53b4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53b4('0x5'))['db'];var utils=require(_0x53b4('0x6'));var logger=require(_0x53b4('0x7'))(_0x53b4('0x8'));var config=require(_0x53b4('0x9'));var jayson=require(_0x53b4('0xa'));var client=jayson[_0x53b4('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e6a7d,_0x4d5846,_0x1eca46){return new BPromise(function(_0x14c4d0,_0x127cbf){return client[_0x53b4('0xc')](_0x5e6a7d,_0x1eca46)['then'](function(_0x54b39d){logger[_0x53b4('0xd')](_0x53b4('0xe'),_0x4d5846,'request\x20sent');logger[_0x53b4('0xf')](_0x53b4('0x10'),_0x4d5846,_0x53b4('0x11'),JSON[_0x53b4('0x12')](_0x54b39d));if(_0x54b39d['error']){if(_0x54b39d[_0x53b4('0x13')][_0x53b4('0x14')]===0x1f4){logger[_0x53b4('0x13')](_0x53b4('0xe'),_0x4d5846,_0x54b39d[_0x53b4('0x13')][_0x53b4('0x15')]);return _0x127cbf(_0x54b39d[_0x53b4('0x13')][_0x53b4('0x15')]);}logger[_0x53b4('0x13')](_0x53b4('0xe'),_0x4d5846,_0x54b39d[_0x53b4('0x13')]['message']);return _0x14c4d0(_0x54b39d[_0x53b4('0x13')][_0x53b4('0x15')]);}else{logger['info'](_0x53b4('0xe'),_0x4d5846,_0x53b4('0x11'));_0x14c4d0(_0x54b39d[_0x53b4('0x16')][_0x53b4('0x15')]);}})['catch'](function(_0x91dfc2){logger[_0x53b4('0x13')](_0x53b4('0xe'),_0x4d5846,_0x91dfc2);_0x127cbf(_0x91dfc2);});});}
\ No newline at end of file
+var _0xaed4=['../../config/environment','jayson/promise','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x2ff022,_0x183a9c){var _0x1cbaa5=function(_0x342bd9){while(--_0x342bd9){_0x2ff022['push'](_0x2ff022['shift']());}};_0x1cbaa5(++_0x183a9c);}(_0xaed4,0xf4));var _0x4aed=function(_0x15e478,_0x1e5a1a){_0x15e478=_0x15e478-0x0;var _0x4158c4=_0xaed4[_0x15e478];return _0x4158c4;};'use strict';var _=require(_0x4aed('0x0'));var util=require('util');var moment=require(_0x4aed('0x1'));var BPromise=require(_0x4aed('0x2'));var rs=require(_0x4aed('0x3'));var fs=require('fs');var Redis=require(_0x4aed('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4aed('0x5'));var logger=require(_0x4aed('0x6'))(_0x4aed('0x7'));var config=require(_0x4aed('0x8'));var jayson=require(_0x4aed('0x9'));var client=jayson['client'][_0x4aed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44dd26,_0x1a1edf,_0x404afa){return new BPromise(function(_0x176cd1,_0x5585e2){return client[_0x4aed('0xb')](_0x44dd26,_0x404afa)['then'](function(_0x41df96){logger[_0x4aed('0xc')](_0x4aed('0xd'),_0x1a1edf,_0x4aed('0xe'));logger[_0x4aed('0xf')](_0x4aed('0x10'),_0x1a1edf,'request\x20sent',JSON['stringify'](_0x41df96));if(_0x41df96[_0x4aed('0x11')]){if(_0x41df96[_0x4aed('0x11')][_0x4aed('0x12')]===0x1f4){logger[_0x4aed('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1a1edf,_0x41df96[_0x4aed('0x11')]['message']);return _0x5585e2(_0x41df96[_0x4aed('0x11')][_0x4aed('0x13')]);}logger[_0x4aed('0x11')](_0x4aed('0xd'),_0x1a1edf,_0x41df96[_0x4aed('0x11')]['message']);return _0x176cd1(_0x41df96[_0x4aed('0x11')][_0x4aed('0x13')]);}else{logger[_0x4aed('0xc')](_0x4aed('0xd'),_0x1a1edf,'request\x20sent');_0x176cd1(_0x41df96['result'][_0x4aed('0x13')]);}})[_0x4aed('0x14')](function(_0x208ba7){logger[_0x4aed('0x11')](_0x4aed('0xd'),_0x1a1edf,_0x208ba7);_0x5585e2(_0x208ba7);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index b70bfb7..10e4784 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 _0x1a60=['get','/:id/download','download','post','create','put','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../config/environment','./analyticExtractedReport.controller','/:id','isAuthenticated','show'];(function(_0x225354,_0x5023a4){var _0x473b0e=function(_0x2adc2a){while(--_0x2adc2a){_0x225354['push'](_0x225354['shift']());}};_0x473b0e(++_0x5023a4);}(_0x1a60,0xa1));var _0x01a6=function(_0x3f3ac3,_0x150461){_0x3f3ac3=_0x3f3ac3-0x0;var _0x49fb00=_0x1a60[_0x3f3ac3];return _0x49fb00;};'use strict';var multer=require('multer');var util=require(_0x01a6('0x0'));var path=require(_0x01a6('0x1'));var timeout=require(_0x01a6('0x2'));var express=require('express');var router=express[_0x01a6('0x3')]();var fs_extra=require(_0x01a6('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x01a6('0x5'));var controller=require(_0x01a6('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x01a6('0x7'),auth[_0x01a6('0x8')](),controller[_0x01a6('0x9')]);router[_0x01a6('0xa')](_0x01a6('0xb'),auth[_0x01a6('0x8')](),controller[_0x01a6('0xc')]);router[_0x01a6('0xd')]('/',auth[_0x01a6('0x8')](),controller[_0x01a6('0xe')]);router[_0x01a6('0xf')](_0x01a6('0x7'),auth['isAuthenticated'](),controller[_0x01a6('0x10')]);router[_0x01a6('0x11')]('/:id',auth[_0x01a6('0x8')](),controller['destroy']);module[_0x01a6('0x12')]=router;
\ No newline at end of file
+var _0x1400=['util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','download','create','put','update','delete','/:id','destroy','exports','multer'];(function(_0x3fd0b3,_0x5ae2ec){var _0x5d4b4a=function(_0x3fb189){while(--_0x3fb189){_0x3fd0b3['push'](_0x3fd0b3['shift']());}};_0x5d4b4a(++_0x5ae2ec);}(_0x1400,0xbd));var _0x0140=function(_0x4ec448,_0x2ef4c5){_0x4ec448=_0x4ec448-0x0;var _0x273ea9=_0x1400[_0x4ec448];return _0x273ea9;};'use strict';var multer=require(_0x0140('0x0'));var util=require(_0x0140('0x1'));var path=require(_0x0140('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0140('0x3'));var auth=require(_0x0140('0x4'));var interaction=require(_0x0140('0x5'));var config=require(_0x0140('0x6'));var controller=require(_0x0140('0x7'));router[_0x0140('0x8')]('/',auth[_0x0140('0x9')](),controller[_0x0140('0xa')]);router['get']('/:id',auth[_0x0140('0x9')](),controller['show']);router[_0x0140('0x8')]('/:id/download',auth[_0x0140('0x9')](),controller[_0x0140('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0140('0xc')]);router[_0x0140('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x0140('0xe')]);router[_0x0140('0xf')](_0x0140('0x10'),auth[_0x0140('0x9')](),controller[_0x0140('0x11')]);module[_0x0140('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 5687e92..60c7776 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 _0xc880=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x316473,_0x35bdc2){var _0x29156e=function(_0x509017){while(--_0x509017){_0x316473['push'](_0x316473['shift']());}};_0x29156e(++_0x35bdc2);}(_0xc880,0x12e));var _0x0c88=function(_0x1bf043,_0x255f61){_0x1bf043=_0x1bf043-0x0;var _0x44181f=_0xc880[_0x1bf043];return _0x44181f;};'use strict';var Sequelize=require(_0x0c88('0x0'));module['exports']={'field':{'type':Sequelize[_0x0c88('0x1')]},'alias':{'type':Sequelize[_0x0c88('0x2')]},'function':{'type':Sequelize[_0x0c88('0x2')]},'format':{'type':Sequelize[_0x0c88('0x2')]},'groupBy':{'type':Sequelize[_0x0c88('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0c88('0x2')]},'custom':{'type':Sequelize[_0x0c88('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x480e=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x482115,_0x5550f5){var _0x40afb4=function(_0x44ce30){while(--_0x44ce30){_0x482115['push'](_0x482115['shift']());}};_0x40afb4(++_0x5550f5);}(_0x480e,0x192));var _0xe480=function(_0x5ece6f,_0x124b6e){_0x5ece6f=_0x5ece6f-0x0;var _0x4e41ee=_0x480e[_0x5ece6f];return _0x4e41ee;};'use strict';var Sequelize=require(_0xe480('0x0'));module[_0xe480('0x1')]={'field':{'type':Sequelize[_0xe480('0x2')]},'alias':{'type':Sequelize[_0xe480('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xe480('0x3')]},'groupBy':{'type':Sequelize[_0xe480('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xe480('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 ca92804..ab8cbfb 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 _0xf2ac=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','key','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','order','filters','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','fields','create','body','bulkCreate','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','jsforce','desk.js','querystring'];(function(_0x1cc808,_0xee2ba){var _0x5ddfc7=function(_0x104960){while(--_0x104960){_0x1cc808['push'](_0x1cc808['shift']());}};_0x5ddfc7(++_0xee2ba);}(_0xf2ac,0xe9));var _0xcf2a=function(_0x3a1955,_0x37a17e){_0x3a1955=_0x3a1955-0x0;var _0x483c1b=_0xf2ac[_0x3a1955];return _0x483c1b;};'use strict';var emlformat=require(_0xcf2a('0x0'));var rimraf=require(_0xcf2a('0x1'));var zipdir=require(_0xcf2a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcf2a('0x3'));var moment=require(_0xcf2a('0x4'));var BPromise=require(_0xcf2a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcf2a('0x6'));var sox=require(_0xcf2a('0x7'));var csv=require(_0xcf2a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcf2a('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcf2a('0xa'));var deskjs=require(_0xcf2a('0xb'));var toCsv=require(_0xcf2a('0x8'));var querystring=require(_0xcf2a('0xc'));var Papa=require(_0xcf2a('0xd'));var Redis=require(_0xcf2a('0xe'));var authService=require(_0xcf2a('0xf'));var qs=require(_0xcf2a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcf2a('0x11'));var logger=require(_0xcf2a('0x12'))(_0xcf2a('0x13'));var utils=require(_0xcf2a('0x14'));var config=require(_0xcf2a('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xcf2a('0x16'))['db'];function respondWithStatusCode(_0x572c85,_0x185702){_0x185702=_0x185702||0xcc;return function(_0x3a7882){if(_0x3a7882){return _0x572c85['sendStatus'](_0x185702);}return _0x572c85[_0xcf2a('0x17')](_0x185702)[_0xcf2a('0x18')]();};}function respondWithResult(_0x672dd6,_0xc19418){_0xc19418=_0xc19418||0xc8;return function(_0x35e08d){if(_0x35e08d){return _0x672dd6['status'](_0xc19418)[_0xcf2a('0x19')](_0x35e08d);}};}function respondWithFilteredResult(_0x3f1080,_0x3fce97){return function(_0xb0f79f){if(_0xb0f79f){var _0x3378af=typeof _0x3fce97[_0xcf2a('0x1a')]===_0xcf2a('0x1b')&&typeof _0x3fce97[_0xcf2a('0x1c')]===_0xcf2a('0x1b');var _0x22baa4=_0xb0f79f[_0xcf2a('0x1d')];var _0x3e2419=_0x3378af?0x0:_0x3fce97[_0xcf2a('0x1a')];var _0x543824=_0x3378af?_0xb0f79f['count']:_0x3fce97[_0xcf2a('0x1a')]+_0x3fce97[_0xcf2a('0x1c')];var _0x4d8378;if(_0x543824>=_0x22baa4){_0x543824=_0x22baa4;_0x4d8378=0xc8;}else{_0x4d8378=0xce;}_0x3f1080['status'](_0x4d8378);return _0x3f1080[_0xcf2a('0x1e')](_0xcf2a('0x1f'),_0x3e2419+'-'+_0x543824+'/'+_0x22baa4)[_0xcf2a('0x19')](_0xb0f79f);}return null;};}function patchUpdates(_0x2ee52b){return function(_0x4beb69){try{jsonpatch[_0xcf2a('0x20')](_0x4beb69,_0x2ee52b,!![]);}catch(_0x40cd9f){return BPromise[_0xcf2a('0x21')](_0x40cd9f);}return _0x4beb69[_0xcf2a('0x22')]();};}function saveUpdates(_0x1f11ad,_0x5b81f5){return function(_0x5c1520){if(_0x5c1520){return _0x5c1520[_0xcf2a('0x23')](_0x1f11ad)[_0xcf2a('0x24')](function(_0x5bf0c0){return _0x5bf0c0;});}return null;};}function removeEntity(_0x935d3c,_0x5269a5){return function(_0x1133b5){if(_0x1133b5){return _0x1133b5[_0xcf2a('0x25')]()['then'](function(){_0x935d3c['status'](0xcc)[_0xcf2a('0x18')]();});}};}function handleEntityNotFound(_0x1c43eb,_0x3c11c6){return function(_0x1f9212){if(!_0x1f9212){_0x1c43eb[_0xcf2a('0x26')](0x194);}return _0x1f9212;};}function handleError(_0x2ecd1f,_0x1cf5dc){_0x1cf5dc=_0x1cf5dc||0x1f4;return function(_0x2a48cb){logger[_0xcf2a('0x27')](_0x2a48cb[_0xcf2a('0x28')]);if(_0x2a48cb[_0xcf2a('0x29')]){delete _0x2a48cb[_0xcf2a('0x29')];}_0x2ecd1f[_0xcf2a('0x17')](_0x1cf5dc)[_0xcf2a('0x2a')](_0x2a48cb);};}exports[_0xcf2a('0x2b')]=function(_0x2965ae,_0x467660){var _0x4040f1={},_0x5291e5={},_0x5491d4={'count':0x0,'rows':[]};var _0x12d072=_[_0xcf2a('0x2c')](db[_0xcf2a('0x2d')][_0xcf2a('0x2e')],function(_0x229efa){return{'name':_0x229efa['fieldName'],'type':_0x229efa['type'][_0xcf2a('0x2f')]};});_0x5291e5[_0xcf2a('0x30')]=_[_0xcf2a('0x2c')](_0x12d072,_0xcf2a('0x29'));_0x5291e5[_0xcf2a('0x31')]=_[_0xcf2a('0x32')](_0x2965ae[_0xcf2a('0x31')]);_0x5291e5['filters']=_[_0xcf2a('0x33')](_0x5291e5[_0xcf2a('0x30')],_0x5291e5[_0xcf2a('0x31')]);_0x4040f1[_0xcf2a('0x34')]=_[_0xcf2a('0x33')](_0x5291e5[_0xcf2a('0x30')],qs['fields'](_0x2965ae[_0xcf2a('0x31')]['fields']));_0x4040f1[_0xcf2a('0x34')]=_0x4040f1[_0xcf2a('0x34')]['length']?_0x4040f1['attributes']:_0x5291e5[_0xcf2a('0x30')];if(!_0x2965ae['query'][_0xcf2a('0x35')](_0xcf2a('0x36'))){_0x4040f1[_0xcf2a('0x1c')]=qs[_0xcf2a('0x1c')](_0x2965ae[_0xcf2a('0x31')][_0xcf2a('0x1c')]);_0x4040f1[_0xcf2a('0x1a')]=qs[_0xcf2a('0x1a')](_0x2965ae['query'][_0xcf2a('0x1a')]);}_0x4040f1[_0xcf2a('0x37')]=qs['sort'](_0x2965ae[_0xcf2a('0x31')]['sort']);_0x4040f1['where']=qs[_0xcf2a('0x38')](_['pick'](_0x2965ae['query'],_0x5291e5[_0xcf2a('0x38')]),_0x12d072);if(_0x2965ae[_0xcf2a('0x31')][_0xcf2a('0x39')]){_0x4040f1[_0xcf2a('0x3a')]=_[_0xcf2a('0x3b')](_0x4040f1['where'],{'$or':_[_0xcf2a('0x2c')](_0x12d072,function(_0x151169){if(_0x151169['type']!==_0xcf2a('0x3c')){var _0x411234={};_0x411234[_0x151169[_0xcf2a('0x29')]]={'$like':'%'+_0x2965ae[_0xcf2a('0x31')][_0xcf2a('0x39')]+'%'};return _0x411234;}})});}_0x4040f1=_['merge']({},_0x4040f1,_0x2965ae[_0xcf2a('0x3d')]);var _0x214534={'where':_0x4040f1[_0xcf2a('0x3a')]};return db[_0xcf2a('0x2d')][_0xcf2a('0x1d')](_0x214534)[_0xcf2a('0x24')](function(_0x23daf1){_0x5491d4[_0xcf2a('0x1d')]=_0x23daf1;if(_0x2965ae[_0xcf2a('0x31')][_0xcf2a('0x3e')]){_0x4040f1[_0xcf2a('0x3f')]=[{'all':!![]}];}return db[_0xcf2a('0x2d')]['findAll'](_0x4040f1);})['then'](function(_0x5cdde8){_0x5491d4[_0xcf2a('0x40')]=_0x5cdde8;return _0x5491d4;})['then'](respondWithFilteredResult(_0x467660,_0x4040f1))[_0xcf2a('0x41')](handleError(_0x467660,null));};exports[_0xcf2a('0x42')]=function(_0x43bdb3,_0x353758){var _0x2aee20={'raw':![],'where':{'id':_0x43bdb3[_0xcf2a('0x43')]['id']}},_0x247783={};_0x247783[_0xcf2a('0x30')]=_[_0xcf2a('0x32')](db[_0xcf2a('0x2d')][_0xcf2a('0x2e')]);_0x247783[_0xcf2a('0x31')]=_['keys'](_0x43bdb3['query']);_0x247783['filters']=_[_0xcf2a('0x33')](_0x247783['model'],_0x247783['query']);_0x2aee20[_0xcf2a('0x34')]=_['intersection'](_0x247783[_0xcf2a('0x30')],qs['fields'](_0x43bdb3[_0xcf2a('0x31')][_0xcf2a('0x44')]));_0x2aee20[_0xcf2a('0x34')]=_0x2aee20[_0xcf2a('0x34')]['length']?_0x2aee20[_0xcf2a('0x34')]:_0x247783[_0xcf2a('0x30')];if(_0x43bdb3[_0xcf2a('0x31')][_0xcf2a('0x3e')]){_0x2aee20[_0xcf2a('0x3f')]=[{'all':!![]}];}_0x2aee20=_[_0xcf2a('0x3b')]({},_0x2aee20,_0x43bdb3['options']);return db['AnalyticFieldReport']['find'](_0x2aee20)['then'](handleEntityNotFound(_0x353758,null))['then'](respondWithResult(_0x353758,null))['catch'](handleError(_0x353758,null));};exports['create']=function(_0x3c9222,_0x3918b1){return db[_0xcf2a('0x2d')][_0xcf2a('0x45')](_0x3c9222[_0xcf2a('0x46')],{})[_0xcf2a('0x24')](respondWithResult(_0x3918b1,0xc9))['catch'](handleError(_0x3918b1,null));};exports[_0xcf2a('0x47')]=function(_0x24d9e5,_0x402a4a){return db['AnalyticFieldReport'][_0xcf2a('0x47')](_0x24d9e5['body'],{'raw':![],'individualHooks':!![]})[_0xcf2a('0x24')](respondWithResult(_0x402a4a,0xc9))['catch'](handleError(_0x402a4a,null));};exports[_0xcf2a('0x23')]=function(_0x1f5602,_0x547ab0){if(_0x1f5602[_0xcf2a('0x46')]['id']){delete _0x1f5602[_0xcf2a('0x46')]['id'];}return db[_0xcf2a('0x2d')]['find']({'where':{'id':_0x1f5602[_0xcf2a('0x43')]['id']}})[_0xcf2a('0x24')](handleEntityNotFound(_0x547ab0,null))['then'](saveUpdates(_0x1f5602[_0xcf2a('0x46')],null))[_0xcf2a('0x24')](respondWithResult(_0x547ab0,null))[_0xcf2a('0x41')](handleError(_0x547ab0,null));};exports[_0xcf2a('0x25')]=function(_0x4e16f2,_0x3a398a){return db[_0xcf2a('0x2d')][_0xcf2a('0x48')]({'where':{'id':_0x4e16f2[_0xcf2a('0x43')]['id']}})[_0xcf2a('0x24')](handleEntityNotFound(_0x3a398a,null))[_0xcf2a('0x24')](removeEntity(_0x3a398a,null))[_0xcf2a('0x41')](handleError(_0x3a398a,null));};exports[_0xcf2a('0x49')]=function(_0x3d4570,_0x6a6b5){return db['AnalyticFieldReport'][_0xcf2a('0x25')]({'where':{'id':_0x3d4570[_0xcf2a('0x31')][_0xcf2a('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0xcf2a('0x24')](respondWithResult(_0x6a6b5,0xcc))[_0xcf2a('0x41')](handleError(_0x6a6b5,null));};exports[_0xcf2a('0x4b')]=function(_0x178505,_0x2cfe17,_0x1b0055){return db[_0xcf2a('0x4c')][_0xcf2a('0x4d')]({'where':{'id':_0x178505['params']['id']}})[_0xcf2a('0x24')](handleEntityNotFound(_0x2cfe17,null))[_0xcf2a('0x24')](function(_0x13abfb){if(_0x13abfb){return db[_0xcf2a('0x4e')][_0xcf2a('0x4f')](function(_0x33a074){return db[_0xcf2a('0x2d')][_0xcf2a('0x25')]({'where':{'CustomReportId':_0x178505[_0xcf2a('0x43')]['id']},'transaction':_0x33a074})[_0xcf2a('0x24')](function(_0x35d602){var _0x2b2f01=_[_0xcf2a('0x2c')](_0x178505['body'],function(_0x298687){delete _0x298687['id'];_0x298687[_0xcf2a('0x50')]=_0x178505[_0xcf2a('0x43')]['id'];return _0x298687;});return db[_0xcf2a('0x2d')][_0xcf2a('0x47')](_0x2b2f01,{'transaction':_0x33a074});});})['then'](function(){return db[_0xcf2a('0x2d')][_0xcf2a('0x51')]({'where':{'CustomReportId':_0x178505['params']['id']}});});}})['then'](respondWithResult(_0x2cfe17,null))[_0xcf2a('0x41')](handleError(_0x2cfe17,null));};
\ No newline at end of file
+var _0x5273=['map','AnalyticFieldReport','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','bulkCreate','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index'];(function(_0x37f8aa,_0x5b66dc){var _0x289b3e=function(_0x2160df){while(--_0x2160df){_0x37f8aa['push'](_0x37f8aa['shift']());}};_0x289b3e(++_0x5b66dc);}(_0x5273,0x11c));var _0x3527=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5273[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3527('0x0'));var zipdir=require(_0x3527('0x1'));var jsonpatch=require(_0x3527('0x2'));var rp=require(_0x3527('0x3'));var moment=require('moment');var BPromise=require(_0x3527('0x4'));var Mustache=require(_0x3527('0x5'));var util=require(_0x3527('0x6'));var path=require(_0x3527('0x7'));var sox=require(_0x3527('0x8'));var csv=require(_0x3527('0x9'));var ejs=require(_0x3527('0xa'));var fs=require('fs');var fs_extra=require(_0x3527('0xb'));var _=require('lodash');var squel=require(_0x3527('0xc'));var crypto=require(_0x3527('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3527('0x9'));var querystring=require(_0x3527('0xe'));var Papa=require(_0x3527('0xf'));var Redis=require(_0x3527('0x10'));var authService=require(_0x3527('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3527('0x12'));var hardwareService=require(_0x3527('0x13'));var logger=require(_0x3527('0x14'))(_0x3527('0x15'));var utils=require('../../config/utils');var config=require(_0x3527('0x16'));var licenseUtil=require(_0x3527('0x17'));var db=require(_0x3527('0x18'))['db'];function respondWithStatusCode(_0x4ef4b1,_0x422acb){_0x422acb=_0x422acb||0xcc;return function(_0x6be3af){if(_0x6be3af){return _0x4ef4b1['sendStatus'](_0x422acb);}return _0x4ef4b1[_0x3527('0x19')](_0x422acb)[_0x3527('0x1a')]();};}function respondWithResult(_0x1b294d,_0x5b61ba){_0x5b61ba=_0x5b61ba||0xc8;return function(_0x4e155f){if(_0x4e155f){return _0x1b294d['status'](_0x5b61ba)[_0x3527('0x1b')](_0x4e155f);}};}function respondWithFilteredResult(_0x45f58a,_0xa51c76){return function(_0x33cb98){if(_0x33cb98){var _0x2d539c=typeof _0xa51c76[_0x3527('0x1c')]===_0x3527('0x1d')&&typeof _0xa51c76[_0x3527('0x1e')]===_0x3527('0x1d');var _0x371ebc=_0x33cb98['count'];var _0x4e68d4=_0x2d539c?0x0:_0xa51c76['offset'];var _0x2d7eae=_0x2d539c?_0x33cb98[_0x3527('0x1f')]:_0xa51c76['offset']+_0xa51c76[_0x3527('0x1e')];var _0x5dd2e5;if(_0x2d7eae>=_0x371ebc){_0x2d7eae=_0x371ebc;_0x5dd2e5=0xc8;}else{_0x5dd2e5=0xce;}_0x45f58a[_0x3527('0x19')](_0x5dd2e5);return _0x45f58a[_0x3527('0x20')](_0x3527('0x21'),_0x4e68d4+'-'+_0x2d7eae+'/'+_0x371ebc)[_0x3527('0x1b')](_0x33cb98);}return null;};}function patchUpdates(_0x3b9e25){return function(_0x4442b1){try{jsonpatch[_0x3527('0x22')](_0x4442b1,_0x3b9e25,!![]);}catch(_0x25b093){return BPromise[_0x3527('0x23')](_0x25b093);}return _0x4442b1['save']();};}function saveUpdates(_0x3f9f1d,_0xc8fb1e){return function(_0x61a5c4){if(_0x61a5c4){return _0x61a5c4[_0x3527('0x24')](_0x3f9f1d)[_0x3527('0x25')](function(_0x431547){return _0x431547;});}return null;};}function removeEntity(_0x4e5254,_0x5c3e97){return function(_0xff2463){if(_0xff2463){return _0xff2463[_0x3527('0x26')]()[_0x3527('0x25')](function(){_0x4e5254['status'](0xcc)[_0x3527('0x1a')]();});}};}function handleEntityNotFound(_0x301757,_0x567656){return function(_0x473fd2){if(!_0x473fd2){_0x301757['sendStatus'](0x194);}return _0x473fd2;};}function handleError(_0x28a32f,_0x3c3ec5){_0x3c3ec5=_0x3c3ec5||0x1f4;return function(_0x5ef188){logger[_0x3527('0x27')](_0x5ef188[_0x3527('0x28')]);if(_0x5ef188[_0x3527('0x29')]){delete _0x5ef188['name'];}_0x28a32f[_0x3527('0x19')](_0x3c3ec5)[_0x3527('0x2a')](_0x5ef188);};}exports[_0x3527('0x2b')]=function(_0x38e158,_0x5db42b){var _0x3f76ed={},_0x58d50d={},_0xfff4b8={'count':0x0,'rows':[]};var _0x335872=_[_0x3527('0x2c')](db[_0x3527('0x2d')]['rawAttributes'],function(_0x23ae11){return{'name':_0x23ae11['fieldName'],'type':_0x23ae11['type'][_0x3527('0x2e')]};});_0x58d50d['model']=_[_0x3527('0x2c')](_0x335872,_0x3527('0x29'));_0x58d50d['query']=_[_0x3527('0x2f')](_0x38e158[_0x3527('0x30')]);_0x58d50d[_0x3527('0x31')]=_[_0x3527('0x32')](_0x58d50d[_0x3527('0x33')],_0x58d50d[_0x3527('0x30')]);_0x3f76ed[_0x3527('0x34')]=_[_0x3527('0x32')](_0x58d50d[_0x3527('0x33')],qs['fields'](_0x38e158[_0x3527('0x30')][_0x3527('0x35')]));_0x3f76ed[_0x3527('0x34')]=_0x3f76ed[_0x3527('0x34')]['length']?_0x3f76ed[_0x3527('0x34')]:_0x58d50d[_0x3527('0x33')];if(!_0x38e158[_0x3527('0x30')][_0x3527('0x36')](_0x3527('0x37'))){_0x3f76ed['limit']=qs[_0x3527('0x1e')](_0x38e158[_0x3527('0x30')][_0x3527('0x1e')]);_0x3f76ed[_0x3527('0x1c')]=qs[_0x3527('0x1c')](_0x38e158[_0x3527('0x30')][_0x3527('0x1c')]);}_0x3f76ed[_0x3527('0x38')]=qs['sort'](_0x38e158['query'][_0x3527('0x39')]);_0x3f76ed[_0x3527('0x3a')]=qs[_0x3527('0x31')](_['pick'](_0x38e158[_0x3527('0x30')],_0x58d50d['filters']),_0x335872);if(_0x38e158[_0x3527('0x30')][_0x3527('0x3b')]){_0x3f76ed[_0x3527('0x3a')]=_[_0x3527('0x3c')](_0x3f76ed['where'],{'$or':_['map'](_0x335872,function(_0x56386a){if(_0x56386a[_0x3527('0x3d')]!==_0x3527('0x3e')){var _0x15ceca={};_0x15ceca[_0x56386a[_0x3527('0x29')]]={'$like':'%'+_0x38e158[_0x3527('0x30')][_0x3527('0x3b')]+'%'};return _0x15ceca;}})});}_0x3f76ed=_[_0x3527('0x3c')]({},_0x3f76ed,_0x38e158[_0x3527('0x3f')]);var _0x2c5c6b={'where':_0x3f76ed[_0x3527('0x3a')]};return db[_0x3527('0x2d')][_0x3527('0x1f')](_0x2c5c6b)[_0x3527('0x25')](function(_0x20ae1a){_0xfff4b8[_0x3527('0x1f')]=_0x20ae1a;if(_0x38e158['query'][_0x3527('0x40')]){_0x3f76ed[_0x3527('0x41')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x3527('0x42')](_0x3f76ed);})[_0x3527('0x25')](function(_0x24b0bf){_0xfff4b8[_0x3527('0x43')]=_0x24b0bf;return _0xfff4b8;})['then'](respondWithFilteredResult(_0x5db42b,_0x3f76ed))[_0x3527('0x44')](handleError(_0x5db42b,null));};exports['show']=function(_0x9279f1,_0x556686){var _0x466d0f={'raw':![],'where':{'id':_0x9279f1[_0x3527('0x45')]['id']}},_0x125f29={};_0x125f29[_0x3527('0x33')]=_[_0x3527('0x2f')](db[_0x3527('0x2d')][_0x3527('0x46')]);_0x125f29['query']=_[_0x3527('0x2f')](_0x9279f1['query']);_0x125f29[_0x3527('0x31')]=_[_0x3527('0x32')](_0x125f29[_0x3527('0x33')],_0x125f29[_0x3527('0x30')]);_0x466d0f[_0x3527('0x34')]=_[_0x3527('0x32')](_0x125f29[_0x3527('0x33')],qs[_0x3527('0x35')](_0x9279f1[_0x3527('0x30')]['fields']));_0x466d0f[_0x3527('0x34')]=_0x466d0f[_0x3527('0x34')]['length']?_0x466d0f[_0x3527('0x34')]:_0x125f29[_0x3527('0x33')];if(_0x9279f1[_0x3527('0x30')][_0x3527('0x40')]){_0x466d0f[_0x3527('0x41')]=[{'all':!![]}];}_0x466d0f=_[_0x3527('0x3c')]({},_0x466d0f,_0x9279f1['options']);return db['AnalyticFieldReport'][_0x3527('0x47')](_0x466d0f)[_0x3527('0x25')](handleEntityNotFound(_0x556686,null))['then'](respondWithResult(_0x556686,null))['catch'](handleError(_0x556686,null));};exports['create']=function(_0x542dd6,_0x47a1ff){return db[_0x3527('0x2d')][_0x3527('0x48')](_0x542dd6[_0x3527('0x49')],{})[_0x3527('0x25')](respondWithResult(_0x47a1ff,0xc9))[_0x3527('0x44')](handleError(_0x47a1ff,null));};exports['bulkCreate']=function(_0x3c74c0,_0x3b30b4){return db[_0x3527('0x2d')][_0x3527('0x4a')](_0x3c74c0[_0x3527('0x49')],{'raw':![],'individualHooks':!![]})[_0x3527('0x25')](respondWithResult(_0x3b30b4,0xc9))[_0x3527('0x44')](handleError(_0x3b30b4,null));};exports[_0x3527('0x24')]=function(_0x30ca73,_0x3a9333){if(_0x30ca73[_0x3527('0x49')]['id']){delete _0x30ca73[_0x3527('0x49')]['id'];}return db[_0x3527('0x2d')]['find']({'where':{'id':_0x30ca73[_0x3527('0x45')]['id']}})['then'](handleEntityNotFound(_0x3a9333,null))[_0x3527('0x25')](saveUpdates(_0x30ca73[_0x3527('0x49')],null))[_0x3527('0x25')](respondWithResult(_0x3a9333,null))[_0x3527('0x44')](handleError(_0x3a9333,null));};exports[_0x3527('0x26')]=function(_0x2e01b8,_0x21e8ab){return db[_0x3527('0x2d')]['find']({'where':{'id':_0x2e01b8['params']['id']}})[_0x3527('0x25')](handleEntityNotFound(_0x21e8ab,null))[_0x3527('0x25')](removeEntity(_0x21e8ab,null))[_0x3527('0x44')](handleError(_0x21e8ab,null));};exports['bulkDestroy']=function(_0x1e54d1,_0x134a8f){return db[_0x3527('0x2d')]['destroy']({'where':{'id':_0x1e54d1[_0x3527('0x30')][_0x3527('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x3527('0x25')](respondWithResult(_0x134a8f,0xcc))[_0x3527('0x44')](handleError(_0x134a8f,null));};exports[_0x3527('0x4c')]=function(_0x35ba80,_0x999281,_0x5e3c15){return db[_0x3527('0x4d')][_0x3527('0x4e')]({'where':{'id':_0x35ba80['params']['id']}})[_0x3527('0x25')](handleEntityNotFound(_0x999281,null))[_0x3527('0x25')](function(_0x333483){if(_0x333483){return db[_0x3527('0x4f')][_0x3527('0x50')](function(_0x4f9d0c){return db[_0x3527('0x2d')][_0x3527('0x26')]({'where':{'CustomReportId':_0x35ba80[_0x3527('0x45')]['id']},'transaction':_0x4f9d0c})[_0x3527('0x25')](function(_0x141bad){var _0x19524c=_[_0x3527('0x2c')](_0x35ba80[_0x3527('0x49')],function(_0x1e44fb){delete _0x1e44fb['id'];_0x1e44fb[_0x3527('0x51')]=_0x35ba80[_0x3527('0x45')]['id'];return _0x1e44fb;});return db['AnalyticFieldReport'][_0x3527('0x4a')](_0x19524c,{'transaction':_0x4f9d0c});});})[_0x3527('0x25')](function(){return db[_0x3527('0x2d')][_0x3527('0x42')]({'where':{'CustomReportId':_0x35ba80[_0x3527('0x45')]['id']}});});}})[_0x3527('0x25')](respondWithResult(_0x999281,null))[_0x3527('0x44')](handleError(_0x999281,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 05dc7f6..e1a6190 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 _0x713a=['./analyticFieldReport.attributes','exports','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x77b5b6,_0x4e2d14){var _0x5b0639=function(_0x511228){while(--_0x511228){_0x77b5b6['push'](_0x77b5b6['shift']());}};_0x5b0639(++_0x4e2d14);}(_0x713a,0x16a));var _0xa713=function(_0x292e5e,_0x3cdb3f){_0x292e5e=_0x292e5e-0x0;var _0x41789d=_0x713a[_0x292e5e];return _0x41789d;};'use strict';var _=require(_0xa713('0x0'));var util=require(_0xa713('0x1'));var logger=require(_0xa713('0x2'))('api');var moment=require(_0xa713('0x3'));var BPromise=require('bluebird');var rp=require(_0xa713('0x4'));var fs=require('fs');var path=require(_0xa713('0x5'));var rimraf=require('rimraf');var config=require(_0xa713('0x6'));var attributes=require(_0xa713('0x7'));module[_0xa713('0x8')]=function(_0x50388d,_0x1d2dc1){return _0x50388d['define']('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x10d6=['api','moment','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields','lodash','util','../../config/logger'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x10d6,0x169));var _0x610d=function(_0x11044b,_0x163ae9){_0x11044b=_0x11044b-0x0;var _0x5ee5b9=_0x10d6[_0x11044b];return _0x5ee5b9;};'use strict';var _=require(_0x610d('0x0'));var util=require(_0x610d('0x1'));var logger=require(_0x610d('0x2'))(_0x610d('0x3'));var moment=require(_0x610d('0x4'));var BPromise=require('bluebird');var rp=require(_0x610d('0x5'));var fs=require('fs');var path=require(_0x610d('0x6'));var rimraf=require(_0x610d('0x7'));var config=require(_0x610d('0x8'));var attributes=require(_0x610d('0x9'));module[_0x610d('0xa')]=function(_0x1946d2,_0x3cae49){return _0x1946d2[_0x610d('0xb')]('AnalyticFieldReport',attributes,{'tableName':_0x610d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index fe87228..5522b1b 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 _0x3a38=['client','then','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x3813c7,_0xfe27fc){var _0x2f2e9b=function(_0x1cd726){while(--_0x1cd726){_0x3813c7['push'](_0x3813c7['shift']());}};_0x2f2e9b(++_0xfe27fc);}(_0x3a38,0x70));var _0x83a3=function(_0x2938e1,_0xe8ecce){_0x2938e1=_0x2938e1-0x0;var _0x43f689=_0x3a38[_0x2938e1];return _0x43f689;};'use strict';var _=require(_0x83a3('0x0'));var util=require(_0x83a3('0x1'));var moment=require(_0x83a3('0x2'));var BPromise=require('bluebird');var rs=require(_0x83a3('0x3'));var fs=require('fs');var Redis=require(_0x83a3('0x4'));var db=require(_0x83a3('0x5'))['db'];var utils=require(_0x83a3('0x6'));var logger=require('../../config/logger')(_0x83a3('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x83a3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20228d,_0x3f38eb,_0x1da84a){return new BPromise(function(_0x48c51d,_0x38ede9){return client['request'](_0x20228d,_0x1da84a)[_0x83a3('0x9')](function(_0x480fcb){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x3f38eb,_0x83a3('0xa'));logger['debug'](_0x83a3('0xb'),_0x3f38eb,_0x83a3('0xa'),JSON[_0x83a3('0xc')](_0x480fcb));if(_0x480fcb[_0x83a3('0xd')]){if(_0x480fcb[_0x83a3('0xd')][_0x83a3('0xe')]===0x1f4){logger[_0x83a3('0xd')](_0x83a3('0xf'),_0x3f38eb,_0x480fcb[_0x83a3('0xd')][_0x83a3('0x10')]);return _0x38ede9(_0x480fcb[_0x83a3('0xd')]['message']);}logger[_0x83a3('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3f38eb,_0x480fcb[_0x83a3('0xd')][_0x83a3('0x10')]);return _0x48c51d(_0x480fcb[_0x83a3('0xd')][_0x83a3('0x10')]);}else{logger[_0x83a3('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3f38eb,_0x83a3('0xa'));_0x48c51d(_0x480fcb[_0x83a3('0x12')][_0x83a3('0x10')]);}})[_0x83a3('0x13')](function(_0x105c61){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x3f38eb,_0x105c61);_0x38ede9(_0x105c61);});});}
\ No newline at end of file
+var _0x77e0=['request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http'];(function(_0x522d87,_0x2fc2d8){var _0x562d3e=function(_0xc0d4b9){while(--_0xc0d4b9){_0x522d87['push'](_0x522d87['shift']());}};_0x562d3e(++_0x2fc2d8);}(_0x77e0,0x90));var _0x077e=function(_0x31165e,_0x1cdcc7){_0x31165e=_0x31165e-0x0;var _0x94538f=_0x77e0[_0x31165e];return _0x94538f;};'use strict';var _=require(_0x077e('0x0'));var util=require('util');var moment=require(_0x077e('0x1'));var BPromise=require(_0x077e('0x2'));var rs=require(_0x077e('0x3'));var fs=require('fs');var Redis=require(_0x077e('0x4'));var db=require(_0x077e('0x5'))['db'];var utils=require(_0x077e('0x6'));var logger=require('../../config/logger')(_0x077e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x077e('0x8')][_0x077e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e156e,_0x3cc5a3,_0x4087a7){return new BPromise(function(_0x5e6937,_0x2798a8){return client[_0x077e('0xa')](_0x3e156e,_0x4087a7)[_0x077e('0xb')](function(_0x464129){logger[_0x077e('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3cc5a3,_0x077e('0xd'));logger[_0x077e('0xe')](_0x077e('0xf'),_0x3cc5a3,_0x077e('0xd'),JSON[_0x077e('0x10')](_0x464129));if(_0x464129[_0x077e('0x11')]){if(_0x464129[_0x077e('0x11')][_0x077e('0x12')]===0x1f4){logger[_0x077e('0x11')](_0x077e('0x13'),_0x3cc5a3,_0x464129['error']['message']);return _0x2798a8(_0x464129[_0x077e('0x11')][_0x077e('0x14')]);}logger['error'](_0x077e('0x13'),_0x3cc5a3,_0x464129[_0x077e('0x11')][_0x077e('0x14')]);return _0x5e6937(_0x464129[_0x077e('0x11')]['message']);}else{logger[_0x077e('0xc')](_0x077e('0x13'),_0x3cc5a3,_0x077e('0xd'));_0x5e6937(_0x464129[_0x077e('0x15')][_0x077e('0x14')]);}})['catch'](function(_0x13b6a5){logger[_0x077e('0x11')](_0x077e('0x13'),_0x3cc5a3,_0x13b6a5);_0x2798a8(_0x13b6a5);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 22749c4..0ef1564 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(_0x21d9e4,_0x469a1a){var _0x4e2e02=function(_0x3a5404){while(--_0x3a5404){_0x21d9e4['push'](_0x21d9e4['shift']());}};_0x4e2e02(++_0x469a1a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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(_0x3834c3,_0x36d467){var _0x2601fc=function(_0x232026){while(--_0x232026){_0x3834c3['push'](_0x3834c3['shift']());}};_0x2601fc(++_0x36d467);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js
index dd7d99f..fe36b04 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 _0xddb8=['STRING','name','TEXT','exports'];(function(_0x705343,_0x31631d){var _0x7296f0=function(_0x546dec){while(--_0x546dec){_0x705343['push'](_0x705343['shift']());}};_0x7296f0(++_0x31631d);}(_0xddb8,0xd7));var _0x8ddb=function(_0x3bbb0a,_0x30e275){_0x3bbb0a=_0x3bbb0a-0x0;var _0x17811e=_0xddb8[_0x3bbb0a];return _0x17811e;};'use strict';var Sequelize=require('sequelize');module[_0x8ddb('0x0')]={'name':{'type':Sequelize[_0x8ddb('0x1')],'allowNull':![],'unique':_0x8ddb('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x8ddb('0x3')]},'description':{'type':Sequelize[_0x8ddb('0x1')]}};
\ No newline at end of file
+var _0x0caf=['name','STRING','TEXT'];(function(_0x16fa96,_0x191e9f){var _0x4e52d3=function(_0x4200a8){while(--_0x4200a8){_0x16fa96['push'](_0x16fa96['shift']());}};_0x4e52d3(++_0x191e9f);}(_0x0caf,0x9f));var _0xf0ca=function(_0x5dd622,_0x125c1a){_0x5dd622=_0x5dd622-0x0;var _0x4f78b0=_0x0caf[_0x5dd622];return _0x4f78b0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf0ca('0x0')},'table':{'type':Sequelize[_0xf0ca('0x1')]},'metric':{'type':Sequelize[_0xf0ca('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index b0be429..715bac6 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 _0x7da7=['model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','merge','options','where','AnalyticMetric','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','json','apply','reject','update','then','destroy','get','Metrics','UserProfileResource','end','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x7da7,0x10d));var _0x77da=function(_0x58ae8a,_0x3c619e){_0x58ae8a=_0x58ae8a-0x0;var _0x2f0b6b=_0x7da7[_0x58ae8a];return _0x2f0b6b;};'use strict';var emlformat=require(_0x77da('0x0'));var rimraf=require(_0x77da('0x1'));var zipdir=require(_0x77da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x77da('0x3'));var BPromise=require(_0x77da('0x4'));var Mustache=require('mustache');var util=require(_0x77da('0x5'));var path=require(_0x77da('0x6'));var sox=require('sox');var csv=require(_0x77da('0x7'));var ejs=require(_0x77da('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x7'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var Redis=require(_0x77da('0xe'));var authService=require(_0x77da('0xf'));var qs=require(_0x77da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77da('0x11'));var logger=require(_0x77da('0x12'))(_0x77da('0x13'));var utils=require(_0x77da('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x77da('0x15'));var db=require(_0x77da('0x16'))['db'];function respondWithStatusCode(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xcc;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0x17')](_0x5d6e2f);}return _0x2acc65[_0x77da('0x18')](_0x5d6e2f)['end']();};}function respondWithResult(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0xc8;return function(_0x355719){if(_0x355719){return _0x3b0ff2[_0x77da('0x18')](_0x369df0)['json'](_0x355719);}};}function respondWithFilteredResult(_0x2172d0,_0x4e130c){return function(_0x29cd7b){if(_0x29cd7b){var _0x366443=typeof _0x4e130c[_0x77da('0x19')]===_0x77da('0x1a')&&typeof _0x4e130c['limit']==='undefined';var _0x514016=_0x29cd7b['count'];var _0x103e46=_0x366443?0x0:_0x4e130c[_0x77da('0x19')];var _0x289887=_0x366443?_0x29cd7b[_0x77da('0x1b')]:_0x4e130c[_0x77da('0x19')]+_0x4e130c[_0x77da('0x1c')];var _0x1d325c;if(_0x289887>=_0x514016){_0x289887=_0x514016;_0x1d325c=0xc8;}else{_0x1d325c=0xce;}_0x2172d0[_0x77da('0x18')](_0x1d325c);return _0x2172d0['set']('Content-Range',_0x103e46+'-'+_0x289887+'/'+_0x514016)[_0x77da('0x1d')](_0x29cd7b);}return null;};}function patchUpdates(_0x4d1512){return function(_0x507979){try{jsonpatch[_0x77da('0x1e')](_0x507979,_0x4d1512,!![]);}catch(_0x304a2b){return BPromise[_0x77da('0x1f')](_0x304a2b);}return _0x507979['save']();};}function saveUpdates(_0x58270c,_0x3e6cfe){return function(_0x58f6c1){if(_0x58f6c1){return _0x58f6c1[_0x77da('0x20')](_0x58270c)[_0x77da('0x21')](function(_0xc52f0e){return _0xc52f0e;});}return null;};}function removeEntity(_0x27b6c7,_0x10399a){return function(_0x270318){if(_0x270318){return _0x270318[_0x77da('0x22')]()['then'](function(){var _0x4885ec=_0x270318[_0x77da('0x23')]({'plain':!![]});var _0x2d009f=_0x77da('0x24');return db[_0x77da('0x25')]['destroy']({'where':{'type':_0x2d009f,'resourceId':_0x4885ec['id']}})[_0x77da('0x21')](function(){return _0x270318;});})[_0x77da('0x21')](function(){_0x27b6c7[_0x77da('0x18')](0xcc)[_0x77da('0x26')]();});}};}function handleEntityNotFound(_0x446ae7,_0x5997b6){return function(_0xce24b8){if(!_0xce24b8){_0x446ae7[_0x77da('0x17')](0x194);}return _0xce24b8;};}function handleError(_0x1f2279,_0x2913f7){_0x2913f7=_0x2913f7||0x1f4;return function(_0x496ecd){logger['error'](_0x496ecd['stack']);if(_0x496ecd[_0x77da('0x27')]){delete _0x496ecd[_0x77da('0x27')];}_0x1f2279[_0x77da('0x18')](_0x2913f7)[_0x77da('0x28')](_0x496ecd);};}exports[_0x77da('0x29')]=function(_0x4eeb99,_0x350b4e){var _0x26f5a0={},_0x356bfb={},_0x1d381b={'count':0x0,'rows':[]};var _0x1e7853=_[_0x77da('0x2a')](db['AnalyticMetric'][_0x77da('0x2b')],function(_0x228851){return{'name':_0x228851[_0x77da('0x2c')],'type':_0x228851[_0x77da('0x2d')][_0x77da('0x2e')]};});_0x356bfb[_0x77da('0x2f')]=_[_0x77da('0x2a')](_0x1e7853,_0x77da('0x27'));_0x356bfb['query']=_['keys'](_0x4eeb99[_0x77da('0x30')]);_0x356bfb[_0x77da('0x31')]=_['intersection'](_0x356bfb[_0x77da('0x2f')],_0x356bfb[_0x77da('0x30')]);_0x26f5a0[_0x77da('0x32')]=_[_0x77da('0x33')](_0x356bfb[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x4eeb99[_0x77da('0x30')]['fields']));_0x26f5a0[_0x77da('0x32')]=_0x26f5a0['attributes']['length']?_0x26f5a0['attributes']:_0x356bfb[_0x77da('0x2f')];if(!_0x4eeb99['query'][_0x77da('0x35')](_0x77da('0x36'))){_0x26f5a0[_0x77da('0x1c')]=qs[_0x77da('0x1c')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x1c')]);_0x26f5a0[_0x77da('0x19')]=qs['offset'](_0x4eeb99[_0x77da('0x30')][_0x77da('0x19')]);}_0x26f5a0[_0x77da('0x37')]=qs[_0x77da('0x38')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x38')]);_0x26f5a0['where']=qs[_0x77da('0x31')](_[_0x77da('0x39')](_0x4eeb99[_0x77da('0x30')],_0x356bfb['filters']),_0x1e7853);if(_0x4eeb99[_0x77da('0x30')]['filter']){_0x26f5a0['where']=_['merge'](_0x26f5a0['where'],{'$or':_[_0x77da('0x2a')](_0x1e7853,function(_0x1adba5){if(_0x1adba5[_0x77da('0x2d')]!=='VIRTUAL'){var _0x21d337={};_0x21d337[_0x1adba5['name']]={'$like':'%'+_0x4eeb99[_0x77da('0x30')]['filter']+'%'};return _0x21d337;}})});}_0x26f5a0=_[_0x77da('0x3a')]({},_0x26f5a0,_0x4eeb99[_0x77da('0x3b')]);var _0x290667={'where':_0x26f5a0[_0x77da('0x3c')]};return db[_0x77da('0x3d')]['count'](_0x290667)[_0x77da('0x21')](function(_0x1f48bd){_0x1d381b[_0x77da('0x1b')]=_0x1f48bd;if(_0x4eeb99[_0x77da('0x30')][_0x77da('0x3e')]){_0x26f5a0[_0x77da('0x3f')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x77da('0x40')](_0x26f5a0);})[_0x77da('0x21')](function(_0x21de41){_0x1d381b[_0x77da('0x41')]=_0x21de41;return _0x1d381b;})[_0x77da('0x21')](respondWithFilteredResult(_0x350b4e,_0x26f5a0))[_0x77da('0x42')](handleError(_0x350b4e,null));};exports['show']=function(_0x10957b,_0x5abcd9){var _0x1ae806={'raw':!![],'where':{'id':_0x10957b[_0x77da('0x43')]['id']}},_0x373fb2={};_0x373fb2['model']=_[_0x77da('0x44')](db[_0x77da('0x3d')][_0x77da('0x2b')]);_0x373fb2[_0x77da('0x30')]=_[_0x77da('0x44')](_0x10957b[_0x77da('0x30')]);_0x373fb2[_0x77da('0x31')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],_0x373fb2['query']);_0x1ae806[_0x77da('0x32')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x10957b[_0x77da('0x30')][_0x77da('0x34')]));_0x1ae806['attributes']=_0x1ae806['attributes'][_0x77da('0x45')]?_0x1ae806[_0x77da('0x32')]:_0x373fb2[_0x77da('0x2f')];if(_0x10957b[_0x77da('0x30')][_0x77da('0x3e')]){_0x1ae806[_0x77da('0x3f')]=[{'all':!![]}];}_0x1ae806=_['merge']({},_0x1ae806,_0x10957b[_0x77da('0x3b')]);return db[_0x77da('0x3d')][_0x77da('0x46')](_0x1ae806)[_0x77da('0x21')](handleEntityNotFound(_0x5abcd9,null))['then'](respondWithResult(_0x5abcd9,null))[_0x77da('0x42')](handleError(_0x5abcd9,null));};exports['create']=function(_0x518fd5,_0x36263b){return db[_0x77da('0x3d')][_0x77da('0x47')](_0x518fd5[_0x77da('0x48')],{})['then'](function(_0x16bf4b){var _0x1e36ee=_0x518fd5['user'][_0x77da('0x23')]({'plain':!![]});if(!_0x1e36ee)throw new Error(_0x77da('0x49'));if(_0x1e36ee['role']===_0x77da('0x4a')){var _0x3aaf5b=_0x16bf4b[_0x77da('0x23')]({'plain':!![]});var _0xef2496=_0x77da('0x24');return db[_0x77da('0x4b')][_0x77da('0x46')]({'where':{'name':_0xef2496,'userProfileId':_0x1e36ee[_0x77da('0x4c')]},'raw':!![]})[_0x77da('0x21')](function(_0x3a34a8){if(_0x3a34a8&&_0x3a34a8['autoAssociation']===0x0){return db[_0x77da('0x25')]['create']({'name':_0x3aaf5b[_0x77da('0x27')],'resourceId':_0x3aaf5b['id'],'type':_0x3a34a8[_0x77da('0x27')],'sectionId':_0x3a34a8['id']},{})[_0x77da('0x21')](function(){return _0x16bf4b;});}else{return _0x16bf4b;}})[_0x77da('0x42')](function(_0x374179){logger[_0x77da('0x4d')](_0x77da('0x4e'),_0x374179);throw _0x374179;});}return _0x16bf4b;})['then'](respondWithResult(_0x36263b,0xc9))[_0x77da('0x42')](handleError(_0x36263b,null));};exports[_0x77da('0x20')]=function(_0x1a7115,_0x353be9){if(_0x1a7115['body']['id']){delete _0x1a7115[_0x77da('0x48')]['id'];}return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x1a7115['params']['id']}})['then'](handleEntityNotFound(_0x353be9,null))[_0x77da('0x21')](saveUpdates(_0x1a7115[_0x77da('0x48')],null))[_0x77da('0x21')](respondWithResult(_0x353be9,null))[_0x77da('0x42')](handleError(_0x353be9,null));};exports[_0x77da('0x22')]=function(_0x528a32,_0x50437b){return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x528a32['params']['id']}})[_0x77da('0x21')](handleEntityNotFound(_0x50437b,null))[_0x77da('0x21')](removeEntity(_0x50437b,null))[_0x77da('0x42')](handleError(_0x50437b,null));};
\ No newline at end of file
+var _0xa41a=['attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Metrics','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','save','update','destroy','then','error','stack','name','send','map','AnalyticMetric','type','key','model','query','keys','intersection','fields'];(function(_0x25dc73,_0x18185f){var _0x46145c=function(_0x47722d){while(--_0x47722d){_0x25dc73['push'](_0x25dc73['shift']());}};_0x46145c(++_0x18185f);}(_0xa41a,0x6b));var _0xaa41=function(_0x1b414e,_0x251964){_0x1b414e=_0x1b414e-0x0;var _0x362973=_0xa41a[_0x1b414e];return _0x362973;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d0a54,_0x518b5b){_0x518b5b=_0x518b5b||0xcc;return function(_0x19bd69){if(_0x19bd69){return _0x1d0a54[_0xaa41('0x19')](_0x518b5b);}return _0x1d0a54[_0xaa41('0x1a')](_0x518b5b)[_0xaa41('0x1b')]();};}function respondWithResult(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0xc8;return function(_0x1e9d7f){if(_0x1e9d7f){return _0x6f9ade[_0xaa41('0x1a')](_0x4eaf81)[_0xaa41('0x1c')](_0x1e9d7f);}};}function respondWithFilteredResult(_0x1ef7d9,_0x2a6988){return function(_0x2005ae){if(_0x2005ae){var _0x1e1e02=typeof _0x2a6988['offset']===_0xaa41('0x1d')&&typeof _0x2a6988[_0xaa41('0x1e')]===_0xaa41('0x1d');var _0x391b01=_0x2005ae[_0xaa41('0x1f')];var _0xd20ddf=_0x1e1e02?0x0:_0x2a6988[_0xaa41('0x20')];var _0x46e6d3=_0x1e1e02?_0x2005ae[_0xaa41('0x1f')]:_0x2a6988['offset']+_0x2a6988['limit'];var _0x1f502a;if(_0x46e6d3>=_0x391b01){_0x46e6d3=_0x391b01;_0x1f502a=0xc8;}else{_0x1f502a=0xce;}_0x1ef7d9[_0xaa41('0x1a')](_0x1f502a);return _0x1ef7d9[_0xaa41('0x21')]('Content-Range',_0xd20ddf+'-'+_0x46e6d3+'/'+_0x391b01)[_0xaa41('0x1c')](_0x2005ae);}return null;};}function patchUpdates(_0x1f692b){return function(_0x4e768e){try{jsonpatch['apply'](_0x4e768e,_0x1f692b,!![]);}catch(_0x1b1910){return BPromise['reject'](_0x1b1910);}return _0x4e768e[_0xaa41('0x22')]();};}function saveUpdates(_0x209c83,_0x3e2175){return function(_0x1f27f3){if(_0x1f27f3){return _0x1f27f3[_0xaa41('0x23')](_0x209c83)['then'](function(_0x43c430){return _0x43c430;});}return null;};}function removeEntity(_0x43a85c,_0x448a21){return function(_0x21f596){if(_0x21f596){return _0x21f596[_0xaa41('0x24')]()[_0xaa41('0x25')](function(){var _0x5c3074=_0x21f596['get']({'plain':!![]});var _0x16aec5='Metrics';return db['UserProfileResource'][_0xaa41('0x24')]({'where':{'type':_0x16aec5,'resourceId':_0x5c3074['id']}})['then'](function(){return _0x21f596;});})['then'](function(){_0x43a85c[_0xaa41('0x1a')](0xcc)[_0xaa41('0x1b')]();});}};}function handleEntityNotFound(_0x392214,_0x632fd2){return function(_0x3f5272){if(!_0x3f5272){_0x392214[_0xaa41('0x19')](0x194);}return _0x3f5272;};}function handleError(_0x57ef96,_0x30a174){_0x30a174=_0x30a174||0x1f4;return function(_0x1f0275){logger[_0xaa41('0x26')](_0x1f0275[_0xaa41('0x27')]);if(_0x1f0275[_0xaa41('0x28')]){delete _0x1f0275[_0xaa41('0x28')];}_0x57ef96[_0xaa41('0x1a')](_0x30a174)[_0xaa41('0x29')](_0x1f0275);};}exports['index']=function(_0x377add,_0x48b48b){var _0x5dad80={},_0x714537={},_0x1176bd={'count':0x0,'rows':[]};var _0x534a85=_[_0xaa41('0x2a')](db[_0xaa41('0x2b')]['rawAttributes'],function(_0x5022fb){return{'name':_0x5022fb['fieldName'],'type':_0x5022fb[_0xaa41('0x2c')][_0xaa41('0x2d')]};});_0x714537[_0xaa41('0x2e')]=_[_0xaa41('0x2a')](_0x534a85,'name');_0x714537[_0xaa41('0x2f')]=_[_0xaa41('0x30')](_0x377add[_0xaa41('0x2f')]);_0x714537['filters']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],_0x714537[_0xaa41('0x2f')]);_0x5dad80['attributes']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],qs['fields'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x5dad80[_0xaa41('0x33')]=_0x5dad80['attributes'][_0xaa41('0x34')]?_0x5dad80['attributes']:_0x714537[_0xaa41('0x2e')];if(!_0x377add[_0xaa41('0x2f')][_0xaa41('0x35')]('nolimit')){_0x5dad80['limit']=qs['limit'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x1e')]);_0x5dad80[_0xaa41('0x20')]=qs[_0xaa41('0x20')](_0x377add['query']['offset']);}_0x5dad80[_0xaa41('0x36')]=qs[_0xaa41('0x37')](_0x377add[_0xaa41('0x2f')][_0xaa41('0x37')]);_0x5dad80[_0xaa41('0x38')]=qs[_0xaa41('0x39')](_[_0xaa41('0x3a')](_0x377add['query'],_0x714537[_0xaa41('0x39')]),_0x534a85);if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]){_0x5dad80[_0xaa41('0x38')]=_['merge'](_0x5dad80['where'],{'$or':_[_0xaa41('0x2a')](_0x534a85,function(_0x275fa3){if(_0x275fa3['type']!==_0xaa41('0x3c')){var _0x563687={};_0x563687[_0x275fa3[_0xaa41('0x28')]]={'$like':'%'+_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]+'%'};return _0x563687;}})});}_0x5dad80=_[_0xaa41('0x3d')]({},_0x5dad80,_0x377add[_0xaa41('0x3e')]);var _0x12ba1a={'where':_0x5dad80[_0xaa41('0x38')]};return db[_0xaa41('0x2b')]['count'](_0x12ba1a)[_0xaa41('0x25')](function(_0x2abf39){_0x1176bd[_0xaa41('0x1f')]=_0x2abf39;if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x5dad80[_0xaa41('0x40')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5dad80);})[_0xaa41('0x25')](function(_0x4f9086){_0x1176bd[_0xaa41('0x41')]=_0x4f9086;return _0x1176bd;})[_0xaa41('0x25')](respondWithFilteredResult(_0x48b48b,_0x5dad80))[_0xaa41('0x42')](handleError(_0x48b48b,null));};exports[_0xaa41('0x43')]=function(_0x2aac10,_0x10bf09){var _0x2db8d6={'raw':!![],'where':{'id':_0x2aac10[_0xaa41('0x44')]['id']}},_0x5ee74c={};_0x5ee74c['model']=_['keys'](db[_0xaa41('0x2b')]['rawAttributes']);_0x5ee74c['query']=_['keys'](_0x2aac10[_0xaa41('0x2f')]);_0x5ee74c['filters']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],_0x5ee74c['query']);_0x2db8d6['attributes']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],qs[_0xaa41('0x32')](_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x2db8d6[_0xaa41('0x33')]=_0x2db8d6[_0xaa41('0x33')][_0xaa41('0x34')]?_0x2db8d6[_0xaa41('0x33')]:_0x5ee74c['model'];if(_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x2db8d6[_0xaa41('0x40')]=[{'all':!![]}];}_0x2db8d6=_[_0xaa41('0x3d')]({},_0x2db8d6,_0x2aac10[_0xaa41('0x3e')]);return db[_0xaa41('0x2b')]['find'](_0x2db8d6)[_0xaa41('0x25')](handleEntityNotFound(_0x10bf09,null))[_0xaa41('0x25')](respondWithResult(_0x10bf09,null))[_0xaa41('0x42')](handleError(_0x10bf09,null));};exports[_0xaa41('0x45')]=function(_0x57d1f6,_0x23bc61){return db['AnalyticMetric']['create'](_0x57d1f6[_0xaa41('0x46')],{})[_0xaa41('0x25')](function(_0x3e16ef){var _0x4ca114=_0x57d1f6[_0xaa41('0x47')][_0xaa41('0x48')]({'plain':!![]});if(!_0x4ca114)throw new Error(_0xaa41('0x49'));if(_0x4ca114['role']===_0xaa41('0x47')){var _0x3c4f24=_0x3e16ef[_0xaa41('0x48')]({'plain':!![]});var _0x1378f9=_0xaa41('0x4a');return db[_0xaa41('0x4b')][_0xaa41('0x4c')]({'where':{'name':_0x1378f9,'userProfileId':_0x4ca114[_0xaa41('0x4d')]},'raw':!![]})['then'](function(_0x9f0a81){if(_0x9f0a81&&_0x9f0a81['autoAssociation']===0x0){return db['UserProfileResource'][_0xaa41('0x45')]({'name':_0x3c4f24[_0xaa41('0x28')],'resourceId':_0x3c4f24['id'],'type':_0x9f0a81[_0xaa41('0x28')],'sectionId':_0x9f0a81['id']},{})[_0xaa41('0x25')](function(){return _0x3e16ef;});}else{return _0x3e16ef;}})[_0xaa41('0x42')](function(_0x288db3){logger[_0xaa41('0x26')](_0xaa41('0x4e'),_0x288db3);throw _0x288db3;});}return _0x3e16ef;})['then'](respondWithResult(_0x23bc61,0xc9))[_0xaa41('0x42')](handleError(_0x23bc61,null));};exports[_0xaa41('0x23')]=function(_0x1d518f,_0x4f9e92){if(_0x1d518f[_0xaa41('0x46')]['id']){delete _0x1d518f[_0xaa41('0x46')]['id'];}return db['AnalyticMetric'][_0xaa41('0x4c')]({'where':{'id':_0x1d518f[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x4f9e92,null))['then'](saveUpdates(_0x1d518f[_0xaa41('0x46')],null))[_0xaa41('0x25')](respondWithResult(_0x4f9e92,null))['catch'](handleError(_0x4f9e92,null));};exports['destroy']=function(_0x3745ed,_0x3cd14f){return db[_0xaa41('0x2b')]['find']({'where':{'id':_0x3745ed[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x3cd14f,null))[_0xaa41('0x25')](removeEntity(_0x3cd14f,null))[_0xaa41('0x42')](handleError(_0x3cd14f,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 12bb246..22dcb22 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 _0x13f5=['define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./analyticMetric.attributes','exports'];(function(_0x903228,_0x42c429){var _0xcec81d=function(_0x4da97a){while(--_0x4da97a){_0x903228['push'](_0x903228['shift']());}};_0xcec81d(++_0x42c429);}(_0x13f5,0xc3));var _0x513f=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x13f5[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x513f('0x0'));var util=require(_0x513f('0x1'));var logger=require(_0x513f('0x2'))(_0x513f('0x3'));var moment=require('moment');var BPromise=require(_0x513f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x513f('0x5'));var config=require(_0x513f('0x6'));var attributes=require(_0x513f('0x7'));module[_0x513f('0x8')]=function(_0x8d019b,_0x579681){return _0x8d019b[_0x513f('0x9')](_0x513f('0xa'),attributes,{'tableName':_0x513f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4453=['lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x24210f,_0x3510de){var _0x37b6db=function(_0x53a3ba){while(--_0x53a3ba){_0x24210f['push'](_0x24210f['shift']());}};_0x37b6db(++_0x3510de);}(_0x4453,0x9c));var _0x3445=function(_0x39e376,_0x433bb4){_0x39e376=_0x39e376-0x0;var _0x580e9f=_0x4453[_0x39e376];return _0x580e9f;};'use strict';var _=require(_0x3445('0x0'));var util=require(_0x3445('0x1'));var logger=require('../../config/logger')(_0x3445('0x2'));var moment=require(_0x3445('0x3'));var BPromise=require('bluebird');var rp=require(_0x3445('0x4'));var fs=require('fs');var path=require(_0x3445('0x5'));var rimraf=require(_0x3445('0x6'));var config=require(_0x3445('0x7'));var attributes=require(_0x3445('0x8'));module[_0x3445('0x9')]=function(_0x43214d,_0x1bd1dc){return _0x43214d[_0x3445('0xa')](_0x3445('0xb'),attributes,{'tableName':'analytics_metrics','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 49ef3aa..f23b65f 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 _0x0d72=['then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x5be7b4,_0x8a0eb4){var _0x2e9c49=function(_0x615552){while(--_0x615552){_0x5be7b4['push'](_0x5be7b4['shift']());}};_0x2e9c49(++_0x8a0eb4);}(_0x0d72,0xc3));var _0x20d7=function(_0x41d5b4,_0x449f98){_0x41d5b4=_0x41d5b4-0x0;var _0x56a933=_0x0d72[_0x41d5b4];return _0x56a933;};'use strict';var _=require(_0x20d7('0x0'));var util=require(_0x20d7('0x1'));var moment=require(_0x20d7('0x2'));var BPromise=require(_0x20d7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x20d7('0x4'));var db=require(_0x20d7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x20d7('0x6'))(_0x20d7('0x7'));var config=require(_0x20d7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x20d7('0x9')][_0x20d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x436807,_0x3e71a7,_0x20034d){return new BPromise(function(_0x43b36a,_0x2f571c){return client[_0x20d7('0xb')](_0x436807,_0x20034d)[_0x20d7('0xc')](function(_0x241b64){logger[_0x20d7('0xd')](_0x20d7('0xe'),_0x3e71a7,'request\x20sent');logger[_0x20d7('0xf')](_0x20d7('0x10'),_0x3e71a7,_0x20d7('0x11'),JSON[_0x20d7('0x12')](_0x241b64));if(_0x241b64['error']){if(_0x241b64[_0x20d7('0x13')][_0x20d7('0x14')]===0x1f4){logger[_0x20d7('0x13')](_0x20d7('0xe'),_0x3e71a7,_0x241b64[_0x20d7('0x13')][_0x20d7('0x15')]);return _0x2f571c(_0x241b64[_0x20d7('0x13')][_0x20d7('0x15')]);}logger[_0x20d7('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x3e71a7,_0x241b64[_0x20d7('0x13')][_0x20d7('0x15')]);return _0x43b36a(_0x241b64['error'][_0x20d7('0x15')]);}else{logger[_0x20d7('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x3e71a7,_0x20d7('0x11'));_0x43b36a(_0x241b64[_0x20d7('0x16')][_0x20d7('0x15')]);}})['catch'](function(_0x4ff67c){logger[_0x20d7('0x13')](_0x20d7('0xe'),_0x3e71a7,_0x4ff67c);_0x2f571c(_0x4ff67c);});});}
\ No newline at end of file
+var _0xb579=['../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1f5888,_0x4a602b){var _0x5c908e=function(_0x2c5e8b){while(--_0x2c5e8b){_0x1f5888['push'](_0x1f5888['shift']());}};_0x5c908e(++_0x4a602b);}(_0xb579,0xd7));var _0x9b57=function(_0x566ff4,_0x35b691){_0x566ff4=_0x566ff4-0x0;var _0x124c1c=_0xb579[_0x566ff4];return _0x124c1c;};'use strict';var _=require(_0x9b57('0x0'));var util=require(_0x9b57('0x1'));var moment=require(_0x9b57('0x2'));var BPromise=require(_0x9b57('0x3'));var rs=require(_0x9b57('0x4'));var fs=require('fs');var Redis=require(_0x9b57('0x5'));var db=require(_0x9b57('0x6'))['db'];var utils=require(_0x9b57('0x7'));var logger=require(_0x9b57('0x8'))(_0x9b57('0x9'));var config=require(_0x9b57('0xa'));var jayson=require(_0x9b57('0xb'));var client=jayson[_0x9b57('0xc')][_0x9b57('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x58ecee,_0x5758ca,_0x1f4ca7){return new BPromise(function(_0x3be94c,_0x4f6c06){return client[_0x9b57('0xe')](_0x58ecee,_0x1f4ca7)[_0x9b57('0xf')](function(_0x13312a){logger[_0x9b57('0x10')](_0x9b57('0x11'),_0x5758ca,'request\x20sent');logger['debug'](_0x9b57('0x12'),_0x5758ca,'request\x20sent',JSON[_0x9b57('0x13')](_0x13312a));if(_0x13312a['error']){if(_0x13312a[_0x9b57('0x14')]['code']===0x1f4){logger['error'](_0x9b57('0x11'),_0x5758ca,_0x13312a[_0x9b57('0x14')]['message']);return _0x4f6c06(_0x13312a[_0x9b57('0x14')][_0x9b57('0x15')]);}logger['error'](_0x9b57('0x11'),_0x5758ca,_0x13312a[_0x9b57('0x14')][_0x9b57('0x15')]);return _0x3be94c(_0x13312a['error'][_0x9b57('0x15')]);}else{logger[_0x9b57('0x10')](_0x9b57('0x11'),_0x5758ca,_0x9b57('0x16'));_0x3be94c(_0x13312a[_0x9b57('0x17')][_0x9b57('0x15')]);}})[_0x9b57('0x18')](function(_0x364d37){logger[_0x9b57('0x14')](_0x9b57('0x11'),_0x5758ca,_0x364d37);_0x4f6c06(_0x364d37);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index d874389..191e488 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 _0x8781=['fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3ddbc4,_0xe5be24){var _0x4f51ff=function(_0xc9119b){while(--_0xc9119b){_0x3ddbc4['push'](_0x3ddbc4['shift']());}};_0x4f51ff(++_0xe5be24);}(_0x8781,0x1c8));var _0x1878=function(_0x473d89,_0x3ca583){_0x473d89=_0x473d89-0x0;var _0x580097=_0x8781[_0x473d89];return _0x580097;};'use strict';var multer=require(_0x1878('0x0'));var util=require(_0x1878('0x1'));var path=require(_0x1878('0x2'));var timeout=require(_0x1878('0x3'));var express=require(_0x1878('0x4'));var router=express[_0x1878('0x5')]();var fs_extra=require(_0x1878('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1878('0x7'));var config=require(_0x1878('0x8'));var controller=require(_0x1878('0x9'));router[_0x1878('0xa')]('/',auth[_0x1878('0xb')](),controller[_0x1878('0xc')]);router['get'](_0x1878('0xd'),auth[_0x1878('0xb')](),controller[_0x1878('0xe')]);router[_0x1878('0xf')]('/',auth[_0x1878('0xb')](),controller[_0x1878('0x10')]);router[_0x1878('0x11')](_0x1878('0xd'),auth[_0x1878('0xb')](),controller[_0x1878('0x12')]);router[_0x1878('0x13')]('/:id',auth[_0x1878('0xb')](),controller[_0x1878('0x14')]);module[_0x1878('0x15')]=router;
\ No newline at end of file
+var _0x8ce1=['../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2eb93b,_0x37a094){var _0x5ebda2=function(_0x1a1f74){while(--_0x1a1f74){_0x2eb93b['push'](_0x2eb93b['shift']());}};_0x5ebda2(++_0x37a094);}(_0x8ce1,0x183));var _0x18ce=function(_0x4df2a0,_0x3c3945){_0x4df2a0=_0x4df2a0-0x0;var _0xaadb19=_0x8ce1[_0x4df2a0];return _0xaadb19;};'use strict';var multer=require(_0x18ce('0x0'));var util=require(_0x18ce('0x1'));var path=require(_0x18ce('0x2'));var timeout=require(_0x18ce('0x3'));var express=require(_0x18ce('0x4'));var router=express[_0x18ce('0x5')]();var fs_extra=require(_0x18ce('0x6'));var auth=require(_0x18ce('0x7'));var interaction=require(_0x18ce('0x8'));var config=require(_0x18ce('0x9'));var controller=require(_0x18ce('0xa'));router[_0x18ce('0xb')]('/',auth[_0x18ce('0xc')](),controller[_0x18ce('0xd')]);router[_0x18ce('0xb')](_0x18ce('0xe'),auth['isAuthenticated'](),controller[_0x18ce('0xf')]);router[_0x18ce('0x10')]('/',auth[_0x18ce('0xc')](),controller[_0x18ce('0x11')]);router['put'](_0x18ce('0xe'),auth[_0x18ce('0xc')](),controller[_0x18ce('0x12')]);router[_0x18ce('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x18ce('0x14')]);module[_0x18ce('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 4f07add..0269485 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 _0x3a71=['sequelize','TEXT'];(function(_0x2bbe6a,_0x9120f){var _0x49021d=function(_0x170514){while(--_0x170514){_0x2bbe6a['push'](_0x2bbe6a['shift']());}};_0x49021d(++_0x9120f);}(_0x3a71,0xea));var _0x13a7=function(_0x46ba1c,_0x53697a){_0x46ba1c=_0x46ba1c-0x0;var _0x5c1b25=_0x3a71[_0x46ba1c];return _0x5c1b25;};'use strict';var Sequelize=require(_0x13a7('0x0'));module['exports']={'tree':{'type':Sequelize[_0x13a7('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xa5ff=['TEXT'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa5ff,0x1b6));var _0xfa5f=function(_0x2f6779,_0x1456ea){_0x2f6779=_0x2f6779-0x0;var _0x21200c=_0xa5ff[_0x2f6779];return _0x21200c;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0xfa5f('0x0')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 56b38bd..a429f47 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 _0x70b9=['../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','sendStatus','stack','name','index','map','AnalyticTreeReport','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','keys','rawAttributes','includeAll','find','catch','create','body','params','destroy','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service'];(function(_0x43cdc3,_0x9ccb13){var _0x2936bd=function(_0x3a6b1b){while(--_0x3a6b1b){_0x43cdc3['push'](_0x43cdc3['shift']());}};_0x2936bd(++_0x9ccb13);}(_0x70b9,0x188));var _0x970b=function(_0x325bb8,_0xd2eb2c){_0x325bb8=_0x325bb8-0x0;var _0x4cf52f=_0x70b9[_0x325bb8];return _0x4cf52f;};'use strict';var emlformat=require(_0x970b('0x0'));var rimraf=require(_0x970b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x970b('0x2'));var rp=require(_0x970b('0x3'));var moment=require('moment');var BPromise=require(_0x970b('0x4'));var Mustache=require(_0x970b('0x5'));var util=require('util');var path=require(_0x970b('0x6'));var sox=require(_0x970b('0x7'));var csv=require(_0x970b('0x8'));var ejs=require(_0x970b('0x9'));var fs=require('fs');var fs_extra=require(_0x970b('0xa'));var _=require('lodash');var squel=require(_0x970b('0xb'));var crypto=require(_0x970b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x970b('0xd'));var toCsv=require(_0x970b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x970b('0xe'));var authService=require(_0x970b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x970b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x970b('0x11'))('api');var utils=require(_0x970b('0x12'));var config=require(_0x970b('0x13'));var licenseUtil=require(_0x970b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45a8a8,_0xa4a5b9){_0xa4a5b9=_0xa4a5b9||0xcc;return function(_0x21d96d){if(_0x21d96d){return _0x45a8a8['sendStatus'](_0xa4a5b9);}return _0x45a8a8[_0x970b('0x15')](_0xa4a5b9)[_0x970b('0x16')]();};}function respondWithResult(_0x2ba66a,_0x184ce4){_0x184ce4=_0x184ce4||0xc8;return function(_0x52a26b){if(_0x52a26b){return _0x2ba66a[_0x970b('0x15')](_0x184ce4)[_0x970b('0x17')](_0x52a26b);}};}function respondWithFilteredResult(_0x2dd1b5,_0xad5954){return function(_0x31dc69){if(_0x31dc69){var _0x3eee8e=typeof _0xad5954[_0x970b('0x18')]===_0x970b('0x19')&&typeof _0xad5954[_0x970b('0x1a')]===_0x970b('0x19');var _0x1b5592=_0x31dc69[_0x970b('0x1b')];var _0x377f28=_0x3eee8e?0x0:_0xad5954['offset'];var _0x3dcf99=_0x3eee8e?_0x31dc69['count']:_0xad5954[_0x970b('0x18')]+_0xad5954['limit'];var _0x9b550;if(_0x3dcf99>=_0x1b5592){_0x3dcf99=_0x1b5592;_0x9b550=0xc8;}else{_0x9b550=0xce;}_0x2dd1b5[_0x970b('0x15')](_0x9b550);return _0x2dd1b5['set'](_0x970b('0x1c'),_0x377f28+'-'+_0x3dcf99+'/'+_0x1b5592)[_0x970b('0x17')](_0x31dc69);}return null;};}function patchUpdates(_0x35cc68){return function(_0x1aa220){try{jsonpatch['apply'](_0x1aa220,_0x35cc68,!![]);}catch(_0x454f98){return BPromise[_0x970b('0x1d')](_0x454f98);}return _0x1aa220['save']();};}function saveUpdates(_0x4fbfb1,_0x36f536){return function(_0x418b2b){if(_0x418b2b){return _0x418b2b[_0x970b('0x1e')](_0x4fbfb1)[_0x970b('0x1f')](function(_0x658dd0){return _0x658dd0;});}return null;};}function removeEntity(_0x1e52af,_0x1fde4c){return function(_0x3dd664){if(_0x3dd664){return _0x3dd664['destroy']()[_0x970b('0x1f')](function(){_0x1e52af[_0x970b('0x15')](0xcc)[_0x970b('0x16')]();});}};}function handleEntityNotFound(_0x4bbf94,_0xcd8757){return function(_0xb136b5){if(!_0xb136b5){_0x4bbf94[_0x970b('0x20')](0x194);}return _0xb136b5;};}function handleError(_0x288643,_0x407e9a){_0x407e9a=_0x407e9a||0x1f4;return function(_0x1f0144){logger['error'](_0x1f0144[_0x970b('0x21')]);if(_0x1f0144[_0x970b('0x22')]){delete _0x1f0144['name'];}_0x288643[_0x970b('0x15')](_0x407e9a)['send'](_0x1f0144);};}exports[_0x970b('0x23')]=function(_0x379cf3,_0x1500dd){var _0xf50bf2={},_0x3a608f={},_0x25c4f8={'count':0x0,'rows':[]};var _0x1c6668=_[_0x970b('0x24')](db[_0x970b('0x25')]['rawAttributes'],function(_0x28a4c8){return{'name':_0x28a4c8['fieldName'],'type':_0x28a4c8['type'][_0x970b('0x26')]};});_0x3a608f[_0x970b('0x27')]=_['map'](_0x1c6668,_0x970b('0x22'));_0x3a608f['query']=_['keys'](_0x379cf3[_0x970b('0x28')]);_0x3a608f[_0x970b('0x29')]=_[_0x970b('0x2a')](_0x3a608f[_0x970b('0x27')],_0x3a608f['query']);_0xf50bf2[_0x970b('0x2b')]=_[_0x970b('0x2a')](_0x3a608f['model'],qs[_0x970b('0x2c')](_0x379cf3[_0x970b('0x28')]['fields']));_0xf50bf2[_0x970b('0x2b')]=_0xf50bf2[_0x970b('0x2b')]['length']?_0xf50bf2[_0x970b('0x2b')]:_0x3a608f['model'];if(!_0x379cf3[_0x970b('0x28')][_0x970b('0x2d')](_0x970b('0x2e'))){_0xf50bf2[_0x970b('0x1a')]=qs[_0x970b('0x1a')](_0x379cf3['query'][_0x970b('0x1a')]);_0xf50bf2[_0x970b('0x18')]=qs[_0x970b('0x18')](_0x379cf3[_0x970b('0x28')][_0x970b('0x18')]);}_0xf50bf2[_0x970b('0x2f')]=qs[_0x970b('0x30')](_0x379cf3[_0x970b('0x28')]['sort']);_0xf50bf2[_0x970b('0x31')]=qs[_0x970b('0x29')](_['pick'](_0x379cf3[_0x970b('0x28')],_0x3a608f[_0x970b('0x29')]),_0x1c6668);if(_0x379cf3[_0x970b('0x28')][_0x970b('0x32')]){_0xf50bf2[_0x970b('0x31')]=_[_0x970b('0x33')](_0xf50bf2[_0x970b('0x31')],{'$or':_[_0x970b('0x24')](_0x1c6668,function(_0x20ffd2){if(_0x20ffd2[_0x970b('0x34')]!==_0x970b('0x35')){var _0x3d3bcd={};_0x3d3bcd[_0x20ffd2[_0x970b('0x22')]]={'$like':'%'+_0x379cf3['query'][_0x970b('0x32')]+'%'};return _0x3d3bcd;}})});}_0xf50bf2=_['merge']({},_0xf50bf2,_0x379cf3[_0x970b('0x36')]);var _0x246480={'where':_0xf50bf2[_0x970b('0x31')]};return db['AnalyticTreeReport'][_0x970b('0x1b')](_0x246480)[_0x970b('0x1f')](function(_0x2e04ac){_0x25c4f8['count']=_0x2e04ac;if(_0x379cf3[_0x970b('0x28')]['includeAll']){_0xf50bf2[_0x970b('0x37')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x970b('0x38')](_0xf50bf2);})[_0x970b('0x1f')](function(_0x1e89ab){_0x25c4f8[_0x970b('0x39')]=_0x1e89ab;return _0x25c4f8;})[_0x970b('0x1f')](respondWithFilteredResult(_0x1500dd,_0xf50bf2))['catch'](handleError(_0x1500dd,null));};exports[_0x970b('0x3a')]=function(_0x1afffb,_0x219e6c){var _0x8e631b={'raw':!![],'where':{'id':_0x1afffb['params']['id']}},_0x17ebc9={};_0x17ebc9['model']=_[_0x970b('0x3b')](db[_0x970b('0x25')][_0x970b('0x3c')]);_0x17ebc9[_0x970b('0x28')]=_[_0x970b('0x3b')](_0x1afffb[_0x970b('0x28')]);_0x17ebc9['filters']=_[_0x970b('0x2a')](_0x17ebc9['model'],_0x17ebc9['query']);_0x8e631b['attributes']=_[_0x970b('0x2a')](_0x17ebc9['model'],qs[_0x970b('0x2c')](_0x1afffb[_0x970b('0x28')][_0x970b('0x2c')]));_0x8e631b[_0x970b('0x2b')]=_0x8e631b['attributes']['length']?_0x8e631b[_0x970b('0x2b')]:_0x17ebc9[_0x970b('0x27')];if(_0x1afffb[_0x970b('0x28')][_0x970b('0x3d')]){_0x8e631b[_0x970b('0x37')]=[{'all':!![]}];}_0x8e631b=_[_0x970b('0x33')]({},_0x8e631b,_0x1afffb[_0x970b('0x36')]);return db['AnalyticTreeReport'][_0x970b('0x3e')](_0x8e631b)[_0x970b('0x1f')](handleEntityNotFound(_0x219e6c,null))[_0x970b('0x1f')](respondWithResult(_0x219e6c,null))[_0x970b('0x3f')](handleError(_0x219e6c,null));};exports[_0x970b('0x40')]=function(_0x4fd25b,_0x4a2600){return db[_0x970b('0x25')]['create'](_0x4fd25b[_0x970b('0x41')],{})[_0x970b('0x1f')](respondWithResult(_0x4a2600,0xc9))['catch'](handleError(_0x4a2600,null));};exports[_0x970b('0x1e')]=function(_0x1c25ff,_0x5337ba){if(_0x1c25ff[_0x970b('0x41')]['id']){delete _0x1c25ff[_0x970b('0x41')]['id'];}return db[_0x970b('0x25')][_0x970b('0x3e')]({'where':{'id':_0x1c25ff[_0x970b('0x42')]['id']}})[_0x970b('0x1f')](handleEntityNotFound(_0x5337ba,null))['then'](saveUpdates(_0x1c25ff[_0x970b('0x41')],null))[_0x970b('0x1f')](respondWithResult(_0x5337ba,null))[_0x970b('0x3f')](handleError(_0x5337ba,null));};exports[_0x970b('0x43')]=function(_0x4b00d9,_0x5306ef){return db[_0x970b('0x25')]['find']({'where':{'id':_0x4b00d9[_0x970b('0x42')]['id']}})[_0x970b('0x1f')](handleEntityNotFound(_0x5306ef,null))['then'](removeEntity(_0x5306ef,null))[_0x970b('0x3f')](handleError(_0x5306ef,null));};
\ No newline at end of file
+var _0x2fd3=['json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','merge','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','eml-format','fast-json-patch','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x412d1f,_0x383cb1){var _0x516a61=function(_0x6f7543){while(--_0x6f7543){_0x412d1f['push'](_0x412d1f['shift']());}};_0x516a61(++_0x383cb1);}(_0x2fd3,0x1f1));var _0x32fd=function(_0x1e1f1c,_0x1f2328){_0x1e1f1c=_0x1e1f1c-0x0;var _0x5ab249=_0x2fd3[_0x1e1f1c];return _0x5ab249;};'use strict';var emlformat=require(_0x32fd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x32fd('0x1'));var rp=require('request-promise');var moment=require(_0x32fd('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x32fd('0x3'));var sox=require(_0x32fd('0x4'));var csv=require(_0x32fd('0x5'));var ejs=require(_0x32fd('0x6'));var fs=require('fs');var fs_extra=require(_0x32fd('0x7'));var _=require(_0x32fd('0x8'));var squel=require(_0x32fd('0x9'));var crypto=require(_0x32fd('0xa'));var jsforce=require(_0x32fd('0xb'));var deskjs=require(_0x32fd('0xc'));var toCsv=require('to-csv');var querystring=require(_0x32fd('0xd'));var Papa=require(_0x32fd('0xe'));var Redis=require(_0x32fd('0xf'));var authService=require(_0x32fd('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x32fd('0x11'));var hardwareService=require(_0x32fd('0x12'));var logger=require(_0x32fd('0x13'))(_0x32fd('0x14'));var utils=require(_0x32fd('0x15'));var config=require(_0x32fd('0x16'));var licenseUtil=require(_0x32fd('0x17'));var db=require(_0x32fd('0x18'))['db'];function respondWithStatusCode(_0xc15858,_0x3f89e6){_0x3f89e6=_0x3f89e6||0xcc;return function(_0x57aadc){if(_0x57aadc){return _0xc15858[_0x32fd('0x19')](_0x3f89e6);}return _0xc15858[_0x32fd('0x1a')](_0x3f89e6)[_0x32fd('0x1b')]();};}function respondWithResult(_0x2a6098,_0x122d6c){_0x122d6c=_0x122d6c||0xc8;return function(_0x363c3c){if(_0x363c3c){return _0x2a6098['status'](_0x122d6c)[_0x32fd('0x1c')](_0x363c3c);}};}function respondWithFilteredResult(_0xa984fd,_0xc73f3f){return function(_0x44510f){if(_0x44510f){var _0x21abaf=typeof _0xc73f3f[_0x32fd('0x1d')]===_0x32fd('0x1e')&&typeof _0xc73f3f['limit']==='undefined';var _0x3fc0ad=_0x44510f[_0x32fd('0x1f')];var _0x238346=_0x21abaf?0x0:_0xc73f3f[_0x32fd('0x1d')];var _0x18af0f=_0x21abaf?_0x44510f[_0x32fd('0x1f')]:_0xc73f3f[_0x32fd('0x1d')]+_0xc73f3f[_0x32fd('0x20')];var _0x5085aa;if(_0x18af0f>=_0x3fc0ad){_0x18af0f=_0x3fc0ad;_0x5085aa=0xc8;}else{_0x5085aa=0xce;}_0xa984fd[_0x32fd('0x1a')](_0x5085aa);return _0xa984fd['set'](_0x32fd('0x21'),_0x238346+'-'+_0x18af0f+'/'+_0x3fc0ad)[_0x32fd('0x1c')](_0x44510f);}return null;};}function patchUpdates(_0x44f3d9){return function(_0x3cda90){try{jsonpatch[_0x32fd('0x22')](_0x3cda90,_0x44f3d9,!![]);}catch(_0x54f666){return BPromise[_0x32fd('0x23')](_0x54f666);}return _0x3cda90['save']();};}function saveUpdates(_0x3480ea,_0x28e871){return function(_0x32543a){if(_0x32543a){return _0x32543a[_0x32fd('0x24')](_0x3480ea)[_0x32fd('0x25')](function(_0x2edcc8){return _0x2edcc8;});}return null;};}function removeEntity(_0xd0bd91,_0x3032e9){return function(_0x4c5016){if(_0x4c5016){return _0x4c5016[_0x32fd('0x26')]()['then'](function(){_0xd0bd91[_0x32fd('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20b8e9,_0x3a572f){return function(_0x243f97){if(!_0x243f97){_0x20b8e9[_0x32fd('0x19')](0x194);}return _0x243f97;};}function handleError(_0x39cebd,_0x5178ca){_0x5178ca=_0x5178ca||0x1f4;return function(_0x4839a5){logger[_0x32fd('0x27')](_0x4839a5[_0x32fd('0x28')]);if(_0x4839a5[_0x32fd('0x29')]){delete _0x4839a5['name'];}_0x39cebd[_0x32fd('0x1a')](_0x5178ca)[_0x32fd('0x2a')](_0x4839a5);};}exports[_0x32fd('0x2b')]=function(_0x24e912,_0x4cf4da){var _0x189bf2={},_0x2a1b3b={},_0x20afb0={'count':0x0,'rows':[]};var _0x42f160=_[_0x32fd('0x2c')](db[_0x32fd('0x2d')][_0x32fd('0x2e')],function(_0x1881eb){return{'name':_0x1881eb[_0x32fd('0x2f')],'type':_0x1881eb['type']['key']};});_0x2a1b3b[_0x32fd('0x30')]=_[_0x32fd('0x2c')](_0x42f160,_0x32fd('0x29'));_0x2a1b3b[_0x32fd('0x31')]=_[_0x32fd('0x32')](_0x24e912[_0x32fd('0x31')]);_0x2a1b3b['filters']=_[_0x32fd('0x33')](_0x2a1b3b[_0x32fd('0x30')],_0x2a1b3b[_0x32fd('0x31')]);_0x189bf2[_0x32fd('0x34')]=_[_0x32fd('0x33')](_0x2a1b3b[_0x32fd('0x30')],qs['fields'](_0x24e912[_0x32fd('0x31')][_0x32fd('0x35')]));_0x189bf2['attributes']=_0x189bf2['attributes']['length']?_0x189bf2[_0x32fd('0x34')]:_0x2a1b3b[_0x32fd('0x30')];if(!_0x24e912[_0x32fd('0x31')][_0x32fd('0x36')](_0x32fd('0x37'))){_0x189bf2[_0x32fd('0x20')]=qs[_0x32fd('0x20')](_0x24e912[_0x32fd('0x31')][_0x32fd('0x20')]);_0x189bf2[_0x32fd('0x1d')]=qs[_0x32fd('0x1d')](_0x24e912['query'][_0x32fd('0x1d')]);}_0x189bf2[_0x32fd('0x38')]=qs[_0x32fd('0x39')](_0x24e912[_0x32fd('0x31')]['sort']);_0x189bf2[_0x32fd('0x3a')]=qs[_0x32fd('0x3b')](_['pick'](_0x24e912[_0x32fd('0x31')],_0x2a1b3b['filters']),_0x42f160);if(_0x24e912[_0x32fd('0x31')][_0x32fd('0x3c')]){_0x189bf2[_0x32fd('0x3a')]=_['merge'](_0x189bf2[_0x32fd('0x3a')],{'$or':_[_0x32fd('0x2c')](_0x42f160,function(_0x541511){if(_0x541511[_0x32fd('0x3d')]!=='VIRTUAL'){var _0x1a1eb0={};_0x1a1eb0[_0x541511[_0x32fd('0x29')]]={'$like':'%'+_0x24e912[_0x32fd('0x31')][_0x32fd('0x3c')]+'%'};return _0x1a1eb0;}})});}_0x189bf2=_[_0x32fd('0x3e')]({},_0x189bf2,_0x24e912[_0x32fd('0x3f')]);var _0x20dbed={'where':_0x189bf2[_0x32fd('0x3a')]};return db['AnalyticTreeReport'][_0x32fd('0x1f')](_0x20dbed)[_0x32fd('0x25')](function(_0x1c985c){_0x20afb0[_0x32fd('0x1f')]=_0x1c985c;if(_0x24e912[_0x32fd('0x31')][_0x32fd('0x40')]){_0x189bf2[_0x32fd('0x41')]=[{'all':!![]}];}return db[_0x32fd('0x2d')][_0x32fd('0x42')](_0x189bf2);})[_0x32fd('0x25')](function(_0x1cf00c){_0x20afb0[_0x32fd('0x43')]=_0x1cf00c;return _0x20afb0;})[_0x32fd('0x25')](respondWithFilteredResult(_0x4cf4da,_0x189bf2))[_0x32fd('0x44')](handleError(_0x4cf4da,null));};exports[_0x32fd('0x45')]=function(_0x2987f6,_0x53de3c){var _0x24a4c2={'raw':!![],'where':{'id':_0x2987f6[_0x32fd('0x46')]['id']}},_0x20d8aa={};_0x20d8aa['model']=_[_0x32fd('0x32')](db[_0x32fd('0x2d')]['rawAttributes']);_0x20d8aa[_0x32fd('0x31')]=_[_0x32fd('0x32')](_0x2987f6[_0x32fd('0x31')]);_0x20d8aa[_0x32fd('0x3b')]=_[_0x32fd('0x33')](_0x20d8aa[_0x32fd('0x30')],_0x20d8aa[_0x32fd('0x31')]);_0x24a4c2[_0x32fd('0x34')]=_[_0x32fd('0x33')](_0x20d8aa[_0x32fd('0x30')],qs[_0x32fd('0x35')](_0x2987f6[_0x32fd('0x31')][_0x32fd('0x35')]));_0x24a4c2[_0x32fd('0x34')]=_0x24a4c2['attributes'][_0x32fd('0x47')]?_0x24a4c2['attributes']:_0x20d8aa[_0x32fd('0x30')];if(_0x2987f6[_0x32fd('0x31')][_0x32fd('0x40')]){_0x24a4c2[_0x32fd('0x41')]=[{'all':!![]}];}_0x24a4c2=_[_0x32fd('0x3e')]({},_0x24a4c2,_0x2987f6[_0x32fd('0x3f')]);return db[_0x32fd('0x2d')]['find'](_0x24a4c2)['then'](handleEntityNotFound(_0x53de3c,null))[_0x32fd('0x25')](respondWithResult(_0x53de3c,null))[_0x32fd('0x44')](handleError(_0x53de3c,null));};exports[_0x32fd('0x48')]=function(_0x5647bf,_0x8e617f){return db['AnalyticTreeReport'][_0x32fd('0x48')](_0x5647bf[_0x32fd('0x49')],{})[_0x32fd('0x25')](respondWithResult(_0x8e617f,0xc9))[_0x32fd('0x44')](handleError(_0x8e617f,null));};exports[_0x32fd('0x24')]=function(_0xbc673,_0xcfe285){if(_0xbc673['body']['id']){delete _0xbc673[_0x32fd('0x49')]['id'];}return db[_0x32fd('0x2d')][_0x32fd('0x4a')]({'where':{'id':_0xbc673[_0x32fd('0x46')]['id']}})['then'](handleEntityNotFound(_0xcfe285,null))['then'](saveUpdates(_0xbc673[_0x32fd('0x49')],null))[_0x32fd('0x25')](respondWithResult(_0xcfe285,null))[_0x32fd('0x44')](handleError(_0xcfe285,null));};exports[_0x32fd('0x26')]=function(_0x3d821a,_0x1cafc3){return db[_0x32fd('0x2d')][_0x32fd('0x4a')]({'where':{'id':_0x3d821a[_0x32fd('0x46')]['id']}})[_0x32fd('0x25')](handleEntityNotFound(_0x1cafc3,null))[_0x32fd('0x25')](removeEntity(_0x1cafc3,null))[_0x32fd('0x44')](handleError(_0x1cafc3,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 2fde0c8..b854fe4 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 _0x202f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','define','analytics_report_trees','util'];(function(_0x5b62df,_0xee401){var _0x5e247b=function(_0x4b96c0){while(--_0x4b96c0){_0x5b62df['push'](_0x5b62df['shift']());}};_0x5e247b(++_0xee401);}(_0x202f,0x128));var _0xf202=function(_0x50c2fe,_0x8b89b0){_0x50c2fe=_0x50c2fe-0x0;var _0x230459=_0x202f[_0x50c2fe];return _0x230459;};'use strict';var _=require('lodash');var util=require(_0xf202('0x0'));var logger=require('../../config/logger')(_0xf202('0x1'));var moment=require(_0xf202('0x2'));var BPromise=require(_0xf202('0x3'));var rp=require(_0xf202('0x4'));var fs=require('fs');var path=require(_0xf202('0x5'));var rimraf=require(_0xf202('0x6'));var config=require(_0xf202('0x7'));var attributes=require(_0xf202('0x8'));module['exports']=function(_0x102e6d,_0xa98c2f){return _0x102e6d[_0xf202('0x9')]('AnalyticTreeReport',attributes,{'tableName':_0xf202('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9c4b=['analytics_report_trees','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x5e03dd,_0x3a3eac){var _0xb9c575=function(_0xe59ef5){while(--_0xe59ef5){_0x5e03dd['push'](_0x5e03dd['shift']());}};_0xb9c575(++_0x3a3eac);}(_0x9c4b,0x19b));var _0xb9c4=function(_0x4e3f26,_0xd30c27){_0x4e3f26=_0x4e3f26-0x0;var _0x19daba=_0x9c4b[_0x4e3f26];return _0x19daba;};'use strict';var _=require('lodash');var util=require(_0xb9c4('0x0'));var logger=require('../../config/logger')(_0xb9c4('0x1'));var moment=require(_0xb9c4('0x2'));var BPromise=require(_0xb9c4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9c4('0x4'));var rimraf=require(_0xb9c4('0x5'));var config=require(_0xb9c4('0x6'));var attributes=require('./analyticTreeReport.attributes');module[_0xb9c4('0x7')]=function(_0x4c68a0,_0xd4419c){return _0x4c68a0[_0xb9c4('0x8')]('AnalyticTreeReport',attributes,{'tableName':_0xb9c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 595e7af..5f0419f 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x33d615,_0x1a5af7){var _0x254611=function(_0x23c410){while(--_0x23c410){_0x33d615['push'](_0x33d615['shift']());}};_0x254611(++_0x1a5af7);}(_0xadb5,0xad));var _0x5adb=function(_0x4314a1,_0x51e0d6){_0x4314a1=_0x4314a1-0x0;var _0x16c400=_0xadb5[_0x4314a1];return _0x16c400;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
+var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x24b5d8,_0x203128){var _0x54908d=function(_0x3b0db0){while(--_0x3b0db0){_0x24b5d8['push'](_0x24b5d8['shift']());}};_0x54908d(++_0x203128);}(_0xadb5,0xad));var _0x5adb=function(_0x52e024,_0x3f3815){_0x52e024=_0x52e024-0x0;var _0x5b077f=_0xadb5[_0x52e024];return _0x5b077f;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 10ae2cf..e20f34e 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 _0xb63d=['index','post','create','put','update','/:id','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x3f0b8a,_0x578b56){var _0x3fceba=function(_0x488007){while(--_0x488007){_0x3f0b8a['push'](_0x3f0b8a['shift']());}};_0x3fceba(++_0x578b56);}(_0xb63d,0x127));var _0xdb63=function(_0x111406,_0x4461dd){_0x111406=_0x111406-0x0;var _0x41e5e5=_0xb63d[_0x111406];return _0x41e5e5;};'use strict';var multer=require(_0xdb63('0x0'));var util=require(_0xdb63('0x1'));var path=require('path');var timeout=require(_0xdb63('0x2'));var express=require('express');var router=express[_0xdb63('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdb63('0x4'));var interaction=require(_0xdb63('0x5'));var config=require(_0xdb63('0x6'));var controller=require('./analyticTreeReport.controller');router[_0xdb63('0x7')]('/',auth[_0xdb63('0x8')](),controller[_0xdb63('0x9')]);router[_0xdb63('0x7')]('/:id',auth[_0xdb63('0x8')](),controller['show']);router[_0xdb63('0xa')]('/',auth['isAuthenticated'](),controller[_0xdb63('0xb')]);router[_0xdb63('0xc')]('/:id',auth[_0xdb63('0x8')](),controller[_0xdb63('0xd')]);router['delete'](_0xdb63('0xe'),auth[_0xdb63('0x8')](),controller['destroy']);module[_0xdb63('0xf')]=router;
\ No newline at end of file
+var _0xc943=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','index','get','/:id','isAuthenticated','delete','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0xc943,0x144));var _0x3c94=function(_0x179e11,_0xf65436){_0x179e11=_0x179e11-0x0;var _0x549f04=_0xc943[_0x179e11];return _0x549f04;};'use strict';var multer=require(_0x3c94('0x0'));var util=require(_0x3c94('0x1'));var path=require(_0x3c94('0x2'));var timeout=require(_0x3c94('0x3'));var express=require('express');var router=express[_0x3c94('0x4')]();var fs_extra=require(_0x3c94('0x5'));var auth=require(_0x3c94('0x6'));var interaction=require(_0x3c94('0x7'));var config=require(_0x3c94('0x8'));var controller=require(_0x3c94('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x3c94('0xa')]);router[_0x3c94('0xb')](_0x3c94('0xc'),auth[_0x3c94('0xd')](),controller['show']);router['post']('/',auth[_0x3c94('0xd')](),controller['create']);router['put'](_0x3c94('0xc'),auth[_0x3c94('0xd')](),controller['update']);router[_0x3c94('0xe')](_0x3c94('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index d3f3290..3bc49ee 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 _0x0c02=['exports','STRING'];(function(_0x511757,_0x3662a1){var _0x38f7aa=function(_0x29a402){while(--_0x29a402){_0x511757['push'](_0x511757['shift']());}};_0x38f7aa(++_0x3662a1);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x20c0('0x0')]={'name':{'type':Sequelize[_0x20c0('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x20c0('0x1')]}};
\ No newline at end of file
+var _0x0962=['sequelize','exports','STRING'];(function(_0x4c2c23,_0x3d8d28){var _0x5c992e=function(_0x5cfed7){while(--_0x5cfed7){_0x4c2c23['push'](_0x4c2c23['shift']());}};_0x5c992e(++_0x3d8d28);}(_0x0962,0x198));var _0x2096=function(_0x30c9d9,_0x2d65b8){_0x30c9d9=_0x30c9d9-0x0;var _0x2cd215=_0x0962[_0x30c9d9];return _0x2cd215;};'use strict';var Sequelize=require(_0x2096('0x0'));module[_0x2096('0x1')]={'name':{'type':Sequelize[_0x2096('0x2')]},'basename':{'type':Sequelize[_0x2096('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 8bc8cb4..ababfc1 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 _0x0425=['undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','map','Attachment','type','key','model','query','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','fields','find','clone','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','download','ChatOfflineMessageId','root','join','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','fs-extra','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset'];(function(_0x4c05e6,_0x5f0d4a){var _0x2a8f22=function(_0x2d11a4){while(--_0x2d11a4){_0x4c05e6['push'](_0x4c05e6['shift']());}};_0x2a8f22(++_0x5f0d4a);}(_0x0425,0x1ef));var _0x5042=function(_0x4174b0,_0x27c9f7){_0x4174b0=_0x4174b0-0x0;var _0x45c7c7=_0x0425[_0x4174b0];return _0x45c7c7;};'use strict';var emlformat=require(_0x5042('0x0'));var rimraf=require(_0x5042('0x1'));var zipdir=require(_0x5042('0x2'));var jsonpatch=require(_0x5042('0x3'));var rp=require(_0x5042('0x4'));var moment=require('moment');var BPromise=require(_0x5042('0x5'));var Mustache=require('mustache');var util=require(_0x5042('0x6'));var path=require(_0x5042('0x7'));var sox=require('sox');var csv=require(_0x5042('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5042('0x9'));var _=require('lodash');var squel=require(_0x5042('0xa'));var crypto=require(_0x5042('0xb'));var jsforce=require(_0x5042('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5042('0x8'));var querystring=require(_0x5042('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5042('0xe'));var hardwareService=require(_0x5042('0xf'));var logger=require(_0x5042('0x10'))(_0x5042('0x11'));var utils=require(_0x5042('0x12'));var config=require(_0x5042('0x13'));var licenseUtil=require(_0x5042('0x14'));var db=require(_0x5042('0x15'))['db'];function respondWithStatusCode(_0x5e4aa5,_0x4a7d9c){_0x4a7d9c=_0x4a7d9c||0xcc;return function(_0xcee97e){if(_0xcee97e){return _0x5e4aa5[_0x5042('0x16')](_0x4a7d9c);}return _0x5e4aa5['status'](_0x4a7d9c)[_0x5042('0x17')]();};}function respondWithResult(_0x33619c,_0x2e2afd){_0x2e2afd=_0x2e2afd||0xc8;return function(_0x544b73){if(_0x544b73){return _0x33619c[_0x5042('0x18')](_0x2e2afd)[_0x5042('0x19')](_0x544b73);}};}function respondWithFilteredResult(_0x32c8f9,_0x1e12da){return function(_0x43886f){if(_0x43886f){var _0x3dc5a9=typeof _0x1e12da[_0x5042('0x1a')]===_0x5042('0x1b')&&typeof _0x1e12da[_0x5042('0x1c')]===_0x5042('0x1b');var _0x21ec95=_0x43886f[_0x5042('0x1d')];var _0x539559=_0x3dc5a9?0x0:_0x1e12da[_0x5042('0x1a')];var _0xe9fb6c=_0x3dc5a9?_0x43886f[_0x5042('0x1d')]:_0x1e12da[_0x5042('0x1a')]+_0x1e12da[_0x5042('0x1c')];var _0x471bfd;if(_0xe9fb6c>=_0x21ec95){_0xe9fb6c=_0x21ec95;_0x471bfd=0xc8;}else{_0x471bfd=0xce;}_0x32c8f9['status'](_0x471bfd);return _0x32c8f9[_0x5042('0x1e')](_0x5042('0x1f'),_0x539559+'-'+_0xe9fb6c+'/'+_0x21ec95)[_0x5042('0x19')](_0x43886f);}return null;};}function patchUpdates(_0x307390){return function(_0x30c803){try{jsonpatch['apply'](_0x30c803,_0x307390,!![]);}catch(_0x5c8342){return BPromise[_0x5042('0x20')](_0x5c8342);}return _0x30c803['save']();};}function saveUpdates(_0x2ced62,_0x3fb248){return function(_0x1618fc){if(_0x1618fc){return _0x1618fc[_0x5042('0x21')](_0x2ced62)[_0x5042('0x22')](function(_0x26841e){return _0x26841e;});}return null;};}function removeEntity(_0x312eea,_0x39594c){return function(_0x375962){if(_0x375962){return _0x375962[_0x5042('0x23')]()['then'](function(){_0x312eea[_0x5042('0x18')](0xcc)[_0x5042('0x17')]();});}};}function handleEntityNotFound(_0x71b64f,_0x21ec06){return function(_0x47aa1f){if(!_0x47aa1f){_0x71b64f[_0x5042('0x16')](0x194);}return _0x47aa1f;};}function handleError(_0x52e905,_0x299d70){_0x299d70=_0x299d70||0x1f4;return function(_0x478c0e){logger[_0x5042('0x24')](_0x478c0e[_0x5042('0x25')]);if(_0x478c0e['name']){delete _0x478c0e[_0x5042('0x26')];}_0x52e905[_0x5042('0x18')](_0x299d70)[_0x5042('0x27')](_0x478c0e);};}exports['index']=function(_0x496940,_0x13575e){var _0xfffcfe={},_0x1f90f8={},_0x2a5070={'count':0x0,'rows':[]};var _0x3e525e=_[_0x5042('0x28')](db[_0x5042('0x29')]['rawAttributes'],function(_0x3df45c){return{'name':_0x3df45c['fieldName'],'type':_0x3df45c[_0x5042('0x2a')][_0x5042('0x2b')]};});_0x1f90f8[_0x5042('0x2c')]=_[_0x5042('0x28')](_0x3e525e,_0x5042('0x26'));_0x1f90f8['query']=_['keys'](_0x496940[_0x5042('0x2d')]);_0x1f90f8[_0x5042('0x2e')]=_[_0x5042('0x2f')](_0x1f90f8[_0x5042('0x2c')],_0x1f90f8[_0x5042('0x2d')]);_0xfffcfe[_0x5042('0x30')]=_['intersection'](_0x1f90f8[_0x5042('0x2c')],qs['fields'](_0x496940[_0x5042('0x2d')]['fields']));_0xfffcfe[_0x5042('0x30')]=_0xfffcfe[_0x5042('0x30')][_0x5042('0x31')]?_0xfffcfe[_0x5042('0x30')]:_0x1f90f8[_0x5042('0x2c')];if(!_0x496940[_0x5042('0x2d')]['hasOwnProperty'](_0x5042('0x32'))){_0xfffcfe[_0x5042('0x1c')]=qs[_0x5042('0x1c')](_0x496940[_0x5042('0x2d')][_0x5042('0x1c')]);_0xfffcfe[_0x5042('0x1a')]=qs[_0x5042('0x1a')](_0x496940[_0x5042('0x2d')][_0x5042('0x1a')]);}_0xfffcfe[_0x5042('0x33')]=qs[_0x5042('0x34')](_0x496940[_0x5042('0x2d')][_0x5042('0x34')]);_0xfffcfe[_0x5042('0x35')]=qs[_0x5042('0x2e')](_[_0x5042('0x36')](_0x496940[_0x5042('0x2d')],_0x1f90f8[_0x5042('0x2e')]),_0x3e525e);if(_0x496940[_0x5042('0x2d')][_0x5042('0x37')]){_0xfffcfe['where']=_[_0x5042('0x38')](_0xfffcfe['where'],{'$or':_[_0x5042('0x28')](_0x3e525e,function(_0x2ee141){if(_0x2ee141[_0x5042('0x2a')]!==_0x5042('0x39')){var _0x34af56={};_0x34af56[_0x2ee141[_0x5042('0x26')]]={'$like':'%'+_0x496940[_0x5042('0x2d')][_0x5042('0x37')]+'%'};return _0x34af56;}})});}_0xfffcfe=_[_0x5042('0x38')]({},_0xfffcfe,_0x496940[_0x5042('0x3a')]);var _0x1ac045={'where':_0xfffcfe['where']};return db[_0x5042('0x29')][_0x5042('0x1d')](_0x1ac045)['then'](function(_0x428d65){_0x2a5070[_0x5042('0x1d')]=_0x428d65;if(_0x496940[_0x5042('0x2d')][_0x5042('0x3b')]){_0xfffcfe[_0x5042('0x3c')]=[{'all':!![]}];}return db['Attachment'][_0x5042('0x3d')](_0xfffcfe);})[_0x5042('0x22')](function(_0x7581c7){_0x2a5070[_0x5042('0x3e')]=_0x7581c7;return _0x2a5070;})[_0x5042('0x22')](respondWithFilteredResult(_0x13575e,_0xfffcfe))[_0x5042('0x3f')](handleError(_0x13575e,null));};exports[_0x5042('0x40')]=function(_0x2ae5ac,_0x12ffd4){var _0x3fd18b={'raw':!![],'where':{'id':_0x2ae5ac[_0x5042('0x41')]['id']}},_0x2c34d4={};_0x2c34d4[_0x5042('0x2c')]=_[_0x5042('0x42')](db[_0x5042('0x29')][_0x5042('0x43')]);_0x2c34d4[_0x5042('0x2d')]=_['keys'](_0x2ae5ac['query']);_0x2c34d4[_0x5042('0x2e')]=_['intersection'](_0x2c34d4[_0x5042('0x2c')],_0x2c34d4[_0x5042('0x2d')]);_0x3fd18b[_0x5042('0x30')]=_['intersection'](_0x2c34d4[_0x5042('0x2c')],qs[_0x5042('0x44')](_0x2ae5ac[_0x5042('0x2d')][_0x5042('0x44')]));_0x3fd18b[_0x5042('0x30')]=_0x3fd18b[_0x5042('0x30')][_0x5042('0x31')]?_0x3fd18b[_0x5042('0x30')]:_0x2c34d4[_0x5042('0x2c')];if(_0x2ae5ac[_0x5042('0x2d')][_0x5042('0x3b')]){_0x3fd18b[_0x5042('0x3c')]=[{'all':!![]}];}_0x3fd18b=_[_0x5042('0x38')]({},_0x3fd18b,_0x2ae5ac[_0x5042('0x3a')]);return db[_0x5042('0x29')][_0x5042('0x45')](_0x3fd18b)[_0x5042('0x22')](handleEntityNotFound(_0x12ffd4,null))['then'](respondWithResult(_0x12ffd4,null))['catch'](handleError(_0x12ffd4,null));};exports[_0x5042('0x46')]=function(_0x450e4b,_0x5edd7d){var _0x2835b7={'where':{'id':_0x450e4b['params']['id']}},_0x349555={};_0x349555[_0x5042('0x2c')]=_[_0x5042('0x42')](db['Attachment'][_0x5042('0x43')]);_0x2835b7[_0x5042('0x30')]=_[_0x5042('0x2f')](_0x349555['model'],qs['fields'](_0x450e4b[_0x5042('0x2d')][_0x5042('0x44')]));_0x2835b7[_0x5042('0x30')]=_0x2835b7[_0x5042('0x30')][_0x5042('0x31')]?_0x2835b7[_0x5042('0x30')]:_0x349555[_0x5042('0x2c')];if(_0x450e4b['query'][_0x5042('0x3b')]){_0x2835b7[_0x5042('0x3c')]=[{'all':!![]}];}_0x2835b7=_[_0x5042('0x38')]({},_0x2835b7,_0x450e4b[_0x5042('0x3a')]);return db['Attachment'][_0x5042('0x45')](_0x2835b7)[_0x5042('0x22')](handleEntityNotFound(_0x5edd7d,null))['then'](function(_0x7f135){if(_0x7f135){var _0x1018dd=_0x7f135[_0x5042('0x47')]({'plain':!![]});_0x1018dd=qs[_0x5042('0x48')](_0x1018dd,['id',_0x5042('0x49'),_0x5042('0x4a')]);_0x450e4b[_0x5042('0x4b')]=_[_0x5042('0x48')](_0x450e4b[_0x5042('0x4b')],['id','createdAt','updatedAt']);return db['Attachment']['create'](_[_0x5042('0x38')](_0x1018dd,_0x450e4b[_0x5042('0x4b')]),{'include':_0x450e4b[_0x5042('0x2d')][_0x5042('0x3b')]?[{'all':!![]}]:undefined});}})[_0x5042('0x22')](respondWithResult(_0x5edd7d,0xc9))['catch'](handleError(_0x5edd7d,null));};exports['update']=function(_0x5c7509,_0x27caf5){if(_0x5c7509[_0x5042('0x4b')]['id']){delete _0x5c7509['body']['id'];}return db[_0x5042('0x29')][_0x5042('0x45')]({'where':{'id':_0x5c7509[_0x5042('0x41')]['id']}})['then'](handleEntityNotFound(_0x27caf5,null))[_0x5042('0x22')](saveUpdates(_0x5c7509['body'],null))[_0x5042('0x22')](respondWithResult(_0x27caf5,null))[_0x5042('0x3f')](handleError(_0x27caf5,null));};exports[_0x5042('0x23')]=function(_0x2d93b1,_0x31fd64){return db['Attachment']['find']({'where':{'id':_0x2d93b1[_0x5042('0x41')]['id']}})[_0x5042('0x22')](handleEntityNotFound(_0x31fd64,null))['then'](removeEntity(_0x31fd64,null))['catch'](handleError(_0x31fd64,null));};exports[_0x5042('0x4c')]=function(_0x163080,_0x2fe287,_0x52de86){_0x163080['body'][_0x5042('0x26')]=_0x163080[_0x5042('0x4d')][_0x5042('0x4e')];_0x163080[_0x5042('0x4b')][_0x5042('0x4f')]=_0x163080['file'][_0x5042('0x50')];_0x163080['body'][_0x5042('0x2a')]=_0x163080[_0x5042('0x4d')][_0x5042('0x51')];return db[_0x5042('0x29')][_0x5042('0x4c')](_0x163080['body'])[_0x5042('0x22')](respondWithResult(_0x2fe287,0xc9))[_0x5042('0x3f')](handleError(_0x2fe287,null));};exports[_0x5042('0x52')]=function(_0x4abbd9,_0x1ceea1,_0xfe9d33){return db[_0x5042('0x29')]['findOne']({'where':{'id':_0x4abbd9[_0x5042('0x41')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1ceea1,null))[_0x5042('0x22')](function(_0x2536dd){if(_0x2536dd){var _0x500eb9=_0x2536dd[_0x5042('0x53')]!==null;var _0xdaf0f9=path['join'](config[_0x5042('0x54')],'server/files/attachments/');if(_0x500eb9){_0xdaf0f9=path[_0x5042('0x55')](_0xdaf0f9,_0x5042('0x56'));}var _0x469ad2=path[_0x5042('0x55')](_0xdaf0f9,_0x2536dd[_0x5042('0x4f')]);return _0x1ceea1[_0x5042('0x52')](_0x469ad2);}})[_0x5042('0x3f')](handleError(_0x1ceea1,null));};
\ No newline at end of file
+var _0x3d8c=['filter','merge','VIRTUAL','includeAll','include','findAll','show','params','fields','options','find','catch','clone','get','omit','createdAt','updatedAt','create','body','basename','file','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','offline-chat/','rimraf','zip-dir','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','Attachment','rawAttributes','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','where','filters','pick'];(function(_0x5a7e78,_0x400b57){var _0xa8d4a1=function(_0x486659){while(--_0x486659){_0x5a7e78['push'](_0x5a7e78['shift']());}};_0xa8d4a1(++_0x400b57);}(_0x3d8c,0x79));var _0xc3d8=function(_0x337537,_0x4ea7b8){_0x337537=_0x337537-0x0;var _0x4fdd67=_0x3d8c[_0x337537];return _0x4fdd67;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc3d8('0x0'));var zipdir=require(_0xc3d8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc3d8('0x2'));var moment=require('moment');var BPromise=require(_0xc3d8('0x3'));var Mustache=require('mustache');var util=require(_0xc3d8('0x4'));var path=require(_0xc3d8('0x5'));var sox=require(_0xc3d8('0x6'));var csv=require('to-csv');var ejs=require(_0xc3d8('0x7'));var fs=require('fs');var fs_extra=require(_0xc3d8('0x8'));var _=require(_0xc3d8('0x9'));var squel=require(_0xc3d8('0xa'));var crypto=require(_0xc3d8('0xb'));var jsforce=require(_0xc3d8('0xc'));var deskjs=require(_0xc3d8('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc3d8('0xe'));var Redis=require(_0xc3d8('0xf'));var authService=require(_0xc3d8('0x10'));var qs=require(_0xc3d8('0x11'));var as=require(_0xc3d8('0x12'));var hardwareService=require(_0xc3d8('0x13'));var logger=require(_0xc3d8('0x14'))(_0xc3d8('0x15'));var utils=require(_0xc3d8('0x16'));var config=require(_0xc3d8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc3d8('0x18'))['db'];function respondWithStatusCode(_0x5cf50f,_0x471097){_0x471097=_0x471097||0xcc;return function(_0x2ee5b0){if(_0x2ee5b0){return _0x5cf50f[_0xc3d8('0x19')](_0x471097);}return _0x5cf50f[_0xc3d8('0x1a')](_0x471097)[_0xc3d8('0x1b')]();};}function respondWithResult(_0x4efa79,_0x911315){_0x911315=_0x911315||0xc8;return function(_0x1651ff){if(_0x1651ff){return _0x4efa79[_0xc3d8('0x1a')](_0x911315)[_0xc3d8('0x1c')](_0x1651ff);}};}function respondWithFilteredResult(_0xc58041,_0x3d6aa0){return function(_0x1a8212){if(_0x1a8212){var _0x44a9f7=typeof _0x3d6aa0[_0xc3d8('0x1d')]===_0xc3d8('0x1e')&&typeof _0x3d6aa0['limit']===_0xc3d8('0x1e');var _0x35ea5d=_0x1a8212[_0xc3d8('0x1f')];var _0x1f5468=_0x44a9f7?0x0:_0x3d6aa0[_0xc3d8('0x1d')];var _0x20b87a=_0x44a9f7?_0x1a8212[_0xc3d8('0x1f')]:_0x3d6aa0['offset']+_0x3d6aa0[_0xc3d8('0x20')];var _0x287b1f;if(_0x20b87a>=_0x35ea5d){_0x20b87a=_0x35ea5d;_0x287b1f=0xc8;}else{_0x287b1f=0xce;}_0xc58041[_0xc3d8('0x1a')](_0x287b1f);return _0xc58041[_0xc3d8('0x21')](_0xc3d8('0x22'),_0x1f5468+'-'+_0x20b87a+'/'+_0x35ea5d)['json'](_0x1a8212);}return null;};}function patchUpdates(_0x52fc88){return function(_0x1fd6f8){try{jsonpatch[_0xc3d8('0x23')](_0x1fd6f8,_0x52fc88,!![]);}catch(_0x509cc7){return BPromise[_0xc3d8('0x24')](_0x509cc7);}return _0x1fd6f8[_0xc3d8('0x25')]();};}function saveUpdates(_0x4fe0fe,_0x3f660c){return function(_0x49dec7){if(_0x49dec7){return _0x49dec7[_0xc3d8('0x26')](_0x4fe0fe)['then'](function(_0x3d0c22){return _0x3d0c22;});}return null;};}function removeEntity(_0x37df48,_0x15391a){return function(_0x147865){if(_0x147865){return _0x147865[_0xc3d8('0x27')]()[_0xc3d8('0x28')](function(){_0x37df48[_0xc3d8('0x1a')](0xcc)[_0xc3d8('0x1b')]();});}};}function handleEntityNotFound(_0x23362a,_0x8fb448){return function(_0x332ec0){if(!_0x332ec0){_0x23362a[_0xc3d8('0x19')](0x194);}return _0x332ec0;};}function handleError(_0x3f67b2,_0x4bfad9){_0x4bfad9=_0x4bfad9||0x1f4;return function(_0xc8d68d){logger[_0xc3d8('0x29')](_0xc8d68d[_0xc3d8('0x2a')]);if(_0xc8d68d[_0xc3d8('0x2b')]){delete _0xc8d68d[_0xc3d8('0x2b')];}_0x3f67b2[_0xc3d8('0x1a')](_0x4bfad9)[_0xc3d8('0x2c')](_0xc8d68d);};}exports[_0xc3d8('0x2d')]=function(_0x1382e6,_0x185579){var _0x4b9aa4={},_0x4dd233={},_0x5ac9a7={'count':0x0,'rows':[]};var _0xff0bd0=_[_0xc3d8('0x2e')](db[_0xc3d8('0x2f')][_0xc3d8('0x30')],function(_0x5186b8){return{'name':_0x5186b8['fieldName'],'type':_0x5186b8[_0xc3d8('0x31')][_0xc3d8('0x32')]};});_0x4dd233[_0xc3d8('0x33')]=_[_0xc3d8('0x2e')](_0xff0bd0,_0xc3d8('0x2b'));_0x4dd233[_0xc3d8('0x34')]=_[_0xc3d8('0x35')](_0x1382e6[_0xc3d8('0x34')]);_0x4dd233['filters']=_[_0xc3d8('0x36')](_0x4dd233[_0xc3d8('0x33')],_0x4dd233[_0xc3d8('0x34')]);_0x4b9aa4[_0xc3d8('0x37')]=_['intersection'](_0x4dd233['model'],qs['fields'](_0x1382e6[_0xc3d8('0x34')]['fields']));_0x4b9aa4['attributes']=_0x4b9aa4[_0xc3d8('0x37')][_0xc3d8('0x38')]?_0x4b9aa4[_0xc3d8('0x37')]:_0x4dd233[_0xc3d8('0x33')];if(!_0x1382e6[_0xc3d8('0x34')][_0xc3d8('0x39')](_0xc3d8('0x3a'))){_0x4b9aa4[_0xc3d8('0x20')]=qs[_0xc3d8('0x20')](_0x1382e6['query'][_0xc3d8('0x20')]);_0x4b9aa4[_0xc3d8('0x1d')]=qs[_0xc3d8('0x1d')](_0x1382e6[_0xc3d8('0x34')][_0xc3d8('0x1d')]);}_0x4b9aa4[_0xc3d8('0x3b')]=qs['sort'](_0x1382e6['query']['sort']);_0x4b9aa4[_0xc3d8('0x3c')]=qs[_0xc3d8('0x3d')](_[_0xc3d8('0x3e')](_0x1382e6['query'],_0x4dd233['filters']),_0xff0bd0);if(_0x1382e6[_0xc3d8('0x34')][_0xc3d8('0x3f')]){_0x4b9aa4['where']=_[_0xc3d8('0x40')](_0x4b9aa4['where'],{'$or':_['map'](_0xff0bd0,function(_0x13f287){if(_0x13f287[_0xc3d8('0x31')]!==_0xc3d8('0x41')){var _0x1a6c71={};_0x1a6c71[_0x13f287[_0xc3d8('0x2b')]]={'$like':'%'+_0x1382e6[_0xc3d8('0x34')][_0xc3d8('0x3f')]+'%'};return _0x1a6c71;}})});}_0x4b9aa4=_['merge']({},_0x4b9aa4,_0x1382e6['options']);var _0x78af76={'where':_0x4b9aa4['where']};return db[_0xc3d8('0x2f')][_0xc3d8('0x1f')](_0x78af76)['then'](function(_0x4b636d){_0x5ac9a7[_0xc3d8('0x1f')]=_0x4b636d;if(_0x1382e6[_0xc3d8('0x34')][_0xc3d8('0x42')]){_0x4b9aa4[_0xc3d8('0x43')]=[{'all':!![]}];}return db[_0xc3d8('0x2f')][_0xc3d8('0x44')](_0x4b9aa4);})[_0xc3d8('0x28')](function(_0x18ec33){_0x5ac9a7['rows']=_0x18ec33;return _0x5ac9a7;})[_0xc3d8('0x28')](respondWithFilteredResult(_0x185579,_0x4b9aa4))['catch'](handleError(_0x185579,null));};exports[_0xc3d8('0x45')]=function(_0x454317,_0x52fdcd){var _0x24c6b0={'raw':!![],'where':{'id':_0x454317[_0xc3d8('0x46')]['id']}},_0x5904bd={};_0x5904bd['model']=_[_0xc3d8('0x35')](db[_0xc3d8('0x2f')][_0xc3d8('0x30')]);_0x5904bd[_0xc3d8('0x34')]=_[_0xc3d8('0x35')](_0x454317['query']);_0x5904bd[_0xc3d8('0x3d')]=_[_0xc3d8('0x36')](_0x5904bd[_0xc3d8('0x33')],_0x5904bd['query']);_0x24c6b0[_0xc3d8('0x37')]=_[_0xc3d8('0x36')](_0x5904bd[_0xc3d8('0x33')],qs[_0xc3d8('0x47')](_0x454317[_0xc3d8('0x34')][_0xc3d8('0x47')]));_0x24c6b0[_0xc3d8('0x37')]=_0x24c6b0[_0xc3d8('0x37')][_0xc3d8('0x38')]?_0x24c6b0[_0xc3d8('0x37')]:_0x5904bd[_0xc3d8('0x33')];if(_0x454317[_0xc3d8('0x34')][_0xc3d8('0x42')]){_0x24c6b0['include']=[{'all':!![]}];}_0x24c6b0=_[_0xc3d8('0x40')]({},_0x24c6b0,_0x454317[_0xc3d8('0x48')]);return db[_0xc3d8('0x2f')][_0xc3d8('0x49')](_0x24c6b0)['then'](handleEntityNotFound(_0x52fdcd,null))[_0xc3d8('0x28')](respondWithResult(_0x52fdcd,null))[_0xc3d8('0x4a')](handleError(_0x52fdcd,null));};exports[_0xc3d8('0x4b')]=function(_0x3fb58c,_0x593d94){var _0x4cc34b={'where':{'id':_0x3fb58c[_0xc3d8('0x46')]['id']}},_0x41e27e={};_0x41e27e[_0xc3d8('0x33')]=_['keys'](db[_0xc3d8('0x2f')]['rawAttributes']);_0x4cc34b[_0xc3d8('0x37')]=_[_0xc3d8('0x36')](_0x41e27e['model'],qs[_0xc3d8('0x47')](_0x3fb58c[_0xc3d8('0x34')]['fields']));_0x4cc34b[_0xc3d8('0x37')]=_0x4cc34b[_0xc3d8('0x37')][_0xc3d8('0x38')]?_0x4cc34b[_0xc3d8('0x37')]:_0x41e27e[_0xc3d8('0x33')];if(_0x3fb58c[_0xc3d8('0x34')]['includeAll']){_0x4cc34b[_0xc3d8('0x43')]=[{'all':!![]}];}_0x4cc34b=_['merge']({},_0x4cc34b,_0x3fb58c[_0xc3d8('0x48')]);return db[_0xc3d8('0x2f')][_0xc3d8('0x49')](_0x4cc34b)['then'](handleEntityNotFound(_0x593d94,null))[_0xc3d8('0x28')](function(_0x8252d6){if(_0x8252d6){var _0x1d4301=_0x8252d6[_0xc3d8('0x4c')]({'plain':!![]});_0x1d4301=qs[_0xc3d8('0x4d')](_0x1d4301,['id',_0xc3d8('0x4e'),'updatedAt']);_0x3fb58c['body']=_[_0xc3d8('0x4d')](_0x3fb58c['body'],['id',_0xc3d8('0x4e'),_0xc3d8('0x4f')]);return db['Attachment'][_0xc3d8('0x50')](_[_0xc3d8('0x40')](_0x1d4301,_0x3fb58c[_0xc3d8('0x51')]),{'include':_0x3fb58c['query'][_0xc3d8('0x42')]?[{'all':!![]}]:undefined});}})[_0xc3d8('0x28')](respondWithResult(_0x593d94,0xc9))[_0xc3d8('0x4a')](handleError(_0x593d94,null));};exports[_0xc3d8('0x26')]=function(_0x58348b,_0x26cd95){if(_0x58348b[_0xc3d8('0x51')]['id']){delete _0x58348b[_0xc3d8('0x51')]['id'];}return db[_0xc3d8('0x2f')]['find']({'where':{'id':_0x58348b[_0xc3d8('0x46')]['id']}})[_0xc3d8('0x28')](handleEntityNotFound(_0x26cd95,null))[_0xc3d8('0x28')](saveUpdates(_0x58348b[_0xc3d8('0x51')],null))['then'](respondWithResult(_0x26cd95,null))[_0xc3d8('0x4a')](handleError(_0x26cd95,null));};exports[_0xc3d8('0x27')]=function(_0x12ef6c,_0x2f0799){return db[_0xc3d8('0x2f')][_0xc3d8('0x49')]({'where':{'id':_0x12ef6c[_0xc3d8('0x46')]['id']}})['then'](handleEntityNotFound(_0x2f0799,null))[_0xc3d8('0x28')](removeEntity(_0x2f0799,null))['catch'](handleError(_0x2f0799,null));};exports[_0xc3d8('0x50')]=function(_0x59591a,_0x3e13b9,_0x589319){_0x59591a[_0xc3d8('0x51')][_0xc3d8('0x2b')]=_0x59591a['file']['originalname'];_0x59591a[_0xc3d8('0x51')][_0xc3d8('0x52')]=_0x59591a[_0xc3d8('0x53')][_0xc3d8('0x54')];_0x59591a[_0xc3d8('0x51')]['type']=_0x59591a[_0xc3d8('0x53')][_0xc3d8('0x55')];return db[_0xc3d8('0x2f')]['create'](_0x59591a[_0xc3d8('0x51')])[_0xc3d8('0x28')](respondWithResult(_0x3e13b9,0xc9))[_0xc3d8('0x4a')](handleError(_0x3e13b9,null));};exports[_0xc3d8('0x56')]=function(_0x556cc1,_0x290631,_0x1ab27f){return db[_0xc3d8('0x2f')][_0xc3d8('0x57')]({'where':{'id':_0x556cc1[_0xc3d8('0x46')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x290631,null))[_0xc3d8('0x28')](function(_0x25218c){if(_0x25218c){var _0x2cd04e=_0x25218c[_0xc3d8('0x58')]!==null;var _0x36cd8e=path[_0xc3d8('0x59')](config[_0xc3d8('0x5a')],'server/files/attachments/');if(_0x2cd04e){_0x36cd8e=path[_0xc3d8('0x59')](_0x36cd8e,_0xc3d8('0x5b'));}var _0x3ace0c=path[_0xc3d8('0x59')](_0x36cd8e,_0x25218c['basename']);return _0x290631[_0xc3d8('0x56')](_0x3ace0c);}})[_0xc3d8('0x4a')](handleError(_0x290631,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 9c7b868..f663534 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 _0x67b9=['util','../../config/logger','api','bluebird','request-promise','rimraf','./attachment.attributes','define','Attachment','attachments'];(function(_0x5f4dfb,_0x12f774){var _0x1b2688=function(_0x481d0e){while(--_0x481d0e){_0x5f4dfb['push'](_0x5f4dfb['shift']());}};_0x1b2688(++_0x12f774);}(_0x67b9,0x1c2));var _0x967b=function(_0x1714ae,_0x4ff761){_0x1714ae=_0x1714ae-0x0;var _0x5d6aba=_0x67b9[_0x1714ae];return _0x5d6aba;};'use strict';var _=require('lodash');var util=require(_0x967b('0x0'));var logger=require(_0x967b('0x1'))(_0x967b('0x2'));var moment=require('moment');var BPromise=require(_0x967b('0x3'));var rp=require(_0x967b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x967b('0x5'));var config=require('../../config/environment');var attributes=require(_0x967b('0x6'));module['exports']=function(_0xe4f367,_0x426073){return _0xe4f367[_0x967b('0x7')](_0x967b('0x8'),attributes,{'tableName':_0x967b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x83ab=['lodash','moment','request-promise','../../config/environment','./attachment.attributes','exports','define','Attachment'];(function(_0x3d40a6,_0x5bfc03){var _0x2a1f81=function(_0x1a5232){while(--_0x1a5232){_0x3d40a6['push'](_0x3d40a6['shift']());}};_0x2a1f81(++_0x5bfc03);}(_0x83ab,0x170));var _0xb83a=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x83ab[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0xb83a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb83a('0x1'));var BPromise=require('bluebird');var rp=require(_0xb83a('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb83a('0x3'));var attributes=require(_0xb83a('0x4'));module[_0xb83a('0x5')]=function(_0x59490f,_0x3a2ad0){return _0x59490f[_0xb83a('0x6')](_0xb83a('0x7'),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 a56e1ee..570d7af 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 _0xf6fb=['Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateAttachment','Attachment','create','body','options','debug','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xf6fb,0x111));var _0xbf6f=function(_0x417ed5,_0x4a9a0e){_0x417ed5=_0x417ed5-0x0;var _0x3539d8=_0xf6fb[_0x417ed5];return _0x3539d8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbf6f('0x0'));var BPromise=require(_0xbf6f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf6f('0x2'));var db=require(_0xbf6f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf6f('0x4'))('rpc');var config=require(_0xbf6f('0x5'));var jayson=require(_0xbf6f('0x6'));var client=jayson[_0xbf6f('0x7')][_0xbf6f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3d8ecf,_0x26bc7b,_0x9d0c63){return new BPromise(function(_0x43d56b,_0x5948cf){return client[_0xbf6f('0x9')](_0x3d8ecf,_0x9d0c63)[_0xbf6f('0xa')](function(_0x2ac2f8){logger[_0xbf6f('0xb')](_0xbf6f('0xc'),_0x26bc7b,'request\x20sent');logger['debug'](_0xbf6f('0xd'),_0x26bc7b,_0xbf6f('0xe'),JSON[_0xbf6f('0xf')](_0x2ac2f8));if(_0x2ac2f8['error']){if(_0x2ac2f8[_0xbf6f('0x10')]['code']===0x1f4){logger[_0xbf6f('0x10')](_0xbf6f('0xc'),_0x26bc7b,_0x2ac2f8[_0xbf6f('0x10')]['message']);return _0x5948cf(_0x2ac2f8[_0xbf6f('0x10')][_0xbf6f('0x11')]);}logger[_0xbf6f('0x10')](_0xbf6f('0xc'),_0x26bc7b,_0x2ac2f8[_0xbf6f('0x10')][_0xbf6f('0x11')]);return _0x43d56b(_0x2ac2f8['error'][_0xbf6f('0x11')]);}else{logger[_0xbf6f('0xb')](_0xbf6f('0xc'),_0x26bc7b,_0xbf6f('0xe'));_0x43d56b(_0x2ac2f8[_0xbf6f('0x12')][_0xbf6f('0x11')]);}})[_0xbf6f('0x13')](function(_0x586f33){logger['error'](_0xbf6f('0xc'),_0x26bc7b,_0x586f33);_0x5948cf(_0x586f33);});});}exports[_0xbf6f('0x14')]=function(_0x21b485){var _0x4b3c33=this;return new Promise(function(_0x56b4da,_0x2a0537){return db[_0xbf6f('0x15')][_0xbf6f('0x16')](_0x21b485[_0xbf6f('0x17')],{'raw':_0x21b485[_0xbf6f('0x18')]?_0x21b485['options']['raw']===undefined?!![]:![]:!![]})[_0xbf6f('0xa')](function(_0x5985ac){logger[_0xbf6f('0xb')](_0xbf6f('0x14'),_0x21b485);logger[_0xbf6f('0x19')]('CreateAttachment',_0x21b485,JSON[_0xbf6f('0xf')](_0x5985ac));_0x56b4da(_0x5985ac);})[_0xbf6f('0x13')](function(_0x3a0087){logger['error'](_0xbf6f('0x14'),_0x3a0087['message'],_0x21b485);_0x2a0537(_0x4b3c33[_0xbf6f('0x10')](0x1f4,_0x3a0087[_0xbf6f('0x11')]));});});};
\ No newline at end of file
+var _0x630e=['code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1c37a5,_0x59ee51){var _0x389d03=function(_0x51b4f4){while(--_0x51b4f4){_0x1c37a5['push'](_0x1c37a5['shift']());}};_0x389d03(++_0x59ee51);}(_0x630e,0x1af));var _0xe630=function(_0x5641f2,_0x3682d4){_0x5641f2=_0x5641f2-0x0;var _0x3384c7=_0x630e[_0x5641f2];return _0x3384c7;};'use strict';var _=require(_0xe630('0x0'));var util=require('util');var moment=require(_0xe630('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe630('0x2'));var db=require(_0xe630('0x3'))['db'];var utils=require(_0xe630('0x4'));var logger=require('../../config/logger')(_0xe630('0x5'));var config=require(_0xe630('0x6'));var jayson=require(_0xe630('0x7'));var client=jayson[_0xe630('0x8')][_0xe630('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x481b21,_0x20193d,_0x34bad4){return new BPromise(function(_0x5a73ad,_0x267926){return client['request'](_0x481b21,_0x34bad4)[_0xe630('0xa')](function(_0x3da641){logger[_0xe630('0xb')]('Attachment,\x20%s,\x20%s',_0x20193d,'request\x20sent');logger[_0xe630('0xc')](_0xe630('0xd'),_0x20193d,_0xe630('0xe'),JSON[_0xe630('0xf')](_0x3da641));if(_0x3da641['error']){if(_0x3da641[_0xe630('0x10')][_0xe630('0x11')]===0x1f4){logger[_0xe630('0x10')](_0xe630('0x12'),_0x20193d,_0x3da641[_0xe630('0x10')][_0xe630('0x13')]);return _0x267926(_0x3da641[_0xe630('0x10')][_0xe630('0x13')]);}logger[_0xe630('0x10')](_0xe630('0x12'),_0x20193d,_0x3da641[_0xe630('0x10')][_0xe630('0x13')]);return _0x5a73ad(_0x3da641[_0xe630('0x10')]['message']);}else{logger[_0xe630('0xb')](_0xe630('0x12'),_0x20193d,_0xe630('0xe'));_0x5a73ad(_0x3da641[_0xe630('0x14')][_0xe630('0x13')]);}})[_0xe630('0x15')](function(_0x26a2b7){logger[_0xe630('0x10')](_0xe630('0x12'),_0x20193d,_0x26a2b7);_0x267926(_0x26a2b7);});});}exports[_0xe630('0x16')]=function(_0x3dbcf6){var _0x9721fa=this;return new Promise(function(_0xafcf13,_0x79213e){return db[_0xe630('0x17')][_0xe630('0x18')](_0x3dbcf6[_0xe630('0x19')],{'raw':_0x3dbcf6[_0xe630('0x1a')]?_0x3dbcf6[_0xe630('0x1a')][_0xe630('0x1b')]===undefined?!![]:![]:!![]})[_0xe630('0xa')](function(_0x22fa75){logger[_0xe630('0xb')](_0xe630('0x16'),_0x3dbcf6);logger[_0xe630('0xc')](_0xe630('0x16'),_0x3dbcf6,JSON['stringify'](_0x22fa75));_0xafcf13(_0x22fa75);})[_0xe630('0x15')](function(_0x35e869){logger[_0xe630('0x10')]('CreateAttachment',_0x35e869[_0xe630('0x13')],_0x3dbcf6);_0x79213e(_0x9721fa[_0xe630('0x10')](0x1f4,_0x35e869[_0xe630('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index dd59057..bf9b101 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(_0x1f7c3d,_0x9bb771){var _0x294b3d=function(_0x4f2f7c){while(--_0x4f2f7c){_0x1f7c3d['push'](_0x1f7c3d['shift']());}};_0x294b3d(++_0x9bb771);}(_0x5f2f,0x73));var _0xf5f2=function(_0x368b5e,_0x308adf){_0x368b5e=_0x368b5e-0x0;var _0x17e983=_0x5f2f[_0x368b5e];return _0x17e983;};'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 _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x4db1c8,_0x2d142e){var _0x3ab9bc=function(_0x5acfc9){while(--_0x5acfc9){_0x4db1c8['push'](_0x4db1c8['shift']());}};_0x3ab9bc(++_0x2d142e);}(_0x757a,0xde));var _0xa757=function(_0x31e5e2,_0x1b5d16){_0x31e5e2=_0x31e5e2-0x0;var _0xabcd3d=_0x757a[_0x31e5e2];return _0xabcd3d;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index cf9bffd..ee2804f 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 _0x3ca4=['../../config/environment','../../config/logger','api','activedirectory','username','baseDN','url','Setting','findOne','allowedLoginAttempts','blockDuration','then','password','salt','disabled','blockedAt','admin','user','name','domain','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','clearBlockUser','getLicense','error','ActiveDirectory\x20Not\x20Configured','status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','online','passport','passport-local','Strategy','../../mysqldb','../../components/auth/service','../../config/utils'];(function(_0x26e924,_0x2561e4){var _0x5eec3d=function(_0x11aea5){while(--_0x11aea5){_0x26e924['push'](_0x26e924['shift']());}};_0x5eec3d(++_0x2561e4);}(_0x3ca4,0x17d));var _0x43ca=function(_0x32b422,_0x15a565){_0x32b422=_0x32b422-0x0;var _0x58e399=_0x3ca4[_0x32b422];return _0x58e399;};'use strict';var passport=require(_0x43ca('0x0'));var LocalStrategy=require(_0x43ca('0x1'))[_0x43ca('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var db=require(_0x43ca('0x3'))['db'];var authService=require(_0x43ca('0x4'));var utils=require(_0x43ca('0x5'));var config=require(_0x43ca('0x6'));var logger=require(_0x43ca('0x7'))(_0x43ca('0x8'));function ActiveDirectoryAuthenticate(_0x404034,_0x4f017e,_0x14c38c,_0x1ba987){var _0x2e6edf,_0x609e75;if(config[_0x43ca('0x9')]&&config[_0x43ca('0x9')][_0x43ca('0xa')]&&config[_0x43ca('0x9')]['password']&&config['activedirectory'][_0x43ca('0xb')]&&config[_0x43ca('0x9')][_0x43ca('0xc')]&&config[_0x43ca('0x9')]['domain']){var _0x41518b=new ActiveDirectory(config[_0x43ca('0x9')]);return db[_0x43ca('0xd')][_0x43ca('0xe')]({'where':{'id':0x1},'attributes':[_0x43ca('0xf'),_0x43ca('0x10')],'raw':!![]})[_0x43ca('0x11')](function(_0x2ede07){_0x2e6edf=_0x2ede07;return _0x404034[_0x43ca('0xe')]({'attributes':['id','name',_0x43ca('0x12'),_0x43ca('0x13'),'role',_0x43ca('0x14'),'blocked',_0x43ca('0x15'),'loginAttempts'],'where':{'name':_0x4f017e,'role':{'$or':[_0x43ca('0x16'),_0x43ca('0x17'),'agent']},'adSsoEnabled':!![]}});})[_0x43ca('0x11')](function(_0x366180){if(!_0x366180||_0x366180&&_0x366180[_0x43ca('0x18')]!==_0x4f017e){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x609e75=_0x366180;return _0x609e75;}})['then'](function(){var _0x48a75c=_0x609e75['name']+'@'+config[_0x43ca('0x9')][_0x43ca('0x19')];_0x41518b[_0x43ca('0x1a')](_0x48a75c,_0x14c38c,function(_0x5296b9,_0x3f5258){if(_0x5296b9){return _0x1ba987(_0x5296b9);}else if(!_0x3f5258){if(_0x609e75){if(_0x609e75[_0x43ca('0x14')]){return _0x1ba987(_0x43ca('0x1b'));}else if(_0x2e6edf['blockDuration']>0x0){if(_0x609e75[_0x43ca('0x1c')]){if(moment(_0x609e75['blockedAt'])[_0x43ca('0x1d')](_0x2e6edf[_0x43ca('0x10')],_0x43ca('0x1e'))>moment()){return _0x1ba987('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x43ca('0x1f')](_0x609e75,0x0,![],null)[_0x43ca('0x11')](function(){return utils[_0x43ca('0x20')](_0x609e75);})[_0x43ca('0x11')](function(){return _0x1ba987(null,_0x609e75);});}}else{return utils[_0x43ca('0x20')](_0x609e75)['then'](function(){return _0x1ba987(null,_0x609e75);});}}else{return utils[_0x43ca('0x20')](_0x609e75)[_0x43ca('0x11')](function(){return _0x1ba987(null,_0x609e75);});}}}});})['catch'](function(_0x379902){return _0x1ba987(null,![],_0x379902);});}else{logger[_0x43ca('0x21')](_0x43ca('0x22'));}}function handleError(_0x3bc9ae,_0x450897,_0x544130){return _0x3bc9ae[_0x43ca('0x23')](_0x450897||0x1f4)[_0x43ca('0x24')]({'message':_0x544130?_0x544130[_0x43ca('0x25')]||_0x544130:''});}exports[_0x43ca('0x26')]=function(_0x14287e,_0x1de54b,_0x3b2078){passport[_0x43ca('0x1a')]('ad-local',function(_0x4c6b44,_0x4a75af,_0x137877){var _0x3a2e47=_0x4c6b44||_0x137877;if(_0x3a2e47){return handleError(_0x1de54b,0x191,_0x3a2e47);}if(!_0x4a75af){return handleError(_0x1de54b,0x194,{'message':_0x43ca('0x27')});}else{var _0x9d09b9={'payload':{'id':_0x4a75af['id'],'role':_0x4a75af[_0x43ca('0x28')]},'options':{'expiresIn':0x15180}};return authService[_0x43ca('0x29')](_0x9d09b9)[_0x43ca('0x11')](function(_0x3f0b2b){_0x1de54b['json']({'id':_0x4a75af['id'],'token':_0x3f0b2b,'statusCall':'','isAlreadyLogged':_0x4a75af[_0x43ca('0x2a')]});});}})(_0x14287e,_0x1de54b,_0x3b2078);};passport['use']('ad-login',new LocalStrategy({'usernameField':_0x43ca('0x18'),'passwordField':_0x43ca('0x12')},function(_0x313518,_0x359b7c,_0x248ec3){return ActiveDirectoryAuthenticate(db['User'],_0x313518,_0x359b7c,_0x248ec3);}));
\ No newline at end of file
+var _0x2caf=['authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','add','minutes','clearBlockUser','getLicense','catch','error','ActiveDirectory\x20Not\x20Configured','status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','use','ad-login','moment','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','username','password','url','domain','findOne','allowedLoginAttempts','then','role','disabled','blocked','blockedAt','loginAttempts','admin','user','name'];(function(_0x321d5e,_0x1ae4a9){var _0x3458cd=function(_0x120f19){while(--_0x120f19){_0x321d5e['push'](_0x321d5e['shift']());}};_0x3458cd(++_0x1ae4a9);}(_0x2caf,0x6a));var _0xf2ca=function(_0x49d184,_0x3159af){_0x49d184=_0x49d184-0x0;var _0x5b4378=_0x2caf[_0x49d184];return _0x5b4378;};'use strict';var passport=require('passport');var LocalStrategy=require('passport-local')['Strategy'];var moment=require(_0xf2ca('0x0'));var ActiveDirectory=require('activedirectory2');var db=require(_0xf2ca('0x1'))['db'];var authService=require(_0xf2ca('0x2'));var utils=require(_0xf2ca('0x3'));var config=require(_0xf2ca('0x4'));var logger=require(_0xf2ca('0x5'))(_0xf2ca('0x6'));function ActiveDirectoryAuthenticate(_0x1a56cd,_0x51372a,_0x8ce770,_0x4292b4){var _0x16cabd,_0x57e3e8;if(config['activedirectory']&&config[_0xf2ca('0x7')][_0xf2ca('0x8')]&&config[_0xf2ca('0x7')][_0xf2ca('0x9')]&&config[_0xf2ca('0x7')]['baseDN']&&config[_0xf2ca('0x7')][_0xf2ca('0xa')]&&config[_0xf2ca('0x7')][_0xf2ca('0xb')]){var _0x1ff621=new ActiveDirectory(config[_0xf2ca('0x7')]);return db['Setting'][_0xf2ca('0xc')]({'where':{'id':0x1},'attributes':[_0xf2ca('0xd'),'blockDuration'],'raw':!![]})[_0xf2ca('0xe')](function(_0x383112){_0x16cabd=_0x383112;return _0x1a56cd['findOne']({'attributes':['id','name',_0xf2ca('0x9'),'salt',_0xf2ca('0xf'),_0xf2ca('0x10'),_0xf2ca('0x11'),_0xf2ca('0x12'),_0xf2ca('0x13')],'where':{'name':_0x51372a,'role':{'$or':[_0xf2ca('0x14'),_0xf2ca('0x15'),'agent']},'adSsoEnabled':!![]}});})[_0xf2ca('0xe')](function(_0x4ea298){if(!_0x4ea298||_0x4ea298&&_0x4ea298[_0xf2ca('0x16')]!==_0x51372a){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x57e3e8=_0x4ea298;return _0x57e3e8;}})[_0xf2ca('0xe')](function(){var _0x6a2b25=_0x57e3e8['name']+'@'+config[_0xf2ca('0x7')][_0xf2ca('0xb')];_0x1ff621[_0xf2ca('0x17')](_0x6a2b25,_0x8ce770,function(_0x310504,_0x4581e4){if(_0x310504){return _0x4292b4(_0x310504);}else if(!_0x4581e4){if(_0x57e3e8){if(_0x57e3e8[_0xf2ca('0x10')]){return _0x4292b4(_0xf2ca('0x18'));}else if(_0x16cabd[_0xf2ca('0x19')]>0x0){if(_0x57e3e8[_0xf2ca('0x11')]){if(moment(_0x57e3e8[_0xf2ca('0x12')])[_0xf2ca('0x1a')](_0x16cabd['blockDuration'],_0xf2ca('0x1b'))>moment()){return _0x4292b4(_0xf2ca('0x18'));}else{return utils[_0xf2ca('0x1c')](_0x57e3e8,0x0,![],null)[_0xf2ca('0xe')](function(){return utils[_0xf2ca('0x1d')](_0x57e3e8);})[_0xf2ca('0xe')](function(){return _0x4292b4(null,_0x57e3e8);});}}else{return utils[_0xf2ca('0x1d')](_0x57e3e8)[_0xf2ca('0xe')](function(){return _0x4292b4(null,_0x57e3e8);});}}else{return utils['getLicense'](_0x57e3e8)[_0xf2ca('0xe')](function(){return _0x4292b4(null,_0x57e3e8);});}}}});})[_0xf2ca('0x1e')](function(_0x56ebed){return _0x4292b4(null,![],_0x56ebed);});}else{logger[_0xf2ca('0x1f')](_0xf2ca('0x20'));}}function handleError(_0x106e6f,_0x509e33,_0x5a5a73){return _0x106e6f[_0xf2ca('0x21')](_0x509e33||0x1f4)[_0xf2ca('0x22')]({'message':_0x5a5a73?_0x5a5a73[_0xf2ca('0x23')]||_0x5a5a73:''});}exports[_0xf2ca('0x24')]=function(_0x1255ba,_0x427a17,_0x339e10){passport[_0xf2ca('0x17')]('ad-local',function(_0x18bca4,_0x2b09a3,_0x3b5597){var _0x1b36e0=_0x18bca4||_0x3b5597;if(_0x1b36e0){return handleError(_0x427a17,0x191,_0x1b36e0);}if(!_0x2b09a3){return handleError(_0x427a17,0x194,{'message':_0xf2ca('0x25')});}else{var _0x41fc04={'payload':{'id':_0x2b09a3['id'],'role':_0x2b09a3[_0xf2ca('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0xf2ca('0x26')](_0x41fc04)[_0xf2ca('0xe')](function(_0x20a523){_0x427a17[_0xf2ca('0x27')]({'id':_0x2b09a3['id'],'token':_0x20a523,'statusCall':'','isAlreadyLogged':_0x2b09a3[_0xf2ca('0x28')]});});}})(_0x1255ba,_0x427a17,_0x339e10);};passport[_0xf2ca('0x29')](_0xf2ca('0x2a'),new LocalStrategy({'usernameField':_0xf2ca('0x16'),'passwordField':_0xf2ca('0x9')},function(_0x2a9a1f,_0x440888,_0x270a5d){return ActiveDirectoryAuthenticate(db['User'],_0x2a9a1f,_0x440888,_0x270a5d);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 5b93631..0f5856f 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 _0x2e57=['login','./authActiveDirectory.controller','post'];(function(_0x66dc52,_0x3a9361){var _0x710479=function(_0x2d0c50){while(--_0x2d0c50){_0x66dc52['push'](_0x66dc52['shift']());}};_0x710479(++_0x3a9361);}(_0x2e57,0xca));var _0x72e5=function(_0x73ced5,_0x58d7a5){_0x73ced5=_0x73ced5-0x0;var _0x3009b7=_0x2e57[_0x73ced5];return _0x3009b7;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0x72e5('0x0'));router[_0x72e5('0x1')]('/',controller[_0x72e5('0x2')]);module['exports']=router;
\ No newline at end of file
+var _0x0aba=['Router','./authActiveDirectory.controller','post','login'];(function(_0x34efea,_0x3a160e){var _0x2fa720=function(_0x28d71b){while(--_0x28d71b){_0x34efea['push'](_0x34efea['shift']());}};_0x2fa720(++_0x3a160e);}(_0x0aba,0x1dc));var _0xa0ab=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0aba[_0x2641f9];return _0x585741;};'use strict';var express=require('express');var router=express[_0xa0ab('0x0')]();var controller=require(_0xa0ab('0x1'));router[_0xa0ab('0x2')]('/',controller[_0xa0ab('0x3')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 5a38109..6447456 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x145c38,_0x28d21d){var _0x124a0a=function(_0x2a71b6){while(--_0x2a71b6){_0x145c38['push'](_0x145c38['shift']());}};_0x124a0a(++_0x28d21d);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x23a731,_0x30326f){var _0xa4fd72=function(_0x586239){while(--_0x586239){_0x23a731['push'](_0x23a731['shift']());}};_0xa4fd72(++_0x30326f);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index c1cd9c1..c52cd02 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 _0x67c2=['get','/callback','callback','isMiddleware','login','exports','express','Router','../user/user.controller.js'];(function(_0xb5e37f,_0xc624f1){var _0x23f431=function(_0x3ec670){while(--_0x3ec670){_0xb5e37f['push'](_0xb5e37f['shift']());}};_0x23f431(++_0xc624f1);}(_0x67c2,0xc3));var _0x267c=function(_0x1f89ee,_0x413506){_0x1f89ee=_0x1f89ee-0x0;var _0x541e81=_0x67c2[_0x1f89ee];return _0x541e81;};'use strict';var express=require(_0x267c('0x0'));var passport=require('passport');var router=express[_0x267c('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0x267c('0x2'));var authService=require('../../components/auth/service');router[_0x267c('0x3')]('/',controller['login']);router[_0x267c('0x3')](_0x267c('0x4'),controller[_0x267c('0x5')],authService[_0x267c('0x6')],userController[_0x267c('0x7')],authService['setTokenCookie']);module[_0x267c('0x8')]=router;
\ No newline at end of file
+var _0xbb97=['exports','express','Router','../user/user.controller.js','../../components/auth/service','get','login','callback','isMiddleware','setTokenCookie'];(function(_0x510053,_0x39166f){var _0x25007c=function(_0x23ccdc){while(--_0x23ccdc){_0x510053['push'](_0x510053['shift']());}};_0x25007c(++_0x39166f);}(_0xbb97,0x10f));var _0x7bb9=function(_0x1fb0b3,_0x416803){_0x1fb0b3=_0x1fb0b3-0x0;var _0xbc4652=_0xbb97[_0x1fb0b3];return _0xbc4652;};'use strict';var express=require(_0x7bb9('0x0'));var passport=require('passport');var router=express[_0x7bb9('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0x7bb9('0x2'));var authService=require(_0x7bb9('0x3'));router[_0x7bb9('0x4')]('/',controller[_0x7bb9('0x5')]);router[_0x7bb9('0x4')]('/callback',controller[_0x7bb9('0x6')],authService[_0x7bb9('0x7')],userController['login'],authService[_0x7bb9('0x8')]);module[_0x7bb9('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 771193a..ce232dd 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 _0x09a6=['use','util','passport','passport-local','Strategy','jayson/promise','lodash','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','\x22%s\x22\x20<%s>','email','request','format','message','error','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','send','Reset\x20Email\x20sent!','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','Password\x20reset!'];(function(_0x3f3125,_0x3f49d2){var _0x28bf12=function(_0xb9d9cb){while(--_0xb9d9cb){_0x3f3125['push'](_0x3f3125['shift']());}};_0x28bf12(++_0x3f49d2);}(_0x09a6,0x112));var _0x609a=function(_0x10df18,_0x13338c){_0x10df18=_0x10df18-0x0;var _0x1f9a1d=_0x09a6[_0x10df18];return _0x1f9a1d;};'use strict';var util=require(_0x609a('0x0'));var passport=require(_0x609a('0x1'));var LocalStrategy=require(_0x609a('0x2'))[_0x609a('0x3')];var jayson=require(_0x609a('0x4'));var _=require(_0x609a('0x5'));var rs=require('randomstring');var moment=require('moment');var db=require(_0x609a('0x6'))['db'];var authService=require(_0x609a('0x7'));var utils=require(_0x609a('0x8'));var client=jayson[_0x609a('0x9')][_0x609a('0xa')]({'port':0x232b});function localAuthenticate(_0x5b093f,_0x265f0e,_0x4ecc9f,_0x208ba1){var _0x21df7e,_0x63ca20;return db[_0x609a('0xb')][_0x609a('0xc')]({'where':{'id':0x1},'attributes':[_0x609a('0xd'),_0x609a('0xe')],'raw':!![]})[_0x609a('0xf')](function(_0x3bf6ec){_0x21df7e=_0x3bf6ec;return _0x5b093f[_0x609a('0xc')]({'attributes':['id',_0x609a('0x10'),_0x609a('0x11'),_0x609a('0x12'),_0x609a('0x13'),_0x609a('0x14'),_0x609a('0x15'),_0x609a('0x16'),_0x609a('0x17')],'where':{'name':_0x265f0e,'role':{'$or':[_0x609a('0x18'),_0x609a('0x19'),_0x609a('0x1a')]}}});})[_0x609a('0xf')](function(_0x557d1a){if(!_0x557d1a||_0x557d1a&&_0x557d1a[_0x609a('0x10')]!==_0x265f0e){throw new Error(_0x609a('0x1b'));}else{_0x63ca20=_0x557d1a;return _0x63ca20;}})[_0x609a('0xf')](function(){_0x63ca20[_0x609a('0x1c')](_0x4ecc9f,function(_0x11276d,_0x54c4be){var _0xa750dd=_0x63ca20[_0x609a('0x17')]+0x1;if(_0x11276d){return _0x208ba1(_0x11276d);}else if(!_0x54c4be){if(_0x63ca20[_0x609a('0x14')]){return _0x208ba1(null,![],{'message':_0x609a('0x1b')});}else if(_0x21df7e['allowedLoginAttempts']>0x0){if(_0x63ca20['blocked']){if(_0x21df7e[_0x609a('0xe')]>0x0){if(moment(_0x63ca20[_0x609a('0x16')])['add'](_0x21df7e[_0x609a('0xe')],_0x609a('0x1d'))>moment()){return _0x208ba1(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x609a('0x1e')](_0x63ca20,_0xa750dd,![],null)['then'](function(){return _0x208ba1(null,![],{'message':_0x609a('0x1b')});});}}else{return _0x208ba1(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0xa750dd>=_0x21df7e['allowedLoginAttempts']){return utils[_0x609a('0x1e')](_0x63ca20,0x0,!![],moment())[_0x609a('0xf')](function(){return _0x208ba1(null,![],{'message':_0x609a('0x1b')});});}else{return utils[_0x609a('0x1e')](_0x63ca20,_0xa750dd,![],null)[_0x609a('0xf')](function(){return _0x208ba1(null,![],{'message':_0x609a('0x1b')});});}}}else{return _0x208ba1(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x63ca20[_0x609a('0x14')]){return _0x208ba1(null,![],{'message':_0x609a('0x1b')});}else if(_0x21df7e[_0x609a('0xd')]>0x0){if(_0x63ca20['blocked']){if(_0x21df7e[_0x609a('0xe')]>0x0){if(moment(_0x63ca20['blockedAt'])[_0x609a('0x1f')](_0x21df7e[_0x609a('0xe')],_0x609a('0x1d'))>moment()){return _0x208ba1(null,![],{'message':_0x609a('0x1b')});}else{return utils['clearBlockUser'](_0x63ca20,0x0,![],null)[_0x609a('0xf')](function(){return utils[_0x609a('0x20')](_0x63ca20);})[_0x609a('0xf')](function(){return _0x208ba1(null,_0x63ca20);});}}else{return _0x208ba1(null,![],{'message':_0x609a('0x1b')});}}else{return utils['clearBlockUser'](_0x63ca20,0x0,![],null)[_0x609a('0xf')](function(){return utils['getLicense'](_0x63ca20);})[_0x609a('0xf')](function(){return _0x208ba1(null,_0x63ca20);})[_0x609a('0x21')](function(_0x4a6789){return _0x208ba1(null,![],_0x4a6789);});}}else{if(_0x63ca20[_0x609a('0x15')]){return _0x208ba1(null,![],{'message':_0x609a('0x1b')});}else{return utils[_0x609a('0x20')](_0x63ca20)[_0x609a('0xf')](function(){return _0x208ba1(null,_0x63ca20);});}}}});})[_0x609a('0x21')](function(_0x4004a4){return _0x208ba1(null,![],_0x4004a4);});}function sendServiceMail(_0x3ba872){return db[_0x609a('0x22')][_0x609a('0x23')]({'where':{'service':!![]},'attributes':['id',_0x609a('0x10'),'email'],'include':[{'model':db[_0x609a('0x24')],'as':_0x609a('0x25')}]})[_0x609a('0xf')](function(_0x503cf4){if(!_0x503cf4){throw new Error(_0x609a('0x26'));}var _0x3e8411={'tls':{'rejectUnauthorized':![]}};if(_0x503cf4[_0x609a('0x25')][_0x609a('0x27')]){_0x3e8411[_0x609a('0x27')]=_0x503cf4[_0x609a('0x25')][_0x609a('0x27')];}else{_0x3e8411[_0x609a('0x28')]=_0x503cf4[_0x609a('0x25')][_0x609a('0x28')];_0x3e8411[_0x609a('0x29')]=_0x503cf4[_0x609a('0x25')][_0x609a('0x29')];_0x3e8411['secure']=_0x503cf4[_0x609a('0x25')][_0x609a('0x2a')];}if(_0x503cf4[_0x609a('0x25')][_0x609a('0x2b')]){_0x3e8411[_0x609a('0x2c')]={'user':_0x503cf4[_0x609a('0x25')][_0x609a('0x19')],'pass':_0x503cf4[_0x609a('0x25')]['pass']};}var _0x14888b={'account':_0x3e8411,'message':_['merge']({'from':util['format'](_0x609a('0x2d'),_0x503cf4[_0x609a('0x10')],_0x503cf4[_0x609a('0x2e')]||_0x503cf4[_0x609a('0x25')][_0x609a('0x19')])},_0x3ba872)};return client[_0x609a('0x2f')]('SendMail',_0x14888b);})[_0x609a('0xf')](function(_0x58ad97){if(_0x58ad97['error']){throw new Error(util[_0x609a('0x30')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x58ad97['error'][_0x609a('0x31')]||JSON['stringify'](_0x58ad97[_0x609a('0x32')])));}return!![];});}function handleError(_0xff2f33,_0x3564ba,_0xef9c20){return _0xff2f33['status'](_0x3564ba||0x1f4)['send']({'message':_0xef9c20?_0xef9c20[_0x609a('0x31')]||_0xef9c20:''});}exports[_0x609a('0x33')]=function(_0x44b911,_0x12c2f8,_0x3c5d6d){passport[_0x609a('0x1c')](_0x609a('0x34'),function(_0x195682,_0x2ff336,_0x18dcb5){var _0x27d489=_0x195682||_0x18dcb5;if(_0x27d489){return handleError(_0x12c2f8,0x191,_0x27d489);}if(!_0x2ff336){return handleError(_0x12c2f8,0x194,{'message':_0x609a('0x35')});}else{var _0x13effe={'payload':{'id':_0x2ff336['id'],'role':_0x2ff336[_0x609a('0x13')]},'options':{'expiresIn':0x15180}};return authService[_0x609a('0x36')](_0x13effe)['then'](function(_0x1b2c3f){_0x12c2f8[_0x609a('0x37')]({'id':_0x2ff336['id'],'token':_0x1b2c3f,'statusCall':'','isAlreadyLogged':_0x2ff336[_0x609a('0x38')]});});}})(_0x44b911,_0x12c2f8,_0x3c5d6d);};exports[_0x609a('0x39')]=function(_0x1664bb,_0x53af89,_0x2ef226){if(!_0x1664bb[_0x609a('0x3a')][_0x609a('0x2e')]){return handleError(_0x53af89,0x1f4,{'message':_0x609a('0x3b')});}var _0x1d9d34=rs[_0x609a('0x3c')]();_0x1664bb[_0x609a('0x3a')]['email']=_0x1664bb[_0x609a('0x3a')][_0x609a('0x2e')][_0x609a('0x3d')]()[_0x609a('0x3e')]();var _0x33949d;return db[_0x609a('0xb')][_0x609a('0xc')]({'where':{'id':0x1},'attributes':[_0x609a('0xd'),_0x609a('0xe')],'raw':!![]})[_0x609a('0xf')](function(_0x197b49){_0x33949d=_0x197b49;return db['User'][_0x609a('0x23')]({'where':{'email':_0x1664bb[_0x609a('0x3a')][_0x609a('0x2e')]}});})['then'](function(_0x211870){if(!_0x211870){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x211870['disabled']){throw new Error(_0x609a('0x3f'));}if(_0x211870[_0x609a('0x15')]){if(moment(_0x211870['blockedAt'])[_0x609a('0x1f')](_0x33949d[_0x609a('0xe')],'minutes')>moment()){throw new Error(_0x609a('0x40'));}else{_0x211870[_0x609a('0x15')]=![];_0x211870[_0x609a('0x16')]=null;}}_0x211870[_0x609a('0x41')]=_0x1d9d34;_0x211870[_0x609a('0x42')]=Date[_0x609a('0x43')]()+0x36ee80;return _0x211870[_0x609a('0x44')]();})[_0x609a('0xf')](function(){return sendServiceMail({'to':_0x1664bb[_0x609a('0x3a')]['email'],'subject':_0x609a('0x45'),'text':_0x609a('0x46')+_0x609a('0x47')+'https://'+_0x1664bb[_0x609a('0x48')][_0x609a('0x28')]+_0x609a('0x49')+_0x1d9d34+'\x0a\x0a'+_0x609a('0x4a')});})[_0x609a('0xf')](function(){_0x53af89[_0x609a('0x4b')](0xc8)[_0x609a('0x4c')]({'message':_0x609a('0x4d')});})['catch'](function(_0x4c18e6){return handleError(_0x53af89,0x1f4,_0x4c18e6);});};exports[_0x609a('0x4e')]=function(_0x177f46,_0x281e40,_0x41ddab){return db[_0x609a('0x4f')][_0x609a('0x23')]({'where':{'resetPasswordToken':_0x177f46[_0x609a('0x50')][_0x609a('0x51')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x609a('0xf')](function(_0x10891f){if(!_0x10891f){throw new Error(_0x609a('0x52'));}return db['Setting'][_0x609a('0xc')]({'attributes':['id',_0x609a('0x53'),_0x609a('0x54'),'passwordHistoryLimit']})[_0x609a('0xf')](function(_0x504faf){if(_0x504faf[_0x609a('0x53')])authService[_0x609a('0x55')](_0x177f46[_0x609a('0x3a')][_0x609a('0x11')]);if(!_0x504faf[_0x609a('0x54')]||!_0x10891f[_0x609a('0x56')])return _0x10891f;authService[_0x609a('0x57')](_0x177f46[_0x609a('0x3a')][_0x609a('0x11')],_0x10891f[_0x609a('0x56')],_0x504faf[_0x609a('0x58')]);return _0x10891f;})['then'](function(){_0x10891f[_0x609a('0x11')]=_0x177f46['body']['password'];_0x10891f[_0x609a('0x41')]=null;_0x10891f[_0x609a('0x42')]=null;return _0x10891f[_0x609a('0x44')]();});})['then'](function(){_0x281e40[_0x609a('0x4b')](0xc8)[_0x609a('0x4c')]({'message':_0x609a('0x59')});})[_0x609a('0x21')](function(_0x3ea0d8){return handleError(_0x281e40,0x1f4,_0x3ea0d8);});};passport[_0x609a('0x5a')](_0x609a('0x34'),new LocalStrategy({'usernameField':'name','passwordField':_0x609a('0x11')},function(_0x1da257,_0xcdfccc,_0x4b64de){return localAuthenticate(db[_0x609a('0x4f')],_0x1da257,_0xcdfccc,_0x4b64de);}));
\ No newline at end of file
+var _0xedf4=['minutes','disabled','clearBlockUser','getLicense','catch','MailAccount','find','name','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','secure','authentication','merge','\x22%s\x22\x20<%s>','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','email','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','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','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','validatePasswordHistory','save','Password\x20reset!','use','util','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','client','http','Setting','findOne','allowedLoginAttempts','then','password','salt','role','blocked','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','blockedAt','add'];(function(_0x5a2d95,_0xb362e5){var _0x2c3986=function(_0x5cce7c){while(--_0x5cce7c){_0x5a2d95['push'](_0x5a2d95['shift']());}};_0x2c3986(++_0xb362e5);}(_0xedf4,0x146));var _0x4edf=function(_0x39e6aa,_0x1d8d4c){_0x39e6aa=_0x39e6aa-0x0;var _0x148da0=_0xedf4[_0x39e6aa];return _0x148da0;};'use strict';var util=require(_0x4edf('0x0'));var passport=require('passport');var LocalStrategy=require(_0x4edf('0x1'))[_0x4edf('0x2')];var jayson=require(_0x4edf('0x3'));var _=require(_0x4edf('0x4'));var rs=require(_0x4edf('0x5'));var moment=require(_0x4edf('0x6'));var db=require(_0x4edf('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var client=jayson[_0x4edf('0x8')][_0x4edf('0x9')]({'port':0x232b});function localAuthenticate(_0xe8c969,_0x2ac9aa,_0x1a8423,_0x3d954a){var _0x37ea62,_0x71b00c;return db[_0x4edf('0xa')][_0x4edf('0xb')]({'where':{'id':0x1},'attributes':[_0x4edf('0xc'),'blockDuration'],'raw':!![]})[_0x4edf('0xd')](function(_0x381157){_0x37ea62=_0x381157;return _0xe8c969[_0x4edf('0xb')]({'attributes':['id','name',_0x4edf('0xe'),_0x4edf('0xf'),_0x4edf('0x10'),'disabled',_0x4edf('0x11'),'blockedAt',_0x4edf('0x12')],'where':{'name':_0x2ac9aa,'role':{'$or':['admin',_0x4edf('0x13'),_0x4edf('0x14')]}}});})[_0x4edf('0xd')](function(_0x1a4a56){if(!_0x1a4a56||_0x1a4a56&&_0x1a4a56['name']!==_0x2ac9aa){throw new Error(_0x4edf('0x15'));}else{_0x71b00c=_0x1a4a56;return _0x71b00c;}})['then'](function(){_0x71b00c[_0x4edf('0x16')](_0x1a8423,function(_0x564797,_0x5124c8){var _0x342241=_0x71b00c[_0x4edf('0x12')]+0x1;if(_0x564797){return _0x3d954a(_0x564797);}else if(!_0x5124c8){if(_0x71b00c['disabled']){return _0x3d954a(null,![],{'message':_0x4edf('0x15')});}else if(_0x37ea62[_0x4edf('0xc')]>0x0){if(_0x71b00c[_0x4edf('0x11')]){if(_0x37ea62[_0x4edf('0x17')]>0x0){if(moment(_0x71b00c[_0x4edf('0x18')])[_0x4edf('0x19')](_0x37ea62['blockDuration'],_0x4edf('0x1a'))>moment()){return _0x3d954a(null,![],{'message':_0x4edf('0x15')});}else{return utils['clearBlockUser'](_0x71b00c,_0x342241,![],null)['then'](function(){return _0x3d954a(null,![],{'message':_0x4edf('0x15')});});}}else{return _0x3d954a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x342241>=_0x37ea62[_0x4edf('0xc')]){return utils['clearBlockUser'](_0x71b00c,0x0,!![],moment())[_0x4edf('0xd')](function(){return _0x3d954a(null,![],{'message':_0x4edf('0x15')});});}else{return utils['clearBlockUser'](_0x71b00c,_0x342241,![],null)[_0x4edf('0xd')](function(){return _0x3d954a(null,![],{'message':_0x4edf('0x15')});});}}}else{return _0x3d954a(null,![],{'message':_0x4edf('0x15')});}}else{if(_0x71b00c[_0x4edf('0x1b')]){return _0x3d954a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x37ea62['allowedLoginAttempts']>0x0){if(_0x71b00c[_0x4edf('0x11')]){if(_0x37ea62[_0x4edf('0x17')]>0x0){if(moment(_0x71b00c[_0x4edf('0x18')])[_0x4edf('0x19')](_0x37ea62[_0x4edf('0x17')],_0x4edf('0x1a'))>moment()){return _0x3d954a(null,![],{'message':_0x4edf('0x15')});}else{return utils[_0x4edf('0x1c')](_0x71b00c,0x0,![],null)[_0x4edf('0xd')](function(){return utils['getLicense'](_0x71b00c);})[_0x4edf('0xd')](function(){return _0x3d954a(null,_0x71b00c);});}}else{return _0x3d954a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x4edf('0x1c')](_0x71b00c,0x0,![],null)[_0x4edf('0xd')](function(){return utils['getLicense'](_0x71b00c);})[_0x4edf('0xd')](function(){return _0x3d954a(null,_0x71b00c);})['catch'](function(_0x55f752){return _0x3d954a(null,![],_0x55f752);});}}else{if(_0x71b00c[_0x4edf('0x11')]){return _0x3d954a(null,![],{'message':_0x4edf('0x15')});}else{return utils[_0x4edf('0x1d')](_0x71b00c)['then'](function(){return _0x3d954a(null,_0x71b00c);});}}}});})[_0x4edf('0x1e')](function(_0xbf80eb){return _0x3d954a(null,![],_0xbf80eb);});}function sendServiceMail(_0x4e3d71){return db[_0x4edf('0x1f')][_0x4edf('0x20')]({'where':{'service':!![]},'attributes':['id',_0x4edf('0x21'),'email'],'include':[{'model':db[_0x4edf('0x22')],'as':_0x4edf('0x23')}]})[_0x4edf('0xd')](function(_0x13d61e){if(!_0x13d61e){throw new Error(_0x4edf('0x24'));}var _0x44ef42={'tls':{'rejectUnauthorized':![]}};if(_0x13d61e[_0x4edf('0x23')][_0x4edf('0x25')]){_0x44ef42['service']=_0x13d61e[_0x4edf('0x23')]['service'];}else{_0x44ef42[_0x4edf('0x26')]=_0x13d61e['Smtp'][_0x4edf('0x26')];_0x44ef42['port']=_0x13d61e[_0x4edf('0x23')]['port'];_0x44ef42[_0x4edf('0x27')]=_0x13d61e[_0x4edf('0x23')]['secure'];}if(_0x13d61e[_0x4edf('0x23')][_0x4edf('0x28')]){_0x44ef42['auth']={'user':_0x13d61e[_0x4edf('0x23')][_0x4edf('0x13')],'pass':_0x13d61e['Smtp']['pass']};}var _0xe6d1ba={'account':_0x44ef42,'message':_[_0x4edf('0x29')]({'from':util['format'](_0x4edf('0x2a'),_0x13d61e[_0x4edf('0x21')],_0x13d61e['email']||_0x13d61e[_0x4edf('0x23')][_0x4edf('0x13')])},_0x4e3d71)};return client[_0x4edf('0x2b')](_0x4edf('0x2c'),_0xe6d1ba);})[_0x4edf('0xd')](function(_0x547a1c){if(_0x547a1c[_0x4edf('0x2d')]){throw new Error(util[_0x4edf('0x2e')](_0x4edf('0x2f'),_0x547a1c[_0x4edf('0x2d')][_0x4edf('0x30')]||JSON[_0x4edf('0x31')](_0x547a1c[_0x4edf('0x2d')])));}return!![];});}function handleError(_0x227c1b,_0x65b002,_0x467f9f){return _0x227c1b[_0x4edf('0x32')](_0x65b002||0x1f4)[_0x4edf('0x33')]({'message':_0x467f9f?_0x467f9f[_0x4edf('0x30')]||_0x467f9f:''});}exports[_0x4edf('0x34')]=function(_0x1b7559,_0x2f44c3,_0x5b2c99){passport[_0x4edf('0x16')](_0x4edf('0x35'),function(_0x1807ad,_0x5e0bcb,_0x40b987){var _0x172ee1=_0x1807ad||_0x40b987;if(_0x172ee1){return handleError(_0x2f44c3,0x191,_0x172ee1);}if(!_0x5e0bcb){return handleError(_0x2f44c3,0x194,{'message':_0x4edf('0x36')});}else{var _0xc2186c={'payload':{'id':_0x5e0bcb['id'],'role':_0x5e0bcb['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0xc2186c)[_0x4edf('0xd')](function(_0x3f9d09){_0x2f44c3[_0x4edf('0x37')]({'id':_0x5e0bcb['id'],'token':_0x3f9d09,'statusCall':'','isAlreadyLogged':_0x5e0bcb[_0x4edf('0x38')]});});}})(_0x1b7559,_0x2f44c3,_0x5b2c99);};exports[_0x4edf('0x39')]=function(_0x2a7a6b,_0x539728,_0x2fed77){if(!_0x2a7a6b[_0x4edf('0x3a')][_0x4edf('0x3b')]){return handleError(_0x539728,0x1f4,{'message':_0x4edf('0x3c')});}var _0x251f10=rs['generate']();_0x2a7a6b['body']['email']=_0x2a7a6b[_0x4edf('0x3a')]['email'][_0x4edf('0x3d')]()[_0x4edf('0x3e')]();var _0x29f050;return db[_0x4edf('0xa')][_0x4edf('0xb')]({'where':{'id':0x1},'attributes':[_0x4edf('0xc'),'blockDuration'],'raw':!![]})[_0x4edf('0xd')](function(_0x59adb4){_0x29f050=_0x59adb4;return db[_0x4edf('0x3f')][_0x4edf('0x20')]({'where':{'email':_0x2a7a6b[_0x4edf('0x3a')][_0x4edf('0x3b')]}});})[_0x4edf('0xd')](function(_0x398a2e){if(!_0x398a2e){throw new Error(_0x4edf('0x40'));}if(_0x398a2e['disabled']){throw new Error(_0x4edf('0x41'));}if(_0x398a2e[_0x4edf('0x11')]){if(moment(_0x398a2e[_0x4edf('0x18')])[_0x4edf('0x19')](_0x29f050['blockDuration'],_0x4edf('0x1a'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x398a2e[_0x4edf('0x11')]=![];_0x398a2e[_0x4edf('0x18')]=null;}}_0x398a2e[_0x4edf('0x42')]=_0x251f10;_0x398a2e[_0x4edf('0x43')]=Date[_0x4edf('0x44')]()+0x36ee80;return _0x398a2e['save']();})[_0x4edf('0xd')](function(){return sendServiceMail({'to':_0x2a7a6b[_0x4edf('0x3a')][_0x4edf('0x3b')],'subject':_0x4edf('0x45'),'text':_0x4edf('0x46')+_0x4edf('0x47')+_0x4edf('0x48')+_0x2a7a6b['headers'][_0x4edf('0x26')]+_0x4edf('0x49')+_0x251f10+'\x0a\x0a'+_0x4edf('0x4a')});})[_0x4edf('0xd')](function(){_0x539728['status'](0xc8)['send']({'message':_0x4edf('0x4b')});})[_0x4edf('0x1e')](function(_0x22ebbb){return handleError(_0x539728,0x1f4,_0x22ebbb);});};exports[_0x4edf('0x4c')]=function(_0x58383c,_0x57171a,_0x581f25){return db[_0x4edf('0x3f')][_0x4edf('0x20')]({'where':{'resetPasswordToken':_0x58383c[_0x4edf('0x4d')][_0x4edf('0x4e')],'resetPasswordExpires':{'$gt':Date[_0x4edf('0x44')]()}}})[_0x4edf('0xd')](function(_0x2c12e9){if(!_0x2c12e9){throw new Error(_0x4edf('0x4f'));}return db['Setting'][_0x4edf('0xb')]({'attributes':['id',_0x4edf('0x50'),'enforcePasswordHistory',_0x4edf('0x51')]})[_0x4edf('0xd')](function(_0x1eb3b4){if(_0x1eb3b4[_0x4edf('0x50')])authService[_0x4edf('0x52')](_0x58383c[_0x4edf('0x3a')][_0x4edf('0xe')]);if(!_0x1eb3b4[_0x4edf('0x53')]||!_0x2c12e9['previousPasswords'])return _0x2c12e9;authService[_0x4edf('0x54')](_0x58383c[_0x4edf('0x3a')][_0x4edf('0xe')],_0x2c12e9['previousPasswords'],_0x1eb3b4[_0x4edf('0x51')]);return _0x2c12e9;})['then'](function(){_0x2c12e9[_0x4edf('0xe')]=_0x58383c[_0x4edf('0x3a')]['password'];_0x2c12e9[_0x4edf('0x42')]=null;_0x2c12e9[_0x4edf('0x43')]=null;return _0x2c12e9[_0x4edf('0x55')]();});})[_0x4edf('0xd')](function(){_0x57171a[_0x4edf('0x32')](0xc8)[_0x4edf('0x33')]({'message':_0x4edf('0x56')});})[_0x4edf('0x1e')](function(_0x36c402){return handleError(_0x57171a,0x1f4,_0x36c402);});};passport[_0x4edf('0x57')](_0x4edf('0x35'),new LocalStrategy({'usernameField':_0x4edf('0x21'),'passwordField':_0x4edf('0xe')},function(_0x36059b,_0xe9b4f2,_0x445044){return localAuthenticate(db['User'],_0x36059b,_0xe9b4f2,_0x445044);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 8541f41..4ffbccb 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 _0xce5a=['reset','exports','Router','./authLocal.controller','post','login','forgot','/reset/:token'];(function(_0x17809c,_0xa6ceb9){var _0x144a29=function(_0x44b044){while(--_0x44b044){_0x17809c['push'](_0x17809c['shift']());}};_0x144a29(++_0xa6ceb9);}(_0xce5a,0x17a));var _0xace5=function(_0x1fd9e7,_0x24cdbe){_0x1fd9e7=_0x1fd9e7-0x0;var _0x1781f2=_0xce5a[_0x1fd9e7];return _0x1781f2;};'use strict';var express=require('express');var router=express[_0xace5('0x0')]();var controller=require(_0xace5('0x1'));router[_0xace5('0x2')]('/',controller[_0xace5('0x3')]);router[_0xace5('0x2')]('/forgot',controller[_0xace5('0x4')]);router['post'](_0xace5('0x5'),controller[_0xace5('0x6')]);module[_0xace5('0x7')]=router;
\ No newline at end of file
+var _0x6ac8=['login','/forgot','post','/reset/:token','reset','exports','express','Router'];(function(_0x10534e,_0x1665c7){var _0x1a1268=function(_0x4cf7b7){while(--_0x4cf7b7){_0x10534e['push'](_0x10534e['shift']());}};_0x1a1268(++_0x1665c7);}(_0x6ac8,0xce));var _0x86ac=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x6ac8[_0x9aada2];return _0x196dff;};'use strict';var express=require(_0x86ac('0x0'));var router=express[_0x86ac('0x1')]();var controller=require('./authLocal.controller');router['post']('/',controller[_0x86ac('0x2')]);router['post'](_0x86ac('0x3'),controller['forgot']);router[_0x86ac('0x4')](_0x86ac('0x5'),controller[_0x86ac('0x6')]);module[_0x86ac('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 6b12a34..153d8c2 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 _0xb9fb=['STRING','BOOLEAN','INTEGER'];(function(_0x1711a3,_0x4c5d79){var _0x338ba5=function(_0x408fff){while(--_0x408fff){_0x1711a3['push'](_0x1711a3['shift']());}};_0x338ba5(++_0x4c5d79);}(_0xb9fb,0x198));var _0xbb9f=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xb9fb[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xbb9f('0x0')],'allowNull':![]},'channel':{'type':Sequelize[_0xbb9f('0x0')]},'description':{'type':Sequelize[_0xbb9f('0x0')]},'status':{'type':Sequelize[_0xbb9f('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xbb9f('0x2')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xb5f5=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x3ff9bc,_0x51778d){var _0x4017d6=function(_0x57bb0a){while(--_0x57bb0a){_0x3ff9bc['push'](_0x3ff9bc['shift']());}};_0x4017d6(++_0x51778d);}(_0xb5f5,0x195));var _0x5b5f=function(_0x273df0,_0x184213){_0x273df0=_0x273df0-0x0;var _0x29d6fd=_0xb5f5[_0x273df0];return _0x29d6fd;};'use strict';var Sequelize=require(_0x5b5f('0x0'));module[_0x5b5f('0x1')]={'name':{'type':Sequelize[_0x5b5f('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x5b5f('0x2')]},'description':{'type':Sequelize[_0x5b5f('0x2')]},'status':{'type':Sequelize[_0x5b5f('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x5b5f('0x4')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 1cc118d..74598b8 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 _0x916b=['options','includeAll','include','findAll','catch','keys','create','body','update','params','destroy','find','Condition','omit','ids','getConditions','findOne','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','then','sendStatus','error','stack','Automation','rawAttributes','fieldName','type','key','map','name','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x2d2bd4,_0x5e73ed){var _0x1d11f0=function(_0x59a371){while(--_0x59a371){_0x2d2bd4['push'](_0x2d2bd4['shift']());}};_0x1d11f0(++_0x5e73ed);}(_0x916b,0x103));var _0xb916=function(_0xf420f6,_0x4d298e){_0xf420f6=_0xf420f6-0x0;var _0xd2d0f=_0x916b[_0xf420f6];return _0xd2d0f;};'use strict';var emlformat=require(_0xb916('0x0'));var rimraf=require(_0xb916('0x1'));var zipdir=require(_0xb916('0x2'));var jsonpatch=require(_0xb916('0x3'));var rp=require(_0xb916('0x4'));var moment=require(_0xb916('0x5'));var BPromise=require(_0xb916('0x6'));var Mustache=require(_0xb916('0x7'));var util=require(_0xb916('0x8'));var path=require(_0xb916('0x9'));var sox=require(_0xb916('0xa'));var csv=require(_0xb916('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb916('0xc'));var crypto=require('crypto');var jsforce=require(_0xb916('0xd'));var deskjs=require(_0xb916('0xe'));var toCsv=require(_0xb916('0xb'));var querystring=require(_0xb916('0xf'));var Papa=require(_0xb916('0x10'));var Redis=require(_0xb916('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb916('0x12'));var as=require(_0xb916('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb916('0x14'))(_0xb916('0x15'));var utils=require('../../config/utils');var config=require(_0xb916('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb916('0x17'))['db'];function respondWithStatusCode(_0x3e75e5,_0x337f84){_0x337f84=_0x337f84||0xcc;return function(_0x92bb73){if(_0x92bb73){return _0x3e75e5['sendStatus'](_0x337f84);}return _0x3e75e5[_0xb916('0x18')](_0x337f84)[_0xb916('0x19')]();};}function respondWithResult(_0x176a42,_0x5b90f8){_0x5b90f8=_0x5b90f8||0xc8;return function(_0x48e7f7){if(_0x48e7f7){return _0x176a42['status'](_0x5b90f8)[_0xb916('0x1a')](_0x48e7f7);}};}function respondWithFilteredResult(_0x533f84,_0x25bf90){return function(_0x1cb418){if(_0x1cb418){var _0x4f6d29=typeof _0x25bf90[_0xb916('0x1b')]==='undefined'&&typeof _0x25bf90[_0xb916('0x1c')]===_0xb916('0x1d');var _0x22815e=_0x1cb418[_0xb916('0x1e')];var _0x381065=_0x4f6d29?0x0:_0x25bf90[_0xb916('0x1b')];var _0x36d336=_0x4f6d29?_0x1cb418['count']:_0x25bf90[_0xb916('0x1b')]+_0x25bf90[_0xb916('0x1c')];var _0x356620;if(_0x36d336>=_0x22815e){_0x36d336=_0x22815e;_0x356620=0xc8;}else{_0x356620=0xce;}_0x533f84[_0xb916('0x18')](_0x356620);return _0x533f84['set'](_0xb916('0x1f'),_0x381065+'-'+_0x36d336+'/'+_0x22815e)[_0xb916('0x1a')](_0x1cb418);}return null;};}function patchUpdates(_0x5eef43){return function(_0x654857){try{jsonpatch[_0xb916('0x20')](_0x654857,_0x5eef43,!![]);}catch(_0x3bc924){return BPromise[_0xb916('0x21')](_0x3bc924);}return _0x654857['save']();};}function saveUpdates(_0x5be03f,_0x272003){return function(_0x1cc07a){if(_0x1cc07a){return _0x1cc07a['update'](_0x5be03f)[_0xb916('0x22')](function(_0x47d86a){return _0x47d86a;});}return null;};}function removeEntity(_0x228589,_0x5fc629){return function(_0x38940f){if(_0x38940f){return _0x38940f['destroy']()[_0xb916('0x22')](function(){_0x228589[_0xb916('0x18')](0xcc)[_0xb916('0x19')]();});}};}function handleEntityNotFound(_0x906739,_0x2d8a9e){return function(_0x50ec01){if(!_0x50ec01){_0x906739[_0xb916('0x23')](0x194);}return _0x50ec01;};}function handleError(_0xfc26ff,_0x7711db){_0x7711db=_0x7711db||0x1f4;return function(_0x190c6e){logger[_0xb916('0x24')](_0x190c6e[_0xb916('0x25')]);if(_0x190c6e['name']){delete _0x190c6e['name'];}_0xfc26ff['status'](_0x7711db)['send'](_0x190c6e);};}exports['index']=function(_0x1b531f,_0xaf06ba){var _0x324607={},_0x38fa83={},_0xddef50={'count':0x0,'rows':[]};var _0x5ba2a3=_['map'](db[_0xb916('0x26')][_0xb916('0x27')],function(_0x2f3a6f){return{'name':_0x2f3a6f[_0xb916('0x28')],'type':_0x2f3a6f[_0xb916('0x29')][_0xb916('0x2a')]};});_0x38fa83['model']=_[_0xb916('0x2b')](_0x5ba2a3,_0xb916('0x2c'));_0x38fa83[_0xb916('0x2d')]=_['keys'](_0x1b531f[_0xb916('0x2d')]);_0x38fa83[_0xb916('0x2e')]=_[_0xb916('0x2f')](_0x38fa83[_0xb916('0x30')],_0x38fa83[_0xb916('0x2d')]);_0x324607['attributes']=_[_0xb916('0x2f')](_0x38fa83[_0xb916('0x30')],qs[_0xb916('0x31')](_0x1b531f['query']['fields']));_0x324607[_0xb916('0x32')]=_0x324607[_0xb916('0x32')][_0xb916('0x33')]?_0x324607[_0xb916('0x32')]:_0x38fa83['model'];if(!_0x1b531f[_0xb916('0x2d')][_0xb916('0x34')](_0xb916('0x35'))){_0x324607[_0xb916('0x1c')]=qs[_0xb916('0x1c')](_0x1b531f[_0xb916('0x2d')][_0xb916('0x1c')]);_0x324607[_0xb916('0x1b')]=qs[_0xb916('0x1b')](_0x1b531f[_0xb916('0x2d')][_0xb916('0x1b')]);}_0x324607[_0xb916('0x36')]=qs[_0xb916('0x37')](_0x1b531f[_0xb916('0x2d')][_0xb916('0x37')]);_0x324607[_0xb916('0x38')]=qs[_0xb916('0x2e')](_[_0xb916('0x39')](_0x1b531f[_0xb916('0x2d')],_0x38fa83[_0xb916('0x2e')]),_0x5ba2a3);if(_0x1b531f[_0xb916('0x2d')][_0xb916('0x3a')]){_0x324607['where']=_[_0xb916('0x3b')](_0x324607['where'],{'$or':_[_0xb916('0x2b')](_0x5ba2a3,function(_0x4c5951){if(_0x4c5951[_0xb916('0x29')]!==_0xb916('0x3c')){var _0x2eb692={};_0x2eb692[_0x4c5951[_0xb916('0x2c')]]={'$like':'%'+_0x1b531f['query'][_0xb916('0x3a')]+'%'};return _0x2eb692;}})});}_0x324607=_[_0xb916('0x3b')]({},_0x324607,_0x1b531f[_0xb916('0x3d')]);var _0xdfa597={'where':_0x324607[_0xb916('0x38')]};return db[_0xb916('0x26')][_0xb916('0x1e')](_0xdfa597)[_0xb916('0x22')](function(_0xfd00ab){_0xddef50[_0xb916('0x1e')]=_0xfd00ab;if(_0x1b531f[_0xb916('0x2d')][_0xb916('0x3e')]){_0x324607[_0xb916('0x3f')]=[{'all':!![]}];}return db[_0xb916('0x26')][_0xb916('0x40')](_0x324607);})['then'](function(_0x3bda57){_0xddef50['rows']=_0x3bda57;return _0xddef50;})[_0xb916('0x22')](respondWithFilteredResult(_0xaf06ba,_0x324607))[_0xb916('0x41')](handleError(_0xaf06ba,null));};exports['show']=function(_0x31fe5e,_0x5966ea){var _0x297ff0={'raw':![],'where':{'id':_0x31fe5e['params']['id']}},_0x7ef7ef={};_0x7ef7ef[_0xb916('0x30')]=_[_0xb916('0x42')](db[_0xb916('0x26')][_0xb916('0x27')]);_0x7ef7ef[_0xb916('0x2d')]=_['keys'](_0x31fe5e[_0xb916('0x2d')]);_0x7ef7ef[_0xb916('0x2e')]=_[_0xb916('0x2f')](_0x7ef7ef[_0xb916('0x30')],_0x7ef7ef[_0xb916('0x2d')]);_0x297ff0[_0xb916('0x32')]=_[_0xb916('0x2f')](_0x7ef7ef[_0xb916('0x30')],qs['fields'](_0x31fe5e[_0xb916('0x2d')]['fields']));_0x297ff0[_0xb916('0x32')]=_0x297ff0['attributes'][_0xb916('0x33')]?_0x297ff0['attributes']:_0x7ef7ef[_0xb916('0x30')];if(_0x31fe5e[_0xb916('0x2d')][_0xb916('0x3e')]){_0x297ff0[_0xb916('0x3f')]=[{'all':!![]}];}_0x297ff0=_[_0xb916('0x3b')]({},_0x297ff0,_0x31fe5e[_0xb916('0x3d')]);return db[_0xb916('0x26')]['find'](_0x297ff0)['then'](handleEntityNotFound(_0x5966ea,null))[_0xb916('0x22')](respondWithResult(_0x5966ea,null))['catch'](handleError(_0x5966ea,null));};exports[_0xb916('0x43')]=function(_0x32ced0,_0x18a691){return db['Automation'][_0xb916('0x43')](_0x32ced0[_0xb916('0x44')],{})[_0xb916('0x22')](respondWithResult(_0x18a691,0xc9))[_0xb916('0x41')](handleError(_0x18a691,null));};exports[_0xb916('0x45')]=function(_0x313e0c,_0x35c619){if(_0x313e0c[_0xb916('0x44')]['id']){delete _0x313e0c[_0xb916('0x44')]['id'];}return db['Automation']['find']({'where':{'id':_0x313e0c[_0xb916('0x46')]['id']}})['then'](handleEntityNotFound(_0x35c619,null))['then'](saveUpdates(_0x313e0c[_0xb916('0x44')],null))[_0xb916('0x22')](respondWithResult(_0x35c619,null))[_0xb916('0x41')](handleError(_0x35c619,null));};exports[_0xb916('0x47')]=function(_0x33aed4,_0x8efedc){return db[_0xb916('0x26')][_0xb916('0x48')]({'where':{'id':_0x33aed4[_0xb916('0x46')]['id']}})[_0xb916('0x22')](handleEntityNotFound(_0x8efedc,null))[_0xb916('0x22')](removeEntity(_0x8efedc,null))['catch'](handleError(_0x8efedc,null));};exports['addConditions']=function(_0x264a9d,_0x8d7623,_0x426cc8){return db[_0xb916('0x49')][_0xb916('0x48')]({'where':{'id':_0x264a9d['params']['id']}})[_0xb916('0x22')](handleEntityNotFound(_0x8d7623,null))[_0xb916('0x22')](function(_0x4ae600){if(_0x4ae600){return _0x4ae600['addConditions'](_0x264a9d['body']['ids'],_[_0xb916('0x4a')](_0x264a9d[_0xb916('0x44')],[_0xb916('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x8d7623,null))[_0xb916('0x41')](handleError(_0x8d7623,null));};exports[_0xb916('0x4c')]=function(_0x571123,_0x508d66,_0x51b1de){var _0x469374={};var _0x24dd82={};var _0x5d739f;var _0x148a34;return db[_0xb916('0x26')][_0xb916('0x4d')]({'where':{'id':_0x571123[_0xb916('0x46')]['id']}})[_0xb916('0x22')](handleEntityNotFound(_0x508d66,null))[_0xb916('0x22')](function(_0x505bf8){if(_0x505bf8){_0x5d739f=_0x505bf8;_0x24dd82[_0xb916('0x30')]=_[_0xb916('0x42')](db['Condition'][_0xb916('0x27')]);_0x24dd82[_0xb916('0x2d')]=_[_0xb916('0x42')](_0x571123[_0xb916('0x2d')]);_0x24dd82['filters']=_[_0xb916('0x2f')](_0x24dd82[_0xb916('0x30')],_0x24dd82['query']);_0x469374[_0xb916('0x32')]=_[_0xb916('0x2f')](_0x24dd82['model'],qs[_0xb916('0x31')](_0x571123[_0xb916('0x2d')][_0xb916('0x31')]));_0x469374['attributes']=_0x469374[_0xb916('0x32')]['length']?_0x469374[_0xb916('0x32')]:_0x24dd82['model'];_0x469374[_0xb916('0x36')]=qs[_0xb916('0x37')](_0x571123[_0xb916('0x2d')][_0xb916('0x37')]);_0x469374[_0xb916('0x38')]=qs[_0xb916('0x2e')](_[_0xb916('0x39')](_0x571123[_0xb916('0x2d')],_0x24dd82[_0xb916('0x2e')]));if(_0x571123['query'][_0xb916('0x3a')]){_0x469374[_0xb916('0x38')]=_[_0xb916('0x3b')](_0x469374[_0xb916('0x38')],{'$or':_[_0xb916('0x2b')](_0x469374[_0xb916('0x32')],function(_0xef6081){var _0x371591={};_0x371591[_0xef6081]={'$like':'%'+_0x571123[_0xb916('0x2d')][_0xb916('0x3a')]+'%'};return _0x371591;})});}_0x469374=_[_0xb916('0x3b')]({},_0x469374,_0x571123[_0xb916('0x3d')]);return _0x5d739f['getConditions'](_0x469374);}})[_0xb916('0x22')](function(_0x51f0df){if(_0x51f0df){_0x148a34=_0x51f0df[_0xb916('0x33')];if(!_0x571123[_0xb916('0x2d')][_0xb916('0x34')](_0xb916('0x35'))){_0x469374[_0xb916('0x1c')]=qs['limit'](_0x571123['query'][_0xb916('0x1c')]);_0x469374[_0xb916('0x1b')]=qs[_0xb916('0x1b')](_0x571123[_0xb916('0x2d')][_0xb916('0x1b')]);}return _0x5d739f[_0xb916('0x4c')](_0x469374);}})[_0xb916('0x22')](function(_0x22bda0){if(_0x22bda0){return _0x22bda0?{'count':_0x148a34,'rows':_0x22bda0}:null;}})[_0xb916('0x22')](respondWithResult(_0x508d66,null))['catch'](handleError(_0x508d66,null));};exports['addActions']=function(_0x49df87,_0x253858,_0x4714f2){return db['Action']['find']({'where':{'id':_0x49df87[_0xb916('0x46')]['id']}})['then'](handleEntityNotFound(_0x253858,null))[_0xb916('0x22')](function(_0x8c1e36){if(_0x8c1e36){return _0x8c1e36['addActions'](_0x49df87['body'][_0xb916('0x4b')],_[_0xb916('0x4a')](_0x49df87['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x253858,null))[_0xb916('0x41')](handleError(_0x253858,null));};exports['getActions']=function(_0x571afb,_0x5a8f1a,_0x309b6a){var _0xaf0f21={};var _0x4fbbc6={};var _0x528ec2;var _0x2d195e;return db[_0xb916('0x26')]['findOne']({'where':{'id':_0x571afb['params']['id']}})[_0xb916('0x22')](handleEntityNotFound(_0x5a8f1a,null))[_0xb916('0x22')](function(_0x258857){if(_0x258857){_0x528ec2=_0x258857;_0x4fbbc6[_0xb916('0x30')]=_['keys'](db[_0xb916('0x4e')][_0xb916('0x27')]);_0x4fbbc6[_0xb916('0x2d')]=_[_0xb916('0x42')](_0x571afb[_0xb916('0x2d')]);_0x4fbbc6['filters']=_[_0xb916('0x2f')](_0x4fbbc6[_0xb916('0x30')],_0x4fbbc6[_0xb916('0x2d')]);_0xaf0f21[_0xb916('0x32')]=_[_0xb916('0x2f')](_0x4fbbc6[_0xb916('0x30')],qs['fields'](_0x571afb[_0xb916('0x2d')]['fields']));_0xaf0f21[_0xb916('0x32')]=_0xaf0f21[_0xb916('0x32')][_0xb916('0x33')]?_0xaf0f21[_0xb916('0x32')]:_0x4fbbc6[_0xb916('0x30')];_0xaf0f21[_0xb916('0x36')]=qs[_0xb916('0x37')](_0x571afb[_0xb916('0x2d')][_0xb916('0x37')]);_0xaf0f21[_0xb916('0x38')]=qs[_0xb916('0x2e')](_[_0xb916('0x39')](_0x571afb[_0xb916('0x2d')],_0x4fbbc6['filters']));if(_0x571afb[_0xb916('0x2d')][_0xb916('0x3a')]){_0xaf0f21[_0xb916('0x38')]=_[_0xb916('0x3b')](_0xaf0f21[_0xb916('0x38')],{'$or':_[_0xb916('0x2b')](_0xaf0f21[_0xb916('0x32')],function(_0x57f120){var _0x547f5b={};_0x547f5b[_0x57f120]={'$like':'%'+_0x571afb[_0xb916('0x2d')][_0xb916('0x3a')]+'%'};return _0x547f5b;})});}_0xaf0f21=_['merge']({},_0xaf0f21,_0x571afb[_0xb916('0x3d')]);return _0x528ec2[_0xb916('0x4f')](_0xaf0f21);}})[_0xb916('0x22')](function(_0x263d78){if(_0x263d78){_0x2d195e=_0x263d78[_0xb916('0x33')];if(!_0x571afb['query'][_0xb916('0x34')]('nolimit')){_0xaf0f21[_0xb916('0x1c')]=qs[_0xb916('0x1c')](_0x571afb[_0xb916('0x2d')]['limit']);_0xaf0f21[_0xb916('0x1b')]=qs[_0xb916('0x1b')](_0x571afb[_0xb916('0x2d')][_0xb916('0x1b')]);}return _0x528ec2[_0xb916('0x4f')](_0xaf0f21);}})[_0xb916('0x22')](function(_0x5234d2){if(_0x5234d2){return _0x5234d2?{'count':_0x2d195e,'rows':_0x5234d2}:null;}})[_0xb916('0x22')](respondWithResult(_0x5a8f1a,null))[_0xb916('0x41')](handleError(_0x5a8f1a,null));};
\ No newline at end of file
+var _0x5589=['attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','Condition','addConditions','ids','omit','getConditions','findOne','nolimit','addActions','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','Automation','fieldName','type','key','model','query','keys','filters'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x5589,0x130));var _0x9558=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x5589[_0x1694f5];return _0x5b4321;};'use strict';var emlformat=require(_0x9558('0x0'));var rimraf=require(_0x9558('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9558('0x2'));var rp=require(_0x9558('0x3'));var moment=require(_0x9558('0x4'));var BPromise=require(_0x9558('0x5'));var Mustache=require(_0x9558('0x6'));var util=require(_0x9558('0x7'));var path=require(_0x9558('0x8'));var sox=require(_0x9558('0x9'));var csv=require(_0x9558('0xa'));var ejs=require(_0x9558('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9558('0xc'));var squel=require(_0x9558('0xd'));var crypto=require(_0x9558('0xe'));var jsforce=require(_0x9558('0xf'));var deskjs=require(_0x9558('0x10'));var toCsv=require('to-csv');var querystring=require(_0x9558('0x11'));var Papa=require(_0x9558('0x12'));var Redis=require(_0x9558('0x13'));var authService=require(_0x9558('0x14'));var qs=require(_0x9558('0x15'));var as=require(_0x9558('0x16'));var hardwareService=require(_0x9558('0x17'));var logger=require(_0x9558('0x18'))(_0x9558('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9558('0x1a'));var db=require(_0x9558('0x1b'))['db'];function respondWithStatusCode(_0x5abca3,_0x27c502){_0x27c502=_0x27c502||0xcc;return function(_0x1baccc){if(_0x1baccc){return _0x5abca3[_0x9558('0x1c')](_0x27c502);}return _0x5abca3[_0x9558('0x1d')](_0x27c502)['end']();};}function respondWithResult(_0x167f4f,_0x232b32){_0x232b32=_0x232b32||0xc8;return function(_0x1ef702){if(_0x1ef702){return _0x167f4f[_0x9558('0x1d')](_0x232b32)[_0x9558('0x1e')](_0x1ef702);}};}function respondWithFilteredResult(_0x32b4c8,_0x2abaa8){return function(_0x2da178){if(_0x2da178){var _0x22f0e5=typeof _0x2abaa8['offset']===_0x9558('0x1f')&&typeof _0x2abaa8[_0x9558('0x20')]===_0x9558('0x1f');var _0x4a5398=_0x2da178[_0x9558('0x21')];var _0x141e1f=_0x22f0e5?0x0:_0x2abaa8[_0x9558('0x22')];var _0x2caab5=_0x22f0e5?_0x2da178[_0x9558('0x21')]:_0x2abaa8['offset']+_0x2abaa8[_0x9558('0x20')];var _0x12645e;if(_0x2caab5>=_0x4a5398){_0x2caab5=_0x4a5398;_0x12645e=0xc8;}else{_0x12645e=0xce;}_0x32b4c8[_0x9558('0x1d')](_0x12645e);return _0x32b4c8[_0x9558('0x23')](_0x9558('0x24'),_0x141e1f+'-'+_0x2caab5+'/'+_0x4a5398)[_0x9558('0x1e')](_0x2da178);}return null;};}function patchUpdates(_0xb4ef4){return function(_0x313168){try{jsonpatch[_0x9558('0x25')](_0x313168,_0xb4ef4,!![]);}catch(_0x1efe44){return BPromise[_0x9558('0x26')](_0x1efe44);}return _0x313168[_0x9558('0x27')]();};}function saveUpdates(_0x357099,_0x2832a1){return function(_0x128d80){if(_0x128d80){return _0x128d80[_0x9558('0x28')](_0x357099)[_0x9558('0x29')](function(_0x4a91ac){return _0x4a91ac;});}return null;};}function removeEntity(_0x51e9e9,_0x166563){return function(_0x4c575c){if(_0x4c575c){return _0x4c575c[_0x9558('0x2a')]()[_0x9558('0x29')](function(){_0x51e9e9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47c174,_0x2b484d){return function(_0x137d28){if(!_0x137d28){_0x47c174[_0x9558('0x1c')](0x194);}return _0x137d28;};}function handleError(_0x5e4bef,_0x17f39c){_0x17f39c=_0x17f39c||0x1f4;return function(_0x414869){logger[_0x9558('0x2b')](_0x414869[_0x9558('0x2c')]);if(_0x414869[_0x9558('0x2d')]){delete _0x414869[_0x9558('0x2d')];}_0x5e4bef[_0x9558('0x1d')](_0x17f39c)[_0x9558('0x2e')](_0x414869);};}exports['index']=function(_0x106490,_0x40118d){var _0x395748={},_0x501dfc={},_0xf1ed0d={'count':0x0,'rows':[]};var _0x2fcfba=_[_0x9558('0x2f')](db[_0x9558('0x30')]['rawAttributes'],function(_0x1e7450){return{'name':_0x1e7450[_0x9558('0x31')],'type':_0x1e7450[_0x9558('0x32')][_0x9558('0x33')]};});_0x501dfc[_0x9558('0x34')]=_['map'](_0x2fcfba,_0x9558('0x2d'));_0x501dfc[_0x9558('0x35')]=_[_0x9558('0x36')](_0x106490[_0x9558('0x35')]);_0x501dfc[_0x9558('0x37')]=_['intersection'](_0x501dfc[_0x9558('0x34')],_0x501dfc[_0x9558('0x35')]);_0x395748[_0x9558('0x38')]=_[_0x9558('0x39')](_0x501dfc[_0x9558('0x34')],qs[_0x9558('0x3a')](_0x106490[_0x9558('0x35')][_0x9558('0x3a')]));_0x395748[_0x9558('0x38')]=_0x395748[_0x9558('0x38')][_0x9558('0x3b')]?_0x395748[_0x9558('0x38')]:_0x501dfc[_0x9558('0x34')];if(!_0x106490[_0x9558('0x35')][_0x9558('0x3c')]('nolimit')){_0x395748[_0x9558('0x20')]=qs[_0x9558('0x20')](_0x106490[_0x9558('0x35')][_0x9558('0x20')]);_0x395748['offset']=qs[_0x9558('0x22')](_0x106490['query']['offset']);}_0x395748[_0x9558('0x3d')]=qs[_0x9558('0x3e')](_0x106490[_0x9558('0x35')][_0x9558('0x3e')]);_0x395748[_0x9558('0x3f')]=qs[_0x9558('0x37')](_[_0x9558('0x40')](_0x106490[_0x9558('0x35')],_0x501dfc[_0x9558('0x37')]),_0x2fcfba);if(_0x106490[_0x9558('0x35')][_0x9558('0x41')]){_0x395748[_0x9558('0x3f')]=_[_0x9558('0x42')](_0x395748['where'],{'$or':_[_0x9558('0x2f')](_0x2fcfba,function(_0x1754b9){if(_0x1754b9['type']!==_0x9558('0x43')){var _0x50db2a={};_0x50db2a[_0x1754b9['name']]={'$like':'%'+_0x106490[_0x9558('0x35')]['filter']+'%'};return _0x50db2a;}})});}_0x395748=_[_0x9558('0x42')]({},_0x395748,_0x106490[_0x9558('0x44')]);var _0x42822f={'where':_0x395748['where']};return db[_0x9558('0x30')][_0x9558('0x21')](_0x42822f)[_0x9558('0x29')](function(_0x5db34){_0xf1ed0d[_0x9558('0x21')]=_0x5db34;if(_0x106490[_0x9558('0x35')][_0x9558('0x45')]){_0x395748[_0x9558('0x46')]=[{'all':!![]}];}return db['Automation'][_0x9558('0x47')](_0x395748);})[_0x9558('0x29')](function(_0x160f13){_0xf1ed0d[_0x9558('0x48')]=_0x160f13;return _0xf1ed0d;})[_0x9558('0x29')](respondWithFilteredResult(_0x40118d,_0x395748))[_0x9558('0x49')](handleError(_0x40118d,null));};exports[_0x9558('0x4a')]=function(_0x5ab162,_0xe3779c){var _0x3dc825={'raw':![],'where':{'id':_0x5ab162[_0x9558('0x4b')]['id']}},_0x1f5e34={};_0x1f5e34[_0x9558('0x34')]=_['keys'](db['Automation'][_0x9558('0x4c')]);_0x1f5e34['query']=_[_0x9558('0x36')](_0x5ab162['query']);_0x1f5e34[_0x9558('0x37')]=_[_0x9558('0x39')](_0x1f5e34['model'],_0x1f5e34['query']);_0x3dc825[_0x9558('0x38')]=_[_0x9558('0x39')](_0x1f5e34[_0x9558('0x34')],qs[_0x9558('0x3a')](_0x5ab162[_0x9558('0x35')]['fields']));_0x3dc825[_0x9558('0x38')]=_0x3dc825['attributes'][_0x9558('0x3b')]?_0x3dc825['attributes']:_0x1f5e34[_0x9558('0x34')];if(_0x5ab162[_0x9558('0x35')][_0x9558('0x45')]){_0x3dc825[_0x9558('0x46')]=[{'all':!![]}];}_0x3dc825=_[_0x9558('0x42')]({},_0x3dc825,_0x5ab162[_0x9558('0x44')]);return db['Automation'][_0x9558('0x4d')](_0x3dc825)['then'](handleEntityNotFound(_0xe3779c,null))[_0x9558('0x29')](respondWithResult(_0xe3779c,null))['catch'](handleError(_0xe3779c,null));};exports[_0x9558('0x4e')]=function(_0x175394,_0x3cb5a9){return db[_0x9558('0x30')][_0x9558('0x4e')](_0x175394[_0x9558('0x4f')],{})[_0x9558('0x29')](respondWithResult(_0x3cb5a9,0xc9))[_0x9558('0x49')](handleError(_0x3cb5a9,null));};exports[_0x9558('0x28')]=function(_0x2cefc2,_0x51272a){if(_0x2cefc2[_0x9558('0x4f')]['id']){delete _0x2cefc2[_0x9558('0x4f')]['id'];}return db[_0x9558('0x30')]['find']({'where':{'id':_0x2cefc2[_0x9558('0x4b')]['id']}})['then'](handleEntityNotFound(_0x51272a,null))[_0x9558('0x29')](saveUpdates(_0x2cefc2[_0x9558('0x4f')],null))[_0x9558('0x29')](respondWithResult(_0x51272a,null))[_0x9558('0x49')](handleError(_0x51272a,null));};exports['destroy']=function(_0xe58c20,_0x79936e){return db['Automation'][_0x9558('0x4d')]({'where':{'id':_0xe58c20['params']['id']}})[_0x9558('0x29')](handleEntityNotFound(_0x79936e,null))[_0x9558('0x29')](removeEntity(_0x79936e,null))['catch'](handleError(_0x79936e,null));};exports['addConditions']=function(_0xb9b210,_0x3207d7,_0x3fbf63){return db[_0x9558('0x50')][_0x9558('0x4d')]({'where':{'id':_0xb9b210[_0x9558('0x4b')]['id']}})[_0x9558('0x29')](handleEntityNotFound(_0x3207d7,null))['then'](function(_0x1f364c){if(_0x1f364c){return _0x1f364c[_0x9558('0x51')](_0xb9b210['body'][_0x9558('0x52')],_[_0x9558('0x53')](_0xb9b210[_0x9558('0x4f')],[_0x9558('0x52'),'id'])||{});}})[_0x9558('0x29')](respondWithResult(_0x3207d7,null))[_0x9558('0x49')](handleError(_0x3207d7,null));};exports[_0x9558('0x54')]=function(_0x20cc9b,_0x44653d,_0x369228){var _0x340548={};var _0xe70a89={};var _0x4b4516;var _0x75451e;return db[_0x9558('0x30')][_0x9558('0x55')]({'where':{'id':_0x20cc9b[_0x9558('0x4b')]['id']}})['then'](handleEntityNotFound(_0x44653d,null))[_0x9558('0x29')](function(_0x48ee7f){if(_0x48ee7f){_0x4b4516=_0x48ee7f;_0xe70a89[_0x9558('0x34')]=_[_0x9558('0x36')](db[_0x9558('0x50')][_0x9558('0x4c')]);_0xe70a89[_0x9558('0x35')]=_[_0x9558('0x36')](_0x20cc9b[_0x9558('0x35')]);_0xe70a89[_0x9558('0x37')]=_[_0x9558('0x39')](_0xe70a89[_0x9558('0x34')],_0xe70a89['query']);_0x340548[_0x9558('0x38')]=_[_0x9558('0x39')](_0xe70a89[_0x9558('0x34')],qs[_0x9558('0x3a')](_0x20cc9b['query']['fields']));_0x340548[_0x9558('0x38')]=_0x340548[_0x9558('0x38')][_0x9558('0x3b')]?_0x340548[_0x9558('0x38')]:_0xe70a89[_0x9558('0x34')];_0x340548[_0x9558('0x3d')]=qs[_0x9558('0x3e')](_0x20cc9b['query'][_0x9558('0x3e')]);_0x340548[_0x9558('0x3f')]=qs['filters'](_['pick'](_0x20cc9b[_0x9558('0x35')],_0xe70a89['filters']));if(_0x20cc9b['query'][_0x9558('0x41')]){_0x340548['where']=_[_0x9558('0x42')](_0x340548[_0x9558('0x3f')],{'$or':_['map'](_0x340548[_0x9558('0x38')],function(_0x256714){var _0x1dfb25={};_0x1dfb25[_0x256714]={'$like':'%'+_0x20cc9b[_0x9558('0x35')][_0x9558('0x41')]+'%'};return _0x1dfb25;})});}_0x340548=_['merge']({},_0x340548,_0x20cc9b['options']);return _0x4b4516[_0x9558('0x54')](_0x340548);}})['then'](function(_0x34487e){if(_0x34487e){_0x75451e=_0x34487e[_0x9558('0x3b')];if(!_0x20cc9b['query'][_0x9558('0x3c')](_0x9558('0x56'))){_0x340548[_0x9558('0x20')]=qs[_0x9558('0x20')](_0x20cc9b[_0x9558('0x35')]['limit']);_0x340548['offset']=qs['offset'](_0x20cc9b['query'][_0x9558('0x22')]);}return _0x4b4516[_0x9558('0x54')](_0x340548);}})[_0x9558('0x29')](function(_0xbed4f7){if(_0xbed4f7){return _0xbed4f7?{'count':_0x75451e,'rows':_0xbed4f7}:null;}})['then'](respondWithResult(_0x44653d,null))['catch'](handleError(_0x44653d,null));};exports[_0x9558('0x57')]=function(_0x2bce9e,_0x1399d0,_0x3fedaf){return db[_0x9558('0x58')][_0x9558('0x4d')]({'where':{'id':_0x2bce9e[_0x9558('0x4b')]['id']}})[_0x9558('0x29')](handleEntityNotFound(_0x1399d0,null))[_0x9558('0x29')](function(_0x296b69){if(_0x296b69){return _0x296b69[_0x9558('0x57')](_0x2bce9e['body'][_0x9558('0x52')],_[_0x9558('0x53')](_0x2bce9e[_0x9558('0x4f')],[_0x9558('0x52'),'id'])||{});}})[_0x9558('0x29')](respondWithResult(_0x1399d0,null))[_0x9558('0x49')](handleError(_0x1399d0,null));};exports[_0x9558('0x59')]=function(_0x4be877,_0x2b142b,_0x2afdfe){var _0x1f6ae1={};var _0x3ad264={};var _0x51b3c9;var _0x197768;return db['Automation'][_0x9558('0x55')]({'where':{'id':_0x4be877[_0x9558('0x4b')]['id']}})[_0x9558('0x29')](handleEntityNotFound(_0x2b142b,null))[_0x9558('0x29')](function(_0x4a0ee5){if(_0x4a0ee5){_0x51b3c9=_0x4a0ee5;_0x3ad264[_0x9558('0x34')]=_['keys'](db[_0x9558('0x58')][_0x9558('0x4c')]);_0x3ad264['query']=_['keys'](_0x4be877['query']);_0x3ad264['filters']=_[_0x9558('0x39')](_0x3ad264[_0x9558('0x34')],_0x3ad264['query']);_0x1f6ae1[_0x9558('0x38')]=_[_0x9558('0x39')](_0x3ad264[_0x9558('0x34')],qs[_0x9558('0x3a')](_0x4be877['query'][_0x9558('0x3a')]));_0x1f6ae1[_0x9558('0x38')]=_0x1f6ae1[_0x9558('0x38')][_0x9558('0x3b')]?_0x1f6ae1[_0x9558('0x38')]:_0x3ad264['model'];_0x1f6ae1[_0x9558('0x3d')]=qs[_0x9558('0x3e')](_0x4be877[_0x9558('0x35')][_0x9558('0x3e')]);_0x1f6ae1[_0x9558('0x3f')]=qs[_0x9558('0x37')](_[_0x9558('0x40')](_0x4be877['query'],_0x3ad264['filters']));if(_0x4be877['query']['filter']){_0x1f6ae1['where']=_[_0x9558('0x42')](_0x1f6ae1[_0x9558('0x3f')],{'$or':_[_0x9558('0x2f')](_0x1f6ae1[_0x9558('0x38')],function(_0x1fb21b){var _0x56c11e={};_0x56c11e[_0x1fb21b]={'$like':'%'+_0x4be877['query'][_0x9558('0x41')]+'%'};return _0x56c11e;})});}_0x1f6ae1=_[_0x9558('0x42')]({},_0x1f6ae1,_0x4be877['options']);return _0x51b3c9[_0x9558('0x59')](_0x1f6ae1);}})[_0x9558('0x29')](function(_0x246ccf){if(_0x246ccf){_0x197768=_0x246ccf['length'];if(!_0x4be877[_0x9558('0x35')][_0x9558('0x3c')](_0x9558('0x56'))){_0x1f6ae1[_0x9558('0x20')]=qs[_0x9558('0x20')](_0x4be877['query'][_0x9558('0x20')]);_0x1f6ae1[_0x9558('0x22')]=qs['offset'](_0x4be877[_0x9558('0x35')][_0x9558('0x22')]);}return _0x51b3c9[_0x9558('0x59')](_0x1f6ae1);}})[_0x9558('0x29')](function(_0x310e39){if(_0x310e39){return _0x310e39?{'count':_0x197768,'rows':_0x310e39}:null;}})[_0x9558('0x29')](respondWithResult(_0x2b142b,null))[_0x9558('0x49')](handleError(_0x2b142b,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index ede957c..fd38c9f 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 _0x8b59=['tools_automations','util','../../config/logger','moment','bluebird','path','../../config/environment','exports','define','Automation'];(function(_0x30d14d,_0x5b7cdc){var _0x47054e=function(_0x3535f2){while(--_0x3535f2){_0x30d14d['push'](_0x30d14d['shift']());}};_0x47054e(++_0x5b7cdc);}(_0x8b59,0x6f));var _0x98b5=function(_0x7514c5,_0x36dbdf){_0x7514c5=_0x7514c5-0x0;var _0x1d5a10=_0x8b59[_0x7514c5];return _0x1d5a10;};'use strict';var _=require('lodash');var util=require(_0x98b5('0x0'));var logger=require(_0x98b5('0x1'))('api');var moment=require(_0x98b5('0x2'));var BPromise=require(_0x98b5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x98b5('0x4'));var rimraf=require('rimraf');var config=require(_0x98b5('0x5'));var attributes=require('./automation.attributes');module[_0x98b5('0x6')]=function(_0x3ddfc9,_0x2e2135){return _0x3ddfc9[_0x98b5('0x7')](_0x98b5('0x8'),attributes,{'tableName':_0x98b5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb6c2=['tools_automations','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','define','Automation'];(function(_0x3addd2,_0x4a6744){var _0x61c0cf=function(_0xd91357){while(--_0xd91357){_0x3addd2['push'](_0x3addd2['shift']());}};_0x61c0cf(++_0x4a6744);}(_0xb6c2,0x18d));var _0x2b6c=function(_0x2bb15d,_0x40b064){_0x2bb15d=_0x2bb15d-0x0;var _0x38ba73=_0xb6c2[_0x2bb15d];return _0x38ba73;};'use strict';var _=require('lodash');var util=require(_0x2b6c('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x2b6c('0x1'));var BPromise=require(_0x2b6c('0x2'));var rp=require(_0x2b6c('0x3'));var fs=require('fs');var path=require(_0x2b6c('0x4'));var rimraf=require(_0x2b6c('0x5'));var config=require(_0x2b6c('0x6'));var attributes=require(_0x2b6c('0x7'));module['exports']=function(_0x18a9b1,_0x7d7efe){return _0x18a9b1[_0x2b6c('0x8')](_0x2b6c('0x9'),attributes,{'tableName':_0x2b6c('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 d89c679..cf9200f 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 _0xbecf=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0xbe0e5c,_0x7368f7){var _0x1c487f=function(_0xa42b1b){while(--_0xa42b1b){_0xbe0e5c['push'](_0xbe0e5c['shift']());}};_0x1c487f(++_0x7368f7);}(_0xbecf,0x15c));var _0xfbec=function(_0x4df79f,_0x5b93fe){_0x4df79f=_0x4df79f-0x0;var _0x80e7cd=_0xbecf[_0x4df79f];return _0x80e7cd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfbec('0x0'));var BPromise=require(_0xfbec('0x1'));var rs=require(_0xfbec('0x2'));var fs=require('fs');var Redis=require(_0xfbec('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfbec('0x4'));var logger=require(_0xfbec('0x5'))(_0xfbec('0x6'));var config=require(_0xfbec('0x7'));var jayson=require(_0xfbec('0x8'));var client=jayson['client'][_0xfbec('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x34a717,_0x33c701,_0x410cab){return new BPromise(function(_0x43bc5b,_0x312ad1){return client[_0xfbec('0xa')](_0x34a717,_0x410cab)[_0xfbec('0xb')](function(_0x21863f){logger['info']('Automation,\x20%s,\x20%s',_0x33c701,'request\x20sent');logger[_0xfbec('0xc')](_0xfbec('0xd'),_0x33c701,_0xfbec('0xe'),JSON[_0xfbec('0xf')](_0x21863f));if(_0x21863f[_0xfbec('0x10')]){if(_0x21863f['error'][_0xfbec('0x11')]===0x1f4){logger[_0xfbec('0x10')](_0xfbec('0x12'),_0x33c701,_0x21863f[_0xfbec('0x10')]['message']);return _0x312ad1(_0x21863f[_0xfbec('0x10')][_0xfbec('0x13')]);}logger[_0xfbec('0x10')](_0xfbec('0x12'),_0x33c701,_0x21863f['error'][_0xfbec('0x13')]);return _0x43bc5b(_0x21863f['error'][_0xfbec('0x13')]);}else{logger['info'](_0xfbec('0x12'),_0x33c701,_0xfbec('0xe'));_0x43bc5b(_0x21863f[_0xfbec('0x14')]['message']);}})[_0xfbec('0x15')](function(_0x2a3329){logger[_0xfbec('0x10')]('Automation,\x20%s,\x20%s',_0x33c701,_0x2a3329);_0x312ad1(_0x2a3329);});});}
\ No newline at end of file
+var _0x7880=['bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment'];(function(_0x31707a,_0x38aa9f){var _0x107b75=function(_0xf342a8){while(--_0xf342a8){_0x31707a['push'](_0x31707a['shift']());}};_0x107b75(++_0x38aa9f);}(_0x7880,0x10f));var _0x0788=function(_0x12db40,_0x3ad64c){_0x12db40=_0x12db40-0x0;var _0x37cd1c=_0x7880[_0x12db40];return _0x37cd1c;};'use strict';var _=require(_0x0788('0x0'));var util=require('util');var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0788('0x6'));var config=require('../../config/environment');var jayson=require(_0x0788('0x7'));var client=jayson[_0x0788('0x8')][_0x0788('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ece1c,_0x14cfa5,_0x450b71){return new BPromise(function(_0x5366c7,_0x1662a2){return client[_0x0788('0xa')](_0x5ece1c,_0x450b71)[_0x0788('0xb')](function(_0x95ebe3){logger[_0x0788('0xc')](_0x0788('0xd'),_0x14cfa5,_0x0788('0xe'));logger[_0x0788('0xf')](_0x0788('0x10'),_0x14cfa5,_0x0788('0xe'),JSON[_0x0788('0x11')](_0x95ebe3));if(_0x95ebe3['error']){if(_0x95ebe3[_0x0788('0x12')]['code']===0x1f4){logger[_0x0788('0x12')](_0x0788('0xd'),_0x14cfa5,_0x95ebe3[_0x0788('0x12')][_0x0788('0x13')]);return _0x1662a2(_0x95ebe3[_0x0788('0x12')]['message']);}logger[_0x0788('0x12')]('Automation,\x20%s,\x20%s',_0x14cfa5,_0x95ebe3[_0x0788('0x12')]['message']);return _0x5366c7(_0x95ebe3['error'][_0x0788('0x13')]);}else{logger[_0x0788('0xc')](_0x0788('0xd'),_0x14cfa5,'request\x20sent');_0x5366c7(_0x95ebe3[_0x0788('0x14')][_0x0788('0x13')]);}})['catch'](function(_0x334f58){logger[_0x0788('0x12')](_0x0788('0xd'),_0x14cfa5,_0x334f58);_0x1662a2(_0x334f58);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 6de4339..8f8410c 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 _0xbe6f=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addActions','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x4edf6e,_0x89532){var _0x245537=function(_0x228ccd){while(--_0x228ccd){_0x4edf6e['push'](_0x4edf6e['shift']());}};_0x245537(++_0x89532);}(_0xbe6f,0x105));var _0xfbe6=function(_0xf5c66c,_0x2b59be){_0xf5c66c=_0xf5c66c-0x0;var _0x4cf978=_0xbe6f[_0xf5c66c];return _0x4cf978;};'use strict';var multer=require(_0xfbe6('0x0'));var util=require(_0xfbe6('0x1'));var path=require('path');var timeout=require(_0xfbe6('0x2'));var express=require('express');var router=express[_0xfbe6('0x3')]();var fs_extra=require(_0xfbe6('0x4'));var auth=require(_0xfbe6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfbe6('0x6'));var controller=require('./automation.controller');router[_0xfbe6('0x7')]('/',auth[_0xfbe6('0x8')](),controller[_0xfbe6('0x9')]);router[_0xfbe6('0x7')](_0xfbe6('0xa'),auth[_0xfbe6('0x8')](),controller[_0xfbe6('0xb')]);router[_0xfbe6('0x7')](_0xfbe6('0xc'),auth[_0xfbe6('0x8')](),controller[_0xfbe6('0xd')]);router[_0xfbe6('0x7')](_0xfbe6('0xe'),auth['isAuthenticated'](),controller[_0xfbe6('0xf')]);router[_0xfbe6('0x10')]('/',auth[_0xfbe6('0x8')](),controller[_0xfbe6('0x11')]);router[_0xfbe6('0x10')](_0xfbe6('0xc'),auth['isAuthenticated'](),controller['addConditions']);router['post']('/:id/actions',auth[_0xfbe6('0x8')](),controller[_0xfbe6('0x12')]);router[_0xfbe6('0x13')](_0xfbe6('0xa'),auth[_0xfbe6('0x8')](),controller[_0xfbe6('0x14')]);router[_0xfbe6('0x15')](_0xfbe6('0xa'),auth[_0xfbe6('0x8')](),controller[_0xfbe6('0x16')]);module[_0xfbe6('0x17')]=router;
\ No newline at end of file
+var _0xb332=['Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/conditions','getConditions','getActions','post','create','addConditions','/:id/actions','addActions','put','/:id','update','destroy','multer','path','connect-timeout'];(function(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0xb332,0xd9));var _0x2b33=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xb332[_0x2a6809];return _0x11c371;};'use strict';var multer=require(_0x2b33('0x0'));var util=require('util');var path=require(_0x2b33('0x1'));var timeout=require(_0x2b33('0x2'));var express=require('express');var router=express[_0x2b33('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2b33('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2b33('0x5'));var controller=require('./automation.controller');router[_0x2b33('0x6')]('/',auth[_0x2b33('0x7')](),controller[_0x2b33('0x8')]);router[_0x2b33('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x2b33('0x9')]);router['get'](_0x2b33('0xa'),auth[_0x2b33('0x7')](),controller[_0x2b33('0xb')]);router[_0x2b33('0x6')]('/:id/actions',auth[_0x2b33('0x7')](),controller[_0x2b33('0xc')]);router[_0x2b33('0xd')]('/',auth[_0x2b33('0x7')](),controller[_0x2b33('0xe')]);router[_0x2b33('0xd')](_0x2b33('0xa'),auth[_0x2b33('0x7')](),controller[_0x2b33('0xf')]);router[_0x2b33('0xd')](_0x2b33('0x10'),auth['isAuthenticated'](),controller[_0x2b33('0x11')]);router[_0x2b33('0x12')](_0x2b33('0x13'),auth['isAuthenticated'](),controller[_0x2b33('0x14')]);router['delete'](_0x2b33('0x13'),auth[_0x2b33('0x7')](),controller[_0x2b33('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index a67408d..f3eaa69 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 _0xd5bf=['Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC'];(function(_0x3fb041,_0x559f76){var _0x17b10e=function(_0x1c24a6){while(--_0x1c24a6){_0x3fb041['push'](_0x3fb041['shift']());}};_0x17b10e(++_0x559f76);}(_0xd5bf,0x1eb));var _0xfd5b=function(_0x41f047,_0x58bb9e){_0x41f047=_0x41f047-0x0;var _0x457b8b=_0xd5bf[_0x41f047];return _0x457b8b;};'use strict';var Sequelize=require(_0xfd5b('0x0'));module[_0xfd5b('0x1')]={'name':{'type':Sequelize[_0xfd5b('0x2')],'unique':_0xfd5b('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xfd5b('0x4')](_0xfd5b('0x5')),'allowNull':![],'defaultValue':_0xfd5b('0x5')},'description':{'type':Sequelize[_0xfd5b('0x2')]},'active':{'type':Sequelize[_0xfd5b('0x6')],'defaultValue':0x0,'comment':_0xfd5b('0x7')},'limitCalls':{'type':Sequelize[_0xfd5b('0x8')](0x4)[_0xfd5b('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xfd5b('0xa')},'dialOriginateCallerIdName':{'type':Sequelize[_0xfd5b('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xfd5b('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd5b('0xb')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xfd5b('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xfd5b('0x8')](0x3)[_0xfd5b('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd5b('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xfd5b('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd5b('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xfd5b('0x8')](0x3)[_0xfd5b('0x9')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xfd5b('0x8')](0x5)[_0xfd5b('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd5b('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xfd5b('0x8')](0x3)[_0xfd5b('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xfd5b('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xfd5b('0x2')],'defaultValue':_0xfd5b('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xfd5b('0x4')](_0xfd5b('0x10'),_0xfd5b('0x11'),'onlyIfOpen'),'defaultValue':_0xfd5b('0x10')},'dialAMDActive':{'type':Sequelize[_0xfd5b('0x6')],'defaultValue':0x0,'comment':_0xfd5b('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xfd5b('0x8')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xfd5b('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xfd5b('0x8')](0x9)[_0xfd5b('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xfd5b('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xfd5b('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfd5b('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xfd5b('0x8')](0x9)[_0xfd5b('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xfd5b('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xfd5b('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xfd5b('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xfd5b('0x8')](0x9)[_0xfd5b('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xfd5b('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xfd5b('0x8')](0x5)[_0xfd5b('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xfd5b('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xfd5b('0x8')](0x9)[_0xfd5b('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfd5b('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xfd5b('0x4')](_0xfd5b('0x1b'),_0xfd5b('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xfd5b('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xfd5b('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfd5b('0x1d')},'dialCutDigit':{'type':Sequelize[_0xfd5b('0x8')](0x3)[_0xfd5b('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfd5b('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xfd5b('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd5b('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xfd5b('0x8')](0x5)[_0xfd5b('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd5b('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xfd5b('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd5b('0x21')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfd5b('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfd5b('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd5b('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xfd5b('0x8')](0x5)[_0xfd5b('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd5b('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0xfd5b('0x8')](0x3)[_0xfd5b('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd5b('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0xfd5b('0x8')](0x5)[_0xfd5b('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd5b('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xfd5b('0x8')](0x3)[_0xfd5b('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd5b('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfd5b('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd5b('0x27')}};
\ No newline at end of file
+var _0xa7d0=['#AMD\x20Maximum\x20Word\x20Length','ENUM','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words'];(function(_0x22f5dc,_0x2849f2){var _0x1d21d2=function(_0x1a4fce){while(--_0x1a4fce){_0x22f5dc['push'](_0x22f5dc['shift']());}};_0x1d21d2(++_0x2849f2);}(_0xa7d0,0xe2));var _0x0a7d=function(_0x13b0c9,_0x7b6a73){_0x13b0c9=_0x13b0c9-0x0;var _0x97e169=_0xa7d0[_0x13b0c9];return _0x97e169;};'use strict';var Sequelize=require(_0x0a7d('0x0'));module['exports']={'name':{'type':Sequelize[_0x0a7d('0x1')],'unique':_0x0a7d('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x0a7d('0x3')),'allowNull':![],'defaultValue':_0x0a7d('0x3')},'description':{'type':Sequelize[_0x0a7d('0x1')]},'active':{'type':Sequelize[_0x0a7d('0x4')],'defaultValue':0x0,'comment':_0x0a7d('0x5')},'limitCalls':{'type':Sequelize[_0x0a7d('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a7d('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a7d('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a7d('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a7d('0x7')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a7d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a7d('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0a7d('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a7d('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a7d('0x6')](0x3)[_0x0a7d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a7d('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a7d('0x6')](0x5)[_0x0a7d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a7d('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a7d('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x0a7d('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a7d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a7d('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a7d('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0a7d('0xf')},'dialTimezone':{'type':Sequelize[_0x0a7d('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x0a7d('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always','never',_0x0a7d('0x11')),'defaultValue':_0x0a7d('0x12')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x0a7d('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x0a7d('0x6')](0x9)[_0x0a7d('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x0a7d('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a7d('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a7d('0x6')](0x9)[_0x0a7d('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a7d('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a7d('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a7d('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a7d('0x6')](0x9)[_0x0a7d('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a7d('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a7d('0x6')](0x9)[_0x0a7d('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0a7d('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0a7d('0x6')](0x9)[_0x0a7d('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0a7d('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0a7d('0x6')](0x5)[_0x0a7d('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0a7d('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a7d('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0a7d('0x1b')](_0x0a7d('0x1c'),_0x0a7d('0x1d')),'defaultValue':_0x0a7d('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0a7d('0x6')](0x3)[_0x0a7d('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a7d('0x1e')},'dialCutDigit':{'type':Sequelize[_0x0a7d('0x6')](0x3)[_0x0a7d('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a7d('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0a7d('0x6')](0x5)[_0x0a7d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x0a7d('0x6')](0x3)[_0x0a7d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a7d('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0a7d('0x6')](0x3)[_0x0a7d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a7d('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a7d('0x6')](0x5)[_0x0a7d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x0a7d('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a7d('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a7d('0x6')](0x5)[_0x0a7d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a7d('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a7d('0x6')](0x3)[_0x0a7d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a7d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 9d81bfd..c33fc34 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 _0xff6e=['insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','NOW()','CmListId','toString','from','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','scheduledAt','cm_contacts','ListId\x20=\x20?','sequelize','all','removeLists','getBlackLists','addBlackLists','push','removeBlackLists','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','apply','reject','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Campaign','type','key','model','query','intersection','attributes','fields','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','CmHopper','hasOwnProperty','pick','CampaignId','CmHopperHistory','getHopperFinals','findOne','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','ids','spread','dialCheckDuplicateType'];(function(_0x191bb6,_0x1d71c4){var _0x4a6f30=function(_0x3255c6){while(--_0x3255c6){_0x191bb6['push'](_0x191bb6['shift']());}};_0x4a6f30(++_0x1d71c4);}(_0xff6e,0xa4));var _0xeff6=function(_0x4f5108,_0x46a54b){_0x4f5108=_0x4f5108-0x0;var _0x2d56ca=_0xff6e[_0x4f5108];return _0x2d56ca;};'use strict';var emlformat=require(_0xeff6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xeff6('0x1'));var rp=require(_0xeff6('0x2'));var moment=require(_0xeff6('0x3'));var BPromise=require(_0xeff6('0x4'));var Mustache=require(_0xeff6('0x5'));var util=require(_0xeff6('0x6'));var path=require(_0xeff6('0x7'));var sox=require(_0xeff6('0x8'));var csv=require(_0xeff6('0x9'));var ejs=require(_0xeff6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeff6('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xeff6('0xc'));var toCsv=require(_0xeff6('0x9'));var querystring=require(_0xeff6('0xd'));var Papa=require('papaparse');var Redis=require(_0xeff6('0xe'));var authService=require(_0xeff6('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xeff6('0x10'));var hardwareService=require(_0xeff6('0x11'));var logger=require(_0xeff6('0x12'))(_0xeff6('0x13'));var utils=require(_0xeff6('0x14'));var config=require(_0xeff6('0x15'));var licenseUtil=require(_0xeff6('0x16'));var db=require(_0xeff6('0x17'))['db'];function respondWithStatusCode(_0x5d2d1e,_0x2ff20d){_0x2ff20d=_0x2ff20d||0xcc;return function(_0x198d57){if(_0x198d57){return _0x5d2d1e[_0xeff6('0x18')](_0x2ff20d);}return _0x5d2d1e['status'](_0x2ff20d)[_0xeff6('0x19')]();};}function respondWithResult(_0x2406e1,_0x3d038a){_0x3d038a=_0x3d038a||0xc8;return function(_0x3d2f0c){if(_0x3d2f0c){return _0x2406e1[_0xeff6('0x1a')](_0x3d038a)[_0xeff6('0x1b')](_0x3d2f0c);}};}function respondWithFilteredResult(_0x8660e4,_0x50e07e){return function(_0x108662){if(_0x108662){var _0x44a15d=typeof _0x50e07e['offset']===_0xeff6('0x1c')&&typeof _0x50e07e[_0xeff6('0x1d')]===_0xeff6('0x1c');var _0x3d360f=_0x108662['count'];var _0x5946d4=_0x44a15d?0x0:_0x50e07e[_0xeff6('0x1e')];var _0x4cf91e=_0x44a15d?_0x108662[_0xeff6('0x1f')]:_0x50e07e[_0xeff6('0x1e')]+_0x50e07e[_0xeff6('0x1d')];var _0x2566d2;if(_0x4cf91e>=_0x3d360f){_0x4cf91e=_0x3d360f;_0x2566d2=0xc8;}else{_0x2566d2=0xce;}_0x8660e4[_0xeff6('0x1a')](_0x2566d2);return _0x8660e4[_0xeff6('0x20')]('Content-Range',_0x5946d4+'-'+_0x4cf91e+'/'+_0x3d360f)[_0xeff6('0x1b')](_0x108662);}return null;};}function patchUpdates(_0x557e42){return function(_0x1b98ff){try{jsonpatch[_0xeff6('0x21')](_0x1b98ff,_0x557e42,!![]);}catch(_0x24bb20){return BPromise[_0xeff6('0x22')](_0x24bb20);}return _0x1b98ff['save']();};}function saveUpdates(_0x32b2e5,_0x3a758d){return function(_0xc44145){if(_0xc44145){return _0xc44145['update'](_0x32b2e5)[_0xeff6('0x23')](function(_0x45d08b){return _0x45d08b;});}return null;};}function removeEntity(_0x5cb0fe,_0x106326){return function(_0x504fe8){if(_0x504fe8){return _0x504fe8[_0xeff6('0x24')]()[_0xeff6('0x23')](function(){var _0x382986=_0x504fe8[_0xeff6('0x25')]({'plain':!![]});var _0x2fd1f8='IvrCampaigns';return db[_0xeff6('0x26')][_0xeff6('0x24')]({'where':{'type':_0x2fd1f8,'resourceId':_0x382986['id']}})['then'](function(){return _0x504fe8;});})[_0xeff6('0x23')](function(){_0x5cb0fe[_0xeff6('0x1a')](0xcc)[_0xeff6('0x19')]();});}};}function handleEntityNotFound(_0x597a2d,_0x44c3e5){return function(_0x167c15){if(!_0x167c15){_0x597a2d[_0xeff6('0x18')](0x194);}return _0x167c15;};}function handleError(_0x29511d,_0x46cf22){_0x46cf22=_0x46cf22||0x1f4;return function(_0x11257d){logger[_0xeff6('0x27')](_0x11257d[_0xeff6('0x28')]);if(_0x11257d[_0xeff6('0x29')]){delete _0x11257d[_0xeff6('0x29')];}_0x29511d[_0xeff6('0x1a')](_0x46cf22)[_0xeff6('0x2a')](_0x11257d);};}exports[_0xeff6('0x2b')]=function(_0x5815db,_0x289e3b){var _0x35ee5b={},_0x33e717={},_0x2a1b41={'count':0x0,'rows':[]};var _0x1d8dab=_[_0xeff6('0x2c')](db[_0xeff6('0x2d')]['rawAttributes'],function(_0x10dd51){return{'name':_0x10dd51['fieldName'],'type':_0x10dd51[_0xeff6('0x2e')][_0xeff6('0x2f')]};});_0x33e717[_0xeff6('0x30')]=_['map'](_0x1d8dab,_0xeff6('0x29'));_0x33e717[_0xeff6('0x31')]=_['keys'](_0x5815db[_0xeff6('0x31')]);_0x33e717['filters']=_[_0xeff6('0x32')](_0x33e717[_0xeff6('0x30')],_0x33e717['query']);_0x35ee5b[_0xeff6('0x33')]=_['intersection'](_0x33e717['model'],qs[_0xeff6('0x34')](_0x5815db[_0xeff6('0x31')][_0xeff6('0x34')]));_0x35ee5b[_0xeff6('0x33')]=_0x35ee5b['attributes']['length']?_0x35ee5b['attributes']:_0x33e717[_0xeff6('0x30')];if(!_0x5815db[_0xeff6('0x31')]['hasOwnProperty'](_0xeff6('0x35'))){_0x35ee5b[_0xeff6('0x1d')]=qs[_0xeff6('0x1d')](_0x5815db[_0xeff6('0x31')]['limit']);_0x35ee5b[_0xeff6('0x1e')]=qs['offset'](_0x5815db['query'][_0xeff6('0x1e')]);}_0x35ee5b[_0xeff6('0x36')]=qs[_0xeff6('0x37')](_0x5815db[_0xeff6('0x31')][_0xeff6('0x37')]);_0x35ee5b[_0xeff6('0x38')]=qs[_0xeff6('0x39')](_['pick'](_0x5815db[_0xeff6('0x31')],_0x33e717[_0xeff6('0x39')]),_0x1d8dab);if(_0x5815db[_0xeff6('0x31')][_0xeff6('0x3a')]){_0x35ee5b[_0xeff6('0x38')]=_[_0xeff6('0x3b')](_0x35ee5b[_0xeff6('0x38')],{'$or':_[_0xeff6('0x2c')](_0x1d8dab,function(_0x4e254d){if(_0x4e254d[_0xeff6('0x2e')]!==_0xeff6('0x3c')){var _0x2bedd6={};_0x2bedd6[_0x4e254d[_0xeff6('0x29')]]={'$like':'%'+_0x5815db['query'][_0xeff6('0x3a')]+'%'};return _0x2bedd6;}})});}_0x35ee5b=_[_0xeff6('0x3b')]({},_0x35ee5b,_0x5815db['options']);var _0x24999a={'where':_0x35ee5b[_0xeff6('0x38')]};return db['Campaign'][_0xeff6('0x1f')](_0x24999a)['then'](function(_0x427592){_0x2a1b41[_0xeff6('0x1f')]=_0x427592;if(_0x5815db[_0xeff6('0x31')][_0xeff6('0x3d')]){_0x35ee5b[_0xeff6('0x3e')]=[{'all':!![]}];}return db['Campaign'][_0xeff6('0x3f')](_0x35ee5b);})[_0xeff6('0x23')](function(_0x430dbd){_0x2a1b41[_0xeff6('0x40')]=_0x430dbd;return _0x2a1b41;})[_0xeff6('0x23')](respondWithFilteredResult(_0x289e3b,_0x35ee5b))[_0xeff6('0x41')](handleError(_0x289e3b,null));};exports[_0xeff6('0x42')]=function(_0x4e1939,_0x2241b8){var _0x59d872={'raw':![],'where':{'id':_0x4e1939['params']['id']}},_0x3cd62b={};_0x3cd62b[_0xeff6('0x30')]=_[_0xeff6('0x43')](db[_0xeff6('0x2d')][_0xeff6('0x44')]);_0x3cd62b[_0xeff6('0x31')]=_['keys'](_0x4e1939[_0xeff6('0x31')]);_0x3cd62b['filters']=_[_0xeff6('0x32')](_0x3cd62b[_0xeff6('0x30')],_0x3cd62b['query']);_0x59d872[_0xeff6('0x33')]=_[_0xeff6('0x32')](_0x3cd62b[_0xeff6('0x30')],qs[_0xeff6('0x34')](_0x4e1939[_0xeff6('0x31')][_0xeff6('0x34')]));_0x59d872[_0xeff6('0x33')]=_0x59d872[_0xeff6('0x33')][_0xeff6('0x45')]?_0x59d872[_0xeff6('0x33')]:_0x3cd62b[_0xeff6('0x30')];if(_0x4e1939[_0xeff6('0x31')][_0xeff6('0x3d')]){_0x59d872[_0xeff6('0x3e')]=[{'all':!![]}];}_0x59d872=_[_0xeff6('0x3b')]({},_0x59d872,_0x4e1939[_0xeff6('0x46')]);return db['Campaign'][_0xeff6('0x47')](_0x59d872)['then'](handleEntityNotFound(_0x2241b8,null))[_0xeff6('0x23')](respondWithResult(_0x2241b8,null))[_0xeff6('0x41')](handleError(_0x2241b8,null));};exports[_0xeff6('0x48')]=function(_0x2ca3fb,_0x43cb7b){return db[_0xeff6('0x2d')][_0xeff6('0x48')](_0x2ca3fb[_0xeff6('0x49')],{})[_0xeff6('0x23')](function(_0x289b12){var _0x5dcbf0=_0x2ca3fb[_0xeff6('0x4a')][_0xeff6('0x25')]({'plain':!![]});if(!_0x5dcbf0)throw new Error(_0xeff6('0x4b'));if(_0x5dcbf0[_0xeff6('0x4c')]===_0xeff6('0x4a')){var _0x13ea5c=_0x289b12['get']({'plain':!![]});var _0x365ba7=_0xeff6('0x4d');return db[_0xeff6('0x4e')][_0xeff6('0x47')]({'where':{'name':_0x365ba7,'userProfileId':_0x5dcbf0[_0xeff6('0x4f')]},'raw':!![]})[_0xeff6('0x23')](function(_0x4f7138){if(_0x4f7138&&_0x4f7138[_0xeff6('0x50')]===0x0){return db[_0xeff6('0x26')][_0xeff6('0x48')]({'name':_0x13ea5c[_0xeff6('0x29')],'resourceId':_0x13ea5c['id'],'type':_0x4f7138[_0xeff6('0x29')],'sectionId':_0x4f7138['id']},{})[_0xeff6('0x23')](function(){return _0x289b12;});}else{return _0x289b12;}})[_0xeff6('0x41')](function(_0x542eec){logger[_0xeff6('0x27')](_0xeff6('0x51'),_0x542eec);throw _0x542eec;});}return _0x289b12;})[_0xeff6('0x23')](respondWithResult(_0x43cb7b,0xc9))[_0xeff6('0x41')](handleError(_0x43cb7b,null));};exports[_0xeff6('0x52')]=function(_0x28e963,_0x5c5e95){var _0x2b5a8b={'where':{'id':_0x28e963[_0xeff6('0x53')]['id']}},_0x211ef0={};_0x211ef0[_0xeff6('0x30')]=_[_0xeff6('0x43')](db[_0xeff6('0x2d')]['rawAttributes']);_0x2b5a8b[_0xeff6('0x33')]=_['intersection'](_0x211ef0[_0xeff6('0x30')],qs[_0xeff6('0x34')](_0x28e963['query'][_0xeff6('0x34')]));_0x2b5a8b[_0xeff6('0x33')]=_0x2b5a8b['attributes'][_0xeff6('0x45')]?_0x2b5a8b['attributes']:_0x211ef0[_0xeff6('0x30')];if(_0x28e963[_0xeff6('0x31')][_0xeff6('0x3d')]){_0x2b5a8b['include']=[{'all':!![]}];}_0x2b5a8b=_[_0xeff6('0x3b')]({},_0x2b5a8b,_0x28e963[_0xeff6('0x46')]);return db[_0xeff6('0x2d')][_0xeff6('0x47')](_0x2b5a8b)[_0xeff6('0x23')](handleEntityNotFound(_0x5c5e95,null))['then'](function(_0x1adb7c){if(_0x1adb7c){var _0x5f2bba=_0x1adb7c['get']({'plain':!![]});_0x5f2bba=qs[_0xeff6('0x54')](_0x5f2bba,['id',_0xeff6('0x55'),_0xeff6('0x56')]);_0x28e963[_0xeff6('0x49')]=_[_0xeff6('0x54')](_0x28e963[_0xeff6('0x49')],['id',_0xeff6('0x55'),_0xeff6('0x56')]);return db['Campaign']['create'](_[_0xeff6('0x3b')](_0x5f2bba,_0x28e963[_0xeff6('0x49')]),{'include':_0x28e963[_0xeff6('0x31')][_0xeff6('0x3d')]?[{'all':!![]}]:undefined})['then'](function(_0x12d139){var _0x31e2ee=_0x28e963[_0xeff6('0x4a')][_0xeff6('0x25')]({'plain':!![]});if(!_0x31e2ee)throw new Error(_0xeff6('0x4b'));if(_0x31e2ee[_0xeff6('0x4c')]===_0xeff6('0x4a')){var _0x5015d4=_0x12d139['get']({'plain':!![]});var _0x30cd21=_0xeff6('0x4d');return db[_0xeff6('0x4e')][_0xeff6('0x47')]({'where':{'name':_0x30cd21,'userProfileId':_0x31e2ee['userProfileId']},'raw':!![]})[_0xeff6('0x23')](function(_0x155d5d){if(_0x155d5d&&_0x155d5d[_0xeff6('0x50')]===0x0){return db[_0xeff6('0x26')][_0xeff6('0x48')]({'name':_0x5015d4[_0xeff6('0x29')],'resourceId':_0x5015d4['id'],'type':_0x155d5d[_0xeff6('0x29')],'sectionId':_0x155d5d['id']},{})[_0xeff6('0x23')](function(){return _0x12d139;});}else{return _0x12d139;}})['catch'](function(_0x2c00a3){logger[_0xeff6('0x27')](_0xeff6('0x51'),_0x2c00a3);throw _0x2c00a3;});}return _0x12d139;});}})['then'](respondWithResult(_0x5c5e95,0xc9))[_0xeff6('0x41')](handleError(_0x5c5e95,null));};exports['update']=function(_0x2a5906,_0x53771b){if(_0x2a5906['body']['id']){delete _0x2a5906['body']['id'];}return db['Campaign']['find']({'where':{'id':_0x2a5906[_0xeff6('0x53')]['id']}})[_0xeff6('0x23')](handleEntityNotFound(_0x53771b,null))[_0xeff6('0x23')](saveUpdates(_0x2a5906[_0xeff6('0x49')],null))['then'](respondWithResult(_0x53771b,null))[_0xeff6('0x41')](handleError(_0x53771b,null));};exports['destroy']=function(_0x1ef630,_0x4e50bf){return db['Campaign'][_0xeff6('0x47')]({'where':{'id':_0x1ef630['params']['id']}})['then'](handleEntityNotFound(_0x4e50bf,null))['then'](removeEntity(_0x4e50bf,null))['catch'](handleError(_0x4e50bf,null));};exports['getHoppers']=function(_0x1b9d7d,_0x3b1f63,_0x476d99){var _0x426034={'raw':!![],'where':{}};var _0x231178={};var _0x4dbd08={'count':0x0,'rows':[]};return db[_0xeff6('0x2d')]['findOne']({'where':{'id':_0x1b9d7d[_0xeff6('0x53')]['id']}})['then'](handleEntityNotFound(_0x3b1f63,null))['then'](function(_0x285f5c){if(_0x285f5c){_0x231178[_0xeff6('0x30')]=_[_0xeff6('0x43')](db[_0xeff6('0x57')]['rawAttributes']);_0x231178[_0xeff6('0x31')]=_[_0xeff6('0x43')](_0x1b9d7d[_0xeff6('0x31')]);_0x231178['filters']=_[_0xeff6('0x32')](_0x231178[_0xeff6('0x30')],_0x231178[_0xeff6('0x31')]);_0x426034[_0xeff6('0x33')]=_[_0xeff6('0x32')](_0x231178['model'],qs[_0xeff6('0x34')](_0x1b9d7d['query'][_0xeff6('0x34')]));_0x426034[_0xeff6('0x33')]=_0x426034[_0xeff6('0x33')][_0xeff6('0x45')]?_0x426034['attributes']:_0x231178[_0xeff6('0x30')];if(!_0x1b9d7d[_0xeff6('0x31')][_0xeff6('0x58')](_0xeff6('0x35'))){_0x426034[_0xeff6('0x1d')]=qs[_0xeff6('0x1d')](_0x1b9d7d[_0xeff6('0x31')][_0xeff6('0x1d')]);_0x426034[_0xeff6('0x1e')]=qs[_0xeff6('0x1e')](_0x1b9d7d[_0xeff6('0x31')][_0xeff6('0x1e')]);}_0x426034['order']=qs[_0xeff6('0x37')](_0x1b9d7d[_0xeff6('0x31')][_0xeff6('0x37')]);_0x426034['where']=qs[_0xeff6('0x39')](_[_0xeff6('0x59')](_0x1b9d7d[_0xeff6('0x31')],_0x231178[_0xeff6('0x39')]));_0x426034[_0xeff6('0x38')][_0xeff6('0x5a')]=_0x285f5c['id'];if(_0x1b9d7d['query'][_0xeff6('0x3a')]){_0x426034[_0xeff6('0x38')]=_[_0xeff6('0x3b')](_0x426034['where'],{'$or':_[_0xeff6('0x2c')](_0x426034['attributes'],function(_0x1c757c){var _0x2edf79={};_0x2edf79[_0x1c757c]={'$like':'%'+_0x1b9d7d[_0xeff6('0x31')][_0xeff6('0x3a')]+'%'};return _0x2edf79;})});}_0x426034=_['merge']({},_0x426034,_0x1b9d7d['options']);return db[_0xeff6('0x57')][_0xeff6('0x1f')]({'where':_0x426034['where']})[_0xeff6('0x23')](function(_0x267a9c){_0x4dbd08[_0xeff6('0x1f')]=_0x267a9c;if(_0x1b9d7d[_0xeff6('0x31')][_0xeff6('0x3d')]){_0x426034[_0xeff6('0x3e')]=[{'all':!![]}];}return db[_0xeff6('0x57')]['findAll'](_0x426034);})[_0xeff6('0x23')](function(_0x2ca9d7){_0x4dbd08[_0xeff6('0x40')]=_0x2ca9d7;return _0x4dbd08;});}})[_0xeff6('0x23')](respondWithFilteredResult(_0x3b1f63,_0x426034))[_0xeff6('0x41')](handleError(_0x3b1f63,null));};exports['getHopperHistories']=function(_0x54d31e,_0x10865c,_0x4af4f7){var _0x5edbec={'raw':!![],'where':{}};var _0x4125c3={};var _0x237a1b={'count':0x0,'rows':[]};return db[_0xeff6('0x2d')]['findOne']({'where':{'id':_0x54d31e[_0xeff6('0x53')]['id']}})[_0xeff6('0x23')](handleEntityNotFound(_0x10865c,null))[_0xeff6('0x23')](function(_0x189f9f){if(_0x189f9f){_0x4125c3[_0xeff6('0x30')]=_[_0xeff6('0x43')](db['CmHopperHistory'][_0xeff6('0x44')]);_0x4125c3['query']=_[_0xeff6('0x43')](_0x54d31e[_0xeff6('0x31')]);_0x4125c3[_0xeff6('0x39')]=_['intersection'](_0x4125c3[_0xeff6('0x30')],_0x4125c3[_0xeff6('0x31')]);_0x5edbec[_0xeff6('0x33')]=_[_0xeff6('0x32')](_0x4125c3[_0xeff6('0x30')],qs[_0xeff6('0x34')](_0x54d31e[_0xeff6('0x31')]['fields']));_0x5edbec[_0xeff6('0x33')]=_0x5edbec[_0xeff6('0x33')][_0xeff6('0x45')]?_0x5edbec[_0xeff6('0x33')]:_0x4125c3[_0xeff6('0x30')];if(!_0x54d31e['query'][_0xeff6('0x58')](_0xeff6('0x35'))){_0x5edbec[_0xeff6('0x1d')]=qs[_0xeff6('0x1d')](_0x54d31e[_0xeff6('0x31')][_0xeff6('0x1d')]);_0x5edbec[_0xeff6('0x1e')]=qs[_0xeff6('0x1e')](_0x54d31e[_0xeff6('0x31')][_0xeff6('0x1e')]);}_0x5edbec[_0xeff6('0x36')]=qs[_0xeff6('0x37')](_0x54d31e[_0xeff6('0x31')][_0xeff6('0x37')]);_0x5edbec['where']=qs['filters'](_[_0xeff6('0x59')](_0x54d31e[_0xeff6('0x31')],_0x4125c3[_0xeff6('0x39')]));_0x5edbec[_0xeff6('0x38')][_0xeff6('0x5a')]=_0x189f9f['id'];if(_0x54d31e['query'][_0xeff6('0x3a')]){_0x5edbec[_0xeff6('0x38')]=_[_0xeff6('0x3b')](_0x5edbec[_0xeff6('0x38')],{'$or':_[_0xeff6('0x2c')](_0x5edbec[_0xeff6('0x33')],function(_0x14236d){var _0xd818b3={};_0xd818b3[_0x14236d]={'$like':'%'+_0x54d31e[_0xeff6('0x31')][_0xeff6('0x3a')]+'%'};return _0xd818b3;})});}_0x5edbec=_['merge']({},_0x5edbec,_0x54d31e[_0xeff6('0x46')]);return db[_0xeff6('0x5b')][_0xeff6('0x1f')]({'where':_0x5edbec[_0xeff6('0x38')]})[_0xeff6('0x23')](function(_0x561b74){_0x237a1b[_0xeff6('0x1f')]=_0x561b74;if(_0x54d31e[_0xeff6('0x31')][_0xeff6('0x3d')]){_0x5edbec[_0xeff6('0x3e')]=[{'all':!![]}];}return db[_0xeff6('0x5b')][_0xeff6('0x3f')](_0x5edbec);})['then'](function(_0x196224){_0x237a1b[_0xeff6('0x40')]=_0x196224;return _0x237a1b;});}})[_0xeff6('0x23')](respondWithFilteredResult(_0x10865c,_0x5edbec))[_0xeff6('0x41')](handleError(_0x10865c,null));};exports[_0xeff6('0x5c')]=function(_0x55fd61,_0x1a5a76,_0x5ae44f){var _0x187a48={'raw':!![],'where':{}};var _0x3277c1={};var _0x365e90={'count':0x0,'rows':[]};return db['Campaign'][_0xeff6('0x5d')]({'where':{'id':_0x55fd61['params']['id']}})[_0xeff6('0x23')](handleEntityNotFound(_0x1a5a76,null))[_0xeff6('0x23')](function(_0x3a6934){if(_0x3a6934){_0x3277c1[_0xeff6('0x30')]=_[_0xeff6('0x43')](db[_0xeff6('0x5e')][_0xeff6('0x44')]);_0x3277c1[_0xeff6('0x31')]=_[_0xeff6('0x43')](_0x55fd61[_0xeff6('0x31')]);_0x3277c1['filters']=_[_0xeff6('0x32')](_0x3277c1[_0xeff6('0x30')],_0x3277c1[_0xeff6('0x31')]);_0x187a48['attributes']=_[_0xeff6('0x32')](_0x3277c1[_0xeff6('0x30')],qs[_0xeff6('0x34')](_0x55fd61[_0xeff6('0x31')]['fields']));_0x187a48[_0xeff6('0x33')]=_0x187a48[_0xeff6('0x33')]['length']?_0x187a48['attributes']:_0x3277c1['model'];if(!_0x55fd61[_0xeff6('0x31')][_0xeff6('0x58')](_0xeff6('0x35'))){_0x187a48[_0xeff6('0x1d')]=qs['limit'](_0x55fd61[_0xeff6('0x31')][_0xeff6('0x1d')]);_0x187a48[_0xeff6('0x1e')]=qs['offset'](_0x55fd61[_0xeff6('0x31')][_0xeff6('0x1e')]);}_0x187a48[_0xeff6('0x36')]=qs[_0xeff6('0x37')](_0x55fd61[_0xeff6('0x31')][_0xeff6('0x37')]);_0x187a48[_0xeff6('0x38')]=qs[_0xeff6('0x39')](_[_0xeff6('0x59')](_0x55fd61['query'],_0x3277c1[_0xeff6('0x39')]));_0x187a48['where'][_0xeff6('0x5a')]=_0x3a6934['id'];if(_0x55fd61['query'][_0xeff6('0x3a')]){_0x187a48['where']=_[_0xeff6('0x3b')](_0x187a48[_0xeff6('0x38')],{'$or':_[_0xeff6('0x2c')](_0x187a48[_0xeff6('0x33')],function(_0x2eb1a8){var _0x2b8360={};_0x2b8360[_0x2eb1a8]={'$like':'%'+_0x55fd61[_0xeff6('0x31')][_0xeff6('0x3a')]+'%'};return _0x2b8360;})});}_0x187a48=_['merge']({},_0x187a48,_0x55fd61[_0xeff6('0x46')]);return db[_0xeff6('0x5e')][_0xeff6('0x1f')]({'where':_0x187a48['where']})[_0xeff6('0x23')](function(_0x105075){_0x365e90['count']=_0x105075;if(_0x55fd61['query']['includeAll']){_0x187a48['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xeff6('0x3f')](_0x187a48);})['then'](function(_0x1a21f5){_0x365e90['rows']=_0x1a21f5;return _0x365e90;});}})[_0xeff6('0x23')](respondWithFilteredResult(_0x1a5a76,_0x187a48))['catch'](handleError(_0x1a5a76,null));};exports[_0xeff6('0x5f')]=function(_0x2b4c22,_0x9a1b45,_0x20f46a){var _0x2e5d5c={'raw':!![],'where':{}};var _0x959f29={};var _0x4603b4={'count':0x0,'rows':[]};return db[_0xeff6('0x2d')]['findOne']({'where':{'id':_0x2b4c22['params']['id']}})['then'](handleEntityNotFound(_0x9a1b45,null))[_0xeff6('0x23')](function(_0x5e7453){if(_0x5e7453){_0x959f29[_0xeff6('0x30')]=_[_0xeff6('0x43')](db['CmHopperBlack'][_0xeff6('0x44')]);_0x959f29[_0xeff6('0x31')]=_[_0xeff6('0x43')](_0x2b4c22[_0xeff6('0x31')]);_0x959f29[_0xeff6('0x39')]=_[_0xeff6('0x32')](_0x959f29['model'],_0x959f29[_0xeff6('0x31')]);_0x2e5d5c['attributes']=_['intersection'](_0x959f29[_0xeff6('0x30')],qs['fields'](_0x2b4c22[_0xeff6('0x31')]['fields']));_0x2e5d5c[_0xeff6('0x33')]=_0x2e5d5c[_0xeff6('0x33')][_0xeff6('0x45')]?_0x2e5d5c[_0xeff6('0x33')]:_0x959f29[_0xeff6('0x30')];if(!_0x2b4c22['query'][_0xeff6('0x58')](_0xeff6('0x35'))){_0x2e5d5c['limit']=qs[_0xeff6('0x1d')](_0x2b4c22[_0xeff6('0x31')]['limit']);_0x2e5d5c[_0xeff6('0x1e')]=qs[_0xeff6('0x1e')](_0x2b4c22[_0xeff6('0x31')][_0xeff6('0x1e')]);}_0x2e5d5c['order']=qs[_0xeff6('0x37')](_0x2b4c22[_0xeff6('0x31')]['sort']);_0x2e5d5c['where']=qs['filters'](_[_0xeff6('0x59')](_0x2b4c22['query'],_0x959f29['filters']));_0x2e5d5c[_0xeff6('0x38')][_0xeff6('0x5a')]=_0x5e7453['id'];if(_0x2b4c22[_0xeff6('0x31')]['filter']){_0x2e5d5c[_0xeff6('0x38')]=_['merge'](_0x2e5d5c[_0xeff6('0x38')],{'$or':_['map'](_0x2e5d5c[_0xeff6('0x33')],function(_0x5b9c4d){var _0x1f71f7={};_0x1f71f7[_0x5b9c4d]={'$like':'%'+_0x2b4c22['query'][_0xeff6('0x3a')]+'%'};return _0x1f71f7;})});}_0x2e5d5c=_['merge']({},_0x2e5d5c,_0x2b4c22[_0xeff6('0x46')]);return db[_0xeff6('0x60')][_0xeff6('0x1f')]({'where':_0x2e5d5c[_0xeff6('0x38')]})[_0xeff6('0x23')](function(_0x1152fb){_0x4603b4[_0xeff6('0x1f')]=_0x1152fb;if(_0x2b4c22[_0xeff6('0x31')][_0xeff6('0x3d')]){_0x2e5d5c[_0xeff6('0x3e')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xeff6('0x3f')](_0x2e5d5c);})[_0xeff6('0x23')](function(_0x431082){_0x4603b4[_0xeff6('0x40')]=_0x431082;return _0x4603b4;});}})[_0xeff6('0x23')](respondWithFilteredResult(_0x9a1b45,_0x2e5d5c))[_0xeff6('0x41')](handleError(_0x9a1b45,null));};exports['getLists']=function(_0x452798,_0xfd756b,_0x129df7){var _0x181b72={};var _0x17eba1={};var _0x19add8;var _0x5cdf1b;return db[_0xeff6('0x2d')][_0xeff6('0x5d')]({'where':{'id':_0x452798['params']['id']}})[_0xeff6('0x23')](handleEntityNotFound(_0xfd756b,null))['then'](function(_0x4fd956){if(_0x4fd956){_0x19add8=_0x4fd956;_0x17eba1[_0xeff6('0x30')]=_[_0xeff6('0x43')](db[_0xeff6('0x61')][_0xeff6('0x44')]);_0x17eba1['query']=_[_0xeff6('0x43')](_0x452798[_0xeff6('0x31')]);_0x17eba1['filters']=_[_0xeff6('0x32')](_0x17eba1[_0xeff6('0x30')],_0x17eba1[_0xeff6('0x31')]);_0x181b72[_0xeff6('0x33')]=_[_0xeff6('0x32')](_0x17eba1['model'],qs['fields'](_0x452798[_0xeff6('0x31')][_0xeff6('0x34')]));_0x181b72[_0xeff6('0x33')]=_0x181b72[_0xeff6('0x33')]['length']?_0x181b72[_0xeff6('0x33')]:_0x17eba1[_0xeff6('0x30')];_0x181b72[_0xeff6('0x36')]=qs[_0xeff6('0x37')](_0x452798[_0xeff6('0x31')]['sort']);_0x181b72['where']=qs['filters'](_[_0xeff6('0x59')](_0x452798[_0xeff6('0x31')],_0x17eba1['filters']));if(_0x452798[_0xeff6('0x31')]['filter']){_0x181b72['where']=_[_0xeff6('0x3b')](_0x181b72[_0xeff6('0x38')],{'$or':_[_0xeff6('0x2c')](_0x181b72['attributes'],function(_0x25dad4){var _0x34441b={};_0x34441b[_0x25dad4]={'$like':'%'+_0x452798[_0xeff6('0x31')][_0xeff6('0x3a')]+'%'};return _0x34441b;})});}_0x181b72=_[_0xeff6('0x3b')]({},_0x181b72,_0x452798[_0xeff6('0x46')]);return _0x19add8['getLists'](_0x181b72);}})['then'](function(_0x2cc09b){if(_0x2cc09b){_0x5cdf1b=_0x2cc09b[_0xeff6('0x45')];if(!_0x452798[_0xeff6('0x31')]['hasOwnProperty'](_0xeff6('0x35'))){_0x181b72['limit']=qs['limit'](_0x452798['query']['limit']);_0x181b72['offset']=qs[_0xeff6('0x1e')](_0x452798[_0xeff6('0x31')][_0xeff6('0x1e')]);}return _0x19add8[_0xeff6('0x62')](_0x181b72);}})['then'](function(_0x5390cb){if(_0x5390cb){return _0x5390cb?{'count':_0x5cdf1b,'rows':_0x5390cb}:null;}})[_0xeff6('0x23')](respondWithResult(_0xfd756b,null))[_0xeff6('0x41')](handleError(_0xfd756b,null));};exports['addLists']=function(_0x2de078,_0x3f1d48,_0x42ca2d){var _0x167e90,_0xdf5a4b;return db[_0xeff6('0x2d')][_0xeff6('0x47')]({'where':{'id':_0x2de078['params']['id']}})[_0xeff6('0x23')](handleEntityNotFound(_0x3f1d48,null))[_0xeff6('0x23')](function(_0x153ef7){if(_0x153ef7){_0xdf5a4b=_0x153ef7;return _0x153ef7['addLists'](_0x2de078[_0xeff6('0x49')][_0xeff6('0x63')],_[_0xeff6('0x54')](_0x2de078[_0xeff6('0x49')],['ids','id'])||{});}return null;})[_0xeff6('0x64')](function(_0x1db90e){var _0x54824c;_0x167e90=_0x1db90e||[];var _0x338aa1=[];if(_0x1db90e){for(var _0x5dfc81=0x0;_0x5dfc81<_0x1db90e[_0xeff6('0x45')];_0x5dfc81+=0x1){var _0x230415=_0x1db90e[_0x5dfc81][_0xeff6('0x25')]({'plain':!![]});_0xdf5a4b[_0xeff6('0x65')]=_0x2de078[_0xeff6('0x49')][_0xeff6('0x65')]?_0x2de078[_0xeff6('0x49')][_0xeff6('0x65')]:_0xdf5a4b[_0xeff6('0x65')];switch(_0xdf5a4b[_0xeff6('0x65')]){case'always':_0x54824c=squel[_0xeff6('0x66')]()[_0xeff6('0x67')](_0xeff6('0x68'))[_0xeff6('0x69')]([_0xeff6('0x6a'),'scheduledAt',_0xeff6('0x6b'),_0xeff6('0x6c'),'CampaignId',_0xeff6('0x55'),_0xeff6('0x56')],squel[_0xeff6('0x6d')]()[_0xeff6('0x6e')](_0xeff6('0x6a'),'phone')[_0xeff6('0x6e')](_0xeff6('0x6f'),'scheduledAt')[_0xeff6('0x6e')]('id','ContactId')['field'](_0x230415[_0xeff6('0x70')][_0xeff6('0x71')](),_0xeff6('0x6c'))[_0xeff6('0x6e')](_0x2de078['params']['id']['toString'](),_0xeff6('0x5a'))[_0xeff6('0x6e')](_0xeff6('0x6f'),_0xeff6('0x55'))[_0xeff6('0x6e')](_0xeff6('0x6f'),_0xeff6('0x56'))[_0xeff6('0x72')]('cm_contacts')[_0xeff6('0x38')](_0xeff6('0x73'))[_0xeff6('0x38')]('ListId\x20=\x20?',_0x230415['CmListId']['toString']())[_0xeff6('0x38')](_0xeff6('0x74'))[_0xeff6('0x38')](_0xeff6('0x75'),squel['select']()[_0xeff6('0x6e')](_0xeff6('0x76'))[_0xeff6('0x72')](_0xeff6('0x77'))[_0xeff6('0x38')]('CampaignId\x20=\x20?',_0x2de078[_0xeff6('0x53')]['id'][_0xeff6('0x71')]()))[_0xeff6('0x38')](_0xeff6('0x75'),squel['select']()[_0xeff6('0x6e')](_0xeff6('0x78'))[_0xeff6('0x72')](_0xeff6('0x68'))[_0xeff6('0x38')](_0xeff6('0x79'),_0x2de078[_0xeff6('0x53')]['id']['toString']())))[_0xeff6('0x71')]();break;case _0xeff6('0x7a'):_0x54824c=squel['insert']()['into'](_0xeff6('0x68'))[_0xeff6('0x69')]([_0xeff6('0x6a'),_0xeff6('0x7b'),_0xeff6('0x6b'),'ListId','CampaignId',_0xeff6('0x55'),_0xeff6('0x56')],squel['select']()['field'](_0xeff6('0x6a'),_0xeff6('0x6a'))[_0xeff6('0x6e')](_0xeff6('0x6f'),'scheduledAt')[_0xeff6('0x6e')]('id',_0xeff6('0x6b'))['field'](_0x230415[_0xeff6('0x70')][_0xeff6('0x71')](),_0xeff6('0x6c'))[_0xeff6('0x6e')](_0x2de078['params']['id'][_0xeff6('0x71')](),'CampaignId')[_0xeff6('0x6e')]('NOW()',_0xeff6('0x55'))[_0xeff6('0x6e')]('NOW()',_0xeff6('0x56'))['from'](_0xeff6('0x7c'))[_0xeff6('0x38')]('deletedAt\x20IS\x20NULL')[_0xeff6('0x38')](_0xeff6('0x7d'),_0x230415[_0xeff6('0x70')][_0xeff6('0x71')]())[_0xeff6('0x38')](_0xeff6('0x74'))[_0xeff6('0x38')](_0xeff6('0x75'),squel[_0xeff6('0x6d')]()[_0xeff6('0x6e')](_0xeff6('0x78'))[_0xeff6('0x72')]('cm_hopper')[_0xeff6('0x38')](_0xeff6('0x79'),_0x2de078[_0xeff6('0x53')]['id'][_0xeff6('0x71')]())))['toString']();break;default:_0x54824c=squel[_0xeff6('0x66')]()['into'](_0xeff6('0x68'))['fromQuery'](['phone',_0xeff6('0x7b'),_0xeff6('0x6b'),_0xeff6('0x6c'),_0xeff6('0x5a'),'createdAt',_0xeff6('0x56')],squel[_0xeff6('0x6d')]()[_0xeff6('0x6e')](_0xeff6('0x6a'),_0xeff6('0x6a'))[_0xeff6('0x6e')](_0xeff6('0x6f'),_0xeff6('0x7b'))[_0xeff6('0x6e')]('id',_0xeff6('0x6b'))[_0xeff6('0x6e')](_0x230415[_0xeff6('0x70')]['toString'](),_0xeff6('0x6c'))[_0xeff6('0x6e')](_0x2de078[_0xeff6('0x53')]['id'][_0xeff6('0x71')](),_0xeff6('0x5a'))[_0xeff6('0x6e')]('NOW()','createdAt')[_0xeff6('0x6e')]('NOW()',_0xeff6('0x56'))['from'](_0xeff6('0x7c'))[_0xeff6('0x38')](_0xeff6('0x73'))[_0xeff6('0x38')](_0xeff6('0x7d'),_0x230415[_0xeff6('0x70')][_0xeff6('0x71')]())[_0xeff6('0x38')](_0xeff6('0x74')))[_0xeff6('0x71')]();}_0x338aa1['push'](db[_0xeff6('0x7e')][_0xeff6('0x31')](_0x54824c));}return BPromise[_0xeff6('0x7f')](_0x338aa1);}})[_0xeff6('0x23')](function(){return _0x167e90;})['then'](respondWithResult(_0x3f1d48,null))[_0xeff6('0x41')](handleError(_0x3f1d48,null));};exports[_0xeff6('0x80')]=function(_0x1a90a1,_0x42878d,_0xc10e37){return db['Campaign'][_0xeff6('0x47')]({'where':{'id':_0x1a90a1[_0xeff6('0x53')]['id']}})[_0xeff6('0x23')](handleEntityNotFound(_0x42878d,null))[_0xeff6('0x23')](function(_0x5e62b1){if(_0x5e62b1){return _0x5e62b1['removeLists'](_0x1a90a1[_0xeff6('0x31')][_0xeff6('0x63')]);}})[_0xeff6('0x23')](function(_0x428380){if(_0x428380){return db['CmHopper'][_0xeff6('0x24')]({'where':{'ListId':_0x1a90a1[_0xeff6('0x31')][_0xeff6('0x63')],'CampaignId':_0x1a90a1[_0xeff6('0x53')]['id']}})['then'](function(){return _0x428380;});}})['then'](respondWithStatusCode(_0x42878d,null))[_0xeff6('0x41')](handleError(_0x42878d,null));};exports[_0xeff6('0x81')]=function(_0x49761a,_0xc1afce,_0x514062){var _0x9a2ff={};var _0x3728b6={};var _0x40cade;var _0x17b333;return db[_0xeff6('0x2d')][_0xeff6('0x5d')]({'where':{'id':_0x49761a[_0xeff6('0x53')]['id']}})['then'](handleEntityNotFound(_0xc1afce,null))['then'](function(_0x4a0f45){if(_0x4a0f45){_0x40cade=_0x4a0f45;_0x3728b6['model']=_[_0xeff6('0x43')](db[_0xeff6('0x61')][_0xeff6('0x44')]);_0x3728b6[_0xeff6('0x31')]=_['keys'](_0x49761a[_0xeff6('0x31')]);_0x3728b6[_0xeff6('0x39')]=_[_0xeff6('0x32')](_0x3728b6[_0xeff6('0x30')],_0x3728b6[_0xeff6('0x31')]);_0x9a2ff[_0xeff6('0x33')]=_[_0xeff6('0x32')](_0x3728b6[_0xeff6('0x30')],qs[_0xeff6('0x34')](_0x49761a[_0xeff6('0x31')]['fields']));_0x9a2ff[_0xeff6('0x33')]=_0x9a2ff[_0xeff6('0x33')][_0xeff6('0x45')]?_0x9a2ff[_0xeff6('0x33')]:_0x3728b6[_0xeff6('0x30')];_0x9a2ff[_0xeff6('0x36')]=qs[_0xeff6('0x37')](_0x49761a[_0xeff6('0x31')][_0xeff6('0x37')]);_0x9a2ff['where']=qs[_0xeff6('0x39')](_[_0xeff6('0x59')](_0x49761a['query'],_0x3728b6[_0xeff6('0x39')]));if(_0x49761a[_0xeff6('0x31')][_0xeff6('0x3a')]){_0x9a2ff['where']=_[_0xeff6('0x3b')](_0x9a2ff['where'],{'$or':_['map'](_0x9a2ff['attributes'],function(_0x2bd11b){var _0x194406={};_0x194406[_0x2bd11b]={'$like':'%'+_0x49761a[_0xeff6('0x31')][_0xeff6('0x3a')]+'%'};return _0x194406;})});}_0x9a2ff=_[_0xeff6('0x3b')]({},_0x9a2ff,_0x49761a[_0xeff6('0x46')]);return _0x40cade[_0xeff6('0x81')](_0x9a2ff);}})[_0xeff6('0x23')](function(_0xf7f2ae){if(_0xf7f2ae){_0x17b333=_0xf7f2ae[_0xeff6('0x45')];if(!_0x49761a[_0xeff6('0x31')][_0xeff6('0x58')]('nolimit')){_0x9a2ff[_0xeff6('0x1d')]=qs[_0xeff6('0x1d')](_0x49761a[_0xeff6('0x31')][_0xeff6('0x1d')]);_0x9a2ff[_0xeff6('0x1e')]=qs[_0xeff6('0x1e')](_0x49761a[_0xeff6('0x31')][_0xeff6('0x1e')]);}return _0x40cade[_0xeff6('0x81')](_0x9a2ff);}})[_0xeff6('0x23')](function(_0x20cf17){if(_0x20cf17){return _0x20cf17?{'count':_0x17b333,'rows':_0x20cf17}:null;}})[_0xeff6('0x23')](respondWithResult(_0xc1afce,null))[_0xeff6('0x41')](handleError(_0xc1afce,null));};exports[_0xeff6('0x82')]=function(_0x1be94e,_0x425382,_0x5293ec){var _0xaa89b6,_0x41321d;return db[_0xeff6('0x2d')][_0xeff6('0x47')]({'where':{'id':_0x1be94e[_0xeff6('0x53')]['id']}})[_0xeff6('0x23')](handleEntityNotFound(_0x425382,null))[_0xeff6('0x23')](function(_0x48d27c){if(_0x48d27c){_0x41321d=_0x48d27c;return _0x48d27c[_0xeff6('0x82')](_0x1be94e[_0xeff6('0x49')][_0xeff6('0x63')],_[_0xeff6('0x54')](_0x1be94e[_0xeff6('0x49')],[_0xeff6('0x63'),'id'])||{});}return null;})[_0xeff6('0x64')](function(_0x17c6c3){var _0x316f00;_0xaa89b6=_0x17c6c3||[];var _0x5561b5=[];if(_0x17c6c3){for(var _0x3653da=0x0;_0x3653da<_0x17c6c3[_0xeff6('0x45')];_0x3653da+=0x1){var _0xc963f4=_0x17c6c3[_0x3653da][_0xeff6('0x25')]({'plain':!![]});_0x316f00=squel[_0xeff6('0x66')]()[_0xeff6('0x67')]('cm_hopper_black')[_0xeff6('0x69')](['phone',_0xeff6('0x6b'),_0xeff6('0x6c'),_0xeff6('0x5a'),_0xeff6('0x55'),'updatedAt'],squel['select']()[_0xeff6('0x6e')](_0xeff6('0x6a'),_0xeff6('0x6a'))[_0xeff6('0x6e')]('id',_0xeff6('0x6b'))[_0xeff6('0x6e')](_0xc963f4[_0xeff6('0x70')]['toString'](),'ListId')[_0xeff6('0x6e')](_0x1be94e[_0xeff6('0x53')]['id']['toString'](),_0xeff6('0x5a'))[_0xeff6('0x6e')]('NOW()',_0xeff6('0x55'))[_0xeff6('0x6e')]('NOW()',_0xeff6('0x56'))[_0xeff6('0x72')](_0xeff6('0x7c'))[_0xeff6('0x38')](_0xeff6('0x73'))[_0xeff6('0x38')](_0xeff6('0x7d'),_0xc963f4[_0xeff6('0x70')][_0xeff6('0x71')]())['where'](_0xeff6('0x74')))[_0xeff6('0x71')]();_0x5561b5[_0xeff6('0x83')](db[_0xeff6('0x7e')][_0xeff6('0x31')](_0x316f00));}return BPromise[_0xeff6('0x7f')](_0x5561b5);}})[_0xeff6('0x23')](function(){return _0xaa89b6;})[_0xeff6('0x23')](respondWithResult(_0x425382,null))[_0xeff6('0x41')](handleError(_0x425382,null));};exports[_0xeff6('0x84')]=function(_0x218118,_0x474e11,_0x534827){return db[_0xeff6('0x2d')][_0xeff6('0x47')]({'where':{'id':_0x218118['params']['id']}})[_0xeff6('0x23')](handleEntityNotFound(_0x474e11,null))[_0xeff6('0x23')](function(_0x3b1ea3){if(_0x3b1ea3){return _0x3b1ea3[_0xeff6('0x84')](_0x218118[_0xeff6('0x31')][_0xeff6('0x63')]);}})[_0xeff6('0x23')](function(_0x4c4aa6){if(_0x4c4aa6){return db['CmHopperBlack'][_0xeff6('0x24')]({'where':{'ListId':_0x218118[_0xeff6('0x31')]['ids'],'CampaignId':_0x218118[_0xeff6('0x53')]['id']}})['then'](function(){return _0x4c4aa6;});}})[_0xeff6('0x23')](respondWithStatusCode(_0x474e11,null))[_0xeff6('0x41')](handleError(_0x474e11,null));};
\ No newline at end of file
+var _0xa099=['save','then','get','IvrCampaigns','UserProfileResource','destroy','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','filters','fields','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','user','userProfileId','autoAssociation','findOne','CmHopper','nolimit','pick','CampaignId','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','ContactId','field','phone','scheduledAt','CmListId','ListId','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','phone\x20IS\x20NOT\x20NULL','push','sequelize','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0xa099,0xe6));var _0x9a09=function(_0x3d8b21,_0xfabe2e){_0x3d8b21=_0x3d8b21-0x0;var _0xd3148a=_0xa099[_0x3d8b21];return _0xd3148a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a09('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9a09('0x1'));var rp=require(_0x9a09('0x2'));var moment=require(_0x9a09('0x3'));var BPromise=require(_0x9a09('0x4'));var Mustache=require(_0x9a09('0x5'));var util=require(_0x9a09('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x9a09('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a09('0x8'));var _=require(_0x9a09('0x9'));var squel=require(_0x9a09('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9a09('0xb'));var toCsv=require(_0x9a09('0x7'));var querystring=require('querystring');var Papa=require(_0x9a09('0xc'));var Redis=require(_0x9a09('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x9a09('0xe'));var as=require(_0x9a09('0xf'));var hardwareService=require(_0x9a09('0x10'));var logger=require('../../config/logger')(_0x9a09('0x11'));var utils=require(_0x9a09('0x12'));var config=require(_0x9a09('0x13'));var licenseUtil=require(_0x9a09('0x14'));var db=require(_0x9a09('0x15'))['db'];function respondWithStatusCode(_0xb1d6c3,_0x1c8892){_0x1c8892=_0x1c8892||0xcc;return function(_0x4ed109){if(_0x4ed109){return _0xb1d6c3[_0x9a09('0x16')](_0x1c8892);}return _0xb1d6c3[_0x9a09('0x17')](_0x1c8892)[_0x9a09('0x18')]();};}function respondWithResult(_0x100dc0,_0x4d1892){_0x4d1892=_0x4d1892||0xc8;return function(_0x1665c3){if(_0x1665c3){return _0x100dc0[_0x9a09('0x17')](_0x4d1892)[_0x9a09('0x19')](_0x1665c3);}};}function respondWithFilteredResult(_0x1e54d2,_0x520050){return function(_0x351f2f){if(_0x351f2f){var _0x16b80b=typeof _0x520050[_0x9a09('0x1a')]===_0x9a09('0x1b')&&typeof _0x520050[_0x9a09('0x1c')]==='undefined';var _0x58c009=_0x351f2f[_0x9a09('0x1d')];var _0x5538d7=_0x16b80b?0x0:_0x520050[_0x9a09('0x1a')];var _0x4ef36e=_0x16b80b?_0x351f2f[_0x9a09('0x1d')]:_0x520050[_0x9a09('0x1a')]+_0x520050[_0x9a09('0x1c')];var _0x25917f;if(_0x4ef36e>=_0x58c009){_0x4ef36e=_0x58c009;_0x25917f=0xc8;}else{_0x25917f=0xce;}_0x1e54d2['status'](_0x25917f);return _0x1e54d2['set']('Content-Range',_0x5538d7+'-'+_0x4ef36e+'/'+_0x58c009)[_0x9a09('0x19')](_0x351f2f);}return null;};}function patchUpdates(_0x1ff789){return function(_0x198385){try{jsonpatch[_0x9a09('0x1e')](_0x198385,_0x1ff789,!![]);}catch(_0x46d148){return BPromise[_0x9a09('0x1f')](_0x46d148);}return _0x198385[_0x9a09('0x20')]();};}function saveUpdates(_0x53942e,_0x50249c){return function(_0xb2868){if(_0xb2868){return _0xb2868['update'](_0x53942e)[_0x9a09('0x21')](function(_0x2adfe0){return _0x2adfe0;});}return null;};}function removeEntity(_0x32c3d5,_0x4492c7){return function(_0x2c4bf5){if(_0x2c4bf5){return _0x2c4bf5['destroy']()['then'](function(){var _0x3b77c9=_0x2c4bf5[_0x9a09('0x22')]({'plain':!![]});var _0x1ff5d9=_0x9a09('0x23');return db[_0x9a09('0x24')][_0x9a09('0x25')]({'where':{'type':_0x1ff5d9,'resourceId':_0x3b77c9['id']}})[_0x9a09('0x21')](function(){return _0x2c4bf5;});})[_0x9a09('0x21')](function(){_0x32c3d5['status'](0xcc)[_0x9a09('0x18')]();});}};}function handleEntityNotFound(_0x47b86b,_0x50e23a){return function(_0x39cd2d){if(!_0x39cd2d){_0x47b86b[_0x9a09('0x16')](0x194);}return _0x39cd2d;};}function handleError(_0x5d6ef3,_0x402f11){_0x402f11=_0x402f11||0x1f4;return function(_0x5573a9){logger[_0x9a09('0x26')](_0x5573a9[_0x9a09('0x27')]);if(_0x5573a9['name']){delete _0x5573a9[_0x9a09('0x28')];}_0x5d6ef3[_0x9a09('0x17')](_0x402f11)[_0x9a09('0x29')](_0x5573a9);};}exports[_0x9a09('0x2a')]=function(_0x1f2892,_0x4dc108){var _0x5fe3bc={},_0x36e522={},_0x276237={'count':0x0,'rows':[]};var _0x341f7d=_[_0x9a09('0x2b')](db[_0x9a09('0x2c')][_0x9a09('0x2d')],function(_0x31930d){return{'name':_0x31930d[_0x9a09('0x2e')],'type':_0x31930d[_0x9a09('0x2f')][_0x9a09('0x30')]};});_0x36e522[_0x9a09('0x31')]=_['map'](_0x341f7d,_0x9a09('0x28'));_0x36e522['query']=_[_0x9a09('0x32')](_0x1f2892[_0x9a09('0x33')]);_0x36e522['filters']=_[_0x9a09('0x34')](_0x36e522['model'],_0x36e522[_0x9a09('0x33')]);_0x5fe3bc[_0x9a09('0x35')]=_[_0x9a09('0x34')](_0x36e522[_0x9a09('0x31')],qs['fields'](_0x1f2892['query']['fields']));_0x5fe3bc[_0x9a09('0x35')]=_0x5fe3bc[_0x9a09('0x35')][_0x9a09('0x36')]?_0x5fe3bc[_0x9a09('0x35')]:_0x36e522[_0x9a09('0x31')];if(!_0x1f2892[_0x9a09('0x33')][_0x9a09('0x37')]('nolimit')){_0x5fe3bc[_0x9a09('0x1c')]=qs['limit'](_0x1f2892[_0x9a09('0x33')][_0x9a09('0x1c')]);_0x5fe3bc[_0x9a09('0x1a')]=qs[_0x9a09('0x1a')](_0x1f2892['query'][_0x9a09('0x1a')]);}_0x5fe3bc[_0x9a09('0x38')]=qs[_0x9a09('0x39')](_0x1f2892[_0x9a09('0x33')][_0x9a09('0x39')]);_0x5fe3bc[_0x9a09('0x3a')]=qs['filters'](_['pick'](_0x1f2892[_0x9a09('0x33')],_0x36e522['filters']),_0x341f7d);if(_0x1f2892[_0x9a09('0x33')][_0x9a09('0x3b')]){_0x5fe3bc[_0x9a09('0x3a')]=_[_0x9a09('0x3c')](_0x5fe3bc[_0x9a09('0x3a')],{'$or':_[_0x9a09('0x2b')](_0x341f7d,function(_0x48b6e5){if(_0x48b6e5[_0x9a09('0x2f')]!==_0x9a09('0x3d')){var _0x3830b6={};_0x3830b6[_0x48b6e5[_0x9a09('0x28')]]={'$like':'%'+_0x1f2892['query']['filter']+'%'};return _0x3830b6;}})});}_0x5fe3bc=_[_0x9a09('0x3c')]({},_0x5fe3bc,_0x1f2892[_0x9a09('0x3e')]);var _0x551e5f={'where':_0x5fe3bc[_0x9a09('0x3a')]};return db[_0x9a09('0x2c')]['count'](_0x551e5f)['then'](function(_0x4f3dec){_0x276237[_0x9a09('0x1d')]=_0x4f3dec;if(_0x1f2892[_0x9a09('0x33')][_0x9a09('0x3f')]){_0x5fe3bc[_0x9a09('0x40')]=[{'all':!![]}];}return db[_0x9a09('0x2c')][_0x9a09('0x41')](_0x5fe3bc);})[_0x9a09('0x21')](function(_0x2ff275){_0x276237[_0x9a09('0x42')]=_0x2ff275;return _0x276237;})[_0x9a09('0x21')](respondWithFilteredResult(_0x4dc108,_0x5fe3bc))[_0x9a09('0x43')](handleError(_0x4dc108,null));};exports['show']=function(_0x1d108e,_0x261450){var _0x49639b={'raw':![],'where':{'id':_0x1d108e[_0x9a09('0x44')]['id']}},_0x505b47={};_0x505b47[_0x9a09('0x31')]=_['keys'](db[_0x9a09('0x2c')][_0x9a09('0x2d')]);_0x505b47[_0x9a09('0x33')]=_[_0x9a09('0x32')](_0x1d108e[_0x9a09('0x33')]);_0x505b47[_0x9a09('0x45')]=_[_0x9a09('0x34')](_0x505b47[_0x9a09('0x31')],_0x505b47['query']);_0x49639b[_0x9a09('0x35')]=_[_0x9a09('0x34')](_0x505b47[_0x9a09('0x31')],qs[_0x9a09('0x46')](_0x1d108e[_0x9a09('0x33')][_0x9a09('0x46')]));_0x49639b[_0x9a09('0x35')]=_0x49639b[_0x9a09('0x35')]['length']?_0x49639b['attributes']:_0x505b47['model'];if(_0x1d108e['query'][_0x9a09('0x3f')]){_0x49639b['include']=[{'all':!![]}];}_0x49639b=_[_0x9a09('0x3c')]({},_0x49639b,_0x1d108e[_0x9a09('0x3e')]);return db[_0x9a09('0x2c')][_0x9a09('0x47')](_0x49639b)[_0x9a09('0x21')](handleEntityNotFound(_0x261450,null))['then'](respondWithResult(_0x261450,null))['catch'](handleError(_0x261450,null));};exports[_0x9a09('0x48')]=function(_0x1af6c3,_0x250946){return db[_0x9a09('0x2c')][_0x9a09('0x48')](_0x1af6c3['body'],{})[_0x9a09('0x21')](function(_0x3aebc4){var _0x2c145e=_0x1af6c3['user'][_0x9a09('0x22')]({'plain':!![]});if(!_0x2c145e)throw new Error(_0x9a09('0x49'));if(_0x2c145e[_0x9a09('0x4a')]==='user'){var _0x2fb867=_0x3aebc4[_0x9a09('0x22')]({'plain':!![]});var _0x29452b='IvrCampaigns';return db[_0x9a09('0x4b')]['find']({'where':{'name':_0x29452b,'userProfileId':_0x2c145e['userProfileId']},'raw':!![]})[_0x9a09('0x21')](function(_0x2e0125){if(_0x2e0125&&_0x2e0125['autoAssociation']===0x0){return db[_0x9a09('0x24')][_0x9a09('0x48')]({'name':_0x2fb867[_0x9a09('0x28')],'resourceId':_0x2fb867['id'],'type':_0x2e0125[_0x9a09('0x28')],'sectionId':_0x2e0125['id']},{})[_0x9a09('0x21')](function(){return _0x3aebc4;});}else{return _0x3aebc4;}})[_0x9a09('0x43')](function(_0x4499ce){logger[_0x9a09('0x26')](_0x9a09('0x4c'),_0x4499ce);throw _0x4499ce;});}return _0x3aebc4;})['then'](respondWithResult(_0x250946,0xc9))[_0x9a09('0x43')](handleError(_0x250946,null));};exports['clone']=function(_0x38c338,_0x7d18ee){var _0xc4f23={'where':{'id':_0x38c338[_0x9a09('0x44')]['id']}},_0x77e395={};_0x77e395['model']=_['keys'](db['Campaign'][_0x9a09('0x2d')]);_0xc4f23[_0x9a09('0x35')]=_[_0x9a09('0x34')](_0x77e395[_0x9a09('0x31')],qs['fields'](_0x38c338[_0x9a09('0x33')][_0x9a09('0x46')]));_0xc4f23[_0x9a09('0x35')]=_0xc4f23[_0x9a09('0x35')]['length']?_0xc4f23[_0x9a09('0x35')]:_0x77e395['model'];if(_0x38c338['query']['includeAll']){_0xc4f23['include']=[{'all':!![]}];}_0xc4f23=_[_0x9a09('0x3c')]({},_0xc4f23,_0x38c338[_0x9a09('0x3e')]);return db['Campaign'][_0x9a09('0x47')](_0xc4f23)[_0x9a09('0x21')](handleEntityNotFound(_0x7d18ee,null))[_0x9a09('0x21')](function(_0x20ff60){if(_0x20ff60){var _0x2cec8d=_0x20ff60[_0x9a09('0x22')]({'plain':!![]});_0x2cec8d=qs[_0x9a09('0x4d')](_0x2cec8d,['id',_0x9a09('0x4e'),_0x9a09('0x4f')]);_0x38c338[_0x9a09('0x50')]=_[_0x9a09('0x4d')](_0x38c338['body'],['id',_0x9a09('0x4e'),_0x9a09('0x4f')]);return db[_0x9a09('0x2c')][_0x9a09('0x48')](_[_0x9a09('0x3c')](_0x2cec8d,_0x38c338[_0x9a09('0x50')]),{'include':_0x38c338[_0x9a09('0x33')]['includeAll']?[{'all':!![]}]:undefined})[_0x9a09('0x21')](function(_0x58c69b){var _0x5d8f43=_0x38c338[_0x9a09('0x51')][_0x9a09('0x22')]({'plain':!![]});if(!_0x5d8f43)throw new Error(_0x9a09('0x49'));if(_0x5d8f43[_0x9a09('0x4a')]===_0x9a09('0x51')){var _0xe0edc=_0x58c69b[_0x9a09('0x22')]({'plain':!![]});var _0x2e04ce=_0x9a09('0x23');return db['UserProfileSection'][_0x9a09('0x47')]({'where':{'name':_0x2e04ce,'userProfileId':_0x5d8f43[_0x9a09('0x52')]},'raw':!![]})[_0x9a09('0x21')](function(_0x2db71a){if(_0x2db71a&&_0x2db71a[_0x9a09('0x53')]===0x0){return db[_0x9a09('0x24')][_0x9a09('0x48')]({'name':_0xe0edc[_0x9a09('0x28')],'resourceId':_0xe0edc['id'],'type':_0x2db71a[_0x9a09('0x28')],'sectionId':_0x2db71a['id']},{})['then'](function(){return _0x58c69b;});}else{return _0x58c69b;}})[_0x9a09('0x43')](function(_0x3474af){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3474af);throw _0x3474af;});}return _0x58c69b;});}})[_0x9a09('0x21')](respondWithResult(_0x7d18ee,0xc9))['catch'](handleError(_0x7d18ee,null));};exports['update']=function(_0x564a24,_0x356888){if(_0x564a24[_0x9a09('0x50')]['id']){delete _0x564a24[_0x9a09('0x50')]['id'];}return db[_0x9a09('0x2c')][_0x9a09('0x47')]({'where':{'id':_0x564a24[_0x9a09('0x44')]['id']}})[_0x9a09('0x21')](handleEntityNotFound(_0x356888,null))[_0x9a09('0x21')](saveUpdates(_0x564a24[_0x9a09('0x50')],null))[_0x9a09('0x21')](respondWithResult(_0x356888,null))[_0x9a09('0x43')](handleError(_0x356888,null));};exports['destroy']=function(_0x281acf,_0x2a1b99){return db[_0x9a09('0x2c')][_0x9a09('0x47')]({'where':{'id':_0x281acf[_0x9a09('0x44')]['id']}})[_0x9a09('0x21')](handleEntityNotFound(_0x2a1b99,null))[_0x9a09('0x21')](removeEntity(_0x2a1b99,null))['catch'](handleError(_0x2a1b99,null));};exports['getHoppers']=function(_0xd40d6d,_0x1e111e,_0x49e98c){var _0x140885={'raw':!![],'where':{}};var _0x298aae={};var _0x2e228d={'count':0x0,'rows':[]};return db[_0x9a09('0x2c')][_0x9a09('0x54')]({'where':{'id':_0xd40d6d[_0x9a09('0x44')]['id']}})['then'](handleEntityNotFound(_0x1e111e,null))[_0x9a09('0x21')](function(_0x5d9d6d){if(_0x5d9d6d){_0x298aae['model']=_[_0x9a09('0x32')](db[_0x9a09('0x55')][_0x9a09('0x2d')]);_0x298aae['query']=_[_0x9a09('0x32')](_0xd40d6d['query']);_0x298aae['filters']=_[_0x9a09('0x34')](_0x298aae['model'],_0x298aae[_0x9a09('0x33')]);_0x140885[_0x9a09('0x35')]=_[_0x9a09('0x34')](_0x298aae[_0x9a09('0x31')],qs[_0x9a09('0x46')](_0xd40d6d[_0x9a09('0x33')][_0x9a09('0x46')]));_0x140885[_0x9a09('0x35')]=_0x140885[_0x9a09('0x35')]['length']?_0x140885[_0x9a09('0x35')]:_0x298aae['model'];if(!_0xd40d6d['query']['hasOwnProperty'](_0x9a09('0x56'))){_0x140885[_0x9a09('0x1c')]=qs[_0x9a09('0x1c')](_0xd40d6d[_0x9a09('0x33')]['limit']);_0x140885['offset']=qs[_0x9a09('0x1a')](_0xd40d6d[_0x9a09('0x33')]['offset']);}_0x140885[_0x9a09('0x38')]=qs[_0x9a09('0x39')](_0xd40d6d['query'][_0x9a09('0x39')]);_0x140885[_0x9a09('0x3a')]=qs['filters'](_[_0x9a09('0x57')](_0xd40d6d[_0x9a09('0x33')],_0x298aae[_0x9a09('0x45')]));_0x140885[_0x9a09('0x3a')][_0x9a09('0x58')]=_0x5d9d6d['id'];if(_0xd40d6d[_0x9a09('0x33')][_0x9a09('0x3b')]){_0x140885[_0x9a09('0x3a')]=_[_0x9a09('0x3c')](_0x140885['where'],{'$or':_[_0x9a09('0x2b')](_0x140885['attributes'],function(_0x3e7989){var _0x39db7b={};_0x39db7b[_0x3e7989]={'$like':'%'+_0xd40d6d[_0x9a09('0x33')][_0x9a09('0x3b')]+'%'};return _0x39db7b;})});}_0x140885=_[_0x9a09('0x3c')]({},_0x140885,_0xd40d6d[_0x9a09('0x3e')]);return db[_0x9a09('0x55')]['count']({'where':_0x140885[_0x9a09('0x3a')]})[_0x9a09('0x21')](function(_0x2b7ae4){_0x2e228d[_0x9a09('0x1d')]=_0x2b7ae4;if(_0xd40d6d[_0x9a09('0x33')][_0x9a09('0x3f')]){_0x140885[_0x9a09('0x40')]=[{'all':!![]}];}return db['CmHopper'][_0x9a09('0x41')](_0x140885);})[_0x9a09('0x21')](function(_0x28e1cc){_0x2e228d['rows']=_0x28e1cc;return _0x2e228d;});}})['then'](respondWithFilteredResult(_0x1e111e,_0x140885))[_0x9a09('0x43')](handleError(_0x1e111e,null));};exports[_0x9a09('0x59')]=function(_0x1ab74b,_0x332f9d,_0x39765f){var _0x2fea84={'raw':!![],'where':{}};var _0x39371f={};var _0x3abed8={'count':0x0,'rows':[]};return db[_0x9a09('0x2c')]['findOne']({'where':{'id':_0x1ab74b[_0x9a09('0x44')]['id']}})['then'](handleEntityNotFound(_0x332f9d,null))['then'](function(_0x318777){if(_0x318777){_0x39371f[_0x9a09('0x31')]=_[_0x9a09('0x32')](db[_0x9a09('0x5a')][_0x9a09('0x2d')]);_0x39371f['query']=_[_0x9a09('0x32')](_0x1ab74b[_0x9a09('0x33')]);_0x39371f[_0x9a09('0x45')]=_[_0x9a09('0x34')](_0x39371f[_0x9a09('0x31')],_0x39371f['query']);_0x2fea84['attributes']=_['intersection'](_0x39371f[_0x9a09('0x31')],qs[_0x9a09('0x46')](_0x1ab74b[_0x9a09('0x33')][_0x9a09('0x46')]));_0x2fea84[_0x9a09('0x35')]=_0x2fea84[_0x9a09('0x35')][_0x9a09('0x36')]?_0x2fea84[_0x9a09('0x35')]:_0x39371f[_0x9a09('0x31')];if(!_0x1ab74b[_0x9a09('0x33')][_0x9a09('0x37')](_0x9a09('0x56'))){_0x2fea84[_0x9a09('0x1c')]=qs[_0x9a09('0x1c')](_0x1ab74b[_0x9a09('0x33')]['limit']);_0x2fea84[_0x9a09('0x1a')]=qs['offset'](_0x1ab74b[_0x9a09('0x33')][_0x9a09('0x1a')]);}_0x2fea84[_0x9a09('0x38')]=qs['sort'](_0x1ab74b[_0x9a09('0x33')][_0x9a09('0x39')]);_0x2fea84[_0x9a09('0x3a')]=qs[_0x9a09('0x45')](_['pick'](_0x1ab74b[_0x9a09('0x33')],_0x39371f[_0x9a09('0x45')]));_0x2fea84[_0x9a09('0x3a')][_0x9a09('0x58')]=_0x318777['id'];if(_0x1ab74b[_0x9a09('0x33')][_0x9a09('0x3b')]){_0x2fea84[_0x9a09('0x3a')]=_[_0x9a09('0x3c')](_0x2fea84['where'],{'$or':_['map'](_0x2fea84[_0x9a09('0x35')],function(_0x2d0227){var _0xdcfe82={};_0xdcfe82[_0x2d0227]={'$like':'%'+_0x1ab74b[_0x9a09('0x33')][_0x9a09('0x3b')]+'%'};return _0xdcfe82;})});}_0x2fea84=_['merge']({},_0x2fea84,_0x1ab74b['options']);return db['CmHopperHistory'][_0x9a09('0x1d')]({'where':_0x2fea84['where']})[_0x9a09('0x21')](function(_0x4882fa){_0x3abed8[_0x9a09('0x1d')]=_0x4882fa;if(_0x1ab74b['query'][_0x9a09('0x3f')]){_0x2fea84[_0x9a09('0x40')]=[{'all':!![]}];}return db[_0x9a09('0x5a')]['findAll'](_0x2fea84);})[_0x9a09('0x21')](function(_0x146bc4){_0x3abed8[_0x9a09('0x42')]=_0x146bc4;return _0x3abed8;});}})['then'](respondWithFilteredResult(_0x332f9d,_0x2fea84))['catch'](handleError(_0x332f9d,null));};exports['getHopperFinals']=function(_0xefd246,_0x25b2ca,_0x25b963){var _0x3ca9b8={'raw':!![],'where':{}};var _0x414ec3={};var _0x458988={'count':0x0,'rows':[]};return db[_0x9a09('0x2c')][_0x9a09('0x54')]({'where':{'id':_0xefd246[_0x9a09('0x44')]['id']}})[_0x9a09('0x21')](handleEntityNotFound(_0x25b2ca,null))[_0x9a09('0x21')](function(_0x2d9a07){if(_0x2d9a07){_0x414ec3[_0x9a09('0x31')]=_[_0x9a09('0x32')](db[_0x9a09('0x5b')][_0x9a09('0x2d')]);_0x414ec3[_0x9a09('0x33')]=_['keys'](_0xefd246[_0x9a09('0x33')]);_0x414ec3[_0x9a09('0x45')]=_['intersection'](_0x414ec3['model'],_0x414ec3[_0x9a09('0x33')]);_0x3ca9b8['attributes']=_[_0x9a09('0x34')](_0x414ec3[_0x9a09('0x31')],qs[_0x9a09('0x46')](_0xefd246['query'][_0x9a09('0x46')]));_0x3ca9b8['attributes']=_0x3ca9b8['attributes'][_0x9a09('0x36')]?_0x3ca9b8[_0x9a09('0x35')]:_0x414ec3[_0x9a09('0x31')];if(!_0xefd246[_0x9a09('0x33')]['hasOwnProperty']('nolimit')){_0x3ca9b8[_0x9a09('0x1c')]=qs[_0x9a09('0x1c')](_0xefd246['query'][_0x9a09('0x1c')]);_0x3ca9b8[_0x9a09('0x1a')]=qs[_0x9a09('0x1a')](_0xefd246[_0x9a09('0x33')][_0x9a09('0x1a')]);}_0x3ca9b8[_0x9a09('0x38')]=qs[_0x9a09('0x39')](_0xefd246[_0x9a09('0x33')]['sort']);_0x3ca9b8['where']=qs[_0x9a09('0x45')](_[_0x9a09('0x57')](_0xefd246[_0x9a09('0x33')],_0x414ec3['filters']));_0x3ca9b8[_0x9a09('0x3a')][_0x9a09('0x58')]=_0x2d9a07['id'];if(_0xefd246[_0x9a09('0x33')][_0x9a09('0x3b')]){_0x3ca9b8[_0x9a09('0x3a')]=_[_0x9a09('0x3c')](_0x3ca9b8[_0x9a09('0x3a')],{'$or':_[_0x9a09('0x2b')](_0x3ca9b8[_0x9a09('0x35')],function(_0x1bfca7){var _0x1be5bd={};_0x1be5bd[_0x1bfca7]={'$like':'%'+_0xefd246[_0x9a09('0x33')][_0x9a09('0x3b')]+'%'};return _0x1be5bd;})});}_0x3ca9b8=_[_0x9a09('0x3c')]({},_0x3ca9b8,_0xefd246[_0x9a09('0x3e')]);return db['CmHopperFinal']['count']({'where':_0x3ca9b8[_0x9a09('0x3a')]})['then'](function(_0x2b0023){_0x458988[_0x9a09('0x1d')]=_0x2b0023;if(_0xefd246['query']['includeAll']){_0x3ca9b8[_0x9a09('0x40')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x9a09('0x41')](_0x3ca9b8);})[_0x9a09('0x21')](function(_0x3de4f3){_0x458988[_0x9a09('0x42')]=_0x3de4f3;return _0x458988;});}})[_0x9a09('0x21')](respondWithFilteredResult(_0x25b2ca,_0x3ca9b8))[_0x9a09('0x43')](handleError(_0x25b2ca,null));};exports[_0x9a09('0x5c')]=function(_0x3fd43b,_0x42b7bf,_0x3b2822){var _0x2e8393={'raw':!![],'where':{}};var _0xead2ef={};var _0x4cc16c={'count':0x0,'rows':[]};return db[_0x9a09('0x2c')][_0x9a09('0x54')]({'where':{'id':_0x3fd43b[_0x9a09('0x44')]['id']}})[_0x9a09('0x21')](handleEntityNotFound(_0x42b7bf,null))[_0x9a09('0x21')](function(_0xd7ab39){if(_0xd7ab39){_0xead2ef[_0x9a09('0x31')]=_[_0x9a09('0x32')](db['CmHopperBlack'][_0x9a09('0x2d')]);_0xead2ef[_0x9a09('0x33')]=_[_0x9a09('0x32')](_0x3fd43b[_0x9a09('0x33')]);_0xead2ef[_0x9a09('0x45')]=_[_0x9a09('0x34')](_0xead2ef[_0x9a09('0x31')],_0xead2ef[_0x9a09('0x33')]);_0x2e8393['attributes']=_['intersection'](_0xead2ef[_0x9a09('0x31')],qs[_0x9a09('0x46')](_0x3fd43b[_0x9a09('0x33')]['fields']));_0x2e8393['attributes']=_0x2e8393[_0x9a09('0x35')][_0x9a09('0x36')]?_0x2e8393[_0x9a09('0x35')]:_0xead2ef['model'];if(!_0x3fd43b[_0x9a09('0x33')][_0x9a09('0x37')](_0x9a09('0x56'))){_0x2e8393['limit']=qs[_0x9a09('0x1c')](_0x3fd43b['query']['limit']);_0x2e8393[_0x9a09('0x1a')]=qs[_0x9a09('0x1a')](_0x3fd43b[_0x9a09('0x33')][_0x9a09('0x1a')]);}_0x2e8393[_0x9a09('0x38')]=qs[_0x9a09('0x39')](_0x3fd43b['query'][_0x9a09('0x39')]);_0x2e8393[_0x9a09('0x3a')]=qs[_0x9a09('0x45')](_[_0x9a09('0x57')](_0x3fd43b[_0x9a09('0x33')],_0xead2ef[_0x9a09('0x45')]));_0x2e8393[_0x9a09('0x3a')]['CampaignId']=_0xd7ab39['id'];if(_0x3fd43b['query']['filter']){_0x2e8393['where']=_[_0x9a09('0x3c')](_0x2e8393[_0x9a09('0x3a')],{'$or':_['map'](_0x2e8393[_0x9a09('0x35')],function(_0x6f9fd2){var _0x43e9a3={};_0x43e9a3[_0x6f9fd2]={'$like':'%'+_0x3fd43b[_0x9a09('0x33')][_0x9a09('0x3b')]+'%'};return _0x43e9a3;})});}_0x2e8393=_[_0x9a09('0x3c')]({},_0x2e8393,_0x3fd43b[_0x9a09('0x3e')]);return db[_0x9a09('0x5d')][_0x9a09('0x1d')]({'where':_0x2e8393[_0x9a09('0x3a')]})[_0x9a09('0x21')](function(_0x80134c){_0x4cc16c['count']=_0x80134c;if(_0x3fd43b[_0x9a09('0x33')][_0x9a09('0x3f')]){_0x2e8393[_0x9a09('0x40')]=[{'all':!![]}];}return db[_0x9a09('0x5d')][_0x9a09('0x41')](_0x2e8393);})[_0x9a09('0x21')](function(_0x4ea65c){_0x4cc16c[_0x9a09('0x42')]=_0x4ea65c;return _0x4cc16c;});}})[_0x9a09('0x21')](respondWithFilteredResult(_0x42b7bf,_0x2e8393))[_0x9a09('0x43')](handleError(_0x42b7bf,null));};exports[_0x9a09('0x5e')]=function(_0x50c663,_0x52e965,_0x253c0a){var _0x1a24e3={};var _0x3eb0cd={};var _0xbd0dee;var _0x2bf78d;return db['Campaign'][_0x9a09('0x54')]({'where':{'id':_0x50c663[_0x9a09('0x44')]['id']}})[_0x9a09('0x21')](handleEntityNotFound(_0x52e965,null))[_0x9a09('0x21')](function(_0x3746fc){if(_0x3746fc){_0xbd0dee=_0x3746fc;_0x3eb0cd[_0x9a09('0x31')]=_[_0x9a09('0x32')](db['CmList'][_0x9a09('0x2d')]);_0x3eb0cd[_0x9a09('0x33')]=_[_0x9a09('0x32')](_0x50c663[_0x9a09('0x33')]);_0x3eb0cd[_0x9a09('0x45')]=_[_0x9a09('0x34')](_0x3eb0cd[_0x9a09('0x31')],_0x3eb0cd[_0x9a09('0x33')]);_0x1a24e3[_0x9a09('0x35')]=_[_0x9a09('0x34')](_0x3eb0cd[_0x9a09('0x31')],qs['fields'](_0x50c663[_0x9a09('0x33')][_0x9a09('0x46')]));_0x1a24e3[_0x9a09('0x35')]=_0x1a24e3[_0x9a09('0x35')][_0x9a09('0x36')]?_0x1a24e3[_0x9a09('0x35')]:_0x3eb0cd[_0x9a09('0x31')];_0x1a24e3[_0x9a09('0x38')]=qs[_0x9a09('0x39')](_0x50c663[_0x9a09('0x33')]['sort']);_0x1a24e3['where']=qs[_0x9a09('0x45')](_['pick'](_0x50c663[_0x9a09('0x33')],_0x3eb0cd[_0x9a09('0x45')]));if(_0x50c663[_0x9a09('0x33')][_0x9a09('0x3b')]){_0x1a24e3[_0x9a09('0x3a')]=_[_0x9a09('0x3c')](_0x1a24e3[_0x9a09('0x3a')],{'$or':_['map'](_0x1a24e3['attributes'],function(_0x2a7498){var _0xace0dd={};_0xace0dd[_0x2a7498]={'$like':'%'+_0x50c663[_0x9a09('0x33')][_0x9a09('0x3b')]+'%'};return _0xace0dd;})});}_0x1a24e3=_[_0x9a09('0x3c')]({},_0x1a24e3,_0x50c663[_0x9a09('0x3e')]);return _0xbd0dee[_0x9a09('0x5e')](_0x1a24e3);}})['then'](function(_0x2a77a7){if(_0x2a77a7){_0x2bf78d=_0x2a77a7['length'];if(!_0x50c663['query']['hasOwnProperty']('nolimit')){_0x1a24e3['limit']=qs[_0x9a09('0x1c')](_0x50c663[_0x9a09('0x33')][_0x9a09('0x1c')]);_0x1a24e3[_0x9a09('0x1a')]=qs['offset'](_0x50c663[_0x9a09('0x33')][_0x9a09('0x1a')]);}return _0xbd0dee['getLists'](_0x1a24e3);}})[_0x9a09('0x21')](function(_0x4a3041){if(_0x4a3041){return _0x4a3041?{'count':_0x2bf78d,'rows':_0x4a3041}:null;}})['then'](respondWithResult(_0x52e965,null))[_0x9a09('0x43')](handleError(_0x52e965,null));};exports[_0x9a09('0x5f')]=function(_0x3b41aa,_0x2b3513,_0x71114d){var _0x347163,_0x58caac;return db[_0x9a09('0x2c')][_0x9a09('0x47')]({'where':{'id':_0x3b41aa['params']['id']}})[_0x9a09('0x21')](handleEntityNotFound(_0x2b3513,null))[_0x9a09('0x21')](function(_0x195430){if(_0x195430){_0x58caac=_0x195430;return _0x195430['addLists'](_0x3b41aa[_0x9a09('0x50')][_0x9a09('0x60')],_[_0x9a09('0x4d')](_0x3b41aa[_0x9a09('0x50')],[_0x9a09('0x60'),'id'])||{});}return null;})[_0x9a09('0x61')](function(_0x10acfd){var _0x5101e4;_0x347163=_0x10acfd||[];var _0x1880bd=[];if(_0x10acfd){for(var _0x393538=0x0;_0x393538<_0x10acfd[_0x9a09('0x36')];_0x393538+=0x1){var _0x2a2203=_0x10acfd[_0x393538]['get']({'plain':!![]});_0x58caac[_0x9a09('0x62')]=_0x3b41aa[_0x9a09('0x50')][_0x9a09('0x62')]?_0x3b41aa[_0x9a09('0x50')][_0x9a09('0x62')]:_0x58caac[_0x9a09('0x62')];switch(_0x58caac['dialCheckDuplicateType']){case _0x9a09('0x63'):_0x5101e4=squel['insert']()[_0x9a09('0x64')](_0x9a09('0x65'))[_0x9a09('0x66')](['phone','scheduledAt',_0x9a09('0x67'),'ListId',_0x9a09('0x58'),'createdAt',_0x9a09('0x4f')],squel['select']()[_0x9a09('0x68')]('phone',_0x9a09('0x69'))['field']('NOW()',_0x9a09('0x6a'))[_0x9a09('0x68')]('id','ContactId')[_0x9a09('0x68')](_0x2a2203[_0x9a09('0x6b')]['toString'](),_0x9a09('0x6c'))[_0x9a09('0x68')](_0x3b41aa[_0x9a09('0x44')]['id'][_0x9a09('0x6d')](),'CampaignId')[_0x9a09('0x68')](_0x9a09('0x6e'),'createdAt')[_0x9a09('0x68')](_0x9a09('0x6e'),_0x9a09('0x4f'))[_0x9a09('0x6f')](_0x9a09('0x70'))[_0x9a09('0x3a')](_0x9a09('0x71'))[_0x9a09('0x3a')](_0x9a09('0x72'),_0x2a2203[_0x9a09('0x6b')][_0x9a09('0x6d')]())[_0x9a09('0x3a')]('phone\x20IS\x20NOT\x20NULL')[_0x9a09('0x3a')](_0x9a09('0x73'),squel[_0x9a09('0x74')]()[_0x9a09('0x68')]('COALESCE(calleridnum,\x27\x27)')['from'](_0x9a09('0x75'))[_0x9a09('0x3a')](_0x9a09('0x76'),_0x3b41aa[_0x9a09('0x44')]['id'][_0x9a09('0x6d')]()))['where'](_0x9a09('0x73'),squel[_0x9a09('0x74')]()[_0x9a09('0x68')](_0x9a09('0x77'))[_0x9a09('0x6f')](_0x9a09('0x65'))[_0x9a09('0x3a')](_0x9a09('0x76'),_0x3b41aa[_0x9a09('0x44')]['id'][_0x9a09('0x6d')]())))[_0x9a09('0x6d')]();break;case _0x9a09('0x78'):_0x5101e4=squel[_0x9a09('0x79')]()[_0x9a09('0x64')](_0x9a09('0x65'))[_0x9a09('0x66')]([_0x9a09('0x69'),_0x9a09('0x6a'),_0x9a09('0x67'),_0x9a09('0x6c'),'CampaignId',_0x9a09('0x4e'),'updatedAt'],squel[_0x9a09('0x74')]()['field'](_0x9a09('0x69'),'phone')[_0x9a09('0x68')](_0x9a09('0x6e'),_0x9a09('0x6a'))[_0x9a09('0x68')]('id',_0x9a09('0x67'))[_0x9a09('0x68')](_0x2a2203[_0x9a09('0x6b')][_0x9a09('0x6d')](),_0x9a09('0x6c'))['field'](_0x3b41aa[_0x9a09('0x44')]['id'][_0x9a09('0x6d')](),_0x9a09('0x58'))[_0x9a09('0x68')](_0x9a09('0x6e'),_0x9a09('0x4e'))[_0x9a09('0x68')](_0x9a09('0x6e'),_0x9a09('0x4f'))[_0x9a09('0x6f')](_0x9a09('0x70'))[_0x9a09('0x3a')](_0x9a09('0x71'))[_0x9a09('0x3a')](_0x9a09('0x72'),_0x2a2203['CmListId']['toString']())[_0x9a09('0x3a')](_0x9a09('0x7a'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x9a09('0x74')]()[_0x9a09('0x68')](_0x9a09('0x77'))['from'](_0x9a09('0x65'))[_0x9a09('0x3a')](_0x9a09('0x76'),_0x3b41aa['params']['id']['toString']())))['toString']();break;default:_0x5101e4=squel['insert']()['into']('cm_hopper')[_0x9a09('0x66')]([_0x9a09('0x69'),'scheduledAt',_0x9a09('0x67'),_0x9a09('0x6c'),'CampaignId','createdAt',_0x9a09('0x4f')],squel['select']()[_0x9a09('0x68')](_0x9a09('0x69'),'phone')[_0x9a09('0x68')](_0x9a09('0x6e'),_0x9a09('0x6a'))['field']('id','ContactId')[_0x9a09('0x68')](_0x2a2203[_0x9a09('0x6b')][_0x9a09('0x6d')](),_0x9a09('0x6c'))[_0x9a09('0x68')](_0x3b41aa[_0x9a09('0x44')]['id']['toString'](),_0x9a09('0x58'))['field']('NOW()',_0x9a09('0x4e'))[_0x9a09('0x68')](_0x9a09('0x6e'),_0x9a09('0x4f'))[_0x9a09('0x6f')]('cm_contacts')[_0x9a09('0x3a')](_0x9a09('0x71'))[_0x9a09('0x3a')](_0x9a09('0x72'),_0x2a2203[_0x9a09('0x6b')]['toString']())[_0x9a09('0x3a')](_0x9a09('0x7a')))[_0x9a09('0x6d')]();}_0x1880bd[_0x9a09('0x7b')](db[_0x9a09('0x7c')][_0x9a09('0x33')](_0x5101e4));}return BPromise['all'](_0x1880bd);}})[_0x9a09('0x21')](function(){return _0x347163;})[_0x9a09('0x21')](respondWithResult(_0x2b3513,null))['catch'](handleError(_0x2b3513,null));};exports[_0x9a09('0x7d')]=function(_0x9078c4,_0x53a4b1,_0x2bb0e0){return db[_0x9a09('0x2c')]['find']({'where':{'id':_0x9078c4[_0x9a09('0x44')]['id']}})[_0x9a09('0x21')](handleEntityNotFound(_0x53a4b1,null))['then'](function(_0x2ce74a){if(_0x2ce74a){return _0x2ce74a[_0x9a09('0x7d')](_0x9078c4[_0x9a09('0x33')][_0x9a09('0x60')]);}})[_0x9a09('0x21')](function(_0x19ccb9){if(_0x19ccb9){return db[_0x9a09('0x55')][_0x9a09('0x25')]({'where':{'ListId':_0x9078c4[_0x9a09('0x33')][_0x9a09('0x60')],'CampaignId':_0x9078c4[_0x9a09('0x44')]['id']}})[_0x9a09('0x21')](function(){return _0x19ccb9;});}})[_0x9a09('0x21')](respondWithStatusCode(_0x53a4b1,null))[_0x9a09('0x43')](handleError(_0x53a4b1,null));};exports[_0x9a09('0x7e')]=function(_0x466f75,_0x4f1396,_0x4395e0){var _0x227d9f={};var _0x5ba321={};var _0x492cf5;var _0x29cec6;return db[_0x9a09('0x2c')][_0x9a09('0x54')]({'where':{'id':_0x466f75[_0x9a09('0x44')]['id']}})[_0x9a09('0x21')](handleEntityNotFound(_0x4f1396,null))['then'](function(_0x115e05){if(_0x115e05){_0x492cf5=_0x115e05;_0x5ba321[_0x9a09('0x31')]=_[_0x9a09('0x32')](db[_0x9a09('0x7f')][_0x9a09('0x2d')]);_0x5ba321[_0x9a09('0x33')]=_['keys'](_0x466f75[_0x9a09('0x33')]);_0x5ba321[_0x9a09('0x45')]=_[_0x9a09('0x34')](_0x5ba321[_0x9a09('0x31')],_0x5ba321[_0x9a09('0x33')]);_0x227d9f[_0x9a09('0x35')]=_[_0x9a09('0x34')](_0x5ba321[_0x9a09('0x31')],qs[_0x9a09('0x46')](_0x466f75[_0x9a09('0x33')][_0x9a09('0x46')]));_0x227d9f[_0x9a09('0x35')]=_0x227d9f[_0x9a09('0x35')][_0x9a09('0x36')]?_0x227d9f[_0x9a09('0x35')]:_0x5ba321['model'];_0x227d9f[_0x9a09('0x38')]=qs[_0x9a09('0x39')](_0x466f75[_0x9a09('0x33')]['sort']);_0x227d9f[_0x9a09('0x3a')]=qs[_0x9a09('0x45')](_[_0x9a09('0x57')](_0x466f75[_0x9a09('0x33')],_0x5ba321[_0x9a09('0x45')]));if(_0x466f75[_0x9a09('0x33')][_0x9a09('0x3b')]){_0x227d9f[_0x9a09('0x3a')]=_[_0x9a09('0x3c')](_0x227d9f[_0x9a09('0x3a')],{'$or':_['map'](_0x227d9f['attributes'],function(_0x5b8ff0){var _0x3c389f={};_0x3c389f[_0x5b8ff0]={'$like':'%'+_0x466f75['query'][_0x9a09('0x3b')]+'%'};return _0x3c389f;})});}_0x227d9f=_[_0x9a09('0x3c')]({},_0x227d9f,_0x466f75['options']);return _0x492cf5[_0x9a09('0x7e')](_0x227d9f);}})[_0x9a09('0x21')](function(_0x31102d){if(_0x31102d){_0x29cec6=_0x31102d['length'];if(!_0x466f75[_0x9a09('0x33')][_0x9a09('0x37')]('nolimit')){_0x227d9f[_0x9a09('0x1c')]=qs['limit'](_0x466f75[_0x9a09('0x33')][_0x9a09('0x1c')]);_0x227d9f[_0x9a09('0x1a')]=qs['offset'](_0x466f75[_0x9a09('0x33')][_0x9a09('0x1a')]);}return _0x492cf5['getBlackLists'](_0x227d9f);}})[_0x9a09('0x21')](function(_0x279760){if(_0x279760){return _0x279760?{'count':_0x29cec6,'rows':_0x279760}:null;}})['then'](respondWithResult(_0x4f1396,null))['catch'](handleError(_0x4f1396,null));};exports[_0x9a09('0x80')]=function(_0x412396,_0xc12a38,_0x53816d){var _0x59a4cd,_0x40a85e;return db[_0x9a09('0x2c')][_0x9a09('0x47')]({'where':{'id':_0x412396[_0x9a09('0x44')]['id']}})[_0x9a09('0x21')](handleEntityNotFound(_0xc12a38,null))[_0x9a09('0x21')](function(_0x3df76d){if(_0x3df76d){_0x40a85e=_0x3df76d;return _0x3df76d['addBlackLists'](_0x412396[_0x9a09('0x50')][_0x9a09('0x60')],_['omit'](_0x412396['body'],[_0x9a09('0x60'),'id'])||{});}return null;})[_0x9a09('0x61')](function(_0x345a5a){var _0x3c25f4;_0x59a4cd=_0x345a5a||[];var _0x2c4b0e=[];if(_0x345a5a){for(var _0x447fef=0x0;_0x447fef<_0x345a5a[_0x9a09('0x36')];_0x447fef+=0x1){var _0x5e0084=_0x345a5a[_0x447fef][_0x9a09('0x22')]({'plain':!![]});_0x3c25f4=squel['insert']()[_0x9a09('0x64')](_0x9a09('0x81'))[_0x9a09('0x66')]([_0x9a09('0x69'),_0x9a09('0x67'),'ListId',_0x9a09('0x58'),_0x9a09('0x4e'),_0x9a09('0x4f')],squel[_0x9a09('0x74')]()[_0x9a09('0x68')](_0x9a09('0x69'),_0x9a09('0x69'))['field']('id','ContactId')[_0x9a09('0x68')](_0x5e0084['CmListId'][_0x9a09('0x6d')](),_0x9a09('0x6c'))[_0x9a09('0x68')](_0x412396[_0x9a09('0x44')]['id']['toString'](),_0x9a09('0x58'))[_0x9a09('0x68')](_0x9a09('0x6e'),_0x9a09('0x4e'))[_0x9a09('0x68')](_0x9a09('0x6e'),_0x9a09('0x4f'))[_0x9a09('0x6f')](_0x9a09('0x70'))[_0x9a09('0x3a')](_0x9a09('0x71'))[_0x9a09('0x3a')]('ListId\x20=\x20?',_0x5e0084[_0x9a09('0x6b')]['toString']())[_0x9a09('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0x9a09('0x6d')]();_0x2c4b0e[_0x9a09('0x7b')](db['sequelize'][_0x9a09('0x33')](_0x3c25f4));}return BPromise['all'](_0x2c4b0e);}})[_0x9a09('0x21')](function(){return _0x59a4cd;})[_0x9a09('0x21')](respondWithResult(_0xc12a38,null))[_0x9a09('0x43')](handleError(_0xc12a38,null));};exports[_0x9a09('0x82')]=function(_0x7389c,_0x567e71,_0x19b83d){return db[_0x9a09('0x2c')]['find']({'where':{'id':_0x7389c[_0x9a09('0x44')]['id']}})['then'](handleEntityNotFound(_0x567e71,null))[_0x9a09('0x21')](function(_0x300e55){if(_0x300e55){return _0x300e55[_0x9a09('0x82')](_0x7389c[_0x9a09('0x33')][_0x9a09('0x60')]);}})[_0x9a09('0x21')](function(_0x528d43){if(_0x528d43){return db[_0x9a09('0x5d')]['destroy']({'where':{'ListId':_0x7389c[_0x9a09('0x33')]['ids'],'CampaignId':_0x7389c[_0x9a09('0x44')]['id']}})[_0x9a09('0x21')](function(){return _0x528d43;});}})[_0x9a09('0x21')](respondWithStatusCode(_0x567e71,null))[_0x9a09('0x43')](handleError(_0x567e71,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 5fd12e6..1cb6efd 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(_0x29b15e,_0xe9df5e){var _0x5c45c3=function(_0x5293a4){while(--_0x5293a4){_0x29b15e['push'](_0x29b15e['shift']());}};_0x5c45c3(++_0xe9df5e);}(_0x7a54,0x106));var _0x47a5=function(_0x13ad33,_0x7ae5c5){_0x13ad33=_0x13ad33-0x0;var _0x277ef9=_0x7a54[_0x13ad33];return _0x277ef9;};'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(_0x4cca27,_0x18e06f){var _0x3d8219=function(_0x2ba31b){while(--_0x2ba31b){_0x4cca27['push'](_0x4cca27['shift']());}};_0x3d8219(++_0x18e06f);}(_0x7a54,0x106));var _0x47a5=function(_0x2ca4ea,_0x56b91b){_0x2ca4ea=_0x2ca4ea-0x0;var _0x3cde34=_0x7a54[_0x2ca4ea];return _0x3cde34;};'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 99c791b..b477f90 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 _0xd52a=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','request','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','GetCampaign','findAll','options','raw','where','attributes','limit','include','model','then','util'];(function(_0x528182,_0x9a98e9){var _0x255df7=function(_0x292249){while(--_0x292249){_0x528182['push'](_0x528182['shift']());}};_0x255df7(++_0x9a98e9);}(_0xd52a,0xca));var _0xad52=function(_0x2556c8,_0x5aaa89){_0x2556c8=_0x2556c8-0x0;var _0x11fa2c=_0xd52a[_0x2556c8];return _0x11fa2c;};'use strict';var _=require('lodash');var util=require(_0xad52('0x0'));var moment=require('moment');var BPromise=require(_0xad52('0x1'));var rs=require(_0xad52('0x2'));var fs=require('fs');var Redis=require(_0xad52('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xad52('0x4'));var logger=require(_0xad52('0x5'))(_0xad52('0x6'));var config=require(_0xad52('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ad70b,_0x55f7a7,_0x23fc23){return new BPromise(function(_0x4bbff0,_0x192ba5){return client[_0xad52('0x8')](_0x1ad70b,_0x23fc23)['then'](function(_0x39c078){logger['info'](_0xad52('0x9'),_0x55f7a7,'request\x20sent');logger[_0xad52('0xa')](_0xad52('0xb'),_0x55f7a7,_0xad52('0xc'),JSON[_0xad52('0xd')](_0x39c078));if(_0x39c078['error']){if(_0x39c078['error']['code']===0x1f4){logger[_0xad52('0xe')](_0xad52('0x9'),_0x55f7a7,_0x39c078[_0xad52('0xe')][_0xad52('0xf')]);return _0x192ba5(_0x39c078[_0xad52('0xe')][_0xad52('0xf')]);}logger[_0xad52('0xe')](_0xad52('0x9'),_0x55f7a7,_0x39c078[_0xad52('0xe')]['message']);return _0x4bbff0(_0x39c078[_0xad52('0xe')][_0xad52('0xf')]);}else{logger[_0xad52('0x10')](_0xad52('0x9'),_0x55f7a7,_0xad52('0xc'));_0x4bbff0(_0x39c078[_0xad52('0x11')][_0xad52('0xf')]);}})[_0xad52('0x12')](function(_0x450099){logger['error']('Campaign,\x20%s,\x20%s',_0x55f7a7,_0x450099);_0x192ba5(_0x450099);});});}exports[_0xad52('0x13')]=function(_0x39128c){var _0x351440=this;return new Promise(function(_0x1c19e9,_0x33da89){return db['Campaign'][_0xad52('0x14')]({'raw':_0x39128c['options']?_0x39128c[_0xad52('0x15')][_0xad52('0x16')]===undefined?!![]:![]:!![],'where':_0x39128c[_0xad52('0x15')]?_0x39128c['options'][_0xad52('0x17')]||null:null,'attributes':_0x39128c['options']?_0x39128c[_0xad52('0x15')][_0xad52('0x18')]||null:null,'limit':_0x39128c[_0xad52('0x15')]?_0x39128c[_0xad52('0x15')][_0xad52('0x19')]||null:null,'include':_0x39128c[_0xad52('0x15')]?_0x39128c['options'][_0xad52('0x1a')]?_['map'](_0x39128c[_0xad52('0x15')][_0xad52('0x1a')],function(_0x2fa90c){return{'model':db[_0x2fa90c[_0xad52('0x1b')]],'as':_0x2fa90c['as'],'attributes':_0x2fa90c[_0xad52('0x18')],'include':_0x2fa90c['include']?_['map'](_0x2fa90c[_0xad52('0x1a')],function(_0x583999){return{'model':db[_0x583999[_0xad52('0x1b')]],'as':_0x583999['as'],'attributes':_0x583999[_0xad52('0x18')],'include':_0x583999['include']?_['map'](_0x583999[_0xad52('0x1a')],function(_0x31b5e0){return{'model':db[_0x31b5e0[_0xad52('0x1b')]],'as':_0x31b5e0['as'],'attributes':_0x31b5e0['attributes']};}):[]};}):[]};}):[]:[]})[_0xad52('0x1c')](function(_0x5771ce){logger[_0xad52('0x10')](_0xad52('0x13'),_0x39128c);logger[_0xad52('0xa')](_0xad52('0x13'),_0x39128c,JSON['stringify'](_0x5771ce));_0x1c19e9(_0x5771ce);})[_0xad52('0x12')](function(_0x2a604c){logger['error'](_0xad52('0x13'),_0x2a604c[_0xad52('0xf')],_0x39128c);_0x33da89(_0x351440[_0xad52('0xe')](0x1f4,_0x2a604c[_0xad52('0xf')]));});});};
\ No newline at end of file
+var _0x1061=['model','attributes','then','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','include','map'];(function(_0x37a0ab,_0x34b900){var _0x13ca1d=function(_0x3c6a41){while(--_0x3c6a41){_0x37a0ab['push'](_0x37a0ab['shift']());}};_0x13ca1d(++_0x34b900);}(_0x1061,0x1b5));var _0x1106=function(_0x70f83,_0x30c72d){_0x70f83=_0x70f83-0x0;var _0x315ec6=_0x1061[_0x70f83];return _0x315ec6;};'use strict';var _=require(_0x1106('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1106('0x1'));var fs=require('fs');var Redis=require(_0x1106('0x2'));var db=require(_0x1106('0x3'))['db'];var utils=require(_0x1106('0x4'));var logger=require(_0x1106('0x5'))(_0x1106('0x6'));var config=require(_0x1106('0x7'));var jayson=require(_0x1106('0x8'));var client=jayson['client'][_0x1106('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36bfb3,_0x54d2d5,_0x523f0f){return new BPromise(function(_0x287336,_0x3056e0){return client['request'](_0x36bfb3,_0x523f0f)['then'](function(_0x223c85){logger[_0x1106('0xa')](_0x1106('0xb'),_0x54d2d5,_0x1106('0xc'));logger[_0x1106('0xd')](_0x1106('0xe'),_0x54d2d5,_0x1106('0xc'),JSON[_0x1106('0xf')](_0x223c85));if(_0x223c85[_0x1106('0x10')]){if(_0x223c85[_0x1106('0x10')]['code']===0x1f4){logger[_0x1106('0x10')](_0x1106('0xb'),_0x54d2d5,_0x223c85[_0x1106('0x10')][_0x1106('0x11')]);return _0x3056e0(_0x223c85[_0x1106('0x10')][_0x1106('0x11')]);}logger[_0x1106('0x10')](_0x1106('0xb'),_0x54d2d5,_0x223c85[_0x1106('0x10')][_0x1106('0x11')]);return _0x287336(_0x223c85[_0x1106('0x10')][_0x1106('0x11')]);}else{logger[_0x1106('0xa')](_0x1106('0xb'),_0x54d2d5,_0x1106('0xc'));_0x287336(_0x223c85[_0x1106('0x12')][_0x1106('0x11')]);}})[_0x1106('0x13')](function(_0x547ca3){logger['error'](_0x1106('0xb'),_0x54d2d5,_0x547ca3);_0x3056e0(_0x547ca3);});});}exports[_0x1106('0x14')]=function(_0x2c2905){var _0x465c13=this;return new Promise(function(_0x5be7fc,_0x2c8ff5){return db[_0x1106('0x15')][_0x1106('0x16')]({'raw':_0x2c2905[_0x1106('0x17')]?_0x2c2905[_0x1106('0x17')][_0x1106('0x18')]===undefined?!![]:![]:!![],'where':_0x2c2905[_0x1106('0x17')]?_0x2c2905[_0x1106('0x17')][_0x1106('0x19')]||null:null,'attributes':_0x2c2905['options']?_0x2c2905[_0x1106('0x17')]['attributes']||null:null,'limit':_0x2c2905[_0x1106('0x17')]?_0x2c2905['options']['limit']||null:null,'include':_0x2c2905[_0x1106('0x17')]?_0x2c2905['options'][_0x1106('0x1a')]?_[_0x1106('0x1b')](_0x2c2905[_0x1106('0x17')][_0x1106('0x1a')],function(_0x2418c7){return{'model':db[_0x2418c7[_0x1106('0x1c')]],'as':_0x2418c7['as'],'attributes':_0x2418c7[_0x1106('0x1d')],'include':_0x2418c7[_0x1106('0x1a')]?_[_0x1106('0x1b')](_0x2418c7[_0x1106('0x1a')],function(_0x1ff815){return{'model':db[_0x1ff815[_0x1106('0x1c')]],'as':_0x1ff815['as'],'attributes':_0x1ff815['attributes'],'include':_0x1ff815[_0x1106('0x1a')]?_[_0x1106('0x1b')](_0x1ff815[_0x1106('0x1a')],function(_0x2285dd){return{'model':db[_0x2285dd['model']],'as':_0x2285dd['as'],'attributes':_0x2285dd[_0x1106('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1106('0x1e')](function(_0x465d83){logger[_0x1106('0xa')](_0x1106('0x14'),_0x2c2905);logger[_0x1106('0xd')](_0x1106('0x14'),_0x2c2905,JSON['stringify'](_0x465d83));_0x5be7fc(_0x465d83);})['catch'](function(_0x4b070d){logger[_0x1106('0x10')](_0x1106('0x14'),_0x4b070d[_0x1106('0x11')],_0x2c2905);_0x2c8ff5(_0x465c13[_0x1106('0x10')](0x1f4,_0x4b070d[_0x1106('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 9070515..1ed195a 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 _0x760b=['/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/lists','addLists','addBlackLists','put','update','delete','removeBlackLists','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists'];(function(_0x461e4b,_0x52caee){var _0x362483=function(_0x4012b3){while(--_0x4012b3){_0x461e4b['push'](_0x461e4b['shift']());}};_0x362483(++_0x52caee);}(_0x760b,0x95));var _0xb760=function(_0x1f6688,_0x1f6e96){_0x1f6688=_0x1f6688-0x0;var _0x245d34=_0x760b[_0x1f6688];return _0x245d34;};'use strict';var multer=require('multer');var util=require(_0xb760('0x0'));var path=require(_0xb760('0x1'));var timeout=require(_0xb760('0x2'));var express=require(_0xb760('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb760('0x4'));var interaction=require(_0xb760('0x5'));var config=require(_0xb760('0x6'));var controller=require(_0xb760('0x7'));router[_0xb760('0x8')]('/',auth[_0xb760('0x9')](),controller['index']);router[_0xb760('0x8')](_0xb760('0xa'),auth[_0xb760('0x9')](),controller[_0xb760('0xb')]);router['get'](_0xb760('0xc'),auth[_0xb760('0x9')](),controller[_0xb760('0xd')]);router[_0xb760('0x8')](_0xb760('0xe'),auth[_0xb760('0x9')](),controller[_0xb760('0xf')]);router[_0xb760('0x8')](_0xb760('0x10'),auth[_0xb760('0x9')](),controller[_0xb760('0x11')]);router['get'](_0xb760('0x12'),auth['isAuthenticated'](),controller[_0xb760('0x13')]);router['get']('/:id/lists',auth[_0xb760('0x9')](),controller[_0xb760('0x14')]);router['get'](_0xb760('0x15'),auth[_0xb760('0x9')](),controller[_0xb760('0x16')]);router[_0xb760('0x17')]('/',auth[_0xb760('0x9')](),controller[_0xb760('0x18')]);router[_0xb760('0x17')](_0xb760('0x19'),auth[_0xb760('0x9')](),controller[_0xb760('0x1a')]);router['post'](_0xb760('0x1b'),auth['isAuthenticated'](),controller[_0xb760('0x1c')]);router[_0xb760('0x17')](_0xb760('0x15'),auth[_0xb760('0x9')](),controller[_0xb760('0x1d')]);router[_0xb760('0x1e')](_0xb760('0xa'),auth[_0xb760('0x9')](),controller[_0xb760('0x1f')]);router[_0xb760('0x20')](_0xb760('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0xb760('0x20')](_0xb760('0x1b'),auth['isAuthenticated'](),controller['removeLists']);router[_0xb760('0x20')](_0xb760('0x15'),auth[_0xb760('0x9')](),controller[_0xb760('0x21')]);module['exports']=router;
\ No newline at end of file
+var _0x3773=['isAuthenticated','index','get','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','/:id/clone','addLists','put','/:id','update','delete','removeLists','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller'];(function(_0x54e83b,_0x22bb2a){var _0x2ae161=function(_0x452451){while(--_0x452451){_0x54e83b['push'](_0x54e83b['shift']());}};_0x2ae161(++_0x22bb2a);}(_0x3773,0x1a9));var _0x3377=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x3773[_0x46698a];return _0x356db0;};'use strict';var multer=require('multer');var util=require(_0x3377('0x0'));var path=require(_0x3377('0x1'));var timeout=require('connect-timeout');var express=require(_0x3377('0x2'));var router=express[_0x3377('0x3')]();var fs_extra=require(_0x3377('0x4'));var auth=require(_0x3377('0x5'));var interaction=require(_0x3377('0x6'));var config=require(_0x3377('0x7'));var controller=require(_0x3377('0x8'));router['get']('/',auth[_0x3377('0x9')](),controller[_0x3377('0xa')]);router[_0x3377('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x3377('0xc')]);router[_0x3377('0xb')](_0x3377('0xd'),auth[_0x3377('0x9')](),controller[_0x3377('0xe')]);router[_0x3377('0xb')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x3377('0xf')]);router[_0x3377('0xb')](_0x3377('0x10'),auth[_0x3377('0x9')](),controller['getHopperFinals']);router[_0x3377('0xb')](_0x3377('0x11'),auth[_0x3377('0x9')](),controller[_0x3377('0x12')]);router['get'](_0x3377('0x13'),auth['isAuthenticated'](),controller['getLists']);router['get'](_0x3377('0x14'),auth['isAuthenticated'](),controller[_0x3377('0x15')]);router[_0x3377('0x16')]('/',auth[_0x3377('0x9')](),controller['create']);router['post'](_0x3377('0x17'),auth['isAuthenticated'](),controller['clone']);router[_0x3377('0x16')](_0x3377('0x13'),auth['isAuthenticated'](),controller[_0x3377('0x18')]);router['post'](_0x3377('0x14'),auth[_0x3377('0x9')](),controller['addBlackLists']);router[_0x3377('0x19')](_0x3377('0x1a'),auth['isAuthenticated'](),controller[_0x3377('0x1b')]);router[_0x3377('0x1c')](_0x3377('0x1a'),auth[_0x3377('0x9')](),controller['destroy']);router[_0x3377('0x1c')](_0x3377('0x13'),auth[_0x3377('0x9')](),controller[_0x3377('0x1d')]);router[_0x3377('0x1c')]('/:id/blacklists',auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x3377('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 7c41a1a..2f63e0b 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 _0xf92a=['exports','STRING','TEXT','VIRTUAL','key'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xf92a,0x127));var _0xaf92=function(_0x6bb9d,_0x37e070){_0x6bb9d=_0x6bb9d-0x0;var _0x5b865b=_0xf92a[_0x6bb9d];return _0x5b865b;};'use strict';var Sequelize=require('sequelize');module[_0xaf92('0x0')]={'key':{'type':Sequelize[_0xaf92('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xaf92('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xaf92('0x3')],'get':function(){return this['getDataValue'](_0xaf92('0x4'));}}};
\ No newline at end of file
+var _0x61e8=['VIRTUAL','key','sequelize','exports','STRING'];(function(_0x29886d,_0x4fcdce){var _0x30fcca=function(_0x35687e){while(--_0x35687e){_0x29886d['push'](_0x29886d['shift']());}};_0x30fcca(++_0x4fcdce);}(_0x61e8,0xac));var _0x861e=function(_0x288549,_0x3b8598){_0x288549=_0x288549-0x0;var _0x4624c0=_0x61e8[_0x288549];return _0x4624c0;};'use strict';var Sequelize=require(_0x861e('0x0'));module[_0x861e('0x1')]={'key':{'type':Sequelize[_0x861e('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x861e('0x2')]},'name':{'type':Sequelize[_0x861e('0x3')],'get':function(){return this['getDataValue'](_0x861e('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index f5e7fec..1929c68 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 _0xa413=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','undefined','limit','offset','count','set','Content-Range','json','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','catch','filters','includeAll','find','body','params','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x15c13a,_0xe7b53d){var _0x5cf531=function(_0x1324f2){while(--_0x1324f2){_0x15c13a['push'](_0x15c13a['shift']());}};_0x5cf531(++_0xe7b53d);}(_0xa413,0x155));var _0x3a41=function(_0x14ce2e,_0x366209){_0x14ce2e=_0x14ce2e-0x0;var _0xd4b636=_0xa413[_0x14ce2e];return _0xd4b636;};'use strict';var emlformat=require(_0x3a41('0x0'));var rimraf=require(_0x3a41('0x1'));var zipdir=require(_0x3a41('0x2'));var jsonpatch=require(_0x3a41('0x3'));var rp=require(_0x3a41('0x4'));var moment=require(_0x3a41('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x3a41('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3a41('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3a41('0x8'));var squel=require(_0x3a41('0x9'));var crypto=require(_0x3a41('0xa'));var jsforce=require(_0x3a41('0xb'));var deskjs=require(_0x3a41('0xc'));var toCsv=require(_0x3a41('0xd'));var querystring=require(_0x3a41('0xe'));var Papa=require('papaparse');var Redis=require(_0x3a41('0xf'));var authService=require(_0x3a41('0x10'));var qs=require(_0x3a41('0x11'));var as=require(_0x3a41('0x12'));var hardwareService=require(_0x3a41('0x13'));var logger=require(_0x3a41('0x14'))(_0x3a41('0x15'));var utils=require(_0x3a41('0x16'));var config=require(_0x3a41('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb6f164,_0x2bd454){_0x2bd454=_0x2bd454||0xcc;return function(_0x441338){if(_0x441338){return _0xb6f164['sendStatus'](_0x2bd454);}return _0xb6f164[_0x3a41('0x18')](_0x2bd454)[_0x3a41('0x19')]();};}function respondWithResult(_0x2b5460,_0x7fa7aa){_0x7fa7aa=_0x7fa7aa||0xc8;return function(_0x54737f){if(_0x54737f){return _0x2b5460['status'](_0x7fa7aa)['json'](_0x54737f);}};}function respondWithFilteredResult(_0x17df6e,_0x342183){return function(_0x369d7b){if(_0x369d7b){var _0x1976da=typeof _0x342183['offset']===_0x3a41('0x1a')&&typeof _0x342183[_0x3a41('0x1b')]===_0x3a41('0x1a');var _0x255045=_0x369d7b['count'];var _0x1eedb6=_0x1976da?0x0:_0x342183[_0x3a41('0x1c')];var _0x3ad046=_0x1976da?_0x369d7b[_0x3a41('0x1d')]:_0x342183[_0x3a41('0x1c')]+_0x342183[_0x3a41('0x1b')];var _0x3e4111;if(_0x3ad046>=_0x255045){_0x3ad046=_0x255045;_0x3e4111=0xc8;}else{_0x3e4111=0xce;}_0x17df6e[_0x3a41('0x18')](_0x3e4111);return _0x17df6e[_0x3a41('0x1e')](_0x3a41('0x1f'),_0x1eedb6+'-'+_0x3ad046+'/'+_0x255045)[_0x3a41('0x20')](_0x369d7b);}return null;};}function patchUpdates(_0x2261e2){return function(_0x216a6e){try{jsonpatch['apply'](_0x216a6e,_0x2261e2,!![]);}catch(_0x580810){return BPromise[_0x3a41('0x21')](_0x580810);}return _0x216a6e[_0x3a41('0x22')]();};}function saveUpdates(_0x42e9a8,_0x39dd32){return function(_0x935c96){if(_0x935c96){return _0x935c96[_0x3a41('0x23')](_0x42e9a8)[_0x3a41('0x24')](function(_0x6c50e6){return _0x6c50e6;});}return null;};}function removeEntity(_0x248840,_0x1e8307){return function(_0x46b0d3){if(_0x46b0d3){return _0x46b0d3[_0x3a41('0x25')]()[_0x3a41('0x24')](function(){var _0x235060=_0x46b0d3[_0x3a41('0x26')]({'plain':!![]});var _0x3fe24b=_0x3a41('0x27');return db[_0x3a41('0x28')][_0x3a41('0x25')]({'where':{'type':_0x3fe24b,'resourceId':_0x235060['id']}})[_0x3a41('0x24')](function(){return _0x46b0d3;});})['then'](function(){_0x248840[_0x3a41('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x130fb8,_0xd6c9cb){return function(_0x5a44b7){if(!_0x5a44b7){_0x130fb8[_0x3a41('0x29')](0x194);}return _0x5a44b7;};}function handleError(_0x500341,_0x5b102f){_0x5b102f=_0x5b102f||0x1f4;return function(_0x3d9a5c){logger[_0x3a41('0x2a')](_0x3d9a5c[_0x3a41('0x2b')]);if(_0x3d9a5c[_0x3a41('0x2c')]){delete _0x3d9a5c['name'];}_0x500341[_0x3a41('0x18')](_0x5b102f)[_0x3a41('0x2d')](_0x3d9a5c);};}exports[_0x3a41('0x2e')]=function(_0x192e0e,_0x4da1e6){var _0x1e0014={},_0x39e0d9={},_0x2cb001={'count':0x0,'rows':[]};var _0xcc0432=_['map'](db[_0x3a41('0x2f')][_0x3a41('0x30')],function(_0x159d98){return{'name':_0x159d98[_0x3a41('0x31')],'type':_0x159d98[_0x3a41('0x32')][_0x3a41('0x33')]};});_0x39e0d9[_0x3a41('0x34')]=_[_0x3a41('0x35')](_0xcc0432,'name');_0x39e0d9[_0x3a41('0x36')]=_[_0x3a41('0x37')](_0x192e0e['query']);_0x39e0d9['filters']=_[_0x3a41('0x38')](_0x39e0d9[_0x3a41('0x34')],_0x39e0d9[_0x3a41('0x36')]);_0x1e0014[_0x3a41('0x39')]=_[_0x3a41('0x38')](_0x39e0d9[_0x3a41('0x34')],qs[_0x3a41('0x3a')](_0x192e0e['query'][_0x3a41('0x3a')]));_0x1e0014[_0x3a41('0x39')]=_0x1e0014['attributes'][_0x3a41('0x3b')]?_0x1e0014[_0x3a41('0x39')]:_0x39e0d9[_0x3a41('0x34')];if(!_0x192e0e['query'][_0x3a41('0x3c')](_0x3a41('0x3d'))){_0x1e0014[_0x3a41('0x1b')]=qs['limit'](_0x192e0e['query'][_0x3a41('0x1b')]);_0x1e0014[_0x3a41('0x1c')]=qs[_0x3a41('0x1c')](_0x192e0e[_0x3a41('0x36')][_0x3a41('0x1c')]);}_0x1e0014[_0x3a41('0x3e')]=qs[_0x3a41('0x3f')](_0x192e0e[_0x3a41('0x36')]['sort']);_0x1e0014[_0x3a41('0x40')]=qs['filters'](_['pick'](_0x192e0e[_0x3a41('0x36')],_0x39e0d9['filters']),_0xcc0432);if(_0x192e0e['query'][_0x3a41('0x41')]){_0x1e0014[_0x3a41('0x40')]=_[_0x3a41('0x42')](_0x1e0014['where'],{'$or':[{'key':{'$like':'%'+_0x192e0e[_0x3a41('0x36')][_0x3a41('0x41')]+'%'}},{'value':{'$like':'%'+_0x192e0e['query'][_0x3a41('0x41')]+'%'}}]});}_0x1e0014=_[_0x3a41('0x42')]({},_0x1e0014,_0x192e0e[_0x3a41('0x43')]);var _0x1dd7ce={'where':_0x1e0014[_0x3a41('0x40')]};return db[_0x3a41('0x2f')]['count'](_0x1dd7ce)[_0x3a41('0x24')](function(_0x36a576){_0x2cb001[_0x3a41('0x1d')]=_0x36a576;if(_0x192e0e[_0x3a41('0x36')]['includeAll']){_0x1e0014[_0x3a41('0x44')]=[{'all':!![]}];}return db[_0x3a41('0x2f')][_0x3a41('0x45')](_0x1e0014);})['then'](function(_0x27957f){_0x2cb001['rows']=_0x27957f;return _0x2cb001;})[_0x3a41('0x24')](respondWithFilteredResult(_0x4da1e6,_0x1e0014))[_0x3a41('0x46')](handleError(_0x4da1e6,null));};exports['show']=function(_0x1dabd0,_0x2523ea){var _0x10157a={'raw':!![],'where':{'id':_0x1dabd0['params']['id']}},_0x464fdc={};_0x464fdc[_0x3a41('0x34')]=_[_0x3a41('0x37')](db[_0x3a41('0x2f')][_0x3a41('0x30')]);_0x464fdc['query']=_[_0x3a41('0x37')](_0x1dabd0[_0x3a41('0x36')]);_0x464fdc[_0x3a41('0x47')]=_[_0x3a41('0x38')](_0x464fdc['model'],_0x464fdc[_0x3a41('0x36')]);_0x10157a[_0x3a41('0x39')]=_[_0x3a41('0x38')](_0x464fdc[_0x3a41('0x34')],qs[_0x3a41('0x3a')](_0x1dabd0[_0x3a41('0x36')][_0x3a41('0x3a')]));_0x10157a[_0x3a41('0x39')]=_0x10157a[_0x3a41('0x39')][_0x3a41('0x3b')]?_0x10157a[_0x3a41('0x39')]:_0x464fdc['model'];if(_0x1dabd0['query'][_0x3a41('0x48')]){_0x10157a[_0x3a41('0x44')]=[{'all':!![]}];}_0x10157a=_[_0x3a41('0x42')]({},_0x10157a,_0x1dabd0['options']);return db[_0x3a41('0x2f')][_0x3a41('0x49')](_0x10157a)['then'](handleEntityNotFound(_0x2523ea,null))[_0x3a41('0x24')](respondWithResult(_0x2523ea,null))[_0x3a41('0x46')](handleError(_0x2523ea,null));};exports[_0x3a41('0x23')]=function(_0x377e45,_0x3387c2){if(_0x377e45['body']['id']){delete _0x377e45[_0x3a41('0x4a')]['id'];}return db[_0x3a41('0x2f')][_0x3a41('0x49')]({'where':{'id':_0x377e45[_0x3a41('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3387c2,null))[_0x3a41('0x24')](saveUpdates(_0x377e45[_0x3a41('0x4a')],null))['then'](respondWithResult(_0x3387c2,null))[_0x3a41('0x46')](handleError(_0x3387c2,null));};exports['destroy']=function(_0x51fe36,_0x369289){return db[_0x3a41('0x2f')]['find']({'where':{'id':_0x51fe36[_0x3a41('0x4b')]['id']}})[_0x3a41('0x24')](handleEntityNotFound(_0x369289,null))['then'](removeEntity(_0x369289,null))[_0x3a41('0x46')](handleError(_0x369289,null));};exports['create']=function(_0x573ada,_0x5bc910){var _0x189059={'key':_0x573ada[_0x3a41('0x4a')]['key']};if(_0x573ada['body'][_0x3a41('0x4c')]){_0x189059['MailAccountId']=_0x573ada['body'][_0x3a41('0x4c')];}else if(_0x573ada[_0x3a41('0x4a')][_0x3a41('0x4d')]){_0x189059[_0x3a41('0x4d')]=_0x573ada[_0x3a41('0x4a')][_0x3a41('0x4d')];}else if(_0x573ada[_0x3a41('0x4a')]['OpenchannelAccountId']){_0x189059['OpenchannelAccountId']=_0x573ada['body'][_0x3a41('0x4e')];}else if(_0x573ada[_0x3a41('0x4a')]['ChatWebsiteId']){_0x189059[_0x3a41('0x4f')]=_0x573ada[_0x3a41('0x4a')]['ChatWebsiteId'];}return db[_0x3a41('0x2f')][_0x3a41('0x49')]({'where':_0x189059})[_0x3a41('0x24')](function(_0x599176){if(_0x599176){throw new db[(_0x3a41('0x50'))]['ValidationError'](_0x3a41('0x51'));}return db['CannedAnswer'][_0x3a41('0x52')](_0x573ada[_0x3a41('0x4a')]);})[_0x3a41('0x24')](function(_0x89460f){var _0x8ba566=_0x573ada[_0x3a41('0x53')][_0x3a41('0x26')]({'plain':!![]});if(!_0x8ba566)throw new Error(_0x3a41('0x54'));if(_0x8ba566[_0x3a41('0x55')]===_0x3a41('0x53')){var _0x3ae39f=_0x89460f[_0x3a41('0x26')]({'plain':!![]});return db[_0x3a41('0x56')][_0x3a41('0x49')]({'where':{'name':_0x3a41('0x27'),'userProfileId':_0x8ba566[_0x3a41('0x57')]},'raw':!![]})[_0x3a41('0x24')](function(_0x34bff4){if(_0x34bff4&&_0x34bff4[_0x3a41('0x58')]===0x0){return db[_0x3a41('0x28')][_0x3a41('0x52')]({'name':_0x3ae39f[_0x3a41('0x2c')],'resourceId':_0x3ae39f['id'],'type':_0x34bff4[_0x3a41('0x2c')],'sectionId':_0x34bff4['id']},{})['then'](function(){return _0x89460f;});}else{return _0x89460f;}})[_0x3a41('0x46')](function(_0xee6b63){logger[_0x3a41('0x2a')](_0x3a41('0x59'),_0xee6b63);throw _0xee6b63;});}return _0x89460f;})['then'](respondWithResult(_0x5bc910,0xc9))['catch'](handleError(_0x5bc910,null));};
\ No newline at end of file
+var _0xf2eb=['save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','map','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','CannedAnswer','include','findAll','catch','show','params','keys','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit','count','offset','set','Content-Range','json','apply','reject'];(function(_0x3b87f4,_0x112243){var _0x63d16e=function(_0x3e7323){while(--_0x3e7323){_0x3b87f4['push'](_0x3b87f4['shift']());}};_0x63d16e(++_0x112243);}(_0xf2eb,0x1d5));var _0xbf2e=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xf2eb[_0x2b7764];return _0x848dcb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbf2e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbf2e('0x1'));var rp=require(_0xbf2e('0x2'));var moment=require('moment');var BPromise=require(_0xbf2e('0x3'));var Mustache=require('mustache');var util=require(_0xbf2e('0x4'));var path=require(_0xbf2e('0x5'));var sox=require(_0xbf2e('0x6'));var csv=require(_0xbf2e('0x7'));var ejs=require(_0xbf2e('0x8'));var fs=require('fs');var fs_extra=require(_0xbf2e('0x9'));var _=require(_0xbf2e('0xa'));var squel=require(_0xbf2e('0xb'));var crypto=require(_0xbf2e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbf2e('0xd'));var toCsv=require(_0xbf2e('0x7'));var querystring=require('querystring');var Papa=require(_0xbf2e('0xe'));var Redis=require(_0xbf2e('0xf'));var authService=require(_0xbf2e('0x10'));var qs=require(_0xbf2e('0x11'));var as=require(_0xbf2e('0x12'));var hardwareService=require(_0xbf2e('0x13'));var logger=require('../../config/logger')(_0xbf2e('0x14'));var utils=require(_0xbf2e('0x15'));var config=require(_0xbf2e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbf2e('0x17'))['db'];function respondWithStatusCode(_0x1f5b79,_0x34478d){_0x34478d=_0x34478d||0xcc;return function(_0x4b2724){if(_0x4b2724){return _0x1f5b79[_0xbf2e('0x18')](_0x34478d);}return _0x1f5b79[_0xbf2e('0x19')](_0x34478d)[_0xbf2e('0x1a')]();};}function respondWithResult(_0x28d488,_0x5df51e){_0x5df51e=_0x5df51e||0xc8;return function(_0x1fc70d){if(_0x1fc70d){return _0x28d488[_0xbf2e('0x19')](_0x5df51e)['json'](_0x1fc70d);}};}function respondWithFilteredResult(_0x2d7bb9,_0x258b77){return function(_0x672d66){if(_0x672d66){var _0xd18952=typeof _0x258b77['offset']==='undefined'&&typeof _0x258b77[_0xbf2e('0x1b')]==='undefined';var _0x71de48=_0x672d66[_0xbf2e('0x1c')];var _0x1ef1cd=_0xd18952?0x0:_0x258b77[_0xbf2e('0x1d')];var _0x2b9041=_0xd18952?_0x672d66[_0xbf2e('0x1c')]:_0x258b77[_0xbf2e('0x1d')]+_0x258b77[_0xbf2e('0x1b')];var _0x5d47d6;if(_0x2b9041>=_0x71de48){_0x2b9041=_0x71de48;_0x5d47d6=0xc8;}else{_0x5d47d6=0xce;}_0x2d7bb9[_0xbf2e('0x19')](_0x5d47d6);return _0x2d7bb9[_0xbf2e('0x1e')](_0xbf2e('0x1f'),_0x1ef1cd+'-'+_0x2b9041+'/'+_0x71de48)[_0xbf2e('0x20')](_0x672d66);}return null;};}function patchUpdates(_0x206588){return function(_0x2e9190){try{jsonpatch[_0xbf2e('0x21')](_0x2e9190,_0x206588,!![]);}catch(_0x16177f){return BPromise[_0xbf2e('0x22')](_0x16177f);}return _0x2e9190[_0xbf2e('0x23')]();};}function saveUpdates(_0x1d5120,_0x51d674){return function(_0x4cc0c2){if(_0x4cc0c2){return _0x4cc0c2[_0xbf2e('0x24')](_0x1d5120)[_0xbf2e('0x25')](function(_0x584886){return _0x584886;});}return null;};}function removeEntity(_0x2a0448,_0x25a65d){return function(_0x11ca41){if(_0x11ca41){return _0x11ca41[_0xbf2e('0x26')]()['then'](function(){var _0x525335=_0x11ca41[_0xbf2e('0x27')]({'plain':!![]});var _0xc56f7b=_0xbf2e('0x28');return db[_0xbf2e('0x29')][_0xbf2e('0x26')]({'where':{'type':_0xc56f7b,'resourceId':_0x525335['id']}})['then'](function(){return _0x11ca41;});})[_0xbf2e('0x25')](function(){_0x2a0448[_0xbf2e('0x19')](0xcc)[_0xbf2e('0x1a')]();});}};}function handleEntityNotFound(_0x434cce,_0x1cb878){return function(_0x2aff52){if(!_0x2aff52){_0x434cce[_0xbf2e('0x18')](0x194);}return _0x2aff52;};}function handleError(_0x364b94,_0x476044){_0x476044=_0x476044||0x1f4;return function(_0x268038){logger[_0xbf2e('0x2a')](_0x268038[_0xbf2e('0x2b')]);if(_0x268038[_0xbf2e('0x2c')]){delete _0x268038[_0xbf2e('0x2c')];}_0x364b94[_0xbf2e('0x19')](_0x476044)[_0xbf2e('0x2d')](_0x268038);};}exports['index']=function(_0x287cb5,_0x313d0a){var _0x29d8b9={},_0x53ba84={},_0x234e88={'count':0x0,'rows':[]};var _0x476f65=_[_0xbf2e('0x2e')](db['CannedAnswer']['rawAttributes'],function(_0x3e1bd1){return{'name':_0x3e1bd1['fieldName'],'type':_0x3e1bd1[_0xbf2e('0x2f')]['key']};});_0x53ba84[_0xbf2e('0x30')]=_[_0xbf2e('0x2e')](_0x476f65,_0xbf2e('0x2c'));_0x53ba84[_0xbf2e('0x31')]=_['keys'](_0x287cb5[_0xbf2e('0x31')]);_0x53ba84[_0xbf2e('0x32')]=_[_0xbf2e('0x33')](_0x53ba84[_0xbf2e('0x30')],_0x53ba84[_0xbf2e('0x31')]);_0x29d8b9[_0xbf2e('0x34')]=_[_0xbf2e('0x33')](_0x53ba84[_0xbf2e('0x30')],qs[_0xbf2e('0x35')](_0x287cb5[_0xbf2e('0x31')][_0xbf2e('0x35')]));_0x29d8b9['attributes']=_0x29d8b9['attributes'][_0xbf2e('0x36')]?_0x29d8b9[_0xbf2e('0x34')]:_0x53ba84[_0xbf2e('0x30')];if(!_0x287cb5['query']['hasOwnProperty'](_0xbf2e('0x37'))){_0x29d8b9['limit']=qs[_0xbf2e('0x1b')](_0x287cb5[_0xbf2e('0x31')][_0xbf2e('0x1b')]);_0x29d8b9[_0xbf2e('0x1d')]=qs[_0xbf2e('0x1d')](_0x287cb5[_0xbf2e('0x31')]['offset']);}_0x29d8b9[_0xbf2e('0x38')]=qs[_0xbf2e('0x39')](_0x287cb5[_0xbf2e('0x31')][_0xbf2e('0x39')]);_0x29d8b9[_0xbf2e('0x3a')]=qs[_0xbf2e('0x32')](_[_0xbf2e('0x3b')](_0x287cb5[_0xbf2e('0x31')],_0x53ba84[_0xbf2e('0x32')]),_0x476f65);if(_0x287cb5[_0xbf2e('0x31')][_0xbf2e('0x3c')]){_0x29d8b9['where']=_[_0xbf2e('0x3d')](_0x29d8b9[_0xbf2e('0x3a')],{'$or':[{'key':{'$like':'%'+_0x287cb5[_0xbf2e('0x31')]['filter']+'%'}},{'value':{'$like':'%'+_0x287cb5[_0xbf2e('0x31')]['filter']+'%'}}]});}_0x29d8b9=_[_0xbf2e('0x3d')]({},_0x29d8b9,_0x287cb5[_0xbf2e('0x3e')]);var _0x16b6c8={'where':_0x29d8b9[_0xbf2e('0x3a')]};return db[_0xbf2e('0x3f')][_0xbf2e('0x1c')](_0x16b6c8)[_0xbf2e('0x25')](function(_0x13e5f9){_0x234e88[_0xbf2e('0x1c')]=_0x13e5f9;if(_0x287cb5[_0xbf2e('0x31')]['includeAll']){_0x29d8b9[_0xbf2e('0x40')]=[{'all':!![]}];}return db['CannedAnswer'][_0xbf2e('0x41')](_0x29d8b9);})[_0xbf2e('0x25')](function(_0x20dac3){_0x234e88['rows']=_0x20dac3;return _0x234e88;})[_0xbf2e('0x25')](respondWithFilteredResult(_0x313d0a,_0x29d8b9))[_0xbf2e('0x42')](handleError(_0x313d0a,null));};exports[_0xbf2e('0x43')]=function(_0x60b009,_0x4839dd){var _0x267c56={'raw':!![],'where':{'id':_0x60b009[_0xbf2e('0x44')]['id']}},_0x3ceaa8={};_0x3ceaa8[_0xbf2e('0x30')]=_['keys'](db[_0xbf2e('0x3f')]['rawAttributes']);_0x3ceaa8[_0xbf2e('0x31')]=_[_0xbf2e('0x45')](_0x60b009[_0xbf2e('0x31')]);_0x3ceaa8[_0xbf2e('0x32')]=_[_0xbf2e('0x33')](_0x3ceaa8[_0xbf2e('0x30')],_0x3ceaa8['query']);_0x267c56[_0xbf2e('0x34')]=_[_0xbf2e('0x33')](_0x3ceaa8[_0xbf2e('0x30')],qs[_0xbf2e('0x35')](_0x60b009[_0xbf2e('0x31')][_0xbf2e('0x35')]));_0x267c56[_0xbf2e('0x34')]=_0x267c56['attributes'][_0xbf2e('0x36')]?_0x267c56[_0xbf2e('0x34')]:_0x3ceaa8[_0xbf2e('0x30')];if(_0x60b009[_0xbf2e('0x31')]['includeAll']){_0x267c56[_0xbf2e('0x40')]=[{'all':!![]}];}_0x267c56=_[_0xbf2e('0x3d')]({},_0x267c56,_0x60b009[_0xbf2e('0x3e')]);return db[_0xbf2e('0x3f')]['find'](_0x267c56)[_0xbf2e('0x25')](handleEntityNotFound(_0x4839dd,null))['then'](respondWithResult(_0x4839dd,null))[_0xbf2e('0x42')](handleError(_0x4839dd,null));};exports[_0xbf2e('0x24')]=function(_0x5cbcf6,_0x1c770d){if(_0x5cbcf6[_0xbf2e('0x46')]['id']){delete _0x5cbcf6['body']['id'];}return db[_0xbf2e('0x3f')][_0xbf2e('0x47')]({'where':{'id':_0x5cbcf6[_0xbf2e('0x44')]['id']}})['then'](handleEntityNotFound(_0x1c770d,null))[_0xbf2e('0x25')](saveUpdates(_0x5cbcf6['body'],null))[_0xbf2e('0x25')](respondWithResult(_0x1c770d,null))['catch'](handleError(_0x1c770d,null));};exports[_0xbf2e('0x26')]=function(_0x49e564,_0x50fa72){return db[_0xbf2e('0x3f')][_0xbf2e('0x47')]({'where':{'id':_0x49e564[_0xbf2e('0x44')]['id']}})[_0xbf2e('0x25')](handleEntityNotFound(_0x50fa72,null))[_0xbf2e('0x25')](removeEntity(_0x50fa72,null))['catch'](handleError(_0x50fa72,null));};exports[_0xbf2e('0x48')]=function(_0x4ee0f2,_0x2c01c7){var _0x34569b={'key':_0x4ee0f2[_0xbf2e('0x46')]['key']};if(_0x4ee0f2[_0xbf2e('0x46')][_0xbf2e('0x49')]){_0x34569b[_0xbf2e('0x49')]=_0x4ee0f2[_0xbf2e('0x46')][_0xbf2e('0x49')];}else if(_0x4ee0f2[_0xbf2e('0x46')]['SmsAccountId']){_0x34569b[_0xbf2e('0x4a')]=_0x4ee0f2[_0xbf2e('0x46')][_0xbf2e('0x4a')];}else if(_0x4ee0f2[_0xbf2e('0x46')][_0xbf2e('0x4b')]){_0x34569b[_0xbf2e('0x4b')]=_0x4ee0f2['body'][_0xbf2e('0x4b')];}else if(_0x4ee0f2[_0xbf2e('0x46')][_0xbf2e('0x4c')]){_0x34569b[_0xbf2e('0x4c')]=_0x4ee0f2[_0xbf2e('0x46')][_0xbf2e('0x4c')];}return db[_0xbf2e('0x3f')][_0xbf2e('0x47')]({'where':_0x34569b})[_0xbf2e('0x25')](function(_0x2960e3){if(_0x2960e3){throw new db[(_0xbf2e('0x4d'))][(_0xbf2e('0x4e'))](_0xbf2e('0x4f'));}return db[_0xbf2e('0x3f')][_0xbf2e('0x48')](_0x4ee0f2[_0xbf2e('0x46')]);})['then'](function(_0xc970fd){var _0x30f1b5=_0x4ee0f2[_0xbf2e('0x50')]['get']({'plain':!![]});if(!_0x30f1b5)throw new Error(_0xbf2e('0x51'));if(_0x30f1b5[_0xbf2e('0x52')]==='user'){var _0x13221a=_0xc970fd[_0xbf2e('0x27')]({'plain':!![]});return db['UserProfileSection'][_0xbf2e('0x47')]({'where':{'name':_0xbf2e('0x28'),'userProfileId':_0x30f1b5['userProfileId']},'raw':!![]})[_0xbf2e('0x25')](function(_0x3cfadc){if(_0x3cfadc&&_0x3cfadc['autoAssociation']===0x0){return db[_0xbf2e('0x29')][_0xbf2e('0x48')]({'name':_0x13221a[_0xbf2e('0x2c')],'resourceId':_0x13221a['id'],'type':_0x3cfadc[_0xbf2e('0x2c')],'sectionId':_0x3cfadc['id']},{})['then'](function(){return _0xc970fd;});}else{return _0xc970fd;}})[_0xbf2e('0x42')](function(_0x1808ba){logger[_0xbf2e('0x2a')](_0xbf2e('0x53'),_0x1808ba);throw _0x1808ba;});}return _0xc970fd;})[_0xbf2e('0x25')](respondWithResult(_0x2c01c7,0xc9))[_0xbf2e('0x42')](handleError(_0x2c01c7,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 8a06fc9..a677745 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 _0x09dd=['moment','bluebird','request-promise','path','rimraf','./cannedAnswer.attributes','define','lodash','util','../../config/logger','api'];(function(_0x251001,_0x41d6ee){var _0x1cce7e=function(_0x5ee1b3){while(--_0x5ee1b3){_0x251001['push'](_0x251001['shift']());}};_0x1cce7e(++_0x41d6ee);}(_0x09dd,0xb7));var _0xd09d=function(_0x493370,_0x4c7fac){_0x493370=_0x493370-0x0;var _0xac15d=_0x09dd[_0x493370];return _0xac15d;};'use strict';var _=require(_0xd09d('0x0'));var util=require(_0xd09d('0x1'));var logger=require(_0xd09d('0x2'))(_0xd09d('0x3'));var moment=require(_0xd09d('0x4'));var BPromise=require(_0xd09d('0x5'));var rp=require(_0xd09d('0x6'));var fs=require('fs');var path=require(_0xd09d('0x7'));var rimraf=require(_0xd09d('0x8'));var config=require('../../config/environment');var attributes=require(_0xd09d('0x9'));module['exports']=function(_0x274db5,_0x535080){return _0x274db5[_0xd09d('0xa')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x8f17=['moment','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x1416a3,_0x2734d6){var _0x2124d9=function(_0x3e5c16){while(--_0x3e5c16){_0x1416a3['push'](_0x1416a3['shift']());}};_0x2124d9(++_0x2734d6);}(_0x8f17,0xfb));var _0x78f1=function(_0x1afc73,_0x1e3ecb){_0x1afc73=_0x1afc73-0x0;var _0x23f0d2=_0x8f17[_0x1afc73];return _0x23f0d2;};'use strict';var _=require(_0x78f1('0x0'));var util=require(_0x78f1('0x1'));var logger=require(_0x78f1('0x2'))(_0x78f1('0x3'));var moment=require(_0x78f1('0x4'));var BPromise=require('bluebird');var rp=require(_0x78f1('0x5'));var fs=require('fs');var path=require(_0x78f1('0x6'));var rimraf=require(_0x78f1('0x7'));var config=require(_0x78f1('0x8'));var attributes=require(_0x78f1('0x9'));module[_0x78f1('0xa')]=function(_0x3ed7fd,_0x3a089b){return _0x3ed7fd[_0x78f1('0xb')]('CannedAnswer',attributes,{'tableName':_0x78f1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x78f1('0xd'),'collate':_0x78f1('0xe')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index fb2c03d..96729de 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(_0x470f5c,_0x1ed9bb){var _0x97f587=function(_0x209bd6){while(--_0x209bd6){_0x470f5c['push'](_0x470f5c['shift']());}};_0x97f587(++_0x1ed9bb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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(_0x33c15c,_0x4db5dd){var _0x64cf71=function(_0x50262b){while(--_0x50262b){_0x33c15c['push'](_0x33c15c['shift']());}};_0x64cf71(++_0x4db5dd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 afa499d..7144591 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 _0x5496=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','post','put','/:id'];(function(_0x5d55fb,_0x57ce20){var _0x337519=function(_0x49e41c){while(--_0x49e41c){_0x5d55fb['push'](_0x5d55fb['shift']());}};_0x337519(++_0x57ce20);}(_0x5496,0x134));var _0x6549=function(_0x243809,_0x12e002){_0x243809=_0x243809-0x0;var _0x3cd85e=_0x5496[_0x243809];return _0x3cd85e;};'use strict';var multer=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var path=require(_0x6549('0x2'));var timeout=require(_0x6549('0x3'));var express=require(_0x6549('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6549('0x5'));var config=require(_0x6549('0x6'));var controller=require('./cannedAnswer.controller');router[_0x6549('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6549('0x7')]('/:id',auth[_0x6549('0x8')](),controller['show']);router[_0x6549('0x9')]('/',auth[_0x6549('0x8')](),controller['create']);router[_0x6549('0xa')](_0x6549('0xb'),auth[_0x6549('0x8')](),controller[_0x6549('0xc')]);router[_0x6549('0xd')](_0x6549('0xb'),auth[_0x6549('0x8')](),controller[_0x6549('0xe')]);module[_0x6549('0xf')]=router;
\ No newline at end of file
+var _0x86bb=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','put','/:id','destroy','exports','multer','connect-timeout','express','fs-extra'];(function(_0x1731a9,_0x4fb551){var _0x22b9a5=function(_0x3b62fd){while(--_0x3b62fd){_0x1731a9['push'](_0x1731a9['shift']());}};_0x22b9a5(++_0x4fb551);}(_0x86bb,0x1ec));var _0xb86b=function(_0x374ea8,_0x444720){_0x374ea8=_0x374ea8-0x0;var _0x5bdf9f=_0x86bb[_0x374ea8];return _0x5bdf9f;};'use strict';var multer=require(_0xb86b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb86b('0x1'));var express=require(_0xb86b('0x2'));var router=express['Router']();var fs_extra=require(_0xb86b('0x3'));var auth=require(_0xb86b('0x4'));var interaction=require(_0xb86b('0x5'));var config=require(_0xb86b('0x6'));var controller=require('./cannedAnswer.controller');router[_0xb86b('0x7')]('/',auth[_0xb86b('0x8')](),controller[_0xb86b('0x9')]);router['get']('/:id',auth[_0xb86b('0x8')](),controller[_0xb86b('0xa')]);router[_0xb86b('0xb')]('/',auth[_0xb86b('0x8')](),controller['create']);router[_0xb86b('0xc')](_0xb86b('0xd'),auth[_0xb86b('0x8')](),controller['update']);router['delete'](_0xb86b('0xd'),auth[_0xb86b('0x8')](),controller[_0xb86b('0xe')]);module[_0xb86b('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 70c3cd3..0ac4235 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 _0xe773=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x3ef7ec,_0x25a299){var _0xdc5789=function(_0x535ccb){while(--_0x535ccb){_0x3ef7ec['push'](_0x3ef7ec['shift']());}};_0xdc5789(++_0x25a299);}(_0xe773,0x19a));var _0x3e77=function(_0x472855,_0x547e32){_0x472855=_0x472855-0x0;var _0x5543da=_0xe773[_0x472855];return _0x5543da;};'use strict';var Sequelize=require('sequelize');module[_0x3e77('0x0')]={'calldate':{'type':Sequelize[_0x3e77('0x1')],'allowNull':![],'defaultValue':_0x3e77('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x3e77('0x3')]},'dst':{'type':Sequelize[_0x3e77('0x3')]},'dcontext':{'type':Sequelize[_0x3e77('0x3')]},'channel':{'type':Sequelize[_0x3e77('0x3')]},'dstchannel':{'type':Sequelize[_0x3e77('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x3e77('0x3')]},'duration':{'type':Sequelize[_0x3e77('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x3e77('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x3e77('0x3')]},'amaflags':{'type':Sequelize[_0x3e77('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x3e77('0x3')]},'userfield':{'type':Sequelize[_0x3e77('0x3')]},'uniqueid':{'type':Sequelize[_0x3e77('0x3')]},'linkedid':{'type':Sequelize[_0x3e77('0x3')]},'sequence':{'type':Sequelize[_0x3e77('0x3')]},'peeraccount':{'type':Sequelize[_0x3e77('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x1d5b=['INTEGER','sequelize','exports','DATE','STRING'];(function(_0x28659f,_0x16f80d){var _0x120c75=function(_0x29323a){while(--_0x29323a){_0x28659f['push'](_0x28659f['shift']());}};_0x120c75(++_0x16f80d);}(_0x1d5b,0x13c));var _0xb1d5=function(_0x394fb1,_0x4072da){_0x394fb1=_0x394fb1-0x0;var _0x2ded0d=_0x1d5b[_0x394fb1];return _0x2ded0d;};'use strict';var Sequelize=require(_0xb1d5('0x0'));module[_0xb1d5('0x1')]={'calldate':{'type':Sequelize[_0xb1d5('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xb1d5('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xb1d5('0x3')]},'dcontext':{'type':Sequelize[_0xb1d5('0x3')]},'channel':{'type':Sequelize[_0xb1d5('0x3')]},'dstchannel':{'type':Sequelize[_0xb1d5('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xb1d5('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xb1d5('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb1d5('0x3')]},'amaflags':{'type':Sequelize[_0xb1d5('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb1d5('0x3')]},'userfield':{'type':Sequelize[_0xb1d5('0x3')]},'uniqueid':{'type':Sequelize[_0xb1d5('0x3')]},'linkedid':{'type':Sequelize[_0xb1d5('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xb1d5('0x3')]},'type':{'type':Sequelize[_0xb1d5('0x3')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 61817a6..8cc1004 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 _0x0618=['catch','show','intersection','options','create','body','update','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','end','stack','name','send','map','Cdr','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','then','rows'];(function(_0x39fb6a,_0x8b07ae){var _0x1452a1=function(_0x391804){while(--_0x391804){_0x39fb6a['push'](_0x39fb6a['shift']());}};_0x1452a1(++_0x8b07ae);}(_0x0618,0x1c6));var _0x8061=function(_0x244a18,_0x48c537){_0x244a18=_0x244a18-0x0;var _0x56975a=_0x0618[_0x244a18];return _0x56975a;};'use strict';var emlformat=require(_0x8061('0x0'));var rimraf=require(_0x8061('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8061('0x2'));var rp=require(_0x8061('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8061('0x4'));var util=require(_0x8061('0x5'));var path=require(_0x8061('0x6'));var sox=require(_0x8061('0x7'));var csv=require(_0x8061('0x8'));var ejs=require(_0x8061('0x9'));var fs=require('fs');var fs_extra=require(_0x8061('0xa'));var _=require(_0x8061('0xb'));var squel=require(_0x8061('0xc'));var crypto=require(_0x8061('0xd'));var jsforce=require(_0x8061('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8061('0x8'));var querystring=require('querystring');var Papa=require(_0x8061('0xf'));var Redis=require(_0x8061('0x10'));var authService=require(_0x8061('0x11'));var qs=require(_0x8061('0x12'));var as=require(_0x8061('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8061('0x14'));var utils=require(_0x8061('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8061('0x16'))['db'];function respondWithStatusCode(_0x141707,_0x724e64){_0x724e64=_0x724e64||0xcc;return function(_0x3537f0){if(_0x3537f0){return _0x141707[_0x8061('0x17')](_0x724e64);}return _0x141707[_0x8061('0x18')](_0x724e64)['end']();};}function respondWithResult(_0x4df59c,_0x19ea89){_0x19ea89=_0x19ea89||0xc8;return function(_0x4da339){if(_0x4da339){return _0x4df59c[_0x8061('0x18')](_0x19ea89)[_0x8061('0x19')](_0x4da339);}};}function respondWithFilteredResult(_0x567988,_0x483af8){return function(_0x460dfd){if(_0x460dfd){var _0x3264ff=typeof _0x483af8[_0x8061('0x1a')]===_0x8061('0x1b')&&typeof _0x483af8[_0x8061('0x1c')]===_0x8061('0x1b');var _0x280f9b=_0x460dfd[_0x8061('0x1d')];var _0x2b0eab=_0x3264ff?0x0:_0x483af8[_0x8061('0x1a')];var _0x14230e=_0x3264ff?_0x460dfd[_0x8061('0x1d')]:_0x483af8[_0x8061('0x1a')]+_0x483af8['limit'];var _0x4d254d;if(_0x14230e>=_0x280f9b){_0x14230e=_0x280f9b;_0x4d254d=0xc8;}else{_0x4d254d=0xce;}_0x567988[_0x8061('0x18')](_0x4d254d);return _0x567988[_0x8061('0x1e')](_0x8061('0x1f'),_0x2b0eab+'-'+_0x14230e+'/'+_0x280f9b)['json'](_0x460dfd);}return null;};}function patchUpdates(_0x53f869){return function(_0x36ccd5){try{jsonpatch[_0x8061('0x20')](_0x36ccd5,_0x53f869,!![]);}catch(_0x2bc509){return BPromise[_0x8061('0x21')](_0x2bc509);}return _0x36ccd5['save']();};}function saveUpdates(_0x49f708,_0x1cd5ed){return function(_0x12e73d){if(_0x12e73d){return _0x12e73d['update'](_0x49f708)['then'](function(_0x3dbaea){return _0x3dbaea;});}return null;};}function removeEntity(_0x554faa,_0x535cc9){return function(_0x37bff0){if(_0x37bff0){return _0x37bff0[_0x8061('0x22')]()['then'](function(){_0x554faa['status'](0xcc)[_0x8061('0x23')]();});}};}function handleEntityNotFound(_0x3f2765,_0x4e0860){return function(_0x1b0ec7){if(!_0x1b0ec7){_0x3f2765[_0x8061('0x17')](0x194);}return _0x1b0ec7;};}function handleError(_0x39fb5c,_0x2f7544){_0x2f7544=_0x2f7544||0x1f4;return function(_0x5f0822){logger['error'](_0x5f0822[_0x8061('0x24')]);if(_0x5f0822[_0x8061('0x25')]){delete _0x5f0822[_0x8061('0x25')];}_0x39fb5c[_0x8061('0x18')](_0x2f7544)[_0x8061('0x26')](_0x5f0822);};}exports['index']=function(_0x4c9202,_0x518700){var _0x59a65d={},_0xfb9138={},_0x38317c={'count':0x0,'rows':[]};var _0x36714f=_[_0x8061('0x27')](db[_0x8061('0x28')][_0x8061('0x29')],function(_0x2d1537){return{'name':_0x2d1537[_0x8061('0x2a')],'type':_0x2d1537[_0x8061('0x2b')][_0x8061('0x2c')]};});_0xfb9138['model']=_['map'](_0x36714f,_0x8061('0x25'));_0xfb9138[_0x8061('0x2d')]=_[_0x8061('0x2e')](_0x4c9202[_0x8061('0x2d')]);_0xfb9138[_0x8061('0x2f')]=_['intersection'](_0xfb9138[_0x8061('0x30')],_0xfb9138[_0x8061('0x2d')]);_0x59a65d['attributes']=_['intersection'](_0xfb9138[_0x8061('0x30')],qs[_0x8061('0x31')](_0x4c9202['query'][_0x8061('0x31')]));_0x59a65d[_0x8061('0x32')]=_0x59a65d[_0x8061('0x32')][_0x8061('0x33')]?_0x59a65d[_0x8061('0x32')]:_0xfb9138[_0x8061('0x30')];if(!_0x4c9202[_0x8061('0x2d')][_0x8061('0x34')](_0x8061('0x35'))){_0x59a65d['limit']=qs[_0x8061('0x1c')](_0x4c9202[_0x8061('0x2d')][_0x8061('0x1c')]);_0x59a65d[_0x8061('0x1a')]=qs['offset'](_0x4c9202['query']['offset']);}_0x59a65d['order']=qs['sort'](_0x4c9202[_0x8061('0x2d')]['sort']);_0x59a65d[_0x8061('0x36')]=qs[_0x8061('0x2f')](_[_0x8061('0x37')](_0x4c9202[_0x8061('0x2d')],_0xfb9138[_0x8061('0x2f')]),_0x36714f);if(_0x4c9202['query'][_0x8061('0x38')]){_0x59a65d[_0x8061('0x36')]=_[_0x8061('0x39')](_0x59a65d[_0x8061('0x36')],{'$or':_[_0x8061('0x27')](_0x36714f,function(_0x31ed9d){if(_0x31ed9d[_0x8061('0x2b')]!==_0x8061('0x3a')){var _0x714833={};_0x714833[_0x31ed9d[_0x8061('0x25')]]={'$like':'%'+_0x4c9202[_0x8061('0x2d')][_0x8061('0x38')]+'%'};return _0x714833;}})});}_0x59a65d=_['merge']({},_0x59a65d,_0x4c9202['options']);var _0xb72481={'where':_0x59a65d['where']};return db[_0x8061('0x28')]['count'](_0xb72481)['then'](function(_0x105747){_0x38317c[_0x8061('0x1d')]=_0x105747;if(_0x4c9202[_0x8061('0x2d')][_0x8061('0x3b')]){_0x59a65d[_0x8061('0x3c')]=[{'all':!![]}];}return db[_0x8061('0x28')][_0x8061('0x3d')](_0x59a65d);})[_0x8061('0x3e')](function(_0x1475b1){_0x38317c[_0x8061('0x3f')]=_0x1475b1;return _0x38317c;})['then'](respondWithFilteredResult(_0x518700,_0x59a65d))[_0x8061('0x40')](handleError(_0x518700,null));};exports[_0x8061('0x41')]=function(_0x177ab1,_0x2675e3){var _0x4435b8={'raw':!![],'where':{'id':_0x177ab1['params']['id']}},_0x4ea342={};_0x4ea342[_0x8061('0x30')]=_[_0x8061('0x2e')](db[_0x8061('0x28')][_0x8061('0x29')]);_0x4ea342[_0x8061('0x2d')]=_[_0x8061('0x2e')](_0x177ab1[_0x8061('0x2d')]);_0x4ea342['filters']=_[_0x8061('0x42')](_0x4ea342[_0x8061('0x30')],_0x4ea342[_0x8061('0x2d')]);_0x4435b8[_0x8061('0x32')]=_[_0x8061('0x42')](_0x4ea342[_0x8061('0x30')],qs[_0x8061('0x31')](_0x177ab1['query'][_0x8061('0x31')]));_0x4435b8['attributes']=_0x4435b8[_0x8061('0x32')][_0x8061('0x33')]?_0x4435b8[_0x8061('0x32')]:_0x4ea342['model'];if(_0x177ab1['query'][_0x8061('0x3b')]){_0x4435b8[_0x8061('0x3c')]=[{'all':!![]}];}_0x4435b8=_[_0x8061('0x39')]({},_0x4435b8,_0x177ab1[_0x8061('0x43')]);return db[_0x8061('0x28')]['find'](_0x4435b8)['then'](handleEntityNotFound(_0x2675e3,null))[_0x8061('0x3e')](respondWithResult(_0x2675e3,null))['catch'](handleError(_0x2675e3,null));};exports[_0x8061('0x44')]=function(_0x393bc9,_0x54546a){return db[_0x8061('0x28')][_0x8061('0x44')](_0x393bc9[_0x8061('0x45')],{})[_0x8061('0x3e')](respondWithResult(_0x54546a,0xc9))['catch'](handleError(_0x54546a,null));};exports[_0x8061('0x46')]=function(_0xb1cc9d,_0x2eaab6){if(_0xb1cc9d[_0x8061('0x45')]['id']){delete _0xb1cc9d[_0x8061('0x45')]['id'];}return db[_0x8061('0x28')][_0x8061('0x47')]({'where':{'id':_0xb1cc9d[_0x8061('0x48')]['id']}})[_0x8061('0x3e')](handleEntityNotFound(_0x2eaab6,null))[_0x8061('0x3e')](saveUpdates(_0xb1cc9d[_0x8061('0x45')],null))[_0x8061('0x3e')](respondWithResult(_0x2eaab6,null))[_0x8061('0x40')](handleError(_0x2eaab6,null));};exports[_0x8061('0x22')]=function(_0x291c8b,_0x30771f){return db[_0x8061('0x28')]['find']({'where':{'id':_0x291c8b[_0x8061('0x48')]['id']}})[_0x8061('0x3e')](handleEntityNotFound(_0x30771f,null))[_0x8061('0x3e')](removeEntity(_0x30771f,null))[_0x8061('0x40')](handleError(_0x30771f,null));};exports['describe']=function(_0x2be970,_0xd63f0e){return db[_0x8061('0x28')][_0x8061('0x49')]()[_0x8061('0x3e')](respondWithResult(_0xd63f0e,null))[_0x8061('0x40')](handleError(_0xd63f0e,null));};
\ No newline at end of file
+var _0x2b83=['stack','name','send','index','Cdr','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','includeAll','include','findAll','keys','options','create','catch','body','find','params','describe','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','count','offset','limit','set','json','apply','reject','save','update','destroy','then','error'];(function(_0x42973b,_0x4b7905){var _0x56bb1e=function(_0x532359){while(--_0x532359){_0x42973b['push'](_0x42973b['shift']());}};_0x56bb1e(++_0x4b7905);}(_0x2b83,0x1d3));var _0x32b8=function(_0x5cad70,_0xa8e39){_0x5cad70=_0x5cad70-0x0;var _0x2ebbb3=_0x2b83[_0x5cad70];return _0x2ebbb3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x32b8('0x0'));var zipdir=require(_0x32b8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x32b8('0x2'));var moment=require(_0x32b8('0x3'));var BPromise=require(_0x32b8('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x32b8('0x5'));var sox=require(_0x32b8('0x6'));var csv=require('to-csv');var ejs=require(_0x32b8('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32b8('0x8'));var squel=require(_0x32b8('0x9'));var crypto=require(_0x32b8('0xa'));var jsforce=require(_0x32b8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x32b8('0xc'));var querystring=require(_0x32b8('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x32b8('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x32b8('0xf'));var hardwareService=require(_0x32b8('0x10'));var logger=require(_0x32b8('0x11'))(_0x32b8('0x12'));var utils=require('../../config/utils');var config=require(_0x32b8('0x13'));var licenseUtil=require(_0x32b8('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49c337,_0x30d00a){_0x30d00a=_0x30d00a||0xcc;return function(_0x5a0ef2){if(_0x5a0ef2){return _0x49c337[_0x32b8('0x15')](_0x30d00a);}return _0x49c337['status'](_0x30d00a)[_0x32b8('0x16')]();};}function respondWithResult(_0x6b533e,_0x3b0fac){_0x3b0fac=_0x3b0fac||0xc8;return function(_0xdf56fb){if(_0xdf56fb){return _0x6b533e[_0x32b8('0x17')](_0x3b0fac)['json'](_0xdf56fb);}};}function respondWithFilteredResult(_0x4c8fc9,_0x5e7b4f){return function(_0x5e49d1){if(_0x5e49d1){var _0x4e0d7a=typeof _0x5e7b4f['offset']===_0x32b8('0x18')&&typeof _0x5e7b4f['limit']==='undefined';var _0x2828fc=_0x5e49d1[_0x32b8('0x19')];var _0x2ba4eb=_0x4e0d7a?0x0:_0x5e7b4f[_0x32b8('0x1a')];var _0x599bc3=_0x4e0d7a?_0x5e49d1['count']:_0x5e7b4f['offset']+_0x5e7b4f[_0x32b8('0x1b')];var _0x2ffea2;if(_0x599bc3>=_0x2828fc){_0x599bc3=_0x2828fc;_0x2ffea2=0xc8;}else{_0x2ffea2=0xce;}_0x4c8fc9[_0x32b8('0x17')](_0x2ffea2);return _0x4c8fc9[_0x32b8('0x1c')]('Content-Range',_0x2ba4eb+'-'+_0x599bc3+'/'+_0x2828fc)[_0x32b8('0x1d')](_0x5e49d1);}return null;};}function patchUpdates(_0x3ddc5f){return function(_0xb51551){try{jsonpatch[_0x32b8('0x1e')](_0xb51551,_0x3ddc5f,!![]);}catch(_0xb9dd1d){return BPromise[_0x32b8('0x1f')](_0xb9dd1d);}return _0xb51551[_0x32b8('0x20')]();};}function saveUpdates(_0xcd4b26,_0x52347c){return function(_0x567055){if(_0x567055){return _0x567055[_0x32b8('0x21')](_0xcd4b26)['then'](function(_0x1ec58d){return _0x1ec58d;});}return null;};}function removeEntity(_0x4bc4a8,_0x1a4c2b){return function(_0x21ee32){if(_0x21ee32){return _0x21ee32[_0x32b8('0x22')]()[_0x32b8('0x23')](function(){_0x4bc4a8[_0x32b8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e1360,_0x25a917){return function(_0x3eea54){if(!_0x3eea54){_0x4e1360[_0x32b8('0x15')](0x194);}return _0x3eea54;};}function handleError(_0x23e195,_0x29988d){_0x29988d=_0x29988d||0x1f4;return function(_0x57a6a3){logger[_0x32b8('0x24')](_0x57a6a3[_0x32b8('0x25')]);if(_0x57a6a3[_0x32b8('0x26')]){delete _0x57a6a3[_0x32b8('0x26')];}_0x23e195[_0x32b8('0x17')](_0x29988d)[_0x32b8('0x27')](_0x57a6a3);};}exports[_0x32b8('0x28')]=function(_0x39ce15,_0x3fa029){var _0xa225ec={},_0x3e0548={},_0x2bc3ce={'count':0x0,'rows':[]};var _0x1fcba2=_['map'](db[_0x32b8('0x29')][_0x32b8('0x2a')],function(_0x383b0e){return{'name':_0x383b0e[_0x32b8('0x2b')],'type':_0x383b0e[_0x32b8('0x2c')][_0x32b8('0x2d')]};});_0x3e0548[_0x32b8('0x2e')]=_[_0x32b8('0x2f')](_0x1fcba2,_0x32b8('0x26'));_0x3e0548[_0x32b8('0x30')]=_['keys'](_0x39ce15[_0x32b8('0x30')]);_0x3e0548[_0x32b8('0x31')]=_[_0x32b8('0x32')](_0x3e0548[_0x32b8('0x2e')],_0x3e0548['query']);_0xa225ec['attributes']=_[_0x32b8('0x32')](_0x3e0548[_0x32b8('0x2e')],qs[_0x32b8('0x33')](_0x39ce15[_0x32b8('0x30')]['fields']));_0xa225ec[_0x32b8('0x34')]=_0xa225ec[_0x32b8('0x34')][_0x32b8('0x35')]?_0xa225ec[_0x32b8('0x34')]:_0x3e0548[_0x32b8('0x2e')];if(!_0x39ce15[_0x32b8('0x30')][_0x32b8('0x36')](_0x32b8('0x37'))){_0xa225ec['limit']=qs[_0x32b8('0x1b')](_0x39ce15['query'][_0x32b8('0x1b')]);_0xa225ec[_0x32b8('0x1a')]=qs[_0x32b8('0x1a')](_0x39ce15[_0x32b8('0x30')][_0x32b8('0x1a')]);}_0xa225ec[_0x32b8('0x38')]=qs['sort'](_0x39ce15[_0x32b8('0x30')][_0x32b8('0x39')]);_0xa225ec[_0x32b8('0x3a')]=qs['filters'](_[_0x32b8('0x3b')](_0x39ce15['query'],_0x3e0548[_0x32b8('0x31')]),_0x1fcba2);if(_0x39ce15[_0x32b8('0x30')][_0x32b8('0x3c')]){_0xa225ec[_0x32b8('0x3a')]=_['merge'](_0xa225ec[_0x32b8('0x3a')],{'$or':_[_0x32b8('0x2f')](_0x1fcba2,function(_0x2d586f){if(_0x2d586f['type']!=='VIRTUAL'){var _0xa8115e={};_0xa8115e[_0x2d586f[_0x32b8('0x26')]]={'$like':'%'+_0x39ce15[_0x32b8('0x30')]['filter']+'%'};return _0xa8115e;}})});}_0xa225ec=_['merge']({},_0xa225ec,_0x39ce15['options']);var _0x1aa6ef={'where':_0xa225ec[_0x32b8('0x3a')]};return db[_0x32b8('0x29')]['count'](_0x1aa6ef)[_0x32b8('0x23')](function(_0x14c109){_0x2bc3ce[_0x32b8('0x19')]=_0x14c109;if(_0x39ce15[_0x32b8('0x30')][_0x32b8('0x3d')]){_0xa225ec[_0x32b8('0x3e')]=[{'all':!![]}];}return db[_0x32b8('0x29')][_0x32b8('0x3f')](_0xa225ec);})['then'](function(_0x39ec33){_0x2bc3ce['rows']=_0x39ec33;return _0x2bc3ce;})['then'](respondWithFilteredResult(_0x3fa029,_0xa225ec))['catch'](handleError(_0x3fa029,null));};exports['show']=function(_0x2d9003,_0x50e6e3){var _0x2a3968={'raw':!![],'where':{'id':_0x2d9003['params']['id']}},_0x52709b={};_0x52709b[_0x32b8('0x2e')]=_[_0x32b8('0x40')](db[_0x32b8('0x29')]['rawAttributes']);_0x52709b[_0x32b8('0x30')]=_[_0x32b8('0x40')](_0x2d9003[_0x32b8('0x30')]);_0x52709b['filters']=_['intersection'](_0x52709b[_0x32b8('0x2e')],_0x52709b['query']);_0x2a3968[_0x32b8('0x34')]=_['intersection'](_0x52709b[_0x32b8('0x2e')],qs['fields'](_0x2d9003[_0x32b8('0x30')][_0x32b8('0x33')]));_0x2a3968[_0x32b8('0x34')]=_0x2a3968[_0x32b8('0x34')]['length']?_0x2a3968['attributes']:_0x52709b[_0x32b8('0x2e')];if(_0x2d9003[_0x32b8('0x30')][_0x32b8('0x3d')]){_0x2a3968['include']=[{'all':!![]}];}_0x2a3968=_['merge']({},_0x2a3968,_0x2d9003[_0x32b8('0x41')]);return db[_0x32b8('0x29')]['find'](_0x2a3968)[_0x32b8('0x23')](handleEntityNotFound(_0x50e6e3,null))['then'](respondWithResult(_0x50e6e3,null))['catch'](handleError(_0x50e6e3,null));};exports['create']=function(_0x250ebf,_0x2d2624){return db[_0x32b8('0x29')][_0x32b8('0x42')](_0x250ebf['body'],{})[_0x32b8('0x23')](respondWithResult(_0x2d2624,0xc9))[_0x32b8('0x43')](handleError(_0x2d2624,null));};exports[_0x32b8('0x21')]=function(_0x29a413,_0x1a5bd4){if(_0x29a413[_0x32b8('0x44')]['id']){delete _0x29a413[_0x32b8('0x44')]['id'];}return db['Cdr'][_0x32b8('0x45')]({'where':{'id':_0x29a413[_0x32b8('0x46')]['id']}})[_0x32b8('0x23')](handleEntityNotFound(_0x1a5bd4,null))[_0x32b8('0x23')](saveUpdates(_0x29a413[_0x32b8('0x44')],null))[_0x32b8('0x23')](respondWithResult(_0x1a5bd4,null))[_0x32b8('0x43')](handleError(_0x1a5bd4,null));};exports[_0x32b8('0x22')]=function(_0x68210a,_0x5b8ca9){return db['Cdr'][_0x32b8('0x45')]({'where':{'id':_0x68210a[_0x32b8('0x46')]['id']}})[_0x32b8('0x23')](handleEntityNotFound(_0x5b8ca9,null))[_0x32b8('0x23')](removeEntity(_0x5b8ca9,null))[_0x32b8('0x43')](handleError(_0x5b8ca9,null));};exports[_0x32b8('0x47')]=function(_0x4f7c6f,_0xde4f61){return db[_0x32b8('0x29')][_0x32b8('0x47')]()[_0x32b8('0x23')](respondWithResult(_0xde4f61,null))['catch'](handleError(_0xde4f61,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 7031c5f..15fc4cb 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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x27a95a,_0x4bae5d){var _0x292282=function(_0x29b04e){while(--_0x29b04e){_0x27a95a['push'](_0x27a95a['shift']());}};_0x292282(++_0x4bae5d);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x4b4dce,_0x27b1de){var _0x97cab9=function(_0x3b4b8e){while(--_0x3b4b8e){_0x4b4dce['push'](_0x4b4dce['shift']());}};_0x97cab9(++_0x27b1de);}(_0x7a54,0x106));var _0x47a5=function(_0xfdcf6c,_0x1484c1){_0xfdcf6c=_0xfdcf6c-0x0;var _0x3580a2=_0x7a54[_0xfdcf6c];return _0x3580a2;};'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 1b21d6c..89ba1eb 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 _0xa70b=['debug','stringify','error','code','message','Cdr,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent'];(function(_0x52a7e1,_0x189bf3){var _0x4f4495=function(_0x5d1915){while(--_0x5d1915){_0x52a7e1['push'](_0x52a7e1['shift']());}};_0x4f4495(++_0x189bf3);}(_0xa70b,0x126));var _0xba70=function(_0x5b959e,_0x28debf){_0x5b959e=_0x5b959e-0x0;var _0x11df5a=_0xa70b[_0x5b959e];return _0x11df5a;};'use strict';var _=require(_0xba70('0x0'));var util=require(_0xba70('0x1'));var moment=require(_0xba70('0x2'));var BPromise=require(_0xba70('0x3'));var rs=require(_0xba70('0x4'));var fs=require('fs');var Redis=require(_0xba70('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xba70('0x6'))(_0xba70('0x7'));var config=require(_0xba70('0x8'));var jayson=require(_0xba70('0x9'));var client=jayson[_0xba70('0xa')][_0xba70('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ed505,_0x2ee216,_0x30e784){return new BPromise(function(_0xc989c8,_0x2ad227){return client['request'](_0x1ed505,_0x30e784)['then'](function(_0x1f4cb3){logger[_0xba70('0xc')]('Cdr,\x20%s,\x20%s',_0x2ee216,_0xba70('0xd'));logger[_0xba70('0xe')]('Cdr,\x20%s,\x20%s,\x20%s',_0x2ee216,_0xba70('0xd'),JSON[_0xba70('0xf')](_0x1f4cb3));if(_0x1f4cb3[_0xba70('0x10')]){if(_0x1f4cb3[_0xba70('0x10')][_0xba70('0x11')]===0x1f4){logger[_0xba70('0x10')]('Cdr,\x20%s,\x20%s',_0x2ee216,_0x1f4cb3[_0xba70('0x10')]['message']);return _0x2ad227(_0x1f4cb3['error'][_0xba70('0x12')]);}logger[_0xba70('0x10')](_0xba70('0x13'),_0x2ee216,_0x1f4cb3[_0xba70('0x10')][_0xba70('0x12')]);return _0xc989c8(_0x1f4cb3[_0xba70('0x10')][_0xba70('0x12')]);}else{logger[_0xba70('0xc')](_0xba70('0x13'),_0x2ee216,_0xba70('0xd'));_0xc989c8(_0x1f4cb3[_0xba70('0x14')][_0xba70('0x12')]);}})[_0xba70('0x15')](function(_0x3f3a02){logger[_0xba70('0x10')](_0xba70('0x13'),_0x2ee216,_0x3f3a02);_0x2ad227(_0x3f3a02);});});}
\ No newline at end of file
+var _0x68a4=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x194d89,_0x3cc65e){var _0x12e6bc=function(_0x34c3ca){while(--_0x34c3ca){_0x194d89['push'](_0x194d89['shift']());}};_0x12e6bc(++_0x3cc65e);}(_0x68a4,0xf0));var _0x468a=function(_0x12ee23,_0xacb61a){_0x12ee23=_0x12ee23-0x0;var _0x101a49=_0x68a4[_0x12ee23];return _0x101a49;};'use strict';var _=require(_0x468a('0x0'));var util=require(_0x468a('0x1'));var moment=require('moment');var BPromise=require(_0x468a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x468a('0x3'));var db=require(_0x468a('0x4'))['db'];var utils=require(_0x468a('0x5'));var logger=require(_0x468a('0x6'))(_0x468a('0x7'));var config=require(_0x468a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x468a('0x9')][_0x468a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3753e0,_0x331d0e,_0x3a0d99){return new BPromise(function(_0x933481,_0xc5f4e5){return client[_0x468a('0xb')](_0x3753e0,_0x3a0d99)[_0x468a('0xc')](function(_0xad2724){logger[_0x468a('0xd')](_0x468a('0xe'),_0x331d0e,_0x468a('0xf'));logger[_0x468a('0x10')](_0x468a('0x11'),_0x331d0e,_0x468a('0xf'),JSON[_0x468a('0x12')](_0xad2724));if(_0xad2724[_0x468a('0x13')]){if(_0xad2724[_0x468a('0x13')][_0x468a('0x14')]===0x1f4){logger[_0x468a('0x13')](_0x468a('0xe'),_0x331d0e,_0xad2724[_0x468a('0x13')]['message']);return _0xc5f4e5(_0xad2724[_0x468a('0x13')][_0x468a('0x15')]);}logger[_0x468a('0x13')](_0x468a('0xe'),_0x331d0e,_0xad2724[_0x468a('0x13')][_0x468a('0x15')]);return _0x933481(_0xad2724['error'][_0x468a('0x15')]);}else{logger['info'](_0x468a('0xe'),_0x331d0e,'request\x20sent');_0x933481(_0xad2724[_0x468a('0x16')][_0x468a('0x15')]);}})[_0x468a('0x17')](function(_0x18fa61){logger[_0x468a('0x13')](_0x468a('0xe'),_0x331d0e,_0x18fa61);_0xc5f4e5(_0x18fa61);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 5dfaac5..1c56429 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(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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(_0x24c57b,_0x2ab0c0){var _0x1d0146=function(_0x420e86){while(--_0x420e86){_0x24c57b['push'](_0x24c57b['shift']());}};_0x1d0146(++_0x2ab0c0);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 6274f79..f8d07dc 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 _0xd8fc=['TEXT','exports','INTEGER','STRING','noop'];(function(_0x584cef,_0x352150){var _0x41d443=function(_0x14b843){while(--_0x14b843){_0x584cef['push'](_0x584cef['shift']());}};_0x41d443(++_0x352150);}(_0xd8fc,0x150));var _0xcd8f=function(_0x390733,_0x1e3d32){_0x390733=_0x390733-0x0;var _0x33beb9=_0xd8fc[_0x390733];return _0x33beb9;};'use strict';var Sequelize=require('sequelize');module[_0xcd8f('0x0')]={'priority':{'type':Sequelize[_0xcd8f('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xcd8f('0x2')],'allowNull':![],'defaultValue':_0xcd8f('0x3')},'appdata':{'type':Sequelize[_0xcd8f('0x4')]()},'description':{'type':Sequelize[_0xcd8f('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x1844=['noop','TEXT','sequelize','exports','STRING'];(function(_0x3e4a3a,_0x655dce){var _0x33c212=function(_0x9ea73d){while(--_0x9ea73d){_0x3e4a3a['push'](_0x3e4a3a['shift']());}};_0x33c212(++_0x655dce);}(_0x1844,0x66));var _0x4184=function(_0x4e148a,_0x2784e3){_0x4e148a=_0x4e148a-0x0;var _0x494092=_0x1844[_0x4e148a];return _0x494092;};'use strict';var Sequelize=require(_0x4184('0x0'));module[_0x4184('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x4184('0x2')],'allowNull':![],'defaultValue':_0x4184('0x3')},'appdata':{'type':Sequelize[_0x4184('0x4')]()},'description':{'type':Sequelize[_0x4184('0x2')]},'interval':{'type':Sequelize[_0x4184('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index e09d546..f74cec0 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 _0x2e31=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','reject','save','update','then','destroy','end','stack','name','send','show','params','model','ChatApplication','query','keys','filters','intersection','attributes','fields','include','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service'];(function(_0x4968a6,_0x22c750){var _0x54592b=function(_0x4190c8){while(--_0x4190c8){_0x4968a6['push'](_0x4968a6['shift']());}};_0x54592b(++_0x22c750);}(_0x2e31,0x145));var _0x12e3=function(_0x4947e3,_0x28b655){_0x4947e3=_0x4947e3-0x0;var _0x26dac7=_0x2e31[_0x4947e3];return _0x26dac7;};'use strict';var emlformat=require(_0x12e3('0x0'));var rimraf=require(_0x12e3('0x1'));var zipdir=require(_0x12e3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x12e3('0x3'));var moment=require(_0x12e3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x12e3('0x5'));var path=require(_0x12e3('0x6'));var sox=require(_0x12e3('0x7'));var csv=require('to-csv');var ejs=require(_0x12e3('0x8'));var fs=require('fs');var fs_extra=require(_0x12e3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x12e3('0xa'));var jsforce=require(_0x12e3('0xb'));var deskjs=require(_0x12e3('0xc'));var toCsv=require(_0x12e3('0xd'));var querystring=require('querystring');var Papa=require(_0x12e3('0xe'));var Redis=require(_0x12e3('0xf'));var authService=require(_0x12e3('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x12e3('0x11'));var logger=require(_0x12e3('0x12'))(_0x12e3('0x13'));var utils=require(_0x12e3('0x14'));var config=require(_0x12e3('0x15'));var licenseUtil=require(_0x12e3('0x16'));var db=require(_0x12e3('0x17'))['db'];function respondWithStatusCode(_0xc2c4c8,_0x2b5dc3){_0x2b5dc3=_0x2b5dc3||0xcc;return function(_0x464b63){if(_0x464b63){return _0xc2c4c8[_0x12e3('0x18')](_0x2b5dc3);}return _0xc2c4c8[_0x12e3('0x19')](_0x2b5dc3)['end']();};}function respondWithResult(_0x2b5352,_0x19de67){_0x19de67=_0x19de67||0xc8;return function(_0xd9f80f){if(_0xd9f80f){return _0x2b5352['status'](_0x19de67)[_0x12e3('0x1a')](_0xd9f80f);}};}function respondWithFilteredResult(_0x1f7b14,_0x4a29e8){return function(_0x5434fd){if(_0x5434fd){var _0x583ca3=typeof _0x4a29e8[_0x12e3('0x1b')]==='undefined'&&typeof _0x4a29e8[_0x12e3('0x1c')]===_0x12e3('0x1d');var _0x114a83=_0x5434fd[_0x12e3('0x1e')];var _0x211c6a=_0x583ca3?0x0:_0x4a29e8[_0x12e3('0x1b')];var _0x5a63c8=_0x583ca3?_0x5434fd[_0x12e3('0x1e')]:_0x4a29e8[_0x12e3('0x1b')]+_0x4a29e8['limit'];var _0x527dc6;if(_0x5a63c8>=_0x114a83){_0x5a63c8=_0x114a83;_0x527dc6=0xc8;}else{_0x527dc6=0xce;}_0x1f7b14['status'](_0x527dc6);return _0x1f7b14[_0x12e3('0x1f')]('Content-Range',_0x211c6a+'-'+_0x5a63c8+'/'+_0x114a83)[_0x12e3('0x1a')](_0x5434fd);}return null;};}function patchUpdates(_0x2ddfbf){return function(_0x5a1990){try{jsonpatch['apply'](_0x5a1990,_0x2ddfbf,!![]);}catch(_0x37151c){return BPromise[_0x12e3('0x20')](_0x37151c);}return _0x5a1990[_0x12e3('0x21')]();};}function saveUpdates(_0x1f1873,_0x4b8617){return function(_0x55380a){if(_0x55380a){return _0x55380a[_0x12e3('0x22')](_0x1f1873)[_0x12e3('0x23')](function(_0x607255){return _0x607255;});}return null;};}function removeEntity(_0x2705e8,_0x2cf78a){return function(_0x553982){if(_0x553982){return _0x553982[_0x12e3('0x24')]()[_0x12e3('0x23')](function(){_0x2705e8[_0x12e3('0x19')](0xcc)[_0x12e3('0x25')]();});}};}function handleEntityNotFound(_0x43a59f,_0x3361d2){return function(_0x578681){if(!_0x578681){_0x43a59f[_0x12e3('0x18')](0x194);}return _0x578681;};}function handleError(_0x1c5344,_0x4213db){_0x4213db=_0x4213db||0x1f4;return function(_0x42765f){logger['error'](_0x42765f[_0x12e3('0x26')]);if(_0x42765f[_0x12e3('0x27')]){delete _0x42765f[_0x12e3('0x27')];}_0x1c5344['status'](_0x4213db)[_0x12e3('0x28')](_0x42765f);};}exports[_0x12e3('0x29')]=function(_0x329d32,_0x337790){var _0x5a5dd1={'raw':!![],'where':{'id':_0x329d32[_0x12e3('0x2a')]['id']}},_0x342ad2={};_0x342ad2[_0x12e3('0x2b')]=_['keys'](db[_0x12e3('0x2c')]['rawAttributes']);_0x342ad2[_0x12e3('0x2d')]=_[_0x12e3('0x2e')](_0x329d32[_0x12e3('0x2d')]);_0x342ad2[_0x12e3('0x2f')]=_[_0x12e3('0x30')](_0x342ad2[_0x12e3('0x2b')],_0x342ad2['query']);_0x5a5dd1[_0x12e3('0x31')]=_[_0x12e3('0x30')](_0x342ad2['model'],qs[_0x12e3('0x32')](_0x329d32[_0x12e3('0x2d')]['fields']));_0x5a5dd1[_0x12e3('0x31')]=_0x5a5dd1[_0x12e3('0x31')]['length']?_0x5a5dd1[_0x12e3('0x31')]:_0x342ad2[_0x12e3('0x2b')];if(_0x329d32[_0x12e3('0x2d')]['includeAll']){_0x5a5dd1[_0x12e3('0x33')]=[{'all':!![]}];}_0x5a5dd1=_[_0x12e3('0x34')]({},_0x5a5dd1,_0x329d32[_0x12e3('0x35')]);return db[_0x12e3('0x2c')][_0x12e3('0x36')](_0x5a5dd1)[_0x12e3('0x23')](handleEntityNotFound(_0x337790,null))[_0x12e3('0x23')](respondWithResult(_0x337790,null))[_0x12e3('0x37')](handleError(_0x337790,null));};exports[_0x12e3('0x22')]=function(_0x273d2f,_0x19d331){if(_0x273d2f[_0x12e3('0x38')]['id']){delete _0x273d2f[_0x12e3('0x38')]['id'];}return db['ChatApplication'][_0x12e3('0x36')]({'where':{'id':_0x273d2f['params']['id']}})[_0x12e3('0x23')](handleEntityNotFound(_0x19d331,null))['then'](saveUpdates(_0x273d2f[_0x12e3('0x38')],null))[_0x12e3('0x23')](respondWithResult(_0x19d331,null))['catch'](handleError(_0x19d331,null));};exports[_0x12e3('0x24')]=function(_0x31910f,_0x5c7f42){return db[_0x12e3('0x2c')][_0x12e3('0x36')]({'where':{'id':_0x31910f[_0x12e3('0x2a')]['id']}})['then'](handleEntityNotFound(_0x5c7f42,null))[_0x12e3('0x23')](removeEntity(_0x5c7f42,null))[_0x12e3('0x37')](handleError(_0x5c7f42,null));};
\ No newline at end of file
+var _0x0efe=['undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','show','keys','rawAttributes','query','filters','intersection','attributes','fields','length','model','include','merge','options','ChatApplication','catch','body','find','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','end','status','json','offset'];(function(_0xf389d7,_0x4ed315){var _0x914d09=function(_0x595e34){while(--_0x595e34){_0xf389d7['push'](_0xf389d7['shift']());}};_0x914d09(++_0x4ed315);}(_0x0efe,0x110));var _0xe0ef=function(_0xabdace,_0x1f5b40){_0xabdace=_0xabdace-0x0;var _0x37da12=_0x0efe[_0xabdace];return _0x37da12;};'use strict';var emlformat=require(_0xe0ef('0x0'));var rimraf=require(_0xe0ef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe0ef('0x2'));var rp=require(_0xe0ef('0x3'));var moment=require(_0xe0ef('0x4'));var BPromise=require(_0xe0ef('0x5'));var Mustache=require(_0xe0ef('0x6'));var util=require(_0xe0ef('0x7'));var path=require(_0xe0ef('0x8'));var sox=require(_0xe0ef('0x9'));var csv=require(_0xe0ef('0xa'));var ejs=require(_0xe0ef('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe0ef('0xc'));var crypto=require(_0xe0ef('0xd'));var jsforce=require(_0xe0ef('0xe'));var deskjs=require(_0xe0ef('0xf'));var toCsv=require(_0xe0ef('0xa'));var querystring=require(_0xe0ef('0x10'));var Papa=require(_0xe0ef('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe0ef('0x12'));var as=require(_0xe0ef('0x13'));var hardwareService=require(_0xe0ef('0x14'));var logger=require('../../config/logger')(_0xe0ef('0x15'));var utils=require(_0xe0ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe0ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38c64f,_0x90c232){_0x90c232=_0x90c232||0xcc;return function(_0x3cce82){if(_0x3cce82){return _0x38c64f['sendStatus'](_0x90c232);}return _0x38c64f['status'](_0x90c232)[_0xe0ef('0x18')]();};}function respondWithResult(_0x196114,_0x1afbbc){_0x1afbbc=_0x1afbbc||0xc8;return function(_0x1fbfd0){if(_0x1fbfd0){return _0x196114[_0xe0ef('0x19')](_0x1afbbc)[_0xe0ef('0x1a')](_0x1fbfd0);}};}function respondWithFilteredResult(_0x2b7564,_0x1177d2){return function(_0x5d845d){if(_0x5d845d){var _0x401f4a=typeof _0x1177d2[_0xe0ef('0x1b')]===_0xe0ef('0x1c')&&typeof _0x1177d2[_0xe0ef('0x1d')]===_0xe0ef('0x1c');var _0x5618ad=_0x5d845d[_0xe0ef('0x1e')];var _0x25ae21=_0x401f4a?0x0:_0x1177d2[_0xe0ef('0x1b')];var _0xe9d60f=_0x401f4a?_0x5d845d[_0xe0ef('0x1e')]:_0x1177d2[_0xe0ef('0x1b')]+_0x1177d2[_0xe0ef('0x1d')];var _0x3a357c;if(_0xe9d60f>=_0x5618ad){_0xe9d60f=_0x5618ad;_0x3a357c=0xc8;}else{_0x3a357c=0xce;}_0x2b7564[_0xe0ef('0x19')](_0x3a357c);return _0x2b7564[_0xe0ef('0x1f')](_0xe0ef('0x20'),_0x25ae21+'-'+_0xe9d60f+'/'+_0x5618ad)[_0xe0ef('0x1a')](_0x5d845d);}return null;};}function patchUpdates(_0x450321){return function(_0x50c044){try{jsonpatch[_0xe0ef('0x21')](_0x50c044,_0x450321,!![]);}catch(_0xe789bc){return BPromise[_0xe0ef('0x22')](_0xe789bc);}return _0x50c044[_0xe0ef('0x23')]();};}function saveUpdates(_0x58810f,_0x140f42){return function(_0x115cb3){if(_0x115cb3){return _0x115cb3[_0xe0ef('0x24')](_0x58810f)[_0xe0ef('0x25')](function(_0x1c0fcb){return _0x1c0fcb;});}return null;};}function removeEntity(_0x1c8270,_0x255b55){return function(_0x59b64c){if(_0x59b64c){return _0x59b64c[_0xe0ef('0x26')]()[_0xe0ef('0x25')](function(){_0x1c8270['status'](0xcc)[_0xe0ef('0x18')]();});}};}function handleEntityNotFound(_0x1cd61a,_0x5bc53a){return function(_0x576082){if(!_0x576082){_0x1cd61a['sendStatus'](0x194);}return _0x576082;};}function handleError(_0x7295c0,_0x4ee2c1){_0x4ee2c1=_0x4ee2c1||0x1f4;return function(_0x3f4e80){logger[_0xe0ef('0x27')](_0x3f4e80[_0xe0ef('0x28')]);if(_0x3f4e80['name']){delete _0x3f4e80['name'];}_0x7295c0['status'](_0x4ee2c1)[_0xe0ef('0x29')](_0x3f4e80);};}exports[_0xe0ef('0x2a')]=function(_0x3dd451,_0x31e576){var _0x2d1674={'raw':!![],'where':{'id':_0x3dd451['params']['id']}},_0x2b0d3c={};_0x2b0d3c['model']=_[_0xe0ef('0x2b')](db['ChatApplication'][_0xe0ef('0x2c')]);_0x2b0d3c[_0xe0ef('0x2d')]=_['keys'](_0x3dd451['query']);_0x2b0d3c[_0xe0ef('0x2e')]=_[_0xe0ef('0x2f')](_0x2b0d3c['model'],_0x2b0d3c[_0xe0ef('0x2d')]);_0x2d1674[_0xe0ef('0x30')]=_[_0xe0ef('0x2f')](_0x2b0d3c['model'],qs['fields'](_0x3dd451['query'][_0xe0ef('0x31')]));_0x2d1674['attributes']=_0x2d1674[_0xe0ef('0x30')][_0xe0ef('0x32')]?_0x2d1674['attributes']:_0x2b0d3c[_0xe0ef('0x33')];if(_0x3dd451[_0xe0ef('0x2d')]['includeAll']){_0x2d1674[_0xe0ef('0x34')]=[{'all':!![]}];}_0x2d1674=_[_0xe0ef('0x35')]({},_0x2d1674,_0x3dd451[_0xe0ef('0x36')]);return db[_0xe0ef('0x37')]['find'](_0x2d1674)[_0xe0ef('0x25')](handleEntityNotFound(_0x31e576,null))[_0xe0ef('0x25')](respondWithResult(_0x31e576,null))[_0xe0ef('0x38')](handleError(_0x31e576,null));};exports[_0xe0ef('0x24')]=function(_0x4a1d24,_0x244f57){if(_0x4a1d24[_0xe0ef('0x39')]['id']){delete _0x4a1d24[_0xe0ef('0x39')]['id'];}return db[_0xe0ef('0x37')][_0xe0ef('0x3a')]({'where':{'id':_0x4a1d24[_0xe0ef('0x3b')]['id']}})[_0xe0ef('0x25')](handleEntityNotFound(_0x244f57,null))[_0xe0ef('0x25')](saveUpdates(_0x4a1d24[_0xe0ef('0x39')],null))['then'](respondWithResult(_0x244f57,null))[_0xe0ef('0x38')](handleError(_0x244f57,null));};exports[_0xe0ef('0x26')]=function(_0x1f6a73,_0x1cb146){return db[_0xe0ef('0x37')][_0xe0ef('0x3a')]({'where':{'id':_0x1f6a73[_0xe0ef('0x3b')]['id']}})[_0xe0ef('0x25')](handleEntityNotFound(_0x1cb146,null))[_0xe0ef('0x25')](removeEntity(_0x1cb146,null))[_0xe0ef('0x38')](handleError(_0x1cb146,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index b7589e3..4397ad3 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 _0x27c7=['ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','define'];(function(_0x386525,_0xefae6){var _0x14d015=function(_0x4a45c1){while(--_0x4a45c1){_0x386525['push'](_0x386525['shift']());}};_0x14d015(++_0xefae6);}(_0x27c7,0x10d));var _0x727c=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x27c7[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x727c('0x0'));var util=require(_0x727c('0x1'));var logger=require(_0x727c('0x2'))('api');var moment=require(_0x727c('0x3'));var BPromise=require(_0x727c('0x4'));var rp=require(_0x727c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x727c('0x6'));var config=require(_0x727c('0x7'));var attributes=require(_0x727c('0x8'));module[_0x727c('0x9')]=function(_0x4db2fe,_0x1d6c6f){return _0x4db2fe[_0x727c('0xa')](_0x727c('0xb'),attributes,{'tableName':_0x727c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x727c('0xd')});};
\ No newline at end of file
+var _0xd91d=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatApplication'];(function(_0xcf95b4,_0x24baf1){var _0x20d28b=function(_0x3814e7){while(--_0x3814e7){_0xcf95b4['push'](_0xcf95b4['shift']());}};_0x20d28b(++_0x24baf1);}(_0xd91d,0x71));var _0xdd91=function(_0x29a50f,_0x1a6fb3){_0x29a50f=_0x29a50f-0x0;var _0x20ec94=_0xd91d[_0x29a50f];return _0x20ec94;};'use strict';var _=require(_0xdd91('0x0'));var util=require(_0xdd91('0x1'));var logger=require(_0xdd91('0x2'))(_0xdd91('0x3'));var moment=require(_0xdd91('0x4'));var BPromise=require(_0xdd91('0x5'));var rp=require(_0xdd91('0x6'));var fs=require('fs');var path=require(_0xdd91('0x7'));var rimraf=require(_0xdd91('0x8'));var config=require(_0xdd91('0x9'));var attributes=require('./chatApplication.attributes');module[_0xdd91('0xa')]=function(_0x1a50b0,_0x36b850){return _0x1a50b0[_0xdd91('0xb')](_0xdd91('0xc'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xdd91('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 6e9c613..8b07c8d 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 _0x8bde=['request\x20sent','debug','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s'];(function(_0x2c0ad1,_0x42a5e0){var _0x22b9ad=function(_0x5e0fdd){while(--_0x5e0fdd){_0x2c0ad1['push'](_0x2c0ad1['shift']());}};_0x22b9ad(++_0x42a5e0);}(_0x8bde,0x15a));var _0xe8bd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8bde[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe8bd('0x0'));var util=require(_0xe8bd('0x1'));var moment=require(_0xe8bd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe8bd('0x3'));var db=require(_0xe8bd('0x4'))['db'];var utils=require(_0xe8bd('0x5'));var logger=require(_0xe8bd('0x6'))('rpc');var config=require(_0xe8bd('0x7'));var jayson=require(_0xe8bd('0x8'));var client=jayson[_0xe8bd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1573a7,_0x308029,_0x63aea7){return new BPromise(function(_0x3e0f7c,_0x3fa4c8){return client[_0xe8bd('0xa')](_0x1573a7,_0x63aea7)[_0xe8bd('0xb')](function(_0x3b5794){logger[_0xe8bd('0xc')](_0xe8bd('0xd'),_0x308029,_0xe8bd('0xe'));logger[_0xe8bd('0xf')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x308029,_0xe8bd('0xe'),JSON['stringify'](_0x3b5794));if(_0x3b5794[_0xe8bd('0x10')]){if(_0x3b5794['error'][_0xe8bd('0x11')]===0x1f4){logger[_0xe8bd('0x10')](_0xe8bd('0xd'),_0x308029,_0x3b5794[_0xe8bd('0x10')][_0xe8bd('0x12')]);return _0x3fa4c8(_0x3b5794['error'][_0xe8bd('0x12')]);}logger[_0xe8bd('0x10')](_0xe8bd('0xd'),_0x308029,_0x3b5794[_0xe8bd('0x10')][_0xe8bd('0x12')]);return _0x3e0f7c(_0x3b5794[_0xe8bd('0x10')][_0xe8bd('0x12')]);}else{logger[_0xe8bd('0xc')](_0xe8bd('0xd'),_0x308029,_0xe8bd('0xe'));_0x3e0f7c(_0x3b5794[_0xe8bd('0x13')]['message']);}})['catch'](function(_0x2ee31f){logger[_0xe8bd('0x10')](_0xe8bd('0xd'),_0x308029,_0x2ee31f);_0x3fa4c8(_0x2ee31f);});});}
\ No newline at end of file
+var _0x6b7d=['info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x346b32,_0x3109fd){var _0xa31991=function(_0x3b8b7f){while(--_0x3b8b7f){_0x346b32['push'](_0x346b32['shift']());}};_0xa31991(++_0x3109fd);}(_0x6b7d,0x7b));var _0xd6b7=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x6b7d[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xd6b7('0x0'));var util=require('util');var moment=require(_0xd6b7('0x1'));var BPromise=require(_0xd6b7('0x2'));var rs=require(_0xd6b7('0x3'));var fs=require('fs');var Redis=require(_0xd6b7('0x4'));var db=require(_0xd6b7('0x5'))['db'];var utils=require(_0xd6b7('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xd6b7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd6b7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f3477,_0x52d56d,_0x33d39f){return new BPromise(function(_0x372377,_0x1050fa){return client['request'](_0x4f3477,_0x33d39f)[_0xd6b7('0x9')](function(_0x3e8622){logger['info'](_0xd6b7('0xa'),_0x52d56d,_0xd6b7('0xb'));logger[_0xd6b7('0xc')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x52d56d,'request\x20sent',JSON[_0xd6b7('0xd')](_0x3e8622));if(_0x3e8622[_0xd6b7('0xe')]){if(_0x3e8622[_0xd6b7('0xe')][_0xd6b7('0xf')]===0x1f4){logger[_0xd6b7('0xe')](_0xd6b7('0xa'),_0x52d56d,_0x3e8622[_0xd6b7('0xe')][_0xd6b7('0x10')]);return _0x1050fa(_0x3e8622[_0xd6b7('0xe')][_0xd6b7('0x10')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x52d56d,_0x3e8622[_0xd6b7('0xe')][_0xd6b7('0x10')]);return _0x372377(_0x3e8622['error'][_0xd6b7('0x10')]);}else{logger[_0xd6b7('0x11')](_0xd6b7('0xa'),_0x52d56d,_0xd6b7('0xb'));_0x372377(_0x3e8622[_0xd6b7('0x12')][_0xd6b7('0x10')]);}})[_0xd6b7('0x13')](function(_0x26d4d3){logger[_0xd6b7('0xe')](_0xd6b7('0xa'),_0x52d56d,_0x26d4d3);_0x1050fa(_0x26d4d3);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 0345c1e..9e998da 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 _0x53c3=['get','/:id','show','isAuthenticated','update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller'];(function(_0xb86097,_0x251ba4){var _0x12bfcf=function(_0x4743c7){while(--_0x4743c7){_0xb86097['push'](_0xb86097['shift']());}};_0x12bfcf(++_0x251ba4);}(_0x53c3,0x18c));var _0x353c=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x53c3[_0x1035c1];return _0x308d67;};'use strict';var multer=require(_0x353c('0x0'));var util=require(_0x353c('0x1'));var path=require(_0x353c('0x2'));var timeout=require(_0x353c('0x3'));var express=require(_0x353c('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x353c('0x5'));var interaction=require(_0x353c('0x6'));var config=require(_0x353c('0x7'));var controller=require(_0x353c('0x8'));router[_0x353c('0x9')](_0x353c('0xa'),auth['isAuthenticated'](),controller[_0x353c('0xb')]);router['put'](_0x353c('0xa'),auth[_0x353c('0xc')](),controller[_0x353c('0xd')]);router['delete'](_0x353c('0xa'),auth[_0x353c('0xc')](),controller['destroy']);module[_0x353c('0xe')]=router;
\ No newline at end of file
+var _0xa91f=['fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','delete','destroy','util','path','express','Router'];(function(_0x47e059,_0x2f0237){var _0x368caf=function(_0x16bc68){while(--_0x16bc68){_0x47e059['push'](_0x47e059['shift']());}};_0x368caf(++_0x2f0237);}(_0xa91f,0xbc));var _0xfa91=function(_0x502ebd,_0x470f8d){_0x502ebd=_0x502ebd-0x0;var _0x167b0a=_0xa91f[_0x502ebd];return _0x167b0a;};'use strict';var multer=require('multer');var util=require(_0xfa91('0x0'));var path=require(_0xfa91('0x1'));var timeout=require('connect-timeout');var express=require(_0xfa91('0x2'));var router=express[_0xfa91('0x3')]();var fs_extra=require(_0xfa91('0x4'));var auth=require(_0xfa91('0x5'));var interaction=require(_0xfa91('0x6'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0xfa91('0x7')](_0xfa91('0x8'),auth['isAuthenticated'](),controller['show']);router['put'](_0xfa91('0x8'),auth[_0xfa91('0x9')](),controller['update']);router[_0xfa91('0xa')](_0xfa91('0x8'),auth[_0xfa91('0x9')](),controller[_0xfa91('0xb')]);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 f46cd1c..2dcd6a4 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 _0xe170=['exports','sequelize'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xe170,0x1b3));var _0x0e17=function(_0x20d06a,_0x16b092){_0x20d06a=_0x20d06a-0x0;var _0x1c48ef=_0xe170[_0x20d06a];return _0x1c48ef;};'use strict';var Sequelize=require(_0x0e17('0x0'));module[_0x0e17('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x626d=['BOOLEAN','sequelize','STRING'];(function(_0x1532d2,_0x274183){var _0x2575bf=function(_0xc07284){while(--_0xc07284){_0x1532d2['push'](_0x1532d2['shift']());}};_0x2575bf(++_0x274183);}(_0x626d,0xa0));var _0xd626=function(_0x5607ea,_0x1ff0e1){_0x5607ea=_0x5607ea-0x0;var _0x2ac925=_0x626d[_0x5607ea];return _0x2ac925;};'use strict';var Sequelize=require(_0xd626('0x0'));module['exports']={'name':{'type':Sequelize[_0xd626('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd626('0x1')]},'write':{'type':Sequelize[_0xd626('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 ffe98b8..7ec38f2 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 _0x0694=['intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','getMembers','User','order','pick','removeMembers','ids','addMessage','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','status','undefined','limit','count','offset','set','apply','reject','save','then','destroy','end','sendStatus','stack','name','send','index','ChatGroup','fieldName','type','key','model','map','keys','query','filters'];(function(_0x1b1e94,_0x2b4af3){var _0x2de73c=function(_0x1d5ef4){while(--_0x1d5ef4){_0x1b1e94['push'](_0x1b1e94['shift']());}};_0x2de73c(++_0x2b4af3);}(_0x0694,0xee));var _0x4069=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x0694[_0x138f59];return _0x3d114d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4069('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4069('0x1'));var rp=require('request-promise');var moment=require(_0x4069('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4069('0x3'));var util=require('util');var path=require(_0x4069('0x4'));var sox=require(_0x4069('0x5'));var csv=require(_0x4069('0x6'));var ejs=require(_0x4069('0x7'));var fs=require('fs');var fs_extra=require(_0x4069('0x8'));var _=require('lodash');var squel=require(_0x4069('0x9'));var crypto=require(_0x4069('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4069('0x6'));var querystring=require(_0x4069('0xb'));var Papa=require('papaparse');var Redis=require(_0x4069('0xc'));var authService=require(_0x4069('0xd'));var qs=require(_0x4069('0xe'));var as=require(_0x4069('0xf'));var hardwareService=require(_0x4069('0x10'));var logger=require(_0x4069('0x11'))(_0x4069('0x12'));var utils=require(_0x4069('0x13'));var config=require(_0x4069('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x4069('0x15'))['db'];config[_0x4069('0x16')]=_[_0x4069('0x17')](config[_0x4069('0x16')],{'host':_0x4069('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4069('0x16')]));require(_0x4069('0x19'))[_0x4069('0x1a')](socket);function respondWithStatusCode(_0x54bf9f,_0x54c9d9){_0x54c9d9=_0x54c9d9||0xcc;return function(_0x446cca){if(_0x446cca){return _0x54bf9f['sendStatus'](_0x54c9d9);}return _0x54bf9f[_0x4069('0x1b')](_0x54c9d9)['end']();};}function respondWithResult(_0x5d8b41,_0x1d197d){_0x1d197d=_0x1d197d||0xc8;return function(_0x4c5296){if(_0x4c5296){return _0x5d8b41[_0x4069('0x1b')](_0x1d197d)['json'](_0x4c5296);}};}function respondWithFilteredResult(_0x5e8384,_0x5a6824){return function(_0x429500){if(_0x429500){var _0x27ea80=typeof _0x5a6824['offset']===_0x4069('0x1c')&&typeof _0x5a6824[_0x4069('0x1d')]===_0x4069('0x1c');var _0x17a64e=_0x429500[_0x4069('0x1e')];var _0x3efa4d=_0x27ea80?0x0:_0x5a6824[_0x4069('0x1f')];var _0xfb4e70=_0x27ea80?_0x429500[_0x4069('0x1e')]:_0x5a6824['offset']+_0x5a6824['limit'];var _0x3495b8;if(_0xfb4e70>=_0x17a64e){_0xfb4e70=_0x17a64e;_0x3495b8=0xc8;}else{_0x3495b8=0xce;}_0x5e8384['status'](_0x3495b8);return _0x5e8384[_0x4069('0x20')]('Content-Range',_0x3efa4d+'-'+_0xfb4e70+'/'+_0x17a64e)['json'](_0x429500);}return null;};}function patchUpdates(_0x460461){return function(_0x21dc18){try{jsonpatch[_0x4069('0x21')](_0x21dc18,_0x460461,!![]);}catch(_0x55cb37){return BPromise[_0x4069('0x22')](_0x55cb37);}return _0x21dc18[_0x4069('0x23')]();};}function saveUpdates(_0x1b9e2a,_0x3d429c){return function(_0x2fabc7){if(_0x2fabc7){return _0x2fabc7['update'](_0x1b9e2a)[_0x4069('0x24')](function(_0x32ee3c){return _0x32ee3c;});}return null;};}function removeEntity(_0x2ad9db,_0x45df6e){return function(_0x106062){if(_0x106062){return _0x106062[_0x4069('0x25')]()[_0x4069('0x24')](function(){_0x2ad9db['status'](0xcc)[_0x4069('0x26')]();});}};}function handleEntityNotFound(_0x5bee8a,_0x39d390){return function(_0x3b67ea){if(!_0x3b67ea){_0x5bee8a[_0x4069('0x27')](0x194);}return _0x3b67ea;};}function handleError(_0x3a4eed,_0x5a1d5f){_0x5a1d5f=_0x5a1d5f||0x1f4;return function(_0x128f8e){logger['error'](_0x128f8e[_0x4069('0x28')]);if(_0x128f8e[_0x4069('0x29')]){delete _0x128f8e['name'];}_0x3a4eed[_0x4069('0x1b')](_0x5a1d5f)[_0x4069('0x2a')](_0x128f8e);};}exports[_0x4069('0x2b')]=function(_0x2baef2,_0x4b66f3){var _0x8f6c38={},_0x36302c={},_0x276db6={'count':0x0,'rows':[]};var _0x915605=_['map'](db[_0x4069('0x2c')]['rawAttributes'],function(_0x4d465d){return{'name':_0x4d465d[_0x4069('0x2d')],'type':_0x4d465d[_0x4069('0x2e')][_0x4069('0x2f')]};});_0x36302c[_0x4069('0x30')]=_[_0x4069('0x31')](_0x915605,_0x4069('0x29'));_0x36302c['query']=_[_0x4069('0x32')](_0x2baef2[_0x4069('0x33')]);_0x36302c[_0x4069('0x34')]=_[_0x4069('0x35')](_0x36302c[_0x4069('0x30')],_0x36302c[_0x4069('0x33')]);_0x8f6c38[_0x4069('0x36')]=_[_0x4069('0x35')](_0x36302c[_0x4069('0x30')],qs[_0x4069('0x37')](_0x2baef2[_0x4069('0x33')][_0x4069('0x37')]));_0x8f6c38[_0x4069('0x36')]=_0x8f6c38['attributes'][_0x4069('0x38')]?_0x8f6c38['attributes']:_0x36302c[_0x4069('0x30')];if(!_0x2baef2[_0x4069('0x33')][_0x4069('0x39')](_0x4069('0x3a'))){_0x8f6c38['limit']=qs[_0x4069('0x1d')](_0x2baef2['query'][_0x4069('0x1d')]);_0x8f6c38[_0x4069('0x1f')]=qs[_0x4069('0x1f')](_0x2baef2[_0x4069('0x33')]['offset']);}_0x8f6c38['order']=qs[_0x4069('0x3b')](_0x2baef2[_0x4069('0x33')]['sort']);_0x8f6c38[_0x4069('0x3c')]=qs['filters'](_['pick'](_0x2baef2[_0x4069('0x33')],_0x36302c['filters']),_0x915605);if(_0x2baef2[_0x4069('0x33')]['filter']){_0x8f6c38['where']=_[_0x4069('0x3d')](_0x8f6c38[_0x4069('0x3c')],{'$or':_[_0x4069('0x31')](_0x915605,function(_0x4b74f7){if(_0x4b74f7[_0x4069('0x2e')]!==_0x4069('0x3e')){var _0x173623={};_0x173623[_0x4b74f7[_0x4069('0x29')]]={'$like':'%'+_0x2baef2[_0x4069('0x33')][_0x4069('0x3f')]+'%'};return _0x173623;}})});}_0x8f6c38=_['merge']({},_0x8f6c38,_0x2baef2[_0x4069('0x40')]);var _0x5883d8={'where':_0x8f6c38['where']};return db[_0x4069('0x2c')][_0x4069('0x1e')](_0x5883d8)[_0x4069('0x24')](function(_0x1db309){_0x276db6[_0x4069('0x1e')]=_0x1db309;if(_0x2baef2['query'][_0x4069('0x41')]){_0x8f6c38[_0x4069('0x42')]=[{'all':!![]}];}return db[_0x4069('0x2c')][_0x4069('0x43')](_0x8f6c38);})[_0x4069('0x24')](function(_0x36d6db){_0x276db6[_0x4069('0x44')]=_0x36d6db;return _0x276db6;})[_0x4069('0x24')](respondWithFilteredResult(_0x4b66f3,_0x8f6c38))[_0x4069('0x45')](handleError(_0x4b66f3,null));};exports[_0x4069('0x46')]=function(_0x9fc5de,_0x2db11a){var _0x42f89d={'raw':!![],'where':{'id':_0x9fc5de[_0x4069('0x47')]['id']}},_0x89b9e5={};_0x89b9e5[_0x4069('0x30')]=_[_0x4069('0x32')](db['ChatGroup'][_0x4069('0x48')]);_0x89b9e5[_0x4069('0x33')]=_['keys'](_0x9fc5de[_0x4069('0x33')]);_0x89b9e5['filters']=_[_0x4069('0x35')](_0x89b9e5['model'],_0x89b9e5['query']);_0x42f89d['attributes']=_['intersection'](_0x89b9e5[_0x4069('0x30')],qs[_0x4069('0x37')](_0x9fc5de[_0x4069('0x33')][_0x4069('0x37')]));_0x42f89d[_0x4069('0x36')]=_0x42f89d[_0x4069('0x36')][_0x4069('0x38')]?_0x42f89d['attributes']:_0x89b9e5[_0x4069('0x30')];if(_0x9fc5de[_0x4069('0x33')][_0x4069('0x41')]){_0x42f89d[_0x4069('0x42')]=[{'all':!![]}];}_0x42f89d=_[_0x4069('0x3d')]({},_0x42f89d,_0x9fc5de['options']);return db[_0x4069('0x2c')][_0x4069('0x49')](_0x42f89d)[_0x4069('0x24')](handleEntityNotFound(_0x2db11a,null))[_0x4069('0x24')](respondWithResult(_0x2db11a,null))['catch'](handleError(_0x2db11a,null));};exports['create']=function(_0x5d8e83,_0x3d76d0){return db[_0x4069('0x2c')][_0x4069('0x4a')](_0x5d8e83[_0x4069('0x4b')],{})['then'](respondWithResult(_0x3d76d0,0xc9))['catch'](handleError(_0x3d76d0,null));};exports[_0x4069('0x4c')]=function(_0x56d011,_0x13e513){if(_0x56d011['body']['id']){delete _0x56d011[_0x4069('0x4b')]['id'];}return db[_0x4069('0x2c')][_0x4069('0x49')]({'where':{'id':_0x56d011[_0x4069('0x47')]['id']}})['then'](handleEntityNotFound(_0x13e513,null))[_0x4069('0x24')](saveUpdates(_0x56d011[_0x4069('0x4b')],null))['then'](respondWithResult(_0x13e513,null))[_0x4069('0x45')](handleError(_0x13e513,null));};exports['destroy']=function(_0x545616,_0x132a5e){return db[_0x4069('0x2c')][_0x4069('0x49')]({'where':{'id':_0x545616[_0x4069('0x47')]['id']}})[_0x4069('0x24')](handleEntityNotFound(_0x132a5e,null))['then'](removeEntity(_0x132a5e,null))['catch'](handleError(_0x132a5e,null));};exports[_0x4069('0x4d')]=function(_0x1b2d3e,_0x3ec55f){return db[_0x4069('0x2c')][_0x4069('0x4d')]()[_0x4069('0x24')](respondWithResult(_0x3ec55f,null))['catch'](handleError(_0x3ec55f,null));};exports[_0x4069('0x4e')]=function(_0x56755a,_0x809cd3,_0x1a83ab){return db[_0x4069('0x4f')]['count']({'where':{'ChatGroupId':_0x56755a[_0x4069('0x47')]['id'],'ToId':_0x56755a[_0x4069('0x50')]['id'],'read':![]}})[_0x4069('0x24')](function(_0x12c4bb){return{'id':_[_0x4069('0x51')](_0x56755a[_0x4069('0x47')]['id']),'count':_0x12c4bb};})['then'](respondWithResult(_0x809cd3,null))[_0x4069('0x45')](handleError(_0x809cd3,null));};exports[_0x4069('0x52')]=function(_0x18bd57,_0x1f0de9,_0x37534e){return db[_0x4069('0x2c')][_0x4069('0x49')]({'where':{'id':_0x18bd57[_0x4069('0x47')]['id']}})[_0x4069('0x24')](handleEntityNotFound(_0x1f0de9,null))['then'](function(_0x5e4947){if(_0x5e4947){return _0x5e4947[_0x4069('0x52')](_0x18bd57['body']['ids'],_[_0x4069('0x53')](_0x18bd57[_0x4069('0x4b')],['ids','id'])||{});}})[_0x4069('0x24')](respondWithResult(_0x1f0de9,null))[_0x4069('0x45')](handleError(_0x1f0de9,null));};exports[_0x4069('0x54')]=function(_0x3016ec,_0x3144bc,_0x565e4e){var _0x560428={};var _0x5ef577={};var _0x527f35;var _0x3c0ab1;return db[_0x4069('0x2c')]['findOne']({'where':{'id':_0x3016ec[_0x4069('0x47')]['id']}})['then'](handleEntityNotFound(_0x3144bc,null))[_0x4069('0x24')](function(_0x3742e3){if(_0x3742e3){_0x527f35=_0x3742e3;_0x5ef577['model']=_['keys'](db[_0x4069('0x55')][_0x4069('0x48')]);_0x5ef577[_0x4069('0x33')]=_[_0x4069('0x32')](_0x3016ec['query']);_0x5ef577[_0x4069('0x34')]=_['intersection'](_0x5ef577[_0x4069('0x30')],_0x5ef577['query']);_0x560428[_0x4069('0x36')]=_['intersection'](_0x5ef577[_0x4069('0x30')],qs[_0x4069('0x37')](_0x3016ec[_0x4069('0x33')][_0x4069('0x37')]));_0x560428['attributes']=_0x560428['attributes'][_0x4069('0x38')]?_0x560428['attributes']:_0x5ef577[_0x4069('0x30')];_0x560428[_0x4069('0x56')]=qs['sort'](_0x3016ec['query'][_0x4069('0x3b')]);_0x560428['where']=qs[_0x4069('0x34')](_[_0x4069('0x57')](_0x3016ec['query'],_0x5ef577['filters']));if(_0x3016ec[_0x4069('0x33')][_0x4069('0x3f')]){_0x560428['where']=_['merge'](_0x560428[_0x4069('0x3c')],{'$or':_[_0x4069('0x31')](_0x560428['attributes'],function(_0x4ff6f6){var _0xf4007a={};_0xf4007a[_0x4ff6f6]={'$like':'%'+_0x3016ec[_0x4069('0x33')][_0x4069('0x3f')]+'%'};return _0xf4007a;})});}_0x560428=_['merge']({},_0x560428,_0x3016ec[_0x4069('0x40')]);return _0x527f35[_0x4069('0x54')](_0x560428);}})[_0x4069('0x24')](function(_0x30623b){if(_0x30623b){_0x3c0ab1=_0x30623b[_0x4069('0x38')];if(!_0x3016ec[_0x4069('0x33')][_0x4069('0x39')](_0x4069('0x3a'))){_0x560428[_0x4069('0x1d')]=qs[_0x4069('0x1d')](_0x3016ec[_0x4069('0x33')][_0x4069('0x1d')]);_0x560428[_0x4069('0x1f')]=qs[_0x4069('0x1f')](_0x3016ec[_0x4069('0x33')][_0x4069('0x1f')]);}return _0x527f35[_0x4069('0x54')](_0x560428);}})[_0x4069('0x24')](function(_0x39f7d7){if(_0x39f7d7){return _0x39f7d7?{'count':_0x3c0ab1,'rows':_0x39f7d7}:null;}})[_0x4069('0x24')](respondWithResult(_0x3144bc,null))[_0x4069('0x45')](handleError(_0x3144bc,null));};exports['removeMembers']=function(_0x4a74ba,_0x5d2e3e,_0x2cd726){return db[_0x4069('0x2c')][_0x4069('0x49')]({'where':{'id':_0x4a74ba[_0x4069('0x47')]['id']}})['then'](handleEntityNotFound(_0x5d2e3e,null))[_0x4069('0x24')](function(_0x856e88){if(_0x856e88){return _0x856e88[_0x4069('0x58')](_0x4a74ba[_0x4069('0x33')][_0x4069('0x59')]);}})[_0x4069('0x24')](respondWithStatusCode(_0x5d2e3e,null))[_0x4069('0x45')](handleError(_0x5d2e3e,null));};exports[_0x4069('0x5a')]=function(_0x124c8a,_0xbc51cd,_0x3346d2){if(_0x124c8a[_0x4069('0x4b')]['id']){delete _0x124c8a['body']['id'];}return db['ChatGroup'][_0x4069('0x49')]({'where':{'id':_0x124c8a['params']['id']}})[_0x4069('0x24')](handleEntityNotFound(_0xbc51cd,null))[_0x4069('0x24')](function(_0x4b1eab){if(_0x4b1eab){_0x124c8a[_0x4069('0x4b')]['ChatGroupId']=_0x4b1eab['id'];return db[_0x4069('0x4f')]['create'](_0x124c8a['body']);}})[_0x4069('0x24')](respondWithResult(_0xbc51cd,null))[_0x4069('0x45')](handleError(_0xbc51cd,null));};exports[_0x4069('0x5b')]=function(_0x5536cf,_0x1b4080,_0x248a96){var _0xcfbce7={};var _0x18a81c={};var _0xbadf7a;var _0xdd50bc;return db[_0x4069('0x2c')][_0x4069('0x5c')]({'where':{'id':_0x5536cf[_0x4069('0x47')]['id']}})[_0x4069('0x24')](handleEntityNotFound(_0x1b4080,null))['then'](function(_0x3b3691){if(_0x3b3691){_0xbadf7a=_0x3b3691;_0x18a81c[_0x4069('0x30')]=_[_0x4069('0x32')](db['ChatInternalMessage'][_0x4069('0x48')]);_0x18a81c[_0x4069('0x33')]=_[_0x4069('0x32')](_0x5536cf[_0x4069('0x33')]);_0x18a81c['filters']=_[_0x4069('0x35')](_0x18a81c['model'],_0x18a81c['query']);_0xcfbce7[_0x4069('0x36')]=_['intersection'](_0x18a81c[_0x4069('0x30')],qs[_0x4069('0x37')](_0x5536cf[_0x4069('0x33')][_0x4069('0x37')]));_0xcfbce7[_0x4069('0x36')]=_0xcfbce7[_0x4069('0x36')][_0x4069('0x38')]?_0xcfbce7[_0x4069('0x36')]:_0x18a81c[_0x4069('0x30')];_0xcfbce7[_0x4069('0x56')]=qs['sort'](_0x5536cf['query'][_0x4069('0x3b')]);_0xcfbce7[_0x4069('0x3c')]=qs['filters'](_[_0x4069('0x57')](_0x5536cf[_0x4069('0x33')],_0x18a81c[_0x4069('0x34')]));if(_0x5536cf['query'][_0x4069('0x3f')]){_0xcfbce7[_0x4069('0x3c')]=_[_0x4069('0x3d')](_0xcfbce7[_0x4069('0x3c')],{'$or':_[_0x4069('0x31')](_0xcfbce7[_0x4069('0x36')],function(_0x2909c2){var _0x3c44a8={};_0x3c44a8[_0x2909c2]={'$like':'%'+_0x5536cf[_0x4069('0x33')]['filter']+'%'};return _0x3c44a8;})});}if(_0x5536cf[_0x4069('0x33')][_0x4069('0x5d')]){var _0x5fee22=_0x5536cf[_0x4069('0x33')][_0x4069('0x5d')][_0x4069('0x5e')](',');var _0x1fe612={};_0x1fe612[_0x5fee22[0x0]]={'$gte':moment(_0x5fee22[0x1])[_0x4069('0x5f')](_0x4069('0x60'))};_0xcfbce7[_0x4069('0x3c')]=_[_0x4069('0x3d')](_0xcfbce7[_0x4069('0x3c')],_0x1fe612);}_0xcfbce7=_[_0x4069('0x3d')]({},_0xcfbce7,_0x5536cf[_0x4069('0x40')]);return _0xbadf7a[_0x4069('0x5b')](_0xcfbce7);}})[_0x4069('0x24')](function(_0xfe06d0){if(_0xfe06d0){_0xdd50bc=_0xfe06d0['length'];if(!_0x5536cf[_0x4069('0x33')]['hasOwnProperty']('nolimit')){_0xcfbce7[_0x4069('0x1d')]=qs[_0x4069('0x1d')](_0x5536cf[_0x4069('0x33')]['limit']);_0xcfbce7[_0x4069('0x1f')]=qs[_0x4069('0x1f')](_0x5536cf['query'][_0x4069('0x1f')]);}return _0xbadf7a[_0x4069('0x5b')](_0xcfbce7);}})[_0x4069('0x24')](function(_0x190fed){if(_0x190fed){return _0x190fed?{'count':_0xdd50bc,'rows':_0x190fed}:null;}})[_0x4069('0x24')](respondWithResult(_0x1b4080,null))[_0x4069('0x45')](handleError(_0x1b4080,null));};
\ No newline at end of file
+var _0x3c3b=['hasOwnProperty','removeMembers','ChatGroupId','ChatInternalMessage','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','nolimit','sort','where','filters','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','keys','find','create','body','params','describe','getUnread','user','toInteger','addMembers','ids','omit','getMembers','order','pick','options'];(function(_0x3c856b,_0x18a43f){var _0x3b5e99=function(_0x48b5f4){while(--_0x48b5f4){_0x3c856b['push'](_0x3c856b['shift']());}};_0x3b5e99(++_0x18a43f);}(_0x3c3b,0x12a));var _0xb3c3=function(_0x46cb3b,_0x5728f0){_0x46cb3b=_0x46cb3b-0x0;var _0x377d8e=_0x3c3b[_0x46cb3b];return _0x377d8e;};'use strict';var emlformat=require(_0xb3c3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb3c3('0x1'));var jsonpatch=require(_0xb3c3('0x2'));var rp=require(_0xb3c3('0x3'));var moment=require(_0xb3c3('0x4'));var BPromise=require(_0xb3c3('0x5'));var Mustache=require(_0xb3c3('0x6'));var util=require(_0xb3c3('0x7'));var path=require(_0xb3c3('0x8'));var sox=require(_0xb3c3('0x9'));var csv=require(_0xb3c3('0xa'));var ejs=require(_0xb3c3('0xb'));var fs=require('fs');var fs_extra=require(_0xb3c3('0xc'));var _=require(_0xb3c3('0xd'));var squel=require(_0xb3c3('0xe'));var crypto=require(_0xb3c3('0xf'));var jsforce=require(_0xb3c3('0x10'));var deskjs=require(_0xb3c3('0x11'));var toCsv=require(_0xb3c3('0xa'));var querystring=require(_0xb3c3('0x12'));var Papa=require(_0xb3c3('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb3c3('0x14'));var as=require(_0xb3c3('0x15'));var hardwareService=require(_0xb3c3('0x16'));var logger=require(_0xb3c3('0x17'))(_0xb3c3('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xb3c3('0x19')]=_[_0xb3c3('0x1a')](config[_0xb3c3('0x19')],{'host':_0xb3c3('0x1b'),'port':0x18eb});var socket=require(_0xb3c3('0x1c'))(new Redis(config[_0xb3c3('0x19')]));require(_0xb3c3('0x1d'))[_0xb3c3('0x1e')](socket);function respondWithStatusCode(_0x5e0552,_0x12bac4){_0x12bac4=_0x12bac4||0xcc;return function(_0x1471ca){if(_0x1471ca){return _0x5e0552[_0xb3c3('0x1f')](_0x12bac4);}return _0x5e0552[_0xb3c3('0x20')](_0x12bac4)[_0xb3c3('0x21')]();};}function respondWithResult(_0x2ab9fd,_0x1acca1){_0x1acca1=_0x1acca1||0xc8;return function(_0x5bc9df){if(_0x5bc9df){return _0x2ab9fd[_0xb3c3('0x20')](_0x1acca1)[_0xb3c3('0x22')](_0x5bc9df);}};}function respondWithFilteredResult(_0x4e03a5,_0x5acc3d){return function(_0x135cab){if(_0x135cab){var _0x303553=typeof _0x5acc3d['offset']==='undefined'&&typeof _0x5acc3d[_0xb3c3('0x23')]==='undefined';var _0x3760bf=_0x135cab[_0xb3c3('0x24')];var _0x53b6f9=_0x303553?0x0:_0x5acc3d[_0xb3c3('0x25')];var _0x253e54=_0x303553?_0x135cab[_0xb3c3('0x24')]:_0x5acc3d['offset']+_0x5acc3d[_0xb3c3('0x23')];var _0x141013;if(_0x253e54>=_0x3760bf){_0x253e54=_0x3760bf;_0x141013=0xc8;}else{_0x141013=0xce;}_0x4e03a5[_0xb3c3('0x20')](_0x141013);return _0x4e03a5[_0xb3c3('0x26')](_0xb3c3('0x27'),_0x53b6f9+'-'+_0x253e54+'/'+_0x3760bf)['json'](_0x135cab);}return null;};}function patchUpdates(_0x1cb3d5){return function(_0x2e914e){try{jsonpatch[_0xb3c3('0x28')](_0x2e914e,_0x1cb3d5,!![]);}catch(_0x4fddd8){return BPromise[_0xb3c3('0x29')](_0x4fddd8);}return _0x2e914e[_0xb3c3('0x2a')]();};}function saveUpdates(_0x6dafed,_0x2b9b86){return function(_0x5710dd){if(_0x5710dd){return _0x5710dd[_0xb3c3('0x2b')](_0x6dafed)[_0xb3c3('0x2c')](function(_0x29e016){return _0x29e016;});}return null;};}function removeEntity(_0x50458e,_0x2edc84){return function(_0x51b450){if(_0x51b450){return _0x51b450[_0xb3c3('0x2d')]()[_0xb3c3('0x2c')](function(){_0x50458e[_0xb3c3('0x20')](0xcc)[_0xb3c3('0x21')]();});}};}function handleEntityNotFound(_0xb8be09,_0x2677da){return function(_0x5a88e3){if(!_0x5a88e3){_0xb8be09[_0xb3c3('0x1f')](0x194);}return _0x5a88e3;};}function handleError(_0x24a9c6,_0x3fad1e){_0x3fad1e=_0x3fad1e||0x1f4;return function(_0x11a01b){logger['error'](_0x11a01b[_0xb3c3('0x2e')]);if(_0x11a01b[_0xb3c3('0x2f')]){delete _0x11a01b[_0xb3c3('0x2f')];}_0x24a9c6[_0xb3c3('0x20')](_0x3fad1e)[_0xb3c3('0x30')](_0x11a01b);};}exports[_0xb3c3('0x31')]=function(_0x5d3bb0,_0x1820d9){var _0x3f32fd={},_0x164197={},_0x3881e3={'count':0x0,'rows':[]};var _0x45a5e5=_[_0xb3c3('0x32')](db[_0xb3c3('0x33')][_0xb3c3('0x34')],function(_0x22af24){return{'name':_0x22af24[_0xb3c3('0x35')],'type':_0x22af24[_0xb3c3('0x36')][_0xb3c3('0x37')]};});_0x164197['model']=_[_0xb3c3('0x32')](_0x45a5e5,_0xb3c3('0x2f'));_0x164197[_0xb3c3('0x38')]=_['keys'](_0x5d3bb0[_0xb3c3('0x38')]);_0x164197['filters']=_[_0xb3c3('0x39')](_0x164197[_0xb3c3('0x3a')],_0x164197[_0xb3c3('0x38')]);_0x3f32fd[_0xb3c3('0x3b')]=_[_0xb3c3('0x39')](_0x164197['model'],qs[_0xb3c3('0x3c')](_0x5d3bb0['query'][_0xb3c3('0x3c')]));_0x3f32fd['attributes']=_0x3f32fd[_0xb3c3('0x3b')][_0xb3c3('0x3d')]?_0x3f32fd[_0xb3c3('0x3b')]:_0x164197[_0xb3c3('0x3a')];if(!_0x5d3bb0[_0xb3c3('0x38')]['hasOwnProperty'](_0xb3c3('0x3e'))){_0x3f32fd[_0xb3c3('0x23')]=qs[_0xb3c3('0x23')](_0x5d3bb0[_0xb3c3('0x38')][_0xb3c3('0x23')]);_0x3f32fd['offset']=qs[_0xb3c3('0x25')](_0x5d3bb0[_0xb3c3('0x38')][_0xb3c3('0x25')]);}_0x3f32fd['order']=qs[_0xb3c3('0x3f')](_0x5d3bb0[_0xb3c3('0x38')]['sort']);_0x3f32fd[_0xb3c3('0x40')]=qs[_0xb3c3('0x41')](_['pick'](_0x5d3bb0[_0xb3c3('0x38')],_0x164197[_0xb3c3('0x41')]),_0x45a5e5);if(_0x5d3bb0[_0xb3c3('0x38')][_0xb3c3('0x42')]){_0x3f32fd[_0xb3c3('0x40')]=_['merge'](_0x3f32fd['where'],{'$or':_['map'](_0x45a5e5,function(_0x39c3d3){if(_0x39c3d3[_0xb3c3('0x36')]!==_0xb3c3('0x43')){var _0x34703f={};_0x34703f[_0x39c3d3[_0xb3c3('0x2f')]]={'$like':'%'+_0x5d3bb0[_0xb3c3('0x38')][_0xb3c3('0x42')]+'%'};return _0x34703f;}})});}_0x3f32fd=_[_0xb3c3('0x44')]({},_0x3f32fd,_0x5d3bb0['options']);var _0x37d18f={'where':_0x3f32fd[_0xb3c3('0x40')]};return db['ChatGroup'][_0xb3c3('0x24')](_0x37d18f)['then'](function(_0x589f55){_0x3881e3['count']=_0x589f55;if(_0x5d3bb0[_0xb3c3('0x38')][_0xb3c3('0x45')]){_0x3f32fd[_0xb3c3('0x46')]=[{'all':!![]}];}return db['ChatGroup'][_0xb3c3('0x47')](_0x3f32fd);})[_0xb3c3('0x2c')](function(_0x455ab2){_0x3881e3[_0xb3c3('0x48')]=_0x455ab2;return _0x3881e3;})['then'](respondWithFilteredResult(_0x1820d9,_0x3f32fd))[_0xb3c3('0x49')](handleError(_0x1820d9,null));};exports['show']=function(_0x5ed594,_0x21f2cb){var _0x28de02={'raw':!![],'where':{'id':_0x5ed594['params']['id']}},_0x93cf67={};_0x93cf67['model']=_[_0xb3c3('0x4a')](db[_0xb3c3('0x33')]['rawAttributes']);_0x93cf67[_0xb3c3('0x38')]=_[_0xb3c3('0x4a')](_0x5ed594[_0xb3c3('0x38')]);_0x93cf67['filters']=_['intersection'](_0x93cf67['model'],_0x93cf67[_0xb3c3('0x38')]);_0x28de02[_0xb3c3('0x3b')]=_[_0xb3c3('0x39')](_0x93cf67['model'],qs[_0xb3c3('0x3c')](_0x5ed594[_0xb3c3('0x38')][_0xb3c3('0x3c')]));_0x28de02[_0xb3c3('0x3b')]=_0x28de02[_0xb3c3('0x3b')]['length']?_0x28de02['attributes']:_0x93cf67['model'];if(_0x5ed594[_0xb3c3('0x38')]['includeAll']){_0x28de02[_0xb3c3('0x46')]=[{'all':!![]}];}_0x28de02=_[_0xb3c3('0x44')]({},_0x28de02,_0x5ed594['options']);return db['ChatGroup'][_0xb3c3('0x4b')](_0x28de02)[_0xb3c3('0x2c')](handleEntityNotFound(_0x21f2cb,null))[_0xb3c3('0x2c')](respondWithResult(_0x21f2cb,null))[_0xb3c3('0x49')](handleError(_0x21f2cb,null));};exports[_0xb3c3('0x4c')]=function(_0xbaad85,_0x36d7ca){return db[_0xb3c3('0x33')][_0xb3c3('0x4c')](_0xbaad85['body'],{})['then'](respondWithResult(_0x36d7ca,0xc9))[_0xb3c3('0x49')](handleError(_0x36d7ca,null));};exports[_0xb3c3('0x2b')]=function(_0xd489c1,_0x5715b5){if(_0xd489c1[_0xb3c3('0x4d')]['id']){delete _0xd489c1[_0xb3c3('0x4d')]['id'];}return db['ChatGroup'][_0xb3c3('0x4b')]({'where':{'id':_0xd489c1[_0xb3c3('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5715b5,null))['then'](saveUpdates(_0xd489c1['body'],null))[_0xb3c3('0x2c')](respondWithResult(_0x5715b5,null))[_0xb3c3('0x49')](handleError(_0x5715b5,null));};exports[_0xb3c3('0x2d')]=function(_0x1144e6,_0x3325c5){return db['ChatGroup'][_0xb3c3('0x4b')]({'where':{'id':_0x1144e6[_0xb3c3('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3325c5,null))[_0xb3c3('0x2c')](removeEntity(_0x3325c5,null))['catch'](handleError(_0x3325c5,null));};exports[_0xb3c3('0x4f')]=function(_0x1a395e,_0x1acbab){return db[_0xb3c3('0x33')][_0xb3c3('0x4f')]()[_0xb3c3('0x2c')](respondWithResult(_0x1acbab,null))['catch'](handleError(_0x1acbab,null));};exports[_0xb3c3('0x50')]=function(_0x42ef77,_0x56729f,_0x3dda19){return db['ChatInternalMessage'][_0xb3c3('0x24')]({'where':{'ChatGroupId':_0x42ef77[_0xb3c3('0x4e')]['id'],'ToId':_0x42ef77[_0xb3c3('0x51')]['id'],'read':![]}})['then'](function(_0x39fa94){return{'id':_[_0xb3c3('0x52')](_0x42ef77[_0xb3c3('0x4e')]['id']),'count':_0x39fa94};})[_0xb3c3('0x2c')](respondWithResult(_0x56729f,null))['catch'](handleError(_0x56729f,null));};exports['addMembers']=function(_0x1f147b,_0x29f977,_0x1df38b){return db[_0xb3c3('0x33')][_0xb3c3('0x4b')]({'where':{'id':_0x1f147b[_0xb3c3('0x4e')]['id']}})['then'](handleEntityNotFound(_0x29f977,null))[_0xb3c3('0x2c')](function(_0x2beb60){if(_0x2beb60){return _0x2beb60[_0xb3c3('0x53')](_0x1f147b[_0xb3c3('0x4d')][_0xb3c3('0x54')],_[_0xb3c3('0x55')](_0x1f147b[_0xb3c3('0x4d')],[_0xb3c3('0x54'),'id'])||{});}})[_0xb3c3('0x2c')](respondWithResult(_0x29f977,null))[_0xb3c3('0x49')](handleError(_0x29f977,null));};exports[_0xb3c3('0x56')]=function(_0x5440d4,_0x401bdb,_0x256a08){var _0x390c53={};var _0xd17261={};var _0x18fe9b;var _0x44395d;return db[_0xb3c3('0x33')]['findOne']({'where':{'id':_0x5440d4['params']['id']}})['then'](handleEntityNotFound(_0x401bdb,null))[_0xb3c3('0x2c')](function(_0x5c21de){if(_0x5c21de){_0x18fe9b=_0x5c21de;_0xd17261[_0xb3c3('0x3a')]=_[_0xb3c3('0x4a')](db['User']['rawAttributes']);_0xd17261[_0xb3c3('0x38')]=_[_0xb3c3('0x4a')](_0x5440d4['query']);_0xd17261[_0xb3c3('0x41')]=_['intersection'](_0xd17261[_0xb3c3('0x3a')],_0xd17261[_0xb3c3('0x38')]);_0x390c53['attributes']=_[_0xb3c3('0x39')](_0xd17261['model'],qs[_0xb3c3('0x3c')](_0x5440d4['query'][_0xb3c3('0x3c')]));_0x390c53['attributes']=_0x390c53[_0xb3c3('0x3b')]['length']?_0x390c53[_0xb3c3('0x3b')]:_0xd17261['model'];_0x390c53[_0xb3c3('0x57')]=qs[_0xb3c3('0x3f')](_0x5440d4[_0xb3c3('0x38')][_0xb3c3('0x3f')]);_0x390c53[_0xb3c3('0x40')]=qs['filters'](_[_0xb3c3('0x58')](_0x5440d4[_0xb3c3('0x38')],_0xd17261['filters']));if(_0x5440d4[_0xb3c3('0x38')][_0xb3c3('0x42')]){_0x390c53[_0xb3c3('0x40')]=_[_0xb3c3('0x44')](_0x390c53['where'],{'$or':_[_0xb3c3('0x32')](_0x390c53[_0xb3c3('0x3b')],function(_0x521ef2){var _0x1b5a2c={};_0x1b5a2c[_0x521ef2]={'$like':'%'+_0x5440d4[_0xb3c3('0x38')][_0xb3c3('0x42')]+'%'};return _0x1b5a2c;})});}_0x390c53=_[_0xb3c3('0x44')]({},_0x390c53,_0x5440d4[_0xb3c3('0x59')]);return _0x18fe9b[_0xb3c3('0x56')](_0x390c53);}})[_0xb3c3('0x2c')](function(_0x2964cc){if(_0x2964cc){_0x44395d=_0x2964cc[_0xb3c3('0x3d')];if(!_0x5440d4['query'][_0xb3c3('0x5a')]('nolimit')){_0x390c53['limit']=qs[_0xb3c3('0x23')](_0x5440d4['query'][_0xb3c3('0x23')]);_0x390c53[_0xb3c3('0x25')]=qs['offset'](_0x5440d4['query'][_0xb3c3('0x25')]);}return _0x18fe9b[_0xb3c3('0x56')](_0x390c53);}})[_0xb3c3('0x2c')](function(_0x23c0c1){if(_0x23c0c1){return _0x23c0c1?{'count':_0x44395d,'rows':_0x23c0c1}:null;}})['then'](respondWithResult(_0x401bdb,null))[_0xb3c3('0x49')](handleError(_0x401bdb,null));};exports['removeMembers']=function(_0x3f3c99,_0x43d54a,_0x3058f0){return db[_0xb3c3('0x33')][_0xb3c3('0x4b')]({'where':{'id':_0x3f3c99[_0xb3c3('0x4e')]['id']}})[_0xb3c3('0x2c')](handleEntityNotFound(_0x43d54a,null))[_0xb3c3('0x2c')](function(_0x49fe28){if(_0x49fe28){return _0x49fe28[_0xb3c3('0x5b')](_0x3f3c99[_0xb3c3('0x38')]['ids']);}})[_0xb3c3('0x2c')](respondWithStatusCode(_0x43d54a,null))[_0xb3c3('0x49')](handleError(_0x43d54a,null));};exports['addMessage']=function(_0x3fecf6,_0x69545c,_0x5db664){if(_0x3fecf6[_0xb3c3('0x4d')]['id']){delete _0x3fecf6[_0xb3c3('0x4d')]['id'];}return db['ChatGroup'][_0xb3c3('0x4b')]({'where':{'id':_0x3fecf6[_0xb3c3('0x4e')]['id']}})['then'](handleEntityNotFound(_0x69545c,null))[_0xb3c3('0x2c')](function(_0x26994c){if(_0x26994c){_0x3fecf6[_0xb3c3('0x4d')][_0xb3c3('0x5c')]=_0x26994c['id'];return db[_0xb3c3('0x5d')][_0xb3c3('0x4c')](_0x3fecf6[_0xb3c3('0x4d')]);}})[_0xb3c3('0x2c')](respondWithResult(_0x69545c,null))[_0xb3c3('0x49')](handleError(_0x69545c,null));};exports[_0xb3c3('0x5e')]=function(_0x3ce1ab,_0x2159fe,_0x38cf0c){var _0x1165be={};var _0xcea62b={};var _0x26aa0d;var _0x191707;return db[_0xb3c3('0x33')]['findOne']({'where':{'id':_0x3ce1ab[_0xb3c3('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2159fe,null))[_0xb3c3('0x2c')](function(_0x4c7566){if(_0x4c7566){_0x26aa0d=_0x4c7566;_0xcea62b[_0xb3c3('0x3a')]=_[_0xb3c3('0x4a')](db[_0xb3c3('0x5d')][_0xb3c3('0x34')]);_0xcea62b[_0xb3c3('0x38')]=_[_0xb3c3('0x4a')](_0x3ce1ab['query']);_0xcea62b[_0xb3c3('0x41')]=_[_0xb3c3('0x39')](_0xcea62b[_0xb3c3('0x3a')],_0xcea62b[_0xb3c3('0x38')]);_0x1165be[_0xb3c3('0x3b')]=_[_0xb3c3('0x39')](_0xcea62b[_0xb3c3('0x3a')],qs[_0xb3c3('0x3c')](_0x3ce1ab[_0xb3c3('0x38')][_0xb3c3('0x3c')]));_0x1165be[_0xb3c3('0x3b')]=_0x1165be[_0xb3c3('0x3b')][_0xb3c3('0x3d')]?_0x1165be['attributes']:_0xcea62b[_0xb3c3('0x3a')];_0x1165be[_0xb3c3('0x57')]=qs[_0xb3c3('0x3f')](_0x3ce1ab[_0xb3c3('0x38')]['sort']);_0x1165be[_0xb3c3('0x40')]=qs['filters'](_['pick'](_0x3ce1ab['query'],_0xcea62b['filters']));if(_0x3ce1ab[_0xb3c3('0x38')][_0xb3c3('0x42')]){_0x1165be[_0xb3c3('0x40')]=_[_0xb3c3('0x44')](_0x1165be[_0xb3c3('0x40')],{'$or':_['map'](_0x1165be[_0xb3c3('0x3b')],function(_0x1b3888){var _0x421f9a={};_0x421f9a[_0x1b3888]={'$like':'%'+_0x3ce1ab[_0xb3c3('0x38')][_0xb3c3('0x42')]+'%'};return _0x421f9a;})});}if(_0x3ce1ab['query'][_0xb3c3('0x5f')]){var _0x1beabd=_0x3ce1ab['query']['$gte']['split'](',');var _0x33f223={};_0x33f223[_0x1beabd[0x0]]={'$gte':moment(_0x1beabd[0x1])['format'](_0xb3c3('0x60'))};_0x1165be['where']=_[_0xb3c3('0x44')](_0x1165be[_0xb3c3('0x40')],_0x33f223);}_0x1165be=_[_0xb3c3('0x44')]({},_0x1165be,_0x3ce1ab[_0xb3c3('0x59')]);return _0x26aa0d[_0xb3c3('0x5e')](_0x1165be);}})[_0xb3c3('0x2c')](function(_0x3bf978){if(_0x3bf978){_0x191707=_0x3bf978[_0xb3c3('0x3d')];if(!_0x3ce1ab[_0xb3c3('0x38')][_0xb3c3('0x5a')](_0xb3c3('0x3e'))){_0x1165be[_0xb3c3('0x23')]=qs['limit'](_0x3ce1ab['query'][_0xb3c3('0x23')]);_0x1165be['offset']=qs[_0xb3c3('0x25')](_0x3ce1ab['query']['offset']);}return _0x26aa0d[_0xb3c3('0x5e')](_0x1165be);}})[_0xb3c3('0x2c')](function(_0x35b141){if(_0x35b141){return _0x35b141?{'count':_0x191707,'rows':_0x35b141}:null;}})[_0xb3c3('0x2c')](respondWithResult(_0x2159fe,null))[_0xb3c3('0x49')](handleError(_0x2159fe,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 01fb05e..b4dc368 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 _0x4667=['../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x84012c,_0x4dbeab){var _0x2ee5cc=function(_0x4599ae){while(--_0x4599ae){_0x84012c['push'](_0x84012c['shift']());}};_0x2ee5cc(++_0x4dbeab);}(_0x4667,0x10f));var _0x7466=function(_0x449746,_0x16fda7){_0x449746=_0x449746-0x0;var _0x5be1de=_0x4667[_0x449746];return _0x5be1de;};'use strict';var EventEmitter=require(_0x7466('0x0'));var ChatGroup=require(_0x7466('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x7466('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7466('0x3')};function emitEvent(_0x20c421){return function(_0x2206b3,_0x5e4ad4,_0x4155aa){ChatGroupEvents[_0x7466('0x4')](_0x20c421+':'+_0x2206b3['id'],_0x2206b3);ChatGroupEvents[_0x7466('0x4')](_0x20c421,_0x2206b3);_0x4155aa(null);};}for(var e in events){if(events[_0x7466('0x5')](e)){var event=events[e];ChatGroup[_0x7466('0x6')](e,emitEvent(event));}}module[_0x7466('0x7')]=ChatGroupEvents;
\ No newline at end of file
+var _0x1103=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatGroup'];(function(_0x17b161,_0x11c665){var _0x2ffcc2=function(_0x179ebf){while(--_0x179ebf){_0x17b161['push'](_0x17b161['shift']());}};_0x2ffcc2(++_0x11c665);}(_0x1103,0x97));var _0x3110=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1103[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x3110('0x0'))['db'][_0x3110('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x3110('0x2')](0x0);var events={'afterCreate':_0x3110('0x3'),'afterUpdate':_0x3110('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1d3d87){return function(_0x74e52,_0x59dc44,_0x5eb55c){ChatGroupEvents[_0x3110('0x5')](_0x1d3d87+':'+_0x74e52['id'],_0x74e52);ChatGroupEvents[_0x3110('0x5')](_0x1d3d87,_0x74e52);_0x5eb55c(null);};}for(var e in events){if(events[_0x3110('0x6')](e)){var event=events[e];ChatGroup[_0x3110('0x7')](e,emitEvent(event));}}module[_0x3110('0x8')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 5a40d01..c72d1f1 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 _0xd278=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','chat_groups','util','../../config/logger'];(function(_0x573d7f,_0x594dfc){var _0xe64264=function(_0x9829f6){while(--_0x9829f6){_0x573d7f['push'](_0x573d7f['shift']());}};_0xe64264(++_0x594dfc);}(_0xd278,0x15c));var _0x8d27=function(_0x21ca99,_0x5be92f){_0x21ca99=_0x21ca99-0x0;var _0xe6360=_0xd278[_0x21ca99];return _0xe6360;};'use strict';var _=require('lodash');var util=require(_0x8d27('0x0'));var logger=require(_0x8d27('0x1'))(_0x8d27('0x2'));var moment=require(_0x8d27('0x3'));var BPromise=require(_0x8d27('0x4'));var rp=require(_0x8d27('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8d27('0x6'));var config=require(_0x8d27('0x7'));var attributes=require(_0x8d27('0x8'));module['exports']=function(_0x3d300f,_0x41670a){return _0x3d300f['define']('ChatGroup',attributes,{'tableName':_0x8d27('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe731=['path','rimraf','../../config/environment','./chatGroup.attributes','exports','ChatGroup','chat_groups','util','bluebird','request-promise'];(function(_0x50450d,_0x314c15){var _0x1c391b=function(_0x3d5c86){while(--_0x3d5c86){_0x50450d['push'](_0x50450d['shift']());}};_0x1c391b(++_0x314c15);}(_0xe731,0x147));var _0x1e73=function(_0x2dd6b7,_0x4ccce3){_0x2dd6b7=_0x2dd6b7-0x0;var _0x9c28c1=_0xe731[_0x2dd6b7];return _0x9c28c1;};'use strict';var _=require('lodash');var util=require(_0x1e73('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1e73('0x1'));var rp=require(_0x1e73('0x2'));var fs=require('fs');var path=require(_0x1e73('0x3'));var rimraf=require(_0x1e73('0x4'));var config=require(_0x1e73('0x5'));var attributes=require(_0x1e73('0x6'));module[_0x1e73('0x7')]=function(_0x3475fa,_0x2621b4){return _0x3475fa['define'](_0x1e73('0x8'),attributes,{'tableName':_0x1e73('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 9afc859..f6ccd9f 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 _0xa92e=['jayson/promise','client','http','redis','defaults','localhost','register','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatGroup,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x489c69,_0x3c196a){var _0x57d2d5=function(_0x1eb15c){while(--_0x1eb15c){_0x489c69['push'](_0x489c69['shift']());}};_0x57d2d5(++_0x3c196a);}(_0xa92e,0x1e5));var _0xea92=function(_0x20dddf,_0x45237a){_0x20dddf=_0x20dddf-0x0;var _0x30219a=_0xa92e[_0x20dddf];return _0x30219a;};'use strict';var _=require(_0xea92('0x0'));var util=require('util');var moment=require(_0xea92('0x1'));var BPromise=require(_0xea92('0x2'));var rs=require(_0xea92('0x3'));var fs=require('fs');var Redis=require(_0xea92('0x4'));var db=require(_0xea92('0x5'))['db'];var utils=require(_0xea92('0x6'));var logger=require(_0xea92('0x7'))(_0xea92('0x8'));var config=require('../../config/environment');var jayson=require(_0xea92('0x9'));var client=jayson[_0xea92('0xa')][_0xea92('0xb')]({'port':0x232a});config[_0xea92('0xc')]=_[_0xea92('0xd')](config[_0xea92('0xc')],{'host':_0xea92('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xea92('0xc')]));require('./chatGroup.socket')[_0xea92('0xf')](socket);function respondWithRpcPromise(_0x5aae95,_0x281a0d,_0x2f1f04){return new BPromise(function(_0x5e48f9,_0x162e5a){return client['request'](_0x5aae95,_0x2f1f04)['then'](function(_0xe01d85){logger[_0xea92('0x10')]('ChatGroup,\x20%s,\x20%s',_0x281a0d,_0xea92('0x11'));logger[_0xea92('0x12')](_0xea92('0x13'),_0x281a0d,_0xea92('0x11'),JSON[_0xea92('0x14')](_0xe01d85));if(_0xe01d85[_0xea92('0x15')]){if(_0xe01d85[_0xea92('0x15')]['code']===0x1f4){logger[_0xea92('0x15')]('ChatGroup,\x20%s,\x20%s',_0x281a0d,_0xe01d85[_0xea92('0x15')][_0xea92('0x16')]);return _0x162e5a(_0xe01d85[_0xea92('0x15')]['message']);}logger[_0xea92('0x15')](_0xea92('0x17'),_0x281a0d,_0xe01d85[_0xea92('0x15')][_0xea92('0x16')]);return _0x5e48f9(_0xe01d85[_0xea92('0x15')][_0xea92('0x16')]);}else{logger['info'](_0xea92('0x17'),_0x281a0d,'request\x20sent');_0x5e48f9(_0xe01d85[_0xea92('0x18')][_0xea92('0x16')]);}})[_0xea92('0x19')](function(_0x207122){logger[_0xea92('0x15')](_0xea92('0x17'),_0x281a0d,_0x207122);_0x162e5a(_0x207122);});});}
\ No newline at end of file
+var _0x0f89=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','request\x20sent','stringify','error','ChatGroup,\x20%s,\x20%s'];(function(_0xcb21b8,_0x57bc5c){var _0xf3cbc4=function(_0x15fd90){while(--_0x15fd90){_0xcb21b8['push'](_0xcb21b8['shift']());}};_0xf3cbc4(++_0x57bc5c);}(_0x0f89,0x111));var _0x90f8=function(_0x304abd,_0x1b7df8){_0x304abd=_0x304abd-0x0;var _0x1b061d=_0x0f89[_0x304abd];return _0x1b061d;};'use strict';var _=require(_0x90f8('0x0'));var util=require(_0x90f8('0x1'));var moment=require(_0x90f8('0x2'));var BPromise=require('bluebird');var rs=require(_0x90f8('0x3'));var fs=require('fs');var Redis=require(_0x90f8('0x4'));var db=require(_0x90f8('0x5'))['db'];var utils=require(_0x90f8('0x6'));var logger=require('../../config/logger')(_0x90f8('0x7'));var config=require(_0x90f8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x90f8('0x9')][_0x90f8('0xa')]({'port':0x232a});config[_0x90f8('0xb')]=_[_0x90f8('0xc')](config[_0x90f8('0xb')],{'host':_0x90f8('0xd'),'port':0x18eb});var socket=require(_0x90f8('0xe'))(new Redis(config[_0x90f8('0xb')]));require(_0x90f8('0xf'))[_0x90f8('0x10')](socket);function respondWithRpcPromise(_0x46b3ad,_0x55ed12,_0x4f8f90){return new BPromise(function(_0x99ae07,_0x2e2134){return client[_0x90f8('0x11')](_0x46b3ad,_0x4f8f90)[_0x90f8('0x12')](function(_0x3cdde3){logger[_0x90f8('0x13')]('ChatGroup,\x20%s,\x20%s',_0x55ed12,_0x90f8('0x14'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x55ed12,_0x90f8('0x14'),JSON[_0x90f8('0x15')](_0x3cdde3));if(_0x3cdde3['error']){if(_0x3cdde3[_0x90f8('0x16')]['code']===0x1f4){logger[_0x90f8('0x16')](_0x90f8('0x17'),_0x55ed12,_0x3cdde3[_0x90f8('0x16')][_0x90f8('0x18')]);return _0x2e2134(_0x3cdde3['error'][_0x90f8('0x18')]);}logger[_0x90f8('0x16')](_0x90f8('0x17'),_0x55ed12,_0x3cdde3[_0x90f8('0x16')]['message']);return _0x99ae07(_0x3cdde3[_0x90f8('0x16')][_0x90f8('0x18')]);}else{logger['info'](_0x90f8('0x17'),_0x55ed12,_0x90f8('0x14'));_0x99ae07(_0x3cdde3[_0x90f8('0x19')][_0x90f8('0x18')]);}})[_0x90f8('0x1a')](function(_0x38a493){logger[_0x90f8('0x16')](_0x90f8('0x17'),_0x55ed12,_0x38a493);_0x2e2134(_0x38a493);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index d0c7765..69c71da 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 _0x224b=['emit','removeListener','register','chatGroup:','update'];(function(_0x8a2e9d,_0xa7a01c){var _0xf64cdd=function(_0x491bd2){while(--_0x491bd2){_0x8a2e9d['push'](_0x8a2e9d['shift']());}};_0xf64cdd(++_0xa7a01c);}(_0x224b,0xa9));var _0xb224=function(_0x7a6c0e,_0x30242a){_0x7a6c0e=_0x7a6c0e-0x0;var _0x26eb5b=_0x224b[_0x7a6c0e];return _0x26eb5b;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save','remove',_0xb224('0x0')];function createListener(_0x4431d7,_0x1b67b2){return function(_0x540496){_0x1b67b2[_0xb224('0x1')](_0x4431d7,_0x540496);};}function removeListener(_0x3a71e5,_0xd3a68b){return function(){ChatGroupEvents[_0xb224('0x2')](_0x3a71e5,_0xd3a68b);};}exports[_0xb224('0x3')]=function(_0x31c7a1){for(var _0x551991=0x0,_0x32e3f7=events['length'];_0x551991<_0x32e3f7;_0x551991++){var _0x2e9444=events[_0x551991];var _0x1729a2=createListener(_0xb224('0x4')+_0x2e9444,_0x31c7a1);ChatGroupEvents['on'](_0x2e9444,_0x1729a2);}};
\ No newline at end of file
+var _0x79fa=['save','removeListener','register','length','chatGroup:','./chatGroup.events'];(function(_0x102f24,_0x3e4e3f){var _0x223adb=function(_0x1b63b2){while(--_0x1b63b2){_0x102f24['push'](_0x102f24['shift']());}};_0x223adb(++_0x3e4e3f);}(_0x79fa,0x185));var _0xa79f=function(_0x108189,_0xeeabab){_0x108189=_0x108189-0x0;var _0x2e723c=_0x79fa[_0x108189];return _0x2e723c;};'use strict';var ChatGroupEvents=require(_0xa79f('0x0'));var events=[_0xa79f('0x1'),'remove','update'];function createListener(_0x1ce735,_0x299c67){return function(_0x5cb89c){_0x299c67['emit'](_0x1ce735,_0x5cb89c);};}function removeListener(_0x3e0071,_0x30fb40){return function(){ChatGroupEvents[_0xa79f('0x2')](_0x3e0071,_0x30fb40);};}exports[_0xa79f('0x3')]=function(_0x5efe58){for(var _0x3e3f4a=0x0,_0x39b9cd=events[_0xa79f('0x4')];_0x3e3f4a<_0x39b9cd;_0x3e3f4a++){var _0x5c2f8c=events[_0x3e3f4a];var _0x3919c3=createListener(_0xa79f('0x5')+_0x5c2f8c,_0x5efe58);ChatGroupEvents['on'](_0x5c2f8c,_0x3919c3);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index d76aaad..9fbfc91 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 _0x35ee=['./chatGroup.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/unread','getUnread','getMembers','/:id/messages','getMessages','post','create','/:id/members','addMembers','put','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x6fa0ae,_0x1d8109){var _0x38884e=function(_0x30f74b){while(--_0x30f74b){_0x6fa0ae['push'](_0x6fa0ae['shift']());}};_0x38884e(++_0x1d8109);}(_0x35ee,0xd9));var _0xe35e=function(_0x43a3df,_0x5506d3){_0x43a3df=_0x43a3df-0x0;var _0x2c6683=_0x35ee[_0x43a3df];return _0x2c6683;};'use strict';var multer=require(_0xe35e('0x0'));var util=require(_0xe35e('0x1'));var path=require(_0xe35e('0x2'));var timeout=require(_0xe35e('0x3'));var express=require('express');var router=express[_0xe35e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe35e('0x5'));var interaction=require(_0xe35e('0x6'));var config=require('../../config/environment');var controller=require(_0xe35e('0x7'));router[_0xe35e('0x8')]('/',auth[_0xe35e('0x9')](),controller[_0xe35e('0xa')]);router[_0xe35e('0x8')](_0xe35e('0xb'),auth[_0xe35e('0x9')](),controller['describe']);router[_0xe35e('0x8')](_0xe35e('0xc'),auth[_0xe35e('0x9')](),controller[_0xe35e('0xd')]);router[_0xe35e('0x8')](_0xe35e('0xe'),auth[_0xe35e('0x9')](),controller[_0xe35e('0xf')]);router[_0xe35e('0x8')]('/:id/members',auth[_0xe35e('0x9')](),controller[_0xe35e('0x10')]);router['get'](_0xe35e('0x11'),auth[_0xe35e('0x9')](),controller[_0xe35e('0x12')]);router[_0xe35e('0x13')]('/',auth[_0xe35e('0x9')](),controller[_0xe35e('0x14')]);router['post'](_0xe35e('0x15'),auth['isAuthenticated'](),controller[_0xe35e('0x16')]);router[_0xe35e('0x13')](_0xe35e('0x11'),auth['isAuthenticated'](),controller['addMessage']);router[_0xe35e('0x17')](_0xe35e('0xc'),auth[_0xe35e('0x9')](),controller['update']);router[_0xe35e('0x18')](_0xe35e('0xc'),auth[_0xe35e('0x9')](),controller[_0xe35e('0x19')]);router[_0xe35e('0x18')]('/:id/members',auth[_0xe35e('0x9')](),controller[_0xe35e('0x1a')]);module[_0xe35e('0x1b')]=router;
\ No newline at end of file
+var _0x866f=['multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','create','addMembers','post','addMessage','put','update','delete','destroy','removeMembers'];(function(_0xa508ed,_0x1a761f){var _0x484a4b=function(_0x4ccf9b){while(--_0x4ccf9b){_0xa508ed['push'](_0xa508ed['shift']());}};_0x484a4b(++_0x1a761f);}(_0x866f,0x1ba));var _0xf866=function(_0x32acc8,_0x86644b){_0x32acc8=_0x32acc8-0x0;var _0x5e09cd=_0x866f[_0x32acc8];return _0x5e09cd;};'use strict';var multer=require(_0xf866('0x0'));var util=require(_0xf866('0x1'));var path=require('path');var timeout=require(_0xf866('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf866('0x3'));var auth=require(_0xf866('0x4'));var interaction=require(_0xf866('0x5'));var config=require(_0xf866('0x6'));var controller=require('./chatGroup.controller');router[_0xf866('0x7')]('/',auth[_0xf866('0x8')](),controller[_0xf866('0x9')]);router[_0xf866('0x7')]('/describe',auth[_0xf866('0x8')](),controller['describe']);router[_0xf866('0x7')](_0xf866('0xa'),auth[_0xf866('0x8')](),controller[_0xf866('0xb')]);router[_0xf866('0x7')](_0xf866('0xc'),auth['isAuthenticated'](),controller[_0xf866('0xd')]);router[_0xf866('0x7')](_0xf866('0xe'),auth[_0xf866('0x8')](),controller['getMembers']);router['get'](_0xf866('0xf'),auth[_0xf866('0x8')](),controller[_0xf866('0x10')]);router['post']('/',auth[_0xf866('0x8')](),controller[_0xf866('0x11')]);router['post'](_0xf866('0xe'),auth[_0xf866('0x8')](),controller[_0xf866('0x12')]);router[_0xf866('0x13')]('/:id/messages',auth[_0xf866('0x8')](),controller[_0xf866('0x14')]);router[_0xf866('0x15')](_0xf866('0xa'),auth[_0xf866('0x8')](),controller[_0xf866('0x16')]);router[_0xf866('0x17')](_0xf866('0xa'),auth[_0xf866('0x8')](),controller[_0xf866('0x18')]);router['delete'](_0xf866('0xe'),auth[_0xf866('0x8')](),controller[_0xf866('0x19')]);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 39e26b1..500b381 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 _0xb62e=['BOOLEAN','INTEGER','star','thumb','TEXT','STRING','long','DATE','ENUM','out','sequelize','exports'];(function(_0xf943c8,_0x24d100){var _0x48a401=function(_0x50431b){while(--_0x50431b){_0xf943c8['push'](_0xf943c8['shift']());}};_0x48a401(++_0x24d100);}(_0xb62e,0x1de));var _0xeb62=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xb62e[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0xeb62('0x0'));module[_0xeb62('0x1')]={'closed':{'type':Sequelize[_0xeb62('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xeb62('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0xeb62('0x4'),_0xeb62('0x5')),'defaultValue':_0xeb62('0x4')},'ratingMessage':{'type':Sequelize[_0xeb62('0x6')]},'pathTranscript':{'type':Sequelize[_0xeb62('0x6')]},'mailTranscript':{'type':Sequelize[_0xeb62('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xeb62('0x7')]},'secondDisposition':{'type':Sequelize[_0xeb62('0x7')]},'thirdDisposition':{'type':Sequelize[_0xeb62('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xeb62('0x7')]},'browserVersion':{'type':Sequelize[_0xeb62('0x7')]},'osName':{'type':Sequelize[_0xeb62('0x7')]},'osVersion':{'type':Sequelize[_0xeb62('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xeb62('0x7')]},'referer':{'type':Sequelize[_0xeb62('0x6')]},'customerIp':{'type':Sequelize[_0xeb62('0x7')]},'formData':{'type':Sequelize[_0xeb62('0x6')](_0xeb62('0x8'))},'read1stAt':{'type':Sequelize[_0xeb62('0x9')]},'lastMsgAt':{'type':Sequelize[_0xeb62('0x9')]},'lastMsgDirection':{'type':Sequelize[_0xeb62('0xa')]('in',_0xeb62('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xeb62('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xeb62('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xeb62('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x8e44=['BOOLEAN','star','thumb','TEXT','STRING','DATE','long','out','sequelize','exports'];(function(_0x565800,_0x3e8e7b){var _0x4e5c4b=function(_0x13ee56){while(--_0x13ee56){_0x565800['push'](_0x565800['shift']());}};_0x4e5c4b(++_0x3e8e7b);}(_0x8e44,0x1ac));var _0x48e4=function(_0x25655f,_0x44fcc0){_0x25655f=_0x25655f-0x0;var _0x40d1af=_0x8e44[_0x25655f];return _0x40d1af;};'use strict';var Sequelize=require(_0x48e4('0x0'));module[_0x48e4('0x1')]={'closed':{'type':Sequelize[_0x48e4('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x48e4('0x3'),_0x48e4('0x4')),'defaultValue':_0x48e4('0x3')},'ratingMessage':{'type':Sequelize[_0x48e4('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x48e4('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x48e4('0x7')]},'disposition':{'type':Sequelize[_0x48e4('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x48e4('0x6')]},'browserName':{'type':Sequelize[_0x48e4('0x6')]},'browserVersion':{'type':Sequelize[_0x48e4('0x6')]},'osName':{'type':Sequelize[_0x48e4('0x6')]},'osVersion':{'type':Sequelize[_0x48e4('0x6')]},'deviceModel':{'type':Sequelize[_0x48e4('0x6')]},'deviceVendor':{'type':Sequelize[_0x48e4('0x6')]},'deviceType':{'type':Sequelize[_0x48e4('0x6')]},'referer':{'type':Sequelize[_0x48e4('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x48e4('0x5')](_0x48e4('0x8'))},'read1stAt':{'type':Sequelize[_0x48e4('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x48e4('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x48e4('0x6')]},'customerPort':{'type':Sequelize[_0x48e4('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x48e4('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index aee47ff..cc8b9cb 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 _0xdd4f=['i.ChatWebsiteId\x20IN\x20?','toString','sequelize','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.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','Contact.mobile','c.fax','Contact.fax','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','includeAll','include','options','create','params','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','follow','isNull','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','basename','mimetype','attachmentDownload','closed','Unauthorized','Attachment','ChatOfflineMessageId','server/files/attachments/','join','offline-chat/','download','close','mailTranscript','root','server/files/chat/upload/','transcript-%s.txt','pathTranscript','Messages','format','%s%d','agentAlias','System','customer','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','Mail\x20Transcript','addMessage','ids','omit','nolimit','sort','ChatInteractionId','$gte','getMyMessages','filter','findAll','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','attachments','transcript-%d-%s.zip','lastName','ChatWebsite','Account','get','mkdirSync','Chat','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerPort','existsSync','createReadStream','pipe','createWriteStream','out','firstName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','err','eml-format','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','destroy','stack','name','send','render','merge','body','interaction','account','Users','map','fullname','Tags','TagIds','split','forEach','push','rawAttributes','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','pick','field','from','tools_tags','select','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','compact','isEmpty','ChatWebsiteId','where','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','order','contactName','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','i.ChatWebsiteId\x20IS\x20NULL'];(function(_0x19d838,_0x1a15f5){var _0x43632d=function(_0x1ffafe){while(--_0x1ffafe){_0x19d838['push'](_0x19d838['shift']());}};_0x43632d(++_0x1a15f5);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x209733,_0xbf3be7){_0x209733=_0x209733-0x0;var _0x8e192=_0xdd4f[_0x209733];return _0x8e192;};'use strict';var emlformat=require(_0xfdd4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfdd4('0x1'));var moment=require(_0xfdd4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfdd4('0x3'));var util=require(_0xfdd4('0x4'));var path=require(_0xfdd4('0x5'));var sox=require('sox');var csv=require(_0xfdd4('0x6'));var ejs=require(_0xfdd4('0x7'));var fs=require('fs');var fs_extra=require(_0xfdd4('0x8'));var _=require(_0xfdd4('0x9'));var squel=require(_0xfdd4('0xa'));var crypto=require('crypto');var jsforce=require(_0xfdd4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfdd4('0x6'));var querystring=require(_0xfdd4('0xc'));var Papa=require(_0xfdd4('0xd'));var Redis=require('ioredis');var authService=require(_0xfdd4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xfdd4('0xf'));var pdf=require(_0xfdd4('0x10'));var hardwareService=require(_0xfdd4('0x11'));var logger=require(_0xfdd4('0x12'))(_0xfdd4('0x13'));var utils=require(_0xfdd4('0x14'));var config=require(_0xfdd4('0x15'));var licenseUtil=require(_0xfdd4('0x16'));var db=require(_0xfdd4('0x17'))['db'];config[_0xfdd4('0x18')]=_[_0xfdd4('0x19')](config['redis'],{'host':_0xfdd4('0x1a'),'port':0x18eb});var socket=require(_0xfdd4('0x1b'))(new Redis(config[_0xfdd4('0x18')]));require('./chatInteraction.socket')[_0xfdd4('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xfdd4('0x1d')][_0xfdd4('0x1e')]({'port':0x232b});var client9004=jayson[_0xfdd4('0x1d')][_0xfdd4('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x37b05f,_0x52cf2c,_0x47ed1d,_0x559c77){return new BPromise(function(_0x3a966d,_0x216c7e){var _0x2eb174=_0x559c77||client;return _0x2eb174[_0xfdd4('0x1f')](_0x37b05f,_0x47ed1d)[_0xfdd4('0x20')](function(_0x33d752){logger[_0xfdd4('0x21')](_0xfdd4('0x22'),_0x52cf2c,_0xfdd4('0x23'));logger['debug'](_0xfdd4('0x24'),_0x52cf2c,_0xfdd4('0x23'),JSON[_0xfdd4('0x25')](_0x33d752));if(_0x33d752[_0xfdd4('0x26')]){if(_0x33d752[_0xfdd4('0x26')][_0xfdd4('0x27')]===0x1f4){logger[_0xfdd4('0x26')](_0xfdd4('0x22'),_0x52cf2c,_0x33d752['error'][_0xfdd4('0x28')]);return _0x216c7e(_0x33d752[_0xfdd4('0x26')][_0xfdd4('0x28')]);}logger[_0xfdd4('0x26')](_0xfdd4('0x22'),_0x52cf2c,_0x33d752[_0xfdd4('0x26')][_0xfdd4('0x28')]);return _0x3a966d(_0x33d752[_0xfdd4('0x26')]['message']);}else{logger[_0xfdd4('0x21')](_0xfdd4('0x22'),_0x52cf2c,_0xfdd4('0x23'));_0x3a966d(_0x33d752['result'][_0xfdd4('0x28')]);}})[_0xfdd4('0x29')](function(_0xf9c346){logger[_0xfdd4('0x26')](_0xfdd4('0x22'),_0x52cf2c,_0xf9c346);_0x216c7e(_0xf9c346);});});}function respondWithStatusCode(_0x4a8790,_0x18bafb){_0x18bafb=_0x18bafb||0xcc;return function(_0x2c88ad){if(_0x2c88ad){return _0x4a8790[_0xfdd4('0x2a')](_0x18bafb);}return _0x4a8790[_0xfdd4('0x2b')](_0x18bafb)[_0xfdd4('0x2c')]();};}function respondWithResult(_0x192471,_0x453a48){_0x453a48=_0x453a48||0xc8;return function(_0x37b7a2){if(_0x37b7a2){return _0x192471['status'](_0x453a48)[_0xfdd4('0x2d')](_0x37b7a2);}};}function respondWithFilteredResult(_0x39981f,_0x385a68){return function(_0xef012e){if(_0xef012e){var _0x2207ae=typeof _0x385a68['offset']===_0xfdd4('0x2e')&&typeof _0x385a68[_0xfdd4('0x2f')]===_0xfdd4('0x2e');var _0x2bb793=_0xef012e[_0xfdd4('0x30')];var _0x4d64ce=_0x2207ae?0x0:_0x385a68[_0xfdd4('0x31')];var _0x315568=_0x2207ae?_0xef012e[_0xfdd4('0x30')]:_0x385a68['offset']+_0x385a68[_0xfdd4('0x2f')];var _0x502776;if(_0x315568>=_0x2bb793){_0x315568=_0x2bb793;_0x502776=0xc8;}else{_0x502776=0xce;}_0x39981f[_0xfdd4('0x2b')](_0x502776);return _0x39981f[_0xfdd4('0x32')]('Content-Range',_0x4d64ce+'-'+_0x315568+'/'+_0x2bb793)['json'](_0xef012e);}return null;};}function patchUpdates(_0x41dae6){return function(_0x289f16){try{jsonpatch['apply'](_0x289f16,_0x41dae6,!![]);}catch(_0x557d7b){return BPromise[_0xfdd4('0x33')](_0x557d7b);}return _0x289f16[_0xfdd4('0x34')]();};}function saveUpdates(_0x39eedb,_0x24b1fa){return function(_0x3247f4){if(_0x3247f4){return _0x3247f4[_0xfdd4('0x35')](_0x39eedb)[_0xfdd4('0x20')](function(_0x4734ed){return _0x4734ed;});}return null;};}function removeEntity(_0x3e6bc5,_0x457ab5){return function(_0x6ffe30){if(_0x6ffe30){return _0x6ffe30[_0xfdd4('0x36')]()[_0xfdd4('0x20')](function(){_0x3e6bc5[_0xfdd4('0x2b')](0xcc)[_0xfdd4('0x2c')]();});}};}function handleEntityNotFound(_0x3f5c5a,_0x261d87){return function(_0x3a0102){if(!_0x3a0102){_0x3f5c5a[_0xfdd4('0x2a')](0x194);}return _0x3a0102;};}function handleError(_0x4037c4,_0xc9549b){_0xc9549b=_0xc9549b||0x1f4;return function(_0x2e4c8c){logger[_0xfdd4('0x26')](_0x2e4c8c[_0xfdd4('0x37')]);if(_0x2e4c8c[_0xfdd4('0x38')]){delete _0x2e4c8c[_0xfdd4('0x38')];}_0x4037c4['status'](_0xc9549b)[_0xfdd4('0x39')](_0x2e4c8c);};}function getMustacheRender(_0x3716da,_0x42dc1a){return Mustache[_0xfdd4('0x3a')](_0x3716da,_[_0xfdd4('0x3b')](_0x42dc1a[_0xfdd4('0x3c')],{'contact':_0x42dc1a['contact'],'message':_0x42dc1a[_0xfdd4('0x28')],'agent':_0x42dc1a['agent'],'interaction':_0x42dc1a[_0xfdd4('0x3d')],'account':_0x42dc1a[_0xfdd4('0x3e')]}))||'';}function getInteractionUsers(_0x6a79eb,_0x13efe8){return new BPromise(function(_0x4cccab,_0x1c6f43){try{if(_0x13efe8[_0x6a79eb['id']]){_0x6a79eb[_0xfdd4('0x3f')]=_[_0xfdd4('0x40')](_0x13efe8[_0x6a79eb['id']],function(_0x2ee857){return{'id':_0x2ee857['id'],'fullname':_0x2ee857[_0xfdd4('0x41')]};});}}catch(_0x7e171){_0x1c6f43(_0x7e171);}_0x4cccab(_0x6a79eb);});}function getInteractionTags(_0x28e5e2,_0x55fcec){return new BPromise(function(_0xe65944,_0x83673d){try{if(_0x28e5e2['TagIds']){_0x28e5e2[_0xfdd4('0x42')]=[];_0x28e5e2[_0xfdd4('0x43')][_0xfdd4('0x44')](',')[_0xfdd4('0x45')](function(_0x5173db){_0x28e5e2[_0xfdd4('0x42')][_0xfdd4('0x46')](_0x55fcec[_0x5173db]);});}delete _0x28e5e2[_0xfdd4('0x43')];}catch(_0x2341e5){_0x83673d(_0x2341e5);}_0xe65944(_0x28e5e2);});}function updateChatInteraction(_0x362c4f,_0x496747,_0x1411e0){return new BPromise(function(_0x23af2a,_0xd3780d){return getInteractionUsers(_0x362c4f,_0x1411e0)[_0xfdd4('0x20')](function(_0x912520){return getInteractionTags(_0x912520,_0x496747);})[_0xfdd4('0x20')](function(_0x3d1051){_0x23af2a(_0x3d1051);})['catch'](function(_0x2dd3fa){_0xd3780d(_0x2dd3fa);});});}exports['index']=function(_0x3a0de9,_0x11f241){var _0x3f7273={},_0x137d41={},_0x5367aa={'count':0x0,'rows':[]};var _0x419578=_[_0xfdd4('0x40')](db['ChatInteraction'][_0xfdd4('0x47')],function(_0xbfaa53){return{'name':_0xbfaa53['fieldName'],'type':_0xbfaa53[_0xfdd4('0x48')]['key']};});_0x137d41['model']=_['map'](_0x419578,_0xfdd4('0x38'));_0x137d41[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x3a0de9['query']);_0x137d41[_0xfdd4('0x4b')]=_[_0xfdd4('0x4c')](_0x137d41['model'],_0x137d41[_0xfdd4('0x49')]);_0x3f7273[_0xfdd4('0x4d')]=_[_0xfdd4('0x4c')](_0x137d41[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x4f')]));_0x3f7273[_0xfdd4('0x4d')]=_0x3f7273[_0xfdd4('0x4d')][_0xfdd4('0x50')]?_0x3f7273[_0xfdd4('0x4d')]:_0x137d41[_0xfdd4('0x4e')];if(!_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x51')]('nolimit')){_0x3f7273['limit']=qs[_0xfdd4('0x2f')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x2f')]);_0x3f7273[_0xfdd4('0x31')]=qs['offset'](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x31')]);}_0x3f7273['order']=qs['sort'](_0x3a0de9['query']['sort']);_0x3f7273['where']=qs[_0xfdd4('0x4b')](_[_0xfdd4('0x52')](_0x3a0de9[_0xfdd4('0x49')],_0x137d41[_0xfdd4('0x4b')]),_0x419578);var _0x35c032=[];var _0x49bc61=squel['select']()[_0xfdd4('0x53')]('id')[_0xfdd4('0x53')](_0xfdd4('0x38'))[_0xfdd4('0x53')]('color')[_0xfdd4('0x54')](_0xfdd4('0x55'));var _0x4addd6=squel[_0xfdd4('0x56')]()[_0xfdd4('0x53')]('u.id')['field'](_0xfdd4('0x57'))[_0xfdd4('0x53')](_0xfdd4('0x58'))[_0xfdd4('0x54')](_0xfdd4('0x59'),'ui')[_0xfdd4('0x5a')](_0xfdd4('0x5b'),'u',_0xfdd4('0x5c'));var _0x5848e1=squel[_0xfdd4('0x56')]()['from']('chat_interactions','i')[_0xfdd4('0x5a')](_0xfdd4('0x5d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0xfdd4('0x5e'))[_0xfdd4('0x5a')]('chat_websites','a',_0xfdd4('0x5f'))[_0xfdd4('0x5a')](_0xfdd4('0x60'),'me',_0xfdd4('0x61'))[_0xfdd4('0x5a')]('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id')['left_join']('tools_tags','t',_0xfdd4('0x62'));var _0x14d07e=squel['expr']();var _0x1eee3d=[];var _0x2abe50=squel['expr']();var _0x45dcc8;if(_0x3a0de9[_0xfdd4('0x49')]['search']){_0x45dcc8=as[_0xfdd4('0x63')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x64')]);var _0x4a5fe6=_0x45dcc8[_0xfdd4('0x65')];for(var _0x3417dd=0x0;_0x3417dd<_0x45dcc8[_0xfdd4('0x66')][_0xfdd4('0x50')];_0x3417dd++){var _0x5c7be=_0x45dcc8['conditions'][_0x3417dd];var _0x2cc3e2='i';var _0x2ee4b6=_[_0xfdd4('0x67')](_0x419578,[_0xfdd4('0x38'),_0x5c7be[_0xfdd4('0x53')]]);if(!_0x2ee4b6){switch(_0x5c7be[_0xfdd4('0x53')]){case _0xfdd4('0x68'):if(_0x5c7be[_0xfdd4('0x69')]==0x1){_0x5848e1[_0xfdd4('0x6a')]('`'+_0x5c7be['field']+_0xfdd4('0x6b'));}else{_0x5848e1[_0xfdd4('0x6a')]('`'+_0x5c7be[_0xfdd4('0x53')]+_0xfdd4('0x6c'));}break;case _0xfdd4('0x6d'):if(_0x5c7be['operator']===_0xfdd4('0x6e')){if(_0x5c7be[_0xfdd4('0x69')][_0xfdd4('0x44')]('\x20')[_0xfdd4('0x50')]>0x1){_0x14d07e[_0x4a5fe6](_0xfdd4('0x6f'),qs[_0xfdd4('0x70')](_0x5c7be[_0xfdd4('0x69')]),null);}else{var _0x276e9='%'+_0x5c7be[_0xfdd4('0x69')]+'%';_0x14d07e[_0x4a5fe6](_0xfdd4('0x71'),_0x276e9,_0x276e9,_0x276e9);}}else{_0x2ee4b6=_[_0xfdd4('0x67')](_0x419578,[_0xfdd4('0x38'),_0xfdd4('0x72')]);_0x5c7be['field']=_0xfdd4('0x72');_0xa55e0f=as['buildExpression'](_0x2cc3e2,_0x2ee4b6[_0xfdd4('0x48')],_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x74')],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);}break;case _0xfdd4('0x75'):var _0xb0bb50=_0x5c7be[_0xfdd4('0x69')][_0xfdd4('0x44')](',')[_0xfdd4('0x40')](function(_0x207a4c){return Number(_0x207a4c);});_0xb0bb50['forEach'](function(_0x4bac59){_0x2abe50['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4bac59+',%');});_0x1eee3d=_[_0xfdd4('0x76')](_0x1eee3d,_0xb0bb50);break;case _0xfdd4('0x77'):if(_0x5c7be['operator']===_0xfdd4('0x6e')){_0x14d07e[_0x4a5fe6](_0xfdd4('0x78'),'%'+_0x5c7be[_0xfdd4('0x69')]+'%',null);}else{_0x2ee4b6=_[_0xfdd4('0x67')](_0x419578,[_0xfdd4('0x38'),'UserId']);_0x5c7be[_0xfdd4('0x53')]=_0xfdd4('0x79');_0xa55e0f=as[_0xfdd4('0x7a')](_0x2cc3e2,_0x2ee4b6['type'],_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f['value'][_0xfdd4('0x74')],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);}break;case _0xfdd4('0x3c'):_0xa55e0f=as['buildExpression']('me',null,_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f[_0xfdd4('0x69')]['start'],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);break;}}else{var _0xa55e0f=as['buildExpression'](_0x2cc3e2,_0x2ee4b6[_0xfdd4('0x48')],_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f[_0xfdd4('0x69')]['start'],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);}}}else{var _0x427ded=_(_0x3a0de9[_0xfdd4('0x49')])[_0xfdd4('0x4a')]()[_0xfdd4('0x40')](function(_0x185226){return _['some'](_0x419578,[_0xfdd4('0x38'),_0x185226])?_0x185226:undefined;})[_0xfdd4('0x7b')]()[_0xfdd4('0x69')]();if(!_[_0xfdd4('0x7c')](_0x427ded)){_0x427ded[_0xfdd4('0x45')](function(_0x2cbd27){if(_0x2cbd27===_0xfdd4('0x7d')){_0x5848e1[_0xfdd4('0x7e')]('i.ChatWebsiteId\x20IN\x20?',[][_0xfdd4('0x7f')](_0x3a0de9['query'][_0x2cbd27]));}else if(_0x2cbd27==='createdAt'){var _0x40b2e8=JSON['parse'](_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27])['$gte'];var _0x4576ce=JSON[_0xfdd4('0x80')](_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27])[_0xfdd4('0x81')];_0x5848e1[_0xfdd4('0x7e')](_0xfdd4('0x82'),_0x40b2e8,_0x4576ce);}else{if(_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27]==='null'){_0x5848e1['where']('i.'+_0x2cbd27+_0xfdd4('0x83'));}else{_0x5848e1['where']('i.'+_0x2cbd27+_0xfdd4('0x84'),_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27]);}}});}if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x85')]){if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x85')]==0x1){_0x5848e1[_0xfdd4('0x6a')]('`unreadMessages`\x20=\x200');}else{_0x5848e1['having'](_0xfdd4('0x86'));}}if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')]){_0x1eee3d=_[_0xfdd4('0x88')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')])?_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')]:new Array(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')]);_0x1eee3d[_0xfdd4('0x45')](function(_0x32abf5){_0x2abe50['or'](_0xfdd4('0x89'),'%,'+_0x32abf5+',%');});}if(_0x3a0de9['query']['filter']){var _0x3761f2=_0x3a0de9[_0xfdd4('0x49')]['filter']['replace']('\x5c','\x5c\x5c')[_0xfdd4('0x8a')](/'/g,'\x27\x27');if(qs[_0xfdd4('0x8b')](_0x3761f2)){_0x14d07e['or']('i.id\x20LIKE\x20?',_0x3761f2+'%');}else{_0x14d07e['or'](_0xfdd4('0x8c'),qs[_0xfdd4('0x70')](_0x3761f2))['or'](_0xfdd4('0x8d'),_0x3761f2+'%');}}}_0x5848e1[_0xfdd4('0x7e')](_0x14d07e);_0x5848e1[_0xfdd4('0x8e')](_0xfdd4('0x8f'));var _0x5d356c={'type':db[_0xfdd4('0x90')][_0xfdd4('0x91')][_0xfdd4('0x92')],'raw':!![]};var _0x2f8001=_0x5848e1[_0xfdd4('0x93')]();_0x2f8001[_0xfdd4('0x53')](_0xfdd4('0x8f'));_0x2f8001[_0xfdd4('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x3f7273[_0xfdd4('0x94')]){_0x3f7273['order'][_0xfdd4('0x45')](function(_0x1b4f61){var _0x298906=_0x1b4f61[0x0]===_0xfdd4('0x95')?_0x1b4f61[0x0]:'i.'+_0x1b4f61[0x0];_0x5848e1[_0xfdd4('0x94')](_0x298906,_0x1b4f61[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x1eee3d)){_0x5848e1[_0xfdd4('0x6a')](_0x2abe50);_0x2f8001['where'](_0xfdd4('0x96'),_0x1eee3d);}BPromise['resolve']()[_0xfdd4('0x20')](function(){if(!_0x45dcc8){if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x7d')])return;_0x2f8001[_0xfdd4('0x7e')](_0xfdd4('0x97'));_0x5848e1[_0xfdd4('0x7e')](_0xfdd4('0x97'));return;}if(_0x3a0de9[_0xfdd4('0x98')][_0xfdd4('0x99')]!==_0xfdd4('0x9a'))return;return _0x3a0de9[_0xfdd4('0x98')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0xfdd4('0x20')](function(_0x1f9e08){if(_[_0xfdd4('0x7c')](_0x1f9e08)){_0x2f8001[_0xfdd4('0x7e')](_0xfdd4('0x9b'));_0x5848e1[_0xfdd4('0x7e')](_0xfdd4('0x9b'));}else{_0x2f8001[_0xfdd4('0x7e')](_0xfdd4('0x9c'),_['map'](_0x1f9e08,'id'));_0x5848e1['where'](_0xfdd4('0x9c'),_[_0xfdd4('0x40')](_0x1f9e08,'id'));}});})[_0xfdd4('0x20')](function(){if(_0x3a0de9['user'][_0xfdd4('0x99')]===_0xfdd4('0x9a')&&!_0x45dcc8&&!_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x7d')])return[];return db['sequelize']['query'](_0x2f8001[_0xfdd4('0x9d')](),_0x5d356c);})[_0xfdd4('0x20')](function(_0x3b75bf){_0x5367aa['count']=_0x3b75bf[_0xfdd4('0x50')];if(_0x5367aa[_0xfdd4('0x30')]===0x0)return[];return db[_0xfdd4('0x9e')][_0xfdd4('0x49')](_0x49bc61[_0xfdd4('0x9d')](),_0x5d356c)[_0xfdd4('0x20')](function(_0x524a8f){_0x35c032=_['keyBy'](_0x524a8f,'id');_0x5d356c=_[_0xfdd4('0x3b')](_0x5d356c,{'model':db[_0xfdd4('0x9f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x4f')]){_0x3f7273[_0xfdd4('0x4d')][_0xfdd4('0x45')](function(_0x46edc9){_0x5848e1[_0xfdd4('0x53')]('i.'+_0x46edc9);});}else{_0x5848e1['field'](_0xfdd4('0xa0'),'unreadMessages');_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa1'),'Account.key');_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa2'),_0xfdd4('0xa3'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa4'),_0xfdd4('0x95'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa5'));_0x5848e1[_0xfdd4('0x53')]('c.firstName',_0xfdd4('0xa6'));_0x5848e1['field'](_0xfdd4('0xa7'),'Contact.lastName');_0x5848e1['field'](_0xfdd4('0xa8'),_0xfdd4('0xa9'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xaa'),_0xfdd4('0xab'));_0x5848e1['field'](_0xfdd4('0xac'),_0xfdd4('0xad'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xae'),_0xfdd4('0xaf'));_0x5848e1[_0xfdd4('0x53')]('o.fullname',_0xfdd4('0xb0'));_0x5848e1[_0xfdd4('0x53')]('o.internal','Owner.internal');_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xb1'),_0xfdd4('0x43'));}if(_0x3f7273['limit'])_0x5848e1['limit'](_0x3f7273[_0xfdd4('0x2f')]);if(_0x3f7273[_0xfdd4('0x31')])_0x5848e1[_0xfdd4('0x31')](_0x3f7273['offset']);return db['sequelize'][_0xfdd4('0x49')](_0x5848e1[_0xfdd4('0x9d')](),_0x5d356c);})[_0xfdd4('0x20')](function(_0x4bfb31){if(_0x4bfb31[_0xfdd4('0x50')]>0x0)_0x4addd6['where'](_0xfdd4('0xb2'),_[_0xfdd4('0x40')](_0x4bfb31,'id'));return db[_0xfdd4('0x9e')]['query'](_0x4addd6[_0xfdd4('0x9d')](),_0x5d356c)[_0xfdd4('0x20')](function(_0x1efb08){var _0xe3296c=_[_0xfdd4('0xb3')](_0x1efb08,'ChatInteractionId');var _0x19de84=[];_0x4bfb31[_0xfdd4('0x45')](function(_0x133f56){_0x19de84['push'](updateChatInteraction(_0x133f56,_0x35c032,_0xe3296c));});return BPromise[_0xfdd4('0xb4')](_0x19de84);});});})[_0xfdd4('0x20')](function(_0xb9cb69){_0x5367aa[_0xfdd4('0xb5')]=_0xb9cb69;return _0x5367aa;})['then'](respondWithFilteredResult(_0x11f241,_0x3f7273))[_0xfdd4('0x29')](handleError(_0x11f241,null));};exports['show']=function(_0x4f5ca3,_0x528004){var _0x206a59={'raw':![],'where':{'id':_0x4f5ca3['params']['id']}},_0x545475={};_0x545475['model']=_[_0xfdd4('0x4a')](db[_0xfdd4('0x9f')][_0xfdd4('0x47')]);_0x545475[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x4f5ca3[_0xfdd4('0x49')]);_0x545475[_0xfdd4('0x4b')]=_[_0xfdd4('0x4c')](_0x545475[_0xfdd4('0x4e')],_0x545475[_0xfdd4('0x49')]);_0x206a59[_0xfdd4('0x4d')]=_[_0xfdd4('0x4c')](_0x545475[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x4f5ca3[_0xfdd4('0x49')][_0xfdd4('0x4f')]));_0x206a59[_0xfdd4('0x4d')]=_0x206a59[_0xfdd4('0x4d')][_0xfdd4('0x50')]?_0x206a59[_0xfdd4('0x4d')]:_0x545475[_0xfdd4('0x4e')];if(_0x4f5ca3[_0xfdd4('0x49')][_0xfdd4('0xb6')]){_0x206a59[_0xfdd4('0xb7')]=[{'all':!![]}];}_0x206a59=_[_0xfdd4('0x3b')]({},_0x206a59,_0x4f5ca3[_0xfdd4('0xb8')]);return db['ChatInteraction'][_0xfdd4('0x67')](_0x206a59)[_0xfdd4('0x20')](handleEntityNotFound(_0x528004,null))[_0xfdd4('0x20')](respondWithResult(_0x528004,null))[_0xfdd4('0x29')](handleError(_0x528004,null));};exports[_0xfdd4('0xb9')]=function(_0x577bef,_0x3616e3){return db[_0xfdd4('0x9f')][_0xfdd4('0xb9')](_0x577bef[_0xfdd4('0x3c')],{})[_0xfdd4('0x20')](respondWithResult(_0x3616e3,0xc9))[_0xfdd4('0x29')](handleError(_0x3616e3,null));};exports['update']=function(_0x186d86,_0x1a9e62){if(_0x186d86[_0xfdd4('0x3c')]['id']){delete _0x186d86[_0xfdd4('0x3c')]['id'];}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x186d86['params']['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x1a9e62,null))[_0xfdd4('0x20')](saveUpdates(_0x186d86[_0xfdd4('0x3c')],null))['then'](respondWithResult(_0x1a9e62,null))[_0xfdd4('0x29')](handleError(_0x1a9e62,null));};exports[_0xfdd4('0x36')]=function(_0x4de363,_0x5159a5){return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x4de363[_0xfdd4('0xba')]['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x5159a5,null))['then'](removeEntity(_0x5159a5,null))[_0xfdd4('0x29')](handleError(_0x5159a5,null));};exports['describe']=function(_0xc9955e,_0x42204a){return db[_0xfdd4('0x9f')][_0xfdd4('0xbb')]()[_0xfdd4('0x20')](respondWithResult(_0x42204a,null))[_0xfdd4('0x29')](handleError(_0x42204a,null));};exports[_0xfdd4('0xbc')]=function(_0x46e3ad,_0x29fcd4){var _0xe32bfc=_0x46e3ad[_0xfdd4('0xba')]['id'];var _0x5015a1;var _0xca4f26;var _0x42a3dc;return db[_0xfdd4('0x9f')][_0xfdd4('0xbd')]({'where':{'id':_0xe32bfc}})[_0xfdd4('0x20')](function(_0x4512b0){_0x5015a1=_0x4512b0;return db['ChatWebsite'][_0xfdd4('0xbd')]({'where':{'id':_0x4512b0[_0xfdd4('0x7d')]},'attributes':['id',_0xfdd4('0xbe'),_0xfdd4('0xbf'),'vidaooTopic',_0xfdd4('0xc0'),_0xfdd4('0xc1')],'raw':!![]});})['then'](function(_0x2d506e){if(_0x2d506e&&_0x2d506e[_0xfdd4('0xbe')]&&_0x2d506e[_0xfdd4('0xbf')]){_0xca4f26=_0x2d506e;var _0x204975={'interaction':{'id':_0xe32bfc},'agent':{'id':_0x46e3ad[_0xfdd4('0x98')]['id'],'name':_0x46e3ad[_0xfdd4('0x98')][_0xfdd4('0x38')],'fullname':_0x46e3ad[_0xfdd4('0x98')][_0xfdd4('0x41')],'email':_0x46e3ad[_0xfdd4('0x98')][_0xfdd4('0xc2')]},'contact':_0x46e3ad[_0xfdd4('0x3c')][_0xfdd4('0xc3')],'account':_0x46e3ad[_0xfdd4('0x3c')]['account']};var _0x42253b={'rejectUnauthorized':![],'method':_0xfdd4('0xc4'),'url':_0xfdd4('0xc5'),'headers':{'X-APIKEY':_0x2d506e[_0xfdd4('0xbe')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x46e3ad['user'][_0xfdd4('0xc2')]],'buttons':null,'topic':_0xca4f26[_0xfdd4('0xc6')],'note':_['isNull'](_0xca4f26[_0xfdd4('0xc0')])?null:getMustacheRender(_0xca4f26[_0xfdd4('0xc0')],_0x204975),'metadata':null},'redirect':_0xfdd4('0xc7'),'json':!![]};try{if(!_[_0xfdd4('0xc8')](_0xca4f26['vidaooMetadata'])){var _0x227fcf=getMustacheRender(_0xca4f26['vidaooMetadata'],_0x204975);var _0x2aa3d3=JSON[_0xfdd4('0x80')](_0x227fcf);_0x42253b['body'][_0xfdd4('0xc9')]=_0x2aa3d3;}}catch(_0x5e058b){throw new db['Sequelize'][(_0xfdd4('0xca'))](_0xfdd4('0xcb'));}return rp(_0x42253b);}else{throw new db[(_0xfdd4('0x90'))][(_0xfdd4('0xca'))]('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x28df36){_0x42a3dc=_0x28df36;if(_0x42a3dc['id']){var _0x1bb704={'body':_0x42a3dc['join_url'],'ChatWebsiteId':_0xca4f26['id'],'ChatInteractionId':_0x5015a1['id'],'direction':'out','UserId':_0x46e3ad[_0xfdd4('0x98')]['id']};return db[_0xfdd4('0xcc')][_0xfdd4('0xb9')](_0x1bb704,{});}else{throw new db['Sequelize'][(_0xfdd4('0xca'))](_0xfdd4('0xcd'));}})[_0xfdd4('0x20')](function(){return _0x5015a1[_0xfdd4('0xce')]({'vidaooSessionId':_0x42a3dc['id']});})['then'](respondWithResult(_0x29fcd4,null))[_0xfdd4('0x29')](handleError(_0x29fcd4,null));};exports[_0xfdd4('0xcf')]=function(_0x23dd10,_0x23746f){if(_0x23dd10[_0xfdd4('0x3c')]['id']){delete _0x23dd10['body']['id'];}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x23dd10['params']['id']},'include':[{'model':db[_0xfdd4('0xd0')],'as':_0xfdd4('0x6d')}]})[_0xfdd4('0x20')](handleEntityNotFound(_0x23746f,null))[_0xfdd4('0x20')](saveUpdates(_0x23dd10[_0xfdd4('0x3c')],null))[_0xfdd4('0x20')](respondWithResult(_0x23746f,null))[_0xfdd4('0x29')](handleError(_0x23746f,null));};exports[_0xfdd4('0xd1')]=function(_0x3b6cfc,_0x20b6b1,_0x308201){if(_0x3b6cfc[_0xfdd4('0x3c')]['id']){delete _0x3b6cfc[_0xfdd4('0x3c')]['id'];}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x3b6cfc['params']['id']}})['then'](function(_0x44b024){if(!_0x44b024){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xfdd4('0xd1'),0x194,_0xfdd4('0xd2'));_0x20b6b1[_0xfdd4('0x2a')](0x194);}else{if(_0x44b024[_0xfdd4('0x79')]){throw new db[(_0xfdd4('0x90'))][(_0xfdd4('0xca'))](_0xfdd4('0xd3'));}}return _0x44b024;})['then'](function(_0x24e4be){if(_0x24e4be){return _0x24e4be[_0xfdd4('0x35')]({'closed':_0x3b6cfc['body']['closed'],'disposition':_0x3b6cfc['body'][_0xfdd4('0xd4')]})['then'](function(_0x28d8d9){return _0x28d8d9;});}})['then'](function(_0x52ff15){return respondWithRpcPromise(_0xfdd4('0xd5'),_0xfdd4('0xd1'),_0x3b6cfc[_0xfdd4('0x3c')],client9004);})[_0xfdd4('0x20')](respondWithResult(_0x20b6b1,null))[_0xfdd4('0x29')](handleError(_0x20b6b1,null));};exports[_0xfdd4('0xd6')]=function(_0x461070,_0x17f504,_0x156173){_0x461070['body'][_0xfdd4('0x38')]=_0x461070[_0xfdd4('0xd7')]['originalname'];_0x461070[_0xfdd4('0x3c')][_0xfdd4('0xd8')]=_0x461070['file']['filename'];_0x461070['body']['type']=_0x461070[_0xfdd4('0xd7')][_0xfdd4('0xd9')];return db['Attachment'][_0xfdd4('0xb9')](_0x461070['body'])[_0xfdd4('0x20')](respondWithResult(_0x17f504,0xc9))[_0xfdd4('0x29')](handleError(_0x17f504,null));};exports[_0xfdd4('0xda')]=function(_0x2093a5,_0x2c36a3,_0x45fa09){return db[_0xfdd4('0x9f')]['findOne']({'where':{'id':_0x2093a5['params']['id']},'raw':!![]})[_0xfdd4('0x20')](handleEntityNotFound(_0x2c36a3,null))[_0xfdd4('0x20')](function(_0x2b65d7){if(_0x2b65d7){if(_0x2b65d7[_0xfdd4('0xdb')]){return _0x2c36a3[_0xfdd4('0x2b')](0x193)['json']({'status':0x193,'message':_0xfdd4('0xdc')});}return db[_0xfdd4('0xdd')][_0xfdd4('0xbd')]({'where':{'id':_0x2093a5['query']['attachId']},'raw':!![]})[_0xfdd4('0x20')](handleEntityNotFound(_0x2c36a3,null));}})[_0xfdd4('0x20')](function(_0x2f6456){if(_0x2f6456){var _0x1ff8d6=_0x2f6456[_0xfdd4('0xde')]!==null;var _0xa64a3b=path['join'](config['root'],_0xfdd4('0xdf'));if(_0x1ff8d6){_0xa64a3b=path[_0xfdd4('0xe0')](_0xa64a3b,_0xfdd4('0xe1'));}var _0x5a4bd4=path[_0xfdd4('0xe0')](_0xa64a3b,_0x2f6456['basename']);return _0x2c36a3[_0xfdd4('0xe2')](_0x5a4bd4);}})['catch'](handleError(_0x2c36a3,null));};exports[_0xfdd4('0xe3')]=function(_0x12beac,_0x5a78bc){var _0x2d1810=null;var _0x308050=null;var _0x1f1ec8=null;var _0x2e3342=null;if(_0x12beac['body']['id']){delete _0x12beac[_0xfdd4('0x3c')]['id'];}if(_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe4')]){_0x2e3342=path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],_0xfdd4('0xe6'),util['format'](_0xfdd4('0xe7'),Date['now']()));_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe8')]=_0x2e3342;}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x12beac[_0xfdd4('0xba')]['id']},'include':[{'model':db[_0xfdd4('0xcc')],'as':_0xfdd4('0xe9'),'include':[{'model':db[_0xfdd4('0x77')],'as':_0xfdd4('0x77')}]}]})[_0xfdd4('0x20')](handleEntityNotFound(_0x5a78bc,null))[_0xfdd4('0x20')](saveUpdates(_0x12beac[_0xfdd4('0x3c')],null))['then'](function(_0x13df51){if(_0x13df51){_0x2d1810=_0x13df51;return db['ChatWebsite'][_0xfdd4('0x67')]({'where':{'id':_0x2d1810['ChatWebsiteId']}});}})['then'](function(_0x17da2a){if(_0x17da2a){_0x1f1ec8=_0x17da2a;return db[_0xfdd4('0xd0')][_0xfdd4('0x67')]({'where':{'id':_0x2d1810[_0xfdd4('0x72')]}});}})[_0xfdd4('0x20')](function(_0x1cf955){if(_0x1cf955){_0x308050=_0x1cf955;if(_0x2e3342){var _0x2d74d1=null;for(var _0x5c70bf=0x1;_0x5c70bf<_0x2d1810[_0xfdd4('0xe9')][_0xfdd4('0x50')];++_0x5c70bf){_0x2d74d1=_0x2d1810[_0xfdd4('0xe9')][_0x5c70bf];var _0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?util[_0xfdd4('0xea')](_0xfdd4('0xeb'),_0x1f1ec8[_0xfdd4('0xec')],_0x2d74d1[_0xfdd4('0x79')]):_0xfdd4('0xed');var _0x43c681=_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xee')]||util[_0xfdd4('0xea')](_0xfdd4('0xeb'),'Visitor',_0x2d74d1['ContactId']);switch(_0x1f1ec8[_0xfdd4('0xef')]){case _0xfdd4('0xf0'):_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?util[_0xfdd4('0xea')]('%s%d',_0x1f1ec8[_0xfdd4('0xec')],_0x2d74d1['UserId']):_0xfdd4('0xed');break;case _0xfdd4('0xf1'):_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?_0x2d74d1['User'][_0xfdd4('0xf2')]||_0x2d74d1[_0xfdd4('0x77')][_0xfdd4('0x41')]:_0xfdd4('0xed');break;case _0xfdd4('0xf3'):_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?_0x2d74d1[_0xfdd4('0x77')][_0xfdd4('0x41')]:_0xfdd4('0xed');break;default:_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?util[_0xfdd4('0xea')]('%s%d',_0x1f1ec8[_0xfdd4('0xec')],_0x2d74d1[_0xfdd4('0x79')]):'System';}var _0x3621f3=util[_0xfdd4('0xea')](_0xfdd4('0xf4'),moment(_0x2d74d1[_0xfdd4('0xf5')])['format'](_0xfdd4('0xf6')),_0x2d74d1[_0xfdd4('0xf7')]==='in'?_0x43c681:_0x5a7c66,_0x2d74d1[_0xfdd4('0x3c')]);if(!_0x2d74d1[_0xfdd4('0xf8')]){fs[_0xfdd4('0xf9')](_0x2e3342,_0x3621f3);}}return db[_0xfdd4('0xfa')][_0xfdd4('0xbd')]({'where':{'service':!![]},'include':[{'model':db[_0xfdd4('0xfb')],'as':'Smtp','raw':!![]}]});}}})[_0xfdd4('0x20')](function(_0x4c248e){if(_0x4c248e&&_0x4c248e[_0xfdd4('0xfc')]&&_0x12beac['body']){var _0x5e8af7={'tls':{'rejectUnauthorized':![]}};if(_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0xfd')]){_0x5e8af7[_0xfdd4('0xfd')]=_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0xfd')];}else{_0x5e8af7[_0xfdd4('0xfe')]=_0x4c248e[_0xfdd4('0xfc')]['host'];_0x5e8af7[_0xfdd4('0xff')]=_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0xff')];_0x5e8af7[_0xfdd4('0x100')]=_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x100')];}if(_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x101')]){_0x5e8af7['auth']={'user':_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x98')],'pass':_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x102')]};}return respondWithRpcPromise(_0xfdd4('0x103'),_0xfdd4('0x104'),{'account':_0x5e8af7,'message':{'from':util[_0xfdd4('0xea')]('\x22%s\x22\x20<%s>',_0x4c248e['name'],_0x4c248e[_0xfdd4('0xc2')]||_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x98')]),'to':_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe4')],'subject':_0xfdd4('0x105'),'text':util[_0xfdd4('0xea')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe4')]),'attachments':[{'path':_0x2e3342}]}})['then'](function(){return _0x2d1810;})['catch'](function(_0x1336e1){console[_0xfdd4('0x26')](_0x1336e1);});}else{return _0x2d1810;}})[_0xfdd4('0x20')](respondWithStatusCode(_0x5a78bc,0xc8))[_0xfdd4('0x29')](handleError(_0x5a78bc,null));};exports[_0xfdd4('0x106')]=function(_0x25656c,_0x5f51e6,_0x4fbd83){return db[_0xfdd4('0xcc')][_0xfdd4('0x67')]({'where':{'id':_0x25656c['params']['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x5f51e6,null))['then'](function(_0x13cf75){if(_0x13cf75){return _0x13cf75[_0xfdd4('0x106')](_0x25656c[_0xfdd4('0x3c')][_0xfdd4('0x107')],_[_0xfdd4('0x108')](_0x25656c['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x5f51e6,null))[_0xfdd4('0x29')](handleError(_0x5f51e6,null));};exports['getMessages']=function(_0x106064,_0x536c4b,_0x7101d2){var _0x317d77={'raw':![],'where':{}};var _0x599d63={};var _0x529474={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xfdd4('0xbd')]({'where':{'id':_0x106064[_0xfdd4('0xba')]['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x536c4b,null))[_0xfdd4('0x20')](function(_0x4c33bc){if(_0x4c33bc){_0x599d63['model']=_[_0xfdd4('0x4a')](db[_0xfdd4('0xcc')][_0xfdd4('0x47')]);_0x599d63[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x106064[_0xfdd4('0x49')]);_0x599d63['filters']=_[_0xfdd4('0x4c')](_0x599d63[_0xfdd4('0x4e')],_0x599d63['query']);_0x317d77[_0xfdd4('0x4d')]=_['intersection'](_0x599d63[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x106064[_0xfdd4('0x49')][_0xfdd4('0x4f')]));_0x317d77[_0xfdd4('0x4d')]=_0x317d77[_0xfdd4('0x4d')][_0xfdd4('0x50')]?_0x317d77[_0xfdd4('0x4d')]:_0x599d63['model'];if(!_0x106064[_0xfdd4('0x49')][_0xfdd4('0x51')](_0xfdd4('0x109'))){_0x317d77[_0xfdd4('0x2f')]=qs['limit'](_0x106064[_0xfdd4('0x49')]['limit']);_0x317d77[_0xfdd4('0x31')]=qs[_0xfdd4('0x31')](_0x106064[_0xfdd4('0x49')]['offset']);}_0x317d77['order']=qs[_0xfdd4('0x10a')](_0x106064[_0xfdd4('0x49')]['sort']);_0x317d77[_0xfdd4('0x7e')]=qs['filters'](_['pick'](_0x106064[_0xfdd4('0x49')],_0x599d63[_0xfdd4('0x4b')]));_0x317d77[_0xfdd4('0x7e')][_0xfdd4('0x10b')]=_0x4c33bc['id'];if(_0x106064['query']['filter']){_0x317d77[_0xfdd4('0x7e')]=_[_0xfdd4('0x3b')](_0x317d77[_0xfdd4('0x7e')],{'$or':_['map'](_0x317d77[_0xfdd4('0x4d')],function(_0x2b1f92){var _0x57c9bb={};_0x57c9bb[_0x2b1f92]={'$like':'%'+_0x106064[_0xfdd4('0x49')]['filter']+'%'};return _0x57c9bb;})});}if(_0x106064[_0xfdd4('0x49')][_0xfdd4('0x10c')]){var _0x4b97fa=_0x106064['query']['$gte']['split'](',');var _0x54fec8={};_0x54fec8[_0x4b97fa[0x0]]={'$gte':moment(_0x4b97fa[0x1])[_0xfdd4('0xea')]('YYYY-MM-DD\x20HH:mm:ss')};_0x317d77[_0xfdd4('0x7e')]=_[_0xfdd4('0x3b')](_0x317d77[_0xfdd4('0x7e')],_0x54fec8);}_0x317d77=_[_0xfdd4('0x3b')]({},_0x317d77,_0x106064[_0xfdd4('0xb8')]);return db['ChatMessage']['count']({'where':_0x317d77[_0xfdd4('0x7e')]})[_0xfdd4('0x20')](function(_0x22c2b9){_0x529474[_0xfdd4('0x30')]=_0x22c2b9;if(_0x106064[_0xfdd4('0x49')][_0xfdd4('0xb6')]){_0x317d77[_0xfdd4('0xb7')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x317d77);})[_0xfdd4('0x20')](function(_0xa129e4){_0x529474[_0xfdd4('0xb5')]=_0xa129e4;return _0x529474;});}})[_0xfdd4('0x20')](respondWithFilteredResult(_0x536c4b,_0x317d77))[_0xfdd4('0x29')](handleError(_0x536c4b,null));};exports[_0xfdd4('0x10d')]=function(_0x18ad0c,_0x5ba916,_0x2d3c9f){var _0x5de8d0={'where':{}},_0x4f2eea={},_0x3341ae={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xfdd4('0xbd')]({'where':{'id':_0x18ad0c[_0xfdd4('0xba')]['id']}})['then'](handleEntityNotFound(_0x5ba916,null))[_0xfdd4('0x20')](function(_0x20c9f6){if(_0x20c9f6){_0x4f2eea[_0xfdd4('0x4e')]=_[_0xfdd4('0x4a')](db[_0xfdd4('0xcc')]['rawAttributes']);_0x4f2eea[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x18ad0c[_0xfdd4('0x49')]);_0x4f2eea['filters']=_[_0xfdd4('0x4c')](_0x4f2eea[_0xfdd4('0x4e')],_0x4f2eea['query']);_0x5de8d0[_0xfdd4('0x4d')]=_[_0xfdd4('0x4c')](_0x4f2eea[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x18ad0c['query']['fields']));_0x5de8d0[_0xfdd4('0x4d')]=_0x5de8d0['attributes'][_0xfdd4('0x50')]?_0x5de8d0[_0xfdd4('0x4d')]:_0x4f2eea[_0xfdd4('0x4e')];if(!_0x18ad0c[_0xfdd4('0x49')][_0xfdd4('0x51')]('nolimit')){_0x5de8d0[_0xfdd4('0x2f')]=qs[_0xfdd4('0x2f')](_0x18ad0c['query'][_0xfdd4('0x2f')]);_0x5de8d0[_0xfdd4('0x31')]=qs[_0xfdd4('0x31')](_0x18ad0c['query'][_0xfdd4('0x31')]);}_0x5de8d0['order']=qs[_0xfdd4('0x10a')](_0x18ad0c['query']['sort']);_0x5de8d0[_0xfdd4('0x7e')]=qs[_0xfdd4('0x4b')](_[_0xfdd4('0x52')](_0x18ad0c[_0xfdd4('0x49')],_0x4f2eea[_0xfdd4('0x4b')]));_0x5de8d0[_0xfdd4('0x7e')]['ChatInteractionId']=_0x20c9f6['id'];if(_0x18ad0c[_0xfdd4('0x49')][_0xfdd4('0x10e')]){_0x5de8d0[_0xfdd4('0x7e')]=_['merge'](_0x5de8d0['where'],{'$or':_[_0xfdd4('0x40')](_0x5de8d0['attributes'],function(_0xa03de8){var _0x141042={};_0x141042[_0xa03de8]={'$like':'%'+_0x18ad0c[_0xfdd4('0x49')]['filter']+'%'};return _0x141042;})});}_0x5de8d0['where'][_0xfdd4('0xf8')]=![];if(_0x18ad0c[_0xfdd4('0x49')]['id']){_0x5de8d0[_0xfdd4('0x7e')]['id']={'$gt':_0x18ad0c[_0xfdd4('0x49')]['id']};}_0x5de8d0=_[_0xfdd4('0x3b')]({},_0x5de8d0,_0x18ad0c[_0xfdd4('0xb8')]);return db[_0xfdd4('0xcc')][_0xfdd4('0x30')]({'where':_0x5de8d0[_0xfdd4('0x7e')]})[_0xfdd4('0x20')](function(_0x21e917){_0x3341ae['count']=_0x21e917;_0x5de8d0[_0xfdd4('0xb7')]=[];if(_0x18ad0c[_0xfdd4('0x49')]['includeAgent']){_0x5de8d0[_0xfdd4('0xb7')][_0xfdd4('0x46')]({'model':db[_0xfdd4('0x77')],'as':_0xfdd4('0x77'),'attributes':['id',_0xfdd4('0x41'),_0xfdd4('0xf2')]});}if(_0x18ad0c[_0xfdd4('0x49')][_0xfdd4('0xb6')]){_0x5de8d0[_0xfdd4('0xb7')]=[{'all':!![]}];}return db[_0xfdd4('0xcc')][_0xfdd4('0x10f')](_0x5de8d0);})[_0xfdd4('0x20')](function(_0x1c18f8){_0x3341ae['rows']=_0x1c18f8;return _0x3341ae;});}})[_0xfdd4('0x20')](respondWithFilteredResult(_0x5ba916,_0x5de8d0))[_0xfdd4('0x29')](handleError(_0x5ba916,null));};exports['addTags']=function(_0x31db99,_0x692aa1,_0x1003d4){return db['ChatInteraction'][_0xfdd4('0x67')]({'where':{'id':_0x31db99[_0xfdd4('0xba')]['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x692aa1,null))['then'](function(_0x5b5edb){if(_0x5b5edb){return _0x5b5edb[_0xfdd4('0x110')](_0x31db99[_0xfdd4('0x3c')][_0xfdd4('0x107')],_[_0xfdd4('0x108')](_0x31db99[_0xfdd4('0x3c')],[_0xfdd4('0x107'),'id'])||{})[_0xfdd4('0x111')](function(){return db[_0xfdd4('0x75')][_0xfdd4('0x10f')]({'attributes':['id',_0xfdd4('0x38'),'color'],'where':{'id':_0x31db99['body']['ids']}});})[_0xfdd4('0x20')](function(_0x1a8c71){socket[_0xfdd4('0x112')](_0xfdd4('0x113'),{'id':Number(_0x31db99[_0xfdd4('0xba')]['id']),'tags':_0x1a8c71||[]});return{'id':Number(_0x31db99[_0xfdd4('0xba')]['id']),'tags':_0x1a8c71||[]};});}})[_0xfdd4('0x20')](respondWithResult(_0x692aa1,null))['catch'](handleError(_0x692aa1,null));};exports[_0xfdd4('0x114')]=function(_0x456534,_0x1178b3,_0x272948){return db[_0xfdd4('0x9f')]['find']({'where':{'id':_0x456534[_0xfdd4('0xba')]['id']}})['then'](handleEntityNotFound(_0x1178b3,null))['then'](function(_0x360298){if(_0x360298){return _0x360298['removeTags'](_0x456534['query'][_0xfdd4('0x107')]);}})['then'](respondWithStatusCode(_0x1178b3,null))[_0xfdd4('0x29')](handleError(_0x1178b3,null));};exports[_0xfdd4('0xe2')]=function(_0x39f38f,_0x4a9e25){var _0x535d2b=moment()[_0xfdd4('0x115')]()[_0xfdd4('0x9d')]();var _0x24b726=path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],'server','files',_0xfdd4('0x116'));var _0x260fe6=path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],_0xfdd4('0x117'),_0xfdd4('0x118'),_0xfdd4('0x119'));var _0x4d52d3=path['join'](_0x24b726,_0x535d2b);var _0x31124f=util['format'](_0xfdd4('0x11a'),_0x39f38f['params']['id'],_0x535d2b);var _0x38e24c=path[_0xfdd4('0xe0')](_0x24b726,_0x31124f);var _0x25f9c9=[];_0x25f9c9[_0xfdd4('0x46')]({'model':db['User'],'as':_0xfdd4('0x77'),'attributes':['id',_0xfdd4('0x41')],'raw':!![]});_0x25f9c9['push']({'model':db[_0xfdd4('0xd0')],'as':'Contact','attributes':['id','firstName',_0xfdd4('0x11b')],'raw':!![]});if(_0x39f38f['query'][_0xfdd4('0x119')]){_0x25f9c9[_0xfdd4('0x46')]({'model':db[_0xfdd4('0xdd')],'as':_0xfdd4('0xdd'),'raw':!![]});}var _0x1a5c91=[{'model':db[_0xfdd4('0xcc')],'as':_0xfdd4('0xe9'),'attributes':['id','body',_0xfdd4('0xf5'),_0xfdd4('0xf7'),'secret','read'],'include':_0x25f9c9}];_0x1a5c91[_0xfdd4('0x46')]({'model':db[_0xfdd4('0x11c')],'as':_0xfdd4('0x11d'),'attributes':['id','name']});_0x1a5c91[_0xfdd4('0x46')]({'model':db[_0xfdd4('0x77')],'as':'Owner','attributes':['id','fullname']});return db[_0xfdd4('0x9f')]['find']({'where':{'id':_0x39f38f['params']['id']},'include':_0x1a5c91})[_0xfdd4('0x20')](handleEntityNotFound(_0x4a9e25,null))[_0xfdd4('0x20')](function(_0xbde236){if(_0xbde236){var _0x2de8b3=_0xbde236[_0xfdd4('0x11e')]({'plain':!![]});fs[_0xfdd4('0x11f')](_0x4d52d3);var _0x1563a5={'channel':_0xfdd4('0x120'),'account':_0x2de8b3[_0xfdd4('0x11d')][_0xfdd4('0x38')],'agent':_0x2de8b3[_0xfdd4('0x121')]?_0x2de8b3[_0xfdd4('0x121')]['fullname']:_0xfdd4('0x122'),'createdAt':moment(_0x2de8b3[_0xfdd4('0xf5')])[_0xfdd4('0xea')](_0xfdd4('0x123'))[_0xfdd4('0x9d')](),'closedAt':_0x2de8b3['closed']?moment(_0x2de8b3[_0xfdd4('0x124')])[_0xfdd4('0xea')]('YYYY-MM-DD\x20HH:mm:ss')[_0xfdd4('0x9d')]():'','disposition':_0x2de8b3['disposition'],'chatInfo':{'browser':_0x2de8b3[_0xfdd4('0x125')],'os':_0x2de8b3[_0xfdd4('0x126')],'referer':_0x2de8b3[_0xfdd4('0x127')],'customerIp':_0x2de8b3['customerIp'],'customerPort':_0x2de8b3[_0xfdd4('0x128')]?_0x2de8b3[_0xfdd4('0x128')]:_0xfdd4('0x122')},'messages':_(_0x2de8b3[_0xfdd4('0xe9')])['tail']()[_0xfdd4('0x10e')]({'secret':![]})[_0xfdd4('0x40')](function(_0x46e0e2){if(_0x46e0e2['Attachment']){var _0x306fc1=path[_0xfdd4('0xe0')](_0x260fe6,_0x46e0e2['Attachment'][_0xfdd4('0xd8')]);if(fs[_0xfdd4('0x129')](_0x306fc1)){fs[_0xfdd4('0x12a')](_0x306fc1)[_0xfdd4('0x12b')](fs[_0xfdd4('0x12c')](path['join'](_0x4d52d3,_0x46e0e2[_0xfdd4('0xdd')][_0xfdd4('0xd8')])));}}return{'date':moment(_0x46e0e2['createdAt'])[_0xfdd4('0xea')](_0xfdd4('0x123'))[_0xfdd4('0x9d')](),'sender':_0x46e0e2[_0xfdd4('0xf7')]===_0xfdd4('0x12d')?_0x46e0e2[_0xfdd4('0x77')]?_0x46e0e2[_0xfdd4('0x77')][_0xfdd4('0x41')]:'System':_0x46e0e2['Contact'][_0xfdd4('0x12e')]+(_0x46e0e2['Contact']['lastName']?'\x20'+_0x46e0e2[_0xfdd4('0x6d')]['lastName']:''),'body':_0x46e0e2[_0xfdd4('0xdd')]?_0x46e0e2[_0xfdd4('0xdd')]['basename']:_0x46e0e2[_0xfdd4('0x3c')],'direction':_0x46e0e2[_0xfdd4('0xf7')]===_0xfdd4('0x12d')?'A':'C','secret':_0x46e0e2[_0xfdd4('0xf8')],'read':_0x46e0e2[_0xfdd4('0x85')],'attachment':_0x46e0e2['Attachment']};})[_0xfdd4('0x69')]()};return ejs[_0xfdd4('0x12f')](path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],_0xfdd4('0x117'),_0xfdd4('0x130'),_0xfdd4('0x131')),{'interaction':_0x1563a5})[_0xfdd4('0x20')](function(_0x5ac931){var _0x2b8e2b=path['join'](_0x4d52d3,_0xfdd4('0x132')+_0x2de8b3['id']+'-'+_0x535d2b+_0xfdd4('0x133'));var _0x4d5a93={'path':_0x2b8e2b,'channel':'Chat','interactionId':_0x2de8b3['id']};return pdf['createPdfFromHTML'](_0x5ac931,_0x4d5a93);})[_0xfdd4('0x20')](function(){return new BPromise(function(_0x4a323c,_0x384933){zipdir(_0x4d52d3,{'saveTo':_0x38e24c},function(_0x13a826,_0x4ce772){if(_0x13a826)return _0x384933(_0x13a826);return _0x4a323c(_0x4ce772);});})['then'](function(){return new BPromise(function(_0x199881,_0x1fa795){rimraf(_0x4d52d3,function(_0x453527){if(_0x453527)_0x1fa795(_0x453527);return _0x199881();});});})[_0xfdd4('0x20')](function(){return _0x4a9e25[_0xfdd4('0xe2')](_0x38e24c,_0x31124f,function(_0x4fa06b){if(_0x4fa06b){console['log'](_0xfdd4('0x134'),_0x4fa06b);}else{fs['unlinkSync'](_0x38e24c);}});});});}else{return _0x4a9e25[_0xfdd4('0x2a')](0xc8);}})[_0xfdd4('0x29')](handleError(_0x4a9e25,null));};
\ No newline at end of file
+var _0x5f2f=['vidaooMetadata','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','sendStatus','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','basename','download','mailTranscript','format','transcript-%s.txt','now','pathTranscript','Messages','ChatWebsite','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','MailAccount','MailServerOut','Smtp','service','host','port','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','omit','getMessages','pick','includeAll','findAll','getMyMessages','includeAgent','alias','setTags','ids','spread','color','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','Owner','get','mkdirSync','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','status','end','limit','undefined','count','set','Content-Range','json','apply','save','update','name','merge','body','contact','account','Users','map','fullname','TagIds','Tags','split','forEach','push','index','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','select','field','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','getFullTextValue','find','ContactId','buildExpression','text','start','Tag','union','User','UserId','some','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','contactName','DESC','t.id\x20IN\x20?','resolve','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','keyBy','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','include','options','create','destroy','params','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow'];(function(_0x70504d,_0x34e810){var _0x47e29b=function(_0x119dfe){while(--_0x119dfe){_0x70504d['push'](_0x70504d['shift']());}};_0x47e29b(++_0x34e810);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1409ee,_0x5b0325){_0x1409ee=_0x1409ee-0x0;var _0x1fc5ac=_0x5f2f[_0x1409ee];return _0x1fc5ac;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf5f2('0x14'))(_0xf5f2('0x15'));var utils=require('../../config/utils');var config=require(_0xf5f2('0x16'));var licenseUtil=require(_0xf5f2('0x17'));var db=require(_0xf5f2('0x18'))['db'];config[_0xf5f2('0x19')]=_[_0xf5f2('0x1a')](config[_0xf5f2('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xf5f2('0x1b'))(new Redis(config[_0xf5f2('0x19')]));require(_0xf5f2('0x1c'))[_0xf5f2('0x1d')](socket);var jayson=require(_0xf5f2('0x1e'));var client=jayson['client'][_0xf5f2('0x1f')]({'port':0x232b});var client9004=jayson[_0xf5f2('0x20')][_0xf5f2('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x1b6dd2,_0x23e23a,_0x3a9dbb,_0xdb61b3){return new BPromise(function(_0x395a5a,_0x11f702){var _0x228ace=_0xdb61b3||client;return _0x228ace[_0xf5f2('0x21')](_0x1b6dd2,_0x3a9dbb)[_0xf5f2('0x22')](function(_0x4ff59b){logger[_0xf5f2('0x23')](_0xf5f2('0x24'),_0x23e23a,_0xf5f2('0x25'));logger[_0xf5f2('0x26')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x23e23a,_0xf5f2('0x25'),JSON[_0xf5f2('0x27')](_0x4ff59b));if(_0x4ff59b['error']){if(_0x4ff59b['error'][_0xf5f2('0x28')]===0x1f4){logger[_0xf5f2('0x29')]('ChatInteraction,\x20%s,\x20%s',_0x23e23a,_0x4ff59b[_0xf5f2('0x29')][_0xf5f2('0x2a')]);return _0x11f702(_0x4ff59b[_0xf5f2('0x29')][_0xf5f2('0x2a')]);}logger[_0xf5f2('0x29')]('ChatInteraction,\x20%s,\x20%s',_0x23e23a,_0x4ff59b[_0xf5f2('0x29')][_0xf5f2('0x2a')]);return _0x395a5a(_0x4ff59b[_0xf5f2('0x29')][_0xf5f2('0x2a')]);}else{logger[_0xf5f2('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x23e23a,'request\x20sent');_0x395a5a(_0x4ff59b[_0xf5f2('0x2b')][_0xf5f2('0x2a')]);}})[_0xf5f2('0x2c')](function(_0x1a5bb3){logger[_0xf5f2('0x29')](_0xf5f2('0x24'),_0x23e23a,_0x1a5bb3);_0x11f702(_0x1a5bb3);});});}function respondWithStatusCode(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0xcc;return function(_0x294414){if(_0x294414){return _0x13a3be['sendStatus'](_0x281ec8);}return _0x13a3be[_0xf5f2('0x2d')](_0x281ec8)[_0xf5f2('0x2e')]();};}function respondWithResult(_0x375ca8,_0x31bfcb){_0x31bfcb=_0x31bfcb||0xc8;return function(_0x198c73){if(_0x198c73){return _0x375ca8[_0xf5f2('0x2d')](_0x31bfcb)['json'](_0x198c73);}};}function respondWithFilteredResult(_0x53cb96,_0x22c826){return function(_0x14c829){if(_0x14c829){var _0x11c771=typeof _0x22c826['offset']==='undefined'&&typeof _0x22c826[_0xf5f2('0x2f')]===_0xf5f2('0x30');var _0x17394a=_0x14c829[_0xf5f2('0x31')];var _0x1b381e=_0x11c771?0x0:_0x22c826['offset'];var _0x52e959=_0x11c771?_0x14c829[_0xf5f2('0x31')]:_0x22c826['offset']+_0x22c826[_0xf5f2('0x2f')];var _0x58a4df;if(_0x52e959>=_0x17394a){_0x52e959=_0x17394a;_0x58a4df=0xc8;}else{_0x58a4df=0xce;}_0x53cb96[_0xf5f2('0x2d')](_0x58a4df);return _0x53cb96[_0xf5f2('0x32')](_0xf5f2('0x33'),_0x1b381e+'-'+_0x52e959+'/'+_0x17394a)[_0xf5f2('0x34')](_0x14c829);}return null;};}function patchUpdates(_0x256bd9){return function(_0x277eee){try{jsonpatch[_0xf5f2('0x35')](_0x277eee,_0x256bd9,!![]);}catch(_0x2c0e05){return BPromise['reject'](_0x2c0e05);}return _0x277eee[_0xf5f2('0x36')]();};}function saveUpdates(_0x43e4ff,_0x4590ec){return function(_0x43c77d){if(_0x43c77d){return _0x43c77d[_0xf5f2('0x37')](_0x43e4ff)[_0xf5f2('0x22')](function(_0x297c0c){return _0x297c0c;});}return null;};}function removeEntity(_0x48d64d,_0x144646){return function(_0xf503e8){if(_0xf503e8){return _0xf503e8['destroy']()[_0xf5f2('0x22')](function(){_0x48d64d['status'](0xcc)[_0xf5f2('0x2e')]();});}};}function handleEntityNotFound(_0x3930fb,_0x2a2c31){return function(_0x2e3cca){if(!_0x2e3cca){_0x3930fb['sendStatus'](0x194);}return _0x2e3cca;};}function handleError(_0x5a98d7,_0x41088b){_0x41088b=_0x41088b||0x1f4;return function(_0x46ad4a){logger[_0xf5f2('0x29')](_0x46ad4a['stack']);if(_0x46ad4a[_0xf5f2('0x38')]){delete _0x46ad4a['name'];}_0x5a98d7[_0xf5f2('0x2d')](_0x41088b)['send'](_0x46ad4a);};}function getMustacheRender(_0x46f464,_0x456764){return Mustache['render'](_0x46f464,_[_0xf5f2('0x39')](_0x456764[_0xf5f2('0x3a')],{'contact':_0x456764[_0xf5f2('0x3b')],'message':_0x456764[_0xf5f2('0x2a')],'agent':_0x456764['agent'],'interaction':_0x456764['interaction'],'account':_0x456764[_0xf5f2('0x3c')]}))||'';}function getInteractionUsers(_0x140a11,_0x22b20c){return new BPromise(function(_0x2d4400,_0x2c7f65){try{if(_0x22b20c[_0x140a11['id']]){_0x140a11[_0xf5f2('0x3d')]=_[_0xf5f2('0x3e')](_0x22b20c[_0x140a11['id']],function(_0x4c0ac7){return{'id':_0x4c0ac7['id'],'fullname':_0x4c0ac7[_0xf5f2('0x3f')]};});}}catch(_0x3b4ea6){_0x2c7f65(_0x3b4ea6);}_0x2d4400(_0x140a11);});}function getInteractionTags(_0x536501,_0xc6a1ae){return new BPromise(function(_0x3f3895,_0x71b0e7){try{if(_0x536501[_0xf5f2('0x40')]){_0x536501[_0xf5f2('0x41')]=[];_0x536501[_0xf5f2('0x40')][_0xf5f2('0x42')](',')[_0xf5f2('0x43')](function(_0x574f24){_0x536501[_0xf5f2('0x41')][_0xf5f2('0x44')](_0xc6a1ae[_0x574f24]);});}delete _0x536501[_0xf5f2('0x40')];}catch(_0x4a8e39){_0x71b0e7(_0x4a8e39);}_0x3f3895(_0x536501);});}function updateChatInteraction(_0x509dbc,_0x59eb00,_0x76d21b){return new BPromise(function(_0x2ad13c,_0x4c8d8e){return getInteractionUsers(_0x509dbc,_0x76d21b)[_0xf5f2('0x22')](function(_0xeed03d){return getInteractionTags(_0xeed03d,_0x59eb00);})[_0xf5f2('0x22')](function(_0x31f86c){_0x2ad13c(_0x31f86c);})[_0xf5f2('0x2c')](function(_0x2b3b1c){_0x4c8d8e(_0x2b3b1c);});});}exports[_0xf5f2('0x45')]=function(_0x212e90,_0x40c322){var _0x106062={},_0x444317={},_0x4773cd={'count':0x0,'rows':[]};var _0x4252a3=_[_0xf5f2('0x3e')](db['ChatInteraction'][_0xf5f2('0x46')],function(_0x578c93){return{'name':_0x578c93[_0xf5f2('0x47')],'type':_0x578c93[_0xf5f2('0x48')][_0xf5f2('0x49')]};});_0x444317[_0xf5f2('0x4a')]=_[_0xf5f2('0x3e')](_0x4252a3,_0xf5f2('0x38'));_0x444317['query']=_[_0xf5f2('0x4b')](_0x212e90[_0xf5f2('0x4c')]);_0x444317[_0xf5f2('0x4d')]=_[_0xf5f2('0x4e')](_0x444317[_0xf5f2('0x4a')],_0x444317[_0xf5f2('0x4c')]);_0x106062[_0xf5f2('0x4f')]=_[_0xf5f2('0x4e')](_0x444317['model'],qs[_0xf5f2('0x50')](_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x50')]));_0x106062['attributes']=_0x106062[_0xf5f2('0x4f')][_0xf5f2('0x51')]?_0x106062[_0xf5f2('0x4f')]:_0x444317['model'];if(!_0x212e90['query'][_0xf5f2('0x52')](_0xf5f2('0x53'))){_0x106062['limit']=qs[_0xf5f2('0x2f')](_0x212e90['query'][_0xf5f2('0x2f')]);_0x106062['offset']=qs[_0xf5f2('0x54')](_0x212e90['query'][_0xf5f2('0x54')]);}_0x106062[_0xf5f2('0x55')]=qs[_0xf5f2('0x56')](_0x212e90[_0xf5f2('0x4c')]['sort']);_0x106062[_0xf5f2('0x57')]=qs[_0xf5f2('0x4d')](_['pick'](_0x212e90['query'],_0x444317[_0xf5f2('0x4d')]),_0x4252a3);var _0x3dc0c4=[];var _0x57782c=squel[_0xf5f2('0x58')]()[_0xf5f2('0x59')]('id')[_0xf5f2('0x59')](_0xf5f2('0x38'))['field']('color')[_0xf5f2('0x5a')](_0xf5f2('0x5b'));var _0x4b62fc=squel[_0xf5f2('0x58')]()[_0xf5f2('0x59')](_0xf5f2('0x5c'))[_0xf5f2('0x59')](_0xf5f2('0x5d'))[_0xf5f2('0x59')](_0xf5f2('0x5e'))['from']('user_has_chat_interactions','ui')[_0xf5f2('0x5f')](_0xf5f2('0x60'),'u',_0xf5f2('0x61'));var _0x46a905=squel[_0xf5f2('0x58')]()['from'](_0xf5f2('0x62'),'i')[_0xf5f2('0x5f')](_0xf5f2('0x63'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xf5f2('0x5f')]('users','o',_0xf5f2('0x64'))[_0xf5f2('0x5f')](_0xf5f2('0x65'),'a',_0xf5f2('0x66'))['left_join']('chat_messages','me',_0xf5f2('0x67'))['left_join'](_0xf5f2('0x68'),'it',_0xf5f2('0x69'))['left_join'](_0xf5f2('0x5b'),'t',_0xf5f2('0x6a'));var _0x2a8f6d=squel['expr']();var _0x397b99=[];var _0xcf7a50=squel[_0xf5f2('0x6b')]();var _0x4579f4;if(_0x212e90['query'][_0xf5f2('0x6c')]){_0x4579f4=as['parseSearch'](_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x6c')]);var _0x2e6f5d=_0x4579f4[_0xf5f2('0x6d')];for(var _0x9f210e=0x0;_0x9f210e<_0x4579f4['conditions'][_0xf5f2('0x51')];_0x9f210e++){var _0xacd80=_0x4579f4[_0xf5f2('0x6e')][_0x9f210e];var _0x212639='i';var _0x2c5733=_['find'](_0x4252a3,[_0xf5f2('0x38'),_0xacd80['field']]);if(!_0x2c5733){switch(_0xacd80['field']){case _0xf5f2('0x6f'):if(_0xacd80['value']==0x1){_0x46a905[_0xf5f2('0x70')]('`'+_0xacd80[_0xf5f2('0x59')]+_0xf5f2('0x71'));}else{_0x46a905[_0xf5f2('0x70')]('`'+_0xacd80['field']+_0xf5f2('0x72'));}break;case _0xf5f2('0x73'):if(_0xacd80[_0xf5f2('0x74')]===_0xf5f2('0x75')){if(_0xacd80[_0xf5f2('0x76')][_0xf5f2('0x42')]('\x20')[_0xf5f2('0x51')]>0x1){_0x2a8f6d[_0x2e6f5d]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf5f2('0x77')](_0xacd80[_0xf5f2('0x76')]),null);}else{var _0xb39a6e='%'+_0xacd80[_0xf5f2('0x76')]+'%';_0x2a8f6d[_0x2e6f5d]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0xb39a6e,_0xb39a6e,_0xb39a6e);}}else{_0x2c5733=_[_0xf5f2('0x78')](_0x4252a3,['name',_0xf5f2('0x79')]);_0xacd80[_0xf5f2('0x59')]='ContactId';_0x5a143f=as[_0xf5f2('0x7a')](_0x212639,_0x2c5733[_0xf5f2('0x48')],_0xacd80);_0x2a8f6d[_0x2e6f5d](_0x5a143f[_0xf5f2('0x7b')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x7c')],_0x5a143f['value'][_0xf5f2('0x2e')]);}break;case _0xf5f2('0x7d'):var _0x3a0e75=_0xacd80[_0xf5f2('0x76')][_0xf5f2('0x42')](',')[_0xf5f2('0x3e')](function(_0x53284f){return Number(_0x53284f);});_0x3a0e75[_0xf5f2('0x43')](function(_0x3f475e){_0xcf7a50['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3f475e+',%');});_0x397b99=_[_0xf5f2('0x7e')](_0x397b99,_0x3a0e75);break;case _0xf5f2('0x7f'):if(_0xacd80[_0xf5f2('0x74')]==='$substring'){_0x2a8f6d[_0x2e6f5d]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0xacd80['value']+'%',null);}else{_0x2c5733=_[_0xf5f2('0x78')](_0x4252a3,[_0xf5f2('0x38'),_0xf5f2('0x80')]);_0xacd80[_0xf5f2('0x59')]=_0xf5f2('0x80');_0x5a143f=as['buildExpression'](_0x212639,_0x2c5733[_0xf5f2('0x48')],_0xacd80);_0x2a8f6d[_0x2e6f5d](_0x5a143f[_0xf5f2('0x7b')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x7c')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x2e')]);}break;case _0xf5f2('0x3a'):_0x5a143f=as[_0xf5f2('0x7a')]('me',null,_0xacd80);_0x2a8f6d[_0x2e6f5d](_0x5a143f[_0xf5f2('0x7b')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x7c')],_0x5a143f['value']['end']);break;}}else{var _0x5a143f=as[_0xf5f2('0x7a')](_0x212639,_0x2c5733[_0xf5f2('0x48')],_0xacd80);_0x2a8f6d[_0x2e6f5d](_0x5a143f[_0xf5f2('0x7b')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x7c')],_0x5a143f['value'][_0xf5f2('0x2e')]);}}}else{var _0x43c732=_(_0x212e90[_0xf5f2('0x4c')])[_0xf5f2('0x4b')]()[_0xf5f2('0x3e')](function(_0x55748d){return _[_0xf5f2('0x81')](_0x4252a3,[_0xf5f2('0x38'),_0x55748d])?_0x55748d:undefined;})['compact']()[_0xf5f2('0x76')]();if(!_[_0xf5f2('0x82')](_0x43c732)){_0x43c732[_0xf5f2('0x43')](function(_0x30ac41){if(_0x30ac41==='ChatWebsiteId'){_0x46a905[_0xf5f2('0x57')](_0xf5f2('0x83'),[][_0xf5f2('0x84')](_0x212e90[_0xf5f2('0x4c')][_0x30ac41]));}else if(_0x30ac41===_0xf5f2('0x85')){var _0x4f47e1=JSON['parse'](_0x212e90[_0xf5f2('0x4c')][_0x30ac41])[_0xf5f2('0x86')];var _0x17eb69=JSON[_0xf5f2('0x87')](_0x212e90['query'][_0x30ac41])['$lte'];_0x46a905[_0xf5f2('0x57')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f47e1,_0x17eb69);}else{if(_0x212e90['query'][_0x30ac41]==='null'){_0x46a905['where']('i.'+_0x30ac41+_0xf5f2('0x88'));}else{_0x46a905[_0xf5f2('0x57')]('i.'+_0x30ac41+_0xf5f2('0x89'),_0x212e90[_0xf5f2('0x4c')][_0x30ac41]);}}});}if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8a')]){if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8a')]==0x1){_0x46a905[_0xf5f2('0x70')](_0xf5f2('0x8b'));}else{_0x46a905[_0xf5f2('0x70')](_0xf5f2('0x8c'));}}if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8d')]){_0x397b99=_[_0xf5f2('0x8e')](_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8d')])?_0x212e90[_0xf5f2('0x4c')]['tag']:new Array(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8d')]);_0x397b99[_0xf5f2('0x43')](function(_0x2811ad){_0xcf7a50['or'](_0xf5f2('0x8f'),'%,'+_0x2811ad+',%');});}if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x90')]){var _0xcf48eb=_0x212e90['query'][_0xf5f2('0x90')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0xcf48eb)){_0x2a8f6d['or']('i.id\x20LIKE\x20?',_0xcf48eb+'%');}else{_0x2a8f6d['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0xcf48eb))['or'](_0xf5f2('0x91'),_0xcf48eb+'%');}}}_0x46a905[_0xf5f2('0x57')](_0x2a8f6d);_0x46a905[_0xf5f2('0x92')](_0xf5f2('0x93'));var _0x145d4d={'type':db[_0xf5f2('0x94')]['QueryTypes']['SELECT'],'raw':!![]};var _0x2fb1a6=_0x46a905['clone']();_0x2fb1a6[_0xf5f2('0x59')](_0xf5f2('0x93'));_0x2fb1a6['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf5f2('0x6f'));if(_0x106062[_0xf5f2('0x55')]){_0x106062['order'][_0xf5f2('0x43')](function(_0x388b32){var _0x49e363=_0x388b32[0x0]===_0xf5f2('0x95')?_0x388b32[0x0]:'i.'+_0x388b32[0x0];_0x46a905[_0xf5f2('0x55')](_0x49e363,_0x388b32[0x1]===_0xf5f2('0x96')?![]:!![]);});}if(!_['isEmpty'](_0x397b99)){_0x46a905[_0xf5f2('0x70')](_0xcf7a50);_0x2fb1a6[_0xf5f2('0x57')](_0xf5f2('0x97'),_0x397b99);}BPromise[_0xf5f2('0x98')]()[_0xf5f2('0x22')](function(){if(!_0x4579f4){if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x99')])return;_0x2fb1a6[_0xf5f2('0x57')](_0xf5f2('0x9a'));_0x46a905[_0xf5f2('0x57')](_0xf5f2('0x9a'));return;}if(_0x212e90[_0xf5f2('0x9b')][_0xf5f2('0x9c')]!==_0xf5f2('0x9d'))return;return _0x212e90[_0xf5f2('0x9b')][_0xf5f2('0x9e')]({'attributes':['id'],'raw':!![]})[_0xf5f2('0x22')](function(_0x29a9d4){if(_[_0xf5f2('0x82')](_0x29a9d4)){_0x2fb1a6[_0xf5f2('0x57')](_0xf5f2('0x9f'));_0x46a905['where'](_0xf5f2('0x9f'));}else{_0x2fb1a6[_0xf5f2('0x57')]('i.ChatWebsiteId\x20IN\x20?',_[_0xf5f2('0x3e')](_0x29a9d4,'id'));_0x46a905[_0xf5f2('0x57')]('i.ChatWebsiteId\x20IN\x20?',_[_0xf5f2('0x3e')](_0x29a9d4,'id'));}});})[_0xf5f2('0x22')](function(){if(_0x212e90[_0xf5f2('0x9b')]['role']==='agent'&&!_0x4579f4&&!_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x99')])return[];return db[_0xf5f2('0xa0')]['query'](_0x2fb1a6['toString'](),_0x145d4d);})[_0xf5f2('0x22')](function(_0xcdc6fd){_0x4773cd[_0xf5f2('0x31')]=_0xcdc6fd['length'];if(_0x4773cd['count']===0x0)return[];return db['sequelize']['query'](_0x57782c['toString'](),_0x145d4d)[_0xf5f2('0x22')](function(_0x561bab){_0x3dc0c4=_[_0xf5f2('0xa1')](_0x561bab,'id');_0x145d4d=_[_0xf5f2('0x39')](_0x145d4d,{'model':db[_0xf5f2('0xa2')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x50')]){_0x106062[_0xf5f2('0x4f')][_0xf5f2('0x43')](function(_0x40e921){_0x46a905[_0xf5f2('0x59')]('i.'+_0x40e921);});}else{_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xa3'),_0xf5f2('0x6f'));_0x46a905[_0xf5f2('0x59')]('a.key',_0xf5f2('0xa4'));_0x46a905[_0xf5f2('0x59')]('a.mandatoryDisposition',_0xf5f2('0xa5'));_0x46a905[_0xf5f2('0x59')]('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',_0xf5f2('0x95'));_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xa6'));_0x46a905['field'](_0xf5f2('0xa7'),_0xf5f2('0xa8'));_0x46a905['field'](_0xf5f2('0xa9'),_0xf5f2('0xaa'));_0x46a905[_0xf5f2('0x59')]('c.email',_0xf5f2('0xab'));_0x46a905['field'](_0xf5f2('0xac'),'Contact.phone');_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xad'),_0xf5f2('0xae'));_0x46a905[_0xf5f2('0x59')]('c.fax',_0xf5f2('0xaf'));_0x46a905['field']('o.fullname','Owner.fullname');_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xb0'),'Owner.internal');_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xb1'),_0xf5f2('0x40'));}if(_0x106062[_0xf5f2('0x2f')])_0x46a905[_0xf5f2('0x2f')](_0x106062[_0xf5f2('0x2f')]);if(_0x106062['offset'])_0x46a905[_0xf5f2('0x54')](_0x106062[_0xf5f2('0x54')]);return db['sequelize'][_0xf5f2('0x4c')](_0x46a905[_0xf5f2('0xb2')](),_0x145d4d);})['then'](function(_0x32301a){if(_0x32301a[_0xf5f2('0x51')]>0x0)_0x4b62fc[_0xf5f2('0x57')](_0xf5f2('0xb3'),_[_0xf5f2('0x3e')](_0x32301a,'id'));return db[_0xf5f2('0xa0')]['query'](_0x4b62fc[_0xf5f2('0xb2')](),_0x145d4d)[_0xf5f2('0x22')](function(_0x13fcb0){var _0x792c75=_[_0xf5f2('0xb4')](_0x13fcb0,_0xf5f2('0xb5'));var _0x162c13=[];_0x32301a[_0xf5f2('0x43')](function(_0x3e4e40){_0x162c13['push'](updateChatInteraction(_0x3e4e40,_0x3dc0c4,_0x792c75));});return BPromise[_0xf5f2('0xb6')](_0x162c13);});});})[_0xf5f2('0x22')](function(_0xdbb2cd){_0x4773cd[_0xf5f2('0xb7')]=_0xdbb2cd;return _0x4773cd;})[_0xf5f2('0x22')](respondWithFilteredResult(_0x40c322,_0x106062))[_0xf5f2('0x2c')](handleError(_0x40c322,null));};exports[_0xf5f2('0xb8')]=function(_0x56f4b4,_0x33cfe7){var _0x40d0eb={'raw':![],'where':{'id':_0x56f4b4['params']['id']}},_0x4c138c={};_0x4c138c[_0xf5f2('0x4a')]=_[_0xf5f2('0x4b')](db[_0xf5f2('0xa2')][_0xf5f2('0x46')]);_0x4c138c['query']=_[_0xf5f2('0x4b')](_0x56f4b4[_0xf5f2('0x4c')]);_0x4c138c[_0xf5f2('0x4d')]=_[_0xf5f2('0x4e')](_0x4c138c[_0xf5f2('0x4a')],_0x4c138c['query']);_0x40d0eb[_0xf5f2('0x4f')]=_[_0xf5f2('0x4e')](_0x4c138c['model'],qs[_0xf5f2('0x50')](_0x56f4b4[_0xf5f2('0x4c')][_0xf5f2('0x50')]));_0x40d0eb[_0xf5f2('0x4f')]=_0x40d0eb['attributes'][_0xf5f2('0x51')]?_0x40d0eb[_0xf5f2('0x4f')]:_0x4c138c[_0xf5f2('0x4a')];if(_0x56f4b4['query']['includeAll']){_0x40d0eb[_0xf5f2('0xb9')]=[{'all':!![]}];}_0x40d0eb=_[_0xf5f2('0x39')]({},_0x40d0eb,_0x56f4b4[_0xf5f2('0xba')]);return db[_0xf5f2('0xa2')][_0xf5f2('0x78')](_0x40d0eb)[_0xf5f2('0x22')](handleEntityNotFound(_0x33cfe7,null))['then'](respondWithResult(_0x33cfe7,null))[_0xf5f2('0x2c')](handleError(_0x33cfe7,null));};exports['create']=function(_0x151f13,_0x1624a4){return db[_0xf5f2('0xa2')][_0xf5f2('0xbb')](_0x151f13[_0xf5f2('0x3a')],{})[_0xf5f2('0x22')](respondWithResult(_0x1624a4,0xc9))['catch'](handleError(_0x1624a4,null));};exports[_0xf5f2('0x37')]=function(_0x409ed1,_0x457b53){if(_0x409ed1[_0xf5f2('0x3a')]['id']){delete _0x409ed1[_0xf5f2('0x3a')]['id'];}return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0x409ed1['params']['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x457b53,null))['then'](saveUpdates(_0x409ed1['body'],null))['then'](respondWithResult(_0x457b53,null))[_0xf5f2('0x2c')](handleError(_0x457b53,null));};exports[_0xf5f2('0xbc')]=function(_0x568806,_0x3487df){return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0x568806[_0xf5f2('0xbd')]['id']}})['then'](handleEntityNotFound(_0x3487df,null))[_0xf5f2('0x22')](removeEntity(_0x3487df,null))[_0xf5f2('0x2c')](handleError(_0x3487df,null));};exports[_0xf5f2('0xbe')]=function(_0x5d3ca7,_0x29f7bd){return db[_0xf5f2('0xa2')]['describe']()[_0xf5f2('0x22')](respondWithResult(_0x29f7bd,null))[_0xf5f2('0x2c')](handleError(_0x29f7bd,null));};exports[_0xf5f2('0xbf')]=function(_0x1583bb,_0x176974){var _0x8b591c=_0x1583bb[_0xf5f2('0xbd')]['id'];var _0x2c242b;var _0x155007;var _0x4782da;return db[_0xf5f2('0xa2')]['findOne']({'where':{'id':_0x8b591c}})[_0xf5f2('0x22')](function(_0x31dbfa){_0x2c242b=_0x31dbfa;return db['ChatWebsite'][_0xf5f2('0xc0')]({'where':{'id':_0x31dbfa['ChatWebsiteId']},'attributes':['id',_0xf5f2('0xc1'),_0xf5f2('0xc2'),_0xf5f2('0xc3'),_0xf5f2('0xc4'),'vidaooMetadata'],'raw':!![]});})[_0xf5f2('0x22')](function(_0x5a104b){if(_0x5a104b&&_0x5a104b[_0xf5f2('0xc1')]&&_0x5a104b['vidaooEscalation']){_0x155007=_0x5a104b;var _0x3310cb={'interaction':{'id':_0x8b591c},'agent':{'id':_0x1583bb[_0xf5f2('0x9b')]['id'],'name':_0x1583bb['user'][_0xf5f2('0x38')],'fullname':_0x1583bb[_0xf5f2('0x9b')][_0xf5f2('0x3f')],'email':_0x1583bb[_0xf5f2('0x9b')][_0xf5f2('0xc5')]},'contact':_0x1583bb[_0xf5f2('0x3a')]['contact'],'account':_0x1583bb['body'][_0xf5f2('0x3c')]};var _0x17e1eb={'rejectUnauthorized':![],'method':'POST','url':_0xf5f2('0xc6'),'headers':{'X-APIKEY':_0x5a104b[_0xf5f2('0xc1')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1583bb[_0xf5f2('0x9b')][_0xf5f2('0xc5')]],'buttons':null,'topic':_0x155007[_0xf5f2('0xc3')],'note':_[_0xf5f2('0xc7')](_0x155007[_0xf5f2('0xc4')])?null:getMustacheRender(_0x155007['vidaooNote'],_0x3310cb),'metadata':null},'redirect':_0xf5f2('0xc8'),'json':!![]};try{if(!_['isNull'](_0x155007[_0xf5f2('0xc9')])){var _0x5ec0f3=getMustacheRender(_0x155007[_0xf5f2('0xc9')],_0x3310cb);var _0x4f2531=JSON[_0xf5f2('0x87')](_0x5ec0f3);_0x17e1eb['body']['metadata']=_0x4f2531;}}catch(_0x2c285c){throw new db[(_0xf5f2('0x94'))]['ValidationError'](_0xf5f2('0xca'));}return rp(_0x17e1eb);}else{throw new db[(_0xf5f2('0x94'))][(_0xf5f2('0xcb'))](_0xf5f2('0xcc'));}})[_0xf5f2('0x22')](function(_0x25af1e){_0x4782da=_0x25af1e;if(_0x4782da['id']){var _0xd0b5d={'body':_0x4782da[_0xf5f2('0xcd')],'ChatWebsiteId':_0x155007['id'],'ChatInteractionId':_0x2c242b['id'],'direction':'out','UserId':_0x1583bb['user']['id']};return db[_0xf5f2('0xce')]['create'](_0xd0b5d,{});}else{throw new db[(_0xf5f2('0x94'))][(_0xf5f2('0xcb'))](_0xf5f2('0xcf'));}})[_0xf5f2('0x22')](function(){return _0x2c242b[_0xf5f2('0xd0')]({'vidaooSessionId':_0x4782da['id']});})[_0xf5f2('0x22')](respondWithResult(_0x176974,null))[_0xf5f2('0x2c')](handleError(_0x176974,null));};exports[_0xf5f2('0xd1')]=function(_0x28f65b,_0x16cbd3){if(_0x28f65b[_0xf5f2('0x3a')]['id']){delete _0x28f65b[_0xf5f2('0x3a')]['id'];}return db['ChatInteraction'][_0xf5f2('0x78')]({'where':{'id':_0x28f65b['params']['id']},'include':[{'model':db[_0xf5f2('0xd2')],'as':_0xf5f2('0x73')}]})[_0xf5f2('0x22')](handleEntityNotFound(_0x16cbd3,null))[_0xf5f2('0x22')](saveUpdates(_0x28f65b[_0xf5f2('0x3a')],null))[_0xf5f2('0x22')](respondWithResult(_0x16cbd3,null))[_0xf5f2('0x2c')](handleError(_0x16cbd3,null));};exports[_0xf5f2('0xd3')]=function(_0x29db4f,_0x377c68,_0xe0f288){if(_0x29db4f['body']['id']){delete _0x29db4f[_0xf5f2('0x3a')]['id'];}return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0x29db4f[_0xf5f2('0xbd')]['id']}})[_0xf5f2('0x22')](function(_0x3f8794){if(!_0x3f8794){logger[_0xf5f2('0x29')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xf5f2('0xd3'),0x194,_0xf5f2('0xd4'));_0x377c68[_0xf5f2('0xd5')](0x194);}else{if(_0x3f8794[_0xf5f2('0x80')]){throw new db[(_0xf5f2('0x94'))][(_0xf5f2('0xcb'))](_0xf5f2('0xd6'));}}return _0x3f8794;})[_0xf5f2('0x22')](function(_0x356155){if(_0x356155){return _0x356155[_0xf5f2('0x37')]({'closed':_0x29db4f[_0xf5f2('0x3a')][_0xf5f2('0xd7')],'disposition':_0x29db4f[_0xf5f2('0x3a')][_0xf5f2('0xd8')]})[_0xf5f2('0x22')](function(_0x654b1b){return _0x654b1b;});}})['then'](function(_0x25566a){return respondWithRpcPromise(_0xf5f2('0xd9'),'abandon',_0x29db4f['body'],client9004);})[_0xf5f2('0x22')](respondWithResult(_0x377c68,null))[_0xf5f2('0x2c')](handleError(_0x377c68,null));};exports[_0xf5f2('0xda')]=function(_0x2c8f4c,_0x529d6f,_0x28cc){_0x2c8f4c[_0xf5f2('0x3a')][_0xf5f2('0x38')]=_0x2c8f4c[_0xf5f2('0xdb')][_0xf5f2('0xdc')];_0x2c8f4c[_0xf5f2('0x3a')]['basename']=_0x2c8f4c[_0xf5f2('0xdb')]['filename'];_0x2c8f4c['body'][_0xf5f2('0x48')]=_0x2c8f4c[_0xf5f2('0xdb')][_0xf5f2('0xdd')];return db[_0xf5f2('0xde')][_0xf5f2('0xbb')](_0x2c8f4c[_0xf5f2('0x3a')])[_0xf5f2('0x22')](respondWithResult(_0x529d6f,0xc9))['catch'](handleError(_0x529d6f,null));};exports[_0xf5f2('0xdf')]=function(_0x3a2862,_0x2c1160,_0x5e6c83){return db[_0xf5f2('0xa2')]['findOne']({'where':{'id':_0x3a2862['params']['id']},'raw':!![]})[_0xf5f2('0x22')](handleEntityNotFound(_0x2c1160,null))['then'](function(_0x2389b7){if(_0x2389b7){if(_0x2389b7[_0xf5f2('0xd7')]){return _0x2c1160['status'](0x193)[_0xf5f2('0x34')]({'status':0x193,'message':_0xf5f2('0xe0')});}return db['Attachment'][_0xf5f2('0xc0')]({'where':{'id':_0x3a2862[_0xf5f2('0x4c')][_0xf5f2('0xe1')]},'raw':!![]})[_0xf5f2('0x22')](handleEntityNotFound(_0x2c1160,null));}})[_0xf5f2('0x22')](function(_0x47a28a){if(_0x47a28a){var _0x182fa7=_0x47a28a[_0xf5f2('0xe2')]!==null;var _0x4d9048=path['join'](config[_0xf5f2('0xe3')],_0xf5f2('0xe4'));if(_0x182fa7){_0x4d9048=path[_0xf5f2('0xe5')](_0x4d9048,_0xf5f2('0xe6'));}var _0x1f51d8=path[_0xf5f2('0xe5')](_0x4d9048,_0x47a28a[_0xf5f2('0xe7')]);return _0x2c1160[_0xf5f2('0xe8')](_0x1f51d8);}})['catch'](handleError(_0x2c1160,null));};exports['close']=function(_0xc86ed5,_0x5be398){var _0x34abb6=null;var _0x235c30=null;var _0x15b060=null;var _0x422e88=null;if(_0xc86ed5['body']['id']){delete _0xc86ed5[_0xf5f2('0x3a')]['id'];}if(_0xc86ed5[_0xf5f2('0x3a')][_0xf5f2('0xe9')]){_0x422e88=path[_0xf5f2('0xe5')](config[_0xf5f2('0xe3')],'server/files/chat/upload/',util[_0xf5f2('0xea')](_0xf5f2('0xeb'),Date[_0xf5f2('0xec')]()));_0xc86ed5[_0xf5f2('0x3a')][_0xf5f2('0xed')]=_0x422e88;}return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0xc86ed5[_0xf5f2('0xbd')]['id']},'include':[{'model':db[_0xf5f2('0xce')],'as':_0xf5f2('0xee'),'include':[{'model':db[_0xf5f2('0x7f')],'as':_0xf5f2('0x7f')}]}]})['then'](handleEntityNotFound(_0x5be398,null))[_0xf5f2('0x22')](saveUpdates(_0xc86ed5['body'],null))[_0xf5f2('0x22')](function(_0x349efe){if(_0x349efe){_0x34abb6=_0x349efe;return db[_0xf5f2('0xef')][_0xf5f2('0x78')]({'where':{'id':_0x34abb6[_0xf5f2('0x99')]}});}})[_0xf5f2('0x22')](function(_0x2cd0b7){if(_0x2cd0b7){_0x15b060=_0x2cd0b7;return db[_0xf5f2('0xd2')][_0xf5f2('0x78')]({'where':{'id':_0x34abb6[_0xf5f2('0x79')]}});}})[_0xf5f2('0x22')](function(_0x2b6f46){if(_0x2b6f46){_0x235c30=_0x2b6f46;if(_0x422e88){var _0xf53f16=null;for(var _0xd45a63=0x1;_0xd45a63<_0x34abb6[_0xf5f2('0xee')][_0xf5f2('0x51')];++_0xd45a63){_0xf53f16=_0x34abb6[_0xf5f2('0xee')][_0xd45a63];var _0x33f987=_0xf53f16['UserId']?util[_0xf5f2('0xea')]('%s%d',_0x15b060['agentAlias'],_0xf53f16[_0xf5f2('0x80')]):_0xf5f2('0xf0');var _0x53e85c=_0xc86ed5[_0xf5f2('0x3a')][_0xf5f2('0xf1')]||util[_0xf5f2('0xea')](_0xf5f2('0xf2'),_0xf5f2('0xf3'),_0xf53f16[_0xf5f2('0x79')]);switch(_0x15b060[_0xf5f2('0xf4')]){case _0xf5f2('0xf5'):_0x33f987=_0xf53f16['UserId']?util[_0xf5f2('0xea')](_0xf5f2('0xf2'),_0x15b060[_0xf5f2('0xf6')],_0xf53f16['UserId']):_0xf5f2('0xf0');break;case _0xf5f2('0xf7'):_0x33f987=_0xf53f16[_0xf5f2('0x80')]?_0xf53f16[_0xf5f2('0x7f')]['alias']||_0xf53f16['User'][_0xf5f2('0x3f')]:_0xf5f2('0xf0');break;case _0xf5f2('0xf8'):_0x33f987=_0xf53f16[_0xf5f2('0x80')]?_0xf53f16[_0xf5f2('0x7f')][_0xf5f2('0x3f')]:_0xf5f2('0xf0');break;default:_0x33f987=_0xf53f16[_0xf5f2('0x80')]?util[_0xf5f2('0xea')](_0xf5f2('0xf2'),_0x15b060['agentAlias'],_0xf53f16[_0xf5f2('0x80')]):_0xf5f2('0xf0');}var _0x3881cd=util['format'](_0xf5f2('0xf9'),moment(_0xf53f16[_0xf5f2('0x85')])['format'](_0xf5f2('0xfa')),_0xf53f16['direction']==='in'?_0x53e85c:_0x33f987,_0xf53f16[_0xf5f2('0x3a')]);if(!_0xf53f16[_0xf5f2('0xfb')]){fs['appendFileSync'](_0x422e88,_0x3881cd);}}return db[_0xf5f2('0xfc')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xf5f2('0xfd')],'as':_0xf5f2('0xfe'),'raw':!![]}]});}}})['then'](function(_0x3971ee){if(_0x3971ee&&_0x3971ee[_0xf5f2('0xfe')]&&_0xc86ed5[_0xf5f2('0x3a')]){var _0xfeccdd={'tls':{'rejectUnauthorized':![]}};if(_0x3971ee[_0xf5f2('0xfe')]['service']){_0xfeccdd[_0xf5f2('0xff')]=_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0xff')];}else{_0xfeccdd[_0xf5f2('0x100')]=_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0x100')];_0xfeccdd[_0xf5f2('0x101')]=_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0x101')];_0xfeccdd['secure']=_0x3971ee[_0xf5f2('0xfe')]['secure'];}if(_0x3971ee['Smtp'][_0xf5f2('0x102')]){_0xfeccdd[_0xf5f2('0x103')]={'user':_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0x9b')],'pass':_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0x104')]};}return respondWithRpcPromise(_0xf5f2('0x105'),_0xf5f2('0x106'),{'account':_0xfeccdd,'message':{'from':util[_0xf5f2('0xea')](_0xf5f2('0x107'),_0x3971ee['name'],_0x3971ee['email']||_0x3971ee['Smtp'][_0xf5f2('0x9b')]),'to':_0xc86ed5['body'][_0xf5f2('0xe9')],'subject':_0xf5f2('0x108'),'text':util[_0xf5f2('0xea')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0xc86ed5[_0xf5f2('0x3a')][_0xf5f2('0xe9')]),'attachments':[{'path':_0x422e88}]}})['then'](function(){return _0x34abb6;})['catch'](function(_0x4d0709){console[_0xf5f2('0x29')](_0x4d0709);});}else{return _0x34abb6;}})[_0xf5f2('0x22')](respondWithStatusCode(_0x5be398,0xc8))[_0xf5f2('0x2c')](handleError(_0x5be398,null));};exports['addMessage']=function(_0x2cfa84,_0x4a22fb,_0x7cf1b6){return db[_0xf5f2('0xce')][_0xf5f2('0x78')]({'where':{'id':_0x2cfa84['params']['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x4a22fb,null))['then'](function(_0x1b88b5){if(_0x1b88b5){return _0x1b88b5[_0xf5f2('0x109')](_0x2cfa84[_0xf5f2('0x3a')]['ids'],_[_0xf5f2('0x10a')](_0x2cfa84[_0xf5f2('0x3a')],['ids','id'])||{});}})[_0xf5f2('0x22')](respondWithResult(_0x4a22fb,null))[_0xf5f2('0x2c')](handleError(_0x4a22fb,null));};exports[_0xf5f2('0x10b')]=function(_0x29526c,_0x2a52e3,_0x439c9f){var _0x44adaa={'raw':![],'where':{}};var _0x3c7058={};var _0x3bcb44={'count':0x0,'rows':[]};return db[_0xf5f2('0xa2')][_0xf5f2('0xc0')]({'where':{'id':_0x29526c[_0xf5f2('0xbd')]['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x2a52e3,null))[_0xf5f2('0x22')](function(_0x23675a){if(_0x23675a){_0x3c7058[_0xf5f2('0x4a')]=_[_0xf5f2('0x4b')](db[_0xf5f2('0xce')][_0xf5f2('0x46')]);_0x3c7058[_0xf5f2('0x4c')]=_[_0xf5f2('0x4b')](_0x29526c[_0xf5f2('0x4c')]);_0x3c7058['filters']=_[_0xf5f2('0x4e')](_0x3c7058[_0xf5f2('0x4a')],_0x3c7058[_0xf5f2('0x4c')]);_0x44adaa[_0xf5f2('0x4f')]=_['intersection'](_0x3c7058[_0xf5f2('0x4a')],qs['fields'](_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x50')]));_0x44adaa[_0xf5f2('0x4f')]=_0x44adaa[_0xf5f2('0x4f')][_0xf5f2('0x51')]?_0x44adaa[_0xf5f2('0x4f')]:_0x3c7058[_0xf5f2('0x4a')];if(!_0x29526c['query']['hasOwnProperty'](_0xf5f2('0x53'))){_0x44adaa[_0xf5f2('0x2f')]=qs[_0xf5f2('0x2f')](_0x29526c[_0xf5f2('0x4c')]['limit']);_0x44adaa[_0xf5f2('0x54')]=qs[_0xf5f2('0x54')](_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x54')]);}_0x44adaa[_0xf5f2('0x55')]=qs[_0xf5f2('0x56')](_0x29526c['query']['sort']);_0x44adaa['where']=qs[_0xf5f2('0x4d')](_[_0xf5f2('0x10c')](_0x29526c[_0xf5f2('0x4c')],_0x3c7058['filters']));_0x44adaa[_0xf5f2('0x57')]['ChatInteractionId']=_0x23675a['id'];if(_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x90')]){_0x44adaa[_0xf5f2('0x57')]=_[_0xf5f2('0x39')](_0x44adaa[_0xf5f2('0x57')],{'$or':_[_0xf5f2('0x3e')](_0x44adaa[_0xf5f2('0x4f')],function(_0xece862){var _0x3b4121={};_0x3b4121[_0xece862]={'$like':'%'+_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x90')]+'%'};return _0x3b4121;})});}if(_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x86')]){var _0x2fa70d=_0x29526c['query'][_0xf5f2('0x86')][_0xf5f2('0x42')](',');var _0x31f018={};_0x31f018[_0x2fa70d[0x0]]={'$gte':moment(_0x2fa70d[0x1])[_0xf5f2('0xea')]('YYYY-MM-DD\x20HH:mm:ss')};_0x44adaa[_0xf5f2('0x57')]=_[_0xf5f2('0x39')](_0x44adaa[_0xf5f2('0x57')],_0x31f018);}_0x44adaa=_[_0xf5f2('0x39')]({},_0x44adaa,_0x29526c['options']);return db[_0xf5f2('0xce')]['count']({'where':_0x44adaa[_0xf5f2('0x57')]})[_0xf5f2('0x22')](function(_0x20bb46){_0x3bcb44[_0xf5f2('0x31')]=_0x20bb46;if(_0x29526c['query'][_0xf5f2('0x10d')]){_0x44adaa[_0xf5f2('0xb9')]=[{'all':!![]}];}return db[_0xf5f2('0xce')][_0xf5f2('0x10e')](_0x44adaa);})[_0xf5f2('0x22')](function(_0x889f0e){_0x3bcb44['rows']=_0x889f0e;return _0x3bcb44;});}})[_0xf5f2('0x22')](respondWithFilteredResult(_0x2a52e3,_0x44adaa))[_0xf5f2('0x2c')](handleError(_0x2a52e3,null));};exports[_0xf5f2('0x10f')]=function(_0x3dcf4e,_0x4212d4,_0x2ebe4f){var _0x34fc35={'where':{}},_0x29c1ca={},_0x2cf93e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xf5f2('0xc0')]({'where':{'id':_0x3dcf4e[_0xf5f2('0xbd')]['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x4212d4,null))[_0xf5f2('0x22')](function(_0x544db3){if(_0x544db3){_0x29c1ca['model']=_[_0xf5f2('0x4b')](db[_0xf5f2('0xce')][_0xf5f2('0x46')]);_0x29c1ca['query']=_['keys'](_0x3dcf4e[_0xf5f2('0x4c')]);_0x29c1ca[_0xf5f2('0x4d')]=_[_0xf5f2('0x4e')](_0x29c1ca[_0xf5f2('0x4a')],_0x29c1ca[_0xf5f2('0x4c')]);_0x34fc35[_0xf5f2('0x4f')]=_['intersection'](_0x29c1ca[_0xf5f2('0x4a')],qs[_0xf5f2('0x50')](_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x50')]));_0x34fc35['attributes']=_0x34fc35['attributes'][_0xf5f2('0x51')]?_0x34fc35['attributes']:_0x29c1ca[_0xf5f2('0x4a')];if(!_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x52')](_0xf5f2('0x53'))){_0x34fc35[_0xf5f2('0x2f')]=qs[_0xf5f2('0x2f')](_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x2f')]);_0x34fc35[_0xf5f2('0x54')]=qs[_0xf5f2('0x54')](_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x54')]);}_0x34fc35[_0xf5f2('0x55')]=qs[_0xf5f2('0x56')](_0x3dcf4e['query'][_0xf5f2('0x56')]);_0x34fc35[_0xf5f2('0x57')]=qs[_0xf5f2('0x4d')](_[_0xf5f2('0x10c')](_0x3dcf4e[_0xf5f2('0x4c')],_0x29c1ca['filters']));_0x34fc35[_0xf5f2('0x57')][_0xf5f2('0xb5')]=_0x544db3['id'];if(_0x3dcf4e['query'][_0xf5f2('0x90')]){_0x34fc35[_0xf5f2('0x57')]=_['merge'](_0x34fc35['where'],{'$or':_[_0xf5f2('0x3e')](_0x34fc35[_0xf5f2('0x4f')],function(_0x3e7f54){var _0x5e165c={};_0x5e165c[_0x3e7f54]={'$like':'%'+_0x3dcf4e['query'][_0xf5f2('0x90')]+'%'};return _0x5e165c;})});}_0x34fc35[_0xf5f2('0x57')][_0xf5f2('0xfb')]=![];if(_0x3dcf4e[_0xf5f2('0x4c')]['id']){_0x34fc35[_0xf5f2('0x57')]['id']={'$gt':_0x3dcf4e[_0xf5f2('0x4c')]['id']};}_0x34fc35=_[_0xf5f2('0x39')]({},_0x34fc35,_0x3dcf4e[_0xf5f2('0xba')]);return db[_0xf5f2('0xce')][_0xf5f2('0x31')]({'where':_0x34fc35['where']})[_0xf5f2('0x22')](function(_0x1c2842){_0x2cf93e['count']=_0x1c2842;_0x34fc35[_0xf5f2('0xb9')]=[];if(_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x110')]){_0x34fc35[_0xf5f2('0xb9')][_0xf5f2('0x44')]({'model':db['User'],'as':'User','attributes':['id',_0xf5f2('0x3f'),_0xf5f2('0x111')]});}if(_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x10d')]){_0x34fc35['include']=[{'all':!![]}];}return db[_0xf5f2('0xce')][_0xf5f2('0x10e')](_0x34fc35);})[_0xf5f2('0x22')](function(_0x3518f9){_0x2cf93e['rows']=_0x3518f9;return _0x2cf93e;});}})['then'](respondWithFilteredResult(_0x4212d4,_0x34fc35))['catch'](handleError(_0x4212d4,null));};exports['addTags']=function(_0x2e9d3b,_0x496802,_0x5be074){return db['ChatInteraction']['find']({'where':{'id':_0x2e9d3b[_0xf5f2('0xbd')]['id']}})['then'](handleEntityNotFound(_0x496802,null))['then'](function(_0x43150f){if(_0x43150f){return _0x43150f[_0xf5f2('0x112')](_0x2e9d3b[_0xf5f2('0x3a')][_0xf5f2('0x113')],_['omit'](_0x2e9d3b[_0xf5f2('0x3a')],[_0xf5f2('0x113'),'id'])||{})[_0xf5f2('0x114')](function(){return db[_0xf5f2('0x7d')][_0xf5f2('0x10e')]({'attributes':['id',_0xf5f2('0x38'),_0xf5f2('0x115')],'where':{'id':_0x2e9d3b['body'][_0xf5f2('0x113')]}});})[_0xf5f2('0x22')](function(_0x4f4af9){socket[_0xf5f2('0x116')](_0xf5f2('0x117'),{'id':Number(_0x2e9d3b[_0xf5f2('0xbd')]['id']),'tags':_0x4f4af9||[]});return{'id':Number(_0x2e9d3b[_0xf5f2('0xbd')]['id']),'tags':_0x4f4af9||[]};});}})[_0xf5f2('0x22')](respondWithResult(_0x496802,null))['catch'](handleError(_0x496802,null));};exports[_0xf5f2('0x118')]=function(_0x5f470f,_0x1f0a64,_0x2bbc23){return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0x5f470f['params']['id']}})['then'](handleEntityNotFound(_0x1f0a64,null))[_0xf5f2('0x22')](function(_0x179901){if(_0x179901){return _0x179901[_0xf5f2('0x118')](_0x5f470f[_0xf5f2('0x4c')][_0xf5f2('0x113')]);}})[_0xf5f2('0x22')](respondWithStatusCode(_0x1f0a64,null))[_0xf5f2('0x2c')](handleError(_0x1f0a64,null));};exports[_0xf5f2('0xe8')]=function(_0x5d8c6a,_0x4f777b){var _0x26dc8c=moment()[_0xf5f2('0x119')]()['toString']();var _0xb8bcf3=path[_0xf5f2('0xe5')](config[_0xf5f2('0xe3')],_0xf5f2('0x11a'),_0xf5f2('0x11b'),_0xf5f2('0x11c'));var _0x2bc493=path[_0xf5f2('0xe5')](config[_0xf5f2('0xe3')],_0xf5f2('0x11a'),_0xf5f2('0x11b'),_0xf5f2('0x11d'));var _0x212d97=path[_0xf5f2('0xe5')](_0xb8bcf3,_0x26dc8c);var _0x8ee5fd=util[_0xf5f2('0xea')](_0xf5f2('0x11e'),_0x5d8c6a['params']['id'],_0x26dc8c);var _0x3712e3=path['join'](_0xb8bcf3,_0x8ee5fd);var _0x56a1c3=[];_0x56a1c3['push']({'model':db['User'],'as':_0xf5f2('0x7f'),'attributes':['id',_0xf5f2('0x3f')],'raw':!![]});_0x56a1c3[_0xf5f2('0x44')]({'model':db[_0xf5f2('0xd2')],'as':'Contact','attributes':['id',_0xf5f2('0x11f'),_0xf5f2('0x120')],'raw':!![]});if(_0x5d8c6a['query']['attachments']){_0x56a1c3['push']({'model':db[_0xf5f2('0xde')],'as':_0xf5f2('0xde'),'raw':!![]});}var _0x5a6da7=[{'model':db[_0xf5f2('0xce')],'as':_0xf5f2('0xee'),'attributes':['id',_0xf5f2('0x3a'),'createdAt',_0xf5f2('0x121'),_0xf5f2('0xfb'),_0xf5f2('0x8a')],'include':_0x56a1c3}];_0x5a6da7[_0xf5f2('0x44')]({'model':db[_0xf5f2('0xef')],'as':_0xf5f2('0x122'),'attributes':['id','name']});_0x5a6da7['push']({'model':db[_0xf5f2('0x7f')],'as':_0xf5f2('0x123'),'attributes':['id','fullname']});return db['ChatInteraction'][_0xf5f2('0x78')]({'where':{'id':_0x5d8c6a['params']['id']},'include':_0x5a6da7})[_0xf5f2('0x22')](handleEntityNotFound(_0x4f777b,null))[_0xf5f2('0x22')](function(_0x2ee55f){if(_0x2ee55f){var _0x43ca34=_0x2ee55f[_0xf5f2('0x124')]({'plain':!![]});fs[_0xf5f2('0x125')](_0x212d97);var _0x220300={'channel':_0xf5f2('0x126'),'account':_0x43ca34[_0xf5f2('0x122')][_0xf5f2('0x38')],'agent':_0x43ca34['Owner']?_0x43ca34[_0xf5f2('0x123')][_0xf5f2('0x3f')]:_0xf5f2('0x127'),'createdAt':moment(_0x43ca34[_0xf5f2('0x85')])['format'](_0xf5f2('0x128'))[_0xf5f2('0xb2')](),'closedAt':_0x43ca34['closed']?moment(_0x43ca34[_0xf5f2('0x129')])['format'](_0xf5f2('0x128'))[_0xf5f2('0xb2')]():'','disposition':_0x43ca34['disposition'],'chatInfo':{'browser':_0x43ca34[_0xf5f2('0x12a')],'os':_0x43ca34[_0xf5f2('0x12b')],'referer':_0x43ca34[_0xf5f2('0x12c')],'customerIp':_0x43ca34[_0xf5f2('0x12d')],'customerPort':_0x43ca34['customerPort']?_0x43ca34[_0xf5f2('0x12e')]:_0xf5f2('0x127')},'messages':_(_0x43ca34[_0xf5f2('0xee')])['tail']()[_0xf5f2('0x90')]({'secret':![]})[_0xf5f2('0x3e')](function(_0x5981bb){if(_0x5981bb[_0xf5f2('0xde')]){var _0x4586b5=path[_0xf5f2('0xe5')](_0x2bc493,_0x5981bb[_0xf5f2('0xde')][_0xf5f2('0xe7')]);if(fs[_0xf5f2('0x12f')](_0x4586b5)){fs[_0xf5f2('0x130')](_0x4586b5)[_0xf5f2('0x131')](fs[_0xf5f2('0x132')](path['join'](_0x212d97,_0x5981bb[_0xf5f2('0xde')][_0xf5f2('0xe7')])));}}return{'date':moment(_0x5981bb[_0xf5f2('0x85')])[_0xf5f2('0xea')](_0xf5f2('0x128'))[_0xf5f2('0xb2')](),'sender':_0x5981bb[_0xf5f2('0x121')]===_0xf5f2('0x133')?_0x5981bb[_0xf5f2('0x7f')]?_0x5981bb[_0xf5f2('0x7f')][_0xf5f2('0x3f')]:'System':_0x5981bb['Contact']['firstName']+(_0x5981bb[_0xf5f2('0x73')][_0xf5f2('0x120')]?'\x20'+_0x5981bb[_0xf5f2('0x73')]['lastName']:''),'body':_0x5981bb[_0xf5f2('0xde')]?_0x5981bb[_0xf5f2('0xde')][_0xf5f2('0xe7')]:_0x5981bb['body'],'direction':_0x5981bb[_0xf5f2('0x121')]===_0xf5f2('0x133')?'A':'C','secret':_0x5981bb[_0xf5f2('0xfb')],'read':_0x5981bb[_0xf5f2('0x8a')],'attachment':_0x5981bb[_0xf5f2('0xde')]};})[_0xf5f2('0x76')]()};return ejs[_0xf5f2('0x134')](path[_0xf5f2('0xe5')](config['root'],_0xf5f2('0x11a'),_0xf5f2('0x135'),_0xf5f2('0x136')),{'interaction':_0x220300})[_0xf5f2('0x22')](function(_0x510f56){var _0x319b39=path[_0xf5f2('0xe5')](_0x212d97,_0xf5f2('0x137')+_0x43ca34['id']+'-'+_0x26dc8c+'.pdf');var _0x346a95={'path':_0x319b39,'channel':_0xf5f2('0x126'),'interactionId':_0x43ca34['id']};return pdf[_0xf5f2('0x138')](_0x510f56,_0x346a95);})[_0xf5f2('0x22')](function(){return new BPromise(function(_0x249e9b,_0x56ab93){zipdir(_0x212d97,{'saveTo':_0x3712e3},function(_0x21fce7,_0x38a5e3){if(_0x21fce7)return _0x56ab93(_0x21fce7);return _0x249e9b(_0x38a5e3);});})[_0xf5f2('0x22')](function(){return new BPromise(function(_0x4d8a71,_0x1ca92b){rimraf(_0x212d97,function(_0x486c5e){if(_0x486c5e)_0x1ca92b(_0x486c5e);return _0x4d8a71();});});})[_0xf5f2('0x22')](function(){return _0x4f777b[_0xf5f2('0xe8')](_0x3712e3,_0x8ee5fd,function(_0x5089c1){if(_0x5089c1){console[_0xf5f2('0x139')](_0xf5f2('0x13a'),_0x5089c1);}else{fs[_0xf5f2('0x13b')](_0x3712e3);}});});});}else{return _0x4f777b['sendStatus'](0xc8);}})[_0xf5f2('0x2c')](handleError(_0x4f777b,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 9d53f9e..30a4b4b 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 _0xe5fc=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','update','remove','getUsers','then','setDataValue','unreadMessages','length','emit','catch'];(function(_0x1ceb7b,_0x894d3d){var _0x57c016=function(_0x282306){while(--_0x282306){_0x1ceb7b['push'](_0x1ceb7b['shift']());}};_0x57c016(++_0x894d3d);}(_0xe5fc,0x144));var _0xce5f=function(_0x4bb7e4,_0x211d37){_0x4bb7e4=_0x4bb7e4-0x0;var _0x398622=_0xe5fc[_0x4bb7e4];return _0x398622;};'use strict';var EventEmitter=require(_0xce5f('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require(_0xce5f('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xce5f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xce5f('0x3'),'afterDestroy':_0xce5f('0x4')};function emitEvent(_0x20023f){return function(_0x5495c3,_0x1db74a,_0x252741){_0x5495c3[_0xce5f('0x5')]({'attributes':['id'],'raw':!![]})[_0xce5f('0x6')](function(_0x16bd4d){_0x5495c3[_0xce5f('0x7')]('Users',_0x16bd4d['map'](function(_0x206386){return{'id':_0x206386['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x5495c3['id'],'direction':'in','read':![]},'raw':!![]});})[_0xce5f('0x6')](function(_0x2f0a36){_0x5495c3[_0xce5f('0x7')](_0xce5f('0x8'),_0x2f0a36[_0xce5f('0x9')]);ChatInteractionEvents[_0xce5f('0xa')](_0x20023f+':'+_0x5495c3['id'],_0x5495c3);ChatInteractionEvents[_0xce5f('0xa')](_0x20023f,_0x5495c3);_0x252741(null);})[_0xce5f('0xb')](_0x252741(null));};}for(var e in events){if(events[_0xce5f('0xc')](e)){var event=events[e];ChatInteraction[_0xce5f('0xd')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0xc7b3=['map','then','setDataValue','unreadMessages','emit','catch','exports','events','ChatInteraction','../../mysqldb','ChatMessage','save','update','remove'];(function(_0x5bc18d,_0x4a1372){var _0x32a08e=function(_0x22d348){while(--_0x22d348){_0x5bc18d['push'](_0x5bc18d['shift']());}};_0x32a08e(++_0x4a1372);}(_0xc7b3,0x181));var _0x3c7b=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xc7b3[_0x465a0c];return _0x1e202e;};'use strict';var EventEmitter=require(_0x3c7b('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x3c7b('0x1')];var ChatMessage=require(_0x3c7b('0x2'))['db'][_0x3c7b('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3c7b('0x4'),'afterUpdate':_0x3c7b('0x5'),'afterDestroy':_0x3c7b('0x6')};function emitEvent(_0x43e415){return function(_0x52e8fe,_0x236e5c,_0x153a10){_0x52e8fe['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x581477){_0x52e8fe['setDataValue']('Users',_0x581477[_0x3c7b('0x7')](function(_0x59fe97){return{'id':_0x59fe97['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x52e8fe['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3c7b('0x8')](function(_0x2a97c0){_0x52e8fe[_0x3c7b('0x9')](_0x3c7b('0xa'),_0x2a97c0['length']);ChatInteractionEvents[_0x3c7b('0xb')](_0x43e415+':'+_0x52e8fe['id'],_0x52e8fe);ChatInteractionEvents[_0x3c7b('0xb')](_0x43e415,_0x52e8fe);_0x153a10(null);})[_0x3c7b('0xc')](_0x153a10(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x3c7b('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 9555f51..e4fe0c7 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 _0x338e=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x338e,0x7e));var _0xe338=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x338e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xe338('0x0'));var logger=require(_0xe338('0x1'))(_0xe338('0x2'));var moment=require(_0xe338('0x3'));var BPromise=require(_0xe338('0x4'));var rp=require(_0xe338('0x5'));var fs=require('fs');var path=require(_0xe338('0x6'));var rimraf=require(_0xe338('0x7'));var config=require(_0xe338('0x8'));var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x2b8445,_0x1fd08a){return _0x2b8445['define'](_0xe338('0x9'),attributes,{'tableName':_0xe338('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x51619e,_0x4ef9bc,_0x5d75a7){if(_0x51619e[_0xe338('0xb')](_0xe338('0xc'))){_0x51619e[_0xe338('0xd')]=moment()[_0xe338('0xe')](_0xe338('0xf'));}_0x5d75a7(null,_0x51619e);}},'charset':_0xe338('0x10'),'collate':_0xe338('0x11')});};
\ No newline at end of file
+var _0x9c52=['exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./chatInteraction.attributes'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x9c52,0x6a));var _0x29c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c52[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x29c5('0x0'));var util=require(_0x29c5('0x1'));var logger=require(_0x29c5('0x2'))(_0x29c5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x29c5('0x4'));var fs=require('fs');var path=require(_0x29c5('0x5'));var rimraf=require('rimraf');var config=require(_0x29c5('0x6'));var attributes=require(_0x29c5('0x7'));module[_0x29c5('0x8')]=function(_0x51ab47,_0x5873a0){return _0x51ab47[_0x29c5('0x9')](_0x29c5('0xa'),attributes,{'tableName':_0x29c5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x255868,_0x57bc5e,_0x5c74a4){if(_0x255868[_0x29c5('0xc')](_0x29c5('0xd'))){_0x255868[_0x29c5('0xe')]=moment()[_0x29c5('0xf')](_0x29c5('0x10'));}_0x5c74a4(null,_0x255868);}},'charset':_0x29c5('0x11'),'collate':_0x29c5('0x12')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 6e73aba..be958fc 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 _0xf78c=['options','where','limit','then','UpdateChatInteraction','catch','AddTagsToChatInteraction','find','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ChatInteraction','update'];(function(_0x3e2efa,_0x4d2cac){var _0x428c9a=function(_0x2c02b7){while(--_0x2c02b7){_0x3e2efa['push'](_0x3e2efa['shift']());}};_0x428c9a(++_0x4d2cac);}(_0xf78c,0x173));var _0xcf78=function(_0x5f1dec,_0x3caa8d){_0x5f1dec=_0x5f1dec-0x0;var _0x3de08c=_0xf78c[_0x5f1dec];return _0x3de08c;};'use strict';var _=require(_0xcf78('0x0'));var util=require(_0xcf78('0x1'));var moment=require(_0xcf78('0x2'));var BPromise=require(_0xcf78('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf78('0x4'));var db=require(_0xcf78('0x5'))['db'];var utils=require(_0xcf78('0x6'));var logger=require('../../config/logger')(_0xcf78('0x7'));var config=require(_0xcf78('0x8'));var jayson=require(_0xcf78('0x9'));var client=jayson[_0xcf78('0xa')][_0xcf78('0xb')]({'port':0x232a});config[_0xcf78('0xc')]=_[_0xcf78('0xd')](config['redis'],{'host':_0xcf78('0xe'),'port':0x18eb});var socket=require(_0xcf78('0xf'))(new Redis(config[_0xcf78('0xc')]));require(_0xcf78('0x10'))['register'](socket);function respondWithRpcPromise(_0x38c5b3,_0x5660d5,_0x1b15c0){return new BPromise(function(_0x3be5da,_0x1f819c){return client['request'](_0x38c5b3,_0x1b15c0)['then'](function(_0x38a57c){logger[_0xcf78('0x11')](_0xcf78('0x12'),_0x5660d5,_0xcf78('0x13'));logger[_0xcf78('0x14')](_0xcf78('0x15'),_0x5660d5,_0xcf78('0x13'),JSON[_0xcf78('0x16')](_0x38a57c));if(_0x38a57c[_0xcf78('0x17')]){if(_0x38a57c[_0xcf78('0x17')][_0xcf78('0x18')]===0x1f4){logger[_0xcf78('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x5660d5,_0x38a57c['error'][_0xcf78('0x19')]);return _0x1f819c(_0x38a57c['error'][_0xcf78('0x19')]);}logger[_0xcf78('0x17')](_0xcf78('0x12'),_0x5660d5,_0x38a57c[_0xcf78('0x17')]['message']);return _0x3be5da(_0x38a57c[_0xcf78('0x17')][_0xcf78('0x19')]);}else{logger['info'](_0xcf78('0x12'),_0x5660d5,_0xcf78('0x13'));_0x3be5da(_0x38a57c[_0xcf78('0x1a')][_0xcf78('0x19')]);}})['catch'](function(_0x55d5b5){logger[_0xcf78('0x17')](_0xcf78('0x12'),_0x5660d5,_0x55d5b5);_0x1f819c(_0x55d5b5);});});}exports['UpdateChatInteraction']=function(_0x258223){var _0x5831fe=this;return new Promise(function(_0xb40109,_0x3ac7cb){return db[_0xcf78('0x1b')][_0xcf78('0x1c')](_0x258223['body'],{'raw':_0x258223[_0xcf78('0x1d')]?_0x258223[_0xcf78('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x258223[_0xcf78('0x1d')]?_0x258223[_0xcf78('0x1d')][_0xcf78('0x1e')]||null:null,'attributes':_0x258223[_0xcf78('0x1d')]?_0x258223[_0xcf78('0x1d')]['attributes']||null:null,'limit':_0x258223[_0xcf78('0x1d')]?_0x258223[_0xcf78('0x1d')][_0xcf78('0x1f')]||null:null})[_0xcf78('0x20')](function(_0x1bcc25){logger[_0xcf78('0x11')](_0xcf78('0x21'),_0x258223);logger['debug'](_0xcf78('0x21'),_0x258223,JSON[_0xcf78('0x16')](_0x1bcc25));_0xb40109(_0x1bcc25);})[_0xcf78('0x22')](function(_0x4cbb43){logger['error'](_0xcf78('0x21'),_0x4cbb43[_0xcf78('0x19')],_0x258223);_0x3ac7cb(_0x5831fe[_0xcf78('0x17')](0x1f4,_0x4cbb43[_0xcf78('0x19')]));});});};exports[_0xcf78('0x23')]=function(_0x2aad6c){return new Promise(function(_0xff2ef0,_0x378f1b){return db[_0xcf78('0x1b')][_0xcf78('0x24')]({'where':_0x2aad6c['options']?_0x2aad6c[_0xcf78('0x1d')][_0xcf78('0x1e')]||null:null})['then'](function(_0x3e4108){if(_0x3e4108){return _0x3e4108['addTags'](_0x2aad6c['body'][_0xcf78('0x25')],_['omit'](_0x2aad6c['body'],[_0xcf78('0x25'),'id'])||{});}})[_0xcf78('0x26')](function(_0x509a52){logger[_0xcf78('0x11')](_0xcf78('0x27'),_0x2aad6c);logger[_0xcf78('0x14')](_0xcf78('0x27'),_0x2aad6c,JSON[_0xcf78('0x16')](_0x509a52));_0xff2ef0(_0x509a52);})[_0xcf78('0x22')](function(_0x52cbc1){logger[_0xcf78('0x17')](_0xcf78('0x27'),_0x52cbc1[_0xcf78('0x19')],_0x2aad6c);_0x378f1b(_this[_0xcf78('0x17')](0x1f4,_0x52cbc1[_0xcf78('0x19')]));});});};
\ No newline at end of file
+var _0xced8=['debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','body','options','raw','where','attributes','limit','stringify','UpdateChatInteraction','AddTagsToChatInteraction','find','addTags','ids','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x820d7b,_0xa5564c){var _0x249af0=function(_0x5ce8fb){while(--_0x5ce8fb){_0x820d7b['push'](_0x820d7b['shift']());}};_0x249af0(++_0xa5564c);}(_0xced8,0x173));var _0x8ced=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xced8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8ced('0x0'));var util=require(_0x8ced('0x1'));var moment=require(_0x8ced('0x2'));var BPromise=require(_0x8ced('0x3'));var rs=require(_0x8ced('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ced('0x5'))['db'];var utils=require(_0x8ced('0x6'));var logger=require('../../config/logger')(_0x8ced('0x7'));var config=require('../../config/environment');var jayson=require(_0x8ced('0x8'));var client=jayson['client'][_0x8ced('0x9')]({'port':0x232a});config[_0x8ced('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8ced('0xb'))(new Redis(config[_0x8ced('0xa')]));require(_0x8ced('0xc'))[_0x8ced('0xd')](socket);function respondWithRpcPromise(_0x6c7033,_0x26951a,_0x3c7aa4){return new BPromise(function(_0x58c13b,_0x2f184f){return client[_0x8ced('0xe')](_0x6c7033,_0x3c7aa4)[_0x8ced('0xf')](function(_0x3462d4){logger[_0x8ced('0x10')](_0x8ced('0x11'),_0x26951a,_0x8ced('0x12'));logger[_0x8ced('0x13')](_0x8ced('0x14'),_0x26951a,_0x8ced('0x12'),JSON['stringify'](_0x3462d4));if(_0x3462d4['error']){if(_0x3462d4[_0x8ced('0x15')][_0x8ced('0x16')]===0x1f4){logger['error'](_0x8ced('0x11'),_0x26951a,_0x3462d4[_0x8ced('0x15')]['message']);return _0x2f184f(_0x3462d4[_0x8ced('0x15')][_0x8ced('0x17')]);}logger['error'](_0x8ced('0x11'),_0x26951a,_0x3462d4['error']['message']);return _0x58c13b(_0x3462d4[_0x8ced('0x15')][_0x8ced('0x17')]);}else{logger['info'](_0x8ced('0x11'),_0x26951a,_0x8ced('0x12'));_0x58c13b(_0x3462d4[_0x8ced('0x18')]['message']);}})[_0x8ced('0x19')](function(_0x241c13){logger[_0x8ced('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x26951a,_0x241c13);_0x2f184f(_0x241c13);});});}exports['UpdateChatInteraction']=function(_0x62d24c){var _0x34f9ac=this;return new Promise(function(_0x2f4d4f,_0x538cf7){return db['ChatInteraction']['update'](_0x62d24c[_0x8ced('0x1a')],{'raw':_0x62d24c[_0x8ced('0x1b')]?_0x62d24c[_0x8ced('0x1b')][_0x8ced('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x62d24c[_0x8ced('0x1b')]?_0x62d24c[_0x8ced('0x1b')][_0x8ced('0x1d')]||null:null,'attributes':_0x62d24c[_0x8ced('0x1b')]?_0x62d24c['options'][_0x8ced('0x1e')]||null:null,'limit':_0x62d24c['options']?_0x62d24c[_0x8ced('0x1b')][_0x8ced('0x1f')]||null:null})[_0x8ced('0xf')](function(_0x4e5c6e){logger[_0x8ced('0x10')]('UpdateChatInteraction',_0x62d24c);logger[_0x8ced('0x13')]('UpdateChatInteraction',_0x62d24c,JSON[_0x8ced('0x20')](_0x4e5c6e));_0x2f4d4f(_0x4e5c6e);})[_0x8ced('0x19')](function(_0x16c79d){logger['error'](_0x8ced('0x21'),_0x16c79d[_0x8ced('0x17')],_0x62d24c);_0x538cf7(_0x34f9ac['error'](0x1f4,_0x16c79d[_0x8ced('0x17')]));});});};exports[_0x8ced('0x22')]=function(_0x56ffca){return new Promise(function(_0x328caa,_0x40ec69){return db['ChatInteraction'][_0x8ced('0x23')]({'where':_0x56ffca[_0x8ced('0x1b')]?_0x56ffca[_0x8ced('0x1b')][_0x8ced('0x1d')]||null:null})[_0x8ced('0xf')](function(_0x404407){if(_0x404407){return _0x404407[_0x8ced('0x24')](_0x56ffca[_0x8ced('0x1a')][_0x8ced('0x25')],_['omit'](_0x56ffca[_0x8ced('0x1a')],[_0x8ced('0x25'),'id'])||{});}})['spread'](function(_0x1a11eb){logger[_0x8ced('0x10')](_0x8ced('0x26'),_0x56ffca);logger['debug'](_0x8ced('0x26'),_0x56ffca,JSON['stringify'](_0x1a11eb));_0x328caa(_0x1a11eb);})[_0x8ced('0x19')](function(_0x35c1b4){logger['error'](_0x8ced('0x26'),_0x35c1b4['message'],_0x56ffca);_0x40ec69(_this[_0x8ced('0x15')](0x1f4,_0x35c1b4[_0x8ced('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 20a9b7b..bb06a19 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 _0x1862=['update','emit','removeListener','./chatInteraction.events','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1862,0x6c));var _0x2186=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1862[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInteractionEvents=require(_0x2186('0x0'));var events=['save',_0x2186('0x1'),_0x2186('0x2')];function createListener(_0x3a44b6,_0x3050ef){return function(_0x517f2c){_0x3050ef[_0x2186('0x3')](_0x3a44b6,_0x517f2c);};}function removeListener(_0x29154,_0x31ec11){return function(){ChatInteractionEvents[_0x2186('0x4')](_0x29154,_0x31ec11);};}exports['register']=function(_0x13515d){for(var _0x2ada49=0x0,_0x119175=events['length'];_0x2ada49<_0x119175;_0x2ada49++){var _0x21ce00=events[_0x2ada49];var _0x4b7e16=createListener('chatInteraction:'+_0x21ce00,_0x13515d);ChatInteractionEvents['on'](_0x21ce00,_0x4b7e16);}};
\ No newline at end of file
+var _0xc0e6=['length','chatInteraction:','save','update','removeListener','register'];(function(_0xea34ca,_0x5eced4){var _0x10a4b2=function(_0x48d978){while(--_0x48d978){_0xea34ca['push'](_0xea34ca['shift']());}};_0x10a4b2(++_0x5eced4);}(_0xc0e6,0x1b8));var _0x6c0e=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0xc0e6[_0x35da42];return _0x370035;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x6c0e('0x0'),'remove',_0x6c0e('0x1')];function createListener(_0x33f34d,_0x343e16){return function(_0x50bbab){_0x343e16['emit'](_0x33f34d,_0x50bbab);};}function removeListener(_0x163f81,_0x35fe2f){return function(){ChatInteractionEvents[_0x6c0e('0x2')](_0x163f81,_0x35fe2f);};}exports[_0x6c0e('0x3')]=function(_0x28b74e){for(var _0x4c3847=0x0,_0x3534c6=events[_0x6c0e('0x4')];_0x4c3847<_0x3534c6;_0x4c3847++){var _0x3e6bdf=events[_0x4c3847];var _0x2d1e43=createListener(_0x6c0e('0x5')+_0x3e6bdf,_0x28b74e);ChatInteractionEvents['on'](_0x3e6bdf,_0x2d1e43);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 529c817..5d07a6c 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 _0x899e=['/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','post','create','/:id/vidaoo','diskStorage','join','root','server/files/attachments/','%s-%s','now','replace','single','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe'];(function(_0x338224,_0x1fb425){var _0x1d5fc5=function(_0x27cc96){while(--_0x27cc96){_0x338224['push'](_0x338224['shift']());}};_0x1d5fc5(++_0x1fb425);}(_0x899e,0x1cf));var _0xe899=function(_0x4abedb,_0x90cb83){_0x4abedb=_0x4abedb-0x0;var _0x3b61c4=_0x899e[_0x4abedb];return _0x3b61c4;};'use strict';var multer=require(_0xe899('0x0'));var util=require(_0xe899('0x1'));var path=require(_0xe899('0x2'));var timeout=require(_0xe899('0x3'));var express=require(_0xe899('0x4'));var router=express[_0xe899('0x5')]();var fs_extra=require(_0xe899('0x6'));var auth=require(_0xe899('0x7'));var interaction=require(_0xe899('0x8'));var config=require(_0xe899('0x9'));var controller=require('./chatInteraction.controller');router[_0xe899('0xa')]('/',auth[_0xe899('0xb')](),controller['index']);router[_0xe899('0xa')](_0xe899('0xc'),auth[_0xe899('0xb')](),controller[_0xe899('0xd')]);router[_0xe899('0xa')](_0xe899('0xe'),auth[_0xe899('0xf')](),controller[_0xe899('0x10')]);router[_0xe899('0xa')](_0xe899('0x11'),auth[_0xe899('0xf')](),controller['attachmentDownload']);router[_0xe899('0xa')](_0xe899('0x12'),auth['isAuthenticated'](),controller[_0xe899('0x13')]);router['get'](_0xe899('0x14'),auth[_0xe899('0xf')](),controller[_0xe899('0x15')]);router[_0xe899('0xa')]('/:id/download',auth[_0xe899('0xb')](),controller['download']);router[_0xe899('0x16')]('/',auth['isAuthenticated'](),controller[_0xe899('0x17')]);router[_0xe899('0x16')](_0xe899('0x18'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xe899('0x19')]({'destination':function(_0x3fc776,_0x5294a2,_0x452314){_0x452314(null,path[_0xe899('0x1a')](config[_0xe899('0x1b')],_0xe899('0x1c')));},'filename':function(_0x279edb,_0x21979a,_0x1fd9cb){_0x1fd9cb(null,util['format'](_0xe899('0x1d'),Date[_0xe899('0x1e')](),_0x21979a['originalname'][_0xe899('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe899('0x16')]('/:id/attachment_upload',upload[_0xe899('0x20')](_0xe899('0x21')),controller[_0xe899('0x22')]);router[_0xe899('0x16')](_0xe899('0x12'),auth[_0xe899('0xf')](),controller[_0xe899('0x23')]);router[_0xe899('0x16')]('/:id/tags',auth[_0xe899('0xb')](),interaction[_0xe899('0x24')](_0xe899('0x25'),_0xe899('0x26')),controller['addTags']);router[_0xe899('0x27')](_0xe899('0xe'),auth[_0xe899('0xb')](),interaction[_0xe899('0x24')](_0xe899('0x25'),_0xe899('0x28')),controller[_0xe899('0x29')]);router[_0xe899('0x27')]('/:id/custom_update',controller[_0xe899('0x2a')]);router[_0xe899('0x27')](_0xe899('0x2b'),auth['isChatInteractionAuthorized'](),controller[_0xe899('0x2c')]);router[_0xe899('0x27')](_0xe899('0x2d'),controller[_0xe899('0x2e')]);router['delete'](_0xe899('0xe'),auth[_0xe899('0xb')](),interaction[_0xe899('0x24')]('chat',_0xe899('0x2f')),controller[_0xe899('0x30')]);router[_0xe899('0x31')](_0xe899('0x32'),auth['isAuthenticated'](),controller[_0xe899('0x33')]);module[_0xe899('0x34')]=router;
\ No newline at end of file
+var _0x0c08=['exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','create','post','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','replace','/:id/attachment_upload','file','/:id/messages','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','tracked','chatinteraction:destroy'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x0c08,0x8e));var _0x80c0=function(_0x5a6644,_0x45d612){_0x5a6644=_0x5a6644-0x0;var _0x3a2a5d=_0x0c08[_0x5a6644];return _0x3a2a5d;};'use strict';var multer=require(_0x80c0('0x0'));var util=require(_0x80c0('0x1'));var path=require('path');var timeout=require(_0x80c0('0x2'));var express=require('express');var router=express[_0x80c0('0x3')]();var fs_extra=require(_0x80c0('0x4'));var auth=require(_0x80c0('0x5'));var interaction=require(_0x80c0('0x6'));var config=require(_0x80c0('0x7'));var controller=require('./chatInteraction.controller');router[_0x80c0('0x8')]('/',auth[_0x80c0('0x9')](),controller[_0x80c0('0xa')]);router[_0x80c0('0x8')](_0x80c0('0xb'),auth[_0x80c0('0x9')](),controller['describe']);router['get'](_0x80c0('0xc'),auth[_0x80c0('0xd')](),controller[_0x80c0('0xe')]);router['get'](_0x80c0('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x80c0('0x10')]);router[_0x80c0('0x8')]('/:id/messages',auth[_0x80c0('0x9')](),controller[_0x80c0('0x11')]);router[_0x80c0('0x8')](_0x80c0('0x12'),auth[_0x80c0('0xd')](),controller[_0x80c0('0x13')]);router[_0x80c0('0x8')]('/:id/download',auth[_0x80c0('0x9')](),controller['download']);router['post']('/',auth[_0x80c0('0x9')](),controller[_0x80c0('0x14')]);router[_0x80c0('0x15')]('/:id/vidaoo',auth[_0x80c0('0x9')](),controller[_0x80c0('0x16')]);var upload=multer({'storage':multer[_0x80c0('0x17')]({'destination':function(_0x3030e0,_0x42f5e2,_0x476942){_0x476942(null,path[_0x80c0('0x18')](config[_0x80c0('0x19')],_0x80c0('0x1a')));},'filename':function(_0x158dfd,_0x433b9b,_0x2e620e){_0x2e620e(null,util[_0x80c0('0x1b')]('%s-%s',Date['now'](),_0x433b9b['originalname'][_0x80c0('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x80c0('0x1d'),upload['single'](_0x80c0('0x1e')),controller['attachmentUpload']);router['post'](_0x80c0('0x1f'),auth['isChatInteractionAuthorized'](),controller[_0x80c0('0x20')]);router[_0x80c0('0x15')](_0x80c0('0x21'),auth[_0x80c0('0x9')](),interaction['tracked'](_0x80c0('0x22'),_0x80c0('0x23')),controller[_0x80c0('0x24')]);router[_0x80c0('0x25')](_0x80c0('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0x80c0('0x22'),'chatinteraction:update'),controller['update']);router[_0x80c0('0x25')]('/:id/custom_update',controller[_0x80c0('0x26')]);router[_0x80c0('0x25')](_0x80c0('0x27'),auth[_0x80c0('0xd')](),controller[_0x80c0('0x28')]);router['put'](_0x80c0('0x29'),controller[_0x80c0('0x2a')]);router[_0x80c0('0x2b')](_0x80c0('0xc'),auth[_0x80c0('0x9')](),interaction[_0x80c0('0x2c')](_0x80c0('0x22'),_0x80c0('0x2d')),controller['destroy']);router['delete'](_0x80c0('0x21'),auth[_0x80c0('0x9')](),controller['removeTags']);module[_0x80c0('0x2e')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index d56a447..4e206f2 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 _0x9a8b=['exports','TEXT','sequelize'];(function(_0x492d08,_0x309900){var _0x476f5a=function(_0x56ab56){while(--_0x56ab56){_0x492d08['push'](_0x492d08['shift']());}};_0x476f5a(++_0x309900);}(_0x9a8b,0x1f1));var _0xb9a8=function(_0x447743,_0x3bde2d){_0x447743=_0x447743-0x0;var _0x157364=_0x9a8b[_0x447743];return _0x157364;};'use strict';var Sequelize=require(_0xb9a8('0x0'));module[_0xb9a8('0x1')]={'body':{'type':Sequelize[_0xb9a8('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x040d=['sequelize','exports','BOOLEAN'];(function(_0x31523e,_0x26f653){var _0x56aa74=function(_0x2bb423){while(--_0x2bb423){_0x31523e['push'](_0x31523e['shift']());}};_0x56aa74(++_0x26f653);}(_0x040d,0x13e));var _0xd040=function(_0x1e9992,_0x24a7db){_0x1e9992=_0x1e9992-0x0;var _0x4204e2=_0x040d[_0x1e9992];return _0x4204e2;};'use strict';var Sequelize=require(_0xd040('0x0'));module[_0xd040('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd040('0x2')],'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 63c66c8..2916c42 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 _0xdc06=['squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./chatInternalMessage.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','get','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','role','userpic','online','allowmessenger','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','ToId','-createdAt','all','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','fs-extra'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xdc06,0xd4));var _0x6dc0=function(_0x5bc779,_0x277212){_0x5bc779=_0x5bc779-0x0;var _0x3bfcac=_0xdc06[_0x5bc779];return _0x3bfcac;};'use strict';var emlformat=require(_0x6dc0('0x0'));var rimraf=require(_0x6dc0('0x1'));var zipdir=require(_0x6dc0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6dc0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6dc0('0x4'));var util=require('util');var path=require(_0x6dc0('0x5'));var sox=require(_0x6dc0('0x6'));var csv=require(_0x6dc0('0x7'));var ejs=require(_0x6dc0('0x8'));var fs=require('fs');var fs_extra=require(_0x6dc0('0x9'));var _=require('lodash');var squel=require(_0x6dc0('0xa'));var crypto=require(_0x6dc0('0xb'));var jsforce=require(_0x6dc0('0xc'));var deskjs=require(_0x6dc0('0xd'));var toCsv=require(_0x6dc0('0x7'));var querystring=require('querystring');var Papa=require(_0x6dc0('0xe'));var Redis=require(_0x6dc0('0xf'));var authService=require(_0x6dc0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6dc0('0x11'));var hardwareService=require(_0x6dc0('0x12'));var logger=require(_0x6dc0('0x13'))(_0x6dc0('0x14'));var utils=require(_0x6dc0('0x15'));var config=require(_0x6dc0('0x16'));var licenseUtil=require(_0x6dc0('0x17'));var db=require('../../mysqldb')['db'];config[_0x6dc0('0x18')]=_['defaults'](config['redis'],{'host':_0x6dc0('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6dc0('0x18')]));require(_0x6dc0('0x1a'))[_0x6dc0('0x1b')](socket);function respondWithStatusCode(_0x13bbf3,_0x1d459a){_0x1d459a=_0x1d459a||0xcc;return function(_0x345652){if(_0x345652){return _0x13bbf3[_0x6dc0('0x1c')](_0x1d459a);}return _0x13bbf3['status'](_0x1d459a)[_0x6dc0('0x1d')]();};}function respondWithResult(_0x3f03b7,_0x2453b8){_0x2453b8=_0x2453b8||0xc8;return function(_0xf28292){if(_0xf28292){return _0x3f03b7[_0x6dc0('0x1e')](_0x2453b8)[_0x6dc0('0x1f')](_0xf28292);}};}function respondWithFilteredResult(_0x58eb1b,_0x4f38f1){return function(_0x589c52){if(_0x589c52){var _0x22bd0f=typeof _0x4f38f1[_0x6dc0('0x20')]===_0x6dc0('0x21')&&typeof _0x4f38f1['limit']===_0x6dc0('0x21');var _0x41a313=_0x589c52[_0x6dc0('0x22')];var _0x39494d=_0x22bd0f?0x0:_0x4f38f1['offset'];var _0x5832af=_0x22bd0f?_0x589c52[_0x6dc0('0x22')]:_0x4f38f1[_0x6dc0('0x20')]+_0x4f38f1[_0x6dc0('0x23')];var _0x3ebfa0;if(_0x5832af>=_0x41a313){_0x5832af=_0x41a313;_0x3ebfa0=0xc8;}else{_0x3ebfa0=0xce;}_0x58eb1b['status'](_0x3ebfa0);return _0x58eb1b[_0x6dc0('0x24')](_0x6dc0('0x25'),_0x39494d+'-'+_0x5832af+'/'+_0x41a313)['json'](_0x589c52);}return null;};}function patchUpdates(_0x309e0f){return function(_0x487598){try{jsonpatch[_0x6dc0('0x26')](_0x487598,_0x309e0f,!![]);}catch(_0x522a37){return BPromise[_0x6dc0('0x27')](_0x522a37);}return _0x487598[_0x6dc0('0x28')]();};}function saveUpdates(_0x263b27,_0x2fe6cd){return function(_0x130ac6){if(_0x130ac6){return _0x130ac6[_0x6dc0('0x29')](_0x263b27)[_0x6dc0('0x2a')](function(_0x2efb84){return _0x2efb84;});}return null;};}function removeEntity(_0x51600d,_0x4a207e){return function(_0x2824cb){if(_0x2824cb){return _0x2824cb[_0x6dc0('0x2b')]()['then'](function(){_0x51600d[_0x6dc0('0x1e')](0xcc)[_0x6dc0('0x1d')]();});}};}function handleEntityNotFound(_0x55203f,_0xe2deaa){return function(_0x328d7b){if(!_0x328d7b){_0x55203f[_0x6dc0('0x1c')](0x194);}return _0x328d7b;};}function handleError(_0x5ad41b,_0x5cd654){_0x5cd654=_0x5cd654||0x1f4;return function(_0x25766c){logger[_0x6dc0('0x2c')](_0x25766c[_0x6dc0('0x2d')]);if(_0x25766c[_0x6dc0('0x2e')]){delete _0x25766c[_0x6dc0('0x2e')];}_0x5ad41b[_0x6dc0('0x1e')](_0x5cd654)[_0x6dc0('0x2f')](_0x25766c);};}exports[_0x6dc0('0x30')]=function(_0x4ece20,_0x3f3abf){var _0x1ea184={},_0x2ebc37={},_0x1dc9d3={'count':0x0,'rows':[]};var _0x387ea6=_[_0x6dc0('0x31')](db[_0x6dc0('0x32')]['rawAttributes'],function(_0x4fb61b){return{'name':_0x4fb61b['fieldName'],'type':_0x4fb61b[_0x6dc0('0x33')][_0x6dc0('0x34')]};});_0x2ebc37[_0x6dc0('0x35')]=_[_0x6dc0('0x31')](_0x387ea6,_0x6dc0('0x2e'));_0x2ebc37[_0x6dc0('0x36')]=_[_0x6dc0('0x37')](_0x4ece20['query']);_0x2ebc37['filters']=_[_0x6dc0('0x38')](_0x2ebc37[_0x6dc0('0x35')],_0x2ebc37[_0x6dc0('0x36')]);_0x1ea184[_0x6dc0('0x39')]=_[_0x6dc0('0x38')](_0x2ebc37['model'],qs[_0x6dc0('0x3a')](_0x4ece20['query'][_0x6dc0('0x3a')]));_0x1ea184['attributes']=_0x1ea184[_0x6dc0('0x39')][_0x6dc0('0x3b')]?_0x1ea184[_0x6dc0('0x39')]:_0x2ebc37[_0x6dc0('0x35')];if(!_0x4ece20['query'][_0x6dc0('0x3c')](_0x6dc0('0x3d'))){_0x1ea184['limit']=qs[_0x6dc0('0x23')](_0x4ece20[_0x6dc0('0x36')]['limit']);_0x1ea184[_0x6dc0('0x20')]=qs[_0x6dc0('0x20')](_0x4ece20['query'][_0x6dc0('0x20')]);}_0x1ea184['order']=qs['sort'](_0x4ece20['query'][_0x6dc0('0x3e')]);_0x1ea184[_0x6dc0('0x3f')]=qs[_0x6dc0('0x40')](_[_0x6dc0('0x41')](_0x4ece20['query'],_0x2ebc37[_0x6dc0('0x40')]),_0x387ea6);if(_0x4ece20[_0x6dc0('0x36')][_0x6dc0('0x42')]){_0x1ea184['where']=_[_0x6dc0('0x43')](_0x1ea184[_0x6dc0('0x3f')],{'$or':_[_0x6dc0('0x31')](_0x387ea6,function(_0x31b62b){if(_0x31b62b[_0x6dc0('0x33')]!==_0x6dc0('0x44')){var _0x23f19e={};_0x23f19e[_0x31b62b[_0x6dc0('0x2e')]]={'$like':'%'+_0x4ece20[_0x6dc0('0x36')][_0x6dc0('0x42')]+'%'};return _0x23f19e;}})});}_0x1ea184=_['merge']({},_0x1ea184,_0x4ece20[_0x6dc0('0x45')]);var _0x1d816a={'where':_0x1ea184[_0x6dc0('0x3f')]};return db[_0x6dc0('0x32')][_0x6dc0('0x22')](_0x1d816a)[_0x6dc0('0x2a')](function(_0x2b7473){_0x1dc9d3[_0x6dc0('0x22')]=_0x2b7473;if(_0x4ece20[_0x6dc0('0x36')][_0x6dc0('0x46')]){_0x1ea184[_0x6dc0('0x47')]=[{'all':!![]}];}return db[_0x6dc0('0x32')][_0x6dc0('0x48')](_0x1ea184);})[_0x6dc0('0x2a')](function(_0x4426b2){_0x1dc9d3[_0x6dc0('0x49')]=_0x4426b2;return _0x1dc9d3;})['then'](respondWithFilteredResult(_0x3f3abf,_0x1ea184))[_0x6dc0('0x4a')](handleError(_0x3f3abf,null));};exports[_0x6dc0('0x4b')]=function(_0x716c1e,_0x533bac){var _0x7c69f7={'raw':!![],'where':{'id':_0x716c1e[_0x6dc0('0x4c')]['id']}},_0x230b3e={};_0x230b3e[_0x6dc0('0x35')]=_[_0x6dc0('0x37')](db[_0x6dc0('0x32')][_0x6dc0('0x4d')]);_0x230b3e['query']=_['keys'](_0x716c1e[_0x6dc0('0x36')]);_0x230b3e[_0x6dc0('0x40')]=_['intersection'](_0x230b3e[_0x6dc0('0x35')],_0x230b3e['query']);_0x7c69f7[_0x6dc0('0x39')]=_['intersection'](_0x230b3e[_0x6dc0('0x35')],qs[_0x6dc0('0x3a')](_0x716c1e['query']['fields']));_0x7c69f7[_0x6dc0('0x39')]=_0x7c69f7[_0x6dc0('0x39')][_0x6dc0('0x3b')]?_0x7c69f7[_0x6dc0('0x39')]:_0x230b3e[_0x6dc0('0x35')];if(_0x716c1e[_0x6dc0('0x36')]['includeAll']){_0x7c69f7[_0x6dc0('0x47')]=[{'all':!![]}];}_0x7c69f7=_[_0x6dc0('0x43')]({},_0x7c69f7,_0x716c1e[_0x6dc0('0x45')]);return db[_0x6dc0('0x32')]['find'](_0x7c69f7)[_0x6dc0('0x2a')](handleEntityNotFound(_0x533bac,null))['then'](respondWithResult(_0x533bac,null))[_0x6dc0('0x4a')](handleError(_0x533bac,null));};exports[_0x6dc0('0x4e')]=function(_0x166006,_0x3ea0ee){return db[_0x6dc0('0x32')][_0x6dc0('0x4e')](_0x166006['body'],{})['then'](respondWithResult(_0x3ea0ee,0xc9))[_0x6dc0('0x4a')](handleError(_0x3ea0ee,null));};exports[_0x6dc0('0x29')]=function(_0x3faaeb,_0x15adf7){if(_0x3faaeb[_0x6dc0('0x4f')]['id']){delete _0x3faaeb[_0x6dc0('0x4f')]['id'];}return db[_0x6dc0('0x32')][_0x6dc0('0x50')]({'where':{'id':_0x3faaeb[_0x6dc0('0x4c')]['id']}})[_0x6dc0('0x2a')](handleEntityNotFound(_0x15adf7,null))[_0x6dc0('0x2a')](saveUpdates(_0x3faaeb['body'],null))[_0x6dc0('0x2a')](respondWithResult(_0x15adf7,null))['catch'](handleError(_0x15adf7,null));};exports['destroy']=function(_0x2732ef,_0x34d7b9){return db[_0x6dc0('0x32')]['find']({'where':{'id':_0x2732ef['params']['id']}})[_0x6dc0('0x2a')](handleEntityNotFound(_0x34d7b9,null))[_0x6dc0('0x2a')](removeEntity(_0x34d7b9,null))[_0x6dc0('0x4a')](handleError(_0x34d7b9,null));};exports[_0x6dc0('0x51')]=function(_0x56e28b,_0x464ae0){return db[_0x6dc0('0x32')][_0x6dc0('0x51')]()[_0x6dc0('0x2a')](respondWithResult(_0x464ae0,null))[_0x6dc0('0x4a')](handleError(_0x464ae0,null));};function wrapUser(_0x5ef898){return function(_0x5594c3){var _0x2df2f8=_0x5ef898[_0x6dc0('0x52')]({'plain':!![]});_0x2df2f8[_0x6dc0('0x53')]=[];if(_0x5594c3){_0x2df2f8[_0x6dc0('0x54')]=_0x5594c3[_0x6dc0('0x55')];_0x2df2f8[_0x6dc0('0x56')]=_0x5594c3;}else{_0x2df2f8[_0x6dc0('0x54')]=moment(0x0)['format'](_0x6dc0('0x57'));_0x2df2f8['lastMessage']={};}return _0x2df2f8;};}exports[_0x6dc0('0x58')]=function(_0x55842d,_0x2c29ff,_0x5b3edd){var _0x211bdc=[];return db[_0x6dc0('0x59')][_0x6dc0('0x48')]({'where':{'role':[_0x6dc0('0x5a'),_0x6dc0('0x5b'),'user']},'attributes':['id','fullname',_0x6dc0('0x2e'),_0x6dc0('0x5c'),_0x6dc0('0x5d'),'internal',_0x6dc0('0x5e'),'lastLoginAt',_0x6dc0('0x5f'),_0x6dc0('0x60')],'order':qs[_0x6dc0('0x3e')](_0x6dc0('0x61')),'include':[{'model':db['VoiceQueue'],'as':_0x6dc0('0x62'),'attributes':['id',_0x6dc0('0x2e'),_0x6dc0('0x33')],'through':{'attributes':[]}}]})[_0x6dc0('0x2a')](function(_0x50222e){if(_0x50222e){var _0x274f1c=_0x55842d['user'][_0x6dc0('0x52')]({'plain':!![]});if(!_0x274f1c)throw new Error(_0x6dc0('0x63'));if(_0x274f1c[_0x6dc0('0x5c')]===_0x6dc0('0x64')){return db[_0x6dc0('0x65')][_0x6dc0('0x50')]({'where':{'name':_0x6dc0('0x66'),'userProfileId':_0x274f1c[_0x6dc0('0x67')]},'raw':!![]})[_0x6dc0('0x2a')](function(_0x5d994d){if(_0x5d994d){if(_0x5d994d[_0x6dc0('0x68')]===0x0){return db[_0x6dc0('0x69')][_0x6dc0('0x48')]({'where':{'sectionId':_0x5d994d['id']},'raw':!![]})[_0x6dc0('0x2a')](function(_0x53f2ff){var _0x4ea9ce=[];if(_['isEmpty'](_0x53f2ff)){_0x4ea9ce=_[_0x6dc0('0x42')](_0x50222e,function(_0x29c963){if(_0x29c963[_0x6dc0('0x5c')]!==_0x6dc0('0x5a')){return _0x29c963;}});return _0x4ea9ce;}else{for(var _0x1f47f8=0x0;_0x1f47f8<_0x50222e[_0x6dc0('0x3b')];_0x1f47f8++){var _0x273d40=_0x50222e[_0x1f47f8];if(_0x273d40[_0x6dc0('0x5c')]===_0x6dc0('0x5a')){var _0x1e3546=_[_0x6dc0('0x50')](_0x53f2ff,function(_0x1e8668){return _0x1e8668[_0x6dc0('0x6a')]===_0x273d40['id'];});if(_0x1e3546)_0x4ea9ce[_0x6dc0('0x6b')](_0x273d40);}else{_0x4ea9ce['push'](_0x273d40);}}return _0x4ea9ce;}});}else{return _0x50222e;}}else{var _0xd22163=_[_0x6dc0('0x42')](_0x50222e,function(_0x2610cc){if(_0x2610cc[_0x6dc0('0x5c')]!==_0x6dc0('0x5a')){return _0x2610cc;}});return _0xd22163;}});}else{return _0x50222e;}}})['then'](function(_0x25a484){var _0x195904=[];if(_0x25a484){_0x211bdc=_0x25a484;for(var _0x3a0e73=0x0;_0x3a0e73<_0x25a484[_0x6dc0('0x3b')];_0x3a0e73+=0x1){_0x211bdc[_0x3a0e73][_0x6dc0('0x53')]=[];_0x195904[_0x6dc0('0x6b')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x55842d[_0x6dc0('0x64')]['id'],_0x25a484[_0x3a0e73]['id']],'ToId':[_0x55842d['user']['id'],_0x25a484[_0x3a0e73]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x6dc0('0x6c'),'read','body'],'order':qs[_0x6dc0('0x3e')](_0x6dc0('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x6dc0('0x2a')](wrapUser(_0x25a484[_0x3a0e73])));}return BPromise[_0x6dc0('0x6e')](_0x195904);}return[];})[_0x6dc0('0x2a')](function(_0x38b7f3){return{'rows':_0x38b7f3,'count':_0x38b7f3[_0x6dc0('0x3b')]};})[_0x6dc0('0x2a')](respondWithResult(_0x2c29ff,null))['catch'](handleError(_0x2c29ff,null));};
\ No newline at end of file
+var _0x1139=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','end','stack','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','merge','VIRTUAL','name','options','where','includeAll','findAll','catch','show','params','include','create','body','find','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','fullname','role','userpic','internal','allowmessenger','showWebBar','-online','VoiceQueues','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','filter','resourceId','push','messages','FromId','ToId','read','-createdAt','all','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x4b22a8,_0x2feff6){var _0x3d41b2=function(_0x587a87){while(--_0x587a87){_0x4b22a8['push'](_0x4b22a8['shift']());}};_0x3d41b2(++_0x2feff6);}(_0x1139,0x1ad));var _0x9113=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x1139[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9113('0x0'));var jsonpatch=require(_0x9113('0x1'));var rp=require(_0x9113('0x2'));var moment=require(_0x9113('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9113('0x4'));var path=require(_0x9113('0x5'));var sox=require(_0x9113('0x6'));var csv=require(_0x9113('0x7'));var ejs=require(_0x9113('0x8'));var fs=require('fs');var fs_extra=require(_0x9113('0x9'));var _=require(_0x9113('0xa'));var squel=require(_0x9113('0xb'));var crypto=require('crypto');var jsforce=require(_0x9113('0xc'));var deskjs=require(_0x9113('0xd'));var toCsv=require(_0x9113('0x7'));var querystring=require(_0x9113('0xe'));var Papa=require(_0x9113('0xf'));var Redis=require(_0x9113('0x10'));var authService=require(_0x9113('0x11'));var qs=require(_0x9113('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9113('0x13'));var logger=require(_0x9113('0x14'))(_0x9113('0x15'));var utils=require(_0x9113('0x16'));var config=require(_0x9113('0x17'));var licenseUtil=require(_0x9113('0x18'));var db=require('../../mysqldb')['db'];config[_0x9113('0x19')]=_['defaults'](config[_0x9113('0x19')],{'host':_0x9113('0x1a'),'port':0x18eb});var socket=require(_0x9113('0x1b'))(new Redis(config[_0x9113('0x19')]));require(_0x9113('0x1c'))[_0x9113('0x1d')](socket);function respondWithStatusCode(_0x21bf19,_0x53d8ac){_0x53d8ac=_0x53d8ac||0xcc;return function(_0x4a34be){if(_0x4a34be){return _0x21bf19['sendStatus'](_0x53d8ac);}return _0x21bf19[_0x9113('0x1e')](_0x53d8ac)['end']();};}function respondWithResult(_0x463e75,_0x120609){_0x120609=_0x120609||0xc8;return function(_0x3faa07){if(_0x3faa07){return _0x463e75['status'](_0x120609)[_0x9113('0x1f')](_0x3faa07);}};}function respondWithFilteredResult(_0x3ecbc8,_0x374225){return function(_0x1169f3){if(_0x1169f3){var _0x2e777c=typeof _0x374225[_0x9113('0x20')]===_0x9113('0x21')&&typeof _0x374225[_0x9113('0x22')]===_0x9113('0x21');var _0x877362=_0x1169f3['count'];var _0x2cb870=_0x2e777c?0x0:_0x374225[_0x9113('0x20')];var _0xd25738=_0x2e777c?_0x1169f3[_0x9113('0x23')]:_0x374225['offset']+_0x374225['limit'];var _0x3c6a48;if(_0xd25738>=_0x877362){_0xd25738=_0x877362;_0x3c6a48=0xc8;}else{_0x3c6a48=0xce;}_0x3ecbc8[_0x9113('0x1e')](_0x3c6a48);return _0x3ecbc8[_0x9113('0x24')](_0x9113('0x25'),_0x2cb870+'-'+_0xd25738+'/'+_0x877362)[_0x9113('0x1f')](_0x1169f3);}return null;};}function patchUpdates(_0x3ca603){return function(_0x34c92e){try{jsonpatch['apply'](_0x34c92e,_0x3ca603,!![]);}catch(_0x3f9295){return BPromise[_0x9113('0x26')](_0x3f9295);}return _0x34c92e[_0x9113('0x27')]();};}function saveUpdates(_0x4671de,_0x62b601){return function(_0x1cafbc){if(_0x1cafbc){return _0x1cafbc['update'](_0x4671de)[_0x9113('0x28')](function(_0x3741f0){return _0x3741f0;});}return null;};}function removeEntity(_0x487b3f,_0x56c16b){return function(_0x7571f0){if(_0x7571f0){return _0x7571f0[_0x9113('0x29')]()[_0x9113('0x28')](function(){_0x487b3f[_0x9113('0x1e')](0xcc)[_0x9113('0x2a')]();});}};}function handleEntityNotFound(_0x598859,_0x46e113){return function(_0x2dceeb){if(!_0x2dceeb){_0x598859['sendStatus'](0x194);}return _0x2dceeb;};}function handleError(_0x5f06e6,_0x5e71e4){_0x5e71e4=_0x5e71e4||0x1f4;return function(_0x3e5c28){logger['error'](_0x3e5c28[_0x9113('0x2b')]);if(_0x3e5c28['name']){delete _0x3e5c28['name'];}_0x5f06e6[_0x9113('0x1e')](_0x5e71e4)[_0x9113('0x2c')](_0x3e5c28);};}exports[_0x9113('0x2d')]=function(_0x2c9a55,_0x5bcd6a){var _0x4057fc={},_0x587475={},_0x285cf1={'count':0x0,'rows':[]};var _0xfbd8ee=_[_0x9113('0x2e')](db[_0x9113('0x2f')][_0x9113('0x30')],function(_0x1e5a3f){return{'name':_0x1e5a3f[_0x9113('0x31')],'type':_0x1e5a3f[_0x9113('0x32')][_0x9113('0x33')]};});_0x587475[_0x9113('0x34')]=_[_0x9113('0x2e')](_0xfbd8ee,'name');_0x587475['query']=_[_0x9113('0x35')](_0x2c9a55[_0x9113('0x36')]);_0x587475[_0x9113('0x37')]=_[_0x9113('0x38')](_0x587475[_0x9113('0x34')],_0x587475[_0x9113('0x36')]);_0x4057fc[_0x9113('0x39')]=_[_0x9113('0x38')](_0x587475[_0x9113('0x34')],qs[_0x9113('0x3a')](_0x2c9a55['query'][_0x9113('0x3a')]));_0x4057fc[_0x9113('0x39')]=_0x4057fc[_0x9113('0x39')][_0x9113('0x3b')]?_0x4057fc[_0x9113('0x39')]:_0x587475[_0x9113('0x34')];if(!_0x2c9a55['query']['hasOwnProperty'](_0x9113('0x3c'))){_0x4057fc[_0x9113('0x22')]=qs[_0x9113('0x22')](_0x2c9a55[_0x9113('0x36')][_0x9113('0x22')]);_0x4057fc[_0x9113('0x20')]=qs[_0x9113('0x20')](_0x2c9a55['query']['offset']);}_0x4057fc[_0x9113('0x3d')]=qs[_0x9113('0x3e')](_0x2c9a55[_0x9113('0x36')]['sort']);_0x4057fc['where']=qs[_0x9113('0x37')](_[_0x9113('0x3f')](_0x2c9a55[_0x9113('0x36')],_0x587475['filters']),_0xfbd8ee);if(_0x2c9a55[_0x9113('0x36')]['filter']){_0x4057fc['where']=_[_0x9113('0x40')](_0x4057fc['where'],{'$or':_[_0x9113('0x2e')](_0xfbd8ee,function(_0x5c6699){if(_0x5c6699[_0x9113('0x32')]!==_0x9113('0x41')){var _0x3ea587={};_0x3ea587[_0x5c6699[_0x9113('0x42')]]={'$like':'%'+_0x2c9a55[_0x9113('0x36')]['filter']+'%'};return _0x3ea587;}})});}_0x4057fc=_[_0x9113('0x40')]({},_0x4057fc,_0x2c9a55[_0x9113('0x43')]);var _0x27f99f={'where':_0x4057fc[_0x9113('0x44')]};return db[_0x9113('0x2f')][_0x9113('0x23')](_0x27f99f)[_0x9113('0x28')](function(_0x167669){_0x285cf1[_0x9113('0x23')]=_0x167669;if(_0x2c9a55[_0x9113('0x36')][_0x9113('0x45')]){_0x4057fc['include']=[{'all':!![]}];}return db[_0x9113('0x2f')][_0x9113('0x46')](_0x4057fc);})['then'](function(_0x29113e){_0x285cf1['rows']=_0x29113e;return _0x285cf1;})[_0x9113('0x28')](respondWithFilteredResult(_0x5bcd6a,_0x4057fc))[_0x9113('0x47')](handleError(_0x5bcd6a,null));};exports[_0x9113('0x48')]=function(_0x8e8eb5,_0x1161aa){var _0x3dbd3b={'raw':!![],'where':{'id':_0x8e8eb5[_0x9113('0x49')]['id']}},_0x2e4c69={};_0x2e4c69['model']=_[_0x9113('0x35')](db[_0x9113('0x2f')]['rawAttributes']);_0x2e4c69['query']=_[_0x9113('0x35')](_0x8e8eb5[_0x9113('0x36')]);_0x2e4c69[_0x9113('0x37')]=_[_0x9113('0x38')](_0x2e4c69[_0x9113('0x34')],_0x2e4c69[_0x9113('0x36')]);_0x3dbd3b['attributes']=_[_0x9113('0x38')](_0x2e4c69[_0x9113('0x34')],qs[_0x9113('0x3a')](_0x8e8eb5[_0x9113('0x36')]['fields']));_0x3dbd3b[_0x9113('0x39')]=_0x3dbd3b[_0x9113('0x39')][_0x9113('0x3b')]?_0x3dbd3b[_0x9113('0x39')]:_0x2e4c69[_0x9113('0x34')];if(_0x8e8eb5[_0x9113('0x36')]['includeAll']){_0x3dbd3b[_0x9113('0x4a')]=[{'all':!![]}];}_0x3dbd3b=_[_0x9113('0x40')]({},_0x3dbd3b,_0x8e8eb5[_0x9113('0x43')]);return db[_0x9113('0x2f')]['find'](_0x3dbd3b)[_0x9113('0x28')](handleEntityNotFound(_0x1161aa,null))[_0x9113('0x28')](respondWithResult(_0x1161aa,null))['catch'](handleError(_0x1161aa,null));};exports[_0x9113('0x4b')]=function(_0x587e0a,_0x5a8a74){return db[_0x9113('0x2f')][_0x9113('0x4b')](_0x587e0a[_0x9113('0x4c')],{})[_0x9113('0x28')](respondWithResult(_0x5a8a74,0xc9))[_0x9113('0x47')](handleError(_0x5a8a74,null));};exports['update']=function(_0x2b134a,_0x21c2b9){if(_0x2b134a['body']['id']){delete _0x2b134a[_0x9113('0x4c')]['id'];}return db['ChatInternalMessage'][_0x9113('0x4d')]({'where':{'id':_0x2b134a[_0x9113('0x49')]['id']}})['then'](handleEntityNotFound(_0x21c2b9,null))[_0x9113('0x28')](saveUpdates(_0x2b134a[_0x9113('0x4c')],null))['then'](respondWithResult(_0x21c2b9,null))[_0x9113('0x47')](handleError(_0x21c2b9,null));};exports['destroy']=function(_0x5aebb4,_0x57d96f){return db['ChatInternalMessage'][_0x9113('0x4d')]({'where':{'id':_0x5aebb4[_0x9113('0x49')]['id']}})[_0x9113('0x28')](handleEntityNotFound(_0x57d96f,null))['then'](removeEntity(_0x57d96f,null))[_0x9113('0x47')](handleError(_0x57d96f,null));};exports['describe']=function(_0x5c675d,_0x12b9c4){return db[_0x9113('0x2f')]['describe']()[_0x9113('0x28')](respondWithResult(_0x12b9c4,null))['catch'](handleError(_0x12b9c4,null));};function wrapUser(_0x37e254){return function(_0x395790){var _0xe9e947=_0x37e254['get']({'plain':!![]});_0xe9e947['messages']=[];if(_0x395790){_0xe9e947[_0x9113('0x4e')]=_0x395790[_0x9113('0x4f')];_0xe9e947['lastMessage']=_0x395790;}else{_0xe9e947[_0x9113('0x4e')]=moment(0x0)[_0x9113('0x50')](_0x9113('0x51'));_0xe9e947[_0x9113('0x52')]={};}return _0xe9e947;};}exports[_0x9113('0x53')]=function(_0x55add6,_0x4d72e3,_0x43e1fd){var _0x343aa2=[];return db[_0x9113('0x54')][_0x9113('0x46')]({'where':{'role':[_0x9113('0x55'),_0x9113('0x56'),'user']},'attributes':['id',_0x9113('0x57'),_0x9113('0x42'),_0x9113('0x58'),_0x9113('0x59'),_0x9113('0x5a'),'online','lastLoginAt',_0x9113('0x5b'),_0x9113('0x5c')],'order':qs[_0x9113('0x3e')](_0x9113('0x5d')),'include':[{'model':db['VoiceQueue'],'as':_0x9113('0x5e'),'attributes':['id',_0x9113('0x42'),_0x9113('0x32')],'through':{'attributes':[]}}]})[_0x9113('0x28')](function(_0x92a55a){if(_0x92a55a){var _0x31ac7f=_0x55add6[_0x9113('0x5f')][_0x9113('0x60')]({'plain':!![]});if(!_0x31ac7f)throw new Error(_0x9113('0x61'));if(_0x31ac7f[_0x9113('0x58')]===_0x9113('0x5f')){return db[_0x9113('0x62')][_0x9113('0x4d')]({'where':{'name':_0x9113('0x63'),'userProfileId':_0x31ac7f['userProfileId']},'raw':!![]})[_0x9113('0x28')](function(_0x14c180){if(_0x14c180){if(_0x14c180[_0x9113('0x64')]===0x0){return db[_0x9113('0x65')][_0x9113('0x46')]({'where':{'sectionId':_0x14c180['id']},'raw':!![]})[_0x9113('0x28')](function(_0xd1f60c){var _0x16044d=[];if(_[_0x9113('0x66')](_0xd1f60c)){_0x16044d=_[_0x9113('0x67')](_0x92a55a,function(_0x39d1a1){if(_0x39d1a1['role']!=='agent'){return _0x39d1a1;}});return _0x16044d;}else{for(var _0x3e4cd3=0x0;_0x3e4cd3<_0x92a55a['length'];_0x3e4cd3++){var _0x17c4b1=_0x92a55a[_0x3e4cd3];if(_0x17c4b1[_0x9113('0x58')]===_0x9113('0x55')){var _0x47c95b=_[_0x9113('0x4d')](_0xd1f60c,function(_0x25a6c1){return _0x25a6c1[_0x9113('0x68')]===_0x17c4b1['id'];});if(_0x47c95b)_0x16044d['push'](_0x17c4b1);}else{_0x16044d[_0x9113('0x69')](_0x17c4b1);}}return _0x16044d;}});}else{return _0x92a55a;}}else{var _0x2c67c8=_[_0x9113('0x67')](_0x92a55a,function(_0x45967d){if(_0x45967d[_0x9113('0x58')]!==_0x9113('0x55')){return _0x45967d;}});return _0x2c67c8;}});}else{return _0x92a55a;}}})[_0x9113('0x28')](function(_0x16178d){var _0x3f68ce=[];if(_0x16178d){_0x343aa2=_0x16178d;for(var _0x3e4e0f=0x0;_0x3e4e0f<_0x16178d[_0x9113('0x3b')];_0x3e4e0f+=0x1){_0x343aa2[_0x3e4e0f][_0x9113('0x6a')]=[];_0x3f68ce[_0x9113('0x69')](db[_0x9113('0x2f')][_0x9113('0x4d')]({'where':{'FromId':[_0x55add6[_0x9113('0x5f')]['id'],_0x16178d[_0x3e4e0f]['id']],'ToId':[_0x55add6[_0x9113('0x5f')]['id'],_0x16178d[_0x3e4e0f]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x9113('0x6b'),_0x9113('0x6c'),_0x9113('0x6d'),'body'],'order':qs['sort'](_0x9113('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x9113('0x28')](wrapUser(_0x16178d[_0x3e4e0f])));}return BPromise[_0x9113('0x6f')](_0x3f68ce);}return[];})[_0x9113('0x28')](function(_0x16c681){return{'rows':_0x16c681,'count':_0x16c681[_0x9113('0x3b')]};})[_0x9113('0x28')](respondWithResult(_0x4d72e3,null))['catch'](handleError(_0x4d72e3,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index abb0edb..5f157ec 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 _0x5af6=['exports','events','save','remove','emit','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5af6,0x15d));var _0x65af=function(_0x25b684,_0x6d754e){_0x25b684=_0x25b684-0x0;var _0x5da1d7=_0x5af6[_0x25b684];return _0x5da1d7;};'use strict';var EventEmitter=require(_0x65af('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x65af('0x1'),'afterUpdate':'update','afterDestroy':_0x65af('0x2')};function emitEvent(_0x7eb646){return function(_0x42b7dd,_0x59facd,_0x3e3afa){ChatInternalMessageEvents[_0x65af('0x3')](_0x7eb646+':'+_0x42b7dd['id'],_0x42b7dd);ChatInternalMessageEvents[_0x65af('0x3')](_0x7eb646,_0x42b7dd);_0x3e3afa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x65af('0x4')](e,emitEvent(event));}}module[_0x65af('0x5')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xca50=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','update','remove'];(function(_0x2aa978,_0x444a1f){var _0x1b4452=function(_0x28f952){while(--_0x28f952){_0x2aa978['push'](_0x2aa978['shift']());}};_0x1b4452(++_0x444a1f);}(_0xca50,0xaf));var _0x0ca5=function(_0x4cab10,_0x42411c){_0x4cab10=_0x4cab10-0x0;var _0x5af3cc=_0xca50[_0x4cab10];return _0x5af3cc;};'use strict';var EventEmitter=require(_0x0ca5('0x0'));var ChatInternalMessage=require(_0x0ca5('0x1'))['db'][_0x0ca5('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0ca5('0x3'),'afterDestroy':_0x0ca5('0x4')};function emitEvent(_0x2271b3){return function(_0x2db617,_0x1fbcfb,_0x5ef6fc){ChatInternalMessageEvents['emit'](_0x2271b3+':'+_0x2db617['id'],_0x2db617);ChatInternalMessageEvents[_0x0ca5('0x5')](_0x2271b3,_0x2db617);_0x5ef6fc(null);};}for(var e in events){if(events[_0x0ca5('0x6')](e)){var event=events[e];ChatInternalMessage[_0x0ca5('0x7')](e,emitEvent(event));}}module[_0x0ca5('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 564e574..58c3536 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 _0x1f70=['../../config/environment','./chatInternalMessage.attributes','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x122068,_0x4e0ff4){var _0x1874d8=function(_0x30b267){while(--_0x30b267){_0x122068['push'](_0x122068['shift']());}};_0x1874d8(++_0x4e0ff4);}(_0x1f70,0x126));var _0x01f7=function(_0x1c5703,_0x5da707){_0x1c5703=_0x1c5703-0x0;var _0x20e6c2=_0x1f70[_0x1c5703];return _0x20e6c2;};'use strict';var _=require('lodash');var util=require(_0x01f7('0x0'));var logger=require(_0x01f7('0x1'))('api');var moment=require(_0x01f7('0x2'));var BPromise=require(_0x01f7('0x3'));var rp=require(_0x01f7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x01f7('0x5'));var config=require(_0x01f7('0x6'));var attributes=require(_0x01f7('0x7'));module['exports']=function(_0x554fdf,_0x525745){return _0x554fdf[_0x01f7('0x8')]('ChatInternalMessage',attributes,{'tableName':_0x01f7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x01f7('0xa'),'collate':_0x01f7('0xb')});};
\ No newline at end of file
+var _0x5aa5=['chat_internal_messages','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x5aa5,0x154));var _0x55aa=function(_0x3878c5,_0x5021a2){_0x3878c5=_0x3878c5-0x0;var _0xa9a557=_0x5aa5[_0x3878c5];return _0xa9a557;};'use strict';var _=require(_0x55aa('0x0'));var util=require('util');var logger=require(_0x55aa('0x1'))(_0x55aa('0x2'));var moment=require(_0x55aa('0x3'));var BPromise=require('bluebird');var rp=require(_0x55aa('0x4'));var fs=require('fs');var path=require(_0x55aa('0x5'));var rimraf=require(_0x55aa('0x6'));var config=require(_0x55aa('0x7'));var attributes=require(_0x55aa('0x8'));module[_0x55aa('0x9')]=function(_0x435b8a,_0x116da1){return _0x435b8a['define'](_0x55aa('0xa'),attributes,{'tableName':_0x55aa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x55aa('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index ad9b3a4..cf3f3ac 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 _0x6a5a=['result','catch','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x25d3c5,_0x29cb4c){var _0x1f0982=function(_0x451322){while(--_0x451322){_0x25d3c5['push'](_0x25d3c5['shift']());}};_0x1f0982(++_0x29cb4c);}(_0x6a5a,0xaa));var _0xa6a5=function(_0x40b146,_0x20cbf8){_0x40b146=_0x40b146-0x0;var _0x388875=_0x6a5a[_0x40b146];return _0x388875;};'use strict';var _=require(_0xa6a5('0x0'));var util=require(_0xa6a5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6a5('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa6a5('0x3'));var logger=require(_0xa6a5('0x4'))(_0xa6a5('0x5'));var config=require(_0xa6a5('0x6'));var jayson=require(_0xa6a5('0x7'));var client=jayson['client'][_0xa6a5('0x8')]({'port':0x232a});config[_0xa6a5('0x9')]=_[_0xa6a5('0xa')](config[_0xa6a5('0x9')],{'host':_0xa6a5('0xb'),'port':0x18eb});var socket=require(_0xa6a5('0xc'))(new Redis(config[_0xa6a5('0x9')]));require(_0xa6a5('0xd'))[_0xa6a5('0xe')](socket);function respondWithRpcPromise(_0x245ddf,_0x5a23f1,_0x29d13b){return new BPromise(function(_0x39c405,_0x1cb70a){return client[_0xa6a5('0xf')](_0x245ddf,_0x29d13b)[_0xa6a5('0x10')](function(_0x59f8b9){logger[_0xa6a5('0x11')](_0xa6a5('0x12'),_0x5a23f1,_0xa6a5('0x13'));logger[_0xa6a5('0x14')](_0xa6a5('0x15'),_0x5a23f1,'request\x20sent',JSON[_0xa6a5('0x16')](_0x59f8b9));if(_0x59f8b9['error']){if(_0x59f8b9[_0xa6a5('0x17')][_0xa6a5('0x18')]===0x1f4){logger[_0xa6a5('0x17')](_0xa6a5('0x12'),_0x5a23f1,_0x59f8b9[_0xa6a5('0x17')][_0xa6a5('0x19')]);return _0x1cb70a(_0x59f8b9[_0xa6a5('0x17')]['message']);}logger[_0xa6a5('0x17')](_0xa6a5('0x12'),_0x5a23f1,_0x59f8b9[_0xa6a5('0x17')][_0xa6a5('0x19')]);return _0x39c405(_0x59f8b9[_0xa6a5('0x17')][_0xa6a5('0x19')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x5a23f1,_0xa6a5('0x13'));_0x39c405(_0x59f8b9[_0xa6a5('0x1a')]['message']);}})[_0xa6a5('0x1b')](function(_0x2cf455){logger[_0xa6a5('0x17')](_0xa6a5('0x12'),_0x5a23f1,_0x2cf455);_0x1cb70a(_0x2cf455);});});}
\ No newline at end of file
+var _0xe8a4=['debug','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x8576ee,_0x36862b){var _0x1c0943=function(_0xe181c6){while(--_0xe181c6){_0x8576ee['push'](_0x8576ee['shift']());}};_0x1c0943(++_0x36862b);}(_0xe8a4,0x158));var _0x4e8a=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xe8a4[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x4e8a('0x0'));var util=require('util');var moment=require(_0x4e8a('0x1'));var BPromise=require('bluebird');var rs=require(_0x4e8a('0x2'));var fs=require('fs');var Redis=require(_0x4e8a('0x3'));var db=require(_0x4e8a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4e8a('0x5'))(_0x4e8a('0x6'));var config=require('../../config/environment');var jayson=require(_0x4e8a('0x7'));var client=jayson[_0x4e8a('0x8')][_0x4e8a('0x9')]({'port':0x232a});config[_0x4e8a('0xa')]=_[_0x4e8a('0xb')](config[_0x4e8a('0xa')],{'host':_0x4e8a('0xc'),'port':0x18eb});var socket=require(_0x4e8a('0xd'))(new Redis(config[_0x4e8a('0xa')]));require(_0x4e8a('0xe'))['register'](socket);function respondWithRpcPromise(_0x1cbdf3,_0x3904bd,_0x395889){return new BPromise(function(_0x3ebde6,_0x5beaee){return client[_0x4e8a('0xf')](_0x1cbdf3,_0x395889)[_0x4e8a('0x10')](function(_0x50469a){logger[_0x4e8a('0x11')](_0x4e8a('0x12'),_0x3904bd,_0x4e8a('0x13'));logger[_0x4e8a('0x14')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x3904bd,_0x4e8a('0x13'),JSON['stringify'](_0x50469a));if(_0x50469a[_0x4e8a('0x15')]){if(_0x50469a[_0x4e8a('0x15')][_0x4e8a('0x16')]===0x1f4){logger['error'](_0x4e8a('0x12'),_0x3904bd,_0x50469a['error'][_0x4e8a('0x17')]);return _0x5beaee(_0x50469a[_0x4e8a('0x15')][_0x4e8a('0x17')]);}logger['error'](_0x4e8a('0x12'),_0x3904bd,_0x50469a[_0x4e8a('0x15')][_0x4e8a('0x17')]);return _0x3ebde6(_0x50469a[_0x4e8a('0x15')]['message']);}else{logger[_0x4e8a('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x3904bd,_0x4e8a('0x13'));_0x3ebde6(_0x50469a[_0x4e8a('0x18')][_0x4e8a('0x17')]);}})[_0x4e8a('0x19')](function(_0x2b51d5){logger[_0x4e8a('0x15')](_0x4e8a('0x12'),_0x3904bd,_0x2b51d5);_0x5beaee(_0x2b51d5);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 308a9e8..23cc84b 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 _0x2c1b=['remove','emit','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0x2c1b,0x1e8));var _0xb2c1=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x2c1b[_0x2aecb2];return _0x3ebb80;};'use strict';var ChatInternalMessageEvents=require(_0xb2c1('0x0'));var events=[_0xb2c1('0x1'),_0xb2c1('0x2'),'update'];function createListener(_0x5f241b,_0x3f6fc8){return function(_0xda8223){_0x3f6fc8[_0xb2c1('0x3')](_0x5f241b,_0xda8223);};}function removeListener(_0x496d57,_0x4b2acc){return function(){ChatInternalMessageEvents['removeListener'](_0x496d57,_0x4b2acc);};}exports[_0xb2c1('0x4')]=function(_0x181d12){for(var _0x4f128e=0x0,_0x293552=events[_0xb2c1('0x5')];_0x4f128e<_0x293552;_0x4f128e++){var _0x444d67=events[_0x4f128e];var _0x52d0ee=createListener(_0xb2c1('0x6')+_0x444d67,_0x181d12);ChatInternalMessageEvents['on'](_0x444d67,_0x52d0ee);}};
\ No newline at end of file
+var _0x16d8=['update','register','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x16d8,0xb8));var _0x816d=function(_0x4595cb,_0x21e43c){_0x4595cb=_0x4595cb-0x0;var _0x49438b=_0x16d8[_0x4595cb];return _0x49438b;};'use strict';var ChatInternalMessageEvents=require(_0x816d('0x0'));var events=['save','remove',_0x816d('0x1')];function createListener(_0x56f0ad,_0x52676a){return function(_0x5abfdb){_0x52676a['emit'](_0x56f0ad,_0x5abfdb);};}function removeListener(_0x1c3f8a,_0xf5bbf0){return function(){ChatInternalMessageEvents['removeListener'](_0x1c3f8a,_0xf5bbf0);};}exports[_0x816d('0x2')]=function(_0x4b63c7){for(var _0x247569=0x0,_0x3f0848=events[_0x816d('0x3')];_0x247569<_0x3f0848;_0x247569++){var _0x39fc46=events[_0x247569];var _0x5e3fde=createListener(_0x816d('0x4')+_0x39fc46,_0x4b63c7);ChatInternalMessageEvents['on'](_0x39fc46,_0x5e3fde);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index e4218bf..d38f369 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 _0x9140=['describe','/users','getUsers','/:id','show','post','create','put','update','delete','util','path','express','fs-extra','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated'];(function(_0x49a77d,_0x5b9dc5){var _0x4f5b3a=function(_0x1aadce){while(--_0x1aadce){_0x49a77d['push'](_0x49a77d['shift']());}};_0x4f5b3a(++_0x5b9dc5);}(_0x9140,0x14e));var _0x0914=function(_0x5128a0,_0x52c284){_0x5128a0=_0x5128a0-0x0;var _0x56d6da=_0x9140[_0x5128a0];return _0x56d6da;};'use strict';var multer=require('multer');var util=require(_0x0914('0x0'));var path=require(_0x0914('0x1'));var timeout=require('connect-timeout');var express=require(_0x0914('0x2'));var router=express['Router']();var fs_extra=require(_0x0914('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0914('0x4'));var controller=require(_0x0914('0x5'));router[_0x0914('0x6')]('/',auth[_0x0914('0x7')](),controller['index']);router[_0x0914('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x0914('0x8')]);router[_0x0914('0x6')](_0x0914('0x9'),auth[_0x0914('0x7')](),controller[_0x0914('0xa')]);router[_0x0914('0x6')](_0x0914('0xb'),auth[_0x0914('0x7')](),controller[_0x0914('0xc')]);router[_0x0914('0xd')]('/',auth[_0x0914('0x7')](),controller[_0x0914('0xe')]);router[_0x0914('0xf')](_0x0914('0xb'),controller[_0x0914('0x10')]);router[_0x0914('0x11')]('/:id',auth[_0x0914('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xfb79=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post','create','destroy','exports','multer'];(function(_0x12cc63,_0x38bf22){var _0x48243f=function(_0x57a0d7){while(--_0x57a0d7){_0x12cc63['push'](_0x12cc63['shift']());}};_0x48243f(++_0x38bf22);}(_0xfb79,0x19d));var _0x9fb7=function(_0x304d1f,_0x41e22f){_0x304d1f=_0x304d1f-0x0;var _0x3e3583=_0xfb79[_0x304d1f];return _0x3e3583;};'use strict';var multer=require(_0x9fb7('0x0'));var util=require(_0x9fb7('0x1'));var path=require(_0x9fb7('0x2'));var timeout=require(_0x9fb7('0x3'));var express=require(_0x9fb7('0x4'));var router=express[_0x9fb7('0x5')]();var fs_extra=require(_0x9fb7('0x6'));var auth=require(_0x9fb7('0x7'));var interaction=require(_0x9fb7('0x8'));var config=require('../../config/environment');var controller=require(_0x9fb7('0x9'));router[_0x9fb7('0xa')]('/',auth[_0x9fb7('0xb')](),controller[_0x9fb7('0xc')]);router[_0x9fb7('0xa')](_0x9fb7('0xd'),auth[_0x9fb7('0xb')](),controller[_0x9fb7('0xe')]);router[_0x9fb7('0xa')](_0x9fb7('0xf'),auth['isAuthenticated'](),controller[_0x9fb7('0x10')]);router[_0x9fb7('0xa')](_0x9fb7('0x11'),auth['isAuthenticated'](),controller[_0x9fb7('0x12')]);router[_0x9fb7('0x13')]('/',auth[_0x9fb7('0xb')](),controller[_0x9fb7('0x14')]);router['put']('/:id',controller['update']);router['delete']('/:id',auth[_0x9fb7('0xb')](),controller[_0x9fb7('0x15')]);module[_0x9fb7('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index a57dab2..5ab2a13 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 _0x236c=['BOOLEAN','ENUM','out','DATE','STRING','sequelize','TEXT','medium'];(function(_0x5b4c88,_0xb82a52){var _0x5dcc4f=function(_0x16f135){while(--_0x16f135){_0x5b4c88['push'](_0x5b4c88['shift']());}};_0x5dcc4f(++_0xb82a52);}(_0x236c,0x155));var _0xc236=function(_0x155fa8,_0x2f7e65){_0x155fa8=_0x155fa8-0x0;var _0x58dc85=_0x236c[_0x155fa8];return _0x58dc85;};'use strict';var Sequelize=require(_0xc236('0x0'));module['exports']={'body':{'type':Sequelize[_0xc236('0x1')](_0xc236('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xc236('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc236('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc236('0x4')]('in','out'),'defaultValue':_0xc236('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc236('0x6')]},'providerName':{'type':Sequelize[_0xc236('0x7')]},'providerResponse':{'type':Sequelize[_0xc236('0x1')]}};
\ No newline at end of file
+var _0xbaf0=['DATE','STRING','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x3931ec,_0x5e9a6c){var _0x2d15e6=function(_0x3f745b){while(--_0x3f745b){_0x3931ec['push'](_0x3931ec['shift']());}};_0x2d15e6(++_0x5e9a6c);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'body':{'type':Sequelize[_0x0baf('0x1')](_0x0baf('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0baf('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x0baf('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0baf('0x4')]('in','out'),'defaultValue':_0x0baf('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x0baf('0x6')]},'providerName':{'type':Sequelize[_0x0baf('0x7')]},'providerResponse':{'type':Sequelize[_0x0baf('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 0fbf305..dc9929e 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 _0x20b4=['socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','stack','name','map','ChatMessage','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','keys','rawAttributes','fields','include','find','create','body','describe','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteractionId','isNil','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','Sequelize','contact','fullname','email','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','chat','ChatInteraction','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','User','internal','rejectmessage','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x20b4,0xeb));var _0x420b=function(_0x109e1d,_0x4474f0){_0x109e1d=_0x109e1d-0x0;var _0x549e93=_0x20b4[_0x109e1d];return _0x549e93;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x420b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x420b('0x1'));var rp=require(_0x420b('0x2'));var moment=require(_0x420b('0x3'));var BPromise=require(_0x420b('0x4'));var Mustache=require(_0x420b('0x5'));var util=require('util');var path=require(_0x420b('0x6'));var sox=require(_0x420b('0x7'));var csv=require(_0x420b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x420b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x420b('0xa'));var jsforce=require(_0x420b('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x420b('0xc'));var Papa=require(_0x420b('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x420b('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x420b('0xf'));var logger=require(_0x420b('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x420b('0x11'));var licenseUtil=require(_0x420b('0x12'));var db=require(_0x420b('0x13'))['db'];config[_0x420b('0x14')]=_[_0x420b('0x15')](config[_0x420b('0x14')],{'host':_0x420b('0x16'),'port':0x18eb});var socket=require(_0x420b('0x17'))(new Redis(config['redis']));require(_0x420b('0x18'))[_0x420b('0x19')](socket);var jayson=require(_0x420b('0x1a'));var client=jayson[_0x420b('0x1b')][_0x420b('0x1c')]({'port':0x232c});var client9002=jayson[_0x420b('0x1b')][_0x420b('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x25b2f6,_0x26cbda,_0x5e70b1,_0x341ad4){return new BPromise(function(_0x54b9f9,_0x308db6){var _0x59f7e0=_0x341ad4||client;return _0x59f7e0['request'](_0x25b2f6,_0x5e70b1)[_0x420b('0x1d')](function(_0x54add6){logger['info'](_0x420b('0x1e'),_0x26cbda,_0x420b('0x1f'));logger[_0x420b('0x20')](_0x420b('0x21'),_0x26cbda,_0x420b('0x1f'),JSON[_0x420b('0x22')](_0x54add6));if(_0x54add6[_0x420b('0x23')]){if(_0x54add6[_0x420b('0x23')][_0x420b('0x24')]===0x1f4){logger[_0x420b('0x23')]('ChatMessage,\x20%s,\x20%s',_0x26cbda,_0x54add6[_0x420b('0x23')][_0x420b('0x25')]);return _0x308db6(_0x54add6[_0x420b('0x23')][_0x420b('0x25')]);}logger[_0x420b('0x23')](_0x420b('0x1e'),_0x26cbda,_0x54add6[_0x420b('0x23')][_0x420b('0x25')]);return _0x54b9f9(_0x54add6[_0x420b('0x23')][_0x420b('0x25')]);}else{logger[_0x420b('0x26')](_0x420b('0x1e'),_0x26cbda,_0x420b('0x1f'));_0x54b9f9(_0x54add6[_0x420b('0x27')]['message']);}})[_0x420b('0x28')](function(_0x2d8cda){logger[_0x420b('0x23')](_0x420b('0x1e'),_0x26cbda,_0x2d8cda);_0x308db6(_0x2d8cda);});});}function respondWithStatusCode(_0x4d96f8,_0x159e49){_0x159e49=_0x159e49||0xcc;return function(_0x2583d4){if(_0x2583d4){return _0x4d96f8[_0x420b('0x29')](_0x159e49);}return _0x4d96f8[_0x420b('0x2a')](_0x159e49)[_0x420b('0x2b')]();};}function respondWithResult(_0x5ee1d0,_0x1753e7){_0x1753e7=_0x1753e7||0xc8;return function(_0x8132e3){if(_0x8132e3){return _0x5ee1d0['status'](_0x1753e7)[_0x420b('0x2c')](_0x8132e3);}};}function respondWithFilteredResult(_0x336760,_0x5471de){return function(_0xa579bc){if(_0xa579bc){var _0x295429=typeof _0x5471de[_0x420b('0x2d')]===_0x420b('0x2e')&&typeof _0x5471de[_0x420b('0x2f')]===_0x420b('0x2e');var _0x3bf4c9=_0xa579bc[_0x420b('0x30')];var _0x5e00e4=_0x295429?0x0:_0x5471de[_0x420b('0x2d')];var _0x53fbf4=_0x295429?_0xa579bc[_0x420b('0x30')]:_0x5471de[_0x420b('0x2d')]+_0x5471de['limit'];var _0x4bbb1d;if(_0x53fbf4>=_0x3bf4c9){_0x53fbf4=_0x3bf4c9;_0x4bbb1d=0xc8;}else{_0x4bbb1d=0xce;}_0x336760[_0x420b('0x2a')](_0x4bbb1d);return _0x336760[_0x420b('0x31')]('Content-Range',_0x5e00e4+'-'+_0x53fbf4+'/'+_0x3bf4c9)['json'](_0xa579bc);}return null;};}function patchUpdates(_0x25a5ab){return function(_0x21a636){try{jsonpatch[_0x420b('0x32')](_0x21a636,_0x25a5ab,!![]);}catch(_0x5bcd15){return BPromise[_0x420b('0x33')](_0x5bcd15);}return _0x21a636[_0x420b('0x34')]();};}function saveUpdates(_0x57f63d,_0x5c3813){return function(_0xf0a330){if(_0xf0a330){return _0xf0a330[_0x420b('0x35')](_0x57f63d)[_0x420b('0x1d')](function(_0x502d40){return _0x502d40;});}return null;};}function removeEntity(_0x828a4d,_0x13e137){return function(_0x34341){if(_0x34341){return _0x34341[_0x420b('0x36')]()[_0x420b('0x1d')](function(){_0x828a4d['status'](0xcc)[_0x420b('0x2b')]();});}};}function handleEntityNotFound(_0x3c0a1d,_0x3e5ac0){return function(_0xbd6b32){if(!_0xbd6b32){_0x3c0a1d[_0x420b('0x29')](0x194);}return _0xbd6b32;};}function handleError(_0x595b,_0x2c626d){_0x2c626d=_0x2c626d||0x1f4;return function(_0x4a7a14){logger[_0x420b('0x23')](_0x4a7a14[_0x420b('0x37')]);if(_0x4a7a14[_0x420b('0x38')]){delete _0x4a7a14[_0x420b('0x38')];}_0x595b['status'](_0x2c626d)['send'](_0x4a7a14);};}exports['index']=function(_0xef61b4,_0xfafeec){var _0x5663ae={},_0x468f92={},_0xb09649={'count':0x0,'rows':[]};var _0x1b721b=_[_0x420b('0x39')](db[_0x420b('0x3a')]['rawAttributes'],function(_0x154077){return{'name':_0x154077[_0x420b('0x3b')],'type':_0x154077[_0x420b('0x3c')][_0x420b('0x3d')]};});_0x468f92[_0x420b('0x3e')]=_[_0x420b('0x39')](_0x1b721b,_0x420b('0x38'));_0x468f92[_0x420b('0x3f')]=_['keys'](_0xef61b4[_0x420b('0x3f')]);_0x468f92[_0x420b('0x40')]=_[_0x420b('0x41')](_0x468f92[_0x420b('0x3e')],_0x468f92[_0x420b('0x3f')]);_0x5663ae[_0x420b('0x42')]=_['intersection'](_0x468f92[_0x420b('0x3e')],qs['fields'](_0xef61b4[_0x420b('0x3f')]['fields']));_0x5663ae[_0x420b('0x42')]=_0x5663ae[_0x420b('0x42')][_0x420b('0x43')]?_0x5663ae['attributes']:_0x468f92[_0x420b('0x3e')];if(!_0xef61b4[_0x420b('0x3f')][_0x420b('0x44')](_0x420b('0x45'))){_0x5663ae[_0x420b('0x2f')]=qs[_0x420b('0x2f')](_0xef61b4[_0x420b('0x3f')][_0x420b('0x2f')]);_0x5663ae[_0x420b('0x2d')]=qs[_0x420b('0x2d')](_0xef61b4[_0x420b('0x3f')][_0x420b('0x2d')]);}_0x5663ae[_0x420b('0x46')]=qs[_0x420b('0x47')](_0xef61b4[_0x420b('0x3f')][_0x420b('0x47')]);_0x5663ae[_0x420b('0x48')]=qs[_0x420b('0x40')](_[_0x420b('0x49')](_0xef61b4[_0x420b('0x3f')],_0x468f92[_0x420b('0x40')]),_0x1b721b);if(_0xef61b4[_0x420b('0x3f')][_0x420b('0x4a')]){_0x5663ae[_0x420b('0x48')]=_[_0x420b('0x4b')](_0x5663ae['where'],{'$or':_[_0x420b('0x39')](_0x1b721b,function(_0x3b5ce1){if(_0x3b5ce1['type']!==_0x420b('0x4c')){var _0x40ae76={};_0x40ae76[_0x3b5ce1['name']]={'$like':'%'+_0xef61b4['query'][_0x420b('0x4a')]+'%'};return _0x40ae76;}})});}_0x5663ae=_[_0x420b('0x4b')]({},_0x5663ae,_0xef61b4[_0x420b('0x4d')]);var _0x26593d={'where':_0x5663ae['where']};return db[_0x420b('0x3a')]['count'](_0x26593d)[_0x420b('0x1d')](function(_0xdb0782){_0xb09649['count']=_0xdb0782;if(_0xef61b4['query']['includeAll']){_0x5663ae['include']=[{'all':!![]}];}return db[_0x420b('0x3a')][_0x420b('0x4e')](_0x5663ae);})[_0x420b('0x1d')](function(_0x1fea3e){_0xb09649[_0x420b('0x4f')]=_0x1fea3e;return _0xb09649;})[_0x420b('0x1d')](respondWithFilteredResult(_0xfafeec,_0x5663ae))[_0x420b('0x28')](handleError(_0xfafeec,null));};exports[_0x420b('0x50')]=function(_0xe59d62,_0x47262e){var _0x234f39={'raw':!![],'where':{'id':_0xe59d62[_0x420b('0x51')]['id']}},_0x37ab97={};_0x37ab97[_0x420b('0x3e')]=_[_0x420b('0x52')](db[_0x420b('0x3a')][_0x420b('0x53')]);_0x37ab97[_0x420b('0x3f')]=_[_0x420b('0x52')](_0xe59d62[_0x420b('0x3f')]);_0x37ab97[_0x420b('0x40')]=_[_0x420b('0x41')](_0x37ab97[_0x420b('0x3e')],_0x37ab97[_0x420b('0x3f')]);_0x234f39['attributes']=_[_0x420b('0x41')](_0x37ab97[_0x420b('0x3e')],qs[_0x420b('0x54')](_0xe59d62[_0x420b('0x3f')][_0x420b('0x54')]));_0x234f39['attributes']=_0x234f39['attributes'][_0x420b('0x43')]?_0x234f39[_0x420b('0x42')]:_0x37ab97[_0x420b('0x3e')];if(_0xe59d62['query']['includeAll']){_0x234f39[_0x420b('0x55')]=[{'all':!![]}];}_0x234f39=_[_0x420b('0x4b')]({},_0x234f39,_0xe59d62[_0x420b('0x4d')]);return db['ChatMessage'][_0x420b('0x56')](_0x234f39)[_0x420b('0x1d')](handleEntityNotFound(_0x47262e,null))[_0x420b('0x1d')](respondWithResult(_0x47262e,null))[_0x420b('0x28')](handleError(_0x47262e,null));};exports[_0x420b('0x57')]=function(_0x107079,_0x2aa418){return db[_0x420b('0x3a')][_0x420b('0x57')](_0x107079[_0x420b('0x58')],{})[_0x420b('0x1d')](respondWithResult(_0x2aa418,0xc9))[_0x420b('0x28')](handleError(_0x2aa418,null));};exports[_0x420b('0x35')]=function(_0x2d1801,_0x5dfee4){if(_0x2d1801[_0x420b('0x58')]['id']){delete _0x2d1801['body']['id'];}return db['ChatMessage'][_0x420b('0x56')]({'where':{'id':_0x2d1801[_0x420b('0x51')]['id']}})[_0x420b('0x1d')](handleEntityNotFound(_0x5dfee4,null))['then'](saveUpdates(_0x2d1801['body'],null))[_0x420b('0x1d')](respondWithResult(_0x5dfee4,null))[_0x420b('0x28')](handleError(_0x5dfee4,null));};exports['destroy']=function(_0x9a54ea,_0x2fce36){return db['ChatMessage'][_0x420b('0x56')]({'where':{'id':_0x9a54ea[_0x420b('0x51')]['id']}})['then'](handleEntityNotFound(_0x2fce36,null))[_0x420b('0x1d')](removeEntity(_0x2fce36,null))[_0x420b('0x28')](handleError(_0x2fce36,null));};exports[_0x420b('0x59')]=function(_0x2404a6,_0x5d1a24){return db[_0x420b('0x3a')][_0x420b('0x59')]()[_0x420b('0x1d')](respondWithResult(_0x5d1a24,null))[_0x420b('0x28')](handleError(_0x5d1a24,null));};var interaction_log=require(_0x420b('0x10'))('chat-interactions');exports[_0x420b('0x5a')]=function(_0x4943b5,_0x4dad0b,_0x4ca000){var _0x4120f2={'agent':{},'channel':'chat'};if(_0x4943b5[_0x420b('0x58')]['id']){delete _0x4943b5['body']['id'];}_0x4943b5[_0x420b('0x58')]['read']=!![];_0x4943b5[_0x420b('0x58')][_0x420b('0x5b')]=moment()[_0x420b('0x5c')](_0x420b('0x5d'));_0x4943b5[_0x420b('0x58')][_0x420b('0x5e')]=_0x4943b5['body'][_0x420b('0x5e')]||_0x4943b5[_0x420b('0x5f')]['id'];_0x4120f2[_0x420b('0x60')]['id']=_0x4943b5[_0x420b('0x58')][_0x420b('0x5e')];return db[_0x420b('0x3a')]['find']({'where':{'id':_0x4943b5['params']['id'],'UserId':null}})[_0x420b('0x1d')](handleEntityNotFound(_0x4dad0b,null))['then'](saveUpdates(_0x4943b5[_0x420b('0x58')],null))[_0x420b('0x1d')](function(_0x22f39a){if(_0x22f39a){_0x4120f2[_0x420b('0x25')]=_0x22f39a['get']({'plain':!![]});return db['ChatInteraction'][_0x420b('0x56')]({'where':{'id':_0x22f39a[_0x420b('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x4dad0b,null))[_0x420b('0x1d')](function(_0x138640){if(_0x138640){return _0x138640[_0x420b('0x35')]({'UserId':_0x4943b5[_0x420b('0x58')][_0x420b('0x5e')],'read1stAt':_[_0x420b('0x62')](_0x138640[_0x420b('0x63')])?moment()[_0x420b('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x420b('0x1d')](function(_0x32bdce){if(_0x32bdce){_0x4120f2[_0x420b('0x64')]=_0x32bdce[_0x420b('0x65')]({'plain':!![]});interaction_log['info'](_0x420b('0x66'),_0x4943b5['user']['id'],_0x4943b5[_0x420b('0x5f')][_0x420b('0x38')],_0x4943b5[_0x420b('0x5f')][_0x420b('0x67')],_0x4120f2[_0x420b('0x64')]['id'],_0x4943b5[_0x420b('0x58')]?JSON['stringify'](_0x4943b5[_0x420b('0x58')]):_0x420b('0x68'));return respondWithRpcPromise('AcceptMessage',_0x420b('0x69'),_0x4120f2);}return null;})['then'](function(_0x2837ef){var _0x2303f4='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2837ef[_0x420b('0x25')]['ContactId'];return db['sequelize'][_0x420b('0x3f')](_0x2303f4,{'type':db[_0x420b('0x6a')]['QueryTypes']['SELECT'],'raw':!![]})[_0x420b('0x1d')](function(_0xe55c61){return _0xe55c61;});})[_0x420b('0x1d')](function(_0x3de63a){if(_0x3de63a){_0x4120f2[_0x420b('0x25')][_0x420b('0x6b')]=_0x3de63a[0x0];if(!_0x4943b5[_0x420b('0x58')][_0x420b('0x5e')])return;return db['User'][_0x420b('0x56')]({'where':{'id':_0x4943b5[_0x420b('0x58')][_0x420b('0x5e')],'role':_0x420b('0x60')},'attributes':['id',_0x420b('0x38'),_0x420b('0x6c'),_0x420b('0x6d'),'internal'],'raw':!![]});}return null;})[_0x420b('0x1d')](function(_0x5e4644){if(!_0x5e4644)return null;_0x4120f2[_0x420b('0x25')]['agent']=_0x5e4644;return _0x4120f2;})[_0x420b('0x1d')](function(_0x45173c){if(_0x45173c){if(_0x4943b5[_0x420b('0x58')]['manual']){_0x4120f2[_0x420b('0x25')][_0x420b('0x6e')]=util[_0x420b('0x5c')](_0x420b('0x6f'),_0x4943b5[_0x420b('0x5f')][_0x420b('0x38')]);_0x4120f2[_0x420b('0x25')][_0x420b('0x70')]=_0x4120f2[_0x420b('0x70')];_0x4120f2['message'][_0x420b('0x71')]=_0x4120f2['channel'];_0x4120f2[_0x420b('0x25')][_0x420b('0x72')]=_0x420b('0x5a');return respondWithRpcPromise(_0x420b('0x73'),_0x420b('0x73'),{'event':_0x420b('0x74'),'message':_[_0x420b('0x4b')](_0x4120f2['message'],JSON[_0x420b('0x75')](_0x4120f2['interaction']['formData']))},client9002)['then'](function(){return _0x4120f2;});}return _0x4120f2;}return null;})[_0x420b('0x1d')](respondWithResult(_0x4dad0b,null))[_0x420b('0x28')](handleError(_0x4dad0b,null));};var interaction_log=require(_0x420b('0x10'))('chat-interactions');exports[_0x420b('0x33')]=function(_0x10da51,_0x18f363,_0x579538){var _0x142de2={'agent':{},'channel':_0x420b('0x76')};if(_0x10da51[_0x420b('0x58')]['id']){delete _0x10da51[_0x420b('0x58')]['id'];}_0x10da51[_0x420b('0x58')]['UserId']=_0x10da51[_0x420b('0x58')][_0x420b('0x5e')]||_0x10da51[_0x420b('0x5f')]['id'];_0x142de2[_0x420b('0x60')]['id']=_0x10da51[_0x420b('0x58')]['UserId'];return db[_0x420b('0x3a')]['find']({'where':{'id':_0x10da51[_0x420b('0x51')]['id'],'UserId':null}})[_0x420b('0x1d')](handleEntityNotFound(_0x18f363,null))[_0x420b('0x1d')](function(_0x19def9){if(_0x19def9){_0x142de2[_0x420b('0x25')]=_0x19def9['get']({'plain':!![]});return db[_0x420b('0x77')][_0x420b('0x56')]({'where':{'id':_0x19def9[_0x420b('0x61')]}});}return null;})[_0x420b('0x1d')](handleEntityNotFound(_0x18f363,null))['then'](function(_0x45ce79){if(_0x45ce79){_0x142de2['interaction']=_0x45ce79['get']({'plain':!![]});interaction_log[_0x420b('0x26')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x10da51[_0x420b('0x5f')]['id'],_0x10da51[_0x420b('0x5f')][_0x420b('0x38')],_0x10da51[_0x420b('0x5f')][_0x420b('0x67')],_0x142de2['interaction']['id'],_0x10da51[_0x420b('0x58')]?JSON['stringify'](_0x10da51[_0x420b('0x58')]):_0x420b('0x68'));return respondWithRpcPromise(_0x420b('0x78'),_0x420b('0x79'),_0x142de2);}return null;})[_0x420b('0x1d')](function(_0xa48d13){var _0x5e5962=_0x420b('0x7a')+_0xa48d13[_0x420b('0x25')][_0x420b('0x7b')];return db['sequelize'][_0x420b('0x3f')](_0x5e5962,{'type':db[_0x420b('0x6a')][_0x420b('0x7c')][_0x420b('0x7d')],'raw':!![]})[_0x420b('0x1d')](function(_0x3c45a9){return _0x3c45a9;});})[_0x420b('0x1d')](function(_0x34866f){if(_0x34866f){_0x142de2[_0x420b('0x25')][_0x420b('0x6b')]=_0x34866f[0x0];if(!_0x10da51[_0x420b('0x58')]['UserId'])return;return db[_0x420b('0x7e')]['find']({'where':{'id':_0x10da51[_0x420b('0x58')][_0x420b('0x5e')],'role':'agent'},'attributes':['id','name',_0x420b('0x6c'),_0x420b('0x6d'),_0x420b('0x7f')],'raw':!![]});}return null;})[_0x420b('0x1d')](function(_0xf63603){if(!_0xf63603)return null;_0x142de2[_0x420b('0x25')][_0x420b('0x60')]=_0xf63603;return _0x142de2;})['then'](function(_0x59d289){if(_0x59d289){_0x59d289['message'][_0x420b('0x6e')]=util[_0x420b('0x5c')](_0x420b('0x6f'),_0x10da51[_0x420b('0x5f')][_0x420b('0x38')]);_0x59d289[_0x420b('0x25')]['channel']=_0x142de2['channel'];_0x59d289[_0x420b('0x25')]['motionChannel']=_0x142de2['channel'];_0x59d289[_0x420b('0x25')][_0x420b('0x72')]='reject';respondWithRpcPromise(_0x420b('0x73'),_0x420b('0x73'),{'event':_0x420b('0x80'),'message':_[_0x420b('0x4b')](_0x142de2['message'],JSON['parse'](_0x142de2[_0x420b('0x64')]['formData']))},client9002);return _0x142de2;}return null;})[_0x420b('0x1d')](respondWithResult(_0x18f363,null))[_0x420b('0x28')](handleError(_0x18f363,null));};
\ No newline at end of file
+var _0x4dbf=['path','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','destroy','then','stack','name','send','index','ChatMessage','rawAttributes','fieldName','type','key','map','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','update','describe','chat-interactions','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','read1stAt','interaction','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x1e8c87,_0x599379){var _0x2a80c8=function(_0x4c5690){while(--_0x4c5690){_0x1e8c87['push'](_0x1e8c87['shift']());}};_0x2a80c8(++_0x599379);}(_0x4dbf,0x7f));var _0xf4db=function(_0x3c2166,_0x41fc16){_0x3c2166=_0x3c2166-0x0;var _0x30ccc3=_0x4dbf[_0x3c2166];return _0x30ccc3;};'use strict';var emlformat=require(_0xf4db('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf4db('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf4db('0x2'));var moment=require(_0xf4db('0x3'));var BPromise=require(_0xf4db('0x4'));var Mustache=require(_0xf4db('0x5'));var util=require(_0xf4db('0x6'));var path=require(_0xf4db('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf4db('0x8'));var squel=require(_0xf4db('0x9'));var crypto=require(_0xf4db('0xa'));var jsforce=require(_0xf4db('0xb'));var deskjs=require(_0xf4db('0xc'));var toCsv=require(_0xf4db('0xd'));var querystring=require('querystring');var Papa=require(_0xf4db('0xe'));var Redis=require(_0xf4db('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf4db('0x10'));var as=require(_0xf4db('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf4db('0x12'))(_0xf4db('0x13'));var utils=require(_0xf4db('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf4db('0x15'));var db=require(_0xf4db('0x16'))['db'];config[_0xf4db('0x17')]=_[_0xf4db('0x18')](config[_0xf4db('0x17')],{'host':_0xf4db('0x19'),'port':0x18eb});var socket=require(_0xf4db('0x1a'))(new Redis(config[_0xf4db('0x17')]));require(_0xf4db('0x1b'))[_0xf4db('0x1c')](socket);var jayson=require(_0xf4db('0x1d'));var client=jayson[_0xf4db('0x1e')][_0xf4db('0x1f')]({'port':0x232c});var client9002=jayson[_0xf4db('0x1e')][_0xf4db('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x171a95,_0x51121d,_0x5a16ba,_0x320006){return new BPromise(function(_0x38721a,_0x474e2c){var _0x2187a3=_0x320006||client;return _0x2187a3[_0xf4db('0x20')](_0x171a95,_0x5a16ba)['then'](function(_0x103e94){logger['info'](_0xf4db('0x21'),_0x51121d,_0xf4db('0x22'));logger[_0xf4db('0x23')](_0xf4db('0x24'),_0x51121d,'request\x20sent',JSON[_0xf4db('0x25')](_0x103e94));if(_0x103e94[_0xf4db('0x26')]){if(_0x103e94['error'][_0xf4db('0x27')]===0x1f4){logger[_0xf4db('0x26')]('ChatMessage,\x20%s,\x20%s',_0x51121d,_0x103e94[_0xf4db('0x26')][_0xf4db('0x28')]);return _0x474e2c(_0x103e94[_0xf4db('0x26')][_0xf4db('0x28')]);}logger[_0xf4db('0x26')]('ChatMessage,\x20%s,\x20%s',_0x51121d,_0x103e94[_0xf4db('0x26')]['message']);return _0x38721a(_0x103e94[_0xf4db('0x26')][_0xf4db('0x28')]);}else{logger[_0xf4db('0x29')]('ChatMessage,\x20%s,\x20%s',_0x51121d,_0xf4db('0x22'));_0x38721a(_0x103e94[_0xf4db('0x2a')][_0xf4db('0x28')]);}})['catch'](function(_0x142ecf){logger[_0xf4db('0x26')](_0xf4db('0x21'),_0x51121d,_0x142ecf);_0x474e2c(_0x142ecf);});});}function respondWithStatusCode(_0x279468,_0xad2c96){_0xad2c96=_0xad2c96||0xcc;return function(_0x457e19){if(_0x457e19){return _0x279468['sendStatus'](_0xad2c96);}return _0x279468[_0xf4db('0x2b')](_0xad2c96)[_0xf4db('0x2c')]();};}function respondWithResult(_0x365779,_0x5aff8f){_0x5aff8f=_0x5aff8f||0xc8;return function(_0x27cb6c){if(_0x27cb6c){return _0x365779[_0xf4db('0x2b')](_0x5aff8f)[_0xf4db('0x2d')](_0x27cb6c);}};}function respondWithFilteredResult(_0x4547d6,_0x3d80a6){return function(_0x20b4de){if(_0x20b4de){var _0x20a5c6=typeof _0x3d80a6[_0xf4db('0x2e')]==='undefined'&&typeof _0x3d80a6[_0xf4db('0x2f')]===_0xf4db('0x30');var _0x32d71f=_0x20b4de[_0xf4db('0x31')];var _0x5b03a6=_0x20a5c6?0x0:_0x3d80a6[_0xf4db('0x2e')];var _0x496cf1=_0x20a5c6?_0x20b4de[_0xf4db('0x31')]:_0x3d80a6[_0xf4db('0x2e')]+_0x3d80a6[_0xf4db('0x2f')];var _0x397581;if(_0x496cf1>=_0x32d71f){_0x496cf1=_0x32d71f;_0x397581=0xc8;}else{_0x397581=0xce;}_0x4547d6['status'](_0x397581);return _0x4547d6['set'](_0xf4db('0x32'),_0x5b03a6+'-'+_0x496cf1+'/'+_0x32d71f)[_0xf4db('0x2d')](_0x20b4de);}return null;};}function patchUpdates(_0x9e8181){return function(_0x2b99d1){try{jsonpatch['apply'](_0x2b99d1,_0x9e8181,!![]);}catch(_0x41907c){return BPromise[_0xf4db('0x33')](_0x41907c);}return _0x2b99d1[_0xf4db('0x34')]();};}function saveUpdates(_0x3f4e24,_0x5a2668){return function(_0x481573){if(_0x481573){return _0x481573['update'](_0x3f4e24)['then'](function(_0x22d44f){return _0x22d44f;});}return null;};}function removeEntity(_0x305f98,_0x500be9){return function(_0x4e494b){if(_0x4e494b){return _0x4e494b[_0xf4db('0x35')]()[_0xf4db('0x36')](function(){_0x305f98['status'](0xcc)[_0xf4db('0x2c')]();});}};}function handleEntityNotFound(_0x5dff65,_0x2ba683){return function(_0x4f2ae8){if(!_0x4f2ae8){_0x5dff65['sendStatus'](0x194);}return _0x4f2ae8;};}function handleError(_0x307d76,_0x304a72){_0x304a72=_0x304a72||0x1f4;return function(_0x480432){logger[_0xf4db('0x26')](_0x480432[_0xf4db('0x37')]);if(_0x480432[_0xf4db('0x38')]){delete _0x480432['name'];}_0x307d76['status'](_0x304a72)[_0xf4db('0x39')](_0x480432);};}exports[_0xf4db('0x3a')]=function(_0x5a1d9f,_0x5784fd){var _0x331d2b={},_0x107ebd={},_0x13a45e={'count':0x0,'rows':[]};var _0x162831=_['map'](db[_0xf4db('0x3b')][_0xf4db('0x3c')],function(_0x81d3ca){return{'name':_0x81d3ca[_0xf4db('0x3d')],'type':_0x81d3ca[_0xf4db('0x3e')][_0xf4db('0x3f')]};});_0x107ebd['model']=_[_0xf4db('0x40')](_0x162831,_0xf4db('0x38'));_0x107ebd[_0xf4db('0x41')]=_['keys'](_0x5a1d9f[_0xf4db('0x41')]);_0x107ebd['filters']=_[_0xf4db('0x42')](_0x107ebd['model'],_0x107ebd[_0xf4db('0x41')]);_0x331d2b['attributes']=_['intersection'](_0x107ebd[_0xf4db('0x43')],qs[_0xf4db('0x44')](_0x5a1d9f[_0xf4db('0x41')][_0xf4db('0x44')]));_0x331d2b[_0xf4db('0x45')]=_0x331d2b[_0xf4db('0x45')][_0xf4db('0x46')]?_0x331d2b['attributes']:_0x107ebd[_0xf4db('0x43')];if(!_0x5a1d9f[_0xf4db('0x41')][_0xf4db('0x47')](_0xf4db('0x48'))){_0x331d2b[_0xf4db('0x2f')]=qs[_0xf4db('0x2f')](_0x5a1d9f[_0xf4db('0x41')][_0xf4db('0x2f')]);_0x331d2b['offset']=qs[_0xf4db('0x2e')](_0x5a1d9f[_0xf4db('0x41')][_0xf4db('0x2e')]);}_0x331d2b[_0xf4db('0x49')]=qs[_0xf4db('0x4a')](_0x5a1d9f[_0xf4db('0x41')][_0xf4db('0x4a')]);_0x331d2b[_0xf4db('0x4b')]=qs[_0xf4db('0x4c')](_[_0xf4db('0x4d')](_0x5a1d9f[_0xf4db('0x41')],_0x107ebd[_0xf4db('0x4c')]),_0x162831);if(_0x5a1d9f[_0xf4db('0x41')][_0xf4db('0x4e')]){_0x331d2b['where']=_[_0xf4db('0x4f')](_0x331d2b[_0xf4db('0x4b')],{'$or':_[_0xf4db('0x40')](_0x162831,function(_0x561ff8){if(_0x561ff8[_0xf4db('0x3e')]!==_0xf4db('0x50')){var _0x310e0c={};_0x310e0c[_0x561ff8[_0xf4db('0x38')]]={'$like':'%'+_0x5a1d9f[_0xf4db('0x41')][_0xf4db('0x4e')]+'%'};return _0x310e0c;}})});}_0x331d2b=_['merge']({},_0x331d2b,_0x5a1d9f[_0xf4db('0x51')]);var _0x29a5b9={'where':_0x331d2b[_0xf4db('0x4b')]};return db['ChatMessage'][_0xf4db('0x31')](_0x29a5b9)['then'](function(_0x2c8f6e){_0x13a45e['count']=_0x2c8f6e;if(_0x5a1d9f[_0xf4db('0x41')][_0xf4db('0x52')]){_0x331d2b[_0xf4db('0x53')]=[{'all':!![]}];}return db[_0xf4db('0x3b')]['findAll'](_0x331d2b);})[_0xf4db('0x36')](function(_0x25b9a8){_0x13a45e[_0xf4db('0x54')]=_0x25b9a8;return _0x13a45e;})[_0xf4db('0x36')](respondWithFilteredResult(_0x5784fd,_0x331d2b))[_0xf4db('0x55')](handleError(_0x5784fd,null));};exports[_0xf4db('0x56')]=function(_0x4ed5b7,_0x180150){var _0x160cb0={'raw':!![],'where':{'id':_0x4ed5b7[_0xf4db('0x57')]['id']}},_0x35ef2e={};_0x35ef2e[_0xf4db('0x43')]=_[_0xf4db('0x58')](db[_0xf4db('0x3b')][_0xf4db('0x3c')]);_0x35ef2e['query']=_[_0xf4db('0x58')](_0x4ed5b7[_0xf4db('0x41')]);_0x35ef2e['filters']=_[_0xf4db('0x42')](_0x35ef2e[_0xf4db('0x43')],_0x35ef2e['query']);_0x160cb0['attributes']=_['intersection'](_0x35ef2e['model'],qs[_0xf4db('0x44')](_0x4ed5b7['query']['fields']));_0x160cb0[_0xf4db('0x45')]=_0x160cb0['attributes'][_0xf4db('0x46')]?_0x160cb0[_0xf4db('0x45')]:_0x35ef2e['model'];if(_0x4ed5b7[_0xf4db('0x41')]['includeAll']){_0x160cb0[_0xf4db('0x53')]=[{'all':!![]}];}_0x160cb0=_[_0xf4db('0x4f')]({},_0x160cb0,_0x4ed5b7[_0xf4db('0x51')]);return db[_0xf4db('0x3b')][_0xf4db('0x59')](_0x160cb0)[_0xf4db('0x36')](handleEntityNotFound(_0x180150,null))[_0xf4db('0x36')](respondWithResult(_0x180150,null))[_0xf4db('0x55')](handleError(_0x180150,null));};exports[_0xf4db('0x5a')]=function(_0x38e009,_0x2206e0){return db[_0xf4db('0x3b')][_0xf4db('0x5a')](_0x38e009[_0xf4db('0x5b')],{})[_0xf4db('0x36')](respondWithResult(_0x2206e0,0xc9))[_0xf4db('0x55')](handleError(_0x2206e0,null));};exports[_0xf4db('0x5c')]=function(_0x4e41d5,_0x41a966){if(_0x4e41d5['body']['id']){delete _0x4e41d5[_0xf4db('0x5b')]['id'];}return db[_0xf4db('0x3b')][_0xf4db('0x59')]({'where':{'id':_0x4e41d5['params']['id']}})[_0xf4db('0x36')](handleEntityNotFound(_0x41a966,null))['then'](saveUpdates(_0x4e41d5[_0xf4db('0x5b')],null))[_0xf4db('0x36')](respondWithResult(_0x41a966,null))[_0xf4db('0x55')](handleError(_0x41a966,null));};exports[_0xf4db('0x35')]=function(_0x2601f5,_0x35790b){return db[_0xf4db('0x3b')]['find']({'where':{'id':_0x2601f5[_0xf4db('0x57')]['id']}})['then'](handleEntityNotFound(_0x35790b,null))['then'](removeEntity(_0x35790b,null))[_0xf4db('0x55')](handleError(_0x35790b,null));};exports[_0xf4db('0x5d')]=function(_0x42b504,_0x26a791){return db[_0xf4db('0x3b')][_0xf4db('0x5d')]()[_0xf4db('0x36')](respondWithResult(_0x26a791,null))['catch'](handleError(_0x26a791,null));};var interaction_log=require(_0xf4db('0x12'))(_0xf4db('0x5e'));exports['accept']=function(_0x59a122,_0xb081af,_0x589430){var _0x1f5482={'agent':{},'channel':_0xf4db('0x5f')};if(_0x59a122[_0xf4db('0x5b')]['id']){delete _0x59a122[_0xf4db('0x5b')]['id'];}_0x59a122[_0xf4db('0x5b')]['read']=!![];_0x59a122['body'][_0xf4db('0x60')]=moment()[_0xf4db('0x61')](_0xf4db('0x62'));_0x59a122[_0xf4db('0x5b')][_0xf4db('0x63')]=_0x59a122[_0xf4db('0x5b')][_0xf4db('0x63')]||_0x59a122['user']['id'];_0x1f5482[_0xf4db('0x64')]['id']=_0x59a122['body']['UserId'];return db[_0xf4db('0x3b')]['find']({'where':{'id':_0x59a122[_0xf4db('0x57')]['id'],'UserId':null}})[_0xf4db('0x36')](handleEntityNotFound(_0xb081af,null))[_0xf4db('0x36')](saveUpdates(_0x59a122['body'],null))[_0xf4db('0x36')](function(_0x4c519d){if(_0x4c519d){_0x1f5482[_0xf4db('0x28')]=_0x4c519d[_0xf4db('0x65')]({'plain':!![]});return db['ChatInteraction'][_0xf4db('0x59')]({'where':{'id':_0x4c519d['ChatInteractionId']}});}return null;})[_0xf4db('0x36')](handleEntityNotFound(_0xb081af,null))[_0xf4db('0x36')](function(_0x379326){if(_0x379326){return _0x379326[_0xf4db('0x5c')]({'UserId':_0x59a122[_0xf4db('0x5b')]['UserId'],'read1stAt':_['isNil'](_0x379326[_0xf4db('0x66')])?moment()['format'](_0xf4db('0x62')):undefined});}return null;})[_0xf4db('0x36')](function(_0x1c5384){if(_0x1c5384){_0x1f5482[_0xf4db('0x67')]=_0x1c5384[_0xf4db('0x65')]({'plain':!![]});interaction_log[_0xf4db('0x29')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x59a122[_0xf4db('0x68')]['id'],_0x59a122[_0xf4db('0x68')][_0xf4db('0x38')],_0x59a122['user'][_0xf4db('0x69')],_0x1f5482[_0xf4db('0x67')]['id'],_0x59a122['body']?JSON['stringify'](_0x59a122['body']):_0xf4db('0x6a'));return respondWithRpcPromise(_0xf4db('0x6b'),_0xf4db('0x6c'),_0x1f5482);}return null;})['then'](function(_0x32e80e){var _0xce865d=_0xf4db('0x6d')+_0x32e80e[_0xf4db('0x28')][_0xf4db('0x6e')];return db[_0xf4db('0x6f')]['query'](_0xce865d,{'type':db[_0xf4db('0x70')][_0xf4db('0x71')][_0xf4db('0x72')],'raw':!![]})[_0xf4db('0x36')](function(_0x4410ab){return _0x4410ab;});})[_0xf4db('0x36')](function(_0x292efa){if(_0x292efa){_0x1f5482[_0xf4db('0x28')][_0xf4db('0x73')]=_0x292efa[0x0];if(!_0x59a122[_0xf4db('0x5b')][_0xf4db('0x63')])return;return db[_0xf4db('0x74')][_0xf4db('0x59')]({'where':{'id':_0x59a122[_0xf4db('0x5b')][_0xf4db('0x63')],'role':'agent'},'attributes':['id',_0xf4db('0x38'),_0xf4db('0x75'),_0xf4db('0x76'),_0xf4db('0x77')],'raw':!![]});}return null;})[_0xf4db('0x36')](function(_0x5934fd){if(!_0x5934fd)return null;_0x1f5482[_0xf4db('0x28')][_0xf4db('0x64')]=_0x5934fd;return _0x1f5482;})['then'](function(_0x5a43ca){if(_0x5a43ca){if(_0x59a122[_0xf4db('0x5b')][_0xf4db('0x78')]){_0x1f5482[_0xf4db('0x28')][_0xf4db('0x79')]=util[_0xf4db('0x61')](_0xf4db('0x7a'),_0x59a122[_0xf4db('0x68')][_0xf4db('0x38')]);_0x1f5482[_0xf4db('0x28')][_0xf4db('0x7b')]=_0x1f5482['channel'];_0x1f5482['message'][_0xf4db('0x7c')]=_0x1f5482['channel'];_0x1f5482[_0xf4db('0x28')][_0xf4db('0x7d')]=_0xf4db('0x7e');return respondWithRpcPromise(_0xf4db('0x7f'),'EventManager',{'event':_0xf4db('0x80'),'message':_[_0xf4db('0x4f')](_0x1f5482[_0xf4db('0x28')],JSON[_0xf4db('0x81')](_0x1f5482['interaction'][_0xf4db('0x82')]))},client9002)[_0xf4db('0x36')](function(){return _0x1f5482;});}return _0x1f5482;}return null;})['then'](respondWithResult(_0xb081af,null))['catch'](handleError(_0xb081af,null));};var interaction_log=require(_0xf4db('0x12'))(_0xf4db('0x5e'));exports[_0xf4db('0x33')]=function(_0x493441,_0x258c10,_0x1453da){var _0x3eeaa6={'agent':{},'channel':'chat'};if(_0x493441[_0xf4db('0x5b')]['id']){delete _0x493441[_0xf4db('0x5b')]['id'];}_0x493441[_0xf4db('0x5b')][_0xf4db('0x63')]=_0x493441['body'][_0xf4db('0x63')]||_0x493441[_0xf4db('0x68')]['id'];_0x3eeaa6[_0xf4db('0x64')]['id']=_0x493441[_0xf4db('0x5b')]['UserId'];return db[_0xf4db('0x3b')][_0xf4db('0x59')]({'where':{'id':_0x493441['params']['id'],'UserId':null}})[_0xf4db('0x36')](handleEntityNotFound(_0x258c10,null))[_0xf4db('0x36')](function(_0x4cc39c){if(_0x4cc39c){_0x3eeaa6['message']=_0x4cc39c[_0xf4db('0x65')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x4cc39c['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x258c10,null))[_0xf4db('0x36')](function(_0x264adb){if(_0x264adb){_0x3eeaa6[_0xf4db('0x67')]=_0x264adb[_0xf4db('0x65')]({'plain':!![]});interaction_log[_0xf4db('0x29')](_0xf4db('0x83'),_0x493441[_0xf4db('0x68')]['id'],_0x493441[_0xf4db('0x68')]['name'],_0x493441[_0xf4db('0x68')]['role'],_0x3eeaa6[_0xf4db('0x67')]['id'],_0x493441['body']?JSON[_0xf4db('0x25')](_0x493441[_0xf4db('0x5b')]):'null');return respondWithRpcPromise('RejectMessage',_0xf4db('0x84'),_0x3eeaa6);}return null;})[_0xf4db('0x36')](function(_0x57c439){var _0x2be96b=_0xf4db('0x6d')+_0x57c439[_0xf4db('0x28')][_0xf4db('0x6e')];return db['sequelize']['query'](_0x2be96b,{'type':db[_0xf4db('0x70')][_0xf4db('0x71')][_0xf4db('0x72')],'raw':!![]})['then'](function(_0x21826d){return _0x21826d;});})[_0xf4db('0x36')](function(_0x225362){if(_0x225362){_0x3eeaa6[_0xf4db('0x28')][_0xf4db('0x73')]=_0x225362[0x0];if(!_0x493441[_0xf4db('0x5b')][_0xf4db('0x63')])return;return db[_0xf4db('0x74')][_0xf4db('0x59')]({'where':{'id':_0x493441[_0xf4db('0x5b')][_0xf4db('0x63')],'role':_0xf4db('0x64')},'attributes':['id',_0xf4db('0x38'),'fullname',_0xf4db('0x76'),_0xf4db('0x77')],'raw':!![]});}return null;})['then'](function(_0x2e35fa){if(!_0x2e35fa)return null;_0x3eeaa6[_0xf4db('0x28')][_0xf4db('0x64')]=_0x2e35fa;return _0x3eeaa6;})['then'](function(_0x88f2ed){if(_0x88f2ed){_0x88f2ed[_0xf4db('0x28')][_0xf4db('0x79')]=util[_0xf4db('0x61')](_0xf4db('0x7a'),_0x493441[_0xf4db('0x68')][_0xf4db('0x38')]);_0x88f2ed[_0xf4db('0x28')][_0xf4db('0x7b')]=_0x3eeaa6[_0xf4db('0x7b')];_0x88f2ed[_0xf4db('0x28')][_0xf4db('0x7c')]=_0x3eeaa6['channel'];_0x88f2ed['message']['event']='reject';respondWithRpcPromise(_0xf4db('0x7f'),'EventManager',{'event':_0xf4db('0x85'),'message':_[_0xf4db('0x4f')](_0x3eeaa6[_0xf4db('0x28')],JSON[_0xf4db('0x81')](_0x3eeaa6[_0xf4db('0x67')][_0xf4db('0x82')]))},client9002);return _0x3eeaa6;}return null;})[_0xf4db('0x36')](respondWithResult(_0x258c10,null))['catch'](handleError(_0x258c10,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 34f527d..b304aef 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 _0xe760=['exports','ChatMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xe760,0xc9));var _0x0e76=function(_0x3f5547,_0x1a4fd2){_0x3f5547=_0x3f5547-0x0;var _0x23e025=_0xe760[_0x3f5547];return _0x23e025;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0x0e76('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x0e76('0x1')](0x0);var events={'afterCreate':_0x0e76('0x2'),'afterUpdate':_0x0e76('0x3'),'afterDestroy':'remove'};function emitEvent(_0x14daa4){return function(_0x3a88f8,_0x192e3d,_0x4472fc){ChatMessageEvents['emit'](_0x14daa4+':'+_0x3a88f8['id'],_0x3a88f8);ChatMessageEvents[_0x0e76('0x4')](_0x14daa4,_0x3a88f8);_0x4472fc(null);};}for(var e in events){if(events[_0x0e76('0x5')](e)){var event=events[e];ChatMessage[_0x0e76('0x6')](e,emitEvent(event));}}module[_0x0e76('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0x7643=['exports','ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x43a5c7,_0x2286bf){var _0x3b12a2=function(_0x1f8f53){while(--_0x1f8f53){_0x43a5c7['push'](_0x43a5c7['shift']());}};_0x3b12a2(++_0x2286bf);}(_0x7643,0x184));var _0x3764=function(_0x510b98,_0x4c4cbb){_0x510b98=_0x510b98-0x0;var _0x45e775=_0x7643[_0x510b98];return _0x45e775;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0x3764('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3764('0x1')](0x0);var events={'afterCreate':_0x3764('0x2'),'afterUpdate':_0x3764('0x3'),'afterDestroy':_0x3764('0x4')};function emitEvent(_0xc361ed){return function(_0x358423,_0x1846ca,_0x555194){ChatMessageEvents['emit'](_0xc361ed+':'+_0x358423['id'],_0x358423);ChatMessageEvents[_0x3764('0x5')](_0xc361ed,_0x358423);_0x555194(null);};}for(var e in events){if(events[_0x3764('0x6')](e)){var event=events[e];ChatMessage[_0x3764('0x7')](e,emitEvent(event));}}module[_0x3764('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 bc02b98..0eabef3 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 _0x965d=['fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird','path','rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x965d,0x92));var _0xd965=function(_0x54e9d6,_0x3053f4){_0x54e9d6=_0x54e9d6-0x0;var _0x8dea10=_0x965d[_0x54e9d6];return _0x8dea10;};'use strict';var _=require(_0xd965('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd965('0x1'));var moment=require('moment');var BPromise=require(_0xd965('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd965('0x3'));var rimraf=require(_0xd965('0x4'));var config=require('../../config/environment');var attributes=require(_0xd965('0x5'));module[_0xd965('0x6')]=function(_0xf8ffa3,_0x1ffa0d){return _0xf8ffa3[_0xd965('0x7')](_0xd965('0x8'),attributes,{'tableName':_0xd965('0x9'),'paranoid':![],'indexes':[{'name':_0xd965('0xa'),'fields':[_0xd965('0xb')],'type':_0xd965('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5bd7e5,_0x34fb2d,_0x14d0a2){var _0x5639b9=_0xf8ffa3[_0xd965('0xd')];var _0x36e39f=_0x5bd7e5['get']({'plain':!![]});if(_0x36e39f[_0xd965('0xe')]['toLowerCase']()==='in'||_0x36e39f[_0xd965('0xe')][_0xd965('0xf')]()===_0xd965('0x10')&&!_0x36e39f[_0xd965('0x11')]&&!_[_0xd965('0x12')](_0x36e39f['UserId'])){_0x5639b9[_0xd965('0x13')][_0xd965('0x14')]({'where':{'id':_0x36e39f['ChatInteractionId']}})['then'](function(_0x365ef2){if(_0x365ef2){_0x365ef2[_0xd965('0x15')]({'lastMsgAt':_0x36e39f[_0xd965('0x16')],'lastMsgDirection':_0x36e39f[_0xd965('0xe')][_0xd965('0xf')]()});}})[_0xd965('0x17')](function(_0x3ad5ec){console['error'](_0x3ad5ec);});}_0x14d0a2();}},'charset':_0xd965('0x18'),'collate':_0xd965('0x19')});};
\ No newline at end of file
+var _0x0223=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','body','FULLTEXT','models','get','direction','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','toLowerCase','error'];(function(_0x29a2cc,_0x2a88fe){var _0x145413=function(_0x4989a8){while(--_0x4989a8){_0x29a2cc['push'](_0x29a2cc['shift']());}};_0x145413(++_0x2a88fe);}(_0x0223,0xaf));var _0x3022=function(_0x5e5c7b,_0x2495a3){_0x5e5c7b=_0x5e5c7b-0x0;var _0x3f947f=_0x0223[_0x5e5c7b];return _0x3f947f;};'use strict';var _=require(_0x3022('0x0'));var util=require(_0x3022('0x1'));var logger=require(_0x3022('0x2'))(_0x3022('0x3'));var moment=require('moment');var BPromise=require(_0x3022('0x4'));var rp=require(_0x3022('0x5'));var fs=require('fs');var path=require(_0x3022('0x6'));var rimraf=require(_0x3022('0x7'));var config=require(_0x3022('0x8'));var attributes=require(_0x3022('0x9'));module[_0x3022('0xa')]=function(_0xc2cefe,_0x1c1aff){return _0xc2cefe[_0x3022('0xb')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x3022('0xc')],'type':_0x3022('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5c1e1d,_0x3ddf10,_0x16c444){var _0x4e9fc8=_0xc2cefe[_0x3022('0xe')];var _0x3de68a=_0x5c1e1d[_0x3022('0xf')]({'plain':!![]});if(_0x3de68a['direction']['toLowerCase']()==='in'||_0x3de68a[_0x3022('0x10')]['toLowerCase']()===_0x3022('0x11')&&!_0x3de68a['secret']&&!_[_0x3022('0x12')](_0x3de68a[_0x3022('0x13')])){_0x4e9fc8[_0x3022('0x14')][_0x3022('0x15')]({'where':{'id':_0x3de68a[_0x3022('0x16')]}})[_0x3022('0x17')](function(_0x510c3a){if(_0x510c3a){_0x510c3a[_0x3022('0x18')]({'lastMsgAt':_0x3de68a[_0x3022('0x19')],'lastMsgDirection':_0x3de68a['direction'][_0x3022('0x1a')]()});}})['catch'](function(_0x1d5fd9){console[_0x3022('0x1b')](_0x1d5fd9);});}_0x16c444();}},'charset':'utf8mb4','collate':_0x3022('0x1c')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index eaa3efa..c496496 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 _0xa82a=['ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatMessage','ChatMessage','options','raw','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info'];(function(_0x406c5c,_0x169f24){var _0x3d7057=function(_0x454d70){while(--_0x454d70){_0x406c5c['push'](_0x406c5c['shift']());}};_0x3d7057(++_0x169f24);}(_0xa82a,0x8d));var _0xaa82=function(_0x407588,_0x211bf8){_0x407588=_0x407588-0x0;var _0x5789f6=_0xa82a[_0x407588];return _0x5789f6;};'use strict';var _=require(_0xaa82('0x0'));var util=require('util');var moment=require(_0xaa82('0x1'));var BPromise=require('bluebird');var rs=require(_0xaa82('0x2'));var fs=require('fs');var Redis=require(_0xaa82('0x3'));var db=require(_0xaa82('0x4'))['db'];var utils=require(_0xaa82('0x5'));var logger=require(_0xaa82('0x6'))('rpc');var config=require(_0xaa82('0x7'));var jayson=require(_0xaa82('0x8'));var client=jayson[_0xaa82('0x9')]['http']({'port':0x232a});config[_0xaa82('0xa')]=_[_0xaa82('0xb')](config['redis'],{'host':_0xaa82('0xc'),'port':0x18eb});var socket=require(_0xaa82('0xd'))(new Redis(config['redis']));require(_0xaa82('0xe'))[_0xaa82('0xf')](socket);function respondWithRpcPromise(_0x447518,_0x22fd8c,_0x48c842){return new BPromise(function(_0x2cbaac,_0x4314b4){return client[_0xaa82('0x10')](_0x447518,_0x48c842)[_0xaa82('0x11')](function(_0x523799){logger[_0xaa82('0x12')](_0xaa82('0x13'),_0x22fd8c,_0xaa82('0x14'));logger[_0xaa82('0x15')](_0xaa82('0x16'),_0x22fd8c,'request\x20sent',JSON[_0xaa82('0x17')](_0x523799));if(_0x523799[_0xaa82('0x18')]){if(_0x523799[_0xaa82('0x18')][_0xaa82('0x19')]===0x1f4){logger[_0xaa82('0x18')](_0xaa82('0x13'),_0x22fd8c,_0x523799[_0xaa82('0x18')][_0xaa82('0x1a')]);return _0x4314b4(_0x523799[_0xaa82('0x18')]['message']);}logger[_0xaa82('0x18')](_0xaa82('0x13'),_0x22fd8c,_0x523799[_0xaa82('0x18')][_0xaa82('0x1a')]);return _0x2cbaac(_0x523799[_0xaa82('0x18')]['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x22fd8c,'request\x20sent');_0x2cbaac(_0x523799['result'][_0xaa82('0x1a')]);}})[_0xaa82('0x1b')](function(_0x5492d5){logger[_0xaa82('0x18')](_0xaa82('0x13'),_0x22fd8c,_0x5492d5);_0x4314b4(_0x5492d5);});});}exports[_0xaa82('0x1c')]=function(_0x102291){var _0x2144a8=this;return new Promise(function(_0x3b15f5,_0x465623){return db[_0xaa82('0x1d')]['create'](_0x102291['body'],{'raw':_0x102291[_0xaa82('0x1e')]?_0x102291[_0xaa82('0x1e')][_0xaa82('0x1f')]===undefined?!![]:![]:!![]})[_0xaa82('0x11')](function(_0x414c5e){logger[_0xaa82('0x12')]('CreateChatMessage',_0x102291);logger[_0xaa82('0x15')]('CreateChatMessage',_0x102291,JSON['stringify'](_0x414c5e));_0x3b15f5(_0x414c5e);})[_0xaa82('0x1b')](function(_0x3003b7){logger[_0xaa82('0x18')]('CreateChatMessage',_0x3003b7['message'],_0x102291);_0x465623(_0x2144a8['error'](0x1f4,_0x3003b7[_0xaa82('0x1a')]));});});};
\ No newline at end of file
+var _0x1dfe=['stringify','error','code','ChatMessage,\x20%s,\x20%s','message','CreateChatMessage','ChatMessage','create','body','options','raw','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s'];(function(_0x5cef2a,_0x34ef09){var _0x3bf10f=function(_0x4a354e){while(--_0x4a354e){_0x5cef2a['push'](_0x5cef2a['shift']());}};_0x3bf10f(++_0x34ef09);}(_0x1dfe,0x69));var _0xe1df=function(_0x305d9f,_0x4b5567){_0x305d9f=_0x305d9f-0x0;var _0x3c5ec0=_0x1dfe[_0x305d9f];return _0x3c5ec0;};'use strict';var _=require(_0xe1df('0x0'));var util=require(_0xe1df('0x1'));var moment=require(_0xe1df('0x2'));var BPromise=require(_0xe1df('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe1df('0x4'))['db'];var utils=require(_0xe1df('0x5'));var logger=require('../../config/logger')(_0xe1df('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe1df('0x7')]({'port':0x232a});config[_0xe1df('0x8')]=_[_0xe1df('0x9')](config[_0xe1df('0x8')],{'host':_0xe1df('0xa'),'port':0x18eb});var socket=require(_0xe1df('0xb'))(new Redis(config['redis']));require(_0xe1df('0xc'))[_0xe1df('0xd')](socket);function respondWithRpcPromise(_0x17fef2,_0x376ce0,_0x1c6f98){return new BPromise(function(_0x587086,_0x1612d2){return client[_0xe1df('0xe')](_0x17fef2,_0x1c6f98)['then'](function(_0x219483){logger[_0xe1df('0xf')]('ChatMessage,\x20%s,\x20%s',_0x376ce0,_0xe1df('0x10'));logger[_0xe1df('0x11')](_0xe1df('0x12'),_0x376ce0,_0xe1df('0x10'),JSON[_0xe1df('0x13')](_0x219483));if(_0x219483[_0xe1df('0x14')]){if(_0x219483[_0xe1df('0x14')][_0xe1df('0x15')]===0x1f4){logger['error'](_0xe1df('0x16'),_0x376ce0,_0x219483[_0xe1df('0x14')][_0xe1df('0x17')]);return _0x1612d2(_0x219483[_0xe1df('0x14')][_0xe1df('0x17')]);}logger[_0xe1df('0x14')](_0xe1df('0x16'),_0x376ce0,_0x219483[_0xe1df('0x14')][_0xe1df('0x17')]);return _0x587086(_0x219483[_0xe1df('0x14')]['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x376ce0,_0xe1df('0x10'));_0x587086(_0x219483['result'][_0xe1df('0x17')]);}})['catch'](function(_0xcf03d1){logger[_0xe1df('0x14')]('ChatMessage,\x20%s,\x20%s',_0x376ce0,_0xcf03d1);_0x1612d2(_0xcf03d1);});});}exports[_0xe1df('0x18')]=function(_0x2387c7){var _0x1da035=this;return new Promise(function(_0x38428b,_0x762c61){return db[_0xe1df('0x19')][_0xe1df('0x1a')](_0x2387c7[_0xe1df('0x1b')],{'raw':_0x2387c7[_0xe1df('0x1c')]?_0x2387c7['options'][_0xe1df('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x1e5e93){logger[_0xe1df('0xf')]('CreateChatMessage',_0x2387c7);logger['debug'](_0xe1df('0x18'),_0x2387c7,JSON['stringify'](_0x1e5e93));_0x38428b(_0x1e5e93);})[_0xe1df('0x1e')](function(_0xea12bb){logger[_0xe1df('0x14')](_0xe1df('0x18'),_0xea12bb[_0xe1df('0x17')],_0x2387c7);_0x762c61(_0x1da035[_0xe1df('0x14')](0x1f4,_0xea12bb['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 059064c..01911d0 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 _0x8958=['removeListener','length','chatMessage:','save'];(function(_0x45a91c,_0x56541f){var _0x587932=function(_0x24efce){while(--_0x24efce){_0x45a91c['push'](_0x45a91c['shift']());}};_0x587932(++_0x56541f);}(_0x8958,0x93));var _0x8895=function(_0x8c1bf,_0x1d81dd){_0x8c1bf=_0x8c1bf-0x0;var _0x1551e4=_0x8958[_0x8c1bf];return _0x1551e4;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x8895('0x0'),'remove','update'];function createListener(_0x5baab1,_0x4cea64){return function(_0x418b66){_0x4cea64['emit'](_0x5baab1,_0x418b66);};}function removeListener(_0x38d5d7,_0xce4955){return function(){ChatMessageEvents[_0x8895('0x1')](_0x38d5d7,_0xce4955);};}exports['register']=function(_0x22fa52){for(var _0x2f03ad=0x0,_0x124e1e=events[_0x8895('0x2')];_0x2f03ad<_0x124e1e;_0x2f03ad++){var _0x33013a=events[_0x2f03ad];var _0x51376b=createListener(_0x8895('0x3')+_0x33013a,_0x22fa52);ChatMessageEvents['on'](_0x33013a,_0x51376b);}};
\ No newline at end of file
+var _0xb91a=['remove','emit','removeListener','register','./chatMessage.events','save'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0xb91a,0xf4));var _0xab91=function(_0x4a758,_0x4d3def){_0x4a758=_0x4a758-0x0;var _0x29b5de=_0xb91a[_0x4a758];return _0x29b5de;};'use strict';var ChatMessageEvents=require(_0xab91('0x0'));var events=[_0xab91('0x1'),_0xab91('0x2'),'update'];function createListener(_0x59b921,_0x36ffe5){return function(_0x37cd1e){_0x36ffe5[_0xab91('0x3')](_0x59b921,_0x37cd1e);};}function removeListener(_0x439eb2,_0x1afca9){return function(){ChatMessageEvents[_0xab91('0x4')](_0x439eb2,_0x1afca9);};}exports[_0xab91('0x5')]=function(_0x429933){for(var _0x290af9=0x0,_0x34932f=events['length'];_0x290af9<_0x34932f;_0x290af9++){var _0x1729f6=events[_0x290af9];var _0x1e8d52=createListener('chatMessage:'+_0x1729f6,_0x429933);ChatMessageEvents['on'](_0x1729f6,_0x1e8d52);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 3f4febc..d2c4d87 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 _0xa81a=['put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','show','tracked','chat','chatmessage:create'];(function(_0x76969f,_0x104327){var _0x1696b0=function(_0x3cc91b){while(--_0x3cc91b){_0x76969f['push'](_0x76969f['shift']());}};_0x1696b0(++_0x104327);}(_0xa81a,0x102));var _0xaa81=function(_0x15697e,_0x4be652){_0x15697e=_0x15697e-0x0;var _0xab45c7=_0xa81a[_0x15697e];return _0xab45c7;};'use strict';var multer=require(_0xaa81('0x0'));var util=require(_0xaa81('0x1'));var path=require(_0xaa81('0x2'));var timeout=require(_0xaa81('0x3'));var express=require(_0xaa81('0x4'));var router=express[_0xaa81('0x5')]();var fs_extra=require(_0xaa81('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xaa81('0x7'));var config=require(_0xaa81('0x8'));var controller=require('./chatMessage.controller');router['get']('/',auth[_0xaa81('0x9')](),controller['index']);router[_0xaa81('0xa')](_0xaa81('0xb'),auth[_0xaa81('0x9')](),controller['describe']);router[_0xaa81('0xa')](_0xaa81('0xc'),auth['isAuthenticated'](),controller[_0xaa81('0xd')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xaa81('0xe')](_0xaa81('0xf'),_0xaa81('0x10')),controller['create']);router[_0xaa81('0x11')](_0xaa81('0xc'),controller[_0xaa81('0x12')]);router[_0xaa81('0x11')](_0xaa81('0x13'),auth[_0xaa81('0x9')](),controller[_0xaa81('0x14')]);router[_0xaa81('0x11')](_0xaa81('0x15'),auth[_0xaa81('0x9')](),controller[_0xaa81('0x16')]);router[_0xaa81('0x17')](_0xaa81('0xc'),auth[_0xaa81('0x9')](),controller[_0xaa81('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0x4057=['isAuthenticated','index','describe','/:id','show','post','tracked','chatmessage:create','create','update','put','accept','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatMessage.controller'];(function(_0x12b4e7,_0x202d1d){var _0x563b9e=function(_0x1357dc){while(--_0x1357dc){_0x12b4e7['push'](_0x12b4e7['shift']());}};_0x563b9e(++_0x202d1d);}(_0x4057,0xe0));var _0x7405=function(_0x23de01,_0x4954da){_0x23de01=_0x23de01-0x0;var _0x126399=_0x4057[_0x23de01];return _0x126399;};'use strict';var multer=require(_0x7405('0x0'));var util=require(_0x7405('0x1'));var path=require('path');var timeout=require(_0x7405('0x2'));var express=require(_0x7405('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7405('0x4'));var interaction=require(_0x7405('0x5'));var config=require('../../config/environment');var controller=require(_0x7405('0x6'));router['get']('/',auth[_0x7405('0x7')](),controller[_0x7405('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x7405('0x9')]);router['get'](_0x7405('0xa'),auth[_0x7405('0x7')](),controller[_0x7405('0xb')]);router[_0x7405('0xc')]('/',auth[_0x7405('0x7')](),interaction[_0x7405('0xd')]('chat',_0x7405('0xe')),controller[_0x7405('0xf')]);router['put'](_0x7405('0xa'),controller[_0x7405('0x10')]);router[_0x7405('0x11')]('/:id/accept',auth[_0x7405('0x7')](),controller[_0x7405('0x12')]);router[_0x7405('0x11')]('/:id/reject',auth[_0x7405('0x7')](),controller['reject']);router['delete'](_0x7405('0xa'),auth[_0x7405('0x7')](),controller[_0x7405('0x13')]);module[_0x7405('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index dde4216..58167fe 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 _0xf863=['medium','sequelize','exports'];(function(_0x3080da,_0x276068){var _0x10313e=function(_0x40051d){while(--_0x40051d){_0x3080da['push'](_0x3080da['shift']());}};_0x10313e(++_0x276068);}(_0xf863,0x1f3));var _0x3f86=function(_0x2251de,_0x2c1aea){_0x2251de=_0x2251de-0x0;var _0x4b8598=_0xf863[_0x2251de];return _0x4b8598;};'use strict';var Sequelize=require(_0x3f86('0x0'));module[_0x3f86('0x1')]={'body':{'type':Sequelize['TEXT'](_0x3f86('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0xd992=['sequelize','exports','TEXT','medium'];(function(_0x4ebf9,_0x139f08){var _0x3c32e8=function(_0x5e885a){while(--_0x5e885a){_0x4ebf9['push'](_0x4ebf9['shift']());}};_0x3c32e8(++_0x139f08);}(_0xd992,0xbc));var _0x2d99=function(_0x2e0f70,_0x18264a){_0x2e0f70=_0x2e0f70-0x0;var _0x403ba3=_0xd992[_0x2e0f70];return _0x403ba3;};'use strict';var Sequelize=require(_0x2d99('0x0'));module[_0x2d99('0x1')]={'body':{'type':Sequelize[_0x2d99('0x2')](_0x2d99('0x3')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 6dde673..bbf12a8 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(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x7a54,0x106));var _0x47a5=function(_0x4ce7ea,_0x261414){_0x4ce7ea=_0x4ce7ea-0x0;var _0xdbb992=_0x7a54[_0x4ce7ea];return _0xdbb992;};'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 _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(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x7a54,0x106));var _0x47a5=function(_0x2f2713,_0x24679d){_0x2f2713=_0x2f2713-0x0;var _0x44a153=_0x7a54[_0x2f2713];return _0x44a153;};'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
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 4de5767..5ca3eaa 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 _0x760a=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x1966f3,_0x210ea3){var _0x17575f=function(_0x7b18fb){while(--_0x7b18fb){_0x1966f3['push'](_0x1966f3['shift']());}};_0x17575f(++_0x210ea3);}(_0x760a,0x7b));var _0xa760=function(_0x1eada7,_0x3a448e){_0x1eada7=_0x1eada7-0x0;var _0x142092=_0x760a[_0x1eada7];return _0x142092;};'use strict';var _=require(_0xa760('0x0'));var util=require(_0xa760('0x1'));var logger=require(_0xa760('0x2'))('api');var moment=require(_0xa760('0x3'));var BPromise=require(_0xa760('0x4'));var rp=require(_0xa760('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa760('0x6'));var config=require(_0xa760('0x7'));var attributes=require(_0xa760('0x8'));module[_0xa760('0x9')]=function(_0x4cce16,_0x55d48a){return _0x4cce16[_0xa760('0xa')](_0xa760('0xb'),attributes,{'tableName':_0xa760('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa760('0xd'),'collate':_0xa760('0xe')});};
\ No newline at end of file
+var _0x4173=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x4173,0x130));var _0x3417=function(_0x58dd0b,_0x39de95){_0x58dd0b=_0x58dd0b-0x0;var _0x30fd30=_0x4173[_0x58dd0b];return _0x30fd30;};'use strict';var _=require(_0x3417('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x3417('0x1'));var BPromise=require(_0x3417('0x2'));var rp=require(_0x3417('0x3'));var fs=require('fs');var path=require(_0x3417('0x4'));var rimraf=require(_0x3417('0x5'));var config=require(_0x3417('0x6'));var attributes=require(_0x3417('0x7'));module[_0x3417('0x8')]=function(_0x55f414,_0x3317f8){return _0x55f414[_0x3417('0x9')](_0x3417('0xa'),attributes,{'tableName':_0x3417('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3417('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 6d791f8..6e03b4a 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 _0x3248=['ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0x3248,0x1bc));var _0x8324=function(_0x1d791b,_0x37656e){_0x1d791b=_0x1d791b-0x0;var _0x5d292d=_0x3248[_0x1d791b];return _0x5d292d;};'use strict';var _=require('lodash');var util=require(_0x8324('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8324('0x1'));var fs=require('fs');var Redis=require(_0x8324('0x2'));var db=require(_0x8324('0x3'))['db'];var utils=require(_0x8324('0x4'));var logger=require(_0x8324('0x5'))(_0x8324('0x6'));var config=require('../../config/environment');var jayson=require(_0x8324('0x7'));var client=jayson[_0x8324('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25ee7a,_0x459a62,_0x4302c5){return new BPromise(function(_0x1514c0,_0x5a482d){return client[_0x8324('0x9')](_0x25ee7a,_0x4302c5)[_0x8324('0xa')](function(_0x3f00e6){logger[_0x8324('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x459a62,_0x8324('0xc'));logger[_0x8324('0xd')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x459a62,_0x8324('0xc'),JSON[_0x8324('0xe')](_0x3f00e6));if(_0x3f00e6['error']){if(_0x3f00e6['error']['code']===0x1f4){logger[_0x8324('0xf')](_0x8324('0x10'),_0x459a62,_0x3f00e6[_0x8324('0xf')][_0x8324('0x11')]);return _0x5a482d(_0x3f00e6['error'][_0x8324('0x11')]);}logger[_0x8324('0xf')](_0x8324('0x10'),_0x459a62,_0x3f00e6[_0x8324('0xf')][_0x8324('0x11')]);return _0x1514c0(_0x3f00e6['error'][_0x8324('0x11')]);}else{logger[_0x8324('0xb')](_0x8324('0x10'),_0x459a62,_0x8324('0xc'));_0x1514c0(_0x3f00e6[_0x8324('0x12')]['message']);}})[_0x8324('0x13')](function(_0xaf20a5){logger[_0x8324('0xf')](_0x8324('0x10'),_0x459a62,_0xaf20a5);_0x5a482d(_0xaf20a5);});});}
\ No newline at end of file
+var _0xb2e8=['result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x125b80,_0x41db3b){var _0x414ba8=function(_0x1bef00){while(--_0x1bef00){_0x125b80['push'](_0x125b80['shift']());}};_0x414ba8(++_0x41db3b);}(_0xb2e8,0x1ef));var _0x8b2e=function(_0x441713,_0x13c238){_0x441713=_0x441713-0x0;var _0x4625c1=_0xb2e8[_0x441713];return _0x4625c1;};'use strict';var _=require(_0x8b2e('0x0'));var util=require(_0x8b2e('0x1'));var moment=require(_0x8b2e('0x2'));var BPromise=require(_0x8b2e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b2e('0x4'));var db=require(_0x8b2e('0x5'))['db'];var utils=require(_0x8b2e('0x6'));var logger=require(_0x8b2e('0x7'))(_0x8b2e('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8b2e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a7ebb,_0x1cd791,_0x5d798d){return new BPromise(function(_0x4d9dd7,_0x22507d){return client[_0x8b2e('0xa')](_0x1a7ebb,_0x5d798d)['then'](function(_0x321395){logger['info'](_0x8b2e('0xb'),_0x1cd791,_0x8b2e('0xc'));logger[_0x8b2e('0xd')](_0x8b2e('0xe'),_0x1cd791,'request\x20sent',JSON['stringify'](_0x321395));if(_0x321395[_0x8b2e('0xf')]){if(_0x321395['error']['code']===0x1f4){logger[_0x8b2e('0xf')](_0x8b2e('0xb'),_0x1cd791,_0x321395[_0x8b2e('0xf')][_0x8b2e('0x10')]);return _0x22507d(_0x321395[_0x8b2e('0xf')][_0x8b2e('0x10')]);}logger['error'](_0x8b2e('0xb'),_0x1cd791,_0x321395[_0x8b2e('0xf')][_0x8b2e('0x10')]);return _0x4d9dd7(_0x321395[_0x8b2e('0xf')][_0x8b2e('0x10')]);}else{logger[_0x8b2e('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1cd791,_0x8b2e('0xc'));_0x4d9dd7(_0x321395[_0x8b2e('0x12')][_0x8b2e('0x10')]);}})['catch'](function(_0x52bfb6){logger['error'](_0x8b2e('0xb'),_0x1cd791,_0x52bfb6);_0x22507d(_0x52bfb6);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 6424eda..4623f37 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 _0xaa48=['get','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','index'];(function(_0x245934,_0x23d841){var _0x483ed8=function(_0x2ed177){while(--_0x2ed177){_0x245934['push'](_0x245934['shift']());}};_0x483ed8(++_0x23d841);}(_0xaa48,0x185));var _0x8aa4=function(_0x57c02d,_0x21ab95){_0x57c02d=_0x57c02d-0x0;var _0x45b484=_0xaa48[_0x57c02d];return _0x45b484;};'use strict';var multer=require(_0x8aa4('0x0'));var util=require(_0x8aa4('0x1'));var path=require(_0x8aa4('0x2'));var timeout=require(_0x8aa4('0x3'));var express=require('express');var router=express[_0x8aa4('0x4')]();var fs_extra=require(_0x8aa4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8aa4('0x6'));var config=require(_0x8aa4('0x7'));var controller=require(_0x8aa4('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x8aa4('0x9')]);router[_0x8aa4('0xa')]('/describe',auth[_0x8aa4('0xb')](),controller[_0x8aa4('0xc')]);router[_0x8aa4('0xa')](_0x8aa4('0xd'),auth[_0x8aa4('0xb')](),controller[_0x8aa4('0xe')]);router[_0x8aa4('0xf')]('/',auth['isAuthenticated'](),controller[_0x8aa4('0x10')]);router['put'](_0x8aa4('0xd'),auth[_0x8aa4('0xb')](),controller[_0x8aa4('0x11')]);router[_0x8aa4('0x12')]('/:id',auth[_0x8aa4('0xb')](),controller[_0x8aa4('0x13')]);module[_0x8aa4('0x14')]=router;
\ No newline at end of file
+var _0x4f54=['post','create','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x3ad1f2,_0x4b0ab4){var _0x872da1=function(_0x5b7493){while(--_0x5b7493){_0x3ad1f2['push'](_0x3ad1f2['shift']());}};_0x872da1(++_0x4b0ab4);}(_0x4f54,0x182));var _0x44f5=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4f54[_0xfae23b];return _0x200640;};'use strict';var multer=require('multer');var util=require(_0x44f5('0x0'));var path=require(_0x44f5('0x1'));var timeout=require(_0x44f5('0x2'));var express=require('express');var router=express[_0x44f5('0x3')]();var fs_extra=require(_0x44f5('0x4'));var auth=require(_0x44f5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x44f5('0x6'));var controller=require(_0x44f5('0x7'));router[_0x44f5('0x8')]('/',auth[_0x44f5('0x9')](),controller['index']);router[_0x44f5('0x8')](_0x44f5('0xa'),auth['isAuthenticated'](),controller[_0x44f5('0xb')]);router[_0x44f5('0x8')](_0x44f5('0xc'),auth[_0x44f5('0x9')](),controller[_0x44f5('0xd')]);router[_0x44f5('0xe')]('/',auth[_0x44f5('0x9')](),controller[_0x44f5('0xf')]);router['put'](_0x44f5('0xc'),auth['isAuthenticated'](),controller[_0x44f5('0x10')]);router[_0x44f5('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x44f5('0x12')]);module[_0x44f5('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index c46efcb..cee77d7 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 _0xc8ba=['ENUM','mouseOver','timeout','INTEGER','STRING'];(function(_0x80b8d3,_0x2d3b80){var _0x5cc9f4=function(_0x2e24a9){while(--_0x2e24a9){_0x80b8d3['push'](_0x80b8d3['shift']());}};_0x5cc9f4(++_0x2d3b80);}(_0xc8ba,0x135));var _0xac8b=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0xc8ba[_0x111e94];return _0x3de107;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xac8b('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0xac8b('0x1')](_0xac8b('0x2'),_0xac8b('0x3')),'defaultValue':_0xac8b('0x2')},'selector':{'type':Sequelize[_0xac8b('0x0')]},'timeout':{'type':Sequelize[_0xac8b('0x4')]}};
\ No newline at end of file
+var _0xd3d7=['mouseOver','sequelize','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd3d7,0x6d));var _0x7d3d=function(_0x4b5dca,_0xe22e){_0x4b5dca=_0x4b5dca-0x0;var _0x4708f6=_0xd3d7[_0x4b5dca];return _0x4708f6;};'use strict';var Sequelize=require(_0x7d3d('0x0'));module['exports']={'name':{'type':Sequelize[_0x7d3d('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x7d3d('0x2'),'timeout'),'defaultValue':_0x7d3d('0x2')},'selector':{'type':Sequelize[_0x7d3d('0x1')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 4a05af5..18d34c8 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 _0x8fed=['find','catch','create','body','destroy','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','limit','count','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','show','params','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','model','attributes','fields','length','include','merge','options'];(function(_0x1599b5,_0x28b24b){var _0x22b161=function(_0x3d936e){while(--_0x3d936e){_0x1599b5['push'](_0x1599b5['shift']());}};_0x22b161(++_0x28b24b);}(_0x8fed,0xf5));var _0xd8fe=function(_0x2fe042,_0x249340){_0x2fe042=_0x2fe042-0x0;var _0x56febe=_0x8fed[_0x2fe042];return _0x56febe;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd8fe('0x0'));var jsonpatch=require(_0xd8fe('0x1'));var rp=require(_0xd8fe('0x2'));var moment=require(_0xd8fe('0x3'));var BPromise=require(_0xd8fe('0x4'));var Mustache=require('mustache');var util=require(_0xd8fe('0x5'));var path=require(_0xd8fe('0x6'));var sox=require(_0xd8fe('0x7'));var csv=require(_0xd8fe('0x8'));var ejs=require(_0xd8fe('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd8fe('0xa'));var squel=require(_0xd8fe('0xb'));var crypto=require(_0xd8fe('0xc'));var jsforce=require(_0xd8fe('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd8fe('0x8'));var querystring=require('querystring');var Papa=require(_0xd8fe('0xe'));var Redis=require(_0xd8fe('0xf'));var authService=require(_0xd8fe('0x10'));var qs=require(_0xd8fe('0x11'));var as=require(_0xd8fe('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd8fe('0x13'))(_0xd8fe('0x14'));var utils=require(_0xd8fe('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd8fe('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf58208,_0x44de03){_0x44de03=_0x44de03||0xcc;return function(_0x2a977d){if(_0x2a977d){return _0xf58208[_0xd8fe('0x17')](_0x44de03);}return _0xf58208[_0xd8fe('0x18')](_0x44de03)['end']();};}function respondWithResult(_0x1e7ea9,_0x21e1ea){_0x21e1ea=_0x21e1ea||0xc8;return function(_0x51bdf5){if(_0x51bdf5){return _0x1e7ea9[_0xd8fe('0x18')](_0x21e1ea)[_0xd8fe('0x19')](_0x51bdf5);}};}function respondWithFilteredResult(_0x2c7c27,_0x415609){return function(_0x237de6){if(_0x237de6){var _0xf5ca56=typeof _0x415609[_0xd8fe('0x1a')]==='undefined'&&typeof _0x415609[_0xd8fe('0x1b')]==='undefined';var _0x346ba9=_0x237de6[_0xd8fe('0x1c')];var _0x4cfb98=_0xf5ca56?0x0:_0x415609[_0xd8fe('0x1a')];var _0x4b7d9e=_0xf5ca56?_0x237de6['count']:_0x415609['offset']+_0x415609['limit'];var _0x4f21fb;if(_0x4b7d9e>=_0x346ba9){_0x4b7d9e=_0x346ba9;_0x4f21fb=0xc8;}else{_0x4f21fb=0xce;}_0x2c7c27[_0xd8fe('0x18')](_0x4f21fb);return _0x2c7c27['set'](_0xd8fe('0x1d'),_0x4cfb98+'-'+_0x4b7d9e+'/'+_0x346ba9)['json'](_0x237de6);}return null;};}function patchUpdates(_0x3b0cf0){return function(_0x58d2d2){try{jsonpatch[_0xd8fe('0x1e')](_0x58d2d2,_0x3b0cf0,!![]);}catch(_0x2f0dc3){return BPromise[_0xd8fe('0x1f')](_0x2f0dc3);}return _0x58d2d2[_0xd8fe('0x20')]();};}function saveUpdates(_0x2305a9,_0x37dab0){return function(_0x108b9c){if(_0x108b9c){return _0x108b9c[_0xd8fe('0x21')](_0x2305a9)['then'](function(_0xe3c91b){return _0xe3c91b;});}return null;};}function removeEntity(_0x189dfa,_0x19d4d1){return function(_0x2fc0be){if(_0x2fc0be){return _0x2fc0be['destroy']()[_0xd8fe('0x22')](function(){_0x189dfa[_0xd8fe('0x18')](0xcc)[_0xd8fe('0x23')]();});}};}function handleEntityNotFound(_0x130c16,_0x107d0c){return function(_0x76d22){if(!_0x76d22){_0x130c16['sendStatus'](0x194);}return _0x76d22;};}function handleError(_0x4e2b49,_0x43a02d){_0x43a02d=_0x43a02d||0x1f4;return function(_0x22ef87){logger[_0xd8fe('0x24')](_0x22ef87[_0xd8fe('0x25')]);if(_0x22ef87[_0xd8fe('0x26')]){delete _0x22ef87[_0xd8fe('0x26')];}_0x4e2b49[_0xd8fe('0x18')](_0x43a02d)[_0xd8fe('0x27')](_0x22ef87);};}exports[_0xd8fe('0x28')]=function(_0x42a46b,_0x398bc2){var _0x472507={'raw':!![],'where':{'id':_0x42a46b[_0xd8fe('0x29')]['id']}},_0x2c2767={};_0x2c2767['model']=_[_0xd8fe('0x2a')](db[_0xd8fe('0x2b')][_0xd8fe('0x2c')]);_0x2c2767['query']=_[_0xd8fe('0x2a')](_0x42a46b[_0xd8fe('0x2d')]);_0x2c2767[_0xd8fe('0x2e')]=_[_0xd8fe('0x2f')](_0x2c2767[_0xd8fe('0x30')],_0x2c2767[_0xd8fe('0x2d')]);_0x472507[_0xd8fe('0x31')]=_[_0xd8fe('0x2f')](_0x2c2767[_0xd8fe('0x30')],qs[_0xd8fe('0x32')](_0x42a46b['query'][_0xd8fe('0x32')]));_0x472507[_0xd8fe('0x31')]=_0x472507[_0xd8fe('0x31')][_0xd8fe('0x33')]?_0x472507[_0xd8fe('0x31')]:_0x2c2767[_0xd8fe('0x30')];if(_0x42a46b[_0xd8fe('0x2d')]['includeAll']){_0x472507[_0xd8fe('0x34')]=[{'all':!![]}];}_0x472507=_[_0xd8fe('0x35')]({},_0x472507,_0x42a46b[_0xd8fe('0x36')]);return db[_0xd8fe('0x2b')][_0xd8fe('0x37')](_0x472507)[_0xd8fe('0x22')](handleEntityNotFound(_0x398bc2,null))[_0xd8fe('0x22')](respondWithResult(_0x398bc2,null))[_0xd8fe('0x38')](handleError(_0x398bc2,null));};exports[_0xd8fe('0x39')]=function(_0x27879b,_0x14b7e9){return db['ChatProactiveAction'][_0xd8fe('0x39')](_0x27879b[_0xd8fe('0x3a')],{})[_0xd8fe('0x22')](respondWithResult(_0x14b7e9,0xc9))[_0xd8fe('0x38')](handleError(_0x14b7e9,null));};exports[_0xd8fe('0x21')]=function(_0x56d056,_0x4f2ef1){if(_0x56d056[_0xd8fe('0x3a')]['id']){delete _0x56d056[_0xd8fe('0x3a')]['id'];}return db[_0xd8fe('0x2b')]['find']({'where':{'id':_0x56d056[_0xd8fe('0x29')]['id']}})[_0xd8fe('0x22')](handleEntityNotFound(_0x4f2ef1,null))['then'](saveUpdates(_0x56d056[_0xd8fe('0x3a')],null))[_0xd8fe('0x22')](respondWithResult(_0x4f2ef1,null))['catch'](handleError(_0x4f2ef1,null));};exports[_0xd8fe('0x3b')]=function(_0x5c0d66,_0xa3d70){return db['ChatProactiveAction']['find']({'where':{'id':_0x5c0d66[_0xd8fe('0x29')]['id']}})[_0xd8fe('0x22')](handleEntityNotFound(_0xa3d70,null))[_0xd8fe('0x22')](removeEntity(_0xa3d70,null))['catch'](handleError(_0xa3d70,null));};
\ No newline at end of file
+var _0x23f4=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','error','stack','send','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','find','catch','create','body','update','params','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x329165,_0x30a441){var _0x5b3948=function(_0x3071dc){while(--_0x3071dc){_0x329165['push'](_0x329165['shift']());}};_0x5b3948(++_0x30a441);}(_0x23f4,0x1ee));var _0x423f=function(_0x33cabe,_0xaad131){_0x33cabe=_0x33cabe-0x0;var _0xd9dd2f=_0x23f4[_0x33cabe];return _0xd9dd2f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x423f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x423f('0x1'));var moment=require(_0x423f('0x2'));var BPromise=require(_0x423f('0x3'));var Mustache=require(_0x423f('0x4'));var util=require(_0x423f('0x5'));var path=require(_0x423f('0x6'));var sox=require(_0x423f('0x7'));var csv=require(_0x423f('0x8'));var ejs=require(_0x423f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x423f('0xa'));var squel=require(_0x423f('0xb'));var crypto=require('crypto');var jsforce=require(_0x423f('0xc'));var deskjs=require(_0x423f('0xd'));var toCsv=require(_0x423f('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x423f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x423f('0xf'));var hardwareService=require(_0x423f('0x10'));var logger=require(_0x423f('0x11'))(_0x423f('0x12'));var utils=require('../../config/utils');var config=require(_0x423f('0x13'));var licenseUtil=require(_0x423f('0x14'));var db=require(_0x423f('0x15'))['db'];function respondWithStatusCode(_0x3d4027,_0x216360){_0x216360=_0x216360||0xcc;return function(_0x5275b0){if(_0x5275b0){return _0x3d4027[_0x423f('0x16')](_0x216360);}return _0x3d4027[_0x423f('0x17')](_0x216360)[_0x423f('0x18')]();};}function respondWithResult(_0x1c894f,_0x44e1d5){_0x44e1d5=_0x44e1d5||0xc8;return function(_0x3b531d){if(_0x3b531d){return _0x1c894f[_0x423f('0x17')](_0x44e1d5)[_0x423f('0x19')](_0x3b531d);}};}function respondWithFilteredResult(_0x252e6c,_0x235c86){return function(_0x3940ea){if(_0x3940ea){var _0x276be1=typeof _0x235c86[_0x423f('0x1a')]===_0x423f('0x1b')&&typeof _0x235c86[_0x423f('0x1c')]===_0x423f('0x1b');var _0x3fd56d=_0x3940ea[_0x423f('0x1d')];var _0x26b6d1=_0x276be1?0x0:_0x235c86['offset'];var _0x99435f=_0x276be1?_0x3940ea['count']:_0x235c86['offset']+_0x235c86[_0x423f('0x1c')];var _0x4956e0;if(_0x99435f>=_0x3fd56d){_0x99435f=_0x3fd56d;_0x4956e0=0xc8;}else{_0x4956e0=0xce;}_0x252e6c[_0x423f('0x17')](_0x4956e0);return _0x252e6c[_0x423f('0x1e')]('Content-Range',_0x26b6d1+'-'+_0x99435f+'/'+_0x3fd56d)[_0x423f('0x19')](_0x3940ea);}return null;};}function patchUpdates(_0x1fc317){return function(_0x56c21e){try{jsonpatch[_0x423f('0x1f')](_0x56c21e,_0x1fc317,!![]);}catch(_0x2ebe74){return BPromise['reject'](_0x2ebe74);}return _0x56c21e[_0x423f('0x20')]();};}function saveUpdates(_0x1b4ecc,_0x568dcd){return function(_0x54f47){if(_0x54f47){return _0x54f47['update'](_0x1b4ecc)[_0x423f('0x21')](function(_0x3c942e){return _0x3c942e;});}return null;};}function removeEntity(_0x4502ab,_0x3955a0){return function(_0xb82e8d){if(_0xb82e8d){return _0xb82e8d[_0x423f('0x22')]()[_0x423f('0x21')](function(){_0x4502ab[_0x423f('0x17')](0xcc)[_0x423f('0x18')]();});}};}function handleEntityNotFound(_0x36f57f,_0x45889f){return function(_0x199196){if(!_0x199196){_0x36f57f[_0x423f('0x16')](0x194);}return _0x199196;};}function handleError(_0x1f1747,_0x4a98f2){_0x4a98f2=_0x4a98f2||0x1f4;return function(_0x3308dd){logger[_0x423f('0x23')](_0x3308dd[_0x423f('0x24')]);if(_0x3308dd['name']){delete _0x3308dd['name'];}_0x1f1747[_0x423f('0x17')](_0x4a98f2)[_0x423f('0x25')](_0x3308dd);};}exports[_0x423f('0x26')]=function(_0x4c2f21,_0x5882ed){var _0x3ca28d={'raw':!![],'where':{'id':_0x4c2f21['params']['id']}},_0xbb4bce={};_0xbb4bce[_0x423f('0x27')]=_[_0x423f('0x28')](db[_0x423f('0x29')][_0x423f('0x2a')]);_0xbb4bce['query']=_[_0x423f('0x28')](_0x4c2f21[_0x423f('0x2b')]);_0xbb4bce[_0x423f('0x2c')]=_[_0x423f('0x2d')](_0xbb4bce['model'],_0xbb4bce[_0x423f('0x2b')]);_0x3ca28d[_0x423f('0x2e')]=_[_0x423f('0x2d')](_0xbb4bce[_0x423f('0x27')],qs[_0x423f('0x2f')](_0x4c2f21[_0x423f('0x2b')][_0x423f('0x2f')]));_0x3ca28d[_0x423f('0x2e')]=_0x3ca28d[_0x423f('0x2e')][_0x423f('0x30')]?_0x3ca28d['attributes']:_0xbb4bce[_0x423f('0x27')];if(_0x4c2f21[_0x423f('0x2b')][_0x423f('0x31')]){_0x3ca28d['include']=[{'all':!![]}];}_0x3ca28d=_[_0x423f('0x32')]({},_0x3ca28d,_0x4c2f21['options']);return db[_0x423f('0x29')][_0x423f('0x33')](_0x3ca28d)[_0x423f('0x21')](handleEntityNotFound(_0x5882ed,null))[_0x423f('0x21')](respondWithResult(_0x5882ed,null))[_0x423f('0x34')](handleError(_0x5882ed,null));};exports['create']=function(_0x5ea12a,_0x880b50){return db[_0x423f('0x29')][_0x423f('0x35')](_0x5ea12a[_0x423f('0x36')],{})[_0x423f('0x21')](respondWithResult(_0x880b50,0xc9))[_0x423f('0x34')](handleError(_0x880b50,null));};exports[_0x423f('0x37')]=function(_0x183665,_0xd99eb0){if(_0x183665[_0x423f('0x36')]['id']){delete _0x183665[_0x423f('0x36')]['id'];}return db[_0x423f('0x29')][_0x423f('0x33')]({'where':{'id':_0x183665['params']['id']}})['then'](handleEntityNotFound(_0xd99eb0,null))[_0x423f('0x21')](saveUpdates(_0x183665[_0x423f('0x36')],null))[_0x423f('0x21')](respondWithResult(_0xd99eb0,null))[_0x423f('0x34')](handleError(_0xd99eb0,null));};exports[_0x423f('0x22')]=function(_0x56a9f4,_0x38dcce){return db[_0x423f('0x29')][_0x423f('0x33')]({'where':{'id':_0x56a9f4[_0x423f('0x38')]['id']}})[_0x423f('0x21')](handleEntityNotFound(_0x38dcce,null))[_0x423f('0x21')](removeEntity(_0x38dcce,null))[_0x423f('0x34')](handleError(_0x38dcce,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index fce6a86..663a0b9 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 _0xaa0c=['bluebird','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment'];(function(_0x5f078a,_0x45d330){var _0x291c01=function(_0x18554d){while(--_0x18554d){_0x5f078a['push'](_0x5f078a['shift']());}};_0x291c01(++_0x45d330);}(_0xaa0c,0xa4));var _0xcaa0=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0xaa0c[_0x3c8e9a];return _0x2d4c57;};'use strict';var _=require(_0xcaa0('0x0'));var util=require(_0xcaa0('0x1'));var logger=require(_0xcaa0('0x2'))(_0xcaa0('0x3'));var moment=require(_0xcaa0('0x4'));var BPromise=require(_0xcaa0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcaa0('0x6'));var rimraf=require(_0xcaa0('0x7'));var config=require('../../config/environment');var attributes=require(_0xcaa0('0x8'));module[_0xcaa0('0x9')]=function(_0x121c15,_0x17ceb1){return _0x121c15[_0xcaa0('0xa')](_0xcaa0('0xb'),attributes,{'tableName':_0xcaa0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf99e=['ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x5cef48,_0x4f4b95){var _0x2486c6=function(_0x4acbe3){while(--_0x4acbe3){_0x5cef48['push'](_0x5cef48['shift']());}};_0x2486c6(++_0x4f4b95);}(_0xf99e,0xa7));var _0xef99=function(_0x2582af,_0x3409f7){_0x2582af=_0x2582af-0x0;var _0x38c9c6=_0xf99e[_0x2582af];return _0x38c9c6;};'use strict';var _=require(_0xef99('0x0'));var util=require(_0xef99('0x1'));var logger=require(_0xef99('0x2'))(_0xef99('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xef99('0x4'));var fs=require('fs');var path=require(_0xef99('0x5'));var rimraf=require(_0xef99('0x6'));var config=require(_0xef99('0x7'));var attributes=require('./chatProactiveAction.attributes');module[_0xef99('0x8')]=function(_0x469585,_0x10bbf6){return _0x469585['define'](_0xef99('0x9'),attributes,{'tableName':_0xef99('0xa'),'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 6ede2cf..e926d68 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 _0x95ad=['request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http'];(function(_0x266c63,_0x135fb5){var _0x46232a=function(_0x4bb7c2){while(--_0x4bb7c2){_0x266c63['push'](_0x266c63['shift']());}};_0x46232a(++_0x135fb5);}(_0x95ad,0xfe));var _0xd95a=function(_0xf170fe,_0xac543c){_0xf170fe=_0xf170fe-0x0;var _0x2b9fe8=_0x95ad[_0xf170fe];return _0x2b9fe8;};'use strict';var _=require(_0xd95a('0x0'));var util=require('util');var moment=require(_0xd95a('0x1'));var BPromise=require(_0xd95a('0x2'));var rs=require(_0xd95a('0x3'));var fs=require('fs');var Redis=require(_0xd95a('0x4'));var db=require(_0xd95a('0x5'))['db'];var utils=require(_0xd95a('0x6'));var logger=require(_0xd95a('0x7'))('rpc');var config=require(_0xd95a('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd95a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5936fd,_0x131d11,_0x46a72c){return new BPromise(function(_0x31731e,_0x2c7a36){return client[_0xd95a('0xa')](_0x5936fd,_0x46a72c)[_0xd95a('0xb')](function(_0x4aad19){logger[_0xd95a('0xc')](_0xd95a('0xd'),_0x131d11,_0xd95a('0xe'));logger[_0xd95a('0xf')](_0xd95a('0x10'),_0x131d11,_0xd95a('0xe'),JSON[_0xd95a('0x11')](_0x4aad19));if(_0x4aad19[_0xd95a('0x12')]){if(_0x4aad19['error'][_0xd95a('0x13')]===0x1f4){logger[_0xd95a('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x131d11,_0x4aad19[_0xd95a('0x12')][_0xd95a('0x14')]);return _0x2c7a36(_0x4aad19[_0xd95a('0x12')][_0xd95a('0x14')]);}logger[_0xd95a('0x12')](_0xd95a('0xd'),_0x131d11,_0x4aad19['error'][_0xd95a('0x14')]);return _0x31731e(_0x4aad19['error'][_0xd95a('0x14')]);}else{logger['info'](_0xd95a('0xd'),_0x131d11,_0xd95a('0xe'));_0x31731e(_0x4aad19['result']['message']);}})[_0xd95a('0x15')](function(_0x5f59dc){logger[_0xd95a('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x131d11,_0x5f59dc);_0x2c7a36(_0x5f59dc);});});}
\ No newline at end of file
+var _0x06c6=['util','moment','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x06c6,0xd1));var _0x606c=function(_0x154f3d,_0x404c77){_0x154f3d=_0x154f3d-0x0;var _0x2e5e71=_0x06c6[_0x154f3d];return _0x2e5e71;};'use strict';var _=require(_0x606c('0x0'));var util=require(_0x606c('0x1'));var moment=require(_0x606c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x606c('0x3'))['db'];var utils=require(_0x606c('0x4'));var logger=require(_0x606c('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x606c('0x6'));var client=jayson[_0x606c('0x7')][_0x606c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x461706,_0x331a16,_0x138dfd){return new BPromise(function(_0x5be5f1,_0x3c95bc){return client[_0x606c('0x9')](_0x461706,_0x138dfd)['then'](function(_0x212e15){logger[_0x606c('0xa')](_0x606c('0xb'),_0x331a16,_0x606c('0xc'));logger[_0x606c('0xd')](_0x606c('0xe'),_0x331a16,_0x606c('0xc'),JSON[_0x606c('0xf')](_0x212e15));if(_0x212e15[_0x606c('0x10')]){if(_0x212e15[_0x606c('0x10')][_0x606c('0x11')]===0x1f4){logger[_0x606c('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x331a16,_0x212e15[_0x606c('0x10')][_0x606c('0x12')]);return _0x3c95bc(_0x212e15[_0x606c('0x10')]['message']);}logger['error'](_0x606c('0xb'),_0x331a16,_0x212e15[_0x606c('0x10')][_0x606c('0x12')]);return _0x5be5f1(_0x212e15['error'][_0x606c('0x12')]);}else{logger[_0x606c('0xa')](_0x606c('0xb'),_0x331a16,_0x606c('0xc'));_0x5be5f1(_0x212e15[_0x606c('0x13')][_0x606c('0x12')]);}})[_0x606c('0x14')](function(_0x28efab){logger[_0x606c('0x10')](_0x606c('0xb'),_0x331a16,_0x28efab);_0x3c95bc(_0x28efab);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index eb98c60..db75af2 100644
--- a/server/api/chatProactiveAction/index.js
+++ b/server/api/chatProactiveAction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x33c5=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','util','path','express','Router'];(function(_0x509256,_0x301fae){var _0x21b281=function(_0x43eabd){while(--_0x43eabd){_0x509256['push'](_0x509256['shift']());}};_0x21b281(++_0x301fae);}(_0x33c5,0xe6));var _0x533c=function(_0x448bab,_0x25517b){_0x448bab=_0x448bab-0x0;var _0x5dc534=_0x33c5[_0x448bab];return _0x5dc534;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var fs_extra=require(_0x533c('0x4'));var auth=require(_0x533c('0x5'));var interaction=require(_0x533c('0x6'));var config=require('../../config/environment');var controller=require(_0x533c('0x7'));router[_0x533c('0x8')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xb')]);router[_0x533c('0xc')]('/',auth[_0x533c('0xa')](),controller[_0x533c('0xd')]);router[_0x533c('0xe')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xf')]);router[_0x533c('0x10')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x7fbe=['show','post','create','put','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated'];(function(_0x86de05,_0x1f034a){var _0x43604d=function(_0x1eb36b){while(--_0x1eb36b){_0x86de05['push'](_0x86de05['shift']());}};_0x43604d(++_0x1f034a);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x37bd46,_0x2cd9de){_0x37bd46=_0x37bd46-0x0;var _0x560101=_0x7fbe[_0x37bd46];return _0x560101;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller[_0xe7fb('0xc')]);router[_0xe7fb('0xd')]('/',auth['isAuthenticated'](),controller[_0xe7fb('0xe')]);router[_0xe7fb('0xf')](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller['update']);router['delete'](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller[_0xe7fb('0x10')]);module[_0xe7fb('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 166afe0..b5970e6 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 _0xac4a=['STRING','name','INTEGER','ENUM','beepall','roundrobin'];(function(_0x237546,_0xa81b26){var _0x233e29=function(_0x728aa4){while(--_0x728aa4){_0x237546['push'](_0x237546['shift']());}};_0x233e29(++_0xa81b26);}(_0xac4a,0x9c));var _0xaac4=function(_0x4c162c,_0x33acf1){_0x4c162c=_0x4c162c-0x0;var _0x5b1fe2=_0xac4a[_0x4c162c];return _0x5b1fe2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xaac4('0x0')],'unique':_0xaac4('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xaac4('0x0')]},'timeout':{'type':Sequelize[_0xaac4('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xaac4('0x3')]('rrmemory',_0xaac4('0x4'),_0xaac4('0x5'))}};
\ No newline at end of file
+var _0x3c63=['name','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x3c63,0x105));var _0x33c6=function(_0x1b1948,_0x49f451){_0x1b1948=_0x1b1948-0x0;var _0x3cbd38=_0x3c63[_0x1b1948];return _0x3cbd38;};'use strict';var Sequelize=require(_0x33c6('0x0'));module[_0x33c6('0x1')]={'name':{'type':Sequelize[_0x33c6('0x2')],'unique':_0x33c6('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x33c6('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x33c6('0x4')](_0x33c6('0x5'),_0x33c6('0x6'),_0x33c6('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index f3a555a..9929609 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 _0xfc9f=['name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','hasOwnProperty','nolimit','order','where','filter','merge','options','includeAll','include','findAll','rows','show','params','length','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','fields','sort','pick','User','findAndCountAll','UserId','createdAt','format','%s/%s','chatPause','getTeams','Team','ids','voicePause','interface','flatMap','Agents','addTeams','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./chatQueue.socket','jayson/promise','http','request','then','info','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','ChatQueues','UserProfileResource','destroy','stack'];(function(_0x4b44d2,_0x297895){var _0x32e790=function(_0x1df9c7){while(--_0x1df9c7){_0x4b44d2['push'](_0x4b44d2['shift']());}};_0x32e790(++_0x297895);}(_0xfc9f,0xf0));var _0xffc9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfc9f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xffc9('0x0'));var rimraf=require(_0xffc9('0x1'));var zipdir=require(_0xffc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xffc9('0x3'));var moment=require(_0xffc9('0x4'));var BPromise=require(_0xffc9('0x5'));var Mustache=require(_0xffc9('0x6'));var util=require('util');var path=require(_0xffc9('0x7'));var sox=require('sox');var csv=require(_0xffc9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xffc9('0x9'));var squel=require(_0xffc9('0xa'));var crypto=require(_0xffc9('0xb'));var jsforce=require(_0xffc9('0xc'));var deskjs=require(_0xffc9('0xd'));var toCsv=require(_0xffc9('0x8'));var querystring=require(_0xffc9('0xe'));var Papa=require(_0xffc9('0xf'));var Redis=require(_0xffc9('0x10'));var authService=require(_0xffc9('0x11'));var qs=require(_0xffc9('0x12'));var as=require(_0xffc9('0x13'));var hardwareService=require(_0xffc9('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xffc9('0x15'));var config=require(_0xffc9('0x16'));var licenseUtil=require(_0xffc9('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xffc9('0x18')](config[_0xffc9('0x19')],{'host':_0xffc9('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xffc9('0x1b'))['register'](socket);var jayson=require(_0xffc9('0x1c'));var client=jayson['client'][_0xffc9('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x161a62,_0x291e57,_0x53e7de,_0x4b77df){return new BPromise(function(_0x5e02d7,_0x3ea660){var _0x94da69=_0x4b77df||client;return _0x94da69[_0xffc9('0x1e')](_0x161a62,_0x53e7de)[_0xffc9('0x1f')](function(_0x4433e6){logger[_0xffc9('0x20')](_0xffc9('0x21'),_0x291e57,'request\x20sent');logger[_0xffc9('0x22')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x291e57,_0xffc9('0x23'),JSON[_0xffc9('0x24')](_0x4433e6));if(_0x4433e6[_0xffc9('0x25')]){if(_0x4433e6[_0xffc9('0x25')][_0xffc9('0x26')]===0x1f4){logger[_0xffc9('0x25')](_0xffc9('0x21'),_0x291e57,_0x4433e6[_0xffc9('0x25')]['message']);return _0x3ea660(_0x4433e6[_0xffc9('0x25')][_0xffc9('0x27')]);}logger[_0xffc9('0x25')](_0xffc9('0x21'),_0x291e57,_0x4433e6[_0xffc9('0x25')][_0xffc9('0x27')]);return _0x5e02d7(_0x4433e6[_0xffc9('0x25')][_0xffc9('0x27')]);}else{logger[_0xffc9('0x20')](_0xffc9('0x21'),_0x291e57,_0xffc9('0x23'));_0x5e02d7(_0x4433e6[_0xffc9('0x28')][_0xffc9('0x27')]);}})[_0xffc9('0x29')](function(_0x3c5b2c){logger[_0xffc9('0x25')](_0xffc9('0x21'),_0x291e57,_0x3c5b2c);_0x3ea660(_0x3c5b2c);});});}function respondWithStatusCode(_0x426a5f,_0x32051d){_0x32051d=_0x32051d||0xcc;return function(_0x4ec577){if(_0x4ec577){return _0x426a5f[_0xffc9('0x2a')](_0x32051d);}return _0x426a5f[_0xffc9('0x2b')](_0x32051d)[_0xffc9('0x2c')]();};}function respondWithResult(_0x497b63,_0x222aa2){_0x222aa2=_0x222aa2||0xc8;return function(_0x32aac9){if(_0x32aac9){return _0x497b63[_0xffc9('0x2b')](_0x222aa2)[_0xffc9('0x2d')](_0x32aac9);}};}function respondWithFilteredResult(_0x236c29,_0x20b003){return function(_0x55fbdc){if(_0x55fbdc){var _0x534824=typeof _0x20b003[_0xffc9('0x2e')]===_0xffc9('0x2f')&&typeof _0x20b003[_0xffc9('0x30')]===_0xffc9('0x2f');var _0x498fbc=_0x55fbdc[_0xffc9('0x31')];var _0x214be2=_0x534824?0x0:_0x20b003[_0xffc9('0x2e')];var _0x46c292=_0x534824?_0x55fbdc['count']:_0x20b003[_0xffc9('0x2e')]+_0x20b003[_0xffc9('0x30')];var _0x25b06a;if(_0x46c292>=_0x498fbc){_0x46c292=_0x498fbc;_0x25b06a=0xc8;}else{_0x25b06a=0xce;}_0x236c29['status'](_0x25b06a);return _0x236c29['set'](_0xffc9('0x32'),_0x214be2+'-'+_0x46c292+'/'+_0x498fbc)[_0xffc9('0x2d')](_0x55fbdc);}return null;};}function patchUpdates(_0x3bc55f){return function(_0x184990){try{jsonpatch[_0xffc9('0x33')](_0x184990,_0x3bc55f,!![]);}catch(_0x8c73a8){return BPromise[_0xffc9('0x34')](_0x8c73a8);}return _0x184990['save']();};}function saveUpdates(_0x1ac40c,_0x5ac558){return function(_0x409dad){if(_0x409dad){return _0x409dad[_0xffc9('0x35')](_0x1ac40c)[_0xffc9('0x1f')](function(_0x56818a){return _0x56818a;});}return null;};}function removeEntity(_0x115a11,_0x50a003){return function(_0x32c9ef){if(_0x32c9ef){return _0x32c9ef['destroy']()[_0xffc9('0x1f')](function(){var _0x581078=_0x32c9ef['get']({'plain':!![]});var _0x22bec9=_0xffc9('0x36');return db[_0xffc9('0x37')][_0xffc9('0x38')]({'where':{'type':_0x22bec9,'resourceId':_0x581078['id']}})[_0xffc9('0x1f')](function(){return _0x32c9ef;});})['then'](function(){_0x115a11[_0xffc9('0x2b')](0xcc)[_0xffc9('0x2c')]();});}};}function handleEntityNotFound(_0x2663ce,_0x45f582){return function(_0x20cf38){if(!_0x20cf38){_0x2663ce[_0xffc9('0x2a')](0x194);}return _0x20cf38;};}function handleError(_0x1c3425,_0x348164){_0x348164=_0x348164||0x1f4;return function(_0x298b55){logger[_0xffc9('0x25')](_0x298b55[_0xffc9('0x39')]);if(_0x298b55[_0xffc9('0x3a')]){delete _0x298b55[_0xffc9('0x3a')];}_0x1c3425[_0xffc9('0x2b')](_0x348164)[_0xffc9('0x3b')](_0x298b55);};}exports[_0xffc9('0x3c')]=function(_0x210035,_0x890139){var _0x58b2e5={},_0x337683={},_0x330b79={'count':0x0,'rows':[]};var _0xbad91e=_[_0xffc9('0x3d')](db[_0xffc9('0x3e')][_0xffc9('0x3f')],function(_0x143e57){return{'name':_0x143e57[_0xffc9('0x40')],'type':_0x143e57[_0xffc9('0x41')][_0xffc9('0x42')]};});_0x337683['model']=_[_0xffc9('0x3d')](_0xbad91e,_0xffc9('0x3a'));_0x337683['query']=_[_0xffc9('0x43')](_0x210035['query']);_0x337683[_0xffc9('0x44')]=_[_0xffc9('0x45')](_0x337683[_0xffc9('0x46')],_0x337683[_0xffc9('0x47')]);_0x58b2e5['attributes']=_[_0xffc9('0x45')](_0x337683['model'],qs['fields'](_0x210035['query']['fields']));_0x58b2e5['attributes']=_0x58b2e5[_0xffc9('0x48')]['length']?_0x58b2e5[_0xffc9('0x48')]:_0x337683[_0xffc9('0x46')];if(!_0x210035['query'][_0xffc9('0x49')](_0xffc9('0x4a'))){_0x58b2e5[_0xffc9('0x30')]=qs[_0xffc9('0x30')](_0x210035[_0xffc9('0x47')][_0xffc9('0x30')]);_0x58b2e5['offset']=qs[_0xffc9('0x2e')](_0x210035[_0xffc9('0x47')][_0xffc9('0x2e')]);}_0x58b2e5[_0xffc9('0x4b')]=qs['sort'](_0x210035['query']['sort']);_0x58b2e5[_0xffc9('0x4c')]=qs[_0xffc9('0x44')](_['pick'](_0x210035[_0xffc9('0x47')],_0x337683[_0xffc9('0x44')]),_0xbad91e);if(_0x210035[_0xffc9('0x47')][_0xffc9('0x4d')]){_0x58b2e5[_0xffc9('0x4c')]=_[_0xffc9('0x4e')](_0x58b2e5[_0xffc9('0x4c')],{'$or':_[_0xffc9('0x3d')](_0xbad91e,function(_0x5db879){if(_0x5db879[_0xffc9('0x41')]!=='VIRTUAL'){var _0x371e8f={};_0x371e8f[_0x5db879[_0xffc9('0x3a')]]={'$like':'%'+_0x210035[_0xffc9('0x47')][_0xffc9('0x4d')]+'%'};return _0x371e8f;}})});}_0x58b2e5=_[_0xffc9('0x4e')]({},_0x58b2e5,_0x210035[_0xffc9('0x4f')]);var _0x5c56ed={'where':_0x58b2e5[_0xffc9('0x4c')]};return db[_0xffc9('0x3e')][_0xffc9('0x31')](_0x5c56ed)['then'](function(_0x40b945){_0x330b79['count']=_0x40b945;if(_0x210035['query'][_0xffc9('0x50')]){_0x58b2e5[_0xffc9('0x51')]=[{'all':!![]}];}return db[_0xffc9('0x3e')][_0xffc9('0x52')](_0x58b2e5);})[_0xffc9('0x1f')](function(_0x2df004){_0x330b79[_0xffc9('0x53')]=_0x2df004;return _0x330b79;})[_0xffc9('0x1f')](respondWithFilteredResult(_0x890139,_0x58b2e5))[_0xffc9('0x29')](handleError(_0x890139,null));};exports[_0xffc9('0x54')]=function(_0x52cc5f,_0x355627){var _0x3d9c90={'raw':!![],'where':{'id':_0x52cc5f[_0xffc9('0x55')]['id']}},_0x2cb9a9={};_0x2cb9a9['model']=_['keys'](db[_0xffc9('0x3e')][_0xffc9('0x3f')]);_0x2cb9a9[_0xffc9('0x47')]=_[_0xffc9('0x43')](_0x52cc5f['query']);_0x2cb9a9[_0xffc9('0x44')]=_[_0xffc9('0x45')](_0x2cb9a9['model'],_0x2cb9a9['query']);_0x3d9c90[_0xffc9('0x48')]=_[_0xffc9('0x45')](_0x2cb9a9[_0xffc9('0x46')],qs['fields'](_0x52cc5f[_0xffc9('0x47')]['fields']));_0x3d9c90[_0xffc9('0x48')]=_0x3d9c90[_0xffc9('0x48')][_0xffc9('0x56')]?_0x3d9c90[_0xffc9('0x48')]:_0x2cb9a9[_0xffc9('0x46')];if(_0x52cc5f[_0xffc9('0x47')][_0xffc9('0x50')]){_0x3d9c90[_0xffc9('0x51')]=[{'all':!![]}];}_0x3d9c90=_[_0xffc9('0x4e')]({},_0x3d9c90,_0x52cc5f['options']);return db['ChatQueue'][_0xffc9('0x57')](_0x3d9c90)['then'](handleEntityNotFound(_0x355627,null))[_0xffc9('0x1f')](respondWithResult(_0x355627,null))[_0xffc9('0x29')](handleError(_0x355627,null));};exports['create']=function(_0x578c67,_0x1a3532){return db[_0xffc9('0x3e')]['create'](_0x578c67[_0xffc9('0x58')],{})[_0xffc9('0x1f')](function(_0x137d5b){var _0x3ab9e2=_0x578c67[_0xffc9('0x59')][_0xffc9('0x5a')]({'plain':!![]});if(!_0x3ab9e2)throw new Error(_0xffc9('0x5b'));if(_0x3ab9e2[_0xffc9('0x5c')]===_0xffc9('0x59')){var _0x476b92=_0x137d5b[_0xffc9('0x5a')]({'plain':!![]});var _0xdfe894='ChatQueues';return db[_0xffc9('0x5d')][_0xffc9('0x57')]({'where':{'name':_0xdfe894,'userProfileId':_0x3ab9e2[_0xffc9('0x5e')]},'raw':!![]})[_0xffc9('0x1f')](function(_0x5052d1){if(_0x5052d1&&_0x5052d1['autoAssociation']===0x0){return db[_0xffc9('0x37')]['create']({'name':_0x476b92[_0xffc9('0x3a')],'resourceId':_0x476b92['id'],'type':_0x5052d1[_0xffc9('0x3a')],'sectionId':_0x5052d1['id']},{})[_0xffc9('0x1f')](function(){return _0x137d5b;});}else{return _0x137d5b;}})['catch'](function(_0x2de9a5){logger['error'](_0xffc9('0x5f'),_0x2de9a5);throw _0x2de9a5;});}return _0x137d5b;})[_0xffc9('0x1f')](respondWithResult(_0x1a3532,0xc9))[_0xffc9('0x29')](handleError(_0x1a3532,null));};exports['update']=function(_0x20f730,_0x3f61ac){if(_0x20f730['body']['id']){delete _0x20f730['body']['id'];}return db[_0xffc9('0x3e')]['find']({'where':{'id':_0x20f730[_0xffc9('0x55')]['id']}})['then'](handleEntityNotFound(_0x3f61ac,null))[_0xffc9('0x1f')](saveUpdates(_0x20f730[_0xffc9('0x58')],null))[_0xffc9('0x1f')](respondWithResult(_0x3f61ac,null))[_0xffc9('0x29')](handleError(_0x3f61ac,null));};exports[_0xffc9('0x38')]=function(_0x94cf87,_0x3d28a9){return db[_0xffc9('0x3e')]['find']({'where':{'id':_0x94cf87['params']['id']}})[_0xffc9('0x1f')](handleEntityNotFound(_0x3d28a9,null))[_0xffc9('0x1f')](removeEntity(_0x3d28a9,null))[_0xffc9('0x29')](handleError(_0x3d28a9,null));};exports[_0xffc9('0x60')]=function(_0x31f880,_0x779058){return db[_0xffc9('0x3e')]['describe']()['then'](respondWithResult(_0x779058,null))[_0xffc9('0x29')](handleError(_0x779058,null));};exports[_0xffc9('0x61')]=function(_0x3c4f8f,_0x3631f1,_0x2a687a){var _0x5df85b={'raw':!![],'where':{}},_0x1fe641={},_0xc6277b;return db[_0xffc9('0x3e')][_0xffc9('0x62')]({'where':{'id':_0x3c4f8f['params']['id']}})[_0xffc9('0x1f')](handleEntityNotFound(_0x3631f1,null))['then'](function(_0x4d2986){if(_0x4d2986){_0xc6277b=_0x4d2986[_0xffc9('0x5a')]({'plain':!![]});_0x1fe641[_0xffc9('0x46')]=_[_0xffc9('0x43')](db[_0xffc9('0x63')][_0xffc9('0x3f')]);_0x1fe641[_0xffc9('0x47')]=_[_0xffc9('0x43')](_0x3c4f8f[_0xffc9('0x47')]);_0x1fe641[_0xffc9('0x44')]=_[_0xffc9('0x45')](_0x1fe641[_0xffc9('0x46')],_0x1fe641[_0xffc9('0x47')]);_0x5df85b['attributes']=_[_0xffc9('0x45')](_0x1fe641[_0xffc9('0x46')],qs[_0xffc9('0x64')](_0x3c4f8f['query'][_0xffc9('0x64')]));_0x5df85b[_0xffc9('0x48')]=_0x5df85b['attributes'][_0xffc9('0x56')]?_0x5df85b[_0xffc9('0x48')]:_0x1fe641['model'];if(!_0x3c4f8f['query'][_0xffc9('0x49')]('nolimit')){_0x5df85b[_0xffc9('0x30')]=qs[_0xffc9('0x30')](_0x3c4f8f[_0xffc9('0x47')]['limit']);_0x5df85b[_0xffc9('0x2e')]=qs[_0xffc9('0x2e')](_0x3c4f8f[_0xffc9('0x47')][_0xffc9('0x2e')]);}_0x5df85b[_0xffc9('0x4b')]=qs['sort'](_0x3c4f8f[_0xffc9('0x47')][_0xffc9('0x65')]);_0x5df85b[_0xffc9('0x4c')]=qs['filters'](_[_0xffc9('0x66')](_0x3c4f8f['query'],_0x1fe641[_0xffc9('0x44')]));_0x5df85b[_0xffc9('0x4c')]['ChatQueueId']=_0x4d2986['id'];if(_0x3c4f8f['query'][_0xffc9('0x4d')]){_0x5df85b[_0xffc9('0x4c')]=_[_0xffc9('0x4e')](_0x5df85b['where'],{'$or':_[_0xffc9('0x3d')](_0x5df85b[_0xffc9('0x48')],function(_0x28c9a7){var _0x31a8a8={};_0x31a8a8[_0x28c9a7]={'$like':'%'+_0x3c4f8f['query']['filter']+'%'};return _0x31a8a8;})});}_0x5df85b=_[_0xffc9('0x4e')]({},_0x5df85b,_0x3c4f8f[_0xffc9('0x4f')]);return db[_0xffc9('0x63')][_0xffc9('0x52')](_0x5df85b);}})['then'](function(_0x347611){if(_0x347611){return db[_0xffc9('0x67')][_0xffc9('0x68')]({'where':{'id':_[_0xffc9('0x3d')](_0x347611,_0xffc9('0x69')),'role':'agent'},'attributes':['id',_0xffc9('0x3a'),'chatPause','updatedAt',_0xffc9('0x6a')]});}})[_0xffc9('0x1f')](function(_0x8d8fa4){if(_0x8d8fa4){return{'count':_0x8d8fa4[_0xffc9('0x31')],'rows':_['map'](_0x8d8fa4[_0xffc9('0x53')],function(_0x5566d8){return{'membername':_0x5566d8[_0xffc9('0x3a')],'UserId':_0x5566d8['id'],'queue_name':_0xc6277b[_0xffc9('0x3a')],'ChatQueueId':_0xc6277b['id'],'interface':util[_0xffc9('0x6b')](_0xffc9('0x6c'),'SIP',_0x5566d8[_0xffc9('0x3a')]),'penalty':0x0,'paused':_0x5566d8[_0xffc9('0x6d')],'createdAt':_0x5566d8[_0xffc9('0x6a')],'updatedAt':_0x5566d8['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xffc9('0x1f')](respondWithFilteredResult(_0x3631f1,_0x5df85b))[_0xffc9('0x29')](handleError(_0x3631f1,null));};exports[_0xffc9('0x6e')]=function(_0x3bc838,_0x3086d8,_0xce020c){var _0x4133ec={};var _0x392623={};var _0x2d3ab0;var _0x8db8cf;return db[_0xffc9('0x3e')][_0xffc9('0x62')]({'where':{'id':_0x3bc838[_0xffc9('0x55')]['id']}})[_0xffc9('0x1f')](handleEntityNotFound(_0x3086d8,null))[_0xffc9('0x1f')](function(_0x677796){if(_0x677796){_0x2d3ab0=_0x677796;_0x392623[_0xffc9('0x46')]=_[_0xffc9('0x43')](db[_0xffc9('0x6f')][_0xffc9('0x3f')]);_0x392623['query']=_['keys'](_0x3bc838[_0xffc9('0x47')]);_0x392623['filters']=_['intersection'](_0x392623[_0xffc9('0x46')],_0x392623[_0xffc9('0x47')]);_0x4133ec[_0xffc9('0x48')]=_[_0xffc9('0x45')](_0x392623['model'],qs['fields'](_0x3bc838['query'][_0xffc9('0x64')]));_0x4133ec['attributes']=_0x4133ec[_0xffc9('0x48')]['length']?_0x4133ec['attributes']:_0x392623['model'];_0x4133ec['order']=qs[_0xffc9('0x65')](_0x3bc838['query'][_0xffc9('0x65')]);_0x4133ec[_0xffc9('0x4c')]=qs[_0xffc9('0x44')](_['pick'](_0x3bc838[_0xffc9('0x47')],_0x392623[_0xffc9('0x44')]));if(_0x3bc838['query']['filter']){_0x4133ec[_0xffc9('0x4c')]=_[_0xffc9('0x4e')](_0x4133ec[_0xffc9('0x4c')],{'$or':_[_0xffc9('0x3d')](_0x4133ec[_0xffc9('0x48')],function(_0x3b160a){var _0x52b590={};_0x52b590[_0x3b160a]={'$like':'%'+_0x3bc838[_0xffc9('0x47')][_0xffc9('0x4d')]+'%'};return _0x52b590;})});}_0x4133ec=_[_0xffc9('0x4e')]({},_0x4133ec,_0x3bc838[_0xffc9('0x4f')]);return _0x2d3ab0[_0xffc9('0x6e')](_0x4133ec);}})[_0xffc9('0x1f')](function(_0x11201d){if(_0x11201d){_0x8db8cf=_0x11201d['length'];if(!_0x3bc838[_0xffc9('0x47')]['hasOwnProperty'](_0xffc9('0x4a'))){_0x4133ec[_0xffc9('0x30')]=qs[_0xffc9('0x30')](_0x3bc838[_0xffc9('0x47')][_0xffc9('0x30')]);_0x4133ec['offset']=qs[_0xffc9('0x2e')](_0x3bc838['query']['offset']);}return _0x2d3ab0[_0xffc9('0x6e')](_0x4133ec);}})[_0xffc9('0x1f')](function(_0x278996){if(_0x278996){return _0x278996?{'count':_0x8db8cf,'rows':_0x278996}:null;}})[_0xffc9('0x1f')](respondWithResult(_0x3086d8,null))[_0xffc9('0x29')](handleError(_0x3086d8,null));};exports['addTeams']=function(_0x6872e7,_0x8f320f,_0x47feed){var _0x1fe8fb=_0x6872e7[_0xffc9('0x58')][_0xffc9('0x70')];return db[_0xffc9('0x6f')][_0xffc9('0x52')]({'where':{'id':_0x1fe8fb},'attributes':['id'],'include':[{'model':db[_0xffc9('0x67')],'as':'Agents','attributes':['id',_0xffc9('0x3a'),'online',_0xffc9('0x71'),_0xffc9('0x72')],'raw':!![]}]})['then'](function(_0x362f4c){if(_0x362f4c){var _0x59809a=_[_0xffc9('0x73')](_0x362f4c,function(_0x187e91){var _0x2d065f=_0x187e91[_0xffc9('0x5a')]({'plain':!![]});return _0x2d065f[_0xffc9('0x74')];});return db[_0xffc9('0x3e')][_0xffc9('0x57')]({'where':{'id':_0x6872e7[_0xffc9('0x55')]['id']}})[_0xffc9('0x1f')](function(_0x29a42b){return db['sequelize']['transaction'](function(_0x3a9afa){return _0x29a42b[_0xffc9('0x75')](_0x1fe8fb,{'transaction':_0x3a9afa})[_0xffc9('0x1f')](function(){return BPromise['each'](_0x59809a,function(_0x1183f5){return db[_0xffc9('0x63')][_0xffc9('0x76')]({'where':{'UserId':_0x1183f5['id'],'ChatQueueId':_0x6872e7[_0xffc9('0x55')]['id']},'transaction':_0x3a9afa});});})[_0xffc9('0x1f')](function(){_0x59809a[_0xffc9('0x77')](function(_0x8e30ab){socket[_0xffc9('0x78')](_0xffc9('0x79'),{'UserId':_0x8e30ab['id'],'ChatQueueId':_0x29a42b['id']});});});});});}})[_0xffc9('0x1f')](respondWithStatusCode(_0x8f320f,null))[_0xffc9('0x29')](handleError(_0x8f320f,null));};exports[_0xffc9('0x7a')]=function(_0x155205,_0x5b2b5b,_0x335886){return db[_0xffc9('0x6f')][_0xffc9('0x52')]({'where':{'id':_0x155205[_0xffc9('0x47')][_0xffc9('0x70')]},'attributes':['id'],'include':[{'model':db[_0xffc9('0x67')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xffc9('0x1f')](handleEntityNotFound(_0x5b2b5b,null))[_0xffc9('0x1f')](function(_0x1d6729){var _0x2626e4=_[_0xffc9('0x3d')](_0x1d6729,'id');var _0x4849a2=[];var _0x3e146c=[];var _0x2b15b6=squel['select']();_0x2b15b6[_0xffc9('0x7b')]('tq.TeamId')['from'](_0xffc9('0x7c'),'tq')[_0xffc9('0x7d')](_0xffc9('0x7e'),'ut',_0xffc9('0x7f'))[_0xffc9('0x4c')](_0xffc9('0x80'),_0x155205[_0xffc9('0x55')]['id']);for(var _0x3a2a21=0x0;_0x3a2a21<_0x1d6729[_0xffc9('0x56')];_0x3a2a21+=0x1){let _0x51751a=_0x1d6729[_0x3a2a21];for(var _0x1a0d97=0x0;_0x1a0d97<_0x51751a['Agents'][_0xffc9('0x56')];_0x1a0d97+=0x1){let _0x5464c3=_0x51751a[_0xffc9('0x74')][_0x1a0d97];var _0x6579be=_0x2b15b6[_0xffc9('0x81')]();_0x6579be['where'](_0xffc9('0x82'),_0x5464c3['id']);_0x3e146c[_0xffc9('0x83')](db[_0xffc9('0x84')][_0xffc9('0x47')](_0x6579be[_0xffc9('0x85')](),{'type':db[_0xffc9('0x84')][_0xffc9('0x86')][_0xffc9('0x87')]})['then'](function(_0x155c38){if(_0x155c38[_0xffc9('0x56')]===0x1){return _0x5464c3['id'];}else{var _0xf34374=_[_0xffc9('0x88')](_[_0xffc9('0x3d')](_0x155c38,_0xffc9('0x89')),function(_0x4f78fb){return _[_0xffc9('0x8a')](_0x2626e4,_0x4f78fb);});if(_0xf34374){return _0x5464c3['id'];}}}));}}return BPromise[_0xffc9('0x8b')](_0x3e146c)[_0xffc9('0x1f')](function(_0x7aba4d){_0x4849a2=_(_0x4849a2)[_0xffc9('0x8c')](_0x7aba4d)[_0xffc9('0x8d')]()[_0xffc9('0x8e')]();return db[_0xffc9('0x3e')][_0xffc9('0x57')]({'where':{'id':_0x155205[_0xffc9('0x55')]['id']}})['then'](function(_0x13f945){return db['sequelize']['transaction'](function(_0x12c40d){return _0x13f945[_0xffc9('0x7a')](_0x155205[_0xffc9('0x47')][_0xffc9('0x70')],{'transaction':_0x12c40d})[_0xffc9('0x1f')](function(){if(!_[_0xffc9('0x8f')](_0x4849a2)){return _0x13f945[_0xffc9('0x90')](_0x4849a2,{'transaction':_0x12c40d});}})['then'](function(){_0x4849a2[_0xffc9('0x77')](function(_0x3d736e){socket[_0xffc9('0x78')](_0xffc9('0x91'),{'UserId':_0x3d736e,'ChatQueueId':_0x13f945['id']});});});});});});})[_0xffc9('0x1f')](respondWithStatusCode(_0x5b2b5b,null))[_0xffc9('0x29')](handleError(_0x5b2b5b,null));};exports['addAgents']=function(_0x21b1b4,_0x5cc66a,_0x24877e){return db[_0xffc9('0x3e')]['find']({'where':{'id':_0x21b1b4[_0xffc9('0x55')]['id']}})[_0xffc9('0x1f')](handleEntityNotFound(_0x5cc66a,null))['then'](function(_0x2e6f41){if(_0x2e6f41){return _0x2e6f41[_0xffc9('0x92')](_0x21b1b4['body'][_0xffc9('0x70')],_['omit'](_0x21b1b4['body'],[_0xffc9('0x70'),'id'])||{})[_0xffc9('0x93')](function(_0x7aa6a6){for(var _0x1c0b38=0x0;_0x1c0b38<_0x21b1b4[_0xffc9('0x58')]['ids']['length'];_0x1c0b38+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x21b1b4[_0xffc9('0x58')][_0xffc9('0x70')][_0x1c0b38]),'ChatQueueId':Number(_0x21b1b4[_0xffc9('0x55')]['id'])});}return _0x7aa6a6;});}})[_0xffc9('0x1f')](respondWithResult(_0x5cc66a,null))['catch'](handleError(_0x5cc66a,null));};exports[_0xffc9('0x90')]=function(_0x23791c,_0x483202,_0x489e41){return db[_0xffc9('0x3e')][_0xffc9('0x57')]({'where':{'id':_0x23791c[_0xffc9('0x55')]['id']}})[_0xffc9('0x1f')](handleEntityNotFound(_0x483202,null))[_0xffc9('0x1f')](function(_0x2a0e31){if(_0x2a0e31){return _0x2a0e31[_0xffc9('0x90')](_0x23791c[_0xffc9('0x47')][_0xffc9('0x70')])[_0xffc9('0x1f')](function(){if(_['isArray'](_0x23791c[_0xffc9('0x47')][_0xffc9('0x70')])){for(var _0x1ee8e9=0x0;_0x1ee8e9<_0x23791c[_0xffc9('0x47')]['ids'][_0xffc9('0x56')];_0x1ee8e9+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x23791c[_0xffc9('0x47')][_0xffc9('0x70')][_0x1ee8e9]),'ChatQueueId':Number(_0x23791c[_0xffc9('0x55')]['id'])});}}else{socket['emit'](_0xffc9('0x91'),{'UserId':Number(_0x23791c[_0xffc9('0x47')][_0xffc9('0x70')]),'ChatQueueId':Number(_0x23791c['params']['id'])});}});}})[_0xffc9('0x1f')](respondWithStatusCode(_0x483202,null))[_0xffc9('0x29')](handleError(_0x483202,null));};exports['getAgents']=function(_0x4f1698,_0x5c02ae,_0x35b850){var _0x45f1a5={};var _0x317a1a={};var _0x23183f;var _0x5276e5;return db[_0xffc9('0x3e')][_0xffc9('0x62')]({'where':{'id':_0x4f1698[_0xffc9('0x55')]['id']}})[_0xffc9('0x1f')](handleEntityNotFound(_0x5c02ae,null))[_0xffc9('0x1f')](function(_0x2e264e){if(_0x2e264e){_0x23183f=_0x2e264e;_0x317a1a[_0xffc9('0x46')]=_[_0xffc9('0x43')](db[_0xffc9('0x67')][_0xffc9('0x3f')]);_0x317a1a[_0xffc9('0x47')]=_[_0xffc9('0x43')](_0x4f1698[_0xffc9('0x47')]);_0x317a1a[_0xffc9('0x44')]=_[_0xffc9('0x45')](_0x317a1a[_0xffc9('0x46')],_0x317a1a[_0xffc9('0x47')]);_0x45f1a5[_0xffc9('0x48')]=_['intersection'](_0x317a1a[_0xffc9('0x46')],qs[_0xffc9('0x64')](_0x4f1698[_0xffc9('0x47')][_0xffc9('0x64')]));_0x45f1a5[_0xffc9('0x48')]=_0x45f1a5['attributes'][_0xffc9('0x56')]?_0x45f1a5[_0xffc9('0x48')]:_0x317a1a[_0xffc9('0x46')];_0x45f1a5[_0xffc9('0x4b')]=qs[_0xffc9('0x65')](_0x4f1698[_0xffc9('0x47')][_0xffc9('0x65')]);_0x45f1a5['where']=qs[_0xffc9('0x44')](_[_0xffc9('0x66')](_0x4f1698[_0xffc9('0x47')],_0x317a1a['filters']));if(_0x4f1698[_0xffc9('0x47')][_0xffc9('0x4d')]){_0x45f1a5[_0xffc9('0x4c')]=_[_0xffc9('0x4e')](_0x45f1a5[_0xffc9('0x4c')],{'$or':_[_0xffc9('0x3d')](_0x45f1a5[_0xffc9('0x48')],function(_0xd56ea1){var _0x5300b1={};_0x5300b1[_0xd56ea1]={'$like':'%'+_0x4f1698[_0xffc9('0x47')][_0xffc9('0x4d')]+'%'};return _0x5300b1;})});}_0x45f1a5=_[_0xffc9('0x4e')]({},_0x45f1a5,_0x4f1698[_0xffc9('0x4f')]);return _0x23183f[_0xffc9('0x94')](_0x45f1a5);}})['then'](function(_0x1fbaf4){if(_0x1fbaf4){_0x5276e5=_0x1fbaf4[_0xffc9('0x56')];if(!_0x4f1698[_0xffc9('0x47')][_0xffc9('0x49')]('nolimit')){_0x45f1a5['limit']=qs[_0xffc9('0x30')](_0x4f1698[_0xffc9('0x47')][_0xffc9('0x30')]);_0x45f1a5[_0xffc9('0x2e')]=qs[_0xffc9('0x2e')](_0x4f1698['query'][_0xffc9('0x2e')]);}return _0x23183f[_0xffc9('0x94')](_0x45f1a5);}})[_0xffc9('0x1f')](function(_0xa2211e){if(_0xa2211e){return _0xa2211e?{'count':_0x5276e5,'rows':_0xa2211e}:null;}})[_0xffc9('0x1f')](respondWithResult(_0x5c02ae,null))['catch'](handleError(_0x5c02ae,null));};
\ No newline at end of file
+var _0x1ce5=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','format','%s/%s','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','findOrCreate','forEach','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','transaction','removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','destroy','get','ChatQueues','stack','name','send','index','ChatQueue','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x2c3b55,_0x52944c){var _0x52aff2=function(_0x26dbb0){while(--_0x26dbb0){_0x2c3b55['push'](_0x2c3b55['shift']());}};_0x52aff2(++_0x52944c);}(_0x1ce5,0xea));var _0x51ce=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x1ce5[_0x2235bf];return _0x4c3a64;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x51ce('0x0'));var rp=require(_0x51ce('0x1'));var moment=require(_0x51ce('0x2'));var BPromise=require(_0x51ce('0x3'));var Mustache=require(_0x51ce('0x4'));var util=require(_0x51ce('0x5'));var path=require(_0x51ce('0x6'));var sox=require(_0x51ce('0x7'));var csv=require(_0x51ce('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51ce('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x51ce('0xa'));var deskjs=require(_0x51ce('0xb'));var toCsv=require(_0x51ce('0x8'));var querystring=require('querystring');var Papa=require(_0x51ce('0xc'));var Redis=require(_0x51ce('0xd'));var authService=require(_0x51ce('0xe'));var qs=require(_0x51ce('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x51ce('0x10'));var logger=require(_0x51ce('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x51ce('0x12'));var db=require(_0x51ce('0x13'))['db'];config[_0x51ce('0x14')]=_[_0x51ce('0x15')](config['redis'],{'host':_0x51ce('0x16'),'port':0x18eb});var socket=require(_0x51ce('0x17'))(new Redis(config[_0x51ce('0x14')]));require(_0x51ce('0x18'))[_0x51ce('0x19')](socket);var jayson=require(_0x51ce('0x1a'));var client=jayson[_0x51ce('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f7f85,_0x15e57f,_0x57d22d,_0x21d4d8){return new BPromise(function(_0x369bde,_0x13cb2c){var _0x9b73d=_0x21d4d8||client;return _0x9b73d[_0x51ce('0x1c')](_0x1f7f85,_0x57d22d)[_0x51ce('0x1d')](function(_0xd4af01){logger[_0x51ce('0x1e')](_0x51ce('0x1f'),_0x15e57f,_0x51ce('0x20'));logger[_0x51ce('0x21')](_0x51ce('0x22'),_0x15e57f,_0x51ce('0x20'),JSON['stringify'](_0xd4af01));if(_0xd4af01[_0x51ce('0x23')]){if(_0xd4af01[_0x51ce('0x23')][_0x51ce('0x24')]===0x1f4){logger['error'](_0x51ce('0x1f'),_0x15e57f,_0xd4af01[_0x51ce('0x23')][_0x51ce('0x25')]);return _0x13cb2c(_0xd4af01['error']['message']);}logger[_0x51ce('0x23')]('ChatQueue,\x20%s,\x20%s',_0x15e57f,_0xd4af01[_0x51ce('0x23')][_0x51ce('0x25')]);return _0x369bde(_0xd4af01[_0x51ce('0x23')][_0x51ce('0x25')]);}else{logger[_0x51ce('0x1e')]('ChatQueue,\x20%s,\x20%s',_0x15e57f,_0x51ce('0x20'));_0x369bde(_0xd4af01[_0x51ce('0x26')][_0x51ce('0x25')]);}})[_0x51ce('0x27')](function(_0x20aec2){logger[_0x51ce('0x23')](_0x51ce('0x1f'),_0x15e57f,_0x20aec2);_0x13cb2c(_0x20aec2);});});}function respondWithStatusCode(_0x41fa69,_0x3d34db){_0x3d34db=_0x3d34db||0xcc;return function(_0x4f264d){if(_0x4f264d){return _0x41fa69[_0x51ce('0x28')](_0x3d34db);}return _0x41fa69[_0x51ce('0x29')](_0x3d34db)[_0x51ce('0x2a')]();};}function respondWithResult(_0x450089,_0x4d08b8){_0x4d08b8=_0x4d08b8||0xc8;return function(_0x5c6605){if(_0x5c6605){return _0x450089[_0x51ce('0x29')](_0x4d08b8)[_0x51ce('0x2b')](_0x5c6605);}};}function respondWithFilteredResult(_0x1742c3,_0xf2248e){return function(_0x5dd380){if(_0x5dd380){var _0x5ad1e3=typeof _0xf2248e[_0x51ce('0x2c')]===_0x51ce('0x2d')&&typeof _0xf2248e['limit']==='undefined';var _0x6cdfa3=_0x5dd380[_0x51ce('0x2e')];var _0x48eb90=_0x5ad1e3?0x0:_0xf2248e[_0x51ce('0x2c')];var _0x15114a=_0x5ad1e3?_0x5dd380[_0x51ce('0x2e')]:_0xf2248e[_0x51ce('0x2c')]+_0xf2248e[_0x51ce('0x2f')];var _0x35a680;if(_0x15114a>=_0x6cdfa3){_0x15114a=_0x6cdfa3;_0x35a680=0xc8;}else{_0x35a680=0xce;}_0x1742c3[_0x51ce('0x29')](_0x35a680);return _0x1742c3['set'](_0x51ce('0x30'),_0x48eb90+'-'+_0x15114a+'/'+_0x6cdfa3)[_0x51ce('0x2b')](_0x5dd380);}return null;};}function patchUpdates(_0x5b5e16){return function(_0x2219c0){try{jsonpatch[_0x51ce('0x31')](_0x2219c0,_0x5b5e16,!![]);}catch(_0x1f0676){return BPromise[_0x51ce('0x32')](_0x1f0676);}return _0x2219c0['save']();};}function saveUpdates(_0x5cfa0e,_0x8714f6){return function(_0x34225c){if(_0x34225c){return _0x34225c[_0x51ce('0x33')](_0x5cfa0e)[_0x51ce('0x1d')](function(_0x47af16){return _0x47af16;});}return null;};}function removeEntity(_0x3ec336,_0x339697){return function(_0x33d4f8){if(_0x33d4f8){return _0x33d4f8[_0x51ce('0x34')]()[_0x51ce('0x1d')](function(){var _0x3fa98c=_0x33d4f8[_0x51ce('0x35')]({'plain':!![]});var _0x263aba=_0x51ce('0x36');return db['UserProfileResource'][_0x51ce('0x34')]({'where':{'type':_0x263aba,'resourceId':_0x3fa98c['id']}})[_0x51ce('0x1d')](function(){return _0x33d4f8;});})[_0x51ce('0x1d')](function(){_0x3ec336[_0x51ce('0x29')](0xcc)[_0x51ce('0x2a')]();});}};}function handleEntityNotFound(_0x416648,_0x22c026){return function(_0x299440){if(!_0x299440){_0x416648[_0x51ce('0x28')](0x194);}return _0x299440;};}function handleError(_0x16cc30,_0x44ff68){_0x44ff68=_0x44ff68||0x1f4;return function(_0x93abbf){logger[_0x51ce('0x23')](_0x93abbf[_0x51ce('0x37')]);if(_0x93abbf[_0x51ce('0x38')]){delete _0x93abbf[_0x51ce('0x38')];}_0x16cc30[_0x51ce('0x29')](_0x44ff68)[_0x51ce('0x39')](_0x93abbf);};}exports[_0x51ce('0x3a')]=function(_0x22d36b,_0x2f4a34){var _0x4bcffe={},_0x18efea={},_0x12b9c4={'count':0x0,'rows':[]};var _0x3a12f9=_['map'](db[_0x51ce('0x3b')]['rawAttributes'],function(_0x149fb4){return{'name':_0x149fb4[_0x51ce('0x3c')],'type':_0x149fb4[_0x51ce('0x3d')][_0x51ce('0x3e')]};});_0x18efea[_0x51ce('0x3f')]=_['map'](_0x3a12f9,'name');_0x18efea[_0x51ce('0x40')]=_[_0x51ce('0x41')](_0x22d36b[_0x51ce('0x40')]);_0x18efea[_0x51ce('0x42')]=_[_0x51ce('0x43')](_0x18efea['model'],_0x18efea[_0x51ce('0x40')]);_0x4bcffe[_0x51ce('0x44')]=_[_0x51ce('0x43')](_0x18efea[_0x51ce('0x3f')],qs[_0x51ce('0x45')](_0x22d36b[_0x51ce('0x40')][_0x51ce('0x45')]));_0x4bcffe['attributes']=_0x4bcffe[_0x51ce('0x44')][_0x51ce('0x46')]?_0x4bcffe[_0x51ce('0x44')]:_0x18efea[_0x51ce('0x3f')];if(!_0x22d36b[_0x51ce('0x40')][_0x51ce('0x47')](_0x51ce('0x48'))){_0x4bcffe[_0x51ce('0x2f')]=qs[_0x51ce('0x2f')](_0x22d36b[_0x51ce('0x40')]['limit']);_0x4bcffe[_0x51ce('0x2c')]=qs[_0x51ce('0x2c')](_0x22d36b[_0x51ce('0x40')]['offset']);}_0x4bcffe[_0x51ce('0x49')]=qs[_0x51ce('0x4a')](_0x22d36b[_0x51ce('0x40')][_0x51ce('0x4a')]);_0x4bcffe[_0x51ce('0x4b')]=qs[_0x51ce('0x42')](_[_0x51ce('0x4c')](_0x22d36b[_0x51ce('0x40')],_0x18efea[_0x51ce('0x42')]),_0x3a12f9);if(_0x22d36b[_0x51ce('0x40')][_0x51ce('0x4d')]){_0x4bcffe['where']=_[_0x51ce('0x4e')](_0x4bcffe[_0x51ce('0x4b')],{'$or':_[_0x51ce('0x4f')](_0x3a12f9,function(_0x587d4f){if(_0x587d4f['type']!==_0x51ce('0x50')){var _0x420c83={};_0x420c83[_0x587d4f[_0x51ce('0x38')]]={'$like':'%'+_0x22d36b[_0x51ce('0x40')][_0x51ce('0x4d')]+'%'};return _0x420c83;}})});}_0x4bcffe=_['merge']({},_0x4bcffe,_0x22d36b[_0x51ce('0x51')]);var _0x50f75d={'where':_0x4bcffe[_0x51ce('0x4b')]};return db[_0x51ce('0x3b')]['count'](_0x50f75d)[_0x51ce('0x1d')](function(_0x1f43ea){_0x12b9c4[_0x51ce('0x2e')]=_0x1f43ea;if(_0x22d36b[_0x51ce('0x40')][_0x51ce('0x52')]){_0x4bcffe['include']=[{'all':!![]}];}return db[_0x51ce('0x3b')][_0x51ce('0x53')](_0x4bcffe);})[_0x51ce('0x1d')](function(_0xeb8611){_0x12b9c4[_0x51ce('0x54')]=_0xeb8611;return _0x12b9c4;})[_0x51ce('0x1d')](respondWithFilteredResult(_0x2f4a34,_0x4bcffe))[_0x51ce('0x27')](handleError(_0x2f4a34,null));};exports[_0x51ce('0x55')]=function(_0x258972,_0x4df83e){var _0x20c0f0={'raw':!![],'where':{'id':_0x258972['params']['id']}},_0x530451={};_0x530451[_0x51ce('0x3f')]=_[_0x51ce('0x41')](db[_0x51ce('0x3b')][_0x51ce('0x56')]);_0x530451[_0x51ce('0x40')]=_[_0x51ce('0x41')](_0x258972['query']);_0x530451[_0x51ce('0x42')]=_[_0x51ce('0x43')](_0x530451[_0x51ce('0x3f')],_0x530451[_0x51ce('0x40')]);_0x20c0f0[_0x51ce('0x44')]=_[_0x51ce('0x43')](_0x530451[_0x51ce('0x3f')],qs[_0x51ce('0x45')](_0x258972[_0x51ce('0x40')]['fields']));_0x20c0f0[_0x51ce('0x44')]=_0x20c0f0['attributes']['length']?_0x20c0f0[_0x51ce('0x44')]:_0x530451[_0x51ce('0x3f')];if(_0x258972[_0x51ce('0x40')][_0x51ce('0x52')]){_0x20c0f0['include']=[{'all':!![]}];}_0x20c0f0=_[_0x51ce('0x4e')]({},_0x20c0f0,_0x258972['options']);return db[_0x51ce('0x3b')][_0x51ce('0x57')](_0x20c0f0)['then'](handleEntityNotFound(_0x4df83e,null))[_0x51ce('0x1d')](respondWithResult(_0x4df83e,null))['catch'](handleError(_0x4df83e,null));};exports[_0x51ce('0x58')]=function(_0x456a1c,_0x1e3b30){return db[_0x51ce('0x3b')]['create'](_0x456a1c[_0x51ce('0x59')],{})['then'](function(_0xf828be){var _0x459700=_0x456a1c[_0x51ce('0x5a')][_0x51ce('0x35')]({'plain':!![]});if(!_0x459700)throw new Error(_0x51ce('0x5b'));if(_0x459700[_0x51ce('0x5c')]==='user'){var _0x26ba3f=_0xf828be[_0x51ce('0x35')]({'plain':!![]});var _0x5aa378='ChatQueues';return db['UserProfileSection'][_0x51ce('0x57')]({'where':{'name':_0x5aa378,'userProfileId':_0x459700[_0x51ce('0x5d')]},'raw':!![]})['then'](function(_0x25a063){if(_0x25a063&&_0x25a063['autoAssociation']===0x0){return db[_0x51ce('0x5e')][_0x51ce('0x58')]({'name':_0x26ba3f[_0x51ce('0x38')],'resourceId':_0x26ba3f['id'],'type':_0x25a063[_0x51ce('0x38')],'sectionId':_0x25a063['id']},{})[_0x51ce('0x1d')](function(){return _0xf828be;});}else{return _0xf828be;}})[_0x51ce('0x27')](function(_0x3e9e56){logger[_0x51ce('0x23')](_0x51ce('0x5f'),_0x3e9e56);throw _0x3e9e56;});}return _0xf828be;})['then'](respondWithResult(_0x1e3b30,0xc9))[_0x51ce('0x27')](handleError(_0x1e3b30,null));};exports['update']=function(_0x5b570b,_0x427dbf){if(_0x5b570b[_0x51ce('0x59')]['id']){delete _0x5b570b[_0x51ce('0x59')]['id'];}return db['ChatQueue'][_0x51ce('0x57')]({'where':{'id':_0x5b570b[_0x51ce('0x60')]['id']}})['then'](handleEntityNotFound(_0x427dbf,null))[_0x51ce('0x1d')](saveUpdates(_0x5b570b[_0x51ce('0x59')],null))[_0x51ce('0x1d')](respondWithResult(_0x427dbf,null))[_0x51ce('0x27')](handleError(_0x427dbf,null));};exports['destroy']=function(_0x3f82d5,_0x4a21a8){return db[_0x51ce('0x3b')]['find']({'where':{'id':_0x3f82d5[_0x51ce('0x60')]['id']}})[_0x51ce('0x1d')](handleEntityNotFound(_0x4a21a8,null))[_0x51ce('0x1d')](removeEntity(_0x4a21a8,null))[_0x51ce('0x27')](handleError(_0x4a21a8,null));};exports['describe']=function(_0x5a1494,_0x7ecdbe){return db[_0x51ce('0x3b')][_0x51ce('0x61')]()[_0x51ce('0x1d')](respondWithResult(_0x7ecdbe,null))[_0x51ce('0x27')](handleError(_0x7ecdbe,null));};exports['getMembers']=function(_0x39d5ae,_0x261c1b,_0x189e51){var _0x41d6e0={'raw':!![],'where':{}},_0x5fd42a={},_0x30f977;return db[_0x51ce('0x3b')][_0x51ce('0x62')]({'where':{'id':_0x39d5ae[_0x51ce('0x60')]['id']}})['then'](handleEntityNotFound(_0x261c1b,null))[_0x51ce('0x1d')](function(_0x2bbfd6){if(_0x2bbfd6){_0x30f977=_0x2bbfd6['get']({'plain':!![]});_0x5fd42a[_0x51ce('0x3f')]=_[_0x51ce('0x41')](db[_0x51ce('0x63')][_0x51ce('0x56')]);_0x5fd42a['query']=_[_0x51ce('0x41')](_0x39d5ae[_0x51ce('0x40')]);_0x5fd42a['filters']=_[_0x51ce('0x43')](_0x5fd42a[_0x51ce('0x3f')],_0x5fd42a['query']);_0x41d6e0[_0x51ce('0x44')]=_[_0x51ce('0x43')](_0x5fd42a[_0x51ce('0x3f')],qs['fields'](_0x39d5ae[_0x51ce('0x40')][_0x51ce('0x45')]));_0x41d6e0[_0x51ce('0x44')]=_0x41d6e0[_0x51ce('0x44')]['length']?_0x41d6e0['attributes']:_0x5fd42a['model'];if(!_0x39d5ae[_0x51ce('0x40')][_0x51ce('0x47')](_0x51ce('0x48'))){_0x41d6e0[_0x51ce('0x2f')]=qs['limit'](_0x39d5ae[_0x51ce('0x40')][_0x51ce('0x2f')]);_0x41d6e0['offset']=qs[_0x51ce('0x2c')](_0x39d5ae[_0x51ce('0x40')][_0x51ce('0x2c')]);}_0x41d6e0[_0x51ce('0x49')]=qs[_0x51ce('0x4a')](_0x39d5ae[_0x51ce('0x40')][_0x51ce('0x4a')]);_0x41d6e0['where']=qs[_0x51ce('0x42')](_[_0x51ce('0x4c')](_0x39d5ae[_0x51ce('0x40')],_0x5fd42a[_0x51ce('0x42')]));_0x41d6e0[_0x51ce('0x4b')][_0x51ce('0x64')]=_0x2bbfd6['id'];if(_0x39d5ae[_0x51ce('0x40')][_0x51ce('0x4d')]){_0x41d6e0['where']=_['merge'](_0x41d6e0[_0x51ce('0x4b')],{'$or':_[_0x51ce('0x4f')](_0x41d6e0[_0x51ce('0x44')],function(_0x258fc7){var _0x4792f4={};_0x4792f4[_0x258fc7]={'$like':'%'+_0x39d5ae[_0x51ce('0x40')][_0x51ce('0x4d')]+'%'};return _0x4792f4;})});}_0x41d6e0=_[_0x51ce('0x4e')]({},_0x41d6e0,_0x39d5ae[_0x51ce('0x51')]);return db[_0x51ce('0x63')][_0x51ce('0x53')](_0x41d6e0);}})[_0x51ce('0x1d')](function(_0x15e456){if(_0x15e456){return db[_0x51ce('0x65')][_0x51ce('0x66')]({'where':{'id':_[_0x51ce('0x4f')](_0x15e456,_0x51ce('0x67')),'role':_0x51ce('0x68')},'attributes':['id',_0x51ce('0x38'),_0x51ce('0x69'),_0x51ce('0x6a'),'createdAt']});}})['then'](function(_0x552d6c){if(_0x552d6c){return{'count':_0x552d6c[_0x51ce('0x2e')],'rows':_['map'](_0x552d6c[_0x51ce('0x54')],function(_0x5ee473){return{'membername':_0x5ee473['name'],'UserId':_0x5ee473['id'],'queue_name':_0x30f977[_0x51ce('0x38')],'ChatQueueId':_0x30f977['id'],'interface':util[_0x51ce('0x6b')](_0x51ce('0x6c'),'SIP',_0x5ee473[_0x51ce('0x38')]),'penalty':0x0,'paused':_0x5ee473['chatPause'],'createdAt':_0x5ee473[_0x51ce('0x6d')],'updatedAt':_0x5ee473[_0x51ce('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x51ce('0x1d')](respondWithFilteredResult(_0x261c1b,_0x41d6e0))['catch'](handleError(_0x261c1b,null));};exports[_0x51ce('0x6e')]=function(_0x1f9aee,_0x1f989f,_0x8375f0){var _0x36acec={};var _0x1eb274={};var _0x7e7f5f;var _0x5a830c;return db[_0x51ce('0x3b')]['findOne']({'where':{'id':_0x1f9aee[_0x51ce('0x60')]['id']}})['then'](handleEntityNotFound(_0x1f989f,null))['then'](function(_0x506223){if(_0x506223){_0x7e7f5f=_0x506223;_0x1eb274[_0x51ce('0x3f')]=_[_0x51ce('0x41')](db[_0x51ce('0x6f')][_0x51ce('0x56')]);_0x1eb274[_0x51ce('0x40')]=_[_0x51ce('0x41')](_0x1f9aee[_0x51ce('0x40')]);_0x1eb274[_0x51ce('0x42')]=_[_0x51ce('0x43')](_0x1eb274[_0x51ce('0x3f')],_0x1eb274[_0x51ce('0x40')]);_0x36acec['attributes']=_[_0x51ce('0x43')](_0x1eb274['model'],qs['fields'](_0x1f9aee[_0x51ce('0x40')][_0x51ce('0x45')]));_0x36acec[_0x51ce('0x44')]=_0x36acec['attributes'][_0x51ce('0x46')]?_0x36acec[_0x51ce('0x44')]:_0x1eb274[_0x51ce('0x3f')];_0x36acec[_0x51ce('0x49')]=qs[_0x51ce('0x4a')](_0x1f9aee[_0x51ce('0x40')][_0x51ce('0x4a')]);_0x36acec[_0x51ce('0x4b')]=qs[_0x51ce('0x42')](_['pick'](_0x1f9aee[_0x51ce('0x40')],_0x1eb274[_0x51ce('0x42')]));if(_0x1f9aee[_0x51ce('0x40')][_0x51ce('0x4d')]){_0x36acec[_0x51ce('0x4b')]=_[_0x51ce('0x4e')](_0x36acec[_0x51ce('0x4b')],{'$or':_['map'](_0x36acec[_0x51ce('0x44')],function(_0x2a7a5e){var _0x4b48a8={};_0x4b48a8[_0x2a7a5e]={'$like':'%'+_0x1f9aee[_0x51ce('0x40')][_0x51ce('0x4d')]+'%'};return _0x4b48a8;})});}_0x36acec=_[_0x51ce('0x4e')]({},_0x36acec,_0x1f9aee[_0x51ce('0x51')]);return _0x7e7f5f[_0x51ce('0x6e')](_0x36acec);}})[_0x51ce('0x1d')](function(_0x5c6113){if(_0x5c6113){_0x5a830c=_0x5c6113[_0x51ce('0x46')];if(!_0x1f9aee[_0x51ce('0x40')][_0x51ce('0x47')](_0x51ce('0x48'))){_0x36acec[_0x51ce('0x2f')]=qs['limit'](_0x1f9aee['query'][_0x51ce('0x2f')]);_0x36acec['offset']=qs[_0x51ce('0x2c')](_0x1f9aee['query'][_0x51ce('0x2c')]);}return _0x7e7f5f[_0x51ce('0x6e')](_0x36acec);}})['then'](function(_0x3400fe){if(_0x3400fe){return _0x3400fe?{'count':_0x5a830c,'rows':_0x3400fe}:null;}})['then'](respondWithResult(_0x1f989f,null))[_0x51ce('0x27')](handleError(_0x1f989f,null));};exports[_0x51ce('0x70')]=function(_0x25db62,_0x4378ac,_0x3127a7){var _0x3fe846=_0x25db62[_0x51ce('0x59')][_0x51ce('0x71')];return db[_0x51ce('0x6f')][_0x51ce('0x53')]({'where':{'id':_0x3fe846},'attributes':['id'],'include':[{'model':db[_0x51ce('0x65')],'as':_0x51ce('0x72'),'attributes':['id',_0x51ce('0x38'),_0x51ce('0x73'),_0x51ce('0x74'),_0x51ce('0x75')],'raw':!![]}]})['then'](function(_0x1c1062){if(_0x1c1062){var _0x24633b=_[_0x51ce('0x76')](_0x1c1062,function(_0x4ee81d){var _0xc2aecf=_0x4ee81d[_0x51ce('0x35')]({'plain':!![]});return _0xc2aecf['Agents'];});return db[_0x51ce('0x3b')][_0x51ce('0x57')]({'where':{'id':_0x25db62[_0x51ce('0x60')]['id']}})[_0x51ce('0x1d')](function(_0x12c16d){return db['sequelize']['transaction'](function(_0x3202f0){return _0x12c16d['addTeams'](_0x3fe846,{'transaction':_0x3202f0})[_0x51ce('0x1d')](function(){return BPromise['each'](_0x24633b,function(_0x43fb40){return db[_0x51ce('0x63')][_0x51ce('0x77')]({'where':{'UserId':_0x43fb40['id'],'ChatQueueId':_0x25db62[_0x51ce('0x60')]['id']},'transaction':_0x3202f0});});})[_0x51ce('0x1d')](function(){_0x24633b[_0x51ce('0x78')](function(_0x5251ec){socket['emit'](_0x51ce('0x79'),{'UserId':_0x5251ec['id'],'ChatQueueId':_0x12c16d['id']});});});});});}})[_0x51ce('0x1d')](respondWithStatusCode(_0x4378ac,null))[_0x51ce('0x27')](handleError(_0x4378ac,null));};exports[_0x51ce('0x7a')]=function(_0x9db6de,_0x5a18af,_0x2108f9){return db['Team'][_0x51ce('0x53')]({'where':{'id':_0x9db6de[_0x51ce('0x40')][_0x51ce('0x71')]},'attributes':['id'],'include':[{'model':db[_0x51ce('0x65')],'as':_0x51ce('0x72'),'attributes':['id'],'raw':!![]}]})[_0x51ce('0x1d')](handleEntityNotFound(_0x5a18af,null))[_0x51ce('0x1d')](function(_0x35c280){var _0x267f4b=_[_0x51ce('0x4f')](_0x35c280,'id');var _0xe41950=[];var _0x23f79e=[];var _0x492832=squel[_0x51ce('0x7b')]();_0x492832[_0x51ce('0x7c')](_0x51ce('0x7d'))[_0x51ce('0x7e')](_0x51ce('0x7f'),'tq')[_0x51ce('0x80')]('user_has_teams','ut',_0x51ce('0x81'))[_0x51ce('0x4b')]('ChatQueueId\x20=\x20?',_0x9db6de[_0x51ce('0x60')]['id']);for(var _0x511988=0x0;_0x511988<_0x35c280[_0x51ce('0x46')];_0x511988+=0x1){let _0x155b62=_0x35c280[_0x511988];for(var _0x4ae22d=0x0;_0x4ae22d<_0x155b62['Agents'][_0x51ce('0x46')];_0x4ae22d+=0x1){let _0x155908=_0x155b62['Agents'][_0x4ae22d];var _0x536aa3=_0x492832[_0x51ce('0x82')]();_0x536aa3['where'](_0x51ce('0x83'),_0x155908['id']);_0x23f79e[_0x51ce('0x84')](db['sequelize'][_0x51ce('0x40')](_0x536aa3[_0x51ce('0x85')](),{'type':db[_0x51ce('0x86')][_0x51ce('0x87')][_0x51ce('0x88')]})[_0x51ce('0x1d')](function(_0x574d40){if(_0x574d40[_0x51ce('0x46')]===0x1){return _0x155908['id'];}else{var _0x364731=_[_0x51ce('0x89')](_[_0x51ce('0x4f')](_0x574d40,_0x51ce('0x8a')),function(_0x4621cb){return _[_0x51ce('0x8b')](_0x267f4b,_0x4621cb);});if(_0x364731){return _0x155908['id'];}}}));}}return BPromise['all'](_0x23f79e)[_0x51ce('0x1d')](function(_0xa8e76b){_0xe41950=_(_0xe41950)[_0x51ce('0x8c')](_0xa8e76b)[_0x51ce('0x8d')]()[_0x51ce('0x8e')]();return db['ChatQueue'][_0x51ce('0x57')]({'where':{'id':_0x9db6de[_0x51ce('0x60')]['id']}})[_0x51ce('0x1d')](function(_0x54933e){return db[_0x51ce('0x86')][_0x51ce('0x8f')](function(_0x1308be){return _0x54933e[_0x51ce('0x7a')](_0x9db6de[_0x51ce('0x40')][_0x51ce('0x71')],{'transaction':_0x1308be})[_0x51ce('0x1d')](function(){if(!_['isEmpty'](_0xe41950)){return _0x54933e[_0x51ce('0x90')](_0xe41950,{'transaction':_0x1308be});}})[_0x51ce('0x1d')](function(){_0xe41950['forEach'](function(_0x1b8485){socket[_0x51ce('0x91')](_0x51ce('0x92'),{'UserId':_0x1b8485,'ChatQueueId':_0x54933e['id']});});});});});});})['then'](respondWithStatusCode(_0x5a18af,null))[_0x51ce('0x27')](handleError(_0x5a18af,null));};exports[_0x51ce('0x93')]=function(_0x2a14a4,_0xacecc1,_0x259fbd){return db[_0x51ce('0x3b')][_0x51ce('0x57')]({'where':{'id':_0x2a14a4['params']['id']}})[_0x51ce('0x1d')](handleEntityNotFound(_0xacecc1,null))[_0x51ce('0x1d')](function(_0xf6c9f8){if(_0xf6c9f8){return _0xf6c9f8[_0x51ce('0x93')](_0x2a14a4[_0x51ce('0x59')][_0x51ce('0x71')],_[_0x51ce('0x94')](_0x2a14a4[_0x51ce('0x59')],[_0x51ce('0x71'),'id'])||{})[_0x51ce('0x95')](function(_0x131d20){for(var _0x4eff62=0x0;_0x4eff62<_0x2a14a4['body'][_0x51ce('0x71')][_0x51ce('0x46')];_0x4eff62+=0x1){socket['emit'](_0x51ce('0x79'),{'UserId':Number(_0x2a14a4[_0x51ce('0x59')]['ids'][_0x4eff62]),'ChatQueueId':Number(_0x2a14a4[_0x51ce('0x60')]['id'])});}return _0x131d20;});}})[_0x51ce('0x1d')](respondWithResult(_0xacecc1,null))[_0x51ce('0x27')](handleError(_0xacecc1,null));};exports[_0x51ce('0x90')]=function(_0x342e72,_0x143e39,_0x1053b2){return db['ChatQueue']['find']({'where':{'id':_0x342e72[_0x51ce('0x60')]['id']}})[_0x51ce('0x1d')](handleEntityNotFound(_0x143e39,null))[_0x51ce('0x1d')](function(_0x1ed00b){if(_0x1ed00b){return _0x1ed00b[_0x51ce('0x90')](_0x342e72[_0x51ce('0x40')]['ids'])[_0x51ce('0x1d')](function(){if(_[_0x51ce('0x96')](_0x342e72['query'][_0x51ce('0x71')])){for(var _0x2017e4=0x0;_0x2017e4<_0x342e72[_0x51ce('0x40')][_0x51ce('0x71')][_0x51ce('0x46')];_0x2017e4+=0x1){socket[_0x51ce('0x91')]('userChatQueue:remove',{'UserId':Number(_0x342e72['query'][_0x51ce('0x71')][_0x2017e4]),'ChatQueueId':Number(_0x342e72[_0x51ce('0x60')]['id'])});}}else{socket[_0x51ce('0x91')](_0x51ce('0x92'),{'UserId':Number(_0x342e72[_0x51ce('0x40')][_0x51ce('0x71')]),'ChatQueueId':Number(_0x342e72['params']['id'])});}});}})['then'](respondWithStatusCode(_0x143e39,null))[_0x51ce('0x27')](handleError(_0x143e39,null));};exports[_0x51ce('0x97')]=function(_0x22849b,_0x4cab30,_0x4b18cf){var _0x3d6842={};var _0x597967={};var _0x54d965;var _0xf6d566;return db[_0x51ce('0x3b')][_0x51ce('0x62')]({'where':{'id':_0x22849b[_0x51ce('0x60')]['id']}})[_0x51ce('0x1d')](handleEntityNotFound(_0x4cab30,null))[_0x51ce('0x1d')](function(_0x277c74){if(_0x277c74){_0x54d965=_0x277c74;_0x597967[_0x51ce('0x3f')]=_[_0x51ce('0x41')](db[_0x51ce('0x65')][_0x51ce('0x56')]);_0x597967[_0x51ce('0x40')]=_[_0x51ce('0x41')](_0x22849b[_0x51ce('0x40')]);_0x597967[_0x51ce('0x42')]=_[_0x51ce('0x43')](_0x597967[_0x51ce('0x3f')],_0x597967['query']);_0x3d6842['attributes']=_[_0x51ce('0x43')](_0x597967[_0x51ce('0x3f')],qs['fields'](_0x22849b['query']['fields']));_0x3d6842['attributes']=_0x3d6842[_0x51ce('0x44')][_0x51ce('0x46')]?_0x3d6842[_0x51ce('0x44')]:_0x597967['model'];_0x3d6842['order']=qs[_0x51ce('0x4a')](_0x22849b[_0x51ce('0x40')]['sort']);_0x3d6842[_0x51ce('0x4b')]=qs[_0x51ce('0x42')](_[_0x51ce('0x4c')](_0x22849b[_0x51ce('0x40')],_0x597967['filters']));if(_0x22849b[_0x51ce('0x40')][_0x51ce('0x4d')]){_0x3d6842[_0x51ce('0x4b')]=_[_0x51ce('0x4e')](_0x3d6842['where'],{'$or':_[_0x51ce('0x4f')](_0x3d6842[_0x51ce('0x44')],function(_0x8831e1){var _0x12d62a={};_0x12d62a[_0x8831e1]={'$like':'%'+_0x22849b[_0x51ce('0x40')][_0x51ce('0x4d')]+'%'};return _0x12d62a;})});}_0x3d6842=_[_0x51ce('0x4e')]({},_0x3d6842,_0x22849b[_0x51ce('0x51')]);return _0x54d965['getAgents'](_0x3d6842);}})[_0x51ce('0x1d')](function(_0x456e54){if(_0x456e54){_0xf6d566=_0x456e54[_0x51ce('0x46')];if(!_0x22849b[_0x51ce('0x40')][_0x51ce('0x47')](_0x51ce('0x48'))){_0x3d6842[_0x51ce('0x2f')]=qs[_0x51ce('0x2f')](_0x22849b[_0x51ce('0x40')][_0x51ce('0x2f')]);_0x3d6842[_0x51ce('0x2c')]=qs[_0x51ce('0x2c')](_0x22849b['query'][_0x51ce('0x2c')]);}return _0x54d965[_0x51ce('0x97')](_0x3d6842);}})[_0x51ce('0x1d')](function(_0x1f22fb){if(_0x1f22fb){return _0x1f22fb?{'count':_0xf6d566,'rows':_0x1f22fb}:null;}})[_0x51ce('0x1d')](respondWithResult(_0x4cab30,null))[_0x51ce('0x27')](handleError(_0x4cab30,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 9d60a0e..91809f2 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 _0xafa5=['exports','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x10a7b2,_0x37587c){var _0x5cf00e=function(_0x69b0b9){while(--_0x69b0b9){_0x10a7b2['push'](_0x10a7b2['shift']());}};_0x5cf00e(++_0x37587c);}(_0xafa5,0x1af));var _0x5afa=function(_0x25d071,_0x488829){_0x25d071=_0x25d071-0x0;var _0x660c3f=_0xafa5[_0x25d071];return _0x660c3f;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x5afa('0x0'))['db'][_0x5afa('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x5afa('0x2')](0x0);var events={'afterCreate':_0x5afa('0x3'),'afterUpdate':_0x5afa('0x4'),'afterDestroy':_0x5afa('0x5')};function emitEvent(_0x14535b){return function(_0x21b649,_0xac7ca5,_0x1509e4){ChatQueueEvents[_0x5afa('0x6')](_0x14535b+':'+_0x21b649['id'],_0x21b649);ChatQueueEvents['emit'](_0x14535b,_0x21b649);_0x1509e4(null);};}for(var e in events){if(events[_0x5afa('0x7')](e)){var event=events[e];ChatQueue[_0x5afa('0x8')](e,emitEvent(event));}}module[_0x5afa('0x9')]=ChatQueueEvents;
\ No newline at end of file
+var _0xf96e=['hook','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0xba581a,_0x25106a){var _0x263a4f=function(_0x434863){while(--_0x434863){_0xba581a['push'](_0xba581a['shift']());}};_0x263a4f(++_0x25106a);}(_0xf96e,0x196));var _0xef96=function(_0x29f0af,_0x231eda){_0x29f0af=_0x29f0af-0x0;var _0x3d6df2=_0xf96e[_0x29f0af];return _0x3d6df2;};'use strict';var EventEmitter=require(_0xef96('0x0'));var ChatQueue=require(_0xef96('0x1'))['db'][_0xef96('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xef96('0x3')](0x0);var events={'afterCreate':_0xef96('0x4'),'afterUpdate':_0xef96('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2c02b8){return function(_0x5b4bba,_0x366a22,_0x3bec69){ChatQueueEvents[_0xef96('0x6')](_0x2c02b8+':'+_0x5b4bba['id'],_0x5b4bba);ChatQueueEvents['emit'](_0x2c02b8,_0x5b4bba);_0x3bec69(null);};}for(var e in events){if(events[_0xef96('0x7')](e)){var event=events[e];ChatQueue[_0xef96('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index ee09a7f..2383162 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 _0x547e=['define','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatQueue.attributes','exports'];(function(_0x150754,_0x17aa20){var _0x45f993=function(_0x279605){while(--_0x279605){_0x150754['push'](_0x150754['shift']());}};_0x45f993(++_0x17aa20);}(_0x547e,0x6f));var _0xe547=function(_0xafa7c7,_0x3b8fc0){_0xafa7c7=_0xafa7c7-0x0;var _0x4b33ec=_0x547e[_0xafa7c7];return _0x4b33ec;};'use strict';var _=require(_0xe547('0x0'));var util=require(_0xe547('0x1'));var logger=require(_0xe547('0x2'))('api');var moment=require(_0xe547('0x3'));var BPromise=require(_0xe547('0x4'));var rp=require(_0xe547('0x5'));var fs=require('fs');var path=require(_0xe547('0x6'));var rimraf=require(_0xe547('0x7'));var config=require('../../config/environment');var attributes=require(_0xe547('0x8'));module[_0xe547('0x9')]=function(_0x45decc,_0x539a92){return _0x45decc[_0xe547('0xa')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6baa=['./chatQueue.attributes','exports','define','chat_queues','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1f147b,_0x338154){var _0x1ffa15=function(_0x235078){while(--_0x235078){_0x1f147b['push'](_0x1f147b['shift']());}};_0x1ffa15(++_0x338154);}(_0x6baa,0x1c0));var _0xa6ba=function(_0x4ab0b4,_0x4e280e){_0x4ab0b4=_0x4ab0b4-0x0;var _0x1911cc=_0x6baa[_0x4ab0b4];return _0x1911cc;};'use strict';var _=require('lodash');var util=require(_0xa6ba('0x0'));var logger=require(_0xa6ba('0x1'))('api');var moment=require(_0xa6ba('0x2'));var BPromise=require(_0xa6ba('0x3'));var rp=require(_0xa6ba('0x4'));var fs=require('fs');var path=require(_0xa6ba('0x5'));var rimraf=require(_0xa6ba('0x6'));var config=require(_0xa6ba('0x7'));var attributes=require(_0xa6ba('0x8'));module[_0xa6ba('0x9')]=function(_0x1c9b43,_0x439cd8){return _0x1c9b43[_0xa6ba('0xa')]('ChatQueue',attributes,{'tableName':_0xa6ba('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index ded4cc1..b911435 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 _0x061a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','ChatQueue','find','lodash','util'];(function(_0x4a0cdd,_0x4422df){var _0x10fc7d=function(_0x230ae9){while(--_0x230ae9){_0x4a0cdd['push'](_0x4a0cdd['shift']());}};_0x10fc7d(++_0x4422df);}(_0x061a,0x13e));var _0xa061=function(_0x55b368,_0xbf5cad){_0x55b368=_0x55b368-0x0;var _0x17c286=_0x061a[_0x55b368];return _0x17c286;};'use strict';var _=require(_0xa061('0x0'));var util=require(_0xa061('0x1'));var moment=require(_0xa061('0x2'));var BPromise=require(_0xa061('0x3'));var rs=require(_0xa061('0x4'));var fs=require('fs');var Redis=require(_0xa061('0x5'));var db=require(_0xa061('0x6'))['db'];var utils=require(_0xa061('0x7'));var logger=require('../../config/logger')(_0xa061('0x8'));var config=require(_0xa061('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa061('0xa')][_0xa061('0xb')]({'port':0x232a});config[_0xa061('0xc')]=_[_0xa061('0xd')](config[_0xa061('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xa061('0xe'))(new Redis(config[_0xa061('0xc')]));require(_0xa061('0xf'))['register'](socket);function respondWithRpcPromise(_0x55759f,_0x387190,_0x59dc92){return new BPromise(function(_0x1dd546,_0x3c184b){return client[_0xa061('0x10')](_0x55759f,_0x59dc92)[_0xa061('0x11')](function(_0x304495){logger[_0xa061('0x12')](_0xa061('0x13'),_0x387190,_0xa061('0x14'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x387190,_0xa061('0x14'),JSON[_0xa061('0x15')](_0x304495));if(_0x304495[_0xa061('0x16')]){if(_0x304495['error'][_0xa061('0x17')]===0x1f4){logger[_0xa061('0x16')](_0xa061('0x13'),_0x387190,_0x304495[_0xa061('0x16')]['message']);return _0x3c184b(_0x304495[_0xa061('0x16')][_0xa061('0x18')]);}logger[_0xa061('0x16')](_0xa061('0x13'),_0x387190,_0x304495[_0xa061('0x16')]['message']);return _0x1dd546(_0x304495[_0xa061('0x16')][_0xa061('0x18')]);}else{logger['info'](_0xa061('0x13'),_0x387190,'request\x20sent');_0x1dd546(_0x304495[_0xa061('0x19')][_0xa061('0x18')]);}})[_0xa061('0x1a')](function(_0x529af8){logger['error']('ChatQueue,\x20%s,\x20%s',_0x387190,_0x529af8);_0x3c184b(_0x529af8);});});}exports[_0xa061('0x1b')]=function(_0x3162c2){var _0x4960f0=this;return new Promise(function(_0x355c56,_0x301713){return db['ChatQueue'][_0xa061('0x1c')]({'raw':_0x3162c2[_0xa061('0x1d')]?_0x3162c2[_0xa061('0x1d')][_0xa061('0x1e')]===undefined?!![]:![]:!![],'where':_0x3162c2['options']?_0x3162c2[_0xa061('0x1d')][_0xa061('0x1f')]||null:null,'attributes':_0x3162c2['options']?_0x3162c2[_0xa061('0x1d')][_0xa061('0x20')]||null:null,'limit':_0x3162c2['options']?_0x3162c2['options'][_0xa061('0x21')]||null:null,'include':_0x3162c2[_0xa061('0x1d')]?_0x3162c2[_0xa061('0x1d')][_0xa061('0x22')]?_[_0xa061('0x23')](_0x3162c2[_0xa061('0x1d')][_0xa061('0x22')],function(_0x1958c7){return{'model':db[_0x1958c7[_0xa061('0x24')]],'as':_0x1958c7['as'],'attributes':_0x1958c7[_0xa061('0x20')],'include':_0x1958c7[_0xa061('0x22')]?_[_0xa061('0x23')](_0x1958c7['include'],function(_0x4c5aae){return{'model':db[_0x4c5aae[_0xa061('0x24')]],'as':_0x4c5aae['as'],'attributes':_0x4c5aae[_0xa061('0x20')],'include':_0x4c5aae[_0xa061('0x22')]?_['map'](_0x4c5aae[_0xa061('0x22')],function(_0x35776e){return{'model':db[_0x35776e['model']],'as':_0x35776e['as'],'attributes':_0x35776e[_0xa061('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa061('0x11')](function(_0x4cc315){logger[_0xa061('0x12')]('GetChatQueue',_0x3162c2);logger['debug'](_0xa061('0x1b'),_0x3162c2,JSON[_0xa061('0x15')](_0x4cc315));_0x355c56(_0x4cc315);})[_0xa061('0x1a')](function(_0x4d8c4b){logger[_0xa061('0x16')](_0xa061('0x1b'),_0x4d8c4b[_0xa061('0x18')],_0x3162c2);_0x301713(_0x4960f0[_0xa061('0x16')](0x1f4,_0x4d8c4b[_0xa061('0x18')]));});});};exports[_0xa061('0x25')]=function(_0x3a33e3){var _0x183d99=this;return new Promise(function(_0x318485,_0x57543d){return db[_0xa061('0x26')][_0xa061('0x27')]({'raw':_0x3a33e3['options']?_0x3a33e3[_0xa061('0x1d')][_0xa061('0x1e')]===undefined?!![]:![]:!![],'where':_0x3a33e3[_0xa061('0x1d')]?_0x3a33e3[_0xa061('0x1d')][_0xa061('0x1f')]||null:null,'attributes':_0x3a33e3['options']?_0x3a33e3[_0xa061('0x1d')]['attributes']||null:null,'include':_0x3a33e3[_0xa061('0x1d')]?_0x3a33e3['options'][_0xa061('0x22')]?_['map'](_0x3a33e3[_0xa061('0x1d')][_0xa061('0x22')],function(_0x1a568e){return{'model':db[_0x1a568e[_0xa061('0x24')]],'as':_0x1a568e['as'],'attributes':_0x1a568e[_0xa061('0x20')],'include':_0x1a568e['include']?_[_0xa061('0x23')](_0x1a568e['include'],function(_0xbf98ef){return{'model':db[_0xbf98ef[_0xa061('0x24')]],'as':_0xbf98ef['as'],'attributes':_0xbf98ef[_0xa061('0x20')],'include':_0xbf98ef[_0xa061('0x22')]?_[_0xa061('0x23')](_0xbf98ef[_0xa061('0x22')],function(_0x4921e3){return{'model':db[_0x4921e3[_0xa061('0x24')]],'as':_0x4921e3['as'],'attributes':_0x4921e3[_0xa061('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa061('0x11')](function(_0x26e8f8){logger[_0xa061('0x12')](_0xa061('0x25'),_0x3a33e3);logger['debug'](_0xa061('0x25'),_0x3a33e3,JSON['stringify'](_0x26e8f8));_0x318485(_0x26e8f8);})[_0xa061('0x1a')](function(_0x57a195){logger[_0xa061('0x16')](_0xa061('0x25'),_0x57a195[_0xa061('0x18')],_0x3a33e3);_0x57543d(_0x183d99[_0xa061('0x16')](0x1f4,_0x57a195[_0xa061('0x18')]));});});};
\ No newline at end of file
+var _0x4342=['http','redis','defaults','socket.io-emitter','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','GetChatQueue','ShowChatQueue','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x494926,_0x5d3a6b){var _0x4be498=function(_0x5a6c11){while(--_0x5a6c11){_0x494926['push'](_0x494926['shift']());}};_0x4be498(++_0x5d3a6b);}(_0x4342,0xe5));var _0x2434=function(_0x3403d5,_0x3d99fc){_0x3403d5=_0x3403d5-0x0;var _0xf9df4f=_0x4342[_0x3403d5];return _0xf9df4f;};'use strict';var _=require(_0x2434('0x0'));var util=require(_0x2434('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2434('0x2'));var fs=require('fs');var Redis=require(_0x2434('0x3'));var db=require(_0x2434('0x4'))['db'];var utils=require(_0x2434('0x5'));var logger=require(_0x2434('0x6'))(_0x2434('0x7'));var config=require(_0x2434('0x8'));var jayson=require(_0x2434('0x9'));var client=jayson[_0x2434('0xa')][_0x2434('0xb')]({'port':0x232a});config[_0x2434('0xc')]=_[_0x2434('0xd')](config[_0x2434('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x2434('0xe'))(new Redis(config[_0x2434('0xc')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x25396f,_0x43f941,_0x3c7618){return new BPromise(function(_0x581ff2,_0x5923f4){return client[_0x2434('0xf')](_0x25396f,_0x3c7618)[_0x2434('0x10')](function(_0xe59f13){logger[_0x2434('0x11')](_0x2434('0x12'),_0x43f941,_0x2434('0x13'));logger['debug'](_0x2434('0x14'),_0x43f941,'request\x20sent',JSON[_0x2434('0x15')](_0xe59f13));if(_0xe59f13['error']){if(_0xe59f13['error'][_0x2434('0x16')]===0x1f4){logger['error'](_0x2434('0x12'),_0x43f941,_0xe59f13[_0x2434('0x17')][_0x2434('0x18')]);return _0x5923f4(_0xe59f13[_0x2434('0x17')][_0x2434('0x18')]);}logger[_0x2434('0x17')](_0x2434('0x12'),_0x43f941,_0xe59f13[_0x2434('0x17')][_0x2434('0x18')]);return _0x581ff2(_0xe59f13[_0x2434('0x17')]['message']);}else{logger[_0x2434('0x11')](_0x2434('0x12'),_0x43f941,_0x2434('0x13'));_0x581ff2(_0xe59f13['result'][_0x2434('0x18')]);}})[_0x2434('0x19')](function(_0x17db53){logger[_0x2434('0x17')](_0x2434('0x12'),_0x43f941,_0x17db53);_0x5923f4(_0x17db53);});});}exports['GetChatQueue']=function(_0x27478a){var _0x558e0e=this;return new Promise(function(_0x3201d0,_0x5d1c73){return db[_0x2434('0x1a')][_0x2434('0x1b')]({'raw':_0x27478a[_0x2434('0x1c')]?_0x27478a[_0x2434('0x1c')][_0x2434('0x1d')]===undefined?!![]:![]:!![],'where':_0x27478a[_0x2434('0x1c')]?_0x27478a[_0x2434('0x1c')][_0x2434('0x1e')]||null:null,'attributes':_0x27478a['options']?_0x27478a[_0x2434('0x1c')][_0x2434('0x1f')]||null:null,'limit':_0x27478a[_0x2434('0x1c')]?_0x27478a['options'][_0x2434('0x20')]||null:null,'include':_0x27478a[_0x2434('0x1c')]?_0x27478a[_0x2434('0x1c')][_0x2434('0x21')]?_[_0x2434('0x22')](_0x27478a[_0x2434('0x1c')][_0x2434('0x21')],function(_0x460f2e){return{'model':db[_0x460f2e[_0x2434('0x23')]],'as':_0x460f2e['as'],'attributes':_0x460f2e[_0x2434('0x1f')],'include':_0x460f2e['include']?_['map'](_0x460f2e[_0x2434('0x21')],function(_0x1fd483){return{'model':db[_0x1fd483[_0x2434('0x23')]],'as':_0x1fd483['as'],'attributes':_0x1fd483[_0x2434('0x1f')],'include':_0x1fd483[_0x2434('0x21')]?_[_0x2434('0x22')](_0x1fd483[_0x2434('0x21')],function(_0x1e697f){return{'model':db[_0x1e697f[_0x2434('0x23')]],'as':_0x1e697f['as'],'attributes':_0x1e697f[_0x2434('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2434('0x10')](function(_0x3e0ec4){logger['info']('GetChatQueue',_0x27478a);logger[_0x2434('0x24')](_0x2434('0x25'),_0x27478a,JSON[_0x2434('0x15')](_0x3e0ec4));_0x3201d0(_0x3e0ec4);})['catch'](function(_0x371e14){logger[_0x2434('0x17')](_0x2434('0x25'),_0x371e14[_0x2434('0x18')],_0x27478a);_0x5d1c73(_0x558e0e[_0x2434('0x17')](0x1f4,_0x371e14[_0x2434('0x18')]));});});};exports[_0x2434('0x26')]=function(_0x2f2005){var _0x19827d=this;return new Promise(function(_0x493a1c,_0x4851e8){return db['ChatQueue'][_0x2434('0x27')]({'raw':_0x2f2005['options']?_0x2f2005['options'][_0x2434('0x1d')]===undefined?!![]:![]:!![],'where':_0x2f2005[_0x2434('0x1c')]?_0x2f2005[_0x2434('0x1c')]['where']||null:null,'attributes':_0x2f2005[_0x2434('0x1c')]?_0x2f2005['options']['attributes']||null:null,'include':_0x2f2005[_0x2434('0x1c')]?_0x2f2005[_0x2434('0x1c')][_0x2434('0x21')]?_[_0x2434('0x22')](_0x2f2005[_0x2434('0x1c')]['include'],function(_0x42beea){return{'model':db[_0x42beea[_0x2434('0x23')]],'as':_0x42beea['as'],'attributes':_0x42beea[_0x2434('0x1f')],'include':_0x42beea[_0x2434('0x21')]?_[_0x2434('0x22')](_0x42beea['include'],function(_0x37b20b){return{'model':db[_0x37b20b[_0x2434('0x23')]],'as':_0x37b20b['as'],'attributes':_0x37b20b[_0x2434('0x1f')],'include':_0x37b20b[_0x2434('0x21')]?_[_0x2434('0x22')](_0x37b20b[_0x2434('0x21')],function(_0x153ac3){return{'model':db[_0x153ac3[_0x2434('0x23')]],'as':_0x153ac3['as'],'attributes':_0x153ac3[_0x2434('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2434('0x10')](function(_0x69214b){logger[_0x2434('0x11')](_0x2434('0x26'),_0x2f2005);logger[_0x2434('0x24')]('ShowChatQueue',_0x2f2005,JSON['stringify'](_0x69214b));_0x493a1c(_0x69214b);})[_0x2434('0x19')](function(_0x820547){logger['error']('ShowChatQueue',_0x820547[_0x2434('0x18')],_0x2f2005);_0x4851e8(_0x19827d[_0x2434('0x17')](0x1f4,_0x820547[_0x2434('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 7730e2f..0bca192 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 _0x032e=['removeListener','register','length','chatQueue:','./chatQueue.events','remove','update','emit'];(function(_0x43008d,_0xef7ad8){var _0x171310=function(_0x284990){while(--_0x284990){_0x43008d['push'](_0x43008d['shift']());}};_0x171310(++_0xef7ad8);}(_0x032e,0x124));var _0xe032=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x032e[_0x13ea00];return _0x1f7347;};'use strict';var ChatQueueEvents=require(_0xe032('0x0'));var events=['save',_0xe032('0x1'),_0xe032('0x2')];function createListener(_0x5ca562,_0x4afba2){return function(_0x45ab5b){_0x4afba2[_0xe032('0x3')](_0x5ca562,_0x45ab5b);};}function removeListener(_0x2f44f6,_0x1983cc){return function(){ChatQueueEvents[_0xe032('0x4')](_0x2f44f6,_0x1983cc);};}exports[_0xe032('0x5')]=function(_0x2ba8a0){for(var _0x33ad0b=0x0,_0x37432f=events[_0xe032('0x6')];_0x33ad0b<_0x37432f;_0x33ad0b++){var _0x3289b0=events[_0x33ad0b];var _0xd84027=createListener(_0xe032('0x7')+_0x3289b0,_0x2ba8a0);ChatQueueEvents['on'](_0x3289b0,_0xd84027);}};
\ No newline at end of file
+var _0x032e=['removeListener','register','length','chatQueue:','./chatQueue.events','remove','update','emit'];(function(_0x388829,_0xdd81e0){var _0x54962a=function(_0x4bf7ac){while(--_0x4bf7ac){_0x388829['push'](_0x388829['shift']());}};_0x54962a(++_0xdd81e0);}(_0x032e,0x124));var _0xe032=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x032e[_0x1ac595];return _0x455fff;};'use strict';var ChatQueueEvents=require(_0xe032('0x0'));var events=['save',_0xe032('0x1'),_0xe032('0x2')];function createListener(_0x5ca562,_0x4afba2){return function(_0x45ab5b){_0x4afba2[_0xe032('0x3')](_0x5ca562,_0x45ab5b);};}function removeListener(_0x2f44f6,_0x1983cc){return function(){ChatQueueEvents[_0xe032('0x4')](_0x2f44f6,_0x1983cc);};}exports[_0xe032('0x5')]=function(_0x2ba8a0){for(var _0x33ad0b=0x0,_0x37432f=events[_0xe032('0x6')];_0x33ad0b<_0x37432f;_0x33ad0b++){var _0x3289b0=events[_0x33ad0b];var _0xd84027=createListener(_0xe032('0x7')+_0x3289b0,_0x2ba8a0);ChatQueueEvents['on'](_0x3289b0,_0xd84027);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 5f700d2..248fe56 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 _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2c1114,_0x2a5c50){_0x2c1114=_0x2c1114-0x0;var _0x2b877c=_0x5fc3[_0x2c1114];return _0x2b877c;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
+var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x5fc3,0xa8));var _0x35fc=function(_0x28edda,_0xbd447a){_0x28edda=_0x28edda-0x0;var _0x21f4a4=_0x5fc3[_0x28edda];return _0x21f4a4;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 3abc45c..1790780 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 _0xa7eb=['exports','STRING','DATE','moment','sequelize'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0xa7eb,0x1b6));var _0xba7e=function(_0x22d397,_0x4a1911){_0x22d397=_0x22d397-0x0;var _0x162930=_0xa7eb[_0x22d397];return _0x162930;};'use strict';var moment=require(_0xba7e('0x0'));var Sequelize=require(_0xba7e('0x1'));module[_0xba7e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xba7e('0x3')]},'joinAt':{'type':Sequelize[_0xba7e('0x4')]},'leaveAt':{'type':Sequelize[_0xba7e('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xba7e('0x4')]},'reason':{'type':Sequelize[_0xba7e('0x3')]}};
\ No newline at end of file
+var _0xdbcc=['moment','sequelize','exports','DATE'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xdbcc,0xf8));var _0xcdbc=function(_0x5176f6,_0x4343bb){_0x5176f6=_0x5176f6-0x0;var _0x2b1351=_0xdbcc[_0x5176f6];return _0x2b1351;};'use strict';var moment=require(_0xcdbc('0x0'));var Sequelize=require(_0xcdbc('0x1'));module[_0xcdbc('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xcdbc('0x3')]},'leaveAt':{'type':Sequelize[_0xcdbc('0x3')]},'acceptAt':{'type':Sequelize[_0xcdbc('0x3')]},'exitAt':{'type':Sequelize[_0xcdbc('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index afcc398..ca55a6d 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 _0xc599=['catch','show','params','include','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','where','merge','filter','options','includeAll','ChatQueueReport','findAll','rows'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0xc599,0x1b2));var _0x9c59=function(_0x57cc7a,_0x1e738d){_0x57cc7a=_0x57cc7a-0x0;var _0x5d6159=_0xc599[_0x57cc7a];return _0x5d6159;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9c59('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9c59('0x1'));var rp=require(_0x9c59('0x2'));var moment=require(_0x9c59('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9c59('0x4'));var util=require(_0x9c59('0x5'));var path=require(_0x9c59('0x6'));var sox=require(_0x9c59('0x7'));var csv=require(_0x9c59('0x8'));var ejs=require(_0x9c59('0x9'));var fs=require('fs');var fs_extra=require(_0x9c59('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9c59('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9c59('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9c59('0xd'));var Papa=require(_0x9c59('0xe'));var Redis=require(_0x9c59('0xf'));var authService=require(_0x9c59('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c59('0x11'));var logger=require('../../config/logger')(_0x9c59('0x12'));var utils=require('../../config/utils');var config=require(_0x9c59('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9c59('0x14'))['db'];function respondWithStatusCode(_0x2cc4f7,_0x40216c){_0x40216c=_0x40216c||0xcc;return function(_0x5d5320){if(_0x5d5320){return _0x2cc4f7['sendStatus'](_0x40216c);}return _0x2cc4f7['status'](_0x40216c)['end']();};}function respondWithResult(_0x5c43bb,_0x13bc3b){_0x13bc3b=_0x13bc3b||0xc8;return function(_0xdfa957){if(_0xdfa957){return _0x5c43bb[_0x9c59('0x15')](_0x13bc3b)[_0x9c59('0x16')](_0xdfa957);}};}function respondWithFilteredResult(_0x55c8ca,_0x1f376d){return function(_0x4019ae){if(_0x4019ae){var _0x1d07fd=typeof _0x1f376d['offset']==='undefined'&&typeof _0x1f376d['limit']===_0x9c59('0x17');var _0x36983f=_0x4019ae[_0x9c59('0x18')];var _0x19f372=_0x1d07fd?0x0:_0x1f376d[_0x9c59('0x19')];var _0x654819=_0x1d07fd?_0x4019ae[_0x9c59('0x18')]:_0x1f376d[_0x9c59('0x19')]+_0x1f376d['limit'];var _0x4eb316;if(_0x654819>=_0x36983f){_0x654819=_0x36983f;_0x4eb316=0xc8;}else{_0x4eb316=0xce;}_0x55c8ca['status'](_0x4eb316);return _0x55c8ca[_0x9c59('0x1a')](_0x9c59('0x1b'),_0x19f372+'-'+_0x654819+'/'+_0x36983f)[_0x9c59('0x16')](_0x4019ae);}return null;};}function patchUpdates(_0x1925a1){return function(_0x566168){try{jsonpatch[_0x9c59('0x1c')](_0x566168,_0x1925a1,!![]);}catch(_0x523dff){return BPromise[_0x9c59('0x1d')](_0x523dff);}return _0x566168[_0x9c59('0x1e')]();};}function saveUpdates(_0x4dcc88,_0x1854b6){return function(_0x3611ca){if(_0x3611ca){return _0x3611ca[_0x9c59('0x1f')](_0x4dcc88)[_0x9c59('0x20')](function(_0x1e5853){return _0x1e5853;});}return null;};}function removeEntity(_0x58dadf,_0x7ffcdd){return function(_0x2eb93e){if(_0x2eb93e){return _0x2eb93e[_0x9c59('0x21')]()['then'](function(){_0x58dadf[_0x9c59('0x15')](0xcc)[_0x9c59('0x22')]();});}};}function handleEntityNotFound(_0x335e36,_0x20ad5c){return function(_0x4f5542){if(!_0x4f5542){_0x335e36[_0x9c59('0x23')](0x194);}return _0x4f5542;};}function handleError(_0x1960f0,_0x41f81c){_0x41f81c=_0x41f81c||0x1f4;return function(_0x597ffc){logger[_0x9c59('0x24')](_0x597ffc[_0x9c59('0x25')]);if(_0x597ffc[_0x9c59('0x26')]){delete _0x597ffc[_0x9c59('0x26')];}_0x1960f0[_0x9c59('0x15')](_0x41f81c)['send'](_0x597ffc);};}exports[_0x9c59('0x27')]=function(_0x9e8833,_0x4f497d){var _0x5d3856={},_0x28fecc={},_0x34fb33={'count':0x0,'rows':[]};var _0x1fd41f=_[_0x9c59('0x28')](db['ChatQueueReport'][_0x9c59('0x29')],function(_0x25c0ab){return{'name':_0x25c0ab[_0x9c59('0x2a')],'type':_0x25c0ab[_0x9c59('0x2b')]['key']};});_0x28fecc[_0x9c59('0x2c')]=_[_0x9c59('0x28')](_0x1fd41f,_0x9c59('0x26'));_0x28fecc[_0x9c59('0x2d')]=_[_0x9c59('0x2e')](_0x9e8833[_0x9c59('0x2d')]);_0x28fecc[_0x9c59('0x2f')]=_[_0x9c59('0x30')](_0x28fecc[_0x9c59('0x2c')],_0x28fecc[_0x9c59('0x2d')]);_0x5d3856[_0x9c59('0x31')]=_[_0x9c59('0x30')](_0x28fecc[_0x9c59('0x2c')],qs['fields'](_0x9e8833[_0x9c59('0x2d')][_0x9c59('0x32')]));_0x5d3856['attributes']=_0x5d3856['attributes'][_0x9c59('0x33')]?_0x5d3856[_0x9c59('0x31')]:_0x28fecc[_0x9c59('0x2c')];if(!_0x9e8833[_0x9c59('0x2d')]['hasOwnProperty'](_0x9c59('0x34'))){_0x5d3856[_0x9c59('0x35')]=qs['limit'](_0x9e8833[_0x9c59('0x2d')][_0x9c59('0x35')]);_0x5d3856['offset']=qs[_0x9c59('0x19')](_0x9e8833['query'][_0x9c59('0x19')]);}_0x5d3856[_0x9c59('0x36')]=qs['sort'](_0x9e8833[_0x9c59('0x2d')]['sort']);_0x5d3856['where']=qs[_0x9c59('0x2f')](_['pick'](_0x9e8833[_0x9c59('0x2d')],_0x28fecc['filters']),_0x1fd41f);if(_0x9e8833['query']['filter']){_0x5d3856[_0x9c59('0x37')]=_[_0x9c59('0x38')](_0x5d3856[_0x9c59('0x37')],{'$or':_[_0x9c59('0x28')](_0x1fd41f,function(_0x282ce8){if(_0x282ce8[_0x9c59('0x2b')]!=='VIRTUAL'){var _0xeb9134={};_0xeb9134[_0x282ce8['name']]={'$like':'%'+_0x9e8833[_0x9c59('0x2d')][_0x9c59('0x39')]+'%'};return _0xeb9134;}})});}_0x5d3856=_[_0x9c59('0x38')]({},_0x5d3856,_0x9e8833[_0x9c59('0x3a')]);var _0x2bab4f={'where':_0x5d3856[_0x9c59('0x37')]};return db['ChatQueueReport'][_0x9c59('0x18')](_0x2bab4f)[_0x9c59('0x20')](function(_0x224fa4){_0x34fb33[_0x9c59('0x18')]=_0x224fa4;if(_0x9e8833[_0x9c59('0x2d')][_0x9c59('0x3b')]){_0x5d3856['include']=[{'all':!![]}];}return db[_0x9c59('0x3c')][_0x9c59('0x3d')](_0x5d3856);})[_0x9c59('0x20')](function(_0x5b8ea2){_0x34fb33[_0x9c59('0x3e')]=_0x5b8ea2;return _0x34fb33;})[_0x9c59('0x20')](respondWithFilteredResult(_0x4f497d,_0x5d3856))[_0x9c59('0x3f')](handleError(_0x4f497d,null));};exports[_0x9c59('0x40')]=function(_0x58dded,_0x3aafc9){var _0x28ab6a={'raw':!![],'where':{'id':_0x58dded[_0x9c59('0x41')]['id']}},_0x767e10={};_0x767e10[_0x9c59('0x2c')]=_[_0x9c59('0x2e')](db['ChatQueueReport']['rawAttributes']);_0x767e10['query']=_['keys'](_0x58dded[_0x9c59('0x2d')]);_0x767e10[_0x9c59('0x2f')]=_[_0x9c59('0x30')](_0x767e10[_0x9c59('0x2c')],_0x767e10[_0x9c59('0x2d')]);_0x28ab6a['attributes']=_['intersection'](_0x767e10[_0x9c59('0x2c')],qs[_0x9c59('0x32')](_0x58dded[_0x9c59('0x2d')][_0x9c59('0x32')]));_0x28ab6a[_0x9c59('0x31')]=_0x28ab6a[_0x9c59('0x31')][_0x9c59('0x33')]?_0x28ab6a[_0x9c59('0x31')]:_0x767e10[_0x9c59('0x2c')];if(_0x58dded[_0x9c59('0x2d')][_0x9c59('0x3b')]){_0x28ab6a[_0x9c59('0x42')]=[{'all':!![]}];}_0x28ab6a=_['merge']({},_0x28ab6a,_0x58dded[_0x9c59('0x3a')]);return db[_0x9c59('0x3c')]['find'](_0x28ab6a)[_0x9c59('0x20')](handleEntityNotFound(_0x3aafc9,null))[_0x9c59('0x20')](respondWithResult(_0x3aafc9,null))[_0x9c59('0x3f')](handleError(_0x3aafc9,null));};exports[_0x9c59('0x43')]=function(_0x170304,_0x145363){return db[_0x9c59('0x3c')][_0x9c59('0x43')](_0x170304['body'],{})[_0x9c59('0x20')](respondWithResult(_0x145363,0xc9))['catch'](handleError(_0x145363,null));};exports[_0x9c59('0x1f')]=function(_0x1668b0,_0x33556c){if(_0x1668b0[_0x9c59('0x44')]['id']){delete _0x1668b0[_0x9c59('0x44')]['id'];}return db[_0x9c59('0x3c')][_0x9c59('0x45')]({'where':{'id':_0x1668b0[_0x9c59('0x41')]['id']}})['then'](handleEntityNotFound(_0x33556c,null))[_0x9c59('0x20')](saveUpdates(_0x1668b0[_0x9c59('0x44')],null))[_0x9c59('0x20')](respondWithResult(_0x33556c,null))[_0x9c59('0x3f')](handleError(_0x33556c,null));};exports[_0x9c59('0x21')]=function(_0xb3bd70,_0x30649a){return db[_0x9c59('0x3c')][_0x9c59('0x45')]({'where':{'id':_0xb3bd70['params']['id']}})[_0x9c59('0x20')](handleEntityNotFound(_0x30649a,null))[_0x9c59('0x20')](removeEntity(_0x30649a,null))[_0x9c59('0x3f')](handleError(_0x30649a,null));};exports[_0x9c59('0x46')]=function(_0x5b5bb9,_0xff3ef2){return db[_0x9c59('0x3c')]['describe']()[_0x9c59('0x20')](respondWithResult(_0xff3ef2,null))['catch'](handleError(_0xff3ef2,null));};
\ No newline at end of file
+var _0x9b0d=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatQueueReport','includeAll','findAll','rows','show','params','include','catch','create','body','update','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','rawAttributes','type','key','query','keys','filters','intersection','model'];(function(_0x54a214,_0x287d40){var _0x1cd25f=function(_0x565ece){while(--_0x565ece){_0x54a214['push'](_0x54a214['shift']());}};_0x1cd25f(++_0x287d40);}(_0x9b0d,0xb7));var _0xd9b0=function(_0x41e28c,_0x3c0b){_0x41e28c=_0x41e28c-0x0;var _0x1a7ac4=_0x9b0d[_0x41e28c];return _0x1a7ac4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd9b0('0x0'));var zipdir=require(_0xd9b0('0x1'));var jsonpatch=require(_0xd9b0('0x2'));var rp=require(_0xd9b0('0x3'));var moment=require('moment');var BPromise=require(_0xd9b0('0x4'));var Mustache=require(_0xd9b0('0x5'));var util=require(_0xd9b0('0x6'));var path=require(_0xd9b0('0x7'));var sox=require('sox');var csv=require(_0xd9b0('0x8'));var ejs=require(_0xd9b0('0x9'));var fs=require('fs');var fs_extra=require(_0xd9b0('0xa'));var _=require(_0xd9b0('0xb'));var squel=require(_0xd9b0('0xc'));var crypto=require(_0xd9b0('0xd'));var jsforce=require(_0xd9b0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd9b0('0x8'));var querystring=require(_0xd9b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xd9b0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd9b0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd9b0('0x12'));var logger=require(_0xd9b0('0x13'))(_0xd9b0('0x14'));var utils=require(_0xd9b0('0x15'));var config=require(_0xd9b0('0x16'));var licenseUtil=require(_0xd9b0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29e9e0,_0x76bb6e){_0x76bb6e=_0x76bb6e||0xcc;return function(_0x4e0210){if(_0x4e0210){return _0x29e9e0[_0xd9b0('0x18')](_0x76bb6e);}return _0x29e9e0[_0xd9b0('0x19')](_0x76bb6e)[_0xd9b0('0x1a')]();};}function respondWithResult(_0x46321d,_0x2a15b1){_0x2a15b1=_0x2a15b1||0xc8;return function(_0x13a800){if(_0x13a800){return _0x46321d['status'](_0x2a15b1)[_0xd9b0('0x1b')](_0x13a800);}};}function respondWithFilteredResult(_0x579aa7,_0x2908a1){return function(_0x288dd4){if(_0x288dd4){var _0x141fea=typeof _0x2908a1[_0xd9b0('0x1c')]===_0xd9b0('0x1d')&&typeof _0x2908a1[_0xd9b0('0x1e')]===_0xd9b0('0x1d');var _0x584d2d=_0x288dd4[_0xd9b0('0x1f')];var _0x3ffdc8=_0x141fea?0x0:_0x2908a1[_0xd9b0('0x1c')];var _0x1b9b8f=_0x141fea?_0x288dd4[_0xd9b0('0x1f')]:_0x2908a1[_0xd9b0('0x1c')]+_0x2908a1[_0xd9b0('0x1e')];var _0x485cdf;if(_0x1b9b8f>=_0x584d2d){_0x1b9b8f=_0x584d2d;_0x485cdf=0xc8;}else{_0x485cdf=0xce;}_0x579aa7[_0xd9b0('0x19')](_0x485cdf);return _0x579aa7['set'](_0xd9b0('0x20'),_0x3ffdc8+'-'+_0x1b9b8f+'/'+_0x584d2d)['json'](_0x288dd4);}return null;};}function patchUpdates(_0x225823){return function(_0x77c318){try{jsonpatch[_0xd9b0('0x21')](_0x77c318,_0x225823,!![]);}catch(_0x3df41b){return BPromise[_0xd9b0('0x22')](_0x3df41b);}return _0x77c318[_0xd9b0('0x23')]();};}function saveUpdates(_0x549cfe,_0x5ecfe7){return function(_0x132710){if(_0x132710){return _0x132710['update'](_0x549cfe)[_0xd9b0('0x24')](function(_0x283da7){return _0x283da7;});}return null;};}function removeEntity(_0x11c443,_0x5a1f95){return function(_0x222229){if(_0x222229){return _0x222229['destroy']()['then'](function(){_0x11c443[_0xd9b0('0x19')](0xcc)[_0xd9b0('0x1a')]();});}};}function handleEntityNotFound(_0x5569c3,_0x3d90f0){return function(_0x4b9935){if(!_0x4b9935){_0x5569c3[_0xd9b0('0x18')](0x194);}return _0x4b9935;};}function handleError(_0xf06e12,_0x1c7ece){_0x1c7ece=_0x1c7ece||0x1f4;return function(_0xe07b77){logger[_0xd9b0('0x25')](_0xe07b77[_0xd9b0('0x26')]);if(_0xe07b77[_0xd9b0('0x27')]){delete _0xe07b77[_0xd9b0('0x27')];}_0xf06e12[_0xd9b0('0x19')](_0x1c7ece)[_0xd9b0('0x28')](_0xe07b77);};}exports[_0xd9b0('0x29')]=function(_0x233aae,_0x160c43){var _0x8be573={},_0x16cd85={},_0x23b2d8={'count':0x0,'rows':[]};var _0x4f5cdc=_[_0xd9b0('0x2a')](db['ChatQueueReport'][_0xd9b0('0x2b')],function(_0x1f8bc8){return{'name':_0x1f8bc8['fieldName'],'type':_0x1f8bc8[_0xd9b0('0x2c')][_0xd9b0('0x2d')]};});_0x16cd85['model']=_[_0xd9b0('0x2a')](_0x4f5cdc,_0xd9b0('0x27'));_0x16cd85[_0xd9b0('0x2e')]=_[_0xd9b0('0x2f')](_0x233aae[_0xd9b0('0x2e')]);_0x16cd85[_0xd9b0('0x30')]=_[_0xd9b0('0x31')](_0x16cd85[_0xd9b0('0x32')],_0x16cd85['query']);_0x8be573[_0xd9b0('0x33')]=_[_0xd9b0('0x31')](_0x16cd85[_0xd9b0('0x32')],qs[_0xd9b0('0x34')](_0x233aae['query']['fields']));_0x8be573[_0xd9b0('0x33')]=_0x8be573['attributes'][_0xd9b0('0x35')]?_0x8be573[_0xd9b0('0x33')]:_0x16cd85['model'];if(!_0x233aae['query'][_0xd9b0('0x36')](_0xd9b0('0x37'))){_0x8be573[_0xd9b0('0x1e')]=qs[_0xd9b0('0x1e')](_0x233aae[_0xd9b0('0x2e')][_0xd9b0('0x1e')]);_0x8be573[_0xd9b0('0x1c')]=qs[_0xd9b0('0x1c')](_0x233aae['query'][_0xd9b0('0x1c')]);}_0x8be573[_0xd9b0('0x38')]=qs[_0xd9b0('0x39')](_0x233aae[_0xd9b0('0x2e')][_0xd9b0('0x39')]);_0x8be573[_0xd9b0('0x3a')]=qs[_0xd9b0('0x30')](_[_0xd9b0('0x3b')](_0x233aae[_0xd9b0('0x2e')],_0x16cd85[_0xd9b0('0x30')]),_0x4f5cdc);if(_0x233aae[_0xd9b0('0x2e')][_0xd9b0('0x3c')]){_0x8be573[_0xd9b0('0x3a')]=_[_0xd9b0('0x3d')](_0x8be573[_0xd9b0('0x3a')],{'$or':_[_0xd9b0('0x2a')](_0x4f5cdc,function(_0x1d04de){if(_0x1d04de[_0xd9b0('0x2c')]!==_0xd9b0('0x3e')){var _0x18dc45={};_0x18dc45[_0x1d04de['name']]={'$like':'%'+_0x233aae['query'][_0xd9b0('0x3c')]+'%'};return _0x18dc45;}})});}_0x8be573=_['merge']({},_0x8be573,_0x233aae[_0xd9b0('0x3f')]);var _0x353fd7={'where':_0x8be573[_0xd9b0('0x3a')]};return db[_0xd9b0('0x40')][_0xd9b0('0x1f')](_0x353fd7)[_0xd9b0('0x24')](function(_0x359b3e){_0x23b2d8[_0xd9b0('0x1f')]=_0x359b3e;if(_0x233aae[_0xd9b0('0x2e')][_0xd9b0('0x41')]){_0x8be573['include']=[{'all':!![]}];}return db[_0xd9b0('0x40')][_0xd9b0('0x42')](_0x8be573);})['then'](function(_0x1f5333){_0x23b2d8[_0xd9b0('0x43')]=_0x1f5333;return _0x23b2d8;})[_0xd9b0('0x24')](respondWithFilteredResult(_0x160c43,_0x8be573))['catch'](handleError(_0x160c43,null));};exports[_0xd9b0('0x44')]=function(_0x225800,_0x418113){var _0x3a09aa={'raw':!![],'where':{'id':_0x225800[_0xd9b0('0x45')]['id']}},_0x285ca9={};_0x285ca9[_0xd9b0('0x32')]=_[_0xd9b0('0x2f')](db[_0xd9b0('0x40')][_0xd9b0('0x2b')]);_0x285ca9[_0xd9b0('0x2e')]=_[_0xd9b0('0x2f')](_0x225800[_0xd9b0('0x2e')]);_0x285ca9[_0xd9b0('0x30')]=_[_0xd9b0('0x31')](_0x285ca9[_0xd9b0('0x32')],_0x285ca9[_0xd9b0('0x2e')]);_0x3a09aa[_0xd9b0('0x33')]=_['intersection'](_0x285ca9[_0xd9b0('0x32')],qs[_0xd9b0('0x34')](_0x225800['query'][_0xd9b0('0x34')]));_0x3a09aa[_0xd9b0('0x33')]=_0x3a09aa[_0xd9b0('0x33')]['length']?_0x3a09aa['attributes']:_0x285ca9[_0xd9b0('0x32')];if(_0x225800[_0xd9b0('0x2e')][_0xd9b0('0x41')]){_0x3a09aa[_0xd9b0('0x46')]=[{'all':!![]}];}_0x3a09aa=_[_0xd9b0('0x3d')]({},_0x3a09aa,_0x225800[_0xd9b0('0x3f')]);return db[_0xd9b0('0x40')]['find'](_0x3a09aa)[_0xd9b0('0x24')](handleEntityNotFound(_0x418113,null))['then'](respondWithResult(_0x418113,null))[_0xd9b0('0x47')](handleError(_0x418113,null));};exports[_0xd9b0('0x48')]=function(_0xd11f53,_0x32857f){return db[_0xd9b0('0x40')][_0xd9b0('0x48')](_0xd11f53[_0xd9b0('0x49')],{})[_0xd9b0('0x24')](respondWithResult(_0x32857f,0xc9))['catch'](handleError(_0x32857f,null));};exports[_0xd9b0('0x4a')]=function(_0x982ccd,_0x2618a0){if(_0x982ccd[_0xd9b0('0x49')]['id']){delete _0x982ccd[_0xd9b0('0x49')]['id'];}return db[_0xd9b0('0x40')][_0xd9b0('0x4b')]({'where':{'id':_0x982ccd[_0xd9b0('0x45')]['id']}})[_0xd9b0('0x24')](handleEntityNotFound(_0x2618a0,null))[_0xd9b0('0x24')](saveUpdates(_0x982ccd[_0xd9b0('0x49')],null))[_0xd9b0('0x24')](respondWithResult(_0x2618a0,null))[_0xd9b0('0x47')](handleError(_0x2618a0,null));};exports[_0xd9b0('0x4c')]=function(_0x39ca70,_0x795b17){return db['ChatQueueReport'][_0xd9b0('0x4b')]({'where':{'id':_0x39ca70[_0xd9b0('0x45')]['id']}})[_0xd9b0('0x24')](handleEntityNotFound(_0x795b17,null))[_0xd9b0('0x24')](removeEntity(_0x795b17,null))[_0xd9b0('0x47')](handleError(_0x795b17,null));};exports[_0xd9b0('0x4d')]=function(_0x547321,_0x33c9a6){return db[_0xd9b0('0x40')]['describe']()['then'](respondWithResult(_0x33c9a6,null))[_0xd9b0('0x47')](handleError(_0x33c9a6,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 1f6914b..c6909e1 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x5e16aa,_0x101c52){var _0x399629=function(_0x997fa2){while(--_0x997fa2){_0x5e16aa['push'](_0x5e16aa['shift']());}};_0x399629(++_0x101c52);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xb7e7[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x81214,_0x5734ac){var _0x57c5cd=function(_0xf55199){while(--_0xf55199){_0x81214['push'](_0x81214['shift']());}};_0x57c5cd(++_0x5734ac);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 504f749..7e3ad60 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 _0xd90c=['options','raw','CreateChatQueueReport','UpdateChatQueueReport','update','where','attributes','limit','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','info','result','catch','ChatQueueReport','body'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xd90c,0x194));var _0xcd90=function(_0x3d8dd8,_0x4dee79){_0x3d8dd8=_0x3d8dd8-0x0;var _0x1955ad=_0xd90c[_0x3d8dd8];return _0x1955ad;};'use strict';var _=require('lodash');var util=require(_0xcd90('0x0'));var moment=require(_0xcd90('0x1'));var BPromise=require('bluebird');var rs=require(_0xcd90('0x2'));var fs=require('fs');var Redis=require(_0xcd90('0x3'));var db=require(_0xcd90('0x4'))['db'];var utils=require(_0xcd90('0x5'));var logger=require(_0xcd90('0x6'))('rpc');var config=require(_0xcd90('0x7'));var jayson=require(_0xcd90('0x8'));var client=jayson['client'][_0xcd90('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a70f3,_0x167350,_0x435116){return new BPromise(function(_0x468f67,_0x9787b1){return client[_0xcd90('0xa')](_0x4a70f3,_0x435116)[_0xcd90('0xb')](function(_0xe9d87f){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x167350,'request\x20sent');logger[_0xcd90('0xc')](_0xcd90('0xd'),_0x167350,_0xcd90('0xe'),JSON[_0xcd90('0xf')](_0xe9d87f));if(_0xe9d87f[_0xcd90('0x10')]){if(_0xe9d87f[_0xcd90('0x10')][_0xcd90('0x11')]===0x1f4){logger[_0xcd90('0x10')](_0xcd90('0x12'),_0x167350,_0xe9d87f['error']['message']);return _0x9787b1(_0xe9d87f['error'][_0xcd90('0x13')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x167350,_0xe9d87f['error']['message']);return _0x468f67(_0xe9d87f['error'][_0xcd90('0x13')]);}else{logger[_0xcd90('0x14')](_0xcd90('0x12'),_0x167350,'request\x20sent');_0x468f67(_0xe9d87f[_0xcd90('0x15')]['message']);}})[_0xcd90('0x16')](function(_0x41eb25){logger[_0xcd90('0x10')](_0xcd90('0x12'),_0x167350,_0x41eb25);_0x9787b1(_0x41eb25);});});}exports['CreateChatQueueReport']=function(_0x2c3195){var _0x43d90a=this;return new Promise(function(_0x1212dc,_0x1f46a4){return db[_0xcd90('0x17')]['create'](_0x2c3195[_0xcd90('0x18')],{'raw':_0x2c3195['options']?_0x2c3195[_0xcd90('0x19')][_0xcd90('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x4b7bdf){logger[_0xcd90('0x14')](_0xcd90('0x1b'),_0x2c3195);logger[_0xcd90('0xc')]('CreateChatQueueReport',_0x2c3195,JSON[_0xcd90('0xf')](_0x4b7bdf));_0x1212dc(_0x4b7bdf);})[_0xcd90('0x16')](function(_0x383a50){logger[_0xcd90('0x10')](_0xcd90('0x1b'),_0x383a50[_0xcd90('0x13')],_0x2c3195);_0x1f46a4(_0x43d90a[_0xcd90('0x10')](0x1f4,_0x383a50['message']));});});};exports[_0xcd90('0x1c')]=function(_0x2a438b){var _0x5ed642=this;return new Promise(function(_0x5dae8e,_0xef8da){return db['ChatQueueReport'][_0xcd90('0x1d')](_0x2a438b[_0xcd90('0x18')],{'raw':_0x2a438b[_0xcd90('0x19')]?_0x2a438b[_0xcd90('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a438b['options']?_0x2a438b[_0xcd90('0x19')][_0xcd90('0x1e')]||null:null,'attributes':_0x2a438b[_0xcd90('0x19')]?_0x2a438b[_0xcd90('0x19')][_0xcd90('0x1f')]||null:null,'limit':_0x2a438b[_0xcd90('0x19')]?_0x2a438b['options'][_0xcd90('0x20')]||null:null})['then'](function(_0x9133bf){logger[_0xcd90('0x14')](_0xcd90('0x1c'),_0x2a438b);logger[_0xcd90('0xc')](_0xcd90('0x1c'),_0x2a438b,JSON['stringify'](_0x9133bf));_0x5dae8e(_0x9133bf);})[_0xcd90('0x16')](function(_0x325022){logger[_0xcd90('0x10')](_0xcd90('0x1c'),_0x325022[_0xcd90('0x13')],_0x2a438b);_0xef8da(_0x5ed642[_0xcd90('0x10')](0x1f4,_0x325022[_0xcd90('0x13')]));});});};
\ No newline at end of file
+var _0x9c7c=['body','options','raw','debug','UpdateChatQueueReport','update','limit','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatQueueReport,\x20%s,\x20%s','result','CreateChatQueueReport','ChatQueueReport','create'];(function(_0x1f745c,_0x5be6ea){var _0x5bc387=function(_0x5be6b2){while(--_0x5be6b2){_0x1f745c['push'](_0x1f745c['shift']());}};_0x5bc387(++_0x5be6ea);}(_0x9c7c,0x84));var _0xc9c7=function(_0x3ccf78,_0x132099){_0x3ccf78=_0x3ccf78-0x0;var _0x634386=_0x9c7c[_0x3ccf78];return _0x634386;};'use strict';var _=require(_0xc9c7('0x0'));var util=require(_0xc9c7('0x1'));var moment=require(_0xc9c7('0x2'));var BPromise=require('bluebird');var rs=require(_0xc9c7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc9c7('0x4'))['db'];var utils=require(_0xc9c7('0x5'));var logger=require(_0xc9c7('0x6'))(_0xc9c7('0x7'));var config=require('../../config/environment');var jayson=require(_0xc9c7('0x8'));var client=jayson['client'][_0xc9c7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e7395,_0x2b251f,_0x569b6f){return new BPromise(function(_0x50b8db,_0x4e649f){return client['request'](_0x2e7395,_0x569b6f)[_0xc9c7('0xa')](function(_0x43495d){logger[_0xc9c7('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x2b251f,_0xc9c7('0xc'));logger['debug'](_0xc9c7('0xd'),_0x2b251f,_0xc9c7('0xc'),JSON[_0xc9c7('0xe')](_0x43495d));if(_0x43495d[_0xc9c7('0xf')]){if(_0x43495d[_0xc9c7('0xf')][_0xc9c7('0x10')]===0x1f4){logger[_0xc9c7('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x2b251f,_0x43495d[_0xc9c7('0xf')][_0xc9c7('0x11')]);return _0x4e649f(_0x43495d['error'][_0xc9c7('0x11')]);}logger['error'](_0xc9c7('0x12'),_0x2b251f,_0x43495d[_0xc9c7('0xf')][_0xc9c7('0x11')]);return _0x50b8db(_0x43495d[_0xc9c7('0xf')][_0xc9c7('0x11')]);}else{logger[_0xc9c7('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x2b251f,'request\x20sent');_0x50b8db(_0x43495d[_0xc9c7('0x13')][_0xc9c7('0x11')]);}})['catch'](function(_0x25e569){logger[_0xc9c7('0xf')](_0xc9c7('0x12'),_0x2b251f,_0x25e569);_0x4e649f(_0x25e569);});});}exports[_0xc9c7('0x14')]=function(_0x3e1966){var _0x1b24fd=this;return new Promise(function(_0x526965,_0x37c080){return db[_0xc9c7('0x15')][_0xc9c7('0x16')](_0x3e1966[_0xc9c7('0x17')],{'raw':_0x3e1966[_0xc9c7('0x18')]?_0x3e1966[_0xc9c7('0x18')][_0xc9c7('0x19')]===undefined?!![]:![]:!![]})[_0xc9c7('0xa')](function(_0x92912e){logger[_0xc9c7('0xb')](_0xc9c7('0x14'),_0x3e1966);logger[_0xc9c7('0x1a')](_0xc9c7('0x14'),_0x3e1966,JSON[_0xc9c7('0xe')](_0x92912e));_0x526965(_0x92912e);})['catch'](function(_0x50d5a0){logger['error'](_0xc9c7('0x14'),_0x50d5a0[_0xc9c7('0x11')],_0x3e1966);_0x37c080(_0x1b24fd['error'](0x1f4,_0x50d5a0['message']));});});};exports[_0xc9c7('0x1b')]=function(_0x53659c){var _0x20933c=this;return new Promise(function(_0x479714,_0x1c01ef){return db[_0xc9c7('0x15')][_0xc9c7('0x1c')](_0x53659c[_0xc9c7('0x17')],{'raw':_0x53659c[_0xc9c7('0x18')]?_0x53659c[_0xc9c7('0x18')][_0xc9c7('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53659c[_0xc9c7('0x18')]?_0x53659c[_0xc9c7('0x18')]['where']||null:null,'attributes':_0x53659c[_0xc9c7('0x18')]?_0x53659c['options']['attributes']||null:null,'limit':_0x53659c[_0xc9c7('0x18')]?_0x53659c['options'][_0xc9c7('0x1d')]||null:null})[_0xc9c7('0xa')](function(_0x5a6335){logger[_0xc9c7('0xb')](_0xc9c7('0x1b'),_0x53659c);logger['debug'](_0xc9c7('0x1b'),_0x53659c,JSON[_0xc9c7('0xe')](_0x5a6335));_0x479714(_0x5a6335);})[_0xc9c7('0x1e')](function(_0x2a8354){logger[_0xc9c7('0xf')](_0xc9c7('0x1b'),_0x2a8354[_0xc9c7('0x11')],_0x53659c);_0x1c01ef(_0x20933c[_0xc9c7('0xf')](0x1f4,_0x2a8354[_0xc9c7('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 02c934e..41de809 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 _0xe2a5=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','post','create'];(function(_0x450f8f,_0x466054){var _0x1d37d7=function(_0x4394ae){while(--_0x4394ae){_0x450f8f['push'](_0x450f8f['shift']());}};_0x1d37d7(++_0x466054);}(_0xe2a5,0x1bd));var _0x5e2a=function(_0x2625d0,_0x3820ba){_0x2625d0=_0x2625d0-0x0;var _0x15ebea=_0xe2a5[_0x2625d0];return _0x15ebea;};'use strict';var multer=require(_0x5e2a('0x0'));var util=require(_0x5e2a('0x1'));var path=require(_0x5e2a('0x2'));var timeout=require(_0x5e2a('0x3'));var express=require(_0x5e2a('0x4'));var router=express[_0x5e2a('0x5')]();var fs_extra=require(_0x5e2a('0x6'));var auth=require(_0x5e2a('0x7'));var interaction=require(_0x5e2a('0x8'));var config=require(_0x5e2a('0x9'));var controller=require('./chatQueueReport.controller');router[_0x5e2a('0xa')]('/',auth[_0x5e2a('0xb')](),controller['index']);router[_0x5e2a('0xa')](_0x5e2a('0xc'),auth[_0x5e2a('0xb')](),controller['describe']);router[_0x5e2a('0xa')](_0x5e2a('0xd'),auth[_0x5e2a('0xb')](),controller[_0x5e2a('0xe')]);router[_0x5e2a('0xf')]('/',auth['isAuthenticated'](),controller[_0x5e2a('0x10')]);router[_0x5e2a('0x11')](_0x5e2a('0xd'),auth[_0x5e2a('0xb')](),controller[_0x5e2a('0x12')]);router[_0x5e2a('0x13')](_0x5e2a('0xd'),auth[_0x5e2a('0xb')](),controller[_0x5e2a('0x14')]);module[_0x5e2a('0x15')]=router;
\ No newline at end of file
+var _0x344e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show','create','put','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2e1cf1,_0x2a4a0a){var _0x2e6c67=function(_0x3df3dc){while(--_0x3df3dc){_0x2e1cf1['push'](_0x2e1cf1['shift']());}};_0x2e6c67(++_0x2a4a0a);}(_0x344e,0x13c));var _0xe344=function(_0x7ab55c,_0x236bde){_0x7ab55c=_0x7ab55c-0x0;var _0xa58648=_0x344e[_0x7ab55c];return _0xa58648;};'use strict';var multer=require(_0xe344('0x0'));var util=require(_0xe344('0x1'));var path=require(_0xe344('0x2'));var timeout=require(_0xe344('0x3'));var express=require('express');var router=express[_0xe344('0x4')]();var fs_extra=require(_0xe344('0x5'));var auth=require(_0xe344('0x6'));var interaction=require(_0xe344('0x7'));var config=require(_0xe344('0x8'));var controller=require(_0xe344('0x9'));router['get']('/',auth[_0xe344('0xa')](),controller[_0xe344('0xb')]);router[_0xe344('0xc')](_0xe344('0xd'),auth[_0xe344('0xa')](),controller['describe']);router[_0xe344('0xc')](_0xe344('0xe'),auth[_0xe344('0xa')](),controller[_0xe344('0xf')]);router['post']('/',auth[_0xe344('0xa')](),controller[_0xe344('0x10')]);router[_0xe344('0x11')](_0xe344('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe344('0xe'),auth[_0xe344('0xa')](),controller[_0xe344('0x12')]);module[_0xe344('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 2b26234..ec3d3a9 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x26e901,_0x369d87){var _0x5b2032=function(_0x2036b0){while(--_0x2036b0){_0x26e901['push'](_0x26e901['shift']());}};_0x5b2032(++_0x369d87);}(_0xedd9,0xfc));var _0x9edd=function(_0x218454,_0x403302){_0x218454=_0x218454-0x0;var _0x177534=_0xedd9[_0x218454];return _0x177534;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
+var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x447256,_0x42bc97){var _0x43c91a=function(_0x48ffc5){while(--_0x48ffc5){_0x447256['push'](_0x447256['shift']());}};_0x43c91a(++_0x42bc97);}(_0xedd9,0xfc));var _0x9edd=function(_0x455502,_0x6451e9){_0x455502=_0x455502-0x0;var _0x4053eb=_0xedd9[_0x455502];return _0x4053eb;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 8860403..fe02b3a 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 _0xce38=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','ChatTransferReport','includeAll','include','findAll','catch','params','keys','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','querystring'];(function(_0x4cc13,_0x40f7a6){var _0x801be7=function(_0x103cda){while(--_0x103cda){_0x4cc13['push'](_0x4cc13['shift']());}};_0x801be7(++_0x40f7a6);}(_0xce38,0x8d));var _0x8ce3=function(_0xf0e391,_0x5433d4){_0xf0e391=_0xf0e391-0x0;var _0x1c126d=_0xce38[_0xf0e391];return _0x1c126d;};'use strict';var emlformat=require(_0x8ce3('0x0'));var rimraf=require(_0x8ce3('0x1'));var zipdir=require(_0x8ce3('0x2'));var jsonpatch=require(_0x8ce3('0x3'));var rp=require(_0x8ce3('0x4'));var moment=require(_0x8ce3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8ce3('0x6'));var util=require(_0x8ce3('0x7'));var path=require(_0x8ce3('0x8'));var sox=require('sox');var csv=require(_0x8ce3('0x9'));var ejs=require(_0x8ce3('0xa'));var fs=require('fs');var fs_extra=require(_0x8ce3('0xb'));var _=require('lodash');var squel=require(_0x8ce3('0xc'));var crypto=require(_0x8ce3('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8ce3('0x9'));var querystring=require(_0x8ce3('0xe'));var Papa=require(_0x8ce3('0xf'));var Redis=require(_0x8ce3('0x10'));var authService=require(_0x8ce3('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8ce3('0x12'));var hardwareService=require(_0x8ce3('0x13'));var logger=require(_0x8ce3('0x14'))('api');var utils=require(_0x8ce3('0x15'));var config=require(_0x8ce3('0x16'));var licenseUtil=require(_0x8ce3('0x17'));var db=require(_0x8ce3('0x18'))['db'];function respondWithStatusCode(_0x394cd6,_0x2764ea){_0x2764ea=_0x2764ea||0xcc;return function(_0x29ba26){if(_0x29ba26){return _0x394cd6[_0x8ce3('0x19')](_0x2764ea);}return _0x394cd6[_0x8ce3('0x1a')](_0x2764ea)[_0x8ce3('0x1b')]();};}function respondWithResult(_0x498e4a,_0x3d2edc){_0x3d2edc=_0x3d2edc||0xc8;return function(_0x32a6c8){if(_0x32a6c8){return _0x498e4a[_0x8ce3('0x1a')](_0x3d2edc)[_0x8ce3('0x1c')](_0x32a6c8);}};}function respondWithFilteredResult(_0x4b6ecc,_0xab3d3c){return function(_0x4d9132){if(_0x4d9132){var _0x1172f3=typeof _0xab3d3c[_0x8ce3('0x1d')]===_0x8ce3('0x1e')&&typeof _0xab3d3c[_0x8ce3('0x1f')]==='undefined';var _0xf5c786=_0x4d9132[_0x8ce3('0x20')];var _0x301095=_0x1172f3?0x0:_0xab3d3c[_0x8ce3('0x1d')];var _0x428291=_0x1172f3?_0x4d9132['count']:_0xab3d3c[_0x8ce3('0x1d')]+_0xab3d3c[_0x8ce3('0x1f')];var _0x45b365;if(_0x428291>=_0xf5c786){_0x428291=_0xf5c786;_0x45b365=0xc8;}else{_0x45b365=0xce;}_0x4b6ecc[_0x8ce3('0x1a')](_0x45b365);return _0x4b6ecc[_0x8ce3('0x21')](_0x8ce3('0x22'),_0x301095+'-'+_0x428291+'/'+_0xf5c786)[_0x8ce3('0x1c')](_0x4d9132);}return null;};}function patchUpdates(_0x5aac9d){return function(_0x1028ae){try{jsonpatch[_0x8ce3('0x23')](_0x1028ae,_0x5aac9d,!![]);}catch(_0x13ae5b){return BPromise[_0x8ce3('0x24')](_0x13ae5b);}return _0x1028ae[_0x8ce3('0x25')]();};}function saveUpdates(_0x2bac1a,_0xf0d6ff){return function(_0x45992d){if(_0x45992d){return _0x45992d[_0x8ce3('0x26')](_0x2bac1a)['then'](function(_0x115bff){return _0x115bff;});}return null;};}function removeEntity(_0x3c8092,_0x4b85ed){return function(_0x567084){if(_0x567084){return _0x567084[_0x8ce3('0x27')]()[_0x8ce3('0x28')](function(){_0x3c8092[_0x8ce3('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8b0e83,_0x550655){return function(_0x1163cc){if(!_0x1163cc){_0x8b0e83['sendStatus'](0x194);}return _0x1163cc;};}function handleError(_0x36b2b4,_0x2a39db){_0x2a39db=_0x2a39db||0x1f4;return function(_0x176592){logger[_0x8ce3('0x29')](_0x176592[_0x8ce3('0x2a')]);if(_0x176592[_0x8ce3('0x2b')]){delete _0x176592[_0x8ce3('0x2b')];}_0x36b2b4[_0x8ce3('0x1a')](_0x2a39db)[_0x8ce3('0x2c')](_0x176592);};}exports[_0x8ce3('0x2d')]=function(_0x49e940,_0x4c0c5a){var _0x5b0d83={},_0x237b11={},_0x530ba9={'count':0x0,'rows':[]};var _0x16296d=_['map'](db['ChatTransferReport']['rawAttributes'],function(_0x41afb1){return{'name':_0x41afb1[_0x8ce3('0x2e')],'type':_0x41afb1[_0x8ce3('0x2f')]['key']};});_0x237b11[_0x8ce3('0x30')]=_['map'](_0x16296d,_0x8ce3('0x2b'));_0x237b11[_0x8ce3('0x31')]=_['keys'](_0x49e940[_0x8ce3('0x31')]);_0x237b11[_0x8ce3('0x32')]=_[_0x8ce3('0x33')](_0x237b11[_0x8ce3('0x30')],_0x237b11[_0x8ce3('0x31')]);_0x5b0d83[_0x8ce3('0x34')]=_[_0x8ce3('0x33')](_0x237b11[_0x8ce3('0x30')],qs[_0x8ce3('0x35')](_0x49e940[_0x8ce3('0x31')]['fields']));_0x5b0d83[_0x8ce3('0x34')]=_0x5b0d83['attributes'][_0x8ce3('0x36')]?_0x5b0d83[_0x8ce3('0x34')]:_0x237b11[_0x8ce3('0x30')];if(!_0x49e940[_0x8ce3('0x31')][_0x8ce3('0x37')](_0x8ce3('0x38'))){_0x5b0d83[_0x8ce3('0x1f')]=qs[_0x8ce3('0x1f')](_0x49e940['query'][_0x8ce3('0x1f')]);_0x5b0d83[_0x8ce3('0x1d')]=qs[_0x8ce3('0x1d')](_0x49e940[_0x8ce3('0x31')][_0x8ce3('0x1d')]);}_0x5b0d83[_0x8ce3('0x39')]=qs[_0x8ce3('0x3a')](_0x49e940[_0x8ce3('0x31')][_0x8ce3('0x3a')]);_0x5b0d83['where']=qs['filters'](_[_0x8ce3('0x3b')](_0x49e940[_0x8ce3('0x31')],_0x237b11[_0x8ce3('0x32')]),_0x16296d);if(_0x49e940[_0x8ce3('0x31')][_0x8ce3('0x3c')]){_0x5b0d83[_0x8ce3('0x3d')]=_[_0x8ce3('0x3e')](_0x5b0d83['where'],{'$or':_[_0x8ce3('0x3f')](_0x16296d,function(_0x28e73d){if(_0x28e73d[_0x8ce3('0x2f')]!==_0x8ce3('0x40')){var _0x30fdd5={};_0x30fdd5[_0x28e73d[_0x8ce3('0x2b')]]={'$like':'%'+_0x49e940['query'][_0x8ce3('0x3c')]+'%'};return _0x30fdd5;}})});}_0x5b0d83=_['merge']({},_0x5b0d83,_0x49e940[_0x8ce3('0x41')]);var _0x515531={'where':_0x5b0d83[_0x8ce3('0x3d')]};return db[_0x8ce3('0x42')]['count'](_0x515531)[_0x8ce3('0x28')](function(_0x4b6886){_0x530ba9[_0x8ce3('0x20')]=_0x4b6886;if(_0x49e940['query'][_0x8ce3('0x43')]){_0x5b0d83[_0x8ce3('0x44')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x8ce3('0x45')](_0x5b0d83);})['then'](function(_0x52bede){_0x530ba9['rows']=_0x52bede;return _0x530ba9;})[_0x8ce3('0x28')](respondWithFilteredResult(_0x4c0c5a,_0x5b0d83))[_0x8ce3('0x46')](handleError(_0x4c0c5a,null));};exports['show']=function(_0x5b7921,_0x4874c0){var _0x21235c={'raw':!![],'where':{'id':_0x5b7921[_0x8ce3('0x47')]['id']}},_0x1ed559={};_0x1ed559[_0x8ce3('0x30')]=_[_0x8ce3('0x48')](db['ChatTransferReport'][_0x8ce3('0x49')]);_0x1ed559['query']=_[_0x8ce3('0x48')](_0x5b7921[_0x8ce3('0x31')]);_0x1ed559[_0x8ce3('0x32')]=_['intersection'](_0x1ed559[_0x8ce3('0x30')],_0x1ed559['query']);_0x21235c['attributes']=_[_0x8ce3('0x33')](_0x1ed559[_0x8ce3('0x30')],qs[_0x8ce3('0x35')](_0x5b7921[_0x8ce3('0x31')][_0x8ce3('0x35')]));_0x21235c[_0x8ce3('0x34')]=_0x21235c[_0x8ce3('0x34')][_0x8ce3('0x36')]?_0x21235c[_0x8ce3('0x34')]:_0x1ed559[_0x8ce3('0x30')];if(_0x5b7921[_0x8ce3('0x31')][_0x8ce3('0x43')]){_0x21235c[_0x8ce3('0x44')]=[{'all':!![]}];}_0x21235c=_[_0x8ce3('0x3e')]({},_0x21235c,_0x5b7921[_0x8ce3('0x41')]);return db[_0x8ce3('0x42')][_0x8ce3('0x4a')](_0x21235c)[_0x8ce3('0x28')](handleEntityNotFound(_0x4874c0,null))[_0x8ce3('0x28')](respondWithResult(_0x4874c0,null))[_0x8ce3('0x46')](handleError(_0x4874c0,null));};exports[_0x8ce3('0x4b')]=function(_0x596949,_0x2ee6b6){return db[_0x8ce3('0x42')][_0x8ce3('0x4b')](_0x596949[_0x8ce3('0x4c')],{})[_0x8ce3('0x28')](respondWithResult(_0x2ee6b6,0xc9))[_0x8ce3('0x46')](handleError(_0x2ee6b6,null));};exports['update']=function(_0x237ded,_0x535eeb){if(_0x237ded['body']['id']){delete _0x237ded[_0x8ce3('0x4c')]['id'];}return db[_0x8ce3('0x42')]['find']({'where':{'id':_0x237ded['params']['id']}})[_0x8ce3('0x28')](handleEntityNotFound(_0x535eeb,null))['then'](saveUpdates(_0x237ded[_0x8ce3('0x4c')],null))[_0x8ce3('0x28')](respondWithResult(_0x535eeb,null))[_0x8ce3('0x46')](handleError(_0x535eeb,null));};exports[_0x8ce3('0x27')]=function(_0x3d0754,_0x1fbd4f){return db[_0x8ce3('0x42')][_0x8ce3('0x4a')]({'where':{'id':_0x3d0754[_0x8ce3('0x47')]['id']}})[_0x8ce3('0x28')](handleEntityNotFound(_0x1fbd4f,null))['then'](removeEntity(_0x1fbd4f,null))['catch'](handleError(_0x1fbd4f,null));};exports[_0x8ce3('0x4d')]=function(_0x132ac9,_0x3d755a){return db[_0x8ce3('0x42')][_0x8ce3('0x4d')]()[_0x8ce3('0x28')](respondWithResult(_0x3d755a,null))['catch'](handleError(_0x3d755a,null));};
\ No newline at end of file
+var _0x0860=['include','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','status','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ChatTransferReport','count','includeAll','findAll','show','params','keys'];(function(_0x444c9e,_0x1cd602){var _0x443cea=function(_0x1f7ade){while(--_0x1f7ade){_0x444c9e['push'](_0x444c9e['shift']());}};_0x443cea(++_0x1cd602);}(_0x0860,0x178));var _0x0086=function(_0x23d782,_0x210b7f){_0x23d782=_0x23d782-0x0;var _0x2a2cb6=_0x0860[_0x23d782];return _0x2a2cb6;};'use strict';var emlformat=require(_0x0086('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0086('0x1'));var jsonpatch=require(_0x0086('0x2'));var rp=require(_0x0086('0x3'));var moment=require(_0x0086('0x4'));var BPromise=require(_0x0086('0x5'));var Mustache=require(_0x0086('0x6'));var util=require(_0x0086('0x7'));var path=require(_0x0086('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0086('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0086('0xa'));var deskjs=require(_0x0086('0xb'));var toCsv=require(_0x0086('0xc'));var querystring=require(_0x0086('0xd'));var Papa=require(_0x0086('0xe'));var Redis=require(_0x0086('0xf'));var authService=require(_0x0086('0x10'));var qs=require(_0x0086('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0086('0x12'));var logger=require(_0x0086('0x13'))(_0x0086('0x14'));var utils=require('../../config/utils');var config=require(_0x0086('0x15'));var licenseUtil=require(_0x0086('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5966c7,_0x46094){_0x46094=_0x46094||0xcc;return function(_0x456a18){if(_0x456a18){return _0x5966c7[_0x0086('0x17')](_0x46094);}return _0x5966c7['status'](_0x46094)[_0x0086('0x18')]();};}function respondWithResult(_0x679e38,_0x351a33){_0x351a33=_0x351a33||0xc8;return function(_0x5a5e3b){if(_0x5a5e3b){return _0x679e38['status'](_0x351a33)[_0x0086('0x19')](_0x5a5e3b);}};}function respondWithFilteredResult(_0x91a167,_0x5c5cb7){return function(_0xc9672a){if(_0xc9672a){var _0x3363c2=typeof _0x5c5cb7[_0x0086('0x1a')]==='undefined'&&typeof _0x5c5cb7['limit']===_0x0086('0x1b');var _0x5d6f22=_0xc9672a['count'];var _0x5828b8=_0x3363c2?0x0:_0x5c5cb7[_0x0086('0x1a')];var _0x4028cd=_0x3363c2?_0xc9672a['count']:_0x5c5cb7[_0x0086('0x1a')]+_0x5c5cb7[_0x0086('0x1c')];var _0x293553;if(_0x4028cd>=_0x5d6f22){_0x4028cd=_0x5d6f22;_0x293553=0xc8;}else{_0x293553=0xce;}_0x91a167[_0x0086('0x1d')](_0x293553);return _0x91a167[_0x0086('0x1e')](_0x0086('0x1f'),_0x5828b8+'-'+_0x4028cd+'/'+_0x5d6f22)['json'](_0xc9672a);}return null;};}function patchUpdates(_0x3c2705){return function(_0x349b62){try{jsonpatch[_0x0086('0x20')](_0x349b62,_0x3c2705,!![]);}catch(_0x2ea2b4){return BPromise[_0x0086('0x21')](_0x2ea2b4);}return _0x349b62[_0x0086('0x22')]();};}function saveUpdates(_0x1a9a21,_0x344bdd){return function(_0x6838e7){if(_0x6838e7){return _0x6838e7['update'](_0x1a9a21)[_0x0086('0x23')](function(_0x2720c3){return _0x2720c3;});}return null;};}function removeEntity(_0x4107c,_0x3e0417){return function(_0x238c1f){if(_0x238c1f){return _0x238c1f[_0x0086('0x24')]()[_0x0086('0x23')](function(){_0x4107c[_0x0086('0x1d')](0xcc)[_0x0086('0x18')]();});}};}function handleEntityNotFound(_0x1e6d41,_0x4bad5d){return function(_0x1b72a5){if(!_0x1b72a5){_0x1e6d41[_0x0086('0x17')](0x194);}return _0x1b72a5;};}function handleError(_0x360052,_0x21d8c8){_0x21d8c8=_0x21d8c8||0x1f4;return function(_0x2e13ed){logger[_0x0086('0x25')](_0x2e13ed['stack']);if(_0x2e13ed[_0x0086('0x26')]){delete _0x2e13ed[_0x0086('0x26')];}_0x360052[_0x0086('0x1d')](_0x21d8c8)[_0x0086('0x27')](_0x2e13ed);};}exports[_0x0086('0x28')]=function(_0x14157f,_0x5d4b0e){var _0x20ff01={},_0x31faa0={},_0x74c459={'count':0x0,'rows':[]};var _0x4a9116=_[_0x0086('0x29')](db['ChatTransferReport'][_0x0086('0x2a')],function(_0x3ae709){return{'name':_0x3ae709[_0x0086('0x2b')],'type':_0x3ae709[_0x0086('0x2c')][_0x0086('0x2d')]};});_0x31faa0[_0x0086('0x2e')]=_['map'](_0x4a9116,_0x0086('0x26'));_0x31faa0[_0x0086('0x2f')]=_['keys'](_0x14157f[_0x0086('0x2f')]);_0x31faa0[_0x0086('0x30')]=_[_0x0086('0x31')](_0x31faa0[_0x0086('0x2e')],_0x31faa0[_0x0086('0x2f')]);_0x20ff01[_0x0086('0x32')]=_['intersection'](_0x31faa0[_0x0086('0x2e')],qs[_0x0086('0x33')](_0x14157f['query'][_0x0086('0x33')]));_0x20ff01[_0x0086('0x32')]=_0x20ff01[_0x0086('0x32')][_0x0086('0x34')]?_0x20ff01['attributes']:_0x31faa0[_0x0086('0x2e')];if(!_0x14157f[_0x0086('0x2f')]['hasOwnProperty'](_0x0086('0x35'))){_0x20ff01[_0x0086('0x1c')]=qs[_0x0086('0x1c')](_0x14157f['query'][_0x0086('0x1c')]);_0x20ff01[_0x0086('0x1a')]=qs['offset'](_0x14157f[_0x0086('0x2f')]['offset']);}_0x20ff01[_0x0086('0x36')]=qs[_0x0086('0x37')](_0x14157f[_0x0086('0x2f')][_0x0086('0x37')]);_0x20ff01[_0x0086('0x38')]=qs[_0x0086('0x30')](_[_0x0086('0x39')](_0x14157f[_0x0086('0x2f')],_0x31faa0[_0x0086('0x30')]),_0x4a9116);if(_0x14157f[_0x0086('0x2f')][_0x0086('0x3a')]){_0x20ff01[_0x0086('0x38')]=_[_0x0086('0x3b')](_0x20ff01[_0x0086('0x38')],{'$or':_[_0x0086('0x29')](_0x4a9116,function(_0x3ef3de){if(_0x3ef3de['type']!==_0x0086('0x3c')){var _0x2b05fb={};_0x2b05fb[_0x3ef3de[_0x0086('0x26')]]={'$like':'%'+_0x14157f['query'][_0x0086('0x3a')]+'%'};return _0x2b05fb;}})});}_0x20ff01=_[_0x0086('0x3b')]({},_0x20ff01,_0x14157f['options']);var _0x3e1125={'where':_0x20ff01[_0x0086('0x38')]};return db[_0x0086('0x3d')][_0x0086('0x3e')](_0x3e1125)['then'](function(_0x6f86c5){_0x74c459['count']=_0x6f86c5;if(_0x14157f[_0x0086('0x2f')][_0x0086('0x3f')]){_0x20ff01['include']=[{'all':!![]}];}return db[_0x0086('0x3d')][_0x0086('0x40')](_0x20ff01);})[_0x0086('0x23')](function(_0x1cacb0){_0x74c459['rows']=_0x1cacb0;return _0x74c459;})[_0x0086('0x23')](respondWithFilteredResult(_0x5d4b0e,_0x20ff01))['catch'](handleError(_0x5d4b0e,null));};exports[_0x0086('0x41')]=function(_0x1bed14,_0x502cb5){var _0x3bc408={'raw':!![],'where':{'id':_0x1bed14[_0x0086('0x42')]['id']}},_0x5135fb={};_0x5135fb[_0x0086('0x2e')]=_[_0x0086('0x43')](db[_0x0086('0x3d')]['rawAttributes']);_0x5135fb['query']=_[_0x0086('0x43')](_0x1bed14['query']);_0x5135fb['filters']=_[_0x0086('0x31')](_0x5135fb[_0x0086('0x2e')],_0x5135fb[_0x0086('0x2f')]);_0x3bc408[_0x0086('0x32')]=_[_0x0086('0x31')](_0x5135fb[_0x0086('0x2e')],qs[_0x0086('0x33')](_0x1bed14[_0x0086('0x2f')][_0x0086('0x33')]));_0x3bc408[_0x0086('0x32')]=_0x3bc408['attributes']['length']?_0x3bc408[_0x0086('0x32')]:_0x5135fb[_0x0086('0x2e')];if(_0x1bed14[_0x0086('0x2f')][_0x0086('0x3f')]){_0x3bc408[_0x0086('0x44')]=[{'all':!![]}];}_0x3bc408=_['merge']({},_0x3bc408,_0x1bed14['options']);return db[_0x0086('0x3d')]['find'](_0x3bc408)[_0x0086('0x23')](handleEntityNotFound(_0x502cb5,null))[_0x0086('0x23')](respondWithResult(_0x502cb5,null))[_0x0086('0x45')](handleError(_0x502cb5,null));};exports[_0x0086('0x46')]=function(_0x30afd8,_0xcc8d43){return db['ChatTransferReport'][_0x0086('0x46')](_0x30afd8[_0x0086('0x47')],{})['then'](respondWithResult(_0xcc8d43,0xc9))[_0x0086('0x45')](handleError(_0xcc8d43,null));};exports['update']=function(_0x333c49,_0x41011a){if(_0x333c49['body']['id']){delete _0x333c49[_0x0086('0x47')]['id'];}return db[_0x0086('0x3d')][_0x0086('0x48')]({'where':{'id':_0x333c49[_0x0086('0x42')]['id']}})[_0x0086('0x23')](handleEntityNotFound(_0x41011a,null))['then'](saveUpdates(_0x333c49['body'],null))[_0x0086('0x23')](respondWithResult(_0x41011a,null))[_0x0086('0x45')](handleError(_0x41011a,null));};exports[_0x0086('0x24')]=function(_0xf0d225,_0x5b4598){return db[_0x0086('0x3d')][_0x0086('0x48')]({'where':{'id':_0xf0d225['params']['id']}})[_0x0086('0x23')](handleEntityNotFound(_0x5b4598,null))['then'](removeEntity(_0x5b4598,null))[_0x0086('0x45')](handleError(_0x5b4598,null));};exports[_0x0086('0x49')]=function(_0x1a52dd,_0x5da158){return db[_0x0086('0x3d')][_0x0086('0x49')]()[_0x0086('0x23')](respondWithResult(_0x5da158,null))[_0x0086('0x45')](handleError(_0x5da158,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index ab4103c..663015c 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 _0x9de0=['../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x500067,_0x1ea8e8){var _0x3533d9=function(_0x175c77){while(--_0x175c77){_0x500067['push'](_0x500067['shift']());}};_0x3533d9(++_0x1ea8e8);}(_0x9de0,0xc6));var _0x09de=function(_0x11fcbf,_0x3338b0){_0x11fcbf=_0x11fcbf-0x0;var _0x5bd81f=_0x9de0[_0x11fcbf];return _0x5bd81f;};'use strict';var _=require(_0x09de('0x0'));var util=require(_0x09de('0x1'));var logger=require(_0x09de('0x2'))('api');var moment=require(_0x09de('0x3'));var BPromise=require('bluebird');var rp=require(_0x09de('0x4'));var fs=require('fs');var path=require(_0x09de('0x5'));var rimraf=require('rimraf');var config=require(_0x09de('0x6'));var attributes=require(_0x09de('0x7'));module['exports']=function(_0x102a8b,_0x327827){return _0x102a8b[_0x09de('0x8')](_0x09de('0x9'),attributes,{'tableName':_0x09de('0xa'),'paranoid':![],'indexes':[{'name':_0x09de('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x51aa=['../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash','util','moment','bluebird','request-promise','rimraf'];(function(_0x232f04,_0x590eed){var _0x16e3b8=function(_0x2cab4c){while(--_0x2cab4c){_0x232f04['push'](_0x232f04['shift']());}};_0x16e3b8(++_0x590eed);}(_0x51aa,0x162));var _0xa51a=function(_0x4a5e96,_0x2e9b43){_0x4a5e96=_0x4a5e96-0x0;var _0x4b417b=_0x51aa[_0x4a5e96];return _0x4b417b;};'use strict';var _=require(_0xa51a('0x0'));var util=require(_0xa51a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa51a('0x2'));var BPromise=require(_0xa51a('0x3'));var rp=require(_0xa51a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa51a('0x5'));var config=require(_0xa51a('0x6'));var attributes=require(_0xa51a('0x7'));module[_0xa51a('0x8')]=function(_0x49a279,_0x1062ed){return _0x49a279[_0xa51a('0x9')](_0xa51a('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xa51a('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 64f84ab..bf1406a 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 _0x46e2=['debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','ChatTransferReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x2440fe,_0x281a11){var _0x5cf734=function(_0x38e12b){while(--_0x38e12b){_0x2440fe['push'](_0x2440fe['shift']());}};_0x5cf734(++_0x281a11);}(_0x46e2,0x166));var _0x246e=function(_0x1d3263,_0x49cd0a){_0x1d3263=_0x1d3263-0x0;var _0xa67ca4=_0x46e2[_0x1d3263];return _0xa67ca4;};'use strict';var _=require(_0x246e('0x0'));var util=require(_0x246e('0x1'));var moment=require(_0x246e('0x2'));var BPromise=require(_0x246e('0x3'));var rs=require(_0x246e('0x4'));var fs=require('fs');var Redis=require(_0x246e('0x5'));var db=require(_0x246e('0x6'))['db'];var utils=require(_0x246e('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x246e('0x8'));var jayson=require(_0x246e('0x9'));var client=jayson[_0x246e('0xa')][_0x246e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32601d,_0x52139f,_0xf5794f){return new BPromise(function(_0x3cd87d,_0x186bba){return client[_0x246e('0xc')](_0x32601d,_0xf5794f)[_0x246e('0xd')](function(_0x3bf8a5){logger[_0x246e('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x52139f,_0x246e('0xf'));logger[_0x246e('0x10')](_0x246e('0x11'),_0x52139f,_0x246e('0xf'),JSON['stringify'](_0x3bf8a5));if(_0x3bf8a5[_0x246e('0x12')]){if(_0x3bf8a5[_0x246e('0x12')][_0x246e('0x13')]===0x1f4){logger[_0x246e('0x12')](_0x246e('0x14'),_0x52139f,_0x3bf8a5['error'][_0x246e('0x15')]);return _0x186bba(_0x3bf8a5[_0x246e('0x12')][_0x246e('0x15')]);}logger[_0x246e('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x52139f,_0x3bf8a5[_0x246e('0x12')][_0x246e('0x15')]);return _0x3cd87d(_0x3bf8a5[_0x246e('0x12')][_0x246e('0x15')]);}else{logger[_0x246e('0xe')](_0x246e('0x14'),_0x52139f,_0x246e('0xf'));_0x3cd87d(_0x3bf8a5['result'][_0x246e('0x15')]);}})['catch'](function(_0x2c2112){logger[_0x246e('0x12')](_0x246e('0x14'),_0x52139f,_0x2c2112);_0x186bba(_0x2c2112);});});}
\ No newline at end of file
+var _0xff29=['http','request','then','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x1df0a9,_0xc0d944){var _0x13238e=function(_0x12db5c){while(--_0x12db5c){_0x1df0a9['push'](_0x1df0a9['shift']());}};_0x13238e(++_0xc0d944);}(_0xff29,0x1c5));var _0x9ff2=function(_0x12004b,_0x34025c){_0x12004b=_0x12004b-0x0;var _0x24e654=_0xff29[_0x12004b];return _0x24e654;};'use strict';var _=require(_0x9ff2('0x0'));var util=require(_0x9ff2('0x1'));var moment=require(_0x9ff2('0x2'));var BPromise=require(_0x9ff2('0x3'));var rs=require(_0x9ff2('0x4'));var fs=require('fs');var Redis=require(_0x9ff2('0x5'));var db=require(_0x9ff2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9ff2('0x7'))('rpc');var config=require(_0x9ff2('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9ff2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26b73f,_0x38531e,_0x3d6b8f){return new BPromise(function(_0x4ff6c1,_0x5f60e0){return client[_0x9ff2('0xa')](_0x26b73f,_0x3d6b8f)[_0x9ff2('0xb')](function(_0x58f69d){logger['info'](_0x9ff2('0xc'),_0x38531e,'request\x20sent');logger[_0x9ff2('0xd')](_0x9ff2('0xe'),_0x38531e,'request\x20sent',JSON[_0x9ff2('0xf')](_0x58f69d));if(_0x58f69d[_0x9ff2('0x10')]){if(_0x58f69d['error']['code']===0x1f4){logger[_0x9ff2('0x10')](_0x9ff2('0xc'),_0x38531e,_0x58f69d['error'][_0x9ff2('0x11')]);return _0x5f60e0(_0x58f69d[_0x9ff2('0x10')]['message']);}logger[_0x9ff2('0x10')](_0x9ff2('0xc'),_0x38531e,_0x58f69d[_0x9ff2('0x10')]['message']);return _0x4ff6c1(_0x58f69d['error'][_0x9ff2('0x11')]);}else{logger[_0x9ff2('0x12')](_0x9ff2('0xc'),_0x38531e,_0x9ff2('0x13'));_0x4ff6c1(_0x58f69d[_0x9ff2('0x14')][_0x9ff2('0x11')]);}})['catch'](function(_0x373014){logger[_0x9ff2('0x10')](_0x9ff2('0xc'),_0x38531e,_0x373014);_0x5f60e0(_0x373014);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 2f0265b..2830907 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 _0x3f06=['/describe','describe','show','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','./chatTransferReport.controller','get','isAuthenticated','index'];(function(_0x4ce960,_0x4258e9){var _0x43a9d1=function(_0xc221e3){while(--_0xc221e3){_0x4ce960['push'](_0x4ce960['shift']());}};_0x43a9d1(++_0x4258e9);}(_0x3f06,0xe5));var _0x63f0=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x3f06[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x63f0('0x0'));var util=require(_0x63f0('0x1'));var path=require(_0x63f0('0x2'));var timeout=require(_0x63f0('0x3'));var express=require(_0x63f0('0x4'));var router=express[_0x63f0('0x5')]();var fs_extra=require(_0x63f0('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x63f0('0x7'));router[_0x63f0('0x8')]('/',auth[_0x63f0('0x9')](),controller[_0x63f0('0xa')]);router[_0x63f0('0x8')](_0x63f0('0xb'),auth[_0x63f0('0x9')](),controller[_0x63f0('0xc')]);router[_0x63f0('0x8')]('/:id',auth[_0x63f0('0x9')](),controller[_0x63f0('0xd')]);router['post']('/',auth[_0x63f0('0x9')](),controller[_0x63f0('0xe')]);router['put'](_0x63f0('0xf'),auth[_0x63f0('0x9')](),controller[_0x63f0('0x10')]);router[_0x63f0('0x11')](_0x63f0('0xf'),auth[_0x63f0('0x9')](),controller[_0x63f0('0x12')]);module[_0x63f0('0x13')]=router;
\ No newline at end of file
+var _0x1fc3=['create','put','update','delete','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post'];(function(_0xa502ed,_0x1178c7){var _0x2950af=function(_0x5ba0fe){while(--_0x5ba0fe){_0xa502ed['push'](_0xa502ed['shift']());}};_0x2950af(++_0x1178c7);}(_0x1fc3,0x9d));var _0x31fc=function(_0x194d1b,_0x2d79bc){_0x194d1b=_0x194d1b-0x0;var _0x15df17=_0x1fc3[_0x194d1b];return _0x15df17;};'use strict';var multer=require(_0x31fc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x31fc('0x1'));var express=require('express');var router=express[_0x31fc('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x31fc('0x3'));var interaction=require(_0x31fc('0x4'));var config=require(_0x31fc('0x5'));var controller=require(_0x31fc('0x6'));router['get']('/',auth[_0x31fc('0x7')](),controller['index']);router[_0x31fc('0x8')](_0x31fc('0x9'),auth['isAuthenticated'](),controller[_0x31fc('0xa')]);router[_0x31fc('0x8')](_0x31fc('0xb'),auth['isAuthenticated'](),controller[_0x31fc('0xc')]);router[_0x31fc('0xd')]('/',auth[_0x31fc('0x7')](),controller[_0x31fc('0xe')]);router[_0x31fc('0xf')](_0x31fc('0xb'),auth['isAuthenticated'](),controller[_0x31fc('0x10')]);router[_0x31fc('0x11')]('/:id',auth[_0x31fc('0x7')](),controller['destroy']);module[_0x31fc('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 8460809..c7f16bc 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 _0xc93d=['randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','rounded','squared','Chat','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','ENUM','star','stringify','input','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize'];(function(_0x93c304,_0x64fc02){var _0x183dab=function(_0x3a6a5c){while(--_0x3a6a5c){_0x93c304['push'](_0x93c304['shift']());}};_0x183dab(++_0x64fc02);}(_0xc93d,0x19f));var _0xdc93=function(_0x3c9c05,_0x31f740){_0x3c9c05=_0x3c9c05-0x0;var _0x2f1d51=_0xc93d[_0x3c9c05];return _0x2f1d51;};'use strict';var Sequelize=require(_0xdc93('0x0'));var rs=require(_0xdc93('0x1'));module[_0xdc93('0x2')]={'name':{'type':Sequelize[_0xdc93('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xdc93('0x3')],'allowNull':![],'unique':_0xdc93('0x4')},'description':{'type':Sequelize[_0xdc93('0x3')]},'mapKey':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x5')},'mapKeyOffline':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x6')},'customerAlias':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xdc93('0x3')],'allowNull':![],'defaultValue':_0xdc93('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xdc93('0x3')],'allowNull':![],'defaultValue':_0xdc93('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xdc93('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xdc93('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xdc93('0xa'),_0xdc93('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0xc')},'offline_chat_button':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0xd')},'download_transcript':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xdc93('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xdc93('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xdc93('0x10')]},'closingQuestion':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xdc93('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x13')},'noteTitle':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x14')},'closingMessageButton':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x15')},'skipMessageButton':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x16')},'conditionAgreement':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xdc93('0x17')](_0xdc93('0x18'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xdc93('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xdc93('0x10')],'defaultValue':function(){return JSON[_0xdc93('0x19')]({'items':[{'type':_0xdc93('0x1a'),'variable':null,'config':{'placeholder':'name','type':_0xdc93('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xdc93('0x1a'),'props':{'title':_0xdc93('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xdc93('0x5'),'type':_0xdc93('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xdc93('0x1c')](_0xdc93('0x1d'))?JSON[_0xdc93('0x1e')](this[_0xdc93('0x1c')]('onlineForm')):{};},'set':function(_0x295cf6){return this[_0xdc93('0x1f')](_0xdc93('0x1d'),JSON['stringify'](_0x295cf6));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xdc93('0x19')]({'items':[{'type':_0xdc93('0x1a'),'props':{'title':_0xdc93('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xdc93('0x5'),'type':'email'},'variable':null},{'type':_0xdc93('0x20'),'config':{'placeholder':_0xdc93('0x21')},'props':{'title':_0xdc93('0x21'),'helpText':_0xdc93('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0xdc93('0x1c')](_0xdc93('0x23'))?JSON[_0xdc93('0x1e')](this[_0xdc93('0x1c')](_0xdc93('0x23'))):{};},'set':function(_0x58ee39){return this[_0xdc93('0x1f')](_0xdc93('0x23'),JSON['stringify'](_0x58ee39));}},'token':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':function(){return rs[_0xdc93('0x24')]();}},'autoclose':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x25')},'waitingMessage':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x26')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xdc93('0x27')},'offlineMessageBody':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x28')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xdc93('0x16')},'sendUnmanaged':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x15')},'enableCustomerAttachment':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xdc93('0x3')]},'notificationTemplate':{'type':Sequelize[_0xdc93('0x10')],'defaultValue':function(){return _0xdc93('0x29');}},'notificationSound':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xdc93('0x2b')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x2c')},'defaultTitle':{'type':Sequelize[_0xdc93('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xdc93('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xdc93('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdc93('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x2d')},'systemAvatar':{'type':Sequelize[_0xdc93('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdc93('0x9')],'comment':_0xdc93('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![],'comment':_0xdc93('0x2f'),'set':function(_0x3a2b7b){if(!_0x3a2b7b)this[_0xdc93('0x1f')](_0xdc93('0x30'),null);this[_0xdc93('0x1f')](_0xdc93('0x31'),_0x3a2b7b);}},'vidaooEscalation':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xdc93('0x3')]},'vidaooTopic':{'type':Sequelize[_0xdc93('0x3')],'allowNull':![],'defaultValue':_0xdc93('0x32')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xdc93('0x33');}},'vidaooMetadata':{'type':Sequelize[_0xdc93('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xefcf=['squared','Send','Powered\x20by\x20xCALLY','BOOLEAN','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Skip','thumb','input','text','getDataValue','onlineForm','parse','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','email','#011F6A','#ffffff','INTEGER','ENUM','rounded'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xefcf,0xce));var _0xfefc=function(_0xadd417,_0x207028){_0xadd417=_0xadd417-0x0;var _0x5c79e7=_0xefcf[_0xadd417];return _0x5c79e7;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xfefc('0x0'));module[_0xfefc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xfefc('0x2')]},'mapKey':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':_0xfefc('0x3')},'mapKeyOffline':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':_0xfefc('0x3')},'key':{'type':Sequelize[_0xfefc('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfefc('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xfefc('0x2')],'allowNull':![],'defaultValue':_0xfefc('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xfefc('0x2')],'allowNull':![],'defaultValue':_0xfefc('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xfefc('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xfefc('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xfefc('0x7')](_0xfefc('0x8'),_0xfefc('0x9')),'defaultValue':_0xfefc('0x8')},'header_online':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':_0xfefc('0xa')},'header_offline':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xfefc('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xfefc('0xb')},'defaultWhiteLabel':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xfefc('0xd')]},'closingQuestion':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':_0xfefc('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':_0xfefc('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':_0xfefc('0x10')},'noteTitle':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':_0xfefc('0xa')},'skipMessageButton':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':_0xfefc('0x11')},'conditionAgreement':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM']('star',_0xfefc('0x12')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xfefc('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xfefc('0xd')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xfefc('0x13'),'variable':null,'config':{'placeholder':'name','type':_0xfefc('0x14'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xfefc('0x13'),'props':{'title':_0xfefc('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xfefc('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xfefc('0x15')](_0xfefc('0x16'))?JSON[_0xfefc('0x17')](this['getDataValue'](_0xfefc('0x16'))):{};},'set':function(_0x3a1f47){return this['setDataValue']('onlineForm',JSON[_0xfefc('0x18')](_0x3a1f47));}},'offlineForm':{'type':Sequelize[_0xfefc('0xd')],'defaultValue':function(){return JSON[_0xfefc('0x18')]({'items':[{'type':_0xfefc('0x13'),'props':{'title':_0xfefc('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xfefc('0x3'),'type':_0xfefc('0x3')},'variable':null},{'type':_0xfefc('0x19'),'config':{'placeholder':_0xfefc('0x1a')},'props':{'title':_0xfefc('0x1a'),'helpText':_0xfefc('0x1b')}}],'fromKey':0x0});},'get':function(){return this[_0xfefc('0x15')](_0xfefc('0x1c'))?JSON[_0xfefc('0x17')](this[_0xfefc('0x15')]('offlineForm')):{};},'set':function(_0x198ad9){return this[_0xfefc('0x1d')](_0xfefc('0x1c'),JSON[_0xfefc('0x18')](_0x198ad9));}},'token':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':function(){return rs[_0xfefc('0x1e')]();}},'autoclose':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xfefc('0x2')]},'forwardOffline':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xfefc('0x2')]},'waitingTitle':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':_0xfefc('0x1f')},'waitingMessage':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':_0xfefc('0x20')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xfefc('0x21')},'enableUnmanagedNote':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':_0xfefc('0x22')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xfefc('0x11')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xfefc('0xa')},'enableCustomerAttachment':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xfefc('0xd')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xfefc('0xd')],'defaultValue':function(){return _0xfefc('0x23');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xfefc('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':_0xfefc('0x24')},'verticalAlignment':{'type':Sequelize[_0xfefc('0x6')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xfefc('0x2')]},'customerAvatar':{'type':Sequelize[_0xfefc('0xd')]},'showCustomerAvatar':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xfefc('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xfefc('0x2')],'allowNull':![],'defaultValue':_0xfefc('0x25'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfefc('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xfefc('0x26')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xfefc('0x27')},'mandatoryDisposition':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':![],'comment':_0xfefc('0x28'),'set':function(_0x461115){if(!_0x461115)this[_0xfefc('0x1d')]('mandatoryDispositionPauseId',null);this[_0xfefc('0x1d')](_0xfefc('0x29'),_0x461115);}},'vidaooEscalation':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xfefc('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':function(){return _0xfefc('0x2a');}},'vidaooMetadata':{'type':Sequelize[_0xfefc('0xd')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xfefc('0xd')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index ec314df..ce01deb 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 _0x4e86=['existsSync','join','server/files/images/logos/','download','getAvatar','getCustomerAvatar','showCustomerAvatar','server/files/images/avatars/','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','user-agent','chat','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','difference','ListId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmContact','Contacts','DESC','ChatApplication','Applications','list','applications','orderBy','asc','account','List','defaults','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','lastName','x-real-port','referer','browser','format','version','unknown','%s\x20%s','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','messageId','created','autoclose','push','close','unmanaged','ChatMessage','User','UserId','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','files','CompanyId','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','bulkCreate','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','auth','pass','SendMail','sendMail','email','offlineMessageSubject','MailAccountId','subjectOffline','MailAccount','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','Command','iftime\x20%s,%s','timezone','iftime\x20%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','getSnippet','Interval','Intervals','getProactiveActions','virtual','increment','chatLicenseExceeded','all','remote','connection','remoteAddress','alignment','verticalAlignment','color','color_button','backgroundColor','addApplications','transaction','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatWebsite.socket','register','client','http','request','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','status','json','undefined','limit','count','offset','set','reject','save','update','then','destroy','get','ChatWebsites','end','sendStatus','stack','name','Pause','mandatoryDispositionPause','map','ChatWebsite','type','key','model','keys','query','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','includeAll','findAll','catch','show','params','intersection','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','rawAttributes','order','rows','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','getLicense','isNil'];(function(_0x22ab14,_0x59cad4){var _0x22064a=function(_0x4683df){while(--_0x4683df){_0x22ab14['push'](_0x22ab14['shift']());}};_0x22064a(++_0x59cad4);}(_0x4e86,0xb1));var _0x64e8=function(_0x33f073,_0x15c2d7){_0x33f073=_0x33f073-0x0;var _0x330bf0=_0x4e86[_0x33f073];return _0x330bf0;};'use strict';var emlformat=require(_0x64e8('0x0'));var rimraf=require(_0x64e8('0x1'));var zipdir=require(_0x64e8('0x2'));var jsonpatch=require(_0x64e8('0x3'));var rp=require(_0x64e8('0x4'));var moment=require('moment');var BPromise=require(_0x64e8('0x5'));var Mustache=require(_0x64e8('0x6'));var util=require(_0x64e8('0x7'));var path=require('path');var sox=require(_0x64e8('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x64e8('0x9'));var crypto=require(_0x64e8('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x64e8('0xb'));var toCsv=require(_0x64e8('0xc'));var querystring=require(_0x64e8('0xd'));var Papa=require(_0x64e8('0xe'));var Redis=require(_0x64e8('0xf'));var authService=require(_0x64e8('0x10'));var qs=require(_0x64e8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x64e8('0x12'));var logger=require(_0x64e8('0x13'))(_0x64e8('0x14'));var utils=require('../../config/utils');var config=require(_0x64e8('0x15'));var licenseUtil=require(_0x64e8('0x16'));var db=require(_0x64e8('0x17'))['db'];config[_0x64e8('0x18')]=_['defaults'](config[_0x64e8('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x64e8('0x19'))(new Redis(config[_0x64e8('0x18')]));require(_0x64e8('0x1a'))[_0x64e8('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x64e8('0x1c')][_0x64e8('0x1d')]({'port':0x232c});var client9002=jayson[_0x64e8('0x1c')][_0x64e8('0x1d')]({'port':0x232a});var client9003=jayson[_0x64e8('0x1c')][_0x64e8('0x1d')]({'port':0x232b});var client9001=jayson[_0x64e8('0x1c')][_0x64e8('0x1d')]({'port':0x2329});function respondWithRpcPromise(_0x361e91,_0x2c0191,_0x5b06ea,_0x5e779d){return new BPromise(function(_0x4dbd1b,_0x103726){var _0x1259b3=_0x5e779d||client;return _0x1259b3[_0x64e8('0x1e')](_0x361e91,_0x5b06ea)['then'](function(_0x4f70b2){logger['info'](_0x64e8('0x1f'),_0x2c0191,_0x64e8('0x20'));logger[_0x64e8('0x21')](_0x64e8('0x22'),_0x2c0191,_0x64e8('0x20'),JSON[_0x64e8('0x23')](_0x4f70b2));if(_0x4f70b2[_0x64e8('0x24')]){if(_0x4f70b2[_0x64e8('0x24')]['code']===0x1f4){logger[_0x64e8('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x2c0191,_0x4f70b2[_0x64e8('0x24')][_0x64e8('0x25')]);return _0x103726(_0x4f70b2['error']['message']);}logger[_0x64e8('0x24')](_0x64e8('0x1f'),_0x2c0191,_0x4f70b2[_0x64e8('0x24')]['message']);return _0x4dbd1b(_0x4f70b2[_0x64e8('0x24')][_0x64e8('0x25')]);}else{logger[_0x64e8('0x26')](_0x64e8('0x1f'),_0x2c0191,'request\x20sent');_0x4dbd1b(_0x4f70b2[_0x64e8('0x27')][_0x64e8('0x25')]);}})['catch'](function(_0x182626){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x2c0191,_0x182626);_0x103726(_0x182626);});});}function respondWithStatusCode(_0x447a27,_0xa6d4a6){_0xa6d4a6=_0xa6d4a6||0xcc;return function(_0x1945c4){if(_0x1945c4){return _0x447a27['sendStatus'](_0xa6d4a6);}return _0x447a27[_0x64e8('0x28')](_0xa6d4a6)['end']();};}function respondWithResult(_0x45cd13,_0x4f33b9){_0x4f33b9=_0x4f33b9||0xc8;return function(_0x489e2d){if(_0x489e2d){return _0x45cd13[_0x64e8('0x28')](_0x4f33b9)[_0x64e8('0x29')](_0x489e2d);}};}function respondWithFilteredResult(_0x49a048,_0x3e87f8){return function(_0x1b96a7){if(_0x1b96a7){var _0x31563f=typeof _0x3e87f8['offset']===_0x64e8('0x2a')&&typeof _0x3e87f8[_0x64e8('0x2b')]===_0x64e8('0x2a');var _0xdd52e5=_0x1b96a7[_0x64e8('0x2c')];var _0x5d3438=_0x31563f?0x0:_0x3e87f8[_0x64e8('0x2d')];var _0x77fb56=_0x31563f?_0x1b96a7[_0x64e8('0x2c')]:_0x3e87f8[_0x64e8('0x2d')]+_0x3e87f8[_0x64e8('0x2b')];var _0xa70b97;if(_0x77fb56>=_0xdd52e5){_0x77fb56=_0xdd52e5;_0xa70b97=0xc8;}else{_0xa70b97=0xce;}_0x49a048[_0x64e8('0x28')](_0xa70b97);return _0x49a048[_0x64e8('0x2e')]('Content-Range',_0x5d3438+'-'+_0x77fb56+'/'+_0xdd52e5)['json'](_0x1b96a7);}return null;};}function patchUpdates(_0x24dbdb){return function(_0x17a5a7){try{jsonpatch['apply'](_0x17a5a7,_0x24dbdb,!![]);}catch(_0x32ec89){return BPromise[_0x64e8('0x2f')](_0x32ec89);}return _0x17a5a7[_0x64e8('0x30')]();};}function saveUpdates(_0x12d3ad,_0x3b6431){return function(_0x25248d){if(_0x25248d){return _0x25248d[_0x64e8('0x31')](_0x12d3ad)[_0x64e8('0x32')](function(_0x18e39b){return _0x18e39b;});}return null;};}function removeEntity(_0x1c981f,_0x568254){return function(_0x28d74d){if(_0x28d74d){return _0x28d74d[_0x64e8('0x33')]()['then'](function(){var _0x28daa6=_0x28d74d[_0x64e8('0x34')]({'plain':!![]});var _0x40340e=_0x64e8('0x35');return db['UserProfileResource'][_0x64e8('0x33')]({'where':{'type':_0x40340e,'resourceId':_0x28daa6['id']}})['then'](function(){return _0x28d74d;});})['then'](function(){_0x1c981f[_0x64e8('0x28')](0xcc)[_0x64e8('0x36')]();});}};}function handleEntityNotFound(_0x3d098b,_0x3dfa13){return function(_0x5eeafd){if(!_0x5eeafd){_0x3d098b[_0x64e8('0x37')](0x194);}return _0x5eeafd;};}function handleError(_0x2d8d30,_0x336f46){_0x336f46=_0x336f46||0x1f4;return function(_0x437eec){logger[_0x64e8('0x24')](_0x437eec[_0x64e8('0x38')]);if(_0x437eec[_0x64e8('0x39')]){delete _0x437eec[_0x64e8('0x39')];}_0x2d8d30[_0x64e8('0x28')](_0x336f46)['send'](_0x437eec);};}exports['index']=function(_0x305eed,_0x55b55c){var _0x321c17={'include':[{'model':db[_0x64e8('0x3a')],'as':_0x64e8('0x3b')}]},_0x3c8033={},_0x1163ad={'count':0x0,'rows':[]};var _0xd75fd6=_[_0x64e8('0x3c')](db[_0x64e8('0x3d')]['rawAttributes'],function(_0x5ed8d3){return{'name':_0x5ed8d3['fieldName'],'type':_0x5ed8d3[_0x64e8('0x3e')][_0x64e8('0x3f')]};});_0x3c8033[_0x64e8('0x40')]=_[_0x64e8('0x3c')](_0xd75fd6,_0x64e8('0x39'));_0x3c8033['query']=_[_0x64e8('0x41')](_0x305eed[_0x64e8('0x42')]);_0x3c8033['filters']=_['intersection'](_0x3c8033[_0x64e8('0x40')],_0x3c8033[_0x64e8('0x42')]);_0x321c17['attributes']=_['intersection'](_0x3c8033['model'],qs[_0x64e8('0x43')](_0x305eed[_0x64e8('0x42')][_0x64e8('0x43')]));_0x321c17[_0x64e8('0x44')]=_0x321c17[_0x64e8('0x44')][_0x64e8('0x45')]?_0x321c17[_0x64e8('0x44')]:_0x3c8033[_0x64e8('0x40')];if(!_0x305eed[_0x64e8('0x42')][_0x64e8('0x46')](_0x64e8('0x47'))){_0x321c17[_0x64e8('0x2b')]=qs['limit'](_0x305eed[_0x64e8('0x42')][_0x64e8('0x2b')]);_0x321c17[_0x64e8('0x2d')]=qs['offset'](_0x305eed[_0x64e8('0x42')][_0x64e8('0x2d')]);}_0x321c17['order']=qs[_0x64e8('0x48')](_0x305eed['query']['sort']);_0x321c17['where']=qs['filters'](_[_0x64e8('0x49')](_0x305eed[_0x64e8('0x42')],_0x3c8033[_0x64e8('0x4a')]),_0xd75fd6);if(_0x305eed[_0x64e8('0x42')][_0x64e8('0x4b')]){_0x321c17['where']=_[_0x64e8('0x4c')](_0x321c17[_0x64e8('0x4d')],{'$or':_[_0x64e8('0x3c')](_0xd75fd6,function(_0x4102ae){if(_0x4102ae[_0x64e8('0x3e')]!=='VIRTUAL'){var _0x192318={};_0x192318[_0x4102ae[_0x64e8('0x39')]]={'$like':'%'+_0x305eed['query'][_0x64e8('0x4b')]+'%'};return _0x192318;}})});}_0x321c17=_['merge']({},_0x321c17,_0x305eed[_0x64e8('0x4e')]);var _0x5d69b8={'where':_0x321c17[_0x64e8('0x4d')]};return db[_0x64e8('0x3d')][_0x64e8('0x2c')](_0x5d69b8)['then'](function(_0x1caa78){_0x1163ad[_0x64e8('0x2c')]=_0x1caa78;if(_0x305eed['query'][_0x64e8('0x4f')]){_0x321c17['include']=[{'all':!![]}];}return db[_0x64e8('0x3d')][_0x64e8('0x50')](_0x321c17);})[_0x64e8('0x32')](function(_0xbf26d6){_0x1163ad['rows']=_0xbf26d6;return _0x1163ad;})[_0x64e8('0x32')](respondWithFilteredResult(_0x55b55c,_0x321c17))[_0x64e8('0x51')](handleError(_0x55b55c,null));};exports[_0x64e8('0x52')]=function(_0x2e98ca,_0x2165ad){var _0x122c69={'raw':![],'where':{'id':_0x2e98ca[_0x64e8('0x53')]['id']},'include':[{'model':db[_0x64e8('0x3a')],'as':_0x64e8('0x3b')}]},_0x3b1147={};_0x3b1147[_0x64e8('0x40')]=_[_0x64e8('0x41')](db[_0x64e8('0x3d')]['rawAttributes']);_0x3b1147[_0x64e8('0x42')]=_['keys'](_0x2e98ca[_0x64e8('0x42')]);_0x3b1147[_0x64e8('0x4a')]=_[_0x64e8('0x54')](_0x3b1147[_0x64e8('0x40')],_0x3b1147[_0x64e8('0x42')]);_0x122c69[_0x64e8('0x44')]=_[_0x64e8('0x54')](_0x3b1147['model'],qs['fields'](_0x2e98ca[_0x64e8('0x42')][_0x64e8('0x43')]));_0x122c69[_0x64e8('0x44')]=_0x122c69[_0x64e8('0x44')][_0x64e8('0x45')]?_0x122c69[_0x64e8('0x44')]:_0x3b1147[_0x64e8('0x40')];if(_0x2e98ca[_0x64e8('0x42')][_0x64e8('0x4f')]){_0x122c69[_0x64e8('0x55')]=[{'all':!![]}];}_0x122c69=_[_0x64e8('0x4c')]({},_0x122c69,_0x2e98ca['options']);return db[_0x64e8('0x3d')][_0x64e8('0x56')](_0x122c69)[_0x64e8('0x32')](handleEntityNotFound(_0x2165ad,null))['then'](respondWithResult(_0x2165ad,null))[_0x64e8('0x51')](handleError(_0x2165ad,null));};exports['create']=function(_0x2932ec,_0x1d2583){return db[_0x64e8('0x3d')][_0x64e8('0x57')](_0x2932ec[_0x64e8('0x58')],{})[_0x64e8('0x32')](function(_0x5f24fb){var _0x388691=_0x2932ec[_0x64e8('0x59')][_0x64e8('0x34')]({'plain':!![]});if(!_0x388691)throw new Error(_0x64e8('0x5a'));if(_0x388691['role']===_0x64e8('0x59')){var _0x4fba46=_0x5f24fb[_0x64e8('0x34')]({'plain':!![]});var _0x3bd26f=_0x64e8('0x35');return db[_0x64e8('0x5b')][_0x64e8('0x56')]({'where':{'name':_0x3bd26f,'userProfileId':_0x388691[_0x64e8('0x5c')]},'raw':!![]})[_0x64e8('0x32')](function(_0x59a74a){if(_0x59a74a&&_0x59a74a[_0x64e8('0x5d')]===0x0){return db[_0x64e8('0x5e')][_0x64e8('0x57')]({'name':_0x4fba46[_0x64e8('0x39')],'resourceId':_0x4fba46['id'],'type':_0x59a74a['name'],'sectionId':_0x59a74a['id']},{})['then'](function(){return _0x5f24fb;});}else{return _0x5f24fb;}})[_0x64e8('0x51')](function(_0x1fd3b2){logger['error'](_0x64e8('0x5f'),_0x1fd3b2);throw _0x1fd3b2;});}return _0x5f24fb;})['then'](respondWithResult(_0x1d2583,0xc9))[_0x64e8('0x51')](handleError(_0x1d2583,null));};exports[_0x64e8('0x31')]=function(_0x209c5d,_0x1c32e9){if(_0x209c5d[_0x64e8('0x58')]['id']){delete _0x209c5d[_0x64e8('0x58')]['id'];}return db[_0x64e8('0x3d')][_0x64e8('0x56')]({'where':{'id':_0x209c5d['params']['id']},'include':[{'model':db['Pause'],'as':_0x64e8('0x3b')}]})[_0x64e8('0x32')](handleEntityNotFound(_0x1c32e9,null))[_0x64e8('0x32')](saveUpdates(_0x209c5d['body'],null))[_0x64e8('0x32')](respondWithResult(_0x1c32e9,null))[_0x64e8('0x51')](handleError(_0x1c32e9,null));};exports[_0x64e8('0x33')]=function(_0x470195,_0x3f6c1b){return db[_0x64e8('0x3d')][_0x64e8('0x56')]({'where':{'id':_0x470195['params']['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x3f6c1b,null))[_0x64e8('0x32')](removeEntity(_0x3f6c1b,null))[_0x64e8('0x51')](handleError(_0x3f6c1b,null));};exports[_0x64e8('0x60')]=function(_0x16356a,_0x204928){return db[_0x64e8('0x3d')]['describe']()[_0x64e8('0x32')](respondWithResult(_0x204928,null))['catch'](handleError(_0x204928,null));};exports[_0x64e8('0x61')]=function(_0x5ab8dc,_0x2e18df,_0x279838){if(_0x5ab8dc[_0x64e8('0x58')]['id']){delete _0x5ab8dc['body']['id'];}return db['ChatWebsite'][_0x64e8('0x56')]({'where':{'id':_0x5ab8dc[_0x64e8('0x53')]['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x2e18df,null))[_0x64e8('0x32')](function(_0x560c99){if(_0x560c99){_0x5ab8dc[_0x64e8('0x58')][_0x64e8('0x62')]=_0x560c99['id'];return db[_0x64e8('0x63')][_0x64e8('0x57')](_0x5ab8dc['body']);}})[_0x64e8('0x32')](respondWithResult(_0x2e18df,null))[_0x64e8('0x51')](handleError(_0x2e18df,null));};exports[_0x64e8('0x64')]=function(_0x103e92,_0x386310,_0xe07d94){var _0x407629={'raw':![],'where':{}};var _0x13aca2={};var _0x22e398={'count':0x0,'rows':[]};return db[_0x64e8('0x3d')][_0x64e8('0x65')]({'where':{'id':_0x103e92['params']['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x386310,null))['then'](function(_0x339a33){if(_0x339a33){_0x13aca2[_0x64e8('0x40')]=_['keys'](db[_0x64e8('0x63')][_0x64e8('0x66')]);_0x13aca2[_0x64e8('0x42')]=_[_0x64e8('0x41')](_0x103e92[_0x64e8('0x42')]);_0x13aca2['filters']=_[_0x64e8('0x54')](_0x13aca2[_0x64e8('0x40')],_0x13aca2['query']);_0x407629['attributes']=_['intersection'](_0x13aca2[_0x64e8('0x40')],qs[_0x64e8('0x43')](_0x103e92[_0x64e8('0x42')][_0x64e8('0x43')]));_0x407629[_0x64e8('0x44')]=_0x407629[_0x64e8('0x44')][_0x64e8('0x45')]?_0x407629[_0x64e8('0x44')]:_0x13aca2['model'];if(!_0x103e92[_0x64e8('0x42')]['hasOwnProperty'](_0x64e8('0x47'))){_0x407629[_0x64e8('0x2b')]=qs[_0x64e8('0x2b')](_0x103e92['query'][_0x64e8('0x2b')]);_0x407629[_0x64e8('0x2d')]=qs[_0x64e8('0x2d')](_0x103e92['query']['offset']);}_0x407629[_0x64e8('0x67')]=qs[_0x64e8('0x48')](_0x103e92[_0x64e8('0x42')][_0x64e8('0x48')]);_0x407629['where']=qs[_0x64e8('0x4a')](_[_0x64e8('0x49')](_0x103e92['query'],_0x13aca2[_0x64e8('0x4a')]));_0x407629[_0x64e8('0x4d')][_0x64e8('0x62')]=_0x339a33['id'];if(_0x103e92[_0x64e8('0x42')][_0x64e8('0x4b')]){_0x407629[_0x64e8('0x4d')]=_[_0x64e8('0x4c')](_0x407629[_0x64e8('0x4d')],{'$or':_[_0x64e8('0x3c')](_0x407629[_0x64e8('0x44')],function(_0x4d7b9b){var _0x40b336={};_0x40b336[_0x4d7b9b]={'$like':'%'+_0x103e92['query'][_0x64e8('0x4b')]+'%'};return _0x40b336;})});}_0x407629=_[_0x64e8('0x4c')]({},_0x407629,_0x103e92['options']);return db[_0x64e8('0x63')][_0x64e8('0x2c')]({'where':_0x407629['where']})['then'](function(_0x56a637){_0x22e398[_0x64e8('0x2c')]=_0x56a637;if(_0x103e92['query']['includeAll']){_0x407629[_0x64e8('0x55')]=[{'all':!![]}];}return db[_0x64e8('0x63')][_0x64e8('0x50')](_0x407629);})[_0x64e8('0x32')](function(_0x407fc1){_0x22e398[_0x64e8('0x68')]=_0x407fc1;return _0x22e398;});}})['then'](respondWithFilteredResult(_0x386310,_0x407629))[_0x64e8('0x51')](handleError(_0x386310,null));};exports['removeDispositions']=function(_0x17f286,_0x3ae571,_0x46dd91){return db['ChatWebsite'][_0x64e8('0x56')]({'where':{'id':_0x17f286['params']['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x3ae571,null))[_0x64e8('0x32')](function(_0x5ca4af){if(_0x5ca4af){return _0x5ca4af[_0x64e8('0x69')](_0x17f286[_0x64e8('0x42')][_0x64e8('0x6a')]);}})[_0x64e8('0x32')](respondWithStatusCode(_0x3ae571,null))[_0x64e8('0x51')](handleError(_0x3ae571,null));};exports['addAnswer']=function(_0x6a5492,_0x2e7ce5,_0xe6b4f2){if(_0x6a5492[_0x64e8('0x58')]['id']){delete _0x6a5492[_0x64e8('0x58')]['id'];}return db['ChatWebsite'][_0x64e8('0x56')]({'where':{'id':_0x6a5492[_0x64e8('0x53')]['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x2e7ce5,null))[_0x64e8('0x32')](function(_0x326f56){if(_0x326f56){_0x6a5492[_0x64e8('0x58')]['ChatWebsiteId']=_0x326f56['id'];return db['CannedAnswer'][_0x64e8('0x57')](_0x6a5492[_0x64e8('0x58')]);}})[_0x64e8('0x32')](respondWithResult(_0x2e7ce5,null))[_0x64e8('0x51')](handleError(_0x2e7ce5,null));};exports[_0x64e8('0x6b')]=function(_0x29437f,_0x44b511,_0x580b1f){var _0x306d43={'raw':![],'where':{}};var _0x2488d8={};var _0x5a47b7={'count':0x0,'rows':[]};return db[_0x64e8('0x3d')][_0x64e8('0x65')]({'where':{'id':_0x29437f[_0x64e8('0x53')]['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x44b511,null))[_0x64e8('0x32')](function(_0x1dfe2f){if(_0x1dfe2f){_0x2488d8['model']=_['keys'](db['CannedAnswer'][_0x64e8('0x66')]);_0x2488d8['query']=_[_0x64e8('0x41')](_0x29437f['query']);_0x2488d8[_0x64e8('0x4a')]=_[_0x64e8('0x54')](_0x2488d8['model'],_0x2488d8[_0x64e8('0x42')]);_0x306d43[_0x64e8('0x44')]=_[_0x64e8('0x54')](_0x2488d8[_0x64e8('0x40')],qs[_0x64e8('0x43')](_0x29437f[_0x64e8('0x42')][_0x64e8('0x43')]));_0x306d43['attributes']=_0x306d43['attributes'][_0x64e8('0x45')]?_0x306d43['attributes']:_0x2488d8['model'];if(!_0x29437f[_0x64e8('0x42')][_0x64e8('0x46')](_0x64e8('0x47'))){_0x306d43[_0x64e8('0x2b')]=qs[_0x64e8('0x2b')](_0x29437f[_0x64e8('0x42')]['limit']);_0x306d43['offset']=qs[_0x64e8('0x2d')](_0x29437f['query']['offset']);}_0x306d43[_0x64e8('0x67')]=qs[_0x64e8('0x48')](_0x29437f[_0x64e8('0x42')][_0x64e8('0x48')]);_0x306d43['where']=qs[_0x64e8('0x4a')](_[_0x64e8('0x49')](_0x29437f[_0x64e8('0x42')],_0x2488d8[_0x64e8('0x4a')]));_0x306d43['where']['ChatWebsiteId']=_0x1dfe2f['id'];if(_0x29437f[_0x64e8('0x42')][_0x64e8('0x4b')]){_0x306d43[_0x64e8('0x4d')]=_[_0x64e8('0x4c')](_0x306d43[_0x64e8('0x4d')],{'$or':_['map'](_0x306d43[_0x64e8('0x44')],function(_0x475896){var _0xd16d1f={};_0xd16d1f[_0x475896]={'$like':'%'+_0x29437f[_0x64e8('0x42')][_0x64e8('0x4b')]+'%'};return _0xd16d1f;})});}_0x306d43=_[_0x64e8('0x4c')]({},_0x306d43,_0x29437f[_0x64e8('0x4e')]);return db[_0x64e8('0x6c')][_0x64e8('0x2c')]({'where':_0x306d43[_0x64e8('0x4d')]})[_0x64e8('0x32')](function(_0x143ad7){_0x5a47b7[_0x64e8('0x2c')]=_0x143ad7;if(_0x29437f[_0x64e8('0x42')][_0x64e8('0x4f')]){_0x306d43['include']=[{'all':!![]}];}return db[_0x64e8('0x6c')][_0x64e8('0x50')](_0x306d43);})[_0x64e8('0x32')](function(_0x2f2ac8){_0x5a47b7[_0x64e8('0x68')]=_0x2f2ac8;return _0x5a47b7;});}})['then'](respondWithFilteredResult(_0x44b511,_0x306d43))['catch'](handleError(_0x44b511,null));};exports[_0x64e8('0x6d')]=function(_0x508564,_0x2f3315,_0x2b4203){return db[_0x64e8('0x3d')][_0x64e8('0x56')]({'where':{'id':_0x508564[_0x64e8('0x53')]['id']}})['then'](handleEntityNotFound(_0x2f3315,null))[_0x64e8('0x32')](function(_0x512e3c){if(_0x512e3c){return _0x512e3c['removeAnswers'](_0x508564[_0x64e8('0x42')][_0x64e8('0x6a')]);}})['then'](respondWithStatusCode(_0x2f3315,null))['catch'](handleError(_0x2f3315,null));};exports[_0x64e8('0x6e')]=function(_0x4457a9,_0x2bac49,_0x1105f8){_0x4457a9['body'][_0x64e8('0x6f')]=_0x4457a9[_0x64e8('0x70')][_0x64e8('0x71')];return db[_0x64e8('0x3d')][_0x64e8('0x56')]({'where':{'id':_0x4457a9[_0x64e8('0x53')]['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x2bac49,null))[_0x64e8('0x32')](saveUpdates(_0x4457a9[_0x64e8('0x58')],null))[_0x64e8('0x32')](respondWithResult(_0x2bac49,null))[_0x64e8('0x51')](handleError(_0x2bac49,null));};exports[_0x64e8('0x72')]=function(_0x287c44,_0x15e3b4,_0x24f68d){_0x287c44['body'][_0x64e8('0x73')]=_0x287c44[_0x64e8('0x70')]['filename'];return db[_0x64e8('0x3d')][_0x64e8('0x56')]({'where':{'id':_0x287c44[_0x64e8('0x53')]['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x15e3b4,null))[_0x64e8('0x32')](saveUpdates(_0x287c44[_0x64e8('0x58')],null))['then'](respondWithResult(_0x15e3b4,null))[_0x64e8('0x51')](handleError(_0x15e3b4,null));};exports['addCustomerAvatar']=function(_0x4665c4,_0x5ec7be,_0xaab468){_0x4665c4['body'][_0x64e8('0x74')]=_0x4665c4[_0x64e8('0x70')][_0x64e8('0x71')];return db[_0x64e8('0x3d')][_0x64e8('0x56')]({'where':{'id':_0x4665c4['params']['id']}})['then'](handleEntityNotFound(_0x5ec7be,null))[_0x64e8('0x32')](saveUpdates(_0x4665c4[_0x64e8('0x58')],null))[_0x64e8('0x32')](respondWithResult(_0x5ec7be,null))[_0x64e8('0x51')](handleError(_0x5ec7be,null));};exports['addSystemAvatar']=function(_0x3fdf9d,_0x433c02,_0x3d3bdf){_0x3fdf9d[_0x64e8('0x58')][_0x64e8('0x75')]=_0x3fdf9d[_0x64e8('0x70')][_0x64e8('0x71')];return db[_0x64e8('0x3d')][_0x64e8('0x56')]({'where':{'id':_0x3fdf9d[_0x64e8('0x53')]['id']}})['then'](handleEntityNotFound(_0x433c02,null))[_0x64e8('0x32')](saveUpdates(_0x3fdf9d[_0x64e8('0x58')],null))[_0x64e8('0x32')](respondWithResult(_0x433c02,null))[_0x64e8('0x51')](handleError(_0x433c02,null));};exports[_0x64e8('0x76')]=function(_0x144b1d,_0x46df56,_0x1cf8f1){var _0x2bf3e6=path['join'](config[_0x64e8('0x77')],_0x64e8('0x78'));var _0x255dd8={'where':{'id':_0x144b1d[_0x64e8('0x53')]['id']},'attributes':['id',_0x64e8('0x6f')],'raw':!![]};var _0x5628ee=![];return require(_0x64e8('0x16'))[_0x64e8('0x79')]()[_0x64e8('0x32')](function(_0x77798e){if(_0x77798e){_0x5628ee=_0x77798e['custom'];}})[_0x64e8('0x32')](function(){return db[_0x64e8('0x3d')]['find'](_0x255dd8);})['then'](handleEntityNotFound(_0x46df56,null))[_0x64e8('0x32')](function(_0x2ac87a){if(_0x2ac87a){if(!_[_0x64e8('0x7a')](_0x2ac87a[_0x64e8('0x6f')])){if(fs[_0x64e8('0x7b')](path[_0x64e8('0x7c')](config[_0x64e8('0x77')],_0x64e8('0x7d'),_0x2ac87a[_0x64e8('0x6f')]))&&_0x5628ee){_0x2bf3e6=path[_0x64e8('0x7c')](config[_0x64e8('0x77')],'server/files/images/logos/',_0x2ac87a[_0x64e8('0x6f')]);}}return _0x46df56[_0x64e8('0x7e')](_0x2bf3e6);}})['catch'](handleError(_0x46df56,null));};exports[_0x64e8('0x7f')]=function(_0x3d9620,_0x1cb06b,_0x2d47a6){var _0xbd573c=path['join'](config[_0x64e8('0x77')],'server/files/images/avatars/default_avatar.png');var _0x438109={'where':{'id':_0x3d9620['params']['id']},'attributes':['id',_0x64e8('0x73')],'raw':!![]};return db[_0x64e8('0x3d')][_0x64e8('0x56')](_0x438109)['then'](handleEntityNotFound(_0x1cb06b,null))[_0x64e8('0x32')](function(_0x122eac){if(_0x122eac){if(!_[_0x64e8('0x7a')](_0x122eac[_0x64e8('0x73')])){if(fs[_0x64e8('0x7b')](path[_0x64e8('0x7c')](config[_0x64e8('0x77')],'server/files/images/avatars/',_0x122eac[_0x64e8('0x73')]))){_0xbd573c=path[_0x64e8('0x7c')](config[_0x64e8('0x77')],'server/files/images/avatars/',_0x122eac[_0x64e8('0x73')]);}}return _0x1cb06b['download'](_0xbd573c);}})[_0x64e8('0x51')](handleError(_0x1cb06b,null));};exports[_0x64e8('0x80')]=function(_0x3aa25a,_0x34da1a,_0x5e0b5a){var _0x41a23=path[_0x64e8('0x7c')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0xb649cb={'where':{'id':_0x3aa25a['params']['id']},'attributes':['id',_0x64e8('0x74'),_0x64e8('0x81')],'raw':!![]};return db[_0x64e8('0x3d')]['find'](_0xb649cb)['then'](handleEntityNotFound(_0x34da1a,null))[_0x64e8('0x32')](function(_0x25bb48){if(_0x25bb48){if(!_[_0x64e8('0x7a')](_0x25bb48['customerAvatar'])){if(fs[_0x64e8('0x7b')](path[_0x64e8('0x7c')](config[_0x64e8('0x77')],_0x64e8('0x82'),_0x25bb48[_0x64e8('0x74')]))&&_0x25bb48[_0x64e8('0x81')]){_0x41a23=path[_0x64e8('0x7c')](config['root'],_0x64e8('0x82'),_0x25bb48['customerAvatar']);}}return _0x34da1a[_0x64e8('0x7e')](_0x41a23);}})[_0x64e8('0x51')](handleError(_0x34da1a,null));};exports[_0x64e8('0x83')]=function(_0x1e4658,_0x52cd34,_0x2fed9d){var _0x3e4926=path[_0x64e8('0x7c')](config[_0x64e8('0x77')],_0x64e8('0x84'));var _0x2deca2={'where':{'id':_0x1e4658[_0x64e8('0x53')]['id']},'attributes':['id',_0x64e8('0x75')],'raw':!![]};return db[_0x64e8('0x3d')][_0x64e8('0x56')](_0x2deca2)[_0x64e8('0x32')](handleEntityNotFound(_0x52cd34,null))[_0x64e8('0x32')](function(_0x5f0276){if(_0x5f0276){if(!_[_0x64e8('0x7a')](_0x5f0276['systemAvatar'])){if(fs[_0x64e8('0x7b')](path['join'](config[_0x64e8('0x77')],_0x64e8('0x82'),_0x5f0276['systemAvatar']))){_0x3e4926=path[_0x64e8('0x7c')](config['root'],_0x64e8('0x82'),_0x5f0276['systemAvatar']);}}return _0x52cd34[_0x64e8('0x7e')](_0x3e4926);}})[_0x64e8('0x51')](handleError(_0x52cd34,null));};exports[_0x64e8('0x85')]=function(_0x4a63eb,_0x2953f7,_0x318e2f){var _0x3d06be=require('user-agent-parser');var _0x4dbfc1=new _0x3d06be();var _0xb86732=_0x4dbfc1[_0x64e8('0x86')](_0x4a63eb[_0x64e8('0x87')][_0x64e8('0x88')])['getResult']();var _0x229c09={'body':_0x4a63eb[_0x64e8('0x58')],'channel':_0x64e8('0x89')};var _0x176561=[];var _0x17b600=[];var _0x2295ab={};var _0x6ee1ff=![];return db['CmContact'][_0x64e8('0x60')]()[_0x64e8('0x32')](function(_0x120dcf){if(!_0x120dcf){throw new db[(_0x64e8('0x8a'))]['ValidationError'](_0x64e8('0x8b'));}_0x176561=_['difference'](_[_0x64e8('0x41')](_0x120dcf),[_0x64e8('0x8c'),_0x64e8('0x8d')]);_0x17b600=_[_0x64e8('0x8e')](_[_0x64e8('0x41')](_0x120dcf),[_0x64e8('0x8c'),_0x64e8('0x8d'),'CompanyId',_0x64e8('0x8f')]);if(_0x4a63eb[_0x64e8('0x58')]['id']){delete _0x4a63eb['body']['id'];}if(_['isNil'](_0x4a63eb[_0x64e8('0x58')][_0x64e8('0x90')])){throw new db['Sequelize'][(_0x64e8('0x91'))](_0x64e8('0x92'));}if(_['isNil'](_0x4a63eb[_0x64e8('0x58')][_0x64e8('0x58')])||_0x4a63eb[_0x64e8('0x58')]['body']===''){throw new db['Sequelize'][(_0x64e8('0x91'))](_0x64e8('0x93'));}if(_[_0x64e8('0x7a')](_0x4a63eb[_0x64e8('0x58')]['mapKey'])){throw new db['Sequelize'][(_0x64e8('0x91'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x17b600);}if(!_[_0x64e8('0x94')](_0x17b600,_0x4a63eb['body'][_0x64e8('0x95')])){throw new db[(_0x64e8('0x8a'))]['ValidationError'](_0x64e8('0x96')+_0x17b600);}_0x2295ab[_0x4a63eb[_0x64e8('0x58')][_0x64e8('0x95')]]=_0x4a63eb[_0x64e8('0x58')]['from'];})[_0x64e8('0x32')](function(){return db[_0x64e8('0x3d')][_0x64e8('0x56')]({'where':{'id':_0x4a63eb[_0x64e8('0x53')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x64e8('0x97')],'as':_0x64e8('0x98'),'where':_0x2295ab,'limit':0x1,'order':[[_0x64e8('0x8d'),_0x64e8('0x99')]]}]},{'model':db[_0x64e8('0x9a')],'as':_0x64e8('0x9b')}]});})[_0x64e8('0x32')](handleEntityNotFound(_0x2953f7,null))[_0x64e8('0x32')](function(_0x334503){if(_0x334503&&_0x334503['List']){_0x229c09['account']=_0x334503;_0x229c09['applications']=_0x334503['Applications'];_0x229c09[_0x64e8('0x9c')]=_0x334503['List'];_0x229c09[_0x64e8('0x9d')]=_[_0x64e8('0x9e')](_0x229c09['applications'],['priority'],[_0x64e8('0x9f')]);if(_0x229c09[_0x64e8('0xa0')]['Applications']){delete _0x229c09[_0x64e8('0xa0')][_0x64e8('0x9b')];}if(_0x229c09[_0x64e8('0xa0')][_0x64e8('0xa1')]&&_0x229c09[_0x64e8('0xa0')]['List']['Contacts'][_0x64e8('0x45')]){return _0x229c09[_0x64e8('0xa0')][_0x64e8('0xa1')][_0x64e8('0x98')][0x0];}var _0x480114=_[_0x64e8('0xa2')](_0x4a63eb[_0x64e8('0x58')],{'firstName':_0x4a63eb[_0x64e8('0x58')][_0x64e8('0x90')],'ListId':_0x334503['ListId']});_0x480114[_0x4a63eb[_0x64e8('0x58')][_0x64e8('0x95')]]=_0x4a63eb[_0x64e8('0x58')][_0x64e8('0x90')];return db[_0x64e8('0x97')]['create'](_0x480114,{'fields':_0x176561,'raw':!![]});}})[_0x64e8('0x32')](handleEntityNotFound(_0x2953f7,null))['then'](function(_0x4bb277){_0x229c09[_0x64e8('0xa3')]=_0x4bb277;var _0x11db9b=_0x4a63eb[_0x64e8('0x58')][_0x64e8('0xa4')];if(_0x4a63eb[_0x64e8('0x87')]['cf-connecting-ip']){_0x11db9b=_0x4a63eb['headers'][_0x64e8('0xa5')];}else if(_0x4a63eb['headers'][_0x64e8('0xa6')]){_0x11db9b=_[_0x64e8('0xa7')](_0x4a63eb['headers'][_0x64e8('0xa6')]['split'](','));}if(_0x4bb277){var _0x4e9abd={'ContactId':_0x4bb277['id'],'ChatWebsiteId':_0x4a63eb['params']['id'],'from':(_0x4bb277['firstName']||'')+'\x20'+(_0x4bb277[_0x64e8('0xa8')]||''),'customerIp':_0x11db9b,'customerPort':_0x4a63eb[_0x64e8('0x87')][_0x64e8('0xa9')]?_0x4a63eb[_0x64e8('0x87')]['x-real-port']:null,'referer':_0x4a63eb['body'][_0x64e8('0xaa')],'browserName':_0xb86732['browser'][_0x64e8('0x39')]&&_0xb86732[_0x64e8('0xab')]['version']?util[_0x64e8('0xac')]('%s\x20%s',_0xb86732[_0x64e8('0xab')][_0x64e8('0x39')],_0xb86732[_0x64e8('0xab')][_0x64e8('0xad')]):_0x64e8('0xae'),'browserVersion':_0xb86732[_0x64e8('0xab')]['version']||_0x64e8('0xae'),'osName':util[_0x64e8('0xac')](_0x64e8('0xaf'),_0xb86732['os']['name'],_0xb86732['os'][_0x64e8('0xad')]),'osVersion':_0xb86732['os'][_0x64e8('0xad')],'deviceModel':_0xb86732[_0x64e8('0xb0')]['model']&&_0xb86732[_0x64e8('0xb0')][_0x64e8('0xb1')]?util[_0x64e8('0xac')]('%s\x20%s\x20%s',_0xb86732[_0x64e8('0xb0')][_0x64e8('0x40')],_0xb86732[_0x64e8('0xb0')]['vendor'],_0xb86732[_0x64e8('0xb0')][_0x64e8('0x3e')]):null,'deviceVendor':_0xb86732[_0x64e8('0xb0')][_0x64e8('0xb1')],'deviceType':_0xb86732[_0x64e8('0xb0')][_0x64e8('0x3e')],'formData':JSON[_0x64e8('0x23')](_0x4a63eb['body'])};var _0x557d79={'ChatWebsiteId':_0x4a63eb[_0x64e8('0x53')]['id'],'closed':![]};if(_0x4a63eb[_0x64e8('0x58')][_0x64e8('0xb2')]){_0x557d79[_0x64e8('0xb2')]=_0x4a63eb[_0x64e8('0x58')][_0x64e8('0xb2')];return db[_0x64e8('0xb3')][_0x64e8('0x56')]({'where':_0x557d79})[_0x64e8('0x32')](function(_0x4ea4b9){if(_0x4ea4b9){return[_0x4ea4b9,![]];}_0x4e9abd[_0x64e8('0xb2')]=_0x4a63eb[_0x64e8('0x58')][_0x64e8('0xb2')];_0x4e9abd[_0x64e8('0xb4')]=_0x4a63eb[_0x64e8('0x58')]['externalUrl'];return db[_0x64e8('0xb3')][_0x64e8('0x57')](_0x4e9abd)[_0x64e8('0x32')](function(_0x58fb70){return[_0x58fb70,!![]];});});}_0x557d79[_0x64e8('0xb5')]=_0x4bb277['id'];if(_0x4a63eb[_0x64e8('0x58')][_0x64e8('0xb6')]&&_0x4a63eb[_0x64e8('0x58')][_0x64e8('0xb6')]['id']){_0x557d79['id']=_0x4a63eb[_0x64e8('0x58')]['interaction']['id'];return db['ChatInteraction'][_0x64e8('0x56')]({'where':_0x557d79})['then'](function(_0x21887e){if(_0x21887e){return[_0x21887e,![]];}return db[_0x64e8('0xb3')]['create'](_0x4e9abd)[_0x64e8('0x32')](function(_0x15967f){return[_0x15967f,!![]];});});}return db['ChatInteraction'][_0x64e8('0x57')](_0x4e9abd)[_0x64e8('0x32')](function(_0x770951){return[_0x770951,!![]];});}})[_0x64e8('0xb7')](function(_0x4bf5f8,_0x5c11d1){if(_0x4bf5f8){_0x6ee1ff=_0x5c11d1;if(!_0x5c11d1){var _0x315e6d={'from':(_0x229c09['contact'][_0x64e8('0xb8')]||'')+'\x20'+(_0x229c09[_0x64e8('0xa3')]['lastName']||'')};if(_0x4a63eb[_0x64e8('0x58')]['threadId']&&_0x4a63eb[_0x64e8('0x58')]['messageId']&&_0x4a63eb[_0x64e8('0x58')][_0x64e8('0xb2')]!=_0x4a63eb[_0x64e8('0x58')]['messageId']){_0x315e6d[_0x64e8('0xb2')]=_0x4a63eb[_0x64e8('0x58')][_0x64e8('0xb9')];}return _0x4bf5f8['update'](_0x315e6d);}else{return _0x4bf5f8;}}})['then'](function(_0xb05942){_0x229c09[_0x64e8('0xb6')]=_0xb05942[_0x64e8('0x34')]({'plain':!![]});_0x229c09['interaction'][_0x64e8('0xba')]=_0x6ee1ff;if(_0x229c09[_0x64e8('0xb6')]['created']){if(_0x229c09[_0x64e8('0xa0')][_0x64e8('0xbb')]){_0x229c09[_0x64e8('0x9d')][_0x64e8('0xbc')]({'id':0x0,'priority':_0x229c09[_0x64e8('0x9d')][_0x64e8('0x45')]+0x1,'app':_0x64e8('0xbd'),'appdata':_0x64e8('0xbe'),'interval':'*,*,*,*'});}}return db[_0x64e8('0xbf')][_0x64e8('0x57')]({'body':_0x4a63eb[_0x64e8('0x58')]['body'],'ChatWebsiteId':_0x4a63eb[_0x64e8('0x53')]['id'],'ChatInteractionId':_0xb05942['id'],'direction':'in','ContactId':_0x229c09[_0x64e8('0xa3')]['id'],'AttachmentId':_0x4a63eb[_0x64e8('0x58')]['AttachmentId']});})[_0x64e8('0x32')](function(_0x13accb){_0x229c09[_0x64e8('0x25')]=_0x13accb;if(_0x229c09[_0x64e8('0xb6')]['UserId']){return db[_0x64e8('0xc0')][_0x64e8('0x56')]({'attributes':['id',_0x64e8('0x39')],'where':{'id':_0x229c09[_0x64e8('0xb6')][_0x64e8('0xc1')]}})['then'](function(_0x36d01f){if(_0x36d01f){_0x229c09['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x36d01f[_0x64e8('0x39')]+','+(_0x229c09[_0x64e8('0xa0')]['waitForTheAssignedAgent']||0xa),'interval':_0x64e8('0xc2')});_0x229c09[_0x64e8('0xc3')]=!![];}return respondWithRpcPromise(_0x64e8('0xc4'),_0x64e8('0xc5'),_0x229c09);});}return respondWithRpcPromise(_0x64e8('0xc4'),_0x64e8('0xc5'),_0x229c09);})[_0x64e8('0x32')](function(_0x5ad0d7){respondWithRpcPromise(_0x64e8('0xc6'),_0x64e8('0xc6'),{'event':_0x64e8('0x85'),'message':_0x5ad0d7},client9002);return _0x5ad0d7;})[_0x64e8('0x32')](respondWithResult(_0x2953f7,null))['catch'](handleError(_0x2953f7,null));};exports['offline']=function(_0x4a9280,_0x312326,_0x530ffe){var _0xae97e1,_0xcc1dbe,_0x58d946;var _0x31c0ac=[];var _0x38d47c=[];var _0xe83b81={};var _0x43dea9=_0x4a9280[_0x64e8('0xc7')]||[];var _0x4128d7=[];var _0x10bbf4;return db['CmContact'][_0x64e8('0x60')]()[_0x64e8('0x32')](function(_0x350e64){if(!_0x350e64){throw new db[(_0x64e8('0x8a'))][(_0x64e8('0x91'))](_0x64e8('0x8b'));}_0x38d47c=_['difference'](_['keys'](_0x350e64),[_0x64e8('0x8c'),'updatedAt']);_0x31c0ac=_[_0x64e8('0x8e')](_[_0x64e8('0x41')](_0x350e64),[_0x64e8('0x8c'),'updatedAt',_0x64e8('0xc8'),_0x64e8('0x8f')]);if(_0x4a9280[_0x64e8('0x58')]['id']){delete _0x4a9280[_0x64e8('0x58')]['id'];}if(_[_0x64e8('0x7a')](_0x4a9280['body']['from'])){throw _0x312326['status'](0x1f4)[_0x64e8('0xc9')](new db[(_0x64e8('0x8a'))]['ValidationError'](_0x64e8('0x92')));}if(_['isNil'](_0x4a9280[_0x64e8('0x58')][_0x64e8('0x58')])||_0x4a9280['body'][_0x64e8('0x58')]===''){throw _0x312326[_0x64e8('0x28')](0x1f4)['send'](new db[(_0x64e8('0x8a'))][(_0x64e8('0x91'))](_0x64e8('0x93')));}if(_[_0x64e8('0x7a')](_0x4a9280[_0x64e8('0x58')][_0x64e8('0xca')])){throw _0x312326[_0x64e8('0x28')](0x1f4)['send'](new db['Sequelize'][(_0x64e8('0x91'))](_0x64e8('0xcb')+_0x31c0ac));}if(!_[_0x64e8('0x94')](_0x31c0ac,_0x4a9280[_0x64e8('0x58')][_0x64e8('0xca')])){throw _0x312326[_0x64e8('0x28')](0x1f4)[_0x64e8('0xc9')](new db[(_0x64e8('0x8a'))][(_0x64e8('0x91'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x31c0ac));}_0xe83b81[_0x4a9280[_0x64e8('0x58')][_0x64e8('0xca')]]=_0x4a9280['body'][_0x64e8('0x90')];})[_0x64e8('0x32')](function(){return db[_0x64e8('0x3d')][_0x64e8('0x56')]({'where':{'id':_0x4a9280['params']['id']},'include':[{'model':db[_0x64e8('0xcc')],'as':_0x64e8('0xa1')},{'model':db['MailAccount'],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x312326,null))[_0x64e8('0x32')](function(_0x26eee6){if(_0x26eee6&&_0x26eee6['List']){_0xcc1dbe=_0x26eee6;var _0xf37083=_['defaults'](_0x4a9280[_0x64e8('0x58')],{'firstName':_0x4a9280[_0x64e8('0x58')][_0x64e8('0x90')],'phone':_0x4a9280[_0x64e8('0x58')]['from'],'ListId':_0x26eee6[_0x64e8('0x8f')]});_0xf37083[_0x4a9280[_0x64e8('0x58')][_0x64e8('0xca')]]=_0x4a9280[_0x64e8('0x58')]['from'];return db['CmContact'][_0x64e8('0xcd')]({'where':_0xe83b81,'defaults':_0xf37083});}})[_0x64e8('0xb7')](function(_0x507657){if(_0x507657){_0x58d946=_0x507657;var _0x336ffb=fs[_0x64e8('0xce')](path[_0x64e8('0x7c')](config['root'],_0x64e8('0xcf')),_0x64e8('0xd0'));var _0x11213c=ejs[_0x64e8('0xd1')](_0x336ffb,{'body':_[_0x64e8('0xd2')](_0x4a9280[_0x64e8('0x58')][_0x64e8('0x58')]),'bodyTitle':_0xcc1dbe[_0x64e8('0xd3')]});return db['ChatOfflineMessage'][_0x64e8('0x57')]({'body':_0x11213c,'ContactId':_0x507657['id'],'ChatWebsiteId':_0xcc1dbe['id']});}})[_0x64e8('0x32')](function(_0x515537){_0x10bbf4=_0x515537;if(_0x43dea9[_0x64e8('0x45')]){var _0x259cf1=_0x43dea9[_0x64e8('0x3c')](function(_0x55ef48){return{'name':_0x55ef48['originalname'],'basename':_0x55ef48[_0x64e8('0x71')],'type':_0x55ef48[_0x64e8('0xd4')],'ChatOfflineMessageId':_0x515537['id']};});_0x4128d7=_0x259cf1[_0x64e8('0x3c')](_0x8a55b7=>{var _0x49d697={'filename':_0x8a55b7[_0x64e8('0x39')],'path':path[_0x64e8('0x7c')](config[_0x64e8('0x77')],_0x64e8('0xd5'),_0x64e8('0xc7'),_0x64e8('0xd6'),_0x64e8('0xd7'),_0x8a55b7[_0x64e8('0xd8')])};return _0x49d697;});if(!_0xcc1dbe[_0x64e8('0xd9')]){return db[_0x64e8('0xda')]['transaction'](function(_0x49470a){return db['Attachment'][_0x64e8('0xdb')](_0x259cf1,{'transaction':_0x49470a});});}}})[_0x64e8('0x32')](function(){if(_0x10bbf4){_0xae97e1=_0x10bbf4;return db['MailAccount']['findOne']({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x64e8('0xdc'),'raw':!![]}]});}})[_0x64e8('0x32')](function(_0x4b7170){if(_0x4b7170&&_0x4b7170[_0x64e8('0xdc')]&&_0xcc1dbe[_0x64e8('0xdd')]&&_0xcc1dbe[_0x64e8('0xde')]){var _0x5c0691={'tls':{'rejectUnauthorized':![]}};if(_0x4b7170[_0x64e8('0xdc')][_0x64e8('0xdf')]){_0x5c0691[_0x64e8('0xdf')]=_0x4b7170['Smtp'][_0x64e8('0xdf')];}else{_0x5c0691['host']=_0x4b7170[_0x64e8('0xdc')][_0x64e8('0xe0')];_0x5c0691['port']=_0x4b7170[_0x64e8('0xdc')][_0x64e8('0xe1')];_0x5c0691[_0x64e8('0xe2')]=_0x4b7170[_0x64e8('0xdc')][_0x64e8('0xe2')];}if(_0x4b7170['Smtp']['authentication']){_0x5c0691[_0x64e8('0xe3')]={'user':_0x4b7170[_0x64e8('0xdc')][_0x64e8('0x59')],'pass':_0x4b7170[_0x64e8('0xdc')][_0x64e8('0xe4')]};}return respondWithRpcPromise(_0x64e8('0xe5'),_0x64e8('0xe6'),{'account':_0x5c0691,'message':{'from':util[_0x64e8('0xac')]('\x22%s\x22\x20<%s>',_0x4b7170[_0x64e8('0x39')],_0x4b7170[_0x64e8('0xe7')]||_0x4b7170[_0x64e8('0xdc')][_0x64e8('0x59')]),'to':_0xcc1dbe[_0x64e8('0xde')],'subject':_0xcc1dbe[_0x64e8('0xe8')],'html':_0xae97e1[_0x64e8('0x58')],'attachments':_0x4128d7}},client9003)[_0x64e8('0x32')](function(){return _0xae97e1;})['catch'](function(_0x4e53cb){console[_0x64e8('0x24')](_0x4e53cb);});}})[_0x64e8('0x32')](function(){if(_0xcc1dbe&&_0xcc1dbe[_0x64e8('0xd9')]&&_0xcc1dbe[_0x64e8('0xe9')]){var _0x1fb4bb=[];if(_0x43dea9[_0x64e8('0x45')]){_0x1fb4bb=_0x43dea9['map'](function(_0xc22658){return{'name':_0xc22658['originalname'],'basename':_0xc22658[_0x64e8('0x71')],'type':_0xc22658[_0x64e8('0xd4')],'ChatOfflineMessageId':_0x10bbf4['id']};});}var _0x283fef;if(!_[_0x64e8('0x7a')](_0xcc1dbe[_0x64e8('0xea')])){var _0xc662b8=_[_0x64e8('0x3c')](_0x4a9280['body'],function(_0xa8c2b8){return _0xa8c2b8;});var _0x6d5e7f=_['toPairsIn'](_0xc662b8)[0x0];var _0x1b6032=_['mapValues'](_0x6d5e7f,function(_0x47f638){return _0x47f638;});_0x283fef=_0x1b6032[0x1][_0xcc1dbe['subjectOffline']];}var _0x320866={'from':_0x58d946[_0x64e8('0xe7')],'firstName':_0x58d946['firstName'],'lastName':_0x58d946[_0x64e8('0xa8')],'mapKey':_0x64e8('0xe7'),'message':{'from':_0x58d946[_0x64e8('0xe7')],'to':_0xcc1dbe[_0x64e8('0xeb')]['email'],'cc':'','subject':_[_0x64e8('0x7a')](_0x283fef)?_0xcc1dbe[_0x64e8('0xe8')]:_0x283fef,'messageId':'','sentAt':new Date(),'attach':_0x1fb4bb[_0x64e8('0x45')],'attachments':_0x1fb4bb,'originChannel':'Chat','ChatWebsiteId':_0xcc1dbe['id'],'ChatOfflineMessageId':_0xae97e1['id'],'originTo':_0xcc1dbe[_0x64e8('0xeb')][_0x64e8('0xe7')]},'body':_0xae97e1[_0x64e8('0x58')]};var _0x3b56f1={'account':{'id':_0xcc1dbe[_0x64e8('0xe9')]},'body':_0x320866,'log':_0x64e8('0xec')};return respondWithRpcPromise(_0x64e8('0xec'),_0x64e8('0xed'),_0x3b56f1,client9001)[_0x64e8('0x32')](function(){return _0xae97e1;})['catch'](function(_0x53c386){console[_0x64e8('0x24')](_0x53c386);});}return;})[_0x64e8('0x32')](function(){if(_0xae97e1){return _0xae97e1;}})[_0x64e8('0x32')](respondWithResult(_0x312326,null))[_0x64e8('0x51')](function(_0x33f57e){console[_0x64e8('0x24')](_0x64e8('0x51'),_0x33f57e);for(var _0x20f15e of _0x43dea9){var _0xf90ecb=path[_0x64e8('0x7c')](config['root'],_0x64e8('0xd5'),'files',_0x64e8('0xd6'),'offline-chat',_0x20f15e[_0x64e8('0x71')]);fs_extra[_0x64e8('0xee')](_0xf90ecb)[_0x64e8('0x51')](function(_0x75dbd4){console[_0x64e8('0x24')](_0x64e8('0xef'),_0xf90ecb,_0x75dbd4);});}});};exports[_0x64e8('0xf0')]=function(_0x369bbc,_0x48eaa9,_0x1a4ef7){return db[_0x64e8('0xb3')][_0x64e8('0x56')]({'where':{'id':_0x369bbc[_0x64e8('0x53')]['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x48eaa9,null))[_0x64e8('0x32')](function(_0xd02b03){if(_0xd02b03){return _0xd02b03[_0x64e8('0xf0')](_0x369bbc[_0x64e8('0x58')]['ids'],_[_0x64e8('0xf1')](_0x369bbc[_0x64e8('0x58')],[_0x64e8('0x6a'),'id'])||{});}})[_0x64e8('0x32')](respondWithResult(_0x48eaa9,null))[_0x64e8('0x51')](handleError(_0x48eaa9,null));};exports[_0x64e8('0xf2')]=function(_0x1f27bb,_0x91513a,_0x9e66a3){var _0x188fdb={'raw':![],'where':{}};var _0x5de474={};var _0x391230={'count':0x0,'rows':[]};return db[_0x64e8('0x3d')][_0x64e8('0x65')]({'where':{'id':_0x1f27bb['params']['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x91513a,null))[_0x64e8('0x32')](function(_0x27a126){if(_0x27a126){_0x5de474[_0x64e8('0x40')]=_[_0x64e8('0x41')](db[_0x64e8('0xb3')][_0x64e8('0x66')]);_0x5de474[_0x64e8('0x42')]=_[_0x64e8('0x41')](_0x1f27bb['query']);_0x5de474[_0x64e8('0x4a')]=_[_0x64e8('0x54')](_0x5de474[_0x64e8('0x40')],_0x5de474[_0x64e8('0x42')]);_0x188fdb[_0x64e8('0x44')]=_['intersection'](_0x5de474[_0x64e8('0x40')],qs[_0x64e8('0x43')](_0x1f27bb[_0x64e8('0x42')]['fields']));_0x188fdb[_0x64e8('0x44')]=_0x188fdb[_0x64e8('0x44')]['length']?_0x188fdb[_0x64e8('0x44')]:_0x5de474[_0x64e8('0x40')];if(!_0x1f27bb[_0x64e8('0x42')][_0x64e8('0x46')]('nolimit')){_0x188fdb['limit']=qs[_0x64e8('0x2b')](_0x1f27bb[_0x64e8('0x42')][_0x64e8('0x2b')]);_0x188fdb['offset']=qs['offset'](_0x1f27bb['query'][_0x64e8('0x2d')]);}_0x188fdb[_0x64e8('0x67')]=qs['sort'](_0x1f27bb[_0x64e8('0x42')][_0x64e8('0x48')]);_0x188fdb['where']=qs[_0x64e8('0x4a')](_[_0x64e8('0x49')](_0x1f27bb[_0x64e8('0x42')],_0x5de474['filters']));_0x188fdb['where'][_0x64e8('0x62')]=_0x27a126['id'];if(_0x1f27bb[_0x64e8('0x42')][_0x64e8('0x4b')]){_0x188fdb['where']=_[_0x64e8('0x4c')](_0x188fdb[_0x64e8('0x4d')],{'$or':_[_0x64e8('0x3c')](_0x188fdb['attributes'],function(_0x429375){var _0xac2ea8={};_0xac2ea8[_0x429375]={'$like':'%'+_0x1f27bb[_0x64e8('0x42')][_0x64e8('0x4b')]+'%'};return _0xac2ea8;})});}_0x188fdb=_[_0x64e8('0x4c')]({},_0x188fdb,_0x1f27bb[_0x64e8('0x4e')]);return db[_0x64e8('0xb3')][_0x64e8('0x2c')]({'where':_0x188fdb[_0x64e8('0x4d')]})[_0x64e8('0x32')](function(_0x136f4d){_0x391230['count']=_0x136f4d;if(_0x1f27bb[_0x64e8('0x42')][_0x64e8('0x4f')]){_0x188fdb[_0x64e8('0x55')]=[{'model':db['CmContact'],'as':_0x64e8('0xf3'),'required':![]},{'model':db[_0x64e8('0xc0')],'as':_0x64e8('0xf4'),'attributes':['name',_0x64e8('0xf5'),_0x64e8('0xf6')],'required':![]},{'model':db[_0x64e8('0xf7')],'as':_0x64e8('0xf8'),'attributes':['id',_0x64e8('0x39'),'color'],'where':_0x1f27bb['query'][_0x64e8('0xf9')]?{'id':_0x1f27bb[_0x64e8('0x42')]['tag']}:undefined,'required':_0x1f27bb[_0x64e8('0x42')][_0x64e8('0xf9')]?!![]:![]}];}return db[_0x64e8('0xb3')][_0x64e8('0x50')](_0x188fdb);})[_0x64e8('0x32')](function(_0x2c36a7){_0x391230[_0x64e8('0x68')]=_0x2c36a7;return _0x391230;});}})[_0x64e8('0x32')](respondWithFilteredResult(_0x91513a,_0x188fdb))[_0x64e8('0x51')](handleError(_0x91513a,null));};function iftimePromise(_0x6ed0f2,_0x3f57e4){return respondWithRpcPromise(_0x64e8('0xfa'),'getSnippet',{'command':_0x3f57e4['timezone']?util[_0x64e8('0xac')](_0x64e8('0xfb'),_0x6ed0f2['interval'],_0x3f57e4[_0x64e8('0xfc')]):util[_0x64e8('0xac')](_0x64e8('0xfd'),_0x6ed0f2[_0x64e8('0xfe')])},client9002)['then'](function(_0x5fbaf7){var _0x1800ec=_0x5fbaf7&&_0x5fbaf7[_0x64e8('0xff')](_0x64e8('0x100'))>=0x0?!![]:![];logger[_0x64e8('0x26')](_0x64e8('0x101'),_0x3f57e4['id'],_0x6ed0f2['id'],_0x6ed0f2['interval'],_0x1800ec?_0x64e8('0x102'):'OFFLINE',_0x3f57e4[_0x64e8('0xfc')]?_0x3f57e4[_0x64e8('0xfc')]:_0x64e8('0x103'));return _0x1800ec;})[_0x64e8('0x51')](function(_0x2f2323){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x3f57e4['id'],_0x6ed0f2['id'],_0x6ed0f2[_0x64e8('0xfe')],util['inspect'](_0x2f2323,{'showHidden':![],'depth':null}),_0x3f57e4['timezone']?_0x3f57e4[_0x64e8('0xfc')]:_0x64e8('0x103'));return![];});}exports[_0x64e8('0x104')]=function(_0x4dace5,_0x5b5734,_0x5cdcc8){var _0x4f28c4=0x0;var _0x46777d=0x0;var _0x517448=![];var _0x10bec7;var _0x36908f;return db['ChatWebsite']['find']({'where':{'id':_0x4dace5[_0x64e8('0x53')]['id']},'include':[{'model':db['Interval'],'as':_0x64e8('0x105'),'include':[{'model':db[_0x64e8('0x105')],'as':_0x64e8('0x106'),'attributes':['id',_0x64e8('0xfe')],'raw':!![]}]}]})[_0x64e8('0x32')](handleEntityNotFound(_0x5b5734,null))['then'](function(_0x2cb74e){if(_0x2cb74e){_0x10bec7=_0x2cb74e;return _0x2cb74e[_0x64e8('0x107')]({'raw':!![]});}})['then'](function(_0x22be08){if(_0x10bec7){if(_0x22be08){_0x36908f=_0x22be08;}}return require(_0x64e8('0x16'))[_0x64e8('0x79')]();})[_0x64e8('0x32')](function(_0x3a0b09){if(_0x3a0b09){_0x46777d=_0x3a0b09[_0x64e8('0x108')];_0x517448=_0x3a0b09['custom'];}})[_0x64e8('0x32')](function(){return db[_0x64e8('0xb3')][_0x64e8('0x2c')]({'where':{'closed':![]}});})[_0x64e8('0x32')](function(_0x39b02d){_0x4f28c4=_0x39b02d;if(_0x46777d&&_0x39b02d>_0x46777d){return db['License']['findOne']({'where':{'id':0x1}})[_0x64e8('0x32')](function(_0x443f37){if(_0x443f37){_0x443f37[_0x64e8('0x109')](_0x64e8('0x10a'));}});}})[_0x64e8('0x32')](function(){if(_0x10bec7['Interval']&&_0x10bec7['Interval'][_0x64e8('0x106')]){var _0x190f54=[];for(var _0xbb5d96=0x0;_0xbb5d96<_0x10bec7[_0x64e8('0x105')][_0x64e8('0x106')][_0x64e8('0x45')];_0xbb5d96++){var _0x28e916=_0x10bec7[_0x64e8('0x105')]['Intervals'][_0xbb5d96]['get']({'plain':!![]});_0x190f54[_0x64e8('0xbc')](iftimePromise(_0x28e916,_0x10bec7));}return BPromise[_0x64e8('0x10b')](_0x190f54)[_0x64e8('0x32')](function(_0x5695d7){return _['some'](_0x5695d7);});}else{return!![];}})[_0x64e8('0x32')](function(_0xc101bb){var _0x2e226a=fs[_0x64e8('0xce')](path[_0x64e8('0x7c')](config['root'],'server/files/chat/iframe.ejs'),_0x64e8('0xd0'));var _0x1fd4f4={'remote':_0x10bec7[_0x64e8('0x10c')],'query':querystring[_0x64e8('0x23')](_[_0x64e8('0x4c')](_0x10bec7[_0x64e8('0x34')]({'plain':!![]}),{'customerIp':_0x4dace5[_0x64e8('0x87')]['x-forwarded-for']||_0x4dace5[_0x64e8('0x87')]['x-real-ip']||_0x4dace5[_0x64e8('0x10d')][_0x64e8('0x10e')]||_0x4dace5['ip'],'referer':_0x4dace5[_0x64e8('0x87')]['referer'],'openedInteractions':_0x4f28c4,'maxInteractions':_0x46777d,'virtual':_0x517448['virtual'],'online':_0xc101bb,'custom':_0x517448}))['replace'](/'/g,'\x5c\x27')};_0x5b5734[_0x64e8('0xc9')](ejs[_0x64e8('0xd1')](Mustache['render'](_0x2e226a,_0x1fd4f4),{'proactiveActions':_0x36908f,'alignment':_0x10bec7[_0x64e8('0x10f')],'verticalAlignment':_0x10bec7[_0x64e8('0x110')],'div_color':_0x10bec7[_0x64e8('0x111')],'text_color':_0x10bec7['textColor'],'button_color':_0x10bec7[_0x64e8('0x112')],'background_color':_0x10bec7[_0x64e8('0x113')]}));})[_0x64e8('0x51')](handleError(_0x5b5734,null));};exports[_0x64e8('0x114')]=function(_0x599811,_0xe39d74,_0xf97a45){return db['ChatWebsite'][_0x64e8('0x65')]({'where':{'id':_0x599811[_0x64e8('0x53')]['id']}})['then'](handleEntityNotFound(_0xe39d74,null))[_0x64e8('0x32')](function(_0x58da83){if(_0x58da83){return db[_0x64e8('0xda')][_0x64e8('0x115')](function(_0x5917dd){return db[_0x64e8('0x9a')][_0x64e8('0x33')]({'where':{'ChatWebsiteId':_0x599811[_0x64e8('0x53')]['id']},'transaction':_0x5917dd})[_0x64e8('0x32')](function(_0x464016){var _0x5456eb=_[_0x64e8('0x3c')](_0x599811[_0x64e8('0x58')],function(_0x153157){_0x153157[_0x64e8('0x62')]=_0x599811[_0x64e8('0x53')]['id'];return _0x153157;});return db['ChatApplication']['bulkCreate'](_0x5456eb,{'transaction':_0x5917dd});});})[_0x64e8('0x32')](function(){return db[_0x64e8('0x9a')][_0x64e8('0x116')]({'where':{'ChatWebsiteId':_0x599811[_0x64e8('0x53')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0xe39d74,null))['catch'](handleError(_0xe39d74,null));};exports['getApplications']=function(_0x3136be,_0x55665f,_0x32dce4){var _0x4c00a3={};var _0x401654={};var _0x4fa7fa;var _0x3ae010;return db[_0x64e8('0x3d')][_0x64e8('0x65')]({'where':{'id':_0x3136be[_0x64e8('0x53')]['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x55665f,null))[_0x64e8('0x32')](function(_0x2b5ea1){if(_0x2b5ea1){_0x4fa7fa=_0x2b5ea1;_0x401654['model']=_[_0x64e8('0x41')](db[_0x64e8('0x9a')]['rawAttributes']);_0x401654['query']=_['keys'](_0x3136be[_0x64e8('0x42')]);_0x401654['filters']=_[_0x64e8('0x54')](_0x401654[_0x64e8('0x40')],_0x401654[_0x64e8('0x42')]);_0x4c00a3[_0x64e8('0x44')]=_[_0x64e8('0x54')](_0x401654[_0x64e8('0x40')],qs[_0x64e8('0x43')](_0x3136be['query'][_0x64e8('0x43')]));_0x4c00a3[_0x64e8('0x44')]=_0x4c00a3[_0x64e8('0x44')][_0x64e8('0x45')]?_0x4c00a3[_0x64e8('0x44')]:_0x401654[_0x64e8('0x40')];_0x4c00a3[_0x64e8('0x67')]=qs[_0x64e8('0x48')](_0x3136be[_0x64e8('0x42')][_0x64e8('0x48')]);_0x4c00a3[_0x64e8('0x4d')]=qs[_0x64e8('0x4a')](_[_0x64e8('0x49')](_0x3136be[_0x64e8('0x42')],_0x401654[_0x64e8('0x4a')]));if(_0x3136be[_0x64e8('0x42')][_0x64e8('0x4b')]){_0x4c00a3[_0x64e8('0x4d')]=_[_0x64e8('0x4c')](_0x4c00a3[_0x64e8('0x4d')],{'$or':_[_0x64e8('0x3c')](_0x4c00a3[_0x64e8('0x44')],function(_0x174237){var _0x503695={};_0x503695[_0x174237]={'$like':'%'+_0x3136be[_0x64e8('0x42')][_0x64e8('0x4b')]+'%'};return _0x503695;})});}_0x4c00a3=_[_0x64e8('0x4c')]({},_0x4c00a3,_0x3136be[_0x64e8('0x4e')]);return _0x4fa7fa[_0x64e8('0x117')](_0x4c00a3);}})[_0x64e8('0x32')](function(_0x5293a2){if(_0x5293a2){_0x3ae010=_0x5293a2['length'];if(!_0x3136be[_0x64e8('0x42')][_0x64e8('0x46')](_0x64e8('0x47'))){_0x4c00a3[_0x64e8('0x2b')]=qs[_0x64e8('0x2b')](_0x3136be[_0x64e8('0x42')][_0x64e8('0x2b')]);_0x4c00a3[_0x64e8('0x2d')]=qs[_0x64e8('0x2d')](_0x3136be[_0x64e8('0x42')][_0x64e8('0x2d')]);}return _0x4fa7fa[_0x64e8('0x117')](_0x4c00a3);}})['then'](function(_0x495ca4){if(_0x495ca4){return _0x495ca4?{'count':_0x3ae010,'rows':_0x495ca4}:null;}})[_0x64e8('0x32')](respondWithResult(_0x55665f,null))[_0x64e8('0x51')](handleError(_0x55665f,null));};exports[_0x64e8('0x118')]=function(_0x454f78,_0x42a02f,_0x26d3c5){return db[_0x64e8('0x119')][_0x64e8('0x56')]({'where':{'id':_0x454f78[_0x64e8('0x53')]['id']}})['then'](handleEntityNotFound(_0x42a02f,null))[_0x64e8('0x32')](function(_0x31d833){if(_0x31d833){return _0x31d833['addProactiveActions'](_0x454f78[_0x64e8('0x58')][_0x64e8('0x6a')],_[_0x64e8('0xf1')](_0x454f78[_0x64e8('0x58')],['ids','id'])||{});}})[_0x64e8('0x32')](respondWithResult(_0x42a02f,null))[_0x64e8('0x51')](handleError(_0x42a02f,null));};exports[_0x64e8('0x107')]=function(_0x2b5ac2,_0xc1782c,_0x256d2e){var _0x4a1b09={};var _0x268f10={};var _0xbc5036;var _0x4a313d;return db['ChatWebsite'][_0x64e8('0x65')]({'where':{'id':_0x2b5ac2[_0x64e8('0x53')]['id']}})['then'](handleEntityNotFound(_0xc1782c,null))['then'](function(_0x15d486){if(_0x15d486){_0xbc5036=_0x15d486;_0x268f10[_0x64e8('0x40')]=_[_0x64e8('0x41')](db[_0x64e8('0x11a')][_0x64e8('0x66')]);_0x268f10[_0x64e8('0x42')]=_[_0x64e8('0x41')](_0x2b5ac2[_0x64e8('0x42')]);_0x268f10[_0x64e8('0x4a')]=_[_0x64e8('0x54')](_0x268f10[_0x64e8('0x40')],_0x268f10[_0x64e8('0x42')]);_0x4a1b09[_0x64e8('0x44')]=_['intersection'](_0x268f10['model'],qs[_0x64e8('0x43')](_0x2b5ac2[_0x64e8('0x42')][_0x64e8('0x43')]));_0x4a1b09[_0x64e8('0x44')]=_0x4a1b09[_0x64e8('0x44')]['length']?_0x4a1b09[_0x64e8('0x44')]:_0x268f10[_0x64e8('0x40')];_0x4a1b09[_0x64e8('0x67')]=qs[_0x64e8('0x48')](_0x2b5ac2['query'][_0x64e8('0x48')]);_0x4a1b09['where']=qs[_0x64e8('0x4a')](_['pick'](_0x2b5ac2[_0x64e8('0x42')],_0x268f10[_0x64e8('0x4a')]));if(_0x2b5ac2[_0x64e8('0x42')]['filter']){_0x4a1b09['where']=_['merge'](_0x4a1b09['where'],{'$or':_[_0x64e8('0x3c')](_0x4a1b09['attributes'],function(_0x31f75){var _0x2b5354={};_0x2b5354[_0x31f75]={'$like':'%'+_0x2b5ac2[_0x64e8('0x42')][_0x64e8('0x4b')]+'%'};return _0x2b5354;})});}_0x4a1b09=_[_0x64e8('0x4c')]({},_0x4a1b09,_0x2b5ac2[_0x64e8('0x4e')]);return _0xbc5036[_0x64e8('0x107')](_0x4a1b09);}})[_0x64e8('0x32')](function(_0x24ff48){if(_0x24ff48){_0x4a313d=_0x24ff48['length'];if(!_0x2b5ac2['query'][_0x64e8('0x46')](_0x64e8('0x47'))){_0x4a1b09[_0x64e8('0x2b')]=qs[_0x64e8('0x2b')](_0x2b5ac2[_0x64e8('0x42')]['limit']);_0x4a1b09[_0x64e8('0x2d')]=qs[_0x64e8('0x2d')](_0x2b5ac2[_0x64e8('0x42')]['offset']);}return _0xbc5036[_0x64e8('0x107')](_0x4a1b09);}})[_0x64e8('0x32')](function(_0x50ca08){if(_0x50ca08){return _0x50ca08?{'count':_0x4a313d,'rows':_0x50ca08}:null;}})[_0x64e8('0x32')](respondWithResult(_0xc1782c,null))[_0x64e8('0x51')](handleError(_0xc1782c,null));};exports[_0x64e8('0x11b')]=function(_0x2f928a,_0x5388b6,_0x1194d6){var _0x3437c4=_0x2f928a[_0x64e8('0x42')][_0x64e8('0x11c')]===_0x64e8('0x11d')?_0x64e8('0x11e'):'onlineForm';return db[_0x64e8('0x3d')][_0x64e8('0x56')]({'attributes':['id',_0x3437c4],'where':{'id':_0x2f928a['params']['id']}})['then'](handleEntityNotFound(_0x5388b6,null))['then'](function(_0x3750b9){if(_0x3750b9){var _0x5dde5a=_0x3750b9[_0x3437c4];var _0x34893b=_0x5dde5a&&_0x5dde5a[_0x64e8('0x11f')]?_0x5dde5a[_0x64e8('0x11f')]:[];_0x5388b6[_0x64e8('0xc9')]({'fromKey':_[_0x64e8('0x7a')](_0x5dde5a['fromKey'])?undefined:_0x5dde5a[_0x64e8('0x120')],'count':_0x34893b[_0x64e8('0x45')],'rows':_0x34893b});}})['catch'](handleError(_0x5388b6,null));};exports[_0x64e8('0x121')]=function(_0x4b2877,_0x47ca04,_0x15a218){var _0x32e053={'raw':![],'where':{}};var _0x2b86e1={};var _0x2ffff4={'count':0x0,'rows':[]};return db[_0x64e8('0x3d')]['findOne']({'where':{'id':_0x4b2877[_0x64e8('0x53')]['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x47ca04,null))['then'](function(_0xe785f8){if(_0xe785f8){_0x2b86e1[_0x64e8('0x40')]=_[_0x64e8('0x41')](db[_0x64e8('0x122')]['rawAttributes']);_0x2b86e1[_0x64e8('0x42')]=_['keys'](_0x4b2877[_0x64e8('0x42')]);_0x2b86e1[_0x64e8('0x4a')]=_[_0x64e8('0x54')](_0x2b86e1[_0x64e8('0x40')],_0x2b86e1['query']);_0x32e053['attributes']=_[_0x64e8('0x54')](_0x2b86e1[_0x64e8('0x40')],qs[_0x64e8('0x43')](_0x4b2877[_0x64e8('0x42')]['fields']));_0x32e053[_0x64e8('0x44')]=_0x32e053[_0x64e8('0x44')][_0x64e8('0x45')]?_0x32e053[_0x64e8('0x44')]:_0x2b86e1['model'];if(!_0x4b2877[_0x64e8('0x42')][_0x64e8('0x46')](_0x64e8('0x47'))){_0x32e053['limit']=qs['limit'](_0x4b2877[_0x64e8('0x42')]['limit']);_0x32e053[_0x64e8('0x2d')]=qs[_0x64e8('0x2d')](_0x4b2877[_0x64e8('0x42')][_0x64e8('0x2d')]);}_0x32e053[_0x64e8('0x67')]=qs[_0x64e8('0x48')](_0x4b2877['query'][_0x64e8('0x48')]);_0x32e053[_0x64e8('0x4d')]=qs['filters'](_[_0x64e8('0x49')](_0x4b2877[_0x64e8('0x42')],_0x2b86e1['filters']));_0x32e053[_0x64e8('0x4d')][_0x64e8('0x62')]=_0xe785f8['id'];if(_0x4b2877[_0x64e8('0x42')][_0x64e8('0x4b')]){_0x32e053['where']=_[_0x64e8('0x4c')](_0x32e053[_0x64e8('0x4d')],{'$or':_[_0x64e8('0x3c')](_0x32e053[_0x64e8('0x44')],function(_0x231401){var _0x1c1926={};_0x1c1926[_0x231401]={'$like':'%'+_0x4b2877[_0x64e8('0x42')]['filter']+'%'};return _0x1c1926;})});}_0x32e053=_[_0x64e8('0x4c')]({},_0x32e053,_0x4b2877[_0x64e8('0x4e')]);return db[_0x64e8('0x122')][_0x64e8('0x2c')]({'where':_0x32e053['where']})[_0x64e8('0x32')](function(_0x2eef8b){_0x2ffff4[_0x64e8('0x2c')]=_0x2eef8b;if(_0x4b2877[_0x64e8('0x42')]['includeAll']){_0x32e053[_0x64e8('0x55')]=[{'all':!![]}];}else{_0x32e053[_0x64e8('0x55')]=[{'model':db[_0x64e8('0x97')],'as':_0x64e8('0xf3'),'required':![]},{'model':db[_0x64e8('0x123')],'as':_0x64e8('0x124'),'required':![]}];}return db['ChatOfflineMessage'][_0x64e8('0x50')](_0x32e053);})[_0x64e8('0x32')](function(_0x33492e){_0x2ffff4['rows']=_0x33492e;return _0x2ffff4;});}})['then'](respondWithFilteredResult(_0x47ca04,_0x32e053))['catch'](handleError(_0x47ca04,null));};exports['addAgents']=function(_0x57680d,_0x45298e,_0x211d2c){return db[_0x64e8('0x3d')][_0x64e8('0x56')]({'where':{'id':_0x57680d['params']['id']}})['then'](handleEntityNotFound(_0x45298e,null))['then'](function(_0x112e51){if(_0x112e51){return _0x112e51[_0x64e8('0x125')](_0x57680d[_0x64e8('0x58')]['ids'],_[_0x64e8('0xf1')](_0x57680d['body'],[_0x64e8('0x6a'),'id'])||{})[_0x64e8('0xb7')](function(_0x4905a2){for(var _0x6cde4f=0x0;_0x6cde4f<_0x57680d[_0x64e8('0x58')][_0x64e8('0x6a')][_0x64e8('0x45')];_0x6cde4f+=0x1){socket[_0x64e8('0x126')](_0x64e8('0x127'),{'UserId':Number(_0x57680d[_0x64e8('0x58')][_0x64e8('0x6a')][_0x6cde4f]),'ChatWebsiteId':Number(_0x57680d[_0x64e8('0x53')]['id'])});}return _0x4905a2;});}})['then'](respondWithResult(_0x45298e,null))[_0x64e8('0x51')](handleError(_0x45298e,null));};exports[_0x64e8('0x128')]=function(_0x12d95e,_0x311c73,_0x343cb6){return db['ChatWebsite']['find']({'where':{'id':_0x12d95e[_0x64e8('0x53')]['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x311c73,null))[_0x64e8('0x32')](function(_0xbb6f15){if(_0xbb6f15){return _0xbb6f15[_0x64e8('0x128')](_0x12d95e[_0x64e8('0x42')][_0x64e8('0x6a')])[_0x64e8('0x32')](function(){if(_[_0x64e8('0x129')](_0x12d95e[_0x64e8('0x42')][_0x64e8('0x6a')])){for(var _0x52ead2=0x0;_0x52ead2<_0x12d95e[_0x64e8('0x42')]['ids']['length'];_0x52ead2+=0x1){socket[_0x64e8('0x126')](_0x64e8('0x12a'),{'UserId':Number(_0x12d95e[_0x64e8('0x42')][_0x64e8('0x6a')][_0x52ead2]),'ChatWebsiteId':Number(_0x12d95e[_0x64e8('0x53')]['id'])});}}else{socket[_0x64e8('0x126')](_0x64e8('0x12a'),{'UserId':Number(_0x12d95e['query'][_0x64e8('0x6a')]),'ChatWebsiteId':Number(_0x12d95e[_0x64e8('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x311c73,null))['catch'](handleError(_0x311c73,null));};exports[_0x64e8('0x12b')]=function(_0x166bbc,_0x1d4af0,_0x3d9c27){var _0x3458bf={};var _0x23fada={};var _0x2adfbc;var _0x5ae058;return db[_0x64e8('0x3d')][_0x64e8('0x65')]({'where':{'id':_0x166bbc[_0x64e8('0x53')]['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x1d4af0,null))[_0x64e8('0x32')](function(_0x2333a8){if(_0x2333a8){_0x2adfbc=_0x2333a8;_0x23fada[_0x64e8('0x40')]=_[_0x64e8('0x41')](db[_0x64e8('0xc0')]['rawAttributes']);_0x23fada['query']=_[_0x64e8('0x41')](_0x166bbc['query']);_0x23fada[_0x64e8('0x4a')]=_[_0x64e8('0x54')](_0x23fada[_0x64e8('0x40')],_0x23fada[_0x64e8('0x42')]);_0x3458bf['attributes']=_[_0x64e8('0x54')](_0x23fada['model'],qs['fields'](_0x166bbc[_0x64e8('0x42')][_0x64e8('0x43')]));_0x3458bf['attributes']=_0x3458bf[_0x64e8('0x44')][_0x64e8('0x45')]?_0x3458bf[_0x64e8('0x44')]:_0x23fada[_0x64e8('0x40')];_0x3458bf['order']=qs['sort'](_0x166bbc['query']['sort']);_0x3458bf[_0x64e8('0x4d')]=qs['filters'](_[_0x64e8('0x49')](_0x166bbc[_0x64e8('0x42')],_0x23fada['filters']));if(_0x166bbc[_0x64e8('0x42')][_0x64e8('0x4b')]){_0x3458bf[_0x64e8('0x4d')]=_[_0x64e8('0x4c')](_0x3458bf[_0x64e8('0x4d')],{'$or':_[_0x64e8('0x3c')](_0x3458bf[_0x64e8('0x44')],function(_0x1abd0e){var _0x42e054={};_0x42e054[_0x1abd0e]={'$like':'%'+_0x166bbc['query'][_0x64e8('0x4b')]+'%'};return _0x42e054;})});}_0x3458bf=_[_0x64e8('0x4c')]({},_0x3458bf,_0x166bbc['options']);return _0x2adfbc[_0x64e8('0x12b')](_0x3458bf);}})[_0x64e8('0x32')](function(_0x46a115){if(_0x46a115){_0x5ae058=_0x46a115[_0x64e8('0x45')];if(!_0x166bbc[_0x64e8('0x42')][_0x64e8('0x46')](_0x64e8('0x47'))){_0x3458bf[_0x64e8('0x2b')]=qs[_0x64e8('0x2b')](_0x166bbc[_0x64e8('0x42')][_0x64e8('0x2b')]);_0x3458bf[_0x64e8('0x2d')]=qs[_0x64e8('0x2d')](_0x166bbc[_0x64e8('0x42')]['offset']);}return _0x2adfbc[_0x64e8('0x12b')](_0x3458bf);}})['then'](function(_0x54c139){if(_0x54c139){return _0x54c139?{'count':_0x5ae058,'rows':_0x54c139}:null;}})[_0x64e8('0x32')](respondWithResult(_0x1d4af0,null))[_0x64e8('0x51')](handleError(_0x1d4af0,null));};
\ No newline at end of file
+var _0xa595=['format','%s\x20%s','unknown','version','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','ContactId','interaction','messageId','created','close','unmanaged','ChatMessage','contact','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','no\x20available\x20attributes','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','utf8','render','toPairs','ChatOfflineMessage','mimetype','server','files','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','sendMail','email','offlineMessageSubject','MailAccountId','subjectOffline','mapValues','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','fullname','internal','Tag','Tags','color','tag','Command','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','custom','License','increment','chatLicenseExceeded','push','all','some','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','verticalAlignment','color_button','backgroundColor','addApplications','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','eml-format','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./chatWebsite.socket','jayson/promise','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','update','ChatWebsites','UserProfileResource','destroy','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','ChatWebsite','includeAll','include','findAll','rows','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','pick','Disposition','removeDispositions','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','ids','addLogo','file','addAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','getLicense','isNil','sitepic','existsSync','server/files/images/logos/','download','getAvatar','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','Sequelize','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','Contacts','from','customerIp','cf-connecting-ip','first','split','firstName','lastName','x-real-port','referer','browser'];(function(_0x9cf85e,_0x3b53c2){var _0x31ac45=function(_0xd9dc7){while(--_0xd9dc7){_0x9cf85e['push'](_0x9cf85e['shift']());}};_0x31ac45(++_0x3b53c2);}(_0xa595,0x1ac));var _0x5a59=function(_0x27dc9c,_0x19aa82){_0x27dc9c=_0x27dc9c-0x0;var _0x3201dc=_0xa595[_0x27dc9c];return _0x3201dc;};'use strict';var emlformat=require(_0x5a59('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5a59('0x1'));var rp=require(_0x5a59('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5a59('0x3'));var util=require('util');var path=require(_0x5a59('0x4'));var sox=require(_0x5a59('0x5'));var csv=require(_0x5a59('0x6'));var ejs=require(_0x5a59('0x7'));var fs=require('fs');var fs_extra=require(_0x5a59('0x8'));var _=require(_0x5a59('0x9'));var squel=require(_0x5a59('0xa'));var crypto=require(_0x5a59('0xb'));var jsforce=require(_0x5a59('0xc'));var deskjs=require(_0x5a59('0xd'));var toCsv=require(_0x5a59('0x6'));var querystring=require(_0x5a59('0xe'));var Papa=require('papaparse');var Redis=require(_0x5a59('0xf'));var authService=require(_0x5a59('0x10'));var qs=require(_0x5a59('0x11'));var as=require(_0x5a59('0x12'));var hardwareService=require(_0x5a59('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x5a59('0x14'));var config=require(_0x5a59('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5a59('0x16'))['db'];config[_0x5a59('0x17')]=_[_0x5a59('0x18')](config[_0x5a59('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5a59('0x17')]));require(_0x5a59('0x19'))['register'](socket);var jayson=require(_0x5a59('0x1a'));var client=jayson['client'][_0x5a59('0x1b')]({'port':0x232c});var client9002=jayson[_0x5a59('0x1c')][_0x5a59('0x1b')]({'port':0x232a});var client9003=jayson[_0x5a59('0x1c')][_0x5a59('0x1b')]({'port':0x232b});var client9001=jayson['client'][_0x5a59('0x1b')]({'port':0x2329});function respondWithRpcPromise(_0x58567d,_0x1fd4e1,_0x59a395,_0x51a1c2){return new BPromise(function(_0x428730,_0x5db658){var _0x4bd0e7=_0x51a1c2||client;return _0x4bd0e7[_0x5a59('0x1d')](_0x58567d,_0x59a395)[_0x5a59('0x1e')](function(_0x3d5c51){logger[_0x5a59('0x1f')](_0x5a59('0x20'),_0x1fd4e1,_0x5a59('0x21'));logger[_0x5a59('0x22')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1fd4e1,'request\x20sent',JSON[_0x5a59('0x23')](_0x3d5c51));if(_0x3d5c51[_0x5a59('0x24')]){if(_0x3d5c51['error'][_0x5a59('0x25')]===0x1f4){logger['error'](_0x5a59('0x20'),_0x1fd4e1,_0x3d5c51[_0x5a59('0x24')][_0x5a59('0x26')]);return _0x5db658(_0x3d5c51[_0x5a59('0x24')]['message']);}logger[_0x5a59('0x24')](_0x5a59('0x20'),_0x1fd4e1,_0x3d5c51[_0x5a59('0x24')][_0x5a59('0x26')]);return _0x428730(_0x3d5c51[_0x5a59('0x24')]['message']);}else{logger['info'](_0x5a59('0x20'),_0x1fd4e1,_0x5a59('0x21'));_0x428730(_0x3d5c51[_0x5a59('0x27')][_0x5a59('0x26')]);}})[_0x5a59('0x28')](function(_0x2822ac){logger['error'](_0x5a59('0x20'),_0x1fd4e1,_0x2822ac);_0x5db658(_0x2822ac);});});}function respondWithStatusCode(_0x38e236,_0x2909ea){_0x2909ea=_0x2909ea||0xcc;return function(_0x14eda2){if(_0x14eda2){return _0x38e236[_0x5a59('0x29')](_0x2909ea);}return _0x38e236[_0x5a59('0x2a')](_0x2909ea)[_0x5a59('0x2b')]();};}function respondWithResult(_0xee7dae,_0x422f35){_0x422f35=_0x422f35||0xc8;return function(_0xac585d){if(_0xac585d){return _0xee7dae[_0x5a59('0x2a')](_0x422f35)[_0x5a59('0x2c')](_0xac585d);}};}function respondWithFilteredResult(_0x5bb467,_0x4e61cd){return function(_0x41ac2a){if(_0x41ac2a){var _0x220a02=typeof _0x4e61cd[_0x5a59('0x2d')]===_0x5a59('0x2e')&&typeof _0x4e61cd['limit']===_0x5a59('0x2e');var _0x45e0b2=_0x41ac2a['count'];var _0x274c3b=_0x220a02?0x0:_0x4e61cd[_0x5a59('0x2d')];var _0x50630d=_0x220a02?_0x41ac2a[_0x5a59('0x2f')]:_0x4e61cd[_0x5a59('0x2d')]+_0x4e61cd[_0x5a59('0x30')];var _0x5bf673;if(_0x50630d>=_0x45e0b2){_0x50630d=_0x45e0b2;_0x5bf673=0xc8;}else{_0x5bf673=0xce;}_0x5bb467['status'](_0x5bf673);return _0x5bb467['set'](_0x5a59('0x31'),_0x274c3b+'-'+_0x50630d+'/'+_0x45e0b2)[_0x5a59('0x2c')](_0x41ac2a);}return null;};}function patchUpdates(_0x3e0287){return function(_0x79df4b){try{jsonpatch[_0x5a59('0x32')](_0x79df4b,_0x3e0287,!![]);}catch(_0x2a7a71){return BPromise['reject'](_0x2a7a71);}return _0x79df4b['save']();};}function saveUpdates(_0x343385,_0x5ad5cf){return function(_0x175a8b){if(_0x175a8b){return _0x175a8b[_0x5a59('0x33')](_0x343385)['then'](function(_0x428658){return _0x428658;});}return null;};}function removeEntity(_0x3f03d6,_0x2a40e3){return function(_0x37b969){if(_0x37b969){return _0x37b969['destroy']()[_0x5a59('0x1e')](function(){var _0x2efbde=_0x37b969['get']({'plain':!![]});var _0x1cf7e8=_0x5a59('0x34');return db[_0x5a59('0x35')][_0x5a59('0x36')]({'where':{'type':_0x1cf7e8,'resourceId':_0x2efbde['id']}})[_0x5a59('0x1e')](function(){return _0x37b969;});})['then'](function(){_0x3f03d6[_0x5a59('0x2a')](0xcc)[_0x5a59('0x2b')]();});}};}function handleEntityNotFound(_0x285483,_0x2318bc){return function(_0x1ad2db){if(!_0x1ad2db){_0x285483[_0x5a59('0x29')](0x194);}return _0x1ad2db;};}function handleError(_0x407b80,_0x24250b){_0x24250b=_0x24250b||0x1f4;return function(_0x56aa75){logger[_0x5a59('0x24')](_0x56aa75['stack']);if(_0x56aa75[_0x5a59('0x37')]){delete _0x56aa75[_0x5a59('0x37')];}_0x407b80[_0x5a59('0x2a')](_0x24250b)[_0x5a59('0x38')](_0x56aa75);};}exports[_0x5a59('0x39')]=function(_0x303522,_0x4c4f4){var _0x13f1d8={'include':[{'model':db[_0x5a59('0x3a')],'as':_0x5a59('0x3b')}]},_0x3b4f19={},_0xa62e88={'count':0x0,'rows':[]};var _0x2a1ddd=_[_0x5a59('0x3c')](db['ChatWebsite'][_0x5a59('0x3d')],function(_0x2bd7cd){return{'name':_0x2bd7cd['fieldName'],'type':_0x2bd7cd[_0x5a59('0x3e')]['key']};});_0x3b4f19[_0x5a59('0x3f')]=_['map'](_0x2a1ddd,_0x5a59('0x37'));_0x3b4f19[_0x5a59('0x40')]=_[_0x5a59('0x41')](_0x303522[_0x5a59('0x40')]);_0x3b4f19[_0x5a59('0x42')]=_['intersection'](_0x3b4f19[_0x5a59('0x3f')],_0x3b4f19[_0x5a59('0x40')]);_0x13f1d8[_0x5a59('0x43')]=_[_0x5a59('0x44')](_0x3b4f19['model'],qs[_0x5a59('0x45')](_0x303522[_0x5a59('0x40')][_0x5a59('0x45')]));_0x13f1d8[_0x5a59('0x43')]=_0x13f1d8[_0x5a59('0x43')][_0x5a59('0x46')]?_0x13f1d8[_0x5a59('0x43')]:_0x3b4f19[_0x5a59('0x3f')];if(!_0x303522['query'][_0x5a59('0x47')]('nolimit')){_0x13f1d8[_0x5a59('0x30')]=qs[_0x5a59('0x30')](_0x303522['query'][_0x5a59('0x30')]);_0x13f1d8[_0x5a59('0x2d')]=qs[_0x5a59('0x2d')](_0x303522[_0x5a59('0x40')][_0x5a59('0x2d')]);}_0x13f1d8[_0x5a59('0x48')]=qs[_0x5a59('0x49')](_0x303522[_0x5a59('0x40')][_0x5a59('0x49')]);_0x13f1d8['where']=qs[_0x5a59('0x42')](_['pick'](_0x303522[_0x5a59('0x40')],_0x3b4f19[_0x5a59('0x42')]),_0x2a1ddd);if(_0x303522[_0x5a59('0x40')][_0x5a59('0x4a')]){_0x13f1d8[_0x5a59('0x4b')]=_[_0x5a59('0x4c')](_0x13f1d8[_0x5a59('0x4b')],{'$or':_[_0x5a59('0x3c')](_0x2a1ddd,function(_0xfd3d47){if(_0xfd3d47['type']!==_0x5a59('0x4d')){var _0x3f7819={};_0x3f7819[_0xfd3d47[_0x5a59('0x37')]]={'$like':'%'+_0x303522[_0x5a59('0x40')]['filter']+'%'};return _0x3f7819;}})});}_0x13f1d8=_[_0x5a59('0x4c')]({},_0x13f1d8,_0x303522[_0x5a59('0x4e')]);var _0x38de76={'where':_0x13f1d8[_0x5a59('0x4b')]};return db[_0x5a59('0x4f')][_0x5a59('0x2f')](_0x38de76)[_0x5a59('0x1e')](function(_0x137e8c){_0xa62e88[_0x5a59('0x2f')]=_0x137e8c;if(_0x303522[_0x5a59('0x40')][_0x5a59('0x50')]){_0x13f1d8[_0x5a59('0x51')]=[{'all':!![]}];}return db[_0x5a59('0x4f')][_0x5a59('0x52')](_0x13f1d8);})['then'](function(_0x2f79ea){_0xa62e88[_0x5a59('0x53')]=_0x2f79ea;return _0xa62e88;})[_0x5a59('0x1e')](respondWithFilteredResult(_0x4c4f4,_0x13f1d8))['catch'](handleError(_0x4c4f4,null));};exports['show']=function(_0x21d8d1,_0x266b1e){var _0xbb4a17={'raw':![],'where':{'id':_0x21d8d1[_0x5a59('0x54')]['id']},'include':[{'model':db[_0x5a59('0x3a')],'as':'mandatoryDispositionPause'}]},_0x1e2725={};_0x1e2725[_0x5a59('0x3f')]=_[_0x5a59('0x41')](db[_0x5a59('0x4f')][_0x5a59('0x3d')]);_0x1e2725[_0x5a59('0x40')]=_[_0x5a59('0x41')](_0x21d8d1['query']);_0x1e2725[_0x5a59('0x42')]=_[_0x5a59('0x44')](_0x1e2725[_0x5a59('0x3f')],_0x1e2725[_0x5a59('0x40')]);_0xbb4a17[_0x5a59('0x43')]=_[_0x5a59('0x44')](_0x1e2725['model'],qs[_0x5a59('0x45')](_0x21d8d1[_0x5a59('0x40')][_0x5a59('0x45')]));_0xbb4a17[_0x5a59('0x43')]=_0xbb4a17[_0x5a59('0x43')]['length']?_0xbb4a17[_0x5a59('0x43')]:_0x1e2725[_0x5a59('0x3f')];if(_0x21d8d1[_0x5a59('0x40')][_0x5a59('0x50')]){_0xbb4a17[_0x5a59('0x51')]=[{'all':!![]}];}_0xbb4a17=_[_0x5a59('0x4c')]({},_0xbb4a17,_0x21d8d1[_0x5a59('0x4e')]);return db[_0x5a59('0x4f')][_0x5a59('0x55')](_0xbb4a17)['then'](handleEntityNotFound(_0x266b1e,null))[_0x5a59('0x1e')](respondWithResult(_0x266b1e,null))[_0x5a59('0x28')](handleError(_0x266b1e,null));};exports[_0x5a59('0x56')]=function(_0x415cb5,_0x1699dd){return db[_0x5a59('0x4f')][_0x5a59('0x56')](_0x415cb5[_0x5a59('0x57')],{})['then'](function(_0x42eef0){var _0x2b5a20=_0x415cb5[_0x5a59('0x58')]['get']({'plain':!![]});if(!_0x2b5a20)throw new Error(_0x5a59('0x59'));if(_0x2b5a20['role']==='user'){var _0x433b87=_0x42eef0[_0x5a59('0x5a')]({'plain':!![]});var _0xfe5e6c='ChatWebsites';return db[_0x5a59('0x5b')][_0x5a59('0x55')]({'where':{'name':_0xfe5e6c,'userProfileId':_0x2b5a20['userProfileId']},'raw':!![]})[_0x5a59('0x1e')](function(_0x23f6c9){if(_0x23f6c9&&_0x23f6c9['autoAssociation']===0x0){return db[_0x5a59('0x35')]['create']({'name':_0x433b87['name'],'resourceId':_0x433b87['id'],'type':_0x23f6c9[_0x5a59('0x37')],'sectionId':_0x23f6c9['id']},{})[_0x5a59('0x1e')](function(){return _0x42eef0;});}else{return _0x42eef0;}})[_0x5a59('0x28')](function(_0x182fff){logger[_0x5a59('0x24')](_0x5a59('0x5c'),_0x182fff);throw _0x182fff;});}return _0x42eef0;})[_0x5a59('0x1e')](respondWithResult(_0x1699dd,0xc9))[_0x5a59('0x28')](handleError(_0x1699dd,null));};exports[_0x5a59('0x33')]=function(_0x38d833,_0x55ddbb){if(_0x38d833[_0x5a59('0x57')]['id']){delete _0x38d833['body']['id'];}return db[_0x5a59('0x4f')]['find']({'where':{'id':_0x38d833[_0x5a59('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0x5a59('0x3b')}]})[_0x5a59('0x1e')](handleEntityNotFound(_0x55ddbb,null))[_0x5a59('0x1e')](saveUpdates(_0x38d833[_0x5a59('0x57')],null))[_0x5a59('0x1e')](respondWithResult(_0x55ddbb,null))['catch'](handleError(_0x55ddbb,null));};exports[_0x5a59('0x36')]=function(_0x15691b,_0x2c5238){return db[_0x5a59('0x4f')]['find']({'where':{'id':_0x15691b['params']['id']}})['then'](handleEntityNotFound(_0x2c5238,null))[_0x5a59('0x1e')](removeEntity(_0x2c5238,null))[_0x5a59('0x28')](handleError(_0x2c5238,null));};exports[_0x5a59('0x5d')]=function(_0x2fd297,_0x466e32){return db[_0x5a59('0x4f')][_0x5a59('0x5d')]()[_0x5a59('0x1e')](respondWithResult(_0x466e32,null))[_0x5a59('0x28')](handleError(_0x466e32,null));};exports[_0x5a59('0x5e')]=function(_0x546701,_0x51469e,_0x2fa6b7){if(_0x546701[_0x5a59('0x57')]['id']){delete _0x546701[_0x5a59('0x57')]['id'];}return db[_0x5a59('0x4f')]['find']({'where':{'id':_0x546701[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x51469e,null))[_0x5a59('0x1e')](function(_0x2b5965){if(_0x2b5965){_0x546701[_0x5a59('0x57')][_0x5a59('0x5f')]=_0x2b5965['id'];return db['Disposition'][_0x5a59('0x56')](_0x546701['body']);}})['then'](respondWithResult(_0x51469e,null))[_0x5a59('0x28')](handleError(_0x51469e,null));};exports[_0x5a59('0x60')]=function(_0x45b785,_0x16392e,_0x3cecd3){var _0x365ea8={'raw':![],'where':{}};var _0x5aec1f={};var _0x147114={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x5a59('0x61')]({'where':{'id':_0x45b785[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x16392e,null))['then'](function(_0x952eba){if(_0x952eba){_0x5aec1f[_0x5a59('0x3f')]=_[_0x5a59('0x41')](db['Disposition'][_0x5a59('0x3d')]);_0x5aec1f[_0x5a59('0x40')]=_[_0x5a59('0x41')](_0x45b785['query']);_0x5aec1f[_0x5a59('0x42')]=_['intersection'](_0x5aec1f[_0x5a59('0x3f')],_0x5aec1f[_0x5a59('0x40')]);_0x365ea8[_0x5a59('0x43')]=_['intersection'](_0x5aec1f[_0x5a59('0x3f')],qs[_0x5a59('0x45')](_0x45b785[_0x5a59('0x40')]['fields']));_0x365ea8['attributes']=_0x365ea8[_0x5a59('0x43')][_0x5a59('0x46')]?_0x365ea8[_0x5a59('0x43')]:_0x5aec1f['model'];if(!_0x45b785[_0x5a59('0x40')][_0x5a59('0x47')]('nolimit')){_0x365ea8['limit']=qs[_0x5a59('0x30')](_0x45b785[_0x5a59('0x40')]['limit']);_0x365ea8['offset']=qs[_0x5a59('0x2d')](_0x45b785[_0x5a59('0x40')]['offset']);}_0x365ea8[_0x5a59('0x48')]=qs[_0x5a59('0x49')](_0x45b785['query']['sort']);_0x365ea8['where']=qs['filters'](_[_0x5a59('0x62')](_0x45b785[_0x5a59('0x40')],_0x5aec1f[_0x5a59('0x42')]));_0x365ea8['where'][_0x5a59('0x5f')]=_0x952eba['id'];if(_0x45b785[_0x5a59('0x40')][_0x5a59('0x4a')]){_0x365ea8[_0x5a59('0x4b')]=_['merge'](_0x365ea8[_0x5a59('0x4b')],{'$or':_[_0x5a59('0x3c')](_0x365ea8[_0x5a59('0x43')],function(_0x4bae97){var _0x22bf92={};_0x22bf92[_0x4bae97]={'$like':'%'+_0x45b785[_0x5a59('0x40')][_0x5a59('0x4a')]+'%'};return _0x22bf92;})});}_0x365ea8=_[_0x5a59('0x4c')]({},_0x365ea8,_0x45b785['options']);return db[_0x5a59('0x63')]['count']({'where':_0x365ea8[_0x5a59('0x4b')]})[_0x5a59('0x1e')](function(_0x9ab936){_0x147114['count']=_0x9ab936;if(_0x45b785[_0x5a59('0x40')][_0x5a59('0x50')]){_0x365ea8[_0x5a59('0x51')]=[{'all':!![]}];}return db[_0x5a59('0x63')][_0x5a59('0x52')](_0x365ea8);})[_0x5a59('0x1e')](function(_0x1988e4){_0x147114[_0x5a59('0x53')]=_0x1988e4;return _0x147114;});}})['then'](respondWithFilteredResult(_0x16392e,_0x365ea8))[_0x5a59('0x28')](handleError(_0x16392e,null));};exports[_0x5a59('0x64')]=function(_0x1d105f,_0x4314f3,_0x74631e){return db['ChatWebsite']['find']({'where':{'id':_0x1d105f[_0x5a59('0x54')]['id']}})['then'](handleEntityNotFound(_0x4314f3,null))[_0x5a59('0x1e')](function(_0x3be489){if(_0x3be489){return _0x3be489[_0x5a59('0x64')](_0x1d105f[_0x5a59('0x40')]['ids']);}})['then'](respondWithStatusCode(_0x4314f3,null))['catch'](handleError(_0x4314f3,null));};exports[_0x5a59('0x65')]=function(_0x5ceaea,_0x457f6f,_0x5395c3){if(_0x5ceaea['body']['id']){delete _0x5ceaea[_0x5a59('0x57')]['id'];}return db['ChatWebsite'][_0x5a59('0x55')]({'where':{'id':_0x5ceaea[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x457f6f,null))[_0x5a59('0x1e')](function(_0x29f248){if(_0x29f248){_0x5ceaea[_0x5a59('0x57')][_0x5a59('0x5f')]=_0x29f248['id'];return db[_0x5a59('0x66')][_0x5a59('0x56')](_0x5ceaea[_0x5a59('0x57')]);}})[_0x5a59('0x1e')](respondWithResult(_0x457f6f,null))['catch'](handleError(_0x457f6f,null));};exports[_0x5a59('0x67')]=function(_0xf1c1bb,_0x1a7998,_0x1e9691){var _0x3e04ad={'raw':![],'where':{}};var _0x4ce37f={};var _0x5dfd72={'count':0x0,'rows':[]};return db[_0x5a59('0x4f')]['findOne']({'where':{'id':_0xf1c1bb[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x1a7998,null))['then'](function(_0x31c83c){if(_0x31c83c){_0x4ce37f[_0x5a59('0x3f')]=_[_0x5a59('0x41')](db[_0x5a59('0x66')][_0x5a59('0x3d')]);_0x4ce37f[_0x5a59('0x40')]=_[_0x5a59('0x41')](_0xf1c1bb[_0x5a59('0x40')]);_0x4ce37f['filters']=_['intersection'](_0x4ce37f[_0x5a59('0x3f')],_0x4ce37f[_0x5a59('0x40')]);_0x3e04ad[_0x5a59('0x43')]=_[_0x5a59('0x44')](_0x4ce37f['model'],qs[_0x5a59('0x45')](_0xf1c1bb['query'][_0x5a59('0x45')]));_0x3e04ad[_0x5a59('0x43')]=_0x3e04ad['attributes'][_0x5a59('0x46')]?_0x3e04ad[_0x5a59('0x43')]:_0x4ce37f[_0x5a59('0x3f')];if(!_0xf1c1bb['query'][_0x5a59('0x47')](_0x5a59('0x68'))){_0x3e04ad[_0x5a59('0x30')]=qs[_0x5a59('0x30')](_0xf1c1bb[_0x5a59('0x40')][_0x5a59('0x30')]);_0x3e04ad[_0x5a59('0x2d')]=qs[_0x5a59('0x2d')](_0xf1c1bb[_0x5a59('0x40')][_0x5a59('0x2d')]);}_0x3e04ad[_0x5a59('0x48')]=qs[_0x5a59('0x49')](_0xf1c1bb[_0x5a59('0x40')][_0x5a59('0x49')]);_0x3e04ad[_0x5a59('0x4b')]=qs[_0x5a59('0x42')](_[_0x5a59('0x62')](_0xf1c1bb[_0x5a59('0x40')],_0x4ce37f[_0x5a59('0x42')]));_0x3e04ad[_0x5a59('0x4b')][_0x5a59('0x5f')]=_0x31c83c['id'];if(_0xf1c1bb[_0x5a59('0x40')][_0x5a59('0x4a')]){_0x3e04ad[_0x5a59('0x4b')]=_[_0x5a59('0x4c')](_0x3e04ad[_0x5a59('0x4b')],{'$or':_['map'](_0x3e04ad[_0x5a59('0x43')],function(_0x4adaee){var _0x2500d3={};_0x2500d3[_0x4adaee]={'$like':'%'+_0xf1c1bb[_0x5a59('0x40')]['filter']+'%'};return _0x2500d3;})});}_0x3e04ad=_[_0x5a59('0x4c')]({},_0x3e04ad,_0xf1c1bb[_0x5a59('0x4e')]);return db[_0x5a59('0x66')]['count']({'where':_0x3e04ad[_0x5a59('0x4b')]})[_0x5a59('0x1e')](function(_0x6147d7){_0x5dfd72['count']=_0x6147d7;if(_0xf1c1bb[_0x5a59('0x40')]['includeAll']){_0x3e04ad[_0x5a59('0x51')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x3e04ad);})[_0x5a59('0x1e')](function(_0x22fcba){_0x5dfd72['rows']=_0x22fcba;return _0x5dfd72;});}})[_0x5a59('0x1e')](respondWithFilteredResult(_0x1a7998,_0x3e04ad))['catch'](handleError(_0x1a7998,null));};exports['removeAnswers']=function(_0x52ea54,_0x2b7142,_0x5adfce){return db['ChatWebsite'][_0x5a59('0x55')]({'where':{'id':_0x52ea54[_0x5a59('0x54')]['id']}})['then'](handleEntityNotFound(_0x2b7142,null))['then'](function(_0x59e4f5){if(_0x59e4f5){return _0x59e4f5[_0x5a59('0x69')](_0x52ea54[_0x5a59('0x40')][_0x5a59('0x6a')]);}})[_0x5a59('0x1e')](respondWithStatusCode(_0x2b7142,null))[_0x5a59('0x28')](handleError(_0x2b7142,null));};exports[_0x5a59('0x6b')]=function(_0x545652,_0x2ca87b,_0x34164e){_0x545652[_0x5a59('0x57')]['sitepic']=_0x545652[_0x5a59('0x6c')]['filename'];return db[_0x5a59('0x4f')][_0x5a59('0x55')]({'where':{'id':_0x545652[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x2ca87b,null))['then'](saveUpdates(_0x545652['body'],null))[_0x5a59('0x1e')](respondWithResult(_0x2ca87b,null))[_0x5a59('0x28')](handleError(_0x2ca87b,null));};exports[_0x5a59('0x6d')]=function(_0x129741,_0x45bec9,_0xfe77b){_0x129741[_0x5a59('0x57')]['agentAvatar']=_0x129741['file'][_0x5a59('0x6e')];return db[_0x5a59('0x4f')]['find']({'where':{'id':_0x129741[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x45bec9,null))[_0x5a59('0x1e')](saveUpdates(_0x129741['body'],null))[_0x5a59('0x1e')](respondWithResult(_0x45bec9,null))[_0x5a59('0x28')](handleError(_0x45bec9,null));};exports[_0x5a59('0x6f')]=function(_0x1695af,_0x55711a,_0x43083b){_0x1695af[_0x5a59('0x57')][_0x5a59('0x70')]=_0x1695af[_0x5a59('0x6c')][_0x5a59('0x6e')];return db['ChatWebsite']['find']({'where':{'id':_0x1695af[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x55711a,null))['then'](saveUpdates(_0x1695af['body'],null))[_0x5a59('0x1e')](respondWithResult(_0x55711a,null))[_0x5a59('0x28')](handleError(_0x55711a,null));};exports[_0x5a59('0x71')]=function(_0x235cc8,_0xfad905,_0x448bbd){_0x235cc8[_0x5a59('0x57')][_0x5a59('0x72')]=_0x235cc8[_0x5a59('0x6c')]['filename'];return db[_0x5a59('0x4f')][_0x5a59('0x55')]({'where':{'id':_0x235cc8[_0x5a59('0x54')]['id']}})['then'](handleEntityNotFound(_0xfad905,null))[_0x5a59('0x1e')](saveUpdates(_0x235cc8[_0x5a59('0x57')],null))[_0x5a59('0x1e')](respondWithResult(_0xfad905,null))[_0x5a59('0x28')](handleError(_0xfad905,null));};exports[_0x5a59('0x73')]=function(_0x129dba,_0x52a9a9,_0x322adc){var _0x1cb19d=path[_0x5a59('0x74')](config[_0x5a59('0x75')],'server/files/images/logos/default_logo.svg');var _0x15b500={'where':{'id':_0x129dba[_0x5a59('0x54')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x43296b=![];return require(_0x5a59('0x76'))[_0x5a59('0x77')]()[_0x5a59('0x1e')](function(_0x1d4d17){if(_0x1d4d17){_0x43296b=_0x1d4d17['custom'];}})[_0x5a59('0x1e')](function(){return db['ChatWebsite']['find'](_0x15b500);})[_0x5a59('0x1e')](handleEntityNotFound(_0x52a9a9,null))['then'](function(_0x45e099){if(_0x45e099){if(!_[_0x5a59('0x78')](_0x45e099[_0x5a59('0x79')])){if(fs[_0x5a59('0x7a')](path[_0x5a59('0x74')](config[_0x5a59('0x75')],_0x5a59('0x7b'),_0x45e099[_0x5a59('0x79')]))&&_0x43296b){_0x1cb19d=path[_0x5a59('0x74')](config['root'],_0x5a59('0x7b'),_0x45e099[_0x5a59('0x79')]);}}return _0x52a9a9[_0x5a59('0x7c')](_0x1cb19d);}})[_0x5a59('0x28')](handleError(_0x52a9a9,null));};exports[_0x5a59('0x7d')]=function(_0x1b5ffe,_0x1b47e7,_0x5db3ef){var _0x3ccdba=path[_0x5a59('0x74')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x22f14a={'where':{'id':_0x1b5ffe[_0x5a59('0x54')]['id']},'attributes':['id',_0x5a59('0x7e')],'raw':!![]};return db[_0x5a59('0x4f')]['find'](_0x22f14a)[_0x5a59('0x1e')](handleEntityNotFound(_0x1b47e7,null))['then'](function(_0x31c759){if(_0x31c759){if(!_[_0x5a59('0x78')](_0x31c759[_0x5a59('0x7e')])){if(fs[_0x5a59('0x7a')](path[_0x5a59('0x74')](config['root'],_0x5a59('0x7f'),_0x31c759[_0x5a59('0x7e')]))){_0x3ccdba=path[_0x5a59('0x74')](config['root'],_0x5a59('0x7f'),_0x31c759[_0x5a59('0x7e')]);}}return _0x1b47e7['download'](_0x3ccdba);}})[_0x5a59('0x28')](handleError(_0x1b47e7,null));};exports[_0x5a59('0x80')]=function(_0x574d87,_0xbacb76,_0x476519){var _0x4e36db=path[_0x5a59('0x74')](config[_0x5a59('0x75')],_0x5a59('0x81'));var _0x3ca6ff={'where':{'id':_0x574d87[_0x5a59('0x54')]['id']},'attributes':['id',_0x5a59('0x70'),_0x5a59('0x82')],'raw':!![]};return db[_0x5a59('0x4f')][_0x5a59('0x55')](_0x3ca6ff)[_0x5a59('0x1e')](handleEntityNotFound(_0xbacb76,null))[_0x5a59('0x1e')](function(_0x28c03d){if(_0x28c03d){if(!_[_0x5a59('0x78')](_0x28c03d[_0x5a59('0x70')])){if(fs['existsSync'](path[_0x5a59('0x74')](config[_0x5a59('0x75')],_0x5a59('0x7f'),_0x28c03d[_0x5a59('0x70')]))&&_0x28c03d[_0x5a59('0x82')]){_0x4e36db=path[_0x5a59('0x74')](config[_0x5a59('0x75')],_0x5a59('0x7f'),_0x28c03d[_0x5a59('0x70')]);}}return _0xbacb76[_0x5a59('0x7c')](_0x4e36db);}})[_0x5a59('0x28')](handleError(_0xbacb76,null));};exports[_0x5a59('0x83')]=function(_0x2d59d3,_0x2c6183,_0x1c5e19){var _0x3a7425=path[_0x5a59('0x74')](config[_0x5a59('0x75')],_0x5a59('0x84'));var _0x4536a7={'where':{'id':_0x2d59d3[_0x5a59('0x54')]['id']},'attributes':['id',_0x5a59('0x72')],'raw':!![]};return db[_0x5a59('0x4f')][_0x5a59('0x55')](_0x4536a7)[_0x5a59('0x1e')](handleEntityNotFound(_0x2c6183,null))['then'](function(_0xf4cf1){if(_0xf4cf1){if(!_[_0x5a59('0x78')](_0xf4cf1[_0x5a59('0x72')])){if(fs[_0x5a59('0x7a')](path['join'](config['root'],_0x5a59('0x7f'),_0xf4cf1['systemAvatar']))){_0x3a7425=path[_0x5a59('0x74')](config[_0x5a59('0x75')],_0x5a59('0x7f'),_0xf4cf1[_0x5a59('0x72')]);}}return _0x2c6183['download'](_0x3a7425);}})[_0x5a59('0x28')](handleError(_0x2c6183,null));};exports[_0x5a59('0x85')]=function(_0x3890e8,_0x8311d4,_0x136f1a){var _0x15ddbb=require(_0x5a59('0x86'));var _0xf7d99b=new _0x15ddbb();var _0x5ae8ea=_0xf7d99b[_0x5a59('0x87')](_0x3890e8[_0x5a59('0x88')][_0x5a59('0x89')])[_0x5a59('0x8a')]();var _0xb1ffe9={'body':_0x3890e8[_0x5a59('0x57')],'channel':_0x5a59('0x8b')};var _0x34487b=[];var _0x1014a8=[];var _0x5ef3f6={};var _0x5e1fa9=![];return db[_0x5a59('0x8c')]['describe']()[_0x5a59('0x1e')](function(_0x24eda0){if(!_0x24eda0){throw new db['Sequelize'][(_0x5a59('0x8d'))]('no\x20available\x20attributes');}_0x34487b=_[_0x5a59('0x8e')](_[_0x5a59('0x41')](_0x24eda0),[_0x5a59('0x8f'),'updatedAt']);_0x1014a8=_['difference'](_[_0x5a59('0x41')](_0x24eda0),[_0x5a59('0x8f'),_0x5a59('0x90'),_0x5a59('0x91'),_0x5a59('0x92')]);if(_0x3890e8[_0x5a59('0x57')]['id']){delete _0x3890e8[_0x5a59('0x57')]['id'];}if(_[_0x5a59('0x78')](_0x3890e8['body']['from'])){throw new db[(_0x5a59('0x93'))][(_0x5a59('0x8d'))](_0x5a59('0x94'));}if(_[_0x5a59('0x78')](_0x3890e8['body']['body'])||_0x3890e8[_0x5a59('0x57')]['body']===''){throw new db[(_0x5a59('0x93'))][(_0x5a59('0x8d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5a59('0x78')](_0x3890e8[_0x5a59('0x57')]['mapKey'])){throw new db[(_0x5a59('0x93'))][(_0x5a59('0x8d'))](_0x5a59('0x95')+_0x1014a8);}if(!_['includes'](_0x1014a8,_0x3890e8[_0x5a59('0x57')][_0x5a59('0x96')])){throw new db[(_0x5a59('0x93'))][(_0x5a59('0x8d'))](_0x5a59('0x97')+_0x1014a8);}_0x5ef3f6[_0x3890e8[_0x5a59('0x57')][_0x5a59('0x96')]]=_0x3890e8[_0x5a59('0x57')]['from'];})[_0x5a59('0x1e')](function(){return db[_0x5a59('0x4f')][_0x5a59('0x55')]({'where':{'id':_0x3890e8['params']['id']},'include':[{'model':db['CmList'],'as':_0x5a59('0x98'),'include':[{'model':db[_0x5a59('0x8c')],'as':'Contacts','where':_0x5ef3f6,'limit':0x1,'order':[['updatedAt',_0x5a59('0x99')]]}]},{'model':db[_0x5a59('0x9a')],'as':_0x5a59('0x9b')}]});})[_0x5a59('0x1e')](handleEntityNotFound(_0x8311d4,null))[_0x5a59('0x1e')](function(_0x232d18){if(_0x232d18&&_0x232d18['List']){_0xb1ffe9[_0x5a59('0x9c')]=_0x232d18;_0xb1ffe9[_0x5a59('0x9d')]=_0x232d18[_0x5a59('0x9b')];_0xb1ffe9[_0x5a59('0x9e')]=_0x232d18[_0x5a59('0x98')];_0xb1ffe9[_0x5a59('0x9d')]=_[_0x5a59('0x9f')](_0xb1ffe9[_0x5a59('0x9d')],[_0x5a59('0xa0')],['asc']);if(_0xb1ffe9[_0x5a59('0x9c')]['Applications']){delete _0xb1ffe9[_0x5a59('0x9c')][_0x5a59('0x9b')];}if(_0xb1ffe9['account'][_0x5a59('0x98')]&&_0xb1ffe9[_0x5a59('0x9c')][_0x5a59('0x98')]['Contacts'][_0x5a59('0x46')]){return _0xb1ffe9['account']['List'][_0x5a59('0xa1')][0x0];}var _0x358a3c=_['defaults'](_0x3890e8[_0x5a59('0x57')],{'firstName':_0x3890e8[_0x5a59('0x57')][_0x5a59('0xa2')],'ListId':_0x232d18[_0x5a59('0x92')]});_0x358a3c[_0x3890e8['body'][_0x5a59('0x96')]]=_0x3890e8[_0x5a59('0x57')][_0x5a59('0xa2')];return db['CmContact'][_0x5a59('0x56')](_0x358a3c,{'fields':_0x34487b,'raw':!![]});}})['then'](handleEntityNotFound(_0x8311d4,null))[_0x5a59('0x1e')](function(_0x5521c5){_0xb1ffe9['contact']=_0x5521c5;var _0xc93770=_0x3890e8[_0x5a59('0x57')][_0x5a59('0xa3')];if(_0x3890e8[_0x5a59('0x88')][_0x5a59('0xa4')]){_0xc93770=_0x3890e8['headers'][_0x5a59('0xa4')];}else if(_0x3890e8[_0x5a59('0x88')]['x-forwarded-for']){_0xc93770=_[_0x5a59('0xa5')](_0x3890e8[_0x5a59('0x88')]['x-forwarded-for'][_0x5a59('0xa6')](','));}if(_0x5521c5){var _0x9e9023={'ContactId':_0x5521c5['id'],'ChatWebsiteId':_0x3890e8[_0x5a59('0x54')]['id'],'from':(_0x5521c5[_0x5a59('0xa7')]||'')+'\x20'+(_0x5521c5[_0x5a59('0xa8')]||''),'customerIp':_0xc93770,'customerPort':_0x3890e8[_0x5a59('0x88')][_0x5a59('0xa9')]?_0x3890e8[_0x5a59('0x88')][_0x5a59('0xa9')]:null,'referer':_0x3890e8[_0x5a59('0x57')][_0x5a59('0xaa')],'browserName':_0x5ae8ea[_0x5a59('0xab')][_0x5a59('0x37')]&&_0x5ae8ea['browser']['version']?util[_0x5a59('0xac')](_0x5a59('0xad'),_0x5ae8ea[_0x5a59('0xab')][_0x5a59('0x37')],_0x5ae8ea['browser']['version']):_0x5a59('0xae'),'browserVersion':_0x5ae8ea[_0x5a59('0xab')]['version']||'unknown','osName':util[_0x5a59('0xac')](_0x5a59('0xad'),_0x5ae8ea['os'][_0x5a59('0x37')],_0x5ae8ea['os'][_0x5a59('0xaf')]),'osVersion':_0x5ae8ea['os'][_0x5a59('0xaf')],'deviceModel':_0x5ae8ea[_0x5a59('0xb0')][_0x5a59('0x3f')]&&_0x5ae8ea[_0x5a59('0xb0')][_0x5a59('0xb1')]?util['format'](_0x5a59('0xb2'),_0x5ae8ea[_0x5a59('0xb0')][_0x5a59('0x3f')],_0x5ae8ea[_0x5a59('0xb0')][_0x5a59('0xb1')],_0x5ae8ea[_0x5a59('0xb0')][_0x5a59('0x3e')]):null,'deviceVendor':_0x5ae8ea['device']['vendor'],'deviceType':_0x5ae8ea[_0x5a59('0xb0')][_0x5a59('0x3e')],'formData':JSON['stringify'](_0x3890e8[_0x5a59('0x57')])};var _0x5cda6f={'ChatWebsiteId':_0x3890e8[_0x5a59('0x54')]['id'],'closed':![]};if(_0x3890e8[_0x5a59('0x57')][_0x5a59('0xb3')]){_0x5cda6f[_0x5a59('0xb3')]=_0x3890e8['body']['threadId'];return db['ChatInteraction'][_0x5a59('0x55')]({'where':_0x5cda6f})['then'](function(_0x4e0fed){if(_0x4e0fed){return[_0x4e0fed,![]];}_0x9e9023[_0x5a59('0xb3')]=_0x3890e8[_0x5a59('0x57')][_0x5a59('0xb3')];_0x9e9023[_0x5a59('0xb4')]=_0x3890e8['body']['externalUrl'];return db[_0x5a59('0xb5')][_0x5a59('0x56')](_0x9e9023)[_0x5a59('0x1e')](function(_0x295b56){return[_0x295b56,!![]];});});}_0x5cda6f[_0x5a59('0xb6')]=_0x5521c5['id'];if(_0x3890e8[_0x5a59('0x57')][_0x5a59('0xb7')]&&_0x3890e8[_0x5a59('0x57')]['interaction']['id']){_0x5cda6f['id']=_0x3890e8[_0x5a59('0x57')][_0x5a59('0xb7')]['id'];return db[_0x5a59('0xb5')][_0x5a59('0x55')]({'where':_0x5cda6f})[_0x5a59('0x1e')](function(_0x4e3cba){if(_0x4e3cba){return[_0x4e3cba,![]];}return db[_0x5a59('0xb5')][_0x5a59('0x56')](_0x9e9023)[_0x5a59('0x1e')](function(_0x12173f){return[_0x12173f,!![]];});});}return db['ChatInteraction']['create'](_0x9e9023)[_0x5a59('0x1e')](function(_0x7fbd69){return[_0x7fbd69,!![]];});}})['spread'](function(_0x18684e,_0x398ef1){if(_0x18684e){_0x5e1fa9=_0x398ef1;if(!_0x398ef1){var _0x3b15dd={'from':(_0xb1ffe9['contact']['firstName']||'')+'\x20'+(_0xb1ffe9['contact'][_0x5a59('0xa8')]||'')};if(_0x3890e8['body']['threadId']&&_0x3890e8[_0x5a59('0x57')][_0x5a59('0xb8')]&&_0x3890e8[_0x5a59('0x57')][_0x5a59('0xb3')]!=_0x3890e8[_0x5a59('0x57')][_0x5a59('0xb8')]){_0x3b15dd[_0x5a59('0xb3')]=_0x3890e8[_0x5a59('0x57')]['messageId'];}return _0x18684e[_0x5a59('0x33')](_0x3b15dd);}else{return _0x18684e;}}})['then'](function(_0x3ba0c8){_0xb1ffe9['interaction']=_0x3ba0c8[_0x5a59('0x5a')]({'plain':!![]});_0xb1ffe9[_0x5a59('0xb7')]['created']=_0x5e1fa9;if(_0xb1ffe9['interaction'][_0x5a59('0xb9')]){if(_0xb1ffe9[_0x5a59('0x9c')]['autoclose']){_0xb1ffe9[_0x5a59('0x9d')]['push']({'id':0x0,'priority':_0xb1ffe9['applications'][_0x5a59('0x46')]+0x1,'app':_0x5a59('0xba'),'appdata':_0x5a59('0xbb'),'interval':'*,*,*,*'});}}return db[_0x5a59('0xbc')]['create']({'body':_0x3890e8[_0x5a59('0x57')][_0x5a59('0x57')],'ChatWebsiteId':_0x3890e8[_0x5a59('0x54')]['id'],'ChatInteractionId':_0x3ba0c8['id'],'direction':'in','ContactId':_0xb1ffe9[_0x5a59('0xbd')]['id'],'AttachmentId':_0x3890e8['body'][_0x5a59('0xbe')]});})[_0x5a59('0x1e')](function(_0x2b9568){_0xb1ffe9[_0x5a59('0x26')]=_0x2b9568;if(_0xb1ffe9[_0x5a59('0xb7')][_0x5a59('0xbf')]){return db[_0x5a59('0xc0')][_0x5a59('0x55')]({'attributes':['id',_0x5a59('0x37')],'where':{'id':_0xb1ffe9[_0x5a59('0xb7')][_0x5a59('0xbf')]}})[_0x5a59('0x1e')](function(_0x20fdf1){if(_0x20fdf1){_0xb1ffe9[_0x5a59('0x9d')][_0x5a59('0xc1')]({'id':0x0,'priority':0x0,'app':_0x5a59('0xc2'),'appdata':_0x20fdf1[_0x5a59('0x37')]+','+(_0xb1ffe9['account'][_0x5a59('0xc3')]||0xa),'interval':_0x5a59('0xc4')});_0xb1ffe9[_0x5a59('0xc5')]=!![];}return respondWithRpcPromise(_0x5a59('0xc6'),_0x5a59('0xc7'),_0xb1ffe9);});}return respondWithRpcPromise('Start',_0x5a59('0xc7'),_0xb1ffe9);})[_0x5a59('0x1e')](function(_0x3f2481){respondWithRpcPromise(_0x5a59('0xc8'),_0x5a59('0xc8'),{'event':_0x5a59('0x85'),'message':_0x3f2481},client9002);return _0x3f2481;})[_0x5a59('0x1e')](respondWithResult(_0x8311d4,null))[_0x5a59('0x28')](handleError(_0x8311d4,null));};exports['offline']=function(_0x2d97f1,_0x2e2ac3,_0x3f02bc){var _0xff22b9,_0x44ece0,_0x2fd195;var _0x15094d=[];var _0x545b95=[];var _0x4b267d={};var _0x5a040a=_0x2d97f1['files']||[];var _0x4e4409=[];var _0x2d45ca;return db[_0x5a59('0x8c')][_0x5a59('0x5d')]()[_0x5a59('0x1e')](function(_0x5901b7){if(!_0x5901b7){throw new db['Sequelize']['ValidationError'](_0x5a59('0xc9'));}_0x545b95=_['difference'](_[_0x5a59('0x41')](_0x5901b7),['createdAt',_0x5a59('0x90')]);_0x15094d=_[_0x5a59('0x8e')](_[_0x5a59('0x41')](_0x5901b7),[_0x5a59('0x8f'),'updatedAt',_0x5a59('0x91'),_0x5a59('0x92')]);if(_0x2d97f1[_0x5a59('0x57')]['id']){delete _0x2d97f1[_0x5a59('0x57')]['id'];}if(_[_0x5a59('0x78')](_0x2d97f1['body'][_0x5a59('0xa2')])){throw _0x2e2ac3[_0x5a59('0x2a')](0x1f4)[_0x5a59('0x38')](new db['Sequelize'][(_0x5a59('0x8d'))](_0x5a59('0x94')));}if(_[_0x5a59('0x78')](_0x2d97f1[_0x5a59('0x57')]['body'])||_0x2d97f1[_0x5a59('0x57')][_0x5a59('0x57')]===''){throw _0x2e2ac3[_0x5a59('0x2a')](0x1f4)[_0x5a59('0x38')](new db[(_0x5a59('0x93'))][(_0x5a59('0x8d'))](_0x5a59('0xca')));}if(_[_0x5a59('0x78')](_0x2d97f1['body'][_0x5a59('0xcb')])){throw _0x2e2ac3[_0x5a59('0x2a')](0x1f4)[_0x5a59('0x38')](new db[(_0x5a59('0x93'))][(_0x5a59('0x8d'))](_0x5a59('0xcc')+_0x15094d));}if(!_['includes'](_0x15094d,_0x2d97f1[_0x5a59('0x57')][_0x5a59('0xcb')])){throw _0x2e2ac3[_0x5a59('0x2a')](0x1f4)[_0x5a59('0x38')](new db[(_0x5a59('0x93'))][(_0x5a59('0x8d'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x15094d));}_0x4b267d[_0x2d97f1[_0x5a59('0x57')]['mapKeyOffline']]=_0x2d97f1[_0x5a59('0x57')][_0x5a59('0xa2')];})[_0x5a59('0x1e')](function(){return db['ChatWebsite'][_0x5a59('0x55')]({'where':{'id':_0x2d97f1[_0x5a59('0x54')]['id']},'include':[{'model':db[_0x5a59('0xcd')],'as':_0x5a59('0x98')},{'model':db['MailAccount'],'as':_0x5a59('0xce')}]});})[_0x5a59('0x1e')](handleEntityNotFound(_0x2e2ac3,null))['then'](function(_0x25c45f){if(_0x25c45f&&_0x25c45f[_0x5a59('0x98')]){_0x44ece0=_0x25c45f;var _0x609b63=_[_0x5a59('0x18')](_0x2d97f1[_0x5a59('0x57')],{'firstName':_0x2d97f1[_0x5a59('0x57')]['from'],'phone':_0x2d97f1[_0x5a59('0x57')][_0x5a59('0xa2')],'ListId':_0x25c45f[_0x5a59('0x92')]});_0x609b63[_0x2d97f1[_0x5a59('0x57')][_0x5a59('0xcb')]]=_0x2d97f1['body']['from'];return db[_0x5a59('0x8c')][_0x5a59('0xcf')]({'where':_0x4b267d,'defaults':_0x609b63});}})['spread'](function(_0x1634ed){if(_0x1634ed){_0x2fd195=_0x1634ed;var _0x5ce8cf=fs['readFileSync'](path['join'](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0x5a59('0xd0'));var _0x5c1572=ejs[_0x5a59('0xd1')](_0x5ce8cf,{'body':_[_0x5a59('0xd2')](_0x2d97f1[_0x5a59('0x57')][_0x5a59('0x57')]),'bodyTitle':_0x44ece0['offlineMessageBody']});return db[_0x5a59('0xd3')][_0x5a59('0x56')]({'body':_0x5c1572,'ContactId':_0x1634ed['id'],'ChatWebsiteId':_0x44ece0['id']});}})[_0x5a59('0x1e')](function(_0x1df740){_0x2d45ca=_0x1df740;if(_0x5a040a[_0x5a59('0x46')]){var _0x3e74c7=_0x5a040a[_0x5a59('0x3c')](function(_0x51c8d8){return{'name':_0x51c8d8['originalname'],'basename':_0x51c8d8['filename'],'type':_0x51c8d8[_0x5a59('0xd4')],'ChatOfflineMessageId':_0x1df740['id']};});_0x4e4409=_0x3e74c7['map'](_0x3e99aa=>{var _0x521f6d={'filename':_0x3e99aa['name'],'path':path[_0x5a59('0x74')](config[_0x5a59('0x75')],_0x5a59('0xd5'),_0x5a59('0xd6'),_0x5a59('0xd7'),_0x5a59('0xd8'),_0x3e99aa[_0x5a59('0xd9')])};return _0x521f6d;});if(!_0x44ece0[_0x5a59('0xda')]){return db[_0x5a59('0xdb')]['transaction'](function(_0x4ef66e){return db[_0x5a59('0xdc')]['bulkCreate'](_0x3e74c7,{'transaction':_0x4ef66e});});}}})[_0x5a59('0x1e')](function(){if(_0x2d45ca){_0xff22b9=_0x2d45ca;return db[_0x5a59('0xce')][_0x5a59('0x61')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x5a59('0xdd'),'raw':!![]}]});}})[_0x5a59('0x1e')](function(_0x554464){if(_0x554464&&_0x554464['Smtp']&&_0x44ece0['forwardOffline']&&_0x44ece0[_0x5a59('0xde')]){var _0x4a15e7={'tls':{'rejectUnauthorized':![]}};if(_0x554464[_0x5a59('0xdd')][_0x5a59('0xdf')]){_0x4a15e7[_0x5a59('0xdf')]=_0x554464['Smtp'][_0x5a59('0xdf')];}else{_0x4a15e7[_0x5a59('0xe0')]=_0x554464['Smtp']['host'];_0x4a15e7[_0x5a59('0xe1')]=_0x554464[_0x5a59('0xdd')]['port'];_0x4a15e7[_0x5a59('0xe2')]=_0x554464[_0x5a59('0xdd')][_0x5a59('0xe2')];}if(_0x554464['Smtp'][_0x5a59('0xe3')]){_0x4a15e7[_0x5a59('0xe4')]={'user':_0x554464[_0x5a59('0xdd')][_0x5a59('0x58')],'pass':_0x554464['Smtp'][_0x5a59('0xe5')]};}return respondWithRpcPromise('SendMail',_0x5a59('0xe6'),{'account':_0x4a15e7,'message':{'from':util[_0x5a59('0xac')]('\x22%s\x22\x20<%s>',_0x554464[_0x5a59('0x37')],_0x554464[_0x5a59('0xe7')]||_0x554464[_0x5a59('0xdd')]['user']),'to':_0x44ece0[_0x5a59('0xde')],'subject':_0x44ece0[_0x5a59('0xe8')],'html':_0xff22b9[_0x5a59('0x57')],'attachments':_0x4e4409}},client9003)[_0x5a59('0x1e')](function(){return _0xff22b9;})['catch'](function(_0x2985d3){console['error'](_0x2985d3);});}})['then'](function(){if(_0x44ece0&&_0x44ece0[_0x5a59('0xda')]&&_0x44ece0[_0x5a59('0xe9')]){var _0x416de8=[];if(_0x5a040a[_0x5a59('0x46')]){_0x416de8=_0x5a040a[_0x5a59('0x3c')](function(_0x274b2b){return{'name':_0x274b2b['originalname'],'basename':_0x274b2b[_0x5a59('0x6e')],'type':_0x274b2b[_0x5a59('0xd4')],'ChatOfflineMessageId':_0x2d45ca['id']};});}var _0x365420;if(!_[_0x5a59('0x78')](_0x44ece0[_0x5a59('0xea')])){var _0x121895=_['map'](_0x2d97f1[_0x5a59('0x57')],function(_0x102d25){return _0x102d25;});var _0x43db41=_['toPairsIn'](_0x121895)[0x0];var _0x5942a2=_[_0x5a59('0xeb')](_0x43db41,function(_0x3aaa1f){return _0x3aaa1f;});_0x365420=_0x5942a2[0x1][_0x44ece0[_0x5a59('0xea')]];}var _0x248f3f={'from':_0x2fd195[_0x5a59('0xe7')],'firstName':_0x2fd195['firstName'],'lastName':_0x2fd195[_0x5a59('0xa8')],'mapKey':_0x5a59('0xe7'),'message':{'from':_0x2fd195[_0x5a59('0xe7')],'to':_0x44ece0[_0x5a59('0xce')]['email'],'cc':'','subject':_[_0x5a59('0x78')](_0x365420)?_0x44ece0[_0x5a59('0xe8')]:_0x365420,'messageId':'','sentAt':new Date(),'attach':_0x416de8[_0x5a59('0x46')],'attachments':_0x416de8,'originChannel':'Chat','ChatWebsiteId':_0x44ece0['id'],'ChatOfflineMessageId':_0xff22b9['id'],'originTo':_0x44ece0['MailAccount'][_0x5a59('0xe7')]},'body':_0xff22b9[_0x5a59('0x57')]};var _0x13206a={'account':{'id':_0x44ece0[_0x5a59('0xe9')]},'body':_0x248f3f,'log':_0x5a59('0xec')};return respondWithRpcPromise(_0x5a59('0xec'),_0x5a59('0xed'),_0x13206a,client9001)['then'](function(){return _0xff22b9;})[_0x5a59('0x28')](function(_0x6e5521){console[_0x5a59('0x24')](_0x6e5521);});}return;})[_0x5a59('0x1e')](function(){if(_0xff22b9){return _0xff22b9;}})['then'](respondWithResult(_0x2e2ac3,null))[_0x5a59('0x28')](function(_0x4e406f){console[_0x5a59('0x24')](_0x5a59('0x28'),_0x4e406f);for(var _0x37f216 of _0x5a040a){var _0x486092=path['join'](config['root'],_0x5a59('0xd5'),_0x5a59('0xd6'),_0x5a59('0xd7'),_0x5a59('0xd8'),_0x37f216[_0x5a59('0x6e')]);fs_extra[_0x5a59('0xee')](_0x486092)[_0x5a59('0x28')](function(_0x35ef18){console[_0x5a59('0x24')](_0x5a59('0xef'),_0x486092,_0x35ef18);});}});};exports[_0x5a59('0xf0')]=function(_0x5046d3,_0x18d898,_0x2f08a5){return db['ChatInteraction'][_0x5a59('0x55')]({'where':{'id':_0x5046d3[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x18d898,null))['then'](function(_0x4203df){if(_0x4203df){return _0x4203df[_0x5a59('0xf0')](_0x5046d3['body']['ids'],_['omit'](_0x5046d3['body'],[_0x5a59('0x6a'),'id'])||{});}})[_0x5a59('0x1e')](respondWithResult(_0x18d898,null))[_0x5a59('0x28')](handleError(_0x18d898,null));};exports['getInteractions']=function(_0xaa9035,_0x118773,_0x4ba72b){var _0x552b39={'raw':![],'where':{}};var _0xb2ebb3={};var _0x371223={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x5a59('0x61')]({'where':{'id':_0xaa9035[_0x5a59('0x54')]['id']}})['then'](handleEntityNotFound(_0x118773,null))[_0x5a59('0x1e')](function(_0x27f1d3){if(_0x27f1d3){_0xb2ebb3[_0x5a59('0x3f')]=_[_0x5a59('0x41')](db[_0x5a59('0xb5')][_0x5a59('0x3d')]);_0xb2ebb3['query']=_[_0x5a59('0x41')](_0xaa9035[_0x5a59('0x40')]);_0xb2ebb3[_0x5a59('0x42')]=_[_0x5a59('0x44')](_0xb2ebb3[_0x5a59('0x3f')],_0xb2ebb3[_0x5a59('0x40')]);_0x552b39['attributes']=_[_0x5a59('0x44')](_0xb2ebb3['model'],qs[_0x5a59('0x45')](_0xaa9035['query'][_0x5a59('0x45')]));_0x552b39[_0x5a59('0x43')]=_0x552b39[_0x5a59('0x43')]['length']?_0x552b39[_0x5a59('0x43')]:_0xb2ebb3[_0x5a59('0x3f')];if(!_0xaa9035[_0x5a59('0x40')]['hasOwnProperty'](_0x5a59('0x68'))){_0x552b39[_0x5a59('0x30')]=qs['limit'](_0xaa9035[_0x5a59('0x40')][_0x5a59('0x30')]);_0x552b39['offset']=qs['offset'](_0xaa9035[_0x5a59('0x40')][_0x5a59('0x2d')]);}_0x552b39['order']=qs[_0x5a59('0x49')](_0xaa9035[_0x5a59('0x40')][_0x5a59('0x49')]);_0x552b39['where']=qs['filters'](_[_0x5a59('0x62')](_0xaa9035[_0x5a59('0x40')],_0xb2ebb3[_0x5a59('0x42')]));_0x552b39[_0x5a59('0x4b')]['ChatWebsiteId']=_0x27f1d3['id'];if(_0xaa9035[_0x5a59('0x40')]['filter']){_0x552b39[_0x5a59('0x4b')]=_[_0x5a59('0x4c')](_0x552b39[_0x5a59('0x4b')],{'$or':_[_0x5a59('0x3c')](_0x552b39[_0x5a59('0x43')],function(_0x14f93e){var _0x2dc66e={};_0x2dc66e[_0x14f93e]={'$like':'%'+_0xaa9035[_0x5a59('0x40')]['filter']+'%'};return _0x2dc66e;})});}_0x552b39=_[_0x5a59('0x4c')]({},_0x552b39,_0xaa9035[_0x5a59('0x4e')]);return db[_0x5a59('0xb5')][_0x5a59('0x2f')]({'where':_0x552b39[_0x5a59('0x4b')]})[_0x5a59('0x1e')](function(_0x398521){_0x371223[_0x5a59('0x2f')]=_0x398521;if(_0xaa9035[_0x5a59('0x40')]['includeAll']){_0x552b39[_0x5a59('0x51')]=[{'model':db[_0x5a59('0x8c')],'as':'Contact','required':![]},{'model':db[_0x5a59('0xc0')],'as':'Owner','attributes':[_0x5a59('0x37'),_0x5a59('0xf1'),_0x5a59('0xf2')],'required':![]},{'model':db[_0x5a59('0xf3')],'as':_0x5a59('0xf4'),'attributes':['id',_0x5a59('0x37'),_0x5a59('0xf5')],'where':_0xaa9035['query'][_0x5a59('0xf6')]?{'id':_0xaa9035[_0x5a59('0x40')][_0x5a59('0xf6')]}:undefined,'required':_0xaa9035[_0x5a59('0x40')]['tag']?!![]:![]}];}return db[_0x5a59('0xb5')][_0x5a59('0x52')](_0x552b39);})[_0x5a59('0x1e')](function(_0x367929){_0x371223[_0x5a59('0x53')]=_0x367929;return _0x371223;});}})[_0x5a59('0x1e')](respondWithFilteredResult(_0x118773,_0x552b39))[_0x5a59('0x28')](handleError(_0x118773,null));};function iftimePromise(_0x9ebcf7,_0x45141d){return respondWithRpcPromise(_0x5a59('0xf7'),'getSnippet',{'command':_0x45141d[_0x5a59('0xf8')]?util[_0x5a59('0xac')](_0x5a59('0xf9'),_0x9ebcf7['interval'],_0x45141d[_0x5a59('0xf8')]):util[_0x5a59('0xac')](_0x5a59('0xfa'),_0x9ebcf7[_0x5a59('0xfb')])},client9002)['then'](function(_0x352fd8){var _0x28e35a=_0x352fd8&&_0x352fd8[_0x5a59('0xfc')]('true')>=0x0?!![]:![];logger[_0x5a59('0x1f')](_0x5a59('0xfd'),_0x45141d['id'],_0x9ebcf7['id'],_0x9ebcf7[_0x5a59('0xfb')],_0x28e35a?_0x5a59('0xfe'):'OFFLINE',_0x45141d[_0x5a59('0xf8')]?_0x45141d['timezone']:_0x5a59('0xff'));return _0x28e35a;})[_0x5a59('0x28')](function(_0x4f1e85){logger[_0x5a59('0x24')](_0x5a59('0xfd'),_0x45141d['id'],_0x9ebcf7['id'],_0x9ebcf7[_0x5a59('0xfb')],util[_0x5a59('0x100')](_0x4f1e85,{'showHidden':![],'depth':null}),_0x45141d[_0x5a59('0xf8')]?_0x45141d[_0x5a59('0xf8')]:_0x5a59('0xff'));return![];});}exports[_0x5a59('0x101')]=function(_0x2edf08,_0x3f6649,_0x40a557){var _0x431e73=0x0;var _0x1a1910=0x0;var _0x149665=![];var _0x36da6b;var _0x9aa103;return db['ChatWebsite'][_0x5a59('0x55')]({'where':{'id':_0x2edf08['params']['id']},'include':[{'model':db[_0x5a59('0x102')],'as':_0x5a59('0x102'),'include':[{'model':db[_0x5a59('0x102')],'as':_0x5a59('0x103'),'attributes':['id',_0x5a59('0xfb')],'raw':!![]}]}]})[_0x5a59('0x1e')](handleEntityNotFound(_0x3f6649,null))[_0x5a59('0x1e')](function(_0x21f3b0){if(_0x21f3b0){_0x36da6b=_0x21f3b0;return _0x21f3b0[_0x5a59('0x104')]({'raw':!![]});}})[_0x5a59('0x1e')](function(_0x86ad3e){if(_0x36da6b){if(_0x86ad3e){_0x9aa103=_0x86ad3e;}}return require(_0x5a59('0x76'))['getLicense']();})[_0x5a59('0x1e')](function(_0x58b78f){if(_0x58b78f){_0x1a1910=_0x58b78f['virtual'];_0x149665=_0x58b78f[_0x5a59('0x105')];}})['then'](function(){return db[_0x5a59('0xb5')][_0x5a59('0x2f')]({'where':{'closed':![]}});})[_0x5a59('0x1e')](function(_0x170a23){_0x431e73=_0x170a23;if(_0x1a1910&&_0x170a23>_0x1a1910){return db[_0x5a59('0x106')][_0x5a59('0x61')]({'where':{'id':0x1}})[_0x5a59('0x1e')](function(_0x15b2b9){if(_0x15b2b9){_0x15b2b9[_0x5a59('0x107')](_0x5a59('0x108'));}});}})[_0x5a59('0x1e')](function(){if(_0x36da6b[_0x5a59('0x102')]&&_0x36da6b[_0x5a59('0x102')][_0x5a59('0x103')]){var _0x230a76=[];for(var _0x431e00=0x0;_0x431e00<_0x36da6b['Interval'][_0x5a59('0x103')][_0x5a59('0x46')];_0x431e00++){var _0x40ee88=_0x36da6b[_0x5a59('0x102')][_0x5a59('0x103')][_0x431e00][_0x5a59('0x5a')]({'plain':!![]});_0x230a76[_0x5a59('0x109')](iftimePromise(_0x40ee88,_0x36da6b));}return BPromise[_0x5a59('0x10a')](_0x230a76)[_0x5a59('0x1e')](function(_0xe4aadb){return _[_0x5a59('0x10b')](_0xe4aadb);});}else{return!![];}})['then'](function(_0x19aa53){var _0x2189ad=fs[_0x5a59('0x10c')](path[_0x5a59('0x74')](config[_0x5a59('0x75')],_0x5a59('0x10d')),_0x5a59('0xd0'));var _0xd4dafa={'remote':_0x36da6b[_0x5a59('0x10e')],'query':querystring['stringify'](_[_0x5a59('0x4c')](_0x36da6b[_0x5a59('0x5a')]({'plain':!![]}),{'customerIp':_0x2edf08[_0x5a59('0x88')]['x-forwarded-for']||_0x2edf08[_0x5a59('0x88')][_0x5a59('0x10f')]||_0x2edf08[_0x5a59('0x110')][_0x5a59('0x111')]||_0x2edf08['ip'],'referer':_0x2edf08[_0x5a59('0x88')][_0x5a59('0xaa')],'openedInteractions':_0x431e73,'maxInteractions':_0x1a1910,'virtual':_0x149665['virtual'],'online':_0x19aa53,'custom':_0x149665}))[_0x5a59('0x112')](/'/g,'\x5c\x27')};_0x3f6649[_0x5a59('0x38')](ejs[_0x5a59('0xd1')](Mustache[_0x5a59('0xd1')](_0x2189ad,_0xd4dafa),{'proactiveActions':_0x9aa103,'alignment':_0x36da6b['alignment'],'verticalAlignment':_0x36da6b[_0x5a59('0x113')],'div_color':_0x36da6b[_0x5a59('0xf5')],'text_color':_0x36da6b['textColor'],'button_color':_0x36da6b[_0x5a59('0x114')],'background_color':_0x36da6b[_0x5a59('0x115')]}));})[_0x5a59('0x28')](handleError(_0x3f6649,null));};exports[_0x5a59('0x116')]=function(_0x373a53,_0x54dc4d,_0x4c32f4){return db[_0x5a59('0x4f')][_0x5a59('0x61')]({'where':{'id':_0x373a53[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x54dc4d,null))[_0x5a59('0x1e')](function(_0x121d05){if(_0x121d05){return db[_0x5a59('0xdb')]['transaction'](function(_0x5bd889){return db[_0x5a59('0x9a')]['destroy']({'where':{'ChatWebsiteId':_0x373a53['params']['id']},'transaction':_0x5bd889})[_0x5a59('0x1e')](function(_0x271222){var _0x523849=_['map'](_0x373a53[_0x5a59('0x57')],function(_0x484f75){_0x484f75[_0x5a59('0x5f')]=_0x373a53[_0x5a59('0x54')]['id'];return _0x484f75;});return db[_0x5a59('0x9a')][_0x5a59('0x117')](_0x523849,{'transaction':_0x5bd889});});})[_0x5a59('0x1e')](function(){return db[_0x5a59('0x9a')][_0x5a59('0x118')]({'where':{'ChatWebsiteId':_0x373a53['params']['id']},'order':_0x5a59('0xa0')});});}})['then'](respondWithResult(_0x54dc4d,null))[_0x5a59('0x28')](handleError(_0x54dc4d,null));};exports[_0x5a59('0x119')]=function(_0x1a7985,_0x2a8ae1,_0x2d9e1f){var _0x78842e={};var _0x13ec06={};var _0x28bab6;var _0xb7ff64;return db[_0x5a59('0x4f')]['findOne']({'where':{'id':_0x1a7985[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x2a8ae1,null))[_0x5a59('0x1e')](function(_0x27bcf7){if(_0x27bcf7){_0x28bab6=_0x27bcf7;_0x13ec06[_0x5a59('0x3f')]=_[_0x5a59('0x41')](db[_0x5a59('0x9a')][_0x5a59('0x3d')]);_0x13ec06['query']=_['keys'](_0x1a7985[_0x5a59('0x40')]);_0x13ec06[_0x5a59('0x42')]=_[_0x5a59('0x44')](_0x13ec06[_0x5a59('0x3f')],_0x13ec06[_0x5a59('0x40')]);_0x78842e[_0x5a59('0x43')]=_['intersection'](_0x13ec06[_0x5a59('0x3f')],qs[_0x5a59('0x45')](_0x1a7985[_0x5a59('0x40')][_0x5a59('0x45')]));_0x78842e[_0x5a59('0x43')]=_0x78842e[_0x5a59('0x43')]['length']?_0x78842e[_0x5a59('0x43')]:_0x13ec06[_0x5a59('0x3f')];_0x78842e['order']=qs[_0x5a59('0x49')](_0x1a7985[_0x5a59('0x40')]['sort']);_0x78842e[_0x5a59('0x4b')]=qs[_0x5a59('0x42')](_[_0x5a59('0x62')](_0x1a7985['query'],_0x13ec06[_0x5a59('0x42')]));if(_0x1a7985[_0x5a59('0x40')][_0x5a59('0x4a')]){_0x78842e[_0x5a59('0x4b')]=_[_0x5a59('0x4c')](_0x78842e[_0x5a59('0x4b')],{'$or':_['map'](_0x78842e[_0x5a59('0x43')],function(_0x16c727){var _0x450ede={};_0x450ede[_0x16c727]={'$like':'%'+_0x1a7985[_0x5a59('0x40')][_0x5a59('0x4a')]+'%'};return _0x450ede;})});}_0x78842e=_[_0x5a59('0x4c')]({},_0x78842e,_0x1a7985[_0x5a59('0x4e')]);return _0x28bab6[_0x5a59('0x119')](_0x78842e);}})['then'](function(_0x22c9b3){if(_0x22c9b3){_0xb7ff64=_0x22c9b3[_0x5a59('0x46')];if(!_0x1a7985[_0x5a59('0x40')]['hasOwnProperty'](_0x5a59('0x68'))){_0x78842e[_0x5a59('0x30')]=qs[_0x5a59('0x30')](_0x1a7985['query'][_0x5a59('0x30')]);_0x78842e[_0x5a59('0x2d')]=qs[_0x5a59('0x2d')](_0x1a7985[_0x5a59('0x40')][_0x5a59('0x2d')]);}return _0x28bab6['getApplications'](_0x78842e);}})['then'](function(_0x5bde98){if(_0x5bde98){return _0x5bde98?{'count':_0xb7ff64,'rows':_0x5bde98}:null;}})['then'](respondWithResult(_0x2a8ae1,null))[_0x5a59('0x28')](handleError(_0x2a8ae1,null));};exports[_0x5a59('0x11a')]=function(_0x45627f,_0x5ca501,_0x5d2878){return db[_0x5a59('0x11b')][_0x5a59('0x55')]({'where':{'id':_0x45627f[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x5ca501,null))[_0x5a59('0x1e')](function(_0x25db7b){if(_0x25db7b){return _0x25db7b['addProactiveActions'](_0x45627f['body'][_0x5a59('0x6a')],_[_0x5a59('0x11c')](_0x45627f[_0x5a59('0x57')],['ids','id'])||{});}})[_0x5a59('0x1e')](respondWithResult(_0x5ca501,null))[_0x5a59('0x28')](handleError(_0x5ca501,null));};exports[_0x5a59('0x104')]=function(_0x3971e5,_0x3a8167,_0x5a8e11){var _0x330188={};var _0x1237ef={};var _0x493688;var _0x522683;return db[_0x5a59('0x4f')]['findOne']({'where':{'id':_0x3971e5[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x3a8167,null))[_0x5a59('0x1e')](function(_0xa426a9){if(_0xa426a9){_0x493688=_0xa426a9;_0x1237ef[_0x5a59('0x3f')]=_['keys'](db[_0x5a59('0x11d')]['rawAttributes']);_0x1237ef[_0x5a59('0x40')]=_['keys'](_0x3971e5[_0x5a59('0x40')]);_0x1237ef['filters']=_[_0x5a59('0x44')](_0x1237ef['model'],_0x1237ef[_0x5a59('0x40')]);_0x330188[_0x5a59('0x43')]=_['intersection'](_0x1237ef['model'],qs[_0x5a59('0x45')](_0x3971e5['query']['fields']));_0x330188[_0x5a59('0x43')]=_0x330188[_0x5a59('0x43')][_0x5a59('0x46')]?_0x330188[_0x5a59('0x43')]:_0x1237ef[_0x5a59('0x3f')];_0x330188[_0x5a59('0x48')]=qs[_0x5a59('0x49')](_0x3971e5[_0x5a59('0x40')]['sort']);_0x330188['where']=qs[_0x5a59('0x42')](_[_0x5a59('0x62')](_0x3971e5['query'],_0x1237ef[_0x5a59('0x42')]));if(_0x3971e5[_0x5a59('0x40')][_0x5a59('0x4a')]){_0x330188[_0x5a59('0x4b')]=_[_0x5a59('0x4c')](_0x330188['where'],{'$or':_[_0x5a59('0x3c')](_0x330188[_0x5a59('0x43')],function(_0x3ae71a){var _0x2d5ff1={};_0x2d5ff1[_0x3ae71a]={'$like':'%'+_0x3971e5[_0x5a59('0x40')][_0x5a59('0x4a')]+'%'};return _0x2d5ff1;})});}_0x330188=_[_0x5a59('0x4c')]({},_0x330188,_0x3971e5[_0x5a59('0x4e')]);return _0x493688[_0x5a59('0x104')](_0x330188);}})[_0x5a59('0x1e')](function(_0x3f5123){if(_0x3f5123){_0x522683=_0x3f5123['length'];if(!_0x3971e5[_0x5a59('0x40')][_0x5a59('0x47')](_0x5a59('0x68'))){_0x330188[_0x5a59('0x30')]=qs[_0x5a59('0x30')](_0x3971e5[_0x5a59('0x40')][_0x5a59('0x30')]);_0x330188[_0x5a59('0x2d')]=qs[_0x5a59('0x2d')](_0x3971e5[_0x5a59('0x40')][_0x5a59('0x2d')]);}return _0x493688[_0x5a59('0x104')](_0x330188);}})['then'](function(_0x3a10c7){if(_0x3a10c7){return _0x3a10c7?{'count':_0x522683,'rows':_0x3a10c7}:null;}})[_0x5a59('0x1e')](respondWithResult(_0x3a8167,null))[_0x5a59('0x28')](handleError(_0x3a8167,null));};exports['getFields']=function(_0x3ef5e,_0x7479d0,_0x15ff70){var _0x107a36=_0x3ef5e['query']['online']===_0x5a59('0x11e')?_0x5a59('0x11f'):_0x5a59('0x120');return db['ChatWebsite']['find']({'attributes':['id',_0x107a36],'where':{'id':_0x3ef5e[_0x5a59('0x54')]['id']}})['then'](handleEntityNotFound(_0x7479d0,null))[_0x5a59('0x1e')](function(_0x1ee9e1){if(_0x1ee9e1){var _0x26ff62=_0x1ee9e1[_0x107a36];var _0x11add1=_0x26ff62&&_0x26ff62[_0x5a59('0x121')]?_0x26ff62[_0x5a59('0x121')]:[];_0x7479d0[_0x5a59('0x38')]({'fromKey':_[_0x5a59('0x78')](_0x26ff62['fromKey'])?undefined:_0x26ff62[_0x5a59('0x122')],'count':_0x11add1[_0x5a59('0x46')],'rows':_0x11add1});}})[_0x5a59('0x28')](handleError(_0x7479d0,null));};exports[_0x5a59('0x123')]=function(_0x3095c3,_0x352831,_0x50f069){var _0x1fefce={'raw':![],'where':{}};var _0x5339a3={};var _0x5b68e2={'count':0x0,'rows':[]};return db[_0x5a59('0x4f')][_0x5a59('0x61')]({'where':{'id':_0x3095c3[_0x5a59('0x54')]['id']}})['then'](handleEntityNotFound(_0x352831,null))[_0x5a59('0x1e')](function(_0xa9fdd3){if(_0xa9fdd3){_0x5339a3[_0x5a59('0x3f')]=_['keys'](db[_0x5a59('0xd3')][_0x5a59('0x3d')]);_0x5339a3['query']=_['keys'](_0x3095c3['query']);_0x5339a3[_0x5a59('0x42')]=_[_0x5a59('0x44')](_0x5339a3[_0x5a59('0x3f')],_0x5339a3[_0x5a59('0x40')]);_0x1fefce[_0x5a59('0x43')]=_[_0x5a59('0x44')](_0x5339a3[_0x5a59('0x3f')],qs['fields'](_0x3095c3[_0x5a59('0x40')]['fields']));_0x1fefce[_0x5a59('0x43')]=_0x1fefce[_0x5a59('0x43')][_0x5a59('0x46')]?_0x1fefce[_0x5a59('0x43')]:_0x5339a3[_0x5a59('0x3f')];if(!_0x3095c3[_0x5a59('0x40')][_0x5a59('0x47')](_0x5a59('0x68'))){_0x1fefce[_0x5a59('0x30')]=qs[_0x5a59('0x30')](_0x3095c3[_0x5a59('0x40')][_0x5a59('0x30')]);_0x1fefce[_0x5a59('0x2d')]=qs['offset'](_0x3095c3[_0x5a59('0x40')]['offset']);}_0x1fefce[_0x5a59('0x48')]=qs['sort'](_0x3095c3[_0x5a59('0x40')][_0x5a59('0x49')]);_0x1fefce['where']=qs[_0x5a59('0x42')](_[_0x5a59('0x62')](_0x3095c3[_0x5a59('0x40')],_0x5339a3[_0x5a59('0x42')]));_0x1fefce[_0x5a59('0x4b')][_0x5a59('0x5f')]=_0xa9fdd3['id'];if(_0x3095c3[_0x5a59('0x40')][_0x5a59('0x4a')]){_0x1fefce[_0x5a59('0x4b')]=_[_0x5a59('0x4c')](_0x1fefce['where'],{'$or':_[_0x5a59('0x3c')](_0x1fefce[_0x5a59('0x43')],function(_0x37078b){var _0x116809={};_0x116809[_0x37078b]={'$like':'%'+_0x3095c3[_0x5a59('0x40')][_0x5a59('0x4a')]+'%'};return _0x116809;})});}_0x1fefce=_[_0x5a59('0x4c')]({},_0x1fefce,_0x3095c3[_0x5a59('0x4e')]);return db[_0x5a59('0xd3')][_0x5a59('0x2f')]({'where':_0x1fefce[_0x5a59('0x4b')]})[_0x5a59('0x1e')](function(_0x2c5345){_0x5b68e2['count']=_0x2c5345;if(_0x3095c3['query'][_0x5a59('0x50')]){_0x1fefce[_0x5a59('0x51')]=[{'all':!![]}];}else{_0x1fefce[_0x5a59('0x51')]=[{'model':db[_0x5a59('0x8c')],'as':_0x5a59('0x124'),'required':![]},{'model':db['Attachment'],'as':_0x5a59('0x125'),'required':![]}];}return db[_0x5a59('0xd3')][_0x5a59('0x52')](_0x1fefce);})['then'](function(_0x15c16f){_0x5b68e2['rows']=_0x15c16f;return _0x5b68e2;});}})['then'](respondWithFilteredResult(_0x352831,_0x1fefce))[_0x5a59('0x28')](handleError(_0x352831,null));};exports[_0x5a59('0x126')]=function(_0x395738,_0x48b5a0,_0x652c84){return db['ChatWebsite']['find']({'where':{'id':_0x395738[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x48b5a0,null))[_0x5a59('0x1e')](function(_0x110ce8){if(_0x110ce8){return _0x110ce8[_0x5a59('0x126')](_0x395738['body']['ids'],_[_0x5a59('0x11c')](_0x395738['body'],[_0x5a59('0x6a'),'id'])||{})['spread'](function(_0x4decae){for(var _0x512849=0x0;_0x512849<_0x395738[_0x5a59('0x57')][_0x5a59('0x6a')][_0x5a59('0x46')];_0x512849+=0x1){socket[_0x5a59('0x127')](_0x5a59('0x128'),{'UserId':Number(_0x395738[_0x5a59('0x57')][_0x5a59('0x6a')][_0x512849]),'ChatWebsiteId':Number(_0x395738[_0x5a59('0x54')]['id'])});}return _0x4decae;});}})['then'](respondWithResult(_0x48b5a0,null))[_0x5a59('0x28')](handleError(_0x48b5a0,null));};exports['removeAgents']=function(_0x500eaf,_0x2aec84,_0xfdb711){return db[_0x5a59('0x4f')][_0x5a59('0x55')]({'where':{'id':_0x500eaf[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x2aec84,null))[_0x5a59('0x1e')](function(_0x962af6){if(_0x962af6){return _0x962af6[_0x5a59('0x129')](_0x500eaf[_0x5a59('0x40')]['ids'])[_0x5a59('0x1e')](function(){if(_['isArray'](_0x500eaf['query']['ids'])){for(var _0x917bb8=0x0;_0x917bb8<_0x500eaf['query'][_0x5a59('0x6a')][_0x5a59('0x46')];_0x917bb8+=0x1){socket[_0x5a59('0x127')]('userChatWebsite:remove',{'UserId':Number(_0x500eaf[_0x5a59('0x40')][_0x5a59('0x6a')][_0x917bb8]),'ChatWebsiteId':Number(_0x500eaf['params']['id'])});}}else{socket[_0x5a59('0x127')](_0x5a59('0x12a'),{'UserId':Number(_0x500eaf[_0x5a59('0x40')][_0x5a59('0x6a')]),'ChatWebsiteId':Number(_0x500eaf['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2aec84,null))[_0x5a59('0x28')](handleError(_0x2aec84,null));};exports[_0x5a59('0x12b')]=function(_0x2ddede,_0x158dcb,_0xfc5e76){var _0x3424ca={};var _0x3170ce={};var _0x4abe73;var _0xd9682c;return db[_0x5a59('0x4f')][_0x5a59('0x61')]({'where':{'id':_0x2ddede[_0x5a59('0x54')]['id']}})['then'](handleEntityNotFound(_0x158dcb,null))[_0x5a59('0x1e')](function(_0x1e2b3f){if(_0x1e2b3f){_0x4abe73=_0x1e2b3f;_0x3170ce[_0x5a59('0x3f')]=_[_0x5a59('0x41')](db['User'][_0x5a59('0x3d')]);_0x3170ce[_0x5a59('0x40')]=_[_0x5a59('0x41')](_0x2ddede[_0x5a59('0x40')]);_0x3170ce['filters']=_[_0x5a59('0x44')](_0x3170ce['model'],_0x3170ce['query']);_0x3424ca[_0x5a59('0x43')]=_[_0x5a59('0x44')](_0x3170ce['model'],qs[_0x5a59('0x45')](_0x2ddede[_0x5a59('0x40')][_0x5a59('0x45')]));_0x3424ca[_0x5a59('0x43')]=_0x3424ca[_0x5a59('0x43')]['length']?_0x3424ca['attributes']:_0x3170ce[_0x5a59('0x3f')];_0x3424ca['order']=qs[_0x5a59('0x49')](_0x2ddede['query'][_0x5a59('0x49')]);_0x3424ca[_0x5a59('0x4b')]=qs[_0x5a59('0x42')](_[_0x5a59('0x62')](_0x2ddede[_0x5a59('0x40')],_0x3170ce[_0x5a59('0x42')]));if(_0x2ddede['query'][_0x5a59('0x4a')]){_0x3424ca[_0x5a59('0x4b')]=_[_0x5a59('0x4c')](_0x3424ca[_0x5a59('0x4b')],{'$or':_[_0x5a59('0x3c')](_0x3424ca[_0x5a59('0x43')],function(_0x213bca){var _0x1e968c={};_0x1e968c[_0x213bca]={'$like':'%'+_0x2ddede[_0x5a59('0x40')][_0x5a59('0x4a')]+'%'};return _0x1e968c;})});}_0x3424ca=_[_0x5a59('0x4c')]({},_0x3424ca,_0x2ddede[_0x5a59('0x4e')]);return _0x4abe73[_0x5a59('0x12b')](_0x3424ca);}})[_0x5a59('0x1e')](function(_0x202b3d){if(_0x202b3d){_0xd9682c=_0x202b3d['length'];if(!_0x2ddede[_0x5a59('0x40')][_0x5a59('0x47')](_0x5a59('0x68'))){_0x3424ca[_0x5a59('0x30')]=qs[_0x5a59('0x30')](_0x2ddede[_0x5a59('0x40')][_0x5a59('0x30')]);_0x3424ca['offset']=qs[_0x5a59('0x2d')](_0x2ddede[_0x5a59('0x40')][_0x5a59('0x2d')]);}return _0x4abe73[_0x5a59('0x12b')](_0x3424ca);}})[_0x5a59('0x1e')](function(_0x39599f){if(_0x39599f){return _0x39599f?{'count':_0xd9682c,'rows':_0x39599f}:null;}})[_0x5a59('0x1e')](respondWithResult(_0x158dcb,null))[_0x5a59('0x28')](handleError(_0x158dcb,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index a5e454d..508339e 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 _0x795a=['exports','../../mysqldb','ChatWebsite','save','remove','emit','hasOwnProperty'];(function(_0x45e488,_0x3b5665){var _0x2c4fbc=function(_0x509886){while(--_0x509886){_0x45e488['push'](_0x45e488['shift']());}};_0x2c4fbc(++_0x3b5665);}(_0x795a,0xa2));var _0xa795=function(_0x2fb89a,_0x49823a){_0x2fb89a=_0x2fb89a-0x0;var _0x4460d5=_0x795a[_0x2fb89a];return _0x4460d5;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xa795('0x0'))['db'][_0xa795('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa795('0x2'),'afterUpdate':'update','afterDestroy':_0xa795('0x3')};function emitEvent(_0x1651a6){return function(_0x4ce3a0,_0x4f7e4e,_0x174575){ChatWebsiteEvents[_0xa795('0x4')](_0x1651a6+':'+_0x4ce3a0['id'],_0x4ce3a0);ChatWebsiteEvents[_0xa795('0x4')](_0x1651a6,_0x4ce3a0);_0x174575(null);};}for(var e in events){if(events[_0xa795('0x5')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xa795('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xfd0f=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xfd0f,0x1b8));var _0xffd0=function(_0x48b764,_0x36a3be){_0x48b764=_0x48b764-0x0;var _0x1a4d80=_0xfd0f[_0x48b764];return _0x1a4d80;};'use strict';var EventEmitter=require(_0xffd0('0x0'));var ChatWebsite=require(_0xffd0('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xffd0('0x2')](0x0);var events={'afterCreate':_0xffd0('0x3'),'afterUpdate':_0xffd0('0x4'),'afterDestroy':'remove'};function emitEvent(_0x33e4d8){return function(_0x5e9c0a,_0x303f38,_0x45ecf8){ChatWebsiteEvents[_0xffd0('0x5')](_0x33e4d8+':'+_0x5e9c0a['id'],_0x5e9c0a);ChatWebsiteEvents[_0xffd0('0x5')](_0x33e4d8,_0x5e9c0a);_0x45ecf8(null);};}for(var e in events){if(events[_0xffd0('0x6')](e)){var event=events[e];ChatWebsite[_0xffd0('0x7')](e,emitEvent(event));}}module[_0xffd0('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index fb6a9fb..6f20ac8 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 _0xbd0a=['rimraf','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','util','bluebird','request-promise'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0xbd0a,0x13c));var _0xabd0=function(_0x164ad3,_0x56ccbe){_0x164ad3=_0x164ad3-0x0;var _0x5393a1=_0xbd0a[_0x164ad3];return _0x5393a1;};'use strict';var _=require(_0xabd0('0x0'));var util=require(_0xabd0('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xabd0('0x2'));var rp=require(_0xabd0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xabd0('0x4'));var config=require(_0xabd0('0x5'));var attributes=require(_0xabd0('0x6'));module[_0xabd0('0x7')]=function(_0x4aeb16,_0xe652d7){return _0x4aeb16['define'](_0xabd0('0x8'),attributes,{'tableName':_0xabd0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x44f3=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','util','../../config/logger'];(function(_0x35387d,_0x1ba72f){var _0x3aba56=function(_0x42cd08){while(--_0x42cd08){_0x35387d['push'](_0x35387d['shift']());}};_0x3aba56(++_0x1ba72f);}(_0x44f3,0xc1));var _0x344f=function(_0x3689a2,_0x1be4ee){_0x3689a2=_0x3689a2-0x0;var _0x14b146=_0x44f3[_0x3689a2];return _0x14b146;};'use strict';var _=require('lodash');var util=require(_0x344f('0x0'));var logger=require(_0x344f('0x1'))(_0x344f('0x2'));var moment=require(_0x344f('0x3'));var BPromise=require(_0x344f('0x4'));var rp=require(_0x344f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x344f('0x6'));var config=require(_0x344f('0x7'));var attributes=require(_0x344f('0x8'));module[_0x344f('0x9')]=function(_0x5bc4ba,_0x53a536){return _0x5bc4ba[_0x344f('0xa')](_0x344f('0xb'),attributes,{'tableName':_0x344f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 4221ddb..dfa69db 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 _0x878e=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./chatWebsite.socket','register','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x8db656,_0x5784b1){var _0x5ed99f=function(_0xb8ff48){while(--_0xb8ff48){_0x8db656['push'](_0x8db656['shift']());}};_0x5ed99f(++_0x5784b1);}(_0x878e,0x1e1));var _0xe878=function(_0x1b143b,_0x4697e){_0x1b143b=_0x1b143b-0x0;var _0xf48cc7=_0x878e[_0x1b143b];return _0xf48cc7;};'use strict';var _=require(_0xe878('0x0'));var util=require(_0xe878('0x1'));var moment=require(_0xe878('0x2'));var BPromise=require(_0xe878('0x3'));var rs=require(_0xe878('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe878('0x5'))['db'];var utils=require(_0xe878('0x6'));var logger=require(_0xe878('0x7'))(_0xe878('0x8'));var config=require(_0xe878('0x9'));var jayson=require(_0xe878('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xe878('0xb')]=_[_0xe878('0xc')](config['redis'],{'host':_0xe878('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe878('0xb')]));require(_0xe878('0xe'))[_0xe878('0xf')](socket);function respondWithRpcPromise(_0x4829a0,_0x358c7c,_0x2075f3){return new BPromise(function(_0x1308ca,_0x5ca0a0){return client['request'](_0x4829a0,_0x2075f3)[_0xe878('0x10')](function(_0x54cad9){logger[_0xe878('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x358c7c,_0xe878('0x12'));logger[_0xe878('0x13')](_0xe878('0x14'),_0x358c7c,_0xe878('0x12'),JSON[_0xe878('0x15')](_0x54cad9));if(_0x54cad9[_0xe878('0x16')]){if(_0x54cad9[_0xe878('0x16')][_0xe878('0x17')]===0x1f4){logger[_0xe878('0x16')](_0xe878('0x18'),_0x358c7c,_0x54cad9[_0xe878('0x16')]['message']);return _0x5ca0a0(_0x54cad9[_0xe878('0x16')][_0xe878('0x19')]);}logger[_0xe878('0x16')](_0xe878('0x18'),_0x358c7c,_0x54cad9[_0xe878('0x16')]['message']);return _0x1308ca(_0x54cad9[_0xe878('0x16')][_0xe878('0x19')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x358c7c,_0xe878('0x12'));_0x1308ca(_0x54cad9[_0xe878('0x1a')]['message']);}})['catch'](function(_0x33cf44){logger[_0xe878('0x16')](_0xe878('0x18'),_0x358c7c,_0x33cf44);_0x5ca0a0(_0x33cf44);});});}
\ No newline at end of file
+var _0x70d7=['debug','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent'];(function(_0x12bcf7,_0xc11103){var _0x2825a=function(_0x4452ba){while(--_0x4452ba){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x2825a(++_0xc11103);}(_0x70d7,0xc7));var _0x770d=function(_0x43384e,_0x5ba50a){_0x43384e=_0x43384e-0x0;var _0x267ac6=_0x70d7[_0x43384e];return _0x267ac6;};'use strict';var _=require(_0x770d('0x0'));var util=require(_0x770d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x770d('0x2'));var fs=require('fs');var Redis=require(_0x770d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x770d('0x4'));var logger=require('../../config/logger')(_0x770d('0x5'));var config=require('../../config/environment');var jayson=require(_0x770d('0x6'));var client=jayson[_0x770d('0x7')]['http']({'port':0x232a});config[_0x770d('0x8')]=_[_0x770d('0x9')](config[_0x770d('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x770d('0xa'))(new Redis(config[_0x770d('0x8')]));require(_0x770d('0xb'))[_0x770d('0xc')](socket);function respondWithRpcPromise(_0x3cbeb8,_0x1ccc5a,_0x57e7de){return new BPromise(function(_0x36f3bd,_0x21af4b){return client['request'](_0x3cbeb8,_0x57e7de)[_0x770d('0xd')](function(_0x5bb87b){logger[_0x770d('0xe')](_0x770d('0xf'),_0x1ccc5a,_0x770d('0x10'));logger[_0x770d('0x11')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1ccc5a,_0x770d('0x10'),JSON[_0x770d('0x12')](_0x5bb87b));if(_0x5bb87b[_0x770d('0x13')]){if(_0x5bb87b[_0x770d('0x13')][_0x770d('0x14')]===0x1f4){logger[_0x770d('0x13')](_0x770d('0xf'),_0x1ccc5a,_0x5bb87b[_0x770d('0x13')][_0x770d('0x15')]);return _0x21af4b(_0x5bb87b['error'][_0x770d('0x15')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x1ccc5a,_0x5bb87b['error']['message']);return _0x36f3bd(_0x5bb87b['error'][_0x770d('0x15')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x1ccc5a,_0x770d('0x10'));_0x36f3bd(_0x5bb87b[_0x770d('0x16')][_0x770d('0x15')]);}})[_0x770d('0x17')](function(_0x364dc6){logger[_0x770d('0x13')](_0x770d('0xf'),_0x1ccc5a,_0x364dc6);_0x21af4b(_0x364dc6);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index d0a56af..ef1a56c 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 _0xf700=['save','remove','update','chatWebsite:','./chatWebsite.events'];(function(_0x2f3168,_0x1ee88a){var _0x1fa716=function(_0x33c240){while(--_0x33c240){_0x2f3168['push'](_0x2f3168['shift']());}};_0x1fa716(++_0x1ee88a);}(_0xf700,0xc7));var _0x0f70=function(_0x2ecc6f,_0x25b176){_0x2ecc6f=_0x2ecc6f-0x0;var _0x27f30e=_0xf700[_0x2ecc6f];return _0x27f30e;};'use strict';var ChatWebsiteEvents=require(_0x0f70('0x0'));var events=[_0x0f70('0x1'),_0x0f70('0x2'),_0x0f70('0x3')];function createListener(_0x45817e,_0x1e96e4){return function(_0x1ef282){_0x1e96e4['emit'](_0x45817e,_0x1ef282);};}function removeListener(_0x48adc8,_0x312eee){return function(){ChatWebsiteEvents['removeListener'](_0x48adc8,_0x312eee);};}exports['register']=function(_0x418f2d){for(var _0x5480de=0x0,_0x51851c=events['length'];_0x5480de<_0x51851c;_0x5480de++){var _0x6caee6=events[_0x5480de];var _0x3c1ac6=createListener(_0x0f70('0x4')+_0x6caee6,_0x418f2d);ChatWebsiteEvents['on'](_0x6caee6,_0x3c1ac6);}};
\ No newline at end of file
+var _0xafa0=['register','length','chatWebsite:','./chatWebsite.events','remove','update','removeListener'];(function(_0x2d08d2,_0x22d0c1){var _0x5b91e9=function(_0x4c93b2){while(--_0x4c93b2){_0x2d08d2['push'](_0x2d08d2['shift']());}};_0x5b91e9(++_0x22d0c1);}(_0xafa0,0x1c3));var _0x0afa=function(_0x3f3106,_0x4c0729){_0x3f3106=_0x3f3106-0x0;var _0x596ee8=_0xafa0[_0x3f3106];return _0x596ee8;};'use strict';var ChatWebsiteEvents=require(_0x0afa('0x0'));var events=['save',_0x0afa('0x1'),_0x0afa('0x2')];function createListener(_0x2ae8e2,_0x1115ce){return function(_0x248bd8){_0x1115ce['emit'](_0x2ae8e2,_0x248bd8);};}function removeListener(_0x1f2647,_0xceb4a){return function(){ChatWebsiteEvents[_0x0afa('0x3')](_0x1f2647,_0xceb4a);};}exports[_0x0afa('0x4')]=function(_0x4f4f66){for(var _0xda2853=0x0,_0x4cc661=events[_0x0afa('0x5')];_0xda2853<_0x4cc661;_0xda2853++){var _0x4bb7b0=events[_0xda2853];var _0x2f411d=createListener(_0x0afa('0x6')+_0x4bb7b0,_0x4f4f66);ChatWebsiteEvents['on'](_0x4bb7b0,_0x2f411d);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index c1ef201..4a26711 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 _0x1a54=['./chatWebsite.controller','get','isAuthenticated','/describe','/:id','show','getDispositions','getAnswers','getLogo','getAvatar','/:id/customer_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','format','%s-%s','now','/:id/logo','single','file','addLogo','originalname','addAvatar','server/files/images/avatars/','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','/:id/dispositions','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x1a54,0xde));var _0x41a5=function(_0x57e9d3,_0x3cad3c){_0x57e9d3=_0x57e9d3-0x0;var _0x180326=_0x1a54[_0x57e9d3];return _0x180326;};'use strict';var multer=require(_0x41a5('0x0'));var util=require(_0x41a5('0x1'));var path=require(_0x41a5('0x2'));var timeout=require(_0x41a5('0x3'));var express=require(_0x41a5('0x4'));var router=express[_0x41a5('0x5')]();var fs_extra=require(_0x41a5('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x41a5('0x7'));var config=require(_0x41a5('0x8'));var controller=require(_0x41a5('0x9'));router[_0x41a5('0xa')]('/',auth[_0x41a5('0xb')](),controller['index']);router['get'](_0x41a5('0xc'),auth[_0x41a5('0xb')](),controller['describe']);router[_0x41a5('0xa')](_0x41a5('0xd'),auth[_0x41a5('0xb')](),controller[_0x41a5('0xe')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x41a5('0xf')]);router['get']('/:id/canned_answers',auth[_0x41a5('0xb')](),controller[_0x41a5('0x10')]);router[_0x41a5('0xa')]('/:id/logo',controller[_0x41a5('0x11')]);router[_0x41a5('0xa')]('/:id/avatar',controller[_0x41a5('0x12')]);router['get'](_0x41a5('0x13'),controller['getCustomerAvatar']);router[_0x41a5('0xa')]('/:id/system_avatar',controller[_0x41a5('0x14')]);router[_0x41a5('0xa')](_0x41a5('0x15'),auth[_0x41a5('0xb')](),controller[_0x41a5('0x16')]);router[_0x41a5('0xa')](_0x41a5('0x17'),controller[_0x41a5('0x18')]);router[_0x41a5('0xa')](_0x41a5('0x19'),auth[_0x41a5('0xb')](),controller[_0x41a5('0x1a')]);router[_0x41a5('0xa')](_0x41a5('0x1b'),auth[_0x41a5('0xb')](),controller[_0x41a5('0x1c')]);router[_0x41a5('0xa')](_0x41a5('0x1d'),controller[_0x41a5('0x1e')]);router[_0x41a5('0xa')]('/:id/offline_messages',auth[_0x41a5('0xb')](),controller[_0x41a5('0x1f')]);router[_0x41a5('0xa')](_0x41a5('0x20'),auth[_0x41a5('0xb')](),controller[_0x41a5('0x21')]);router[_0x41a5('0x22')]('/',auth[_0x41a5('0xb')](),controller['create']);router[_0x41a5('0x22')]('/:id/dispositions',auth[_0x41a5('0xb')](),controller[_0x41a5('0x23')]);router[_0x41a5('0x22')](_0x41a5('0x24'),auth[_0x41a5('0xb')](),controller[_0x41a5('0x25')]);var upload=multer({'storage':multer[_0x41a5('0x26')]({'destination':function(_0x3af50f,_0x529258,_0x3e6c16){_0x3e6c16(null,path[_0x41a5('0x27')](config[_0x41a5('0x28')],'server/files/images/logos/'));},'filename':function(_0x53ff23,_0x2399ab,_0x998ba5){_0x998ba5(null,util[_0x41a5('0x29')](_0x41a5('0x2a'),Date[_0x41a5('0x2b')](),_0x2399ab['originalname']));}})});router[_0x41a5('0x22')](_0x41a5('0x2c'),upload[_0x41a5('0x2d')](_0x41a5('0x2e')),controller[_0x41a5('0x2f')]);var upload=multer({'storage':multer[_0x41a5('0x26')]({'destination':function(_0x367830,_0x1d5bbc,_0x542493){_0x542493(null,path[_0x41a5('0x27')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x238ad8,_0x3fe431,_0xe01629){_0xe01629(null,util[_0x41a5('0x29')](_0x41a5('0x2a'),Date[_0x41a5('0x2b')](),_0x3fe431[_0x41a5('0x30')]));}})});router[_0x41a5('0x22')]('/:id/avatar',upload[_0x41a5('0x2d')]('file'),controller[_0x41a5('0x31')]);var upload=multer({'storage':multer[_0x41a5('0x26')]({'destination':function(_0x4c8502,_0x1dab80,_0x48e262){_0x48e262(null,path[_0x41a5('0x27')](config[_0x41a5('0x28')],_0x41a5('0x32')));},'filename':function(_0x51b8ca,_0x7a0d57,_0x3ca0c2){_0x3ca0c2(null,util[_0x41a5('0x29')](_0x41a5('0x2a'),Date[_0x41a5('0x2b')](),_0x7a0d57[_0x41a5('0x30')]));}})});router[_0x41a5('0x22')](_0x41a5('0x13'),upload[_0x41a5('0x2d')](_0x41a5('0x2e')),controller[_0x41a5('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x43441b,_0x16f235,_0x394c14){_0x394c14(null,path[_0x41a5('0x27')](config[_0x41a5('0x28')],_0x41a5('0x32')));},'filename':function(_0x20fd68,_0x493bff,_0x151809){_0x151809(null,util[_0x41a5('0x29')](_0x41a5('0x2a'),Date[_0x41a5('0x2b')](),_0x493bff['originalname']));}})});router[_0x41a5('0x22')](_0x41a5('0x34'),upload[_0x41a5('0x2d')](_0x41a5('0x2e')),controller[_0x41a5('0x35')]);router[_0x41a5('0x22')](_0x41a5('0x36'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x41a5('0x26')]({'destination':function(_0x245278,_0x18fd18,_0x5121cd){const _0xa40214=path[_0x41a5('0x27')](config[_0x41a5('0x28')],_0x41a5('0x37'),_0x41a5('0x38'),_0x41a5('0x39'));fs_extra[_0x41a5('0x3a')](_0xa40214,function(){_0x5121cd(null,_0xa40214);});},'filename':function(_0x3f9d88,_0x54b834,_0xf2cbbc){const _0x438228=_0x54b834[_0x41a5('0x30')][_0x41a5('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x418f17=path[_0x41a5('0x3c')](_0x438228);const _0xe5ed1b=Date[_0x41a5('0x2b')]()+'-'+_0x438228[_0x41a5('0x3b')](_0x418f17,'')+_0x418f17;_0xf2cbbc(null,_0xe5ed1b);}})});router[_0x41a5('0x22')](_0x41a5('0x3d'),offlineUploadMulter[_0x41a5('0x3e')](),controller[_0x41a5('0x3f')]);router[_0x41a5('0x22')](_0x41a5('0x15'),auth[_0x41a5('0xb')](),controller[_0x41a5('0x40')]);router[_0x41a5('0x22')](_0x41a5('0x19'),auth['isAuthenticated'](),controller[_0x41a5('0x41')]);router[_0x41a5('0x22')](_0x41a5('0x1b'),auth[_0x41a5('0xb')](),controller[_0x41a5('0x42')]);router['post'](_0x41a5('0x20'),auth[_0x41a5('0xb')](),controller[_0x41a5('0x43')]);router[_0x41a5('0x44')](_0x41a5('0xd'),auth[_0x41a5('0xb')](),controller[_0x41a5('0x45')]);router[_0x41a5('0x46')](_0x41a5('0xd'),auth['isAuthenticated'](),controller[_0x41a5('0x47')]);router[_0x41a5('0x46')](_0x41a5('0x48'),auth['isAuthenticated'](),controller[_0x41a5('0x49')]);router[_0x41a5('0x46')]('/:id/canned_answers',auth[_0x41a5('0xb')](),controller[_0x41a5('0x4a')]);router[_0x41a5('0x46')]('/:id/users',auth[_0x41a5('0xb')](),controller[_0x41a5('0x4b')]);module[_0x41a5('0x4c')]=router;
\ No newline at end of file
+var _0x76a0=['root','server/files/images/logos/','format','%s-%s','originalname','/:id/logo','addLogo','now','file','addAvatar','server/files/images/avatars/','single','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','diskStorage','server/files','attachments','ensureDir','replace','extname','/:id/offline','any','/:id/applications','addApplications','delete','destroy','removeDispositions','removeAgents','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','show','/:id/dispositions','getDispositions','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','addDisposition','/:id/canned_answers','addAnswer','join'];(function(_0x38af48,_0x400460){var _0x445384=function(_0x464435){while(--_0x464435){_0x38af48['push'](_0x38af48['shift']());}};_0x445384(++_0x400460);}(_0x76a0,0x68));var _0x076a=function(_0x7bfe1b,_0x3eb3c3){_0x7bfe1b=_0x7bfe1b-0x0;var _0x24e555=_0x76a0[_0x7bfe1b];return _0x24e555;};'use strict';var multer=require(_0x076a('0x0'));var util=require(_0x076a('0x1'));var path=require('path');var timeout=require(_0x076a('0x2'));var express=require('express');var router=express[_0x076a('0x3')]();var fs_extra=require(_0x076a('0x4'));var auth=require(_0x076a('0x5'));var interaction=require(_0x076a('0x6'));var config=require(_0x076a('0x7'));var controller=require(_0x076a('0x8'));router[_0x076a('0x9')]('/',auth[_0x076a('0xa')](),controller[_0x076a('0xb')]);router[_0x076a('0x9')]('/describe',auth[_0x076a('0xa')](),controller[_0x076a('0xc')]);router[_0x076a('0x9')]('/:id',auth[_0x076a('0xa')](),controller[_0x076a('0xd')]);router[_0x076a('0x9')](_0x076a('0xe'),auth[_0x076a('0xa')](),controller[_0x076a('0xf')]);router[_0x076a('0x9')]('/:id/canned_answers',auth[_0x076a('0xa')](),controller[_0x076a('0x10')]);router[_0x076a('0x9')]('/:id/logo',controller[_0x076a('0x11')]);router[_0x076a('0x9')](_0x076a('0x12'),controller[_0x076a('0x13')]);router[_0x076a('0x9')](_0x076a('0x14'),controller['getCustomerAvatar']);router['get']('/:id/system_avatar',controller[_0x076a('0x15')]);router[_0x076a('0x9')](_0x076a('0x16'),auth['isAuthenticated'](),controller[_0x076a('0x17')]);router[_0x076a('0x9')](_0x076a('0x18'),controller[_0x076a('0x19')]);router[_0x076a('0x9')]('/:id/applications',auth['isAuthenticated'](),controller[_0x076a('0x1a')]);router[_0x076a('0x9')](_0x076a('0x1b'),auth[_0x076a('0xa')](),controller[_0x076a('0x1c')]);router[_0x076a('0x9')](_0x076a('0x1d'),controller[_0x076a('0x1e')]);router[_0x076a('0x9')](_0x076a('0x1f'),auth[_0x076a('0xa')](),controller[_0x076a('0x20')]);router[_0x076a('0x9')](_0x076a('0x21'),auth['isAuthenticated'](),controller['getAgents']);router[_0x076a('0x22')]('/',auth[_0x076a('0xa')](),controller[_0x076a('0x23')]);router[_0x076a('0x22')](_0x076a('0xe'),auth['isAuthenticated'](),controller[_0x076a('0x24')]);router[_0x076a('0x22')](_0x076a('0x25'),auth[_0x076a('0xa')](),controller[_0x076a('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x320438,_0xf954a8,_0x20b282){_0x20b282(null,path[_0x076a('0x27')](config[_0x076a('0x28')],_0x076a('0x29')));},'filename':function(_0x5b1e45,_0x537623,_0x1407fc){_0x1407fc(null,util[_0x076a('0x2a')](_0x076a('0x2b'),Date['now'](),_0x537623[_0x076a('0x2c')]));}})});router[_0x076a('0x22')](_0x076a('0x2d'),upload['single']('file'),controller[_0x076a('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x54680c,_0x4a0d85,_0x59eeee){_0x59eeee(null,path[_0x076a('0x27')](config[_0x076a('0x28')],'server/files/images/avatars/'));},'filename':function(_0x827c41,_0xf99590,_0x2811b9){_0x2811b9(null,util[_0x076a('0x2a')](_0x076a('0x2b'),Date[_0x076a('0x2f')](),_0xf99590[_0x076a('0x2c')]));}})});router['post'](_0x076a('0x12'),upload['single'](_0x076a('0x30')),controller[_0x076a('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x588356,_0x58dd94,_0x4fa5d9){_0x4fa5d9(null,path[_0x076a('0x27')](config[_0x076a('0x28')],_0x076a('0x32')));},'filename':function(_0x27aff6,_0x4cbc21,_0x37c8c4){_0x37c8c4(null,util[_0x076a('0x2a')](_0x076a('0x2b'),Date[_0x076a('0x2f')](),_0x4cbc21[_0x076a('0x2c')]));}})});router[_0x076a('0x22')](_0x076a('0x14'),upload[_0x076a('0x33')]('file'),controller[_0x076a('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5429db,_0x419ae6,_0x1075a6){_0x1075a6(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x3817e7,_0x37d0c3,_0x554d14){_0x554d14(null,util[_0x076a('0x2a')](_0x076a('0x2b'),Date[_0x076a('0x2f')](),_0x37d0c3[_0x076a('0x2c')]));}})});router['post'](_0x076a('0x35'),upload['single'](_0x076a('0x30')),controller[_0x076a('0x36')]);router[_0x076a('0x22')](_0x076a('0x37'),controller[_0x076a('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0x076a('0x39')]({'destination':function(_0x1226db,_0x305f44,_0xa0ea2c){const _0x2a9e97=path[_0x076a('0x27')](config['root'],_0x076a('0x3a'),_0x076a('0x3b'),'offline-chat');fs_extra[_0x076a('0x3c')](_0x2a9e97,function(){_0xa0ea2c(null,_0x2a9e97);});},'filename':function(_0x58b2d4,_0x47ff10,_0x29f23c){const _0x1cbd37=_0x47ff10[_0x076a('0x2c')][_0x076a('0x3d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xc32d98=path[_0x076a('0x3e')](_0x1cbd37);const _0x8ccbe0=Date['now']()+'-'+_0x1cbd37['replace'](_0xc32d98,'')+_0xc32d98;_0x29f23c(null,_0x8ccbe0);}})});router[_0x076a('0x22')](_0x076a('0x3f'),offlineUploadMulter[_0x076a('0x40')](),controller['offline']);router[_0x076a('0x22')]('/:id/interactions',auth[_0x076a('0xa')](),controller['addInteraction']);router[_0x076a('0x22')](_0x076a('0x41'),auth[_0x076a('0xa')](),controller[_0x076a('0x42')]);router[_0x076a('0x22')](_0x076a('0x1b'),auth['isAuthenticated'](),controller['addProactiveActions']);router['post'](_0x076a('0x21'),auth['isAuthenticated'](),controller['addAgents']);router['put']('/:id',auth[_0x076a('0xa')](),controller['update']);router[_0x076a('0x43')]('/:id',auth[_0x076a('0xa')](),controller[_0x076a('0x44')]);router[_0x076a('0x43')]('/:id/dispositions',auth[_0x076a('0xa')](),controller[_0x076a('0x45')]);router[_0x076a('0x43')](_0x076a('0x25'),auth[_0x076a('0xa')](),controller['removeAnswers']);router['delete'](_0x076a('0x21'),auth[_0x076a('0xa')](),controller[_0x076a('0x46')]);module[_0x076a('0x47')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 6aeb3f4..92c71c1 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 _0x0618=['exports','ENUM','AmazonAWS','STRING','sequelize'];(function(_0x3f8f4a,_0x1b41db){var _0x1e179e=function(_0x5557e0){while(--_0x5557e0){_0x3f8f4a['push'](_0x3f8f4a['shift']());}};_0x1e179e(++_0x1b41db);}(_0x0618,0x1c6));var _0x8061=function(_0xed2989,_0x35b120){_0xed2989=_0xed2989-0x0;var _0x4e6b11=_0x0618[_0xed2989];return _0x4e6b11;};'use strict';var Sequelize=require(_0x8061('0x0'));module[_0x8061('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x8061('0x2')](_0x8061('0x3'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x8061('0x4')]}};
\ No newline at end of file
+var _0xb46f=['Google','STRING','sequelize','exports','ENUM','AmazonAWS'];(function(_0x4c887a,_0x3e4d93){var _0x604810=function(_0x153ece){while(--_0x153ece){_0x4c887a['push'](_0x4c887a['shift']());}};_0x604810(++_0x3e4d93);}(_0xb46f,0xb6));var _0xfb46=function(_0x2f06a0,_0x4c9c08){_0x2f06a0=_0x2f06a0-0x0;var _0xc77f94=_0xb46f[_0x2f06a0];return _0xc77f94;};'use strict';var Sequelize=require(_0xfb46('0x0'));module[_0xfb46('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xfb46('0x2')](_0xfb46('0x3'),_0xfb46('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xfb46('0x5')]},'data2':{'type':Sequelize[_0xfb46('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 23a260f..c605ed9 100644
--- a/server/api/cloudProvider/cloudProvider.controller.js
+++ b/server/api/cloudProvider/cloudProvider.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CloudProvider','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x2cebb8,_0x5c4767){var _0x27ea64=function(_0x2ae721){while(--_0x2ae721){_0x2cebb8['push'](_0x2cebb8['shift']());}};_0x27ea64(++_0x5c4767);}(_0x2ef3,0xba));var _0x32ef=function(_0x3be5d4,_0x537f82){_0x3be5d4=_0x3be5d4-0x0;var _0x17394d=_0x2ef3[_0x3be5d4];return _0x17394d;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['CloudProvider'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':!![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['CloudProvider'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['CloudProvider']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));};
\ No newline at end of file
+var _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CloudProvider','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x30638f,_0x33b6ec){var _0xed4d2=function(_0x4fa757){while(--_0x4fa757){_0x30638f['push'](_0x30638f['shift']());}};_0xed4d2(++_0x33b6ec);}(_0x2ef3,0xba));var _0x32ef=function(_0x5d033a,_0x444d0d){_0x5d033a=_0x5d033a-0x0;var _0x9f5b59=_0x2ef3[_0x5d033a];return _0x9f5b59;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['CloudProvider'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':!![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['CloudProvider'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['CloudProvider']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 0117a16..a200bea 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 _0x622f=['../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers','../../config/logger','api','moment','request-promise'];(function(_0x2e4d84,_0x42dd83){var _0x53f832=function(_0x5b9964){while(--_0x5b9964){_0x2e4d84['push'](_0x2e4d84['shift']());}};_0x53f832(++_0x42dd83);}(_0x622f,0x71));var _0xf622=function(_0x459ce0,_0x4906ab){_0x459ce0=_0x459ce0-0x0;var _0x1a4a41=_0x622f[_0x459ce0];return _0x1a4a41;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf622('0x0'))(_0xf622('0x1'));var moment=require(_0xf622('0x2'));var BPromise=require('bluebird');var rp=require(_0xf622('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf622('0x4'));var attributes=require(_0xf622('0x5'));module['exports']=function(_0x1f92ef,_0x188133){return _0x1f92ef[_0xf622('0x6')](_0xf622('0x7'),attributes,{'tableName':_0xf622('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3a1f=['moment','request-promise','path','rimraf','../../config/environment','exports','define','CloudProvider','lodash','util','../../config/logger','api'];(function(_0x6cf3b6,_0x4b7560){var _0xdbe948=function(_0x1504d6){while(--_0x1504d6){_0x6cf3b6['push'](_0x6cf3b6['shift']());}};_0xdbe948(++_0x4b7560);}(_0x3a1f,0x188));var _0xf3a1=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x3a1f[_0x5b561d];return _0x431060;};'use strict';var _=require(_0xf3a1('0x0'));var util=require(_0xf3a1('0x1'));var logger=require(_0xf3a1('0x2'))(_0xf3a1('0x3'));var moment=require(_0xf3a1('0x4'));var BPromise=require('bluebird');var rp=require(_0xf3a1('0x5'));var fs=require('fs');var path=require(_0xf3a1('0x6'));var rimraf=require(_0xf3a1('0x7'));var config=require(_0xf3a1('0x8'));var attributes=require('./cloudProvider.attributes');module[_0xf3a1('0x9')]=function(_0x276744,_0x2e5691){return _0x276744[_0xf3a1('0xa')](_0xf3a1('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index ed6e027..c7ab519 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 _0xd481=['catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x4aeed0,_0x4b6534){var _0x5a27f4=function(_0x5de2a5){while(--_0x5de2a5){_0x4aeed0['push'](_0x4aeed0['shift']());}};_0x5a27f4(++_0x4b6534);}(_0xd481,0x1e4));var _0x1d48=function(_0x121b85,_0x599aa2){_0x121b85=_0x121b85-0x0;var _0x46347a=_0xd481[_0x121b85];return _0x46347a;};'use strict';var _=require(_0x1d48('0x0'));var util=require('util');var moment=require(_0x1d48('0x1'));var BPromise=require(_0x1d48('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1d48('0x3'));var db=require(_0x1d48('0x4'))['db'];var utils=require(_0x1d48('0x5'));var logger=require('../../config/logger')(_0x1d48('0x6'));var config=require('../../config/environment');var jayson=require(_0x1d48('0x7'));var client=jayson[_0x1d48('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x472584,_0x3099cc,_0x3b8bd4){return new BPromise(function(_0x27c383,_0x1fc969){return client[_0x1d48('0x9')](_0x472584,_0x3b8bd4)[_0x1d48('0xa')](function(_0x303dce){logger[_0x1d48('0xb')](_0x1d48('0xc'),_0x3099cc,_0x1d48('0xd'));logger[_0x1d48('0xe')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x3099cc,_0x1d48('0xd'),JSON[_0x1d48('0xf')](_0x303dce));if(_0x303dce[_0x1d48('0x10')]){if(_0x303dce[_0x1d48('0x10')][_0x1d48('0x11')]===0x1f4){logger[_0x1d48('0x10')](_0x1d48('0xc'),_0x3099cc,_0x303dce[_0x1d48('0x10')][_0x1d48('0x12')]);return _0x1fc969(_0x303dce[_0x1d48('0x10')]['message']);}logger[_0x1d48('0x10')]('CloudProvider,\x20%s,\x20%s',_0x3099cc,_0x303dce[_0x1d48('0x10')][_0x1d48('0x12')]);return _0x27c383(_0x303dce[_0x1d48('0x10')][_0x1d48('0x12')]);}else{logger['info'](_0x1d48('0xc'),_0x3099cc,_0x1d48('0xd'));_0x27c383(_0x303dce[_0x1d48('0x13')]['message']);}})[_0x1d48('0x14')](function(_0x433c92){logger[_0x1d48('0x10')](_0x1d48('0xc'),_0x3099cc,_0x433c92);_0x1fc969(_0x433c92);});});}
\ No newline at end of file
+var _0x09df=['rpc','../../config/environment','request','then','info','request\x20sent','debug','error','code','CloudProvider,\x20%s,\x20%s','message','lodash','util','bluebird','../../mysqldb'];(function(_0x589aab,_0x4de83a){var _0x372b62=function(_0x51de11){while(--_0x51de11){_0x589aab['push'](_0x589aab['shift']());}};_0x372b62(++_0x4de83a);}(_0x09df,0x164));var _0xf09d=function(_0x1cd47d,_0x55bc75){_0x1cd47d=_0x1cd47d-0x0;var _0x29d52f=_0x09df[_0x1cd47d];return _0x29d52f;};'use strict';var _=require(_0xf09d('0x0'));var util=require(_0xf09d('0x1'));var moment=require('moment');var BPromise=require(_0xf09d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf09d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf09d('0x4'));var config=require(_0xf09d('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x284a42,_0x48b82f,_0x28c91c){return new BPromise(function(_0x2555c7,_0x2f1810){return client[_0xf09d('0x6')](_0x284a42,_0x28c91c)[_0xf09d('0x7')](function(_0x2a59a8){logger[_0xf09d('0x8')]('CloudProvider,\x20%s,\x20%s',_0x48b82f,_0xf09d('0x9'));logger[_0xf09d('0xa')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x48b82f,_0xf09d('0x9'),JSON['stringify'](_0x2a59a8));if(_0x2a59a8[_0xf09d('0xb')]){if(_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xc')]===0x1f4){logger[_0xf09d('0xb')](_0xf09d('0xd'),_0x48b82f,_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xe')]);return _0x2f1810(_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xe')]);}logger['error'](_0xf09d('0xd'),_0x48b82f,_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xe')]);return _0x2555c7(_0x2a59a8['error']['message']);}else{logger[_0xf09d('0x8')](_0xf09d('0xd'),_0x48b82f,_0xf09d('0x9'));_0x2555c7(_0x2a59a8['result'][_0xf09d('0xe')]);}})['catch'](function(_0x3614f7){logger[_0xf09d('0xb')](_0xf09d('0xd'),_0x48b82f,_0x3614f7);_0x2f1810(_0x3614f7);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index ea38a95..5c27b3e 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 _0xd997=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','isAuthenticated','get','/:id','show','post','create','put','update','destroy','multer','util','path','connect-timeout'];(function(_0x2a746e,_0xa993ae){var _0x2331ac=function(_0x244ee1){while(--_0x244ee1){_0x2a746e['push'](_0x2a746e['shift']());}};_0x2331ac(++_0xa993ae);}(_0xd997,0x1a0));var _0x7d99=function(_0x48ed76,_0x579d6a){_0x48ed76=_0x48ed76-0x0;var _0x4cb322=_0xd997[_0x48ed76];return _0x4cb322;};'use strict';var multer=require(_0x7d99('0x0'));var util=require(_0x7d99('0x1'));var path=require(_0x7d99('0x2'));var timeout=require(_0x7d99('0x3'));var express=require(_0x7d99('0x4'));var router=express[_0x7d99('0x5')]();var fs_extra=require(_0x7d99('0x6'));var auth=require(_0x7d99('0x7'));var interaction=require(_0x7d99('0x8'));var config=require(_0x7d99('0x9'));var controller=require(_0x7d99('0xa'));router['get']('/',auth[_0x7d99('0xb')](),controller['index']);router[_0x7d99('0xc')](_0x7d99('0xd'),auth[_0x7d99('0xb')](),controller[_0x7d99('0xe')]);router[_0x7d99('0xf')]('/',auth[_0x7d99('0xb')](),controller[_0x7d99('0x10')]);router[_0x7d99('0x11')](_0x7d99('0xd'),auth['isAuthenticated'](),controller[_0x7d99('0x12')]);router['delete'](_0x7d99('0xd'),auth['isAuthenticated'](),controller[_0x7d99('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x9336=['isAuthenticated','show','post','create','put','/:id','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cloudProvider.controller','index','get'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9336,0x112));var _0x6933=function(_0x185d78,_0xf88d87){_0x185d78=_0x185d78-0x0;var _0x1743b5=_0x9336[_0x185d78];return _0x1743b5;};'use strict';var multer=require(_0x6933('0x0'));var util=require('util');var path=require(_0x6933('0x1'));var timeout=require(_0x6933('0x2'));var express=require(_0x6933('0x3'));var router=express[_0x6933('0x4')]();var fs_extra=require(_0x6933('0x5'));var auth=require(_0x6933('0x6'));var interaction=require(_0x6933('0x7'));var config=require('../../config/environment');var controller=require(_0x6933('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6933('0x9')]);router[_0x6933('0xa')]('/:id',auth[_0x6933('0xb')](),controller[_0x6933('0xc')]);router[_0x6933('0xd')]('/',auth[_0x6933('0xb')](),controller[_0x6933('0xe')]);router[_0x6933('0xf')](_0x6933('0x10'),auth[_0x6933('0xb')](),controller[_0x6933('0x11')]);router['delete'](_0x6933('0x10'),auth[_0x6933('0xb')](),controller['destroy']);module[_0x6933('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 46455ea..8f17566 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 _0xcf64=['STRING','sequelize','exports'];(function(_0x59bc71,_0x5388ca){var _0x49142b=function(_0x3b620b){while(--_0x3b620b){_0x59bc71['push'](_0x59bc71['shift']());}};_0x49142b(++_0x5388ca);}(_0xcf64,0x15a));var _0x4cf6=function(_0x4b5c20,_0x55c19e){_0x4b5c20=_0x4b5c20-0x0;var _0x5b4cb2=_0xcf64[_0x4b5c20];return _0x5b4cb2;};'use strict';var Sequelize=require(_0x4cf6('0x0'));module[_0x4cf6('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x4cf6('0x2')]},'phone':{'type':Sequelize[_0x4cf6('0x2')]},'fax':{'type':Sequelize[_0x4cf6('0x2')]},'type':{'type':Sequelize[_0x4cf6('0x2')]},'street':{'type':Sequelize[_0x4cf6('0x2')]},'postalCode':{'type':Sequelize[_0x4cf6('0x2')]},'city':{'type':Sequelize[_0x4cf6('0x2')]},'country':{'type':Sequelize[_0x4cf6('0x2')]},'email':{'type':Sequelize[_0x4cf6('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x4cf6('0x2')]},'sStreet':{'type':Sequelize[_0x4cf6('0x2')]},'sPostalCode':{'type':Sequelize[_0x4cf6('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x4cf6('0x2')]},'description':{'type':Sequelize[_0x4cf6('0x2')]}};
\ No newline at end of file
+var _0x0aae=['sequelize','exports','STRING','name'];(function(_0x203879,_0x553507){var _0x283bf3=function(_0xc9a355){while(--_0xc9a355){_0x203879['push'](_0x203879['shift']());}};_0x283bf3(++_0x553507);}(_0x0aae,0xe0));var _0xe0aa=function(_0x33f63f,_0xae6f41){_0x33f63f=_0x33f63f-0x0;var _0x4c6e4a=_0x0aae[_0x33f63f];return _0x4c6e4a;};'use strict';var Sequelize=require(_0xe0aa('0x0'));module[_0xe0aa('0x1')]={'name':{'type':Sequelize[_0xe0aa('0x2')],'unique':_0xe0aa('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe0aa('0x2')]},'companyId':{'type':Sequelize[_0xe0aa('0x2')]},'website':{'type':Sequelize[_0xe0aa('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xe0aa('0x2')]},'type':{'type':Sequelize[_0xe0aa('0x2')]},'street':{'type':Sequelize[_0xe0aa('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xe0aa('0x2')]},'country':{'type':Sequelize[_0xe0aa('0x2')]},'email':{'type':Sequelize[_0xe0aa('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xe0aa('0x2')]},'sPostalCode':{'type':Sequelize[_0xe0aa('0x2')]},'sCity':{'type':Sequelize[_0xe0aa('0x2')]},'sCountry':{'type':Sequelize[_0xe0aa('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 ff7cf28..ec07fc3 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 _0x3b23=['role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','order','nolimit','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','map','options','include','rows','catch','show','params','rawAttributes','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x1552a9,_0x3e8176){var _0x5eeb96=function(_0x1c3e96){while(--_0x1c3e96){_0x1552a9['push'](_0x1552a9['shift']());}};_0x5eeb96(++_0x3e8176);}(_0x3b23,0x1b9));var _0x33b2=function(_0xdfd079,_0x4ddb3d){_0xdfd079=_0xdfd079-0x0;var _0x5c9aed=_0x3b23[_0xdfd079];return _0x5c9aed;};'use strict';var emlformat=require(_0x33b2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x33b2('0x1'));var rp=require(_0x33b2('0x2'));var moment=require(_0x33b2('0x3'));var BPromise=require(_0x33b2('0x4'));var Mustache=require(_0x33b2('0x5'));var util=require('util');var path=require(_0x33b2('0x6'));var sox=require(_0x33b2('0x7'));var csv=require(_0x33b2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x33b2('0x9'));var _=require(_0x33b2('0xa'));var squel=require(_0x33b2('0xb'));var crypto=require(_0x33b2('0xc'));var jsforce=require(_0x33b2('0xd'));var deskjs=require(_0x33b2('0xe'));var toCsv=require(_0x33b2('0x8'));var querystring=require('querystring');var Papa=require(_0x33b2('0xf'));var Redis=require(_0x33b2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x33b2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x33b2('0x12'));var logger=require(_0x33b2('0x13'))(_0x33b2('0x14'));var utils=require(_0x33b2('0x15'));var config=require(_0x33b2('0x16'));var licenseUtil=require(_0x33b2('0x17'));var db=require(_0x33b2('0x18'))['db'];function respondWithStatusCode(_0x1c64d3,_0x5a0f04){_0x5a0f04=_0x5a0f04||0xcc;return function(_0x103e35){if(_0x103e35){return _0x1c64d3[_0x33b2('0x19')](_0x5a0f04);}return _0x1c64d3['status'](_0x5a0f04)['end']();};}function respondWithResult(_0x4bdcbd,_0x40270e){_0x40270e=_0x40270e||0xc8;return function(_0x40835d){if(_0x40835d){return _0x4bdcbd[_0x33b2('0x1a')](_0x40270e)[_0x33b2('0x1b')](_0x40835d);}};}function respondWithFilteredResult(_0x360de8,_0x4ab04b){return function(_0x417d5f){if(_0x417d5f){var _0x461b23=typeof _0x4ab04b[_0x33b2('0x1c')]===_0x33b2('0x1d')&&typeof _0x4ab04b[_0x33b2('0x1e')]===_0x33b2('0x1d');var _0x778f0d=_0x417d5f[_0x33b2('0x1f')];var _0x3b947a=_0x461b23?0x0:_0x4ab04b[_0x33b2('0x1c')];var _0x2984cb=_0x461b23?_0x417d5f[_0x33b2('0x1f')]:_0x4ab04b[_0x33b2('0x1c')]+_0x4ab04b[_0x33b2('0x1e')];var _0x1888ed;if(_0x2984cb>=_0x778f0d){_0x2984cb=_0x778f0d;_0x1888ed=0xc8;}else{_0x1888ed=0xce;}_0x360de8[_0x33b2('0x1a')](_0x1888ed);return _0x360de8[_0x33b2('0x20')](_0x33b2('0x21'),_0x3b947a+'-'+_0x2984cb+'/'+_0x778f0d)['json'](_0x417d5f);}return null;};}function patchUpdates(_0x3cf2b9){return function(_0x10a953){try{jsonpatch[_0x33b2('0x22')](_0x10a953,_0x3cf2b9,!![]);}catch(_0x5d5b4d){return BPromise[_0x33b2('0x23')](_0x5d5b4d);}return _0x10a953[_0x33b2('0x24')]();};}function saveUpdates(_0x53669f,_0x20ce5b){return function(_0x2e162c){if(_0x2e162c){return _0x2e162c['update'](_0x53669f)[_0x33b2('0x25')](function(_0x3eaddc){return _0x3eaddc;});}return null;};}function removeEntity(_0x4d2460,_0x297823){return function(_0x22df1e){if(_0x22df1e){return _0x22df1e['destroy']()[_0x33b2('0x25')](function(){var _0x43f0f1=_0x22df1e[_0x33b2('0x26')]({'plain':!![]});var _0x1cfd99=_0x33b2('0x27');return db[_0x33b2('0x28')]['destroy']({'where':{'type':_0x1cfd99,'resourceId':_0x43f0f1['id']}})[_0x33b2('0x25')](function(){return _0x22df1e;});})[_0x33b2('0x25')](function(){_0x4d2460[_0x33b2('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2eeeac,_0x2cb570){return function(_0xc5a0ac){if(!_0xc5a0ac){_0x2eeeac[_0x33b2('0x19')](0x194);}return _0xc5a0ac;};}function handleError(_0x2ad8b5,_0x700665){_0x700665=_0x700665||0x1f4;return function(_0x40eeed){logger[_0x33b2('0x29')](_0x40eeed[_0x33b2('0x2a')]);if(_0x40eeed[_0x33b2('0x2b')]){delete _0x40eeed[_0x33b2('0x2b')];}_0x2ad8b5[_0x33b2('0x1a')](_0x700665)[_0x33b2('0x2c')](_0x40eeed);};}exports[_0x33b2('0x2d')]=function(_0x18b25d,_0x32acaf){var _0x46db4a={},_0xeb558d={},_0x5c7ecb={'count':0x0,'rows':[]};return db[_0x33b2('0x2e')][_0x33b2('0x2f')]()[_0x33b2('0x25')](function(_0x4bbde4){_0xeb558d[_0x33b2('0x30')]=_[_0x33b2('0x31')](_0x4bbde4);_0xeb558d[_0x33b2('0x32')]=_['keys'](_0x18b25d['query']);_0xeb558d['filters']=_[_0x33b2('0x33')](_0xeb558d[_0x33b2('0x30')],_0xeb558d['query']);_0x46db4a[_0x33b2('0x34')]=_['intersection'](_0xeb558d[_0x33b2('0x30')],qs[_0x33b2('0x35')](_0x18b25d[_0x33b2('0x32')][_0x33b2('0x35')]));_0x46db4a[_0x33b2('0x34')]=_0x46db4a['attributes'][_0x33b2('0x36')]?_0x46db4a['attributes']:_0xeb558d[_0x33b2('0x30')];if(!_0x18b25d[_0x33b2('0x32')][_0x33b2('0x37')]('nolimit')){_0x46db4a[_0x33b2('0x1e')]=qs[_0x33b2('0x1e')](_0x18b25d['query'][_0x33b2('0x1e')]);_0x46db4a['offset']=qs[_0x33b2('0x1c')](_0x18b25d[_0x33b2('0x32')][_0x33b2('0x1c')]);}_0x46db4a['order']=qs[_0x33b2('0x38')](_0x18b25d[_0x33b2('0x32')][_0x33b2('0x38')]);_0x46db4a[_0x33b2('0x39')]=qs['filters'](_[_0x33b2('0x3a')](_0x18b25d[_0x33b2('0x32')],_0xeb558d[_0x33b2('0x3b')]),_0x4bbde4);if(_0x18b25d[_0x33b2('0x32')][_0x33b2('0x3c')]){_0x46db4a[_0x33b2('0x39')]=_[_0x33b2('0x3d')](_0x46db4a[_0x33b2('0x39')],{'$or':_[_0x33b2('0x3e')](_0x46db4a[_0x33b2('0x34')],function(_0x212ff7){var _0x6f508e={};_0x6f508e[_0x212ff7]={'$like':'%'+_0x18b25d[_0x33b2('0x32')][_0x33b2('0x3c')]+'%'};return _0x6f508e;})});}_0x46db4a=_['merge']({},_0x46db4a,_0x18b25d[_0x33b2('0x3f')]);var _0x36c05e={'where':_0x46db4a[_0x33b2('0x39')]};return db[_0x33b2('0x2e')]['count'](_0x36c05e)[_0x33b2('0x25')](function(_0x497b6e){_0x5c7ecb[_0x33b2('0x1f')]=_0x497b6e;if(_0x18b25d['query']['includeAll']){_0x46db4a[_0x33b2('0x40')]=[{'all':!![]}];}return db[_0x33b2('0x2e')]['findAll'](_0x46db4a);})[_0x33b2('0x25')](function(_0x39a066){_0x5c7ecb[_0x33b2('0x41')]=_0x39a066;return _0x5c7ecb;})[_0x33b2('0x25')](respondWithFilteredResult(_0x32acaf,_0x46db4a))[_0x33b2('0x42')](handleError(_0x32acaf,null));})[_0x33b2('0x42')](handleError(_0x32acaf,null));};exports[_0x33b2('0x43')]=function(_0x1885bc,_0x4a55f2){var _0x2e23cf={'raw':![],'where':{'id':_0x1885bc[_0x33b2('0x44')]['id']}},_0x5e93fb={};_0x5e93fb[_0x33b2('0x30')]=_[_0x33b2('0x31')](db['CmCompany'][_0x33b2('0x45')]);_0x5e93fb['query']=_[_0x33b2('0x31')](_0x1885bc[_0x33b2('0x32')]);_0x5e93fb[_0x33b2('0x3b')]=_[_0x33b2('0x33')](_0x5e93fb[_0x33b2('0x30')],_0x5e93fb[_0x33b2('0x32')]);_0x2e23cf[_0x33b2('0x34')]=_[_0x33b2('0x33')](_0x5e93fb['model'],qs[_0x33b2('0x35')](_0x1885bc[_0x33b2('0x32')][_0x33b2('0x35')]));_0x2e23cf[_0x33b2('0x34')]=_0x2e23cf[_0x33b2('0x34')][_0x33b2('0x36')]?_0x2e23cf[_0x33b2('0x34')]:_0x5e93fb[_0x33b2('0x30')];if(_0x1885bc['query'][_0x33b2('0x46')]){_0x2e23cf[_0x33b2('0x40')]=[{'all':!![]}];}_0x2e23cf=_[_0x33b2('0x3d')]({},_0x2e23cf,_0x1885bc['options']);return db['CmCompany'][_0x33b2('0x47')](_0x2e23cf)[_0x33b2('0x25')](handleEntityNotFound(_0x4a55f2,null))[_0x33b2('0x25')](respondWithResult(_0x4a55f2,null))[_0x33b2('0x42')](handleError(_0x4a55f2,null));};exports[_0x33b2('0x48')]=function(_0x137dc3,_0x36971c){return db[_0x33b2('0x2e')][_0x33b2('0x48')](_0x137dc3[_0x33b2('0x49')],{})[_0x33b2('0x25')](function(_0x46cb82){var _0x5980e1=_0x137dc3['user'][_0x33b2('0x26')]({'plain':!![]});if(!_0x5980e1)throw new Error(_0x33b2('0x4a'));if(_0x5980e1[_0x33b2('0x4b')]==='user'){var _0x18166b=_0x46cb82[_0x33b2('0x26')]({'plain':!![]});var _0x2eee67=_0x33b2('0x27');return db[_0x33b2('0x4c')]['find']({'where':{'name':_0x2eee67,'userProfileId':_0x5980e1[_0x33b2('0x4d')]},'raw':!![]})[_0x33b2('0x25')](function(_0x3fa124){if(_0x3fa124&&_0x3fa124['autoAssociation']===0x0){return db[_0x33b2('0x28')]['create']({'name':_0x18166b['name'],'resourceId':_0x18166b['id'],'type':_0x3fa124[_0x33b2('0x2b')],'sectionId':_0x3fa124['id']},{})[_0x33b2('0x25')](function(){return _0x46cb82;});}else{return _0x46cb82;}})[_0x33b2('0x42')](function(_0x47cb0b){logger[_0x33b2('0x29')](_0x33b2('0x4e'),_0x47cb0b);throw _0x47cb0b;});}return _0x46cb82;})[_0x33b2('0x25')](respondWithResult(_0x36971c,0xc9))[_0x33b2('0x42')](handleError(_0x36971c,null));};exports['update']=function(_0xb91e43,_0x1b395d){if(_0xb91e43[_0x33b2('0x49')]['id']){delete _0xb91e43[_0x33b2('0x49')]['id'];}return db[_0x33b2('0x2e')][_0x33b2('0x47')]({'where':{'id':_0xb91e43[_0x33b2('0x44')]['id']}})[_0x33b2('0x25')](handleEntityNotFound(_0x1b395d,null))[_0x33b2('0x25')](saveUpdates(_0xb91e43['body'],null))[_0x33b2('0x25')](respondWithResult(_0x1b395d,null))[_0x33b2('0x42')](handleError(_0x1b395d,null));};exports['destroy']=function(_0x529d1f,_0x10ae97){return db[_0x33b2('0x2e')][_0x33b2('0x47')]({'where':{'id':_0x529d1f[_0x33b2('0x44')]['id']}})[_0x33b2('0x25')](handleEntityNotFound(_0x10ae97,null))['then'](removeEntity(_0x10ae97,null))[_0x33b2('0x42')](handleError(_0x10ae97,null));};exports[_0x33b2('0x2f')]=function(_0x262708,_0x5b636c){return db['CmCompany'][_0x33b2('0x2f')]()[_0x33b2('0x25')](respondWithResult(_0x5b636c,null))[_0x33b2('0x42')](handleError(_0x5b636c,null));};exports[_0x33b2('0x4f')]=function(_0x513bf4,_0x2671f3,_0x4e6c59){return db[_0x33b2('0x50')][_0x33b2('0x47')]({'where':{'id':_0x513bf4[_0x33b2('0x44')]['id']}})['then'](handleEntityNotFound(_0x2671f3,null))['then'](function(_0x4c5c1a){if(_0x4c5c1a){return _0x4c5c1a[_0x33b2('0x4f')](_0x513bf4[_0x33b2('0x49')][_0x33b2('0x51')],_[_0x33b2('0x52')](_0x513bf4[_0x33b2('0x49')],[_0x33b2('0x51'),'id'])||{});}})['then'](respondWithResult(_0x2671f3,null))[_0x33b2('0x42')](handleError(_0x2671f3,null));};exports[_0x33b2('0x53')]=function(_0x3c292a,_0x48b1f6,_0x5b7c0e){var _0x84b676={};var _0x5ae626={};var _0x5b9eda;var _0x189a94;return db[_0x33b2('0x2e')]['findOne']({'where':{'id':_0x3c292a[_0x33b2('0x44')]['id']}})[_0x33b2('0x25')](handleEntityNotFound(_0x48b1f6,null))[_0x33b2('0x25')](function(_0x2b4a94){if(_0x2b4a94){_0x5b9eda=_0x2b4a94;_0x5ae626[_0x33b2('0x30')]=_['keys'](db[_0x33b2('0x50')][_0x33b2('0x45')]);_0x5ae626[_0x33b2('0x32')]=_[_0x33b2('0x31')](_0x3c292a[_0x33b2('0x32')]);_0x5ae626['filters']=_[_0x33b2('0x33')](_0x5ae626[_0x33b2('0x30')],_0x5ae626['query']);_0x84b676[_0x33b2('0x34')]=_[_0x33b2('0x33')](_0x5ae626[_0x33b2('0x30')],qs['fields'](_0x3c292a[_0x33b2('0x32')][_0x33b2('0x35')]));_0x84b676[_0x33b2('0x34')]=_0x84b676[_0x33b2('0x34')][_0x33b2('0x36')]?_0x84b676[_0x33b2('0x34')]:_0x5ae626[_0x33b2('0x30')];_0x84b676[_0x33b2('0x54')]=qs[_0x33b2('0x38')](_0x3c292a['query']['sort']);_0x84b676[_0x33b2('0x39')]=qs[_0x33b2('0x3b')](_[_0x33b2('0x3a')](_0x3c292a[_0x33b2('0x32')],_0x5ae626['filters']));if(_0x3c292a[_0x33b2('0x32')][_0x33b2('0x3c')]){_0x84b676['where']=_['merge'](_0x84b676[_0x33b2('0x39')],{'$or':_[_0x33b2('0x3e')](_0x84b676[_0x33b2('0x34')],function(_0x37ecd2){var _0x3f8ccc={};_0x3f8ccc[_0x37ecd2]={'$like':'%'+_0x3c292a[_0x33b2('0x32')][_0x33b2('0x3c')]+'%'};return _0x3f8ccc;})});}_0x84b676=_[_0x33b2('0x3d')]({},_0x84b676,_0x3c292a[_0x33b2('0x3f')]);return _0x5b9eda[_0x33b2('0x53')](_0x84b676);}})[_0x33b2('0x25')](function(_0x273f1d){if(_0x273f1d){_0x189a94=_0x273f1d[_0x33b2('0x36')];if(!_0x3c292a[_0x33b2('0x32')][_0x33b2('0x37')](_0x33b2('0x55'))){_0x84b676[_0x33b2('0x1e')]=qs[_0x33b2('0x1e')](_0x3c292a[_0x33b2('0x32')][_0x33b2('0x1e')]);_0x84b676[_0x33b2('0x1c')]=qs[_0x33b2('0x1c')](_0x3c292a['query']['offset']);}return _0x5b9eda[_0x33b2('0x53')](_0x84b676);}})[_0x33b2('0x25')](function(_0x59688d){if(_0x59688d){return _0x59688d?{'count':_0x189a94,'rows':_0x59688d}:null;}})[_0x33b2('0x25')](respondWithResult(_0x48b1f6,null))[_0x33b2('0x42')](handleError(_0x48b1f6,null));};
\ No newline at end of file
+var _0x0793=['../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','json','apply','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','ids','getContacts','findOne','hasOwnProperty','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x1347f8,_0x233feb){var _0x218368=function(_0x3f4ca3){while(--_0x3f4ca3){_0x1347f8['push'](_0x1347f8['shift']());}};_0x218368(++_0x233feb);}(_0x0793,0x14c));var _0x3079=function(_0x5151ab,_0x5d0dd9){_0x5151ab=_0x5151ab-0x0;var _0x5b6c0a=_0x0793[_0x5151ab];return _0x5b6c0a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3079('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3079('0x1'));var rp=require('request-promise');var moment=require(_0x3079('0x2'));var BPromise=require(_0x3079('0x3'));var Mustache=require(_0x3079('0x4'));var util=require(_0x3079('0x5'));var path=require(_0x3079('0x6'));var sox=require(_0x3079('0x7'));var csv=require(_0x3079('0x8'));var ejs=require(_0x3079('0x9'));var fs=require('fs');var fs_extra=require(_0x3079('0xa'));var _=require(_0x3079('0xb'));var squel=require('squel');var crypto=require(_0x3079('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3079('0xd'));var toCsv=require(_0x3079('0x8'));var querystring=require(_0x3079('0xe'));var Papa=require(_0x3079('0xf'));var Redis=require(_0x3079('0x10'));var authService=require(_0x3079('0x11'));var qs=require(_0x3079('0x12'));var as=require(_0x3079('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3079('0x14'))(_0x3079('0x15'));var utils=require('../../config/utils');var config=require(_0x3079('0x16'));var licenseUtil=require(_0x3079('0x17'));var db=require(_0x3079('0x18'))['db'];function respondWithStatusCode(_0x3ee607,_0x331c1d){_0x331c1d=_0x331c1d||0xcc;return function(_0x584cf7){if(_0x584cf7){return _0x3ee607[_0x3079('0x19')](_0x331c1d);}return _0x3ee607[_0x3079('0x1a')](_0x331c1d)[_0x3079('0x1b')]();};}function respondWithResult(_0x52de68,_0x46edf3){_0x46edf3=_0x46edf3||0xc8;return function(_0x330f55){if(_0x330f55){return _0x52de68[_0x3079('0x1a')](_0x46edf3)['json'](_0x330f55);}};}function respondWithFilteredResult(_0x2fd0a2,_0x6fe049){return function(_0x71394){if(_0x71394){var _0x4e097e=typeof _0x6fe049['offset']===_0x3079('0x1c')&&typeof _0x6fe049['limit']===_0x3079('0x1c');var _0x51771b=_0x71394[_0x3079('0x1d')];var _0x221d94=_0x4e097e?0x0:_0x6fe049['offset'];var _0x49de40=_0x4e097e?_0x71394[_0x3079('0x1d')]:_0x6fe049[_0x3079('0x1e')]+_0x6fe049[_0x3079('0x1f')];var _0x3a96ac;if(_0x49de40>=_0x51771b){_0x49de40=_0x51771b;_0x3a96ac=0xc8;}else{_0x3a96ac=0xce;}_0x2fd0a2[_0x3079('0x1a')](_0x3a96ac);return _0x2fd0a2[_0x3079('0x20')]('Content-Range',_0x221d94+'-'+_0x49de40+'/'+_0x51771b)[_0x3079('0x21')](_0x71394);}return null;};}function patchUpdates(_0x16b46c){return function(_0x4e696c){try{jsonpatch[_0x3079('0x22')](_0x4e696c,_0x16b46c,!![]);}catch(_0xee6c76){return BPromise['reject'](_0xee6c76);}return _0x4e696c[_0x3079('0x23')]();};}function saveUpdates(_0x5cd799,_0x5d29d2){return function(_0x2ce6ca){if(_0x2ce6ca){return _0x2ce6ca[_0x3079('0x24')](_0x5cd799)[_0x3079('0x25')](function(_0x3cb008){return _0x3cb008;});}return null;};}function removeEntity(_0x59ace6,_0x551b5b){return function(_0x294010){if(_0x294010){return _0x294010[_0x3079('0x26')]()[_0x3079('0x25')](function(){var _0x2a83a8=_0x294010[_0x3079('0x27')]({'plain':!![]});var _0x471390=_0x3079('0x28');return db[_0x3079('0x29')][_0x3079('0x26')]({'where':{'type':_0x471390,'resourceId':_0x2a83a8['id']}})[_0x3079('0x25')](function(){return _0x294010;});})['then'](function(){_0x59ace6[_0x3079('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d1171,_0x362955){return function(_0x3db46d){if(!_0x3db46d){_0x1d1171['sendStatus'](0x194);}return _0x3db46d;};}function handleError(_0x4d103e,_0x13cae3){_0x13cae3=_0x13cae3||0x1f4;return function(_0x44b789){logger[_0x3079('0x2a')](_0x44b789[_0x3079('0x2b')]);if(_0x44b789[_0x3079('0x2c')]){delete _0x44b789[_0x3079('0x2c')];}_0x4d103e[_0x3079('0x1a')](_0x13cae3)[_0x3079('0x2d')](_0x44b789);};}exports[_0x3079('0x2e')]=function(_0x3f6d30,_0x29c122){var _0x19ea1f={},_0x5ce6ef={},_0x4dd4f5={'count':0x0,'rows':[]};return db[_0x3079('0x2f')][_0x3079('0x30')]()[_0x3079('0x25')](function(_0x306e18){_0x5ce6ef['model']=_['keys'](_0x306e18);_0x5ce6ef['query']=_[_0x3079('0x31')](_0x3f6d30[_0x3079('0x32')]);_0x5ce6ef[_0x3079('0x33')]=_[_0x3079('0x34')](_0x5ce6ef[_0x3079('0x35')],_0x5ce6ef[_0x3079('0x32')]);_0x19ea1f['attributes']=_[_0x3079('0x34')](_0x5ce6ef[_0x3079('0x35')],qs[_0x3079('0x36')](_0x3f6d30[_0x3079('0x32')][_0x3079('0x36')]));_0x19ea1f[_0x3079('0x37')]=_0x19ea1f[_0x3079('0x37')][_0x3079('0x38')]?_0x19ea1f[_0x3079('0x37')]:_0x5ce6ef['model'];if(!_0x3f6d30[_0x3079('0x32')]['hasOwnProperty'](_0x3079('0x39'))){_0x19ea1f['limit']=qs['limit'](_0x3f6d30[_0x3079('0x32')][_0x3079('0x1f')]);_0x19ea1f['offset']=qs[_0x3079('0x1e')](_0x3f6d30['query']['offset']);}_0x19ea1f[_0x3079('0x3a')]=qs[_0x3079('0x3b')](_0x3f6d30[_0x3079('0x32')][_0x3079('0x3b')]);_0x19ea1f[_0x3079('0x3c')]=qs[_0x3079('0x33')](_[_0x3079('0x3d')](_0x3f6d30[_0x3079('0x32')],_0x5ce6ef[_0x3079('0x33')]),_0x306e18);if(_0x3f6d30['query'][_0x3079('0x3e')]){_0x19ea1f[_0x3079('0x3c')]=_[_0x3079('0x3f')](_0x19ea1f[_0x3079('0x3c')],{'$or':_[_0x3079('0x40')](_0x19ea1f['attributes'],function(_0x2e3aea){var _0x3f08f2={};_0x3f08f2[_0x2e3aea]={'$like':'%'+_0x3f6d30[_0x3079('0x32')][_0x3079('0x3e')]+'%'};return _0x3f08f2;})});}_0x19ea1f=_[_0x3079('0x3f')]({},_0x19ea1f,_0x3f6d30['options']);var _0x21af39={'where':_0x19ea1f[_0x3079('0x3c')]};return db['CmCompany'][_0x3079('0x1d')](_0x21af39)[_0x3079('0x25')](function(_0x4ebb19){_0x4dd4f5[_0x3079('0x1d')]=_0x4ebb19;if(_0x3f6d30['query'][_0x3079('0x41')]){_0x19ea1f[_0x3079('0x42')]=[{'all':!![]}];}return db['CmCompany'][_0x3079('0x43')](_0x19ea1f);})[_0x3079('0x25')](function(_0x34e376){_0x4dd4f5[_0x3079('0x44')]=_0x34e376;return _0x4dd4f5;})['then'](respondWithFilteredResult(_0x29c122,_0x19ea1f))['catch'](handleError(_0x29c122,null));})[_0x3079('0x45')](handleError(_0x29c122,null));};exports[_0x3079('0x46')]=function(_0x5f40c2,_0x459a81){var _0x335516={'raw':![],'where':{'id':_0x5f40c2['params']['id']}},_0x4a5120={};_0x4a5120[_0x3079('0x35')]=_['keys'](db[_0x3079('0x2f')][_0x3079('0x47')]);_0x4a5120[_0x3079('0x32')]=_[_0x3079('0x31')](_0x5f40c2[_0x3079('0x32')]);_0x4a5120[_0x3079('0x33')]=_['intersection'](_0x4a5120['model'],_0x4a5120[_0x3079('0x32')]);_0x335516[_0x3079('0x37')]=_[_0x3079('0x34')](_0x4a5120[_0x3079('0x35')],qs['fields'](_0x5f40c2['query'][_0x3079('0x36')]));_0x335516[_0x3079('0x37')]=_0x335516[_0x3079('0x37')][_0x3079('0x38')]?_0x335516[_0x3079('0x37')]:_0x4a5120[_0x3079('0x35')];if(_0x5f40c2[_0x3079('0x32')][_0x3079('0x41')]){_0x335516['include']=[{'all':!![]}];}_0x335516=_['merge']({},_0x335516,_0x5f40c2[_0x3079('0x48')]);return db[_0x3079('0x2f')][_0x3079('0x49')](_0x335516)[_0x3079('0x25')](handleEntityNotFound(_0x459a81,null))['then'](respondWithResult(_0x459a81,null))[_0x3079('0x45')](handleError(_0x459a81,null));};exports[_0x3079('0x4a')]=function(_0x5cd52e,_0x5b5c05){return db['CmCompany'][_0x3079('0x4a')](_0x5cd52e[_0x3079('0x4b')],{})[_0x3079('0x25')](function(_0x16b640){var _0x208039=_0x5cd52e[_0x3079('0x4c')][_0x3079('0x27')]({'plain':!![]});if(!_0x208039)throw new Error(_0x3079('0x4d'));if(_0x208039['role']===_0x3079('0x4c')){var _0x387fb4=_0x16b640['get']({'plain':!![]});var _0x5d2b29='Companies';return db[_0x3079('0x4e')][_0x3079('0x49')]({'where':{'name':_0x5d2b29,'userProfileId':_0x208039[_0x3079('0x4f')]},'raw':!![]})[_0x3079('0x25')](function(_0x4cd760){if(_0x4cd760&&_0x4cd760[_0x3079('0x50')]===0x0){return db[_0x3079('0x29')][_0x3079('0x4a')]({'name':_0x387fb4['name'],'resourceId':_0x387fb4['id'],'type':_0x4cd760[_0x3079('0x2c')],'sectionId':_0x4cd760['id']},{})[_0x3079('0x25')](function(){return _0x16b640;});}else{return _0x16b640;}})[_0x3079('0x45')](function(_0x146282){logger[_0x3079('0x2a')](_0x3079('0x51'),_0x146282);throw _0x146282;});}return _0x16b640;})[_0x3079('0x25')](respondWithResult(_0x5b5c05,0xc9))[_0x3079('0x45')](handleError(_0x5b5c05,null));};exports['update']=function(_0x2e9ca3,_0x3f3613){if(_0x2e9ca3[_0x3079('0x4b')]['id']){delete _0x2e9ca3['body']['id'];}return db[_0x3079('0x2f')]['find']({'where':{'id':_0x2e9ca3[_0x3079('0x52')]['id']}})[_0x3079('0x25')](handleEntityNotFound(_0x3f3613,null))['then'](saveUpdates(_0x2e9ca3[_0x3079('0x4b')],null))['then'](respondWithResult(_0x3f3613,null))[_0x3079('0x45')](handleError(_0x3f3613,null));};exports[_0x3079('0x26')]=function(_0x2d5c8a,_0x31af47){return db[_0x3079('0x2f')][_0x3079('0x49')]({'where':{'id':_0x2d5c8a['params']['id']}})[_0x3079('0x25')](handleEntityNotFound(_0x31af47,null))[_0x3079('0x25')](removeEntity(_0x31af47,null))['catch'](handleError(_0x31af47,null));};exports[_0x3079('0x30')]=function(_0x1a4c77,_0x3866d7){return db['CmCompany'][_0x3079('0x30')]()[_0x3079('0x25')](respondWithResult(_0x3866d7,null))[_0x3079('0x45')](handleError(_0x3866d7,null));};exports[_0x3079('0x53')]=function(_0xbd8780,_0x3d0d9b,_0x117b49){return db[_0x3079('0x54')][_0x3079('0x49')]({'where':{'id':_0xbd8780['params']['id']}})[_0x3079('0x25')](handleEntityNotFound(_0x3d0d9b,null))[_0x3079('0x25')](function(_0x176ca8){if(_0x176ca8){return _0x176ca8[_0x3079('0x53')](_0xbd8780['body'][_0x3079('0x55')],_['omit'](_0xbd8780['body'],[_0x3079('0x55'),'id'])||{});}})[_0x3079('0x25')](respondWithResult(_0x3d0d9b,null))[_0x3079('0x45')](handleError(_0x3d0d9b,null));};exports[_0x3079('0x56')]=function(_0x309f9b,_0x5567d0,_0x2a5e75){var _0x53a6f8={};var _0x5c34a3={};var _0x335a03;var _0x4fb787;return db['CmCompany'][_0x3079('0x57')]({'where':{'id':_0x309f9b['params']['id']}})[_0x3079('0x25')](handleEntityNotFound(_0x5567d0,null))[_0x3079('0x25')](function(_0x55f5ac){if(_0x55f5ac){_0x335a03=_0x55f5ac;_0x5c34a3[_0x3079('0x35')]=_['keys'](db[_0x3079('0x54')]['rawAttributes']);_0x5c34a3[_0x3079('0x32')]=_[_0x3079('0x31')](_0x309f9b[_0x3079('0x32')]);_0x5c34a3['filters']=_[_0x3079('0x34')](_0x5c34a3[_0x3079('0x35')],_0x5c34a3[_0x3079('0x32')]);_0x53a6f8[_0x3079('0x37')]=_[_0x3079('0x34')](_0x5c34a3[_0x3079('0x35')],qs['fields'](_0x309f9b[_0x3079('0x32')]['fields']));_0x53a6f8[_0x3079('0x37')]=_0x53a6f8[_0x3079('0x37')][_0x3079('0x38')]?_0x53a6f8['attributes']:_0x5c34a3['model'];_0x53a6f8[_0x3079('0x3a')]=qs[_0x3079('0x3b')](_0x309f9b['query'][_0x3079('0x3b')]);_0x53a6f8['where']=qs[_0x3079('0x33')](_[_0x3079('0x3d')](_0x309f9b['query'],_0x5c34a3[_0x3079('0x33')]));if(_0x309f9b[_0x3079('0x32')][_0x3079('0x3e')]){_0x53a6f8['where']=_['merge'](_0x53a6f8[_0x3079('0x3c')],{'$or':_[_0x3079('0x40')](_0x53a6f8['attributes'],function(_0x542f4d){var _0x2c3836={};_0x2c3836[_0x542f4d]={'$like':'%'+_0x309f9b[_0x3079('0x32')][_0x3079('0x3e')]+'%'};return _0x2c3836;})});}_0x53a6f8=_[_0x3079('0x3f')]({},_0x53a6f8,_0x309f9b[_0x3079('0x48')]);return _0x335a03[_0x3079('0x56')](_0x53a6f8);}})[_0x3079('0x25')](function(_0x4debbe){if(_0x4debbe){_0x4fb787=_0x4debbe[_0x3079('0x38')];if(!_0x309f9b[_0x3079('0x32')][_0x3079('0x58')](_0x3079('0x39'))){_0x53a6f8[_0x3079('0x1f')]=qs['limit'](_0x309f9b[_0x3079('0x32')]['limit']);_0x53a6f8[_0x3079('0x1e')]=qs['offset'](_0x309f9b[_0x3079('0x32')]['offset']);}return _0x335a03[_0x3079('0x56')](_0x53a6f8);}})[_0x3079('0x25')](function(_0xf953e6){if(_0xf953e6){return _0xf953e6?{'count':_0x4fb787,'rows':_0xf953e6}:null;}})[_0x3079('0x25')](respondWithResult(_0x5567d0,null))[_0x3079('0x45')](handleError(_0x5567d0,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 3dba045..335da78 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 _0x25df=['define','CmCompany','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0x341186,_0x4d1b7c){var _0x2b4a7c=function(_0x655936){while(--_0x655936){_0x341186['push'](_0x341186['shift']());}};_0x2b4a7c(++_0x4d1b7c);}(_0x25df,0x12e));var _0xf25d=function(_0x3a2821,_0x446fc7){_0x3a2821=_0x3a2821-0x0;var _0x31b9b6=_0x25df[_0x3a2821];return _0x31b9b6;};'use strict';var _=require('lodash');var util=require(_0xf25d('0x0'));var logger=require(_0xf25d('0x1'))(_0xf25d('0x2'));var moment=require(_0xf25d('0x3'));var BPromise=require(_0xf25d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf25d('0x5'));var config=require(_0xf25d('0x6'));var attributes=require('./cmCompany.attributes');module[_0xf25d('0x7')]=function(_0x6d99e,_0x2ced72){return _0x6d99e[_0xf25d('0x8')](_0xf25d('0x9'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xddd7=['path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2df83f,_0x4305f0){var _0x28d7d5=function(_0x497335){while(--_0x497335){_0x2df83f['push'](_0x2df83f['shift']());}};_0x28d7d5(++_0x4305f0);}(_0xddd7,0xa2));var _0x7ddd=function(_0x7c9599,_0x447293){_0x7c9599=_0x7c9599-0x0;var _0x19ee57=_0xddd7[_0x7c9599];return _0x19ee57;};'use strict';var _=require(_0x7ddd('0x0'));var util=require(_0x7ddd('0x1'));var logger=require(_0x7ddd('0x2'))(_0x7ddd('0x3'));var moment=require('moment');var BPromise=require(_0x7ddd('0x4'));var rp=require(_0x7ddd('0x5'));var fs=require('fs');var path=require(_0x7ddd('0x6'));var rimraf=require(_0x7ddd('0x7'));var config=require(_0x7ddd('0x8'));var attributes=require(_0x7ddd('0x9'));module['exports']=function(_0x24254d,_0x5e2b77){return _0x24254d[_0x7ddd('0xa')](_0x7ddd('0xb'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 74affe1..2bd08f7 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 _0xd117=['../../config/logger','rpc','../../config/environment','client','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x329bd7,_0x58d7a4){var _0x351d9e=function(_0x5238dc){while(--_0x5238dc){_0x329bd7['push'](_0x329bd7['shift']());}};_0x351d9e(++_0x58d7a4);}(_0xd117,0x9a));var _0x7d11=function(_0x57d13b,_0x52d8cb){_0x57d13b=_0x57d13b-0x0;var _0x467696=_0xd117[_0x57d13b];return _0x467696;};'use strict';var _=require(_0x7d11('0x0'));var util=require('util');var moment=require(_0x7d11('0x1'));var BPromise=require(_0x7d11('0x2'));var rs=require(_0x7d11('0x3'));var fs=require('fs');var Redis=require(_0x7d11('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7d11('0x5'));var logger=require(_0x7d11('0x6'))(_0x7d11('0x7'));var config=require(_0x7d11('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7d11('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xdc4f62,_0x1f74ae,_0x7847b9){return new BPromise(function(_0x2f7bfb,_0x5a5eb5){return client[_0x7d11('0xa')](_0xdc4f62,_0x7847b9)['then'](function(_0x4f942f){logger[_0x7d11('0xb')](_0x7d11('0xc'),_0x1f74ae,_0x7d11('0xd'));logger[_0x7d11('0xe')](_0x7d11('0xf'),_0x1f74ae,_0x7d11('0xd'),JSON[_0x7d11('0x10')](_0x4f942f));if(_0x4f942f[_0x7d11('0x11')]){if(_0x4f942f[_0x7d11('0x11')]['code']===0x1f4){logger[_0x7d11('0x11')](_0x7d11('0xc'),_0x1f74ae,_0x4f942f[_0x7d11('0x11')][_0x7d11('0x12')]);return _0x5a5eb5(_0x4f942f[_0x7d11('0x11')][_0x7d11('0x12')]);}logger[_0x7d11('0x11')](_0x7d11('0xc'),_0x1f74ae,_0x4f942f[_0x7d11('0x11')]['message']);return _0x2f7bfb(_0x4f942f[_0x7d11('0x11')]['message']);}else{logger[_0x7d11('0xb')](_0x7d11('0xc'),_0x1f74ae,_0x7d11('0xd'));_0x2f7bfb(_0x4f942f[_0x7d11('0x13')][_0x7d11('0x12')]);}})['catch'](function(_0x27e244){logger[_0x7d11('0x11')](_0x7d11('0xc'),_0x1f74ae,_0x27e244);_0x5a5eb5(_0x27e244);});});}
\ No newline at end of file
+var _0x801c=['error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x801c,0xcb));var _0xc801=function(_0x5a6291,_0x47b1a0){_0x5a6291=_0x5a6291-0x0;var _0x3014ce=_0x801c[_0x5a6291];return _0x3014ce;};'use strict';var _=require(_0xc801('0x0'));var util=require(_0xc801('0x1'));var moment=require(_0xc801('0x2'));var BPromise=require(_0xc801('0x3'));var rs=require(_0xc801('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc801('0x5'))['db'];var utils=require(_0xc801('0x6'));var logger=require(_0xc801('0x7'))('rpc');var config=require(_0xc801('0x8'));var jayson=require(_0xc801('0x9'));var client=jayson['client'][_0xc801('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x531eba,_0x2fb281,_0x57f279){return new BPromise(function(_0x435810,_0x13cf9f){return client['request'](_0x531eba,_0x57f279)[_0xc801('0xb')](function(_0x3fc69b){logger['info'](_0xc801('0xc'),_0x2fb281,_0xc801('0xd'));logger[_0xc801('0xe')](_0xc801('0xf'),_0x2fb281,_0xc801('0xd'),JSON[_0xc801('0x10')](_0x3fc69b));if(_0x3fc69b['error']){if(_0x3fc69b[_0xc801('0x11')][_0xc801('0x12')]===0x1f4){logger[_0xc801('0x11')]('CmCompany,\x20%s,\x20%s',_0x2fb281,_0x3fc69b[_0xc801('0x11')][_0xc801('0x13')]);return _0x13cf9f(_0x3fc69b[_0xc801('0x11')]['message']);}logger['error'](_0xc801('0xc'),_0x2fb281,_0x3fc69b['error']['message']);return _0x435810(_0x3fc69b[_0xc801('0x11')]['message']);}else{logger[_0xc801('0x14')]('CmCompany,\x20%s,\x20%s',_0x2fb281,'request\x20sent');_0x435810(_0x3fc69b['result'][_0xc801('0x13')]);}})[_0xc801('0x15')](function(_0x2592d9){logger['error'](_0xc801('0xc'),_0x2fb281,_0x2592d9);_0x13cf9f(_0x2592d9);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index fd0fa4b..8aa04a4 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 _0xf346=['/:id/contacts','put','destroy','exports','util','Router','fs-extra','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getContacts','post','create'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xf346,0x134));var _0x6f34=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xf346[_0x199572];return _0x13cfa3;};'use strict';var multer=require('multer');var util=require(_0x6f34('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6f34('0x1')]();var fs_extra=require(_0x6f34('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6f34('0x3'));var controller=require(_0x6f34('0x4'));router[_0x6f34('0x5')]('/',auth[_0x6f34('0x6')](),controller[_0x6f34('0x7')]);router[_0x6f34('0x5')](_0x6f34('0x8'),auth['isAuthenticated'](),controller[_0x6f34('0x9')]);router['get'](_0x6f34('0xa'),auth[_0x6f34('0x6')](),controller[_0x6f34('0xb')]);router['get']('/:id/contacts',auth[_0x6f34('0x6')](),controller[_0x6f34('0xc')]);router[_0x6f34('0xd')]('/',auth[_0x6f34('0x6')](),controller[_0x6f34('0xe')]);router[_0x6f34('0xd')](_0x6f34('0xf'),auth[_0x6f34('0x6')](),controller['addContacts']);router[_0x6f34('0x10')]('/:id',auth[_0x6f34('0x6')](),controller['update']);router['delete'](_0x6f34('0xa'),auth['isAuthenticated'](),controller[_0x6f34('0x11')]);module[_0x6f34('0x12')]=router;
\ No newline at end of file
+var _0xdfff=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1f9d05,_0x4a5ecc){var _0x59c1ea=function(_0x54eb43){while(--_0x54eb43){_0x1f9d05['push'](_0x1f9d05['shift']());}};_0x59c1ea(++_0x4a5ecc);}(_0xdfff,0x110));var _0xfdff=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdfff[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xfdff('0x0'));var util=require(_0xfdff('0x1'));var path=require(_0xfdff('0x2'));var timeout=require(_0xfdff('0x3'));var express=require(_0xfdff('0x4'));var router=express['Router']();var fs_extra=require(_0xfdff('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfdff('0x6'));var config=require(_0xfdff('0x7'));var controller=require(_0xfdff('0x8'));router[_0xfdff('0x9')]('/',auth[_0xfdff('0xa')](),controller[_0xfdff('0xb')]);router[_0xfdff('0x9')](_0xfdff('0xc'),auth[_0xfdff('0xa')](),controller[_0xfdff('0xd')]);router[_0xfdff('0x9')](_0xfdff('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0xfdff('0xf'),auth[_0xfdff('0xa')](),controller[_0xfdff('0x10')]);router[_0xfdff('0x11')]('/',auth[_0xfdff('0xa')](),controller[_0xfdff('0x12')]);router['post']('/:id/contacts',auth[_0xfdff('0xa')](),controller[_0xfdff('0x13')]);router[_0xfdff('0x14')]('/:id',auth[_0xfdff('0xa')](),controller[_0xfdff('0x15')]);router[_0xfdff('0x16')](_0xfdff('0xe'),auth[_0xfdff('0xa')](),controller[_0xfdff('0x17')]);module[_0xfdff('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 80fb33e..b742960 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 _0x20e7=['TEXT','UNSIGNED','DATE','NOW','lodash','exports','STRING'];(function(_0x336c97,_0x293692){var _0x493397=function(_0x12cf22){while(--_0x12cf22){_0x336c97['push'](_0x336c97['shift']());}};_0x493397(++_0x293692);}(_0x20e7,0x193));var _0x720e=function(_0x10ce1f,_0x541626){_0x10ce1f=_0x10ce1f-0x0;var _0x5d0fb1=_0x20e7[_0x10ce1f];return _0x5d0fb1;};'use strict';var _=require(_0x720e('0x0'));var Sequelize=require('sequelize');module[_0x720e('0x1')]={'firstName':{'type':Sequelize[_0x720e('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x720e('0x2')]},'street':{'type':Sequelize[_0x720e('0x2')]},'postalCode':{'type':Sequelize[_0x720e('0x2')]},'city':{'type':Sequelize[_0x720e('0x2')]},'country':{'type':Sequelize[_0x720e('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x720e('0x3')]},'phone':{'type':Sequelize[_0x720e('0x2')]},'mobile':{'type':Sequelize[_0x720e('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x720e('0x2')]},'url':{'type':Sequelize[_0x720e('0x2')]},'facebook':{'type':Sequelize[_0x720e('0x2')]},'fb_data':{'type':Sequelize[_0x720e('0x2')]},'twitter':{'type':Sequelize[_0x720e('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x720e('0x2')]},'line':{'type':Sequelize[_0x720e('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x720e('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x720e('0x5')],'defaultValue':Sequelize[_0x720e('0x6')]}};
\ No newline at end of file
+var _0x4dc1=['NOW','lodash','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x4dc1,0xef));var _0x14dc=function(_0x2a288d,_0x1a5a5e){_0x2a288d=_0x2a288d-0x0;var _0x976b1b=_0x4dc1[_0x2a288d];return _0x976b1b;};'use strict';var _=require(_0x14dc('0x0'));var Sequelize=require(_0x14dc('0x1'));module[_0x14dc('0x2')]={'firstName':{'type':Sequelize[_0x14dc('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x14dc('0x3')]},'street':{'type':Sequelize[_0x14dc('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x14dc('0x3')]},'country':{'type':Sequelize[_0x14dc('0x3')]},'dateOfBirth':{'type':Sequelize[_0x14dc('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x14dc('0x3')]},'mobile':{'type':Sequelize[_0x14dc('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x14dc('0x3')]},'facebook':{'type':Sequelize[_0x14dc('0x3')]},'fb_data':{'type':Sequelize[_0x14dc('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x14dc('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x14dc('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x14dc('0x3')]},'UserId':{'type':Sequelize[_0x14dc('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x14dc('0x5')],'defaultValue':Sequelize[_0x14dc('0x6')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 1a87eb3..d6e6122 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 _0xcea0=['findOne','trimStart','length','fieldType','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','cm_contacts','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','tools_tags','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','expr','parseSearch','search','sqlOperator','conditions','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','text','start','filter','isNil','Contact','isEmpty','ListId','\x20=\x20?','tag','isArray','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','SELECT','clone','having','t.id\x20IN\x20?','user','agent','some','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','role','sequelize','toString','count','keyBy','merge','CmContact','c.lastName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','find','params','tags','displayName','analytics','CmCustomField','findAll','columnName','alias','values','body','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','bulkCreate','each','duplicates','findOrCreate','spread','show','$and','omit','format','cf_%d','pickBy','table','setFields','id\x20=\x20?','phone','getTags','options','setTags','getHoppers','rawAttributes','ContactId','includeAll','include','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','server/files/tmp','file','filename','chmodSync','child_process','fork','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','binding','stringify','message','start\x20child\x20process\x20correctly!','exit','getJourney','mail','chat','sms','fax','whatsapp','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','voice','uniqueid','source','destination','endtime','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','createdAt','DESC','findAndCountAll','startCase','Account','closed','closedAt','note','secondDisposition','key','Owner','customerIp','customerPort','deviceModel','osName','ratingMessage','subject','substatus','openchannel','externalUrl','threadId','Interaction','sortBy','reverse','moment','bluebird','util','path','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','socket.io-emitter','./cmContact.socket','register','status','json','offset','limit','undefined','update','then','destroy','end','error','stack','name','send','index','describe','keys','startsWith','cf_','push'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xcea0,0xf7));var _0x0cea=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xcea0[_0x346737];return _0x1ade2e;};'use strict';var moment=require(_0x0cea('0x0'));var BPromise=require(_0x0cea('0x1'));var util=require(_0x0cea('0x2'));var path=require(_0x0cea('0x3'));var fs=require('fs');var _=require(_0x0cea('0x4'));var squel=require(_0x0cea('0x5'));var Papa=require('papaparse');var Redis=require(_0x0cea('0x6'));var qs=require('../../components/parsers/qs');var as=require(_0x0cea('0x7'));var logger=require(_0x0cea('0x8'))(_0x0cea('0x9'));var config=require(_0x0cea('0xa'));var db=require('../../mysqldb')['db'];config[_0x0cea('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0cea('0xc'))(new Redis(config[_0x0cea('0xb')]));require(_0x0cea('0xd'))[_0x0cea('0xe')](socket);function respondWithResult(_0xfcb455,_0x3b906b){_0x3b906b=_0x3b906b||0xc8;return function(_0x21308c){if(_0x21308c){return _0xfcb455[_0x0cea('0xf')](_0x3b906b)[_0x0cea('0x10')](_0x21308c);}};}function respondWithFilteredResult(_0x2e6ae9,_0x247f88){return function(_0x362df){if(_0x362df){var _0x5352ee=typeof _0x247f88[_0x0cea('0x11')]==='undefined'&&typeof _0x247f88[_0x0cea('0x12')]===_0x0cea('0x13');var _0x1dc038=_0x362df['count'];var _0x4ef0c9=_0x5352ee?0x0:_0x247f88[_0x0cea('0x11')];var _0x5f3fd9=_0x5352ee?_0x362df['count']:_0x247f88[_0x0cea('0x11')]+_0x247f88[_0x0cea('0x12')];var _0x40c3f3;if(_0x5f3fd9>=_0x1dc038){_0x5f3fd9=_0x1dc038;_0x40c3f3=0xc8;}else{_0x40c3f3=0xce;}_0x2e6ae9[_0x0cea('0xf')](_0x40c3f3);return _0x2e6ae9['set']('Content-Range',_0x4ef0c9+'-'+_0x5f3fd9+'/'+_0x1dc038)[_0x0cea('0x10')](_0x362df);}return null;};}function saveUpdates(_0x309205){return function(_0x29c7ca){if(_0x29c7ca){return _0x29c7ca[_0x0cea('0x14')](_0x309205)[_0x0cea('0x15')](function(_0x3d4458){return _0x3d4458;});}return null;};}function removeEntity(_0x45fedf){return function(_0x5824d6){if(_0x5824d6){return _0x5824d6[_0x0cea('0x16')]()[_0x0cea('0x15')](function(){_0x45fedf[_0x0cea('0xf')](0xcc)[_0x0cea('0x17')]();});}};}function handleEntityNotFound(_0x4811d4){return function(_0x5b03a1){if(!_0x5b03a1){_0x4811d4['sendStatus'](0x194);}return _0x5b03a1;};}function handleError(_0x5e97e0,_0x5cd7de){_0x5cd7de=_0x5cd7de||0x1f4;return function(_0x5bc90f){logger[_0x0cea('0x18')](_0x5bc90f[_0x0cea('0x19')]);if(_0x5bc90f[_0x0cea('0x1a')]){delete _0x5bc90f[_0x0cea('0x1a')];}_0x5e97e0[_0x0cea('0xf')](_0x5cd7de)[_0x0cea('0x1b')](_0x5bc90f);};}exports[_0x0cea('0x1c')]=function(_0x1a91cd,_0xa9c147){var _0x504666={},_0x2c9814={},_0xfa14da={'count':0x0,'rows':[]};return db['CmContact'][_0x0cea('0x1d')]()[_0x0cea('0x15')](function(_0x15d092){var _0x45444b=[];for(var _0x46f97b=0x0;_0x46f97b
','Attachments','Title','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','moment','randomstring','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','@xcally.com','value','name','substring','split','length','slice','Anonymous','pop','generate','html','test'];(function(_0xe286c6,_0x5f57f3){var _0x1c2d32=function(_0x31dbc3){while(--_0x31dbc3){_0xe286c6['push'](_0xe286c6['shift']());}};_0x1c2d32(++_0x5f57f3);}(_0x15ef,0x80));var _0xf15e=function(_0x400b01,_0x20bcd3){_0x400b01=_0x400b01-0x0;var _0x480105=_0x15ef[_0x400b01];return _0x480105;};'use strict';var _=require('lodash');var moment=require(_0xf15e('0x0'));var random=require(_0xf15e('0x1'));var fs=require('fs');var path=require('path');var util=require(_0xf15e('0x2'));var tnef=require(_0xf15e('0x3'));var logger=require(_0xf15e('0x4'))(_0xf15e('0x5'));var config=require(_0xf15e('0x6'));function getAddress(_0x5d456b){var _0x1b9a24=_[_0xf15e('0x7')](_0x5d456b['value']);return _0x1b9a24&&_0x1b9a24['address']?_0x1b9a24[_0xf15e('0x8')]:_0xf15e('0x9')+random['generate'](0x6)+_0xf15e('0xa');}function getFirstName(_0x4daf89){var _0x1168c3=_[_0xf15e('0x7')](_0x4daf89[_0xf15e('0xb')]);if(_0x1168c3&&_0x1168c3[_0xf15e('0xc')]){if(_0x1168c3['name']==_0x1168c3['address']){return _0x1168c3['name'][_0xf15e('0xd')](0x0,_0x1168c3[_0xf15e('0xc')]['indexOf']('@'));}var _0x5e487f=_0x1168c3['name'][_0xf15e('0xe')](/\s+/);return _0x5e487f[_0xf15e('0xf')]>0x1?_0x5e487f[_0xf15e('0x10')](0x0,-0x1)['join']('\x20'):_0x1168c3[_0xf15e('0xc')];}return _0xf15e('0x11');}function getLastName(_0x16a04a){var _0x5da521=_[_0xf15e('0x7')](_0x16a04a[_0xf15e('0xb')]);if(_0x5da521&&_0x5da521[_0xf15e('0xc')]){var _0x280b78=_0x5da521[_0xf15e('0xc')][_0xf15e('0xe')](/\s+/);return _0x280b78[_0xf15e('0xf')]>0x1?_0x280b78[_0xf15e('0x12')]():'';}return'';}function getMails(_0x54b94c,_0x11866c){var _0x29a3bd='';for(var _0x4a2c32=0x0;_0x4a2c32<_0x11866c[_0xf15e('0xb')][_0xf15e('0xf')];_0x4a2c32+=0x1){if(_0x11866c[_0xf15e('0xb')][_0x4a2c32]['address']!==_0x54b94c){if(!_['isEmpty'](_0x29a3bd)){_0x29a3bd+=',';}_0x29a3bd+=_0x11866c[_0xf15e('0xb')][_0x4a2c32][_0xf15e('0xc')]||_0x11866c['value'][_0x4a2c32][_0xf15e('0x8')]||'';_0x29a3bd+='\x20<';_0x29a3bd+=_0x11866c[_0xf15e('0xb')][_0x4a2c32][_0xf15e('0x8')]?_0x11866c['value'][_0x4a2c32]['address']:_0xf15e('0x9')+random[_0xf15e('0x13')](0x6)+'@xcally.com';_0x29a3bd+='>';}}return _0x29a3bd;}function parseEmail(_0x1012ea,_0x56e8c9,_0x5560c1){if(_0x56e8c9[_0xf15e('0x14')]){var _0x239d41=/