From: support
Date: Tue, 22 Mar 2022 09:25:06 +0000 (+0000)
Subject: Built motion from commit 6d0b49e9.|2.6.7
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%20%20%20%20%2011license.mail?a=commitdiff_plain;h=fe382b814b9b38d8b0c683b26407fda60adc979a;p=motion2.git
Built motion from commit 6d0b49e9.|2.6.7
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index cdb9018..3c8cd6b 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-03-22T08:56:27.615Z",
+ "time": "2022-03-22T09:17:24.788Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index e960364..60fc86b 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-03-22T08:56:27.615Z",
+ "time": "2022-03-22T09:17:24.788Z",
"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 d971da4..564dc9a 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 _0x58a7=['integration','motionbar','jscripty','browser','bot','script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager'];(function(_0x391b46,_0x582609){var _0x577fd5=function(_0x5d4a11){while(--_0x5d4a11){_0x391b46['push'](_0x391b46['shift']());}};_0x577fd5(++_0x582609);}(_0x58a7,0x1e7));var _0x758a=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x58a7[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x758a('0x0'));module[_0x758a('0x1')]={'name':{'type':Sequelize[_0x758a('0x2')],'get':function(_0x554b9c){return this[_0x758a('0x3')](_0x758a('0x4'));}},'action':{'type':Sequelize[_0x758a('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x758a('0x6'),_0x758a('0x7'),_0x758a('0x8'),_0x758a('0x9'),'urlForward',_0x758a('0xa'),_0x758a('0xb'),_0x758a('0xc')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x758a('0x5')](0x1000),'comment':'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)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x758a('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x758a('0xe')},'data4':{'type':Sequelize[_0x758a('0x5')](0x1000),'comments':_0x758a('0xf')},'data5':{'type':Sequelize[_0x758a('0x5')](0x1000),'comments':_0x758a('0x10')},'data6':{'type':Sequelize[_0x758a('0x5')],'comments':_0x758a('0x11')},'data7':{'type':Sequelize[_0x758a('0x12')],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0xa54f=['script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','contactManager','integration','motionbar','jscripty','urlForward','bot'];(function(_0xcfd89f,_0x106e8f){var _0x59acd4=function(_0x2e187c){while(--_0x2e187c){_0xcfd89f['push'](_0xcfd89f['shift']());}};_0x59acd4(++_0x106e8f);}(_0xa54f,0x173));var _0xfa54=function(_0x4f8bbf,_0x1b1a45){_0x4f8bbf=_0x4f8bbf-0x0;var _0x5aa7a7=_0xa54f[_0x4f8bbf];return _0x5aa7a7;};'use strict';var Sequelize=require(_0xfa54('0x0'));module[_0xfa54('0x1')]={'name':{'type':Sequelize[_0xfa54('0x2')],'get':function(_0x51fa50){return this['getDataValue']('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xfa54('0x3'),_0xfa54('0x4'),_0xfa54('0x5'),_0xfa54('0x6'),_0xfa54('0x7'),'browser',_0xfa54('0x8'),_0xfa54('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xfa54('0xa')},'data1':{'type':Sequelize[_0xfa54('0xb')](0x1000),'comment':_0xfa54('0xc')},'data2':{'type':Sequelize[_0xfa54('0xb')](0x1000),'comment':_0xfa54('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xfa54('0xe')},'data4':{'type':Sequelize[_0xfa54('0xb')](0x1000),'comments':_0xfa54('0xf')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xfa54('0x10')},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xfa54('0x11')],'comments':_0xfa54('0x12')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 3e9334a..fea535e 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 _0x67ba=['api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','error','name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger'];(function(_0x18e9d5,_0x36e419){var _0x441065=function(_0x55ac72){while(--_0x55ac72){_0x18e9d5['push'](_0x18e9d5['shift']());}};_0x441065(++_0x36e419);}(_0x67ba,0xce));var _0xa67b=function(_0x44b57e,_0xdaa741){_0x44b57e=_0x44b57e-0x0;var _0x5128d8=_0x67ba[_0x44b57e];return _0x5128d8;};'use strict';var emlformat=require(_0xa67b('0x0'));var rimraf=require(_0xa67b('0x1'));var zipdir=require(_0xa67b('0x2'));var jsonpatch=require(_0xa67b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa67b('0x4'));var Mustache=require(_0xa67b('0x5'));var util=require(_0xa67b('0x6'));var path=require(_0xa67b('0x7'));var sox=require('sox');var csv=require(_0xa67b('0x8'));var ejs=require(_0xa67b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa67b('0xa'));var crypto=require(_0xa67b('0xb'));var jsforce=require(_0xa67b('0xc'));var deskjs=require(_0xa67b('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa67b('0xe'));var Papa=require('papaparse');var Redis=require(_0xa67b('0xf'));var authService=require(_0xa67b('0x10'));var qs=require(_0xa67b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa67b('0x12'))(_0xa67b('0x13'));var utils=require('../../config/utils');var config=require(_0xa67b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xa67b('0x15'))['db'];function respondWithStatusCode(_0x5282d3,_0xadc759){_0xadc759=_0xadc759||0xcc;return function(_0x7933fe){if(_0x7933fe){return _0x5282d3[_0xa67b('0x16')](_0xadc759);}return _0x5282d3[_0xa67b('0x17')](_0xadc759)[_0xa67b('0x18')]();};}function respondWithResult(_0x5d9715,_0x4c9201){_0x4c9201=_0x4c9201||0xc8;return function(_0x13c94a){if(_0x13c94a){return _0x5d9715[_0xa67b('0x17')](_0x4c9201)[_0xa67b('0x19')](_0x13c94a);}};}function respondWithFilteredResult(_0x45b6a6,_0x275bc3){return function(_0x3c292c){if(_0x3c292c){var _0x327eda=typeof _0x275bc3['offset']===_0xa67b('0x1a')&&typeof _0x275bc3[_0xa67b('0x1b')]===_0xa67b('0x1a');var _0xdb0d65=_0x3c292c['count'];var _0x436168=_0x327eda?0x0:_0x275bc3[_0xa67b('0x1c')];var _0x8e0d2a=_0x327eda?_0x3c292c[_0xa67b('0x1d')]:_0x275bc3[_0xa67b('0x1c')]+_0x275bc3['limit'];var _0x343e7d;if(_0x8e0d2a>=_0xdb0d65){_0x8e0d2a=_0xdb0d65;_0x343e7d=0xc8;}else{_0x343e7d=0xce;}_0x45b6a6[_0xa67b('0x17')](_0x343e7d);return _0x45b6a6[_0xa67b('0x1e')](_0xa67b('0x1f'),_0x436168+'-'+_0x8e0d2a+'/'+_0xdb0d65)['json'](_0x3c292c);}return null;};}function patchUpdates(_0x1084d0){return function(_0x1371a8){try{jsonpatch[_0xa67b('0x20')](_0x1371a8,_0x1084d0,!![]);}catch(_0x4711aa){return BPromise['reject'](_0x4711aa);}return _0x1371a8[_0xa67b('0x21')]();};}function saveUpdates(_0x5a2c07,_0x52037f){return function(_0x362cd7){if(_0x362cd7){return _0x362cd7[_0xa67b('0x22')](_0x5a2c07)[_0xa67b('0x23')](function(_0x1167f5){return _0x1167f5;});}return null;};}function removeEntity(_0x4e21ee,_0x35ca4d){return function(_0x442e63){if(_0x442e63){return _0x442e63[_0xa67b('0x24')]()['then'](function(){_0x4e21ee[_0xa67b('0x17')](0xcc)[_0xa67b('0x18')]();});}};}function handleEntityNotFound(_0x3536a3,_0x4b18a6){return function(_0x2b0151){if(!_0x2b0151){_0x3536a3[_0xa67b('0x16')](0x194);}return _0x2b0151;};}function handleError(_0x2360ee,_0x1035a8){_0x1035a8=_0x1035a8||0x1f4;return function(_0x5d9e4a){logger[_0xa67b('0x25')](_0x5d9e4a['stack']);if(_0x5d9e4a[_0xa67b('0x26')]){delete _0x5d9e4a[_0xa67b('0x26')];}_0x2360ee[_0xa67b('0x17')](_0x1035a8)[_0xa67b('0x27')](_0x5d9e4a);};}exports['update']=function(_0x31e1a2,_0x4a1071){if(_0x31e1a2[_0xa67b('0x28')]['id']){delete _0x31e1a2[_0xa67b('0x28')]['id'];}return db[_0xa67b('0x29')][_0xa67b('0x2a')]({'where':{'id':_0x31e1a2[_0xa67b('0x2b')]['id']}})[_0xa67b('0x23')](handleEntityNotFound(_0x4a1071,null))[_0xa67b('0x23')](saveUpdates(_0x31e1a2['body'],null))[_0xa67b('0x23')](respondWithResult(_0x4a1071,null))[_0xa67b('0x2c')](handleError(_0x4a1071,null));};exports['destroy']=function(_0x1502b9,_0x5176b8){return db[_0xa67b('0x29')][_0xa67b('0x2a')]({'where':{'id':_0x1502b9[_0xa67b('0x2b')]['id']}})[_0xa67b('0x23')](handleEntityNotFound(_0x5176b8,null))[_0xa67b('0x23')](removeEntity(_0x5176b8,null))[_0xa67b('0x2c')](handleError(_0x5176b8,null));};
\ No newline at end of file
+var _0xa220=['count','offset','set','Content-Range','apply','reject','update','destroy','then','name','send','body','Action','params','find','catch','eml-format','rimraf','fast-json-patch','request-promise','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit'];(function(_0x36bf88,_0x15c459){var _0x332914=function(_0x512adf){while(--_0x512adf){_0x36bf88['push'](_0x36bf88['shift']());}};_0x332914(++_0x15c459);}(_0xa220,0x124));var _0x0a22=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xa220[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x0a22('0x0'));var rimraf=require(_0x0a22('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0a22('0x2'));var rp=require(_0x0a22('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0a22('0x4'));var path=require('path');var sox=require(_0x0a22('0x5'));var csv=require('to-csv');var ejs=require(_0x0a22('0x6'));var fs=require('fs');var fs_extra=require(_0x0a22('0x7'));var _=require(_0x0a22('0x8'));var squel=require('squel');var crypto=require(_0x0a22('0x9'));var jsforce=require(_0x0a22('0xa'));var deskjs=require(_0x0a22('0xb'));var toCsv=require(_0x0a22('0xc'));var querystring=require(_0x0a22('0xd'));var Papa=require(_0x0a22('0xe'));var Redis=require(_0x0a22('0xf'));var authService=require(_0x0a22('0x10'));var qs=require(_0x0a22('0x11'));var as=require(_0x0a22('0x12'));var hardwareService=require(_0x0a22('0x13'));var logger=require('../../config/logger')(_0x0a22('0x14'));var utils=require(_0x0a22('0x15'));var config=require(_0x0a22('0x16'));var licenseUtil=require(_0x0a22('0x17'));var db=require(_0x0a22('0x18'))['db'];function respondWithStatusCode(_0x5b5eaa,_0x30bc68){_0x30bc68=_0x30bc68||0xcc;return function(_0x4ec771){if(_0x4ec771){return _0x5b5eaa[_0x0a22('0x19')](_0x30bc68);}return _0x5b5eaa[_0x0a22('0x1a')](_0x30bc68)[_0x0a22('0x1b')]();};}function respondWithResult(_0x4fbb91,_0x3c53d8){_0x3c53d8=_0x3c53d8||0xc8;return function(_0x2afa2c){if(_0x2afa2c){return _0x4fbb91[_0x0a22('0x1a')](_0x3c53d8)[_0x0a22('0x1c')](_0x2afa2c);}};}function respondWithFilteredResult(_0x29192c,_0x5a857b){return function(_0x295ae9){if(_0x295ae9){var _0x110f59=typeof _0x5a857b['offset']==='undefined'&&typeof _0x5a857b[_0x0a22('0x1d')]==='undefined';var _0x329f1a=_0x295ae9[_0x0a22('0x1e')];var _0x561671=_0x110f59?0x0:_0x5a857b[_0x0a22('0x1f')];var _0x1baca9=_0x110f59?_0x295ae9[_0x0a22('0x1e')]:_0x5a857b['offset']+_0x5a857b[_0x0a22('0x1d')];var _0x38c914;if(_0x1baca9>=_0x329f1a){_0x1baca9=_0x329f1a;_0x38c914=0xc8;}else{_0x38c914=0xce;}_0x29192c[_0x0a22('0x1a')](_0x38c914);return _0x29192c[_0x0a22('0x20')](_0x0a22('0x21'),_0x561671+'-'+_0x1baca9+'/'+_0x329f1a)['json'](_0x295ae9);}return null;};}function patchUpdates(_0x1c97eb){return function(_0x24666a){try{jsonpatch[_0x0a22('0x22')](_0x24666a,_0x1c97eb,!![]);}catch(_0xbe4188){return BPromise[_0x0a22('0x23')](_0xbe4188);}return _0x24666a['save']();};}function saveUpdates(_0x313a70,_0x3aac7c){return function(_0x44b5c4){if(_0x44b5c4){return _0x44b5c4[_0x0a22('0x24')](_0x313a70)['then'](function(_0xec873f){return _0xec873f;});}return null;};}function removeEntity(_0x27f330,_0x287170){return function(_0x2390af){if(_0x2390af){return _0x2390af[_0x0a22('0x25')]()[_0x0a22('0x26')](function(){_0x27f330[_0x0a22('0x1a')](0xcc)[_0x0a22('0x1b')]();});}};}function handleEntityNotFound(_0x12f9ba,_0xbd86cf){return function(_0x14fdc9){if(!_0x14fdc9){_0x12f9ba['sendStatus'](0x194);}return _0x14fdc9;};}function handleError(_0x2f1c00,_0x4cad03){_0x4cad03=_0x4cad03||0x1f4;return function(_0x407801){logger['error'](_0x407801['stack']);if(_0x407801[_0x0a22('0x27')]){delete _0x407801['name'];}_0x2f1c00[_0x0a22('0x1a')](_0x4cad03)[_0x0a22('0x28')](_0x407801);};}exports[_0x0a22('0x24')]=function(_0x3e6a46,_0x5edf6d){if(_0x3e6a46[_0x0a22('0x29')]['id']){delete _0x3e6a46['body']['id'];}return db[_0x0a22('0x2a')]['find']({'where':{'id':_0x3e6a46[_0x0a22('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5edf6d,null))['then'](saveUpdates(_0x3e6a46[_0x0a22('0x29')],null))[_0x0a22('0x26')](respondWithResult(_0x5edf6d,null))['catch'](handleError(_0x5edf6d,null));};exports[_0x0a22('0x25')]=function(_0x48e9f2,_0x281284){return db[_0x0a22('0x2a')][_0x0a22('0x2c')]({'where':{'id':_0x48e9f2[_0x0a22('0x2b')]['id']}})[_0x0a22('0x26')](handleEntityNotFound(_0x281284,null))[_0x0a22('0x26')](removeEntity(_0x281284,null))[_0x0a22('0x2d')](handleError(_0x281284,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 2c5b414..b82f8d3 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 _0x342f=['request-promise','rimraf','./action.attributes','exports','Action','tools_actions','lodash','util','../../config/logger','api','moment'];(function(_0x521378,_0x2f8004){var _0x4b2fc4=function(_0x25511e){while(--_0x25511e){_0x521378['push'](_0x521378['shift']());}};_0x4b2fc4(++_0x2f8004);}(_0x342f,0x1d4));var _0xf342=function(_0x4d7d43,_0x5ecccb){_0x4d7d43=_0x4d7d43-0x0;var _0x9e0feb=_0x342f[_0x4d7d43];return _0x9e0feb;};'use strict';var _=require(_0xf342('0x0'));var util=require(_0xf342('0x1'));var logger=require(_0xf342('0x2'))(_0xf342('0x3'));var moment=require(_0xf342('0x4'));var BPromise=require('bluebird');var rp=require(_0xf342('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf342('0x6'));var config=require('../../config/environment');var attributes=require(_0xf342('0x7'));module[_0xf342('0x8')]=function(_0x50027b,_0x267387){return _0x50027b['define'](_0xf342('0x9'),attributes,{'tableName':_0xf342('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3d55=['exports','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x2c3c35,_0x7a5001){var _0x1f9506=function(_0x514625){while(--_0x514625){_0x2c3c35['push'](_0x2c3c35['shift']());}};_0x1f9506(++_0x7a5001);}(_0x3d55,0x141));var _0x53d5=function(_0x8efbee,_0x107af1){_0x8efbee=_0x8efbee-0x0;var _0x1e92c1=_0x3d55[_0x8efbee];return _0x1e92c1;};'use strict';var _=require(_0x53d5('0x0'));var util=require(_0x53d5('0x1'));var logger=require(_0x53d5('0x2'))(_0x53d5('0x3'));var moment=require(_0x53d5('0x4'));var BPromise=require(_0x53d5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x53d5('0x6'));var rimraf=require(_0x53d5('0x7'));var config=require(_0x53d5('0x8'));var attributes=require('./action.attributes');module[_0x53d5('0x9')]=function(_0x38a18e,_0x14b38c){return _0x38a18e['define']('Action',attributes,{'tableName':_0x53d5('0xa'),'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 798d70d..b025f15 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x5df7ad,_0x26db74){var _0x2a46f0=function(_0x3bf107){while(--_0x3bf107){_0x5df7ad['push'](_0x5df7ad['shift']());}};_0x2a46f0(++_0x26db74);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xc4aa[_0x51020b];return _0x371e47;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
+var _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x57669f,_0x2196b8){var _0x183977=function(_0x1606ff){while(--_0x1606ff){_0x57669f['push'](_0x57669f['shift']());}};_0x183977(++_0x2196b8);}(_0x1261,0x144));var _0x1126=function(_0xc5a279,_0x155360){_0xc5a279=_0xc5a279-0x0;var _0xc755d3=_0x1261[_0xc5a279];return _0xc755d3;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 9e15d4c..0b9c84c 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 _0x5ba3=['put','isAuthenticated','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0xd6802,_0x3e4d3f){var _0x5ebf43=function(_0x477ecb){while(--_0x477ecb){_0xd6802['push'](_0xd6802['shift']());}};_0x5ebf43(++_0x3e4d3f);}(_0x5ba3,0xd9));var _0x35ba=function(_0x54becc,_0x9bcfc8){_0x54becc=_0x54becc-0x0;var _0x3f5ef5=_0x5ba3[_0x54becc];return _0x3f5ef5;};'use strict';var multer=require(_0x35ba('0x0'));var util=require(_0x35ba('0x1'));var path=require('path');var timeout=require(_0x35ba('0x2'));var express=require(_0x35ba('0x3'));var router=express[_0x35ba('0x4')]();var fs_extra=require(_0x35ba('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x35ba('0x6'));var controller=require('./action.controller');router[_0x35ba('0x7')]('/:id',auth[_0x35ba('0x8')](),controller[_0x35ba('0x9')]);router[_0x35ba('0xa')](_0x35ba('0xb'),auth[_0x35ba('0x8')](),controller[_0x35ba('0xc')]);module[_0x35ba('0xd')]=router;
\ No newline at end of file
+var _0x6bc0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id','isAuthenticated','delete','destroy','util','path'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x6bc0,0x15a));var _0x06bc=function(_0x4bf342,_0x2f8c4e){_0x4bf342=_0x4bf342-0x0;var _0x210afe=_0x6bc0[_0x4bf342];return _0x210afe;};'use strict';var multer=require('multer');var util=require(_0x06bc('0x0'));var path=require(_0x06bc('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x06bc('0x2')]();var fs_extra=require(_0x06bc('0x3'));var auth=require(_0x06bc('0x4'));var interaction=require(_0x06bc('0x5'));var config=require('../../config/environment');var controller=require(_0x06bc('0x6'));router[_0x06bc('0x7')](_0x06bc('0x8'),auth[_0x06bc('0x9')](),controller['update']);router[_0x06bc('0xa')](_0x06bc('0x8'),auth[_0x06bc('0x9')](),controller[_0x06bc('0xb')]);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 526498c..5b71ba1 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 _0x5496=['TEXT','sequelize','exports','STRING'];(function(_0x37dc97,_0x1dbe04){var _0x16f2dd=function(_0x2d67dd){while(--_0x2d67dd){_0x37dc97['push'](_0x37dc97['shift']());}};_0x16f2dd(++_0x1dbe04);}(_0x5496,0x175));var _0x6549=function(_0x3bfe19,_0x5e8fd0){_0x3bfe19=_0x3bfe19-0x0;var _0x12b965=_0x5496[_0x3bfe19];return _0x12b965;};'use strict';var Sequelize=require(_0x6549('0x0'));module[_0x6549('0x1')]={'name':{'type':Sequelize[_0x6549('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6549('0x2')]},'parent':{'type':Sequelize[_0x6549('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x6549('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x83221c,_0x3975ef){var _0x2fa1fc=function(_0x26d691){while(--_0x26d691){_0x83221c['push'](_0x83221c['shift']());}};_0x2fa1fc(++_0x3975ef);}(_0x5fab,0x177));var _0xb5fa=function(_0x1ee611,_0x377a3a){_0x1ee611=_0x1ee611-0x0;var _0x3bce0a=_0x5fab[_0x1ee611];return _0x3bce0a;};'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
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index d421912..89ea99a 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 _0x0c8c=['Content-Range','reject','update','then','destroy','CustomReports','UserProfileResource','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','table','MetricId','metric','function','format','replace','groupBy','orderBy','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','DATE(%s)','IS\x20EMPTY','Please\x20insert\x20at\x20least\x20one\x20field','from','DESC','output','fullPath','%s-%s.%s','randomstring','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','run','ROUND(%s)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x0c8c,0x129));var _0xc0c8=function(_0x36e3b4,_0xba85ae){_0x36e3b4=_0x36e3b4-0x0;var _0x1f764c=_0x0c8c[_0x36e3b4];return _0x1f764c;};'use strict';var emlformat=require(_0xc0c8('0x0'));var rimraf=require(_0xc0c8('0x1'));var zipdir=require(_0xc0c8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc0c8('0x3'));var moment=require(_0xc0c8('0x4'));var BPromise=require(_0xc0c8('0x5'));var Mustache=require(_0xc0c8('0x6'));var util=require(_0xc0c8('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xc0c8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc0c8('0x9'));var _=require('lodash');var squel=require(_0xc0c8('0xa'));var crypto=require(_0xc0c8('0xb'));var jsforce=require(_0xc0c8('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc0c8('0x8'));var querystring=require('querystring');var Papa=require(_0xc0c8('0xd'));var Redis=require(_0xc0c8('0xe'));var authService=require(_0xc0c8('0xf'));var qs=require(_0xc0c8('0x10'));var as=require(_0xc0c8('0x11'));var hardwareService=require(_0xc0c8('0x12'));var logger=require(_0xc0c8('0x13'))(_0xc0c8('0x14'));var utils=require(_0xc0c8('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc0c8('0x16'));var db=require(_0xc0c8('0x17'))['db'];var dbH=require(_0xc0c8('0x17'))[_0xc0c8('0x18')];function respondWithStatusCode(_0x5043cc,_0x44e7ba){_0x44e7ba=_0x44e7ba||0xcc;return function(_0x171466){if(_0x171466){return _0x5043cc[_0xc0c8('0x19')](_0x44e7ba);}return _0x5043cc[_0xc0c8('0x1a')](_0x44e7ba)[_0xc0c8('0x1b')]();};}function respondWithResult(_0x5b2acf,_0x47af96){_0x47af96=_0x47af96||0xc8;return function(_0x309c47){if(_0x309c47){return _0x5b2acf[_0xc0c8('0x1a')](_0x47af96)[_0xc0c8('0x1c')](_0x309c47);}};}function respondWithFilteredResult(_0x216629,_0x22a9fd){return function(_0x2fcb85){if(_0x2fcb85){var _0x2cbc91=typeof _0x22a9fd[_0xc0c8('0x1d')]===_0xc0c8('0x1e')&&typeof _0x22a9fd['limit']===_0xc0c8('0x1e');var _0x5605d4=_0x2fcb85[_0xc0c8('0x1f')];var _0x2a80e7=_0x2cbc91?0x0:_0x22a9fd['offset'];var _0x19e440=_0x2cbc91?_0x2fcb85['count']:_0x22a9fd['offset']+_0x22a9fd['limit'];var _0x281ac8;if(_0x19e440>=_0x5605d4){_0x19e440=_0x5605d4;_0x281ac8=0xc8;}else{_0x281ac8=0xce;}_0x216629[_0xc0c8('0x1a')](_0x281ac8);return _0x216629[_0xc0c8('0x20')](_0xc0c8('0x21'),_0x2a80e7+'-'+_0x19e440+'/'+_0x5605d4)['json'](_0x2fcb85);}return null;};}function patchUpdates(_0x3a0176){return function(_0x3b3aca){try{jsonpatch['apply'](_0x3b3aca,_0x3a0176,!![]);}catch(_0x52852a){return BPromise[_0xc0c8('0x22')](_0x52852a);}return _0x3b3aca['save']();};}function saveUpdates(_0x15178d,_0x190b7b){return function(_0x53c6f9){if(_0x53c6f9){return _0x53c6f9[_0xc0c8('0x23')](_0x15178d)[_0xc0c8('0x24')](function(_0x1284ce){return _0x1284ce;});}return null;};}function removeEntity(_0x5b0b42,_0x30752f){return function(_0x3aa9ab){if(_0x3aa9ab){return _0x3aa9ab[_0xc0c8('0x25')]()[_0xc0c8('0x24')](function(){var _0x31abff=_0x3aa9ab['get']({'plain':!![]});var _0x6c3296=_0xc0c8('0x26');return db[_0xc0c8('0x27')][_0xc0c8('0x25')]({'where':{'type':_0x6c3296,'resourceId':_0x31abff['id']}})[_0xc0c8('0x24')](function(){return _0x3aa9ab;});})['then'](function(){_0x5b0b42[_0xc0c8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd5217e,_0x1731c8){return function(_0x5927fa){if(!_0x5927fa){_0xd5217e[_0xc0c8('0x19')](0x194);}return _0x5927fa;};}function handleError(_0x2bcc42,_0x4c5da5){_0x4c5da5=_0x4c5da5||0x1f4;return function(_0x1799c5){logger['error'](_0x1799c5['stack']);if(_0x1799c5[_0xc0c8('0x28')]){delete _0x1799c5[_0xc0c8('0x28')];}_0x2bcc42[_0xc0c8('0x1a')](_0x4c5da5)[_0xc0c8('0x29')](_0x1799c5);};}exports[_0xc0c8('0x2a')]=function(_0x23cac7,_0xb29cda){var _0x49b3d8={},_0x149c9f={},_0x36aad7={'count':0x0,'rows':[]};var _0x2a4bdd=_[_0xc0c8('0x2b')](db[_0xc0c8('0x2c')][_0xc0c8('0x2d')],function(_0x1ba1f7){return{'name':_0x1ba1f7[_0xc0c8('0x2e')],'type':_0x1ba1f7[_0xc0c8('0x2f')][_0xc0c8('0x30')]};});_0x149c9f[_0xc0c8('0x31')]=_['map'](_0x2a4bdd,_0xc0c8('0x28'));_0x149c9f[_0xc0c8('0x32')]=_['keys'](_0x23cac7[_0xc0c8('0x32')]);_0x149c9f[_0xc0c8('0x33')]=_[_0xc0c8('0x34')](_0x149c9f['model'],_0x149c9f[_0xc0c8('0x32')]);_0x49b3d8[_0xc0c8('0x35')]=_[_0xc0c8('0x34')](_0x149c9f[_0xc0c8('0x31')],qs[_0xc0c8('0x36')](_0x23cac7['query'][_0xc0c8('0x36')]));_0x49b3d8['attributes']=_0x49b3d8[_0xc0c8('0x35')][_0xc0c8('0x37')]?_0x49b3d8['attributes']:_0x149c9f[_0xc0c8('0x31')];if(!_0x23cac7[_0xc0c8('0x32')][_0xc0c8('0x38')](_0xc0c8('0x39'))){_0x49b3d8['limit']=qs[_0xc0c8('0x3a')](_0x23cac7[_0xc0c8('0x32')][_0xc0c8('0x3a')]);_0x49b3d8[_0xc0c8('0x1d')]=qs[_0xc0c8('0x1d')](_0x23cac7[_0xc0c8('0x32')][_0xc0c8('0x1d')]);}_0x49b3d8[_0xc0c8('0x3b')]=qs[_0xc0c8('0x3c')](_0x23cac7[_0xc0c8('0x32')][_0xc0c8('0x3c')]);_0x49b3d8['where']=qs[_0xc0c8('0x33')](_[_0xc0c8('0x3d')](_0x23cac7[_0xc0c8('0x32')],_0x149c9f[_0xc0c8('0x33')]),_0x2a4bdd);if(_0x23cac7[_0xc0c8('0x32')][_0xc0c8('0x3e')]){_0x49b3d8[_0xc0c8('0x3f')]=_[_0xc0c8('0x40')](_0x49b3d8['where'],{'$or':_[_0xc0c8('0x2b')](_0x2a4bdd,function(_0x332e1a){if(_0x332e1a['type']!==_0xc0c8('0x41')){var _0x2db947={};_0x2db947[_0x332e1a[_0xc0c8('0x28')]]={'$like':'%'+_0x23cac7[_0xc0c8('0x32')]['filter']+'%'};return _0x2db947;}})});}_0x49b3d8=_[_0xc0c8('0x40')]({},_0x49b3d8,_0x23cac7[_0xc0c8('0x42')]);var _0x21b976={'where':_0x49b3d8[_0xc0c8('0x3f')]};return db[_0xc0c8('0x2c')]['count'](_0x21b976)[_0xc0c8('0x24')](function(_0x40b36c){_0x36aad7[_0xc0c8('0x1f')]=_0x40b36c;if(_0x23cac7['query']['includeAll']){_0x49b3d8[_0xc0c8('0x43')]=[{'all':!![]}];}return db[_0xc0c8('0x2c')][_0xc0c8('0x44')](_0x49b3d8);})[_0xc0c8('0x24')](function(_0x3c6ee2){_0x36aad7[_0xc0c8('0x45')]=_0x3c6ee2;return _0x36aad7;})[_0xc0c8('0x24')](respondWithFilteredResult(_0xb29cda,_0x49b3d8))[_0xc0c8('0x46')](handleError(_0xb29cda,null));};exports[_0xc0c8('0x47')]=function(_0x5a0b9c,_0x3bbd00){var _0x5ad762={'raw':![],'where':{'id':_0x5a0b9c[_0xc0c8('0x48')]['id']}},_0x1ed916={};_0x1ed916[_0xc0c8('0x31')]=_[_0xc0c8('0x49')](db[_0xc0c8('0x2c')][_0xc0c8('0x2d')]);_0x1ed916[_0xc0c8('0x32')]=_[_0xc0c8('0x49')](_0x5a0b9c[_0xc0c8('0x32')]);_0x1ed916[_0xc0c8('0x33')]=_[_0xc0c8('0x34')](_0x1ed916[_0xc0c8('0x31')],_0x1ed916[_0xc0c8('0x32')]);_0x5ad762['attributes']=_[_0xc0c8('0x34')](_0x1ed916[_0xc0c8('0x31')],qs[_0xc0c8('0x36')](_0x5a0b9c['query']['fields']));_0x5ad762[_0xc0c8('0x35')]=_0x5ad762[_0xc0c8('0x35')][_0xc0c8('0x37')]?_0x5ad762[_0xc0c8('0x35')]:_0x1ed916[_0xc0c8('0x31')];if(_0x5a0b9c[_0xc0c8('0x32')][_0xc0c8('0x4a')]){_0x5ad762[_0xc0c8('0x43')]=[{'all':!![]}];}_0x5ad762=_[_0xc0c8('0x40')]({},_0x5ad762,_0x5a0b9c[_0xc0c8('0x42')]);return db[_0xc0c8('0x2c')][_0xc0c8('0x4b')](_0x5ad762)[_0xc0c8('0x24')](handleEntityNotFound(_0x3bbd00,null))[_0xc0c8('0x24')](respondWithResult(_0x3bbd00,null))[_0xc0c8('0x46')](handleError(_0x3bbd00,null));};exports[_0xc0c8('0x4c')]=function(_0x2abac0,_0xcec5f9){return db[_0xc0c8('0x2c')][_0xc0c8('0x4c')](_0x2abac0[_0xc0c8('0x4d')],{})['then'](function(_0x3af1bc){var _0x45693b=_0x2abac0[_0xc0c8('0x4e')][_0xc0c8('0x4f')]({'plain':!![]});if(!_0x45693b)throw new Error(_0xc0c8('0x50'));if(_0x45693b['role']===_0xc0c8('0x4e')){var _0x494883=_0x3af1bc[_0xc0c8('0x4f')]({'plain':!![]});var _0x4cf72a='Reports';return db[_0xc0c8('0x51')][_0xc0c8('0x4b')]({'where':{'name':_0x4cf72a,'userProfileId':_0x45693b['userProfileId']},'raw':!![]})[_0xc0c8('0x24')](function(_0x167d86){if(_0x167d86&&_0x167d86[_0xc0c8('0x52')]===0x0){return db[_0xc0c8('0x27')][_0xc0c8('0x4c')]({'name':_0x494883[_0xc0c8('0x28')],'resourceId':_0x494883['id'],'type':'CustomReports','sectionId':_0x167d86['id']},{})['then'](function(){return _0x3af1bc;});}else{return _0x3af1bc;}})[_0xc0c8('0x46')](function(_0x550256){logger[_0xc0c8('0x53')](_0xc0c8('0x54'),_0x550256);throw _0x550256;});}return _0x3af1bc;})[_0xc0c8('0x24')](respondWithResult(_0xcec5f9,0xc9))[_0xc0c8('0x46')](handleError(_0xcec5f9,null));};exports['update']=function(_0x13cc93,_0x4b0a20){if(_0x13cc93[_0xc0c8('0x4d')]['id']){delete _0x13cc93[_0xc0c8('0x4d')]['id'];}return db[_0xc0c8('0x2c')][_0xc0c8('0x4b')]({'where':{'id':_0x13cc93[_0xc0c8('0x48')]['id']}})['then'](handleEntityNotFound(_0x4b0a20,null))[_0xc0c8('0x24')](saveUpdates(_0x13cc93[_0xc0c8('0x4d')],null))[_0xc0c8('0x24')](respondWithResult(_0x4b0a20,null))[_0xc0c8('0x46')](handleError(_0x4b0a20,null));};exports[_0xc0c8('0x25')]=function(_0x4ba5a5,_0x133758){return db[_0xc0c8('0x2c')][_0xc0c8('0x4b')]({'where':{'id':_0x4ba5a5['params']['id']}})[_0xc0c8('0x24')](handleEntityNotFound(_0x133758,null))['then'](removeEntity(_0x133758,null))['catch'](handleError(_0x133758,null));};exports[_0xc0c8('0x55')]=function(_0x1740f3,_0xb84b31){var _0x588fc1=0xa;var _0x3134d6=[_0xc0c8('0x56'),_0xc0c8('0x57'),_0xc0c8('0x58'),_0xc0c8('0x59')];var _0x263bd8={'SUM':_0xc0c8('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc0c8('0x5b'),'MAX':_0xc0c8('0x5c'),'MIN':_0xc0c8('0x5d'),'AVG':_0xc0c8('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc0c8('0x5f'),'GROUP_CONCAT DESC':_0xc0c8('0x60')};var _0x5764e0={'SEC_TO_TIME':_0xc0c8('0x61'),'DATE':'DATE(%s)','HOUR':_0xc0c8('0x62'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc0c8('0x63')};var _0x56fcf9=function(_0x5895f2){return!_[_0xc0c8('0x64')]([_0xc0c8('0x65'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xc0c8('0x66')],_0x5895f2);};var _0x458cbb=function(_0x5312c7){if(!_0x5312c7||!_0x5312c7[_0xc0c8('0x67')][_0xc0c8('0x37')]){return'';}for(var _0x2d37d9='(',_0x2a574c=0x0;_0x2a574c<_0x5312c7[_0xc0c8('0x67')][_0xc0c8('0x37')];_0x2a574c+=0x1){_0x2a574c>0x0&&(_0x2d37d9+='\x20'+_0x5312c7[_0xc0c8('0x68')]+'\x20');_0x2d37d9+=_0x5312c7[_0xc0c8('0x67')][_0x2a574c]['group']?_0x458cbb(_0x5312c7['rules'][_0x2a574c][_0xc0c8('0x69')]):_0x5312c7[_0xc0c8('0x67')][_0x2a574c][_0xc0c8('0x6a')]+'\x20'+_0x5312c7['rules'][_0x2a574c]['condition']+(_0x56fcf9(_0x5312c7['rules'][_0x2a574c][_0xc0c8('0x6b')])?'\x20'+_0x5312c7[_0xc0c8('0x67')][_0x2a574c][_0xc0c8('0x6c')]:'');}return _0x2d37d9+')';};var _0x47af9c={'where':{'id':_0x1740f3[_0xc0c8('0x48')]['id']}},_0x5a63e1,_0x30cdce,_0x40a8cb,_0x20db77,_0x1dfc51;_0x47af9c=_['merge']({},_0x47af9c,_0x1740f3[_0xc0c8('0x42')]);return db[_0xc0c8('0x2c')][_0xc0c8('0x4b')](_0x47af9c)['then'](function(_0x24abd9){if(_0x24abd9){_0x5a63e1=_0x24abd9;return _0x24abd9[_0xc0c8('0x6d')]();}return null;})['then'](function(_0x10c804){if(_0x10c804){if(!_0x10c804[_0xc0c8('0x37')]){throw new db[(_0xc0c8('0x6e'))][(_0xc0c8('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x30cdce=_0x10c804;return db[_0xc0c8('0x70')][_0xc0c8('0x44')]({'raw':!![]});}return null;})[_0xc0c8('0x24')](function(_0x1b91f4){if(_0x1b91f4){_0x40a8cb=_[_0xc0c8('0x71')](_0x1b91f4,'id');var _0x3f039c;var _0x31fee6=squel[_0xc0c8('0x72')]();_0x31fee6['from'](_0x5a63e1[_0xc0c8('0x73')]);for(var _0x25ac99=0x0;_0x25ac99<_0x30cdce[_0xc0c8('0x37')];_0x25ac99+=0x1){_0x3f039c=_0x30cdce[_0x25ac99][_0xc0c8('0x74')]?_0x40a8cb[_0x30cdce[_0x25ac99][_0xc0c8('0x74')]][_0xc0c8('0x75')]:_0x30cdce[_0x25ac99][_0xc0c8('0x6a')];_0x3f039c=_0x30cdce[_0x25ac99][_0xc0c8('0x76')]?_['replace'](_0x263bd8[_0x30cdce[_0x25ac99][_0xc0c8('0x76')]],'%s',_0x3f039c):_0x3f039c;_0x3f039c=_0x30cdce[_0x25ac99][_0xc0c8('0x77')]?_[_0xc0c8('0x78')](_0x5764e0[_0x30cdce[_0x25ac99]['format']],'%s',_0x3f039c):_0x3f039c;if(_0x30cdce[_0x25ac99][_0xc0c8('0x79')]){_0x31fee6['group'](_0x3f039c);}_0x30cdce[_0x25ac99][_0xc0c8('0x7a')]&&_0x31fee6['order'](_0x3f039c,_0x30cdce[_0x25ac99][_0xc0c8('0x7a')]==='DESC'?![]:!![]);_0x31fee6[_0xc0c8('0x6a')](_0x3f039c,_0x30cdce[_0x25ac99][_0xc0c8('0x7b')]||_0x3f039c);}if(_0x5a63e1[_0xc0c8('0x7c')]){_0x5a63e1[_0xc0c8('0x7c')]=JSON['parse'](_0x5a63e1[_0xc0c8('0x7c')]);for(var _0x28a1e6=0x0;_0x28a1e6<_0x5a63e1[_0xc0c8('0x7c')]['length'];_0x28a1e6+=0x1){if(_0x5a63e1[_0xc0c8('0x7c')][_0x28a1e6]['type']&&_[_0xc0c8('0x64')](_0x3134d6,_0x5a63e1[_0xc0c8('0x7c')][_0x28a1e6][_0xc0c8('0x2f')])&&_0x5a63e1[_0xc0c8('0x7c')][_0x28a1e6][_0xc0c8('0x7d')]&&_0x5a63e1['joins'][_0x28a1e6][_0xc0c8('0x7e')]&&_0x5a63e1[_0xc0c8('0x7c')][_0x28a1e6][_0xc0c8('0x7f')]){_0x31fee6[_0x5a63e1[_0xc0c8('0x7c')][_0x28a1e6][_0xc0c8('0x2f')]](_0x5a63e1[_0xc0c8('0x7c')][_0x28a1e6][_0xc0c8('0x7e')],null,util[_0xc0c8('0x77')](_0xc0c8('0x80'),_0x5a63e1[_0xc0c8('0x73')],_0x5a63e1[_0xc0c8('0x7c')][_0x28a1e6][_0xc0c8('0x7d')],_0x5a63e1[_0xc0c8('0x7c')][_0x28a1e6]['foreignTable'],_0x5a63e1['joins'][_0x28a1e6][_0xc0c8('0x7f')]));}}}if(_0x5a63e1[_0xc0c8('0x81')]){_0x5a63e1[_0xc0c8('0x81')]=JSON[_0xc0c8('0x82')](_0x5a63e1['conditions']);_0x31fee6[_0xc0c8('0x3f')](_0x458cbb(_0x5a63e1[_0xc0c8('0x81')]['group']));}_0x1dfc51=_0x31fee6[_0xc0c8('0x83')]();_0x31fee6[_0xc0c8('0x3a')](_0x588fc1);_0x31fee6[_0xc0c8('0x1d')](0x0);logger[_0xc0c8('0x84')](_0xc0c8('0x85'),_0x31fee6[_0xc0c8('0x86')]());return dbH['sequelize'][_0xc0c8('0x32')](_0x31fee6[_0xc0c8('0x86')](),{'type':dbH[_0xc0c8('0x87')][_0xc0c8('0x88')][_0xc0c8('0x89')]});}})[_0xc0c8('0x24')](respondWithResult(_0xb84b31,null))[_0xc0c8('0x46')](handleError(_0xb84b31,null));};function runReport(_0xf0ce98,_0x37a265,_0x44b62b){var _0x323b9f=_0x37a265['name'];var _0x4d735e=0xa;var _0x23ec2a=[_0xc0c8('0x56'),_0xc0c8('0x57'),_0xc0c8('0x58'),_0xc0c8('0x59')];var _0x5e0248={'SUM':'SUM(%s)','COUNT':_0xc0c8('0x8a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc0c8('0x5c'),'MIN':_0xc0c8('0x5d'),'AVG':_0xc0c8('0x5e'),'GROUP_CONCAT':_0xc0c8('0x8b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc0c8('0x60')};var _0x1c7cdf={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xc0c8('0x8c'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5ada18=function(_0x15327e){return!_[_0xc0c8('0x64')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xc0c8('0x8d'),'IS\x20NOT\x20EMPTY'],_0x15327e);};var _0x528fdf=function(_0x494acc){if(!_0x494acc||!_0x494acc[_0xc0c8('0x67')]['length']){return'';}for(var _0x1d5dde='(',_0x171502=0x0;_0x171502<_0x494acc[_0xc0c8('0x67')][_0xc0c8('0x37')];_0x171502+=0x1){_0x171502>0x0&&(_0x1d5dde+='\x20'+_0x494acc['operator']+'\x20');_0x1d5dde+=_0x494acc[_0xc0c8('0x67')][_0x171502][_0xc0c8('0x69')]?_0x528fdf(_0x494acc[_0xc0c8('0x67')][_0x171502]['group']):_0x494acc[_0xc0c8('0x67')][_0x171502][_0xc0c8('0x6a')]+'\x20'+_0x494acc[_0xc0c8('0x67')][_0x171502][_0xc0c8('0x6b')]+(_0x5ada18(_0x494acc['rules'][_0x171502][_0xc0c8('0x6b')])?'\x20'+_0x494acc[_0xc0c8('0x67')][_0x171502][_0xc0c8('0x6c')]:'');}return _0x1d5dde+')';};var _0xcfcb5f={'where':{'id':_0xf0ce98['id']}},_0x3d8b01,_0x598e2a,_0x5a249f,_0x641e07,_0x13bfc1;_0xcfcb5f=_['merge']({},_0xcfcb5f,_0x44b62b);return db[_0xc0c8('0x2c')]['find'](_0xcfcb5f)[_0xc0c8('0x24')](function(_0x2eabf3){if(_0x2eabf3){_0x3d8b01=_0x2eabf3;return _0x2eabf3[_0xc0c8('0x6d')]();}return null;})['then'](function(_0x338cb8){if(_0x338cb8){if(!_0x338cb8[_0xc0c8('0x37')]){throw new db['Sequelize'][(_0xc0c8('0x6f'))](_0xc0c8('0x8e'),0x193);}_0x598e2a=_0x338cb8;return db[_0xc0c8('0x70')][_0xc0c8('0x44')]({'raw':!![]});}return null;})[_0xc0c8('0x24')](function(_0x4e0cd2){if(_0x4e0cd2){_0x5a249f=_[_0xc0c8('0x71')](_0x4e0cd2,'id');var _0x4b369d;var _0x255ffa=squel[_0xc0c8('0x72')]();_0x255ffa[_0xc0c8('0x8f')](_0x3d8b01[_0xc0c8('0x73')]);for(var _0x39440c=0x0;_0x39440c<_0x598e2a['length'];_0x39440c+=0x1){_0x4b369d=_0x598e2a[_0x39440c][_0xc0c8('0x74')]?_0x5a249f[_0x598e2a[_0x39440c]['MetricId']][_0xc0c8('0x75')]:_0x598e2a[_0x39440c][_0xc0c8('0x6a')];_0x4b369d=_0x598e2a[_0x39440c]['function']?_[_0xc0c8('0x78')](_0x5e0248[_0x598e2a[_0x39440c][_0xc0c8('0x76')]],'%s',_0x4b369d):_0x4b369d;_0x4b369d=_0x598e2a[_0x39440c][_0xc0c8('0x77')]?_[_0xc0c8('0x78')](_0x1c7cdf[_0x598e2a[_0x39440c][_0xc0c8('0x77')]],'%s',_0x4b369d):_0x4b369d;if(_0x598e2a[_0x39440c][_0xc0c8('0x79')]){_0x255ffa[_0xc0c8('0x69')](_0x4b369d);}_0x598e2a[_0x39440c][_0xc0c8('0x7a')]&&_0x255ffa['order'](_0x4b369d,_0x598e2a[_0x39440c][_0xc0c8('0x7a')]===_0xc0c8('0x90')?![]:!![]);_0x255ffa[_0xc0c8('0x6a')](_0x4b369d,_0x598e2a[_0x39440c][_0xc0c8('0x7b')]||_0x4b369d);}if(_0x3d8b01[_0xc0c8('0x7c')]){_0x3d8b01[_0xc0c8('0x7c')]=JSON[_0xc0c8('0x82')](_0x3d8b01[_0xc0c8('0x7c')]);for(var _0xd9f9b8=0x0;_0xd9f9b8<_0x3d8b01[_0xc0c8('0x7c')][_0xc0c8('0x37')];_0xd9f9b8+=0x1){if(_0x3d8b01[_0xc0c8('0x7c')][_0xd9f9b8][_0xc0c8('0x2f')]&&_[_0xc0c8('0x64')](_0x23ec2a,_0x3d8b01[_0xc0c8('0x7c')][_0xd9f9b8][_0xc0c8('0x2f')])&&_0x3d8b01[_0xc0c8('0x7c')][_0xd9f9b8][_0xc0c8('0x7d')]&&_0x3d8b01[_0xc0c8('0x7c')][_0xd9f9b8][_0xc0c8('0x7e')]&&_0x3d8b01['joins'][_0xd9f9b8][_0xc0c8('0x7f')]){_0x255ffa[_0x3d8b01['joins'][_0xd9f9b8][_0xc0c8('0x2f')]](_0x3d8b01[_0xc0c8('0x7c')][_0xd9f9b8]['foreignTable'],null,util[_0xc0c8('0x77')](_0xc0c8('0x80'),_0x3d8b01[_0xc0c8('0x73')],_0x3d8b01[_0xc0c8('0x7c')][_0xd9f9b8][_0xc0c8('0x7d')],_0x3d8b01[_0xc0c8('0x7c')][_0xd9f9b8]['foreignTable'],_0x3d8b01[_0xc0c8('0x7c')][_0xd9f9b8]['foreignKey']));}}}if(_0x3d8b01[_0xc0c8('0x81')]){_0x3d8b01[_0xc0c8('0x81')]=JSON[_0xc0c8('0x82')](_0x3d8b01['conditions']);_0x255ffa[_0xc0c8('0x3f')](_0x528fdf(_0x3d8b01[_0xc0c8('0x81')][_0xc0c8('0x69')]));}_0x13bfc1=_0x255ffa[_0xc0c8('0x83')]();_0x255ffa['limit'](_0x4d735e);_0x255ffa[_0xc0c8('0x1d')](0x0);return;}})['then'](function(){if(_0x37a265[_0xc0c8('0x91')]==='web'){return null;}var _0x1ae2de=_[_0xc0c8('0x40')](_0x37a265,{'name':_0x37a265[_0xc0c8('0x92')]||_0x37a265['name']||_0x3d8b01[_0xc0c8('0x28')],'basename':_0x323b9f,'savename':util[_0xc0c8('0x77')](_0xc0c8('0x93'),_0x37a265[_0xc0c8('0x28')]||_0x3d8b01['name'],require(_0xc0c8('0x94'))['generate'](0x4),_0x37a265['output']||'csv'),'reportId':_0x3d8b01['id'],'reportType':_0xc0c8('0x95')});return db[_0xc0c8('0x96')]['create'](_0x1ae2de,{'raw':!![]});})[_0xc0c8('0x24')](function(_0xc7a17){if(_0x3d8b01['table']===_0xc0c8('0x97')){_0x13bfc1[_0xc0c8('0x3f')](_0x3d8b01[_0xc0c8('0x73')]+_0xc0c8('0x98'),_0x37a265[_0xc0c8('0x99')],_0x37a265['endDate']);}else{_0x13bfc1[_0xc0c8('0x3f')](_0x3d8b01[_0xc0c8('0x73')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x37a265[_0xc0c8('0x99')],_0x37a265[_0xc0c8('0x9a')]);}if(_0xc7a17){logger[_0xc0c8('0x9b')](_0xc0c8('0x9c'),_0x13bfc1[_0xc0c8('0x86')]());require(_0xc0c8('0x9d'))[_0xc0c8('0x9e')](path[_0xc0c8('0x56')](__dirname,_0xc0c8('0x9f'),_0xc7a17[_0xc0c8('0x91')]),[_0xc7a17['id'],_0x13bfc1[_0xc0c8('0x86')](),path[_0xc0c8('0x56')](__dirname,'../../files/reports',_0xc7a17[_0xc0c8('0xa0')]),_0x323b9f]);return _0xc7a17;}else{var _0x237751=squel[_0xc0c8('0x72')]();_0x237751['from']('('+_0x13bfc1[_0xc0c8('0x86')]()+')',_0xc0c8('0xa1'));_0x237751[_0xc0c8('0x6a')]('COUNT(*)','count');_0x13bfc1[_0xc0c8('0x3a')](_0x37a265[_0xc0c8('0x3a')]||_0x4d735e);_0x13bfc1[_0xc0c8('0x1d')](_0x37a265[_0xc0c8('0x1d')]||0x0);return dbH[_0xc0c8('0x87')][_0xc0c8('0x32')](_0x237751[_0xc0c8('0x86')](),{'type':dbH[_0xc0c8('0x87')]['QueryTypes']['SELECT']})[_0xc0c8('0x24')](function(_0x3b7dfe){if(!_0x3b7dfe[_0xc0c8('0x37')]){_0x641e07=0x0;}else{_0x641e07=_0x3b7dfe[0x0][_0xc0c8('0x1f')]||0x0;}return dbH[_0xc0c8('0x87')][_0xc0c8('0x32')](_0x13bfc1['toString'](),{'type':dbH[_0xc0c8('0x87')]['QueryTypes'][_0xc0c8('0x89')]});})[_0xc0c8('0x24')](function(_0x4ae91d){return{'rows':_0x4ae91d||[],'count':_0x641e07};});}});}exports[_0xc0c8('0xa2')]=function(_0x13a1e1,_0x3e4a60){return runReport(_0x13a1e1[_0xc0c8('0x48')],_0x13a1e1['query'],_0x13a1e1[_0xc0c8('0x42')])[_0xc0c8('0x24')](respondWithResult(_0x3e4a60,null))[_0xc0c8('0x46')](handleError(_0x3e4a60,null));};exports['runReport']=runReport;exports[_0xc0c8('0x32')]=function(_0x49ca5f,_0x35ae6e){var _0x7a29fb=0xa;var _0x97ea9c=['join',_0xc0c8('0x57'),_0xc0c8('0x58'),_0xc0c8('0x59')];var _0x51a65e={'SUM':_0xc0c8('0x5a'),'COUNT':_0xc0c8('0x8a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xc0c8('0x5d'),'AVG':_0xc0c8('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc0c8('0x5f'),'GROUP_CONCAT DESC':_0xc0c8('0x60')};var _0x320005={'SEC_TO_TIME':_0xc0c8('0x61'),'DATE':'DATE(%s)','HOUR':_0xc0c8('0x62'),'ROUND':_0xc0c8('0xa3'),'UNIX_TIMESTAMP':_0xc0c8('0x63')};var _0x265c97=function(_0x39994c){return!_[_0xc0c8('0x64')]([_0xc0c8('0x65'),_0xc0c8('0xa4'),_0xc0c8('0x8d'),_0xc0c8('0x66')],_0x39994c);};var _0x5b442b=function(_0x40ea6b){if(!_0x40ea6b||!_0x40ea6b[_0xc0c8('0x67')]['length']){return'';}for(var _0x17fad8='(',_0x1a0725=0x0;_0x1a0725<_0x40ea6b[_0xc0c8('0x67')][_0xc0c8('0x37')];_0x1a0725+=0x1){_0x1a0725>0x0&&(_0x17fad8+='\x20'+_0x40ea6b[_0xc0c8('0x68')]+'\x20');_0x17fad8+=_0x40ea6b[_0xc0c8('0x67')][_0x1a0725]['group']?_0x5b442b(_0x40ea6b[_0xc0c8('0x67')][_0x1a0725][_0xc0c8('0x69')]):_0x40ea6b[_0xc0c8('0x67')][_0x1a0725][_0xc0c8('0x6a')]+'\x20'+_0x40ea6b[_0xc0c8('0x67')][_0x1a0725][_0xc0c8('0x6b')]+(_0x265c97(_0x40ea6b[_0xc0c8('0x67')][_0x1a0725][_0xc0c8('0x6b')])?'\x20'+_0x40ea6b['rules'][_0x1a0725]['value']:'');}return _0x17fad8+')';};var _0x224480={'where':{'id':_0x49ca5f[_0xc0c8('0x48')]['id']}},_0x34aa2d,_0x2370b0,_0x25dd64,_0x3bcf34,_0x11b2a0;_0x224480=_['merge']({},_0x224480,_0x49ca5f['options']);return db['AnalyticCustomReport'][_0xc0c8('0x4b')](_0x224480)[_0xc0c8('0x24')](function(_0x2f5c16){if(_0x2f5c16){_0x34aa2d=_0x2f5c16;return _0x2f5c16[_0xc0c8('0x6d')]();}return null;})['then'](function(_0x27ad7c){if(_0x27ad7c){if(!_0x27ad7c['length']){throw new db['Sequelize'][(_0xc0c8('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2370b0=_0x27ad7c;return db[_0xc0c8('0x70')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x3ce367){if(_0x3ce367){_0x25dd64=_['keyBy'](_0x3ce367,'id');var _0x10e53c;var _0x2f992f=squel[_0xc0c8('0x72')]();_0x2f992f[_0xc0c8('0x8f')](_0x34aa2d[_0xc0c8('0x73')]);for(var _0x1266b4=0x0;_0x1266b4<_0x2370b0[_0xc0c8('0x37')];_0x1266b4+=0x1){_0x10e53c=_0x2370b0[_0x1266b4][_0xc0c8('0x74')]?_0x25dd64[_0x2370b0[_0x1266b4][_0xc0c8('0x74')]][_0xc0c8('0x75')]:_0x2370b0[_0x1266b4][_0xc0c8('0x6a')];_0x10e53c=_0x2370b0[_0x1266b4][_0xc0c8('0x76')]?_[_0xc0c8('0x78')](_0x51a65e[_0x2370b0[_0x1266b4][_0xc0c8('0x76')]],'%s',_0x10e53c):_0x10e53c;_0x10e53c=_0x2370b0[_0x1266b4]['format']?_[_0xc0c8('0x78')](_0x320005[_0x2370b0[_0x1266b4][_0xc0c8('0x77')]],'%s',_0x10e53c):_0x10e53c;if(_0x2370b0[_0x1266b4][_0xc0c8('0x79')]){_0x2f992f[_0xc0c8('0x69')](_0x10e53c);}_0x2370b0[_0x1266b4][_0xc0c8('0x7a')]&&_0x2f992f[_0xc0c8('0x3b')](_0x10e53c,_0x2370b0[_0x1266b4][_0xc0c8('0x7a')]===_0xc0c8('0x90')?![]:!![]);_0x2f992f[_0xc0c8('0x6a')](_0x10e53c,_0x2370b0[_0x1266b4][_0xc0c8('0x7b')]||_0x10e53c);}if(_0x34aa2d[_0xc0c8('0x7c')]){_0x34aa2d[_0xc0c8('0x7c')]=JSON[_0xc0c8('0x82')](_0x34aa2d[_0xc0c8('0x7c')]);for(var _0x566541=0x0;_0x566541<_0x34aa2d['joins'][_0xc0c8('0x37')];_0x566541+=0x1){if(_0x34aa2d[_0xc0c8('0x7c')][_0x566541]['type']&&_['includes'](_0x97ea9c,_0x34aa2d[_0xc0c8('0x7c')][_0x566541]['type'])&&_0x34aa2d[_0xc0c8('0x7c')][_0x566541][_0xc0c8('0x7d')]&&_0x34aa2d[_0xc0c8('0x7c')][_0x566541][_0xc0c8('0x7e')]&&_0x34aa2d[_0xc0c8('0x7c')][_0x566541]['foreignKey']){_0x2f992f[_0x34aa2d[_0xc0c8('0x7c')][_0x566541][_0xc0c8('0x2f')]](_0x34aa2d[_0xc0c8('0x7c')][_0x566541][_0xc0c8('0x7e')],null,util['format'](_0xc0c8('0x80'),_0x34aa2d['table'],_0x34aa2d[_0xc0c8('0x7c')][_0x566541][_0xc0c8('0x7d')],_0x34aa2d[_0xc0c8('0x7c')][_0x566541][_0xc0c8('0x7e')],_0x34aa2d[_0xc0c8('0x7c')][_0x566541]['foreignKey']));}}}if(_0x34aa2d[_0xc0c8('0x81')]){_0x34aa2d[_0xc0c8('0x81')]=JSON[_0xc0c8('0x82')](_0x34aa2d[_0xc0c8('0x81')]);_0x2f992f[_0xc0c8('0x3f')](_0x5b442b(_0x34aa2d['conditions']['group']));}_0x11b2a0=_0x2f992f[_0xc0c8('0x83')]();_0x2f992f['limit'](_0x7a29fb);_0x2f992f[_0xc0c8('0x1d')](0x0);logger['debug'](_0xc0c8('0x85'),_0x2f992f[_0xc0c8('0x86')]());return dbH[_0xc0c8('0x87')][_0xc0c8('0x32')](_0x2f992f['toString'](),{'type':dbH[_0xc0c8('0x87')][_0xc0c8('0x88')][_0xc0c8('0x89')]});}})[_0xc0c8('0x24')](function(){return{'sql':_0x11b2a0[_0xc0c8('0x86')]()};})[_0xc0c8('0x24')](respondWithResult(_0x35ae6e,null))['catch'](handleError(_0x35ae6e,null));};
\ No newline at end of file
+var _0xe16c=['Content-Range','apply','reject','save','destroy','then','get','UserProfileResource','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','type','filter','options','includeAll','include','AnalyticCustomReport','findAll','rows','show','params','merge','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','MetricId','function','replace','format','groupBy','orderBy','order','joins','parse','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','join','MIN(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','operator','value','ValidationErrorItem','select','from','alias','clone','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','savename','countTable','SELECT','run','runReport','COUNT(%s)','metric','rimraf','zip-dir','request-promise','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set'];(function(_0x13b1d8,_0x10a06f){var _0x3d000b=function(_0x13b070){while(--_0x13b070){_0x13b1d8['push'](_0x13b1d8['shift']());}};_0x3d000b(++_0x10a06f);}(_0xe16c,0x89));var _0xce16=function(_0x66eb90,_0x4d9dcd){_0x66eb90=_0x66eb90-0x0;var _0x593592=_0xe16c[_0x66eb90];return _0x593592;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xce16('0x0'));var zipdir=require(_0xce16('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xce16('0x2'));var moment=require('moment');var BPromise=require(_0xce16('0x3'));var Mustache=require(_0xce16('0x4'));var util=require('util');var path=require(_0xce16('0x5'));var sox=require('sox');var csv=require(_0xce16('0x6'));var ejs=require(_0xce16('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xce16('0x8'));var crypto=require(_0xce16('0x9'));var jsforce=require(_0xce16('0xa'));var deskjs=require(_0xce16('0xb'));var toCsv=require('to-csv');var querystring=require(_0xce16('0xc'));var Papa=require(_0xce16('0xd'));var Redis=require(_0xce16('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xce16('0xf'));var as=require(_0xce16('0x10'));var hardwareService=require(_0xce16('0x11'));var logger=require('../../config/logger')(_0xce16('0x12'));var utils=require(_0xce16('0x13'));var config=require(_0xce16('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xce16('0x15'))['db'];var dbH=require('../../mysqldb')[_0xce16('0x16')];function respondWithStatusCode(_0x217df0,_0x5e8b44){_0x5e8b44=_0x5e8b44||0xcc;return function(_0x4f3dd1){if(_0x4f3dd1){return _0x217df0[_0xce16('0x17')](_0x5e8b44);}return _0x217df0[_0xce16('0x18')](_0x5e8b44)[_0xce16('0x19')]();};}function respondWithResult(_0x3c250e,_0x29b2db){_0x29b2db=_0x29b2db||0xc8;return function(_0x56e0e8){if(_0x56e0e8){return _0x3c250e['status'](_0x29b2db)[_0xce16('0x1a')](_0x56e0e8);}};}function respondWithFilteredResult(_0x12e64a,_0x1e064f){return function(_0x25f7a7){if(_0x25f7a7){var _0x33056e=typeof _0x1e064f[_0xce16('0x1b')]===_0xce16('0x1c')&&typeof _0x1e064f['limit']===_0xce16('0x1c');var _0x45f65e=_0x25f7a7[_0xce16('0x1d')];var _0x388d64=_0x33056e?0x0:_0x1e064f['offset'];var _0xdaa57a=_0x33056e?_0x25f7a7['count']:_0x1e064f[_0xce16('0x1b')]+_0x1e064f[_0xce16('0x1e')];var _0x58bdc8;if(_0xdaa57a>=_0x45f65e){_0xdaa57a=_0x45f65e;_0x58bdc8=0xc8;}else{_0x58bdc8=0xce;}_0x12e64a[_0xce16('0x18')](_0x58bdc8);return _0x12e64a[_0xce16('0x1f')](_0xce16('0x20'),_0x388d64+'-'+_0xdaa57a+'/'+_0x45f65e)[_0xce16('0x1a')](_0x25f7a7);}return null;};}function patchUpdates(_0x426cd2){return function(_0x275b04){try{jsonpatch[_0xce16('0x21')](_0x275b04,_0x426cd2,!![]);}catch(_0x42d383){return BPromise[_0xce16('0x22')](_0x42d383);}return _0x275b04[_0xce16('0x23')]();};}function saveUpdates(_0x35e1b9,_0x458e91){return function(_0x531318){if(_0x531318){return _0x531318['update'](_0x35e1b9)['then'](function(_0x5778f4){return _0x5778f4;});}return null;};}function removeEntity(_0x54454f,_0x377564){return function(_0x3d1bda){if(_0x3d1bda){return _0x3d1bda[_0xce16('0x24')]()[_0xce16('0x25')](function(){var _0x4577d9=_0x3d1bda[_0xce16('0x26')]({'plain':!![]});var _0x324ab5='CustomReports';return db[_0xce16('0x27')][_0xce16('0x24')]({'where':{'type':_0x324ab5,'resourceId':_0x4577d9['id']}})[_0xce16('0x25')](function(){return _0x3d1bda;});})['then'](function(){_0x54454f[_0xce16('0x18')](0xcc)[_0xce16('0x19')]();});}};}function handleEntityNotFound(_0x312c6d,_0x27ac06){return function(_0x3cc4aa){if(!_0x3cc4aa){_0x312c6d[_0xce16('0x17')](0x194);}return _0x3cc4aa;};}function handleError(_0x291f8e,_0x57c19e){_0x57c19e=_0x57c19e||0x1f4;return function(_0x2f8236){logger['error'](_0x2f8236[_0xce16('0x28')]);if(_0x2f8236['name']){delete _0x2f8236[_0xce16('0x29')];}_0x291f8e[_0xce16('0x18')](_0x57c19e)['send'](_0x2f8236);};}exports[_0xce16('0x2a')]=function(_0x2b384d,_0x56f233){var _0x13e45e={},_0x2b65b8={},_0x22b096={'count':0x0,'rows':[]};var _0x1be622=_[_0xce16('0x2b')](db['AnalyticCustomReport'][_0xce16('0x2c')],function(_0x582781){return{'name':_0x582781[_0xce16('0x2d')],'type':_0x582781['type'][_0xce16('0x2e')]};});_0x2b65b8[_0xce16('0x2f')]=_[_0xce16('0x2b')](_0x1be622,_0xce16('0x29'));_0x2b65b8[_0xce16('0x30')]=_[_0xce16('0x31')](_0x2b384d[_0xce16('0x30')]);_0x2b65b8['filters']=_['intersection'](_0x2b65b8['model'],_0x2b65b8[_0xce16('0x30')]);_0x13e45e[_0xce16('0x32')]=_[_0xce16('0x33')](_0x2b65b8[_0xce16('0x2f')],qs[_0xce16('0x34')](_0x2b384d[_0xce16('0x30')][_0xce16('0x34')]));_0x13e45e[_0xce16('0x32')]=_0x13e45e[_0xce16('0x32')][_0xce16('0x35')]?_0x13e45e[_0xce16('0x32')]:_0x2b65b8[_0xce16('0x2f')];if(!_0x2b384d[_0xce16('0x30')][_0xce16('0x36')](_0xce16('0x37'))){_0x13e45e[_0xce16('0x1e')]=qs[_0xce16('0x1e')](_0x2b384d[_0xce16('0x30')]['limit']);_0x13e45e[_0xce16('0x1b')]=qs[_0xce16('0x1b')](_0x2b384d[_0xce16('0x30')][_0xce16('0x1b')]);}_0x13e45e['order']=qs[_0xce16('0x38')](_0x2b384d[_0xce16('0x30')][_0xce16('0x38')]);_0x13e45e[_0xce16('0x39')]=qs[_0xce16('0x3a')](_[_0xce16('0x3b')](_0x2b384d[_0xce16('0x30')],_0x2b65b8[_0xce16('0x3a')]),_0x1be622);if(_0x2b384d['query']['filter']){_0x13e45e[_0xce16('0x39')]=_['merge'](_0x13e45e[_0xce16('0x39')],{'$or':_['map'](_0x1be622,function(_0x3e916c){if(_0x3e916c[_0xce16('0x3c')]!=='VIRTUAL'){var _0x2250bc={};_0x2250bc[_0x3e916c['name']]={'$like':'%'+_0x2b384d[_0xce16('0x30')][_0xce16('0x3d')]+'%'};return _0x2250bc;}})});}_0x13e45e=_['merge']({},_0x13e45e,_0x2b384d[_0xce16('0x3e')]);var _0x304095={'where':_0x13e45e[_0xce16('0x39')]};return db['AnalyticCustomReport'][_0xce16('0x1d')](_0x304095)[_0xce16('0x25')](function(_0x5d220c){_0x22b096[_0xce16('0x1d')]=_0x5d220c;if(_0x2b384d[_0xce16('0x30')][_0xce16('0x3f')]){_0x13e45e[_0xce16('0x40')]=[{'all':!![]}];}return db[_0xce16('0x41')][_0xce16('0x42')](_0x13e45e);})[_0xce16('0x25')](function(_0x588b09){_0x22b096[_0xce16('0x43')]=_0x588b09;return _0x22b096;})['then'](respondWithFilteredResult(_0x56f233,_0x13e45e))['catch'](handleError(_0x56f233,null));};exports[_0xce16('0x44')]=function(_0x3f6574,_0x14b87f){var _0x7f75f={'raw':![],'where':{'id':_0x3f6574[_0xce16('0x45')]['id']}},_0x32b070={};_0x32b070[_0xce16('0x2f')]=_[_0xce16('0x31')](db[_0xce16('0x41')][_0xce16('0x2c')]);_0x32b070[_0xce16('0x30')]=_[_0xce16('0x31')](_0x3f6574[_0xce16('0x30')]);_0x32b070[_0xce16('0x3a')]=_[_0xce16('0x33')](_0x32b070['model'],_0x32b070[_0xce16('0x30')]);_0x7f75f[_0xce16('0x32')]=_[_0xce16('0x33')](_0x32b070[_0xce16('0x2f')],qs[_0xce16('0x34')](_0x3f6574['query'][_0xce16('0x34')]));_0x7f75f['attributes']=_0x7f75f[_0xce16('0x32')][_0xce16('0x35')]?_0x7f75f[_0xce16('0x32')]:_0x32b070[_0xce16('0x2f')];if(_0x3f6574[_0xce16('0x30')][_0xce16('0x3f')]){_0x7f75f['include']=[{'all':!![]}];}_0x7f75f=_[_0xce16('0x46')]({},_0x7f75f,_0x3f6574[_0xce16('0x3e')]);return db[_0xce16('0x41')][_0xce16('0x47')](_0x7f75f)[_0xce16('0x25')](handleEntityNotFound(_0x14b87f,null))['then'](respondWithResult(_0x14b87f,null))[_0xce16('0x48')](handleError(_0x14b87f,null));};exports[_0xce16('0x49')]=function(_0x4753d9,_0x500a35){return db[_0xce16('0x41')][_0xce16('0x49')](_0x4753d9[_0xce16('0x4a')],{})[_0xce16('0x25')](function(_0x5e8408){var _0x19a48c=_0x4753d9[_0xce16('0x4b')][_0xce16('0x26')]({'plain':!![]});if(!_0x19a48c)throw new Error(_0xce16('0x4c'));if(_0x19a48c[_0xce16('0x4d')]==='user'){var _0x4e3edb=_0x5e8408[_0xce16('0x26')]({'plain':!![]});var _0x17e81e=_0xce16('0x4e');return db[_0xce16('0x4f')][_0xce16('0x47')]({'where':{'name':_0x17e81e,'userProfileId':_0x19a48c[_0xce16('0x50')]},'raw':!![]})[_0xce16('0x25')](function(_0x4086ab){if(_0x4086ab&&_0x4086ab[_0xce16('0x51')]===0x0){return db['UserProfileResource'][_0xce16('0x49')]({'name':_0x4e3edb[_0xce16('0x29')],'resourceId':_0x4e3edb['id'],'type':_0xce16('0x52'),'sectionId':_0x4086ab['id']},{})[_0xce16('0x25')](function(){return _0x5e8408;});}else{return _0x5e8408;}})[_0xce16('0x48')](function(_0x59d751){logger[_0xce16('0x53')](_0xce16('0x54'),_0x59d751);throw _0x59d751;});}return _0x5e8408;})['then'](respondWithResult(_0x500a35,0xc9))[_0xce16('0x48')](handleError(_0x500a35,null));};exports[_0xce16('0x55')]=function(_0x284c4c,_0x4cf8ba){if(_0x284c4c[_0xce16('0x4a')]['id']){delete _0x284c4c['body']['id'];}return db[_0xce16('0x41')][_0xce16('0x47')]({'where':{'id':_0x284c4c[_0xce16('0x45')]['id']}})[_0xce16('0x25')](handleEntityNotFound(_0x4cf8ba,null))[_0xce16('0x25')](saveUpdates(_0x284c4c[_0xce16('0x4a')],null))[_0xce16('0x25')](respondWithResult(_0x4cf8ba,null))[_0xce16('0x48')](handleError(_0x4cf8ba,null));};exports[_0xce16('0x24')]=function(_0x1f2b4c,_0x2db024){return db[_0xce16('0x41')][_0xce16('0x47')]({'where':{'id':_0x1f2b4c['params']['id']}})[_0xce16('0x25')](handleEntityNotFound(_0x2db024,null))[_0xce16('0x25')](removeEntity(_0x2db024,null))[_0xce16('0x48')](handleError(_0x2db024,null));};exports[_0xce16('0x56')]=function(_0x9617fd,_0x46369a){var _0x352b1d=0xa;var _0x19322b=['join',_0xce16('0x57'),_0xce16('0x58'),_0xce16('0x59')];var _0x5bc511={'SUM':_0xce16('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xce16('0x5b'),'MAX':_0xce16('0x5c'),'MIN':'MIN(%s)','AVG':_0xce16('0x5d'),'GROUP_CONCAT':_0xce16('0x5e'),'GROUP_CONCAT ASC':_0xce16('0x5f'),'GROUP_CONCAT DESC':_0xce16('0x60')};var _0x4d7ef1={'SEC_TO_TIME':_0xce16('0x61'),'DATE':'DATE(%s)','HOUR':_0xce16('0x62'),'ROUND':_0xce16('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4b8ca2=function(_0xb68433){return!_['includes']([_0xce16('0x64'),_0xce16('0x65'),_0xce16('0x66'),_0xce16('0x67')],_0xb68433);};var _0x5e9cfe=function(_0x5372d1){if(!_0x5372d1||!_0x5372d1[_0xce16('0x68')]['length']){return'';}for(var _0x382744='(',_0x396c00=0x0;_0x396c00<_0x5372d1[_0xce16('0x68')][_0xce16('0x35')];_0x396c00+=0x1){_0x396c00>0x0&&(_0x382744+='\x20'+_0x5372d1['operator']+'\x20');_0x382744+=_0x5372d1[_0xce16('0x68')][_0x396c00][_0xce16('0x69')]?_0x5e9cfe(_0x5372d1[_0xce16('0x68')][_0x396c00]['group']):_0x5372d1['rules'][_0x396c00][_0xce16('0x6a')]+'\x20'+_0x5372d1[_0xce16('0x68')][_0x396c00][_0xce16('0x6b')]+(_0x4b8ca2(_0x5372d1[_0xce16('0x68')][_0x396c00][_0xce16('0x6b')])?'\x20'+_0x5372d1[_0xce16('0x68')][_0x396c00]['value']:'');}return _0x382744+')';};var _0x13d828={'where':{'id':_0x9617fd[_0xce16('0x45')]['id']}},_0x33951b,_0xbcdd0c,_0x11a1b7,_0x66d52b,_0x5ba2ef;_0x13d828=_['merge']({},_0x13d828,_0x9617fd[_0xce16('0x3e')]);return db[_0xce16('0x41')]['find'](_0x13d828)['then'](function(_0x4ce7b6){if(_0x4ce7b6){_0x33951b=_0x4ce7b6;return _0x4ce7b6[_0xce16('0x6c')]();}return null;})['then'](function(_0x1325c7){if(_0x1325c7){if(!_0x1325c7[_0xce16('0x35')]){throw new db[(_0xce16('0x6d'))]['ValidationErrorItem'](_0xce16('0x6e'),0x193);}_0xbcdd0c=_0x1325c7;return db[_0xce16('0x6f')][_0xce16('0x42')]({'raw':!![]});}return null;})[_0xce16('0x25')](function(_0x26a06e){if(_0x26a06e){_0x11a1b7=_[_0xce16('0x70')](_0x26a06e,'id');var _0x4bd519;var _0x1ebef8=squel['select']();_0x1ebef8['from'](_0x33951b['table']);for(var _0x8e5ebc=0x0;_0x8e5ebc<_0xbcdd0c['length'];_0x8e5ebc+=0x1){_0x4bd519=_0xbcdd0c[_0x8e5ebc][_0xce16('0x71')]?_0x11a1b7[_0xbcdd0c[_0x8e5ebc][_0xce16('0x71')]]['metric']:_0xbcdd0c[_0x8e5ebc][_0xce16('0x6a')];_0x4bd519=_0xbcdd0c[_0x8e5ebc][_0xce16('0x72')]?_[_0xce16('0x73')](_0x5bc511[_0xbcdd0c[_0x8e5ebc][_0xce16('0x72')]],'%s',_0x4bd519):_0x4bd519;_0x4bd519=_0xbcdd0c[_0x8e5ebc]['format']?_[_0xce16('0x73')](_0x4d7ef1[_0xbcdd0c[_0x8e5ebc][_0xce16('0x74')]],'%s',_0x4bd519):_0x4bd519;if(_0xbcdd0c[_0x8e5ebc][_0xce16('0x75')]){_0x1ebef8[_0xce16('0x69')](_0x4bd519);}_0xbcdd0c[_0x8e5ebc][_0xce16('0x76')]&&_0x1ebef8[_0xce16('0x77')](_0x4bd519,_0xbcdd0c[_0x8e5ebc][_0xce16('0x76')]==='DESC'?![]:!![]);_0x1ebef8[_0xce16('0x6a')](_0x4bd519,_0xbcdd0c[_0x8e5ebc]['alias']||_0x4bd519);}if(_0x33951b[_0xce16('0x78')]){_0x33951b['joins']=JSON[_0xce16('0x79')](_0x33951b[_0xce16('0x78')]);for(var _0x3666ab=0x0;_0x3666ab<_0x33951b[_0xce16('0x78')]['length'];_0x3666ab+=0x1){if(_0x33951b['joins'][_0x3666ab]['type']&&_[_0xce16('0x7a')](_0x19322b,_0x33951b['joins'][_0x3666ab][_0xce16('0x3c')])&&_0x33951b[_0xce16('0x78')][_0x3666ab][_0xce16('0x7b')]&&_0x33951b[_0xce16('0x78')][_0x3666ab][_0xce16('0x7c')]&&_0x33951b['joins'][_0x3666ab][_0xce16('0x7d')]){_0x1ebef8[_0x33951b[_0xce16('0x78')][_0x3666ab][_0xce16('0x3c')]](_0x33951b[_0xce16('0x78')][_0x3666ab][_0xce16('0x7c')],null,util[_0xce16('0x74')](_0xce16('0x7e'),_0x33951b[_0xce16('0x7f')],_0x33951b[_0xce16('0x78')][_0x3666ab]['parentKey'],_0x33951b['joins'][_0x3666ab][_0xce16('0x7c')],_0x33951b[_0xce16('0x78')][_0x3666ab][_0xce16('0x7d')]));}}}if(_0x33951b['conditions']){_0x33951b[_0xce16('0x80')]=JSON[_0xce16('0x79')](_0x33951b[_0xce16('0x80')]);_0x1ebef8[_0xce16('0x39')](_0x5e9cfe(_0x33951b[_0xce16('0x80')]['group']));}_0x5ba2ef=_0x1ebef8['clone']();_0x1ebef8['limit'](_0x352b1d);_0x1ebef8[_0xce16('0x1b')](0x0);logger[_0xce16('0x81')](_0xce16('0x82'),_0x1ebef8[_0xce16('0x83')]());return dbH[_0xce16('0x84')][_0xce16('0x30')](_0x1ebef8['toString'](),{'type':dbH[_0xce16('0x84')][_0xce16('0x85')]['SELECT']});}})[_0xce16('0x25')](respondWithResult(_0x46369a,null))[_0xce16('0x48')](handleError(_0x46369a,null));};function runReport(_0x1e1865,_0x106327,_0x50ed40){var _0x4844f9=_0x106327[_0xce16('0x29')];var _0x23c20f=0xa;var _0x499e88=[_0xce16('0x86'),'left_join',_0xce16('0x58'),_0xce16('0x59')];var _0x4c345d={'SUM':_0xce16('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xce16('0x5b'),'MAX':_0xce16('0x5c'),'MIN':_0xce16('0x87'),'AVG':_0xce16('0x5d'),'GROUP_CONCAT':_0xce16('0x5e'),'GROUP_CONCAT ASC':_0xce16('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4e506b={'SEC_TO_TIME':_0xce16('0x61'),'DATE':_0xce16('0x88'),'HOUR':_0xce16('0x62'),'ROUND':_0xce16('0x63'),'UNIX_TIMESTAMP':_0xce16('0x89')};var _0x5b9096=function(_0x1e9703){return!_[_0xce16('0x7a')]([_0xce16('0x64'),_0xce16('0x65'),_0xce16('0x66'),'IS\x20NOT\x20EMPTY'],_0x1e9703);};var _0x2dcadd=function(_0x2f84ae){if(!_0x2f84ae||!_0x2f84ae['rules'][_0xce16('0x35')]){return'';}for(var _0x46807a='(',_0x3400f8=0x0;_0x3400f8<_0x2f84ae[_0xce16('0x68')][_0xce16('0x35')];_0x3400f8+=0x1){_0x3400f8>0x0&&(_0x46807a+='\x20'+_0x2f84ae[_0xce16('0x8a')]+'\x20');_0x46807a+=_0x2f84ae[_0xce16('0x68')][_0x3400f8][_0xce16('0x69')]?_0x2dcadd(_0x2f84ae['rules'][_0x3400f8][_0xce16('0x69')]):_0x2f84ae['rules'][_0x3400f8][_0xce16('0x6a')]+'\x20'+_0x2f84ae[_0xce16('0x68')][_0x3400f8][_0xce16('0x6b')]+(_0x5b9096(_0x2f84ae['rules'][_0x3400f8][_0xce16('0x6b')])?'\x20'+_0x2f84ae[_0xce16('0x68')][_0x3400f8][_0xce16('0x8b')]:'');}return _0x46807a+')';};var _0x3b49d3={'where':{'id':_0x1e1865['id']}},_0x445a6b,_0xa961f0,_0x3c79e0,_0x1052a9,_0x1a0ac6;_0x3b49d3=_['merge']({},_0x3b49d3,_0x50ed40);return db[_0xce16('0x41')][_0xce16('0x47')](_0x3b49d3)[_0xce16('0x25')](function(_0x31942f){if(_0x31942f){_0x445a6b=_0x31942f;return _0x31942f[_0xce16('0x6c')]();}return null;})['then'](function(_0x12f3c7){if(_0x12f3c7){if(!_0x12f3c7[_0xce16('0x35')]){throw new db[(_0xce16('0x6d'))][(_0xce16('0x8c'))](_0xce16('0x6e'),0x193);}_0xa961f0=_0x12f3c7;return db['AnalyticMetric'][_0xce16('0x42')]({'raw':!![]});}return null;})[_0xce16('0x25')](function(_0x5ed22b){if(_0x5ed22b){_0x3c79e0=_[_0xce16('0x70')](_0x5ed22b,'id');var _0x11acc3;var _0xfa3426=squel[_0xce16('0x8d')]();_0xfa3426[_0xce16('0x8e')](_0x445a6b[_0xce16('0x7f')]);for(var _0xf51611=0x0;_0xf51611<_0xa961f0[_0xce16('0x35')];_0xf51611+=0x1){_0x11acc3=_0xa961f0[_0xf51611]['MetricId']?_0x3c79e0[_0xa961f0[_0xf51611][_0xce16('0x71')]]['metric']:_0xa961f0[_0xf51611][_0xce16('0x6a')];_0x11acc3=_0xa961f0[_0xf51611][_0xce16('0x72')]?_[_0xce16('0x73')](_0x4c345d[_0xa961f0[_0xf51611]['function']],'%s',_0x11acc3):_0x11acc3;_0x11acc3=_0xa961f0[_0xf51611][_0xce16('0x74')]?_['replace'](_0x4e506b[_0xa961f0[_0xf51611]['format']],'%s',_0x11acc3):_0x11acc3;if(_0xa961f0[_0xf51611]['groupBy']){_0xfa3426[_0xce16('0x69')](_0x11acc3);}_0xa961f0[_0xf51611][_0xce16('0x76')]&&_0xfa3426[_0xce16('0x77')](_0x11acc3,_0xa961f0[_0xf51611][_0xce16('0x76')]==='DESC'?![]:!![]);_0xfa3426[_0xce16('0x6a')](_0x11acc3,_0xa961f0[_0xf51611][_0xce16('0x8f')]||_0x11acc3);}if(_0x445a6b[_0xce16('0x78')]){_0x445a6b['joins']=JSON['parse'](_0x445a6b[_0xce16('0x78')]);for(var _0x15511d=0x0;_0x15511d<_0x445a6b[_0xce16('0x78')][_0xce16('0x35')];_0x15511d+=0x1){if(_0x445a6b[_0xce16('0x78')][_0x15511d][_0xce16('0x3c')]&&_[_0xce16('0x7a')](_0x499e88,_0x445a6b[_0xce16('0x78')][_0x15511d][_0xce16('0x3c')])&&_0x445a6b[_0xce16('0x78')][_0x15511d][_0xce16('0x7b')]&&_0x445a6b[_0xce16('0x78')][_0x15511d][_0xce16('0x7c')]&&_0x445a6b[_0xce16('0x78')][_0x15511d][_0xce16('0x7d')]){_0xfa3426[_0x445a6b['joins'][_0x15511d][_0xce16('0x3c')]](_0x445a6b[_0xce16('0x78')][_0x15511d]['foreignTable'],null,util[_0xce16('0x74')](_0xce16('0x7e'),_0x445a6b[_0xce16('0x7f')],_0x445a6b['joins'][_0x15511d][_0xce16('0x7b')],_0x445a6b[_0xce16('0x78')][_0x15511d][_0xce16('0x7c')],_0x445a6b[_0xce16('0x78')][_0x15511d]['foreignKey']));}}}if(_0x445a6b['conditions']){_0x445a6b[_0xce16('0x80')]=JSON[_0xce16('0x79')](_0x445a6b['conditions']);_0xfa3426[_0xce16('0x39')](_0x2dcadd(_0x445a6b['conditions'][_0xce16('0x69')]));}_0x1a0ac6=_0xfa3426[_0xce16('0x90')]();_0xfa3426['limit'](_0x23c20f);_0xfa3426['offset'](0x0);return;}})['then'](function(){if(_0x106327['output']===_0xce16('0x91')){return null;}var _0x117816=_[_0xce16('0x46')](_0x106327,{'name':_0x106327[_0xce16('0x92')]||_0x106327['name']||_0x445a6b[_0xce16('0x29')],'basename':_0x4844f9,'savename':util['format'](_0xce16('0x93'),_0x106327[_0xce16('0x29')]||_0x445a6b['name'],require(_0xce16('0x94'))[_0xce16('0x95')](0x4),_0x106327[_0xce16('0x96')]||_0xce16('0x97')),'reportId':_0x445a6b['id'],'reportType':'custom'});return db[_0xce16('0x98')][_0xce16('0x49')](_0x117816,{'raw':!![]});})[_0xce16('0x25')](function(_0x4722b9){if(_0x445a6b[_0xce16('0x7f')]===_0xce16('0x99')){_0x1a0ac6[_0xce16('0x39')](_0x445a6b[_0xce16('0x7f')]+_0xce16('0x9a'),_0x106327[_0xce16('0x9b')],_0x106327[_0xce16('0x9c')]);}else{_0x1a0ac6[_0xce16('0x39')](_0x445a6b[_0xce16('0x7f')]+_0xce16('0x9d'),_0x106327[_0xce16('0x9b')],_0x106327[_0xce16('0x9c')]);}if(_0x4722b9){logger[_0xce16('0x9e')](_0xce16('0x9f'),_0x1a0ac6[_0xce16('0x83')]());require(_0xce16('0xa0'))[_0xce16('0xa1')](path['join'](__dirname,'../../components/export/',_0x4722b9[_0xce16('0x96')]),[_0x4722b9['id'],_0x1a0ac6[_0xce16('0x83')](),path[_0xce16('0x86')](__dirname,'../../files/reports',_0x4722b9[_0xce16('0xa2')]),_0x4844f9]);return _0x4722b9;}else{var _0x5ae125=squel[_0xce16('0x8d')]();_0x5ae125[_0xce16('0x8e')]('('+_0x1a0ac6[_0xce16('0x83')]()+')',_0xce16('0xa3'));_0x5ae125[_0xce16('0x6a')]('COUNT(*)','count');_0x1a0ac6[_0xce16('0x1e')](_0x106327[_0xce16('0x1e')]||_0x23c20f);_0x1a0ac6[_0xce16('0x1b')](_0x106327[_0xce16('0x1b')]||0x0);return dbH[_0xce16('0x84')][_0xce16('0x30')](_0x5ae125[_0xce16('0x83')](),{'type':dbH[_0xce16('0x84')][_0xce16('0x85')][_0xce16('0xa4')]})['then'](function(_0x520de0){if(!_0x520de0['length']){_0x1052a9=0x0;}else{_0x1052a9=_0x520de0[0x0]['count']||0x0;}return dbH['sequelize'][_0xce16('0x30')](_0x1a0ac6[_0xce16('0x83')](),{'type':dbH['sequelize'][_0xce16('0x85')]['SELECT']});})['then'](function(_0xa2fc7a){return{'rows':_0xa2fc7a||[],'count':_0x1052a9};});}});}exports[_0xce16('0xa5')]=function(_0x6dd44f,_0x8fc98e){return runReport(_0x6dd44f[_0xce16('0x45')],_0x6dd44f['query'],_0x6dd44f[_0xce16('0x3e')])[_0xce16('0x25')](respondWithResult(_0x8fc98e,null))[_0xce16('0x48')](handleError(_0x8fc98e,null));};exports[_0xce16('0xa6')]=runReport;exports['query']=function(_0x5a81ad,_0x33ac99){var _0x478714=0xa;var _0x4672fe=[_0xce16('0x86'),_0xce16('0x57'),_0xce16('0x58'),_0xce16('0x59')];var _0x13a6e3={'SUM':_0xce16('0x5a'),'COUNT':_0xce16('0xa7'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xce16('0x5c'),'MIN':_0xce16('0x87'),'AVG':_0xce16('0x5d'),'GROUP_CONCAT':_0xce16('0x5e'),'GROUP_CONCAT ASC':_0xce16('0x5f'),'GROUP_CONCAT DESC':_0xce16('0x60')};var _0x16196b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xce16('0x62'),'ROUND':_0xce16('0x63'),'UNIX_TIMESTAMP':_0xce16('0x89')};var _0x305baf=function(_0x1c4b49){return!_[_0xce16('0x7a')]([_0xce16('0x64'),_0xce16('0x65'),_0xce16('0x66'),_0xce16('0x67')],_0x1c4b49);};var _0x7352d6=function(_0x1c2228){if(!_0x1c2228||!_0x1c2228[_0xce16('0x68')][_0xce16('0x35')]){return'';}for(var _0x8737c6='(',_0x5c502d=0x0;_0x5c502d<_0x1c2228[_0xce16('0x68')][_0xce16('0x35')];_0x5c502d+=0x1){_0x5c502d>0x0&&(_0x8737c6+='\x20'+_0x1c2228[_0xce16('0x8a')]+'\x20');_0x8737c6+=_0x1c2228[_0xce16('0x68')][_0x5c502d]['group']?_0x7352d6(_0x1c2228[_0xce16('0x68')][_0x5c502d]['group']):_0x1c2228[_0xce16('0x68')][_0x5c502d]['field']+'\x20'+_0x1c2228[_0xce16('0x68')][_0x5c502d][_0xce16('0x6b')]+(_0x305baf(_0x1c2228['rules'][_0x5c502d][_0xce16('0x6b')])?'\x20'+_0x1c2228[_0xce16('0x68')][_0x5c502d][_0xce16('0x8b')]:'');}return _0x8737c6+')';};var _0x17bd1c={'where':{'id':_0x5a81ad[_0xce16('0x45')]['id']}},_0x159b47,_0x21731a,_0x49196,_0x43eec5,_0x45b1f6;_0x17bd1c=_['merge']({},_0x17bd1c,_0x5a81ad[_0xce16('0x3e')]);return db[_0xce16('0x41')][_0xce16('0x47')](_0x17bd1c)[_0xce16('0x25')](function(_0x3a5488){if(_0x3a5488){_0x159b47=_0x3a5488;return _0x3a5488[_0xce16('0x6c')]();}return null;})[_0xce16('0x25')](function(_0x111e04){if(_0x111e04){if(!_0x111e04['length']){throw new db['Sequelize'][(_0xce16('0x8c'))](_0xce16('0x6e'),0x193);}_0x21731a=_0x111e04;return db['AnalyticMetric'][_0xce16('0x42')]({'raw':!![]});}return null;})[_0xce16('0x25')](function(_0xe28015){if(_0xe28015){_0x49196=_['keyBy'](_0xe28015,'id');var _0x23a2da;var _0x26c20a=squel[_0xce16('0x8d')]();_0x26c20a[_0xce16('0x8e')](_0x159b47[_0xce16('0x7f')]);for(var _0x50df2a=0x0;_0x50df2a<_0x21731a[_0xce16('0x35')];_0x50df2a+=0x1){_0x23a2da=_0x21731a[_0x50df2a]['MetricId']?_0x49196[_0x21731a[_0x50df2a][_0xce16('0x71')]][_0xce16('0xa8')]:_0x21731a[_0x50df2a][_0xce16('0x6a')];_0x23a2da=_0x21731a[_0x50df2a][_0xce16('0x72')]?_[_0xce16('0x73')](_0x13a6e3[_0x21731a[_0x50df2a][_0xce16('0x72')]],'%s',_0x23a2da):_0x23a2da;_0x23a2da=_0x21731a[_0x50df2a][_0xce16('0x74')]?_['replace'](_0x16196b[_0x21731a[_0x50df2a][_0xce16('0x74')]],'%s',_0x23a2da):_0x23a2da;if(_0x21731a[_0x50df2a]['groupBy']){_0x26c20a[_0xce16('0x69')](_0x23a2da);}_0x21731a[_0x50df2a][_0xce16('0x76')]&&_0x26c20a['order'](_0x23a2da,_0x21731a[_0x50df2a][_0xce16('0x76')]==='DESC'?![]:!![]);_0x26c20a[_0xce16('0x6a')](_0x23a2da,_0x21731a[_0x50df2a][_0xce16('0x8f')]||_0x23a2da);}if(_0x159b47[_0xce16('0x78')]){_0x159b47[_0xce16('0x78')]=JSON['parse'](_0x159b47[_0xce16('0x78')]);for(var _0x5914c3=0x0;_0x5914c3<_0x159b47[_0xce16('0x78')][_0xce16('0x35')];_0x5914c3+=0x1){if(_0x159b47['joins'][_0x5914c3][_0xce16('0x3c')]&&_[_0xce16('0x7a')](_0x4672fe,_0x159b47[_0xce16('0x78')][_0x5914c3][_0xce16('0x3c')])&&_0x159b47['joins'][_0x5914c3]['parentKey']&&_0x159b47['joins'][_0x5914c3][_0xce16('0x7c')]&&_0x159b47[_0xce16('0x78')][_0x5914c3]['foreignKey']){_0x26c20a[_0x159b47[_0xce16('0x78')][_0x5914c3]['type']](_0x159b47[_0xce16('0x78')][_0x5914c3]['foreignTable'],null,util[_0xce16('0x74')](_0xce16('0x7e'),_0x159b47[_0xce16('0x7f')],_0x159b47[_0xce16('0x78')][_0x5914c3][_0xce16('0x7b')],_0x159b47[_0xce16('0x78')][_0x5914c3][_0xce16('0x7c')],_0x159b47[_0xce16('0x78')][_0x5914c3][_0xce16('0x7d')]));}}}if(_0x159b47[_0xce16('0x80')]){_0x159b47[_0xce16('0x80')]=JSON[_0xce16('0x79')](_0x159b47['conditions']);_0x26c20a[_0xce16('0x39')](_0x7352d6(_0x159b47[_0xce16('0x80')]['group']));}_0x45b1f6=_0x26c20a[_0xce16('0x90')]();_0x26c20a['limit'](_0x478714);_0x26c20a[_0xce16('0x1b')](0x0);logger[_0xce16('0x81')]('Limited\x20Query:',_0x26c20a[_0xce16('0x83')]());return dbH[_0xce16('0x84')]['query'](_0x26c20a[_0xce16('0x83')](),{'type':dbH['sequelize'][_0xce16('0x85')][_0xce16('0xa4')]});}})['then'](function(){return{'sql':_0x45b1f6[_0xce16('0x83')]()};})[_0xce16('0x25')](respondWithResult(_0x33ac99,null))['catch'](handleError(_0x33ac99,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index a754cda..fe4dfa2 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 _0x7e74=['rimraf','../../config/environment','exports','define','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1cb41c,_0x4fbffe){var _0x41ea58=function(_0x2ce1aa){while(--_0x2ce1aa){_0x1cb41c['push'](_0x1cb41c['shift']());}};_0x41ea58(++_0x4fbffe);}(_0x7e74,0x165));var _0x47e7=function(_0x41ea3a,_0x3139aa){_0x41ea3a=_0x41ea3a-0x0;var _0x55ebf1=_0x7e74[_0x41ea3a];return _0x55ebf1;};'use strict';var _=require('lodash');var util=require(_0x47e7('0x0'));var logger=require(_0x47e7('0x1'))(_0x47e7('0x2'));var moment=require(_0x47e7('0x3'));var BPromise=require(_0x47e7('0x4'));var rp=require(_0x47e7('0x5'));var fs=require('fs');var path=require(_0x47e7('0x6'));var rimraf=require(_0x47e7('0x7'));var config=require(_0x47e7('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0x47e7('0x9')]=function(_0x267e1f,_0x48eb13){return _0x267e1f[_0x47e7('0xa')](_0x47e7('0xb'),attributes,{'tableName':_0x47e7('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcf61=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','analytics_custom_reports','lodash','util','../../config/logger','api','moment'];(function(_0x2514b4,_0x219880){var _0x4bcaa5=function(_0x6d2472){while(--_0x6d2472){_0x2514b4['push'](_0x2514b4['shift']());}};_0x4bcaa5(++_0x219880);}(_0xcf61,0x157));var _0x1cf6=function(_0x247e29,_0x540032){_0x247e29=_0x247e29-0x0;var _0x5ec66e=_0xcf61[_0x247e29];return _0x5ec66e;};'use strict';var _=require(_0x1cf6('0x0'));var util=require(_0x1cf6('0x1'));var logger=require(_0x1cf6('0x2'))(_0x1cf6('0x3'));var moment=require(_0x1cf6('0x4'));var BPromise=require(_0x1cf6('0x5'));var rp=require(_0x1cf6('0x6'));var fs=require('fs');var path=require(_0x1cf6('0x7'));var rimraf=require(_0x1cf6('0x8'));var config=require(_0x1cf6('0x9'));var attributes=require(_0x1cf6('0xa'));module['exports']=function(_0xd35121,_0x311844){return _0xd35121['define']('AnalyticCustomReport',attributes,{'tableName':_0x1cf6('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 d6c0012..299a379 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 _0xb1e5=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x1be767,_0x1386e0){var _0x45124e=function(_0x49f8da){while(--_0x49f8da){_0x1be767['push'](_0x1be767['shift']());}};_0x45124e(++_0x1386e0);}(_0xb1e5,0xcb));var _0x5b1e=function(_0x507245,_0x3d87ed){_0x507245=_0x507245-0x0;var _0x39a50e=_0xb1e5[_0x507245];return _0x39a50e;};'use strict';var _=require(_0x5b1e('0x0'));var util=require(_0x5b1e('0x1'));var moment=require('moment');var BPromise=require(_0x5b1e('0x2'));var rs=require(_0x5b1e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b1e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5b1e('0x5'))(_0x5b1e('0x6'));var config=require(_0x5b1e('0x7'));var jayson=require(_0x5b1e('0x8'));var client=jayson['client'][_0x5b1e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b7661,_0x19fb90,_0x4316a0){return new BPromise(function(_0x3152a9,_0x15edc8){return client[_0x5b1e('0xa')](_0x3b7661,_0x4316a0)[_0x5b1e('0xb')](function(_0x16efd0){logger[_0x5b1e('0xc')](_0x5b1e('0xd'),_0x19fb90,_0x5b1e('0xe'));logger[_0x5b1e('0xf')](_0x5b1e('0x10'),_0x19fb90,_0x5b1e('0xe'),JSON[_0x5b1e('0x11')](_0x16efd0));if(_0x16efd0[_0x5b1e('0x12')]){if(_0x16efd0['error'][_0x5b1e('0x13')]===0x1f4){logger[_0x5b1e('0x12')](_0x5b1e('0xd'),_0x19fb90,_0x16efd0[_0x5b1e('0x12')][_0x5b1e('0x14')]);return _0x15edc8(_0x16efd0[_0x5b1e('0x12')][_0x5b1e('0x14')]);}logger[_0x5b1e('0x12')](_0x5b1e('0xd'),_0x19fb90,_0x16efd0[_0x5b1e('0x12')][_0x5b1e('0x14')]);return _0x3152a9(_0x16efd0[_0x5b1e('0x12')]['message']);}else{logger[_0x5b1e('0xc')](_0x5b1e('0xd'),_0x19fb90,_0x5b1e('0xe'));_0x3152a9(_0x16efd0[_0x5b1e('0x15')][_0x5b1e('0x14')]);}})[_0x5b1e('0x16')](function(_0x17cb68){logger[_0x5b1e('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x19fb90,_0x17cb68);_0x15edc8(_0x17cb68);});});}
\ No newline at end of file
+var _0x04bc=['catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x4bb956,_0x33236b){var _0x4099a3=function(_0x37f993){while(--_0x37f993){_0x4bb956['push'](_0x4bb956['shift']());}};_0x4099a3(++_0x33236b);}(_0x04bc,0x1ba));var _0xc04b=function(_0x3cf8f1,_0x574345){_0x3cf8f1=_0x3cf8f1-0x0;var _0x1e8db8=_0x04bc[_0x3cf8f1];return _0x1e8db8;};'use strict';var _=require('lodash');var util=require(_0xc04b('0x0'));var moment=require('moment');var BPromise=require(_0xc04b('0x1'));var rs=require(_0xc04b('0x2'));var fs=require('fs');var Redis=require(_0xc04b('0x3'));var db=require(_0xc04b('0x4'))['db'];var utils=require(_0xc04b('0x5'));var logger=require(_0xc04b('0x6'))('rpc');var config=require(_0xc04b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc04b('0x8')][_0xc04b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e0063,_0x4c4963,_0x46d200){return new BPromise(function(_0x486774,_0x4dc2d8){return client['request'](_0x4e0063,_0x46d200)[_0xc04b('0xa')](function(_0x1abb0f){logger[_0xc04b('0xb')](_0xc04b('0xc'),_0x4c4963,_0xc04b('0xd'));logger[_0xc04b('0xe')](_0xc04b('0xf'),_0x4c4963,_0xc04b('0xd'),JSON[_0xc04b('0x10')](_0x1abb0f));if(_0x1abb0f[_0xc04b('0x11')]){if(_0x1abb0f[_0xc04b('0x11')]['code']===0x1f4){logger['error'](_0xc04b('0xc'),_0x4c4963,_0x1abb0f[_0xc04b('0x11')]['message']);return _0x4dc2d8(_0x1abb0f[_0xc04b('0x11')][_0xc04b('0x12')]);}logger[_0xc04b('0x11')](_0xc04b('0xc'),_0x4c4963,_0x1abb0f['error']['message']);return _0x486774(_0x1abb0f['error'][_0xc04b('0x12')]);}else{logger[_0xc04b('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4c4963,_0xc04b('0xd'));_0x486774(_0x1abb0f[_0xc04b('0x13')]['message']);}})[_0xc04b('0x14')](function(_0x469557){logger[_0xc04b('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4c4963,_0x469557);_0x4dc2d8(_0x469557);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 6e5e28d..e751e5d 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 _0xa01a=['/:id/query','query','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run'];(function(_0x15e961,_0x27e7f4){var _0x1b8be3=function(_0x3434d0){while(--_0x3434d0){_0x15e961['push'](_0x15e961['shift']());}};_0x1b8be3(++_0x27e7f4);}(_0xa01a,0x166));var _0xaa01=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xa01a[_0x273c39];return _0x46d6b5;};'use strict';var multer=require('multer');var util=require(_0xaa01('0x0'));var path=require(_0xaa01('0x1'));var timeout=require(_0xaa01('0x2'));var express=require(_0xaa01('0x3'));var router=express['Router']();var fs_extra=require(_0xaa01('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xaa01('0x5'));var config=require(_0xaa01('0x6'));var controller=require('./analyticCustomReport.controller');router[_0xaa01('0x7')]('/',auth['isAuthenticated'](),controller[_0xaa01('0x8')]);router['get'](_0xaa01('0x9'),auth[_0xaa01('0xa')](),controller[_0xaa01('0xb')]);router[_0xaa01('0x7')](_0xaa01('0xc'),auth[_0xaa01('0xa')](),controller[_0xaa01('0xd')]);router[_0xaa01('0x7')](_0xaa01('0xe'),auth['isAuthenticated'](),controller[_0xaa01('0xf')]);router[_0xaa01('0x7')](_0xaa01('0x10'),auth['isAuthenticated'](),controller[_0xaa01('0x11')]);router['post']('/',auth[_0xaa01('0xa')](),controller['create']);router['put'](_0xaa01('0x9'),auth['isAuthenticated'](),controller[_0xaa01('0x12')]);router[_0xaa01('0x13')](_0xaa01('0x9'),auth['isAuthenticated'](),controller[_0xaa01('0x14')]);module[_0xaa01('0x15')]=router;
\ No newline at end of file
+var _0xaedd=['fs-extra','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','show','/:id/run','run','/:id/query','create','put','update','delete','/:id','multer','util','Router'];(function(_0xd158dc,_0x128608){var _0x12d25f=function(_0x2e9d2b){while(--_0x2e9d2b){_0xd158dc['push'](_0xd158dc['shift']());}};_0x12d25f(++_0x128608);}(_0xaedd,0x96));var _0xdaed=function(_0xbc90d4,_0x568e8a){_0xbc90d4=_0xbc90d4-0x0;var _0x4e0548=_0xaedd[_0xbc90d4];return _0x4e0548;};'use strict';var multer=require(_0xdaed('0x0'));var util=require(_0xdaed('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdaed('0x2')]();var fs_extra=require(_0xdaed('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xdaed('0x4'));var config=require('../../config/environment');var controller=require(_0xdaed('0x5'));router[_0xdaed('0x6')]('/',auth[_0xdaed('0x7')](),controller['index']);router[_0xdaed('0x6')]('/:id',auth[_0xdaed('0x7')](),controller[_0xdaed('0x8')]);router['get']('/:id/preview',auth['isAuthenticated'](),controller['preview']);router[_0xdaed('0x6')](_0xdaed('0x9'),auth[_0xdaed('0x7')](),controller[_0xdaed('0xa')]);router['get'](_0xdaed('0xb'),auth[_0xdaed('0x7')](),controller['query']);router['post']('/',auth[_0xdaed('0x7')](),controller[_0xdaed('0xc')]);router[_0xdaed('0xd')]('/:id',auth[_0xdaed('0x7')](),controller[_0xdaed('0xe')]);router[_0xdaed('0xf')](_0xdaed('0x10'),auth[_0xdaed('0x7')](),controller['destroy']);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 451c053..d6abcd2 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 _0x326f=['STRING','TEXT','sequelize'];(function(_0x16462,_0x37c6d0){var _0x308bf3=function(_0x118202){while(--_0x118202){_0x16462['push'](_0x16462['shift']());}};_0x308bf3(++_0x37c6d0);}(_0x326f,0xd1));var _0xf326=function(_0x1101f0,_0x48c216){_0x1101f0=_0x1101f0-0x0;var _0x30acf2=_0x326f[_0x1101f0];return _0x30acf2;};'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
+var _0xf494=['STRING','TEXT','sequelize','exports'];(function(_0x4eee80,_0x4a0b9a){var _0x10d6f0=function(_0x1ac511){while(--_0x1ac511){_0x4eee80['push'](_0x4eee80['shift']());}};_0x10d6f0(++_0x4a0b9a);}(_0xf494,0x1c6));var _0x4f49=function(_0x1204f3,_0x3eaf4d){_0x1204f3=_0x1204f3-0x0;var _0x57e89a=_0xf494[_0x1204f3];return _0x57e89a;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'name':{'type':Sequelize[_0x4f49('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4f49('0x2')]},'table':{'type':Sequelize[_0x4f49('0x2')]},'conditions':{'type':Sequelize[_0x4f49('0x3')]},'joins':{'type':Sequelize[_0x4f49('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index d4c1ef6..d1670ef 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 _0x4819=['keyBy','table','metric','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','from','countTable','COUNT(*)','SELECT','run','cross_join','COUNT(DISTINCT\x20%s)','debug','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','AnalyticDefaultReport','includeAll','include','findAll','rows','show','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','body','preview','join','left_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','MetricId','function','replace','format','groupBy','group','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20EMPTY','operator','condition'];(function(_0x10b2c4,_0x4b10ed){var _0xb10a8e=function(_0x58ff68){while(--_0x58ff68){_0x10b2c4['push'](_0x10b2c4['shift']());}};_0xb10a8e(++_0x4b10ed);}(_0x4819,0xcd));var _0x9481=function(_0x476c6c,_0x434db8){_0x476c6c=_0x476c6c-0x0;var _0xbb94db=_0x4819[_0x476c6c];return _0xbb94db;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9481('0x0'));var zipdir=require(_0x9481('0x1'));var jsonpatch=require(_0x9481('0x2'));var rp=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var Mustache=require(_0x9481('0x6'));var util=require(_0x9481('0x7'));var path=require(_0x9481('0x8'));var sox=require(_0x9481('0x9'));var csv=require('to-csv');var ejs=require(_0x9481('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xf'));var querystring=require('querystring');var Papa=require(_0x9481('0x10'));var Redis=require('ioredis');var authService=require(_0x9481('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x12'));var hardwareService=require(_0x9481('0x13'));var logger=require(_0x9481('0x14'))(_0x9481('0x15'));var utils=require(_0x9481('0x16'));var config=require(_0x9481('0x17'));var licenseUtil=require(_0x9481('0x18'));var db=require(_0x9481('0x19'))['db'];var dbH=require(_0x9481('0x19'))['dbH'];function respondWithStatusCode(_0x5aac02,_0xce6fa2){_0xce6fa2=_0xce6fa2||0xcc;return function(_0x150276){if(_0x150276){return _0x5aac02[_0x9481('0x1a')](_0xce6fa2);}return _0x5aac02[_0x9481('0x1b')](_0xce6fa2)[_0x9481('0x1c')]();};}function respondWithResult(_0xc7a0b5,_0x3fb97f){_0x3fb97f=_0x3fb97f||0xc8;return function(_0x495b30){if(_0x495b30){return _0xc7a0b5[_0x9481('0x1b')](_0x3fb97f)[_0x9481('0x1d')](_0x495b30);}};}function respondWithFilteredResult(_0x5b1fe6,_0x2266d5){return function(_0x518150){if(_0x518150){var _0x34108d=typeof _0x2266d5[_0x9481('0x1e')]===_0x9481('0x1f')&&typeof _0x2266d5[_0x9481('0x20')]==='undefined';var _0x5eda66=_0x518150[_0x9481('0x21')];var _0x50a559=_0x34108d?0x0:_0x2266d5['offset'];var _0x26671c=_0x34108d?_0x518150[_0x9481('0x21')]:_0x2266d5[_0x9481('0x1e')]+_0x2266d5[_0x9481('0x20')];var _0x7000e7;if(_0x26671c>=_0x5eda66){_0x26671c=_0x5eda66;_0x7000e7=0xc8;}else{_0x7000e7=0xce;}_0x5b1fe6[_0x9481('0x1b')](_0x7000e7);return _0x5b1fe6['set'](_0x9481('0x22'),_0x50a559+'-'+_0x26671c+'/'+_0x5eda66)[_0x9481('0x1d')](_0x518150);}return null;};}function patchUpdates(_0x45f9df){return function(_0x615e02){try{jsonpatch[_0x9481('0x23')](_0x615e02,_0x45f9df,!![]);}catch(_0x56da97){return BPromise[_0x9481('0x24')](_0x56da97);}return _0x615e02[_0x9481('0x25')]();};}function saveUpdates(_0x572599,_0x2bcf37){return function(_0xd1cd1a){if(_0xd1cd1a){return _0xd1cd1a[_0x9481('0x26')](_0x572599)[_0x9481('0x27')](function(_0x2dc02e){return _0x2dc02e;});}return null;};}function removeEntity(_0x49ecfa,_0x91e3d9){return function(_0x22f0b5){if(_0x22f0b5){return _0x22f0b5['destroy']()['then'](function(){var _0x12b0c3=_0x22f0b5[_0x9481('0x28')]({'plain':!![]});var _0x550fce=_0x9481('0x29');return db[_0x9481('0x2a')][_0x9481('0x2b')]({'where':{'type':_0x550fce,'resourceId':_0x12b0c3['id']}})[_0x9481('0x27')](function(){return _0x22f0b5;});})['then'](function(){_0x49ecfa[_0x9481('0x1b')](0xcc)[_0x9481('0x1c')]();});}};}function handleEntityNotFound(_0x3c2585,_0x587706){return function(_0x1791b2){if(!_0x1791b2){_0x3c2585['sendStatus'](0x194);}return _0x1791b2;};}function handleError(_0x2e1eff,_0xe153ab){_0xe153ab=_0xe153ab||0x1f4;return function(_0x22ab26){logger[_0x9481('0x2c')](_0x22ab26[_0x9481('0x2d')]);if(_0x22ab26['name']){delete _0x22ab26[_0x9481('0x2e')];}_0x2e1eff[_0x9481('0x1b')](_0xe153ab)[_0x9481('0x2f')](_0x22ab26);};}exports['index']=function(_0x56752e,_0x1addc8){var _0x427c25={},_0x42df68={},_0x2b33f8={'count':0x0,'rows':[]};var _0x5d9926=_['map'](db['AnalyticDefaultReport'][_0x9481('0x30')],function(_0x5d6c65){return{'name':_0x5d6c65[_0x9481('0x31')],'type':_0x5d6c65['type'][_0x9481('0x32')]};});_0x42df68[_0x9481('0x33')]=_[_0x9481('0x34')](_0x5d9926,_0x9481('0x2e'));_0x42df68[_0x9481('0x35')]=_['keys'](_0x56752e[_0x9481('0x35')]);_0x42df68[_0x9481('0x36')]=_[_0x9481('0x37')](_0x42df68['model'],_0x42df68[_0x9481('0x35')]);_0x427c25[_0x9481('0x38')]=_[_0x9481('0x37')](_0x42df68[_0x9481('0x33')],qs[_0x9481('0x39')](_0x56752e[_0x9481('0x35')]['fields']));_0x427c25[_0x9481('0x38')]=_0x427c25['attributes'][_0x9481('0x3a')]?_0x427c25[_0x9481('0x38')]:_0x42df68[_0x9481('0x33')];if(!_0x56752e[_0x9481('0x35')][_0x9481('0x3b')](_0x9481('0x3c'))){_0x427c25['limit']=qs[_0x9481('0x20')](_0x56752e[_0x9481('0x35')]['limit']);_0x427c25['offset']=qs[_0x9481('0x1e')](_0x56752e['query'][_0x9481('0x1e')]);}_0x427c25[_0x9481('0x3d')]=qs[_0x9481('0x3e')](_0x56752e[_0x9481('0x35')]['sort']);_0x427c25[_0x9481('0x3f')]=qs['filters'](_[_0x9481('0x40')](_0x56752e['query'],_0x42df68[_0x9481('0x36')]),_0x5d9926);if(_0x56752e['query'][_0x9481('0x41')]){_0x427c25[_0x9481('0x3f')]=_[_0x9481('0x42')](_0x427c25[_0x9481('0x3f')],{'$or':_[_0x9481('0x34')](_0x5d9926,function(_0x3b7998){if(_0x3b7998[_0x9481('0x43')]!=='VIRTUAL'){var _0x464080={};_0x464080[_0x3b7998[_0x9481('0x2e')]]={'$like':'%'+_0x56752e[_0x9481('0x35')][_0x9481('0x41')]+'%'};return _0x464080;}})});}_0x427c25=_[_0x9481('0x42')]({},_0x427c25,_0x56752e[_0x9481('0x44')]);var _0x2e4241={'where':_0x427c25['where']};return db[_0x9481('0x45')][_0x9481('0x21')](_0x2e4241)['then'](function(_0x704e81){_0x2b33f8[_0x9481('0x21')]=_0x704e81;if(_0x56752e[_0x9481('0x35')][_0x9481('0x46')]){_0x427c25[_0x9481('0x47')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x9481('0x48')](_0x427c25);})['then'](function(_0x23811a){_0x2b33f8[_0x9481('0x49')]=_0x23811a;return _0x2b33f8;})['then'](respondWithFilteredResult(_0x1addc8,_0x427c25))['catch'](handleError(_0x1addc8,null));};exports[_0x9481('0x4a')]=function(_0x1d0df0,_0x42b19a){var _0x4c4caf={'raw':!![],'where':{'id':_0x1d0df0[_0x9481('0x4b')]['id']}},_0x4402f6={};_0x4402f6['model']=_['keys'](db[_0x9481('0x45')]['rawAttributes']);_0x4402f6[_0x9481('0x35')]=_[_0x9481('0x4c')](_0x1d0df0[_0x9481('0x35')]);_0x4402f6[_0x9481('0x36')]=_[_0x9481('0x37')](_0x4402f6['model'],_0x4402f6[_0x9481('0x35')]);_0x4c4caf[_0x9481('0x38')]=_['intersection'](_0x4402f6[_0x9481('0x33')],qs[_0x9481('0x39')](_0x1d0df0[_0x9481('0x35')][_0x9481('0x39')]));_0x4c4caf[_0x9481('0x38')]=_0x4c4caf[_0x9481('0x38')][_0x9481('0x3a')]?_0x4c4caf[_0x9481('0x38')]:_0x4402f6[_0x9481('0x33')];if(_0x1d0df0['query'][_0x9481('0x46')]){_0x4c4caf['include']=[{'all':!![]}];}_0x4c4caf=_['merge']({},_0x4c4caf,_0x1d0df0[_0x9481('0x44')]);return db['AnalyticDefaultReport'][_0x9481('0x4d')](_0x4c4caf)[_0x9481('0x27')](handleEntityNotFound(_0x42b19a,null))['then'](respondWithResult(_0x42b19a,null))[_0x9481('0x4e')](handleError(_0x42b19a,null));};exports[_0x9481('0x4f')]=function(_0x2f3413,_0x13b674){return db[_0x9481('0x45')][_0x9481('0x4f')](_0x2f3413['body'],{})['then'](function(_0x424b22){var _0x44d7e0=_0x2f3413[_0x9481('0x50')][_0x9481('0x28')]({'plain':!![]});if(!_0x44d7e0)throw new Error(_0x9481('0x51'));if(_0x44d7e0[_0x9481('0x52')]===_0x9481('0x50')){var _0x3d2250=_0x424b22['get']({'plain':!![]});var _0x3972c1=_0x9481('0x53');return db[_0x9481('0x54')][_0x9481('0x4d')]({'where':{'name':_0x3972c1,'userProfileId':_0x44d7e0[_0x9481('0x55')]},'raw':!![]})['then'](function(_0x4c3048){if(_0x4c3048&&_0x4c3048[_0x9481('0x56')]===0x0){return db[_0x9481('0x2a')][_0x9481('0x4f')]({'name':_0x3d2250['name'],'resourceId':_0x3d2250['id'],'type':'DefaultReports','sectionId':_0x4c3048['id']},{})['then'](function(){return _0x424b22;});}else{return _0x424b22;}})['catch'](function(_0x538507){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x538507);throw _0x538507;});}return _0x424b22;})[_0x9481('0x27')](respondWithResult(_0x13b674,0xc9))[_0x9481('0x4e')](handleError(_0x13b674,null));};exports['update']=function(_0xd8351c,_0x5f210c){if(_0xd8351c[_0x9481('0x57')]['id']){delete _0xd8351c[_0x9481('0x57')]['id'];}return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0xd8351c[_0x9481('0x4b')]['id']}})[_0x9481('0x27')](handleEntityNotFound(_0x5f210c,null))[_0x9481('0x27')](saveUpdates(_0xd8351c['body'],null))[_0x9481('0x27')](respondWithResult(_0x5f210c,null))[_0x9481('0x4e')](handleError(_0x5f210c,null));};exports['destroy']=function(_0x16416a,_0x1240dc){return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0x16416a[_0x9481('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1240dc,null))[_0x9481('0x27')](removeEntity(_0x1240dc,null))[_0x9481('0x4e')](handleError(_0x1240dc,null));};exports[_0x9481('0x58')]=function(_0x3fc0f9,_0x559dd2){var _0x3ac428=0xa;var _0x2927f5=[_0x9481('0x59'),_0x9481('0x5a'),'right_join','cross_join'];var _0x5b4234={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x589b16={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x239676=function(_0x205b96){return!_['includes'](['IS\x20NULL',_0x9481('0x67'),'IS\x20EMPTY',_0x9481('0x68')],_0x205b96);};var _0x59637f=function(_0x9af916){if(!_0x9af916||!_0x9af916[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x492464='(',_0x28d331=0x0;_0x28d331<_0x9af916[_0x9481('0x69')]['length'];_0x28d331+=0x1){_0x28d331>0x0&&(_0x492464+='\x20'+_0x9af916['operator']+'\x20');_0x492464+=_0x9af916['rules'][_0x28d331]['group']?_0x59637f(_0x9af916[_0x9481('0x69')][_0x28d331]['group']):_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6a')]+'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331]['condition']+(_0x239676(_0x9af916[_0x9481('0x69')][_0x28d331]['condition'])?'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6b')]:'');}return _0x492464+')';};var _0x3c267b={'where':{'id':_0x3fc0f9[_0x9481('0x4b')]['id']}},_0x4f157d,_0x2f20b4,_0x40fed2,_0x4ff016,_0x321972;_0x3c267b=_[_0x9481('0x42')]({},_0x3c267b,_0x3fc0f9[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x3c267b)[_0x9481('0x27')](function(_0x32ebde){if(_0x32ebde){_0x4f157d=_0x32ebde;return _0x32ebde[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x237d9b){if(_0x237d9b){if(!_0x237d9b[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x2f20b4=_0x237d9b;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})['then'](function(_0x1e05f8){if(_0x1e05f8){_0x40fed2=_['keyBy'](_0x1e05f8,'id');var _0x47bf37;var _0x1a7892=squel['select']();_0x1a7892['from'](_0x4f157d['table']);for(var _0x1b1967=0x0;_0x1b1967<_0x2f20b4[_0x9481('0x3a')];_0x1b1967+=0x1){_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x71')]?_0x40fed2[_0x2f20b4[_0x1b1967][_0x9481('0x71')]]['metric']:_0x2f20b4[_0x1b1967][_0x9481('0x6a')];_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x72')]?_[_0x9481('0x73')](_0x5b4234[_0x2f20b4[_0x1b1967][_0x9481('0x72')]],'%s',_0x47bf37):_0x47bf37;_0x47bf37=_0x2f20b4[_0x1b1967]['format']?_['replace'](_0x589b16[_0x2f20b4[_0x1b1967][_0x9481('0x74')]],'%s',_0x47bf37):_0x47bf37;if(_0x2f20b4[_0x1b1967][_0x9481('0x75')]){_0x1a7892[_0x9481('0x76')](_0x47bf37);}_0x2f20b4[_0x1b1967][_0x9481('0x77')]&&_0x1a7892[_0x9481('0x3d')](_0x47bf37,_0x2f20b4[_0x1b1967]['orderBy']===_0x9481('0x78')?![]:!![]);_0x1a7892[_0x9481('0x6a')](_0x47bf37,_0x2f20b4[_0x1b1967][_0x9481('0x79')]||_0x47bf37);}if(_0x4f157d[_0x9481('0x7a')]){_0x4f157d[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x4f157d[_0x9481('0x7a')]);for(var _0x42a6d2=0x0;_0x42a6d2<_0x4f157d[_0x9481('0x7a')][_0x9481('0x3a')];_0x42a6d2+=0x1){if(_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2927f5,_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')])&&_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7d')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7e')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7f')]){_0x1a7892[_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]](_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x4f157d['table'],_0x4f157d[_0x9481('0x7a')][_0x42a6d2]['parentKey'],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7f')]));}}}if(_0x4f157d[_0x9481('0x80')]){_0x4f157d[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x4f157d['conditions']);_0x1a7892[_0x9481('0x3f')](_0x59637f(_0x4f157d['conditions'][_0x9481('0x76')]));}_0x321972=_0x1a7892[_0x9481('0x81')]();_0x1a7892[_0x9481('0x20')](_0x3ac428);_0x1a7892['offset'](0x0);logger['debug']('Limited\x20Query:',_0x1a7892[_0x9481('0x82')]());return dbH['sequelize']['query'](_0x1a7892[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')]['SELECT']});}})[_0x9481('0x27')](respondWithResult(_0x559dd2,null))[_0x9481('0x4e')](handleError(_0x559dd2,null));};function runReport(_0x545457,_0x226932,_0x3c8241){var _0x1ea93a=_0x226932[_0x9481('0x2e')];var _0x5f4be2=0xa;var _0x2e585d=['join',_0x9481('0x5a'),_0x9481('0x85'),'cross_join'];var _0x1c82a1={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x9481('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x55b428={'SEC_TO_TIME':_0x9481('0x86'),'DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9481('0x66')};var _0x31e097=function(_0x339a30){return!_[_0x9481('0x7c')]([_0x9481('0x87'),_0x9481('0x67'),_0x9481('0x88'),_0x9481('0x68')],_0x339a30);};var _0x22e787=function(_0x31b70b){if(!_0x31b70b||!_0x31b70b['rules'][_0x9481('0x3a')]){return'';}for(var _0x5c430e='(',_0x4f55b5=0x0;_0x4f55b5<_0x31b70b['rules'][_0x9481('0x3a')];_0x4f55b5+=0x1){_0x4f55b5>0x0&&(_0x5c430e+='\x20'+_0x31b70b[_0x9481('0x89')]+'\x20');_0x5c430e+=_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x76')]?_0x22e787(_0x31b70b[_0x9481('0x69')][_0x4f55b5]['group']):_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6a')]+'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')]+(_0x31e097(_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')])?'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6b')]:'');}return _0x5c430e+')';};var _0x28d924={'where':{'id':_0x545457['id']}},_0x426d56,_0x5808c8,_0x27be69,_0x1d49ba,_0x458a6f;_0x28d924=_[_0x9481('0x42')]({},_0x28d924,_0x3c8241);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x28d924)[_0x9481('0x27')](function(_0x1173e9){if(_0x1173e9){_0x426d56=_0x1173e9;return _0x1173e9[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x5557d7){if(_0x5557d7){if(!_0x5557d7[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x5808c8=_0x5557d7;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x3ae3e2){if(_0x3ae3e2){_0x27be69=_[_0x9481('0x8b')](_0x3ae3e2,'id');var _0x538fe0;var _0x44e2c2=squel['select']();_0x44e2c2['from'](_0x426d56[_0x9481('0x8c')]);for(var _0x382455=0x0;_0x382455<_0x5808c8[_0x9481('0x3a')];_0x382455+=0x1){_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x71')]?_0x27be69[_0x5808c8[_0x382455][_0x9481('0x71')]][_0x9481('0x8d')]:_0x5808c8[_0x382455]['field'];_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x72')]?_['replace'](_0x1c82a1[_0x5808c8[_0x382455][_0x9481('0x72')]],'%s',_0x538fe0):_0x538fe0;_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x74')]?_[_0x9481('0x73')](_0x55b428[_0x5808c8[_0x382455]['format']],'%s',_0x538fe0):_0x538fe0;if(_0x5808c8[_0x382455]['groupBy']){_0x44e2c2[_0x9481('0x76')](_0x538fe0);}_0x5808c8[_0x382455][_0x9481('0x77')]&&_0x44e2c2[_0x9481('0x3d')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x44e2c2[_0x9481('0x6a')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x79')]||_0x538fe0);}if(_0x426d56[_0x9481('0x7a')]){_0x426d56[_0x9481('0x7a')]=JSON['parse'](_0x426d56[_0x9481('0x7a')]);for(var _0xd64114=0x0;_0xd64114<_0x426d56['joins'][_0x9481('0x3a')];_0xd64114+=0x1){if(_0x426d56['joins'][_0xd64114][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2e585d,_0x426d56['joins'][_0xd64114][_0x9481('0x43')])&&_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')]&&_0x426d56['joins'][_0xd64114][_0x9481('0x7e')]&&_0x426d56[_0x9481('0x7a')][_0xd64114]['foreignKey']){_0x44e2c2[_0x426d56[_0x9481('0x7a')][_0xd64114]['type']](_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x426d56['table'],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7f')]));}}}if(_0x426d56['conditions']){_0x426d56[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x426d56[_0x9481('0x80')]);_0x44e2c2[_0x9481('0x3f')](_0x22e787(_0x426d56[_0x9481('0x80')][_0x9481('0x76')]));}_0x458a6f=_0x44e2c2[_0x9481('0x81')]();_0x44e2c2['limit'](_0x5f4be2);_0x44e2c2[_0x9481('0x1e')](0x0);return;}})[_0x9481('0x27')](function(){if(_0x226932[_0x9481('0x8e')]===_0x9481('0x8f')){return null;}var _0x4e5a8d=_[_0x9481('0x42')](_0x226932,{'name':_0x226932[_0x9481('0x90')]||_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],'basename':_0x1ea93a,'savename':util['format'](_0x9481('0x91'),_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],require(_0x9481('0x92'))[_0x9481('0x93')](0x4),_0x226932[_0x9481('0x8e')]||_0x9481('0x94')),'reportId':_0x426d56['id'],'reportType':_0x9481('0x95')});return db[_0x9481('0x96')][_0x9481('0x4f')](_0x4e5a8d,{'raw':!![]});})[_0x9481('0x27')](function(_0x5930d6){if(_0x426d56[_0x9481('0x8c')]==='cdr'){_0x458a6f[_0x9481('0x3f')](_0x426d56[_0x9481('0x8c')]+_0x9481('0x97'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}else{_0x458a6f['where'](_0x426d56[_0x9481('0x8c')]+_0x9481('0x9a'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}if(_0x5930d6){logger[_0x9481('0x9b')](_0x9481('0x9c'),_0x458a6f['toString']());require(_0x9481('0x9d'))[_0x9481('0x9e')](path[_0x9481('0x59')](__dirname,_0x9481('0x9f'),_0x5930d6[_0x9481('0x8e')]),[_0x5930d6['id'],_0x458a6f[_0x9481('0x82')](),path[_0x9481('0x59')](__dirname,_0x9481('0xa0'),_0x5930d6[_0x9481('0xa1')]),_0x1ea93a]);return _0x5930d6;}else{var _0x26a666=squel[_0x9481('0xa2')]();_0x26a666[_0x9481('0xa3')]('('+_0x458a6f['toString']()+')',_0x9481('0xa4'));_0x26a666[_0x9481('0x6a')](_0x9481('0xa5'),_0x9481('0x21'));_0x458a6f[_0x9481('0x20')](_0x226932[_0x9481('0x20')]||_0x5f4be2);_0x458a6f[_0x9481('0x1e')](_0x226932[_0x9481('0x1e')]||0x0);return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x26a666[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]})[_0x9481('0x27')](function(_0xcf83d2){if(!_0xcf83d2[_0x9481('0x3a')]){_0x1d49ba=0x0;}else{_0x1d49ba=_0xcf83d2[0x0][_0x9481('0x21')]||0x0;}return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x458a6f['toString'](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});})[_0x9481('0x27')](function(_0x4553fc){return{'rows':_0x4553fc||[],'count':_0x1d49ba};});}});}exports[_0x9481('0xa7')]=function(_0x55c4ab,_0x57928a){return runReport(_0x55c4ab[_0x9481('0x4b')],_0x55c4ab[_0x9481('0x35')],_0x55c4ab[_0x9481('0x44')])[_0x9481('0x27')](respondWithResult(_0x57928a,null))['catch'](handleError(_0x57928a,null));};exports['runReport']=runReport;exports['query']=function(_0x52b980,_0x5792b1){var _0x3a199b=0xa;var _0x4b779b=[_0x9481('0x59'),_0x9481('0x5a'),_0x9481('0x85'),_0x9481('0xa8')];var _0x55a65f={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':_0x9481('0xa9'),'MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x583490={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':'HOUR(%s)','ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x1e40fe=function(_0x26c87b){return!_[_0x9481('0x7c')](['IS\x20NULL',_0x9481('0x67'),_0x9481('0x88'),'IS\x20NOT\x20EMPTY'],_0x26c87b);};var _0x4ea411=function(_0x1cdca0){if(!_0x1cdca0||!_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x15c53f='(',_0x7ee854=0x0;_0x7ee854<_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')];_0x7ee854+=0x1){_0x7ee854>0x0&&(_0x15c53f+='\x20'+_0x1cdca0[_0x9481('0x89')]+'\x20');_0x15c53f+=_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x76')]?_0x4ea411(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x76')]):_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x6a')]+'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x8a')]+(_0x1e40fe(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x8a')])?'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854]['value']:'');}return _0x15c53f+')';};var _0x49a6db={'where':{'id':_0x52b980['params']['id']}},_0x224b16,_0x83543f,_0x58c043,_0x97a67a,_0xe157e4;_0x49a6db=_[_0x9481('0x42')]({},_0x49a6db,_0x52b980[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x49a6db)['then'](function(_0x1a1058){if(_0x1a1058){_0x224b16=_0x1a1058;return _0x1a1058['getFields']();}return null;})[_0x9481('0x27')](function(_0x206661){if(_0x206661){if(!_0x206661[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x83543f=_0x206661;return db['AnalyticMetric'][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x40cdf9){if(_0x40cdf9){_0x58c043=_['keyBy'](_0x40cdf9,'id');var _0x5467fe;var _0x440d88=squel['select']();_0x440d88[_0x9481('0xa3')](_0x224b16['table']);for(var _0x2a0367=0x0;_0x2a0367<_0x83543f[_0x9481('0x3a')];_0x2a0367+=0x1){_0x5467fe=_0x83543f[_0x2a0367]['MetricId']?_0x58c043[_0x83543f[_0x2a0367][_0x9481('0x71')]][_0x9481('0x8d')]:_0x83543f[_0x2a0367][_0x9481('0x6a')];_0x5467fe=_0x83543f[_0x2a0367]['function']?_[_0x9481('0x73')](_0x55a65f[_0x83543f[_0x2a0367][_0x9481('0x72')]],'%s',_0x5467fe):_0x5467fe;_0x5467fe=_0x83543f[_0x2a0367][_0x9481('0x74')]?_[_0x9481('0x73')](_0x583490[_0x83543f[_0x2a0367][_0x9481('0x74')]],'%s',_0x5467fe):_0x5467fe;if(_0x83543f[_0x2a0367][_0x9481('0x75')]){_0x440d88[_0x9481('0x76')](_0x5467fe);}_0x83543f[_0x2a0367]['orderBy']&&_0x440d88[_0x9481('0x3d')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x440d88[_0x9481('0x6a')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x79')]||_0x5467fe);}if(_0x224b16['joins']){_0x224b16[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x7a')]);for(var _0x527ef6=0x0;_0x527ef6<_0x224b16['joins'][_0x9481('0x3a')];_0x527ef6+=0x1){if(_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x4b779b,_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')])&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7d')]&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')]&&_0x224b16['joins'][_0x527ef6][_0x9481('0x7f')]){_0x440d88[_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]](_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x224b16[_0x9481('0x8c')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['parentKey'],_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['foreignKey']));}}}if(_0x224b16[_0x9481('0x80')]){_0x224b16[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x80')]);_0x440d88['where'](_0x4ea411(_0x224b16[_0x9481('0x80')][_0x9481('0x76')]));}_0xe157e4=_0x440d88[_0x9481('0x81')]();_0x440d88[_0x9481('0x20')](_0x3a199b);_0x440d88['offset'](0x0);logger[_0x9481('0xaa')](_0x9481('0xab'),_0x440d88[_0x9481('0x82')]());return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x440d88[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});}})[_0x9481('0x27')](function(){return{'sql':_0xe157e4['toString']()};})[_0x9481('0x27')](respondWithResult(_0x5792b1,null))[_0x9481('0x4e')](handleError(_0x5792b1,null));};
\ No newline at end of file
+var _0x46ed=['SEC_TO_TIME(%s)','value','AnalyticMetric','select','DESC','output','fullPath','%s-%s.%s','randomstring','csv','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../files/reports','savename','countTable','COUNT(*)','sequelize','runReport','left_join','COUNT(%s)','MIN(%s)','AVG(%s)','Limited\x20Query:','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','user','Reports','UserProfileSection','userProfileId','autoAssociation','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%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\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','order','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','QueryTypes','SELECT'];(function(_0x169dab,_0x3dcafb){var _0x5e2d3e=function(_0x143edd){while(--_0x143edd){_0x169dab['push'](_0x169dab['shift']());}};_0x5e2d3e(++_0x3dcafb);}(_0x46ed,0x168));var _0xd46e=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x46ed[_0x5c2e3e];return _0x53f64a;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xf3048c,_0x27dbfb){_0x27dbfb=_0x27dbfb||0xcc;return function(_0x53b309){if(_0x53b309){return _0xf3048c['sendStatus'](_0x27dbfb);}return _0xf3048c[_0xd46e('0x1a')](_0x27dbfb)[_0xd46e('0x1b')]();};}function respondWithResult(_0x1e9aae,_0x3fdf88){_0x3fdf88=_0x3fdf88||0xc8;return function(_0x50c7c3){if(_0x50c7c3){return _0x1e9aae[_0xd46e('0x1a')](_0x3fdf88)[_0xd46e('0x1c')](_0x50c7c3);}};}function respondWithFilteredResult(_0x417402,_0x3d72ce){return function(_0x36a317){if(_0x36a317){var _0x47fa8f=typeof _0x3d72ce[_0xd46e('0x1d')]===_0xd46e('0x1e')&&typeof _0x3d72ce[_0xd46e('0x1f')]==='undefined';var _0x5ddd04=_0x36a317[_0xd46e('0x20')];var _0x1bd574=_0x47fa8f?0x0:_0x3d72ce['offset'];var _0x4fd1f2=_0x47fa8f?_0x36a317[_0xd46e('0x20')]:_0x3d72ce[_0xd46e('0x1d')]+_0x3d72ce[_0xd46e('0x1f')];var _0x2273c5;if(_0x4fd1f2>=_0x5ddd04){_0x4fd1f2=_0x5ddd04;_0x2273c5=0xc8;}else{_0x2273c5=0xce;}_0x417402[_0xd46e('0x1a')](_0x2273c5);return _0x417402[_0xd46e('0x21')](_0xd46e('0x22'),_0x1bd574+'-'+_0x4fd1f2+'/'+_0x5ddd04)[_0xd46e('0x1c')](_0x36a317);}return null;};}function patchUpdates(_0xb4940){return function(_0x3c7e91){try{jsonpatch[_0xd46e('0x23')](_0x3c7e91,_0xb4940,!![]);}catch(_0x5ba94d){return BPromise[_0xd46e('0x24')](_0x5ba94d);}return _0x3c7e91[_0xd46e('0x25')]();};}function saveUpdates(_0x79aa51,_0x45ce0b){return function(_0x128246){if(_0x128246){return _0x128246[_0xd46e('0x26')](_0x79aa51)[_0xd46e('0x27')](function(_0x8a1be){return _0x8a1be;});}return null;};}function removeEntity(_0x62dea5,_0x4cf899){return function(_0x314570){if(_0x314570){return _0x314570['destroy']()['then'](function(){var _0x371054=_0x314570[_0xd46e('0x28')]({'plain':!![]});var _0x21135f=_0xd46e('0x29');return db[_0xd46e('0x2a')][_0xd46e('0x2b')]({'where':{'type':_0x21135f,'resourceId':_0x371054['id']}})[_0xd46e('0x27')](function(){return _0x314570;});})['then'](function(){_0x62dea5[_0xd46e('0x1a')](0xcc)[_0xd46e('0x1b')]();});}};}function handleEntityNotFound(_0xddbce9,_0x17db79){return function(_0x96f15c){if(!_0x96f15c){_0xddbce9[_0xd46e('0x2c')](0x194);}return _0x96f15c;};}function handleError(_0x58aeef,_0x465d54){_0x465d54=_0x465d54||0x1f4;return function(_0x3a1ced){logger[_0xd46e('0x2d')](_0x3a1ced[_0xd46e('0x2e')]);if(_0x3a1ced[_0xd46e('0x2f')]){delete _0x3a1ced[_0xd46e('0x2f')];}_0x58aeef[_0xd46e('0x1a')](_0x465d54)[_0xd46e('0x30')](_0x3a1ced);};}exports[_0xd46e('0x31')]=function(_0x45ea47,_0x2ff785){var _0x504324={},_0x2f4a1b={},_0x5ed8dc={'count':0x0,'rows':[]};var _0x1248ce=_[_0xd46e('0x32')](db[_0xd46e('0x33')][_0xd46e('0x34')],function(_0x5ef248){return{'name':_0x5ef248[_0xd46e('0x35')],'type':_0x5ef248[_0xd46e('0x36')]['key']};});_0x2f4a1b[_0xd46e('0x37')]=_[_0xd46e('0x32')](_0x1248ce,'name');_0x2f4a1b[_0xd46e('0x38')]=_[_0xd46e('0x39')](_0x45ea47[_0xd46e('0x38')]);_0x2f4a1b['filters']=_['intersection'](_0x2f4a1b[_0xd46e('0x37')],_0x2f4a1b[_0xd46e('0x38')]);_0x504324[_0xd46e('0x3a')]=_[_0xd46e('0x3b')](_0x2f4a1b[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x504324['attributes']=_0x504324[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x504324[_0xd46e('0x3a')]:_0x2f4a1b[_0xd46e('0x37')];if(!_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3e')](_0xd46e('0x3f'))){_0x504324['limit']=qs[_0xd46e('0x1f')](_0x45ea47[_0xd46e('0x38')]['limit']);_0x504324[_0xd46e('0x1d')]=qs[_0xd46e('0x1d')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x1d')]);}_0x504324['order']=qs[_0xd46e('0x40')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x40')]);_0x504324[_0xd46e('0x41')]=qs[_0xd46e('0x42')](_[_0xd46e('0x43')](_0x45ea47[_0xd46e('0x38')],_0x2f4a1b[_0xd46e('0x42')]),_0x1248ce);if(_0x45ea47['query'][_0xd46e('0x44')]){_0x504324[_0xd46e('0x41')]=_[_0xd46e('0x45')](_0x504324[_0xd46e('0x41')],{'$or':_[_0xd46e('0x32')](_0x1248ce,function(_0x56f99c){if(_0x56f99c[_0xd46e('0x36')]!=='VIRTUAL'){var _0x55230d={};_0x55230d[_0x56f99c['name']]={'$like':'%'+_0x45ea47['query'][_0xd46e('0x44')]+'%'};return _0x55230d;}})});}_0x504324=_['merge']({},_0x504324,_0x45ea47[_0xd46e('0x46')]);var _0x40720e={'where':_0x504324['where']};return db[_0xd46e('0x33')][_0xd46e('0x20')](_0x40720e)[_0xd46e('0x27')](function(_0x31ba12){_0x5ed8dc[_0xd46e('0x20')]=_0x31ba12;if(_0x45ea47[_0xd46e('0x38')][_0xd46e('0x47')]){_0x504324[_0xd46e('0x48')]=[{'all':!![]}];}return db[_0xd46e('0x33')][_0xd46e('0x49')](_0x504324);})[_0xd46e('0x27')](function(_0x5ea048){_0x5ed8dc['rows']=_0x5ea048;return _0x5ed8dc;})['then'](respondWithFilteredResult(_0x2ff785,_0x504324))[_0xd46e('0x4a')](handleError(_0x2ff785,null));};exports['show']=function(_0x168d35,_0x272f5f){var _0x3fdf67={'raw':!![],'where':{'id':_0x168d35[_0xd46e('0x4b')]['id']}},_0x416505={};_0x416505[_0xd46e('0x37')]=_[_0xd46e('0x39')](db[_0xd46e('0x33')]['rawAttributes']);_0x416505[_0xd46e('0x38')]=_['keys'](_0x168d35[_0xd46e('0x38')]);_0x416505[_0xd46e('0x42')]=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],_0x416505[_0xd46e('0x38')]);_0x3fdf67['attributes']=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x168d35[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x3fdf67['attributes']=_0x3fdf67[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x3fdf67[_0xd46e('0x3a')]:_0x416505[_0xd46e('0x37')];if(_0x168d35[_0xd46e('0x38')]['includeAll']){_0x3fdf67[_0xd46e('0x48')]=[{'all':!![]}];}_0x3fdf67=_[_0xd46e('0x45')]({},_0x3fdf67,_0x168d35[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fdf67)[_0xd46e('0x27')](handleEntityNotFound(_0x272f5f,null))[_0xd46e('0x27')](respondWithResult(_0x272f5f,null))[_0xd46e('0x4a')](handleError(_0x272f5f,null));};exports['create']=function(_0xf9dab,_0x71a8dc){return db[_0xd46e('0x33')][_0xd46e('0x4d')](_0xf9dab[_0xd46e('0x4e')],{})['then'](function(_0x4ae314){var _0x3a94cf=_0xf9dab[_0xd46e('0x4f')][_0xd46e('0x28')]({'plain':!![]});if(!_0x3a94cf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a94cf['role']===_0xd46e('0x4f')){var _0x9d8638=_0x4ae314['get']({'plain':!![]});var _0x2eee92=_0xd46e('0x50');return db[_0xd46e('0x51')][_0xd46e('0x4c')]({'where':{'name':_0x2eee92,'userProfileId':_0x3a94cf[_0xd46e('0x52')]},'raw':!![]})[_0xd46e('0x27')](function(_0x80ed51){if(_0x80ed51&&_0x80ed51[_0xd46e('0x53')]===0x0){return db['UserProfileResource'][_0xd46e('0x4d')]({'name':_0x9d8638[_0xd46e('0x2f')],'resourceId':_0x9d8638['id'],'type':_0xd46e('0x29'),'sectionId':_0x80ed51['id']},{})[_0xd46e('0x27')](function(){return _0x4ae314;});}else{return _0x4ae314;}})['catch'](function(_0x56dd9a){logger[_0xd46e('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56dd9a);throw _0x56dd9a;});}return _0x4ae314;})[_0xd46e('0x27')](respondWithResult(_0x71a8dc,0xc9))[_0xd46e('0x4a')](handleError(_0x71a8dc,null));};exports[_0xd46e('0x26')]=function(_0x31f7eb,_0x5a7870){if(_0x31f7eb[_0xd46e('0x4e')]['id']){delete _0x31f7eb['body']['id'];}return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x31f7eb[_0xd46e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5a7870,null))[_0xd46e('0x27')](saveUpdates(_0x31f7eb[_0xd46e('0x4e')],null))[_0xd46e('0x27')](respondWithResult(_0x5a7870,null))[_0xd46e('0x4a')](handleError(_0x5a7870,null));};exports[_0xd46e('0x2b')]=function(_0x2cc676,_0x2760ef){return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x2cc676[_0xd46e('0x4b')]['id']}})[_0xd46e('0x27')](handleEntityNotFound(_0x2760ef,null))[_0xd46e('0x27')](removeEntity(_0x2760ef,null))[_0xd46e('0x4a')](handleError(_0x2760ef,null));};exports[_0xd46e('0x54')]=function(_0x47a86c,_0x3ec709){var _0x37a22f=0xa;var _0xe0cd61=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0xaf9641={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x481dce={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x2dacb4=function(_0x2f9fcb){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x2f9fcb);};var _0x1aaa99=function(_0x272514){if(!_0x272514||!_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x476f09='(',_0x5067b7=0x0;_0x5067b7<_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')];_0x5067b7+=0x1){_0x5067b7>0x0&&(_0x476f09+='\x20'+_0x272514[_0xd46e('0x68')]+'\x20');_0x476f09+=_0x272514['rules'][_0x5067b7][_0xd46e('0x69')]?_0x1aaa99(_0x272514[_0xd46e('0x67')][_0x5067b7]['group']):_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6a')]+'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['condition']+(_0x2dacb4(_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6b')])?'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['value']:'');}return _0x476f09+')';};var _0xe5f8cd={'where':{'id':_0x47a86c[_0xd46e('0x4b')]['id']}},_0x516e7d,_0x32eed0,_0x148187,_0x35db1b,_0x4f3ba0;_0xe5f8cd=_[_0xd46e('0x45')]({},_0xe5f8cd,_0x47a86c[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0xe5f8cd)[_0xd46e('0x27')](function(_0x16f906){if(_0x16f906){_0x516e7d=_0x16f906;return _0x16f906[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0x3e55a3){if(_0x3e55a3){if(!_0x3e55a3[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))](_0xd46e('0x6f'),0x193);}_0x32eed0=_0x3e55a3;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3e0ed5){if(_0x3e0ed5){_0x148187=_[_0xd46e('0x70')](_0x3e0ed5,'id');var _0x2fff69;var _0x249938=squel['select']();_0x249938[_0xd46e('0x71')](_0x516e7d[_0xd46e('0x72')]);for(var _0xfb4073=0x0;_0xfb4073<_0x32eed0[_0xd46e('0x3d')];_0xfb4073+=0x1){_0x2fff69=_0x32eed0[_0xfb4073]['MetricId']?_0x148187[_0x32eed0[_0xfb4073][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x32eed0[_0xfb4073]['field'];_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0xaf9641[_0x32eed0[_0xfb4073]['function']],'%s',_0x2fff69):_0x2fff69;_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x481dce[_0x32eed0[_0xfb4073]['format']],'%s',_0x2fff69):_0x2fff69;if(_0x32eed0[_0xfb4073][_0xd46e('0x78')]){_0x249938['group'](_0x2fff69);}_0x32eed0[_0xfb4073][_0xd46e('0x79')]&&_0x249938[_0xd46e('0x7a')](_0x2fff69,_0x32eed0[_0xfb4073]['orderBy']==='DESC'?![]:!![]);_0x249938[_0xd46e('0x6a')](_0x2fff69,_0x32eed0[_0xfb4073][_0xd46e('0x7b')]||_0x2fff69);}if(_0x516e7d[_0xd46e('0x7c')]){_0x516e7d[_0xd46e('0x7c')]=JSON['parse'](_0x516e7d[_0xd46e('0x7c')]);for(var _0x372509=0x0;_0x372509<_0x516e7d['joins'][_0xd46e('0x3d')];_0x372509+=0x1){if(_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0xe0cd61,_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')])&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7d')]&&_0x516e7d[_0xd46e('0x7c')][_0x372509]['foreignTable']&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7e')]){_0x249938[_0x516e7d['joins'][_0x372509][_0xd46e('0x36')]](_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0x516e7d[_0xd46e('0x72')],_0x516e7d['joins'][_0x372509]['parentKey'],_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],_0x516e7d['joins'][_0x372509]['foreignKey']));}}}if(_0x516e7d['conditions']){_0x516e7d[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x516e7d[_0xd46e('0x81')]);_0x249938['where'](_0x1aaa99(_0x516e7d[_0xd46e('0x81')][_0xd46e('0x69')]));}_0x4f3ba0=_0x249938[_0xd46e('0x83')]();_0x249938['limit'](_0x37a22f);_0x249938['offset'](0x0);logger['debug']('Limited\x20Query:',_0x249938[_0xd46e('0x84')]());return dbH['sequelize'][_0xd46e('0x38')](_0x249938['toString'](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](respondWithResult(_0x3ec709,null))[_0xd46e('0x4a')](handleError(_0x3ec709,null));};function runReport(_0xf16d87,_0x99872a,_0x57a7cc){var _0x586024=_0x99872a[_0xd46e('0x2f')];var _0x383919=0xa;var _0x114f2c=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0x4ca21f={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x5ef4cc={'SEC_TO_TIME':_0xd46e('0x87'),'DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x88460a=function(_0x3a3744){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x3a3744);};var _0x3c476d=function(_0x1b2a6d){if(!_0x1b2a6d||!_0x1b2a6d[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x441f73='(',_0x1d2738=0x0;_0x1d2738<_0x1b2a6d['rules'][_0xd46e('0x3d')];_0x1d2738+=0x1){_0x1d2738>0x0&&(_0x441f73+='\x20'+_0x1b2a6d['operator']+'\x20');_0x441f73+=_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x69')]?_0x3c476d(_0x1b2a6d['rules'][_0x1d2738][_0xd46e('0x69')]):_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6a')]+'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')]+(_0x88460a(_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')])?'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x88')]:'');}return _0x441f73+')';};var _0x3fa34d={'where':{'id':_0xf16d87['id']}},_0xc098c9,_0x5f5ba7,_0x493df5,_0x18e140,_0x459a0c;_0x3fa34d=_[_0xd46e('0x45')]({},_0x3fa34d,_0x57a7cc);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fa34d)[_0xd46e('0x27')](function(_0x5b554e){if(_0x5b554e){_0xc098c9=_0x5b554e;return _0x5b554e[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0xa254f5){if(_0xa254f5){if(!_0xa254f5[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5f5ba7=_0xa254f5;return db[_0xd46e('0x89')][_0xd46e('0x49')]({'raw':!![]});}return null;})['then'](function(_0x3c8d68){if(_0x3c8d68){_0x493df5=_[_0xd46e('0x70')](_0x3c8d68,'id');var _0x9e222d;var _0x3da17e=squel[_0xd46e('0x8a')]();_0x3da17e[_0xd46e('0x71')](_0xc098c9[_0xd46e('0x72')]);for(var _0x282f71=0x0;_0x282f71<_0x5f5ba7[_0xd46e('0x3d')];_0x282f71+=0x1){_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x73')]?_0x493df5[_0x5f5ba7[_0x282f71][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x5f5ba7[_0x282f71][_0xd46e('0x6a')];_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x75')]?_['replace'](_0x4ca21f[_0x5f5ba7[_0x282f71]['function']],'%s',_0x9e222d):_0x9e222d;_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x5ef4cc[_0x5f5ba7[_0x282f71][_0xd46e('0x77')]],'%s',_0x9e222d):_0x9e222d;if(_0x5f5ba7[_0x282f71][_0xd46e('0x78')]){_0x3da17e[_0xd46e('0x69')](_0x9e222d);}_0x5f5ba7[_0x282f71][_0xd46e('0x79')]&&_0x3da17e['order'](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x3da17e[_0xd46e('0x6a')](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x7b')]||_0x9e222d);}if(_0xc098c9['joins']){_0xc098c9[_0xd46e('0x7c')]=JSON[_0xd46e('0x82')](_0xc098c9['joins']);for(var _0xdf967c=0x0;_0xdf967c<_0xc098c9['joins']['length'];_0xdf967c+=0x1){if(_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x114f2c,_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['type'])&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7d')]&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7f')]&&_0xc098c9['joins'][_0xdf967c]['foreignKey']){_0x3da17e[_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]](_0xc098c9['joins'][_0xdf967c]['foreignTable'],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0xc098c9[_0xd46e('0x72')],_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['parentKey'],_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x7f')],_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7e')]));}}}if(_0xc098c9[_0xd46e('0x81')]){_0xc098c9[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0xc098c9[_0xd46e('0x81')]);_0x3da17e[_0xd46e('0x41')](_0x3c476d(_0xc098c9['conditions'][_0xd46e('0x69')]));}_0x459a0c=_0x3da17e[_0xd46e('0x83')]();_0x3da17e['limit'](_0x383919);_0x3da17e['offset'](0x0);return;}})[_0xd46e('0x27')](function(){if(_0x99872a[_0xd46e('0x8c')]==='web'){return null;}var _0x5e637d=_[_0xd46e('0x45')](_0x99872a,{'name':_0x99872a[_0xd46e('0x8d')]||_0x99872a['name']||_0xc098c9[_0xd46e('0x2f')],'basename':_0x586024,'savename':util[_0xd46e('0x77')](_0xd46e('0x8e'),_0x99872a[_0xd46e('0x2f')]||_0xc098c9[_0xd46e('0x2f')],require(_0xd46e('0x8f'))['generate'](0x4),_0x99872a[_0xd46e('0x8c')]||_0xd46e('0x90')),'reportId':_0xc098c9['id'],'reportType':_0xd46e('0x91')});return db[_0xd46e('0x92')][_0xd46e('0x4d')](_0x5e637d,{'raw':!![]});})[_0xd46e('0x27')](function(_0x3311a6){if(_0xc098c9[_0xd46e('0x72')]===_0xd46e('0x93')){_0x459a0c[_0xd46e('0x41')](_0xc098c9[_0xd46e('0x72')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x99872a[_0xd46e('0x94')],_0x99872a['endDate']);}else{_0x459a0c['where'](_0xc098c9[_0xd46e('0x72')]+_0xd46e('0x95'),_0x99872a[_0xd46e('0x94')],_0x99872a[_0xd46e('0x96')]);}if(_0x3311a6){logger[_0xd46e('0x97')](_0xd46e('0x98'),_0x459a0c[_0xd46e('0x84')]());require(_0xd46e('0x99'))['fork'](path[_0xd46e('0x55')](__dirname,'../../components/export/',_0x3311a6[_0xd46e('0x8c')]),[_0x3311a6['id'],_0x459a0c[_0xd46e('0x84')](),path[_0xd46e('0x55')](__dirname,_0xd46e('0x9a'),_0x3311a6[_0xd46e('0x9b')]),_0x586024]);return _0x3311a6;}else{var _0x399918=squel[_0xd46e('0x8a')]();_0x399918[_0xd46e('0x71')]('('+_0x459a0c['toString']()+')',_0xd46e('0x9c'));_0x399918[_0xd46e('0x6a')](_0xd46e('0x9d'),'count');_0x459a0c[_0xd46e('0x1f')](_0x99872a[_0xd46e('0x1f')]||_0x383919);_0x459a0c[_0xd46e('0x1d')](_0x99872a['offset']||0x0);return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x399918[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]})['then'](function(_0x4967ff){if(!_0x4967ff[_0xd46e('0x3d')]){_0x18e140=0x0;}else{_0x18e140=_0x4967ff[0x0][_0xd46e('0x20')]||0x0;}return dbH['sequelize'][_0xd46e('0x38')](_0x459a0c[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]});})[_0xd46e('0x27')](function(_0x4bb76b){return{'rows':_0x4bb76b||[],'count':_0x18e140};});}});}exports['run']=function(_0x204a9f,_0x52ca5a){return runReport(_0x204a9f[_0xd46e('0x4b')],_0x204a9f[_0xd46e('0x38')],_0x204a9f['options'])[_0xd46e('0x27')](respondWithResult(_0x52ca5a,null))[_0xd46e('0x4a')](handleError(_0x52ca5a,null));};exports[_0xd46e('0x9f')]=runReport;exports[_0xd46e('0x38')]=function(_0x786ae,_0x537c73){var _0x1610bd=0xa;var _0x20cc4c=[_0xd46e('0x55'),_0xd46e('0xa0'),_0xd46e('0x56'),_0xd46e('0x57')];var _0x368742={'SUM':_0xd46e('0x58'),'COUNT':_0xd46e('0xa1'),'COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':_0xd46e('0xa2'),'AVG':_0xd46e('0xa3'),'GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x285cf8={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xc87da2=function(_0x195f02){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),'IS\x20NOT\x20NULL',_0xd46e('0x65'),_0xd46e('0x66')],_0x195f02);};var _0x44322f=function(_0x49959f){if(!_0x49959f||!_0x49959f['rules'][_0xd46e('0x3d')]){return'';}for(var _0x2094e5='(',_0x85aac1=0x0;_0x85aac1<_0x49959f[_0xd46e('0x67')][_0xd46e('0x3d')];_0x85aac1+=0x1){_0x85aac1>0x0&&(_0x2094e5+='\x20'+_0x49959f[_0xd46e('0x68')]+'\x20');_0x2094e5+=_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]?_0x44322f(_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]):_0x49959f['rules'][_0x85aac1][_0xd46e('0x6a')]+'\x20'+_0x49959f['rules'][_0x85aac1]['condition']+(_0xc87da2(_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x6b')])?'\x20'+_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x88')]:'');}return _0x2094e5+')';};var _0x101a29={'where':{'id':_0x786ae[_0xd46e('0x4b')]['id']}},_0x3a44da,_0x417068,_0x52e73e,_0x206077,_0xe729b6;_0x101a29=_[_0xd46e('0x45')]({},_0x101a29,_0x786ae[_0xd46e('0x46')]);return db['AnalyticDefaultReport'][_0xd46e('0x4c')](_0x101a29)[_0xd46e('0x27')](function(_0x1d08bb){if(_0x1d08bb){_0x3a44da=_0x1d08bb;return _0x1d08bb['getFields']();}return null;})[_0xd46e('0x27')](function(_0x8c6ed1){if(_0x8c6ed1){if(!_0x8c6ed1['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xd46e('0x6f'),0x193);}_0x417068=_0x8c6ed1;return db[_0xd46e('0x89')]['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3a13f8){if(_0x3a13f8){_0x52e73e=_['keyBy'](_0x3a13f8,'id');var _0x5a8661;var _0x157fb0=squel[_0xd46e('0x8a')]();_0x157fb0[_0xd46e('0x71')](_0x3a44da[_0xd46e('0x72')]);for(var _0x50750f=0x0;_0x50750f<_0x417068['length'];_0x50750f+=0x1){_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x73')]?_0x52e73e[_0x417068[_0x50750f][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x417068[_0x50750f][_0xd46e('0x6a')];_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0x368742[_0x417068[_0x50750f][_0xd46e('0x75')]],'%s',_0x5a8661):_0x5a8661;_0x5a8661=_0x417068[_0x50750f]['format']?_[_0xd46e('0x76')](_0x285cf8[_0x417068[_0x50750f][_0xd46e('0x77')]],'%s',_0x5a8661):_0x5a8661;if(_0x417068[_0x50750f]['groupBy']){_0x157fb0[_0xd46e('0x69')](_0x5a8661);}_0x417068[_0x50750f][_0xd46e('0x79')]&&_0x157fb0[_0xd46e('0x7a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x157fb0[_0xd46e('0x6a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x7b')]||_0x5a8661);}if(_0x3a44da[_0xd46e('0x7c')]){_0x3a44da['joins']=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x7c')]);for(var _0x3c819b=0x0;_0x3c819b<_0x3a44da[_0xd46e('0x7c')][_0xd46e('0x3d')];_0x3c819b+=0x1){if(_0x3a44da['joins'][_0x3c819b][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x20cc4c,_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')])&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7d')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']){_0x157fb0[_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')]](_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3a44da[_0xd46e('0x72')],_0x3a44da['joins'][_0x3c819b][_0xd46e('0x7d')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']));}}}if(_0x3a44da[_0xd46e('0x81')]){_0x3a44da[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x81')]);_0x157fb0[_0xd46e('0x41')](_0x44322f(_0x3a44da[_0xd46e('0x81')][_0xd46e('0x69')]));}_0xe729b6=_0x157fb0[_0xd46e('0x83')]();_0x157fb0[_0xd46e('0x1f')](_0x1610bd);_0x157fb0['offset'](0x0);logger['debug'](_0xd46e('0xa4'),_0x157fb0['toString']());return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x157fb0[_0xd46e('0x84')](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](function(){return{'sql':_0xe729b6['toString']()};})['then'](respondWithResult(_0x537c73,null))[_0xd46e('0x4a')](handleError(_0x537c73,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 4e1ca35..1a6c509 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 _0x3298=['bluebird','request-promise','path','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger','moment'];(function(_0x43839e,_0x54d3c7){var _0x3d538a=function(_0x57013e){while(--_0x57013e){_0x43839e['push'](_0x43839e['shift']());}};_0x3d538a(++_0x54d3c7);}(_0x3298,0x1b5));var _0x8329=function(_0x3f90ee,_0xbaa884){_0x3f90ee=_0x3f90ee-0x0;var _0x1eab5a=_0x3298[_0x3f90ee];return _0x1eab5a;};'use strict';var _=require(_0x8329('0x0'));var util=require('util');var logger=require(_0x8329('0x1'))('api');var moment=require(_0x8329('0x2'));var BPromise=require(_0x8329('0x3'));var rp=require(_0x8329('0x4'));var fs=require('fs');var path=require(_0x8329('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8329('0x6'));module[_0x8329('0x7')]=function(_0x513d96,_0x25d0af){return _0x513d96[_0x8329('0x8')](_0x8329('0x9'),attributes,{'tableName':_0x8329('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x72a0=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','analytics_default_reports','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x49d4c1,_0x548f27){var _0x4d43db=function(_0x933e46){while(--_0x933e46){_0x49d4c1['push'](_0x49d4c1['shift']());}};_0x4d43db(++_0x548f27);}(_0x72a0,0xb5));var _0x072a=function(_0x4a6682,_0x98e04d){_0x4a6682=_0x4a6682-0x0;var _0x1a1e62=_0x72a0[_0x4a6682];return _0x1a1e62;};'use strict';var _=require(_0x072a('0x0'));var util=require(_0x072a('0x1'));var logger=require(_0x072a('0x2'))('api');var moment=require(_0x072a('0x3'));var BPromise=require('bluebird');var rp=require(_0x072a('0x4'));var fs=require('fs');var path=require(_0x072a('0x5'));var rimraf=require(_0x072a('0x6'));var config=require(_0x072a('0x7'));var attributes=require(_0x072a('0x8'));module[_0x072a('0x9')]=function(_0x14bdd0,_0x204c8f){return _0x14bdd0['define']('AnalyticDefaultReport',attributes,{'tableName':_0x072a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index e75e7a8..b96119f 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 _0xdcd9=['AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x31f0a7,_0x40a73a){var _0xfe717d=function(_0x514262){while(--_0x514262){_0x31f0a7['push'](_0x31f0a7['shift']());}};_0xfe717d(++_0x40a73a);}(_0xdcd9,0x125));var _0x9dcd=function(_0x47cd2a,_0x166558){_0x47cd2a=_0x47cd2a-0x0;var _0x245e4f=_0xdcd9[_0x47cd2a];return _0x245e4f;};'use strict';var _=require(_0x9dcd('0x0'));var util=require('util');var moment=require(_0x9dcd('0x1'));var BPromise=require(_0x9dcd('0x2'));var rs=require(_0x9dcd('0x3'));var fs=require('fs');var Redis=require(_0x9dcd('0x4'));var db=require(_0x9dcd('0x5'))['db'];var utils=require(_0x9dcd('0x6'));var logger=require(_0x9dcd('0x7'))(_0x9dcd('0x8'));var config=require(_0x9dcd('0x9'));var jayson=require(_0x9dcd('0xa'));var client=jayson[_0x9dcd('0xb')][_0x9dcd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x46d905,_0x40da01,_0x3a2f6d){return new BPromise(function(_0x3f9e73,_0x487155){return client[_0x9dcd('0xd')](_0x46d905,_0x3a2f6d)[_0x9dcd('0xe')](function(_0x166ddf){logger[_0x9dcd('0xf')](_0x9dcd('0x10'),_0x40da01,_0x9dcd('0x11'));logger[_0x9dcd('0x12')](_0x9dcd('0x13'),_0x40da01,_0x9dcd('0x11'),JSON[_0x9dcd('0x14')](_0x166ddf));if(_0x166ddf[_0x9dcd('0x15')]){if(_0x166ddf[_0x9dcd('0x15')][_0x9dcd('0x16')]===0x1f4){logger[_0x9dcd('0x15')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x40da01,_0x166ddf[_0x9dcd('0x15')][_0x9dcd('0x17')]);return _0x487155(_0x166ddf[_0x9dcd('0x15')]['message']);}logger[_0x9dcd('0x15')](_0x9dcd('0x10'),_0x40da01,_0x166ddf['error'][_0x9dcd('0x17')]);return _0x3f9e73(_0x166ddf[_0x9dcd('0x15')][_0x9dcd('0x17')]);}else{logger['info'](_0x9dcd('0x10'),_0x40da01,_0x9dcd('0x11'));_0x3f9e73(_0x166ddf[_0x9dcd('0x18')]['message']);}})[_0x9dcd('0x19')](function(_0x1283f1){logger[_0x9dcd('0x15')](_0x9dcd('0x10'),_0x40da01,_0x1283f1);_0x487155(_0x1283f1);});});}
\ No newline at end of file
+var _0xf21a=['error','code','message','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x348a38,_0x5295d5){var _0x4edc31=function(_0xeef470){while(--_0xeef470){_0x348a38['push'](_0x348a38['shift']());}};_0x4edc31(++_0x5295d5);}(_0xf21a,0x146));var _0xaf21=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xf21a[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require(_0xaf21('0x0'));var moment=require(_0xaf21('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf21('0x2'));var db=require(_0xaf21('0x3'))['db'];var utils=require(_0xaf21('0x4'));var logger=require(_0xaf21('0x5'))(_0xaf21('0x6'));var config=require('../../config/environment');var jayson=require(_0xaf21('0x7'));var client=jayson[_0xaf21('0x8')][_0xaf21('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37ca86,_0x25685c,_0x44f780){return new BPromise(function(_0xb86ef1,_0x452d01){return client['request'](_0x37ca86,_0x44f780)[_0xaf21('0xa')](function(_0x335f39){logger[_0xaf21('0xb')](_0xaf21('0xc'),_0x25685c,'request\x20sent');logger[_0xaf21('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x25685c,_0xaf21('0xe'),JSON[_0xaf21('0xf')](_0x335f39));if(_0x335f39[_0xaf21('0x10')]){if(_0x335f39[_0xaf21('0x10')][_0xaf21('0x11')]===0x1f4){logger[_0xaf21('0x10')](_0xaf21('0xc'),_0x25685c,_0x335f39[_0xaf21('0x10')]['message']);return _0x452d01(_0x335f39['error'][_0xaf21('0x12')]);}logger[_0xaf21('0x10')](_0xaf21('0xc'),_0x25685c,_0x335f39['error'][_0xaf21('0x12')]);return _0xb86ef1(_0x335f39[_0xaf21('0x10')]['message']);}else{logger['info'](_0xaf21('0xc'),_0x25685c,_0xaf21('0xe'));_0xb86ef1(_0x335f39['result']['message']);}})['catch'](function(_0x1b9103){logger[_0xaf21('0x10')](_0xaf21('0xc'),_0x25685c,_0x1b9103);_0x452d01(_0x1b9103);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 7017472..682d4db 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 _0x6b06=['show','/:id/preview','preview','/:id/run','run','/:id/query','post','create','update','delete','/:id','exports','multer','util','path','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index'];(function(_0x4d0df6,_0x4634f3){var _0x4e2615=function(_0x5285e2){while(--_0x5285e2){_0x4d0df6['push'](_0x4d0df6['shift']());}};_0x4e2615(++_0x4634f3);}(_0x6b06,0xd4));var _0x66b0=function(_0x478b35,_0x49dced){_0x478b35=_0x478b35-0x0;var _0x542c50=_0x6b06[_0x478b35];return _0x542c50;};'use strict';var multer=require(_0x66b0('0x0'));var util=require(_0x66b0('0x1'));var path=require(_0x66b0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x66b0('0x3'));var controller=require(_0x66b0('0x4'));router[_0x66b0('0x5')]('/',auth[_0x66b0('0x6')](),controller[_0x66b0('0x7')]);router[_0x66b0('0x5')]('/:id',auth[_0x66b0('0x6')](),controller[_0x66b0('0x8')]);router[_0x66b0('0x5')](_0x66b0('0x9'),auth['isAuthenticated'](),controller[_0x66b0('0xa')]);router[_0x66b0('0x5')](_0x66b0('0xb'),auth[_0x66b0('0x6')](),controller[_0x66b0('0xc')]);router[_0x66b0('0x5')](_0x66b0('0xd'),auth[_0x66b0('0x6')](),controller['query']);router[_0x66b0('0xe')]('/',auth['isAuthenticated'](),controller[_0x66b0('0xf')]);router['put']('/:id',auth[_0x66b0('0x6')](),controller[_0x66b0('0x10')]);router[_0x66b0('0x11')](_0x66b0('0x12'),auth[_0x66b0('0x6')](),controller['destroy']);module[_0x66b0('0x13')]=router;
\ No newline at end of file
+var _0x4eb3=['post','create','delete','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','/:id','get','/:id/preview','preview','/:id/run','query'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x4eb3,0x17f));var _0x34eb=function(_0x3c059c,_0x2dc0cb){_0x3c059c=_0x3c059c-0x0;var _0x1323e4=_0x4eb3[_0x3c059c];return _0x1323e4;};'use strict';var multer=require(_0x34eb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x34eb('0x1'));var express=require('express');var router=express[_0x34eb('0x2')]();var fs_extra=require(_0x34eb('0x3'));var auth=require(_0x34eb('0x4'));var interaction=require(_0x34eb('0x5'));var config=require(_0x34eb('0x6'));var controller=require(_0x34eb('0x7'));router['get']('/',auth[_0x34eb('0x8')](),controller[_0x34eb('0x9')]);router['get'](_0x34eb('0xa'),auth[_0x34eb('0x8')](),controller['show']);router[_0x34eb('0xb')](_0x34eb('0xc'),auth[_0x34eb('0x8')](),controller[_0x34eb('0xd')]);router[_0x34eb('0xb')](_0x34eb('0xe'),auth[_0x34eb('0x8')](),controller['run']);router[_0x34eb('0xb')]('/:id/query',auth[_0x34eb('0x8')](),controller[_0x34eb('0xf')]);router[_0x34eb('0x10')]('/',auth[_0x34eb('0x8')](),controller[_0x34eb('0x11')]);router['put']('/:id',auth[_0x34eb('0x8')](),controller['update']);router[_0x34eb('0x12')](_0x34eb('0xa'),auth[_0x34eb('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index c8981c8..e9a732a 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 _0x7de2=['pdf','xlsx','DATE','Loading','manual','scheduled','INTEGER','sequelize','exports','STRING','ENUM','csv'];(function(_0x496fe4,_0x272d02){var _0x52729b=function(_0x581515){while(--_0x581515){_0x496fe4['push'](_0x496fe4['shift']());}};_0x52729b(++_0x272d02);}(_0x7de2,0xaf));var _0x27de=function(_0x473898,_0x13fe84){_0x473898=_0x473898-0x0;var _0x3d9a17=_0x7de2[_0x473898];return _0x3d9a17;};'use strict';var Sequelize=require(_0x27de('0x0'));var moment=require('moment');module[_0x27de('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x27de('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x27de('0x3')](_0x27de('0x4'),_0x27de('0x5'),_0x27de('0x6')),'allowNull':![],'defaultValue':_0x27de('0x4')},'savename':{'type':Sequelize[_0x27de('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x27de('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x27de('0x2')],'defaultValue':_0x27de('0x8')},'type':{'type':Sequelize[_0x27de('0x3')](_0x27de('0x9'),_0x27de('0xa')),'allowNull':![],'defaultValue':_0x27de('0x9')},'reportId':{'type':Sequelize[_0x27de('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x27de('0x2')]}};
\ No newline at end of file
+var _0xed62=['sequelize','exports','STRING','ENUM','csv','pdf','DATE','manual','scheduled','UNSIGNED'];(function(_0x34f9a6,_0x4bf60b){var _0x5a94a2=function(_0x12e12a){while(--_0x12e12a){_0x34f9a6['push'](_0x34f9a6['shift']());}};_0x5a94a2(++_0x4bf60b);}(_0xed62,0xc8));var _0x2ed6=function(_0x23c549,_0x2e12c5){_0x23c549=_0x23c549-0x0;var _0x35e1b7=_0xed62[_0x23c549];return _0x35e1b7;};'use strict';var Sequelize=require(_0x2ed6('0x0'));var moment=require('moment');module[_0x2ed6('0x1')]={'name':{'type':Sequelize[_0x2ed6('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x2ed6('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x2ed6('0x3')](_0x2ed6('0x4'),_0x2ed6('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x2ed6('0x4')},'savename':{'type':Sequelize[_0x2ed6('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x2ed6('0x6')]},'endDate':{'type':Sequelize[_0x2ed6('0x6')]},'status':{'type':Sequelize[_0x2ed6('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x2ed6('0x3')](_0x2ed6('0x7'),_0x2ed6('0x8')),'allowNull':![],'defaultValue':_0x2ed6('0x7')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x2ed6('0x9')]},'reportType':{'type':Sequelize[_0x2ed6('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index a42ec79..d274717 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 _0x7ecd=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','find','create','body','get','user','ExtractedReports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','save','update','then','destroy','UserProfileResource','error','stack','name','AnalyticExtractedReport','rawAttributes','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x54cd0b,_0x182ab9){var _0x2dbfb7=function(_0x41d47e){while(--_0x41d47e){_0x54cd0b['push'](_0x54cd0b['shift']());}};_0x2dbfb7(++_0x182ab9);}(_0x7ecd,0x87));var _0xd7ec=function(_0x3526d1,_0x4f18fa){_0x3526d1=_0x3526d1-0x0;var _0x32442f=_0x7ecd[_0x3526d1];return _0x32442f;};'use strict';var emlformat=require(_0xd7ec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd7ec('0x1'));var jsonpatch=require(_0xd7ec('0x2'));var rp=require('request-promise');var moment=require(_0xd7ec('0x3'));var BPromise=require(_0xd7ec('0x4'));var Mustache=require('mustache');var util=require(_0xd7ec('0x5'));var path=require(_0xd7ec('0x6'));var sox=require(_0xd7ec('0x7'));var csv=require('to-csv');var ejs=require(_0xd7ec('0x8'));var fs=require('fs');var fs_extra=require(_0xd7ec('0x9'));var _=require(_0xd7ec('0xa'));var squel=require(_0xd7ec('0xb'));var crypto=require(_0xd7ec('0xc'));var jsforce=require(_0xd7ec('0xd'));var deskjs=require(_0xd7ec('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd7ec('0xf'));var Papa=require(_0xd7ec('0x10'));var Redis=require(_0xd7ec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd7ec('0x12'));var as=require(_0xd7ec('0x13'));var hardwareService=require(_0xd7ec('0x14'));var logger=require(_0xd7ec('0x15'))(_0xd7ec('0x16'));var utils=require(_0xd7ec('0x17'));var config=require(_0xd7ec('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd7ec('0x19'))['db'];function respondWithStatusCode(_0x360aef,_0x2f6c19){_0x2f6c19=_0x2f6c19||0xcc;return function(_0x56e446){if(_0x56e446){return _0x360aef[_0xd7ec('0x1a')](_0x2f6c19);}return _0x360aef[_0xd7ec('0x1b')](_0x2f6c19)[_0xd7ec('0x1c')]();};}function respondWithResult(_0xaa461b,_0x2eaa92){_0x2eaa92=_0x2eaa92||0xc8;return function(_0x36144d){if(_0x36144d){return _0xaa461b[_0xd7ec('0x1b')](_0x2eaa92)[_0xd7ec('0x1d')](_0x36144d);}};}function respondWithFilteredResult(_0x354bd5,_0x2135dc){return function(_0xba1ed2){if(_0xba1ed2){var _0x4180e3=typeof _0x2135dc['offset']==='undefined'&&typeof _0x2135dc[_0xd7ec('0x1e')]===_0xd7ec('0x1f');var _0x4aac9a=_0xba1ed2[_0xd7ec('0x20')];var _0x22f5e9=_0x4180e3?0x0:_0x2135dc[_0xd7ec('0x21')];var _0x8bddc0=_0x4180e3?_0xba1ed2[_0xd7ec('0x20')]:_0x2135dc['offset']+_0x2135dc[_0xd7ec('0x1e')];var _0x3bb6ff;if(_0x8bddc0>=_0x4aac9a){_0x8bddc0=_0x4aac9a;_0x3bb6ff=0xc8;}else{_0x3bb6ff=0xce;}_0x354bd5[_0xd7ec('0x1b')](_0x3bb6ff);return _0x354bd5['set'](_0xd7ec('0x22'),_0x22f5e9+'-'+_0x8bddc0+'/'+_0x4aac9a)['json'](_0xba1ed2);}return null;};}function patchUpdates(_0x594bd3){return function(_0x5528bb){try{jsonpatch[_0xd7ec('0x23')](_0x5528bb,_0x594bd3,!![]);}catch(_0xd5b339){return BPromise['reject'](_0xd5b339);}return _0x5528bb[_0xd7ec('0x24')]();};}function saveUpdates(_0x49b05f,_0x3df27d){return function(_0x255189){if(_0x255189){return _0x255189[_0xd7ec('0x25')](_0x49b05f)[_0xd7ec('0x26')](function(_0x28d4d1){return _0x28d4d1;});}return null;};}function removeEntity(_0x3e4602,_0x321978){return function(_0x4c98bf){if(_0x4c98bf){return _0x4c98bf[_0xd7ec('0x27')]()[_0xd7ec('0x26')](function(){var _0x4f2a13=_0x4c98bf['get']({'plain':!![]});var _0xe437b9='ExtractedReports';return db[_0xd7ec('0x28')][_0xd7ec('0x27')]({'where':{'type':_0xe437b9,'resourceId':_0x4f2a13['id']}})['then'](function(){return _0x4c98bf;});})['then'](function(){_0x3e4602['status'](0xcc)[_0xd7ec('0x1c')]();});}};}function handleEntityNotFound(_0x1eb63f,_0x323044){return function(_0x2fe22d){if(!_0x2fe22d){_0x1eb63f[_0xd7ec('0x1a')](0x194);}return _0x2fe22d;};}function handleError(_0xff84f5,_0x1ad3e1){_0x1ad3e1=_0x1ad3e1||0x1f4;return function(_0x47f543){logger[_0xd7ec('0x29')](_0x47f543[_0xd7ec('0x2a')]);if(_0x47f543[_0xd7ec('0x2b')]){delete _0x47f543[_0xd7ec('0x2b')];}_0xff84f5['status'](_0x1ad3e1)['send'](_0x47f543);};}exports['index']=function(_0x4ef5e5,_0x32733f){var _0x7ec9fd={},_0xb9b7a6={},_0x4934e1={'count':0x0,'rows':[]};var _0x220617=_['map'](db[_0xd7ec('0x2c')][_0xd7ec('0x2d')],function(_0x33556a){return{'name':_0x33556a['fieldName'],'type':_0x33556a[_0xd7ec('0x2e')][_0xd7ec('0x2f')]};});_0xb9b7a6[_0xd7ec('0x30')]=_[_0xd7ec('0x31')](_0x220617,_0xd7ec('0x2b'));_0xb9b7a6[_0xd7ec('0x32')]=_['keys'](_0x4ef5e5[_0xd7ec('0x32')]);_0xb9b7a6[_0xd7ec('0x33')]=_[_0xd7ec('0x34')](_0xb9b7a6[_0xd7ec('0x30')],_0xb9b7a6[_0xd7ec('0x32')]);_0x7ec9fd['attributes']=_[_0xd7ec('0x34')](_0xb9b7a6[_0xd7ec('0x30')],qs[_0xd7ec('0x35')](_0x4ef5e5[_0xd7ec('0x32')][_0xd7ec('0x35')]));_0x7ec9fd[_0xd7ec('0x36')]=_0x7ec9fd[_0xd7ec('0x36')][_0xd7ec('0x37')]?_0x7ec9fd[_0xd7ec('0x36')]:_0xb9b7a6['model'];if(!_0x4ef5e5['query'][_0xd7ec('0x38')](_0xd7ec('0x39'))){_0x7ec9fd[_0xd7ec('0x1e')]=qs[_0xd7ec('0x1e')](_0x4ef5e5['query'][_0xd7ec('0x1e')]);_0x7ec9fd[_0xd7ec('0x21')]=qs['offset'](_0x4ef5e5['query'][_0xd7ec('0x21')]);}_0x7ec9fd[_0xd7ec('0x3a')]=qs['sort'](_0x4ef5e5['query'][_0xd7ec('0x3b')]);_0x7ec9fd[_0xd7ec('0x3c')]=qs[_0xd7ec('0x33')](_[_0xd7ec('0x3d')](_0x4ef5e5[_0xd7ec('0x32')],_0xb9b7a6[_0xd7ec('0x33')]),_0x220617);if(_0x4ef5e5[_0xd7ec('0x32')][_0xd7ec('0x3e')]){_0x7ec9fd[_0xd7ec('0x3c')]=_[_0xd7ec('0x3f')](_0x7ec9fd[_0xd7ec('0x3c')],{'$or':_['map'](_0x220617,function(_0x45dc93){if(_0x45dc93[_0xd7ec('0x2e')]!==_0xd7ec('0x40')){var _0x418c35={};_0x418c35[_0x45dc93[_0xd7ec('0x2b')]]={'$like':'%'+_0x4ef5e5['query'][_0xd7ec('0x3e')]+'%'};return _0x418c35;}})});}_0x7ec9fd=_[_0xd7ec('0x3f')]({},_0x7ec9fd,_0x4ef5e5[_0xd7ec('0x41')]);var _0x5c3bbe={'where':_0x7ec9fd[_0xd7ec('0x3c')]};return db['AnalyticExtractedReport'][_0xd7ec('0x20')](_0x5c3bbe)[_0xd7ec('0x26')](function(_0x4899ec){_0x4934e1['count']=_0x4899ec;if(_0x4ef5e5[_0xd7ec('0x32')]['includeAll']){_0x7ec9fd[_0xd7ec('0x42')]=[{'all':!![]}];}return db[_0xd7ec('0x2c')][_0xd7ec('0x43')](_0x7ec9fd);})[_0xd7ec('0x26')](function(_0x151b60){_0x4934e1[_0xd7ec('0x44')]=_0x151b60;return _0x4934e1;})[_0xd7ec('0x26')](respondWithFilteredResult(_0x32733f,_0x7ec9fd))[_0xd7ec('0x45')](handleError(_0x32733f,null));};exports[_0xd7ec('0x46')]=function(_0x4813f2,_0x356d08){var _0x350484={'raw':!![],'where':{'id':_0x4813f2['params']['id']}},_0x3f144e={};_0x3f144e[_0xd7ec('0x30')]=_['keys'](db[_0xd7ec('0x2c')]['rawAttributes']);_0x3f144e[_0xd7ec('0x32')]=_[_0xd7ec('0x47')](_0x4813f2[_0xd7ec('0x32')]);_0x3f144e[_0xd7ec('0x33')]=_[_0xd7ec('0x34')](_0x3f144e[_0xd7ec('0x30')],_0x3f144e[_0xd7ec('0x32')]);_0x350484[_0xd7ec('0x36')]=_[_0xd7ec('0x34')](_0x3f144e['model'],qs[_0xd7ec('0x35')](_0x4813f2[_0xd7ec('0x32')][_0xd7ec('0x35')]));_0x350484[_0xd7ec('0x36')]=_0x350484['attributes']['length']?_0x350484[_0xd7ec('0x36')]:_0x3f144e['model'];if(_0x4813f2['query']['includeAll']){_0x350484[_0xd7ec('0x42')]=[{'all':!![]}];}_0x350484=_[_0xd7ec('0x3f')]({},_0x350484,_0x4813f2['options']);return db['AnalyticExtractedReport'][_0xd7ec('0x48')](_0x350484)[_0xd7ec('0x26')](handleEntityNotFound(_0x356d08,null))[_0xd7ec('0x26')](respondWithResult(_0x356d08,null))[_0xd7ec('0x45')](handleError(_0x356d08,null));};exports[_0xd7ec('0x49')]=function(_0xc2c6ce,_0x2eb690){return db[_0xd7ec('0x2c')]['create'](_0xc2c6ce[_0xd7ec('0x4a')],{})[_0xd7ec('0x26')](function(_0x6229d4){var _0xbd2d54=_0xc2c6ce['user'][_0xd7ec('0x4b')]({'plain':!![]});if(!_0xbd2d54)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbd2d54['role']===_0xd7ec('0x4c')){var _0x37ba9d=_0x6229d4[_0xd7ec('0x4b')]({'plain':!![]});var _0x2cb584=_0xd7ec('0x4d');return db[_0xd7ec('0x4e')][_0xd7ec('0x48')]({'where':{'name':_0x2cb584,'userProfileId':_0xbd2d54['userProfileId']},'raw':!![]})[_0xd7ec('0x26')](function(_0x49165d){if(_0x49165d&&_0x49165d[_0xd7ec('0x4f')]===0x0){return db[_0xd7ec('0x28')][_0xd7ec('0x49')]({'name':_0x37ba9d[_0xd7ec('0x2b')],'resourceId':_0x37ba9d['id'],'type':_0x49165d[_0xd7ec('0x2b')],'sectionId':_0x49165d['id']},{})['then'](function(){return _0x6229d4;});}else{return _0x6229d4;}})['catch'](function(_0xc370fd){logger[_0xd7ec('0x29')](_0xd7ec('0x50'),_0xc370fd);throw _0xc370fd;});}return _0x6229d4;})[_0xd7ec('0x26')](respondWithResult(_0x2eb690,0xc9))[_0xd7ec('0x45')](handleError(_0x2eb690,null));};exports[_0xd7ec('0x25')]=function(_0x190c4f,_0x548a16){if(_0x190c4f[_0xd7ec('0x4a')]['id']){delete _0x190c4f[_0xd7ec('0x4a')]['id'];}return db[_0xd7ec('0x2c')][_0xd7ec('0x48')]({'where':{'id':_0x190c4f[_0xd7ec('0x51')]['id']}})[_0xd7ec('0x26')](handleEntityNotFound(_0x548a16,null))[_0xd7ec('0x26')](saveUpdates(_0x190c4f[_0xd7ec('0x4a')],null))['then'](respondWithResult(_0x548a16,null))[_0xd7ec('0x45')](handleError(_0x548a16,null));};exports['destroy']=function(_0xfadeae,_0x9c108b){return db[_0xd7ec('0x2c')][_0xd7ec('0x48')]({'where':{'id':_0xfadeae[_0xd7ec('0x51')]['id']}})[_0xd7ec('0x26')](handleEntityNotFound(_0x9c108b,null))[_0xd7ec('0x26')](removeEntity(_0x9c108b,null))[_0xd7ec('0x45')](handleError(_0x9c108b,null));};exports[_0xd7ec('0x52')]=function(_0x29b561,_0x19a8c8,_0x27cb7a){return db[_0xd7ec('0x2c')][_0xd7ec('0x48')]({'where':{'id':_0x29b561[_0xd7ec('0x51')]['id']},'attributes':[_0xd7ec('0x2b'),_0xd7ec('0x53'),_0xd7ec('0x54'),_0xd7ec('0x55')],'raw':!![]})[_0xd7ec('0x26')](handleEntityNotFound(_0x19a8c8,null))['then'](function(_0x5085bf){if(_0x5085bf){if(!fs[_0xd7ec('0x56')](path[_0xd7ec('0x57')](config[_0xd7ec('0x58')],_0xd7ec('0x59'),_0x5085bf[_0xd7ec('0x54')]))){throw new db[(_0xd7ec('0x5a'))]['ValidationError'](_0xd7ec('0x5b'));}if(_0x29b561['query'][_0xd7ec('0x5c')]){return _0x19a8c8[_0xd7ec('0x1a')](0xc8);}return _0x19a8c8[_0xd7ec('0x52')](path[_0xd7ec('0x57')](config[_0xd7ec('0x58')],_0xd7ec('0x59'),_0x5085bf[_0xd7ec('0x54')]),util[_0xd7ec('0x5d')](_0xd7ec('0x5e'),_0x5085bf[_0xd7ec('0x53')]||_0x5085bf[_0xd7ec('0x2b')],_0x5085bf['output'][_0xd7ec('0x5f')]()));}})[_0xd7ec('0x45')](handleError(_0x19a8c8,null));};
\ No newline at end of file
+var _0xb2c0=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','apply','save','then','get','ExtractedReports','destroy','error','name','index','rawAttributes','fieldName','type','model','map','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticExtractedReport','includeAll','rows','catch','show','params','intersection','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','basename','toLowerCase','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox'];(function(_0xe93ec7,_0x1cbb61){var _0x3d36ed=function(_0x34a909){while(--_0x34a909){_0xe93ec7['push'](_0xe93ec7['shift']());}};_0x3d36ed(++_0x1cbb61);}(_0xb2c0,0x16f));var _0x0b2c=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xb2c0[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0x0b2c('0x0'));var rimraf=require(_0x0b2c('0x1'));var zipdir=require(_0x0b2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0b2c('0x3'));var moment=require(_0x0b2c('0x4'));var BPromise=require(_0x0b2c('0x5'));var Mustache=require('mustache');var util=require(_0x0b2c('0x6'));var path=require(_0x0b2c('0x7'));var sox=require(_0x0b2c('0x8'));var csv=require(_0x0b2c('0x9'));var ejs=require(_0x0b2c('0xa'));var fs=require('fs');var fs_extra=require(_0x0b2c('0xb'));var _=require(_0x0b2c('0xc'));var squel=require(_0x0b2c('0xd'));var crypto=require(_0x0b2c('0xe'));var jsforce=require(_0x0b2c('0xf'));var deskjs=require(_0x0b2c('0x10'));var toCsv=require(_0x0b2c('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0b2c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0b2c('0x12'));var hardwareService=require(_0x0b2c('0x13'));var logger=require('../../config/logger')(_0x0b2c('0x14'));var utils=require(_0x0b2c('0x15'));var config=require(_0x0b2c('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x120314,_0x22892b){_0x22892b=_0x22892b||0xcc;return function(_0x2cafda){if(_0x2cafda){return _0x120314[_0x0b2c('0x17')](_0x22892b);}return _0x120314[_0x0b2c('0x18')](_0x22892b)[_0x0b2c('0x19')]();};}function respondWithResult(_0x27d0ac,_0x408143){_0x408143=_0x408143||0xc8;return function(_0x2f7051){if(_0x2f7051){return _0x27d0ac['status'](_0x408143)[_0x0b2c('0x1a')](_0x2f7051);}};}function respondWithFilteredResult(_0x3005c1,_0x73f60d){return function(_0x242cfb){if(_0x242cfb){var _0xbd48e3=typeof _0x73f60d[_0x0b2c('0x1b')]==='undefined'&&typeof _0x73f60d[_0x0b2c('0x1c')]===_0x0b2c('0x1d');var _0x469a77=_0x242cfb[_0x0b2c('0x1e')];var _0x3034eb=_0xbd48e3?0x0:_0x73f60d['offset'];var _0x48594a=_0xbd48e3?_0x242cfb['count']:_0x73f60d['offset']+_0x73f60d[_0x0b2c('0x1c')];var _0x24d360;if(_0x48594a>=_0x469a77){_0x48594a=_0x469a77;_0x24d360=0xc8;}else{_0x24d360=0xce;}_0x3005c1[_0x0b2c('0x18')](_0x24d360);return _0x3005c1['set']('Content-Range',_0x3034eb+'-'+_0x48594a+'/'+_0x469a77)[_0x0b2c('0x1a')](_0x242cfb);}return null;};}function patchUpdates(_0x1f9e92){return function(_0x9d0fc0){try{jsonpatch[_0x0b2c('0x1f')](_0x9d0fc0,_0x1f9e92,!![]);}catch(_0x75391f){return BPromise['reject'](_0x75391f);}return _0x9d0fc0[_0x0b2c('0x20')]();};}function saveUpdates(_0xe12453,_0x38ebe6){return function(_0x132ce7){if(_0x132ce7){return _0x132ce7['update'](_0xe12453)['then'](function(_0x27feaa){return _0x27feaa;});}return null;};}function removeEntity(_0x106cdf,_0x4b712b){return function(_0x337093){if(_0x337093){return _0x337093['destroy']()[_0x0b2c('0x21')](function(){var _0x492914=_0x337093[_0x0b2c('0x22')]({'plain':!![]});var _0x38ade3=_0x0b2c('0x23');return db['UserProfileResource'][_0x0b2c('0x24')]({'where':{'type':_0x38ade3,'resourceId':_0x492914['id']}})['then'](function(){return _0x337093;});})[_0x0b2c('0x21')](function(){_0x106cdf[_0x0b2c('0x18')](0xcc)[_0x0b2c('0x19')]();});}};}function handleEntityNotFound(_0x5f064f,_0x915b25){return function(_0x4a1e15){if(!_0x4a1e15){_0x5f064f[_0x0b2c('0x17')](0x194);}return _0x4a1e15;};}function handleError(_0x190cc8,_0x2b5e5f){_0x2b5e5f=_0x2b5e5f||0x1f4;return function(_0x189d0f){logger[_0x0b2c('0x25')](_0x189d0f['stack']);if(_0x189d0f['name']){delete _0x189d0f[_0x0b2c('0x26')];}_0x190cc8[_0x0b2c('0x18')](_0x2b5e5f)['send'](_0x189d0f);};}exports[_0x0b2c('0x27')]=function(_0x4e696a,_0x50b63d){var _0xcd5f54={},_0x1c6870={},_0x1bdc6f={'count':0x0,'rows':[]};var _0x5bda99=_['map'](db['AnalyticExtractedReport'][_0x0b2c('0x28')],function(_0x25ebde){return{'name':_0x25ebde[_0x0b2c('0x29')],'type':_0x25ebde[_0x0b2c('0x2a')]['key']};});_0x1c6870[_0x0b2c('0x2b')]=_[_0x0b2c('0x2c')](_0x5bda99,_0x0b2c('0x26'));_0x1c6870[_0x0b2c('0x2d')]=_[_0x0b2c('0x2e')](_0x4e696a['query']);_0x1c6870[_0x0b2c('0x2f')]=_['intersection'](_0x1c6870['model'],_0x1c6870[_0x0b2c('0x2d')]);_0xcd5f54['attributes']=_['intersection'](_0x1c6870[_0x0b2c('0x2b')],qs[_0x0b2c('0x30')](_0x4e696a[_0x0b2c('0x2d')]['fields']));_0xcd5f54[_0x0b2c('0x31')]=_0xcd5f54['attributes'][_0x0b2c('0x32')]?_0xcd5f54[_0x0b2c('0x31')]:_0x1c6870[_0x0b2c('0x2b')];if(!_0x4e696a[_0x0b2c('0x2d')][_0x0b2c('0x33')](_0x0b2c('0x34'))){_0xcd5f54[_0x0b2c('0x1c')]=qs['limit'](_0x4e696a['query'][_0x0b2c('0x1c')]);_0xcd5f54[_0x0b2c('0x1b')]=qs['offset'](_0x4e696a['query'][_0x0b2c('0x1b')]);}_0xcd5f54['order']=qs[_0x0b2c('0x35')](_0x4e696a[_0x0b2c('0x2d')]['sort']);_0xcd5f54[_0x0b2c('0x36')]=qs[_0x0b2c('0x2f')](_[_0x0b2c('0x37')](_0x4e696a['query'],_0x1c6870[_0x0b2c('0x2f')]),_0x5bda99);if(_0x4e696a['query'][_0x0b2c('0x38')]){_0xcd5f54[_0x0b2c('0x36')]=_[_0x0b2c('0x39')](_0xcd5f54[_0x0b2c('0x36')],{'$or':_[_0x0b2c('0x2c')](_0x5bda99,function(_0x453862){if(_0x453862[_0x0b2c('0x2a')]!==_0x0b2c('0x3a')){var _0x347c88={};_0x347c88[_0x453862[_0x0b2c('0x26')]]={'$like':'%'+_0x4e696a[_0x0b2c('0x2d')]['filter']+'%'};return _0x347c88;}})});}_0xcd5f54=_['merge']({},_0xcd5f54,_0x4e696a[_0x0b2c('0x3b')]);var _0x5bcdd3={'where':_0xcd5f54['where']};return db[_0x0b2c('0x3c')][_0x0b2c('0x1e')](_0x5bcdd3)['then'](function(_0x29db5d){_0x1bdc6f[_0x0b2c('0x1e')]=_0x29db5d;if(_0x4e696a[_0x0b2c('0x2d')][_0x0b2c('0x3d')]){_0xcd5f54['include']=[{'all':!![]}];}return db[_0x0b2c('0x3c')]['findAll'](_0xcd5f54);})[_0x0b2c('0x21')](function(_0x187aaf){_0x1bdc6f[_0x0b2c('0x3e')]=_0x187aaf;return _0x1bdc6f;})[_0x0b2c('0x21')](respondWithFilteredResult(_0x50b63d,_0xcd5f54))[_0x0b2c('0x3f')](handleError(_0x50b63d,null));};exports[_0x0b2c('0x40')]=function(_0x59c2c1,_0x525526){var _0x1574f1={'raw':!![],'where':{'id':_0x59c2c1[_0x0b2c('0x41')]['id']}},_0x4de976={};_0x4de976[_0x0b2c('0x2b')]=_[_0x0b2c('0x2e')](db[_0x0b2c('0x3c')][_0x0b2c('0x28')]);_0x4de976[_0x0b2c('0x2d')]=_[_0x0b2c('0x2e')](_0x59c2c1[_0x0b2c('0x2d')]);_0x4de976[_0x0b2c('0x2f')]=_[_0x0b2c('0x42')](_0x4de976['model'],_0x4de976[_0x0b2c('0x2d')]);_0x1574f1[_0x0b2c('0x31')]=_[_0x0b2c('0x42')](_0x4de976[_0x0b2c('0x2b')],qs['fields'](_0x59c2c1[_0x0b2c('0x2d')][_0x0b2c('0x30')]));_0x1574f1['attributes']=_0x1574f1['attributes'][_0x0b2c('0x32')]?_0x1574f1[_0x0b2c('0x31')]:_0x4de976['model'];if(_0x59c2c1[_0x0b2c('0x2d')][_0x0b2c('0x3d')]){_0x1574f1[_0x0b2c('0x43')]=[{'all':!![]}];}_0x1574f1=_[_0x0b2c('0x39')]({},_0x1574f1,_0x59c2c1[_0x0b2c('0x3b')]);return db[_0x0b2c('0x3c')][_0x0b2c('0x44')](_0x1574f1)[_0x0b2c('0x21')](handleEntityNotFound(_0x525526,null))[_0x0b2c('0x21')](respondWithResult(_0x525526,null))[_0x0b2c('0x3f')](handleError(_0x525526,null));};exports[_0x0b2c('0x45')]=function(_0xb38752,_0x44d967){return db['AnalyticExtractedReport'][_0x0b2c('0x45')](_0xb38752[_0x0b2c('0x46')],{})[_0x0b2c('0x21')](function(_0x465fd2){var _0x555e65=_0xb38752[_0x0b2c('0x47')][_0x0b2c('0x22')]({'plain':!![]});if(!_0x555e65)throw new Error(_0x0b2c('0x48'));if(_0x555e65[_0x0b2c('0x49')]==='user'){var _0x4d644c=_0x465fd2[_0x0b2c('0x22')]({'plain':!![]});var _0x3f6203=_0x0b2c('0x23');return db[_0x0b2c('0x4a')][_0x0b2c('0x44')]({'where':{'name':_0x3f6203,'userProfileId':_0x555e65[_0x0b2c('0x4b')]},'raw':!![]})['then'](function(_0x238a74){if(_0x238a74&&_0x238a74[_0x0b2c('0x4c')]===0x0){return db[_0x0b2c('0x4d')][_0x0b2c('0x45')]({'name':_0x4d644c[_0x0b2c('0x26')],'resourceId':_0x4d644c['id'],'type':_0x238a74[_0x0b2c('0x26')],'sectionId':_0x238a74['id']},{})[_0x0b2c('0x21')](function(){return _0x465fd2;});}else{return _0x465fd2;}})['catch'](function(_0x65dadb){logger['error'](_0x0b2c('0x4e'),_0x65dadb);throw _0x65dadb;});}return _0x465fd2;})[_0x0b2c('0x21')](respondWithResult(_0x44d967,0xc9))['catch'](handleError(_0x44d967,null));};exports[_0x0b2c('0x4f')]=function(_0x15a1cb,_0x526b4e){if(_0x15a1cb[_0x0b2c('0x46')]['id']){delete _0x15a1cb[_0x0b2c('0x46')]['id'];}return db['AnalyticExtractedReport'][_0x0b2c('0x44')]({'where':{'id':_0x15a1cb[_0x0b2c('0x41')]['id']}})['then'](handleEntityNotFound(_0x526b4e,null))['then'](saveUpdates(_0x15a1cb[_0x0b2c('0x46')],null))[_0x0b2c('0x21')](respondWithResult(_0x526b4e,null))[_0x0b2c('0x3f')](handleError(_0x526b4e,null));};exports[_0x0b2c('0x24')]=function(_0x4d0fe9,_0x1b11ff){return db[_0x0b2c('0x3c')][_0x0b2c('0x44')]({'where':{'id':_0x4d0fe9[_0x0b2c('0x41')]['id']}})['then'](handleEntityNotFound(_0x1b11ff,null))[_0x0b2c('0x21')](removeEntity(_0x1b11ff,null))[_0x0b2c('0x3f')](handleError(_0x1b11ff,null));};exports[_0x0b2c('0x50')]=function(_0x4f7b31,_0x5a1cb9,_0x1ee0d0){return db[_0x0b2c('0x3c')][_0x0b2c('0x44')]({'where':{'id':_0x4f7b31[_0x0b2c('0x41')]['id']},'attributes':[_0x0b2c('0x26'),'basename',_0x0b2c('0x51'),_0x0b2c('0x52')],'raw':!![]})[_0x0b2c('0x21')](handleEntityNotFound(_0x5a1cb9,null))[_0x0b2c('0x21')](function(_0x3c24a8){if(_0x3c24a8){if(!fs[_0x0b2c('0x53')](path[_0x0b2c('0x54')](config[_0x0b2c('0x55')],_0x0b2c('0x56'),_0x3c24a8[_0x0b2c('0x51')]))){throw new db[(_0x0b2c('0x57'))][(_0x0b2c('0x58'))](_0x0b2c('0x59'));}if(_0x4f7b31[_0x0b2c('0x2d')][_0x0b2c('0x5a')]){return _0x5a1cb9[_0x0b2c('0x17')](0xc8);}return _0x5a1cb9[_0x0b2c('0x50')](path['join'](config[_0x0b2c('0x55')],'server/files/reports',_0x3c24a8['savename']),util['format'](_0x0b2c('0x5b'),_0x3c24a8[_0x0b2c('0x5c')]||_0x3c24a8[_0x0b2c('0x26')],_0x3c24a8[_0x0b2c('0x52')][_0x0b2c('0x5d')]()));}})[_0x0b2c('0x3f')](handleError(_0x5a1cb9,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 64ec67f..eef57a6 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 _0x640c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util'];(function(_0x569848,_0x5223da){var _0x247e93=function(_0x1b01ea){while(--_0x1b01ea){_0x569848['push'](_0x569848['shift']());}};_0x247e93(++_0x5223da);}(_0x640c,0x136));var _0xc640=function(_0x31adf9,_0x511868){_0x31adf9=_0x31adf9-0x0;var _0x4412b5=_0x640c[_0x31adf9];return _0x4412b5;};'use strict';var _=require(_0xc640('0x0'));var util=require(_0xc640('0x1'));var logger=require('../../config/logger')(_0xc640('0x2'));var moment=require(_0xc640('0x3'));var BPromise=require(_0xc640('0x4'));var rp=require(_0xc640('0x5'));var fs=require('fs');var path=require(_0xc640('0x6'));var rimraf=require(_0xc640('0x7'));var config=require(_0xc640('0x8'));var attributes=require('./analyticExtractedReport.attributes');module[_0xc640('0x9')]=function(_0x4d0fec,_0x42e81b){return _0x4d0fec[_0xc640('0xa')](_0xc640('0xb'),attributes,{'tableName':_0xc640('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8576=['../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','moment','request-promise','rimraf'];(function(_0x1960c6,_0x5e4732){var _0x2b03d6=function(_0x54702d){while(--_0x54702d){_0x1960c6['push'](_0x1960c6['shift']());}};_0x2b03d6(++_0x5e4732);}(_0x8576,0xc3));var _0x6857=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x8576[_0x4c445a];return _0x2f611c;};'use strict';var _=require(_0x6857('0x0'));var util=require(_0x6857('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6857('0x2'));var BPromise=require('bluebird');var rp=require(_0x6857('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6857('0x4'));var config=require(_0x6857('0x5'));var attributes=require(_0x6857('0x6'));module['exports']=function(_0x447e0c,_0x5f239d){return _0x447e0c[_0x6857('0x7')](_0x6857('0x8'),attributes,{'tableName':_0x6857('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index b795088..ecaa282 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 _0x78b0=['http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x484453,_0x2fb41e){var _0x23106d=function(_0xc42e83){while(--_0xc42e83){_0x484453['push'](_0x484453['shift']());}};_0x23106d(++_0x2fb41e);}(_0x78b0,0x173));var _0x078b=function(_0x1a06d0,_0x2d77e2){_0x1a06d0=_0x1a06d0-0x0;var _0x370e6d=_0x78b0[_0x1a06d0];return _0x370e6d;};'use strict';var _=require(_0x078b('0x0'));var util=require(_0x078b('0x1'));var moment=require('moment');var BPromise=require(_0x078b('0x2'));var rs=require(_0x078b('0x3'));var fs=require('fs');var Redis=require(_0x078b('0x4'));var db=require(_0x078b('0x5'))['db'];var utils=require(_0x078b('0x6'));var logger=require(_0x078b('0x7'))(_0x078b('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x078b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3fa46e,_0x160f91,_0x3c3f1c){return new BPromise(function(_0xbed569,_0x3a9648){return client[_0x078b('0xa')](_0x3fa46e,_0x3c3f1c)[_0x078b('0xb')](function(_0x47948b){logger[_0x078b('0xc')](_0x078b('0xd'),_0x160f91,_0x078b('0xe'));logger['debug'](_0x078b('0xf'),_0x160f91,_0x078b('0xe'),JSON[_0x078b('0x10')](_0x47948b));if(_0x47948b[_0x078b('0x11')]){if(_0x47948b[_0x078b('0x11')]['code']===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x160f91,_0x47948b['error']['message']);return _0x3a9648(_0x47948b[_0x078b('0x11')][_0x078b('0x12')]);}logger[_0x078b('0x11')](_0x078b('0xd'),_0x160f91,_0x47948b[_0x078b('0x11')]['message']);return _0xbed569(_0x47948b[_0x078b('0x11')][_0x078b('0x12')]);}else{logger[_0x078b('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x160f91,_0x078b('0xe'));_0xbed569(_0x47948b['result'][_0x078b('0x12')]);}})[_0x078b('0x13')](function(_0x3f4c68){logger[_0x078b('0x11')](_0x078b('0xd'),_0x160f91,_0x3f4c68);_0x3a9648(_0x3f4c68);});});}
\ No newline at end of file
+var _0x521e=['../../config/environment','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x3c22e0,_0x1dc6ea){var _0x215811=function(_0x1b453c){while(--_0x1b453c){_0x3c22e0['push'](_0x3c22e0['shift']());}};_0x215811(++_0x1dc6ea);}(_0x521e,0x101));var _0xe521=function(_0x396896,_0x393c90){_0x396896=_0x396896-0x0;var _0x2cf0dc=_0x521e[_0x396896];return _0x2cf0dc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe521('0x0'));var BPromise=require(_0xe521('0x1'));var rs=require(_0xe521('0x2'));var fs=require('fs');var Redis=require(_0xe521('0x3'));var db=require(_0xe521('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe521('0x5'))(_0xe521('0x6'));var config=require(_0xe521('0x7'));var jayson=require(_0xe521('0x8'));var client=jayson[_0xe521('0x9')][_0xe521('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x414b24,_0x3e3622,_0x5dda6a){return new BPromise(function(_0x286c0b,_0x58087b){return client[_0xe521('0xb')](_0x414b24,_0x5dda6a)[_0xe521('0xc')](function(_0x25abde){logger['info'](_0xe521('0xd'),_0x3e3622,_0xe521('0xe'));logger[_0xe521('0xf')](_0xe521('0x10'),_0x3e3622,_0xe521('0xe'),JSON[_0xe521('0x11')](_0x25abde));if(_0x25abde['error']){if(_0x25abde[_0xe521('0x12')][_0xe521('0x13')]===0x1f4){logger[_0xe521('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3e3622,_0x25abde[_0xe521('0x12')]['message']);return _0x58087b(_0x25abde[_0xe521('0x12')][_0xe521('0x14')]);}logger['error'](_0xe521('0xd'),_0x3e3622,_0x25abde['error']['message']);return _0x286c0b(_0x25abde[_0xe521('0x12')][_0xe521('0x14')]);}else{logger[_0xe521('0x15')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3e3622,_0xe521('0xe'));_0x286c0b(_0x25abde[_0xe521('0x16')][_0xe521('0x14')]);}})[_0xe521('0x17')](function(_0x3fe959){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x3e3622,_0x3fe959);_0x58087b(_0x3fe959);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index aeb7b74..6c82a7c 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 _0xfe73=['/:id/download','download','post','create','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show'];(function(_0x14e0cb,_0x49da14){var _0x5398ca=function(_0x4167e3){while(--_0x4167e3){_0x14e0cb['push'](_0x14e0cb['shift']());}};_0x5398ca(++_0x49da14);}(_0xfe73,0xc5));var _0x3fe7=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0xfe73[_0x62c958];return _0x57ec61;};'use strict';var multer=require('multer');var util=require(_0x3fe7('0x0'));var path=require('path');var timeout=require(_0x3fe7('0x1'));var express=require(_0x3fe7('0x2'));var router=express[_0x3fe7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3fe7('0x4'));var interaction=require(_0x3fe7('0x5'));var config=require(_0x3fe7('0x6'));var controller=require(_0x3fe7('0x7'));router[_0x3fe7('0x8')]('/',auth[_0x3fe7('0x9')](),controller[_0x3fe7('0xa')]);router[_0x3fe7('0x8')](_0x3fe7('0xb'),auth[_0x3fe7('0x9')](),controller[_0x3fe7('0xc')]);router[_0x3fe7('0x8')](_0x3fe7('0xd'),auth[_0x3fe7('0x9')](),controller[_0x3fe7('0xe')]);router[_0x3fe7('0xf')]('/',auth[_0x3fe7('0x9')](),controller[_0x3fe7('0x10')]);router['put'](_0x3fe7('0xb'),auth[_0x3fe7('0x9')](),controller[_0x3fe7('0x11')]);router[_0x3fe7('0x12')](_0x3fe7('0xb'),auth[_0x3fe7('0x9')](),controller[_0x3fe7('0x13')]);module[_0x3fe7('0x14')]=router;
\ No newline at end of file
+var _0x6695=['index','show','download','post','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x12a969,_0x3ac462){var _0x3e0f11=function(_0x4c3877){while(--_0x4c3877){_0x12a969['push'](_0x12a969['shift']());}};_0x3e0f11(++_0x3ac462);}(_0x6695,0x15c));var _0x5669=function(_0x4ff444,_0x5dbb45){_0x4ff444=_0x4ff444-0x0;var _0x533fbd=_0x6695[_0x4ff444];return _0x533fbd;};'use strict';var multer=require(_0x5669('0x0'));var util=require('util');var path=require(_0x5669('0x1'));var timeout=require('connect-timeout');var express=require(_0x5669('0x2'));var router=express[_0x5669('0x3')]();var fs_extra=require(_0x5669('0x4'));var auth=require(_0x5669('0x5'));var interaction=require(_0x5669('0x6'));var config=require(_0x5669('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0x5669('0x8')]('/',auth['isAuthenticated'](),controller[_0x5669('0x9')]);router[_0x5669('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x5669('0xa')]);router[_0x5669('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x5669('0xb')]);router[_0x5669('0xc')]('/',auth[_0x5669('0xd')](),controller[_0x5669('0xe')]);router[_0x5669('0xf')](_0x5669('0x10'),auth[_0x5669('0xd')](),controller[_0x5669('0x11')]);router[_0x5669('0x12')](_0x5669('0x10'),auth[_0x5669('0xd')](),controller[_0x5669('0x13')]);module[_0x5669('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 18e9dac..161b9ea 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 _0x6803=['STRING','BOOLEAN','exports','TEXT'];(function(_0xee5d2a,_0x534134){var _0x346948=function(_0x458fdf){while(--_0x458fdf){_0xee5d2a['push'](_0xee5d2a['shift']());}};_0x346948(++_0x534134);}(_0x6803,0x1c6));var _0x3680=function(_0x16e1fe,_0x6dd51e){_0x16e1fe=_0x16e1fe-0x0;var _0x56187a=_0x6803[_0x16e1fe];return _0x56187a;};'use strict';var Sequelize=require('sequelize');module[_0x3680('0x0')]={'field':{'type':Sequelize[_0x3680('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x3680('0x2')]},'format':{'type':Sequelize[_0x3680('0x2')]},'groupBy':{'type':Sequelize[_0x3680('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x541c=['sequelize','TEXT','STRING','BOOLEAN'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x541c,0x6c));var _0xc541=function(_0x4496d4,_0x35a23c){_0x4496d4=_0x4496d4-0x0;var _0x549149=_0x541c[_0x4496d4];return _0x549149;};'use strict';var Sequelize=require(_0xc541('0x0'));module['exports']={'field':{'type':Sequelize[_0xc541('0x1')]},'alias':{'type':Sequelize[_0xc541('0x2')]},'function':{'type':Sequelize[_0xc541('0x2')]},'format':{'type':Sequelize[_0xc541('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xc541('0x2')]},'custom':{'type':Sequelize[_0xc541('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 5ba208f..444b41c 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 _0xe706=['VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','intersection','includeAll','find','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','transaction','CustomReportId','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','AnalyticFieldReport','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge'];(function(_0x14b8c7,_0x4839ea){var _0x4bb5a3=function(_0x17cf53){while(--_0x17cf53){_0x14b8c7['push'](_0x14b8c7['shift']());}};_0x4bb5a3(++_0x4839ea);}(_0xe706,0x1e8));var _0x6e70=function(_0x39285d,_0x4e7c32){_0x39285d=_0x39285d-0x0;var _0x5b809b=_0xe706[_0x39285d];return _0x5b809b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6e70('0x0'));var jsonpatch=require(_0x6e70('0x1'));var rp=require(_0x6e70('0x2'));var moment=require('moment');var BPromise=require(_0x6e70('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6e70('0x4'));var sox=require(_0x6e70('0x5'));var csv=require(_0x6e70('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6e70('0x7'));var squel=require(_0x6e70('0x8'));var crypto=require(_0x6e70('0x9'));var jsforce=require(_0x6e70('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6e70('0x6'));var querystring=require(_0x6e70('0xb'));var Papa=require(_0x6e70('0xc'));var Redis=require(_0x6e70('0xd'));var authService=require(_0x6e70('0xe'));var qs=require(_0x6e70('0xf'));var as=require(_0x6e70('0x10'));var hardwareService=require(_0x6e70('0x11'));var logger=require(_0x6e70('0x12'))(_0x6e70('0x13'));var utils=require('../../config/utils');var config=require(_0x6e70('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xdde585,_0x2ba483){_0x2ba483=_0x2ba483||0xcc;return function(_0x3c3d2d){if(_0x3c3d2d){return _0xdde585[_0x6e70('0x15')](_0x2ba483);}return _0xdde585[_0x6e70('0x16')](_0x2ba483)[_0x6e70('0x17')]();};}function respondWithResult(_0x49f976,_0x33be97){_0x33be97=_0x33be97||0xc8;return function(_0x85dbdb){if(_0x85dbdb){return _0x49f976[_0x6e70('0x16')](_0x33be97)[_0x6e70('0x18')](_0x85dbdb);}};}function respondWithFilteredResult(_0x100e70,_0x2b3e66){return function(_0x16992c){if(_0x16992c){var _0x44e4a1=typeof _0x2b3e66[_0x6e70('0x19')]==='undefined'&&typeof _0x2b3e66[_0x6e70('0x1a')]===_0x6e70('0x1b');var _0x1d3b36=_0x16992c[_0x6e70('0x1c')];var _0x978ca1=_0x44e4a1?0x0:_0x2b3e66['offset'];var _0x523da4=_0x44e4a1?_0x16992c[_0x6e70('0x1c')]:_0x2b3e66['offset']+_0x2b3e66[_0x6e70('0x1a')];var _0x249784;if(_0x523da4>=_0x1d3b36){_0x523da4=_0x1d3b36;_0x249784=0xc8;}else{_0x249784=0xce;}_0x100e70[_0x6e70('0x16')](_0x249784);return _0x100e70[_0x6e70('0x1d')](_0x6e70('0x1e'),_0x978ca1+'-'+_0x523da4+'/'+_0x1d3b36)['json'](_0x16992c);}return null;};}function patchUpdates(_0x4cb3f7){return function(_0x191d72){try{jsonpatch[_0x6e70('0x1f')](_0x191d72,_0x4cb3f7,!![]);}catch(_0x212b1b){return BPromise[_0x6e70('0x20')](_0x212b1b);}return _0x191d72[_0x6e70('0x21')]();};}function saveUpdates(_0x4e14be,_0xf79d62){return function(_0x202fdf){if(_0x202fdf){return _0x202fdf[_0x6e70('0x22')](_0x4e14be)[_0x6e70('0x23')](function(_0x5421e3){return _0x5421e3;});}return null;};}function removeEntity(_0x4da378,_0x21d061){return function(_0xc0c57c){if(_0xc0c57c){return _0xc0c57c[_0x6e70('0x24')]()[_0x6e70('0x23')](function(){_0x4da378[_0x6e70('0x16')](0xcc)[_0x6e70('0x17')]();});}};}function handleEntityNotFound(_0x474c04,_0x5d901b){return function(_0x564f31){if(!_0x564f31){_0x474c04['sendStatus'](0x194);}return _0x564f31;};}function handleError(_0x1840be,_0x7a3a77){_0x7a3a77=_0x7a3a77||0x1f4;return function(_0x130bb7){logger['error'](_0x130bb7[_0x6e70('0x25')]);if(_0x130bb7[_0x6e70('0x26')]){delete _0x130bb7[_0x6e70('0x26')];}_0x1840be[_0x6e70('0x16')](_0x7a3a77)[_0x6e70('0x27')](_0x130bb7);};}exports[_0x6e70('0x28')]=function(_0x2dcebe,_0x21f4d5){var _0x5a2ac0={},_0x449117={},_0x556e37={'count':0x0,'rows':[]};var _0x1d62d9=_[_0x6e70('0x29')](db[_0x6e70('0x2a')]['rawAttributes'],function(_0xd6eafd){return{'name':_0xd6eafd['fieldName'],'type':_0xd6eafd[_0x6e70('0x2b')]['key']};});_0x449117[_0x6e70('0x2c')]=_[_0x6e70('0x29')](_0x1d62d9,_0x6e70('0x26'));_0x449117[_0x6e70('0x2d')]=_[_0x6e70('0x2e')](_0x2dcebe['query']);_0x449117[_0x6e70('0x2f')]=_['intersection'](_0x449117[_0x6e70('0x2c')],_0x449117['query']);_0x5a2ac0[_0x6e70('0x30')]=_['intersection'](_0x449117[_0x6e70('0x2c')],qs[_0x6e70('0x31')](_0x2dcebe[_0x6e70('0x2d')]['fields']));_0x5a2ac0[_0x6e70('0x30')]=_0x5a2ac0[_0x6e70('0x30')][_0x6e70('0x32')]?_0x5a2ac0['attributes']:_0x449117['model'];if(!_0x2dcebe['query'][_0x6e70('0x33')](_0x6e70('0x34'))){_0x5a2ac0[_0x6e70('0x1a')]=qs[_0x6e70('0x1a')](_0x2dcebe['query'][_0x6e70('0x1a')]);_0x5a2ac0[_0x6e70('0x19')]=qs['offset'](_0x2dcebe[_0x6e70('0x2d')][_0x6e70('0x19')]);}_0x5a2ac0['order']=qs[_0x6e70('0x35')](_0x2dcebe[_0x6e70('0x2d')][_0x6e70('0x35')]);_0x5a2ac0[_0x6e70('0x36')]=qs[_0x6e70('0x2f')](_[_0x6e70('0x37')](_0x2dcebe[_0x6e70('0x2d')],_0x449117[_0x6e70('0x2f')]),_0x1d62d9);if(_0x2dcebe[_0x6e70('0x2d')][_0x6e70('0x38')]){_0x5a2ac0[_0x6e70('0x36')]=_[_0x6e70('0x39')](_0x5a2ac0[_0x6e70('0x36')],{'$or':_[_0x6e70('0x29')](_0x1d62d9,function(_0x55e79f){if(_0x55e79f['type']!==_0x6e70('0x3a')){var _0x275c06={};_0x275c06[_0x55e79f[_0x6e70('0x26')]]={'$like':'%'+_0x2dcebe['query'][_0x6e70('0x38')]+'%'};return _0x275c06;}})});}_0x5a2ac0=_[_0x6e70('0x39')]({},_0x5a2ac0,_0x2dcebe[_0x6e70('0x3b')]);var _0x48b0a7={'where':_0x5a2ac0['where']};return db['AnalyticFieldReport'][_0x6e70('0x1c')](_0x48b0a7)['then'](function(_0xd7c063){_0x556e37[_0x6e70('0x1c')]=_0xd7c063;if(_0x2dcebe[_0x6e70('0x2d')]['includeAll']){_0x5a2ac0[_0x6e70('0x3c')]=[{'all':!![]}];}return db[_0x6e70('0x2a')][_0x6e70('0x3d')](_0x5a2ac0);})[_0x6e70('0x23')](function(_0x38756f){_0x556e37[_0x6e70('0x3e')]=_0x38756f;return _0x556e37;})['then'](respondWithFilteredResult(_0x21f4d5,_0x5a2ac0))[_0x6e70('0x3f')](handleError(_0x21f4d5,null));};exports[_0x6e70('0x40')]=function(_0x569dc4,_0x24f1be){var _0x5cc9fc={'raw':![],'where':{'id':_0x569dc4[_0x6e70('0x41')]['id']}},_0x59bd20={};_0x59bd20[_0x6e70('0x2c')]=_[_0x6e70('0x2e')](db[_0x6e70('0x2a')][_0x6e70('0x42')]);_0x59bd20[_0x6e70('0x2d')]=_[_0x6e70('0x2e')](_0x569dc4[_0x6e70('0x2d')]);_0x59bd20[_0x6e70('0x2f')]=_[_0x6e70('0x43')](_0x59bd20[_0x6e70('0x2c')],_0x59bd20[_0x6e70('0x2d')]);_0x5cc9fc[_0x6e70('0x30')]=_[_0x6e70('0x43')](_0x59bd20['model'],qs[_0x6e70('0x31')](_0x569dc4[_0x6e70('0x2d')]['fields']));_0x5cc9fc[_0x6e70('0x30')]=_0x5cc9fc[_0x6e70('0x30')][_0x6e70('0x32')]?_0x5cc9fc['attributes']:_0x59bd20[_0x6e70('0x2c')];if(_0x569dc4[_0x6e70('0x2d')][_0x6e70('0x44')]){_0x5cc9fc[_0x6e70('0x3c')]=[{'all':!![]}];}_0x5cc9fc=_[_0x6e70('0x39')]({},_0x5cc9fc,_0x569dc4[_0x6e70('0x3b')]);return db[_0x6e70('0x2a')][_0x6e70('0x45')](_0x5cc9fc)['then'](handleEntityNotFound(_0x24f1be,null))[_0x6e70('0x23')](respondWithResult(_0x24f1be,null))[_0x6e70('0x3f')](handleError(_0x24f1be,null));};exports['create']=function(_0x5b6cef,_0x40ef18){return db['AnalyticFieldReport']['create'](_0x5b6cef[_0x6e70('0x46')],{})['then'](respondWithResult(_0x40ef18,0xc9))[_0x6e70('0x3f')](handleError(_0x40ef18,null));};exports[_0x6e70('0x47')]=function(_0x767988,_0xa9c1a6){return db[_0x6e70('0x2a')][_0x6e70('0x47')](_0x767988[_0x6e70('0x46')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0xa9c1a6,0xc9))[_0x6e70('0x3f')](handleError(_0xa9c1a6,null));};exports[_0x6e70('0x22')]=function(_0x1f779c,_0xb8c10b){if(_0x1f779c[_0x6e70('0x46')]['id']){delete _0x1f779c['body']['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x1f779c['params']['id']}})[_0x6e70('0x23')](handleEntityNotFound(_0xb8c10b,null))[_0x6e70('0x23')](saveUpdates(_0x1f779c[_0x6e70('0x46')],null))['then'](respondWithResult(_0xb8c10b,null))['catch'](handleError(_0xb8c10b,null));};exports[_0x6e70('0x24')]=function(_0x3a9ab5,_0x4969b1){return db['AnalyticFieldReport'][_0x6e70('0x45')]({'where':{'id':_0x3a9ab5[_0x6e70('0x41')]['id']}})[_0x6e70('0x23')](handleEntityNotFound(_0x4969b1,null))['then'](removeEntity(_0x4969b1,null))[_0x6e70('0x3f')](handleError(_0x4969b1,null));};exports[_0x6e70('0x48')]=function(_0x42e093,_0x512573){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x42e093[_0x6e70('0x2d')][_0x6e70('0x49')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x512573,0xcc))['catch'](handleError(_0x512573,null));};exports[_0x6e70('0x4a')]=function(_0x2ccde2,_0x44bb5b,_0x4bb228){return db[_0x6e70('0x4b')]['findOne']({'where':{'id':_0x2ccde2[_0x6e70('0x41')]['id']}})[_0x6e70('0x23')](handleEntityNotFound(_0x44bb5b,null))['then'](function(_0x48bb94){if(_0x48bb94){return db['sequelize'][_0x6e70('0x4c')](function(_0x8f565a){return db['AnalyticFieldReport'][_0x6e70('0x24')]({'where':{'CustomReportId':_0x2ccde2[_0x6e70('0x41')]['id']},'transaction':_0x8f565a})[_0x6e70('0x23')](function(_0x1de062){var _0x50887b=_[_0x6e70('0x29')](_0x2ccde2[_0x6e70('0x46')],function(_0x484717){delete _0x484717['id'];_0x484717[_0x6e70('0x4d')]=_0x2ccde2[_0x6e70('0x41')]['id'];return _0x484717;});return db[_0x6e70('0x2a')]['bulkCreate'](_0x50887b,{'transaction':_0x8f565a});});})['then'](function(){return db[_0x6e70('0x2a')]['findAll']({'where':{'CustomReportId':_0x2ccde2[_0x6e70('0x41')]['id']}});});}})[_0x6e70('0x23')](respondWithResult(_0x44bb5b,null))[_0x6e70('0x3f')](handleError(_0x44bb5b,null));};
\ No newline at end of file
+var _0x457c=['../../config/logger','../../config/environment','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','bulkCreate','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3bbd9f,_0x109c13){var _0x4fd1c1=function(_0x19d46c){while(--_0x19d46c){_0x3bbd9f['push'](_0x3bbd9f['shift']());}};_0x4fd1c1(++_0x109c13);}(_0x457c,0xdf));var _0xc457=function(_0x3ab96b,_0x584427){_0x3ab96b=_0x3ab96b-0x0;var _0x1cc885=_0x457c[_0x3ab96b];return _0x1cc885;};'use strict';var emlformat=require(_0xc457('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc457('0x1'));var jsonpatch=require(_0xc457('0x2'));var rp=require(_0xc457('0x3'));var moment=require(_0xc457('0x4'));var BPromise=require(_0xc457('0x5'));var Mustache=require(_0xc457('0x6'));var util=require(_0xc457('0x7'));var path=require('path');var sox=require(_0xc457('0x8'));var csv=require(_0xc457('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc457('0xa'));var squel=require(_0xc457('0xb'));var crypto=require(_0xc457('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc457('0xd'));var toCsv=require(_0xc457('0x9'));var querystring=require('querystring');var Papa=require(_0xc457('0xe'));var Redis=require(_0xc457('0xf'));var authService=require(_0xc457('0x10'));var qs=require(_0xc457('0x11'));var as=require(_0xc457('0x12'));var hardwareService=require(_0xc457('0x13'));var logger=require(_0xc457('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xc457('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47b87e,_0x1d9688){_0x1d9688=_0x1d9688||0xcc;return function(_0x2486b4){if(_0x2486b4){return _0x47b87e[_0xc457('0x16')](_0x1d9688);}return _0x47b87e[_0xc457('0x17')](_0x1d9688)['end']();};}function respondWithResult(_0x24ba82,_0x30ea2b){_0x30ea2b=_0x30ea2b||0xc8;return function(_0x548612){if(_0x548612){return _0x24ba82[_0xc457('0x17')](_0x30ea2b)['json'](_0x548612);}};}function respondWithFilteredResult(_0x3e2c2b,_0x5a64b0){return function(_0x2364f8){if(_0x2364f8){var _0x58e66c=typeof _0x5a64b0[_0xc457('0x18')]===_0xc457('0x19')&&typeof _0x5a64b0[_0xc457('0x1a')]===_0xc457('0x19');var _0x2f7c78=_0x2364f8['count'];var _0x37c431=_0x58e66c?0x0:_0x5a64b0['offset'];var _0xfccc38=_0x58e66c?_0x2364f8[_0xc457('0x1b')]:_0x5a64b0[_0xc457('0x18')]+_0x5a64b0[_0xc457('0x1a')];var _0x2e604e;if(_0xfccc38>=_0x2f7c78){_0xfccc38=_0x2f7c78;_0x2e604e=0xc8;}else{_0x2e604e=0xce;}_0x3e2c2b[_0xc457('0x17')](_0x2e604e);return _0x3e2c2b['set'](_0xc457('0x1c'),_0x37c431+'-'+_0xfccc38+'/'+_0x2f7c78)['json'](_0x2364f8);}return null;};}function patchUpdates(_0x126396){return function(_0x5c9294){try{jsonpatch[_0xc457('0x1d')](_0x5c9294,_0x126396,!![]);}catch(_0x4e0bc4){return BPromise[_0xc457('0x1e')](_0x4e0bc4);}return _0x5c9294[_0xc457('0x1f')]();};}function saveUpdates(_0x57ebf8,_0x25a03b){return function(_0xf20e92){if(_0xf20e92){return _0xf20e92[_0xc457('0x20')](_0x57ebf8)[_0xc457('0x21')](function(_0x14506e){return _0x14506e;});}return null;};}function removeEntity(_0x14d5b1,_0x105797){return function(_0x4bc17e){if(_0x4bc17e){return _0x4bc17e['destroy']()[_0xc457('0x21')](function(){_0x14d5b1[_0xc457('0x17')](0xcc)[_0xc457('0x22')]();});}};}function handleEntityNotFound(_0x1b3884,_0x4f77bd){return function(_0x209626){if(!_0x209626){_0x1b3884[_0xc457('0x16')](0x194);}return _0x209626;};}function handleError(_0x180e09,_0x2139d4){_0x2139d4=_0x2139d4||0x1f4;return function(_0x2099d2){logger[_0xc457('0x23')](_0x2099d2[_0xc457('0x24')]);if(_0x2099d2[_0xc457('0x25')]){delete _0x2099d2[_0xc457('0x25')];}_0x180e09[_0xc457('0x17')](_0x2139d4)[_0xc457('0x26')](_0x2099d2);};}exports[_0xc457('0x27')]=function(_0x17412a,_0x4e8c58){var _0x580549={},_0xe59bfa={},_0xf44a37={'count':0x0,'rows':[]};var _0x5d5a23=_['map'](db[_0xc457('0x28')][_0xc457('0x29')],function(_0x223ac3){return{'name':_0x223ac3[_0xc457('0x2a')],'type':_0x223ac3[_0xc457('0x2b')]['key']};});_0xe59bfa['model']=_[_0xc457('0x2c')](_0x5d5a23,_0xc457('0x25'));_0xe59bfa[_0xc457('0x2d')]=_[_0xc457('0x2e')](_0x17412a[_0xc457('0x2d')]);_0xe59bfa[_0xc457('0x2f')]=_[_0xc457('0x30')](_0xe59bfa[_0xc457('0x31')],_0xe59bfa['query']);_0x580549[_0xc457('0x32')]=_[_0xc457('0x30')](_0xe59bfa['model'],qs[_0xc457('0x33')](_0x17412a['query'][_0xc457('0x33')]));_0x580549[_0xc457('0x32')]=_0x580549['attributes'][_0xc457('0x34')]?_0x580549[_0xc457('0x32')]:_0xe59bfa['model'];if(!_0x17412a[_0xc457('0x2d')][_0xc457('0x35')](_0xc457('0x36'))){_0x580549[_0xc457('0x1a')]=qs[_0xc457('0x1a')](_0x17412a['query'][_0xc457('0x1a')]);_0x580549[_0xc457('0x18')]=qs[_0xc457('0x18')](_0x17412a[_0xc457('0x2d')][_0xc457('0x18')]);}_0x580549[_0xc457('0x37')]=qs['sort'](_0x17412a[_0xc457('0x2d')][_0xc457('0x38')]);_0x580549[_0xc457('0x39')]=qs['filters'](_[_0xc457('0x3a')](_0x17412a[_0xc457('0x2d')],_0xe59bfa['filters']),_0x5d5a23);if(_0x17412a[_0xc457('0x2d')][_0xc457('0x3b')]){_0x580549[_0xc457('0x39')]=_[_0xc457('0x3c')](_0x580549[_0xc457('0x39')],{'$or':_[_0xc457('0x2c')](_0x5d5a23,function(_0x48b571){if(_0x48b571[_0xc457('0x2b')]!==_0xc457('0x3d')){var _0x4136ef={};_0x4136ef[_0x48b571[_0xc457('0x25')]]={'$like':'%'+_0x17412a[_0xc457('0x2d')]['filter']+'%'};return _0x4136ef;}})});}_0x580549=_[_0xc457('0x3c')]({},_0x580549,_0x17412a[_0xc457('0x3e')]);var _0x20dbe0={'where':_0x580549['where']};return db[_0xc457('0x28')][_0xc457('0x1b')](_0x20dbe0)['then'](function(_0x181574){_0xf44a37[_0xc457('0x1b')]=_0x181574;if(_0x17412a[_0xc457('0x2d')][_0xc457('0x3f')]){_0x580549[_0xc457('0x40')]=[{'all':!![]}];}return db[_0xc457('0x28')][_0xc457('0x41')](_0x580549);})[_0xc457('0x21')](function(_0x3d822a){_0xf44a37[_0xc457('0x42')]=_0x3d822a;return _0xf44a37;})[_0xc457('0x21')](respondWithFilteredResult(_0x4e8c58,_0x580549))[_0xc457('0x43')](handleError(_0x4e8c58,null));};exports[_0xc457('0x44')]=function(_0x106ece,_0xf192cf){var _0x18f565={'raw':![],'where':{'id':_0x106ece[_0xc457('0x45')]['id']}},_0x16835f={};_0x16835f[_0xc457('0x31')]=_[_0xc457('0x2e')](db[_0xc457('0x28')][_0xc457('0x29')]);_0x16835f[_0xc457('0x2d')]=_[_0xc457('0x2e')](_0x106ece['query']);_0x16835f[_0xc457('0x2f')]=_[_0xc457('0x30')](_0x16835f['model'],_0x16835f['query']);_0x18f565[_0xc457('0x32')]=_[_0xc457('0x30')](_0x16835f[_0xc457('0x31')],qs['fields'](_0x106ece[_0xc457('0x2d')][_0xc457('0x33')]));_0x18f565[_0xc457('0x32')]=_0x18f565[_0xc457('0x32')][_0xc457('0x34')]?_0x18f565[_0xc457('0x32')]:_0x16835f['model'];if(_0x106ece[_0xc457('0x2d')][_0xc457('0x3f')]){_0x18f565['include']=[{'all':!![]}];}_0x18f565=_['merge']({},_0x18f565,_0x106ece[_0xc457('0x3e')]);return db['AnalyticFieldReport'][_0xc457('0x46')](_0x18f565)['then'](handleEntityNotFound(_0xf192cf,null))[_0xc457('0x21')](respondWithResult(_0xf192cf,null))[_0xc457('0x43')](handleError(_0xf192cf,null));};exports[_0xc457('0x47')]=function(_0x41e59e,_0x46ac3a){return db[_0xc457('0x28')]['create'](_0x41e59e[_0xc457('0x48')],{})[_0xc457('0x21')](respondWithResult(_0x46ac3a,0xc9))[_0xc457('0x43')](handleError(_0x46ac3a,null));};exports[_0xc457('0x49')]=function(_0x3539bd,_0x593ec9){return db[_0xc457('0x28')][_0xc457('0x49')](_0x3539bd[_0xc457('0x48')],{'raw':![],'individualHooks':!![]})[_0xc457('0x21')](respondWithResult(_0x593ec9,0xc9))[_0xc457('0x43')](handleError(_0x593ec9,null));};exports[_0xc457('0x20')]=function(_0x1df66a,_0x31af1a){if(_0x1df66a['body']['id']){delete _0x1df66a['body']['id'];}return db['AnalyticFieldReport'][_0xc457('0x46')]({'where':{'id':_0x1df66a[_0xc457('0x45')]['id']}})['then'](handleEntityNotFound(_0x31af1a,null))['then'](saveUpdates(_0x1df66a['body'],null))[_0xc457('0x21')](respondWithResult(_0x31af1a,null))[_0xc457('0x43')](handleError(_0x31af1a,null));};exports[_0xc457('0x4a')]=function(_0x4a2f50,_0x4c8a9d){return db[_0xc457('0x28')]['find']({'where':{'id':_0x4a2f50[_0xc457('0x45')]['id']}})[_0xc457('0x21')](handleEntityNotFound(_0x4c8a9d,null))[_0xc457('0x21')](removeEntity(_0x4c8a9d,null))[_0xc457('0x43')](handleError(_0x4c8a9d,null));};exports[_0xc457('0x4b')]=function(_0xd695e0,_0x4b88aa){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0xd695e0['query'][_0xc457('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0xc457('0x21')](respondWithResult(_0x4b88aa,0xcc))[_0xc457('0x43')](handleError(_0x4b88aa,null));};exports[_0xc457('0x4d')]=function(_0x32900e,_0x56aa47,_0x630da9){return db[_0xc457('0x4e')]['findOne']({'where':{'id':_0x32900e[_0xc457('0x45')]['id']}})[_0xc457('0x21')](handleEntityNotFound(_0x56aa47,null))[_0xc457('0x21')](function(_0x18f3bb){if(_0x18f3bb){return db[_0xc457('0x4f')][_0xc457('0x50')](function(_0x2a5649){return db[_0xc457('0x28')][_0xc457('0x4a')]({'where':{'CustomReportId':_0x32900e[_0xc457('0x45')]['id']},'transaction':_0x2a5649})[_0xc457('0x21')](function(_0x27532d){var _0x5bdb15=_[_0xc457('0x2c')](_0x32900e[_0xc457('0x48')],function(_0x55f839){delete _0x55f839['id'];_0x55f839['CustomReportId']=_0x32900e[_0xc457('0x45')]['id'];return _0x55f839;});return db[_0xc457('0x28')][_0xc457('0x49')](_0x5bdb15,{'transaction':_0x2a5649});});})['then'](function(){return db[_0xc457('0x28')][_0xc457('0x41')]({'where':{'CustomReportId':_0x32900e[_0xc457('0x45')]['id']}});});}})[_0xc457('0x21')](respondWithResult(_0x56aa47,null))[_0xc457('0x43')](handleError(_0x56aa47,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index ee19062..569551e 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 _0x642f=['rimraf','../../config/environment','./analyticFieldReport.attributes','AnalyticFieldReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4c5ef3,_0x55eafe){var _0x1a3742=function(_0x1b5e68){while(--_0x1b5e68){_0x4c5ef3['push'](_0x4c5ef3['shift']());}};_0x1a3742(++_0x55eafe);}(_0x642f,0x138));var _0xf642=function(_0x527f7b,_0x263c43){_0x527f7b=_0x527f7b-0x0;var _0x68e917=_0x642f[_0x527f7b];return _0x68e917;};'use strict';var _=require(_0xf642('0x0'));var util=require(_0xf642('0x1'));var logger=require(_0xf642('0x2'))(_0xf642('0x3'));var moment=require(_0xf642('0x4'));var BPromise=require(_0xf642('0x5'));var rp=require(_0xf642('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf642('0x7'));var config=require(_0xf642('0x8'));var attributes=require(_0xf642('0x9'));module['exports']=function(_0x2b4dab,_0x29fa15){return _0x2b4dab['define'](_0xf642('0xa'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8588=['exports','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x3b0f80,_0x1a666a){var _0x52d4bf=function(_0x4ffda1){while(--_0x4ffda1){_0x3b0f80['push'](_0x3b0f80['shift']());}};_0x52d4bf(++_0x1a666a);}(_0x8588,0x74));var _0x8858=function(_0x8fe148,_0x288331){_0x8fe148=_0x8fe148-0x0;var _0x18ccfd=_0x8588[_0x8fe148];return _0x18ccfd;};'use strict';var _=require(_0x8858('0x0'));var util=require('util');var logger=require(_0x8858('0x1'))(_0x8858('0x2'));var moment=require(_0x8858('0x3'));var BPromise=require(_0x8858('0x4'));var rp=require(_0x8858('0x5'));var fs=require('fs');var path=require(_0x8858('0x6'));var rimraf=require(_0x8858('0x7'));var config=require(_0x8858('0x8'));var attributes=require(_0x8858('0x9'));module[_0x8858('0xa')]=function(_0x4d3ded,_0x2cd6f0){return _0x4d3ded[_0x8858('0xb')](_0x8858('0xc'),attributes,{'tableName':_0x8858('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index cb5f948..e8a8ba8 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 _0x1135=['../../config/environment','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x26191d,_0x5142e5){var _0x1b644f=function(_0x146a4a){while(--_0x146a4a){_0x26191d['push'](_0x26191d['shift']());}};_0x1b644f(++_0x5142e5);}(_0x1135,0x6a));var _0x5113=function(_0x388a00,_0x18d2cd){_0x388a00=_0x388a00-0x0;var _0xee6010=_0x1135[_0x388a00];return _0xee6010;};'use strict';var _=require(_0x5113('0x0'));var util=require(_0x5113('0x1'));var moment=require(_0x5113('0x2'));var BPromise=require(_0x5113('0x3'));var rs=require(_0x5113('0x4'));var fs=require('fs');var Redis=require(_0x5113('0x5'));var db=require(_0x5113('0x6'))['db'];var utils=require(_0x5113('0x7'));var logger=require(_0x5113('0x8'))('rpc');var config=require(_0x5113('0x9'));var jayson=require(_0x5113('0xa'));var client=jayson['client'][_0x5113('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52456b,_0x4def68,_0x32d0c5){return new BPromise(function(_0x31df06,_0x492b3a){return client[_0x5113('0xc')](_0x52456b,_0x32d0c5)[_0x5113('0xd')](function(_0xf44298){logger[_0x5113('0xe')](_0x5113('0xf'),_0x4def68,_0x5113('0x10'));logger[_0x5113('0x11')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x4def68,_0x5113('0x10'),JSON[_0x5113('0x12')](_0xf44298));if(_0xf44298['error']){if(_0xf44298[_0x5113('0x13')][_0x5113('0x14')]===0x1f4){logger['error'](_0x5113('0xf'),_0x4def68,_0xf44298[_0x5113('0x13')][_0x5113('0x15')]);return _0x492b3a(_0xf44298[_0x5113('0x13')][_0x5113('0x15')]);}logger['error'](_0x5113('0xf'),_0x4def68,_0xf44298[_0x5113('0x13')][_0x5113('0x15')]);return _0x31df06(_0xf44298[_0x5113('0x13')][_0x5113('0x15')]);}else{logger[_0x5113('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4def68,'request\x20sent');_0x31df06(_0xf44298[_0x5113('0x16')][_0x5113('0x15')]);}})['catch'](function(_0x584c39){logger['error'](_0x5113('0xf'),_0x4def68,_0x584c39);_0x492b3a(_0x584c39);});});}
\ No newline at end of file
+var _0x9e10=['AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x9e10,0x7b));var _0x09e1=function(_0x24bfce,_0x2364d8){_0x24bfce=_0x24bfce-0x0;var _0x10f7c8=_0x9e10[_0x24bfce];return _0x10f7c8;};'use strict';var _=require(_0x09e1('0x0'));var util=require('util');var moment=require(_0x09e1('0x1'));var BPromise=require(_0x09e1('0x2'));var rs=require(_0x09e1('0x3'));var fs=require('fs');var Redis=require(_0x09e1('0x4'));var db=require(_0x09e1('0x5'))['db'];var utils=require(_0x09e1('0x6'));var logger=require(_0x09e1('0x7'))(_0x09e1('0x8'));var config=require(_0x09e1('0x9'));var jayson=require(_0x09e1('0xa'));var client=jayson[_0x09e1('0xb')][_0x09e1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x153407,_0x36a9d0,_0x27bb8a){return new BPromise(function(_0x1357c9,_0x4e7b44){return client['request'](_0x153407,_0x27bb8a)[_0x09e1('0xd')](function(_0x1c49f3){logger[_0x09e1('0xe')](_0x09e1('0xf'),_0x36a9d0,'request\x20sent');logger['debug'](_0x09e1('0x10'),_0x36a9d0,_0x09e1('0x11'),JSON[_0x09e1('0x12')](_0x1c49f3));if(_0x1c49f3['error']){if(_0x1c49f3['error'][_0x09e1('0x13')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x36a9d0,_0x1c49f3[_0x09e1('0x14')][_0x09e1('0x15')]);return _0x4e7b44(_0x1c49f3[_0x09e1('0x14')][_0x09e1('0x15')]);}logger[_0x09e1('0x14')](_0x09e1('0xf'),_0x36a9d0,_0x1c49f3['error'][_0x09e1('0x15')]);return _0x1357c9(_0x1c49f3[_0x09e1('0x14')][_0x09e1('0x15')]);}else{logger[_0x09e1('0xe')](_0x09e1('0xf'),_0x36a9d0,_0x09e1('0x11'));_0x1357c9(_0x1c49f3[_0x09e1('0x16')][_0x09e1('0x15')]);}})['catch'](function(_0x4c9373){logger[_0x09e1('0x14')]('AnalyticFieldReport,\x20%s,\x20%s',_0x36a9d0,_0x4c9373);_0x4e7b44(_0x4c9373);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 696554d..0356cb7 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(_0x233984,_0x2d2be1){var _0x30f6b7=function(_0x18d3df){while(--_0x18d3df){_0x233984['push'](_0x233984['shift']());}};_0x30f6b7(++_0x2d2be1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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(_0x34e434,_0x4c74d4){var _0x55be27=function(_0x45cf2b){while(--_0x45cf2b){_0x34e434['push'](_0x34e434['shift']());}};_0x55be27(++_0x4c74d4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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 ed1c404..985fd70 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 _0x83cd=['exports','STRING','name','sequelize'];(function(_0x400766,_0x368660){var _0x3ae58b=function(_0x4c6a6e){while(--_0x4c6a6e){_0x400766['push'](_0x400766['shift']());}};_0x3ae58b(++_0x368660);}(_0x83cd,0x17b));var _0xd83c=function(_0x49eba4,_0x4f3802){_0x49eba4=_0x49eba4-0x0;var _0x1c2e93=_0x83cd[_0x49eba4];return _0x1c2e93;};'use strict';var Sequelize=require(_0xd83c('0x0'));module[_0xd83c('0x1')]={'name':{'type':Sequelize[_0xd83c('0x2')],'allowNull':![],'unique':_0xd83c('0x3')},'table':{'type':Sequelize[_0xd83c('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xd83c('0x2')]}};
\ No newline at end of file
+var _0x0c71=['name','STRING','TEXT','exports'];(function(_0x4081a5,_0x27e9e2){var _0x59f5d9=function(_0x5b7420){while(--_0x5b7420){_0x4081a5['push'](_0x4081a5['shift']());}};_0x59f5d9(++_0x27e9e2);}(_0x0c71,0xfb));var _0x10c7=function(_0x275db9,_0x352089){_0x275db9=_0x275db9-0x0;var _0x4cf532=_0x0c71[_0x275db9];return _0x4cf532;};'use strict';var Sequelize=require('sequelize');module[_0x10c7('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x10c7('0x1')},'table':{'type':Sequelize[_0x10c7('0x2')]},'metric':{'type':Sequelize[_0x10c7('0x3')]},'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 2fc2321..9bec68d 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 _0x9957=['fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','Metrics','UserProfileResource','end','error','name','map','type','key','model','keys','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','AnalyticMetric','include','findAll','rawAttributes','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x1b2422,_0x1e98d4){var _0x376573=function(_0x5db41b){while(--_0x5db41b){_0x1b2422['push'](_0x1b2422['shift']());}};_0x376573(++_0x1e98d4);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){var _0x472195=_0x563799['get']({'plain':!![]});var _0x39df42=_0x7995('0x28');return db[_0x7995('0x29')][_0x7995('0x27')]({'where':{'type':_0x39df42,'resourceId':_0x472195['id']}})[_0x7995('0x26')](function(){return _0x563799;});})[_0x7995('0x26')](function(){_0x204507['status'](0xcc)[_0x7995('0x2a')]();});}};}function handleEntityNotFound(_0x5911c3,_0x229742){return function(_0x49bc7e){if(!_0x49bc7e){_0x5911c3[_0x7995('0x1b')](0x194);}return _0x49bc7e;};}function handleError(_0x132a42,_0x11c1eb){_0x11c1eb=_0x11c1eb||0x1f4;return function(_0x4b6f99){logger[_0x7995('0x2b')](_0x4b6f99['stack']);if(_0x4b6f99[_0x7995('0x2c')]){delete _0x4b6f99[_0x7995('0x2c')];}_0x132a42[_0x7995('0x1c')](_0x11c1eb)['send'](_0x4b6f99);};}exports['index']=function(_0x48e573,_0x3573be){var _0xe6b0b3={},_0x327a81={},_0x2b874d={'count':0x0,'rows':[]};var _0x2e3493=_[_0x7995('0x2d')](db['AnalyticMetric']['rawAttributes'],function(_0xfa8f15){return{'name':_0xfa8f15['fieldName'],'type':_0xfa8f15[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x327a81[_0x7995('0x30')]=_[_0x7995('0x2d')](_0x2e3493,_0x7995('0x2c'));_0x327a81['query']=_[_0x7995('0x31')](_0x48e573[_0x7995('0x32')]);_0x327a81['filters']=_['intersection'](_0x327a81['model'],_0x327a81[_0x7995('0x32')]);_0xe6b0b3[_0x7995('0x33')]=_['intersection'](_0x327a81[_0x7995('0x30')],qs['fields'](_0x48e573[_0x7995('0x32')][_0x7995('0x34')]));_0xe6b0b3[_0x7995('0x33')]=_0xe6b0b3['attributes']['length']?_0xe6b0b3[_0x7995('0x33')]:_0x327a81['model'];if(!_0x48e573['query'][_0x7995('0x35')](_0x7995('0x36'))){_0xe6b0b3['limit']=qs[_0x7995('0x21')](_0x48e573[_0x7995('0x32')][_0x7995('0x21')]);_0xe6b0b3[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x48e573['query'][_0x7995('0x20')]);}_0xe6b0b3[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x48e573[_0x7995('0x32')]['sort']);_0xe6b0b3[_0x7995('0x39')]=qs[_0x7995('0x3a')](_[_0x7995('0x3b')](_0x48e573[_0x7995('0x32')],_0x327a81[_0x7995('0x3a')]),_0x2e3493);if(_0x48e573[_0x7995('0x32')]['filter']){_0xe6b0b3[_0x7995('0x39')]=_[_0x7995('0x3c')](_0xe6b0b3[_0x7995('0x39')],{'$or':_[_0x7995('0x2d')](_0x2e3493,function(_0x2e04cd){if(_0x2e04cd[_0x7995('0x2e')]!==_0x7995('0x3d')){var _0x270c0e={};_0x270c0e[_0x2e04cd[_0x7995('0x2c')]]={'$like':'%'+_0x48e573[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x270c0e;}})});}_0xe6b0b3=_[_0x7995('0x3c')]({},_0xe6b0b3,_0x48e573[_0x7995('0x3f')]);var _0x53cda2={'where':_0xe6b0b3['where']};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x53cda2)['then'](function(_0x4b0855){_0x2b874d[_0x7995('0x1f')]=_0x4b0855;if(_0x48e573['query']['includeAll']){_0xe6b0b3[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x42')](_0xe6b0b3);})['then'](function(_0x46ac4f){_0x2b874d['rows']=_0x46ac4f;return _0x2b874d;})[_0x7995('0x26')](respondWithFilteredResult(_0x3573be,_0xe6b0b3))['catch'](handleError(_0x3573be,null));};exports['show']=function(_0x39c5b8,_0x403f54){var _0xc04e5={'raw':!![],'where':{'id':_0x39c5b8['params']['id']}},_0x3f1c35={};_0x3f1c35[_0x7995('0x30')]=_[_0x7995('0x31')](db[_0x7995('0x40')][_0x7995('0x43')]);_0x3f1c35['query']=_['keys'](_0x39c5b8[_0x7995('0x32')]);_0x3f1c35['filters']=_[_0x7995('0x44')](_0x3f1c35['model'],_0x3f1c35[_0x7995('0x32')]);_0xc04e5['attributes']=_[_0x7995('0x44')](_0x3f1c35[_0x7995('0x30')],qs['fields'](_0x39c5b8[_0x7995('0x32')][_0x7995('0x34')]));_0xc04e5[_0x7995('0x33')]=_0xc04e5[_0x7995('0x33')]['length']?_0xc04e5[_0x7995('0x33')]:_0x3f1c35[_0x7995('0x30')];if(_0x39c5b8[_0x7995('0x32')]['includeAll']){_0xc04e5[_0x7995('0x41')]=[{'all':!![]}];}_0xc04e5=_[_0x7995('0x3c')]({},_0xc04e5,_0x39c5b8[_0x7995('0x3f')]);return db[_0x7995('0x40')][_0x7995('0x45')](_0xc04e5)['then'](handleEntityNotFound(_0x403f54,null))[_0x7995('0x26')](respondWithResult(_0x403f54,null))[_0x7995('0x46')](handleError(_0x403f54,null));};exports['create']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x40')][_0x7995('0x47')](_0x3d1dbb[_0x7995('0x48')],{})[_0x7995('0x26')](function(_0xddf537){var _0x14b537=_0x3d1dbb[_0x7995('0x49')]['get']({'plain':!![]});if(!_0x14b537)throw new Error(_0x7995('0x4a'));if(_0x14b537[_0x7995('0x4b')]===_0x7995('0x49')){var _0x4ffc8a=_0xddf537[_0x7995('0x4c')]({'plain':!![]});var _0x1fe77e=_0x7995('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x1fe77e,'userProfileId':_0x14b537['userProfileId']},'raw':!![]})[_0x7995('0x26')](function(_0x1fd1ca){if(_0x1fd1ca&&_0x1fd1ca['autoAssociation']===0x0){return db[_0x7995('0x29')][_0x7995('0x47')]({'name':_0x4ffc8a[_0x7995('0x2c')],'resourceId':_0x4ffc8a['id'],'type':_0x1fd1ca[_0x7995('0x2c')],'sectionId':_0x1fd1ca['id']},{})[_0x7995('0x26')](function(){return _0xddf537;});}else{return _0xddf537;}})['catch'](function(_0x29ee32){logger['error'](_0x7995('0x4d'),_0x29ee32);throw _0x29ee32;});}return _0xddf537;})[_0x7995('0x26')](respondWithResult(_0x5843ba,0xc9))[_0x7995('0x46')](handleError(_0x5843ba,null));};exports['update']=function(_0x5e1f34,_0x54e2b1){if(_0x5e1f34['body']['id']){delete _0x5e1f34[_0x7995('0x48')]['id'];}return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0x5e1f34[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x54e2b1,null))[_0x7995('0x26')](saveUpdates(_0x5e1f34[_0x7995('0x48')],null))[_0x7995('0x26')](respondWithResult(_0x54e2b1,null))[_0x7995('0x46')](handleError(_0x54e2b1,null));};exports[_0x7995('0x27')]=function(_0xa7af8c,_0x133c63){return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0xa7af8c[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x133c63,null))[_0x7995('0x26')](removeEntity(_0x133c63,null))[_0x7995('0x46')](handleError(_0x133c63,null));};
\ No newline at end of file
+var _0x98a8=['../../mysqldb','end','status','json','undefined','count','offset','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Metrics','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x4b8208,_0x293c87){var _0x1f6fac=function(_0x50d65c){while(--_0x50d65c){_0x4b8208['push'](_0x4b8208['shift']());}};_0x1f6fac(++_0x293c87);}(_0x98a8,0x12c));var _0x898a=function(_0x4b5cf3,_0xc54638){_0x4b5cf3=_0x4b5cf3-0x0;var _0x3455dc=_0x98a8[_0x4b5cf3];return _0x3455dc;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];function respondWithStatusCode(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xcc;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['sendStatus'](_0x364a23);}return _0x2c76b7['status'](_0x364a23)[_0x898a('0x19')]();};}function respondWithResult(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0xc8;return function(_0x116fbe){if(_0x116fbe){return _0x1f5be4[_0x898a('0x1a')](_0xb24335)[_0x898a('0x1b')](_0x116fbe);}};}function respondWithFilteredResult(_0x506023,_0x47033c){return function(_0x53a4b8){if(_0x53a4b8){var _0x3fec7a=typeof _0x47033c['offset']===_0x898a('0x1c')&&typeof _0x47033c['limit']===_0x898a('0x1c');var _0x56f8f9=_0x53a4b8[_0x898a('0x1d')];var _0x3197f7=_0x3fec7a?0x0:_0x47033c[_0x898a('0x1e')];var _0x4ddd4d=_0x3fec7a?_0x53a4b8[_0x898a('0x1d')]:_0x47033c['offset']+_0x47033c['limit'];var _0x3f8af4;if(_0x4ddd4d>=_0x56f8f9){_0x4ddd4d=_0x56f8f9;_0x3f8af4=0xc8;}else{_0x3f8af4=0xce;}_0x506023[_0x898a('0x1a')](_0x3f8af4);return _0x506023['set']('Content-Range',_0x3197f7+'-'+_0x4ddd4d+'/'+_0x56f8f9)[_0x898a('0x1b')](_0x53a4b8);}return null;};}function patchUpdates(_0x26449a){return function(_0x38a8f0){try{jsonpatch[_0x898a('0x1f')](_0x38a8f0,_0x26449a,!![]);}catch(_0x2da52d){return BPromise[_0x898a('0x20')](_0x2da52d);}return _0x38a8f0[_0x898a('0x21')]();};}function saveUpdates(_0x483212,_0x247cfc){return function(_0x50718e){if(_0x50718e){return _0x50718e[_0x898a('0x22')](_0x483212)[_0x898a('0x23')](function(_0x30495a){return _0x30495a;});}return null;};}function removeEntity(_0x310bfa,_0x4e254d){return function(_0x274cdf){if(_0x274cdf){return _0x274cdf[_0x898a('0x24')]()[_0x898a('0x23')](function(){var _0x32eca5=_0x274cdf[_0x898a('0x25')]({'plain':!![]});var _0x1426e3='Metrics';return db[_0x898a('0x26')]['destroy']({'where':{'type':_0x1426e3,'resourceId':_0x32eca5['id']}})['then'](function(){return _0x274cdf;});})['then'](function(){_0x310bfa[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();});}};}function handleEntityNotFound(_0x420b25,_0x40b3db){return function(_0x28ae6a){if(!_0x28ae6a){_0x420b25[_0x898a('0x27')](0x194);}return _0x28ae6a;};}function handleError(_0x398e98,_0xac1fc4){_0xac1fc4=_0xac1fc4||0x1f4;return function(_0xd31922){logger['error'](_0xd31922['stack']);if(_0xd31922['name']){delete _0xd31922[_0x898a('0x28')];}_0x398e98[_0x898a('0x1a')](_0xac1fc4)[_0x898a('0x29')](_0xd31922);};}exports[_0x898a('0x2a')]=function(_0x34f447,_0x560000){var _0xe3c983={},_0xf74645={},_0x18773a={'count':0x0,'rows':[]};var _0x4287da=_[_0x898a('0x2b')](db[_0x898a('0x2c')]['rawAttributes'],function(_0x7a1eb5){return{'name':_0x7a1eb5[_0x898a('0x2d')],'type':_0x7a1eb5[_0x898a('0x2e')][_0x898a('0x2f')]};});_0xf74645[_0x898a('0x30')]=_['map'](_0x4287da,'name');_0xf74645[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34f447[_0x898a('0x31')]);_0xf74645['filters']=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],_0xf74645[_0x898a('0x31')]);_0xe3c983[_0x898a('0x34')]=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],qs[_0x898a('0x35')](_0x34f447[_0x898a('0x31')]['fields']));_0xe3c983[_0x898a('0x34')]=_0xe3c983['attributes']['length']?_0xe3c983[_0x898a('0x34')]:_0xf74645['model'];if(!_0x34f447[_0x898a('0x31')]['hasOwnProperty'](_0x898a('0x36'))){_0xe3c983['limit']=qs[_0x898a('0x37')](_0x34f447[_0x898a('0x31')][_0x898a('0x37')]);_0xe3c983['offset']=qs['offset'](_0x34f447['query'][_0x898a('0x1e')]);}_0xe3c983[_0x898a('0x38')]=qs['sort'](_0x34f447[_0x898a('0x31')][_0x898a('0x39')]);_0xe3c983[_0x898a('0x3a')]=qs[_0x898a('0x3b')](_['pick'](_0x34f447['query'],_0xf74645[_0x898a('0x3b')]),_0x4287da);if(_0x34f447[_0x898a('0x31')]['filter']){_0xe3c983['where']=_[_0x898a('0x3c')](_0xe3c983[_0x898a('0x3a')],{'$or':_[_0x898a('0x2b')](_0x4287da,function(_0xa45405){if(_0xa45405['type']!==_0x898a('0x3d')){var _0x369c02={};_0x369c02[_0xa45405['name']]={'$like':'%'+_0x34f447['query']['filter']+'%'};return _0x369c02;}})});}_0xe3c983=_[_0x898a('0x3c')]({},_0xe3c983,_0x34f447[_0x898a('0x3e')]);var _0x35d767={'where':_0xe3c983[_0x898a('0x3a')]};return db[_0x898a('0x2c')][_0x898a('0x1d')](_0x35d767)[_0x898a('0x23')](function(_0x1432ec){_0x18773a[_0x898a('0x1d')]=_0x1432ec;if(_0x34f447[_0x898a('0x31')][_0x898a('0x3f')]){_0xe3c983[_0x898a('0x40')]=[{'all':!![]}];}return db[_0x898a('0x2c')][_0x898a('0x41')](_0xe3c983);})[_0x898a('0x23')](function(_0x4c8628){_0x18773a[_0x898a('0x42')]=_0x4c8628;return _0x18773a;})[_0x898a('0x23')](respondWithFilteredResult(_0x560000,_0xe3c983))[_0x898a('0x43')](handleError(_0x560000,null));};exports['show']=function(_0x34029e,_0x2e5451){var _0x3a8663={'raw':!![],'where':{'id':_0x34029e[_0x898a('0x44')]['id']}},_0x6ab441={};_0x6ab441[_0x898a('0x30')]=_[_0x898a('0x32')](db[_0x898a('0x2c')]['rawAttributes']);_0x6ab441[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34029e[_0x898a('0x31')]);_0x6ab441[_0x898a('0x3b')]=_['intersection'](_0x6ab441[_0x898a('0x30')],_0x6ab441[_0x898a('0x31')]);_0x3a8663['attributes']=_[_0x898a('0x33')](_0x6ab441['model'],qs[_0x898a('0x35')](_0x34029e['query']['fields']));_0x3a8663[_0x898a('0x34')]=_0x3a8663['attributes'][_0x898a('0x45')]?_0x3a8663[_0x898a('0x34')]:_0x6ab441['model'];if(_0x34029e[_0x898a('0x31')][_0x898a('0x3f')]){_0x3a8663['include']=[{'all':!![]}];}_0x3a8663=_[_0x898a('0x3c')]({},_0x3a8663,_0x34029e[_0x898a('0x3e')]);return db[_0x898a('0x2c')][_0x898a('0x46')](_0x3a8663)['then'](handleEntityNotFound(_0x2e5451,null))[_0x898a('0x23')](respondWithResult(_0x2e5451,null))[_0x898a('0x43')](handleError(_0x2e5451,null));};exports['create']=function(_0x25adcc,_0x1d8c16){return db['AnalyticMetric'][_0x898a('0x47')](_0x25adcc['body'],{})[_0x898a('0x23')](function(_0x41f291){var _0x32ccb9=_0x25adcc['user'][_0x898a('0x25')]({'plain':!![]});if(!_0x32ccb9)throw new Error(_0x898a('0x48'));if(_0x32ccb9[_0x898a('0x49')]===_0x898a('0x4a')){var _0x5a8a2c=_0x41f291[_0x898a('0x25')]({'plain':!![]});var _0x529d7c=_0x898a('0x4b');return db[_0x898a('0x4c')][_0x898a('0x46')]({'where':{'name':_0x529d7c,'userProfileId':_0x32ccb9['userProfileId']},'raw':!![]})[_0x898a('0x23')](function(_0x3c4db0){if(_0x3c4db0&&_0x3c4db0[_0x898a('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a8a2c[_0x898a('0x28')],'resourceId':_0x5a8a2c['id'],'type':_0x3c4db0[_0x898a('0x28')],'sectionId':_0x3c4db0['id']},{})[_0x898a('0x23')](function(){return _0x41f291;});}else{return _0x41f291;}})[_0x898a('0x43')](function(_0x28b8c9){logger[_0x898a('0x4e')](_0x898a('0x4f'),_0x28b8c9);throw _0x28b8c9;});}return _0x41f291;})[_0x898a('0x23')](respondWithResult(_0x1d8c16,0xc9))[_0x898a('0x43')](handleError(_0x1d8c16,null));};exports[_0x898a('0x22')]=function(_0x2382a9,_0x5e9329){if(_0x2382a9[_0x898a('0x50')]['id']){delete _0x2382a9[_0x898a('0x50')]['id'];}return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x2382a9['params']['id']}})['then'](handleEntityNotFound(_0x5e9329,null))[_0x898a('0x23')](saveUpdates(_0x2382a9[_0x898a('0x50')],null))[_0x898a('0x23')](respondWithResult(_0x5e9329,null))['catch'](handleError(_0x5e9329,null));};exports['destroy']=function(_0x11a07a,_0x1f5e4b){return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x11a07a[_0x898a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1f5e4b,null))[_0x898a('0x23')](removeEntity(_0x1f5e4b,null))[_0x898a('0x43')](handleError(_0x1f5e4b,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 2c131ce..93135bc 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 _0x624c=['../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','util'];(function(_0x327d7a,_0x16d23c){var _0x3a59db=function(_0x59a56a){while(--_0x59a56a){_0x327d7a['push'](_0x327d7a['shift']());}};_0x3a59db(++_0x16d23c);}(_0x624c,0x1ee));var _0xc624=function(_0x1d4be2,_0x12c7ec){_0x1d4be2=_0x1d4be2-0x0;var _0x3df399=_0x624c[_0x1d4be2];return _0x3df399;};'use strict';var _=require('lodash');var util=require(_0xc624('0x0'));var logger=require(_0xc624('0x1'))(_0xc624('0x2'));var moment=require(_0xc624('0x3'));var BPromise=require(_0xc624('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc624('0x5'));var rimraf=require('rimraf');var config=require(_0xc624('0x6'));var attributes=require('./analyticMetric.attributes');module[_0xc624('0x7')]=function(_0x2d1db7,_0x39759e){return _0x2d1db7[_0xc624('0x8')](_0xc624('0x9'),attributes,{'tableName':_0xc624('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8be8=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash'];(function(_0x20e070,_0x3373b4){var _0x4805c1=function(_0x5a1c80){while(--_0x5a1c80){_0x20e070['push'](_0x20e070['shift']());}};_0x4805c1(++_0x3373b4);}(_0x8be8,0xf6));var _0x88be=function(_0x20e200,_0x35bee2){_0x20e200=_0x20e200-0x0;var _0x2e257a=_0x8be8[_0x20e200];return _0x2e257a;};'use strict';var _=require(_0x88be('0x0'));var util=require(_0x88be('0x1'));var logger=require(_0x88be('0x2'))(_0x88be('0x3'));var moment=require(_0x88be('0x4'));var BPromise=require(_0x88be('0x5'));var rp=require(_0x88be('0x6'));var fs=require('fs');var path=require(_0x88be('0x7'));var rimraf=require(_0x88be('0x8'));var config=require('../../config/environment');var attributes=require(_0x88be('0x9'));module['exports']=function(_0xc7c5,_0x57da87){return _0xc7c5[_0x88be('0xa')](_0x88be('0xb'),attributes,{'tableName':_0x88be('0xc'),'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 9f9c0d0..fea225a 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 _0xd7a9=['debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xd7a9,0x128));var _0x9d7a=function(_0x3e1ccd,_0x3d3880){_0x3e1ccd=_0x3e1ccd-0x0;var _0x3e02ed=_0xd7a9[_0x3e1ccd];return _0x3e02ed;};'use strict';var _=require('lodash');var util=require(_0x9d7a('0x0'));var moment=require(_0x9d7a('0x1'));var BPromise=require(_0x9d7a('0x2'));var rs=require(_0x9d7a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d7a('0x4'))['db'];var utils=require(_0x9d7a('0x5'));var logger=require(_0x9d7a('0x6'))('rpc');var config=require(_0x9d7a('0x7'));var jayson=require(_0x9d7a('0x8'));var client=jayson[_0x9d7a('0x9')][_0x9d7a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47d090,_0x1bbb17,_0x251d27){return new BPromise(function(_0x450167,_0x13b55d){return client[_0x9d7a('0xb')](_0x47d090,_0x251d27)[_0x9d7a('0xc')](function(_0x45ecd8){logger[_0x9d7a('0xd')](_0x9d7a('0xe'),_0x1bbb17,_0x9d7a('0xf'));logger[_0x9d7a('0x10')](_0x9d7a('0x11'),_0x1bbb17,'request\x20sent',JSON[_0x9d7a('0x12')](_0x45ecd8));if(_0x45ecd8[_0x9d7a('0x13')]){if(_0x45ecd8['error'][_0x9d7a('0x14')]===0x1f4){logger['error'](_0x9d7a('0xe'),_0x1bbb17,_0x45ecd8[_0x9d7a('0x13')][_0x9d7a('0x15')]);return _0x13b55d(_0x45ecd8['error'][_0x9d7a('0x15')]);}logger['error'](_0x9d7a('0xe'),_0x1bbb17,_0x45ecd8[_0x9d7a('0x13')][_0x9d7a('0x15')]);return _0x450167(_0x45ecd8[_0x9d7a('0x13')][_0x9d7a('0x15')]);}else{logger[_0x9d7a('0xd')](_0x9d7a('0xe'),_0x1bbb17,_0x9d7a('0xf'));_0x450167(_0x45ecd8[_0x9d7a('0x16')][_0x9d7a('0x15')]);}})[_0x9d7a('0x17')](function(_0x476f8d){logger[_0x9d7a('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x1bbb17,_0x476f8d);_0x13b55d(_0x476f8d);});});}
\ No newline at end of file
+var _0x4a8c=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','info','util'];(function(_0x2b226e,_0x94c72c){var _0x24006c=function(_0x300d81){while(--_0x300d81){_0x2b226e['push'](_0x2b226e['shift']());}};_0x24006c(++_0x94c72c);}(_0x4a8c,0x83));var _0xc4a8=function(_0x16f22d,_0x4ccd65){_0x16f22d=_0x16f22d-0x0;var _0x1b3140=_0x4a8c[_0x16f22d];return _0x1b3140;};'use strict';var _=require('lodash');var util=require(_0xc4a8('0x0'));var moment=require(_0xc4a8('0x1'));var BPromise=require(_0xc4a8('0x2'));var rs=require(_0xc4a8('0x3'));var fs=require('fs');var Redis=require(_0xc4a8('0x4'));var db=require(_0xc4a8('0x5'))['db'];var utils=require(_0xc4a8('0x6'));var logger=require(_0xc4a8('0x7'))(_0xc4a8('0x8'));var config=require(_0xc4a8('0x9'));var jayson=require(_0xc4a8('0xa'));var client=jayson['client'][_0xc4a8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55c091,_0x1b7734,_0x5b002b){return new BPromise(function(_0x46d045,_0x2c897b){return client[_0xc4a8('0xc')](_0x55c091,_0x5b002b)[_0xc4a8('0xd')](function(_0x12f4d2){logger['info'](_0xc4a8('0xe'),_0x1b7734,_0xc4a8('0xf'));logger[_0xc4a8('0x10')](_0xc4a8('0x11'),_0x1b7734,'request\x20sent',JSON['stringify'](_0x12f4d2));if(_0x12f4d2[_0xc4a8('0x12')]){if(_0x12f4d2[_0xc4a8('0x12')][_0xc4a8('0x13')]===0x1f4){logger[_0xc4a8('0x12')](_0xc4a8('0xe'),_0x1b7734,_0x12f4d2[_0xc4a8('0x12')][_0xc4a8('0x14')]);return _0x2c897b(_0x12f4d2[_0xc4a8('0x12')][_0xc4a8('0x14')]);}logger[_0xc4a8('0x12')](_0xc4a8('0xe'),_0x1b7734,_0x12f4d2[_0xc4a8('0x12')]['message']);return _0x46d045(_0x12f4d2[_0xc4a8('0x12')][_0xc4a8('0x14')]);}else{logger[_0xc4a8('0x15')](_0xc4a8('0xe'),_0x1b7734,_0xc4a8('0xf'));_0x46d045(_0x12f4d2['result'][_0xc4a8('0x14')]);}})['catch'](function(_0x4c6619){logger['error'](_0xc4a8('0xe'),_0x1b7734,_0x4c6619);_0x2c897b(_0x4c6619);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 3ee4d50..678df46 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 _0xb7a8=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','put','update','destroy','util','path'];(function(_0xaa1cab,_0x5f54b2){var _0x48cbeb=function(_0x58c0c8){while(--_0x58c0c8){_0xaa1cab['push'](_0xaa1cab['shift']());}};_0x48cbeb(++_0x5f54b2);}(_0xb7a8,0xec));var _0x8b7a=function(_0x3ca393,_0x6def48){_0x3ca393=_0x3ca393-0x0;var _0xfa6ac0=_0xb7a8[_0x3ca393];return _0xfa6ac0;};'use strict';var multer=require('multer');var util=require(_0x8b7a('0x0'));var path=require(_0x8b7a('0x1'));var timeout=require('connect-timeout');var express=require(_0x8b7a('0x2'));var router=express[_0x8b7a('0x3')]();var fs_extra=require(_0x8b7a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8b7a('0x5'));var config=require(_0x8b7a('0x6'));var controller=require(_0x8b7a('0x7'));router[_0x8b7a('0x8')]('/',auth[_0x8b7a('0x9')](),controller[_0x8b7a('0xa')]);router[_0x8b7a('0x8')](_0x8b7a('0xb'),auth[_0x8b7a('0x9')](),controller[_0x8b7a('0xc')]);router[_0x8b7a('0xd')]('/',auth[_0x8b7a('0x9')](),controller['create']);router[_0x8b7a('0xe')]('/:id',auth[_0x8b7a('0x9')](),controller[_0x8b7a('0xf')]);router['delete'](_0x8b7a('0xb'),auth[_0x8b7a('0x9')](),controller[_0x8b7a('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x4819=['/:id','show','post','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated'];(function(_0x1c910c,_0x1f99f4){var _0x111c74=function(_0x105f83){while(--_0x105f83){_0x1c910c['push'](_0x1c910c['shift']());}};_0x111c74(++_0x1f99f4);}(_0x4819,0xcd));var _0x9481=function(_0xef89d,_0x287047){_0xef89d=_0xef89d-0x0;var _0x23d599=_0x4819[_0xef89d];return _0x23d599;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var fs_extra=require(_0x9481('0x5'));var auth=require(_0x9481('0x6'));var interaction=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var controller=require(_0x9481('0x9'));router['get']('/',auth[_0x9481('0xa')](),controller['index']);router['get'](_0x9481('0xb'),auth[_0x9481('0xa')](),controller[_0x9481('0xc')]);router[_0x9481('0xd')]('/',auth[_0x9481('0xa')](),controller['create']);router[_0x9481('0xe')]('/:id',auth[_0x9481('0xa')](),controller['update']);router[_0x9481('0xf')](_0x9481('0xb'),auth[_0x9481('0xa')](),controller[_0x9481('0x10')]);module[_0x9481('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index b9c80a9..688b842 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 _0x263b=['sequelize','exports','TEXT'];(function(_0x4a1d23,_0x411bea){var _0x32c71c=function(_0x4f9845){while(--_0x4f9845){_0x4a1d23['push'](_0x4a1d23['shift']());}};_0x32c71c(++_0x411bea);}(_0x263b,0x144));var _0xb263=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x263b[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xb263('0x0'));module[_0xb263('0x1')]={'tree':{'type':Sequelize[_0xb263('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xa8fb=['TEXT','sequelize','exports'];(function(_0x1a1ac0,_0x754906){var _0x539145=function(_0x2aec93){while(--_0x2aec93){_0x1a1ac0['push'](_0x1a1ac0['shift']());}};_0x539145(++_0x754906);}(_0xa8fb,0xa9));var _0xba8f=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0xa8fb[_0x1477ef];return _0x164acd;};'use strict';var Sequelize=require(_0xba8f('0x0'));module[_0xba8f('0x1')]={'tree':{'type':Sequelize[_0xba8f('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 971646f..5ca2020 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 _0x4a98=['ejs','lodash','crypto','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','json','undefined','limit','offset','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','count','includeAll','include','AnalyticTreeReport','findAll','rows','catch','show','params','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv'];(function(_0x5cab28,_0x307622){var _0xa3554d=function(_0x330139){while(--_0x330139){_0x5cab28['push'](_0x5cab28['shift']());}};_0xa3554d(++_0x307622);}(_0x4a98,0x1b9));var _0x84a9=function(_0x503641,_0x33a3cf){_0x503641=_0x503641-0x0;var _0x17757d=_0x4a98[_0x503641];return _0x17757d;};'use strict';var emlformat=require(_0x84a9('0x0'));var rimraf=require(_0x84a9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x84a9('0x2'));var rp=require(_0x84a9('0x3'));var moment=require(_0x84a9('0x4'));var BPromise=require(_0x84a9('0x5'));var Mustache=require(_0x84a9('0x6'));var util=require('util');var path=require(_0x84a9('0x7'));var sox=require('sox');var csv=require(_0x84a9('0x8'));var ejs=require(_0x84a9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x84a9('0xa'));var squel=require('squel');var crypto=require(_0x84a9('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x84a9('0xc'));var Papa=require(_0x84a9('0xd'));var Redis=require(_0x84a9('0xe'));var authService=require(_0x84a9('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x84a9('0x10'));var hardwareService=require(_0x84a9('0x11'));var logger=require(_0x84a9('0x12'))(_0x84a9('0x13'));var utils=require(_0x84a9('0x14'));var config=require(_0x84a9('0x15'));var licenseUtil=require(_0x84a9('0x16'));var db=require(_0x84a9('0x17'))['db'];function respondWithStatusCode(_0x42ce74,_0x164fa7){_0x164fa7=_0x164fa7||0xcc;return function(_0x110809){if(_0x110809){return _0x42ce74[_0x84a9('0x18')](_0x164fa7);}return _0x42ce74[_0x84a9('0x19')](_0x164fa7)[_0x84a9('0x1a')]();};}function respondWithResult(_0x11c9ec,_0x585a76){_0x585a76=_0x585a76||0xc8;return function(_0x424e8){if(_0x424e8){return _0x11c9ec['status'](_0x585a76)[_0x84a9('0x1b')](_0x424e8);}};}function respondWithFilteredResult(_0x37dece,_0x119ad3){return function(_0x1bba91){if(_0x1bba91){var _0x2b2999=typeof _0x119ad3['offset']===_0x84a9('0x1c')&&typeof _0x119ad3[_0x84a9('0x1d')]===_0x84a9('0x1c');var _0xc261b6=_0x1bba91['count'];var _0x29b59d=_0x2b2999?0x0:_0x119ad3[_0x84a9('0x1e')];var _0x126bd3=_0x2b2999?_0x1bba91['count']:_0x119ad3[_0x84a9('0x1e')]+_0x119ad3[_0x84a9('0x1d')];var _0x2cd18e;if(_0x126bd3>=_0xc261b6){_0x126bd3=_0xc261b6;_0x2cd18e=0xc8;}else{_0x2cd18e=0xce;}_0x37dece[_0x84a9('0x19')](_0x2cd18e);return _0x37dece[_0x84a9('0x1f')](_0x84a9('0x20'),_0x29b59d+'-'+_0x126bd3+'/'+_0xc261b6)[_0x84a9('0x1b')](_0x1bba91);}return null;};}function patchUpdates(_0x3205b5){return function(_0xaa4176){try{jsonpatch['apply'](_0xaa4176,_0x3205b5,!![]);}catch(_0x5c9b91){return BPromise[_0x84a9('0x21')](_0x5c9b91);}return _0xaa4176[_0x84a9('0x22')]();};}function saveUpdates(_0x2e73ad,_0x570d1c){return function(_0x4b5b36){if(_0x4b5b36){return _0x4b5b36[_0x84a9('0x23')](_0x2e73ad)[_0x84a9('0x24')](function(_0x36656f){return _0x36656f;});}return null;};}function removeEntity(_0x431959,_0x4edd4b){return function(_0x3a0375){if(_0x3a0375){return _0x3a0375[_0x84a9('0x25')]()[_0x84a9('0x24')](function(){_0x431959[_0x84a9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd8e8fb,_0x2289e3){return function(_0x4d3f35){if(!_0x4d3f35){_0xd8e8fb[_0x84a9('0x18')](0x194);}return _0x4d3f35;};}function handleError(_0x4ff03a,_0x6700f8){_0x6700f8=_0x6700f8||0x1f4;return function(_0x543e52){logger['error'](_0x543e52[_0x84a9('0x26')]);if(_0x543e52[_0x84a9('0x27')]){delete _0x543e52[_0x84a9('0x27')];}_0x4ff03a['status'](_0x6700f8)[_0x84a9('0x28')](_0x543e52);};}exports[_0x84a9('0x29')]=function(_0x42de6c,_0x52d9e5){var _0x4196c1={},_0x211aa0={},_0x5697fa={'count':0x0,'rows':[]};var _0x4bb4c1=_['map'](db['AnalyticTreeReport'][_0x84a9('0x2a')],function(_0x3b5693){return{'name':_0x3b5693[_0x84a9('0x2b')],'type':_0x3b5693['type'][_0x84a9('0x2c')]};});_0x211aa0['model']=_[_0x84a9('0x2d')](_0x4bb4c1,_0x84a9('0x27'));_0x211aa0[_0x84a9('0x2e')]=_[_0x84a9('0x2f')](_0x42de6c[_0x84a9('0x2e')]);_0x211aa0[_0x84a9('0x30')]=_[_0x84a9('0x31')](_0x211aa0[_0x84a9('0x32')],_0x211aa0[_0x84a9('0x2e')]);_0x4196c1[_0x84a9('0x33')]=_['intersection'](_0x211aa0[_0x84a9('0x32')],qs[_0x84a9('0x34')](_0x42de6c[_0x84a9('0x2e')]['fields']));_0x4196c1[_0x84a9('0x33')]=_0x4196c1[_0x84a9('0x33')]['length']?_0x4196c1[_0x84a9('0x33')]:_0x211aa0['model'];if(!_0x42de6c[_0x84a9('0x2e')][_0x84a9('0x35')](_0x84a9('0x36'))){_0x4196c1[_0x84a9('0x1d')]=qs[_0x84a9('0x1d')](_0x42de6c[_0x84a9('0x2e')]['limit']);_0x4196c1[_0x84a9('0x1e')]=qs['offset'](_0x42de6c['query'][_0x84a9('0x1e')]);}_0x4196c1[_0x84a9('0x37')]=qs[_0x84a9('0x38')](_0x42de6c[_0x84a9('0x2e')]['sort']);_0x4196c1['where']=qs[_0x84a9('0x30')](_[_0x84a9('0x39')](_0x42de6c['query'],_0x211aa0[_0x84a9('0x30')]),_0x4bb4c1);if(_0x42de6c[_0x84a9('0x2e')][_0x84a9('0x3a')]){_0x4196c1[_0x84a9('0x3b')]=_[_0x84a9('0x3c')](_0x4196c1['where'],{'$or':_[_0x84a9('0x2d')](_0x4bb4c1,function(_0x268aba){if(_0x268aba[_0x84a9('0x3d')]!==_0x84a9('0x3e')){var _0x213433={};_0x213433[_0x268aba[_0x84a9('0x27')]]={'$like':'%'+_0x42de6c[_0x84a9('0x2e')]['filter']+'%'};return _0x213433;}})});}_0x4196c1=_[_0x84a9('0x3c')]({},_0x4196c1,_0x42de6c['options']);var _0x4066e8={'where':_0x4196c1['where']};return db['AnalyticTreeReport']['count'](_0x4066e8)[_0x84a9('0x24')](function(_0x2278bd){_0x5697fa[_0x84a9('0x3f')]=_0x2278bd;if(_0x42de6c['query'][_0x84a9('0x40')]){_0x4196c1[_0x84a9('0x41')]=[{'all':!![]}];}return db[_0x84a9('0x42')][_0x84a9('0x43')](_0x4196c1);})[_0x84a9('0x24')](function(_0x2c1fc2){_0x5697fa[_0x84a9('0x44')]=_0x2c1fc2;return _0x5697fa;})[_0x84a9('0x24')](respondWithFilteredResult(_0x52d9e5,_0x4196c1))[_0x84a9('0x45')](handleError(_0x52d9e5,null));};exports[_0x84a9('0x46')]=function(_0x214ed3,_0x31c554){var _0x40b236={'raw':!![],'where':{'id':_0x214ed3[_0x84a9('0x47')]['id']}},_0x41fa4b={};_0x41fa4b['model']=_[_0x84a9('0x2f')](db[_0x84a9('0x42')][_0x84a9('0x2a')]);_0x41fa4b[_0x84a9('0x2e')]=_['keys'](_0x214ed3[_0x84a9('0x2e')]);_0x41fa4b[_0x84a9('0x30')]=_[_0x84a9('0x31')](_0x41fa4b[_0x84a9('0x32')],_0x41fa4b['query']);_0x40b236[_0x84a9('0x33')]=_[_0x84a9('0x31')](_0x41fa4b[_0x84a9('0x32')],qs['fields'](_0x214ed3['query'][_0x84a9('0x34')]));_0x40b236['attributes']=_0x40b236[_0x84a9('0x33')]['length']?_0x40b236[_0x84a9('0x33')]:_0x41fa4b['model'];if(_0x214ed3['query'][_0x84a9('0x40')]){_0x40b236[_0x84a9('0x41')]=[{'all':!![]}];}_0x40b236=_[_0x84a9('0x3c')]({},_0x40b236,_0x214ed3['options']);return db[_0x84a9('0x42')]['find'](_0x40b236)['then'](handleEntityNotFound(_0x31c554,null))[_0x84a9('0x24')](respondWithResult(_0x31c554,null))[_0x84a9('0x45')](handleError(_0x31c554,null));};exports[_0x84a9('0x48')]=function(_0x1e0ff0,_0x128153){return db['AnalyticTreeReport'][_0x84a9('0x48')](_0x1e0ff0['body'],{})[_0x84a9('0x24')](respondWithResult(_0x128153,0xc9))[_0x84a9('0x45')](handleError(_0x128153,null));};exports[_0x84a9('0x23')]=function(_0xdb7247,_0x2bfd84){if(_0xdb7247[_0x84a9('0x49')]['id']){delete _0xdb7247[_0x84a9('0x49')]['id'];}return db[_0x84a9('0x42')][_0x84a9('0x4a')]({'where':{'id':_0xdb7247['params']['id']}})[_0x84a9('0x24')](handleEntityNotFound(_0x2bfd84,null))[_0x84a9('0x24')](saveUpdates(_0xdb7247['body'],null))[_0x84a9('0x24')](respondWithResult(_0x2bfd84,null))[_0x84a9('0x45')](handleError(_0x2bfd84,null));};exports[_0x84a9('0x25')]=function(_0x500779,_0x5cb1e5){return db[_0x84a9('0x42')]['find']({'where':{'id':_0x500779[_0x84a9('0x47')]['id']}})['then'](handleEntityNotFound(_0x5cb1e5,null))['then'](removeEntity(_0x5cb1e5,null))[_0x84a9('0x45')](handleError(_0x5cb1e5,null));};
\ No newline at end of file
+var _0xf5f5=['error','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','AnalyticTreeReport','findAll','rows','catch','show','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then'];(function(_0x313d6f,_0x122c8d){var _0x2059ac=function(_0x49c551){while(--_0x49c551){_0x313d6f['push'](_0x313d6f['shift']());}};_0x2059ac(++_0x122c8d);}(_0xf5f5,0xfe));var _0x5f5f=function(_0x236001,_0x243c37){_0x236001=_0x236001-0x0;var _0x5741a2=_0xf5f5[_0x236001];return _0x5741a2;};'use strict';var emlformat=require(_0x5f5f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f5f('0x1'));var jsonpatch=require(_0x5f5f('0x2'));var rp=require(_0x5f5f('0x3'));var moment=require('moment');var BPromise=require(_0x5f5f('0x4'));var Mustache=require('mustache');var util=require(_0x5f5f('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x5f5f('0x6'));var ejs=require(_0x5f5f('0x7'));var fs=require('fs');var fs_extra=require(_0x5f5f('0x8'));var _=require(_0x5f5f('0x9'));var squel=require(_0x5f5f('0xa'));var crypto=require(_0x5f5f('0xb'));var jsforce=require(_0x5f5f('0xc'));var deskjs=require(_0x5f5f('0xd'));var toCsv=require(_0x5f5f('0x6'));var querystring=require('querystring');var Papa=require(_0x5f5f('0xe'));var Redis=require(_0x5f5f('0xf'));var authService=require(_0x5f5f('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5f5f('0x11'));var logger=require(_0x5f5f('0x12'))(_0x5f5f('0x13'));var utils=require(_0x5f5f('0x14'));var config=require(_0x5f5f('0x15'));var licenseUtil=require(_0x5f5f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x434b4a,_0x526920){_0x526920=_0x526920||0xcc;return function(_0x352efe){if(_0x352efe){return _0x434b4a[_0x5f5f('0x17')](_0x526920);}return _0x434b4a['status'](_0x526920)[_0x5f5f('0x18')]();};}function respondWithResult(_0x30c463,_0x26672c){_0x26672c=_0x26672c||0xc8;return function(_0x32f7ee){if(_0x32f7ee){return _0x30c463[_0x5f5f('0x19')](_0x26672c)['json'](_0x32f7ee);}};}function respondWithFilteredResult(_0xabc1ae,_0x2c9b1c){return function(_0x30f982){if(_0x30f982){var _0x280c51=typeof _0x2c9b1c[_0x5f5f('0x1a')]===_0x5f5f('0x1b')&&typeof _0x2c9b1c[_0x5f5f('0x1c')]==='undefined';var _0xe0a2b9=_0x30f982[_0x5f5f('0x1d')];var _0x1934ac=_0x280c51?0x0:_0x2c9b1c[_0x5f5f('0x1a')];var _0x3f1759=_0x280c51?_0x30f982[_0x5f5f('0x1d')]:_0x2c9b1c['offset']+_0x2c9b1c['limit'];var _0x4b05cb;if(_0x3f1759>=_0xe0a2b9){_0x3f1759=_0xe0a2b9;_0x4b05cb=0xc8;}else{_0x4b05cb=0xce;}_0xabc1ae[_0x5f5f('0x19')](_0x4b05cb);return _0xabc1ae[_0x5f5f('0x1e')]('Content-Range',_0x1934ac+'-'+_0x3f1759+'/'+_0xe0a2b9)[_0x5f5f('0x1f')](_0x30f982);}return null;};}function patchUpdates(_0x3c1640){return function(_0x326ca0){try{jsonpatch[_0x5f5f('0x20')](_0x326ca0,_0x3c1640,!![]);}catch(_0x352051){return BPromise[_0x5f5f('0x21')](_0x352051);}return _0x326ca0[_0x5f5f('0x22')]();};}function saveUpdates(_0x5548a1,_0x55c669){return function(_0x52b7f7){if(_0x52b7f7){return _0x52b7f7[_0x5f5f('0x23')](_0x5548a1)['then'](function(_0x41fcbe){return _0x41fcbe;});}return null;};}function removeEntity(_0x40677a,_0x214d6c){return function(_0x3af4e1){if(_0x3af4e1){return _0x3af4e1[_0x5f5f('0x24')]()[_0x5f5f('0x25')](function(){_0x40677a[_0x5f5f('0x19')](0xcc)[_0x5f5f('0x18')]();});}};}function handleEntityNotFound(_0x5513c0,_0x2f8b32){return function(_0x457049){if(!_0x457049){_0x5513c0[_0x5f5f('0x17')](0x194);}return _0x457049;};}function handleError(_0x599e1f,_0x4adf45){_0x4adf45=_0x4adf45||0x1f4;return function(_0x232558){logger[_0x5f5f('0x26')](_0x232558['stack']);if(_0x232558['name']){delete _0x232558['name'];}_0x599e1f[_0x5f5f('0x19')](_0x4adf45)[_0x5f5f('0x27')](_0x232558);};}exports[_0x5f5f('0x28')]=function(_0x51d26f,_0x4ac8a6){var _0x1ddfdb={},_0x2e1c06={},_0x424f3c={'count':0x0,'rows':[]};var _0x1d5162=_[_0x5f5f('0x29')](db['AnalyticTreeReport'][_0x5f5f('0x2a')],function(_0x4ff504){return{'name':_0x4ff504[_0x5f5f('0x2b')],'type':_0x4ff504[_0x5f5f('0x2c')]['key']};});_0x2e1c06[_0x5f5f('0x2d')]=_[_0x5f5f('0x29')](_0x1d5162,'name');_0x2e1c06[_0x5f5f('0x2e')]=_[_0x5f5f('0x2f')](_0x51d26f['query']);_0x2e1c06[_0x5f5f('0x30')]=_['intersection'](_0x2e1c06[_0x5f5f('0x2d')],_0x2e1c06['query']);_0x1ddfdb[_0x5f5f('0x31')]=_[_0x5f5f('0x32')](_0x2e1c06[_0x5f5f('0x2d')],qs[_0x5f5f('0x33')](_0x51d26f[_0x5f5f('0x2e')][_0x5f5f('0x33')]));_0x1ddfdb[_0x5f5f('0x31')]=_0x1ddfdb[_0x5f5f('0x31')][_0x5f5f('0x34')]?_0x1ddfdb[_0x5f5f('0x31')]:_0x2e1c06[_0x5f5f('0x2d')];if(!_0x51d26f[_0x5f5f('0x2e')][_0x5f5f('0x35')](_0x5f5f('0x36'))){_0x1ddfdb[_0x5f5f('0x1c')]=qs[_0x5f5f('0x1c')](_0x51d26f[_0x5f5f('0x2e')][_0x5f5f('0x1c')]);_0x1ddfdb[_0x5f5f('0x1a')]=qs[_0x5f5f('0x1a')](_0x51d26f['query'][_0x5f5f('0x1a')]);}_0x1ddfdb[_0x5f5f('0x37')]=qs[_0x5f5f('0x38')](_0x51d26f['query'][_0x5f5f('0x38')]);_0x1ddfdb['where']=qs['filters'](_[_0x5f5f('0x39')](_0x51d26f[_0x5f5f('0x2e')],_0x2e1c06[_0x5f5f('0x30')]),_0x1d5162);if(_0x51d26f[_0x5f5f('0x2e')][_0x5f5f('0x3a')]){_0x1ddfdb[_0x5f5f('0x3b')]=_[_0x5f5f('0x3c')](_0x1ddfdb[_0x5f5f('0x3b')],{'$or':_[_0x5f5f('0x29')](_0x1d5162,function(_0x318dca){if(_0x318dca[_0x5f5f('0x2c')]!=='VIRTUAL'){var _0x5892cd={};_0x5892cd[_0x318dca['name']]={'$like':'%'+_0x51d26f['query'][_0x5f5f('0x3a')]+'%'};return _0x5892cd;}})});}_0x1ddfdb=_[_0x5f5f('0x3c')]({},_0x1ddfdb,_0x51d26f[_0x5f5f('0x3d')]);var _0x30817b={'where':_0x1ddfdb[_0x5f5f('0x3b')]};return db['AnalyticTreeReport']['count'](_0x30817b)['then'](function(_0x115ffe){_0x424f3c[_0x5f5f('0x1d')]=_0x115ffe;if(_0x51d26f[_0x5f5f('0x2e')][_0x5f5f('0x3e')]){_0x1ddfdb[_0x5f5f('0x3f')]=[{'all':!![]}];}return db[_0x5f5f('0x40')][_0x5f5f('0x41')](_0x1ddfdb);})[_0x5f5f('0x25')](function(_0x3ea1c9){_0x424f3c[_0x5f5f('0x42')]=_0x3ea1c9;return _0x424f3c;})[_0x5f5f('0x25')](respondWithFilteredResult(_0x4ac8a6,_0x1ddfdb))[_0x5f5f('0x43')](handleError(_0x4ac8a6,null));};exports[_0x5f5f('0x44')]=function(_0x15348d,_0x40e936){var _0x137f1c={'raw':!![],'where':{'id':_0x15348d['params']['id']}},_0x1640e6={};_0x1640e6[_0x5f5f('0x2d')]=_[_0x5f5f('0x2f')](db[_0x5f5f('0x40')][_0x5f5f('0x2a')]);_0x1640e6['query']=_['keys'](_0x15348d[_0x5f5f('0x2e')]);_0x1640e6[_0x5f5f('0x30')]=_[_0x5f5f('0x32')](_0x1640e6['model'],_0x1640e6[_0x5f5f('0x2e')]);_0x137f1c['attributes']=_[_0x5f5f('0x32')](_0x1640e6[_0x5f5f('0x2d')],qs[_0x5f5f('0x33')](_0x15348d[_0x5f5f('0x2e')]['fields']));_0x137f1c[_0x5f5f('0x31')]=_0x137f1c['attributes'][_0x5f5f('0x34')]?_0x137f1c['attributes']:_0x1640e6['model'];if(_0x15348d[_0x5f5f('0x2e')][_0x5f5f('0x3e')]){_0x137f1c[_0x5f5f('0x3f')]=[{'all':!![]}];}_0x137f1c=_['merge']({},_0x137f1c,_0x15348d[_0x5f5f('0x3d')]);return db[_0x5f5f('0x40')][_0x5f5f('0x45')](_0x137f1c)['then'](handleEntityNotFound(_0x40e936,null))['then'](respondWithResult(_0x40e936,null))['catch'](handleError(_0x40e936,null));};exports[_0x5f5f('0x46')]=function(_0x2bc0b2,_0x18b00a){return db['AnalyticTreeReport'][_0x5f5f('0x46')](_0x2bc0b2[_0x5f5f('0x47')],{})['then'](respondWithResult(_0x18b00a,0xc9))['catch'](handleError(_0x18b00a,null));};exports['update']=function(_0x3cd8fa,_0x1ff282){if(_0x3cd8fa[_0x5f5f('0x47')]['id']){delete _0x3cd8fa[_0x5f5f('0x47')]['id'];}return db[_0x5f5f('0x40')][_0x5f5f('0x45')]({'where':{'id':_0x3cd8fa[_0x5f5f('0x48')]['id']}})['then'](handleEntityNotFound(_0x1ff282,null))['then'](saveUpdates(_0x3cd8fa['body'],null))[_0x5f5f('0x25')](respondWithResult(_0x1ff282,null))[_0x5f5f('0x43')](handleError(_0x1ff282,null));};exports[_0x5f5f('0x24')]=function(_0x996d53,_0x3edc5a){return db[_0x5f5f('0x40')][_0x5f5f('0x45')]({'where':{'id':_0x996d53[_0x5f5f('0x48')]['id']}})[_0x5f5f('0x25')](handleEntityNotFound(_0x3edc5a,null))[_0x5f5f('0x25')](removeEntity(_0x3edc5a,null))[_0x5f5f('0x43')](handleError(_0x3edc5a,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 0437726..8fe1578 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 _0x7869=['lodash','moment','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees'];(function(_0x40570d,_0x173745){var _0x53bc05=function(_0x2e0259){while(--_0x2e0259){_0x40570d['push'](_0x40570d['shift']());}};_0x53bc05(++_0x173745);}(_0x7869,0x172));var _0x9786=function(_0xb434e5,_0x4d78d3){_0xb434e5=_0xb434e5-0x0;var _0x1775bf=_0x7869[_0xb434e5];return _0x1775bf;};'use strict';var _=require(_0x9786('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x9786('0x1'));var BPromise=require(_0x9786('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9786('0x3'));var rimraf=require(_0x9786('0x4'));var config=require(_0x9786('0x5'));var attributes=require(_0x9786('0x6'));module['exports']=function(_0x140015,_0x262c6d){return _0x140015[_0x9786('0x7')](_0x9786('0x8'),attributes,{'tableName':_0x9786('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6527=['bluebird','request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api'];(function(_0x4e713e,_0x1ac682){var _0x296ac0=function(_0x26a297){while(--_0x26a297){_0x4e713e['push'](_0x4e713e['shift']());}};_0x296ac0(++_0x1ac682);}(_0x6527,0x10d));var _0x7652=function(_0x508d96,_0x4774cb){_0x508d96=_0x508d96-0x0;var _0x445799=_0x6527[_0x508d96];return _0x445799;};'use strict';var _=require(_0x7652('0x0'));var util=require(_0x7652('0x1'));var logger=require(_0x7652('0x2'))(_0x7652('0x3'));var moment=require('moment');var BPromise=require(_0x7652('0x4'));var rp=require(_0x7652('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7652('0x6'));var config=require(_0x7652('0x7'));var attributes=require(_0x7652('0x8'));module[_0x7652('0x9')]=function(_0x3986be,_0xf31d96){return _0x3986be[_0x7652('0xa')](_0x7652('0xb'),attributes,{'tableName':_0x7652('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index e8d5950..7af6320 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x54dd29,_0x4417dd){var _0x370bc6=function(_0x1f5391){while(--_0x1f5391){_0x54dd29['push'](_0x54dd29['shift']());}};_0x370bc6(++_0x4417dd);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xc4aa[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x266d8c,_0x1d0f0b){var _0x1ca7a1=function(_0x3ab29c){while(--_0x3ab29c){_0x266d8c['push'](_0x266d8c['shift']());}};_0x1ca7a1(++_0x1d0f0b);}(_0xdb28,0x106));var _0x8db2=function(_0x474a36,_0x3f534a){_0x474a36=_0x474a36-0x0;var _0x4a4529=_0xdb28[_0x474a36];return _0x4a4529;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 20a21bf..5b683a5 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 _0x8794=['../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','/:id','create','put','update','delete','destroy','multer','util','fs-extra','../../components/interaction/service'];(function(_0x3c0569,_0x11da9f){var _0x142524=function(_0x59a41e){while(--_0x59a41e){_0x3c0569['push'](_0x3c0569['shift']());}};_0x142524(++_0x11da9f);}(_0x8794,0x6c));var _0x4879=function(_0x1a4dd7,_0x5487e5){_0x1a4dd7=_0x1a4dd7-0x0;var _0x48c2af=_0x8794[_0x1a4dd7];return _0x48c2af;};'use strict';var multer=require(_0x4879('0x0'));var util=require(_0x4879('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x4879('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x4879('0x3'));var config=require(_0x4879('0x4'));var controller=require(_0x4879('0x5'));router['get']('/',auth[_0x4879('0x6')](),controller[_0x4879('0x7')]);router['get'](_0x4879('0x8'),auth[_0x4879('0x6')](),controller['show']);router['post']('/',auth[_0x4879('0x6')](),controller[_0x4879('0x9')]);router[_0x4879('0xa')](_0x4879('0x8'),auth[_0x4879('0x6')](),controller[_0x4879('0xb')]);router[_0x4879('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x4879('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0xa437=['../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','index','get','isAuthenticated','show','put','/:id','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2dfffc,_0x3411af){var _0xf9d20d=function(_0x137b78){while(--_0x137b78){_0x2dfffc['push'](_0x2dfffc['shift']());}};_0xf9d20d(++_0x3411af);}(_0xa437,0xd1));var _0x7a43=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa437[_0x220dbb];return _0x2b77de;};'use strict';var multer=require(_0x7a43('0x0'));var util=require('util');var path=require(_0x7a43('0x1'));var timeout=require(_0x7a43('0x2'));var express=require(_0x7a43('0x3'));var router=express[_0x7a43('0x4')]();var fs_extra=require(_0x7a43('0x5'));var auth=require(_0x7a43('0x6'));var interaction=require(_0x7a43('0x7'));var config=require(_0x7a43('0x8'));var controller=require(_0x7a43('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7a43('0xa')]);router[_0x7a43('0xb')]('/:id',auth[_0x7a43('0xc')](),controller[_0x7a43('0xd')]);router['post']('/',auth[_0x7a43('0xc')](),controller['create']);router[_0x7a43('0xe')](_0x7a43('0xf'),auth[_0x7a43('0xc')](),controller['update']);router[_0x7a43('0x10')](_0x7a43('0xf'),auth['isAuthenticated'](),controller[_0x7a43('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 34c3874..3650453 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 _0xac95=['sequelize','exports','STRING'];(function(_0x2e5590,_0x522539){var _0x358234=function(_0x43a45b){while(--_0x43a45b){_0x2e5590['push'](_0x2e5590['shift']());}};_0x358234(++_0x522539);}(_0xac95,0xa8));var _0x5ac9=function(_0x5e8836,_0x207ce8){_0x5e8836=_0x5e8836-0x0;var _0x30c99a=_0xac95[_0x5e8836];return _0x30c99a;};'use strict';var Sequelize=require(_0x5ac9('0x0'));module[_0x5ac9('0x1')]={'name':{'type':Sequelize[_0x5ac9('0x2')]},'basename':{'type':Sequelize[_0x5ac9('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0eec=['sequelize','STRING'];(function(_0x32e7d6,_0x214dda){var _0x481e8c=function(_0x1c800a){while(--_0x1c800a){_0x32e7d6['push'](_0x32e7d6['shift']());}};_0x481e8c(++_0x214dda);}(_0x0eec,0xac));var _0xc0ee=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0eec[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xc0ee('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xc0ee('0x1')]},'type':{'type':Sequelize[_0xc0ee('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 249e688..758ed87 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 _0x13a7=['path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','end','undefined','limit','offset','Content-Range','json','apply','reject','save','update','then','error','stack','name','index','map','Attachment','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','filter','options','count','includeAll','include','catch','params','merge','find','clone','intersection','updatedAt','omit','body','createdAt','create','destroy','file','originalname','basename','filename','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x5276f1,_0x1fcf3f){var _0xa2d451=function(_0x59de19){while(--_0x59de19){_0x5276f1['push'](_0x5276f1['shift']());}};_0xa2d451(++_0x1fcf3f);}(_0x13a7,0x159));var _0x713a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x13a7[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x713a('0x0'));var rimraf=require(_0x713a('0x1'));var zipdir=require(_0x713a('0x2'));var jsonpatch=require(_0x713a('0x3'));var rp=require(_0x713a('0x4'));var moment=require(_0x713a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x713a('0x6'));var util=require('util');var path=require(_0x713a('0x7'));var sox=require(_0x713a('0x8'));var csv=require(_0x713a('0x9'));var ejs=require(_0x713a('0xa'));var fs=require('fs');var fs_extra=require(_0x713a('0xb'));var _=require('lodash');var squel=require(_0x713a('0xc'));var crypto=require(_0x713a('0xd'));var jsforce=require(_0x713a('0xe'));var deskjs=require(_0x713a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x713a('0x10'));var Papa=require(_0x713a('0x11'));var Redis=require(_0x713a('0x12'));var authService=require(_0x713a('0x13'));var qs=require(_0x713a('0x14'));var as=require(_0x713a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x713a('0x16'));var utils=require(_0x713a('0x17'));var config=require(_0x713a('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41fcd2,_0x311de8){_0x311de8=_0x311de8||0xcc;return function(_0x22b4a3){if(_0x22b4a3){return _0x41fcd2[_0x713a('0x19')](_0x311de8);}return _0x41fcd2[_0x713a('0x1a')](_0x311de8)[_0x713a('0x1b')]();};}function respondWithResult(_0x190c33,_0x5b4842){_0x5b4842=_0x5b4842||0xc8;return function(_0x36d00d){if(_0x36d00d){return _0x190c33[_0x713a('0x1a')](_0x5b4842)['json'](_0x36d00d);}};}function respondWithFilteredResult(_0xae7ae1,_0x2446ed){return function(_0x1b5768){if(_0x1b5768){var _0x12bf50=typeof _0x2446ed['offset']===_0x713a('0x1c')&&typeof _0x2446ed[_0x713a('0x1d')]===_0x713a('0x1c');var _0x5cb65b=_0x1b5768['count'];var _0x5c2129=_0x12bf50?0x0:_0x2446ed[_0x713a('0x1e')];var _0x227e56=_0x12bf50?_0x1b5768['count']:_0x2446ed[_0x713a('0x1e')]+_0x2446ed['limit'];var _0x4772d3;if(_0x227e56>=_0x5cb65b){_0x227e56=_0x5cb65b;_0x4772d3=0xc8;}else{_0x4772d3=0xce;}_0xae7ae1[_0x713a('0x1a')](_0x4772d3);return _0xae7ae1['set'](_0x713a('0x1f'),_0x5c2129+'-'+_0x227e56+'/'+_0x5cb65b)[_0x713a('0x20')](_0x1b5768);}return null;};}function patchUpdates(_0x639efd){return function(_0x1015e3){try{jsonpatch[_0x713a('0x21')](_0x1015e3,_0x639efd,!![]);}catch(_0x30f9a2){return BPromise[_0x713a('0x22')](_0x30f9a2);}return _0x1015e3[_0x713a('0x23')]();};}function saveUpdates(_0x495664,_0x552ae7){return function(_0x38b1f6){if(_0x38b1f6){return _0x38b1f6[_0x713a('0x24')](_0x495664)[_0x713a('0x25')](function(_0x5defcc){return _0x5defcc;});}return null;};}function removeEntity(_0x313f28,_0x43c8c6){return function(_0x2b4ead){if(_0x2b4ead){return _0x2b4ead['destroy']()['then'](function(){_0x313f28['status'](0xcc)[_0x713a('0x1b')]();});}};}function handleEntityNotFound(_0x1cd189,_0x237fe9){return function(_0x16c2c9){if(!_0x16c2c9){_0x1cd189[_0x713a('0x19')](0x194);}return _0x16c2c9;};}function handleError(_0x5726f1,_0xb65dcd){_0xb65dcd=_0xb65dcd||0x1f4;return function(_0x29a67f){logger[_0x713a('0x26')](_0x29a67f[_0x713a('0x27')]);if(_0x29a67f[_0x713a('0x28')]){delete _0x29a67f['name'];}_0x5726f1[_0x713a('0x1a')](_0xb65dcd)['send'](_0x29a67f);};}exports[_0x713a('0x29')]=function(_0x59435d,_0x50a136){var _0x4fa258={},_0x2f6292={},_0x15b39b={'count':0x0,'rows':[]};var _0xac389a=_[_0x713a('0x2a')](db[_0x713a('0x2b')][_0x713a('0x2c')],function(_0x1bd869){return{'name':_0x1bd869[_0x713a('0x2d')],'type':_0x1bd869['type'][_0x713a('0x2e')]};});_0x2f6292[_0x713a('0x2f')]=_[_0x713a('0x2a')](_0xac389a,_0x713a('0x28'));_0x2f6292[_0x713a('0x30')]=_[_0x713a('0x31')](_0x59435d[_0x713a('0x30')]);_0x2f6292[_0x713a('0x32')]=_['intersection'](_0x2f6292['model'],_0x2f6292['query']);_0x4fa258[_0x713a('0x33')]=_['intersection'](_0x2f6292[_0x713a('0x2f')],qs[_0x713a('0x34')](_0x59435d[_0x713a('0x30')]['fields']));_0x4fa258[_0x713a('0x33')]=_0x4fa258[_0x713a('0x33')][_0x713a('0x35')]?_0x4fa258[_0x713a('0x33')]:_0x2f6292['model'];if(!_0x59435d[_0x713a('0x30')][_0x713a('0x36')]('nolimit')){_0x4fa258[_0x713a('0x1d')]=qs[_0x713a('0x1d')](_0x59435d[_0x713a('0x30')][_0x713a('0x1d')]);_0x4fa258[_0x713a('0x1e')]=qs['offset'](_0x59435d[_0x713a('0x30')][_0x713a('0x1e')]);}_0x4fa258[_0x713a('0x37')]=qs[_0x713a('0x38')](_0x59435d['query'][_0x713a('0x38')]);_0x4fa258[_0x713a('0x39')]=qs['filters'](_[_0x713a('0x3a')](_0x59435d[_0x713a('0x30')],_0x2f6292[_0x713a('0x32')]),_0xac389a);if(_0x59435d[_0x713a('0x30')]['filter']){_0x4fa258[_0x713a('0x39')]=_['merge'](_0x4fa258[_0x713a('0x39')],{'$or':_[_0x713a('0x2a')](_0xac389a,function(_0x5c47bf){if(_0x5c47bf[_0x713a('0x3b')]!==_0x713a('0x3c')){var _0x369a68={};_0x369a68[_0x5c47bf[_0x713a('0x28')]]={'$like':'%'+_0x59435d[_0x713a('0x30')][_0x713a('0x3d')]+'%'};return _0x369a68;}})});}_0x4fa258=_['merge']({},_0x4fa258,_0x59435d[_0x713a('0x3e')]);var _0x2d0381={'where':_0x4fa258[_0x713a('0x39')]};return db[_0x713a('0x2b')][_0x713a('0x3f')](_0x2d0381)['then'](function(_0x29ee4b){_0x15b39b['count']=_0x29ee4b;if(_0x59435d[_0x713a('0x30')][_0x713a('0x40')]){_0x4fa258[_0x713a('0x41')]=[{'all':!![]}];}return db[_0x713a('0x2b')]['findAll'](_0x4fa258);})[_0x713a('0x25')](function(_0x5b4e67){_0x15b39b['rows']=_0x5b4e67;return _0x15b39b;})[_0x713a('0x25')](respondWithFilteredResult(_0x50a136,_0x4fa258))[_0x713a('0x42')](handleError(_0x50a136,null));};exports['show']=function(_0x5f35b0,_0x4851f7){var _0x569e5c={'raw':!![],'where':{'id':_0x5f35b0[_0x713a('0x43')]['id']}},_0x5bb7a1={};_0x5bb7a1['model']=_['keys'](db['Attachment'][_0x713a('0x2c')]);_0x5bb7a1[_0x713a('0x30')]=_[_0x713a('0x31')](_0x5f35b0['query']);_0x5bb7a1[_0x713a('0x32')]=_['intersection'](_0x5bb7a1[_0x713a('0x2f')],_0x5bb7a1['query']);_0x569e5c['attributes']=_['intersection'](_0x5bb7a1[_0x713a('0x2f')],qs[_0x713a('0x34')](_0x5f35b0['query'][_0x713a('0x34')]));_0x569e5c[_0x713a('0x33')]=_0x569e5c['attributes'][_0x713a('0x35')]?_0x569e5c[_0x713a('0x33')]:_0x5bb7a1['model'];if(_0x5f35b0[_0x713a('0x30')][_0x713a('0x40')]){_0x569e5c[_0x713a('0x41')]=[{'all':!![]}];}_0x569e5c=_[_0x713a('0x44')]({},_0x569e5c,_0x5f35b0[_0x713a('0x3e')]);return db[_0x713a('0x2b')][_0x713a('0x45')](_0x569e5c)['then'](handleEntityNotFound(_0x4851f7,null))[_0x713a('0x25')](respondWithResult(_0x4851f7,null))[_0x713a('0x42')](handleError(_0x4851f7,null));};exports[_0x713a('0x46')]=function(_0x1c2817,_0x526063){var _0x1731dc={'where':{'id':_0x1c2817[_0x713a('0x43')]['id']}},_0x4c0cb6={};_0x4c0cb6['model']=_[_0x713a('0x31')](db['Attachment'][_0x713a('0x2c')]);_0x1731dc[_0x713a('0x33')]=_[_0x713a('0x47')](_0x4c0cb6[_0x713a('0x2f')],qs[_0x713a('0x34')](_0x1c2817['query'][_0x713a('0x34')]));_0x1731dc['attributes']=_0x1731dc[_0x713a('0x33')][_0x713a('0x35')]?_0x1731dc['attributes']:_0x4c0cb6[_0x713a('0x2f')];if(_0x1c2817[_0x713a('0x30')][_0x713a('0x40')]){_0x1731dc[_0x713a('0x41')]=[{'all':!![]}];}_0x1731dc=_[_0x713a('0x44')]({},_0x1731dc,_0x1c2817['options']);return db[_0x713a('0x2b')][_0x713a('0x45')](_0x1731dc)[_0x713a('0x25')](handleEntityNotFound(_0x526063,null))[_0x713a('0x25')](function(_0x1f5a1a){if(_0x1f5a1a){var _0x171b09=_0x1f5a1a['get']({'plain':!![]});_0x171b09=qs['omit'](_0x171b09,['id','createdAt',_0x713a('0x48')]);_0x1c2817['body']=_[_0x713a('0x49')](_0x1c2817[_0x713a('0x4a')],['id',_0x713a('0x4b'),_0x713a('0x48')]);return db[_0x713a('0x2b')][_0x713a('0x4c')](_['merge'](_0x171b09,_0x1c2817[_0x713a('0x4a')]),{'include':_0x1c2817[_0x713a('0x30')][_0x713a('0x40')]?[{'all':!![]}]:undefined});}})[_0x713a('0x25')](respondWithResult(_0x526063,0xc9))[_0x713a('0x42')](handleError(_0x526063,null));};exports['update']=function(_0x291ffe,_0x50af43){if(_0x291ffe[_0x713a('0x4a')]['id']){delete _0x291ffe[_0x713a('0x4a')]['id'];}return db[_0x713a('0x2b')][_0x713a('0x45')]({'where':{'id':_0x291ffe[_0x713a('0x43')]['id']}})[_0x713a('0x25')](handleEntityNotFound(_0x50af43,null))['then'](saveUpdates(_0x291ffe[_0x713a('0x4a')],null))[_0x713a('0x25')](respondWithResult(_0x50af43,null))[_0x713a('0x42')](handleError(_0x50af43,null));};exports[_0x713a('0x4d')]=function(_0x4898be,_0x2f2255){return db[_0x713a('0x2b')][_0x713a('0x45')]({'where':{'id':_0x4898be[_0x713a('0x43')]['id']}})[_0x713a('0x25')](handleEntityNotFound(_0x2f2255,null))[_0x713a('0x25')](removeEntity(_0x2f2255,null))['catch'](handleError(_0x2f2255,null));};exports['create']=function(_0x4847a2,_0x146a80,_0x2fa097){_0x4847a2[_0x713a('0x4a')][_0x713a('0x28')]=_0x4847a2[_0x713a('0x4e')][_0x713a('0x4f')];_0x4847a2[_0x713a('0x4a')][_0x713a('0x50')]=_0x4847a2[_0x713a('0x4e')][_0x713a('0x51')];_0x4847a2[_0x713a('0x4a')][_0x713a('0x3b')]=_0x4847a2[_0x713a('0x4e')]['mimetype'];return db[_0x713a('0x2b')][_0x713a('0x4c')](_0x4847a2[_0x713a('0x4a')])[_0x713a('0x25')](respondWithResult(_0x146a80,0xc9))[_0x713a('0x42')](handleError(_0x146a80,null));};exports[_0x713a('0x52')]=function(_0x1e19da,_0x6ab91e,_0x37a51b){return db[_0x713a('0x2b')][_0x713a('0x53')]({'where':{'id':_0x1e19da[_0x713a('0x43')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x6ab91e,null))[_0x713a('0x25')](function(_0x52842f){if(_0x52842f){var _0x44926a=_0x52842f[_0x713a('0x54')]!==null;var _0x58f767=path[_0x713a('0x55')](config['root'],_0x713a('0x56'));if(_0x44926a){_0x58f767=path['join'](_0x58f767,_0x713a('0x57'));}var _0x4b6ac6=path[_0x713a('0x55')](_0x58f767,_0x52842f[_0x713a('0x50')]);return _0x6ab91e[_0x713a('0x52')](_0x4b6ac6);}})[_0x713a('0x42')](handleError(_0x6ab91e,null));};
\ No newline at end of file
+var _0x7899=['length','hasOwnProperty','nolimit','offset','order','sort','where','filters','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','clone','find','get','omit','createdAt','updatedAt','body','basename','file','create','ChatOfflineMessageId','join','server/files/attachments/','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','limit','undefined','count','set','apply','save','update','then','error','stack','name','send','index','map','Attachment','key','query','keys','intersection','model','attributes','fields'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7899,0x11a));var _0x9789=function(_0x2b49bc,_0x47b636){_0x2b49bc=_0x2b49bc-0x0;var _0x43cc65=_0x7899[_0x2b49bc];return _0x43cc65;};'use strict';var emlformat=require(_0x9789('0x0'));var rimraf=require(_0x9789('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9789('0x2'));var rp=require(_0x9789('0x3'));var moment=require(_0x9789('0x4'));var BPromise=require(_0x9789('0x5'));var Mustache=require(_0x9789('0x6'));var util=require(_0x9789('0x7'));var path=require(_0x9789('0x8'));var sox=require(_0x9789('0x9'));var csv=require(_0x9789('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9789('0xb'));var _=require(_0x9789('0xc'));var squel=require(_0x9789('0xd'));var crypto=require(_0x9789('0xe'));var jsforce=require(_0x9789('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x9789('0xa'));var querystring=require(_0x9789('0x10'));var Papa=require(_0x9789('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9789('0x12'));var as=require(_0x9789('0x13'));var hardwareService=require(_0x9789('0x14'));var logger=require(_0x9789('0x15'))(_0x9789('0x16'));var utils=require('../../config/utils');var config=require(_0x9789('0x17'));var licenseUtil=require(_0x9789('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53ad89,_0x31699f){_0x31699f=_0x31699f||0xcc;return function(_0x4dfb9c){if(_0x4dfb9c){return _0x53ad89[_0x9789('0x19')](_0x31699f);}return _0x53ad89[_0x9789('0x1a')](_0x31699f)[_0x9789('0x1b')]();};}function respondWithResult(_0x233190,_0x2b8fff){_0x2b8fff=_0x2b8fff||0xc8;return function(_0x2be765){if(_0x2be765){return _0x233190[_0x9789('0x1a')](_0x2b8fff)['json'](_0x2be765);}};}function respondWithFilteredResult(_0x2f31fd,_0x3b5e50){return function(_0xd24e2e){if(_0xd24e2e){var _0x56ed6d=typeof _0x3b5e50['offset']==='undefined'&&typeof _0x3b5e50[_0x9789('0x1c')]===_0x9789('0x1d');var _0x1d1812=_0xd24e2e[_0x9789('0x1e')];var _0x49c822=_0x56ed6d?0x0:_0x3b5e50['offset'];var _0x57b96a=_0x56ed6d?_0xd24e2e[_0x9789('0x1e')]:_0x3b5e50['offset']+_0x3b5e50[_0x9789('0x1c')];var _0x16ce56;if(_0x57b96a>=_0x1d1812){_0x57b96a=_0x1d1812;_0x16ce56=0xc8;}else{_0x16ce56=0xce;}_0x2f31fd[_0x9789('0x1a')](_0x16ce56);return _0x2f31fd[_0x9789('0x1f')]('Content-Range',_0x49c822+'-'+_0x57b96a+'/'+_0x1d1812)['json'](_0xd24e2e);}return null;};}function patchUpdates(_0x3bde61){return function(_0x35c74c){try{jsonpatch[_0x9789('0x20')](_0x35c74c,_0x3bde61,!![]);}catch(_0x18dfa3){return BPromise['reject'](_0x18dfa3);}return _0x35c74c[_0x9789('0x21')]();};}function saveUpdates(_0x4a8e78,_0x18c39a){return function(_0x441ccb){if(_0x441ccb){return _0x441ccb[_0x9789('0x22')](_0x4a8e78)[_0x9789('0x23')](function(_0x121588){return _0x121588;});}return null;};}function removeEntity(_0x1990e0,_0x256ff4){return function(_0x183353){if(_0x183353){return _0x183353['destroy']()[_0x9789('0x23')](function(){_0x1990e0[_0x9789('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d030a,_0x20931d){return function(_0x54e19f){if(!_0x54e19f){_0x5d030a['sendStatus'](0x194);}return _0x54e19f;};}function handleError(_0x254180,_0xa217dc){_0xa217dc=_0xa217dc||0x1f4;return function(_0x174916){logger[_0x9789('0x24')](_0x174916[_0x9789('0x25')]);if(_0x174916[_0x9789('0x26')]){delete _0x174916[_0x9789('0x26')];}_0x254180[_0x9789('0x1a')](_0xa217dc)[_0x9789('0x27')](_0x174916);};}exports[_0x9789('0x28')]=function(_0x3bc7e8,_0x2fed92){var _0x188780={},_0x70d603={},_0x383b49={'count':0x0,'rows':[]};var _0x3735e8=_[_0x9789('0x29')](db[_0x9789('0x2a')]['rawAttributes'],function(_0x34d3b2){return{'name':_0x34d3b2['fieldName'],'type':_0x34d3b2['type'][_0x9789('0x2b')]};});_0x70d603['model']=_[_0x9789('0x29')](_0x3735e8,_0x9789('0x26'));_0x70d603[_0x9789('0x2c')]=_[_0x9789('0x2d')](_0x3bc7e8[_0x9789('0x2c')]);_0x70d603['filters']=_[_0x9789('0x2e')](_0x70d603[_0x9789('0x2f')],_0x70d603[_0x9789('0x2c')]);_0x188780[_0x9789('0x30')]=_[_0x9789('0x2e')](_0x70d603['model'],qs[_0x9789('0x31')](_0x3bc7e8[_0x9789('0x2c')]['fields']));_0x188780[_0x9789('0x30')]=_0x188780[_0x9789('0x30')][_0x9789('0x32')]?_0x188780[_0x9789('0x30')]:_0x70d603[_0x9789('0x2f')];if(!_0x3bc7e8[_0x9789('0x2c')][_0x9789('0x33')](_0x9789('0x34'))){_0x188780[_0x9789('0x1c')]=qs[_0x9789('0x1c')](_0x3bc7e8[_0x9789('0x2c')][_0x9789('0x1c')]);_0x188780[_0x9789('0x35')]=qs['offset'](_0x3bc7e8[_0x9789('0x2c')][_0x9789('0x35')]);}_0x188780[_0x9789('0x36')]=qs['sort'](_0x3bc7e8[_0x9789('0x2c')][_0x9789('0x37')]);_0x188780[_0x9789('0x38')]=qs[_0x9789('0x39')](_['pick'](_0x3bc7e8[_0x9789('0x2c')],_0x70d603['filters']),_0x3735e8);if(_0x3bc7e8[_0x9789('0x2c')]['filter']){_0x188780[_0x9789('0x38')]=_['merge'](_0x188780[_0x9789('0x38')],{'$or':_[_0x9789('0x29')](_0x3735e8,function(_0x37f230){if(_0x37f230[_0x9789('0x3a')]!==_0x9789('0x3b')){var _0x292e02={};_0x292e02[_0x37f230[_0x9789('0x26')]]={'$like':'%'+_0x3bc7e8['query']['filter']+'%'};return _0x292e02;}})});}_0x188780=_[_0x9789('0x3c')]({},_0x188780,_0x3bc7e8['options']);var _0xaf277b={'where':_0x188780[_0x9789('0x38')]};return db[_0x9789('0x2a')]['count'](_0xaf277b)['then'](function(_0x4786e7){_0x383b49[_0x9789('0x1e')]=_0x4786e7;if(_0x3bc7e8['query'][_0x9789('0x3d')]){_0x188780[_0x9789('0x3e')]=[{'all':!![]}];}return db[_0x9789('0x2a')][_0x9789('0x3f')](_0x188780);})[_0x9789('0x23')](function(_0x45540d){_0x383b49[_0x9789('0x40')]=_0x45540d;return _0x383b49;})['then'](respondWithFilteredResult(_0x2fed92,_0x188780))[_0x9789('0x41')](handleError(_0x2fed92,null));};exports[_0x9789('0x42')]=function(_0x2d854e,_0x5ba6ae){var _0x545fd1={'raw':!![],'where':{'id':_0x2d854e[_0x9789('0x43')]['id']}},_0x8d17dc={};_0x8d17dc[_0x9789('0x2f')]=_[_0x9789('0x2d')](db[_0x9789('0x2a')][_0x9789('0x44')]);_0x8d17dc[_0x9789('0x2c')]=_['keys'](_0x2d854e['query']);_0x8d17dc[_0x9789('0x39')]=_[_0x9789('0x2e')](_0x8d17dc[_0x9789('0x2f')],_0x8d17dc[_0x9789('0x2c')]);_0x545fd1[_0x9789('0x30')]=_[_0x9789('0x2e')](_0x8d17dc[_0x9789('0x2f')],qs[_0x9789('0x31')](_0x2d854e[_0x9789('0x2c')][_0x9789('0x31')]));_0x545fd1[_0x9789('0x30')]=_0x545fd1[_0x9789('0x30')][_0x9789('0x32')]?_0x545fd1[_0x9789('0x30')]:_0x8d17dc[_0x9789('0x2f')];if(_0x2d854e[_0x9789('0x2c')][_0x9789('0x3d')]){_0x545fd1[_0x9789('0x3e')]=[{'all':!![]}];}_0x545fd1=_[_0x9789('0x3c')]({},_0x545fd1,_0x2d854e[_0x9789('0x45')]);return db[_0x9789('0x2a')]['find'](_0x545fd1)[_0x9789('0x23')](handleEntityNotFound(_0x5ba6ae,null))[_0x9789('0x23')](respondWithResult(_0x5ba6ae,null))[_0x9789('0x41')](handleError(_0x5ba6ae,null));};exports[_0x9789('0x46')]=function(_0x44c219,_0x38f40f){var _0x39b746={'where':{'id':_0x44c219[_0x9789('0x43')]['id']}},_0xce4c77={};_0xce4c77['model']=_[_0x9789('0x2d')](db['Attachment'][_0x9789('0x44')]);_0x39b746[_0x9789('0x30')]=_['intersection'](_0xce4c77[_0x9789('0x2f')],qs[_0x9789('0x31')](_0x44c219[_0x9789('0x2c')][_0x9789('0x31')]));_0x39b746[_0x9789('0x30')]=_0x39b746['attributes'][_0x9789('0x32')]?_0x39b746[_0x9789('0x30')]:_0xce4c77['model'];if(_0x44c219['query'][_0x9789('0x3d')]){_0x39b746[_0x9789('0x3e')]=[{'all':!![]}];}_0x39b746=_['merge']({},_0x39b746,_0x44c219[_0x9789('0x45')]);return db[_0x9789('0x2a')][_0x9789('0x47')](_0x39b746)[_0x9789('0x23')](handleEntityNotFound(_0x38f40f,null))[_0x9789('0x23')](function(_0x28fc2d){if(_0x28fc2d){var _0xdf39e2=_0x28fc2d[_0x9789('0x48')]({'plain':!![]});_0xdf39e2=qs[_0x9789('0x49')](_0xdf39e2,['id',_0x9789('0x4a'),_0x9789('0x4b')]);_0x44c219[_0x9789('0x4c')]=_[_0x9789('0x49')](_0x44c219[_0x9789('0x4c')],['id',_0x9789('0x4a'),'updatedAt']);return db[_0x9789('0x2a')]['create'](_[_0x9789('0x3c')](_0xdf39e2,_0x44c219[_0x9789('0x4c')]),{'include':_0x44c219[_0x9789('0x2c')][_0x9789('0x3d')]?[{'all':!![]}]:undefined});}})[_0x9789('0x23')](respondWithResult(_0x38f40f,0xc9))[_0x9789('0x41')](handleError(_0x38f40f,null));};exports[_0x9789('0x22')]=function(_0x5adc3d,_0xf3b5b5){if(_0x5adc3d[_0x9789('0x4c')]['id']){delete _0x5adc3d[_0x9789('0x4c')]['id'];}return db[_0x9789('0x2a')]['find']({'where':{'id':_0x5adc3d['params']['id']}})['then'](handleEntityNotFound(_0xf3b5b5,null))[_0x9789('0x23')](saveUpdates(_0x5adc3d[_0x9789('0x4c')],null))['then'](respondWithResult(_0xf3b5b5,null))['catch'](handleError(_0xf3b5b5,null));};exports['destroy']=function(_0x3f988f,_0x4aa6f7){return db['Attachment'][_0x9789('0x47')]({'where':{'id':_0x3f988f[_0x9789('0x43')]['id']}})['then'](handleEntityNotFound(_0x4aa6f7,null))[_0x9789('0x23')](removeEntity(_0x4aa6f7,null))[_0x9789('0x41')](handleError(_0x4aa6f7,null));};exports['create']=function(_0x165735,_0x457140,_0x219409){_0x165735[_0x9789('0x4c')][_0x9789('0x26')]=_0x165735['file']['originalname'];_0x165735[_0x9789('0x4c')][_0x9789('0x4d')]=_0x165735[_0x9789('0x4e')]['filename'];_0x165735['body']['type']=_0x165735[_0x9789('0x4e')]['mimetype'];return db[_0x9789('0x2a')][_0x9789('0x4f')](_0x165735[_0x9789('0x4c')])[_0x9789('0x23')](respondWithResult(_0x457140,0xc9))[_0x9789('0x41')](handleError(_0x457140,null));};exports['download']=function(_0x3889bb,_0x54cbea,_0x2183bb){return db['Attachment']['findOne']({'where':{'id':_0x3889bb['params']['id']},'raw':!![]})[_0x9789('0x23')](handleEntityNotFound(_0x54cbea,null))['then'](function(_0x47041b){if(_0x47041b){var _0x569d61=_0x47041b[_0x9789('0x50')]!==null;var _0x26339f=path[_0x9789('0x51')](config['root'],_0x9789('0x52'));if(_0x569d61){_0x26339f=path['join'](_0x26339f,'offline-chat/');}var _0x4c4247=path[_0x9789('0x51')](_0x26339f,_0x47041b[_0x9789('0x4d')]);return _0x54cbea['download'](_0x4c4247);}})['catch'](handleError(_0x54cbea,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 3194f62..adf23c8 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 _0xf567=['rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x4e93a9,_0x413f30){var _0x43013c=function(_0x3a0cf3){while(--_0x3a0cf3){_0x4e93a9['push'](_0x4e93a9['shift']());}};_0x43013c(++_0x413f30);}(_0xf567,0x1ab));var _0x7f56=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xf567[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x7f56('0x0'));var util=require(_0x7f56('0x1'));var logger=require(_0x7f56('0x2'))(_0x7f56('0x3'));var moment=require(_0x7f56('0x4'));var BPromise=require(_0x7f56('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f56('0x6'));var rimraf=require(_0x7f56('0x7'));var config=require(_0x7f56('0x8'));var attributes=require(_0x7f56('0x9'));module[_0x7f56('0xa')]=function(_0x17e2c3,_0x49b41a){return _0x17e2c3[_0x7f56('0xb')](_0x7f56('0xc'),attributes,{'tableName':_0x7f56('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xace5=['exports','define','Attachment','attachments','lodash','util','../../config/logger','api','request-promise','path','rimraf','./attachment.attributes'];(function(_0x2b702e,_0x267442){var _0x2eddf7=function(_0x2158be){while(--_0x2158be){_0x2b702e['push'](_0x2b702e['shift']());}};_0x2eddf7(++_0x267442);}(_0xace5,0xb8));var _0x5ace=function(_0x13c471,_0x50a390){_0x13c471=_0x13c471-0x0;var _0x33b8f1=_0xace5[_0x13c471];return _0x33b8f1;};'use strict';var _=require(_0x5ace('0x0'));var util=require(_0x5ace('0x1'));var logger=require(_0x5ace('0x2'))(_0x5ace('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5ace('0x4'));var fs=require('fs');var path=require(_0x5ace('0x5'));var rimraf=require(_0x5ace('0x6'));var config=require('../../config/environment');var attributes=require(_0x5ace('0x7'));module[_0x5ace('0x8')]=function(_0xa557aa,_0x408677){return _0xa557aa[_0x5ace('0x9')](_0x5ace('0xa'),attributes,{'tableName':_0x5ace('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index a8ea856..55589f0 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 _0x5b02=['then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','result','catch','Attachment','create','options','raw','CreateAttachment','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3ae3a3,_0x1d4c57){var _0xf3058a=function(_0x46b3b8){while(--_0x46b3b8){_0x3ae3a3['push'](_0x3ae3a3['shift']());}};_0xf3058a(++_0x1d4c57);}(_0x5b02,0xe9));var _0x25b0=function(_0x18373d,_0x4674a2){_0x18373d=_0x18373d-0x0;var _0x315df6=_0x5b02[_0x18373d];return _0x315df6;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var moment=require(_0x25b0('0x2'));var BPromise=require(_0x25b0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25b0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x25b0('0x5'))(_0x25b0('0x6'));var config=require(_0x25b0('0x7'));var jayson=require(_0x25b0('0x8'));var client=jayson[_0x25b0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d82c6,_0xd8276d,_0x49ef3a){return new BPromise(function(_0x412954,_0x4d3e71){return client['request'](_0x1d82c6,_0x49ef3a)[_0x25b0('0xa')](function(_0x45429b){logger[_0x25b0('0xb')]('Attachment,\x20%s,\x20%s',_0xd8276d,_0x25b0('0xc'));logger[_0x25b0('0xd')](_0x25b0('0xe'),_0xd8276d,_0x25b0('0xc'),JSON[_0x25b0('0xf')](_0x45429b));if(_0x45429b[_0x25b0('0x10')]){if(_0x45429b[_0x25b0('0x10')][_0x25b0('0x11')]===0x1f4){logger[_0x25b0('0x10')](_0x25b0('0x12'),_0xd8276d,_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);return _0x4d3e71(_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);}logger[_0x25b0('0x10')](_0x25b0('0x12'),_0xd8276d,_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);return _0x412954(_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);}else{logger[_0x25b0('0xb')]('Attachment,\x20%s,\x20%s',_0xd8276d,'request\x20sent');_0x412954(_0x45429b[_0x25b0('0x14')]['message']);}})[_0x25b0('0x15')](function(_0x1d009f){logger[_0x25b0('0x10')](_0x25b0('0x12'),_0xd8276d,_0x1d009f);_0x4d3e71(_0x1d009f);});});}exports['CreateAttachment']=function(_0x1d850f){var _0x213a77=this;return new Promise(function(_0x20762e,_0x385334){return db[_0x25b0('0x16')][_0x25b0('0x17')](_0x1d850f['body'],{'raw':_0x1d850f[_0x25b0('0x18')]?_0x1d850f[_0x25b0('0x18')][_0x25b0('0x19')]===undefined?!![]:![]:!![]})[_0x25b0('0xa')](function(_0x1dc691){logger[_0x25b0('0xb')](_0x25b0('0x1a'),_0x1d850f);logger[_0x25b0('0xd')](_0x25b0('0x1a'),_0x1d850f,JSON[_0x25b0('0xf')](_0x1dc691));_0x20762e(_0x1dc691);})[_0x25b0('0x15')](function(_0x3ce1da){logger['error'](_0x25b0('0x1a'),_0x3ce1da[_0x25b0('0x13')],_0x1d850f);_0x385334(_0x213a77['error'](0x1f4,_0x3ce1da[_0x25b0('0x13')]));});});};
\ No newline at end of file
+var _0x07c3=['debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','CreateAttachment','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s'];(function(_0xa44259,_0x153a71){var _0xbef6f0=function(_0x593a70){while(--_0x593a70){_0xa44259['push'](_0xa44259['shift']());}};_0xbef6f0(++_0x153a71);}(_0x07c3,0x1bf));var _0x307c=function(_0xa4c85,_0x2b52a7){_0xa4c85=_0xa4c85-0x0;var _0x172c1f=_0x07c3[_0xa4c85];return _0x172c1f;};'use strict';var _=require(_0x307c('0x0'));var util=require(_0x307c('0x1'));var moment=require(_0x307c('0x2'));var BPromise=require(_0x307c('0x3'));var rs=require(_0x307c('0x4'));var fs=require('fs');var Redis=require(_0x307c('0x5'));var db=require(_0x307c('0x6'))['db'];var utils=require(_0x307c('0x7'));var logger=require('../../config/logger')(_0x307c('0x8'));var config=require(_0x307c('0x9'));var jayson=require(_0x307c('0xa'));var client=jayson[_0x307c('0xb')][_0x307c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x410ae8,_0x39af52,_0x3f5d08){return new BPromise(function(_0xfb14bf,_0x166467){return client[_0x307c('0xd')](_0x410ae8,_0x3f5d08)[_0x307c('0xe')](function(_0x1af97f){logger[_0x307c('0xf')](_0x307c('0x10'),_0x39af52,'request\x20sent');logger[_0x307c('0x11')](_0x307c('0x12'),_0x39af52,_0x307c('0x13'),JSON[_0x307c('0x14')](_0x1af97f));if(_0x1af97f['error']){if(_0x1af97f['error'][_0x307c('0x15')]===0x1f4){logger['error'](_0x307c('0x10'),_0x39af52,_0x1af97f[_0x307c('0x16')]['message']);return _0x166467(_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);}logger[_0x307c('0x16')](_0x307c('0x10'),_0x39af52,_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);return _0xfb14bf(_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);}else{logger[_0x307c('0xf')](_0x307c('0x10'),_0x39af52,_0x307c('0x13'));_0xfb14bf(_0x1af97f[_0x307c('0x18')]['message']);}})[_0x307c('0x19')](function(_0x364441){logger[_0x307c('0x16')](_0x307c('0x10'),_0x39af52,_0x364441);_0x166467(_0x364441);});});}exports[_0x307c('0x1a')]=function(_0x2e21a6){var _0x3e05e2=this;return new Promise(function(_0x13f03b,_0xbfe2b4){return db['Attachment']['create'](_0x2e21a6[_0x307c('0x1b')],{'raw':_0x2e21a6['options']?_0x2e21a6[_0x307c('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4bcc1a){logger[_0x307c('0xf')]('CreateAttachment',_0x2e21a6);logger[_0x307c('0x11')](_0x307c('0x1a'),_0x2e21a6,JSON['stringify'](_0x4bcc1a));_0x13f03b(_0x4bcc1a);})[_0x307c('0x19')](function(_0x45fe2){logger['error'](_0x307c('0x1a'),_0x45fe2[_0x307c('0x17')],_0x2e21a6);_0xbfe2b4(_0x3e05e2[_0x307c('0x16')](0x1f4,_0x45fe2[_0x307c('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index e44809a..066a840 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 _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x4226d6,_0x3864ca){var _0x19655b=function(_0x1d43a1){while(--_0x1d43a1){_0x4226d6['push'](_0x4226d6['shift']());}};_0x19655b(++_0x3864ca);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
+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(_0x15196a,_0x42cbaf){var _0x3d9ee6=function(_0x13b540){while(--_0x13b540){_0x15196a['push'](_0x15196a['shift']());}};_0x3d9ee6(++_0x42cbaf);}(_0x5f2f,0x73));var _0xf5f2=function(_0x29551f,_0x589fd9){_0x29551f=_0x29551f-0x0;var _0x4c7b83=_0x5f2f[_0x29551f];return _0x4c7b83;};'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
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 100da41..47a49c7 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 _0x689b=['domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','disabled','blockedAt','online','admin','user','name','blocked','add','minutes','clearBlockUser','getLicense','status','send','message','login','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','use','ad-login','User','passport-local','Strategy','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x689b,0x85));var _0xb689=function(_0x4a11c2,_0x292670){_0x4a11c2=_0x4a11c2-0x0;var _0x2d94e7=_0x689b[_0x4a11c2];return _0x2d94e7;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xb689('0x0'))[_0xb689('0x1')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xb689('0x2'));var util=require(_0xb689('0x3'));var db=require(_0xb689('0x4'))['db'];var authService=require(_0xb689('0x5'));var utils=require(_0xb689('0x6'));var config=require(_0xb689('0x7'));var logger=require(_0xb689('0x8'))(_0xb689('0x9'));function isActiveDirectoryConfigured(_0x92d93b){var _0x35cd17=![];if(typeof _0x92d93b[_0xb689('0xa')]!==_0xb689('0xb')){_0x35cd17=_0x92d93b[_0xb689('0xa')][_0xb689('0xc')]&&_0x92d93b[_0xb689('0xa')][_0xb689('0xd')]&&_0x92d93b[_0xb689('0xa')][_0xb689('0xe')];}return _0x35cd17;}function adAuthenticate(_0x540d0a,_0x28bf5a,_0x8c1455){return new BPromise(function(_0x329dbd,_0x32b34a){try{var _0x485f70=new ActiveDirectory(_0x540d0a);_0x485f70['authenticate'](_0x28bf5a,_0x8c1455,function(_0x3c213c,_0x2820b1){if(_0x3c213c){logger[_0xb689('0xf')](_0xb689('0x10'),_0x28bf5a,util[_0xb689('0x11')](_0x3c213c,{'showHidden':![],'depth':null}));_0x32b34a(_0xb689('0x12'));}else if(!_0x2820b1){logger[_0xb689('0xf')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x28bf5a);_0x32b34a(_0xb689('0x12'));}else{_0x329dbd(_0x2820b1);}});}catch(_0x225fa4){_0x32b34a(_0x225fa4);}});}function ActiveDirectoryAuthenticate(_0xf7e61b,_0x2352c3,_0x1dad8d,_0x2d49d4){var _0x499c46,_0x347112;if(!isActiveDirectoryConfigured(config)){logger['error'](_0xb689('0x13'),_0x2352c3);return _0x2d49d4(null,![],{'message':_0xb689('0x12')});}return db['Setting'][_0xb689('0x14')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xb689('0x15')],'raw':!![]})[_0xb689('0x16')](function(_0x192276){_0x499c46=_0x192276;if(!_0x499c46[_0xb689('0x17')]){logger[_0xb689('0xf')](_0xb689('0x18'),_0x2352c3);throw new Error(_0xb689('0x12'));}return _0xf7e61b['findOne']({'attributes':['id','name',_0xb689('0x19'),_0xb689('0x1a'),'role',_0xb689('0x1b'),'blocked',_0xb689('0x1c'),_0xb689('0x1d')],'where':{'name':_0x2352c3,'role':{'$or':[_0xb689('0x1e'),_0xb689('0x1f'),'agent']},'adSsoEnabled':!![]}});})[_0xb689('0x16')](function(_0x1e94aa){if(!_0x1e94aa||_0x1e94aa&&_0x1e94aa[_0xb689('0x20')]!==_0x2352c3){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x347112=_0x1e94aa;var _0x4e52d3=_0x347112[_0xb689('0x20')]+'@'+config[_0xb689('0xa')][_0xb689('0xe')];return adAuthenticate(config['activedirectory'],_0x4e52d3,_0x1dad8d);})[_0xb689('0x16')](function(_0x1edcf3){if(_0x347112[_0xb689('0x1b')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x499c46[_0xb689('0x15')]>0x0){if(_0x347112[_0xb689('0x21')]){if(moment(_0x347112[_0xb689('0x1c')])[_0xb689('0x22')](_0x499c46[_0xb689('0x15')],_0xb689('0x23'))>moment()){throw new Error(_0xb689('0x12'));}return utils[_0xb689('0x24')](_0x347112,0x0,![],null)[_0xb689('0x16')](function(){return utils[_0xb689('0x25')](_0x347112);})[_0xb689('0x16')](function(){return _0x2d49d4(null,_0x347112);});}else{return utils[_0xb689('0x25')](_0x347112)['then'](function(){return _0x2d49d4(null,_0x347112);});}}else{return utils['getLicense'](_0x347112)['then'](function(){return _0x2d49d4(null,_0x347112);});}})['catch'](function(_0x4ac21c){return _0x2d49d4(null,![],_0x4ac21c);});}function handleError(_0x33df38,_0x4b7ffa,_0x4cda0e){return _0x33df38[_0xb689('0x26')](_0x4b7ffa||0x1f4)[_0xb689('0x27')]({'message':_0x4cda0e?_0x4cda0e[_0xb689('0x28')]||_0x4cda0e:''});}exports[_0xb689('0x29')]=function(_0x5b27e0,_0x2f4679,_0x160fa9){passport[_0xb689('0x2a')]('ad-login',function(_0x557c2d,_0x56b12a,_0x32b4ce){var _0x1e4912=_0x557c2d||_0x32b4ce;if(_0x1e4912){return handleError(_0x2f4679,0x191,_0x1e4912);}if(!_0x56b12a){return handleError(_0x2f4679,0x194,{'message':_0xb689('0x2b')});}else{var _0x1a49ee={'payload':{'id':_0x56b12a['id'],'role':_0x56b12a[_0xb689('0x2c')]},'options':{'expiresIn':0x15180}};return authService[_0xb689('0x2d')](_0x1a49ee)[_0xb689('0x16')](function(_0x10756d){_0x2f4679['json']({'id':_0x56b12a['id'],'token':_0x10756d,'statusCall':'','isAlreadyLogged':_0x56b12a[_0xb689('0x1d')]});});}})(_0x5b27e0,_0x2f4679,_0x160fa9);};passport[_0xb689('0x2e')](_0xb689('0x2f'),new LocalStrategy({'usernameField':_0xb689('0x20'),'passwordField':'password'},function(_0x36eec0,_0x553e97,_0x3e4b93){return ActiveDirectoryAuthenticate(db[_0xb689('0x30')],_0x36eec0,_0x553e97,_0x3e4b93);}));
\ No newline at end of file
+var _0x427e=['authenticate','ad-login','role','json','use','User','passport','activedirectory2','util','../../components/auth/service','../../config/utils','../../config/logger','api','activedirectory','undefined','baseDN','domain','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','blocked','blockedAt','online','admin','user','agent','disabled','add','clearBlockUser','getLicense','catch','status','send','message','login'];(function(_0x1d7ef5,_0x38cb8a){var _0xd108dd=function(_0x40242c){while(--_0x40242c){_0x1d7ef5['push'](_0x1d7ef5['shift']());}};_0xd108dd(++_0x38cb8a);}(_0x427e,0x11a));var _0xe427=function(_0xcc68e1,_0x246c14){_0xcc68e1=_0xcc68e1-0x0;var _0x40a451=_0x427e[_0xcc68e1];return _0x40a451;};'use strict';var passport=require(_0xe427('0x0'));var LocalStrategy=require('passport-local')['Strategy'];var moment=require('moment');var ActiveDirectory=require(_0xe427('0x1'));var BPromise=require('bluebird');var util=require(_0xe427('0x2'));var db=require('../../mysqldb')['db'];var authService=require(_0xe427('0x3'));var utils=require(_0xe427('0x4'));var config=require('../../config/environment');var logger=require(_0xe427('0x5'))(_0xe427('0x6'));function isActiveDirectoryConfigured(_0x34498b){var _0x4567f1=![];if(typeof _0x34498b[_0xe427('0x7')]!==_0xe427('0x8')){_0x4567f1=_0x34498b[_0xe427('0x7')][_0xe427('0x9')]&&_0x34498b['activedirectory']['url']&&_0x34498b[_0xe427('0x7')][_0xe427('0xa')];}return _0x4567f1;}function adAuthenticate(_0x381c7f,_0x25a1bc,_0x3b3f9d){return new BPromise(function(_0x2aecd7,_0x159375){try{var _0x308179=new ActiveDirectory(_0x381c7f);_0x308179['authenticate'](_0x25a1bc,_0x3b3f9d,function(_0x49d014,_0x1777b5){if(_0x49d014){logger[_0xe427('0xb')]('Error\x20authenticate\x20%s:\x20%s',_0x25a1bc,util[_0xe427('0xc')](_0x49d014,{'showHidden':![],'depth':null}));_0x159375(_0xe427('0xd'));}else if(!_0x1777b5){logger[_0xe427('0xb')](_0xe427('0xe'),_0x25a1bc);_0x159375(_0xe427('0xd'));}else{_0x2aecd7(_0x1777b5);}});}catch(_0x9608c5){_0x159375(_0x9608c5);}});}function ActiveDirectoryAuthenticate(_0x17d319,_0x2fac68,_0x22c29b,_0x4bb104){var _0x4b7347,_0x307498;if(!isActiveDirectoryConfigured(config)){logger[_0xe427('0xb')](_0xe427('0xf'),_0x2fac68);return _0x4bb104(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xe427('0x10')][_0xe427('0x11')]({'where':{'id':0x1},'attributes':[_0xe427('0x12'),_0xe427('0x13')],'raw':!![]})[_0xe427('0x14')](function(_0x537730){_0x4b7347=_0x537730;if(!_0x4b7347[_0xe427('0x12')]){logger[_0xe427('0xb')](_0xe427('0x15'),_0x2fac68);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x17d319[_0xe427('0x11')]({'attributes':['id',_0xe427('0x16'),_0xe427('0x17'),_0xe427('0x18'),'role','disabled',_0xe427('0x19'),_0xe427('0x1a'),_0xe427('0x1b')],'where':{'name':_0x2fac68,'role':{'$or':[_0xe427('0x1c'),_0xe427('0x1d'),_0xe427('0x1e')]},'adSsoEnabled':!![]}});})[_0xe427('0x14')](function(_0x3e39b5){if(!_0x3e39b5||_0x3e39b5&&_0x3e39b5[_0xe427('0x16')]!==_0x2fac68){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x307498=_0x3e39b5;var _0x14e8c8=_0x307498[_0xe427('0x16')]+'@'+config[_0xe427('0x7')][_0xe427('0xa')];return adAuthenticate(config[_0xe427('0x7')],_0x14e8c8,_0x22c29b);})[_0xe427('0x14')](function(_0x4f07dd){if(_0x307498[_0xe427('0x1f')]){throw new Error(_0xe427('0xd'));}if(_0x4b7347['blockDuration']>0x0){if(_0x307498[_0xe427('0x19')]){if(moment(_0x307498[_0xe427('0x1a')])[_0xe427('0x20')](_0x4b7347[_0xe427('0x13')],'minutes')>moment()){throw new Error(_0xe427('0xd'));}return utils[_0xe427('0x21')](_0x307498,0x0,![],null)[_0xe427('0x14')](function(){return utils[_0xe427('0x22')](_0x307498);})[_0xe427('0x14')](function(){return _0x4bb104(null,_0x307498);});}else{return utils[_0xe427('0x22')](_0x307498)[_0xe427('0x14')](function(){return _0x4bb104(null,_0x307498);});}}else{return utils['getLicense'](_0x307498)[_0xe427('0x14')](function(){return _0x4bb104(null,_0x307498);});}})[_0xe427('0x23')](function(_0x2bc7f3){return _0x4bb104(null,![],_0x2bc7f3);});}function handleError(_0x582a35,_0x3e49c0,_0x5ef4cf){return _0x582a35[_0xe427('0x24')](_0x3e49c0||0x1f4)[_0xe427('0x25')]({'message':_0x5ef4cf?_0x5ef4cf[_0xe427('0x26')]||_0x5ef4cf:''});}exports[_0xe427('0x27')]=function(_0x4db304,_0x1ffdb2,_0x4f944d){passport[_0xe427('0x28')](_0xe427('0x29'),function(_0x12a0dd,_0x48e476,_0x575f84){var _0x57f41c=_0x12a0dd||_0x575f84;if(_0x57f41c){return handleError(_0x1ffdb2,0x191,_0x57f41c);}if(!_0x48e476){return handleError(_0x1ffdb2,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xad160a={'payload':{'id':_0x48e476['id'],'role':_0x48e476[_0xe427('0x2a')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0xad160a)[_0xe427('0x14')](function(_0x4f2dbe){_0x1ffdb2[_0xe427('0x2b')]({'id':_0x48e476['id'],'token':_0x4f2dbe,'statusCall':'','isAlreadyLogged':_0x48e476['online']});});}})(_0x4db304,_0x1ffdb2,_0x4f944d);};passport[_0xe427('0x2c')]('ad-login',new LocalStrategy({'usernameField':_0xe427('0x16'),'passwordField':'password'},function(_0x2a1507,_0x427e58,_0x42b6af){return ActiveDirectoryAuthenticate(db[_0xe427('0x2d')],_0x2a1507,_0x427e58,_0x42b6af);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 7a4dcef..3290cac 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 _0x38e9=['express','./authActiveDirectory.controller','exports'];(function(_0x2bf451,_0x293261){var _0x327a73=function(_0x594345){while(--_0x594345){_0x2bf451['push'](_0x2bf451['shift']());}};_0x327a73(++_0x293261);}(_0x38e9,0x1dd));var _0x938e=function(_0x3dfea6,_0x5cd685){_0x3dfea6=_0x3dfea6-0x0;var _0x567aca=_0x38e9[_0x3dfea6];return _0x567aca;};'use strict';var express=require(_0x938e('0x0'));var router=express['Router']();var controller=require(_0x938e('0x1'));router['post']('/',controller['login']);module[_0x938e('0x2')]=router;
\ No newline at end of file
+var _0xca88=['Router','./authActiveDirectory.controller','post','exports','express'];(function(_0x41ee16,_0xfa94c3){var _0x1f60de=function(_0x1c8ffc){while(--_0x1c8ffc){_0x41ee16['push'](_0x41ee16['shift']());}};_0x1f60de(++_0xfa94c3);}(_0xca88,0xe0));var _0x8ca8=function(_0x429fd5,_0x21156c){_0x429fd5=_0x429fd5-0x0;var _0x125acf=_0xca88[_0x429fd5];return _0x125acf;};'use strict';var express=require(_0x8ca8('0x0'));var router=express[_0x8ca8('0x1')]();var controller=require(_0x8ca8('0x2'));router[_0x8ca8('0x3')]('/',controller['login']);module[_0x8ca8('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index e1b8297..386f687 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(_0x3aace3,_0x257273){var _0x572543=function(_0xe93782){while(--_0xe93782){_0x3aace3['push'](_0x3aace3['shift']());}};_0x572543(++_0x257273);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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(_0x3f3d54,_0x1e03ef){var _0x2e1d4a=function(_0x46fd35){while(--_0x46fd35){_0x3f3d54['push'](_0x3f3d54['shift']());}};_0x2e1d4a(++_0x1e03ef);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 83d260a..4f9a335 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 _0xbb8f=['../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports','express','Router','./authGoogle.controller'];(function(_0x4aa2c1,_0x2a1da8){var _0x477fa0=function(_0x2e9b94){while(--_0x2e9b94){_0x4aa2c1['push'](_0x4aa2c1['shift']());}};_0x477fa0(++_0x2a1da8);}(_0xbb8f,0x99));var _0xfbb8=function(_0x4635cc,_0x4f7e6){_0x4635cc=_0x4635cc-0x0;var _0x5a255c=_0xbb8f[_0x4635cc];return _0x5a255c;};'use strict';var express=require(_0xfbb8('0x0'));var passport=require('passport');var router=express[_0xfbb8('0x1')]();var controller=require(_0xfbb8('0x2'));var userController=require(_0xfbb8('0x3'));var authService=require(_0xfbb8('0x4'));router[_0xfbb8('0x5')]('/',controller[_0xfbb8('0x6')]);router[_0xfbb8('0x5')](_0xfbb8('0x7'),controller[_0xfbb8('0x8')],authService[_0xfbb8('0x9')],userController[_0xfbb8('0x6')],authService[_0xfbb8('0xa')]);module[_0xfbb8('0xb')]=router;
\ No newline at end of file
+var _0x01db=['get','/callback','callback','setTokenCookie','exports','express','passport','../user/user.controller.js','login'];(function(_0x3d5f38,_0x4efe53){var _0x5bde8b=function(_0xff28f1){while(--_0xff28f1){_0x3d5f38['push'](_0x3d5f38['shift']());}};_0x5bde8b(++_0x4efe53);}(_0x01db,0x9e));var _0xb01d=function(_0x3fdc90,_0x266b97){_0x3fdc90=_0x3fdc90-0x0;var _0x5bf230=_0x01db[_0x3fdc90];return _0x5bf230;};'use strict';var express=require(_0xb01d('0x0'));var passport=require(_0xb01d('0x1'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0xb01d('0x2'));var authService=require('../../components/auth/service');router['get']('/',controller[_0xb01d('0x3')]);router[_0xb01d('0x4')](_0xb01d('0x5'),controller[_0xb01d('0x6')],authService['isMiddleware'],userController[_0xb01d('0x3')],authService[_0xb01d('0x7')]);module[_0xb01d('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 5568d94..b57ae0c 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 _0x1eb9=['forgot','body','generate','trim','toLowerCase','User','find','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','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','Password\x20reset!','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','salt','disabled','blocked','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','then','authenticate','blockedAt','add','minutes','clearBlockUser','getLicense','catch','MailAccount','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','Smtp','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','login','local-login','role','json','online'];(function(_0x127fb7,_0x47c4b8){var _0x49252a=function(_0x176220){while(--_0x176220){_0x127fb7['push'](_0x127fb7['shift']());}};_0x49252a(++_0x47c4b8);}(_0x1eb9,0xc7));var _0x91eb=function(_0x47643e,_0x337374){_0x47643e=_0x47643e-0x0;var _0x2aa5db=_0x1eb9[_0x47643e];return _0x2aa5db;};'use strict';var util=require(_0x91eb('0x0'));var passport=require(_0x91eb('0x1'));var LocalStrategy=require(_0x91eb('0x2'))[_0x91eb('0x3')];var jayson=require(_0x91eb('0x4'));var _=require(_0x91eb('0x5'));var rs=require(_0x91eb('0x6'));var moment=require('moment');var db=require(_0x91eb('0x7'))['db'];var authService=require(_0x91eb('0x8'));var utils=require(_0x91eb('0x9'));var client=jayson[_0x91eb('0xa')][_0x91eb('0xb')]({'port':0x232b});function localAuthenticate(_0x1d7fa,_0x3430a4,_0xe09132,_0x5a79e6){var _0x214ea3,_0x22e087;return db[_0x91eb('0xc')][_0x91eb('0xd')]({'where':{'id':0x1},'attributes':[_0x91eb('0xe'),_0x91eb('0xf')],'raw':!![]})['then'](function(_0x1ad114){_0x214ea3=_0x1ad114;return _0x1d7fa['findOne']({'attributes':['id',_0x91eb('0x10'),'password',_0x91eb('0x11'),'role',_0x91eb('0x12'),_0x91eb('0x13'),'blockedAt',_0x91eb('0x14')],'where':{'name':_0x3430a4,'role':{'$or':[_0x91eb('0x15'),_0x91eb('0x16'),'agent']}}});})['then'](function(_0x5d053e){if(!_0x5d053e||_0x5d053e&&_0x5d053e[_0x91eb('0x10')]!==_0x3430a4){throw new Error(_0x91eb('0x17'));}else{_0x22e087=_0x5d053e;return _0x22e087;}})[_0x91eb('0x18')](function(){_0x22e087[_0x91eb('0x19')](_0xe09132,function(_0x4cac57,_0x4afc06){var _0x4a9f57=_0x22e087[_0x91eb('0x14')]+0x1;if(_0x4cac57){return _0x5a79e6(_0x4cac57);}else if(!_0x4afc06){if(_0x22e087[_0x91eb('0x12')]){return _0x5a79e6(null,![],{'message':_0x91eb('0x17')});}else if(_0x214ea3[_0x91eb('0xe')]>0x0){if(_0x22e087[_0x91eb('0x13')]){if(_0x214ea3[_0x91eb('0xf')]>0x0){if(moment(_0x22e087[_0x91eb('0x1a')])[_0x91eb('0x1b')](_0x214ea3[_0x91eb('0xf')],_0x91eb('0x1c'))>moment()){return _0x5a79e6(null,![],{'message':_0x91eb('0x17')});}else{return utils[_0x91eb('0x1d')](_0x22e087,_0x4a9f57,![],null)['then'](function(){return _0x5a79e6(null,![],{'message':_0x91eb('0x17')});});}}else{return _0x5a79e6(null,![],{'message':_0x91eb('0x17')});}}else{if(_0x4a9f57>=_0x214ea3['allowedLoginAttempts']){return utils[_0x91eb('0x1d')](_0x22e087,0x0,!![],moment())['then'](function(){return _0x5a79e6(null,![],{'message':_0x91eb('0x17')});});}else{return utils[_0x91eb('0x1d')](_0x22e087,_0x4a9f57,![],null)[_0x91eb('0x18')](function(){return _0x5a79e6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x5a79e6(null,![],{'message':_0x91eb('0x17')});}}else{if(_0x22e087[_0x91eb('0x12')]){return _0x5a79e6(null,![],{'message':_0x91eb('0x17')});}else if(_0x214ea3[_0x91eb('0xe')]>0x0){if(_0x22e087[_0x91eb('0x13')]){if(_0x214ea3[_0x91eb('0xf')]>0x0){if(moment(_0x22e087[_0x91eb('0x1a')])[_0x91eb('0x1b')](_0x214ea3[_0x91eb('0xf')],_0x91eb('0x1c'))>moment()){return _0x5a79e6(null,![],{'message':_0x91eb('0x17')});}else{return utils[_0x91eb('0x1d')](_0x22e087,0x0,![],null)['then'](function(){return utils[_0x91eb('0x1e')](_0x22e087);})[_0x91eb('0x18')](function(){return _0x5a79e6(null,_0x22e087);});}}else{return _0x5a79e6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x91eb('0x1d')](_0x22e087,0x0,![],null)[_0x91eb('0x18')](function(){return utils[_0x91eb('0x1e')](_0x22e087);})[_0x91eb('0x18')](function(){return _0x5a79e6(null,_0x22e087);})[_0x91eb('0x1f')](function(_0x26196a){return _0x5a79e6(null,![],_0x26196a);});}}else{if(_0x22e087[_0x91eb('0x13')]){return _0x5a79e6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x91eb('0x1e')](_0x22e087)[_0x91eb('0x18')](function(){return _0x5a79e6(null,_0x22e087);});}}}});})[_0x91eb('0x1f')](function(_0x26ee4a){return _0x5a79e6(null,![],_0x26ee4a);});}function sendServiceMail(_0x5f106a){return db[_0x91eb('0x20')]['find']({'where':{'service':!![]},'attributes':['id',_0x91eb('0x10'),_0x91eb('0x21')],'include':[{'model':db[_0x91eb('0x22')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0x91eb('0x23')}]}]})[_0x91eb('0x18')](function(_0x123438){if(!_0x123438){throw new Error(_0x91eb('0x24'));}var _0x4d34ad=_0x123438[_0x91eb('0x25')]();var _0x189c8a={'account':_0x4d34ad,'message':_[_0x91eb('0x26')]({'from':util[_0x91eb('0x27')](_0x91eb('0x28'),_0x123438[_0x91eb('0x10')],_0x123438['email']||_0x123438[_0x91eb('0x29')][_0x91eb('0x16')])},_0x5f106a)};return client[_0x91eb('0x2a')](_0x91eb('0x2b'),_0x189c8a);})[_0x91eb('0x18')](function(_0x1e5f8e){if(_0x1e5f8e[_0x91eb('0x2c')]){throw new Error(util[_0x91eb('0x27')](_0x91eb('0x2d'),_0x1e5f8e['error'][_0x91eb('0x2e')]||JSON['stringify'](_0x1e5f8e[_0x91eb('0x2c')])));}return!![];});}function handleError(_0x63deab,_0x316f49,_0x1d9fa2){return _0x63deab[_0x91eb('0x2f')](_0x316f49||0x1f4)['send']({'message':_0x1d9fa2?_0x1d9fa2[_0x91eb('0x2e')]||_0x1d9fa2:''});}exports[_0x91eb('0x30')]=function(_0x25076e,_0x2be86b,_0x499fca){passport[_0x91eb('0x19')](_0x91eb('0x31'),function(_0xb1090e,_0x500ef6,_0x1922a7){var _0x21199e=_0xb1090e||_0x1922a7;if(_0x21199e){return handleError(_0x2be86b,0x191,_0x21199e);}if(!_0x500ef6){return handleError(_0x2be86b,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x59d792={'payload':{'id':_0x500ef6['id'],'role':_0x500ef6[_0x91eb('0x32')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x59d792)[_0x91eb('0x18')](function(_0x24a3bf){_0x2be86b[_0x91eb('0x33')]({'id':_0x500ef6['id'],'token':_0x24a3bf,'statusCall':'','isAlreadyLogged':_0x500ef6[_0x91eb('0x34')]});});}})(_0x25076e,_0x2be86b,_0x499fca);};exports[_0x91eb('0x35')]=function(_0xfd7c67,_0x223207){if(!_0xfd7c67[_0x91eb('0x36')][_0x91eb('0x21')]){return handleError(_0x223207,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x2fa333=rs[_0x91eb('0x37')]();_0xfd7c67[_0x91eb('0x36')][_0x91eb('0x21')]=_0xfd7c67[_0x91eb('0x36')][_0x91eb('0x21')][_0x91eb('0x38')]()[_0x91eb('0x39')]();var _0x38fab3;return db[_0x91eb('0xc')]['findOne']({'where':{'id':0x1},'attributes':[_0x91eb('0xe'),_0x91eb('0xf')],'raw':!![]})[_0x91eb('0x18')](function(_0x3ed368){_0x38fab3=_0x3ed368;return db[_0x91eb('0x3a')][_0x91eb('0x3b')]({'where':{'email':_0xfd7c67[_0x91eb('0x36')][_0x91eb('0x21')]}});})[_0x91eb('0x18')](function(_0x56a620){if(!_0x56a620){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x56a620[_0x91eb('0x12')]){throw new Error(_0x91eb('0x3c'));}if(_0x56a620[_0x91eb('0x13')]){if(moment(_0x56a620[_0x91eb('0x1a')])[_0x91eb('0x1b')](_0x38fab3[_0x91eb('0xf')],'minutes')>moment()){throw new Error(_0x91eb('0x3d'));}else{_0x56a620[_0x91eb('0x13')]=![];_0x56a620['blockedAt']=null;}}_0x56a620[_0x91eb('0x3e')]=_0x2fa333;_0x56a620[_0x91eb('0x3f')]=Date[_0x91eb('0x40')]()+0x36ee80;return _0x56a620[_0x91eb('0x41')]();})[_0x91eb('0x18')](function(){return sendServiceMail({'to':_0xfd7c67['body']['email'],'subject':_0x91eb('0x42'),'text':_0x91eb('0x43')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0xfd7c67[_0x91eb('0x44')][_0x91eb('0x45')]+'/reset/'+_0x2fa333+'\x0a\x0a'+_0x91eb('0x46')});})['then'](function(){_0x223207['status'](0xc8)[_0x91eb('0x47')]({'message':_0x91eb('0x48')});})['catch'](function(_0x24f5fb){return handleError(_0x223207,0x1f4,_0x24f5fb);});};exports[_0x91eb('0x49')]=function(_0x50f62d,_0x117d82){return db[_0x91eb('0x3a')][_0x91eb('0x3b')]({'where':{'resetPasswordToken':_0x50f62d[_0x91eb('0x4a')][_0x91eb('0x4b')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x484a2a){if(!_0x484a2a){throw new Error(_0x91eb('0x4c'));}return db[_0x91eb('0xc')][_0x91eb('0xd')]({'attributes':['id',_0x91eb('0x4d'),_0x91eb('0x4e'),_0x91eb('0x4f')]})['then'](function(_0x21e1c9){if(_0x21e1c9[_0x91eb('0x4d')])authService[_0x91eb('0x50')](_0x50f62d[_0x91eb('0x36')][_0x91eb('0x51')]);if(!_0x21e1c9[_0x91eb('0x4e')]||!_0x484a2a[_0x91eb('0x52')])return _0x484a2a;authService['validatePasswordHistory'](_0x50f62d[_0x91eb('0x36')][_0x91eb('0x51')],_0x484a2a[_0x91eb('0x52')],_0x21e1c9[_0x91eb('0x4f')]);return _0x484a2a;})[_0x91eb('0x18')](function(){_0x484a2a['password']=_0x50f62d[_0x91eb('0x36')][_0x91eb('0x51')];_0x484a2a[_0x91eb('0x3e')]=null;_0x484a2a[_0x91eb('0x3f')]=null;return _0x484a2a[_0x91eb('0x41')]();});})[_0x91eb('0x18')](function(){_0x117d82[_0x91eb('0x2f')](0xc8)[_0x91eb('0x47')]({'message':_0x91eb('0x53')});})[_0x91eb('0x1f')](function(_0x27b941){return handleError(_0x117d82,0x1f4,_0x27b941);});};passport['use'](_0x91eb('0x31'),new LocalStrategy({'usernameField':_0x91eb('0x10'),'passwordField':_0x91eb('0x51')},function(_0x146d9e,_0x395810,_0x437540){return localAuthenticate(db['User'],_0x146d9e,_0x395810,_0x437540);}));
\ No newline at end of file
+var _0x4602=['host','/reset/','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','enforcePasswordHistory','validatePasswordHistory','previousPasswords','resetPasswordExpires','Password\x20reset!','use','local-login','util','passport','jayson/promise','lodash','randomstring','moment','../../config/utils','http','Setting','blockDuration','findOne','name','password','salt','disabled','blockedAt','loginAttempts','user','agent','then','authenticate','allowedLoginAttempts','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','blocked','add','minutes','getLicense','catch','MailAccount','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers'];(function(_0x56da57,_0x234ac0){var _0x825fab=function(_0x24cfc8){while(--_0x24cfc8){_0x56da57['push'](_0x56da57['shift']());}};_0x825fab(++_0x234ac0);}(_0x4602,0x14b));var _0x2460=function(_0x9780e1,_0x23d9da){_0x9780e1=_0x9780e1-0x0;var _0x3183ca=_0x4602[_0x9780e1];return _0x3183ca;};'use strict';var util=require(_0x2460('0x0'));var passport=require(_0x2460('0x1'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0x2460('0x2'));var _=require(_0x2460('0x3'));var rs=require(_0x2460('0x4'));var moment=require(_0x2460('0x5'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x2460('0x6'));var client=jayson['client'][_0x2460('0x7')]({'port':0x232b});function localAuthenticate(_0x1e9242,_0xb43454,_0x3065b8,_0x1cf89b){var _0x10844e,_0x484ae6;return db[_0x2460('0x8')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x2460('0x9')],'raw':!![]})['then'](function(_0x5719c5){_0x10844e=_0x5719c5;return _0x1e9242[_0x2460('0xa')]({'attributes':['id',_0x2460('0xb'),_0x2460('0xc'),_0x2460('0xd'),'role',_0x2460('0xe'),'blocked',_0x2460('0xf'),_0x2460('0x10')],'where':{'name':_0xb43454,'role':{'$or':['admin',_0x2460('0x11'),_0x2460('0x12')]}}});})[_0x2460('0x13')](function(_0x534050){if(!_0x534050||_0x534050&&_0x534050[_0x2460('0xb')]!==_0xb43454){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x484ae6=_0x534050;return _0x484ae6;}})['then'](function(){_0x484ae6[_0x2460('0x14')](_0x3065b8,function(_0x13a619,_0x9d0ee2){var _0x25832b=_0x484ae6[_0x2460('0x10')]+0x1;if(_0x13a619){return _0x1cf89b(_0x13a619);}else if(!_0x9d0ee2){if(_0x484ae6['disabled']){return _0x1cf89b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x10844e[_0x2460('0x15')]>0x0){if(_0x484ae6['blocked']){if(_0x10844e[_0x2460('0x9')]>0x0){if(moment(_0x484ae6[_0x2460('0xf')])['add'](_0x10844e['blockDuration'],'minutes')>moment()){return _0x1cf89b(null,![],{'message':_0x2460('0x16')});}else{return utils['clearBlockUser'](_0x484ae6,_0x25832b,![],null)['then'](function(){return _0x1cf89b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x1cf89b(null,![],{'message':_0x2460('0x16')});}}else{if(_0x25832b>=_0x10844e['allowedLoginAttempts']){return utils['clearBlockUser'](_0x484ae6,0x0,!![],moment())[_0x2460('0x13')](function(){return _0x1cf89b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x2460('0x17')](_0x484ae6,_0x25832b,![],null)['then'](function(){return _0x1cf89b(null,![],{'message':_0x2460('0x16')});});}}}else{return _0x1cf89b(null,![],{'message':_0x2460('0x16')});}}else{if(_0x484ae6['disabled']){return _0x1cf89b(null,![],{'message':_0x2460('0x16')});}else if(_0x10844e[_0x2460('0x15')]>0x0){if(_0x484ae6[_0x2460('0x18')]){if(_0x10844e[_0x2460('0x9')]>0x0){if(moment(_0x484ae6[_0x2460('0xf')])[_0x2460('0x19')](_0x10844e[_0x2460('0x9')],_0x2460('0x1a'))>moment()){return _0x1cf89b(null,![],{'message':_0x2460('0x16')});}else{return utils['clearBlockUser'](_0x484ae6,0x0,![],null)[_0x2460('0x13')](function(){return utils[_0x2460('0x1b')](_0x484ae6);})[_0x2460('0x13')](function(){return _0x1cf89b(null,_0x484ae6);});}}else{return _0x1cf89b(null,![],{'message':_0x2460('0x16')});}}else{return utils[_0x2460('0x17')](_0x484ae6,0x0,![],null)['then'](function(){return utils[_0x2460('0x1b')](_0x484ae6);})[_0x2460('0x13')](function(){return _0x1cf89b(null,_0x484ae6);})[_0x2460('0x1c')](function(_0xe977b){return _0x1cf89b(null,![],_0xe977b);});}}else{if(_0x484ae6[_0x2460('0x18')]){return _0x1cf89b(null,![],{'message':_0x2460('0x16')});}else{return utils['getLicense'](_0x484ae6)[_0x2460('0x13')](function(){return _0x1cf89b(null,_0x484ae6);});}}}});})[_0x2460('0x1c')](function(_0x3baabc){return _0x1cf89b(null,![],_0x3baabc);});}function sendServiceMail(_0x5f0dc3){return db[_0x2460('0x1d')]['find']({'where':{'service':!![]},'attributes':['id','name',_0x2460('0x1e')],'include':[{'model':db['MailServerOut'],'as':_0x2460('0x1f'),'include':[{'model':db[_0x2460('0x20')],'as':_0x2460('0x20')}]}]})[_0x2460('0x13')](function(_0x389eca){if(!_0x389eca){throw new Error(_0x2460('0x21'));}var _0x542d06=_0x389eca[_0x2460('0x22')]();var _0x2a2953={'account':_0x542d06,'message':_['merge']({'from':util[_0x2460('0x23')]('\x22%s\x22\x20<%s>',_0x389eca['name'],_0x389eca[_0x2460('0x1e')]||_0x389eca[_0x2460('0x1f')]['user'])},_0x5f0dc3)};return client['request']('SendMail',_0x2a2953);})['then'](function(_0x5aa88c){if(_0x5aa88c[_0x2460('0x24')]){throw new Error(util[_0x2460('0x23')](_0x2460('0x25'),_0x5aa88c[_0x2460('0x24')][_0x2460('0x26')]||JSON[_0x2460('0x27')](_0x5aa88c['error'])));}return!![];});}function handleError(_0x5bc79c,_0x5d04a3,_0x65a381){return _0x5bc79c[_0x2460('0x28')](_0x5d04a3||0x1f4)[_0x2460('0x29')]({'message':_0x65a381?_0x65a381[_0x2460('0x26')]||_0x65a381:''});}exports[_0x2460('0x2a')]=function(_0x294450,_0x2f4744,_0x27b1a5){passport[_0x2460('0x14')]('local-login',function(_0x302bdc,_0x471de6,_0x1fb4d3){var _0x437d4a=_0x302bdc||_0x1fb4d3;if(_0x437d4a){return handleError(_0x2f4744,0x191,_0x437d4a);}if(!_0x471de6){return handleError(_0x2f4744,0x194,{'message':_0x2460('0x2b')});}else{var _0x5960ca={'payload':{'id':_0x471de6['id'],'role':_0x471de6['role']},'options':{'expiresIn':0x15180}};return authService[_0x2460('0x2c')](_0x5960ca)[_0x2460('0x13')](function(_0x4d32c0){_0x2f4744[_0x2460('0x2d')]({'id':_0x471de6['id'],'token':_0x4d32c0,'statusCall':'','isAlreadyLogged':_0x471de6['online']});});}})(_0x294450,_0x2f4744,_0x27b1a5);};exports[_0x2460('0x2e')]=function(_0x4aadc9,_0x2b8727){if(!_0x4aadc9[_0x2460('0x2f')][_0x2460('0x1e')]){return handleError(_0x2b8727,0x1f4,{'message':_0x2460('0x30')});}var _0x5e10fc=rs[_0x2460('0x31')]();_0x4aadc9[_0x2460('0x2f')]['email']=_0x4aadc9[_0x2460('0x2f')][_0x2460('0x1e')]['trim']()[_0x2460('0x32')]();var _0x5072d1;return db[_0x2460('0x8')]['findOne']({'where':{'id':0x1},'attributes':[_0x2460('0x15'),_0x2460('0x9')],'raw':!![]})[_0x2460('0x13')](function(_0xbb7903){_0x5072d1=_0xbb7903;return db[_0x2460('0x33')][_0x2460('0x34')]({'where':{'email':_0x4aadc9[_0x2460('0x2f')][_0x2460('0x1e')]}});})[_0x2460('0x13')](function(_0x1d221d){if(!_0x1d221d){throw new Error(_0x2460('0x35'));}if(_0x1d221d[_0x2460('0xe')]){throw new Error(_0x2460('0x36'));}if(_0x1d221d[_0x2460('0x18')]){if(moment(_0x1d221d[_0x2460('0xf')])['add'](_0x5072d1[_0x2460('0x9')],_0x2460('0x1a'))>moment()){throw new Error(_0x2460('0x37'));}else{_0x1d221d[_0x2460('0x18')]=![];_0x1d221d[_0x2460('0xf')]=null;}}_0x1d221d[_0x2460('0x38')]=_0x5e10fc;_0x1d221d['resetPasswordExpires']=Date[_0x2460('0x39')]()+0x36ee80;return _0x1d221d[_0x2460('0x3a')]();})[_0x2460('0x13')](function(){return sendServiceMail({'to':_0x4aadc9[_0x2460('0x2f')]['email'],'subject':_0x2460('0x3b'),'text':_0x2460('0x3c')+_0x2460('0x3d')+_0x2460('0x3e')+_0x4aadc9[_0x2460('0x3f')][_0x2460('0x40')]+_0x2460('0x41')+_0x5e10fc+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x2460('0x13')](function(){_0x2b8727[_0x2460('0x28')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})[_0x2460('0x1c')](function(_0x396f97){return handleError(_0x2b8727,0x1f4,_0x396f97);});};exports[_0x2460('0x42')]=function(_0x493ccf,_0x110abb){return db[_0x2460('0x33')][_0x2460('0x34')]({'where':{'resetPasswordToken':_0x493ccf[_0x2460('0x43')][_0x2460('0x44')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x2460('0x13')](function(_0x45fee6){if(!_0x45fee6){throw new Error(_0x2460('0x45'));}return db[_0x2460('0x8')]['findOne']({'attributes':['id',_0x2460('0x46'),'enforcePasswordHistory',_0x2460('0x47')]})['then'](function(_0xbd2cb2){if(_0xbd2cb2[_0x2460('0x46')])authService['validatePasswordPattern'](_0x493ccf['body'][_0x2460('0xc')]);if(!_0xbd2cb2[_0x2460('0x48')]||!_0x45fee6['previousPasswords'])return _0x45fee6;authService[_0x2460('0x49')](_0x493ccf[_0x2460('0x2f')][_0x2460('0xc')],_0x45fee6[_0x2460('0x4a')],_0xbd2cb2['passwordHistoryLimit']);return _0x45fee6;})[_0x2460('0x13')](function(){_0x45fee6[_0x2460('0xc')]=_0x493ccf['body'][_0x2460('0xc')];_0x45fee6[_0x2460('0x38')]=null;_0x45fee6[_0x2460('0x4b')]=null;return _0x45fee6[_0x2460('0x3a')]();});})[_0x2460('0x13')](function(){_0x110abb['status'](0xc8)[_0x2460('0x29')]({'message':_0x2460('0x4c')});})[_0x2460('0x1c')](function(_0x329bd5){return handleError(_0x110abb,0x1f4,_0x329bd5);});};passport[_0x2460('0x4d')](_0x2460('0x4e'),new LocalStrategy({'usernameField':_0x2460('0xb'),'passwordField':_0x2460('0xc')},function(_0x3edd2f,_0x2d63b3,_0x4dfddc){return localAuthenticate(db[_0x2460('0x33')],_0x3edd2f,_0x2d63b3,_0x4dfddc);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 8a817b5..eb80c48 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 _0xdef8=['reset','exports','express','./authLocal.controller','login','post','/forgot','/reset/:token'];(function(_0x39e1e3,_0x45ba4d){var _0x4946ab=function(_0x21835d){while(--_0x21835d){_0x39e1e3['push'](_0x39e1e3['shift']());}};_0x4946ab(++_0x45ba4d);}(_0xdef8,0x11a));var _0x8def=function(_0xa54301,_0x2bc8e0){_0xa54301=_0xa54301-0x0;var _0x6834c1=_0xdef8[_0xa54301];return _0x6834c1;};'use strict';var express=require(_0x8def('0x0'));var router=express['Router']();var controller=require(_0x8def('0x1'));router['post']('/',controller[_0x8def('0x2')]);router[_0x8def('0x3')](_0x8def('0x4'),controller['forgot']);router['post'](_0x8def('0x5'),controller[_0x8def('0x6')]);module[_0x8def('0x7')]=router;
\ No newline at end of file
+var _0x9cb8=['login','/forgot','forgot','/reset/:token','reset','exports','Router','./authLocal.controller','post'];(function(_0x35825e,_0x657421){var _0x4f4d90=function(_0x160265){while(--_0x160265){_0x35825e['push'](_0x35825e['shift']());}};_0x4f4d90(++_0x657421);}(_0x9cb8,0x192));var _0x89cb=function(_0x251c5a,_0x173cbe){_0x251c5a=_0x251c5a-0x0;var _0x1cb570=_0x9cb8[_0x251c5a];return _0x1cb570;};'use strict';var express=require('express');var router=express[_0x89cb('0x0')]();var controller=require(_0x89cb('0x1'));router[_0x89cb('0x2')]('/',controller[_0x89cb('0x3')]);router[_0x89cb('0x2')](_0x89cb('0x4'),controller[_0x89cb('0x5')]);router[_0x89cb('0x2')](_0x89cb('0x6'),controller[_0x89cb('0x7')]);module[_0x89cb('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 4e5d16f..d86c7d7 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 _0x6d65=['INTEGER','sequelize','exports','STRING'];(function(_0x138a60,_0x25ce07){var _0x1a967c=function(_0x24f1d9){while(--_0x24f1d9){_0x138a60['push'](_0x138a60['shift']());}};_0x1a967c(++_0x25ce07);}(_0x6d65,0x191));var _0x56d6=function(_0x1f22d5,_0x33e246){_0x1f22d5=_0x1f22d5-0x0;var _0x5bc93b=_0x6d65[_0x1f22d5];return _0x5bc93b;};'use strict';var Sequelize=require(_0x56d6('0x0'));module[_0x56d6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x56d6('0x2')]},'description':{'type':Sequelize[_0x56d6('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x56d6('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xff07=['exports','STRING','BOOLEAN','INTEGER'];(function(_0x59ec5e,_0x5096b9){var _0xbb997a=function(_0x3911e2){while(--_0x3911e2){_0x59ec5e['push'](_0x59ec5e['shift']());}};_0xbb997a(++_0x5096b9);}(_0xff07,0x180));var _0x7ff0=function(_0x2b90dc,_0x10b832){_0x2b90dc=_0x2b90dc-0x0;var _0x4794a6=_0xff07[_0x2b90dc];return _0x4794a6;};'use strict';var Sequelize=require('sequelize');module[_0x7ff0('0x0')]={'name':{'type':Sequelize[_0x7ff0('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x7ff0('0x1')]},'description':{'type':Sequelize[_0x7ff0('0x1')]},'status':{'type':Sequelize[_0x7ff0('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x7ff0('0x3')],'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 fc7aa4e..c6cf812 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 _0x3f9b=['show','params','includeAll','include','find','create','body','Condition','addConditions','omit','ids','findOne','getConditions','addActions','Action','getActions','hasOwnProperty','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','Automation','rawAttributes','type','key','model','keys','filters','attributes','intersection','fields','length','query','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch'];(function(_0x2b5a65,_0x395f84){var _0xf4ab8=function(_0x43c09f){while(--_0x43c09f){_0x2b5a65['push'](_0x2b5a65['shift']());}};_0xf4ab8(++_0x395f84);}(_0x3f9b,0x110));var _0xb3f9=function(_0x27c96e,_0x2074ef){_0x27c96e=_0x27c96e-0x0;var _0x1dea73=_0x3f9b[_0x27c96e];return _0x1dea73;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb3f9('0x0'));var rp=require(_0xb3f9('0x1'));var moment=require('moment');var BPromise=require(_0xb3f9('0x2'));var Mustache=require(_0xb3f9('0x3'));var util=require(_0xb3f9('0x4'));var path=require(_0xb3f9('0x5'));var sox=require(_0xb3f9('0x6'));var csv=require(_0xb3f9('0x7'));var ejs=require(_0xb3f9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb3f9('0x9'));var squel=require(_0xb3f9('0xa'));var crypto=require('crypto');var jsforce=require(_0xb3f9('0xb'));var deskjs=require(_0xb3f9('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb3f9('0xd'));var Papa=require(_0xb3f9('0xe'));var Redis=require('ioredis');var authService=require(_0xb3f9('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb3f9('0x10'));var hardwareService=require(_0xb3f9('0x11'));var logger=require(_0xb3f9('0x12'))(_0xb3f9('0x13'));var utils=require(_0xb3f9('0x14'));var config=require(_0xb3f9('0x15'));var licenseUtil=require(_0xb3f9('0x16'));var db=require(_0xb3f9('0x17'))['db'];function respondWithStatusCode(_0x5eb9d3,_0x46c230){_0x46c230=_0x46c230||0xcc;return function(_0x5b10e4){if(_0x5b10e4){return _0x5eb9d3['sendStatus'](_0x46c230);}return _0x5eb9d3['status'](_0x46c230)[_0xb3f9('0x18')]();};}function respondWithResult(_0x218e40,_0x109ad0){_0x109ad0=_0x109ad0||0xc8;return function(_0x460efa){if(_0x460efa){return _0x218e40[_0xb3f9('0x19')](_0x109ad0)[_0xb3f9('0x1a')](_0x460efa);}};}function respondWithFilteredResult(_0x34a7e9,_0x3f117b){return function(_0x559989){if(_0x559989){var _0xb51f0b=typeof _0x3f117b[_0xb3f9('0x1b')]===_0xb3f9('0x1c')&&typeof _0x3f117b[_0xb3f9('0x1d')]===_0xb3f9('0x1c');var _0x452fbb=_0x559989[_0xb3f9('0x1e')];var _0x4ae838=_0xb51f0b?0x0:_0x3f117b[_0xb3f9('0x1b')];var _0x5f353e=_0xb51f0b?_0x559989[_0xb3f9('0x1e')]:_0x3f117b[_0xb3f9('0x1b')]+_0x3f117b[_0xb3f9('0x1d')];var _0x2b5a00;if(_0x5f353e>=_0x452fbb){_0x5f353e=_0x452fbb;_0x2b5a00=0xc8;}else{_0x2b5a00=0xce;}_0x34a7e9[_0xb3f9('0x19')](_0x2b5a00);return _0x34a7e9['set'](_0xb3f9('0x1f'),_0x4ae838+'-'+_0x5f353e+'/'+_0x452fbb)[_0xb3f9('0x1a')](_0x559989);}return null;};}function patchUpdates(_0x674166){return function(_0x34048d){try{jsonpatch[_0xb3f9('0x20')](_0x34048d,_0x674166,!![]);}catch(_0x47519b){return BPromise[_0xb3f9('0x21')](_0x47519b);}return _0x34048d[_0xb3f9('0x22')]();};}function saveUpdates(_0x55f8c7,_0x5041a7){return function(_0x4f32f9){if(_0x4f32f9){return _0x4f32f9[_0xb3f9('0x23')](_0x55f8c7)[_0xb3f9('0x24')](function(_0x3ac142){return _0x3ac142;});}return null;};}function removeEntity(_0x567a0c,_0x3cdca6){return function(_0x3bb486){if(_0x3bb486){return _0x3bb486[_0xb3f9('0x25')]()[_0xb3f9('0x24')](function(){_0x567a0c[_0xb3f9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2002f6,_0xbf03dd){return function(_0x3e4253){if(!_0x3e4253){_0x2002f6[_0xb3f9('0x26')](0x194);}return _0x3e4253;};}function handleError(_0x8c1f72,_0x192736){_0x192736=_0x192736||0x1f4;return function(_0x5b633f){logger[_0xb3f9('0x27')](_0x5b633f[_0xb3f9('0x28')]);if(_0x5b633f[_0xb3f9('0x29')]){delete _0x5b633f[_0xb3f9('0x29')];}_0x8c1f72[_0xb3f9('0x19')](_0x192736)['send'](_0x5b633f);};}exports[_0xb3f9('0x2a')]=function(_0x17e981,_0x15f087){var _0x463e94={},_0x347193={},_0x2b7f20={'count':0x0,'rows':[]};var _0x24b2b3=_[_0xb3f9('0x2b')](db[_0xb3f9('0x2c')][_0xb3f9('0x2d')],function(_0x1ab486){return{'name':_0x1ab486['fieldName'],'type':_0x1ab486[_0xb3f9('0x2e')][_0xb3f9('0x2f')]};});_0x347193[_0xb3f9('0x30')]=_[_0xb3f9('0x2b')](_0x24b2b3,_0xb3f9('0x29'));_0x347193['query']=_[_0xb3f9('0x31')](_0x17e981['query']);_0x347193[_0xb3f9('0x32')]=_['intersection'](_0x347193[_0xb3f9('0x30')],_0x347193['query']);_0x463e94[_0xb3f9('0x33')]=_[_0xb3f9('0x34')](_0x347193[_0xb3f9('0x30')],qs[_0xb3f9('0x35')](_0x17e981['query'][_0xb3f9('0x35')]));_0x463e94['attributes']=_0x463e94[_0xb3f9('0x33')][_0xb3f9('0x36')]?_0x463e94[_0xb3f9('0x33')]:_0x347193[_0xb3f9('0x30')];if(!_0x17e981[_0xb3f9('0x37')]['hasOwnProperty'](_0xb3f9('0x38'))){_0x463e94[_0xb3f9('0x1d')]=qs['limit'](_0x17e981['query']['limit']);_0x463e94['offset']=qs[_0xb3f9('0x1b')](_0x17e981[_0xb3f9('0x37')][_0xb3f9('0x1b')]);}_0x463e94[_0xb3f9('0x39')]=qs['sort'](_0x17e981[_0xb3f9('0x37')][_0xb3f9('0x3a')]);_0x463e94[_0xb3f9('0x3b')]=qs[_0xb3f9('0x32')](_[_0xb3f9('0x3c')](_0x17e981[_0xb3f9('0x37')],_0x347193[_0xb3f9('0x32')]),_0x24b2b3);if(_0x17e981['query'][_0xb3f9('0x3d')]){_0x463e94['where']=_['merge'](_0x463e94['where'],{'$or':_[_0xb3f9('0x2b')](_0x24b2b3,function(_0x5d5721){if(_0x5d5721['type']!==_0xb3f9('0x3e')){var _0x139805={};_0x139805[_0x5d5721[_0xb3f9('0x29')]]={'$like':'%'+_0x17e981['query'][_0xb3f9('0x3d')]+'%'};return _0x139805;}})});}_0x463e94=_[_0xb3f9('0x3f')]({},_0x463e94,_0x17e981[_0xb3f9('0x40')]);var _0x597eed={'where':_0x463e94[_0xb3f9('0x3b')]};return db[_0xb3f9('0x2c')][_0xb3f9('0x1e')](_0x597eed)[_0xb3f9('0x24')](function(_0x2e0d72){_0x2b7f20[_0xb3f9('0x1e')]=_0x2e0d72;if(_0x17e981['query']['includeAll']){_0x463e94['include']=[{'all':!![]}];}return db[_0xb3f9('0x2c')][_0xb3f9('0x41')](_0x463e94);})['then'](function(_0x1130a3){_0x2b7f20[_0xb3f9('0x42')]=_0x1130a3;return _0x2b7f20;})[_0xb3f9('0x24')](respondWithFilteredResult(_0x15f087,_0x463e94))[_0xb3f9('0x43')](handleError(_0x15f087,null));};exports[_0xb3f9('0x44')]=function(_0x27cb5b,_0x469239){var _0x14aab2={'raw':![],'where':{'id':_0x27cb5b[_0xb3f9('0x45')]['id']}},_0x182e16={};_0x182e16['model']=_[_0xb3f9('0x31')](db[_0xb3f9('0x2c')][_0xb3f9('0x2d')]);_0x182e16[_0xb3f9('0x37')]=_[_0xb3f9('0x31')](_0x27cb5b['query']);_0x182e16['filters']=_['intersection'](_0x182e16[_0xb3f9('0x30')],_0x182e16['query']);_0x14aab2[_0xb3f9('0x33')]=_[_0xb3f9('0x34')](_0x182e16[_0xb3f9('0x30')],qs['fields'](_0x27cb5b[_0xb3f9('0x37')][_0xb3f9('0x35')]));_0x14aab2[_0xb3f9('0x33')]=_0x14aab2['attributes'][_0xb3f9('0x36')]?_0x14aab2[_0xb3f9('0x33')]:_0x182e16[_0xb3f9('0x30')];if(_0x27cb5b[_0xb3f9('0x37')][_0xb3f9('0x46')]){_0x14aab2[_0xb3f9('0x47')]=[{'all':!![]}];}_0x14aab2=_[_0xb3f9('0x3f')]({},_0x14aab2,_0x27cb5b[_0xb3f9('0x40')]);return db[_0xb3f9('0x2c')][_0xb3f9('0x48')](_0x14aab2)[_0xb3f9('0x24')](handleEntityNotFound(_0x469239,null))['then'](respondWithResult(_0x469239,null))[_0xb3f9('0x43')](handleError(_0x469239,null));};exports[_0xb3f9('0x49')]=function(_0x2c1e55,_0x2feffd){return db['Automation']['create'](_0x2c1e55['body'],{})[_0xb3f9('0x24')](respondWithResult(_0x2feffd,0xc9))['catch'](handleError(_0x2feffd,null));};exports[_0xb3f9('0x23')]=function(_0x127481,_0x49aecd){if(_0x127481[_0xb3f9('0x4a')]['id']){delete _0x127481['body']['id'];}return db[_0xb3f9('0x2c')][_0xb3f9('0x48')]({'where':{'id':_0x127481['params']['id']}})['then'](handleEntityNotFound(_0x49aecd,null))[_0xb3f9('0x24')](saveUpdates(_0x127481[_0xb3f9('0x4a')],null))[_0xb3f9('0x24')](respondWithResult(_0x49aecd,null))[_0xb3f9('0x43')](handleError(_0x49aecd,null));};exports[_0xb3f9('0x25')]=function(_0x19a518,_0x20cd9f){return db[_0xb3f9('0x2c')]['find']({'where':{'id':_0x19a518['params']['id']}})[_0xb3f9('0x24')](handleEntityNotFound(_0x20cd9f,null))['then'](removeEntity(_0x20cd9f,null))[_0xb3f9('0x43')](handleError(_0x20cd9f,null));};exports['addConditions']=function(_0x16ac45,_0xda0d54,_0x2863df){return db[_0xb3f9('0x4b')][_0xb3f9('0x48')]({'where':{'id':_0x16ac45[_0xb3f9('0x45')]['id']}})[_0xb3f9('0x24')](handleEntityNotFound(_0xda0d54,null))[_0xb3f9('0x24')](function(_0x22be9d){if(_0x22be9d){return _0x22be9d[_0xb3f9('0x4c')](_0x16ac45[_0xb3f9('0x4a')]['ids'],_[_0xb3f9('0x4d')](_0x16ac45['body'],[_0xb3f9('0x4e'),'id'])||{});}})[_0xb3f9('0x24')](respondWithResult(_0xda0d54,null))[_0xb3f9('0x43')](handleError(_0xda0d54,null));};exports['getConditions']=function(_0x327447,_0x4495cf,_0x572911){var _0x4c90ff={};var _0x217273={};var _0x262697;var _0x15da18;return db[_0xb3f9('0x2c')][_0xb3f9('0x4f')]({'where':{'id':_0x327447['params']['id']}})[_0xb3f9('0x24')](handleEntityNotFound(_0x4495cf,null))[_0xb3f9('0x24')](function(_0x130174){if(_0x130174){_0x262697=_0x130174;_0x217273[_0xb3f9('0x30')]=_[_0xb3f9('0x31')](db[_0xb3f9('0x4b')][_0xb3f9('0x2d')]);_0x217273['query']=_[_0xb3f9('0x31')](_0x327447[_0xb3f9('0x37')]);_0x217273[_0xb3f9('0x32')]=_['intersection'](_0x217273['model'],_0x217273['query']);_0x4c90ff['attributes']=_['intersection'](_0x217273[_0xb3f9('0x30')],qs[_0xb3f9('0x35')](_0x327447[_0xb3f9('0x37')]['fields']));_0x4c90ff[_0xb3f9('0x33')]=_0x4c90ff[_0xb3f9('0x33')][_0xb3f9('0x36')]?_0x4c90ff[_0xb3f9('0x33')]:_0x217273['model'];_0x4c90ff[_0xb3f9('0x39')]=qs[_0xb3f9('0x3a')](_0x327447[_0xb3f9('0x37')][_0xb3f9('0x3a')]);_0x4c90ff[_0xb3f9('0x3b')]=qs['filters'](_['pick'](_0x327447[_0xb3f9('0x37')],_0x217273['filters']));if(_0x327447[_0xb3f9('0x37')][_0xb3f9('0x3d')]){_0x4c90ff[_0xb3f9('0x3b')]=_[_0xb3f9('0x3f')](_0x4c90ff[_0xb3f9('0x3b')],{'$or':_[_0xb3f9('0x2b')](_0x4c90ff[_0xb3f9('0x33')],function(_0x412b68){var _0x23667d={};_0x23667d[_0x412b68]={'$like':'%'+_0x327447['query'][_0xb3f9('0x3d')]+'%'};return _0x23667d;})});}_0x4c90ff=_[_0xb3f9('0x3f')]({},_0x4c90ff,_0x327447[_0xb3f9('0x40')]);return _0x262697[_0xb3f9('0x50')](_0x4c90ff);}})[_0xb3f9('0x24')](function(_0xd543ba){if(_0xd543ba){_0x15da18=_0xd543ba[_0xb3f9('0x36')];if(!_0x327447[_0xb3f9('0x37')]['hasOwnProperty'](_0xb3f9('0x38'))){_0x4c90ff[_0xb3f9('0x1d')]=qs[_0xb3f9('0x1d')](_0x327447[_0xb3f9('0x37')]['limit']);_0x4c90ff[_0xb3f9('0x1b')]=qs[_0xb3f9('0x1b')](_0x327447[_0xb3f9('0x37')]['offset']);}return _0x262697['getConditions'](_0x4c90ff);}})[_0xb3f9('0x24')](function(_0x19d18e){if(_0x19d18e){return _0x19d18e?{'count':_0x15da18,'rows':_0x19d18e}:null;}})[_0xb3f9('0x24')](respondWithResult(_0x4495cf,null))[_0xb3f9('0x43')](handleError(_0x4495cf,null));};exports[_0xb3f9('0x51')]=function(_0x30d085,_0x3c6269,_0x1ae0b8){return db[_0xb3f9('0x52')][_0xb3f9('0x48')]({'where':{'id':_0x30d085[_0xb3f9('0x45')]['id']}})['then'](handleEntityNotFound(_0x3c6269,null))[_0xb3f9('0x24')](function(_0x2454d1){if(_0x2454d1){return _0x2454d1[_0xb3f9('0x51')](_0x30d085[_0xb3f9('0x4a')][_0xb3f9('0x4e')],_['omit'](_0x30d085['body'],['ids','id'])||{});}})[_0xb3f9('0x24')](respondWithResult(_0x3c6269,null))[_0xb3f9('0x43')](handleError(_0x3c6269,null));};exports[_0xb3f9('0x53')]=function(_0xe27b47,_0x59a8dd,_0x23d4fa){var _0x1046b0={};var _0x4939be={};var _0x4a3158;var _0x40abac;return db[_0xb3f9('0x2c')][_0xb3f9('0x4f')]({'where':{'id':_0xe27b47[_0xb3f9('0x45')]['id']}})[_0xb3f9('0x24')](handleEntityNotFound(_0x59a8dd,null))['then'](function(_0x4a2c55){if(_0x4a2c55){_0x4a3158=_0x4a2c55;_0x4939be[_0xb3f9('0x30')]=_[_0xb3f9('0x31')](db[_0xb3f9('0x52')][_0xb3f9('0x2d')]);_0x4939be[_0xb3f9('0x37')]=_[_0xb3f9('0x31')](_0xe27b47[_0xb3f9('0x37')]);_0x4939be[_0xb3f9('0x32')]=_['intersection'](_0x4939be[_0xb3f9('0x30')],_0x4939be[_0xb3f9('0x37')]);_0x1046b0['attributes']=_[_0xb3f9('0x34')](_0x4939be[_0xb3f9('0x30')],qs[_0xb3f9('0x35')](_0xe27b47[_0xb3f9('0x37')]['fields']));_0x1046b0[_0xb3f9('0x33')]=_0x1046b0['attributes'][_0xb3f9('0x36')]?_0x1046b0['attributes']:_0x4939be[_0xb3f9('0x30')];_0x1046b0[_0xb3f9('0x39')]=qs['sort'](_0xe27b47[_0xb3f9('0x37')][_0xb3f9('0x3a')]);_0x1046b0[_0xb3f9('0x3b')]=qs['filters'](_[_0xb3f9('0x3c')](_0xe27b47[_0xb3f9('0x37')],_0x4939be[_0xb3f9('0x32')]));if(_0xe27b47[_0xb3f9('0x37')]['filter']){_0x1046b0[_0xb3f9('0x3b')]=_[_0xb3f9('0x3f')](_0x1046b0[_0xb3f9('0x3b')],{'$or':_[_0xb3f9('0x2b')](_0x1046b0[_0xb3f9('0x33')],function(_0x100b2d){var _0x4483c1={};_0x4483c1[_0x100b2d]={'$like':'%'+_0xe27b47[_0xb3f9('0x37')][_0xb3f9('0x3d')]+'%'};return _0x4483c1;})});}_0x1046b0=_[_0xb3f9('0x3f')]({},_0x1046b0,_0xe27b47[_0xb3f9('0x40')]);return _0x4a3158[_0xb3f9('0x53')](_0x1046b0);}})[_0xb3f9('0x24')](function(_0x5c3d6a){if(_0x5c3d6a){_0x40abac=_0x5c3d6a['length'];if(!_0xe27b47[_0xb3f9('0x37')][_0xb3f9('0x54')]('nolimit')){_0x1046b0['limit']=qs[_0xb3f9('0x1d')](_0xe27b47[_0xb3f9('0x37')][_0xb3f9('0x1d')]);_0x1046b0['offset']=qs[_0xb3f9('0x1b')](_0xe27b47[_0xb3f9('0x37')][_0xb3f9('0x1b')]);}return _0x4a3158[_0xb3f9('0x53')](_0x1046b0);}})[_0xb3f9('0x24')](function(_0x1dfc49){if(_0x1dfc49){return _0x1dfc49?{'count':_0x40abac,'rows':_0x1dfc49}:null;}})[_0xb3f9('0x24')](respondWithResult(_0x59a8dd,null))[_0xb3f9('0x43')](handleError(_0x59a8dd,null));};
\ No newline at end of file
+var _0xc0ae=['getActions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','filter','where','merge','includeAll','catch','show','params','length','include','options','create','body','find','addConditions','Condition','omit','ids','findOne','order','pick','getConditions','addActions','Action'];(function(_0x23cf72,_0x22e108){var _0x3bc541=function(_0x59ef43){while(--_0x59ef43){_0x23cf72['push'](_0x23cf72['shift']());}};_0x3bc541(++_0x22e108);}(_0xc0ae,0xeb));var _0xec0a=function(_0x1438fb,_0x415ec0){_0x1438fb=_0x1438fb-0x0;var _0xbd63b=_0xc0ae[_0x1438fb];return _0xbd63b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec0a('0x0'));var zipdir=require(_0xec0a('0x1'));var jsonpatch=require(_0xec0a('0x2'));var rp=require(_0xec0a('0x3'));var moment=require('moment');var BPromise=require(_0xec0a('0x4'));var Mustache=require(_0xec0a('0x5'));var util=require(_0xec0a('0x6'));var path=require('path');var sox=require(_0xec0a('0x7'));var csv=require(_0xec0a('0x8'));var ejs=require(_0xec0a('0x9'));var fs=require('fs');var fs_extra=require(_0xec0a('0xa'));var _=require(_0xec0a('0xb'));var squel=require(_0xec0a('0xc'));var crypto=require(_0xec0a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xec0a('0xe'));var toCsv=require(_0xec0a('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xec0a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xec0a('0x10'));var as=require(_0xec0a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xec0a('0x12'))('api');var utils=require(_0xec0a('0x13'));var config=require(_0xec0a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xec0a('0x15'))['db'];function respondWithStatusCode(_0x230342,_0x3ee866){_0x3ee866=_0x3ee866||0xcc;return function(_0x10ae66){if(_0x10ae66){return _0x230342[_0xec0a('0x16')](_0x3ee866);}return _0x230342[_0xec0a('0x17')](_0x3ee866)[_0xec0a('0x18')]();};}function respondWithResult(_0xb302e7,_0x587167){_0x587167=_0x587167||0xc8;return function(_0x4e8b06){if(_0x4e8b06){return _0xb302e7[_0xec0a('0x17')](_0x587167)['json'](_0x4e8b06);}};}function respondWithFilteredResult(_0x44a8b4,_0x1cbe44){return function(_0x5a65dd){if(_0x5a65dd){var _0x4daa20=typeof _0x1cbe44[_0xec0a('0x19')]==='undefined'&&typeof _0x1cbe44[_0xec0a('0x1a')]==='undefined';var _0x5211f9=_0x5a65dd[_0xec0a('0x1b')];var _0x59f622=_0x4daa20?0x0:_0x1cbe44[_0xec0a('0x19')];var _0x5e79a8=_0x4daa20?_0x5a65dd[_0xec0a('0x1b')]:_0x1cbe44[_0xec0a('0x19')]+_0x1cbe44[_0xec0a('0x1a')];var _0x1a0fa0;if(_0x5e79a8>=_0x5211f9){_0x5e79a8=_0x5211f9;_0x1a0fa0=0xc8;}else{_0x1a0fa0=0xce;}_0x44a8b4['status'](_0x1a0fa0);return _0x44a8b4[_0xec0a('0x1c')](_0xec0a('0x1d'),_0x59f622+'-'+_0x5e79a8+'/'+_0x5211f9)['json'](_0x5a65dd);}return null;};}function patchUpdates(_0x20cfbe){return function(_0x198b84){try{jsonpatch['apply'](_0x198b84,_0x20cfbe,!![]);}catch(_0x58a813){return BPromise['reject'](_0x58a813);}return _0x198b84['save']();};}function saveUpdates(_0x584814,_0x20ec4e){return function(_0x5e2f7b){if(_0x5e2f7b){return _0x5e2f7b[_0xec0a('0x1e')](_0x584814)[_0xec0a('0x1f')](function(_0x26bd59){return _0x26bd59;});}return null;};}function removeEntity(_0xe1739a,_0x5edffc){return function(_0x1555bd){if(_0x1555bd){return _0x1555bd[_0xec0a('0x20')]()[_0xec0a('0x1f')](function(){_0xe1739a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f3d18,_0x531569){return function(_0xfd4cd0){if(!_0xfd4cd0){_0x3f3d18[_0xec0a('0x16')](0x194);}return _0xfd4cd0;};}function handleError(_0x479d5e,_0x47ce03){_0x47ce03=_0x47ce03||0x1f4;return function(_0x1fee77){logger[_0xec0a('0x21')](_0x1fee77[_0xec0a('0x22')]);if(_0x1fee77['name']){delete _0x1fee77[_0xec0a('0x23')];}_0x479d5e['status'](_0x47ce03)[_0xec0a('0x24')](_0x1fee77);};}exports[_0xec0a('0x25')]=function(_0xe2cf51,_0x52d6f4){var _0x3959a7={},_0x97654a={},_0x585f2e={'count':0x0,'rows':[]};var _0x5434f6=_[_0xec0a('0x26')](db[_0xec0a('0x27')][_0xec0a('0x28')],function(_0x406569){return{'name':_0x406569[_0xec0a('0x29')],'type':_0x406569[_0xec0a('0x2a')][_0xec0a('0x2b')]};});_0x97654a[_0xec0a('0x2c')]=_[_0xec0a('0x26')](_0x5434f6,'name');_0x97654a[_0xec0a('0x2d')]=_[_0xec0a('0x2e')](_0xe2cf51[_0xec0a('0x2d')]);_0x97654a['filters']=_[_0xec0a('0x2f')](_0x97654a[_0xec0a('0x2c')],_0x97654a[_0xec0a('0x2d')]);_0x3959a7[_0xec0a('0x30')]=_[_0xec0a('0x2f')](_0x97654a[_0xec0a('0x2c')],qs[_0xec0a('0x31')](_0xe2cf51[_0xec0a('0x2d')][_0xec0a('0x31')]));_0x3959a7['attributes']=_0x3959a7[_0xec0a('0x30')]['length']?_0x3959a7[_0xec0a('0x30')]:_0x97654a[_0xec0a('0x2c')];if(!_0xe2cf51[_0xec0a('0x2d')][_0xec0a('0x32')](_0xec0a('0x33'))){_0x3959a7[_0xec0a('0x1a')]=qs[_0xec0a('0x1a')](_0xe2cf51['query']['limit']);_0x3959a7[_0xec0a('0x19')]=qs[_0xec0a('0x19')](_0xe2cf51[_0xec0a('0x2d')][_0xec0a('0x19')]);}_0x3959a7['order']=qs[_0xec0a('0x34')](_0xe2cf51[_0xec0a('0x2d')][_0xec0a('0x34')]);_0x3959a7['where']=qs[_0xec0a('0x35')](_['pick'](_0xe2cf51[_0xec0a('0x2d')],_0x97654a[_0xec0a('0x35')]),_0x5434f6);if(_0xe2cf51['query'][_0xec0a('0x36')]){_0x3959a7[_0xec0a('0x37')]=_[_0xec0a('0x38')](_0x3959a7['where'],{'$or':_[_0xec0a('0x26')](_0x5434f6,function(_0x306d32){if(_0x306d32[_0xec0a('0x2a')]!=='VIRTUAL'){var _0x431c0f={};_0x431c0f[_0x306d32['name']]={'$like':'%'+_0xe2cf51[_0xec0a('0x2d')][_0xec0a('0x36')]+'%'};return _0x431c0f;}})});}_0x3959a7=_[_0xec0a('0x38')]({},_0x3959a7,_0xe2cf51['options']);var _0x38f1e1={'where':_0x3959a7[_0xec0a('0x37')]};return db[_0xec0a('0x27')][_0xec0a('0x1b')](_0x38f1e1)[_0xec0a('0x1f')](function(_0x390b37){_0x585f2e[_0xec0a('0x1b')]=_0x390b37;if(_0xe2cf51[_0xec0a('0x2d')][_0xec0a('0x39')]){_0x3959a7['include']=[{'all':!![]}];}return db['Automation']['findAll'](_0x3959a7);})[_0xec0a('0x1f')](function(_0x1d4a87){_0x585f2e['rows']=_0x1d4a87;return _0x585f2e;})[_0xec0a('0x1f')](respondWithFilteredResult(_0x52d6f4,_0x3959a7))[_0xec0a('0x3a')](handleError(_0x52d6f4,null));};exports[_0xec0a('0x3b')]=function(_0x32c116,_0x4210a4){var _0x5d6c8e={'raw':![],'where':{'id':_0x32c116[_0xec0a('0x3c')]['id']}},_0x1f070d={};_0x1f070d['model']=_[_0xec0a('0x2e')](db['Automation'][_0xec0a('0x28')]);_0x1f070d[_0xec0a('0x2d')]=_[_0xec0a('0x2e')](_0x32c116[_0xec0a('0x2d')]);_0x1f070d[_0xec0a('0x35')]=_[_0xec0a('0x2f')](_0x1f070d['model'],_0x1f070d[_0xec0a('0x2d')]);_0x5d6c8e[_0xec0a('0x30')]=_[_0xec0a('0x2f')](_0x1f070d['model'],qs[_0xec0a('0x31')](_0x32c116[_0xec0a('0x2d')][_0xec0a('0x31')]));_0x5d6c8e[_0xec0a('0x30')]=_0x5d6c8e[_0xec0a('0x30')][_0xec0a('0x3d')]?_0x5d6c8e['attributes']:_0x1f070d[_0xec0a('0x2c')];if(_0x32c116[_0xec0a('0x2d')][_0xec0a('0x39')]){_0x5d6c8e[_0xec0a('0x3e')]=[{'all':!![]}];}_0x5d6c8e=_[_0xec0a('0x38')]({},_0x5d6c8e,_0x32c116[_0xec0a('0x3f')]);return db['Automation']['find'](_0x5d6c8e)[_0xec0a('0x1f')](handleEntityNotFound(_0x4210a4,null))[_0xec0a('0x1f')](respondWithResult(_0x4210a4,null))[_0xec0a('0x3a')](handleError(_0x4210a4,null));};exports[_0xec0a('0x40')]=function(_0x46ef16,_0x4a1bfe){return db['Automation'][_0xec0a('0x40')](_0x46ef16['body'],{})['then'](respondWithResult(_0x4a1bfe,0xc9))[_0xec0a('0x3a')](handleError(_0x4a1bfe,null));};exports[_0xec0a('0x1e')]=function(_0x1af951,_0x15bde3){if(_0x1af951['body']['id']){delete _0x1af951[_0xec0a('0x41')]['id'];}return db['Automation']['find']({'where':{'id':_0x1af951[_0xec0a('0x3c')]['id']}})[_0xec0a('0x1f')](handleEntityNotFound(_0x15bde3,null))[_0xec0a('0x1f')](saveUpdates(_0x1af951[_0xec0a('0x41')],null))[_0xec0a('0x1f')](respondWithResult(_0x15bde3,null))['catch'](handleError(_0x15bde3,null));};exports[_0xec0a('0x20')]=function(_0x46f2f9,_0x436336){return db[_0xec0a('0x27')][_0xec0a('0x42')]({'where':{'id':_0x46f2f9[_0xec0a('0x3c')]['id']}})[_0xec0a('0x1f')](handleEntityNotFound(_0x436336,null))[_0xec0a('0x1f')](removeEntity(_0x436336,null))['catch'](handleError(_0x436336,null));};exports[_0xec0a('0x43')]=function(_0x29e2db,_0x42d444,_0x32457c){return db[_0xec0a('0x44')][_0xec0a('0x42')]({'where':{'id':_0x29e2db[_0xec0a('0x3c')]['id']}})[_0xec0a('0x1f')](handleEntityNotFound(_0x42d444,null))[_0xec0a('0x1f')](function(_0xb01fde){if(_0xb01fde){return _0xb01fde['addConditions'](_0x29e2db[_0xec0a('0x41')]['ids'],_[_0xec0a('0x45')](_0x29e2db['body'],[_0xec0a('0x46'),'id'])||{});}})[_0xec0a('0x1f')](respondWithResult(_0x42d444,null))[_0xec0a('0x3a')](handleError(_0x42d444,null));};exports['getConditions']=function(_0x40be08,_0x419dd6,_0x53bf50){var _0x31ea3d={};var _0x11ab12={};var _0x42c501;var _0xe729bf;return db[_0xec0a('0x27')][_0xec0a('0x47')]({'where':{'id':_0x40be08[_0xec0a('0x3c')]['id']}})[_0xec0a('0x1f')](handleEntityNotFound(_0x419dd6,null))[_0xec0a('0x1f')](function(_0x3801e0){if(_0x3801e0){_0x42c501=_0x3801e0;_0x11ab12[_0xec0a('0x2c')]=_['keys'](db[_0xec0a('0x44')][_0xec0a('0x28')]);_0x11ab12[_0xec0a('0x2d')]=_[_0xec0a('0x2e')](_0x40be08['query']);_0x11ab12[_0xec0a('0x35')]=_[_0xec0a('0x2f')](_0x11ab12['model'],_0x11ab12[_0xec0a('0x2d')]);_0x31ea3d[_0xec0a('0x30')]=_[_0xec0a('0x2f')](_0x11ab12[_0xec0a('0x2c')],qs[_0xec0a('0x31')](_0x40be08[_0xec0a('0x2d')]['fields']));_0x31ea3d[_0xec0a('0x30')]=_0x31ea3d[_0xec0a('0x30')][_0xec0a('0x3d')]?_0x31ea3d['attributes']:_0x11ab12['model'];_0x31ea3d[_0xec0a('0x48')]=qs[_0xec0a('0x34')](_0x40be08[_0xec0a('0x2d')][_0xec0a('0x34')]);_0x31ea3d[_0xec0a('0x37')]=qs[_0xec0a('0x35')](_[_0xec0a('0x49')](_0x40be08['query'],_0x11ab12[_0xec0a('0x35')]));if(_0x40be08[_0xec0a('0x2d')]['filter']){_0x31ea3d[_0xec0a('0x37')]=_[_0xec0a('0x38')](_0x31ea3d[_0xec0a('0x37')],{'$or':_[_0xec0a('0x26')](_0x31ea3d[_0xec0a('0x30')],function(_0x62b558){var _0x3af7f1={};_0x3af7f1[_0x62b558]={'$like':'%'+_0x40be08[_0xec0a('0x2d')][_0xec0a('0x36')]+'%'};return _0x3af7f1;})});}_0x31ea3d=_[_0xec0a('0x38')]({},_0x31ea3d,_0x40be08[_0xec0a('0x3f')]);return _0x42c501[_0xec0a('0x4a')](_0x31ea3d);}})[_0xec0a('0x1f')](function(_0x2cb9c8){if(_0x2cb9c8){_0xe729bf=_0x2cb9c8['length'];if(!_0x40be08[_0xec0a('0x2d')][_0xec0a('0x32')](_0xec0a('0x33'))){_0x31ea3d['limit']=qs[_0xec0a('0x1a')](_0x40be08[_0xec0a('0x2d')][_0xec0a('0x1a')]);_0x31ea3d[_0xec0a('0x19')]=qs['offset'](_0x40be08['query'][_0xec0a('0x19')]);}return _0x42c501[_0xec0a('0x4a')](_0x31ea3d);}})[_0xec0a('0x1f')](function(_0x1ef3c7){if(_0x1ef3c7){return _0x1ef3c7?{'count':_0xe729bf,'rows':_0x1ef3c7}:null;}})[_0xec0a('0x1f')](respondWithResult(_0x419dd6,null))[_0xec0a('0x3a')](handleError(_0x419dd6,null));};exports[_0xec0a('0x4b')]=function(_0x1e2a2d,_0x1943fd,_0xbfd383){return db[_0xec0a('0x4c')][_0xec0a('0x42')]({'where':{'id':_0x1e2a2d['params']['id']}})['then'](handleEntityNotFound(_0x1943fd,null))['then'](function(_0x24d841){if(_0x24d841){return _0x24d841[_0xec0a('0x4b')](_0x1e2a2d['body'][_0xec0a('0x46')],_[_0xec0a('0x45')](_0x1e2a2d[_0xec0a('0x41')],[_0xec0a('0x46'),'id'])||{});}})[_0xec0a('0x1f')](respondWithResult(_0x1943fd,null))['catch'](handleError(_0x1943fd,null));};exports[_0xec0a('0x4d')]=function(_0x25a0d9,_0x21862f,_0x5b715e){var _0x3700bb={};var _0x35be5f={};var _0x1ceff4;var _0x379bc3;return db['Automation'][_0xec0a('0x47')]({'where':{'id':_0x25a0d9[_0xec0a('0x3c')]['id']}})['then'](handleEntityNotFound(_0x21862f,null))[_0xec0a('0x1f')](function(_0x1d90a0){if(_0x1d90a0){_0x1ceff4=_0x1d90a0;_0x35be5f['model']=_[_0xec0a('0x2e')](db[_0xec0a('0x4c')][_0xec0a('0x28')]);_0x35be5f[_0xec0a('0x2d')]=_['keys'](_0x25a0d9['query']);_0x35be5f['filters']=_[_0xec0a('0x2f')](_0x35be5f['model'],_0x35be5f[_0xec0a('0x2d')]);_0x3700bb['attributes']=_[_0xec0a('0x2f')](_0x35be5f['model'],qs[_0xec0a('0x31')](_0x25a0d9[_0xec0a('0x2d')][_0xec0a('0x31')]));_0x3700bb['attributes']=_0x3700bb[_0xec0a('0x30')][_0xec0a('0x3d')]?_0x3700bb['attributes']:_0x35be5f[_0xec0a('0x2c')];_0x3700bb[_0xec0a('0x48')]=qs[_0xec0a('0x34')](_0x25a0d9[_0xec0a('0x2d')][_0xec0a('0x34')]);_0x3700bb[_0xec0a('0x37')]=qs['filters'](_[_0xec0a('0x49')](_0x25a0d9[_0xec0a('0x2d')],_0x35be5f['filters']));if(_0x25a0d9[_0xec0a('0x2d')][_0xec0a('0x36')]){_0x3700bb[_0xec0a('0x37')]=_[_0xec0a('0x38')](_0x3700bb['where'],{'$or':_[_0xec0a('0x26')](_0x3700bb[_0xec0a('0x30')],function(_0x1b1669){var _0x387fe1={};_0x387fe1[_0x1b1669]={'$like':'%'+_0x25a0d9[_0xec0a('0x2d')]['filter']+'%'};return _0x387fe1;})});}_0x3700bb=_['merge']({},_0x3700bb,_0x25a0d9['options']);return _0x1ceff4[_0xec0a('0x4d')](_0x3700bb);}})[_0xec0a('0x1f')](function(_0x653591){if(_0x653591){_0x379bc3=_0x653591[_0xec0a('0x3d')];if(!_0x25a0d9[_0xec0a('0x2d')][_0xec0a('0x32')](_0xec0a('0x33'))){_0x3700bb[_0xec0a('0x1a')]=qs[_0xec0a('0x1a')](_0x25a0d9[_0xec0a('0x2d')][_0xec0a('0x1a')]);_0x3700bb[_0xec0a('0x19')]=qs[_0xec0a('0x19')](_0x25a0d9[_0xec0a('0x2d')]['offset']);}return _0x1ceff4['getActions'](_0x3700bb);}})['then'](function(_0x44305d){if(_0x44305d){return _0x44305d?{'count':_0x379bc3,'rows':_0x44305d}:null;}})['then'](respondWithResult(_0x21862f,null))[_0xec0a('0x3a')](handleError(_0x21862f,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 9d31b35..5f5a27b 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 _0xe0d9=['../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','api','moment','request-promise'];(function(_0x40b493,_0x4050de){var _0x548365=function(_0x8ceba7){while(--_0x8ceba7){_0x40b493['push'](_0x40b493['shift']());}};_0x548365(++_0x4050de);}(_0xe0d9,0x16e));var _0x9e0d=function(_0x21f9c2,_0x2b3d2a){_0x21f9c2=_0x21f9c2-0x0;var _0x3da17f=_0xe0d9[_0x21f9c2];return _0x3da17f;};'use strict';var _=require(_0x9e0d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9e0d('0x1'));var moment=require(_0x9e0d('0x2'));var BPromise=require('bluebird');var rp=require(_0x9e0d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9e0d('0x4'));var attributes=require(_0x9e0d('0x5'));module[_0x9e0d('0x6')]=function(_0x4b04c8,_0x1efd3d){return _0x4b04c8[_0x9e0d('0x7')](_0x9e0d('0x8'),attributes,{'tableName':_0x9e0d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x69f4=['bluebird','request-promise','path','rimraf','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment'];(function(_0xca1f03,_0xa6241c){var _0x57bcf5=function(_0x2c8494){while(--_0x2c8494){_0xca1f03['push'](_0xca1f03['shift']());}};_0x57bcf5(++_0xa6241c);}(_0x69f4,0x87));var _0x469f=function(_0x474de6,_0x300052){_0x474de6=_0x474de6-0x0;var _0x83599a=_0x69f4[_0x474de6];return _0x83599a;};'use strict';var _=require(_0x469f('0x0'));var util=require(_0x469f('0x1'));var logger=require(_0x469f('0x2'))(_0x469f('0x3'));var moment=require(_0x469f('0x4'));var BPromise=require(_0x469f('0x5'));var rp=require(_0x469f('0x6'));var fs=require('fs');var path=require(_0x469f('0x7'));var rimraf=require(_0x469f('0x8'));var config=require('../../config/environment');var attributes=require(_0x469f('0x9'));module[_0x469f('0xa')]=function(_0x4d5c3f,_0x306a9c){return _0x4d5c3f[_0x469f('0xb')](_0x469f('0xc'),attributes,{'tableName':_0x469f('0xd'),'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 d343885..659a486 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 _0xc17d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x4c6f44,_0x413a03){var _0x5ee4b9=function(_0x61a78c){while(--_0x61a78c){_0x4c6f44['push'](_0x4c6f44['shift']());}};_0x5ee4b9(++_0x413a03);}(_0xc17d,0x96));var _0xdc17=function(_0x193b08,_0x3284d4){_0x193b08=_0x193b08-0x0;var _0x4bba83=_0xc17d[_0x193b08];return _0x4bba83;};'use strict';var _=require(_0xdc17('0x0'));var util=require(_0xdc17('0x1'));var moment=require(_0xdc17('0x2'));var BPromise=require(_0xdc17('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc17('0x4'));var db=require(_0xdc17('0x5'))['db'];var utils=require(_0xdc17('0x6'));var logger=require(_0xdc17('0x7'))('rpc');var config=require(_0xdc17('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdc17('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52a11b,_0x16ac50,_0x373463){return new BPromise(function(_0x53143d,_0x5ccdc5){return client[_0xdc17('0xa')](_0x52a11b,_0x373463)[_0xdc17('0xb')](function(_0x17c626){logger[_0xdc17('0xc')](_0xdc17('0xd'),_0x16ac50,_0xdc17('0xe'));logger[_0xdc17('0xf')](_0xdc17('0x10'),_0x16ac50,'request\x20sent',JSON[_0xdc17('0x11')](_0x17c626));if(_0x17c626[_0xdc17('0x12')]){if(_0x17c626[_0xdc17('0x12')]['code']===0x1f4){logger[_0xdc17('0x12')]('Automation,\x20%s,\x20%s',_0x16ac50,_0x17c626[_0xdc17('0x12')][_0xdc17('0x13')]);return _0x5ccdc5(_0x17c626['error'][_0xdc17('0x13')]);}logger[_0xdc17('0x12')]('Automation,\x20%s,\x20%s',_0x16ac50,_0x17c626[_0xdc17('0x12')]['message']);return _0x53143d(_0x17c626[_0xdc17('0x12')][_0xdc17('0x13')]);}else{logger['info'](_0xdc17('0xd'),_0x16ac50,_0xdc17('0xe'));_0x53143d(_0x17c626[_0xdc17('0x14')][_0xdc17('0x13')]);}})[_0xdc17('0x15')](function(_0x3adc90){logger['error'](_0xdc17('0xd'),_0x16ac50,_0x3adc90);_0x5ccdc5(_0x3adc90);});});}
\ No newline at end of file
+var _0x38b8=['client','http','request','then','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../config/logger','rpc'];(function(_0x4cfb78,_0x4c1da6){var _0xc1250e=function(_0x217b6c){while(--_0x217b6c){_0x4cfb78['push'](_0x4cfb78['shift']());}};_0xc1250e(++_0x4c1da6);}(_0x38b8,0x7f));var _0x838b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x38b8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x838b('0x0'));var util=require('util');var moment=require(_0x838b('0x1'));var BPromise=require(_0x838b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x838b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x838b('0x4'))(_0x838b('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x838b('0x6')][_0x838b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5c516c,_0x2d3e96,_0x15184b){return new BPromise(function(_0x4b9530,_0x552245){return client[_0x838b('0x8')](_0x5c516c,_0x15184b)[_0x838b('0x9')](function(_0x31ba84){logger['info'](_0x838b('0xa'),_0x2d3e96,'request\x20sent');logger[_0x838b('0xb')](_0x838b('0xc'),_0x2d3e96,_0x838b('0xd'),JSON[_0x838b('0xe')](_0x31ba84));if(_0x31ba84[_0x838b('0xf')]){if(_0x31ba84[_0x838b('0xf')]['code']===0x1f4){logger[_0x838b('0xf')](_0x838b('0xa'),_0x2d3e96,_0x31ba84[_0x838b('0xf')][_0x838b('0x10')]);return _0x552245(_0x31ba84[_0x838b('0xf')][_0x838b('0x10')]);}logger[_0x838b('0xf')](_0x838b('0xa'),_0x2d3e96,_0x31ba84[_0x838b('0xf')]['message']);return _0x4b9530(_0x31ba84[_0x838b('0xf')]['message']);}else{logger['info']('Automation,\x20%s,\x20%s',_0x2d3e96,_0x838b('0xd'));_0x4b9530(_0x31ba84[_0x838b('0x11')][_0x838b('0x10')]);}})[_0x838b('0x12')](function(_0x94e893){logger['error'](_0x838b('0xa'),_0x2d3e96,_0x94e893);_0x552245(_0x94e893);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index cfd7f87..8fe2acc 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 _0x89fe=['../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','/:id/actions','getActions','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x2431d6,_0x25189a){var _0x4d0f9b=function(_0x52cd84){while(--_0x52cd84){_0x2431d6['push'](_0x2431d6['shift']());}};_0x4d0f9b(++_0x25189a);}(_0x89fe,0x83));var _0xe89f=function(_0x7af9db,_0x4f1dd6){_0x7af9db=_0x7af9db-0x0;var _0x5d901e=_0x89fe[_0x7af9db];return _0x5d901e;};'use strict';var multer=require(_0xe89f('0x0'));var util=require(_0xe89f('0x1'));var path=require(_0xe89f('0x2'));var timeout=require(_0xe89f('0x3'));var express=require('express');var router=express[_0xe89f('0x4')]();var fs_extra=require(_0xe89f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe89f('0x6'));var config=require(_0xe89f('0x7'));var controller=require(_0xe89f('0x8'));router[_0xe89f('0x9')]('/',auth[_0xe89f('0xa')](),controller[_0xe89f('0xb')]);router[_0xe89f('0x9')]('/:id',auth[_0xe89f('0xa')](),controller[_0xe89f('0xc')]);router[_0xe89f('0x9')](_0xe89f('0xd'),auth[_0xe89f('0xa')](),controller['getConditions']);router[_0xe89f('0x9')](_0xe89f('0xe'),auth[_0xe89f('0xa')](),controller[_0xe89f('0xf')]);router[_0xe89f('0x10')]('/',auth[_0xe89f('0xa')](),controller[_0xe89f('0x11')]);router[_0xe89f('0x10')](_0xe89f('0xd'),auth[_0xe89f('0xa')](),controller['addConditions']);router['post']('/:id/actions',auth['isAuthenticated'](),controller['addActions']);router[_0xe89f('0x12')](_0xe89f('0x13'),auth['isAuthenticated'](),controller['update']);router[_0xe89f('0x14')](_0xe89f('0x13'),auth[_0xe89f('0xa')](),controller[_0xe89f('0x15')]);module[_0xe89f('0x16')]=router;
\ No newline at end of file
+var _0xd405=['/:id/conditions','addActions','put','update','delete','destroy','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','index','/:id','isAuthenticated','show','getConditions','/:id/actions','getActions','post','create'];(function(_0xaa7de4,_0x517895){var _0x1988da=function(_0x2d5a5b){while(--_0x2d5a5b){_0xaa7de4['push'](_0xaa7de4['shift']());}};_0x1988da(++_0x517895);}(_0xd405,0x1d2));var _0x5d40=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xd405[_0x24237f];return _0x48298e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5d40('0x0'));var router=express[_0x5d40('0x1')]();var fs_extra=require(_0x5d40('0x2'));var auth=require(_0x5d40('0x3'));var interaction=require(_0x5d40('0x4'));var config=require(_0x5d40('0x5'));var controller=require(_0x5d40('0x6'));router[_0x5d40('0x7')]('/',auth['isAuthenticated'](),controller[_0x5d40('0x8')]);router['get'](_0x5d40('0x9'),auth[_0x5d40('0xa')](),controller[_0x5d40('0xb')]);router[_0x5d40('0x7')]('/:id/conditions',auth[_0x5d40('0xa')](),controller[_0x5d40('0xc')]);router[_0x5d40('0x7')](_0x5d40('0xd'),auth[_0x5d40('0xa')](),controller[_0x5d40('0xe')]);router[_0x5d40('0xf')]('/',auth[_0x5d40('0xa')](),controller[_0x5d40('0x10')]);router['post'](_0x5d40('0x11'),auth['isAuthenticated'](),controller['addConditions']);router[_0x5d40('0xf')]('/:id/actions',auth['isAuthenticated'](),controller[_0x5d40('0x12')]);router[_0x5d40('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x5d40('0x14')]);router[_0x5d40('0x15')]('/:id',auth[_0x5d40('0xa')](),controller[_0x5d40('0x16')]);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 51d2fe5..f179781 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 _0x723c=['#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x3bab09,_0x217c29){var _0x164376=function(_0x277730){while(--_0x277730){_0x3bab09['push'](_0x3bab09['shift']());}};_0x164376(++_0x217c29);}(_0x723c,0x1ad));var _0xc723=function(_0x17b83f,_0x6f1d6){_0x17b83f=_0x17b83f-0x0;var _0x184af4=_0x723c[_0x17b83f];return _0x184af4;};'use strict';var Sequelize=require('sequelize');module[_0xc723('0x0')]={'name':{'type':Sequelize[_0xc723('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc723('0x2')]('ivr'),'allowNull':![],'defaultValue':_0xc723('0x3')},'description':{'type':Sequelize[_0xc723('0x1')]},'active':{'type':Sequelize[_0xc723('0x4')],'defaultValue':0x0,'comment':_0xc723('0x5')},'limitCalls':{'type':Sequelize[_0xc723('0x6')](0x4)[_0xc723('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xc723('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc723('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xc723('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc723('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc723('0x6')](0x3)[_0xc723('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc723('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc723('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xc723('0x6')](0x3)[_0xc723('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc723('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc723('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc723('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc723('0x6')](0x3)[_0xc723('0x7')],'defaultValue':0x3,'comment':_0xc723('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc723('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc723('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc723('0x6')](0x3)[_0xc723('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc723('0xf')},'dialTimezone':{'type':Sequelize[_0xc723('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xc723('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0xc723('0x11'),_0xc723('0x12')),'defaultValue':_0xc723('0x13')},'dialAMDActive':{'type':Sequelize[_0xc723('0x4')],'defaultValue':0x0,'comment':_0xc723('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xc723('0x6')](0x9)[_0xc723('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc723('0x15')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xc723('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc723('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc723('0x6')](0x9)[_0xc723('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xc723('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc723('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xc723('0x6')](0x9)[_0xc723('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc723('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc723('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc723('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc723('0x6')](0x9)[_0xc723('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc723('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc723('0x6')](0x5)[_0xc723('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc723('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc723('0x6')](0x9)[_0xc723('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc723('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0xc723('0x2')]('DESC',_0xc723('0x1d')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xc723('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc723('0x6')](0x3)[_0xc723('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xc723('0x6')](0x3)[_0xc723('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc723('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc723('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc723('0x6')](0x5)[_0xc723('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc723('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0xc723('0x6')](0x3)[_0xc723('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc723('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc723('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc723('0x6')](0x3)[_0xc723('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc723('0x6')](0x5)[_0xc723('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc723('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xc723('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc723('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0xc723('0x6')](0x5)[_0xc723('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xc723('0x6')](0x3)[_0xc723('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc723('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc723('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0xa936=['name','ENUM','ivr','BOOLEAN','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','STRING'];(function(_0x48ac7f,_0xb8ec44){var _0x50a9b6=function(_0x46d1fa){while(--_0x46d1fa){_0x48ac7f['push'](_0x48ac7f['shift']());}};_0x50a9b6(++_0xb8ec44);}(_0xa936,0x107));var _0x6a93=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xa936[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6a93('0x0')],'unique':_0x6a93('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x6a93('0x2')]('ivr'),'allowNull':![],'defaultValue':_0x6a93('0x3')},'description':{'type':Sequelize[_0x6a93('0x0')]},'active':{'type':Sequelize[_0x6a93('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x6a93('0x5')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x6a93('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0x6a93('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x6a93('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0x6a93('0x5')](0x3)[_0x6a93('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6a93('0x8')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6a93('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6a93('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x6a93('0x5')](0x5)[_0x6a93('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6a93('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6a93('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x6a93('0x5')](0x5)[_0x6a93('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6a93('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6a93('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x6a93('0x5')](0x5)[_0x6a93('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6a93('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6a93('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x6a93('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x6a93('0x0')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x6a93('0x2')](_0x6a93('0xe'),_0x6a93('0xf'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x6a93('0x4')],'defaultValue':0x0,'comment':_0x6a93('0x10')},'dialAMDInitialSilence':{'type':Sequelize[_0x6a93('0x5')](0x9)[_0x6a93('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x6a93('0x11')},'dialAMDGreeting':{'type':Sequelize[_0x6a93('0x5')](0x9)[_0x6a93('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x6a93('0x5')](0x9)[_0x6a93('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x6a93('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x6a93('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6a93('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0x6a93('0x5')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x6a93('0x5')](0x9)[_0x6a93('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x6a93('0x14')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x6a93('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x6a93('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x6a93('0x5')](0x5)[_0x6a93('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x6a93('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x6a93('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x6a93('0x17'),_0x6a93('0x18')),'defaultValue':_0x6a93('0x17')},'dialPrefix':{'type':Sequelize[_0x6a93('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x6a93('0x5')](0x3)[_0x6a93('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x6a93('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x6a93('0x5')](0x3)[_0x6a93('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6a93('0x19')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x6a93('0x5')](0x5)[_0x6a93('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6a93('0x1a')},'dialDropMaxRetry':{'type':Sequelize[_0x6a93('0x5')](0x3)[_0x6a93('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6a93('0x1b')},'dialDropRetryFrequency':{'type':Sequelize[_0x6a93('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6a93('0x1c')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6a93('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6a93('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x6a93('0x5')](0x5)[_0x6a93('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6a93('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0x6a93('0x5')](0x3)[_0x6a93('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6a93('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0x6a93('0x5')](0x5)[_0x6a93('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x6a93('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6a93('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x6a93('0x5')](0x5)[_0x6a93('0x7')],'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 887bcd2..43875ce 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 _0xf53d=['end','sendStatus','stack','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','name','query','keys','filters','attributes','intersection','fields','length','order','where','filter','merge','VIRTUAL','options','findAll','rows','catch','params','includeAll','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','autoAssociation','error','getHoppers','findOne','nolimit','sort','pick','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','hasOwnProperty','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','NOW()','COALESCE(phone,\x27\x27)','deletedAt\x20IS\x20NULL','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','IvrCampaigns','UserProfileResource','status'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf53d,0x199));var _0xdf53=function(_0x508083,_0x1e53c6){_0x508083=_0x508083-0x0;var _0x5d5912=_0xf53d[_0x508083];return _0x5d5912;};'use strict';var emlformat=require(_0xdf53('0x0'));var rimraf=require(_0xdf53('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdf53('0x2'));var rp=require(_0xdf53('0x3'));var moment=require(_0xdf53('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdf53('0x5'));var util=require('util');var path=require(_0xdf53('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdf53('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdf53('0x8'));var squel=require(_0xdf53('0x9'));var crypto=require(_0xdf53('0xa'));var jsforce=require(_0xdf53('0xb'));var deskjs=require(_0xdf53('0xc'));var toCsv=require(_0xdf53('0xd'));var querystring=require(_0xdf53('0xe'));var Papa=require(_0xdf53('0xf'));var Redis=require('ioredis');var authService=require(_0xdf53('0x10'));var qs=require(_0xdf53('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf53('0x12'));var logger=require('../../config/logger')(_0xdf53('0x13'));var utils=require(_0xdf53('0x14'));var config=require(_0xdf53('0x15'));var licenseUtil=require(_0xdf53('0x16'));var db=require(_0xdf53('0x17'))['db'];function respondWithStatusCode(_0x336304,_0x4c1eee){_0x4c1eee=_0x4c1eee||0xcc;return function(_0x4082e3){if(_0x4082e3){return _0x336304['sendStatus'](_0x4c1eee);}return _0x336304['status'](_0x4c1eee)['end']();};}function respondWithResult(_0x433315,_0x25f7c3){_0x25f7c3=_0x25f7c3||0xc8;return function(_0x1cca6c){if(_0x1cca6c){return _0x433315['status'](_0x25f7c3)[_0xdf53('0x18')](_0x1cca6c);}};}function respondWithFilteredResult(_0x3f24f3,_0x2476ee){return function(_0x174b19){if(_0x174b19){var _0x22deb2=typeof _0x2476ee[_0xdf53('0x19')]===_0xdf53('0x1a')&&typeof _0x2476ee[_0xdf53('0x1b')]===_0xdf53('0x1a');var _0x5965a3=_0x174b19[_0xdf53('0x1c')];var _0x92b79f=_0x22deb2?0x0:_0x2476ee['offset'];var _0x340176=_0x22deb2?_0x174b19['count']:_0x2476ee[_0xdf53('0x19')]+_0x2476ee[_0xdf53('0x1b')];var _0x1040ac;if(_0x340176>=_0x5965a3){_0x340176=_0x5965a3;_0x1040ac=0xc8;}else{_0x1040ac=0xce;}_0x3f24f3['status'](_0x1040ac);return _0x3f24f3[_0xdf53('0x1d')](_0xdf53('0x1e'),_0x92b79f+'-'+_0x340176+'/'+_0x5965a3)[_0xdf53('0x18')](_0x174b19);}return null;};}function patchUpdates(_0x4edc1f){return function(_0x4a381b){try{jsonpatch['apply'](_0x4a381b,_0x4edc1f,!![]);}catch(_0x528861){return BPromise[_0xdf53('0x1f')](_0x528861);}return _0x4a381b['save']();};}function saveUpdates(_0x1e003d,_0x21cc09){return function(_0x213703){if(_0x213703){return _0x213703[_0xdf53('0x20')](_0x1e003d)[_0xdf53('0x21')](function(_0xd5f7f8){return _0xd5f7f8;});}return null;};}function removeEntity(_0x433622,_0x5b0303){return function(_0x3fa668){if(_0x3fa668){return _0x3fa668[_0xdf53('0x22')]()[_0xdf53('0x21')](function(){var _0x260cb3=_0x3fa668['get']({'plain':!![]});var _0x35a387=_0xdf53('0x23');return db[_0xdf53('0x24')][_0xdf53('0x22')]({'where':{'type':_0x35a387,'resourceId':_0x260cb3['id']}})[_0xdf53('0x21')](function(){return _0x3fa668;});})[_0xdf53('0x21')](function(){_0x433622[_0xdf53('0x25')](0xcc)[_0xdf53('0x26')]();});}};}function handleEntityNotFound(_0x159942,_0x2e023c){return function(_0x19928f){if(!_0x19928f){_0x159942[_0xdf53('0x27')](0x194);}return _0x19928f;};}function handleError(_0x413c3d,_0x344ab4){_0x344ab4=_0x344ab4||0x1f4;return function(_0x1ed29a){logger['error'](_0x1ed29a[_0xdf53('0x28')]);if(_0x1ed29a['name']){delete _0x1ed29a['name'];}_0x413c3d[_0xdf53('0x25')](_0x344ab4)[_0xdf53('0x29')](_0x1ed29a);};}exports[_0xdf53('0x2a')]=function(_0x442d88,_0x2754dd){var _0x3e8363={},_0x2ad1d4={},_0x18a805={'count':0x0,'rows':[]};var _0x52ef02=_[_0xdf53('0x2b')](db[_0xdf53('0x2c')][_0xdf53('0x2d')],function(_0x1268a7){return{'name':_0x1268a7[_0xdf53('0x2e')],'type':_0x1268a7[_0xdf53('0x2f')][_0xdf53('0x30')]};});_0x2ad1d4[_0xdf53('0x31')]=_[_0xdf53('0x2b')](_0x52ef02,_0xdf53('0x32'));_0x2ad1d4[_0xdf53('0x33')]=_[_0xdf53('0x34')](_0x442d88[_0xdf53('0x33')]);_0x2ad1d4[_0xdf53('0x35')]=_['intersection'](_0x2ad1d4[_0xdf53('0x31')],_0x2ad1d4['query']);_0x3e8363[_0xdf53('0x36')]=_[_0xdf53('0x37')](_0x2ad1d4['model'],qs[_0xdf53('0x38')](_0x442d88['query'][_0xdf53('0x38')]));_0x3e8363['attributes']=_0x3e8363[_0xdf53('0x36')][_0xdf53('0x39')]?_0x3e8363[_0xdf53('0x36')]:_0x2ad1d4['model'];if(!_0x442d88[_0xdf53('0x33')]['hasOwnProperty']('nolimit')){_0x3e8363[_0xdf53('0x1b')]=qs['limit'](_0x442d88['query'][_0xdf53('0x1b')]);_0x3e8363[_0xdf53('0x19')]=qs[_0xdf53('0x19')](_0x442d88[_0xdf53('0x33')]['offset']);}_0x3e8363[_0xdf53('0x3a')]=qs['sort'](_0x442d88[_0xdf53('0x33')]['sort']);_0x3e8363[_0xdf53('0x3b')]=qs[_0xdf53('0x35')](_['pick'](_0x442d88[_0xdf53('0x33')],_0x2ad1d4[_0xdf53('0x35')]),_0x52ef02);if(_0x442d88[_0xdf53('0x33')][_0xdf53('0x3c')]){_0x3e8363[_0xdf53('0x3b')]=_[_0xdf53('0x3d')](_0x3e8363[_0xdf53('0x3b')],{'$or':_[_0xdf53('0x2b')](_0x52ef02,function(_0x2f81f5){if(_0x2f81f5[_0xdf53('0x2f')]!==_0xdf53('0x3e')){var _0x33bd35={};_0x33bd35[_0x2f81f5['name']]={'$like':'%'+_0x442d88[_0xdf53('0x33')][_0xdf53('0x3c')]+'%'};return _0x33bd35;}})});}_0x3e8363=_[_0xdf53('0x3d')]({},_0x3e8363,_0x442d88[_0xdf53('0x3f')]);var _0x28ec41={'where':_0x3e8363[_0xdf53('0x3b')]};return db[_0xdf53('0x2c')][_0xdf53('0x1c')](_0x28ec41)['then'](function(_0x491704){_0x18a805[_0xdf53('0x1c')]=_0x491704;if(_0x442d88[_0xdf53('0x33')]['includeAll']){_0x3e8363['include']=[{'all':!![]}];}return db[_0xdf53('0x2c')][_0xdf53('0x40')](_0x3e8363);})['then'](function(_0x296362){_0x18a805[_0xdf53('0x41')]=_0x296362;return _0x18a805;})[_0xdf53('0x21')](respondWithFilteredResult(_0x2754dd,_0x3e8363))[_0xdf53('0x42')](handleError(_0x2754dd,null));};exports['show']=function(_0x2977a9,_0x289434){var _0x1bf714={'raw':![],'where':{'id':_0x2977a9[_0xdf53('0x43')]['id']}},_0x16e3be={};_0x16e3be[_0xdf53('0x31')]=_['keys'](db['Campaign'][_0xdf53('0x2d')]);_0x16e3be['query']=_['keys'](_0x2977a9[_0xdf53('0x33')]);_0x16e3be[_0xdf53('0x35')]=_['intersection'](_0x16e3be[_0xdf53('0x31')],_0x16e3be[_0xdf53('0x33')]);_0x1bf714[_0xdf53('0x36')]=_[_0xdf53('0x37')](_0x16e3be['model'],qs[_0xdf53('0x38')](_0x2977a9[_0xdf53('0x33')][_0xdf53('0x38')]));_0x1bf714['attributes']=_0x1bf714[_0xdf53('0x36')][_0xdf53('0x39')]?_0x1bf714['attributes']:_0x16e3be['model'];if(_0x2977a9['query'][_0xdf53('0x44')]){_0x1bf714[_0xdf53('0x45')]=[{'all':!![]}];}_0x1bf714=_[_0xdf53('0x3d')]({},_0x1bf714,_0x2977a9[_0xdf53('0x3f')]);return db[_0xdf53('0x2c')][_0xdf53('0x46')](_0x1bf714)[_0xdf53('0x21')](handleEntityNotFound(_0x289434,null))['then'](respondWithResult(_0x289434,null))['catch'](handleError(_0x289434,null));};exports[_0xdf53('0x47')]=function(_0x37f56c,_0x11e94c){return db[_0xdf53('0x2c')][_0xdf53('0x47')](_0x37f56c[_0xdf53('0x48')],{})[_0xdf53('0x21')](function(_0xe28459){var _0x233457=_0x37f56c[_0xdf53('0x49')][_0xdf53('0x4a')]({'plain':!![]});if(!_0x233457)throw new Error(_0xdf53('0x4b'));if(_0x233457[_0xdf53('0x4c')]===_0xdf53('0x49')){var _0x3808fd=_0xe28459[_0xdf53('0x4a')]({'plain':!![]});var _0x3371b5=_0xdf53('0x23');return db[_0xdf53('0x4d')]['find']({'where':{'name':_0x3371b5,'userProfileId':_0x233457[_0xdf53('0x4e')]},'raw':!![]})[_0xdf53('0x21')](function(_0x239494){if(_0x239494&&_0x239494['autoAssociation']===0x0){return db[_0xdf53('0x24')][_0xdf53('0x47')]({'name':_0x3808fd['name'],'resourceId':_0x3808fd['id'],'type':_0x239494[_0xdf53('0x32')],'sectionId':_0x239494['id']},{})['then'](function(){return _0xe28459;});}else{return _0xe28459;}})[_0xdf53('0x42')](function(_0x33853b){logger['error'](_0xdf53('0x4f'),_0x33853b);throw _0x33853b;});}return _0xe28459;})[_0xdf53('0x21')](respondWithResult(_0x11e94c,0xc9))[_0xdf53('0x42')](handleError(_0x11e94c,null));};exports[_0xdf53('0x50')]=function(_0x1cbef5,_0x81150d){var _0x2274b5={'where':{'id':_0x1cbef5['params']['id']}},_0x2fdef4={};_0x2fdef4['model']=_[_0xdf53('0x34')](db[_0xdf53('0x2c')][_0xdf53('0x2d')]);_0x2274b5[_0xdf53('0x36')]=_[_0xdf53('0x37')](_0x2fdef4['model'],qs['fields'](_0x1cbef5['query'][_0xdf53('0x38')]));_0x2274b5['attributes']=_0x2274b5[_0xdf53('0x36')][_0xdf53('0x39')]?_0x2274b5[_0xdf53('0x36')]:_0x2fdef4[_0xdf53('0x31')];if(_0x1cbef5[_0xdf53('0x33')][_0xdf53('0x44')]){_0x2274b5[_0xdf53('0x45')]=[{'all':!![]}];}_0x2274b5=_[_0xdf53('0x3d')]({},_0x2274b5,_0x1cbef5[_0xdf53('0x3f')]);return db[_0xdf53('0x2c')][_0xdf53('0x46')](_0x2274b5)[_0xdf53('0x21')](handleEntityNotFound(_0x81150d,null))[_0xdf53('0x21')](function(_0x359e56){if(_0x359e56){var _0x5568b1=_0x359e56[_0xdf53('0x4a')]({'plain':!![]});_0x5568b1=qs[_0xdf53('0x51')](_0x5568b1,['id','createdAt',_0xdf53('0x52')]);_0x1cbef5[_0xdf53('0x48')]=_[_0xdf53('0x51')](_0x1cbef5['body'],['id',_0xdf53('0x53'),_0xdf53('0x52')]);return db[_0xdf53('0x2c')][_0xdf53('0x47')](_[_0xdf53('0x3d')](_0x5568b1,_0x1cbef5[_0xdf53('0x48')]),{'include':_0x1cbef5[_0xdf53('0x33')][_0xdf53('0x44')]?[{'all':!![]}]:undefined})['then'](function(_0x46e5ca){var _0x180f5c=_0x1cbef5[_0xdf53('0x49')][_0xdf53('0x4a')]({'plain':!![]});if(!_0x180f5c)throw new Error(_0xdf53('0x4b'));if(_0x180f5c[_0xdf53('0x4c')]==='user'){var _0x47fe92=_0x46e5ca[_0xdf53('0x4a')]({'plain':!![]});var _0x354819='IvrCampaigns';return db[_0xdf53('0x4d')][_0xdf53('0x46')]({'where':{'name':_0x354819,'userProfileId':_0x180f5c[_0xdf53('0x4e')]},'raw':!![]})['then'](function(_0x4dc662){if(_0x4dc662&&_0x4dc662[_0xdf53('0x54')]===0x0){return db[_0xdf53('0x24')][_0xdf53('0x47')]({'name':_0x47fe92['name'],'resourceId':_0x47fe92['id'],'type':_0x4dc662[_0xdf53('0x32')],'sectionId':_0x4dc662['id']},{})['then'](function(){return _0x46e5ca;});}else{return _0x46e5ca;}})[_0xdf53('0x42')](function(_0xfcc470){logger[_0xdf53('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xfcc470);throw _0xfcc470;});}return _0x46e5ca;});}})['then'](respondWithResult(_0x81150d,0xc9))[_0xdf53('0x42')](handleError(_0x81150d,null));};exports['update']=function(_0x25ff8b,_0x4a2039){if(_0x25ff8b['body']['id']){delete _0x25ff8b['body']['id'];}return db[_0xdf53('0x2c')][_0xdf53('0x46')]({'where':{'id':_0x25ff8b[_0xdf53('0x43')]['id']}})[_0xdf53('0x21')](handleEntityNotFound(_0x4a2039,null))['then'](saveUpdates(_0x25ff8b[_0xdf53('0x48')],null))[_0xdf53('0x21')](respondWithResult(_0x4a2039,null))[_0xdf53('0x42')](handleError(_0x4a2039,null));};exports[_0xdf53('0x22')]=function(_0x1153cf,_0x43011c){return db[_0xdf53('0x2c')][_0xdf53('0x46')]({'where':{'id':_0x1153cf['params']['id']}})['then'](handleEntityNotFound(_0x43011c,null))[_0xdf53('0x21')](removeEntity(_0x43011c,null))['catch'](handleError(_0x43011c,null));};exports[_0xdf53('0x56')]=function(_0x23be71,_0x33a653,_0x352c5b){var _0x1b8323={'raw':!![],'where':{}};var _0x1dbf59={};var _0x1476cf={'count':0x0,'rows':[]};return db[_0xdf53('0x2c')][_0xdf53('0x57')]({'where':{'id':_0x23be71[_0xdf53('0x43')]['id']}})[_0xdf53('0x21')](handleEntityNotFound(_0x33a653,null))[_0xdf53('0x21')](function(_0x5c8ae9){if(_0x5c8ae9){_0x1dbf59[_0xdf53('0x31')]=_[_0xdf53('0x34')](db['CmHopper'][_0xdf53('0x2d')]);_0x1dbf59[_0xdf53('0x33')]=_[_0xdf53('0x34')](_0x23be71['query']);_0x1dbf59[_0xdf53('0x35')]=_[_0xdf53('0x37')](_0x1dbf59[_0xdf53('0x31')],_0x1dbf59['query']);_0x1b8323[_0xdf53('0x36')]=_['intersection'](_0x1dbf59['model'],qs[_0xdf53('0x38')](_0x23be71[_0xdf53('0x33')]['fields']));_0x1b8323['attributes']=_0x1b8323[_0xdf53('0x36')][_0xdf53('0x39')]?_0x1b8323[_0xdf53('0x36')]:_0x1dbf59[_0xdf53('0x31')];if(!_0x23be71[_0xdf53('0x33')]['hasOwnProperty'](_0xdf53('0x58'))){_0x1b8323[_0xdf53('0x1b')]=qs[_0xdf53('0x1b')](_0x23be71[_0xdf53('0x33')][_0xdf53('0x1b')]);_0x1b8323['offset']=qs[_0xdf53('0x19')](_0x23be71[_0xdf53('0x33')][_0xdf53('0x19')]);}_0x1b8323[_0xdf53('0x3a')]=qs[_0xdf53('0x59')](_0x23be71['query']['sort']);_0x1b8323['where']=qs[_0xdf53('0x35')](_[_0xdf53('0x5a')](_0x23be71[_0xdf53('0x33')],_0x1dbf59[_0xdf53('0x35')]));_0x1b8323['where'][_0xdf53('0x5b')]=_0x5c8ae9['id'];if(_0x23be71[_0xdf53('0x33')][_0xdf53('0x3c')]){_0x1b8323[_0xdf53('0x3b')]=_[_0xdf53('0x3d')](_0x1b8323[_0xdf53('0x3b')],{'$or':_[_0xdf53('0x2b')](_0x1b8323[_0xdf53('0x36')],function(_0x51a6ea){var _0xf3916f={};_0xf3916f[_0x51a6ea]={'$like':'%'+_0x23be71[_0xdf53('0x33')][_0xdf53('0x3c')]+'%'};return _0xf3916f;})});}_0x1b8323=_[_0xdf53('0x3d')]({},_0x1b8323,_0x23be71['options']);return db[_0xdf53('0x5c')][_0xdf53('0x1c')]({'where':_0x1b8323['where']})[_0xdf53('0x21')](function(_0x49c57d){_0x1476cf[_0xdf53('0x1c')]=_0x49c57d;if(_0x23be71[_0xdf53('0x33')][_0xdf53('0x44')]){_0x1b8323[_0xdf53('0x45')]=[{'all':!![]}];}return db[_0xdf53('0x5c')][_0xdf53('0x40')](_0x1b8323);})[_0xdf53('0x21')](function(_0x5ddefb){_0x1476cf[_0xdf53('0x41')]=_0x5ddefb;return _0x1476cf;});}})[_0xdf53('0x21')](respondWithFilteredResult(_0x33a653,_0x1b8323))[_0xdf53('0x42')](handleError(_0x33a653,null));};exports[_0xdf53('0x5d')]=function(_0x289733,_0x5578b6,_0x2940ce){var _0x1d7529={'raw':!![],'where':{}};var _0x5d0167={};var _0x5e5caa={'count':0x0,'rows':[]};return db[_0xdf53('0x2c')][_0xdf53('0x57')]({'where':{'id':_0x289733['params']['id']}})[_0xdf53('0x21')](handleEntityNotFound(_0x5578b6,null))[_0xdf53('0x21')](function(_0x635ba8){if(_0x635ba8){_0x5d0167[_0xdf53('0x31')]=_['keys'](db['CmHopperHistory'][_0xdf53('0x2d')]);_0x5d0167[_0xdf53('0x33')]=_['keys'](_0x289733[_0xdf53('0x33')]);_0x5d0167[_0xdf53('0x35')]=_[_0xdf53('0x37')](_0x5d0167[_0xdf53('0x31')],_0x5d0167[_0xdf53('0x33')]);_0x1d7529['attributes']=_[_0xdf53('0x37')](_0x5d0167[_0xdf53('0x31')],qs[_0xdf53('0x38')](_0x289733[_0xdf53('0x33')][_0xdf53('0x38')]));_0x1d7529[_0xdf53('0x36')]=_0x1d7529[_0xdf53('0x36')][_0xdf53('0x39')]?_0x1d7529[_0xdf53('0x36')]:_0x5d0167[_0xdf53('0x31')];if(!_0x289733['query']['hasOwnProperty'](_0xdf53('0x58'))){_0x1d7529[_0xdf53('0x1b')]=qs[_0xdf53('0x1b')](_0x289733[_0xdf53('0x33')]['limit']);_0x1d7529[_0xdf53('0x19')]=qs[_0xdf53('0x19')](_0x289733[_0xdf53('0x33')][_0xdf53('0x19')]);}_0x1d7529[_0xdf53('0x3a')]=qs[_0xdf53('0x59')](_0x289733[_0xdf53('0x33')][_0xdf53('0x59')]);_0x1d7529['where']=qs[_0xdf53('0x35')](_[_0xdf53('0x5a')](_0x289733[_0xdf53('0x33')],_0x5d0167[_0xdf53('0x35')]));_0x1d7529['where'][_0xdf53('0x5b')]=_0x635ba8['id'];if(_0x289733[_0xdf53('0x33')][_0xdf53('0x3c')]){_0x1d7529[_0xdf53('0x3b')]=_[_0xdf53('0x3d')](_0x1d7529[_0xdf53('0x3b')],{'$or':_[_0xdf53('0x2b')](_0x1d7529[_0xdf53('0x36')],function(_0x577d47){var _0x37d776={};_0x37d776[_0x577d47]={'$like':'%'+_0x289733['query'][_0xdf53('0x3c')]+'%'};return _0x37d776;})});}_0x1d7529=_[_0xdf53('0x3d')]({},_0x1d7529,_0x289733[_0xdf53('0x3f')]);return db[_0xdf53('0x5e')]['count']({'where':_0x1d7529[_0xdf53('0x3b')]})[_0xdf53('0x21')](function(_0x4a4a8b){_0x5e5caa[_0xdf53('0x1c')]=_0x4a4a8b;if(_0x289733[_0xdf53('0x33')]['includeAll']){_0x1d7529[_0xdf53('0x45')]=[{'all':!![]}];}return db[_0xdf53('0x5e')][_0xdf53('0x40')](_0x1d7529);})[_0xdf53('0x21')](function(_0x3a8bd8){_0x5e5caa[_0xdf53('0x41')]=_0x3a8bd8;return _0x5e5caa;});}})[_0xdf53('0x21')](respondWithFilteredResult(_0x5578b6,_0x1d7529))[_0xdf53('0x42')](handleError(_0x5578b6,null));};exports[_0xdf53('0x5f')]=function(_0x3b004b,_0x1ffff0,_0x2149a5){var _0x5e1448={'raw':!![],'where':{}};var _0x391863={};var _0x1c8d09={'count':0x0,'rows':[]};return db[_0xdf53('0x2c')][_0xdf53('0x57')]({'where':{'id':_0x3b004b[_0xdf53('0x43')]['id']}})[_0xdf53('0x21')](handleEntityNotFound(_0x1ffff0,null))['then'](function(_0x4ae492){if(_0x4ae492){_0x391863[_0xdf53('0x31')]=_['keys'](db[_0xdf53('0x60')][_0xdf53('0x2d')]);_0x391863[_0xdf53('0x33')]=_['keys'](_0x3b004b[_0xdf53('0x33')]);_0x391863[_0xdf53('0x35')]=_[_0xdf53('0x37')](_0x391863[_0xdf53('0x31')],_0x391863[_0xdf53('0x33')]);_0x5e1448[_0xdf53('0x36')]=_[_0xdf53('0x37')](_0x391863[_0xdf53('0x31')],qs[_0xdf53('0x38')](_0x3b004b[_0xdf53('0x33')]['fields']));_0x5e1448[_0xdf53('0x36')]=_0x5e1448['attributes'][_0xdf53('0x39')]?_0x5e1448[_0xdf53('0x36')]:_0x391863['model'];if(!_0x3b004b['query'][_0xdf53('0x61')](_0xdf53('0x58'))){_0x5e1448[_0xdf53('0x1b')]=qs['limit'](_0x3b004b[_0xdf53('0x33')][_0xdf53('0x1b')]);_0x5e1448[_0xdf53('0x19')]=qs['offset'](_0x3b004b[_0xdf53('0x33')][_0xdf53('0x19')]);}_0x5e1448[_0xdf53('0x3a')]=qs[_0xdf53('0x59')](_0x3b004b[_0xdf53('0x33')][_0xdf53('0x59')]);_0x5e1448[_0xdf53('0x3b')]=qs[_0xdf53('0x35')](_[_0xdf53('0x5a')](_0x3b004b[_0xdf53('0x33')],_0x391863[_0xdf53('0x35')]));_0x5e1448[_0xdf53('0x3b')][_0xdf53('0x5b')]=_0x4ae492['id'];if(_0x3b004b[_0xdf53('0x33')][_0xdf53('0x3c')]){_0x5e1448[_0xdf53('0x3b')]=_[_0xdf53('0x3d')](_0x5e1448[_0xdf53('0x3b')],{'$or':_[_0xdf53('0x2b')](_0x5e1448[_0xdf53('0x36')],function(_0x174829){var _0x244527={};_0x244527[_0x174829]={'$like':'%'+_0x3b004b[_0xdf53('0x33')][_0xdf53('0x3c')]+'%'};return _0x244527;})});}_0x5e1448=_[_0xdf53('0x3d')]({},_0x5e1448,_0x3b004b[_0xdf53('0x3f')]);return db[_0xdf53('0x60')][_0xdf53('0x1c')]({'where':_0x5e1448[_0xdf53('0x3b')]})[_0xdf53('0x21')](function(_0xe4cf76){_0x1c8d09['count']=_0xe4cf76;if(_0x3b004b['query'][_0xdf53('0x44')]){_0x5e1448[_0xdf53('0x45')]=[{'all':!![]}];}return db[_0xdf53('0x60')]['findAll'](_0x5e1448);})[_0xdf53('0x21')](function(_0xa61795){_0x1c8d09['rows']=_0xa61795;return _0x1c8d09;});}})[_0xdf53('0x21')](respondWithFilteredResult(_0x1ffff0,_0x5e1448))[_0xdf53('0x42')](handleError(_0x1ffff0,null));};exports[_0xdf53('0x62')]=function(_0xae30c9,_0x3474ef,_0x4109d9){var _0x82f676={'raw':!![],'where':{}};var _0x44deef={};var _0x3bbee1={'count':0x0,'rows':[]};return db['Campaign'][_0xdf53('0x57')]({'where':{'id':_0xae30c9[_0xdf53('0x43')]['id']}})[_0xdf53('0x21')](handleEntityNotFound(_0x3474ef,null))['then'](function(_0x309ede){if(_0x309ede){_0x44deef['model']=_[_0xdf53('0x34')](db['CmHopperBlack'][_0xdf53('0x2d')]);_0x44deef[_0xdf53('0x33')]=_['keys'](_0xae30c9[_0xdf53('0x33')]);_0x44deef[_0xdf53('0x35')]=_['intersection'](_0x44deef[_0xdf53('0x31')],_0x44deef[_0xdf53('0x33')]);_0x82f676[_0xdf53('0x36')]=_[_0xdf53('0x37')](_0x44deef[_0xdf53('0x31')],qs['fields'](_0xae30c9['query']['fields']));_0x82f676[_0xdf53('0x36')]=_0x82f676[_0xdf53('0x36')][_0xdf53('0x39')]?_0x82f676[_0xdf53('0x36')]:_0x44deef['model'];if(!_0xae30c9[_0xdf53('0x33')][_0xdf53('0x61')](_0xdf53('0x58'))){_0x82f676[_0xdf53('0x1b')]=qs[_0xdf53('0x1b')](_0xae30c9['query'][_0xdf53('0x1b')]);_0x82f676['offset']=qs[_0xdf53('0x19')](_0xae30c9[_0xdf53('0x33')][_0xdf53('0x19')]);}_0x82f676[_0xdf53('0x3a')]=qs['sort'](_0xae30c9[_0xdf53('0x33')][_0xdf53('0x59')]);_0x82f676[_0xdf53('0x3b')]=qs['filters'](_[_0xdf53('0x5a')](_0xae30c9[_0xdf53('0x33')],_0x44deef[_0xdf53('0x35')]));_0x82f676['where'][_0xdf53('0x5b')]=_0x309ede['id'];if(_0xae30c9[_0xdf53('0x33')][_0xdf53('0x3c')]){_0x82f676[_0xdf53('0x3b')]=_[_0xdf53('0x3d')](_0x82f676[_0xdf53('0x3b')],{'$or':_['map'](_0x82f676[_0xdf53('0x36')],function(_0x492d3a){var _0x5058b8={};_0x5058b8[_0x492d3a]={'$like':'%'+_0xae30c9[_0xdf53('0x33')][_0xdf53('0x3c')]+'%'};return _0x5058b8;})});}_0x82f676=_[_0xdf53('0x3d')]({},_0x82f676,_0xae30c9[_0xdf53('0x3f')]);return db[_0xdf53('0x63')][_0xdf53('0x1c')]({'where':_0x82f676[_0xdf53('0x3b')]})['then'](function(_0x3282a7){_0x3bbee1[_0xdf53('0x1c')]=_0x3282a7;if(_0xae30c9[_0xdf53('0x33')][_0xdf53('0x44')]){_0x82f676[_0xdf53('0x45')]=[{'all':!![]}];}return db[_0xdf53('0x63')][_0xdf53('0x40')](_0x82f676);})[_0xdf53('0x21')](function(_0x1690ec){_0x3bbee1['rows']=_0x1690ec;return _0x3bbee1;});}})[_0xdf53('0x21')](respondWithFilteredResult(_0x3474ef,_0x82f676))[_0xdf53('0x42')](handleError(_0x3474ef,null));};exports[_0xdf53('0x64')]=function(_0x3ded4d,_0x514687,_0x7ddf1d){var _0x204712={};var _0x508811={};var _0x2c5455;var _0x5d20ba;return db[_0xdf53('0x2c')][_0xdf53('0x57')]({'where':{'id':_0x3ded4d[_0xdf53('0x43')]['id']}})[_0xdf53('0x21')](handleEntityNotFound(_0x514687,null))[_0xdf53('0x21')](function(_0x547464){if(_0x547464){_0x2c5455=_0x547464;_0x508811[_0xdf53('0x31')]=_[_0xdf53('0x34')](db[_0xdf53('0x65')][_0xdf53('0x2d')]);_0x508811[_0xdf53('0x33')]=_[_0xdf53('0x34')](_0x3ded4d['query']);_0x508811[_0xdf53('0x35')]=_[_0xdf53('0x37')](_0x508811[_0xdf53('0x31')],_0x508811[_0xdf53('0x33')]);_0x204712[_0xdf53('0x36')]=_[_0xdf53('0x37')](_0x508811[_0xdf53('0x31')],qs['fields'](_0x3ded4d['query'][_0xdf53('0x38')]));_0x204712[_0xdf53('0x36')]=_0x204712[_0xdf53('0x36')]['length']?_0x204712[_0xdf53('0x36')]:_0x508811[_0xdf53('0x31')];_0x204712['order']=qs['sort'](_0x3ded4d[_0xdf53('0x33')][_0xdf53('0x59')]);_0x204712[_0xdf53('0x3b')]=qs[_0xdf53('0x35')](_[_0xdf53('0x5a')](_0x3ded4d[_0xdf53('0x33')],_0x508811[_0xdf53('0x35')]));if(_0x3ded4d[_0xdf53('0x33')]['filter']){_0x204712[_0xdf53('0x3b')]=_[_0xdf53('0x3d')](_0x204712['where'],{'$or':_[_0xdf53('0x2b')](_0x204712[_0xdf53('0x36')],function(_0x28d0f7){var _0x292f0f={};_0x292f0f[_0x28d0f7]={'$like':'%'+_0x3ded4d[_0xdf53('0x33')][_0xdf53('0x3c')]+'%'};return _0x292f0f;})});}_0x204712=_[_0xdf53('0x3d')]({},_0x204712,_0x3ded4d[_0xdf53('0x3f')]);return _0x2c5455[_0xdf53('0x64')](_0x204712);}})['then'](function(_0x580dee){if(_0x580dee){_0x5d20ba=_0x580dee['length'];if(!_0x3ded4d[_0xdf53('0x33')][_0xdf53('0x61')]('nolimit')){_0x204712[_0xdf53('0x1b')]=qs['limit'](_0x3ded4d['query'][_0xdf53('0x1b')]);_0x204712['offset']=qs[_0xdf53('0x19')](_0x3ded4d[_0xdf53('0x33')][_0xdf53('0x19')]);}return _0x2c5455[_0xdf53('0x64')](_0x204712);}})[_0xdf53('0x21')](function(_0x5992e6){if(_0x5992e6){return _0x5992e6?{'count':_0x5d20ba,'rows':_0x5992e6}:null;}})[_0xdf53('0x21')](respondWithResult(_0x514687,null))[_0xdf53('0x42')](handleError(_0x514687,null));};exports[_0xdf53('0x66')]=function(_0x445347,_0x734018,_0x5436e1){var _0x37d8b7,_0x454957;var _0x9d80fe=[];var _0x628a2d=moment()[_0xdf53('0x67')](_0xdf53('0x68'));return db[_0xdf53('0x2c')]['find']({'where':{'id':_0x445347[_0xdf53('0x43')]['id']}})[_0xdf53('0x21')](handleEntityNotFound(_0x734018,null))[_0xdf53('0x21')](function(_0x46f26f){if(_0x46f26f){_0x454957=_0x46f26f;return _0x46f26f['addLists'](_0x445347[_0xdf53('0x48')][_0xdf53('0x69')],_[_0xdf53('0x51')](_0x445347[_0xdf53('0x48')],[_0xdf53('0x69'),'id'])||{});}return null;})[_0xdf53('0x6a')](function(_0x32fa91){var _0x773016;var _0x418f0b;_0x37d8b7=_0x32fa91||[];var _0x5c1b78=[];if(_0x32fa91){for(var _0x18e54b=0x0;_0x18e54b<_0x32fa91[_0xdf53('0x39')];_0x18e54b+=0x1){var _0x8568af=_0x32fa91[_0x18e54b][_0xdf53('0x4a')]({'plain':!![]});_0x454957[_0xdf53('0x6b')]=_0x445347[_0xdf53('0x48')][_0xdf53('0x6b')]?_0x445347[_0xdf53('0x48')][_0xdf53('0x6b')]:_0x454957[_0xdf53('0x6b')];switch(_0x454957[_0xdf53('0x6b')]){case _0xdf53('0x6c'):_0x773016=squel[_0xdf53('0x6d')]()[_0xdf53('0x6e')](_0xdf53('0x6f'))[_0xdf53('0x70')]([_0xdf53('0x71'),_0xdf53('0x72'),_0xdf53('0x73'),_0xdf53('0x74'),_0xdf53('0x5b'),_0xdf53('0x53'),_0xdf53('0x52')],squel[_0xdf53('0x75')]()[_0xdf53('0x76')]('phone',_0xdf53('0x71'))[_0xdf53('0x76')]('NOW()','scheduledAt')['field']('id',_0xdf53('0x73'))[_0xdf53('0x76')](_0x8568af[_0xdf53('0x77')][_0xdf53('0x78')](),'ListId')['field'](_0x445347[_0xdf53('0x43')]['id'][_0xdf53('0x78')](),'CampaignId')[_0xdf53('0x76')]('\x27'+_0x628a2d+'\x27','createdAt')['field']('\x27'+_0x628a2d+'\x27',_0xdf53('0x52'))[_0xdf53('0x79')](_0xdf53('0x7a'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xdf53('0x7b'),_0x8568af['CmListId'][_0xdf53('0x78')]())['where'](_0xdf53('0x7c'))[_0xdf53('0x3b')](_0xdf53('0x7d'),squel[_0xdf53('0x75')]()[_0xdf53('0x76')]('COALESCE(calleridnum,\x27\x27)')[_0xdf53('0x79')](_0xdf53('0x7e'))[_0xdf53('0x3b')](_0xdf53('0x7f'),_0x445347[_0xdf53('0x43')]['id'][_0xdf53('0x78')]()))['where'](_0xdf53('0x7d'),squel[_0xdf53('0x75')]()['field']('COALESCE(phone,\x27\x27)')[_0xdf53('0x79')]('cm_hopper')[_0xdf53('0x3b')](_0xdf53('0x7f'),_0x445347[_0xdf53('0x43')]['id'][_0xdf53('0x78')]())))[_0xdf53('0x78')]();break;case _0xdf53('0x80'):_0x773016=squel['insert']()[_0xdf53('0x6e')](_0xdf53('0x6f'))[_0xdf53('0x70')](['phone',_0xdf53('0x72'),_0xdf53('0x73'),_0xdf53('0x74'),_0xdf53('0x5b'),_0xdf53('0x53'),_0xdf53('0x52')],squel['select']()[_0xdf53('0x76')](_0xdf53('0x71'),_0xdf53('0x71'))['field'](_0xdf53('0x81'),_0xdf53('0x72'))[_0xdf53('0x76')]('id',_0xdf53('0x73'))[_0xdf53('0x76')](_0x8568af[_0xdf53('0x77')][_0xdf53('0x78')](),'ListId')[_0xdf53('0x76')](_0x445347[_0xdf53('0x43')]['id'][_0xdf53('0x78')](),_0xdf53('0x5b'))[_0xdf53('0x76')]('\x27'+_0x628a2d+'\x27',_0xdf53('0x53'))[_0xdf53('0x76')]('\x27'+_0x628a2d+'\x27','updatedAt')[_0xdf53('0x79')](_0xdf53('0x7a'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xdf53('0x7b'),_0x8568af[_0xdf53('0x77')][_0xdf53('0x78')]())[_0xdf53('0x3b')](_0xdf53('0x7c'))['where'](_0xdf53('0x7d'),squel[_0xdf53('0x75')]()[_0xdf53('0x76')](_0xdf53('0x82'))[_0xdf53('0x79')](_0xdf53('0x6f'))['where']('CampaignId\x20=\x20?',_0x445347[_0xdf53('0x43')]['id'][_0xdf53('0x78')]())))[_0xdf53('0x78')]();break;default:_0x773016=squel[_0xdf53('0x6d')]()['into'](_0xdf53('0x6f'))[_0xdf53('0x70')](['phone','scheduledAt',_0xdf53('0x73'),_0xdf53('0x74'),_0xdf53('0x5b'),_0xdf53('0x53'),'updatedAt'],squel[_0xdf53('0x75')]()[_0xdf53('0x76')](_0xdf53('0x71'),'phone')['field'](_0xdf53('0x81'),_0xdf53('0x72'))['field']('id','ContactId')['field'](_0x8568af[_0xdf53('0x77')][_0xdf53('0x78')](),_0xdf53('0x74'))[_0xdf53('0x76')](_0x445347[_0xdf53('0x43')]['id'][_0xdf53('0x78')](),_0xdf53('0x5b'))['field']('\x27'+_0x628a2d+'\x27','createdAt')[_0xdf53('0x76')]('\x27'+_0x628a2d+'\x27',_0xdf53('0x52'))[_0xdf53('0x79')](_0xdf53('0x7a'))['where'](_0xdf53('0x83'))[_0xdf53('0x3b')]('ListId\x20=\x20?',_0x8568af[_0xdf53('0x77')]['toString']())[_0xdf53('0x3b')](_0xdf53('0x7c')))[_0xdf53('0x78')]();}_0x418f0b=squel[_0xdf53('0x6d')]()['into']('cm_hopper_additional_phones')[_0xdf53('0x70')](['cmHopperId',_0xdf53('0x72'),_0xdf53('0x71'),_0xdf53('0x84'),_0xdf53('0x53'),'updatedAt'],squel[_0xdf53('0x75')]()[_0xdf53('0x76')](_0xdf53('0x85'),'id')[_0xdf53('0x76')]('NOW()','scheduledAt')[_0xdf53('0x76')](_0xdf53('0x86'),_0xdf53('0x71'))[_0xdf53('0x76')](_0xdf53('0x87'),_0xdf53('0x84'))['field']('\x27'+_0x628a2d+'\x27',_0xdf53('0x53'))[_0xdf53('0x76')]('\x27'+_0x628a2d+'\x27',_0xdf53('0x52'))[_0xdf53('0x79')](_0xdf53('0x88'),'ci')['join']('cm_hopper','h',_0xdf53('0x89'))[_0xdf53('0x3b')](_0xdf53('0x8a'),_0x8568af[_0xdf53('0x77')][_0xdf53('0x78')]())[_0xdf53('0x3b')](_0xdf53('0x8b'),_0x445347[_0xdf53('0x43')]['id'][_0xdf53('0x78')]())['where'](_0xdf53('0x8c'),_0x628a2d))[_0xdf53('0x78')]();_0x5c1b78[_0xdf53('0x8d')](db[_0xdf53('0x8e')]['query'](_0x773016));_0x9d80fe['push'](db[_0xdf53('0x8e')][_0xdf53('0x33')](_0x418f0b));}return BPromise[_0xdf53('0x8f')](_0x5c1b78);}})[_0xdf53('0x21')](function(){return BPromise[_0xdf53('0x8f')](_0x9d80fe);})[_0xdf53('0x21')](function(){return _0x37d8b7;})['then'](respondWithResult(_0x734018,null))['catch'](handleError(_0x734018,null));};exports[_0xdf53('0x90')]=function(_0x237f24,_0xcc8264,_0x2d2814){return db[_0xdf53('0x2c')][_0xdf53('0x46')]({'where':{'id':_0x237f24[_0xdf53('0x43')]['id']}})[_0xdf53('0x21')](handleEntityNotFound(_0xcc8264,null))[_0xdf53('0x21')](function(_0x1d86b7){if(_0x1d86b7){return _0x1d86b7[_0xdf53('0x90')](_0x237f24[_0xdf53('0x33')][_0xdf53('0x69')]);}})[_0xdf53('0x21')](function(_0x75373d){if(_0x75373d){return db['CmHopper'][_0xdf53('0x22')]({'where':{'ListId':_0x237f24[_0xdf53('0x33')][_0xdf53('0x69')],'CampaignId':_0x237f24['params']['id']}})[_0xdf53('0x21')](function(){return _0x75373d;});}})[_0xdf53('0x21')](respondWithStatusCode(_0xcc8264,null))['catch'](handleError(_0xcc8264,null));};exports[_0xdf53('0x91')]=function(_0x17115f,_0x56fc63,_0x545168){var _0x4780d1={};var _0x3adad8={};var _0x31d980;var _0x433693;return db[_0xdf53('0x2c')][_0xdf53('0x57')]({'where':{'id':_0x17115f['params']['id']}})['then'](handleEntityNotFound(_0x56fc63,null))['then'](function(_0x2a2dd1){if(_0x2a2dd1){_0x31d980=_0x2a2dd1;_0x3adad8[_0xdf53('0x31')]=_[_0xdf53('0x34')](db[_0xdf53('0x65')][_0xdf53('0x2d')]);_0x3adad8[_0xdf53('0x33')]=_[_0xdf53('0x34')](_0x17115f[_0xdf53('0x33')]);_0x3adad8['filters']=_[_0xdf53('0x37')](_0x3adad8[_0xdf53('0x31')],_0x3adad8[_0xdf53('0x33')]);_0x4780d1[_0xdf53('0x36')]=_['intersection'](_0x3adad8[_0xdf53('0x31')],qs[_0xdf53('0x38')](_0x17115f[_0xdf53('0x33')][_0xdf53('0x38')]));_0x4780d1[_0xdf53('0x36')]=_0x4780d1[_0xdf53('0x36')][_0xdf53('0x39')]?_0x4780d1[_0xdf53('0x36')]:_0x3adad8[_0xdf53('0x31')];_0x4780d1[_0xdf53('0x3a')]=qs['sort'](_0x17115f[_0xdf53('0x33')][_0xdf53('0x59')]);_0x4780d1[_0xdf53('0x3b')]=qs[_0xdf53('0x35')](_[_0xdf53('0x5a')](_0x17115f[_0xdf53('0x33')],_0x3adad8['filters']));if(_0x17115f[_0xdf53('0x33')]['filter']){_0x4780d1[_0xdf53('0x3b')]=_['merge'](_0x4780d1[_0xdf53('0x3b')],{'$or':_[_0xdf53('0x2b')](_0x4780d1['attributes'],function(_0x3a6c80){var _0x5314dc={};_0x5314dc[_0x3a6c80]={'$like':'%'+_0x17115f[_0xdf53('0x33')][_0xdf53('0x3c')]+'%'};return _0x5314dc;})});}_0x4780d1=_[_0xdf53('0x3d')]({},_0x4780d1,_0x17115f[_0xdf53('0x3f')]);return _0x31d980['getBlackLists'](_0x4780d1);}})[_0xdf53('0x21')](function(_0x3c59f2){if(_0x3c59f2){_0x433693=_0x3c59f2[_0xdf53('0x39')];if(!_0x17115f[_0xdf53('0x33')][_0xdf53('0x61')](_0xdf53('0x58'))){_0x4780d1[_0xdf53('0x1b')]=qs['limit'](_0x17115f[_0xdf53('0x33')][_0xdf53('0x1b')]);_0x4780d1[_0xdf53('0x19')]=qs[_0xdf53('0x19')](_0x17115f[_0xdf53('0x33')][_0xdf53('0x19')]);}return _0x31d980[_0xdf53('0x91')](_0x4780d1);}})[_0xdf53('0x21')](function(_0x228172){if(_0x228172){return _0x228172?{'count':_0x433693,'rows':_0x228172}:null;}})[_0xdf53('0x21')](respondWithResult(_0x56fc63,null))['catch'](handleError(_0x56fc63,null));};exports[_0xdf53('0x92')]=function(_0x67a262,_0x5157b,_0x54b0b7){var _0x129100,_0x3886a8;var _0x35912c=[];var _0x3f364f=moment()[_0xdf53('0x67')](_0xdf53('0x68'));return db[_0xdf53('0x2c')][_0xdf53('0x46')]({'where':{'id':_0x67a262[_0xdf53('0x43')]['id']}})[_0xdf53('0x21')](handleEntityNotFound(_0x5157b,null))['then'](function(_0x5506f1){if(_0x5506f1){_0x3886a8=_0x5506f1;return _0x5506f1[_0xdf53('0x92')](_0x67a262[_0xdf53('0x48')]['ids'],_['omit'](_0x67a262['body'],[_0xdf53('0x69'),'id'])||{});}return null;})[_0xdf53('0x6a')](function(_0x5b23c5){var _0x5a8dca;var _0x4bfb2e;_0x129100=_0x5b23c5||[];var _0x1048bc=[];if(_0x5b23c5){for(var _0x1104b5=0x0;_0x1104b5<_0x5b23c5[_0xdf53('0x39')];_0x1104b5+=0x1){var _0x374990=_0x5b23c5[_0x1104b5][_0xdf53('0x4a')]({'plain':!![]});_0x5a8dca=squel[_0xdf53('0x6d')]()[_0xdf53('0x6e')](_0xdf53('0x93'))[_0xdf53('0x70')](['phone',_0xdf53('0x73'),'ListId',_0xdf53('0x5b'),_0xdf53('0x53'),_0xdf53('0x52')],squel[_0xdf53('0x75')]()[_0xdf53('0x76')](_0xdf53('0x71'),_0xdf53('0x71'))['field']('id','ContactId')[_0xdf53('0x76')](_0x374990[_0xdf53('0x77')][_0xdf53('0x78')](),_0xdf53('0x74'))['field'](_0x67a262[_0xdf53('0x43')]['id']['toString'](),_0xdf53('0x5b'))['field'](_0xdf53('0x81'),_0xdf53('0x53'))['field'](_0xdf53('0x81'),_0xdf53('0x52'))[_0xdf53('0x79')]('cm_contacts')[_0xdf53('0x3b')]('deletedAt\x20IS\x20NULL')[_0xdf53('0x3b')]('ListId\x20=\x20?',_0x374990['CmListId'][_0xdf53('0x78')]())['where'](_0xdf53('0x7c')))[_0xdf53('0x78')]();_0x1048bc[_0xdf53('0x8d')](db[_0xdf53('0x8e')][_0xdf53('0x33')](_0x5a8dca));}return BPromise[_0xdf53('0x8f')](_0x1048bc);}})[_0xdf53('0x21')](function(){return _0x129100;})['then'](respondWithResult(_0x5157b,null))[_0xdf53('0x42')](handleError(_0x5157b,null));};exports[_0xdf53('0x94')]=function(_0x7030fe,_0x149407,_0x40b703){return db[_0xdf53('0x2c')][_0xdf53('0x46')]({'where':{'id':_0x7030fe[_0xdf53('0x43')]['id']}})[_0xdf53('0x21')](handleEntityNotFound(_0x149407,null))['then'](function(_0x1e731d){if(_0x1e731d){return _0x1e731d[_0xdf53('0x94')](_0x7030fe[_0xdf53('0x33')]['ids']);}})[_0xdf53('0x21')](function(_0x5f4931){if(_0x5f4931){return db[_0xdf53('0x63')]['destroy']({'where':{'ListId':_0x7030fe[_0xdf53('0x33')][_0xdf53('0x69')],'CampaignId':_0x7030fe[_0xdf53('0x43')]['id']}})['then'](function(){return _0x5f4931;});}})['then'](respondWithStatusCode(_0x149407,null))[_0xdf53('0x42')](handleError(_0x149407,null));};
\ No newline at end of file
+var _0x73f5=['cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','format','addBlackLists','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','IvrCampaigns','UserProfileResource','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','Campaign','includeAll','include','rows','catch','show','params','model','keys','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','autoAssociation','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','order','findAll','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','select','field','NOW()','ContactId','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','ci.OrderBY'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x73f5,0x1cb));var _0x573f=function(_0x32cc8a,_0x500424){_0x32cc8a=_0x32cc8a-0x0;var _0x5eb4e3=_0x73f5[_0x32cc8a];return _0x5eb4e3;};'use strict';var emlformat=require(_0x573f('0x0'));var rimraf=require(_0x573f('0x1'));var zipdir=require(_0x573f('0x2'));var jsonpatch=require(_0x573f('0x3'));var rp=require('request-promise');var moment=require(_0x573f('0x4'));var BPromise=require(_0x573f('0x5'));var Mustache=require(_0x573f('0x6'));var util=require(_0x573f('0x7'));var path=require(_0x573f('0x8'));var sox=require(_0x573f('0x9'));var csv=require(_0x573f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x573f('0xb'));var _=require('lodash');var squel=require(_0x573f('0xc'));var crypto=require('crypto');var jsforce=require(_0x573f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x573f('0xa'));var querystring=require(_0x573f('0xe'));var Papa=require(_0x573f('0xf'));var Redis=require('ioredis');var authService=require(_0x573f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x573f('0x11'));var hardwareService=require(_0x573f('0x12'));var logger=require(_0x573f('0x13'))(_0x573f('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x573f('0x15'))['db'];function respondWithStatusCode(_0x2493f3,_0x11ea43){_0x11ea43=_0x11ea43||0xcc;return function(_0x322304){if(_0x322304){return _0x2493f3[_0x573f('0x16')](_0x11ea43);}return _0x2493f3['status'](_0x11ea43)['end']();};}function respondWithResult(_0x57290c,_0x2718bd){_0x2718bd=_0x2718bd||0xc8;return function(_0x149144){if(_0x149144){return _0x57290c[_0x573f('0x17')](_0x2718bd)['json'](_0x149144);}};}function respondWithFilteredResult(_0x3550bf,_0x544e9f){return function(_0x55d73f){if(_0x55d73f){var _0x51c32d=typeof _0x544e9f[_0x573f('0x18')]===_0x573f('0x19')&&typeof _0x544e9f[_0x573f('0x1a')]===_0x573f('0x19');var _0x3c1584=_0x55d73f['count'];var _0x4de5ef=_0x51c32d?0x0:_0x544e9f[_0x573f('0x18')];var _0x1202c8=_0x51c32d?_0x55d73f[_0x573f('0x1b')]:_0x544e9f['offset']+_0x544e9f[_0x573f('0x1a')];var _0x3d4253;if(_0x1202c8>=_0x3c1584){_0x1202c8=_0x3c1584;_0x3d4253=0xc8;}else{_0x3d4253=0xce;}_0x3550bf[_0x573f('0x17')](_0x3d4253);return _0x3550bf[_0x573f('0x1c')](_0x573f('0x1d'),_0x4de5ef+'-'+_0x1202c8+'/'+_0x3c1584)[_0x573f('0x1e')](_0x55d73f);}return null;};}function patchUpdates(_0x5c4308){return function(_0x77ba9f){try{jsonpatch[_0x573f('0x1f')](_0x77ba9f,_0x5c4308,!![]);}catch(_0x3eebba){return BPromise[_0x573f('0x20')](_0x3eebba);}return _0x77ba9f[_0x573f('0x21')]();};}function saveUpdates(_0x1fd5e4,_0x5f5f48){return function(_0x206e5d){if(_0x206e5d){return _0x206e5d[_0x573f('0x22')](_0x1fd5e4)[_0x573f('0x23')](function(_0x3da73b){return _0x3da73b;});}return null;};}function removeEntity(_0x31dfe8,_0x429f2b){return function(_0x10eda6){if(_0x10eda6){return _0x10eda6[_0x573f('0x24')]()[_0x573f('0x23')](function(){var _0x3acd35=_0x10eda6['get']({'plain':!![]});var _0x50139c=_0x573f('0x25');return db[_0x573f('0x26')]['destroy']({'where':{'type':_0x50139c,'resourceId':_0x3acd35['id']}})['then'](function(){return _0x10eda6;});})[_0x573f('0x23')](function(){_0x31dfe8[_0x573f('0x17')](0xcc)[_0x573f('0x27')]();});}};}function handleEntityNotFound(_0x54ae1a,_0x32c273){return function(_0x146975){if(!_0x146975){_0x54ae1a[_0x573f('0x16')](0x194);}return _0x146975;};}function handleError(_0x253e2c,_0x343296){_0x343296=_0x343296||0x1f4;return function(_0x54eef1){logger[_0x573f('0x28')](_0x54eef1[_0x573f('0x29')]);if(_0x54eef1[_0x573f('0x2a')]){delete _0x54eef1[_0x573f('0x2a')];}_0x253e2c['status'](_0x343296)['send'](_0x54eef1);};}exports[_0x573f('0x2b')]=function(_0x3eb44a,_0x1b2582){var _0x164a4e={},_0x30c1b4={},_0x17ba36={'count':0x0,'rows':[]};var _0x1a43a2=_[_0x573f('0x2c')](db['Campaign'][_0x573f('0x2d')],function(_0x2169aa){return{'name':_0x2169aa[_0x573f('0x2e')],'type':_0x2169aa[_0x573f('0x2f')][_0x573f('0x30')]};});_0x30c1b4['model']=_[_0x573f('0x2c')](_0x1a43a2,_0x573f('0x2a'));_0x30c1b4[_0x573f('0x31')]=_['keys'](_0x3eb44a[_0x573f('0x31')]);_0x30c1b4[_0x573f('0x32')]=_[_0x573f('0x33')](_0x30c1b4['model'],_0x30c1b4[_0x573f('0x31')]);_0x164a4e[_0x573f('0x34')]=_[_0x573f('0x33')](_0x30c1b4['model'],qs['fields'](_0x3eb44a['query'][_0x573f('0x35')]));_0x164a4e['attributes']=_0x164a4e[_0x573f('0x34')]['length']?_0x164a4e[_0x573f('0x34')]:_0x30c1b4['model'];if(!_0x3eb44a[_0x573f('0x31')][_0x573f('0x36')](_0x573f('0x37'))){_0x164a4e[_0x573f('0x1a')]=qs[_0x573f('0x1a')](_0x3eb44a[_0x573f('0x31')][_0x573f('0x1a')]);_0x164a4e[_0x573f('0x18')]=qs[_0x573f('0x18')](_0x3eb44a[_0x573f('0x31')][_0x573f('0x18')]);}_0x164a4e['order']=qs[_0x573f('0x38')](_0x3eb44a[_0x573f('0x31')]['sort']);_0x164a4e[_0x573f('0x39')]=qs[_0x573f('0x32')](_[_0x573f('0x3a')](_0x3eb44a[_0x573f('0x31')],_0x30c1b4['filters']),_0x1a43a2);if(_0x3eb44a[_0x573f('0x31')][_0x573f('0x3b')]){_0x164a4e[_0x573f('0x39')]=_[_0x573f('0x3c')](_0x164a4e['where'],{'$or':_['map'](_0x1a43a2,function(_0x29e5a4){if(_0x29e5a4[_0x573f('0x2f')]!==_0x573f('0x3d')){var _0x52d508={};_0x52d508[_0x29e5a4[_0x573f('0x2a')]]={'$like':'%'+_0x3eb44a[_0x573f('0x31')][_0x573f('0x3b')]+'%'};return _0x52d508;}})});}_0x164a4e=_[_0x573f('0x3c')]({},_0x164a4e,_0x3eb44a[_0x573f('0x3e')]);var _0x2b3419={'where':_0x164a4e[_0x573f('0x39')]};return db[_0x573f('0x3f')][_0x573f('0x1b')](_0x2b3419)['then'](function(_0x427126){_0x17ba36['count']=_0x427126;if(_0x3eb44a[_0x573f('0x31')][_0x573f('0x40')]){_0x164a4e[_0x573f('0x41')]=[{'all':!![]}];}return db[_0x573f('0x3f')]['findAll'](_0x164a4e);})['then'](function(_0x2660dc){_0x17ba36[_0x573f('0x42')]=_0x2660dc;return _0x17ba36;})['then'](respondWithFilteredResult(_0x1b2582,_0x164a4e))[_0x573f('0x43')](handleError(_0x1b2582,null));};exports[_0x573f('0x44')]=function(_0xff317f,_0x7537c){var _0xc755c4={'raw':![],'where':{'id':_0xff317f[_0x573f('0x45')]['id']}},_0x38ee04={};_0x38ee04[_0x573f('0x46')]=_[_0x573f('0x47')](db[_0x573f('0x3f')][_0x573f('0x2d')]);_0x38ee04['query']=_[_0x573f('0x47')](_0xff317f['query']);_0x38ee04[_0x573f('0x32')]=_['intersection'](_0x38ee04[_0x573f('0x46')],_0x38ee04['query']);_0xc755c4[_0x573f('0x34')]=_[_0x573f('0x33')](_0x38ee04[_0x573f('0x46')],qs['fields'](_0xff317f[_0x573f('0x31')][_0x573f('0x35')]));_0xc755c4[_0x573f('0x34')]=_0xc755c4[_0x573f('0x34')][_0x573f('0x48')]?_0xc755c4[_0x573f('0x34')]:_0x38ee04[_0x573f('0x46')];if(_0xff317f[_0x573f('0x31')][_0x573f('0x40')]){_0xc755c4[_0x573f('0x41')]=[{'all':!![]}];}_0xc755c4=_['merge']({},_0xc755c4,_0xff317f[_0x573f('0x3e')]);return db[_0x573f('0x3f')]['find'](_0xc755c4)['then'](handleEntityNotFound(_0x7537c,null))['then'](respondWithResult(_0x7537c,null))['catch'](handleError(_0x7537c,null));};exports[_0x573f('0x49')]=function(_0x2ccde3,_0x354a83){return db[_0x573f('0x3f')][_0x573f('0x49')](_0x2ccde3['body'],{})['then'](function(_0x5ccbf9){var _0xbf5d44=_0x2ccde3[_0x573f('0x4a')]['get']({'plain':!![]});if(!_0xbf5d44)throw new Error(_0x573f('0x4b'));if(_0xbf5d44[_0x573f('0x4c')]==='user'){var _0x5d2d97=_0x5ccbf9[_0x573f('0x4d')]({'plain':!![]});var _0x4d2ceb=_0x573f('0x25');return db[_0x573f('0x4e')][_0x573f('0x4f')]({'where':{'name':_0x4d2ceb,'userProfileId':_0xbf5d44[_0x573f('0x50')]},'raw':!![]})['then'](function(_0x2851e2){if(_0x2851e2&&_0x2851e2['autoAssociation']===0x0){return db[_0x573f('0x26')]['create']({'name':_0x5d2d97[_0x573f('0x2a')],'resourceId':_0x5d2d97['id'],'type':_0x2851e2[_0x573f('0x2a')],'sectionId':_0x2851e2['id']},{})[_0x573f('0x23')](function(){return _0x5ccbf9;});}else{return _0x5ccbf9;}})['catch'](function(_0x3ffb02){logger[_0x573f('0x28')](_0x573f('0x51'),_0x3ffb02);throw _0x3ffb02;});}return _0x5ccbf9;})['then'](respondWithResult(_0x354a83,0xc9))['catch'](handleError(_0x354a83,null));};exports[_0x573f('0x52')]=function(_0x35cea3,_0x3a70b1){var _0x1e8162={'where':{'id':_0x35cea3[_0x573f('0x45')]['id']}},_0x1d7c2a={};_0x1d7c2a[_0x573f('0x46')]=_[_0x573f('0x47')](db[_0x573f('0x3f')]['rawAttributes']);_0x1e8162['attributes']=_['intersection'](_0x1d7c2a[_0x573f('0x46')],qs[_0x573f('0x35')](_0x35cea3['query'][_0x573f('0x35')]));_0x1e8162[_0x573f('0x34')]=_0x1e8162[_0x573f('0x34')]['length']?_0x1e8162['attributes']:_0x1d7c2a['model'];if(_0x35cea3[_0x573f('0x31')][_0x573f('0x40')]){_0x1e8162[_0x573f('0x41')]=[{'all':!![]}];}_0x1e8162=_['merge']({},_0x1e8162,_0x35cea3[_0x573f('0x3e')]);return db[_0x573f('0x3f')]['find'](_0x1e8162)[_0x573f('0x23')](handleEntityNotFound(_0x3a70b1,null))[_0x573f('0x23')](function(_0x3da2d6){if(_0x3da2d6){var _0x78b369=_0x3da2d6[_0x573f('0x4d')]({'plain':!![]});_0x78b369=qs[_0x573f('0x53')](_0x78b369,['id',_0x573f('0x54'),_0x573f('0x55')]);_0x35cea3['body']=_[_0x573f('0x53')](_0x35cea3[_0x573f('0x56')],['id',_0x573f('0x54'),_0x573f('0x55')]);return db['Campaign'][_0x573f('0x49')](_[_0x573f('0x3c')](_0x78b369,_0x35cea3[_0x573f('0x56')]),{'include':_0x35cea3['query'][_0x573f('0x40')]?[{'all':!![]}]:undefined})[_0x573f('0x23')](function(_0x24bab6){var _0x298ca8=_0x35cea3[_0x573f('0x4a')]['get']({'plain':!![]});if(!_0x298ca8)throw new Error(_0x573f('0x4b'));if(_0x298ca8[_0x573f('0x4c')]===_0x573f('0x4a')){var _0x52b8f8=_0x24bab6[_0x573f('0x4d')]({'plain':!![]});var _0x17192b=_0x573f('0x25');return db[_0x573f('0x4e')][_0x573f('0x4f')]({'where':{'name':_0x17192b,'userProfileId':_0x298ca8[_0x573f('0x50')]},'raw':!![]})[_0x573f('0x23')](function(_0x17c120){if(_0x17c120&&_0x17c120[_0x573f('0x57')]===0x0){return db[_0x573f('0x26')][_0x573f('0x49')]({'name':_0x52b8f8[_0x573f('0x2a')],'resourceId':_0x52b8f8['id'],'type':_0x17c120['name'],'sectionId':_0x17c120['id']},{})[_0x573f('0x23')](function(){return _0x24bab6;});}else{return _0x24bab6;}})[_0x573f('0x43')](function(_0x481a78){logger[_0x573f('0x28')](_0x573f('0x51'),_0x481a78);throw _0x481a78;});}return _0x24bab6;});}})[_0x573f('0x23')](respondWithResult(_0x3a70b1,0xc9))['catch'](handleError(_0x3a70b1,null));};exports['update']=function(_0xa94d6a,_0x479e91){if(_0xa94d6a[_0x573f('0x56')]['id']){delete _0xa94d6a[_0x573f('0x56')]['id'];}return db[_0x573f('0x3f')][_0x573f('0x4f')]({'where':{'id':_0xa94d6a[_0x573f('0x45')]['id']}})[_0x573f('0x23')](handleEntityNotFound(_0x479e91,null))[_0x573f('0x23')](saveUpdates(_0xa94d6a[_0x573f('0x56')],null))[_0x573f('0x23')](respondWithResult(_0x479e91,null))[_0x573f('0x43')](handleError(_0x479e91,null));};exports[_0x573f('0x24')]=function(_0x56510d,_0x29f6cf){return db[_0x573f('0x3f')]['find']({'where':{'id':_0x56510d[_0x573f('0x45')]['id']}})['then'](handleEntityNotFound(_0x29f6cf,null))[_0x573f('0x23')](removeEntity(_0x29f6cf,null))[_0x573f('0x43')](handleError(_0x29f6cf,null));};exports['getHoppers']=function(_0x1b79c3,_0x3d0895,_0x165c06){var _0x563c07={'raw':!![],'where':{}};var _0x490af5={};var _0x5e78c7={'count':0x0,'rows':[]};return db['Campaign'][_0x573f('0x58')]({'where':{'id':_0x1b79c3[_0x573f('0x45')]['id']}})['then'](handleEntityNotFound(_0x3d0895,null))[_0x573f('0x23')](function(_0x3bb905){if(_0x3bb905){_0x490af5[_0x573f('0x46')]=_[_0x573f('0x47')](db[_0x573f('0x59')][_0x573f('0x2d')]);_0x490af5['query']=_['keys'](_0x1b79c3[_0x573f('0x31')]);_0x490af5['filters']=_[_0x573f('0x33')](_0x490af5[_0x573f('0x46')],_0x490af5[_0x573f('0x31')]);_0x563c07[_0x573f('0x34')]=_[_0x573f('0x33')](_0x490af5[_0x573f('0x46')],qs[_0x573f('0x35')](_0x1b79c3[_0x573f('0x31')]['fields']));_0x563c07[_0x573f('0x34')]=_0x563c07[_0x573f('0x34')][_0x573f('0x48')]?_0x563c07['attributes']:_0x490af5[_0x573f('0x46')];if(!_0x1b79c3[_0x573f('0x31')]['hasOwnProperty'](_0x573f('0x37'))){_0x563c07[_0x573f('0x1a')]=qs[_0x573f('0x1a')](_0x1b79c3[_0x573f('0x31')]['limit']);_0x563c07[_0x573f('0x18')]=qs[_0x573f('0x18')](_0x1b79c3[_0x573f('0x31')][_0x573f('0x18')]);}_0x563c07['order']=qs[_0x573f('0x38')](_0x1b79c3[_0x573f('0x31')][_0x573f('0x38')]);_0x563c07['where']=qs[_0x573f('0x32')](_['pick'](_0x1b79c3['query'],_0x490af5['filters']));_0x563c07[_0x573f('0x39')][_0x573f('0x5a')]=_0x3bb905['id'];if(_0x1b79c3[_0x573f('0x31')][_0x573f('0x3b')]){_0x563c07[_0x573f('0x39')]=_[_0x573f('0x3c')](_0x563c07[_0x573f('0x39')],{'$or':_[_0x573f('0x2c')](_0x563c07[_0x573f('0x34')],function(_0x36008){var _0x2f79ac={};_0x2f79ac[_0x36008]={'$like':'%'+_0x1b79c3[_0x573f('0x31')][_0x573f('0x3b')]+'%'};return _0x2f79ac;})});}_0x563c07=_['merge']({},_0x563c07,_0x1b79c3[_0x573f('0x3e')]);return db[_0x573f('0x59')]['count']({'where':_0x563c07['where']})[_0x573f('0x23')](function(_0x370837){_0x5e78c7[_0x573f('0x1b')]=_0x370837;if(_0x1b79c3[_0x573f('0x31')]['includeAll']){_0x563c07['include']=[{'all':!![]}];}return db[_0x573f('0x59')]['findAll'](_0x563c07);})[_0x573f('0x23')](function(_0x3918c6){_0x5e78c7[_0x573f('0x42')]=_0x3918c6;return _0x5e78c7;});}})[_0x573f('0x23')](respondWithFilteredResult(_0x3d0895,_0x563c07))['catch'](handleError(_0x3d0895,null));};exports[_0x573f('0x5b')]=function(_0x2dd5ea,_0x536f8c,_0x464d41){var _0x290511={'raw':!![],'where':{}};var _0x4121b5={};var _0x5af3da={'count':0x0,'rows':[]};return db[_0x573f('0x3f')][_0x573f('0x58')]({'where':{'id':_0x2dd5ea[_0x573f('0x45')]['id']}})[_0x573f('0x23')](handleEntityNotFound(_0x536f8c,null))[_0x573f('0x23')](function(_0x126d7d){if(_0x126d7d){_0x4121b5[_0x573f('0x46')]=_[_0x573f('0x47')](db[_0x573f('0x5c')][_0x573f('0x2d')]);_0x4121b5[_0x573f('0x31')]=_[_0x573f('0x47')](_0x2dd5ea[_0x573f('0x31')]);_0x4121b5[_0x573f('0x32')]=_[_0x573f('0x33')](_0x4121b5[_0x573f('0x46')],_0x4121b5['query']);_0x290511[_0x573f('0x34')]=_['intersection'](_0x4121b5[_0x573f('0x46')],qs[_0x573f('0x35')](_0x2dd5ea[_0x573f('0x31')]['fields']));_0x290511[_0x573f('0x34')]=_0x290511[_0x573f('0x34')][_0x573f('0x48')]?_0x290511[_0x573f('0x34')]:_0x4121b5[_0x573f('0x46')];if(!_0x2dd5ea['query']['hasOwnProperty']('nolimit')){_0x290511[_0x573f('0x1a')]=qs['limit'](_0x2dd5ea[_0x573f('0x31')][_0x573f('0x1a')]);_0x290511[_0x573f('0x18')]=qs['offset'](_0x2dd5ea[_0x573f('0x31')][_0x573f('0x18')]);}_0x290511[_0x573f('0x5d')]=qs[_0x573f('0x38')](_0x2dd5ea[_0x573f('0x31')][_0x573f('0x38')]);_0x290511[_0x573f('0x39')]=qs['filters'](_[_0x573f('0x3a')](_0x2dd5ea[_0x573f('0x31')],_0x4121b5[_0x573f('0x32')]));_0x290511['where'][_0x573f('0x5a')]=_0x126d7d['id'];if(_0x2dd5ea[_0x573f('0x31')][_0x573f('0x3b')]){_0x290511[_0x573f('0x39')]=_[_0x573f('0x3c')](_0x290511['where'],{'$or':_['map'](_0x290511[_0x573f('0x34')],function(_0x3724a0){var _0x37915e={};_0x37915e[_0x3724a0]={'$like':'%'+_0x2dd5ea[_0x573f('0x31')]['filter']+'%'};return _0x37915e;})});}_0x290511=_[_0x573f('0x3c')]({},_0x290511,_0x2dd5ea[_0x573f('0x3e')]);return db['CmHopperHistory'][_0x573f('0x1b')]({'where':_0x290511['where']})[_0x573f('0x23')](function(_0x58010e){_0x5af3da['count']=_0x58010e;if(_0x2dd5ea[_0x573f('0x31')][_0x573f('0x40')]){_0x290511['include']=[{'all':!![]}];}return db[_0x573f('0x5c')][_0x573f('0x5e')](_0x290511);})[_0x573f('0x23')](function(_0x134a12){_0x5af3da[_0x573f('0x42')]=_0x134a12;return _0x5af3da;});}})[_0x573f('0x23')](respondWithFilteredResult(_0x536f8c,_0x290511))[_0x573f('0x43')](handleError(_0x536f8c,null));};exports[_0x573f('0x5f')]=function(_0x2be1d8,_0x5464c6,_0x4396ca){var _0x3c4326={'raw':!![],'where':{}};var _0x29edf3={};var _0x3a8cb6={'count':0x0,'rows':[]};return db[_0x573f('0x3f')][_0x573f('0x58')]({'where':{'id':_0x2be1d8[_0x573f('0x45')]['id']}})[_0x573f('0x23')](handleEntityNotFound(_0x5464c6,null))[_0x573f('0x23')](function(_0x59bc43){if(_0x59bc43){_0x29edf3['model']=_[_0x573f('0x47')](db[_0x573f('0x60')][_0x573f('0x2d')]);_0x29edf3[_0x573f('0x31')]=_[_0x573f('0x47')](_0x2be1d8[_0x573f('0x31')]);_0x29edf3[_0x573f('0x32')]=_[_0x573f('0x33')](_0x29edf3[_0x573f('0x46')],_0x29edf3[_0x573f('0x31')]);_0x3c4326[_0x573f('0x34')]=_[_0x573f('0x33')](_0x29edf3['model'],qs[_0x573f('0x35')](_0x2be1d8['query']['fields']));_0x3c4326[_0x573f('0x34')]=_0x3c4326[_0x573f('0x34')]['length']?_0x3c4326[_0x573f('0x34')]:_0x29edf3[_0x573f('0x46')];if(!_0x2be1d8[_0x573f('0x31')][_0x573f('0x36')]('nolimit')){_0x3c4326[_0x573f('0x1a')]=qs['limit'](_0x2be1d8[_0x573f('0x31')][_0x573f('0x1a')]);_0x3c4326[_0x573f('0x18')]=qs[_0x573f('0x18')](_0x2be1d8[_0x573f('0x31')]['offset']);}_0x3c4326[_0x573f('0x5d')]=qs[_0x573f('0x38')](_0x2be1d8[_0x573f('0x31')]['sort']);_0x3c4326[_0x573f('0x39')]=qs[_0x573f('0x32')](_[_0x573f('0x3a')](_0x2be1d8[_0x573f('0x31')],_0x29edf3[_0x573f('0x32')]));_0x3c4326[_0x573f('0x39')][_0x573f('0x5a')]=_0x59bc43['id'];if(_0x2be1d8[_0x573f('0x31')][_0x573f('0x3b')]){_0x3c4326[_0x573f('0x39')]=_[_0x573f('0x3c')](_0x3c4326[_0x573f('0x39')],{'$or':_[_0x573f('0x2c')](_0x3c4326[_0x573f('0x34')],function(_0x556f72){var _0x73e1ef={};_0x73e1ef[_0x556f72]={'$like':'%'+_0x2be1d8[_0x573f('0x31')][_0x573f('0x3b')]+'%'};return _0x73e1ef;})});}_0x3c4326=_[_0x573f('0x3c')]({},_0x3c4326,_0x2be1d8[_0x573f('0x3e')]);return db[_0x573f('0x60')]['count']({'where':_0x3c4326[_0x573f('0x39')]})[_0x573f('0x23')](function(_0x32b05c){_0x3a8cb6['count']=_0x32b05c;if(_0x2be1d8['query'][_0x573f('0x40')]){_0x3c4326['include']=[{'all':!![]}];}return db[_0x573f('0x60')][_0x573f('0x5e')](_0x3c4326);})[_0x573f('0x23')](function(_0x409367){_0x3a8cb6[_0x573f('0x42')]=_0x409367;return _0x3a8cb6;});}})[_0x573f('0x23')](respondWithFilteredResult(_0x5464c6,_0x3c4326))[_0x573f('0x43')](handleError(_0x5464c6,null));};exports['getHopperBlacks']=function(_0xfc3fc2,_0x3575d8,_0x317837){var _0x128e5e={'raw':!![],'where':{}};var _0xbaa101={};var _0x218690={'count':0x0,'rows':[]};return db[_0x573f('0x3f')][_0x573f('0x58')]({'where':{'id':_0xfc3fc2[_0x573f('0x45')]['id']}})[_0x573f('0x23')](handleEntityNotFound(_0x3575d8,null))[_0x573f('0x23')](function(_0x5085ba){if(_0x5085ba){_0xbaa101[_0x573f('0x46')]=_[_0x573f('0x47')](db[_0x573f('0x61')]['rawAttributes']);_0xbaa101['query']=_['keys'](_0xfc3fc2[_0x573f('0x31')]);_0xbaa101[_0x573f('0x32')]=_[_0x573f('0x33')](_0xbaa101[_0x573f('0x46')],_0xbaa101[_0x573f('0x31')]);_0x128e5e['attributes']=_['intersection'](_0xbaa101['model'],qs[_0x573f('0x35')](_0xfc3fc2[_0x573f('0x31')]['fields']));_0x128e5e[_0x573f('0x34')]=_0x128e5e[_0x573f('0x34')][_0x573f('0x48')]?_0x128e5e[_0x573f('0x34')]:_0xbaa101[_0x573f('0x46')];if(!_0xfc3fc2['query'][_0x573f('0x36')]('nolimit')){_0x128e5e[_0x573f('0x1a')]=qs['limit'](_0xfc3fc2[_0x573f('0x31')][_0x573f('0x1a')]);_0x128e5e[_0x573f('0x18')]=qs[_0x573f('0x18')](_0xfc3fc2['query'][_0x573f('0x18')]);}_0x128e5e[_0x573f('0x5d')]=qs[_0x573f('0x38')](_0xfc3fc2[_0x573f('0x31')]['sort']);_0x128e5e[_0x573f('0x39')]=qs[_0x573f('0x32')](_['pick'](_0xfc3fc2[_0x573f('0x31')],_0xbaa101[_0x573f('0x32')]));_0x128e5e['where'][_0x573f('0x5a')]=_0x5085ba['id'];if(_0xfc3fc2[_0x573f('0x31')][_0x573f('0x3b')]){_0x128e5e[_0x573f('0x39')]=_['merge'](_0x128e5e['where'],{'$or':_[_0x573f('0x2c')](_0x128e5e[_0x573f('0x34')],function(_0xcfe444){var _0x128795={};_0x128795[_0xcfe444]={'$like':'%'+_0xfc3fc2['query'][_0x573f('0x3b')]+'%'};return _0x128795;})});}_0x128e5e=_[_0x573f('0x3c')]({},_0x128e5e,_0xfc3fc2[_0x573f('0x3e')]);return db[_0x573f('0x61')][_0x573f('0x1b')]({'where':_0x128e5e['where']})[_0x573f('0x23')](function(_0x5dc8e3){_0x218690[_0x573f('0x1b')]=_0x5dc8e3;if(_0xfc3fc2[_0x573f('0x31')][_0x573f('0x40')]){_0x128e5e['include']=[{'all':!![]}];}return db[_0x573f('0x61')][_0x573f('0x5e')](_0x128e5e);})[_0x573f('0x23')](function(_0xa72188){_0x218690['rows']=_0xa72188;return _0x218690;});}})['then'](respondWithFilteredResult(_0x3575d8,_0x128e5e))[_0x573f('0x43')](handleError(_0x3575d8,null));};exports[_0x573f('0x62')]=function(_0x41bbc3,_0x56be9d,_0x2f1e26){var _0x13570c={};var _0x18e428={};var _0x3563d2;var _0xe204a8;return db[_0x573f('0x3f')][_0x573f('0x58')]({'where':{'id':_0x41bbc3[_0x573f('0x45')]['id']}})[_0x573f('0x23')](handleEntityNotFound(_0x56be9d,null))[_0x573f('0x23')](function(_0x5d8b54){if(_0x5d8b54){_0x3563d2=_0x5d8b54;_0x18e428[_0x573f('0x46')]=_[_0x573f('0x47')](db[_0x573f('0x63')][_0x573f('0x2d')]);_0x18e428['query']=_['keys'](_0x41bbc3[_0x573f('0x31')]);_0x18e428[_0x573f('0x32')]=_['intersection'](_0x18e428[_0x573f('0x46')],_0x18e428[_0x573f('0x31')]);_0x13570c['attributes']=_[_0x573f('0x33')](_0x18e428[_0x573f('0x46')],qs[_0x573f('0x35')](_0x41bbc3[_0x573f('0x31')]['fields']));_0x13570c[_0x573f('0x34')]=_0x13570c[_0x573f('0x34')][_0x573f('0x48')]?_0x13570c[_0x573f('0x34')]:_0x18e428[_0x573f('0x46')];_0x13570c[_0x573f('0x5d')]=qs[_0x573f('0x38')](_0x41bbc3['query'][_0x573f('0x38')]);_0x13570c[_0x573f('0x39')]=qs[_0x573f('0x32')](_[_0x573f('0x3a')](_0x41bbc3['query'],_0x18e428[_0x573f('0x32')]));if(_0x41bbc3[_0x573f('0x31')][_0x573f('0x3b')]){_0x13570c[_0x573f('0x39')]=_['merge'](_0x13570c[_0x573f('0x39')],{'$or':_['map'](_0x13570c[_0x573f('0x34')],function(_0xcd5358){var _0x28b296={};_0x28b296[_0xcd5358]={'$like':'%'+_0x41bbc3['query'][_0x573f('0x3b')]+'%'};return _0x28b296;})});}_0x13570c=_[_0x573f('0x3c')]({},_0x13570c,_0x41bbc3[_0x573f('0x3e')]);return _0x3563d2[_0x573f('0x62')](_0x13570c);}})[_0x573f('0x23')](function(_0xf32878){if(_0xf32878){_0xe204a8=_0xf32878[_0x573f('0x48')];if(!_0x41bbc3[_0x573f('0x31')][_0x573f('0x36')](_0x573f('0x37'))){_0x13570c[_0x573f('0x1a')]=qs[_0x573f('0x1a')](_0x41bbc3[_0x573f('0x31')][_0x573f('0x1a')]);_0x13570c[_0x573f('0x18')]=qs[_0x573f('0x18')](_0x41bbc3[_0x573f('0x31')][_0x573f('0x18')]);}return _0x3563d2[_0x573f('0x62')](_0x13570c);}})['then'](function(_0x465ac6){if(_0x465ac6){return _0x465ac6?{'count':_0xe204a8,'rows':_0x465ac6}:null;}})[_0x573f('0x23')](respondWithResult(_0x56be9d,null))[_0x573f('0x43')](handleError(_0x56be9d,null));};exports[_0x573f('0x64')]=function(_0x2403a7,_0x332267,_0x2a19da){var _0x224bbf,_0x35454d;var _0x23d4c7=[];var _0x3edbeb=moment()['format'](_0x573f('0x65'));return db[_0x573f('0x3f')][_0x573f('0x4f')]({'where':{'id':_0x2403a7[_0x573f('0x45')]['id']}})[_0x573f('0x23')](handleEntityNotFound(_0x332267,null))[_0x573f('0x23')](function(_0x4f68dc){if(_0x4f68dc){_0x35454d=_0x4f68dc;return _0x4f68dc[_0x573f('0x64')](_0x2403a7['body'][_0x573f('0x66')],_['omit'](_0x2403a7[_0x573f('0x56')],['ids','id'])||{});}return null;})['spread'](function(_0x283a08){var _0x45dd87;var _0x2d7348;_0x224bbf=_0x283a08||[];var _0x21ddd8=[];if(_0x283a08){for(var _0x33e6ea=0x0;_0x33e6ea<_0x283a08[_0x573f('0x48')];_0x33e6ea+=0x1){var _0x3f8f63=_0x283a08[_0x33e6ea]['get']({'plain':!![]});_0x35454d[_0x573f('0x67')]=_0x2403a7[_0x573f('0x56')][_0x573f('0x67')]?_0x2403a7[_0x573f('0x56')][_0x573f('0x67')]:_0x35454d[_0x573f('0x67')];switch(_0x35454d[_0x573f('0x67')]){case'always':_0x45dd87=squel[_0x573f('0x68')]()[_0x573f('0x69')](_0x573f('0x6a'))[_0x573f('0x6b')]([_0x573f('0x6c'),_0x573f('0x6d'),'ContactId',_0x573f('0x6e'),_0x573f('0x5a'),_0x573f('0x54'),'updatedAt'],squel[_0x573f('0x6f')]()[_0x573f('0x70')](_0x573f('0x6c'),_0x573f('0x6c'))['field'](_0x573f('0x71'),'scheduledAt')[_0x573f('0x70')]('id',_0x573f('0x72'))['field'](_0x3f8f63[_0x573f('0x73')][_0x573f('0x74')](),'ListId')[_0x573f('0x70')](_0x2403a7[_0x573f('0x45')]['id'][_0x573f('0x74')](),_0x573f('0x5a'))[_0x573f('0x70')]('\x27'+_0x3edbeb+'\x27',_0x573f('0x54'))[_0x573f('0x70')]('\x27'+_0x3edbeb+'\x27',_0x573f('0x55'))[_0x573f('0x75')](_0x573f('0x76'))[_0x573f('0x39')](_0x573f('0x77'))[_0x573f('0x39')](_0x573f('0x78'),_0x3f8f63[_0x573f('0x73')][_0x573f('0x74')]())[_0x573f('0x39')]('phone\x20IS\x20NOT\x20NULL')[_0x573f('0x39')](_0x573f('0x79'),squel[_0x573f('0x6f')]()[_0x573f('0x70')](_0x573f('0x7a'))[_0x573f('0x75')](_0x573f('0x7b'))[_0x573f('0x39')]('CampaignId\x20=\x20?',_0x2403a7[_0x573f('0x45')]['id'][_0x573f('0x74')]()))[_0x573f('0x39')](_0x573f('0x79'),squel[_0x573f('0x6f')]()[_0x573f('0x70')](_0x573f('0x7c'))[_0x573f('0x75')](_0x573f('0x6a'))[_0x573f('0x39')](_0x573f('0x7d'),_0x2403a7['params']['id'][_0x573f('0x74')]())))[_0x573f('0x74')]();break;case _0x573f('0x7e'):_0x45dd87=squel[_0x573f('0x68')]()[_0x573f('0x69')](_0x573f('0x6a'))[_0x573f('0x6b')]([_0x573f('0x6c'),_0x573f('0x6d'),_0x573f('0x72'),'ListId',_0x573f('0x5a'),'createdAt',_0x573f('0x55')],squel[_0x573f('0x6f')]()[_0x573f('0x70')]('phone',_0x573f('0x6c'))[_0x573f('0x70')](_0x573f('0x71'),'scheduledAt')[_0x573f('0x70')]('id','ContactId')[_0x573f('0x70')](_0x3f8f63[_0x573f('0x73')]['toString'](),_0x573f('0x6e'))[_0x573f('0x70')](_0x2403a7[_0x573f('0x45')]['id']['toString'](),_0x573f('0x5a'))[_0x573f('0x70')]('\x27'+_0x3edbeb+'\x27','createdAt')['field']('\x27'+_0x3edbeb+'\x27',_0x573f('0x55'))[_0x573f('0x75')](_0x573f('0x76'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x573f('0x78'),_0x3f8f63['CmListId']['toString']())[_0x573f('0x39')](_0x573f('0x7f'))[_0x573f('0x39')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x573f('0x70')](_0x573f('0x7c'))[_0x573f('0x75')]('cm_hopper')[_0x573f('0x39')](_0x573f('0x7d'),_0x2403a7[_0x573f('0x45')]['id'][_0x573f('0x74')]())))[_0x573f('0x74')]();break;default:_0x45dd87=squel[_0x573f('0x68')]()['into'](_0x573f('0x6a'))[_0x573f('0x6b')]([_0x573f('0x6c'),_0x573f('0x6d'),_0x573f('0x72'),_0x573f('0x6e'),_0x573f('0x5a'),'createdAt','updatedAt'],squel[_0x573f('0x6f')]()[_0x573f('0x70')](_0x573f('0x6c'),_0x573f('0x6c'))['field']('NOW()',_0x573f('0x6d'))[_0x573f('0x70')]('id','ContactId')[_0x573f('0x70')](_0x3f8f63[_0x573f('0x73')]['toString'](),_0x573f('0x6e'))['field'](_0x2403a7[_0x573f('0x45')]['id']['toString'](),'CampaignId')[_0x573f('0x70')]('\x27'+_0x3edbeb+'\x27','createdAt')[_0x573f('0x70')]('\x27'+_0x3edbeb+'\x27','updatedAt')[_0x573f('0x75')](_0x573f('0x76'))[_0x573f('0x39')]('deletedAt\x20IS\x20NULL')[_0x573f('0x39')](_0x573f('0x78'),_0x3f8f63['CmListId'][_0x573f('0x74')]())[_0x573f('0x39')](_0x573f('0x7f')))[_0x573f('0x74')]();}_0x2d7348=squel[_0x573f('0x68')]()[_0x573f('0x69')](_0x573f('0x80'))[_0x573f('0x6b')]([_0x573f('0x81'),_0x573f('0x6d'),'phone',_0x573f('0x82'),_0x573f('0x54'),_0x573f('0x55')],squel[_0x573f('0x6f')]()['field']('h.id','id')[_0x573f('0x70')]('NOW()',_0x573f('0x6d'))[_0x573f('0x70')](_0x573f('0x83'),_0x573f('0x6c'))[_0x573f('0x70')](_0x573f('0x84'),_0x573f('0x82'))[_0x573f('0x70')]('\x27'+_0x3edbeb+'\x27',_0x573f('0x54'))[_0x573f('0x70')]('\x27'+_0x3edbeb+'\x27',_0x573f('0x55'))[_0x573f('0x75')](_0x573f('0x85'),'ci')[_0x573f('0x86')](_0x573f('0x6a'),'h',_0x573f('0x87'))['where'](_0x573f('0x88'),_0x3f8f63[_0x573f('0x73')][_0x573f('0x74')]())[_0x573f('0x39')](_0x573f('0x89'),_0x2403a7[_0x573f('0x45')]['id'][_0x573f('0x74')]())[_0x573f('0x39')]('h.createdAt\x20=\x20?',_0x3edbeb))['toString']();_0x21ddd8[_0x573f('0x8a')](db[_0x573f('0x8b')]['query'](_0x45dd87));_0x23d4c7[_0x573f('0x8a')](db[_0x573f('0x8b')][_0x573f('0x31')](_0x2d7348));}return BPromise[_0x573f('0x8c')](_0x21ddd8);}})[_0x573f('0x23')](function(){return BPromise['all'](_0x23d4c7);})[_0x573f('0x23')](function(){return _0x224bbf;})['then'](respondWithResult(_0x332267,null))[_0x573f('0x43')](handleError(_0x332267,null));};exports[_0x573f('0x8d')]=function(_0x430a94,_0x2423fe,_0xc60e2c){return db[_0x573f('0x3f')][_0x573f('0x4f')]({'where':{'id':_0x430a94['params']['id']}})[_0x573f('0x23')](handleEntityNotFound(_0x2423fe,null))['then'](function(_0x5b8aae){if(_0x5b8aae){return _0x5b8aae['removeLists'](_0x430a94['query'][_0x573f('0x66')]);}})[_0x573f('0x23')](function(_0xcee634){if(_0xcee634){return db[_0x573f('0x59')]['destroy']({'where':{'ListId':_0x430a94[_0x573f('0x31')][_0x573f('0x66')],'CampaignId':_0x430a94[_0x573f('0x45')]['id']}})[_0x573f('0x23')](function(){return _0xcee634;});}})[_0x573f('0x23')](respondWithStatusCode(_0x2423fe,null))[_0x573f('0x43')](handleError(_0x2423fe,null));};exports[_0x573f('0x8e')]=function(_0x217efc,_0x2837d1,_0xbbf98c){var _0x205171={};var _0x2c2f30={};var _0x2e65a9;var _0x3bbca8;return db[_0x573f('0x3f')]['findOne']({'where':{'id':_0x217efc[_0x573f('0x45')]['id']}})[_0x573f('0x23')](handleEntityNotFound(_0x2837d1,null))[_0x573f('0x23')](function(_0x4e10f8){if(_0x4e10f8){_0x2e65a9=_0x4e10f8;_0x2c2f30[_0x573f('0x46')]=_[_0x573f('0x47')](db['CmList'][_0x573f('0x2d')]);_0x2c2f30['query']=_[_0x573f('0x47')](_0x217efc['query']);_0x2c2f30['filters']=_[_0x573f('0x33')](_0x2c2f30[_0x573f('0x46')],_0x2c2f30[_0x573f('0x31')]);_0x205171[_0x573f('0x34')]=_[_0x573f('0x33')](_0x2c2f30['model'],qs[_0x573f('0x35')](_0x217efc[_0x573f('0x31')][_0x573f('0x35')]));_0x205171['attributes']=_0x205171[_0x573f('0x34')]['length']?_0x205171[_0x573f('0x34')]:_0x2c2f30['model'];_0x205171[_0x573f('0x5d')]=qs['sort'](_0x217efc[_0x573f('0x31')][_0x573f('0x38')]);_0x205171[_0x573f('0x39')]=qs[_0x573f('0x32')](_['pick'](_0x217efc[_0x573f('0x31')],_0x2c2f30['filters']));if(_0x217efc['query'][_0x573f('0x3b')]){_0x205171['where']=_['merge'](_0x205171[_0x573f('0x39')],{'$or':_[_0x573f('0x2c')](_0x205171[_0x573f('0x34')],function(_0x2c530b){var _0x1e18f8={};_0x1e18f8[_0x2c530b]={'$like':'%'+_0x217efc[_0x573f('0x31')][_0x573f('0x3b')]+'%'};return _0x1e18f8;})});}_0x205171=_['merge']({},_0x205171,_0x217efc[_0x573f('0x3e')]);return _0x2e65a9[_0x573f('0x8e')](_0x205171);}})[_0x573f('0x23')](function(_0x41c056){if(_0x41c056){_0x3bbca8=_0x41c056[_0x573f('0x48')];if(!_0x217efc['query'][_0x573f('0x36')](_0x573f('0x37'))){_0x205171[_0x573f('0x1a')]=qs['limit'](_0x217efc[_0x573f('0x31')][_0x573f('0x1a')]);_0x205171['offset']=qs[_0x573f('0x18')](_0x217efc['query'][_0x573f('0x18')]);}return _0x2e65a9[_0x573f('0x8e')](_0x205171);}})[_0x573f('0x23')](function(_0x3855d8){if(_0x3855d8){return _0x3855d8?{'count':_0x3bbca8,'rows':_0x3855d8}:null;}})[_0x573f('0x23')](respondWithResult(_0x2837d1,null))['catch'](handleError(_0x2837d1,null));};exports['addBlackLists']=function(_0x523e0d,_0x4ffd05,_0x19fb3f){var _0x3b0ec9,_0x349964;var _0x5fba85=[];var _0x4f4f4e=moment()[_0x573f('0x8f')](_0x573f('0x65'));return db[_0x573f('0x3f')]['find']({'where':{'id':_0x523e0d[_0x573f('0x45')]['id']}})[_0x573f('0x23')](handleEntityNotFound(_0x4ffd05,null))[_0x573f('0x23')](function(_0x5eff84){if(_0x5eff84){_0x349964=_0x5eff84;return _0x5eff84[_0x573f('0x90')](_0x523e0d[_0x573f('0x56')]['ids'],_['omit'](_0x523e0d['body'],[_0x573f('0x66'),'id'])||{});}return null;})[_0x573f('0x91')](function(_0x32e46d){var _0x1936b1;var _0x47a17c;_0x3b0ec9=_0x32e46d||[];var _0xd840d5=[];if(_0x32e46d){for(var _0x4d1bbe=0x0;_0x4d1bbe<_0x32e46d[_0x573f('0x48')];_0x4d1bbe+=0x1){var _0x1d019e=_0x32e46d[_0x4d1bbe][_0x573f('0x4d')]({'plain':!![]});_0x1936b1=squel[_0x573f('0x68')]()[_0x573f('0x69')](_0x573f('0x92'))[_0x573f('0x6b')]([_0x573f('0x6c'),_0x573f('0x72'),_0x573f('0x6e'),'CampaignId',_0x573f('0x54'),_0x573f('0x55')],squel[_0x573f('0x6f')]()[_0x573f('0x70')](_0x573f('0x6c'),'phone')[_0x573f('0x70')]('id',_0x573f('0x72'))['field'](_0x1d019e[_0x573f('0x73')][_0x573f('0x74')](),_0x573f('0x6e'))[_0x573f('0x70')](_0x523e0d['params']['id'][_0x573f('0x74')](),_0x573f('0x5a'))[_0x573f('0x70')](_0x573f('0x71'),_0x573f('0x54'))[_0x573f('0x70')](_0x573f('0x71'),_0x573f('0x55'))['from'](_0x573f('0x76'))['where'](_0x573f('0x77'))[_0x573f('0x39')](_0x573f('0x78'),_0x1d019e['CmListId'][_0x573f('0x74')]())[_0x573f('0x39')](_0x573f('0x7f')))[_0x573f('0x74')]();_0xd840d5[_0x573f('0x8a')](db[_0x573f('0x8b')][_0x573f('0x31')](_0x1936b1));}return BPromise[_0x573f('0x8c')](_0xd840d5);}})[_0x573f('0x23')](function(){return _0x3b0ec9;})[_0x573f('0x23')](respondWithResult(_0x4ffd05,null))[_0x573f('0x43')](handleError(_0x4ffd05,null));};exports[_0x573f('0x93')]=function(_0x162d57,_0x4b2e4d,_0xe52833){return db['Campaign'][_0x573f('0x4f')]({'where':{'id':_0x162d57[_0x573f('0x45')]['id']}})[_0x573f('0x23')](handleEntityNotFound(_0x4b2e4d,null))[_0x573f('0x23')](function(_0x277321){if(_0x277321){return _0x277321['removeBlackLists'](_0x162d57[_0x573f('0x31')][_0x573f('0x66')]);}})[_0x573f('0x23')](function(_0x56d0d0){if(_0x56d0d0){return db['CmHopperBlack'][_0x573f('0x24')]({'where':{'ListId':_0x162d57[_0x573f('0x31')][_0x573f('0x66')],'CampaignId':_0x162d57[_0x573f('0x45')]['id']}})[_0x573f('0x23')](function(){return _0x56d0d0;});}})[_0x573f('0x23')](respondWithStatusCode(_0x4b2e4d,null))[_0x573f('0x43')](handleError(_0x4b2e4d,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 29ecc5a..fd47691 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(_0x442d25,_0x53c66b){var _0x14fb3d=function(_0x9cd927){while(--_0x9cd927){_0x442d25['push'](_0x442d25['shift']());}};_0x14fb3d(++_0x53c66b);}(_0x7a54,0x106));var _0x47a5=function(_0x56b3bb,_0x2a51e4){_0x56b3bb=_0x56b3bb-0x0;var _0x17831e=_0x7a54[_0x56b3bb];return _0x17831e;};'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(_0x3c19ca,_0x131d1c){var _0x425bee=function(_0x463ae3){while(--_0x463ae3){_0x3c19ca['push'](_0x3c19ca['shift']());}};_0x425bee(++_0x131d1c);}(_0x7a54,0x106));var _0x47a5=function(_0x1654d1,_0x425511){_0x1654d1=_0x1654d1-0x0;var _0x144d90=_0x7a54[_0x1654d1];return _0x144d90;};'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 07f8611..55964bf 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 _0xa8a8=['Campaign,\x20%s,\x20%s','message','catch','Campaign','findAll','where','options','attributes','limit','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xa8a8,0xec));var _0x8a8a=function(_0x320d7f,_0x3ac648){_0x320d7f=_0x320d7f-0x0;var _0xf7dc0f=_0xa8a8[_0x320d7f];return _0xf7dc0f;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var BPromise=require(_0x8a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a8a('0x4'));var db=require(_0x8a8a('0x5'))['db'];var utils=require(_0x8a8a('0x6'));var logger=require(_0x8a8a('0x7'))(_0x8a8a('0x8'));var config=require(_0x8a8a('0x9'));var jayson=require(_0x8a8a('0xa'));var client=jayson[_0x8a8a('0xb')][_0x8a8a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x315fe9,_0x1d7121,_0x8e7aa0){return new BPromise(function(_0x4225b9,_0xecaa6f){return client[_0x8a8a('0xd')](_0x315fe9,_0x8e7aa0)['then'](function(_0x576ef9){logger[_0x8a8a('0xe')]('Campaign,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));logger[_0x8a8a('0x10')]('Campaign,\x20%s,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'),JSON[_0x8a8a('0x11')](_0x576ef9));if(_0x576ef9[_0x8a8a('0x12')]){if(_0x576ef9['error'][_0x8a8a('0x13')]===0x1f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')]['message']);return _0xecaa6f(_0x576ef9[_0x8a8a('0x12')]['message']);}logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);return _0x4225b9(_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);}else{logger[_0x8a8a('0xe')]('Campaign,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));_0x4225b9(_0x576ef9['result'][_0x8a8a('0x15')]);}})[_0x8a8a('0x16')](function(_0x46a4f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x46a4f4);_0xecaa6f(_0x46a4f4);});});}exports['GetCampaign']=function(_0x9d55f9){var _0x3d165c=this;return new Promise(function(_0x262ca9,_0x2bce13){return db[_0x8a8a('0x17')][_0x8a8a('0x18')]({'raw':_0x9d55f9['options']?_0x9d55f9['options']['raw']===undefined?!![]:![]:!![],'where':_0x9d55f9['options']?_0x9d55f9['options'][_0x8a8a('0x19')]||null:null,'attributes':_0x9d55f9[_0x8a8a('0x1a')]?_0x9d55f9[_0x8a8a('0x1a')][_0x8a8a('0x1b')]||null:null,'limit':_0x9d55f9[_0x8a8a('0x1a')]?_0x9d55f9[_0x8a8a('0x1a')][_0x8a8a('0x1c')]||null:null,'include':_0x9d55f9[_0x8a8a('0x1a')]?_0x9d55f9[_0x8a8a('0x1a')][_0x8a8a('0x1d')]?_[_0x8a8a('0x1e')](_0x9d55f9[_0x8a8a('0x1a')][_0x8a8a('0x1d')],function(_0x625c1b){return{'model':db[_0x625c1b[_0x8a8a('0x1f')]],'as':_0x625c1b['as'],'attributes':_0x625c1b['attributes'],'include':_0x625c1b[_0x8a8a('0x1d')]?_[_0x8a8a('0x1e')](_0x625c1b[_0x8a8a('0x1d')],function(_0x7662e){return{'model':db[_0x7662e[_0x8a8a('0x1f')]],'as':_0x7662e['as'],'attributes':_0x7662e[_0x8a8a('0x1b')],'include':_0x7662e[_0x8a8a('0x1d')]?_['map'](_0x7662e[_0x8a8a('0x1d')],function(_0x38c1e0){return{'model':db[_0x38c1e0[_0x8a8a('0x1f')]],'as':_0x38c1e0['as'],'attributes':_0x38c1e0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2dafcd){logger[_0x8a8a('0xe')]('GetCampaign',_0x9d55f9);logger['debug']('GetCampaign',_0x9d55f9,JSON[_0x8a8a('0x11')](_0x2dafcd));_0x262ca9(_0x2dafcd);})['catch'](function(_0x10b916){logger[_0x8a8a('0x12')]('GetCampaign',_0x10b916[_0x8a8a('0x15')],_0x9d55f9);_0x2bce13(_0x3d165c[_0x8a8a('0x12')](0x1f4,_0x10b916[_0x8a8a('0x15')]));});});};
\ No newline at end of file
+var _0xa44a=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','stringify','lodash'];(function(_0x461a37,_0x56b40e){var _0x2d740b=function(_0x3fd4d9){while(--_0x3fd4d9){_0x461a37['push'](_0x461a37['shift']());}};_0x2d740b(++_0x56b40e);}(_0xa44a,0x9a));var _0xaa44=function(_0x2262e7,_0x1c8a15){_0x2262e7=_0x2262e7-0x0;var _0x45bd84=_0xa44a[_0x2262e7];return _0x45bd84;};'use strict';var _=require(_0xaa44('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaa44('0x1'));var rs=require(_0xaa44('0x2'));var fs=require('fs');var Redis=require(_0xaa44('0x3'));var db=require(_0xaa44('0x4'))['db'];var utils=require(_0xaa44('0x5'));var logger=require(_0xaa44('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xaa44('0x7'));var client=jayson[_0xaa44('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x247589,_0x54b139,_0x3459c5){return new BPromise(function(_0x37cdeb,_0x513d81){return client[_0xaa44('0x9')](_0x247589,_0x3459c5)[_0xaa44('0xa')](function(_0x5f57d4){logger[_0xaa44('0xb')](_0xaa44('0xc'),_0x54b139,_0xaa44('0xd'));logger[_0xaa44('0xe')]('Campaign,\x20%s,\x20%s,\x20%s',_0x54b139,_0xaa44('0xd'),JSON['stringify'](_0x5f57d4));if(_0x5f57d4[_0xaa44('0xf')]){if(_0x5f57d4['error']['code']===0x1f4){logger['error'](_0xaa44('0xc'),_0x54b139,_0x5f57d4[_0xaa44('0xf')][_0xaa44('0x10')]);return _0x513d81(_0x5f57d4['error'][_0xaa44('0x10')]);}logger[_0xaa44('0xf')]('Campaign,\x20%s,\x20%s',_0x54b139,_0x5f57d4['error'][_0xaa44('0x10')]);return _0x37cdeb(_0x5f57d4[_0xaa44('0xf')]['message']);}else{logger['info'](_0xaa44('0xc'),_0x54b139,'request\x20sent');_0x37cdeb(_0x5f57d4[_0xaa44('0x11')]['message']);}})[_0xaa44('0x12')](function(_0x1c1514){logger[_0xaa44('0xf')](_0xaa44('0xc'),_0x54b139,_0x1c1514);_0x513d81(_0x1c1514);});});}exports[_0xaa44('0x13')]=function(_0x4b54cf){var _0x542595=this;return new Promise(function(_0x16fa2c,_0xa2fa67){return db[_0xaa44('0x14')][_0xaa44('0x15')]({'raw':_0x4b54cf[_0xaa44('0x16')]?_0x4b54cf[_0xaa44('0x16')][_0xaa44('0x17')]===undefined?!![]:![]:!![],'where':_0x4b54cf[_0xaa44('0x16')]?_0x4b54cf['options'][_0xaa44('0x18')]||null:null,'attributes':_0x4b54cf['options']?_0x4b54cf[_0xaa44('0x16')][_0xaa44('0x19')]||null:null,'limit':_0x4b54cf['options']?_0x4b54cf[_0xaa44('0x16')][_0xaa44('0x1a')]||null:null,'include':_0x4b54cf[_0xaa44('0x16')]?_0x4b54cf[_0xaa44('0x16')][_0xaa44('0x1b')]?_[_0xaa44('0x1c')](_0x4b54cf[_0xaa44('0x16')][_0xaa44('0x1b')],function(_0x17afa1){return{'model':db[_0x17afa1[_0xaa44('0x1d')]],'as':_0x17afa1['as'],'attributes':_0x17afa1['attributes'],'include':_0x17afa1[_0xaa44('0x1b')]?_[_0xaa44('0x1c')](_0x17afa1[_0xaa44('0x1b')],function(_0x39830b){return{'model':db[_0x39830b[_0xaa44('0x1d')]],'as':_0x39830b['as'],'attributes':_0x39830b[_0xaa44('0x19')],'include':_0x39830b[_0xaa44('0x1b')]?_['map'](_0x39830b[_0xaa44('0x1b')],function(_0x2b1941){return{'model':db[_0x2b1941[_0xaa44('0x1d')]],'as':_0x2b1941['as'],'attributes':_0x2b1941[_0xaa44('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x12fcca){logger[_0xaa44('0xb')](_0xaa44('0x13'),_0x4b54cf);logger[_0xaa44('0xe')](_0xaa44('0x13'),_0x4b54cf,JSON[_0xaa44('0x1e')](_0x12fcca));_0x16fa2c(_0x12fcca);})[_0xaa44('0x12')](function(_0x2b4e06){logger[_0xaa44('0xf')](_0xaa44('0x13'),_0x2b4e06[_0xaa44('0x10')],_0x4b54cf);_0xa2fa67(_0x542595['error'](0x1f4,_0x2b4e06[_0xaa44('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 39c6e8c..a8d5f98 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 _0x8e18=['/:id/lists','addLists','put','delete','destroy','removeLists','removeBlackLists','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/blacklists','getBlackLists','post','/:id/clone'];(function(_0x5460c8,_0x312bcc){var _0x2b8bc6=function(_0x5eefff){while(--_0x5eefff){_0x5460c8['push'](_0x5460c8['shift']());}};_0x2b8bc6(++_0x312bcc);}(_0x8e18,0x1ba));var _0x88e1=function(_0x55bc0b,_0x52d197){_0x55bc0b=_0x55bc0b-0x0;var _0x55141d=_0x8e18[_0x55bc0b];return _0x55141d;};'use strict';var multer=require('multer');var util=require(_0x88e1('0x0'));var path=require('path');var timeout=require(_0x88e1('0x1'));var express=require(_0x88e1('0x2'));var router=express[_0x88e1('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x88e1('0x4'));var config=require(_0x88e1('0x5'));var controller=require(_0x88e1('0x6'));router[_0x88e1('0x7')]('/',auth[_0x88e1('0x8')](),controller[_0x88e1('0x9')]);router[_0x88e1('0x7')](_0x88e1('0xa'),auth['isAuthenticated'](),controller[_0x88e1('0xb')]);router['get'](_0x88e1('0xc'),auth['isAuthenticated'](),controller[_0x88e1('0xd')]);router[_0x88e1('0x7')]('/:id/hopper_histories',auth[_0x88e1('0x8')](),controller[_0x88e1('0xe')]);router['get'](_0x88e1('0xf'),auth[_0x88e1('0x8')](),controller[_0x88e1('0x10')]);router[_0x88e1('0x7')](_0x88e1('0x11'),auth['isAuthenticated'](),controller[_0x88e1('0x12')]);router[_0x88e1('0x7')]('/:id/lists',auth[_0x88e1('0x8')](),controller['getLists']);router[_0x88e1('0x7')](_0x88e1('0x13'),auth[_0x88e1('0x8')](),controller[_0x88e1('0x14')]);router['post']('/',auth[_0x88e1('0x8')](),controller['create']);router[_0x88e1('0x15')](_0x88e1('0x16'),auth['isAuthenticated'](),controller['clone']);router[_0x88e1('0x15')](_0x88e1('0x17'),auth[_0x88e1('0x8')](),controller[_0x88e1('0x18')]);router[_0x88e1('0x15')](_0x88e1('0x13'),auth[_0x88e1('0x8')](),controller['addBlackLists']);router[_0x88e1('0x19')](_0x88e1('0xa'),auth[_0x88e1('0x8')](),controller['update']);router[_0x88e1('0x1a')](_0x88e1('0xa'),auth[_0x88e1('0x8')](),controller[_0x88e1('0x1b')]);router['delete'](_0x88e1('0x17'),auth['isAuthenticated'](),controller[_0x88e1('0x1c')]);router[_0x88e1('0x1a')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x88e1('0x1d')]);module[_0x88e1('0x1e')]=router;
\ No newline at end of file
+var _0x4a52=['post','create','/:id/clone','clone','addLists','/:id/blacklists','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists'];(function(_0x2fbf8f,_0x4720ff){var _0x36f428=function(_0x1c9c79){while(--_0x1c9c79){_0x2fbf8f['push'](_0x2fbf8f['shift']());}};_0x36f428(++_0x4720ff);}(_0x4a52,0x15e));var _0x24a5=function(_0x5201f1,_0x5a01e1){_0x5201f1=_0x5201f1-0x0;var _0x36a73a=_0x4a52[_0x5201f1];return _0x36a73a;};'use strict';var multer=require(_0x24a5('0x0'));var util=require(_0x24a5('0x1'));var path=require(_0x24a5('0x2'));var timeout=require(_0x24a5('0x3'));var express=require(_0x24a5('0x4'));var router=express['Router']();var fs_extra=require(_0x24a5('0x5'));var auth=require(_0x24a5('0x6'));var interaction=require(_0x24a5('0x7'));var config=require(_0x24a5('0x8'));var controller=require(_0x24a5('0x9'));router[_0x24a5('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x24a5('0xa')](_0x24a5('0xb'),auth[_0x24a5('0xc')](),controller[_0x24a5('0xd')]);router['get'](_0x24a5('0xe'),auth[_0x24a5('0xc')](),controller[_0x24a5('0xf')]);router[_0x24a5('0xa')]('/:id/hopper_histories',auth[_0x24a5('0xc')](),controller[_0x24a5('0x10')]);router[_0x24a5('0xa')](_0x24a5('0x11'),auth[_0x24a5('0xc')](),controller[_0x24a5('0x12')]);router['get'](_0x24a5('0x13'),auth[_0x24a5('0xc')](),controller[_0x24a5('0x14')]);router['get'](_0x24a5('0x15'),auth[_0x24a5('0xc')](),controller[_0x24a5('0x16')]);router['get']('/:id/blacklists',auth[_0x24a5('0xc')](),controller[_0x24a5('0x17')]);router[_0x24a5('0x18')]('/',auth[_0x24a5('0xc')](),controller[_0x24a5('0x19')]);router[_0x24a5('0x18')](_0x24a5('0x1a'),auth[_0x24a5('0xc')](),controller[_0x24a5('0x1b')]);router['post'](_0x24a5('0x15'),auth[_0x24a5('0xc')](),controller[_0x24a5('0x1c')]);router[_0x24a5('0x18')](_0x24a5('0x1d'),auth['isAuthenticated'](),controller['addBlackLists']);router[_0x24a5('0x1e')](_0x24a5('0xb'),auth[_0x24a5('0xc')](),controller[_0x24a5('0x1f')]);router[_0x24a5('0x20')](_0x24a5('0xb'),auth[_0x24a5('0xc')](),controller[_0x24a5('0x21')]);router[_0x24a5('0x20')](_0x24a5('0x15'),auth[_0x24a5('0xc')](),controller['removeLists']);router[_0x24a5('0x20')](_0x24a5('0x1d'),auth[_0x24a5('0xc')](),controller['removeBlackLists']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 16cbc6b..a6b04d3 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 _0xd4b4=['exports','STRING','getDataValue','key','sequelize'];(function(_0x9ef996,_0x4be935){var _0x491614=function(_0x362293){while(--_0x362293){_0x9ef996['push'](_0x9ef996['shift']());}};_0x491614(++_0x4be935);}(_0xd4b4,0x176));var _0x4d4b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd4b4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4d4b('0x0'));module[_0x4d4b('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x4d4b('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x4d4b('0x3')](_0x4d4b('0x4'));}}};
\ No newline at end of file
+var _0xa683=['getDataValue','exports','TEXT','STRING','VIRTUAL'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa683,0x14b));var _0x3a68=function(_0x13973f,_0x4d5e3b){_0x13973f=_0x13973f-0x0;var _0x499f77=_0xa683[_0x13973f];return _0x499f77;};'use strict';var Sequelize=require('sequelize');module[_0x3a68('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x3a68('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x3a68('0x2')]},'name':{'type':Sequelize[_0x3a68('0x3')],'get':function(){return this[_0x3a68('0x4')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 7dcd225..d8e6956 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 _0x7261=['attributes','fields','length','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','body','find','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','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/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','CannedAnswers','UserProfileResource','destroy','stack','name','map','CannedAnswer','fieldName','key','keys','filters','intersection','model','query'];(function(_0x1b9efc,_0x31bb67){var _0x1c9db0=function(_0x4c5a8d){while(--_0x4c5a8d){_0x1b9efc['push'](_0x1b9efc['shift']());}};_0x1c9db0(++_0x31bb67);}(_0x7261,0x176));var _0x1726=function(_0x38941d,_0x1b1b28){_0x38941d=_0x38941d-0x0;var _0x380991=_0x7261[_0x38941d];return _0x380991;};'use strict';var emlformat=require(_0x1726('0x0'));var rimraf=require(_0x1726('0x1'));var zipdir=require(_0x1726('0x2'));var jsonpatch=require(_0x1726('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1726('0x4'));var Mustache=require(_0x1726('0x5'));var util=require(_0x1726('0x6'));var path=require(_0x1726('0x7'));var sox=require('sox');var csv=require(_0x1726('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1726('0x9'));var squel=require(_0x1726('0xa'));var crypto=require(_0x1726('0xb'));var jsforce=require(_0x1726('0xc'));var deskjs=require(_0x1726('0xd'));var toCsv=require(_0x1726('0x8'));var querystring=require(_0x1726('0xe'));var Papa=require(_0x1726('0xf'));var Redis=require(_0x1726('0x10'));var authService=require(_0x1726('0x11'));var qs=require(_0x1726('0x12'));var as=require(_0x1726('0x13'));var hardwareService=require(_0x1726('0x14'));var logger=require(_0x1726('0x15'))(_0x1726('0x16'));var utils=require(_0x1726('0x17'));var config=require(_0x1726('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1726('0x19'))['db'];function respondWithStatusCode(_0x45bd8a,_0x593e0d){_0x593e0d=_0x593e0d||0xcc;return function(_0x2c6b4f){if(_0x2c6b4f){return _0x45bd8a[_0x1726('0x1a')](_0x593e0d);}return _0x45bd8a[_0x1726('0x1b')](_0x593e0d)[_0x1726('0x1c')]();};}function respondWithResult(_0x5bc43e,_0x453c80){_0x453c80=_0x453c80||0xc8;return function(_0x5ca910){if(_0x5ca910){return _0x5bc43e['status'](_0x453c80)[_0x1726('0x1d')](_0x5ca910);}};}function respondWithFilteredResult(_0x5611e7,_0x5e000a){return function(_0x2c580b){if(_0x2c580b){var _0x2f8c93=typeof _0x5e000a[_0x1726('0x1e')]===_0x1726('0x1f')&&typeof _0x5e000a['limit']===_0x1726('0x1f');var _0x9edb8e=_0x2c580b[_0x1726('0x20')];var _0xc453f3=_0x2f8c93?0x0:_0x5e000a[_0x1726('0x1e')];var _0x42b76e=_0x2f8c93?_0x2c580b[_0x1726('0x20')]:_0x5e000a['offset']+_0x5e000a[_0x1726('0x21')];var _0x1cccbd;if(_0x42b76e>=_0x9edb8e){_0x42b76e=_0x9edb8e;_0x1cccbd=0xc8;}else{_0x1cccbd=0xce;}_0x5611e7['status'](_0x1cccbd);return _0x5611e7[_0x1726('0x22')](_0x1726('0x23'),_0xc453f3+'-'+_0x42b76e+'/'+_0x9edb8e)[_0x1726('0x1d')](_0x2c580b);}return null;};}function patchUpdates(_0x1ec974){return function(_0xf56938){try{jsonpatch[_0x1726('0x24')](_0xf56938,_0x1ec974,!![]);}catch(_0x53dae4){return BPromise[_0x1726('0x25')](_0x53dae4);}return _0xf56938[_0x1726('0x26')]();};}function saveUpdates(_0x53e10a,_0x4f9cea){return function(_0x481aa6){if(_0x481aa6){return _0x481aa6[_0x1726('0x27')](_0x53e10a)[_0x1726('0x28')](function(_0x733f42){return _0x733f42;});}return null;};}function removeEntity(_0x2b0202,_0x59a03c){return function(_0x1adeaa){if(_0x1adeaa){return _0x1adeaa['destroy']()[_0x1726('0x28')](function(){var _0x53cc26=_0x1adeaa[_0x1726('0x29')]({'plain':!![]});var _0x5913f9=_0x1726('0x2a');return db[_0x1726('0x2b')][_0x1726('0x2c')]({'where':{'type':_0x5913f9,'resourceId':_0x53cc26['id']}})[_0x1726('0x28')](function(){return _0x1adeaa;});})[_0x1726('0x28')](function(){_0x2b0202[_0x1726('0x1b')](0xcc)[_0x1726('0x1c')]();});}};}function handleEntityNotFound(_0x360b64,_0x4d0bd2){return function(_0x1fbdde){if(!_0x1fbdde){_0x360b64[_0x1726('0x1a')](0x194);}return _0x1fbdde;};}function handleError(_0x5495dc,_0x487bc6){_0x487bc6=_0x487bc6||0x1f4;return function(_0x10d18a){logger['error'](_0x10d18a[_0x1726('0x2d')]);if(_0x10d18a[_0x1726('0x2e')]){delete _0x10d18a[_0x1726('0x2e')];}_0x5495dc[_0x1726('0x1b')](_0x487bc6)['send'](_0x10d18a);};}exports['index']=function(_0x3c5f5e,_0x22c6d8){var _0x57e119={},_0xac904b={},_0x2762cc={'count':0x0,'rows':[]};var _0x658bc0=_[_0x1726('0x2f')](db[_0x1726('0x30')]['rawAttributes'],function(_0x255f9){return{'name':_0x255f9[_0x1726('0x31')],'type':_0x255f9['type'][_0x1726('0x32')]};});_0xac904b['model']=_[_0x1726('0x2f')](_0x658bc0,_0x1726('0x2e'));_0xac904b['query']=_[_0x1726('0x33')](_0x3c5f5e['query']);_0xac904b[_0x1726('0x34')]=_[_0x1726('0x35')](_0xac904b[_0x1726('0x36')],_0xac904b[_0x1726('0x37')]);_0x57e119[_0x1726('0x38')]=_[_0x1726('0x35')](_0xac904b[_0x1726('0x36')],qs[_0x1726('0x39')](_0x3c5f5e[_0x1726('0x37')]['fields']));_0x57e119['attributes']=_0x57e119[_0x1726('0x38')][_0x1726('0x3a')]?_0x57e119[_0x1726('0x38')]:_0xac904b[_0x1726('0x36')];if(!_0x3c5f5e[_0x1726('0x37')]['hasOwnProperty']('nolimit')){_0x57e119[_0x1726('0x21')]=qs[_0x1726('0x21')](_0x3c5f5e[_0x1726('0x37')][_0x1726('0x21')]);_0x57e119[_0x1726('0x1e')]=qs['offset'](_0x3c5f5e[_0x1726('0x37')][_0x1726('0x1e')]);}_0x57e119[_0x1726('0x3b')]=qs[_0x1726('0x3c')](_0x3c5f5e[_0x1726('0x37')][_0x1726('0x3c')]);_0x57e119[_0x1726('0x3d')]=qs[_0x1726('0x34')](_['pick'](_0x3c5f5e[_0x1726('0x37')],_0xac904b[_0x1726('0x34')]),_0x658bc0);if(_0x3c5f5e[_0x1726('0x37')][_0x1726('0x3e')]){_0x57e119['where']=_[_0x1726('0x3f')](_0x57e119[_0x1726('0x3d')],{'$or':[{'key':{'$like':'%'+_0x3c5f5e[_0x1726('0x37')][_0x1726('0x3e')]+'%'}},{'value':{'$like':'%'+_0x3c5f5e[_0x1726('0x37')][_0x1726('0x3e')]+'%'}}]});}_0x57e119=_[_0x1726('0x3f')]({},_0x57e119,_0x3c5f5e[_0x1726('0x40')]);var _0x32f2e6={'where':_0x57e119['where']};return db[_0x1726('0x30')][_0x1726('0x20')](_0x32f2e6)['then'](function(_0x3440a4){_0x2762cc[_0x1726('0x20')]=_0x3440a4;if(_0x3c5f5e[_0x1726('0x37')][_0x1726('0x41')]){_0x57e119[_0x1726('0x42')]=[{'all':!![]}];}return db[_0x1726('0x30')][_0x1726('0x43')](_0x57e119);})['then'](function(_0x3d4371){_0x2762cc[_0x1726('0x44')]=_0x3d4371;return _0x2762cc;})[_0x1726('0x28')](respondWithFilteredResult(_0x22c6d8,_0x57e119))[_0x1726('0x45')](handleError(_0x22c6d8,null));};exports[_0x1726('0x46')]=function(_0x2015e8,_0x1767aa){var _0x54a170={'raw':!![],'where':{'id':_0x2015e8['params']['id']}},_0x1ed485={};_0x1ed485[_0x1726('0x36')]=_['keys'](db[_0x1726('0x30')][_0x1726('0x47')]);_0x1ed485[_0x1726('0x37')]=_[_0x1726('0x33')](_0x2015e8[_0x1726('0x37')]);_0x1ed485['filters']=_['intersection'](_0x1ed485[_0x1726('0x36')],_0x1ed485[_0x1726('0x37')]);_0x54a170[_0x1726('0x38')]=_[_0x1726('0x35')](_0x1ed485[_0x1726('0x36')],qs['fields'](_0x2015e8[_0x1726('0x37')][_0x1726('0x39')]));_0x54a170[_0x1726('0x38')]=_0x54a170['attributes'][_0x1726('0x3a')]?_0x54a170[_0x1726('0x38')]:_0x1ed485[_0x1726('0x36')];if(_0x2015e8['query']['includeAll']){_0x54a170['include']=[{'all':!![]}];}_0x54a170=_[_0x1726('0x3f')]({},_0x54a170,_0x2015e8[_0x1726('0x40')]);return db[_0x1726('0x30')]['find'](_0x54a170)['then'](handleEntityNotFound(_0x1767aa,null))['then'](respondWithResult(_0x1767aa,null))[_0x1726('0x45')](handleError(_0x1767aa,null));};exports[_0x1726('0x27')]=function(_0x554e84,_0x5d69ae){if(_0x554e84[_0x1726('0x48')]['id']){delete _0x554e84['body']['id'];}return db['CannedAnswer'][_0x1726('0x49')]({'where':{'id':_0x554e84[_0x1726('0x4a')]['id']}})[_0x1726('0x28')](handleEntityNotFound(_0x5d69ae,null))[_0x1726('0x28')](saveUpdates(_0x554e84['body'],null))[_0x1726('0x28')](respondWithResult(_0x5d69ae,null))[_0x1726('0x45')](handleError(_0x5d69ae,null));};exports[_0x1726('0x2c')]=function(_0x37a3c3,_0x424839){return db[_0x1726('0x30')][_0x1726('0x49')]({'where':{'id':_0x37a3c3[_0x1726('0x4a')]['id']}})[_0x1726('0x28')](handleEntityNotFound(_0x424839,null))['then'](removeEntity(_0x424839,null))[_0x1726('0x45')](handleError(_0x424839,null));};exports[_0x1726('0x4b')]=function(_0x114518,_0x272757){var _0x3d0722={'key':_0x114518[_0x1726('0x48')]['key']};if(_0x114518[_0x1726('0x48')][_0x1726('0x4c')]){_0x3d0722[_0x1726('0x4c')]=_0x114518[_0x1726('0x48')][_0x1726('0x4c')];}else if(_0x114518[_0x1726('0x48')][_0x1726('0x4d')]){_0x3d0722['SmsAccountId']=_0x114518['body'][_0x1726('0x4d')];}else if(_0x114518[_0x1726('0x48')][_0x1726('0x4e')]){_0x3d0722['OpenchannelAccountId']=_0x114518[_0x1726('0x48')]['OpenchannelAccountId'];}else if(_0x114518[_0x1726('0x48')][_0x1726('0x4f')]){_0x3d0722['ChatWebsiteId']=_0x114518[_0x1726('0x48')][_0x1726('0x4f')];}return db[_0x1726('0x30')][_0x1726('0x49')]({'where':_0x3d0722})['then'](function(_0x3a8741){if(_0x3a8741){throw new db['Sequelize']['ValidationError'](_0x1726('0x50'));}return db['CannedAnswer']['create'](_0x114518[_0x1726('0x48')]);})[_0x1726('0x28')](function(_0x1a5075){var _0x35a92d=_0x114518['user']['get']({'plain':!![]});if(!_0x35a92d)throw new Error(_0x1726('0x51'));if(_0x35a92d[_0x1726('0x52')]===_0x1726('0x53')){var _0x250ccb=_0x1a5075[_0x1726('0x29')]({'plain':!![]});return db['UserProfileSection'][_0x1726('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x35a92d['userProfileId']},'raw':!![]})[_0x1726('0x28')](function(_0x172a2f){if(_0x172a2f&&_0x172a2f[_0x1726('0x54')]===0x0){return db[_0x1726('0x2b')]['create']({'name':_0x250ccb[_0x1726('0x2e')],'resourceId':_0x250ccb['id'],'type':_0x172a2f['name'],'sectionId':_0x172a2f['id']},{})[_0x1726('0x28')](function(){return _0x1a5075;});}else{return _0x1a5075;}})['catch'](function(_0x822678){logger['error'](_0x1726('0x55'),_0x822678);throw _0x822678;});}return _0x1a5075;})[_0x1726('0x28')](respondWithResult(_0x272757,0xc9))[_0x1726('0x45')](handleError(_0x272757,null));};
\ No newline at end of file
+var _0xb2ec=['name','send','map','CannedAnswer','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','catch','show','options','find','body','params','destroy','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','update','then','get','CannedAnswers','error','stack'];(function(_0x58a4ac,_0x43fd42){var _0x545810=function(_0x308e65){while(--_0x308e65){_0x58a4ac['push'](_0x58a4ac['shift']());}};_0x545810(++_0x43fd42);}(_0xb2ec,0x86));var _0xcb2e=function(_0x2d7e98,_0x10de4e){_0x2d7e98=_0x2d7e98-0x0;var _0x212be6=_0xb2ec[_0x2d7e98];return _0x212be6;};'use strict';var emlformat=require(_0xcb2e('0x0'));var rimraf=require(_0xcb2e('0x1'));var zipdir=require(_0xcb2e('0x2'));var jsonpatch=require(_0xcb2e('0x3'));var rp=require(_0xcb2e('0x4'));var moment=require(_0xcb2e('0x5'));var BPromise=require(_0xcb2e('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcb2e('0x7'));var sox=require(_0xcb2e('0x8'));var csv=require('to-csv');var ejs=require(_0xcb2e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcb2e('0xa'));var squel=require(_0xcb2e('0xb'));var crypto=require(_0xcb2e('0xc'));var jsforce=require(_0xcb2e('0xd'));var deskjs=require(_0xcb2e('0xe'));var toCsv=require(_0xcb2e('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcb2e('0x10'));var authService=require(_0xcb2e('0x11'));var qs=require(_0xcb2e('0x12'));var as=require(_0xcb2e('0x13'));var hardwareService=require(_0xcb2e('0x14'));var logger=require(_0xcb2e('0x15'))(_0xcb2e('0x16'));var utils=require(_0xcb2e('0x17'));var config=require(_0xcb2e('0x18'));var licenseUtil=require(_0xcb2e('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4425af,_0x12e490){_0x12e490=_0x12e490||0xcc;return function(_0x37fa1b){if(_0x37fa1b){return _0x4425af[_0xcb2e('0x1a')](_0x12e490);}return _0x4425af[_0xcb2e('0x1b')](_0x12e490)[_0xcb2e('0x1c')]();};}function respondWithResult(_0x5d02e1,_0x4f11ae){_0x4f11ae=_0x4f11ae||0xc8;return function(_0x470b35){if(_0x470b35){return _0x5d02e1[_0xcb2e('0x1b')](_0x4f11ae)[_0xcb2e('0x1d')](_0x470b35);}};}function respondWithFilteredResult(_0x1b0e30,_0x57e6da){return function(_0x277e72){if(_0x277e72){var _0x10cf08=typeof _0x57e6da[_0xcb2e('0x1e')]==='undefined'&&typeof _0x57e6da[_0xcb2e('0x1f')]===_0xcb2e('0x20');var _0x5933f3=_0x277e72[_0xcb2e('0x21')];var _0x48659d=_0x10cf08?0x0:_0x57e6da[_0xcb2e('0x1e')];var _0x4cbbf1=_0x10cf08?_0x277e72[_0xcb2e('0x21')]:_0x57e6da[_0xcb2e('0x1e')]+_0x57e6da['limit'];var _0x4bc027;if(_0x4cbbf1>=_0x5933f3){_0x4cbbf1=_0x5933f3;_0x4bc027=0xc8;}else{_0x4bc027=0xce;}_0x1b0e30['status'](_0x4bc027);return _0x1b0e30['set']('Content-Range',_0x48659d+'-'+_0x4cbbf1+'/'+_0x5933f3)[_0xcb2e('0x1d')](_0x277e72);}return null;};}function patchUpdates(_0x5f21d0){return function(_0x23b3b1){try{jsonpatch[_0xcb2e('0x22')](_0x23b3b1,_0x5f21d0,!![]);}catch(_0x3e6d5d){return BPromise[_0xcb2e('0x23')](_0x3e6d5d);}return _0x23b3b1['save']();};}function saveUpdates(_0x4f7378,_0x240eb5){return function(_0x1306d0){if(_0x1306d0){return _0x1306d0[_0xcb2e('0x24')](_0x4f7378)['then'](function(_0x2d7f40){return _0x2d7f40;});}return null;};}function removeEntity(_0x2bfa10,_0x27a67d){return function(_0x48e3aa){if(_0x48e3aa){return _0x48e3aa['destroy']()[_0xcb2e('0x25')](function(){var _0x150222=_0x48e3aa[_0xcb2e('0x26')]({'plain':!![]});var _0x48b74d=_0xcb2e('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x48b74d,'resourceId':_0x150222['id']}})[_0xcb2e('0x25')](function(){return _0x48e3aa;});})[_0xcb2e('0x25')](function(){_0x2bfa10['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x26d133,_0x446438){return function(_0x29dcb6){if(!_0x29dcb6){_0x26d133[_0xcb2e('0x1a')](0x194);}return _0x29dcb6;};}function handleError(_0x4a9eb1,_0x6f9c6d){_0x6f9c6d=_0x6f9c6d||0x1f4;return function(_0xf551a1){logger[_0xcb2e('0x28')](_0xf551a1[_0xcb2e('0x29')]);if(_0xf551a1[_0xcb2e('0x2a')]){delete _0xf551a1[_0xcb2e('0x2a')];}_0x4a9eb1[_0xcb2e('0x1b')](_0x6f9c6d)[_0xcb2e('0x2b')](_0xf551a1);};}exports['index']=function(_0x210995,_0xa6e5e1){var _0x27aaf8={},_0x3f584a={},_0x5a4e0a={'count':0x0,'rows':[]};var _0x2dbb70=_[_0xcb2e('0x2c')](db[_0xcb2e('0x2d')][_0xcb2e('0x2e')],function(_0x1c0c44){return{'name':_0x1c0c44[_0xcb2e('0x2f')],'type':_0x1c0c44['type'][_0xcb2e('0x30')]};});_0x3f584a['model']=_['map'](_0x2dbb70,'name');_0x3f584a[_0xcb2e('0x31')]=_[_0xcb2e('0x32')](_0x210995['query']);_0x3f584a[_0xcb2e('0x33')]=_[_0xcb2e('0x34')](_0x3f584a[_0xcb2e('0x35')],_0x3f584a[_0xcb2e('0x31')]);_0x27aaf8[_0xcb2e('0x36')]=_['intersection'](_0x3f584a['model'],qs[_0xcb2e('0x37')](_0x210995[_0xcb2e('0x31')]['fields']));_0x27aaf8[_0xcb2e('0x36')]=_0x27aaf8[_0xcb2e('0x36')][_0xcb2e('0x38')]?_0x27aaf8[_0xcb2e('0x36')]:_0x3f584a[_0xcb2e('0x35')];if(!_0x210995[_0xcb2e('0x31')][_0xcb2e('0x39')](_0xcb2e('0x3a'))){_0x27aaf8[_0xcb2e('0x1f')]=qs[_0xcb2e('0x1f')](_0x210995[_0xcb2e('0x31')][_0xcb2e('0x1f')]);_0x27aaf8[_0xcb2e('0x1e')]=qs['offset'](_0x210995[_0xcb2e('0x31')][_0xcb2e('0x1e')]);}_0x27aaf8[_0xcb2e('0x3b')]=qs['sort'](_0x210995[_0xcb2e('0x31')][_0xcb2e('0x3c')]);_0x27aaf8[_0xcb2e('0x3d')]=qs[_0xcb2e('0x33')](_['pick'](_0x210995[_0xcb2e('0x31')],_0x3f584a['filters']),_0x2dbb70);if(_0x210995[_0xcb2e('0x31')][_0xcb2e('0x3e')]){_0x27aaf8['where']=_['merge'](_0x27aaf8['where'],{'$or':[{'key':{'$like':'%'+_0x210995['query'][_0xcb2e('0x3e')]+'%'}},{'value':{'$like':'%'+_0x210995['query']['filter']+'%'}}]});}_0x27aaf8=_[_0xcb2e('0x3f')]({},_0x27aaf8,_0x210995['options']);var _0x1d339e={'where':_0x27aaf8[_0xcb2e('0x3d')]};return db[_0xcb2e('0x2d')]['count'](_0x1d339e)[_0xcb2e('0x25')](function(_0x4eae17){_0x5a4e0a[_0xcb2e('0x21')]=_0x4eae17;if(_0x210995[_0xcb2e('0x31')][_0xcb2e('0x40')]){_0x27aaf8[_0xcb2e('0x41')]=[{'all':!![]}];}return db[_0xcb2e('0x2d')]['findAll'](_0x27aaf8);})[_0xcb2e('0x25')](function(_0x304b8e){_0x5a4e0a['rows']=_0x304b8e;return _0x5a4e0a;})[_0xcb2e('0x25')](respondWithFilteredResult(_0xa6e5e1,_0x27aaf8))[_0xcb2e('0x42')](handleError(_0xa6e5e1,null));};exports[_0xcb2e('0x43')]=function(_0x22bbf8,_0x54ffef){var _0x3ce8f0={'raw':!![],'where':{'id':_0x22bbf8['params']['id']}},_0x292852={};_0x292852[_0xcb2e('0x35')]=_[_0xcb2e('0x32')](db[_0xcb2e('0x2d')][_0xcb2e('0x2e')]);_0x292852[_0xcb2e('0x31')]=_['keys'](_0x22bbf8[_0xcb2e('0x31')]);_0x292852[_0xcb2e('0x33')]=_[_0xcb2e('0x34')](_0x292852[_0xcb2e('0x35')],_0x292852[_0xcb2e('0x31')]);_0x3ce8f0[_0xcb2e('0x36')]=_[_0xcb2e('0x34')](_0x292852[_0xcb2e('0x35')],qs[_0xcb2e('0x37')](_0x22bbf8[_0xcb2e('0x31')]['fields']));_0x3ce8f0[_0xcb2e('0x36')]=_0x3ce8f0[_0xcb2e('0x36')]['length']?_0x3ce8f0[_0xcb2e('0x36')]:_0x292852['model'];if(_0x22bbf8[_0xcb2e('0x31')][_0xcb2e('0x40')]){_0x3ce8f0[_0xcb2e('0x41')]=[{'all':!![]}];}_0x3ce8f0=_['merge']({},_0x3ce8f0,_0x22bbf8[_0xcb2e('0x44')]);return db[_0xcb2e('0x2d')][_0xcb2e('0x45')](_0x3ce8f0)[_0xcb2e('0x25')](handleEntityNotFound(_0x54ffef,null))['then'](respondWithResult(_0x54ffef,null))['catch'](handleError(_0x54ffef,null));};exports[_0xcb2e('0x24')]=function(_0x44c82b,_0x153c0e){if(_0x44c82b[_0xcb2e('0x46')]['id']){delete _0x44c82b[_0xcb2e('0x46')]['id'];}return db[_0xcb2e('0x2d')][_0xcb2e('0x45')]({'where':{'id':_0x44c82b[_0xcb2e('0x47')]['id']}})['then'](handleEntityNotFound(_0x153c0e,null))[_0xcb2e('0x25')](saveUpdates(_0x44c82b['body'],null))['then'](respondWithResult(_0x153c0e,null))['catch'](handleError(_0x153c0e,null));};exports[_0xcb2e('0x48')]=function(_0x16c546,_0x5a8e2d){return db['CannedAnswer']['find']({'where':{'id':_0x16c546[_0xcb2e('0x47')]['id']}})[_0xcb2e('0x25')](handleEntityNotFound(_0x5a8e2d,null))[_0xcb2e('0x25')](removeEntity(_0x5a8e2d,null))['catch'](handleError(_0x5a8e2d,null));};exports[_0xcb2e('0x49')]=function(_0xa7433b,_0x5773ad){var _0x367a5b={'key':_0xa7433b[_0xcb2e('0x46')][_0xcb2e('0x30')]};if(_0xa7433b[_0xcb2e('0x46')]['MailAccountId']){_0x367a5b[_0xcb2e('0x4a')]=_0xa7433b[_0xcb2e('0x46')][_0xcb2e('0x4a')];}else if(_0xa7433b[_0xcb2e('0x46')][_0xcb2e('0x4b')]){_0x367a5b['SmsAccountId']=_0xa7433b[_0xcb2e('0x46')][_0xcb2e('0x4b')];}else if(_0xa7433b[_0xcb2e('0x46')][_0xcb2e('0x4c')]){_0x367a5b['OpenchannelAccountId']=_0xa7433b[_0xcb2e('0x46')][_0xcb2e('0x4c')];}else if(_0xa7433b[_0xcb2e('0x46')]['ChatWebsiteId']){_0x367a5b['ChatWebsiteId']=_0xa7433b[_0xcb2e('0x46')][_0xcb2e('0x4d')];}return db[_0xcb2e('0x2d')]['find']({'where':_0x367a5b})[_0xcb2e('0x25')](function(_0x185169){if(_0x185169){throw new db[(_0xcb2e('0x4e'))][(_0xcb2e('0x4f'))](_0xcb2e('0x50'));}return db['CannedAnswer']['create'](_0xa7433b[_0xcb2e('0x46')]);})[_0xcb2e('0x25')](function(_0x1103d6){var _0x4c5c06=_0xa7433b['user'][_0xcb2e('0x26')]({'plain':!![]});if(!_0x4c5c06)throw new Error(_0xcb2e('0x51'));if(_0x4c5c06['role']===_0xcb2e('0x52')){var _0x6e9bbc=_0x1103d6[_0xcb2e('0x26')]({'plain':!![]});return db[_0xcb2e('0x53')][_0xcb2e('0x45')]({'where':{'name':_0xcb2e('0x27'),'userProfileId':_0x4c5c06[_0xcb2e('0x54')]},'raw':!![]})['then'](function(_0x28d4d3){if(_0x28d4d3&&_0x28d4d3[_0xcb2e('0x55')]===0x0){return db[_0xcb2e('0x56')][_0xcb2e('0x49')]({'name':_0x6e9bbc['name'],'resourceId':_0x6e9bbc['id'],'type':_0x28d4d3[_0xcb2e('0x2a')],'sectionId':_0x28d4d3['id']},{})['then'](function(){return _0x1103d6;});}else{return _0x1103d6;}})[_0xcb2e('0x42')](function(_0xd59100){logger['error'](_0xcb2e('0x57'),_0xd59100);throw _0xd59100;});}return _0x1103d6;})[_0xcb2e('0x25')](respondWithResult(_0x5773ad,0xc9))[_0xcb2e('0x42')](handleError(_0x5773ad,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 57ab9e1..155ebaf 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 _0xa359=['./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','util','moment','bluebird','request-promise','path'];(function(_0x358dcb,_0x46b304){var _0x321b74=function(_0x26bb47){while(--_0x26bb47){_0x358dcb['push'](_0x358dcb['shift']());}};_0x321b74(++_0x46b304);}(_0xa359,0xb6));var _0x9a35=function(_0x455d96,_0x310919){_0x455d96=_0x455d96-0x0;var _0x84b523=_0xa359[_0x455d96];return _0x84b523;};'use strict';var _=require('lodash');var util=require(_0x9a35('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x9a35('0x1'));var BPromise=require(_0x9a35('0x2'));var rp=require(_0x9a35('0x3'));var fs=require('fs');var path=require(_0x9a35('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9a35('0x5'));module[_0x9a35('0x6')]=function(_0x2a2264,_0x22bc97){return _0x2a2264[_0x9a35('0x7')](_0x9a35('0x8'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9a35('0x9'),'collate':_0x9a35('0xa')});};
\ No newline at end of file
+var _0xff07=['path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5adbcf,_0x4398a0){var _0x1f73b5=function(_0x1d29a1){while(--_0x1d29a1){_0x5adbcf['push'](_0x5adbcf['shift']());}};_0x1f73b5(++_0x4398a0);}(_0xff07,0x1ac));var _0x7ff0=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xff07[_0x5a776b];return _0xbbef59;};'use strict';var _=require(_0x7ff0('0x0'));var util=require(_0x7ff0('0x1'));var logger=require(_0x7ff0('0x2'))(_0x7ff0('0x3'));var moment=require(_0x7ff0('0x4'));var BPromise=require(_0x7ff0('0x5'));var rp=require(_0x7ff0('0x6'));var fs=require('fs');var path=require(_0x7ff0('0x7'));var rimraf=require(_0x7ff0('0x8'));var config=require(_0x7ff0('0x9'));var attributes=require(_0x7ff0('0xa'));module[_0x7ff0('0xb')]=function(_0x5bc19f,_0x26bf9a){return _0x5bc19f[_0x7ff0('0xc')](_0x7ff0('0xd'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7ff0('0xe')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 276302d..4501756 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(_0xbb6f43,_0x459bbf){var _0x48a780=function(_0x2b9e64){while(--_0x2b9e64){_0xbb6f43['push'](_0xbb6f43['shift']());}};_0x48a780(++_0x459bbf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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(_0x5d3767,_0x58eedc){var _0x57f2ea=function(_0x3cc4f6){while(--_0x3cc4f6){_0x5d3767['push'](_0x5d3767['shift']());}};_0x57f2ea(++_0x58eedc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 8d16c3e..b8cf3af 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 _0x680d=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x3edab6,_0xb15016){var _0xa8b6ae=function(_0x3596d2){while(--_0x3596d2){_0x3edab6['push'](_0x3edab6['shift']());}};_0xa8b6ae(++_0xb15016);}(_0x680d,0x79));var _0xd680=function(_0x57063b,_0x5ab441){_0x57063b=_0x57063b-0x0;var _0x5d22f8=_0x680d[_0x57063b];return _0x5d22f8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd680('0x0'));var timeout=require(_0xd680('0x1'));var express=require('express');var router=express[_0xd680('0x2')]();var fs_extra=require(_0xd680('0x3'));var auth=require(_0xd680('0x4'));var interaction=require(_0xd680('0x5'));var config=require(_0xd680('0x6'));var controller=require(_0xd680('0x7'));router[_0xd680('0x8')]('/',auth[_0xd680('0x9')](),controller['index']);router[_0xd680('0x8')](_0xd680('0xa'),auth['isAuthenticated'](),controller[_0xd680('0xb')]);router[_0xd680('0xc')]('/',auth[_0xd680('0x9')](),controller[_0xd680('0xd')]);router[_0xd680('0xe')](_0xd680('0xa'),auth[_0xd680('0x9')](),controller[_0xd680('0xf')]);router[_0xd680('0x10')](_0xd680('0xa'),auth[_0xd680('0x9')](),controller['destroy']);module[_0xd680('0x11')]=router;
\ No newline at end of file
+var _0xb371=['get','/:id','show','post','create','put','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x27e811,_0x20137c){var _0x1627fa=function(_0x4498ca){while(--_0x4498ca){_0x27e811['push'](_0x27e811['shift']());}};_0x1627fa(++_0x20137c);}(_0xb371,0x14d));var _0x1b37=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb371[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1b37('0x0'));var timeout=require(_0x1b37('0x1'));var express=require(_0x1b37('0x2'));var router=express[_0x1b37('0x3')]();var fs_extra=require(_0x1b37('0x4'));var auth=require(_0x1b37('0x5'));var interaction=require(_0x1b37('0x6'));var config=require(_0x1b37('0x7'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0x1b37('0x8')](),controller['index']);router[_0x1b37('0x9')](_0x1b37('0xa'),auth[_0x1b37('0x8')](),controller[_0x1b37('0xb')]);router[_0x1b37('0xc')]('/',auth[_0x1b37('0x8')](),controller[_0x1b37('0xd')]);router[_0x1b37('0xe')](_0x1b37('0xa'),auth['isAuthenticated'](),controller[_0x1b37('0xf')]);router['delete'](_0x1b37('0xa'),auth['isAuthenticated'](),controller[_0x1b37('0x10')]);module[_0x1b37('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 69a9dc0..102e05d 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 _0xd110=['DATE','STRING','INTEGER','sequelize','exports'];(function(_0x5200b9,_0x22ca30){var _0x2de02d=function(_0x220142){while(--_0x220142){_0x5200b9['push'](_0x5200b9['shift']());}};_0x2de02d(++_0x22ca30);}(_0xd110,0x1e8));var _0x0d11=function(_0x5f2575,_0x21d1cb){_0x5f2575=_0x5f2575-0x0;var _0x1b845f=_0xd110[_0x5f2575];return _0x1b845f;};'use strict';var Sequelize=require(_0x0d11('0x0'));module[_0x0d11('0x1')]={'calldate':{'type':Sequelize[_0x0d11('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x0d11('0x3')]},'src':{'type':Sequelize[_0x0d11('0x3')]},'dst':{'type':Sequelize[_0x0d11('0x3')]},'dcontext':{'type':Sequelize[_0x0d11('0x3')]},'channel':{'type':Sequelize[_0x0d11('0x3')]},'dstchannel':{'type':Sequelize[_0x0d11('0x3')]},'lastapp':{'type':Sequelize[_0x0d11('0x3')]},'lastdata':{'type':Sequelize[_0x0d11('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0d11('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x0d11('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x0d11('0x3')]},'linkedid':{'type':Sequelize[_0x0d11('0x3')]},'sequence':{'type':Sequelize[_0x0d11('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0d11('0x3')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xe235=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe235,0xe4));var _0x5e23=function(_0x23c949,_0x1c73b5){_0x23c949=_0x23c949-0x0;var _0x26562c=_0xe235[_0x23c949];return _0x26562c;};'use strict';var Sequelize=require(_0x5e23('0x0'));module[_0x5e23('0x1')]={'calldate':{'type':Sequelize[_0x5e23('0x2')],'allowNull':![],'defaultValue':_0x5e23('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x5e23('0x4')]},'dcontext':{'type':Sequelize[_0x5e23('0x4')]},'channel':{'type':Sequelize[_0x5e23('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x5e23('0x4')]},'duration':{'type':Sequelize[_0x5e23('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x5e23('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5e23('0x4')]},'amaflags':{'type':Sequelize[_0x5e23('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5e23('0x4')]},'userfield':{'type':Sequelize[_0x5e23('0x4')]},'uniqueid':{'type':Sequelize[_0x5e23('0x4')]},'linkedid':{'type':Sequelize[_0x5e23('0x4')]},'sequence':{'type':Sequelize[_0x5e23('0x4')]},'peeraccount':{'type':Sequelize[_0x5e23('0x4')]},'type':{'type':Sequelize[_0x5e23('0x4')]},'tag':{'type':Sequelize[_0x5e23('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 5466712..26f72d6 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 _0xa9b1=['where','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','Cdr','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter'];(function(_0x340c13,_0x595d66){var _0x5a7d96=function(_0x250118){while(--_0x250118){_0x340c13['push'](_0x340c13['shift']());}};_0x5a7d96(++_0x595d66);}(_0xa9b1,0x133));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1a9b('0x0'));var jsonpatch=require(_0x1a9b('0x1'));var rp=require(_0x1a9b('0x2'));var moment=require(_0x1a9b('0x3'));var BPromise=require(_0x1a9b('0x4'));var Mustache=require(_0x1a9b('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1a9b('0x6'));var ejs=require(_0x1a9b('0x7'));var fs=require('fs');var fs_extra=require(_0x1a9b('0x8'));var _=require(_0x1a9b('0x9'));var squel=require(_0x1a9b('0xa'));var crypto=require(_0x1a9b('0xb'));var jsforce=require(_0x1a9b('0xc'));var deskjs=require(_0x1a9b('0xd'));var toCsv=require(_0x1a9b('0x6'));var querystring=require(_0x1a9b('0xe'));var Papa=require(_0x1a9b('0xf'));var Redis=require(_0x1a9b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1a9b('0x11'));var hardwareService=require(_0x1a9b('0x12'));var logger=require(_0x1a9b('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1a9b('0x14'));var db=require(_0x1a9b('0x15'))['db'];function respondWithStatusCode(_0x2c75cf,_0x11bf7e){_0x11bf7e=_0x11bf7e||0xcc;return function(_0x2c3170){if(_0x2c3170){return _0x2c75cf[_0x1a9b('0x16')](_0x11bf7e);}return _0x2c75cf['status'](_0x11bf7e)[_0x1a9b('0x17')]();};}function respondWithResult(_0x34f082,_0x245883){_0x245883=_0x245883||0xc8;return function(_0x53c725){if(_0x53c725){return _0x34f082[_0x1a9b('0x18')](_0x245883)[_0x1a9b('0x19')](_0x53c725);}};}function respondWithFilteredResult(_0x55a00d,_0x2a7d72){return function(_0x57ca87){if(_0x57ca87){var _0x439acd=typeof _0x2a7d72[_0x1a9b('0x1a')]===_0x1a9b('0x1b')&&typeof _0x2a7d72[_0x1a9b('0x1c')]===_0x1a9b('0x1b');var _0x20b8dc=_0x57ca87[_0x1a9b('0x1d')];var _0x205a0d=_0x439acd?0x0:_0x2a7d72[_0x1a9b('0x1a')];var _0x1281c2=_0x439acd?_0x57ca87['count']:_0x2a7d72[_0x1a9b('0x1a')]+_0x2a7d72[_0x1a9b('0x1c')];var _0x3df7d2;if(_0x1281c2>=_0x20b8dc){_0x1281c2=_0x20b8dc;_0x3df7d2=0xc8;}else{_0x3df7d2=0xce;}_0x55a00d[_0x1a9b('0x18')](_0x3df7d2);return _0x55a00d['set'](_0x1a9b('0x1e'),_0x205a0d+'-'+_0x1281c2+'/'+_0x20b8dc)[_0x1a9b('0x19')](_0x57ca87);}return null;};}function patchUpdates(_0x4b3cd3){return function(_0x23e327){try{jsonpatch[_0x1a9b('0x1f')](_0x23e327,_0x4b3cd3,!![]);}catch(_0x44cebf){return BPromise[_0x1a9b('0x20')](_0x44cebf);}return _0x23e327[_0x1a9b('0x21')]();};}function saveUpdates(_0x590568,_0x189e78){return function(_0x17b1dd){if(_0x17b1dd){return _0x17b1dd[_0x1a9b('0x22')](_0x590568)[_0x1a9b('0x23')](function(_0x36391a){return _0x36391a;});}return null;};}function removeEntity(_0x2e42f1,_0x28f937){return function(_0x488a33){if(_0x488a33){return _0x488a33[_0x1a9b('0x24')]()['then'](function(){_0x2e42f1[_0x1a9b('0x18')](0xcc)[_0x1a9b('0x17')]();});}};}function handleEntityNotFound(_0xad6541,_0x4e7234){return function(_0x213841){if(!_0x213841){_0xad6541[_0x1a9b('0x16')](0x194);}return _0x213841;};}function handleError(_0x1521f4,_0x181331){_0x181331=_0x181331||0x1f4;return function(_0x18c9dd){logger[_0x1a9b('0x25')](_0x18c9dd['stack']);if(_0x18c9dd[_0x1a9b('0x26')]){delete _0x18c9dd[_0x1a9b('0x26')];}_0x1521f4['status'](_0x181331)[_0x1a9b('0x27')](_0x18c9dd);};}exports[_0x1a9b('0x28')]=function(_0x5d70dc,_0x5d7e8c){var _0x3f8e98={},_0x1d981e={},_0x5362b8={'count':0x0,'rows':[]};var _0x30278b=_[_0x1a9b('0x29')](db[_0x1a9b('0x2a')][_0x1a9b('0x2b')],function(_0x1a5085){return{'name':_0x1a5085[_0x1a9b('0x2c')],'type':_0x1a5085[_0x1a9b('0x2d')]['key']};});_0x1d981e[_0x1a9b('0x2e')]=_[_0x1a9b('0x29')](_0x30278b,_0x1a9b('0x26'));_0x1d981e[_0x1a9b('0x2f')]=_[_0x1a9b('0x30')](_0x5d70dc[_0x1a9b('0x2f')]);_0x1d981e[_0x1a9b('0x31')]=_[_0x1a9b('0x32')](_0x1d981e[_0x1a9b('0x2e')],_0x1d981e[_0x1a9b('0x2f')]);_0x3f8e98[_0x1a9b('0x33')]=_['intersection'](_0x1d981e['model'],qs[_0x1a9b('0x34')](_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x34')]));_0x3f8e98['attributes']=_0x3f8e98[_0x1a9b('0x33')]['length']?_0x3f8e98[_0x1a9b('0x33')]:_0x1d981e['model'];if(!_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x35')]('nolimit')){_0x3f8e98[_0x1a9b('0x1c')]=qs['limit'](_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x1c')]);_0x3f8e98[_0x1a9b('0x1a')]=qs[_0x1a9b('0x1a')](_0x5d70dc['query'][_0x1a9b('0x1a')]);}_0x3f8e98[_0x1a9b('0x36')]=qs[_0x1a9b('0x37')](_0x5d70dc['query'][_0x1a9b('0x37')]);_0x3f8e98['where']=qs['filters'](_[_0x1a9b('0x38')](_0x5d70dc[_0x1a9b('0x2f')],_0x1d981e[_0x1a9b('0x31')]),_0x30278b);if(_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x39')]){_0x3f8e98[_0x1a9b('0x3a')]=_[_0x1a9b('0x3b')](_0x3f8e98['where'],{'$or':_[_0x1a9b('0x29')](_0x30278b,function(_0x230fc6){if(_0x230fc6[_0x1a9b('0x2d')]!=='VIRTUAL'){var _0x466827={};_0x466827[_0x230fc6[_0x1a9b('0x26')]]={'$like':'%'+_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x39')]+'%'};return _0x466827;}})});}_0x3f8e98=_['merge']({},_0x3f8e98,_0x5d70dc['options']);var _0x10e80f={'where':_0x3f8e98[_0x1a9b('0x3a')]};return db[_0x1a9b('0x2a')]['count'](_0x10e80f)['then'](function(_0x2b9bcf){_0x5362b8[_0x1a9b('0x1d')]=_0x2b9bcf;if(_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x3c')]){_0x3f8e98[_0x1a9b('0x3d')]=[{'all':!![]}];}return db[_0x1a9b('0x2a')][_0x1a9b('0x3e')](_0x3f8e98);})['then'](function(_0x313921){_0x5362b8[_0x1a9b('0x3f')]=_0x313921;return _0x5362b8;})[_0x1a9b('0x23')](respondWithFilteredResult(_0x5d7e8c,_0x3f8e98))[_0x1a9b('0x40')](handleError(_0x5d7e8c,null));};exports[_0x1a9b('0x41')]=function(_0x1decb8,_0xb4cbf4){var _0x398db3={'raw':!![],'where':{'id':_0x1decb8[_0x1a9b('0x42')]['id']}},_0x35f6d8={};_0x35f6d8[_0x1a9b('0x2e')]=_[_0x1a9b('0x30')](db[_0x1a9b('0x2a')][_0x1a9b('0x2b')]);_0x35f6d8[_0x1a9b('0x2f')]=_[_0x1a9b('0x30')](_0x1decb8['query']);_0x35f6d8[_0x1a9b('0x31')]=_[_0x1a9b('0x32')](_0x35f6d8['model'],_0x35f6d8[_0x1a9b('0x2f')]);_0x398db3['attributes']=_['intersection'](_0x35f6d8[_0x1a9b('0x2e')],qs[_0x1a9b('0x34')](_0x1decb8[_0x1a9b('0x2f')][_0x1a9b('0x34')]));_0x398db3[_0x1a9b('0x33')]=_0x398db3[_0x1a9b('0x33')][_0x1a9b('0x43')]?_0x398db3['attributes']:_0x35f6d8[_0x1a9b('0x2e')];if(_0x1decb8[_0x1a9b('0x2f')][_0x1a9b('0x3c')]){_0x398db3[_0x1a9b('0x3d')]=[{'all':!![]}];}_0x398db3=_['merge']({},_0x398db3,_0x1decb8[_0x1a9b('0x44')]);return db[_0x1a9b('0x2a')][_0x1a9b('0x45')](_0x398db3)[_0x1a9b('0x23')](handleEntityNotFound(_0xb4cbf4,null))['then'](respondWithResult(_0xb4cbf4,null))[_0x1a9b('0x40')](handleError(_0xb4cbf4,null));};exports[_0x1a9b('0x46')]=function(_0x41e9fc,_0x1e93df){return db[_0x1a9b('0x2a')]['create'](_0x41e9fc['body'],{})[_0x1a9b('0x23')](respondWithResult(_0x1e93df,0xc9))[_0x1a9b('0x40')](handleError(_0x1e93df,null));};exports['update']=function(_0x52b06e,_0x252140){if(_0x52b06e[_0x1a9b('0x47')]['id']){delete _0x52b06e[_0x1a9b('0x47')]['id'];}return db['Cdr'][_0x1a9b('0x45')]({'where':{'id':_0x52b06e[_0x1a9b('0x42')]['id']}})[_0x1a9b('0x23')](handleEntityNotFound(_0x252140,null))[_0x1a9b('0x23')](saveUpdates(_0x52b06e[_0x1a9b('0x47')],null))[_0x1a9b('0x23')](respondWithResult(_0x252140,null))[_0x1a9b('0x40')](handleError(_0x252140,null));};exports['destroy']=function(_0x54b9ac,_0x5465d0){return db[_0x1a9b('0x2a')][_0x1a9b('0x45')]({'where':{'id':_0x54b9ac[_0x1a9b('0x42')]['id']}})[_0x1a9b('0x23')](handleEntityNotFound(_0x5465d0,null))[_0x1a9b('0x23')](removeEntity(_0x5465d0,null))['catch'](handleError(_0x5465d0,null));};exports[_0x1a9b('0x48')]=function(_0x222bba,_0x3b1fdf){return db[_0x1a9b('0x2a')][_0x1a9b('0x48')]()[_0x1a9b('0x23')](respondWithResult(_0x3b1fdf,null))[_0x1a9b('0x40')](handleError(_0x3b1fdf,null));};
\ No newline at end of file
+var _0x1224=['sort','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','include','create','body','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','Cdr','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order'];(function(_0x5a2601,_0x3fd7d1){var _0x27ab50=function(_0x53f6ca){while(--_0x53f6ca){_0x5a2601['push'](_0x5a2601['shift']());}};_0x27ab50(++_0x3fd7d1);}(_0x1224,0x10d));var _0x4122=function(_0x30fc13,_0x126c3f){_0x30fc13=_0x30fc13-0x0;var _0x5d0365=_0x1224[_0x30fc13];return _0x5d0365;};'use strict';var emlformat=require(_0x4122('0x0'));var rimraf=require(_0x4122('0x1'));var zipdir=require(_0x4122('0x2'));var jsonpatch=require(_0x4122('0x3'));var rp=require(_0x4122('0x4'));var moment=require(_0x4122('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4122('0x6'));var util=require(_0x4122('0x7'));var path=require(_0x4122('0x8'));var sox=require('sox');var csv=require(_0x4122('0x9'));var ejs=require(_0x4122('0xa'));var fs=require('fs');var fs_extra=require(_0x4122('0xb'));var _=require(_0x4122('0xc'));var squel=require(_0x4122('0xd'));var crypto=require(_0x4122('0xe'));var jsforce=require(_0x4122('0xf'));var deskjs=require(_0x4122('0x10'));var toCsv=require(_0x4122('0x9'));var querystring=require(_0x4122('0x11'));var Papa=require(_0x4122('0x12'));var Redis=require(_0x4122('0x13'));var authService=require(_0x4122('0x14'));var qs=require(_0x4122('0x15'));var as=require(_0x4122('0x16'));var hardwareService=require(_0x4122('0x17'));var logger=require(_0x4122('0x18'))(_0x4122('0x19'));var utils=require(_0x4122('0x1a'));var config=require(_0x4122('0x1b'));var licenseUtil=require(_0x4122('0x1c'));var db=require(_0x4122('0x1d'))['db'];function respondWithStatusCode(_0x440ff0,_0x8d4876){_0x8d4876=_0x8d4876||0xcc;return function(_0xe213d){if(_0xe213d){return _0x440ff0[_0x4122('0x1e')](_0x8d4876);}return _0x440ff0[_0x4122('0x1f')](_0x8d4876)[_0x4122('0x20')]();};}function respondWithResult(_0x421ee3,_0x1a701e){_0x1a701e=_0x1a701e||0xc8;return function(_0x3a88fe){if(_0x3a88fe){return _0x421ee3['status'](_0x1a701e)[_0x4122('0x21')](_0x3a88fe);}};}function respondWithFilteredResult(_0x3c674e,_0x192e77){return function(_0x359909){if(_0x359909){var _0x520300=typeof _0x192e77[_0x4122('0x22')]===_0x4122('0x23')&&typeof _0x192e77['limit']===_0x4122('0x23');var _0x3ec4d3=_0x359909[_0x4122('0x24')];var _0x4636ae=_0x520300?0x0:_0x192e77[_0x4122('0x22')];var _0x42374d=_0x520300?_0x359909[_0x4122('0x24')]:_0x192e77['offset']+_0x192e77['limit'];var _0x586105;if(_0x42374d>=_0x3ec4d3){_0x42374d=_0x3ec4d3;_0x586105=0xc8;}else{_0x586105=0xce;}_0x3c674e[_0x4122('0x1f')](_0x586105);return _0x3c674e[_0x4122('0x25')](_0x4122('0x26'),_0x4636ae+'-'+_0x42374d+'/'+_0x3ec4d3)[_0x4122('0x21')](_0x359909);}return null;};}function patchUpdates(_0xef6995){return function(_0xb0a7d){try{jsonpatch[_0x4122('0x27')](_0xb0a7d,_0xef6995,!![]);}catch(_0x46b24e){return BPromise['reject'](_0x46b24e);}return _0xb0a7d[_0x4122('0x28')]();};}function saveUpdates(_0x50e243,_0x4f949a){return function(_0x508cd7){if(_0x508cd7){return _0x508cd7[_0x4122('0x29')](_0x50e243)[_0x4122('0x2a')](function(_0x317418){return _0x317418;});}return null;};}function removeEntity(_0x4eb35b,_0x128fde){return function(_0x386cdc){if(_0x386cdc){return _0x386cdc['destroy']()['then'](function(){_0x4eb35b[_0x4122('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4db23e,_0x59895d){return function(_0x1b449b){if(!_0x1b449b){_0x4db23e[_0x4122('0x1e')](0x194);}return _0x1b449b;};}function handleError(_0xbb76e1,_0x1bb51b){_0x1bb51b=_0x1bb51b||0x1f4;return function(_0x31568f){logger[_0x4122('0x2b')](_0x31568f[_0x4122('0x2c')]);if(_0x31568f[_0x4122('0x2d')]){delete _0x31568f[_0x4122('0x2d')];}_0xbb76e1[_0x4122('0x1f')](_0x1bb51b)[_0x4122('0x2e')](_0x31568f);};}exports[_0x4122('0x2f')]=function(_0xfefaf6,_0x5f32c5){var _0x2e5bc2={},_0x43c51c={},_0x79c85={'count':0x0,'rows':[]};var _0x31f141=_['map'](db[_0x4122('0x30')]['rawAttributes'],function(_0x3e4eee){return{'name':_0x3e4eee[_0x4122('0x31')],'type':_0x3e4eee[_0x4122('0x32')][_0x4122('0x33')]};});_0x43c51c[_0x4122('0x34')]=_[_0x4122('0x35')](_0x31f141,_0x4122('0x2d'));_0x43c51c[_0x4122('0x36')]=_['keys'](_0xfefaf6[_0x4122('0x36')]);_0x43c51c[_0x4122('0x37')]=_['intersection'](_0x43c51c[_0x4122('0x34')],_0x43c51c[_0x4122('0x36')]);_0x2e5bc2[_0x4122('0x38')]=_[_0x4122('0x39')](_0x43c51c['model'],qs[_0x4122('0x3a')](_0xfefaf6[_0x4122('0x36')]['fields']));_0x2e5bc2['attributes']=_0x2e5bc2[_0x4122('0x38')]['length']?_0x2e5bc2[_0x4122('0x38')]:_0x43c51c[_0x4122('0x34')];if(!_0xfefaf6['query'][_0x4122('0x3b')](_0x4122('0x3c'))){_0x2e5bc2[_0x4122('0x3d')]=qs['limit'](_0xfefaf6[_0x4122('0x36')]['limit']);_0x2e5bc2[_0x4122('0x22')]=qs[_0x4122('0x22')](_0xfefaf6[_0x4122('0x36')]['offset']);}_0x2e5bc2[_0x4122('0x3e')]=qs['sort'](_0xfefaf6[_0x4122('0x36')][_0x4122('0x3f')]);_0x2e5bc2['where']=qs['filters'](_['pick'](_0xfefaf6[_0x4122('0x36')],_0x43c51c['filters']),_0x31f141);if(_0xfefaf6[_0x4122('0x36')][_0x4122('0x40')]){_0x2e5bc2[_0x4122('0x41')]=_[_0x4122('0x42')](_0x2e5bc2[_0x4122('0x41')],{'$or':_['map'](_0x31f141,function(_0x5c20ec){if(_0x5c20ec[_0x4122('0x32')]!=='VIRTUAL'){var _0xf4ab54={};_0xf4ab54[_0x5c20ec['name']]={'$like':'%'+_0xfefaf6[_0x4122('0x36')][_0x4122('0x40')]+'%'};return _0xf4ab54;}})});}_0x2e5bc2=_['merge']({},_0x2e5bc2,_0xfefaf6[_0x4122('0x43')]);var _0x2b7d56={'where':_0x2e5bc2[_0x4122('0x41')]};return db[_0x4122('0x30')][_0x4122('0x24')](_0x2b7d56)[_0x4122('0x2a')](function(_0x5b8fe2){_0x79c85[_0x4122('0x24')]=_0x5b8fe2;if(_0xfefaf6['query'][_0x4122('0x44')]){_0x2e5bc2['include']=[{'all':!![]}];}return db[_0x4122('0x30')][_0x4122('0x45')](_0x2e5bc2);})[_0x4122('0x2a')](function(_0x469fdd){_0x79c85[_0x4122('0x46')]=_0x469fdd;return _0x79c85;})['then'](respondWithFilteredResult(_0x5f32c5,_0x2e5bc2))[_0x4122('0x47')](handleError(_0x5f32c5,null));};exports[_0x4122('0x48')]=function(_0x59ed80,_0x589b39){var _0x5853ae={'raw':!![],'where':{'id':_0x59ed80[_0x4122('0x49')]['id']}},_0x297937={};_0x297937[_0x4122('0x34')]=_[_0x4122('0x4a')](db[_0x4122('0x30')][_0x4122('0x4b')]);_0x297937[_0x4122('0x36')]=_[_0x4122('0x4a')](_0x59ed80[_0x4122('0x36')]);_0x297937['filters']=_[_0x4122('0x39')](_0x297937['model'],_0x297937['query']);_0x5853ae[_0x4122('0x38')]=_[_0x4122('0x39')](_0x297937[_0x4122('0x34')],qs['fields'](_0x59ed80[_0x4122('0x36')][_0x4122('0x3a')]));_0x5853ae['attributes']=_0x5853ae[_0x4122('0x38')][_0x4122('0x4c')]?_0x5853ae[_0x4122('0x38')]:_0x297937[_0x4122('0x34')];if(_0x59ed80['query'][_0x4122('0x44')]){_0x5853ae[_0x4122('0x4d')]=[{'all':!![]}];}_0x5853ae=_[_0x4122('0x42')]({},_0x5853ae,_0x59ed80[_0x4122('0x43')]);return db[_0x4122('0x30')]['find'](_0x5853ae)['then'](handleEntityNotFound(_0x589b39,null))[_0x4122('0x2a')](respondWithResult(_0x589b39,null))[_0x4122('0x47')](handleError(_0x589b39,null));};exports[_0x4122('0x4e')]=function(_0x13cc1d,_0x144d4c){return db['Cdr'][_0x4122('0x4e')](_0x13cc1d[_0x4122('0x4f')],{})[_0x4122('0x2a')](respondWithResult(_0x144d4c,0xc9))['catch'](handleError(_0x144d4c,null));};exports[_0x4122('0x29')]=function(_0x53f7d9,_0x39515c){if(_0x53f7d9[_0x4122('0x4f')]['id']){delete _0x53f7d9[_0x4122('0x4f')]['id'];}return db[_0x4122('0x30')]['find']({'where':{'id':_0x53f7d9['params']['id']}})[_0x4122('0x2a')](handleEntityNotFound(_0x39515c,null))[_0x4122('0x2a')](saveUpdates(_0x53f7d9[_0x4122('0x4f')],null))[_0x4122('0x2a')](respondWithResult(_0x39515c,null))['catch'](handleError(_0x39515c,null));};exports[_0x4122('0x50')]=function(_0x5678ff,_0x376782){return db['Cdr'][_0x4122('0x51')]({'where':{'id':_0x5678ff[_0x4122('0x49')]['id']}})[_0x4122('0x2a')](handleEntityNotFound(_0x376782,null))[_0x4122('0x2a')](removeEntity(_0x376782,null))[_0x4122('0x47')](handleError(_0x376782,null));};exports[_0x4122('0x52')]=function(_0x4fb7ac,_0xf265ed){return db['Cdr'][_0x4122('0x52')]()[_0x4122('0x2a')](respondWithResult(_0xf265ed,null))[_0x4122('0x47')](handleError(_0xf265ed,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 557ae0e..abfe3c4 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(_0x1c341b,_0x157953){var _0x5e8591=function(_0x1e29cd){while(--_0x1e29cd){_0x1c341b['push'](_0x1c341b['shift']());}};_0x5e8591(++_0x157953);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x5ce743,_0xc5caca){var _0x2a3fd1=function(_0x218b48){while(--_0x218b48){_0x5ce743['push'](_0x5ce743['shift']());}};_0x2a3fd1(++_0xc5caca);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index f9967ff..af7a837 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 _0x708f=['message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x529f36,_0x6b4496){var _0x64d301=function(_0x5a1399){while(--_0x5a1399){_0x529f36['push'](_0x529f36['shift']());}};_0x64d301(++_0x6b4496);}(_0x708f,0x117));var _0xf708=function(_0x57dae8,_0x14f493){_0x57dae8=_0x57dae8-0x0;var _0x2da89a=_0x708f[_0x57dae8];return _0x2da89a;};'use strict';var _=require(_0xf708('0x0'));var util=require(_0xf708('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf708('0x2'));var fs=require('fs');var Redis=require(_0xf708('0x3'));var db=require(_0xf708('0x4'))['db'];var utils=require(_0xf708('0x5'));var logger=require(_0xf708('0x6'))('rpc');var config=require(_0xf708('0x7'));var jayson=require(_0xf708('0x8'));var client=jayson[_0xf708('0x9')][_0xf708('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf6072f,_0x2adf2a,_0x28f807){return new BPromise(function(_0x166465,_0x5ccb1d){return client[_0xf708('0xb')](_0xf6072f,_0x28f807)[_0xf708('0xc')](function(_0x2108fd){logger[_0xf708('0xd')](_0xf708('0xe'),_0x2adf2a,_0xf708('0xf'));logger['debug'](_0xf708('0x10'),_0x2adf2a,_0xf708('0xf'),JSON[_0xf708('0x11')](_0x2108fd));if(_0x2108fd[_0xf708('0x12')]){if(_0x2108fd[_0xf708('0x12')][_0xf708('0x13')]===0x1f4){logger[_0xf708('0x12')](_0xf708('0xe'),_0x2adf2a,_0x2108fd[_0xf708('0x12')][_0xf708('0x14')]);return _0x5ccb1d(_0x2108fd[_0xf708('0x12')]['message']);}logger['error'](_0xf708('0xe'),_0x2adf2a,_0x2108fd[_0xf708('0x12')][_0xf708('0x14')]);return _0x166465(_0x2108fd[_0xf708('0x12')]['message']);}else{logger[_0xf708('0xd')](_0xf708('0xe'),_0x2adf2a,_0xf708('0xf'));_0x166465(_0x2108fd[_0xf708('0x15')]['message']);}})[_0xf708('0x16')](function(_0x33cd4b){logger['error'](_0xf708('0xe'),_0x2adf2a,_0x33cd4b);_0x5ccb1d(_0x33cd4b);});});}
\ No newline at end of file
+var _0x94a7=['../../config/environment','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5a43b8,_0x2e0eb2){var _0x26eeef=function(_0x4b1451){while(--_0x4b1451){_0x5a43b8['push'](_0x5a43b8['shift']());}};_0x26eeef(++_0x2e0eb2);}(_0x94a7,0x10b));var _0x794a=function(_0x189ece,_0x34dd60){_0x189ece=_0x189ece-0x0;var _0x3eda01=_0x94a7[_0x189ece];return _0x3eda01;};'use strict';var _=require(_0x794a('0x0'));var util=require(_0x794a('0x1'));var moment=require(_0x794a('0x2'));var BPromise=require(_0x794a('0x3'));var rs=require(_0x794a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x794a('0x5'))['db'];var utils=require(_0x794a('0x6'));var logger=require(_0x794a('0x7'))(_0x794a('0x8'));var config=require(_0x794a('0x9'));var jayson=require(_0x794a('0xa'));var client=jayson['client'][_0x794a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d11eb,_0x544df5,_0x265332){return new BPromise(function(_0x4df1bc,_0x1b29fc){return client[_0x794a('0xc')](_0x3d11eb,_0x265332)[_0x794a('0xd')](function(_0x650e1d){logger[_0x794a('0xe')](_0x794a('0xf'),_0x544df5,_0x794a('0x10'));logger['debug'](_0x794a('0x11'),_0x544df5,_0x794a('0x10'),JSON[_0x794a('0x12')](_0x650e1d));if(_0x650e1d[_0x794a('0x13')]){if(_0x650e1d['error'][_0x794a('0x14')]===0x1f4){logger[_0x794a('0x13')](_0x794a('0xf'),_0x544df5,_0x650e1d[_0x794a('0x13')]['message']);return _0x1b29fc(_0x650e1d[_0x794a('0x13')]['message']);}logger['error']('Cdr,\x20%s,\x20%s',_0x544df5,_0x650e1d[_0x794a('0x13')][_0x794a('0x15')]);return _0x4df1bc(_0x650e1d[_0x794a('0x13')][_0x794a('0x15')]);}else{logger['info'](_0x794a('0xf'),_0x544df5,'request\x20sent');_0x4df1bc(_0x650e1d['result']['message']);}})[_0x794a('0x16')](function(_0x935ceb){logger[_0x794a('0x13')]('Cdr,\x20%s,\x20%s',_0x544df5,_0x935ceb);_0x1b29fc(_0x935ceb);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 7e0e12e..1fb4ff7 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x288267,_0x12e1e3){var _0x5b245c=function(_0x4716ab){while(--_0x4716ab){_0x288267['push'](_0x288267['shift']());}};_0x5b245c(++_0x12e1e3);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5d6398,_0x5af583){var _0xf652d6=function(_0x1e6c52){while(--_0x1e6c52){_0x5d6398['push'](_0x5d6398['shift']());}};_0xf652d6(++_0x5af583);}(_0xb10b,0x12a));var _0xbb10=function(_0x155924,_0x2a5368){_0x155924=_0x155924-0x0;var _0x262e4b=_0xb10b[_0x155924];return _0x262e4b;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('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 9083bd6..1a8a005 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 _0x2870=['sequelize','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x482fc8,_0x29e418){var _0x402339=function(_0x501171){while(--_0x501171){_0x482fc8['push'](_0x482fc8['shift']());}};_0x402339(++_0x29e418);}(_0x2870,0xba));var _0x0287=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0x2870[_0x5e4563];return _0x8d1bf5;};'use strict';var Sequelize=require(_0x0287('0x0'));module['exports']={'priority':{'type':Sequelize[_0x0287('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x0287('0x2')],'allowNull':![],'defaultValue':_0x0287('0x3')},'appdata':{'type':Sequelize[_0x0287('0x4')]()},'description':{'type':Sequelize[_0x0287('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x0287('0x5')}};
\ No newline at end of file
+var _0x9a26=['TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x118cda,_0x46f01a){var _0x75fce3=function(_0x422085){while(--_0x422085){_0x118cda['push'](_0x118cda['shift']());}};_0x75fce3(++_0x46f01a);}(_0x9a26,0xdb));var _0x69a2=function(_0x2e64e0,_0x1642bb){_0x2e64e0=_0x2e64e0-0x0;var _0x29aa5f=_0x9a26[_0x2e64e0];return _0x29aa5f;};'use strict';var Sequelize=require(_0x69a2('0x0'));module[_0x69a2('0x1')]={'priority':{'type':Sequelize[_0x69a2('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x69a2('0x3')]()},'description':{'type':Sequelize[_0x69a2('0x4')]},'interval':{'type':Sequelize[_0x69a2('0x4')],'defaultValue':_0x69a2('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 8522a58..3bf56e5 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 _0x3c2c=['params','model','ChatApplication','rawAttributes','query','keys','filters','intersection','fields','length','includeAll','options','find','then','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','end','sendStatus','stack','name','send','show'];(function(_0x40a69b,_0x30a7e9){var _0x31c177=function(_0x572694){while(--_0x572694){_0x40a69b['push'](_0x40a69b['shift']());}};_0x31c177(++_0x30a7e9);}(_0x3c2c,0x160));var _0xc3c2=function(_0x537e09,_0x4c175a){_0x537e09=_0x537e09-0x0;var _0x38ac68=_0x3c2c[_0x537e09];return _0x38ac68;};'use strict';var emlformat=require(_0xc3c2('0x0'));var rimraf=require(_0xc3c2('0x1'));var zipdir=require(_0xc3c2('0x2'));var jsonpatch=require(_0xc3c2('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc3c2('0x4'));var Mustache=require(_0xc3c2('0x5'));var util=require(_0xc3c2('0x6'));var path=require(_0xc3c2('0x7'));var sox=require('sox');var csv=require(_0xc3c2('0x8'));var ejs=require(_0xc3c2('0x9'));var fs=require('fs');var fs_extra=require(_0xc3c2('0xa'));var _=require(_0xc3c2('0xb'));var squel=require(_0xc3c2('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc3c2('0x8'));var querystring=require(_0xc3c2('0xd'));var Papa=require('papaparse');var Redis=require(_0xc3c2('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc3c2('0xf'));var hardwareService=require(_0xc3c2('0x10'));var logger=require(_0xc3c2('0x11'))('api');var utils=require(_0xc3c2('0x12'));var config=require(_0xc3c2('0x13'));var licenseUtil=require(_0xc3c2('0x14'));var db=require(_0xc3c2('0x15'))['db'];function respondWithStatusCode(_0x578ac4,_0x3920e7){_0x3920e7=_0x3920e7||0xcc;return function(_0x1befad){if(_0x1befad){return _0x578ac4['sendStatus'](_0x3920e7);}return _0x578ac4[_0xc3c2('0x16')](_0x3920e7)['end']();};}function respondWithResult(_0x25b091,_0x4d7d11){_0x4d7d11=_0x4d7d11||0xc8;return function(_0x154071){if(_0x154071){return _0x25b091['status'](_0x4d7d11)[_0xc3c2('0x17')](_0x154071);}};}function respondWithFilteredResult(_0xf5d9a,_0x56bc61){return function(_0x1c2987){if(_0x1c2987){var _0x36f10f=typeof _0x56bc61[_0xc3c2('0x18')]===_0xc3c2('0x19')&&typeof _0x56bc61[_0xc3c2('0x1a')]===_0xc3c2('0x19');var _0x57b7b3=_0x1c2987['count'];var _0x4c0f2d=_0x36f10f?0x0:_0x56bc61[_0xc3c2('0x18')];var _0x3e26e1=_0x36f10f?_0x1c2987[_0xc3c2('0x1b')]:_0x56bc61[_0xc3c2('0x18')]+_0x56bc61[_0xc3c2('0x1a')];var _0x5c9d2c;if(_0x3e26e1>=_0x57b7b3){_0x3e26e1=_0x57b7b3;_0x5c9d2c=0xc8;}else{_0x5c9d2c=0xce;}_0xf5d9a['status'](_0x5c9d2c);return _0xf5d9a[_0xc3c2('0x1c')](_0xc3c2('0x1d'),_0x4c0f2d+'-'+_0x3e26e1+'/'+_0x57b7b3)[_0xc3c2('0x17')](_0x1c2987);}return null;};}function patchUpdates(_0x5e925e){return function(_0x42feba){try{jsonpatch['apply'](_0x42feba,_0x5e925e,!![]);}catch(_0x2e9c78){return BPromise[_0xc3c2('0x1e')](_0x2e9c78);}return _0x42feba[_0xc3c2('0x1f')]();};}function saveUpdates(_0x57458a,_0x2ca609){return function(_0x340c75){if(_0x340c75){return _0x340c75[_0xc3c2('0x20')](_0x57458a)['then'](function(_0x3db978){return _0x3db978;});}return null;};}function removeEntity(_0x3287a3,_0x6ad7af){return function(_0x5d7789){if(_0x5d7789){return _0x5d7789[_0xc3c2('0x21')]()['then'](function(){_0x3287a3[_0xc3c2('0x16')](0xcc)[_0xc3c2('0x22')]();});}};}function handleEntityNotFound(_0x26aacc,_0x38d0b9){return function(_0x15f5f9){if(!_0x15f5f9){_0x26aacc[_0xc3c2('0x23')](0x194);}return _0x15f5f9;};}function handleError(_0x978056,_0x4b6504){_0x4b6504=_0x4b6504||0x1f4;return function(_0x48fa15){logger['error'](_0x48fa15[_0xc3c2('0x24')]);if(_0x48fa15[_0xc3c2('0x25')]){delete _0x48fa15[_0xc3c2('0x25')];}_0x978056['status'](_0x4b6504)[_0xc3c2('0x26')](_0x48fa15);};}exports[_0xc3c2('0x27')]=function(_0x2dc9ec,_0x2bc3b7){var _0x7686ac={'raw':!![],'where':{'id':_0x2dc9ec[_0xc3c2('0x28')]['id']}},_0x166f8e={};_0x166f8e[_0xc3c2('0x29')]=_['keys'](db[_0xc3c2('0x2a')][_0xc3c2('0x2b')]);_0x166f8e[_0xc3c2('0x2c')]=_[_0xc3c2('0x2d')](_0x2dc9ec[_0xc3c2('0x2c')]);_0x166f8e[_0xc3c2('0x2e')]=_['intersection'](_0x166f8e['model'],_0x166f8e[_0xc3c2('0x2c')]);_0x7686ac['attributes']=_[_0xc3c2('0x2f')](_0x166f8e[_0xc3c2('0x29')],qs[_0xc3c2('0x30')](_0x2dc9ec['query']['fields']));_0x7686ac['attributes']=_0x7686ac['attributes'][_0xc3c2('0x31')]?_0x7686ac['attributes']:_0x166f8e[_0xc3c2('0x29')];if(_0x2dc9ec['query'][_0xc3c2('0x32')]){_0x7686ac['include']=[{'all':!![]}];}_0x7686ac=_['merge']({},_0x7686ac,_0x2dc9ec[_0xc3c2('0x33')]);return db[_0xc3c2('0x2a')][_0xc3c2('0x34')](_0x7686ac)[_0xc3c2('0x35')](handleEntityNotFound(_0x2bc3b7,null))[_0xc3c2('0x35')](respondWithResult(_0x2bc3b7,null))[_0xc3c2('0x36')](handleError(_0x2bc3b7,null));};exports[_0xc3c2('0x20')]=function(_0x434430,_0x3ee2ee){if(_0x434430['body']['id']){delete _0x434430['body']['id'];}return db[_0xc3c2('0x2a')][_0xc3c2('0x34')]({'where':{'id':_0x434430[_0xc3c2('0x28')]['id']}})[_0xc3c2('0x35')](handleEntityNotFound(_0x3ee2ee,null))[_0xc3c2('0x35')](saveUpdates(_0x434430[_0xc3c2('0x37')],null))['then'](respondWithResult(_0x3ee2ee,null))[_0xc3c2('0x36')](handleError(_0x3ee2ee,null));};exports['destroy']=function(_0x2278fa,_0x227dfb){return db['ChatApplication'][_0xc3c2('0x34')]({'where':{'id':_0x2278fa[_0xc3c2('0x28')]['id']}})['then'](handleEntityNotFound(_0x227dfb,null))[_0xc3c2('0x35')](removeEntity(_0x227dfb,null))[_0xc3c2('0x36')](handleError(_0x227dfb,null));};
\ No newline at end of file
+var _0x7633=['find','catch','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','show','model','keys','ChatApplication','query','filters','intersection','attributes','fields','includeAll'];(function(_0x3042c5,_0x36cb88){var _0x7cd140=function(_0x4cdcd8){while(--_0x4cdcd8){_0x3042c5['push'](_0x3042c5['shift']());}};_0x7cd140(++_0x36cb88);}(_0x7633,0x1c4));var _0x3763=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x7633[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require(_0x3763('0x0'));var rimraf=require(_0x3763('0x1'));var zipdir=require(_0x3763('0x2'));var jsonpatch=require(_0x3763('0x3'));var rp=require(_0x3763('0x4'));var moment=require('moment');var BPromise=require(_0x3763('0x5'));var Mustache=require(_0x3763('0x6'));var util=require('util');var path=require(_0x3763('0x7'));var sox=require(_0x3763('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3763('0x9'));var _=require(_0x3763('0xa'));var squel=require(_0x3763('0xb'));var crypto=require(_0x3763('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3763('0xd'));var querystring=require(_0x3763('0xe'));var Papa=require('papaparse');var Redis=require(_0x3763('0xf'));var authService=require(_0x3763('0x10'));var qs=require(_0x3763('0x11'));var as=require(_0x3763('0x12'));var hardwareService=require(_0x3763('0x13'));var logger=require(_0x3763('0x14'))(_0x3763('0x15'));var utils=require(_0x3763('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3763('0x17'));var db=require(_0x3763('0x18'))['db'];function respondWithStatusCode(_0x11d390,_0x52728b){_0x52728b=_0x52728b||0xcc;return function(_0x59980c){if(_0x59980c){return _0x11d390[_0x3763('0x19')](_0x52728b);}return _0x11d390['status'](_0x52728b)[_0x3763('0x1a')]();};}function respondWithResult(_0x12582e,_0xf9d237){_0xf9d237=_0xf9d237||0xc8;return function(_0x3d91da){if(_0x3d91da){return _0x12582e[_0x3763('0x1b')](_0xf9d237)[_0x3763('0x1c')](_0x3d91da);}};}function respondWithFilteredResult(_0x1110e0,_0x4c877a){return function(_0xa95c5b){if(_0xa95c5b){var _0x368434=typeof _0x4c877a[_0x3763('0x1d')]==='undefined'&&typeof _0x4c877a['limit']==='undefined';var _0x1bb7bc=_0xa95c5b[_0x3763('0x1e')];var _0x33dd0e=_0x368434?0x0:_0x4c877a[_0x3763('0x1d')];var _0x23087d=_0x368434?_0xa95c5b[_0x3763('0x1e')]:_0x4c877a[_0x3763('0x1d')]+_0x4c877a['limit'];var _0x38a33f;if(_0x23087d>=_0x1bb7bc){_0x23087d=_0x1bb7bc;_0x38a33f=0xc8;}else{_0x38a33f=0xce;}_0x1110e0[_0x3763('0x1b')](_0x38a33f);return _0x1110e0[_0x3763('0x1f')](_0x3763('0x20'),_0x33dd0e+'-'+_0x23087d+'/'+_0x1bb7bc)['json'](_0xa95c5b);}return null;};}function patchUpdates(_0x485836){return function(_0x2cb398){try{jsonpatch[_0x3763('0x21')](_0x2cb398,_0x485836,!![]);}catch(_0x427c15){return BPromise[_0x3763('0x22')](_0x427c15);}return _0x2cb398['save']();};}function saveUpdates(_0x36ff74,_0x5e5f4e){return function(_0xafb9f5){if(_0xafb9f5){return _0xafb9f5[_0x3763('0x23')](_0x36ff74)['then'](function(_0x3083e){return _0x3083e;});}return null;};}function removeEntity(_0x195945,_0xa53ba5){return function(_0xd6086f){if(_0xd6086f){return _0xd6086f[_0x3763('0x24')]()[_0x3763('0x25')](function(){_0x195945[_0x3763('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57036c,_0x51e77a){return function(_0x434fa3){if(!_0x434fa3){_0x57036c[_0x3763('0x19')](0x194);}return _0x434fa3;};}function handleError(_0x28a17a,_0xe5beb5){_0xe5beb5=_0xe5beb5||0x1f4;return function(_0x3f6644){logger[_0x3763('0x26')](_0x3f6644[_0x3763('0x27')]);if(_0x3f6644[_0x3763('0x28')]){delete _0x3f6644[_0x3763('0x28')];}_0x28a17a[_0x3763('0x1b')](_0xe5beb5)[_0x3763('0x29')](_0x3f6644);};}exports[_0x3763('0x2a')]=function(_0x4f9a96,_0xd128d8){var _0xb1b938={'raw':!![],'where':{'id':_0x4f9a96['params']['id']}},_0x2f6e9d={};_0x2f6e9d[_0x3763('0x2b')]=_[_0x3763('0x2c')](db[_0x3763('0x2d')]['rawAttributes']);_0x2f6e9d[_0x3763('0x2e')]=_[_0x3763('0x2c')](_0x4f9a96[_0x3763('0x2e')]);_0x2f6e9d[_0x3763('0x2f')]=_[_0x3763('0x30')](_0x2f6e9d['model'],_0x2f6e9d['query']);_0xb1b938[_0x3763('0x31')]=_[_0x3763('0x30')](_0x2f6e9d[_0x3763('0x2b')],qs[_0x3763('0x32')](_0x4f9a96[_0x3763('0x2e')][_0x3763('0x32')]));_0xb1b938[_0x3763('0x31')]=_0xb1b938[_0x3763('0x31')]['length']?_0xb1b938[_0x3763('0x31')]:_0x2f6e9d[_0x3763('0x2b')];if(_0x4f9a96[_0x3763('0x2e')][_0x3763('0x33')]){_0xb1b938['include']=[{'all':!![]}];}_0xb1b938=_['merge']({},_0xb1b938,_0x4f9a96['options']);return db['ChatApplication'][_0x3763('0x34')](_0xb1b938)[_0x3763('0x25')](handleEntityNotFound(_0xd128d8,null))['then'](respondWithResult(_0xd128d8,null))[_0x3763('0x35')](handleError(_0xd128d8,null));};exports[_0x3763('0x23')]=function(_0x51e756,_0x805718){if(_0x51e756[_0x3763('0x36')]['id']){delete _0x51e756[_0x3763('0x36')]['id'];}return db[_0x3763('0x2d')][_0x3763('0x34')]({'where':{'id':_0x51e756[_0x3763('0x37')]['id']}})[_0x3763('0x25')](handleEntityNotFound(_0x805718,null))[_0x3763('0x25')](saveUpdates(_0x51e756['body'],null))[_0x3763('0x25')](respondWithResult(_0x805718,null))[_0x3763('0x35')](handleError(_0x805718,null));};exports['destroy']=function(_0x3a52f1,_0x231aa4){return db[_0x3763('0x2d')]['find']({'where':{'id':_0x3a52f1[_0x3763('0x37')]['id']}})['then'](handleEntityNotFound(_0x231aa4,null))[_0x3763('0x25')](removeEntity(_0x231aa4,null))['catch'](handleError(_0x231aa4,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 194da35..8c916fb 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 _0xd8b4=['request-promise','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird'];(function(_0x37d80e,_0xb03875){var _0x28d5a9=function(_0x4631cd){while(--_0x4631cd){_0x37d80e['push'](_0x37d80e['shift']());}};_0x28d5a9(++_0xb03875);}(_0xd8b4,0xff));var _0x4d8b=function(_0x418627,_0x4e30ac){_0x418627=_0x418627-0x0;var _0x384d53=_0xd8b4[_0x418627];return _0x384d53;};'use strict';var _=require(_0x4d8b('0x0'));var util=require(_0x4d8b('0x1'));var logger=require(_0x4d8b('0x2'))('api');var moment=require(_0x4d8b('0x3'));var BPromise=require(_0x4d8b('0x4'));var rp=require(_0x4d8b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4d8b('0x6'));var attributes=require(_0x4d8b('0x7'));module[_0x4d8b('0x8')]=function(_0x5254c8,_0x59b779){return _0x5254c8[_0x4d8b('0x9')](_0x4d8b('0xa'),attributes,{'tableName':_0x4d8b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4d8b('0xc')});};
\ No newline at end of file
+var _0x03aa=['moment','bluebird','../../config/environment','exports','define','chat_applications','utf8mb4','lodash','util','api'];(function(_0x12ab5b,_0x71f67a){var _0x481a2c=function(_0x4571c7){while(--_0x4571c7){_0x12ab5b['push'](_0x12ab5b['shift']());}};_0x481a2c(++_0x71f67a);}(_0x03aa,0xe3));var _0xa03a=function(_0x579bab,_0x6fac55){_0x579bab=_0x579bab-0x0;var _0x5bbb34=_0x03aa[_0x579bab];return _0x5bbb34;};'use strict';var _=require(_0xa03a('0x0'));var util=require(_0xa03a('0x1'));var logger=require('../../config/logger')(_0xa03a('0x2'));var moment=require(_0xa03a('0x3'));var BPromise=require(_0xa03a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa03a('0x5'));var attributes=require('./chatApplication.attributes');module[_0xa03a('0x6')]=function(_0x3ba950,_0x333c93){return _0x3ba950[_0xa03a('0x7')]('ChatApplication',attributes,{'tableName':_0xa03a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa03a('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index b41c1a1..032efb9 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 _0xdd3f=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ChatApplication,\x20%s,\x20%s','lodash','moment','bluebird','randomstring'];(function(_0x502195,_0x24a1d8){var _0x490cfd=function(_0x89a7fd){while(--_0x89a7fd){_0x502195['push'](_0x502195['shift']());}};_0x490cfd(++_0x24a1d8);}(_0xdd3f,0xb4));var _0xfdd3=function(_0x9d835b,_0x150225){_0x9d835b=_0x9d835b-0x0;var _0xe0e98c=_0xdd3f[_0x9d835b];return _0xe0e98c;};'use strict';var _=require(_0xfdd3('0x0'));var util=require('util');var moment=require(_0xfdd3('0x1'));var BPromise=require(_0xfdd3('0x2'));var rs=require(_0xfdd3('0x3'));var fs=require('fs');var Redis=require(_0xfdd3('0x4'));var db=require(_0xfdd3('0x5'))['db'];var utils=require(_0xfdd3('0x6'));var logger=require(_0xfdd3('0x7'))(_0xfdd3('0x8'));var config=require(_0xfdd3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfdd3('0xa')][_0xfdd3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15b0e8,_0x2e4d17,_0x47ad60){return new BPromise(function(_0x2e150d,_0x18d978){return client[_0xfdd3('0xc')](_0x15b0e8,_0x47ad60)['then'](function(_0xb50d84){logger['info']('ChatApplication,\x20%s,\x20%s',_0x2e4d17,_0xfdd3('0xd'));logger['debug'](_0xfdd3('0xe'),_0x2e4d17,'request\x20sent',JSON[_0xfdd3('0xf')](_0xb50d84));if(_0xb50d84[_0xfdd3('0x10')]){if(_0xb50d84[_0xfdd3('0x10')][_0xfdd3('0x11')]===0x1f4){logger[_0xfdd3('0x10')]('ChatApplication,\x20%s,\x20%s',_0x2e4d17,_0xb50d84['error'][_0xfdd3('0x12')]);return _0x18d978(_0xb50d84[_0xfdd3('0x10')][_0xfdd3('0x12')]);}logger[_0xfdd3('0x10')]('ChatApplication,\x20%s,\x20%s',_0x2e4d17,_0xb50d84[_0xfdd3('0x10')][_0xfdd3('0x12')]);return _0x2e150d(_0xb50d84[_0xfdd3('0x10')][_0xfdd3('0x12')]);}else{logger[_0xfdd3('0x13')]('ChatApplication,\x20%s,\x20%s',_0x2e4d17,'request\x20sent');_0x2e150d(_0xb50d84[_0xfdd3('0x14')][_0xfdd3('0x12')]);}})[_0xfdd3('0x15')](function(_0x5df678){logger[_0xfdd3('0x10')](_0xfdd3('0x16'),_0x2e4d17,_0x5df678);_0x18d978(_0x5df678);});});}
\ No newline at end of file
+var _0x8532=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x22708b,_0x2bee57){var _0x3e0055=function(_0x2215a2){while(--_0x2215a2){_0x22708b['push'](_0x22708b['shift']());}};_0x3e0055(++_0x2bee57);}(_0x8532,0x1f3));var _0x2853=function(_0x499def,_0x1db2ff){_0x499def=_0x499def-0x0;var _0x5c33ec=_0x8532[_0x499def];return _0x5c33ec;};'use strict';var _=require(_0x2853('0x0'));var util=require(_0x2853('0x1'));var moment=require(_0x2853('0x2'));var BPromise=require('bluebird');var rs=require(_0x2853('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2853('0x4'))['db'];var utils=require(_0x2853('0x5'));var logger=require(_0x2853('0x6'))(_0x2853('0x7'));var config=require(_0x2853('0x8'));var jayson=require(_0x2853('0x9'));var client=jayson[_0x2853('0xa')][_0x2853('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x268bf8,_0x290559,_0x3f1da4){return new BPromise(function(_0x56c7ab,_0x112af5){return client[_0x2853('0xc')](_0x268bf8,_0x3f1da4)[_0x2853('0xd')](function(_0x4df9b7){logger[_0x2853('0xe')](_0x2853('0xf'),_0x290559,_0x2853('0x10'));logger[_0x2853('0x11')](_0x2853('0x12'),_0x290559,'request\x20sent',JSON['stringify'](_0x4df9b7));if(_0x4df9b7[_0x2853('0x13')]){if(_0x4df9b7[_0x2853('0x13')][_0x2853('0x14')]===0x1f4){logger[_0x2853('0x13')](_0x2853('0xf'),_0x290559,_0x4df9b7[_0x2853('0x13')][_0x2853('0x15')]);return _0x112af5(_0x4df9b7[_0x2853('0x13')]['message']);}logger[_0x2853('0x13')](_0x2853('0xf'),_0x290559,_0x4df9b7[_0x2853('0x13')][_0x2853('0x15')]);return _0x56c7ab(_0x4df9b7[_0x2853('0x13')][_0x2853('0x15')]);}else{logger['info'](_0x2853('0xf'),_0x290559,'request\x20sent');_0x56c7ab(_0x4df9b7[_0x2853('0x16')][_0x2853('0x15')]);}})[_0x2853('0x17')](function(_0x44490e){logger[_0x2853('0x13')](_0x2853('0xf'),_0x290559,_0x44490e);_0x112af5(_0x44490e);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 57a8a43..593438d 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 _0x98d2=['util','path','express','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','multer'];(function(_0x37951b,_0x41b79c){var _0x5d2855=function(_0x37432c){while(--_0x37432c){_0x37951b['push'](_0x37951b['shift']());}};_0x5d2855(++_0x41b79c);}(_0x98d2,0xfb));var _0x298d=function(_0x2c1e7a,_0x155f86){_0x2c1e7a=_0x2c1e7a-0x0;var _0xcacb4f=_0x98d2[_0x2c1e7a];return _0xcacb4f;};'use strict';var multer=require(_0x298d('0x0'));var util=require(_0x298d('0x1'));var path=require(_0x298d('0x2'));var timeout=require('connect-timeout');var express=require(_0x298d('0x3'));var router=express['Router']();var fs_extra=require(_0x298d('0x4'));var auth=require(_0x298d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x298d('0x6'));var controller=require(_0x298d('0x7'));router[_0x298d('0x8')](_0x298d('0x9'),auth[_0x298d('0xa')](),controller[_0x298d('0xb')]);router[_0x298d('0xc')](_0x298d('0x9'),auth[_0x298d('0xa')](),controller[_0x298d('0xd')]);router['delete'](_0x298d('0x9'),auth[_0x298d('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x2176=['/:id','show','put','isAuthenticated','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','get'];(function(_0x46723d,_0x3d6bd5){var _0x5e2b3a=function(_0x1a3c33){while(--_0x1a3c33){_0x46723d['push'](_0x46723d['shift']());}};_0x5e2b3a(++_0x3d6bd5);}(_0x2176,0x17e));var _0x6217=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2176[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x6217('0x0'));var util=require(_0x6217('0x1'));var path=require(_0x6217('0x2'));var timeout=require(_0x6217('0x3'));var express=require(_0x6217('0x4'));var router=express['Router']();var fs_extra=require(_0x6217('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6217('0x6'));var controller=require('./chatApplication.controller');router[_0x6217('0x7')](_0x6217('0x8'),auth['isAuthenticated'](),controller[_0x6217('0x9')]);router[_0x6217('0xa')](_0x6217('0x8'),auth[_0x6217('0xb')](),controller[_0x6217('0xc')]);router[_0x6217('0xd')](_0x6217('0x8'),auth[_0x6217('0xb')](),controller['destroy']);module[_0x6217('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 9c408ca..870f261 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 _0x3249=['STRING','BOOLEAN','sequelize','exports'];(function(_0x3815c2,_0x1f54e3){var _0x271f88=function(_0x53963c){while(--_0x53963c){_0x3815c2['push'](_0x3815c2['shift']());}};_0x271f88(++_0x1f54e3);}(_0x3249,0xd2));var _0x9324=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x3249[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require(_0x9324('0x0'));module[_0x9324('0x1')]={'name':{'type':Sequelize[_0x9324('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x9324('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xdb82=['sequelize','STRING'];(function(_0x3c2863,_0x1b2cee){var _0x2c3d27=function(_0x4f831b){while(--_0x4f831b){_0x3c2863['push'](_0x3c2863['shift']());}};_0x2c3d27(++_0x1b2cee);}(_0xdb82,0x1dc));var _0x2db8=function(_0x19bfd1,_0xa61e9c){_0x19bfd1=_0x19bfd1-0x0;var _0xd5d89a=_0xdb82[_0x19bfd1];return _0xd5d89a;};'use strict';var Sequelize=require(_0x2db8('0x0'));module['exports']={'name':{'type':Sequelize[_0x2db8('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x2db8('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index b642575..78cb1eb 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 _0x9a9d=['fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','error','stack','name','send','map','ChatGroup','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','findAll','rows','show','params','keys','include','options','find','catch','create','body','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf'];(function(_0x1a2ecd,_0xc517f8){var _0x3f7b51=function(_0x4c6f99){while(--_0x4c6f99){_0x1a2ecd['push'](_0x1a2ecd['shift']());}};_0x3f7b51(++_0xc517f8);}(_0x9a9d,0x17e));var _0xd9a9=function(_0x23f071,_0x50c494){_0x23f071=_0x23f071-0x0;var _0x1020be=_0x9a9d[_0x23f071];return _0x1020be;};'use strict';var emlformat=require(_0xd9a9('0x0'));var rimraf=require(_0xd9a9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd9a9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd9a9('0x3'));var Mustache=require(_0xd9a9('0x4'));var util=require(_0xd9a9('0x5'));var path=require(_0xd9a9('0x6'));var sox=require(_0xd9a9('0x7'));var csv=require(_0xd9a9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd9a9('0x9'));var _=require(_0xd9a9('0xa'));var squel=require(_0xd9a9('0xb'));var crypto=require(_0xd9a9('0xc'));var jsforce=require(_0xd9a9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd9a9('0x8'));var querystring=require(_0xd9a9('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd9a9('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd9a9('0x10'));var hardwareService=require(_0xd9a9('0x11'));var logger=require(_0xd9a9('0x12'))(_0xd9a9('0x13'));var utils=require(_0xd9a9('0x14'));var config=require(_0xd9a9('0x15'));var licenseUtil=require(_0xd9a9('0x16'));var db=require('../../mysqldb')['db'];config[_0xd9a9('0x17')]=_[_0xd9a9('0x18')](config[_0xd9a9('0x17')],{'host':_0xd9a9('0x19'),'port':0x18eb});var socket=require(_0xd9a9('0x1a'))(new Redis(config[_0xd9a9('0x17')]));require('./chatGroup.socket')[_0xd9a9('0x1b')](socket);function respondWithStatusCode(_0x1358da,_0x4a3195){_0x4a3195=_0x4a3195||0xcc;return function(_0x368cbb){if(_0x368cbb){return _0x1358da[_0xd9a9('0x1c')](_0x4a3195);}return _0x1358da['status'](_0x4a3195)[_0xd9a9('0x1d')]();};}function respondWithResult(_0x3b633f,_0x300fdf){_0x300fdf=_0x300fdf||0xc8;return function(_0x1b483d){if(_0x1b483d){return _0x3b633f[_0xd9a9('0x1e')](_0x300fdf)[_0xd9a9('0x1f')](_0x1b483d);}};}function respondWithFilteredResult(_0xb0fce2,_0x3957a2){return function(_0x5cf1c5){if(_0x5cf1c5){var _0x1cc3d9=typeof _0x3957a2['offset']===_0xd9a9('0x20')&&typeof _0x3957a2[_0xd9a9('0x21')]===_0xd9a9('0x20');var _0x2bc4af=_0x5cf1c5[_0xd9a9('0x22')];var _0x78a7fe=_0x1cc3d9?0x0:_0x3957a2[_0xd9a9('0x23')];var _0x142fba=_0x1cc3d9?_0x5cf1c5[_0xd9a9('0x22')]:_0x3957a2[_0xd9a9('0x23')]+_0x3957a2[_0xd9a9('0x21')];var _0x253f62;if(_0x142fba>=_0x2bc4af){_0x142fba=_0x2bc4af;_0x253f62=0xc8;}else{_0x253f62=0xce;}_0xb0fce2[_0xd9a9('0x1e')](_0x253f62);return _0xb0fce2[_0xd9a9('0x24')](_0xd9a9('0x25'),_0x78a7fe+'-'+_0x142fba+'/'+_0x2bc4af)[_0xd9a9('0x1f')](_0x5cf1c5);}return null;};}function patchUpdates(_0x3e9986){return function(_0x55add9){try{jsonpatch[_0xd9a9('0x26')](_0x55add9,_0x3e9986,!![]);}catch(_0x494051){return BPromise[_0xd9a9('0x27')](_0x494051);}return _0x55add9['save']();};}function saveUpdates(_0x2310d1,_0x1f2f34){return function(_0x16f2c7){if(_0x16f2c7){return _0x16f2c7[_0xd9a9('0x28')](_0x2310d1)['then'](function(_0x2436f0){return _0x2436f0;});}return null;};}function removeEntity(_0x4f0e1f,_0x5316c4){return function(_0x575751){if(_0x575751){return _0x575751['destroy']()[_0xd9a9('0x29')](function(){_0x4f0e1f[_0xd9a9('0x1e')](0xcc)[_0xd9a9('0x1d')]();});}};}function handleEntityNotFound(_0xd44fcd,_0x26c4a6){return function(_0x4c7794){if(!_0x4c7794){_0xd44fcd[_0xd9a9('0x1c')](0x194);}return _0x4c7794;};}function handleError(_0x17eaf6,_0x968d0b){_0x968d0b=_0x968d0b||0x1f4;return function(_0x432c84){logger[_0xd9a9('0x2a')](_0x432c84[_0xd9a9('0x2b')]);if(_0x432c84[_0xd9a9('0x2c')]){delete _0x432c84[_0xd9a9('0x2c')];}_0x17eaf6[_0xd9a9('0x1e')](_0x968d0b)[_0xd9a9('0x2d')](_0x432c84);};}exports['index']=function(_0x2c0f5f,_0x6c24d5){var _0x373417={},_0x59bc40={},_0x367478={'count':0x0,'rows':[]};var _0x3d6184=_[_0xd9a9('0x2e')](db[_0xd9a9('0x2f')][_0xd9a9('0x30')],function(_0x2d2a39){return{'name':_0x2d2a39[_0xd9a9('0x31')],'type':_0x2d2a39[_0xd9a9('0x32')]['key']};});_0x59bc40[_0xd9a9('0x33')]=_[_0xd9a9('0x2e')](_0x3d6184,_0xd9a9('0x2c'));_0x59bc40['query']=_['keys'](_0x2c0f5f[_0xd9a9('0x34')]);_0x59bc40[_0xd9a9('0x35')]=_[_0xd9a9('0x36')](_0x59bc40[_0xd9a9('0x33')],_0x59bc40[_0xd9a9('0x34')]);_0x373417[_0xd9a9('0x37')]=_[_0xd9a9('0x36')](_0x59bc40[_0xd9a9('0x33')],qs[_0xd9a9('0x38')](_0x2c0f5f[_0xd9a9('0x34')]['fields']));_0x373417['attributes']=_0x373417[_0xd9a9('0x37')][_0xd9a9('0x39')]?_0x373417[_0xd9a9('0x37')]:_0x59bc40[_0xd9a9('0x33')];if(!_0x2c0f5f[_0xd9a9('0x34')][_0xd9a9('0x3a')](_0xd9a9('0x3b'))){_0x373417[_0xd9a9('0x21')]=qs[_0xd9a9('0x21')](_0x2c0f5f[_0xd9a9('0x34')][_0xd9a9('0x21')]);_0x373417['offset']=qs[_0xd9a9('0x23')](_0x2c0f5f[_0xd9a9('0x34')]['offset']);}_0x373417[_0xd9a9('0x3c')]=qs[_0xd9a9('0x3d')](_0x2c0f5f['query'][_0xd9a9('0x3d')]);_0x373417[_0xd9a9('0x3e')]=qs[_0xd9a9('0x35')](_[_0xd9a9('0x3f')](_0x2c0f5f[_0xd9a9('0x34')],_0x59bc40[_0xd9a9('0x35')]),_0x3d6184);if(_0x2c0f5f[_0xd9a9('0x34')][_0xd9a9('0x40')]){_0x373417[_0xd9a9('0x3e')]=_['merge'](_0x373417['where'],{'$or':_[_0xd9a9('0x2e')](_0x3d6184,function(_0x4611e4){if(_0x4611e4[_0xd9a9('0x32')]!==_0xd9a9('0x41')){var _0x16cae0={};_0x16cae0[_0x4611e4[_0xd9a9('0x2c')]]={'$like':'%'+_0x2c0f5f[_0xd9a9('0x34')][_0xd9a9('0x40')]+'%'};return _0x16cae0;}})});}_0x373417=_[_0xd9a9('0x42')]({},_0x373417,_0x2c0f5f['options']);var _0x29ed93={'where':_0x373417[_0xd9a9('0x3e')]};return db[_0xd9a9('0x2f')][_0xd9a9('0x22')](_0x29ed93)[_0xd9a9('0x29')](function(_0x3eacab){_0x367478[_0xd9a9('0x22')]=_0x3eacab;if(_0x2c0f5f['query'][_0xd9a9('0x43')]){_0x373417['include']=[{'all':!![]}];}return db[_0xd9a9('0x2f')][_0xd9a9('0x44')](_0x373417);})[_0xd9a9('0x29')](function(_0x40f1aa){_0x367478[_0xd9a9('0x45')]=_0x40f1aa;return _0x367478;})[_0xd9a9('0x29')](respondWithFilteredResult(_0x6c24d5,_0x373417))['catch'](handleError(_0x6c24d5,null));};exports[_0xd9a9('0x46')]=function(_0x3ec264,_0x4d61f6){var _0x505ac8={'raw':!![],'where':{'id':_0x3ec264[_0xd9a9('0x47')]['id']}},_0x3453ba={};_0x3453ba[_0xd9a9('0x33')]=_[_0xd9a9('0x48')](db['ChatGroup']['rawAttributes']);_0x3453ba[_0xd9a9('0x34')]=_[_0xd9a9('0x48')](_0x3ec264[_0xd9a9('0x34')]);_0x3453ba[_0xd9a9('0x35')]=_[_0xd9a9('0x36')](_0x3453ba[_0xd9a9('0x33')],_0x3453ba[_0xd9a9('0x34')]);_0x505ac8[_0xd9a9('0x37')]=_[_0xd9a9('0x36')](_0x3453ba[_0xd9a9('0x33')],qs[_0xd9a9('0x38')](_0x3ec264[_0xd9a9('0x34')][_0xd9a9('0x38')]));_0x505ac8[_0xd9a9('0x37')]=_0x505ac8[_0xd9a9('0x37')]['length']?_0x505ac8[_0xd9a9('0x37')]:_0x3453ba[_0xd9a9('0x33')];if(_0x3ec264[_0xd9a9('0x34')][_0xd9a9('0x43')]){_0x505ac8[_0xd9a9('0x49')]=[{'all':!![]}];}_0x505ac8=_[_0xd9a9('0x42')]({},_0x505ac8,_0x3ec264[_0xd9a9('0x4a')]);return db[_0xd9a9('0x2f')][_0xd9a9('0x4b')](_0x505ac8)[_0xd9a9('0x29')](handleEntityNotFound(_0x4d61f6,null))['then'](respondWithResult(_0x4d61f6,null))[_0xd9a9('0x4c')](handleError(_0x4d61f6,null));};exports[_0xd9a9('0x4d')]=function(_0x31469e,_0x5d068d){return db[_0xd9a9('0x2f')][_0xd9a9('0x4d')](_0x31469e['body'],{})[_0xd9a9('0x29')](respondWithResult(_0x5d068d,0xc9))[_0xd9a9('0x4c')](handleError(_0x5d068d,null));};exports[_0xd9a9('0x28')]=function(_0x2eac5f,_0x1fc12b){if(_0x2eac5f['body']['id']){delete _0x2eac5f['body']['id'];}return db['ChatGroup'][_0xd9a9('0x4b')]({'where':{'id':_0x2eac5f[_0xd9a9('0x47')]['id']}})[_0xd9a9('0x29')](handleEntityNotFound(_0x1fc12b,null))[_0xd9a9('0x29')](saveUpdates(_0x2eac5f[_0xd9a9('0x4e')],null))['then'](respondWithResult(_0x1fc12b,null))[_0xd9a9('0x4c')](handleError(_0x1fc12b,null));};exports['destroy']=function(_0x5d3225,_0x369280){return db[_0xd9a9('0x2f')][_0xd9a9('0x4b')]({'where':{'id':_0x5d3225[_0xd9a9('0x47')]['id']}})[_0xd9a9('0x29')](handleEntityNotFound(_0x369280,null))[_0xd9a9('0x29')](removeEntity(_0x369280,null))[_0xd9a9('0x4c')](handleError(_0x369280,null));};exports[_0xd9a9('0x4f')]=function(_0x28a69a,_0x4642ea){return db[_0xd9a9('0x2f')][_0xd9a9('0x4f')]()[_0xd9a9('0x29')](respondWithResult(_0x4642ea,null))[_0xd9a9('0x4c')](handleError(_0x4642ea,null));};exports['getUnread']=function(_0x2d6c4a,_0x415a1e,_0x5a67b4){return db[_0xd9a9('0x50')][_0xd9a9('0x22')]({'where':{'ChatGroupId':_0x2d6c4a[_0xd9a9('0x47')]['id'],'ToId':_0x2d6c4a[_0xd9a9('0x51')]['id'],'read':![]}})[_0xd9a9('0x29')](function(_0x3ebd29){return{'id':_[_0xd9a9('0x52')](_0x2d6c4a['params']['id']),'count':_0x3ebd29};})[_0xd9a9('0x29')](respondWithResult(_0x415a1e,null))[_0xd9a9('0x4c')](handleError(_0x415a1e,null));};exports[_0xd9a9('0x53')]=function(_0x35b923,_0x31b550,_0x3c915a){return db[_0xd9a9('0x2f')][_0xd9a9('0x4b')]({'where':{'id':_0x35b923[_0xd9a9('0x47')]['id']}})[_0xd9a9('0x29')](handleEntityNotFound(_0x31b550,null))['then'](function(_0x309bb9){if(_0x309bb9){return _0x309bb9['addMembers'](_0x35b923[_0xd9a9('0x4e')][_0xd9a9('0x54')],_[_0xd9a9('0x55')](_0x35b923[_0xd9a9('0x4e')],[_0xd9a9('0x54'),'id'])||{});}})['then'](respondWithResult(_0x31b550,null))[_0xd9a9('0x4c')](handleError(_0x31b550,null));};exports[_0xd9a9('0x56')]=function(_0x617f58,_0x27773a,_0x2ea197){var _0x568bec={};var _0x57a0c2={};var _0x1f2059;var _0x40baee;return db[_0xd9a9('0x2f')][_0xd9a9('0x57')]({'where':{'id':_0x617f58['params']['id']}})[_0xd9a9('0x29')](handleEntityNotFound(_0x27773a,null))['then'](function(_0x54a1c7){if(_0x54a1c7){_0x1f2059=_0x54a1c7;_0x57a0c2[_0xd9a9('0x33')]=_[_0xd9a9('0x48')](db[_0xd9a9('0x58')]['rawAttributes']);_0x57a0c2[_0xd9a9('0x34')]=_[_0xd9a9('0x48')](_0x617f58['query']);_0x57a0c2[_0xd9a9('0x35')]=_[_0xd9a9('0x36')](_0x57a0c2[_0xd9a9('0x33')],_0x57a0c2[_0xd9a9('0x34')]);_0x568bec[_0xd9a9('0x37')]=_['intersection'](_0x57a0c2['model'],qs['fields'](_0x617f58[_0xd9a9('0x34')]['fields']));_0x568bec['attributes']=_0x568bec[_0xd9a9('0x37')]['length']?_0x568bec[_0xd9a9('0x37')]:_0x57a0c2[_0xd9a9('0x33')];_0x568bec[_0xd9a9('0x3c')]=qs[_0xd9a9('0x3d')](_0x617f58[_0xd9a9('0x34')][_0xd9a9('0x3d')]);_0x568bec[_0xd9a9('0x3e')]=qs[_0xd9a9('0x35')](_['pick'](_0x617f58[_0xd9a9('0x34')],_0x57a0c2[_0xd9a9('0x35')]));if(_0x617f58[_0xd9a9('0x34')][_0xd9a9('0x40')]){_0x568bec[_0xd9a9('0x3e')]=_['merge'](_0x568bec['where'],{'$or':_[_0xd9a9('0x2e')](_0x568bec['attributes'],function(_0x378111){var _0x1bef37={};_0x1bef37[_0x378111]={'$like':'%'+_0x617f58['query'][_0xd9a9('0x40')]+'%'};return _0x1bef37;})});}_0x568bec=_[_0xd9a9('0x42')]({},_0x568bec,_0x617f58[_0xd9a9('0x4a')]);return _0x1f2059[_0xd9a9('0x56')](_0x568bec);}})[_0xd9a9('0x29')](function(_0x1cd86b){if(_0x1cd86b){_0x40baee=_0x1cd86b[_0xd9a9('0x39')];if(!_0x617f58['query']['hasOwnProperty'](_0xd9a9('0x3b'))){_0x568bec['limit']=qs['limit'](_0x617f58[_0xd9a9('0x34')][_0xd9a9('0x21')]);_0x568bec[_0xd9a9('0x23')]=qs['offset'](_0x617f58[_0xd9a9('0x34')][_0xd9a9('0x23')]);}return _0x1f2059['getMembers'](_0x568bec);}})['then'](function(_0x49cc50){if(_0x49cc50){return _0x49cc50?{'count':_0x40baee,'rows':_0x49cc50}:null;}})[_0xd9a9('0x29')](respondWithResult(_0x27773a,null))[_0xd9a9('0x4c')](handleError(_0x27773a,null));};exports[_0xd9a9('0x59')]=function(_0x49ddb1,_0x25e948,_0x4898e8){return db[_0xd9a9('0x2f')][_0xd9a9('0x4b')]({'where':{'id':_0x49ddb1[_0xd9a9('0x47')]['id']}})[_0xd9a9('0x29')](handleEntityNotFound(_0x25e948,null))['then'](function(_0x4da13a){if(_0x4da13a){return _0x4da13a['removeMembers'](_0x49ddb1[_0xd9a9('0x34')][_0xd9a9('0x54')]);}})[_0xd9a9('0x29')](respondWithStatusCode(_0x25e948,null))[_0xd9a9('0x4c')](handleError(_0x25e948,null));};exports['addMessage']=function(_0xa56403,_0xafe1c5,_0x4667dc){if(_0xa56403[_0xd9a9('0x4e')]['id']){delete _0xa56403[_0xd9a9('0x4e')]['id'];}return db[_0xd9a9('0x2f')][_0xd9a9('0x4b')]({'where':{'id':_0xa56403[_0xd9a9('0x47')]['id']}})[_0xd9a9('0x29')](handleEntityNotFound(_0xafe1c5,null))[_0xd9a9('0x29')](function(_0x2db257){if(_0x2db257){_0xa56403['body'][_0xd9a9('0x5a')]=_0x2db257['id'];return db['ChatInternalMessage'][_0xd9a9('0x4d')](_0xa56403[_0xd9a9('0x4e')]);}})['then'](respondWithResult(_0xafe1c5,null))['catch'](handleError(_0xafe1c5,null));};exports['getMessages']=function(_0x37dbf4,_0x456ff8,_0x122f4e){var _0x30366a={};var _0x4d5b22={};var _0x4b2bfe;var _0xd5914b;return db[_0xd9a9('0x2f')][_0xd9a9('0x57')]({'where':{'id':_0x37dbf4[_0xd9a9('0x47')]['id']}})[_0xd9a9('0x29')](handleEntityNotFound(_0x456ff8,null))['then'](function(_0x50065b){if(_0x50065b){_0x4b2bfe=_0x50065b;_0x4d5b22['model']=_[_0xd9a9('0x48')](db['ChatInternalMessage'][_0xd9a9('0x30')]);_0x4d5b22[_0xd9a9('0x34')]=_['keys'](_0x37dbf4[_0xd9a9('0x34')]);_0x4d5b22[_0xd9a9('0x35')]=_[_0xd9a9('0x36')](_0x4d5b22[_0xd9a9('0x33')],_0x4d5b22[_0xd9a9('0x34')]);_0x30366a[_0xd9a9('0x37')]=_[_0xd9a9('0x36')](_0x4d5b22['model'],qs[_0xd9a9('0x38')](_0x37dbf4[_0xd9a9('0x34')][_0xd9a9('0x38')]));_0x30366a['attributes']=_0x30366a[_0xd9a9('0x37')]['length']?_0x30366a[_0xd9a9('0x37')]:_0x4d5b22[_0xd9a9('0x33')];_0x30366a[_0xd9a9('0x3c')]=qs[_0xd9a9('0x3d')](_0x37dbf4['query'][_0xd9a9('0x3d')]);_0x30366a[_0xd9a9('0x3e')]=qs[_0xd9a9('0x35')](_[_0xd9a9('0x3f')](_0x37dbf4[_0xd9a9('0x34')],_0x4d5b22[_0xd9a9('0x35')]));if(_0x37dbf4[_0xd9a9('0x34')][_0xd9a9('0x40')]){_0x30366a[_0xd9a9('0x3e')]=_[_0xd9a9('0x42')](_0x30366a[_0xd9a9('0x3e')],{'$or':_[_0xd9a9('0x2e')](_0x30366a[_0xd9a9('0x37')],function(_0x224f98){var _0x59c761={};_0x59c761[_0x224f98]={'$like':'%'+_0x37dbf4[_0xd9a9('0x34')][_0xd9a9('0x40')]+'%'};return _0x59c761;})});}if(_0x37dbf4[_0xd9a9('0x34')][_0xd9a9('0x5b')]){var _0xf6af49=_0x37dbf4[_0xd9a9('0x34')][_0xd9a9('0x5b')][_0xd9a9('0x5c')](',');var _0x4669b2={};_0x4669b2[_0xf6af49[0x0]]={'$gte':moment(_0xf6af49[0x1])[_0xd9a9('0x5d')](_0xd9a9('0x5e'))};_0x30366a[_0xd9a9('0x3e')]=_[_0xd9a9('0x42')](_0x30366a['where'],_0x4669b2);}_0x30366a=_['merge']({},_0x30366a,_0x37dbf4[_0xd9a9('0x4a')]);return _0x4b2bfe['getMessages'](_0x30366a);}})[_0xd9a9('0x29')](function(_0x22ce17){if(_0x22ce17){_0xd5914b=_0x22ce17[_0xd9a9('0x39')];if(!_0x37dbf4[_0xd9a9('0x34')][_0xd9a9('0x3a')](_0xd9a9('0x3b'))){_0x30366a[_0xd9a9('0x21')]=qs[_0xd9a9('0x21')](_0x37dbf4[_0xd9a9('0x34')]['limit']);_0x30366a['offset']=qs[_0xd9a9('0x23')](_0x37dbf4['query'][_0xd9a9('0x23')]);}return _0x4b2bfe[_0xd9a9('0x5f')](_0x30366a);}})[_0xd9a9('0x29')](function(_0x563728){if(_0x563728){return _0x563728?{'count':_0xd5914b,'rows':_0x563728}:null;}})['then'](respondWithResult(_0x456ff8,null))['catch'](handleError(_0x456ff8,null));};
\ No newline at end of file
+var _0x945d=['util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','reject','then','destroy','error','stack','name','index','map','ChatGroup','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','params','options','find','create','body','update','describe','getUnread','ChatInternalMessage','user','addMembers','ids','getMembers','User','removeMembers','addMessage','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x295df8,_0x1f9924){var _0x1c4b61=function(_0x55f262){while(--_0x55f262){_0x295df8['push'](_0x295df8['shift']());}};_0x1c4b61(++_0x1f9924);}(_0x945d,0x112));var _0xd945=function(_0x482f68,_0x274c1d){_0x482f68=_0x482f68-0x0;var _0x2b5a77=_0x945d[_0x482f68];return _0x2b5a77;};'use strict';var emlformat=require(_0xd945('0x0'));var rimraf=require(_0xd945('0x1'));var zipdir=require(_0xd945('0x2'));var jsonpatch=require(_0xd945('0x3'));var rp=require(_0xd945('0x4'));var moment=require(_0xd945('0x5'));var BPromise=require(_0xd945('0x6'));var Mustache=require(_0xd945('0x7'));var util=require(_0xd945('0x8'));var path=require(_0xd945('0x9'));var sox=require(_0xd945('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd945('0xb'));var _=require(_0xd945('0xc'));var squel=require(_0xd945('0xd'));var crypto=require(_0xd945('0xe'));var jsforce=require(_0xd945('0xf'));var deskjs=require(_0xd945('0x10'));var toCsv=require(_0xd945('0x11'));var querystring=require(_0xd945('0x12'));var Papa=require(_0xd945('0x13'));var Redis=require('ioredis');var authService=require(_0xd945('0x14'));var qs=require(_0xd945('0x15'));var as=require(_0xd945('0x16'));var hardwareService=require(_0xd945('0x17'));var logger=require(_0xd945('0x18'))(_0xd945('0x19'));var utils=require(_0xd945('0x1a'));var config=require(_0xd945('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xd945('0x1c'))['db'];config[_0xd945('0x1d')]=_['defaults'](config[_0xd945('0x1d')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd945('0x1d')]));require(_0xd945('0x1e'))[_0xd945('0x1f')](socket);function respondWithStatusCode(_0x2a6ff6,_0x2ec2a7){_0x2ec2a7=_0x2ec2a7||0xcc;return function(_0x3fe7a0){if(_0x3fe7a0){return _0x2a6ff6[_0xd945('0x20')](_0x2ec2a7);}return _0x2a6ff6[_0xd945('0x21')](_0x2ec2a7)[_0xd945('0x22')]();};}function respondWithResult(_0x1cfebf,_0x2bce57){_0x2bce57=_0x2bce57||0xc8;return function(_0xe36b23){if(_0xe36b23){return _0x1cfebf['status'](_0x2bce57)[_0xd945('0x23')](_0xe36b23);}};}function respondWithFilteredResult(_0xa324e7,_0xe4a797){return function(_0x4b8a5f){if(_0x4b8a5f){var _0x4d7419=typeof _0xe4a797[_0xd945('0x24')]===_0xd945('0x25')&&typeof _0xe4a797[_0xd945('0x26')]===_0xd945('0x25');var _0x5aac17=_0x4b8a5f['count'];var _0x4e7139=_0x4d7419?0x0:_0xe4a797[_0xd945('0x24')];var _0x1efe3b=_0x4d7419?_0x4b8a5f['count']:_0xe4a797[_0xd945('0x24')]+_0xe4a797[_0xd945('0x26')];var _0x43d69a;if(_0x1efe3b>=_0x5aac17){_0x1efe3b=_0x5aac17;_0x43d69a=0xc8;}else{_0x43d69a=0xce;}_0xa324e7[_0xd945('0x21')](_0x43d69a);return _0xa324e7[_0xd945('0x27')]('Content-Range',_0x4e7139+'-'+_0x1efe3b+'/'+_0x5aac17)[_0xd945('0x23')](_0x4b8a5f);}return null;};}function patchUpdates(_0x2ef7cb){return function(_0x4292dc){try{jsonpatch['apply'](_0x4292dc,_0x2ef7cb,!![]);}catch(_0xddcafe){return BPromise[_0xd945('0x28')](_0xddcafe);}return _0x4292dc['save']();};}function saveUpdates(_0x5951af,_0x2b4717){return function(_0x2f8eb0){if(_0x2f8eb0){return _0x2f8eb0['update'](_0x5951af)[_0xd945('0x29')](function(_0xc0a73d){return _0xc0a73d;});}return null;};}function removeEntity(_0x147c69,_0x5a26a2){return function(_0x12e1ad){if(_0x12e1ad){return _0x12e1ad[_0xd945('0x2a')]()[_0xd945('0x29')](function(){_0x147c69[_0xd945('0x21')](0xcc)[_0xd945('0x22')]();});}};}function handleEntityNotFound(_0x552276,_0x30dd2c){return function(_0x118bb1){if(!_0x118bb1){_0x552276[_0xd945('0x20')](0x194);}return _0x118bb1;};}function handleError(_0x5de59c,_0x2a2534){_0x2a2534=_0x2a2534||0x1f4;return function(_0x5409c9){logger[_0xd945('0x2b')](_0x5409c9[_0xd945('0x2c')]);if(_0x5409c9['name']){delete _0x5409c9[_0xd945('0x2d')];}_0x5de59c[_0xd945('0x21')](_0x2a2534)['send'](_0x5409c9);};}exports[_0xd945('0x2e')]=function(_0x4b7786,_0x2139a5){var _0x37cbd8={},_0x45640a={},_0x32dc93={'count':0x0,'rows':[]};var _0x22170f=_[_0xd945('0x2f')](db[_0xd945('0x30')][_0xd945('0x31')],function(_0x5b57d1){return{'name':_0x5b57d1['fieldName'],'type':_0x5b57d1[_0xd945('0x32')]['key']};});_0x45640a[_0xd945('0x33')]=_[_0xd945('0x2f')](_0x22170f,_0xd945('0x2d'));_0x45640a[_0xd945('0x34')]=_[_0xd945('0x35')](_0x4b7786['query']);_0x45640a[_0xd945('0x36')]=_[_0xd945('0x37')](_0x45640a[_0xd945('0x33')],_0x45640a['query']);_0x37cbd8[_0xd945('0x38')]=_[_0xd945('0x37')](_0x45640a[_0xd945('0x33')],qs['fields'](_0x4b7786[_0xd945('0x34')][_0xd945('0x39')]));_0x37cbd8[_0xd945('0x38')]=_0x37cbd8['attributes'][_0xd945('0x3a')]?_0x37cbd8[_0xd945('0x38')]:_0x45640a[_0xd945('0x33')];if(!_0x4b7786[_0xd945('0x34')][_0xd945('0x3b')](_0xd945('0x3c'))){_0x37cbd8[_0xd945('0x26')]=qs[_0xd945('0x26')](_0x4b7786[_0xd945('0x34')][_0xd945('0x26')]);_0x37cbd8[_0xd945('0x24')]=qs[_0xd945('0x24')](_0x4b7786[_0xd945('0x34')]['offset']);}_0x37cbd8[_0xd945('0x3d')]=qs[_0xd945('0x3e')](_0x4b7786[_0xd945('0x34')][_0xd945('0x3e')]);_0x37cbd8[_0xd945('0x3f')]=qs['filters'](_[_0xd945('0x40')](_0x4b7786[_0xd945('0x34')],_0x45640a[_0xd945('0x36')]),_0x22170f);if(_0x4b7786[_0xd945('0x34')][_0xd945('0x41')]){_0x37cbd8['where']=_[_0xd945('0x42')](_0x37cbd8[_0xd945('0x3f')],{'$or':_[_0xd945('0x2f')](_0x22170f,function(_0x375ea0){if(_0x375ea0['type']!==_0xd945('0x43')){var _0x414eab={};_0x414eab[_0x375ea0[_0xd945('0x2d')]]={'$like':'%'+_0x4b7786[_0xd945('0x34')][_0xd945('0x41')]+'%'};return _0x414eab;}})});}_0x37cbd8=_['merge']({},_0x37cbd8,_0x4b7786['options']);var _0x56c8b9={'where':_0x37cbd8[_0xd945('0x3f')]};return db[_0xd945('0x30')][_0xd945('0x44')](_0x56c8b9)[_0xd945('0x29')](function(_0x6b2a98){_0x32dc93[_0xd945('0x44')]=_0x6b2a98;if(_0x4b7786[_0xd945('0x34')][_0xd945('0x45')]){_0x37cbd8[_0xd945('0x46')]=[{'all':!![]}];}return db[_0xd945('0x30')][_0xd945('0x47')](_0x37cbd8);})[_0xd945('0x29')](function(_0x5272b3){_0x32dc93[_0xd945('0x48')]=_0x5272b3;return _0x32dc93;})[_0xd945('0x29')](respondWithFilteredResult(_0x2139a5,_0x37cbd8))[_0xd945('0x49')](handleError(_0x2139a5,null));};exports['show']=function(_0x1f8650,_0x3bc9c0){var _0x21132a={'raw':!![],'where':{'id':_0x1f8650[_0xd945('0x4a')]['id']}},_0x1100e4={};_0x1100e4[_0xd945('0x33')]=_['keys'](db[_0xd945('0x30')][_0xd945('0x31')]);_0x1100e4[_0xd945('0x34')]=_[_0xd945('0x35')](_0x1f8650[_0xd945('0x34')]);_0x1100e4[_0xd945('0x36')]=_[_0xd945('0x37')](_0x1100e4[_0xd945('0x33')],_0x1100e4[_0xd945('0x34')]);_0x21132a['attributes']=_[_0xd945('0x37')](_0x1100e4[_0xd945('0x33')],qs[_0xd945('0x39')](_0x1f8650[_0xd945('0x34')]['fields']));_0x21132a[_0xd945('0x38')]=_0x21132a[_0xd945('0x38')][_0xd945('0x3a')]?_0x21132a[_0xd945('0x38')]:_0x1100e4['model'];if(_0x1f8650[_0xd945('0x34')][_0xd945('0x45')]){_0x21132a[_0xd945('0x46')]=[{'all':!![]}];}_0x21132a=_[_0xd945('0x42')]({},_0x21132a,_0x1f8650[_0xd945('0x4b')]);return db[_0xd945('0x30')][_0xd945('0x4c')](_0x21132a)[_0xd945('0x29')](handleEntityNotFound(_0x3bc9c0,null))[_0xd945('0x29')](respondWithResult(_0x3bc9c0,null))[_0xd945('0x49')](handleError(_0x3bc9c0,null));};exports[_0xd945('0x4d')]=function(_0x5e076d,_0x52f7fc){return db[_0xd945('0x30')][_0xd945('0x4d')](_0x5e076d[_0xd945('0x4e')],{})[_0xd945('0x29')](respondWithResult(_0x52f7fc,0xc9))[_0xd945('0x49')](handleError(_0x52f7fc,null));};exports[_0xd945('0x4f')]=function(_0x2c3086,_0x3a38f7){if(_0x2c3086[_0xd945('0x4e')]['id']){delete _0x2c3086['body']['id'];}return db[_0xd945('0x30')][_0xd945('0x4c')]({'where':{'id':_0x2c3086[_0xd945('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3a38f7,null))['then'](saveUpdates(_0x2c3086['body'],null))[_0xd945('0x29')](respondWithResult(_0x3a38f7,null))[_0xd945('0x49')](handleError(_0x3a38f7,null));};exports[_0xd945('0x2a')]=function(_0x5df992,_0x4048e9){return db[_0xd945('0x30')][_0xd945('0x4c')]({'where':{'id':_0x5df992[_0xd945('0x4a')]['id']}})[_0xd945('0x29')](handleEntityNotFound(_0x4048e9,null))[_0xd945('0x29')](removeEntity(_0x4048e9,null))[_0xd945('0x49')](handleError(_0x4048e9,null));};exports[_0xd945('0x50')]=function(_0x941b74,_0x4f1ae7){return db[_0xd945('0x30')][_0xd945('0x50')]()[_0xd945('0x29')](respondWithResult(_0x4f1ae7,null))[_0xd945('0x49')](handleError(_0x4f1ae7,null));};exports[_0xd945('0x51')]=function(_0x5245b2,_0x12a59e,_0x36adfd){return db[_0xd945('0x52')][_0xd945('0x44')]({'where':{'ChatGroupId':_0x5245b2['params']['id'],'ToId':_0x5245b2[_0xd945('0x53')]['id'],'read':![]}})['then'](function(_0x1692ec){return{'id':_['toInteger'](_0x5245b2[_0xd945('0x4a')]['id']),'count':_0x1692ec};})[_0xd945('0x29')](respondWithResult(_0x12a59e,null))[_0xd945('0x49')](handleError(_0x12a59e,null));};exports[_0xd945('0x54')]=function(_0x216877,_0x44ed16,_0x3e0b8f){return db['ChatGroup'][_0xd945('0x4c')]({'where':{'id':_0x216877[_0xd945('0x4a')]['id']}})[_0xd945('0x29')](handleEntityNotFound(_0x44ed16,null))[_0xd945('0x29')](function(_0xaa8c7){if(_0xaa8c7){return _0xaa8c7['addMembers'](_0x216877['body'][_0xd945('0x55')],_['omit'](_0x216877['body'],[_0xd945('0x55'),'id'])||{});}})[_0xd945('0x29')](respondWithResult(_0x44ed16,null))[_0xd945('0x49')](handleError(_0x44ed16,null));};exports[_0xd945('0x56')]=function(_0x2a0556,_0x1f6740,_0x136544){var _0x4e9b66={};var _0x338a54={};var _0x4652f0;var _0x1cef46;return db[_0xd945('0x30')]['findOne']({'where':{'id':_0x2a0556['params']['id']}})[_0xd945('0x29')](handleEntityNotFound(_0x1f6740,null))['then'](function(_0x3f3d63){if(_0x3f3d63){_0x4652f0=_0x3f3d63;_0x338a54['model']=_['keys'](db[_0xd945('0x57')][_0xd945('0x31')]);_0x338a54[_0xd945('0x34')]=_['keys'](_0x2a0556['query']);_0x338a54['filters']=_[_0xd945('0x37')](_0x338a54['model'],_0x338a54['query']);_0x4e9b66[_0xd945('0x38')]=_['intersection'](_0x338a54['model'],qs[_0xd945('0x39')](_0x2a0556[_0xd945('0x34')][_0xd945('0x39')]));_0x4e9b66['attributes']=_0x4e9b66['attributes'][_0xd945('0x3a')]?_0x4e9b66[_0xd945('0x38')]:_0x338a54['model'];_0x4e9b66['order']=qs['sort'](_0x2a0556[_0xd945('0x34')][_0xd945('0x3e')]);_0x4e9b66[_0xd945('0x3f')]=qs['filters'](_[_0xd945('0x40')](_0x2a0556['query'],_0x338a54['filters']));if(_0x2a0556[_0xd945('0x34')][_0xd945('0x41')]){_0x4e9b66[_0xd945('0x3f')]=_['merge'](_0x4e9b66[_0xd945('0x3f')],{'$or':_['map'](_0x4e9b66[_0xd945('0x38')],function(_0x4afb2b){var _0x1c60c8={};_0x1c60c8[_0x4afb2b]={'$like':'%'+_0x2a0556[_0xd945('0x34')][_0xd945('0x41')]+'%'};return _0x1c60c8;})});}_0x4e9b66=_[_0xd945('0x42')]({},_0x4e9b66,_0x2a0556[_0xd945('0x4b')]);return _0x4652f0[_0xd945('0x56')](_0x4e9b66);}})[_0xd945('0x29')](function(_0x54b49a){if(_0x54b49a){_0x1cef46=_0x54b49a['length'];if(!_0x2a0556[_0xd945('0x34')][_0xd945('0x3b')]('nolimit')){_0x4e9b66['limit']=qs[_0xd945('0x26')](_0x2a0556[_0xd945('0x34')][_0xd945('0x26')]);_0x4e9b66[_0xd945('0x24')]=qs[_0xd945('0x24')](_0x2a0556[_0xd945('0x34')][_0xd945('0x24')]);}return _0x4652f0[_0xd945('0x56')](_0x4e9b66);}})['then'](function(_0x4f6145){if(_0x4f6145){return _0x4f6145?{'count':_0x1cef46,'rows':_0x4f6145}:null;}})[_0xd945('0x29')](respondWithResult(_0x1f6740,null))[_0xd945('0x49')](handleError(_0x1f6740,null));};exports['removeMembers']=function(_0x28d730,_0x55503b,_0x4de674){return db['ChatGroup'][_0xd945('0x4c')]({'where':{'id':_0x28d730['params']['id']}})[_0xd945('0x29')](handleEntityNotFound(_0x55503b,null))[_0xd945('0x29')](function(_0x17826d){if(_0x17826d){return _0x17826d[_0xd945('0x58')](_0x28d730['query']['ids']);}})[_0xd945('0x29')](respondWithStatusCode(_0x55503b,null))[_0xd945('0x49')](handleError(_0x55503b,null));};exports[_0xd945('0x59')]=function(_0x1fd1e1,_0x4725ce,_0x1a54d0){if(_0x1fd1e1[_0xd945('0x4e')]['id']){delete _0x1fd1e1[_0xd945('0x4e')]['id'];}return db[_0xd945('0x30')]['find']({'where':{'id':_0x1fd1e1['params']['id']}})[_0xd945('0x29')](handleEntityNotFound(_0x4725ce,null))[_0xd945('0x29')](function(_0xf9c75f){if(_0xf9c75f){_0x1fd1e1[_0xd945('0x4e')]['ChatGroupId']=_0xf9c75f['id'];return db[_0xd945('0x52')][_0xd945('0x4d')](_0x1fd1e1[_0xd945('0x4e')]);}})[_0xd945('0x29')](respondWithResult(_0x4725ce,null))[_0xd945('0x49')](handleError(_0x4725ce,null));};exports[_0xd945('0x5a')]=function(_0x1c6f53,_0xb0caca,_0x4c64c9){var _0x78c95b={};var _0x499552={};var _0xf108c4;var _0x2fbd71;return db[_0xd945('0x30')][_0xd945('0x5b')]({'where':{'id':_0x1c6f53[_0xd945('0x4a')]['id']}})[_0xd945('0x29')](handleEntityNotFound(_0xb0caca,null))[_0xd945('0x29')](function(_0x295267){if(_0x295267){_0xf108c4=_0x295267;_0x499552['model']=_[_0xd945('0x35')](db[_0xd945('0x52')][_0xd945('0x31')]);_0x499552[_0xd945('0x34')]=_[_0xd945('0x35')](_0x1c6f53['query']);_0x499552[_0xd945('0x36')]=_[_0xd945('0x37')](_0x499552[_0xd945('0x33')],_0x499552[_0xd945('0x34')]);_0x78c95b[_0xd945('0x38')]=_[_0xd945('0x37')](_0x499552['model'],qs[_0xd945('0x39')](_0x1c6f53[_0xd945('0x34')][_0xd945('0x39')]));_0x78c95b[_0xd945('0x38')]=_0x78c95b[_0xd945('0x38')][_0xd945('0x3a')]?_0x78c95b['attributes']:_0x499552[_0xd945('0x33')];_0x78c95b[_0xd945('0x3d')]=qs[_0xd945('0x3e')](_0x1c6f53[_0xd945('0x34')][_0xd945('0x3e')]);_0x78c95b[_0xd945('0x3f')]=qs[_0xd945('0x36')](_[_0xd945('0x40')](_0x1c6f53[_0xd945('0x34')],_0x499552['filters']));if(_0x1c6f53[_0xd945('0x34')][_0xd945('0x41')]){_0x78c95b[_0xd945('0x3f')]=_[_0xd945('0x42')](_0x78c95b['where'],{'$or':_[_0xd945('0x2f')](_0x78c95b[_0xd945('0x38')],function(_0x31156c){var _0x2a0970={};_0x2a0970[_0x31156c]={'$like':'%'+_0x1c6f53[_0xd945('0x34')]['filter']+'%'};return _0x2a0970;})});}if(_0x1c6f53[_0xd945('0x34')]['$gte']){var _0x3f391c=_0x1c6f53[_0xd945('0x34')]['$gte']['split'](',');var _0x30487c={};_0x30487c[_0x3f391c[0x0]]={'$gte':moment(_0x3f391c[0x1])[_0xd945('0x5c')](_0xd945('0x5d'))};_0x78c95b['where']=_[_0xd945('0x42')](_0x78c95b['where'],_0x30487c);}_0x78c95b=_[_0xd945('0x42')]({},_0x78c95b,_0x1c6f53['options']);return _0xf108c4[_0xd945('0x5a')](_0x78c95b);}})['then'](function(_0x2334a8){if(_0x2334a8){_0x2fbd71=_0x2334a8['length'];if(!_0x1c6f53[_0xd945('0x34')][_0xd945('0x3b')]('nolimit')){_0x78c95b[_0xd945('0x26')]=qs['limit'](_0x1c6f53[_0xd945('0x34')]['limit']);_0x78c95b[_0xd945('0x24')]=qs[_0xd945('0x24')](_0x1c6f53[_0xd945('0x34')]['offset']);}return _0xf108c4[_0xd945('0x5a')](_0x78c95b);}})[_0xd945('0x29')](function(_0x4a6c42){if(_0x4a6c42){return _0x4a6c42?{'count':_0x2fbd71,'rows':_0x4a6c42}:null;}})[_0xd945('0x29')](respondWithResult(_0xb0caca,null))['catch'](handleError(_0xb0caca,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 814faf4..ac1c9b9 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 _0x50a5=['../../mysqldb','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0xa83a04,_0x4d24fc){var _0x30e8ab=function(_0x34b936){while(--_0x34b936){_0xa83a04['push'](_0xa83a04['shift']());}};_0x30e8ab(++_0x4d24fc);}(_0x50a5,0xd1));var _0x550a=function(_0x4f451d,_0x46a97e){_0x4f451d=_0x4f451d-0x0;var _0x588972=_0x50a5[_0x4f451d];return _0x588972;};'use strict';var EventEmitter=require(_0x550a('0x0'));var ChatGroup=require(_0x550a('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x550a('0x2')};function emitEvent(_0x4827e0){return function(_0x357485,_0x2038f7,_0x45ca06){ChatGroupEvents[_0x550a('0x3')](_0x4827e0+':'+_0x357485['id'],_0x357485);ChatGroupEvents[_0x550a('0x3')](_0x4827e0,_0x357485);_0x45ca06(null);};}for(var e in events){if(events[_0x550a('0x4')](e)){var event=events[e];ChatGroup[_0x550a('0x5')](e,emitEvent(event));}}module[_0x550a('0x6')]=ChatGroupEvents;
\ No newline at end of file
+var _0xa143=['hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x1db251,_0xf0443d){var _0x56685a=function(_0x6ec6b7){while(--_0x6ec6b7){_0x1db251['push'](_0x1db251['shift']());}};_0x56685a(++_0xf0443d);}(_0xa143,0x115));var _0x3a14=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xa143[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0x3a14('0x0'));var ChatGroup=require(_0x3a14('0x1'))['db'][_0x3a14('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x3a14('0x3')](0x0);var events={'afterCreate':_0x3a14('0x4'),'afterUpdate':_0x3a14('0x5'),'afterDestroy':_0x3a14('0x6')};function emitEvent(_0x363b10){return function(_0x3c6622,_0x238839,_0x446a1c){ChatGroupEvents[_0x3a14('0x7')](_0x363b10+':'+_0x3c6622['id'],_0x3c6622);ChatGroupEvents['emit'](_0x363b10,_0x3c6622);_0x446a1c(null);};}for(var e in events){if(events[_0x3a14('0x8')](e)){var event=events[e];ChatGroup[_0x3a14('0x9')](e,emitEvent(event));}}module[_0x3a14('0xa')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 04f7180..f9e0af4 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 _0x63dc=['define','ChatGroup','chat_groups','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x63dc,0x1d1));var _0xc63d=function(_0x23f3ca,_0x3fc171){_0x23f3ca=_0x23f3ca-0x0;var _0x33688a=_0x63dc[_0x23f3ca];return _0x33688a;};'use strict';var _=require('lodash');var util=require(_0xc63d('0x0'));var logger=require(_0xc63d('0x1'))(_0xc63d('0x2'));var moment=require(_0xc63d('0x3'));var BPromise=require(_0xc63d('0x4'));var rp=require(_0xc63d('0x5'));var fs=require('fs');var path=require(_0xc63d('0x6'));var rimraf=require(_0xc63d('0x7'));var config=require(_0xc63d('0x8'));var attributes=require(_0xc63d('0x9'));module[_0xc63d('0xa')]=function(_0x5b8676,_0x4530be){return _0x5b8676[_0xc63d('0xb')](_0xc63d('0xc'),attributes,{'tableName':_0xc63d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8cfe=['lodash','api','moment','bluebird','rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup'];(function(_0x2389bc,_0x167cd2){var _0x170548=function(_0x2da7f2){while(--_0x2da7f2){_0x2389bc['push'](_0x2389bc['shift']());}};_0x170548(++_0x167cd2);}(_0x8cfe,0x183));var _0xe8cf=function(_0x251028,_0x3eef2a){_0x251028=_0x251028-0x0;var _0x415051=_0x8cfe[_0x251028];return _0x415051;};'use strict';var _=require(_0xe8cf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe8cf('0x1'));var moment=require(_0xe8cf('0x2'));var BPromise=require(_0xe8cf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe8cf('0x4'));var config=require(_0xe8cf('0x5'));var attributes=require(_0xe8cf('0x6'));module['exports']=function(_0x16915b,_0x6cc976){return _0x16915b[_0xe8cf('0x7')](_0xe8cf('0x8'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 1b8fe0c..aedcc49 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 _0x594d=['message','info','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','register','request','then','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','ChatGroup,\x20%s,\x20%s'];(function(_0x29bfda,_0x30ad24){var _0x3f3db5=function(_0x238405){while(--_0x238405){_0x29bfda['push'](_0x29bfda['shift']());}};_0x3f3db5(++_0x30ad24);}(_0x594d,0x172));var _0xd594=function(_0x223b26,_0x2c883f){_0x223b26=_0x223b26-0x0;var _0x691749=_0x594d[_0x223b26];return _0x691749;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd594('0x0'));var BPromise=require(_0xd594('0x1'));var rs=require(_0xd594('0x2'));var fs=require('fs');var Redis=require(_0xd594('0x3'));var db=require(_0xd594('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd594('0x5'))(_0xd594('0x6'));var config=require(_0xd594('0x7'));var jayson=require(_0xd594('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xd594('0x9')](config[_0xd594('0xa')],{'host':_0xd594('0xb'),'port':0x18eb});var socket=require(_0xd594('0xc'))(new Redis(config['redis']));require('./chatGroup.socket')[_0xd594('0xd')](socket);function respondWithRpcPromise(_0x30413d,_0x46397c,_0x204faf){return new BPromise(function(_0x512c4e,_0x50abb3){return client[_0xd594('0xe')](_0x30413d,_0x204faf)[_0xd594('0xf')](function(_0x4b53ee){logger['info']('ChatGroup,\x20%s,\x20%s',_0x46397c,_0xd594('0x10'));logger['debug'](_0xd594('0x11'),_0x46397c,_0xd594('0x10'),JSON[_0xd594('0x12')](_0x4b53ee));if(_0x4b53ee['error']){if(_0x4b53ee[_0xd594('0x13')]['code']===0x1f4){logger[_0xd594('0x13')](_0xd594('0x14'),_0x46397c,_0x4b53ee['error'][_0xd594('0x15')]);return _0x50abb3(_0x4b53ee[_0xd594('0x13')][_0xd594('0x15')]);}logger[_0xd594('0x13')]('ChatGroup,\x20%s,\x20%s',_0x46397c,_0x4b53ee[_0xd594('0x13')]['message']);return _0x512c4e(_0x4b53ee[_0xd594('0x13')][_0xd594('0x15')]);}else{logger[_0xd594('0x16')]('ChatGroup,\x20%s,\x20%s',_0x46397c,_0xd594('0x10'));_0x512c4e(_0x4b53ee['result'][_0xd594('0x15')]);}})['catch'](function(_0x50ba67){logger[_0xd594('0x13')](_0xd594('0x14'),_0x46397c,_0x50ba67);_0x50abb3(_0x50ba67);});});}
\ No newline at end of file
+var _0x6b71=['lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','register','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch'];(function(_0xb5f383,_0x4890b3){var _0x1608e8=function(_0x42907d){while(--_0x42907d){_0xb5f383['push'](_0xb5f383['shift']());}};_0x1608e8(++_0x4890b3);}(_0x6b71,0x12c));var _0x16b7=function(_0xe24fc0,_0x444ff6){_0xe24fc0=_0xe24fc0-0x0;var _0x185c6b=_0x6b71[_0xe24fc0];return _0x185c6b;};'use strict';var _=require(_0x16b7('0x0'));var util=require(_0x16b7('0x1'));var moment=require('moment');var BPromise=require(_0x16b7('0x2'));var rs=require(_0x16b7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16b7('0x4'))['db'];var utils=require(_0x16b7('0x5'));var logger=require(_0x16b7('0x6'))(_0x16b7('0x7'));var config=require(_0x16b7('0x8'));var jayson=require(_0x16b7('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x16b7('0xa')]=_['defaults'](config[_0x16b7('0xa')],{'host':_0x16b7('0xb'),'port':0x18eb});var socket=require(_0x16b7('0xc'))(new Redis(config[_0x16b7('0xa')]));require('./chatGroup.socket')[_0x16b7('0xd')](socket);function respondWithRpcPromise(_0x537abb,_0xd05d11,_0x50c2a1){return new BPromise(function(_0x46c08d,_0x4b11f4){return client['request'](_0x537abb,_0x50c2a1)[_0x16b7('0xe')](function(_0x4f762f){logger['info'](_0x16b7('0xf'),_0xd05d11,_0x16b7('0x10'));logger[_0x16b7('0x11')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0xd05d11,_0x16b7('0x10'),JSON[_0x16b7('0x12')](_0x4f762f));if(_0x4f762f[_0x16b7('0x13')]){if(_0x4f762f[_0x16b7('0x13')][_0x16b7('0x14')]===0x1f4){logger[_0x16b7('0x13')](_0x16b7('0xf'),_0xd05d11,_0x4f762f[_0x16b7('0x13')][_0x16b7('0x15')]);return _0x4b11f4(_0x4f762f['error']['message']);}logger[_0x16b7('0x13')](_0x16b7('0xf'),_0xd05d11,_0x4f762f[_0x16b7('0x13')]['message']);return _0x46c08d(_0x4f762f[_0x16b7('0x13')][_0x16b7('0x15')]);}else{logger[_0x16b7('0x16')](_0x16b7('0xf'),_0xd05d11,_0x16b7('0x10'));_0x46c08d(_0x4f762f[_0x16b7('0x17')]['message']);}})[_0x16b7('0x18')](function(_0x2d1df9){logger[_0x16b7('0x13')](_0x16b7('0xf'),_0xd05d11,_0x2d1df9);_0x4b11f4(_0x2d1df9);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 6394599..cc204c0 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 _0x6ef6=['emit','removeListener','chatGroup:','./chatGroup.events','save','remove'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x6ef6,0xff));var _0x66ef=function(_0x4e4f15,_0xc99f54){_0x4e4f15=_0x4e4f15-0x0;var _0x2f0a16=_0x6ef6[_0x4e4f15];return _0x2f0a16;};'use strict';var ChatGroupEvents=require(_0x66ef('0x0'));var events=[_0x66ef('0x1'),_0x66ef('0x2'),'update'];function createListener(_0x775994,_0x45107b){return function(_0x10af6c){_0x45107b[_0x66ef('0x3')](_0x775994,_0x10af6c);};}function removeListener(_0x1bb764,_0x2856be){return function(){ChatGroupEvents[_0x66ef('0x4')](_0x1bb764,_0x2856be);};}exports['register']=function(_0x3f3886){for(var _0x2e425f=0x0,_0x2be0fc=events['length'];_0x2e425f<_0x2be0fc;_0x2e425f++){var _0x2821da=events[_0x2e425f];var _0xdef69c=createListener(_0x66ef('0x5')+_0x2821da,_0x3f3886);ChatGroupEvents['on'](_0x2821da,_0xdef69c);}};
\ No newline at end of file
+var _0xdf47=['register','length','./chatGroup.events','save','remove','update','emit','removeListener'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xdf47,0x1e2));var _0x7df4=function(_0x37a690,_0x50bebc){_0x37a690=_0x37a690-0x0;var _0x5c2f74=_0xdf47[_0x37a690];return _0x5c2f74;};'use strict';var ChatGroupEvents=require(_0x7df4('0x0'));var events=[_0x7df4('0x1'),_0x7df4('0x2'),_0x7df4('0x3')];function createListener(_0x51ef53,_0x534a70){return function(_0x45e5f9){_0x534a70[_0x7df4('0x4')](_0x51ef53,_0x45e5f9);};}function removeListener(_0x12a2fd,_0x4ebfc4){return function(){ChatGroupEvents[_0x7df4('0x5')](_0x12a2fd,_0x4ebfc4);};}exports[_0x7df4('0x6')]=function(_0x5ecb85){for(var _0x3922a2=0x0,_0x1298d1=events[_0x7df4('0x7')];_0x3922a2<_0x1298d1;_0x3922a2++){var _0x1ac8cb=events[_0x3922a2];var _0x1b8a49=createListener('chatGroup:'+_0x1ac8cb,_0x5ecb85);ChatGroupEvents['on'](_0x1ac8cb,_0x1b8a49);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index eb3eaef..b3f73bc 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 _0x7a93=['index','/describe','describe','getUnread','post','create','/:id/members','addMembers','addMessage','put','/:id','delete','destroy','removeMembers','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0x7a93,0x15f));var _0x37a9=function(_0x2b8fa7,_0x3df05b){_0x2b8fa7=_0x2b8fa7-0x0;var _0x3fc766=_0x7a93[_0x2b8fa7];return _0x3fc766;};'use strict';var multer=require('multer');var util=require(_0x37a9('0x0'));var path=require('path');var timeout=require(_0x37a9('0x1'));var express=require(_0x37a9('0x2'));var router=express[_0x37a9('0x3')]();var fs_extra=require(_0x37a9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x37a9('0x5'));var config=require(_0x37a9('0x6'));var controller=require('./chatGroup.controller');router[_0x37a9('0x7')]('/',auth[_0x37a9('0x8')](),controller[_0x37a9('0x9')]);router[_0x37a9('0x7')](_0x37a9('0xa'),auth[_0x37a9('0x8')](),controller[_0x37a9('0xb')]);router[_0x37a9('0x7')]('/:id',auth[_0x37a9('0x8')](),controller['show']);router[_0x37a9('0x7')]('/:id/unread',auth[_0x37a9('0x8')](),controller[_0x37a9('0xc')]);router[_0x37a9('0x7')]('/:id/members',auth[_0x37a9('0x8')](),controller['getMembers']);router[_0x37a9('0x7')]('/:id/messages',auth[_0x37a9('0x8')](),controller['getMessages']);router[_0x37a9('0xd')]('/',auth[_0x37a9('0x8')](),controller[_0x37a9('0xe')]);router[_0x37a9('0xd')](_0x37a9('0xf'),auth[_0x37a9('0x8')](),controller[_0x37a9('0x10')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0x37a9('0x11')]);router[_0x37a9('0x12')](_0x37a9('0x13'),auth[_0x37a9('0x8')](),controller['update']);router[_0x37a9('0x14')](_0x37a9('0x13'),auth[_0x37a9('0x8')](),controller[_0x37a9('0x15')]);router[_0x37a9('0x14')](_0x37a9('0xf'),auth[_0x37a9('0x8')](),controller[_0x37a9('0x16')]);module[_0x37a9('0x17')]=router;
\ No newline at end of file
+var _0xee0c=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/unread','/:id/members','getMessages','post','addMembers','put','/:id','delete','destroy','removeMembers'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xee0c,0x1cc));var _0xcee0=function(_0x52020e,_0x940e91){_0x52020e=_0x52020e-0x0;var _0x34e724=_0xee0c[_0x52020e];return _0x34e724;};'use strict';var multer=require(_0xcee0('0x0'));var util=require(_0xcee0('0x1'));var path=require(_0xcee0('0x2'));var timeout=require(_0xcee0('0x3'));var express=require(_0xcee0('0x4'));var router=express[_0xcee0('0x5')]();var fs_extra=require(_0xcee0('0x6'));var auth=require(_0xcee0('0x7'));var interaction=require(_0xcee0('0x8'));var config=require(_0xcee0('0x9'));var controller=require('./chatGroup.controller');router[_0xcee0('0xa')]('/',auth[_0xcee0('0xb')](),controller[_0xcee0('0xc')]);router[_0xcee0('0xa')](_0xcee0('0xd'),auth[_0xcee0('0xb')](),controller[_0xcee0('0xe')]);router[_0xcee0('0xa')]('/:id',auth[_0xcee0('0xb')](),controller[_0xcee0('0xf')]);router[_0xcee0('0xa')](_0xcee0('0x10'),auth[_0xcee0('0xb')](),controller['getUnread']);router[_0xcee0('0xa')](_0xcee0('0x11'),auth['isAuthenticated'](),controller['getMembers']);router[_0xcee0('0xa')]('/:id/messages',auth[_0xcee0('0xb')](),controller[_0xcee0('0x12')]);router['post']('/',auth[_0xcee0('0xb')](),controller['create']);router[_0xcee0('0x13')](_0xcee0('0x11'),auth['isAuthenticated'](),controller[_0xcee0('0x14')]);router[_0xcee0('0x13')]('/:id/messages',auth[_0xcee0('0xb')](),controller['addMessage']);router[_0xcee0('0x15')](_0xcee0('0x16'),auth[_0xcee0('0xb')](),controller['update']);router[_0xcee0('0x17')](_0xcee0('0x16'),auth[_0xcee0('0xb')](),controller[_0xcee0('0x18')]);router[_0xcee0('0x17')]('/:id/members',auth[_0xcee0('0xb')](),controller[_0xcee0('0x19')]);module[_0xcee0('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index a93a432..5c5fd17 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 _0x3423=['BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE'];(function(_0x49f98a,_0x481c5b){var _0x1f38a2=function(_0x45238e){while(--_0x45238e){_0x49f98a['push'](_0x49f98a['shift']());}};_0x1f38a2(++_0x481c5b);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x3342('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x3342('0x1')]},'ratingType':{'type':Sequelize[_0x3342('0x2')](_0x3342('0x3'),_0x3342('0x4')),'defaultValue':_0x3342('0x3')},'ratingMessage':{'type':Sequelize[_0x3342('0x5')]},'pathTranscript':{'type':Sequelize[_0x3342('0x5')]},'mailTranscript':{'type':Sequelize[_0x3342('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x3342('0x7')]},'disposition':{'type':Sequelize[_0x3342('0x6')]},'secondDisposition':{'type':Sequelize[_0x3342('0x6')]},'thirdDisposition':{'type':Sequelize[_0x3342('0x6')]},'note':{'type':Sequelize[_0x3342('0x6')]},'browserName':{'type':Sequelize[_0x3342('0x6')]},'browserVersion':{'type':Sequelize[_0x3342('0x6')]},'osName':{'type':Sequelize[_0x3342('0x6')]},'osVersion':{'type':Sequelize[_0x3342('0x6')]},'deviceModel':{'type':Sequelize[_0x3342('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x3342('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT']('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x3342('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x3342('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3342('0x6')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x3342('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x3342('0x0')],'defaultValue':![]}};
\ No newline at end of file
+var _0x74f4=['sequelize','exports','INTEGER','ENUM','thumb','TEXT','STRING','long','DATE','out'];(function(_0x47eae0,_0x243f1b){var _0x260347=function(_0x221977){while(--_0x221977){_0x47eae0['push'](_0x47eae0['shift']());}};_0x260347(++_0x243f1b);}(_0x74f4,0xaa));var _0x474f=function(_0x337e2b,_0x483b3b){_0x337e2b=_0x337e2b-0x0;var _0x569e62=_0x74f4[_0x337e2b];return _0x569e62;};'use strict';var Sequelize=require(_0x474f('0x0'));module[_0x474f('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x474f('0x2')]},'ratingType':{'type':Sequelize[_0x474f('0x3')]('star',_0x474f('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x474f('0x5')]},'pathTranscript':{'type':Sequelize[_0x474f('0x5')]},'mailTranscript':{'type':Sequelize[_0x474f('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x474f('0x6')]},'secondDisposition':{'type':Sequelize[_0x474f('0x6')]},'thirdDisposition':{'type':Sequelize[_0x474f('0x6')]},'note':{'type':Sequelize[_0x474f('0x6')]},'browserName':{'type':Sequelize[_0x474f('0x6')]},'browserVersion':{'type':Sequelize[_0x474f('0x6')]},'osName':{'type':Sequelize[_0x474f('0x6')]},'osVersion':{'type':Sequelize[_0x474f('0x6')]},'deviceModel':{'type':Sequelize[_0x474f('0x6')]},'deviceVendor':{'type':Sequelize[_0x474f('0x6')]},'deviceType':{'type':Sequelize[_0x474f('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x474f('0x6')]},'formData':{'type':Sequelize[_0x474f('0x5')](_0x474f('0x7'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x474f('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x474f('0x3')]('in',_0x474f('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x474f('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x474f('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 6d42310..3a30db3 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 _0xd64b=['`\x20=\x200','`\x20>\x200','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','show','includeAll','include','create','params','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooMetadata','vidaooEscalation','email','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','vidaooNote','follow','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','sendStatus','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','attachmentDownload','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','basename','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','User','System','Visitor','agentIdentifier','%s%d','agentAlias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','sort','YYYY-MM-DD\x20HH:mm:ss','options','findAll','getMyMessages','addTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','tmp','files','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','Owner','Chat','Account','closedAt','browserName','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','createWriteStream','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','rimraf','request-promise','bluebird','mustache','util','path','ejs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','stack','send','render','body','contact','agent','interaction','account','Users','map','fullname','TagIds','forEach','Tags','push','answered','total','closed','UserId','waiting','talking','disposition','abandoned','unmanaged','ChatInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','select','field','name','color','u.id','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','find','unreadMessages','value','having'];(function(_0x5ff517,_0x3e4ee0){var _0x19a245=function(_0x4c00ac){while(--_0x4c00ac){_0x5ff517['push'](_0x5ff517['shift']());}};_0x19a245(++_0x3e4ee0);}(_0xd64b,0xc1));var _0xbd64=function(_0x4551f6,_0x48151b){_0x4551f6=_0x4551f6-0x0;var _0x581dc2=_0xd64b[_0x4551f6];return _0x581dc2;};'use strict';var rimraf=require(_0xbd64('0x0'));var zipdir=require('zip-dir');var rp=require(_0xbd64('0x1'));var moment=require('moment');var BPromise=require(_0xbd64('0x2'));var Mustache=require(_0xbd64('0x3'));var util=require(_0xbd64('0x4'));var path=require(_0xbd64('0x5'));var ejs=require(_0xbd64('0x6'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var as=require(_0xbd64('0x7'));var pdf=require(_0xbd64('0x8'));var logger=require(_0xbd64('0x9'))(_0xbd64('0xa'));var config=require(_0xbd64('0xb'));var db=require(_0xbd64('0xc'))['db'];config[_0xbd64('0xd')]=_['defaults'](config['redis'],{'host':_0xbd64('0xe'),'port':0x18eb});var socket=require(_0xbd64('0xf'))(new Redis(config[_0xbd64('0xd')]));require('./chatInteraction.socket')[_0xbd64('0x10')](socket);var jayson=require(_0xbd64('0x11'));var client=jayson[_0xbd64('0x12')][_0xbd64('0x13')]({'port':0x232b});var client9004=jayson['client'][_0xbd64('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x5f2adf,_0x136f60,_0x2729d8,_0x3a941c){return new BPromise(function(_0x2183e2,_0x367824){var _0x27438c=_0x3a941c||client;return _0x27438c[_0xbd64('0x14')](_0x5f2adf,_0x2729d8)[_0xbd64('0x15')](function(_0x2b5808){logger['info'](_0xbd64('0x16'),_0x136f60,_0xbd64('0x17'));logger[_0xbd64('0x18')](_0xbd64('0x19'),_0x136f60,_0xbd64('0x17'),JSON['stringify'](_0x2b5808));if(_0x2b5808[_0xbd64('0x1a')]){if(_0x2b5808['error'][_0xbd64('0x1b')]===0x1f4){logger[_0xbd64('0x1a')](_0xbd64('0x16'),_0x136f60,_0x2b5808[_0xbd64('0x1a')][_0xbd64('0x1c')]);return _0x367824(_0x2b5808[_0xbd64('0x1a')][_0xbd64('0x1c')]);}logger[_0xbd64('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x136f60,_0x2b5808[_0xbd64('0x1a')][_0xbd64('0x1c')]);return _0x2183e2(_0x2b5808['error']['message']);}else{logger[_0xbd64('0x1d')](_0xbd64('0x16'),_0x136f60,_0xbd64('0x17'));_0x2183e2(_0x2b5808[_0xbd64('0x1e')][_0xbd64('0x1c')]);}})[_0xbd64('0x1f')](function(_0x5dc2bd){logger['error'](_0xbd64('0x16'),_0x136f60,_0x5dc2bd);_0x367824(_0x5dc2bd);});});}function respondWithStatusCode(_0x41f2f,_0x12f67b){_0x12f67b=_0x12f67b||0xcc;return function(_0x365d88){if(_0x365d88){return _0x41f2f['sendStatus'](_0x12f67b);}return _0x41f2f['status'](_0x12f67b)[_0xbd64('0x20')]();};}function respondWithResult(_0x4afaff,_0x46ab38){_0x46ab38=_0x46ab38||0xc8;return function(_0x5b356b){if(_0x5b356b){return _0x4afaff[_0xbd64('0x21')](_0x46ab38)[_0xbd64('0x22')](_0x5b356b);}};}function respondWithFilteredResult(_0x3d12a0,_0x2d0993){return function(_0x5ae417){if(_0x5ae417){var _0x9d0fb8=typeof _0x2d0993[_0xbd64('0x23')]===_0xbd64('0x24')&&typeof _0x2d0993[_0xbd64('0x25')]==='undefined';var _0x4e8719=_0x5ae417[_0xbd64('0x26')];var _0x49eac5=_0x9d0fb8?0x0:_0x2d0993['offset'];var _0xfa918=_0x9d0fb8?_0x5ae417['count']:_0x2d0993[_0xbd64('0x23')]+_0x2d0993['limit'];var _0x28199c;if(_0xfa918>=_0x4e8719){_0xfa918=_0x4e8719;_0x28199c=0xc8;}else{_0x28199c=0xce;}_0x3d12a0['status'](_0x28199c);return _0x3d12a0[_0xbd64('0x27')](_0xbd64('0x28'),_0x49eac5+'-'+_0xfa918+'/'+_0x4e8719)[_0xbd64('0x22')](_0x5ae417);}return null;};}function saveUpdates(_0x210fff){return function(_0x306f19){if(_0x306f19){return _0x306f19[_0xbd64('0x29')](_0x210fff)['then'](function(_0x35bdd5){return _0x35bdd5;});}return null;};}function removeEntity(_0xe876c9){return function(_0xc44280){if(_0xc44280){return _0xc44280[_0xbd64('0x2a')]()[_0xbd64('0x15')](function(){_0xe876c9[_0xbd64('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c5961){return function(_0x1e4593){if(!_0x1e4593){_0x4c5961['sendStatus'](0x194);}return _0x1e4593;};}function handleError(_0xebed78,_0x3bce1b){_0x3bce1b=_0x3bce1b||0x1f4;return function(_0x54459f){logger['error'](_0x54459f[_0xbd64('0x2b')]);if(_0x54459f['name']){delete _0x54459f['name'];}_0xebed78[_0xbd64('0x21')](_0x3bce1b)[_0xbd64('0x2c')](_0x54459f);};}function getMustacheRender(_0x192ca3,_0x50c58e){return Mustache[_0xbd64('0x2d')](_0x192ca3,_['merge'](_0x50c58e[_0xbd64('0x2e')],{'contact':_0x50c58e[_0xbd64('0x2f')],'message':_0x50c58e[_0xbd64('0x1c')],'agent':_0x50c58e[_0xbd64('0x30')],'interaction':_0x50c58e[_0xbd64('0x31')],'account':_0x50c58e[_0xbd64('0x32')]}))||'';}function getInteractionUsers(_0x513339,_0x4d870e){return new BPromise(function(_0x1a3c0f,_0x2be110){try{if(_0x4d870e[_0x513339['id']]){_0x513339[_0xbd64('0x33')]=_[_0xbd64('0x34')](_0x4d870e[_0x513339['id']],function(_0x5cf522){return{'id':_0x5cf522['id'],'fullname':_0x5cf522[_0xbd64('0x35')]};});}}catch(_0x54784f){_0x2be110(_0x54784f);}_0x1a3c0f(_0x513339);});}function getInteractionTags(_0x5a74a9,_0x1db1fa){return new BPromise(function(_0x1bcd4c,_0x21f518){try{if(_0x5a74a9['TagIds']){_0x5a74a9['Tags']=[];_0x5a74a9[_0xbd64('0x36')]['split'](',')[_0xbd64('0x37')](function(_0x4e1f11){_0x5a74a9[_0xbd64('0x38')][_0xbd64('0x39')](_0x1db1fa[_0x4e1f11]);});}delete _0x5a74a9['TagIds'];}catch(_0x107da1){_0x21f518(_0x107da1);}_0x1bcd4c(_0x5a74a9);});}function updateChatInteraction(_0x51ae42,_0x534091,_0x380f32){return new BPromise(function(_0x195d89,_0x252fc4){return getInteractionUsers(_0x51ae42,_0x380f32)['then'](function(_0x540e2a){return getInteractionTags(_0x540e2a,_0x534091);})['then'](function(_0x344d46){return getStateInteraction(_0x344d46);})[_0xbd64('0x15')](function(_0x51d54b){_0x195d89(_0x51d54b);})[_0xbd64('0x1f')](function(_0x34b19a){_0x252fc4(_0x34b19a);});});}function getStateInteraction(_0x19832c){return new BPromise(function(_0x27fd12){_0x19832c['waiting']=0x0;_0x19832c['talking']=0x0;_0x19832c[_0xbd64('0x3a')]=0x0;_0x19832c['unmanaged']=0x0;_0x19832c['abandoned']=0x0;_0x19832c[_0xbd64('0x3b')]=0x0;if(!_0x19832c[_0xbd64('0x3c')]&&!_0x19832c[_0xbd64('0x3d')]){_0x19832c[_0xbd64('0x3e')]+=0x1;}if(!_0x19832c[_0xbd64('0x3c')]&&_0x19832c[_0xbd64('0x3d')]){_0x19832c[_0xbd64('0x3f')]+=0x1;if(_0x19832c[_0xbd64('0x3e')]){_0x19832c['waiting']-=0x1;}}if(_0x19832c[_0xbd64('0x3c')]&&_0x19832c[_0xbd64('0x40')]==='abandoned'){_0x19832c[_0xbd64('0x41')]+=0x1;if(_0x19832c[_0xbd64('0x3e')]){_0x19832c[_0xbd64('0x3e')]-=0x1;}}else if(_0x19832c[_0xbd64('0x3c')]&&!_0x19832c[_0xbd64('0x3d')]&&_0x19832c[_0xbd64('0x40')]){_0x19832c[_0xbd64('0x42')]+=0x1;if(_0x19832c['waiting']){_0x19832c[_0xbd64('0x3e')]-=0x1;}}else if(_0x19832c['closed']&&_0x19832c[_0xbd64('0x3d')]){_0x19832c['answered']+=0x1;if(_0x19832c[_0xbd64('0x3f')]){_0x19832c[_0xbd64('0x3f')]-=0x1;}}_0x19832c[_0xbd64('0x3b')]+=0x1;_0x27fd12(_0x19832c);});}exports['index']=function(_0x23bf21,_0x495522){var _0x526705={},_0x553fa0={},_0x3304b7={'count':0x0,'rows':[]};var _0x2abe23=_[_0xbd64('0x34')](db[_0xbd64('0x43')][_0xbd64('0x44')],function(_0x3079b6){return{'name':_0x3079b6[_0xbd64('0x45')],'type':_0x3079b6['type'][_0xbd64('0x46')]};});_0x553fa0[_0xbd64('0x47')]=_[_0xbd64('0x34')](_0x2abe23,'name');_0x553fa0[_0xbd64('0x48')]=_[_0xbd64('0x49')](_0x23bf21[_0xbd64('0x48')]);_0x553fa0[_0xbd64('0x4a')]=_[_0xbd64('0x4b')](_0x553fa0['model'],_0x553fa0[_0xbd64('0x48')]);_0x526705[_0xbd64('0x4c')]=_[_0xbd64('0x4b')](_0x553fa0[_0xbd64('0x47')],qs['fields'](_0x23bf21['query'][_0xbd64('0x4d')]));_0x526705[_0xbd64('0x4c')]=_0x526705[_0xbd64('0x4c')][_0xbd64('0x4e')]?_0x526705[_0xbd64('0x4c')]:_0x553fa0[_0xbd64('0x47')];if(!_0x23bf21[_0xbd64('0x48')][_0xbd64('0x4f')](_0xbd64('0x50'))){_0x526705[_0xbd64('0x25')]=qs[_0xbd64('0x25')](_0x23bf21[_0xbd64('0x48')][_0xbd64('0x25')]);_0x526705[_0xbd64('0x23')]=qs[_0xbd64('0x23')](_0x23bf21['query'][_0xbd64('0x23')]);}_0x526705['order']=qs['sort'](_0x23bf21['query']['sort']);_0x526705[_0xbd64('0x51')]=qs[_0xbd64('0x4a')](_['pick'](_0x23bf21[_0xbd64('0x48')],_0x553fa0[_0xbd64('0x4a')]),_0x2abe23);var _0x46a3af=[];var _0x57e811=squel[_0xbd64('0x52')]()[_0xbd64('0x53')]('id')[_0xbd64('0x53')](_0xbd64('0x54'))[_0xbd64('0x53')](_0xbd64('0x55'))['from']('tools_tags');var _0x4bd09c=squel[_0xbd64('0x52')]()[_0xbd64('0x53')](_0xbd64('0x56'))[_0xbd64('0x53')]('u.fullname')[_0xbd64('0x53')](_0xbd64('0x57'))[_0xbd64('0x58')](_0xbd64('0x59'),'ui')[_0xbd64('0x5a')](_0xbd64('0x5b'),'u','u.id\x20=\x20ui.UserId');var _0x270910=squel[_0xbd64('0x52')]()[_0xbd64('0x58')](_0xbd64('0x5c'),'i')[_0xbd64('0x5a')](_0xbd64('0x5d'),'c',_0xbd64('0x5e'))[_0xbd64('0x5a')](_0xbd64('0x5b'),'o',_0xbd64('0x5f'))[_0xbd64('0x5a')](_0xbd64('0x60'),'a','a.id\x20=\x20i.ChatWebsiteId')['left_join'](_0xbd64('0x61'),'me',_0xbd64('0x62'))['left_join']('chat_interaction_has_tags','it',_0xbd64('0x63'))[_0xbd64('0x5a')]('tools_tags','t',_0xbd64('0x64'));var _0x13f083=squel[_0xbd64('0x65')]();var _0x3b592e=[];var _0x713652=squel[_0xbd64('0x65')]();var _0x2d788;if(_0x23bf21[_0xbd64('0x48')][_0xbd64('0x66')]){_0x2d788=as['parseSearch'](_0x23bf21[_0xbd64('0x48')][_0xbd64('0x66')]);var _0x166783=_0x2d788['sqlOperator'];for(var _0x8ec428=0x0;_0x8ec428<_0x2d788[_0xbd64('0x67')]['length'];_0x8ec428++){var _0x4423d9=_0x2d788[_0xbd64('0x67')][_0x8ec428];var _0x16634d='i';var _0x220603=_[_0xbd64('0x68')](_0x2abe23,[_0xbd64('0x54'),_0x4423d9['field']]);if(!_0x220603){switch(_0x4423d9[_0xbd64('0x53')]){case _0xbd64('0x69'):if(_0x4423d9[_0xbd64('0x6a')]==0x1){_0x270910[_0xbd64('0x6b')]('`'+_0x4423d9['field']+_0xbd64('0x6c'));}else{_0x270910[_0xbd64('0x6b')]('`'+_0x4423d9['field']+_0xbd64('0x6d'));}break;case'Contact':if(_0x4423d9[_0xbd64('0x6e')]===_0xbd64('0x6f')){if(_0x4423d9[_0xbd64('0x6a')][_0xbd64('0x70')]('\x20')['length']>0x1){_0x13f083[_0x166783](_0xbd64('0x71'),qs[_0xbd64('0x72')](_0x4423d9[_0xbd64('0x6a')]),null);}else{var _0x23925c='%'+_0x4423d9[_0xbd64('0x6a')]+'%';_0x13f083[_0x166783](_0xbd64('0x73'),_0x23925c,_0x23925c,_0x23925c);}}else{_0x220603=_['find'](_0x2abe23,['name','ContactId']);_0x4423d9[_0xbd64('0x53')]=_0xbd64('0x74');_0x2b95a0=as[_0xbd64('0x75')](_0x16634d,_0x220603[_0xbd64('0x76')],_0x4423d9);_0x13f083[_0x166783](_0x2b95a0[_0xbd64('0x77')],_0x2b95a0[_0xbd64('0x6a')]['start'],_0x2b95a0[_0xbd64('0x6a')][_0xbd64('0x20')]);}break;case _0xbd64('0x78'):var _0x333720=_0x4423d9[_0xbd64('0x6a')][_0xbd64('0x70')](',')[_0xbd64('0x34')](function(_0x3d7e47){return Number(_0x3d7e47);});_0x333720[_0xbd64('0x37')](function(_0x18e724){_0x713652['or'](_0xbd64('0x79'),'%,'+_0x18e724+',%');});_0x3b592e=_[_0xbd64('0x7a')](_0x3b592e,_0x333720);break;case'User':if(_0x4423d9['operator']===_0xbd64('0x6f')){_0x13f083[_0x166783](_0xbd64('0x7b'),'%'+_0x4423d9[_0xbd64('0x6a')]+'%',null);}else{_0x220603=_['find'](_0x2abe23,[_0xbd64('0x54'),'UserId']);_0x4423d9[_0xbd64('0x53')]=_0xbd64('0x3d');_0x2b95a0=as[_0xbd64('0x75')](_0x16634d,_0x220603[_0xbd64('0x76')],_0x4423d9);_0x13f083[_0x166783](_0x2b95a0['text'],_0x2b95a0[_0xbd64('0x6a')]['start'],_0x2b95a0[_0xbd64('0x6a')][_0xbd64('0x20')]);}break;case _0xbd64('0x2e'):_0x2b95a0=as[_0xbd64('0x75')]('me',null,_0x4423d9);_0x13f083[_0x166783](_0x2b95a0[_0xbd64('0x77')],_0x2b95a0['value'][_0xbd64('0x7c')],_0x2b95a0[_0xbd64('0x6a')]['end']);break;}}else{var _0x2b95a0=as[_0xbd64('0x75')](_0x16634d,_0x220603[_0xbd64('0x76')],_0x4423d9);_0x13f083[_0x166783](_0x2b95a0[_0xbd64('0x77')],_0x2b95a0['value'][_0xbd64('0x7c')],_0x2b95a0['value'][_0xbd64('0x20')]);}}}else{var _0x4de7e0=_(_0x23bf21[_0xbd64('0x48')])['keys']()['map'](function(_0x51e0b0){return _['some'](_0x2abe23,[_0xbd64('0x54'),_0x51e0b0])?_0x51e0b0:undefined;})[_0xbd64('0x7d')]()[_0xbd64('0x6a')]();if(!_[_0xbd64('0x7e')](_0x4de7e0)){_0x4de7e0[_0xbd64('0x37')](function(_0x4ea72d){if(_0x4ea72d===_0xbd64('0x7f')){_0x270910[_0xbd64('0x51')](_0xbd64('0x80'),[][_0xbd64('0x81')](_0x23bf21[_0xbd64('0x48')][_0x4ea72d]));}else if(_0x4ea72d==='createdAt'){var _0x1abf2f=JSON[_0xbd64('0x82')](_0x23bf21[_0xbd64('0x48')][_0x4ea72d])[_0xbd64('0x83')];var _0x5875da=JSON['parse'](_0x23bf21[_0xbd64('0x48')][_0x4ea72d])[_0xbd64('0x84')];_0x270910[_0xbd64('0x51')](_0xbd64('0x85'),_0x1abf2f,_0x5875da);}else{if(_0x23bf21[_0xbd64('0x48')][_0x4ea72d]===_0xbd64('0x86')){_0x270910[_0xbd64('0x51')]('i.'+_0x4ea72d+_0xbd64('0x87'));}else{_0x270910['where']('i.'+_0x4ea72d+_0xbd64('0x88'),_0x23bf21['query'][_0x4ea72d]);}}});}if(_0x23bf21[_0xbd64('0x48')][_0xbd64('0x89')]){if(_0x23bf21[_0xbd64('0x48')]['read']==0x1){_0x270910[_0xbd64('0x6b')]('`unreadMessages`\x20=\x200');}else{_0x270910['having'](_0xbd64('0x8a'));}}if(_0x23bf21[_0xbd64('0x48')][_0xbd64('0x8b')]){_0x3b592e=_['isArray'](_0x23bf21[_0xbd64('0x48')][_0xbd64('0x8b')])?_0x23bf21[_0xbd64('0x48')][_0xbd64('0x8b')]:new Array(_0x23bf21['query'][_0xbd64('0x8b')]);_0x3b592e[_0xbd64('0x37')](function(_0x355b87){_0x713652['or'](_0xbd64('0x79'),'%,'+_0x355b87+',%');});}if(_0x23bf21[_0xbd64('0x48')][_0xbd64('0x8c')]){var _0x3bc2e8=_0x23bf21[_0xbd64('0x48')][_0xbd64('0x8c')][_0xbd64('0x8d')]('\x5c','\x5c\x5c')[_0xbd64('0x8d')](/'/g,'\x27\x27');if(qs[_0xbd64('0x8e')](_0x3bc2e8)){_0x13f083['or'](_0xbd64('0x8f'),_0x3bc2e8+'%');}else{_0x13f083['or'](_0xbd64('0x90'),qs['getFullTextValue'](_0x3bc2e8))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3bc2e8+'%');}}}_0x270910[_0xbd64('0x51')](_0x13f083);_0x270910[_0xbd64('0x91')](_0xbd64('0x92'));var _0x586056={'type':db[_0xbd64('0x93')]['QueryTypes'][_0xbd64('0x94')],'raw':!![]};var _0x99ee7f=_0x270910[_0xbd64('0x95')]();_0x99ee7f[_0xbd64('0x53')]('i.id');_0x99ee7f[_0xbd64('0x53')](_0xbd64('0x96'),'unreadMessages');if(_0x526705[_0xbd64('0x97')]){_0x526705['order'][_0xbd64('0x37')](function(_0x2415a8){var _0x38e860=_0x2415a8[0x0]===_0xbd64('0x98')?_0x2415a8[0x0]:'i.'+_0x2415a8[0x0];_0x270910[_0xbd64('0x97')](_0x38e860,_0x2415a8[0x1]===_0xbd64('0x99')?![]:!![]);});}if(!_['isEmpty'](_0x3b592e)){_0x270910[_0xbd64('0x6b')](_0x713652);_0x99ee7f['where'](_0xbd64('0x9a'),_0x3b592e);}BPromise[_0xbd64('0x9b')]()['then'](function(){if(!_0x2d788){if(_0x23bf21[_0xbd64('0x48')]['ChatWebsiteId'])return;_0x99ee7f[_0xbd64('0x51')](_0xbd64('0x9c'));_0x270910[_0xbd64('0x51')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x23bf21[_0xbd64('0x9d')][_0xbd64('0x9e')]!==_0xbd64('0x30'))return;return _0x23bf21[_0xbd64('0x9d')][_0xbd64('0x9f')]({'attributes':['id'],'raw':!![]})['then'](function(_0x58efa2){if(_[_0xbd64('0x7e')](_0x58efa2)){_0x99ee7f[_0xbd64('0x51')](_0xbd64('0xa0'));_0x270910[_0xbd64('0x51')](_0xbd64('0xa0'));}else{_0x99ee7f[_0xbd64('0x51')](_0xbd64('0x80'),_[_0xbd64('0x34')](_0x58efa2,'id'));_0x270910[_0xbd64('0x51')](_0xbd64('0x80'),_[_0xbd64('0x34')](_0x58efa2,'id'));}});})[_0xbd64('0x15')](function(){if(_0x23bf21[_0xbd64('0x9d')]['role']===_0xbd64('0x30')&&!_0x2d788&&!_0x23bf21[_0xbd64('0x48')]['ChatWebsiteId'])return[];return db[_0xbd64('0xa1')][_0xbd64('0x48')](_0x99ee7f[_0xbd64('0xa2')](),_0x586056);})[_0xbd64('0x15')](function(_0x4e948c){_0x3304b7['count']=_0x4e948c[_0xbd64('0x4e')];if(_0x3304b7[_0xbd64('0x26')]===0x0)return[];return db[_0xbd64('0xa1')][_0xbd64('0x48')](_0x57e811[_0xbd64('0xa2')](),_0x586056)[_0xbd64('0x15')](function(_0x23cead){_0x46a3af=_[_0xbd64('0xa3')](_0x23cead,'id');_0x586056=_[_0xbd64('0xa4')](_0x586056,{'model':db[_0xbd64('0x43')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x23bf21[_0xbd64('0x48')][_0xbd64('0x4d')]){_0x526705['attributes'][_0xbd64('0x37')](function(_0x13c379){_0x270910[_0xbd64('0x53')]('i.'+_0x13c379);});}else{_0x270910['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xbd64('0x69'));_0x270910[_0xbd64('0x53')]('a.key',_0xbd64('0xa5'));_0x270910[_0xbd64('0x53')](_0xbd64('0xa6'),_0xbd64('0xa7'));_0x270910[_0xbd64('0x53')](_0xbd64('0xa8'),_0xbd64('0x98'));_0x270910[_0xbd64('0x53')](_0xbd64('0xa9'));_0x270910[_0xbd64('0x53')](_0xbd64('0xaa'),_0xbd64('0xab'));_0x270910['field'](_0xbd64('0xac'),'Contact.lastName');_0x270910[_0xbd64('0x53')](_0xbd64('0xad'),_0xbd64('0xae'));_0x270910[_0xbd64('0x53')](_0xbd64('0xaf'),'Contact.phone');_0x270910[_0xbd64('0x53')](_0xbd64('0xb0'),_0xbd64('0xb1'));_0x270910[_0xbd64('0x53')]('c.fax',_0xbd64('0xb2'));_0x270910['field'](_0xbd64('0xb3'),_0xbd64('0xb4'));_0x270910[_0xbd64('0x53')](_0xbd64('0xb5'),_0xbd64('0xb6'));_0x270910[_0xbd64('0x53')](_0xbd64('0xb7'),'TagIds');}if(_0x526705[_0xbd64('0x25')])_0x270910[_0xbd64('0x25')](_0x526705[_0xbd64('0x25')]);if(_0x526705[_0xbd64('0x23')])_0x270910['offset'](_0x526705[_0xbd64('0x23')]);return db[_0xbd64('0xa1')][_0xbd64('0x48')](_0x270910[_0xbd64('0xa2')](),_0x586056);})[_0xbd64('0x15')](function(_0x2add60){if(_0x2add60[_0xbd64('0x4e')]>0x0)_0x4bd09c['where'](_0xbd64('0xb8'),_['map'](_0x2add60,'id'));return db[_0xbd64('0xa1')]['query'](_0x4bd09c['toString'](),_0x586056)[_0xbd64('0x15')](function(_0x1c2d76){var _0x29706a=_['groupBy'](_0x1c2d76,_0xbd64('0xb9'));var _0x49d6fe=[];_0x2add60[_0xbd64('0x37')](function(_0x48a1b1){_0x49d6fe['push'](updateChatInteraction(_0x48a1b1,_0x46a3af,_0x29706a));});return BPromise[_0xbd64('0xba')](_0x49d6fe);});});})[_0xbd64('0x15')](function(_0x30a8b4){_0x3304b7[_0xbd64('0xbb')]=_0x30a8b4;return _0x3304b7;})[_0xbd64('0x15')](respondWithFilteredResult(_0x495522,_0x526705))[_0xbd64('0x1f')](handleError(_0x495522,null));};exports[_0xbd64('0xbc')]=function(_0x475506,_0x5ecd1e){var _0x58d2c6={'raw':![],'where':{'id':_0x475506['params']['id']}},_0xd7e9dd={};_0xd7e9dd[_0xbd64('0x47')]=_[_0xbd64('0x49')](db[_0xbd64('0x43')]['rawAttributes']);_0xd7e9dd[_0xbd64('0x48')]=_[_0xbd64('0x49')](_0x475506['query']);_0xd7e9dd[_0xbd64('0x4a')]=_[_0xbd64('0x4b')](_0xd7e9dd['model'],_0xd7e9dd['query']);_0x58d2c6[_0xbd64('0x4c')]=_[_0xbd64('0x4b')](_0xd7e9dd[_0xbd64('0x47')],qs[_0xbd64('0x4d')](_0x475506[_0xbd64('0x48')][_0xbd64('0x4d')]));_0x58d2c6[_0xbd64('0x4c')]=_0x58d2c6[_0xbd64('0x4c')][_0xbd64('0x4e')]?_0x58d2c6[_0xbd64('0x4c')]:_0xd7e9dd[_0xbd64('0x47')];if(_0x475506[_0xbd64('0x48')][_0xbd64('0xbd')]){_0x58d2c6[_0xbd64('0xbe')]=[{'all':!![]}];}_0x58d2c6=_[_0xbd64('0xa4')]({},_0x58d2c6,_0x475506['options']);return db[_0xbd64('0x43')]['find'](_0x58d2c6)[_0xbd64('0x15')](handleEntityNotFound(_0x5ecd1e,null))[_0xbd64('0x15')](respondWithResult(_0x5ecd1e,null))['catch'](handleError(_0x5ecd1e,null));};exports[_0xbd64('0xbf')]=function(_0x4ad565,_0x2614bf){return db[_0xbd64('0x43')][_0xbd64('0xbf')](_0x4ad565[_0xbd64('0x2e')],{})['then'](respondWithResult(_0x2614bf,0xc9))[_0xbd64('0x1f')](handleError(_0x2614bf,null));};exports[_0xbd64('0x29')]=function(_0x291861,_0x459a16){if(_0x291861['body']['id']){delete _0x291861['body']['id'];}return db[_0xbd64('0x43')][_0xbd64('0x68')]({'where':{'id':_0x291861[_0xbd64('0xc0')]['id']}})['then'](handleEntityNotFound(_0x459a16,null))[_0xbd64('0x15')](saveUpdates(_0x291861['body'],null))[_0xbd64('0x15')](respondWithResult(_0x459a16,null))[_0xbd64('0x1f')](handleError(_0x459a16,null));};exports[_0xbd64('0x2a')]=function(_0x3337a5,_0x37ca27){return db['ChatInteraction']['find']({'where':{'id':_0x3337a5[_0xbd64('0xc0')]['id']}})[_0xbd64('0x15')](handleEntityNotFound(_0x37ca27,null))[_0xbd64('0x15')](removeEntity(_0x37ca27,null))['catch'](handleError(_0x37ca27,null));};exports[_0xbd64('0xc1')]=function(_0x4e1359,_0x11ab17){return db[_0xbd64('0x43')][_0xbd64('0xc1')]()['then'](respondWithResult(_0x11ab17,null))[_0xbd64('0x1f')](handleError(_0x11ab17,null));};exports[_0xbd64('0xc2')]=function(_0x496475,_0x4d5ad0){var _0x13be0b=_0x496475['params']['id'];var _0x4d1a95;var _0x1442ee;var _0x237a8c;return db['ChatInteraction'][_0xbd64('0xc3')]({'where':{'id':_0x13be0b}})['then'](function(_0x4011c5){_0x4d1a95=_0x4011c5;return db[_0xbd64('0xc4')][_0xbd64('0xc3')]({'where':{'id':_0x4011c5['ChatWebsiteId']},'attributes':['id',_0xbd64('0xc5'),'vidaooEscalation','vidaooTopic','vidaooNote',_0xbd64('0xc6')],'raw':!![]});})[_0xbd64('0x15')](function(_0xdf1c41){if(_0xdf1c41&&_0xdf1c41['vidaooApiKey']&&_0xdf1c41[_0xbd64('0xc7')]){_0x1442ee=_0xdf1c41;var _0x4a745f={'interaction':{'id':_0x13be0b},'agent':{'id':_0x496475[_0xbd64('0x9d')]['id'],'name':_0x496475['user']['name'],'fullname':_0x496475['user'][_0xbd64('0x35')],'email':_0x496475[_0xbd64('0x9d')][_0xbd64('0xc8')]},'contact':_0x496475[_0xbd64('0x2e')]['contact'],'account':_0x496475[_0xbd64('0x2e')][_0xbd64('0x32')]};var _0xef51de={'rejectUnauthorized':![],'method':'POST','url':_0xbd64('0xc9'),'headers':{'X-APIKEY':_0xdf1c41['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x496475[_0xbd64('0x9d')][_0xbd64('0xc8')]],'buttons':null,'topic':_0x1442ee[_0xbd64('0xca')],'note':_[_0xbd64('0xcb')](_0x1442ee[_0xbd64('0xcc')])?null:getMustacheRender(_0x1442ee[_0xbd64('0xcc')],_0x4a745f),'metadata':null},'redirect':_0xbd64('0xcd'),'json':!![]};try{if(!_[_0xbd64('0xcb')](_0x1442ee[_0xbd64('0xc6')])){var _0x871906=getMustacheRender(_0x1442ee[_0xbd64('0xc6')],_0x4a745f);var _0x17f82d=JSON[_0xbd64('0x82')](_0x871906);_0xef51de['body']['metadata']=_0x17f82d;}}catch(_0x3ccf53){throw new db[(_0xbd64('0x93'))][(_0xbd64('0xce'))](_0xbd64('0xcf'));}return rp(_0xef51de);}else{throw new db['Sequelize'][(_0xbd64('0xce'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xbd64('0x15')](function(_0x5ecf80){_0x237a8c=_0x5ecf80;if(_0x237a8c['id']){var _0x5b7dbd={'body':_0x237a8c[_0xbd64('0xd0')],'ChatWebsiteId':_0x1442ee['id'],'ChatInteractionId':_0x4d1a95['id'],'direction':_0xbd64('0xd1'),'UserId':_0x496475['user']['id']};return db[_0xbd64('0xd2')]['create'](_0x5b7dbd,{});}else{throw new db[(_0xbd64('0x93'))]['ValidationError'](_0xbd64('0xd3'));}})[_0xbd64('0x15')](function(){return _0x4d1a95[_0xbd64('0xd4')]({'vidaooSessionId':_0x237a8c['id']});})['then'](respondWithResult(_0x4d5ad0,null))[_0xbd64('0x1f')](handleError(_0x4d5ad0,null));};exports[_0xbd64('0xd5')]=function(_0x314899,_0x3fac1a){if(_0x314899[_0xbd64('0x2e')]['id']){delete _0x314899[_0xbd64('0x2e')]['id'];}return db[_0xbd64('0x43')]['find']({'where':{'id':_0x314899[_0xbd64('0xc0')]['id']},'include':[{'model':db[_0xbd64('0xd6')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x3fac1a,null))['then'](saveUpdates(_0x314899[_0xbd64('0x2e')],null))[_0xbd64('0x15')](respondWithResult(_0x3fac1a,null))[_0xbd64('0x1f')](handleError(_0x3fac1a,null));};exports['abandon']=function(_0x1b2a3e,_0x5d1231){if(_0x1b2a3e[_0xbd64('0x2e')]['id']){delete _0x1b2a3e['body']['id'];}return db[_0xbd64('0x43')][_0xbd64('0x68')]({'where':{'id':_0x1b2a3e[_0xbd64('0xc0')]['id']}})[_0xbd64('0x15')](function(_0xe1837c){if(!_0xe1837c){logger[_0xbd64('0x1a')](_0xbd64('0xd7'),_0xbd64('0xd8'),0x194,_0xbd64('0xd9'));_0x5d1231[_0xbd64('0xda')](0x194);}else{if(_0xe1837c[_0xbd64('0x3d')]){throw new db['Sequelize'][(_0xbd64('0xce'))](_0xbd64('0xdb'));}}return _0xe1837c;})[_0xbd64('0x15')](function(_0x23fd87){if(_0x23fd87){return _0x23fd87[_0xbd64('0x29')]({'closed':_0x1b2a3e[_0xbd64('0x2e')][_0xbd64('0x3c')],'disposition':_0x1b2a3e[_0xbd64('0x2e')][_0xbd64('0x40')]})['then'](function(_0x5e5211){return _0x5e5211;});}})[_0xbd64('0x15')](function(){return respondWithRpcPromise(_0xbd64('0xdc'),'abandon',_0x1b2a3e[_0xbd64('0x2e')],client9004);})[_0xbd64('0x15')](respondWithResult(_0x5d1231,null))['catch'](handleError(_0x5d1231,null));};exports[_0xbd64('0xdd')]=function(_0x4fdc08,_0x368998){_0x4fdc08[_0xbd64('0x2e')][_0xbd64('0x54')]=_0x4fdc08[_0xbd64('0xde')][_0xbd64('0xdf')];_0x4fdc08['body']['basename']=_0x4fdc08['file']['filename'];_0x4fdc08[_0xbd64('0x2e')]['type']=_0x4fdc08[_0xbd64('0xde')]['mimetype'];return db['Attachment'][_0xbd64('0xbf')](_0x4fdc08[_0xbd64('0x2e')])[_0xbd64('0x15')](respondWithResult(_0x368998,0xc9))[_0xbd64('0x1f')](handleError(_0x368998,null));};exports[_0xbd64('0xe0')]=function(_0x385178,_0x13fae5){return db[_0xbd64('0x43')][_0xbd64('0xc3')]({'where':{'id':_0x385178[_0xbd64('0xc0')]['id']},'raw':!![]})[_0xbd64('0x15')](handleEntityNotFound(_0x13fae5,null))[_0xbd64('0x15')](function(_0x5efd7c){if(_0x5efd7c){if(_0x5efd7c[_0xbd64('0x3c')]){return _0x13fae5[_0xbd64('0x21')](0x193)[_0xbd64('0x22')]({'status':0x193,'message':_0xbd64('0xe1')});}return db[_0xbd64('0xe2')][_0xbd64('0xc3')]({'where':{'id':_0x385178['query'][_0xbd64('0xe3')]},'raw':!![]})[_0xbd64('0x15')](handleEntityNotFound(_0x13fae5,null));}})[_0xbd64('0x15')](function(_0x2c2664){if(_0x2c2664){var _0x52011f=_0x2c2664[_0xbd64('0xe4')]!==null;var _0x117595=path[_0xbd64('0xe5')](config[_0xbd64('0xe6')],'server/files/attachments/');if(_0x52011f){_0x117595=path[_0xbd64('0xe5')](_0x117595,'offline-chat/');}var _0x5dd4db=path['join'](_0x117595,_0x2c2664[_0xbd64('0xe7')]);return _0x13fae5[_0xbd64('0xe8')](_0x5dd4db);}})['catch'](handleError(_0x13fae5,null));};exports['close']=function(_0x54831a,_0x1d8739){var _0x1c64ca=null;var _0x65c02b=null;var _0x545933=null;if(_0x54831a['body']['id']){delete _0x54831a[_0xbd64('0x2e')]['id'];}if(_0x54831a['body'][_0xbd64('0xe9')]){_0x545933=path['join'](config[_0xbd64('0xe6')],_0xbd64('0xea'),util[_0xbd64('0xeb')](_0xbd64('0xec'),Date['now']()));_0x54831a[_0xbd64('0x2e')][_0xbd64('0xed')]=_0x545933;}return db[_0xbd64('0x43')][_0xbd64('0x68')]({'where':{'id':_0x54831a['params']['id']},'include':[{'model':db[_0xbd64('0xd2')],'as':_0xbd64('0xee'),'include':[{'model':db[_0xbd64('0xef')],'as':_0xbd64('0xef')}]}]})[_0xbd64('0x15')](handleEntityNotFound(_0x1d8739,null))[_0xbd64('0x15')](saveUpdates(_0x54831a[_0xbd64('0x2e')],null))[_0xbd64('0x15')](function(_0x3d02a3){if(_0x3d02a3){_0x1c64ca=_0x3d02a3;return db['ChatWebsite']['find']({'where':{'id':_0x1c64ca[_0xbd64('0x7f')]}});}})['then'](function(_0x1b4d1a){if(_0x1b4d1a){_0x65c02b=_0x1b4d1a;return db[_0xbd64('0xd6')][_0xbd64('0x68')]({'where':{'id':_0x1c64ca['ContactId']}});}})['then'](function(_0x1798e1){if(_0x1798e1){if(_0x545933){var _0x394dd0=null;for(var _0x2b532a=0x1;_0x2b532a<_0x1c64ca[_0xbd64('0xee')][_0xbd64('0x4e')];++_0x2b532a){_0x394dd0=_0x1c64ca[_0xbd64('0xee')][_0x2b532a];var _0x1ac26f=_0x394dd0[_0xbd64('0x3d')]?util[_0xbd64('0xeb')]('%s%d',_0x65c02b['agentAlias'],_0x394dd0[_0xbd64('0x3d')]):_0xbd64('0xf0');var _0x4022da=_0x54831a[_0xbd64('0x2e')]['customer']||util[_0xbd64('0xeb')]('%s%d',_0xbd64('0xf1'),_0x394dd0['ContactId']);switch(_0x65c02b[_0xbd64('0xf2')]){case'website_alias':_0x1ac26f=_0x394dd0[_0xbd64('0x3d')]?util[_0xbd64('0xeb')](_0xbd64('0xf3'),_0x65c02b[_0xbd64('0xf4')],_0x394dd0[_0xbd64('0x3d')]):_0xbd64('0xf0');break;case'agent_alias':_0x1ac26f=_0x394dd0[_0xbd64('0x3d')]?_0x394dd0['User'][_0xbd64('0xf5')]||_0x394dd0['User']['fullname']:_0xbd64('0xf0');break;case _0xbd64('0xf6'):_0x1ac26f=_0x394dd0[_0xbd64('0x3d')]?_0x394dd0['User'][_0xbd64('0x35')]:_0xbd64('0xf0');break;default:_0x1ac26f=_0x394dd0[_0xbd64('0x3d')]?util[_0xbd64('0xeb')](_0xbd64('0xf3'),_0x65c02b['agentAlias'],_0x394dd0[_0xbd64('0x3d')]):'System';}var _0x5ec435=util[_0xbd64('0xeb')](_0xbd64('0xf7'),moment(_0x394dd0[_0xbd64('0xf8')])[_0xbd64('0xeb')](_0xbd64('0xf9')),_0x394dd0[_0xbd64('0xfa')]==='in'?_0x4022da:_0x1ac26f,_0x394dd0[_0xbd64('0x2e')]);if(!_0x394dd0[_0xbd64('0xfb')]){fs[_0xbd64('0xfc')](_0x545933,_0x5ec435);}}return db[_0xbd64('0xfd')][_0xbd64('0xc3')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xbd64('0xfe'),'raw':!![],'include':[{'model':db[_0xbd64('0xff')],'as':_0xbd64('0xff'),'raw':!![]}]}]});}}})[_0xbd64('0x15')](function(_0x4e69f8){if(!_0x4e69f8||!_0x4e69f8[_0xbd64('0xfe')]||!_0x54831a[_0xbd64('0x2e')])return _0x1c64ca;var _0x4a6ea9=_0x4e69f8['getSmtpOptions']();return respondWithRpcPromise(_0xbd64('0x100'),_0xbd64('0x101'),{'account':_0x4a6ea9,'message':{'from':util[_0xbd64('0xeb')](_0xbd64('0x102'),_0x4e69f8[_0xbd64('0x54')],_0x4e69f8[_0xbd64('0xc8')]||_0x4e69f8['Smtp'][_0xbd64('0x9d')]),'to':_0x54831a[_0xbd64('0x2e')][_0xbd64('0xe9')],'subject':_0xbd64('0x103'),'text':util['format'](_0xbd64('0x104'),_0x54831a['body'][_0xbd64('0xe9')]),'attachments':[{'path':_0x545933}]}})[_0xbd64('0x15')](function(){return _0x1c64ca;})[_0xbd64('0x1f')](function(_0x44662a){logger['error'](_0x44662a);});})[_0xbd64('0x15')](respondWithStatusCode(_0x1d8739,0xc8))['catch'](handleError(_0x1d8739,null));};exports[_0xbd64('0x105')]=function(_0x4cf6ec,_0x28ae53){return db['ChatMessage'][_0xbd64('0x68')]({'where':{'id':_0x4cf6ec[_0xbd64('0xc0')]['id']}})['then'](handleEntityNotFound(_0x28ae53,null))[_0xbd64('0x15')](function(_0x4238ae){if(_0x4238ae){return _0x4238ae['addMessage'](_0x4cf6ec[_0xbd64('0x2e')][_0xbd64('0x106')],_[_0xbd64('0x107')](_0x4cf6ec['body'],[_0xbd64('0x106'),'id'])||{});}})[_0xbd64('0x15')](respondWithResult(_0x28ae53,null))[_0xbd64('0x1f')](handleError(_0x28ae53,null));};exports['getMessages']=function(_0x475fc3,_0x46f980){var _0x5c9a2f={'raw':![],'where':{}};var _0x512f76={};var _0x4452ba={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x475fc3[_0xbd64('0xc0')]['id']}})[_0xbd64('0x15')](handleEntityNotFound(_0x46f980,null))[_0xbd64('0x15')](function(_0x5423f1){if(_0x5423f1){_0x512f76[_0xbd64('0x47')]=_['keys'](db[_0xbd64('0xd2')]['rawAttributes']);_0x512f76[_0xbd64('0x48')]=_[_0xbd64('0x49')](_0x475fc3['query']);_0x512f76[_0xbd64('0x4a')]=_[_0xbd64('0x4b')](_0x512f76[_0xbd64('0x47')],_0x512f76[_0xbd64('0x48')]);_0x5c9a2f[_0xbd64('0x4c')]=_[_0xbd64('0x4b')](_0x512f76['model'],qs[_0xbd64('0x4d')](_0x475fc3[_0xbd64('0x48')][_0xbd64('0x4d')]));_0x5c9a2f[_0xbd64('0x4c')]=_0x5c9a2f[_0xbd64('0x4c')][_0xbd64('0x4e')]?_0x5c9a2f['attributes']:_0x512f76['model'];if(!_0x475fc3[_0xbd64('0x48')][_0xbd64('0x4f')](_0xbd64('0x50'))){_0x5c9a2f['limit']=qs[_0xbd64('0x25')](_0x475fc3[_0xbd64('0x48')][_0xbd64('0x25')]);_0x5c9a2f[_0xbd64('0x23')]=qs[_0xbd64('0x23')](_0x475fc3[_0xbd64('0x48')][_0xbd64('0x23')]);}_0x5c9a2f['order']=qs[_0xbd64('0x108')](_0x475fc3[_0xbd64('0x48')][_0xbd64('0x108')]);_0x5c9a2f[_0xbd64('0x51')]=qs['filters'](_['pick'](_0x475fc3['query'],_0x512f76[_0xbd64('0x4a')]));_0x5c9a2f['where'][_0xbd64('0xb9')]=_0x5423f1['id'];if(_0x475fc3[_0xbd64('0x48')][_0xbd64('0x8c')]){_0x5c9a2f['where']=_[_0xbd64('0xa4')](_0x5c9a2f[_0xbd64('0x51')],{'$or':_[_0xbd64('0x34')](_0x5c9a2f[_0xbd64('0x4c')],function(_0x3248fa){var _0x996723={};_0x996723[_0x3248fa]={'$like':'%'+_0x475fc3[_0xbd64('0x48')][_0xbd64('0x8c')]+'%'};return _0x996723;})});}if(_0x475fc3[_0xbd64('0x48')][_0xbd64('0x83')]){var _0x217a57=_0x475fc3[_0xbd64('0x48')][_0xbd64('0x83')]['split'](',');var _0x233441={};_0x233441[_0x217a57[0x0]]={'$gte':moment(_0x217a57[0x1])['format'](_0xbd64('0x109'))};_0x5c9a2f[_0xbd64('0x51')]=_[_0xbd64('0xa4')](_0x5c9a2f[_0xbd64('0x51')],_0x233441);}_0x5c9a2f=_[_0xbd64('0xa4')]({},_0x5c9a2f,_0x475fc3[_0xbd64('0x10a')]);return db['ChatMessage']['count']({'where':_0x5c9a2f['where']})['then'](function(_0x2f75d1){_0x4452ba[_0xbd64('0x26')]=_0x2f75d1;if(_0x475fc3[_0xbd64('0x48')][_0xbd64('0xbd')]){_0x5c9a2f[_0xbd64('0xbe')]=[{'all':!![]}];}return db[_0xbd64('0xd2')][_0xbd64('0x10b')](_0x5c9a2f);})[_0xbd64('0x15')](function(_0x50abe1){_0x4452ba[_0xbd64('0xbb')]=_0x50abe1;return _0x4452ba;});}})[_0xbd64('0x15')](respondWithFilteredResult(_0x46f980,_0x5c9a2f))['catch'](handleError(_0x46f980,null));};exports[_0xbd64('0x10c')]=function(_0x41294f,_0x3f3cd6){var _0x47806e={'where':{}},_0x39b3c7={},_0x325f67={'count':0x0,'rows':[]};return db[_0xbd64('0x43')][_0xbd64('0xc3')]({'where':{'id':_0x41294f[_0xbd64('0xc0')]['id']}})[_0xbd64('0x15')](handleEntityNotFound(_0x3f3cd6,null))[_0xbd64('0x15')](function(_0x489033){if(_0x489033){_0x39b3c7[_0xbd64('0x47')]=_[_0xbd64('0x49')](db[_0xbd64('0xd2')]['rawAttributes']);_0x39b3c7[_0xbd64('0x48')]=_['keys'](_0x41294f[_0xbd64('0x48')]);_0x39b3c7[_0xbd64('0x4a')]=_[_0xbd64('0x4b')](_0x39b3c7['model'],_0x39b3c7['query']);_0x47806e[_0xbd64('0x4c')]=_[_0xbd64('0x4b')](_0x39b3c7['model'],qs[_0xbd64('0x4d')](_0x41294f['query'][_0xbd64('0x4d')]));_0x47806e[_0xbd64('0x4c')]=_0x47806e[_0xbd64('0x4c')][_0xbd64('0x4e')]?_0x47806e[_0xbd64('0x4c')]:_0x39b3c7[_0xbd64('0x47')];if(!_0x41294f[_0xbd64('0x48')][_0xbd64('0x4f')](_0xbd64('0x50'))){_0x47806e[_0xbd64('0x25')]=qs['limit'](_0x41294f['query'][_0xbd64('0x25')]);_0x47806e[_0xbd64('0x23')]=qs['offset'](_0x41294f[_0xbd64('0x48')][_0xbd64('0x23')]);}_0x47806e[_0xbd64('0x97')]=qs[_0xbd64('0x108')](_0x41294f['query'][_0xbd64('0x108')]);_0x47806e[_0xbd64('0x51')]=qs[_0xbd64('0x4a')](_['pick'](_0x41294f['query'],_0x39b3c7[_0xbd64('0x4a')]));_0x47806e[_0xbd64('0x51')][_0xbd64('0xb9')]=_0x489033['id'];if(_0x41294f['query'][_0xbd64('0x8c')]){_0x47806e['where']=_[_0xbd64('0xa4')](_0x47806e['where'],{'$or':_[_0xbd64('0x34')](_0x47806e['attributes'],function(_0x305199){var _0x37498c={};_0x37498c[_0x305199]={'$like':'%'+_0x41294f[_0xbd64('0x48')][_0xbd64('0x8c')]+'%'};return _0x37498c;})});}_0x47806e['where'][_0xbd64('0xfb')]=![];if(_0x41294f[_0xbd64('0x48')]['id']){_0x47806e[_0xbd64('0x51')]['id']={'$gt':_0x41294f[_0xbd64('0x48')]['id']};}_0x47806e=_[_0xbd64('0xa4')]({},_0x47806e,_0x41294f[_0xbd64('0x10a')]);return db[_0xbd64('0xd2')][_0xbd64('0x26')]({'where':_0x47806e[_0xbd64('0x51')]})[_0xbd64('0x15')](function(_0x197e24){_0x325f67['count']=_0x197e24;_0x47806e[_0xbd64('0xbe')]=[];if(_0x41294f[_0xbd64('0x48')]['includeAgent']){_0x47806e['include'][_0xbd64('0x39')]({'model':db[_0xbd64('0xef')],'as':'User','attributes':['id',_0xbd64('0x35'),_0xbd64('0xf5')]});}if(_0x41294f[_0xbd64('0x48')]['includeAll']){_0x47806e[_0xbd64('0xbe')]=[{'all':!![]}];}return db[_0xbd64('0xd2')]['findAll'](_0x47806e);})[_0xbd64('0x15')](function(_0x17cacc){_0x325f67[_0xbd64('0xbb')]=_0x17cacc;return _0x325f67;});}})[_0xbd64('0x15')](respondWithFilteredResult(_0x3f3cd6,_0x47806e))[_0xbd64('0x1f')](handleError(_0x3f3cd6,null));};exports[_0xbd64('0x10d')]=function(_0x1d759c,_0x171d75){return db[_0xbd64('0x43')]['find']({'where':{'id':_0x1d759c['params']['id']}})[_0xbd64('0x15')](handleEntityNotFound(_0x171d75,null))['then'](function(_0x2acfac){if(_0x2acfac){return _0x2acfac['setTags'](_0x1d759c[_0xbd64('0x2e')]['ids'],_[_0xbd64('0x107')](_0x1d759c[_0xbd64('0x2e')],['ids','id'])||{})[_0xbd64('0x10e')](function(){return db[_0xbd64('0x78')][_0xbd64('0x10b')]({'attributes':['id',_0xbd64('0x54'),_0xbd64('0x55')],'where':{'id':_0x1d759c[_0xbd64('0x2e')][_0xbd64('0x106')]}});})[_0xbd64('0x15')](function(_0x160744){socket[_0xbd64('0x10f')](_0xbd64('0x110'),{'id':Number(_0x1d759c[_0xbd64('0xc0')]['id']),'tags':_0x160744||[]});return{'id':Number(_0x1d759c[_0xbd64('0xc0')]['id']),'tags':_0x160744||[]};});}})[_0xbd64('0x15')](respondWithResult(_0x171d75,null))[_0xbd64('0x1f')](handleError(_0x171d75,null));};exports[_0xbd64('0x111')]=function(_0x384d15,_0x24eec6){return db[_0xbd64('0x43')]['find']({'where':{'id':_0x384d15[_0xbd64('0xc0')]['id']}})[_0xbd64('0x15')](handleEntityNotFound(_0x24eec6,null))[_0xbd64('0x15')](function(_0x483727){if(_0x483727){return _0x483727[_0xbd64('0x111')](_0x384d15[_0xbd64('0x48')][_0xbd64('0x106')]);}})[_0xbd64('0x15')](respondWithStatusCode(_0x24eec6,null))[_0xbd64('0x1f')](handleError(_0x24eec6,null));};exports[_0xbd64('0xe8')]=function(_0x89472a,_0x22dd66){var _0x2137fc=moment()[_0xbd64('0x112')]()[_0xbd64('0xa2')]();var _0x1267c8=path[_0xbd64('0xe5')](config[_0xbd64('0xe6')],_0xbd64('0x113'),'files',_0xbd64('0x114'));var _0x356b58=path[_0xbd64('0xe5')](config['root'],_0xbd64('0x113'),_0xbd64('0x115'),_0xbd64('0x116'));var _0x23e5d8=path[_0xbd64('0xe5')](_0x1267c8,_0x2137fc);var _0x18b84f=util[_0xbd64('0xeb')](_0xbd64('0x117'),_0x89472a[_0xbd64('0xc0')]['id'],_0x2137fc);var _0x281df6=path['join'](_0x1267c8,_0x18b84f);var _0x4021f2=[];_0x4021f2['push']({'model':db[_0xbd64('0xef')],'as':'User','attributes':['id',_0xbd64('0x35')],'raw':!![]});_0x4021f2[_0xbd64('0x39')]({'model':db[_0xbd64('0xd6')],'as':_0xbd64('0x118'),'attributes':['id',_0xbd64('0x119'),_0xbd64('0x11a')],'raw':!![]});if(_0x89472a[_0xbd64('0x48')][_0xbd64('0x116')]){_0x4021f2[_0xbd64('0x39')]({'model':db[_0xbd64('0xe2')],'as':_0xbd64('0xe2'),'raw':!![]});}var _0x3edc3b=[{'model':db[_0xbd64('0xd2')],'as':'Messages','attributes':['id','body',_0xbd64('0xf8'),_0xbd64('0xfa'),_0xbd64('0xfb'),_0xbd64('0x89')],'include':_0x4021f2}];_0x3edc3b[_0xbd64('0x39')]({'model':db[_0xbd64('0xc4')],'as':'Account','attributes':['id',_0xbd64('0x54')]});_0x3edc3b['push']({'model':db[_0xbd64('0xef')],'as':_0xbd64('0x11b'),'attributes':['id','fullname']});return db[_0xbd64('0x43')][_0xbd64('0x68')]({'where':{'id':_0x89472a[_0xbd64('0xc0')]['id']},'include':_0x3edc3b})[_0xbd64('0x15')](handleEntityNotFound(_0x22dd66,null))[_0xbd64('0x15')](function(_0x10a22f){if(_0x10a22f){var _0x3db848=_0x10a22f['get']({'plain':!![]});fs['mkdirSync'](_0x23e5d8);var _0x5422bc={'channel':_0xbd64('0x11c'),'account':_0x3db848[_0xbd64('0x11d')][_0xbd64('0x54')],'agent':_0x3db848[_0xbd64('0x11b')]?_0x3db848['Owner'][_0xbd64('0x35')]:'N.A.','createdAt':moment(_0x3db848['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xbd64('0xa2')](),'closedAt':_0x3db848[_0xbd64('0x3c')]?moment(_0x3db848[_0xbd64('0x11e')])[_0xbd64('0xeb')](_0xbd64('0x109'))['toString']():'','disposition':_0x3db848[_0xbd64('0x40')],'chatInfo':{'browser':_0x3db848[_0xbd64('0x11f')],'os':_0x3db848['osName'],'referer':_0x3db848['referer'],'customerIp':_0x3db848[_0xbd64('0x120')],'customerPort':_0x3db848['customerPort']?_0x3db848[_0xbd64('0x121')]:_0xbd64('0x122')},'messages':_(_0x3db848[_0xbd64('0xee')])[_0xbd64('0x123')]()[_0xbd64('0x8c')]({'secret':![]})[_0xbd64('0x34')](function(_0x20bdb5){if(_0x20bdb5[_0xbd64('0xe2')]){var _0x4020a1=path[_0xbd64('0xe5')](_0x356b58,_0x20bdb5[_0xbd64('0xe2')][_0xbd64('0xe7')]);if(fs[_0xbd64('0x124')](_0x4020a1)){fs[_0xbd64('0x125')](_0x4020a1)['pipe'](fs[_0xbd64('0x126')](path['join'](_0x23e5d8,_0x20bdb5[_0xbd64('0xe2')]['basename'])));}}return{'date':moment(_0x20bdb5[_0xbd64('0xf8')])[_0xbd64('0xeb')]('YYYY-MM-DD\x20HH:mm:ss')[_0xbd64('0xa2')](),'sender':_0x20bdb5[_0xbd64('0xfa')]===_0xbd64('0xd1')?_0x20bdb5['User']?_0x20bdb5[_0xbd64('0xef')][_0xbd64('0x35')]:_0xbd64('0xf0'):_0x20bdb5[_0xbd64('0x118')][_0xbd64('0x119')]+(_0x20bdb5['Contact'][_0xbd64('0x11a')]?'\x20'+_0x20bdb5['Contact']['lastName']:''),'body':_0x20bdb5['Attachment']?_0x20bdb5[_0xbd64('0xe2')]['basename']:_0x20bdb5[_0xbd64('0x2e')],'direction':_0x20bdb5[_0xbd64('0xfa')]===_0xbd64('0xd1')?'A':'C','secret':_0x20bdb5[_0xbd64('0xfb')],'read':_0x20bdb5[_0xbd64('0x89')],'attachment':_0x20bdb5['Attachment']};})[_0xbd64('0x6a')]()};return ejs['renderFile'](path[_0xbd64('0xe5')](config[_0xbd64('0xe6')],'server',_0xbd64('0x127'),_0xbd64('0x128')),{'interaction':_0x5422bc})[_0xbd64('0x15')](function(_0x1f5879){var _0x142845=path[_0xbd64('0xe5')](_0x23e5d8,_0xbd64('0x129')+_0x3db848['id']+'-'+_0x2137fc+_0xbd64('0x12a'));var _0x33a5c9={'path':_0x142845,'channel':'Chat','interactionId':_0x3db848['id']};return pdf[_0xbd64('0x12b')](_0x1f5879,_0x33a5c9);})['then'](function(){return new Promise(function(_0x5df014,_0x5d8bf1){zipdir(_0x23e5d8,{'saveTo':_0x281df6},function(_0x101acc,_0x4fceed){if(_0x101acc)return _0x5d8bf1(_0x101acc);return _0x5df014(_0x4fceed);});})[_0xbd64('0x15')](function(){return new BPromise(function(_0x4996bb,_0x1da281){rimraf(_0x23e5d8,function(_0x516378){if(_0x516378)_0x1da281(_0x516378);return _0x4996bb();});});})[_0xbd64('0x15')](function(){return _0x22dd66[_0xbd64('0xe8')](_0x281df6,_0x18b84f,function(_0x2583cd){if(_0x2583cd){logger[_0xbd64('0x1a')](_0xbd64('0x12c'),_0x2583cd);}else{fs['unlinkSync'](_0x281df6);}});});});}else{return _0x22dd66[_0xbd64('0xda')](0xc8);}})[_0xbd64('0x1f')](handleError(_0x22dd66,null));};
\ No newline at end of file
+var _0x5b02=['closed','disposition','index','ChatInteraction','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','pick','field','from','select','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','having','`\x20>\x200','Contact','$substring','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','start','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','isNumeric','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','toString','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','show','rawAttributes','includeAll','include','options','create','params','destroy','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','ValidationError','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','AbandonInteraction','file','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','join','download','format','transcript-%s.txt','now','Messages','User','ChatWebsite','CmContact','agentAlias','System','%s%d','Visitor','website_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','getMessages','hasOwnProperty','sort','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','addTags','setTags','ids','spread','emit','chatInteractionTags:save','removeTags','unix','tmp','server','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','Owner','get','mkdirSync','Chat','N.A.','browserName','referer','customerIp','customerPort','tail','existsSync','createWriteStream','out','renderFile','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','util','ejs','lodash','squel','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','defaults','redis','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','update','sendStatus','stack','name','render','merge','body','contact','agent','interaction','account','Users','map','fullname','TagIds','Tags','forEach','push','talking','answered','unmanaged','abandoned','total','UserId','waiting'];(function(_0x28e2cd,_0x153b42){var _0x11fd46=function(_0x50df13){while(--_0x50df13){_0x28e2cd['push'](_0x28e2cd['shift']());}};_0x11fd46(++_0x153b42);}(_0x5b02,0xe9));var _0x25b0=function(_0x114b63,_0x332fce){_0x114b63=_0x114b63-0x0;var _0x17caef=_0x5b02[_0x114b63];return _0x17caef;};'use strict';var rimraf=require(_0x25b0('0x0'));var zipdir=require(_0x25b0('0x1'));var rp=require(_0x25b0('0x2'));var moment=require(_0x25b0('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x25b0('0x4'));var path=require('path');var ejs=require(_0x25b0('0x5'));var fs=require('fs');var _=require(_0x25b0('0x6'));var squel=require(_0x25b0('0x7'));var Redis=require(_0x25b0('0x8'));var qs=require(_0x25b0('0x9'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x25b0('0xa'));var logger=require(_0x25b0('0xb'))('api');var config=require(_0x25b0('0xc'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x25b0('0xd')](config[_0x25b0('0xe')],{'host':_0x25b0('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x25b0('0xe')]));require(_0x25b0('0x10'))[_0x25b0('0x11')](socket);var jayson=require(_0x25b0('0x12'));var client=jayson[_0x25b0('0x13')][_0x25b0('0x14')]({'port':0x232b});var client9004=jayson[_0x25b0('0x13')][_0x25b0('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x193c2b,_0x1d3178,_0x184452,_0x26a34f){return new BPromise(function(_0x2048dc,_0x3655c2){var _0x1ceeb1=_0x26a34f||client;return _0x1ceeb1[_0x25b0('0x15')](_0x193c2b,_0x184452)[_0x25b0('0x16')](function(_0x211658){logger[_0x25b0('0x17')](_0x25b0('0x18'),_0x1d3178,_0x25b0('0x19'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x1d3178,_0x25b0('0x19'),JSON['stringify'](_0x211658));if(_0x211658[_0x25b0('0x1a')]){if(_0x211658[_0x25b0('0x1a')][_0x25b0('0x1b')]===0x1f4){logger[_0x25b0('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x1d3178,_0x211658[_0x25b0('0x1a')][_0x25b0('0x1c')]);return _0x3655c2(_0x211658[_0x25b0('0x1a')][_0x25b0('0x1c')]);}logger[_0x25b0('0x1a')](_0x25b0('0x18'),_0x1d3178,_0x211658['error'][_0x25b0('0x1c')]);return _0x2048dc(_0x211658[_0x25b0('0x1a')][_0x25b0('0x1c')]);}else{logger[_0x25b0('0x17')](_0x25b0('0x18'),_0x1d3178,_0x25b0('0x19'));_0x2048dc(_0x211658[_0x25b0('0x1d')][_0x25b0('0x1c')]);}})[_0x25b0('0x1e')](function(_0x35939f){logger[_0x25b0('0x1a')](_0x25b0('0x18'),_0x1d3178,_0x35939f);_0x3655c2(_0x35939f);});});}function respondWithStatusCode(_0x5cb746,_0x9f432e){_0x9f432e=_0x9f432e||0xcc;return function(_0x16623c){if(_0x16623c){return _0x5cb746['sendStatus'](_0x9f432e);}return _0x5cb746[_0x25b0('0x1f')](_0x9f432e)[_0x25b0('0x20')]();};}function respondWithResult(_0x3546f0,_0x498fef){_0x498fef=_0x498fef||0xc8;return function(_0x4b87c9){if(_0x4b87c9){return _0x3546f0['status'](_0x498fef)[_0x25b0('0x21')](_0x4b87c9);}};}function respondWithFilteredResult(_0x433085,_0x99bd3a){return function(_0x24f847){if(_0x24f847){var _0xdbb459=typeof _0x99bd3a[_0x25b0('0x22')]===_0x25b0('0x23')&&typeof _0x99bd3a[_0x25b0('0x24')]===_0x25b0('0x23');var _0x596d14=_0x24f847[_0x25b0('0x25')];var _0xbfba84=_0xdbb459?0x0:_0x99bd3a['offset'];var _0x567775=_0xdbb459?_0x24f847['count']:_0x99bd3a[_0x25b0('0x22')]+_0x99bd3a[_0x25b0('0x24')];var _0x251fad;if(_0x567775>=_0x596d14){_0x567775=_0x596d14;_0x251fad=0xc8;}else{_0x251fad=0xce;}_0x433085[_0x25b0('0x1f')](_0x251fad);return _0x433085[_0x25b0('0x26')](_0x25b0('0x27'),_0xbfba84+'-'+_0x567775+'/'+_0x596d14)[_0x25b0('0x21')](_0x24f847);}return null;};}function saveUpdates(_0x227287){return function(_0x36b81d){if(_0x36b81d){return _0x36b81d[_0x25b0('0x28')](_0x227287)[_0x25b0('0x16')](function(_0x3161c1){return _0x3161c1;});}return null;};}function removeEntity(_0x1ea374){return function(_0x4f640f){if(_0x4f640f){return _0x4f640f['destroy']()[_0x25b0('0x16')](function(){_0x1ea374['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3317fc){return function(_0x419975){if(!_0x419975){_0x3317fc[_0x25b0('0x29')](0x194);}return _0x419975;};}function handleError(_0x2338fa,_0xb68653){_0xb68653=_0xb68653||0x1f4;return function(_0x5d64dc){logger[_0x25b0('0x1a')](_0x5d64dc[_0x25b0('0x2a')]);if(_0x5d64dc['name']){delete _0x5d64dc[_0x25b0('0x2b')];}_0x2338fa[_0x25b0('0x1f')](_0xb68653)['send'](_0x5d64dc);};}function getMustacheRender(_0x215fb8,_0x49b3a5){return Mustache[_0x25b0('0x2c')](_0x215fb8,_[_0x25b0('0x2d')](_0x49b3a5[_0x25b0('0x2e')],{'contact':_0x49b3a5[_0x25b0('0x2f')],'message':_0x49b3a5[_0x25b0('0x1c')],'agent':_0x49b3a5[_0x25b0('0x30')],'interaction':_0x49b3a5[_0x25b0('0x31')],'account':_0x49b3a5[_0x25b0('0x32')]}))||'';}function getInteractionUsers(_0x2f123c,_0x4790fe){return new BPromise(function(_0x461a06,_0x434bda){try{if(_0x4790fe[_0x2f123c['id']]){_0x2f123c[_0x25b0('0x33')]=_[_0x25b0('0x34')](_0x4790fe[_0x2f123c['id']],function(_0xc6180){return{'id':_0xc6180['id'],'fullname':_0xc6180[_0x25b0('0x35')]};});}}catch(_0x1eee05){_0x434bda(_0x1eee05);}_0x461a06(_0x2f123c);});}function getInteractionTags(_0x847eba,_0x29e810){return new BPromise(function(_0x2d798b,_0x4c6a19){try{if(_0x847eba[_0x25b0('0x36')]){_0x847eba[_0x25b0('0x37')]=[];_0x847eba[_0x25b0('0x36')]['split'](',')[_0x25b0('0x38')](function(_0x42a0ed){_0x847eba[_0x25b0('0x37')][_0x25b0('0x39')](_0x29e810[_0x42a0ed]);});}delete _0x847eba[_0x25b0('0x36')];}catch(_0xa35c6a){_0x4c6a19(_0xa35c6a);}_0x2d798b(_0x847eba);});}function updateChatInteraction(_0x28f1cd,_0x391493,_0x5297f7){return new BPromise(function(_0x4ae0aa,_0x447a18){return getInteractionUsers(_0x28f1cd,_0x5297f7)[_0x25b0('0x16')](function(_0x3f4ae0){return getInteractionTags(_0x3f4ae0,_0x391493);})['then'](function(_0x9c6ab4){return getStateInteraction(_0x9c6ab4);})['then'](function(_0x3eb6d4){_0x4ae0aa(_0x3eb6d4);})[_0x25b0('0x1e')](function(_0xbd0db5){_0x447a18(_0xbd0db5);});});}function getStateInteraction(_0x255e31){return new BPromise(function(_0x8a2eeb){_0x255e31['waiting']=0x0;_0x255e31[_0x25b0('0x3a')]=0x0;_0x255e31[_0x25b0('0x3b')]=0x0;_0x255e31[_0x25b0('0x3c')]=0x0;_0x255e31[_0x25b0('0x3d')]=0x0;_0x255e31[_0x25b0('0x3e')]=0x0;if(!_0x255e31['closed']&&!_0x255e31[_0x25b0('0x3f')]){_0x255e31[_0x25b0('0x40')]+=0x1;}if(!_0x255e31[_0x25b0('0x41')]&&_0x255e31[_0x25b0('0x3f')]){_0x255e31[_0x25b0('0x3a')]+=0x1;if(_0x255e31[_0x25b0('0x40')]){_0x255e31[_0x25b0('0x40')]-=0x1;}}if(_0x255e31[_0x25b0('0x41')]&&_0x255e31[_0x25b0('0x42')]===_0x25b0('0x3d')){_0x255e31[_0x25b0('0x3d')]+=0x1;if(_0x255e31['waiting']){_0x255e31[_0x25b0('0x40')]-=0x1;}}else if(_0x255e31['closed']&&!_0x255e31[_0x25b0('0x3f')]&&_0x255e31[_0x25b0('0x42')]){_0x255e31[_0x25b0('0x3c')]+=0x1;if(_0x255e31[_0x25b0('0x40')]){_0x255e31['waiting']-=0x1;}}else if(_0x255e31[_0x25b0('0x41')]&&_0x255e31[_0x25b0('0x3f')]){_0x255e31[_0x25b0('0x3b')]+=0x1;if(_0x255e31['talking']){_0x255e31[_0x25b0('0x3a')]-=0x1;}}_0x255e31[_0x25b0('0x3e')]+=0x1;_0x8a2eeb(_0x255e31);});}exports[_0x25b0('0x43')]=function(_0x4434b1,_0x3b6679){var _0x3c6ec1={},_0x28bdc4={},_0x55ff4c={'count':0x0,'rows':[]};var _0x3ad3b3=_[_0x25b0('0x34')](db[_0x25b0('0x44')]['rawAttributes'],function(_0xbaeb06){return{'name':_0xbaeb06[_0x25b0('0x45')],'type':_0xbaeb06[_0x25b0('0x46')][_0x25b0('0x47')]};});_0x28bdc4[_0x25b0('0x48')]=_['map'](_0x3ad3b3,_0x25b0('0x2b'));_0x28bdc4[_0x25b0('0x49')]=_[_0x25b0('0x4a')](_0x4434b1['query']);_0x28bdc4[_0x25b0('0x4b')]=_[_0x25b0('0x4c')](_0x28bdc4[_0x25b0('0x48')],_0x28bdc4[_0x25b0('0x49')]);_0x3c6ec1[_0x25b0('0x4d')]=_[_0x25b0('0x4c')](_0x28bdc4['model'],qs['fields'](_0x4434b1['query'][_0x25b0('0x4e')]));_0x3c6ec1['attributes']=_0x3c6ec1['attributes'][_0x25b0('0x4f')]?_0x3c6ec1['attributes']:_0x28bdc4[_0x25b0('0x48')];if(!_0x4434b1['query']['hasOwnProperty'](_0x25b0('0x50'))){_0x3c6ec1[_0x25b0('0x24')]=qs[_0x25b0('0x24')](_0x4434b1[_0x25b0('0x49')][_0x25b0('0x24')]);_0x3c6ec1[_0x25b0('0x22')]=qs[_0x25b0('0x22')](_0x4434b1[_0x25b0('0x49')][_0x25b0('0x22')]);}_0x3c6ec1[_0x25b0('0x51')]=qs['sort'](_0x4434b1['query']['sort']);_0x3c6ec1[_0x25b0('0x52')]=qs[_0x25b0('0x4b')](_[_0x25b0('0x53')](_0x4434b1[_0x25b0('0x49')],_0x28bdc4[_0x25b0('0x4b')]),_0x3ad3b3);var _0x3f460f=[];var _0x735ebb=squel['select']()[_0x25b0('0x54')]('id')['field'](_0x25b0('0x2b'))['field']('color')[_0x25b0('0x55')]('tools_tags');var _0x58d4ad=squel[_0x25b0('0x56')]()[_0x25b0('0x54')](_0x25b0('0x57'))[_0x25b0('0x54')](_0x25b0('0x58'))[_0x25b0('0x54')](_0x25b0('0x59'))[_0x25b0('0x55')](_0x25b0('0x5a'),'ui')[_0x25b0('0x5b')]('users','u','u.id\x20=\x20ui.UserId');var _0x163a05=squel[_0x25b0('0x56')]()['from'](_0x25b0('0x5c'),'i')[_0x25b0('0x5b')](_0x25b0('0x5d'),'c',_0x25b0('0x5e'))[_0x25b0('0x5b')]('users','o',_0x25b0('0x5f'))[_0x25b0('0x5b')](_0x25b0('0x60'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x25b0('0x5b')](_0x25b0('0x61'),'me',_0x25b0('0x62'))[_0x25b0('0x5b')](_0x25b0('0x63'),'it',_0x25b0('0x64'))[_0x25b0('0x5b')](_0x25b0('0x65'),'t',_0x25b0('0x66'));var _0x39a5e3=squel[_0x25b0('0x67')]();var _0x131049=[];var _0x2db834=squel[_0x25b0('0x67')]();var _0x561634;if(_0x4434b1[_0x25b0('0x49')][_0x25b0('0x68')]){_0x561634=as['parseSearch'](_0x4434b1[_0x25b0('0x49')]['search']);var _0x3d3060=_0x561634[_0x25b0('0x69')];for(var _0x4cd91f=0x0;_0x4cd91f<_0x561634[_0x25b0('0x6a')][_0x25b0('0x4f')];_0x4cd91f++){var _0x25fab4=_0x561634['conditions'][_0x4cd91f];var _0x135f75='i';var _0x5534ab=_[_0x25b0('0x6b')](_0x3ad3b3,[_0x25b0('0x2b'),_0x25fab4['field']]);if(!_0x5534ab){switch(_0x25fab4[_0x25b0('0x54')]){case _0x25b0('0x6c'):if(_0x25fab4['value']==0x1){_0x163a05[_0x25b0('0x6d')]('`'+_0x25fab4['field']+'`\x20=\x200');}else{_0x163a05['having']('`'+_0x25fab4[_0x25b0('0x54')]+_0x25b0('0x6e'));}break;case _0x25b0('0x6f'):if(_0x25fab4['operator']===_0x25b0('0x70')){if(_0x25fab4[_0x25b0('0x71')][_0x25b0('0x72')]('\x20')[_0x25b0('0x4f')]>0x1){_0x39a5e3[_0x3d3060](_0x25b0('0x73'),qs[_0x25b0('0x74')](_0x25fab4[_0x25b0('0x71')]),null);}else{var _0x452f19='%'+_0x25fab4[_0x25b0('0x71')]+'%';_0x39a5e3[_0x3d3060](_0x25b0('0x75'),_0x452f19,_0x452f19,_0x452f19);}}else{_0x5534ab=_[_0x25b0('0x6b')](_0x3ad3b3,[_0x25b0('0x2b'),_0x25b0('0x76')]);_0x25fab4[_0x25b0('0x54')]=_0x25b0('0x76');_0x55a48d=as[_0x25b0('0x77')](_0x135f75,_0x5534ab[_0x25b0('0x46')],_0x25fab4);_0x39a5e3[_0x3d3060](_0x55a48d['text'],_0x55a48d[_0x25b0('0x71')]['start'],_0x55a48d[_0x25b0('0x71')][_0x25b0('0x20')]);}break;case _0x25b0('0x78'):var _0x139eef=_0x25fab4['value'][_0x25b0('0x72')](',')[_0x25b0('0x34')](function(_0x3e326c){return Number(_0x3e326c);});_0x139eef[_0x25b0('0x38')](function(_0x46a1d1){_0x2db834['or'](_0x25b0('0x79'),'%,'+_0x46a1d1+',%');});_0x131049=_['union'](_0x131049,_0x139eef);break;case'User':if(_0x25fab4[_0x25b0('0x7a')]==='$substring'){_0x39a5e3[_0x3d3060](_0x25b0('0x7b'),'%'+_0x25fab4[_0x25b0('0x71')]+'%',null);}else{_0x5534ab=_[_0x25b0('0x6b')](_0x3ad3b3,['name',_0x25b0('0x3f')]);_0x25fab4[_0x25b0('0x54')]=_0x25b0('0x3f');_0x55a48d=as[_0x25b0('0x77')](_0x135f75,_0x5534ab['type'],_0x25fab4);_0x39a5e3[_0x3d3060](_0x55a48d[_0x25b0('0x7c')],_0x55a48d[_0x25b0('0x71')][_0x25b0('0x7d')],_0x55a48d['value'][_0x25b0('0x20')]);}break;case _0x25b0('0x2e'):_0x55a48d=as[_0x25b0('0x77')]('me',null,_0x25fab4);_0x39a5e3[_0x3d3060](_0x55a48d[_0x25b0('0x7c')],_0x55a48d[_0x25b0('0x71')][_0x25b0('0x7d')],_0x55a48d[_0x25b0('0x71')][_0x25b0('0x20')]);break;}}else{var _0x55a48d=as[_0x25b0('0x77')](_0x135f75,_0x5534ab[_0x25b0('0x46')],_0x25fab4);_0x39a5e3[_0x3d3060](_0x55a48d[_0x25b0('0x7c')],_0x55a48d[_0x25b0('0x71')]['start'],_0x55a48d['value'][_0x25b0('0x20')]);}}}else{var _0x330daa=_(_0x4434b1[_0x25b0('0x49')])[_0x25b0('0x4a')]()['map'](function(_0x3315bf){return _[_0x25b0('0x7e')](_0x3ad3b3,['name',_0x3315bf])?_0x3315bf:undefined;})[_0x25b0('0x7f')]()[_0x25b0('0x71')]();if(!_['isEmpty'](_0x330daa)){_0x330daa['forEach'](function(_0xef147b){if(_0xef147b===_0x25b0('0x80')){_0x163a05[_0x25b0('0x52')](_0x25b0('0x81'),[][_0x25b0('0x82')](_0x4434b1[_0x25b0('0x49')][_0xef147b]));}else if(_0xef147b===_0x25b0('0x83')){var _0x12fd93=JSON[_0x25b0('0x84')](_0x4434b1[_0x25b0('0x49')][_0xef147b])[_0x25b0('0x85')];var _0x43b334=JSON[_0x25b0('0x84')](_0x4434b1['query'][_0xef147b])[_0x25b0('0x86')];_0x163a05['where'](_0x25b0('0x87'),_0x12fd93,_0x43b334);}else{if(_0x4434b1[_0x25b0('0x49')][_0xef147b]==='null'){_0x163a05[_0x25b0('0x52')]('i.'+_0xef147b+_0x25b0('0x88'));}else{_0x163a05[_0x25b0('0x52')]('i.'+_0xef147b+_0x25b0('0x89'),_0x4434b1[_0x25b0('0x49')][_0xef147b]);}}});}if(_0x4434b1[_0x25b0('0x49')][_0x25b0('0x8a')]){if(_0x4434b1[_0x25b0('0x49')][_0x25b0('0x8a')]==0x1){_0x163a05[_0x25b0('0x6d')](_0x25b0('0x8b'));}else{_0x163a05['having']('`unreadMessages`\x20>\x200');}}if(_0x4434b1[_0x25b0('0x49')][_0x25b0('0x8c')]){_0x131049=_['isArray'](_0x4434b1['query'][_0x25b0('0x8c')])?_0x4434b1['query'][_0x25b0('0x8c')]:new Array(_0x4434b1[_0x25b0('0x49')]['tag']);_0x131049[_0x25b0('0x38')](function(_0xd49a10){_0x2db834['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xd49a10+',%');});}if(_0x4434b1[_0x25b0('0x49')][_0x25b0('0x8d')]){var _0x9ee86f=_0x4434b1[_0x25b0('0x49')][_0x25b0('0x8d')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x25b0('0x8e')](_0x9ee86f)){_0x39a5e3['or']('i.id\x20LIKE\x20?',_0x9ee86f+'%');}else{_0x39a5e3['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x9ee86f))['or'](_0x25b0('0x8f'),_0x9ee86f+'%');}}}_0x163a05[_0x25b0('0x52')](_0x39a5e3);_0x163a05[_0x25b0('0x90')]('i.id');var _0x57f494={'type':db[_0x25b0('0x91')][_0x25b0('0x92')]['SELECT'],'raw':!![]};var _0x4e9ac3=_0x163a05['clone']();_0x4e9ac3[_0x25b0('0x54')](_0x25b0('0x93'));_0x4e9ac3[_0x25b0('0x54')](_0x25b0('0x94'),'unreadMessages');if(_0x3c6ec1[_0x25b0('0x51')]){_0x3c6ec1[_0x25b0('0x51')][_0x25b0('0x38')](function(_0xd956a5){var _0x35d1a0=_0xd956a5[0x0]===_0x25b0('0x95')?_0xd956a5[0x0]:'i.'+_0xd956a5[0x0];_0x163a05[_0x25b0('0x51')](_0x35d1a0,_0xd956a5[0x1]===_0x25b0('0x96')?![]:!![]);});}if(!_[_0x25b0('0x97')](_0x131049)){_0x163a05[_0x25b0('0x6d')](_0x2db834);_0x4e9ac3[_0x25b0('0x52')](_0x25b0('0x98'),_0x131049);}BPromise[_0x25b0('0x99')]()[_0x25b0('0x16')](function(){if(!_0x561634){if(_0x4434b1[_0x25b0('0x49')][_0x25b0('0x80')])return;_0x4e9ac3[_0x25b0('0x52')](_0x25b0('0x9a'));_0x163a05['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x4434b1[_0x25b0('0x9b')]['role']!==_0x25b0('0x30'))return;return _0x4434b1['user']['getChatWebsites']({'attributes':['id'],'raw':!![]})['then'](function(_0x4cb24c){if(_['isEmpty'](_0x4cb24c)){_0x4e9ac3[_0x25b0('0x52')](_0x25b0('0x9c'));_0x163a05[_0x25b0('0x52')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x4e9ac3[_0x25b0('0x52')](_0x25b0('0x81'),_['map'](_0x4cb24c,'id'));_0x163a05[_0x25b0('0x52')](_0x25b0('0x81'),_[_0x25b0('0x34')](_0x4cb24c,'id'));}});})[_0x25b0('0x16')](function(){if(_0x4434b1[_0x25b0('0x9b')][_0x25b0('0x9d')]===_0x25b0('0x30')&&!_0x561634&&!_0x4434b1[_0x25b0('0x49')][_0x25b0('0x80')])return[];return db[_0x25b0('0x9e')][_0x25b0('0x49')](_0x4e9ac3[_0x25b0('0x9f')](),_0x57f494);})[_0x25b0('0x16')](function(_0x2e1c98){_0x55ff4c[_0x25b0('0x25')]=_0x2e1c98[_0x25b0('0x4f')];if(_0x55ff4c[_0x25b0('0x25')]===0x0)return[];return db['sequelize'][_0x25b0('0x49')](_0x735ebb[_0x25b0('0x9f')](),_0x57f494)[_0x25b0('0x16')](function(_0x2a6a2a){_0x3f460f=_[_0x25b0('0xa0')](_0x2a6a2a,'id');_0x57f494=_['merge'](_0x57f494,{'model':db[_0x25b0('0x44')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4434b1['query'][_0x25b0('0x4e')]){_0x3c6ec1['attributes']['forEach'](function(_0x4fe408){_0x163a05['field']('i.'+_0x4fe408);});}else{_0x163a05[_0x25b0('0x54')](_0x25b0('0x94'),'unreadMessages');_0x163a05[_0x25b0('0x54')](_0x25b0('0xa1'),_0x25b0('0xa2'));_0x163a05[_0x25b0('0x54')]('a.mandatoryDisposition',_0x25b0('0xa3'));_0x163a05[_0x25b0('0x54')](_0x25b0('0xa4'),'contactName');_0x163a05[_0x25b0('0x54')](_0x25b0('0xa5'));_0x163a05[_0x25b0('0x54')](_0x25b0('0xa6'),_0x25b0('0xa7'));_0x163a05['field']('c.lastName',_0x25b0('0xa8'));_0x163a05[_0x25b0('0x54')](_0x25b0('0xa9'),_0x25b0('0xaa'));_0x163a05[_0x25b0('0x54')](_0x25b0('0xab'),_0x25b0('0xac'));_0x163a05[_0x25b0('0x54')](_0x25b0('0xad'),_0x25b0('0xae'));_0x163a05[_0x25b0('0x54')](_0x25b0('0xaf'),_0x25b0('0xb0'));_0x163a05['field'](_0x25b0('0xb1'),'Owner.fullname');_0x163a05[_0x25b0('0x54')](_0x25b0('0xb2'),_0x25b0('0xb3'));_0x163a05[_0x25b0('0x54')](_0x25b0('0xb4'),_0x25b0('0x36'));}if(_0x3c6ec1['limit'])_0x163a05[_0x25b0('0x24')](_0x3c6ec1['limit']);if(_0x3c6ec1[_0x25b0('0x22')])_0x163a05['offset'](_0x3c6ec1[_0x25b0('0x22')]);return db[_0x25b0('0x9e')][_0x25b0('0x49')](_0x163a05[_0x25b0('0x9f')](),_0x57f494);})[_0x25b0('0x16')](function(_0xcf7098){if(_0xcf7098['length']>0x0)_0x58d4ad['where'](_0x25b0('0xb5'),_[_0x25b0('0x34')](_0xcf7098,'id'));return db[_0x25b0('0x9e')][_0x25b0('0x49')](_0x58d4ad['toString'](),_0x57f494)[_0x25b0('0x16')](function(_0x5e0ae3){var _0x220a3b=_[_0x25b0('0xb6')](_0x5e0ae3,'ChatInteractionId');var _0x2b20e8=[];_0xcf7098[_0x25b0('0x38')](function(_0x52bcb7){_0x2b20e8[_0x25b0('0x39')](updateChatInteraction(_0x52bcb7,_0x3f460f,_0x220a3b));});return BPromise[_0x25b0('0xb7')](_0x2b20e8);});});})[_0x25b0('0x16')](function(_0x6d1e07){_0x55ff4c[_0x25b0('0xb8')]=_0x6d1e07;return _0x55ff4c;})[_0x25b0('0x16')](respondWithFilteredResult(_0x3b6679,_0x3c6ec1))[_0x25b0('0x1e')](handleError(_0x3b6679,null));};exports[_0x25b0('0xb9')]=function(_0xa6b29d,_0x39c3d8){var _0x5e2169={'raw':![],'where':{'id':_0xa6b29d['params']['id']}},_0x40b592={};_0x40b592[_0x25b0('0x48')]=_[_0x25b0('0x4a')](db[_0x25b0('0x44')][_0x25b0('0xba')]);_0x40b592[_0x25b0('0x49')]=_['keys'](_0xa6b29d[_0x25b0('0x49')]);_0x40b592[_0x25b0('0x4b')]=_[_0x25b0('0x4c')](_0x40b592[_0x25b0('0x48')],_0x40b592[_0x25b0('0x49')]);_0x5e2169['attributes']=_['intersection'](_0x40b592[_0x25b0('0x48')],qs[_0x25b0('0x4e')](_0xa6b29d[_0x25b0('0x49')][_0x25b0('0x4e')]));_0x5e2169['attributes']=_0x5e2169[_0x25b0('0x4d')]['length']?_0x5e2169[_0x25b0('0x4d')]:_0x40b592[_0x25b0('0x48')];if(_0xa6b29d[_0x25b0('0x49')][_0x25b0('0xbb')]){_0x5e2169[_0x25b0('0xbc')]=[{'all':!![]}];}_0x5e2169=_[_0x25b0('0x2d')]({},_0x5e2169,_0xa6b29d[_0x25b0('0xbd')]);return db[_0x25b0('0x44')][_0x25b0('0x6b')](_0x5e2169)['then'](handleEntityNotFound(_0x39c3d8,null))[_0x25b0('0x16')](respondWithResult(_0x39c3d8,null))['catch'](handleError(_0x39c3d8,null));};exports[_0x25b0('0xbe')]=function(_0x44c6e6,_0x43401e){return db[_0x25b0('0x44')][_0x25b0('0xbe')](_0x44c6e6['body'],{})[_0x25b0('0x16')](respondWithResult(_0x43401e,0xc9))[_0x25b0('0x1e')](handleError(_0x43401e,null));};exports[_0x25b0('0x28')]=function(_0x40d6fb,_0x50dbb7){if(_0x40d6fb['body']['id']){delete _0x40d6fb[_0x25b0('0x2e')]['id'];}return db[_0x25b0('0x44')][_0x25b0('0x6b')]({'where':{'id':_0x40d6fb[_0x25b0('0xbf')]['id']}})['then'](handleEntityNotFound(_0x50dbb7,null))['then'](saveUpdates(_0x40d6fb[_0x25b0('0x2e')],null))['then'](respondWithResult(_0x50dbb7,null))[_0x25b0('0x1e')](handleError(_0x50dbb7,null));};exports[_0x25b0('0xc0')]=function(_0x42bc42,_0x107814){return db[_0x25b0('0x44')]['find']({'where':{'id':_0x42bc42[_0x25b0('0xbf')]['id']}})[_0x25b0('0x16')](handleEntityNotFound(_0x107814,null))[_0x25b0('0x16')](removeEntity(_0x107814,null))['catch'](handleError(_0x107814,null));};exports[_0x25b0('0xc1')]=function(_0x31908d,_0x42c9b5){return db['ChatInteraction'][_0x25b0('0xc1')]()['then'](respondWithResult(_0x42c9b5,null))['catch'](handleError(_0x42c9b5,null));};exports[_0x25b0('0xc2')]=function(_0xcb86ba,_0x584acd){var _0x17cd9e=_0xcb86ba['params']['id'];var _0x35d3f5;var _0x503ad7;var _0x4ad548;return db[_0x25b0('0x44')][_0x25b0('0xc3')]({'where':{'id':_0x17cd9e}})[_0x25b0('0x16')](function(_0x4539bf){_0x35d3f5=_0x4539bf;return db['ChatWebsite'][_0x25b0('0xc3')]({'where':{'id':_0x4539bf['ChatWebsiteId']},'attributes':['id',_0x25b0('0xc4'),_0x25b0('0xc5'),_0x25b0('0xc6'),_0x25b0('0xc7'),_0x25b0('0xc8')],'raw':!![]});})[_0x25b0('0x16')](function(_0x210e42){if(_0x210e42&&_0x210e42[_0x25b0('0xc4')]&&_0x210e42[_0x25b0('0xc5')]){_0x503ad7=_0x210e42;var _0x4bf695={'interaction':{'id':_0x17cd9e},'agent':{'id':_0xcb86ba[_0x25b0('0x9b')]['id'],'name':_0xcb86ba[_0x25b0('0x9b')][_0x25b0('0x2b')],'fullname':_0xcb86ba[_0x25b0('0x9b')][_0x25b0('0x35')],'email':_0xcb86ba[_0x25b0('0x9b')][_0x25b0('0xc9')]},'contact':_0xcb86ba[_0x25b0('0x2e')][_0x25b0('0x2f')],'account':_0xcb86ba['body']['account']};var _0x3fc765={'rejectUnauthorized':![],'method':_0x25b0('0xca'),'url':_0x25b0('0xcb'),'headers':{'X-APIKEY':_0x210e42[_0x25b0('0xc4')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0xcb86ba[_0x25b0('0x9b')][_0x25b0('0xc9')]],'buttons':null,'topic':_0x503ad7[_0x25b0('0xc6')],'note':_[_0x25b0('0xcc')](_0x503ad7[_0x25b0('0xc7')])?null:getMustacheRender(_0x503ad7[_0x25b0('0xc7')],_0x4bf695),'metadata':null},'redirect':_0x25b0('0xcd'),'json':!![]};try{if(!_['isNull'](_0x503ad7[_0x25b0('0xc8')])){var _0xecf0f6=getMustacheRender(_0x503ad7[_0x25b0('0xc8')],_0x4bf695);var _0x4db8a4=JSON[_0x25b0('0x84')](_0xecf0f6);_0x3fc765[_0x25b0('0x2e')][_0x25b0('0xce')]=_0x4db8a4;}}catch(_0x48c6d1){throw new db[(_0x25b0('0x91'))][(_0x25b0('0xcf'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x3fc765);}else{throw new db[(_0x25b0('0x91'))][(_0x25b0('0xcf'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x25b0('0x16')](function(_0x26b8f6){_0x4ad548=_0x26b8f6;if(_0x4ad548['id']){var _0x14fa4d={'body':_0x4ad548[_0x25b0('0xd0')],'ChatWebsiteId':_0x503ad7['id'],'ChatInteractionId':_0x35d3f5['id'],'direction':'out','UserId':_0xcb86ba[_0x25b0('0x9b')]['id']};return db[_0x25b0('0xd1')][_0x25b0('0xbe')](_0x14fa4d,{});}else{throw new db[(_0x25b0('0x91'))][(_0x25b0('0xcf'))](_0x25b0('0xd2'));}})[_0x25b0('0x16')](function(){return _0x35d3f5[_0x25b0('0xd3')]({'vidaooSessionId':_0x4ad548['id']});})[_0x25b0('0x16')](respondWithResult(_0x584acd,null))[_0x25b0('0x1e')](handleError(_0x584acd,null));};exports['customUpdate']=function(_0x547f76,_0x3a2bed){if(_0x547f76['body']['id']){delete _0x547f76[_0x25b0('0x2e')]['id'];}return db[_0x25b0('0x44')][_0x25b0('0x6b')]({'where':{'id':_0x547f76[_0x25b0('0xbf')]['id']},'include':[{'model':db['CmContact'],'as':_0x25b0('0x6f')}]})[_0x25b0('0x16')](handleEntityNotFound(_0x3a2bed,null))['then'](saveUpdates(_0x547f76[_0x25b0('0x2e')],null))[_0x25b0('0x16')](respondWithResult(_0x3a2bed,null))[_0x25b0('0x1e')](handleError(_0x3a2bed,null));};exports[_0x25b0('0xd4')]=function(_0x2a06ab,_0x3c0cec){if(_0x2a06ab[_0x25b0('0x2e')]['id']){delete _0x2a06ab[_0x25b0('0x2e')]['id'];}return db[_0x25b0('0x44')]['find']({'where':{'id':_0x2a06ab[_0x25b0('0xbf')]['id']}})[_0x25b0('0x16')](function(_0x5f4940){if(!_0x5f4940){logger[_0x25b0('0x1a')](_0x25b0('0xd5'),_0x25b0('0xd4'),0x194,_0x25b0('0xd6'));_0x3c0cec[_0x25b0('0x29')](0x194);}else{if(_0x5f4940[_0x25b0('0x3f')]){throw new db[(_0x25b0('0x91'))][(_0x25b0('0xcf'))]('Interaction\x20already\x20assigned');}}return _0x5f4940;})[_0x25b0('0x16')](function(_0x197800){if(_0x197800){return _0x197800[_0x25b0('0x28')]({'closed':_0x2a06ab[_0x25b0('0x2e')]['closed'],'disposition':_0x2a06ab[_0x25b0('0x2e')][_0x25b0('0x42')]})[_0x25b0('0x16')](function(_0x2b85ee){return _0x2b85ee;});}})[_0x25b0('0x16')](function(){return respondWithRpcPromise(_0x25b0('0xd7'),_0x25b0('0xd4'),_0x2a06ab[_0x25b0('0x2e')],client9004);})['then'](respondWithResult(_0x3c0cec,null))[_0x25b0('0x1e')](handleError(_0x3c0cec,null));};exports['attachmentUpload']=function(_0x410b30,_0x1b7969){_0x410b30['body']['name']=_0x410b30[_0x25b0('0xd8')]['originalname'];_0x410b30[_0x25b0('0x2e')][_0x25b0('0xd9')]=_0x410b30[_0x25b0('0xd8')][_0x25b0('0xda')];_0x410b30['body'][_0x25b0('0x46')]=_0x410b30[_0x25b0('0xd8')][_0x25b0('0xdb')];return db[_0x25b0('0xdc')][_0x25b0('0xbe')](_0x410b30['body'])[_0x25b0('0x16')](respondWithResult(_0x1b7969,0xc9))[_0x25b0('0x1e')](handleError(_0x1b7969,null));};exports[_0x25b0('0xdd')]=function(_0x395766,_0x143814){return db[_0x25b0('0x44')]['findOne']({'where':{'id':_0x395766['params']['id']},'raw':!![]})[_0x25b0('0x16')](handleEntityNotFound(_0x143814,null))[_0x25b0('0x16')](function(_0x3faa59){if(_0x3faa59){if(_0x3faa59['closed']){return _0x143814[_0x25b0('0x1f')](0x193)[_0x25b0('0x21')]({'status':0x193,'message':_0x25b0('0xde')});}return db[_0x25b0('0xdc')][_0x25b0('0xc3')]({'where':{'id':_0x395766['query'][_0x25b0('0xdf')]},'raw':!![]})[_0x25b0('0x16')](handleEntityNotFound(_0x143814,null));}})[_0x25b0('0x16')](function(_0x5bce7e){if(_0x5bce7e){var _0x2de633=_0x5bce7e[_0x25b0('0xe0')]!==null;var _0x1a2303=path['join'](config[_0x25b0('0xe1')],'server/files/attachments/');if(_0x2de633){_0x1a2303=path[_0x25b0('0xe2')](_0x1a2303,'offline-chat/');}var _0xa3304d=path[_0x25b0('0xe2')](_0x1a2303,_0x5bce7e[_0x25b0('0xd9')]);return _0x143814[_0x25b0('0xe3')](_0xa3304d);}})['catch'](handleError(_0x143814,null));};exports['close']=function(_0x2b89e2,_0x2fefe3){var _0x45e535=null;var _0x4a2977=null;var _0x4b2667=null;if(_0x2b89e2[_0x25b0('0x2e')]['id']){delete _0x2b89e2['body']['id'];}if(_0x2b89e2[_0x25b0('0x2e')]['mailTranscript']){_0x4b2667=path[_0x25b0('0xe2')](config[_0x25b0('0xe1')],'server/files/chat/upload/',util[_0x25b0('0xe4')](_0x25b0('0xe5'),Date[_0x25b0('0xe6')]()));_0x2b89e2['body']['pathTranscript']=_0x4b2667;}return db[_0x25b0('0x44')]['find']({'where':{'id':_0x2b89e2['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0x25b0('0xe7'),'include':[{'model':db[_0x25b0('0xe8')],'as':_0x25b0('0xe8')}]}]})[_0x25b0('0x16')](handleEntityNotFound(_0x2fefe3,null))[_0x25b0('0x16')](saveUpdates(_0x2b89e2[_0x25b0('0x2e')],null))['then'](function(_0x56d12a){if(_0x56d12a){_0x45e535=_0x56d12a;return db[_0x25b0('0xe9')]['find']({'where':{'id':_0x45e535[_0x25b0('0x80')]}});}})[_0x25b0('0x16')](function(_0x3425e1){if(_0x3425e1){_0x4a2977=_0x3425e1;return db[_0x25b0('0xea')][_0x25b0('0x6b')]({'where':{'id':_0x45e535['ContactId']}});}})['then'](function(_0x1c3e46){if(_0x1c3e46){if(_0x4b2667){var _0x1a0041=null;for(var _0x1778d5=0x1;_0x1778d5<_0x45e535[_0x25b0('0xe7')][_0x25b0('0x4f')];++_0x1778d5){_0x1a0041=_0x45e535[_0x25b0('0xe7')][_0x1778d5];var _0x413d9f=_0x1a0041[_0x25b0('0x3f')]?util[_0x25b0('0xe4')]('%s%d',_0x4a2977[_0x25b0('0xeb')],_0x1a0041['UserId']):_0x25b0('0xec');var _0x464671=_0x2b89e2[_0x25b0('0x2e')]['customer']||util['format'](_0x25b0('0xed'),_0x25b0('0xee'),_0x1a0041['ContactId']);switch(_0x4a2977['agentIdentifier']){case _0x25b0('0xef'):_0x413d9f=_0x1a0041['UserId']?util[_0x25b0('0xe4')]('%s%d',_0x4a2977['agentAlias'],_0x1a0041[_0x25b0('0x3f')]):'System';break;case'agent_alias':_0x413d9f=_0x1a0041[_0x25b0('0x3f')]?_0x1a0041[_0x25b0('0xe8')][_0x25b0('0xf0')]||_0x1a0041[_0x25b0('0xe8')][_0x25b0('0x35')]:_0x25b0('0xec');break;case'agent_fullname':_0x413d9f=_0x1a0041['UserId']?_0x1a0041[_0x25b0('0xe8')][_0x25b0('0x35')]:_0x25b0('0xec');break;default:_0x413d9f=_0x1a0041[_0x25b0('0x3f')]?util[_0x25b0('0xe4')]('%s%d',_0x4a2977['agentAlias'],_0x1a0041[_0x25b0('0x3f')]):_0x25b0('0xec');}var _0x3421d0=util[_0x25b0('0xe4')](_0x25b0('0xf1'),moment(_0x1a0041[_0x25b0('0x83')])['format'](_0x25b0('0xf2')),_0x1a0041['direction']==='in'?_0x464671:_0x413d9f,_0x1a0041[_0x25b0('0x2e')]);if(!_0x1a0041[_0x25b0('0xf3')]){fs[_0x25b0('0xf4')](_0x4b2667,_0x3421d0);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x25b0('0xf5'),'raw':!![],'include':[{'model':db[_0x25b0('0xf6')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x25b0('0x16')](function(_0x49456a){if(!_0x49456a||!_0x49456a[_0x25b0('0xf5')]||!_0x2b89e2[_0x25b0('0x2e')])return _0x45e535;var _0x1fcb61=_0x49456a[_0x25b0('0xf7')]();return respondWithRpcPromise(_0x25b0('0xf8'),_0x25b0('0xf9'),{'account':_0x1fcb61,'message':{'from':util[_0x25b0('0xe4')]('\x22%s\x22\x20<%s>',_0x49456a[_0x25b0('0x2b')],_0x49456a[_0x25b0('0xc9')]||_0x49456a['Smtp'][_0x25b0('0x9b')]),'to':_0x2b89e2['body'][_0x25b0('0xfa')],'subject':_0x25b0('0xfb'),'text':util[_0x25b0('0xe4')](_0x25b0('0xfc'),_0x2b89e2['body']['mailTranscript']),'attachments':[{'path':_0x4b2667}]}})[_0x25b0('0x16')](function(){return _0x45e535;})[_0x25b0('0x1e')](function(_0x47f740){logger[_0x25b0('0x1a')](_0x47f740);});})['then'](respondWithStatusCode(_0x2fefe3,0xc8))[_0x25b0('0x1e')](handleError(_0x2fefe3,null));};exports[_0x25b0('0xfd')]=function(_0x1727e8,_0x42c085){return db[_0x25b0('0xd1')]['find']({'where':{'id':_0x1727e8['params']['id']}})[_0x25b0('0x16')](handleEntityNotFound(_0x42c085,null))[_0x25b0('0x16')](function(_0x539c7d){if(_0x539c7d){return _0x539c7d[_0x25b0('0xfd')](_0x1727e8['body']['ids'],_[_0x25b0('0xfe')](_0x1727e8[_0x25b0('0x2e')],['ids','id'])||{});}})[_0x25b0('0x16')](respondWithResult(_0x42c085,null))[_0x25b0('0x1e')](handleError(_0x42c085,null));};exports[_0x25b0('0xff')]=function(_0x3a4a59,_0x5567c9){var _0x200edc={'raw':![],'where':{}};var _0x4975f4={};var _0x24f13f={'count':0x0,'rows':[]};return db[_0x25b0('0x44')][_0x25b0('0xc3')]({'where':{'id':_0x3a4a59[_0x25b0('0xbf')]['id']}})[_0x25b0('0x16')](handleEntityNotFound(_0x5567c9,null))[_0x25b0('0x16')](function(_0x3d5609){if(_0x3d5609){_0x4975f4[_0x25b0('0x48')]=_[_0x25b0('0x4a')](db[_0x25b0('0xd1')][_0x25b0('0xba')]);_0x4975f4[_0x25b0('0x49')]=_[_0x25b0('0x4a')](_0x3a4a59[_0x25b0('0x49')]);_0x4975f4[_0x25b0('0x4b')]=_[_0x25b0('0x4c')](_0x4975f4[_0x25b0('0x48')],_0x4975f4[_0x25b0('0x49')]);_0x200edc[_0x25b0('0x4d')]=_['intersection'](_0x4975f4[_0x25b0('0x48')],qs['fields'](_0x3a4a59[_0x25b0('0x49')]['fields']));_0x200edc['attributes']=_0x200edc[_0x25b0('0x4d')][_0x25b0('0x4f')]?_0x200edc['attributes']:_0x4975f4[_0x25b0('0x48')];if(!_0x3a4a59['query'][_0x25b0('0x100')](_0x25b0('0x50'))){_0x200edc['limit']=qs['limit'](_0x3a4a59[_0x25b0('0x49')]['limit']);_0x200edc[_0x25b0('0x22')]=qs['offset'](_0x3a4a59[_0x25b0('0x49')][_0x25b0('0x22')]);}_0x200edc['order']=qs[_0x25b0('0x101')](_0x3a4a59[_0x25b0('0x49')][_0x25b0('0x101')]);_0x200edc[_0x25b0('0x52')]=qs[_0x25b0('0x4b')](_[_0x25b0('0x53')](_0x3a4a59[_0x25b0('0x49')],_0x4975f4[_0x25b0('0x4b')]));_0x200edc[_0x25b0('0x52')][_0x25b0('0x102')]=_0x3d5609['id'];if(_0x3a4a59[_0x25b0('0x49')]['filter']){_0x200edc[_0x25b0('0x52')]=_['merge'](_0x200edc[_0x25b0('0x52')],{'$or':_['map'](_0x200edc['attributes'],function(_0x3144ca){var _0x37cef6={};_0x37cef6[_0x3144ca]={'$like':'%'+_0x3a4a59[_0x25b0('0x49')][_0x25b0('0x8d')]+'%'};return _0x37cef6;})});}if(_0x3a4a59[_0x25b0('0x49')][_0x25b0('0x85')]){var _0x5429f8=_0x3a4a59[_0x25b0('0x49')][_0x25b0('0x85')]['split'](',');var _0x350f71={};_0x350f71[_0x5429f8[0x0]]={'$gte':moment(_0x5429f8[0x1])[_0x25b0('0xe4')](_0x25b0('0x103'))};_0x200edc['where']=_[_0x25b0('0x2d')](_0x200edc[_0x25b0('0x52')],_0x350f71);}_0x200edc=_['merge']({},_0x200edc,_0x3a4a59[_0x25b0('0xbd')]);return db['ChatMessage'][_0x25b0('0x25')]({'where':_0x200edc[_0x25b0('0x52')]})[_0x25b0('0x16')](function(_0x1011bf){_0x24f13f[_0x25b0('0x25')]=_0x1011bf;if(_0x3a4a59[_0x25b0('0x49')][_0x25b0('0xbb')]){_0x200edc[_0x25b0('0xbc')]=[{'all':!![]}];}return db['ChatMessage'][_0x25b0('0x104')](_0x200edc);})['then'](function(_0x4281a5){_0x24f13f[_0x25b0('0xb8')]=_0x4281a5;return _0x24f13f;});}})['then'](respondWithFilteredResult(_0x5567c9,_0x200edc))['catch'](handleError(_0x5567c9,null));};exports[_0x25b0('0x105')]=function(_0x169ce2,_0x6e2707){var _0x2fd32f={'where':{}},_0x23343a={},_0x5e8e3a={'count':0x0,'rows':[]};return db[_0x25b0('0x44')][_0x25b0('0xc3')]({'where':{'id':_0x169ce2['params']['id']}})[_0x25b0('0x16')](handleEntityNotFound(_0x6e2707,null))['then'](function(_0x1a5f25){if(_0x1a5f25){_0x23343a[_0x25b0('0x48')]=_[_0x25b0('0x4a')](db[_0x25b0('0xd1')][_0x25b0('0xba')]);_0x23343a[_0x25b0('0x49')]=_[_0x25b0('0x4a')](_0x169ce2[_0x25b0('0x49')]);_0x23343a[_0x25b0('0x4b')]=_[_0x25b0('0x4c')](_0x23343a[_0x25b0('0x48')],_0x23343a[_0x25b0('0x49')]);_0x2fd32f[_0x25b0('0x4d')]=_['intersection'](_0x23343a[_0x25b0('0x48')],qs['fields'](_0x169ce2[_0x25b0('0x49')][_0x25b0('0x4e')]));_0x2fd32f[_0x25b0('0x4d')]=_0x2fd32f[_0x25b0('0x4d')]['length']?_0x2fd32f[_0x25b0('0x4d')]:_0x23343a[_0x25b0('0x48')];if(!_0x169ce2[_0x25b0('0x49')][_0x25b0('0x100')](_0x25b0('0x50'))){_0x2fd32f['limit']=qs[_0x25b0('0x24')](_0x169ce2[_0x25b0('0x49')][_0x25b0('0x24')]);_0x2fd32f['offset']=qs[_0x25b0('0x22')](_0x169ce2[_0x25b0('0x49')][_0x25b0('0x22')]);}_0x2fd32f['order']=qs[_0x25b0('0x101')](_0x169ce2['query'][_0x25b0('0x101')]);_0x2fd32f[_0x25b0('0x52')]=qs[_0x25b0('0x4b')](_[_0x25b0('0x53')](_0x169ce2[_0x25b0('0x49')],_0x23343a[_0x25b0('0x4b')]));_0x2fd32f[_0x25b0('0x52')]['ChatInteractionId']=_0x1a5f25['id'];if(_0x169ce2[_0x25b0('0x49')][_0x25b0('0x8d')]){_0x2fd32f[_0x25b0('0x52')]=_[_0x25b0('0x2d')](_0x2fd32f['where'],{'$or':_[_0x25b0('0x34')](_0x2fd32f[_0x25b0('0x4d')],function(_0x14252c){var _0x578a4c={};_0x578a4c[_0x14252c]={'$like':'%'+_0x169ce2[_0x25b0('0x49')][_0x25b0('0x8d')]+'%'};return _0x578a4c;})});}_0x2fd32f[_0x25b0('0x52')]['secret']=![];if(_0x169ce2[_0x25b0('0x49')]['id']){_0x2fd32f['where']['id']={'$gt':_0x169ce2[_0x25b0('0x49')]['id']};}_0x2fd32f=_[_0x25b0('0x2d')]({},_0x2fd32f,_0x169ce2['options']);return db[_0x25b0('0xd1')][_0x25b0('0x25')]({'where':_0x2fd32f[_0x25b0('0x52')]})[_0x25b0('0x16')](function(_0x2af676){_0x5e8e3a[_0x25b0('0x25')]=_0x2af676;_0x2fd32f[_0x25b0('0xbc')]=[];if(_0x169ce2[_0x25b0('0x49')][_0x25b0('0x106')]){_0x2fd32f[_0x25b0('0xbc')][_0x25b0('0x39')]({'model':db[_0x25b0('0xe8')],'as':_0x25b0('0xe8'),'attributes':['id',_0x25b0('0x35'),_0x25b0('0xf0')]});}if(_0x169ce2[_0x25b0('0x49')][_0x25b0('0xbb')]){_0x2fd32f[_0x25b0('0xbc')]=[{'all':!![]}];}return db['ChatMessage'][_0x25b0('0x104')](_0x2fd32f);})[_0x25b0('0x16')](function(_0x450cdb){_0x5e8e3a[_0x25b0('0xb8')]=_0x450cdb;return _0x5e8e3a;});}})[_0x25b0('0x16')](respondWithFilteredResult(_0x6e2707,_0x2fd32f))[_0x25b0('0x1e')](handleError(_0x6e2707,null));};exports[_0x25b0('0x107')]=function(_0x43a5fc,_0x23e93c){return db[_0x25b0('0x44')]['find']({'where':{'id':_0x43a5fc[_0x25b0('0xbf')]['id']}})[_0x25b0('0x16')](handleEntityNotFound(_0x23e93c,null))[_0x25b0('0x16')](function(_0x5a96da){if(_0x5a96da){return _0x5a96da[_0x25b0('0x108')](_0x43a5fc[_0x25b0('0x2e')][_0x25b0('0x109')],_[_0x25b0('0xfe')](_0x43a5fc[_0x25b0('0x2e')],['ids','id'])||{})[_0x25b0('0x10a')](function(){return db['Tag']['findAll']({'attributes':['id',_0x25b0('0x2b'),'color'],'where':{'id':_0x43a5fc[_0x25b0('0x2e')]['ids']}});})[_0x25b0('0x16')](function(_0x4953c5){socket[_0x25b0('0x10b')](_0x25b0('0x10c'),{'id':Number(_0x43a5fc[_0x25b0('0xbf')]['id']),'tags':_0x4953c5||[]});return{'id':Number(_0x43a5fc[_0x25b0('0xbf')]['id']),'tags':_0x4953c5||[]};});}})[_0x25b0('0x16')](respondWithResult(_0x23e93c,null))[_0x25b0('0x1e')](handleError(_0x23e93c,null));};exports['removeTags']=function(_0x4c3b11,_0x3429be){return db[_0x25b0('0x44')]['find']({'where':{'id':_0x4c3b11['params']['id']}})[_0x25b0('0x16')](handleEntityNotFound(_0x3429be,null))[_0x25b0('0x16')](function(_0x3b81ec){if(_0x3b81ec){return _0x3b81ec[_0x25b0('0x10d')](_0x4c3b11['query'][_0x25b0('0x109')]);}})[_0x25b0('0x16')](respondWithStatusCode(_0x3429be,null))[_0x25b0('0x1e')](handleError(_0x3429be,null));};exports['download']=function(_0x1748a6,_0x7c474f){var _0xaf5ba4=moment()[_0x25b0('0x10e')]()['toString']();var _0x5ab8b3=path[_0x25b0('0xe2')](config[_0x25b0('0xe1')],'server','files',_0x25b0('0x10f'));var _0x4e40af=path['join'](config[_0x25b0('0xe1')],_0x25b0('0x110'),'files',_0x25b0('0x111'));var _0xa8f0f0=path[_0x25b0('0xe2')](_0x5ab8b3,_0xaf5ba4);var _0xd1a53b=util[_0x25b0('0xe4')](_0x25b0('0x112'),_0x1748a6[_0x25b0('0xbf')]['id'],_0xaf5ba4);var _0x48fb2e=path['join'](_0x5ab8b3,_0xd1a53b);var _0x37990b=[];_0x37990b[_0x25b0('0x39')]({'model':db[_0x25b0('0xe8')],'as':_0x25b0('0xe8'),'attributes':['id',_0x25b0('0x35')],'raw':!![]});_0x37990b[_0x25b0('0x39')]({'model':db['CmContact'],'as':_0x25b0('0x6f'),'attributes':['id',_0x25b0('0x113'),_0x25b0('0x114')],'raw':!![]});if(_0x1748a6[_0x25b0('0x49')][_0x25b0('0x111')]){_0x37990b[_0x25b0('0x39')]({'model':db[_0x25b0('0xdc')],'as':_0x25b0('0xdc'),'raw':!![]});}var _0x29056f=[{'model':db[_0x25b0('0xd1')],'as':'Messages','attributes':['id',_0x25b0('0x2e'),'createdAt',_0x25b0('0x115'),_0x25b0('0xf3'),_0x25b0('0x8a')],'include':_0x37990b}];_0x29056f[_0x25b0('0x39')]({'model':db[_0x25b0('0xe9')],'as':_0x25b0('0x116'),'attributes':['id',_0x25b0('0x2b')]});_0x29056f[_0x25b0('0x39')]({'model':db[_0x25b0('0xe8')],'as':_0x25b0('0x117'),'attributes':['id',_0x25b0('0x35')]});return db['ChatInteraction']['find']({'where':{'id':_0x1748a6[_0x25b0('0xbf')]['id']},'include':_0x29056f})[_0x25b0('0x16')](handleEntityNotFound(_0x7c474f,null))['then'](function(_0x2943a9){if(_0x2943a9){var _0xa6bfaa=_0x2943a9[_0x25b0('0x118')]({'plain':!![]});fs[_0x25b0('0x119')](_0xa8f0f0);var _0x511ee9={'channel':_0x25b0('0x11a'),'account':_0xa6bfaa[_0x25b0('0x116')][_0x25b0('0x2b')],'agent':_0xa6bfaa['Owner']?_0xa6bfaa[_0x25b0('0x117')][_0x25b0('0x35')]:_0x25b0('0x11b'),'createdAt':moment(_0xa6bfaa[_0x25b0('0x83')])[_0x25b0('0xe4')]('YYYY-MM-DD\x20HH:mm:ss')[_0x25b0('0x9f')](),'closedAt':_0xa6bfaa['closed']?moment(_0xa6bfaa['closedAt'])[_0x25b0('0xe4')](_0x25b0('0x103'))[_0x25b0('0x9f')]():'','disposition':_0xa6bfaa[_0x25b0('0x42')],'chatInfo':{'browser':_0xa6bfaa[_0x25b0('0x11c')],'os':_0xa6bfaa['osName'],'referer':_0xa6bfaa[_0x25b0('0x11d')],'customerIp':_0xa6bfaa[_0x25b0('0x11e')],'customerPort':_0xa6bfaa[_0x25b0('0x11f')]?_0xa6bfaa[_0x25b0('0x11f')]:_0x25b0('0x11b')},'messages':_(_0xa6bfaa[_0x25b0('0xe7')])[_0x25b0('0x120')]()['filter']({'secret':![]})[_0x25b0('0x34')](function(_0x23edf3){if(_0x23edf3['Attachment']){var _0x67d139=path[_0x25b0('0xe2')](_0x4e40af,_0x23edf3[_0x25b0('0xdc')][_0x25b0('0xd9')]);if(fs[_0x25b0('0x121')](_0x67d139)){fs['createReadStream'](_0x67d139)['pipe'](fs[_0x25b0('0x122')](path[_0x25b0('0xe2')](_0xa8f0f0,_0x23edf3[_0x25b0('0xdc')][_0x25b0('0xd9')])));}}return{'date':moment(_0x23edf3['createdAt'])['format'](_0x25b0('0x103'))[_0x25b0('0x9f')](),'sender':_0x23edf3[_0x25b0('0x115')]===_0x25b0('0x123')?_0x23edf3['User']?_0x23edf3[_0x25b0('0xe8')][_0x25b0('0x35')]:_0x25b0('0xec'):_0x23edf3[_0x25b0('0x6f')]['firstName']+(_0x23edf3[_0x25b0('0x6f')][_0x25b0('0x114')]?'\x20'+_0x23edf3[_0x25b0('0x6f')][_0x25b0('0x114')]:''),'body':_0x23edf3[_0x25b0('0xdc')]?_0x23edf3[_0x25b0('0xdc')][_0x25b0('0xd9')]:_0x23edf3['body'],'direction':_0x23edf3[_0x25b0('0x115')]===_0x25b0('0x123')?'A':'C','secret':_0x23edf3['secret'],'read':_0x23edf3['read'],'attachment':_0x23edf3['Attachment']};})[_0x25b0('0x71')]()};return ejs[_0x25b0('0x124')](path[_0x25b0('0xe2')](config['root'],_0x25b0('0x110'),'views','downloadInteraction.ejs'),{'interaction':_0x511ee9})['then'](function(_0xaee691){var _0x2848df=path[_0x25b0('0xe2')](_0xa8f0f0,_0x25b0('0x125')+_0xa6bfaa['id']+'-'+_0xaf5ba4+_0x25b0('0x126'));var _0x90f7cd={'path':_0x2848df,'channel':_0x25b0('0x11a'),'interactionId':_0xa6bfaa['id']};return pdf[_0x25b0('0x127')](_0xaee691,_0x90f7cd);})['then'](function(){return new Promise(function(_0x2bf536,_0xa177ce){zipdir(_0xa8f0f0,{'saveTo':_0x48fb2e},function(_0x69cfe4,_0x435e3e){if(_0x69cfe4)return _0xa177ce(_0x69cfe4);return _0x2bf536(_0x435e3e);});})[_0x25b0('0x16')](function(){return new BPromise(function(_0x3c3409,_0x133c12){rimraf(_0xa8f0f0,function(_0x4c2e1b){if(_0x4c2e1b)_0x133c12(_0x4c2e1b);return _0x3c3409();});});})[_0x25b0('0x16')](function(){return _0x7c474f[_0x25b0('0xe3')](_0x48fb2e,_0xd1a53b,function(_0x22339b){if(_0x22339b){logger[_0x25b0('0x1a')](_0x25b0('0x128'),_0x22339b);}else{fs[_0x25b0('0x129')](_0x48fb2e);}});});});}else{return _0x7c474f[_0x25b0('0x29')](0xc8);}})[_0x25b0('0x1e')](handleError(_0x7c474f,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 7a9daac..a063362 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 _0xb35b=['save','update','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners'];(function(_0x4e10c9,_0x327a63){var _0x587f22=function(_0x16b50a){while(--_0x16b50a){_0x4e10c9['push'](_0x4e10c9['shift']());}};_0x587f22(++_0x327a63);}(_0xb35b,0x164));var _0xbb35=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xb35b[_0x21aec3];return _0x288bbc;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xbb35('0x0'))['db'][_0xbb35('0x1')];var ChatMessage=require(_0xbb35('0x0'))['db'][_0xbb35('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xbb35('0x3')](0x0);var events={'afterCreate':_0xbb35('0x4'),'afterUpdate':_0xbb35('0x5'),'afterDestroy':'remove'};function emitEvent(_0x12ed26){return function(_0xb3e402,_0x3bb2c7,_0x158201){_0xb3e402[_0xbb35('0x6')]({'attributes':['id'],'raw':!![]})[_0xbb35('0x7')](function(_0x5b304b){_0xb3e402[_0xbb35('0x8')]('Users',_0x5b304b[_0xbb35('0x9')](function(_0x383f12){return{'id':_0x383f12['id']};}));return ChatMessage[_0xbb35('0xa')]({'where':{'ChatInteractionId':_0xb3e402['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbb35('0x7')](function(_0x4f1bdd){_0xb3e402[_0xbb35('0x8')](_0xbb35('0xb'),_0x4f1bdd[_0xbb35('0xc')]);ChatInteractionEvents[_0xbb35('0xd')](_0x12ed26+':'+_0xb3e402['id'],_0xb3e402);ChatInteractionEvents['emit'](_0x12ed26,_0xb3e402);_0x158201(null);})[_0xbb35('0xe')](_0x158201(null));};}for(var e in events){if(events[_0xbb35('0xf')](e)){var event=events[e];ChatInteraction[_0xbb35('0x10')](e,emitEvent(event));}}module[_0xbb35('0x11')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x9102=['map','findAll','unreadMessages','length','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove','getUsers','then','setDataValue'];(function(_0x3cd216,_0x55d550){var _0x182cfb=function(_0x371368){while(--_0x371368){_0x3cd216['push'](_0x3cd216['shift']());}};_0x182cfb(++_0x55d550);}(_0x9102,0x1a6));var _0x2910=function(_0x37a79c,_0x2b19f0){_0x37a79c=_0x37a79c-0x0;var _0x561d89=_0x9102[_0x37a79c];return _0x561d89;};'use strict';var EventEmitter=require(_0x2910('0x0'));var ChatInteraction=require(_0x2910('0x1'))['db'][_0x2910('0x2')];var ChatMessage=require(_0x2910('0x1'))['db'][_0x2910('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x2910('0x4')](0x0);var events={'afterCreate':_0x2910('0x5'),'afterUpdate':'update','afterDestroy':_0x2910('0x6')};function emitEvent(_0x331c43){return function(_0x2cba50,_0x4f35e5,_0x97fbbc){_0x2cba50[_0x2910('0x7')]({'attributes':['id'],'raw':!![]})[_0x2910('0x8')](function(_0x229cb3){_0x2cba50[_0x2910('0x9')]('Users',_0x229cb3[_0x2910('0xa')](function(_0x4b0891){return{'id':_0x4b0891['id']};}));return ChatMessage[_0x2910('0xb')]({'where':{'ChatInteractionId':_0x2cba50['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2910('0x8')](function(_0x35ee5f){_0x2cba50[_0x2910('0x9')](_0x2910('0xc'),_0x35ee5f[_0x2910('0xd')]);ChatInteractionEvents['emit'](_0x331c43+':'+_0x2cba50['id'],_0x2cba50);ChatInteractionEvents['emit'](_0x331c43,_0x2cba50);_0x97fbbc(null);})[_0x2910('0xe')](_0x97fbbc(null));};}for(var e in events){if(events[_0x2910('0xf')](e)){var event=events[e];ChatInteraction[_0x2910('0x10')](e,emitEvent(event));}}module[_0x2910('0x11')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 73fc836..8843ec8 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 _0x2b2c=['changed','closed','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions'];(function(_0x2cfc8e,_0x46fc38){var _0x25cd3a=function(_0x159022){while(--_0x159022){_0x2cfc8e['push'](_0x2cfc8e['shift']());}};_0x25cd3a(++_0x46fc38);}(_0x2b2c,0x95));var _0xc2b2=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x2b2c[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xc2b2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc2b2('0x1'));var moment=require('moment');var BPromise=require(_0xc2b2('0x2'));var rp=require(_0xc2b2('0x3'));var fs=require('fs');var path=require(_0xc2b2('0x4'));var rimraf=require('rimraf');var config=require(_0xc2b2('0x5'));var attributes=require(_0xc2b2('0x6'));module[_0xc2b2('0x7')]=function(_0x18bd55,_0x3bd1ac){return _0x18bd55[_0xc2b2('0x8')](_0xc2b2('0x9'),attributes,{'tableName':_0xc2b2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x20ad08,_0x31205e,_0x38bcde){if(_0x20ad08[_0xc2b2('0xb')](_0xc2b2('0xc'))){_0x20ad08['closedAt']=moment()['format'](_0xc2b2('0xd'));}_0x38bcde(null,_0x20ad08);}},'charset':_0xc2b2('0xe'),'collate':_0xc2b2('0xf')});};
\ No newline at end of file
+var _0x1522=['rimraf','../../config/environment','exports','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x22b4df,_0x2971f3){var _0xb778a6=function(_0x355607){while(--_0x355607){_0x22b4df['push'](_0x22b4df['shift']());}};_0xb778a6(++_0x2971f3);}(_0x1522,0x16f));var _0x2152=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1522[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2152('0x0'));var util=require(_0x2152('0x1'));var logger=require(_0x2152('0x2'))(_0x2152('0x3'));var moment=require('moment');var BPromise=require(_0x2152('0x4'));var rp=require(_0x2152('0x5'));var fs=require('fs');var path=require(_0x2152('0x6'));var rimraf=require(_0x2152('0x7'));var config=require(_0x2152('0x8'));var attributes=require('./chatInteraction.attributes');module[_0x2152('0x9')]=function(_0x2a47b1,_0x6fd713){return _0x2a47b1['define'](_0x2152('0xa'),attributes,{'tableName':_0x2152('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xcb0c3d,_0x30a614,_0x2ff6ab){if(_0xcb0c3d[_0x2152('0xc')](_0x2152('0xd'))){_0xcb0c3d[_0x2152('0xe')]=moment()[_0x2152('0xf')](_0x2152('0x10'));}_0x2ff6ab(null,_0xcb0c3d);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index d99cd69..b16b372 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 _0xb18e=['randomstring','ioredis','../../mysqldb','client','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','then','debug','AddTagsToChatInteraction','find','omit','ids','spread','AddTags','lodash','util','bluebird'];(function(_0x3f7d53,_0x334a69){var _0x280969=function(_0xdb9d43){while(--_0xdb9d43){_0x3f7d53['push'](_0x3f7d53['shift']());}};_0x280969(++_0x334a69);}(_0xb18e,0xe1));var _0xeb18=function(_0x1044e5,_0x498e01){_0x1044e5=_0x1044e5-0x0;var _0x5ad0dd=_0xb18e[_0x1044e5];return _0x5ad0dd;};'use strict';var _=require(_0xeb18('0x0'));var util=require(_0xeb18('0x1'));var moment=require('moment');var BPromise=require(_0xeb18('0x2'));var rs=require(_0xeb18('0x3'));var fs=require('fs');var Redis=require(_0xeb18('0x4'));var db=require(_0xeb18('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeb18('0x6')]['http']({'port':0x232a});config[_0xeb18('0x7')]=_[_0xeb18('0x8')](config[_0xeb18('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xeb18('0x9'))(new Redis(config['redis']));require(_0xeb18('0xa'))[_0xeb18('0xb')](socket);function respondWithRpcPromise(_0x1e9955,_0x47dfa7,_0x58d6ec){return new BPromise(function(_0x22c9ad,_0x16eca5){return client[_0xeb18('0xc')](_0x1e9955,_0x58d6ec)['then'](function(_0x22a928){logger[_0xeb18('0xd')](_0xeb18('0xe'),_0x47dfa7,_0xeb18('0xf'));logger['debug'](_0xeb18('0x10'),_0x47dfa7,_0xeb18('0xf'),JSON[_0xeb18('0x11')](_0x22a928));if(_0x22a928[_0xeb18('0x12')]){if(_0x22a928[_0xeb18('0x12')]['code']===0x1f4){logger['error'](_0xeb18('0xe'),_0x47dfa7,_0x22a928[_0xeb18('0x12')]['message']);return _0x16eca5(_0x22a928['error'][_0xeb18('0x13')]);}logger['error'](_0xeb18('0xe'),_0x47dfa7,_0x22a928['error']['message']);return _0x22c9ad(_0x22a928['error'][_0xeb18('0x13')]);}else{logger[_0xeb18('0xd')](_0xeb18('0xe'),_0x47dfa7,_0xeb18('0xf'));_0x22c9ad(_0x22a928[_0xeb18('0x14')][_0xeb18('0x13')]);}})[_0xeb18('0x15')](function(_0x4bfd61){logger[_0xeb18('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x47dfa7,_0x4bfd61);_0x16eca5(_0x4bfd61);});});}exports[_0xeb18('0x16')]=function(_0x4e161b){var _0x26f60a=this;return new Promise(function(_0x24a166,_0x4b2e2c){return db[_0xeb18('0x17')][_0xeb18('0x18')](_0x4e161b[_0xeb18('0x19')],{'raw':_0x4e161b[_0xeb18('0x1a')]?_0x4e161b[_0xeb18('0x1a')][_0xeb18('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e161b[_0xeb18('0x1a')]?_0x4e161b[_0xeb18('0x1a')][_0xeb18('0x1c')]||null:null,'attributes':_0x4e161b[_0xeb18('0x1a')]?_0x4e161b[_0xeb18('0x1a')][_0xeb18('0x1d')]||null:null,'limit':_0x4e161b[_0xeb18('0x1a')]?_0x4e161b['options']['limit']||null:null})[_0xeb18('0x1e')](function(_0x146a97){logger['info'](_0xeb18('0x16'),_0x4e161b);logger[_0xeb18('0x1f')](_0xeb18('0x16'),_0x4e161b,JSON[_0xeb18('0x11')](_0x146a97));_0x24a166(_0x146a97);})[_0xeb18('0x15')](function(_0x4b6ed3){logger[_0xeb18('0x12')]('UpdateChatInteraction',_0x4b6ed3[_0xeb18('0x13')],_0x4e161b);_0x4b2e2c(_0x26f60a[_0xeb18('0x12')](0x1f4,_0x4b6ed3[_0xeb18('0x13')]));});});};exports[_0xeb18('0x20')]=function(_0x567caa){return new Promise(function(_0x40ef23,_0x415560){return db['ChatInteraction'][_0xeb18('0x21')]({'where':_0x567caa[_0xeb18('0x1a')]?_0x567caa[_0xeb18('0x1a')][_0xeb18('0x1c')]||null:null})[_0xeb18('0x1e')](function(_0x3920d5){if(_0x3920d5){return _0x3920d5['addTags'](_0x567caa[_0xeb18('0x19')]['ids'],_[_0xeb18('0x22')](_0x567caa[_0xeb18('0x19')],[_0xeb18('0x23'),'id'])||{});}})[_0xeb18('0x24')](function(_0x4a78fe){logger[_0xeb18('0xd')](_0xeb18('0x25'),_0x567caa);logger['debug'](_0xeb18('0x25'),_0x567caa,JSON[_0xeb18('0x11')](_0x4a78fe));_0x40ef23(_0x4a78fe);})['catch'](function(_0x54e267){logger[_0xeb18('0x12')](_0xeb18('0x25'),_0x54e267[_0xeb18('0x13')],_0x567caa);_0x415560(_this[_0xeb18('0x12')](0x1f4,_0x54e267[_0xeb18('0x13')]));});});};
\ No newline at end of file
+var _0x0598=['register','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','limit','then','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket'];(function(_0x246b3e,_0x5f458e){var _0x10fb9b=function(_0x436942){while(--_0x436942){_0x246b3e['push'](_0x246b3e['shift']());}};_0x10fb9b(++_0x5f458e);}(_0x0598,0x1a8));var _0x8059=function(_0x2a9b99,_0x4daa75){_0x2a9b99=_0x2a9b99-0x0;var _0x223f0d=_0x0598[_0x2a9b99];return _0x223f0d;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var moment=require(_0x8059('0x2'));var BPromise=require(_0x8059('0x3'));var rs=require(_0x8059('0x4'));var fs=require('fs');var Redis=require(_0x8059('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8059('0x6'));var logger=require('../../config/logger')(_0x8059('0x7'));var config=require(_0x8059('0x8'));var jayson=require(_0x8059('0x9'));var client=jayson['client'][_0x8059('0xa')]({'port':0x232a});config[_0x8059('0xb')]=_[_0x8059('0xc')](config[_0x8059('0xb')],{'host':_0x8059('0xd'),'port':0x18eb});var socket=require(_0x8059('0xe'))(new Redis(config['redis']));require(_0x8059('0xf'))[_0x8059('0x10')](socket);function respondWithRpcPromise(_0x233797,_0x219ca0,_0x27e3f4){return new BPromise(function(_0x5aa846,_0x1bec6a){return client['request'](_0x233797,_0x27e3f4)['then'](function(_0x180c87){logger[_0x8059('0x11')](_0x8059('0x12'),_0x219ca0,_0x8059('0x13'));logger[_0x8059('0x14')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x219ca0,_0x8059('0x13'),JSON[_0x8059('0x15')](_0x180c87));if(_0x180c87[_0x8059('0x16')]){if(_0x180c87[_0x8059('0x16')][_0x8059('0x17')]===0x1f4){logger[_0x8059('0x16')](_0x8059('0x12'),_0x219ca0,_0x180c87[_0x8059('0x16')][_0x8059('0x18')]);return _0x1bec6a(_0x180c87[_0x8059('0x16')][_0x8059('0x18')]);}logger[_0x8059('0x16')](_0x8059('0x12'),_0x219ca0,_0x180c87[_0x8059('0x16')]['message']);return _0x5aa846(_0x180c87['error'][_0x8059('0x18')]);}else{logger[_0x8059('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x219ca0,_0x8059('0x13'));_0x5aa846(_0x180c87['result'][_0x8059('0x18')]);}})[_0x8059('0x19')](function(_0x174a1f){logger[_0x8059('0x16')](_0x8059('0x12'),_0x219ca0,_0x174a1f);_0x1bec6a(_0x174a1f);});});}exports[_0x8059('0x1a')]=function(_0x1a56ed){var _0x430da7=this;return new Promise(function(_0x4bac1c,_0x536fd8){return db[_0x8059('0x1b')][_0x8059('0x1c')](_0x1a56ed[_0x8059('0x1d')],{'raw':_0x1a56ed[_0x8059('0x1e')]?_0x1a56ed[_0x8059('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a56ed['options']?_0x1a56ed['options'][_0x8059('0x1f')]||null:null,'attributes':_0x1a56ed[_0x8059('0x1e')]?_0x1a56ed[_0x8059('0x1e')][_0x8059('0x20')]||null:null,'limit':_0x1a56ed['options']?_0x1a56ed['options'][_0x8059('0x21')]||null:null})[_0x8059('0x22')](function(_0x239998){logger[_0x8059('0x11')](_0x8059('0x1a'),_0x1a56ed);logger[_0x8059('0x14')](_0x8059('0x1a'),_0x1a56ed,JSON['stringify'](_0x239998));_0x4bac1c(_0x239998);})[_0x8059('0x19')](function(_0x4fc4af){logger[_0x8059('0x16')](_0x8059('0x1a'),_0x4fc4af['message'],_0x1a56ed);_0x536fd8(_0x430da7[_0x8059('0x16')](0x1f4,_0x4fc4af[_0x8059('0x18')]));});});};exports['AddTagsToChatInteraction']=function(_0x123fce){return new Promise(function(_0x699ee7,_0x30dedc){return db[_0x8059('0x1b')][_0x8059('0x23')]({'where':_0x123fce[_0x8059('0x1e')]?_0x123fce[_0x8059('0x1e')][_0x8059('0x1f')]||null:null})[_0x8059('0x22')](function(_0x4497e6){if(_0x4497e6){return _0x4497e6[_0x8059('0x24')](_0x123fce[_0x8059('0x1d')][_0x8059('0x25')],_['omit'](_0x123fce[_0x8059('0x1d')],[_0x8059('0x25'),'id'])||{});}})[_0x8059('0x26')](function(_0x14a09d){logger['info'](_0x8059('0x27'),_0x123fce);logger['debug'](_0x8059('0x27'),_0x123fce,JSON[_0x8059('0x15')](_0x14a09d));_0x699ee7(_0x14a09d);})[_0x8059('0x19')](function(_0xfad949){logger['error'](_0x8059('0x27'),_0xfad949[_0x8059('0x18')],_0x123fce);_0x30dedc(_this['error'](0x1f4,_0xfad949[_0x8059('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index f260b97..4bbb1ec 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 _0x5577=['chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener'];(function(_0x422bb1,_0x41eb73){var _0xfe5f30=function(_0x1314ca){while(--_0x1314ca){_0x422bb1['push'](_0x422bb1['shift']());}};_0xfe5f30(++_0x41eb73);}(_0x5577,0x120));var _0x7557=function(_0x4e944b,_0x3e910f){_0x4e944b=_0x4e944b-0x0;var _0x4eec32=_0x5577[_0x4e944b];return _0x4eec32;};'use strict';var ChatInteractionEvents=require(_0x7557('0x0'));var events=[_0x7557('0x1'),_0x7557('0x2'),_0x7557('0x3')];function createListener(_0x4dea0f,_0x33eb23){return function(_0x38def7){_0x33eb23[_0x7557('0x4')](_0x4dea0f,_0x38def7);};}function removeListener(_0x498861,_0x26a15e){return function(){ChatInteractionEvents[_0x7557('0x5')](_0x498861,_0x26a15e);};}exports['register']=function(_0x30e97c){for(var _0x2f64f0=0x0,_0x47b1ee=events['length'];_0x2f64f0<_0x47b1ee;_0x2f64f0++){var _0x41fd3e=events[_0x2f64f0];var _0x428205=createListener(_0x7557('0x6')+_0x41fd3e,_0x30e97c);ChatInteractionEvents['on'](_0x41fd3e,_0x428205);}};
\ No newline at end of file
+var _0x9eca=['./chatInteraction.events','remove','update','register','length'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x9eca,0xd2));var _0xa9ec=function(_0x259fca,_0x53360c){_0x259fca=_0x259fca-0x0;var _0x387fc5=_0x9eca[_0x259fca];return _0x387fc5;};'use strict';var ChatInteractionEvents=require(_0xa9ec('0x0'));var events=['save',_0xa9ec('0x1'),_0xa9ec('0x2')];function createListener(_0x311a3d,_0x29f64a){return function(_0x440ed3){_0x29f64a['emit'](_0x311a3d,_0x440ed3);};}function removeListener(_0x331d90,_0x49e2ae){return function(){ChatInteractionEvents['removeListener'](_0x331d90,_0x49e2ae);};}exports[_0xa9ec('0x3')]=function(_0x4f4638){for(var _0x50bea8=0x0,_0xfc1912=events[_0xa9ec('0x4')];_0x50bea8<_0xfc1912;_0x50bea8++){var _0x5da681=events[_0x50bea8];var _0x1345b9=createListener('chatInteraction:'+_0x5da681,_0x4f4638);ChatInteractionEvents['on'](_0x5da681,_0x1345b9);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 92bd4d1..6a022ce 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 _0xf45d=['addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','close','chatinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','/:id/vidaoo','diskStorage','root','format','%s-%s','replace','/:id/attachment_upload','file','attachmentUpload'];(function(_0x326086,_0x5bac35){var _0x468e45=function(_0x1de2f0){while(--_0x1de2f0){_0x326086['push'](_0x326086['shift']());}};_0x468e45(++_0x5bac35);}(_0xf45d,0x1cc));var _0xdf45=function(_0x4c1e4c,_0x5048b0){_0x4c1e4c=_0x4c1e4c-0x0;var _0xef475f=_0xf45d[_0x4c1e4c];return _0xef475f;};'use strict';var multer=require(_0xdf45('0x0'));var util=require(_0xdf45('0x1'));var path=require(_0xdf45('0x2'));var timeout=require(_0xdf45('0x3'));var express=require(_0xdf45('0x4'));var router=express[_0xdf45('0x5')]();var fs_extra=require(_0xdf45('0x6'));var auth=require(_0xdf45('0x7'));var interaction=require(_0xdf45('0x8'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0xdf45('0x9')]('/',auth[_0xdf45('0xa')](),controller['index']);router['get'](_0xdf45('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xdf45('0x9')]('/:id',auth[_0xdf45('0xc')](),controller['show']);router['get'](_0xdf45('0xd'),auth[_0xdf45('0xc')](),controller[_0xdf45('0xe')]);router[_0xdf45('0x9')](_0xdf45('0xf'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x10')]);router['get'](_0xdf45('0x11'),auth[_0xdf45('0xc')](),controller['getMyMessages']);router[_0xdf45('0x9')](_0xdf45('0x12'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x13')]);router[_0xdf45('0x14')]('/',auth[_0xdf45('0xa')](),controller['create']);router['post'](_0xdf45('0x15'),auth[_0xdf45('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xdf45('0x16')]({'destination':function(_0x3c0e59,_0x2b641a,_0x398abd){_0x398abd(null,path['join'](config[_0xdf45('0x17')],'server/files/attachments/'));},'filename':function(_0x86a165,_0x447694,_0xf2ebc5){_0xf2ebc5(null,util[_0xdf45('0x18')](_0xdf45('0x19'),Date['now'](),_0x447694['originalname'][_0xdf45('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xdf45('0x14')](_0xdf45('0x1b'),upload['single'](_0xdf45('0x1c')),controller[_0xdf45('0x1d')]);router[_0xdf45('0x14')]('/:id/messages',auth[_0xdf45('0xc')](),controller[_0xdf45('0x1e')]);router[_0xdf45('0x14')](_0xdf45('0x1f'),auth[_0xdf45('0xa')](),interaction[_0xdf45('0x20')](_0xdf45('0x21'),_0xdf45('0x22')),controller[_0xdf45('0x23')]);router[_0xdf45('0x24')](_0xdf45('0x25'),auth['isAuthenticated'](),interaction[_0xdf45('0x20')]('chat',_0xdf45('0x26')),controller[_0xdf45('0x27')]);router['put']('/:id/custom_update',controller[_0xdf45('0x28')]);router[_0xdf45('0x24')](_0xdf45('0x29'),auth[_0xdf45('0xc')](),controller[_0xdf45('0x2a')]);router[_0xdf45('0x24')]('/:id/close',controller[_0xdf45('0x2b')]);router['delete'](_0xdf45('0x25'),auth[_0xdf45('0xa')](),interaction[_0xdf45('0x20')]('chat',_0xdf45('0x2c')),controller[_0xdf45('0x2d')]);router[_0xdf45('0x2e')](_0xdf45('0x1f'),auth['isAuthenticated'](),controller[_0xdf45('0x2f')]);module[_0xdf45('0x30')]=router;
\ No newline at end of file
+var _0x106a=['originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','diskStorage','join','root','server/files/attachments/','format','%s-%s','now'];(function(_0x836465,_0x5442ae){var _0x2150ea=function(_0x4f4bc2){while(--_0x4f4bc2){_0x836465['push'](_0x836465['shift']());}};_0x2150ea(++_0x5442ae);}(_0x106a,0x1b5));var _0xa106=function(_0x5daeb2,_0x4b007c){_0x5daeb2=_0x5daeb2-0x0;var _0x2dbb9f=_0x106a[_0x5daeb2];return _0x2dbb9f;};'use strict';var multer=require(_0xa106('0x0'));var util=require(_0xa106('0x1'));var path=require(_0xa106('0x2'));var timeout=require('connect-timeout');var express=require(_0xa106('0x3'));var router=express[_0xa106('0x4')]();var fs_extra=require(_0xa106('0x5'));var auth=require(_0xa106('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa106('0x7'));var controller=require('./chatInteraction.controller');router[_0xa106('0x8')]('/',auth[_0xa106('0x9')](),controller['index']);router[_0xa106('0x8')]('/describe',auth[_0xa106('0x9')](),controller[_0xa106('0xa')]);router[_0xa106('0x8')](_0xa106('0xb'),auth['isChatInteractionAuthorized'](),controller[_0xa106('0xc')]);router[_0xa106('0x8')](_0xa106('0xd'),auth[_0xa106('0xe')](),controller['attachmentDownload']);router[_0xa106('0x8')](_0xa106('0xf'),auth[_0xa106('0x9')](),controller[_0xa106('0x10')]);router[_0xa106('0x8')](_0xa106('0x11'),auth[_0xa106('0xe')](),controller[_0xa106('0x12')]);router[_0xa106('0x8')](_0xa106('0x13'),auth[_0xa106('0x9')](),controller[_0xa106('0x14')]);router[_0xa106('0x15')]('/',auth[_0xa106('0x9')](),controller[_0xa106('0x16')]);router[_0xa106('0x15')](_0xa106('0x17'),auth[_0xa106('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xa106('0x18')]({'destination':function(_0x37c45f,_0x58512a,_0xeee3aa){_0xeee3aa(null,path[_0xa106('0x19')](config[_0xa106('0x1a')],_0xa106('0x1b')));},'filename':function(_0x247808,_0x34ea15,_0x558daf){_0x558daf(null,util[_0xa106('0x1c')](_0xa106('0x1d'),Date[_0xa106('0x1e')](),_0x34ea15[_0xa106('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa106('0x15')](_0xa106('0x20'),upload[_0xa106('0x21')](_0xa106('0x22')),controller[_0xa106('0x23')]);router[_0xa106('0x15')](_0xa106('0xf'),auth[_0xa106('0xe')](),controller[_0xa106('0x24')]);router[_0xa106('0x15')](_0xa106('0x25'),auth[_0xa106('0x9')](),interaction[_0xa106('0x26')](_0xa106('0x27'),_0xa106('0x28')),controller[_0xa106('0x29')]);router[_0xa106('0x2a')](_0xa106('0xb'),auth[_0xa106('0x9')](),interaction[_0xa106('0x26')](_0xa106('0x27'),'chatinteraction:update'),controller[_0xa106('0x2b')]);router[_0xa106('0x2a')](_0xa106('0x2c'),controller[_0xa106('0x2d')]);router[_0xa106('0x2a')]('/:id/abandon',auth[_0xa106('0xe')](),controller[_0xa106('0x2e')]);router[_0xa106('0x2a')](_0xa106('0x2f'),controller[_0xa106('0x30')]);router[_0xa106('0x31')](_0xa106('0xb'),auth[_0xa106('0x9')](),interaction['tracked'](_0xa106('0x27'),_0xa106('0x32')),controller[_0xa106('0x33')]);router[_0xa106('0x31')](_0xa106('0x25'),auth[_0xa106('0x9')](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 64cb197..ba5d27a 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 _0xfb98=['sequelize','exports','TEXT','medium'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0xfb98,0x94));var _0x8fb9=function(_0x5bbb65,_0x33159b){_0x5bbb65=_0x5bbb65-0x0;var _0x56c547=_0xfb98[_0x5bbb65];return _0x56c547;};'use strict';var Sequelize=require(_0x8fb9('0x0'));module[_0x8fb9('0x1')]={'body':{'type':Sequelize[_0x8fb9('0x2')](_0x8fb9('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xe699=['TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x52e43f,_0x20c65c){var _0x4d7c4d=function(_0x287927){while(--_0x287927){_0x52e43f['push'](_0x52e43f['shift']());}};_0x4d7c4d(++_0x20c65c);}(_0xe699,0x153));var _0x9e69=function(_0x561534,_0x82908a){_0x561534=_0x561534-0x0;var _0x500ba1=_0xe699[_0x561534];return _0x500ba1;};'use strict';var Sequelize=require(_0x9e69('0x0'));module['exports']={'body':{'type':Sequelize[_0x9e69('0x1')](_0x9e69('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x9e69('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x9e69('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 8f25524..ffed1ac 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 _0x88e2=['catch','show','intersection','options','create','body','find','params','describe','get','lastMessageAt','lastMessage','format','getUsers','User','agent','user','fullname','role','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','messages','createdAt','FromId','ToId','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows'];(function(_0x246769,_0x49cd30){var _0x560e5d=function(_0x3b5331){while(--_0x3b5331){_0x246769['push'](_0x246769['shift']());}};_0x560e5d(++_0x49cd30);}(_0x88e2,0x9c));var _0x288e=function(_0x3a8663,_0x5c4df1){_0x3a8663=_0x3a8663-0x0;var _0x404900=_0x88e2[_0x3a8663];return _0x404900;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x288e('0x0'));var zipdir=require(_0x288e('0x1'));var jsonpatch=require(_0x288e('0x2'));var rp=require(_0x288e('0x3'));var moment=require(_0x288e('0x4'));var BPromise=require(_0x288e('0x5'));var Mustache=require(_0x288e('0x6'));var util=require(_0x288e('0x7'));var path=require(_0x288e('0x8'));var sox=require(_0x288e('0x9'));var csv=require(_0x288e('0xa'));var ejs=require(_0x288e('0xb'));var fs=require('fs');var fs_extra=require(_0x288e('0xc'));var _=require('lodash');var squel=require(_0x288e('0xd'));var crypto=require(_0x288e('0xe'));var jsforce=require(_0x288e('0xf'));var deskjs=require(_0x288e('0x10'));var toCsv=require(_0x288e('0xa'));var querystring=require(_0x288e('0x11'));var Papa=require(_0x288e('0x12'));var Redis=require(_0x288e('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x288e('0x14'));var as=require(_0x288e('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x288e('0x16'))(_0x288e('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x288e('0x18')]=_[_0x288e('0x19')](config[_0x288e('0x18')],{'host':_0x288e('0x1a'),'port':0x18eb});var socket=require(_0x288e('0x1b'))(new Redis(config[_0x288e('0x18')]));require(_0x288e('0x1c'))[_0x288e('0x1d')](socket);function respondWithStatusCode(_0xface85,_0x4ca747){_0x4ca747=_0x4ca747||0xcc;return function(_0xea6b27){if(_0xea6b27){return _0xface85[_0x288e('0x1e')](_0x4ca747);}return _0xface85[_0x288e('0x1f')](_0x4ca747)[_0x288e('0x20')]();};}function respondWithResult(_0x55406f,_0x589e77){_0x589e77=_0x589e77||0xc8;return function(_0x12b3fc){if(_0x12b3fc){return _0x55406f[_0x288e('0x1f')](_0x589e77)[_0x288e('0x21')](_0x12b3fc);}};}function respondWithFilteredResult(_0x455707,_0xf3288f){return function(_0x53688e){if(_0x53688e){var _0x44001b=typeof _0xf3288f[_0x288e('0x22')]===_0x288e('0x23')&&typeof _0xf3288f[_0x288e('0x24')]==='undefined';var _0x2ae21a=_0x53688e[_0x288e('0x25')];var _0x1bd4b8=_0x44001b?0x0:_0xf3288f[_0x288e('0x22')];var _0x340f71=_0x44001b?_0x53688e[_0x288e('0x25')]:_0xf3288f['offset']+_0xf3288f['limit'];var _0x301fdd;if(_0x340f71>=_0x2ae21a){_0x340f71=_0x2ae21a;_0x301fdd=0xc8;}else{_0x301fdd=0xce;}_0x455707[_0x288e('0x1f')](_0x301fdd);return _0x455707['set']('Content-Range',_0x1bd4b8+'-'+_0x340f71+'/'+_0x2ae21a)[_0x288e('0x21')](_0x53688e);}return null;};}function patchUpdates(_0x7df4b0){return function(_0x35ab6c){try{jsonpatch[_0x288e('0x26')](_0x35ab6c,_0x7df4b0,!![]);}catch(_0x504244){return BPromise[_0x288e('0x27')](_0x504244);}return _0x35ab6c[_0x288e('0x28')]();};}function saveUpdates(_0x2b2f91,_0x3b5a8c){return function(_0x58c79e){if(_0x58c79e){return _0x58c79e[_0x288e('0x29')](_0x2b2f91)[_0x288e('0x2a')](function(_0xc72d1c){return _0xc72d1c;});}return null;};}function removeEntity(_0x35e442,_0x14b220){return function(_0x555b33){if(_0x555b33){return _0x555b33[_0x288e('0x2b')]()[_0x288e('0x2a')](function(){_0x35e442[_0x288e('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9645bd,_0x5a1792){return function(_0x138ff6){if(!_0x138ff6){_0x9645bd[_0x288e('0x1e')](0x194);}return _0x138ff6;};}function handleError(_0x576c25,_0xd15d2a){_0xd15d2a=_0xd15d2a||0x1f4;return function(_0x57b844){logger[_0x288e('0x2c')](_0x57b844[_0x288e('0x2d')]);if(_0x57b844[_0x288e('0x2e')]){delete _0x57b844['name'];}_0x576c25['status'](_0xd15d2a)[_0x288e('0x2f')](_0x57b844);};}exports[_0x288e('0x30')]=function(_0xf8a9a6,_0x16a997){var _0x3eb6a8={},_0x532f1f={},_0x32fdff={'count':0x0,'rows':[]};var _0x48b3bd=_[_0x288e('0x31')](db[_0x288e('0x32')][_0x288e('0x33')],function(_0x37b3d4){return{'name':_0x37b3d4[_0x288e('0x34')],'type':_0x37b3d4[_0x288e('0x35')][_0x288e('0x36')]};});_0x532f1f[_0x288e('0x37')]=_[_0x288e('0x31')](_0x48b3bd,_0x288e('0x2e'));_0x532f1f[_0x288e('0x38')]=_[_0x288e('0x39')](_0xf8a9a6['query']);_0x532f1f[_0x288e('0x3a')]=_['intersection'](_0x532f1f[_0x288e('0x37')],_0x532f1f['query']);_0x3eb6a8[_0x288e('0x3b')]=_['intersection'](_0x532f1f[_0x288e('0x37')],qs[_0x288e('0x3c')](_0xf8a9a6[_0x288e('0x38')][_0x288e('0x3c')]));_0x3eb6a8['attributes']=_0x3eb6a8['attributes'][_0x288e('0x3d')]?_0x3eb6a8[_0x288e('0x3b')]:_0x532f1f[_0x288e('0x37')];if(!_0xf8a9a6['query']['hasOwnProperty'](_0x288e('0x3e'))){_0x3eb6a8[_0x288e('0x24')]=qs[_0x288e('0x24')](_0xf8a9a6['query'][_0x288e('0x24')]);_0x3eb6a8[_0x288e('0x22')]=qs[_0x288e('0x22')](_0xf8a9a6[_0x288e('0x38')]['offset']);}_0x3eb6a8[_0x288e('0x3f')]=qs[_0x288e('0x40')](_0xf8a9a6['query'][_0x288e('0x40')]);_0x3eb6a8[_0x288e('0x41')]=qs[_0x288e('0x3a')](_[_0x288e('0x42')](_0xf8a9a6['query'],_0x532f1f[_0x288e('0x3a')]),_0x48b3bd);if(_0xf8a9a6['query']['filter']){_0x3eb6a8[_0x288e('0x41')]=_[_0x288e('0x43')](_0x3eb6a8[_0x288e('0x41')],{'$or':_[_0x288e('0x31')](_0x48b3bd,function(_0x5d8766){if(_0x5d8766[_0x288e('0x35')]!==_0x288e('0x44')){var _0x17a421={};_0x17a421[_0x5d8766[_0x288e('0x2e')]]={'$like':'%'+_0xf8a9a6[_0x288e('0x38')][_0x288e('0x45')]+'%'};return _0x17a421;}})});}_0x3eb6a8=_[_0x288e('0x43')]({},_0x3eb6a8,_0xf8a9a6['options']);var _0x19f2bf={'where':_0x3eb6a8[_0x288e('0x41')]};return db[_0x288e('0x32')][_0x288e('0x25')](_0x19f2bf)[_0x288e('0x2a')](function(_0x3b66a0){_0x32fdff[_0x288e('0x25')]=_0x3b66a0;if(_0xf8a9a6[_0x288e('0x38')][_0x288e('0x46')]){_0x3eb6a8[_0x288e('0x47')]=[{'all':!![]}];}return db[_0x288e('0x32')][_0x288e('0x48')](_0x3eb6a8);})[_0x288e('0x2a')](function(_0x2fd609){_0x32fdff[_0x288e('0x49')]=_0x2fd609;return _0x32fdff;})[_0x288e('0x2a')](respondWithFilteredResult(_0x16a997,_0x3eb6a8))[_0x288e('0x4a')](handleError(_0x16a997,null));};exports[_0x288e('0x4b')]=function(_0x1ac699,_0x429c21){var _0xd0e9e4={'raw':!![],'where':{'id':_0x1ac699['params']['id']}},_0x1e9a47={};_0x1e9a47['model']=_[_0x288e('0x39')](db[_0x288e('0x32')]['rawAttributes']);_0x1e9a47['query']=_[_0x288e('0x39')](_0x1ac699[_0x288e('0x38')]);_0x1e9a47[_0x288e('0x3a')]=_['intersection'](_0x1e9a47[_0x288e('0x37')],_0x1e9a47['query']);_0xd0e9e4[_0x288e('0x3b')]=_[_0x288e('0x4c')](_0x1e9a47[_0x288e('0x37')],qs[_0x288e('0x3c')](_0x1ac699['query'][_0x288e('0x3c')]));_0xd0e9e4[_0x288e('0x3b')]=_0xd0e9e4[_0x288e('0x3b')][_0x288e('0x3d')]?_0xd0e9e4[_0x288e('0x3b')]:_0x1e9a47['model'];if(_0x1ac699[_0x288e('0x38')][_0x288e('0x46')]){_0xd0e9e4[_0x288e('0x47')]=[{'all':!![]}];}_0xd0e9e4=_[_0x288e('0x43')]({},_0xd0e9e4,_0x1ac699[_0x288e('0x4d')]);return db[_0x288e('0x32')]['find'](_0xd0e9e4)[_0x288e('0x2a')](handleEntityNotFound(_0x429c21,null))[_0x288e('0x2a')](respondWithResult(_0x429c21,null))[_0x288e('0x4a')](handleError(_0x429c21,null));};exports[_0x288e('0x4e')]=function(_0x33482b,_0x185c90){return db[_0x288e('0x32')][_0x288e('0x4e')](_0x33482b[_0x288e('0x4f')],{})[_0x288e('0x2a')](respondWithResult(_0x185c90,0xc9))[_0x288e('0x4a')](handleError(_0x185c90,null));};exports[_0x288e('0x29')]=function(_0x4bd050,_0x2daf13){if(_0x4bd050[_0x288e('0x4f')]['id']){delete _0x4bd050[_0x288e('0x4f')]['id'];}return db['ChatInternalMessage'][_0x288e('0x50')]({'where':{'id':_0x4bd050['params']['id']}})['then'](handleEntityNotFound(_0x2daf13,null))[_0x288e('0x2a')](saveUpdates(_0x4bd050[_0x288e('0x4f')],null))['then'](respondWithResult(_0x2daf13,null))[_0x288e('0x4a')](handleError(_0x2daf13,null));};exports[_0x288e('0x2b')]=function(_0x4e46cd,_0x5e0a92){return db[_0x288e('0x32')]['find']({'where':{'id':_0x4e46cd[_0x288e('0x51')]['id']}})[_0x288e('0x2a')](handleEntityNotFound(_0x5e0a92,null))[_0x288e('0x2a')](removeEntity(_0x5e0a92,null))[_0x288e('0x4a')](handleError(_0x5e0a92,null));};exports[_0x288e('0x52')]=function(_0x3fd97c,_0xcb4b0d){return db[_0x288e('0x32')][_0x288e('0x52')]()['then'](respondWithResult(_0xcb4b0d,null))[_0x288e('0x4a')](handleError(_0xcb4b0d,null));};function wrapUser(_0x108998){return function(_0x55ef49){var _0x50e03c=_0x108998[_0x288e('0x53')]({'plain':!![]});_0x50e03c['messages']=[];if(_0x55ef49){_0x50e03c[_0x288e('0x54')]=_0x55ef49['createdAt'];_0x50e03c[_0x288e('0x55')]=_0x55ef49;}else{_0x50e03c[_0x288e('0x54')]=moment(0x0)[_0x288e('0x56')]('YYYY-MM-DD\x20HH:mm:ss');_0x50e03c[_0x288e('0x55')]={};}return _0x50e03c;};}exports[_0x288e('0x57')]=function(_0x3ef5dd,_0x674d4e,_0x19ba6a){var _0x1178f0=[];return db[_0x288e('0x58')][_0x288e('0x48')]({'where':{'role':[_0x288e('0x59'),'admin',_0x288e('0x5a')]},'attributes':['id',_0x288e('0x5b'),_0x288e('0x2e'),_0x288e('0x5c'),'userpic',_0x288e('0x5d'),_0x288e('0x5e'),_0x288e('0x5f'),_0x288e('0x60'),_0x288e('0x61')],'order':qs['sort'](_0x288e('0x62')),'include':[{'model':db[_0x288e('0x63')],'as':_0x288e('0x64'),'attributes':['id','name',_0x288e('0x35')],'through':{'attributes':[]}}]})[_0x288e('0x2a')](function(_0x5d48ef){if(_0x5d48ef){var _0x1f17ad=_0x3ef5dd['user'][_0x288e('0x53')]({'plain':!![]});if(!_0x1f17ad)throw new Error(_0x288e('0x65'));if(_0x1f17ad[_0x288e('0x5c')]===_0x288e('0x5a')){return db[_0x288e('0x66')]['find']({'where':{'name':_0x288e('0x67'),'userProfileId':_0x1f17ad[_0x288e('0x68')]},'raw':!![]})[_0x288e('0x2a')](function(_0x1fb6e4){if(_0x1fb6e4){if(_0x1fb6e4[_0x288e('0x69')]===0x0){return db[_0x288e('0x6a')][_0x288e('0x48')]({'where':{'sectionId':_0x1fb6e4['id']},'raw':!![]})[_0x288e('0x2a')](function(_0x24a71d){var _0x2b8216=[];if(_[_0x288e('0x6b')](_0x24a71d)){_0x2b8216=_[_0x288e('0x45')](_0x5d48ef,function(_0x5cf978){if(_0x5cf978[_0x288e('0x5c')]!==_0x288e('0x59')){return _0x5cf978;}});return _0x2b8216;}else{for(var _0x517ed1=0x0;_0x517ed1<_0x5d48ef[_0x288e('0x3d')];_0x517ed1++){var _0xbfbdd8=_0x5d48ef[_0x517ed1];if(_0xbfbdd8[_0x288e('0x5c')]==='agent'){var _0x39f90e=_['find'](_0x24a71d,function(_0x4bbce5){return _0x4bbce5['resourceId']===_0xbfbdd8['id'];});if(_0x39f90e)_0x2b8216[_0x288e('0x6c')](_0xbfbdd8);}else{_0x2b8216['push'](_0xbfbdd8);}}return _0x2b8216;}});}else{return _0x5d48ef;}}else{var _0x4de743=_[_0x288e('0x45')](_0x5d48ef,function(_0x3a45df){if(_0x3a45df[_0x288e('0x5c')]!==_0x288e('0x59')){return _0x3a45df;}});return _0x4de743;}});}else{return _0x5d48ef;}}})[_0x288e('0x2a')](function(_0x3be6ff){var _0x56966a=[];if(_0x3be6ff){_0x1178f0=_0x3be6ff;for(var _0x296f58=0x0;_0x296f58<_0x3be6ff[_0x288e('0x3d')];_0x296f58+=0x1){_0x1178f0[_0x296f58][_0x288e('0x6d')]=[];_0x56966a[_0x288e('0x6c')](db[_0x288e('0x32')][_0x288e('0x50')]({'where':{'FromId':[_0x3ef5dd[_0x288e('0x5a')]['id'],_0x3be6ff[_0x296f58]['id']],'ToId':[_0x3ef5dd[_0x288e('0x5a')]['id'],_0x3be6ff[_0x296f58]['id']],'ChatGroupId':null},'attributes':['id',_0x288e('0x6e'),_0x288e('0x6f'),_0x288e('0x70'),'read',_0x288e('0x4f')],'order':qs[_0x288e('0x40')](_0x288e('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x288e('0x2a')](wrapUser(_0x3be6ff[_0x296f58])));}return BPromise[_0x288e('0x72')](_0x56966a);}return[];})[_0x288e('0x2a')](function(_0x591365){return{'rows':_0x591365,'count':_0x591365[_0x288e('0x3d')]};})['then'](respondWithResult(_0x674d4e,null))[_0x288e('0x4a')](handleError(_0x674d4e,null));};
\ No newline at end of file
+var _0x0a14=['order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','describe','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','user','fullname','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','ToId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','map','ChatInternalMessage','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','nolimit'];(function(_0x416273,_0x39f3fb){var _0x34f447=function(_0xe062d7){while(--_0xe062d7){_0x416273['push'](_0x416273['shift']());}};_0x34f447(++_0x39f3fb);}(_0x0a14,0x115));var _0x40a1=function(_0x562677,_0x24729f){_0x562677=_0x562677-0x0;var _0x59975e=_0x0a14[_0x562677];return _0x59975e;};'use strict';var emlformat=require(_0x40a1('0x0'));var rimraf=require(_0x40a1('0x1'));var zipdir=require(_0x40a1('0x2'));var jsonpatch=require(_0x40a1('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x40a1('0x4'));var Mustache=require(_0x40a1('0x5'));var util=require(_0x40a1('0x6'));var path=require('path');var sox=require(_0x40a1('0x7'));var csv=require(_0x40a1('0x8'));var ejs=require(_0x40a1('0x9'));var fs=require('fs');var fs_extra=require(_0x40a1('0xa'));var _=require('lodash');var squel=require(_0x40a1('0xb'));var crypto=require(_0x40a1('0xc'));var jsforce=require(_0x40a1('0xd'));var deskjs=require(_0x40a1('0xe'));var toCsv=require(_0x40a1('0x8'));var querystring=require(_0x40a1('0xf'));var Papa=require(_0x40a1('0x10'));var Redis=require('ioredis');var authService=require(_0x40a1('0x11'));var qs=require(_0x40a1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x40a1('0x13'));var logger=require(_0x40a1('0x14'))('api');var utils=require(_0x40a1('0x15'));var config=require(_0x40a1('0x16'));var licenseUtil=require(_0x40a1('0x17'));var db=require(_0x40a1('0x18'))['db'];config[_0x40a1('0x19')]=_[_0x40a1('0x1a')](config[_0x40a1('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x40a1('0x19')]));require('./chatInternalMessage.socket')[_0x40a1('0x1b')](socket);function respondWithStatusCode(_0x3c8a88,_0x27f3d9){_0x27f3d9=_0x27f3d9||0xcc;return function(_0x384ec0){if(_0x384ec0){return _0x3c8a88[_0x40a1('0x1c')](_0x27f3d9);}return _0x3c8a88[_0x40a1('0x1d')](_0x27f3d9)[_0x40a1('0x1e')]();};}function respondWithResult(_0x4763e5,_0x544fd4){_0x544fd4=_0x544fd4||0xc8;return function(_0x5d7726){if(_0x5d7726){return _0x4763e5[_0x40a1('0x1d')](_0x544fd4)[_0x40a1('0x1f')](_0x5d7726);}};}function respondWithFilteredResult(_0x16405b,_0x3654f1){return function(_0x3a06ff){if(_0x3a06ff){var _0x8c3dfe=typeof _0x3654f1[_0x40a1('0x20')]===_0x40a1('0x21')&&typeof _0x3654f1[_0x40a1('0x22')]===_0x40a1('0x21');var _0x720307=_0x3a06ff[_0x40a1('0x23')];var _0x492c88=_0x8c3dfe?0x0:_0x3654f1[_0x40a1('0x20')];var _0x57cad4=_0x8c3dfe?_0x3a06ff['count']:_0x3654f1[_0x40a1('0x20')]+_0x3654f1[_0x40a1('0x22')];var _0x183e31;if(_0x57cad4>=_0x720307){_0x57cad4=_0x720307;_0x183e31=0xc8;}else{_0x183e31=0xce;}_0x16405b['status'](_0x183e31);return _0x16405b[_0x40a1('0x24')](_0x40a1('0x25'),_0x492c88+'-'+_0x57cad4+'/'+_0x720307)[_0x40a1('0x1f')](_0x3a06ff);}return null;};}function patchUpdates(_0x242d5d){return function(_0x26ca0d){try{jsonpatch[_0x40a1('0x26')](_0x26ca0d,_0x242d5d,!![]);}catch(_0x1bfc98){return BPromise[_0x40a1('0x27')](_0x1bfc98);}return _0x26ca0d[_0x40a1('0x28')]();};}function saveUpdates(_0x23ba5c,_0x58f980){return function(_0x5172f1){if(_0x5172f1){return _0x5172f1[_0x40a1('0x29')](_0x23ba5c)['then'](function(_0x144793){return _0x144793;});}return null;};}function removeEntity(_0x47533d,_0x3f575a){return function(_0x4462d8){if(_0x4462d8){return _0x4462d8[_0x40a1('0x2a')]()[_0x40a1('0x2b')](function(){_0x47533d[_0x40a1('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e2653,_0x2fbeba){return function(_0x5cc7e6){if(!_0x5cc7e6){_0x4e2653[_0x40a1('0x1c')](0x194);}return _0x5cc7e6;};}function handleError(_0x514ad0,_0x2d7365){_0x2d7365=_0x2d7365||0x1f4;return function(_0x1e93e2){logger['error'](_0x1e93e2[_0x40a1('0x2c')]);if(_0x1e93e2[_0x40a1('0x2d')]){delete _0x1e93e2[_0x40a1('0x2d')];}_0x514ad0[_0x40a1('0x1d')](_0x2d7365)['send'](_0x1e93e2);};}exports['index']=function(_0x2292d5,_0xea8642){var _0x4eb0ac={},_0x1b5791={},_0x5cd4ae={'count':0x0,'rows':[]};var _0x54ac37=_[_0x40a1('0x2e')](db[_0x40a1('0x2f')][_0x40a1('0x30')],function(_0x29cde4){return{'name':_0x29cde4[_0x40a1('0x31')],'type':_0x29cde4[_0x40a1('0x32')]['key']};});_0x1b5791[_0x40a1('0x33')]=_[_0x40a1('0x2e')](_0x54ac37,'name');_0x1b5791['query']=_[_0x40a1('0x34')](_0x2292d5[_0x40a1('0x35')]);_0x1b5791['filters']=_[_0x40a1('0x36')](_0x1b5791['model'],_0x1b5791[_0x40a1('0x35')]);_0x4eb0ac[_0x40a1('0x37')]=_[_0x40a1('0x36')](_0x1b5791[_0x40a1('0x33')],qs[_0x40a1('0x38')](_0x2292d5['query']['fields']));_0x4eb0ac[_0x40a1('0x37')]=_0x4eb0ac[_0x40a1('0x37')][_0x40a1('0x39')]?_0x4eb0ac[_0x40a1('0x37')]:_0x1b5791[_0x40a1('0x33')];if(!_0x2292d5[_0x40a1('0x35')]['hasOwnProperty'](_0x40a1('0x3a'))){_0x4eb0ac['limit']=qs[_0x40a1('0x22')](_0x2292d5['query']['limit']);_0x4eb0ac[_0x40a1('0x20')]=qs['offset'](_0x2292d5[_0x40a1('0x35')][_0x40a1('0x20')]);}_0x4eb0ac[_0x40a1('0x3b')]=qs[_0x40a1('0x3c')](_0x2292d5['query'][_0x40a1('0x3c')]);_0x4eb0ac[_0x40a1('0x3d')]=qs[_0x40a1('0x3e')](_[_0x40a1('0x3f')](_0x2292d5[_0x40a1('0x35')],_0x1b5791[_0x40a1('0x3e')]),_0x54ac37);if(_0x2292d5['query']['filter']){_0x4eb0ac[_0x40a1('0x3d')]=_[_0x40a1('0x40')](_0x4eb0ac[_0x40a1('0x3d')],{'$or':_['map'](_0x54ac37,function(_0x34b340){if(_0x34b340['type']!==_0x40a1('0x41')){var _0x240627={};_0x240627[_0x34b340[_0x40a1('0x2d')]]={'$like':'%'+_0x2292d5[_0x40a1('0x35')][_0x40a1('0x42')]+'%'};return _0x240627;}})});}_0x4eb0ac=_[_0x40a1('0x40')]({},_0x4eb0ac,_0x2292d5[_0x40a1('0x43')]);var _0x5977dc={'where':_0x4eb0ac[_0x40a1('0x3d')]};return db[_0x40a1('0x2f')][_0x40a1('0x23')](_0x5977dc)['then'](function(_0x1ac5f5){_0x5cd4ae[_0x40a1('0x23')]=_0x1ac5f5;if(_0x2292d5['query'][_0x40a1('0x44')]){_0x4eb0ac[_0x40a1('0x45')]=[{'all':!![]}];}return db[_0x40a1('0x2f')]['findAll'](_0x4eb0ac);})[_0x40a1('0x2b')](function(_0x51a559){_0x5cd4ae[_0x40a1('0x46')]=_0x51a559;return _0x5cd4ae;})['then'](respondWithFilteredResult(_0xea8642,_0x4eb0ac))[_0x40a1('0x47')](handleError(_0xea8642,null));};exports[_0x40a1('0x48')]=function(_0xc400c7,_0x5f503b){var _0x51852b={'raw':!![],'where':{'id':_0xc400c7[_0x40a1('0x49')]['id']}},_0x11fc52={};_0x11fc52[_0x40a1('0x33')]=_[_0x40a1('0x34')](db[_0x40a1('0x2f')][_0x40a1('0x30')]);_0x11fc52['query']=_[_0x40a1('0x34')](_0xc400c7[_0x40a1('0x35')]);_0x11fc52[_0x40a1('0x3e')]=_[_0x40a1('0x36')](_0x11fc52['model'],_0x11fc52['query']);_0x51852b[_0x40a1('0x37')]=_[_0x40a1('0x36')](_0x11fc52['model'],qs[_0x40a1('0x38')](_0xc400c7[_0x40a1('0x35')][_0x40a1('0x38')]));_0x51852b[_0x40a1('0x37')]=_0x51852b[_0x40a1('0x37')]['length']?_0x51852b[_0x40a1('0x37')]:_0x11fc52[_0x40a1('0x33')];if(_0xc400c7[_0x40a1('0x35')]['includeAll']){_0x51852b[_0x40a1('0x45')]=[{'all':!![]}];}_0x51852b=_['merge']({},_0x51852b,_0xc400c7[_0x40a1('0x43')]);return db[_0x40a1('0x2f')][_0x40a1('0x4a')](_0x51852b)[_0x40a1('0x2b')](handleEntityNotFound(_0x5f503b,null))['then'](respondWithResult(_0x5f503b,null))[_0x40a1('0x47')](handleError(_0x5f503b,null));};exports[_0x40a1('0x4b')]=function(_0x4fef2b,_0x37855a){return db['ChatInternalMessage']['create'](_0x4fef2b[_0x40a1('0x4c')],{})['then'](respondWithResult(_0x37855a,0xc9))[_0x40a1('0x47')](handleError(_0x37855a,null));};exports[_0x40a1('0x29')]=function(_0x2cc6b6,_0x28ad93){if(_0x2cc6b6[_0x40a1('0x4c')]['id']){delete _0x2cc6b6[_0x40a1('0x4c')]['id'];}return db[_0x40a1('0x2f')][_0x40a1('0x4a')]({'where':{'id':_0x2cc6b6[_0x40a1('0x49')]['id']}})[_0x40a1('0x2b')](handleEntityNotFound(_0x28ad93,null))['then'](saveUpdates(_0x2cc6b6[_0x40a1('0x4c')],null))['then'](respondWithResult(_0x28ad93,null))[_0x40a1('0x47')](handleError(_0x28ad93,null));};exports[_0x40a1('0x2a')]=function(_0x2cb07c,_0x3edb5c){return db['ChatInternalMessage']['find']({'where':{'id':_0x2cb07c[_0x40a1('0x49')]['id']}})['then'](handleEntityNotFound(_0x3edb5c,null))[_0x40a1('0x2b')](removeEntity(_0x3edb5c,null))[_0x40a1('0x47')](handleError(_0x3edb5c,null));};exports[_0x40a1('0x4d')]=function(_0x554932,_0x57b129){return db[_0x40a1('0x2f')][_0x40a1('0x4d')]()[_0x40a1('0x2b')](respondWithResult(_0x57b129,null))[_0x40a1('0x47')](handleError(_0x57b129,null));};function wrapUser(_0xf94ff){return function(_0x4e955b){var _0x50d527=_0xf94ff['get']({'plain':!![]});_0x50d527[_0x40a1('0x4e')]=[];if(_0x4e955b){_0x50d527[_0x40a1('0x4f')]=_0x4e955b[_0x40a1('0x50')];_0x50d527[_0x40a1('0x51')]=_0x4e955b;}else{_0x50d527['lastMessageAt']=moment(0x0)[_0x40a1('0x52')](_0x40a1('0x53'));_0x50d527['lastMessage']={};}return _0x50d527;};}exports[_0x40a1('0x54')]=function(_0x398d85,_0x1c94e7,_0x284e48){var _0x14b4fa=[];return db[_0x40a1('0x55')][_0x40a1('0x56')]({'where':{'role':['agent','admin',_0x40a1('0x57')]},'attributes':['id',_0x40a1('0x58'),_0x40a1('0x2d'),'role',_0x40a1('0x59'),_0x40a1('0x5a'),_0x40a1('0x5b'),_0x40a1('0x5c'),_0x40a1('0x5d'),_0x40a1('0x5e')],'order':qs[_0x40a1('0x3c')](_0x40a1('0x5f')),'include':[{'model':db[_0x40a1('0x60')],'as':_0x40a1('0x61'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})['then'](function(_0x33abe3){if(_0x33abe3){var _0x135ed1=_0x398d85[_0x40a1('0x57')][_0x40a1('0x62')]({'plain':!![]});if(!_0x135ed1)throw new Error(_0x40a1('0x63'));if(_0x135ed1[_0x40a1('0x64')]===_0x40a1('0x57')){return db[_0x40a1('0x65')][_0x40a1('0x4a')]({'where':{'name':_0x40a1('0x66'),'userProfileId':_0x135ed1['userProfileId']},'raw':!![]})['then'](function(_0x3762f3){if(_0x3762f3){if(_0x3762f3[_0x40a1('0x67')]===0x0){return db[_0x40a1('0x68')][_0x40a1('0x56')]({'where':{'sectionId':_0x3762f3['id']},'raw':!![]})['then'](function(_0x52cad5){var _0xde3143=[];if(_[_0x40a1('0x69')](_0x52cad5)){_0xde3143=_[_0x40a1('0x42')](_0x33abe3,function(_0x352dff){if(_0x352dff[_0x40a1('0x64')]!==_0x40a1('0x6a')){return _0x352dff;}});return _0xde3143;}else{for(var _0x46b434=0x0;_0x46b434<_0x33abe3[_0x40a1('0x39')];_0x46b434++){var _0x5adf1c=_0x33abe3[_0x46b434];if(_0x5adf1c[_0x40a1('0x64')]==='agent'){var _0x384c6e=_['find'](_0x52cad5,function(_0x2afd22){return _0x2afd22[_0x40a1('0x6b')]===_0x5adf1c['id'];});if(_0x384c6e)_0xde3143[_0x40a1('0x6c')](_0x5adf1c);}else{_0xde3143[_0x40a1('0x6c')](_0x5adf1c);}}return _0xde3143;}});}else{return _0x33abe3;}}else{var _0x5d2404=_[_0x40a1('0x42')](_0x33abe3,function(_0x3b0cc6){if(_0x3b0cc6['role']!==_0x40a1('0x6a')){return _0x3b0cc6;}});return _0x5d2404;}});}else{return _0x33abe3;}}})[_0x40a1('0x2b')](function(_0x547067){var _0x16f1c8=[];if(_0x547067){_0x14b4fa=_0x547067;for(var _0x4524ed=0x0;_0x4524ed<_0x547067[_0x40a1('0x39')];_0x4524ed+=0x1){_0x14b4fa[_0x4524ed]['messages']=[];_0x16f1c8[_0x40a1('0x6c')](db['ChatInternalMessage'][_0x40a1('0x4a')]({'where':{'FromId':[_0x398d85[_0x40a1('0x57')]['id'],_0x547067[_0x4524ed]['id']],'ToId':[_0x398d85['user']['id'],_0x547067[_0x4524ed]['id']],'ChatGroupId':null},'attributes':['id',_0x40a1('0x50'),'FromId',_0x40a1('0x6d'),_0x40a1('0x6e'),_0x40a1('0x4c')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x40a1('0x2b')](wrapUser(_0x547067[_0x4524ed])));}return BPromise[_0x40a1('0x6f')](_0x16f1c8);}return[];})[_0x40a1('0x2b')](function(_0x21f4c3){return{'rows':_0x21f4c3,'count':_0x21f4c3['length']};})['then'](respondWithResult(_0x1c94e7,null))[_0x40a1('0x47')](handleError(_0x1c94e7,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 0b050c8..b4a1a2a 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 _0xd4b2=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update'];(function(_0x498fd2,_0x285a2d){var _0x337b69=function(_0x5af854){while(--_0x5af854){_0x498fd2['push'](_0x498fd2['shift']());}};_0x337b69(++_0x285a2d);}(_0xd4b2,0x1da));var _0x2d4b=function(_0x3c6310,_0x13601d){_0x3c6310=_0x3c6310-0x0;var _0x320122=_0xd4b2[_0x3c6310];return _0x320122;};'use strict';var EventEmitter=require(_0x2d4b('0x0'));var ChatInternalMessage=require(_0x2d4b('0x1'))['db'][_0x2d4b('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x2d4b('0x3')](0x0);var events={'afterCreate':_0x2d4b('0x4'),'afterUpdate':_0x2d4b('0x5'),'afterDestroy':_0x2d4b('0x6')};function emitEvent(_0x2e4ce6){return function(_0xd5abd7,_0xb3eea1,_0xb83cd){ChatInternalMessageEvents[_0x2d4b('0x7')](_0x2e4ce6+':'+_0xd5abd7['id'],_0xd5abd7);ChatInternalMessageEvents[_0x2d4b('0x7')](_0x2e4ce6,_0xd5abd7);_0xb83cd(null);};}for(var e in events){if(events[_0x2d4b('0x8')](e)){var event=events[e];ChatInternalMessage[_0x2d4b('0x9')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x29e5=['../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x2ef8c1,_0x2f72f4){var _0x288305=function(_0x56244b){while(--_0x56244b){_0x2ef8c1['push'](_0x2ef8c1['shift']());}};_0x288305(++_0x2f72f4);}(_0x29e5,0x8f));var _0x529e=function(_0x1e9f73,_0x53009f){_0x1e9f73=_0x1e9f73-0x0;var _0x4f7de7=_0x29e5[_0x1e9f73];return _0x4f7de7;};'use strict';var EventEmitter=require(_0x529e('0x0'));var ChatInternalMessage=require(_0x529e('0x1'))['db'][_0x529e('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x529e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x529e('0x4'),'afterDestroy':_0x529e('0x5')};function emitEvent(_0xf57499){return function(_0x6750bd,_0x41217e,_0x2e2b71){ChatInternalMessageEvents[_0x529e('0x6')](_0xf57499+':'+_0x6750bd['id'],_0x6750bd);ChatInternalMessageEvents[_0x529e('0x6')](_0xf57499,_0x6750bd);_0x2e2b71(null);};}for(var e in events){if(events[_0x529e('0x7')](e)){var event=events[e];ChatInternalMessage[_0x529e('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 471b1b0..f84da94 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 _0xaf73=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0xaf73,0x112));var _0x3af7=function(_0x307d97,_0x4990e9){_0x307d97=_0x307d97-0x0;var _0x2d1985=_0xaf73[_0x307d97];return _0x2d1985;};'use strict';var _=require(_0x3af7('0x0'));var util=require(_0x3af7('0x1'));var logger=require(_0x3af7('0x2'))('api');var moment=require(_0x3af7('0x3'));var BPromise=require(_0x3af7('0x4'));var rp=require(_0x3af7('0x5'));var fs=require('fs');var path=require(_0x3af7('0x6'));var rimraf=require(_0x3af7('0x7'));var config=require(_0x3af7('0x8'));var attributes=require(_0x3af7('0x9'));module[_0x3af7('0xa')]=function(_0x51fe10,_0x3fc6a9){return _0x51fe10[_0x3af7('0xb')](_0x3af7('0xc'),attributes,{'tableName':_0x3af7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3af7('0xe'),'collate':_0x3af7('0xf')});};
\ No newline at end of file
+var _0x4e72=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages'];(function(_0x45ce08,_0x59dcc7){var _0x23dff2=function(_0x1ad0e5){while(--_0x1ad0e5){_0x45ce08['push'](_0x45ce08['shift']());}};_0x23dff2(++_0x59dcc7);}(_0x4e72,0x152));var _0x24e7=function(_0x40d077,_0x173490){_0x40d077=_0x40d077-0x0;var _0x3e01e9=_0x4e72[_0x40d077];return _0x3e01e9;};'use strict';var _=require(_0x24e7('0x0'));var util=require(_0x24e7('0x1'));var logger=require(_0x24e7('0x2'))(_0x24e7('0x3'));var moment=require(_0x24e7('0x4'));var BPromise=require(_0x24e7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x24e7('0x6'));var config=require(_0x24e7('0x7'));var attributes=require(_0x24e7('0x8'));module['exports']=function(_0x6e6f57,_0x5b1e65){return _0x6e6f57[_0x24e7('0x9')](_0x24e7('0xa'),attributes,{'tableName':_0x24e7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x24e7('0xc'),'collate':_0x24e7('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 6f2b2a1..1bc38d4 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 _0x4745=['../../config/environment','jayson/promise','http','redis','localhost','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2dab8a,_0x3d36a6){var _0x4cb52e=function(_0x266c50){while(--_0x266c50){_0x2dab8a['push'](_0x2dab8a['shift']());}};_0x4cb52e(++_0x3d36a6);}(_0x4745,0xf3));var _0x5474=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x4745[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var moment=require(_0x5474('0x2'));var BPromise=require(_0x5474('0x3'));var rs=require(_0x5474('0x4'));var fs=require('fs');var Redis=require(_0x5474('0x5'));var db=require(_0x5474('0x6'))['db'];var utils=require(_0x5474('0x7'));var logger=require(_0x5474('0x8'))('rpc');var config=require(_0x5474('0x9'));var jayson=require(_0x5474('0xa'));var client=jayson['client'][_0x5474('0xb')]({'port':0x232a});config[_0x5474('0xc')]=_['defaults'](config[_0x5474('0xc')],{'host':_0x5474('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5474('0xc')]));require(_0x5474('0xe'))[_0x5474('0xf')](socket);function respondWithRpcPromise(_0x87493a,_0xb76daf,_0x3adea0){return new BPromise(function(_0x2ae99a,_0x6339f0){return client[_0x5474('0x10')](_0x87493a,_0x3adea0)[_0x5474('0x11')](function(_0x4d6a48){logger['info'](_0x5474('0x12'),_0xb76daf,_0x5474('0x13'));logger[_0x5474('0x14')](_0x5474('0x15'),_0xb76daf,'request\x20sent',JSON['stringify'](_0x4d6a48));if(_0x4d6a48[_0x5474('0x16')]){if(_0x4d6a48['error'][_0x5474('0x17')]===0x1f4){logger[_0x5474('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0xb76daf,_0x4d6a48[_0x5474('0x16')][_0x5474('0x18')]);return _0x6339f0(_0x4d6a48['error'][_0x5474('0x18')]);}logger[_0x5474('0x16')](_0x5474('0x12'),_0xb76daf,_0x4d6a48[_0x5474('0x16')][_0x5474('0x18')]);return _0x2ae99a(_0x4d6a48[_0x5474('0x16')][_0x5474('0x18')]);}else{logger[_0x5474('0x19')](_0x5474('0x12'),_0xb76daf,_0x5474('0x13'));_0x2ae99a(_0x4d6a48[_0x5474('0x1a')]['message']);}})[_0x5474('0x1b')](function(_0x4c7879){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0xb76daf,_0x4c7879);_0x6339f0(_0x4c7879);});});}
\ No newline at end of file
+var _0xdc5d=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x28f32c,_0x4cc342){var _0x355402=function(_0xdb5032){while(--_0xdb5032){_0x28f32c['push'](_0x28f32c['shift']());}};_0x355402(++_0x4cc342);}(_0xdc5d,0x1a4));var _0xddc5=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xdc5d[_0x4a53d];return _0x27410e;};'use strict';var _=require('lodash');var util=require(_0xddc5('0x0'));var moment=require('moment');var BPromise=require(_0xddc5('0x1'));var rs=require(_0xddc5('0x2'));var fs=require('fs');var Redis=require(_0xddc5('0x3'));var db=require(_0xddc5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xddc5('0x5'));var jayson=require(_0xddc5('0x6'));var client=jayson[_0xddc5('0x7')][_0xddc5('0x8')]({'port':0x232a});config['redis']=_[_0xddc5('0x9')](config[_0xddc5('0xa')],{'host':_0xddc5('0xb'),'port':0x18eb});var socket=require(_0xddc5('0xc'))(new Redis(config['redis']));require(_0xddc5('0xd'))[_0xddc5('0xe')](socket);function respondWithRpcPromise(_0x4bd083,_0x11996c,_0x1428c7){return new BPromise(function(_0x1868b5,_0xd4a252){return client[_0xddc5('0xf')](_0x4bd083,_0x1428c7)[_0xddc5('0x10')](function(_0x4713ac){logger[_0xddc5('0x11')](_0xddc5('0x12'),_0x11996c,'request\x20sent');logger[_0xddc5('0x13')](_0xddc5('0x14'),_0x11996c,_0xddc5('0x15'),JSON[_0xddc5('0x16')](_0x4713ac));if(_0x4713ac['error']){if(_0x4713ac[_0xddc5('0x17')][_0xddc5('0x18')]===0x1f4){logger[_0xddc5('0x17')](_0xddc5('0x12'),_0x11996c,_0x4713ac[_0xddc5('0x17')][_0xddc5('0x19')]);return _0xd4a252(_0x4713ac[_0xddc5('0x17')]['message']);}logger[_0xddc5('0x17')](_0xddc5('0x12'),_0x11996c,_0x4713ac['error'][_0xddc5('0x19')]);return _0x1868b5(_0x4713ac['error'][_0xddc5('0x19')]);}else{logger[_0xddc5('0x11')](_0xddc5('0x12'),_0x11996c,_0xddc5('0x15'));_0x1868b5(_0x4713ac[_0xddc5('0x1a')][_0xddc5('0x19')]);}})[_0xddc5('0x1b')](function(_0x113d64){logger[_0xddc5('0x17')](_0xddc5('0x12'),_0x11996c,_0x113d64);_0xd4a252(_0x113d64);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 40e4275..fddea40 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 _0x682f=['emit','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x682f,0x184));var _0xf682=function(_0x23dceb,_0x2a4bcc){_0x23dceb=_0x23dceb-0x0;var _0xce17bc=_0x682f[_0x23dceb];return _0xce17bc;};'use strict';var ChatInternalMessageEvents=require(_0xf682('0x0'));var events=[_0xf682('0x1'),_0xf682('0x2'),_0xf682('0x3')];function createListener(_0x858461,_0x5cc60a){return function(_0x16f11e){_0x5cc60a[_0xf682('0x4')](_0x858461,_0x16f11e);};}function removeListener(_0x386cb5,_0xe44d7a){return function(){ChatInternalMessageEvents['removeListener'](_0x386cb5,_0xe44d7a);};}exports['register']=function(_0x7a9f5b){for(var _0x43436e=0x0,_0x365683=events[_0xf682('0x5')];_0x43436e<_0x365683;_0x43436e++){var _0x444e33=events[_0x43436e];var _0x5b436f=createListener(_0xf682('0x6')+_0x444e33,_0x7a9f5b);ChatInternalMessageEvents['on'](_0x444e33,_0x5b436f);}};
\ No newline at end of file
+var _0xd61c=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','update','emit'];(function(_0xf0940e,_0x23b020){var _0x21c011=function(_0x473e38){while(--_0x473e38){_0xf0940e['push'](_0xf0940e['shift']());}};_0x21c011(++_0x23b020);}(_0xd61c,0x12c));var _0xcd61=function(_0x4beeb9,_0x53d210){_0x4beeb9=_0x4beeb9-0x0;var _0x55aea8=_0xd61c[_0x4beeb9];return _0x55aea8;};'use strict';var ChatInternalMessageEvents=require(_0xcd61('0x0'));var events=[_0xcd61('0x1'),'remove',_0xcd61('0x2')];function createListener(_0x4b78f6,_0x2e254a){return function(_0x10f491){_0x2e254a[_0xcd61('0x3')](_0x4b78f6,_0x10f491);};}function removeListener(_0x4d075b,_0x2c4647){return function(){ChatInternalMessageEvents[_0xcd61('0x4')](_0x4d075b,_0x2c4647);};}exports[_0xcd61('0x5')]=function(_0x2a0c66){for(var _0x727c30=0x0,_0x4e3f2b=events[_0xcd61('0x6')];_0x727c30<_0x4e3f2b;_0x727c30++){var _0x7385d=events[_0x727c30];var _0x215616=createListener(_0xcd61('0x7')+_0x7385d,_0x2a0c66);ChatInternalMessageEvents['on'](_0x7385d,_0x215616);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 9cdac78..a84b8f2 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 _0x14b6=['put','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show'];(function(_0x2e26e0,_0x59fc69){var _0x432020=function(_0x138bf0){while(--_0x138bf0){_0x2e26e0['push'](_0x2e26e0['shift']());}};_0x432020(++_0x59fc69);}(_0x14b6,0x146));var _0x614b=function(_0x1e06d8,_0x11916d){_0x1e06d8=_0x1e06d8-0x0;var _0x224eb1=_0x14b6[_0x1e06d8];return _0x224eb1;};'use strict';var multer=require('multer');var util=require(_0x614b('0x0'));var path=require('path');var timeout=require(_0x614b('0x1'));var express=require(_0x614b('0x2'));var router=express[_0x614b('0x3')]();var fs_extra=require(_0x614b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x614b('0x5'));var config=require(_0x614b('0x6'));var controller=require('./chatInternalMessage.controller');router[_0x614b('0x7')]('/',auth[_0x614b('0x8')](),controller[_0x614b('0x9')]);router[_0x614b('0x7')](_0x614b('0xa'),auth[_0x614b('0x8')](),controller[_0x614b('0xb')]);router[_0x614b('0x7')](_0x614b('0xc'),auth[_0x614b('0x8')](),controller[_0x614b('0xd')]);router['get'](_0x614b('0xe'),auth[_0x614b('0x8')](),controller[_0x614b('0xf')]);router['post']('/',auth[_0x614b('0x8')](),controller['create']);router[_0x614b('0x10')]('/:id',controller['update']);router['delete'](_0x614b('0xe'),auth[_0x614b('0x8')](),controller[_0x614b('0x11')]);module[_0x614b('0x12')]=router;
\ No newline at end of file
+var _0xe4b6=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/users','getUsers','post','create','put','/:id','update','delete','exports','multer','path'];(function(_0x3620a3,_0x1e8376){var _0x55985f=function(_0x3da5d4){while(--_0x3da5d4){_0x3620a3['push'](_0x3620a3['shift']());}};_0x55985f(++_0x1e8376);}(_0xe4b6,0x18e));var _0x6e4b=function(_0x26cc1c,_0x4f6b44){_0x26cc1c=_0x26cc1c-0x0;var _0x23d79c=_0xe4b6[_0x26cc1c];return _0x23d79c;};'use strict';var multer=require(_0x6e4b('0x0'));var util=require('util');var path=require(_0x6e4b('0x1'));var timeout=require('connect-timeout');var express=require(_0x6e4b('0x2'));var router=express['Router']();var fs_extra=require(_0x6e4b('0x3'));var auth=require(_0x6e4b('0x4'));var interaction=require(_0x6e4b('0x5'));var config=require(_0x6e4b('0x6'));var controller=require('./chatInternalMessage.controller');router[_0x6e4b('0x7')]('/',auth['isAuthenticated'](),controller[_0x6e4b('0x8')]);router[_0x6e4b('0x7')](_0x6e4b('0x9'),auth[_0x6e4b('0xa')](),controller['describe']);router['get'](_0x6e4b('0xb'),auth[_0x6e4b('0xa')](),controller[_0x6e4b('0xc')]);router[_0x6e4b('0x7')]('/:id',auth[_0x6e4b('0xa')](),controller['show']);router[_0x6e4b('0xd')]('/',auth[_0x6e4b('0xa')](),controller[_0x6e4b('0xe')]);router[_0x6e4b('0xf')](_0x6e4b('0x10'),controller[_0x6e4b('0x11')]);router[_0x6e4b('0x12')](_0x6e4b('0x10'),auth[_0x6e4b('0xa')](),controller['destroy']);module[_0x6e4b('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 2123406..7b64622 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 _0x69d3=['TEXT','BOOLEAN','out','sequelize','exports'];(function(_0x5840a5,_0x374e6c){var _0x2d3e92=function(_0x96cad4){while(--_0x96cad4){_0x5840a5['push'](_0x5840a5['shift']());}};_0x2d3e92(++_0x374e6c);}(_0x69d3,0xda));var _0x369d=function(_0x5f598a,_0x21cffb){_0x5f598a=_0x5f598a-0x0;var _0x33845a=_0x69d3[_0x5f598a];return _0x33845a;};'use strict';var Sequelize=require(_0x369d('0x0'));module[_0x369d('0x1')]={'body':{'type':Sequelize[_0x369d('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x369d('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x369d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x369d('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x369d('0x2')]}};
\ No newline at end of file
+var _0x2fe3=['ENUM','DATE','STRING','sequelize','exports','BOOLEAN'];(function(_0x1717ad,_0x12b953){var _0x153a6e=function(_0x6c3348){while(--_0x6c3348){_0x1717ad['push'](_0x1717ad['shift']());}};_0x153a6e(++_0x12b953);}(_0x2fe3,0x87));var _0x32fe=function(_0x3824b2,_0x335028){_0x3824b2=_0x3824b2-0x0;var _0x19a232=_0x2fe3[_0x3824b2];return _0x19a232;};'use strict';var Sequelize=require(_0x32fe('0x0'));module[_0x32fe('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x32fe('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x32fe('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x32fe('0x4')]},'providerName':{'type':Sequelize[_0x32fe('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 287c733..2dd8739 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 _0x04af=['agent','ChatInteraction','ChatInteractionId','update','isNil','read1stAt','interaction','get','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','channel','motionChannel','event','acceptmessage','parse','formData','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','Sequelize','email','EventManager','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatMessage.socket','register','jayson/promise','http','client','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','destroy','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','options','includeAll','ChatMessage','findAll','show','params','length','find','create','body','describe','chat-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user'];(function(_0x3f29fe,_0x4f7a72){var _0x5da19c=function(_0x15d9eb){while(--_0x15d9eb){_0x3f29fe['push'](_0x3f29fe['shift']());}};_0x5da19c(++_0x4f7a72);}(_0x04af,0x1ac));var _0xf04a=function(_0x168cb7,_0x5c802a){_0x168cb7=_0x168cb7-0x0;var _0x5086ef=_0x04af[_0x168cb7];return _0x5086ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf04a('0x0'));var zipdir=require(_0xf04a('0x1'));var jsonpatch=require(_0xf04a('0x2'));var rp=require(_0xf04a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf04a('0x4'));var util=require(_0xf04a('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xf04a('0x6'));var ejs=require(_0xf04a('0x7'));var fs=require('fs');var fs_extra=require(_0xf04a('0x8'));var _=require(_0xf04a('0x9'));var squel=require('squel');var crypto=require(_0xf04a('0xa'));var jsforce=require(_0xf04a('0xb'));var deskjs=require(_0xf04a('0xc'));var toCsv=require(_0xf04a('0x6'));var querystring=require(_0xf04a('0xd'));var Papa=require(_0xf04a('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf04a('0xf'));var as=require(_0xf04a('0x10'));var hardwareService=require(_0xf04a('0x11'));var logger=require(_0xf04a('0x12'))(_0xf04a('0x13'));var utils=require(_0xf04a('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf04a('0x15'))['db'];config['redis']=_[_0xf04a('0x16')](config['redis'],{'host':_0xf04a('0x17'),'port':0x18eb});var socket=require(_0xf04a('0x18'))(new Redis(config[_0xf04a('0x19')]));require(_0xf04a('0x1a'))[_0xf04a('0x1b')](socket);var jayson=require(_0xf04a('0x1c'));var client=jayson['client'][_0xf04a('0x1d')]({'port':0x232c});var client9002=jayson[_0xf04a('0x1e')][_0xf04a('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x29ce0e,_0x46958a,_0x512f1c,_0x4b9941){return new BPromise(function(_0x4d542b,_0x455e9f){var _0x490996=_0x4b9941||client;return _0x490996[_0xf04a('0x1f')](_0x29ce0e,_0x512f1c)[_0xf04a('0x20')](function(_0x499744){logger[_0xf04a('0x21')](_0xf04a('0x22'),_0x46958a,'request\x20sent');logger[_0xf04a('0x23')](_0xf04a('0x24'),_0x46958a,'request\x20sent',JSON[_0xf04a('0x25')](_0x499744));if(_0x499744[_0xf04a('0x26')]){if(_0x499744['error'][_0xf04a('0x27')]===0x1f4){logger[_0xf04a('0x26')]('ChatMessage,\x20%s,\x20%s',_0x46958a,_0x499744['error']['message']);return _0x455e9f(_0x499744['error'][_0xf04a('0x28')]);}logger[_0xf04a('0x26')](_0xf04a('0x22'),_0x46958a,_0x499744[_0xf04a('0x26')][_0xf04a('0x28')]);return _0x4d542b(_0x499744['error'][_0xf04a('0x28')]);}else{logger[_0xf04a('0x21')](_0xf04a('0x22'),_0x46958a,_0xf04a('0x29'));_0x4d542b(_0x499744[_0xf04a('0x2a')][_0xf04a('0x28')]);}})[_0xf04a('0x2b')](function(_0x443352){logger['error']('ChatMessage,\x20%s,\x20%s',_0x46958a,_0x443352);_0x455e9f(_0x443352);});});}function respondWithStatusCode(_0x1538e3,_0x45124c){_0x45124c=_0x45124c||0xcc;return function(_0x4da877){if(_0x4da877){return _0x1538e3[_0xf04a('0x2c')](_0x45124c);}return _0x1538e3[_0xf04a('0x2d')](_0x45124c)[_0xf04a('0x2e')]();};}function respondWithResult(_0x5846ee,_0x5daf65){_0x5daf65=_0x5daf65||0xc8;return function(_0x4767b1){if(_0x4767b1){return _0x5846ee[_0xf04a('0x2d')](_0x5daf65)[_0xf04a('0x2f')](_0x4767b1);}};}function respondWithFilteredResult(_0x586e1a,_0x3ec0cf){return function(_0x151ccd){if(_0x151ccd){var _0x5ee698=typeof _0x3ec0cf['offset']===_0xf04a('0x30')&&typeof _0x3ec0cf[_0xf04a('0x31')]===_0xf04a('0x30');var _0x5a265f=_0x151ccd[_0xf04a('0x32')];var _0x1901cf=_0x5ee698?0x0:_0x3ec0cf[_0xf04a('0x33')];var _0x28b533=_0x5ee698?_0x151ccd['count']:_0x3ec0cf[_0xf04a('0x33')]+_0x3ec0cf[_0xf04a('0x31')];var _0x2bc079;if(_0x28b533>=_0x5a265f){_0x28b533=_0x5a265f;_0x2bc079=0xc8;}else{_0x2bc079=0xce;}_0x586e1a[_0xf04a('0x2d')](_0x2bc079);return _0x586e1a[_0xf04a('0x34')](_0xf04a('0x35'),_0x1901cf+'-'+_0x28b533+'/'+_0x5a265f)[_0xf04a('0x2f')](_0x151ccd);}return null;};}function patchUpdates(_0x4fd861){return function(_0x4327be){try{jsonpatch[_0xf04a('0x36')](_0x4327be,_0x4fd861,!![]);}catch(_0x3ead78){return BPromise['reject'](_0x3ead78);}return _0x4327be[_0xf04a('0x37')]();};}function saveUpdates(_0xa74127,_0x1c796d){return function(_0x17b373){if(_0x17b373){return _0x17b373['update'](_0xa74127)['then'](function(_0x24aa70){return _0x24aa70;});}return null;};}function removeEntity(_0x201e03,_0x5cd761){return function(_0x118f9c){if(_0x118f9c){return _0x118f9c[_0xf04a('0x38')]()[_0xf04a('0x20')](function(){_0x201e03['status'](0xcc)[_0xf04a('0x2e')]();});}};}function handleEntityNotFound(_0x40d943,_0x516bd4){return function(_0x4bc4be){if(!_0x4bc4be){_0x40d943[_0xf04a('0x2c')](0x194);}return _0x4bc4be;};}function handleError(_0x3aefd5,_0x231ce0){_0x231ce0=_0x231ce0||0x1f4;return function(_0x4001cc){logger[_0xf04a('0x26')](_0x4001cc[_0xf04a('0x39')]);if(_0x4001cc[_0xf04a('0x3a')]){delete _0x4001cc[_0xf04a('0x3a')];}_0x3aefd5[_0xf04a('0x2d')](_0x231ce0)[_0xf04a('0x3b')](_0x4001cc);};}exports[_0xf04a('0x3c')]=function(_0x10b891,_0x325624){var _0x81b408={},_0x2f90dd={},_0x1fa523={'count':0x0,'rows':[]};var _0xdc8b6e=_[_0xf04a('0x3d')](db['ChatMessage'][_0xf04a('0x3e')],function(_0x41d841){return{'name':_0x41d841['fieldName'],'type':_0x41d841[_0xf04a('0x3f')]['key']};});_0x2f90dd[_0xf04a('0x40')]=_[_0xf04a('0x3d')](_0xdc8b6e,_0xf04a('0x3a'));_0x2f90dd[_0xf04a('0x41')]=_[_0xf04a('0x42')](_0x10b891[_0xf04a('0x41')]);_0x2f90dd[_0xf04a('0x43')]=_[_0xf04a('0x44')](_0x2f90dd['model'],_0x2f90dd[_0xf04a('0x41')]);_0x81b408[_0xf04a('0x45')]=_[_0xf04a('0x44')](_0x2f90dd[_0xf04a('0x40')],qs['fields'](_0x10b891[_0xf04a('0x41')][_0xf04a('0x46')]));_0x81b408[_0xf04a('0x45')]=_0x81b408[_0xf04a('0x45')]['length']?_0x81b408[_0xf04a('0x45')]:_0x2f90dd['model'];if(!_0x10b891['query'][_0xf04a('0x47')]('nolimit')){_0x81b408[_0xf04a('0x31')]=qs[_0xf04a('0x31')](_0x10b891[_0xf04a('0x41')][_0xf04a('0x31')]);_0x81b408['offset']=qs[_0xf04a('0x33')](_0x10b891['query'][_0xf04a('0x33')]);}_0x81b408[_0xf04a('0x48')]=qs[_0xf04a('0x49')](_0x10b891[_0xf04a('0x41')]['sort']);_0x81b408[_0xf04a('0x4a')]=qs[_0xf04a('0x43')](_['pick'](_0x10b891[_0xf04a('0x41')],_0x2f90dd[_0xf04a('0x43')]),_0xdc8b6e);if(_0x10b891[_0xf04a('0x41')]['filter']){_0x81b408['where']=_[_0xf04a('0x4b')](_0x81b408[_0xf04a('0x4a')],{'$or':_[_0xf04a('0x3d')](_0xdc8b6e,function(_0x554d2c){if(_0x554d2c[_0xf04a('0x3f')]!==_0xf04a('0x4c')){var _0x240675={};_0x240675[_0x554d2c[_0xf04a('0x3a')]]={'$like':'%'+_0x10b891['query']['filter']+'%'};return _0x240675;}})});}_0x81b408=_[_0xf04a('0x4b')]({},_0x81b408,_0x10b891[_0xf04a('0x4d')]);var _0x1d8f5e={'where':_0x81b408[_0xf04a('0x4a')]};return db['ChatMessage'][_0xf04a('0x32')](_0x1d8f5e)['then'](function(_0x5e5f6b){_0x1fa523[_0xf04a('0x32')]=_0x5e5f6b;if(_0x10b891[_0xf04a('0x41')][_0xf04a('0x4e')]){_0x81b408['include']=[{'all':!![]}];}return db[_0xf04a('0x4f')][_0xf04a('0x50')](_0x81b408);})['then'](function(_0x3285c1){_0x1fa523['rows']=_0x3285c1;return _0x1fa523;})[_0xf04a('0x20')](respondWithFilteredResult(_0x325624,_0x81b408))[_0xf04a('0x2b')](handleError(_0x325624,null));};exports[_0xf04a('0x51')]=function(_0xeed8d4,_0x40c031){var _0x16d1fb={'raw':!![],'where':{'id':_0xeed8d4[_0xf04a('0x52')]['id']}},_0x2f39c2={};_0x2f39c2[_0xf04a('0x40')]=_[_0xf04a('0x42')](db['ChatMessage'][_0xf04a('0x3e')]);_0x2f39c2['query']=_[_0xf04a('0x42')](_0xeed8d4[_0xf04a('0x41')]);_0x2f39c2['filters']=_[_0xf04a('0x44')](_0x2f39c2[_0xf04a('0x40')],_0x2f39c2[_0xf04a('0x41')]);_0x16d1fb[_0xf04a('0x45')]=_[_0xf04a('0x44')](_0x2f39c2[_0xf04a('0x40')],qs[_0xf04a('0x46')](_0xeed8d4['query']['fields']));_0x16d1fb['attributes']=_0x16d1fb[_0xf04a('0x45')][_0xf04a('0x53')]?_0x16d1fb[_0xf04a('0x45')]:_0x2f39c2[_0xf04a('0x40')];if(_0xeed8d4['query'][_0xf04a('0x4e')]){_0x16d1fb['include']=[{'all':!![]}];}_0x16d1fb=_[_0xf04a('0x4b')]({},_0x16d1fb,_0xeed8d4[_0xf04a('0x4d')]);return db[_0xf04a('0x4f')][_0xf04a('0x54')](_0x16d1fb)[_0xf04a('0x20')](handleEntityNotFound(_0x40c031,null))['then'](respondWithResult(_0x40c031,null))[_0xf04a('0x2b')](handleError(_0x40c031,null));};exports[_0xf04a('0x55')]=function(_0x18cc9f,_0x2afcf6){return db[_0xf04a('0x4f')][_0xf04a('0x55')](_0x18cc9f[_0xf04a('0x56')],{})[_0xf04a('0x20')](respondWithResult(_0x2afcf6,0xc9))[_0xf04a('0x2b')](handleError(_0x2afcf6,null));};exports['update']=function(_0x574b5b,_0x16c782){if(_0x574b5b[_0xf04a('0x56')]['id']){delete _0x574b5b['body']['id'];}return db['ChatMessage']['find']({'where':{'id':_0x574b5b[_0xf04a('0x52')]['id']}})[_0xf04a('0x20')](handleEntityNotFound(_0x16c782,null))[_0xf04a('0x20')](saveUpdates(_0x574b5b[_0xf04a('0x56')],null))[_0xf04a('0x20')](respondWithResult(_0x16c782,null))[_0xf04a('0x2b')](handleError(_0x16c782,null));};exports[_0xf04a('0x38')]=function(_0x47c4e1,_0x372549){return db['ChatMessage']['find']({'where':{'id':_0x47c4e1[_0xf04a('0x52')]['id']}})[_0xf04a('0x20')](handleEntityNotFound(_0x372549,null))['then'](removeEntity(_0x372549,null))['catch'](handleError(_0x372549,null));};exports[_0xf04a('0x57')]=function(_0x4cafa9,_0x5f479e){return db['ChatMessage'][_0xf04a('0x57')]()['then'](respondWithResult(_0x5f479e,null))[_0xf04a('0x2b')](handleError(_0x5f479e,null));};var interaction_log=require(_0xf04a('0x12'))(_0xf04a('0x58'));exports[_0xf04a('0x59')]=function(_0x9b1192,_0x4a3708,_0x13e5a6){var _0x52d430={'agent':{},'channel':'chat'};if(_0x9b1192[_0xf04a('0x56')]['id']){delete _0x9b1192[_0xf04a('0x56')]['id'];}_0x9b1192[_0xf04a('0x56')][_0xf04a('0x5a')]=!![];_0x9b1192[_0xf04a('0x56')][_0xf04a('0x5b')]=moment()[_0xf04a('0x5c')](_0xf04a('0x5d'));_0x9b1192[_0xf04a('0x56')][_0xf04a('0x5e')]=_0x9b1192[_0xf04a('0x56')]['UserId']||_0x9b1192[_0xf04a('0x5f')]['id'];_0x52d430[_0xf04a('0x60')]['id']=_0x9b1192['body']['UserId'];return db[_0xf04a('0x4f')][_0xf04a('0x54')]({'where':{'id':_0x9b1192['params']['id'],'UserId':null}})[_0xf04a('0x20')](handleEntityNotFound(_0x4a3708,null))[_0xf04a('0x20')](saveUpdates(_0x9b1192[_0xf04a('0x56')],null))[_0xf04a('0x20')](function(_0x50a43c){if(_0x50a43c){_0x52d430['message']=_0x50a43c['get']({'plain':!![]});return db[_0xf04a('0x61')][_0xf04a('0x54')]({'where':{'id':_0x50a43c[_0xf04a('0x62')]}});}return null;})[_0xf04a('0x20')](handleEntityNotFound(_0x4a3708,null))[_0xf04a('0x20')](function(_0x1a079a){if(_0x1a079a){return _0x1a079a[_0xf04a('0x63')]({'UserId':_0x9b1192[_0xf04a('0x56')][_0xf04a('0x5e')],'read1stAt':_[_0xf04a('0x64')](_0x1a079a[_0xf04a('0x65')])?moment()[_0xf04a('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xf04a('0x20')](function(_0xbd18fe){if(_0xbd18fe){_0x52d430[_0xf04a('0x66')]=_0xbd18fe[_0xf04a('0x67')]({'plain':!![]});interaction_log[_0xf04a('0x21')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x9b1192[_0xf04a('0x5f')]['id'],_0x9b1192[_0xf04a('0x5f')][_0xf04a('0x3a')],_0x9b1192[_0xf04a('0x5f')][_0xf04a('0x68')],_0x52d430[_0xf04a('0x66')]['id'],_0x9b1192[_0xf04a('0x56')]?JSON[_0xf04a('0x25')](_0x9b1192[_0xf04a('0x56')]):_0xf04a('0x69'));return respondWithRpcPromise(_0xf04a('0x6a'),'acceptMessage',_0x52d430);}return null;})[_0xf04a('0x20')](function(_0x1901c1){var _0x37cd3c=_0xf04a('0x6b')+_0x1901c1[_0xf04a('0x28')]['ContactId'];return db['sequelize']['query'](_0x37cd3c,{'type':db['Sequelize'][_0xf04a('0x6c')][_0xf04a('0x6d')],'raw':!![]})['then'](function(_0x49fc83){return _0x49fc83;});})[_0xf04a('0x20')](function(_0x13b26c){if(_0x13b26c){_0x52d430['message'][_0xf04a('0x6e')]=_0x13b26c[0x0];if(!_0x9b1192[_0xf04a('0x56')]['UserId'])return;return db[_0xf04a('0x6f')][_0xf04a('0x54')]({'where':{'id':_0x9b1192[_0xf04a('0x56')][_0xf04a('0x5e')],'role':_0xf04a('0x60')},'attributes':['id','name',_0xf04a('0x70'),'email',_0xf04a('0x71')],'raw':!![]});}return null;})[_0xf04a('0x20')](function(_0x3bd762){if(!_0x3bd762)return null;_0x52d430[_0xf04a('0x28')][_0xf04a('0x60')]=_0x3bd762;return _0x52d430;})['then'](function(_0x4ba8ef){if(_0x4ba8ef){if(_0x9b1192[_0xf04a('0x56')][_0xf04a('0x72')]){_0x52d430[_0xf04a('0x28')][_0xf04a('0x73')]=util[_0xf04a('0x5c')]('SIP/%s',_0x9b1192[_0xf04a('0x5f')][_0xf04a('0x3a')]);_0x52d430[_0xf04a('0x28')][_0xf04a('0x74')]=_0x52d430[_0xf04a('0x74')];_0x52d430[_0xf04a('0x28')][_0xf04a('0x75')]=_0x52d430['channel'];_0x52d430[_0xf04a('0x28')][_0xf04a('0x76')]=_0xf04a('0x59');return respondWithRpcPromise('EventManager','EventManager',{'event':_0xf04a('0x77'),'message':_[_0xf04a('0x4b')](_0x52d430[_0xf04a('0x28')],JSON[_0xf04a('0x78')](_0x52d430[_0xf04a('0x66')][_0xf04a('0x79')]))},client9002)[_0xf04a('0x20')](function(){return _0x52d430;});}return _0x52d430;}return null;})[_0xf04a('0x20')](respondWithResult(_0x4a3708,null))[_0xf04a('0x2b')](handleError(_0x4a3708,null));};var interaction_log=require(_0xf04a('0x12'))(_0xf04a('0x58'));exports[_0xf04a('0x7a')]=function(_0x2bb4a1,_0x272833,_0x31c875){var _0x403c82={'agent':{},'channel':'chat'};if(_0x2bb4a1[_0xf04a('0x56')]['id']){delete _0x2bb4a1['body']['id'];}_0x2bb4a1[_0xf04a('0x56')][_0xf04a('0x5e')]=_0x2bb4a1[_0xf04a('0x56')]['UserId']||_0x2bb4a1['user']['id'];_0x403c82[_0xf04a('0x60')]['id']=_0x2bb4a1[_0xf04a('0x56')][_0xf04a('0x5e')];return db[_0xf04a('0x4f')][_0xf04a('0x54')]({'where':{'id':_0x2bb4a1[_0xf04a('0x52')]['id'],'UserId':null}})[_0xf04a('0x20')](handleEntityNotFound(_0x272833,null))[_0xf04a('0x20')](function(_0x3ed5c4){if(_0x3ed5c4){_0x403c82[_0xf04a('0x28')]=_0x3ed5c4['get']({'plain':!![]});return db[_0xf04a('0x61')][_0xf04a('0x54')]({'where':{'id':_0x3ed5c4['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x272833,null))[_0xf04a('0x20')](function(_0x3b44b8){if(_0x3b44b8){_0x403c82[_0xf04a('0x66')]=_0x3b44b8[_0xf04a('0x67')]({'plain':!![]});interaction_log[_0xf04a('0x21')](_0xf04a('0x7b'),_0x2bb4a1[_0xf04a('0x5f')]['id'],_0x2bb4a1[_0xf04a('0x5f')][_0xf04a('0x3a')],_0x2bb4a1[_0xf04a('0x5f')][_0xf04a('0x68')],_0x403c82[_0xf04a('0x66')]['id'],_0x2bb4a1['body']?JSON['stringify'](_0x2bb4a1[_0xf04a('0x56')]):_0xf04a('0x69'));return respondWithRpcPromise(_0xf04a('0x7c'),_0xf04a('0x7d'),_0x403c82);}return null;})[_0xf04a('0x20')](function(_0xe02a40){var _0x330e71=_0xf04a('0x6b')+_0xe02a40[_0xf04a('0x28')]['ContactId'];return db[_0xf04a('0x7e')]['query'](_0x330e71,{'type':db[_0xf04a('0x7f')][_0xf04a('0x6c')][_0xf04a('0x6d')],'raw':!![]})['then'](function(_0x4cf898){return _0x4cf898;});})[_0xf04a('0x20')](function(_0x523325){if(_0x523325){_0x403c82[_0xf04a('0x28')][_0xf04a('0x6e')]=_0x523325[0x0];if(!_0x2bb4a1['body'][_0xf04a('0x5e')])return;return db[_0xf04a('0x6f')]['find']({'where':{'id':_0x2bb4a1[_0xf04a('0x56')][_0xf04a('0x5e')],'role':'agent'},'attributes':['id',_0xf04a('0x3a'),_0xf04a('0x70'),_0xf04a('0x80'),'internal'],'raw':!![]});}return null;})[_0xf04a('0x20')](function(_0x211011){if(!_0x211011)return null;_0x403c82['message'][_0xf04a('0x60')]=_0x211011;return _0x403c82;})['then'](function(_0x318cfe){if(_0x318cfe){_0x318cfe['message'][_0xf04a('0x73')]=util[_0xf04a('0x5c')]('SIP/%s',_0x2bb4a1['user'][_0xf04a('0x3a')]);_0x318cfe['message'][_0xf04a('0x74')]=_0x403c82[_0xf04a('0x74')];_0x318cfe[_0xf04a('0x28')]['motionChannel']=_0x403c82['channel'];_0x318cfe[_0xf04a('0x28')][_0xf04a('0x76')]=_0xf04a('0x7a');respondWithRpcPromise('EventManager',_0xf04a('0x81'),{'event':_0xf04a('0x82'),'message':_[_0xf04a('0x4b')](_0x403c82[_0xf04a('0x28')],JSON[_0xf04a('0x78')](_0x403c82['interaction']['formData']))},client9002);return _0x403c82;}return null;})[_0xf04a('0x20')](respondWithResult(_0x272833,null))[_0xf04a('0x2b')](handleError(_0x272833,null));};
\ No newline at end of file
+var _0xc4a1=['result','catch','sendStatus','status','end','count','offset','limit','set','apply','save','update','destroy','stack','name','index','map','ChatMessage','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','then','includeAll','include','findAll','rows','params','rawAttributes','options','find','create','body','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','User','agent','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','formData','get','role','RejectMessage','rejectMessage','sequelize','QueryTypes','contact','interface','parse','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','info','request\x20sent','debug','error','code','ChatMessage,\x20%s,\x20%s','message'];(function(_0x14e632,_0x10917d){var _0x11d216=function(_0x44d132){while(--_0x44d132){_0x14e632['push'](_0x14e632['shift']());}};_0x11d216(++_0x10917d);}(_0xc4a1,0x1e5));var _0x1c4a=function(_0x462d34,_0x132731){_0x462d34=_0x462d34-0x0;var _0x1b0e53=_0xc4a1[_0x462d34];return _0x1b0e53;};'use strict';var emlformat=require(_0x1c4a('0x0'));var rimraf=require(_0x1c4a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1c4a('0x2'));var rp=require(_0x1c4a('0x3'));var moment=require(_0x1c4a('0x4'));var BPromise=require(_0x1c4a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1c4a('0x6'));var sox=require(_0x1c4a('0x7'));var csv=require(_0x1c4a('0x8'));var ejs=require(_0x1c4a('0x9'));var fs=require('fs');var fs_extra=require(_0x1c4a('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1c4a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1c4a('0x8'));var querystring=require(_0x1c4a('0xc'));var Papa=require('papaparse');var Redis=require(_0x1c4a('0xd'));var authService=require(_0x1c4a('0xe'));var qs=require(_0x1c4a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1c4a('0x10'));var logger=require(_0x1c4a('0x11'))(_0x1c4a('0x12'));var utils=require(_0x1c4a('0x13'));var config=require(_0x1c4a('0x14'));var licenseUtil=require(_0x1c4a('0x15'));var db=require(_0x1c4a('0x16'))['db'];config[_0x1c4a('0x17')]=_[_0x1c4a('0x18')](config['redis'],{'host':_0x1c4a('0x19'),'port':0x18eb});var socket=require(_0x1c4a('0x1a'))(new Redis(config[_0x1c4a('0x17')]));require(_0x1c4a('0x1b'))['register'](socket);var jayson=require(_0x1c4a('0x1c'));var client=jayson[_0x1c4a('0x1d')][_0x1c4a('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x1c4a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x539e46,_0x3600c6,_0xdd99e1,_0x8911ac){return new BPromise(function(_0x4be33f,_0x45186b){var _0x38a6bc=_0x8911ac||client;return _0x38a6bc[_0x1c4a('0x1f')](_0x539e46,_0xdd99e1)['then'](function(_0xc074c4){logger[_0x1c4a('0x20')]('ChatMessage,\x20%s,\x20%s',_0x3600c6,_0x1c4a('0x21'));logger[_0x1c4a('0x22')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3600c6,_0x1c4a('0x21'),JSON['stringify'](_0xc074c4));if(_0xc074c4[_0x1c4a('0x23')]){if(_0xc074c4[_0x1c4a('0x23')][_0x1c4a('0x24')]===0x1f4){logger[_0x1c4a('0x23')](_0x1c4a('0x25'),_0x3600c6,_0xc074c4[_0x1c4a('0x23')][_0x1c4a('0x26')]);return _0x45186b(_0xc074c4[_0x1c4a('0x23')]['message']);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x3600c6,_0xc074c4[_0x1c4a('0x23')][_0x1c4a('0x26')]);return _0x4be33f(_0xc074c4[_0x1c4a('0x23')][_0x1c4a('0x26')]);}else{logger[_0x1c4a('0x20')](_0x1c4a('0x25'),_0x3600c6,_0x1c4a('0x21'));_0x4be33f(_0xc074c4[_0x1c4a('0x27')]['message']);}})[_0x1c4a('0x28')](function(_0xe0f854){logger[_0x1c4a('0x23')]('ChatMessage,\x20%s,\x20%s',_0x3600c6,_0xe0f854);_0x45186b(_0xe0f854);});});}function respondWithStatusCode(_0x45a9df,_0x28773b){_0x28773b=_0x28773b||0xcc;return function(_0x481aa3){if(_0x481aa3){return _0x45a9df[_0x1c4a('0x29')](_0x28773b);}return _0x45a9df[_0x1c4a('0x2a')](_0x28773b)[_0x1c4a('0x2b')]();};}function respondWithResult(_0x402eb6,_0x16de1c){_0x16de1c=_0x16de1c||0xc8;return function(_0x5200fc){if(_0x5200fc){return _0x402eb6[_0x1c4a('0x2a')](_0x16de1c)['json'](_0x5200fc);}};}function respondWithFilteredResult(_0x1f04c5,_0x11a2db){return function(_0x4268e5){if(_0x4268e5){var _0x34ee13=typeof _0x11a2db['offset']==='undefined'&&typeof _0x11a2db['limit']==='undefined';var _0x424080=_0x4268e5[_0x1c4a('0x2c')];var _0x5b8808=_0x34ee13?0x0:_0x11a2db[_0x1c4a('0x2d')];var _0x3c538b=_0x34ee13?_0x4268e5[_0x1c4a('0x2c')]:_0x11a2db[_0x1c4a('0x2d')]+_0x11a2db[_0x1c4a('0x2e')];var _0x149aeb;if(_0x3c538b>=_0x424080){_0x3c538b=_0x424080;_0x149aeb=0xc8;}else{_0x149aeb=0xce;}_0x1f04c5[_0x1c4a('0x2a')](_0x149aeb);return _0x1f04c5[_0x1c4a('0x2f')]('Content-Range',_0x5b8808+'-'+_0x3c538b+'/'+_0x424080)['json'](_0x4268e5);}return null;};}function patchUpdates(_0x1e73a4){return function(_0x1162e7){try{jsonpatch[_0x1c4a('0x30')](_0x1162e7,_0x1e73a4,!![]);}catch(_0x30f69e){return BPromise['reject'](_0x30f69e);}return _0x1162e7[_0x1c4a('0x31')]();};}function saveUpdates(_0x14ca89,_0x168c42){return function(_0x42bfc5){if(_0x42bfc5){return _0x42bfc5[_0x1c4a('0x32')](_0x14ca89)['then'](function(_0x5a8993){return _0x5a8993;});}return null;};}function removeEntity(_0xe228ec,_0x4b7b29){return function(_0x21d69f){if(_0x21d69f){return _0x21d69f[_0x1c4a('0x33')]()['then'](function(){_0xe228ec[_0x1c4a('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ed329,_0x1ee4ef){return function(_0x2e5b25){if(!_0x2e5b25){_0x3ed329['sendStatus'](0x194);}return _0x2e5b25;};}function handleError(_0x2987c3,_0x38146c){_0x38146c=_0x38146c||0x1f4;return function(_0x39e64a){logger[_0x1c4a('0x23')](_0x39e64a[_0x1c4a('0x34')]);if(_0x39e64a[_0x1c4a('0x35')]){delete _0x39e64a[_0x1c4a('0x35')];}_0x2987c3[_0x1c4a('0x2a')](_0x38146c)['send'](_0x39e64a);};}exports[_0x1c4a('0x36')]=function(_0x5b9e56,_0x5a3c54){var _0x2fe862={},_0x5df219={},_0x244b58={'count':0x0,'rows':[]};var _0x46e3c3=_[_0x1c4a('0x37')](db[_0x1c4a('0x38')]['rawAttributes'],function(_0x1c3b98){return{'name':_0x1c3b98[_0x1c4a('0x39')],'type':_0x1c3b98[_0x1c4a('0x3a')][_0x1c4a('0x3b')]};});_0x5df219[_0x1c4a('0x3c')]=_['map'](_0x46e3c3,'name');_0x5df219[_0x1c4a('0x3d')]=_[_0x1c4a('0x3e')](_0x5b9e56[_0x1c4a('0x3d')]);_0x5df219['filters']=_['intersection'](_0x5df219[_0x1c4a('0x3c')],_0x5df219[_0x1c4a('0x3d')]);_0x2fe862[_0x1c4a('0x3f')]=_[_0x1c4a('0x40')](_0x5df219['model'],qs[_0x1c4a('0x41')](_0x5b9e56[_0x1c4a('0x3d')][_0x1c4a('0x41')]));_0x2fe862['attributes']=_0x2fe862['attributes'][_0x1c4a('0x42')]?_0x2fe862[_0x1c4a('0x3f')]:_0x5df219['model'];if(!_0x5b9e56[_0x1c4a('0x3d')][_0x1c4a('0x43')](_0x1c4a('0x44'))){_0x2fe862[_0x1c4a('0x2e')]=qs[_0x1c4a('0x2e')](_0x5b9e56[_0x1c4a('0x3d')][_0x1c4a('0x2e')]);_0x2fe862[_0x1c4a('0x2d')]=qs[_0x1c4a('0x2d')](_0x5b9e56[_0x1c4a('0x3d')][_0x1c4a('0x2d')]);}_0x2fe862[_0x1c4a('0x45')]=qs['sort'](_0x5b9e56[_0x1c4a('0x3d')][_0x1c4a('0x46')]);_0x2fe862[_0x1c4a('0x47')]=qs[_0x1c4a('0x48')](_[_0x1c4a('0x49')](_0x5b9e56[_0x1c4a('0x3d')],_0x5df219[_0x1c4a('0x48')]),_0x46e3c3);if(_0x5b9e56[_0x1c4a('0x3d')][_0x1c4a('0x4a')]){_0x2fe862[_0x1c4a('0x47')]=_[_0x1c4a('0x4b')](_0x2fe862['where'],{'$or':_['map'](_0x46e3c3,function(_0x49e868){if(_0x49e868['type']!==_0x1c4a('0x4c')){var _0x1bfe9d={};_0x1bfe9d[_0x49e868[_0x1c4a('0x35')]]={'$like':'%'+_0x5b9e56[_0x1c4a('0x3d')]['filter']+'%'};return _0x1bfe9d;}})});}_0x2fe862=_[_0x1c4a('0x4b')]({},_0x2fe862,_0x5b9e56['options']);var _0x5caf00={'where':_0x2fe862[_0x1c4a('0x47')]};return db['ChatMessage']['count'](_0x5caf00)[_0x1c4a('0x4d')](function(_0x3d4b59){_0x244b58[_0x1c4a('0x2c')]=_0x3d4b59;if(_0x5b9e56[_0x1c4a('0x3d')][_0x1c4a('0x4e')]){_0x2fe862[_0x1c4a('0x4f')]=[{'all':!![]}];}return db[_0x1c4a('0x38')][_0x1c4a('0x50')](_0x2fe862);})['then'](function(_0x152f2b){_0x244b58[_0x1c4a('0x51')]=_0x152f2b;return _0x244b58;})[_0x1c4a('0x4d')](respondWithFilteredResult(_0x5a3c54,_0x2fe862))[_0x1c4a('0x28')](handleError(_0x5a3c54,null));};exports['show']=function(_0x35bc26,_0x4fd8d1){var _0x59f6af={'raw':!![],'where':{'id':_0x35bc26[_0x1c4a('0x52')]['id']}},_0x5ab6f7={};_0x5ab6f7[_0x1c4a('0x3c')]=_['keys'](db[_0x1c4a('0x38')][_0x1c4a('0x53')]);_0x5ab6f7[_0x1c4a('0x3d')]=_[_0x1c4a('0x3e')](_0x35bc26['query']);_0x5ab6f7[_0x1c4a('0x48')]=_['intersection'](_0x5ab6f7[_0x1c4a('0x3c')],_0x5ab6f7['query']);_0x59f6af[_0x1c4a('0x3f')]=_[_0x1c4a('0x40')](_0x5ab6f7[_0x1c4a('0x3c')],qs[_0x1c4a('0x41')](_0x35bc26[_0x1c4a('0x3d')][_0x1c4a('0x41')]));_0x59f6af['attributes']=_0x59f6af[_0x1c4a('0x3f')][_0x1c4a('0x42')]?_0x59f6af[_0x1c4a('0x3f')]:_0x5ab6f7[_0x1c4a('0x3c')];if(_0x35bc26[_0x1c4a('0x3d')][_0x1c4a('0x4e')]){_0x59f6af[_0x1c4a('0x4f')]=[{'all':!![]}];}_0x59f6af=_['merge']({},_0x59f6af,_0x35bc26[_0x1c4a('0x54')]);return db[_0x1c4a('0x38')][_0x1c4a('0x55')](_0x59f6af)[_0x1c4a('0x4d')](handleEntityNotFound(_0x4fd8d1,null))[_0x1c4a('0x4d')](respondWithResult(_0x4fd8d1,null))['catch'](handleError(_0x4fd8d1,null));};exports['create']=function(_0x26d96a,_0x4d9115){return db['ChatMessage'][_0x1c4a('0x56')](_0x26d96a['body'],{})[_0x1c4a('0x4d')](respondWithResult(_0x4d9115,0xc9))[_0x1c4a('0x28')](handleError(_0x4d9115,null));};exports[_0x1c4a('0x32')]=function(_0x4ab690,_0x20fb0d){if(_0x4ab690[_0x1c4a('0x57')]['id']){delete _0x4ab690[_0x1c4a('0x57')]['id'];}return db[_0x1c4a('0x38')]['find']({'where':{'id':_0x4ab690['params']['id']}})[_0x1c4a('0x4d')](handleEntityNotFound(_0x20fb0d,null))[_0x1c4a('0x4d')](saveUpdates(_0x4ab690['body'],null))[_0x1c4a('0x4d')](respondWithResult(_0x20fb0d,null))[_0x1c4a('0x28')](handleError(_0x20fb0d,null));};exports['destroy']=function(_0x45a05b,_0x285a5a){return db[_0x1c4a('0x38')][_0x1c4a('0x55')]({'where':{'id':_0x45a05b[_0x1c4a('0x52')]['id']}})[_0x1c4a('0x4d')](handleEntityNotFound(_0x285a5a,null))[_0x1c4a('0x4d')](removeEntity(_0x285a5a,null))[_0x1c4a('0x28')](handleError(_0x285a5a,null));};exports['describe']=function(_0x4b872b,_0x1e09d3){return db['ChatMessage']['describe']()[_0x1c4a('0x4d')](respondWithResult(_0x1e09d3,null))[_0x1c4a('0x28')](handleError(_0x1e09d3,null));};var interaction_log=require(_0x1c4a('0x11'))('chat-interactions');exports['accept']=function(_0x26e21b,_0x198283,_0x5cac8a){var _0x5b964d={'agent':{},'channel':_0x1c4a('0x58')};if(_0x26e21b['body']['id']){delete _0x26e21b[_0x1c4a('0x57')]['id'];}_0x26e21b[_0x1c4a('0x57')][_0x1c4a('0x59')]=!![];_0x26e21b[_0x1c4a('0x57')][_0x1c4a('0x5a')]=moment()[_0x1c4a('0x5b')](_0x1c4a('0x5c'));_0x26e21b['body'][_0x1c4a('0x5d')]=_0x26e21b[_0x1c4a('0x57')][_0x1c4a('0x5d')]||_0x26e21b[_0x1c4a('0x5e')]['id'];_0x5b964d['agent']['id']=_0x26e21b[_0x1c4a('0x57')][_0x1c4a('0x5d')];return db['ChatMessage'][_0x1c4a('0x55')]({'where':{'id':_0x26e21b[_0x1c4a('0x52')]['id'],'UserId':null}})[_0x1c4a('0x4d')](handleEntityNotFound(_0x198283,null))[_0x1c4a('0x4d')](saveUpdates(_0x26e21b[_0x1c4a('0x57')],null))[_0x1c4a('0x4d')](function(_0x1179fd){if(_0x1179fd){_0x5b964d['message']=_0x1179fd['get']({'plain':!![]});return db[_0x1c4a('0x5f')][_0x1c4a('0x55')]({'where':{'id':_0x1179fd[_0x1c4a('0x60')]}});}return null;})[_0x1c4a('0x4d')](handleEntityNotFound(_0x198283,null))[_0x1c4a('0x4d')](function(_0x52b288){if(_0x52b288){return _0x52b288[_0x1c4a('0x32')]({'UserId':_0x26e21b[_0x1c4a('0x57')]['UserId'],'read1stAt':_[_0x1c4a('0x61')](_0x52b288[_0x1c4a('0x62')])?moment()['format'](_0x1c4a('0x5c')):undefined});}return null;})[_0x1c4a('0x4d')](function(_0x3d5135){if(_0x3d5135){_0x5b964d[_0x1c4a('0x63')]=_0x3d5135['get']({'plain':!![]});interaction_log[_0x1c4a('0x20')](_0x1c4a('0x64'),_0x26e21b[_0x1c4a('0x5e')]['id'],_0x26e21b[_0x1c4a('0x5e')][_0x1c4a('0x35')],_0x26e21b['user']['role'],_0x5b964d[_0x1c4a('0x63')]['id'],_0x26e21b[_0x1c4a('0x57')]?JSON[_0x1c4a('0x65')](_0x26e21b[_0x1c4a('0x57')]):_0x1c4a('0x66'));return respondWithRpcPromise(_0x1c4a('0x67'),'acceptMessage',_0x5b964d);}return null;})[_0x1c4a('0x4d')](function(_0x155897){var _0x371fb9=_0x1c4a('0x68')+_0x155897[_0x1c4a('0x26')][_0x1c4a('0x69')];return db['sequelize'][_0x1c4a('0x3d')](_0x371fb9,{'type':db[_0x1c4a('0x6a')]['QueryTypes'][_0x1c4a('0x6b')],'raw':!![]})['then'](function(_0x329026){return _0x329026;});})[_0x1c4a('0x4d')](function(_0x48ad86){if(_0x48ad86){_0x5b964d['message']['contact']=_0x48ad86[0x0];if(!_0x26e21b['body'][_0x1c4a('0x5d')])return;return db[_0x1c4a('0x6c')][_0x1c4a('0x55')]({'where':{'id':_0x26e21b[_0x1c4a('0x57')][_0x1c4a('0x5d')],'role':_0x1c4a('0x6d')},'attributes':['id',_0x1c4a('0x35'),_0x1c4a('0x6e'),_0x1c4a('0x6f'),_0x1c4a('0x70')],'raw':!![]});}return null;})['then'](function(_0x597032){if(!_0x597032)return null;_0x5b964d['message'][_0x1c4a('0x6d')]=_0x597032;return _0x5b964d;})[_0x1c4a('0x4d')](function(_0xfb80ce){if(_0xfb80ce){if(_0x26e21b[_0x1c4a('0x57')][_0x1c4a('0x71')]){_0x5b964d[_0x1c4a('0x26')]['interface']=util[_0x1c4a('0x5b')](_0x1c4a('0x72'),_0x26e21b[_0x1c4a('0x5e')][_0x1c4a('0x35')]);_0x5b964d[_0x1c4a('0x26')][_0x1c4a('0x73')]=_0x5b964d['channel'];_0x5b964d[_0x1c4a('0x26')][_0x1c4a('0x74')]=_0x5b964d['channel'];_0x5b964d[_0x1c4a('0x26')][_0x1c4a('0x75')]=_0x1c4a('0x76');return respondWithRpcPromise(_0x1c4a('0x77'),_0x1c4a('0x77'),{'event':_0x1c4a('0x78'),'message':_[_0x1c4a('0x4b')](_0x5b964d[_0x1c4a('0x26')],JSON['parse'](_0x5b964d['interaction'][_0x1c4a('0x79')]))},client9002)[_0x1c4a('0x4d')](function(){return _0x5b964d;});}return _0x5b964d;}return null;})[_0x1c4a('0x4d')](respondWithResult(_0x198283,null))[_0x1c4a('0x28')](handleError(_0x198283,null));};var interaction_log=require(_0x1c4a('0x11'))('chat-interactions');exports['reject']=function(_0x39b480,_0x14748f,_0x140049){var _0x51e44b={'agent':{},'channel':'chat'};if(_0x39b480['body']['id']){delete _0x39b480[_0x1c4a('0x57')]['id'];}_0x39b480[_0x1c4a('0x57')][_0x1c4a('0x5d')]=_0x39b480['body'][_0x1c4a('0x5d')]||_0x39b480[_0x1c4a('0x5e')]['id'];_0x51e44b[_0x1c4a('0x6d')]['id']=_0x39b480[_0x1c4a('0x57')][_0x1c4a('0x5d')];return db[_0x1c4a('0x38')][_0x1c4a('0x55')]({'where':{'id':_0x39b480[_0x1c4a('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x14748f,null))[_0x1c4a('0x4d')](function(_0x326e55){if(_0x326e55){_0x51e44b[_0x1c4a('0x26')]=_0x326e55[_0x1c4a('0x7a')]({'plain':!![]});return db[_0x1c4a('0x5f')]['find']({'where':{'id':_0x326e55['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x14748f,null))['then'](function(_0x5454f5){if(_0x5454f5){_0x51e44b[_0x1c4a('0x63')]=_0x5454f5['get']({'plain':!![]});interaction_log[_0x1c4a('0x20')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x39b480[_0x1c4a('0x5e')]['id'],_0x39b480['user'][_0x1c4a('0x35')],_0x39b480[_0x1c4a('0x5e')][_0x1c4a('0x7b')],_0x51e44b[_0x1c4a('0x63')]['id'],_0x39b480[_0x1c4a('0x57')]?JSON['stringify'](_0x39b480[_0x1c4a('0x57')]):_0x1c4a('0x66'));return respondWithRpcPromise(_0x1c4a('0x7c'),_0x1c4a('0x7d'),_0x51e44b);}return null;})[_0x1c4a('0x4d')](function(_0x5c7813){var _0x13a209=_0x1c4a('0x68')+_0x5c7813[_0x1c4a('0x26')][_0x1c4a('0x69')];return db[_0x1c4a('0x7e')][_0x1c4a('0x3d')](_0x13a209,{'type':db[_0x1c4a('0x6a')][_0x1c4a('0x7f')][_0x1c4a('0x6b')],'raw':!![]})[_0x1c4a('0x4d')](function(_0x4afebf){return _0x4afebf;});})[_0x1c4a('0x4d')](function(_0x56e83a){if(_0x56e83a){_0x51e44b[_0x1c4a('0x26')][_0x1c4a('0x80')]=_0x56e83a[0x0];if(!_0x39b480[_0x1c4a('0x57')]['UserId'])return;return db[_0x1c4a('0x6c')][_0x1c4a('0x55')]({'where':{'id':_0x39b480[_0x1c4a('0x57')][_0x1c4a('0x5d')],'role':_0x1c4a('0x6d')},'attributes':['id','name',_0x1c4a('0x6e'),_0x1c4a('0x6f'),_0x1c4a('0x70')],'raw':!![]});}return null;})[_0x1c4a('0x4d')](function(_0x14633e){if(!_0x14633e)return null;_0x51e44b[_0x1c4a('0x26')][_0x1c4a('0x6d')]=_0x14633e;return _0x51e44b;})[_0x1c4a('0x4d')](function(_0x363b8b){if(_0x363b8b){_0x363b8b['message'][_0x1c4a('0x81')]=util[_0x1c4a('0x5b')](_0x1c4a('0x72'),_0x39b480['user'][_0x1c4a('0x35')]);_0x363b8b[_0x1c4a('0x26')][_0x1c4a('0x73')]=_0x51e44b[_0x1c4a('0x73')];_0x363b8b[_0x1c4a('0x26')][_0x1c4a('0x74')]=_0x51e44b['channel'];_0x363b8b[_0x1c4a('0x26')][_0x1c4a('0x75')]='reject';respondWithRpcPromise('EventManager',_0x1c4a('0x77'),{'event':'rejectmessage','message':_[_0x1c4a('0x4b')](_0x51e44b[_0x1c4a('0x26')],JSON[_0x1c4a('0x82')](_0x51e44b[_0x1c4a('0x63')][_0x1c4a('0x79')]))},client9002);return _0x51e44b;}return null;})[_0x1c4a('0x4d')](respondWithResult(_0x14748f,null))[_0x1c4a('0x28')](handleError(_0x14748f,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 47df007..838f20f 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 _0xd738=['ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x42c108,_0x3845fb){var _0x2c9996=function(_0x54ea99){while(--_0x54ea99){_0x42c108['push'](_0x42c108['shift']());}};_0x2c9996(++_0x3845fb);}(_0xd738,0x13e));var _0x8d73=function(_0x3122ca,_0x560490){_0x3122ca=_0x3122ca-0x0;var _0x364e70=_0xd738[_0x3122ca];return _0x364e70;};'use strict';var EventEmitter=require(_0x8d73('0x0'));var ChatMessage=require(_0x8d73('0x1'))['db'][_0x8d73('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x8d73('0x3')](0x0);var events={'afterCreate':_0x8d73('0x4'),'afterUpdate':_0x8d73('0x5'),'afterDestroy':_0x8d73('0x6')};function emitEvent(_0x40a05c){return function(_0xedfb09,_0x5cdf0e,_0x177540){ChatMessageEvents[_0x8d73('0x7')](_0x40a05c+':'+_0xedfb09['id'],_0xedfb09);ChatMessageEvents[_0x8d73('0x7')](_0x40a05c,_0xedfb09);_0x177540(null);};}for(var e in events){if(events[_0x8d73('0x8')](e)){var event=events[e];ChatMessage[_0x8d73('0x9')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0xdc03=['hasOwnProperty','hook','events','../../mysqldb','ChatMessage','update','remove','emit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdc03,0x172));var _0x3dc0=function(_0x46f286,_0x29a1d1){_0x46f286=_0x46f286-0x0;var _0x4fa39a=_0xdc03[_0x46f286];return _0x4fa39a;};'use strict';var EventEmitter=require(_0x3dc0('0x0'));var ChatMessage=require(_0x3dc0('0x1'))['db'][_0x3dc0('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x3dc0('0x3'),'afterDestroy':_0x3dc0('0x4')};function emitEvent(_0x569d44){return function(_0x5a4313,_0x6fbc4f,_0x22ae05){ChatMessageEvents['emit'](_0x569d44+':'+_0x5a4313['id'],_0x5a4313);ChatMessageEvents[_0x3dc0('0x5')](_0x569d44,_0x5a4313);_0x22ae05(null);};}for(var e in events){if(events[_0x3dc0('0x6')](e)){var event=events[e];ChatMessage[_0x3dc0('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 86e4126..428959f 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 _0x92ba=['request-promise','path','rimraf','../../config/environment','define','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x92ba,0x1ad));var _0xa92b=function(_0x3788fe,_0x3421c9){_0x3788fe=_0x3788fe-0x0;var _0x9deb3=_0x92ba[_0x3788fe];return _0x9deb3;};'use strict';var _=require(_0xa92b('0x0'));var util=require(_0xa92b('0x1'));var logger=require(_0xa92b('0x2'))(_0xa92b('0x3'));var moment=require(_0xa92b('0x4'));var BPromise=require(_0xa92b('0x5'));var rp=require(_0xa92b('0x6'));var fs=require('fs');var path=require(_0xa92b('0x7'));var rimraf=require(_0xa92b('0x8'));var config=require(_0xa92b('0x9'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x537428,_0x14db25){return _0x537428[_0xa92b('0xa')](_0xa92b('0xb'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xa92b('0xc'),'fields':[_0xa92b('0xd')],'type':_0xa92b('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x432634,_0x1e4986,_0x3d9ffe){var _0x3dbbb5=_0x537428[_0xa92b('0xf')];var _0x3aea7e=_0x432634[_0xa92b('0x10')]({'plain':!![]});if(_0x3aea7e[_0xa92b('0x11')][_0xa92b('0x12')]()==='in'||_0x3aea7e[_0xa92b('0x11')][_0xa92b('0x12')]()===_0xa92b('0x13')&&!_0x3aea7e[_0xa92b('0x14')]&&!_[_0xa92b('0x15')](_0x3aea7e['UserId'])){_0x3dbbb5[_0xa92b('0x16')][_0xa92b('0x17')]({'where':{'id':_0x3aea7e['ChatInteractionId']}})['then'](function(_0x7345fc){if(_0x7345fc){_0x7345fc[_0xa92b('0x18')]({'lastMsgAt':_0x3aea7e[_0xa92b('0x19')],'lastMsgDirection':_0x3aea7e[_0xa92b('0x11')][_0xa92b('0x12')]()});}})['catch'](function(_0x4add8b){console[_0xa92b('0x1a')](_0x4add8b);});}_0x3d9ffe();}},'charset':_0xa92b('0x1b'),'collate':_0xa92b('0x1c')});};
\ No newline at end of file
+var _0x962c=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x5edb6b,_0x452143){var _0x29ac06=function(_0x431129){while(--_0x431129){_0x5edb6b['push'](_0x5edb6b['shift']());}};_0x29ac06(++_0x452143);}(_0x962c,0x1ed));var _0xc962=function(_0x4dc4fb,_0x537433){_0x4dc4fb=_0x4dc4fb-0x0;var _0xdb856b=_0x962c[_0x4dc4fb];return _0xdb856b;};'use strict';var _=require(_0xc962('0x0'));var util=require(_0xc962('0x1'));var logger=require(_0xc962('0x2'))(_0xc962('0x3'));var moment=require(_0xc962('0x4'));var BPromise=require(_0xc962('0x5'));var rp=require(_0xc962('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc962('0x7'));var config=require(_0xc962('0x8'));var attributes=require(_0xc962('0x9'));module[_0xc962('0xa')]=function(_0x140e5c,_0x3f67d0){return _0x140e5c[_0xc962('0xb')](_0xc962('0xc'),attributes,{'tableName':_0xc962('0xd'),'paranoid':![],'indexes':[{'name':_0xc962('0xe'),'fields':[_0xc962('0xf')],'type':_0xc962('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x48eced,_0x19a483,_0x43ce2e){var _0x541a72=_0x140e5c[_0xc962('0x11')];var _0x23a955=_0x48eced['get']({'plain':!![]});if(_0x23a955[_0xc962('0x12')][_0xc962('0x13')]()==='in'||_0x23a955[_0xc962('0x12')][_0xc962('0x13')]()===_0xc962('0x14')&&!_0x23a955[_0xc962('0x15')]&&!_[_0xc962('0x16')](_0x23a955['UserId'])){_0x541a72[_0xc962('0x17')][_0xc962('0x18')]({'where':{'id':_0x23a955[_0xc962('0x19')]}})[_0xc962('0x1a')](function(_0x144f32){if(_0x144f32){_0x144f32[_0xc962('0x1b')]({'lastMsgAt':_0x23a955[_0xc962('0x1c')],'lastMsgDirection':_0x23a955[_0xc962('0x12')][_0xc962('0x13')]()});}})[_0xc962('0x1d')](function(_0x202950){console[_0xc962('0x1e')](_0x202950);});}_0x43ce2e();}},'charset':_0xc962('0x1f'),'collate':_0xc962('0x20')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index f122961..20f4f90 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 _0x94ff=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','localhost','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatMessage','body','options','raw','CreateChatMessage','debug','lodash'];(function(_0xb85451,_0x3f5873){var _0x2d2873=function(_0x5f4ebf){while(--_0x5f4ebf){_0xb85451['push'](_0xb85451['shift']());}};_0x2d2873(++_0x3f5873);}(_0x94ff,0xc3));var _0xf94f=function(_0x52d80a,_0x1256a3){_0x52d80a=_0x52d80a-0x0;var _0x5bb920=_0x94ff[_0x52d80a];return _0x5bb920;};'use strict';var _=require(_0xf94f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf94f('0x1'));var fs=require('fs');var Redis=require(_0xf94f('0x2'));var db=require(_0xf94f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf94f('0x4'))(_0xf94f('0x5'));var config=require('../../config/environment');var jayson=require(_0xf94f('0x6'));var client=jayson[_0xf94f('0x7')]['http']({'port':0x232a});config[_0xf94f('0x8')]=_['defaults'](config[_0xf94f('0x8')],{'host':_0xf94f('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf94f('0x8')]));require(_0xf94f('0xa'))[_0xf94f('0xb')](socket);function respondWithRpcPromise(_0x57b900,_0x5c518f,_0x510972){return new BPromise(function(_0x2d3ea6,_0x234f34){return client[_0xf94f('0xc')](_0x57b900,_0x510972)[_0xf94f('0xd')](function(_0x18a8a6){logger[_0xf94f('0xe')](_0xf94f('0xf'),_0x5c518f,_0xf94f('0x10'));logger['debug'](_0xf94f('0x11'),_0x5c518f,_0xf94f('0x10'),JSON[_0xf94f('0x12')](_0x18a8a6));if(_0x18a8a6[_0xf94f('0x13')]){if(_0x18a8a6['error'][_0xf94f('0x14')]===0x1f4){logger[_0xf94f('0x13')](_0xf94f('0xf'),_0x5c518f,_0x18a8a6[_0xf94f('0x13')][_0xf94f('0x15')]);return _0x234f34(_0x18a8a6[_0xf94f('0x13')]['message']);}logger[_0xf94f('0x13')]('ChatMessage,\x20%s,\x20%s',_0x5c518f,_0x18a8a6[_0xf94f('0x13')][_0xf94f('0x15')]);return _0x2d3ea6(_0x18a8a6['error']['message']);}else{logger['info'](_0xf94f('0xf'),_0x5c518f,'request\x20sent');_0x2d3ea6(_0x18a8a6['result'][_0xf94f('0x15')]);}})['catch'](function(_0x33defc){logger['error'](_0xf94f('0xf'),_0x5c518f,_0x33defc);_0x234f34(_0x33defc);});});}exports['CreateChatMessage']=function(_0x18aedc){var _0x124ef6=this;return new Promise(function(_0x5779ea,_0x412de1){return db[_0xf94f('0x16')]['create'](_0x18aedc[_0xf94f('0x17')],{'raw':_0x18aedc[_0xf94f('0x18')]?_0x18aedc['options'][_0xf94f('0x19')]===undefined?!![]:![]:!![]})[_0xf94f('0xd')](function(_0x5beb9c){logger[_0xf94f('0xe')](_0xf94f('0x1a'),_0x18aedc);logger[_0xf94f('0x1b')](_0xf94f('0x1a'),_0x18aedc,JSON[_0xf94f('0x12')](_0x5beb9c));_0x5779ea(_0x5beb9c);})['catch'](function(_0x2af18d){logger[_0xf94f('0x13')](_0xf94f('0x1a'),_0x2af18d['message'],_0x18aedc);_0x412de1(_0x124ef6[_0xf94f('0x13')](0x1f4,_0x2af18d[_0xf94f('0x15')]));});});};
\ No newline at end of file
+var _0xc8af=['error','code','ChatMessage,\x20%s,\x20%s','message','catch','CreateChatMessage','create','body','options','raw','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s'];(function(_0x3b1988,_0x3f0132){var _0x63a434=function(_0x260efb){while(--_0x260efb){_0x3b1988['push'](_0x3b1988['shift']());}};_0x63a434(++_0x3f0132);}(_0xc8af,0x19e));var _0xfc8a=function(_0xf1990d,_0x32f2f0){_0xf1990d=_0xf1990d-0x0;var _0x195641=_0xc8af[_0xf1990d];return _0x195641;};'use strict';var _=require(_0xfc8a('0x0'));var util=require(_0xfc8a('0x1'));var moment=require(_0xfc8a('0x2'));var BPromise=require('bluebird');var rs=require(_0xfc8a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc8a('0x4'))['db'];var utils=require(_0xfc8a('0x5'));var logger=require('../../config/logger')(_0xfc8a('0x6'));var config=require(_0xfc8a('0x7'));var jayson=require(_0xfc8a('0x8'));var client=jayson['client'][_0xfc8a('0x9')]({'port':0x232a});config['redis']=_[_0xfc8a('0xa')](config[_0xfc8a('0xb')],{'host':_0xfc8a('0xc'),'port':0x18eb});var socket=require(_0xfc8a('0xd'))(new Redis(config[_0xfc8a('0xb')]));require(_0xfc8a('0xe'))[_0xfc8a('0xf')](socket);function respondWithRpcPromise(_0x4e95e5,_0x593841,_0x1a99d5){return new BPromise(function(_0x3d6bfd,_0x2c67d7){return client['request'](_0x4e95e5,_0x1a99d5)['then'](function(_0x4cdb7f){logger[_0xfc8a('0x10')]('ChatMessage,\x20%s,\x20%s',_0x593841,_0xfc8a('0x11'));logger[_0xfc8a('0x12')](_0xfc8a('0x13'),_0x593841,'request\x20sent',JSON['stringify'](_0x4cdb7f));if(_0x4cdb7f[_0xfc8a('0x14')]){if(_0x4cdb7f[_0xfc8a('0x14')][_0xfc8a('0x15')]===0x1f4){logger[_0xfc8a('0x14')](_0xfc8a('0x16'),_0x593841,_0x4cdb7f[_0xfc8a('0x14')][_0xfc8a('0x17')]);return _0x2c67d7(_0x4cdb7f[_0xfc8a('0x14')][_0xfc8a('0x17')]);}logger['error'](_0xfc8a('0x16'),_0x593841,_0x4cdb7f['error'][_0xfc8a('0x17')]);return _0x3d6bfd(_0x4cdb7f[_0xfc8a('0x14')][_0xfc8a('0x17')]);}else{logger[_0xfc8a('0x10')](_0xfc8a('0x16'),_0x593841,_0xfc8a('0x11'));_0x3d6bfd(_0x4cdb7f['result'][_0xfc8a('0x17')]);}})[_0xfc8a('0x18')](function(_0x23c3ad){logger['error']('ChatMessage,\x20%s,\x20%s',_0x593841,_0x23c3ad);_0x2c67d7(_0x23c3ad);});});}exports[_0xfc8a('0x19')]=function(_0x3e9609){var _0x20c1ab=this;return new Promise(function(_0x398e8a,_0x8e337e){return db['ChatMessage'][_0xfc8a('0x1a')](_0x3e9609[_0xfc8a('0x1b')],{'raw':_0x3e9609[_0xfc8a('0x1c')]?_0x3e9609[_0xfc8a('0x1c')][_0xfc8a('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x550d24){logger[_0xfc8a('0x10')](_0xfc8a('0x19'),_0x3e9609);logger['debug'](_0xfc8a('0x19'),_0x3e9609,JSON[_0xfc8a('0x1e')](_0x550d24));_0x398e8a(_0x550d24);})[_0xfc8a('0x18')](function(_0x7ddc3e){logger[_0xfc8a('0x14')](_0xfc8a('0x19'),_0x7ddc3e[_0xfc8a('0x17')],_0x3e9609);_0x8e337e(_0x20c1ab['error'](0x1f4,_0x7ddc3e[_0xfc8a('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 37cf72c..00aa897 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 _0x37a7=['chatMessage:','./chatMessage.events','save','removeListener','register'];(function(_0x5d99dd,_0x4bb40b){var _0x148a26=function(_0x25df5f){while(--_0x25df5f){_0x5d99dd['push'](_0x5d99dd['shift']());}};_0x148a26(++_0x4bb40b);}(_0x37a7,0x6f));var _0x737a=function(_0x4cdf14,_0x3eeb3a){_0x4cdf14=_0x4cdf14-0x0;var _0x52646e=_0x37a7[_0x4cdf14];return _0x52646e;};'use strict';var ChatMessageEvents=require(_0x737a('0x0'));var events=[_0x737a('0x1'),'remove','update'];function createListener(_0x5a259b,_0x2d4b54){return function(_0xc5eaef){_0x2d4b54['emit'](_0x5a259b,_0xc5eaef);};}function removeListener(_0x524516,_0x4af128){return function(){ChatMessageEvents[_0x737a('0x2')](_0x524516,_0x4af128);};}exports[_0x737a('0x3')]=function(_0x7f4eed){for(var _0x11109c=0x0,_0x2f6800=events['length'];_0x11109c<_0x2f6800;_0x11109c++){var _0x244850=events[_0x11109c];var _0x249898=createListener(_0x737a('0x4')+_0x244850,_0x7f4eed);ChatMessageEvents['on'](_0x244850,_0x249898);}};
\ No newline at end of file
+var _0x0fda=['register','length','./chatMessage.events','remove','update','emit'];(function(_0x21b359,_0x4dc80e){var _0x57b8e7=function(_0x135adb){while(--_0x135adb){_0x21b359['push'](_0x21b359['shift']());}};_0x57b8e7(++_0x4dc80e);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x50488f,_0x587041){_0x50488f=_0x50488f-0x0;var _0x1a818=_0x0fda[_0x50488f];return _0x1a818;};'use strict';var ChatMessageEvents=require(_0xa0fd('0x0'));var events=['save',_0xa0fd('0x1'),_0xa0fd('0x2')];function createListener(_0x314a1a,_0x2f71f3){return function(_0x426242){_0x2f71f3[_0xa0fd('0x3')](_0x314a1a,_0x426242);};}function removeListener(_0x13c734,_0x574fca){return function(){ChatMessageEvents['removeListener'](_0x13c734,_0x574fca);};}exports[_0xa0fd('0x4')]=function(_0x4aec58){for(var _0x49b3c1=0x0,_0x868183=events[_0xa0fd('0x5')];_0x49b3c1<_0x868183;_0x49b3c1++){var _0x1aab41=events[_0x49b3c1];var _0x248cca=createListener('chatMessage:'+_0x1aab41,_0x4aec58);ChatMessageEvents['on'](_0x1aab41,_0x248cca);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 55d8592..1ff7537 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 _0x8322=['show','post','tracked','chat','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','path','express','Router','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x8322,0xe5));var _0x2832=function(_0x511b76,_0x4727fa){_0x511b76=_0x511b76-0x0;var _0x5424ff=_0x8322[_0x511b76];return _0x5424ff;};'use strict';var multer=require(_0x2832('0x0'));var util=require('util');var path=require(_0x2832('0x1'));var timeout=require('connect-timeout');var express=require(_0x2832('0x2'));var router=express[_0x2832('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2832('0x4'));var controller=require('./chatMessage.controller');router[_0x2832('0x5')]('/',auth['isAuthenticated'](),controller[_0x2832('0x6')]);router['get'](_0x2832('0x7'),auth['isAuthenticated'](),controller[_0x2832('0x8')]);router[_0x2832('0x5')](_0x2832('0x9'),auth[_0x2832('0xa')](),controller[_0x2832('0xb')]);router[_0x2832('0xc')]('/',auth[_0x2832('0xa')](),interaction[_0x2832('0xd')](_0x2832('0xe'),'chatmessage:create'),controller[_0x2832('0xf')]);router[_0x2832('0x10')]('/:id',controller[_0x2832('0x11')]);router['put'](_0x2832('0x12'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x2832('0x13'),auth['isAuthenticated'](),controller[_0x2832('0x14')]);router[_0x2832('0x15')](_0x2832('0x9'),auth[_0x2832('0xa')](),controller[_0x2832('0x16')]);module[_0x2832('0x17')]=router;
\ No newline at end of file
+var _0x6f6a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','chatmessage:create','update','put','/:id/accept','accept','reject','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x2730da,_0x1098bd){var _0xfe9991=function(_0x2ea521){while(--_0x2ea521){_0x2730da['push'](_0x2730da['shift']());}};_0xfe9991(++_0x1098bd);}(_0x6f6a,0xff));var _0xa6f6=function(_0x16ffb1,_0x23ff79){_0x16ffb1=_0x16ffb1-0x0;var _0x2703be=_0x6f6a[_0x16ffb1];return _0x2703be;};'use strict';var multer=require(_0xa6f6('0x0'));var util=require(_0xa6f6('0x1'));var path=require('path');var timeout=require(_0xa6f6('0x2'));var express=require(_0xa6f6('0x3'));var router=express[_0xa6f6('0x4')]();var fs_extra=require(_0xa6f6('0x5'));var auth=require(_0xa6f6('0x6'));var interaction=require(_0xa6f6('0x7'));var config=require(_0xa6f6('0x8'));var controller=require(_0xa6f6('0x9'));router['get']('/',auth[_0xa6f6('0xa')](),controller[_0xa6f6('0xb')]);router[_0xa6f6('0xc')](_0xa6f6('0xd'),auth['isAuthenticated'](),controller[_0xa6f6('0xe')]);router['get'](_0xa6f6('0xf'),auth[_0xa6f6('0xa')](),controller[_0xa6f6('0x10')]);router[_0xa6f6('0x11')]('/',auth['isAuthenticated'](),interaction['tracked']('chat',_0xa6f6('0x12')),controller['create']);router['put'](_0xa6f6('0xf'),controller[_0xa6f6('0x13')]);router[_0xa6f6('0x14')](_0xa6f6('0x15'),auth[_0xa6f6('0xa')](),controller[_0xa6f6('0x16')]);router['put']('/:id/reject',auth[_0xa6f6('0xa')](),controller[_0xa6f6('0x17')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa6f6('0x18')]);module[_0xa6f6('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 4a8a316..9bdbe96 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xadb5=['medium','TEXT','exports'];(function(_0x14ee26,_0x166414){var _0x521aa9=function(_0xf2420c){while(--_0xf2420c){_0x14ee26['push'](_0x14ee26['shift']());}};_0x521aa9(++_0x166414);}(_0xadb5,0xad));var _0x5adb=function(_0x5cbb86,_0x318b0f){_0x5cbb86=_0x5cbb86-0x0;var _0x199d82=_0xadb5[_0x5cbb86];return _0x199d82;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0xb10b=['medium','sequelize','TEXT'];(function(_0x1e1f2f,_0x2ad54f){var _0x20db03=function(_0x31106e){while(--_0x31106e){_0x1e1f2f['push'](_0x1e1f2f['shift']());}};_0x20db03(++_0x2ad54f);}(_0xb10b,0x12a));var _0xbb10=function(_0x5d4460,_0x400e28){_0x5d4460=_0x5d4460-0x0;var _0x5bdc5e=_0xb10b[_0x5d4460];return _0x5bdc5e;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 2e65525..a67f25d 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x4f89ce,_0x4aff54){var _0x1e4ff9=function(_0x57d720){while(--_0x57d720){_0x4f89ce['push'](_0x4f89ce['shift']());}};_0x1e4ff9(++_0x4aff54);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x248afb,_0x2b0f28){var _0x4ed56e=function(_0x191893){while(--_0x191893){_0x248afb['push'](_0x248afb['shift']());}};_0x4ed56e(++_0x2b0f28);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 3050e85..fc5660c 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x52ad=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','update'];(function(_0x4cfb78,_0x4c1da6){var _0xc1250e=function(_0x217b6c){while(--_0x217b6c){_0x4cfb78['push'](_0x4cfb78['shift']());}};_0xc1250e(++_0x4c1da6);}(_0x52ad,0x1d8));var _0xd52a=function(_0x2f67a6,_0x49c531){_0x2f67a6=_0x2f67a6-0x0;var _0x1c74ef=_0x52ad[_0x2f67a6];return _0x1c74ef;};'use strict';var EventEmitter=require(_0xd52a('0x0'));var ChatOfflineMessage=require(_0xd52a('0x1'))['db'][_0xd52a('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xd52a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd52a('0x4'),'afterDestroy':_0xd52a('0x5')};function emitEvent(_0x2dbf7a){return function(_0xf1d12e,_0x69fd93,_0xc135cb){ChatOfflineMessageEvents[_0xd52a('0x6')](_0x2dbf7a+':'+_0xf1d12e['id'],_0xf1d12e);ChatOfflineMessageEvents[_0xd52a('0x6')](_0x2dbf7a,_0xf1d12e);_0xc135cb(null);};}for(var e in events){if(events[_0xd52a('0x7')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xd52a('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x8ad5=['exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','remove','emit','hook'];(function(_0x501308,_0x2c9dfe){var _0x174f25=function(_0x1acdb9){while(--_0x1acdb9){_0x501308['push'](_0x501308['shift']());}};_0x174f25(++_0x2c9dfe);}(_0x8ad5,0xf1));var _0x58ad=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x8ad5[_0x29b609];return _0x54c952;};'use strict';var EventEmitter=require(_0x58ad('0x0'));var ChatOfflineMessage=require(_0x58ad('0x1'))['db'][_0x58ad('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x58ad('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x58ad('0x4')};function emitEvent(_0x3ea384){return function(_0x223e54,_0x22aba9,_0x13711c){ChatOfflineMessageEvents[_0x58ad('0x5')](_0x3ea384+':'+_0x223e54['id'],_0x223e54);ChatOfflineMessageEvents['emit'](_0x3ea384,_0x223e54);_0x13711c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x58ad('0x6')](e,emitEvent(event));}}module[_0x58ad('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 50068a4..db7f4cd 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 _0x1a36=['exports','ChatOfflineMessage','chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes'];(function(_0x479ddb,_0x13d5f9){var _0x5c6429=function(_0x55134e){while(--_0x55134e){_0x479ddb['push'](_0x479ddb['shift']());}};_0x5c6429(++_0x13d5f9);}(_0x1a36,0x9a));var _0x61a3=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x1a36[_0x413feb];return _0x40ee88;};'use strict';var attributes=require(_0x61a3('0x0'));module[_0x61a3('0x1')]=function(_0xd56919){return _0xd56919['define'](_0x61a3('0x2'),attributes,{'tableName':_0x61a3('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x61a3('0x4'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x3f38=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes'];(function(_0x56cfef,_0x14617c){var _0x5b0a2d=function(_0x1661da){while(--_0x1661da){_0x56cfef['push'](_0x56cfef['shift']());}};_0x5b0a2d(++_0x14617c);}(_0x3f38,0x119));var _0x83f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f38[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require(_0x83f3('0x0'));module[_0x83f3('0x1')]=function(_0x468b83){return _0x468b83[_0x83f3('0x2')](_0x83f3('0x3'),attributes,{'tableName':_0x83f3('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x83f3('0x5'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index eed7378..02cc5bb 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 _0x9fe3=['../../config/logger','rpc','../../config/environment','client','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x554f35,_0x3a33b2){var _0x32fe11=function(_0x3bcf54){while(--_0x3bcf54){_0x554f35['push'](_0x554f35['shift']());}};_0x32fe11(++_0x3a33b2);}(_0x9fe3,0x1b1));var _0x39fe=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x9fe3[_0x49d41c];return _0xb64c5f;};'use strict';var _=require(_0x39fe('0x0'));var util=require('util');var moment=require(_0x39fe('0x1'));var BPromise=require(_0x39fe('0x2'));var rs=require(_0x39fe('0x3'));var fs=require('fs');var Redis=require(_0x39fe('0x4'));var db=require(_0x39fe('0x5'))['db'];var utils=require(_0x39fe('0x6'));var logger=require(_0x39fe('0x7'))(_0x39fe('0x8'));var config=require(_0x39fe('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x39fe('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x418bc4,_0x42be6d,_0x228ecd){return new BPromise(function(_0x4fcd91,_0x32490c){return client[_0x39fe('0xb')](_0x418bc4,_0x228ecd)[_0x39fe('0xc')](function(_0x207175){logger['info'](_0x39fe('0xd'),_0x42be6d,_0x39fe('0xe'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x42be6d,_0x39fe('0xe'),JSON[_0x39fe('0xf')](_0x207175));if(_0x207175['error']){if(_0x207175['error']['code']===0x1f4){logger[_0x39fe('0x10')](_0x39fe('0xd'),_0x42be6d,_0x207175[_0x39fe('0x10')][_0x39fe('0x11')]);return _0x32490c(_0x207175[_0x39fe('0x10')]['message']);}logger[_0x39fe('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x42be6d,_0x207175[_0x39fe('0x10')][_0x39fe('0x11')]);return _0x4fcd91(_0x207175[_0x39fe('0x10')][_0x39fe('0x11')]);}else{logger['info'](_0x39fe('0xd'),_0x42be6d,_0x39fe('0xe'));_0x4fcd91(_0x207175[_0x39fe('0x12')][_0x39fe('0x11')]);}})[_0x39fe('0x13')](function(_0x1235d5){logger[_0x39fe('0x10')](_0x39fe('0xd'),_0x42be6d,_0x1235d5);_0x32490c(_0x1235d5);});});}
\ No newline at end of file
+var _0xcf70=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','code'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xcf70,0x94));var _0x0cf7=function(_0x23584a,_0x7abb50){_0x23584a=_0x23584a-0x0;var _0x5bd540=_0xcf70[_0x23584a];return _0x5bd540;};'use strict';var _=require(_0x0cf7('0x0'));var util=require(_0x0cf7('0x1'));var moment=require(_0x0cf7('0x2'));var BPromise=require(_0x0cf7('0x3'));var rs=require(_0x0cf7('0x4'));var fs=require('fs');var Redis=require(_0x0cf7('0x5'));var db=require(_0x0cf7('0x6'))['db'];var utils=require(_0x0cf7('0x7'));var logger=require(_0x0cf7('0x8'))(_0x0cf7('0x9'));var config=require('../../config/environment');var jayson=require(_0x0cf7('0xa'));var client=jayson['client'][_0x0cf7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28aac7,_0x59758a,_0x6f757f){return new BPromise(function(_0x352126,_0x39e5c8){return client[_0x0cf7('0xc')](_0x28aac7,_0x6f757f)[_0x0cf7('0xd')](function(_0x5192f8){logger[_0x0cf7('0xe')](_0x0cf7('0xf'),_0x59758a,_0x0cf7('0x10'));logger[_0x0cf7('0x11')](_0x0cf7('0x12'),_0x59758a,_0x0cf7('0x10'),JSON['stringify'](_0x5192f8));if(_0x5192f8['error']){if(_0x5192f8['error'][_0x0cf7('0x13')]===0x1f4){logger[_0x0cf7('0x14')](_0x0cf7('0xf'),_0x59758a,_0x5192f8[_0x0cf7('0x14')][_0x0cf7('0x15')]);return _0x39e5c8(_0x5192f8[_0x0cf7('0x14')]['message']);}logger['error'](_0x0cf7('0xf'),_0x59758a,_0x5192f8[_0x0cf7('0x14')]['message']);return _0x352126(_0x5192f8[_0x0cf7('0x14')][_0x0cf7('0x15')]);}else{logger['info'](_0x0cf7('0xf'),_0x59758a,'request\x20sent');_0x352126(_0x5192f8[_0x0cf7('0x16')][_0x0cf7('0x15')]);}})[_0x0cf7('0x17')](function(_0x4c5bca){logger[_0x0cf7('0x14')](_0x0cf7('0xf'),_0x59758a,_0x4c5bca);_0x39e5c8(_0x4c5bca);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 94e292c..0c6e80d 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 _0x0c33=['../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','fs-extra'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x0c33,0x1a0));var _0x30c3=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x0c33[_0x4fc9e6];return _0x551d28;};'use strict';var multer=require(_0x30c3('0x0'));var util=require(_0x30c3('0x1'));var path=require('path');var timeout=require(_0x30c3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x30c3('0x3'));var auth=require(_0x30c3('0x4'));var interaction=require(_0x30c3('0x5'));var config=require('../../config/environment');var controller=require(_0x30c3('0x6'));router[_0x30c3('0x7')]('/',auth['isAuthenticated'](),controller[_0x30c3('0x8')]);router['get'](_0x30c3('0x9'),auth[_0x30c3('0xa')](),controller[_0x30c3('0xb')]);router[_0x30c3('0x7')](_0x30c3('0xc'),auth[_0x30c3('0xa')](),controller[_0x30c3('0xd')]);router[_0x30c3('0xe')]('/',auth[_0x30c3('0xa')](),controller[_0x30c3('0xf')]);router[_0x30c3('0x10')](_0x30c3('0xc'),auth['isAuthenticated'](),controller[_0x30c3('0x11')]);router['delete']('/:id',auth[_0x30c3('0xa')](),controller[_0x30c3('0x12')]);module[_0x30c3('0x13')]=router;
\ No newline at end of file
+var _0xabfc=['destroy','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','put'];(function(_0x49f8c2,_0x5166b7){var _0x3e63ec=function(_0x575c26){while(--_0x575c26){_0x49f8c2['push'](_0x49f8c2['shift']());}};_0x3e63ec(++_0x5166b7);}(_0xabfc,0xc2));var _0xcabf=function(_0x40dd56,_0x726ca5){_0x40dd56=_0x40dd56-0x0;var _0x4f850f=_0xabfc[_0x40dd56];return _0x4f850f;};'use strict';var multer=require(_0xcabf('0x0'));var util=require(_0xcabf('0x1'));var path=require('path');var timeout=require(_0xcabf('0x2'));var express=require('express');var router=express[_0xcabf('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcabf('0x4'));var config=require(_0xcabf('0x5'));var controller=require('./chatOfflineMessage.controller');router[_0xcabf('0x6')]('/',auth[_0xcabf('0x7')](),controller[_0xcabf('0x8')]);router['get'](_0xcabf('0x9'),auth[_0xcabf('0x7')](),controller['describe']);router[_0xcabf('0x6')](_0xcabf('0xa'),auth[_0xcabf('0x7')](),controller[_0xcabf('0xb')]);router[_0xcabf('0xc')]('/',auth[_0xcabf('0x7')](),controller['create']);router[_0xcabf('0xd')](_0xcabf('0xa'),auth[_0xcabf('0x7')](),controller['update']);router['delete'](_0xcabf('0xa'),auth[_0xcabf('0x7')](),controller[_0xcabf('0xe')]);module[_0xcabf('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 3e6e7dd..c6ba527 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 _0xbfe7=['sequelize','STRING','mouseOver','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbfe7,0x1ec));var _0x7bfe=function(_0x516c67,_0xd6ef4){_0x516c67=_0x516c67-0x0;var _0xaf96d3=_0xbfe7[_0x516c67];return _0xaf96d3;};'use strict';var Sequelize=require(_0x7bfe('0x0'));module['exports']={'name':{'type':Sequelize[_0x7bfe('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x7bfe('0x2'),'timeout'),'defaultValue':_0x7bfe('0x2')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7bfe('0x3')]}};
\ No newline at end of file
+var _0xb865=['STRING','ENUM','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xb865,0x140));var _0x5b86=function(_0x15805a,_0x31801d){_0x15805a=_0x15805a-0x0;var _0x11b989=_0xb865[_0x15805a];return _0x11b989;};'use strict';var Sequelize=require(_0x5b86('0x0'));module[_0x5b86('0x1')]={'name':{'type':Sequelize[_0x5b86('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x5b86('0x3')](_0x5b86('0x4'),_0x5b86('0x5')),'defaultValue':_0x5b86('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x5b86('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 7e9e67f..8b61829 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 _0x8784=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send','show','params','keys','ChatProactiveAction','query','filters','intersection','model','attributes','fields','includeAll','merge','options','find','create','catch','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox'];(function(_0x4d5fb5,_0x33c249){var _0x54e091=function(_0x4f88e3){while(--_0x4f88e3){_0x4d5fb5['push'](_0x4d5fb5['shift']());}};_0x54e091(++_0x33c249);}(_0x8784,0x172));var _0x4878=function(_0x3cd91d,_0x163516){_0x3cd91d=_0x3cd91d-0x0;var _0x3b4fab=_0x8784[_0x3cd91d];return _0x3b4fab;};'use strict';var emlformat=require(_0x4878('0x0'));var rimraf=require(_0x4878('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4878('0x2'));var rp=require(_0x4878('0x3'));var moment=require(_0x4878('0x4'));var BPromise=require(_0x4878('0x5'));var Mustache=require(_0x4878('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4878('0x7'));var csv=require(_0x4878('0x8'));var ejs=require(_0x4878('0x9'));var fs=require('fs');var fs_extra=require(_0x4878('0xa'));var _=require(_0x4878('0xb'));var squel=require(_0x4878('0xc'));var crypto=require(_0x4878('0xd'));var jsforce=require(_0x4878('0xe'));var deskjs=require(_0x4878('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4878('0x10'));var Papa=require(_0x4878('0x11'));var Redis=require(_0x4878('0x12'));var authService=require(_0x4878('0x13'));var qs=require(_0x4878('0x14'));var as=require(_0x4878('0x15'));var hardwareService=require(_0x4878('0x16'));var logger=require(_0x4878('0x17'))(_0x4878('0x18'));var utils=require(_0x4878('0x19'));var config=require(_0x4878('0x1a'));var licenseUtil=require(_0x4878('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa3b6c,_0x462485){_0x462485=_0x462485||0xcc;return function(_0x188e81){if(_0x188e81){return _0xa3b6c['sendStatus'](_0x462485);}return _0xa3b6c[_0x4878('0x1c')](_0x462485)[_0x4878('0x1d')]();};}function respondWithResult(_0x4f6486,_0x32c5ea){_0x32c5ea=_0x32c5ea||0xc8;return function(_0x5e67cc){if(_0x5e67cc){return _0x4f6486['status'](_0x32c5ea)[_0x4878('0x1e')](_0x5e67cc);}};}function respondWithFilteredResult(_0x41fefd,_0x2b7ccc){return function(_0x297b43){if(_0x297b43){var _0x37a150=typeof _0x2b7ccc['offset']===_0x4878('0x1f')&&typeof _0x2b7ccc[_0x4878('0x20')]==='undefined';var _0x4319a8=_0x297b43['count'];var _0x2c2529=_0x37a150?0x0:_0x2b7ccc['offset'];var _0x5267ff=_0x37a150?_0x297b43[_0x4878('0x21')]:_0x2b7ccc[_0x4878('0x22')]+_0x2b7ccc[_0x4878('0x20')];var _0x3219f7;if(_0x5267ff>=_0x4319a8){_0x5267ff=_0x4319a8;_0x3219f7=0xc8;}else{_0x3219f7=0xce;}_0x41fefd[_0x4878('0x1c')](_0x3219f7);return _0x41fefd['set'](_0x4878('0x23'),_0x2c2529+'-'+_0x5267ff+'/'+_0x4319a8)[_0x4878('0x1e')](_0x297b43);}return null;};}function patchUpdates(_0x35a0e1){return function(_0x436f62){try{jsonpatch[_0x4878('0x24')](_0x436f62,_0x35a0e1,!![]);}catch(_0x3ffa0c){return BPromise['reject'](_0x3ffa0c);}return _0x436f62[_0x4878('0x25')]();};}function saveUpdates(_0x7767d1,_0x3f3f11){return function(_0x5482f5){if(_0x5482f5){return _0x5482f5[_0x4878('0x26')](_0x7767d1)[_0x4878('0x27')](function(_0x57d9b3){return _0x57d9b3;});}return null;};}function removeEntity(_0x21d4d7,_0x10e25d){return function(_0x3b2d57){if(_0x3b2d57){return _0x3b2d57['destroy']()[_0x4878('0x27')](function(){_0x21d4d7[_0x4878('0x1c')](0xcc)[_0x4878('0x1d')]();});}};}function handleEntityNotFound(_0x476ec3,_0x2938f9){return function(_0x5b1222){if(!_0x5b1222){_0x476ec3[_0x4878('0x28')](0x194);}return _0x5b1222;};}function handleError(_0x4458fb,_0x522157){_0x522157=_0x522157||0x1f4;return function(_0x48f8f){logger[_0x4878('0x29')](_0x48f8f[_0x4878('0x2a')]);if(_0x48f8f[_0x4878('0x2b')]){delete _0x48f8f[_0x4878('0x2b')];}_0x4458fb[_0x4878('0x1c')](_0x522157)[_0x4878('0x2c')](_0x48f8f);};}exports[_0x4878('0x2d')]=function(_0xcff66b,_0xe7a731){var _0x3b09f1={'raw':!![],'where':{'id':_0xcff66b[_0x4878('0x2e')]['id']}},_0x38400b={};_0x38400b['model']=_[_0x4878('0x2f')](db[_0x4878('0x30')]['rawAttributes']);_0x38400b['query']=_[_0x4878('0x2f')](_0xcff66b[_0x4878('0x31')]);_0x38400b[_0x4878('0x32')]=_[_0x4878('0x33')](_0x38400b[_0x4878('0x34')],_0x38400b[_0x4878('0x31')]);_0x3b09f1[_0x4878('0x35')]=_['intersection'](_0x38400b[_0x4878('0x34')],qs[_0x4878('0x36')](_0xcff66b[_0x4878('0x31')][_0x4878('0x36')]));_0x3b09f1[_0x4878('0x35')]=_0x3b09f1['attributes']['length']?_0x3b09f1['attributes']:_0x38400b[_0x4878('0x34')];if(_0xcff66b[_0x4878('0x31')][_0x4878('0x37')]){_0x3b09f1['include']=[{'all':!![]}];}_0x3b09f1=_[_0x4878('0x38')]({},_0x3b09f1,_0xcff66b[_0x4878('0x39')]);return db['ChatProactiveAction'][_0x4878('0x3a')](_0x3b09f1)['then'](handleEntityNotFound(_0xe7a731,null))[_0x4878('0x27')](respondWithResult(_0xe7a731,null))['catch'](handleError(_0xe7a731,null));};exports['create']=function(_0x179116,_0x535b44){return db[_0x4878('0x30')][_0x4878('0x3b')](_0x179116['body'],{})[_0x4878('0x27')](respondWithResult(_0x535b44,0xc9))[_0x4878('0x3c')](handleError(_0x535b44,null));};exports['update']=function(_0x1bda87,_0x305f44){if(_0x1bda87['body']['id']){delete _0x1bda87[_0x4878('0x3d')]['id'];}return db['ChatProactiveAction'][_0x4878('0x3a')]({'where':{'id':_0x1bda87[_0x4878('0x2e')]['id']}})[_0x4878('0x27')](handleEntityNotFound(_0x305f44,null))[_0x4878('0x27')](saveUpdates(_0x1bda87['body'],null))[_0x4878('0x27')](respondWithResult(_0x305f44,null))[_0x4878('0x3c')](handleError(_0x305f44,null));};exports[_0x4878('0x3e')]=function(_0x38d6c2,_0x5e1709){return db[_0x4878('0x30')]['find']({'where':{'id':_0x38d6c2[_0x4878('0x2e')]['id']}})[_0x4878('0x27')](handleEntityNotFound(_0x5e1709,null))['then'](removeEntity(_0x5e1709,null))[_0x4878('0x3c')](handleError(_0x5e1709,null));};
\ No newline at end of file
+var _0xbcc7=['find','create','body','catch','eml-format','rimraf','fast-json-patch','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','show','params','keys','ChatProactiveAction','filters','intersection','model','query','fields','attributes','length','includeAll','include','merge','options'];(function(_0x2f149d,_0x3ccd01){var _0x347ec4=function(_0x43fbbe){while(--_0x43fbbe){_0x2f149d['push'](_0x2f149d['shift']());}};_0x347ec4(++_0x3ccd01);}(_0xbcc7,0x19a));var _0x7bcc=function(_0x165c4e,_0x16942c){_0x165c4e=_0x165c4e-0x0;var _0x15e35f=_0xbcc7[_0x165c4e];return _0x15e35f;};'use strict';var emlformat=require(_0x7bcc('0x0'));var rimraf=require(_0x7bcc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7bcc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7bcc('0x3'));var Mustache=require('mustache');var util=require(_0x7bcc('0x4'));var path=require(_0x7bcc('0x5'));var sox=require('sox');var csv=require(_0x7bcc('0x6'));var ejs=require(_0x7bcc('0x7'));var fs=require('fs');var fs_extra=require(_0x7bcc('0x8'));var _=require(_0x7bcc('0x9'));var squel=require(_0x7bcc('0xa'));var crypto=require(_0x7bcc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7bcc('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7bcc('0xd'));var Papa=require(_0x7bcc('0xe'));var Redis=require('ioredis');var authService=require(_0x7bcc('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bcc('0x10'))(_0x7bcc('0x11'));var utils=require(_0x7bcc('0x12'));var config=require(_0x7bcc('0x13'));var licenseUtil=require(_0x7bcc('0x14'));var db=require(_0x7bcc('0x15'))['db'];function respondWithStatusCode(_0xae46e8,_0x51b0e8){_0x51b0e8=_0x51b0e8||0xcc;return function(_0x3e3580){if(_0x3e3580){return _0xae46e8[_0x7bcc('0x16')](_0x51b0e8);}return _0xae46e8[_0x7bcc('0x17')](_0x51b0e8)[_0x7bcc('0x18')]();};}function respondWithResult(_0x39f912,_0x217896){_0x217896=_0x217896||0xc8;return function(_0x4a2539){if(_0x4a2539){return _0x39f912[_0x7bcc('0x17')](_0x217896)[_0x7bcc('0x19')](_0x4a2539);}};}function respondWithFilteredResult(_0x148618,_0x461ff7){return function(_0x30caa2){if(_0x30caa2){var _0x134d55=typeof _0x461ff7[_0x7bcc('0x1a')]==='undefined'&&typeof _0x461ff7[_0x7bcc('0x1b')]==='undefined';var _0x3156f3=_0x30caa2[_0x7bcc('0x1c')];var _0x340bd6=_0x134d55?0x0:_0x461ff7[_0x7bcc('0x1a')];var _0x49168c=_0x134d55?_0x30caa2['count']:_0x461ff7[_0x7bcc('0x1a')]+_0x461ff7[_0x7bcc('0x1b')];var _0x1a1b7f;if(_0x49168c>=_0x3156f3){_0x49168c=_0x3156f3;_0x1a1b7f=0xc8;}else{_0x1a1b7f=0xce;}_0x148618[_0x7bcc('0x17')](_0x1a1b7f);return _0x148618[_0x7bcc('0x1d')](_0x7bcc('0x1e'),_0x340bd6+'-'+_0x49168c+'/'+_0x3156f3)[_0x7bcc('0x19')](_0x30caa2);}return null;};}function patchUpdates(_0x3d0719){return function(_0x15b2c3){try{jsonpatch['apply'](_0x15b2c3,_0x3d0719,!![]);}catch(_0x553865){return BPromise[_0x7bcc('0x1f')](_0x553865);}return _0x15b2c3[_0x7bcc('0x20')]();};}function saveUpdates(_0x34ee2a,_0x3050cf){return function(_0x201f40){if(_0x201f40){return _0x201f40[_0x7bcc('0x21')](_0x34ee2a)[_0x7bcc('0x22')](function(_0x345671){return _0x345671;});}return null;};}function removeEntity(_0x32b3ea,_0x54c611){return function(_0x2d25b8){if(_0x2d25b8){return _0x2d25b8[_0x7bcc('0x23')]()[_0x7bcc('0x22')](function(){_0x32b3ea[_0x7bcc('0x17')](0xcc)[_0x7bcc('0x18')]();});}};}function handleEntityNotFound(_0x1d085c,_0x4f8562){return function(_0x48b296){if(!_0x48b296){_0x1d085c[_0x7bcc('0x16')](0x194);}return _0x48b296;};}function handleError(_0x4a91d0,_0x4db3c0){_0x4db3c0=_0x4db3c0||0x1f4;return function(_0xd3ca3b){logger['error'](_0xd3ca3b[_0x7bcc('0x24')]);if(_0xd3ca3b[_0x7bcc('0x25')]){delete _0xd3ca3b[_0x7bcc('0x25')];}_0x4a91d0['status'](_0x4db3c0)[_0x7bcc('0x26')](_0xd3ca3b);};}exports[_0x7bcc('0x27')]=function(_0x2e92e1,_0x319943){var _0x20c458={'raw':!![],'where':{'id':_0x2e92e1[_0x7bcc('0x28')]['id']}},_0x1ecf95={};_0x1ecf95['model']=_[_0x7bcc('0x29')](db[_0x7bcc('0x2a')]['rawAttributes']);_0x1ecf95['query']=_[_0x7bcc('0x29')](_0x2e92e1['query']);_0x1ecf95[_0x7bcc('0x2b')]=_[_0x7bcc('0x2c')](_0x1ecf95[_0x7bcc('0x2d')],_0x1ecf95[_0x7bcc('0x2e')]);_0x20c458['attributes']=_[_0x7bcc('0x2c')](_0x1ecf95[_0x7bcc('0x2d')],qs[_0x7bcc('0x2f')](_0x2e92e1['query'][_0x7bcc('0x2f')]));_0x20c458[_0x7bcc('0x30')]=_0x20c458[_0x7bcc('0x30')][_0x7bcc('0x31')]?_0x20c458[_0x7bcc('0x30')]:_0x1ecf95[_0x7bcc('0x2d')];if(_0x2e92e1[_0x7bcc('0x2e')][_0x7bcc('0x32')]){_0x20c458[_0x7bcc('0x33')]=[{'all':!![]}];}_0x20c458=_[_0x7bcc('0x34')]({},_0x20c458,_0x2e92e1[_0x7bcc('0x35')]);return db['ChatProactiveAction'][_0x7bcc('0x36')](_0x20c458)[_0x7bcc('0x22')](handleEntityNotFound(_0x319943,null))[_0x7bcc('0x22')](respondWithResult(_0x319943,null))['catch'](handleError(_0x319943,null));};exports['create']=function(_0x409ff4,_0x1ef50b){return db[_0x7bcc('0x2a')][_0x7bcc('0x37')](_0x409ff4[_0x7bcc('0x38')],{})[_0x7bcc('0x22')](respondWithResult(_0x1ef50b,0xc9))[_0x7bcc('0x39')](handleError(_0x1ef50b,null));};exports['update']=function(_0x5bbb4b,_0x5584f6){if(_0x5bbb4b['body']['id']){delete _0x5bbb4b[_0x7bcc('0x38')]['id'];}return db[_0x7bcc('0x2a')][_0x7bcc('0x36')]({'where':{'id':_0x5bbb4b['params']['id']}})[_0x7bcc('0x22')](handleEntityNotFound(_0x5584f6,null))[_0x7bcc('0x22')](saveUpdates(_0x5bbb4b[_0x7bcc('0x38')],null))['then'](respondWithResult(_0x5584f6,null))['catch'](handleError(_0x5584f6,null));};exports[_0x7bcc('0x23')]=function(_0xca6ce3,_0x1d9c06){return db['ChatProactiveAction']['find']({'where':{'id':_0xca6ce3[_0x7bcc('0x28')]['id']}})[_0x7bcc('0x22')](handleEntityNotFound(_0x1d9c06,null))[_0x7bcc('0x22')](removeEntity(_0x1d9c06,null))['catch'](handleError(_0x1d9c06,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 0b7aaa5..98e69bf 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 _0x5350=['chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatProactiveAction'];(function(_0x3fc5d3,_0x4a1df1){var _0x3a8bf1=function(_0x2f264a){while(--_0x2f264a){_0x3fc5d3['push'](_0x3fc5d3['shift']());}};_0x3a8bf1(++_0x4a1df1);}(_0x5350,0xaa));var _0x0535=function(_0x5bf752,_0x29c9fa){_0x5bf752=_0x5bf752-0x0;var _0x3c74fd=_0x5350[_0x5bf752];return _0x3c74fd;};'use strict';var _=require(_0x0535('0x0'));var util=require(_0x0535('0x1'));var logger=require(_0x0535('0x2'))(_0x0535('0x3'));var moment=require(_0x0535('0x4'));var BPromise=require(_0x0535('0x5'));var rp=require(_0x0535('0x6'));var fs=require('fs');var path=require(_0x0535('0x7'));var rimraf=require(_0x0535('0x8'));var config=require(_0x0535('0x9'));var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x3e88ea,_0xc5b73f){return _0x3e88ea[_0x0535('0xa')](_0x0535('0xb'),attributes,{'tableName':_0x0535('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0d60=['api','path','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util'];(function(_0x298845,_0x4382b2){var _0x52d93a=function(_0x5369fd){while(--_0x5369fd){_0x298845['push'](_0x298845['shift']());}};_0x52d93a(++_0x4382b2);}(_0x0d60,0x1ca));var _0x00d6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0d60[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x00d6('0x0'));var util=require(_0x00d6('0x1'));var logger=require('../../config/logger')(_0x00d6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x00d6('0x3'));var rimraf=require('rimraf');var config=require(_0x00d6('0x4'));var attributes=require(_0x00d6('0x5'));module[_0x00d6('0x6')]=function(_0x4e862d,_0xe78a18){return _0x4e862d[_0x00d6('0x7')](_0x00d6('0x8'),attributes,{'tableName':_0x00d6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 4edc1e9..66296a8 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 _0xd596=['request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x42c3a2,_0x22a366){var _0x406e0e=function(_0x5a25e1){while(--_0x5a25e1){_0x42c3a2['push'](_0x42c3a2['shift']());}};_0x406e0e(++_0x22a366);}(_0xd596,0x1d5));var _0x6d59=function(_0x4de1b1,_0x18c64c){_0x4de1b1=_0x4de1b1-0x0;var _0x639f27=_0xd596[_0x4de1b1];return _0x639f27;};'use strict';var _=require(_0x6d59('0x0'));var util=require(_0x6d59('0x1'));var moment=require(_0x6d59('0x2'));var BPromise=require('bluebird');var rs=require(_0x6d59('0x3'));var fs=require('fs');var Redis=require(_0x6d59('0x4'));var db=require(_0x6d59('0x5'))['db'];var utils=require(_0x6d59('0x6'));var logger=require(_0x6d59('0x7'))(_0x6d59('0x8'));var config=require('../../config/environment');var jayson=require(_0x6d59('0x9'));var client=jayson[_0x6d59('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5690e0,_0x5b22c3,_0x16d6b2){return new BPromise(function(_0x17123b,_0x1915cf){return client['request'](_0x5690e0,_0x16d6b2)[_0x6d59('0xb')](function(_0x42a35e){logger[_0x6d59('0xc')](_0x6d59('0xd'),_0x5b22c3,_0x6d59('0xe'));logger[_0x6d59('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x5b22c3,'request\x20sent',JSON['stringify'](_0x42a35e));if(_0x42a35e[_0x6d59('0x10')]){if(_0x42a35e[_0x6d59('0x10')][_0x6d59('0x11')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x5b22c3,_0x42a35e[_0x6d59('0x10')]['message']);return _0x1915cf(_0x42a35e[_0x6d59('0x10')]['message']);}logger[_0x6d59('0x10')](_0x6d59('0xd'),_0x5b22c3,_0x42a35e[_0x6d59('0x10')][_0x6d59('0x12')]);return _0x17123b(_0x42a35e[_0x6d59('0x10')][_0x6d59('0x12')]);}else{logger[_0x6d59('0xc')](_0x6d59('0xd'),_0x5b22c3,_0x6d59('0xe'));_0x17123b(_0x42a35e[_0x6d59('0x13')][_0x6d59('0x12')]);}})[_0x6d59('0x14')](function(_0x30a54f){logger[_0x6d59('0x10')](_0x6d59('0xd'),_0x5b22c3,_0x30a54f);_0x1915cf(_0x30a54f);});});}
\ No newline at end of file
+var _0x6df4=['lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch'];(function(_0x3348e0,_0x3d3ce9){var _0x2a556d=function(_0x113f3c){while(--_0x113f3c){_0x3348e0['push'](_0x3348e0['shift']());}};_0x2a556d(++_0x3d3ce9);}(_0x6df4,0x150));var _0x46df=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0x6df4[_0x31b5a5];return _0x364cc9;};'use strict';var _=require(_0x46df('0x0'));var util=require(_0x46df('0x1'));var moment=require('moment');var BPromise=require(_0x46df('0x2'));var rs=require(_0x46df('0x3'));var fs=require('fs');var Redis=require(_0x46df('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x46df('0x5'));var logger=require(_0x46df('0x6'))(_0x46df('0x7'));var config=require(_0x46df('0x8'));var jayson=require(_0x46df('0x9'));var client=jayson['client'][_0x46df('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a7d41,_0x4f8776,_0x3a525a){return new BPromise(function(_0x53731e,_0x317c4b){return client[_0x46df('0xb')](_0x1a7d41,_0x3a525a)[_0x46df('0xc')](function(_0x4aa812){logger[_0x46df('0xd')](_0x46df('0xe'),_0x4f8776,_0x46df('0xf'));logger[_0x46df('0x10')](_0x46df('0x11'),_0x4f8776,_0x46df('0xf'),JSON[_0x46df('0x12')](_0x4aa812));if(_0x4aa812['error']){if(_0x4aa812['error'][_0x46df('0x13')]===0x1f4){logger[_0x46df('0x14')](_0x46df('0xe'),_0x4f8776,_0x4aa812[_0x46df('0x14')]['message']);return _0x317c4b(_0x4aa812['error'][_0x46df('0x15')]);}logger[_0x46df('0x14')](_0x46df('0xe'),_0x4f8776,_0x4aa812[_0x46df('0x14')][_0x46df('0x15')]);return _0x53731e(_0x4aa812['error'][_0x46df('0x15')]);}else{logger[_0x46df('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x4f8776,'request\x20sent');_0x53731e(_0x4aa812[_0x46df('0x16')][_0x46df('0x15')]);}})[_0x46df('0x17')](function(_0x309056){logger[_0x46df('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x4f8776,_0x309056);_0x317c4b(_0x309056);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 525ff2d..13bb59a 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 _0xd8fb=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','isAuthenticated','post','create','put','update','delete','/:id','destroy','exports'];(function(_0x59daf0,_0x5b22bd){var _0x1f7841=function(_0x5e403a){while(--_0x5e403a){_0x59daf0['push'](_0x59daf0['shift']());}};_0x1f7841(++_0x5b22bd);}(_0xd8fb,0x99));var _0xbd8f=function(_0x1b1107,_0x1cae6b){_0x1b1107=_0x1b1107-0x0;var _0x32a5b9=_0xd8fb[_0x1b1107];return _0x32a5b9;};'use strict';var multer=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var path=require(_0xbd8f('0x2'));var timeout=require(_0xbd8f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd8f('0x4'));var interaction=require(_0xbd8f('0x5'));var config=require('../../config/environment');var controller=require(_0xbd8f('0x6'));router[_0xbd8f('0x7')]('/:id',auth[_0xbd8f('0x8')](),controller['show']);router[_0xbd8f('0x9')]('/',auth['isAuthenticated'](),controller[_0xbd8f('0xa')]);router[_0xbd8f('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xbd8f('0xc')]);router[_0xbd8f('0xd')](_0xbd8f('0xe'),auth['isAuthenticated'](),controller[_0xbd8f('0xf')]);module[_0xbd8f('0x10')]=router;
\ No newline at end of file
+var _0x5d17=['create','put','/:id','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','isAuthenticated','show','post'];(function(_0x1555bf,_0x1051e6){var _0x5ee4ab=function(_0x2d54c4){while(--_0x2d54c4){_0x1555bf['push'](_0x1555bf['shift']());}};_0x5ee4ab(++_0x1051e6);}(_0x5d17,0x114));var _0x75d1=function(_0x1325b5,_0x20c67e){_0x1325b5=_0x1325b5-0x0;var _0x49e29c=_0x5d17[_0x1325b5];return _0x49e29c;};'use strict';var multer=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x75d1('0x2'));var router=express[_0x75d1('0x3')]();var fs_extra=require(_0x75d1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x75d1('0x5'));var config=require(_0x75d1('0x6'));var controller=require(_0x75d1('0x7'));router[_0x75d1('0x8')]('/:id',auth[_0x75d1('0x9')](),controller[_0x75d1('0xa')]);router[_0x75d1('0xb')]('/',auth[_0x75d1('0x9')](),controller[_0x75d1('0xc')]);router[_0x75d1('0xd')](_0x75d1('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x75d1('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x75d1('0x10')]);module[_0x75d1('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 08be0a1..4787a3d 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 _0xff22=['sequelize','exports','name','STRING','INTEGER','rrmemory','roundrobin'];(function(_0x5201c0,_0x171649){var _0x11222a=function(_0x3c0499){while(--_0x3c0499){_0x5201c0['push'](_0x5201c0['shift']());}};_0x11222a(++_0x171649);}(_0xff22,0x17a));var _0x2ff2=function(_0x115310,_0x16e3af){_0x115310=_0x115310-0x0;var _0x3a0c3d=_0xff22[_0x115310];return _0x3a0c3d;};'use strict';var Sequelize=require(_0x2ff2('0x0'));module[_0x2ff2('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2ff2('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2ff2('0x3')]},'timeout':{'type':Sequelize[_0x2ff2('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x2ff2('0x5'),'beepall',_0x2ff2('0x6'))}};
\ No newline at end of file
+var _0xe663=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','INTEGER','ENUM'];(function(_0xb54a3d,_0x1a97c8){var _0x411f46=function(_0x3358bd){while(--_0x3358bd){_0xb54a3d['push'](_0xb54a3d['shift']());}};_0x411f46(++_0x1a97c8);}(_0xe663,0xbb));var _0x3e66=function(_0x1a66dc,_0x5412ef){_0x1a66dc=_0x1a66dc-0x0;var _0x14849a=_0xe663[_0x1a66dc];return _0x14849a;};'use strict';var Sequelize=require(_0x3e66('0x0'));module[_0x3e66('0x1')]={'name':{'type':Sequelize[_0x3e66('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3e66('0x2')]},'timeout':{'type':Sequelize[_0x3e66('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3e66('0x4')](_0x3e66('0x5'),_0x3e66('0x6'),_0x3e66('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 0ad6779..1f5c985 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 _0xed95=['user','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','UserChatQueue','findAndCountAll','agent','chatPause','updatedAt','SIP','createdAt','findOne','Team','getTeams','addTeams','ids','User','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','from','team_has_chat_queues','ChatQueueId\x20=\x20?','Agents','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','ChatQueues','UserProfileResource','end','sendStatus','stack','name','send','index','map','ChatQueue','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x1e58c8,_0x21ef59){var _0x228aee=function(_0x1a9652){while(--_0x1a9652){_0x1e58c8['push'](_0x1e58c8['shift']());}};_0x228aee(++_0x21ef59);}(_0xed95,0x16d));var _0x5ed9=function(_0x365d8d,_0x5c2840){_0x365d8d=_0x365d8d-0x0;var _0x369f87=_0xed95[_0x365d8d];return _0x369f87;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5ed9('0x0'));var zipdir=require(_0x5ed9('0x1'));var jsonpatch=require(_0x5ed9('0x2'));var rp=require(_0x5ed9('0x3'));var moment=require(_0x5ed9('0x4'));var BPromise=require(_0x5ed9('0x5'));var Mustache=require('mustache');var util=require(_0x5ed9('0x6'));var path=require(_0x5ed9('0x7'));var sox=require(_0x5ed9('0x8'));var csv=require('to-csv');var ejs=require(_0x5ed9('0x9'));var fs=require('fs');var fs_extra=require(_0x5ed9('0xa'));var _=require(_0x5ed9('0xb'));var squel=require(_0x5ed9('0xc'));var crypto=require(_0x5ed9('0xd'));var jsforce=require(_0x5ed9('0xe'));var deskjs=require(_0x5ed9('0xf'));var toCsv=require(_0x5ed9('0x10'));var querystring=require('querystring');var Papa=require(_0x5ed9('0x11'));var Redis=require(_0x5ed9('0x12'));var authService=require(_0x5ed9('0x13'));var qs=require(_0x5ed9('0x14'));var as=require(_0x5ed9('0x15'));var hardwareService=require(_0x5ed9('0x16'));var logger=require('../../config/logger')(_0x5ed9('0x17'));var utils=require(_0x5ed9('0x18'));var config=require(_0x5ed9('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x5ed9('0x1a'))['db'];config['redis']=_[_0x5ed9('0x1b')](config[_0x5ed9('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x5ed9('0x1d'))(new Redis(config[_0x5ed9('0x1c')]));require(_0x5ed9('0x1e'))[_0x5ed9('0x1f')](socket);var jayson=require(_0x5ed9('0x20'));var client=jayson['client'][_0x5ed9('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x2faa88,_0x2704fc,_0x1ad808,_0xe37159){return new BPromise(function(_0x5ccf0c,_0x18c14c){var _0x37eaec=_0xe37159||client;return _0x37eaec['request'](_0x2faa88,_0x1ad808)[_0x5ed9('0x22')](function(_0x50268b){logger[_0x5ed9('0x23')](_0x5ed9('0x24'),_0x2704fc,_0x5ed9('0x25'));logger[_0x5ed9('0x26')](_0x5ed9('0x27'),_0x2704fc,_0x5ed9('0x25'),JSON[_0x5ed9('0x28')](_0x50268b));if(_0x50268b[_0x5ed9('0x29')]){if(_0x50268b[_0x5ed9('0x29')][_0x5ed9('0x2a')]===0x1f4){logger[_0x5ed9('0x29')](_0x5ed9('0x24'),_0x2704fc,_0x50268b['error'][_0x5ed9('0x2b')]);return _0x18c14c(_0x50268b[_0x5ed9('0x29')]['message']);}logger[_0x5ed9('0x29')](_0x5ed9('0x24'),_0x2704fc,_0x50268b[_0x5ed9('0x29')]['message']);return _0x5ccf0c(_0x50268b[_0x5ed9('0x29')][_0x5ed9('0x2b')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x2704fc,_0x5ed9('0x25'));_0x5ccf0c(_0x50268b[_0x5ed9('0x2c')][_0x5ed9('0x2b')]);}})[_0x5ed9('0x2d')](function(_0x2fd1eb){logger[_0x5ed9('0x29')](_0x5ed9('0x24'),_0x2704fc,_0x2fd1eb);_0x18c14c(_0x2fd1eb);});});}function respondWithStatusCode(_0xb035ab,_0x1775b2){_0x1775b2=_0x1775b2||0xcc;return function(_0x3b0c2e){if(_0x3b0c2e){return _0xb035ab['sendStatus'](_0x1775b2);}return _0xb035ab['status'](_0x1775b2)['end']();};}function respondWithResult(_0x452224,_0x569ff0){_0x569ff0=_0x569ff0||0xc8;return function(_0x4df88b){if(_0x4df88b){return _0x452224[_0x5ed9('0x2e')](_0x569ff0)[_0x5ed9('0x2f')](_0x4df88b);}};}function respondWithFilteredResult(_0x4436fe,_0x24dd8f){return function(_0x2beb48){if(_0x2beb48){var _0x4fd6d0=typeof _0x24dd8f[_0x5ed9('0x30')]===_0x5ed9('0x31')&&typeof _0x24dd8f[_0x5ed9('0x32')]===_0x5ed9('0x31');var _0x3f3b6f=_0x2beb48[_0x5ed9('0x33')];var _0x3aad3d=_0x4fd6d0?0x0:_0x24dd8f[_0x5ed9('0x30')];var _0x365a87=_0x4fd6d0?_0x2beb48[_0x5ed9('0x33')]:_0x24dd8f[_0x5ed9('0x30')]+_0x24dd8f[_0x5ed9('0x32')];var _0x26e3c5;if(_0x365a87>=_0x3f3b6f){_0x365a87=_0x3f3b6f;_0x26e3c5=0xc8;}else{_0x26e3c5=0xce;}_0x4436fe[_0x5ed9('0x2e')](_0x26e3c5);return _0x4436fe[_0x5ed9('0x34')](_0x5ed9('0x35'),_0x3aad3d+'-'+_0x365a87+'/'+_0x3f3b6f)[_0x5ed9('0x2f')](_0x2beb48);}return null;};}function patchUpdates(_0x37d611){return function(_0x3f66e0){try{jsonpatch[_0x5ed9('0x36')](_0x3f66e0,_0x37d611,!![]);}catch(_0x18538a){return BPromise[_0x5ed9('0x37')](_0x18538a);}return _0x3f66e0[_0x5ed9('0x38')]();};}function saveUpdates(_0xc33f26,_0x5457ec){return function(_0x2540d5){if(_0x2540d5){return _0x2540d5['update'](_0xc33f26)['then'](function(_0xa2b194){return _0xa2b194;});}return null;};}function removeEntity(_0x5c78ad,_0x3513a9){return function(_0x5dc43c){if(_0x5dc43c){return _0x5dc43c[_0x5ed9('0x39')]()[_0x5ed9('0x22')](function(){var _0x1488e7=_0x5dc43c[_0x5ed9('0x3a')]({'plain':!![]});var _0x8aa3ea=_0x5ed9('0x3b');return db[_0x5ed9('0x3c')][_0x5ed9('0x39')]({'where':{'type':_0x8aa3ea,'resourceId':_0x1488e7['id']}})[_0x5ed9('0x22')](function(){return _0x5dc43c;});})[_0x5ed9('0x22')](function(){_0x5c78ad[_0x5ed9('0x2e')](0xcc)[_0x5ed9('0x3d')]();});}};}function handleEntityNotFound(_0x35ba64,_0x572cff){return function(_0x141d3f){if(!_0x141d3f){_0x35ba64[_0x5ed9('0x3e')](0x194);}return _0x141d3f;};}function handleError(_0x2a07c2,_0x1431d0){_0x1431d0=_0x1431d0||0x1f4;return function(_0x21c48c){logger[_0x5ed9('0x29')](_0x21c48c[_0x5ed9('0x3f')]);if(_0x21c48c['name']){delete _0x21c48c[_0x5ed9('0x40')];}_0x2a07c2[_0x5ed9('0x2e')](_0x1431d0)[_0x5ed9('0x41')](_0x21c48c);};}exports[_0x5ed9('0x42')]=function(_0x2d2a33,_0x2e8394){var _0x459e82={},_0x40019c={},_0x12d3d0={'count':0x0,'rows':[]};var _0x3d6c96=_[_0x5ed9('0x43')](db[_0x5ed9('0x44')]['rawAttributes'],function(_0x4a2ff1){return{'name':_0x4a2ff1[_0x5ed9('0x45')],'type':_0x4a2ff1[_0x5ed9('0x46')]['key']};});_0x40019c[_0x5ed9('0x47')]=_[_0x5ed9('0x43')](_0x3d6c96,_0x5ed9('0x40'));_0x40019c[_0x5ed9('0x48')]=_['keys'](_0x2d2a33['query']);_0x40019c[_0x5ed9('0x49')]=_[_0x5ed9('0x4a')](_0x40019c[_0x5ed9('0x47')],_0x40019c[_0x5ed9('0x48')]);_0x459e82['attributes']=_[_0x5ed9('0x4a')](_0x40019c[_0x5ed9('0x47')],qs[_0x5ed9('0x4b')](_0x2d2a33[_0x5ed9('0x48')][_0x5ed9('0x4b')]));_0x459e82[_0x5ed9('0x4c')]=_0x459e82[_0x5ed9('0x4c')][_0x5ed9('0x4d')]?_0x459e82['attributes']:_0x40019c[_0x5ed9('0x47')];if(!_0x2d2a33['query'][_0x5ed9('0x4e')](_0x5ed9('0x4f'))){_0x459e82['limit']=qs[_0x5ed9('0x32')](_0x2d2a33[_0x5ed9('0x48')]['limit']);_0x459e82[_0x5ed9('0x30')]=qs['offset'](_0x2d2a33[_0x5ed9('0x48')]['offset']);}_0x459e82[_0x5ed9('0x50')]=qs[_0x5ed9('0x51')](_0x2d2a33[_0x5ed9('0x48')][_0x5ed9('0x51')]);_0x459e82[_0x5ed9('0x52')]=qs[_0x5ed9('0x49')](_[_0x5ed9('0x53')](_0x2d2a33[_0x5ed9('0x48')],_0x40019c[_0x5ed9('0x49')]),_0x3d6c96);if(_0x2d2a33[_0x5ed9('0x48')][_0x5ed9('0x54')]){_0x459e82['where']=_[_0x5ed9('0x55')](_0x459e82[_0x5ed9('0x52')],{'$or':_[_0x5ed9('0x43')](_0x3d6c96,function(_0x4e62b2){if(_0x4e62b2[_0x5ed9('0x46')]!=='VIRTUAL'){var _0x614321={};_0x614321[_0x4e62b2['name']]={'$like':'%'+_0x2d2a33['query'][_0x5ed9('0x54')]+'%'};return _0x614321;}})});}_0x459e82=_[_0x5ed9('0x55')]({},_0x459e82,_0x2d2a33[_0x5ed9('0x56')]);var _0x3984f8={'where':_0x459e82[_0x5ed9('0x52')]};return db[_0x5ed9('0x44')][_0x5ed9('0x33')](_0x3984f8)[_0x5ed9('0x22')](function(_0x570893){_0x12d3d0[_0x5ed9('0x33')]=_0x570893;if(_0x2d2a33[_0x5ed9('0x48')]['includeAll']){_0x459e82[_0x5ed9('0x57')]=[{'all':!![]}];}return db[_0x5ed9('0x44')][_0x5ed9('0x58')](_0x459e82);})[_0x5ed9('0x22')](function(_0x52c797){_0x12d3d0[_0x5ed9('0x59')]=_0x52c797;return _0x12d3d0;})['then'](respondWithFilteredResult(_0x2e8394,_0x459e82))[_0x5ed9('0x2d')](handleError(_0x2e8394,null));};exports[_0x5ed9('0x5a')]=function(_0x1490d3,_0x269bd6){var _0x5cffba={'raw':!![],'where':{'id':_0x1490d3[_0x5ed9('0x5b')]['id']}},_0x2a0279={};_0x2a0279[_0x5ed9('0x47')]=_[_0x5ed9('0x5c')](db[_0x5ed9('0x44')][_0x5ed9('0x5d')]);_0x2a0279[_0x5ed9('0x48')]=_[_0x5ed9('0x5c')](_0x1490d3[_0x5ed9('0x48')]);_0x2a0279[_0x5ed9('0x49')]=_[_0x5ed9('0x4a')](_0x2a0279[_0x5ed9('0x47')],_0x2a0279[_0x5ed9('0x48')]);_0x5cffba['attributes']=_[_0x5ed9('0x4a')](_0x2a0279[_0x5ed9('0x47')],qs[_0x5ed9('0x4b')](_0x1490d3[_0x5ed9('0x48')][_0x5ed9('0x4b')]));_0x5cffba[_0x5ed9('0x4c')]=_0x5cffba['attributes']['length']?_0x5cffba[_0x5ed9('0x4c')]:_0x2a0279[_0x5ed9('0x47')];if(_0x1490d3[_0x5ed9('0x48')][_0x5ed9('0x5e')]){_0x5cffba[_0x5ed9('0x57')]=[{'all':!![]}];}_0x5cffba=_[_0x5ed9('0x55')]({},_0x5cffba,_0x1490d3[_0x5ed9('0x56')]);return db[_0x5ed9('0x44')][_0x5ed9('0x5f')](_0x5cffba)['then'](handleEntityNotFound(_0x269bd6,null))[_0x5ed9('0x22')](respondWithResult(_0x269bd6,null))[_0x5ed9('0x2d')](handleError(_0x269bd6,null));};exports[_0x5ed9('0x60')]=function(_0x49a260,_0x38c4dc){return db[_0x5ed9('0x44')][_0x5ed9('0x60')](_0x49a260[_0x5ed9('0x61')],{})['then'](function(_0x13b4d0){var _0x18a757=_0x49a260['user']['get']({'plain':!![]});if(!_0x18a757)throw new Error(_0x5ed9('0x62'));if(_0x18a757[_0x5ed9('0x63')]===_0x5ed9('0x64')){var _0x264512=_0x13b4d0[_0x5ed9('0x3a')]({'plain':!![]});var _0x2756f7=_0x5ed9('0x3b');return db[_0x5ed9('0x65')][_0x5ed9('0x5f')]({'where':{'name':_0x2756f7,'userProfileId':_0x18a757[_0x5ed9('0x66')]},'raw':!![]})[_0x5ed9('0x22')](function(_0x30a243){if(_0x30a243&&_0x30a243[_0x5ed9('0x67')]===0x0){return db['UserProfileResource'][_0x5ed9('0x60')]({'name':_0x264512[_0x5ed9('0x40')],'resourceId':_0x264512['id'],'type':_0x30a243['name'],'sectionId':_0x30a243['id']},{})[_0x5ed9('0x22')](function(){return _0x13b4d0;});}else{return _0x13b4d0;}})[_0x5ed9('0x2d')](function(_0x9edc92){logger[_0x5ed9('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x9edc92);throw _0x9edc92;});}return _0x13b4d0;})['then'](respondWithResult(_0x38c4dc,0xc9))[_0x5ed9('0x2d')](handleError(_0x38c4dc,null));};exports['update']=function(_0x26d84b,_0x35095f){if(_0x26d84b[_0x5ed9('0x61')]['id']){delete _0x26d84b[_0x5ed9('0x61')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x26d84b[_0x5ed9('0x5b')]['id']}})[_0x5ed9('0x22')](handleEntityNotFound(_0x35095f,null))['then'](saveUpdates(_0x26d84b[_0x5ed9('0x61')],null))[_0x5ed9('0x22')](respondWithResult(_0x35095f,null))[_0x5ed9('0x2d')](handleError(_0x35095f,null));};exports[_0x5ed9('0x39')]=function(_0x442215,_0x4d6f15){return db[_0x5ed9('0x44')][_0x5ed9('0x5f')]({'where':{'id':_0x442215[_0x5ed9('0x5b')]['id']}})[_0x5ed9('0x22')](handleEntityNotFound(_0x4d6f15,null))['then'](removeEntity(_0x4d6f15,null))[_0x5ed9('0x2d')](handleError(_0x4d6f15,null));};exports[_0x5ed9('0x68')]=function(_0x5703e6,_0x5cf1e0){return db[_0x5ed9('0x44')][_0x5ed9('0x68')]()[_0x5ed9('0x22')](respondWithResult(_0x5cf1e0,null))[_0x5ed9('0x2d')](handleError(_0x5cf1e0,null));};exports[_0x5ed9('0x69')]=function(_0x2f17ed,_0x483b4f,_0xbf0b31){var _0xc7e46b={'raw':!![],'where':{}},_0x3b1f1a={},_0x628ba1;return db[_0x5ed9('0x44')]['findOne']({'where':{'id':_0x2f17ed['params']['id']}})['then'](handleEntityNotFound(_0x483b4f,null))['then'](function(_0x10a13b){if(_0x10a13b){_0x628ba1=_0x10a13b['get']({'plain':!![]});_0x3b1f1a[_0x5ed9('0x47')]=_[_0x5ed9('0x5c')](db['UserChatQueue'][_0x5ed9('0x5d')]);_0x3b1f1a[_0x5ed9('0x48')]=_['keys'](_0x2f17ed[_0x5ed9('0x48')]);_0x3b1f1a[_0x5ed9('0x49')]=_[_0x5ed9('0x4a')](_0x3b1f1a[_0x5ed9('0x47')],_0x3b1f1a[_0x5ed9('0x48')]);_0xc7e46b[_0x5ed9('0x4c')]=_[_0x5ed9('0x4a')](_0x3b1f1a[_0x5ed9('0x47')],qs['fields'](_0x2f17ed[_0x5ed9('0x48')]['fields']));_0xc7e46b[_0x5ed9('0x4c')]=_0xc7e46b[_0x5ed9('0x4c')][_0x5ed9('0x4d')]?_0xc7e46b[_0x5ed9('0x4c')]:_0x3b1f1a[_0x5ed9('0x47')];if(!_0x2f17ed[_0x5ed9('0x48')][_0x5ed9('0x4e')]('nolimit')){_0xc7e46b[_0x5ed9('0x32')]=qs[_0x5ed9('0x32')](_0x2f17ed[_0x5ed9('0x48')][_0x5ed9('0x32')]);_0xc7e46b[_0x5ed9('0x30')]=qs[_0x5ed9('0x30')](_0x2f17ed['query'][_0x5ed9('0x30')]);}_0xc7e46b[_0x5ed9('0x50')]=qs[_0x5ed9('0x51')](_0x2f17ed[_0x5ed9('0x48')][_0x5ed9('0x51')]);_0xc7e46b[_0x5ed9('0x52')]=qs['filters'](_['pick'](_0x2f17ed[_0x5ed9('0x48')],_0x3b1f1a[_0x5ed9('0x49')]));_0xc7e46b[_0x5ed9('0x52')]['ChatQueueId']=_0x10a13b['id'];if(_0x2f17ed[_0x5ed9('0x48')][_0x5ed9('0x54')]){_0xc7e46b['where']=_[_0x5ed9('0x55')](_0xc7e46b[_0x5ed9('0x52')],{'$or':_[_0x5ed9('0x43')](_0xc7e46b['attributes'],function(_0xc63322){var _0x5bd69b={};_0x5bd69b[_0xc63322]={'$like':'%'+_0x2f17ed[_0x5ed9('0x48')][_0x5ed9('0x54')]+'%'};return _0x5bd69b;})});}_0xc7e46b=_[_0x5ed9('0x55')]({},_0xc7e46b,_0x2f17ed[_0x5ed9('0x56')]);return db[_0x5ed9('0x6a')]['findAll'](_0xc7e46b);}})['then'](function(_0x9fd27){if(_0x9fd27){return db['User'][_0x5ed9('0x6b')]({'where':{'id':_[_0x5ed9('0x43')](_0x9fd27,'UserId'),'role':_0x5ed9('0x6c')},'attributes':['id','name',_0x5ed9('0x6d'),_0x5ed9('0x6e'),'createdAt']});}})[_0x5ed9('0x22')](function(_0x4ea298){if(_0x4ea298){return{'count':_0x4ea298[_0x5ed9('0x33')],'rows':_[_0x5ed9('0x43')](_0x4ea298[_0x5ed9('0x59')],function(_0x2626ce){return{'membername':_0x2626ce[_0x5ed9('0x40')],'UserId':_0x2626ce['id'],'queue_name':_0x628ba1[_0x5ed9('0x40')],'ChatQueueId':_0x628ba1['id'],'interface':util['format']('%s/%s',_0x5ed9('0x6f'),_0x2626ce[_0x5ed9('0x40')]),'penalty':0x0,'paused':_0x2626ce[_0x5ed9('0x6d')],'createdAt':_0x2626ce[_0x5ed9('0x70')],'updatedAt':_0x2626ce[_0x5ed9('0x6e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5ed9('0x22')](respondWithFilteredResult(_0x483b4f,_0xc7e46b))['catch'](handleError(_0x483b4f,null));};exports['getTeams']=function(_0x43fb7e,_0x246eaf,_0x517cc7){var _0x29395e={};var _0x4c86cb={};var _0x2dcccd;var _0x466b91;return db[_0x5ed9('0x44')][_0x5ed9('0x71')]({'where':{'id':_0x43fb7e[_0x5ed9('0x5b')]['id']}})[_0x5ed9('0x22')](handleEntityNotFound(_0x246eaf,null))[_0x5ed9('0x22')](function(_0x3fbf03){if(_0x3fbf03){_0x2dcccd=_0x3fbf03;_0x4c86cb[_0x5ed9('0x47')]=_[_0x5ed9('0x5c')](db[_0x5ed9('0x72')]['rawAttributes']);_0x4c86cb[_0x5ed9('0x48')]=_['keys'](_0x43fb7e[_0x5ed9('0x48')]);_0x4c86cb[_0x5ed9('0x49')]=_['intersection'](_0x4c86cb['model'],_0x4c86cb[_0x5ed9('0x48')]);_0x29395e['attributes']=_[_0x5ed9('0x4a')](_0x4c86cb[_0x5ed9('0x47')],qs[_0x5ed9('0x4b')](_0x43fb7e[_0x5ed9('0x48')][_0x5ed9('0x4b')]));_0x29395e[_0x5ed9('0x4c')]=_0x29395e[_0x5ed9('0x4c')]['length']?_0x29395e[_0x5ed9('0x4c')]:_0x4c86cb[_0x5ed9('0x47')];_0x29395e[_0x5ed9('0x50')]=qs[_0x5ed9('0x51')](_0x43fb7e[_0x5ed9('0x48')]['sort']);_0x29395e[_0x5ed9('0x52')]=qs[_0x5ed9('0x49')](_['pick'](_0x43fb7e[_0x5ed9('0x48')],_0x4c86cb[_0x5ed9('0x49')]));if(_0x43fb7e[_0x5ed9('0x48')][_0x5ed9('0x54')]){_0x29395e[_0x5ed9('0x52')]=_[_0x5ed9('0x55')](_0x29395e[_0x5ed9('0x52')],{'$or':_[_0x5ed9('0x43')](_0x29395e['attributes'],function(_0xfbf41f){var _0x17f096={};_0x17f096[_0xfbf41f]={'$like':'%'+_0x43fb7e[_0x5ed9('0x48')]['filter']+'%'};return _0x17f096;})});}_0x29395e=_[_0x5ed9('0x55')]({},_0x29395e,_0x43fb7e['options']);return _0x2dcccd[_0x5ed9('0x73')](_0x29395e);}})[_0x5ed9('0x22')](function(_0x3f25cc){if(_0x3f25cc){_0x466b91=_0x3f25cc[_0x5ed9('0x4d')];if(!_0x43fb7e[_0x5ed9('0x48')][_0x5ed9('0x4e')]('nolimit')){_0x29395e[_0x5ed9('0x32')]=qs[_0x5ed9('0x32')](_0x43fb7e[_0x5ed9('0x48')][_0x5ed9('0x32')]);_0x29395e[_0x5ed9('0x30')]=qs[_0x5ed9('0x30')](_0x43fb7e['query']['offset']);}return _0x2dcccd[_0x5ed9('0x73')](_0x29395e);}})[_0x5ed9('0x22')](function(_0x1c835a){if(_0x1c835a){return _0x1c835a?{'count':_0x466b91,'rows':_0x1c835a}:null;}})[_0x5ed9('0x22')](respondWithResult(_0x246eaf,null))[_0x5ed9('0x2d')](handleError(_0x246eaf,null));};exports[_0x5ed9('0x74')]=function(_0x21be2f,_0x5e95ce,_0x388ddd){var _0x4011ad=_0x21be2f['body'][_0x5ed9('0x75')];return db['Team'][_0x5ed9('0x58')]({'where':{'id':_0x4011ad},'attributes':['id'],'include':[{'model':db[_0x5ed9('0x76')],'as':'Agents','attributes':['id',_0x5ed9('0x40'),_0x5ed9('0x77'),_0x5ed9('0x78'),'interface'],'raw':!![]}]})[_0x5ed9('0x22')](function(_0x112347){if(_0x112347){var _0x70e4e=_[_0x5ed9('0x79')](_0x112347,function(_0x59f4af){var _0x332ee6=_0x59f4af['get']({'plain':!![]});return _0x332ee6['Agents'];});return db['ChatQueue'][_0x5ed9('0x5f')]({'where':{'id':_0x21be2f[_0x5ed9('0x5b')]['id']}})['then'](function(_0x18a44c){return db[_0x5ed9('0x7a')][_0x5ed9('0x7b')](function(_0x241b70){return _0x18a44c[_0x5ed9('0x74')](_0x4011ad,{'transaction':_0x241b70})['then'](function(){return BPromise[_0x5ed9('0x7c')](_0x70e4e,function(_0xaccc85){return db['UserChatQueue'][_0x5ed9('0x7d')]({'where':{'UserId':_0xaccc85['id'],'ChatQueueId':_0x21be2f['params']['id']},'transaction':_0x241b70});});})[_0x5ed9('0x22')](function(){_0x70e4e[_0x5ed9('0x7e')](function(_0x27faa4){socket[_0x5ed9('0x7f')](_0x5ed9('0x80'),{'UserId':_0x27faa4['id'],'ChatQueueId':_0x18a44c['id']});});});});});}})[_0x5ed9('0x22')](respondWithStatusCode(_0x5e95ce,null))[_0x5ed9('0x2d')](handleError(_0x5e95ce,null));};exports[_0x5ed9('0x81')]=function(_0x8cee17,_0x861768,_0x2e68d7){return db[_0x5ed9('0x72')][_0x5ed9('0x58')]({'where':{'id':_0x8cee17[_0x5ed9('0x48')]['ids']},'attributes':['id'],'include':[{'model':db[_0x5ed9('0x76')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x5ed9('0x22')](handleEntityNotFound(_0x861768,null))['then'](function(_0x3fbdd7){var _0x5e0cf0=_['map'](_0x3fbdd7,'id');var _0x2af98e=[];var _0x2b24ad=[];var _0x11af3e=squel['select']();_0x11af3e[_0x5ed9('0x82')](_0x5ed9('0x83'))[_0x5ed9('0x84')](_0x5ed9('0x85'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x5ed9('0x52')](_0x5ed9('0x86'),_0x8cee17['params']['id']);for(var _0x134ba1=0x0;_0x134ba1<_0x3fbdd7[_0x5ed9('0x4d')];_0x134ba1+=0x1){let _0x18364b=_0x3fbdd7[_0x134ba1];for(var _0x43c907=0x0;_0x43c907<_0x18364b[_0x5ed9('0x87')][_0x5ed9('0x4d')];_0x43c907+=0x1){let _0x5153ec=_0x18364b[_0x5ed9('0x87')][_0x43c907];var _0x4f91b6=_0x11af3e[_0x5ed9('0x88')]();_0x4f91b6['where']('ut.UserId\x20=\x20?',_0x5153ec['id']);_0x2b24ad[_0x5ed9('0x89')](db[_0x5ed9('0x7a')]['query'](_0x4f91b6[_0x5ed9('0x8a')](),{'type':db[_0x5ed9('0x7a')][_0x5ed9('0x8b')][_0x5ed9('0x8c')]})[_0x5ed9('0x22')](function(_0x4882d9){if(_0x4882d9[_0x5ed9('0x4d')]===0x1){return _0x5153ec['id'];}else{var _0x16a98b=_[_0x5ed9('0x8d')](_[_0x5ed9('0x43')](_0x4882d9,_0x5ed9('0x8e')),function(_0x3c66ee){return _[_0x5ed9('0x8f')](_0x5e0cf0,_0x3c66ee);});if(_0x16a98b){return _0x5153ec['id'];}}}));}}return BPromise['all'](_0x2b24ad)[_0x5ed9('0x22')](function(_0x30fab9){_0x2af98e=_(_0x2af98e)[_0x5ed9('0x90')](_0x30fab9)[_0x5ed9('0x91')]()[_0x5ed9('0x92')]();return db[_0x5ed9('0x44')][_0x5ed9('0x5f')]({'where':{'id':_0x8cee17[_0x5ed9('0x5b')]['id']}})[_0x5ed9('0x22')](function(_0x9fa205){return db[_0x5ed9('0x7a')]['transaction'](function(_0x3e9030){return _0x9fa205['removeTeams'](_0x8cee17[_0x5ed9('0x48')][_0x5ed9('0x75')],{'transaction':_0x3e9030})['then'](function(){if(!_[_0x5ed9('0x93')](_0x2af98e)){return _0x9fa205[_0x5ed9('0x94')](_0x2af98e,{'transaction':_0x3e9030});}})[_0x5ed9('0x22')](function(){_0x2af98e['forEach'](function(_0xd12b27){socket[_0x5ed9('0x7f')](_0x5ed9('0x95'),{'UserId':_0xd12b27,'ChatQueueId':_0x9fa205['id']});});});});});});})['then'](respondWithStatusCode(_0x861768,null))[_0x5ed9('0x2d')](handleError(_0x861768,null));};exports['addAgents']=function(_0x29501f,_0x169785,_0x597300){return db[_0x5ed9('0x44')]['find']({'where':{'id':_0x29501f['params']['id']}})[_0x5ed9('0x22')](handleEntityNotFound(_0x169785,null))[_0x5ed9('0x22')](function(_0x57ddc4){if(_0x57ddc4){return _0x57ddc4[_0x5ed9('0x96')](_0x29501f[_0x5ed9('0x61')][_0x5ed9('0x75')],_[_0x5ed9('0x97')](_0x29501f['body'],[_0x5ed9('0x75'),'id'])||{})[_0x5ed9('0x98')](function(_0x34fc1d){for(var _0x1d696e=0x0;_0x1d696e<_0x29501f[_0x5ed9('0x61')][_0x5ed9('0x75')][_0x5ed9('0x4d')];_0x1d696e+=0x1){socket[_0x5ed9('0x7f')]('userChatQueue:save',{'UserId':Number(_0x29501f[_0x5ed9('0x61')][_0x5ed9('0x75')][_0x1d696e]),'ChatQueueId':Number(_0x29501f[_0x5ed9('0x5b')]['id'])});}return _0x34fc1d;});}})['then'](respondWithResult(_0x169785,null))['catch'](handleError(_0x169785,null));};exports[_0x5ed9('0x94')]=function(_0x404ce6,_0x19b4b3,_0x2b53d5){return db['ChatQueue'][_0x5ed9('0x5f')]({'where':{'id':_0x404ce6[_0x5ed9('0x5b')]['id']}})[_0x5ed9('0x22')](handleEntityNotFound(_0x19b4b3,null))[_0x5ed9('0x22')](function(_0x41ae3a){if(_0x41ae3a){return _0x41ae3a[_0x5ed9('0x94')](_0x404ce6[_0x5ed9('0x48')][_0x5ed9('0x75')])[_0x5ed9('0x22')](function(){if(_[_0x5ed9('0x99')](_0x404ce6['query'][_0x5ed9('0x75')])){for(var _0x557102=0x0;_0x557102<_0x404ce6[_0x5ed9('0x48')]['ids'][_0x5ed9('0x4d')];_0x557102+=0x1){socket[_0x5ed9('0x7f')](_0x5ed9('0x95'),{'UserId':Number(_0x404ce6[_0x5ed9('0x48')][_0x5ed9('0x75')][_0x557102]),'ChatQueueId':Number(_0x404ce6['params']['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x404ce6['query'][_0x5ed9('0x75')]),'ChatQueueId':Number(_0x404ce6[_0x5ed9('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x19b4b3,null))['catch'](handleError(_0x19b4b3,null));};exports['getAgents']=function(_0x68e47e,_0x2a1949,_0x509344){var _0x4a084f={};var _0x2ed3c0={};var _0x12f397;var _0x16bedd;return db[_0x5ed9('0x44')][_0x5ed9('0x71')]({'where':{'id':_0x68e47e['params']['id']}})[_0x5ed9('0x22')](handleEntityNotFound(_0x2a1949,null))['then'](function(_0xc7708){if(_0xc7708){_0x12f397=_0xc7708;_0x2ed3c0['model']=_['keys'](db[_0x5ed9('0x76')][_0x5ed9('0x5d')]);_0x2ed3c0[_0x5ed9('0x48')]=_[_0x5ed9('0x5c')](_0x68e47e[_0x5ed9('0x48')]);_0x2ed3c0['filters']=_[_0x5ed9('0x4a')](_0x2ed3c0[_0x5ed9('0x47')],_0x2ed3c0[_0x5ed9('0x48')]);_0x4a084f[_0x5ed9('0x4c')]=_['intersection'](_0x2ed3c0['model'],qs[_0x5ed9('0x4b')](_0x68e47e[_0x5ed9('0x48')][_0x5ed9('0x4b')]));_0x4a084f[_0x5ed9('0x4c')]=_0x4a084f[_0x5ed9('0x4c')][_0x5ed9('0x4d')]?_0x4a084f[_0x5ed9('0x4c')]:_0x2ed3c0[_0x5ed9('0x47')];_0x4a084f[_0x5ed9('0x50')]=qs['sort'](_0x68e47e[_0x5ed9('0x48')][_0x5ed9('0x51')]);_0x4a084f[_0x5ed9('0x52')]=qs[_0x5ed9('0x49')](_[_0x5ed9('0x53')](_0x68e47e['query'],_0x2ed3c0[_0x5ed9('0x49')]));if(_0x68e47e['query']['filter']){_0x4a084f['where']=_[_0x5ed9('0x55')](_0x4a084f[_0x5ed9('0x52')],{'$or':_[_0x5ed9('0x43')](_0x4a084f[_0x5ed9('0x4c')],function(_0x21fcc3){var _0x235c94={};_0x235c94[_0x21fcc3]={'$like':'%'+_0x68e47e[_0x5ed9('0x48')][_0x5ed9('0x54')]+'%'};return _0x235c94;})});}_0x4a084f=_['merge']({},_0x4a084f,_0x68e47e[_0x5ed9('0x56')]);return _0x12f397[_0x5ed9('0x9a')](_0x4a084f);}})[_0x5ed9('0x22')](function(_0x42c156){if(_0x42c156){_0x16bedd=_0x42c156[_0x5ed9('0x4d')];if(!_0x68e47e[_0x5ed9('0x48')][_0x5ed9('0x4e')](_0x5ed9('0x4f'))){_0x4a084f[_0x5ed9('0x32')]=qs['limit'](_0x68e47e['query'][_0x5ed9('0x32')]);_0x4a084f[_0x5ed9('0x30')]=qs[_0x5ed9('0x30')](_0x68e47e[_0x5ed9('0x48')][_0x5ed9('0x30')]);}return _0x12f397[_0x5ed9('0x9a')](_0x4a084f);}})['then'](function(_0x5b5aeb){if(_0x5b5aeb){return _0x5b5aeb?{'count':_0x16bedd,'rows':_0x5b5aeb}:null;}})[_0x5ed9('0x22')](respondWithResult(_0x2a1949,null))[_0x5ed9('0x2d')](handleError(_0x2a1949,null));};
\ No newline at end of file
+var _0x7fec=['fs-extra','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','get','ChatQueues','UserProfileResource','stack','name','send','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','map','VIRTUAL','merge','options','includeAll','include','ChatQueue','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','sort','ChatQueueId','findAll','User','findAndCountAll','UserId','agent','chatPause','format','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','getAgents','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs'];(function(_0x557fd2,_0x2c0a7a){var _0x1b54a2=function(_0x2e439b){while(--_0x2e439b){_0x557fd2['push'](_0x557fd2['shift']());}};_0x1b54a2(++_0x2c0a7a);}(_0x7fec,0x128));var _0xc7fe=function(_0x339150,_0x109c60){_0x339150=_0x339150-0x0;var _0x222333=_0x7fec[_0x339150];return _0x222333;};'use strict';var emlformat=require(_0xc7fe('0x0'));var rimraf=require(_0xc7fe('0x1'));var zipdir=require(_0xc7fe('0x2'));var jsonpatch=require(_0xc7fe('0x3'));var rp=require(_0xc7fe('0x4'));var moment=require(_0xc7fe('0x5'));var BPromise=require(_0xc7fe('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc7fe('0x7'));var sox=require(_0xc7fe('0x8'));var csv=require('to-csv');var ejs=require(_0xc7fe('0x9'));var fs=require('fs');var fs_extra=require(_0xc7fe('0xa'));var _=require('lodash');var squel=require(_0xc7fe('0xb'));var crypto=require(_0xc7fe('0xc'));var jsforce=require(_0xc7fe('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc7fe('0xe'));var querystring=require('querystring');var Papa=require(_0xc7fe('0xf'));var Redis=require(_0xc7fe('0x10'));var authService=require(_0xc7fe('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc7fe('0x12'));var hardwareService=require(_0xc7fe('0x13'));var logger=require(_0xc7fe('0x14'))(_0xc7fe('0x15'));var utils=require(_0xc7fe('0x16'));var config=require(_0xc7fe('0x17'));var licenseUtil=require(_0xc7fe('0x18'));var db=require(_0xc7fe('0x19'))['db'];config['redis']=_[_0xc7fe('0x1a')](config[_0xc7fe('0x1b')],{'host':_0xc7fe('0x1c'),'port':0x18eb});var socket=require(_0xc7fe('0x1d'))(new Redis(config[_0xc7fe('0x1b')]));require('./chatQueue.socket')[_0xc7fe('0x1e')](socket);var jayson=require(_0xc7fe('0x1f'));var client=jayson[_0xc7fe('0x20')][_0xc7fe('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x150aaf,_0x203d1b,_0x52c60e,_0x1b061d){return new BPromise(function(_0x3fc4c5,_0x1d1bf8){var _0x35b059=_0x1b061d||client;return _0x35b059['request'](_0x150aaf,_0x52c60e)[_0xc7fe('0x22')](function(_0xc775b0){logger[_0xc7fe('0x23')](_0xc7fe('0x24'),_0x203d1b,_0xc7fe('0x25'));logger[_0xc7fe('0x26')](_0xc7fe('0x27'),_0x203d1b,_0xc7fe('0x25'),JSON[_0xc7fe('0x28')](_0xc775b0));if(_0xc775b0[_0xc7fe('0x29')]){if(_0xc775b0['error'][_0xc7fe('0x2a')]===0x1f4){logger[_0xc7fe('0x29')](_0xc7fe('0x24'),_0x203d1b,_0xc775b0[_0xc7fe('0x29')][_0xc7fe('0x2b')]);return _0x1d1bf8(_0xc775b0[_0xc7fe('0x29')][_0xc7fe('0x2b')]);}logger[_0xc7fe('0x29')](_0xc7fe('0x24'),_0x203d1b,_0xc775b0[_0xc7fe('0x29')][_0xc7fe('0x2b')]);return _0x3fc4c5(_0xc775b0['error'][_0xc7fe('0x2b')]);}else{logger[_0xc7fe('0x23')]('ChatQueue,\x20%s,\x20%s',_0x203d1b,_0xc7fe('0x25'));_0x3fc4c5(_0xc775b0[_0xc7fe('0x2c')][_0xc7fe('0x2b')]);}})[_0xc7fe('0x2d')](function(_0xafc489){logger[_0xc7fe('0x29')]('ChatQueue,\x20%s,\x20%s',_0x203d1b,_0xafc489);_0x1d1bf8(_0xafc489);});});}function respondWithStatusCode(_0x18f795,_0x3dd728){_0x3dd728=_0x3dd728||0xcc;return function(_0x152d5d){if(_0x152d5d){return _0x18f795[_0xc7fe('0x2e')](_0x3dd728);}return _0x18f795[_0xc7fe('0x2f')](_0x3dd728)[_0xc7fe('0x30')]();};}function respondWithResult(_0x37c579,_0x4a0848){_0x4a0848=_0x4a0848||0xc8;return function(_0x4e05d8){if(_0x4e05d8){return _0x37c579[_0xc7fe('0x2f')](_0x4a0848)[_0xc7fe('0x31')](_0x4e05d8);}};}function respondWithFilteredResult(_0x4c070b,_0x3098db){return function(_0x3e2b0e){if(_0x3e2b0e){var _0x31505a=typeof _0x3098db[_0xc7fe('0x32')]===_0xc7fe('0x33')&&typeof _0x3098db[_0xc7fe('0x34')]===_0xc7fe('0x33');var _0xeccfee=_0x3e2b0e[_0xc7fe('0x35')];var _0x44d736=_0x31505a?0x0:_0x3098db[_0xc7fe('0x32')];var _0xeec5ce=_0x31505a?_0x3e2b0e[_0xc7fe('0x35')]:_0x3098db[_0xc7fe('0x32')]+_0x3098db[_0xc7fe('0x34')];var _0x1b4254;if(_0xeec5ce>=_0xeccfee){_0xeec5ce=_0xeccfee;_0x1b4254=0xc8;}else{_0x1b4254=0xce;}_0x4c070b['status'](_0x1b4254);return _0x4c070b[_0xc7fe('0x36')](_0xc7fe('0x37'),_0x44d736+'-'+_0xeec5ce+'/'+_0xeccfee)[_0xc7fe('0x31')](_0x3e2b0e);}return null;};}function patchUpdates(_0x48c58d){return function(_0x3aa1b3){try{jsonpatch['apply'](_0x3aa1b3,_0x48c58d,!![]);}catch(_0x5f143d){return BPromise[_0xc7fe('0x38')](_0x5f143d);}return _0x3aa1b3[_0xc7fe('0x39')]();};}function saveUpdates(_0x52280f,_0x34c4ec){return function(_0x5020ac){if(_0x5020ac){return _0x5020ac['update'](_0x52280f)[_0xc7fe('0x22')](function(_0x594b78){return _0x594b78;});}return null;};}function removeEntity(_0xd5ca2e,_0x49953e){return function(_0x4ab5a5){if(_0x4ab5a5){return _0x4ab5a5[_0xc7fe('0x3a')]()[_0xc7fe('0x22')](function(){var _0x41c121=_0x4ab5a5[_0xc7fe('0x3b')]({'plain':!![]});var _0x5c9b4a=_0xc7fe('0x3c');return db[_0xc7fe('0x3d')][_0xc7fe('0x3a')]({'where':{'type':_0x5c9b4a,'resourceId':_0x41c121['id']}})['then'](function(){return _0x4ab5a5;});})[_0xc7fe('0x22')](function(){_0xd5ca2e[_0xc7fe('0x2f')](0xcc)[_0xc7fe('0x30')]();});}};}function handleEntityNotFound(_0x7e8651,_0x8c43a){return function(_0x449f5b){if(!_0x449f5b){_0x7e8651[_0xc7fe('0x2e')](0x194);}return _0x449f5b;};}function handleError(_0x5cdede,_0x329fc7){_0x329fc7=_0x329fc7||0x1f4;return function(_0x2a66ff){logger[_0xc7fe('0x29')](_0x2a66ff[_0xc7fe('0x3e')]);if(_0x2a66ff[_0xc7fe('0x3f')]){delete _0x2a66ff[_0xc7fe('0x3f')];}_0x5cdede[_0xc7fe('0x2f')](_0x329fc7)[_0xc7fe('0x40')](_0x2a66ff);};}exports['index']=function(_0x14d640,_0x4ab194){var _0xc556fc={},_0x59a184={},_0x4a5810={'count':0x0,'rows':[]};var _0x2b5245=_['map'](db['ChatQueue'][_0xc7fe('0x41')],function(_0x45bfe7){return{'name':_0x45bfe7['fieldName'],'type':_0x45bfe7[_0xc7fe('0x42')][_0xc7fe('0x43')]};});_0x59a184[_0xc7fe('0x44')]=_['map'](_0x2b5245,_0xc7fe('0x3f'));_0x59a184[_0xc7fe('0x45')]=_[_0xc7fe('0x46')](_0x14d640[_0xc7fe('0x45')]);_0x59a184[_0xc7fe('0x47')]=_['intersection'](_0x59a184[_0xc7fe('0x44')],_0x59a184[_0xc7fe('0x45')]);_0xc556fc[_0xc7fe('0x48')]=_[_0xc7fe('0x49')](_0x59a184['model'],qs[_0xc7fe('0x4a')](_0x14d640[_0xc7fe('0x45')][_0xc7fe('0x4a')]));_0xc556fc[_0xc7fe('0x48')]=_0xc556fc[_0xc7fe('0x48')][_0xc7fe('0x4b')]?_0xc556fc[_0xc7fe('0x48')]:_0x59a184[_0xc7fe('0x44')];if(!_0x14d640['query'][_0xc7fe('0x4c')](_0xc7fe('0x4d'))){_0xc556fc[_0xc7fe('0x34')]=qs[_0xc7fe('0x34')](_0x14d640[_0xc7fe('0x45')][_0xc7fe('0x34')]);_0xc556fc['offset']=qs['offset'](_0x14d640[_0xc7fe('0x45')][_0xc7fe('0x32')]);}_0xc556fc[_0xc7fe('0x4e')]=qs['sort'](_0x14d640[_0xc7fe('0x45')]['sort']);_0xc556fc[_0xc7fe('0x4f')]=qs['filters'](_[_0xc7fe('0x50')](_0x14d640[_0xc7fe('0x45')],_0x59a184['filters']),_0x2b5245);if(_0x14d640['query'][_0xc7fe('0x51')]){_0xc556fc[_0xc7fe('0x4f')]=_['merge'](_0xc556fc['where'],{'$or':_[_0xc7fe('0x52')](_0x2b5245,function(_0x53c8dd){if(_0x53c8dd['type']!==_0xc7fe('0x53')){var _0x23827d={};_0x23827d[_0x53c8dd[_0xc7fe('0x3f')]]={'$like':'%'+_0x14d640[_0xc7fe('0x45')][_0xc7fe('0x51')]+'%'};return _0x23827d;}})});}_0xc556fc=_[_0xc7fe('0x54')]({},_0xc556fc,_0x14d640[_0xc7fe('0x55')]);var _0x3c86a7={'where':_0xc556fc['where']};return db['ChatQueue'][_0xc7fe('0x35')](_0x3c86a7)[_0xc7fe('0x22')](function(_0xa8b85f){_0x4a5810[_0xc7fe('0x35')]=_0xa8b85f;if(_0x14d640[_0xc7fe('0x45')][_0xc7fe('0x56')]){_0xc556fc[_0xc7fe('0x57')]=[{'all':!![]}];}return db[_0xc7fe('0x58')]['findAll'](_0xc556fc);})[_0xc7fe('0x22')](function(_0x255ae6){_0x4a5810[_0xc7fe('0x59')]=_0x255ae6;return _0x4a5810;})['then'](respondWithFilteredResult(_0x4ab194,_0xc556fc))[_0xc7fe('0x2d')](handleError(_0x4ab194,null));};exports[_0xc7fe('0x5a')]=function(_0x166e23,_0xc97d79){var _0x584d10={'raw':!![],'where':{'id':_0x166e23[_0xc7fe('0x5b')]['id']}},_0x16af92={};_0x16af92[_0xc7fe('0x44')]=_['keys'](db[_0xc7fe('0x58')][_0xc7fe('0x41')]);_0x16af92['query']=_[_0xc7fe('0x46')](_0x166e23[_0xc7fe('0x45')]);_0x16af92[_0xc7fe('0x47')]=_[_0xc7fe('0x49')](_0x16af92[_0xc7fe('0x44')],_0x16af92[_0xc7fe('0x45')]);_0x584d10['attributes']=_[_0xc7fe('0x49')](_0x16af92[_0xc7fe('0x44')],qs['fields'](_0x166e23[_0xc7fe('0x45')][_0xc7fe('0x4a')]));_0x584d10['attributes']=_0x584d10[_0xc7fe('0x48')][_0xc7fe('0x4b')]?_0x584d10[_0xc7fe('0x48')]:_0x16af92['model'];if(_0x166e23[_0xc7fe('0x45')]['includeAll']){_0x584d10[_0xc7fe('0x57')]=[{'all':!![]}];}_0x584d10=_['merge']({},_0x584d10,_0x166e23[_0xc7fe('0x55')]);return db[_0xc7fe('0x58')][_0xc7fe('0x5c')](_0x584d10)[_0xc7fe('0x22')](handleEntityNotFound(_0xc97d79,null))[_0xc7fe('0x22')](respondWithResult(_0xc97d79,null))[_0xc7fe('0x2d')](handleError(_0xc97d79,null));};exports['create']=function(_0x97f041,_0x346209){return db[_0xc7fe('0x58')][_0xc7fe('0x5d')](_0x97f041[_0xc7fe('0x5e')],{})[_0xc7fe('0x22')](function(_0x46577a){var _0x3da62d=_0x97f041[_0xc7fe('0x5f')][_0xc7fe('0x3b')]({'plain':!![]});if(!_0x3da62d)throw new Error(_0xc7fe('0x60'));if(_0x3da62d['role']==='user'){var _0x385049=_0x46577a[_0xc7fe('0x3b')]({'plain':!![]});var _0xa26c51='ChatQueues';return db[_0xc7fe('0x61')][_0xc7fe('0x5c')]({'where':{'name':_0xa26c51,'userProfileId':_0x3da62d[_0xc7fe('0x62')]},'raw':!![]})[_0xc7fe('0x22')](function(_0xd166ea){if(_0xd166ea&&_0xd166ea[_0xc7fe('0x63')]===0x0){return db[_0xc7fe('0x3d')]['create']({'name':_0x385049[_0xc7fe('0x3f')],'resourceId':_0x385049['id'],'type':_0xd166ea['name'],'sectionId':_0xd166ea['id']},{})[_0xc7fe('0x22')](function(){return _0x46577a;});}else{return _0x46577a;}})['catch'](function(_0x1ca3ef){logger[_0xc7fe('0x29')](_0xc7fe('0x64'),_0x1ca3ef);throw _0x1ca3ef;});}return _0x46577a;})[_0xc7fe('0x22')](respondWithResult(_0x346209,0xc9))['catch'](handleError(_0x346209,null));};exports['update']=function(_0x52f6ef,_0x283f0d){if(_0x52f6ef[_0xc7fe('0x5e')]['id']){delete _0x52f6ef[_0xc7fe('0x5e')]['id'];}return db[_0xc7fe('0x58')][_0xc7fe('0x5c')]({'where':{'id':_0x52f6ef['params']['id']}})[_0xc7fe('0x22')](handleEntityNotFound(_0x283f0d,null))['then'](saveUpdates(_0x52f6ef[_0xc7fe('0x5e')],null))[_0xc7fe('0x22')](respondWithResult(_0x283f0d,null))['catch'](handleError(_0x283f0d,null));};exports[_0xc7fe('0x3a')]=function(_0x9e6558,_0x220fc1){return db[_0xc7fe('0x58')][_0xc7fe('0x5c')]({'where':{'id':_0x9e6558[_0xc7fe('0x5b')]['id']}})[_0xc7fe('0x22')](handleEntityNotFound(_0x220fc1,null))[_0xc7fe('0x22')](removeEntity(_0x220fc1,null))[_0xc7fe('0x2d')](handleError(_0x220fc1,null));};exports[_0xc7fe('0x65')]=function(_0x2cfab4,_0x529e27){return db['ChatQueue'][_0xc7fe('0x65')]()[_0xc7fe('0x22')](respondWithResult(_0x529e27,null))[_0xc7fe('0x2d')](handleError(_0x529e27,null));};exports[_0xc7fe('0x66')]=function(_0x1f54b1,_0x5e23fc,_0x530541){var _0x4ddf42={'raw':!![],'where':{}},_0x23c298={},_0x29727b;return db[_0xc7fe('0x58')]['findOne']({'where':{'id':_0x1f54b1[_0xc7fe('0x5b')]['id']}})[_0xc7fe('0x22')](handleEntityNotFound(_0x5e23fc,null))['then'](function(_0x50946a){if(_0x50946a){_0x29727b=_0x50946a['get']({'plain':!![]});_0x23c298[_0xc7fe('0x44')]=_['keys'](db[_0xc7fe('0x67')][_0xc7fe('0x41')]);_0x23c298['query']=_[_0xc7fe('0x46')](_0x1f54b1[_0xc7fe('0x45')]);_0x23c298[_0xc7fe('0x47')]=_[_0xc7fe('0x49')](_0x23c298['model'],_0x23c298[_0xc7fe('0x45')]);_0x4ddf42[_0xc7fe('0x48')]=_[_0xc7fe('0x49')](_0x23c298[_0xc7fe('0x44')],qs[_0xc7fe('0x4a')](_0x1f54b1[_0xc7fe('0x45')][_0xc7fe('0x4a')]));_0x4ddf42['attributes']=_0x4ddf42[_0xc7fe('0x48')]['length']?_0x4ddf42[_0xc7fe('0x48')]:_0x23c298[_0xc7fe('0x44')];if(!_0x1f54b1['query'][_0xc7fe('0x4c')](_0xc7fe('0x4d'))){_0x4ddf42[_0xc7fe('0x34')]=qs[_0xc7fe('0x34')](_0x1f54b1[_0xc7fe('0x45')]['limit']);_0x4ddf42[_0xc7fe('0x32')]=qs['offset'](_0x1f54b1[_0xc7fe('0x45')][_0xc7fe('0x32')]);}_0x4ddf42[_0xc7fe('0x4e')]=qs[_0xc7fe('0x68')](_0x1f54b1[_0xc7fe('0x45')][_0xc7fe('0x68')]);_0x4ddf42[_0xc7fe('0x4f')]=qs['filters'](_[_0xc7fe('0x50')](_0x1f54b1['query'],_0x23c298[_0xc7fe('0x47')]));_0x4ddf42[_0xc7fe('0x4f')][_0xc7fe('0x69')]=_0x50946a['id'];if(_0x1f54b1['query'][_0xc7fe('0x51')]){_0x4ddf42[_0xc7fe('0x4f')]=_['merge'](_0x4ddf42[_0xc7fe('0x4f')],{'$or':_[_0xc7fe('0x52')](_0x4ddf42[_0xc7fe('0x48')],function(_0x5cfc1c){var _0x386050={};_0x386050[_0x5cfc1c]={'$like':'%'+_0x1f54b1[_0xc7fe('0x45')][_0xc7fe('0x51')]+'%'};return _0x386050;})});}_0x4ddf42=_[_0xc7fe('0x54')]({},_0x4ddf42,_0x1f54b1['options']);return db[_0xc7fe('0x67')][_0xc7fe('0x6a')](_0x4ddf42);}})['then'](function(_0x131567){if(_0x131567){return db[_0xc7fe('0x6b')][_0xc7fe('0x6c')]({'where':{'id':_[_0xc7fe('0x52')](_0x131567,_0xc7fe('0x6d')),'role':_0xc7fe('0x6e')},'attributes':['id',_0xc7fe('0x3f'),_0xc7fe('0x6f'),'updatedAt','createdAt']});}})['then'](function(_0x3f42ab){if(_0x3f42ab){return{'count':_0x3f42ab[_0xc7fe('0x35')],'rows':_['map'](_0x3f42ab[_0xc7fe('0x59')],function(_0x366405){return{'membername':_0x366405[_0xc7fe('0x3f')],'UserId':_0x366405['id'],'queue_name':_0x29727b['name'],'ChatQueueId':_0x29727b['id'],'interface':util[_0xc7fe('0x70')]('%s/%s',_0xc7fe('0x71'),_0x366405[_0xc7fe('0x3f')]),'penalty':0x0,'paused':_0x366405[_0xc7fe('0x6f')],'createdAt':_0x366405[_0xc7fe('0x72')],'updatedAt':_0x366405['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xc7fe('0x22')](respondWithFilteredResult(_0x5e23fc,_0x4ddf42))['catch'](handleError(_0x5e23fc,null));};exports[_0xc7fe('0x73')]=function(_0x2aad39,_0x3276e1,_0x1cd56d){var _0x3240fc={};var _0x3d146b={};var _0x32ad8;var _0x5a5e03;return db[_0xc7fe('0x58')]['findOne']({'where':{'id':_0x2aad39[_0xc7fe('0x5b')]['id']}})[_0xc7fe('0x22')](handleEntityNotFound(_0x3276e1,null))[_0xc7fe('0x22')](function(_0x163c16){if(_0x163c16){_0x32ad8=_0x163c16;_0x3d146b['model']=_[_0xc7fe('0x46')](db[_0xc7fe('0x74')][_0xc7fe('0x41')]);_0x3d146b[_0xc7fe('0x45')]=_['keys'](_0x2aad39[_0xc7fe('0x45')]);_0x3d146b[_0xc7fe('0x47')]=_[_0xc7fe('0x49')](_0x3d146b['model'],_0x3d146b[_0xc7fe('0x45')]);_0x3240fc[_0xc7fe('0x48')]=_[_0xc7fe('0x49')](_0x3d146b[_0xc7fe('0x44')],qs[_0xc7fe('0x4a')](_0x2aad39['query']['fields']));_0x3240fc[_0xc7fe('0x48')]=_0x3240fc[_0xc7fe('0x48')][_0xc7fe('0x4b')]?_0x3240fc[_0xc7fe('0x48')]:_0x3d146b[_0xc7fe('0x44')];_0x3240fc[_0xc7fe('0x4e')]=qs[_0xc7fe('0x68')](_0x2aad39[_0xc7fe('0x45')]['sort']);_0x3240fc['where']=qs['filters'](_[_0xc7fe('0x50')](_0x2aad39['query'],_0x3d146b['filters']));if(_0x2aad39[_0xc7fe('0x45')][_0xc7fe('0x51')]){_0x3240fc[_0xc7fe('0x4f')]=_[_0xc7fe('0x54')](_0x3240fc[_0xc7fe('0x4f')],{'$or':_[_0xc7fe('0x52')](_0x3240fc[_0xc7fe('0x48')],function(_0x4fc30b){var _0x8cf4cc={};_0x8cf4cc[_0x4fc30b]={'$like':'%'+_0x2aad39[_0xc7fe('0x45')]['filter']+'%'};return _0x8cf4cc;})});}_0x3240fc=_[_0xc7fe('0x54')]({},_0x3240fc,_0x2aad39[_0xc7fe('0x55')]);return _0x32ad8[_0xc7fe('0x73')](_0x3240fc);}})[_0xc7fe('0x22')](function(_0x21c33f){if(_0x21c33f){_0x5a5e03=_0x21c33f[_0xc7fe('0x4b')];if(!_0x2aad39[_0xc7fe('0x45')][_0xc7fe('0x4c')](_0xc7fe('0x4d'))){_0x3240fc[_0xc7fe('0x34')]=qs[_0xc7fe('0x34')](_0x2aad39[_0xc7fe('0x45')]['limit']);_0x3240fc[_0xc7fe('0x32')]=qs[_0xc7fe('0x32')](_0x2aad39[_0xc7fe('0x45')][_0xc7fe('0x32')]);}return _0x32ad8['getTeams'](_0x3240fc);}})['then'](function(_0x2ab78f){if(_0x2ab78f){return _0x2ab78f?{'count':_0x5a5e03,'rows':_0x2ab78f}:null;}})['then'](respondWithResult(_0x3276e1,null))[_0xc7fe('0x2d')](handleError(_0x3276e1,null));};exports[_0xc7fe('0x75')]=function(_0x4b547e,_0x5e27e5,_0x33203a){var _0x6257c0=_0x4b547e[_0xc7fe('0x5e')][_0xc7fe('0x76')];return db[_0xc7fe('0x74')][_0xc7fe('0x6a')]({'where':{'id':_0x6257c0},'attributes':['id'],'include':[{'model':db[_0xc7fe('0x6b')],'as':_0xc7fe('0x77'),'attributes':['id',_0xc7fe('0x3f'),'online','voicePause',_0xc7fe('0x78')],'raw':!![]}]})[_0xc7fe('0x22')](function(_0xd77d28){if(_0xd77d28){var _0x53e732=_['flatMap'](_0xd77d28,function(_0x11836c){var _0x10345d=_0x11836c[_0xc7fe('0x3b')]({'plain':!![]});return _0x10345d['Agents'];});return db['ChatQueue'][_0xc7fe('0x5c')]({'where':{'id':_0x4b547e[_0xc7fe('0x5b')]['id']}})[_0xc7fe('0x22')](function(_0x36cbc6){return db[_0xc7fe('0x79')][_0xc7fe('0x7a')](function(_0x2a41b7){return _0x36cbc6[_0xc7fe('0x75')](_0x6257c0,{'transaction':_0x2a41b7})[_0xc7fe('0x22')](function(){return BPromise[_0xc7fe('0x7b')](_0x53e732,function(_0x2ab1fe){return db[_0xc7fe('0x67')][_0xc7fe('0x7c')]({'where':{'UserId':_0x2ab1fe['id'],'ChatQueueId':_0x4b547e['params']['id']},'transaction':_0x2a41b7});});})[_0xc7fe('0x22')](function(){_0x53e732[_0xc7fe('0x7d')](function(_0x1954a4){socket[_0xc7fe('0x7e')](_0xc7fe('0x7f'),{'UserId':_0x1954a4['id'],'ChatQueueId':_0x36cbc6['id']});});});});});}})[_0xc7fe('0x22')](respondWithStatusCode(_0x5e27e5,null))[_0xc7fe('0x2d')](handleError(_0x5e27e5,null));};exports[_0xc7fe('0x80')]=function(_0x19791f,_0x4af615,_0x45b963){return db[_0xc7fe('0x74')]['findAll']({'where':{'id':_0x19791f[_0xc7fe('0x45')][_0xc7fe('0x76')]},'attributes':['id'],'include':[{'model':db[_0xc7fe('0x6b')],'as':_0xc7fe('0x77'),'attributes':['id'],'raw':!![]}]})[_0xc7fe('0x22')](handleEntityNotFound(_0x4af615,null))[_0xc7fe('0x22')](function(_0xab13db){var _0x28ece9=_[_0xc7fe('0x52')](_0xab13db,'id');var _0x14d181=[];var _0x41aad6=[];var _0x46a694=squel['select']();_0x46a694[_0xc7fe('0x81')](_0xc7fe('0x82'))[_0xc7fe('0x83')](_0xc7fe('0x84'),'tq')[_0xc7fe('0x85')]('user_has_teams','ut',_0xc7fe('0x86'))[_0xc7fe('0x4f')](_0xc7fe('0x87'),_0x19791f[_0xc7fe('0x5b')]['id']);for(var _0x3a93e7=0x0;_0x3a93e7<_0xab13db[_0xc7fe('0x4b')];_0x3a93e7+=0x1){let _0x3f7b15=_0xab13db[_0x3a93e7];for(var _0x4d0edb=0x0;_0x4d0edb<_0x3f7b15[_0xc7fe('0x77')][_0xc7fe('0x4b')];_0x4d0edb+=0x1){let _0x354bb7=_0x3f7b15[_0xc7fe('0x77')][_0x4d0edb];var _0x1d4093=_0x46a694[_0xc7fe('0x88')]();_0x1d4093[_0xc7fe('0x4f')](_0xc7fe('0x89'),_0x354bb7['id']);_0x41aad6['push'](db[_0xc7fe('0x79')]['query'](_0x1d4093[_0xc7fe('0x8a')](),{'type':db[_0xc7fe('0x79')][_0xc7fe('0x8b')][_0xc7fe('0x8c')]})[_0xc7fe('0x22')](function(_0x8ab728){if(_0x8ab728[_0xc7fe('0x4b')]===0x1){return _0x354bb7['id'];}else{var _0x328e30=_[_0xc7fe('0x8d')](_['map'](_0x8ab728,_0xc7fe('0x8e')),function(_0x697259){return _['includes'](_0x28ece9,_0x697259);});if(_0x328e30){return _0x354bb7['id'];}}}));}}return BPromise['all'](_0x41aad6)['then'](function(_0x1b7304){_0x14d181=_(_0x14d181)[_0xc7fe('0x8f')](_0x1b7304)[_0xc7fe('0x90')]()[_0xc7fe('0x91')]();return db[_0xc7fe('0x58')][_0xc7fe('0x5c')]({'where':{'id':_0x19791f['params']['id']}})[_0xc7fe('0x22')](function(_0x2b79e8){return db['sequelize'][_0xc7fe('0x7a')](function(_0x53217e){return _0x2b79e8[_0xc7fe('0x80')](_0x19791f[_0xc7fe('0x45')][_0xc7fe('0x76')],{'transaction':_0x53217e})['then'](function(){if(!_[_0xc7fe('0x92')](_0x14d181)){return _0x2b79e8[_0xc7fe('0x93')](_0x14d181,{'transaction':_0x53217e});}})[_0xc7fe('0x22')](function(){_0x14d181['forEach'](function(_0x3c408d){socket[_0xc7fe('0x7e')](_0xc7fe('0x94'),{'UserId':_0x3c408d,'ChatQueueId':_0x2b79e8['id']});});});});});});})[_0xc7fe('0x22')](respondWithStatusCode(_0x4af615,null))[_0xc7fe('0x2d')](handleError(_0x4af615,null));};exports[_0xc7fe('0x95')]=function(_0x638af5,_0x2335a9,_0x204bd9){return db[_0xc7fe('0x58')][_0xc7fe('0x5c')]({'where':{'id':_0x638af5[_0xc7fe('0x5b')]['id']}})[_0xc7fe('0x22')](handleEntityNotFound(_0x2335a9,null))['then'](function(_0xb44dc9){if(_0xb44dc9){return _0xb44dc9[_0xc7fe('0x95')](_0x638af5[_0xc7fe('0x5e')][_0xc7fe('0x76')],_['omit'](_0x638af5[_0xc7fe('0x5e')],[_0xc7fe('0x76'),'id'])||{})[_0xc7fe('0x96')](function(_0x69303b){for(var _0x211cd8=0x0;_0x211cd8<_0x638af5[_0xc7fe('0x5e')][_0xc7fe('0x76')]['length'];_0x211cd8+=0x1){socket[_0xc7fe('0x7e')]('userChatQueue:save',{'UserId':Number(_0x638af5[_0xc7fe('0x5e')][_0xc7fe('0x76')][_0x211cd8]),'ChatQueueId':Number(_0x638af5[_0xc7fe('0x5b')]['id'])});}return _0x69303b;});}})[_0xc7fe('0x22')](respondWithResult(_0x2335a9,null))[_0xc7fe('0x2d')](handleError(_0x2335a9,null));};exports[_0xc7fe('0x93')]=function(_0x3c083e,_0x179a25,_0x38d709){return db[_0xc7fe('0x58')][_0xc7fe('0x5c')]({'where':{'id':_0x3c083e[_0xc7fe('0x5b')]['id']}})['then'](handleEntityNotFound(_0x179a25,null))['then'](function(_0x4c1d61){if(_0x4c1d61){return _0x4c1d61[_0xc7fe('0x93')](_0x3c083e[_0xc7fe('0x45')][_0xc7fe('0x76')])[_0xc7fe('0x22')](function(){if(_['isArray'](_0x3c083e[_0xc7fe('0x45')][_0xc7fe('0x76')])){for(var _0x4de991=0x0;_0x4de991<_0x3c083e[_0xc7fe('0x45')]['ids'][_0xc7fe('0x4b')];_0x4de991+=0x1){socket[_0xc7fe('0x7e')](_0xc7fe('0x94'),{'UserId':Number(_0x3c083e[_0xc7fe('0x45')][_0xc7fe('0x76')][_0x4de991]),'ChatQueueId':Number(_0x3c083e[_0xc7fe('0x5b')]['id'])});}}else{socket[_0xc7fe('0x7e')](_0xc7fe('0x94'),{'UserId':Number(_0x3c083e[_0xc7fe('0x45')][_0xc7fe('0x76')]),'ChatQueueId':Number(_0x3c083e['params']['id'])});}});}})['then'](respondWithStatusCode(_0x179a25,null))['catch'](handleError(_0x179a25,null));};exports[_0xc7fe('0x97')]=function(_0x27f614,_0x583edc,_0x42a624){var _0x37eddb={};var _0x549e17={};var _0x4e3eda;var _0x5a7e8c;return db[_0xc7fe('0x58')][_0xc7fe('0x98')]({'where':{'id':_0x27f614[_0xc7fe('0x5b')]['id']}})[_0xc7fe('0x22')](handleEntityNotFound(_0x583edc,null))['then'](function(_0x454373){if(_0x454373){_0x4e3eda=_0x454373;_0x549e17[_0xc7fe('0x44')]=_[_0xc7fe('0x46')](db[_0xc7fe('0x6b')][_0xc7fe('0x41')]);_0x549e17[_0xc7fe('0x45')]=_[_0xc7fe('0x46')](_0x27f614[_0xc7fe('0x45')]);_0x549e17['filters']=_[_0xc7fe('0x49')](_0x549e17[_0xc7fe('0x44')],_0x549e17['query']);_0x37eddb[_0xc7fe('0x48')]=_[_0xc7fe('0x49')](_0x549e17[_0xc7fe('0x44')],qs['fields'](_0x27f614['query'][_0xc7fe('0x4a')]));_0x37eddb[_0xc7fe('0x48')]=_0x37eddb[_0xc7fe('0x48')]['length']?_0x37eddb[_0xc7fe('0x48')]:_0x549e17[_0xc7fe('0x44')];_0x37eddb[_0xc7fe('0x4e')]=qs['sort'](_0x27f614[_0xc7fe('0x45')][_0xc7fe('0x68')]);_0x37eddb['where']=qs[_0xc7fe('0x47')](_[_0xc7fe('0x50')](_0x27f614[_0xc7fe('0x45')],_0x549e17['filters']));if(_0x27f614[_0xc7fe('0x45')][_0xc7fe('0x51')]){_0x37eddb[_0xc7fe('0x4f')]=_[_0xc7fe('0x54')](_0x37eddb['where'],{'$or':_[_0xc7fe('0x52')](_0x37eddb[_0xc7fe('0x48')],function(_0x1ee6f0){var _0x442429={};_0x442429[_0x1ee6f0]={'$like':'%'+_0x27f614['query'][_0xc7fe('0x51')]+'%'};return _0x442429;})});}_0x37eddb=_['merge']({},_0x37eddb,_0x27f614['options']);return _0x4e3eda[_0xc7fe('0x97')](_0x37eddb);}})[_0xc7fe('0x22')](function(_0x265eb3){if(_0x265eb3){_0x5a7e8c=_0x265eb3[_0xc7fe('0x4b')];if(!_0x27f614[_0xc7fe('0x45')][_0xc7fe('0x4c')](_0xc7fe('0x4d'))){_0x37eddb[_0xc7fe('0x34')]=qs['limit'](_0x27f614[_0xc7fe('0x45')][_0xc7fe('0x34')]);_0x37eddb[_0xc7fe('0x32')]=qs[_0xc7fe('0x32')](_0x27f614[_0xc7fe('0x45')][_0xc7fe('0x32')]);}return _0x4e3eda[_0xc7fe('0x97')](_0x37eddb);}})['then'](function(_0x2ef053){if(_0x2ef053){return _0x2ef053?{'count':_0x5a7e8c,'rows':_0x2ef053}:null;}})[_0xc7fe('0x22')](respondWithResult(_0x583edc,null))[_0xc7fe('0x2d')](handleError(_0x583edc,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index af093b4..d7537fc 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 _0x5824=['ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x5824,0x14c));var _0x4582=function(_0x124472,_0x3f6e2d){_0x124472=_0x124472-0x0;var _0x3fc192=_0x5824[_0x124472];return _0x3fc192;};'use strict';var EventEmitter=require(_0x4582('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x4582('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4582('0x2')](0x0);var events={'afterCreate':_0x4582('0x3'),'afterUpdate':_0x4582('0x4'),'afterDestroy':_0x4582('0x5')};function emitEvent(_0x2d499e){return function(_0x630c6b,_0x19a9c0,_0x3f5149){ChatQueueEvents[_0x4582('0x6')](_0x2d499e+':'+_0x630c6b['id'],_0x630c6b);ChatQueueEvents[_0x4582('0x6')](_0x2d499e,_0x630c6b);_0x3f5149(null);};}for(var e in events){if(events[_0x4582('0x7')](e)){var event=events[e];ChatQueue[_0x4582('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x2cc4=['exports','events','../../mysqldb','ChatQueue','setMaxListeners','emit'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x2cc4,0x1f3));var _0x42cc=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0x2cc4[_0x504df1];return _0x1063b5;};'use strict';var EventEmitter=require(_0x42cc('0x0'));var ChatQueue=require(_0x42cc('0x1'))['db'][_0x42cc('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x42cc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x56e2ff){return function(_0x3eb4c3,_0x217489,_0x21a59a){ChatQueueEvents[_0x42cc('0x4')](_0x56e2ff+':'+_0x3eb4c3['id'],_0x3eb4c3);ChatQueueEvents[_0x42cc('0x4')](_0x56e2ff,_0x3eb4c3);_0x21a59a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x42cc('0x5')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 24bff93..ccfa794 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 _0x9849=['./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x41cd97,_0x3e477a){var _0x4f39c2=function(_0x4feb10){while(--_0x4feb10){_0x41cd97['push'](_0x41cd97['shift']());}};_0x4f39c2(++_0x3e477a);}(_0x9849,0xc8));var _0x9984=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x9849[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x9984('0x0'));var util=require(_0x9984('0x1'));var logger=require(_0x9984('0x2'))(_0x9984('0x3'));var moment=require(_0x9984('0x4'));var BPromise=require(_0x9984('0x5'));var rp=require(_0x9984('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9984('0x7'));var attributes=require(_0x9984('0x8'));module[_0x9984('0x9')]=function(_0x10964a,_0x3ff7fe){return _0x10964a[_0x9984('0xa')](_0x9984('0xb'),attributes,{'tableName':_0x9984('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1393=['api','moment','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger'];(function(_0x3e1134,_0x16fce7){var _0x218791=function(_0xe5635a){while(--_0xe5635a){_0x3e1134['push'](_0x3e1134['shift']());}};_0x218791(++_0x16fce7);}(_0x1393,0xcf));var _0x3139=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x1393[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x3139('0x0'));var util=require(_0x3139('0x1'));var logger=require(_0x3139('0x2'))(_0x3139('0x3'));var moment=require(_0x3139('0x4'));var BPromise=require('bluebird');var rp=require(_0x3139('0x5'));var fs=require('fs');var path=require(_0x3139('0x6'));var rimraf=require(_0x3139('0x7'));var config=require(_0x3139('0x8'));var attributes=require(_0x3139('0x9'));module[_0x3139('0xa')]=function(_0x572d88,_0x1bb503){return _0x572d88[_0x3139('0xb')](_0x3139('0xc'),attributes,{'tableName':_0x3139('0xd'),'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 c200b59..cc08efd 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 _0xefda=['rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes','include','model','map','find','where','ShowChatQueue','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3b1ca2,_0x2f82ac){var _0x4f3ac5=function(_0x5cc1f0){while(--_0x5cc1f0){_0x3b1ca2['push'](_0x3b1ca2['shift']());}};_0x4f3ac5(++_0x2f82ac);}(_0xefda,0x96));var _0xaefd=function(_0x57f901,_0x37fef1){_0x57f901=_0x57f901-0x0;var _0x18863b=_0xefda[_0x57f901];return _0x18863b;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaefd('0x1'));var rs=require(_0xaefd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaefd('0x3'))['db'];var utils=require(_0xaefd('0x4'));var logger=require(_0xaefd('0x5'))(_0xaefd('0x6'));var config=require(_0xaefd('0x7'));var jayson=require(_0xaefd('0x8'));var client=jayson['client'][_0xaefd('0x9')]({'port':0x232a});config[_0xaefd('0xa')]=_[_0xaefd('0xb')](config[_0xaefd('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xaefd('0xc'))(new Redis(config[_0xaefd('0xa')]));require(_0xaefd('0xd'))['register'](socket);function respondWithRpcPromise(_0x48a255,_0x54a3b1,_0xa6239d){return new BPromise(function(_0x16b36e,_0x20135c){return client[_0xaefd('0xe')](_0x48a255,_0xa6239d)[_0xaefd('0xf')](function(_0x1e00fb){logger[_0xaefd('0x10')](_0xaefd('0x11'),_0x54a3b1,_0xaefd('0x12'));logger[_0xaefd('0x13')](_0xaefd('0x14'),_0x54a3b1,'request\x20sent',JSON[_0xaefd('0x15')](_0x1e00fb));if(_0x1e00fb['error']){if(_0x1e00fb[_0xaefd('0x16')][_0xaefd('0x17')]===0x1f4){logger[_0xaefd('0x16')](_0xaefd('0x11'),_0x54a3b1,_0x1e00fb['error'][_0xaefd('0x18')]);return _0x20135c(_0x1e00fb[_0xaefd('0x16')][_0xaefd('0x18')]);}logger[_0xaefd('0x16')](_0xaefd('0x11'),_0x54a3b1,_0x1e00fb[_0xaefd('0x16')][_0xaefd('0x18')]);return _0x16b36e(_0x1e00fb[_0xaefd('0x16')]['message']);}else{logger[_0xaefd('0x10')](_0xaefd('0x11'),_0x54a3b1,_0xaefd('0x12'));_0x16b36e(_0x1e00fb[_0xaefd('0x19')][_0xaefd('0x18')]);}})[_0xaefd('0x1a')](function(_0x516e84){logger[_0xaefd('0x16')](_0xaefd('0x11'),_0x54a3b1,_0x516e84);_0x20135c(_0x516e84);});});}exports[_0xaefd('0x1b')]=function(_0x1260dd){var _0x45ebf2=this;return new Promise(function(_0x1f302c,_0x5282ed){return db[_0xaefd('0x1c')][_0xaefd('0x1d')]({'raw':_0x1260dd[_0xaefd('0x1e')]?_0x1260dd[_0xaefd('0x1e')][_0xaefd('0x1f')]===undefined?!![]:![]:!![],'where':_0x1260dd['options']?_0x1260dd['options']['where']||null:null,'attributes':_0x1260dd[_0xaefd('0x1e')]?_0x1260dd[_0xaefd('0x1e')][_0xaefd('0x20')]||null:null,'limit':_0x1260dd['options']?_0x1260dd[_0xaefd('0x1e')]['limit']||null:null,'include':_0x1260dd[_0xaefd('0x1e')]?_0x1260dd[_0xaefd('0x1e')][_0xaefd('0x21')]?_['map'](_0x1260dd[_0xaefd('0x1e')][_0xaefd('0x21')],function(_0x18e720){return{'model':db[_0x18e720[_0xaefd('0x22')]],'as':_0x18e720['as'],'attributes':_0x18e720[_0xaefd('0x20')],'include':_0x18e720['include']?_[_0xaefd('0x23')](_0x18e720['include'],function(_0x810bf){return{'model':db[_0x810bf[_0xaefd('0x22')]],'as':_0x810bf['as'],'attributes':_0x810bf['attributes'],'include':_0x810bf[_0xaefd('0x21')]?_[_0xaefd('0x23')](_0x810bf['include'],function(_0xbeb1b8){return{'model':db[_0xbeb1b8[_0xaefd('0x22')]],'as':_0xbeb1b8['as'],'attributes':_0xbeb1b8[_0xaefd('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45f0e8){logger['info'](_0xaefd('0x1b'),_0x1260dd);logger['debug']('GetChatQueue',_0x1260dd,JSON[_0xaefd('0x15')](_0x45f0e8));_0x1f302c(_0x45f0e8);})[_0xaefd('0x1a')](function(_0x4a032d){logger['error']('GetChatQueue',_0x4a032d[_0xaefd('0x18')],_0x1260dd);_0x5282ed(_0x45ebf2[_0xaefd('0x16')](0x1f4,_0x4a032d['message']));});});};exports['ShowChatQueue']=function(_0x62ef86){var _0x465d99=this;return new Promise(function(_0x3f4947,_0x21d358){return db['ChatQueue'][_0xaefd('0x24')]({'raw':_0x62ef86[_0xaefd('0x1e')]?_0x62ef86[_0xaefd('0x1e')][_0xaefd('0x1f')]===undefined?!![]:![]:!![],'where':_0x62ef86[_0xaefd('0x1e')]?_0x62ef86[_0xaefd('0x1e')][_0xaefd('0x25')]||null:null,'attributes':_0x62ef86[_0xaefd('0x1e')]?_0x62ef86[_0xaefd('0x1e')][_0xaefd('0x20')]||null:null,'include':_0x62ef86[_0xaefd('0x1e')]?_0x62ef86[_0xaefd('0x1e')][_0xaefd('0x21')]?_[_0xaefd('0x23')](_0x62ef86[_0xaefd('0x1e')][_0xaefd('0x21')],function(_0x554e48){return{'model':db[_0x554e48[_0xaefd('0x22')]],'as':_0x554e48['as'],'attributes':_0x554e48[_0xaefd('0x20')],'include':_0x554e48[_0xaefd('0x21')]?_['map'](_0x554e48[_0xaefd('0x21')],function(_0x577389){return{'model':db[_0x577389[_0xaefd('0x22')]],'as':_0x577389['as'],'attributes':_0x577389[_0xaefd('0x20')],'include':_0x577389[_0xaefd('0x21')]?_[_0xaefd('0x23')](_0x577389[_0xaefd('0x21')],function(_0x2f1548){return{'model':db[_0x2f1548[_0xaefd('0x22')]],'as':_0x2f1548['as'],'attributes':_0x2f1548[_0xaefd('0x20')]};}):[]};}):[]};}):[]:[]})[_0xaefd('0xf')](function(_0x28491b){logger[_0xaefd('0x10')](_0xaefd('0x26'),_0x62ef86);logger[_0xaefd('0x13')](_0xaefd('0x26'),_0x62ef86,JSON['stringify'](_0x28491b));_0x3f4947(_0x28491b);})[_0xaefd('0x1a')](function(_0x56ec96){logger[_0xaefd('0x16')](_0xaefd('0x26'),_0x56ec96[_0xaefd('0x18')],_0x62ef86);_0x21d358(_0x465d99[_0xaefd('0x16')](0x1f4,_0x56ec96[_0xaefd('0x18')]));});});};
\ No newline at end of file
+var _0x93e9=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatQueue.socket','register','request','info','request\x20sent','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','findAll','options','where','attributes','limit','include','map','model','find','then','debug','ShowChatQueue','lodash'];(function(_0x3b2369,_0x4c68b9){var _0x5a1367=function(_0x58ddcf){while(--_0x58ddcf){_0x3b2369['push'](_0x3b2369['shift']());}};_0x5a1367(++_0x4c68b9);}(_0x93e9,0xcc));var _0x993e=function(_0x50794f,_0xc14361){_0x50794f=_0x50794f-0x0;var _0x378b49=_0x93e9[_0x50794f];return _0x378b49;};'use strict';var _=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var moment=require(_0x993e('0x2'));var BPromise=require(_0x993e('0x3'));var rs=require(_0x993e('0x4'));var fs=require('fs');var Redis=require(_0x993e('0x5'));var db=require(_0x993e('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x993e('0x7'));var config=require(_0x993e('0x8'));var jayson=require(_0x993e('0x9'));var client=jayson[_0x993e('0xa')][_0x993e('0xb')]({'port':0x232a});config[_0x993e('0xc')]=_[_0x993e('0xd')](config[_0x993e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x993e('0xe'))(new Redis(config[_0x993e('0xc')]));require(_0x993e('0xf'))[_0x993e('0x10')](socket);function respondWithRpcPromise(_0x2cd389,_0x27a28f,_0x1c2324){return new BPromise(function(_0x48291a,_0x196f6d){return client[_0x993e('0x11')](_0x2cd389,_0x1c2324)['then'](function(_0x5ebc8c){logger[_0x993e('0x12')]('ChatQueue,\x20%s,\x20%s',_0x27a28f,_0x993e('0x13'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x27a28f,_0x993e('0x13'),JSON[_0x993e('0x14')](_0x5ebc8c));if(_0x5ebc8c[_0x993e('0x15')]){if(_0x5ebc8c[_0x993e('0x15')][_0x993e('0x16')]===0x1f4){logger[_0x993e('0x15')](_0x993e('0x17'),_0x27a28f,_0x5ebc8c[_0x993e('0x15')][_0x993e('0x18')]);return _0x196f6d(_0x5ebc8c[_0x993e('0x15')][_0x993e('0x18')]);}logger[_0x993e('0x15')](_0x993e('0x17'),_0x27a28f,_0x5ebc8c[_0x993e('0x15')][_0x993e('0x18')]);return _0x48291a(_0x5ebc8c[_0x993e('0x15')][_0x993e('0x18')]);}else{logger['info'](_0x993e('0x17'),_0x27a28f,_0x993e('0x13'));_0x48291a(_0x5ebc8c[_0x993e('0x19')][_0x993e('0x18')]);}})[_0x993e('0x1a')](function(_0x3eda77){logger['error'](_0x993e('0x17'),_0x27a28f,_0x3eda77);_0x196f6d(_0x3eda77);});});}exports[_0x993e('0x1b')]=function(_0x1eaf57){var _0x22390e=this;return new Promise(function(_0x130a8a,_0x425ab4){return db[_0x993e('0x1c')][_0x993e('0x1d')]({'raw':_0x1eaf57['options']?_0x1eaf57[_0x993e('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x1eaf57[_0x993e('0x1e')]?_0x1eaf57[_0x993e('0x1e')][_0x993e('0x1f')]||null:null,'attributes':_0x1eaf57['options']?_0x1eaf57[_0x993e('0x1e')][_0x993e('0x20')]||null:null,'limit':_0x1eaf57[_0x993e('0x1e')]?_0x1eaf57[_0x993e('0x1e')][_0x993e('0x21')]||null:null,'include':_0x1eaf57[_0x993e('0x1e')]?_0x1eaf57[_0x993e('0x1e')][_0x993e('0x22')]?_[_0x993e('0x23')](_0x1eaf57[_0x993e('0x1e')][_0x993e('0x22')],function(_0x3603fa){return{'model':db[_0x3603fa['model']],'as':_0x3603fa['as'],'attributes':_0x3603fa[_0x993e('0x20')],'include':_0x3603fa[_0x993e('0x22')]?_['map'](_0x3603fa[_0x993e('0x22')],function(_0x4f5cc1){return{'model':db[_0x4f5cc1[_0x993e('0x24')]],'as':_0x4f5cc1['as'],'attributes':_0x4f5cc1[_0x993e('0x20')],'include':_0x4f5cc1[_0x993e('0x22')]?_[_0x993e('0x23')](_0x4f5cc1['include'],function(_0x48d457){return{'model':db[_0x48d457[_0x993e('0x24')]],'as':_0x48d457['as'],'attributes':_0x48d457[_0x993e('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x223af0){logger[_0x993e('0x12')](_0x993e('0x1b'),_0x1eaf57);logger['debug'](_0x993e('0x1b'),_0x1eaf57,JSON[_0x993e('0x14')](_0x223af0));_0x130a8a(_0x223af0);})[_0x993e('0x1a')](function(_0x1fa8a5){logger[_0x993e('0x15')]('GetChatQueue',_0x1fa8a5[_0x993e('0x18')],_0x1eaf57);_0x425ab4(_0x22390e['error'](0x1f4,_0x1fa8a5[_0x993e('0x18')]));});});};exports['ShowChatQueue']=function(_0x1da357){var _0x567ed4=this;return new Promise(function(_0x3b9c3c,_0x2ce5d5){return db[_0x993e('0x1c')][_0x993e('0x25')]({'raw':_0x1da357[_0x993e('0x1e')]?_0x1da357[_0x993e('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x1da357[_0x993e('0x1e')]?_0x1da357['options']['where']||null:null,'attributes':_0x1da357[_0x993e('0x1e')]?_0x1da357['options'][_0x993e('0x20')]||null:null,'include':_0x1da357[_0x993e('0x1e')]?_0x1da357[_0x993e('0x1e')][_0x993e('0x22')]?_[_0x993e('0x23')](_0x1da357[_0x993e('0x1e')][_0x993e('0x22')],function(_0x14424a){return{'model':db[_0x14424a[_0x993e('0x24')]],'as':_0x14424a['as'],'attributes':_0x14424a[_0x993e('0x20')],'include':_0x14424a[_0x993e('0x22')]?_[_0x993e('0x23')](_0x14424a[_0x993e('0x22')],function(_0x28a481){return{'model':db[_0x28a481[_0x993e('0x24')]],'as':_0x28a481['as'],'attributes':_0x28a481['attributes'],'include':_0x28a481[_0x993e('0x22')]?_[_0x993e('0x23')](_0x28a481[_0x993e('0x22')],function(_0x9a9f42){return{'model':db[_0x9a9f42[_0x993e('0x24')]],'as':_0x9a9f42['as'],'attributes':_0x9a9f42[_0x993e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x993e('0x26')](function(_0x416afd){logger[_0x993e('0x12')]('ShowChatQueue',_0x1da357);logger[_0x993e('0x27')]('ShowChatQueue',_0x1da357,JSON[_0x993e('0x14')](_0x416afd));_0x3b9c3c(_0x416afd);})[_0x993e('0x1a')](function(_0x3f5e2b){logger[_0x993e('0x15')](_0x993e('0x28'),_0x3f5e2b[_0x993e('0x18')],_0x1da357);_0x2ce5d5(_0x567ed4[_0x993e('0x15')](0x1f4,_0x3f5e2b[_0x993e('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 5e2777b..eaacd21 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 _0x9b67=['register','length','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x1d2d9e,_0x30fa7e){var _0x2005d6=function(_0x402e47){while(--_0x402e47){_0x1d2d9e['push'](_0x1d2d9e['shift']());}};_0x2005d6(++_0x30fa7e);}(_0x9b67,0xf6));var _0x79b6=function(_0x37c641,_0x13b222){_0x37c641=_0x37c641-0x0;var _0xe81d07=_0x9b67[_0x37c641];return _0xe81d07;};'use strict';var ChatQueueEvents=require(_0x79b6('0x0'));var events=[_0x79b6('0x1'),_0x79b6('0x2'),_0x79b6('0x3')];function createListener(_0x29728d,_0x5523a1){return function(_0x3ba25a){_0x5523a1[_0x79b6('0x4')](_0x29728d,_0x3ba25a);};}function removeListener(_0x5297d0,_0x4e8794){return function(){ChatQueueEvents[_0x79b6('0x5')](_0x5297d0,_0x4e8794);};}exports[_0x79b6('0x6')]=function(_0x258103){for(var _0xec367e=0x0,_0xfa6a05=events[_0x79b6('0x7')];_0xec367e<_0xfa6a05;_0xec367e++){var _0x34adbe=events[_0xec367e];var _0x58ae2d=createListener(_0x79b6('0x8')+_0x34adbe,_0x258103);ChatQueueEvents['on'](_0x34adbe,_0x58ae2d);}};
\ No newline at end of file
+var _0x0bde=['save','update','emit','removeListener','register','length','chatQueue:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0bde,0xe7));var _0xe0bd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0bde[_0x2641f9];return _0x585741;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xe0bd('0x0'),'remove',_0xe0bd('0x1')];function createListener(_0x3dc984,_0x1d8922){return function(_0x1e198a){_0x1d8922[_0xe0bd('0x2')](_0x3dc984,_0x1e198a);};}function removeListener(_0x5541b9,_0x34df88){return function(){ChatQueueEvents[_0xe0bd('0x3')](_0x5541b9,_0x34df88);};}exports[_0xe0bd('0x4')]=function(_0x3b712a){for(var _0x22bfd1=0x0,_0x26393f=events[_0xe0bd('0x5')];_0x22bfd1<_0x26393f;_0x22bfd1++){var _0x491dc7=events[_0x22bfd1];var _0x40b36a=createListener(_0xe0bd('0x6')+_0x491dc7,_0x3b712a);ChatQueueEvents['on'](_0x491dc7,_0x40b36a);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index b667b01..cd8d89a 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x5531b4,_0x4d9d33){var _0x344b6d=function(_0x273879){while(--_0x273879){_0x5531b4['push'](_0x5531b4['shift']());}};_0x344b6d(++_0x4d9d33);}(_0x55ca,0x126));var _0xa55c=function(_0x55821d,_0x27a22e){_0x55821d=_0x55821d-0x0;var _0x58ea8a=_0x55ca[_0x55821d];return _0x58ea8a;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
+var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x7b43ce,_0x536b72){var _0x129be8=function(_0x2d92e1){while(--_0x2d92e1){_0x7b43ce['push'](_0x7b43ce['shift']());}};_0x129be8(++_0x536b72);}(_0xe14b,0x93));var _0xbe14=function(_0x3a24f4,_0x587cc2){_0x3a24f4=_0x3a24f4-0x0;var _0x3e30d6=_0xe14b[_0x3a24f4];return _0x3e30d6;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 5c9f409..3bcdeb7 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 _0x81ef=['moment','sequelize','exports','STRING','DATE'];(function(_0x7f4719,_0x1d4aee){var _0x2f9135=function(_0x54d820){while(--_0x54d820){_0x7f4719['push'](_0x7f4719['shift']());}};_0x2f9135(++_0x1d4aee);}(_0x81ef,0xc3));var _0xf81e=function(_0x218543,_0x2fed46){_0x218543=_0x218543-0x0;var _0x3dad81=_0x81ef[_0x218543];return _0x3dad81;};'use strict';var moment=require(_0xf81e('0x0'));var Sequelize=require(_0xf81e('0x1'));module[_0xf81e('0x2')]={'uniqueid':{'type':Sequelize[_0xf81e('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xf81e('0x3')]},'joinAt':{'type':Sequelize[_0xf81e('0x4')]},'leaveAt':{'type':Sequelize[_0xf81e('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xf81e('0x3')]}};
\ No newline at end of file
+var _0xe9a2=['exports','DATE','STRING','moment','sequelize'];(function(_0x57ccb4,_0xe7da75){var _0x325fa5=function(_0x40f669){while(--_0x40f669){_0x57ccb4['push'](_0x57ccb4['shift']());}};_0x325fa5(++_0xe7da75);}(_0xe9a2,0x71));var _0x2e9a=function(_0x495f68,_0x46bdae){_0x495f68=_0x495f68-0x0;var _0x278ba0=_0xe9a2[_0x495f68];return _0x278ba0;};'use strict';var moment=require(_0x2e9a('0x0'));var Sequelize=require(_0x2e9a('0x1'));module[_0x2e9a('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x2e9a('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x2e9a('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x2e9a('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 340f166..facc1fc 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 _0x1bce=['Content-Range','then','destroy','status','end','stack','name','index','map','ChatQueueReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','update','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','json','offset','limit','undefined','count','set'];(function(_0x16ef3a,_0x1bea31){var _0x3d4966=function(_0x202a8f){while(--_0x202a8f){_0x16ef3a['push'](_0x16ef3a['shift']());}};_0x3d4966(++_0x1bea31);}(_0x1bce,0x73));var _0xe1bc=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1bce[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xe1bc('0x0'));var rimraf=require(_0xe1bc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe1bc('0x2'));var rp=require(_0xe1bc('0x3'));var moment=require(_0xe1bc('0x4'));var BPromise=require(_0xe1bc('0x5'));var Mustache=require(_0xe1bc('0x6'));var util=require(_0xe1bc('0x7'));var path=require(_0xe1bc('0x8'));var sox=require(_0xe1bc('0x9'));var csv=require(_0xe1bc('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe1bc('0xb'));var squel=require(_0xe1bc('0xc'));var crypto=require(_0xe1bc('0xd'));var jsforce=require(_0xe1bc('0xe'));var deskjs=require(_0xe1bc('0xf'));var toCsv=require(_0xe1bc('0xa'));var querystring=require('querystring');var Papa=require(_0xe1bc('0x10'));var Redis=require('ioredis');var authService=require(_0xe1bc('0x11'));var qs=require(_0xe1bc('0x12'));var as=require(_0xe1bc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe1bc('0x14'))(_0xe1bc('0x15'));var utils=require('../../config/utils');var config=require(_0xe1bc('0x16'));var licenseUtil=require(_0xe1bc('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c8b9f,_0xdb61b){_0xdb61b=_0xdb61b||0xcc;return function(_0xc89560){if(_0xc89560){return _0x5c8b9f[_0xe1bc('0x18')](_0xdb61b);}return _0x5c8b9f['status'](_0xdb61b)['end']();};}function respondWithResult(_0x161955,_0x16b0cd){_0x16b0cd=_0x16b0cd||0xc8;return function(_0x402a22){if(_0x402a22){return _0x161955['status'](_0x16b0cd)[_0xe1bc('0x19')](_0x402a22);}};}function respondWithFilteredResult(_0x3a073e,_0x17cfc3){return function(_0x46ab48){if(_0x46ab48){var _0x556001=typeof _0x17cfc3[_0xe1bc('0x1a')]==='undefined'&&typeof _0x17cfc3[_0xe1bc('0x1b')]===_0xe1bc('0x1c');var _0x4acd5b=_0x46ab48[_0xe1bc('0x1d')];var _0x1ed85d=_0x556001?0x0:_0x17cfc3[_0xe1bc('0x1a')];var _0x3fd489=_0x556001?_0x46ab48[_0xe1bc('0x1d')]:_0x17cfc3[_0xe1bc('0x1a')]+_0x17cfc3['limit'];var _0x2d2caa;if(_0x3fd489>=_0x4acd5b){_0x3fd489=_0x4acd5b;_0x2d2caa=0xc8;}else{_0x2d2caa=0xce;}_0x3a073e['status'](_0x2d2caa);return _0x3a073e[_0xe1bc('0x1e')](_0xe1bc('0x1f'),_0x1ed85d+'-'+_0x3fd489+'/'+_0x4acd5b)[_0xe1bc('0x19')](_0x46ab48);}return null;};}function patchUpdates(_0x1d222c){return function(_0x2a79f1){try{jsonpatch['apply'](_0x2a79f1,_0x1d222c,!![]);}catch(_0x313b16){return BPromise['reject'](_0x313b16);}return _0x2a79f1['save']();};}function saveUpdates(_0x3a5f82,_0x2a999c){return function(_0x5cc42d){if(_0x5cc42d){return _0x5cc42d['update'](_0x3a5f82)[_0xe1bc('0x20')](function(_0x7a8e22){return _0x7a8e22;});}return null;};}function removeEntity(_0x26582e,_0x126ae3){return function(_0x229b43){if(_0x229b43){return _0x229b43[_0xe1bc('0x21')]()[_0xe1bc('0x20')](function(){_0x26582e[_0xe1bc('0x22')](0xcc)[_0xe1bc('0x23')]();});}};}function handleEntityNotFound(_0x16631e,_0x927963){return function(_0x3d1946){if(!_0x3d1946){_0x16631e[_0xe1bc('0x18')](0x194);}return _0x3d1946;};}function handleError(_0x584622,_0x4dd024){_0x4dd024=_0x4dd024||0x1f4;return function(_0x6311aa){logger['error'](_0x6311aa[_0xe1bc('0x24')]);if(_0x6311aa['name']){delete _0x6311aa[_0xe1bc('0x25')];}_0x584622['status'](_0x4dd024)['send'](_0x6311aa);};}exports[_0xe1bc('0x26')]=function(_0x3958a4,_0x58a667){var _0x47d9b3={},_0x39017e={},_0x23caa1={'count':0x0,'rows':[]};var _0x345da1=_[_0xe1bc('0x27')](db[_0xe1bc('0x28')][_0xe1bc('0x29')],function(_0x122da8){return{'name':_0x122da8[_0xe1bc('0x2a')],'type':_0x122da8[_0xe1bc('0x2b')]['key']};});_0x39017e[_0xe1bc('0x2c')]=_[_0xe1bc('0x27')](_0x345da1,_0xe1bc('0x25'));_0x39017e['query']=_[_0xe1bc('0x2d')](_0x3958a4[_0xe1bc('0x2e')]);_0x39017e[_0xe1bc('0x2f')]=_[_0xe1bc('0x30')](_0x39017e[_0xe1bc('0x2c')],_0x39017e['query']);_0x47d9b3[_0xe1bc('0x31')]=_['intersection'](_0x39017e['model'],qs[_0xe1bc('0x32')](_0x3958a4[_0xe1bc('0x2e')][_0xe1bc('0x32')]));_0x47d9b3['attributes']=_0x47d9b3[_0xe1bc('0x31')][_0xe1bc('0x33')]?_0x47d9b3['attributes']:_0x39017e[_0xe1bc('0x2c')];if(!_0x3958a4[_0xe1bc('0x2e')][_0xe1bc('0x34')](_0xe1bc('0x35'))){_0x47d9b3[_0xe1bc('0x1b')]=qs[_0xe1bc('0x1b')](_0x3958a4['query'][_0xe1bc('0x1b')]);_0x47d9b3[_0xe1bc('0x1a')]=qs['offset'](_0x3958a4[_0xe1bc('0x2e')]['offset']);}_0x47d9b3[_0xe1bc('0x36')]=qs[_0xe1bc('0x37')](_0x3958a4[_0xe1bc('0x2e')][_0xe1bc('0x37')]);_0x47d9b3['where']=qs[_0xe1bc('0x2f')](_[_0xe1bc('0x38')](_0x3958a4[_0xe1bc('0x2e')],_0x39017e[_0xe1bc('0x2f')]),_0x345da1);if(_0x3958a4[_0xe1bc('0x2e')][_0xe1bc('0x39')]){_0x47d9b3[_0xe1bc('0x3a')]=_[_0xe1bc('0x3b')](_0x47d9b3[_0xe1bc('0x3a')],{'$or':_[_0xe1bc('0x27')](_0x345da1,function(_0x344b42){if(_0x344b42[_0xe1bc('0x2b')]!==_0xe1bc('0x3c')){var _0x45ddd3={};_0x45ddd3[_0x344b42['name']]={'$like':'%'+_0x3958a4[_0xe1bc('0x2e')][_0xe1bc('0x39')]+'%'};return _0x45ddd3;}})});}_0x47d9b3=_['merge']({},_0x47d9b3,_0x3958a4[_0xe1bc('0x3d')]);var _0x4e3d2d={'where':_0x47d9b3[_0xe1bc('0x3a')]};return db[_0xe1bc('0x28')][_0xe1bc('0x1d')](_0x4e3d2d)[_0xe1bc('0x20')](function(_0x254e8b){_0x23caa1['count']=_0x254e8b;if(_0x3958a4['query'][_0xe1bc('0x3e')]){_0x47d9b3[_0xe1bc('0x3f')]=[{'all':!![]}];}return db[_0xe1bc('0x28')][_0xe1bc('0x40')](_0x47d9b3);})[_0xe1bc('0x20')](function(_0xbe9e0e){_0x23caa1['rows']=_0xbe9e0e;return _0x23caa1;})[_0xe1bc('0x20')](respondWithFilteredResult(_0x58a667,_0x47d9b3))[_0xe1bc('0x41')](handleError(_0x58a667,null));};exports[_0xe1bc('0x42')]=function(_0x5b0339,_0x3fee8f){var _0x4c5634={'raw':!![],'where':{'id':_0x5b0339[_0xe1bc('0x43')]['id']}},_0x22cc17={};_0x22cc17[_0xe1bc('0x2c')]=_['keys'](db[_0xe1bc('0x28')][_0xe1bc('0x29')]);_0x22cc17[_0xe1bc('0x2e')]=_['keys'](_0x5b0339[_0xe1bc('0x2e')]);_0x22cc17['filters']=_['intersection'](_0x22cc17['model'],_0x22cc17['query']);_0x4c5634['attributes']=_['intersection'](_0x22cc17[_0xe1bc('0x2c')],qs[_0xe1bc('0x32')](_0x5b0339[_0xe1bc('0x2e')][_0xe1bc('0x32')]));_0x4c5634[_0xe1bc('0x31')]=_0x4c5634[_0xe1bc('0x31')]['length']?_0x4c5634[_0xe1bc('0x31')]:_0x22cc17[_0xe1bc('0x2c')];if(_0x5b0339[_0xe1bc('0x2e')][_0xe1bc('0x3e')]){_0x4c5634[_0xe1bc('0x3f')]=[{'all':!![]}];}_0x4c5634=_['merge']({},_0x4c5634,_0x5b0339[_0xe1bc('0x3d')]);return db[_0xe1bc('0x28')]['find'](_0x4c5634)[_0xe1bc('0x20')](handleEntityNotFound(_0x3fee8f,null))[_0xe1bc('0x20')](respondWithResult(_0x3fee8f,null))['catch'](handleError(_0x3fee8f,null));};exports[_0xe1bc('0x44')]=function(_0x52263b,_0x1ec1dc){return db['ChatQueueReport']['create'](_0x52263b[_0xe1bc('0x45')],{})[_0xe1bc('0x20')](respondWithResult(_0x1ec1dc,0xc9))[_0xe1bc('0x41')](handleError(_0x1ec1dc,null));};exports[_0xe1bc('0x46')]=function(_0xd4884c,_0x2dccb7){if(_0xd4884c['body']['id']){delete _0xd4884c[_0xe1bc('0x45')]['id'];}return db[_0xe1bc('0x28')]['find']({'where':{'id':_0xd4884c[_0xe1bc('0x43')]['id']}})['then'](handleEntityNotFound(_0x2dccb7,null))[_0xe1bc('0x20')](saveUpdates(_0xd4884c['body'],null))[_0xe1bc('0x20')](respondWithResult(_0x2dccb7,null))[_0xe1bc('0x41')](handleError(_0x2dccb7,null));};exports[_0xe1bc('0x21')]=function(_0x5bc275,_0x3b6165){return db['ChatQueueReport'][_0xe1bc('0x47')]({'where':{'id':_0x5bc275[_0xe1bc('0x43')]['id']}})[_0xe1bc('0x20')](handleEntityNotFound(_0x3b6165,null))['then'](removeEntity(_0x3b6165,null))[_0xe1bc('0x41')](handleError(_0x3b6165,null));};exports['describe']=function(_0x274131,_0x4594bd){return db['ChatQueueReport'][_0xe1bc('0x48')]()['then'](respondWithResult(_0x4594bd,null))[_0xe1bc('0x41')](handleError(_0x4594bd,null));};
\ No newline at end of file
+var _0xd43e=['to-csv','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','Content-Range','json','apply','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','ChatQueueReport','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd43e,0x88));var _0xed43=function(_0x47b1a7,_0x666d32){_0x47b1a7=_0x47b1a7-0x0;var _0x410f7a=_0xd43e[_0x47b1a7];return _0x410f7a;};'use strict';var emlformat=require(_0xed43('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xed43('0x1'));var jsonpatch=require(_0xed43('0x2'));var rp=require(_0xed43('0x3'));var moment=require(_0xed43('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xed43('0x5'));var path=require(_0xed43('0x6'));var sox=require(_0xed43('0x7'));var csv=require(_0xed43('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xed43('0x9'));var _=require(_0xed43('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xed43('0xb'));var toCsv=require(_0xed43('0x8'));var querystring=require(_0xed43('0xc'));var Papa=require(_0xed43('0xd'));var Redis=require(_0xed43('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xed43('0xf'));var as=require(_0xed43('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed43('0x11'))(_0xed43('0x12'));var utils=require(_0xed43('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xed43('0x14'))['db'];function respondWithStatusCode(_0x34027b,_0x4eed04){_0x4eed04=_0x4eed04||0xcc;return function(_0x1519aa){if(_0x1519aa){return _0x34027b[_0xed43('0x15')](_0x4eed04);}return _0x34027b[_0xed43('0x16')](_0x4eed04)[_0xed43('0x17')]();};}function respondWithResult(_0x2adbc5,_0x403a89){_0x403a89=_0x403a89||0xc8;return function(_0x597544){if(_0x597544){return _0x2adbc5[_0xed43('0x16')](_0x403a89)['json'](_0x597544);}};}function respondWithFilteredResult(_0x2ec9c3,_0x4a9621){return function(_0x2d457a){if(_0x2d457a){var _0x4caa03=typeof _0x4a9621['offset']===_0xed43('0x18')&&typeof _0x4a9621['limit']===_0xed43('0x18');var _0x1ada9c=_0x2d457a[_0xed43('0x19')];var _0x5f5093=_0x4caa03?0x0:_0x4a9621[_0xed43('0x1a')];var _0xa8a443=_0x4caa03?_0x2d457a['count']:_0x4a9621['offset']+_0x4a9621[_0xed43('0x1b')];var _0x46a875;if(_0xa8a443>=_0x1ada9c){_0xa8a443=_0x1ada9c;_0x46a875=0xc8;}else{_0x46a875=0xce;}_0x2ec9c3[_0xed43('0x16')](_0x46a875);return _0x2ec9c3['set'](_0xed43('0x1c'),_0x5f5093+'-'+_0xa8a443+'/'+_0x1ada9c)[_0xed43('0x1d')](_0x2d457a);}return null;};}function patchUpdates(_0x5bbd5c){return function(_0x3570ef){try{jsonpatch[_0xed43('0x1e')](_0x3570ef,_0x5bbd5c,!![]);}catch(_0x336ce7){return BPromise['reject'](_0x336ce7);}return _0x3570ef['save']();};}function saveUpdates(_0x2a6329,_0x42fb48){return function(_0x7f4c4c){if(_0x7f4c4c){return _0x7f4c4c[_0xed43('0x1f')](_0x2a6329)[_0xed43('0x20')](function(_0x45a24a){return _0x45a24a;});}return null;};}function removeEntity(_0x556440,_0x414c7a){return function(_0x30b5cf){if(_0x30b5cf){return _0x30b5cf[_0xed43('0x21')]()['then'](function(){_0x556440[_0xed43('0x16')](0xcc)[_0xed43('0x17')]();});}};}function handleEntityNotFound(_0x28a908,_0x90350a){return function(_0x549f91){if(!_0x549f91){_0x28a908[_0xed43('0x15')](0x194);}return _0x549f91;};}function handleError(_0x53f575,_0x3e7442){_0x3e7442=_0x3e7442||0x1f4;return function(_0xed8706){logger[_0xed43('0x22')](_0xed8706[_0xed43('0x23')]);if(_0xed8706['name']){delete _0xed8706[_0xed43('0x24')];}_0x53f575['status'](_0x3e7442)['send'](_0xed8706);};}exports[_0xed43('0x25')]=function(_0x51f128,_0x587d85){var _0x1b2f66={},_0x139750={},_0x325ab5={'count':0x0,'rows':[]};var _0x1f1207=_[_0xed43('0x26')](db['ChatQueueReport'][_0xed43('0x27')],function(_0x32c395){return{'name':_0x32c395[_0xed43('0x28')],'type':_0x32c395[_0xed43('0x29')][_0xed43('0x2a')]};});_0x139750['model']=_[_0xed43('0x26')](_0x1f1207,_0xed43('0x24'));_0x139750[_0xed43('0x2b')]=_['keys'](_0x51f128[_0xed43('0x2b')]);_0x139750[_0xed43('0x2c')]=_[_0xed43('0x2d')](_0x139750[_0xed43('0x2e')],_0x139750[_0xed43('0x2b')]);_0x1b2f66[_0xed43('0x2f')]=_[_0xed43('0x2d')](_0x139750[_0xed43('0x2e')],qs['fields'](_0x51f128['query'][_0xed43('0x30')]));_0x1b2f66['attributes']=_0x1b2f66[_0xed43('0x2f')][_0xed43('0x31')]?_0x1b2f66['attributes']:_0x139750[_0xed43('0x2e')];if(!_0x51f128[_0xed43('0x2b')][_0xed43('0x32')](_0xed43('0x33'))){_0x1b2f66[_0xed43('0x1b')]=qs[_0xed43('0x1b')](_0x51f128[_0xed43('0x2b')][_0xed43('0x1b')]);_0x1b2f66['offset']=qs['offset'](_0x51f128[_0xed43('0x2b')][_0xed43('0x1a')]);}_0x1b2f66[_0xed43('0x34')]=qs[_0xed43('0x35')](_0x51f128[_0xed43('0x2b')]['sort']);_0x1b2f66[_0xed43('0x36')]=qs['filters'](_[_0xed43('0x37')](_0x51f128[_0xed43('0x2b')],_0x139750[_0xed43('0x2c')]),_0x1f1207);if(_0x51f128['query'][_0xed43('0x38')]){_0x1b2f66[_0xed43('0x36')]=_['merge'](_0x1b2f66[_0xed43('0x36')],{'$or':_[_0xed43('0x26')](_0x1f1207,function(_0x5bf247){if(_0x5bf247[_0xed43('0x29')]!=='VIRTUAL'){var _0x16c207={};_0x16c207[_0x5bf247[_0xed43('0x24')]]={'$like':'%'+_0x51f128['query'][_0xed43('0x38')]+'%'};return _0x16c207;}})});}_0x1b2f66=_[_0xed43('0x39')]({},_0x1b2f66,_0x51f128[_0xed43('0x3a')]);var _0x4a6ff6={'where':_0x1b2f66[_0xed43('0x36')]};return db[_0xed43('0x3b')][_0xed43('0x19')](_0x4a6ff6)[_0xed43('0x20')](function(_0xa6a7c3){_0x325ab5[_0xed43('0x19')]=_0xa6a7c3;if(_0x51f128['query'][_0xed43('0x3c')]){_0x1b2f66['include']=[{'all':!![]}];}return db[_0xed43('0x3b')][_0xed43('0x3d')](_0x1b2f66);})[_0xed43('0x20')](function(_0x2a9a15){_0x325ab5[_0xed43('0x3e')]=_0x2a9a15;return _0x325ab5;})[_0xed43('0x20')](respondWithFilteredResult(_0x587d85,_0x1b2f66))[_0xed43('0x3f')](handleError(_0x587d85,null));};exports[_0xed43('0x40')]=function(_0x19d7de,_0x32ddec){var _0x3ec9c0={'raw':!![],'where':{'id':_0x19d7de[_0xed43('0x41')]['id']}},_0x57ac6b={};_0x57ac6b[_0xed43('0x2e')]=_[_0xed43('0x42')](db['ChatQueueReport'][_0xed43('0x27')]);_0x57ac6b[_0xed43('0x2b')]=_[_0xed43('0x42')](_0x19d7de['query']);_0x57ac6b[_0xed43('0x2c')]=_['intersection'](_0x57ac6b['model'],_0x57ac6b[_0xed43('0x2b')]);_0x3ec9c0[_0xed43('0x2f')]=_[_0xed43('0x2d')](_0x57ac6b[_0xed43('0x2e')],qs['fields'](_0x19d7de[_0xed43('0x2b')][_0xed43('0x30')]));_0x3ec9c0['attributes']=_0x3ec9c0['attributes'][_0xed43('0x31')]?_0x3ec9c0['attributes']:_0x57ac6b[_0xed43('0x2e')];if(_0x19d7de['query'][_0xed43('0x3c')]){_0x3ec9c0[_0xed43('0x43')]=[{'all':!![]}];}_0x3ec9c0=_[_0xed43('0x39')]({},_0x3ec9c0,_0x19d7de[_0xed43('0x3a')]);return db[_0xed43('0x3b')][_0xed43('0x44')](_0x3ec9c0)['then'](handleEntityNotFound(_0x32ddec,null))[_0xed43('0x20')](respondWithResult(_0x32ddec,null))[_0xed43('0x3f')](handleError(_0x32ddec,null));};exports[_0xed43('0x45')]=function(_0x2ff4cf,_0x298662){return db[_0xed43('0x3b')]['create'](_0x2ff4cf[_0xed43('0x46')],{})[_0xed43('0x20')](respondWithResult(_0x298662,0xc9))[_0xed43('0x3f')](handleError(_0x298662,null));};exports[_0xed43('0x1f')]=function(_0x567327,_0xeda46e){if(_0x567327[_0xed43('0x46')]['id']){delete _0x567327['body']['id'];}return db[_0xed43('0x3b')][_0xed43('0x44')]({'where':{'id':_0x567327[_0xed43('0x41')]['id']}})[_0xed43('0x20')](handleEntityNotFound(_0xeda46e,null))[_0xed43('0x20')](saveUpdates(_0x567327[_0xed43('0x46')],null))[_0xed43('0x20')](respondWithResult(_0xeda46e,null))[_0xed43('0x3f')](handleError(_0xeda46e,null));};exports[_0xed43('0x21')]=function(_0x5f1968,_0x47cb1e){return db[_0xed43('0x3b')][_0xed43('0x44')]({'where':{'id':_0x5f1968[_0xed43('0x41')]['id']}})['then'](handleEntityNotFound(_0x47cb1e,null))['then'](removeEntity(_0x47cb1e,null))[_0xed43('0x3f')](handleError(_0x47cb1e,null));};exports[_0xed43('0x47')]=function(_0x399b30,_0x31846d){return db[_0xed43('0x3b')][_0xed43('0x47')]()[_0xed43('0x20')](respondWithResult(_0x31846d,null))[_0xed43('0x3f')](handleError(_0x31846d,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 0f9f880..3878569 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x2abc3d,_0x48edca){var _0x252745=function(_0x32bb6f){while(--_0x32bb6f){_0x2abc3d['push'](_0x2abc3d['shift']());}};_0x252745(++_0x48edca);}(_0xb10b,0x12a));var _0xbb10=function(_0x1b9169,_0x40f904){_0x1b9169=_0x1b9169-0x0;var _0x59ea07=_0xb10b[_0x1b9169];return _0x59ea07;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x1b9d67,_0x2ac333){var _0x5f3794=function(_0x4f6479){while(--_0x4f6479){_0x1b9d67['push'](_0x1b9d67['shift']());}};_0x5f3794(++_0x2ac333);}(_0x757a,0xde));var _0xa757=function(_0x4e0d5c,_0x3f0ea4){_0x4e0d5c=_0x4e0d5c-0x0;var _0xe79eb1=_0x757a[_0x4e0d5c];return _0xe79eb1;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 40ed1f6..5bf56d9 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 _0xbab2=['rpc','../../config/environment','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','where','attributes','limit','UpdateChatQueueReport','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x338b15,_0x3202d8){var _0x466e43=function(_0x3c79ae){while(--_0x3c79ae){_0x338b15['push'](_0x338b15['shift']());}};_0x466e43(++_0x3202d8);}(_0xbab2,0x1ea));var _0x2bab=function(_0x36f94d,_0x4919a9){_0x36f94d=_0x36f94d-0x0;var _0x8efbfb=_0xbab2[_0x36f94d];return _0x8efbfb;};'use strict';var _=require('lodash');var util=require(_0x2bab('0x0'));var moment=require(_0x2bab('0x1'));var BPromise=require('bluebird');var rs=require(_0x2bab('0x2'));var fs=require('fs');var Redis=require(_0x2bab('0x3'));var db=require(_0x2bab('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2bab('0x5'))(_0x2bab('0x6'));var config=require(_0x2bab('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2bab('0x8')][_0x2bab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ab11b,_0x9332a1,_0x58164f){return new BPromise(function(_0x2e301b,_0x32ab52){return client['request'](_0x2ab11b,_0x58164f)[_0x2bab('0xa')](function(_0x258223){logger[_0x2bab('0xb')](_0x2bab('0xc'),_0x9332a1,_0x2bab('0xd'));logger[_0x2bab('0xe')](_0x2bab('0xf'),_0x9332a1,_0x2bab('0xd'),JSON[_0x2bab('0x10')](_0x258223));if(_0x258223[_0x2bab('0x11')]){if(_0x258223[_0x2bab('0x11')]['code']===0x1f4){logger[_0x2bab('0x11')](_0x2bab('0xc'),_0x9332a1,_0x258223[_0x2bab('0x11')][_0x2bab('0x12')]);return _0x32ab52(_0x258223[_0x2bab('0x11')][_0x2bab('0x12')]);}logger[_0x2bab('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x9332a1,_0x258223[_0x2bab('0x11')]['message']);return _0x2e301b(_0x258223[_0x2bab('0x11')][_0x2bab('0x12')]);}else{logger[_0x2bab('0xb')](_0x2bab('0xc'),_0x9332a1,_0x2bab('0xd'));_0x2e301b(_0x258223[_0x2bab('0x13')][_0x2bab('0x12')]);}})[_0x2bab('0x14')](function(_0x3113b2){logger[_0x2bab('0x11')](_0x2bab('0xc'),_0x9332a1,_0x3113b2);_0x32ab52(_0x3113b2);});});}exports[_0x2bab('0x15')]=function(_0x43fe3d){var _0x5b7b31=this;return new Promise(function(_0x5f35db,_0x38b615){return db[_0x2bab('0x16')][_0x2bab('0x17')](_0x43fe3d[_0x2bab('0x18')],{'raw':_0x43fe3d[_0x2bab('0x19')]?_0x43fe3d[_0x2bab('0x19')][_0x2bab('0x1a')]===undefined?!![]:![]:!![]})[_0x2bab('0xa')](function(_0x3c9f52){logger[_0x2bab('0xb')](_0x2bab('0x15'),_0x43fe3d);logger['debug']('CreateChatQueueReport',_0x43fe3d,JSON[_0x2bab('0x10')](_0x3c9f52));_0x5f35db(_0x3c9f52);})['catch'](function(_0x325fc3){logger[_0x2bab('0x11')]('CreateChatQueueReport',_0x325fc3['message'],_0x43fe3d);_0x38b615(_0x5b7b31['error'](0x1f4,_0x325fc3[_0x2bab('0x12')]));});});};exports['UpdateChatQueueReport']=function(_0x58f98f){var _0x443825=this;return new Promise(function(_0x138d52,_0x5e2d1b){return db[_0x2bab('0x16')]['update'](_0x58f98f[_0x2bab('0x18')],{'raw':_0x58f98f['options']?_0x58f98f[_0x2bab('0x19')][_0x2bab('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58f98f[_0x2bab('0x19')]?_0x58f98f[_0x2bab('0x19')][_0x2bab('0x1b')]||null:null,'attributes':_0x58f98f[_0x2bab('0x19')]?_0x58f98f['options'][_0x2bab('0x1c')]||null:null,'limit':_0x58f98f[_0x2bab('0x19')]?_0x58f98f['options'][_0x2bab('0x1d')]||null:null})[_0x2bab('0xa')](function(_0x3753a7){logger[_0x2bab('0xb')](_0x2bab('0x1e'),_0x58f98f);logger[_0x2bab('0xe')](_0x2bab('0x1e'),_0x58f98f,JSON[_0x2bab('0x10')](_0x3753a7));_0x138d52(_0x3753a7);})[_0x2bab('0x14')](function(_0x4cf279){logger[_0x2bab('0x11')](_0x2bab('0x1e'),_0x4cf279[_0x2bab('0x12')],_0x58f98f);_0x5e2d1b(_0x443825[_0x2bab('0x11')](0x1f4,_0x4cf279['message']));});});};
\ No newline at end of file
+var _0xc98e=['CreateChatQueueReport','ChatQueueReport','create','body','raw','update','options','where','attributes','limit','UpdateChatQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x4060cb,_0x354071){var _0x25d8fa=function(_0x248ad8){while(--_0x248ad8){_0x4060cb['push'](_0x4060cb['shift']());}};_0x25d8fa(++_0x354071);}(_0xc98e,0x1eb));var _0xec98=function(_0x96a10d,_0x2f5500){_0x96a10d=_0x96a10d-0x0;var _0x375445=_0xc98e[_0x96a10d];return _0x375445;};'use strict';var _=require(_0xec98('0x0'));var util=require('util');var moment=require(_0xec98('0x1'));var BPromise=require(_0xec98('0x2'));var rs=require(_0xec98('0x3'));var fs=require('fs');var Redis=require(_0xec98('0x4'));var db=require(_0xec98('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xec98('0x6'));var config=require(_0xec98('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xec98('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17180c,_0x25d6f1,_0xb06fa0){return new BPromise(function(_0x2e330d,_0x1d4914){return client[_0xec98('0x9')](_0x17180c,_0xb06fa0)[_0xec98('0xa')](function(_0x7c3c34){logger[_0xec98('0xb')](_0xec98('0xc'),_0x25d6f1,_0xec98('0xd'));logger[_0xec98('0xe')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x25d6f1,_0xec98('0xd'),JSON[_0xec98('0xf')](_0x7c3c34));if(_0x7c3c34[_0xec98('0x10')]){if(_0x7c3c34[_0xec98('0x10')][_0xec98('0x11')]===0x1f4){logger[_0xec98('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x25d6f1,_0x7c3c34[_0xec98('0x10')][_0xec98('0x12')]);return _0x1d4914(_0x7c3c34['error'][_0xec98('0x12')]);}logger[_0xec98('0x10')](_0xec98('0xc'),_0x25d6f1,_0x7c3c34[_0xec98('0x10')][_0xec98('0x12')]);return _0x2e330d(_0x7c3c34[_0xec98('0x10')]['message']);}else{logger[_0xec98('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x25d6f1,_0xec98('0xd'));_0x2e330d(_0x7c3c34[_0xec98('0x13')][_0xec98('0x12')]);}})[_0xec98('0x14')](function(_0x19534a){logger[_0xec98('0x10')](_0xec98('0xc'),_0x25d6f1,_0x19534a);_0x1d4914(_0x19534a);});});}exports[_0xec98('0x15')]=function(_0x177fc5){var _0x2e24c7=this;return new Promise(function(_0x439bed,_0x11c713){return db[_0xec98('0x16')][_0xec98('0x17')](_0x177fc5[_0xec98('0x18')],{'raw':_0x177fc5['options']?_0x177fc5['options'][_0xec98('0x19')]===undefined?!![]:![]:!![]})[_0xec98('0xa')](function(_0x2f294b){logger[_0xec98('0xb')](_0xec98('0x15'),_0x177fc5);logger[_0xec98('0xe')]('CreateChatQueueReport',_0x177fc5,JSON[_0xec98('0xf')](_0x2f294b));_0x439bed(_0x2f294b);})['catch'](function(_0xfdd257){logger[_0xec98('0x10')]('CreateChatQueueReport',_0xfdd257[_0xec98('0x12')],_0x177fc5);_0x11c713(_0x2e24c7[_0xec98('0x10')](0x1f4,_0xfdd257['message']));});});};exports['UpdateChatQueueReport']=function(_0x5dfe85){var _0x38a224=this;return new Promise(function(_0x400afa,_0x3d2703){return db['ChatQueueReport'][_0xec98('0x1a')](_0x5dfe85[_0xec98('0x18')],{'raw':_0x5dfe85[_0xec98('0x1b')]?_0x5dfe85['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5dfe85[_0xec98('0x1b')]?_0x5dfe85[_0xec98('0x1b')][_0xec98('0x1c')]||null:null,'attributes':_0x5dfe85[_0xec98('0x1b')]?_0x5dfe85[_0xec98('0x1b')][_0xec98('0x1d')]||null:null,'limit':_0x5dfe85['options']?_0x5dfe85['options'][_0xec98('0x1e')]||null:null})['then'](function(_0x476925){logger[_0xec98('0xb')](_0xec98('0x1f'),_0x5dfe85);logger[_0xec98('0xe')](_0xec98('0x1f'),_0x5dfe85,JSON[_0xec98('0xf')](_0x476925));_0x400afa(_0x476925);})[_0xec98('0x14')](function(_0x3447d8){logger['error'](_0xec98('0x1f'),_0x3447d8['message'],_0x5dfe85);_0x3d2703(_0x38a224[_0xec98('0x10')](0x1f4,_0x3447d8[_0xec98('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index bbec6cd..d8743ce 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 _0xff1f=['fs-extra','../../components/auth/service','./chatQueueReport.controller','get','isAuthenticated','/describe','/:id','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router'];(function(_0x2fef39,_0x253198){var _0x4e2ff6=function(_0x5086de){while(--_0x5086de){_0x2fef39['push'](_0x2fef39['shift']());}};_0x4e2ff6(++_0x253198);}(_0xff1f,0x140));var _0xfff1=function(_0x3db122,_0x5e6bee){_0x3db122=_0x3db122-0x0;var _0x325b67=_0xff1f[_0x3db122];return _0x325b67;};'use strict';var multer=require('multer');var util=require(_0xfff1('0x0'));var path=require(_0xfff1('0x1'));var timeout=require(_0xfff1('0x2'));var express=require('express');var router=express[_0xfff1('0x3')]();var fs_extra=require(_0xfff1('0x4'));var auth=require(_0xfff1('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfff1('0x6'));router[_0xfff1('0x7')]('/',auth[_0xfff1('0x8')](),controller['index']);router[_0xfff1('0x7')](_0xfff1('0x9'),auth[_0xfff1('0x8')](),controller['describe']);router[_0xfff1('0x7')](_0xfff1('0xa'),auth[_0xfff1('0x8')](),controller['show']);router[_0xfff1('0xb')]('/',auth[_0xfff1('0x8')](),controller[_0xfff1('0xc')]);router[_0xfff1('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xfff1('0xe')]);router[_0xfff1('0xf')](_0xfff1('0xa'),auth[_0xfff1('0x8')](),controller[_0xfff1('0x10')]);module[_0xfff1('0x11')]=router;
\ No newline at end of file
+var _0xce7c=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','index','isAuthenticated','show','post','put'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xce7c,0x1a9));var _0xcce7=function(_0x20fa63,_0x65c8d3){_0x20fa63=_0x20fa63-0x0;var _0x4c37ae=_0xce7c[_0x20fa63];return _0x4c37ae;};'use strict';var multer=require(_0xcce7('0x0'));var util=require(_0xcce7('0x1'));var path=require(_0xcce7('0x2'));var timeout=require(_0xcce7('0x3'));var express=require(_0xcce7('0x4'));var router=express[_0xcce7('0x5')]();var fs_extra=require(_0xcce7('0x6'));var auth=require(_0xcce7('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xcce7('0x8'));var controller=require(_0xcce7('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xcce7('0xa')]);router['get']('/describe',auth[_0xcce7('0xb')](),controller['describe']);router['get']('/:id',auth[_0xcce7('0xb')](),controller[_0xcce7('0xc')]);router[_0xcce7('0xd')]('/',auth[_0xcce7('0xb')](),controller['create']);router[_0xcce7('0xe')](_0xcce7('0xf'),auth[_0xcce7('0xb')](),controller[_0xcce7('0x10')]);router[_0xcce7('0x11')]('/:id',auth[_0xcce7('0xb')](),controller[_0xcce7('0x12')]);module[_0xcce7('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 1dbc97a..730ec81 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x2b01d9,_0x2e54aa){var _0x3b9d60=function(_0x2f00f8){while(--_0x2f00f8){_0x2b01d9['push'](_0x2b01d9['shift']());}};_0x3b9d60(++_0x2e54aa);}(_0xf4eb,0xec));var _0xbf4e=function(_0x198fa0,_0x43dce9){_0x198fa0=_0x198fa0-0x0;var _0x24e23f=_0xf4eb[_0x198fa0];return _0x24e23f;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
+var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x5466c2,_0x3308cb){var _0x4b03f8=function(_0x535156){while(--_0x535156){_0x5466c2['push'](_0x5466c2['shift']());}};_0x4b03f8(++_0x3308cb);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3a8cd0,_0x17f29d){_0x3a8cd0=_0x3a8cd0-0x0;var _0x3d6f44=_0xf4eb[_0x3a8cd0];return _0x3d6f44;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 3e5f7a3..2815782 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 _0xfde9=['catch','show','params','rawAttributes','includeAll','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','index','map','fieldName','type','key','name','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','ChatTransferReport','include','findAll','rows'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xfde9,0x1d2));var _0x9fde=function(_0x372515,_0xdd11f){_0x372515=_0x372515-0x0;var _0xa3bf4e=_0xfde9[_0x372515];return _0xa3bf4e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9fde('0x0'));var zipdir=require(_0x9fde('0x1'));var jsonpatch=require(_0x9fde('0x2'));var rp=require('request-promise');var moment=require(_0x9fde('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x9fde('0x4'));var sox=require(_0x9fde('0x5'));var csv=require(_0x9fde('0x6'));var ejs=require(_0x9fde('0x7'));var fs=require('fs');var fs_extra=require(_0x9fde('0x8'));var _=require(_0x9fde('0x9'));var squel=require(_0x9fde('0xa'));var crypto=require(_0x9fde('0xb'));var jsforce=require(_0x9fde('0xc'));var deskjs=require(_0x9fde('0xd'));var toCsv=require(_0x9fde('0x6'));var querystring=require(_0x9fde('0xe'));var Papa=require(_0x9fde('0xf'));var Redis=require(_0x9fde('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9fde('0x11'));var as=require(_0x9fde('0x12'));var hardwareService=require(_0x9fde('0x13'));var logger=require('../../config/logger')(_0x9fde('0x14'));var utils=require(_0x9fde('0x15'));var config=require(_0x9fde('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9fde('0x17'))['db'];function respondWithStatusCode(_0x28d9c5,_0x1efe7d){_0x1efe7d=_0x1efe7d||0xcc;return function(_0x555629){if(_0x555629){return _0x28d9c5[_0x9fde('0x18')](_0x1efe7d);}return _0x28d9c5[_0x9fde('0x19')](_0x1efe7d)[_0x9fde('0x1a')]();};}function respondWithResult(_0x569c7b,_0x3fe94c){_0x3fe94c=_0x3fe94c||0xc8;return function(_0x29530c){if(_0x29530c){return _0x569c7b[_0x9fde('0x19')](_0x3fe94c)[_0x9fde('0x1b')](_0x29530c);}};}function respondWithFilteredResult(_0x554b4d,_0x2e4349){return function(_0x565e03){if(_0x565e03){var _0xe533aa=typeof _0x2e4349[_0x9fde('0x1c')]==='undefined'&&typeof _0x2e4349[_0x9fde('0x1d')]==='undefined';var _0x795587=_0x565e03[_0x9fde('0x1e')];var _0xfc9197=_0xe533aa?0x0:_0x2e4349[_0x9fde('0x1c')];var _0xea296d=_0xe533aa?_0x565e03[_0x9fde('0x1e')]:_0x2e4349['offset']+_0x2e4349[_0x9fde('0x1d')];var _0x4d2f1c;if(_0xea296d>=_0x795587){_0xea296d=_0x795587;_0x4d2f1c=0xc8;}else{_0x4d2f1c=0xce;}_0x554b4d[_0x9fde('0x19')](_0x4d2f1c);return _0x554b4d[_0x9fde('0x1f')](_0x9fde('0x20'),_0xfc9197+'-'+_0xea296d+'/'+_0x795587)['json'](_0x565e03);}return null;};}function patchUpdates(_0x29c08a){return function(_0x2cc2a4){try{jsonpatch[_0x9fde('0x21')](_0x2cc2a4,_0x29c08a,!![]);}catch(_0x5b6a3e){return BPromise[_0x9fde('0x22')](_0x5b6a3e);}return _0x2cc2a4[_0x9fde('0x23')]();};}function saveUpdates(_0x2ed48d,_0x5b75a0){return function(_0x3f1a9a){if(_0x3f1a9a){return _0x3f1a9a['update'](_0x2ed48d)[_0x9fde('0x24')](function(_0x153614){return _0x153614;});}return null;};}function removeEntity(_0x28839e,_0x38ece0){return function(_0x5d788d){if(_0x5d788d){return _0x5d788d[_0x9fde('0x25')]()['then'](function(){_0x28839e[_0x9fde('0x19')](0xcc)[_0x9fde('0x1a')]();});}};}function handleEntityNotFound(_0x41f67f,_0x9ac7c4){return function(_0x389c8d){if(!_0x389c8d){_0x41f67f[_0x9fde('0x18')](0x194);}return _0x389c8d;};}function handleError(_0xf6890,_0x3b0837){_0x3b0837=_0x3b0837||0x1f4;return function(_0x1d9ec7){logger[_0x9fde('0x26')](_0x1d9ec7[_0x9fde('0x27')]);if(_0x1d9ec7['name']){delete _0x1d9ec7['name'];}_0xf6890[_0x9fde('0x19')](_0x3b0837)['send'](_0x1d9ec7);};}exports[_0x9fde('0x28')]=function(_0x51b088,_0x459347){var _0x2d0065={},_0x5640fa={},_0x4d1e4e={'count':0x0,'rows':[]};var _0x4db725=_[_0x9fde('0x29')](db['ChatTransferReport']['rawAttributes'],function(_0x2a0290){return{'name':_0x2a0290[_0x9fde('0x2a')],'type':_0x2a0290[_0x9fde('0x2b')][_0x9fde('0x2c')]};});_0x5640fa['model']=_['map'](_0x4db725,_0x9fde('0x2d'));_0x5640fa['query']=_[_0x9fde('0x2e')](_0x51b088[_0x9fde('0x2f')]);_0x5640fa[_0x9fde('0x30')]=_[_0x9fde('0x31')](_0x5640fa[_0x9fde('0x32')],_0x5640fa[_0x9fde('0x2f')]);_0x2d0065[_0x9fde('0x33')]=_[_0x9fde('0x31')](_0x5640fa[_0x9fde('0x32')],qs[_0x9fde('0x34')](_0x51b088['query']['fields']));_0x2d0065[_0x9fde('0x33')]=_0x2d0065[_0x9fde('0x33')][_0x9fde('0x35')]?_0x2d0065[_0x9fde('0x33')]:_0x5640fa[_0x9fde('0x32')];if(!_0x51b088[_0x9fde('0x2f')][_0x9fde('0x36')]('nolimit')){_0x2d0065['limit']=qs[_0x9fde('0x1d')](_0x51b088['query'][_0x9fde('0x1d')]);_0x2d0065[_0x9fde('0x1c')]=qs['offset'](_0x51b088[_0x9fde('0x2f')][_0x9fde('0x1c')]);}_0x2d0065[_0x9fde('0x37')]=qs[_0x9fde('0x38')](_0x51b088['query']['sort']);_0x2d0065[_0x9fde('0x39')]=qs[_0x9fde('0x30')](_[_0x9fde('0x3a')](_0x51b088[_0x9fde('0x2f')],_0x5640fa[_0x9fde('0x30')]),_0x4db725);if(_0x51b088[_0x9fde('0x2f')][_0x9fde('0x3b')]){_0x2d0065[_0x9fde('0x39')]=_[_0x9fde('0x3c')](_0x2d0065[_0x9fde('0x39')],{'$or':_[_0x9fde('0x29')](_0x4db725,function(_0x5aac3a){if(_0x5aac3a[_0x9fde('0x2b')]!=='VIRTUAL'){var _0x5f396c={};_0x5f396c[_0x5aac3a[_0x9fde('0x2d')]]={'$like':'%'+_0x51b088[_0x9fde('0x2f')][_0x9fde('0x3b')]+'%'};return _0x5f396c;}})});}_0x2d0065=_[_0x9fde('0x3c')]({},_0x2d0065,_0x51b088[_0x9fde('0x3d')]);var _0x7e3093={'where':_0x2d0065[_0x9fde('0x39')]};return db[_0x9fde('0x3e')][_0x9fde('0x1e')](_0x7e3093)[_0x9fde('0x24')](function(_0x4c3b05){_0x4d1e4e[_0x9fde('0x1e')]=_0x4c3b05;if(_0x51b088['query']['includeAll']){_0x2d0065[_0x9fde('0x3f')]=[{'all':!![]}];}return db[_0x9fde('0x3e')][_0x9fde('0x40')](_0x2d0065);})['then'](function(_0x555136){_0x4d1e4e[_0x9fde('0x41')]=_0x555136;return _0x4d1e4e;})[_0x9fde('0x24')](respondWithFilteredResult(_0x459347,_0x2d0065))[_0x9fde('0x42')](handleError(_0x459347,null));};exports[_0x9fde('0x43')]=function(_0xe1514a,_0x2da18b){var _0x50cfba={'raw':!![],'where':{'id':_0xe1514a[_0x9fde('0x44')]['id']}},_0xbde840={};_0xbde840[_0x9fde('0x32')]=_['keys'](db[_0x9fde('0x3e')][_0x9fde('0x45')]);_0xbde840[_0x9fde('0x2f')]=_[_0x9fde('0x2e')](_0xe1514a[_0x9fde('0x2f')]);_0xbde840[_0x9fde('0x30')]=_[_0x9fde('0x31')](_0xbde840[_0x9fde('0x32')],_0xbde840[_0x9fde('0x2f')]);_0x50cfba['attributes']=_['intersection'](_0xbde840[_0x9fde('0x32')],qs[_0x9fde('0x34')](_0xe1514a[_0x9fde('0x2f')][_0x9fde('0x34')]));_0x50cfba['attributes']=_0x50cfba[_0x9fde('0x33')]['length']?_0x50cfba[_0x9fde('0x33')]:_0xbde840[_0x9fde('0x32')];if(_0xe1514a[_0x9fde('0x2f')][_0x9fde('0x46')]){_0x50cfba[_0x9fde('0x3f')]=[{'all':!![]}];}_0x50cfba=_['merge']({},_0x50cfba,_0xe1514a[_0x9fde('0x3d')]);return db[_0x9fde('0x3e')][_0x9fde('0x47')](_0x50cfba)[_0x9fde('0x24')](handleEntityNotFound(_0x2da18b,null))[_0x9fde('0x24')](respondWithResult(_0x2da18b,null))['catch'](handleError(_0x2da18b,null));};exports[_0x9fde('0x48')]=function(_0x153752,_0x3a33ba){return db[_0x9fde('0x3e')][_0x9fde('0x48')](_0x153752[_0x9fde('0x49')],{})['then'](respondWithResult(_0x3a33ba,0xc9))[_0x9fde('0x42')](handleError(_0x3a33ba,null));};exports[_0x9fde('0x4a')]=function(_0x8d1a6a,_0x3e7085){if(_0x8d1a6a['body']['id']){delete _0x8d1a6a['body']['id'];}return db[_0x9fde('0x3e')]['find']({'where':{'id':_0x8d1a6a['params']['id']}})[_0x9fde('0x24')](handleEntityNotFound(_0x3e7085,null))['then'](saveUpdates(_0x8d1a6a[_0x9fde('0x49')],null))['then'](respondWithResult(_0x3e7085,null))[_0x9fde('0x42')](handleError(_0x3e7085,null));};exports['destroy']=function(_0x404534,_0x2997ab){return db['ChatTransferReport'][_0x9fde('0x47')]({'where':{'id':_0x404534[_0x9fde('0x44')]['id']}})['then'](handleEntityNotFound(_0x2997ab,null))[_0x9fde('0x24')](removeEntity(_0x2997ab,null))[_0x9fde('0x42')](handleError(_0x2997ab,null));};exports[_0x9fde('0x4b')]=function(_0x1fbb62,_0x301bc1){return db[_0x9fde('0x3e')][_0x9fde('0x4b')]()[_0x9fde('0x24')](respondWithResult(_0x301bc1,null))[_0x9fde('0x42')](handleError(_0x301bc1,null));};
\ No newline at end of file
+var _0x9e8e=['end','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','then'];(function(_0x535c96,_0x380486){var _0x10bb40=function(_0x10012c){while(--_0x10012c){_0x535c96['push'](_0x535c96['shift']());}};_0x10bb40(++_0x380486);}(_0x9e8e,0x179));var _0xe9e8=function(_0x15f019,_0x41b4f2){_0x15f019=_0x15f019-0x0;var _0x2a462f=_0x9e8e[_0x15f019];return _0x2a462f;};'use strict';var emlformat=require(_0xe9e8('0x0'));var rimraf=require(_0xe9e8('0x1'));var zipdir=require(_0xe9e8('0x2'));var jsonpatch=require(_0xe9e8('0x3'));var rp=require('request-promise');var moment=require(_0xe9e8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xe9e8('0x5'));var sox=require('sox');var csv=require(_0xe9e8('0x6'));var ejs=require(_0xe9e8('0x7'));var fs=require('fs');var fs_extra=require(_0xe9e8('0x8'));var _=require('lodash');var squel=require(_0xe9e8('0x9'));var crypto=require(_0xe9e8('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe9e8('0xb'));var toCsv=require(_0xe9e8('0x6'));var querystring=require(_0xe9e8('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9e8('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe9e8('0xe'));var licenseUtil=require(_0xe9e8('0xf'));var db=require(_0xe9e8('0x10'))['db'];function respondWithStatusCode(_0x38cde1,_0x4b4861){_0x4b4861=_0x4b4861||0xcc;return function(_0x144a7e){if(_0x144a7e){return _0x38cde1[_0xe9e8('0x11')](_0x4b4861);}return _0x38cde1[_0xe9e8('0x12')](_0x4b4861)['end']();};}function respondWithResult(_0x404d1d,_0x4f98ce){_0x4f98ce=_0x4f98ce||0xc8;return function(_0x132a83){if(_0x132a83){return _0x404d1d[_0xe9e8('0x12')](_0x4f98ce)[_0xe9e8('0x13')](_0x132a83);}};}function respondWithFilteredResult(_0x2935db,_0x39daac){return function(_0x5c8f8b){if(_0x5c8f8b){var _0x29848b=typeof _0x39daac['offset']===_0xe9e8('0x14')&&typeof _0x39daac[_0xe9e8('0x15')]==='undefined';var _0x91f843=_0x5c8f8b[_0xe9e8('0x16')];var _0x42178b=_0x29848b?0x0:_0x39daac[_0xe9e8('0x17')];var _0x597fbe=_0x29848b?_0x5c8f8b['count']:_0x39daac[_0xe9e8('0x17')]+_0x39daac[_0xe9e8('0x15')];var _0x162e2e;if(_0x597fbe>=_0x91f843){_0x597fbe=_0x91f843;_0x162e2e=0xc8;}else{_0x162e2e=0xce;}_0x2935db[_0xe9e8('0x12')](_0x162e2e);return _0x2935db['set'](_0xe9e8('0x18'),_0x42178b+'-'+_0x597fbe+'/'+_0x91f843)[_0xe9e8('0x13')](_0x5c8f8b);}return null;};}function patchUpdates(_0x405a46){return function(_0x289b1e){try{jsonpatch[_0xe9e8('0x19')](_0x289b1e,_0x405a46,!![]);}catch(_0x87a9d2){return BPromise[_0xe9e8('0x1a')](_0x87a9d2);}return _0x289b1e[_0xe9e8('0x1b')]();};}function saveUpdates(_0x34174a,_0x2746d9){return function(_0x1b9f9a){if(_0x1b9f9a){return _0x1b9f9a[_0xe9e8('0x1c')](_0x34174a)['then'](function(_0x326e15){return _0x326e15;});}return null;};}function removeEntity(_0x453d2e,_0x591d4d){return function(_0x701dca){if(_0x701dca){return _0x701dca[_0xe9e8('0x1d')]()[_0xe9e8('0x1e')](function(){_0x453d2e[_0xe9e8('0x12')](0xcc)[_0xe9e8('0x1f')]();});}};}function handleEntityNotFound(_0x30e1fb,_0x51312b){return function(_0xbd9dcd){if(!_0xbd9dcd){_0x30e1fb['sendStatus'](0x194);}return _0xbd9dcd;};}function handleError(_0x84847c,_0x14d85d){_0x14d85d=_0x14d85d||0x1f4;return function(_0xe8c7c6){logger[_0xe9e8('0x20')](_0xe8c7c6[_0xe9e8('0x21')]);if(_0xe8c7c6[_0xe9e8('0x22')]){delete _0xe8c7c6['name'];}_0x84847c[_0xe9e8('0x12')](_0x14d85d)[_0xe9e8('0x23')](_0xe8c7c6);};}exports[_0xe9e8('0x24')]=function(_0x1938c7,_0x4d3695){var _0x3771e7={},_0x5255be={},_0x277ca4={'count':0x0,'rows':[]};var _0x427193=_[_0xe9e8('0x25')](db[_0xe9e8('0x26')][_0xe9e8('0x27')],function(_0x1425a5){return{'name':_0x1425a5[_0xe9e8('0x28')],'type':_0x1425a5['type']['key']};});_0x5255be[_0xe9e8('0x29')]=_[_0xe9e8('0x25')](_0x427193,_0xe9e8('0x22'));_0x5255be[_0xe9e8('0x2a')]=_['keys'](_0x1938c7[_0xe9e8('0x2a')]);_0x5255be[_0xe9e8('0x2b')]=_[_0xe9e8('0x2c')](_0x5255be[_0xe9e8('0x29')],_0x5255be['query']);_0x3771e7['attributes']=_[_0xe9e8('0x2c')](_0x5255be[_0xe9e8('0x29')],qs[_0xe9e8('0x2d')](_0x1938c7['query']['fields']));_0x3771e7[_0xe9e8('0x2e')]=_0x3771e7[_0xe9e8('0x2e')][_0xe9e8('0x2f')]?_0x3771e7[_0xe9e8('0x2e')]:_0x5255be[_0xe9e8('0x29')];if(!_0x1938c7[_0xe9e8('0x2a')][_0xe9e8('0x30')]('nolimit')){_0x3771e7[_0xe9e8('0x15')]=qs['limit'](_0x1938c7['query'][_0xe9e8('0x15')]);_0x3771e7[_0xe9e8('0x17')]=qs[_0xe9e8('0x17')](_0x1938c7[_0xe9e8('0x2a')][_0xe9e8('0x17')]);}_0x3771e7[_0xe9e8('0x31')]=qs['sort'](_0x1938c7[_0xe9e8('0x2a')][_0xe9e8('0x32')]);_0x3771e7[_0xe9e8('0x33')]=qs[_0xe9e8('0x2b')](_[_0xe9e8('0x34')](_0x1938c7[_0xe9e8('0x2a')],_0x5255be[_0xe9e8('0x2b')]),_0x427193);if(_0x1938c7[_0xe9e8('0x2a')][_0xe9e8('0x35')]){_0x3771e7[_0xe9e8('0x33')]=_[_0xe9e8('0x36')](_0x3771e7[_0xe9e8('0x33')],{'$or':_[_0xe9e8('0x25')](_0x427193,function(_0x5a233a){if(_0x5a233a['type']!==_0xe9e8('0x37')){var _0x7164ae={};_0x7164ae[_0x5a233a[_0xe9e8('0x22')]]={'$like':'%'+_0x1938c7[_0xe9e8('0x2a')][_0xe9e8('0x35')]+'%'};return _0x7164ae;}})});}_0x3771e7=_[_0xe9e8('0x36')]({},_0x3771e7,_0x1938c7[_0xe9e8('0x38')]);var _0x1daad8={'where':_0x3771e7[_0xe9e8('0x33')]};return db['ChatTransferReport'][_0xe9e8('0x16')](_0x1daad8)[_0xe9e8('0x1e')](function(_0x57efd6){_0x277ca4['count']=_0x57efd6;if(_0x1938c7[_0xe9e8('0x2a')][_0xe9e8('0x39')]){_0x3771e7[_0xe9e8('0x3a')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xe9e8('0x3b')](_0x3771e7);})[_0xe9e8('0x1e')](function(_0x1ca91a){_0x277ca4[_0xe9e8('0x3c')]=_0x1ca91a;return _0x277ca4;})[_0xe9e8('0x1e')](respondWithFilteredResult(_0x4d3695,_0x3771e7))[_0xe9e8('0x3d')](handleError(_0x4d3695,null));};exports['show']=function(_0xf36ad1,_0x82da5){var _0x10282c={'raw':!![],'where':{'id':_0xf36ad1[_0xe9e8('0x3e')]['id']}},_0x37635c={};_0x37635c[_0xe9e8('0x29')]=_[_0xe9e8('0x3f')](db['ChatTransferReport'][_0xe9e8('0x27')]);_0x37635c[_0xe9e8('0x2a')]=_[_0xe9e8('0x3f')](_0xf36ad1[_0xe9e8('0x2a')]);_0x37635c['filters']=_[_0xe9e8('0x2c')](_0x37635c[_0xe9e8('0x29')],_0x37635c[_0xe9e8('0x2a')]);_0x10282c['attributes']=_[_0xe9e8('0x2c')](_0x37635c['model'],qs[_0xe9e8('0x2d')](_0xf36ad1[_0xe9e8('0x2a')][_0xe9e8('0x2d')]));_0x10282c[_0xe9e8('0x2e')]=_0x10282c[_0xe9e8('0x2e')][_0xe9e8('0x2f')]?_0x10282c[_0xe9e8('0x2e')]:_0x37635c[_0xe9e8('0x29')];if(_0xf36ad1[_0xe9e8('0x2a')][_0xe9e8('0x39')]){_0x10282c[_0xe9e8('0x3a')]=[{'all':!![]}];}_0x10282c=_[_0xe9e8('0x36')]({},_0x10282c,_0xf36ad1[_0xe9e8('0x38')]);return db['ChatTransferReport'][_0xe9e8('0x40')](_0x10282c)[_0xe9e8('0x1e')](handleEntityNotFound(_0x82da5,null))[_0xe9e8('0x1e')](respondWithResult(_0x82da5,null))[_0xe9e8('0x3d')](handleError(_0x82da5,null));};exports[_0xe9e8('0x41')]=function(_0x5021f1,_0x49e4cc){return db[_0xe9e8('0x26')]['create'](_0x5021f1['body'],{})[_0xe9e8('0x1e')](respondWithResult(_0x49e4cc,0xc9))[_0xe9e8('0x3d')](handleError(_0x49e4cc,null));};exports[_0xe9e8('0x1c')]=function(_0x484aa0,_0x42a47a){if(_0x484aa0[_0xe9e8('0x42')]['id']){delete _0x484aa0['body']['id'];}return db[_0xe9e8('0x26')][_0xe9e8('0x40')]({'where':{'id':_0x484aa0[_0xe9e8('0x3e')]['id']}})['then'](handleEntityNotFound(_0x42a47a,null))[_0xe9e8('0x1e')](saveUpdates(_0x484aa0[_0xe9e8('0x42')],null))[_0xe9e8('0x1e')](respondWithResult(_0x42a47a,null))[_0xe9e8('0x3d')](handleError(_0x42a47a,null));};exports[_0xe9e8('0x1d')]=function(_0x1ef052,_0x6393d4){return db['ChatTransferReport'][_0xe9e8('0x40')]({'where':{'id':_0x1ef052[_0xe9e8('0x3e')]['id']}})[_0xe9e8('0x1e')](handleEntityNotFound(_0x6393d4,null))[_0xe9e8('0x1e')](removeEntity(_0x6393d4,null))[_0xe9e8('0x3d')](handleError(_0x6393d4,null));};exports['describe']=function(_0x399e14,_0x286c2a){return db['ChatTransferReport'][_0xe9e8('0x43')]()[_0xe9e8('0x1e')](respondWithResult(_0x286c2a,null))['catch'](handleError(_0x286c2a,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index d3ba085..df976db 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 _0xf5f2=['request-promise','rimraf','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x3f4bab,_0xbf42f9){var _0x27fd30=function(_0x531b17){while(--_0x531b17){_0x3f4bab['push'](_0x3f4bab['shift']());}};_0x27fd30(++_0xbf42f9);}(_0xf5f2,0x14d));var _0x2f5f=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xf5f2[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0x2f5f('0x0'));var util=require('util');var logger=require(_0x2f5f('0x1'))(_0x2f5f('0x2'));var moment=require(_0x2f5f('0x3'));var BPromise=require(_0x2f5f('0x4'));var rp=require(_0x2f5f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2f5f('0x6'));var config=require('../../config/environment');var attributes=require(_0x2f5f('0x7'));module[_0x2f5f('0x8')]=function(_0x5a1df6,_0x3e5ca1){return _0x5a1df6[_0x2f5f('0x9')](_0x2f5f('0xa'),attributes,{'tableName':_0x2f5f('0xb'),'paranoid':![],'indexes':[{'name':_0x2f5f('0xc'),'fields':[_0x2f5f('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xdd24=['./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','util','../../config/logger','moment','request-promise','rimraf'];(function(_0x3c33c1,_0x200481){var _0x1ce9c1=function(_0x255c5b){while(--_0x255c5b){_0x3c33c1['push'](_0x3c33c1['shift']());}};_0x1ce9c1(++_0x200481);}(_0xdd24,0x9b));var _0x4dd2=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xdd24[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0x4dd2('0x0'));var logger=require(_0x4dd2('0x1'))('api');var moment=require(_0x4dd2('0x2'));var BPromise=require('bluebird');var rp=require(_0x4dd2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4dd2('0x4'));var config=require('../../config/environment');var attributes=require(_0x4dd2('0x5'));module[_0x4dd2('0x6')]=function(_0x3a602f,_0x94aedd){return _0x3a602f[_0x4dd2('0x7')](_0x4dd2('0x8'),attributes,{'tableName':_0x4dd2('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','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 e8dadf9..07ec961 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 _0xccad=['then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xccad,0x1d9));var _0xdcca=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0xccad[_0x256b72];return _0x2183e3;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xdcca('0x0'));var rs=require(_0xdcca('0x1'));var fs=require('fs');var Redis=require(_0xdcca('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xdcca('0x3'));var logger=require(_0xdcca('0x4'))(_0xdcca('0x5'));var config=require(_0xdcca('0x6'));var jayson=require(_0xdcca('0x7'));var client=jayson['client'][_0xdcca('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x41966d,_0x4511bf,_0x420d49){return new BPromise(function(_0x586d9c,_0x1b4d1e){return client[_0xdcca('0x9')](_0x41966d,_0x420d49)[_0xdcca('0xa')](function(_0x34e804){logger[_0xdcca('0xb')](_0xdcca('0xc'),_0x4511bf,_0xdcca('0xd'));logger[_0xdcca('0xe')](_0xdcca('0xf'),_0x4511bf,_0xdcca('0xd'),JSON[_0xdcca('0x10')](_0x34e804));if(_0x34e804[_0xdcca('0x11')]){if(_0x34e804[_0xdcca('0x11')][_0xdcca('0x12')]===0x1f4){logger[_0xdcca('0x11')](_0xdcca('0xc'),_0x4511bf,_0x34e804[_0xdcca('0x11')]['message']);return _0x1b4d1e(_0x34e804[_0xdcca('0x11')][_0xdcca('0x13')]);}logger[_0xdcca('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x4511bf,_0x34e804[_0xdcca('0x11')][_0xdcca('0x13')]);return _0x586d9c(_0x34e804[_0xdcca('0x11')][_0xdcca('0x13')]);}else{logger[_0xdcca('0xb')](_0xdcca('0xc'),_0x4511bf,_0xdcca('0xd'));_0x586d9c(_0x34e804[_0xdcca('0x14')][_0xdcca('0x13')]);}})['catch'](function(_0x5afb11){logger[_0xdcca('0x11')](_0xdcca('0xc'),_0x4511bf,_0x5afb11);_0x1b4d1e(_0x5afb11);});});}
\ No newline at end of file
+var _0xf981=['result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf981,0xaa));var _0x1f98=function(_0x240e0d,_0x551a41){_0x240e0d=_0x240e0d-0x0;var _0x45a0f3=_0xf981[_0x240e0d];return _0x45a0f3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1f98('0x0'));var BPromise=require(_0x1f98('0x1'));var rs=require(_0x1f98('0x2'));var fs=require('fs');var Redis=require(_0x1f98('0x3'));var db=require(_0x1f98('0x4'))['db'];var utils=require(_0x1f98('0x5'));var logger=require('../../config/logger')(_0x1f98('0x6'));var config=require('../../config/environment');var jayson=require(_0x1f98('0x7'));var client=jayson[_0x1f98('0x8')][_0x1f98('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8ff00c,_0x15049a,_0x38b0d7){return new BPromise(function(_0x1466ba,_0x3165cc){return client['request'](_0x8ff00c,_0x38b0d7)[_0x1f98('0xa')](function(_0x1e1d1c){logger[_0x1f98('0xb')](_0x1f98('0xc'),_0x15049a,_0x1f98('0xd'));logger[_0x1f98('0xe')](_0x1f98('0xf'),_0x15049a,_0x1f98('0xd'),JSON['stringify'](_0x1e1d1c));if(_0x1e1d1c[_0x1f98('0x10')]){if(_0x1e1d1c[_0x1f98('0x10')][_0x1f98('0x11')]===0x1f4){logger[_0x1f98('0x10')](_0x1f98('0xc'),_0x15049a,_0x1e1d1c[_0x1f98('0x10')][_0x1f98('0x12')]);return _0x3165cc(_0x1e1d1c[_0x1f98('0x10')][_0x1f98('0x12')]);}logger['error'](_0x1f98('0xc'),_0x15049a,_0x1e1d1c[_0x1f98('0x10')][_0x1f98('0x12')]);return _0x1466ba(_0x1e1d1c[_0x1f98('0x10')][_0x1f98('0x12')]);}else{logger['info'](_0x1f98('0xc'),_0x15049a,_0x1f98('0xd'));_0x1466ba(_0x1e1d1c[_0x1f98('0x13')][_0x1f98('0x12')]);}})[_0x1f98('0x14')](function(_0x22748d){logger[_0x1f98('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x15049a,_0x22748d);_0x3165cc(_0x22748d);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index c83e6da..ac7e1ad 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 _0x5162=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','util'];(function(_0x249e56,_0x48b38b){var _0x33d16f=function(_0x48823d){while(--_0x48823d){_0x249e56['push'](_0x249e56['shift']());}};_0x33d16f(++_0x48b38b);}(_0x5162,0x7d));var _0x2516=function(_0x39cff5,_0x234f0c){_0x39cff5=_0x39cff5-0x0;var _0x430437=_0x5162[_0x39cff5];return _0x430437;};'use strict';var multer=require('multer');var util=require(_0x2516('0x0'));var path=require(_0x2516('0x1'));var timeout=require(_0x2516('0x2'));var express=require('express');var router=express[_0x2516('0x3')]();var fs_extra=require(_0x2516('0x4'));var auth=require(_0x2516('0x5'));var interaction=require(_0x2516('0x6'));var config=require('../../config/environment');var controller=require(_0x2516('0x7'));router[_0x2516('0x8')]('/',auth[_0x2516('0x9')](),controller[_0x2516('0xa')]);router[_0x2516('0x8')](_0x2516('0xb'),auth[_0x2516('0x9')](),controller[_0x2516('0xc')]);router[_0x2516('0x8')](_0x2516('0xd'),auth[_0x2516('0x9')](),controller[_0x2516('0xe')]);router[_0x2516('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2516('0x10')]('/:id',auth[_0x2516('0x9')](),controller[_0x2516('0x11')]);router[_0x2516('0x12')](_0x2516('0xd'),auth[_0x2516('0x9')](),controller[_0x2516('0x13')]);module[_0x2516('0x14')]=router;
\ No newline at end of file
+var _0x09c0=['create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','describe','show','post'];(function(_0x164f9a,_0x1342ca){var _0x3062e3=function(_0x2dcd24){while(--_0x2dcd24){_0x164f9a['push'](_0x164f9a['shift']());}};_0x3062e3(++_0x1342ca);}(_0x09c0,0x79));var _0x009c=function(_0x47fa0f,_0x2a471e){_0x47fa0f=_0x47fa0f-0x0;var _0x30005a=_0x09c0[_0x47fa0f];return _0x30005a;};'use strict';var multer=require(_0x009c('0x0'));var util=require(_0x009c('0x1'));var path=require(_0x009c('0x2'));var timeout=require(_0x009c('0x3'));var express=require(_0x009c('0x4'));var router=express[_0x009c('0x5')]();var fs_extra=require(_0x009c('0x6'));var auth=require(_0x009c('0x7'));var interaction=require(_0x009c('0x8'));var config=require(_0x009c('0x9'));var controller=require(_0x009c('0xa'));router[_0x009c('0xb')]('/',auth[_0x009c('0xc')](),controller[_0x009c('0xd')]);router[_0x009c('0xb')]('/describe',auth[_0x009c('0xc')](),controller[_0x009c('0xe')]);router[_0x009c('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x009c('0xf')]);router[_0x009c('0x10')]('/',auth[_0x009c('0xc')](),controller[_0x009c('0x11')]);router[_0x009c('0x12')](_0x009c('0x13'),auth[_0x009c('0xc')](),controller[_0x009c('0x14')]);router[_0x009c('0x15')](_0x009c('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0x009c('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 5e6624c..ae5fdf0 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 _0x5ff3=['text','getDataValue','onlineForm','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','parse','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','squared','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','ENUM','star','thumb','input','name'];(function(_0x45b0b3,_0x565a05){var _0x282d6f=function(_0x13a774){while(--_0x13a774){_0x45b0b3['push'](_0x45b0b3['shift']());}};_0x282d6f(++_0x565a05);}(_0x5ff3,0x17d));var _0x35ff=function(_0x96ed10,_0x4dbe3f){_0x96ed10=_0x96ed10-0x0;var _0x4d603f=_0x5ff3[_0x96ed10];return _0x4d603f;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x35ff('0x0'));module['exports']={'name':{'type':Sequelize[_0x35ff('0x1')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x35ff('0x2')},'description':{'type':Sequelize[_0x35ff('0x1')]},'mapKey':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x35ff('0x3')},'key':{'type':Sequelize[_0x35ff('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x4')},'customerAlias':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x35ff('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x35ff('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x35ff('0x1')],'allowNull':![],'defaultValue':_0x35ff('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x35ff('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x35ff('0x1')]},'animation':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0x35ff('0x8')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x9')},'offline_chat_button':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0xa')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x35ff('0xb')},'download_transcript':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x35ff('0xc')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x35ff('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x35ff('0xe')]},'closingQuestion':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x11')},'noteTitle':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x12')},'placeholderMessage':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x13')},'closingMessage':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x35ff('0xa')},'skipMessageButton':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x15')},'conditionAgreement':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x35ff('0x16')](_0x35ff('0x17'),_0x35ff('0x18')),'defaultValue':_0x35ff('0x17')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x35ff('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x35ff('0x19'),'variable':null,'config':{'placeholder':_0x35ff('0x1a'),'type':_0x35ff('0x1b'),'required':!![]},'props':{'title':_0x35ff('0x1a'),'helpText':''}},{'type':_0x35ff('0x19'),'props':{'title':_0x35ff('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x35ff('0x3'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x35ff('0x1c')](_0x35ff('0x1d'))?JSON['parse'](this[_0x35ff('0x1c')]('onlineForm')):{};},'set':function(_0x4c46b7){return this[_0x35ff('0x1e')](_0x35ff('0x1d'),JSON[_0x35ff('0x1f')](_0x4c46b7));}},'offlineForm':{'type':Sequelize[_0x35ff('0xe')],'defaultValue':function(){return JSON[_0x35ff('0x1f')]({'items':[{'type':'input','props':{'title':_0x35ff('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x35ff('0x3'),'type':_0x35ff('0x3')},'variable':null},{'type':'textarea','config':{'placeholder':_0x35ff('0x20')},'props':{'title':_0x35ff('0x20'),'helpText':_0x35ff('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x35ff('0x1c')](_0x35ff('0x22'))?JSON[_0x35ff('0x23')](this[_0x35ff('0x1c')](_0x35ff('0x22'))):{};},'set':function(_0x105e58){return this['setDataValue'](_0x35ff('0x22'),JSON['stringify'](_0x105e58));}},'token':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':function(){return rs[_0x35ff('0x24')]();}},'autoclose':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x35ff('0x1')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x35ff('0x1')]},'waitingTitle':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x35ff('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x26')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x27')},'skipUnmanaged':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x15')},'sendUnmanaged':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0xa')},'enableCustomerAttachment':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x35ff('0xe')]},'showAgentAvatar':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x35ff('0x1')]},'notificationTemplate':{'type':Sequelize[_0x35ff('0xe')],'defaultValue':function(){return _0x35ff('0x28');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x35ff('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x2b')},'messagesAlignment':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x2c')},'defaultTitle':{'type':Sequelize[_0x35ff('0x1')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x35ff('0xc')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x35ff('0x1')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x35ff('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x35ff('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x2d')},'systemAvatar':{'type':Sequelize[_0x35ff('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x35ff('0xc')],'comment':_0x35ff('0x2e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x550c09){if(!_0x550c09)this[_0x35ff('0x1e')](_0x35ff('0x2f'),null);this[_0x35ff('0x1e')](_0x35ff('0x30'),_0x550c09);}},'vidaooEscalation':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x35ff('0x1')],'allowNull':![],'defaultValue':_0x35ff('0x31')},'vidaooNote':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':function(){return _0x35ff('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x35ff('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x9f62=['Skip','Feedback','thumb','stringify','input','name','getDataValue','parse','setDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','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}}','website_alias','CHAT','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!'];(function(_0x3ef9f7,_0x1bfbf6){var _0x4c9ded=function(_0x32c994){while(--_0x32c994){_0x3ef9f7['push'](_0x3ef9f7['shift']());}};_0x4c9ded(++_0x1bfbf6);}(_0x9f62,0x154));var _0x29f6=function(_0x4135fd,_0x4dd3c8){_0x4135fd=_0x4135fd-0x0;var _0x3ab658=_0x9f62[_0x4135fd];return _0x3ab658;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x29f6('0x0'));module['exports']={'name':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![],'unique':_0x29f6('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x29f6('0x3')},'mapKeyOffline':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x3')},'key':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x29f6('0x4')},'customerAlias':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![],'defaultValue':_0x29f6('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x29f6('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x29f6('0x8')](_0x29f6('0x9'),'squared'),'defaultValue':_0x29f6('0x9')},'header_online':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x29f6('0xa')},'header_offline':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xb')},'download_transcript':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x29f6('0xe')]},'closingQuestion':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x11')},'noteTitle':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x13')},'closingMessageButton':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x15')},'ratingType':{'type':Sequelize[_0x29f6('0x8')]('star',_0x29f6('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':function(){return JSON[_0x29f6('0x17')]({'items':[{'type':_0x29f6('0x18'),'variable':null,'config':{'placeholder':_0x29f6('0x19'),'type':'text','required':!![]},'props':{'title':_0x29f6('0x19'),'helpText':''}},{'type':'input','props':{'title':_0x29f6('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x29f6('0x3'),'type':_0x29f6('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x29f6('0x1a')]('onlineForm')?JSON[_0x29f6('0x1b')](this[_0x29f6('0x1a')]('onlineForm')):{};},'set':function(_0x1401fb){return this[_0x29f6('0x1c')](_0x29f6('0x1d'),JSON[_0x29f6('0x17')](_0x1401fb));}},'offlineForm':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':function(){return JSON[_0x29f6('0x17')]({'items':[{'type':_0x29f6('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x29f6('0x3'),'type':_0x29f6('0x3')},'variable':null},{'type':_0x29f6('0x1e'),'config':{'placeholder':_0x29f6('0x1f')},'props':{'title':_0x29f6('0x1f'),'helpText':_0x29f6('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x29f6('0x1a')](_0x29f6('0x21'))?JSON[_0x29f6('0x1b')](this[_0x29f6('0x1a')](_0x29f6('0x21'))):{};},'set':function(_0x1c3f0b){return this[_0x29f6('0x1c')](_0x29f6('0x21'),JSON[_0x29f6('0x17')](_0x1c3f0b));}},'token':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':function(){return rs[_0x29f6('0x22')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x29f6('0x1')]},'waitingTitle':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x23')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x24')},'offlineMessageBody':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x26')},'skipUnmanaged':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x14')},'sendUnmanaged':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xa')},'enableCustomerAttachment':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x29f6('0xe')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':function(){return _0x29f6('0x27');}},'notificationSound':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x29f6('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x29')},'messagesAlignment':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x29f6('0x1')]},'customerAvatar':{'type':Sequelize[_0x29f6('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x29f6('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x29f6('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3f3475){if(!_0x3f3475)this[_0x29f6('0x1c')]('mandatoryDispositionPauseId',null);this[_0x29f6('0x1c')](_0x29f6('0x2a'),_0x3f3475);}},'vidaooEscalation':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x29f6('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x29f6('0x2b')},'vidaooNote':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':function(){return _0x29f6('0x2c');}},'vidaooMetadata':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 4f385af..e7e2dba 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 _0x520c=['includeAll','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','describe','ChatWebsiteId','Disposition','getDispositions','findOne','pick','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','isNil','server/files/images/avatars/system_avatar.png','notify','user-agent','getResult','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','ChatApplication','Applications','List','account','applications','list','orderBy','priority','asc','Contacts','contact','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','format','%s\x20%s','version','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','ContactId','interaction','spread','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','no\x20available\x20attributes','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','fromString','originalname','mimetype','files','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','user','offlineMessageSubject','MailAccountId','toPairsIn','mapValues','subjectOffline','email','NotifyMailAccount','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','User','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','referer','replace','verticalAlignment','textColor','textButtonColor','color_button','backgroundColor','addApplications','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','false','onlineForm','items','fromKey','getOfflineMessages','Attachments','ChatOfflineMessage','emit','removeAgents','userChatWebsite:remove','getAgents','bluebird','mustache','util','ejs','fs-extra','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','redis','localhost','./chatWebsite.socket','register','html-to-text','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','end','sendStatus','stack','name','index','Pause','map','ChatWebsite','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','include','findAll','rows','params','mandatoryDispositionPause'];(function(_0x1988a6,_0x92744b){var _0x48ca22=function(_0x159a67){while(--_0x159a67){_0x1988a6['push'](_0x1988a6['shift']());}};_0x48ca22(++_0x92744b);}(_0x520c,0xd5));var _0xc520=function(_0xabbd2f,_0x44d05a){_0xabbd2f=_0xabbd2f-0x0;var _0x34a040=_0x520c[_0xabbd2f];return _0x34a040;};'use strict';var BPromise=require(_0xc520('0x0'));var Mustache=require(_0xc520('0x1'));var util=require(_0xc520('0x2'));var path=require('path');var ejs=require(_0xc520('0x3'));var fs=require('fs');var fs_extra=require(_0xc520('0x4'));var _=require(_0xc520('0x5'));var querystring=require(_0xc520('0x6'));var Redis=require('ioredis');var qs=require(_0xc520('0x7'));var logger=require(_0xc520('0x8'))(_0xc520('0x9'));var config=require(_0xc520('0xa'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xc520('0xb')](config[_0xc520('0xc')],{'host':_0xc520('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc520('0xc')]));require(_0xc520('0xe'))[_0xc520('0xf')](socket);var htmlToText=require(_0xc520('0x10'));var jayson=require('jayson/promise');var client=jayson[_0xc520('0x11')]['http']({'port':0x232c});var client9002=jayson[_0xc520('0x11')][_0xc520('0x12')]({'port':0x232a});var client9003=jayson[_0xc520('0x11')][_0xc520('0x12')]({'port':0x232b});var client9001=jayson[_0xc520('0x11')]['http']({'port':0x2329});function respondWithRpcPromise(_0x4beb3c,_0x32db26,_0x24ab50,_0x30cf1f){return new BPromise(function(_0x54a39e,_0x3fc182){var _0x9b0c49=_0x30cf1f||client;return _0x9b0c49[_0xc520('0x13')](_0x4beb3c,_0x24ab50)[_0xc520('0x14')](function(_0x467ef5){logger[_0xc520('0x15')](_0xc520('0x16'),_0x32db26,'request\x20sent');logger['debug'](_0xc520('0x17'),_0x32db26,_0xc520('0x18'),JSON[_0xc520('0x19')](_0x467ef5));if(_0x467ef5[_0xc520('0x1a')]){if(_0x467ef5[_0xc520('0x1a')][_0xc520('0x1b')]===0x1f4){logger[_0xc520('0x1a')](_0xc520('0x16'),_0x32db26,_0x467ef5[_0xc520('0x1a')][_0xc520('0x1c')]);return _0x3fc182(_0x467ef5[_0xc520('0x1a')][_0xc520('0x1c')]);}logger[_0xc520('0x1a')](_0xc520('0x16'),_0x32db26,_0x467ef5[_0xc520('0x1a')][_0xc520('0x1c')]);return _0x54a39e(_0x467ef5[_0xc520('0x1a')][_0xc520('0x1c')]);}else{logger[_0xc520('0x15')](_0xc520('0x16'),_0x32db26,'request\x20sent');_0x54a39e(_0x467ef5[_0xc520('0x1d')][_0xc520('0x1c')]);}})[_0xc520('0x1e')](function(_0x19c612){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x32db26,_0x19c612);_0x3fc182(_0x19c612);});});}function respondWithStatusCode(_0x5e19a0,_0x268d06){_0x268d06=_0x268d06||0xcc;return function(_0x294cfe){if(_0x294cfe){return _0x5e19a0['sendStatus'](_0x268d06);}return _0x5e19a0[_0xc520('0x1f')](_0x268d06)['end']();};}function respondWithResult(_0xfbf124,_0x194586){_0x194586=_0x194586||0xc8;return function(_0x3a6bf3){if(_0x3a6bf3){return _0xfbf124['status'](_0x194586)[_0xc520('0x20')](_0x3a6bf3);}};}function respondWithFilteredResult(_0x2f8c43,_0x17b651){return function(_0x458697){if(_0x458697){var _0x3c6d98=typeof _0x17b651[_0xc520('0x21')]===_0xc520('0x22')&&typeof _0x17b651[_0xc520('0x23')]===_0xc520('0x22');var _0x570e8d=_0x458697[_0xc520('0x24')];var _0x37ae7f=_0x3c6d98?0x0:_0x17b651[_0xc520('0x21')];var _0x163d97=_0x3c6d98?_0x458697['count']:_0x17b651[_0xc520('0x21')]+_0x17b651[_0xc520('0x23')];var _0x398712;if(_0x163d97>=_0x570e8d){_0x163d97=_0x570e8d;_0x398712=0xc8;}else{_0x398712=0xce;}_0x2f8c43[_0xc520('0x1f')](_0x398712);return _0x2f8c43[_0xc520('0x25')](_0xc520('0x26'),_0x37ae7f+'-'+_0x163d97+'/'+_0x570e8d)[_0xc520('0x20')](_0x458697);}return null;};}function saveUpdates(_0x46b207){return function(_0x17199e){if(_0x17199e){return _0x17199e[_0xc520('0x27')](_0x46b207)[_0xc520('0x14')](function(_0x24a078){return _0x24a078;});}return null;};}function removeEntity(_0x48b3c4){return function(_0x1ca8e6){if(_0x1ca8e6){return _0x1ca8e6[_0xc520('0x28')]()['then'](function(){var _0x33a479=_0x1ca8e6[_0xc520('0x29')]({'plain':!![]});var _0x1b61f2=_0xc520('0x2a');return db[_0xc520('0x2b')][_0xc520('0x28')]({'where':{'type':_0x1b61f2,'resourceId':_0x33a479['id']}})[_0xc520('0x14')](function(){return _0x1ca8e6;});})[_0xc520('0x14')](function(){_0x48b3c4[_0xc520('0x1f')](0xcc)[_0xc520('0x2c')]();});}};}function handleEntityNotFound(_0x1e97b3){return function(_0x44524a){if(!_0x44524a){_0x1e97b3[_0xc520('0x2d')](0x194);}return _0x44524a;};}function handleError(_0x376b4e,_0xb5591e){_0xb5591e=_0xb5591e||0x1f4;return function(_0x1bde96){logger[_0xc520('0x1a')](_0x1bde96[_0xc520('0x2e')]);if(_0x1bde96[_0xc520('0x2f')]){delete _0x1bde96[_0xc520('0x2f')];}_0x376b4e[_0xc520('0x1f')](_0xb5591e)['send'](_0x1bde96);};}exports[_0xc520('0x30')]=function(_0x3b467f,_0x375cc8){var _0x2ee155={'include':[{'model':db[_0xc520('0x31')],'as':'mandatoryDispositionPause'}]},_0x13a2da={},_0x3b8e64={'count':0x0,'rows':[]};var _0x5e50fd=_[_0xc520('0x32')](db[_0xc520('0x33')][_0xc520('0x34')],function(_0x133bc6){return{'name':_0x133bc6[_0xc520('0x35')],'type':_0x133bc6[_0xc520('0x36')]['key']};});_0x13a2da['model']=_[_0xc520('0x32')](_0x5e50fd,_0xc520('0x2f'));_0x13a2da[_0xc520('0x37')]=_[_0xc520('0x38')](_0x3b467f[_0xc520('0x37')]);_0x13a2da[_0xc520('0x39')]=_[_0xc520('0x3a')](_0x13a2da['model'],_0x13a2da['query']);_0x2ee155[_0xc520('0x3b')]=_[_0xc520('0x3a')](_0x13a2da[_0xc520('0x3c')],qs[_0xc520('0x3d')](_0x3b467f[_0xc520('0x37')][_0xc520('0x3d')]));_0x2ee155[_0xc520('0x3b')]=_0x2ee155[_0xc520('0x3b')][_0xc520('0x3e')]?_0x2ee155[_0xc520('0x3b')]:_0x13a2da[_0xc520('0x3c')];if(!_0x3b467f[_0xc520('0x37')][_0xc520('0x3f')](_0xc520('0x40'))){_0x2ee155[_0xc520('0x23')]=qs[_0xc520('0x23')](_0x3b467f['query'][_0xc520('0x23')]);_0x2ee155[_0xc520('0x21')]=qs[_0xc520('0x21')](_0x3b467f[_0xc520('0x37')][_0xc520('0x21')]);}_0x2ee155[_0xc520('0x41')]=qs['sort'](_0x3b467f['query'][_0xc520('0x42')]);_0x2ee155[_0xc520('0x43')]=qs[_0xc520('0x39')](_['pick'](_0x3b467f['query'],_0x13a2da['filters']),_0x5e50fd);if(_0x3b467f[_0xc520('0x37')][_0xc520('0x44')]){_0x2ee155['where']=_[_0xc520('0x45')](_0x2ee155[_0xc520('0x43')],{'$or':_[_0xc520('0x32')](_0x5e50fd,function(_0x474c88){if(_0x474c88[_0xc520('0x36')]!==_0xc520('0x46')){var _0x44e4f1={};_0x44e4f1[_0x474c88[_0xc520('0x2f')]]={'$like':'%'+_0x3b467f[_0xc520('0x37')][_0xc520('0x44')]+'%'};return _0x44e4f1;}})});}_0x2ee155=_['merge']({},_0x2ee155,_0x3b467f['options']);var _0x17fdd2={'where':_0x2ee155[_0xc520('0x43')]};return db[_0xc520('0x33')]['count'](_0x17fdd2)[_0xc520('0x14')](function(_0x4608d1){_0x3b8e64[_0xc520('0x24')]=_0x4608d1;if(_0x3b467f[_0xc520('0x37')]['includeAll']){_0x2ee155[_0xc520('0x47')]=[{'all':!![]}];}return db[_0xc520('0x33')][_0xc520('0x48')](_0x2ee155);})[_0xc520('0x14')](function(_0x9d2a4f){_0x3b8e64[_0xc520('0x49')]=_0x9d2a4f;return _0x3b8e64;})['then'](respondWithFilteredResult(_0x375cc8,_0x2ee155))[_0xc520('0x1e')](handleError(_0x375cc8,null));};exports['show']=function(_0x47cd58,_0x2a7af5){var _0xe9508d={'raw':![],'where':{'id':_0x47cd58[_0xc520('0x4a')]['id']},'include':[{'model':db['Pause'],'as':_0xc520('0x4b')}]},_0x1d7bbe={};_0x1d7bbe[_0xc520('0x3c')]=_[_0xc520('0x38')](db[_0xc520('0x33')][_0xc520('0x34')]);_0x1d7bbe[_0xc520('0x37')]=_[_0xc520('0x38')](_0x47cd58[_0xc520('0x37')]);_0x1d7bbe[_0xc520('0x39')]=_[_0xc520('0x3a')](_0x1d7bbe[_0xc520('0x3c')],_0x1d7bbe[_0xc520('0x37')]);_0xe9508d[_0xc520('0x3b')]=_[_0xc520('0x3a')](_0x1d7bbe['model'],qs[_0xc520('0x3d')](_0x47cd58[_0xc520('0x37')]['fields']));_0xe9508d[_0xc520('0x3b')]=_0xe9508d[_0xc520('0x3b')][_0xc520('0x3e')]?_0xe9508d['attributes']:_0x1d7bbe[_0xc520('0x3c')];if(_0x47cd58['query'][_0xc520('0x4c')]){_0xe9508d[_0xc520('0x47')]=[{'all':!![]}];}_0xe9508d=_['merge']({},_0xe9508d,_0x47cd58[_0xc520('0x4d')]);return db['ChatWebsite'][_0xc520('0x4e')](_0xe9508d)[_0xc520('0x14')](handleEntityNotFound(_0x2a7af5,null))['then'](respondWithResult(_0x2a7af5,null))[_0xc520('0x1e')](handleError(_0x2a7af5,null));};exports[_0xc520('0x4f')]=function(_0x1e844a,_0x11f398){return db['ChatWebsite'][_0xc520('0x4f')](_0x1e844a['body'],{})[_0xc520('0x14')](function(_0x5ec85f){var _0x2a82a8=_0x1e844a['user'][_0xc520('0x29')]({'plain':!![]});if(!_0x2a82a8)throw new Error(_0xc520('0x50'));if(_0x2a82a8[_0xc520('0x51')]==='user'){var _0x2d7e9a=_0x5ec85f[_0xc520('0x29')]({'plain':!![]});var _0x2fd347='ChatWebsites';return db[_0xc520('0x52')][_0xc520('0x4e')]({'where':{'name':_0x2fd347,'userProfileId':_0x2a82a8[_0xc520('0x53')]},'raw':!![]})['then'](function(_0x5ef7a0){if(_0x5ef7a0&&_0x5ef7a0[_0xc520('0x54')]===0x0){return db[_0xc520('0x2b')]['create']({'name':_0x2d7e9a[_0xc520('0x2f')],'resourceId':_0x2d7e9a['id'],'type':_0x5ef7a0[_0xc520('0x2f')],'sectionId':_0x5ef7a0['id']},{})['then'](function(){return _0x5ec85f;});}else{return _0x5ec85f;}})['catch'](function(_0x14192a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14192a);throw _0x14192a;});}return _0x5ec85f;})[_0xc520('0x14')](respondWithResult(_0x11f398,0xc9))[_0xc520('0x1e')](handleError(_0x11f398,null));};exports[_0xc520('0x27')]=function(_0x383a35,_0x242e33){if(_0x383a35[_0xc520('0x55')]['id']){delete _0x383a35[_0xc520('0x55')]['id'];}return db[_0xc520('0x33')][_0xc520('0x4e')]({'where':{'id':_0x383a35['params']['id']},'include':[{'model':db[_0xc520('0x31')],'as':_0xc520('0x4b')}]})[_0xc520('0x14')](handleEntityNotFound(_0x242e33,null))['then'](saveUpdates(_0x383a35[_0xc520('0x55')],null))[_0xc520('0x14')](respondWithResult(_0x242e33,null))[_0xc520('0x1e')](handleError(_0x242e33,null));};exports[_0xc520('0x28')]=function(_0x14f9e2,_0x4e90f1){return db[_0xc520('0x33')][_0xc520('0x4e')]({'where':{'id':_0x14f9e2[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x4e90f1,null))['then'](removeEntity(_0x4e90f1,null))['catch'](handleError(_0x4e90f1,null));};exports['describe']=function(_0x5332ea,_0x22cc15){return db[_0xc520('0x33')][_0xc520('0x56')]()[_0xc520('0x14')](respondWithResult(_0x22cc15,null))[_0xc520('0x1e')](handleError(_0x22cc15,null));};exports['addDisposition']=function(_0x14bf5d,_0x9b209d){if(_0x14bf5d[_0xc520('0x55')]['id']){delete _0x14bf5d[_0xc520('0x55')]['id'];}return db[_0xc520('0x33')][_0xc520('0x4e')]({'where':{'id':_0x14bf5d[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x9b209d,null))[_0xc520('0x14')](function(_0x5d4682){if(_0x5d4682){_0x14bf5d[_0xc520('0x55')][_0xc520('0x57')]=_0x5d4682['id'];return db[_0xc520('0x58')][_0xc520('0x4f')](_0x14bf5d[_0xc520('0x55')]);}})[_0xc520('0x14')](respondWithResult(_0x9b209d,null))['catch'](handleError(_0x9b209d,null));};exports[_0xc520('0x59')]=function(_0x2f4433,_0x507599){var _0x4d9742={'raw':![],'where':{}};var _0x5f4051={};var _0x336a59={'count':0x0,'rows':[]};return db[_0xc520('0x33')][_0xc520('0x5a')]({'where':{'id':_0x2f4433[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x507599,null))[_0xc520('0x14')](function(_0x2b3512){if(_0x2b3512){_0x5f4051['model']=_[_0xc520('0x38')](db['Disposition'][_0xc520('0x34')]);_0x5f4051[_0xc520('0x37')]=_[_0xc520('0x38')](_0x2f4433[_0xc520('0x37')]);_0x5f4051[_0xc520('0x39')]=_[_0xc520('0x3a')](_0x5f4051[_0xc520('0x3c')],_0x5f4051[_0xc520('0x37')]);_0x4d9742[_0xc520('0x3b')]=_['intersection'](_0x5f4051['model'],qs['fields'](_0x2f4433[_0xc520('0x37')][_0xc520('0x3d')]));_0x4d9742['attributes']=_0x4d9742['attributes'][_0xc520('0x3e')]?_0x4d9742['attributes']:_0x5f4051[_0xc520('0x3c')];if(!_0x2f4433[_0xc520('0x37')][_0xc520('0x3f')]('nolimit')){_0x4d9742[_0xc520('0x23')]=qs[_0xc520('0x23')](_0x2f4433[_0xc520('0x37')][_0xc520('0x23')]);_0x4d9742[_0xc520('0x21')]=qs['offset'](_0x2f4433[_0xc520('0x37')][_0xc520('0x21')]);}_0x4d9742[_0xc520('0x41')]=qs['sort'](_0x2f4433[_0xc520('0x37')]['sort']);_0x4d9742[_0xc520('0x43')]=qs[_0xc520('0x39')](_[_0xc520('0x5b')](_0x2f4433[_0xc520('0x37')],_0x5f4051[_0xc520('0x39')]));_0x4d9742[_0xc520('0x43')][_0xc520('0x57')]=_0x2b3512['id'];if(_0x2f4433[_0xc520('0x37')][_0xc520('0x44')]){_0x4d9742[_0xc520('0x43')]=_['merge'](_0x4d9742['where'],{'$or':_[_0xc520('0x32')](_0x4d9742['attributes'],function(_0x28e5fe){var _0x465839={};_0x465839[_0x28e5fe]={'$like':'%'+_0x2f4433['query']['filter']+'%'};return _0x465839;})});}_0x4d9742=_[_0xc520('0x45')]({},_0x4d9742,_0x2f4433['options']);return db[_0xc520('0x58')][_0xc520('0x24')]({'where':_0x4d9742[_0xc520('0x43')]})['then'](function(_0x52c44b){_0x336a59['count']=_0x52c44b;if(_0x2f4433['query']['includeAll']){_0x4d9742[_0xc520('0x47')]=[{'all':!![]}];}return db['Disposition'][_0xc520('0x48')](_0x4d9742);})[_0xc520('0x14')](function(_0x19716a){_0x336a59[_0xc520('0x49')]=_0x19716a;return _0x336a59;});}})['then'](respondWithFilteredResult(_0x507599,_0x4d9742))['catch'](handleError(_0x507599,null));};exports[_0xc520('0x5c')]=function(_0x3540d4,_0x45ccd6){return db[_0xc520('0x33')][_0xc520('0x4e')]({'where':{'id':_0x3540d4[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x45ccd6,null))[_0xc520('0x14')](function(_0x307238){if(_0x307238){return _0x307238[_0xc520('0x5c')](_0x3540d4[_0xc520('0x37')][_0xc520('0x5d')]);}})[_0xc520('0x14')](respondWithStatusCode(_0x45ccd6,null))[_0xc520('0x1e')](handleError(_0x45ccd6,null));};exports[_0xc520('0x5e')]=function(_0x457521,_0x4e2604){if(_0x457521[_0xc520('0x55')]['id']){delete _0x457521[_0xc520('0x55')]['id'];}return db[_0xc520('0x33')][_0xc520('0x4e')]({'where':{'id':_0x457521[_0xc520('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4e2604,null))['then'](function(_0x558a06){if(_0x558a06){_0x457521[_0xc520('0x55')]['ChatWebsiteId']=_0x558a06['id'];return db[_0xc520('0x5f')][_0xc520('0x4f')](_0x457521['body']);}})[_0xc520('0x14')](respondWithResult(_0x4e2604,null))[_0xc520('0x1e')](handleError(_0x4e2604,null));};exports['getAnswers']=function(_0x435ccf,_0x3c136d){var _0x1d6aca={'raw':![],'where':{}};var _0x214a11={};var _0xf7d7a8={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc520('0x5a')]({'where':{'id':_0x435ccf[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x3c136d,null))[_0xc520('0x14')](function(_0x58f71b){if(_0x58f71b){_0x214a11[_0xc520('0x3c')]=_['keys'](db['CannedAnswer'][_0xc520('0x34')]);_0x214a11[_0xc520('0x37')]=_[_0xc520('0x38')](_0x435ccf[_0xc520('0x37')]);_0x214a11[_0xc520('0x39')]=_['intersection'](_0x214a11['model'],_0x214a11[_0xc520('0x37')]);_0x1d6aca[_0xc520('0x3b')]=_[_0xc520('0x3a')](_0x214a11[_0xc520('0x3c')],qs[_0xc520('0x3d')](_0x435ccf[_0xc520('0x37')][_0xc520('0x3d')]));_0x1d6aca[_0xc520('0x3b')]=_0x1d6aca[_0xc520('0x3b')][_0xc520('0x3e')]?_0x1d6aca['attributes']:_0x214a11[_0xc520('0x3c')];if(!_0x435ccf[_0xc520('0x37')][_0xc520('0x3f')](_0xc520('0x40'))){_0x1d6aca[_0xc520('0x23')]=qs['limit'](_0x435ccf['query'][_0xc520('0x23')]);_0x1d6aca['offset']=qs[_0xc520('0x21')](_0x435ccf[_0xc520('0x37')][_0xc520('0x21')]);}_0x1d6aca[_0xc520('0x41')]=qs[_0xc520('0x42')](_0x435ccf['query']['sort']);_0x1d6aca[_0xc520('0x43')]=qs[_0xc520('0x39')](_[_0xc520('0x5b')](_0x435ccf[_0xc520('0x37')],_0x214a11[_0xc520('0x39')]));_0x1d6aca[_0xc520('0x43')][_0xc520('0x57')]=_0x58f71b['id'];if(_0x435ccf[_0xc520('0x37')][_0xc520('0x44')]){_0x1d6aca[_0xc520('0x43')]=_['merge'](_0x1d6aca['where'],{'$or':_[_0xc520('0x32')](_0x1d6aca[_0xc520('0x3b')],function(_0x36e3a4){var _0x6558a3={};_0x6558a3[_0x36e3a4]={'$like':'%'+_0x435ccf['query'][_0xc520('0x44')]+'%'};return _0x6558a3;})});}_0x1d6aca=_[_0xc520('0x45')]({},_0x1d6aca,_0x435ccf['options']);return db[_0xc520('0x5f')][_0xc520('0x24')]({'where':_0x1d6aca[_0xc520('0x43')]})[_0xc520('0x14')](function(_0x1300f6){_0xf7d7a8[_0xc520('0x24')]=_0x1300f6;if(_0x435ccf[_0xc520('0x37')][_0xc520('0x4c')]){_0x1d6aca['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xc520('0x48')](_0x1d6aca);})[_0xc520('0x14')](function(_0x30406c){_0xf7d7a8[_0xc520('0x49')]=_0x30406c;return _0xf7d7a8;});}})[_0xc520('0x14')](respondWithFilteredResult(_0x3c136d,_0x1d6aca))[_0xc520('0x1e')](handleError(_0x3c136d,null));};exports['removeAnswers']=function(_0x260521,_0x4f604a){return db[_0xc520('0x33')][_0xc520('0x4e')]({'where':{'id':_0x260521[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x4f604a,null))[_0xc520('0x14')](function(_0x5949df){if(_0x5949df){return _0x5949df[_0xc520('0x60')](_0x260521['query'][_0xc520('0x5d')]);}})[_0xc520('0x14')](respondWithStatusCode(_0x4f604a,null))[_0xc520('0x1e')](handleError(_0x4f604a,null));};exports['addLogo']=function(_0x214217,_0x162bc9){_0x214217[_0xc520('0x55')][_0xc520('0x61')]=_0x214217[_0xc520('0x62')][_0xc520('0x63')];return db[_0xc520('0x33')]['find']({'where':{'id':_0x214217['params']['id']}})['then'](handleEntityNotFound(_0x162bc9,null))[_0xc520('0x14')](saveUpdates(_0x214217[_0xc520('0x55')],null))[_0xc520('0x14')](respondWithResult(_0x162bc9,null))['catch'](handleError(_0x162bc9,null));};exports[_0xc520('0x64')]=function(_0x251cd1,_0x2c4bc8){_0x251cd1[_0xc520('0x55')][_0xc520('0x65')]=_0x251cd1[_0xc520('0x62')][_0xc520('0x63')];return db['ChatWebsite'][_0xc520('0x4e')]({'where':{'id':_0x251cd1['params']['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x2c4bc8,null))[_0xc520('0x14')](saveUpdates(_0x251cd1[_0xc520('0x55')],null))[_0xc520('0x14')](respondWithResult(_0x2c4bc8,null))[_0xc520('0x1e')](handleError(_0x2c4bc8,null));};exports[_0xc520('0x66')]=function(_0x160a23,_0x23ffb0){_0x160a23['body'][_0xc520('0x67')]=_0x160a23[_0xc520('0x62')][_0xc520('0x63')];return db['ChatWebsite'][_0xc520('0x4e')]({'where':{'id':_0x160a23[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x23ffb0,null))[_0xc520('0x14')](saveUpdates(_0x160a23[_0xc520('0x55')],null))[_0xc520('0x14')](respondWithResult(_0x23ffb0,null))[_0xc520('0x1e')](handleError(_0x23ffb0,null));};exports['addSystemAvatar']=function(_0x2e0db2,_0x5ca9b5){_0x2e0db2[_0xc520('0x55')][_0xc520('0x68')]=_0x2e0db2[_0xc520('0x62')][_0xc520('0x63')];return db[_0xc520('0x33')]['find']({'where':{'id':_0x2e0db2[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x5ca9b5,null))['then'](saveUpdates(_0x2e0db2['body'],null))['then'](respondWithResult(_0x5ca9b5,null))['catch'](handleError(_0x5ca9b5,null));};exports[_0xc520('0x69')]=function(_0x2578c2,_0xb3b1b1){var _0x50456d=path[_0xc520('0x6a')](config[_0xc520('0x6b')],_0xc520('0x6c'));var _0x1d86a5={'where':{'id':_0x2578c2['params']['id']},'attributes':['id',_0xc520('0x61')],'raw':!![]};var _0x40c65c=![];return require('../../config/license/util')[_0xc520('0x6d')]()[_0xc520('0x14')](function(_0x2151d0){if(_0x2151d0){_0x40c65c=_0x2151d0[_0xc520('0x6e')];}})['then'](function(){return db['ChatWebsite']['find'](_0x1d86a5);})[_0xc520('0x14')](handleEntityNotFound(_0xb3b1b1,null))[_0xc520('0x14')](function(_0x55fd2c){if(_0x55fd2c){if(!_['isNil'](_0x55fd2c[_0xc520('0x61')])){if(fs[_0xc520('0x6f')](path[_0xc520('0x6a')](config[_0xc520('0x6b')],_0xc520('0x70'),_0x55fd2c['sitepic']))&&_0x40c65c){_0x50456d=path[_0xc520('0x6a')](config[_0xc520('0x6b')],_0xc520('0x70'),_0x55fd2c[_0xc520('0x61')]);}}return _0xb3b1b1[_0xc520('0x71')](_0x50456d);}})[_0xc520('0x1e')](handleError(_0xb3b1b1,null));};exports[_0xc520('0x72')]=function(_0x5ce508,_0x2e4fed){var _0x4b9555=path['join'](config[_0xc520('0x6b')],_0xc520('0x73'));var _0x345b5c={'where':{'id':_0x5ce508[_0xc520('0x4a')]['id']},'attributes':['id',_0xc520('0x65')],'raw':!![]};return db[_0xc520('0x33')][_0xc520('0x4e')](_0x345b5c)['then'](handleEntityNotFound(_0x2e4fed,null))[_0xc520('0x14')](function(_0x176d0a){if(_0x176d0a){if(!_['isNil'](_0x176d0a[_0xc520('0x65')])){if(fs['existsSync'](path['join'](config[_0xc520('0x6b')],'server/files/images/avatars/',_0x176d0a[_0xc520('0x65')]))){_0x4b9555=path[_0xc520('0x6a')](config[_0xc520('0x6b')],_0xc520('0x74'),_0x176d0a[_0xc520('0x65')]);}}return _0x2e4fed[_0xc520('0x71')](_0x4b9555);}})[_0xc520('0x1e')](handleError(_0x2e4fed,null));};exports[_0xc520('0x75')]=function(_0x3d4fe4,_0x12e2ee){var _0x69594c=path[_0xc520('0x6a')](config[_0xc520('0x6b')],_0xc520('0x76'));var _0x7ae5c5={'where':{'id':_0x3d4fe4[_0xc520('0x4a')]['id']},'attributes':['id',_0xc520('0x67'),_0xc520('0x77')],'raw':!![]};return db[_0xc520('0x33')]['find'](_0x7ae5c5)[_0xc520('0x14')](handleEntityNotFound(_0x12e2ee,null))['then'](function(_0x11b5e4){if(_0x11b5e4){if(!_[_0xc520('0x78')](_0x11b5e4[_0xc520('0x67')])){if(fs[_0xc520('0x6f')](path[_0xc520('0x6a')](config[_0xc520('0x6b')],_0xc520('0x74'),_0x11b5e4['customerAvatar']))&&_0x11b5e4[_0xc520('0x77')]){_0x69594c=path['join'](config[_0xc520('0x6b')],'server/files/images/avatars/',_0x11b5e4[_0xc520('0x67')]);}}return _0x12e2ee[_0xc520('0x71')](_0x69594c);}})[_0xc520('0x1e')](handleError(_0x12e2ee,null));};exports['getSystemAvatar']=function(_0xc4a18,_0x1a377b){var _0x6b66a2=path[_0xc520('0x6a')](config[_0xc520('0x6b')],_0xc520('0x79'));var _0x297d6e={'where':{'id':_0xc4a18[_0xc520('0x4a')]['id']},'attributes':['id',_0xc520('0x68')],'raw':!![]};return db['ChatWebsite'][_0xc520('0x4e')](_0x297d6e)['then'](handleEntityNotFound(_0x1a377b,null))['then'](function(_0x234ebb){if(_0x234ebb){if(!_[_0xc520('0x78')](_0x234ebb[_0xc520('0x68')])){if(fs[_0xc520('0x6f')](path['join'](config[_0xc520('0x6b')],'server/files/images/avatars/',_0x234ebb[_0xc520('0x68')]))){_0x6b66a2=path[_0xc520('0x6a')](config[_0xc520('0x6b')],_0xc520('0x74'),_0x234ebb['systemAvatar']);}}return _0x1a377b['download'](_0x6b66a2);}})['catch'](handleError(_0x1a377b,null));};exports[_0xc520('0x7a')]=function(_0x1ae37b,_0x2e9035){var _0x368381=require('user-agent-parser');var _0x1dadec=new _0x368381();var _0x33367e=_0x1dadec['setUA'](_0x1ae37b['headers'][_0xc520('0x7b')])[_0xc520('0x7c')]();var _0x349e0b={'body':_0x1ae37b[_0xc520('0x55')],'channel':'chat'};var _0x425d1e=[];var _0x388bb2=[];var _0x2d529e={};var _0x1d91ab=![];return db[_0xc520('0x7d')][_0xc520('0x56')]()[_0xc520('0x14')](function(_0x5e38d3){if(!_0x5e38d3){throw new db[(_0xc520('0x7e'))][(_0xc520('0x7f'))]('no\x20available\x20attributes');}_0x425d1e=_[_0xc520('0x80')](_[_0xc520('0x38')](_0x5e38d3),[_0xc520('0x81'),'updatedAt']);_0x388bb2=_['difference'](_[_0xc520('0x38')](_0x5e38d3),[_0xc520('0x81'),_0xc520('0x82'),_0xc520('0x83'),_0xc520('0x84')]);if(_0x1ae37b[_0xc520('0x55')]['id']){delete _0x1ae37b[_0xc520('0x55')]['id'];}if(_[_0xc520('0x78')](_0x1ae37b[_0xc520('0x55')][_0xc520('0x85')])){throw new db[(_0xc520('0x7e'))][(_0xc520('0x7f'))](_0xc520('0x86'));}if(_[_0xc520('0x78')](_0x1ae37b[_0xc520('0x55')]['body'])||_0x1ae37b[_0xc520('0x55')][_0xc520('0x55')]===''){throw new db[(_0xc520('0x7e'))][(_0xc520('0x7f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xc520('0x78')](_0x1ae37b[_0xc520('0x55')][_0xc520('0x87')])){throw new db[(_0xc520('0x7e'))][(_0xc520('0x7f'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x388bb2);}if(!_[_0xc520('0x88')](_0x388bb2,_0x1ae37b[_0xc520('0x55')][_0xc520('0x87')])){throw new db['Sequelize']['ValidationError'](_0xc520('0x89')+_0x388bb2);}_0x2d529e[_0x1ae37b[_0xc520('0x55')][_0xc520('0x87')]]=_0x1ae37b['body'][_0xc520('0x85')];})['then'](function(){return db[_0xc520('0x33')][_0xc520('0x4e')]({'where':{'id':_0x1ae37b[_0xc520('0x4a')]['id']},'include':[{'model':db[_0xc520('0x8a')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x2d529e,'limit':0x1,'order':[[_0xc520('0x82'),_0xc520('0x8b')]]}]},{'model':db[_0xc520('0x8c')],'as':_0xc520('0x8d')}]});})[_0xc520('0x14')](handleEntityNotFound(_0x2e9035,null))['then'](function(_0x3fe751){if(_0x3fe751&&_0x3fe751[_0xc520('0x8e')]){_0x349e0b[_0xc520('0x8f')]=_0x3fe751;_0x349e0b[_0xc520('0x90')]=_0x3fe751[_0xc520('0x8d')];_0x349e0b[_0xc520('0x91')]=_0x3fe751['List'];_0x349e0b['applications']=_[_0xc520('0x92')](_0x349e0b[_0xc520('0x90')],[_0xc520('0x93')],[_0xc520('0x94')]);if(_0x349e0b[_0xc520('0x8f')][_0xc520('0x8d')]){delete _0x349e0b['account'][_0xc520('0x8d')];}if(_0x349e0b[_0xc520('0x8f')][_0xc520('0x8e')]&&_0x349e0b[_0xc520('0x8f')][_0xc520('0x8e')][_0xc520('0x95')][_0xc520('0x3e')]){return _0x349e0b[_0xc520('0x8f')][_0xc520('0x8e')][_0xc520('0x95')][0x0];}var _0x4d5c7a=_[_0xc520('0xb')](_0x1ae37b[_0xc520('0x55')],{'firstName':_0x1ae37b['body'][_0xc520('0x85')],'ListId':_0x3fe751['ListId']});_0x4d5c7a[_0x1ae37b['body'][_0xc520('0x87')]]=_0x1ae37b['body'][_0xc520('0x85')];return db[_0xc520('0x7d')]['create'](_0x4d5c7a,{'fields':_0x425d1e,'raw':!![]});}})[_0xc520('0x14')](handleEntityNotFound(_0x2e9035,null))[_0xc520('0x14')](function(_0x44d700){_0x349e0b[_0xc520('0x96')]=_0x44d700;var _0x39a637=_0x1ae37b['body']['customerIp'];if(_0x1ae37b[_0xc520('0x97')][_0xc520('0x98')]){_0x39a637=_0x1ae37b['headers']['cf-connecting-ip'];}else if(_0x1ae37b[_0xc520('0x97')][_0xc520('0x99')]){_0x39a637=_[_0xc520('0x9a')](_0x1ae37b[_0xc520('0x97')][_0xc520('0x99')][_0xc520('0x9b')](','));}if(_0x44d700){var _0x2217f1={'ContactId':_0x44d700['id'],'ChatWebsiteId':_0x1ae37b[_0xc520('0x4a')]['id'],'from':(_0x44d700[_0xc520('0x9c')]||'')+'\x20'+(_0x44d700[_0xc520('0x9d')]||''),'customerIp':_0x39a637,'customerPort':_0x1ae37b[_0xc520('0x97')][_0xc520('0x9e')]?_0x1ae37b[_0xc520('0x97')][_0xc520('0x9e')]:null,'referer':_0x1ae37b[_0xc520('0x55')]['referer'],'browserName':_0x33367e[_0xc520('0x9f')][_0xc520('0x2f')]&&_0x33367e[_0xc520('0x9f')]['version']?util[_0xc520('0xa0')](_0xc520('0xa1'),_0x33367e[_0xc520('0x9f')][_0xc520('0x2f')],_0x33367e['browser'][_0xc520('0xa2')]):_0xc520('0xa3'),'browserVersion':_0x33367e[_0xc520('0x9f')][_0xc520('0xa2')]||_0xc520('0xa3'),'osName':util['format'](_0xc520('0xa1'),_0x33367e['os'][_0xc520('0x2f')],_0x33367e['os'][_0xc520('0xa2')]),'osVersion':_0x33367e['os'][_0xc520('0xa2')],'deviceModel':_0x33367e['device'][_0xc520('0x3c')]&&_0x33367e[_0xc520('0xa4')]['vendor']?util[_0xc520('0xa0')](_0xc520('0xa5'),_0x33367e[_0xc520('0xa4')][_0xc520('0x3c')],_0x33367e[_0xc520('0xa4')][_0xc520('0xa6')],_0x33367e[_0xc520('0xa4')][_0xc520('0x36')]):null,'deviceVendor':_0x33367e[_0xc520('0xa4')]['vendor'],'deviceType':_0x33367e['device'][_0xc520('0x36')],'formData':JSON[_0xc520('0x19')](_0x1ae37b[_0xc520('0x55')])};var _0x53e2c0={'ChatWebsiteId':_0x1ae37b[_0xc520('0x4a')]['id'],'closed':![]};if(_0x1ae37b[_0xc520('0x55')][_0xc520('0xa7')]){_0x53e2c0[_0xc520('0xa7')]=_0x1ae37b[_0xc520('0x55')][_0xc520('0xa7')];return db[_0xc520('0xa8')][_0xc520('0x4e')]({'where':_0x53e2c0})[_0xc520('0x14')](function(_0x120cc0){if(_0x120cc0){return[_0x120cc0,![]];}_0x2217f1[_0xc520('0xa7')]=_0x1ae37b[_0xc520('0x55')][_0xc520('0xa7')];_0x2217f1['externalUrl']=_0x1ae37b[_0xc520('0x55')]['externalUrl'];return db['ChatInteraction'][_0xc520('0x4f')](_0x2217f1)[_0xc520('0x14')](function(_0x5449a1){return[_0x5449a1,!![]];});});}_0x53e2c0[_0xc520('0xa9')]=_0x44d700['id'];if(_0x1ae37b[_0xc520('0x55')]['interaction']&&_0x1ae37b[_0xc520('0x55')]['interaction']['id']){_0x53e2c0['id']=_0x1ae37b[_0xc520('0x55')][_0xc520('0xaa')]['id'];return db['ChatInteraction'][_0xc520('0x4e')]({'where':_0x53e2c0})[_0xc520('0x14')](function(_0x17c5e6){if(_0x17c5e6){return[_0x17c5e6,![]];}return db[_0xc520('0xa8')][_0xc520('0x4f')](_0x2217f1)[_0xc520('0x14')](function(_0x19684a){return[_0x19684a,!![]];});});}return db[_0xc520('0xa8')][_0xc520('0x4f')](_0x2217f1)[_0xc520('0x14')](function(_0x55dc92){return[_0x55dc92,!![]];});}})[_0xc520('0xab')](function(_0x27cda3,_0x25b04d){if(_0x27cda3){_0x1d91ab=_0x25b04d;if(!_0x25b04d){var _0x4c23ef={'from':(_0x349e0b['contact'][_0xc520('0x9c')]||'')+'\x20'+(_0x349e0b[_0xc520('0x96')][_0xc520('0x9d')]||'')};if(_0x1ae37b['body'][_0xc520('0xa7')]&&_0x1ae37b[_0xc520('0x55')]['messageId']&&_0x1ae37b[_0xc520('0x55')][_0xc520('0xa7')]!=_0x1ae37b[_0xc520('0x55')]['messageId']){_0x4c23ef[_0xc520('0xa7')]=_0x1ae37b[_0xc520('0x55')][_0xc520('0xac')];}return _0x27cda3[_0xc520('0x27')](_0x4c23ef);}else{return _0x27cda3;}}})[_0xc520('0x14')](function(_0x56328f){_0x349e0b[_0xc520('0xaa')]=_0x56328f[_0xc520('0x29')]({'plain':!![]});_0x349e0b[_0xc520('0xaa')]['created']=_0x1d91ab;if(_0x349e0b['interaction'][_0xc520('0xad')]){if(_0x349e0b[_0xc520('0x8f')][_0xc520('0xae')]){_0x349e0b['applications'][_0xc520('0xaf')]({'id':0x0,'priority':_0x349e0b[_0xc520('0x90')][_0xc520('0x3e')]+0x1,'app':'close','appdata':_0xc520('0xb0'),'interval':_0xc520('0xb1')});}}return db[_0xc520('0xb2')][_0xc520('0x4f')]({'body':_0x1ae37b['body'][_0xc520('0x55')],'ChatWebsiteId':_0x1ae37b['params']['id'],'ChatInteractionId':_0x56328f['id'],'direction':'in','ContactId':_0x349e0b[_0xc520('0x96')]['id'],'AttachmentId':_0x1ae37b['body'][_0xc520('0xb3')]});})['then'](function(_0x1c6f7d){_0x349e0b[_0xc520('0x1c')]=_0x1c6f7d;if(_0x349e0b[_0xc520('0xaa')][_0xc520('0xb4')]){return db['User'][_0xc520('0x4e')]({'attributes':['id',_0xc520('0x2f')],'where':{'id':_0x349e0b['interaction'][_0xc520('0xb4')]}})['then'](function(_0x3a45c6){if(_0x3a45c6){_0x349e0b[_0xc520('0x90')][_0xc520('0xb5')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3a45c6['name']+','+(_0x349e0b['account'][_0xc520('0xb6')]||0xa),'interval':_0xc520('0xb1')});_0x349e0b[_0xc520('0xb7')]=!![];}return respondWithRpcPromise(_0xc520('0xb8'),_0xc520('0xb9'),_0x349e0b);});}return respondWithRpcPromise(_0xc520('0xb8'),_0xc520('0xb9'),_0x349e0b);})[_0xc520('0x14')](function(_0x54a842){respondWithRpcPromise(_0xc520('0xba'),_0xc520('0xba'),{'event':_0xc520('0x7a'),'message':_0x54a842},client9002);return _0x54a842;})[_0xc520('0x14')](respondWithResult(_0x2e9035,null))[_0xc520('0x1e')](handleError(_0x2e9035,null));};exports[_0xc520('0xbb')]=function(_0x182b97,_0x55c2f5){var _0x5058ce,_0x4e7192,_0x26e789;var _0x803626=[];var _0x293990={};var _0x596da4=_0x182b97['files']||[];var _0x2b39cf=[];var _0x5e887a;return db[_0xc520('0x7d')][_0xc520('0x56')]()[_0xc520('0x14')](function(_0x512c35){if(!_0x512c35){throw new db['Sequelize'][(_0xc520('0x7f'))](_0xc520('0xbc'));}_0x803626=_['difference'](_[_0xc520('0x38')](_0x512c35),['createdAt','updatedAt',_0xc520('0x83'),_0xc520('0x84')]);if(_0x182b97[_0xc520('0x55')]['id']){delete _0x182b97['body']['id'];}if(_[_0xc520('0x78')](_0x182b97[_0xc520('0x55')][_0xc520('0x85')])){throw _0x55c2f5[_0xc520('0x1f')](0x1f4)[_0xc520('0xbd')](new db['Sequelize'][(_0xc520('0x7f'))]('from\x20is\x20mandatory'));}if(_[_0xc520('0x78')](_0x182b97[_0xc520('0x55')][_0xc520('0x55')])||_0x182b97[_0xc520('0x55')][_0xc520('0x55')]===''){throw _0x55c2f5[_0xc520('0x1f')](0x1f4)['send'](new db[(_0xc520('0x7e'))][(_0xc520('0x7f'))](_0xc520('0xbe')));}if(_[_0xc520('0x78')](_0x182b97[_0xc520('0x55')][_0xc520('0xbf')])){throw _0x55c2f5[_0xc520('0x1f')](0x1f4)[_0xc520('0xbd')](new db[(_0xc520('0x7e'))]['ValidationError'](_0xc520('0xc0')+_0x803626));}if(!_[_0xc520('0x88')](_0x803626,_0x182b97['body']['mapKeyOffline'])){throw _0x55c2f5[_0xc520('0x1f')](0x1f4)[_0xc520('0xbd')](new db[(_0xc520('0x7e'))]['ValidationError'](_0xc520('0xc1')+_0x803626));}_0x293990[_0x182b97[_0xc520('0x55')][_0xc520('0xbf')]]=_0x182b97[_0xc520('0x55')]['from'];})[_0xc520('0x14')](function(){return db[_0xc520('0x33')]['find']({'where':{'id':_0x182b97[_0xc520('0x4a')]['id']},'include':[{'model':db[_0xc520('0x8a')],'as':_0xc520('0x8e')},{'model':db[_0xc520('0xc2')],'as':_0xc520('0xc2')}]});})[_0xc520('0x14')](handleEntityNotFound(_0x55c2f5,null))[_0xc520('0x14')](function(_0xa648d3){if(_0xa648d3&&_0xa648d3[_0xc520('0x8e')]){_0x4e7192=_0xa648d3;var _0x4003b6=_[_0xc520('0xb')](_0x182b97[_0xc520('0x55')],{'firstName':_0x182b97['body'][_0xc520('0x85')],'phone':_0x182b97[_0xc520('0x55')]['from'],'ListId':_0xa648d3[_0xc520('0x84')]});_0x4003b6[_0x182b97[_0xc520('0x55')][_0xc520('0xbf')]]=_0x182b97[_0xc520('0x55')][_0xc520('0x85')];return db[_0xc520('0x7d')][_0xc520('0xc3')]({'where':_0x293990,'defaults':_0x4003b6});}})['spread'](function(_0x272577){if(_0x272577){_0x26e789=_0x272577;var _0x2fdf84=fs['readFileSync'](path[_0xc520('0x6a')](config[_0xc520('0x6b')],_0xc520('0xc4')),_0xc520('0xc5'));var _0x1c36d1=ejs[_0xc520('0xc6')](_0x2fdf84,{'body':_[_0xc520('0xc7')](_0x182b97[_0xc520('0x55')][_0xc520('0x55')]),'bodyTitle':_0x4e7192[_0xc520('0xc8')]});return db['ChatOfflineMessage'][_0xc520('0x4f')]({'body':_0x1c36d1,'plainBody':htmlToText[_0xc520('0xc9')](_0x1c36d1),'ContactId':_0x272577['id'],'ChatWebsiteId':_0x4e7192['id']});}})[_0xc520('0x14')](function(_0x37d030){_0x5e887a=_0x37d030;if(_0x596da4[_0xc520('0x3e')]){var _0x11849b=_0x596da4['map'](function(_0x1b4d00){return{'name':_0x1b4d00[_0xc520('0xca')],'basename':_0x1b4d00[_0xc520('0x63')],'type':_0x1b4d00[_0xc520('0xcb')],'ChatOfflineMessageId':_0x37d030['id']};});_0x2b39cf=_0x11849b[_0xc520('0x32')](_0x18beb3=>{var _0x37427f={'filename':_0x18beb3[_0xc520('0x2f')],'path':path[_0xc520('0x6a')](config['root'],'server',_0xc520('0xcc'),_0xc520('0xcd'),_0xc520('0xce'),_0x18beb3['basename'])};return _0x37427f;});if(!_0x4e7192[_0xc520('0xcf')]){return db[_0xc520('0xd0')][_0xc520('0xd1')](function(_0x1a6b03){return db[_0xc520('0xd2')][_0xc520('0xd3')](_0x11849b,{'transaction':_0x1a6b03});});}}})[_0xc520('0x14')](function(){if(_0x5e887a){_0x5058ce=_0x5e887a;return db[_0xc520('0xc2')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xc520('0xd4')],'as':_0xc520('0xd5'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xc520('0xd6'),'raw':!![]}]}]});}})[_0xc520('0x14')](function(_0x1e3508){if(_0x1e3508&&_0x1e3508[_0xc520('0xd5')]&&_0x4e7192['forwardOffline']&&_0x4e7192[_0xc520('0xd7')]){var _0x6ef7a0=_0x1e3508[_0xc520('0xd8')]();return respondWithRpcPromise(_0xc520('0xd9'),'sendMail',{'account':_0x6ef7a0,'message':{'from':util['format'](_0xc520('0xda'),_0x1e3508[_0xc520('0x2f')],_0x1e3508['email']||_0x1e3508['Smtp'][_0xc520('0xdb')]),'to':_0x4e7192['forwardOfflineAddress'],'subject':_0x4e7192[_0xc520('0xdc')],'html':_0x5058ce[_0xc520('0x55')],'attachments':_0x2b39cf}},client9003)[_0xc520('0x14')](function(){return _0x5058ce;})[_0xc520('0x1e')](function(_0x44017e){logger[_0xc520('0x1a')](_0x44017e);});}})[_0xc520('0x14')](function(){if(_0x4e7192&&_0x4e7192[_0xc520('0xcf')]&&_0x4e7192[_0xc520('0xdd')]){var _0x3cb514=[];if(_0x596da4['length']){_0x3cb514=_0x596da4['map'](function(_0x246258){return{'name':_0x246258[_0xc520('0xca')],'basename':_0x246258['filename'],'type':_0x246258[_0xc520('0xcb')],'ChatOfflineMessageId':_0x5e887a['id']};});}var _0x22fde1;if(!_['isNil'](_0x4e7192['subjectOffline'])){var _0x501fcd=_[_0xc520('0x32')](_0x182b97[_0xc520('0x55')],function(_0x513e41){return _0x513e41;});var _0x4cb8d1=_[_0xc520('0xde')](_0x501fcd)[0x0];var _0x363883=_[_0xc520('0xdf')](_0x4cb8d1,function(_0x5a22dd){return _0x5a22dd;});_0x22fde1=_0x363883[0x1][_0x4e7192[_0xc520('0xe0')]];}var _0x1008bc={'from':_0x26e789[_0xc520('0xe1')],'firstName':_0x26e789['firstName'],'lastName':_0x26e789[_0xc520('0x9d')],'mapKey':_0xc520('0xe1'),'message':{'from':_0x26e789[_0xc520('0xe1')],'to':_0x4e7192[_0xc520('0xc2')][_0xc520('0xe1')],'cc':'','subject':_[_0xc520('0x78')](_0x22fde1)?_0x4e7192['offlineMessageSubject']:_0x22fde1,'messageId':'','sentAt':new Date(),'attach':_0x3cb514[_0xc520('0x3e')],'attachments':_0x3cb514,'originChannel':'Chat','ChatWebsiteId':_0x4e7192['id'],'ChatOfflineMessageId':_0x5058ce['id'],'originTo':_0x4e7192['MailAccount'][_0xc520('0xe1')]},'body':_0x5058ce['body']};var _0x5b8696={'account':{'id':_0x4e7192[_0xc520('0xdd')]},'body':_0x1008bc,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xc520('0xe2'),'notifyMail',_0x5b8696,client9001)[_0xc520('0x14')](function(){return _0x5058ce;})[_0xc520('0x1e')](function(_0x31b968){logger['error'](_0x31b968);});}return;})[_0xc520('0x14')](function(){if(_0x5058ce){return _0x5058ce;}})[_0xc520('0x14')](respondWithResult(_0x55c2f5,null))[_0xc520('0x1e')](function(_0x4b8d0a){logger[_0xc520('0x1a')](_0xc520('0x1e'),_0x4b8d0a);for(var _0x2b1473 of _0x596da4){var _0x29ae12=path[_0xc520('0x6a')](config[_0xc520('0x6b')],_0xc520('0xe3'),_0xc520('0xcc'),_0xc520('0xcd'),_0xc520('0xce'),_0x2b1473[_0xc520('0x63')]);fs_extra[_0xc520('0xe4')](_0x29ae12)[_0xc520('0x1e')](function(_0xa1109f){logger[_0xc520('0x1a')](_0xc520('0xe5'),_0x29ae12,_0xa1109f);});}});};exports[_0xc520('0xe6')]=function(_0x3b4128,_0x115fef){return db[_0xc520('0xa8')][_0xc520('0x4e')]({'where':{'id':_0x3b4128[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x115fef,null))[_0xc520('0x14')](function(_0x29b021){if(_0x29b021){return _0x29b021[_0xc520('0xe6')](_0x3b4128['body'][_0xc520('0x5d')],_[_0xc520('0xe7')](_0x3b4128[_0xc520('0x55')],[_0xc520('0x5d'),'id'])||{});}})[_0xc520('0x14')](respondWithResult(_0x115fef,null))['catch'](handleError(_0x115fef,null));};exports['getInteractions']=function(_0x114bdf,_0x57c4fc){var _0x101a0e={'raw':![],'where':{}};var _0x17fe2c={};var _0x26a503={'count':0x0,'rows':[]};return db[_0xc520('0x33')][_0xc520('0x5a')]({'where':{'id':_0x114bdf[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x57c4fc,null))[_0xc520('0x14')](function(_0x23e34a){if(_0x23e34a){_0x17fe2c[_0xc520('0x3c')]=_[_0xc520('0x38')](db[_0xc520('0xa8')]['rawAttributes']);_0x17fe2c[_0xc520('0x37')]=_[_0xc520('0x38')](_0x114bdf[_0xc520('0x37')]);_0x17fe2c[_0xc520('0x39')]=_['intersection'](_0x17fe2c[_0xc520('0x3c')],_0x17fe2c[_0xc520('0x37')]);_0x101a0e[_0xc520('0x3b')]=_['intersection'](_0x17fe2c[_0xc520('0x3c')],qs['fields'](_0x114bdf[_0xc520('0x37')][_0xc520('0x3d')]));_0x101a0e[_0xc520('0x3b')]=_0x101a0e[_0xc520('0x3b')][_0xc520('0x3e')]?_0x101a0e['attributes']:_0x17fe2c[_0xc520('0x3c')];if(!_0x114bdf[_0xc520('0x37')]['hasOwnProperty'](_0xc520('0x40'))){_0x101a0e[_0xc520('0x23')]=qs[_0xc520('0x23')](_0x114bdf[_0xc520('0x37')]['limit']);_0x101a0e[_0xc520('0x21')]=qs[_0xc520('0x21')](_0x114bdf[_0xc520('0x37')][_0xc520('0x21')]);}_0x101a0e['order']=qs[_0xc520('0x42')](_0x114bdf[_0xc520('0x37')][_0xc520('0x42')]);_0x101a0e[_0xc520('0x43')]=qs[_0xc520('0x39')](_[_0xc520('0x5b')](_0x114bdf[_0xc520('0x37')],_0x17fe2c[_0xc520('0x39')]));_0x101a0e[_0xc520('0x43')][_0xc520('0x57')]=_0x23e34a['id'];if(_0x114bdf[_0xc520('0x37')]['filter']){_0x101a0e[_0xc520('0x43')]=_[_0xc520('0x45')](_0x101a0e[_0xc520('0x43')],{'$or':_[_0xc520('0x32')](_0x101a0e[_0xc520('0x3b')],function(_0x5bf252){var _0x3d4f71={};_0x3d4f71[_0x5bf252]={'$like':'%'+_0x114bdf[_0xc520('0x37')][_0xc520('0x44')]+'%'};return _0x3d4f71;})});}_0x101a0e=_[_0xc520('0x45')]({},_0x101a0e,_0x114bdf[_0xc520('0x4d')]);return db[_0xc520('0xa8')][_0xc520('0x24')]({'where':_0x101a0e[_0xc520('0x43')]})['then'](function(_0x3514f3){_0x26a503['count']=_0x3514f3;if(_0x114bdf[_0xc520('0x37')]['includeAll']){_0x101a0e[_0xc520('0x47')]=[{'model':db[_0xc520('0x7d')],'as':_0xc520('0xe8'),'required':![]},{'model':db[_0xc520('0xe9')],'as':'Owner','attributes':[_0xc520('0x2f'),_0xc520('0xea'),_0xc520('0xeb')],'required':![]},{'model':db[_0xc520('0xec')],'as':_0xc520('0xed'),'attributes':['id',_0xc520('0x2f'),_0xc520('0xee')],'where':_0x114bdf[_0xc520('0x37')][_0xc520('0xef')]?{'id':_0x114bdf[_0xc520('0x37')][_0xc520('0xef')]}:undefined,'required':_0x114bdf['query'][_0xc520('0xef')]?!![]:![]}];}return db['ChatInteraction'][_0xc520('0x48')](_0x101a0e);})[_0xc520('0x14')](function(_0x13a5e7){_0x26a503[_0xc520('0x49')]=_0x13a5e7;return _0x26a503;});}})[_0xc520('0x14')](respondWithFilteredResult(_0x57c4fc,_0x101a0e))[_0xc520('0x1e')](handleError(_0x57c4fc,null));};function iftimePromise(_0x26b596,_0x4a39d7){return respondWithRpcPromise(_0xc520('0xf0'),_0xc520('0xf1'),{'command':_0x4a39d7[_0xc520('0xf2')]?util[_0xc520('0xa0')](_0xc520('0xf3'),_0x26b596[_0xc520('0xf4')],_0x4a39d7['timezone']):util[_0xc520('0xa0')](_0xc520('0xf5'),_0x26b596[_0xc520('0xf4')])},client9002)[_0xc520('0x14')](function(_0x1abaa8){var _0x3a2682=_0x1abaa8&&_0x1abaa8['indexOf'](_0xc520('0xf6'))>=0x0?!![]:![];logger[_0xc520('0x15')](_0xc520('0xf7'),_0x4a39d7['id'],_0x26b596['id'],_0x26b596['interval'],_0x3a2682?'ONLINE':_0xc520('0xf8'),_0x4a39d7[_0xc520('0xf2')]?_0x4a39d7[_0xc520('0xf2')]:_0xc520('0xf9'));return _0x3a2682;})[_0xc520('0x1e')](function(_0x2eb31a){logger[_0xc520('0x1a')](_0xc520('0xf7'),_0x4a39d7['id'],_0x26b596['id'],_0x26b596['interval'],util[_0xc520('0xfa')](_0x2eb31a,{'showHidden':![],'depth':null}),_0x4a39d7[_0xc520('0xf2')]?_0x4a39d7[_0xc520('0xf2')]:_0xc520('0xf9'));return![];});}exports[_0xc520('0xf1')]=function(_0x1c6fb7,_0x3fc888){var _0x196cf4=0x0;var _0x4ef810=0x0;var _0x540280=![];var _0x4822eb;var _0x512761;return db[_0xc520('0x33')][_0xc520('0x4e')]({'where':{'id':_0x1c6fb7[_0xc520('0x4a')]['id']},'include':[{'model':db[_0xc520('0xfb')],'as':_0xc520('0xfb'),'include':[{'model':db['Interval'],'as':_0xc520('0xfc'),'attributes':['id',_0xc520('0xf4')],'raw':!![]}]}]})[_0xc520('0x14')](handleEntityNotFound(_0x3fc888,null))[_0xc520('0x14')](function(_0x69527b){if(_0x69527b){_0x4822eb=_0x69527b;return _0x69527b[_0xc520('0xfd')]({'raw':!![]});}})['then'](function(_0x5c53e0){if(_0x4822eb){if(_0x5c53e0){_0x512761=_0x5c53e0;}}return require('../../config/license/util')['getLicense']();})['then'](function(_0x3aa87f){if(_0x3aa87f){_0x4ef810=_0x3aa87f[_0xc520('0xfe')];_0x540280=_0x3aa87f[_0xc520('0x6e')];}})[_0xc520('0x14')](function(){return db[_0xc520('0xa8')]['count']({'where':{'closed':![]}});})[_0xc520('0x14')](function(_0x6b3dd8){_0x196cf4=_0x6b3dd8;if(_0x4ef810&&_0x6b3dd8>_0x4ef810){return db['License'][_0xc520('0x5a')]({'where':{'id':0x1}})['then'](function(_0x5a40f6){if(_0x5a40f6){_0x5a40f6[_0xc520('0xff')](_0xc520('0x100'));}});}})[_0xc520('0x14')](function(){if(_0x4822eb[_0xc520('0xfb')]&&_0x4822eb[_0xc520('0xfb')]['Intervals']){var _0x5f3b47=[];for(var _0x39a43=0x0;_0x39a43<_0x4822eb[_0xc520('0xfb')][_0xc520('0xfc')]['length'];_0x39a43++){var _0x3ec9c9=_0x4822eb[_0xc520('0xfb')][_0xc520('0xfc')][_0x39a43][_0xc520('0x29')]({'plain':!![]});_0x5f3b47['push'](iftimePromise(_0x3ec9c9,_0x4822eb));}return BPromise[_0xc520('0x101')](_0x5f3b47)[_0xc520('0x14')](function(_0x439db6){return _[_0xc520('0x102')](_0x439db6);});}else{return!![];}})[_0xc520('0x14')](function(_0x7cceef){var _0x23b391=fs['readFileSync'](path[_0xc520('0x6a')](config[_0xc520('0x6b')],_0xc520('0x103')),_0xc520('0xc5'));var _0x1237ce={'remote':_0x4822eb[_0xc520('0x104')],'query':querystring['stringify'](_[_0xc520('0x45')](_0x4822eb[_0xc520('0x29')]({'plain':!![]}),{'customerIp':_0x1c6fb7[_0xc520('0x97')][_0xc520('0x99')]||_0x1c6fb7[_0xc520('0x97')][_0xc520('0x105')]||_0x1c6fb7[_0xc520('0x106')]['remoteAddress']||_0x1c6fb7['ip'],'referer':_0x1c6fb7[_0xc520('0x97')][_0xc520('0x107')],'openedInteractions':_0x196cf4,'maxInteractions':_0x4ef810,'virtual':_0x540280[_0xc520('0xfe')],'online':_0x7cceef,'custom':_0x540280}))[_0xc520('0x108')](/'/g,'\x5c\x27')};_0x3fc888[_0xc520('0xbd')](ejs[_0xc520('0xc6')](Mustache[_0xc520('0xc6')](_0x23b391,_0x1237ce),{'proactiveActions':_0x512761,'alignment':_0x4822eb['alignment'],'verticalAlignment':_0x4822eb[_0xc520('0x109')],'div_color':_0x4822eb[_0xc520('0xee')],'labelText':_0x4822eb['labelText'],'text_color':_0x4822eb[_0xc520('0x10a')],'text_button_color':_0x4822eb[_0xc520('0x10b')],'button_color':_0x4822eb[_0xc520('0x10c')],'background_color':_0x4822eb[_0xc520('0x10d')],'hideWhenOffline':_0x4822eb['hideWhenOffline'],'interval':_0x4822eb['IntervalId']}));})[_0xc520('0x1e')](handleError(_0x3fc888,null));};exports[_0xc520('0x10e')]=function(_0x2901d1,_0x1ba733){var _0x493d7f=_0x2901d1['params']['id'];var _0x4050a9=_0x2901d1['body'];var _0x1dba38=0xc8;var _0x10ca3a=null;return db[_0xc520('0xd0')][_0xc520('0xd1')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS'][_0xc520('0x10f')]},function(_0x289b12){return db[_0xc520('0x33')][_0xc520('0x5a')]({'where':{'id':_0x493d7f},'transaction':_0x289b12})[_0xc520('0x14')](function(_0x4f6312){if(_0x4f6312){return db['ChatApplication'][_0xc520('0x28')]({'where':{'ChatWebsiteId':_0x493d7f},'transaction':_0x289b12})[_0xc520('0x14')](function(){var _0x48157c=_[_0xc520('0x32')](_0x4050a9,function(_0x37ac2b){_0x37ac2b['ChatWebsiteId']=_0x493d7f;return _0x37ac2b;});return db[_0xc520('0x8c')][_0xc520('0xd3')](_0x48157c,{'transaction':_0x289b12});});}else{_0x1dba38=0x194;_0x10ca3a=[];}});})['then'](function(){if(_0x1dba38!==0x194){return db[_0xc520('0x8c')][_0xc520('0x110')]({'where':{'ChatWebsiteId':_0x493d7f},'order':'priority'})[_0xc520('0x14')](function(_0xedf5b4){_0x10ca3a=_0xedf5b4;});}})[_0xc520('0x1e')](function(_0x3cc9d1){_0x1dba38=0x1f4;logger[_0xc520('0x1a')](_0x3cc9d1[_0xc520('0x2e')]);if(_0x3cc9d1['name']){delete _0x3cc9d1['name'];}_0x10ca3a=_0x3cc9d1;})[_0xc520('0x111')](function(){if(_0x10ca3a===null){_0x1ba733['sendStatus'](_0x1dba38);}else{if(_0x1dba38===0x1f4){_0x1ba733['status'](_0x1dba38)[_0xc520('0xbd')](_0x10ca3a);}else{_0x1ba733[_0xc520('0x1f')](_0x1dba38)[_0xc520('0x20')](_0x10ca3a);}}});};exports[_0xc520('0x112')]=function(_0x7a77ba,_0x4c485b){var _0x392364={};var _0x26b3b4={};var _0x299ff5;var _0x307cfc;return db[_0xc520('0x33')][_0xc520('0x5a')]({'where':{'id':_0x7a77ba['params']['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x4c485b,null))[_0xc520('0x14')](function(_0x2dd848){if(_0x2dd848){_0x299ff5=_0x2dd848;_0x26b3b4[_0xc520('0x3c')]=_[_0xc520('0x38')](db[_0xc520('0x8c')][_0xc520('0x34')]);_0x26b3b4[_0xc520('0x37')]=_[_0xc520('0x38')](_0x7a77ba[_0xc520('0x37')]);_0x26b3b4['filters']=_[_0xc520('0x3a')](_0x26b3b4[_0xc520('0x3c')],_0x26b3b4['query']);_0x392364[_0xc520('0x3b')]=_[_0xc520('0x3a')](_0x26b3b4[_0xc520('0x3c')],qs['fields'](_0x7a77ba[_0xc520('0x37')][_0xc520('0x3d')]));_0x392364['attributes']=_0x392364['attributes'][_0xc520('0x3e')]?_0x392364['attributes']:_0x26b3b4[_0xc520('0x3c')];_0x392364[_0xc520('0x41')]=qs[_0xc520('0x42')](_0x7a77ba['query'][_0xc520('0x42')]);_0x392364[_0xc520('0x43')]=qs['filters'](_[_0xc520('0x5b')](_0x7a77ba['query'],_0x26b3b4['filters']));if(_0x7a77ba[_0xc520('0x37')][_0xc520('0x44')]){_0x392364[_0xc520('0x43')]=_[_0xc520('0x45')](_0x392364[_0xc520('0x43')],{'$or':_[_0xc520('0x32')](_0x392364['attributes'],function(_0x158119){var _0x5b2964={};_0x5b2964[_0x158119]={'$like':'%'+_0x7a77ba[_0xc520('0x37')][_0xc520('0x44')]+'%'};return _0x5b2964;})});}_0x392364=_[_0xc520('0x45')]({},_0x392364,_0x7a77ba[_0xc520('0x4d')]);return _0x299ff5[_0xc520('0x112')](_0x392364);}})[_0xc520('0x14')](function(_0x3ebebf){if(_0x3ebebf){_0x307cfc=_0x3ebebf['length'];if(!_0x7a77ba[_0xc520('0x37')]['hasOwnProperty'](_0xc520('0x40'))){_0x392364[_0xc520('0x23')]=qs[_0xc520('0x23')](_0x7a77ba[_0xc520('0x37')][_0xc520('0x23')]);_0x392364[_0xc520('0x21')]=qs['offset'](_0x7a77ba['query'][_0xc520('0x21')]);}return _0x299ff5['getApplications'](_0x392364);}})['then'](function(_0x18ce1a){if(_0x18ce1a){return _0x18ce1a?{'count':_0x307cfc,'rows':_0x18ce1a}:null;}})[_0xc520('0x14')](respondWithResult(_0x4c485b,null))[_0xc520('0x1e')](handleError(_0x4c485b,null));};exports[_0xc520('0x113')]=function(_0x4411a8,_0x14da9e){return db['chatProactiveAction'][_0xc520('0x4e')]({'where':{'id':_0x4411a8[_0xc520('0x4a')]['id']}})['then'](handleEntityNotFound(_0x14da9e,null))[_0xc520('0x14')](function(_0xc485c6){if(_0xc485c6){return _0xc485c6[_0xc520('0x113')](_0x4411a8[_0xc520('0x55')]['ids'],_['omit'](_0x4411a8[_0xc520('0x55')],[_0xc520('0x5d'),'id'])||{});}})[_0xc520('0x14')](respondWithResult(_0x14da9e,null))[_0xc520('0x1e')](handleError(_0x14da9e,null));};exports['getProactiveActions']=function(_0x98de69,_0x49c713){var _0x3c64a2={};var _0x4a065d={};var _0x1d9635;var _0x395155;return db[_0xc520('0x33')][_0xc520('0x5a')]({'where':{'id':_0x98de69[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x49c713,null))[_0xc520('0x14')](function(_0x580d16){if(_0x580d16){_0x1d9635=_0x580d16;_0x4a065d[_0xc520('0x3c')]=_['keys'](db[_0xc520('0x114')][_0xc520('0x34')]);_0x4a065d[_0xc520('0x37')]=_['keys'](_0x98de69['query']);_0x4a065d[_0xc520('0x39')]=_[_0xc520('0x3a')](_0x4a065d[_0xc520('0x3c')],_0x4a065d[_0xc520('0x37')]);_0x3c64a2[_0xc520('0x3b')]=_[_0xc520('0x3a')](_0x4a065d[_0xc520('0x3c')],qs['fields'](_0x98de69[_0xc520('0x37')][_0xc520('0x3d')]));_0x3c64a2[_0xc520('0x3b')]=_0x3c64a2[_0xc520('0x3b')]['length']?_0x3c64a2[_0xc520('0x3b')]:_0x4a065d[_0xc520('0x3c')];_0x3c64a2[_0xc520('0x41')]=qs[_0xc520('0x42')](_0x98de69['query'][_0xc520('0x42')]);_0x3c64a2[_0xc520('0x43')]=qs[_0xc520('0x39')](_[_0xc520('0x5b')](_0x98de69[_0xc520('0x37')],_0x4a065d[_0xc520('0x39')]));if(_0x98de69[_0xc520('0x37')]['filter']){_0x3c64a2['where']=_[_0xc520('0x45')](_0x3c64a2[_0xc520('0x43')],{'$or':_[_0xc520('0x32')](_0x3c64a2[_0xc520('0x3b')],function(_0x139c99){var _0x5d3b32={};_0x5d3b32[_0x139c99]={'$like':'%'+_0x98de69['query'][_0xc520('0x44')]+'%'};return _0x5d3b32;})});}_0x3c64a2=_['merge']({},_0x3c64a2,_0x98de69['options']);return _0x1d9635['getProactiveActions'](_0x3c64a2);}})['then'](function(_0x4c53ad){if(_0x4c53ad){_0x395155=_0x4c53ad[_0xc520('0x3e')];if(!_0x98de69['query'][_0xc520('0x3f')](_0xc520('0x40'))){_0x3c64a2[_0xc520('0x23')]=qs[_0xc520('0x23')](_0x98de69[_0xc520('0x37')][_0xc520('0x23')]);_0x3c64a2[_0xc520('0x21')]=qs[_0xc520('0x21')](_0x98de69[_0xc520('0x37')]['offset']);}return _0x1d9635[_0xc520('0xfd')](_0x3c64a2);}})[_0xc520('0x14')](function(_0x12b566){if(_0x12b566){return _0x12b566?{'count':_0x395155,'rows':_0x12b566}:null;}})[_0xc520('0x14')](respondWithResult(_0x49c713,null))[_0xc520('0x1e')](handleError(_0x49c713,null));};exports[_0xc520('0x115')]=function(_0x30bc76,_0x43de39){var _0x1f47aa=_0x30bc76[_0xc520('0x37')]['online']===_0xc520('0x116')?'offlineForm':_0xc520('0x117');return db[_0xc520('0x33')][_0xc520('0x4e')]({'attributes':['id',_0x1f47aa],'where':{'id':_0x30bc76[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x43de39,null))[_0xc520('0x14')](function(_0x47f5a2){if(_0x47f5a2){var _0x286f61=_0x47f5a2[_0x1f47aa];var _0x4eaf62=_0x286f61&&_0x286f61['items']?_0x286f61[_0xc520('0x118')]:[];_0x43de39[_0xc520('0xbd')]({'fromKey':_[_0xc520('0x78')](_0x286f61[_0xc520('0x119')])?undefined:_0x286f61[_0xc520('0x119')],'count':_0x4eaf62[_0xc520('0x3e')],'rows':_0x4eaf62});}})[_0xc520('0x1e')](handleError(_0x43de39,null));};exports[_0xc520('0x11a')]=function(_0x3b3b80,_0x4f22b5){var _0x5c7bcf={'raw':![],'where':{}};var _0x2e45d9={};var _0x580013={'count':0x0,'rows':[]};return db[_0xc520('0x33')][_0xc520('0x5a')]({'where':{'id':_0x3b3b80[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x4f22b5,null))[_0xc520('0x14')](function(_0x1738a9){if(_0x1738a9){_0x2e45d9[_0xc520('0x3c')]=_[_0xc520('0x38')](db['ChatOfflineMessage']['rawAttributes']);_0x2e45d9['query']=_[_0xc520('0x38')](_0x3b3b80[_0xc520('0x37')]);_0x2e45d9[_0xc520('0x39')]=_[_0xc520('0x3a')](_0x2e45d9[_0xc520('0x3c')],_0x2e45d9['query']);_0x5c7bcf['attributes']=_['intersection'](_0x2e45d9[_0xc520('0x3c')],qs[_0xc520('0x3d')](_0x3b3b80[_0xc520('0x37')][_0xc520('0x3d')]));_0x5c7bcf[_0xc520('0x3b')]=_0x5c7bcf['attributes'][_0xc520('0x3e')]?_0x5c7bcf[_0xc520('0x3b')]:_0x2e45d9['model'];if(!_0x3b3b80['query']['hasOwnProperty'](_0xc520('0x40'))){_0x5c7bcf[_0xc520('0x23')]=qs[_0xc520('0x23')](_0x3b3b80['query'][_0xc520('0x23')]);_0x5c7bcf['offset']=qs[_0xc520('0x21')](_0x3b3b80[_0xc520('0x37')][_0xc520('0x21')]);}_0x5c7bcf[_0xc520('0x41')]=qs['sort'](_0x3b3b80['query'][_0xc520('0x42')]);_0x5c7bcf[_0xc520('0x43')]=qs[_0xc520('0x39')](_[_0xc520('0x5b')](_0x3b3b80[_0xc520('0x37')],_0x2e45d9['filters']));_0x5c7bcf[_0xc520('0x43')][_0xc520('0x57')]=_0x1738a9['id'];if(_0x3b3b80[_0xc520('0x37')][_0xc520('0x44')]){_0x5c7bcf[_0xc520('0x43')]=_[_0xc520('0x45')](_0x5c7bcf[_0xc520('0x43')],{'$or':_[_0xc520('0x32')](_0x5c7bcf[_0xc520('0x3b')],function(_0x33f8f6){var _0xec056c={};_0xec056c[_0x33f8f6]={'$like':'%'+_0x3b3b80[_0xc520('0x37')][_0xc520('0x44')]+'%'};return _0xec056c;})});}_0x5c7bcf=_['merge']({},_0x5c7bcf,_0x3b3b80[_0xc520('0x4d')]);return db['ChatOfflineMessage']['count']({'where':_0x5c7bcf[_0xc520('0x43')]})[_0xc520('0x14')](function(_0x36412d){_0x580013[_0xc520('0x24')]=_0x36412d;if(_0x3b3b80[_0xc520('0x37')][_0xc520('0x4c')]){_0x5c7bcf[_0xc520('0x47')]=[{'all':!![]}];}else{_0x5c7bcf[_0xc520('0x47')]=[{'model':db[_0xc520('0x7d')],'as':_0xc520('0xe8'),'required':![]},{'model':db[_0xc520('0xd2')],'as':_0xc520('0x11b'),'required':![]}];}return db[_0xc520('0x11c')][_0xc520('0x48')](_0x5c7bcf);})[_0xc520('0x14')](function(_0x1eafa){_0x580013[_0xc520('0x49')]=_0x1eafa;return _0x580013;});}})[_0xc520('0x14')](respondWithFilteredResult(_0x4f22b5,_0x5c7bcf))[_0xc520('0x1e')](handleError(_0x4f22b5,null));};exports['addAgents']=function(_0x21c00a,_0x6f65e){return db[_0xc520('0x33')][_0xc520('0x4e')]({'where':{'id':_0x21c00a[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x6f65e,null))[_0xc520('0x14')](function(_0x4edd4d){if(_0x4edd4d){return _0x4edd4d['addAgents'](_0x21c00a[_0xc520('0x55')][_0xc520('0x5d')],_[_0xc520('0xe7')](_0x21c00a[_0xc520('0x55')],['ids','id'])||{})['spread'](function(_0x236b25){for(var _0x35016a=0x0;_0x35016a<_0x21c00a[_0xc520('0x55')][_0xc520('0x5d')][_0xc520('0x3e')];_0x35016a+=0x1){socket[_0xc520('0x11d')]('userChatWebsite:save',{'UserId':Number(_0x21c00a[_0xc520('0x55')][_0xc520('0x5d')][_0x35016a]),'ChatWebsiteId':Number(_0x21c00a['params']['id'])});}return _0x236b25;});}})[_0xc520('0x14')](respondWithResult(_0x6f65e,null))[_0xc520('0x1e')](handleError(_0x6f65e,null));};exports[_0xc520('0x11e')]=function(_0x287a61,_0x3752d1){return db[_0xc520('0x33')]['find']({'where':{'id':_0x287a61['params']['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x3752d1,null))[_0xc520('0x14')](function(_0x313183){if(_0x313183){return _0x313183[_0xc520('0x11e')](_0x287a61['query'][_0xc520('0x5d')])[_0xc520('0x14')](function(){if(_['isArray'](_0x287a61[_0xc520('0x37')][_0xc520('0x5d')])){for(var _0x4860c1=0x0;_0x4860c1<_0x287a61[_0xc520('0x37')][_0xc520('0x5d')][_0xc520('0x3e')];_0x4860c1+=0x1){socket[_0xc520('0x11d')](_0xc520('0x11f'),{'UserId':Number(_0x287a61[_0xc520('0x37')][_0xc520('0x5d')][_0x4860c1]),'ChatWebsiteId':Number(_0x287a61['params']['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x287a61[_0xc520('0x37')][_0xc520('0x5d')]),'ChatWebsiteId':Number(_0x287a61[_0xc520('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x3752d1,null))[_0xc520('0x1e')](handleError(_0x3752d1,null));};exports[_0xc520('0x120')]=function(_0x20b46f,_0x301124){var _0xc1e2b4={};var _0x34162b={};var _0x4a84cf;var _0x23f29a;return db['ChatWebsite'][_0xc520('0x5a')]({'where':{'id':_0x20b46f[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x301124,null))[_0xc520('0x14')](function(_0x1f5c3a){if(_0x1f5c3a){_0x4a84cf=_0x1f5c3a;_0x34162b[_0xc520('0x3c')]=_[_0xc520('0x38')](db[_0xc520('0xe9')]['rawAttributes']);_0x34162b[_0xc520('0x37')]=_[_0xc520('0x38')](_0x20b46f['query']);_0x34162b['filters']=_[_0xc520('0x3a')](_0x34162b['model'],_0x34162b[_0xc520('0x37')]);_0xc1e2b4[_0xc520('0x3b')]=_[_0xc520('0x3a')](_0x34162b[_0xc520('0x3c')],qs[_0xc520('0x3d')](_0x20b46f['query'][_0xc520('0x3d')]));_0xc1e2b4[_0xc520('0x3b')]=_0xc1e2b4[_0xc520('0x3b')][_0xc520('0x3e')]?_0xc1e2b4[_0xc520('0x3b')]:_0x34162b['model'];_0xc1e2b4[_0xc520('0x41')]=qs['sort'](_0x20b46f[_0xc520('0x37')]['sort']);_0xc1e2b4[_0xc520('0x43')]=qs[_0xc520('0x39')](_['pick'](_0x20b46f['query'],_0x34162b[_0xc520('0x39')]));if(_0x20b46f[_0xc520('0x37')]['filter']){_0xc1e2b4[_0xc520('0x43')]=_['merge'](_0xc1e2b4[_0xc520('0x43')],{'$or':_['map'](_0xc1e2b4[_0xc520('0x3b')],function(_0x5960ba){var _0x1dfe3c={};_0x1dfe3c[_0x5960ba]={'$like':'%'+_0x20b46f[_0xc520('0x37')][_0xc520('0x44')]+'%'};return _0x1dfe3c;})});}_0xc1e2b4=_['merge']({},_0xc1e2b4,_0x20b46f[_0xc520('0x4d')]);return _0x4a84cf[_0xc520('0x120')](_0xc1e2b4);}})[_0xc520('0x14')](function(_0xf3928b){if(_0xf3928b){_0x23f29a=_0xf3928b['length'];if(!_0x20b46f[_0xc520('0x37')][_0xc520('0x3f')](_0xc520('0x40'))){_0xc1e2b4[_0xc520('0x23')]=qs['limit'](_0x20b46f[_0xc520('0x37')][_0xc520('0x23')]);_0xc1e2b4[_0xc520('0x21')]=qs[_0xc520('0x21')](_0x20b46f[_0xc520('0x37')][_0xc520('0x21')]);}return _0x4a84cf[_0xc520('0x120')](_0xc1e2b4);}})['then'](function(_0x48847e){if(_0x48847e){return _0x48847e?{'count':_0x23f29a,'rows':_0x48847e}:null;}})[_0xc520('0x14')](respondWithResult(_0x301124,null))['catch'](handleError(_0x301124,null));};
\ No newline at end of file
+var _0xf0e3=['server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','ValidationError','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','List','Contacts','DESC','ChatApplication','Applications','list','applications','orderBy','account','ListId','contact','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','type','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','originalname','mimetype','server','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Smtp','offlineMessageSubject','subjectOffline','mapValues','Chat','MailAccountId','NotifyMailAccount','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','interval','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','getLicense','chatLicenseExceeded','all','readFileSync','server/files/chat/iframe.ejs','remote','remoteAddress','virtual','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority','getApplications','addProactiveActions','omit','ChatProactiveAction','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','User','bluebird','mustache','util','path','ejs','lodash','querystring','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','sendStatus','status','json','undefined','limit','count','set','Content-Range','update','destroy','end','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','filters','pick','filter','merge','options','findAll','rows','show','params','length','includeAll','include','find','create','body','user','role','get','ChatWebsites','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','order','ChatWebsiteId','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','existsSync','server/files/images/logos/','root','download','server/files/images/avatars/','getCustomerAvatar'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xf0e3,0x1dc));var _0x3f0e=function(_0x44e83f,_0xb35413){_0x44e83f=_0x44e83f-0x0;var _0x585054=_0xf0e3[_0x44e83f];return _0x585054;};'use strict';var BPromise=require(_0x3f0e('0x0'));var Mustache=require(_0x3f0e('0x1'));var util=require(_0x3f0e('0x2'));var path=require(_0x3f0e('0x3'));var ejs=require(_0x3f0e('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3f0e('0x5'));var querystring=require(_0x3f0e('0x6'));var Redis=require(_0x3f0e('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0x3f0e('0x8'))(_0x3f0e('0x9'));var config=require(_0x3f0e('0xa'));var db=require(_0x3f0e('0xb'))['db'];config['redis']=_[_0x3f0e('0xc')](config[_0x3f0e('0xd')],{'host':_0x3f0e('0xe'),'port':0x18eb});var socket=require(_0x3f0e('0xf'))(new Redis(config[_0x3f0e('0xd')]));require(_0x3f0e('0x10'))[_0x3f0e('0x11')](socket);var htmlToText=require(_0x3f0e('0x12'));var jayson=require(_0x3f0e('0x13'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x3f0e('0x14')]['http']({'port':0x232a});var client9003=jayson[_0x3f0e('0x14')][_0x3f0e('0x15')]({'port':0x232b});var client9001=jayson['client'][_0x3f0e('0x15')]({'port':0x2329});function respondWithRpcPromise(_0xa6b3d8,_0x16d6a5,_0x2d7f50,_0x3433d0){return new BPromise(function(_0x1d12bd,_0x30466e){var _0x4c399e=_0x3433d0||client;return _0x4c399e[_0x3f0e('0x16')](_0xa6b3d8,_0x2d7f50)[_0x3f0e('0x17')](function(_0x18ac45){logger[_0x3f0e('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x16d6a5,'request\x20sent');logger[_0x3f0e('0x19')](_0x3f0e('0x1a'),_0x16d6a5,_0x3f0e('0x1b'),JSON[_0x3f0e('0x1c')](_0x18ac45));if(_0x18ac45[_0x3f0e('0x1d')]){if(_0x18ac45[_0x3f0e('0x1d')][_0x3f0e('0x1e')]===0x1f4){logger[_0x3f0e('0x1d')](_0x3f0e('0x1f'),_0x16d6a5,_0x18ac45['error']['message']);return _0x30466e(_0x18ac45['error'][_0x3f0e('0x20')]);}logger['error'](_0x3f0e('0x1f'),_0x16d6a5,_0x18ac45[_0x3f0e('0x1d')][_0x3f0e('0x20')]);return _0x1d12bd(_0x18ac45[_0x3f0e('0x1d')][_0x3f0e('0x20')]);}else{logger[_0x3f0e('0x18')](_0x3f0e('0x1f'),_0x16d6a5,'request\x20sent');_0x1d12bd(_0x18ac45['result'][_0x3f0e('0x20')]);}})[_0x3f0e('0x21')](function(_0x20038a){logger[_0x3f0e('0x1d')]('ChatWebsite,\x20%s,\x20%s',_0x16d6a5,_0x20038a);_0x30466e(_0x20038a);});});}function respondWithStatusCode(_0x1d0698,_0x24f0cc){_0x24f0cc=_0x24f0cc||0xcc;return function(_0x53ac92){if(_0x53ac92){return _0x1d0698[_0x3f0e('0x22')](_0x24f0cc);}return _0x1d0698[_0x3f0e('0x23')](_0x24f0cc)['end']();};}function respondWithResult(_0x2b57f2,_0x52262c){_0x52262c=_0x52262c||0xc8;return function(_0x47c5e2){if(_0x47c5e2){return _0x2b57f2[_0x3f0e('0x23')](_0x52262c)[_0x3f0e('0x24')](_0x47c5e2);}};}function respondWithFilteredResult(_0x41b30a,_0x4f3766){return function(_0x242b03){if(_0x242b03){var _0x3c04e4=typeof _0x4f3766['offset']===_0x3f0e('0x25')&&typeof _0x4f3766[_0x3f0e('0x26')]===_0x3f0e('0x25');var _0x25eabb=_0x242b03[_0x3f0e('0x27')];var _0x2cc1e6=_0x3c04e4?0x0:_0x4f3766['offset'];var _0x393dc9=_0x3c04e4?_0x242b03[_0x3f0e('0x27')]:_0x4f3766['offset']+_0x4f3766[_0x3f0e('0x26')];var _0x3daff4;if(_0x393dc9>=_0x25eabb){_0x393dc9=_0x25eabb;_0x3daff4=0xc8;}else{_0x3daff4=0xce;}_0x41b30a['status'](_0x3daff4);return _0x41b30a[_0x3f0e('0x28')](_0x3f0e('0x29'),_0x2cc1e6+'-'+_0x393dc9+'/'+_0x25eabb)['json'](_0x242b03);}return null;};}function saveUpdates(_0x46b354){return function(_0x294206){if(_0x294206){return _0x294206[_0x3f0e('0x2a')](_0x46b354)['then'](function(_0x2a0087){return _0x2a0087;});}return null;};}function removeEntity(_0x89c2a){return function(_0x3672c4){if(_0x3672c4){return _0x3672c4[_0x3f0e('0x2b')]()['then'](function(){var _0x20bf0d=_0x3672c4['get']({'plain':!![]});var _0xd5c850='ChatWebsites';return db['UserProfileResource'][_0x3f0e('0x2b')]({'where':{'type':_0xd5c850,'resourceId':_0x20bf0d['id']}})[_0x3f0e('0x17')](function(){return _0x3672c4;});})[_0x3f0e('0x17')](function(){_0x89c2a[_0x3f0e('0x23')](0xcc)[_0x3f0e('0x2c')]();});}};}function handleEntityNotFound(_0x4427dd){return function(_0x755bdc){if(!_0x755bdc){_0x4427dd[_0x3f0e('0x22')](0x194);}return _0x755bdc;};}function handleError(_0x1a376f,_0xca1521){_0xca1521=_0xca1521||0x1f4;return function(_0x3a30ea){logger[_0x3f0e('0x1d')](_0x3a30ea['stack']);if(_0x3a30ea[_0x3f0e('0x2d')]){delete _0x3a30ea['name'];}_0x1a376f[_0x3f0e('0x23')](_0xca1521)[_0x3f0e('0x2e')](_0x3a30ea);};}exports[_0x3f0e('0x2f')]=function(_0x3f2287,_0x59b093){var _0xa2fe01={'include':[{'model':db[_0x3f0e('0x30')],'as':_0x3f0e('0x31')}]},_0x21f0a1={},_0x18d5eb={'count':0x0,'rows':[]};var _0x3e9951=_[_0x3f0e('0x32')](db[_0x3f0e('0x33')][_0x3f0e('0x34')],function(_0x1c1a24){return{'name':_0x1c1a24[_0x3f0e('0x35')],'type':_0x1c1a24['type'][_0x3f0e('0x36')]};});_0x21f0a1[_0x3f0e('0x37')]=_[_0x3f0e('0x32')](_0x3e9951,'name');_0x21f0a1[_0x3f0e('0x38')]=_[_0x3f0e('0x39')](_0x3f2287[_0x3f0e('0x38')]);_0x21f0a1['filters']=_[_0x3f0e('0x3a')](_0x21f0a1[_0x3f0e('0x37')],_0x21f0a1['query']);_0xa2fe01[_0x3f0e('0x3b')]=_[_0x3f0e('0x3a')](_0x21f0a1[_0x3f0e('0x37')],qs[_0x3f0e('0x3c')](_0x3f2287[_0x3f0e('0x38')][_0x3f0e('0x3c')]));_0xa2fe01[_0x3f0e('0x3b')]=_0xa2fe01[_0x3f0e('0x3b')]['length']?_0xa2fe01[_0x3f0e('0x3b')]:_0x21f0a1['model'];if(!_0x3f2287['query'][_0x3f0e('0x3d')](_0x3f0e('0x3e'))){_0xa2fe01[_0x3f0e('0x26')]=qs['limit'](_0x3f2287['query'][_0x3f0e('0x26')]);_0xa2fe01[_0x3f0e('0x3f')]=qs[_0x3f0e('0x3f')](_0x3f2287[_0x3f0e('0x38')][_0x3f0e('0x3f')]);}_0xa2fe01['order']=qs[_0x3f0e('0x40')](_0x3f2287[_0x3f0e('0x38')][_0x3f0e('0x40')]);_0xa2fe01[_0x3f0e('0x41')]=qs[_0x3f0e('0x42')](_[_0x3f0e('0x43')](_0x3f2287[_0x3f0e('0x38')],_0x21f0a1[_0x3f0e('0x42')]),_0x3e9951);if(_0x3f2287['query'][_0x3f0e('0x44')]){_0xa2fe01[_0x3f0e('0x41')]=_[_0x3f0e('0x45')](_0xa2fe01[_0x3f0e('0x41')],{'$or':_[_0x3f0e('0x32')](_0x3e9951,function(_0x4384c0){if(_0x4384c0['type']!=='VIRTUAL'){var _0x5d78fa={};_0x5d78fa[_0x4384c0[_0x3f0e('0x2d')]]={'$like':'%'+_0x3f2287[_0x3f0e('0x38')][_0x3f0e('0x44')]+'%'};return _0x5d78fa;}})});}_0xa2fe01=_[_0x3f0e('0x45')]({},_0xa2fe01,_0x3f2287[_0x3f0e('0x46')]);var _0x27cb5b={'where':_0xa2fe01[_0x3f0e('0x41')]};return db[_0x3f0e('0x33')][_0x3f0e('0x27')](_0x27cb5b)[_0x3f0e('0x17')](function(_0x4d859e){_0x18d5eb[_0x3f0e('0x27')]=_0x4d859e;if(_0x3f2287[_0x3f0e('0x38')]['includeAll']){_0xa2fe01['include']=[{'all':!![]}];}return db[_0x3f0e('0x33')][_0x3f0e('0x47')](_0xa2fe01);})[_0x3f0e('0x17')](function(_0x558d00){_0x18d5eb[_0x3f0e('0x48')]=_0x558d00;return _0x18d5eb;})[_0x3f0e('0x17')](respondWithFilteredResult(_0x59b093,_0xa2fe01))['catch'](handleError(_0x59b093,null));};exports[_0x3f0e('0x49')]=function(_0x5753c3,_0x14f9e2){var _0x372413={'raw':![],'where':{'id':_0x5753c3[_0x3f0e('0x4a')]['id']},'include':[{'model':db[_0x3f0e('0x30')],'as':_0x3f0e('0x31')}]},_0x24e029={};_0x24e029[_0x3f0e('0x37')]=_[_0x3f0e('0x39')](db[_0x3f0e('0x33')][_0x3f0e('0x34')]);_0x24e029[_0x3f0e('0x38')]=_[_0x3f0e('0x39')](_0x5753c3[_0x3f0e('0x38')]);_0x24e029[_0x3f0e('0x42')]=_['intersection'](_0x24e029['model'],_0x24e029[_0x3f0e('0x38')]);_0x372413[_0x3f0e('0x3b')]=_[_0x3f0e('0x3a')](_0x24e029[_0x3f0e('0x37')],qs[_0x3f0e('0x3c')](_0x5753c3['query'][_0x3f0e('0x3c')]));_0x372413[_0x3f0e('0x3b')]=_0x372413[_0x3f0e('0x3b')][_0x3f0e('0x4b')]?_0x372413[_0x3f0e('0x3b')]:_0x24e029[_0x3f0e('0x37')];if(_0x5753c3[_0x3f0e('0x38')][_0x3f0e('0x4c')]){_0x372413[_0x3f0e('0x4d')]=[{'all':!![]}];}_0x372413=_[_0x3f0e('0x45')]({},_0x372413,_0x5753c3['options']);return db[_0x3f0e('0x33')][_0x3f0e('0x4e')](_0x372413)['then'](handleEntityNotFound(_0x14f9e2,null))[_0x3f0e('0x17')](respondWithResult(_0x14f9e2,null))[_0x3f0e('0x21')](handleError(_0x14f9e2,null));};exports[_0x3f0e('0x4f')]=function(_0x5bad02,_0x46113c){return db[_0x3f0e('0x33')][_0x3f0e('0x4f')](_0x5bad02[_0x3f0e('0x50')],{})[_0x3f0e('0x17')](function(_0x44d1f0){var _0x5c7b93=_0x5bad02[_0x3f0e('0x51')]['get']({'plain':!![]});if(!_0x5c7b93)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c7b93[_0x3f0e('0x52')]==='user'){var _0x2433e6=_0x44d1f0[_0x3f0e('0x53')]({'plain':!![]});var _0x5b8cfd=_0x3f0e('0x54');return db[_0x3f0e('0x55')]['find']({'where':{'name':_0x5b8cfd,'userProfileId':_0x5c7b93[_0x3f0e('0x56')]},'raw':!![]})[_0x3f0e('0x17')](function(_0x4cd74b){if(_0x4cd74b&&_0x4cd74b['autoAssociation']===0x0){return db[_0x3f0e('0x57')][_0x3f0e('0x4f')]({'name':_0x2433e6['name'],'resourceId':_0x2433e6['id'],'type':_0x4cd74b[_0x3f0e('0x2d')],'sectionId':_0x4cd74b['id']},{})[_0x3f0e('0x17')](function(){return _0x44d1f0;});}else{return _0x44d1f0;}})['catch'](function(_0x270f29){logger[_0x3f0e('0x1d')](_0x3f0e('0x58'),_0x270f29);throw _0x270f29;});}return _0x44d1f0;})['then'](respondWithResult(_0x46113c,0xc9))[_0x3f0e('0x21')](handleError(_0x46113c,null));};exports[_0x3f0e('0x2a')]=function(_0x2cc374,_0x8aab85){if(_0x2cc374[_0x3f0e('0x50')]['id']){delete _0x2cc374[_0x3f0e('0x50')]['id'];}return db[_0x3f0e('0x33')]['find']({'where':{'id':_0x2cc374['params']['id']},'include':[{'model':db[_0x3f0e('0x30')],'as':_0x3f0e('0x31')}]})[_0x3f0e('0x17')](handleEntityNotFound(_0x8aab85,null))[_0x3f0e('0x17')](saveUpdates(_0x2cc374[_0x3f0e('0x50')],null))[_0x3f0e('0x17')](respondWithResult(_0x8aab85,null))['catch'](handleError(_0x8aab85,null));};exports['destroy']=function(_0x50c0cb,_0x56ccc2){return db[_0x3f0e('0x33')][_0x3f0e('0x4e')]({'where':{'id':_0x50c0cb[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x56ccc2,null))[_0x3f0e('0x17')](removeEntity(_0x56ccc2,null))['catch'](handleError(_0x56ccc2,null));};exports['describe']=function(_0x1353e7,_0x52b3a0){return db[_0x3f0e('0x33')][_0x3f0e('0x59')]()[_0x3f0e('0x17')](respondWithResult(_0x52b3a0,null))[_0x3f0e('0x21')](handleError(_0x52b3a0,null));};exports[_0x3f0e('0x5a')]=function(_0x472c42,_0x39240d){if(_0x472c42[_0x3f0e('0x50')]['id']){delete _0x472c42['body']['id'];}return db[_0x3f0e('0x33')][_0x3f0e('0x4e')]({'where':{'id':_0x472c42[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x39240d,null))['then'](function(_0x35338c){if(_0x35338c){_0x472c42[_0x3f0e('0x50')]['ChatWebsiteId']=_0x35338c['id'];return db[_0x3f0e('0x5b')][_0x3f0e('0x4f')](_0x472c42[_0x3f0e('0x50')]);}})['then'](respondWithResult(_0x39240d,null))[_0x3f0e('0x21')](handleError(_0x39240d,null));};exports[_0x3f0e('0x5c')]=function(_0x399fef,_0x2d9a61){var _0x2e0425={'raw':![],'where':{}};var _0x2c1ebe={};var _0xfe9081={'count':0x0,'rows':[]};return db[_0x3f0e('0x33')][_0x3f0e('0x5d')]({'where':{'id':_0x399fef[_0x3f0e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2d9a61,null))['then'](function(_0x31d01a){if(_0x31d01a){_0x2c1ebe['model']=_[_0x3f0e('0x39')](db[_0x3f0e('0x5b')][_0x3f0e('0x34')]);_0x2c1ebe['query']=_[_0x3f0e('0x39')](_0x399fef[_0x3f0e('0x38')]);_0x2c1ebe[_0x3f0e('0x42')]=_[_0x3f0e('0x3a')](_0x2c1ebe[_0x3f0e('0x37')],_0x2c1ebe[_0x3f0e('0x38')]);_0x2e0425[_0x3f0e('0x3b')]=_[_0x3f0e('0x3a')](_0x2c1ebe['model'],qs[_0x3f0e('0x3c')](_0x399fef['query']['fields']));_0x2e0425[_0x3f0e('0x3b')]=_0x2e0425[_0x3f0e('0x3b')][_0x3f0e('0x4b')]?_0x2e0425['attributes']:_0x2c1ebe[_0x3f0e('0x37')];if(!_0x399fef['query']['hasOwnProperty'](_0x3f0e('0x3e'))){_0x2e0425[_0x3f0e('0x26')]=qs[_0x3f0e('0x26')](_0x399fef['query'][_0x3f0e('0x26')]);_0x2e0425[_0x3f0e('0x3f')]=qs['offset'](_0x399fef[_0x3f0e('0x38')]['offset']);}_0x2e0425[_0x3f0e('0x5e')]=qs[_0x3f0e('0x40')](_0x399fef[_0x3f0e('0x38')][_0x3f0e('0x40')]);_0x2e0425[_0x3f0e('0x41')]=qs[_0x3f0e('0x42')](_[_0x3f0e('0x43')](_0x399fef[_0x3f0e('0x38')],_0x2c1ebe[_0x3f0e('0x42')]));_0x2e0425['where'][_0x3f0e('0x5f')]=_0x31d01a['id'];if(_0x399fef[_0x3f0e('0x38')][_0x3f0e('0x44')]){_0x2e0425[_0x3f0e('0x41')]=_['merge'](_0x2e0425['where'],{'$or':_[_0x3f0e('0x32')](_0x2e0425[_0x3f0e('0x3b')],function(_0x1ba7a4){var _0x48b8c0={};_0x48b8c0[_0x1ba7a4]={'$like':'%'+_0x399fef[_0x3f0e('0x38')]['filter']+'%'};return _0x48b8c0;})});}_0x2e0425=_[_0x3f0e('0x45')]({},_0x2e0425,_0x399fef['options']);return db[_0x3f0e('0x5b')][_0x3f0e('0x27')]({'where':_0x2e0425[_0x3f0e('0x41')]})[_0x3f0e('0x17')](function(_0x5d0239){_0xfe9081[_0x3f0e('0x27')]=_0x5d0239;if(_0x399fef[_0x3f0e('0x38')][_0x3f0e('0x4c')]){_0x2e0425[_0x3f0e('0x4d')]=[{'all':!![]}];}return db[_0x3f0e('0x5b')][_0x3f0e('0x47')](_0x2e0425);})[_0x3f0e('0x17')](function(_0x142000){_0xfe9081['rows']=_0x142000;return _0xfe9081;});}})[_0x3f0e('0x17')](respondWithFilteredResult(_0x2d9a61,_0x2e0425))[_0x3f0e('0x21')](handleError(_0x2d9a61,null));};exports[_0x3f0e('0x60')]=function(_0x2c0e5b,_0x3feb0a){return db[_0x3f0e('0x33')][_0x3f0e('0x4e')]({'where':{'id':_0x2c0e5b[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x3feb0a,null))['then'](function(_0x5c47cf){if(_0x5c47cf){return _0x5c47cf['removeDispositions'](_0x2c0e5b[_0x3f0e('0x38')][_0x3f0e('0x61')]);}})[_0x3f0e('0x17')](respondWithStatusCode(_0x3feb0a,null))[_0x3f0e('0x21')](handleError(_0x3feb0a,null));};exports[_0x3f0e('0x62')]=function(_0xa02c31,_0x21c798){if(_0xa02c31['body']['id']){delete _0xa02c31[_0x3f0e('0x50')]['id'];}return db['ChatWebsite'][_0x3f0e('0x4e')]({'where':{'id':_0xa02c31[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x21c798,null))[_0x3f0e('0x17')](function(_0x1bad21){if(_0x1bad21){_0xa02c31['body'][_0x3f0e('0x5f')]=_0x1bad21['id'];return db['CannedAnswer'][_0x3f0e('0x4f')](_0xa02c31[_0x3f0e('0x50')]);}})[_0x3f0e('0x17')](respondWithResult(_0x21c798,null))[_0x3f0e('0x21')](handleError(_0x21c798,null));};exports[_0x3f0e('0x63')]=function(_0x85409,_0x21931d){var _0xcb91ae={'raw':![],'where':{}};var _0x3f27e4={};var _0x54933a={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x85409[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x21931d,null))[_0x3f0e('0x17')](function(_0x27a666){if(_0x27a666){_0x3f27e4[_0x3f0e('0x37')]=_[_0x3f0e('0x39')](db[_0x3f0e('0x64')]['rawAttributes']);_0x3f27e4[_0x3f0e('0x38')]=_['keys'](_0x85409[_0x3f0e('0x38')]);_0x3f27e4[_0x3f0e('0x42')]=_[_0x3f0e('0x3a')](_0x3f27e4[_0x3f0e('0x37')],_0x3f27e4['query']);_0xcb91ae[_0x3f0e('0x3b')]=_[_0x3f0e('0x3a')](_0x3f27e4[_0x3f0e('0x37')],qs[_0x3f0e('0x3c')](_0x85409['query'][_0x3f0e('0x3c')]));_0xcb91ae['attributes']=_0xcb91ae[_0x3f0e('0x3b')]['length']?_0xcb91ae[_0x3f0e('0x3b')]:_0x3f27e4[_0x3f0e('0x37')];if(!_0x85409['query'][_0x3f0e('0x3d')](_0x3f0e('0x3e'))){_0xcb91ae['limit']=qs[_0x3f0e('0x26')](_0x85409['query'][_0x3f0e('0x26')]);_0xcb91ae['offset']=qs[_0x3f0e('0x3f')](_0x85409[_0x3f0e('0x38')][_0x3f0e('0x3f')]);}_0xcb91ae[_0x3f0e('0x5e')]=qs[_0x3f0e('0x40')](_0x85409[_0x3f0e('0x38')]['sort']);_0xcb91ae[_0x3f0e('0x41')]=qs[_0x3f0e('0x42')](_[_0x3f0e('0x43')](_0x85409['query'],_0x3f27e4[_0x3f0e('0x42')]));_0xcb91ae[_0x3f0e('0x41')][_0x3f0e('0x5f')]=_0x27a666['id'];if(_0x85409[_0x3f0e('0x38')][_0x3f0e('0x44')]){_0xcb91ae[_0x3f0e('0x41')]=_['merge'](_0xcb91ae[_0x3f0e('0x41')],{'$or':_['map'](_0xcb91ae[_0x3f0e('0x3b')],function(_0x4ac143){var _0x4266a6={};_0x4266a6[_0x4ac143]={'$like':'%'+_0x85409[_0x3f0e('0x38')]['filter']+'%'};return _0x4266a6;})});}_0xcb91ae=_[_0x3f0e('0x45')]({},_0xcb91ae,_0x85409[_0x3f0e('0x46')]);return db[_0x3f0e('0x64')][_0x3f0e('0x27')]({'where':_0xcb91ae['where']})[_0x3f0e('0x17')](function(_0x2e9be5){_0x54933a[_0x3f0e('0x27')]=_0x2e9be5;if(_0x85409[_0x3f0e('0x38')][_0x3f0e('0x4c')]){_0xcb91ae['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x3f0e('0x47')](_0xcb91ae);})['then'](function(_0x10176e){_0x54933a[_0x3f0e('0x48')]=_0x10176e;return _0x54933a;});}})['then'](respondWithFilteredResult(_0x21931d,_0xcb91ae))[_0x3f0e('0x21')](handleError(_0x21931d,null));};exports[_0x3f0e('0x65')]=function(_0x2ace77,_0x178feb){return db[_0x3f0e('0x33')]['find']({'where':{'id':_0x2ace77[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x178feb,null))[_0x3f0e('0x17')](function(_0xfd0dbc){if(_0xfd0dbc){return _0xfd0dbc[_0x3f0e('0x65')](_0x2ace77[_0x3f0e('0x38')][_0x3f0e('0x61')]);}})['then'](respondWithStatusCode(_0x178feb,null))[_0x3f0e('0x21')](handleError(_0x178feb,null));};exports[_0x3f0e('0x66')]=function(_0x40830c,_0x1d5c47){_0x40830c[_0x3f0e('0x50')][_0x3f0e('0x67')]=_0x40830c[_0x3f0e('0x68')][_0x3f0e('0x69')];return db[_0x3f0e('0x33')][_0x3f0e('0x4e')]({'where':{'id':_0x40830c[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x1d5c47,null))['then'](saveUpdates(_0x40830c[_0x3f0e('0x50')],null))[_0x3f0e('0x17')](respondWithResult(_0x1d5c47,null))[_0x3f0e('0x21')](handleError(_0x1d5c47,null));};exports[_0x3f0e('0x6a')]=function(_0x1292f5,_0x404f8b){_0x1292f5[_0x3f0e('0x50')][_0x3f0e('0x6b')]=_0x1292f5[_0x3f0e('0x68')][_0x3f0e('0x69')];return db['ChatWebsite'][_0x3f0e('0x4e')]({'where':{'id':_0x1292f5['params']['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x404f8b,null))[_0x3f0e('0x17')](saveUpdates(_0x1292f5['body'],null))['then'](respondWithResult(_0x404f8b,null))[_0x3f0e('0x21')](handleError(_0x404f8b,null));};exports[_0x3f0e('0x6c')]=function(_0x3deab0,_0x13ff84){_0x3deab0[_0x3f0e('0x50')][_0x3f0e('0x6d')]=_0x3deab0[_0x3f0e('0x68')][_0x3f0e('0x69')];return db[_0x3f0e('0x33')]['find']({'where':{'id':_0x3deab0[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x13ff84,null))['then'](saveUpdates(_0x3deab0[_0x3f0e('0x50')],null))[_0x3f0e('0x17')](respondWithResult(_0x13ff84,null))[_0x3f0e('0x21')](handleError(_0x13ff84,null));};exports[_0x3f0e('0x6e')]=function(_0x1cff93,_0x1cd663){_0x1cff93[_0x3f0e('0x50')][_0x3f0e('0x6f')]=_0x1cff93[_0x3f0e('0x68')]['filename'];return db[_0x3f0e('0x33')][_0x3f0e('0x4e')]({'where':{'id':_0x1cff93[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x1cd663,null))[_0x3f0e('0x17')](saveUpdates(_0x1cff93[_0x3f0e('0x50')],null))[_0x3f0e('0x17')](respondWithResult(_0x1cd663,null))[_0x3f0e('0x21')](handleError(_0x1cd663,null));};exports[_0x3f0e('0x70')]=function(_0x66029f,_0x50e2bd){var _0x1cb103=path[_0x3f0e('0x71')](config['root'],_0x3f0e('0x72'));var _0x16c33c={'where':{'id':_0x66029f['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x33fd9a=![];return require(_0x3f0e('0x73'))['getLicense']()[_0x3f0e('0x17')](function(_0x1c970b){if(_0x1c970b){_0x33fd9a=_0x1c970b[_0x3f0e('0x74')];}})[_0x3f0e('0x17')](function(){return db[_0x3f0e('0x33')]['find'](_0x16c33c);})['then'](handleEntityNotFound(_0x50e2bd,null))[_0x3f0e('0x17')](function(_0x2c78c6){if(_0x2c78c6){if(!_[_0x3f0e('0x75')](_0x2c78c6['sitepic'])){if(fs[_0x3f0e('0x76')](path[_0x3f0e('0x71')](config['root'],_0x3f0e('0x77'),_0x2c78c6['sitepic']))&&_0x33fd9a){_0x1cb103=path['join'](config[_0x3f0e('0x78')],_0x3f0e('0x77'),_0x2c78c6['sitepic']);}}return _0x50e2bd[_0x3f0e('0x79')](_0x1cb103);}})[_0x3f0e('0x21')](handleError(_0x50e2bd,null));};exports['getAvatar']=function(_0x39c4a6,_0x32e714){var _0x188cd9=path[_0x3f0e('0x71')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x5c3edf={'where':{'id':_0x39c4a6['params']['id']},'attributes':['id',_0x3f0e('0x6b')],'raw':!![]};return db['ChatWebsite'][_0x3f0e('0x4e')](_0x5c3edf)[_0x3f0e('0x17')](handleEntityNotFound(_0x32e714,null))[_0x3f0e('0x17')](function(_0x2b67de){if(_0x2b67de){if(!_[_0x3f0e('0x75')](_0x2b67de['agentAvatar'])){if(fs[_0x3f0e('0x76')](path['join'](config[_0x3f0e('0x78')],_0x3f0e('0x7a'),_0x2b67de[_0x3f0e('0x6b')]))){_0x188cd9=path[_0x3f0e('0x71')](config['root'],'server/files/images/avatars/',_0x2b67de['agentAvatar']);}}return _0x32e714['download'](_0x188cd9);}})['catch'](handleError(_0x32e714,null));};exports[_0x3f0e('0x7b')]=function(_0x540f5f,_0x379d84){var _0xd34f6=path['join'](config['root'],_0x3f0e('0x7c'));var _0x2f7e50={'where':{'id':_0x540f5f[_0x3f0e('0x4a')]['id']},'attributes':['id',_0x3f0e('0x6d'),_0x3f0e('0x7d')],'raw':!![]};return db[_0x3f0e('0x33')][_0x3f0e('0x4e')](_0x2f7e50)[_0x3f0e('0x17')](handleEntityNotFound(_0x379d84,null))[_0x3f0e('0x17')](function(_0x29e3f4){if(_0x29e3f4){if(!_[_0x3f0e('0x75')](_0x29e3f4[_0x3f0e('0x6d')])){if(fs['existsSync'](path[_0x3f0e('0x71')](config[_0x3f0e('0x78')],_0x3f0e('0x7a'),_0x29e3f4[_0x3f0e('0x6d')]))&&_0x29e3f4['showCustomerAvatar']){_0xd34f6=path[_0x3f0e('0x71')](config[_0x3f0e('0x78')],'server/files/images/avatars/',_0x29e3f4['customerAvatar']);}}return _0x379d84['download'](_0xd34f6);}})[_0x3f0e('0x21')](handleError(_0x379d84,null));};exports['getSystemAvatar']=function(_0x8420eb,_0x326acf){var _0x4bfcfc=path[_0x3f0e('0x71')](config[_0x3f0e('0x78')],_0x3f0e('0x7e'));var _0x5cea6a={'where':{'id':_0x8420eb[_0x3f0e('0x4a')]['id']},'attributes':['id',_0x3f0e('0x6f')],'raw':!![]};return db[_0x3f0e('0x33')][_0x3f0e('0x4e')](_0x5cea6a)[_0x3f0e('0x17')](handleEntityNotFound(_0x326acf,null))[_0x3f0e('0x17')](function(_0x575a55){if(_0x575a55){if(!_['isNil'](_0x575a55[_0x3f0e('0x6f')])){if(fs[_0x3f0e('0x76')](path['join'](config['root'],_0x3f0e('0x7a'),_0x575a55[_0x3f0e('0x6f')]))){_0x4bfcfc=path[_0x3f0e('0x71')](config[_0x3f0e('0x78')],_0x3f0e('0x7a'),_0x575a55[_0x3f0e('0x6f')]);}}return _0x326acf[_0x3f0e('0x79')](_0x4bfcfc);}})[_0x3f0e('0x21')](handleError(_0x326acf,null));};exports[_0x3f0e('0x7f')]=function(_0x535b63,_0x3ab285){var _0x45fc31=require('user-agent-parser');var _0x418c1f=new _0x45fc31();var _0x28aa00=_0x418c1f[_0x3f0e('0x80')](_0x535b63[_0x3f0e('0x81')][_0x3f0e('0x82')])[_0x3f0e('0x83')]();var _0x3505cd={'body':_0x535b63['body'],'channel':_0x3f0e('0x84')};var _0x10d9cb=[];var _0x224a28=[];var _0x39d5f5={};var _0x124eca=![];return db[_0x3f0e('0x85')]['describe']()[_0x3f0e('0x17')](function(_0x563b19){if(!_0x563b19){throw new db[(_0x3f0e('0x86'))]['ValidationError'](_0x3f0e('0x87'));}_0x10d9cb=_[_0x3f0e('0x88')](_[_0x3f0e('0x39')](_0x563b19),[_0x3f0e('0x89'),_0x3f0e('0x8a')]);_0x224a28=_[_0x3f0e('0x88')](_[_0x3f0e('0x39')](_0x563b19),['createdAt',_0x3f0e('0x8a'),_0x3f0e('0x8b'),'ListId']);if(_0x535b63[_0x3f0e('0x50')]['id']){delete _0x535b63[_0x3f0e('0x50')]['id'];}if(_[_0x3f0e('0x75')](_0x535b63[_0x3f0e('0x50')][_0x3f0e('0x8c')])){throw new db['Sequelize'][(_0x3f0e('0x8d'))](_0x3f0e('0x8e'));}if(_[_0x3f0e('0x75')](_0x535b63[_0x3f0e('0x50')][_0x3f0e('0x50')])||_0x535b63[_0x3f0e('0x50')]['body']===''){throw new db[(_0x3f0e('0x86'))][(_0x3f0e('0x8d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x535b63[_0x3f0e('0x50')]['mapKey'])){throw new db[(_0x3f0e('0x86'))][(_0x3f0e('0x8d'))](_0x3f0e('0x8f')+_0x224a28);}if(!_[_0x3f0e('0x90')](_0x224a28,_0x535b63[_0x3f0e('0x50')][_0x3f0e('0x91')])){throw new db[(_0x3f0e('0x86'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x224a28);}_0x39d5f5[_0x535b63[_0x3f0e('0x50')][_0x3f0e('0x91')]]=_0x535b63[_0x3f0e('0x50')]['from'];})['then'](function(){return db[_0x3f0e('0x33')][_0x3f0e('0x4e')]({'where':{'id':_0x535b63[_0x3f0e('0x4a')]['id']},'include':[{'model':db[_0x3f0e('0x92')],'as':_0x3f0e('0x93'),'include':[{'model':db['CmContact'],'as':_0x3f0e('0x94'),'where':_0x39d5f5,'limit':0x1,'order':[[_0x3f0e('0x8a'),_0x3f0e('0x95')]]}]},{'model':db[_0x3f0e('0x96')],'as':'Applications'}]});})[_0x3f0e('0x17')](handleEntityNotFound(_0x3ab285,null))[_0x3f0e('0x17')](function(_0x107fe1){if(_0x107fe1&&_0x107fe1[_0x3f0e('0x93')]){_0x3505cd['account']=_0x107fe1;_0x3505cd['applications']=_0x107fe1[_0x3f0e('0x97')];_0x3505cd[_0x3f0e('0x98')]=_0x107fe1['List'];_0x3505cd[_0x3f0e('0x99')]=_[_0x3f0e('0x9a')](_0x3505cd[_0x3f0e('0x99')],['priority'],['asc']);if(_0x3505cd[_0x3f0e('0x9b')][_0x3f0e('0x97')]){delete _0x3505cd[_0x3f0e('0x9b')][_0x3f0e('0x97')];}if(_0x3505cd[_0x3f0e('0x9b')][_0x3f0e('0x93')]&&_0x3505cd[_0x3f0e('0x9b')][_0x3f0e('0x93')][_0x3f0e('0x94')][_0x3f0e('0x4b')]){return _0x3505cd[_0x3f0e('0x9b')][_0x3f0e('0x93')][_0x3f0e('0x94')][0x0];}var _0xee4ed6=_['defaults'](_0x535b63['body'],{'firstName':_0x535b63[_0x3f0e('0x50')][_0x3f0e('0x8c')],'ListId':_0x107fe1[_0x3f0e('0x9c')]});_0xee4ed6[_0x535b63[_0x3f0e('0x50')][_0x3f0e('0x91')]]=_0x535b63[_0x3f0e('0x50')]['from'];return db[_0x3f0e('0x85')][_0x3f0e('0x4f')](_0xee4ed6,{'fields':_0x10d9cb,'raw':!![]});}})[_0x3f0e('0x17')](handleEntityNotFound(_0x3ab285,null))[_0x3f0e('0x17')](function(_0x3176c6){_0x3505cd[_0x3f0e('0x9d')]=_0x3176c6;var _0x25b031=_0x535b63[_0x3f0e('0x50')]['customerIp'];if(_0x535b63[_0x3f0e('0x81')]['cf-connecting-ip']){_0x25b031=_0x535b63['headers'][_0x3f0e('0x9e')];}else if(_0x535b63[_0x3f0e('0x81')][_0x3f0e('0x9f')]){_0x25b031=_[_0x3f0e('0xa0')](_0x535b63[_0x3f0e('0x81')]['x-forwarded-for']['split'](','));}if(_0x3176c6){var _0x27a111={'ContactId':_0x3176c6['id'],'ChatWebsiteId':_0x535b63[_0x3f0e('0x4a')]['id'],'from':(_0x3176c6[_0x3f0e('0xa1')]||'')+'\x20'+(_0x3176c6[_0x3f0e('0xa2')]||''),'customerIp':_0x25b031,'customerPort':_0x535b63[_0x3f0e('0x81')]['x-real-port']?_0x535b63[_0x3f0e('0x81')][_0x3f0e('0xa3')]:null,'referer':_0x535b63[_0x3f0e('0x50')][_0x3f0e('0xa4')],'browserName':_0x28aa00[_0x3f0e('0xa5')]['name']&&_0x28aa00[_0x3f0e('0xa5')][_0x3f0e('0xa6')]?util[_0x3f0e('0xa7')](_0x3f0e('0xa8'),_0x28aa00[_0x3f0e('0xa5')][_0x3f0e('0x2d')],_0x28aa00[_0x3f0e('0xa5')][_0x3f0e('0xa6')]):_0x3f0e('0xa9'),'browserVersion':_0x28aa00['browser'][_0x3f0e('0xa6')]||_0x3f0e('0xa9'),'osName':util[_0x3f0e('0xa7')](_0x3f0e('0xa8'),_0x28aa00['os']['name'],_0x28aa00['os'][_0x3f0e('0xa6')]),'osVersion':_0x28aa00['os']['version'],'deviceModel':_0x28aa00['device'][_0x3f0e('0x37')]&&_0x28aa00[_0x3f0e('0xaa')]['vendor']?util[_0x3f0e('0xa7')](_0x3f0e('0xab'),_0x28aa00[_0x3f0e('0xaa')][_0x3f0e('0x37')],_0x28aa00['device'][_0x3f0e('0xac')],_0x28aa00[_0x3f0e('0xaa')][_0x3f0e('0xad')]):null,'deviceVendor':_0x28aa00[_0x3f0e('0xaa')][_0x3f0e('0xac')],'deviceType':_0x28aa00[_0x3f0e('0xaa')][_0x3f0e('0xad')],'formData':JSON[_0x3f0e('0x1c')](_0x535b63[_0x3f0e('0x50')])};var _0x508695={'ChatWebsiteId':_0x535b63[_0x3f0e('0x4a')]['id'],'closed':![]};if(_0x535b63['body'][_0x3f0e('0xae')]){_0x508695[_0x3f0e('0xae')]=_0x535b63['body'][_0x3f0e('0xae')];return db[_0x3f0e('0xaf')]['find']({'where':_0x508695})[_0x3f0e('0x17')](function(_0x54644e){if(_0x54644e){return[_0x54644e,![]];}_0x27a111[_0x3f0e('0xae')]=_0x535b63[_0x3f0e('0x50')]['threadId'];_0x27a111[_0x3f0e('0xb0')]=_0x535b63['body'][_0x3f0e('0xb0')];return db['ChatInteraction'][_0x3f0e('0x4f')](_0x27a111)[_0x3f0e('0x17')](function(_0x49b5b8){return[_0x49b5b8,!![]];});});}_0x508695['ContactId']=_0x3176c6['id'];if(_0x535b63[_0x3f0e('0x50')][_0x3f0e('0xb1')]&&_0x535b63['body'][_0x3f0e('0xb1')]['id']){_0x508695['id']=_0x535b63['body'][_0x3f0e('0xb1')]['id'];return db[_0x3f0e('0xaf')][_0x3f0e('0x4e')]({'where':_0x508695})['then'](function(_0x543565){if(_0x543565){return[_0x543565,![]];}return db[_0x3f0e('0xaf')]['create'](_0x27a111)[_0x3f0e('0x17')](function(_0x45b0c8){return[_0x45b0c8,!![]];});});}return db['ChatInteraction'][_0x3f0e('0x4f')](_0x27a111)['then'](function(_0x293aab){return[_0x293aab,!![]];});}})[_0x3f0e('0xb2')](function(_0x250db3,_0x7b5352){if(_0x250db3){_0x124eca=_0x7b5352;if(!_0x7b5352){var _0x406804={'from':(_0x3505cd[_0x3f0e('0x9d')][_0x3f0e('0xa1')]||'')+'\x20'+(_0x3505cd[_0x3f0e('0x9d')][_0x3f0e('0xa2')]||'')};if(_0x535b63[_0x3f0e('0x50')][_0x3f0e('0xae')]&&_0x535b63[_0x3f0e('0x50')][_0x3f0e('0xb3')]&&_0x535b63[_0x3f0e('0x50')][_0x3f0e('0xae')]!=_0x535b63['body'][_0x3f0e('0xb3')]){_0x406804[_0x3f0e('0xae')]=_0x535b63[_0x3f0e('0x50')][_0x3f0e('0xb3')];}return _0x250db3[_0x3f0e('0x2a')](_0x406804);}else{return _0x250db3;}}})['then'](function(_0x19e454){_0x3505cd['interaction']=_0x19e454[_0x3f0e('0x53')]({'plain':!![]});_0x3505cd[_0x3f0e('0xb1')]['created']=_0x124eca;if(_0x3505cd['interaction']['created']){if(_0x3505cd[_0x3f0e('0x9b')]['autoclose']){_0x3505cd[_0x3f0e('0x99')][_0x3f0e('0xb4')]({'id':0x0,'priority':_0x3505cd[_0x3f0e('0x99')][_0x3f0e('0x4b')]+0x1,'app':_0x3f0e('0xb5'),'appdata':_0x3f0e('0xb6'),'interval':_0x3f0e('0xb7')});}}return db[_0x3f0e('0xb8')][_0x3f0e('0x4f')]({'body':_0x535b63[_0x3f0e('0x50')]['body'],'ChatWebsiteId':_0x535b63['params']['id'],'ChatInteractionId':_0x19e454['id'],'direction':'in','ContactId':_0x3505cd[_0x3f0e('0x9d')]['id'],'AttachmentId':_0x535b63[_0x3f0e('0x50')]['AttachmentId']});})[_0x3f0e('0x17')](function(_0x3d21bf){_0x3505cd[_0x3f0e('0x20')]=_0x3d21bf;if(_0x3505cd[_0x3f0e('0xb1')][_0x3f0e('0xb9')]){return db['User'][_0x3f0e('0x4e')]({'attributes':['id',_0x3f0e('0x2d')],'where':{'id':_0x3505cd['interaction'][_0x3f0e('0xb9')]}})[_0x3f0e('0x17')](function(_0x121812){if(_0x121812){_0x3505cd['applications'][_0x3f0e('0xba')]({'id':0x0,'priority':0x0,'app':_0x3f0e('0xbb'),'appdata':_0x121812[_0x3f0e('0x2d')]+','+(_0x3505cd[_0x3f0e('0x9b')][_0x3f0e('0xbc')]||0xa),'interval':_0x3f0e('0xb7')});_0x3505cd[_0x3f0e('0xbd')]=!![];}return respondWithRpcPromise(_0x3f0e('0xbe'),'startRouting',_0x3505cd);});}return respondWithRpcPromise(_0x3f0e('0xbe'),_0x3f0e('0xbf'),_0x3505cd);})[_0x3f0e('0x17')](function(_0x4aac10){respondWithRpcPromise(_0x3f0e('0xc0'),_0x3f0e('0xc0'),{'event':_0x3f0e('0x7f'),'message':_0x4aac10},client9002);return _0x4aac10;})['then'](respondWithResult(_0x3ab285,null))[_0x3f0e('0x21')](handleError(_0x3ab285,null));};exports[_0x3f0e('0xc1')]=function(_0x293b3c,_0x57bd65){var _0x36615f,_0x86b336,_0x3337b3;var _0x1b0d4f=[];var _0x28f190={};var _0x872715=_0x293b3c[_0x3f0e('0xc2')]||[];var _0x27b1f6=[];var _0x16a005;return db[_0x3f0e('0x85')][_0x3f0e('0x59')]()['then'](function(_0x1c3f82){if(!_0x1c3f82){throw new db[(_0x3f0e('0x86'))][(_0x3f0e('0x8d'))](_0x3f0e('0x87'));}_0x1b0d4f=_[_0x3f0e('0x88')](_['keys'](_0x1c3f82),[_0x3f0e('0x89'),_0x3f0e('0x8a'),'CompanyId',_0x3f0e('0x9c')]);if(_0x293b3c[_0x3f0e('0x50')]['id']){delete _0x293b3c[_0x3f0e('0x50')]['id'];}if(_['isNil'](_0x293b3c[_0x3f0e('0x50')][_0x3f0e('0x8c')])){throw _0x57bd65['status'](0x1f4)[_0x3f0e('0x2e')](new db[(_0x3f0e('0x86'))][(_0x3f0e('0x8d'))]('from\x20is\x20mandatory'));}if(_[_0x3f0e('0x75')](_0x293b3c[_0x3f0e('0x50')]['body'])||_0x293b3c[_0x3f0e('0x50')][_0x3f0e('0x50')]===''){throw _0x57bd65[_0x3f0e('0x23')](0x1f4)[_0x3f0e('0x2e')](new db['Sequelize'][(_0x3f0e('0x8d'))](_0x3f0e('0xc3')));}if(_[_0x3f0e('0x75')](_0x293b3c[_0x3f0e('0x50')][_0x3f0e('0xc4')])){throw _0x57bd65[_0x3f0e('0x23')](0x1f4)['send'](new db[(_0x3f0e('0x86'))]['ValidationError'](_0x3f0e('0xc5')+_0x1b0d4f));}if(!_[_0x3f0e('0x90')](_0x1b0d4f,_0x293b3c[_0x3f0e('0x50')][_0x3f0e('0xc4')])){throw _0x57bd65['status'](0x1f4)[_0x3f0e('0x2e')](new db[(_0x3f0e('0x86'))][(_0x3f0e('0x8d'))](_0x3f0e('0xc6')+_0x1b0d4f));}_0x28f190[_0x293b3c[_0x3f0e('0x50')]['mapKeyOffline']]=_0x293b3c[_0x3f0e('0x50')][_0x3f0e('0x8c')];})[_0x3f0e('0x17')](function(){return db[_0x3f0e('0x33')][_0x3f0e('0x4e')]({'where':{'id':_0x293b3c['params']['id']},'include':[{'model':db[_0x3f0e('0x92')],'as':_0x3f0e('0x93')},{'model':db[_0x3f0e('0xc7')],'as':_0x3f0e('0xc7')}]});})['then'](handleEntityNotFound(_0x57bd65,null))[_0x3f0e('0x17')](function(_0x409904){if(_0x409904&&_0x409904['List']){_0x86b336=_0x409904;var _0x811365=_[_0x3f0e('0xc')](_0x293b3c['body'],{'firstName':_0x293b3c['body'][_0x3f0e('0x8c')],'phone':_0x293b3c[_0x3f0e('0x50')]['from'],'ListId':_0x409904[_0x3f0e('0x9c')]});_0x811365[_0x293b3c[_0x3f0e('0x50')]['mapKeyOffline']]=_0x293b3c[_0x3f0e('0x50')][_0x3f0e('0x8c')];return db[_0x3f0e('0x85')][_0x3f0e('0xc8')]({'where':_0x28f190,'defaults':_0x811365});}})[_0x3f0e('0xb2')](function(_0x19054a){if(_0x19054a){_0x3337b3=_0x19054a;var _0x57b432=fs['readFileSync'](path['join'](config[_0x3f0e('0x78')],_0x3f0e('0xc9')),_0x3f0e('0xca'));var _0x5693fa=ejs[_0x3f0e('0xcb')](_0x57b432,{'body':_[_0x3f0e('0xcc')](_0x293b3c[_0x3f0e('0x50')]['body']),'bodyTitle':_0x86b336['offlineMessageBody']});return db[_0x3f0e('0xcd')][_0x3f0e('0x4f')]({'body':_0x5693fa,'plainBody':htmlToText['fromString'](_0x5693fa),'ContactId':_0x19054a['id'],'ChatWebsiteId':_0x86b336['id']});}})[_0x3f0e('0x17')](function(_0x575261){_0x16a005=_0x575261;if(_0x872715[_0x3f0e('0x4b')]){var _0x10aa9d=_0x872715[_0x3f0e('0x32')](function(_0x160b02){return{'name':_0x160b02[_0x3f0e('0xce')],'basename':_0x160b02[_0x3f0e('0x69')],'type':_0x160b02[_0x3f0e('0xcf')],'ChatOfflineMessageId':_0x575261['id']};});_0x27b1f6=_0x10aa9d['map'](_0x558ccf=>{var _0x3757e8={'filename':_0x558ccf['name'],'path':path['join'](config[_0x3f0e('0x78')],_0x3f0e('0xd0'),_0x3f0e('0xc2'),'attachments',_0x3f0e('0xd1'),_0x558ccf[_0x3f0e('0xd2')])};return _0x3757e8;});if(!_0x86b336[_0x3f0e('0xd3')]){return db[_0x3f0e('0xd4')][_0x3f0e('0xd5')](function(_0x3874b5){return db[_0x3f0e('0xd6')][_0x3f0e('0xd7')](_0x10aa9d,{'transaction':_0x3874b5});});}}})[_0x3f0e('0x17')](function(){if(_0x16a005){_0x36615f=_0x16a005;return db[_0x3f0e('0xc7')][_0x3f0e('0x5d')]({'where':{'service':!![]},'include':[{'model':db[_0x3f0e('0xd8')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x3f0e('0xd9')],'as':_0x3f0e('0xd9'),'raw':!![]}]}]});}})[_0x3f0e('0x17')](function(_0x23428c){if(_0x23428c&&_0x23428c['Smtp']&&_0x86b336[_0x3f0e('0xda')]&&_0x86b336[_0x3f0e('0xdb')]){var _0x4eed42=_0x23428c[_0x3f0e('0xdc')]();return respondWithRpcPromise(_0x3f0e('0xdd'),_0x3f0e('0xde'),{'account':_0x4eed42,'message':{'from':util[_0x3f0e('0xa7')](_0x3f0e('0xdf'),_0x23428c[_0x3f0e('0x2d')],_0x23428c[_0x3f0e('0xe0')]||_0x23428c[_0x3f0e('0xe1')][_0x3f0e('0x51')]),'to':_0x86b336['forwardOfflineAddress'],'subject':_0x86b336[_0x3f0e('0xe2')],'html':_0x36615f[_0x3f0e('0x50')],'attachments':_0x27b1f6}},client9003)[_0x3f0e('0x17')](function(){return _0x36615f;})[_0x3f0e('0x21')](function(_0x33da79){logger[_0x3f0e('0x1d')](_0x33da79);});}})[_0x3f0e('0x17')](function(){if(_0x86b336&&_0x86b336['openNewInteraction']&&_0x86b336['MailAccountId']){var _0x304cf6=[];if(_0x872715[_0x3f0e('0x4b')]){_0x304cf6=_0x872715[_0x3f0e('0x32')](function(_0x582a53){return{'name':_0x582a53[_0x3f0e('0xce')],'basename':_0x582a53['filename'],'type':_0x582a53[_0x3f0e('0xcf')],'ChatOfflineMessageId':_0x16a005['id']};});}var _0x191adb;if(!_[_0x3f0e('0x75')](_0x86b336[_0x3f0e('0xe3')])){var _0x5afd11=_[_0x3f0e('0x32')](_0x293b3c[_0x3f0e('0x50')],function(_0x47ec5e){return _0x47ec5e;});var _0x5386ce=_['toPairsIn'](_0x5afd11)[0x0];var _0x3c2c2d=_[_0x3f0e('0xe4')](_0x5386ce,function(_0x8b301c){return _0x8b301c;});_0x191adb=_0x3c2c2d[0x1][_0x86b336[_0x3f0e('0xe3')]];}var _0x495929={'from':_0x3337b3[_0x3f0e('0xe0')],'firstName':_0x3337b3['firstName'],'lastName':_0x3337b3['lastName'],'mapKey':_0x3f0e('0xe0'),'message':{'from':_0x3337b3[_0x3f0e('0xe0')],'to':_0x86b336[_0x3f0e('0xc7')][_0x3f0e('0xe0')],'cc':'','subject':_[_0x3f0e('0x75')](_0x191adb)?_0x86b336[_0x3f0e('0xe2')]:_0x191adb,'messageId':'','sentAt':new Date(),'attach':_0x304cf6[_0x3f0e('0x4b')],'attachments':_0x304cf6,'originChannel':_0x3f0e('0xe5'),'ChatWebsiteId':_0x86b336['id'],'ChatOfflineMessageId':_0x36615f['id'],'originTo':_0x86b336['MailAccount'][_0x3f0e('0xe0')]},'body':_0x36615f[_0x3f0e('0x50')]};var _0x14084d={'account':{'id':_0x86b336[_0x3f0e('0xe6')]},'body':_0x495929,'log':_0x3f0e('0xe7')};return respondWithRpcPromise(_0x3f0e('0xe7'),_0x3f0e('0xe8'),_0x14084d,client9001)[_0x3f0e('0x17')](function(){return _0x36615f;})[_0x3f0e('0x21')](function(_0x407c00){logger[_0x3f0e('0x1d')](_0x407c00);});}return;})[_0x3f0e('0x17')](function(){if(_0x36615f){return _0x36615f;}})['then'](respondWithResult(_0x57bd65,null))[_0x3f0e('0x21')](function(_0x5b2c34){logger[_0x3f0e('0x1d')](_0x3f0e('0x21'),_0x5b2c34);for(var _0x27e153 of _0x872715){var _0x63cf7d=path[_0x3f0e('0x71')](config[_0x3f0e('0x78')],_0x3f0e('0xd0'),_0x3f0e('0xc2'),_0x3f0e('0xe9'),_0x3f0e('0xd1'),_0x27e153[_0x3f0e('0x69')]);fs_extra[_0x3f0e('0xea')](_0x63cf7d)['catch'](function(_0x1dcf8d){logger['error'](_0x3f0e('0xeb'),_0x63cf7d,_0x1dcf8d);});}});};exports[_0x3f0e('0xec')]=function(_0x453683,_0x53a77f){return db[_0x3f0e('0xaf')][_0x3f0e('0x4e')]({'where':{'id':_0x453683[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x53a77f,null))[_0x3f0e('0x17')](function(_0x2645c8){if(_0x2645c8){return _0x2645c8[_0x3f0e('0xec')](_0x453683[_0x3f0e('0x50')][_0x3f0e('0x61')],_['omit'](_0x453683[_0x3f0e('0x50')],['ids','id'])||{});}})[_0x3f0e('0x17')](respondWithResult(_0x53a77f,null))['catch'](handleError(_0x53a77f,null));};exports[_0x3f0e('0xed')]=function(_0x27895e,_0x68dcec){var _0x5df10c={'raw':![],'where':{}};var _0x381894={};var _0x21fa19={'count':0x0,'rows':[]};return db[_0x3f0e('0x33')][_0x3f0e('0x5d')]({'where':{'id':_0x27895e[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x68dcec,null))['then'](function(_0x383b42){if(_0x383b42){_0x381894[_0x3f0e('0x37')]=_['keys'](db['ChatInteraction'][_0x3f0e('0x34')]);_0x381894[_0x3f0e('0x38')]=_[_0x3f0e('0x39')](_0x27895e['query']);_0x381894['filters']=_['intersection'](_0x381894[_0x3f0e('0x37')],_0x381894['query']);_0x5df10c[_0x3f0e('0x3b')]=_[_0x3f0e('0x3a')](_0x381894[_0x3f0e('0x37')],qs['fields'](_0x27895e[_0x3f0e('0x38')][_0x3f0e('0x3c')]));_0x5df10c[_0x3f0e('0x3b')]=_0x5df10c[_0x3f0e('0x3b')][_0x3f0e('0x4b')]?_0x5df10c['attributes']:_0x381894['model'];if(!_0x27895e[_0x3f0e('0x38')][_0x3f0e('0x3d')](_0x3f0e('0x3e'))){_0x5df10c[_0x3f0e('0x26')]=qs['limit'](_0x27895e['query'][_0x3f0e('0x26')]);_0x5df10c[_0x3f0e('0x3f')]=qs[_0x3f0e('0x3f')](_0x27895e[_0x3f0e('0x38')][_0x3f0e('0x3f')]);}_0x5df10c['order']=qs['sort'](_0x27895e['query']['sort']);_0x5df10c[_0x3f0e('0x41')]=qs[_0x3f0e('0x42')](_[_0x3f0e('0x43')](_0x27895e[_0x3f0e('0x38')],_0x381894[_0x3f0e('0x42')]));_0x5df10c['where'][_0x3f0e('0x5f')]=_0x383b42['id'];if(_0x27895e[_0x3f0e('0x38')][_0x3f0e('0x44')]){_0x5df10c[_0x3f0e('0x41')]=_[_0x3f0e('0x45')](_0x5df10c[_0x3f0e('0x41')],{'$or':_['map'](_0x5df10c['attributes'],function(_0x2960a5){var _0x509ce4={};_0x509ce4[_0x2960a5]={'$like':'%'+_0x27895e[_0x3f0e('0x38')]['filter']+'%'};return _0x509ce4;})});}_0x5df10c=_['merge']({},_0x5df10c,_0x27895e[_0x3f0e('0x46')]);return db[_0x3f0e('0xaf')][_0x3f0e('0x27')]({'where':_0x5df10c[_0x3f0e('0x41')]})[_0x3f0e('0x17')](function(_0x358375){_0x21fa19[_0x3f0e('0x27')]=_0x358375;if(_0x27895e['query'][_0x3f0e('0x4c')]){_0x5df10c[_0x3f0e('0x4d')]=[{'model':db[_0x3f0e('0x85')],'as':_0x3f0e('0xee'),'required':![]},{'model':db['User'],'as':_0x3f0e('0xef'),'attributes':['name',_0x3f0e('0xf0'),_0x3f0e('0xf1')],'required':![]},{'model':db[_0x3f0e('0xf2')],'as':_0x3f0e('0xf3'),'attributes':['id',_0x3f0e('0x2d'),_0x3f0e('0xf4')],'where':_0x27895e[_0x3f0e('0x38')]['tag']?{'id':_0x27895e[_0x3f0e('0x38')][_0x3f0e('0xf5')]}:undefined,'required':_0x27895e[_0x3f0e('0x38')][_0x3f0e('0xf5')]?!![]:![]}];}return db[_0x3f0e('0xaf')][_0x3f0e('0x47')](_0x5df10c);})['then'](function(_0x3042de){_0x21fa19[_0x3f0e('0x48')]=_0x3042de;return _0x21fa19;});}})[_0x3f0e('0x17')](respondWithFilteredResult(_0x68dcec,_0x5df10c))[_0x3f0e('0x21')](handleError(_0x68dcec,null));};function iftimePromise(_0x1f0b1c,_0x4dae6e){return respondWithRpcPromise(_0x3f0e('0xf6'),_0x3f0e('0xf7'),{'command':_0x4dae6e[_0x3f0e('0xf8')]?util[_0x3f0e('0xa7')]('iftime\x20%s,%s',_0x1f0b1c[_0x3f0e('0xf9')],_0x4dae6e[_0x3f0e('0xf8')]):util[_0x3f0e('0xa7')]('iftime\x20%s',_0x1f0b1c[_0x3f0e('0xf9')])},client9002)[_0x3f0e('0x17')](function(_0x570b4b){var _0x105436=_0x570b4b&&_0x570b4b['indexOf']('true')>=0x0?!![]:![];logger[_0x3f0e('0x18')](_0x3f0e('0xfa'),_0x4dae6e['id'],_0x1f0b1c['id'],_0x1f0b1c[_0x3f0e('0xf9')],_0x105436?_0x3f0e('0xfb'):_0x3f0e('0xfc'),_0x4dae6e[_0x3f0e('0xf8')]?_0x4dae6e[_0x3f0e('0xf8')]:_0x3f0e('0xfd'));return _0x105436;})[_0x3f0e('0x21')](function(_0x2f972c){logger[_0x3f0e('0x1d')](_0x3f0e('0xfa'),_0x4dae6e['id'],_0x1f0b1c['id'],_0x1f0b1c[_0x3f0e('0xf9')],util[_0x3f0e('0xfe')](_0x2f972c,{'showHidden':![],'depth':null}),_0x4dae6e[_0x3f0e('0xf8')]?_0x4dae6e[_0x3f0e('0xf8')]:'No\x20timezone');return![];});}exports[_0x3f0e('0xf7')]=function(_0x39a475,_0x3d4968){var _0x53314b=0x0;var _0x3b44fc=0x0;var _0x4d776c=![];var _0x355c04;var _0x241dba;return db[_0x3f0e('0x33')]['find']({'where':{'id':_0x39a475[_0x3f0e('0x4a')]['id']},'include':[{'model':db[_0x3f0e('0xff')],'as':'Interval','include':[{'model':db['Interval'],'as':_0x3f0e('0x100'),'attributes':['id',_0x3f0e('0xf9')],'raw':!![]}]}]})[_0x3f0e('0x17')](handleEntityNotFound(_0x3d4968,null))['then'](function(_0x54e1f4){if(_0x54e1f4){_0x355c04=_0x54e1f4;return _0x54e1f4[_0x3f0e('0x101')]({'raw':!![]});}})[_0x3f0e('0x17')](function(_0xc3c904){if(_0x355c04){if(_0xc3c904){_0x241dba=_0xc3c904;}}return require(_0x3f0e('0x73'))[_0x3f0e('0x102')]();})['then'](function(_0x213cd1){if(_0x213cd1){_0x3b44fc=_0x213cd1['virtual'];_0x4d776c=_0x213cd1['custom'];}})[_0x3f0e('0x17')](function(){return db[_0x3f0e('0xaf')][_0x3f0e('0x27')]({'where':{'closed':![]}});})['then'](function(_0x4e8789){_0x53314b=_0x4e8789;if(_0x3b44fc&&_0x4e8789>_0x3b44fc){return db['License'][_0x3f0e('0x5d')]({'where':{'id':0x1}})[_0x3f0e('0x17')](function(_0xe3aef1){if(_0xe3aef1){_0xe3aef1['increment'](_0x3f0e('0x103'));}});}})['then'](function(){if(_0x355c04[_0x3f0e('0xff')]&&_0x355c04[_0x3f0e('0xff')]['Intervals']){var _0x142c1d=[];for(var _0x244c8d=0x0;_0x244c8d<_0x355c04[_0x3f0e('0xff')][_0x3f0e('0x100')][_0x3f0e('0x4b')];_0x244c8d++){var _0x2a88b3=_0x355c04[_0x3f0e('0xff')][_0x3f0e('0x100')][_0x244c8d]['get']({'plain':!![]});_0x142c1d[_0x3f0e('0xb4')](iftimePromise(_0x2a88b3,_0x355c04));}return BPromise[_0x3f0e('0x104')](_0x142c1d)[_0x3f0e('0x17')](function(_0x34e60c){return _['some'](_0x34e60c);});}else{return!![];}})[_0x3f0e('0x17')](function(_0xfe75ad){var _0x4d2d0b=fs[_0x3f0e('0x105')](path[_0x3f0e('0x71')](config[_0x3f0e('0x78')],_0x3f0e('0x106')),_0x3f0e('0xca'));var _0x48269a={'remote':_0x355c04[_0x3f0e('0x107')],'query':querystring[_0x3f0e('0x1c')](_[_0x3f0e('0x45')](_0x355c04[_0x3f0e('0x53')]({'plain':!![]}),{'customerIp':_0x39a475[_0x3f0e('0x81')][_0x3f0e('0x9f')]||_0x39a475[_0x3f0e('0x81')]['x-real-ip']||_0x39a475['connection'][_0x3f0e('0x108')]||_0x39a475['ip'],'referer':_0x39a475['headers'][_0x3f0e('0xa4')],'openedInteractions':_0x53314b,'maxInteractions':_0x3b44fc,'virtual':_0x4d776c[_0x3f0e('0x109')],'online':_0xfe75ad,'custom':_0x4d776c}))[_0x3f0e('0x10a')](/'/g,'\x5c\x27')};_0x3d4968[_0x3f0e('0x2e')](ejs[_0x3f0e('0xcb')](Mustache[_0x3f0e('0xcb')](_0x4d2d0b,_0x48269a),{'proactiveActions':_0x241dba,'alignment':_0x355c04[_0x3f0e('0x10b')],'verticalAlignment':_0x355c04[_0x3f0e('0x10c')],'div_color':_0x355c04[_0x3f0e('0xf4')],'labelText':_0x355c04[_0x3f0e('0x10d')],'text_color':_0x355c04[_0x3f0e('0x10e')],'text_button_color':_0x355c04[_0x3f0e('0x10f')],'button_color':_0x355c04[_0x3f0e('0x110')],'background_color':_0x355c04[_0x3f0e('0x111')],'hideWhenOffline':_0x355c04[_0x3f0e('0x112')],'interval':_0x355c04[_0x3f0e('0x113')]}));})['catch'](handleError(_0x3d4968,null));};exports[_0x3f0e('0x114')]=function(_0x3a7d13,_0x5b1c42){var _0x66bc46=_0x3a7d13[_0x3f0e('0x4a')]['id'];var _0x34d584=_0x3a7d13[_0x3f0e('0x50')];var _0x3d555f=0xc8;var _0x3827dd=null;return db[_0x3f0e('0xd4')][_0x3f0e('0xd5')]({'isolationLevel':db['sequelize']['Transaction'][_0x3f0e('0x115')][_0x3f0e('0x116')]},function(_0x4e29e7){return db[_0x3f0e('0x33')][_0x3f0e('0x5d')]({'where':{'id':_0x66bc46},'transaction':_0x4e29e7})[_0x3f0e('0x17')](function(_0x1a6dfa){if(_0x1a6dfa){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x66bc46},'transaction':_0x4e29e7})['then'](function(){var _0x2f5515=_['map'](_0x34d584,function(_0xe54bbe){_0xe54bbe[_0x3f0e('0x5f')]=_0x66bc46;return _0xe54bbe;});return db[_0x3f0e('0x96')]['bulkCreate'](_0x2f5515,{'transaction':_0x4e29e7});});}else{_0x3d555f=0x194;_0x3827dd=[];}});})['then'](function(){if(_0x3d555f!==0x194){return db[_0x3f0e('0x96')][_0x3f0e('0x117')]({'where':{'ChatWebsiteId':_0x66bc46},'order':_0x3f0e('0x118')})[_0x3f0e('0x17')](function(_0x5b1cec){_0x3827dd=_0x5b1cec;});}})[_0x3f0e('0x21')](function(_0x1964b4){_0x3d555f=0x1f4;logger['error'](_0x1964b4['stack']);if(_0x1964b4[_0x3f0e('0x2d')]){delete _0x1964b4[_0x3f0e('0x2d')];}_0x3827dd=_0x1964b4;})['finally'](function(){if(_0x3827dd===null){_0x5b1c42['sendStatus'](_0x3d555f);}else{if(_0x3d555f===0x1f4){_0x5b1c42['status'](_0x3d555f)[_0x3f0e('0x2e')](_0x3827dd);}else{_0x5b1c42[_0x3f0e('0x23')](_0x3d555f)[_0x3f0e('0x24')](_0x3827dd);}}});};exports[_0x3f0e('0x119')]=function(_0x49a055,_0x4a1b63){var _0x45e8ae={};var _0x3a8856={};var _0x26016c;var _0x2fd9a5;return db['ChatWebsite'][_0x3f0e('0x5d')]({'where':{'id':_0x49a055[_0x3f0e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4a1b63,null))['then'](function(_0x520ddd){if(_0x520ddd){_0x26016c=_0x520ddd;_0x3a8856['model']=_[_0x3f0e('0x39')](db[_0x3f0e('0x96')][_0x3f0e('0x34')]);_0x3a8856[_0x3f0e('0x38')]=_[_0x3f0e('0x39')](_0x49a055[_0x3f0e('0x38')]);_0x3a8856['filters']=_[_0x3f0e('0x3a')](_0x3a8856[_0x3f0e('0x37')],_0x3a8856[_0x3f0e('0x38')]);_0x45e8ae['attributes']=_[_0x3f0e('0x3a')](_0x3a8856[_0x3f0e('0x37')],qs[_0x3f0e('0x3c')](_0x49a055[_0x3f0e('0x38')][_0x3f0e('0x3c')]));_0x45e8ae[_0x3f0e('0x3b')]=_0x45e8ae[_0x3f0e('0x3b')]['length']?_0x45e8ae[_0x3f0e('0x3b')]:_0x3a8856[_0x3f0e('0x37')];_0x45e8ae['order']=qs[_0x3f0e('0x40')](_0x49a055['query'][_0x3f0e('0x40')]);_0x45e8ae[_0x3f0e('0x41')]=qs['filters'](_[_0x3f0e('0x43')](_0x49a055['query'],_0x3a8856[_0x3f0e('0x42')]));if(_0x49a055[_0x3f0e('0x38')]['filter']){_0x45e8ae[_0x3f0e('0x41')]=_[_0x3f0e('0x45')](_0x45e8ae[_0x3f0e('0x41')],{'$or':_[_0x3f0e('0x32')](_0x45e8ae[_0x3f0e('0x3b')],function(_0x222a35){var _0xcc69e2={};_0xcc69e2[_0x222a35]={'$like':'%'+_0x49a055[_0x3f0e('0x38')][_0x3f0e('0x44')]+'%'};return _0xcc69e2;})});}_0x45e8ae=_[_0x3f0e('0x45')]({},_0x45e8ae,_0x49a055[_0x3f0e('0x46')]);return _0x26016c[_0x3f0e('0x119')](_0x45e8ae);}})[_0x3f0e('0x17')](function(_0x2d842e){if(_0x2d842e){_0x2fd9a5=_0x2d842e['length'];if(!_0x49a055['query'][_0x3f0e('0x3d')]('nolimit')){_0x45e8ae['limit']=qs[_0x3f0e('0x26')](_0x49a055[_0x3f0e('0x38')][_0x3f0e('0x26')]);_0x45e8ae[_0x3f0e('0x3f')]=qs[_0x3f0e('0x3f')](_0x49a055[_0x3f0e('0x38')][_0x3f0e('0x3f')]);}return _0x26016c[_0x3f0e('0x119')](_0x45e8ae);}})[_0x3f0e('0x17')](function(_0x4c563b){if(_0x4c563b){return _0x4c563b?{'count':_0x2fd9a5,'rows':_0x4c563b}:null;}})[_0x3f0e('0x17')](respondWithResult(_0x4a1b63,null))['catch'](handleError(_0x4a1b63,null));};exports[_0x3f0e('0x11a')]=function(_0x3e4d5f,_0x316ccc){return db['chatProactiveAction'][_0x3f0e('0x4e')]({'where':{'id':_0x3e4d5f[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x316ccc,null))[_0x3f0e('0x17')](function(_0x5df4b2){if(_0x5df4b2){return _0x5df4b2[_0x3f0e('0x11a')](_0x3e4d5f[_0x3f0e('0x50')][_0x3f0e('0x61')],_[_0x3f0e('0x11b')](_0x3e4d5f[_0x3f0e('0x50')],[_0x3f0e('0x61'),'id'])||{});}})[_0x3f0e('0x17')](respondWithResult(_0x316ccc,null))[_0x3f0e('0x21')](handleError(_0x316ccc,null));};exports[_0x3f0e('0x101')]=function(_0x3e8b2e,_0x5079ba){var _0x286cc4={};var _0x316002={};var _0x487d4;var _0x46d49b;return db['ChatWebsite'][_0x3f0e('0x5d')]({'where':{'id':_0x3e8b2e[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x5079ba,null))[_0x3f0e('0x17')](function(_0x35b652){if(_0x35b652){_0x487d4=_0x35b652;_0x316002[_0x3f0e('0x37')]=_[_0x3f0e('0x39')](db[_0x3f0e('0x11c')][_0x3f0e('0x34')]);_0x316002[_0x3f0e('0x38')]=_[_0x3f0e('0x39')](_0x3e8b2e['query']);_0x316002['filters']=_['intersection'](_0x316002[_0x3f0e('0x37')],_0x316002[_0x3f0e('0x38')]);_0x286cc4[_0x3f0e('0x3b')]=_[_0x3f0e('0x3a')](_0x316002[_0x3f0e('0x37')],qs['fields'](_0x3e8b2e[_0x3f0e('0x38')][_0x3f0e('0x3c')]));_0x286cc4['attributes']=_0x286cc4[_0x3f0e('0x3b')]['length']?_0x286cc4['attributes']:_0x316002[_0x3f0e('0x37')];_0x286cc4[_0x3f0e('0x5e')]=qs[_0x3f0e('0x40')](_0x3e8b2e[_0x3f0e('0x38')][_0x3f0e('0x40')]);_0x286cc4[_0x3f0e('0x41')]=qs[_0x3f0e('0x42')](_[_0x3f0e('0x43')](_0x3e8b2e[_0x3f0e('0x38')],_0x316002[_0x3f0e('0x42')]));if(_0x3e8b2e[_0x3f0e('0x38')][_0x3f0e('0x44')]){_0x286cc4[_0x3f0e('0x41')]=_[_0x3f0e('0x45')](_0x286cc4[_0x3f0e('0x41')],{'$or':_[_0x3f0e('0x32')](_0x286cc4[_0x3f0e('0x3b')],function(_0x991f61){var _0xde9d65={};_0xde9d65[_0x991f61]={'$like':'%'+_0x3e8b2e['query']['filter']+'%'};return _0xde9d65;})});}_0x286cc4=_[_0x3f0e('0x45')]({},_0x286cc4,_0x3e8b2e[_0x3f0e('0x46')]);return _0x487d4[_0x3f0e('0x101')](_0x286cc4);}})['then'](function(_0x121546){if(_0x121546){_0x46d49b=_0x121546[_0x3f0e('0x4b')];if(!_0x3e8b2e[_0x3f0e('0x38')][_0x3f0e('0x3d')]('nolimit')){_0x286cc4[_0x3f0e('0x26')]=qs[_0x3f0e('0x26')](_0x3e8b2e['query'][_0x3f0e('0x26')]);_0x286cc4['offset']=qs['offset'](_0x3e8b2e['query']['offset']);}return _0x487d4[_0x3f0e('0x101')](_0x286cc4);}})['then'](function(_0xf1d15){if(_0xf1d15){return _0xf1d15?{'count':_0x46d49b,'rows':_0xf1d15}:null;}})[_0x3f0e('0x17')](respondWithResult(_0x5079ba,null))[_0x3f0e('0x21')](handleError(_0x5079ba,null));};exports['getFields']=function(_0x3dfd42,_0xda697){var _0x286a01=_0x3dfd42[_0x3f0e('0x38')][_0x3f0e('0x11d')]==='false'?_0x3f0e('0x11e'):_0x3f0e('0x11f');return db[_0x3f0e('0x33')]['find']({'attributes':['id',_0x286a01],'where':{'id':_0x3dfd42[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0xda697,null))[_0x3f0e('0x17')](function(_0x40875a){if(_0x40875a){var _0x21d264=_0x40875a[_0x286a01];var _0x1f1cd4=_0x21d264&&_0x21d264[_0x3f0e('0x120')]?_0x21d264[_0x3f0e('0x120')]:[];_0xda697[_0x3f0e('0x2e')]({'fromKey':_['isNil'](_0x21d264['fromKey'])?undefined:_0x21d264[_0x3f0e('0x121')],'count':_0x1f1cd4[_0x3f0e('0x4b')],'rows':_0x1f1cd4});}})[_0x3f0e('0x21')](handleError(_0xda697,null));};exports[_0x3f0e('0x122')]=function(_0x386cf9,_0x220f76){var _0x193e09={'raw':![],'where':{}};var _0x47fe46={};var _0x306d02={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3f0e('0x5d')]({'where':{'id':_0x386cf9[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x220f76,null))[_0x3f0e('0x17')](function(_0x1e57d5){if(_0x1e57d5){_0x47fe46['model']=_[_0x3f0e('0x39')](db['ChatOfflineMessage']['rawAttributes']);_0x47fe46['query']=_[_0x3f0e('0x39')](_0x386cf9[_0x3f0e('0x38')]);_0x47fe46[_0x3f0e('0x42')]=_[_0x3f0e('0x3a')](_0x47fe46[_0x3f0e('0x37')],_0x47fe46[_0x3f0e('0x38')]);_0x193e09[_0x3f0e('0x3b')]=_[_0x3f0e('0x3a')](_0x47fe46[_0x3f0e('0x37')],qs[_0x3f0e('0x3c')](_0x386cf9['query']['fields']));_0x193e09[_0x3f0e('0x3b')]=_0x193e09[_0x3f0e('0x3b')][_0x3f0e('0x4b')]?_0x193e09['attributes']:_0x47fe46['model'];if(!_0x386cf9['query']['hasOwnProperty'](_0x3f0e('0x3e'))){_0x193e09[_0x3f0e('0x26')]=qs['limit'](_0x386cf9[_0x3f0e('0x38')][_0x3f0e('0x26')]);_0x193e09[_0x3f0e('0x3f')]=qs['offset'](_0x386cf9[_0x3f0e('0x38')]['offset']);}_0x193e09[_0x3f0e('0x5e')]=qs[_0x3f0e('0x40')](_0x386cf9[_0x3f0e('0x38')][_0x3f0e('0x40')]);_0x193e09[_0x3f0e('0x41')]=qs[_0x3f0e('0x42')](_[_0x3f0e('0x43')](_0x386cf9[_0x3f0e('0x38')],_0x47fe46[_0x3f0e('0x42')]));_0x193e09['where'][_0x3f0e('0x5f')]=_0x1e57d5['id'];if(_0x386cf9[_0x3f0e('0x38')][_0x3f0e('0x44')]){_0x193e09[_0x3f0e('0x41')]=_[_0x3f0e('0x45')](_0x193e09['where'],{'$or':_[_0x3f0e('0x32')](_0x193e09[_0x3f0e('0x3b')],function(_0x24a9cd){var _0x30cfa2={};_0x30cfa2[_0x24a9cd]={'$like':'%'+_0x386cf9[_0x3f0e('0x38')][_0x3f0e('0x44')]+'%'};return _0x30cfa2;})});}_0x193e09=_[_0x3f0e('0x45')]({},_0x193e09,_0x386cf9[_0x3f0e('0x46')]);return db[_0x3f0e('0xcd')][_0x3f0e('0x27')]({'where':_0x193e09[_0x3f0e('0x41')]})[_0x3f0e('0x17')](function(_0x4e424e){_0x306d02['count']=_0x4e424e;if(_0x386cf9[_0x3f0e('0x38')][_0x3f0e('0x4c')]){_0x193e09[_0x3f0e('0x4d')]=[{'all':!![]}];}else{_0x193e09['include']=[{'model':db[_0x3f0e('0x85')],'as':'Contact','required':![]},{'model':db[_0x3f0e('0xd6')],'as':_0x3f0e('0x123'),'required':![]}];}return db[_0x3f0e('0xcd')][_0x3f0e('0x47')](_0x193e09);})['then'](function(_0x5e3b02){_0x306d02['rows']=_0x5e3b02;return _0x306d02;});}})[_0x3f0e('0x17')](respondWithFilteredResult(_0x220f76,_0x193e09))[_0x3f0e('0x21')](handleError(_0x220f76,null));};exports['addAgents']=function(_0x20e42d,_0x537ece){return db[_0x3f0e('0x33')][_0x3f0e('0x4e')]({'where':{'id':_0x20e42d[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x537ece,null))[_0x3f0e('0x17')](function(_0x5d6479){if(_0x5d6479){return _0x5d6479[_0x3f0e('0x124')](_0x20e42d['body'][_0x3f0e('0x61')],_[_0x3f0e('0x11b')](_0x20e42d[_0x3f0e('0x50')],[_0x3f0e('0x61'),'id'])||{})[_0x3f0e('0xb2')](function(_0x96f5df){for(var _0x49171b=0x0;_0x49171b<_0x20e42d[_0x3f0e('0x50')][_0x3f0e('0x61')][_0x3f0e('0x4b')];_0x49171b+=0x1){socket[_0x3f0e('0x125')](_0x3f0e('0x126'),{'UserId':Number(_0x20e42d[_0x3f0e('0x50')][_0x3f0e('0x61')][_0x49171b]),'ChatWebsiteId':Number(_0x20e42d[_0x3f0e('0x4a')]['id'])});}return _0x96f5df;});}})[_0x3f0e('0x17')](respondWithResult(_0x537ece,null))[_0x3f0e('0x21')](handleError(_0x537ece,null));};exports[_0x3f0e('0x127')]=function(_0x12e715,_0x4b9bfe){return db[_0x3f0e('0x33')]['find']({'where':{'id':_0x12e715[_0x3f0e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4b9bfe,null))[_0x3f0e('0x17')](function(_0x2a7c0d){if(_0x2a7c0d){return _0x2a7c0d[_0x3f0e('0x127')](_0x12e715[_0x3f0e('0x38')][_0x3f0e('0x61')])['then'](function(){if(_[_0x3f0e('0x128')](_0x12e715[_0x3f0e('0x38')][_0x3f0e('0x61')])){for(var _0x11de73=0x0;_0x11de73<_0x12e715['query'][_0x3f0e('0x61')]['length'];_0x11de73+=0x1){socket['emit'](_0x3f0e('0x129'),{'UserId':Number(_0x12e715[_0x3f0e('0x38')][_0x3f0e('0x61')][_0x11de73]),'ChatWebsiteId':Number(_0x12e715[_0x3f0e('0x4a')]['id'])});}}else{socket[_0x3f0e('0x125')](_0x3f0e('0x129'),{'UserId':Number(_0x12e715[_0x3f0e('0x38')][_0x3f0e('0x61')]),'ChatWebsiteId':Number(_0x12e715[_0x3f0e('0x4a')]['id'])});}});}})[_0x3f0e('0x17')](respondWithStatusCode(_0x4b9bfe,null))[_0x3f0e('0x21')](handleError(_0x4b9bfe,null));};exports[_0x3f0e('0x12a')]=function(_0x2eb20e,_0x429564){var _0x4a5f2e={};var _0x340283={};var _0x3e9a3d;var _0x3c2d2e;return db[_0x3f0e('0x33')]['findOne']({'where':{'id':_0x2eb20e[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x429564,null))['then'](function(_0x522a76){if(_0x522a76){_0x3e9a3d=_0x522a76;_0x340283[_0x3f0e('0x37')]=_['keys'](db[_0x3f0e('0x12b')][_0x3f0e('0x34')]);_0x340283['query']=_[_0x3f0e('0x39')](_0x2eb20e['query']);_0x340283[_0x3f0e('0x42')]=_[_0x3f0e('0x3a')](_0x340283[_0x3f0e('0x37')],_0x340283[_0x3f0e('0x38')]);_0x4a5f2e[_0x3f0e('0x3b')]=_[_0x3f0e('0x3a')](_0x340283['model'],qs[_0x3f0e('0x3c')](_0x2eb20e[_0x3f0e('0x38')][_0x3f0e('0x3c')]));_0x4a5f2e[_0x3f0e('0x3b')]=_0x4a5f2e[_0x3f0e('0x3b')][_0x3f0e('0x4b')]?_0x4a5f2e['attributes']:_0x340283[_0x3f0e('0x37')];_0x4a5f2e[_0x3f0e('0x5e')]=qs[_0x3f0e('0x40')](_0x2eb20e['query'][_0x3f0e('0x40')]);_0x4a5f2e['where']=qs[_0x3f0e('0x42')](_['pick'](_0x2eb20e['query'],_0x340283[_0x3f0e('0x42')]));if(_0x2eb20e[_0x3f0e('0x38')][_0x3f0e('0x44')]){_0x4a5f2e[_0x3f0e('0x41')]=_['merge'](_0x4a5f2e[_0x3f0e('0x41')],{'$or':_['map'](_0x4a5f2e[_0x3f0e('0x3b')],function(_0x2eba2f){var _0x83bec9={};_0x83bec9[_0x2eba2f]={'$like':'%'+_0x2eb20e[_0x3f0e('0x38')][_0x3f0e('0x44')]+'%'};return _0x83bec9;})});}_0x4a5f2e=_['merge']({},_0x4a5f2e,_0x2eb20e['options']);return _0x3e9a3d['getAgents'](_0x4a5f2e);}})[_0x3f0e('0x17')](function(_0x1f86ca){if(_0x1f86ca){_0x3c2d2e=_0x1f86ca[_0x3f0e('0x4b')];if(!_0x2eb20e[_0x3f0e('0x38')]['hasOwnProperty'](_0x3f0e('0x3e'))){_0x4a5f2e['limit']=qs['limit'](_0x2eb20e[_0x3f0e('0x38')][_0x3f0e('0x26')]);_0x4a5f2e['offset']=qs[_0x3f0e('0x3f')](_0x2eb20e[_0x3f0e('0x38')][_0x3f0e('0x3f')]);}return _0x3e9a3d[_0x3f0e('0x12a')](_0x4a5f2e);}})[_0x3f0e('0x17')](function(_0x15088b){if(_0x15088b){return _0x15088b?{'count':_0x3c2d2e,'rows':_0x15088b}:null;}})[_0x3f0e('0x17')](respondWithResult(_0x429564,null))['catch'](handleError(_0x429564,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index be3fc28..91ae522 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 _0x8135=['exports','../../mysqldb','ChatWebsite','setMaxListeners','save','remove','hasOwnProperty','hook'];(function(_0x230c4d,_0x1d8484){var _0x160dc6=function(_0x26e91d){while(--_0x26e91d){_0x230c4d['push'](_0x230c4d['shift']());}};_0x160dc6(++_0x1d8484);}(_0x8135,0x99));var _0x5813=function(_0x1bbdd0,_0x398e88){_0x1bbdd0=_0x1bbdd0-0x0;var _0x499450=_0x8135[_0x1bbdd0];return _0x499450;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x5813('0x0'))['db'][_0x5813('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x5813('0x2')](0x0);var events={'afterCreate':_0x5813('0x3'),'afterUpdate':'update','afterDestroy':_0x5813('0x4')};function emitEvent(_0x196ea8){return function(_0xf23c29,_0x701689,_0x1c9b08){ChatWebsiteEvents['emit'](_0x196ea8+':'+_0xf23c29['id'],_0xf23c29);ChatWebsiteEvents['emit'](_0x196ea8,_0xf23c29);_0x1c9b08(null);};}for(var e in events){if(events[_0x5813('0x5')](e)){var event=events[e];ChatWebsite[_0x5813('0x6')](e,emitEvent(event));}}module[_0x5813('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x80ce=['save','remove','emit','hasOwnProperty','hook','exports','setMaxListeners'];(function(_0x5f60b3,_0x3895e0){var _0x4c7b1a=function(_0x43dd2c){while(--_0x43dd2c){_0x5f60b3['push'](_0x5f60b3['shift']());}};_0x4c7b1a(++_0x3895e0);}(_0x80ce,0xae));var _0xe80c=function(_0x3f03f2,_0x240034){_0x3f03f2=_0x3f03f2-0x0;var _0x522dfb=_0x80ce[_0x3f03f2];return _0x522dfb;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xe80c('0x0')](0x0);var events={'afterCreate':_0xe80c('0x1'),'afterUpdate':'update','afterDestroy':_0xe80c('0x2')};function emitEvent(_0x3efe49){return function(_0x4372b2,_0x57043c,_0x4cb700){ChatWebsiteEvents['emit'](_0x3efe49+':'+_0x4372b2['id'],_0x4372b2);ChatWebsiteEvents[_0xe80c('0x3')](_0x3efe49,_0x4372b2);_0x4cb700(null);};}for(var e in events){if(events[_0xe80c('0x4')](e)){var event=events[e];ChatWebsite[_0xe80c('0x5')](e,emitEvent(event));}}module[_0xe80c('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 959dd86..2212d37 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 _0xdc2d=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites'];(function(_0x1b159d,_0x12dc44){var _0x206b10=function(_0x2ae333){while(--_0x2ae333){_0x1b159d['push'](_0x1b159d['shift']());}};_0x206b10(++_0x12dc44);}(_0xdc2d,0x75));var _0xddc2=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xdc2d[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0xddc2('0x0'));var util=require(_0xddc2('0x1'));var logger=require(_0xddc2('0x2'))('api');var moment=require(_0xddc2('0x3'));var BPromise=require(_0xddc2('0x4'));var rp=require(_0xddc2('0x5'));var fs=require('fs');var path=require(_0xddc2('0x6'));var rimraf=require('rimraf');var config=require(_0xddc2('0x7'));var attributes=require(_0xddc2('0x8'));module[_0xddc2('0x9')]=function(_0x4612ea,_0x2675eb){return _0x4612ea[_0xddc2('0xa')](_0xddc2('0xb'),attributes,{'tableName':_0xddc2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1ef2=['chat_websites','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./chatWebsite.attributes','exports','define','ChatWebsite'];(function(_0x425f3c,_0x300d00){var _0x4f6fd7=function(_0x38b9a2){while(--_0x38b9a2){_0x425f3c['push'](_0x425f3c['shift']());}};_0x4f6fd7(++_0x300d00);}(_0x1ef2,0x6d));var _0x21ef=function(_0x55dcf1,_0x309b92){_0x55dcf1=_0x55dcf1-0x0;var _0x1d58fd=_0x1ef2[_0x55dcf1];return _0x1d58fd;};'use strict';var _=require(_0x21ef('0x0'));var util=require('util');var logger=require(_0x21ef('0x1'))(_0x21ef('0x2'));var moment=require(_0x21ef('0x3'));var BPromise=require(_0x21ef('0x4'));var rp=require(_0x21ef('0x5'));var fs=require('fs');var path=require(_0x21ef('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x21ef('0x7'));module[_0x21ef('0x8')]=function(_0x5a7ba6,_0x14fc56){return _0x5a7ba6[_0x21ef('0x9')](_0x21ef('0xa'),attributes,{'tableName':_0x21ef('0xb'),'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 084bb6f..76e2915 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 _0x5788=['request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','request','info'];(function(_0x129a57,_0x330d03){var _0xa7147c=function(_0x4e6c1f){while(--_0x4e6c1f){_0x129a57['push'](_0x129a57['shift']());}};_0xa7147c(++_0x330d03);}(_0x5788,0x128));var _0x8578=function(_0x429d94,_0x1e6b49){_0x429d94=_0x429d94-0x0;var _0xda6583=_0x5788[_0x429d94];return _0xda6583;};'use strict';var _=require(_0x8578('0x0'));var util=require(_0x8578('0x1'));var moment=require(_0x8578('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8578('0x3'));var db=require(_0x8578('0x4'))['db'];var utils=require(_0x8578('0x5'));var logger=require(_0x8578('0x6'))('rpc');var config=require(_0x8578('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8578('0x8')][_0x8578('0x9')]({'port':0x232a});config[_0x8578('0xa')]=_[_0x8578('0xb')](config[_0x8578('0xa')],{'host':_0x8578('0xc'),'port':0x18eb});var socket=require(_0x8578('0xd'))(new Redis(config[_0x8578('0xa')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x250c43,_0x27a30d,_0x18502d){return new BPromise(function(_0x391f9c,_0x170cb6){return client[_0x8578('0xe')](_0x250c43,_0x18502d)['then'](function(_0x1ea54f){logger[_0x8578('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x27a30d,_0x8578('0x10'));logger[_0x8578('0x11')](_0x8578('0x12'),_0x27a30d,_0x8578('0x10'),JSON[_0x8578('0x13')](_0x1ea54f));if(_0x1ea54f['error']){if(_0x1ea54f[_0x8578('0x14')][_0x8578('0x15')]===0x1f4){logger['error'](_0x8578('0x16'),_0x27a30d,_0x1ea54f['error'][_0x8578('0x17')]);return _0x170cb6(_0x1ea54f['error'][_0x8578('0x17')]);}logger[_0x8578('0x14')](_0x8578('0x16'),_0x27a30d,_0x1ea54f['error'][_0x8578('0x17')]);return _0x391f9c(_0x1ea54f[_0x8578('0x14')]['message']);}else{logger['info'](_0x8578('0x16'),_0x27a30d,_0x8578('0x10'));_0x391f9c(_0x1ea54f[_0x8578('0x18')][_0x8578('0x17')]);}})[_0x8578('0x19')](function(_0x3e9d94){logger[_0x8578('0x14')](_0x8578('0x16'),_0x27a30d,_0x3e9d94);_0x170cb6(_0x3e9d94);});});}
\ No newline at end of file
+var _0x767a=['./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost'];(function(_0x3c305e,_0x2ac00c){var _0x2c0a93=function(_0x42ae52){while(--_0x42ae52){_0x3c305e['push'](_0x3c305e['shift']());}};_0x2c0a93(++_0x2ac00c);}(_0x767a,0xbb));var _0xa767=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x767a[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require(_0xa767('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa767('0x1'));var fs=require('fs');var Redis=require(_0xa767('0x2'));var db=require(_0xa767('0x3'))['db'];var utils=require(_0xa767('0x4'));var logger=require(_0xa767('0x5'))(_0xa767('0x6'));var config=require(_0xa767('0x7'));var jayson=require(_0xa767('0x8'));var client=jayson[_0xa767('0x9')]['http']({'port':0x232a});config[_0xa767('0xa')]=_[_0xa767('0xb')](config[_0xa767('0xa')],{'host':_0xa767('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa767('0xd'))[_0xa767('0xe')](socket);function respondWithRpcPromise(_0x1da083,_0x181151,_0x14def0){return new BPromise(function(_0x4f65ad,_0x7684c1){return client['request'](_0x1da083,_0x14def0)[_0xa767('0xf')](function(_0x457e97){logger[_0xa767('0x10')](_0xa767('0x11'),_0x181151,_0xa767('0x12'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x181151,_0xa767('0x12'),JSON[_0xa767('0x13')](_0x457e97));if(_0x457e97[_0xa767('0x14')]){if(_0x457e97[_0xa767('0x14')][_0xa767('0x15')]===0x1f4){logger['error'](_0xa767('0x11'),_0x181151,_0x457e97[_0xa767('0x14')]['message']);return _0x7684c1(_0x457e97['error']['message']);}logger[_0xa767('0x14')](_0xa767('0x11'),_0x181151,_0x457e97[_0xa767('0x14')][_0xa767('0x16')]);return _0x4f65ad(_0x457e97[_0xa767('0x14')][_0xa767('0x16')]);}else{logger[_0xa767('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x181151,_0xa767('0x12'));_0x4f65ad(_0x457e97[_0xa767('0x17')][_0xa767('0x16')]);}})[_0xa767('0x18')](function(_0x3954d8){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x181151,_0x3954d8);_0x7684c1(_0x3954d8);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 6cb28c2..e7aa73d 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 _0x7839=['removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove','emit'];(function(_0x1778a1,_0x50cba4){var _0x1b9222=function(_0x1f49ad){while(--_0x1f49ad){_0x1778a1['push'](_0x1778a1['shift']());}};_0x1b9222(++_0x50cba4);}(_0x7839,0x10c));var _0x9783=function(_0x10ac35,_0x119ac4){_0x10ac35=_0x10ac35-0x0;var _0xeaf4c0=_0x7839[_0x10ac35];return _0xeaf4c0;};'use strict';var ChatWebsiteEvents=require(_0x9783('0x0'));var events=[_0x9783('0x1'),_0x9783('0x2'),'update'];function createListener(_0x281cdb,_0x5b726f){return function(_0x421131){_0x5b726f[_0x9783('0x3')](_0x281cdb,_0x421131);};}function removeListener(_0x147d1f,_0x5db539){return function(){ChatWebsiteEvents[_0x9783('0x4')](_0x147d1f,_0x5db539);};}exports[_0x9783('0x5')]=function(_0x3e0462){for(var _0x13a077=0x0,_0x5092ad=events[_0x9783('0x6')];_0x13a077<_0x5092ad;_0x13a077++){var _0xe3e641=events[_0x13a077];var _0x3526e3=createListener(_0x9783('0x7')+_0xe3e641,_0x3e0462);ChatWebsiteEvents['on'](_0xe3e641,_0x3526e3);}};
\ No newline at end of file
+var _0x3ef3=['save','update','emit','length','chatWebsite:','./chatWebsite.events'];(function(_0x33c090,_0x184b69){var _0x4081df=function(_0x109a20){while(--_0x109a20){_0x33c090['push'](_0x33c090['shift']());}};_0x4081df(++_0x184b69);}(_0x3ef3,0x14f));var _0x33ef=function(_0x3ceac4,_0xf57186){_0x3ceac4=_0x3ceac4-0x0;var _0x9e4fe8=_0x3ef3[_0x3ceac4];return _0x9e4fe8;};'use strict';var ChatWebsiteEvents=require(_0x33ef('0x0'));var events=[_0x33ef('0x1'),'remove',_0x33ef('0x2')];function createListener(_0x594fae,_0x4d63ab){return function(_0xe844fa){_0x4d63ab[_0x33ef('0x3')](_0x594fae,_0xe844fa);};}function removeListener(_0x4765d1,_0x47bdd2){return function(){ChatWebsiteEvents['removeListener'](_0x4765d1,_0x47bdd2);};}exports['register']=function(_0x3f3c8e){for(var _0x26b78d=0x0,_0x16c37b=events[_0x33ef('0x4')];_0x26b78d<_0x16c37b;_0x26b78d++){var _0x294676=events[_0x26b78d];var _0x242f49=createListener(_0x33ef('0x5')+_0x294676,_0x3f3c8e);ChatWebsiteEvents['on'](_0x294676,_0x242f49);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 3f4d1d7..bd7beb3 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 _0x6a66=['getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','join','root','server/files/images/logos/','now','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','format','addAvatar','%s-%s','addCustomerAvatar','notify','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addAgents','put','update','delete','removeAnswers','removeAgents','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions','/:id/canned_answers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6a66,0x1bf));var _0x66a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6a66[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x66a6('0x0'));var util=require(_0x66a6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x66a6('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x66a6('0x3'));var interaction=require(_0x66a6('0x4'));var config=require(_0x66a6('0x5'));var controller=require('./chatWebsite.controller');router[_0x66a6('0x6')]('/',auth[_0x66a6('0x7')](),controller['index']);router[_0x66a6('0x6')](_0x66a6('0x8'),auth[_0x66a6('0x7')](),controller[_0x66a6('0x9')]);router[_0x66a6('0x6')](_0x66a6('0xa'),auth[_0x66a6('0x7')](),controller['show']);router[_0x66a6('0x6')](_0x66a6('0xb'),auth[_0x66a6('0x7')](),controller['getDispositions']);router[_0x66a6('0x6')](_0x66a6('0xc'),auth[_0x66a6('0x7')](),controller['getAnswers']);router['get'](_0x66a6('0xd'),controller[_0x66a6('0xe')]);router[_0x66a6('0x6')]('/:id/avatar',controller[_0x66a6('0xf')]);router[_0x66a6('0x6')](_0x66a6('0x10'),controller[_0x66a6('0x11')]);router[_0x66a6('0x6')](_0x66a6('0x12'),controller['getSystemAvatar']);router[_0x66a6('0x6')](_0x66a6('0x13'),auth[_0x66a6('0x7')](),controller[_0x66a6('0x14')]);router[_0x66a6('0x6')](_0x66a6('0x15'),controller[_0x66a6('0x16')]);router[_0x66a6('0x6')](_0x66a6('0x17'),auth[_0x66a6('0x7')](),controller[_0x66a6('0x18')]);router[_0x66a6('0x6')](_0x66a6('0x19'),auth['isAuthenticated'](),controller[_0x66a6('0x1a')]);router[_0x66a6('0x6')](_0x66a6('0x1b'),controller[_0x66a6('0x1c')]);router['get'](_0x66a6('0x1d'),auth['isAuthenticated'](),controller[_0x66a6('0x1e')]);router[_0x66a6('0x6')](_0x66a6('0x1f'),auth[_0x66a6('0x7')](),controller[_0x66a6('0x20')]);router[_0x66a6('0x21')]('/',auth[_0x66a6('0x7')](),controller[_0x66a6('0x22')]);router['post'](_0x66a6('0xb'),auth[_0x66a6('0x7')](),controller[_0x66a6('0x23')]);router[_0x66a6('0x21')](_0x66a6('0xc'),auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x30bba2,_0x2181ba,_0x20f4f0){_0x20f4f0(null,path[_0x66a6('0x24')](config[_0x66a6('0x25')],_0x66a6('0x26')));},'filename':function(_0x411fe5,_0x17896e,_0x2f26eb){_0x2f26eb(null,util['format']('%s-%s',Date[_0x66a6('0x27')](),_0x17896e[_0x66a6('0x28')]));}})});router['post'](_0x66a6('0xd'),upload[_0x66a6('0x29')](_0x66a6('0x2a')),controller[_0x66a6('0x2b')]);var upload=multer({'storage':multer[_0x66a6('0x2c')]({'destination':function(_0x1df1c5,_0x4a9f0f,_0xc1c500){_0xc1c500(null,path['join'](config[_0x66a6('0x25')],_0x66a6('0x2d')));},'filename':function(_0x3492a4,_0x2eaef4,_0x3a496b){_0x3a496b(null,util[_0x66a6('0x2e')]('%s-%s',Date['now'](),_0x2eaef4[_0x66a6('0x28')]));}})});router['post']('/:id/avatar',upload[_0x66a6('0x29')](_0x66a6('0x2a')),controller[_0x66a6('0x2f')]);var upload=multer({'storage':multer[_0x66a6('0x2c')]({'destination':function(_0x3db63c,_0x51deb2,_0x158ddb){_0x158ddb(null,path[_0x66a6('0x24')](config['root'],_0x66a6('0x2d')));},'filename':function(_0x296cdd,_0x54712a,_0x33cf15){_0x33cf15(null,util[_0x66a6('0x2e')](_0x66a6('0x30'),Date[_0x66a6('0x27')](),_0x54712a['originalname']));}})});router['post'](_0x66a6('0x10'),upload['single'](_0x66a6('0x2a')),controller[_0x66a6('0x31')]);var upload=multer({'storage':multer[_0x66a6('0x2c')]({'destination':function(_0x1b8a80,_0x22ee45,_0x316ce9){_0x316ce9(null,path[_0x66a6('0x24')](config[_0x66a6('0x25')],_0x66a6('0x2d')));},'filename':function(_0xb64e93,_0x51dbc2,_0x562ce9){_0x562ce9(null,util['format'](_0x66a6('0x30'),Date[_0x66a6('0x27')](),_0x51dbc2['originalname']));}})});router[_0x66a6('0x21')]('/:id/system_avatar',upload[_0x66a6('0x29')]('file'),controller['addSystemAvatar']);router[_0x66a6('0x21')]('/:id/notify',controller[_0x66a6('0x32')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x11badd,_0x40bc6e,_0x9feb3b){const _0x459fb7=path[_0x66a6('0x24')](config[_0x66a6('0x25')],'server/files','attachments',_0x66a6('0x33'));fs_extra[_0x66a6('0x34')](_0x459fb7,function(){_0x9feb3b(null,_0x459fb7);});},'filename':function(_0x3f8800,_0x15f8a9,_0x15d9dd){const _0x2fefa2=_0x15f8a9[_0x66a6('0x28')][_0x66a6('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1346e8=path[_0x66a6('0x36')](_0x2fefa2);const _0x1c07bb=Date[_0x66a6('0x27')]()+'-'+_0x2fefa2[_0x66a6('0x35')](_0x1346e8,'')+_0x1346e8;_0x15d9dd(null,_0x1c07bb);}})});router['post'](_0x66a6('0x37'),offlineUploadMulter[_0x66a6('0x38')](),controller[_0x66a6('0x39')]);router[_0x66a6('0x21')]('/:id/interactions',auth[_0x66a6('0x7')](),controller[_0x66a6('0x3a')]);router[_0x66a6('0x21')](_0x66a6('0x17'),auth['isAuthenticated'](),controller[_0x66a6('0x3b')]);router['post']('/:id/proactive_actions',auth[_0x66a6('0x7')](),controller['addProactiveActions']);router[_0x66a6('0x21')](_0x66a6('0x1f'),auth[_0x66a6('0x7')](),controller[_0x66a6('0x3c')]);router[_0x66a6('0x3d')]('/:id',auth[_0x66a6('0x7')](),controller[_0x66a6('0x3e')]);router[_0x66a6('0x3f')](_0x66a6('0xa'),auth[_0x66a6('0x7')](),controller['destroy']);router[_0x66a6('0x3f')](_0x66a6('0xb'),auth[_0x66a6('0x7')](),controller['removeDispositions']);router[_0x66a6('0x3f')](_0x66a6('0xc'),auth['isAuthenticated'](),controller[_0x66a6('0x40')]);router['delete'](_0x66a6('0x1f'),auth[_0x66a6('0x7')](),controller[_0x66a6('0x41')]);module[_0x66a6('0x42')]=router;
\ No newline at end of file
+var _0x7ae5=['%s-%s','now','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','addAvatar','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','ensureDir','replace','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','put','/:id','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','/describe','isAuthenticated','describe','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','join','root','server/files/images/logos/','format'];(function(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0x7ae5,0x193));var _0x57ae=function(_0x24fb96,_0x4d1674){_0x24fb96=_0x24fb96-0x0;var _0x584c04=_0x7ae5[_0x24fb96];return _0x584c04;};'use strict';var multer=require(_0x57ae('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x57ae('0x1'));var router=express[_0x57ae('0x2')]();var fs_extra=require(_0x57ae('0x3'));var auth=require(_0x57ae('0x4'));var interaction=require(_0x57ae('0x5'));var config=require(_0x57ae('0x6'));var controller=require(_0x57ae('0x7'));router[_0x57ae('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x57ae('0x8')](_0x57ae('0x9'),auth[_0x57ae('0xa')](),controller[_0x57ae('0xb')]);router[_0x57ae('0x8')]('/:id',auth[_0x57ae('0xa')](),controller['show']);router[_0x57ae('0x8')](_0x57ae('0xc'),auth[_0x57ae('0xa')](),controller[_0x57ae('0xd')]);router[_0x57ae('0x8')](_0x57ae('0xe'),auth[_0x57ae('0xa')](),controller[_0x57ae('0xf')]);router[_0x57ae('0x8')](_0x57ae('0x10'),controller[_0x57ae('0x11')]);router['get'](_0x57ae('0x12'),controller[_0x57ae('0x13')]);router[_0x57ae('0x8')]('/:id/customer_avatar',controller[_0x57ae('0x14')]);router[_0x57ae('0x8')]('/:id/system_avatar',controller['getSystemAvatar']);router[_0x57ae('0x8')](_0x57ae('0x15'),auth[_0x57ae('0xa')](),controller[_0x57ae('0x16')]);router[_0x57ae('0x8')](_0x57ae('0x17'),controller[_0x57ae('0x18')]);router[_0x57ae('0x8')](_0x57ae('0x19'),auth[_0x57ae('0xa')](),controller[_0x57ae('0x1a')]);router['get'](_0x57ae('0x1b'),auth[_0x57ae('0xa')](),controller['getProactiveActions']);router[_0x57ae('0x8')](_0x57ae('0x1c'),controller['getFields']);router[_0x57ae('0x8')](_0x57ae('0x1d'),auth[_0x57ae('0xa')](),controller[_0x57ae('0x1e')]);router['get'](_0x57ae('0x1f'),auth[_0x57ae('0xa')](),controller[_0x57ae('0x20')]);router[_0x57ae('0x21')]('/',auth[_0x57ae('0xa')](),controller[_0x57ae('0x22')]);router[_0x57ae('0x21')](_0x57ae('0xc'),auth['isAuthenticated'](),controller[_0x57ae('0x23')]);router['post'](_0x57ae('0xe'),auth[_0x57ae('0xa')](),controller[_0x57ae('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2de4b5,_0xb9e093,_0x561aff){_0x561aff(null,path[_0x57ae('0x25')](config[_0x57ae('0x26')],_0x57ae('0x27')));},'filename':function(_0x242998,_0x58ae5f,_0x9a6eeb){_0x9a6eeb(null,util[_0x57ae('0x28')](_0x57ae('0x29'),Date[_0x57ae('0x2a')](),_0x58ae5f[_0x57ae('0x2b')]));}})});router[_0x57ae('0x21')](_0x57ae('0x10'),upload[_0x57ae('0x2c')](_0x57ae('0x2d')),controller[_0x57ae('0x2e')]);var upload=multer({'storage':multer[_0x57ae('0x2f')]({'destination':function(_0x307517,_0x45bec6,_0x3ede19){_0x3ede19(null,path[_0x57ae('0x25')](config['root'],_0x57ae('0x30')));},'filename':function(_0x11ac60,_0x515c17,_0x30fdeb){_0x30fdeb(null,util[_0x57ae('0x28')](_0x57ae('0x29'),Date[_0x57ae('0x2a')](),_0x515c17[_0x57ae('0x2b')]));}})});router['post'](_0x57ae('0x12'),upload[_0x57ae('0x2c')]('file'),controller[_0x57ae('0x31')]);var upload=multer({'storage':multer[_0x57ae('0x2f')]({'destination':function(_0x5a7921,_0x10e595,_0x4e2f60){_0x4e2f60(null,path[_0x57ae('0x25')](config[_0x57ae('0x26')],_0x57ae('0x30')));},'filename':function(_0x1137fa,_0x10a643,_0x17eed2){_0x17eed2(null,util[_0x57ae('0x28')](_0x57ae('0x29'),Date['now'](),_0x10a643[_0x57ae('0x2b')]));}})});router[_0x57ae('0x21')](_0x57ae('0x32'),upload['single'](_0x57ae('0x2d')),controller[_0x57ae('0x33')]);var upload=multer({'storage':multer[_0x57ae('0x2f')]({'destination':function(_0x559fe9,_0x293679,_0x2c8afa){_0x2c8afa(null,path[_0x57ae('0x25')](config[_0x57ae('0x26')],_0x57ae('0x30')));},'filename':function(_0x15f4aa,_0x227bc9,_0x149e28){_0x149e28(null,util[_0x57ae('0x28')](_0x57ae('0x29'),Date[_0x57ae('0x2a')](),_0x227bc9[_0x57ae('0x2b')]));}})});router[_0x57ae('0x21')](_0x57ae('0x34'),upload['single'](_0x57ae('0x2d')),controller[_0x57ae('0x35')]);router[_0x57ae('0x21')](_0x57ae('0x36'),controller[_0x57ae('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x57ae('0x2f')]({'destination':function(_0x350af0,_0x1b854a,_0xb9537a){const _0x52a3ff=path['join'](config['root'],_0x57ae('0x38'),_0x57ae('0x39'),'offline-chat');fs_extra[_0x57ae('0x3a')](_0x52a3ff,function(){_0xb9537a(null,_0x52a3ff);});},'filename':function(_0x5d1444,_0x53fa4e,_0x5e6dde){const _0x39ed84=_0x53fa4e['originalname'][_0x57ae('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x400e6d=path['extname'](_0x39ed84);const _0x18b24c=Date[_0x57ae('0x2a')]()+'-'+_0x39ed84[_0x57ae('0x3b')](_0x400e6d,'')+_0x400e6d;_0x5e6dde(null,_0x18b24c);}})});router[_0x57ae('0x21')](_0x57ae('0x3c'),offlineUploadMulter[_0x57ae('0x3d')](),controller[_0x57ae('0x3e')]);router[_0x57ae('0x21')](_0x57ae('0x15'),auth[_0x57ae('0xa')](),controller[_0x57ae('0x3f')]);router['post']('/:id/applications',auth[_0x57ae('0xa')](),controller[_0x57ae('0x40')]);router[_0x57ae('0x21')]('/:id/proactive_actions',auth[_0x57ae('0xa')](),controller[_0x57ae('0x41')]);router[_0x57ae('0x21')]('/:id/users',auth[_0x57ae('0xa')](),controller['addAgents']);router[_0x57ae('0x42')](_0x57ae('0x43'),auth[_0x57ae('0xa')](),controller['update']);router[_0x57ae('0x44')]('/:id',auth[_0x57ae('0xa')](),controller[_0x57ae('0x45')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x57ae('0x46')]);router['delete'](_0x57ae('0xe'),auth['isAuthenticated'](),controller[_0x57ae('0x47')]);router[_0x57ae('0x44')]('/:id/users',auth['isAuthenticated'](),controller[_0x57ae('0x48')]);module[_0x57ae('0x49')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index e66ab9d..1b5ccce 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa4bf=['../components/auth/service','../config/environment','Router','env','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','exports','beaver-logger/server','express'];(function(_0x13193c,_0x3d5713){var _0x3d25ea=function(_0x25747d){while(--_0x25747d){_0x13193c['push'](_0x13193c['shift']());}};_0x3d25ea(++_0x3d5713);}(_0xa4bf,0xa7));var _0xfa4b=function(_0xff7c05,_0x2456ca){_0xff7c05=_0xff7c05-0x0;var _0x1c1ab9=_0xa4bf[_0xff7c05];return _0x1c1ab9;};var beaverLogger=require(_0xfa4b('0x0'));var express=require(_0xfa4b('0x1'));var auth=require(_0xfa4b('0x2'));var config=require(_0xfa4b('0x3'));var router=express[_0xfa4b('0x4')]();var isProduction=config[_0xfa4b('0x5')]==='production'||![];function clientSideLogs(_0x6f1e31,_0x2c7fd6,_0x154c9c){var _0xc962c5=_0x6f1e31['app'][_0xfa4b('0x6')](_0xfa4b('0x7'));if(!_0xc962c5){throw new Error(_0xfa4b('0x8'));}return beaverLogger[_0xfa4b('0x9')]({'uri':_0xfa4b('0xa'),'logger':_0xc962c5,'enableCors':!isProduction})(_0x6f1e31,_0x2c7fd6,_0x154c9c);}router[_0xfa4b('0xb')](auth['isAuthenticated'](),clientSideLogs);module[_0xfa4b('0xc')]=router;
\ No newline at end of file
+var _0x92bc=['Router','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','express','../config/environment'];(function(_0x4d3ccc,_0x295480){var _0x5b65a3=function(_0x856637){while(--_0x856637){_0x4d3ccc['push'](_0x4d3ccc['shift']());}};_0x5b65a3(++_0x295480);}(_0x92bc,0x1a2));var _0xc92b=function(_0x5a348d,_0x2e7e92){_0x5a348d=_0x5a348d-0x0;var _0x1121be=_0x92bc[_0x5a348d];return _0x1121be;};var beaverLogger=require('beaver-logger/server');var express=require(_0xc92b('0x0'));var auth=require('../components/auth/service');var config=require(_0xc92b('0x1'));var router=express[_0xc92b('0x2')]();var isProduction=config[_0xc92b('0x3')]===_0xc92b('0x4')||![];function clientSideLogs(_0x5e3d14,_0x30793c,_0x337c84){var _0x12a76f=_0x5e3d14[_0xc92b('0x5')][_0xc92b('0x6')](_0xc92b('0x7'));if(!_0x12a76f){throw new Error(_0xc92b('0x8'));}return beaverLogger[_0xc92b('0x9')]({'uri':'/client-logs','logger':_0x12a76f,'enableCors':!isProduction})(_0x5e3d14,_0x30793c,_0x337c84);}router[_0xc92b('0xa')](auth[_0xc92b('0xb')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 8b09d05..86f3992 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 _0x3f0d=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','MicrosoftAzure','Outlook365','Dynamics365'];(function(_0x3a9ed8,_0x35eb1d){var _0x5390c9=function(_0x16e0ec){while(--_0x16e0ec){_0x3a9ed8['push'](_0x3a9ed8['shift']());}};_0x5390c9(++_0x35eb1d);}(_0x3f0d,0x1ab));var _0xd3f0=function(_0x5ea317,_0x22d2a8){_0x5ea317=_0x5ea317-0x0;var _0x53b81c=_0x3f0d[_0x5ea317];return _0x53b81c;};'use strict';var Sequelize=require(_0xd3f0('0x0'));module[_0xd3f0('0x1')]={'name':{'type':Sequelize[_0xd3f0('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xd3f0('0x3')](_0xd3f0('0x4'),'Google',_0xd3f0('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xd3f0('0x3')](_0xd3f0('0x6'),_0xd3f0('0x7'))},'data1':{'type':Sequelize[_0xd3f0('0x2')],'comment':_0xd3f0('0x8')},'data2':{'type':Sequelize[_0xd3f0('0x2')],'comment':_0xd3f0('0x9')},'data3':{'type':Sequelize[_0xd3f0('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize['STRING'],'comment':_0xd3f0('0xa')},'data5':{'type':Sequelize['TEXT'],'comment':_0xd3f0('0xb')},'data6':{'type':Sequelize[_0xd3f0('0xc')],'comment':_0xd3f0('0xd')},'data7':{'type':Sequelize['TEXT'],'comment':_0xd3f0('0xe')}};
\ No newline at end of file
+var _0x1a3d=['MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS'];(function(_0x2c8dde,_0x330674){var _0x3712a8=function(_0x9c781b){while(--_0x9c781b){_0x2c8dde['push'](_0x2c8dde['shift']());}};_0x3712a8(++_0x330674);}(_0x1a3d,0x1dc));var _0xd1a3=function(_0x27db8c,_0x21ff04){_0x27db8c=_0x27db8c-0x0;var _0x45f758=_0x1a3d[_0x27db8c];return _0x45f758;};'use strict';var Sequelize=require(_0xd1a3('0x0'));module[_0xd1a3('0x1')]={'name':{'type':Sequelize[_0xd1a3('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xd1a3('0x3')](_0xd1a3('0x4'),'Google',_0xd1a3('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('Outlook365',_0xd1a3('0x6'))},'data1':{'type':Sequelize[_0xd1a3('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xd1a3('0x2')],'comment':_0xd1a3('0x7')},'data3':{'type':Sequelize[_0xd1a3('0x2')],'comment':_0xd1a3('0x8')},'data4':{'type':Sequelize[_0xd1a3('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0xd1a3('0x9')],'comment':_0xd1a3('0xa')},'data6':{'type':Sequelize[_0xd1a3('0x9')],'comment':_0xd1a3('0xb')},'data7':{'type':Sequelize['TEXT'],'comment':_0xd1a3('0xc')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 0fcb692..6807a21 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 _0x5fb6=['Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','then','stack','send','padEnd','slice','index','CloudProvider','rawAttributes','type','key','model','map','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','include','findAll','rows','MicrosoftAzure','decryptString','data3','catch','show','params','length','includeAll','options','find','service','create','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','includes','join','encryptString','destroy','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','data5','startRefreshInterval','emit','microsoftAuthorization:error','error'];(function(_0x14cdce,_0x3bd691){var _0x522ec6=function(_0x4c985e){while(--_0x4c985e){_0x14cdce['push'](_0x14cdce['shift']());}};_0x522ec6(++_0x3bd691);}(_0x5fb6,0x65));var _0x65fb=function(_0x4912b0,_0x3c99dc){_0x4912b0=_0x4912b0-0x0;var _0x487685=_0x5fb6[_0x4912b0];return _0x487685;};'use strict';var _=require(_0x65fb('0x0'));var Redis=require(_0x65fb('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require('../../components/encryptor');var config=require(_0x65fb('0x2'));var logger=require(_0x65fb('0x3'))(_0x65fb('0x4'));var db=require('../../mysqldb')['db'];var oauth=require(_0x65fb('0x5'));config['redis']=_['defaults'](config[_0x65fb('0x6')],{'host':_0x65fb('0x7'),'port':0x18eb});var socket=require(_0x65fb('0x8'))(new Redis(config[_0x65fb('0x6')]));var redis=new Redis(config[_0x65fb('0x6')]);function respondWithStatusCode(_0x2f2d96,_0x528e4c){_0x528e4c=_0x528e4c||0xcc;return function(_0x5c7d71){if(_0x5c7d71){return _0x2f2d96[_0x65fb('0x9')](_0x528e4c);}return _0x2f2d96[_0x65fb('0xa')](_0x528e4c)['end']();};}function respondWithResult(_0x61ef9b,_0x30222a){_0x30222a=_0x30222a||0xc8;return function(_0x4dd877){if(_0x4dd877){return _0x61ef9b[_0x65fb('0xa')](_0x30222a)[_0x65fb('0xb')](_0x4dd877);}};}function respondWithFilteredResult(_0x1b34f6,_0x1e4401){return function(_0x2507c4){if(_0x2507c4){var _0x11d5a5=typeof _0x1e4401['offset']===_0x65fb('0xc')&&typeof _0x1e4401[_0x65fb('0xd')]===_0x65fb('0xc');var _0x1b0294=_0x2507c4[_0x65fb('0xe')];var _0x532005=_0x11d5a5?0x0:_0x1e4401[_0x65fb('0xf')];var _0x1a0f2d=_0x11d5a5?_0x2507c4[_0x65fb('0xe')]:_0x1e4401[_0x65fb('0xf')]+_0x1e4401['limit'];var _0x155482;if(_0x1a0f2d>=_0x1b0294){_0x1a0f2d=_0x1b0294;_0x155482=0xc8;}else{_0x155482=0xce;}_0x1b34f6['status'](_0x155482);return _0x1b34f6[_0x65fb('0x10')](_0x65fb('0x11'),_0x532005+'-'+_0x1a0f2d+'/'+_0x1b0294)[_0x65fb('0xb')](_0x2507c4);}return null;};}function saveUpdates(_0x2fa044){return function(_0x1122ea){if(_0x1122ea){return _0x1122ea[_0x65fb('0x12')](_0x2fa044)[_0x65fb('0x13')](function(_0x5af2e0){return _0x5af2e0;});}return null;};}function removeEntity(_0x1d7b2b){return function(_0x31dc30){if(_0x31dc30){return _0x31dc30['destroy']()[_0x65fb('0x13')](function(){_0x1d7b2b[_0x65fb('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x845217){return function(_0x1f0165){if(!_0x1f0165){_0x845217[_0x65fb('0x9')](0x194);}return _0x1f0165;};}function handleError(_0x39eea7,_0x1a24fd){_0x1a24fd=_0x1a24fd||0x1f4;return function(_0xcdd71e){logger['error'](_0xcdd71e[_0x65fb('0x14')]);if(_0xcdd71e['name']){delete _0xcdd71e['name'];}_0x39eea7[_0x65fb('0xa')](_0x1a24fd)[_0x65fb('0x15')](_0xcdd71e);};}function maskClientSecret(_0x4152ee){return _[_0x65fb('0x16')](_0x4152ee[_0x65fb('0x17')](0x0,0x3),0x14,'*');}exports[_0x65fb('0x18')]=function(_0x2b27dd,_0x2774ff){var _0x878e7d={},_0x58d1ea={},_0x325035={'count':0x0,'rows':[]};var _0x40924d=_['map'](db[_0x65fb('0x19')][_0x65fb('0x1a')],function(_0x3d8e23){return{'name':_0x3d8e23['fieldName'],'type':_0x3d8e23[_0x65fb('0x1b')][_0x65fb('0x1c')]};});_0x58d1ea[_0x65fb('0x1d')]=_[_0x65fb('0x1e')](_0x40924d,_0x65fb('0x1f'));_0x58d1ea[_0x65fb('0x20')]=_[_0x65fb('0x21')](_0x2b27dd[_0x65fb('0x20')]);_0x58d1ea['filters']=_[_0x65fb('0x22')](_0x58d1ea[_0x65fb('0x1d')],_0x58d1ea[_0x65fb('0x20')]);_0x878e7d[_0x65fb('0x23')]=_['intersection'](_0x58d1ea['model'],qs[_0x65fb('0x24')](_0x2b27dd[_0x65fb('0x20')][_0x65fb('0x24')]));_0x878e7d[_0x65fb('0x23')]=_0x878e7d[_0x65fb('0x23')]['length']?_0x878e7d[_0x65fb('0x23')]:_0x58d1ea[_0x65fb('0x1d')];if(!_0x2b27dd[_0x65fb('0x20')][_0x65fb('0x25')](_0x65fb('0x26'))){_0x878e7d['limit']=qs[_0x65fb('0xd')](_0x2b27dd[_0x65fb('0x20')][_0x65fb('0xd')]);_0x878e7d[_0x65fb('0xf')]=qs[_0x65fb('0xf')](_0x2b27dd[_0x65fb('0x20')]['offset']);}_0x878e7d[_0x65fb('0x27')]=qs['sort'](_0x2b27dd['query'][_0x65fb('0x28')]);_0x878e7d[_0x65fb('0x29')]=qs[_0x65fb('0x2a')](_[_0x65fb('0x2b')](_0x2b27dd[_0x65fb('0x20')],_0x58d1ea[_0x65fb('0x2a')]),_0x40924d);if(_0x2b27dd[_0x65fb('0x20')]['filter']){_0x878e7d[_0x65fb('0x29')]=_[_0x65fb('0x2c')](_0x878e7d[_0x65fb('0x29')],{'$or':_['map'](_0x40924d,function(_0x2be80b){if(_0x2be80b[_0x65fb('0x1b')]!==_0x65fb('0x2d')){var _0x1f6344={};_0x1f6344[_0x2be80b['name']]={'$like':'%'+_0x2b27dd[_0x65fb('0x20')][_0x65fb('0x2e')]+'%'};return _0x1f6344;}})});}_0x878e7d=_['merge']({},_0x878e7d,_0x2b27dd['options']);var _0x3302ff={'where':_0x878e7d[_0x65fb('0x29')]};return db[_0x65fb('0x19')][_0x65fb('0xe')](_0x3302ff)['then'](function(_0x18b347){_0x325035[_0x65fb('0xe')]=_0x18b347;if(_0x2b27dd[_0x65fb('0x20')]['includeAll']){_0x878e7d[_0x65fb('0x2f')]=[{'all':!![]}];}return db[_0x65fb('0x19')][_0x65fb('0x30')](_0x878e7d);})[_0x65fb('0x13')](function(_0x106d04){_0x325035[_0x65fb('0x31')]=_[_0x65fb('0x1e')](_0x106d04,function(_0x4f7bce){if(_0x4f7bce['service']===_0x65fb('0x32')){var _0x5c9d63=encryptor[_0x65fb('0x33')](_0x4f7bce[_0x65fb('0x34')]);_0x4f7bce[_0x65fb('0x34')]=maskClientSecret(_0x5c9d63);}return _0x4f7bce;});return _0x325035;})['then'](respondWithFilteredResult(_0x2774ff,_0x878e7d))[_0x65fb('0x35')](handleError(_0x2774ff,null));};exports[_0x65fb('0x36')]=function(_0x36a295,_0x2f6d3a){var _0x288737={'raw':!![],'where':{'id':_0x36a295[_0x65fb('0x37')]['id']}},_0x50a3a2={};_0x50a3a2[_0x65fb('0x1d')]=_[_0x65fb('0x21')](db[_0x65fb('0x19')]['rawAttributes']);_0x50a3a2[_0x65fb('0x20')]=_['keys'](_0x36a295[_0x65fb('0x20')]);_0x50a3a2[_0x65fb('0x2a')]=_[_0x65fb('0x22')](_0x50a3a2[_0x65fb('0x1d')],_0x50a3a2[_0x65fb('0x20')]);_0x288737[_0x65fb('0x23')]=_['intersection'](_0x50a3a2['model'],qs[_0x65fb('0x24')](_0x36a295['query'][_0x65fb('0x24')]));_0x288737[_0x65fb('0x23')]=_0x288737[_0x65fb('0x23')][_0x65fb('0x38')]?_0x288737['attributes']:_0x50a3a2[_0x65fb('0x1d')];if(_0x36a295[_0x65fb('0x20')][_0x65fb('0x39')]){_0x288737[_0x65fb('0x2f')]=[{'all':!![]}];}_0x288737=_[_0x65fb('0x2c')]({},_0x288737,_0x36a295[_0x65fb('0x3a')]);return db[_0x65fb('0x19')][_0x65fb('0x3b')](_0x288737)['then'](handleEntityNotFound(_0x2f6d3a,null))[_0x65fb('0x13')](function(_0x19088f){if(_0x19088f[_0x65fb('0x3c')]==='MicrosoftAzure'){var _0x3e203e=encryptor[_0x65fb('0x33')](_0x19088f[_0x65fb('0x34')]);_0x19088f['data3']=maskClientSecret(_0x3e203e);}return _0x19088f;})['then'](respondWithResult(_0x2f6d3a,null))[_0x65fb('0x35')](handleError(_0x2f6d3a,null));};exports[_0x65fb('0x3d')]=function(_0x1d8271,_0x235735){if(!_0x1d8271['body'][_0x65fb('0x1f')])throw new Error(_0x65fb('0x3e'));if(!_0x1d8271[_0x65fb('0x3f')][_0x65fb('0x3c')])throw new Error(_0x65fb('0x40'));var _0x2ec3aa=db[_0x65fb('0x19')]['rawAttributes'][_0x65fb('0x3c')]['values'];if(!_0x2ec3aa[_0x65fb('0x41')](_0x1d8271['body']['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x2ec3aa[_0x65fb('0x42')](',\x20'));if(_0x1d8271['body'][_0x65fb('0x3c')]===_0x65fb('0x32')&&_0x1d8271[_0x65fb('0x3f')]['data3']){_0x1d8271[_0x65fb('0x3f')][_0x65fb('0x34')]=encryptor[_0x65fb('0x43')](_0x1d8271[_0x65fb('0x3f')]['data3']);}return db[_0x65fb('0x19')]['create'](_0x1d8271[_0x65fb('0x3f')],{})[_0x65fb('0x13')](respondWithResult(_0x235735,0xc9))[_0x65fb('0x35')](handleError(_0x235735,null));};exports['update']=function(_0x881787,_0x285b96){if(_0x881787['body']['id']){delete _0x881787[_0x65fb('0x3f')]['id'];}return db[_0x65fb('0x19')]['find']({'where':{'id':_0x881787[_0x65fb('0x37')]['id']}})['then'](handleEntityNotFound(_0x285b96,null))[_0x65fb('0x13')](function(_0x32384c){if(_0x32384c[_0x65fb('0x3c')]===_0x65fb('0x32')&&_0x881787[_0x65fb('0x3f')][_0x65fb('0x34')]){_0x881787['body']['data3']=encryptor[_0x65fb('0x43')](_0x881787[_0x65fb('0x3f')]['data3']);}return _0x32384c;})[_0x65fb('0x13')](saveUpdates(_0x881787['body'],null))['then'](respondWithResult(_0x285b96,null))['catch'](handleError(_0x285b96,null));};exports[_0x65fb('0x44')]=function(_0x31437e,_0x108191){return db[_0x65fb('0x19')][_0x65fb('0x3b')]({'where':{'id':_0x31437e[_0x65fb('0x37')]['id']}})[_0x65fb('0x13')](handleEntityNotFound(_0x108191,null))[_0x65fb('0x13')](removeEntity(_0x108191,null))['catch'](handleError(_0x108191,null));};exports[_0x65fb('0x45')]=function(_0x1f1620,_0x3cb165){return db['CloudProvider']['findOne']({'where':{'id':_0x1f1620['params']['id']},'raw':!![]})[_0x65fb('0x13')](function(_0x2c7727){if(!_0x2c7727)return _0x3cb165[_0x65fb('0x9')](0x194);return{'url':oauth[_0x65fb('0x46')](_0x2c7727,_0x1f1620[_0x65fb('0x47')]['id'])};})[_0x65fb('0x13')](respondWithResult(_0x3cb165,null))[_0x65fb('0x35')](handleError(_0x3cb165,null));};exports[_0x65fb('0x48')]=function(_0xbfffd3,_0x48b61f){var _0x321393=_0xbfffd3[_0x65fb('0x3f')];var _0x467b68;var _0x2d557c;if(_0x321393['error'])throw _0x321393;redis[_0x65fb('0x49')](_0x321393[_0x65fb('0x4a')])[_0x65fb('0x13')](function(_0x597e3d){if(!_0x597e3d)throw new Error(_0x65fb('0x4b'));_0x467b68=JSON[_0x65fb('0x4c')](_0x597e3d);var _0x2fc493=Buffer[_0x65fb('0x4d')](_0x321393[_0x65fb('0x4a')],_0x65fb('0x4e'))[_0x65fb('0x4f')]('ascii');_0x2d557c=JSON[_0x65fb('0x4c')](_0x2fc493);if(!oauth['isValidIdToken'](_0x321393['id_token'],_0x467b68[_0x65fb('0x50')]))throw new Error(_0x65fb('0x51'));redis[_0x65fb('0x52')](_0x321393[_0x65fb('0x4a')]);return oauth[_0x65fb('0x53')](_0x321393[_0x65fb('0x54')],_0x467b68);})[_0x65fb('0x13')](function(_0x519199){_0x467b68['data5']=_0x519199[_0x65fb('0x55')];_0x467b68[_0x65fb('0x56')]=_0x519199[_0x65fb('0x57')];return db['CloudProvider'][_0x65fb('0x12')]({'data5':_0x467b68[_0x65fb('0x58')],'data6':_0x467b68[_0x65fb('0x56')]},{'where':{'id':_0x467b68['id']}});})[_0x65fb('0x13')](function(){oauth[_0x65fb('0x59')](_0x467b68);socket[_0x65fb('0x5a')]('microsoftAuthorization:success',{'id':_0x2d557c['id']});return;})[_0x65fb('0x13')](respondWithStatusCode(_0x48b61f,null))[_0x65fb('0x35')](function(_0x2d5e4e){if(_0x2d557c){socket[_0x65fb('0x5a')](_0x65fb('0x5b'),{'id':_0x2d557c['id']});}if(!_0x467b68){logger[_0x65fb('0x5c')](_0x65fb('0x5d'),_0x2d5e4e);return _0x48b61f[_0x65fb('0xa')](0x1f4)[_0x65fb('0x15')](_0x2d5e4e[_0x65fb('0x5e')]);}logger['error'](_0x65fb('0x5f'),_0x467b68['id'],JSON[_0x65fb('0x60')](_0x2d5e4e));});};
\ No newline at end of file
+var _0x610f=['limit','count','set','Content-Range','update','then','end','sendStatus','error','stack','name','slice','map','CloudProvider','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','service','MicrosoftAzure','data3','catch','params','find','decryptString','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','join','encryptString','create','destroy','oauth2MicrosoftAuthorize','findOne','user','get','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','state','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','send','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','status','json','offset','undefined'];(function(_0x39c2b1,_0x59decc){var _0x409fb7=function(_0x38d261){while(--_0x38d261){_0x39c2b1['push'](_0x39c2b1['shift']());}};_0x409fb7(++_0x59decc);}(_0x610f,0x168));var _0xf610=function(_0x20582f,_0x112fd2){_0x20582f=_0x20582f-0x0;var _0x1b64c1=_0x610f[_0x20582f];return _0x1b64c1;};'use strict';var _=require('lodash');var Redis=require(_0xf610('0x0'));var qs=require(_0xf610('0x1'));var encryptor=require(_0xf610('0x2'));var config=require(_0xf610('0x3'));var logger=require(_0xf610('0x4'))(_0xf610('0x5'));var db=require(_0xf610('0x6'))['db'];var oauth=require(_0xf610('0x7'));config[_0xf610('0x8')]=_[_0xf610('0x9')](config['redis'],{'host':_0xf610('0xa'),'port':0x18eb});var socket=require(_0xf610('0xb'))(new Redis(config[_0xf610('0x8')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x3dd74e,_0x3062c1){_0x3062c1=_0x3062c1||0xcc;return function(_0x361baa){if(_0x361baa){return _0x3dd74e['sendStatus'](_0x3062c1);}return _0x3dd74e[_0xf610('0xc')](_0x3062c1)['end']();};}function respondWithResult(_0x1d1c51,_0x596040){_0x596040=_0x596040||0xc8;return function(_0x4d1b8a){if(_0x4d1b8a){return _0x1d1c51[_0xf610('0xc')](_0x596040)[_0xf610('0xd')](_0x4d1b8a);}};}function respondWithFilteredResult(_0xbfc539,_0x27a0c9){return function(_0x3c04ff){if(_0x3c04ff){var _0x4effbc=typeof _0x27a0c9[_0xf610('0xe')]===_0xf610('0xf')&&typeof _0x27a0c9[_0xf610('0x10')]===_0xf610('0xf');var _0x2d95b3=_0x3c04ff[_0xf610('0x11')];var _0x239c62=_0x4effbc?0x0:_0x27a0c9[_0xf610('0xe')];var _0x3bf63e=_0x4effbc?_0x3c04ff[_0xf610('0x11')]:_0x27a0c9[_0xf610('0xe')]+_0x27a0c9['limit'];var _0x1e3d4a;if(_0x3bf63e>=_0x2d95b3){_0x3bf63e=_0x2d95b3;_0x1e3d4a=0xc8;}else{_0x1e3d4a=0xce;}_0xbfc539['status'](_0x1e3d4a);return _0xbfc539[_0xf610('0x12')](_0xf610('0x13'),_0x239c62+'-'+_0x3bf63e+'/'+_0x2d95b3)[_0xf610('0xd')](_0x3c04ff);}return null;};}function saveUpdates(_0x21cb3c){return function(_0x242d76){if(_0x242d76){return _0x242d76[_0xf610('0x14')](_0x21cb3c)['then'](function(_0x5ea722){return _0x5ea722;});}return null;};}function removeEntity(_0x35a780){return function(_0x333abf){if(_0x333abf){return _0x333abf['destroy']()[_0xf610('0x15')](function(){_0x35a780['status'](0xcc)[_0xf610('0x16')]();});}};}function handleEntityNotFound(_0x44f29c){return function(_0x558be4){if(!_0x558be4){_0x44f29c[_0xf610('0x17')](0x194);}return _0x558be4;};}function handleError(_0x1fd5c4,_0x59f90f){_0x59f90f=_0x59f90f||0x1f4;return function(_0x491587){logger[_0xf610('0x18')](_0x491587[_0xf610('0x19')]);if(_0x491587[_0xf610('0x1a')]){delete _0x491587['name'];}_0x1fd5c4[_0xf610('0xc')](_0x59f90f)['send'](_0x491587);};}function maskClientSecret(_0x1a55df){return _['padEnd'](_0x1a55df[_0xf610('0x1b')](0x0,0x3),0x14,'*');}exports['index']=function(_0x3e49cf,_0x3a9f60){var _0x5280b5={},_0x983f0={},_0xdc9b0d={'count':0x0,'rows':[]};var _0x11d870=_[_0xf610('0x1c')](db[_0xf610('0x1d')][_0xf610('0x1e')],function(_0x4d617b){return{'name':_0x4d617b[_0xf610('0x1f')],'type':_0x4d617b[_0xf610('0x20')][_0xf610('0x21')]};});_0x983f0[_0xf610('0x22')]=_[_0xf610('0x1c')](_0x11d870,_0xf610('0x1a'));_0x983f0['query']=_[_0xf610('0x23')](_0x3e49cf[_0xf610('0x24')]);_0x983f0[_0xf610('0x25')]=_['intersection'](_0x983f0[_0xf610('0x22')],_0x983f0[_0xf610('0x24')]);_0x5280b5[_0xf610('0x26')]=_[_0xf610('0x27')](_0x983f0['model'],qs[_0xf610('0x28')](_0x3e49cf['query'][_0xf610('0x28')]));_0x5280b5[_0xf610('0x26')]=_0x5280b5['attributes'][_0xf610('0x29')]?_0x5280b5[_0xf610('0x26')]:_0x983f0[_0xf610('0x22')];if(!_0x3e49cf[_0xf610('0x24')]['hasOwnProperty'](_0xf610('0x2a'))){_0x5280b5['limit']=qs[_0xf610('0x10')](_0x3e49cf[_0xf610('0x24')][_0xf610('0x10')]);_0x5280b5[_0xf610('0xe')]=qs['offset'](_0x3e49cf[_0xf610('0x24')][_0xf610('0xe')]);}_0x5280b5[_0xf610('0x2b')]=qs[_0xf610('0x2c')](_0x3e49cf[_0xf610('0x24')][_0xf610('0x2c')]);_0x5280b5[_0xf610('0x2d')]=qs[_0xf610('0x25')](_['pick'](_0x3e49cf[_0xf610('0x24')],_0x983f0['filters']),_0x11d870);if(_0x3e49cf[_0xf610('0x24')][_0xf610('0x2e')]){_0x5280b5['where']=_[_0xf610('0x2f')](_0x5280b5[_0xf610('0x2d')],{'$or':_[_0xf610('0x1c')](_0x11d870,function(_0x480e3a){if(_0x480e3a['type']!==_0xf610('0x30')){var _0x3f60f7={};_0x3f60f7[_0x480e3a[_0xf610('0x1a')]]={'$like':'%'+_0x3e49cf[_0xf610('0x24')][_0xf610('0x2e')]+'%'};return _0x3f60f7;}})});}_0x5280b5=_['merge']({},_0x5280b5,_0x3e49cf[_0xf610('0x31')]);var _0x1f3ac1={'where':_0x5280b5[_0xf610('0x2d')]};return db[_0xf610('0x1d')]['count'](_0x1f3ac1)[_0xf610('0x15')](function(_0x3f6262){_0xdc9b0d[_0xf610('0x11')]=_0x3f6262;if(_0x3e49cf[_0xf610('0x24')][_0xf610('0x32')]){_0x5280b5[_0xf610('0x33')]=[{'all':!![]}];}return db[_0xf610('0x1d')][_0xf610('0x34')](_0x5280b5);})[_0xf610('0x15')](function(_0x24ec16){_0xdc9b0d[_0xf610('0x35')]=_[_0xf610('0x1c')](_0x24ec16,function(_0x3e5784){if(_0x3e5784[_0xf610('0x36')]===_0xf610('0x37')){var _0x34c19d=encryptor['decryptString'](_0x3e5784['data3']);_0x3e5784[_0xf610('0x38')]=maskClientSecret(_0x34c19d);}return _0x3e5784;});return _0xdc9b0d;})[_0xf610('0x15')](respondWithFilteredResult(_0x3a9f60,_0x5280b5))[_0xf610('0x39')](handleError(_0x3a9f60,null));};exports['show']=function(_0x2745c4,_0x3aa11d){var _0x5e847a={'raw':!![],'where':{'id':_0x2745c4[_0xf610('0x3a')]['id']}},_0x1672bf={};_0x1672bf[_0xf610('0x22')]=_[_0xf610('0x23')](db[_0xf610('0x1d')][_0xf610('0x1e')]);_0x1672bf[_0xf610('0x24')]=_[_0xf610('0x23')](_0x2745c4[_0xf610('0x24')]);_0x1672bf[_0xf610('0x25')]=_[_0xf610('0x27')](_0x1672bf[_0xf610('0x22')],_0x1672bf[_0xf610('0x24')]);_0x5e847a[_0xf610('0x26')]=_[_0xf610('0x27')](_0x1672bf[_0xf610('0x22')],qs[_0xf610('0x28')](_0x2745c4[_0xf610('0x24')]['fields']));_0x5e847a[_0xf610('0x26')]=_0x5e847a[_0xf610('0x26')][_0xf610('0x29')]?_0x5e847a['attributes']:_0x1672bf['model'];if(_0x2745c4['query'][_0xf610('0x32')]){_0x5e847a[_0xf610('0x33')]=[{'all':!![]}];}_0x5e847a=_[_0xf610('0x2f')]({},_0x5e847a,_0x2745c4[_0xf610('0x31')]);return db['CloudProvider'][_0xf610('0x3b')](_0x5e847a)[_0xf610('0x15')](handleEntityNotFound(_0x3aa11d,null))['then'](function(_0x560dfc){if(_0x560dfc[_0xf610('0x36')]===_0xf610('0x37')){var _0xa616f=encryptor[_0xf610('0x3c')](_0x560dfc[_0xf610('0x38')]);_0x560dfc[_0xf610('0x38')]=maskClientSecret(_0xa616f);}return _0x560dfc;})[_0xf610('0x15')](respondWithResult(_0x3aa11d,null))['catch'](handleError(_0x3aa11d,null));};exports['create']=function(_0x9bf421,_0x128e15){if(!_0x9bf421[_0xf610('0x3d')][_0xf610('0x1a')])throw new Error(_0xf610('0x3e'));if(!_0x9bf421['body'][_0xf610('0x36')])throw new Error(_0xf610('0x3f'));var _0x15b839=db[_0xf610('0x1d')]['rawAttributes']['service'][_0xf610('0x40')];if(!_0x15b839[_0xf610('0x41')](_0x9bf421[_0xf610('0x3d')][_0xf610('0x36')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x15b839[_0xf610('0x42')](',\x20'));if(_0x9bf421[_0xf610('0x3d')][_0xf610('0x36')]===_0xf610('0x37')&&_0x9bf421['body'][_0xf610('0x38')]){_0x9bf421['body'][_0xf610('0x38')]=encryptor[_0xf610('0x43')](_0x9bf421['body'][_0xf610('0x38')]);}return db[_0xf610('0x1d')][_0xf610('0x44')](_0x9bf421[_0xf610('0x3d')],{})[_0xf610('0x15')](respondWithResult(_0x128e15,0xc9))[_0xf610('0x39')](handleError(_0x128e15,null));};exports[_0xf610('0x14')]=function(_0x151cd7,_0x547564){if(_0x151cd7[_0xf610('0x3d')]['id']){delete _0x151cd7['body']['id'];}return db[_0xf610('0x1d')][_0xf610('0x3b')]({'where':{'id':_0x151cd7[_0xf610('0x3a')]['id']}})[_0xf610('0x15')](handleEntityNotFound(_0x547564,null))[_0xf610('0x15')](function(_0x53b8df){if(_0x53b8df[_0xf610('0x36')]==='MicrosoftAzure'&&_0x151cd7[_0xf610('0x3d')][_0xf610('0x38')]){_0x151cd7[_0xf610('0x3d')][_0xf610('0x38')]=encryptor[_0xf610('0x43')](_0x151cd7[_0xf610('0x3d')][_0xf610('0x38')]);}return _0x53b8df;})['then'](saveUpdates(_0x151cd7[_0xf610('0x3d')],null))[_0xf610('0x15')](respondWithResult(_0x547564,null))[_0xf610('0x39')](handleError(_0x547564,null));};exports[_0xf610('0x45')]=function(_0x1493fd,_0x155898){return db[_0xf610('0x1d')][_0xf610('0x3b')]({'where':{'id':_0x1493fd[_0xf610('0x3a')]['id']}})[_0xf610('0x15')](handleEntityNotFound(_0x155898,null))[_0xf610('0x15')](removeEntity(_0x155898,null))[_0xf610('0x39')](handleError(_0x155898,null));};exports[_0xf610('0x46')]=function(_0x246e29,_0x5b356b){return db['CloudProvider'][_0xf610('0x47')]({'where':{'id':_0x246e29['params']['id']},'raw':!![]})['then'](function(_0xf32c9f){if(!_0xf32c9f)return _0x5b356b['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0xf32c9f,_0x246e29[_0xf610('0x48')]['id'])};})['then'](respondWithResult(_0x5b356b,null))[_0xf610('0x39')](handleError(_0x5b356b,null));};exports['oauth2MicrosoftCallback']=function(_0x550d12,_0x8489a0){var _0x584a0a=_0x550d12['body'];var _0x43c11b;var _0x5e0e67;if(_0x584a0a['error'])throw _0x584a0a;redis[_0xf610('0x49')](_0x584a0a['state'])[_0xf610('0x15')](function(_0x30e5fe){if(!_0x30e5fe)throw new Error(_0xf610('0x4a'));_0x43c11b=JSON[_0xf610('0x4b')](_0x30e5fe);var _0x3f823d=Buffer[_0xf610('0x4c')](_0x584a0a['state'],_0xf610('0x4d'))[_0xf610('0x4e')](_0xf610('0x4f'));_0x5e0e67=JSON[_0xf610('0x4b')](_0x3f823d);if(!oauth[_0xf610('0x50')](_0x584a0a[_0xf610('0x51')],_0x43c11b[_0xf610('0x52')]))throw new Error(_0xf610('0x53'));redis[_0xf610('0x54')](_0x584a0a[_0xf610('0x55')]);return oauth['getOauth2MicrosoftAccessToken'](_0x584a0a['code'],_0x43c11b);})[_0xf610('0x15')](function(_0x1cf7c1){_0x43c11b[_0xf610('0x56')]=_0x1cf7c1[_0xf610('0x57')];_0x43c11b[_0xf610('0x58')]=_0x1cf7c1[_0xf610('0x59')];return db[_0xf610('0x1d')]['update']({'data5':_0x43c11b[_0xf610('0x56')],'data6':_0x43c11b[_0xf610('0x58')]},{'where':{'id':_0x43c11b['id']}});})[_0xf610('0x15')](function(){oauth[_0xf610('0x5a')](_0x43c11b);socket[_0xf610('0x5b')](_0xf610('0x5c'),{'id':_0x5e0e67['id']});return;})['then'](respondWithStatusCode(_0x8489a0,null))[_0xf610('0x39')](function(_0xe4a3c8){if(_0x5e0e67){socket['emit']('microsoftAuthorization:error',{'id':_0x5e0e67['id']});}if(!_0x43c11b){logger[_0xf610('0x18')]('Invalid\x20authentication\x20state\x20parameter',_0xe4a3c8);return _0x8489a0['status'](0x1f4)[_0xf610('0x5d')](_0xe4a3c8['message']);}logger[_0xf610('0x18')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x43c11b['id'],JSON['stringify'](_0xe4a3c8));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index f119ff9..3379855 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 _0x6cbc=['moment','bluebird','path','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','lodash','util','../../config/logger','api'];(function(_0x13e453,_0x4ab30c){var _0x26aad2=function(_0x3387a1){while(--_0x3387a1){_0x13e453['push'](_0x13e453['shift']());}};_0x26aad2(++_0x4ab30c);}(_0x6cbc,0x128));var _0xc6cb=function(_0x421021,_0xf42b18){_0x421021=_0x421021-0x0;var _0x1b9d18=_0x6cbc[_0x421021];return _0x1b9d18;};'use strict';var _=require(_0xc6cb('0x0'));var util=require(_0xc6cb('0x1'));var logger=require(_0xc6cb('0x2'))(_0xc6cb('0x3'));var moment=require(_0xc6cb('0x4'));var BPromise=require(_0xc6cb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6cb('0x6'));var rimraf=require('rimraf');var config=require(_0xc6cb('0x7'));var attributes=require(_0xc6cb('0x8'));module[_0xc6cb('0x9')]=function(_0x3cfc67,_0x3259cc){return _0x3cfc67[_0xc6cb('0xa')](_0xc6cb('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6c38=['cloud_providers','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','define','CloudProvider'];(function(_0x448e8d,_0x43a056){var _0x46e774=function(_0x22f0be){while(--_0x22f0be){_0x448e8d['push'](_0x448e8d['shift']());}};_0x46e774(++_0x43a056);}(_0x6c38,0x65));var _0x86c3=function(_0xc26035,_0x9bdf57){_0xc26035=_0xc26035-0x0;var _0x2f6310=_0x6c38[_0xc26035];return _0x2f6310;};'use strict';var _=require('lodash');var util=require(_0x86c3('0x0'));var logger=require(_0x86c3('0x1'))('api');var moment=require('moment');var BPromise=require(_0x86c3('0x2'));var rp=require(_0x86c3('0x3'));var fs=require('fs');var path=require(_0x86c3('0x4'));var rimraf=require('rimraf');var config=require(_0x86c3('0x5'));var attributes=require(_0x86c3('0x6'));module['exports']=function(_0x402b1d,_0x47d55c){return _0x402b1d[_0x86c3('0x7')](_0x86c3('0x8'),attributes,{'tableName':_0x86c3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 627a23b..ff4061b 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0a03=['resolve','then','data3','CloudProvider','findOne','refresh_token','POST','data5','data6','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','findAll','all','inspect','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','map','type','Dynamics365','data7','/.default','replace','{TENANT_ID}','data2','code','id_token','toString','base64','client_id','data1','join','data4','response_mode','form_post','scope','prompt','key','value','oauth2Claims','stringify','decode','payload','iss','issuer','aud','audience','nonce','isAfter','unix','exp'];(function(_0x1e31fa,_0x2dea6b){var _0x1b9c65=function(_0x3dbe83){while(--_0x3dbe83){_0x1e31fa['push'](_0x1e31fa['shift']());}};_0x1b9c65(++_0x2dea6b);}(_0x0a03,0x131));var _0x30a0=function(_0x3d3c73,_0x4306ef){_0x3d3c73=_0x3d3c73-0x0;var _0x45696f=_0x0a03[_0x3d3c73];return _0x45696f;};'use strict';var _=require(_0x30a0('0x0'));var crypto=require(_0x30a0('0x1'));var jwt=require(_0x30a0('0x2'));var moment=require(_0x30a0('0x3'));var Redis=require(_0x30a0('0x4'));var rp=require(_0x30a0('0x5'));var util=require('util');var encryptor=require(_0x30a0('0x6'));var config=require(_0x30a0('0x7'));var logger=require('../../config/logger')(_0x30a0('0x8'));var schedule=require(_0x30a0('0x9'));var db=require(_0x30a0('0xa'))['db'];config[_0x30a0('0xb')]=_[_0x30a0('0xc')](config[_0x30a0('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x30a0('0xb')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x30a0('0xd'),_0x30a0('0xe'),_0x30a0('0xf'),_0x30a0('0x10'),_0x30a0('0x11'),_0x30a0('0x12'),_0x30a0('0x13')],'Dynamics365':[_0x30a0('0xd'),_0x30a0('0x10')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x30a0('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5bcb8b){var _0x5c756c=_[_0x30a0('0x15')](AZURE_AUTH_SCOPES[_0x5bcb8b[_0x30a0('0x16')]]);if(_0x5bcb8b[_0x30a0('0x16')]===_0x30a0('0x17'))_0x5c756c['push'](_0x5bcb8b[_0x30a0('0x18')]+_0x30a0('0x19'));return _0x5c756c['join']('\x20');}function getAccessTokenScope(_0x1b12f1){if(_0x1b12f1[_0x30a0('0x16')]==='Outlook365')return _0x30a0('0x11');if(_0x1b12f1[_0x30a0('0x16')]===_0x30a0('0x17'))return _0x1b12f1[_0x30a0('0x18')]+_0x30a0('0x19');}function generateMicrosoftAuthorizationUrl(_0x1ba9ed,_0x3e1044){var _0x15122b=MICROSOFT_AUTH_URL[_0x30a0('0x1a')](_0x30a0('0x1b'),_0x1ba9ed[_0x30a0('0x1c')]);var _0x3ffe1f=[_0x30a0('0x1d'),_0x30a0('0x1e')];var _0x8c1e9e=Buffer['from'](JSON['stringify']({'id':_0x3e1044}))[_0x30a0('0x1f')](_0x30a0('0x20'));var _0xb0129e=crypto['randomBytes'](0x10)[_0x30a0('0x1f')]('hex');var _0x3a3d14=getAuthorizationScopes(_0x1ba9ed);var _0x2127dc=[{'key':_0x30a0('0x21'),'value':_0x1ba9ed[_0x30a0('0x22')]},{'key':'response_type','value':encodeURIComponent(_0x3ffe1f[_0x30a0('0x23')]('\x20'))},{'key':'redirect_uri','value':_0x1ba9ed[_0x30a0('0x24')]},{'key':_0x30a0('0x25'),'value':_0x30a0('0x26')},{'key':_0x30a0('0x27'),'value':encodeURIComponent(_0x3a3d14)},{'key':'state','value':_0x8c1e9e},{'key':'nonce','value':_0xb0129e},{'key':_0x30a0('0x28'),'value':'login'}];var _0x4b8be2=_0x15122b+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x30a0('0x15')](_0x2127dc,function(_0x31934c){return _0x31934c[_0x30a0('0x29')]+'='+_0x31934c[_0x30a0('0x2a')];})[_0x30a0('0x23')]('&');_0x1ba9ed[_0x30a0('0x2b')]={'issuer':_0x15122b[_0x30a0('0x1a')]('oauth2/',''),'audience':_0x1ba9ed[_0x30a0('0x22')],'state':_0x8c1e9e,'nonce':_0xb0129e};redis['set'](_0x8c1e9e,JSON[_0x30a0('0x2c')](_0x1ba9ed));return _0x4b8be2;}function isValidIdToken(_0xf09b25,_0x4b6675){try{var _0x12ecb9=jwt[_0x30a0('0x2d')](_0xf09b25,{'complete':!![]});var _0x574fc9=_0x12ecb9[_0x30a0('0x2e')];if(_0x574fc9[_0x30a0('0x2f')]!==_0x4b6675[_0x30a0('0x30')])return![];if(_0x574fc9[_0x30a0('0x31')]!==_0x4b6675[_0x30a0('0x32')])return![];if(_0x574fc9[_0x30a0('0x33')]!==_0x4b6675[_0x30a0('0x33')])return![];if(moment()[_0x30a0('0x34')](moment[_0x30a0('0x35')](_0x574fc9[_0x30a0('0x36')])))return![];return!![];}catch(_0x5ac1a1){throw _0x5ac1a1;}}function refreshOauth2MicrosoftAccessToken(_0x14f52c){return Promise[_0x30a0('0x37')]()[_0x30a0('0x38')](function(){if(_0x14f52c[_0x30a0('0x39')])return _0x14f52c;return db[_0x30a0('0x3a')][_0x30a0('0x3b')]({'where':{'id':_0x14f52c['id']},'raw':!![]});})['then'](function(_0x4de7fa){var _0x2cec2d={'grant_type':_0x30a0('0x3c'),'refresh_token':_0x4de7fa['data6'],'scope':getAccessTokenScope(_0x4de7fa),'redirect_uri':_0x4de7fa[_0x30a0('0x24')],'client_id':_0x4de7fa[_0x30a0('0x22')],'client_secret':encryptor['decryptString'](_0x4de7fa['data3'])};var _0x44266b={'method':_0x30a0('0x3d'),'uri':MICROSOFT_AUTH_URL[_0x30a0('0x1a')](_0x30a0('0x1b'),_0x4de7fa['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2cec2d,'json':!![]};return rp(_0x44266b);})['then'](function(_0x13cfa5){_0x14f52c[_0x30a0('0x3e')]=_0x13cfa5['access_token'];_0x14f52c[_0x30a0('0x3f')]=_0x13cfa5[_0x30a0('0x3c')];return db[_0x30a0('0x3a')][_0x30a0('0x40')]({'data5':_0x14f52c[_0x30a0('0x3e')],'data6':_0x14f52c[_0x30a0('0x3f')]},{'where':{'id':_0x14f52c['id']}});})[_0x30a0('0x38')](function(){return _0x14f52c;})[_0x30a0('0x41')](function(_0x5e251b){logger['error'](_0x30a0('0x42'),_0x14f52c['id'],_0x5e251b);});}function getOauth2MicrosoftAccessToken(_0x540586,_0x29f3a6){var _0x541061={'grant_type':_0x30a0('0x43'),'code':_0x540586,'scope':getAccessTokenScope(_0x29f3a6),'redirect_uri':_0x29f3a6[_0x30a0('0x24')],'client_id':_0x29f3a6['data1'],'client_secret':encryptor['decryptString'](_0x29f3a6['data3'])};var _0x1b0e5b={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x30a0('0x1a')](_0x30a0('0x1b'),_0x29f3a6[_0x30a0('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x541061,'json':!![]};return rp(_0x1b0e5b);}function startRefreshInterval(_0x11284d){var _0x429ada=schedule[_0x30a0('0x44')];if(_0x429ada[_0x11284d['id']])clearInterval(_0x429ada[_0x11284d['id']]);_0x429ada[_0x11284d['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x11284d['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x30a0('0x44')]=_0x429ada;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x30a0('0x45')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x30a0('0x38')](function(_0x5bf361){var _0x262af3=_0x5bf361[_0x30a0('0x15')](function(_0x4b9656){return refreshOauth2MicrosoftAccessToken(_0x4b9656)['then'](function(_0x29700a){startRefreshInterval(_0x29700a);});});return Promise[_0x30a0('0x46')](_0x262af3);})[_0x30a0('0x41')](function(_0x53460a){var _0x29ee0b=_0x53460a?util[_0x30a0('0x47')](_0x53460a,{'showHidden':![],'depth':null}):'';logger['error']('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x29ee0b);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x1f21=['decryptString','data2','intervals','findAll','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','{TENANT_ID}','code','id_token','stringify','toString','base64','randomBytes','client_id','data1','response_type','redirect_uri','data4','scope','state','nonce','login','value','oauth2Claims','oauth2/','set','decode','payload','aud','audience','isAfter','unix','exp','then','data3','CloudProvider','findOne','refresh_token','data6','POST','replace','data5','update','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code'];(function(_0x321323,_0x4d62fa){var _0x102702=function(_0x71936f){while(--_0x71936f){_0x321323['push'](_0x321323['shift']());}};_0x102702(++_0x4d62fa);}(_0x1f21,0x179));var _0x11f2=function(_0xd09ff5,_0x1daae){_0xd09ff5=_0xd09ff5-0x0;var _0x6d7b8e=_0x1f21[_0xd09ff5];return _0x6d7b8e;};'use strict';var _=require(_0x11f2('0x0'));var crypto=require(_0x11f2('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x11f2('0x2'));var Redis=require(_0x11f2('0x3'));var rp=require(_0x11f2('0x4'));var util=require(_0x11f2('0x5'));var encryptor=require(_0x11f2('0x6'));var config=require(_0x11f2('0x7'));var logger=require(_0x11f2('0x8'))('api');var schedule=require(_0x11f2('0x9'));var db=require('../../mysqldb')['db'];config[_0x11f2('0xa')]=_['defaults'](config[_0x11f2('0xa')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x11f2('0xa')]);var MICROSOFT_AUTH_URL=_0x11f2('0xb');var AZURE_AUTH_SCOPES={'Outlook365':['openid','profile',_0x11f2('0xc'),_0x11f2('0xd'),_0x11f2('0xe'),_0x11f2('0xf'),_0x11f2('0x10')],'Dynamics365':[_0x11f2('0x11'),_0x11f2('0xd')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x11f2('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x267a93){var _0x21a062=_[_0x11f2('0x13')](AZURE_AUTH_SCOPES[_0x267a93['type']]);if(_0x267a93[_0x11f2('0x14')]===_0x11f2('0x15'))_0x21a062[_0x11f2('0x16')](_0x267a93[_0x11f2('0x17')]+_0x11f2('0x18'));return _0x21a062[_0x11f2('0x19')]('\x20');}function getAccessTokenScope(_0x2caf16){if(_0x2caf16[_0x11f2('0x14')]===_0x11f2('0x1a'))return _0x11f2('0xe');if(_0x2caf16[_0x11f2('0x14')]===_0x11f2('0x15'))return _0x2caf16[_0x11f2('0x17')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x54b293,_0x19d934){var _0x2d70c0=MICROSOFT_AUTH_URL['replace'](_0x11f2('0x1b'),_0x54b293['data2']);var _0xc8f18c=[_0x11f2('0x1c'),_0x11f2('0x1d')];var _0x45983f=Buffer['from'](JSON[_0x11f2('0x1e')]({'id':_0x19d934}))[_0x11f2('0x1f')](_0x11f2('0x20'));var _0x195e5b=crypto[_0x11f2('0x21')](0x10)[_0x11f2('0x1f')]('hex');var _0x407d2e=getAuthorizationScopes(_0x54b293);var _0x3a6cc5=[{'key':_0x11f2('0x22'),'value':_0x54b293[_0x11f2('0x23')]},{'key':_0x11f2('0x24'),'value':encodeURIComponent(_0xc8f18c['join']('\x20'))},{'key':_0x11f2('0x25'),'value':_0x54b293[_0x11f2('0x26')]},{'key':'response_mode','value':'form_post'},{'key':_0x11f2('0x27'),'value':encodeURIComponent(_0x407d2e)},{'key':_0x11f2('0x28'),'value':_0x45983f},{'key':_0x11f2('0x29'),'value':_0x195e5b},{'key':'prompt','value':_0x11f2('0x2a')}];var _0xc0f81e=_0x2d70c0+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x3a6cc5,function(_0x35b7d8){return _0x35b7d8['key']+'='+_0x35b7d8[_0x11f2('0x2b')];})[_0x11f2('0x19')]('&');_0x54b293[_0x11f2('0x2c')]={'issuer':_0x2d70c0['replace'](_0x11f2('0x2d'),''),'audience':_0x54b293['data1'],'state':_0x45983f,'nonce':_0x195e5b};redis[_0x11f2('0x2e')](_0x45983f,JSON[_0x11f2('0x1e')](_0x54b293));return _0xc0f81e;}function isValidIdToken(_0x124ae7,_0xe55e2){try{var _0x348c83=jwt[_0x11f2('0x2f')](_0x124ae7,{'complete':!![]});var _0x47b085=_0x348c83[_0x11f2('0x30')];if(_0x47b085['iss']!==_0xe55e2['issuer'])return![];if(_0x47b085[_0x11f2('0x31')]!==_0xe55e2[_0x11f2('0x32')])return![];if(_0x47b085[_0x11f2('0x29')]!==_0xe55e2[_0x11f2('0x29')])return![];if(moment()[_0x11f2('0x33')](moment[_0x11f2('0x34')](_0x47b085[_0x11f2('0x35')])))return![];return!![];}catch(_0x33be51){throw _0x33be51;}}function refreshOauth2MicrosoftAccessToken(_0x17c4a4){return Promise['resolve']()[_0x11f2('0x36')](function(){if(_0x17c4a4[_0x11f2('0x37')])return _0x17c4a4;return db[_0x11f2('0x38')][_0x11f2('0x39')]({'where':{'id':_0x17c4a4['id']},'raw':!![]});})[_0x11f2('0x36')](function(_0x5c772e){var _0x4790e2={'grant_type':_0x11f2('0x3a'),'refresh_token':_0x5c772e[_0x11f2('0x3b')],'scope':getAccessTokenScope(_0x5c772e),'redirect_uri':_0x5c772e[_0x11f2('0x26')],'client_id':_0x5c772e[_0x11f2('0x23')],'client_secret':encryptor['decryptString'](_0x5c772e[_0x11f2('0x37')])};var _0x44b4ff={'method':_0x11f2('0x3c'),'uri':MICROSOFT_AUTH_URL[_0x11f2('0x3d')](_0x11f2('0x1b'),_0x5c772e['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4790e2,'json':!![]};return rp(_0x44b4ff);})[_0x11f2('0x36')](function(_0x50216c){_0x17c4a4[_0x11f2('0x3e')]=_0x50216c['access_token'];_0x17c4a4['data6']=_0x50216c[_0x11f2('0x3a')];return db[_0x11f2('0x38')][_0x11f2('0x3f')]({'data5':_0x17c4a4[_0x11f2('0x3e')],'data6':_0x17c4a4[_0x11f2('0x3b')]},{'where':{'id':_0x17c4a4['id']}});})['then'](function(){return _0x17c4a4;})['catch'](function(_0x5be7d4){logger[_0x11f2('0x40')](_0x11f2('0x41'),_0x17c4a4['id'],_0x5be7d4);});}function getOauth2MicrosoftAccessToken(_0x173a02,_0x145b5e){var _0x48497f={'grant_type':_0x11f2('0x42'),'code':_0x173a02,'scope':getAccessTokenScope(_0x145b5e),'redirect_uri':_0x145b5e[_0x11f2('0x26')],'client_id':_0x145b5e[_0x11f2('0x23')],'client_secret':encryptor[_0x11f2('0x43')](_0x145b5e['data3'])};var _0x5d0579={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x11f2('0x3d')]('{TENANT_ID}',_0x145b5e[_0x11f2('0x44')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x48497f,'json':!![]};return rp(_0x5d0579);}function startRefreshInterval(_0x443a0b){var _0x422b0c=schedule['intervals'];if(_0x422b0c[_0x443a0b['id']])clearInterval(_0x422b0c[_0x443a0b['id']]);_0x422b0c[_0x443a0b['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x443a0b['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x11f2('0x45')]=_0x422b0c;}function startAllRefreshIntervals(){return db[_0x11f2('0x38')][_0x11f2('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x11f2('0x36')](function(_0x5b86a2){var _0x3c4e75=_0x5b86a2[_0x11f2('0x13')](function(_0x541a71){return refreshOauth2MicrosoftAccessToken(_0x541a71)['then'](function(_0x416c93){startRefreshInterval(_0x416c93);});});return Promise[_0x11f2('0x47')](_0x3c4e75);})['catch'](function(_0x538465){var _0x50fead=_0x538465?util['inspect'](_0x538465,{'showHidden':![],'depth':null}):'';logger[_0x11f2('0x40')](_0x11f2('0x48'),_0x50fead);});}module[_0x11f2('0x49')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 6c88024..b344491 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 _0x79d7=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x79d7,0x9c));var _0x779d=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x79d7[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x779d('0x0'));var util=require('util');var moment=require(_0x779d('0x1'));var BPromise=require(_0x779d('0x2'));var rs=require(_0x779d('0x3'));var fs=require('fs');var Redis=require(_0x779d('0x4'));var db=require(_0x779d('0x5'))['db'];var utils=require(_0x779d('0x6'));var logger=require('../../config/logger')(_0x779d('0x7'));var config=require(_0x779d('0x8'));var jayson=require(_0x779d('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x227c87,_0x4c7fb4,_0xc067dd){return new BPromise(function(_0x2f83f6,_0x4c7c92){return client['request'](_0x227c87,_0xc067dd)['then'](function(_0x5b4ef2){logger[_0x779d('0xa')](_0x779d('0xb'),_0x4c7fb4,_0x779d('0xc'));logger['debug'](_0x779d('0xd'),_0x4c7fb4,'request\x20sent',JSON[_0x779d('0xe')](_0x5b4ef2));if(_0x5b4ef2['error']){if(_0x5b4ef2[_0x779d('0xf')][_0x779d('0x10')]===0x1f4){logger[_0x779d('0xf')]('CloudProvider,\x20%s,\x20%s',_0x4c7fb4,_0x5b4ef2[_0x779d('0xf')][_0x779d('0x11')]);return _0x4c7c92(_0x5b4ef2[_0x779d('0xf')][_0x779d('0x11')]);}logger[_0x779d('0xf')](_0x779d('0xb'),_0x4c7fb4,_0x5b4ef2['error'][_0x779d('0x11')]);return _0x2f83f6(_0x5b4ef2[_0x779d('0xf')][_0x779d('0x11')]);}else{logger[_0x779d('0xa')](_0x779d('0xb'),_0x4c7fb4,'request\x20sent');_0x2f83f6(_0x5b4ef2[_0x779d('0x12')][_0x779d('0x11')]);}})[_0x779d('0x13')](function(_0x4cc248){logger[_0x779d('0xf')](_0x779d('0xb'),_0x4c7fb4,_0x4cc248);_0x4c7c92(_0x4cc248);});});}
\ No newline at end of file
+var _0x1189=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash'];(function(_0x51d2e0,_0x576a37){var _0x5359b5=function(_0xbb528a){while(--_0xbb528a){_0x51d2e0['push'](_0x51d2e0['shift']());}};_0x5359b5(++_0x576a37);}(_0x1189,0x17f));var _0x9118=function(_0x316e2b,_0x40efd7){_0x316e2b=_0x316e2b-0x0;var _0x2e4809=_0x1189[_0x316e2b];return _0x2e4809;};'use strict';var _=require(_0x9118('0x0'));var util=require(_0x9118('0x1'));var moment=require(_0x9118('0x2'));var BPromise=require(_0x9118('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9118('0x4'));var db=require(_0x9118('0x5'))['db'];var utils=require(_0x9118('0x6'));var logger=require(_0x9118('0x7'))(_0x9118('0x8'));var config=require(_0x9118('0x9'));var jayson=require(_0x9118('0xa'));var client=jayson['client'][_0x9118('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x370bec,_0x21251a,_0x3df1a3){return new BPromise(function(_0x37e930,_0xad3e6e){return client['request'](_0x370bec,_0x3df1a3)[_0x9118('0xc')](function(_0x227eea){logger[_0x9118('0xd')](_0x9118('0xe'),_0x21251a,_0x9118('0xf'));logger[_0x9118('0x10')](_0x9118('0x11'),_0x21251a,'request\x20sent',JSON[_0x9118('0x12')](_0x227eea));if(_0x227eea['error']){if(_0x227eea['error'][_0x9118('0x13')]===0x1f4){logger[_0x9118('0x14')]('CloudProvider,\x20%s,\x20%s',_0x21251a,_0x227eea[_0x9118('0x14')][_0x9118('0x15')]);return _0xad3e6e(_0x227eea[_0x9118('0x14')][_0x9118('0x15')]);}logger[_0x9118('0x14')](_0x9118('0xe'),_0x21251a,_0x227eea[_0x9118('0x14')][_0x9118('0x15')]);return _0x37e930(_0x227eea[_0x9118('0x14')][_0x9118('0x15')]);}else{logger[_0x9118('0xd')]('CloudProvider,\x20%s,\x20%s',_0x21251a,'request\x20sent');_0x37e930(_0x227eea[_0x9118('0x16')]['message']);}})[_0x9118('0x17')](function(_0x1ff727){logger[_0x9118('0x14')](_0x9118('0xe'),_0x21251a,_0x1ff727);_0xad3e6e(_0x1ff727);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 0cdb3de..af48dc4 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 _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x7a54,0x106));var _0x47a5=function(_0x3cec2e,_0x39de83){_0x3cec2e=_0x3cec2e-0x0;var _0xc8294f=_0x7a54[_0x3cec2e];return _0xc8294f;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router;
\ No newline at end of file
+var _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x2ecf65,_0x3c293d){var _0x55cd74=function(_0x12085b){while(--_0x12085b){_0x2ecf65['push'](_0x2ecf65['shift']());}};_0x55cd74(++_0x3c293d);}(_0xdb28,0x106));var _0x8db2=function(_0x3ec49d,_0x534c18){_0x3ec49d=_0x3ec49d-0x0;var _0x428f66=_0xdb28[_0x3ec49d];return _0x428f66;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 8fd6b59..1ac6650 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 _0x2a5e=['sequelize','name','STRING'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x2a5e,0xf6));var _0xe2a5=function(_0x4127b0,_0x249d6c){_0x4127b0=_0x4127b0-0x0;var _0x4ae7f6=_0x2a5e[_0x4127b0];return _0x4ae7f6;};'use strict';var Sequelize=require(_0xe2a5('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xe2a5('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe2a5('0x2')]},'companyId':{'type':Sequelize[_0xe2a5('0x2')]},'website':{'type':Sequelize[_0xe2a5('0x2')]},'phone':{'type':Sequelize[_0xe2a5('0x2')]},'fax':{'type':Sequelize[_0xe2a5('0x2')]},'type':{'type':Sequelize[_0xe2a5('0x2')]},'street':{'type':Sequelize[_0xe2a5('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xe2a5('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xe2a5('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xe2a5('0x2')]},'sPostalCode':{'type':Sequelize[_0xe2a5('0x2')]},'sCity':{'type':Sequelize[_0xe2a5('0x2')]},'sCountry':{'type':Sequelize[_0xe2a5('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x3073=['name','STRING'];(function(_0x529a0f,_0x328763){var _0x187a88=function(_0x1ea706){while(--_0x1ea706){_0x529a0f['push'](_0x529a0f['shift']());}};_0x187a88(++_0x328763);}(_0x3073,0x17c));var _0x3307=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x3073[_0x1e3c16];return _0x47a0c9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x3307('0x0'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x3307('0x1')]},'companyId':{'type':Sequelize[_0x3307('0x1')]},'website':{'type':Sequelize[_0x3307('0x1')]},'phone':{'type':Sequelize[_0x3307('0x1')]},'fax':{'type':Sequelize[_0x3307('0x1')]},'type':{'type':Sequelize[_0x3307('0x1')]},'street':{'type':Sequelize[_0x3307('0x1')]},'postalCode':{'type':Sequelize[_0x3307('0x1')]},'city':{'type':Sequelize[_0x3307('0x1')]},'country':{'type':Sequelize[_0x3307('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x3307('0x1')]},'sStreet':{'type':Sequelize[_0x3307('0x1')]},'sPostalCode':{'type':Sequelize[_0x3307('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x3307('0x1')]},'description':{'type':Sequelize[_0x3307('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index c3a6d36..9c6353b 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 _0xbf26=['map','options','findAll','catch','show','params','rawAttributes','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','omit','ids','getContacts','findOne','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','destroy','then','get','Companies','UserProfileResource','error','stack','name','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge'];(function(_0x374397,_0x14987c){var _0x57e020=function(_0xec7f31){while(--_0xec7f31){_0x374397['push'](_0x374397['shift']());}};_0x57e020(++_0x14987c);}(_0xbf26,0xb7));var _0x6bf2=function(_0x154285,_0x5a9804){_0x154285=_0x154285-0x0;var _0x21db10=_0xbf26[_0x154285];return _0x21db10;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6bf2('0x0'));var zipdir=require(_0x6bf2('0x1'));var jsonpatch=require(_0x6bf2('0x2'));var rp=require(_0x6bf2('0x3'));var moment=require(_0x6bf2('0x4'));var BPromise=require(_0x6bf2('0x5'));var Mustache=require('mustache');var util=require(_0x6bf2('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6bf2('0x7'));var ejs=require(_0x6bf2('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6bf2('0x9'));var crypto=require('crypto');var jsforce=require(_0x6bf2('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6bf2('0x7'));var querystring=require(_0x6bf2('0xb'));var Papa=require(_0x6bf2('0xc'));var Redis=require('ioredis');var authService=require(_0x6bf2('0xd'));var qs=require(_0x6bf2('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6bf2('0xf'))(_0x6bf2('0x10'));var utils=require(_0x6bf2('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x6bf2('0x12'));var db=require(_0x6bf2('0x13'))['db'];function respondWithStatusCode(_0x57427d,_0x5d1f60){_0x5d1f60=_0x5d1f60||0xcc;return function(_0x3cb104){if(_0x3cb104){return _0x57427d[_0x6bf2('0x14')](_0x5d1f60);}return _0x57427d[_0x6bf2('0x15')](_0x5d1f60)[_0x6bf2('0x16')]();};}function respondWithResult(_0x42a236,_0x58fb37){_0x58fb37=_0x58fb37||0xc8;return function(_0x260c9c){if(_0x260c9c){return _0x42a236[_0x6bf2('0x15')](_0x58fb37)[_0x6bf2('0x17')](_0x260c9c);}};}function respondWithFilteredResult(_0x3c5e5d,_0xaec504){return function(_0x24b5b2){if(_0x24b5b2){var _0x59ffff=typeof _0xaec504[_0x6bf2('0x18')]===_0x6bf2('0x19')&&typeof _0xaec504[_0x6bf2('0x1a')]===_0x6bf2('0x19');var _0x5d0863=_0x24b5b2[_0x6bf2('0x1b')];var _0x4ae745=_0x59ffff?0x0:_0xaec504[_0x6bf2('0x18')];var _0xa369f9=_0x59ffff?_0x24b5b2[_0x6bf2('0x1b')]:_0xaec504[_0x6bf2('0x18')]+_0xaec504[_0x6bf2('0x1a')];var _0x1dd17c;if(_0xa369f9>=_0x5d0863){_0xa369f9=_0x5d0863;_0x1dd17c=0xc8;}else{_0x1dd17c=0xce;}_0x3c5e5d[_0x6bf2('0x15')](_0x1dd17c);return _0x3c5e5d[_0x6bf2('0x1c')]('Content-Range',_0x4ae745+'-'+_0xa369f9+'/'+_0x5d0863)[_0x6bf2('0x17')](_0x24b5b2);}return null;};}function patchUpdates(_0x51f2ff){return function(_0x5dfb67){try{jsonpatch[_0x6bf2('0x1d')](_0x5dfb67,_0x51f2ff,!![]);}catch(_0x5914f9){return BPromise['reject'](_0x5914f9);}return _0x5dfb67['save']();};}function saveUpdates(_0x31ca0d,_0x4426b8){return function(_0x10b384){if(_0x10b384){return _0x10b384[_0x6bf2('0x1e')](_0x31ca0d)['then'](function(_0x224764){return _0x224764;});}return null;};}function removeEntity(_0x1f62c,_0x540dd8){return function(_0x1b98c3){if(_0x1b98c3){return _0x1b98c3[_0x6bf2('0x1f')]()[_0x6bf2('0x20')](function(){var _0x4ea68e=_0x1b98c3[_0x6bf2('0x21')]({'plain':!![]});var _0x229b2d=_0x6bf2('0x22');return db[_0x6bf2('0x23')]['destroy']({'where':{'type':_0x229b2d,'resourceId':_0x4ea68e['id']}})[_0x6bf2('0x20')](function(){return _0x1b98c3;});})[_0x6bf2('0x20')](function(){_0x1f62c[_0x6bf2('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e0a6f,_0x235248){return function(_0x32b940){if(!_0x32b940){_0x2e0a6f[_0x6bf2('0x14')](0x194);}return _0x32b940;};}function handleError(_0xf65c82,_0x1d2e5b){_0x1d2e5b=_0x1d2e5b||0x1f4;return function(_0x8d4c6){logger[_0x6bf2('0x24')](_0x8d4c6[_0x6bf2('0x25')]);if(_0x8d4c6['name']){delete _0x8d4c6[_0x6bf2('0x26')];}_0xf65c82[_0x6bf2('0x15')](_0x1d2e5b)['send'](_0x8d4c6);};}exports[_0x6bf2('0x27')]=function(_0x32ffff,_0x4e1298){var _0x33b234={},_0x5a4487={},_0x58b9b8={'count':0x0,'rows':[]};return db[_0x6bf2('0x28')][_0x6bf2('0x29')]()[_0x6bf2('0x20')](function(_0x56ae19){_0x5a4487[_0x6bf2('0x2a')]=_[_0x6bf2('0x2b')](_0x56ae19);_0x5a4487[_0x6bf2('0x2c')]=_[_0x6bf2('0x2b')](_0x32ffff[_0x6bf2('0x2c')]);_0x5a4487[_0x6bf2('0x2d')]=_[_0x6bf2('0x2e')](_0x5a4487['model'],_0x5a4487['query']);_0x33b234[_0x6bf2('0x2f')]=_['intersection'](_0x5a4487[_0x6bf2('0x2a')],qs[_0x6bf2('0x30')](_0x32ffff['query'][_0x6bf2('0x30')]));_0x33b234[_0x6bf2('0x2f')]=_0x33b234['attributes'][_0x6bf2('0x31')]?_0x33b234[_0x6bf2('0x2f')]:_0x5a4487[_0x6bf2('0x2a')];if(!_0x32ffff['query'][_0x6bf2('0x32')]('nolimit')){_0x33b234[_0x6bf2('0x1a')]=qs[_0x6bf2('0x1a')](_0x32ffff[_0x6bf2('0x2c')][_0x6bf2('0x1a')]);_0x33b234[_0x6bf2('0x18')]=qs[_0x6bf2('0x18')](_0x32ffff[_0x6bf2('0x2c')]['offset']);}_0x33b234[_0x6bf2('0x33')]=qs[_0x6bf2('0x34')](_0x32ffff['query'][_0x6bf2('0x34')]);_0x33b234[_0x6bf2('0x35')]=qs['filters'](_[_0x6bf2('0x36')](_0x32ffff['query'],_0x5a4487[_0x6bf2('0x2d')]),_0x56ae19);if(_0x32ffff[_0x6bf2('0x2c')][_0x6bf2('0x37')]){_0x33b234[_0x6bf2('0x35')]=_[_0x6bf2('0x38')](_0x33b234[_0x6bf2('0x35')],{'$or':_[_0x6bf2('0x39')](_0x33b234[_0x6bf2('0x2f')],function(_0xd4a59e){var _0x3faa87={};_0x3faa87[_0xd4a59e]={'$like':'%'+_0x32ffff[_0x6bf2('0x2c')][_0x6bf2('0x37')]+'%'};return _0x3faa87;})});}_0x33b234=_[_0x6bf2('0x38')]({},_0x33b234,_0x32ffff[_0x6bf2('0x3a')]);var _0x302767={'where':_0x33b234[_0x6bf2('0x35')]};return db[_0x6bf2('0x28')][_0x6bf2('0x1b')](_0x302767)[_0x6bf2('0x20')](function(_0x38c14c){_0x58b9b8[_0x6bf2('0x1b')]=_0x38c14c;if(_0x32ffff[_0x6bf2('0x2c')]['includeAll']){_0x33b234['include']=[{'all':!![]}];}return db[_0x6bf2('0x28')][_0x6bf2('0x3b')](_0x33b234);})['then'](function(_0x1532b4){_0x58b9b8['rows']=_0x1532b4;return _0x58b9b8;})['then'](respondWithFilteredResult(_0x4e1298,_0x33b234))[_0x6bf2('0x3c')](handleError(_0x4e1298,null));})[_0x6bf2('0x3c')](handleError(_0x4e1298,null));};exports[_0x6bf2('0x3d')]=function(_0x5cbb09,_0x1577dd){var _0x149269={'raw':![],'where':{'id':_0x5cbb09[_0x6bf2('0x3e')]['id']}},_0x3fb9d5={};_0x3fb9d5[_0x6bf2('0x2a')]=_[_0x6bf2('0x2b')](db[_0x6bf2('0x28')][_0x6bf2('0x3f')]);_0x3fb9d5[_0x6bf2('0x2c')]=_['keys'](_0x5cbb09['query']);_0x3fb9d5[_0x6bf2('0x2d')]=_[_0x6bf2('0x2e')](_0x3fb9d5['model'],_0x3fb9d5['query']);_0x149269[_0x6bf2('0x2f')]=_[_0x6bf2('0x2e')](_0x3fb9d5[_0x6bf2('0x2a')],qs['fields'](_0x5cbb09[_0x6bf2('0x2c')][_0x6bf2('0x30')]));_0x149269['attributes']=_0x149269[_0x6bf2('0x2f')][_0x6bf2('0x31')]?_0x149269[_0x6bf2('0x2f')]:_0x3fb9d5[_0x6bf2('0x2a')];if(_0x5cbb09[_0x6bf2('0x2c')]['includeAll']){_0x149269[_0x6bf2('0x40')]=[{'all':!![]}];}_0x149269=_[_0x6bf2('0x38')]({},_0x149269,_0x5cbb09[_0x6bf2('0x3a')]);return db['CmCompany']['find'](_0x149269)['then'](handleEntityNotFound(_0x1577dd,null))[_0x6bf2('0x20')](respondWithResult(_0x1577dd,null))['catch'](handleError(_0x1577dd,null));};exports[_0x6bf2('0x41')]=function(_0xe83c23,_0x47b400){return db[_0x6bf2('0x28')][_0x6bf2('0x41')](_0xe83c23[_0x6bf2('0x42')],{})[_0x6bf2('0x20')](function(_0x476560){var _0x406d2d=_0xe83c23['user'][_0x6bf2('0x21')]({'plain':!![]});if(!_0x406d2d)throw new Error(_0x6bf2('0x43'));if(_0x406d2d['role']===_0x6bf2('0x44')){var _0x400deb=_0x476560['get']({'plain':!![]});var _0x5f213f=_0x6bf2('0x22');return db[_0x6bf2('0x45')][_0x6bf2('0x46')]({'where':{'name':_0x5f213f,'userProfileId':_0x406d2d['userProfileId']},'raw':!![]})[_0x6bf2('0x20')](function(_0x1521dc){if(_0x1521dc&&_0x1521dc[_0x6bf2('0x47')]===0x0){return db[_0x6bf2('0x23')][_0x6bf2('0x41')]({'name':_0x400deb[_0x6bf2('0x26')],'resourceId':_0x400deb['id'],'type':_0x1521dc[_0x6bf2('0x26')],'sectionId':_0x1521dc['id']},{})[_0x6bf2('0x20')](function(){return _0x476560;});}else{return _0x476560;}})['catch'](function(_0x2c8491){logger[_0x6bf2('0x24')](_0x6bf2('0x48'),_0x2c8491);throw _0x2c8491;});}return _0x476560;})[_0x6bf2('0x20')](respondWithResult(_0x47b400,0xc9))['catch'](handleError(_0x47b400,null));};exports[_0x6bf2('0x1e')]=function(_0x4a31b3,_0x40964b){if(_0x4a31b3[_0x6bf2('0x42')]['id']){delete _0x4a31b3[_0x6bf2('0x42')]['id'];}return db['CmCompany'][_0x6bf2('0x46')]({'where':{'id':_0x4a31b3[_0x6bf2('0x3e')]['id']}})[_0x6bf2('0x20')](handleEntityNotFound(_0x40964b,null))[_0x6bf2('0x20')](saveUpdates(_0x4a31b3[_0x6bf2('0x42')],null))[_0x6bf2('0x20')](respondWithResult(_0x40964b,null))[_0x6bf2('0x3c')](handleError(_0x40964b,null));};exports[_0x6bf2('0x1f')]=function(_0x36503b,_0x188feb){return db[_0x6bf2('0x28')][_0x6bf2('0x46')]({'where':{'id':_0x36503b['params']['id']}})[_0x6bf2('0x20')](handleEntityNotFound(_0x188feb,null))[_0x6bf2('0x20')](removeEntity(_0x188feb,null))[_0x6bf2('0x3c')](handleError(_0x188feb,null));};exports[_0x6bf2('0x29')]=function(_0x3073dc,_0x15f65c){return db['CmCompany']['describe']()[_0x6bf2('0x20')](respondWithResult(_0x15f65c,null))['catch'](handleError(_0x15f65c,null));};exports[_0x6bf2('0x49')]=function(_0x6c10f,_0xa3f56e,_0x51d9cc){return db[_0x6bf2('0x4a')][_0x6bf2('0x46')]({'where':{'id':_0x6c10f[_0x6bf2('0x3e')]['id']}})[_0x6bf2('0x20')](handleEntityNotFound(_0xa3f56e,null))[_0x6bf2('0x20')](function(_0x7d763e){if(_0x7d763e){return _0x7d763e[_0x6bf2('0x49')](_0x6c10f['body']['ids'],_[_0x6bf2('0x4b')](_0x6c10f[_0x6bf2('0x42')],[_0x6bf2('0x4c'),'id'])||{});}})[_0x6bf2('0x20')](respondWithResult(_0xa3f56e,null))[_0x6bf2('0x3c')](handleError(_0xa3f56e,null));};exports[_0x6bf2('0x4d')]=function(_0x1ae484,_0xbd935c,_0x42b966){var _0x249df1={};var _0x246de6={};var _0x41b2f7;var _0x511f91;return db['CmCompany'][_0x6bf2('0x4e')]({'where':{'id':_0x1ae484[_0x6bf2('0x3e')]['id']}})[_0x6bf2('0x20')](handleEntityNotFound(_0xbd935c,null))[_0x6bf2('0x20')](function(_0x40dd74){if(_0x40dd74){_0x41b2f7=_0x40dd74;_0x246de6['model']=_[_0x6bf2('0x2b')](db[_0x6bf2('0x4a')]['rawAttributes']);_0x246de6[_0x6bf2('0x2c')]=_[_0x6bf2('0x2b')](_0x1ae484[_0x6bf2('0x2c')]);_0x246de6[_0x6bf2('0x2d')]=_['intersection'](_0x246de6[_0x6bf2('0x2a')],_0x246de6['query']);_0x249df1['attributes']=_['intersection'](_0x246de6['model'],qs[_0x6bf2('0x30')](_0x1ae484[_0x6bf2('0x2c')][_0x6bf2('0x30')]));_0x249df1[_0x6bf2('0x2f')]=_0x249df1[_0x6bf2('0x2f')][_0x6bf2('0x31')]?_0x249df1[_0x6bf2('0x2f')]:_0x246de6[_0x6bf2('0x2a')];_0x249df1['order']=qs[_0x6bf2('0x34')](_0x1ae484[_0x6bf2('0x2c')][_0x6bf2('0x34')]);_0x249df1[_0x6bf2('0x35')]=qs[_0x6bf2('0x2d')](_[_0x6bf2('0x36')](_0x1ae484['query'],_0x246de6[_0x6bf2('0x2d')]));if(_0x1ae484[_0x6bf2('0x2c')][_0x6bf2('0x37')]){_0x249df1[_0x6bf2('0x35')]=_[_0x6bf2('0x38')](_0x249df1[_0x6bf2('0x35')],{'$or':_['map'](_0x249df1[_0x6bf2('0x2f')],function(_0x1beadd){var _0x59ed51={};_0x59ed51[_0x1beadd]={'$like':'%'+_0x1ae484[_0x6bf2('0x2c')][_0x6bf2('0x37')]+'%'};return _0x59ed51;})});}_0x249df1=_[_0x6bf2('0x38')]({},_0x249df1,_0x1ae484[_0x6bf2('0x3a')]);return _0x41b2f7[_0x6bf2('0x4d')](_0x249df1);}})[_0x6bf2('0x20')](function(_0xb169c4){if(_0xb169c4){_0x511f91=_0xb169c4[_0x6bf2('0x31')];if(!_0x1ae484[_0x6bf2('0x2c')]['hasOwnProperty'](_0x6bf2('0x4f'))){_0x249df1[_0x6bf2('0x1a')]=qs['limit'](_0x1ae484[_0x6bf2('0x2c')][_0x6bf2('0x1a')]);_0x249df1[_0x6bf2('0x18')]=qs[_0x6bf2('0x18')](_0x1ae484[_0x6bf2('0x2c')][_0x6bf2('0x18')]);}return _0x41b2f7[_0x6bf2('0x4d')](_0x249df1);}})['then'](function(_0x1271ed){if(_0x1271ed){return _0x1271ed?{'count':_0x511f91,'rows':_0x1271ed}:null;}})['then'](respondWithResult(_0xbd935c,null))[_0x6bf2('0x3c')](handleError(_0xbd935c,null));};
\ No newline at end of file
+var _0x6e1a=['find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','params','describe','addContacts','CmContact','ids','findOne','getContacts','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','get','Companies','UserProfileResource','error','name','send','index','CmCompany','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','catch','show','rawAttributes'];(function(_0x1b58dd,_0x14bc5d){var _0x3511e9=function(_0x3aedd2){while(--_0x3aedd2){_0x1b58dd['push'](_0x1b58dd['shift']());}};_0x3511e9(++_0x14bc5d);}(_0x6e1a,0x64));var _0xa6e1=function(_0x3f44c0,_0xdc21d1){_0x3f44c0=_0x3f44c0-0x0;var _0x18fa0f=_0x6e1a[_0x3f44c0];return _0x18fa0f;};'use strict';var emlformat=require(_0xa6e1('0x0'));var rimraf=require(_0xa6e1('0x1'));var zipdir=require(_0xa6e1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa6e1('0x3'));var moment=require('moment');var BPromise=require(_0xa6e1('0x4'));var Mustache=require(_0xa6e1('0x5'));var util=require(_0xa6e1('0x6'));var path=require('path');var sox=require(_0xa6e1('0x7'));var csv=require(_0xa6e1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa6e1('0x9'));var _=require(_0xa6e1('0xa'));var squel=require('squel');var crypto=require(_0xa6e1('0xb'));var jsforce=require(_0xa6e1('0xc'));var deskjs=require(_0xa6e1('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa6e1('0xe'));var Redis=require(_0xa6e1('0xf'));var authService=require(_0xa6e1('0x10'));var qs=require(_0xa6e1('0x11'));var as=require(_0xa6e1('0x12'));var hardwareService=require(_0xa6e1('0x13'));var logger=require(_0xa6e1('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xa6e1('0x15'));var licenseUtil=require(_0xa6e1('0x16'));var db=require(_0xa6e1('0x17'))['db'];function respondWithStatusCode(_0x636898,_0xf49172){_0xf49172=_0xf49172||0xcc;return function(_0x4aceb3){if(_0x4aceb3){return _0x636898['sendStatus'](_0xf49172);}return _0x636898[_0xa6e1('0x18')](_0xf49172)[_0xa6e1('0x19')]();};}function respondWithResult(_0x5535d0,_0x424abf){_0x424abf=_0x424abf||0xc8;return function(_0x33d60f){if(_0x33d60f){return _0x5535d0[_0xa6e1('0x18')](_0x424abf)[_0xa6e1('0x1a')](_0x33d60f);}};}function respondWithFilteredResult(_0x4d2af8,_0xbb54eb){return function(_0x90ae3){if(_0x90ae3){var _0x434b35=typeof _0xbb54eb[_0xa6e1('0x1b')]===_0xa6e1('0x1c')&&typeof _0xbb54eb[_0xa6e1('0x1d')]===_0xa6e1('0x1c');var _0xe73e6c=_0x90ae3[_0xa6e1('0x1e')];var _0x49811b=_0x434b35?0x0:_0xbb54eb[_0xa6e1('0x1b')];var _0x44cc17=_0x434b35?_0x90ae3['count']:_0xbb54eb[_0xa6e1('0x1b')]+_0xbb54eb[_0xa6e1('0x1d')];var _0x20771a;if(_0x44cc17>=_0xe73e6c){_0x44cc17=_0xe73e6c;_0x20771a=0xc8;}else{_0x20771a=0xce;}_0x4d2af8[_0xa6e1('0x18')](_0x20771a);return _0x4d2af8['set'](_0xa6e1('0x1f'),_0x49811b+'-'+_0x44cc17+'/'+_0xe73e6c)['json'](_0x90ae3);}return null;};}function patchUpdates(_0x39d9fa){return function(_0x23f693){try{jsonpatch[_0xa6e1('0x20')](_0x23f693,_0x39d9fa,!![]);}catch(_0x58028c){return BPromise[_0xa6e1('0x21')](_0x58028c);}return _0x23f693[_0xa6e1('0x22')]();};}function saveUpdates(_0x33824b,_0x455c00){return function(_0x12de3e){if(_0x12de3e){return _0x12de3e[_0xa6e1('0x23')](_0x33824b)['then'](function(_0x4b5f50){return _0x4b5f50;});}return null;};}function removeEntity(_0x1a8a0e,_0x191601){return function(_0x58e741){if(_0x58e741){return _0x58e741[_0xa6e1('0x24')]()[_0xa6e1('0x25')](function(){var _0x52e1e7=_0x58e741[_0xa6e1('0x26')]({'plain':!![]});var _0x488da5=_0xa6e1('0x27');return db[_0xa6e1('0x28')][_0xa6e1('0x24')]({'where':{'type':_0x488da5,'resourceId':_0x52e1e7['id']}})[_0xa6e1('0x25')](function(){return _0x58e741;});})['then'](function(){_0x1a8a0e['status'](0xcc)[_0xa6e1('0x19')]();});}};}function handleEntityNotFound(_0x2097b0,_0x1648d7){return function(_0x155aca){if(!_0x155aca){_0x2097b0['sendStatus'](0x194);}return _0x155aca;};}function handleError(_0x5a3954,_0x1a2f84){_0x1a2f84=_0x1a2f84||0x1f4;return function(_0x37e4bb){logger[_0xa6e1('0x29')](_0x37e4bb['stack']);if(_0x37e4bb[_0xa6e1('0x2a')]){delete _0x37e4bb[_0xa6e1('0x2a')];}_0x5a3954[_0xa6e1('0x18')](_0x1a2f84)[_0xa6e1('0x2b')](_0x37e4bb);};}exports[_0xa6e1('0x2c')]=function(_0x24950b,_0x192e16){var _0x4d157b={},_0x43cabe={},_0x151dfe={'count':0x0,'rows':[]};return db[_0xa6e1('0x2d')]['describe']()[_0xa6e1('0x25')](function(_0x5f4e40){_0x43cabe[_0xa6e1('0x2e')]=_[_0xa6e1('0x2f')](_0x5f4e40);_0x43cabe[_0xa6e1('0x30')]=_[_0xa6e1('0x2f')](_0x24950b[_0xa6e1('0x30')]);_0x43cabe[_0xa6e1('0x31')]=_['intersection'](_0x43cabe[_0xa6e1('0x2e')],_0x43cabe['query']);_0x4d157b[_0xa6e1('0x32')]=_[_0xa6e1('0x33')](_0x43cabe[_0xa6e1('0x2e')],qs[_0xa6e1('0x34')](_0x24950b[_0xa6e1('0x30')][_0xa6e1('0x34')]));_0x4d157b[_0xa6e1('0x32')]=_0x4d157b[_0xa6e1('0x32')][_0xa6e1('0x35')]?_0x4d157b[_0xa6e1('0x32')]:_0x43cabe[_0xa6e1('0x2e')];if(!_0x24950b[_0xa6e1('0x30')][_0xa6e1('0x36')](_0xa6e1('0x37'))){_0x4d157b['limit']=qs[_0xa6e1('0x1d')](_0x24950b[_0xa6e1('0x30')][_0xa6e1('0x1d')]);_0x4d157b[_0xa6e1('0x1b')]=qs[_0xa6e1('0x1b')](_0x24950b['query'][_0xa6e1('0x1b')]);}_0x4d157b[_0xa6e1('0x38')]=qs[_0xa6e1('0x39')](_0x24950b[_0xa6e1('0x30')]['sort']);_0x4d157b[_0xa6e1('0x3a')]=qs[_0xa6e1('0x31')](_[_0xa6e1('0x3b')](_0x24950b[_0xa6e1('0x30')],_0x43cabe['filters']),_0x5f4e40);if(_0x24950b['query'][_0xa6e1('0x3c')]){_0x4d157b['where']=_[_0xa6e1('0x3d')](_0x4d157b['where'],{'$or':_[_0xa6e1('0x3e')](_0x4d157b[_0xa6e1('0x32')],function(_0x3c3c02){var _0x50d571={};_0x50d571[_0x3c3c02]={'$like':'%'+_0x24950b['query'][_0xa6e1('0x3c')]+'%'};return _0x50d571;})});}_0x4d157b=_['merge']({},_0x4d157b,_0x24950b[_0xa6e1('0x3f')]);var _0x1dbb8c={'where':_0x4d157b['where']};return db['CmCompany'][_0xa6e1('0x1e')](_0x1dbb8c)[_0xa6e1('0x25')](function(_0x399e8e){_0x151dfe[_0xa6e1('0x1e')]=_0x399e8e;if(_0x24950b[_0xa6e1('0x30')][_0xa6e1('0x40')]){_0x4d157b[_0xa6e1('0x41')]=[{'all':!![]}];}return db['CmCompany'][_0xa6e1('0x42')](_0x4d157b);})[_0xa6e1('0x25')](function(_0x16c256){_0x151dfe['rows']=_0x16c256;return _0x151dfe;})[_0xa6e1('0x25')](respondWithFilteredResult(_0x192e16,_0x4d157b))[_0xa6e1('0x43')](handleError(_0x192e16,null));})[_0xa6e1('0x43')](handleError(_0x192e16,null));};exports[_0xa6e1('0x44')]=function(_0x597194,_0x2883d4){var _0x5f77cc={'raw':![],'where':{'id':_0x597194['params']['id']}},_0xe9e5b1={};_0xe9e5b1[_0xa6e1('0x2e')]=_[_0xa6e1('0x2f')](db[_0xa6e1('0x2d')][_0xa6e1('0x45')]);_0xe9e5b1[_0xa6e1('0x30')]=_[_0xa6e1('0x2f')](_0x597194[_0xa6e1('0x30')]);_0xe9e5b1['filters']=_[_0xa6e1('0x33')](_0xe9e5b1[_0xa6e1('0x2e')],_0xe9e5b1['query']);_0x5f77cc[_0xa6e1('0x32')]=_['intersection'](_0xe9e5b1[_0xa6e1('0x2e')],qs[_0xa6e1('0x34')](_0x597194['query'][_0xa6e1('0x34')]));_0x5f77cc[_0xa6e1('0x32')]=_0x5f77cc[_0xa6e1('0x32')][_0xa6e1('0x35')]?_0x5f77cc[_0xa6e1('0x32')]:_0xe9e5b1[_0xa6e1('0x2e')];if(_0x597194[_0xa6e1('0x30')][_0xa6e1('0x40')]){_0x5f77cc[_0xa6e1('0x41')]=[{'all':!![]}];}_0x5f77cc=_[_0xa6e1('0x3d')]({},_0x5f77cc,_0x597194[_0xa6e1('0x3f')]);return db[_0xa6e1('0x2d')][_0xa6e1('0x46')](_0x5f77cc)[_0xa6e1('0x25')](handleEntityNotFound(_0x2883d4,null))[_0xa6e1('0x25')](respondWithResult(_0x2883d4,null))[_0xa6e1('0x43')](handleError(_0x2883d4,null));};exports[_0xa6e1('0x47')]=function(_0x367c5b,_0x3c8bc7){return db[_0xa6e1('0x2d')][_0xa6e1('0x47')](_0x367c5b[_0xa6e1('0x48')],{})[_0xa6e1('0x25')](function(_0x39bd1c){var _0x1d5240=_0x367c5b[_0xa6e1('0x49')][_0xa6e1('0x26')]({'plain':!![]});if(!_0x1d5240)throw new Error(_0xa6e1('0x4a'));if(_0x1d5240[_0xa6e1('0x4b')]===_0xa6e1('0x49')){var _0x22bfdf=_0x39bd1c[_0xa6e1('0x26')]({'plain':!![]});var _0x60c04d=_0xa6e1('0x27');return db[_0xa6e1('0x4c')][_0xa6e1('0x46')]({'where':{'name':_0x60c04d,'userProfileId':_0x1d5240['userProfileId']},'raw':!![]})[_0xa6e1('0x25')](function(_0xdff156){if(_0xdff156&&_0xdff156[_0xa6e1('0x4d')]===0x0){return db[_0xa6e1('0x28')][_0xa6e1('0x47')]({'name':_0x22bfdf['name'],'resourceId':_0x22bfdf['id'],'type':_0xdff156[_0xa6e1('0x2a')],'sectionId':_0xdff156['id']},{})['then'](function(){return _0x39bd1c;});}else{return _0x39bd1c;}})['catch'](function(_0x2d8345){logger[_0xa6e1('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d8345);throw _0x2d8345;});}return _0x39bd1c;})[_0xa6e1('0x25')](respondWithResult(_0x3c8bc7,0xc9))[_0xa6e1('0x43')](handleError(_0x3c8bc7,null));};exports[_0xa6e1('0x23')]=function(_0x3771aa,_0x2954a4){if(_0x3771aa['body']['id']){delete _0x3771aa[_0xa6e1('0x48')]['id'];}return db[_0xa6e1('0x2d')][_0xa6e1('0x46')]({'where':{'id':_0x3771aa[_0xa6e1('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2954a4,null))[_0xa6e1('0x25')](saveUpdates(_0x3771aa[_0xa6e1('0x48')],null))[_0xa6e1('0x25')](respondWithResult(_0x2954a4,null))[_0xa6e1('0x43')](handleError(_0x2954a4,null));};exports[_0xa6e1('0x24')]=function(_0x572d80,_0x4e00fb){return db[_0xa6e1('0x2d')][_0xa6e1('0x46')]({'where':{'id':_0x572d80[_0xa6e1('0x4e')]['id']}})[_0xa6e1('0x25')](handleEntityNotFound(_0x4e00fb,null))['then'](removeEntity(_0x4e00fb,null))['catch'](handleError(_0x4e00fb,null));};exports[_0xa6e1('0x4f')]=function(_0x349e73,_0xf3f59a){return db[_0xa6e1('0x2d')][_0xa6e1('0x4f')]()[_0xa6e1('0x25')](respondWithResult(_0xf3f59a,null))[_0xa6e1('0x43')](handleError(_0xf3f59a,null));};exports[_0xa6e1('0x50')]=function(_0x668453,_0x4d0478,_0x326bf2){return db[_0xa6e1('0x51')][_0xa6e1('0x46')]({'where':{'id':_0x668453[_0xa6e1('0x4e')]['id']}})[_0xa6e1('0x25')](handleEntityNotFound(_0x4d0478,null))[_0xa6e1('0x25')](function(_0x32b1ea){if(_0x32b1ea){return _0x32b1ea['addContacts'](_0x668453['body'][_0xa6e1('0x52')],_['omit'](_0x668453[_0xa6e1('0x48')],['ids','id'])||{});}})[_0xa6e1('0x25')](respondWithResult(_0x4d0478,null))[_0xa6e1('0x43')](handleError(_0x4d0478,null));};exports['getContacts']=function(_0x56333e,_0x3a17ae,_0x294667){var _0x4b7f8f={};var _0x30860a={};var _0x51ae9b;var _0xaef465;return db[_0xa6e1('0x2d')][_0xa6e1('0x53')]({'where':{'id':_0x56333e[_0xa6e1('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3a17ae,null))[_0xa6e1('0x25')](function(_0x1a1b8b){if(_0x1a1b8b){_0x51ae9b=_0x1a1b8b;_0x30860a[_0xa6e1('0x2e')]=_[_0xa6e1('0x2f')](db[_0xa6e1('0x51')][_0xa6e1('0x45')]);_0x30860a[_0xa6e1('0x30')]=_[_0xa6e1('0x2f')](_0x56333e[_0xa6e1('0x30')]);_0x30860a[_0xa6e1('0x31')]=_[_0xa6e1('0x33')](_0x30860a[_0xa6e1('0x2e')],_0x30860a[_0xa6e1('0x30')]);_0x4b7f8f[_0xa6e1('0x32')]=_[_0xa6e1('0x33')](_0x30860a[_0xa6e1('0x2e')],qs[_0xa6e1('0x34')](_0x56333e[_0xa6e1('0x30')][_0xa6e1('0x34')]));_0x4b7f8f['attributes']=_0x4b7f8f[_0xa6e1('0x32')]['length']?_0x4b7f8f['attributes']:_0x30860a[_0xa6e1('0x2e')];_0x4b7f8f[_0xa6e1('0x38')]=qs['sort'](_0x56333e[_0xa6e1('0x30')][_0xa6e1('0x39')]);_0x4b7f8f['where']=qs[_0xa6e1('0x31')](_[_0xa6e1('0x3b')](_0x56333e[_0xa6e1('0x30')],_0x30860a[_0xa6e1('0x31')]));if(_0x56333e[_0xa6e1('0x30')][_0xa6e1('0x3c')]){_0x4b7f8f['where']=_[_0xa6e1('0x3d')](_0x4b7f8f['where'],{'$or':_[_0xa6e1('0x3e')](_0x4b7f8f[_0xa6e1('0x32')],function(_0x5c859d){var _0x2e4cd4={};_0x2e4cd4[_0x5c859d]={'$like':'%'+_0x56333e['query'][_0xa6e1('0x3c')]+'%'};return _0x2e4cd4;})});}_0x4b7f8f=_[_0xa6e1('0x3d')]({},_0x4b7f8f,_0x56333e[_0xa6e1('0x3f')]);return _0x51ae9b[_0xa6e1('0x54')](_0x4b7f8f);}})[_0xa6e1('0x25')](function(_0x4bc05c){if(_0x4bc05c){_0xaef465=_0x4bc05c['length'];if(!_0x56333e[_0xa6e1('0x30')][_0xa6e1('0x36')](_0xa6e1('0x37'))){_0x4b7f8f[_0xa6e1('0x1d')]=qs[_0xa6e1('0x1d')](_0x56333e[_0xa6e1('0x30')][_0xa6e1('0x1d')]);_0x4b7f8f[_0xa6e1('0x1b')]=qs['offset'](_0x56333e['query'][_0xa6e1('0x1b')]);}return _0x51ae9b['getContacts'](_0x4b7f8f);}})['then'](function(_0x2089f5){if(_0x2089f5){return _0x2089f5?{'count':_0xaef465,'rows':_0x2089f5}:null;}})[_0xa6e1('0x25')](respondWithResult(_0x3a17ae,null))[_0xa6e1('0x43')](handleError(_0x3a17ae,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index d1a5013..09d5912 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 _0xda16=['exports','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x3e69c7,_0x1b9730){var _0x5e5259=function(_0x2312bc){while(--_0x2312bc){_0x3e69c7['push'](_0x3e69c7['shift']());}};_0x5e5259(++_0x1b9730);}(_0xda16,0x65));var _0x6da1=function(_0x4283e1,_0x80344){_0x4283e1=_0x4283e1-0x0;var _0x201855=_0xda16[_0x4283e1];return _0x201855;};'use strict';var _=require(_0x6da1('0x0'));var util=require(_0x6da1('0x1'));var logger=require(_0x6da1('0x2'))(_0x6da1('0x3'));var moment=require(_0x6da1('0x4'));var BPromise=require(_0x6da1('0x5'));var rp=require(_0x6da1('0x6'));var fs=require('fs');var path=require(_0x6da1('0x7'));var rimraf=require(_0x6da1('0x8'));var config=require(_0x6da1('0x9'));var attributes=require(_0x6da1('0xa'));module[_0x6da1('0xb')]=function(_0x31f417,_0x4c9b05){return _0x31f417['define'](_0x6da1('0xc'),attributes,{'tableName':_0x6da1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2002=['cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','exports','define','CmCompany'];(function(_0x2a9576,_0x2676e8){var _0x2f2342=function(_0x51f0a4){while(--_0x51f0a4){_0x2a9576['push'](_0x2a9576['shift']());}};_0x2f2342(++_0x2676e8);}(_0x2002,0x1b1));var _0x2200=function(_0x44a3b0,_0x352810){_0x44a3b0=_0x44a3b0-0x0;var _0x39e6f6=_0x2002[_0x44a3b0];return _0x39e6f6;};'use strict';var _=require(_0x2200('0x0'));var util=require(_0x2200('0x1'));var logger=require(_0x2200('0x2'))(_0x2200('0x3'));var moment=require(_0x2200('0x4'));var BPromise=require(_0x2200('0x5'));var rp=require(_0x2200('0x6'));var fs=require('fs');var path=require(_0x2200('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module[_0x2200('0x8')]=function(_0x37d836,_0x5b218d){return _0x37d836[_0x2200('0x9')](_0x2200('0xa'),attributes,{'tableName':_0x2200('0xb'),'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 d358261..c8c5b35 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 _0x7c73=['catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x3051ce,_0x32bb38){var _0x4226e4=function(_0x24b6ca){while(--_0x24b6ca){_0x3051ce['push'](_0x3051ce['shift']());}};_0x4226e4(++_0x32bb38);}(_0x7c73,0xc1));var _0x37c7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7c73[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x37c7('0x0'));var util=require(_0x37c7('0x1'));var moment=require('moment');var BPromise=require(_0x37c7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x37c7('0x3'));var db=require(_0x37c7('0x4'))['db'];var utils=require(_0x37c7('0x5'));var logger=require(_0x37c7('0x6'))(_0x37c7('0x7'));var config=require(_0x37c7('0x8'));var jayson=require(_0x37c7('0x9'));var client=jayson[_0x37c7('0xa')][_0x37c7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1491b5,_0x3d3fc0,_0x3506cf){return new BPromise(function(_0x146dd0,_0x198f97){return client[_0x37c7('0xc')](_0x1491b5,_0x3506cf)['then'](function(_0x290a3f){logger['info'](_0x37c7('0xd'),_0x3d3fc0,_0x37c7('0xe'));logger[_0x37c7('0xf')](_0x37c7('0x10'),_0x3d3fc0,'request\x20sent',JSON[_0x37c7('0x11')](_0x290a3f));if(_0x290a3f[_0x37c7('0x12')]){if(_0x290a3f[_0x37c7('0x12')][_0x37c7('0x13')]===0x1f4){logger[_0x37c7('0x12')]('CmCompany,\x20%s,\x20%s',_0x3d3fc0,_0x290a3f[_0x37c7('0x12')][_0x37c7('0x14')]);return _0x198f97(_0x290a3f[_0x37c7('0x12')][_0x37c7('0x14')]);}logger[_0x37c7('0x12')](_0x37c7('0xd'),_0x3d3fc0,_0x290a3f['error'][_0x37c7('0x14')]);return _0x146dd0(_0x290a3f[_0x37c7('0x12')][_0x37c7('0x14')]);}else{logger[_0x37c7('0x15')](_0x37c7('0xd'),_0x3d3fc0,_0x37c7('0xe'));_0x146dd0(_0x290a3f[_0x37c7('0x16')]['message']);}})[_0x37c7('0x17')](function(_0x330255){logger[_0x37c7('0x12')](_0x37c7('0xd'),_0x3d3fc0,_0x330255);_0x198f97(_0x330255);});});}
\ No newline at end of file
+var _0xdcab=['then','info','debug','request\x20sent','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','../../config/logger','jayson/promise','client','http','request'];(function(_0x239622,_0x1f38db){var _0x46cd02=function(_0x228687){while(--_0x228687){_0x239622['push'](_0x239622['shift']());}};_0x46cd02(++_0x1f38db);}(_0xdcab,0x13b));var _0xbdca=function(_0x47b024,_0x43ec89){_0x47b024=_0x47b024-0x0;var _0x2a61f6=_0xdcab[_0x47b024];return _0x2a61f6;};'use strict';var _=require(_0xbdca('0x0'));var util=require(_0xbdca('0x1'));var moment=require('moment');var BPromise=require(_0xbdca('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbdca('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbdca('0x4'));var client=jayson[_0xbdca('0x5')][_0xbdca('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x33abdc,_0x413d9f,_0x2354bf){return new BPromise(function(_0xd282c1,_0x398645){return client[_0xbdca('0x7')](_0x33abdc,_0x2354bf)[_0xbdca('0x8')](function(_0x1ecfeb){logger[_0xbdca('0x9')]('CmCompany,\x20%s,\x20%s',_0x413d9f,'request\x20sent');logger[_0xbdca('0xa')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x413d9f,_0xbdca('0xb'),JSON[_0xbdca('0xc')](_0x1ecfeb));if(_0x1ecfeb[_0xbdca('0xd')]){if(_0x1ecfeb[_0xbdca('0xd')][_0xbdca('0xe')]===0x1f4){logger[_0xbdca('0xd')](_0xbdca('0xf'),_0x413d9f,_0x1ecfeb[_0xbdca('0xd')]['message']);return _0x398645(_0x1ecfeb[_0xbdca('0xd')]['message']);}logger['error']('CmCompany,\x20%s,\x20%s',_0x413d9f,_0x1ecfeb[_0xbdca('0xd')]['message']);return _0xd282c1(_0x1ecfeb[_0xbdca('0xd')][_0xbdca('0x10')]);}else{logger[_0xbdca('0x9')]('CmCompany,\x20%s,\x20%s',_0x413d9f,_0xbdca('0xb'));_0xd282c1(_0x1ecfeb[_0xbdca('0x11')][_0xbdca('0x10')]);}})[_0xbdca('0x12')](function(_0x41eb99){logger[_0xbdca('0xd')]('CmCompany,\x20%s,\x20%s',_0x413d9f,_0x41eb99);_0x398645(_0x41eb99);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index d24bf53..a584e4e 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 _0xfb52=['fs-extra','../../components/auth/service','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','post','addContacts','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x7c13a0,_0x8c4473){var _0x29ab0c=function(_0x4ad5a5){while(--_0x4ad5a5){_0x7c13a0['push'](_0x7c13a0['shift']());}};_0x29ab0c(++_0x8c4473);}(_0xfb52,0x7e));var _0x2fb5=function(_0x33f3a5,_0x4bd444){_0x33f3a5=_0x33f3a5-0x0;var _0x504c18=_0xfb52[_0x33f3a5];return _0x504c18;};'use strict';var multer=require(_0x2fb5('0x0'));var util=require(_0x2fb5('0x1'));var path=require(_0x2fb5('0x2'));var timeout=require(_0x2fb5('0x3'));var express=require(_0x2fb5('0x4'));var router=express[_0x2fb5('0x5')]();var fs_extra=require(_0x2fb5('0x6'));var auth=require(_0x2fb5('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0x2fb5('0x8')]('/',auth['isAuthenticated'](),controller[_0x2fb5('0x9')]);router['get'](_0x2fb5('0xa'),auth[_0x2fb5('0xb')](),controller[_0x2fb5('0xc')]);router[_0x2fb5('0x8')](_0x2fb5('0xd'),auth[_0x2fb5('0xb')](),controller[_0x2fb5('0xe')]);router[_0x2fb5('0x8')](_0x2fb5('0xf'),auth[_0x2fb5('0xb')](),controller['getContacts']);router[_0x2fb5('0x10')]('/',auth[_0x2fb5('0xb')](),controller['create']);router[_0x2fb5('0x10')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x2fb5('0x11')]);router[_0x2fb5('0x12')](_0x2fb5('0xd'),auth[_0x2fb5('0xb')](),controller['update']);router[_0x2fb5('0x13')]('/:id',auth[_0x2fb5('0xb')](),controller[_0x2fb5('0x14')]);module[_0x2fb5('0x15')]=router;
\ No newline at end of file
+var _0x9a0f=['update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','show','getContacts','post','/:id/contacts','addContacts','put'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0x9a0f,0x15b));var _0xf9a0=function(_0x18babc,_0x2e20c1){_0x18babc=_0x18babc-0x0;var _0x5cbfe3=_0x9a0f[_0x18babc];return _0x5cbfe3;};'use strict';var multer=require(_0xf9a0('0x0'));var util=require(_0xf9a0('0x1'));var path=require('path');var timeout=require(_0xf9a0('0x2'));var express=require(_0xf9a0('0x3'));var router=express[_0xf9a0('0x4')]();var fs_extra=require(_0xf9a0('0x5'));var auth=require(_0xf9a0('0x6'));var interaction=require(_0xf9a0('0x7'));var config=require(_0xf9a0('0x8'));var controller=require(_0xf9a0('0x9'));router[_0xf9a0('0xa')]('/',auth[_0xf9a0('0xb')](),controller[_0xf9a0('0xc')]);router[_0xf9a0('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xf9a0('0xd')]);router[_0xf9a0('0xa')](_0xf9a0('0xe'),auth[_0xf9a0('0xb')](),controller[_0xf9a0('0xf')]);router[_0xf9a0('0xa')]('/:id/contacts',auth[_0xf9a0('0xb')](),controller[_0xf9a0('0x10')]);router[_0xf9a0('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf9a0('0x11')](_0xf9a0('0x12'),auth[_0xf9a0('0xb')](),controller[_0xf9a0('0x13')]);router[_0xf9a0('0x14')]('/:id',auth[_0xf9a0('0xb')](),controller[_0xf9a0('0x15')]);router['delete'](_0xf9a0('0xe'),auth['isAuthenticated'](),controller[_0xf9a0('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 3e35343..34f7397 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 _0xe391=['sequelize','exports','STRING','INTEGER','UNSIGNED','NOW','lodash'];(function(_0x52de57,_0x1da7c2){var _0x1d9499=function(_0x1e60e4){while(--_0x1e60e4){_0x52de57['push'](_0x52de57['shift']());}};_0x1d9499(++_0x1da7c2);}(_0xe391,0x1cd));var _0x1e39=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0xe391[_0x5d80de];return _0x1c7556;};'use strict';var _=require(_0x1e39('0x0'));var Sequelize=require(_0x1e39('0x1'));module[_0x1e39('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x1e39('0x3')]},'postalCode':{'type':Sequelize[_0x1e39('0x3')]},'city':{'type':Sequelize[_0x1e39('0x3')]},'country':{'type':Sequelize[_0x1e39('0x3')]},'dateOfBirth':{'type':Sequelize[_0x1e39('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x1e39('0x3')]},'email':{'type':Sequelize[_0x1e39('0x3')]},'url':{'type':Sequelize[_0x1e39('0x3')]},'facebook':{'type':Sequelize[_0x1e39('0x3')]},'fb_data':{'type':Sequelize[_0x1e39('0x3')]},'twitter':{'type':Sequelize[_0x1e39('0x3')]},'skype':{'type':Sequelize[_0x1e39('0x3')]},'teams':{'type':Sequelize[_0x1e39('0x3')]},'viber':{'type':Sequelize[_0x1e39('0x3')]},'line':{'type':Sequelize[_0x1e39('0x3')]},'wechat':{'type':Sequelize[_0x1e39('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x1e39('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x1e39('0x3')]},'priority':{'type':Sequelize[_0x1e39('0x4')](0x2)[_0x1e39('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x1e39('0x6')]},'dialTimezone':{'type':Sequelize[_0x1e39('0x3')]},'utcOffset':{'type':Sequelize[_0x1e39('0x4')]}};
\ No newline at end of file
+var _0x99e0=['sequelize','STRING','TEXT','INTEGER','UNSIGNED','NOW'];(function(_0x5e4323,_0x34cb4c){var _0x2813cb=function(_0x43c023){while(--_0x43c023){_0x5e4323['push'](_0x5e4323['shift']());}};_0x2813cb(++_0x34cb4c);}(_0x99e0,0x12c));var _0x099e=function(_0x170cdd,_0x35d83b){_0x170cdd=_0x170cdd-0x0;var _0x5a41d9=_0x99e0[_0x170cdd];return _0x5a41d9;};'use strict';var _=require('lodash');var Sequelize=require(_0x099e('0x0'));module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x099e('0x1')]},'street':{'type':Sequelize[_0x099e('0x1')]},'postalCode':{'type':Sequelize[_0x099e('0x1')]},'city':{'type':Sequelize[_0x099e('0x1')]},'country':{'type':Sequelize[_0x099e('0x1')]},'dateOfBirth':{'type':Sequelize[_0x099e('0x1')]},'description':{'type':Sequelize[_0x099e('0x2')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x099e('0x1')]},'fax':{'type':Sequelize[_0x099e('0x1')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x099e('0x1')]},'fb_data':{'type':Sequelize[_0x099e('0x1')]},'twitter':{'type':Sequelize[_0x099e('0x1')]},'skype':{'type':Sequelize[_0x099e('0x1')]},'teams':{'type':Sequelize[_0x099e('0x1')]},'viber':{'type':Sequelize[_0x099e('0x1')]},'line':{'type':Sequelize[_0x099e('0x1')]},'wechat':{'type':Sequelize[_0x099e('0x1')]},'telegram':{'type':Sequelize[_0x099e('0x1')]},'UserId':{'type':Sequelize[_0x099e('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x099e('0x1')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x099e('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x099e('0x5')]},'dialTimezone':{'type':Sequelize[_0x099e('0x1')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index fa80a67..b95be2d 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 _0xd6b4=['TagIds','Tags','rows','catch','describe','tags','columnName','displayName','analytics','findAll','custom','values','merge','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','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','FaxMessage','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','VoiceCallReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','findOrCreate','spread','contact','show','params','ItemType','omit','$and','pickBy','format','cf_%d','setFields','id\x20=\x20?','toParam','phone','pick','options','getTags','setTags','ids','ContactItemType','OrderBy','item_types','items','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','literal','`ItemType`.OrderBy','CmHopperId','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','getHoppers','rawAttributes','getHopperHistories','includeAll','getHopperFinals','ContactId','include','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','0777','child_process','fork','CompanyId','upload','createReadStream','parse','meta','import','binding','stringify','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','getJourney','mail','chat','sms','fax','voice','-createdAt','channel','Invalid\x20channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','note','createdAt','userDisposition','userThirdDisposition','fullname','alias','startCase','Website','Account','closed','closedAt','thirdDisposition','UserId','key','Owner','browserName','customerIp','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','openchannel','externalUrl','threadId','Interaction','flatten','reverse','slice','moment','util','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/environment/shared','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','register','status','undefined','limit','count','offset','set','Content-Range','json','update','then','destroy','end','sendStatus','name','send','index','CmContact','length','startsWith','cf_','push','CmCustomField','findOne','all','fieldType','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','field','color','from','tools_tags','select','left_join','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','c.deletedAt\x20IS\x20NULL','expr','parseSearch','search','sqlOperator','conditions','find','Tag','value','split','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','text','start','isNil','Contact','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','tag','isArray','forEach','filter','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','Sequelize','SELECT','clone','DESC','having','t.id\x20IN\x20?','resolve','role','agent','user','getLists','isEmpty','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','c.id','c.firstName','c.lastName','c.phone','c.mobile','c.createdAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)'];(function(_0x45286e,_0x5cb2ef){var _0x100e4e=function(_0x22e554){while(--_0x22e554){_0x45286e['push'](_0x45286e['shift']());}};_0x100e4e(++_0x5cb2ef);}(_0xd6b4,0x1ea));var _0x4d6b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd6b4[_0x2dafbe];return _0x58a45a;};'use strict';var moment=require(_0x4d6b('0x0'));var BPromise=require('bluebird');var util=require(_0x4d6b('0x1'));var path=require(_0x4d6b('0x2'));var fs=require('fs');var _=require(_0x4d6b('0x3'));var squel=require(_0x4d6b('0x4'));var Papa=require(_0x4d6b('0x5'));var Redis=require(_0x4d6b('0x6'));var qs=require(_0x4d6b('0x7'));var as=require(_0x4d6b('0x8'));var logger=require(_0x4d6b('0x9'))('api');var config=require(_0x4d6b('0xa'));var shared=require(_0x4d6b('0xb'));var db=require(_0x4d6b('0xc'))['db'];config[_0x4d6b('0xd')]=_['defaults'](config[_0x4d6b('0xd')],{'host':_0x4d6b('0xe'),'port':0x18eb});var socket=require(_0x4d6b('0xf'))(new Redis(config[_0x4d6b('0xd')]));require(_0x4d6b('0x10'))[_0x4d6b('0x11')](socket);function respondWithResult(_0x1fe78f,_0x495471){_0x495471=_0x495471||0xc8;return function(_0x1d9801){if(_0x1d9801){return _0x1fe78f[_0x4d6b('0x12')](_0x495471)['json'](_0x1d9801);}};}function respondWithFilteredResult(_0x5a9780,_0x3b36f5){return function(_0x379e18){if(_0x379e18){var _0x563888=typeof _0x3b36f5['offset']===_0x4d6b('0x13')&&typeof _0x3b36f5[_0x4d6b('0x14')]===_0x4d6b('0x13');var _0x121f23=_0x379e18[_0x4d6b('0x15')];var _0x36b13e=_0x563888?0x0:_0x3b36f5[_0x4d6b('0x16')];var _0x2459aa=_0x563888?_0x379e18[_0x4d6b('0x15')]:_0x3b36f5[_0x4d6b('0x16')]+_0x3b36f5[_0x4d6b('0x14')];var _0x3bcfeb;if(_0x2459aa>=_0x121f23){_0x2459aa=_0x121f23;_0x3bcfeb=0xc8;}else{_0x3bcfeb=0xce;}_0x5a9780[_0x4d6b('0x12')](_0x3bcfeb);return _0x5a9780[_0x4d6b('0x17')](_0x4d6b('0x18'),_0x36b13e+'-'+_0x2459aa+'/'+_0x121f23)[_0x4d6b('0x19')](_0x379e18);}return null;};}function saveUpdates(_0x1ee6f6){return function(_0x2c54c4){if(_0x2c54c4){return _0x2c54c4[_0x4d6b('0x1a')](_0x1ee6f6)[_0x4d6b('0x1b')](function(_0x26b6d8){return _0x26b6d8;});}return null;};}function removeEntity(_0x383a45){return function(_0x509507){if(_0x509507){return _0x509507[_0x4d6b('0x1c')]()[_0x4d6b('0x1b')](function(){_0x383a45[_0x4d6b('0x12')](0xcc)[_0x4d6b('0x1d')]();});}};}function handleEntityNotFound(_0x2596c0){return function(_0x1e57b2){if(!_0x1e57b2){_0x2596c0[_0x4d6b('0x1e')](0x194);}return _0x1e57b2;};}function handleError(_0x292e83,_0x4304a6){_0x4304a6=_0x4304a6||0x1f4;return function(_0x248e60){logger['error'](_0x248e60['stack']);if(_0x248e60[_0x4d6b('0x1f')]){delete _0x248e60[_0x4d6b('0x1f')];}_0x292e83[_0x4d6b('0x12')](_0x4304a6)[_0x4d6b('0x20')](_0x248e60);};}exports[_0x4d6b('0x21')]=function(_0x3f74b4,_0x5d5ca6){var _0x19c503={},_0x309f07={},_0x484fb4={'count':0x0,'rows':[]};return db[_0x4d6b('0x22')]['describe']()[_0x4d6b('0x1b')](function(_0x49e5ce){var _0x9826a5=[];for(var _0x388c47=0x0;_0x388c47
','Attachments','Data','user=','utf-8','toString','base64','lodash','randomstring','path','email','head','address','anonymous','generate','value','name','indexOf','split','Anonymous','pop','length','isEmpty','@xcally.com','test','html','replace','includes'];(function(_0x13ea75,_0x70adf2){var _0x188f64=function(_0x4580e5){while(--_0x4580e5){_0x13ea75['push'](_0x13ea75['shift']());}};_0x188f64(++_0x70adf2);}(_0xd2bf,0x75));var _0xfd2b=function(_0x5ca353,_0x21eb37){_0x5ca353=_0x5ca353-0x0;var _0x4f2fe5=_0xd2bf[_0x5ca353];return _0x4f2fe5;};'use strict';var _=require(_0xfd2b('0x0'));var moment=require('moment');var random=require(_0xfd2b('0x1'));var fs=require('fs');var path=require(_0xfd2b('0x2'));var util=require('util');var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0xfd2b('0x3'));var config=require('../../../config/environment');function getAddress(_0x12a300){var _0x155324=_[_0xfd2b('0x4')](_0x12a300['value']);return _0x155324&&_0x155324[_0xfd2b('0x5')]?_0x155324[_0xfd2b('0x5')]:_0xfd2b('0x6')+random[_0xfd2b('0x7')](0x6)+'@xcally.com';}function getFirstName(_0x1c05b2){var _0x4c2c98=_[_0xfd2b('0x4')](_0x1c05b2[_0xfd2b('0x8')]);if(_0x4c2c98&&_0x4c2c98[_0xfd2b('0x9')]){if(_0x4c2c98[_0xfd2b('0x9')]==_0x4c2c98[_0xfd2b('0x5')]){return _0x4c2c98[_0xfd2b('0x9')]['substring'](0x0,_0x4c2c98[_0xfd2b('0x9')][_0xfd2b('0xa')]('@'));}var _0x459d1d=_0x4c2c98[_0xfd2b('0x9')][_0xfd2b('0xb')](/\s+/);return _0x459d1d['length']>0x1?_0x459d1d['slice'](0x0,-0x1)['join']('\x20'):_0x4c2c98[_0xfd2b('0x9')];}return _0xfd2b('0xc');}function getLastName(_0xd22a77){var _0x5eb7c0=_[_0xfd2b('0x4')](_0xd22a77[_0xfd2b('0x8')]);if(_0x5eb7c0&&_0x5eb7c0[_0xfd2b('0x9')]){var _0x319caf=_0x5eb7c0[_0xfd2b('0x9')][_0xfd2b('0xb')](/\s+/);return _0x319caf['length']>0x1?_0x319caf[_0xfd2b('0xd')]():'';}return'';}function getMails(_0x46d8e9,_0x529f1c){var _0x21783c='';for(var _0x194e9c=0x0;_0x194e9c<_0x529f1c[_0xfd2b('0x8')][_0xfd2b('0xe')];_0x194e9c+=0x1){if(_0x529f1c[_0xfd2b('0x8')][_0x194e9c][_0xfd2b('0x5')]!==_0x46d8e9){if(!_[_0xfd2b('0xf')](_0x21783c)){_0x21783c+=',';}_0x21783c+=_0x529f1c[_0xfd2b('0x8')][_0x194e9c][_0xfd2b('0x9')]||_0x529f1c[_0xfd2b('0x8')][_0x194e9c][_0xfd2b('0x5')]||'';_0x21783c+='\x20<';_0x21783c+=_0x529f1c[_0xfd2b('0x8')][_0x194e9c][_0xfd2b('0x5')]?_0x529f1c[_0xfd2b('0x8')][_0x194e9c]['address']:_0xfd2b('0x6')+random['generate'](0x6)+_0xfd2b('0x10');_0x21783c+='>';}}return _0x21783c;}function parseEmail(_0x1b1d1b,_0x1f36cb,_0x34562d){if(_0x1f36cb['html']){var _0x2987f3=/