From: support
Date: Wed, 2 Nov 2022 06:13:53 +0000 (+0000)
Subject: Built motion from commit 8f498182.|2.6.21
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22%7B%7Blicense.mail?a=commitdiff_plain;h=b627843ac855946c7ff45214ae2e31de12400c2a;p=motion2.git
Built motion from commit 8f498182.|2.6.21
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index bc2b834..4709cdc 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -1,6 +1,6 @@
define({
"name": "xCALLY Motion API",
- "version": "2.6.19",
+ "version": "2.6.21",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-10-28T05:14:06.369Z",
+ "time": "2022-11-02T06:05:17.961Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index a6387a0..f5125fe 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -1,6 +1,6 @@
{
"name": "xCALLY Motion API",
- "version": "2.6.19",
+ "version": "2.6.21",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-10-28T05:14:06.369Z",
+ "time": "2022-11-02T06:05:17.961Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index 0549b25..efe6876 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -1,6 +1,6 @@
{
"name": "motion",
- "version": "2.6.19",
+ "version": "2.6.21",
"dependencies": {
"@babel/code-frame": {
"version": "7.18.6",
diff --git a/package.json b/package.json
index f66562f..69f22db 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "motion",
- "version": "2.6.19",
+ "version": "2.6.21",
"description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.",
"main": "server/app.js",
"engines": {
diff --git a/public/app/main/apps/staff/i18n/it.json b/public/app/main/apps/staff/i18n/it.json
index 5d106f4..9515685 100644
--- a/public/app/main/apps/staff/i18n/it.json
+++ b/public/app/main/apps/staff/i18n/it.json
@@ -412,17 +412,17 @@
"AD_SSO_ENABLED": "SSO di Active Directory",
"AUTHENTICATION": "Autenticazione",
"AUTO_ANSWER": "Risposta automatica",
- "CHAT_AUTOANSWER": "Risposta automatica via Chat",
- "CHAT_AUTOANSWERDELAY": "Ritardo risposta automatica via Chat [s]",
- "EMAIL_AUTOANSWER": "Risposta automatica via Email",
- "EMAIL_AUTOANSWERDELAY": "Ritardo risposta automatica via Email [i]",
- "FAX_AUTOANSWER": "Risposta automatica via Fax",
- "FAX_AUTOANSWERDELAY": "Ritardo risposta automatica Fax [s]",
- "OPENCHANNEL_AUTOANSWER": "Risposta automatica via Openchannel",
- "OPENCHANNEL_AUTOANSWERDELAY": "Ritardo risposta automatica via Openchannel [s]",
- "SMS_AUTOANSWER": "Risposta automatica via Sms",
- "SMS_AUTOANSWERDELAY": "Ritardo risposta automatica via Sms [s]",
- "WHATSAPP_AUTOANSWER": "Risposta automatica via Whatsapp",
- "WHATSAPP_AUTOANSWERDELAY": "Ritardo risposta automatica via Whatsapp [s]"
+ "CHAT_AUTOANSWER": "Risposta automatica della chat",
+ "CHAT_AUTOANSWERDELAY": "Ritardo risposta automatica chat [s]",
+ "EMAIL_AUTOANSWER": "Risposta automatica via e-mail",
+ "EMAIL_AUTOANSWERDELAY": "Ritardo risposta automatica e-mail [i]",
+ "FAX_AUTOANSWER": "Risposta automatica via fax",
+ "FAX_AUTOANSWERDELAY": "Ritardo risposta automatica fax [s]",
+ "OPENCHANNEL_AUTOANSWER": "Risposta automatica a canale aperto",
+ "OPENCHANNEL_AUTOANSWERDELAY": "Ritardo risposta automatica canale aperto [s]",
+ "SMS_AUTOANSWER": "Sms risposta automatica",
+ "SMS_AUTOANSWERDELAY": "Ritardo risposta automatica SMS [s]",
+ "WHATSAPP_AUTOANSWER": "Whatsapp risposta automatica",
+ "WHATSAPP_AUTOANSWERDELAY": "Ritardo risposta automatica Whatsapp [s]"
}
}
diff --git a/public/app/toolbar/i18n/it.json b/public/app/toolbar/i18n/it.json
index 4796dd7..0d9949a 100644
--- a/public/app/toolbar/i18n/it.json
+++ b/public/app/toolbar/i18n/it.json
@@ -117,14 +117,14 @@
"AUTOANSWER_NOTIFICATIONS": "Notifiche di risposta automatica",
"CHANNEL": "Canale",
"CHANNELS": "Canali",
- "CHAT": "Chat",
+ "CHAT": "Chiacchierata",
"DELAY": "Ritardo risposta automatica [sec]",
"EMAIL": "E-mail",
"FAX": "Fax",
"NOTIFICATIONS": "Risposta automatica abilitata",
"NUM_NOTIFICATIONS": "Notifiche",
- "OPENCHANNEL": "Openchannel",
- "SMS": "Sms",
+ "OPENCHANNEL": "Canale aperto",
+ "SMS": "sms",
"WHATSAPP": "WhatsApp",
"NO_AUTOANSWER_CONFIGURED": "Nessuna risposta automatica configurata per i canali",
"BOSNIAN": "bosniaco",
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index ee363b8..8568387 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 _0x4b57=['sequelize','exports','VIRTUAL','action','STRING','contactManager','integration','motionbar','urlForward','browser','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT'];(function(_0xabb865,_0x1a4197){var _0x1519e8=function(_0x5c8b0d){while(--_0x5c8b0d){_0xabb865['push'](_0xabb865['shift']());}};_0x1519e8(++_0x1a4197);}(_0x4b57,0xaa));var _0x74b5=function(_0xbf8ec1,_0x9169c8){_0xbf8ec1=_0xbf8ec1-0x0;var _0xc84567=_0x4b57[_0xbf8ec1];return _0xc84567;};'use strict';var Sequelize=require(_0x74b5('0x0'));module[_0x74b5('0x1')]={'name':{'type':Sequelize[_0x74b5('0x2')],'get':function(_0x12582c){return this['getDataValue'](_0x74b5('0x3'));}},'action':{'type':Sequelize[_0x74b5('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x74b5('0x5'),_0x74b5('0x6'),_0x74b5('0x7'),'jscripty',_0x74b5('0x8'),_0x74b5('0x9'),'bot','script']],'msg':_0x74b5('0xa')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x74b5('0x4')](0x1000),'comment':_0x74b5('0xb')},'data2':{'type':Sequelize[_0x74b5('0x4')](0x1000),'comment':_0x74b5('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x74b5('0x4')](0x1000),'comments':_0x74b5('0xd')},'data5':{'type':Sequelize[_0x74b5('0x4')](0x1000),'comments':_0x74b5('0xe')},'data6':{'type':Sequelize[_0x74b5('0x4')],'comments':_0x74b5('0xf')},'data7':{'type':Sequelize[_0x74b5('0x10')],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0xdb60=['urlForward[body]','sequelize','VIRTUAL','getDataValue','contactManager','integration','jscripty','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','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]','TEXT'];(function(_0x56b2c9,_0x38d9e6){var _0x1624bb=function(_0x4d1872){while(--_0x4d1872){_0x56b2c9['push'](_0x56b2c9['shift']());}};_0x1624bb(++_0x38d9e6);}(_0xdb60,0xd3));var _0x0db6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xdb60[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0db6('0x0'));module['exports']={'name':{'type':Sequelize[_0x0db6('0x1')],'get':function(_0x423982){return this[_0x0db6('0x2')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x0db6('0x3'),_0x0db6('0x4'),'motionbar',_0x0db6('0x5'),_0x0db6('0x6'),_0x0db6('0x7'),_0x0db6('0x8'),'script']],'msg':_0x0db6('0x9')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x0db6('0xa')](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[_0x0db6('0xa')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x0db6('0xa')](0x1000),'comment':_0x0db6('0xb')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x0db6('0xc')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x0db6('0xd')],'comments':_0x0db6('0xe')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index d703a2b..561f7fa 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 _0x51fc=['moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','save','update','then','end','error','name','send','body','Action','find','params','catch','destroy','rimraf','zip-dir'];(function(_0x32f8a2,_0x49c502){var _0x258cca=function(_0x1040e4){while(--_0x1040e4){_0x32f8a2['push'](_0x32f8a2['shift']());}};_0x258cca(++_0x49c502);}(_0x51fc,0x1c0));var _0xc51f=function(_0x293055,_0x10e0b1){_0x293055=_0x293055-0x0;var _0x19c83a=_0x51fc[_0x293055];return _0x19c83a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc51f('0x0'));var zipdir=require(_0xc51f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc51f('0x2'));var BPromise=require(_0xc51f('0x3'));var Mustache=require(_0xc51f('0x4'));var util=require(_0xc51f('0x5'));var path=require('path');var sox=require(_0xc51f('0x6'));var csv=require(_0xc51f('0x7'));var ejs=require(_0xc51f('0x8'));var fs=require('fs');var fs_extra=require(_0xc51f('0x9'));var _=require(_0xc51f('0xa'));var squel=require(_0xc51f('0xb'));var crypto=require(_0xc51f('0xc'));var jsforce=require(_0xc51f('0xd'));var deskjs=require(_0xc51f('0xe'));var toCsv=require(_0xc51f('0x7'));var querystring=require(_0xc51f('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc51f('0x10'));var qs=require(_0xc51f('0x11'));var as=require(_0xc51f('0x12'));var hardwareService=require(_0xc51f('0x13'));var logger=require('../../config/logger')(_0xc51f('0x14'));var utils=require(_0xc51f('0x15'));var config=require(_0xc51f('0x16'));var licenseUtil=require(_0xc51f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15692e,_0x47b162){_0x47b162=_0x47b162||0xcc;return function(_0x49de0d){if(_0x49de0d){return _0x15692e[_0xc51f('0x18')](_0x47b162);}return _0x15692e[_0xc51f('0x19')](_0x47b162)['end']();};}function respondWithResult(_0x27c8bf,_0x21245d){_0x21245d=_0x21245d||0xc8;return function(_0x4c9572){if(_0x4c9572){return _0x27c8bf[_0xc51f('0x19')](_0x21245d)['json'](_0x4c9572);}};}function respondWithFilteredResult(_0x776feb,_0x54987d){return function(_0x23bce4){if(_0x23bce4){var _0x5137af=typeof _0x54987d[_0xc51f('0x1a')]===_0xc51f('0x1b')&&typeof _0x54987d[_0xc51f('0x1c')]===_0xc51f('0x1b');var _0x471bd5=_0x23bce4[_0xc51f('0x1d')];var _0x312728=_0x5137af?0x0:_0x54987d[_0xc51f('0x1a')];var _0x9330c3=_0x5137af?_0x23bce4['count']:_0x54987d['offset']+_0x54987d[_0xc51f('0x1c')];var _0xec821c;if(_0x9330c3>=_0x471bd5){_0x9330c3=_0x471bd5;_0xec821c=0xc8;}else{_0xec821c=0xce;}_0x776feb['status'](_0xec821c);return _0x776feb['set'](_0xc51f('0x1e'),_0x312728+'-'+_0x9330c3+'/'+_0x471bd5)['json'](_0x23bce4);}return null;};}function patchUpdates(_0x296cc6){return function(_0x4e7c2b){try{jsonpatch[_0xc51f('0x1f')](_0x4e7c2b,_0x296cc6,!![]);}catch(_0x267636){return BPromise['reject'](_0x267636);}return _0x4e7c2b[_0xc51f('0x20')]();};}function saveUpdates(_0x3d0693,_0x3ea232){return function(_0x5eb2c6){if(_0x5eb2c6){return _0x5eb2c6[_0xc51f('0x21')](_0x3d0693)[_0xc51f('0x22')](function(_0x42b6c6){return _0x42b6c6;});}return null;};}function removeEntity(_0x441566,_0x412f81){return function(_0x1634ed){if(_0x1634ed){return _0x1634ed['destroy']()[_0xc51f('0x22')](function(){_0x441566[_0xc51f('0x19')](0xcc)[_0xc51f('0x23')]();});}};}function handleEntityNotFound(_0x2df61e,_0x5b22ba){return function(_0x5136b9){if(!_0x5136b9){_0x2df61e[_0xc51f('0x18')](0x194);}return _0x5136b9;};}function handleError(_0x19c448,_0x5c7ee1){_0x5c7ee1=_0x5c7ee1||0x1f4;return function(_0x1ddca9){logger[_0xc51f('0x24')](_0x1ddca9['stack']);if(_0x1ddca9[_0xc51f('0x25')]){delete _0x1ddca9[_0xc51f('0x25')];}_0x19c448[_0xc51f('0x19')](_0x5c7ee1)[_0xc51f('0x26')](_0x1ddca9);};}exports[_0xc51f('0x21')]=function(_0x122f01,_0x3e156d){if(_0x122f01[_0xc51f('0x27')]['id']){delete _0x122f01['body']['id'];}return db[_0xc51f('0x28')][_0xc51f('0x29')]({'where':{'id':_0x122f01[_0xc51f('0x2a')]['id']}})[_0xc51f('0x22')](handleEntityNotFound(_0x3e156d,null))[_0xc51f('0x22')](saveUpdates(_0x122f01[_0xc51f('0x27')],null))[_0xc51f('0x22')](respondWithResult(_0x3e156d,null))[_0xc51f('0x2b')](handleError(_0x3e156d,null));};exports[_0xc51f('0x2c')]=function(_0x31f561,_0x2cc0f4){return db[_0xc51f('0x28')][_0xc51f('0x29')]({'where':{'id':_0x31f561[_0xc51f('0x2a')]['id']}})['then'](handleEntityNotFound(_0x2cc0f4,null))[_0xc51f('0x22')](removeEntity(_0x2cc0f4,null))[_0xc51f('0x2b')](handleError(_0x2cc0f4,null));};
\ No newline at end of file
+var _0x2a85=['desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Action','find','params','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0xca8554,_0x5255c5){var _0x4a4185=function(_0x33e052){while(--_0x33e052){_0xca8554['push'](_0xca8554['shift']());}};_0x4a4185(++_0x5255c5);}(_0x2a85,0x171));var _0x52a8=function(_0x676c61,_0x5f5b08){_0x676c61=_0x676c61-0x0;var _0x1c000d=_0x2a85[_0x676c61];return _0x1c000d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x52a8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x52a8('0x1'));var rp=require(_0x52a8('0x2'));var moment=require(_0x52a8('0x3'));var BPromise=require(_0x52a8('0x4'));var Mustache=require(_0x52a8('0x5'));var util=require(_0x52a8('0x6'));var path=require(_0x52a8('0x7'));var sox=require(_0x52a8('0x8'));var csv=require(_0x52a8('0x9'));var ejs=require(_0x52a8('0xa'));var fs=require('fs');var fs_extra=require(_0x52a8('0xb'));var _=require(_0x52a8('0xc'));var squel=require(_0x52a8('0xd'));var crypto=require('crypto');var jsforce=require(_0x52a8('0xe'));var deskjs=require(_0x52a8('0xf'));var toCsv=require('to-csv');var querystring=require(_0x52a8('0x10'));var Papa=require(_0x52a8('0x11'));var Redis=require('ioredis');var authService=require(_0x52a8('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x52a8('0x13'))('api');var utils=require(_0x52a8('0x14'));var config=require(_0x52a8('0x15'));var licenseUtil=require(_0x52a8('0x16'));var db=require(_0x52a8('0x17'))['db'];function respondWithStatusCode(_0x25c7be,_0x5d7eb2){_0x5d7eb2=_0x5d7eb2||0xcc;return function(_0x212a08){if(_0x212a08){return _0x25c7be[_0x52a8('0x18')](_0x5d7eb2);}return _0x25c7be[_0x52a8('0x19')](_0x5d7eb2)[_0x52a8('0x1a')]();};}function respondWithResult(_0x255eaa,_0x4200c2){_0x4200c2=_0x4200c2||0xc8;return function(_0x2e5f86){if(_0x2e5f86){return _0x255eaa[_0x52a8('0x19')](_0x4200c2)[_0x52a8('0x1b')](_0x2e5f86);}};}function respondWithFilteredResult(_0x3305d2,_0x10a7f3){return function(_0xcf4c84){if(_0xcf4c84){var _0x37d4c4=typeof _0x10a7f3[_0x52a8('0x1c')]===_0x52a8('0x1d')&&typeof _0x10a7f3['limit']==='undefined';var _0x340548=_0xcf4c84[_0x52a8('0x1e')];var _0x44f660=_0x37d4c4?0x0:_0x10a7f3[_0x52a8('0x1c')];var _0x1bc9df=_0x37d4c4?_0xcf4c84['count']:_0x10a7f3[_0x52a8('0x1c')]+_0x10a7f3[_0x52a8('0x1f')];var _0x20ddc0;if(_0x1bc9df>=_0x340548){_0x1bc9df=_0x340548;_0x20ddc0=0xc8;}else{_0x20ddc0=0xce;}_0x3305d2[_0x52a8('0x19')](_0x20ddc0);return _0x3305d2[_0x52a8('0x20')](_0x52a8('0x21'),_0x44f660+'-'+_0x1bc9df+'/'+_0x340548)[_0x52a8('0x1b')](_0xcf4c84);}return null;};}function patchUpdates(_0x750b11){return function(_0x3d71a5){try{jsonpatch['apply'](_0x3d71a5,_0x750b11,!![]);}catch(_0x117c91){return BPromise[_0x52a8('0x22')](_0x117c91);}return _0x3d71a5[_0x52a8('0x23')]();};}function saveUpdates(_0x3bff08,_0x29306d){return function(_0x5814f9){if(_0x5814f9){return _0x5814f9[_0x52a8('0x24')](_0x3bff08)[_0x52a8('0x25')](function(_0x10e1d1){return _0x10e1d1;});}return null;};}function removeEntity(_0x3a1b68,_0x14cefe){return function(_0x5b59f2){if(_0x5b59f2){return _0x5b59f2[_0x52a8('0x26')]()[_0x52a8('0x25')](function(){_0x3a1b68['status'](0xcc)[_0x52a8('0x1a')]();});}};}function handleEntityNotFound(_0x4264a8,_0x36e5d7){return function(_0x46c859){if(!_0x46c859){_0x4264a8[_0x52a8('0x18')](0x194);}return _0x46c859;};}function handleError(_0x3962b4,_0x2c2c21){_0x2c2c21=_0x2c2c21||0x1f4;return function(_0x428291){logger[_0x52a8('0x27')](_0x428291[_0x52a8('0x28')]);if(_0x428291[_0x52a8('0x29')]){delete _0x428291['name'];}_0x3962b4[_0x52a8('0x19')](_0x2c2c21)[_0x52a8('0x2a')](_0x428291);};}exports[_0x52a8('0x24')]=function(_0x249b12,_0x550f32){if(_0x249b12[_0x52a8('0x2b')]['id']){delete _0x249b12[_0x52a8('0x2b')]['id'];}return db['Action']['find']({'where':{'id':_0x249b12['params']['id']}})[_0x52a8('0x25')](handleEntityNotFound(_0x550f32,null))[_0x52a8('0x25')](saveUpdates(_0x249b12['body'],null))['then'](respondWithResult(_0x550f32,null))['catch'](handleError(_0x550f32,null));};exports[_0x52a8('0x26')]=function(_0x3f6d70,_0x326d8a){return db[_0x52a8('0x2c')][_0x52a8('0x2d')]({'where':{'id':_0x3f6d70[_0x52a8('0x2e')]['id']}})[_0x52a8('0x25')](handleEntityNotFound(_0x326d8a,null))[_0x52a8('0x25')](removeEntity(_0x326d8a,null))[_0x52a8('0x2f')](handleError(_0x326d8a,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index c36fa28..38c2029 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 _0xb789=['path','rimraf','../../config/environment','./action.attributes','define','tools_actions','lodash','../../config/logger','api','request-promise'];(function(_0x2d3f1d,_0x2a0715){var _0x19b6fc=function(_0x58bec8){while(--_0x58bec8){_0x2d3f1d['push'](_0x2d3f1d['shift']());}};_0x19b6fc(++_0x2a0715);}(_0xb789,0x1c8));var _0x9b78=function(_0xd3978b,_0x5cf5de){_0xd3978b=_0xd3978b-0x0;var _0x4c7145=_0xb789[_0xd3978b];return _0x4c7145;};'use strict';var _=require(_0x9b78('0x0'));var util=require('util');var logger=require(_0x9b78('0x1'))(_0x9b78('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9b78('0x3'));var fs=require('fs');var path=require(_0x9b78('0x4'));var rimraf=require(_0x9b78('0x5'));var config=require(_0x9b78('0x6'));var attributes=require(_0x9b78('0x7'));module['exports']=function(_0x3ecd87,_0x4231f6){return _0x3ecd87[_0x9b78('0x8')]('Action',attributes,{'tableName':_0x9b78('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0d5a=['exports','Action','util','api','moment','bluebird','request-promise','path','../../config/environment','./action.attributes'];(function(_0x92651e,_0x2c5afe){var _0x45cf22=function(_0x91bcc3){while(--_0x91bcc3){_0x92651e['push'](_0x92651e['shift']());}};_0x45cf22(++_0x2c5afe);}(_0x0d5a,0xe8));var _0xa0d5=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x0d5a[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var util=require(_0xa0d5('0x0'));var logger=require('../../config/logger')(_0xa0d5('0x1'));var moment=require(_0xa0d5('0x2'));var BPromise=require(_0xa0d5('0x3'));var rp=require(_0xa0d5('0x4'));var fs=require('fs');var path=require(_0xa0d5('0x5'));var rimraf=require('rimraf');var config=require(_0xa0d5('0x6'));var attributes=require(_0xa0d5('0x7'));module[_0xa0d5('0x8')]=function(_0x39184c,_0x4015b4){return _0x39184c['define'](_0xa0d5('0x9'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 2c904b9..731894c 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 _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(_0x2da8a2,_0x2f7bf1){var _0x1d7a1b=function(_0x45d295){while(--_0x45d295){_0x2da8a2['push'](_0x2da8a2['shift']());}};_0x1d7a1b(++_0x2f7bf1);}(_0x1261,0x144));var _0x1126=function(_0x352d28,_0x444033){_0x352d28=_0x352d28-0x0;var _0x387d7e=_0x1261[_0x352d28];return _0x387d7e;};'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
+var _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1691e0,_0x290625){var _0x52b537=function(_0x40026a){while(--_0x40026a){_0x1691e0['push'](_0x1691e0['shift']());}};_0x52b537(++_0x290625);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x381f7f,_0x1321a9){_0x381f7f=_0x381f7f-0x0;var _0xd2ae6d=_0x7fbe[_0x381f7f];return _0xd2ae6d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 5c48453..f04a07f 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 _0x9c0f=['Router','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','delete','destroy','connect-timeout'];(function(_0x2e6ab8,_0x4ea85c){var _0x16cba0=function(_0x4b3776){while(--_0x4b3776){_0x2e6ab8['push'](_0x2e6ab8['shift']());}};_0x16cba0(++_0x4ea85c);}(_0x9c0f,0x199));var _0xf9c0=function(_0x121886,_0x8cd8e5){_0x121886=_0x121886-0x0;var _0x20ca01=_0x9c0f[_0x121886];return _0x20ca01;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf9c0('0x0'));var express=require('express');var router=express[_0xf9c0('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf9c0('0x2'));var config=require(_0xf9c0('0x3'));var controller=require(_0xf9c0('0x4'));router[_0xf9c0('0x5')](_0xf9c0('0x6'),auth[_0xf9c0('0x7')](),controller['update']);router[_0xf9c0('0x8')](_0xf9c0('0x6'),auth[_0xf9c0('0x7')](),controller[_0xf9c0('0x9')]);module['exports']=router;
\ No newline at end of file
+var _0x7b99=['./action.controller','put','/:id','update','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x6596e,_0xa89aa3){var _0x5596ce=function(_0x5acf59){while(--_0x5acf59){_0x6596e['push'](_0x6596e['shift']());}};_0x5596ce(++_0xa89aa3);}(_0x7b99,0xa2));var _0x97b9=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x7b99[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0x97b9('0x0'));var path=require(_0x97b9('0x1'));var timeout=require(_0x97b9('0x2'));var express=require('express');var router=express[_0x97b9('0x3')]();var fs_extra=require(_0x97b9('0x4'));var auth=require(_0x97b9('0x5'));var interaction=require(_0x97b9('0x6'));var config=require('../../config/environment');var controller=require(_0x97b9('0x7'));router[_0x97b9('0x8')](_0x97b9('0x9'),auth['isAuthenticated'](),controller[_0x97b9('0xa')]);router[_0x97b9('0xb')](_0x97b9('0x9'),auth['isAuthenticated'](),controller[_0x97b9('0xc')]);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 d8eb1df..ec0b0fc 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 _0xeec6=['STRING','TEXT','sequelize','exports'];(function(_0xa0139d,_0x3f1109){var _0x5b6d49=function(_0x5cddfc){while(--_0x5cddfc){_0xa0139d['push'](_0xa0139d['shift']());}};_0x5b6d49(++_0x3f1109);}(_0xeec6,0x1c2));var _0x6eec=function(_0x180bc5,_0x17fd8d){_0x180bc5=_0x180bc5-0x0;var _0x310566=_0xeec6[_0x180bc5];return _0x310566;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'name':{'type':Sequelize[_0x6eec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6eec('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x6eec('0x2')]},'conditions':{'type':Sequelize[_0x6eec('0x3')]},'joins':{'type':Sequelize[_0x6eec('0x3')]}};
\ No newline at end of file
+var _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x2718c7,_0x5a1636){var _0x59d89c=function(_0x4d4f49){while(--_0x4d4f49){_0x2718c7['push'](_0x2718c7['shift']());}};_0x59d89c(++_0x5a1636);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x2e5f9c,_0x134a52){_0x2e5f9c=_0x2e5f9c-0x0;var _0x538b44=_0xfdbd[_0x2e5f9c];return _0x538b44;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 378a2d2..a1506c7 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 _0x832e=['groupBy','orderBy','order','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','HOUR(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','condition','getFields','ValidationErrorItem','output','web','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','update','then','destroy','get','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','AnalyticCustomReport','findAll','show','options','find','catch','create','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','CustomReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','right_join','cross_join','SUM(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','rules','operator','group','field','value','params','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format'];(function(_0x47271b,_0x2fd7d7){var _0x24aa67=function(_0x5a7376){while(--_0x5a7376){_0x47271b['push'](_0x47271b['shift']());}};_0x24aa67(++_0x2fd7d7);}(_0x832e,0x17b));var _0xe832=function(_0x1c5572,_0x2b93aa){_0x1c5572=_0x1c5572-0x0;var _0x341a36=_0x832e[_0x1c5572];return _0x341a36;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe832('0x0'));var jsonpatch=require(_0xe832('0x1'));var rp=require(_0xe832('0x2'));var moment=require(_0xe832('0x3'));var BPromise=require(_0xe832('0x4'));var Mustache=require(_0xe832('0x5'));var util=require(_0xe832('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xe832('0x7'));var ejs=require(_0xe832('0x8'));var fs=require('fs');var fs_extra=require(_0xe832('0x9'));var _=require(_0xe832('0xa'));var squel=require(_0xe832('0xb'));var crypto=require(_0xe832('0xc'));var jsforce=require(_0xe832('0xd'));var deskjs=require(_0xe832('0xe'));var toCsv=require(_0xe832('0x7'));var querystring=require('querystring');var Papa=require(_0xe832('0xf'));var Redis=require('ioredis');var authService=require(_0xe832('0x10'));var qs=require(_0xe832('0x11'));var as=require(_0xe832('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe832('0x13'))(_0xe832('0x14'));var utils=require(_0xe832('0x15'));var config=require(_0xe832('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe832('0x17'))['db'];var dbH=require(_0xe832('0x17'))['dbH'];function respondWithStatusCode(_0x4669b4,_0x3c46d3){_0x3c46d3=_0x3c46d3||0xcc;return function(_0x4c857b){if(_0x4c857b){return _0x4669b4[_0xe832('0x18')](_0x3c46d3);}return _0x4669b4[_0xe832('0x19')](_0x3c46d3)[_0xe832('0x1a')]();};}function respondWithResult(_0x124d4c,_0x312999){_0x312999=_0x312999||0xc8;return function(_0x3d8782){if(_0x3d8782){return _0x124d4c[_0xe832('0x19')](_0x312999)[_0xe832('0x1b')](_0x3d8782);}};}function respondWithFilteredResult(_0x4e3995,_0x3d8382){return function(_0xd70f2e){if(_0xd70f2e){var _0x918070=typeof _0x3d8382['offset']===_0xe832('0x1c')&&typeof _0x3d8382[_0xe832('0x1d')]===_0xe832('0x1c');var _0x382e95=_0xd70f2e['count'];var _0x346cbb=_0x918070?0x0:_0x3d8382[_0xe832('0x1e')];var _0x4d1603=_0x918070?_0xd70f2e[_0xe832('0x1f')]:_0x3d8382['offset']+_0x3d8382[_0xe832('0x1d')];var _0x45e24a;if(_0x4d1603>=_0x382e95){_0x4d1603=_0x382e95;_0x45e24a=0xc8;}else{_0x45e24a=0xce;}_0x4e3995[_0xe832('0x19')](_0x45e24a);return _0x4e3995[_0xe832('0x20')](_0xe832('0x21'),_0x346cbb+'-'+_0x4d1603+'/'+_0x382e95)['json'](_0xd70f2e);}return null;};}function patchUpdates(_0x3646b2){return function(_0x4753e3){try{jsonpatch[_0xe832('0x22')](_0x4753e3,_0x3646b2,!![]);}catch(_0x2e668c){return BPromise['reject'](_0x2e668c);}return _0x4753e3['save']();};}function saveUpdates(_0x57446a,_0xc4c62f){return function(_0x349553){if(_0x349553){return _0x349553[_0xe832('0x23')](_0x57446a)[_0xe832('0x24')](function(_0x596d30){return _0x596d30;});}return null;};}function removeEntity(_0x55c81f,_0x281a96){return function(_0x53984c){if(_0x53984c){return _0x53984c[_0xe832('0x25')]()[_0xe832('0x24')](function(){var _0x329ffd=_0x53984c[_0xe832('0x26')]({'plain':!![]});var _0x13420a='CustomReports';return db['UserProfileResource'][_0xe832('0x25')]({'where':{'type':_0x13420a,'resourceId':_0x329ffd['id']}})[_0xe832('0x24')](function(){return _0x53984c;});})[_0xe832('0x24')](function(){_0x55c81f[_0xe832('0x19')](0xcc)[_0xe832('0x1a')]();});}};}function handleEntityNotFound(_0x53d622,_0x5b3cab){return function(_0x55c508){if(!_0x55c508){_0x53d622[_0xe832('0x18')](0x194);}return _0x55c508;};}function handleError(_0x2c2737,_0x54497e){_0x54497e=_0x54497e||0x1f4;return function(_0x54a243){logger['error'](_0x54a243[_0xe832('0x27')]);if(_0x54a243['name']){delete _0x54a243[_0xe832('0x28')];}_0x2c2737['status'](_0x54497e)[_0xe832('0x29')](_0x54a243);};}exports[_0xe832('0x2a')]=function(_0x5391fc,_0x35d0d3){var _0x334433={},_0x583158={},_0x335d44={'count':0x0,'rows':[]};var _0x1c4c5e=_['map'](db['AnalyticCustomReport'][_0xe832('0x2b')],function(_0x4c162c){return{'name':_0x4c162c[_0xe832('0x2c')],'type':_0x4c162c[_0xe832('0x2d')][_0xe832('0x2e')]};});_0x583158['model']=_[_0xe832('0x2f')](_0x1c4c5e,_0xe832('0x28'));_0x583158[_0xe832('0x30')]=_[_0xe832('0x31')](_0x5391fc[_0xe832('0x30')]);_0x583158[_0xe832('0x32')]=_[_0xe832('0x33')](_0x583158[_0xe832('0x34')],_0x583158[_0xe832('0x30')]);_0x334433['attributes']=_[_0xe832('0x33')](_0x583158['model'],qs['fields'](_0x5391fc[_0xe832('0x30')][_0xe832('0x35')]));_0x334433[_0xe832('0x36')]=_0x334433[_0xe832('0x36')][_0xe832('0x37')]?_0x334433[_0xe832('0x36')]:_0x583158[_0xe832('0x34')];if(!_0x5391fc[_0xe832('0x30')]['hasOwnProperty'](_0xe832('0x38'))){_0x334433['limit']=qs['limit'](_0x5391fc['query'][_0xe832('0x1d')]);_0x334433[_0xe832('0x1e')]=qs['offset'](_0x5391fc[_0xe832('0x30')][_0xe832('0x1e')]);}_0x334433['order']=qs[_0xe832('0x39')](_0x5391fc[_0xe832('0x30')]['sort']);_0x334433[_0xe832('0x3a')]=qs['filters'](_[_0xe832('0x3b')](_0x5391fc[_0xe832('0x30')],_0x583158[_0xe832('0x32')]),_0x1c4c5e);if(_0x5391fc[_0xe832('0x30')]['filter']){_0x334433[_0xe832('0x3a')]=_[_0xe832('0x3c')](_0x334433[_0xe832('0x3a')],{'$or':_[_0xe832('0x2f')](_0x1c4c5e,function(_0x1dbaf8){if(_0x1dbaf8[_0xe832('0x2d')]!==_0xe832('0x3d')){var _0x4d8d03={};_0x4d8d03[_0x1dbaf8['name']]={'$like':'%'+_0x5391fc[_0xe832('0x30')][_0xe832('0x3e')]+'%'};return _0x4d8d03;}})});}_0x334433=_[_0xe832('0x3c')]({},_0x334433,_0x5391fc['options']);var _0x24f385={'where':_0x334433[_0xe832('0x3a')]};return db['AnalyticCustomReport'][_0xe832('0x1f')](_0x24f385)[_0xe832('0x24')](function(_0x233258){_0x335d44[_0xe832('0x1f')]=_0x233258;if(_0x5391fc[_0xe832('0x30')][_0xe832('0x3f')]){_0x334433[_0xe832('0x40')]=[{'all':!![]}];}return db[_0xe832('0x41')][_0xe832('0x42')](_0x334433);})[_0xe832('0x24')](function(_0x3a3671){_0x335d44['rows']=_0x3a3671;return _0x335d44;})['then'](respondWithFilteredResult(_0x35d0d3,_0x334433))['catch'](handleError(_0x35d0d3,null));};exports[_0xe832('0x43')]=function(_0x198afa,_0x580895){var _0x2f60da={'raw':![],'where':{'id':_0x198afa['params']['id']}},_0x33f68f={};_0x33f68f['model']=_['keys'](db[_0xe832('0x41')][_0xe832('0x2b')]);_0x33f68f[_0xe832('0x30')]=_[_0xe832('0x31')](_0x198afa[_0xe832('0x30')]);_0x33f68f[_0xe832('0x32')]=_[_0xe832('0x33')](_0x33f68f[_0xe832('0x34')],_0x33f68f[_0xe832('0x30')]);_0x2f60da[_0xe832('0x36')]=_[_0xe832('0x33')](_0x33f68f[_0xe832('0x34')],qs[_0xe832('0x35')](_0x198afa[_0xe832('0x30')]['fields']));_0x2f60da[_0xe832('0x36')]=_0x2f60da[_0xe832('0x36')][_0xe832('0x37')]?_0x2f60da['attributes']:_0x33f68f[_0xe832('0x34')];if(_0x198afa['query'][_0xe832('0x3f')]){_0x2f60da[_0xe832('0x40')]=[{'all':!![]}];}_0x2f60da=_[_0xe832('0x3c')]({},_0x2f60da,_0x198afa[_0xe832('0x44')]);return db[_0xe832('0x41')][_0xe832('0x45')](_0x2f60da)[_0xe832('0x24')](handleEntityNotFound(_0x580895,null))[_0xe832('0x24')](respondWithResult(_0x580895,null))[_0xe832('0x46')](handleError(_0x580895,null));};exports['create']=function(_0xfdcdbe,_0x18a560){return db[_0xe832('0x41')][_0xe832('0x47')](_0xfdcdbe['body'],{})[_0xe832('0x24')](function(_0x4110c4){var _0x2a62b4=_0xfdcdbe['user']['get']({'plain':!![]});if(!_0x2a62b4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a62b4['role']===_0xe832('0x48')){var _0x518de1=_0x4110c4[_0xe832('0x26')]({'plain':!![]});var _0xd67ff9='Reports';return db[_0xe832('0x49')][_0xe832('0x45')]({'where':{'name':_0xd67ff9,'userProfileId':_0x2a62b4[_0xe832('0x4a')]},'raw':!![]})['then'](function(_0x208622){if(_0x208622&&_0x208622[_0xe832('0x4b')]===0x0){return db[_0xe832('0x4c')][_0xe832('0x47')]({'name':_0x518de1[_0xe832('0x28')],'resourceId':_0x518de1['id'],'type':_0xe832('0x4d'),'sectionId':_0x208622['id']},{})['then'](function(){return _0x4110c4;});}else{return _0x4110c4;}})['catch'](function(_0x5ad382){logger[_0xe832('0x4e')](_0xe832('0x4f'),_0x5ad382);throw _0x5ad382;});}return _0x4110c4;})[_0xe832('0x24')](respondWithResult(_0x18a560,0xc9))[_0xe832('0x46')](handleError(_0x18a560,null));};exports[_0xe832('0x23')]=function(_0x37ae6e,_0x4b35b9){if(_0x37ae6e[_0xe832('0x50')]['id']){delete _0x37ae6e[_0xe832('0x50')]['id'];}return db[_0xe832('0x41')][_0xe832('0x45')]({'where':{'id':_0x37ae6e['params']['id']}})[_0xe832('0x24')](handleEntityNotFound(_0x4b35b9,null))[_0xe832('0x24')](saveUpdates(_0x37ae6e[_0xe832('0x50')],null))[_0xe832('0x24')](respondWithResult(_0x4b35b9,null))['catch'](handleError(_0x4b35b9,null));};exports[_0xe832('0x25')]=function(_0x394efe,_0xfd9c8e){return db[_0xe832('0x41')][_0xe832('0x45')]({'where':{'id':_0x394efe['params']['id']}})[_0xe832('0x24')](handleEntityNotFound(_0xfd9c8e,null))[_0xe832('0x24')](removeEntity(_0xfd9c8e,null))['catch'](handleError(_0xfd9c8e,null));};exports['preview']=function(_0x4b9aa8,_0x312ba1){var _0x3bbef8=0xa;var _0x42ce59=[_0xe832('0x51'),'left_join',_0xe832('0x52'),_0xe832('0x53')];var _0x107413={'SUM':_0xe832('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xe832('0x55'),'GROUP_CONCAT':_0xe832('0x56'),'GROUP_CONCAT ASC':_0xe832('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x419508={'SEC_TO_TIME':_0xe832('0x58'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xe832('0x59')};var _0x50731c=function(_0x41e1c1){return!_[_0xe832('0x5a')]([_0xe832('0x5b'),'IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x41e1c1);};var _0x161e32=function(_0x162073){if(!_0x162073||!_0x162073[_0xe832('0x5c')]['length']){return'';}for(var _0x280c84='(',_0x544384=0x0;_0x544384<_0x162073[_0xe832('0x5c')][_0xe832('0x37')];_0x544384+=0x1){_0x544384>0x0&&(_0x280c84+='\x20'+_0x162073[_0xe832('0x5d')]+'\x20');_0x280c84+=_0x162073['rules'][_0x544384]['group']?_0x161e32(_0x162073[_0xe832('0x5c')][_0x544384][_0xe832('0x5e')]):_0x162073[_0xe832('0x5c')][_0x544384][_0xe832('0x5f')]+'\x20'+_0x162073[_0xe832('0x5c')][_0x544384]['condition']+(_0x50731c(_0x162073[_0xe832('0x5c')][_0x544384]['condition'])?'\x20'+_0x162073['rules'][_0x544384][_0xe832('0x60')]:'');}return _0x280c84+')';};var _0x4a01b5={'where':{'id':_0x4b9aa8[_0xe832('0x61')]['id']}},_0x38286e,_0x1be49d,_0x3c583e,_0x3cef74,_0x2d575e;_0x4a01b5=_['merge']({},_0x4a01b5,_0x4b9aa8[_0xe832('0x44')]);return db[_0xe832('0x41')][_0xe832('0x45')](_0x4a01b5)[_0xe832('0x24')](function(_0x59910e){if(_0x59910e){_0x38286e=_0x59910e;return _0x59910e['getFields']();}return null;})[_0xe832('0x24')](function(_0xa8c198){if(_0xa8c198){if(!_0xa8c198[_0xe832('0x37')]){throw new db[(_0xe832('0x62'))]['ValidationErrorItem'](_0xe832('0x63'),0x193);}_0x1be49d=_0xa8c198;return db[_0xe832('0x64')][_0xe832('0x42')]({'raw':!![]});}return null;})[_0xe832('0x24')](function(_0x304884){if(_0x304884){_0x3c583e=_[_0xe832('0x65')](_0x304884,'id');var _0x4f58b9;var _0x2778d7=squel[_0xe832('0x66')]();_0x2778d7[_0xe832('0x67')](_0x38286e[_0xe832('0x68')]);for(var _0x2ba799=0x0;_0x2ba799<_0x1be49d[_0xe832('0x37')];_0x2ba799+=0x1){_0x4f58b9=_0x1be49d[_0x2ba799][_0xe832('0x69')]?_0x3c583e[_0x1be49d[_0x2ba799][_0xe832('0x69')]][_0xe832('0x6a')]:_0x1be49d[_0x2ba799][_0xe832('0x5f')];_0x4f58b9=_0x1be49d[_0x2ba799][_0xe832('0x6b')]?_[_0xe832('0x6c')](_0x107413[_0x1be49d[_0x2ba799][_0xe832('0x6b')]],'%s',_0x4f58b9):_0x4f58b9;_0x4f58b9=_0x1be49d[_0x2ba799][_0xe832('0x6d')]?_[_0xe832('0x6c')](_0x419508[_0x1be49d[_0x2ba799][_0xe832('0x6d')]],'%s',_0x4f58b9):_0x4f58b9;if(_0x1be49d[_0x2ba799][_0xe832('0x6e')]){_0x2778d7[_0xe832('0x5e')](_0x4f58b9);}_0x1be49d[_0x2ba799][_0xe832('0x6f')]&&_0x2778d7[_0xe832('0x70')](_0x4f58b9,_0x1be49d[_0x2ba799][_0xe832('0x6f')]===_0xe832('0x71')?![]:!![]);_0x2778d7[_0xe832('0x5f')](_0x4f58b9,_0x1be49d[_0x2ba799][_0xe832('0x72')]||_0x4f58b9);}if(_0x38286e[_0xe832('0x73')]){_0x38286e['joins']=JSON[_0xe832('0x74')](_0x38286e['joins']);for(var _0x41e5f8=0x0;_0x41e5f8<_0x38286e[_0xe832('0x73')][_0xe832('0x37')];_0x41e5f8+=0x1){if(_0x38286e[_0xe832('0x73')][_0x41e5f8]['type']&&_[_0xe832('0x5a')](_0x42ce59,_0x38286e[_0xe832('0x73')][_0x41e5f8][_0xe832('0x2d')])&&_0x38286e[_0xe832('0x73')][_0x41e5f8]['parentKey']&&_0x38286e[_0xe832('0x73')][_0x41e5f8][_0xe832('0x75')]&&_0x38286e[_0xe832('0x73')][_0x41e5f8][_0xe832('0x76')]){_0x2778d7[_0x38286e[_0xe832('0x73')][_0x41e5f8][_0xe832('0x2d')]](_0x38286e[_0xe832('0x73')][_0x41e5f8]['foreignTable'],null,util['format'](_0xe832('0x77'),_0x38286e[_0xe832('0x68')],_0x38286e['joins'][_0x41e5f8][_0xe832('0x78')],_0x38286e[_0xe832('0x73')][_0x41e5f8]['foreignTable'],_0x38286e[_0xe832('0x73')][_0x41e5f8][_0xe832('0x76')]));}}}if(_0x38286e[_0xe832('0x79')]){_0x38286e[_0xe832('0x79')]=JSON[_0xe832('0x74')](_0x38286e['conditions']);_0x2778d7[_0xe832('0x3a')](_0x161e32(_0x38286e[_0xe832('0x79')][_0xe832('0x5e')]));}_0x2d575e=_0x2778d7[_0xe832('0x7a')]();_0x2778d7[_0xe832('0x1d')](_0x3bbef8);_0x2778d7['offset'](0x0);logger[_0xe832('0x7b')](_0xe832('0x7c'),_0x2778d7[_0xe832('0x7d')]());return dbH['sequelize'][_0xe832('0x30')](_0x2778d7['toString'](),{'type':dbH[_0xe832('0x7e')][_0xe832('0x7f')][_0xe832('0x80')]});}})[_0xe832('0x24')](respondWithResult(_0x312ba1,null))[_0xe832('0x46')](handleError(_0x312ba1,null));};function runReport(_0x29c6f8,_0x23d367,_0x455fe){var _0x5ca54f=_0x23d367[_0xe832('0x28')];var _0x2cd87f=0xa;var _0x199db9=['join',_0xe832('0x81'),_0xe832('0x52'),'cross_join'];var _0x329303={'SUM':_0xe832('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xe832('0x82'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xe832('0x55'),'GROUP_CONCAT':_0xe832('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4273d2={'SEC_TO_TIME':_0xe832('0x58'),'DATE':'DATE(%s)','HOUR':_0xe832('0x83'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xe832('0x59')};var _0x1a0807=function(_0xb4168c){return!_['includes']([_0xe832('0x5b'),_0xe832('0x84'),_0xe832('0x85'),_0xe832('0x86')],_0xb4168c);};var _0x496cd3=function(_0x8775ca){if(!_0x8775ca||!_0x8775ca[_0xe832('0x5c')][_0xe832('0x37')]){return'';}for(var _0x10f9a1='(',_0x5bff87=0x0;_0x5bff87<_0x8775ca[_0xe832('0x5c')][_0xe832('0x37')];_0x5bff87+=0x1){_0x5bff87>0x0&&(_0x10f9a1+='\x20'+_0x8775ca[_0xe832('0x5d')]+'\x20');_0x10f9a1+=_0x8775ca[_0xe832('0x5c')][_0x5bff87][_0xe832('0x5e')]?_0x496cd3(_0x8775ca[_0xe832('0x5c')][_0x5bff87][_0xe832('0x5e')]):_0x8775ca[_0xe832('0x5c')][_0x5bff87][_0xe832('0x5f')]+'\x20'+_0x8775ca[_0xe832('0x5c')][_0x5bff87][_0xe832('0x87')]+(_0x1a0807(_0x8775ca[_0xe832('0x5c')][_0x5bff87][_0xe832('0x87')])?'\x20'+_0x8775ca[_0xe832('0x5c')][_0x5bff87][_0xe832('0x60')]:'');}return _0x10f9a1+')';};var _0x39e271={'where':{'id':_0x29c6f8['id']}},_0x1b46a2,_0xe23634,_0xa802a1,_0x4659be,_0x514c83;_0x39e271=_[_0xe832('0x3c')]({},_0x39e271,_0x455fe);return db[_0xe832('0x41')][_0xe832('0x45')](_0x39e271)[_0xe832('0x24')](function(_0x1b92e8){if(_0x1b92e8){_0x1b46a2=_0x1b92e8;return _0x1b92e8[_0xe832('0x88')]();}return null;})['then'](function(_0x2e1914){if(_0x2e1914){if(!_0x2e1914['length']){throw new db[(_0xe832('0x62'))][(_0xe832('0x89'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xe23634=_0x2e1914;return db[_0xe832('0x64')][_0xe832('0x42')]({'raw':!![]});}return null;})[_0xe832('0x24')](function(_0x2c8723){if(_0x2c8723){_0xa802a1=_[_0xe832('0x65')](_0x2c8723,'id');var _0x5a421d;var _0x5918d9=squel['select']();_0x5918d9[_0xe832('0x67')](_0x1b46a2[_0xe832('0x68')]);for(var _0x5dd1fd=0x0;_0x5dd1fd<_0xe23634['length'];_0x5dd1fd+=0x1){_0x5a421d=_0xe23634[_0x5dd1fd][_0xe832('0x69')]?_0xa802a1[_0xe23634[_0x5dd1fd][_0xe832('0x69')]][_0xe832('0x6a')]:_0xe23634[_0x5dd1fd][_0xe832('0x5f')];_0x5a421d=_0xe23634[_0x5dd1fd][_0xe832('0x6b')]?_[_0xe832('0x6c')](_0x329303[_0xe23634[_0x5dd1fd]['function']],'%s',_0x5a421d):_0x5a421d;_0x5a421d=_0xe23634[_0x5dd1fd][_0xe832('0x6d')]?_['replace'](_0x4273d2[_0xe23634[_0x5dd1fd][_0xe832('0x6d')]],'%s',_0x5a421d):_0x5a421d;if(_0xe23634[_0x5dd1fd][_0xe832('0x6e')]){_0x5918d9[_0xe832('0x5e')](_0x5a421d);}_0xe23634[_0x5dd1fd][_0xe832('0x6f')]&&_0x5918d9[_0xe832('0x70')](_0x5a421d,_0xe23634[_0x5dd1fd][_0xe832('0x6f')]==='DESC'?![]:!![]);_0x5918d9[_0xe832('0x5f')](_0x5a421d,_0xe23634[_0x5dd1fd]['alias']||_0x5a421d);}if(_0x1b46a2[_0xe832('0x73')]){_0x1b46a2['joins']=JSON[_0xe832('0x74')](_0x1b46a2[_0xe832('0x73')]);for(var _0x174e9c=0x0;_0x174e9c<_0x1b46a2['joins'][_0xe832('0x37')];_0x174e9c+=0x1){if(_0x1b46a2[_0xe832('0x73')][_0x174e9c][_0xe832('0x2d')]&&_[_0xe832('0x5a')](_0x199db9,_0x1b46a2[_0xe832('0x73')][_0x174e9c][_0xe832('0x2d')])&&_0x1b46a2[_0xe832('0x73')][_0x174e9c][_0xe832('0x78')]&&_0x1b46a2[_0xe832('0x73')][_0x174e9c][_0xe832('0x75')]&&_0x1b46a2[_0xe832('0x73')][_0x174e9c][_0xe832('0x76')]){_0x5918d9[_0x1b46a2[_0xe832('0x73')][_0x174e9c][_0xe832('0x2d')]](_0x1b46a2['joins'][_0x174e9c][_0xe832('0x75')],null,util[_0xe832('0x6d')](_0xe832('0x77'),_0x1b46a2['table'],_0x1b46a2['joins'][_0x174e9c][_0xe832('0x78')],_0x1b46a2[_0xe832('0x73')][_0x174e9c][_0xe832('0x75')],_0x1b46a2[_0xe832('0x73')][_0x174e9c][_0xe832('0x76')]));}}}if(_0x1b46a2[_0xe832('0x79')]){_0x1b46a2[_0xe832('0x79')]=JSON['parse'](_0x1b46a2[_0xe832('0x79')]);_0x5918d9[_0xe832('0x3a')](_0x496cd3(_0x1b46a2['conditions'][_0xe832('0x5e')]));}_0x514c83=_0x5918d9[_0xe832('0x7a')]();_0x5918d9[_0xe832('0x1d')](_0x2cd87f);_0x5918d9[_0xe832('0x1e')](0x0);return;}})[_0xe832('0x24')](function(){if(_0x23d367[_0xe832('0x8a')]===_0xe832('0x8b')){return null;}var _0x1fa98a=_[_0xe832('0x3c')](_0x23d367,{'name':_0x23d367['fullPath']||_0x23d367[_0xe832('0x28')]||_0x1b46a2['name'],'basename':_0x5ca54f,'savename':util[_0xe832('0x6d')](_0xe832('0x8c'),_0x23d367[_0xe832('0x28')]||_0x1b46a2[_0xe832('0x28')],require(_0xe832('0x8d'))[_0xe832('0x8e')](0x4),_0x23d367[_0xe832('0x8a')]||_0xe832('0x8f')),'reportId':_0x1b46a2['id'],'reportType':_0xe832('0x90')});return db[_0xe832('0x91')][_0xe832('0x47')](_0x1fa98a,{'raw':!![]});})[_0xe832('0x24')](function(_0x2c0e43){if(_0x1b46a2['table']==='cdr'){_0x514c83[_0xe832('0x3a')](_0x1b46a2[_0xe832('0x68')]+_0xe832('0x92'),_0x23d367[_0xe832('0x93')],_0x23d367[_0xe832('0x94')]);}else{_0x514c83[_0xe832('0x3a')](_0x1b46a2['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x23d367[_0xe832('0x93')],_0x23d367['endDate']);}if(_0x2c0e43){logger[_0xe832('0x95')]('Run\x20Query:',_0x514c83[_0xe832('0x7d')]());require(_0xe832('0x96'))['fork'](path[_0xe832('0x51')](__dirname,_0xe832('0x97'),_0x2c0e43[_0xe832('0x8a')]),[_0x2c0e43['id'],_0x514c83[_0xe832('0x7d')](),path['join'](__dirname,_0xe832('0x98'),_0x2c0e43[_0xe832('0x99')]),_0x5ca54f]);return _0x2c0e43;}else{var _0x1632e5=squel[_0xe832('0x66')]();_0x1632e5[_0xe832('0x67')]('('+_0x514c83[_0xe832('0x7d')]()+')',_0xe832('0x9a'));_0x1632e5[_0xe832('0x5f')](_0xe832('0x9b'),_0xe832('0x1f'));_0x514c83[_0xe832('0x1d')](_0x23d367[_0xe832('0x1d')]||_0x2cd87f);_0x514c83[_0xe832('0x1e')](_0x23d367[_0xe832('0x1e')]||0x0);return dbH[_0xe832('0x7e')][_0xe832('0x30')](_0x1632e5[_0xe832('0x7d')](),{'type':dbH[_0xe832('0x7e')][_0xe832('0x7f')][_0xe832('0x80')]})[_0xe832('0x24')](function(_0x161cce){if(!_0x161cce[_0xe832('0x37')]){_0x4659be=0x0;}else{_0x4659be=_0x161cce[0x0][_0xe832('0x1f')]||0x0;}return dbH[_0xe832('0x7e')]['query'](_0x514c83[_0xe832('0x7d')](),{'type':dbH[_0xe832('0x7e')][_0xe832('0x7f')][_0xe832('0x80')]});})[_0xe832('0x24')](function(_0x47dbc4){return{'rows':_0x47dbc4||[],'count':_0x4659be};});}});}exports['run']=function(_0xdab5b1,_0x2338b2){return runReport(_0xdab5b1[_0xe832('0x61')],_0xdab5b1[_0xe832('0x30')],_0xdab5b1['options'])[_0xe832('0x24')](respondWithResult(_0x2338b2,null))['catch'](handleError(_0x2338b2,null));};exports[_0xe832('0x9c')]=runReport;exports[_0xe832('0x30')]=function(_0x4e0433,_0xc6271e){var _0x22269c=0xa;var _0x4e2a31=[_0xe832('0x51'),'left_join',_0xe832('0x52'),_0xe832('0x53')];var _0x401bcb={'SUM':_0xe832('0x54'),'COUNT':_0xe832('0x9d'),'COUNT DISTINCT':_0xe832('0x82'),'MAX':_0xe832('0x9e'),'MIN':_0xe832('0x9f'),'AVG':_0xe832('0x55'),'GROUP_CONCAT':_0xe832('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe832('0xa0')};var _0x400f07={'SEC_TO_TIME':_0xe832('0x58'),'DATE':_0xe832('0xa1'),'HOUR':_0xe832('0x83'),'ROUND':_0xe832('0xa2'),'UNIX_TIMESTAMP':_0xe832('0x59')};var _0x1e915e=function(_0x340de8){return!_[_0xe832('0x5a')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xe832('0x85'),_0xe832('0x86')],_0x340de8);};var _0x5644fd=function(_0x4c4504){if(!_0x4c4504||!_0x4c4504[_0xe832('0x5c')]['length']){return'';}for(var _0x2cf794='(',_0x59e67b=0x0;_0x59e67b<_0x4c4504[_0xe832('0x5c')][_0xe832('0x37')];_0x59e67b+=0x1){_0x59e67b>0x0&&(_0x2cf794+='\x20'+_0x4c4504[_0xe832('0x5d')]+'\x20');_0x2cf794+=_0x4c4504[_0xe832('0x5c')][_0x59e67b]['group']?_0x5644fd(_0x4c4504[_0xe832('0x5c')][_0x59e67b][_0xe832('0x5e')]):_0x4c4504['rules'][_0x59e67b][_0xe832('0x5f')]+'\x20'+_0x4c4504[_0xe832('0x5c')][_0x59e67b][_0xe832('0x87')]+(_0x1e915e(_0x4c4504[_0xe832('0x5c')][_0x59e67b]['condition'])?'\x20'+_0x4c4504[_0xe832('0x5c')][_0x59e67b][_0xe832('0x60')]:'');}return _0x2cf794+')';};var _0x438dd8={'where':{'id':_0x4e0433['params']['id']}},_0x5b6347,_0x41875e,_0x14df33,_0x51287a,_0x56b39b;_0x438dd8=_[_0xe832('0x3c')]({},_0x438dd8,_0x4e0433['options']);return db[_0xe832('0x41')]['find'](_0x438dd8)['then'](function(_0xa73ac1){if(_0xa73ac1){_0x5b6347=_0xa73ac1;return _0xa73ac1['getFields']();}return null;})['then'](function(_0x1cfcd5){if(_0x1cfcd5){if(!_0x1cfcd5[_0xe832('0x37')]){throw new db['Sequelize']['ValidationErrorItem'](_0xe832('0x63'),0x193);}_0x41875e=_0x1cfcd5;return db['AnalyticMetric'][_0xe832('0x42')]({'raw':!![]});}return null;})[_0xe832('0x24')](function(_0x213ba7){if(_0x213ba7){_0x14df33=_[_0xe832('0x65')](_0x213ba7,'id');var _0x1384c4;var _0xed10e6=squel[_0xe832('0x66')]();_0xed10e6['from'](_0x5b6347[_0xe832('0x68')]);for(var _0xe2b2df=0x0;_0xe2b2df<_0x41875e[_0xe832('0x37')];_0xe2b2df+=0x1){_0x1384c4=_0x41875e[_0xe2b2df][_0xe832('0x69')]?_0x14df33[_0x41875e[_0xe2b2df][_0xe832('0x69')]][_0xe832('0x6a')]:_0x41875e[_0xe2b2df][_0xe832('0x5f')];_0x1384c4=_0x41875e[_0xe2b2df][_0xe832('0x6b')]?_['replace'](_0x401bcb[_0x41875e[_0xe2b2df][_0xe832('0x6b')]],'%s',_0x1384c4):_0x1384c4;_0x1384c4=_0x41875e[_0xe2b2df][_0xe832('0x6d')]?_[_0xe832('0x6c')](_0x400f07[_0x41875e[_0xe2b2df]['format']],'%s',_0x1384c4):_0x1384c4;if(_0x41875e[_0xe2b2df][_0xe832('0x6e')]){_0xed10e6['group'](_0x1384c4);}_0x41875e[_0xe2b2df][_0xe832('0x6f')]&&_0xed10e6[_0xe832('0x70')](_0x1384c4,_0x41875e[_0xe2b2df][_0xe832('0x6f')]===_0xe832('0x71')?![]:!![]);_0xed10e6['field'](_0x1384c4,_0x41875e[_0xe2b2df]['alias']||_0x1384c4);}if(_0x5b6347[_0xe832('0x73')]){_0x5b6347['joins']=JSON[_0xe832('0x74')](_0x5b6347['joins']);for(var _0x34190a=0x0;_0x34190a<_0x5b6347[_0xe832('0x73')]['length'];_0x34190a+=0x1){if(_0x5b6347[_0xe832('0x73')][_0x34190a][_0xe832('0x2d')]&&_['includes'](_0x4e2a31,_0x5b6347[_0xe832('0x73')][_0x34190a]['type'])&&_0x5b6347[_0xe832('0x73')][_0x34190a][_0xe832('0x78')]&&_0x5b6347[_0xe832('0x73')][_0x34190a]['foreignTable']&&_0x5b6347['joins'][_0x34190a][_0xe832('0x76')]){_0xed10e6[_0x5b6347[_0xe832('0x73')][_0x34190a]['type']](_0x5b6347['joins'][_0x34190a][_0xe832('0x75')],null,util[_0xe832('0x6d')]('%s.%s\x20=\x20%s.%s',_0x5b6347[_0xe832('0x68')],_0x5b6347[_0xe832('0x73')][_0x34190a]['parentKey'],_0x5b6347['joins'][_0x34190a][_0xe832('0x75')],_0x5b6347[_0xe832('0x73')][_0x34190a]['foreignKey']));}}}if(_0x5b6347['conditions']){_0x5b6347[_0xe832('0x79')]=JSON[_0xe832('0x74')](_0x5b6347['conditions']);_0xed10e6['where'](_0x5644fd(_0x5b6347[_0xe832('0x79')][_0xe832('0x5e')]));}_0x56b39b=_0xed10e6[_0xe832('0x7a')]();_0xed10e6[_0xe832('0x1d')](_0x22269c);_0xed10e6[_0xe832('0x1e')](0x0);logger[_0xe832('0x7b')](_0xe832('0x7c'),_0xed10e6[_0xe832('0x7d')]());return dbH['sequelize'][_0xe832('0x30')](_0xed10e6[_0xe832('0x7d')](),{'type':dbH[_0xe832('0x7e')][_0xe832('0x7f')][_0xe832('0x80')]});}})[_0xe832('0x24')](function(){return{'sql':_0x56b39b[_0xe832('0x7d')]()};})['then'](respondWithResult(_0xc6271e,null))[_0xe832('0x46')](handleError(_0xc6271e,null));};
\ No newline at end of file
+var _0x9d7b=['COUNT(DISTINCT\x20%s)','MAX(%s)','AnalyticMetric','select','MetricId','alias','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','../../components/export/','../../files/reports','savename','COUNT(*)','SELECT','run','SUM(%s)','AVG(%s)','%s.%s\x20=\x20%s.%s','debug','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','status','end','offset','limit','undefined','count','json','apply','reject','save','then','destroy','get','CustomReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','options','AnalyticCustomReport','includeAll','include','findAll','catch','show','params','keys','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','COUNT(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','merge','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','from','metric','function','replace','format','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','table','conditions','clone','Limited\x20Query:','sequelize','toString','QueryTypes'];(function(_0x2df2c4,_0x3b183b){var _0x3244d3=function(_0x26e5b2){while(--_0x26e5b2){_0x2df2c4['push'](_0x2df2c4['shift']());}};_0x3244d3(++_0x3b183b);}(_0x9d7b,0xc5));var _0xb9d7=function(_0x105b1a,_0x52d2de){_0x105b1a=_0x105b1a-0x0;var _0x5c95a0=_0x9d7b[_0x105b1a];return _0x5c95a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb9d7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb9d7('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb9d7('0x2'));var Mustache=require(_0xb9d7('0x3'));var util=require(_0xb9d7('0x4'));var path=require(_0xb9d7('0x5'));var sox=require('sox');var csv=require(_0xb9d7('0x6'));var ejs=require(_0xb9d7('0x7'));var fs=require('fs');var fs_extra=require(_0xb9d7('0x8'));var _=require(_0xb9d7('0x9'));var squel=require(_0xb9d7('0xa'));var crypto=require(_0xb9d7('0xb'));var jsforce=require(_0xb9d7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb9d7('0x6'));var querystring=require(_0xb9d7('0xd'));var Papa=require(_0xb9d7('0xe'));var Redis=require(_0xb9d7('0xf'));var authService=require(_0xb9d7('0x10'));var qs=require(_0xb9d7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb9d7('0x12'))(_0xb9d7('0x13'));var utils=require(_0xb9d7('0x14'));var config=require(_0xb9d7('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb9d7('0x16'))['db'];var dbH=require(_0xb9d7('0x16'))[_0xb9d7('0x17')];function respondWithStatusCode(_0x307e8c,_0x44dd52){_0x44dd52=_0x44dd52||0xcc;return function(_0x52d010){if(_0x52d010){return _0x307e8c['sendStatus'](_0x44dd52);}return _0x307e8c[_0xb9d7('0x18')](_0x44dd52)[_0xb9d7('0x19')]();};}function respondWithResult(_0xb0cd94,_0x5707ae){_0x5707ae=_0x5707ae||0xc8;return function(_0x4b9975){if(_0x4b9975){return _0xb0cd94[_0xb9d7('0x18')](_0x5707ae)['json'](_0x4b9975);}};}function respondWithFilteredResult(_0x4e7ec1,_0x24576a){return function(_0x30caf8){if(_0x30caf8){var _0xc9c27b=typeof _0x24576a[_0xb9d7('0x1a')]==='undefined'&&typeof _0x24576a[_0xb9d7('0x1b')]===_0xb9d7('0x1c');var _0x5f027b=_0x30caf8[_0xb9d7('0x1d')];var _0x1c78ba=_0xc9c27b?0x0:_0x24576a[_0xb9d7('0x1a')];var _0x3de446=_0xc9c27b?_0x30caf8[_0xb9d7('0x1d')]:_0x24576a[_0xb9d7('0x1a')]+_0x24576a['limit'];var _0x5c69d0;if(_0x3de446>=_0x5f027b){_0x3de446=_0x5f027b;_0x5c69d0=0xc8;}else{_0x5c69d0=0xce;}_0x4e7ec1['status'](_0x5c69d0);return _0x4e7ec1['set']('Content-Range',_0x1c78ba+'-'+_0x3de446+'/'+_0x5f027b)[_0xb9d7('0x1e')](_0x30caf8);}return null;};}function patchUpdates(_0x41e36c){return function(_0x481ce6){try{jsonpatch[_0xb9d7('0x1f')](_0x481ce6,_0x41e36c,!![]);}catch(_0xb10fed){return BPromise[_0xb9d7('0x20')](_0xb10fed);}return _0x481ce6[_0xb9d7('0x21')]();};}function saveUpdates(_0xca16fc,_0x2002ef){return function(_0x1fce49){if(_0x1fce49){return _0x1fce49['update'](_0xca16fc)[_0xb9d7('0x22')](function(_0xfd747f){return _0xfd747f;});}return null;};}function removeEntity(_0x5e4e66,_0x5d7a5f){return function(_0x5f1fdf){if(_0x5f1fdf){return _0x5f1fdf[_0xb9d7('0x23')]()[_0xb9d7('0x22')](function(){var _0x178087=_0x5f1fdf[_0xb9d7('0x24')]({'plain':!![]});var _0x983ae7=_0xb9d7('0x25');return db[_0xb9d7('0x26')][_0xb9d7('0x23')]({'where':{'type':_0x983ae7,'resourceId':_0x178087['id']}})[_0xb9d7('0x22')](function(){return _0x5f1fdf;});})[_0xb9d7('0x22')](function(){_0x5e4e66[_0xb9d7('0x18')](0xcc)[_0xb9d7('0x19')]();});}};}function handleEntityNotFound(_0x19faea,_0x4b80ab){return function(_0x2ee9e6){if(!_0x2ee9e6){_0x19faea[_0xb9d7('0x27')](0x194);}return _0x2ee9e6;};}function handleError(_0x41b1c0,_0x15b540){_0x15b540=_0x15b540||0x1f4;return function(_0x4e030e){logger[_0xb9d7('0x28')](_0x4e030e[_0xb9d7('0x29')]);if(_0x4e030e[_0xb9d7('0x2a')]){delete _0x4e030e[_0xb9d7('0x2a')];}_0x41b1c0[_0xb9d7('0x18')](_0x15b540)[_0xb9d7('0x2b')](_0x4e030e);};}exports[_0xb9d7('0x2c')]=function(_0x17a259,_0x3944d5){var _0x4a94f3={},_0x1e039b={},_0x4cd2c6={'count':0x0,'rows':[]};var _0x19fb12=_[_0xb9d7('0x2d')](db['AnalyticCustomReport']['rawAttributes'],function(_0x3e369f){return{'name':_0x3e369f['fieldName'],'type':_0x3e369f[_0xb9d7('0x2e')][_0xb9d7('0x2f')]};});_0x1e039b['model']=_[_0xb9d7('0x2d')](_0x19fb12,'name');_0x1e039b[_0xb9d7('0x30')]=_['keys'](_0x17a259[_0xb9d7('0x30')]);_0x1e039b[_0xb9d7('0x31')]=_[_0xb9d7('0x32')](_0x1e039b[_0xb9d7('0x33')],_0x1e039b[_0xb9d7('0x30')]);_0x4a94f3[_0xb9d7('0x34')]=_[_0xb9d7('0x32')](_0x1e039b['model'],qs['fields'](_0x17a259[_0xb9d7('0x30')][_0xb9d7('0x35')]));_0x4a94f3[_0xb9d7('0x34')]=_0x4a94f3[_0xb9d7('0x34')][_0xb9d7('0x36')]?_0x4a94f3[_0xb9d7('0x34')]:_0x1e039b[_0xb9d7('0x33')];if(!_0x17a259[_0xb9d7('0x30')][_0xb9d7('0x37')](_0xb9d7('0x38'))){_0x4a94f3[_0xb9d7('0x1b')]=qs[_0xb9d7('0x1b')](_0x17a259[_0xb9d7('0x30')]['limit']);_0x4a94f3[_0xb9d7('0x1a')]=qs['offset'](_0x17a259[_0xb9d7('0x30')][_0xb9d7('0x1a')]);}_0x4a94f3[_0xb9d7('0x39')]=qs['sort'](_0x17a259[_0xb9d7('0x30')][_0xb9d7('0x3a')]);_0x4a94f3['where']=qs[_0xb9d7('0x31')](_[_0xb9d7('0x3b')](_0x17a259[_0xb9d7('0x30')],_0x1e039b['filters']),_0x19fb12);if(_0x17a259[_0xb9d7('0x30')]['filter']){_0x4a94f3['where']=_['merge'](_0x4a94f3[_0xb9d7('0x3c')],{'$or':_[_0xb9d7('0x2d')](_0x19fb12,function(_0x294463){if(_0x294463[_0xb9d7('0x2e')]!==_0xb9d7('0x3d')){var _0x4893f8={};_0x4893f8[_0x294463[_0xb9d7('0x2a')]]={'$like':'%'+_0x17a259[_0xb9d7('0x30')][_0xb9d7('0x3e')]+'%'};return _0x4893f8;}})});}_0x4a94f3=_['merge']({},_0x4a94f3,_0x17a259[_0xb9d7('0x3f')]);var _0xd0f581={'where':_0x4a94f3[_0xb9d7('0x3c')]};return db[_0xb9d7('0x40')][_0xb9d7('0x1d')](_0xd0f581)[_0xb9d7('0x22')](function(_0x412772){_0x4cd2c6[_0xb9d7('0x1d')]=_0x412772;if(_0x17a259[_0xb9d7('0x30')][_0xb9d7('0x41')]){_0x4a94f3[_0xb9d7('0x42')]=[{'all':!![]}];}return db[_0xb9d7('0x40')][_0xb9d7('0x43')](_0x4a94f3);})['then'](function(_0x20ceeb){_0x4cd2c6['rows']=_0x20ceeb;return _0x4cd2c6;})['then'](respondWithFilteredResult(_0x3944d5,_0x4a94f3))[_0xb9d7('0x44')](handleError(_0x3944d5,null));};exports[_0xb9d7('0x45')]=function(_0x5d0f5d,_0x1f6b4a){var _0x6c9e4a={'raw':![],'where':{'id':_0x5d0f5d[_0xb9d7('0x46')]['id']}},_0x5e1830={};_0x5e1830[_0xb9d7('0x33')]=_[_0xb9d7('0x47')](db[_0xb9d7('0x40')][_0xb9d7('0x48')]);_0x5e1830[_0xb9d7('0x30')]=_[_0xb9d7('0x47')](_0x5d0f5d['query']);_0x5e1830['filters']=_[_0xb9d7('0x32')](_0x5e1830[_0xb9d7('0x33')],_0x5e1830[_0xb9d7('0x30')]);_0x6c9e4a['attributes']=_[_0xb9d7('0x32')](_0x5e1830[_0xb9d7('0x33')],qs[_0xb9d7('0x35')](_0x5d0f5d[_0xb9d7('0x30')][_0xb9d7('0x35')]));_0x6c9e4a[_0xb9d7('0x34')]=_0x6c9e4a[_0xb9d7('0x34')][_0xb9d7('0x36')]?_0x6c9e4a[_0xb9d7('0x34')]:_0x5e1830[_0xb9d7('0x33')];if(_0x5d0f5d[_0xb9d7('0x30')][_0xb9d7('0x41')]){_0x6c9e4a[_0xb9d7('0x42')]=[{'all':!![]}];}_0x6c9e4a=_['merge']({},_0x6c9e4a,_0x5d0f5d[_0xb9d7('0x3f')]);return db[_0xb9d7('0x40')]['find'](_0x6c9e4a)[_0xb9d7('0x22')](handleEntityNotFound(_0x1f6b4a,null))['then'](respondWithResult(_0x1f6b4a,null))['catch'](handleError(_0x1f6b4a,null));};exports[_0xb9d7('0x49')]=function(_0x163f6b,_0x5e31b7){return db['AnalyticCustomReport'][_0xb9d7('0x49')](_0x163f6b[_0xb9d7('0x4a')],{})[_0xb9d7('0x22')](function(_0x40b626){var _0x4e06c2=_0x163f6b[_0xb9d7('0x4b')]['get']({'plain':!![]});if(!_0x4e06c2)throw new Error(_0xb9d7('0x4c'));if(_0x4e06c2[_0xb9d7('0x4d')]===_0xb9d7('0x4b')){var _0x6d9f7=_0x40b626[_0xb9d7('0x24')]({'plain':!![]});var _0x595c45=_0xb9d7('0x4e');return db[_0xb9d7('0x4f')][_0xb9d7('0x50')]({'where':{'name':_0x595c45,'userProfileId':_0x4e06c2[_0xb9d7('0x51')]},'raw':!![]})[_0xb9d7('0x22')](function(_0x2fb391){if(_0x2fb391&&_0x2fb391[_0xb9d7('0x52')]===0x0){return db[_0xb9d7('0x26')][_0xb9d7('0x49')]({'name':_0x6d9f7[_0xb9d7('0x2a')],'resourceId':_0x6d9f7['id'],'type':'CustomReports','sectionId':_0x2fb391['id']},{})[_0xb9d7('0x22')](function(){return _0x40b626;});}else{return _0x40b626;}})[_0xb9d7('0x44')](function(_0x1cf33f){logger[_0xb9d7('0x28')](_0xb9d7('0x53'),_0x1cf33f);throw _0x1cf33f;});}return _0x40b626;})['then'](respondWithResult(_0x5e31b7,0xc9))[_0xb9d7('0x44')](handleError(_0x5e31b7,null));};exports[_0xb9d7('0x54')]=function(_0xdad3bd,_0x372315){if(_0xdad3bd[_0xb9d7('0x4a')]['id']){delete _0xdad3bd[_0xb9d7('0x4a')]['id'];}return db[_0xb9d7('0x40')][_0xb9d7('0x50')]({'where':{'id':_0xdad3bd[_0xb9d7('0x46')]['id']}})[_0xb9d7('0x22')](handleEntityNotFound(_0x372315,null))[_0xb9d7('0x22')](saveUpdates(_0xdad3bd[_0xb9d7('0x4a')],null))[_0xb9d7('0x22')](respondWithResult(_0x372315,null))[_0xb9d7('0x44')](handleError(_0x372315,null));};exports['destroy']=function(_0x185a9c,_0x3fa5fa){return db[_0xb9d7('0x40')]['find']({'where':{'id':_0x185a9c['params']['id']}})[_0xb9d7('0x22')](handleEntityNotFound(_0x3fa5fa,null))['then'](removeEntity(_0x3fa5fa,null))[_0xb9d7('0x44')](handleError(_0x3fa5fa,null));};exports[_0xb9d7('0x55')]=function(_0x3cccb7,_0x4390a1){var _0x12be2a=0xa;var _0x3b6396=[_0xb9d7('0x56'),_0xb9d7('0x57'),_0xb9d7('0x58'),_0xb9d7('0x59')];var _0x4370c8={'SUM':'SUM(%s)','COUNT':_0xb9d7('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xb9d7('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb9d7('0x5c'),'GROUP_CONCAT ASC':_0xb9d7('0x5d'),'GROUP_CONCAT DESC':_0xb9d7('0x5e')};var _0x5a24c3={'SEC_TO_TIME':_0xb9d7('0x5f'),'DATE':_0xb9d7('0x60'),'HOUR':_0xb9d7('0x61'),'ROUND':_0xb9d7('0x62'),'UNIX_TIMESTAMP':_0xb9d7('0x63')};var _0x3ca0bd=function(_0x5e54cc){return!_[_0xb9d7('0x64')](['IS\x20NULL',_0xb9d7('0x65'),_0xb9d7('0x66'),_0xb9d7('0x67')],_0x5e54cc);};var _0x3055ec=function(_0x13c61b){if(!_0x13c61b||!_0x13c61b[_0xb9d7('0x68')][_0xb9d7('0x36')]){return'';}for(var _0x183b5a='(',_0x1137be=0x0;_0x1137be<_0x13c61b['rules'][_0xb9d7('0x36')];_0x1137be+=0x1){_0x1137be>0x0&&(_0x183b5a+='\x20'+_0x13c61b[_0xb9d7('0x69')]+'\x20');_0x183b5a+=_0x13c61b[_0xb9d7('0x68')][_0x1137be][_0xb9d7('0x6a')]?_0x3055ec(_0x13c61b[_0xb9d7('0x68')][_0x1137be][_0xb9d7('0x6a')]):_0x13c61b[_0xb9d7('0x68')][_0x1137be][_0xb9d7('0x6b')]+'\x20'+_0x13c61b['rules'][_0x1137be][_0xb9d7('0x6c')]+(_0x3ca0bd(_0x13c61b[_0xb9d7('0x68')][_0x1137be][_0xb9d7('0x6c')])?'\x20'+_0x13c61b['rules'][_0x1137be][_0xb9d7('0x6d')]:'');}return _0x183b5a+')';};var _0x272d16={'where':{'id':_0x3cccb7[_0xb9d7('0x46')]['id']}},_0xd6fedf,_0x12155d,_0xa22ddf,_0x24f0bd,_0x13acd2;_0x272d16=_[_0xb9d7('0x6e')]({},_0x272d16,_0x3cccb7['options']);return db[_0xb9d7('0x40')][_0xb9d7('0x50')](_0x272d16)[_0xb9d7('0x22')](function(_0x4283fb){if(_0x4283fb){_0xd6fedf=_0x4283fb;return _0x4283fb[_0xb9d7('0x6f')]();}return null;})[_0xb9d7('0x22')](function(_0x314788){if(_0x314788){if(!_0x314788[_0xb9d7('0x36')]){throw new db[(_0xb9d7('0x70'))][(_0xb9d7('0x71'))](_0xb9d7('0x72'),0x193);}_0x12155d=_0x314788;return db['AnalyticMetric'][_0xb9d7('0x43')]({'raw':!![]});}return null;})[_0xb9d7('0x22')](function(_0x19ddc0){if(_0x19ddc0){_0xa22ddf=_['keyBy'](_0x19ddc0,'id');var _0x206cda;var _0x557b95=squel['select']();_0x557b95[_0xb9d7('0x73')](_0xd6fedf['table']);for(var _0x1bf43b=0x0;_0x1bf43b<_0x12155d[_0xb9d7('0x36')];_0x1bf43b+=0x1){_0x206cda=_0x12155d[_0x1bf43b]['MetricId']?_0xa22ddf[_0x12155d[_0x1bf43b]['MetricId']][_0xb9d7('0x74')]:_0x12155d[_0x1bf43b]['field'];_0x206cda=_0x12155d[_0x1bf43b][_0xb9d7('0x75')]?_[_0xb9d7('0x76')](_0x4370c8[_0x12155d[_0x1bf43b]['function']],'%s',_0x206cda):_0x206cda;_0x206cda=_0x12155d[_0x1bf43b][_0xb9d7('0x77')]?_[_0xb9d7('0x76')](_0x5a24c3[_0x12155d[_0x1bf43b][_0xb9d7('0x77')]],'%s',_0x206cda):_0x206cda;if(_0x12155d[_0x1bf43b][_0xb9d7('0x78')]){_0x557b95[_0xb9d7('0x6a')](_0x206cda);}_0x12155d[_0x1bf43b][_0xb9d7('0x79')]&&_0x557b95[_0xb9d7('0x39')](_0x206cda,_0x12155d[_0x1bf43b][_0xb9d7('0x79')]===_0xb9d7('0x7a')?![]:!![]);_0x557b95[_0xb9d7('0x6b')](_0x206cda,_0x12155d[_0x1bf43b]['alias']||_0x206cda);}if(_0xd6fedf[_0xb9d7('0x7b')]){_0xd6fedf['joins']=JSON[_0xb9d7('0x7c')](_0xd6fedf['joins']);for(var _0x302e71=0x0;_0x302e71<_0xd6fedf['joins'][_0xb9d7('0x36')];_0x302e71+=0x1){if(_0xd6fedf[_0xb9d7('0x7b')][_0x302e71][_0xb9d7('0x2e')]&&_[_0xb9d7('0x64')](_0x3b6396,_0xd6fedf[_0xb9d7('0x7b')][_0x302e71][_0xb9d7('0x2e')])&&_0xd6fedf[_0xb9d7('0x7b')][_0x302e71][_0xb9d7('0x7d')]&&_0xd6fedf['joins'][_0x302e71][_0xb9d7('0x7e')]&&_0xd6fedf['joins'][_0x302e71][_0xb9d7('0x7f')]){_0x557b95[_0xd6fedf[_0xb9d7('0x7b')][_0x302e71][_0xb9d7('0x2e')]](_0xd6fedf[_0xb9d7('0x7b')][_0x302e71]['foreignTable'],null,util[_0xb9d7('0x77')]('%s.%s\x20=\x20%s.%s',_0xd6fedf[_0xb9d7('0x80')],_0xd6fedf[_0xb9d7('0x7b')][_0x302e71][_0xb9d7('0x7d')],_0xd6fedf['joins'][_0x302e71][_0xb9d7('0x7e')],_0xd6fedf[_0xb9d7('0x7b')][_0x302e71]['foreignKey']));}}}if(_0xd6fedf[_0xb9d7('0x81')]){_0xd6fedf[_0xb9d7('0x81')]=JSON[_0xb9d7('0x7c')](_0xd6fedf['conditions']);_0x557b95[_0xb9d7('0x3c')](_0x3055ec(_0xd6fedf['conditions'][_0xb9d7('0x6a')]));}_0x13acd2=_0x557b95[_0xb9d7('0x82')]();_0x557b95['limit'](_0x12be2a);_0x557b95[_0xb9d7('0x1a')](0x0);logger['debug'](_0xb9d7('0x83'),_0x557b95['toString']());return dbH[_0xb9d7('0x84')][_0xb9d7('0x30')](_0x557b95[_0xb9d7('0x85')](),{'type':dbH[_0xb9d7('0x84')][_0xb9d7('0x86')]['SELECT']});}})[_0xb9d7('0x22')](respondWithResult(_0x4390a1,null))[_0xb9d7('0x44')](handleError(_0x4390a1,null));};function runReport(_0x4e65dc,_0x4a3333,_0x39c1e8){var _0x20c0ea=_0x4a3333[_0xb9d7('0x2a')];var _0x45841c=0xa;var _0x164c12=['join',_0xb9d7('0x57'),_0xb9d7('0x58'),_0xb9d7('0x59')];var _0x3798ec={'SUM':'SUM(%s)','COUNT':_0xb9d7('0x5a'),'COUNT DISTINCT':_0xb9d7('0x87'),'MAX':_0xb9d7('0x88'),'MIN':_0xb9d7('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb9d7('0x5d'),'GROUP_CONCAT DESC':_0xb9d7('0x5e')};var _0xc594aa={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb9d7('0x60'),'HOUR':_0xb9d7('0x61'),'ROUND':_0xb9d7('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2d66cc=function(_0x2df12c){return!_['includes'](['IS\x20NULL',_0xb9d7('0x65'),_0xb9d7('0x66'),_0xb9d7('0x67')],_0x2df12c);};var _0x560ee9=function(_0x5abfb3){if(!_0x5abfb3||!_0x5abfb3[_0xb9d7('0x68')]['length']){return'';}for(var _0x43c359='(',_0x1e4659=0x0;_0x1e4659<_0x5abfb3['rules'][_0xb9d7('0x36')];_0x1e4659+=0x1){_0x1e4659>0x0&&(_0x43c359+='\x20'+_0x5abfb3[_0xb9d7('0x69')]+'\x20');_0x43c359+=_0x5abfb3[_0xb9d7('0x68')][_0x1e4659][_0xb9d7('0x6a')]?_0x560ee9(_0x5abfb3[_0xb9d7('0x68')][_0x1e4659][_0xb9d7('0x6a')]):_0x5abfb3[_0xb9d7('0x68')][_0x1e4659][_0xb9d7('0x6b')]+'\x20'+_0x5abfb3['rules'][_0x1e4659][_0xb9d7('0x6c')]+(_0x2d66cc(_0x5abfb3[_0xb9d7('0x68')][_0x1e4659][_0xb9d7('0x6c')])?'\x20'+_0x5abfb3[_0xb9d7('0x68')][_0x1e4659][_0xb9d7('0x6d')]:'');}return _0x43c359+')';};var _0x49c036={'where':{'id':_0x4e65dc['id']}},_0xddcc93,_0x1194ed,_0x101a6d,_0x3013f5,_0x3ec83a;_0x49c036=_[_0xb9d7('0x6e')]({},_0x49c036,_0x39c1e8);return db[_0xb9d7('0x40')]['find'](_0x49c036)[_0xb9d7('0x22')](function(_0x4719dc){if(_0x4719dc){_0xddcc93=_0x4719dc;return _0x4719dc['getFields']();}return null;})[_0xb9d7('0x22')](function(_0x49df1e){if(_0x49df1e){if(!_0x49df1e['length']){throw new db[(_0xb9d7('0x70'))][(_0xb9d7('0x71'))](_0xb9d7('0x72'),0x193);}_0x1194ed=_0x49df1e;return db[_0xb9d7('0x89')][_0xb9d7('0x43')]({'raw':!![]});}return null;})[_0xb9d7('0x22')](function(_0x297a18){if(_0x297a18){_0x101a6d=_['keyBy'](_0x297a18,'id');var _0x4256da;var _0x491313=squel[_0xb9d7('0x8a')]();_0x491313['from'](_0xddcc93[_0xb9d7('0x80')]);for(var _0x576d61=0x0;_0x576d61<_0x1194ed[_0xb9d7('0x36')];_0x576d61+=0x1){_0x4256da=_0x1194ed[_0x576d61]['MetricId']?_0x101a6d[_0x1194ed[_0x576d61][_0xb9d7('0x8b')]][_0xb9d7('0x74')]:_0x1194ed[_0x576d61][_0xb9d7('0x6b')];_0x4256da=_0x1194ed[_0x576d61][_0xb9d7('0x75')]?_['replace'](_0x3798ec[_0x1194ed[_0x576d61][_0xb9d7('0x75')]],'%s',_0x4256da):_0x4256da;_0x4256da=_0x1194ed[_0x576d61]['format']?_[_0xb9d7('0x76')](_0xc594aa[_0x1194ed[_0x576d61][_0xb9d7('0x77')]],'%s',_0x4256da):_0x4256da;if(_0x1194ed[_0x576d61]['groupBy']){_0x491313[_0xb9d7('0x6a')](_0x4256da);}_0x1194ed[_0x576d61][_0xb9d7('0x79')]&&_0x491313[_0xb9d7('0x39')](_0x4256da,_0x1194ed[_0x576d61][_0xb9d7('0x79')]===_0xb9d7('0x7a')?![]:!![]);_0x491313[_0xb9d7('0x6b')](_0x4256da,_0x1194ed[_0x576d61][_0xb9d7('0x8c')]||_0x4256da);}if(_0xddcc93['joins']){_0xddcc93[_0xb9d7('0x7b')]=JSON[_0xb9d7('0x7c')](_0xddcc93[_0xb9d7('0x7b')]);for(var _0x2d52bc=0x0;_0x2d52bc<_0xddcc93[_0xb9d7('0x7b')][_0xb9d7('0x36')];_0x2d52bc+=0x1){if(_0xddcc93[_0xb9d7('0x7b')][_0x2d52bc][_0xb9d7('0x2e')]&&_[_0xb9d7('0x64')](_0x164c12,_0xddcc93['joins'][_0x2d52bc]['type'])&&_0xddcc93[_0xb9d7('0x7b')][_0x2d52bc]['parentKey']&&_0xddcc93[_0xb9d7('0x7b')][_0x2d52bc][_0xb9d7('0x7e')]&&_0xddcc93[_0xb9d7('0x7b')][_0x2d52bc][_0xb9d7('0x7f')]){_0x491313[_0xddcc93[_0xb9d7('0x7b')][_0x2d52bc][_0xb9d7('0x2e')]](_0xddcc93[_0xb9d7('0x7b')][_0x2d52bc][_0xb9d7('0x7e')],null,util[_0xb9d7('0x77')]('%s.%s\x20=\x20%s.%s',_0xddcc93[_0xb9d7('0x80')],_0xddcc93['joins'][_0x2d52bc][_0xb9d7('0x7d')],_0xddcc93[_0xb9d7('0x7b')][_0x2d52bc][_0xb9d7('0x7e')],_0xddcc93[_0xb9d7('0x7b')][_0x2d52bc]['foreignKey']));}}}if(_0xddcc93[_0xb9d7('0x81')]){_0xddcc93[_0xb9d7('0x81')]=JSON[_0xb9d7('0x7c')](_0xddcc93[_0xb9d7('0x81')]);_0x491313['where'](_0x560ee9(_0xddcc93[_0xb9d7('0x81')][_0xb9d7('0x6a')]));}_0x3ec83a=_0x491313[_0xb9d7('0x82')]();_0x491313[_0xb9d7('0x1b')](_0x45841c);_0x491313[_0xb9d7('0x1a')](0x0);return;}})[_0xb9d7('0x22')](function(){if(_0x4a3333[_0xb9d7('0x8d')]===_0xb9d7('0x8e')){return null;}var _0x25939c=_[_0xb9d7('0x6e')](_0x4a3333,{'name':_0x4a3333[_0xb9d7('0x8f')]||_0x4a3333[_0xb9d7('0x2a')]||_0xddcc93['name'],'basename':_0x20c0ea,'savename':util[_0xb9d7('0x77')](_0xb9d7('0x90'),_0x4a3333[_0xb9d7('0x2a')]||_0xddcc93[_0xb9d7('0x2a')],require(_0xb9d7('0x91'))[_0xb9d7('0x92')](0x4),_0x4a3333[_0xb9d7('0x8d')]||_0xb9d7('0x93')),'reportId':_0xddcc93['id'],'reportType':_0xb9d7('0x94')});return db[_0xb9d7('0x95')][_0xb9d7('0x49')](_0x25939c,{'raw':!![]});})['then'](function(_0x48a975){if(_0xddcc93[_0xb9d7('0x80')]===_0xb9d7('0x96')){_0x3ec83a[_0xb9d7('0x3c')](_0xddcc93['table']+_0xb9d7('0x97'),_0x4a3333[_0xb9d7('0x98')],_0x4a3333[_0xb9d7('0x99')]);}else{_0x3ec83a[_0xb9d7('0x3c')](_0xddcc93[_0xb9d7('0x80')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4a3333[_0xb9d7('0x98')],_0x4a3333[_0xb9d7('0x99')]);}if(_0x48a975){logger[_0xb9d7('0x9a')]('Run\x20Query:',_0x3ec83a[_0xb9d7('0x85')]());require(_0xb9d7('0x9b'))['fork'](path[_0xb9d7('0x56')](__dirname,_0xb9d7('0x9c'),_0x48a975[_0xb9d7('0x8d')]),[_0x48a975['id'],_0x3ec83a[_0xb9d7('0x85')](),path[_0xb9d7('0x56')](__dirname,_0xb9d7('0x9d'),_0x48a975[_0xb9d7('0x9e')]),_0x20c0ea]);return _0x48a975;}else{var _0x39317a=squel[_0xb9d7('0x8a')]();_0x39317a['from']('('+_0x3ec83a[_0xb9d7('0x85')]()+')','countTable');_0x39317a[_0xb9d7('0x6b')](_0xb9d7('0x9f'),_0xb9d7('0x1d'));_0x3ec83a['limit'](_0x4a3333[_0xb9d7('0x1b')]||_0x45841c);_0x3ec83a[_0xb9d7('0x1a')](_0x4a3333[_0xb9d7('0x1a')]||0x0);return dbH[_0xb9d7('0x84')][_0xb9d7('0x30')](_0x39317a['toString'](),{'type':dbH[_0xb9d7('0x84')][_0xb9d7('0x86')][_0xb9d7('0xa0')]})[_0xb9d7('0x22')](function(_0x12ca40){if(!_0x12ca40[_0xb9d7('0x36')]){_0x3013f5=0x0;}else{_0x3013f5=_0x12ca40[0x0][_0xb9d7('0x1d')]||0x0;}return dbH[_0xb9d7('0x84')]['query'](_0x3ec83a[_0xb9d7('0x85')](),{'type':dbH[_0xb9d7('0x84')][_0xb9d7('0x86')][_0xb9d7('0xa0')]});})['then'](function(_0xb11b15){return{'rows':_0xb11b15||[],'count':_0x3013f5};});}});}exports[_0xb9d7('0xa1')]=function(_0x31962b,_0x3ac274){return runReport(_0x31962b['params'],_0x31962b[_0xb9d7('0x30')],_0x31962b[_0xb9d7('0x3f')])[_0xb9d7('0x22')](respondWithResult(_0x3ac274,null))['catch'](handleError(_0x3ac274,null));};exports['runReport']=runReport;exports[_0xb9d7('0x30')]=function(_0x384b8f,_0xab44ac){var _0x1e56aa=0xa;var _0x292c87=[_0xb9d7('0x56'),_0xb9d7('0x57'),_0xb9d7('0x58'),'cross_join'];var _0x2dca97={'SUM':_0xb9d7('0xa2'),'COUNT':_0xb9d7('0x5a'),'COUNT DISTINCT':_0xb9d7('0x87'),'MAX':_0xb9d7('0x88'),'MIN':_0xb9d7('0x5b'),'AVG':_0xb9d7('0xa3'),'GROUP_CONCAT':_0xb9d7('0x5c'),'GROUP_CONCAT ASC':_0xb9d7('0x5d'),'GROUP_CONCAT DESC':_0xb9d7('0x5e')};var _0x184621={'SEC_TO_TIME':_0xb9d7('0x5f'),'DATE':_0xb9d7('0x60'),'HOUR':_0xb9d7('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb9d7('0x63')};var _0x71afaa=function(_0x4ba1b6){return!_[_0xb9d7('0x64')](['IS\x20NULL',_0xb9d7('0x65'),_0xb9d7('0x66'),_0xb9d7('0x67')],_0x4ba1b6);};var _0x2c1c1b=function(_0x5ecb7f){if(!_0x5ecb7f||!_0x5ecb7f[_0xb9d7('0x68')][_0xb9d7('0x36')]){return'';}for(var _0x4c829d='(',_0x4873a5=0x0;_0x4873a5<_0x5ecb7f[_0xb9d7('0x68')][_0xb9d7('0x36')];_0x4873a5+=0x1){_0x4873a5>0x0&&(_0x4c829d+='\x20'+_0x5ecb7f[_0xb9d7('0x69')]+'\x20');_0x4c829d+=_0x5ecb7f['rules'][_0x4873a5][_0xb9d7('0x6a')]?_0x2c1c1b(_0x5ecb7f['rules'][_0x4873a5][_0xb9d7('0x6a')]):_0x5ecb7f['rules'][_0x4873a5][_0xb9d7('0x6b')]+'\x20'+_0x5ecb7f['rules'][_0x4873a5][_0xb9d7('0x6c')]+(_0x71afaa(_0x5ecb7f[_0xb9d7('0x68')][_0x4873a5][_0xb9d7('0x6c')])?'\x20'+_0x5ecb7f[_0xb9d7('0x68')][_0x4873a5][_0xb9d7('0x6d')]:'');}return _0x4c829d+')';};var _0xcf1c76={'where':{'id':_0x384b8f[_0xb9d7('0x46')]['id']}},_0x11d091,_0x27989c,_0x443a31,_0x40e26b,_0x218bd5;_0xcf1c76=_['merge']({},_0xcf1c76,_0x384b8f[_0xb9d7('0x3f')]);return db['AnalyticCustomReport']['find'](_0xcf1c76)[_0xb9d7('0x22')](function(_0x9b2aae){if(_0x9b2aae){_0x11d091=_0x9b2aae;return _0x9b2aae[_0xb9d7('0x6f')]();}return null;})[_0xb9d7('0x22')](function(_0x5efa02){if(_0x5efa02){if(!_0x5efa02['length']){throw new db[(_0xb9d7('0x70'))][(_0xb9d7('0x71'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x27989c=_0x5efa02;return db[_0xb9d7('0x89')][_0xb9d7('0x43')]({'raw':!![]});}return null;})['then'](function(_0x598b59){if(_0x598b59){_0x443a31=_['keyBy'](_0x598b59,'id');var _0x19cc3e;var _0x519d40=squel[_0xb9d7('0x8a')]();_0x519d40[_0xb9d7('0x73')](_0x11d091[_0xb9d7('0x80')]);for(var _0x5f00c3=0x0;_0x5f00c3<_0x27989c[_0xb9d7('0x36')];_0x5f00c3+=0x1){_0x19cc3e=_0x27989c[_0x5f00c3][_0xb9d7('0x8b')]?_0x443a31[_0x27989c[_0x5f00c3][_0xb9d7('0x8b')]][_0xb9d7('0x74')]:_0x27989c[_0x5f00c3][_0xb9d7('0x6b')];_0x19cc3e=_0x27989c[_0x5f00c3][_0xb9d7('0x75')]?_[_0xb9d7('0x76')](_0x2dca97[_0x27989c[_0x5f00c3][_0xb9d7('0x75')]],'%s',_0x19cc3e):_0x19cc3e;_0x19cc3e=_0x27989c[_0x5f00c3][_0xb9d7('0x77')]?_['replace'](_0x184621[_0x27989c[_0x5f00c3][_0xb9d7('0x77')]],'%s',_0x19cc3e):_0x19cc3e;if(_0x27989c[_0x5f00c3][_0xb9d7('0x78')]){_0x519d40[_0xb9d7('0x6a')](_0x19cc3e);}_0x27989c[_0x5f00c3][_0xb9d7('0x79')]&&_0x519d40['order'](_0x19cc3e,_0x27989c[_0x5f00c3][_0xb9d7('0x79')]==='DESC'?![]:!![]);_0x519d40[_0xb9d7('0x6b')](_0x19cc3e,_0x27989c[_0x5f00c3][_0xb9d7('0x8c')]||_0x19cc3e);}if(_0x11d091['joins']){_0x11d091[_0xb9d7('0x7b')]=JSON[_0xb9d7('0x7c')](_0x11d091[_0xb9d7('0x7b')]);for(var _0x2cfc67=0x0;_0x2cfc67<_0x11d091[_0xb9d7('0x7b')]['length'];_0x2cfc67+=0x1){if(_0x11d091[_0xb9d7('0x7b')][_0x2cfc67]['type']&&_['includes'](_0x292c87,_0x11d091[_0xb9d7('0x7b')][_0x2cfc67][_0xb9d7('0x2e')])&&_0x11d091[_0xb9d7('0x7b')][_0x2cfc67][_0xb9d7('0x7d')]&&_0x11d091['joins'][_0x2cfc67][_0xb9d7('0x7e')]&&_0x11d091[_0xb9d7('0x7b')][_0x2cfc67][_0xb9d7('0x7f')]){_0x519d40[_0x11d091[_0xb9d7('0x7b')][_0x2cfc67][_0xb9d7('0x2e')]](_0x11d091[_0xb9d7('0x7b')][_0x2cfc67]['foreignTable'],null,util[_0xb9d7('0x77')](_0xb9d7('0xa4'),_0x11d091[_0xb9d7('0x80')],_0x11d091['joins'][_0x2cfc67][_0xb9d7('0x7d')],_0x11d091['joins'][_0x2cfc67][_0xb9d7('0x7e')],_0x11d091[_0xb9d7('0x7b')][_0x2cfc67][_0xb9d7('0x7f')]));}}}if(_0x11d091[_0xb9d7('0x81')]){_0x11d091[_0xb9d7('0x81')]=JSON[_0xb9d7('0x7c')](_0x11d091[_0xb9d7('0x81')]);_0x519d40[_0xb9d7('0x3c')](_0x2c1c1b(_0x11d091[_0xb9d7('0x81')][_0xb9d7('0x6a')]));}_0x218bd5=_0x519d40[_0xb9d7('0x82')]();_0x519d40['limit'](_0x1e56aa);_0x519d40[_0xb9d7('0x1a')](0x0);logger[_0xb9d7('0xa5')](_0xb9d7('0x83'),_0x519d40[_0xb9d7('0x85')]());return dbH[_0xb9d7('0x84')][_0xb9d7('0x30')](_0x519d40[_0xb9d7('0x85')](),{'type':dbH['sequelize'][_0xb9d7('0x86')][_0xb9d7('0xa0')]});}})[_0xb9d7('0x22')](function(){return{'sql':_0x218bd5[_0xb9d7('0x85')]()};})[_0xb9d7('0x22')](respondWithResult(_0xab44ac,null))[_0xb9d7('0x44')](handleError(_0xab44ac,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 46a94fd..6473817 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 _0x0821=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger'];(function(_0x170a52,_0x2e27d6){var _0x2c03ed=function(_0x32e213){while(--_0x32e213){_0x170a52['push'](_0x170a52['shift']());}};_0x2c03ed(++_0x2e27d6);}(_0x0821,0xa5));var _0x1082=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0x0821[_0x481bf7];return _0x461787;};'use strict';var _=require(_0x1082('0x0'));var util=require(_0x1082('0x1'));var logger=require(_0x1082('0x2'))('api');var moment=require(_0x1082('0x3'));var BPromise=require(_0x1082('0x4'));var rp=require(_0x1082('0x5'));var fs=require('fs');var path=require(_0x1082('0x6'));var rimraf=require(_0x1082('0x7'));var config=require(_0x1082('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0x1082('0x9')]=function(_0x1c0d4b,_0xf0839a){return _0x1c0d4b['define'](_0x1082('0xa'),attributes,{'tableName':_0x1082('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1a0b=['bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','../../config/logger','api','moment'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x1a0b,0xd4));var _0xb1a0=function(_0xade054,_0x3cddfa){_0xade054=_0xade054-0x0;var _0x37a229=_0x1a0b[_0xade054];return _0x37a229;};'use strict';var _=require(_0xb1a0('0x0'));var util=require('util');var logger=require(_0xb1a0('0x1'))(_0xb1a0('0x2'));var moment=require(_0xb1a0('0x3'));var BPromise=require(_0xb1a0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb1a0('0x5'));var rimraf=require(_0xb1a0('0x6'));var config=require(_0xb1a0('0x7'));var attributes=require(_0xb1a0('0x8'));module[_0xb1a0('0x9')]=function(_0x184343,_0x57cbc3){return _0x184343[_0xb1a0('0xa')](_0xb1a0('0xb'),attributes,{'tableName':'analytics_custom_reports','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 87b9312..e75ef2c 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 _0xdc2a=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x940ce4,_0x1b0503){var _0x4b9212=function(_0x561348){while(--_0x561348){_0x940ce4['push'](_0x940ce4['shift']());}};_0x4b9212(++_0x1b0503);}(_0xdc2a,0x9d));var _0xadc2=function(_0x4fd163,_0x154781){_0x4fd163=_0x4fd163-0x0;var _0x178f7b=_0xdc2a[_0x4fd163];return _0x178f7b;};'use strict';var _=require(_0xadc2('0x0'));var util=require('util');var moment=require(_0xadc2('0x1'));var BPromise=require(_0xadc2('0x2'));var rs=require(_0xadc2('0x3'));var fs=require('fs');var Redis=require(_0xadc2('0x4'));var db=require(_0xadc2('0x5'))['db'];var utils=require(_0xadc2('0x6'));var logger=require(_0xadc2('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xadc2('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39f9ac,_0x20d73f,_0x5d1030){return new BPromise(function(_0x42f7ce,_0x45a615){return client['request'](_0x39f9ac,_0x5d1030)['then'](function(_0x25f8f2){logger[_0xadc2('0x9')](_0xadc2('0xa'),_0x20d73f,_0xadc2('0xb'));logger['debug'](_0xadc2('0xc'),_0x20d73f,_0xadc2('0xb'),JSON['stringify'](_0x25f8f2));if(_0x25f8f2[_0xadc2('0xd')]){if(_0x25f8f2[_0xadc2('0xd')][_0xadc2('0xe')]===0x1f4){logger[_0xadc2('0xd')](_0xadc2('0xa'),_0x20d73f,_0x25f8f2['error']['message']);return _0x45a615(_0x25f8f2[_0xadc2('0xd')][_0xadc2('0xf')]);}logger[_0xadc2('0xd')](_0xadc2('0xa'),_0x20d73f,_0x25f8f2[_0xadc2('0xd')][_0xadc2('0xf')]);return _0x42f7ce(_0x25f8f2[_0xadc2('0xd')][_0xadc2('0xf')]);}else{logger[_0xadc2('0x9')](_0xadc2('0xa'),_0x20d73f,_0xadc2('0xb'));_0x42f7ce(_0x25f8f2[_0xadc2('0x10')][_0xadc2('0xf')]);}})[_0xadc2('0x11')](function(_0x450f94){logger[_0xadc2('0xd')](_0xadc2('0xa'),_0x20d73f,_0x450f94);_0x45a615(_0x450f94);});});}
\ No newline at end of file
+var _0xdeee=['../../config/logger','../../config/environment','jayson/promise','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdeee,0x179));var _0xedee=function(_0x2971bf,_0x47b60b){_0x2971bf=_0x2971bf-0x0;var _0x1191f0=_0xdeee[_0x2971bf];return _0x1191f0;};'use strict';var _=require(_0xedee('0x0'));var util=require(_0xedee('0x1'));var moment=require(_0xedee('0x2'));var BPromise=require(_0xedee('0x3'));var rs=require(_0xedee('0x4'));var fs=require('fs');var Redis=require(_0xedee('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xedee('0x6'));var logger=require(_0xedee('0x7'))('rpc');var config=require(_0xedee('0x8'));var jayson=require(_0xedee('0x9'));var client=jayson['client'][_0xedee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c5774,_0x99b75d,_0x326383){return new BPromise(function(_0x255302,_0x4df791){return client[_0xedee('0xb')](_0x5c5774,_0x326383)[_0xedee('0xc')](function(_0x557929){logger['info'](_0xedee('0xd'),_0x99b75d,_0xedee('0xe'));logger[_0xedee('0xf')](_0xedee('0x10'),_0x99b75d,'request\x20sent',JSON[_0xedee('0x11')](_0x557929));if(_0x557929['error']){if(_0x557929[_0xedee('0x12')][_0xedee('0x13')]===0x1f4){logger['error'](_0xedee('0xd'),_0x99b75d,_0x557929[_0xedee('0x12')]['message']);return _0x4df791(_0x557929[_0xedee('0x12')][_0xedee('0x14')]);}logger[_0xedee('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x99b75d,_0x557929[_0xedee('0x12')][_0xedee('0x14')]);return _0x255302(_0x557929[_0xedee('0x12')]['message']);}else{logger[_0xedee('0x15')]('AnalyticCustomReport,\x20%s,\x20%s',_0x99b75d,'request\x20sent');_0x255302(_0x557929[_0xedee('0x16')][_0xedee('0x14')]);}})[_0xedee('0x17')](function(_0x105131){logger[_0xedee('0x12')](_0xedee('0xd'),_0x99b75d,_0x105131);_0x4df791(_0x105131);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 78505c6..0135db1 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 _0x4af1=['create','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','index','get','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','/:id/query','query','post'];(function(_0x4a563b,_0x36f42d){var _0x2935ef=function(_0x32593f){while(--_0x32593f){_0x4a563b['push'](_0x4a563b['shift']());}};_0x2935ef(++_0x36f42d);}(_0x4af1,0x94));var _0x14af=function(_0x1c00e3,_0x3c24a0){_0x1c00e3=_0x1c00e3-0x0;var _0x27181b=_0x4af1[_0x1c00e3];return _0x27181b;};'use strict';var multer=require(_0x14af('0x0'));var util=require(_0x14af('0x1'));var path=require(_0x14af('0x2'));var timeout=require(_0x14af('0x3'));var express=require(_0x14af('0x4'));var router=express['Router']();var fs_extra=require(_0x14af('0x5'));var auth=require(_0x14af('0x6'));var interaction=require(_0x14af('0x7'));var config=require('../../config/environment');var controller=require(_0x14af('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x14af('0x9')]);router[_0x14af('0xa')](_0x14af('0xb'),auth[_0x14af('0xc')](),controller[_0x14af('0xd')]);router['get'](_0x14af('0xe'),auth[_0x14af('0xc')](),controller[_0x14af('0xf')]);router[_0x14af('0xa')](_0x14af('0x10'),auth[_0x14af('0xc')](),controller['run']);router[_0x14af('0xa')](_0x14af('0x11'),auth[_0x14af('0xc')](),controller[_0x14af('0x12')]);router[_0x14af('0x13')]('/',auth[_0x14af('0xc')](),controller[_0x14af('0x14')]);router['put'](_0x14af('0xb'),auth[_0x14af('0xc')](),controller['update']);router[_0x14af('0x15')](_0x14af('0xb'),auth[_0x14af('0xc')](),controller[_0x14af('0x16')]);module[_0x14af('0x17')]=router;
\ No newline at end of file
+var _0x9afb=['create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','get','/:id','preview','/:id/run','post'];(function(_0x2cde0a,_0x1f9695){var _0x260610=function(_0x179089){while(--_0x179089){_0x2cde0a['push'](_0x2cde0a['shift']());}};_0x260610(++_0x1f9695);}(_0x9afb,0x10e));var _0xb9af=function(_0x1d3a4d,_0x7a4edb){_0x1d3a4d=_0x1d3a4d-0x0;var _0x122e3d=_0x9afb[_0x1d3a4d];return _0x122e3d;};'use strict';var multer=require(_0xb9af('0x0'));var util=require(_0xb9af('0x1'));var path=require(_0xb9af('0x2'));var timeout=require(_0xb9af('0x3'));var express=require(_0xb9af('0x4'));var router=express[_0xb9af('0x5')]();var fs_extra=require(_0xb9af('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb9af('0x7'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0xb9af('0x8')](),controller[_0xb9af('0x9')]);router[_0xb9af('0xa')](_0xb9af('0xb'),auth[_0xb9af('0x8')](),controller['show']);router[_0xb9af('0xa')]('/:id/preview',auth[_0xb9af('0x8')](),controller[_0xb9af('0xc')]);router['get'](_0xb9af('0xd'),auth[_0xb9af('0x8')](),controller['run']);router[_0xb9af('0xa')]('/:id/query',auth[_0xb9af('0x8')](),controller['query']);router[_0xb9af('0xe')]('/',auth[_0xb9af('0x8')](),controller[_0xb9af('0xf')]);router[_0xb9af('0x10')]('/:id',auth[_0xb9af('0x8')](),controller[_0xb9af('0x11')]);router['delete']('/:id',auth[_0xb9af('0x8')](),controller[_0xb9af('0x12')]);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 79feb99..2f2db5c 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 _0xeda8=['sequelize','exports','STRING','TEXT'];(function(_0x194d2f,_0x58d4af){var _0x3e5eca=function(_0x4bd8df){while(--_0x4bd8df){_0x194d2f['push'](_0x194d2f['shift']());}};_0x3e5eca(++_0x58d4af);}(_0xeda8,0x104));var _0x8eda=function(_0x2e5d8a,_0x2f97c0){_0x2e5d8a=_0x2e5d8a-0x0;var _0x4969ae=_0xeda8[_0x2e5d8a];return _0x4969ae;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eda('0x2')]},'parent':{'type':Sequelize[_0x8eda('0x2')]},'table':{'type':Sequelize[_0x8eda('0x2')]},'conditions':{'type':Sequelize[_0x8eda('0x3')]},'joins':{'type':Sequelize[_0x8eda('0x3')]}};
\ No newline at end of file
+var _0x5075=['exports','STRING','TEXT','sequelize'];(function(_0x507597,_0x412525){var _0x110a0f=function(_0x57935a){while(--_0x57935a){_0x507597['push'](_0x507597['shift']());}};_0x110a0f(++_0x412525);}(_0x5075,0x73));var _0x5507=function(_0x41c49e,_0x4e9e2c){_0x41c49e=_0x41c49e-0x0;var _0x648a67=_0x5075[_0x41c49e];return _0x648a67;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'name':{'type':Sequelize[_0x5507('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5507('0x2')]},'parent':{'type':Sequelize[_0x5507('0x2')]},'table':{'type':Sequelize[_0x5507('0x2')]},'conditions':{'type':Sequelize[_0x5507('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 1bae3f7..352fb04 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 _0xda19=['ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','replace','groupBy','orderBy','order','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','operator','Sequelize','metric','format','DESC','parse','parentKey','web','output','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','run','runReport','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','dbH','status','json','offset','undefined','limit','count','set','apply','update','then','DefaultReports','destroy','end','error','stack','name','send','map','AnalyticDefaultReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','includeAll','include','findAll','show','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','options','find','getFields'];(function(_0x3f80e8,_0xd88ecf){var _0x17cf31=function(_0x5c849e){while(--_0x5c849e){_0x3f80e8['push'](_0x3f80e8['shift']());}};_0x17cf31(++_0xd88ecf);}(_0xda19,0xd5));var _0x9da1=function(_0x55c498,_0x14021c){_0x55c498=_0x55c498-0x0;var _0x3323f2=_0xda19[_0x55c498];return _0x3323f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];var dbH=require('../../mysqldb')[_0x9da1('0x17')];function respondWithStatusCode(_0x1d93f8,_0xd2d225){_0xd2d225=_0xd2d225||0xcc;return function(_0x1ffa2a){if(_0x1ffa2a){return _0x1d93f8['sendStatus'](_0xd2d225);}return _0x1d93f8[_0x9da1('0x18')](_0xd2d225)['end']();};}function respondWithResult(_0x4d17e1,_0x40ba9d){_0x40ba9d=_0x40ba9d||0xc8;return function(_0x479ccd){if(_0x479ccd){return _0x4d17e1[_0x9da1('0x18')](_0x40ba9d)[_0x9da1('0x19')](_0x479ccd);}};}function respondWithFilteredResult(_0x37653d,_0x1a1a6b){return function(_0x7f1a64){if(_0x7f1a64){var _0x514d8e=typeof _0x1a1a6b[_0x9da1('0x1a')]===_0x9da1('0x1b')&&typeof _0x1a1a6b[_0x9da1('0x1c')]===_0x9da1('0x1b');var _0xfb278d=_0x7f1a64[_0x9da1('0x1d')];var _0x497676=_0x514d8e?0x0:_0x1a1a6b['offset'];var _0x17205d=_0x514d8e?_0x7f1a64[_0x9da1('0x1d')]:_0x1a1a6b[_0x9da1('0x1a')]+_0x1a1a6b[_0x9da1('0x1c')];var _0x40a967;if(_0x17205d>=_0xfb278d){_0x17205d=_0xfb278d;_0x40a967=0xc8;}else{_0x40a967=0xce;}_0x37653d[_0x9da1('0x18')](_0x40a967);return _0x37653d[_0x9da1('0x1e')]('Content-Range',_0x497676+'-'+_0x17205d+'/'+_0xfb278d)[_0x9da1('0x19')](_0x7f1a64);}return null;};}function patchUpdates(_0x554845){return function(_0x9c3b37){try{jsonpatch[_0x9da1('0x1f')](_0x9c3b37,_0x554845,!![]);}catch(_0x1fc065){return BPromise['reject'](_0x1fc065);}return _0x9c3b37['save']();};}function saveUpdates(_0x14793b,_0x3e6f85){return function(_0x16ee0c){if(_0x16ee0c){return _0x16ee0c[_0x9da1('0x20')](_0x14793b)[_0x9da1('0x21')](function(_0x165b73){return _0x165b73;});}return null;};}function removeEntity(_0x4c60aa,_0x2413fe){return function(_0x3bfa40){if(_0x3bfa40){return _0x3bfa40['destroy']()[_0x9da1('0x21')](function(){var _0x3f5680=_0x3bfa40['get']({'plain':!![]});var _0x2fd49c=_0x9da1('0x22');return db['UserProfileResource'][_0x9da1('0x23')]({'where':{'type':_0x2fd49c,'resourceId':_0x3f5680['id']}})[_0x9da1('0x21')](function(){return _0x3bfa40;});})['then'](function(){_0x4c60aa['status'](0xcc)[_0x9da1('0x24')]();});}};}function handleEntityNotFound(_0x47055e,_0x5eca5b){return function(_0x27c6e2){if(!_0x27c6e2){_0x47055e['sendStatus'](0x194);}return _0x27c6e2;};}function handleError(_0x5a6f2d,_0x5a59c2){_0x5a59c2=_0x5a59c2||0x1f4;return function(_0x31b826){logger[_0x9da1('0x25')](_0x31b826[_0x9da1('0x26')]);if(_0x31b826[_0x9da1('0x27')]){delete _0x31b826[_0x9da1('0x27')];}_0x5a6f2d['status'](_0x5a59c2)[_0x9da1('0x28')](_0x31b826);};}exports['index']=function(_0x1feae0,_0x235ced){var _0x5b38b3={},_0xc29ba8={},_0x2eb48f={'count':0x0,'rows':[]};var _0x4f318b=_[_0x9da1('0x29')](db[_0x9da1('0x2a')][_0x9da1('0x2b')],function(_0x2b2b48){return{'name':_0x2b2b48['fieldName'],'type':_0x2b2b48['type'][_0x9da1('0x2c')]};});_0xc29ba8[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x4f318b,_0x9da1('0x27'));_0xc29ba8[_0x9da1('0x2e')]=_['keys'](_0x1feae0[_0x9da1('0x2e')]);_0xc29ba8[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xc29ba8[_0x9da1('0x2d')],_0xc29ba8[_0x9da1('0x2e')]);_0x5b38b3[_0x9da1('0x31')]=_['intersection'](_0xc29ba8[_0x9da1('0x2d')],qs['fields'](_0x1feae0['query'][_0x9da1('0x32')]));_0x5b38b3['attributes']=_0x5b38b3[_0x9da1('0x31')][_0x9da1('0x33')]?_0x5b38b3[_0x9da1('0x31')]:_0xc29ba8[_0x9da1('0x2d')];if(!_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x34')](_0x9da1('0x35'))){_0x5b38b3[_0x9da1('0x1c')]=qs['limit'](_0x1feae0[_0x9da1('0x2e')]['limit']);_0x5b38b3[_0x9da1('0x1a')]=qs['offset'](_0x1feae0['query'][_0x9da1('0x1a')]);}_0x5b38b3['order']=qs[_0x9da1('0x36')](_0x1feae0[_0x9da1('0x2e')]['sort']);_0x5b38b3[_0x9da1('0x37')]=qs[_0x9da1('0x2f')](_[_0x9da1('0x38')](_0x1feae0[_0x9da1('0x2e')],_0xc29ba8['filters']),_0x4f318b);if(_0x1feae0[_0x9da1('0x2e')]['filter']){_0x5b38b3[_0x9da1('0x37')]=_['merge'](_0x5b38b3[_0x9da1('0x37')],{'$or':_[_0x9da1('0x29')](_0x4f318b,function(_0x58e165){if(_0x58e165[_0x9da1('0x39')]!==_0x9da1('0x3a')){var _0x394acf={};_0x394acf[_0x58e165['name']]={'$like':'%'+_0x1feae0['query']['filter']+'%'};return _0x394acf;}})});}_0x5b38b3=_[_0x9da1('0x3b')]({},_0x5b38b3,_0x1feae0['options']);var _0x5b215c={'where':_0x5b38b3[_0x9da1('0x37')]};return db[_0x9da1('0x2a')][_0x9da1('0x1d')](_0x5b215c)['then'](function(_0x42dbd8){_0x2eb48f[_0x9da1('0x1d')]=_0x42dbd8;if(_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x3c')]){_0x5b38b3[_0x9da1('0x3d')]=[{'all':!![]}];}return db[_0x9da1('0x2a')][_0x9da1('0x3e')](_0x5b38b3);})['then'](function(_0x467350){_0x2eb48f['rows']=_0x467350;return _0x2eb48f;})[_0x9da1('0x21')](respondWithFilteredResult(_0x235ced,_0x5b38b3))['catch'](handleError(_0x235ced,null));};exports[_0x9da1('0x3f')]=function(_0x40d848,_0x599211){var _0x265366={'raw':!![],'where':{'id':_0x40d848['params']['id']}},_0xfeec5f={};_0xfeec5f[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x2a')][_0x9da1('0x2b')]);_0xfeec5f['query']=_['keys'](_0x40d848[_0x9da1('0x2e')]);_0xfeec5f[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],_0xfeec5f[_0x9da1('0x2e')]);_0x265366[_0x9da1('0x31')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],qs['fields'](_0x40d848[_0x9da1('0x2e')][_0x9da1('0x32')]));_0x265366[_0x9da1('0x31')]=_0x265366['attributes'][_0x9da1('0x33')]?_0x265366[_0x9da1('0x31')]:_0xfeec5f[_0x9da1('0x2d')];if(_0x40d848['query'][_0x9da1('0x3c')]){_0x265366[_0x9da1('0x3d')]=[{'all':!![]}];}_0x265366=_[_0x9da1('0x3b')]({},_0x265366,_0x40d848['options']);return db[_0x9da1('0x2a')]['find'](_0x265366)['then'](handleEntityNotFound(_0x599211,null))[_0x9da1('0x21')](respondWithResult(_0x599211,null))[_0x9da1('0x40')](handleError(_0x599211,null));};exports['create']=function(_0x712d10,_0x2066d2){return db['AnalyticDefaultReport'][_0x9da1('0x41')](_0x712d10[_0x9da1('0x42')],{})[_0x9da1('0x21')](function(_0x3a529d){var _0x4780ca=_0x712d10[_0x9da1('0x43')][_0x9da1('0x44')]({'plain':!![]});if(!_0x4780ca)throw new Error(_0x9da1('0x45'));if(_0x4780ca[_0x9da1('0x46')]==='user'){var _0x147c65=_0x3a529d[_0x9da1('0x44')]({'plain':!![]});var _0x34a203=_0x9da1('0x47');return db['UserProfileSection']['find']({'where':{'name':_0x34a203,'userProfileId':_0x4780ca[_0x9da1('0x48')]},'raw':!![]})[_0x9da1('0x21')](function(_0x3870dd){if(_0x3870dd&&_0x3870dd[_0x9da1('0x49')]===0x0){return db[_0x9da1('0x4a')][_0x9da1('0x41')]({'name':_0x147c65[_0x9da1('0x27')],'resourceId':_0x147c65['id'],'type':_0x9da1('0x22'),'sectionId':_0x3870dd['id']},{})[_0x9da1('0x21')](function(){return _0x3a529d;});}else{return _0x3a529d;}})[_0x9da1('0x40')](function(_0x868167){logger[_0x9da1('0x25')](_0x9da1('0x4b'),_0x868167);throw _0x868167;});}return _0x3a529d;})[_0x9da1('0x21')](respondWithResult(_0x2066d2,0xc9))['catch'](handleError(_0x2066d2,null));};exports[_0x9da1('0x20')]=function(_0x1fbb5d,_0x4d241a){if(_0x1fbb5d[_0x9da1('0x42')]['id']){delete _0x1fbb5d['body']['id'];}return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x1fbb5d[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x4d241a,null))[_0x9da1('0x21')](saveUpdates(_0x1fbb5d[_0x9da1('0x42')],null))[_0x9da1('0x21')](respondWithResult(_0x4d241a,null))[_0x9da1('0x40')](handleError(_0x4d241a,null));};exports[_0x9da1('0x23')]=function(_0x343b05,_0x170351){return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x343b05[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x170351,null))[_0x9da1('0x21')](removeEntity(_0x170351,null))[_0x9da1('0x40')](handleError(_0x170351,null));};exports[_0x9da1('0x4d')]=function(_0x4607a9,_0x2020d0){var _0x3c01c3=0xa;var _0xfa8d3f=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),_0x9da1('0x50')];var _0x5bda2a={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0xc27b00={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x27ac84=function(_0x10ebc9){return!_[_0x9da1('0x5c')]([_0x9da1('0x5d'),_0x9da1('0x5e'),_0x9da1('0x5f'),'IS\x20NOT\x20EMPTY'],_0x10ebc9);};var _0x5f5dc2=function(_0x454a68){if(!_0x454a68||!_0x454a68['rules']['length']){return'';}for(var _0x5b4a05='(',_0x6f86c3=0x0;_0x6f86c3<_0x454a68['rules'][_0x9da1('0x33')];_0x6f86c3+=0x1){_0x6f86c3>0x0&&(_0x5b4a05+='\x20'+_0x454a68['operator']+'\x20');_0x5b4a05+=_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x61')]?_0x5f5dc2(_0x454a68['rules'][_0x6f86c3][_0x9da1('0x61')]):_0x454a68[_0x9da1('0x60')][_0x6f86c3]['field']+'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x62')]+(_0x27ac84(_0x454a68['rules'][_0x6f86c3]['condition'])?'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x63')]:'');}return _0x5b4a05+')';};var _0x21d00c={'where':{'id':_0x4607a9['params']['id']}},_0x3ca531,_0x236b01,_0x44d7fe,_0x5cb102,_0x3d2c25;_0x21d00c=_['merge']({},_0x21d00c,_0x4607a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0x21d00c)[_0x9da1('0x21')](function(_0x3382b1){if(_0x3382b1){_0x3ca531=_0x3382b1;return _0x3382b1[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x1f2a4b){if(_0x1f2a4b){if(!_0x1f2a4b[_0x9da1('0x33')]){throw new db['Sequelize'][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x236b01=_0x1f2a4b;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x491fcb){if(_0x491fcb){_0x44d7fe=_[_0x9da1('0x6a')](_0x491fcb,'id');var _0x13fadd;var _0x419f78=squel[_0x9da1('0x6b')]();_0x419f78[_0x9da1('0x6c')](_0x3ca531[_0x9da1('0x6d')]);for(var _0x55a6d2=0x0;_0x55a6d2<_0x236b01[_0x9da1('0x33')];_0x55a6d2+=0x1){_0x13fadd=_0x236b01[_0x55a6d2]['MetricId']?_0x44d7fe[_0x236b01[_0x55a6d2][_0x9da1('0x6e')]]['metric']:_0x236b01[_0x55a6d2][_0x9da1('0x6f')];_0x13fadd=_0x236b01[_0x55a6d2][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x5bda2a[_0x236b01[_0x55a6d2][_0x9da1('0x70')]],'%s',_0x13fadd):_0x13fadd;_0x13fadd=_0x236b01[_0x55a6d2]['format']?_['replace'](_0xc27b00[_0x236b01[_0x55a6d2]['format']],'%s',_0x13fadd):_0x13fadd;if(_0x236b01[_0x55a6d2][_0x9da1('0x72')]){_0x419f78[_0x9da1('0x61')](_0x13fadd);}_0x236b01[_0x55a6d2][_0x9da1('0x73')]&&_0x419f78[_0x9da1('0x74')](_0x13fadd,_0x236b01[_0x55a6d2]['orderBy']==='DESC'?![]:!![]);_0x419f78[_0x9da1('0x6f')](_0x13fadd,_0x236b01[_0x55a6d2][_0x9da1('0x75')]||_0x13fadd);}if(_0x3ca531[_0x9da1('0x76')]){_0x3ca531['joins']=JSON['parse'](_0x3ca531[_0x9da1('0x76')]);for(var _0x1deb93=0x0;_0x1deb93<_0x3ca531[_0x9da1('0x76')]['length'];_0x1deb93+=0x1){if(_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0xfa8d3f,_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x39')])&&_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey']&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')]&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x78')]){_0x419f78[_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]](_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0x3ca531[_0x9da1('0x6d')],_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey'],_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],_0x3ca531['joins'][_0x1deb93][_0x9da1('0x78')]));}}}if(_0x3ca531['conditions']){_0x3ca531[_0x9da1('0x7a')]=JSON['parse'](_0x3ca531[_0x9da1('0x7a')]);_0x419f78[_0x9da1('0x37')](_0x5f5dc2(_0x3ca531[_0x9da1('0x7a')][_0x9da1('0x61')]));}_0x3d2c25=_0x419f78[_0x9da1('0x7b')]();_0x419f78[_0x9da1('0x1c')](_0x3c01c3);_0x419f78[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x419f78[_0x9da1('0x7e')]());return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x419f78[_0x9da1('0x7e')](),{'type':dbH['sequelize'][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](respondWithResult(_0x2020d0,null))[_0x9da1('0x40')](handleError(_0x2020d0,null));};function runReport(_0x162597,_0x4f39bc,_0x1ca102){var _0x2eb5e6=_0x4f39bc['name'];var _0x4a4cda=0xa;var _0x84f8d8=[_0x9da1('0x4e'),_0x9da1('0x82'),_0x9da1('0x4f'),_0x9da1('0x50')];var _0x4701b3={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x3a0a84={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':_0x9da1('0x83'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9da1('0x84')};var _0x354c5a=function(_0x53ab6a){return!_[_0x9da1('0x5c')](['IS\x20NULL',_0x9da1('0x5e'),'IS\x20EMPTY',_0x9da1('0x85')],_0x53ab6a);};var _0x106bd9=function(_0x347cb8){if(!_0x347cb8||!_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x3e331a='(',_0x1f785c=0x0;_0x1f785c<_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')];_0x1f785c+=0x1){_0x1f785c>0x0&&(_0x3e331a+='\x20'+_0x347cb8[_0x9da1('0x86')]+'\x20');_0x3e331a+=_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x61')]?_0x106bd9(_0x347cb8['rules'][_0x1f785c][_0x9da1('0x61')]):_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x6f')]+'\x20'+_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x62')]+(_0x354c5a(_0x347cb8[_0x9da1('0x60')][_0x1f785c]['condition'])?'\x20'+_0x347cb8['rules'][_0x1f785c][_0x9da1('0x63')]:'');}return _0x3e331a+')';};var _0xdecc82={'where':{'id':_0x162597['id']}},_0xe12dd7,_0x4cd85f,_0x4bf74c,_0x28335d,_0x175b4b;_0xdecc82=_[_0x9da1('0x3b')]({},_0xdecc82,_0x1ca102);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xdecc82)[_0x9da1('0x21')](function(_0x5561f0){if(_0x5561f0){_0xe12dd7=_0x5561f0;return _0x5561f0[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x5a64fd){if(_0x5a64fd){if(!_0x5a64fd['length']){throw new db[(_0x9da1('0x87'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cd85f=_0x5a64fd;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x18ae08){if(_0x18ae08){_0x4bf74c=_[_0x9da1('0x6a')](_0x18ae08,'id');var _0x30065d;var _0x40a2ef=squel[_0x9da1('0x6b')]();_0x40a2ef['from'](_0xe12dd7['table']);for(var _0xd10ba4=0x0;_0xd10ba4<_0x4cd85f[_0x9da1('0x33')];_0xd10ba4+=0x1){_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]?_0x4bf74c[_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]][_0x9da1('0x88')]:_0x4cd85f[_0xd10ba4][_0x9da1('0x6f')];_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x4701b3[_0x4cd85f[_0xd10ba4]['function']],'%s',_0x30065d):_0x30065d;_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]?_['replace'](_0x3a0a84[_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]],'%s',_0x30065d):_0x30065d;if(_0x4cd85f[_0xd10ba4][_0x9da1('0x72')]){_0x40a2ef[_0x9da1('0x61')](_0x30065d);}_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]&&_0x40a2ef[_0x9da1('0x74')](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]===_0x9da1('0x8a')?![]:!![]);_0x40a2ef['field'](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x75')]||_0x30065d);}if(_0xe12dd7['joins']){_0xe12dd7[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0xe12dd7[_0x9da1('0x76')]);for(var _0x22b679=0x0;_0x22b679<_0xe12dd7['joins'][_0x9da1('0x33')];_0x22b679+=0x1){if(_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0x84f8d8,_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')])&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]){_0x40a2ef[_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]](_0xe12dd7['joins'][_0x22b679][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0xe12dd7['table'],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]));}}}if(_0xe12dd7[_0x9da1('0x7a')]){_0xe12dd7[_0x9da1('0x7a')]=JSON['parse'](_0xe12dd7[_0x9da1('0x7a')]);_0x40a2ef[_0x9da1('0x37')](_0x106bd9(_0xe12dd7['conditions'][_0x9da1('0x61')]));}_0x175b4b=_0x40a2ef[_0x9da1('0x7b')]();_0x40a2ef[_0x9da1('0x1c')](_0x4a4cda);_0x40a2ef['offset'](0x0);return;}})['then'](function(){if(_0x4f39bc['output']===_0x9da1('0x8d')){return null;}var _0x3b17aa=_[_0x9da1('0x3b')](_0x4f39bc,{'name':_0x4f39bc['fullPath']||_0x4f39bc['name']||_0xe12dd7[_0x9da1('0x27')],'basename':_0x2eb5e6,'savename':util[_0x9da1('0x89')]('%s-%s.%s',_0x4f39bc[_0x9da1('0x27')]||_0xe12dd7['name'],require('randomstring')['generate'](0x4),_0x4f39bc[_0x9da1('0x8e')]||_0x9da1('0x8f')),'reportId':_0xe12dd7['id'],'reportType':_0x9da1('0x90')});return db[_0x9da1('0x91')][_0x9da1('0x41')](_0x3b17aa,{'raw':!![]});})[_0x9da1('0x21')](function(_0x2aac99){if(_0xe12dd7[_0x9da1('0x6d')]===_0x9da1('0x92')){_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc['startDate'],_0x4f39bc['endDate']);}else{_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc[_0x9da1('0x93')],_0x4f39bc[_0x9da1('0x94')]);}if(_0x2aac99){logger[_0x9da1('0x95')](_0x9da1('0x96'),_0x175b4b[_0x9da1('0x7e')]());require(_0x9da1('0x97'))[_0x9da1('0x98')](path[_0x9da1('0x4e')](__dirname,'../../components/export/',_0x2aac99[_0x9da1('0x8e')]),[_0x2aac99['id'],_0x175b4b[_0x9da1('0x7e')](),path[_0x9da1('0x4e')](__dirname,_0x9da1('0x99'),_0x2aac99[_0x9da1('0x9a')]),_0x2eb5e6]);return _0x2aac99;}else{var _0x5ad3f8=squel[_0x9da1('0x6b')]();_0x5ad3f8['from']('('+_0x175b4b[_0x9da1('0x7e')]()+')',_0x9da1('0x9b'));_0x5ad3f8[_0x9da1('0x6f')]('COUNT(*)','count');_0x175b4b[_0x9da1('0x1c')](_0x4f39bc[_0x9da1('0x1c')]||_0x4a4cda);_0x175b4b[_0x9da1('0x1a')](_0x4f39bc['offset']||0x0);return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x5ad3f8['toString'](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')]['SELECT']})['then'](function(_0x489b3f){if(!_0x489b3f[_0x9da1('0x33')]){_0x28335d=0x0;}else{_0x28335d=_0x489b3f[0x0]['count']||0x0;}return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x175b4b[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});})['then'](function(_0x355a71){return{'rows':_0x355a71||[],'count':_0x28335d};});}});}exports[_0x9da1('0x9c')]=function(_0x492e1a,_0x449a17){return runReport(_0x492e1a[_0x9da1('0x4c')],_0x492e1a[_0x9da1('0x2e')],_0x492e1a[_0x9da1('0x64')])['then'](respondWithResult(_0x449a17,null))[_0x9da1('0x40')](handleError(_0x449a17,null));};exports[_0x9da1('0x9d')]=runReport;exports[_0x9da1('0x2e')]=function(_0x8280a9,_0x374754){var _0x1e466a=0xa;var _0x3f9133=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),'cross_join'];var _0x3dd3e0={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x52e4a6={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4aa903=function(_0x55d7f2){return!_['includes'](['IS\x20NULL',_0x9da1('0x5e'),_0x9da1('0x5f'),_0x9da1('0x85')],_0x55d7f2);};var _0x3212ad=function(_0x5ac65b){if(!_0x5ac65b||!_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x21a99d='(',_0xd19a7c=0x0;_0xd19a7c<_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')];_0xd19a7c+=0x1){_0xd19a7c>0x0&&(_0x21a99d+='\x20'+_0x5ac65b[_0x9da1('0x86')]+'\x20');_0x21a99d+=_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]?_0x3212ad(_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]):_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x6f')]+'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c]['condition']+(_0x4aa903(_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x62')])?'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x63')]:'');}return _0x21a99d+')';};var _0xb14af1={'where':{'id':_0x8280a9[_0x9da1('0x4c')]['id']}},_0x245566,_0x5b2591,_0x3c51e3,_0x54b83d,_0x23bf86;_0xb14af1=_['merge']({},_0xb14af1,_0x8280a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xb14af1)[_0x9da1('0x21')](function(_0x4bb140){if(_0x4bb140){_0x245566=_0x4bb140;return _0x4bb140[_0x9da1('0x66')]();}return null;})['then'](function(_0x47cbdd){if(_0x47cbdd){if(!_0x47cbdd['length']){throw new db[(_0x9da1('0x87'))][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x5b2591=_0x47cbdd;return db['AnalyticMetric'][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x5e1e24){if(_0x5e1e24){_0x3c51e3=_[_0x9da1('0x6a')](_0x5e1e24,'id');var _0x49ddec;var _0x407218=squel['select']();_0x407218['from'](_0x245566['table']);for(var _0x316fee=0x0;_0x316fee<_0x5b2591['length'];_0x316fee+=0x1){_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x6e')]?_0x3c51e3[_0x5b2591[_0x316fee][_0x9da1('0x6e')]]['metric']:_0x5b2591[_0x316fee]['field'];_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x70')]?_['replace'](_0x3dd3e0[_0x5b2591[_0x316fee][_0x9da1('0x70')]],'%s',_0x49ddec):_0x49ddec;_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x89')]?_['replace'](_0x52e4a6[_0x5b2591[_0x316fee]['format']],'%s',_0x49ddec):_0x49ddec;if(_0x5b2591[_0x316fee][_0x9da1('0x72')]){_0x407218[_0x9da1('0x61')](_0x49ddec);}_0x5b2591[_0x316fee][_0x9da1('0x73')]&&_0x407218[_0x9da1('0x74')](_0x49ddec,_0x5b2591[_0x316fee]['orderBy']==='DESC'?![]:!![]);_0x407218[_0x9da1('0x6f')](_0x49ddec,_0x5b2591[_0x316fee][_0x9da1('0x75')]||_0x49ddec);}if(_0x245566[_0x9da1('0x76')]){_0x245566[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0x245566['joins']);for(var _0x56ec7d=0x0;_0x56ec7d<_0x245566[_0x9da1('0x76')][_0x9da1('0x33')];_0x56ec7d+=0x1){if(_0x245566['joins'][_0x56ec7d][_0x9da1('0x39')]&&_['includes'](_0x3f9133,_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')])&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x8c')]&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')]&&_0x245566['joins'][_0x56ec7d][_0x9da1('0x78')]){_0x407218[_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')]](_0x245566[_0x9da1('0x76')][_0x56ec7d]['foreignTable'],null,util[_0x9da1('0x89')](_0x9da1('0x79'),_0x245566[_0x9da1('0x6d')],_0x245566['joins'][_0x56ec7d]['parentKey'],_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')],_0x245566['joins'][_0x56ec7d]['foreignKey']));}}}if(_0x245566[_0x9da1('0x7a')]){_0x245566[_0x9da1('0x7a')]=JSON[_0x9da1('0x8b')](_0x245566[_0x9da1('0x7a')]);_0x407218[_0x9da1('0x37')](_0x3212ad(_0x245566['conditions'][_0x9da1('0x61')]));}_0x23bf86=_0x407218['clone']();_0x407218[_0x9da1('0x1c')](_0x1e466a);_0x407218[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x407218['toString']());return dbH['sequelize'][_0x9da1('0x2e')](_0x407218[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](function(){return{'sql':_0x23bf86['toString']()};})[_0x9da1('0x21')](respondWithResult(_0x374754,null))[_0x9da1('0x40')](handleError(_0x374754,null));};
\ No newline at end of file
+var _0x4975=['set','Content-Range','save','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','index','AnalyticDefaultReport','rawAttributes','type','key','map','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','body','role','user','Reports','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','SUM(%s)','COUNT(%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','joins','includes','parentKey','foreignKey','foreignTable','conditions','parse','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','HOUR(%s)','operator','Please\x20insert\x20at\x20least\x20one\x20field','alias','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','toString','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','cross_join','getFields','replace','clone','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x313d54,_0x42f9e8){var _0x1cd633=function(_0x820bde){while(--_0x820bde){_0x313d54['push'](_0x313d54['shift']());}};_0x1cd633(++_0x42f9e8);}(_0x4975,0x86));var _0x5497=function(_0x38c9b5,_0x46dfee){_0x38c9b5=_0x38c9b5-0x0;var _0x54aed1=_0x4975[_0x38c9b5];return _0x54aed1;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];var dbH=require(_0x5497('0x17'))[_0x5497('0x18')];function respondWithStatusCode(_0x984990,_0x747dc7){_0x747dc7=_0x747dc7||0xcc;return function(_0x365144){if(_0x365144){return _0x984990[_0x5497('0x19')](_0x747dc7);}return _0x984990[_0x5497('0x1a')](_0x747dc7)[_0x5497('0x1b')]();};}function respondWithResult(_0x1a4c74,_0x55f590){_0x55f590=_0x55f590||0xc8;return function(_0x11b0a9){if(_0x11b0a9){return _0x1a4c74['status'](_0x55f590)[_0x5497('0x1c')](_0x11b0a9);}};}function respondWithFilteredResult(_0x2bfd8a,_0x19e5f3){return function(_0x3ce50b){if(_0x3ce50b){var _0x37c18e=typeof _0x19e5f3[_0x5497('0x1d')]===_0x5497('0x1e')&&typeof _0x19e5f3['limit']==='undefined';var _0x3f4d20=_0x3ce50b[_0x5497('0x1f')];var _0x3a47fd=_0x37c18e?0x0:_0x19e5f3['offset'];var _0xbf1ba7=_0x37c18e?_0x3ce50b[_0x5497('0x1f')]:_0x19e5f3[_0x5497('0x1d')]+_0x19e5f3[_0x5497('0x20')];var _0x1b1b43;if(_0xbf1ba7>=_0x3f4d20){_0xbf1ba7=_0x3f4d20;_0x1b1b43=0xc8;}else{_0x1b1b43=0xce;}_0x2bfd8a[_0x5497('0x1a')](_0x1b1b43);return _0x2bfd8a[_0x5497('0x21')](_0x5497('0x22'),_0x3a47fd+'-'+_0xbf1ba7+'/'+_0x3f4d20)[_0x5497('0x1c')](_0x3ce50b);}return null;};}function patchUpdates(_0x3f54ef){return function(_0x186065){try{jsonpatch['apply'](_0x186065,_0x3f54ef,!![]);}catch(_0x720767){return BPromise['reject'](_0x720767);}return _0x186065[_0x5497('0x23')]();};}function saveUpdates(_0xd0868d,_0x44265c){return function(_0x2f587d){if(_0x2f587d){return _0x2f587d[_0x5497('0x24')](_0xd0868d)[_0x5497('0x25')](function(_0x5018fa){return _0x5018fa;});}return null;};}function removeEntity(_0x54043a,_0x1eefce){return function(_0x34b97f){if(_0x34b97f){return _0x34b97f[_0x5497('0x26')]()[_0x5497('0x25')](function(){var _0x5223b5=_0x34b97f[_0x5497('0x27')]({'plain':!![]});var _0x57268c=_0x5497('0x28');return db[_0x5497('0x29')][_0x5497('0x26')]({'where':{'type':_0x57268c,'resourceId':_0x5223b5['id']}})[_0x5497('0x25')](function(){return _0x34b97f;});})[_0x5497('0x25')](function(){_0x54043a[_0x5497('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4af5f4,_0x5406e2){return function(_0x583d06){if(!_0x583d06){_0x4af5f4['sendStatus'](0x194);}return _0x583d06;};}function handleError(_0x39a2b7,_0x48d146){_0x48d146=_0x48d146||0x1f4;return function(_0x5e9356){logger[_0x5497('0x2a')](_0x5e9356[_0x5497('0x2b')]);if(_0x5e9356[_0x5497('0x2c')]){delete _0x5e9356['name'];}_0x39a2b7['status'](_0x48d146)['send'](_0x5e9356);};}exports[_0x5497('0x2d')]=function(_0x471e0b,_0xf4c117){var _0x5b8f79={},_0x489f71={},_0x594866={'count':0x0,'rows':[]};var _0xa28dd8=_['map'](db[_0x5497('0x2e')][_0x5497('0x2f')],function(_0x77c575){return{'name':_0x77c575['fieldName'],'type':_0x77c575[_0x5497('0x30')][_0x5497('0x31')]};});_0x489f71['model']=_[_0x5497('0x32')](_0xa28dd8,_0x5497('0x2c'));_0x489f71[_0x5497('0x33')]=_['keys'](_0x471e0b[_0x5497('0x33')]);_0x489f71[_0x5497('0x34')]=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],_0x489f71[_0x5497('0x33')]);_0x5b8f79['attributes']=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],qs['fields'](_0x471e0b[_0x5497('0x33')][_0x5497('0x37')]));_0x5b8f79[_0x5497('0x38')]=_0x5b8f79[_0x5497('0x38')][_0x5497('0x39')]?_0x5b8f79[_0x5497('0x38')]:_0x489f71['model'];if(!_0x471e0b[_0x5497('0x33')]['hasOwnProperty'](_0x5497('0x3a'))){_0x5b8f79[_0x5497('0x20')]=qs[_0x5497('0x20')](_0x471e0b['query']['limit']);_0x5b8f79[_0x5497('0x1d')]=qs[_0x5497('0x1d')](_0x471e0b[_0x5497('0x33')][_0x5497('0x1d')]);}_0x5b8f79[_0x5497('0x3b')]=qs[_0x5497('0x3c')](_0x471e0b['query'][_0x5497('0x3c')]);_0x5b8f79[_0x5497('0x3d')]=qs[_0x5497('0x34')](_[_0x5497('0x3e')](_0x471e0b[_0x5497('0x33')],_0x489f71[_0x5497('0x34')]),_0xa28dd8);if(_0x471e0b[_0x5497('0x33')][_0x5497('0x3f')]){_0x5b8f79[_0x5497('0x3d')]=_['merge'](_0x5b8f79[_0x5497('0x3d')],{'$or':_[_0x5497('0x32')](_0xa28dd8,function(_0x1e9616){if(_0x1e9616[_0x5497('0x30')]!==_0x5497('0x40')){var _0xa5ebe6={};_0xa5ebe6[_0x1e9616[_0x5497('0x2c')]]={'$like':'%'+_0x471e0b['query'][_0x5497('0x3f')]+'%'};return _0xa5ebe6;}})});}_0x5b8f79=_[_0x5497('0x41')]({},_0x5b8f79,_0x471e0b[_0x5497('0x42')]);var _0x35993c={'where':_0x5b8f79[_0x5497('0x3d')]};return db[_0x5497('0x2e')][_0x5497('0x1f')](_0x35993c)['then'](function(_0x2137bd){_0x594866[_0x5497('0x1f')]=_0x2137bd;if(_0x471e0b[_0x5497('0x33')][_0x5497('0x43')]){_0x5b8f79[_0x5497('0x44')]=[{'all':!![]}];}return db[_0x5497('0x2e')][_0x5497('0x45')](_0x5b8f79);})[_0x5497('0x25')](function(_0x2021ae){_0x594866[_0x5497('0x46')]=_0x2021ae;return _0x594866;})['then'](respondWithFilteredResult(_0xf4c117,_0x5b8f79))[_0x5497('0x47')](handleError(_0xf4c117,null));};exports['show']=function(_0x40822a,_0x9fc24){var _0x26ef01={'raw':!![],'where':{'id':_0x40822a[_0x5497('0x48')]['id']}},_0x3602ec={};_0x3602ec['model']=_[_0x5497('0x49')](db[_0x5497('0x2e')]['rawAttributes']);_0x3602ec[_0x5497('0x33')]=_['keys'](_0x40822a[_0x5497('0x33')]);_0x3602ec['filters']=_[_0x5497('0x35')](_0x3602ec[_0x5497('0x36')],_0x3602ec[_0x5497('0x33')]);_0x26ef01[_0x5497('0x38')]=_[_0x5497('0x35')](_0x3602ec['model'],qs['fields'](_0x40822a['query']['fields']));_0x26ef01[_0x5497('0x38')]=_0x26ef01[_0x5497('0x38')][_0x5497('0x39')]?_0x26ef01[_0x5497('0x38')]:_0x3602ec[_0x5497('0x36')];if(_0x40822a[_0x5497('0x33')][_0x5497('0x43')]){_0x26ef01[_0x5497('0x44')]=[{'all':!![]}];}_0x26ef01=_[_0x5497('0x41')]({},_0x26ef01,_0x40822a['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x26ef01)[_0x5497('0x25')](handleEntityNotFound(_0x9fc24,null))['then'](respondWithResult(_0x9fc24,null))[_0x5497('0x47')](handleError(_0x9fc24,null));};exports['create']=function(_0x12ffbc,_0x31f1ba){return db[_0x5497('0x2e')]['create'](_0x12ffbc[_0x5497('0x4b')],{})[_0x5497('0x25')](function(_0x515c3e){var _0x3abc92=_0x12ffbc['user'][_0x5497('0x27')]({'plain':!![]});if(!_0x3abc92)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3abc92[_0x5497('0x4c')]===_0x5497('0x4d')){var _0x26fd9f=_0x515c3e[_0x5497('0x27')]({'plain':!![]});var _0x25e80c=_0x5497('0x4e');return db[_0x5497('0x4f')][_0x5497('0x4a')]({'where':{'name':_0x25e80c,'userProfileId':_0x3abc92['userProfileId']},'raw':!![]})[_0x5497('0x25')](function(_0x5b2c22){if(_0x5b2c22&&_0x5b2c22['autoAssociation']===0x0){return db[_0x5497('0x29')][_0x5497('0x50')]({'name':_0x26fd9f['name'],'resourceId':_0x26fd9f['id'],'type':_0x5497('0x28'),'sectionId':_0x5b2c22['id']},{})[_0x5497('0x25')](function(){return _0x515c3e;});}else{return _0x515c3e;}})[_0x5497('0x47')](function(_0x3094c7){logger['error'](_0x5497('0x51'),_0x3094c7);throw _0x3094c7;});}return _0x515c3e;})['then'](respondWithResult(_0x31f1ba,0xc9))['catch'](handleError(_0x31f1ba,null));};exports[_0x5497('0x24')]=function(_0x33dd07,_0x2f7ec8){if(_0x33dd07['body']['id']){delete _0x33dd07['body']['id'];}return db[_0x5497('0x2e')]['find']({'where':{'id':_0x33dd07[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f7ec8,null))[_0x5497('0x25')](saveUpdates(_0x33dd07['body'],null))[_0x5497('0x25')](respondWithResult(_0x2f7ec8,null))[_0x5497('0x47')](handleError(_0x2f7ec8,null));};exports['destroy']=function(_0x418f17,_0x5dccfb){return db['AnalyticDefaultReport'][_0x5497('0x4a')]({'where':{'id':_0x418f17[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x5dccfb,null))[_0x5497('0x25')](removeEntity(_0x5dccfb,null))[_0x5497('0x47')](handleError(_0x5dccfb,null));};exports[_0x5497('0x52')]=function(_0x28b2a3,_0x3fca40){var _0x25c75e=0xa;var _0x590be7=[_0x5497('0x53'),'left_join','right_join','cross_join'];var _0x1f3965={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5497('0x56'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x25f349={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x425995=function(_0xc783ce){return!_['includes']([_0x5497('0x5e'),_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0xc783ce);};var _0x5823f6=function(_0x31271c){if(!_0x31271c||!_0x31271c[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x542bcf='(',_0x1ab48f=0x0;_0x1ab48f<_0x31271c['rules']['length'];_0x1ab48f+=0x1){_0x1ab48f>0x0&&(_0x542bcf+='\x20'+_0x31271c['operator']+'\x20');_0x542bcf+=_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x63')]?_0x5823f6(_0x31271c[_0x5497('0x62')][_0x1ab48f]['group']):_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x64')]+'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x65')]+(_0x425995(_0x31271c['rules'][_0x1ab48f][_0x5497('0x65')])?'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x66')]:'');}return _0x542bcf+')';};var _0x49617c={'where':{'id':_0x28b2a3[_0x5497('0x48')]['id']}},_0x164de1,_0x465bed,_0xb3eec2,_0x4368e3,_0x1467c4;_0x49617c=_[_0x5497('0x41')]({},_0x49617c,_0x28b2a3['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x49617c)[_0x5497('0x25')](function(_0x20efea){if(_0x20efea){_0x164de1=_0x20efea;return _0x20efea['getFields']();}return null;})['then'](function(_0x4a7360){if(_0x4a7360){if(!_0x4a7360[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x465bed=_0x4a7360;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x464df3){if(_0x464df3){_0xb3eec2=_[_0x5497('0x6a')](_0x464df3,'id');var _0x4338d4;var _0x3f38bf=squel[_0x5497('0x6b')]();_0x3f38bf[_0x5497('0x6c')](_0x164de1[_0x5497('0x6d')]);for(var _0x1fc6ad=0x0;_0x1fc6ad<_0x465bed['length'];_0x1fc6ad+=0x1){_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x6e')]?_0xb3eec2[_0x465bed[_0x1fc6ad][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x465bed[_0x1fc6ad]['field'];_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x70')]?_['replace'](_0x1f3965[_0x465bed[_0x1fc6ad][_0x5497('0x70')]],'%s',_0x4338d4):_0x4338d4;_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x71')]?_['replace'](_0x25f349[_0x465bed[_0x1fc6ad][_0x5497('0x71')]],'%s',_0x4338d4):_0x4338d4;if(_0x465bed[_0x1fc6ad][_0x5497('0x72')]){_0x3f38bf[_0x5497('0x63')](_0x4338d4);}_0x465bed[_0x1fc6ad][_0x5497('0x73')]&&_0x3f38bf['order'](_0x4338d4,_0x465bed[_0x1fc6ad][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x3f38bf[_0x5497('0x64')](_0x4338d4,_0x465bed[_0x1fc6ad]['alias']||_0x4338d4);}if(_0x164de1[_0x5497('0x75')]){_0x164de1[_0x5497('0x75')]=JSON['parse'](_0x164de1[_0x5497('0x75')]);for(var _0xebe694=0x0;_0xebe694<_0x164de1[_0x5497('0x75')]['length'];_0xebe694+=0x1){if(_0x164de1['joins'][_0xebe694][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x590be7,_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x30')])&&_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x77')]&&_0x164de1[_0x5497('0x75')][_0xebe694]['foreignTable']&&_0x164de1['joins'][_0xebe694][_0x5497('0x78')]){_0x3f38bf[_0x164de1[_0x5497('0x75')][_0xebe694]['type']](_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],null,util[_0x5497('0x71')]('%s.%s\x20=\x20%s.%s',_0x164de1[_0x5497('0x6d')],_0x164de1[_0x5497('0x75')][_0xebe694]['parentKey'],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x78')]));}}}if(_0x164de1[_0x5497('0x7a')]){_0x164de1['conditions']=JSON[_0x5497('0x7b')](_0x164de1[_0x5497('0x7a')]);_0x3f38bf[_0x5497('0x3d')](_0x5823f6(_0x164de1[_0x5497('0x7a')][_0x5497('0x63')]));}_0x1467c4=_0x3f38bf['clone']();_0x3f38bf[_0x5497('0x20')](_0x25c75e);_0x3f38bf[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')](_0x5497('0x7d'),_0x3f38bf['toString']());return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x3f38bf['toString'](),{'type':dbH[_0x5497('0x7e')][_0x5497('0x7f')][_0x5497('0x80')]});}})[_0x5497('0x25')](respondWithResult(_0x3fca40,null))['catch'](handleError(_0x3fca40,null));};function runReport(_0x547de7,_0x4ff64f,_0x5343d5){var _0x594761=_0x4ff64f[_0x5497('0x2c')];var _0x2375cc=0xa;var _0x15d0da=[_0x5497('0x53'),_0x5497('0x81'),'right_join','cross_join'];var _0x392987={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x4c41c4={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x22b019=function(_0x4aa4ba){return!_[_0x5497('0x76')](['IS\x20NULL',_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0x4aa4ba);};var _0x5b0f9d=function(_0x59960b){if(!_0x59960b||!_0x59960b[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x953b31='(',_0xeb52c9=0x0;_0xeb52c9<_0x59960b[_0x5497('0x62')][_0x5497('0x39')];_0xeb52c9+=0x1){_0xeb52c9>0x0&&(_0x953b31+='\x20'+_0x59960b[_0x5497('0x86')]+'\x20');_0x953b31+=_0x59960b[_0x5497('0x62')][_0xeb52c9]['group']?_0x5b0f9d(_0x59960b['rules'][_0xeb52c9]['group']):_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x64')]+'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x65')]+(_0x22b019(_0x59960b['rules'][_0xeb52c9]['condition'])?'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x66')]:'');}return _0x953b31+')';};var _0x5dd9bc={'where':{'id':_0x547de7['id']}},_0x83b240,_0x2fc11a,_0x3ce2ee,_0x36c09f,_0x51e9fb;_0x5dd9bc=_['merge']({},_0x5dd9bc,_0x5343d5);return db['AnalyticDefaultReport']['find'](_0x5dd9bc)['then'](function(_0x497295){if(_0x497295){_0x83b240=_0x497295;return _0x497295['getFields']();}return null;})[_0x5497('0x25')](function(_0x5aa5e1){if(_0x5aa5e1){if(!_0x5aa5e1[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))](_0x5497('0x87'),0x193);}_0x2fc11a=_0x5aa5e1;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})['then'](function(_0x77d52c){if(_0x77d52c){_0x3ce2ee=_['keyBy'](_0x77d52c,'id');var _0x15a67d;var _0x2721b2=squel[_0x5497('0x6b')]();_0x2721b2[_0x5497('0x6c')](_0x83b240[_0x5497('0x6d')]);for(var _0x38fa59=0x0;_0x38fa59<_0x2fc11a[_0x5497('0x39')];_0x38fa59+=0x1){_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x6e')]?_0x3ce2ee[_0x2fc11a[_0x38fa59][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x2fc11a[_0x38fa59]['field'];_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x70')]?_['replace'](_0x392987[_0x2fc11a[_0x38fa59][_0x5497('0x70')]],'%s',_0x15a67d):_0x15a67d;_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x71')]?_['replace'](_0x4c41c4[_0x2fc11a[_0x38fa59][_0x5497('0x71')]],'%s',_0x15a67d):_0x15a67d;if(_0x2fc11a[_0x38fa59][_0x5497('0x72')]){_0x2721b2[_0x5497('0x63')](_0x15a67d);}_0x2fc11a[_0x38fa59][_0x5497('0x73')]&&_0x2721b2[_0x5497('0x3b')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x2721b2[_0x5497('0x64')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x88')]||_0x15a67d);}if(_0x83b240[_0x5497('0x75')]){_0x83b240[_0x5497('0x75')]=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x75')]);for(var _0x22426e=0x0;_0x22426e<_0x83b240['joins'][_0x5497('0x39')];_0x22426e+=0x1){if(_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x15d0da,_0x83b240[_0x5497('0x75')][_0x22426e]['type'])&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')]&&_0x83b240['joins'][_0x22426e]['foreignTable']&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]){_0x2721b2[_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]](_0x83b240[_0x5497('0x75')][_0x22426e]['foreignTable'],null,util['format'](_0x5497('0x89'),_0x83b240['table'],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x79')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]));}}}if(_0x83b240['conditions']){_0x83b240['conditions']=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x7a')]);_0x2721b2[_0x5497('0x3d')](_0x5b0f9d(_0x83b240['conditions'][_0x5497('0x63')]));}_0x51e9fb=_0x2721b2['clone']();_0x2721b2[_0x5497('0x20')](_0x2375cc);_0x2721b2['offset'](0x0);return;}})['then'](function(){if(_0x4ff64f[_0x5497('0x8a')]===_0x5497('0x8b')){return null;}var _0x4ce768=_[_0x5497('0x41')](_0x4ff64f,{'name':_0x4ff64f[_0x5497('0x8c')]||_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],'basename':_0x594761,'savename':util['format'](_0x5497('0x8d'),_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],require(_0x5497('0x8e'))[_0x5497('0x8f')](0x4),_0x4ff64f['output']||_0x5497('0x90')),'reportId':_0x83b240['id'],'reportType':'default'});return db[_0x5497('0x91')][_0x5497('0x50')](_0x4ce768,{'raw':!![]});})[_0x5497('0x25')](function(_0x314db4){if(_0x83b240[_0x5497('0x6d')]===_0x5497('0x92')){_0x51e9fb[_0x5497('0x3d')](_0x83b240[_0x5497('0x6d')]+_0x5497('0x93'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}else{_0x51e9fb['where'](_0x83b240[_0x5497('0x6d')]+_0x5497('0x96'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}if(_0x314db4){logger[_0x5497('0x97')](_0x5497('0x98'),_0x51e9fb[_0x5497('0x99')]());require(_0x5497('0x9a'))[_0x5497('0x9b')](path[_0x5497('0x53')](__dirname,_0x5497('0x9c'),_0x314db4['output']),[_0x314db4['id'],_0x51e9fb[_0x5497('0x99')](),path[_0x5497('0x53')](__dirname,_0x5497('0x9d'),_0x314db4[_0x5497('0x9e')]),_0x594761]);return _0x314db4;}else{var _0x46be08=squel[_0x5497('0x6b')]();_0x46be08[_0x5497('0x6c')]('('+_0x51e9fb[_0x5497('0x99')]()+')',_0x5497('0x9f'));_0x46be08[_0x5497('0x64')](_0x5497('0xa0'),_0x5497('0x1f'));_0x51e9fb[_0x5497('0x20')](_0x4ff64f[_0x5497('0x20')]||_0x2375cc);_0x51e9fb['offset'](_0x4ff64f['offset']||0x0);return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x46be08[_0x5497('0x99')](),{'type':dbH['sequelize'][_0x5497('0x7f')][_0x5497('0x80')]})[_0x5497('0x25')](function(_0x2bd48c){if(!_0x2bd48c[_0x5497('0x39')]){_0x36c09f=0x0;}else{_0x36c09f=_0x2bd48c[0x0][_0x5497('0x1f')]||0x0;}return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x51e9fb['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5497('0x80')]});})[_0x5497('0x25')](function(_0x4dab6a){return{'rows':_0x4dab6a||[],'count':_0x36c09f};});}});}exports[_0x5497('0xa1')]=function(_0x27f42b,_0x1bef85){return runReport(_0x27f42b['params'],_0x27f42b[_0x5497('0x33')],_0x27f42b['options'])[_0x5497('0x25')](respondWithResult(_0x1bef85,null))[_0x5497('0x47')](handleError(_0x1bef85,null));};exports[_0x5497('0xa2')]=runReport;exports['query']=function(_0x1c3dad,_0xfba062){var _0x494cc3=0xa;var _0x401f04=[_0x5497('0x53'),_0x5497('0x81'),'right_join',_0x5497('0xa3')];var _0x1a5c32={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x1dfb76={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x5c2517=function(_0x367929){return!_[_0x5497('0x76')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5497('0x60'),_0x5497('0x61')],_0x367929);};var _0x2fd2e3=function(_0x2fe770){if(!_0x2fe770||!_0x2fe770['rules'][_0x5497('0x39')]){return'';}for(var _0x1299cd='(',_0x4c2b14=0x0;_0x4c2b14<_0x2fe770['rules'][_0x5497('0x39')];_0x4c2b14+=0x1){_0x4c2b14>0x0&&(_0x1299cd+='\x20'+_0x2fe770[_0x5497('0x86')]+'\x20');_0x1299cd+=_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x63')]?_0x2fd2e3(_0x2fe770[_0x5497('0x62')][_0x4c2b14]['group']):_0x2fe770['rules'][_0x4c2b14][_0x5497('0x64')]+'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14]['condition']+(_0x5c2517(_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x65')])?'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x66')]:'');}return _0x1299cd+')';};var _0x358ec5={'where':{'id':_0x1c3dad['params']['id']}},_0x5cddbc,_0x188d21,_0xf92129,_0x2d5cc1,_0x4f9228;_0x358ec5=_[_0x5497('0x41')]({},_0x358ec5,_0x1c3dad[_0x5497('0x42')]);return db[_0x5497('0x2e')]['find'](_0x358ec5)[_0x5497('0x25')](function(_0x30a248){if(_0x30a248){_0x5cddbc=_0x30a248;return _0x30a248[_0x5497('0xa4')]();}return null;})['then'](function(_0x1d4c76){if(_0x1d4c76){if(!_0x1d4c76[_0x5497('0x39')]){throw new db['Sequelize']['ValidationErrorItem'](_0x5497('0x87'),0x193);}_0x188d21=_0x1d4c76;return db[_0x5497('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x5001d5){if(_0x5001d5){_0xf92129=_[_0x5497('0x6a')](_0x5001d5,'id');var _0x2c58e6;var _0x300f3e=squel[_0x5497('0x6b')]();_0x300f3e[_0x5497('0x6c')](_0x5cddbc[_0x5497('0x6d')]);for(var _0x23732d=0x0;_0x23732d<_0x188d21['length'];_0x23732d+=0x1){_0x2c58e6=_0x188d21[_0x23732d]['MetricId']?_0xf92129[_0x188d21[_0x23732d][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x188d21[_0x23732d]['field'];_0x2c58e6=_0x188d21[_0x23732d]['function']?_[_0x5497('0xa5')](_0x1a5c32[_0x188d21[_0x23732d][_0x5497('0x70')]],'%s',_0x2c58e6):_0x2c58e6;_0x2c58e6=_0x188d21[_0x23732d][_0x5497('0x71')]?_[_0x5497('0xa5')](_0x1dfb76[_0x188d21[_0x23732d][_0x5497('0x71')]],'%s',_0x2c58e6):_0x2c58e6;if(_0x188d21[_0x23732d][_0x5497('0x72')]){_0x300f3e['group'](_0x2c58e6);}_0x188d21[_0x23732d][_0x5497('0x73')]&&_0x300f3e[_0x5497('0x3b')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x300f3e[_0x5497('0x64')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x88')]||_0x2c58e6);}if(_0x5cddbc['joins']){_0x5cddbc[_0x5497('0x75')]=JSON['parse'](_0x5cddbc[_0x5497('0x75')]);for(var _0x261804=0x0;_0x261804<_0x5cddbc[_0x5497('0x75')]['length'];_0x261804+=0x1){if(_0x5cddbc[_0x5497('0x75')][_0x261804]['type']&&_['includes'](_0x401f04,_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')])&&_0x5cddbc['joins'][_0x261804][_0x5497('0x77')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]){_0x300f3e[_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')]](_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],null,util['format'](_0x5497('0x89'),_0x5cddbc[_0x5497('0x6d')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x77')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]));}}}if(_0x5cddbc[_0x5497('0x7a')]){_0x5cddbc[_0x5497('0x7a')]=JSON[_0x5497('0x7b')](_0x5cddbc[_0x5497('0x7a')]);_0x300f3e[_0x5497('0x3d')](_0x2fd2e3(_0x5cddbc[_0x5497('0x7a')][_0x5497('0x63')]));}_0x4f9228=_0x300f3e[_0x5497('0xa6')]();_0x300f3e[_0x5497('0x20')](_0x494cc3);_0x300f3e[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')]('Limited\x20Query:',_0x300f3e[_0x5497('0x99')]());return dbH[_0x5497('0x7e')]['query'](_0x300f3e['toString'](),{'type':dbH[_0x5497('0x7e')]['QueryTypes'][_0x5497('0x80')]});}})[_0x5497('0x25')](function(){return{'sql':_0x4f9228[_0x5497('0x99')]()};})[_0x5497('0x25')](respondWithResult(_0xfba062,null))[_0x5497('0x47')](handleError(_0xfba062,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 6832c46..268d4d2 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 _0xdb5a=['path','rimraf','./analyticDefaultReport.attributes','exports','define','util','api','bluebird','request-promise'];(function(_0x3f00ee,_0x1d1673){var _0x18a07e=function(_0x4dad57){while(--_0x4dad57){_0x3f00ee['push'](_0x3f00ee['shift']());}};_0x18a07e(++_0x1d1673);}(_0xdb5a,0x1d0));var _0xadb5=function(_0x1ca804,_0x2a0925){_0x1ca804=_0x1ca804-0x0;var _0x2fc5bf=_0xdb5a[_0x1ca804];return _0x2fc5bf;};'use strict';var _=require('lodash');var util=require(_0xadb5('0x0'));var logger=require('../../config/logger')(_0xadb5('0x1'));var moment=require('moment');var BPromise=require(_0xadb5('0x2'));var rp=require(_0xadb5('0x3'));var fs=require('fs');var path=require(_0xadb5('0x4'));var rimraf=require(_0xadb5('0x5'));var config=require('../../config/environment');var attributes=require(_0xadb5('0x6'));module[_0xadb5('0x7')]=function(_0x3f0728,_0x594c43){return _0x3f0728[_0xadb5('0x8')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc8a1=['request-promise','path','../../config/environment','./analyticDefaultReport.attributes','exports','lodash','../../config/logger','api','moment'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0xc8a1,0x8c));var _0x1c8a=function(_0x32ec2e,_0x3d423f){_0x32ec2e=_0x32ec2e-0x0;var _0x28e955=_0xc8a1[_0x32ec2e];return _0x28e955;};'use strict';var _=require(_0x1c8a('0x0'));var util=require('util');var logger=require(_0x1c8a('0x1'))(_0x1c8a('0x2'));var moment=require(_0x1c8a('0x3'));var BPromise=require('bluebird');var rp=require(_0x1c8a('0x4'));var fs=require('fs');var path=require(_0x1c8a('0x5'));var rimraf=require('rimraf');var config=require(_0x1c8a('0x6'));var attributes=require(_0x1c8a('0x7'));module[_0x1c8a('0x8')]=function(_0x405b73,_0x161ed4){return _0x405b73['define']('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 14c2aae..95e4179 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 _0x92a0=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x5506cd,_0x1f1fc1){var _0x3be516=function(_0x492c42){while(--_0x492c42){_0x5506cd['push'](_0x5506cd['shift']());}};_0x3be516(++_0x1f1fc1);}(_0x92a0,0x1c6));var _0x092a=function(_0xa0be1c,_0x152d5d){_0xa0be1c=_0xa0be1c-0x0;var _0x546eec=_0x92a0[_0xa0be1c];return _0x546eec;};'use strict';var _=require(_0x092a('0x0'));var util=require(_0x092a('0x1'));var moment=require(_0x092a('0x2'));var BPromise=require('bluebird');var rs=require(_0x092a('0x3'));var fs=require('fs');var Redis=require(_0x092a('0x4'));var db=require(_0x092a('0x5'))['db'];var utils=require(_0x092a('0x6'));var logger=require('../../config/logger')(_0x092a('0x7'));var config=require(_0x092a('0x8'));var jayson=require(_0x092a('0x9'));var client=jayson[_0x092a('0xa')][_0x092a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x272931,_0x57dbef,_0x330d04){return new BPromise(function(_0x50a109,_0x4f149f){return client[_0x092a('0xc')](_0x272931,_0x330d04)['then'](function(_0x5607d6){logger['info'](_0x092a('0xd'),_0x57dbef,_0x092a('0xe'));logger[_0x092a('0xf')](_0x092a('0x10'),_0x57dbef,_0x092a('0xe'),JSON[_0x092a('0x11')](_0x5607d6));if(_0x5607d6[_0x092a('0x12')]){if(_0x5607d6[_0x092a('0x12')][_0x092a('0x13')]===0x1f4){logger[_0x092a('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x57dbef,_0x5607d6[_0x092a('0x12')][_0x092a('0x14')]);return _0x4f149f(_0x5607d6['error'][_0x092a('0x14')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x57dbef,_0x5607d6[_0x092a('0x12')][_0x092a('0x14')]);return _0x50a109(_0x5607d6[_0x092a('0x12')][_0x092a('0x14')]);}else{logger[_0x092a('0x15')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x57dbef,'request\x20sent');_0x50a109(_0x5607d6[_0x092a('0x16')][_0x092a('0x14')]);}})['catch'](function(_0xd921f9){logger[_0x092a('0x12')](_0x092a('0xd'),_0x57dbef,_0xd921f9);_0x4f149f(_0xd921f9);});});}
\ No newline at end of file
+var _0xbd53=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','request','then','info','request\x20sent','debug','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','catch'];(function(_0x122cc1,_0x5c956e){var _0x1e33af=function(_0x949b75){while(--_0x949b75){_0x122cc1['push'](_0x122cc1['shift']());}};_0x1e33af(++_0x5c956e);}(_0xbd53,0x93));var _0x3bd5=function(_0x19c6d7,_0x243cf6){_0x19c6d7=_0x19c6d7-0x0;var _0x5d3fac=_0xbd53[_0x19c6d7];return _0x5d3fac;};'use strict';var _=require(_0x3bd5('0x0'));var util=require(_0x3bd5('0x1'));var moment=require(_0x3bd5('0x2'));var BPromise=require(_0x3bd5('0x3'));var rs=require(_0x3bd5('0x4'));var fs=require('fs');var Redis=require(_0x3bd5('0x5'));var db=require(_0x3bd5('0x6'))['db'];var utils=require(_0x3bd5('0x7'));var logger=require('../../config/logger')(_0x3bd5('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3bd5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc11c08,_0x282cb7,_0x1d4cf5){return new BPromise(function(_0x45ce90,_0x59c4e7){return client[_0x3bd5('0xa')](_0xc11c08,_0x1d4cf5)[_0x3bd5('0xb')](function(_0x2ebe4a){logger[_0x3bd5('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x282cb7,_0x3bd5('0xd'));logger[_0x3bd5('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x282cb7,_0x3bd5('0xd'),JSON[_0x3bd5('0xf')](_0x2ebe4a));if(_0x2ebe4a[_0x3bd5('0x10')]){if(_0x2ebe4a[_0x3bd5('0x10')][_0x3bd5('0x11')]===0x1f4){logger[_0x3bd5('0x10')](_0x3bd5('0x12'),_0x282cb7,_0x2ebe4a[_0x3bd5('0x10')][_0x3bd5('0x13')]);return _0x59c4e7(_0x2ebe4a['error'][_0x3bd5('0x13')]);}logger[_0x3bd5('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x282cb7,_0x2ebe4a[_0x3bd5('0x10')][_0x3bd5('0x13')]);return _0x45ce90(_0x2ebe4a['error']['message']);}else{logger['info'](_0x3bd5('0x12'),_0x282cb7,'request\x20sent');_0x45ce90(_0x2ebe4a['result'][_0x3bd5('0x13')]);}})[_0x3bd5('0x14')](function(_0x25f18f){logger[_0x3bd5('0x10')](_0x3bd5('0x12'),_0x282cb7,_0x25f18f);_0x59c4e7(_0x25f18f);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 71756d5..92ec258 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 _0x19f4=['../../components/auth/service','./analyticDefaultReport.controller','isAuthenticated','get','/:id','show','/:id/preview','/:id/run','run','/:id/query','query','post','create','put','update','destroy','multer','util','path','connect-timeout','Router'];(function(_0x18032f,_0x4f4e45){var _0xb0b2b8=function(_0x563262){while(--_0x563262){_0x18032f['push'](_0x18032f['shift']());}};_0xb0b2b8(++_0x4f4e45);}(_0x19f4,0x10c));var _0x419f=function(_0x2d3154,_0xf911c9){_0x2d3154=_0x2d3154-0x0;var _0x30196e=_0x19f4[_0x2d3154];return _0x30196e;};'use strict';var multer=require(_0x419f('0x0'));var util=require(_0x419f('0x1'));var path=require(_0x419f('0x2'));var timeout=require(_0x419f('0x3'));var express=require('express');var router=express[_0x419f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x419f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x419f('0x6'));router['get']('/',auth[_0x419f('0x7')](),controller['index']);router[_0x419f('0x8')](_0x419f('0x9'),auth[_0x419f('0x7')](),controller[_0x419f('0xa')]);router['get'](_0x419f('0xb'),auth['isAuthenticated'](),controller['preview']);router[_0x419f('0x8')](_0x419f('0xc'),auth[_0x419f('0x7')](),controller[_0x419f('0xd')]);router[_0x419f('0x8')](_0x419f('0xe'),auth['isAuthenticated'](),controller[_0x419f('0xf')]);router[_0x419f('0x10')]('/',auth[_0x419f('0x7')](),controller[_0x419f('0x11')]);router[_0x419f('0x12')](_0x419f('0x9'),auth[_0x419f('0x7')](),controller[_0x419f('0x13')]);router['delete'](_0x419f('0x9'),auth[_0x419f('0x7')](),controller[_0x419f('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x33a7=['/:id/run','run','/:id/query','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','get','/:id/preview'];(function(_0x41be9f,_0x123958){var _0x459a7b=function(_0x49170f){while(--_0x49170f){_0x41be9f['push'](_0x41be9f['shift']());}};_0x459a7b(++_0x123958);}(_0x33a7,0x77));var _0x733a=function(_0x1df473,_0x1a6931){_0x1df473=_0x1df473-0x0;var _0x1bdd49=_0x33a7[_0x1df473];return _0x1bdd49;};'use strict';var multer=require(_0x733a('0x0'));var util=require(_0x733a('0x1'));var path=require('path');var timeout=require(_0x733a('0x2'));var express=require(_0x733a('0x3'));var router=express[_0x733a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x733a('0x5'));var config=require(_0x733a('0x6'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0x733a('0x7')](),controller[_0x733a('0x8')]);router['get'](_0x733a('0x9'),auth[_0x733a('0x7')](),controller[_0x733a('0xa')]);router[_0x733a('0xb')](_0x733a('0xc'),auth[_0x733a('0x7')](),controller['preview']);router[_0x733a('0xb')](_0x733a('0xd'),auth['isAuthenticated'](),controller[_0x733a('0xe')]);router['get'](_0x733a('0xf'),auth[_0x733a('0x7')](),controller['query']);router[_0x733a('0x10')]('/',auth[_0x733a('0x7')](),controller[_0x733a('0x11')]);router[_0x733a('0x12')](_0x733a('0x9'),auth[_0x733a('0x7')](),controller[_0x733a('0x13')]);router['delete'](_0x733a('0x9'),auth[_0x733a('0x7')](),controller[_0x733a('0x14')]);module[_0x733a('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index eaa54cc..f7846ae 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 _0x4722=['manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','Loading'];(function(_0x322e53,_0x12446f){var _0x3e19ab=function(_0x2bb848){while(--_0x2bb848){_0x322e53['push'](_0x322e53['shift']());}};_0x3e19ab(++_0x12446f);}(_0x4722,0x18a));var _0x2472=function(_0x4cdb9b,_0x9800cf){_0x4cdb9b=_0x4cdb9b-0x0;var _0x46cfa4=_0x4722[_0x4cdb9b];return _0x46cfa4;};'use strict';var Sequelize=require(_0x2472('0x0'));var moment=require(_0x2472('0x1'));module[_0x2472('0x2')]={'name':{'type':Sequelize[_0x2472('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x2472('0x4')](_0x2472('0x5'),_0x2472('0x6'),_0x2472('0x7')),'allowNull':![],'defaultValue':_0x2472('0x5')},'savename':{'type':Sequelize[_0x2472('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x2472('0x3')],'defaultValue':_0x2472('0x8')},'type':{'type':Sequelize[_0x2472('0x4')](_0x2472('0x9'),_0x2472('0xa')),'allowNull':![],'defaultValue':_0x2472('0x9')},'reportId':{'type':Sequelize[_0x2472('0xb')](0xb)[_0x2472('0xc')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x5cdc=['sequelize','moment','STRING','ENUM','csv','xlsx','DATE','Loading','manual','INTEGER','UNSIGNED'];(function(_0x48c583,_0x30a7b8){var _0x357851=function(_0x4e573d){while(--_0x4e573d){_0x48c583['push'](_0x48c583['shift']());}};_0x357851(++_0x30a7b8);}(_0x5cdc,0x1d9));var _0xc5cd=function(_0x197065,_0x2e79d0){_0x197065=_0x197065-0x0;var _0x3d9404=_0x5cdc[_0x197065];return _0x3d9404;};'use strict';var Sequelize=require(_0xc5cd('0x0'));var moment=require(_0xc5cd('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xc5cd('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xc5cd('0x3')](_0xc5cd('0x4'),'pdf',_0xc5cd('0x5')),'allowNull':![],'defaultValue':_0xc5cd('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xc5cd('0x6')]},'endDate':{'type':Sequelize[_0xc5cd('0x6')]},'status':{'type':Sequelize[_0xc5cd('0x2')],'defaultValue':_0xc5cd('0x7')},'type':{'type':Sequelize[_0xc5cd('0x3')](_0xc5cd('0x8'),'scheduled'),'allowNull':![],'defaultValue':_0xc5cd('0x8')},'reportId':{'type':Sequelize[_0xc5cd('0x9')](0xb)[_0xc5cd('0xa')]},'reportType':{'type':Sequelize[_0xc5cd('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index f33b071..8c3012d 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 _0x5d89=['path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','end','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','format','%s.%s','eml-format','rimraf','request-promise','moment','mustache','util'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5d89,0x1e9));var _0x95d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d89[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x95d8('0x0'));var rimraf=require(_0x95d8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x95d8('0x2'));var moment=require(_0x95d8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x95d8('0x4'));var util=require(_0x95d8('0x5'));var path=require(_0x95d8('0x6'));var sox=require(_0x95d8('0x7'));var csv=require(_0x95d8('0x8'));var ejs=require(_0x95d8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x95d8('0xa'));var squel=require(_0x95d8('0xb'));var crypto=require(_0x95d8('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x95d8('0x8'));var querystring=require(_0x95d8('0xd'));var Papa=require(_0x95d8('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x95d8('0xf'));var as=require(_0x95d8('0x10'));var hardwareService=require(_0x95d8('0x11'));var logger=require(_0x95d8('0x12'))('api');var utils=require(_0x95d8('0x13'));var config=require(_0x95d8('0x14'));var licenseUtil=require(_0x95d8('0x15'));var db=require(_0x95d8('0x16'))['db'];function respondWithStatusCode(_0x4e9972,_0x5cf2fe){_0x5cf2fe=_0x5cf2fe||0xcc;return function(_0x255382){if(_0x255382){return _0x4e9972['sendStatus'](_0x5cf2fe);}return _0x4e9972['status'](_0x5cf2fe)['end']();};}function respondWithResult(_0x23ede8,_0x4adc31){_0x4adc31=_0x4adc31||0xc8;return function(_0x2326bb){if(_0x2326bb){return _0x23ede8[_0x95d8('0x17')](_0x4adc31)[_0x95d8('0x18')](_0x2326bb);}};}function respondWithFilteredResult(_0x52a119,_0x1b3f26){return function(_0x275a83){if(_0x275a83){var _0x4850c2=typeof _0x1b3f26[_0x95d8('0x19')]===_0x95d8('0x1a')&&typeof _0x1b3f26['limit']===_0x95d8('0x1a');var _0x17f69d=_0x275a83['count'];var _0x14f9ff=_0x4850c2?0x0:_0x1b3f26[_0x95d8('0x19')];var _0x4ab61e=_0x4850c2?_0x275a83[_0x95d8('0x1b')]:_0x1b3f26[_0x95d8('0x19')]+_0x1b3f26[_0x95d8('0x1c')];var _0x286e57;if(_0x4ab61e>=_0x17f69d){_0x4ab61e=_0x17f69d;_0x286e57=0xc8;}else{_0x286e57=0xce;}_0x52a119[_0x95d8('0x17')](_0x286e57);return _0x52a119[_0x95d8('0x1d')](_0x95d8('0x1e'),_0x14f9ff+'-'+_0x4ab61e+'/'+_0x17f69d)[_0x95d8('0x18')](_0x275a83);}return null;};}function patchUpdates(_0x45a763){return function(_0x49d9da){try{jsonpatch[_0x95d8('0x1f')](_0x49d9da,_0x45a763,!![]);}catch(_0x10b11f){return BPromise[_0x95d8('0x20')](_0x10b11f);}return _0x49d9da[_0x95d8('0x21')]();};}function saveUpdates(_0x1b9735,_0x7e0444){return function(_0x502c58){if(_0x502c58){return _0x502c58[_0x95d8('0x22')](_0x1b9735)[_0x95d8('0x23')](function(_0x276e18){return _0x276e18;});}return null;};}function removeEntity(_0x3ed960,_0x6ea91b){return function(_0x900539){if(_0x900539){return _0x900539[_0x95d8('0x24')]()['then'](function(){var _0x78ad19=_0x900539[_0x95d8('0x25')]({'plain':!![]});var _0x1996ca='ExtractedReports';return db['UserProfileResource'][_0x95d8('0x24')]({'where':{'type':_0x1996ca,'resourceId':_0x78ad19['id']}})[_0x95d8('0x23')](function(){return _0x900539;});})[_0x95d8('0x23')](function(){_0x3ed960['status'](0xcc)[_0x95d8('0x26')]();});}};}function handleEntityNotFound(_0x54fa64,_0x2ba6d9){return function(_0x1a1dbc){if(!_0x1a1dbc){_0x54fa64[_0x95d8('0x27')](0x194);}return _0x1a1dbc;};}function handleError(_0x5b28da,_0x194e54){_0x194e54=_0x194e54||0x1f4;return function(_0x7cfc74){logger[_0x95d8('0x28')](_0x7cfc74[_0x95d8('0x29')]);if(_0x7cfc74[_0x95d8('0x2a')]){delete _0x7cfc74[_0x95d8('0x2a')];}_0x5b28da[_0x95d8('0x17')](_0x194e54)[_0x95d8('0x2b')](_0x7cfc74);};}exports[_0x95d8('0x2c')]=function(_0xe9b10e,_0x4c981e){var _0x20fe0b={},_0x228d65={},_0x36977e={'count':0x0,'rows':[]};var _0xfcfd00=_[_0x95d8('0x2d')](db[_0x95d8('0x2e')][_0x95d8('0x2f')],function(_0x1fe92f){return{'name':_0x1fe92f[_0x95d8('0x30')],'type':_0x1fe92f[_0x95d8('0x31')][_0x95d8('0x32')]};});_0x228d65[_0x95d8('0x33')]=_[_0x95d8('0x2d')](_0xfcfd00,'name');_0x228d65[_0x95d8('0x34')]=_[_0x95d8('0x35')](_0xe9b10e[_0x95d8('0x34')]);_0x228d65['filters']=_[_0x95d8('0x36')](_0x228d65[_0x95d8('0x33')],_0x228d65[_0x95d8('0x34')]);_0x20fe0b['attributes']=_[_0x95d8('0x36')](_0x228d65[_0x95d8('0x33')],qs[_0x95d8('0x37')](_0xe9b10e[_0x95d8('0x34')]['fields']));_0x20fe0b[_0x95d8('0x38')]=_0x20fe0b[_0x95d8('0x38')][_0x95d8('0x39')]?_0x20fe0b[_0x95d8('0x38')]:_0x228d65[_0x95d8('0x33')];if(!_0xe9b10e['query']['hasOwnProperty'](_0x95d8('0x3a'))){_0x20fe0b[_0x95d8('0x1c')]=qs[_0x95d8('0x1c')](_0xe9b10e[_0x95d8('0x34')]['limit']);_0x20fe0b[_0x95d8('0x19')]=qs[_0x95d8('0x19')](_0xe9b10e['query']['offset']);}_0x20fe0b[_0x95d8('0x3b')]=qs[_0x95d8('0x3c')](_0xe9b10e[_0x95d8('0x34')][_0x95d8('0x3c')]);_0x20fe0b[_0x95d8('0x3d')]=qs[_0x95d8('0x3e')](_['pick'](_0xe9b10e[_0x95d8('0x34')],_0x228d65['filters']),_0xfcfd00);if(_0xe9b10e[_0x95d8('0x34')][_0x95d8('0x3f')]){_0x20fe0b[_0x95d8('0x3d')]=_[_0x95d8('0x40')](_0x20fe0b[_0x95d8('0x3d')],{'$or':_['map'](_0xfcfd00,function(_0x6653d0){if(_0x6653d0[_0x95d8('0x31')]!==_0x95d8('0x41')){var _0x1c38e9={};_0x1c38e9[_0x6653d0['name']]={'$like':'%'+_0xe9b10e[_0x95d8('0x34')][_0x95d8('0x3f')]+'%'};return _0x1c38e9;}})});}_0x20fe0b=_[_0x95d8('0x40')]({},_0x20fe0b,_0xe9b10e[_0x95d8('0x42')]);var _0x501fde={'where':_0x20fe0b['where']};return db[_0x95d8('0x2e')][_0x95d8('0x1b')](_0x501fde)[_0x95d8('0x23')](function(_0x3effbf){_0x36977e[_0x95d8('0x1b')]=_0x3effbf;if(_0xe9b10e[_0x95d8('0x34')]['includeAll']){_0x20fe0b[_0x95d8('0x43')]=[{'all':!![]}];}return db[_0x95d8('0x2e')][_0x95d8('0x44')](_0x20fe0b);})[_0x95d8('0x23')](function(_0x4fc463){_0x36977e[_0x95d8('0x45')]=_0x4fc463;return _0x36977e;})[_0x95d8('0x23')](respondWithFilteredResult(_0x4c981e,_0x20fe0b))[_0x95d8('0x46')](handleError(_0x4c981e,null));};exports[_0x95d8('0x47')]=function(_0x2612be,_0x1d5f1a){var _0x5dcc49={'raw':!![],'where':{'id':_0x2612be[_0x95d8('0x48')]['id']}},_0x222d11={};_0x222d11[_0x95d8('0x33')]=_['keys'](db[_0x95d8('0x2e')]['rawAttributes']);_0x222d11[_0x95d8('0x34')]=_[_0x95d8('0x35')](_0x2612be[_0x95d8('0x34')]);_0x222d11['filters']=_[_0x95d8('0x36')](_0x222d11[_0x95d8('0x33')],_0x222d11[_0x95d8('0x34')]);_0x5dcc49['attributes']=_[_0x95d8('0x36')](_0x222d11[_0x95d8('0x33')],qs['fields'](_0x2612be['query']['fields']));_0x5dcc49['attributes']=_0x5dcc49[_0x95d8('0x38')]['length']?_0x5dcc49[_0x95d8('0x38')]:_0x222d11[_0x95d8('0x33')];if(_0x2612be[_0x95d8('0x34')][_0x95d8('0x49')]){_0x5dcc49['include']=[{'all':!![]}];}_0x5dcc49=_[_0x95d8('0x40')]({},_0x5dcc49,_0x2612be[_0x95d8('0x42')]);return db[_0x95d8('0x2e')][_0x95d8('0x4a')](_0x5dcc49)[_0x95d8('0x23')](handleEntityNotFound(_0x1d5f1a,null))[_0x95d8('0x23')](respondWithResult(_0x1d5f1a,null))[_0x95d8('0x46')](handleError(_0x1d5f1a,null));};exports[_0x95d8('0x4b')]=function(_0x51b159,_0x29f6a5){return db['AnalyticExtractedReport'][_0x95d8('0x4b')](_0x51b159[_0x95d8('0x4c')],{})[_0x95d8('0x23')](function(_0x3e340e){var _0x47e252=_0x51b159[_0x95d8('0x4d')][_0x95d8('0x25')]({'plain':!![]});if(!_0x47e252)throw new Error(_0x95d8('0x4e'));if(_0x47e252[_0x95d8('0x4f')]===_0x95d8('0x4d')){var _0x4b4de7=_0x3e340e['get']({'plain':!![]});var _0x1a2a20=_0x95d8('0x50');return db['UserProfileSection'][_0x95d8('0x4a')]({'where':{'name':_0x1a2a20,'userProfileId':_0x47e252[_0x95d8('0x51')]},'raw':!![]})['then'](function(_0x17b185){if(_0x17b185&&_0x17b185[_0x95d8('0x52')]===0x0){return db[_0x95d8('0x53')][_0x95d8('0x4b')]({'name':_0x4b4de7[_0x95d8('0x2a')],'resourceId':_0x4b4de7['id'],'type':_0x17b185[_0x95d8('0x2a')],'sectionId':_0x17b185['id']},{})[_0x95d8('0x23')](function(){return _0x3e340e;});}else{return _0x3e340e;}})[_0x95d8('0x46')](function(_0x5ba290){logger[_0x95d8('0x28')](_0x95d8('0x54'),_0x5ba290);throw _0x5ba290;});}return _0x3e340e;})['then'](respondWithResult(_0x29f6a5,0xc9))[_0x95d8('0x46')](handleError(_0x29f6a5,null));};exports[_0x95d8('0x22')]=function(_0x43309c,_0x397f07){if(_0x43309c[_0x95d8('0x4c')]['id']){delete _0x43309c[_0x95d8('0x4c')]['id'];}return db[_0x95d8('0x2e')][_0x95d8('0x4a')]({'where':{'id':_0x43309c[_0x95d8('0x48')]['id']}})[_0x95d8('0x23')](handleEntityNotFound(_0x397f07,null))[_0x95d8('0x23')](saveUpdates(_0x43309c[_0x95d8('0x4c')],null))['then'](respondWithResult(_0x397f07,null))[_0x95d8('0x46')](handleError(_0x397f07,null));};exports[_0x95d8('0x24')]=function(_0x4caf8b,_0x433ba6){return db[_0x95d8('0x2e')][_0x95d8('0x4a')]({'where':{'id':_0x4caf8b['params']['id']}})[_0x95d8('0x23')](handleEntityNotFound(_0x433ba6,null))['then'](removeEntity(_0x433ba6,null))[_0x95d8('0x46')](handleError(_0x433ba6,null));};exports[_0x95d8('0x55')]=function(_0x155073,_0x67f929,_0xbfeeb5){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x155073[_0x95d8('0x48')]['id']},'attributes':[_0x95d8('0x2a'),_0x95d8('0x56'),_0x95d8('0x57'),_0x95d8('0x58')],'raw':!![]})[_0x95d8('0x23')](handleEntityNotFound(_0x67f929,null))[_0x95d8('0x23')](function(_0x101e74){if(_0x101e74){if(!fs[_0x95d8('0x59')](path['join'](config[_0x95d8('0x5a')],_0x95d8('0x5b'),_0x101e74[_0x95d8('0x57')]))){throw new db[(_0x95d8('0x5c'))][(_0x95d8('0x5d'))](_0x95d8('0x5e'));}if(_0x155073[_0x95d8('0x34')][_0x95d8('0x5f')]){return _0x67f929[_0x95d8('0x27')](0xc8);}return _0x67f929['download'](path[_0x95d8('0x60')](config[_0x95d8('0x5a')],'server/files/reports',_0x101e74[_0x95d8('0x57')]),util[_0x95d8('0x61')](_0x95d8('0x62'),_0x101e74['basename']||_0x101e74[_0x95d8('0x2a')],_0x101e74[_0x95d8('0x58')]['toLowerCase']()));}})[_0x95d8('0x46')](handleError(_0x67f929,null));};
\ No newline at end of file
+var _0xb0f0=['json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','get','ExtractedReports','destroy','stack','name','index','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','existsSync','join','root','server/files/reports','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','format','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end'];(function(_0x162722,_0x37e4e3){var _0x35e975=function(_0x5e3114){while(--_0x5e3114){_0x162722['push'](_0x162722['shift']());}};_0x35e975(++_0x37e4e3);}(_0xb0f0,0xa1));var _0x0b0f=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xb0f0[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x0b0f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0b0f('0x1'));var jsonpatch=require(_0x0b0f('0x2'));var rp=require(_0x0b0f('0x3'));var moment=require(_0x0b0f('0x4'));var BPromise=require(_0x0b0f('0x5'));var Mustache=require(_0x0b0f('0x6'));var util=require(_0x0b0f('0x7'));var path=require('path');var sox=require(_0x0b0f('0x8'));var csv=require(_0x0b0f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0b0f('0xa'));var squel=require(_0x0b0f('0xb'));var crypto=require(_0x0b0f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0b0f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0b0f('0xe'));var Papa=require(_0x0b0f('0xf'));var Redis=require(_0x0b0f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0b0f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0b0f('0x12'));var logger=require(_0x0b0f('0x13'))(_0x0b0f('0x14'));var utils=require('../../config/utils');var config=require(_0x0b0f('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2596c4,_0x5df073){_0x5df073=_0x5df073||0xcc;return function(_0x5a06bc){if(_0x5a06bc){return _0x2596c4[_0x0b0f('0x16')](_0x5df073);}return _0x2596c4[_0x0b0f('0x17')](_0x5df073)[_0x0b0f('0x18')]();};}function respondWithResult(_0x4a7b6c,_0x59c1cb){_0x59c1cb=_0x59c1cb||0xc8;return function(_0x3b2b5b){if(_0x3b2b5b){return _0x4a7b6c[_0x0b0f('0x17')](_0x59c1cb)[_0x0b0f('0x19')](_0x3b2b5b);}};}function respondWithFilteredResult(_0x3dc31d,_0x27e4a4){return function(_0x399e15){if(_0x399e15){var _0x5c7f82=typeof _0x27e4a4[_0x0b0f('0x1a')]==='undefined'&&typeof _0x27e4a4['limit']===_0x0b0f('0x1b');var _0x4bf3db=_0x399e15[_0x0b0f('0x1c')];var _0x3325aa=_0x5c7f82?0x0:_0x27e4a4['offset'];var _0x528c7f=_0x5c7f82?_0x399e15[_0x0b0f('0x1c')]:_0x27e4a4[_0x0b0f('0x1a')]+_0x27e4a4[_0x0b0f('0x1d')];var _0x543178;if(_0x528c7f>=_0x4bf3db){_0x528c7f=_0x4bf3db;_0x543178=0xc8;}else{_0x543178=0xce;}_0x3dc31d[_0x0b0f('0x17')](_0x543178);return _0x3dc31d[_0x0b0f('0x1e')](_0x0b0f('0x1f'),_0x3325aa+'-'+_0x528c7f+'/'+_0x4bf3db)['json'](_0x399e15);}return null;};}function patchUpdates(_0x5cfddd){return function(_0x42b16a){try{jsonpatch[_0x0b0f('0x20')](_0x42b16a,_0x5cfddd,!![]);}catch(_0x24c8c1){return BPromise['reject'](_0x24c8c1);}return _0x42b16a[_0x0b0f('0x21')]();};}function saveUpdates(_0x3b6e3d,_0x2e4bf4){return function(_0x28a41e){if(_0x28a41e){return _0x28a41e[_0x0b0f('0x22')](_0x3b6e3d)[_0x0b0f('0x23')](function(_0x412b2a){return _0x412b2a;});}return null;};}function removeEntity(_0x38bf11,_0xbb0b1b){return function(_0x5cd30c){if(_0x5cd30c){return _0x5cd30c['destroy']()[_0x0b0f('0x23')](function(){var _0x80ed25=_0x5cd30c[_0x0b0f('0x24')]({'plain':!![]});var _0x2d9ad5=_0x0b0f('0x25');return db['UserProfileResource'][_0x0b0f('0x26')]({'where':{'type':_0x2d9ad5,'resourceId':_0x80ed25['id']}})['then'](function(){return _0x5cd30c;});})['then'](function(){_0x38bf11[_0x0b0f('0x17')](0xcc)[_0x0b0f('0x18')]();});}};}function handleEntityNotFound(_0x54d1fe,_0x3214b4){return function(_0x2982b8){if(!_0x2982b8){_0x54d1fe[_0x0b0f('0x16')](0x194);}return _0x2982b8;};}function handleError(_0x499a02,_0x10ffb7){_0x10ffb7=_0x10ffb7||0x1f4;return function(_0x1e4158){logger['error'](_0x1e4158[_0x0b0f('0x27')]);if(_0x1e4158[_0x0b0f('0x28')]){delete _0x1e4158[_0x0b0f('0x28')];}_0x499a02[_0x0b0f('0x17')](_0x10ffb7)['send'](_0x1e4158);};}exports[_0x0b0f('0x29')]=function(_0x59b674,_0x377987){var _0x3aa65f={},_0x3e689f={},_0x801624={'count':0x0,'rows':[]};var _0x47b60d=_['map'](db[_0x0b0f('0x2a')][_0x0b0f('0x2b')],function(_0x685894){return{'name':_0x685894[_0x0b0f('0x2c')],'type':_0x685894[_0x0b0f('0x2d')][_0x0b0f('0x2e')]};});_0x3e689f[_0x0b0f('0x2f')]=_[_0x0b0f('0x30')](_0x47b60d,_0x0b0f('0x28'));_0x3e689f[_0x0b0f('0x31')]=_[_0x0b0f('0x32')](_0x59b674[_0x0b0f('0x31')]);_0x3e689f[_0x0b0f('0x33')]=_[_0x0b0f('0x34')](_0x3e689f[_0x0b0f('0x2f')],_0x3e689f['query']);_0x3aa65f[_0x0b0f('0x35')]=_[_0x0b0f('0x34')](_0x3e689f[_0x0b0f('0x2f')],qs['fields'](_0x59b674[_0x0b0f('0x31')][_0x0b0f('0x36')]));_0x3aa65f[_0x0b0f('0x35')]=_0x3aa65f['attributes'][_0x0b0f('0x37')]?_0x3aa65f[_0x0b0f('0x35')]:_0x3e689f[_0x0b0f('0x2f')];if(!_0x59b674[_0x0b0f('0x31')][_0x0b0f('0x38')](_0x0b0f('0x39'))){_0x3aa65f[_0x0b0f('0x1d')]=qs['limit'](_0x59b674['query'][_0x0b0f('0x1d')]);_0x3aa65f[_0x0b0f('0x1a')]=qs[_0x0b0f('0x1a')](_0x59b674[_0x0b0f('0x31')]['offset']);}_0x3aa65f[_0x0b0f('0x3a')]=qs['sort'](_0x59b674['query'][_0x0b0f('0x3b')]);_0x3aa65f[_0x0b0f('0x3c')]=qs[_0x0b0f('0x33')](_['pick'](_0x59b674['query'],_0x3e689f[_0x0b0f('0x33')]),_0x47b60d);if(_0x59b674[_0x0b0f('0x31')][_0x0b0f('0x3d')]){_0x3aa65f[_0x0b0f('0x3c')]=_['merge'](_0x3aa65f[_0x0b0f('0x3c')],{'$or':_['map'](_0x47b60d,function(_0xcf122f){if(_0xcf122f[_0x0b0f('0x2d')]!=='VIRTUAL'){var _0x5d7624={};_0x5d7624[_0xcf122f[_0x0b0f('0x28')]]={'$like':'%'+_0x59b674[_0x0b0f('0x31')]['filter']+'%'};return _0x5d7624;}})});}_0x3aa65f=_[_0x0b0f('0x3e')]({},_0x3aa65f,_0x59b674['options']);var _0x32e74f={'where':_0x3aa65f[_0x0b0f('0x3c')]};return db['AnalyticExtractedReport']['count'](_0x32e74f)[_0x0b0f('0x23')](function(_0x4f3f42){_0x801624[_0x0b0f('0x1c')]=_0x4f3f42;if(_0x59b674[_0x0b0f('0x31')][_0x0b0f('0x3f')]){_0x3aa65f[_0x0b0f('0x40')]=[{'all':!![]}];}return db[_0x0b0f('0x2a')][_0x0b0f('0x41')](_0x3aa65f);})['then'](function(_0x53fb8e){_0x801624[_0x0b0f('0x42')]=_0x53fb8e;return _0x801624;})[_0x0b0f('0x23')](respondWithFilteredResult(_0x377987,_0x3aa65f))[_0x0b0f('0x43')](handleError(_0x377987,null));};exports[_0x0b0f('0x44')]=function(_0x8e69d0,_0x471dfd){var _0x4756af={'raw':!![],'where':{'id':_0x8e69d0[_0x0b0f('0x45')]['id']}},_0x2d7320={};_0x2d7320['model']=_[_0x0b0f('0x32')](db['AnalyticExtractedReport'][_0x0b0f('0x2b')]);_0x2d7320[_0x0b0f('0x31')]=_[_0x0b0f('0x32')](_0x8e69d0['query']);_0x2d7320[_0x0b0f('0x33')]=_[_0x0b0f('0x34')](_0x2d7320[_0x0b0f('0x2f')],_0x2d7320[_0x0b0f('0x31')]);_0x4756af['attributes']=_['intersection'](_0x2d7320[_0x0b0f('0x2f')],qs[_0x0b0f('0x36')](_0x8e69d0['query'][_0x0b0f('0x36')]));_0x4756af[_0x0b0f('0x35')]=_0x4756af['attributes']['length']?_0x4756af[_0x0b0f('0x35')]:_0x2d7320['model'];if(_0x8e69d0[_0x0b0f('0x31')]['includeAll']){_0x4756af[_0x0b0f('0x40')]=[{'all':!![]}];}_0x4756af=_[_0x0b0f('0x3e')]({},_0x4756af,_0x8e69d0[_0x0b0f('0x46')]);return db['AnalyticExtractedReport']['find'](_0x4756af)[_0x0b0f('0x23')](handleEntityNotFound(_0x471dfd,null))['then'](respondWithResult(_0x471dfd,null))['catch'](handleError(_0x471dfd,null));};exports[_0x0b0f('0x47')]=function(_0x4efd9f,_0x41e31a){return db[_0x0b0f('0x2a')][_0x0b0f('0x47')](_0x4efd9f[_0x0b0f('0x48')],{})[_0x0b0f('0x23')](function(_0x1d8012){var _0x304573=_0x4efd9f[_0x0b0f('0x49')]['get']({'plain':!![]});if(!_0x304573)throw new Error(_0x0b0f('0x4a'));if(_0x304573[_0x0b0f('0x4b')]===_0x0b0f('0x49')){var _0x4a7a6d=_0x1d8012['get']({'plain':!![]});var _0x20b85b=_0x0b0f('0x25');return db[_0x0b0f('0x4c')][_0x0b0f('0x4d')]({'where':{'name':_0x20b85b,'userProfileId':_0x304573[_0x0b0f('0x4e')]},'raw':!![]})['then'](function(_0x473600){if(_0x473600&&_0x473600['autoAssociation']===0x0){return db[_0x0b0f('0x4f')][_0x0b0f('0x47')]({'name':_0x4a7a6d[_0x0b0f('0x28')],'resourceId':_0x4a7a6d['id'],'type':_0x473600[_0x0b0f('0x28')],'sectionId':_0x473600['id']},{})[_0x0b0f('0x23')](function(){return _0x1d8012;});}else{return _0x1d8012;}})[_0x0b0f('0x43')](function(_0x21a187){logger['error'](_0x0b0f('0x50'),_0x21a187);throw _0x21a187;});}return _0x1d8012;})[_0x0b0f('0x23')](respondWithResult(_0x41e31a,0xc9))[_0x0b0f('0x43')](handleError(_0x41e31a,null));};exports['update']=function(_0x3f2e1c,_0x328c67){if(_0x3f2e1c[_0x0b0f('0x48')]['id']){delete _0x3f2e1c['body']['id'];}return db[_0x0b0f('0x2a')][_0x0b0f('0x4d')]({'where':{'id':_0x3f2e1c[_0x0b0f('0x45')]['id']}})[_0x0b0f('0x23')](handleEntityNotFound(_0x328c67,null))[_0x0b0f('0x23')](saveUpdates(_0x3f2e1c['body'],null))[_0x0b0f('0x23')](respondWithResult(_0x328c67,null))['catch'](handleError(_0x328c67,null));};exports[_0x0b0f('0x26')]=function(_0xe208e,_0x4de368){return db[_0x0b0f('0x2a')][_0x0b0f('0x4d')]({'where':{'id':_0xe208e['params']['id']}})[_0x0b0f('0x23')](handleEntityNotFound(_0x4de368,null))['then'](removeEntity(_0x4de368,null))[_0x0b0f('0x43')](handleError(_0x4de368,null));};exports[_0x0b0f('0x51')]=function(_0x22c273,_0x20dee4,_0x4c101b){return db[_0x0b0f('0x2a')][_0x0b0f('0x4d')]({'where':{'id':_0x22c273[_0x0b0f('0x45')]['id']},'attributes':[_0x0b0f('0x28'),_0x0b0f('0x52'),'savename',_0x0b0f('0x53')],'raw':!![]})[_0x0b0f('0x23')](handleEntityNotFound(_0x20dee4,null))[_0x0b0f('0x23')](function(_0x427d1b){if(_0x427d1b){if(!fs[_0x0b0f('0x54')](path[_0x0b0f('0x55')](config[_0x0b0f('0x56')],_0x0b0f('0x57'),_0x427d1b[_0x0b0f('0x58')]))){throw new db['Sequelize'][(_0x0b0f('0x59'))](_0x0b0f('0x5a'));}if(_0x22c273[_0x0b0f('0x31')]['exists']){return _0x20dee4['sendStatus'](0xc8);}return _0x20dee4[_0x0b0f('0x51')](path[_0x0b0f('0x55')](config[_0x0b0f('0x56')],_0x0b0f('0x57'),_0x427d1b[_0x0b0f('0x58')]),util[_0x0b0f('0x5b')]('%s.%s',_0x427d1b['basename']||_0x427d1b[_0x0b0f('0x28')],_0x427d1b['output'][_0x0b0f('0x5c')]()));}})['catch'](handleError(_0x20dee4,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index ecabe0b..b1f5dcf 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 _0x1790=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x4bd9bd,_0x2fd047){var _0x1ebbd5=function(_0x1b8304){while(--_0x1b8304){_0x4bd9bd['push'](_0x4bd9bd['shift']());}};_0x1ebbd5(++_0x2fd047);}(_0x1790,0xd0));var _0x0179=function(_0x544d9a,_0x1dd46e){_0x544d9a=_0x544d9a-0x0;var _0x31cb96=_0x1790[_0x544d9a];return _0x31cb96;};'use strict';var _=require(_0x0179('0x0'));var util=require('util');var logger=require(_0x0179('0x1'))(_0x0179('0x2'));var moment=require('moment');var BPromise=require(_0x0179('0x3'));var rp=require(_0x0179('0x4'));var fs=require('fs');var path=require(_0x0179('0x5'));var rimraf=require(_0x0179('0x6'));var config=require(_0x0179('0x7'));var attributes=require(_0x0179('0x8'));module[_0x0179('0x9')]=function(_0x48b7c7,_0x4c4e36){return _0x48b7c7[_0x0179('0xa')](_0x0179('0xb'),attributes,{'tableName':_0x0179('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8d95=['bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api','moment'];(function(_0x53cdd0,_0x295197){var _0x1c9e2a=function(_0x3c01c8){while(--_0x3c01c8){_0x53cdd0['push'](_0x53cdd0['shift']());}};_0x1c9e2a(++_0x295197);}(_0x8d95,0x125));var _0x58d9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8d95[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x58d9('0x0'));var util=require(_0x58d9('0x1'));var logger=require('../../config/logger')(_0x58d9('0x2'));var moment=require(_0x58d9('0x3'));var BPromise=require(_0x58d9('0x4'));var rp=require(_0x58d9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x58d9('0x6'));var config=require(_0x58d9('0x7'));var attributes=require(_0x58d9('0x8'));module['exports']=function(_0x5ed8e3,_0x2f03ad){return _0x5ed8e3['define'](_0x58d9('0x9'),attributes,{'tableName':_0x58d9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index f25a6e6..60b5b21 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 _0x9280=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x2e180b,_0x1b08c7){var _0x59e9bb=function(_0x341602){while(--_0x341602){_0x2e180b['push'](_0x2e180b['shift']());}};_0x59e9bb(++_0x1b08c7);}(_0x9280,0x113));var _0x0928=function(_0x178e27,_0x2dcbde){_0x178e27=_0x178e27-0x0;var _0x582375=_0x9280[_0x178e27];return _0x582375;};'use strict';var _=require(_0x0928('0x0'));var util=require(_0x0928('0x1'));var moment=require(_0x0928('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0928('0x3'));var db=require(_0x0928('0x4'))['db'];var utils=require(_0x0928('0x5'));var logger=require(_0x0928('0x6'))(_0x0928('0x7'));var config=require(_0x0928('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0928('0x9')][_0x0928('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51404f,_0x1c26c4,_0x47a28c){return new BPromise(function(_0x1f60a5,_0x47597d){return client['request'](_0x51404f,_0x47a28c)[_0x0928('0xb')](function(_0x15861b){logger['info'](_0x0928('0xc'),_0x1c26c4,'request\x20sent');logger[_0x0928('0xd')](_0x0928('0xe'),_0x1c26c4,_0x0928('0xf'),JSON[_0x0928('0x10')](_0x15861b));if(_0x15861b[_0x0928('0x11')]){if(_0x15861b[_0x0928('0x11')][_0x0928('0x12')]===0x1f4){logger[_0x0928('0x11')](_0x0928('0xc'),_0x1c26c4,_0x15861b[_0x0928('0x11')][_0x0928('0x13')]);return _0x47597d(_0x15861b[_0x0928('0x11')][_0x0928('0x13')]);}logger['error'](_0x0928('0xc'),_0x1c26c4,_0x15861b[_0x0928('0x11')][_0x0928('0x13')]);return _0x1f60a5(_0x15861b[_0x0928('0x11')][_0x0928('0x13')]);}else{logger['info'](_0x0928('0xc'),_0x1c26c4,_0x0928('0xf'));_0x1f60a5(_0x15861b['result'][_0x0928('0x13')]);}})['catch'](function(_0x3700d6){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1c26c4,_0x3700d6);_0x47597d(_0x3700d6);});});}
\ No newline at end of file
+var _0x1aab=['AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0x1aab,0x122));var _0xb1aa=function(_0x353144,_0x2d83ed){_0x353144=_0x353144-0x0;var _0x44e823=_0x1aab[_0x353144];return _0x44e823;};'use strict';var _=require(_0xb1aa('0x0'));var util=require(_0xb1aa('0x1'));var moment=require(_0xb1aa('0x2'));var BPromise=require('bluebird');var rs=require(_0xb1aa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb1aa('0x4'))['db'];var utils=require(_0xb1aa('0x5'));var logger=require(_0xb1aa('0x6'))(_0xb1aa('0x7'));var config=require(_0xb1aa('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb1aa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x277448,_0x13a350,_0x283ad6){return new BPromise(function(_0x3415f7,_0x405387){return client[_0xb1aa('0xa')](_0x277448,_0x283ad6)['then'](function(_0x12067d){logger[_0xb1aa('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x13a350,_0xb1aa('0xc'));logger[_0xb1aa('0xd')](_0xb1aa('0xe'),_0x13a350,_0xb1aa('0xc'),JSON[_0xb1aa('0xf')](_0x12067d));if(_0x12067d[_0xb1aa('0x10')]){if(_0x12067d[_0xb1aa('0x10')][_0xb1aa('0x11')]===0x1f4){logger[_0xb1aa('0x10')](_0xb1aa('0x12'),_0x13a350,_0x12067d[_0xb1aa('0x10')][_0xb1aa('0x13')]);return _0x405387(_0x12067d[_0xb1aa('0x10')][_0xb1aa('0x13')]);}logger[_0xb1aa('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x13a350,_0x12067d['error'][_0xb1aa('0x13')]);return _0x3415f7(_0x12067d['error'][_0xb1aa('0x13')]);}else{logger['info'](_0xb1aa('0x12'),_0x13a350,'request\x20sent');_0x3415f7(_0x12067d[_0xb1aa('0x14')]['message']);}})[_0xb1aa('0x15')](function(_0x408bf8){logger['error'](_0xb1aa('0x12'),_0x13a350,_0x408bf8);_0x405387(_0x408bf8);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 2c69491..a6ce12e 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 _0xf4e7=['Router','fs-extra','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x5b7b22,_0x5bc479){var _0x53dc9d=function(_0x5108c0){while(--_0x5108c0){_0x5b7b22['push'](_0x5b7b22['shift']());}};_0x53dc9d(++_0x5bc479);}(_0xf4e7,0x154));var _0x7f4e=function(_0x5f30b9,_0x196dad){_0x5f30b9=_0x5f30b9-0x0;var _0x3e8ee9=_0xf4e7[_0x5f30b9];return _0x3e8ee9;};'use strict';var multer=require(_0x7f4e('0x0'));var util=require(_0x7f4e('0x1'));var path=require(_0x7f4e('0x2'));var timeout=require(_0x7f4e('0x3'));var express=require(_0x7f4e('0x4'));var router=express[_0x7f4e('0x5')]();var fs_extra=require(_0x7f4e('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7f4e('0x7'));var controller=require(_0x7f4e('0x8'));router[_0x7f4e('0x9')]('/',auth[_0x7f4e('0xa')](),controller[_0x7f4e('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7f4e('0xc')]);router[_0x7f4e('0x9')](_0x7f4e('0xd'),auth[_0x7f4e('0xa')](),controller[_0x7f4e('0xe')]);router[_0x7f4e('0xf')]('/',auth[_0x7f4e('0xa')](),controller[_0x7f4e('0x10')]);router[_0x7f4e('0x11')](_0x7f4e('0x12'),auth[_0x7f4e('0xa')](),controller[_0x7f4e('0x13')]);router[_0x7f4e('0x14')](_0x7f4e('0x12'),auth[_0x7f4e('0xa')](),controller[_0x7f4e('0x15')]);module[_0x7f4e('0x16')]=router;
\ No newline at end of file
+var _0x152d=['exports','multer','util','connect-timeout','express','Router','fs-extra','./analyticExtractedReport.controller','get','isAuthenticated','index','show','download','put','/:id','delete','destroy'];(function(_0x5018e1,_0xa4a296){var _0x33f310=function(_0x4f1d8a){while(--_0x4f1d8a){_0x5018e1['push'](_0x5018e1['shift']());}};_0x33f310(++_0xa4a296);}(_0x152d,0xde));var _0xd152=function(_0x47a246,_0xd07a63){_0x47a246=_0x47a246-0x0;var _0xc87538=_0x152d[_0x47a246];return _0xc87538;};'use strict';var multer=require(_0xd152('0x0'));var util=require(_0xd152('0x1'));var path=require('path');var timeout=require(_0xd152('0x2'));var express=require(_0xd152('0x3'));var router=express[_0xd152('0x4')]();var fs_extra=require(_0xd152('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd152('0x6'));router[_0xd152('0x7')]('/',auth[_0xd152('0x8')](),controller[_0xd152('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd152('0xa')]);router[_0xd152('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0xd152('0xb')]);router['post']('/',auth[_0xd152('0x8')](),controller['create']);router[_0xd152('0xc')](_0xd152('0xd'),auth[_0xd152('0x8')](),controller['update']);router[_0xd152('0xe')]('/:id',auth[_0xd152('0x8')](),controller[_0xd152('0xf')]);module[_0xd152('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 21f9e6f..65389d8 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 _0x59ad=['BOOLEAN','exports','TEXT','STRING'];(function(_0xe650fa,_0x28e061){var _0x21f96b=function(_0x167c65){while(--_0x167c65){_0xe650fa['push'](_0xe650fa['shift']());}};_0x21f96b(++_0x28e061);}(_0x59ad,0x1bd));var _0xd59a=function(_0x6830be,_0x5817ec){_0x6830be=_0x6830be-0x0;var _0x2127af=_0x59ad[_0x6830be];return _0x2127af;};'use strict';var Sequelize=require('sequelize');module[_0xd59a('0x0')]={'field':{'type':Sequelize[_0xd59a('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xd59a('0x2')]},'groupBy':{'type':Sequelize[_0xd59a('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xd59a('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x4c3d=['exports','STRING','BOOLEAN','sequelize'];(function(_0x4470c0,_0x5b9cd1){var _0x2c079a=function(_0x1a91c5){while(--_0x1a91c5){_0x4470c0['push'](_0x4470c0['shift']());}};_0x2c079a(++_0x5b9cd1);}(_0x4c3d,0x9f));var _0xd4c3=function(_0x1a2868,_0x2e0567){_0x1a2868=_0x1a2868-0x0;var _0x1778d4=_0x4c3d[_0x1a2868];return _0x1778d4;};'use strict';var Sequelize=require(_0xd4c3('0x0'));module[_0xd4c3('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xd4c3('0x2')]},'function':{'type':Sequelize[_0xd4c3('0x2')]},'format':{'type':Sequelize[_0xd4c3('0x2')]},'groupBy':{'type':Sequelize[_0xd4c3('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xd4c3('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 990e9a6..eb086e4 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 _0x1d3c=['error','name','index','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','show','params','keys','length','find','create','body','catch','bulkCreate','destroy','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','offset','limit','set','Content-Range','apply','reject','update','then','sendStatus'];(function(_0x1140c3,_0x562621){var _0x2d0b43=function(_0x20bc1e){while(--_0x20bc1e){_0x1140c3['push'](_0x1140c3['shift']());}};_0x2d0b43(++_0x562621);}(_0x1d3c,0x1c7));var _0xc1d3=function(_0x4667b2,_0x135b67){_0x4667b2=_0x4667b2-0x0;var _0x1070f2=_0x1d3c[_0x4667b2];return _0x1070f2;};'use strict';var emlformat=require(_0xc1d3('0x0'));var rimraf=require(_0xc1d3('0x1'));var zipdir=require(_0xc1d3('0x2'));var jsonpatch=require(_0xc1d3('0x3'));var rp=require(_0xc1d3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc1d3('0x5'));var path=require(_0xc1d3('0x6'));var sox=require(_0xc1d3('0x7'));var csv=require(_0xc1d3('0x8'));var ejs=require(_0xc1d3('0x9'));var fs=require('fs');var fs_extra=require(_0xc1d3('0xa'));var _=require('lodash');var squel=require(_0xc1d3('0xb'));var crypto=require(_0xc1d3('0xc'));var jsforce=require(_0xc1d3('0xd'));var deskjs=require(_0xc1d3('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc1d3('0xf'));var authService=require(_0xc1d3('0x10'));var qs=require(_0xc1d3('0x11'));var as=require(_0xc1d3('0x12'));var hardwareService=require(_0xc1d3('0x13'));var logger=require(_0xc1d3('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xc1d3('0x15'));var licenseUtil=require(_0xc1d3('0x16'));var db=require(_0xc1d3('0x17'))['db'];function respondWithStatusCode(_0xa6ef78,_0x58c5a8){_0x58c5a8=_0x58c5a8||0xcc;return function(_0x319e86){if(_0x319e86){return _0xa6ef78['sendStatus'](_0x58c5a8);}return _0xa6ef78[_0xc1d3('0x18')](_0x58c5a8)[_0xc1d3('0x19')]();};}function respondWithResult(_0x2866fa,_0x5a206e){_0x5a206e=_0x5a206e||0xc8;return function(_0x3a2408){if(_0x3a2408){return _0x2866fa[_0xc1d3('0x18')](_0x5a206e)[_0xc1d3('0x1a')](_0x3a2408);}};}function respondWithFilteredResult(_0x405d43,_0x393bc0){return function(_0x24ffdd){if(_0x24ffdd){var _0x795219=typeof _0x393bc0['offset']===_0xc1d3('0x1b')&&typeof _0x393bc0['limit']===_0xc1d3('0x1b');var _0x4b36be=_0x24ffdd['count'];var _0x4b14f5=_0x795219?0x0:_0x393bc0[_0xc1d3('0x1c')];var _0x431f0e=_0x795219?_0x24ffdd['count']:_0x393bc0[_0xc1d3('0x1c')]+_0x393bc0[_0xc1d3('0x1d')];var _0x4a708f;if(_0x431f0e>=_0x4b36be){_0x431f0e=_0x4b36be;_0x4a708f=0xc8;}else{_0x4a708f=0xce;}_0x405d43['status'](_0x4a708f);return _0x405d43[_0xc1d3('0x1e')](_0xc1d3('0x1f'),_0x4b14f5+'-'+_0x431f0e+'/'+_0x4b36be)[_0xc1d3('0x1a')](_0x24ffdd);}return null;};}function patchUpdates(_0x20c688){return function(_0x255145){try{jsonpatch[_0xc1d3('0x20')](_0x255145,_0x20c688,!![]);}catch(_0x3ad214){return BPromise[_0xc1d3('0x21')](_0x3ad214);}return _0x255145['save']();};}function saveUpdates(_0x1ae1f9,_0xad94f7){return function(_0x2b3e27){if(_0x2b3e27){return _0x2b3e27[_0xc1d3('0x22')](_0x1ae1f9)[_0xc1d3('0x23')](function(_0x2b9d3d){return _0x2b9d3d;});}return null;};}function removeEntity(_0xea51aa,_0x4917f2){return function(_0x1d6d1b){if(_0x1d6d1b){return _0x1d6d1b['destroy']()[_0xc1d3('0x23')](function(){_0xea51aa['status'](0xcc)[_0xc1d3('0x19')]();});}};}function handleEntityNotFound(_0x4ecf49,_0x6e7559){return function(_0x1eaadd){if(!_0x1eaadd){_0x4ecf49[_0xc1d3('0x24')](0x194);}return _0x1eaadd;};}function handleError(_0x1fb545,_0x466949){_0x466949=_0x466949||0x1f4;return function(_0x4a1422){logger[_0xc1d3('0x25')](_0x4a1422['stack']);if(_0x4a1422[_0xc1d3('0x26')]){delete _0x4a1422['name'];}_0x1fb545[_0xc1d3('0x18')](_0x466949)['send'](_0x4a1422);};}exports[_0xc1d3('0x27')]=function(_0x849553,_0x5da72e){var _0x3f288b={},_0x363358={},_0x29706a={'count':0x0,'rows':[]};var _0x3f4b92=_['map'](db[_0xc1d3('0x28')][_0xc1d3('0x29')],function(_0x406cd4){return{'name':_0x406cd4[_0xc1d3('0x2a')],'type':_0x406cd4[_0xc1d3('0x2b')][_0xc1d3('0x2c')]};});_0x363358[_0xc1d3('0x2d')]=_[_0xc1d3('0x2e')](_0x3f4b92,_0xc1d3('0x26'));_0x363358[_0xc1d3('0x2f')]=_['keys'](_0x849553[_0xc1d3('0x2f')]);_0x363358['filters']=_[_0xc1d3('0x30')](_0x363358[_0xc1d3('0x2d')],_0x363358[_0xc1d3('0x2f')]);_0x3f288b[_0xc1d3('0x31')]=_[_0xc1d3('0x30')](_0x363358[_0xc1d3('0x2d')],qs[_0xc1d3('0x32')](_0x849553['query'][_0xc1d3('0x32')]));_0x3f288b[_0xc1d3('0x31')]=_0x3f288b[_0xc1d3('0x31')]['length']?_0x3f288b[_0xc1d3('0x31')]:_0x363358[_0xc1d3('0x2d')];if(!_0x849553['query'][_0xc1d3('0x33')]('nolimit')){_0x3f288b['limit']=qs[_0xc1d3('0x1d')](_0x849553[_0xc1d3('0x2f')][_0xc1d3('0x1d')]);_0x3f288b[_0xc1d3('0x1c')]=qs[_0xc1d3('0x1c')](_0x849553[_0xc1d3('0x2f')][_0xc1d3('0x1c')]);}_0x3f288b['order']=qs[_0xc1d3('0x34')](_0x849553[_0xc1d3('0x2f')][_0xc1d3('0x34')]);_0x3f288b[_0xc1d3('0x35')]=qs[_0xc1d3('0x36')](_[_0xc1d3('0x37')](_0x849553['query'],_0x363358[_0xc1d3('0x36')]),_0x3f4b92);if(_0x849553['query'][_0xc1d3('0x38')]){_0x3f288b['where']=_[_0xc1d3('0x39')](_0x3f288b['where'],{'$or':_['map'](_0x3f4b92,function(_0x26bc91){if(_0x26bc91[_0xc1d3('0x2b')]!==_0xc1d3('0x3a')){var _0x41da28={};_0x41da28[_0x26bc91[_0xc1d3('0x26')]]={'$like':'%'+_0x849553[_0xc1d3('0x2f')][_0xc1d3('0x38')]+'%'};return _0x41da28;}})});}_0x3f288b=_[_0xc1d3('0x39')]({},_0x3f288b,_0x849553[_0xc1d3('0x3b')]);var _0x4748e3={'where':_0x3f288b['where']};return db['AnalyticFieldReport'][_0xc1d3('0x3c')](_0x4748e3)[_0xc1d3('0x23')](function(_0x6043f4){_0x29706a[_0xc1d3('0x3c')]=_0x6043f4;if(_0x849553[_0xc1d3('0x2f')][_0xc1d3('0x3d')]){_0x3f288b[_0xc1d3('0x3e')]=[{'all':!![]}];}return db[_0xc1d3('0x28')]['findAll'](_0x3f288b);})[_0xc1d3('0x23')](function(_0x212cf6){_0x29706a[_0xc1d3('0x3f')]=_0x212cf6;return _0x29706a;})['then'](respondWithFilteredResult(_0x5da72e,_0x3f288b))['catch'](handleError(_0x5da72e,null));};exports[_0xc1d3('0x40')]=function(_0x39f322,_0x221bed){var _0x468f5a={'raw':![],'where':{'id':_0x39f322[_0xc1d3('0x41')]['id']}},_0x5997f1={};_0x5997f1[_0xc1d3('0x2d')]=_[_0xc1d3('0x42')](db[_0xc1d3('0x28')][_0xc1d3('0x29')]);_0x5997f1['query']=_['keys'](_0x39f322[_0xc1d3('0x2f')]);_0x5997f1[_0xc1d3('0x36')]=_[_0xc1d3('0x30')](_0x5997f1[_0xc1d3('0x2d')],_0x5997f1[_0xc1d3('0x2f')]);_0x468f5a[_0xc1d3('0x31')]=_[_0xc1d3('0x30')](_0x5997f1[_0xc1d3('0x2d')],qs[_0xc1d3('0x32')](_0x39f322[_0xc1d3('0x2f')][_0xc1d3('0x32')]));_0x468f5a['attributes']=_0x468f5a['attributes'][_0xc1d3('0x43')]?_0x468f5a['attributes']:_0x5997f1[_0xc1d3('0x2d')];if(_0x39f322[_0xc1d3('0x2f')][_0xc1d3('0x3d')]){_0x468f5a['include']=[{'all':!![]}];}_0x468f5a=_[_0xc1d3('0x39')]({},_0x468f5a,_0x39f322[_0xc1d3('0x3b')]);return db[_0xc1d3('0x28')][_0xc1d3('0x44')](_0x468f5a)[_0xc1d3('0x23')](handleEntityNotFound(_0x221bed,null))[_0xc1d3('0x23')](respondWithResult(_0x221bed,null))['catch'](handleError(_0x221bed,null));};exports[_0xc1d3('0x45')]=function(_0x447e9d,_0x172cd6){return db['AnalyticFieldReport'][_0xc1d3('0x45')](_0x447e9d[_0xc1d3('0x46')],{})[_0xc1d3('0x23')](respondWithResult(_0x172cd6,0xc9))[_0xc1d3('0x47')](handleError(_0x172cd6,null));};exports[_0xc1d3('0x48')]=function(_0x5a2455,_0xcf2c24){return db[_0xc1d3('0x28')][_0xc1d3('0x48')](_0x5a2455['body'],{'raw':![],'individualHooks':!![]})[_0xc1d3('0x23')](respondWithResult(_0xcf2c24,0xc9))[_0xc1d3('0x47')](handleError(_0xcf2c24,null));};exports[_0xc1d3('0x22')]=function(_0x4a21c6,_0x20796d){if(_0x4a21c6[_0xc1d3('0x46')]['id']){delete _0x4a21c6[_0xc1d3('0x46')]['id'];}return db['AnalyticFieldReport'][_0xc1d3('0x44')]({'where':{'id':_0x4a21c6[_0xc1d3('0x41')]['id']}})['then'](handleEntityNotFound(_0x20796d,null))[_0xc1d3('0x23')](saveUpdates(_0x4a21c6[_0xc1d3('0x46')],null))['then'](respondWithResult(_0x20796d,null))[_0xc1d3('0x47')](handleError(_0x20796d,null));};exports[_0xc1d3('0x49')]=function(_0x56d1cb,_0x2d5b91){return db[_0xc1d3('0x28')][_0xc1d3('0x44')]({'where':{'id':_0x56d1cb[_0xc1d3('0x41')]['id']}})['then'](handleEntityNotFound(_0x2d5b91,null))[_0xc1d3('0x23')](removeEntity(_0x2d5b91,null))[_0xc1d3('0x47')](handleError(_0x2d5b91,null));};exports[_0xc1d3('0x4a')]=function(_0x2e416c,_0x195b9b){return db[_0xc1d3('0x28')][_0xc1d3('0x49')]({'where':{'id':_0x2e416c[_0xc1d3('0x2f')][_0xc1d3('0x4b')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x195b9b,0xcc))[_0xc1d3('0x47')](handleError(_0x195b9b,null));};exports['addFields']=function(_0x366b1c,_0x286544,_0x173f1e){return db[_0xc1d3('0x4c')][_0xc1d3('0x4d')]({'where':{'id':_0x366b1c['params']['id']}})['then'](handleEntityNotFound(_0x286544,null))[_0xc1d3('0x23')](function(_0xbfbf4f){if(_0xbfbf4f){return db[_0xc1d3('0x4e')][_0xc1d3('0x4f')](function(_0x2a782a){return db[_0xc1d3('0x28')][_0xc1d3('0x49')]({'where':{'CustomReportId':_0x366b1c[_0xc1d3('0x41')]['id']},'transaction':_0x2a782a})[_0xc1d3('0x23')](function(_0x45b268){var _0x349ba4=_[_0xc1d3('0x2e')](_0x366b1c[_0xc1d3('0x46')],function(_0xd81085){delete _0xd81085['id'];_0xd81085[_0xc1d3('0x50')]=_0x366b1c[_0xc1d3('0x41')]['id'];return _0xd81085;});return db['AnalyticFieldReport']['bulkCreate'](_0x349ba4,{'transaction':_0x2a782a});});})[_0xc1d3('0x23')](function(){return db['AnalyticFieldReport'][_0xc1d3('0x51')]({'where':{'CustomReportId':_0x366b1c[_0xc1d3('0x41')]['id']}});});}})[_0xc1d3('0x23')](respondWithResult(_0x286544,null))['catch'](handleError(_0x286544,null));};
\ No newline at end of file
+var _0x65dc=['map','AnalyticFieldReport','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','rawAttributes','include','find','create','body','params','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','bulkCreate','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index'];(function(_0x39551a,_0x116007){var _0x4b0b62=function(_0x3d8a12){while(--_0x3d8a12){_0x39551a['push'](_0x39551a['shift']());}};_0x4b0b62(++_0x116007);}(_0x65dc,0x7b));var _0xc65d=function(_0x3c0713,_0x118272){_0x3c0713=_0x3c0713-0x0;var _0xda81d3=_0x65dc[_0x3c0713];return _0xda81d3;};'use strict';var emlformat=require(_0xc65d('0x0'));var rimraf=require(_0xc65d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc65d('0x2'));var rp=require(_0xc65d('0x3'));var moment=require(_0xc65d('0x4'));var BPromise=require(_0xc65d('0x5'));var Mustache=require(_0xc65d('0x6'));var util=require(_0xc65d('0x7'));var path=require(_0xc65d('0x8'));var sox=require(_0xc65d('0x9'));var csv=require(_0xc65d('0xa'));var ejs=require(_0xc65d('0xb'));var fs=require('fs');var fs_extra=require(_0xc65d('0xc'));var _=require(_0xc65d('0xd'));var squel=require(_0xc65d('0xe'));var crypto=require('crypto');var jsforce=require(_0xc65d('0xf'));var deskjs=require(_0xc65d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc65d('0x11'));var Papa=require('papaparse');var Redis=require(_0xc65d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc65d('0x13'));var as=require(_0xc65d('0x14'));var hardwareService=require(_0xc65d('0x15'));var logger=require(_0xc65d('0x16'))(_0xc65d('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc65d('0x18'))['db'];function respondWithStatusCode(_0x45cb88,_0x1e69c4){_0x1e69c4=_0x1e69c4||0xcc;return function(_0x42ff3c){if(_0x42ff3c){return _0x45cb88[_0xc65d('0x19')](_0x1e69c4);}return _0x45cb88[_0xc65d('0x1a')](_0x1e69c4)['end']();};}function respondWithResult(_0x56eb71,_0x2538e2){_0x2538e2=_0x2538e2||0xc8;return function(_0x3797cb){if(_0x3797cb){return _0x56eb71[_0xc65d('0x1a')](_0x2538e2)[_0xc65d('0x1b')](_0x3797cb);}};}function respondWithFilteredResult(_0x269513,_0x490203){return function(_0x29c950){if(_0x29c950){var _0x27e221=typeof _0x490203[_0xc65d('0x1c')]==='undefined'&&typeof _0x490203[_0xc65d('0x1d')]==='undefined';var _0x3eafd8=_0x29c950[_0xc65d('0x1e')];var _0x21cc66=_0x27e221?0x0:_0x490203['offset'];var _0x2cdc7f=_0x27e221?_0x29c950[_0xc65d('0x1e')]:_0x490203[_0xc65d('0x1c')]+_0x490203[_0xc65d('0x1d')];var _0x4545a8;if(_0x2cdc7f>=_0x3eafd8){_0x2cdc7f=_0x3eafd8;_0x4545a8=0xc8;}else{_0x4545a8=0xce;}_0x269513[_0xc65d('0x1a')](_0x4545a8);return _0x269513[_0xc65d('0x1f')](_0xc65d('0x20'),_0x21cc66+'-'+_0x2cdc7f+'/'+_0x3eafd8)['json'](_0x29c950);}return null;};}function patchUpdates(_0x3e3d88){return function(_0x4c7cb9){try{jsonpatch[_0xc65d('0x21')](_0x4c7cb9,_0x3e3d88,!![]);}catch(_0x21b3e9){return BPromise[_0xc65d('0x22')](_0x21b3e9);}return _0x4c7cb9[_0xc65d('0x23')]();};}function saveUpdates(_0x1953e5,_0x250895){return function(_0x17c33d){if(_0x17c33d){return _0x17c33d[_0xc65d('0x24')](_0x1953e5)[_0xc65d('0x25')](function(_0x1b6fb2){return _0x1b6fb2;});}return null;};}function removeEntity(_0x34d43e,_0x26a7e9){return function(_0x559d9a){if(_0x559d9a){return _0x559d9a[_0xc65d('0x26')]()[_0xc65d('0x25')](function(){_0x34d43e[_0xc65d('0x1a')](0xcc)[_0xc65d('0x27')]();});}};}function handleEntityNotFound(_0x22617e,_0x139d1f){return function(_0x520c9e){if(!_0x520c9e){_0x22617e[_0xc65d('0x19')](0x194);}return _0x520c9e;};}function handleError(_0x28f51c,_0x964a93){_0x964a93=_0x964a93||0x1f4;return function(_0x3cd14f){logger[_0xc65d('0x28')](_0x3cd14f[_0xc65d('0x29')]);if(_0x3cd14f[_0xc65d('0x2a')]){delete _0x3cd14f[_0xc65d('0x2a')];}_0x28f51c[_0xc65d('0x1a')](_0x964a93)[_0xc65d('0x2b')](_0x3cd14f);};}exports[_0xc65d('0x2c')]=function(_0x58c26a,_0x22ed18){var _0x2d3c61={},_0x26e6b2={},_0x5e95d5={'count':0x0,'rows':[]};var _0x158c31=_[_0xc65d('0x2d')](db[_0xc65d('0x2e')]['rawAttributes'],function(_0x10f6b5){return{'name':_0x10f6b5['fieldName'],'type':_0x10f6b5[_0xc65d('0x2f')][_0xc65d('0x30')]};});_0x26e6b2[_0xc65d('0x31')]=_[_0xc65d('0x2d')](_0x158c31,_0xc65d('0x2a'));_0x26e6b2[_0xc65d('0x32')]=_['keys'](_0x58c26a['query']);_0x26e6b2[_0xc65d('0x33')]=_['intersection'](_0x26e6b2[_0xc65d('0x31')],_0x26e6b2['query']);_0x2d3c61[_0xc65d('0x34')]=_[_0xc65d('0x35')](_0x26e6b2[_0xc65d('0x31')],qs[_0xc65d('0x36')](_0x58c26a[_0xc65d('0x32')]['fields']));_0x2d3c61[_0xc65d('0x34')]=_0x2d3c61[_0xc65d('0x34')][_0xc65d('0x37')]?_0x2d3c61[_0xc65d('0x34')]:_0x26e6b2[_0xc65d('0x31')];if(!_0x58c26a[_0xc65d('0x32')][_0xc65d('0x38')](_0xc65d('0x39'))){_0x2d3c61[_0xc65d('0x1d')]=qs[_0xc65d('0x1d')](_0x58c26a[_0xc65d('0x32')][_0xc65d('0x1d')]);_0x2d3c61['offset']=qs[_0xc65d('0x1c')](_0x58c26a[_0xc65d('0x32')][_0xc65d('0x1c')]);}_0x2d3c61['order']=qs[_0xc65d('0x3a')](_0x58c26a[_0xc65d('0x32')][_0xc65d('0x3a')]);_0x2d3c61[_0xc65d('0x3b')]=qs[_0xc65d('0x33')](_['pick'](_0x58c26a[_0xc65d('0x32')],_0x26e6b2[_0xc65d('0x33')]),_0x158c31);if(_0x58c26a['query'][_0xc65d('0x3c')]){_0x2d3c61['where']=_[_0xc65d('0x3d')](_0x2d3c61['where'],{'$or':_[_0xc65d('0x2d')](_0x158c31,function(_0x2157d0){if(_0x2157d0[_0xc65d('0x2f')]!==_0xc65d('0x3e')){var _0x141693={};_0x141693[_0x2157d0[_0xc65d('0x2a')]]={'$like':'%'+_0x58c26a[_0xc65d('0x32')][_0xc65d('0x3c')]+'%'};return _0x141693;}})});}_0x2d3c61=_[_0xc65d('0x3d')]({},_0x2d3c61,_0x58c26a[_0xc65d('0x3f')]);var _0x1c8ba9={'where':_0x2d3c61[_0xc65d('0x3b')]};return db[_0xc65d('0x2e')][_0xc65d('0x1e')](_0x1c8ba9)[_0xc65d('0x25')](function(_0x2fa22a){_0x5e95d5['count']=_0x2fa22a;if(_0x58c26a[_0xc65d('0x32')][_0xc65d('0x40')]){_0x2d3c61['include']=[{'all':!![]}];}return db[_0xc65d('0x2e')][_0xc65d('0x41')](_0x2d3c61);})[_0xc65d('0x25')](function(_0x951134){_0x5e95d5[_0xc65d('0x42')]=_0x951134;return _0x5e95d5;})[_0xc65d('0x25')](respondWithFilteredResult(_0x22ed18,_0x2d3c61))[_0xc65d('0x43')](handleError(_0x22ed18,null));};exports[_0xc65d('0x44')]=function(_0x464453,_0x3fd539){var _0x4af250={'raw':![],'where':{'id':_0x464453['params']['id']}},_0x343bf2={};_0x343bf2['model']=_[_0xc65d('0x45')](db[_0xc65d('0x2e')][_0xc65d('0x46')]);_0x343bf2['query']=_['keys'](_0x464453[_0xc65d('0x32')]);_0x343bf2[_0xc65d('0x33')]=_[_0xc65d('0x35')](_0x343bf2['model'],_0x343bf2[_0xc65d('0x32')]);_0x4af250[_0xc65d('0x34')]=_[_0xc65d('0x35')](_0x343bf2[_0xc65d('0x31')],qs[_0xc65d('0x36')](_0x464453['query'][_0xc65d('0x36')]));_0x4af250['attributes']=_0x4af250[_0xc65d('0x34')][_0xc65d('0x37')]?_0x4af250[_0xc65d('0x34')]:_0x343bf2[_0xc65d('0x31')];if(_0x464453[_0xc65d('0x32')][_0xc65d('0x40')]){_0x4af250[_0xc65d('0x47')]=[{'all':!![]}];}_0x4af250=_[_0xc65d('0x3d')]({},_0x4af250,_0x464453[_0xc65d('0x3f')]);return db[_0xc65d('0x2e')][_0xc65d('0x48')](_0x4af250)[_0xc65d('0x25')](handleEntityNotFound(_0x3fd539,null))[_0xc65d('0x25')](respondWithResult(_0x3fd539,null))['catch'](handleError(_0x3fd539,null));};exports[_0xc65d('0x49')]=function(_0x112991,_0x8b6243){return db['AnalyticFieldReport'][_0xc65d('0x49')](_0x112991[_0xc65d('0x4a')],{})['then'](respondWithResult(_0x8b6243,0xc9))['catch'](handleError(_0x8b6243,null));};exports['bulkCreate']=function(_0x5a2e14,_0x361514){return db['AnalyticFieldReport']['bulkCreate'](_0x5a2e14['body'],{'raw':![],'individualHooks':!![]})[_0xc65d('0x25')](respondWithResult(_0x361514,0xc9))[_0xc65d('0x43')](handleError(_0x361514,null));};exports[_0xc65d('0x24')]=function(_0x2f23a5,_0x4aea8c){if(_0x2f23a5[_0xc65d('0x4a')]['id']){delete _0x2f23a5[_0xc65d('0x4a')]['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x2f23a5[_0xc65d('0x4b')]['id']}})[_0xc65d('0x25')](handleEntityNotFound(_0x4aea8c,null))['then'](saveUpdates(_0x2f23a5[_0xc65d('0x4a')],null))[_0xc65d('0x25')](respondWithResult(_0x4aea8c,null))[_0xc65d('0x43')](handleError(_0x4aea8c,null));};exports[_0xc65d('0x26')]=function(_0x4c0b92,_0x599516){return db[_0xc65d('0x2e')]['find']({'where':{'id':_0x4c0b92[_0xc65d('0x4b')]['id']}})[_0xc65d('0x25')](handleEntityNotFound(_0x599516,null))[_0xc65d('0x25')](removeEntity(_0x599516,null))['catch'](handleError(_0x599516,null));};exports[_0xc65d('0x4c')]=function(_0x10c363,_0x43226f){return db[_0xc65d('0x2e')][_0xc65d('0x26')]({'where':{'id':_0x10c363[_0xc65d('0x32')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xc65d('0x25')](respondWithResult(_0x43226f,0xcc))[_0xc65d('0x43')](handleError(_0x43226f,null));};exports[_0xc65d('0x4d')]=function(_0x4fbded,_0x1ce544,_0x35e9ad){return db[_0xc65d('0x4e')][_0xc65d('0x4f')]({'where':{'id':_0x4fbded[_0xc65d('0x4b')]['id']}})[_0xc65d('0x25')](handleEntityNotFound(_0x1ce544,null))['then'](function(_0x451eb6){if(_0x451eb6){return db[_0xc65d('0x50')][_0xc65d('0x51')](function(_0x417725){return db[_0xc65d('0x2e')]['destroy']({'where':{'CustomReportId':_0x4fbded[_0xc65d('0x4b')]['id']},'transaction':_0x417725})['then'](function(_0x522426){var _0x28ff68=_['map'](_0x4fbded[_0xc65d('0x4a')],function(_0x732f99){delete _0x732f99['id'];_0x732f99[_0xc65d('0x52')]=_0x4fbded[_0xc65d('0x4b')]['id'];return _0x732f99;});return db[_0xc65d('0x2e')][_0xc65d('0x53')](_0x28ff68,{'transaction':_0x417725});});})[_0xc65d('0x25')](function(){return db[_0xc65d('0x2e')][_0xc65d('0x41')]({'where':{'CustomReportId':_0x4fbded['params']['id']}});});}})[_0xc65d('0x25')](respondWithResult(_0x1ce544,null))[_0xc65d('0x43')](handleError(_0x1ce544,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 9335f1a..31b9371 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 _0x44a0=['path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','lodash','../../config/logger','moment','request-promise'];(function(_0x1cc32e,_0x1f278f){var _0x1dac9a=function(_0x1fb7a0){while(--_0x1fb7a0){_0x1cc32e['push'](_0x1cc32e['shift']());}};_0x1dac9a(++_0x1f278f);}(_0x44a0,0x193));var _0x044a=function(_0x4891a7,_0x566170){_0x4891a7=_0x4891a7-0x0;var _0x20a6aa=_0x44a0[_0x4891a7];return _0x20a6aa;};'use strict';var _=require(_0x044a('0x0'));var util=require('util');var logger=require(_0x044a('0x1'))('api');var moment=require(_0x044a('0x2'));var BPromise=require('bluebird');var rp=require(_0x044a('0x3'));var fs=require('fs');var path=require(_0x044a('0x4'));var rimraf=require(_0x044a('0x5'));var config=require(_0x044a('0x6'));var attributes=require(_0x044a('0x7'));module[_0x044a('0x8')]=function(_0x35e5ce,_0x476d49){return _0x35e5ce[_0x044a('0x9')](_0x044a('0xa'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x512c=['./analyticFieldReport.attributes','define','analytics_report_fields','../../config/logger','api','moment','bluebird','path'];(function(_0x4a5ba6,_0x103eb9){var _0x23831=function(_0x19dffc){while(--_0x19dffc){_0x4a5ba6['push'](_0x4a5ba6['shift']());}};_0x23831(++_0x103eb9);}(_0x512c,0x13b));var _0xc512=function(_0x176c29,_0x31b30a){_0x176c29=_0x176c29-0x0;var _0x553834=_0x512c[_0x176c29];return _0x553834;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc512('0x0'))(_0xc512('0x1'));var moment=require(_0xc512('0x2'));var BPromise=require(_0xc512('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc512('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc512('0x5'));module['exports']=function(_0xb4f59d,_0x46c5b6){return _0xb4f59d[_0xc512('0x6')]('AnalyticFieldReport',attributes,{'tableName':_0xc512('0x7'),'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 e0fb259..c35ac59 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 _0x0826=['request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x42f6ca,_0x268900){var _0x509ea9=function(_0x45b0a2){while(--_0x45b0a2){_0x42f6ca['push'](_0x42f6ca['shift']());}};_0x509ea9(++_0x268900);}(_0x0826,0x104));var _0x6082=function(_0x15b065,_0x3b77a7){_0x15b065=_0x15b065-0x0;var _0x4cb0ae=_0x0826[_0x15b065];return _0x4cb0ae;};'use strict';var _=require(_0x6082('0x0'));var util=require(_0x6082('0x1'));var moment=require(_0x6082('0x2'));var BPromise=require(_0x6082('0x3'));var rs=require(_0x6082('0x4'));var fs=require('fs');var Redis=require(_0x6082('0x5'));var db=require(_0x6082('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6082('0x7'))(_0x6082('0x8'));var config=require(_0x6082('0x9'));var jayson=require(_0x6082('0xa'));var client=jayson[_0x6082('0xb')][_0x6082('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x85e0c1,_0x3210d1,_0x4387de){return new BPromise(function(_0x355aec,_0x23f9af){return client['request'](_0x85e0c1,_0x4387de)[_0x6082('0xd')](function(_0x4c0212){logger[_0x6082('0xe')](_0x6082('0xf'),_0x3210d1,_0x6082('0x10'));logger[_0x6082('0x11')](_0x6082('0x12'),_0x3210d1,_0x6082('0x10'),JSON['stringify'](_0x4c0212));if(_0x4c0212[_0x6082('0x13')]){if(_0x4c0212[_0x6082('0x13')][_0x6082('0x14')]===0x1f4){logger[_0x6082('0x13')](_0x6082('0xf'),_0x3210d1,_0x4c0212[_0x6082('0x13')][_0x6082('0x15')]);return _0x23f9af(_0x4c0212[_0x6082('0x13')][_0x6082('0x15')]);}logger[_0x6082('0x13')](_0x6082('0xf'),_0x3210d1,_0x4c0212[_0x6082('0x13')][_0x6082('0x15')]);return _0x355aec(_0x4c0212[_0x6082('0x13')]['message']);}else{logger[_0x6082('0xe')](_0x6082('0xf'),_0x3210d1,'request\x20sent');_0x355aec(_0x4c0212['result'][_0x6082('0x15')]);}})[_0x6082('0x16')](function(_0x276ed5){logger[_0x6082('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3210d1,_0x276ed5);_0x23f9af(_0x276ed5);});});}
\ No newline at end of file
+var _0xfdc5=['code','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x23db04,_0x16800f){var _0x80db9d=function(_0x11562d){while(--_0x11562d){_0x23db04['push'](_0x23db04['shift']());}};_0x80db9d(++_0x16800f);}(_0xfdc5,0xb5));var _0x5fdc=function(_0x3a7a9c,_0x24f7d6){_0x3a7a9c=_0x3a7a9c-0x0;var _0x59156e=_0xfdc5[_0x3a7a9c];return _0x59156e;};'use strict';var _=require(_0x5fdc('0x0'));var util=require(_0x5fdc('0x1'));var moment=require('moment');var BPromise=require(_0x5fdc('0x2'));var rs=require(_0x5fdc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5fdc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5fdc('0x5'))(_0x5fdc('0x6'));var config=require('../../config/environment');var jayson=require(_0x5fdc('0x7'));var client=jayson[_0x5fdc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e395e,_0xd11245,_0x233c92){return new BPromise(function(_0xb20af8,_0x3b4aa1){return client[_0x5fdc('0x9')](_0x3e395e,_0x233c92)[_0x5fdc('0xa')](function(_0x4b868d){logger['info'](_0x5fdc('0xb'),_0xd11245,_0x5fdc('0xc'));logger[_0x5fdc('0xd')](_0x5fdc('0xe'),_0xd11245,_0x5fdc('0xc'),JSON[_0x5fdc('0xf')](_0x4b868d));if(_0x4b868d[_0x5fdc('0x10')]){if(_0x4b868d[_0x5fdc('0x10')][_0x5fdc('0x11')]===0x1f4){logger['error'](_0x5fdc('0xb'),_0xd11245,_0x4b868d[_0x5fdc('0x10')][_0x5fdc('0x12')]);return _0x3b4aa1(_0x4b868d[_0x5fdc('0x10')]['message']);}logger[_0x5fdc('0x10')](_0x5fdc('0xb'),_0xd11245,_0x4b868d['error']['message']);return _0xb20af8(_0x4b868d['error'][_0x5fdc('0x12')]);}else{logger[_0x5fdc('0x13')](_0x5fdc('0xb'),_0xd11245,'request\x20sent');_0xb20af8(_0x4b868d[_0x5fdc('0x14')][_0x5fdc('0x12')]);}})[_0x5fdc('0x15')](function(_0xccede4){logger[_0x5fdc('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0xd11245,_0xccede4);_0x3b4aa1(_0xccede4);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index aa0b4fc..f7b5a39 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(_0x58ef58,_0x2ea5b7){var _0x10117a=function(_0x4d282){while(--_0x4d282){_0x58ef58['push'](_0x58ef58['shift']());}};_0x10117a(++_0x2ea5b7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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(_0x32f20e,_0x5b7a1e){var _0x457e79=function(_0x34f608){while(--_0x34f608){_0x32f20e['push'](_0x32f20e['shift']());}};_0x457e79(++_0x5b7a1e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 88b7811..21b8e3e 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 _0x38a5=['sequelize','exports','STRING','name','TEXT'];(function(_0x589172,_0x2839fa){var _0x105c51=function(_0x5eb9a5){while(--_0x5eb9a5){_0x589172['push'](_0x589172['shift']());}};_0x105c51(++_0x2839fa);}(_0x38a5,0x69));var _0x538a=function(_0x32c272,_0x1b6d58){_0x32c272=_0x32c272-0x0;var _0x534033=_0x38a5[_0x32c272];return _0x534033;};'use strict';var Sequelize=require(_0x538a('0x0'));module[_0x538a('0x1')]={'name':{'type':Sequelize[_0x538a('0x2')],'allowNull':![],'unique':_0x538a('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x538a('0x4')]},'description':{'type':Sequelize[_0x538a('0x2')]}};
\ No newline at end of file
+var _0x0caf=['name','STRING','TEXT'];(function(_0x44ba8a,_0x19c5ea){var _0x2ac7fb=function(_0x225dd4){while(--_0x225dd4){_0x44ba8a['push'](_0x44ba8a['shift']());}};_0x2ac7fb(++_0x19c5ea);}(_0x0caf,0x9f));var _0xf0ca=function(_0x5e9f37,_0xfcd535){_0x5e9f37=_0x5e9f37-0x0;var _0xe1304f=_0x0caf[_0x5e9f37];return _0xe1304f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf0ca('0x0')},'table':{'type':Sequelize[_0xf0ca('0x1')]},'metric':{'type':Sequelize[_0xf0ca('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 64f3bc5..a0bcf5a 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 _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(_0x1a929b,_0x5dee96){var _0x39b6f9=function(_0x42afe8){while(--_0x42afe8){_0x1a929b['push'](_0x1a929b['shift']());}};_0x39b6f9(++_0x5dee96);}(_0x98a8,0x12c));var _0x898a=function(_0x338255,_0x457edc){_0x338255=_0x338255-0x0;var _0x3dc9c7=_0x98a8[_0x338255];return _0x3dc9c7;};'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
+var _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','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','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x2b8aa1,_0x29699b){var _0x170363=function(_0x471bd2){while(--_0x471bd2){_0x2b8aa1['push'](_0x2b8aa1['shift']());}};_0x170363(++_0x29699b);}(_0x9a19,0x114));var _0x99a1=function(_0x1f7413,_0x3388c3){_0x1f7413=_0x1f7413-0x0;var _0x2d2775=_0x9a19[_0x1f7413];return _0x2d2775;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 5156e2d..ccf12a7 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 _0x0689=['define','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x0689,0x161));var _0x9068=function(_0x1abfc4,_0x1e1298){_0x1abfc4=_0x1abfc4-0x0;var _0x1e6a3e=_0x0689[_0x1abfc4];return _0x1e6a3e;};'use strict';var _=require('lodash');var util=require(_0x9068('0x0'));var logger=require('../../config/logger')(_0x9068('0x1'));var moment=require(_0x9068('0x2'));var BPromise=require(_0x9068('0x3'));var rp=require(_0x9068('0x4'));var fs=require('fs');var path=require(_0x9068('0x5'));var rimraf=require(_0x9068('0x6'));var config=require(_0x9068('0x7'));var attributes=require(_0x9068('0x8'));module[_0x9068('0x9')]=function(_0x287846,_0x5ce5a7){return _0x287846[_0x9068('0xa')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0d91=['analytics_metrics','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x6caff4,_0x480025){var _0x358739=function(_0x2839ef){while(--_0x2839ef){_0x6caff4['push'](_0x6caff4['shift']());}};_0x358739(++_0x480025);}(_0x0d91,0x76));var _0x10d9=function(_0x57746e,_0x45093f){_0x57746e=_0x57746e-0x0;var _0x5caeaa=_0x0d91[_0x57746e];return _0x5caeaa;};'use strict';var _=require(_0x10d9('0x0'));var util=require(_0x10d9('0x1'));var logger=require(_0x10d9('0x2'))(_0x10d9('0x3'));var moment=require('moment');var BPromise=require(_0x10d9('0x4'));var rp=require(_0x10d9('0x5'));var fs=require('fs');var path=require(_0x10d9('0x6'));var rimraf=require('rimraf');var config=require(_0x10d9('0x7'));var attributes=require(_0x10d9('0x8'));module[_0x10d9('0x9')]=function(_0x4d89f0,_0x3cc578){return _0x4d89f0[_0x10d9('0xa')](_0x10d9('0xb'),attributes,{'tableName':_0x10d9('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 ebc3a40..b7b87a4 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 _0x9f66=['info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x547030,_0x5ac365){var _0x20dd29=function(_0x138efd){while(--_0x138efd){_0x547030['push'](_0x547030['shift']());}};_0x20dd29(++_0x5ac365);}(_0x9f66,0x1be));var _0x69f6=function(_0x28150d,_0x276ffa){_0x28150d=_0x28150d-0x0;var _0x52fd33=_0x9f66[_0x28150d];return _0x52fd33;};'use strict';var _=require(_0x69f6('0x0'));var util=require(_0x69f6('0x1'));var moment=require(_0x69f6('0x2'));var BPromise=require(_0x69f6('0x3'));var rs=require(_0x69f6('0x4'));var fs=require('fs');var Redis=require(_0x69f6('0x5'));var db=require(_0x69f6('0x6'))['db'];var utils=require(_0x69f6('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x69f6('0x8'));var jayson=require(_0x69f6('0x9'));var client=jayson[_0x69f6('0xa')][_0x69f6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9bc56e,_0x3b8a76,_0x43fb93){return new BPromise(function(_0x39757e,_0x2b62e5){return client[_0x69f6('0xc')](_0x9bc56e,_0x43fb93)[_0x69f6('0xd')](function(_0x38b147){logger[_0x69f6('0xe')](_0x69f6('0xf'),_0x3b8a76,_0x69f6('0x10'));logger['debug'](_0x69f6('0x11'),_0x3b8a76,_0x69f6('0x10'),JSON[_0x69f6('0x12')](_0x38b147));if(_0x38b147[_0x69f6('0x13')]){if(_0x38b147[_0x69f6('0x13')]['code']===0x1f4){logger[_0x69f6('0x13')](_0x69f6('0xf'),_0x3b8a76,_0x38b147['error']['message']);return _0x2b62e5(_0x38b147['error'][_0x69f6('0x14')]);}logger[_0x69f6('0x13')](_0x69f6('0xf'),_0x3b8a76,_0x38b147[_0x69f6('0x13')][_0x69f6('0x14')]);return _0x39757e(_0x38b147['error'][_0x69f6('0x14')]);}else{logger[_0x69f6('0xe')](_0x69f6('0xf'),_0x3b8a76,'request\x20sent');_0x39757e(_0x38b147[_0x69f6('0x15')]['message']);}})[_0x69f6('0x16')](function(_0x54a435){logger['error'](_0x69f6('0xf'),_0x3b8a76,_0x54a435);_0x2b62e5(_0x54a435);});});}
\ No newline at end of file
+var _0x9486=['result','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9486,0xd2));var _0x6948=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9486[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x6948('0x0'));var util=require(_0x6948('0x1'));var moment=require(_0x6948('0x2'));var BPromise=require(_0x6948('0x3'));var rs=require(_0x6948('0x4'));var fs=require('fs');var Redis=require(_0x6948('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6948('0x6'));var logger=require('../../config/logger')(_0x6948('0x7'));var config=require(_0x6948('0x8'));var jayson=require(_0x6948('0x9'));var client=jayson[_0x6948('0xa')][_0x6948('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x803c27,_0x16b95c,_0x322192){return new BPromise(function(_0x54c0bf,_0xc3fce6){return client['request'](_0x803c27,_0x322192)[_0x6948('0xc')](function(_0x38d599){logger[_0x6948('0xd')](_0x6948('0xe'),_0x16b95c,_0x6948('0xf'));logger[_0x6948('0x10')](_0x6948('0x11'),_0x16b95c,_0x6948('0xf'),JSON['stringify'](_0x38d599));if(_0x38d599[_0x6948('0x12')]){if(_0x38d599['error'][_0x6948('0x13')]===0x1f4){logger['error'](_0x6948('0xe'),_0x16b95c,_0x38d599[_0x6948('0x12')]['message']);return _0xc3fce6(_0x38d599[_0x6948('0x12')]['message']);}logger[_0x6948('0x12')](_0x6948('0xe'),_0x16b95c,_0x38d599[_0x6948('0x12')]['message']);return _0x54c0bf(_0x38d599['error']['message']);}else{logger[_0x6948('0xd')](_0x6948('0xe'),_0x16b95c,_0x6948('0xf'));_0x54c0bf(_0x38d599[_0x6948('0x14')][_0x6948('0x15')]);}})[_0x6948('0x16')](function(_0x14f224){logger['error'](_0x6948('0xe'),_0x16b95c,_0x14f224);_0xc3fce6(_0x14f224);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 84aee45..f8f05bf 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 _0xa23f=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','post','create','put','/:id','delete','exports','multer','util','express','Router'];(function(_0x150d4a,_0x2ee3d8){var _0x1d31ec=function(_0x4a794a){while(--_0x4a794a){_0x150d4a['push'](_0x150d4a['shift']());}};_0x1d31ec(++_0x2ee3d8);}(_0xa23f,0x7c));var _0xfa23=function(_0x59e068,_0x8ce760){_0x59e068=_0x59e068-0x0;var _0x1a7f9e=_0xa23f[_0x59e068];return _0x1a7f9e;};'use strict';var multer=require(_0xfa23('0x0'));var util=require(_0xfa23('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfa23('0x2'));var router=express[_0xfa23('0x3')]();var fs_extra=require(_0xfa23('0x4'));var auth=require(_0xfa23('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfa23('0x6'));var controller=require('./analyticMetric.controller');router[_0xfa23('0x7')]('/',auth[_0xfa23('0x8')](),controller[_0xfa23('0x9')]);router[_0xfa23('0x7')]('/:id',auth[_0xfa23('0x8')](),controller['show']);router[_0xfa23('0xa')]('/',auth[_0xfa23('0x8')](),controller[_0xfa23('0xb')]);router[_0xfa23('0xc')](_0xfa23('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xfa23('0xe')]('/:id',auth[_0xfa23('0x8')](),controller['destroy']);module[_0xfa23('0xf')]=router;
\ No newline at end of file
+var _0xd7c3=['./analyticMetric.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xa5da3f,_0x5b2b0a){var _0x3b4916=function(_0x86ba90){while(--_0x86ba90){_0xa5da3f['push'](_0xa5da3f['shift']());}};_0x3b4916(++_0x5b2b0a);}(_0xd7c3,0x1c5));var _0x3d7c=function(_0x4dcf88,_0x220d82){_0x4dcf88=_0x4dcf88-0x0;var _0x64f0dc=_0xd7c3[_0x4dcf88];return _0x64f0dc;};'use strict';var multer=require(_0x3d7c('0x0'));var util=require(_0x3d7c('0x1'));var path=require(_0x3d7c('0x2'));var timeout=require(_0x3d7c('0x3'));var express=require(_0x3d7c('0x4'));var router=express[_0x3d7c('0x5')]();var fs_extra=require(_0x3d7c('0x6'));var auth=require(_0x3d7c('0x7'));var interaction=require(_0x3d7c('0x8'));var config=require('../../config/environment');var controller=require(_0x3d7c('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x3d7c('0xa')](_0x3d7c('0xb'),auth[_0x3d7c('0xc')](),controller[_0x3d7c('0xd')]);router[_0x3d7c('0xe')]('/',auth[_0x3d7c('0xc')](),controller[_0x3d7c('0xf')]);router[_0x3d7c('0x10')](_0x3d7c('0xb'),auth[_0x3d7c('0xc')](),controller[_0x3d7c('0x11')]);router[_0x3d7c('0x12')](_0x3d7c('0xb'),auth[_0x3d7c('0xc')](),controller[_0x3d7c('0x13')]);module[_0x3d7c('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index f61c294..c38e50f 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 _0x3bca=['sequelize','exports','TEXT'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x3bca,0x132));var _0xa3bc=function(_0x58927c,_0x47c5f0){_0x58927c=_0x58927c-0x0;var _0x1100c2=_0x3bca[_0x58927c];return _0x1100c2;};'use strict';var Sequelize=require(_0xa3bc('0x0'));module[_0xa3bc('0x1')]={'tree':{'type':Sequelize[_0xa3bc('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x6f28=['TEXT','sequelize','exports'];(function(_0xd059e9,_0x30db2a){var _0x8ec878=function(_0x2feb66){while(--_0x2feb66){_0xd059e9['push'](_0xd059e9['shift']());}};_0x8ec878(++_0x30db2a);}(_0x6f28,0x130));var _0x86f2=function(_0x152678,_0x11e0ac){_0x152678=_0x152678-0x0;var _0x311a9=_0x6f28[_0x152678];return _0x311a9;};'use strict';var Sequelize=require(_0x86f2('0x0'));module[_0x86f2('0x1')]={'tree':{'type':Sequelize[_0x86f2('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 ddd9165..66b6c0f 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 _0xb96b=['end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','stack','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','keys','filters','intersection','query','fields','attributes','length','model','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','params','options','find','catch','create','body','eml-format','rimraf','zip-dir','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x1b515f,_0x52aa6b){var _0x66ff73=function(_0x2cc081){while(--_0x2cc081){_0x1b515f['push'](_0x1b515f['shift']());}};_0x66ff73(++_0x52aa6b);}(_0xb96b,0xfd));var _0xbb96=function(_0x2d991c,_0x1583d4){_0x2d991c=_0x2d991c-0x0;var _0x3d5af5=_0xb96b[_0x2d991c];return _0x3d5af5;};'use strict';var emlformat=require(_0xbb96('0x0'));var rimraf=require(_0xbb96('0x1'));var zipdir=require(_0xbb96('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbb96('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbb96('0x4'));var sox=require(_0xbb96('0x5'));var csv=require('to-csv');var ejs=require(_0xbb96('0x6'));var fs=require('fs');var fs_extra=require(_0xbb96('0x7'));var _=require(_0xbb96('0x8'));var squel=require(_0xbb96('0x9'));var crypto=require(_0xbb96('0xa'));var jsforce=require(_0xbb96('0xb'));var deskjs=require(_0xbb96('0xc'));var toCsv=require('to-csv');var querystring=require(_0xbb96('0xd'));var Papa=require(_0xbb96('0xe'));var Redis=require(_0xbb96('0xf'));var authService=require(_0xbb96('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xbb96('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbb96('0x12'));var utils=require('../../config/utils');var config=require(_0xbb96('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb96('0x14'))['db'];function respondWithStatusCode(_0x50f376,_0x1369a1){_0x1369a1=_0x1369a1||0xcc;return function(_0x10462a){if(_0x10462a){return _0x50f376[_0xbb96('0x15')](_0x1369a1);}return _0x50f376[_0xbb96('0x16')](_0x1369a1)[_0xbb96('0x17')]();};}function respondWithResult(_0x154b6f,_0x7e0bf9){_0x7e0bf9=_0x7e0bf9||0xc8;return function(_0x238b7c){if(_0x238b7c){return _0x154b6f[_0xbb96('0x16')](_0x7e0bf9)[_0xbb96('0x18')](_0x238b7c);}};}function respondWithFilteredResult(_0x410ca0,_0x43b182){return function(_0x19855e){if(_0x19855e){var _0x8079c0=typeof _0x43b182[_0xbb96('0x19')]===_0xbb96('0x1a')&&typeof _0x43b182[_0xbb96('0x1b')]===_0xbb96('0x1a');var _0xf17f90=_0x19855e[_0xbb96('0x1c')];var _0x1703bb=_0x8079c0?0x0:_0x43b182[_0xbb96('0x19')];var _0x77d361=_0x8079c0?_0x19855e[_0xbb96('0x1c')]:_0x43b182[_0xbb96('0x19')]+_0x43b182[_0xbb96('0x1b')];var _0x273013;if(_0x77d361>=_0xf17f90){_0x77d361=_0xf17f90;_0x273013=0xc8;}else{_0x273013=0xce;}_0x410ca0[_0xbb96('0x16')](_0x273013);return _0x410ca0['set'](_0xbb96('0x1d'),_0x1703bb+'-'+_0x77d361+'/'+_0xf17f90)[_0xbb96('0x18')](_0x19855e);}return null;};}function patchUpdates(_0x2a5e9b){return function(_0x1ea65c){try{jsonpatch[_0xbb96('0x1e')](_0x1ea65c,_0x2a5e9b,!![]);}catch(_0x8da8d5){return BPromise[_0xbb96('0x1f')](_0x8da8d5);}return _0x1ea65c[_0xbb96('0x20')]();};}function saveUpdates(_0x574a7e,_0x49b16e){return function(_0x1adc62){if(_0x1adc62){return _0x1adc62[_0xbb96('0x21')](_0x574a7e)['then'](function(_0xeed2fa){return _0xeed2fa;});}return null;};}function removeEntity(_0x3748ec,_0x28ec20){return function(_0x4bd3f6){if(_0x4bd3f6){return _0x4bd3f6['destroy']()[_0xbb96('0x22')](function(){_0x3748ec[_0xbb96('0x16')](0xcc)[_0xbb96('0x17')]();});}};}function handleEntityNotFound(_0x32c5c7,_0xd78b3c){return function(_0x5a82e5){if(!_0x5a82e5){_0x32c5c7[_0xbb96('0x15')](0x194);}return _0x5a82e5;};}function handleError(_0x52280b,_0x31b124){_0x31b124=_0x31b124||0x1f4;return function(_0x4a9ca6){logger['error'](_0x4a9ca6[_0xbb96('0x23')]);if(_0x4a9ca6[_0xbb96('0x24')]){delete _0x4a9ca6['name'];}_0x52280b[_0xbb96('0x16')](_0x31b124)['send'](_0x4a9ca6);};}exports[_0xbb96('0x25')]=function(_0x4b8162,_0x4bb140){var _0xe18b22={},_0x55d7c9={},_0x102119={'count':0x0,'rows':[]};var _0x5d9e8f=_[_0xbb96('0x26')](db[_0xbb96('0x27')][_0xbb96('0x28')],function(_0x49fdae){return{'name':_0x49fdae[_0xbb96('0x29')],'type':_0x49fdae[_0xbb96('0x2a')][_0xbb96('0x2b')]};});_0x55d7c9['model']=_[_0xbb96('0x26')](_0x5d9e8f,_0xbb96('0x24'));_0x55d7c9['query']=_[_0xbb96('0x2c')](_0x4b8162['query']);_0x55d7c9[_0xbb96('0x2d')]=_[_0xbb96('0x2e')](_0x55d7c9['model'],_0x55d7c9[_0xbb96('0x2f')]);_0xe18b22['attributes']=_[_0xbb96('0x2e')](_0x55d7c9['model'],qs[_0xbb96('0x30')](_0x4b8162['query'][_0xbb96('0x30')]));_0xe18b22[_0xbb96('0x31')]=_0xe18b22[_0xbb96('0x31')][_0xbb96('0x32')]?_0xe18b22['attributes']:_0x55d7c9[_0xbb96('0x33')];if(!_0x4b8162[_0xbb96('0x2f')][_0xbb96('0x34')]('nolimit')){_0xe18b22['limit']=qs['limit'](_0x4b8162[_0xbb96('0x2f')][_0xbb96('0x1b')]);_0xe18b22[_0xbb96('0x19')]=qs[_0xbb96('0x19')](_0x4b8162[_0xbb96('0x2f')][_0xbb96('0x19')]);}_0xe18b22[_0xbb96('0x35')]=qs[_0xbb96('0x36')](_0x4b8162[_0xbb96('0x2f')]['sort']);_0xe18b22[_0xbb96('0x37')]=qs['filters'](_[_0xbb96('0x38')](_0x4b8162['query'],_0x55d7c9[_0xbb96('0x2d')]),_0x5d9e8f);if(_0x4b8162[_0xbb96('0x2f')][_0xbb96('0x39')]){_0xe18b22[_0xbb96('0x37')]=_[_0xbb96('0x3a')](_0xe18b22[_0xbb96('0x37')],{'$or':_[_0xbb96('0x26')](_0x5d9e8f,function(_0xb8d1d){if(_0xb8d1d['type']!=='VIRTUAL'){var _0x148f8c={};_0x148f8c[_0xb8d1d[_0xbb96('0x24')]]={'$like':'%'+_0x4b8162[_0xbb96('0x2f')][_0xbb96('0x39')]+'%'};return _0x148f8c;}})});}_0xe18b22=_['merge']({},_0xe18b22,_0x4b8162['options']);var _0x16aa03={'where':_0xe18b22[_0xbb96('0x37')]};return db[_0xbb96('0x27')][_0xbb96('0x1c')](_0x16aa03)[_0xbb96('0x22')](function(_0x49cea0){_0x102119[_0xbb96('0x1c')]=_0x49cea0;if(_0x4b8162[_0xbb96('0x2f')][_0xbb96('0x3b')]){_0xe18b22[_0xbb96('0x3c')]=[{'all':!![]}];}return db[_0xbb96('0x27')][_0xbb96('0x3d')](_0xe18b22);})[_0xbb96('0x22')](function(_0x5bcaf6){_0x102119[_0xbb96('0x3e')]=_0x5bcaf6;return _0x102119;})[_0xbb96('0x22')](respondWithFilteredResult(_0x4bb140,_0xe18b22))['catch'](handleError(_0x4bb140,null));};exports['show']=function(_0xdaa1e1,_0x1a6dc1){var _0x147414={'raw':!![],'where':{'id':_0xdaa1e1[_0xbb96('0x3f')]['id']}},_0x3fe0d5={};_0x3fe0d5['model']=_[_0xbb96('0x2c')](db[_0xbb96('0x27')][_0xbb96('0x28')]);_0x3fe0d5['query']=_[_0xbb96('0x2c')](_0xdaa1e1[_0xbb96('0x2f')]);_0x3fe0d5['filters']=_['intersection'](_0x3fe0d5[_0xbb96('0x33')],_0x3fe0d5[_0xbb96('0x2f')]);_0x147414[_0xbb96('0x31')]=_[_0xbb96('0x2e')](_0x3fe0d5[_0xbb96('0x33')],qs[_0xbb96('0x30')](_0xdaa1e1[_0xbb96('0x2f')]['fields']));_0x147414[_0xbb96('0x31')]=_0x147414[_0xbb96('0x31')][_0xbb96('0x32')]?_0x147414[_0xbb96('0x31')]:_0x3fe0d5[_0xbb96('0x33')];if(_0xdaa1e1[_0xbb96('0x2f')]['includeAll']){_0x147414[_0xbb96('0x3c')]=[{'all':!![]}];}_0x147414=_['merge']({},_0x147414,_0xdaa1e1[_0xbb96('0x40')]);return db['AnalyticTreeReport'][_0xbb96('0x41')](_0x147414)[_0xbb96('0x22')](handleEntityNotFound(_0x1a6dc1,null))[_0xbb96('0x22')](respondWithResult(_0x1a6dc1,null))[_0xbb96('0x42')](handleError(_0x1a6dc1,null));};exports['create']=function(_0x1d7c35,_0x4dd29f){return db['AnalyticTreeReport'][_0xbb96('0x43')](_0x1d7c35[_0xbb96('0x44')],{})[_0xbb96('0x22')](respondWithResult(_0x4dd29f,0xc9))[_0xbb96('0x42')](handleError(_0x4dd29f,null));};exports[_0xbb96('0x21')]=function(_0x2f52a4,_0x2fb24e){if(_0x2f52a4['body']['id']){delete _0x2f52a4[_0xbb96('0x44')]['id'];}return db[_0xbb96('0x27')][_0xbb96('0x41')]({'where':{'id':_0x2f52a4['params']['id']}})[_0xbb96('0x22')](handleEntityNotFound(_0x2fb24e,null))['then'](saveUpdates(_0x2f52a4[_0xbb96('0x44')],null))[_0xbb96('0x22')](respondWithResult(_0x2fb24e,null))[_0xbb96('0x42')](handleError(_0x2fb24e,null));};exports['destroy']=function(_0x298a54,_0x2afb01){return db[_0xbb96('0x27')][_0xbb96('0x41')]({'where':{'id':_0x298a54['params']['id']}})['then'](handleEntityNotFound(_0x2afb01,null))['then'](removeEntity(_0x2afb01,null))[_0xbb96('0x42')](handleError(_0x2afb01,null));};
\ No newline at end of file
+var _0xeaf7=['json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','params','keys','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x28600d,_0x1cce36){var _0x439f97=function(_0x32d000){while(--_0x32d000){_0x28600d['push'](_0x28600d['shift']());}};_0x439f97(++_0x1cce36);}(_0xeaf7,0x173));var _0x7eaf=function(_0x23f8d8,_0x3da4c7){_0x23f8d8=_0x23f8d8-0x0;var _0x43e485=_0xeaf7[_0x23f8d8];return _0x43e485;};'use strict';var emlformat=require(_0x7eaf('0x0'));var rimraf=require(_0x7eaf('0x1'));var zipdir=require(_0x7eaf('0x2'));var jsonpatch=require(_0x7eaf('0x3'));var rp=require(_0x7eaf('0x4'));var moment=require(_0x7eaf('0x5'));var BPromise=require(_0x7eaf('0x6'));var Mustache=require(_0x7eaf('0x7'));var util=require(_0x7eaf('0x8'));var path=require(_0x7eaf('0x9'));var sox=require(_0x7eaf('0xa'));var csv=require(_0x7eaf('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7eaf('0xc'));var _=require('lodash');var squel=require(_0x7eaf('0xd'));var crypto=require(_0x7eaf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7eaf('0xf'));var toCsv=require(_0x7eaf('0xb'));var querystring=require(_0x7eaf('0x10'));var Papa=require(_0x7eaf('0x11'));var Redis=require(_0x7eaf('0x12'));var authService=require(_0x7eaf('0x13'));var qs=require(_0x7eaf('0x14'));var as=require(_0x7eaf('0x15'));var hardwareService=require(_0x7eaf('0x16'));var logger=require(_0x7eaf('0x17'))('api');var utils=require(_0x7eaf('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7eaf('0x19'));var db=require(_0x7eaf('0x1a'))['db'];function respondWithStatusCode(_0x583cd7,_0x152851){_0x152851=_0x152851||0xcc;return function(_0x134049){if(_0x134049){return _0x583cd7[_0x7eaf('0x1b')](_0x152851);}return _0x583cd7[_0x7eaf('0x1c')](_0x152851)['end']();};}function respondWithResult(_0x422acc,_0x383022){_0x383022=_0x383022||0xc8;return function(_0x197260){if(_0x197260){return _0x422acc[_0x7eaf('0x1c')](_0x383022)[_0x7eaf('0x1d')](_0x197260);}};}function respondWithFilteredResult(_0xa5f8da,_0x50b226){return function(_0x1a6efe){if(_0x1a6efe){var _0x37d9b8=typeof _0x50b226[_0x7eaf('0x1e')]===_0x7eaf('0x1f')&&typeof _0x50b226[_0x7eaf('0x20')]===_0x7eaf('0x1f');var _0xc1c1ca=_0x1a6efe[_0x7eaf('0x21')];var _0x4b77d5=_0x37d9b8?0x0:_0x50b226['offset'];var _0x3239e2=_0x37d9b8?_0x1a6efe[_0x7eaf('0x21')]:_0x50b226['offset']+_0x50b226['limit'];var _0x151f9d;if(_0x3239e2>=_0xc1c1ca){_0x3239e2=_0xc1c1ca;_0x151f9d=0xc8;}else{_0x151f9d=0xce;}_0xa5f8da['status'](_0x151f9d);return _0xa5f8da[_0x7eaf('0x22')](_0x7eaf('0x23'),_0x4b77d5+'-'+_0x3239e2+'/'+_0xc1c1ca)[_0x7eaf('0x1d')](_0x1a6efe);}return null;};}function patchUpdates(_0x57890b){return function(_0x51fcbf){try{jsonpatch['apply'](_0x51fcbf,_0x57890b,!![]);}catch(_0x15fbad){return BPromise[_0x7eaf('0x24')](_0x15fbad);}return _0x51fcbf[_0x7eaf('0x25')]();};}function saveUpdates(_0x4fd9cf,_0x42b3c8){return function(_0xa677aa){if(_0xa677aa){return _0xa677aa[_0x7eaf('0x26')](_0x4fd9cf)[_0x7eaf('0x27')](function(_0x2e8f5e){return _0x2e8f5e;});}return null;};}function removeEntity(_0x185e67,_0x38cfcc){return function(_0xf7071f){if(_0xf7071f){return _0xf7071f[_0x7eaf('0x28')]()[_0x7eaf('0x27')](function(){_0x185e67[_0x7eaf('0x1c')](0xcc)[_0x7eaf('0x29')]();});}};}function handleEntityNotFound(_0x41b45b,_0x146b0b){return function(_0x26ee8a){if(!_0x26ee8a){_0x41b45b[_0x7eaf('0x1b')](0x194);}return _0x26ee8a;};}function handleError(_0x4f9fbf,_0x3b0480){_0x3b0480=_0x3b0480||0x1f4;return function(_0x5eafa9){logger[_0x7eaf('0x2a')](_0x5eafa9['stack']);if(_0x5eafa9[_0x7eaf('0x2b')]){delete _0x5eafa9[_0x7eaf('0x2b')];}_0x4f9fbf[_0x7eaf('0x1c')](_0x3b0480)[_0x7eaf('0x2c')](_0x5eafa9);};}exports[_0x7eaf('0x2d')]=function(_0x548792,_0x2623d0){var _0x5ba9ff={},_0x28ae02={},_0x29446c={'count':0x0,'rows':[]};var _0x3fec26=_[_0x7eaf('0x2e')](db[_0x7eaf('0x2f')][_0x7eaf('0x30')],function(_0x32a95d){return{'name':_0x32a95d[_0x7eaf('0x31')],'type':_0x32a95d['type'][_0x7eaf('0x32')]};});_0x28ae02[_0x7eaf('0x33')]=_[_0x7eaf('0x2e')](_0x3fec26,_0x7eaf('0x2b'));_0x28ae02[_0x7eaf('0x34')]=_['keys'](_0x548792[_0x7eaf('0x34')]);_0x28ae02[_0x7eaf('0x35')]=_[_0x7eaf('0x36')](_0x28ae02[_0x7eaf('0x33')],_0x28ae02[_0x7eaf('0x34')]);_0x5ba9ff[_0x7eaf('0x37')]=_['intersection'](_0x28ae02[_0x7eaf('0x33')],qs[_0x7eaf('0x38')](_0x548792[_0x7eaf('0x34')]['fields']));_0x5ba9ff['attributes']=_0x5ba9ff['attributes'][_0x7eaf('0x39')]?_0x5ba9ff[_0x7eaf('0x37')]:_0x28ae02[_0x7eaf('0x33')];if(!_0x548792[_0x7eaf('0x34')][_0x7eaf('0x3a')](_0x7eaf('0x3b'))){_0x5ba9ff[_0x7eaf('0x20')]=qs['limit'](_0x548792[_0x7eaf('0x34')][_0x7eaf('0x20')]);_0x5ba9ff[_0x7eaf('0x1e')]=qs[_0x7eaf('0x1e')](_0x548792[_0x7eaf('0x34')][_0x7eaf('0x1e')]);}_0x5ba9ff[_0x7eaf('0x3c')]=qs[_0x7eaf('0x3d')](_0x548792[_0x7eaf('0x34')][_0x7eaf('0x3d')]);_0x5ba9ff[_0x7eaf('0x3e')]=qs[_0x7eaf('0x35')](_[_0x7eaf('0x3f')](_0x548792[_0x7eaf('0x34')],_0x28ae02[_0x7eaf('0x35')]),_0x3fec26);if(_0x548792['query'][_0x7eaf('0x40')]){_0x5ba9ff['where']=_[_0x7eaf('0x41')](_0x5ba9ff['where'],{'$or':_['map'](_0x3fec26,function(_0x5dd6f5){if(_0x5dd6f5[_0x7eaf('0x42')]!==_0x7eaf('0x43')){var _0x20578c={};_0x20578c[_0x5dd6f5[_0x7eaf('0x2b')]]={'$like':'%'+_0x548792['query'][_0x7eaf('0x40')]+'%'};return _0x20578c;}})});}_0x5ba9ff=_[_0x7eaf('0x41')]({},_0x5ba9ff,_0x548792[_0x7eaf('0x44')]);var _0x3d63ab={'where':_0x5ba9ff[_0x7eaf('0x3e')]};return db[_0x7eaf('0x2f')][_0x7eaf('0x21')](_0x3d63ab)[_0x7eaf('0x27')](function(_0x1b29cc){_0x29446c[_0x7eaf('0x21')]=_0x1b29cc;if(_0x548792[_0x7eaf('0x34')]['includeAll']){_0x5ba9ff[_0x7eaf('0x45')]=[{'all':!![]}];}return db[_0x7eaf('0x2f')][_0x7eaf('0x46')](_0x5ba9ff);})[_0x7eaf('0x27')](function(_0x158b94){_0x29446c[_0x7eaf('0x47')]=_0x158b94;return _0x29446c;})[_0x7eaf('0x27')](respondWithFilteredResult(_0x2623d0,_0x5ba9ff))['catch'](handleError(_0x2623d0,null));};exports[_0x7eaf('0x48')]=function(_0x53ae2f,_0x355205){var _0x3063bf={'raw':!![],'where':{'id':_0x53ae2f[_0x7eaf('0x49')]['id']}},_0x5b3843={};_0x5b3843[_0x7eaf('0x33')]=_[_0x7eaf('0x4a')](db['AnalyticTreeReport'][_0x7eaf('0x30')]);_0x5b3843[_0x7eaf('0x34')]=_['keys'](_0x53ae2f[_0x7eaf('0x34')]);_0x5b3843[_0x7eaf('0x35')]=_[_0x7eaf('0x36')](_0x5b3843[_0x7eaf('0x33')],_0x5b3843[_0x7eaf('0x34')]);_0x3063bf['attributes']=_[_0x7eaf('0x36')](_0x5b3843[_0x7eaf('0x33')],qs[_0x7eaf('0x38')](_0x53ae2f[_0x7eaf('0x34')][_0x7eaf('0x38')]));_0x3063bf['attributes']=_0x3063bf[_0x7eaf('0x37')][_0x7eaf('0x39')]?_0x3063bf[_0x7eaf('0x37')]:_0x5b3843[_0x7eaf('0x33')];if(_0x53ae2f[_0x7eaf('0x34')][_0x7eaf('0x4b')]){_0x3063bf[_0x7eaf('0x45')]=[{'all':!![]}];}_0x3063bf=_[_0x7eaf('0x41')]({},_0x3063bf,_0x53ae2f[_0x7eaf('0x44')]);return db[_0x7eaf('0x2f')][_0x7eaf('0x4c')](_0x3063bf)[_0x7eaf('0x27')](handleEntityNotFound(_0x355205,null))[_0x7eaf('0x27')](respondWithResult(_0x355205,null))[_0x7eaf('0x4d')](handleError(_0x355205,null));};exports[_0x7eaf('0x4e')]=function(_0x179576,_0x3d8288){return db[_0x7eaf('0x2f')][_0x7eaf('0x4e')](_0x179576[_0x7eaf('0x4f')],{})[_0x7eaf('0x27')](respondWithResult(_0x3d8288,0xc9))['catch'](handleError(_0x3d8288,null));};exports[_0x7eaf('0x26')]=function(_0x5969b6,_0x10d63b){if(_0x5969b6[_0x7eaf('0x4f')]['id']){delete _0x5969b6[_0x7eaf('0x4f')]['id'];}return db[_0x7eaf('0x2f')][_0x7eaf('0x4c')]({'where':{'id':_0x5969b6[_0x7eaf('0x49')]['id']}})[_0x7eaf('0x27')](handleEntityNotFound(_0x10d63b,null))['then'](saveUpdates(_0x5969b6['body'],null))[_0x7eaf('0x27')](respondWithResult(_0x10d63b,null))[_0x7eaf('0x4d')](handleError(_0x10d63b,null));};exports[_0x7eaf('0x28')]=function(_0x2e86b1,_0x121bab){return db[_0x7eaf('0x2f')][_0x7eaf('0x4c')]({'where':{'id':_0x2e86b1[_0x7eaf('0x49')]['id']}})[_0x7eaf('0x27')](handleEntityNotFound(_0x121bab,null))['then'](removeEntity(_0x121bab,null))[_0x7eaf('0x4d')](handleError(_0x121bab,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 3b60112..79ed49f 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 _0xe3bd=['request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','moment'];(function(_0x360cf1,_0x3c9321){var _0x1d1c80=function(_0x295473){while(--_0x295473){_0x360cf1['push'](_0x360cf1['shift']());}};_0x1d1c80(++_0x3c9321);}(_0xe3bd,0x19f));var _0xde3b=function(_0x4551f6,_0x48151b){_0x4551f6=_0x4551f6-0x0;var _0x581dc2=_0xe3bd[_0x4551f6];return _0x581dc2;};'use strict';var _=require('lodash');var util=require(_0xde3b('0x0'));var logger=require(_0xde3b('0x1'))('api');var moment=require(_0xde3b('0x2'));var BPromise=require('bluebird');var rp=require(_0xde3b('0x3'));var fs=require('fs');var path=require(_0xde3b('0x4'));var rimraf=require(_0xde3b('0x5'));var config=require(_0xde3b('0x6'));var attributes=require(_0xde3b('0x7'));module[_0xde3b('0x8')]=function(_0x5569ff,_0x29a1dc){return _0x5569ff['define'](_0xde3b('0x9'),attributes,{'tableName':_0xde3b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd0e7=['bluebird','request-promise','rimraf','../../config/environment','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger'];(function(_0x512f86,_0x10d5cf){var _0xf8c104=function(_0x57e005){while(--_0x57e005){_0x512f86['push'](_0x512f86['shift']());}};_0xf8c104(++_0x10d5cf);}(_0xd0e7,0xef));var _0x7d0e=function(_0x3c22e0,_0x1dc6ea){_0x3c22e0=_0x3c22e0-0x0;var _0x215811=_0xd0e7[_0x3c22e0];return _0x215811;};'use strict';var _=require(_0x7d0e('0x0'));var util=require(_0x7d0e('0x1'));var logger=require(_0x7d0e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7d0e('0x3'));var rp=require(_0x7d0e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d0e('0x5'));var config=require(_0x7d0e('0x6'));var attributes=require('./analyticTreeReport.attributes');module[_0x7d0e('0x7')]=function(_0x54dcaa,_0x1d3a79){return _0x54dcaa[_0x7d0e('0x8')](_0x7d0e('0x9'),attributes,{'tableName':_0x7d0e('0xa'),'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 ee66dcd..efd8758 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x272282,_0x2e94a0){var _0xedf511=function(_0x5d1ab6){while(--_0x5d1ab6){_0x272282['push'](_0x272282['shift']());}};_0xedf511(++_0x2e94a0);}(_0xadb5,0xad));var _0x5adb=function(_0x420868,_0x3719af){_0x420868=_0x420868-0x0;var _0x3a06a3=_0xadb5[_0x420868];return _0x3a06a3;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
+var _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(_0x40cbba,_0x4208e5){var _0x4dc247=function(_0x27f763){while(--_0x27f763){_0x40cbba['push'](_0x40cbba['shift']());}};_0x4dc247(++_0x4208e5);}(_0xdb28,0x106));var _0x8db2=function(_0x1d6d89,_0x256025){_0x1d6d89=_0x1d6d89-0x0;var _0x9f9416=_0xdb28[_0x1d6d89];return _0x9f9416;};'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 fc17b5b..0486d28 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 _0xe308=['./analyticTreeReport.controller','get','index','show','post','isAuthenticated','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x13ae4a,_0x4b8c49){var _0x514426=function(_0x2a3a3b){while(--_0x2a3a3b){_0x13ae4a['push'](_0x13ae4a['shift']());}};_0x514426(++_0x4b8c49);}(_0xe308,0x175));var _0x8e30=function(_0x2d5fb2,_0x1706f1){_0x2d5fb2=_0x2d5fb2-0x0;var _0x58439d=_0xe308[_0x2d5fb2];return _0x58439d;};'use strict';var multer=require(_0x8e30('0x0'));var util=require(_0x8e30('0x1'));var path=require(_0x8e30('0x2'));var timeout=require(_0x8e30('0x3'));var express=require('express');var router=express[_0x8e30('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8e30('0x5'));var config=require(_0x8e30('0x6'));var controller=require(_0x8e30('0x7'));router[_0x8e30('0x8')]('/',auth['isAuthenticated'](),controller[_0x8e30('0x9')]);router[_0x8e30('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x8e30('0xa')]);router[_0x8e30('0xb')]('/',auth[_0x8e30('0xc')](),controller[_0x8e30('0xd')]);router[_0x8e30('0xe')](_0x8e30('0xf'),auth[_0x8e30('0xc')](),controller['update']);router[_0x8e30('0x10')](_0x8e30('0xf'),auth[_0x8e30('0xc')](),controller[_0x8e30('0x11')]);module[_0x8e30('0x12')]=router;
\ No newline at end of file
+var _0x0ecc=['show','post','update','destroy','util','Router','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated'];(function(_0x461bd4,_0x1e283b){var _0x23cae7=function(_0x4ed63d){while(--_0x4ed63d){_0x461bd4['push'](_0x461bd4['shift']());}};_0x23cae7(++_0x1e283b);}(_0x0ecc,0x100));var _0xc0ec=function(_0x5d3da8,_0x2f264f){_0x5d3da8=_0x5d3da8-0x0;var _0x54c5b6=_0x0ecc[_0x5d3da8];return _0x54c5b6;};'use strict';var multer=require('multer');var util=require(_0xc0ec('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc0ec('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc0ec('0x2'));var config=require(_0xc0ec('0x3'));var controller=require('./analyticTreeReport.controller');router[_0xc0ec('0x4')]('/',auth['isAuthenticated'](),controller[_0xc0ec('0x5')]);router[_0xc0ec('0x4')](_0xc0ec('0x6'),auth[_0xc0ec('0x7')](),controller[_0xc0ec('0x8')]);router[_0xc0ec('0x9')]('/',auth[_0xc0ec('0x7')](),controller['create']);router['put'](_0xc0ec('0x6'),auth[_0xc0ec('0x7')](),controller[_0xc0ec('0xa')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc0ec('0xb')]);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 f1bbd0b..6438b59 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 _0xe13e=['STRING'];(function(_0x403b7c,_0x4ff6bc){var _0x4a4272=function(_0x1ce280){while(--_0x1ce280){_0x403b7c['push'](_0x403b7c['shift']());}};_0x4a4272(++_0x4ff6bc);}(_0xe13e,0xde));var _0xee13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe13e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xee13('0x0')]},'basename':{'type':Sequelize[_0xee13('0x0')]},'type':{'type':Sequelize[_0xee13('0x0')]}};
\ No newline at end of file
+var _0x6183=['STRING','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6183,0x19b));var _0x3618=function(_0x28611e,_0x586726){_0x28611e=_0x28611e-0x0;var _0x530f69=_0x6183[_0x28611e];return _0x530f69;};'use strict';var Sequelize=require('sequelize');module[_0x3618('0x0')]={'name':{'type':Sequelize[_0x3618('0x1')]},'basename':{'type':Sequelize[_0x3618('0x1')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 778a887..a0a2856 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 _0x38ff=['filters','pick','filter','where','merge','options','includeAll','include','rows','catch','show','params','clone','get','omit','body','createdAt','updatedAt','create','update','find','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','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','sendStatus','end','status','json','offset','limit','undefined','count','apply','reject','destroy','then','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x409ea0,_0x24d255){var _0x983244=function(_0x17a19){while(--_0x17a19){_0x409ea0['push'](_0x409ea0['shift']());}};_0x983244(++_0x24d255);}(_0x38ff,0x7e));var _0xf38f=function(_0xadc7d9,_0x203608){_0xadc7d9=_0xadc7d9-0x0;var _0x915ca1=_0x38ff[_0xadc7d9];return _0x915ca1;};'use strict';var emlformat=require(_0xf38f('0x0'));var rimraf=require(_0xf38f('0x1'));var zipdir=require(_0xf38f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf38f('0x3'));var moment=require(_0xf38f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf38f('0x5'));var util=require(_0xf38f('0x6'));var path=require('path');var sox=require(_0xf38f('0x7'));var csv=require(_0xf38f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf38f('0x9'));var _=require(_0xf38f('0xa'));var squel=require(_0xf38f('0xb'));var crypto=require(_0xf38f('0xc'));var jsforce=require(_0xf38f('0xd'));var deskjs=require(_0xf38f('0xe'));var toCsv=require(_0xf38f('0x8'));var querystring=require(_0xf38f('0xf'));var Papa=require(_0xf38f('0x10'));var Redis=require('ioredis');var authService=require(_0xf38f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf38f('0x12'));var hardwareService=require(_0xf38f('0x13'));var logger=require(_0xf38f('0x14'))(_0xf38f('0x15'));var utils=require(_0xf38f('0x16'));var config=require(_0xf38f('0x17'));var licenseUtil=require(_0xf38f('0x18'));var db=require(_0xf38f('0x19'))['db'];function respondWithStatusCode(_0x45748b,_0x258385){_0x258385=_0x258385||0xcc;return function(_0x2fe1f8){if(_0x2fe1f8){return _0x45748b[_0xf38f('0x1a')](_0x258385);}return _0x45748b['status'](_0x258385)[_0xf38f('0x1b')]();};}function respondWithResult(_0x3d4e22,_0x3b2af0){_0x3b2af0=_0x3b2af0||0xc8;return function(_0x46093a){if(_0x46093a){return _0x3d4e22[_0xf38f('0x1c')](_0x3b2af0)[_0xf38f('0x1d')](_0x46093a);}};}function respondWithFilteredResult(_0x358a99,_0x50cdfa){return function(_0x59465d){if(_0x59465d){var _0x1d40c2=typeof _0x50cdfa[_0xf38f('0x1e')]==='undefined'&&typeof _0x50cdfa[_0xf38f('0x1f')]===_0xf38f('0x20');var _0x3d686a=_0x59465d[_0xf38f('0x21')];var _0x454845=_0x1d40c2?0x0:_0x50cdfa['offset'];var _0xf6ff42=_0x1d40c2?_0x59465d['count']:_0x50cdfa[_0xf38f('0x1e')]+_0x50cdfa[_0xf38f('0x1f')];var _0x46a66f;if(_0xf6ff42>=_0x3d686a){_0xf6ff42=_0x3d686a;_0x46a66f=0xc8;}else{_0x46a66f=0xce;}_0x358a99[_0xf38f('0x1c')](_0x46a66f);return _0x358a99['set']('Content-Range',_0x454845+'-'+_0xf6ff42+'/'+_0x3d686a)[_0xf38f('0x1d')](_0x59465d);}return null;};}function patchUpdates(_0x2f4ac9){return function(_0x283f01){try{jsonpatch[_0xf38f('0x22')](_0x283f01,_0x2f4ac9,!![]);}catch(_0x41f84c){return BPromise[_0xf38f('0x23')](_0x41f84c);}return _0x283f01['save']();};}function saveUpdates(_0x326ee5,_0x4e3e03){return function(_0x146992){if(_0x146992){return _0x146992['update'](_0x326ee5)['then'](function(_0x4098a7){return _0x4098a7;});}return null;};}function removeEntity(_0x30c4f0,_0x1b00f3){return function(_0x293dc2){if(_0x293dc2){return _0x293dc2[_0xf38f('0x24')]()[_0xf38f('0x25')](function(){_0x30c4f0[_0xf38f('0x1c')](0xcc)[_0xf38f('0x1b')]();});}};}function handleEntityNotFound(_0x3a6020,_0x51621e){return function(_0x3f7bbc){if(!_0x3f7bbc){_0x3a6020[_0xf38f('0x1a')](0x194);}return _0x3f7bbc;};}function handleError(_0x5956ca,_0x48f86e){_0x48f86e=_0x48f86e||0x1f4;return function(_0x5dcbd6){logger[_0xf38f('0x26')](_0x5dcbd6[_0xf38f('0x27')]);if(_0x5dcbd6[_0xf38f('0x28')]){delete _0x5dcbd6[_0xf38f('0x28')];}_0x5956ca[_0xf38f('0x1c')](_0x48f86e)[_0xf38f('0x29')](_0x5dcbd6);};}exports[_0xf38f('0x2a')]=function(_0x28f247,_0x52696f){var _0x5b81ce={},_0x1d895b={},_0xf41424={'count':0x0,'rows':[]};var _0x4aecdd=_[_0xf38f('0x2b')](db[_0xf38f('0x2c')][_0xf38f('0x2d')],function(_0x57e937){return{'name':_0x57e937[_0xf38f('0x2e')],'type':_0x57e937[_0xf38f('0x2f')][_0xf38f('0x30')]};});_0x1d895b['model']=_[_0xf38f('0x2b')](_0x4aecdd,_0xf38f('0x28'));_0x1d895b[_0xf38f('0x31')]=_[_0xf38f('0x32')](_0x28f247['query']);_0x1d895b['filters']=_[_0xf38f('0x33')](_0x1d895b['model'],_0x1d895b[_0xf38f('0x31')]);_0x5b81ce['attributes']=_[_0xf38f('0x33')](_0x1d895b[_0xf38f('0x34')],qs['fields'](_0x28f247[_0xf38f('0x31')][_0xf38f('0x35')]));_0x5b81ce[_0xf38f('0x36')]=_0x5b81ce[_0xf38f('0x36')][_0xf38f('0x37')]?_0x5b81ce[_0xf38f('0x36')]:_0x1d895b['model'];if(!_0x28f247[_0xf38f('0x31')][_0xf38f('0x38')](_0xf38f('0x39'))){_0x5b81ce[_0xf38f('0x1f')]=qs[_0xf38f('0x1f')](_0x28f247[_0xf38f('0x31')][_0xf38f('0x1f')]);_0x5b81ce['offset']=qs[_0xf38f('0x1e')](_0x28f247['query'][_0xf38f('0x1e')]);}_0x5b81ce[_0xf38f('0x3a')]=qs[_0xf38f('0x3b')](_0x28f247[_0xf38f('0x31')][_0xf38f('0x3b')]);_0x5b81ce['where']=qs[_0xf38f('0x3c')](_[_0xf38f('0x3d')](_0x28f247[_0xf38f('0x31')],_0x1d895b[_0xf38f('0x3c')]),_0x4aecdd);if(_0x28f247[_0xf38f('0x31')][_0xf38f('0x3e')]){_0x5b81ce[_0xf38f('0x3f')]=_[_0xf38f('0x40')](_0x5b81ce[_0xf38f('0x3f')],{'$or':_[_0xf38f('0x2b')](_0x4aecdd,function(_0x28419d){if(_0x28419d[_0xf38f('0x2f')]!=='VIRTUAL'){var _0x4be876={};_0x4be876[_0x28419d[_0xf38f('0x28')]]={'$like':'%'+_0x28f247[_0xf38f('0x31')]['filter']+'%'};return _0x4be876;}})});}_0x5b81ce=_[_0xf38f('0x40')]({},_0x5b81ce,_0x28f247[_0xf38f('0x41')]);var _0x12f0d6={'where':_0x5b81ce[_0xf38f('0x3f')]};return db[_0xf38f('0x2c')][_0xf38f('0x21')](_0x12f0d6)['then'](function(_0x11d8b5){_0xf41424[_0xf38f('0x21')]=_0x11d8b5;if(_0x28f247['query'][_0xf38f('0x42')]){_0x5b81ce[_0xf38f('0x43')]=[{'all':!![]}];}return db[_0xf38f('0x2c')]['findAll'](_0x5b81ce);})[_0xf38f('0x25')](function(_0x3a1509){_0xf41424[_0xf38f('0x44')]=_0x3a1509;return _0xf41424;})['then'](respondWithFilteredResult(_0x52696f,_0x5b81ce))[_0xf38f('0x45')](handleError(_0x52696f,null));};exports[_0xf38f('0x46')]=function(_0x2c0309,_0x2a4e14){var _0x2ca5b4={'raw':!![],'where':{'id':_0x2c0309[_0xf38f('0x47')]['id']}},_0x5980ad={};_0x5980ad[_0xf38f('0x34')]=_['keys'](db[_0xf38f('0x2c')]['rawAttributes']);_0x5980ad[_0xf38f('0x31')]=_['keys'](_0x2c0309['query']);_0x5980ad[_0xf38f('0x3c')]=_['intersection'](_0x5980ad[_0xf38f('0x34')],_0x5980ad[_0xf38f('0x31')]);_0x2ca5b4[_0xf38f('0x36')]=_[_0xf38f('0x33')](_0x5980ad[_0xf38f('0x34')],qs[_0xf38f('0x35')](_0x2c0309[_0xf38f('0x31')][_0xf38f('0x35')]));_0x2ca5b4['attributes']=_0x2ca5b4['attributes'][_0xf38f('0x37')]?_0x2ca5b4['attributes']:_0x5980ad[_0xf38f('0x34')];if(_0x2c0309[_0xf38f('0x31')][_0xf38f('0x42')]){_0x2ca5b4[_0xf38f('0x43')]=[{'all':!![]}];}_0x2ca5b4=_[_0xf38f('0x40')]({},_0x2ca5b4,_0x2c0309[_0xf38f('0x41')]);return db[_0xf38f('0x2c')]['find'](_0x2ca5b4)[_0xf38f('0x25')](handleEntityNotFound(_0x2a4e14,null))[_0xf38f('0x25')](respondWithResult(_0x2a4e14,null))[_0xf38f('0x45')](handleError(_0x2a4e14,null));};exports[_0xf38f('0x48')]=function(_0xb1af4f,_0x26f3a0){var _0xe616c6={'where':{'id':_0xb1af4f[_0xf38f('0x47')]['id']}},_0x373f66={};_0x373f66[_0xf38f('0x34')]=_[_0xf38f('0x32')](db[_0xf38f('0x2c')][_0xf38f('0x2d')]);_0xe616c6[_0xf38f('0x36')]=_[_0xf38f('0x33')](_0x373f66[_0xf38f('0x34')],qs['fields'](_0xb1af4f[_0xf38f('0x31')][_0xf38f('0x35')]));_0xe616c6[_0xf38f('0x36')]=_0xe616c6[_0xf38f('0x36')][_0xf38f('0x37')]?_0xe616c6[_0xf38f('0x36')]:_0x373f66[_0xf38f('0x34')];if(_0xb1af4f[_0xf38f('0x31')][_0xf38f('0x42')]){_0xe616c6[_0xf38f('0x43')]=[{'all':!![]}];}_0xe616c6=_['merge']({},_0xe616c6,_0xb1af4f[_0xf38f('0x41')]);return db[_0xf38f('0x2c')]['find'](_0xe616c6)['then'](handleEntityNotFound(_0x26f3a0,null))[_0xf38f('0x25')](function(_0x140f19){if(_0x140f19){var _0x457679=_0x140f19[_0xf38f('0x49')]({'plain':!![]});_0x457679=qs[_0xf38f('0x4a')](_0x457679,['id','createdAt','updatedAt']);_0xb1af4f[_0xf38f('0x4b')]=_[_0xf38f('0x4a')](_0xb1af4f[_0xf38f('0x4b')],['id',_0xf38f('0x4c'),_0xf38f('0x4d')]);return db[_0xf38f('0x2c')][_0xf38f('0x4e')](_['merge'](_0x457679,_0xb1af4f[_0xf38f('0x4b')]),{'include':_0xb1af4f[_0xf38f('0x31')][_0xf38f('0x42')]?[{'all':!![]}]:undefined});}})[_0xf38f('0x25')](respondWithResult(_0x26f3a0,0xc9))[_0xf38f('0x45')](handleError(_0x26f3a0,null));};exports[_0xf38f('0x4f')]=function(_0x41ce38,_0x1c888d){if(_0x41ce38[_0xf38f('0x4b')]['id']){delete _0x41ce38[_0xf38f('0x4b')]['id'];}return db['Attachment'][_0xf38f('0x50')]({'where':{'id':_0x41ce38['params']['id']}})[_0xf38f('0x25')](handleEntityNotFound(_0x1c888d,null))['then'](saveUpdates(_0x41ce38['body'],null))['then'](respondWithResult(_0x1c888d,null))['catch'](handleError(_0x1c888d,null));};exports[_0xf38f('0x24')]=function(_0x140c05,_0x3cbfa7){return db[_0xf38f('0x2c')][_0xf38f('0x50')]({'where':{'id':_0x140c05['params']['id']}})[_0xf38f('0x25')](handleEntityNotFound(_0x3cbfa7,null))[_0xf38f('0x25')](removeEntity(_0x3cbfa7,null))[_0xf38f('0x45')](handleError(_0x3cbfa7,null));};exports[_0xf38f('0x4e')]=function(_0x5e2a82,_0x13d57c,_0x17cc62){_0x5e2a82[_0xf38f('0x4b')][_0xf38f('0x28')]=_0x5e2a82[_0xf38f('0x51')][_0xf38f('0x52')];_0x5e2a82[_0xf38f('0x4b')][_0xf38f('0x53')]=_0x5e2a82['file'][_0xf38f('0x54')];_0x5e2a82[_0xf38f('0x4b')][_0xf38f('0x2f')]=_0x5e2a82['file'][_0xf38f('0x55')];return db[_0xf38f('0x2c')][_0xf38f('0x4e')](_0x5e2a82[_0xf38f('0x4b')])[_0xf38f('0x25')](respondWithResult(_0x13d57c,0xc9))['catch'](handleError(_0x13d57c,null));};exports[_0xf38f('0x56')]=function(_0x3e0d03,_0x1a6578,_0x386cc9){return db['Attachment'][_0xf38f('0x57')]({'where':{'id':_0x3e0d03[_0xf38f('0x47')]['id']},'raw':!![]})[_0xf38f('0x25')](handleEntityNotFound(_0x1a6578,null))[_0xf38f('0x25')](function(_0x3d18cd){if(_0x3d18cd){var _0x4d9232=_0x3d18cd[_0xf38f('0x58')]!==null;var _0x58ae99=path['join'](config[_0xf38f('0x59')],_0xf38f('0x5a'));if(_0x4d9232){_0x58ae99=path[_0xf38f('0x5b')](_0x58ae99,_0xf38f('0x5c'));}var _0x5b0b1b=path[_0xf38f('0x5b')](_0x58ae99,_0x3d18cd[_0xf38f('0x53')]);return _0x1a6578[_0xf38f('0x56')](_0x5b0b1b);}})[_0xf38f('0x45')](handleError(_0x1a6578,null));};
\ No newline at end of file
+var _0xb19a=['clone','includeAll','get','omit','createdAt','updatedAt','body','create','originalname','basename','file','mimetype','download','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','Attachment','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','findAll','catch','show','params','rawAttributes','include','options','find'];(function(_0x35007a,_0x58a0d4){var _0x574f68=function(_0xd1c129){while(--_0xd1c129){_0x35007a['push'](_0x35007a['shift']());}};_0x574f68(++_0x58a0d4);}(_0xb19a,0xc4));var _0xab19=function(_0x1dee09,_0x396388){_0x1dee09=_0x1dee09-0x0;var _0x67231e=_0xb19a[_0x1dee09];return _0x67231e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab19('0x0'));var zipdir=require(_0xab19('0x1'));var jsonpatch=require(_0xab19('0x2'));var rp=require(_0xab19('0x3'));var moment=require('moment');var BPromise=require(_0xab19('0x4'));var Mustache=require(_0xab19('0x5'));var util=require(_0xab19('0x6'));var path=require('path');var sox=require(_0xab19('0x7'));var csv=require('to-csv');var ejs=require(_0xab19('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab19('0x9'));var squel=require(_0xab19('0xa'));var crypto=require(_0xab19('0xb'));var jsforce=require(_0xab19('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xab19('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xab19('0xe'));var qs=require(_0xab19('0xf'));var as=require(_0xab19('0x10'));var hardwareService=require(_0xab19('0x11'));var logger=require(_0xab19('0x12'))('api');var utils=require(_0xab19('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xab19('0x14'));var db=require(_0xab19('0x15'))['db'];function respondWithStatusCode(_0x3090cb,_0x5d83a5){_0x5d83a5=_0x5d83a5||0xcc;return function(_0x1bf557){if(_0x1bf557){return _0x3090cb[_0xab19('0x16')](_0x5d83a5);}return _0x3090cb[_0xab19('0x17')](_0x5d83a5)[_0xab19('0x18')]();};}function respondWithResult(_0x2cd579,_0x194396){_0x194396=_0x194396||0xc8;return function(_0x2ae465){if(_0x2ae465){return _0x2cd579[_0xab19('0x17')](_0x194396)[_0xab19('0x19')](_0x2ae465);}};}function respondWithFilteredResult(_0x4217bb,_0x50d517){return function(_0x51bd5b){if(_0x51bd5b){var _0x48af00=typeof _0x50d517[_0xab19('0x1a')]==='undefined'&&typeof _0x50d517[_0xab19('0x1b')]===_0xab19('0x1c');var _0x58944c=_0x51bd5b['count'];var _0x291105=_0x48af00?0x0:_0x50d517[_0xab19('0x1a')];var _0x30cb92=_0x48af00?_0x51bd5b[_0xab19('0x1d')]:_0x50d517['offset']+_0x50d517['limit'];var _0x45f6b5;if(_0x30cb92>=_0x58944c){_0x30cb92=_0x58944c;_0x45f6b5=0xc8;}else{_0x45f6b5=0xce;}_0x4217bb[_0xab19('0x17')](_0x45f6b5);return _0x4217bb[_0xab19('0x1e')](_0xab19('0x1f'),_0x291105+'-'+_0x30cb92+'/'+_0x58944c)[_0xab19('0x19')](_0x51bd5b);}return null;};}function patchUpdates(_0x20034f){return function(_0x2e4595){try{jsonpatch[_0xab19('0x20')](_0x2e4595,_0x20034f,!![]);}catch(_0x378024){return BPromise[_0xab19('0x21')](_0x378024);}return _0x2e4595['save']();};}function saveUpdates(_0x6807e0,_0x96ab80){return function(_0x2dd24a){if(_0x2dd24a){return _0x2dd24a[_0xab19('0x22')](_0x6807e0)[_0xab19('0x23')](function(_0x38e0a9){return _0x38e0a9;});}return null;};}function removeEntity(_0x32203d,_0x40060e){return function(_0x12dc24){if(_0x12dc24){return _0x12dc24[_0xab19('0x24')]()[_0xab19('0x23')](function(){_0x32203d[_0xab19('0x17')](0xcc)[_0xab19('0x18')]();});}};}function handleEntityNotFound(_0x21ab58,_0x1dd803){return function(_0x62923){if(!_0x62923){_0x21ab58[_0xab19('0x16')](0x194);}return _0x62923;};}function handleError(_0x3e04c9,_0x3677c1){_0x3677c1=_0x3677c1||0x1f4;return function(_0x47dc06){logger[_0xab19('0x25')](_0x47dc06[_0xab19('0x26')]);if(_0x47dc06[_0xab19('0x27')]){delete _0x47dc06[_0xab19('0x27')];}_0x3e04c9['status'](_0x3677c1)[_0xab19('0x28')](_0x47dc06);};}exports[_0xab19('0x29')]=function(_0x3cc92d,_0x2491df){var _0x35832c={},_0x21b78c={},_0x2443ce={'count':0x0,'rows':[]};var _0x1656ea=_['map'](db[_0xab19('0x2a')]['rawAttributes'],function(_0x3a095c){return{'name':_0x3a095c[_0xab19('0x2b')],'type':_0x3a095c[_0xab19('0x2c')][_0xab19('0x2d')]};});_0x21b78c[_0xab19('0x2e')]=_[_0xab19('0x2f')](_0x1656ea,_0xab19('0x27'));_0x21b78c['query']=_[_0xab19('0x30')](_0x3cc92d['query']);_0x21b78c[_0xab19('0x31')]=_[_0xab19('0x32')](_0x21b78c[_0xab19('0x2e')],_0x21b78c[_0xab19('0x33')]);_0x35832c[_0xab19('0x34')]=_[_0xab19('0x32')](_0x21b78c[_0xab19('0x2e')],qs[_0xab19('0x35')](_0x3cc92d[_0xab19('0x33')]['fields']));_0x35832c[_0xab19('0x34')]=_0x35832c[_0xab19('0x34')][_0xab19('0x36')]?_0x35832c[_0xab19('0x34')]:_0x21b78c['model'];if(!_0x3cc92d[_0xab19('0x33')][_0xab19('0x37')]('nolimit')){_0x35832c[_0xab19('0x1b')]=qs[_0xab19('0x1b')](_0x3cc92d[_0xab19('0x33')][_0xab19('0x1b')]);_0x35832c[_0xab19('0x1a')]=qs[_0xab19('0x1a')](_0x3cc92d[_0xab19('0x33')]['offset']);}_0x35832c[_0xab19('0x38')]=qs['sort'](_0x3cc92d[_0xab19('0x33')][_0xab19('0x39')]);_0x35832c[_0xab19('0x3a')]=qs[_0xab19('0x31')](_[_0xab19('0x3b')](_0x3cc92d[_0xab19('0x33')],_0x21b78c[_0xab19('0x31')]),_0x1656ea);if(_0x3cc92d['query'][_0xab19('0x3c')]){_0x35832c['where']=_[_0xab19('0x3d')](_0x35832c[_0xab19('0x3a')],{'$or':_[_0xab19('0x2f')](_0x1656ea,function(_0xea1121){if(_0xea1121[_0xab19('0x2c')]!==_0xab19('0x3e')){var _0x5ebe61={};_0x5ebe61[_0xea1121[_0xab19('0x27')]]={'$like':'%'+_0x3cc92d[_0xab19('0x33')][_0xab19('0x3c')]+'%'};return _0x5ebe61;}})});}_0x35832c=_[_0xab19('0x3d')]({},_0x35832c,_0x3cc92d['options']);var _0x10db71={'where':_0x35832c[_0xab19('0x3a')]};return db['Attachment']['count'](_0x10db71)['then'](function(_0x10842a){_0x2443ce[_0xab19('0x1d')]=_0x10842a;if(_0x3cc92d[_0xab19('0x33')]['includeAll']){_0x35832c['include']=[{'all':!![]}];}return db['Attachment'][_0xab19('0x3f')](_0x35832c);})['then'](function(_0x3d2e8b){_0x2443ce['rows']=_0x3d2e8b;return _0x2443ce;})[_0xab19('0x23')](respondWithFilteredResult(_0x2491df,_0x35832c))[_0xab19('0x40')](handleError(_0x2491df,null));};exports[_0xab19('0x41')]=function(_0x1966da,_0x1b3e19){var _0x341ad4={'raw':!![],'where':{'id':_0x1966da[_0xab19('0x42')]['id']}},_0x57e40d={};_0x57e40d['model']=_[_0xab19('0x30')](db[_0xab19('0x2a')][_0xab19('0x43')]);_0x57e40d[_0xab19('0x33')]=_[_0xab19('0x30')](_0x1966da[_0xab19('0x33')]);_0x57e40d[_0xab19('0x31')]=_['intersection'](_0x57e40d[_0xab19('0x2e')],_0x57e40d[_0xab19('0x33')]);_0x341ad4[_0xab19('0x34')]=_[_0xab19('0x32')](_0x57e40d[_0xab19('0x2e')],qs[_0xab19('0x35')](_0x1966da[_0xab19('0x33')][_0xab19('0x35')]));_0x341ad4[_0xab19('0x34')]=_0x341ad4[_0xab19('0x34')][_0xab19('0x36')]?_0x341ad4['attributes']:_0x57e40d[_0xab19('0x2e')];if(_0x1966da['query']['includeAll']){_0x341ad4[_0xab19('0x44')]=[{'all':!![]}];}_0x341ad4=_[_0xab19('0x3d')]({},_0x341ad4,_0x1966da[_0xab19('0x45')]);return db[_0xab19('0x2a')][_0xab19('0x46')](_0x341ad4)[_0xab19('0x23')](handleEntityNotFound(_0x1b3e19,null))[_0xab19('0x23')](respondWithResult(_0x1b3e19,null))[_0xab19('0x40')](handleError(_0x1b3e19,null));};exports[_0xab19('0x47')]=function(_0xbbf984,_0x4a3ffb){var _0x5bfec4={'where':{'id':_0xbbf984['params']['id']}},_0x13f549={};_0x13f549[_0xab19('0x2e')]=_[_0xab19('0x30')](db[_0xab19('0x2a')][_0xab19('0x43')]);_0x5bfec4[_0xab19('0x34')]=_[_0xab19('0x32')](_0x13f549['model'],qs['fields'](_0xbbf984[_0xab19('0x33')][_0xab19('0x35')]));_0x5bfec4['attributes']=_0x5bfec4[_0xab19('0x34')][_0xab19('0x36')]?_0x5bfec4[_0xab19('0x34')]:_0x13f549[_0xab19('0x2e')];if(_0xbbf984['query'][_0xab19('0x48')]){_0x5bfec4[_0xab19('0x44')]=[{'all':!![]}];}_0x5bfec4=_['merge']({},_0x5bfec4,_0xbbf984['options']);return db[_0xab19('0x2a')][_0xab19('0x46')](_0x5bfec4)['then'](handleEntityNotFound(_0x4a3ffb,null))[_0xab19('0x23')](function(_0x1cc8fe){if(_0x1cc8fe){var _0x182d71=_0x1cc8fe[_0xab19('0x49')]({'plain':!![]});_0x182d71=qs[_0xab19('0x4a')](_0x182d71,['id',_0xab19('0x4b'),_0xab19('0x4c')]);_0xbbf984[_0xab19('0x4d')]=_[_0xab19('0x4a')](_0xbbf984[_0xab19('0x4d')],['id',_0xab19('0x4b'),'updatedAt']);return db[_0xab19('0x2a')][_0xab19('0x4e')](_[_0xab19('0x3d')](_0x182d71,_0xbbf984['body']),{'include':_0xbbf984[_0xab19('0x33')][_0xab19('0x48')]?[{'all':!![]}]:undefined});}})[_0xab19('0x23')](respondWithResult(_0x4a3ffb,0xc9))[_0xab19('0x40')](handleError(_0x4a3ffb,null));};exports[_0xab19('0x22')]=function(_0xc3d2a3,_0x306266){if(_0xc3d2a3[_0xab19('0x4d')]['id']){delete _0xc3d2a3[_0xab19('0x4d')]['id'];}return db[_0xab19('0x2a')][_0xab19('0x46')]({'where':{'id':_0xc3d2a3[_0xab19('0x42')]['id']}})[_0xab19('0x23')](handleEntityNotFound(_0x306266,null))['then'](saveUpdates(_0xc3d2a3['body'],null))[_0xab19('0x23')](respondWithResult(_0x306266,null))[_0xab19('0x40')](handleError(_0x306266,null));};exports[_0xab19('0x24')]=function(_0x2d77ae,_0x294c78){return db['Attachment'][_0xab19('0x46')]({'where':{'id':_0x2d77ae[_0xab19('0x42')]['id']}})[_0xab19('0x23')](handleEntityNotFound(_0x294c78,null))[_0xab19('0x23')](removeEntity(_0x294c78,null))['catch'](handleError(_0x294c78,null));};exports[_0xab19('0x4e')]=function(_0x122314,_0x16925e,_0x3c501a){_0x122314[_0xab19('0x4d')][_0xab19('0x27')]=_0x122314['file'][_0xab19('0x4f')];_0x122314[_0xab19('0x4d')][_0xab19('0x50')]=_0x122314[_0xab19('0x51')]['filename'];_0x122314[_0xab19('0x4d')][_0xab19('0x2c')]=_0x122314['file'][_0xab19('0x52')];return db[_0xab19('0x2a')]['create'](_0x122314[_0xab19('0x4d')])[_0xab19('0x23')](respondWithResult(_0x16925e,0xc9))['catch'](handleError(_0x16925e,null));};exports[_0xab19('0x53')]=function(_0x4b8178,_0x13b5c4,_0x4573db){return db[_0xab19('0x2a')]['findOne']({'where':{'id':_0x4b8178['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x13b5c4,null))[_0xab19('0x23')](function(_0x973243){if(_0x973243){var _0x4f063a=_0x973243[_0xab19('0x54')]!==null;var _0x25b844=path['join'](config[_0xab19('0x55')],_0xab19('0x56'));if(_0x4f063a){_0x25b844=path[_0xab19('0x57')](_0x25b844,_0xab19('0x58'));}var _0x35e7bf=path[_0xab19('0x57')](_0x25b844,_0x973243[_0xab19('0x50')]);return _0x13b5c4[_0xab19('0x53')](_0x35e7bf);}})['catch'](handleError(_0x13b5c4,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index a0d415a..7f2ffc4 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 _0xd0ee=['exports','define','util','moment','bluebird','request-promise','../../config/environment','./attachment.attributes'];(function(_0x485df0,_0x55eb9f){var _0xfd4f3b=function(_0x1d43e9){while(--_0x1d43e9){_0x485df0['push'](_0x485df0['shift']());}};_0xfd4f3b(++_0x55eb9f);}(_0xd0ee,0x152));var _0xed0e=function(_0x14dbda,_0x2767ff){_0x14dbda=_0x14dbda-0x0;var _0x32cbc9=_0xd0ee[_0x14dbda];return _0x32cbc9;};'use strict';var _=require('lodash');var util=require(_0xed0e('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xed0e('0x1'));var BPromise=require(_0xed0e('0x2'));var rp=require(_0xed0e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xed0e('0x4'));var attributes=require(_0xed0e('0x5'));module[_0xed0e('0x6')]=function(_0xf70193,_0x49c33b){return _0xf70193[_0xed0e('0x7')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xffea=['rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','api','moment','bluebird','request-promise','path'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0xffea,0x13f));var _0xaffe=function(_0x831608,_0x20a30e){_0x831608=_0x831608-0x0;var _0x1e8ea0=_0xffea[_0x831608];return _0x1e8ea0;};'use strict';var _=require(_0xaffe('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaffe('0x1'));var moment=require(_0xaffe('0x2'));var BPromise=require(_0xaffe('0x3'));var rp=require(_0xaffe('0x4'));var fs=require('fs');var path=require(_0xaffe('0x5'));var rimraf=require(_0xaffe('0x6'));var config=require(_0xaffe('0x7'));var attributes=require(_0xaffe('0x8'));module[_0xaffe('0x9')]=function(_0x165094,_0xd63dbb){return _0x165094[_0xaffe('0xa')](_0xaffe('0xb'),attributes,{'tableName':_0xaffe('0xc'),'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 38069b7..1d23720 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 _0xd4b6=['jayson/promise','client','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','create','body','options','lodash','util','bluebird','randomstring','../../mysqldb','../../config/environment'];(function(_0x4e7667,_0x47c33b){var _0x2dcbad=function(_0x4ec54b){while(--_0x4ec54b){_0x4e7667['push'](_0x4e7667['shift']());}};_0x2dcbad(++_0x47c33b);}(_0xd4b6,0x13f));var _0x6d4b=function(_0x3b6148,_0x2e26e5){_0x3b6148=_0x3b6148-0x0;var _0x2d750a=_0xd4b6[_0x3b6148];return _0x2d750a;};'use strict';var _=require(_0x6d4b('0x0'));var util=require(_0x6d4b('0x1'));var moment=require('moment');var BPromise=require(_0x6d4b('0x2'));var rs=require(_0x6d4b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6d4b('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6d4b('0x5'));var jayson=require(_0x6d4b('0x6'));var client=jayson[_0x6d4b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20f52a,_0x42a52a,_0x424690){return new BPromise(function(_0x262eed,_0x4dcf3d){return client[_0x6d4b('0x8')](_0x20f52a,_0x424690)[_0x6d4b('0x9')](function(_0xb2567b){logger[_0x6d4b('0xa')]('Attachment,\x20%s,\x20%s',_0x42a52a,_0x6d4b('0xb'));logger[_0x6d4b('0xc')](_0x6d4b('0xd'),_0x42a52a,_0x6d4b('0xb'),JSON[_0x6d4b('0xe')](_0xb2567b));if(_0xb2567b[_0x6d4b('0xf')]){if(_0xb2567b[_0x6d4b('0xf')]['code']===0x1f4){logger[_0x6d4b('0xf')](_0x6d4b('0x10'),_0x42a52a,_0xb2567b[_0x6d4b('0xf')]['message']);return _0x4dcf3d(_0xb2567b[_0x6d4b('0xf')][_0x6d4b('0x11')]);}logger[_0x6d4b('0xf')](_0x6d4b('0x10'),_0x42a52a,_0xb2567b[_0x6d4b('0xf')][_0x6d4b('0x11')]);return _0x262eed(_0xb2567b[_0x6d4b('0xf')][_0x6d4b('0x11')]);}else{logger[_0x6d4b('0xa')](_0x6d4b('0x10'),_0x42a52a,'request\x20sent');_0x262eed(_0xb2567b[_0x6d4b('0x12')]['message']);}})[_0x6d4b('0x13')](function(_0x428b75){logger['error']('Attachment,\x20%s,\x20%s',_0x42a52a,_0x428b75);_0x4dcf3d(_0x428b75);});});}exports[_0x6d4b('0x14')]=function(_0x3a30b2){var _0x318b0f=this;return new Promise(function(_0x2694ba,_0xa2f130){return db[_0x6d4b('0x15')][_0x6d4b('0x16')](_0x3a30b2[_0x6d4b('0x17')],{'raw':_0x3a30b2[_0x6d4b('0x18')]?_0x3a30b2[_0x6d4b('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x25a1fa){logger[_0x6d4b('0xa')](_0x6d4b('0x14'),_0x3a30b2);logger['debug'](_0x6d4b('0x14'),_0x3a30b2,JSON[_0x6d4b('0xe')](_0x25a1fa));_0x2694ba(_0x25a1fa);})[_0x6d4b('0x13')](function(_0x26b72d){logger['error'](_0x6d4b('0x14'),_0x26b72d[_0x6d4b('0x11')],_0x3a30b2);_0xa2f130(_0x318b0f[_0x6d4b('0xf')](0x1f4,_0x26b72d[_0x6d4b('0x11')]));});});};
\ No newline at end of file
+var _0x31c2=['CreateAttachment','stringify','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','Attachment','create','body','options','raw'];(function(_0x5224ba,_0x3fb4e1){var _0x459bd2=function(_0x61be43){while(--_0x61be43){_0x5224ba['push'](_0x5224ba['shift']());}};_0x459bd2(++_0x3fb4e1);}(_0x31c2,0x98));var _0x231c=function(_0x42c1a4,_0x4669f1){_0x42c1a4=_0x42c1a4-0x0;var _0x1ab6db=_0x31c2[_0x42c1a4];return _0x1ab6db;};'use strict';var _=require(_0x231c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x231c('0x1'));var rs=require(_0x231c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x231c('0x3'))['db'];var utils=require(_0x231c('0x4'));var logger=require(_0x231c('0x5'))(_0x231c('0x6'));var config=require(_0x231c('0x7'));var jayson=require(_0x231c('0x8'));var client=jayson[_0x231c('0x9')][_0x231c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5afc76,_0x1e3997,_0x4fd8b8){return new BPromise(function(_0x3dfccb,_0x396da8){return client[_0x231c('0xb')](_0x5afc76,_0x4fd8b8)[_0x231c('0xc')](function(_0x4cd3b8){logger[_0x231c('0xd')](_0x231c('0xe'),_0x1e3997,_0x231c('0xf'));logger[_0x231c('0x10')](_0x231c('0x11'),_0x1e3997,_0x231c('0xf'),JSON['stringify'](_0x4cd3b8));if(_0x4cd3b8['error']){if(_0x4cd3b8['error'][_0x231c('0x12')]===0x1f4){logger[_0x231c('0x13')](_0x231c('0xe'),_0x1e3997,_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);return _0x396da8(_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);}logger[_0x231c('0x13')](_0x231c('0xe'),_0x1e3997,_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);return _0x3dfccb(_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);}else{logger[_0x231c('0xd')]('Attachment,\x20%s,\x20%s',_0x1e3997,_0x231c('0xf'));_0x3dfccb(_0x4cd3b8[_0x231c('0x15')][_0x231c('0x14')]);}})[_0x231c('0x16')](function(_0x40f4f6){logger['error'](_0x231c('0xe'),_0x1e3997,_0x40f4f6);_0x396da8(_0x40f4f6);});});}exports['CreateAttachment']=function(_0x1d48e3){var _0x59282c=this;return new Promise(function(_0x286148,_0x34f391){return db[_0x231c('0x17')][_0x231c('0x18')](_0x1d48e3[_0x231c('0x19')],{'raw':_0x1d48e3[_0x231c('0x1a')]?_0x1d48e3[_0x231c('0x1a')][_0x231c('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x29a94){logger[_0x231c('0xd')](_0x231c('0x1c'),_0x1d48e3);logger['debug']('CreateAttachment',_0x1d48e3,JSON[_0x231c('0x1d')](_0x29a94));_0x286148(_0x29a94);})[_0x231c('0x16')](function(_0x3bd9ed){logger['error'](_0x231c('0x1c'),_0x3bd9ed['message'],_0x1d48e3);_0x34f391(_0x59282c[_0x231c('0x13')](0x1f4,_0x3bd9ed[_0x231c('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 20b037a..7dfea74 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 _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0x0b0e[_0x44b3bd];return _0x1efc4a;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
+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(_0x49f856,_0x287a28){var _0x43a6fb=function(_0x25ab53){while(--_0x25ab53){_0x49f856['push'](_0x49f856['shift']());}};_0x43a6fb(++_0x287a28);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3b07ce,_0x1efc2f){_0x3b07ce=_0x3b07ce-0x0;var _0x8e9a57=_0x5f2f[_0x3b07ce];return _0x8e9a57;};'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 2827568..8d55f02 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 _0x6889=['activedirectory2','util','../../config/utils','../../config/environment','../../config/logger','activedirectory','url','error','Error\x20authenticate\x20%s:\x20%s','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role','blockedAt','online','user','domain','blocked','minutes','clearBlockUser','getLicense','status','send','message','authenticate','json','use','User','passport','passport-local','Strategy','moment'];(function(_0x5d5f7e,_0x17b602){var _0x4df13f=function(_0x5cf293){while(--_0x5cf293){_0x5d5f7e['push'](_0x5d5f7e['shift']());}};_0x4df13f(++_0x17b602);}(_0x6889,0x114));var _0x9688=function(_0x13f5ac,_0x303066){_0x13f5ac=_0x13f5ac-0x0;var _0x163d97=_0x6889[_0x13f5ac];return _0x163d97;};'use strict';var passport=require(_0x9688('0x0'));var LocalStrategy=require(_0x9688('0x1'))[_0x9688('0x2')];var moment=require(_0x9688('0x3'));var ActiveDirectory=require(_0x9688('0x4'));var BPromise=require('bluebird');var util=require(_0x9688('0x5'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x9688('0x6'));var config=require(_0x9688('0x7'));var logger=require(_0x9688('0x8'))('api');function isActiveDirectoryConfigured(_0x795938){var _0x2b8881=![];if(typeof _0x795938[_0x9688('0x9')]!=='undefined'){_0x2b8881=_0x795938[_0x9688('0x9')]['baseDN']&&_0x795938['activedirectory'][_0x9688('0xa')]&&_0x795938['activedirectory']['domain'];}return _0x2b8881;}function adAuthenticate(_0x5322b0,_0x3171ed,_0x396ab2){return new BPromise(function(_0x284c71,_0x4d1ef0){try{var _0x123c50=new ActiveDirectory(_0x5322b0);_0x123c50['authenticate'](_0x3171ed,_0x396ab2,function(_0x53ba22,_0x59dec3){if(_0x53ba22){logger[_0x9688('0xb')](_0x9688('0xc'),_0x3171ed,util['inspect'](_0x53ba22,{'showHidden':![],'depth':null}));_0x4d1ef0('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x59dec3){logger[_0x9688('0xb')](_0x9688('0xd'),_0x3171ed);_0x4d1ef0(_0x9688('0xe'));}else{_0x284c71(_0x59dec3);}});}catch(_0x17a9ae){_0x4d1ef0(_0x17a9ae);}});}function ActiveDirectoryAuthenticate(_0x466211,_0x5f3055,_0x17b5f6,_0xd9dfc){var _0x2daabc,_0x1b3646;if(!isActiveDirectoryConfigured(config)){logger[_0x9688('0xb')](_0x9688('0xf'),_0x5f3055);return _0xd9dfc(null,![],{'message':_0x9688('0xe')});}return db[_0x9688('0x10')][_0x9688('0x11')]({'where':{'id':0x1},'attributes':[_0x9688('0x12'),_0x9688('0x13')],'raw':!![]})[_0x9688('0x14')](function(_0x51fe0e){_0x2daabc=_0x51fe0e;if(!_0x2daabc[_0x9688('0x12')]){logger[_0x9688('0xb')](_0x9688('0x15'),_0x5f3055);throw new Error(_0x9688('0xe'));}return _0x466211['findOne']({'attributes':['id',_0x9688('0x16'),_0x9688('0x17'),'salt',_0x9688('0x18'),'disabled','blocked',_0x9688('0x19'),_0x9688('0x1a')],'where':{'name':_0x5f3055,'role':{'$or':['admin',_0x9688('0x1b'),'agent']},'adSsoEnabled':!![]}});})[_0x9688('0x14')](function(_0x477a58){if(!_0x477a58||_0x477a58&&_0x477a58['name']!==_0x5f3055){throw new Error(_0x9688('0xe'));}_0x1b3646=_0x477a58;var _0x1faf51=_0x1b3646[_0x9688('0x16')]+'@'+config[_0x9688('0x9')][_0x9688('0x1c')];return adAuthenticate(config[_0x9688('0x9')],_0x1faf51,_0x17b5f6);})[_0x9688('0x14')](function(_0x2d196a){if(_0x1b3646['disabled']){throw new Error(_0x9688('0xe'));}if(_0x2daabc[_0x9688('0x13')]>0x0){if(_0x1b3646[_0x9688('0x1d')]){if(moment(_0x1b3646[_0x9688('0x19')])['add'](_0x2daabc['blockDuration'],_0x9688('0x1e'))>moment()){throw new Error(_0x9688('0xe'));}return utils[_0x9688('0x1f')](_0x1b3646,0x0,![],null)[_0x9688('0x14')](function(){return utils[_0x9688('0x20')](_0x1b3646);})[_0x9688('0x14')](function(){return _0xd9dfc(null,_0x1b3646);});}else{return utils[_0x9688('0x20')](_0x1b3646)[_0x9688('0x14')](function(){return _0xd9dfc(null,_0x1b3646);});}}else{return utils[_0x9688('0x20')](_0x1b3646)[_0x9688('0x14')](function(){return _0xd9dfc(null,_0x1b3646);});}})['catch'](function(_0x338caa){return _0xd9dfc(null,![],_0x338caa);});}function handleError(_0x204d7c,_0x698e50,_0xc2906){return _0x204d7c[_0x9688('0x21')](_0x698e50||0x1f4)[_0x9688('0x22')]({'message':_0xc2906?_0xc2906[_0x9688('0x23')]||_0xc2906:''});}exports['login']=function(_0x4a8168,_0x567312,_0x1d6e33){passport[_0x9688('0x24')]('ad-login',function(_0x299c31,_0x142071,_0x2d9408){var _0x1af471=_0x299c31||_0x2d9408;if(_0x1af471){return handleError(_0x567312,0x191,_0x1af471);}if(!_0x142071){return handleError(_0x567312,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x3bcb44={'payload':{'id':_0x142071['id'],'role':_0x142071[_0x9688('0x18')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x3bcb44)[_0x9688('0x14')](function(_0x22adaa){_0x567312[_0x9688('0x25')]({'id':_0x142071['id'],'token':_0x22adaa,'statusCall':'','isAlreadyLogged':_0x142071[_0x9688('0x1a')]});});}})(_0x4a8168,_0x567312,_0x1d6e33);};passport[_0x9688('0x26')]('ad-login',new LocalStrategy({'usernameField':'name','passwordField':_0x9688('0x17')},function(_0x5ba757,_0x4f8f07,_0x25f53e){return ActiveDirectoryAuthenticate(db[_0x9688('0x27')],_0x5ba757,_0x4f8f07,_0x25f53e);}));
\ No newline at end of file
+var _0xa55f=['getLicense','catch','status','send','message','login','ad-login','signToken','use','User','passport','passport-local','Strategy','activedirectory2','util','../../components/auth/service','../../config/utils','../../config/logger','api','activedirectory','undefined','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','role','disabled','blocked','blockedAt','online','admin','user','agent','name','blockDuration','minutes','clearBlockUser'];(function(_0x48f8ba,_0x3adddd){var _0x2867da=function(_0x39abd1){while(--_0x39abd1){_0x48f8ba['push'](_0x48f8ba['shift']());}};_0x2867da(++_0x3adddd);}(_0xa55f,0x172));var _0xfa55=function(_0x350c87,_0x2b44ef){_0x350c87=_0x350c87-0x0;var _0x163800=_0xa55f[_0x350c87];return _0x163800;};'use strict';var passport=require(_0xfa55('0x0'));var LocalStrategy=require(_0xfa55('0x1'))[_0xfa55('0x2')];var moment=require('moment');var ActiveDirectory=require(_0xfa55('0x3'));var BPromise=require('bluebird');var util=require(_0xfa55('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0xfa55('0x5'));var utils=require(_0xfa55('0x6'));var config=require('../../config/environment');var logger=require(_0xfa55('0x7'))(_0xfa55('0x8'));function isActiveDirectoryConfigured(_0x329eba){var _0x50307a=![];if(typeof _0x329eba[_0xfa55('0x9')]!==_0xfa55('0xa')){_0x50307a=_0x329eba['activedirectory']['baseDN']&&_0x329eba[_0xfa55('0x9')]['url']&&_0x329eba['activedirectory'][_0xfa55('0xb')];}return _0x50307a;}function adAuthenticate(_0x4ad3ce,_0x2a6d02,_0x28b94e){return new BPromise(function(_0x4c61a6,_0x430f89){try{var _0x476faa=new ActiveDirectory(_0x4ad3ce);_0x476faa[_0xfa55('0xc')](_0x2a6d02,_0x28b94e,function(_0x34b3ec,_0x2f8fcb){if(_0x34b3ec){logger[_0xfa55('0xd')](_0xfa55('0xe'),_0x2a6d02,util['inspect'](_0x34b3ec,{'showHidden':![],'depth':null}));_0x430f89(_0xfa55('0xf'));}else if(!_0x2f8fcb){logger[_0xfa55('0xd')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x2a6d02);_0x430f89(_0xfa55('0xf'));}else{_0x4c61a6(_0x2f8fcb);}});}catch(_0x24b614){_0x430f89(_0x24b614);}});}function ActiveDirectoryAuthenticate(_0x5811eb,_0x4e58ac,_0x567090,_0x7a2bbd){var _0x209d0c,_0x1a39ca;if(!isActiveDirectoryConfigured(config)){logger[_0xfa55('0xd')](_0xfa55('0x10'),_0x4e58ac);return _0x7a2bbd(null,![],{'message':_0xfa55('0xf')});}return db[_0xfa55('0x11')][_0xfa55('0x12')]({'where':{'id':0x1},'attributes':['adSsoEnabled','blockDuration'],'raw':!![]})[_0xfa55('0x13')](function(_0x27d661){_0x209d0c=_0x27d661;if(!_0x209d0c[_0xfa55('0x14')]){logger[_0xfa55('0xd')](_0xfa55('0x15'),_0x4e58ac);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x5811eb[_0xfa55('0x12')]({'attributes':['id','name',_0xfa55('0x16'),'salt',_0xfa55('0x17'),_0xfa55('0x18'),_0xfa55('0x19'),_0xfa55('0x1a'),_0xfa55('0x1b')],'where':{'name':_0x4e58ac,'role':{'$or':[_0xfa55('0x1c'),_0xfa55('0x1d'),_0xfa55('0x1e')]},'adSsoEnabled':!![]}});})[_0xfa55('0x13')](function(_0x24c36d){if(!_0x24c36d||_0x24c36d&&_0x24c36d[_0xfa55('0x1f')]!==_0x4e58ac){throw new Error(_0xfa55('0xf'));}_0x1a39ca=_0x24c36d;var _0x88a6a7=_0x1a39ca[_0xfa55('0x1f')]+'@'+config[_0xfa55('0x9')][_0xfa55('0xb')];return adAuthenticate(config[_0xfa55('0x9')],_0x88a6a7,_0x567090);})[_0xfa55('0x13')](function(_0x4dec3b){if(_0x1a39ca[_0xfa55('0x18')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x209d0c[_0xfa55('0x20')]>0x0){if(_0x1a39ca[_0xfa55('0x19')]){if(moment(_0x1a39ca[_0xfa55('0x1a')])['add'](_0x209d0c['blockDuration'],_0xfa55('0x21'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0xfa55('0x22')](_0x1a39ca,0x0,![],null)['then'](function(){return utils[_0xfa55('0x23')](_0x1a39ca);})[_0xfa55('0x13')](function(){return _0x7a2bbd(null,_0x1a39ca);});}else{return utils[_0xfa55('0x23')](_0x1a39ca)[_0xfa55('0x13')](function(){return _0x7a2bbd(null,_0x1a39ca);});}}else{return utils[_0xfa55('0x23')](_0x1a39ca)[_0xfa55('0x13')](function(){return _0x7a2bbd(null,_0x1a39ca);});}})[_0xfa55('0x24')](function(_0x5ae914){return _0x7a2bbd(null,![],_0x5ae914);});}function handleError(_0x29f76e,_0x5af8f6,_0x2c14d6){return _0x29f76e[_0xfa55('0x25')](_0x5af8f6||0x1f4)[_0xfa55('0x26')]({'message':_0x2c14d6?_0x2c14d6[_0xfa55('0x27')]||_0x2c14d6:''});}exports[_0xfa55('0x28')]=function(_0x1a7b3a,_0x18459a,_0x17b68a){passport[_0xfa55('0xc')](_0xfa55('0x29'),function(_0x18cebe,_0x4c61ae,_0x50e615){var _0xa2c581=_0x18cebe||_0x50e615;if(_0xa2c581){return handleError(_0x18459a,0x191,_0xa2c581);}if(!_0x4c61ae){return handleError(_0x18459a,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x509eba={'payload':{'id':_0x4c61ae['id'],'role':_0x4c61ae[_0xfa55('0x17')]},'options':{'expiresIn':0x15180}};return authService[_0xfa55('0x2a')](_0x509eba)[_0xfa55('0x13')](function(_0x588c25){_0x18459a['json']({'id':_0x4c61ae['id'],'token':_0x588c25,'statusCall':'','isAlreadyLogged':_0x4c61ae[_0xfa55('0x1b')]});});}})(_0x1a7b3a,_0x18459a,_0x17b68a);};passport[_0xfa55('0x2b')](_0xfa55('0x29'),new LocalStrategy({'usernameField':_0xfa55('0x1f'),'passwordField':_0xfa55('0x16')},function(_0xa932ee,_0x380625,_0x178fc8){return ActiveDirectoryAuthenticate(db[_0xfa55('0x2c')],_0xa932ee,_0x380625,_0x178fc8);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 50372c0..f0291b1 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 _0x2e55=['Router','./authActiveDirectory.controller','exports','express'];(function(_0x173f10,_0x35db61){var _0x53142d=function(_0x37bbef){while(--_0x37bbef){_0x173f10['push'](_0x173f10['shift']());}};_0x53142d(++_0x35db61);}(_0x2e55,0xeb));var _0x52e5=function(_0xf26d40,_0x2f4f46){_0xf26d40=_0xf26d40-0x0;var _0x50b68c=_0x2e55[_0xf26d40];return _0x50b68c;};'use strict';var express=require(_0x52e5('0x0'));var router=express[_0x52e5('0x1')]();var controller=require(_0x52e5('0x2'));router['post']('/',controller['login']);module[_0x52e5('0x3')]=router;
\ No newline at end of file
+var _0x9bb0=['login','Router','./authActiveDirectory.controller'];(function(_0x39d0e4,_0x13ae06){var _0x36ead2=function(_0x351268){while(--_0x351268){_0x39d0e4['push'](_0x39d0e4['shift']());}};_0x36ead2(++_0x13ae06);}(_0x9bb0,0x64));var _0x09bb=function(_0x11e001,_0xb3367b){_0x11e001=_0x11e001-0x0;var _0x417419=_0x9bb0[_0x11e001];return _0x417419;};'use strict';var express=require('express');var router=express[_0x09bb('0x0')]();var controller=require(_0x09bb('0x1'));router['post']('/',controller[_0x09bb('0x2')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index b895166..459c9cb 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7a54,0x106));var _0x47a5=function(_0x28dc65,_0x47963e){_0x28dc65=_0x28dc65-0x0;var _0x74222b=_0x7a54[_0x28dc65];return _0x74222b;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _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(_0x29d95d,_0x4396e7){var _0x5860c3=function(_0x3ffd61){while(--_0x3ffd61){_0x29d95d['push'](_0x29d95d['shift']());}};_0x5860c3(++_0x4396e7);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 204d0ff..9700905 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 _0x5e58=['callback','isMiddleware','login','express','get','/callback'];(function(_0x364a17,_0x1c3288){var _0x1a78ce=function(_0x5940a3){while(--_0x5940a3){_0x364a17['push'](_0x364a17['shift']());}};_0x1a78ce(++_0x1c3288);}(_0x5e58,0x14d));var _0x85e5=function(_0x201b94,_0x5cada6){_0x201b94=_0x201b94-0x0;var _0x49da82=_0x5e58[_0x201b94];return _0x49da82;};'use strict';var express=require(_0x85e5('0x0'));var passport=require('passport');var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0x85e5('0x1')]('/',controller['login']);router['get'](_0x85e5('0x2'),controller[_0x85e5('0x3')],authService[_0x85e5('0x4')],userController[_0x85e5('0x5')],authService['setTokenCookie']);module['exports']=router;
\ No newline at end of file
+var _0x5a26=['../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','express','passport','./authGoogle.controller'];(function(_0x1ccb48,_0x561988){var _0x4f5396=function(_0x3f5bc2){while(--_0x3f5bc2){_0x1ccb48['push'](_0x1ccb48['shift']());}};_0x4f5396(++_0x561988);}(_0x5a26,0x165));var _0x65a2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a26[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x65a2('0x0'));var passport=require(_0x65a2('0x1'));var router=express['Router']();var controller=require(_0x65a2('0x2'));var userController=require(_0x65a2('0x3'));var authService=require(_0x65a2('0x4'));router['get']('/',controller['login']);router[_0x65a2('0x5')](_0x65a2('0x6'),controller[_0x65a2('0x7')],authService[_0x65a2('0x8')],userController['login'],authService['setTokenCookie']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 683724b..1db3500 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 _0x40ff=['findOne','allowedLoginAttempts','then','name','password','salt','role','disabled','blocked','admin','user','loginAttempts','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','minutes','clearBlockUser','blockedAt','add','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','\x22%s\x22\x20<%s>','request','SendMail','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','util','passport','passport-local','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting'];(function(_0x175cd1,_0x5dd9f8){var _0x3ff513=function(_0x2835c4){while(--_0x2835c4){_0x175cd1['push'](_0x175cd1['shift']());}};_0x3ff513(++_0x5dd9f8);}(_0x40ff,0xe8));var _0xf40f=function(_0x5e41f0,_0x1799cc){_0x5e41f0=_0x5e41f0-0x0;var _0x5c85c4=_0x40ff[_0x5e41f0];return _0x5c85c4;};'use strict';var util=require(_0xf40f('0x0'));var passport=require(_0xf40f('0x1'));var LocalStrategy=require(_0xf40f('0x2'))['Strategy'];var jayson=require('jayson/promise');var _=require(_0xf40f('0x3'));var rs=require('randomstring');var moment=require(_0xf40f('0x4'));var db=require(_0xf40f('0x5'))['db'];var authService=require(_0xf40f('0x6'));var utils=require(_0xf40f('0x7'));var client=jayson[_0xf40f('0x8')][_0xf40f('0x9')]({'port':0x232b});function localAuthenticate(_0x4323cf,_0x55d113,_0x4318c6,_0x2f9923){var _0xc6cdaf,_0x134784;return db[_0xf40f('0xa')][_0xf40f('0xb')]({'where':{'id':0x1},'attributes':[_0xf40f('0xc'),'blockDuration'],'raw':!![]})[_0xf40f('0xd')](function(_0x5bf174){_0xc6cdaf=_0x5bf174;return _0x4323cf['findOne']({'attributes':['id',_0xf40f('0xe'),_0xf40f('0xf'),_0xf40f('0x10'),_0xf40f('0x11'),_0xf40f('0x12'),_0xf40f('0x13'),'blockedAt','loginAttempts'],'where':{'name':_0x55d113,'role':{'$or':[_0xf40f('0x14'),_0xf40f('0x15'),'agent']}}});})['then'](function(_0x53948f){if(!_0x53948f||_0x53948f&&_0x53948f['name']!==_0x55d113){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x134784=_0x53948f;return _0x134784;}})[_0xf40f('0xd')](function(){_0x134784['authenticate'](_0x4318c6,function(_0x407c19,_0x14699d){var _0x54e684=_0x134784[_0xf40f('0x16')]+0x1;if(_0x407c19){return _0x2f9923(_0x407c19);}else if(!_0x14699d){if(_0x134784['disabled']){return _0x2f9923(null,![],{'message':_0xf40f('0x17')});}else if(_0xc6cdaf[_0xf40f('0xc')]>0x0){if(_0x134784['blocked']){if(_0xc6cdaf[_0xf40f('0x18')]>0x0){if(moment(_0x134784['blockedAt'])['add'](_0xc6cdaf[_0xf40f('0x18')],_0xf40f('0x19'))>moment()){return _0x2f9923(null,![],{'message':_0xf40f('0x17')});}else{return utils[_0xf40f('0x1a')](_0x134784,_0x54e684,![],null)[_0xf40f('0xd')](function(){return _0x2f9923(null,![],{'message':_0xf40f('0x17')});});}}else{return _0x2f9923(null,![],{'message':_0xf40f('0x17')});}}else{if(_0x54e684>=_0xc6cdaf[_0xf40f('0xc')]){return utils[_0xf40f('0x1a')](_0x134784,0x0,!![],moment())[_0xf40f('0xd')](function(){return _0x2f9923(null,![],{'message':_0xf40f('0x17')});});}else{return utils['clearBlockUser'](_0x134784,_0x54e684,![],null)[_0xf40f('0xd')](function(){return _0x2f9923(null,![],{'message':_0xf40f('0x17')});});}}}else{return _0x2f9923(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x134784[_0xf40f('0x12')]){return _0x2f9923(null,![],{'message':_0xf40f('0x17')});}else if(_0xc6cdaf[_0xf40f('0xc')]>0x0){if(_0x134784['blocked']){if(_0xc6cdaf['blockDuration']>0x0){if(moment(_0x134784[_0xf40f('0x1b')])[_0xf40f('0x1c')](_0xc6cdaf[_0xf40f('0x18')],_0xf40f('0x19'))>moment()){return _0x2f9923(null,![],{'message':_0xf40f('0x17')});}else{return utils['clearBlockUser'](_0x134784,0x0,![],null)[_0xf40f('0xd')](function(){return utils['getLicense'](_0x134784);})[_0xf40f('0xd')](function(){return _0x2f9923(null,_0x134784);});}}else{return _0x2f9923(null,![],{'message':_0xf40f('0x17')});}}else{return utils[_0xf40f('0x1a')](_0x134784,0x0,![],null)['then'](function(){return utils[_0xf40f('0x1d')](_0x134784);})[_0xf40f('0xd')](function(){return _0x2f9923(null,_0x134784);})[_0xf40f('0x1e')](function(_0x4d8e15){return _0x2f9923(null,![],_0x4d8e15);});}}else{if(_0x134784[_0xf40f('0x13')]){return _0x2f9923(null,![],{'message':_0xf40f('0x17')});}else{return utils['getLicense'](_0x134784)[_0xf40f('0xd')](function(){return _0x2f9923(null,_0x134784);});}}}});})[_0xf40f('0x1e')](function(_0x3b987d){return _0x2f9923(null,![],_0x3b987d);});}function sendServiceMail(_0x1e57a9){return db['MailAccount'][_0xf40f('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xf40f('0xe'),_0xf40f('0x20')],'include':[{'model':db[_0xf40f('0x21')],'as':_0xf40f('0x22'),'include':[{'model':db[_0xf40f('0x23')],'as':_0xf40f('0x23')}]}]})['then'](function(_0x1333b7){if(!_0x1333b7){throw new Error(_0xf40f('0x24'));}var _0x1b642e=_0x1333b7[_0xf40f('0x25')]();var _0x371dc9={'account':_0x1b642e,'message':_['merge']({'from':util['format'](_0xf40f('0x26'),_0x1333b7[_0xf40f('0xe')],_0x1333b7['email']||_0x1333b7['Smtp'][_0xf40f('0x15')])},_0x1e57a9)};return client[_0xf40f('0x27')](_0xf40f('0x28'),_0x371dc9);})[_0xf40f('0xd')](function(_0x532240){if(_0x532240['error']){throw new Error(util[_0xf40f('0x29')](_0xf40f('0x2a'),_0x532240[_0xf40f('0x2b')][_0xf40f('0x2c')]||JSON[_0xf40f('0x2d')](_0x532240[_0xf40f('0x2b')])));}return!![];});}function handleError(_0x4aa496,_0x1ee844,_0x441bc1){return _0x4aa496[_0xf40f('0x2e')](_0x1ee844||0x1f4)[_0xf40f('0x2f')]({'message':_0x441bc1?_0x441bc1[_0xf40f('0x2c')]||_0x441bc1:''});}exports[_0xf40f('0x30')]=function(_0x2f9170,_0x3ddddc,_0x50d96d){passport[_0xf40f('0x31')](_0xf40f('0x32'),function(_0x2f95b8,_0x556c8e,_0x5dd8f6){var _0x2eafb4=_0x2f95b8||_0x5dd8f6;if(_0x2eafb4){return handleError(_0x3ddddc,0x191,_0x2eafb4);}if(!_0x556c8e){return handleError(_0x3ddddc,0x194,{'message':_0xf40f('0x33')});}else{var _0x45d57c={'payload':{'id':_0x556c8e['id'],'role':_0x556c8e[_0xf40f('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0xf40f('0x34')](_0x45d57c)['then'](function(_0x3bc02d){_0x3ddddc[_0xf40f('0x35')]({'id':_0x556c8e['id'],'token':_0x3bc02d,'statusCall':'','isAlreadyLogged':_0x556c8e['online']});});}})(_0x2f9170,_0x3ddddc,_0x50d96d);};exports[_0xf40f('0x36')]=function(_0x115e58,_0x4c22d6){if(!_0x115e58[_0xf40f('0x37')][_0xf40f('0x20')]){return handleError(_0x4c22d6,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0xcc2eb3=rs['generate']();_0x115e58[_0xf40f('0x37')][_0xf40f('0x20')]=_0x115e58[_0xf40f('0x37')]['email'][_0xf40f('0x38')]()[_0xf40f('0x39')]();var _0x4b4879;return db[_0xf40f('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0xf40f('0xc'),_0xf40f('0x18')],'raw':!![]})[_0xf40f('0xd')](function(_0x4609f0){_0x4b4879=_0x4609f0;return db[_0xf40f('0x3a')][_0xf40f('0x1f')]({'where':{'email':_0x115e58[_0xf40f('0x37')]['email']}});})[_0xf40f('0xd')](function(_0x19ddc3){if(!_0x19ddc3){throw new Error(_0xf40f('0x3b'));}if(_0x19ddc3['disabled']){throw new Error(_0xf40f('0x3c'));}if(_0x19ddc3[_0xf40f('0x13')]){if(moment(_0x19ddc3['blockedAt'])[_0xf40f('0x1c')](_0x4b4879[_0xf40f('0x18')],_0xf40f('0x19'))>moment()){throw new Error(_0xf40f('0x3d'));}else{_0x19ddc3[_0xf40f('0x13')]=![];_0x19ddc3['blockedAt']=null;}}_0x19ddc3['resetPasswordToken']=_0xcc2eb3;_0x19ddc3['resetPasswordExpires']=Date[_0xf40f('0x3e')]()+0x36ee80;return _0x19ddc3[_0xf40f('0x3f')]();})['then'](function(){return sendServiceMail({'to':_0x115e58['body'][_0xf40f('0x20')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xf40f('0x40')+_0xf40f('0x41')+_0xf40f('0x42')+_0x115e58[_0xf40f('0x43')]['host']+'/reset/'+_0xcc2eb3+'\x0a\x0a'+_0xf40f('0x44')});})['then'](function(){_0x4c22d6[_0xf40f('0x2e')](0xc8)[_0xf40f('0x2f')]({'message':_0xf40f('0x45')});})[_0xf40f('0x1e')](function(_0x360340){return handleError(_0x4c22d6,0x1f4,_0x360340);});};exports[_0xf40f('0x46')]=function(_0x47ce81,_0x3d3087){return db[_0xf40f('0x3a')][_0xf40f('0x1f')]({'where':{'resetPasswordToken':_0x47ce81['params'][_0xf40f('0x47')],'resetPasswordExpires':{'$gt':Date[_0xf40f('0x3e')]()}}})[_0xf40f('0xd')](function(_0x577374){if(!_0x577374){throw new Error(_0xf40f('0x48'));}return db['Setting'][_0xf40f('0xb')]({'attributes':['id',_0xf40f('0x49'),'enforcePasswordHistory',_0xf40f('0x4a')]})[_0xf40f('0xd')](function(_0x17e0d4){if(_0x17e0d4[_0xf40f('0x49')])authService[_0xf40f('0x4b')](_0x47ce81[_0xf40f('0x37')][_0xf40f('0xf')]);if(!_0x17e0d4['enforcePasswordHistory']||!_0x577374[_0xf40f('0x4c')])return _0x577374;authService[_0xf40f('0x4d')](_0x47ce81['body'][_0xf40f('0xf')],_0x577374[_0xf40f('0x4c')],_0x17e0d4['passwordHistoryLimit']);return _0x577374;})[_0xf40f('0xd')](function(){_0x577374['password']=_0x47ce81[_0xf40f('0x37')]['password'];_0x577374['resetPasswordToken']=null;_0x577374[_0xf40f('0x4e')]=null;return _0x577374['save']();});})['then'](function(){_0x3d3087[_0xf40f('0x2e')](0xc8)[_0xf40f('0x2f')]({'message':_0xf40f('0x4f')});})[_0xf40f('0x1e')](function(_0xd15605){return handleError(_0x3d3087,0x1f4,_0xd15605);});};passport[_0xf40f('0x50')](_0xf40f('0x32'),new LocalStrategy({'usernameField':_0xf40f('0xe'),'passwordField':_0xf40f('0xf')},function(_0x4e5bc8,_0x38e62d,_0x41ebbc){return localAuthenticate(db[_0xf40f('0x3a')],_0x4e5bc8,_0x38e62d,_0x41ebbc);}));
\ No newline at end of file
+var _0x5d3b=['The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','send','Reset\x20Email\x20sent!','reset','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','password','resetPasswordExpires','save','Password\x20reset!','util','passport-local','Strategy','jayson/promise','randomstring','moment','../../components/auth/service','http','findOne','allowedLoginAttempts','blockDuration','then','name','role','disabled','blockedAt','admin','user','agent','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','email','request','error','message','stringify','status','login','local-login','online','forgot','body','generate','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.'];(function(_0x484945,_0x44c47d){var _0x5de501=function(_0xc3ac8e){while(--_0xc3ac8e){_0x484945['push'](_0x484945['shift']());}};_0x5de501(++_0x44c47d);}(_0x5d3b,0x1d3));var _0xb5d3=function(_0x3b18ec,_0x17bc5a){_0x3b18ec=_0x3b18ec-0x0;var _0x34b5c1=_0x5d3b[_0x3b18ec];return _0x34b5c1;};'use strict';var util=require(_0xb5d3('0x0'));var passport=require('passport');var LocalStrategy=require(_0xb5d3('0x1'))[_0xb5d3('0x2')];var jayson=require(_0xb5d3('0x3'));var _=require('lodash');var rs=require(_0xb5d3('0x4'));var moment=require(_0xb5d3('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0xb5d3('0x6'));var utils=require('../../config/utils');var client=jayson['client'][_0xb5d3('0x7')]({'port':0x232b});function localAuthenticate(_0x55dd1a,_0x2e825a,_0x5bf12a,_0x4b5076){var _0x3378d0,_0x107bb9;return db['Setting'][_0xb5d3('0x8')]({'where':{'id':0x1},'attributes':[_0xb5d3('0x9'),_0xb5d3('0xa')],'raw':!![]})[_0xb5d3('0xb')](function(_0x517047){_0x3378d0=_0x517047;return _0x55dd1a['findOne']({'attributes':['id',_0xb5d3('0xc'),'password','salt',_0xb5d3('0xd'),_0xb5d3('0xe'),'blocked',_0xb5d3('0xf'),'loginAttempts'],'where':{'name':_0x2e825a,'role':{'$or':[_0xb5d3('0x10'),_0xb5d3('0x11'),_0xb5d3('0x12')]}}});})[_0xb5d3('0xb')](function(_0x110507){if(!_0x110507||_0x110507&&_0x110507[_0xb5d3('0xc')]!==_0x2e825a){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x107bb9=_0x110507;return _0x107bb9;}})[_0xb5d3('0xb')](function(){_0x107bb9[_0xb5d3('0x13')](_0x5bf12a,function(_0x203066,_0xb4fc2){var _0x51b0f6=_0x107bb9['loginAttempts']+0x1;if(_0x203066){return _0x4b5076(_0x203066);}else if(!_0xb4fc2){if(_0x107bb9[_0xb5d3('0xe')]){return _0x4b5076(null,![],{'message':_0xb5d3('0x14')});}else if(_0x3378d0[_0xb5d3('0x9')]>0x0){if(_0x107bb9[_0xb5d3('0x15')]){if(_0x3378d0['blockDuration']>0x0){if(moment(_0x107bb9[_0xb5d3('0xf')])[_0xb5d3('0x16')](_0x3378d0[_0xb5d3('0xa')],'minutes')>moment()){return _0x4b5076(null,![],{'message':_0xb5d3('0x14')});}else{return utils[_0xb5d3('0x17')](_0x107bb9,_0x51b0f6,![],null)[_0xb5d3('0xb')](function(){return _0x4b5076(null,![],{'message':_0xb5d3('0x14')});});}}else{return _0x4b5076(null,![],{'message':_0xb5d3('0x14')});}}else{if(_0x51b0f6>=_0x3378d0[_0xb5d3('0x9')]){return utils[_0xb5d3('0x17')](_0x107bb9,0x0,!![],moment())[_0xb5d3('0xb')](function(){return _0x4b5076(null,![],{'message':_0xb5d3('0x14')});});}else{return utils[_0xb5d3('0x17')](_0x107bb9,_0x51b0f6,![],null)[_0xb5d3('0xb')](function(){return _0x4b5076(null,![],{'message':_0xb5d3('0x14')});});}}}else{return _0x4b5076(null,![],{'message':_0xb5d3('0x14')});}}else{if(_0x107bb9[_0xb5d3('0xe')]){return _0x4b5076(null,![],{'message':_0xb5d3('0x14')});}else if(_0x3378d0[_0xb5d3('0x9')]>0x0){if(_0x107bb9['blocked']){if(_0x3378d0[_0xb5d3('0xa')]>0x0){if(moment(_0x107bb9[_0xb5d3('0xf')])[_0xb5d3('0x16')](_0x3378d0['blockDuration'],_0xb5d3('0x18'))>moment()){return _0x4b5076(null,![],{'message':_0xb5d3('0x14')});}else{return utils[_0xb5d3('0x17')](_0x107bb9,0x0,![],null)[_0xb5d3('0xb')](function(){return utils[_0xb5d3('0x19')](_0x107bb9);})[_0xb5d3('0xb')](function(){return _0x4b5076(null,_0x107bb9);});}}else{return _0x4b5076(null,![],{'message':_0xb5d3('0x14')});}}else{return utils['clearBlockUser'](_0x107bb9,0x0,![],null)[_0xb5d3('0xb')](function(){return utils['getLicense'](_0x107bb9);})[_0xb5d3('0xb')](function(){return _0x4b5076(null,_0x107bb9);})[_0xb5d3('0x1a')](function(_0x1d8d9d){return _0x4b5076(null,![],_0x1d8d9d);});}}else{if(_0x107bb9[_0xb5d3('0x15')]){return _0x4b5076(null,![],{'message':_0xb5d3('0x14')});}else{return utils[_0xb5d3('0x19')](_0x107bb9)[_0xb5d3('0xb')](function(){return _0x4b5076(null,_0x107bb9);});}}}});})[_0xb5d3('0x1a')](function(_0x18ecf0){return _0x4b5076(null,![],_0x18ecf0);});}function sendServiceMail(_0x344a84){return db[_0xb5d3('0x1b')][_0xb5d3('0x1c')]({'where':{'service':!![]},'attributes':['id',_0xb5d3('0xc'),'email'],'include':[{'model':db[_0xb5d3('0x1d')],'as':'Smtp','include':[{'model':db[_0xb5d3('0x1e')],'as':_0xb5d3('0x1e')}]}]})[_0xb5d3('0xb')](function(_0x1ca3f4){if(!_0x1ca3f4){throw new Error(_0xb5d3('0x1f'));}var _0x1fc95a=_0x1ca3f4['getSmtpOptions']();var _0x2190d3={'account':_0x1fc95a,'message':_[_0xb5d3('0x20')]({'from':util[_0xb5d3('0x21')](_0xb5d3('0x22'),_0x1ca3f4[_0xb5d3('0xc')],_0x1ca3f4[_0xb5d3('0x23')]||_0x1ca3f4['Smtp'][_0xb5d3('0x11')])},_0x344a84)};return client[_0xb5d3('0x24')]('SendMail',_0x2190d3);})[_0xb5d3('0xb')](function(_0x4cd2de){if(_0x4cd2de[_0xb5d3('0x25')]){throw new Error(util[_0xb5d3('0x21')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x4cd2de[_0xb5d3('0x25')][_0xb5d3('0x26')]||JSON[_0xb5d3('0x27')](_0x4cd2de[_0xb5d3('0x25')])));}return!![];});}function handleError(_0x443920,_0x2edd5f,_0x1c85a2){return _0x443920[_0xb5d3('0x28')](_0x2edd5f||0x1f4)['send']({'message':_0x1c85a2?_0x1c85a2[_0xb5d3('0x26')]||_0x1c85a2:''});}exports[_0xb5d3('0x29')]=function(_0x4dcc26,_0x18e0ae,_0x3fe347){passport[_0xb5d3('0x13')](_0xb5d3('0x2a'),function(_0x256c95,_0x26dea0,_0x320536){var _0x2a02b3=_0x256c95||_0x320536;if(_0x2a02b3){return handleError(_0x18e0ae,0x191,_0x2a02b3);}if(!_0x26dea0){return handleError(_0x18e0ae,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x31edba={'payload':{'id':_0x26dea0['id'],'role':_0x26dea0['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x31edba)[_0xb5d3('0xb')](function(_0x34b0d1){_0x18e0ae['json']({'id':_0x26dea0['id'],'token':_0x34b0d1,'statusCall':'','isAlreadyLogged':_0x26dea0[_0xb5d3('0x2b')]});});}})(_0x4dcc26,_0x18e0ae,_0x3fe347);};exports[_0xb5d3('0x2c')]=function(_0x32d5a5,_0x4299bf){if(!_0x32d5a5[_0xb5d3('0x2d')][_0xb5d3('0x23')]){return handleError(_0x4299bf,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x171619=rs[_0xb5d3('0x2e')]();_0x32d5a5[_0xb5d3('0x2d')][_0xb5d3('0x23')]=_0x32d5a5[_0xb5d3('0x2d')]['email']['trim']()['toLowerCase']();var _0xa00dd7;return db[_0xb5d3('0x2f')]['findOne']({'where':{'id':0x1},'attributes':[_0xb5d3('0x9'),_0xb5d3('0xa')],'raw':!![]})[_0xb5d3('0xb')](function(_0x270cd8){_0xa00dd7=_0x270cd8;return db[_0xb5d3('0x30')]['find']({'where':{'email':_0x32d5a5[_0xb5d3('0x2d')][_0xb5d3('0x23')]}});})[_0xb5d3('0xb')](function(_0x288821){if(!_0x288821){throw new Error(_0xb5d3('0x31'));}if(_0x288821['disabled']){throw new Error(_0xb5d3('0x32'));}if(_0x288821[_0xb5d3('0x15')]){if(moment(_0x288821[_0xb5d3('0xf')])[_0xb5d3('0x16')](_0xa00dd7[_0xb5d3('0xa')],'minutes')>moment()){throw new Error(_0xb5d3('0x33'));}else{_0x288821['blocked']=![];_0x288821[_0xb5d3('0xf')]=null;}}_0x288821[_0xb5d3('0x34')]=_0x171619;_0x288821['resetPasswordExpires']=Date[_0xb5d3('0x35')]()+0x36ee80;return _0x288821['save']();})[_0xb5d3('0xb')](function(){return sendServiceMail({'to':_0x32d5a5[_0xb5d3('0x2d')][_0xb5d3('0x23')],'subject':_0xb5d3('0x36'),'text':_0xb5d3('0x37')+_0xb5d3('0x38')+_0xb5d3('0x39')+_0x32d5a5[_0xb5d3('0x3a')][_0xb5d3('0x3b')]+_0xb5d3('0x3c')+_0x171619+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})['then'](function(){_0x4299bf[_0xb5d3('0x28')](0xc8)[_0xb5d3('0x3d')]({'message':_0xb5d3('0x3e')});})[_0xb5d3('0x1a')](function(_0x1dc65d){return handleError(_0x4299bf,0x1f4,_0x1dc65d);});};exports[_0xb5d3('0x3f')]=function(_0x5aa16c,_0x2b32b3){return db[_0xb5d3('0x30')]['find']({'where':{'resetPasswordToken':_0x5aa16c['params']['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x4323bd){if(!_0x4323bd){throw new Error(_0xb5d3('0x40'));}return db[_0xb5d3('0x2f')]['findOne']({'attributes':['id',_0xb5d3('0x41'),_0xb5d3('0x42'),_0xb5d3('0x43')]})[_0xb5d3('0xb')](function(_0x54899c){if(_0x54899c[_0xb5d3('0x41')])authService['validatePasswordPattern'](_0x5aa16c[_0xb5d3('0x2d')]['password']);if(!_0x54899c[_0xb5d3('0x42')]||!_0x4323bd[_0xb5d3('0x44')])return _0x4323bd;authService[_0xb5d3('0x45')](_0x5aa16c[_0xb5d3('0x2d')][_0xb5d3('0x46')],_0x4323bd['previousPasswords'],_0x54899c[_0xb5d3('0x43')]);return _0x4323bd;})['then'](function(){_0x4323bd['password']=_0x5aa16c[_0xb5d3('0x2d')][_0xb5d3('0x46')];_0x4323bd['resetPasswordToken']=null;_0x4323bd[_0xb5d3('0x47')]=null;return _0x4323bd[_0xb5d3('0x48')]();});})[_0xb5d3('0xb')](function(){_0x2b32b3[_0xb5d3('0x28')](0xc8)['send']({'message':_0xb5d3('0x49')});})['catch'](function(_0x226967){return handleError(_0x2b32b3,0x1f4,_0x226967);});};passport['use'](_0xb5d3('0x2a'),new LocalStrategy({'usernameField':_0xb5d3('0xc'),'passwordField':'password'},function(_0xa8a1a2,_0x1071de,_0x5e942a){return localAuthenticate(db[_0xb5d3('0x30')],_0xa8a1a2,_0x1071de,_0x5e942a);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index cce9aed..2af4a80 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 _0x3ef3=['post','login','forgot','/reset/:token','express','Router'];(function(_0x587bdb,_0xffed85){var _0x3e292c=function(_0xc1bb6b){while(--_0xc1bb6b){_0x587bdb['push'](_0x587bdb['shift']());}};_0x3e292c(++_0xffed85);}(_0x3ef3,0xdc));var _0x33ef=function(_0x3ffa4a,_0xbfbae4){_0x3ffa4a=_0x3ffa4a-0x0;var _0x4e9062=_0x3ef3[_0x3ffa4a];return _0x4e9062;};'use strict';var express=require(_0x33ef('0x0'));var router=express[_0x33ef('0x1')]();var controller=require('./authLocal.controller');router[_0x33ef('0x2')]('/',controller[_0x33ef('0x3')]);router[_0x33ef('0x2')]('/forgot',controller[_0x33ef('0x4')]);router['post'](_0x33ef('0x5'),controller['reset']);module['exports']=router;
\ No newline at end of file
+var _0x3b01=['forgot','post','/reset/:token','reset','express','./authLocal.controller','login','/forgot'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0x3b01,0x94));var _0x13b0=function(_0x5e4e37,_0x57e4ad){_0x5e4e37=_0x5e4e37-0x0;var _0xea325=_0x3b01[_0x5e4e37];return _0xea325;};'use strict';var express=require(_0x13b0('0x0'));var router=express['Router']();var controller=require(_0x13b0('0x1'));router['post']('/',controller[_0x13b0('0x2')]);router['post'](_0x13b0('0x3'),controller[_0x13b0('0x4')]);router[_0x13b0('0x5')](_0x13b0('0x6'),controller[_0x13b0('0x7')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index a775fcb..791ca97 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 _0x8a04=['sequelize','STRING','INTEGER'];(function(_0x4ad0f7,_0x1920b0){var _0x30f5c8=function(_0x2aa6b6){while(--_0x2aa6b6){_0x4ad0f7['push'](_0x4ad0f7['shift']());}};_0x30f5c8(++_0x1920b0);}(_0x8a04,0x1d7));var _0x48a0=function(_0x3cba10,_0x365836){_0x3cba10=_0x3cba10-0x0;var _0x27fc93=_0x8a04[_0x3cba10];return _0x27fc93;};'use strict';var Sequelize=require(_0x48a0('0x0'));module['exports']={'name':{'type':Sequelize[_0x48a0('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x48a0('0x1')]},'description':{'type':Sequelize[_0x48a0('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x48a0('0x2')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x04be=['BOOLEAN','INTEGER','exports','STRING'];(function(_0x3067f3,_0x55914e){var _0xcecdf4=function(_0x2a5929){while(--_0x2a5929){_0x3067f3['push'](_0x3067f3['shift']());}};_0xcecdf4(++_0x55914e);}(_0x04be,0x162));var _0xe04b=function(_0x3169a3,_0x48f18b){_0x3169a3=_0x3169a3-0x0;var _0x4f34de=_0x04be[_0x3169a3];return _0x4f34de;};'use strict';var Sequelize=require('sequelize');module[_0xe04b('0x0')]={'name':{'type':Sequelize[_0xe04b('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xe04b('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xe04b('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 cbef0c3..bf2e6b8 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 _0xcee9=['Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','Automation','includeAll','include','findAll','rows','show','params','find','catch','create','body','addConditions','Condition','ids','omit','order','getConditions','addActions','Action','getActions','findOne','nolimit','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set'];(function(_0x48f848,_0x887c01){var _0x783f00=function(_0x58902a){while(--_0x58902a){_0x48f848['push'](_0x48f848['shift']());}};_0x783f00(++_0x887c01);}(_0xcee9,0xe8));var _0x9cee=function(_0x3017f3,_0x138709){_0x3017f3=_0x3017f3-0x0;var _0x1a7b94=_0xcee9[_0x3017f3];return _0x1a7b94;};'use strict';var emlformat=require(_0x9cee('0x0'));var rimraf=require(_0x9cee('0x1'));var zipdir=require(_0x9cee('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9cee('0x3'));var moment=require(_0x9cee('0x4'));var BPromise=require(_0x9cee('0x5'));var Mustache=require(_0x9cee('0x6'));var util=require(_0x9cee('0x7'));var path=require(_0x9cee('0x8'));var sox=require(_0x9cee('0x9'));var csv=require(_0x9cee('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9cee('0xb'));var _=require(_0x9cee('0xc'));var squel=require('squel');var crypto=require(_0x9cee('0xd'));var jsforce=require(_0x9cee('0xe'));var deskjs=require(_0x9cee('0xf'));var toCsv=require(_0x9cee('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9cee('0x10'));var authService=require(_0x9cee('0x11'));var qs=require(_0x9cee('0x12'));var as=require(_0x9cee('0x13'));var hardwareService=require(_0x9cee('0x14'));var logger=require('../../config/logger')(_0x9cee('0x15'));var utils=require('../../config/utils');var config=require(_0x9cee('0x16'));var licenseUtil=require(_0x9cee('0x17'));var db=require(_0x9cee('0x18'))['db'];function respondWithStatusCode(_0x1b2854,_0x5e6b9b){_0x5e6b9b=_0x5e6b9b||0xcc;return function(_0x149a7f){if(_0x149a7f){return _0x1b2854['sendStatus'](_0x5e6b9b);}return _0x1b2854['status'](_0x5e6b9b)['end']();};}function respondWithResult(_0x110be6,_0x5a0064){_0x5a0064=_0x5a0064||0xc8;return function(_0x429ed7){if(_0x429ed7){return _0x110be6[_0x9cee('0x19')](_0x5a0064)[_0x9cee('0x1a')](_0x429ed7);}};}function respondWithFilteredResult(_0x340065,_0x4569f4){return function(_0x384ee1){if(_0x384ee1){var _0x2a075=typeof _0x4569f4[_0x9cee('0x1b')]===_0x9cee('0x1c')&&typeof _0x4569f4[_0x9cee('0x1d')]===_0x9cee('0x1c');var _0x1d0a5c=_0x384ee1['count'];var _0xed57bc=_0x2a075?0x0:_0x4569f4[_0x9cee('0x1b')];var _0x17c180=_0x2a075?_0x384ee1[_0x9cee('0x1e')]:_0x4569f4[_0x9cee('0x1b')]+_0x4569f4[_0x9cee('0x1d')];var _0x7f4bed;if(_0x17c180>=_0x1d0a5c){_0x17c180=_0x1d0a5c;_0x7f4bed=0xc8;}else{_0x7f4bed=0xce;}_0x340065[_0x9cee('0x19')](_0x7f4bed);return _0x340065[_0x9cee('0x1f')](_0x9cee('0x20'),_0xed57bc+'-'+_0x17c180+'/'+_0x1d0a5c)['json'](_0x384ee1);}return null;};}function patchUpdates(_0x475c8b){return function(_0x259984){try{jsonpatch[_0x9cee('0x21')](_0x259984,_0x475c8b,!![]);}catch(_0x4fb879){return BPromise[_0x9cee('0x22')](_0x4fb879);}return _0x259984['save']();};}function saveUpdates(_0x5a713a,_0x184da2){return function(_0x17aee2){if(_0x17aee2){return _0x17aee2[_0x9cee('0x23')](_0x5a713a)[_0x9cee('0x24')](function(_0x5754a9){return _0x5754a9;});}return null;};}function removeEntity(_0x2a6fdc,_0x11e205){return function(_0x483c96){if(_0x483c96){return _0x483c96[_0x9cee('0x25')]()[_0x9cee('0x24')](function(){_0x2a6fdc[_0x9cee('0x19')](0xcc)[_0x9cee('0x26')]();});}};}function handleEntityNotFound(_0x5e445b,_0x19f746){return function(_0x276a78){if(!_0x276a78){_0x5e445b[_0x9cee('0x27')](0x194);}return _0x276a78;};}function handleError(_0x39d310,_0x5de48a){_0x5de48a=_0x5de48a||0x1f4;return function(_0x51bcc9){logger[_0x9cee('0x28')](_0x51bcc9[_0x9cee('0x29')]);if(_0x51bcc9[_0x9cee('0x2a')]){delete _0x51bcc9['name'];}_0x39d310[_0x9cee('0x19')](_0x5de48a)[_0x9cee('0x2b')](_0x51bcc9);};}exports[_0x9cee('0x2c')]=function(_0x2c6252,_0x5ee160){var _0x2f891a={},_0x4c90c1={},_0x598e70={'count':0x0,'rows':[]};var _0x3af562=_['map'](db['Automation'][_0x9cee('0x2d')],function(_0xdeab53){return{'name':_0xdeab53[_0x9cee('0x2e')],'type':_0xdeab53[_0x9cee('0x2f')][_0x9cee('0x30')]};});_0x4c90c1['model']=_[_0x9cee('0x31')](_0x3af562,_0x9cee('0x2a'));_0x4c90c1[_0x9cee('0x32')]=_[_0x9cee('0x33')](_0x2c6252[_0x9cee('0x32')]);_0x4c90c1[_0x9cee('0x34')]=_[_0x9cee('0x35')](_0x4c90c1[_0x9cee('0x36')],_0x4c90c1[_0x9cee('0x32')]);_0x2f891a[_0x9cee('0x37')]=_['intersection'](_0x4c90c1[_0x9cee('0x36')],qs['fields'](_0x2c6252['query'][_0x9cee('0x38')]));_0x2f891a['attributes']=_0x2f891a[_0x9cee('0x37')][_0x9cee('0x39')]?_0x2f891a[_0x9cee('0x37')]:_0x4c90c1[_0x9cee('0x36')];if(!_0x2c6252['query'][_0x9cee('0x3a')]('nolimit')){_0x2f891a['limit']=qs[_0x9cee('0x1d')](_0x2c6252[_0x9cee('0x32')]['limit']);_0x2f891a[_0x9cee('0x1b')]=qs[_0x9cee('0x1b')](_0x2c6252[_0x9cee('0x32')][_0x9cee('0x1b')]);}_0x2f891a['order']=qs[_0x9cee('0x3b')](_0x2c6252[_0x9cee('0x32')][_0x9cee('0x3b')]);_0x2f891a[_0x9cee('0x3c')]=qs[_0x9cee('0x34')](_[_0x9cee('0x3d')](_0x2c6252['query'],_0x4c90c1[_0x9cee('0x34')]),_0x3af562);if(_0x2c6252[_0x9cee('0x32')][_0x9cee('0x3e')]){_0x2f891a['where']=_[_0x9cee('0x3f')](_0x2f891a['where'],{'$or':_[_0x9cee('0x31')](_0x3af562,function(_0x5eb118){if(_0x5eb118[_0x9cee('0x2f')]!==_0x9cee('0x40')){var _0x345614={};_0x345614[_0x5eb118['name']]={'$like':'%'+_0x2c6252['query'][_0x9cee('0x3e')]+'%'};return _0x345614;}})});}_0x2f891a=_[_0x9cee('0x3f')]({},_0x2f891a,_0x2c6252[_0x9cee('0x41')]);var _0x415b8b={'where':_0x2f891a[_0x9cee('0x3c')]};return db[_0x9cee('0x42')]['count'](_0x415b8b)[_0x9cee('0x24')](function(_0x2d87fc){_0x598e70[_0x9cee('0x1e')]=_0x2d87fc;if(_0x2c6252[_0x9cee('0x32')][_0x9cee('0x43')]){_0x2f891a[_0x9cee('0x44')]=[{'all':!![]}];}return db[_0x9cee('0x42')][_0x9cee('0x45')](_0x2f891a);})['then'](function(_0x390a6a){_0x598e70[_0x9cee('0x46')]=_0x390a6a;return _0x598e70;})['then'](respondWithFilteredResult(_0x5ee160,_0x2f891a))['catch'](handleError(_0x5ee160,null));};exports[_0x9cee('0x47')]=function(_0x33cacc,_0x43ed0c){var _0x4823b2={'raw':![],'where':{'id':_0x33cacc[_0x9cee('0x48')]['id']}},_0x404fa6={};_0x404fa6[_0x9cee('0x36')]=_[_0x9cee('0x33')](db[_0x9cee('0x42')]['rawAttributes']);_0x404fa6[_0x9cee('0x32')]=_[_0x9cee('0x33')](_0x33cacc[_0x9cee('0x32')]);_0x404fa6[_0x9cee('0x34')]=_[_0x9cee('0x35')](_0x404fa6[_0x9cee('0x36')],_0x404fa6[_0x9cee('0x32')]);_0x4823b2[_0x9cee('0x37')]=_[_0x9cee('0x35')](_0x404fa6['model'],qs[_0x9cee('0x38')](_0x33cacc['query'][_0x9cee('0x38')]));_0x4823b2['attributes']=_0x4823b2[_0x9cee('0x37')][_0x9cee('0x39')]?_0x4823b2['attributes']:_0x404fa6[_0x9cee('0x36')];if(_0x33cacc[_0x9cee('0x32')][_0x9cee('0x43')]){_0x4823b2['include']=[{'all':!![]}];}_0x4823b2=_[_0x9cee('0x3f')]({},_0x4823b2,_0x33cacc[_0x9cee('0x41')]);return db[_0x9cee('0x42')][_0x9cee('0x49')](_0x4823b2)[_0x9cee('0x24')](handleEntityNotFound(_0x43ed0c,null))[_0x9cee('0x24')](respondWithResult(_0x43ed0c,null))[_0x9cee('0x4a')](handleError(_0x43ed0c,null));};exports[_0x9cee('0x4b')]=function(_0x2de9ed,_0xbcef18){return db[_0x9cee('0x42')][_0x9cee('0x4b')](_0x2de9ed[_0x9cee('0x4c')],{})[_0x9cee('0x24')](respondWithResult(_0xbcef18,0xc9))[_0x9cee('0x4a')](handleError(_0xbcef18,null));};exports['update']=function(_0x51d0ee,_0x5827bd){if(_0x51d0ee[_0x9cee('0x4c')]['id']){delete _0x51d0ee['body']['id'];}return db[_0x9cee('0x42')][_0x9cee('0x49')]({'where':{'id':_0x51d0ee[_0x9cee('0x48')]['id']}})[_0x9cee('0x24')](handleEntityNotFound(_0x5827bd,null))[_0x9cee('0x24')](saveUpdates(_0x51d0ee['body'],null))['then'](respondWithResult(_0x5827bd,null))[_0x9cee('0x4a')](handleError(_0x5827bd,null));};exports['destroy']=function(_0x446bcd,_0x4c675b){return db[_0x9cee('0x42')][_0x9cee('0x49')]({'where':{'id':_0x446bcd['params']['id']}})[_0x9cee('0x24')](handleEntityNotFound(_0x4c675b,null))[_0x9cee('0x24')](removeEntity(_0x4c675b,null))[_0x9cee('0x4a')](handleError(_0x4c675b,null));};exports[_0x9cee('0x4d')]=function(_0x4b02e7,_0x5d342a,_0x41b5be){return db[_0x9cee('0x4e')]['find']({'where':{'id':_0x4b02e7[_0x9cee('0x48')]['id']}})['then'](handleEntityNotFound(_0x5d342a,null))[_0x9cee('0x24')](function(_0x34fd79){if(_0x34fd79){return _0x34fd79[_0x9cee('0x4d')](_0x4b02e7[_0x9cee('0x4c')][_0x9cee('0x4f')],_[_0x9cee('0x50')](_0x4b02e7[_0x9cee('0x4c')],['ids','id'])||{});}})[_0x9cee('0x24')](respondWithResult(_0x5d342a,null))[_0x9cee('0x4a')](handleError(_0x5d342a,null));};exports['getConditions']=function(_0x3768ed,_0x2b7fac,_0x176bda){var _0x402aa9={};var _0x5a0da5={};var _0x4d82c6;var _0x308dd6;return db['Automation']['findOne']({'where':{'id':_0x3768ed[_0x9cee('0x48')]['id']}})['then'](handleEntityNotFound(_0x2b7fac,null))[_0x9cee('0x24')](function(_0x53d137){if(_0x53d137){_0x4d82c6=_0x53d137;_0x5a0da5['model']=_[_0x9cee('0x33')](db[_0x9cee('0x4e')][_0x9cee('0x2d')]);_0x5a0da5['query']=_[_0x9cee('0x33')](_0x3768ed[_0x9cee('0x32')]);_0x5a0da5['filters']=_[_0x9cee('0x35')](_0x5a0da5['model'],_0x5a0da5[_0x9cee('0x32')]);_0x402aa9['attributes']=_[_0x9cee('0x35')](_0x5a0da5['model'],qs[_0x9cee('0x38')](_0x3768ed[_0x9cee('0x32')][_0x9cee('0x38')]));_0x402aa9['attributes']=_0x402aa9[_0x9cee('0x37')][_0x9cee('0x39')]?_0x402aa9['attributes']:_0x5a0da5['model'];_0x402aa9[_0x9cee('0x51')]=qs[_0x9cee('0x3b')](_0x3768ed['query']['sort']);_0x402aa9[_0x9cee('0x3c')]=qs['filters'](_[_0x9cee('0x3d')](_0x3768ed[_0x9cee('0x32')],_0x5a0da5[_0x9cee('0x34')]));if(_0x3768ed[_0x9cee('0x32')][_0x9cee('0x3e')]){_0x402aa9['where']=_[_0x9cee('0x3f')](_0x402aa9[_0x9cee('0x3c')],{'$or':_[_0x9cee('0x31')](_0x402aa9['attributes'],function(_0x3c95c8){var _0xcdff11={};_0xcdff11[_0x3c95c8]={'$like':'%'+_0x3768ed[_0x9cee('0x32')][_0x9cee('0x3e')]+'%'};return _0xcdff11;})});}_0x402aa9=_[_0x9cee('0x3f')]({},_0x402aa9,_0x3768ed[_0x9cee('0x41')]);return _0x4d82c6[_0x9cee('0x52')](_0x402aa9);}})['then'](function(_0x5551b3){if(_0x5551b3){_0x308dd6=_0x5551b3[_0x9cee('0x39')];if(!_0x3768ed['query'][_0x9cee('0x3a')]('nolimit')){_0x402aa9[_0x9cee('0x1d')]=qs[_0x9cee('0x1d')](_0x3768ed[_0x9cee('0x32')][_0x9cee('0x1d')]);_0x402aa9[_0x9cee('0x1b')]=qs[_0x9cee('0x1b')](_0x3768ed['query'][_0x9cee('0x1b')]);}return _0x4d82c6[_0x9cee('0x52')](_0x402aa9);}})[_0x9cee('0x24')](function(_0x53cb3c){if(_0x53cb3c){return _0x53cb3c?{'count':_0x308dd6,'rows':_0x53cb3c}:null;}})['then'](respondWithResult(_0x2b7fac,null))[_0x9cee('0x4a')](handleError(_0x2b7fac,null));};exports[_0x9cee('0x53')]=function(_0x940e34,_0x3d887c,_0x8fb6f4){return db[_0x9cee('0x54')][_0x9cee('0x49')]({'where':{'id':_0x940e34[_0x9cee('0x48')]['id']}})[_0x9cee('0x24')](handleEntityNotFound(_0x3d887c,null))['then'](function(_0x415c06){if(_0x415c06){return _0x415c06[_0x9cee('0x53')](_0x940e34[_0x9cee('0x4c')][_0x9cee('0x4f')],_[_0x9cee('0x50')](_0x940e34[_0x9cee('0x4c')],[_0x9cee('0x4f'),'id'])||{});}})[_0x9cee('0x24')](respondWithResult(_0x3d887c,null))[_0x9cee('0x4a')](handleError(_0x3d887c,null));};exports[_0x9cee('0x55')]=function(_0x23016c,_0x2ffe51,_0x388daf){var _0x971a={};var _0x1aaec4={};var _0x7a0f01;var _0x2481f8;return db['Automation'][_0x9cee('0x56')]({'where':{'id':_0x23016c['params']['id']}})[_0x9cee('0x24')](handleEntityNotFound(_0x2ffe51,null))[_0x9cee('0x24')](function(_0x4a04d0){if(_0x4a04d0){_0x7a0f01=_0x4a04d0;_0x1aaec4[_0x9cee('0x36')]=_[_0x9cee('0x33')](db[_0x9cee('0x54')]['rawAttributes']);_0x1aaec4[_0x9cee('0x32')]=_[_0x9cee('0x33')](_0x23016c[_0x9cee('0x32')]);_0x1aaec4[_0x9cee('0x34')]=_[_0x9cee('0x35')](_0x1aaec4[_0x9cee('0x36')],_0x1aaec4[_0x9cee('0x32')]);_0x971a[_0x9cee('0x37')]=_['intersection'](_0x1aaec4[_0x9cee('0x36')],qs[_0x9cee('0x38')](_0x23016c[_0x9cee('0x32')][_0x9cee('0x38')]));_0x971a[_0x9cee('0x37')]=_0x971a[_0x9cee('0x37')][_0x9cee('0x39')]?_0x971a[_0x9cee('0x37')]:_0x1aaec4[_0x9cee('0x36')];_0x971a['order']=qs[_0x9cee('0x3b')](_0x23016c[_0x9cee('0x32')]['sort']);_0x971a[_0x9cee('0x3c')]=qs['filters'](_[_0x9cee('0x3d')](_0x23016c[_0x9cee('0x32')],_0x1aaec4[_0x9cee('0x34')]));if(_0x23016c[_0x9cee('0x32')][_0x9cee('0x3e')]){_0x971a['where']=_[_0x9cee('0x3f')](_0x971a['where'],{'$or':_[_0x9cee('0x31')](_0x971a[_0x9cee('0x37')],function(_0xc9f4c2){var _0x9f2237={};_0x9f2237[_0xc9f4c2]={'$like':'%'+_0x23016c[_0x9cee('0x32')][_0x9cee('0x3e')]+'%'};return _0x9f2237;})});}_0x971a=_['merge']({},_0x971a,_0x23016c[_0x9cee('0x41')]);return _0x7a0f01[_0x9cee('0x55')](_0x971a);}})[_0x9cee('0x24')](function(_0x37dd91){if(_0x37dd91){_0x2481f8=_0x37dd91[_0x9cee('0x39')];if(!_0x23016c['query'][_0x9cee('0x3a')](_0x9cee('0x57'))){_0x971a['limit']=qs[_0x9cee('0x1d')](_0x23016c[_0x9cee('0x32')]['limit']);_0x971a[_0x9cee('0x1b')]=qs[_0x9cee('0x1b')](_0x23016c[_0x9cee('0x32')][_0x9cee('0x1b')]);}return _0x7a0f01[_0x9cee('0x55')](_0x971a);}})[_0x9cee('0x24')](function(_0x9c7f92){if(_0x9c7f92){return _0x9c7f92?{'count':_0x2481f8,'rows':_0x9c7f92}:null;}})[_0x9cee('0x24')](respondWithResult(_0x2ffe51,null))[_0x9cee('0x4a')](handleError(_0x2ffe51,null));};
\ No newline at end of file
+var _0x78b3=['where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','destroy','Condition','addConditions','ids','getConditions','findOne','sort','pick','addActions','Action','omit','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','count','limit','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','map','Automation','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x41eb8b,_0x8e630f){var _0x57f6be=function(_0x552d87){while(--_0x552d87){_0x41eb8b['push'](_0x41eb8b['shift']());}};_0x57f6be(++_0x8e630f);}(_0x78b3,0x6d));var _0x378b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78b3[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x378b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x378b('0x1'));var jsonpatch=require(_0x378b('0x2'));var rp=require(_0x378b('0x3'));var moment=require(_0x378b('0x4'));var BPromise=require(_0x378b('0x5'));var Mustache=require(_0x378b('0x6'));var util=require(_0x378b('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x378b('0x8'));var ejs=require(_0x378b('0x9'));var fs=require('fs');var fs_extra=require(_0x378b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x378b('0xb'));var toCsv=require(_0x378b('0x8'));var querystring=require(_0x378b('0xc'));var Papa=require(_0x378b('0xd'));var Redis=require(_0x378b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x378b('0xf'));var as=require(_0x378b('0x10'));var hardwareService=require(_0x378b('0x11'));var logger=require(_0x378b('0x12'))(_0x378b('0x13'));var utils=require('../../config/utils');var config=require(_0x378b('0x14'));var licenseUtil=require(_0x378b('0x15'));var db=require(_0x378b('0x16'))['db'];function respondWithStatusCode(_0x521e73,_0x39d4c4){_0x39d4c4=_0x39d4c4||0xcc;return function(_0x35f0c5){if(_0x35f0c5){return _0x521e73['sendStatus'](_0x39d4c4);}return _0x521e73['status'](_0x39d4c4)[_0x378b('0x17')]();};}function respondWithResult(_0x3d7099,_0x38ba6e){_0x38ba6e=_0x38ba6e||0xc8;return function(_0x23cb4b){if(_0x23cb4b){return _0x3d7099[_0x378b('0x18')](_0x38ba6e)['json'](_0x23cb4b);}};}function respondWithFilteredResult(_0x91ae63,_0xf12f97){return function(_0x59ad27){if(_0x59ad27){var _0x4931e2=typeof _0xf12f97[_0x378b('0x19')]===_0x378b('0x1a')&&typeof _0xf12f97['limit']===_0x378b('0x1a');var _0xf754fa=_0x59ad27[_0x378b('0x1b')];var _0x1c0666=_0x4931e2?0x0:_0xf12f97[_0x378b('0x19')];var _0x470ab4=_0x4931e2?_0x59ad27[_0x378b('0x1b')]:_0xf12f97[_0x378b('0x19')]+_0xf12f97[_0x378b('0x1c')];var _0x4f4ea0;if(_0x470ab4>=_0xf754fa){_0x470ab4=_0xf754fa;_0x4f4ea0=0xc8;}else{_0x4f4ea0=0xce;}_0x91ae63[_0x378b('0x18')](_0x4f4ea0);return _0x91ae63['set'](_0x378b('0x1d'),_0x1c0666+'-'+_0x470ab4+'/'+_0xf754fa)['json'](_0x59ad27);}return null;};}function patchUpdates(_0x24398b){return function(_0x3497e8){try{jsonpatch[_0x378b('0x1e')](_0x3497e8,_0x24398b,!![]);}catch(_0x23e196){return BPromise[_0x378b('0x1f')](_0x23e196);}return _0x3497e8['save']();};}function saveUpdates(_0x4d9e07,_0x4f1ac8){return function(_0x5a3830){if(_0x5a3830){return _0x5a3830[_0x378b('0x20')](_0x4d9e07)[_0x378b('0x21')](function(_0x246286){return _0x246286;});}return null;};}function removeEntity(_0x58920d,_0x56c357){return function(_0x1dc970){if(_0x1dc970){return _0x1dc970['destroy']()['then'](function(){_0x58920d[_0x378b('0x18')](0xcc)[_0x378b('0x17')]();});}};}function handleEntityNotFound(_0x55719e,_0x3845a1){return function(_0x43c525){if(!_0x43c525){_0x55719e[_0x378b('0x22')](0x194);}return _0x43c525;};}function handleError(_0x29667d,_0x22afef){_0x22afef=_0x22afef||0x1f4;return function(_0x5b76d1){logger[_0x378b('0x23')](_0x5b76d1[_0x378b('0x24')]);if(_0x5b76d1[_0x378b('0x25')]){delete _0x5b76d1[_0x378b('0x25')];}_0x29667d[_0x378b('0x18')](_0x22afef)[_0x378b('0x26')](_0x5b76d1);};}exports['index']=function(_0x15801b,_0x248700){var _0x3c301b={},_0x4efddc={},_0x2691da={'count':0x0,'rows':[]};var _0x45b8cd=_[_0x378b('0x27')](db[_0x378b('0x28')]['rawAttributes'],function(_0x24af94){return{'name':_0x24af94[_0x378b('0x29')],'type':_0x24af94[_0x378b('0x2a')]['key']};});_0x4efddc[_0x378b('0x2b')]=_[_0x378b('0x27')](_0x45b8cd,_0x378b('0x25'));_0x4efddc[_0x378b('0x2c')]=_['keys'](_0x15801b['query']);_0x4efddc[_0x378b('0x2d')]=_[_0x378b('0x2e')](_0x4efddc[_0x378b('0x2b')],_0x4efddc['query']);_0x3c301b[_0x378b('0x2f')]=_['intersection'](_0x4efddc[_0x378b('0x2b')],qs[_0x378b('0x30')](_0x15801b[_0x378b('0x2c')][_0x378b('0x30')]));_0x3c301b[_0x378b('0x2f')]=_0x3c301b[_0x378b('0x2f')][_0x378b('0x31')]?_0x3c301b[_0x378b('0x2f')]:_0x4efddc[_0x378b('0x2b')];if(!_0x15801b[_0x378b('0x2c')][_0x378b('0x32')](_0x378b('0x33'))){_0x3c301b[_0x378b('0x1c')]=qs[_0x378b('0x1c')](_0x15801b[_0x378b('0x2c')]['limit']);_0x3c301b[_0x378b('0x19')]=qs['offset'](_0x15801b['query'][_0x378b('0x19')]);}_0x3c301b[_0x378b('0x34')]=qs['sort'](_0x15801b[_0x378b('0x2c')]['sort']);_0x3c301b[_0x378b('0x35')]=qs['filters'](_['pick'](_0x15801b[_0x378b('0x2c')],_0x4efddc[_0x378b('0x2d')]),_0x45b8cd);if(_0x15801b[_0x378b('0x2c')]['filter']){_0x3c301b[_0x378b('0x35')]=_['merge'](_0x3c301b['where'],{'$or':_[_0x378b('0x27')](_0x45b8cd,function(_0x2a7bd3){if(_0x2a7bd3[_0x378b('0x2a')]!=='VIRTUAL'){var _0x40a777={};_0x40a777[_0x2a7bd3[_0x378b('0x25')]]={'$like':'%'+_0x15801b[_0x378b('0x2c')][_0x378b('0x36')]+'%'};return _0x40a777;}})});}_0x3c301b=_[_0x378b('0x37')]({},_0x3c301b,_0x15801b[_0x378b('0x38')]);var _0x5ba8b8={'where':_0x3c301b[_0x378b('0x35')]};return db[_0x378b('0x28')][_0x378b('0x1b')](_0x5ba8b8)[_0x378b('0x21')](function(_0x38bd7d){_0x2691da[_0x378b('0x1b')]=_0x38bd7d;if(_0x15801b[_0x378b('0x2c')][_0x378b('0x39')]){_0x3c301b[_0x378b('0x3a')]=[{'all':!![]}];}return db[_0x378b('0x28')][_0x378b('0x3b')](_0x3c301b);})[_0x378b('0x21')](function(_0x7db198){_0x2691da[_0x378b('0x3c')]=_0x7db198;return _0x2691da;})[_0x378b('0x21')](respondWithFilteredResult(_0x248700,_0x3c301b))[_0x378b('0x3d')](handleError(_0x248700,null));};exports[_0x378b('0x3e')]=function(_0x2dd0eb,_0x19134d){var _0x117051={'raw':![],'where':{'id':_0x2dd0eb[_0x378b('0x3f')]['id']}},_0x4ba266={};_0x4ba266[_0x378b('0x2b')]=_[_0x378b('0x40')](db[_0x378b('0x28')][_0x378b('0x41')]);_0x4ba266[_0x378b('0x2c')]=_[_0x378b('0x40')](_0x2dd0eb['query']);_0x4ba266[_0x378b('0x2d')]=_[_0x378b('0x2e')](_0x4ba266[_0x378b('0x2b')],_0x4ba266[_0x378b('0x2c')]);_0x117051[_0x378b('0x2f')]=_[_0x378b('0x2e')](_0x4ba266[_0x378b('0x2b')],qs[_0x378b('0x30')](_0x2dd0eb[_0x378b('0x2c')][_0x378b('0x30')]));_0x117051[_0x378b('0x2f')]=_0x117051[_0x378b('0x2f')]['length']?_0x117051['attributes']:_0x4ba266[_0x378b('0x2b')];if(_0x2dd0eb['query'][_0x378b('0x39')]){_0x117051[_0x378b('0x3a')]=[{'all':!![]}];}_0x117051=_[_0x378b('0x37')]({},_0x117051,_0x2dd0eb['options']);return db[_0x378b('0x28')][_0x378b('0x42')](_0x117051)[_0x378b('0x21')](handleEntityNotFound(_0x19134d,null))[_0x378b('0x21')](respondWithResult(_0x19134d,null))[_0x378b('0x3d')](handleError(_0x19134d,null));};exports[_0x378b('0x43')]=function(_0x359acc,_0x17c1d2){return db[_0x378b('0x28')][_0x378b('0x43')](_0x359acc[_0x378b('0x44')],{})[_0x378b('0x21')](respondWithResult(_0x17c1d2,0xc9))['catch'](handleError(_0x17c1d2,null));};exports[_0x378b('0x20')]=function(_0x100fb9,_0x2ebaec){if(_0x100fb9[_0x378b('0x44')]['id']){delete _0x100fb9[_0x378b('0x44')]['id'];}return db[_0x378b('0x28')][_0x378b('0x42')]({'where':{'id':_0x100fb9['params']['id']}})['then'](handleEntityNotFound(_0x2ebaec,null))[_0x378b('0x21')](saveUpdates(_0x100fb9['body'],null))[_0x378b('0x21')](respondWithResult(_0x2ebaec,null))[_0x378b('0x3d')](handleError(_0x2ebaec,null));};exports[_0x378b('0x45')]=function(_0x33b281,_0x2f2bcb){return db['Automation']['find']({'where':{'id':_0x33b281['params']['id']}})[_0x378b('0x21')](handleEntityNotFound(_0x2f2bcb,null))[_0x378b('0x21')](removeEntity(_0x2f2bcb,null))[_0x378b('0x3d')](handleError(_0x2f2bcb,null));};exports['addConditions']=function(_0x4c55b8,_0x59c859,_0x286380){return db[_0x378b('0x46')][_0x378b('0x42')]({'where':{'id':_0x4c55b8['params']['id']}})['then'](handleEntityNotFound(_0x59c859,null))[_0x378b('0x21')](function(_0x2381d4){if(_0x2381d4){return _0x2381d4[_0x378b('0x47')](_0x4c55b8['body'][_0x378b('0x48')],_['omit'](_0x4c55b8['body'],['ids','id'])||{});}})[_0x378b('0x21')](respondWithResult(_0x59c859,null))[_0x378b('0x3d')](handleError(_0x59c859,null));};exports[_0x378b('0x49')]=function(_0xd46175,_0x4e09f3,_0x5af232){var _0x5d79a2={};var _0x16181b={};var _0xdcc7c5;var _0x8279f6;return db['Automation'][_0x378b('0x4a')]({'where':{'id':_0xd46175[_0x378b('0x3f')]['id']}})[_0x378b('0x21')](handleEntityNotFound(_0x4e09f3,null))[_0x378b('0x21')](function(_0x516d10){if(_0x516d10){_0xdcc7c5=_0x516d10;_0x16181b[_0x378b('0x2b')]=_[_0x378b('0x40')](db[_0x378b('0x46')]['rawAttributes']);_0x16181b[_0x378b('0x2c')]=_[_0x378b('0x40')](_0xd46175[_0x378b('0x2c')]);_0x16181b[_0x378b('0x2d')]=_[_0x378b('0x2e')](_0x16181b[_0x378b('0x2b')],_0x16181b['query']);_0x5d79a2[_0x378b('0x2f')]=_['intersection'](_0x16181b[_0x378b('0x2b')],qs['fields'](_0xd46175[_0x378b('0x2c')][_0x378b('0x30')]));_0x5d79a2[_0x378b('0x2f')]=_0x5d79a2[_0x378b('0x2f')]['length']?_0x5d79a2[_0x378b('0x2f')]:_0x16181b[_0x378b('0x2b')];_0x5d79a2[_0x378b('0x34')]=qs['sort'](_0xd46175['query'][_0x378b('0x4b')]);_0x5d79a2[_0x378b('0x35')]=qs[_0x378b('0x2d')](_[_0x378b('0x4c')](_0xd46175['query'],_0x16181b[_0x378b('0x2d')]));if(_0xd46175[_0x378b('0x2c')][_0x378b('0x36')]){_0x5d79a2[_0x378b('0x35')]=_['merge'](_0x5d79a2[_0x378b('0x35')],{'$or':_[_0x378b('0x27')](_0x5d79a2[_0x378b('0x2f')],function(_0x4e69c5){var _0x363e99={};_0x363e99[_0x4e69c5]={'$like':'%'+_0xd46175[_0x378b('0x2c')][_0x378b('0x36')]+'%'};return _0x363e99;})});}_0x5d79a2=_[_0x378b('0x37')]({},_0x5d79a2,_0xd46175[_0x378b('0x38')]);return _0xdcc7c5[_0x378b('0x49')](_0x5d79a2);}})[_0x378b('0x21')](function(_0x2950f9){if(_0x2950f9){_0x8279f6=_0x2950f9[_0x378b('0x31')];if(!_0xd46175[_0x378b('0x2c')][_0x378b('0x32')]('nolimit')){_0x5d79a2[_0x378b('0x1c')]=qs[_0x378b('0x1c')](_0xd46175[_0x378b('0x2c')]['limit']);_0x5d79a2[_0x378b('0x19')]=qs['offset'](_0xd46175[_0x378b('0x2c')][_0x378b('0x19')]);}return _0xdcc7c5[_0x378b('0x49')](_0x5d79a2);}})['then'](function(_0xa4972){if(_0xa4972){return _0xa4972?{'count':_0x8279f6,'rows':_0xa4972}:null;}})['then'](respondWithResult(_0x4e09f3,null))['catch'](handleError(_0x4e09f3,null));};exports[_0x378b('0x4d')]=function(_0x2319cb,_0x47b6d1,_0x510ce7){return db[_0x378b('0x4e')]['find']({'where':{'id':_0x2319cb['params']['id']}})[_0x378b('0x21')](handleEntityNotFound(_0x47b6d1,null))['then'](function(_0x5bcb62){if(_0x5bcb62){return _0x5bcb62[_0x378b('0x4d')](_0x2319cb[_0x378b('0x44')][_0x378b('0x48')],_[_0x378b('0x4f')](_0x2319cb[_0x378b('0x44')],[_0x378b('0x48'),'id'])||{});}})[_0x378b('0x21')](respondWithResult(_0x47b6d1,null))[_0x378b('0x3d')](handleError(_0x47b6d1,null));};exports[_0x378b('0x50')]=function(_0x2bb98f,_0x1de7e2,_0x39d782){var _0xe6445={};var _0x4306f7={};var _0x40468f;var _0x506b35;return db['Automation'][_0x378b('0x4a')]({'where':{'id':_0x2bb98f[_0x378b('0x3f')]['id']}})[_0x378b('0x21')](handleEntityNotFound(_0x1de7e2,null))['then'](function(_0x431fa2){if(_0x431fa2){_0x40468f=_0x431fa2;_0x4306f7[_0x378b('0x2b')]=_[_0x378b('0x40')](db[_0x378b('0x4e')][_0x378b('0x41')]);_0x4306f7[_0x378b('0x2c')]=_['keys'](_0x2bb98f[_0x378b('0x2c')]);_0x4306f7[_0x378b('0x2d')]=_[_0x378b('0x2e')](_0x4306f7[_0x378b('0x2b')],_0x4306f7[_0x378b('0x2c')]);_0xe6445[_0x378b('0x2f')]=_[_0x378b('0x2e')](_0x4306f7['model'],qs[_0x378b('0x30')](_0x2bb98f[_0x378b('0x2c')][_0x378b('0x30')]));_0xe6445['attributes']=_0xe6445[_0x378b('0x2f')][_0x378b('0x31')]?_0xe6445[_0x378b('0x2f')]:_0x4306f7[_0x378b('0x2b')];_0xe6445[_0x378b('0x34')]=qs[_0x378b('0x4b')](_0x2bb98f[_0x378b('0x2c')][_0x378b('0x4b')]);_0xe6445[_0x378b('0x35')]=qs['filters'](_['pick'](_0x2bb98f[_0x378b('0x2c')],_0x4306f7['filters']));if(_0x2bb98f[_0x378b('0x2c')][_0x378b('0x36')]){_0xe6445[_0x378b('0x35')]=_[_0x378b('0x37')](_0xe6445[_0x378b('0x35')],{'$or':_['map'](_0xe6445[_0x378b('0x2f')],function(_0xd1cc7a){var _0x5c6547={};_0x5c6547[_0xd1cc7a]={'$like':'%'+_0x2bb98f[_0x378b('0x2c')][_0x378b('0x36')]+'%'};return _0x5c6547;})});}_0xe6445=_[_0x378b('0x37')]({},_0xe6445,_0x2bb98f[_0x378b('0x38')]);return _0x40468f[_0x378b('0x50')](_0xe6445);}})[_0x378b('0x21')](function(_0x208883){if(_0x208883){_0x506b35=_0x208883['length'];if(!_0x2bb98f[_0x378b('0x2c')][_0x378b('0x32')]('nolimit')){_0xe6445[_0x378b('0x1c')]=qs[_0x378b('0x1c')](_0x2bb98f[_0x378b('0x2c')]['limit']);_0xe6445[_0x378b('0x19')]=qs[_0x378b('0x19')](_0x2bb98f['query'][_0x378b('0x19')]);}return _0x40468f[_0x378b('0x50')](_0xe6445);}})['then'](function(_0x1003ad){if(_0x1003ad){return _0x1003ad?{'count':_0x506b35,'rows':_0x1003ad}:null;}})[_0x378b('0x21')](respondWithResult(_0x1de7e2,null))[_0x378b('0x3d')](handleError(_0x1de7e2,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 94c97ba..73b54ee 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 _0xfc3d=['rimraf','./automation.attributes','exports','Automation','tools_automations','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x22e6f0,_0x9d6f84){var _0x31aeaf=function(_0x203316){while(--_0x203316){_0x22e6f0['push'](_0x22e6f0['shift']());}};_0x31aeaf(++_0x9d6f84);}(_0xfc3d,0x19d));var _0xdfc3=function(_0x208cda,_0x46fb61){_0x208cda=_0x208cda-0x0;var _0x3cc9a8=_0xfc3d[_0x208cda];return _0x3cc9a8;};'use strict';var _=require(_0xdfc3('0x0'));var util=require(_0xdfc3('0x1'));var logger=require('../../config/logger')(_0xdfc3('0x2'));var moment=require(_0xdfc3('0x3'));var BPromise=require(_0xdfc3('0x4'));var rp=require(_0xdfc3('0x5'));var fs=require('fs');var path=require(_0xdfc3('0x6'));var rimraf=require(_0xdfc3('0x7'));var config=require('../../config/environment');var attributes=require(_0xdfc3('0x8'));module[_0xdfc3('0x9')]=function(_0x401d1a,_0xf38aa4){return _0x401d1a['define'](_0xdfc3('0xa'),attributes,{'tableName':_0xdfc3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf38b=['request-promise','path','../../config/environment','./automation.attributes','Automation','tools_automations','lodash','util','moment','bluebird'];(function(_0x47a41f,_0x48d92b){var _0x2411f5=function(_0x3f5b72){while(--_0x3f5b72){_0x47a41f['push'](_0x47a41f['shift']());}};_0x2411f5(++_0x48d92b);}(_0xf38b,0x10a));var _0xbf38=function(_0x2417f5,_0x15553f){_0x2417f5=_0x2417f5-0x0;var _0x181eec=_0xf38b[_0x2417f5];return _0x181eec;};'use strict';var _=require(_0xbf38('0x0'));var util=require(_0xbf38('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbf38('0x2'));var BPromise=require(_0xbf38('0x3'));var rp=require(_0xbf38('0x4'));var fs=require('fs');var path=require(_0xbf38('0x5'));var rimraf=require('rimraf');var config=require(_0xbf38('0x6'));var attributes=require(_0xbf38('0x7'));module['exports']=function(_0x1450a4,_0x15da51){return _0x1450a4['define'](_0xbf38('0x8'),attributes,{'tableName':_0xbf38('0x9'),'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 265151a..4cdd8c4 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 _0xc6d7=['rpc','../../config/environment','jayson/promise','client','http','request','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3a64dc,_0x1f46be){var _0x58d3a2=function(_0x1031cd){while(--_0x1031cd){_0x3a64dc['push'](_0x3a64dc['shift']());}};_0x58d3a2(++_0x1f46be);}(_0xc6d7,0x71));var _0x7c6d=function(_0x3c9d4b,_0x57223d){_0x3c9d4b=_0x3c9d4b-0x0;var _0x234a8a=_0xc6d7[_0x3c9d4b];return _0x234a8a;};'use strict';var _=require(_0x7c6d('0x0'));var util=require(_0x7c6d('0x1'));var moment=require(_0x7c6d('0x2'));var BPromise=require(_0x7c6d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c6d('0x4'))['db'];var utils=require(_0x7c6d('0x5'));var logger=require(_0x7c6d('0x6'))(_0x7c6d('0x7'));var config=require(_0x7c6d('0x8'));var jayson=require(_0x7c6d('0x9'));var client=jayson[_0x7c6d('0xa')][_0x7c6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x446b68,_0x45713e,_0x338f94){return new BPromise(function(_0x1ad7e2,_0x22755d){return client[_0x7c6d('0xc')](_0x446b68,_0x338f94)['then'](function(_0x477a41){logger['info'](_0x7c6d('0xd'),_0x45713e,_0x7c6d('0xe'));logger[_0x7c6d('0xf')](_0x7c6d('0x10'),_0x45713e,'request\x20sent',JSON[_0x7c6d('0x11')](_0x477a41));if(_0x477a41[_0x7c6d('0x12')]){if(_0x477a41[_0x7c6d('0x12')][_0x7c6d('0x13')]===0x1f4){logger[_0x7c6d('0x12')](_0x7c6d('0xd'),_0x45713e,_0x477a41[_0x7c6d('0x12')]['message']);return _0x22755d(_0x477a41[_0x7c6d('0x12')][_0x7c6d('0x14')]);}logger[_0x7c6d('0x12')](_0x7c6d('0xd'),_0x45713e,_0x477a41[_0x7c6d('0x12')][_0x7c6d('0x14')]);return _0x1ad7e2(_0x477a41[_0x7c6d('0x12')][_0x7c6d('0x14')]);}else{logger[_0x7c6d('0x15')]('Automation,\x20%s,\x20%s',_0x45713e,_0x7c6d('0xe'));_0x1ad7e2(_0x477a41[_0x7c6d('0x16')]['message']);}})[_0x7c6d('0x17')](function(_0x220bae){logger[_0x7c6d('0x12')](_0x7c6d('0xd'),_0x45713e,_0x220bae);_0x22755d(_0x220bae);});});}
\ No newline at end of file
+var _0x1410=['jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1410,0x130));var _0x0141=function(_0xd6bcdb,_0x44853c){_0xd6bcdb=_0xd6bcdb-0x0;var _0x199a86=_0x1410[_0xd6bcdb];return _0x199a86;};'use strict';var _=require(_0x0141('0x0'));var util=require(_0x0141('0x1'));var moment=require(_0x0141('0x2'));var BPromise=require(_0x0141('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0141('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0141('0x5'));var logger=require('../../config/logger')(_0x0141('0x6'));var config=require(_0x0141('0x7'));var jayson=require(_0x0141('0x8'));var client=jayson[_0x0141('0x9')][_0x0141('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24f701,_0x22b566,_0x25511f){return new BPromise(function(_0x2d8f15,_0x57cfbb){return client[_0x0141('0xb')](_0x24f701,_0x25511f)[_0x0141('0xc')](function(_0x2b4f13){logger[_0x0141('0xd')](_0x0141('0xe'),_0x22b566,_0x0141('0xf'));logger[_0x0141('0x10')](_0x0141('0x11'),_0x22b566,'request\x20sent',JSON[_0x0141('0x12')](_0x2b4f13));if(_0x2b4f13[_0x0141('0x13')]){if(_0x2b4f13[_0x0141('0x13')][_0x0141('0x14')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x22b566,_0x2b4f13[_0x0141('0x13')][_0x0141('0x15')]);return _0x57cfbb(_0x2b4f13['error'][_0x0141('0x15')]);}logger[_0x0141('0x13')](_0x0141('0xe'),_0x22b566,_0x2b4f13[_0x0141('0x13')][_0x0141('0x15')]);return _0x2d8f15(_0x2b4f13['error'][_0x0141('0x15')]);}else{logger['info'](_0x0141('0xe'),_0x22b566,_0x0141('0xf'));_0x2d8f15(_0x2b4f13[_0x0141('0x16')][_0x0141('0x15')]);}})[_0x0141('0x17')](function(_0x3c91e8){logger['error']('Automation,\x20%s,\x20%s',_0x22b566,_0x3c91e8);_0x57cfbb(_0x3c91e8);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index fd09122..178ce76 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 _0xac52=['/:id','show','/:id/conditions','getConditions','/:id/actions','post','create','addActions','put','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated'];(function(_0x205496,_0x11ab53){var _0x449187=function(_0xf07d19){while(--_0xf07d19){_0x205496['push'](_0x205496['shift']());}};_0x449187(++_0x11ab53);}(_0xac52,0x122));var _0x2ac5=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xac52[_0x580576];return _0x3f55a0;};'use strict';var multer=require('multer');var util=require(_0x2ac5('0x0'));var path=require(_0x2ac5('0x1'));var timeout=require(_0x2ac5('0x2'));var express=require(_0x2ac5('0x3'));var router=express[_0x2ac5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2ac5('0x5'));var interaction=require(_0x2ac5('0x6'));var config=require('../../config/environment');var controller=require(_0x2ac5('0x7'));router[_0x2ac5('0x8')]('/',auth[_0x2ac5('0x9')](),controller['index']);router['get'](_0x2ac5('0xa'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0xb')]);router[_0x2ac5('0x8')](_0x2ac5('0xc'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0xd')]);router[_0x2ac5('0x8')](_0x2ac5('0xe'),auth[_0x2ac5('0x9')](),controller['getActions']);router[_0x2ac5('0xf')]('/',auth[_0x2ac5('0x9')](),controller[_0x2ac5('0x10')]);router[_0x2ac5('0xf')]('/:id/conditions',auth['isAuthenticated'](),controller['addConditions']);router[_0x2ac5('0xf')](_0x2ac5('0xe'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0x11')]);router[_0x2ac5('0x12')]('/:id',auth[_0x2ac5('0x9')](),controller['update']);router[_0x2ac5('0x13')](_0x2ac5('0xa'),auth[_0x2ac5('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xcd3a=['show','/:id/conditions','getConditions','post','create','addConditions','addActions','put','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id'];(function(_0xa5f5ab,_0x251aa3){var _0xc25c1b=function(_0x10af38){while(--_0x10af38){_0xa5f5ab['push'](_0xa5f5ab['shift']());}};_0xc25c1b(++_0x251aa3);}(_0xcd3a,0xcf));var _0xacd3=function(_0x3e27a5,_0x1b0bb0){_0x3e27a5=_0x3e27a5-0x0;var _0x2b666e=_0xcd3a[_0x3e27a5];return _0x2b666e;};'use strict';var multer=require(_0xacd3('0x0'));var util=require(_0xacd3('0x1'));var path=require(_0xacd3('0x2'));var timeout=require(_0xacd3('0x3'));var express=require(_0xacd3('0x4'));var router=express[_0xacd3('0x5')]();var fs_extra=require(_0xacd3('0x6'));var auth=require(_0xacd3('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xacd3('0x8'));var controller=require(_0xacd3('0x9'));router[_0xacd3('0xa')]('/',auth[_0xacd3('0xb')](),controller['index']);router['get'](_0xacd3('0xc'),auth[_0xacd3('0xb')](),controller[_0xacd3('0xd')]);router['get'](_0xacd3('0xe'),auth[_0xacd3('0xb')](),controller[_0xacd3('0xf')]);router[_0xacd3('0xa')]('/:id/actions',auth[_0xacd3('0xb')](),controller['getActions']);router[_0xacd3('0x10')]('/',auth[_0xacd3('0xb')](),controller[_0xacd3('0x11')]);router[_0xacd3('0x10')]('/:id/conditions',auth[_0xacd3('0xb')](),controller[_0xacd3('0x12')]);router[_0xacd3('0x10')]('/:id/actions',auth['isAuthenticated'](),controller[_0xacd3('0x13')]);router[_0xacd3('0x14')]('/:id',auth[_0xacd3('0xb')](),controller['update']);router['delete'](_0xacd3('0xc'),auth[_0xacd3('0xb')](),controller['destroy']);module[_0xacd3('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index e5e6351..0892552 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 _0x028a=['ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','ENUM','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name'];(function(_0x54854b,_0x5e2ab3){var _0x2ed79b=function(_0x3fc3af){while(--_0x3fc3af){_0x54854b['push'](_0x54854b['shift']());}};_0x2ed79b(++_0x5e2ab3);}(_0x028a,0x1b5));var _0xa028=function(_0x28b709,_0x4d7a52){_0x28b709=_0x28b709-0x0;var _0x1ebf2f=_0x028a[_0x28b709];return _0x1ebf2f;};'use strict';var Sequelize=require('sequelize');module[_0xa028('0x0')]={'name':{'type':Sequelize[_0xa028('0x1')],'unique':_0xa028('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xa028('0x3')),'allowNull':![],'defaultValue':_0xa028('0x3')},'description':{'type':Sequelize[_0xa028('0x1')]},'active':{'type':Sequelize[_0xa028('0x4')],'defaultValue':0x0,'comment':_0xa028('0x5')},'limitCalls':{'type':Sequelize[_0xa028('0x6')](0x4)[_0xa028('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa028('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xa028('0x6')](0x3)[_0xa028('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa028('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xa028('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa028('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xa028('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa028('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xa028('0x6')](0x3)[_0xa028('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa028('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa028('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa028('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa028('0x6')](0x3)[_0xa028('0x7')],'defaultValue':0x3,'comment':_0xa028('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa028('0x6')](0x5)[_0xa028('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa028('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xa028('0x6')](0x3)[_0xa028('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa028('0xf')},'dialTimezone':{'type':Sequelize[_0xa028('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa028('0x1')],'defaultValue':_0xa028('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0xa028('0x11'),_0xa028('0x12')),'defaultValue':_0xa028('0x13')},'dialAMDActive':{'type':Sequelize[_0xa028('0x4')],'defaultValue':0x0,'comment':_0xa028('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xa028('0x6')](0x9)[_0xa028('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa028('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xa028('0x6')](0x9)[_0xa028('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xa028('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa028('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa028('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xa028('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa028('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0xa028('0x6')](0x9)[_0xa028('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa028('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa028('0x6')](0x9)[_0xa028('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa028('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xa028('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xa028('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa028('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa028('0x6')](0x9)[_0xa028('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xa028('0x1c')](_0xa028('0x1d'),_0xa028('0x1e')),'defaultValue':_0xa028('0x1d')},'dialPrefix':{'type':Sequelize[_0xa028('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xa028('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa028('0x1f')},'dialCutDigit':{'type':Sequelize[_0xa028('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa028('0x20')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa028('0x6')](0x3)[_0xa028('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa028('0x6')](0x5)[_0xa028('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa028('0x21')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa028('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xa028('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa028('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa028('0x6')](0x5)[_0xa028('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa028('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0xa028('0x6')](0x3)[_0xa028('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xa028('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa028('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xa028('0x6')](0x3)[_0xa028('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa028('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa028('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa028('0x27')}};
\ No newline at end of file
+var _0x7a1a=['always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'];(function(_0x3d1825,_0x319490){var _0x4098f2=function(_0x2a6901){while(--_0x2a6901){_0x3d1825['push'](_0x3d1825['shift']());}};_0x4098f2(++_0x319490);}(_0x7a1a,0x187));var _0xa7a1=function(_0x5015cc,_0x57a4f0){_0x5015cc=_0x5015cc-0x0;var _0x4946be=_0x7a1a[_0x5015cc];return _0x4946be;};'use strict';var Sequelize=require('sequelize');module[_0xa7a1('0x0')]={'name':{'type':Sequelize[_0xa7a1('0x1')],'unique':_0xa7a1('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xa7a1('0x3')](_0xa7a1('0x4')),'allowNull':![],'defaultValue':_0xa7a1('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xa7a1('0x5')},'limitCalls':{'type':Sequelize[_0xa7a1('0x6')](0x4)[_0xa7a1('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xa7a1('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xa7a1('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa7a1('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xa7a1('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa7a1('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa7a1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa7a1('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xa7a1('0x6')](0x5)[_0xa7a1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa7a1('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xa7a1('0x6')](0x3)[_0xa7a1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xa7a1('0x6')](0x5)[_0xa7a1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa7a1('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa7a1('0x6')](0x3)[_0xa7a1('0x7')],'defaultValue':0x3,'comment':_0xa7a1('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa7a1('0x6')](0x5)[_0xa7a1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa7a1('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xa7a1('0x6')](0x3)[_0xa7a1('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa7a1('0xf')},'dialTimezone':{'type':Sequelize[_0xa7a1('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa7a1('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xa7a1('0x3')](_0xa7a1('0x10'),_0xa7a1('0x11'),_0xa7a1('0x12')),'defaultValue':_0xa7a1('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xa7a1('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xa7a1('0x6')](0x9)[_0xa7a1('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa7a1('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xa7a1('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xa7a1('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xa7a1('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa7a1('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa7a1('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xa7a1('0x6')](0x9)[_0xa7a1('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa7a1('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa7a1('0x6')](0x9)[_0xa7a1('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xa7a1('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa7a1('0x6')](0x5)[_0xa7a1('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa7a1('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xa7a1('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa7a1('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xa7a1('0x3')](_0xa7a1('0x1b'),_0xa7a1('0x1c')),'defaultValue':_0xa7a1('0x1b')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xa7a1('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa7a1('0x1d')},'dialCutDigit':{'type':Sequelize[_0xa7a1('0x6')](0x3)[_0xa7a1('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa7a1('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa7a1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa7a1('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa7a1('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0xa7a1('0x6')](0x3)[_0xa7a1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa7a1('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0xa7a1('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa7a1('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xa7a1('0x6')](0x3)[_0xa7a1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa7a1('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa7a1('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xa7a1('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xa7a1('0x6')](0x5)[_0xa7a1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa7a1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa7a1('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa7a1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa7a1('0x24')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 4e871a0..3837a58 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 _0x336d=['ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','into','ListId','from','OrderBy','h.id','ci.item','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','UserProfileResource','error','name','index','map','Campaign','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','catch','show','params','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','role','IvrCampaigns','UserProfileSection','getHoppers','findOne','CmHopper','rows','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','field','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL'];(function(_0x15b916,_0x39ccf5){var _0x4f6426=function(_0x1ba9ca){while(--_0x1ba9ca){_0x15b916['push'](_0x15b916['shift']());}};_0x4f6426(++_0x39ccf5);}(_0x336d,0xae));var _0xd336=function(_0x5cda54,_0x9b37fc){_0x5cda54=_0x5cda54-0x0;var _0x33d718=_0x336d[_0x5cda54];return _0x33d718;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd336('0x0'));var zipdir=require(_0xd336('0x1'));var jsonpatch=require(_0xd336('0x2'));var rp=require(_0xd336('0x3'));var moment=require(_0xd336('0x4'));var BPromise=require(_0xd336('0x5'));var Mustache=require(_0xd336('0x6'));var util=require(_0xd336('0x7'));var path=require(_0xd336('0x8'));var sox=require(_0xd336('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd336('0xa'));var _=require(_0xd336('0xb'));var squel=require(_0xd336('0xc'));var crypto=require('crypto');var jsforce=require(_0xd336('0xd'));var deskjs=require(_0xd336('0xe'));var toCsv=require(_0xd336('0xf'));var querystring=require(_0xd336('0x10'));var Papa=require(_0xd336('0x11'));var Redis=require(_0xd336('0x12'));var authService=require(_0xd336('0x13'));var qs=require(_0xd336('0x14'));var as=require(_0xd336('0x15'));var hardwareService=require(_0xd336('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xd336('0x17'));var config=require(_0xd336('0x18'));var licenseUtil=require(_0xd336('0x19'));var db=require(_0xd336('0x1a'))['db'];function respondWithStatusCode(_0x29aa4a,_0x276abb){_0x276abb=_0x276abb||0xcc;return function(_0x327229){if(_0x327229){return _0x29aa4a[_0xd336('0x1b')](_0x276abb);}return _0x29aa4a[_0xd336('0x1c')](_0x276abb)[_0xd336('0x1d')]();};}function respondWithResult(_0x4d4fca,_0x3a8a98){_0x3a8a98=_0x3a8a98||0xc8;return function(_0x4fc32e){if(_0x4fc32e){return _0x4d4fca[_0xd336('0x1c')](_0x3a8a98)[_0xd336('0x1e')](_0x4fc32e);}};}function respondWithFilteredResult(_0x1b3cd8,_0x1c8fd7){return function(_0x1e4716){if(_0x1e4716){var _0x96cab8=typeof _0x1c8fd7[_0xd336('0x1f')]===_0xd336('0x20')&&typeof _0x1c8fd7[_0xd336('0x21')]===_0xd336('0x20');var _0x2171a2=_0x1e4716[_0xd336('0x22')];var _0x3dfc7b=_0x96cab8?0x0:_0x1c8fd7[_0xd336('0x1f')];var _0x1eabe0=_0x96cab8?_0x1e4716[_0xd336('0x22')]:_0x1c8fd7[_0xd336('0x1f')]+_0x1c8fd7['limit'];var _0x3fd3d1;if(_0x1eabe0>=_0x2171a2){_0x1eabe0=_0x2171a2;_0x3fd3d1=0xc8;}else{_0x3fd3d1=0xce;}_0x1b3cd8[_0xd336('0x1c')](_0x3fd3d1);return _0x1b3cd8[_0xd336('0x23')]('Content-Range',_0x3dfc7b+'-'+_0x1eabe0+'/'+_0x2171a2)[_0xd336('0x1e')](_0x1e4716);}return null;};}function patchUpdates(_0x2a5349){return function(_0x4d7351){try{jsonpatch[_0xd336('0x24')](_0x4d7351,_0x2a5349,!![]);}catch(_0x190123){return BPromise['reject'](_0x190123);}return _0x4d7351[_0xd336('0x25')]();};}function saveUpdates(_0x4d76b2,_0x2dad56){return function(_0x3bf076){if(_0x3bf076){return _0x3bf076[_0xd336('0x26')](_0x4d76b2)[_0xd336('0x27')](function(_0x38736e){return _0x38736e;});}return null;};}function removeEntity(_0x4d7fa6,_0x4d6f4d){return function(_0xc1f71f){if(_0xc1f71f){return _0xc1f71f[_0xd336('0x28')]()[_0xd336('0x27')](function(){var _0xfa45e8=_0xc1f71f[_0xd336('0x29')]({'plain':!![]});var _0x2f16dd='IvrCampaigns';return db[_0xd336('0x2a')][_0xd336('0x28')]({'where':{'type':_0x2f16dd,'resourceId':_0xfa45e8['id']}})['then'](function(){return _0xc1f71f;});})['then'](function(){_0x4d7fa6[_0xd336('0x1c')](0xcc)[_0xd336('0x1d')]();});}};}function handleEntityNotFound(_0x4240bc,_0x2e0678){return function(_0xa99518){if(!_0xa99518){_0x4240bc[_0xd336('0x1b')](0x194);}return _0xa99518;};}function handleError(_0x2c11d6,_0x21f288){_0x21f288=_0x21f288||0x1f4;return function(_0x289051){logger[_0xd336('0x2b')](_0x289051['stack']);if(_0x289051['name']){delete _0x289051[_0xd336('0x2c')];}_0x2c11d6[_0xd336('0x1c')](_0x21f288)['send'](_0x289051);};}exports[_0xd336('0x2d')]=function(_0x337a90,_0x489dee){var _0x45aaa8={},_0x3c2439={},_0x389ed6={'count':0x0,'rows':[]};var _0x21c898=_[_0xd336('0x2e')](db[_0xd336('0x2f')][_0xd336('0x30')],function(_0x4cab5e){return{'name':_0x4cab5e[_0xd336('0x31')],'type':_0x4cab5e['type'][_0xd336('0x32')]};});_0x3c2439[_0xd336('0x33')]=_[_0xd336('0x2e')](_0x21c898,_0xd336('0x2c'));_0x3c2439[_0xd336('0x34')]=_[_0xd336('0x35')](_0x337a90[_0xd336('0x34')]);_0x3c2439[_0xd336('0x36')]=_[_0xd336('0x37')](_0x3c2439['model'],_0x3c2439[_0xd336('0x34')]);_0x45aaa8[_0xd336('0x38')]=_[_0xd336('0x37')](_0x3c2439[_0xd336('0x33')],qs[_0xd336('0x39')](_0x337a90[_0xd336('0x34')]['fields']));_0x45aaa8[_0xd336('0x38')]=_0x45aaa8[_0xd336('0x38')]['length']?_0x45aaa8[_0xd336('0x38')]:_0x3c2439['model'];if(!_0x337a90[_0xd336('0x34')][_0xd336('0x3a')](_0xd336('0x3b'))){_0x45aaa8[_0xd336('0x21')]=qs[_0xd336('0x21')](_0x337a90[_0xd336('0x34')][_0xd336('0x21')]);_0x45aaa8[_0xd336('0x1f')]=qs[_0xd336('0x1f')](_0x337a90[_0xd336('0x34')][_0xd336('0x1f')]);}_0x45aaa8[_0xd336('0x3c')]=qs['sort'](_0x337a90[_0xd336('0x34')][_0xd336('0x3d')]);_0x45aaa8[_0xd336('0x3e')]=qs[_0xd336('0x36')](_[_0xd336('0x3f')](_0x337a90['query'],_0x3c2439[_0xd336('0x36')]),_0x21c898);if(_0x337a90[_0xd336('0x34')][_0xd336('0x40')]){_0x45aaa8[_0xd336('0x3e')]=_[_0xd336('0x41')](_0x45aaa8['where'],{'$or':_[_0xd336('0x2e')](_0x21c898,function(_0x3c126c){if(_0x3c126c[_0xd336('0x42')]!=='VIRTUAL'){var _0x877fe1={};_0x877fe1[_0x3c126c['name']]={'$like':'%'+_0x337a90['query']['filter']+'%'};return _0x877fe1;}})});}_0x45aaa8=_[_0xd336('0x41')]({},_0x45aaa8,_0x337a90['options']);var _0x418b28={'where':_0x45aaa8[_0xd336('0x3e')]};return db['Campaign'][_0xd336('0x22')](_0x418b28)[_0xd336('0x27')](function(_0x456c35){_0x389ed6[_0xd336('0x22')]=_0x456c35;if(_0x337a90[_0xd336('0x34')][_0xd336('0x43')]){_0x45aaa8[_0xd336('0x44')]=[{'all':!![]}];}return db[_0xd336('0x2f')][_0xd336('0x45')](_0x45aaa8);})[_0xd336('0x27')](function(_0x24c734){_0x389ed6['rows']=_0x24c734;return _0x389ed6;})['then'](respondWithFilteredResult(_0x489dee,_0x45aaa8))[_0xd336('0x46')](handleError(_0x489dee,null));};exports[_0xd336('0x47')]=function(_0x24d222,_0x5ec77b){var _0x112e84={'raw':![],'where':{'id':_0x24d222[_0xd336('0x48')]['id']}},_0x33fef7={};_0x33fef7['model']=_[_0xd336('0x35')](db[_0xd336('0x2f')][_0xd336('0x30')]);_0x33fef7['query']=_['keys'](_0x24d222['query']);_0x33fef7[_0xd336('0x36')]=_[_0xd336('0x37')](_0x33fef7['model'],_0x33fef7[_0xd336('0x34')]);_0x112e84[_0xd336('0x38')]=_[_0xd336('0x37')](_0x33fef7['model'],qs['fields'](_0x24d222[_0xd336('0x34')][_0xd336('0x39')]));_0x112e84[_0xd336('0x38')]=_0x112e84[_0xd336('0x38')][_0xd336('0x49')]?_0x112e84[_0xd336('0x38')]:_0x33fef7[_0xd336('0x33')];if(_0x24d222['query'][_0xd336('0x43')]){_0x112e84[_0xd336('0x44')]=[{'all':!![]}];}_0x112e84=_['merge']({},_0x112e84,_0x24d222[_0xd336('0x4a')]);return db[_0xd336('0x2f')][_0xd336('0x4b')](_0x112e84)[_0xd336('0x27')](handleEntityNotFound(_0x5ec77b,null))[_0xd336('0x27')](respondWithResult(_0x5ec77b,null))['catch'](handleError(_0x5ec77b,null));};exports[_0xd336('0x4c')]=function(_0x163c36,_0x34530e){return db['Campaign'][_0xd336('0x4c')](_0x163c36[_0xd336('0x4d')],{})['then'](function(_0x3a4ef9){var _0x2388b7=_0x163c36[_0xd336('0x4e')][_0xd336('0x29')]({'plain':!![]});if(!_0x2388b7)throw new Error(_0xd336('0x4f'));if(_0x2388b7['role']===_0xd336('0x4e')){var _0x3df648=_0x3a4ef9['get']({'plain':!![]});var _0x4040ca='IvrCampaigns';return db['UserProfileSection'][_0xd336('0x4b')]({'where':{'name':_0x4040ca,'userProfileId':_0x2388b7[_0xd336('0x50')]},'raw':!![]})[_0xd336('0x27')](function(_0x12f414){if(_0x12f414&&_0x12f414[_0xd336('0x51')]===0x0){return db['UserProfileResource'][_0xd336('0x4c')]({'name':_0x3df648[_0xd336('0x2c')],'resourceId':_0x3df648['id'],'type':_0x12f414[_0xd336('0x2c')],'sectionId':_0x12f414['id']},{})[_0xd336('0x27')](function(){return _0x3a4ef9;});}else{return _0x3a4ef9;}})[_0xd336('0x46')](function(_0x4bf412){logger[_0xd336('0x2b')](_0xd336('0x52'),_0x4bf412);throw _0x4bf412;});}return _0x3a4ef9;})['then'](respondWithResult(_0x34530e,0xc9))[_0xd336('0x46')](handleError(_0x34530e,null));};exports[_0xd336('0x53')]=function(_0x34761b,_0x2e72c0){var _0x865cc7={'where':{'id':_0x34761b[_0xd336('0x48')]['id']}},_0x179533={};_0x179533['model']=_[_0xd336('0x35')](db['Campaign'][_0xd336('0x30')]);_0x865cc7['attributes']=_[_0xd336('0x37')](_0x179533[_0xd336('0x33')],qs[_0xd336('0x39')](_0x34761b[_0xd336('0x34')][_0xd336('0x39')]));_0x865cc7['attributes']=_0x865cc7[_0xd336('0x38')]['length']?_0x865cc7[_0xd336('0x38')]:_0x179533[_0xd336('0x33')];if(_0x34761b['query'][_0xd336('0x43')]){_0x865cc7[_0xd336('0x44')]=[{'all':!![]}];}_0x865cc7=_[_0xd336('0x41')]({},_0x865cc7,_0x34761b[_0xd336('0x4a')]);return db['Campaign'][_0xd336('0x4b')](_0x865cc7)[_0xd336('0x27')](handleEntityNotFound(_0x2e72c0,null))['then'](function(_0x310cbd){if(_0x310cbd){var _0x1b436=_0x310cbd[_0xd336('0x29')]({'plain':!![]});_0x1b436=qs['omit'](_0x1b436,['id',_0xd336('0x54'),_0xd336('0x55')]);_0x34761b[_0xd336('0x4d')]=_[_0xd336('0x56')](_0x34761b[_0xd336('0x4d')],['id','createdAt',_0xd336('0x55')]);return db['Campaign'][_0xd336('0x4c')](_['merge'](_0x1b436,_0x34761b[_0xd336('0x4d')]),{'include':_0x34761b[_0xd336('0x34')][_0xd336('0x43')]?[{'all':!![]}]:undefined})['then'](function(_0xde88fc){var _0x2e3bc5=_0x34761b[_0xd336('0x4e')][_0xd336('0x29')]({'plain':!![]});if(!_0x2e3bc5)throw new Error(_0xd336('0x4f'));if(_0x2e3bc5[_0xd336('0x57')]===_0xd336('0x4e')){var _0x3229c0=_0xde88fc['get']({'plain':!![]});var _0x1709cb=_0xd336('0x58');return db[_0xd336('0x59')][_0xd336('0x4b')]({'where':{'name':_0x1709cb,'userProfileId':_0x2e3bc5[_0xd336('0x50')]},'raw':!![]})[_0xd336('0x27')](function(_0x2693f3){if(_0x2693f3&&_0x2693f3['autoAssociation']===0x0){return db[_0xd336('0x2a')][_0xd336('0x4c')]({'name':_0x3229c0['name'],'resourceId':_0x3229c0['id'],'type':_0x2693f3[_0xd336('0x2c')],'sectionId':_0x2693f3['id']},{})[_0xd336('0x27')](function(){return _0xde88fc;});}else{return _0xde88fc;}})[_0xd336('0x46')](function(_0x50f288){logger[_0xd336('0x2b')](_0xd336('0x52'),_0x50f288);throw _0x50f288;});}return _0xde88fc;});}})[_0xd336('0x27')](respondWithResult(_0x2e72c0,0xc9))[_0xd336('0x46')](handleError(_0x2e72c0,null));};exports[_0xd336('0x26')]=function(_0x49d74e,_0x3e3911){if(_0x49d74e[_0xd336('0x4d')]['id']){delete _0x49d74e[_0xd336('0x4d')]['id'];}return db[_0xd336('0x2f')][_0xd336('0x4b')]({'where':{'id':_0x49d74e[_0xd336('0x48')]['id']}})[_0xd336('0x27')](handleEntityNotFound(_0x3e3911,null))[_0xd336('0x27')](saveUpdates(_0x49d74e[_0xd336('0x4d')],null))[_0xd336('0x27')](respondWithResult(_0x3e3911,null))['catch'](handleError(_0x3e3911,null));};exports[_0xd336('0x28')]=function(_0x54e68e,_0x29f840){return db[_0xd336('0x2f')][_0xd336('0x4b')]({'where':{'id':_0x54e68e['params']['id']}})[_0xd336('0x27')](handleEntityNotFound(_0x29f840,null))[_0xd336('0x27')](removeEntity(_0x29f840,null))[_0xd336('0x46')](handleError(_0x29f840,null));};exports[_0xd336('0x5a')]=function(_0x434a29,_0x1c5563,_0x1fe9e4){var _0x4222e2={'raw':!![],'where':{}};var _0x46713c={};var _0x5022ba={'count':0x0,'rows':[]};return db[_0xd336('0x2f')][_0xd336('0x5b')]({'where':{'id':_0x434a29[_0xd336('0x48')]['id']}})['then'](handleEntityNotFound(_0x1c5563,null))[_0xd336('0x27')](function(_0x35f41d){if(_0x35f41d){_0x46713c[_0xd336('0x33')]=_[_0xd336('0x35')](db[_0xd336('0x5c')][_0xd336('0x30')]);_0x46713c[_0xd336('0x34')]=_[_0xd336('0x35')](_0x434a29[_0xd336('0x34')]);_0x46713c[_0xd336('0x36')]=_[_0xd336('0x37')](_0x46713c[_0xd336('0x33')],_0x46713c[_0xd336('0x34')]);_0x4222e2['attributes']=_[_0xd336('0x37')](_0x46713c[_0xd336('0x33')],qs[_0xd336('0x39')](_0x434a29[_0xd336('0x34')][_0xd336('0x39')]));_0x4222e2[_0xd336('0x38')]=_0x4222e2[_0xd336('0x38')][_0xd336('0x49')]?_0x4222e2[_0xd336('0x38')]:_0x46713c[_0xd336('0x33')];if(!_0x434a29['query']['hasOwnProperty'](_0xd336('0x3b'))){_0x4222e2[_0xd336('0x21')]=qs[_0xd336('0x21')](_0x434a29[_0xd336('0x34')]['limit']);_0x4222e2[_0xd336('0x1f')]=qs['offset'](_0x434a29[_0xd336('0x34')][_0xd336('0x1f')]);}_0x4222e2[_0xd336('0x3c')]=qs['sort'](_0x434a29[_0xd336('0x34')][_0xd336('0x3d')]);_0x4222e2[_0xd336('0x3e')]=qs[_0xd336('0x36')](_[_0xd336('0x3f')](_0x434a29[_0xd336('0x34')],_0x46713c[_0xd336('0x36')]));_0x4222e2[_0xd336('0x3e')]['CampaignId']=_0x35f41d['id'];if(_0x434a29[_0xd336('0x34')]['filter']){_0x4222e2['where']=_[_0xd336('0x41')](_0x4222e2[_0xd336('0x3e')],{'$or':_['map'](_0x4222e2[_0xd336('0x38')],function(_0x2ff83c){var _0x1f999a={};_0x1f999a[_0x2ff83c]={'$like':'%'+_0x434a29[_0xd336('0x34')][_0xd336('0x40')]+'%'};return _0x1f999a;})});}_0x4222e2=_['merge']({},_0x4222e2,_0x434a29['options']);return db[_0xd336('0x5c')][_0xd336('0x22')]({'where':_0x4222e2[_0xd336('0x3e')]})[_0xd336('0x27')](function(_0x2cb6eb){_0x5022ba[_0xd336('0x22')]=_0x2cb6eb;if(_0x434a29['query'][_0xd336('0x43')]){_0x4222e2[_0xd336('0x44')]=[{'all':!![]}];}return db[_0xd336('0x5c')][_0xd336('0x45')](_0x4222e2);})['then'](function(_0xc9c6b3){_0x5022ba[_0xd336('0x5d')]=_0xc9c6b3;return _0x5022ba;});}})[_0xd336('0x27')](respondWithFilteredResult(_0x1c5563,_0x4222e2))[_0xd336('0x46')](handleError(_0x1c5563,null));};exports[_0xd336('0x5e')]=function(_0xca6ec4,_0x239358,_0x6fc3ad){var _0x30908a={'raw':!![],'where':{}};var _0x43c0f7={};var _0x3e0663={'count':0x0,'rows':[]};return db[_0xd336('0x2f')][_0xd336('0x5b')]({'where':{'id':_0xca6ec4[_0xd336('0x48')]['id']}})[_0xd336('0x27')](handleEntityNotFound(_0x239358,null))[_0xd336('0x27')](function(_0x149acc){if(_0x149acc){_0x43c0f7[_0xd336('0x33')]=_[_0xd336('0x35')](db[_0xd336('0x5f')][_0xd336('0x30')]);_0x43c0f7[_0xd336('0x34')]=_[_0xd336('0x35')](_0xca6ec4[_0xd336('0x34')]);_0x43c0f7[_0xd336('0x36')]=_[_0xd336('0x37')](_0x43c0f7[_0xd336('0x33')],_0x43c0f7[_0xd336('0x34')]);_0x30908a[_0xd336('0x38')]=_['intersection'](_0x43c0f7[_0xd336('0x33')],qs[_0xd336('0x39')](_0xca6ec4[_0xd336('0x34')][_0xd336('0x39')]));_0x30908a['attributes']=_0x30908a[_0xd336('0x38')]['length']?_0x30908a['attributes']:_0x43c0f7['model'];if(!_0xca6ec4[_0xd336('0x34')][_0xd336('0x3a')](_0xd336('0x3b'))){_0x30908a[_0xd336('0x21')]=qs[_0xd336('0x21')](_0xca6ec4[_0xd336('0x34')]['limit']);_0x30908a[_0xd336('0x1f')]=qs[_0xd336('0x1f')](_0xca6ec4[_0xd336('0x34')]['offset']);}_0x30908a[_0xd336('0x3c')]=qs[_0xd336('0x3d')](_0xca6ec4[_0xd336('0x34')][_0xd336('0x3d')]);_0x30908a[_0xd336('0x3e')]=qs[_0xd336('0x36')](_['pick'](_0xca6ec4[_0xd336('0x34')],_0x43c0f7['filters']));_0x30908a[_0xd336('0x3e')][_0xd336('0x60')]=_0x149acc['id'];if(_0xca6ec4[_0xd336('0x34')][_0xd336('0x40')]){_0x30908a[_0xd336('0x3e')]=_[_0xd336('0x41')](_0x30908a[_0xd336('0x3e')],{'$or':_[_0xd336('0x2e')](_0x30908a[_0xd336('0x38')],function(_0x24b2fd){var _0x3ce687={};_0x3ce687[_0x24b2fd]={'$like':'%'+_0xca6ec4[_0xd336('0x34')][_0xd336('0x40')]+'%'};return _0x3ce687;})});}_0x30908a=_[_0xd336('0x41')]({},_0x30908a,_0xca6ec4[_0xd336('0x4a')]);return db['CmHopperHistory'][_0xd336('0x22')]({'where':_0x30908a['where']})[_0xd336('0x27')](function(_0x2ae4dc){_0x3e0663[_0xd336('0x22')]=_0x2ae4dc;if(_0xca6ec4[_0xd336('0x34')][_0xd336('0x43')]){_0x30908a['include']=[{'all':!![]}];}return db[_0xd336('0x5f')][_0xd336('0x45')](_0x30908a);})[_0xd336('0x27')](function(_0x1c761c){_0x3e0663[_0xd336('0x5d')]=_0x1c761c;return _0x3e0663;});}})[_0xd336('0x27')](respondWithFilteredResult(_0x239358,_0x30908a))['catch'](handleError(_0x239358,null));};exports[_0xd336('0x61')]=function(_0x35d124,_0x12bb68,_0x5290d1){var _0x13e5f0={'raw':!![],'where':{}};var _0x1d5699={};var _0x28e29={'count':0x0,'rows':[]};return db[_0xd336('0x2f')][_0xd336('0x5b')]({'where':{'id':_0x35d124[_0xd336('0x48')]['id']}})[_0xd336('0x27')](handleEntityNotFound(_0x12bb68,null))[_0xd336('0x27')](function(_0x5e038e){if(_0x5e038e){_0x1d5699[_0xd336('0x33')]=_[_0xd336('0x35')](db[_0xd336('0x62')][_0xd336('0x30')]);_0x1d5699['query']=_['keys'](_0x35d124['query']);_0x1d5699[_0xd336('0x36')]=_[_0xd336('0x37')](_0x1d5699[_0xd336('0x33')],_0x1d5699[_0xd336('0x34')]);_0x13e5f0['attributes']=_[_0xd336('0x37')](_0x1d5699[_0xd336('0x33')],qs['fields'](_0x35d124[_0xd336('0x34')][_0xd336('0x39')]));_0x13e5f0[_0xd336('0x38')]=_0x13e5f0[_0xd336('0x38')]['length']?_0x13e5f0[_0xd336('0x38')]:_0x1d5699[_0xd336('0x33')];if(!_0x35d124[_0xd336('0x34')][_0xd336('0x3a')]('nolimit')){_0x13e5f0['limit']=qs[_0xd336('0x21')](_0x35d124[_0xd336('0x34')][_0xd336('0x21')]);_0x13e5f0['offset']=qs[_0xd336('0x1f')](_0x35d124[_0xd336('0x34')][_0xd336('0x1f')]);}_0x13e5f0[_0xd336('0x3c')]=qs[_0xd336('0x3d')](_0x35d124[_0xd336('0x34')][_0xd336('0x3d')]);_0x13e5f0[_0xd336('0x3e')]=qs[_0xd336('0x36')](_[_0xd336('0x3f')](_0x35d124[_0xd336('0x34')],_0x1d5699[_0xd336('0x36')]));_0x13e5f0[_0xd336('0x3e')][_0xd336('0x60')]=_0x5e038e['id'];if(_0x35d124[_0xd336('0x34')]['filter']){_0x13e5f0[_0xd336('0x3e')]=_[_0xd336('0x41')](_0x13e5f0[_0xd336('0x3e')],{'$or':_[_0xd336('0x2e')](_0x13e5f0['attributes'],function(_0x5129b1){var _0x287a5f={};_0x287a5f[_0x5129b1]={'$like':'%'+_0x35d124[_0xd336('0x34')][_0xd336('0x40')]+'%'};return _0x287a5f;})});}_0x13e5f0=_['merge']({},_0x13e5f0,_0x35d124[_0xd336('0x4a')]);return db[_0xd336('0x62')]['count']({'where':_0x13e5f0[_0xd336('0x3e')]})['then'](function(_0x46bb99){_0x28e29['count']=_0x46bb99;if(_0x35d124[_0xd336('0x34')][_0xd336('0x43')]){_0x13e5f0['include']=[{'all':!![]}];}return db[_0xd336('0x62')][_0xd336('0x45')](_0x13e5f0);})[_0xd336('0x27')](function(_0xed5080){_0x28e29[_0xd336('0x5d')]=_0xed5080;return _0x28e29;});}})[_0xd336('0x27')](respondWithFilteredResult(_0x12bb68,_0x13e5f0))[_0xd336('0x46')](handleError(_0x12bb68,null));};exports[_0xd336('0x63')]=function(_0x5f50ef,_0x218026,_0x5540f0){var _0x593429={'raw':!![],'where':{}};var _0x513cfe={};var _0x56125b={'count':0x0,'rows':[]};return db[_0xd336('0x2f')]['findOne']({'where':{'id':_0x5f50ef['params']['id']}})['then'](handleEntityNotFound(_0x218026,null))[_0xd336('0x27')](function(_0x2042d6){if(_0x2042d6){_0x513cfe['model']=_['keys'](db[_0xd336('0x64')][_0xd336('0x30')]);_0x513cfe[_0xd336('0x34')]=_[_0xd336('0x35')](_0x5f50ef[_0xd336('0x34')]);_0x513cfe['filters']=_[_0xd336('0x37')](_0x513cfe['model'],_0x513cfe[_0xd336('0x34')]);_0x593429[_0xd336('0x38')]=_[_0xd336('0x37')](_0x513cfe[_0xd336('0x33')],qs[_0xd336('0x39')](_0x5f50ef[_0xd336('0x34')][_0xd336('0x39')]));_0x593429['attributes']=_0x593429[_0xd336('0x38')]['length']?_0x593429[_0xd336('0x38')]:_0x513cfe[_0xd336('0x33')];if(!_0x5f50ef[_0xd336('0x34')][_0xd336('0x3a')](_0xd336('0x3b'))){_0x593429['limit']=qs[_0xd336('0x21')](_0x5f50ef[_0xd336('0x34')][_0xd336('0x21')]);_0x593429['offset']=qs[_0xd336('0x1f')](_0x5f50ef[_0xd336('0x34')][_0xd336('0x1f')]);}_0x593429['order']=qs[_0xd336('0x3d')](_0x5f50ef[_0xd336('0x34')][_0xd336('0x3d')]);_0x593429['where']=qs[_0xd336('0x36')](_[_0xd336('0x3f')](_0x5f50ef[_0xd336('0x34')],_0x513cfe['filters']));_0x593429[_0xd336('0x3e')][_0xd336('0x60')]=_0x2042d6['id'];if(_0x5f50ef[_0xd336('0x34')][_0xd336('0x40')]){_0x593429['where']=_['merge'](_0x593429['where'],{'$or':_[_0xd336('0x2e')](_0x593429[_0xd336('0x38')],function(_0x299aa9){var _0x357708={};_0x357708[_0x299aa9]={'$like':'%'+_0x5f50ef[_0xd336('0x34')]['filter']+'%'};return _0x357708;})});}_0x593429=_[_0xd336('0x41')]({},_0x593429,_0x5f50ef['options']);return db[_0xd336('0x64')][_0xd336('0x22')]({'where':_0x593429[_0xd336('0x3e')]})[_0xd336('0x27')](function(_0x508025){_0x56125b[_0xd336('0x22')]=_0x508025;if(_0x5f50ef[_0xd336('0x34')][_0xd336('0x43')]){_0x593429['include']=[{'all':!![]}];}return db[_0xd336('0x64')][_0xd336('0x45')](_0x593429);})[_0xd336('0x27')](function(_0x7f7454){_0x56125b[_0xd336('0x5d')]=_0x7f7454;return _0x56125b;});}})['then'](respondWithFilteredResult(_0x218026,_0x593429))[_0xd336('0x46')](handleError(_0x218026,null));};exports[_0xd336('0x65')]=function(_0x4a6e87,_0x55bba7,_0x20e939){var _0x3ead6e={};var _0x27ccf5={};var _0x31da91;var _0x50e3b1;return db[_0xd336('0x2f')]['findOne']({'where':{'id':_0x4a6e87[_0xd336('0x48')]['id']}})['then'](handleEntityNotFound(_0x55bba7,null))[_0xd336('0x27')](function(_0x21b247){if(_0x21b247){_0x31da91=_0x21b247;_0x27ccf5[_0xd336('0x33')]=_['keys'](db[_0xd336('0x66')][_0xd336('0x30')]);_0x27ccf5[_0xd336('0x34')]=_['keys'](_0x4a6e87[_0xd336('0x34')]);_0x27ccf5[_0xd336('0x36')]=_['intersection'](_0x27ccf5[_0xd336('0x33')],_0x27ccf5[_0xd336('0x34')]);_0x3ead6e[_0xd336('0x38')]=_[_0xd336('0x37')](_0x27ccf5[_0xd336('0x33')],qs['fields'](_0x4a6e87[_0xd336('0x34')][_0xd336('0x39')]));_0x3ead6e[_0xd336('0x38')]=_0x3ead6e[_0xd336('0x38')][_0xd336('0x49')]?_0x3ead6e[_0xd336('0x38')]:_0x27ccf5['model'];_0x3ead6e['order']=qs['sort'](_0x4a6e87[_0xd336('0x34')][_0xd336('0x3d')]);_0x3ead6e['where']=qs[_0xd336('0x36')](_['pick'](_0x4a6e87[_0xd336('0x34')],_0x27ccf5[_0xd336('0x36')]));if(_0x4a6e87['query']['filter']){_0x3ead6e[_0xd336('0x3e')]=_[_0xd336('0x41')](_0x3ead6e[_0xd336('0x3e')],{'$or':_[_0xd336('0x2e')](_0x3ead6e[_0xd336('0x38')],function(_0x177761){var _0x28ccee={};_0x28ccee[_0x177761]={'$like':'%'+_0x4a6e87['query'][_0xd336('0x40')]+'%'};return _0x28ccee;})});}_0x3ead6e=_[_0xd336('0x41')]({},_0x3ead6e,_0x4a6e87[_0xd336('0x4a')]);return _0x31da91['getLists'](_0x3ead6e);}})[_0xd336('0x27')](function(_0x41d4ab){if(_0x41d4ab){_0x50e3b1=_0x41d4ab[_0xd336('0x49')];if(!_0x4a6e87[_0xd336('0x34')][_0xd336('0x3a')](_0xd336('0x3b'))){_0x3ead6e[_0xd336('0x21')]=qs['limit'](_0x4a6e87['query'][_0xd336('0x21')]);_0x3ead6e['offset']=qs[_0xd336('0x1f')](_0x4a6e87['query'][_0xd336('0x1f')]);}return _0x31da91[_0xd336('0x65')](_0x3ead6e);}})[_0xd336('0x27')](function(_0x21dd89){if(_0x21dd89){return _0x21dd89?{'count':_0x50e3b1,'rows':_0x21dd89}:null;}})[_0xd336('0x27')](respondWithResult(_0x55bba7,null))['catch'](handleError(_0x55bba7,null));};exports[_0xd336('0x67')]=function(_0xdfda16,_0x4a500e,_0x99bd7f){var _0x4e202d,_0x51540b;var _0x57a266=[];var _0x5a2b37=moment()[_0xd336('0x68')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xd336('0x2f')]['find']({'where':{'id':_0xdfda16[_0xd336('0x48')]['id']}})['then'](handleEntityNotFound(_0x4a500e,null))[_0xd336('0x27')](function(_0xbf861c){if(_0xbf861c){_0x51540b=_0xbf861c;return _0xbf861c[_0xd336('0x67')](_0xdfda16[_0xd336('0x4d')][_0xd336('0x69')],_[_0xd336('0x56')](_0xdfda16['body'],[_0xd336('0x69'),'id'])||{});}return null;})[_0xd336('0x6a')](function(_0x28e0f0){var _0x2ad7ae;var _0x1ee500;_0x4e202d=_0x28e0f0||[];var _0x507b91=[];if(_0x28e0f0){for(var _0x4a89e8=0x0;_0x4a89e8<_0x28e0f0[_0xd336('0x49')];_0x4a89e8+=0x1){var _0x5afac5=_0x28e0f0[_0x4a89e8][_0xd336('0x29')]({'plain':!![]});_0x51540b[_0xd336('0x6b')]=_0xdfda16[_0xd336('0x4d')][_0xd336('0x6b')]?_0xdfda16['body'][_0xd336('0x6b')]:_0x51540b[_0xd336('0x6b')];switch(_0x51540b['dialCheckDuplicateType']){case _0xd336('0x6c'):_0x2ad7ae=squel[_0xd336('0x6d')]()['into'](_0xd336('0x6e'))[_0xd336('0x6f')]([_0xd336('0x70'),_0xd336('0x71'),_0xd336('0x72'),'ListId',_0xd336('0x60'),'createdAt',_0xd336('0x55')],squel[_0xd336('0x73')]()[_0xd336('0x74')](_0xd336('0x70'),_0xd336('0x70'))[_0xd336('0x74')](_0xd336('0x75'),_0xd336('0x71'))[_0xd336('0x74')]('id','ContactId')[_0xd336('0x74')](_0x5afac5[_0xd336('0x76')]['toString'](),'ListId')[_0xd336('0x74')](_0xdfda16['params']['id'][_0xd336('0x77')](),_0xd336('0x60'))['field']('\x27'+_0x5a2b37+'\x27','createdAt')[_0xd336('0x74')]('\x27'+_0x5a2b37+'\x27',_0xd336('0x55'))['from'](_0xd336('0x78'))[_0xd336('0x3e')](_0xd336('0x79'))['where'](_0xd336('0x7a'),_0x5afac5[_0xd336('0x76')][_0xd336('0x77')]())[_0xd336('0x3e')](_0xd336('0x7b'))[_0xd336('0x3e')](_0xd336('0x7c'),squel[_0xd336('0x73')]()[_0xd336('0x74')]('COALESCE(calleridnum,\x27\x27)')['from'](_0xd336('0x7d'))[_0xd336('0x3e')](_0xd336('0x7e'),_0xdfda16[_0xd336('0x48')]['id'][_0xd336('0x77')]()))[_0xd336('0x3e')](_0xd336('0x7c'),squel[_0xd336('0x73')]()[_0xd336('0x74')](_0xd336('0x7f'))['from'](_0xd336('0x6e'))[_0xd336('0x3e')](_0xd336('0x7e'),_0xdfda16[_0xd336('0x48')]['id'][_0xd336('0x77')]())))[_0xd336('0x77')]();break;case'onlyIfOpen':_0x2ad7ae=squel[_0xd336('0x6d')]()[_0xd336('0x80')](_0xd336('0x6e'))[_0xd336('0x6f')](['phone',_0xd336('0x71'),_0xd336('0x72'),_0xd336('0x81'),_0xd336('0x60'),'createdAt',_0xd336('0x55')],squel[_0xd336('0x73')]()[_0xd336('0x74')](_0xd336('0x70'),_0xd336('0x70'))[_0xd336('0x74')](_0xd336('0x75'),_0xd336('0x71'))[_0xd336('0x74')]('id',_0xd336('0x72'))[_0xd336('0x74')](_0x5afac5['CmListId'][_0xd336('0x77')](),_0xd336('0x81'))[_0xd336('0x74')](_0xdfda16[_0xd336('0x48')]['id'][_0xd336('0x77')](),_0xd336('0x60'))['field']('\x27'+_0x5a2b37+'\x27','createdAt')['field']('\x27'+_0x5a2b37+'\x27',_0xd336('0x55'))['from'](_0xd336('0x78'))[_0xd336('0x3e')]('deletedAt\x20IS\x20NULL')[_0xd336('0x3e')](_0xd336('0x7a'),_0x5afac5[_0xd336('0x76')][_0xd336('0x77')]())[_0xd336('0x3e')](_0xd336('0x7b'))[_0xd336('0x3e')](_0xd336('0x7c'),squel[_0xd336('0x73')]()[_0xd336('0x74')](_0xd336('0x7f'))['from'](_0xd336('0x6e'))[_0xd336('0x3e')]('CampaignId\x20=\x20?',_0xdfda16[_0xd336('0x48')]['id'][_0xd336('0x77')]())))['toString']();break;default:_0x2ad7ae=squel[_0xd336('0x6d')]()['into'](_0xd336('0x6e'))[_0xd336('0x6f')]([_0xd336('0x70'),_0xd336('0x71'),_0xd336('0x72'),'ListId','CampaignId',_0xd336('0x54'),_0xd336('0x55')],squel['select']()['field']('phone',_0xd336('0x70'))[_0xd336('0x74')]('NOW()','scheduledAt')['field']('id',_0xd336('0x72'))[_0xd336('0x74')](_0x5afac5[_0xd336('0x76')]['toString'](),_0xd336('0x81'))[_0xd336('0x74')](_0xdfda16[_0xd336('0x48')]['id'][_0xd336('0x77')](),_0xd336('0x60'))['field']('\x27'+_0x5a2b37+'\x27',_0xd336('0x54'))[_0xd336('0x74')]('\x27'+_0x5a2b37+'\x27',_0xd336('0x55'))[_0xd336('0x82')](_0xd336('0x78'))[_0xd336('0x3e')](_0xd336('0x79'))[_0xd336('0x3e')](_0xd336('0x7a'),_0x5afac5[_0xd336('0x76')][_0xd336('0x77')]())[_0xd336('0x3e')](_0xd336('0x7b')))[_0xd336('0x77')]();}_0x1ee500=squel[_0xd336('0x6d')]()[_0xd336('0x80')]('cm_hopper_additional_phones')[_0xd336('0x6f')](['cmHopperId',_0xd336('0x71'),_0xd336('0x70'),_0xd336('0x83'),_0xd336('0x54'),_0xd336('0x55')],squel[_0xd336('0x73')]()[_0xd336('0x74')](_0xd336('0x84'),'id')[_0xd336('0x74')](_0xd336('0x75'),_0xd336('0x71'))['field'](_0xd336('0x85'),_0xd336('0x70'))[_0xd336('0x74')]('ci.OrderBY','OrderBy')['field']('\x27'+_0x5a2b37+'\x27',_0xd336('0x54'))['field']('\x27'+_0x5a2b37+'\x27',_0xd336('0x55'))[_0xd336('0x82')](_0xd336('0x86'),'ci')['join'](_0xd336('0x6e'),'h',_0xd336('0x87'))[_0xd336('0x3e')](_0xd336('0x88'),_0x5afac5['CmListId'][_0xd336('0x77')]())[_0xd336('0x3e')](_0xd336('0x89'),_0xdfda16['params']['id'][_0xd336('0x77')]())['where'](_0xd336('0x8a'),_0x5a2b37))['toString']();_0x507b91['push'](db[_0xd336('0x8b')][_0xd336('0x34')](_0x2ad7ae));_0x57a266[_0xd336('0x8c')](db[_0xd336('0x8b')]['query'](_0x1ee500));}return BPromise[_0xd336('0x8d')](_0x507b91);}})[_0xd336('0x27')](function(){return BPromise['all'](_0x57a266);})[_0xd336('0x27')](function(){return _0x4e202d;})[_0xd336('0x27')](respondWithResult(_0x4a500e,null))['catch'](handleError(_0x4a500e,null));};exports[_0xd336('0x8e')]=function(_0x20eed7,_0x327d45,_0x63ab7d){return db[_0xd336('0x2f')][_0xd336('0x4b')]({'where':{'id':_0x20eed7['params']['id']}})['then'](handleEntityNotFound(_0x327d45,null))[_0xd336('0x27')](function(_0x1ff1c9){if(_0x1ff1c9){return _0x1ff1c9[_0xd336('0x8e')](_0x20eed7[_0xd336('0x34')]['ids']);}})[_0xd336('0x27')](function(_0x2c84a3){if(_0x2c84a3){return db[_0xd336('0x5c')][_0xd336('0x28')]({'where':{'ListId':_0x20eed7['query'][_0xd336('0x69')],'CampaignId':_0x20eed7[_0xd336('0x48')]['id']}})[_0xd336('0x27')](function(){return _0x2c84a3;});}})[_0xd336('0x27')](respondWithStatusCode(_0x327d45,null))[_0xd336('0x46')](handleError(_0x327d45,null));};exports[_0xd336('0x8f')]=function(_0x490b6e,_0x205e59,_0x43ee1c){var _0x1be820={};var _0x29b59d={};var _0x57c9d3;var _0x49c9ad;return db[_0xd336('0x2f')][_0xd336('0x5b')]({'where':{'id':_0x490b6e['params']['id']}})[_0xd336('0x27')](handleEntityNotFound(_0x205e59,null))['then'](function(_0x4e0b2c){if(_0x4e0b2c){_0x57c9d3=_0x4e0b2c;_0x29b59d[_0xd336('0x33')]=_[_0xd336('0x35')](db[_0xd336('0x66')][_0xd336('0x30')]);_0x29b59d[_0xd336('0x34')]=_['keys'](_0x490b6e[_0xd336('0x34')]);_0x29b59d[_0xd336('0x36')]=_[_0xd336('0x37')](_0x29b59d[_0xd336('0x33')],_0x29b59d['query']);_0x1be820[_0xd336('0x38')]=_[_0xd336('0x37')](_0x29b59d[_0xd336('0x33')],qs[_0xd336('0x39')](_0x490b6e[_0xd336('0x34')]['fields']));_0x1be820[_0xd336('0x38')]=_0x1be820[_0xd336('0x38')][_0xd336('0x49')]?_0x1be820[_0xd336('0x38')]:_0x29b59d[_0xd336('0x33')];_0x1be820['order']=qs[_0xd336('0x3d')](_0x490b6e[_0xd336('0x34')][_0xd336('0x3d')]);_0x1be820['where']=qs[_0xd336('0x36')](_[_0xd336('0x3f')](_0x490b6e['query'],_0x29b59d[_0xd336('0x36')]));if(_0x490b6e[_0xd336('0x34')][_0xd336('0x40')]){_0x1be820[_0xd336('0x3e')]=_['merge'](_0x1be820['where'],{'$or':_[_0xd336('0x2e')](_0x1be820['attributes'],function(_0x483d41){var _0xbec22d={};_0xbec22d[_0x483d41]={'$like':'%'+_0x490b6e[_0xd336('0x34')]['filter']+'%'};return _0xbec22d;})});}_0x1be820=_[_0xd336('0x41')]({},_0x1be820,_0x490b6e['options']);return _0x57c9d3['getBlackLists'](_0x1be820);}})[_0xd336('0x27')](function(_0x15d57c){if(_0x15d57c){_0x49c9ad=_0x15d57c[_0xd336('0x49')];if(!_0x490b6e[_0xd336('0x34')][_0xd336('0x3a')](_0xd336('0x3b'))){_0x1be820[_0xd336('0x21')]=qs[_0xd336('0x21')](_0x490b6e[_0xd336('0x34')][_0xd336('0x21')]);_0x1be820['offset']=qs['offset'](_0x490b6e['query']['offset']);}return _0x57c9d3[_0xd336('0x8f')](_0x1be820);}})[_0xd336('0x27')](function(_0x556f57){if(_0x556f57){return _0x556f57?{'count':_0x49c9ad,'rows':_0x556f57}:null;}})[_0xd336('0x27')](respondWithResult(_0x205e59,null))['catch'](handleError(_0x205e59,null));};exports[_0xd336('0x90')]=function(_0xf65e60,_0x16cfe6,_0x44e2fa){var _0x35b35d,_0x4c2437;var _0x32d6ab=[];var _0x21ed7b=moment()['format'](_0xd336('0x91'));return db[_0xd336('0x2f')][_0xd336('0x4b')]({'where':{'id':_0xf65e60['params']['id']}})[_0xd336('0x27')](handleEntityNotFound(_0x16cfe6,null))[_0xd336('0x27')](function(_0x5381b2){if(_0x5381b2){_0x4c2437=_0x5381b2;return _0x5381b2['addBlackLists'](_0xf65e60[_0xd336('0x4d')][_0xd336('0x69')],_[_0xd336('0x56')](_0xf65e60[_0xd336('0x4d')],['ids','id'])||{});}return null;})[_0xd336('0x6a')](function(_0x2e38bb){var _0xc17866;var _0x1def26;_0x35b35d=_0x2e38bb||[];var _0x10de6e=[];if(_0x2e38bb){for(var _0x599649=0x0;_0x599649<_0x2e38bb[_0xd336('0x49')];_0x599649+=0x1){var _0x5d2769=_0x2e38bb[_0x599649][_0xd336('0x29')]({'plain':!![]});_0xc17866=squel[_0xd336('0x6d')]()[_0xd336('0x80')](_0xd336('0x92'))[_0xd336('0x6f')]([_0xd336('0x70'),_0xd336('0x72'),_0xd336('0x81'),'CampaignId',_0xd336('0x54'),_0xd336('0x55')],squel['select']()['field'](_0xd336('0x70'),'phone')[_0xd336('0x74')]('id',_0xd336('0x72'))[_0xd336('0x74')](_0x5d2769[_0xd336('0x76')]['toString'](),_0xd336('0x81'))[_0xd336('0x74')](_0xf65e60[_0xd336('0x48')]['id']['toString'](),_0xd336('0x60'))[_0xd336('0x74')]('NOW()',_0xd336('0x54'))['field'](_0xd336('0x75'),_0xd336('0x55'))['from']('cm_contacts')['where'](_0xd336('0x79'))['where']('ListId\x20=\x20?',_0x5d2769['CmListId'][_0xd336('0x77')]())[_0xd336('0x3e')](_0xd336('0x7b')))[_0xd336('0x77')]();_0x10de6e[_0xd336('0x8c')](db['sequelize'][_0xd336('0x34')](_0xc17866));}return BPromise[_0xd336('0x8d')](_0x10de6e);}})[_0xd336('0x27')](function(){return _0x35b35d;})[_0xd336('0x27')](respondWithResult(_0x16cfe6,null))[_0xd336('0x46')](handleError(_0x16cfe6,null));};exports[_0xd336('0x93')]=function(_0x175d57,_0x2664b8,_0x38ea0b){return db[_0xd336('0x2f')][_0xd336('0x4b')]({'where':{'id':_0x175d57['params']['id']}})[_0xd336('0x27')](handleEntityNotFound(_0x2664b8,null))['then'](function(_0x1c8b86){if(_0x1c8b86){return _0x1c8b86[_0xd336('0x93')](_0x175d57['query'][_0xd336('0x69')]);}})[_0xd336('0x27')](function(_0x8b9ae6){if(_0x8b9ae6){return db[_0xd336('0x64')]['destroy']({'where':{'ListId':_0x175d57[_0xd336('0x34')][_0xd336('0x69')],'CampaignId':_0x175d57[_0xd336('0x48')]['id']}})[_0xd336('0x27')](function(){return _0x8b9ae6;});}})[_0xd336('0x27')](respondWithStatusCode(_0x2664b8,null))[_0xd336('0x46')](handleError(_0x2664b8,null));};
\ No newline at end of file
+var _0xdb51=['deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','cm_hopper','COALESCE(phone,\x27\x27)','cm_contacts','ListId\x20=\x20?','cmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','Content-Range','apply','reject','destroy','get','UserProfileResource','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','Campaign','count','findAll','rows','catch','show','params','length','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','omit','update','findOne','order','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','format','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','phone','ContactId','ListId','select','field','NOW()','scheduledAt','CmListId','toString','from'];(function(_0x826e62,_0x119ae8){var _0x490887=function(_0x581842){while(--_0x581842){_0x826e62['push'](_0x826e62['shift']());}};_0x490887(++_0x119ae8);}(_0xdb51,0x145));var _0x1db5=function(_0x59f96a,_0xce2fad){_0x59f96a=_0x59f96a-0x0;var _0x32b231=_0xdb51[_0x59f96a];return _0x32b231;};'use strict';var emlformat=require(_0x1db5('0x0'));var rimraf=require(_0x1db5('0x1'));var zipdir=require(_0x1db5('0x2'));var jsonpatch=require(_0x1db5('0x3'));var rp=require(_0x1db5('0x4'));var moment=require(_0x1db5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1db5('0x6'));var util=require(_0x1db5('0x7'));var path=require(_0x1db5('0x8'));var sox=require(_0x1db5('0x9'));var csv=require(_0x1db5('0xa'));var ejs=require(_0x1db5('0xb'));var fs=require('fs');var fs_extra=require(_0x1db5('0xc'));var _=require(_0x1db5('0xd'));var squel=require(_0x1db5('0xe'));var crypto=require(_0x1db5('0xf'));var jsforce=require(_0x1db5('0x10'));var deskjs=require(_0x1db5('0x11'));var toCsv=require(_0x1db5('0xa'));var querystring=require(_0x1db5('0x12'));var Papa=require('papaparse');var Redis=require(_0x1db5('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x1db5('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1db5('0x15'));var logger=require(_0x1db5('0x16'))(_0x1db5('0x17'));var utils=require(_0x1db5('0x18'));var config=require(_0x1db5('0x19'));var licenseUtil=require(_0x1db5('0x1a'));var db=require(_0x1db5('0x1b'))['db'];function respondWithStatusCode(_0x3a81d6,_0x114a49){_0x114a49=_0x114a49||0xcc;return function(_0x2d2f8c){if(_0x2d2f8c){return _0x3a81d6[_0x1db5('0x1c')](_0x114a49);}return _0x3a81d6[_0x1db5('0x1d')](_0x114a49)[_0x1db5('0x1e')]();};}function respondWithResult(_0x36e3ef,_0x1b4f83){_0x1b4f83=_0x1b4f83||0xc8;return function(_0x49fbbf){if(_0x49fbbf){return _0x36e3ef[_0x1db5('0x1d')](_0x1b4f83)['json'](_0x49fbbf);}};}function respondWithFilteredResult(_0x1a7a17,_0x142880){return function(_0x2a0752){if(_0x2a0752){var _0x279c4f=typeof _0x142880[_0x1db5('0x1f')]===_0x1db5('0x20')&&typeof _0x142880['limit']===_0x1db5('0x20');var _0x23f356=_0x2a0752['count'];var _0x23cff4=_0x279c4f?0x0:_0x142880[_0x1db5('0x1f')];var _0x4045f0=_0x279c4f?_0x2a0752['count']:_0x142880['offset']+_0x142880['limit'];var _0x5c887b;if(_0x4045f0>=_0x23f356){_0x4045f0=_0x23f356;_0x5c887b=0xc8;}else{_0x5c887b=0xce;}_0x1a7a17['status'](_0x5c887b);return _0x1a7a17['set'](_0x1db5('0x21'),_0x23cff4+'-'+_0x4045f0+'/'+_0x23f356)['json'](_0x2a0752);}return null;};}function patchUpdates(_0x29356c){return function(_0x199473){try{jsonpatch[_0x1db5('0x22')](_0x199473,_0x29356c,!![]);}catch(_0x166e96){return BPromise[_0x1db5('0x23')](_0x166e96);}return _0x199473['save']();};}function saveUpdates(_0x2bacfb,_0x37beac){return function(_0x7cb1e4){if(_0x7cb1e4){return _0x7cb1e4['update'](_0x2bacfb)['then'](function(_0x3fae8f){return _0x3fae8f;});}return null;};}function removeEntity(_0x508e93,_0x551990){return function(_0x1339d5){if(_0x1339d5){return _0x1339d5[_0x1db5('0x24')]()['then'](function(){var _0x15c61d=_0x1339d5[_0x1db5('0x25')]({'plain':!![]});var _0x5bed5a='IvrCampaigns';return db[_0x1db5('0x26')][_0x1db5('0x24')]({'where':{'type':_0x5bed5a,'resourceId':_0x15c61d['id']}})[_0x1db5('0x27')](function(){return _0x1339d5;});})[_0x1db5('0x27')](function(){_0x508e93[_0x1db5('0x1d')](0xcc)[_0x1db5('0x1e')]();});}};}function handleEntityNotFound(_0x5ca360,_0x5c7e01){return function(_0x1ddc31){if(!_0x1ddc31){_0x5ca360['sendStatus'](0x194);}return _0x1ddc31;};}function handleError(_0x252f4f,_0xd01ba9){_0xd01ba9=_0xd01ba9||0x1f4;return function(_0x4b5ec4){logger['error'](_0x4b5ec4[_0x1db5('0x28')]);if(_0x4b5ec4['name']){delete _0x4b5ec4[_0x1db5('0x29')];}_0x252f4f[_0x1db5('0x1d')](_0xd01ba9)[_0x1db5('0x2a')](_0x4b5ec4);};}exports[_0x1db5('0x2b')]=function(_0x7b44f7,_0x35e7f9){var _0x41acf5={},_0x233619={},_0x30616c={'count':0x0,'rows':[]};var _0xbd1097=_[_0x1db5('0x2c')](db['Campaign'][_0x1db5('0x2d')],function(_0x4a834e){return{'name':_0x4a834e[_0x1db5('0x2e')],'type':_0x4a834e[_0x1db5('0x2f')][_0x1db5('0x30')]};});_0x233619[_0x1db5('0x31')]=_[_0x1db5('0x2c')](_0xbd1097,_0x1db5('0x29'));_0x233619[_0x1db5('0x32')]=_[_0x1db5('0x33')](_0x7b44f7[_0x1db5('0x32')]);_0x233619[_0x1db5('0x34')]=_['intersection'](_0x233619['model'],_0x233619['query']);_0x41acf5['attributes']=_[_0x1db5('0x35')](_0x233619['model'],qs[_0x1db5('0x36')](_0x7b44f7['query']['fields']));_0x41acf5[_0x1db5('0x37')]=_0x41acf5[_0x1db5('0x37')]['length']?_0x41acf5['attributes']:_0x233619['model'];if(!_0x7b44f7[_0x1db5('0x32')][_0x1db5('0x38')](_0x1db5('0x39'))){_0x41acf5[_0x1db5('0x3a')]=qs[_0x1db5('0x3a')](_0x7b44f7[_0x1db5('0x32')]['limit']);_0x41acf5[_0x1db5('0x1f')]=qs[_0x1db5('0x1f')](_0x7b44f7[_0x1db5('0x32')][_0x1db5('0x1f')]);}_0x41acf5['order']=qs['sort'](_0x7b44f7[_0x1db5('0x32')][_0x1db5('0x3b')]);_0x41acf5[_0x1db5('0x3c')]=qs[_0x1db5('0x34')](_[_0x1db5('0x3d')](_0x7b44f7[_0x1db5('0x32')],_0x233619['filters']),_0xbd1097);if(_0x7b44f7[_0x1db5('0x32')][_0x1db5('0x3e')]){_0x41acf5[_0x1db5('0x3c')]=_[_0x1db5('0x3f')](_0x41acf5['where'],{'$or':_['map'](_0xbd1097,function(_0x15e0dc){if(_0x15e0dc[_0x1db5('0x2f')]!==_0x1db5('0x40')){var _0xb81e91={};_0xb81e91[_0x15e0dc[_0x1db5('0x29')]]={'$like':'%'+_0x7b44f7['query'][_0x1db5('0x3e')]+'%'};return _0xb81e91;}})});}_0x41acf5=_[_0x1db5('0x3f')]({},_0x41acf5,_0x7b44f7[_0x1db5('0x41')]);var _0x2b7148={'where':_0x41acf5[_0x1db5('0x3c')]};return db[_0x1db5('0x42')][_0x1db5('0x43')](_0x2b7148)[_0x1db5('0x27')](function(_0x8a7465){_0x30616c[_0x1db5('0x43')]=_0x8a7465;if(_0x7b44f7[_0x1db5('0x32')]['includeAll']){_0x41acf5['include']=[{'all':!![]}];}return db['Campaign'][_0x1db5('0x44')](_0x41acf5);})['then'](function(_0x43b7e0){_0x30616c[_0x1db5('0x45')]=_0x43b7e0;return _0x30616c;})[_0x1db5('0x27')](respondWithFilteredResult(_0x35e7f9,_0x41acf5))[_0x1db5('0x46')](handleError(_0x35e7f9,null));};exports[_0x1db5('0x47')]=function(_0x59f754,_0xcd94aa){var _0x3536d5={'raw':![],'where':{'id':_0x59f754[_0x1db5('0x48')]['id']}},_0x72f9a8={};_0x72f9a8[_0x1db5('0x31')]=_[_0x1db5('0x33')](db[_0x1db5('0x42')][_0x1db5('0x2d')]);_0x72f9a8[_0x1db5('0x32')]=_[_0x1db5('0x33')](_0x59f754[_0x1db5('0x32')]);_0x72f9a8[_0x1db5('0x34')]=_[_0x1db5('0x35')](_0x72f9a8['model'],_0x72f9a8[_0x1db5('0x32')]);_0x3536d5[_0x1db5('0x37')]=_['intersection'](_0x72f9a8[_0x1db5('0x31')],qs['fields'](_0x59f754[_0x1db5('0x32')][_0x1db5('0x36')]));_0x3536d5[_0x1db5('0x37')]=_0x3536d5['attributes'][_0x1db5('0x49')]?_0x3536d5['attributes']:_0x72f9a8[_0x1db5('0x31')];if(_0x59f754[_0x1db5('0x32')][_0x1db5('0x4a')]){_0x3536d5[_0x1db5('0x4b')]=[{'all':!![]}];}_0x3536d5=_[_0x1db5('0x3f')]({},_0x3536d5,_0x59f754[_0x1db5('0x41')]);return db['Campaign'][_0x1db5('0x4c')](_0x3536d5)[_0x1db5('0x27')](handleEntityNotFound(_0xcd94aa,null))['then'](respondWithResult(_0xcd94aa,null))[_0x1db5('0x46')](handleError(_0xcd94aa,null));};exports[_0x1db5('0x4d')]=function(_0x5d9486,_0x594602){return db[_0x1db5('0x42')]['create'](_0x5d9486[_0x1db5('0x4e')],{})[_0x1db5('0x27')](function(_0x9b5765){var _0x2cb008=_0x5d9486['user']['get']({'plain':!![]});if(!_0x2cb008)throw new Error(_0x1db5('0x4f'));if(_0x2cb008[_0x1db5('0x50')]===_0x1db5('0x51')){var _0xc710cf=_0x9b5765[_0x1db5('0x25')]({'plain':!![]});var _0x2008d7=_0x1db5('0x52');return db[_0x1db5('0x53')]['find']({'where':{'name':_0x2008d7,'userProfileId':_0x2cb008[_0x1db5('0x54')]},'raw':!![]})[_0x1db5('0x27')](function(_0x262941){if(_0x262941&&_0x262941[_0x1db5('0x55')]===0x0){return db[_0x1db5('0x26')][_0x1db5('0x4d')]({'name':_0xc710cf[_0x1db5('0x29')],'resourceId':_0xc710cf['id'],'type':_0x262941['name'],'sectionId':_0x262941['id']},{})[_0x1db5('0x27')](function(){return _0x9b5765;});}else{return _0x9b5765;}})['catch'](function(_0x5658d3){logger[_0x1db5('0x56')](_0x1db5('0x57'),_0x5658d3);throw _0x5658d3;});}return _0x9b5765;})[_0x1db5('0x27')](respondWithResult(_0x594602,0xc9))[_0x1db5('0x46')](handleError(_0x594602,null));};exports['clone']=function(_0x54eb54,_0x11616a){var _0x2b7fc3={'where':{'id':_0x54eb54[_0x1db5('0x48')]['id']}},_0x2ece4b={};_0x2ece4b[_0x1db5('0x31')]=_[_0x1db5('0x33')](db['Campaign']['rawAttributes']);_0x2b7fc3[_0x1db5('0x37')]=_['intersection'](_0x2ece4b[_0x1db5('0x31')],qs[_0x1db5('0x36')](_0x54eb54[_0x1db5('0x32')][_0x1db5('0x36')]));_0x2b7fc3[_0x1db5('0x37')]=_0x2b7fc3[_0x1db5('0x37')][_0x1db5('0x49')]?_0x2b7fc3['attributes']:_0x2ece4b[_0x1db5('0x31')];if(_0x54eb54['query'][_0x1db5('0x4a')]){_0x2b7fc3[_0x1db5('0x4b')]=[{'all':!![]}];}_0x2b7fc3=_['merge']({},_0x2b7fc3,_0x54eb54[_0x1db5('0x41')]);return db[_0x1db5('0x42')]['find'](_0x2b7fc3)[_0x1db5('0x27')](handleEntityNotFound(_0x11616a,null))[_0x1db5('0x27')](function(_0x10242b){if(_0x10242b){var _0x553a84=_0x10242b[_0x1db5('0x25')]({'plain':!![]});_0x553a84=qs['omit'](_0x553a84,['id',_0x1db5('0x58'),_0x1db5('0x59')]);_0x54eb54[_0x1db5('0x4e')]=_[_0x1db5('0x5a')](_0x54eb54[_0x1db5('0x4e')],['id',_0x1db5('0x58'),_0x1db5('0x59')]);return db[_0x1db5('0x42')][_0x1db5('0x4d')](_[_0x1db5('0x3f')](_0x553a84,_0x54eb54[_0x1db5('0x4e')]),{'include':_0x54eb54['query'][_0x1db5('0x4a')]?[{'all':!![]}]:undefined})[_0x1db5('0x27')](function(_0x2af311){var _0x1396ba=_0x54eb54[_0x1db5('0x51')][_0x1db5('0x25')]({'plain':!![]});if(!_0x1396ba)throw new Error(_0x1db5('0x4f'));if(_0x1396ba[_0x1db5('0x50')]==='user'){var _0x121b37=_0x2af311[_0x1db5('0x25')]({'plain':!![]});var _0x52732b='IvrCampaigns';return db[_0x1db5('0x53')][_0x1db5('0x4c')]({'where':{'name':_0x52732b,'userProfileId':_0x1396ba[_0x1db5('0x54')]},'raw':!![]})[_0x1db5('0x27')](function(_0x2e1c63){if(_0x2e1c63&&_0x2e1c63['autoAssociation']===0x0){return db['UserProfileResource'][_0x1db5('0x4d')]({'name':_0x121b37[_0x1db5('0x29')],'resourceId':_0x121b37['id'],'type':_0x2e1c63['name'],'sectionId':_0x2e1c63['id']},{})[_0x1db5('0x27')](function(){return _0x2af311;});}else{return _0x2af311;}})[_0x1db5('0x46')](function(_0x16eafb){logger[_0x1db5('0x56')](_0x1db5('0x57'),_0x16eafb);throw _0x16eafb;});}return _0x2af311;});}})[_0x1db5('0x27')](respondWithResult(_0x11616a,0xc9))[_0x1db5('0x46')](handleError(_0x11616a,null));};exports[_0x1db5('0x5b')]=function(_0x57b3d6,_0xc8d7e){if(_0x57b3d6['body']['id']){delete _0x57b3d6[_0x1db5('0x4e')]['id'];}return db['Campaign'][_0x1db5('0x4c')]({'where':{'id':_0x57b3d6[_0x1db5('0x48')]['id']}})[_0x1db5('0x27')](handleEntityNotFound(_0xc8d7e,null))[_0x1db5('0x27')](saveUpdates(_0x57b3d6[_0x1db5('0x4e')],null))['then'](respondWithResult(_0xc8d7e,null))[_0x1db5('0x46')](handleError(_0xc8d7e,null));};exports[_0x1db5('0x24')]=function(_0x1d5e14,_0xd57508){return db[_0x1db5('0x42')][_0x1db5('0x4c')]({'where':{'id':_0x1d5e14[_0x1db5('0x48')]['id']}})[_0x1db5('0x27')](handleEntityNotFound(_0xd57508,null))[_0x1db5('0x27')](removeEntity(_0xd57508,null))[_0x1db5('0x46')](handleError(_0xd57508,null));};exports['getHoppers']=function(_0x463208,_0x2c392f,_0x2995f8){var _0x392111={'raw':!![],'where':{}};var _0x5111e4={};var _0x4751a1={'count':0x0,'rows':[]};return db[_0x1db5('0x42')][_0x1db5('0x5c')]({'where':{'id':_0x463208[_0x1db5('0x48')]['id']}})[_0x1db5('0x27')](handleEntityNotFound(_0x2c392f,null))[_0x1db5('0x27')](function(_0x36489a){if(_0x36489a){_0x5111e4['model']=_['keys'](db['CmHopper'][_0x1db5('0x2d')]);_0x5111e4['query']=_[_0x1db5('0x33')](_0x463208[_0x1db5('0x32')]);_0x5111e4[_0x1db5('0x34')]=_[_0x1db5('0x35')](_0x5111e4['model'],_0x5111e4[_0x1db5('0x32')]);_0x392111[_0x1db5('0x37')]=_['intersection'](_0x5111e4[_0x1db5('0x31')],qs[_0x1db5('0x36')](_0x463208[_0x1db5('0x32')][_0x1db5('0x36')]));_0x392111[_0x1db5('0x37')]=_0x392111[_0x1db5('0x37')][_0x1db5('0x49')]?_0x392111[_0x1db5('0x37')]:_0x5111e4[_0x1db5('0x31')];if(!_0x463208[_0x1db5('0x32')]['hasOwnProperty'](_0x1db5('0x39'))){_0x392111['limit']=qs[_0x1db5('0x3a')](_0x463208[_0x1db5('0x32')][_0x1db5('0x3a')]);_0x392111[_0x1db5('0x1f')]=qs[_0x1db5('0x1f')](_0x463208[_0x1db5('0x32')][_0x1db5('0x1f')]);}_0x392111[_0x1db5('0x5d')]=qs[_0x1db5('0x3b')](_0x463208[_0x1db5('0x32')][_0x1db5('0x3b')]);_0x392111[_0x1db5('0x3c')]=qs[_0x1db5('0x34')](_['pick'](_0x463208[_0x1db5('0x32')],_0x5111e4['filters']));_0x392111[_0x1db5('0x3c')][_0x1db5('0x5e')]=_0x36489a['id'];if(_0x463208['query'][_0x1db5('0x3e')]){_0x392111['where']=_[_0x1db5('0x3f')](_0x392111[_0x1db5('0x3c')],{'$or':_[_0x1db5('0x2c')](_0x392111['attributes'],function(_0x11ceea){var _0x1b1fb7={};_0x1b1fb7[_0x11ceea]={'$like':'%'+_0x463208[_0x1db5('0x32')][_0x1db5('0x3e')]+'%'};return _0x1b1fb7;})});}_0x392111=_[_0x1db5('0x3f')]({},_0x392111,_0x463208[_0x1db5('0x41')]);return db['CmHopper'][_0x1db5('0x43')]({'where':_0x392111[_0x1db5('0x3c')]})[_0x1db5('0x27')](function(_0x4c84cf){_0x4751a1[_0x1db5('0x43')]=_0x4c84cf;if(_0x463208[_0x1db5('0x32')][_0x1db5('0x4a')]){_0x392111[_0x1db5('0x4b')]=[{'all':!![]}];}return db[_0x1db5('0x5f')][_0x1db5('0x44')](_0x392111);})[_0x1db5('0x27')](function(_0x4836a3){_0x4751a1[_0x1db5('0x45')]=_0x4836a3;return _0x4751a1;});}})[_0x1db5('0x27')](respondWithFilteredResult(_0x2c392f,_0x392111))['catch'](handleError(_0x2c392f,null));};exports[_0x1db5('0x60')]=function(_0x19b637,_0x4bd51a,_0x1cf41d){var _0x436155={'raw':!![],'where':{}};var _0x1c3a57={};var _0x487354={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x19b637[_0x1db5('0x48')]['id']}})[_0x1db5('0x27')](handleEntityNotFound(_0x4bd51a,null))[_0x1db5('0x27')](function(_0x30e524){if(_0x30e524){_0x1c3a57[_0x1db5('0x31')]=_[_0x1db5('0x33')](db['CmHopperHistory'][_0x1db5('0x2d')]);_0x1c3a57[_0x1db5('0x32')]=_['keys'](_0x19b637[_0x1db5('0x32')]);_0x1c3a57[_0x1db5('0x34')]=_[_0x1db5('0x35')](_0x1c3a57[_0x1db5('0x31')],_0x1c3a57[_0x1db5('0x32')]);_0x436155[_0x1db5('0x37')]=_['intersection'](_0x1c3a57[_0x1db5('0x31')],qs[_0x1db5('0x36')](_0x19b637[_0x1db5('0x32')][_0x1db5('0x36')]));_0x436155[_0x1db5('0x37')]=_0x436155['attributes'][_0x1db5('0x49')]?_0x436155['attributes']:_0x1c3a57[_0x1db5('0x31')];if(!_0x19b637[_0x1db5('0x32')][_0x1db5('0x38')]('nolimit')){_0x436155[_0x1db5('0x3a')]=qs['limit'](_0x19b637[_0x1db5('0x32')][_0x1db5('0x3a')]);_0x436155[_0x1db5('0x1f')]=qs['offset'](_0x19b637[_0x1db5('0x32')][_0x1db5('0x1f')]);}_0x436155[_0x1db5('0x5d')]=qs['sort'](_0x19b637[_0x1db5('0x32')][_0x1db5('0x3b')]);_0x436155[_0x1db5('0x3c')]=qs[_0x1db5('0x34')](_[_0x1db5('0x3d')](_0x19b637[_0x1db5('0x32')],_0x1c3a57['filters']));_0x436155['where'][_0x1db5('0x5e')]=_0x30e524['id'];if(_0x19b637['query'][_0x1db5('0x3e')]){_0x436155[_0x1db5('0x3c')]=_['merge'](_0x436155['where'],{'$or':_[_0x1db5('0x2c')](_0x436155[_0x1db5('0x37')],function(_0x32973a){var _0x49b2b5={};_0x49b2b5[_0x32973a]={'$like':'%'+_0x19b637[_0x1db5('0x32')][_0x1db5('0x3e')]+'%'};return _0x49b2b5;})});}_0x436155=_[_0x1db5('0x3f')]({},_0x436155,_0x19b637[_0x1db5('0x41')]);return db[_0x1db5('0x61')]['count']({'where':_0x436155[_0x1db5('0x3c')]})[_0x1db5('0x27')](function(_0x33bbff){_0x487354[_0x1db5('0x43')]=_0x33bbff;if(_0x19b637[_0x1db5('0x32')][_0x1db5('0x4a')]){_0x436155['include']=[{'all':!![]}];}return db[_0x1db5('0x61')][_0x1db5('0x44')](_0x436155);})[_0x1db5('0x27')](function(_0x41435f){_0x487354['rows']=_0x41435f;return _0x487354;});}})[_0x1db5('0x27')](respondWithFilteredResult(_0x4bd51a,_0x436155))[_0x1db5('0x46')](handleError(_0x4bd51a,null));};exports['getHopperFinals']=function(_0x291fdb,_0x58afcc,_0x1566d5){var _0x551a0d={'raw':!![],'where':{}};var _0x34a918={};var _0x24fc15={'count':0x0,'rows':[]};return db[_0x1db5('0x42')][_0x1db5('0x5c')]({'where':{'id':_0x291fdb[_0x1db5('0x48')]['id']}})[_0x1db5('0x27')](handleEntityNotFound(_0x58afcc,null))['then'](function(_0x195608){if(_0x195608){_0x34a918[_0x1db5('0x31')]=_[_0x1db5('0x33')](db[_0x1db5('0x62')][_0x1db5('0x2d')]);_0x34a918[_0x1db5('0x32')]=_[_0x1db5('0x33')](_0x291fdb[_0x1db5('0x32')]);_0x34a918[_0x1db5('0x34')]=_['intersection'](_0x34a918['model'],_0x34a918['query']);_0x551a0d[_0x1db5('0x37')]=_['intersection'](_0x34a918[_0x1db5('0x31')],qs[_0x1db5('0x36')](_0x291fdb[_0x1db5('0x32')]['fields']));_0x551a0d[_0x1db5('0x37')]=_0x551a0d[_0x1db5('0x37')][_0x1db5('0x49')]?_0x551a0d[_0x1db5('0x37')]:_0x34a918[_0x1db5('0x31')];if(!_0x291fdb[_0x1db5('0x32')]['hasOwnProperty'](_0x1db5('0x39'))){_0x551a0d['limit']=qs['limit'](_0x291fdb[_0x1db5('0x32')][_0x1db5('0x3a')]);_0x551a0d[_0x1db5('0x1f')]=qs[_0x1db5('0x1f')](_0x291fdb[_0x1db5('0x32')]['offset']);}_0x551a0d[_0x1db5('0x5d')]=qs['sort'](_0x291fdb[_0x1db5('0x32')][_0x1db5('0x3b')]);_0x551a0d[_0x1db5('0x3c')]=qs['filters'](_['pick'](_0x291fdb[_0x1db5('0x32')],_0x34a918[_0x1db5('0x34')]));_0x551a0d[_0x1db5('0x3c')][_0x1db5('0x5e')]=_0x195608['id'];if(_0x291fdb[_0x1db5('0x32')][_0x1db5('0x3e')]){_0x551a0d[_0x1db5('0x3c')]=_[_0x1db5('0x3f')](_0x551a0d['where'],{'$or':_[_0x1db5('0x2c')](_0x551a0d[_0x1db5('0x37')],function(_0x4b745b){var _0x458095={};_0x458095[_0x4b745b]={'$like':'%'+_0x291fdb[_0x1db5('0x32')][_0x1db5('0x3e')]+'%'};return _0x458095;})});}_0x551a0d=_[_0x1db5('0x3f')]({},_0x551a0d,_0x291fdb[_0x1db5('0x41')]);return db[_0x1db5('0x62')]['count']({'where':_0x551a0d[_0x1db5('0x3c')]})[_0x1db5('0x27')](function(_0x4d9fee){_0x24fc15[_0x1db5('0x43')]=_0x4d9fee;if(_0x291fdb[_0x1db5('0x32')][_0x1db5('0x4a')]){_0x551a0d[_0x1db5('0x4b')]=[{'all':!![]}];}return db[_0x1db5('0x62')][_0x1db5('0x44')](_0x551a0d);})[_0x1db5('0x27')](function(_0x2200a8){_0x24fc15['rows']=_0x2200a8;return _0x24fc15;});}})['then'](respondWithFilteredResult(_0x58afcc,_0x551a0d))[_0x1db5('0x46')](handleError(_0x58afcc,null));};exports[_0x1db5('0x63')]=function(_0x173491,_0x1e5acf,_0x23fcfa){var _0x1de069={'raw':!![],'where':{}};var _0x106cb3={};var _0x1a38b4={'count':0x0,'rows':[]};return db[_0x1db5('0x42')]['findOne']({'where':{'id':_0x173491[_0x1db5('0x48')]['id']}})['then'](handleEntityNotFound(_0x1e5acf,null))[_0x1db5('0x27')](function(_0x5302e5){if(_0x5302e5){_0x106cb3['model']=_[_0x1db5('0x33')](db[_0x1db5('0x64')][_0x1db5('0x2d')]);_0x106cb3[_0x1db5('0x32')]=_[_0x1db5('0x33')](_0x173491['query']);_0x106cb3['filters']=_['intersection'](_0x106cb3[_0x1db5('0x31')],_0x106cb3[_0x1db5('0x32')]);_0x1de069[_0x1db5('0x37')]=_[_0x1db5('0x35')](_0x106cb3[_0x1db5('0x31')],qs[_0x1db5('0x36')](_0x173491[_0x1db5('0x32')][_0x1db5('0x36')]));_0x1de069['attributes']=_0x1de069[_0x1db5('0x37')]['length']?_0x1de069[_0x1db5('0x37')]:_0x106cb3[_0x1db5('0x31')];if(!_0x173491[_0x1db5('0x32')][_0x1db5('0x38')]('nolimit')){_0x1de069[_0x1db5('0x3a')]=qs[_0x1db5('0x3a')](_0x173491[_0x1db5('0x32')]['limit']);_0x1de069[_0x1db5('0x1f')]=qs[_0x1db5('0x1f')](_0x173491['query'][_0x1db5('0x1f')]);}_0x1de069[_0x1db5('0x5d')]=qs['sort'](_0x173491[_0x1db5('0x32')][_0x1db5('0x3b')]);_0x1de069[_0x1db5('0x3c')]=qs['filters'](_['pick'](_0x173491['query'],_0x106cb3[_0x1db5('0x34')]));_0x1de069[_0x1db5('0x3c')]['CampaignId']=_0x5302e5['id'];if(_0x173491[_0x1db5('0x32')][_0x1db5('0x3e')]){_0x1de069['where']=_[_0x1db5('0x3f')](_0x1de069[_0x1db5('0x3c')],{'$or':_['map'](_0x1de069[_0x1db5('0x37')],function(_0x3ce271){var _0x36d4bb={};_0x36d4bb[_0x3ce271]={'$like':'%'+_0x173491[_0x1db5('0x32')][_0x1db5('0x3e')]+'%'};return _0x36d4bb;})});}_0x1de069=_[_0x1db5('0x3f')]({},_0x1de069,_0x173491['options']);return db[_0x1db5('0x64')][_0x1db5('0x43')]({'where':_0x1de069['where']})[_0x1db5('0x27')](function(_0x5ddbe3){_0x1a38b4[_0x1db5('0x43')]=_0x5ddbe3;if(_0x173491[_0x1db5('0x32')][_0x1db5('0x4a')]){_0x1de069[_0x1db5('0x4b')]=[{'all':!![]}];}return db[_0x1db5('0x64')]['findAll'](_0x1de069);})[_0x1db5('0x27')](function(_0x44cd75){_0x1a38b4[_0x1db5('0x45')]=_0x44cd75;return _0x1a38b4;});}})[_0x1db5('0x27')](respondWithFilteredResult(_0x1e5acf,_0x1de069))[_0x1db5('0x46')](handleError(_0x1e5acf,null));};exports['getLists']=function(_0x3fd4ea,_0x8f4714,_0x1f99f5){var _0x4868f3={};var _0x123202={};var _0xe1c95d;var _0x22b0f6;return db[_0x1db5('0x42')]['findOne']({'where':{'id':_0x3fd4ea[_0x1db5('0x48')]['id']}})[_0x1db5('0x27')](handleEntityNotFound(_0x8f4714,null))['then'](function(_0xea8259){if(_0xea8259){_0xe1c95d=_0xea8259;_0x123202[_0x1db5('0x31')]=_['keys'](db[_0x1db5('0x65')][_0x1db5('0x2d')]);_0x123202['query']=_['keys'](_0x3fd4ea[_0x1db5('0x32')]);_0x123202['filters']=_[_0x1db5('0x35')](_0x123202[_0x1db5('0x31')],_0x123202[_0x1db5('0x32')]);_0x4868f3[_0x1db5('0x37')]=_[_0x1db5('0x35')](_0x123202[_0x1db5('0x31')],qs[_0x1db5('0x36')](_0x3fd4ea['query'][_0x1db5('0x36')]));_0x4868f3[_0x1db5('0x37')]=_0x4868f3[_0x1db5('0x37')][_0x1db5('0x49')]?_0x4868f3[_0x1db5('0x37')]:_0x123202[_0x1db5('0x31')];_0x4868f3['order']=qs['sort'](_0x3fd4ea[_0x1db5('0x32')][_0x1db5('0x3b')]);_0x4868f3[_0x1db5('0x3c')]=qs[_0x1db5('0x34')](_[_0x1db5('0x3d')](_0x3fd4ea[_0x1db5('0x32')],_0x123202[_0x1db5('0x34')]));if(_0x3fd4ea[_0x1db5('0x32')]['filter']){_0x4868f3[_0x1db5('0x3c')]=_[_0x1db5('0x3f')](_0x4868f3[_0x1db5('0x3c')],{'$or':_['map'](_0x4868f3[_0x1db5('0x37')],function(_0x22e4e2){var _0x586f28={};_0x586f28[_0x22e4e2]={'$like':'%'+_0x3fd4ea[_0x1db5('0x32')]['filter']+'%'};return _0x586f28;})});}_0x4868f3=_[_0x1db5('0x3f')]({},_0x4868f3,_0x3fd4ea[_0x1db5('0x41')]);return _0xe1c95d['getLists'](_0x4868f3);}})['then'](function(_0x5678e3){if(_0x5678e3){_0x22b0f6=_0x5678e3[_0x1db5('0x49')];if(!_0x3fd4ea['query'][_0x1db5('0x38')](_0x1db5('0x39'))){_0x4868f3['limit']=qs[_0x1db5('0x3a')](_0x3fd4ea[_0x1db5('0x32')][_0x1db5('0x3a')]);_0x4868f3[_0x1db5('0x1f')]=qs['offset'](_0x3fd4ea[_0x1db5('0x32')][_0x1db5('0x1f')]);}return _0xe1c95d[_0x1db5('0x66')](_0x4868f3);}})[_0x1db5('0x27')](function(_0x5d693e){if(_0x5d693e){return _0x5d693e?{'count':_0x22b0f6,'rows':_0x5d693e}:null;}})[_0x1db5('0x27')](respondWithResult(_0x8f4714,null))['catch'](handleError(_0x8f4714,null));};exports[_0x1db5('0x67')]=function(_0x37bdb0,_0x233db3,_0x55bccd){var _0x1b030b,_0x87a925;var _0x3bc9d2=[];var _0x5e224d=moment()[_0x1db5('0x68')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x1db5('0x42')][_0x1db5('0x4c')]({'where':{'id':_0x37bdb0[_0x1db5('0x48')]['id']}})[_0x1db5('0x27')](handleEntityNotFound(_0x233db3,null))[_0x1db5('0x27')](function(_0x53e29){if(_0x53e29){_0x87a925=_0x53e29;return _0x53e29[_0x1db5('0x67')](_0x37bdb0[_0x1db5('0x4e')][_0x1db5('0x69')],_[_0x1db5('0x5a')](_0x37bdb0[_0x1db5('0x4e')],[_0x1db5('0x69'),'id'])||{});}return null;})[_0x1db5('0x6a')](function(_0x190286){var _0x3ca097;var _0x27c6bd;_0x1b030b=_0x190286||[];var _0x2d78a4=[];if(_0x190286){for(var _0x560532=0x0;_0x560532<_0x190286[_0x1db5('0x49')];_0x560532+=0x1){var _0x19e138=_0x190286[_0x560532]['get']({'plain':!![]});_0x87a925[_0x1db5('0x6b')]=_0x37bdb0[_0x1db5('0x4e')][_0x1db5('0x6b')]?_0x37bdb0['body'][_0x1db5('0x6b')]:_0x87a925[_0x1db5('0x6b')];switch(_0x87a925[_0x1db5('0x6b')]){case _0x1db5('0x6c'):_0x3ca097=squel[_0x1db5('0x6d')]()[_0x1db5('0x6e')]('cm_hopper')[_0x1db5('0x6f')]([_0x1db5('0x70'),'scheduledAt',_0x1db5('0x71'),_0x1db5('0x72'),_0x1db5('0x5e'),_0x1db5('0x58'),_0x1db5('0x59')],squel[_0x1db5('0x73')]()[_0x1db5('0x74')](_0x1db5('0x70'),_0x1db5('0x70'))[_0x1db5('0x74')](_0x1db5('0x75'),_0x1db5('0x76'))[_0x1db5('0x74')]('id',_0x1db5('0x71'))[_0x1db5('0x74')](_0x19e138[_0x1db5('0x77')][_0x1db5('0x78')](),_0x1db5('0x72'))[_0x1db5('0x74')](_0x37bdb0[_0x1db5('0x48')]['id'][_0x1db5('0x78')](),'CampaignId')[_0x1db5('0x74')]('\x27'+_0x5e224d+'\x27',_0x1db5('0x58'))['field']('\x27'+_0x5e224d+'\x27',_0x1db5('0x59'))[_0x1db5('0x79')]('cm_contacts')[_0x1db5('0x3c')](_0x1db5('0x7a'))[_0x1db5('0x3c')]('ListId\x20=\x20?',_0x19e138['CmListId'][_0x1db5('0x78')]())[_0x1db5('0x3c')](_0x1db5('0x7b'))['where'](_0x1db5('0x7c'),squel[_0x1db5('0x73')]()[_0x1db5('0x74')](_0x1db5('0x7d'))[_0x1db5('0x79')](_0x1db5('0x7e'))[_0x1db5('0x3c')](_0x1db5('0x7f'),_0x37bdb0[_0x1db5('0x48')]['id'][_0x1db5('0x78')]()))['where'](_0x1db5('0x7c'),squel[_0x1db5('0x73')]()[_0x1db5('0x74')]('COALESCE(phone,\x27\x27)')['from'](_0x1db5('0x80'))[_0x1db5('0x3c')](_0x1db5('0x7f'),_0x37bdb0[_0x1db5('0x48')]['id'][_0x1db5('0x78')]())))[_0x1db5('0x78')]();break;case'onlyIfOpen':_0x3ca097=squel[_0x1db5('0x6d')]()[_0x1db5('0x6e')](_0x1db5('0x80'))[_0x1db5('0x6f')]([_0x1db5('0x70'),'scheduledAt',_0x1db5('0x71'),_0x1db5('0x72'),_0x1db5('0x5e'),_0x1db5('0x58'),'updatedAt'],squel[_0x1db5('0x73')]()[_0x1db5('0x74')]('phone',_0x1db5('0x70'))[_0x1db5('0x74')](_0x1db5('0x75'),_0x1db5('0x76'))[_0x1db5('0x74')]('id',_0x1db5('0x71'))[_0x1db5('0x74')](_0x19e138[_0x1db5('0x77')][_0x1db5('0x78')](),_0x1db5('0x72'))[_0x1db5('0x74')](_0x37bdb0[_0x1db5('0x48')]['id'][_0x1db5('0x78')](),'CampaignId')['field']('\x27'+_0x5e224d+'\x27',_0x1db5('0x58'))[_0x1db5('0x74')]('\x27'+_0x5e224d+'\x27',_0x1db5('0x59'))[_0x1db5('0x79')]('cm_contacts')[_0x1db5('0x3c')](_0x1db5('0x7a'))[_0x1db5('0x3c')]('ListId\x20=\x20?',_0x19e138[_0x1db5('0x77')][_0x1db5('0x78')]())[_0x1db5('0x3c')]('phone\x20IS\x20NOT\x20NULL')[_0x1db5('0x3c')](_0x1db5('0x7c'),squel[_0x1db5('0x73')]()[_0x1db5('0x74')](_0x1db5('0x81'))[_0x1db5('0x79')]('cm_hopper')[_0x1db5('0x3c')](_0x1db5('0x7f'),_0x37bdb0[_0x1db5('0x48')]['id'][_0x1db5('0x78')]())))[_0x1db5('0x78')]();break;default:_0x3ca097=squel['insert']()[_0x1db5('0x6e')](_0x1db5('0x80'))[_0x1db5('0x6f')]([_0x1db5('0x70'),_0x1db5('0x76'),_0x1db5('0x71'),'ListId',_0x1db5('0x5e'),'createdAt',_0x1db5('0x59')],squel[_0x1db5('0x73')]()[_0x1db5('0x74')]('phone',_0x1db5('0x70'))[_0x1db5('0x74')]('NOW()',_0x1db5('0x76'))[_0x1db5('0x74')]('id',_0x1db5('0x71'))[_0x1db5('0x74')](_0x19e138[_0x1db5('0x77')]['toString'](),'ListId')[_0x1db5('0x74')](_0x37bdb0['params']['id'][_0x1db5('0x78')](),_0x1db5('0x5e'))[_0x1db5('0x74')]('\x27'+_0x5e224d+'\x27','createdAt')[_0x1db5('0x74')]('\x27'+_0x5e224d+'\x27',_0x1db5('0x59'))[_0x1db5('0x79')](_0x1db5('0x82'))[_0x1db5('0x3c')](_0x1db5('0x7a'))[_0x1db5('0x3c')](_0x1db5('0x83'),_0x19e138[_0x1db5('0x77')][_0x1db5('0x78')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x1db5('0x78')]();}_0x27c6bd=squel[_0x1db5('0x6d')]()[_0x1db5('0x6e')]('cm_hopper_additional_phones')[_0x1db5('0x6f')]([_0x1db5('0x84'),_0x1db5('0x76'),'phone',_0x1db5('0x85'),_0x1db5('0x58'),_0x1db5('0x59')],squel[_0x1db5('0x73')]()[_0x1db5('0x74')](_0x1db5('0x86'),'id')['field'](_0x1db5('0x75'),'scheduledAt')[_0x1db5('0x74')](_0x1db5('0x87'),_0x1db5('0x70'))[_0x1db5('0x74')]('ci.OrderBY',_0x1db5('0x85'))[_0x1db5('0x74')]('\x27'+_0x5e224d+'\x27',_0x1db5('0x58'))[_0x1db5('0x74')]('\x27'+_0x5e224d+'\x27',_0x1db5('0x59'))[_0x1db5('0x79')](_0x1db5('0x88'),'ci')[_0x1db5('0x89')](_0x1db5('0x80'),'h',_0x1db5('0x8a'))[_0x1db5('0x3c')](_0x1db5('0x8b'),_0x19e138[_0x1db5('0x77')][_0x1db5('0x78')]())['where'](_0x1db5('0x8c'),_0x37bdb0[_0x1db5('0x48')]['id'][_0x1db5('0x78')]())[_0x1db5('0x3c')]('h.createdAt\x20=\x20?',_0x5e224d))[_0x1db5('0x78')]();_0x2d78a4[_0x1db5('0x8d')](db[_0x1db5('0x8e')][_0x1db5('0x32')](_0x3ca097));_0x3bc9d2[_0x1db5('0x8d')](db['sequelize'][_0x1db5('0x32')](_0x27c6bd));}return BPromise[_0x1db5('0x8f')](_0x2d78a4);}})[_0x1db5('0x27')](function(){return BPromise[_0x1db5('0x8f')](_0x3bc9d2);})[_0x1db5('0x27')](function(){return _0x1b030b;})[_0x1db5('0x27')](respondWithResult(_0x233db3,null))[_0x1db5('0x46')](handleError(_0x233db3,null));};exports[_0x1db5('0x90')]=function(_0x2521b0,_0x2fc645,_0x4e96b8){return db[_0x1db5('0x42')][_0x1db5('0x4c')]({'where':{'id':_0x2521b0[_0x1db5('0x48')]['id']}})[_0x1db5('0x27')](handleEntityNotFound(_0x2fc645,null))['then'](function(_0x4afe7a){if(_0x4afe7a){return _0x4afe7a[_0x1db5('0x90')](_0x2521b0[_0x1db5('0x32')][_0x1db5('0x69')]);}})['then'](function(_0x407ec6){if(_0x407ec6){return db[_0x1db5('0x5f')][_0x1db5('0x24')]({'where':{'ListId':_0x2521b0[_0x1db5('0x32')][_0x1db5('0x69')],'CampaignId':_0x2521b0[_0x1db5('0x48')]['id']}})[_0x1db5('0x27')](function(){return _0x407ec6;});}})['then'](respondWithStatusCode(_0x2fc645,null))[_0x1db5('0x46')](handleError(_0x2fc645,null));};exports[_0x1db5('0x91')]=function(_0x5136d4,_0x518fdc,_0x5d134e){var _0x132ed1={};var _0x104256={};var _0x3845a6;var _0x297abc;return db[_0x1db5('0x42')][_0x1db5('0x5c')]({'where':{'id':_0x5136d4[_0x1db5('0x48')]['id']}})['then'](handleEntityNotFound(_0x518fdc,null))[_0x1db5('0x27')](function(_0x3d9f61){if(_0x3d9f61){_0x3845a6=_0x3d9f61;_0x104256['model']=_[_0x1db5('0x33')](db[_0x1db5('0x65')][_0x1db5('0x2d')]);_0x104256[_0x1db5('0x32')]=_[_0x1db5('0x33')](_0x5136d4['query']);_0x104256[_0x1db5('0x34')]=_[_0x1db5('0x35')](_0x104256['model'],_0x104256[_0x1db5('0x32')]);_0x132ed1['attributes']=_['intersection'](_0x104256[_0x1db5('0x31')],qs[_0x1db5('0x36')](_0x5136d4['query']['fields']));_0x132ed1[_0x1db5('0x37')]=_0x132ed1[_0x1db5('0x37')]['length']?_0x132ed1[_0x1db5('0x37')]:_0x104256[_0x1db5('0x31')];_0x132ed1[_0x1db5('0x5d')]=qs['sort'](_0x5136d4['query'][_0x1db5('0x3b')]);_0x132ed1[_0x1db5('0x3c')]=qs[_0x1db5('0x34')](_[_0x1db5('0x3d')](_0x5136d4[_0x1db5('0x32')],_0x104256['filters']));if(_0x5136d4[_0x1db5('0x32')][_0x1db5('0x3e')]){_0x132ed1[_0x1db5('0x3c')]=_[_0x1db5('0x3f')](_0x132ed1[_0x1db5('0x3c')],{'$or':_[_0x1db5('0x2c')](_0x132ed1[_0x1db5('0x37')],function(_0x39a629){var _0x280af9={};_0x280af9[_0x39a629]={'$like':'%'+_0x5136d4[_0x1db5('0x32')]['filter']+'%'};return _0x280af9;})});}_0x132ed1=_[_0x1db5('0x3f')]({},_0x132ed1,_0x5136d4[_0x1db5('0x41')]);return _0x3845a6[_0x1db5('0x91')](_0x132ed1);}})[_0x1db5('0x27')](function(_0x2fd5b8){if(_0x2fd5b8){_0x297abc=_0x2fd5b8[_0x1db5('0x49')];if(!_0x5136d4[_0x1db5('0x32')][_0x1db5('0x38')](_0x1db5('0x39'))){_0x132ed1[_0x1db5('0x3a')]=qs['limit'](_0x5136d4[_0x1db5('0x32')][_0x1db5('0x3a')]);_0x132ed1[_0x1db5('0x1f')]=qs[_0x1db5('0x1f')](_0x5136d4['query'][_0x1db5('0x1f')]);}return _0x3845a6[_0x1db5('0x91')](_0x132ed1);}})[_0x1db5('0x27')](function(_0x1e9a39){if(_0x1e9a39){return _0x1e9a39?{'count':_0x297abc,'rows':_0x1e9a39}:null;}})[_0x1db5('0x27')](respondWithResult(_0x518fdc,null))[_0x1db5('0x46')](handleError(_0x518fdc,null));};exports[_0x1db5('0x92')]=function(_0x209096,_0x3f4833,_0x252c17){var _0x5b45fa,_0x3c9cb1;var _0x260a59=[];var _0x29b3f5=moment()[_0x1db5('0x68')](_0x1db5('0x93'));return db[_0x1db5('0x42')][_0x1db5('0x4c')]({'where':{'id':_0x209096[_0x1db5('0x48')]['id']}})[_0x1db5('0x27')](handleEntityNotFound(_0x3f4833,null))[_0x1db5('0x27')](function(_0x46e35a){if(_0x46e35a){_0x3c9cb1=_0x46e35a;return _0x46e35a['addBlackLists'](_0x209096[_0x1db5('0x4e')][_0x1db5('0x69')],_['omit'](_0x209096[_0x1db5('0x4e')],[_0x1db5('0x69'),'id'])||{});}return null;})[_0x1db5('0x6a')](function(_0x246206){var _0x5e17a0;var _0x58dde2;_0x5b45fa=_0x246206||[];var _0x54634d=[];if(_0x246206){for(var _0x3a15f1=0x0;_0x3a15f1<_0x246206[_0x1db5('0x49')];_0x3a15f1+=0x1){var _0x19cce9=_0x246206[_0x3a15f1][_0x1db5('0x25')]({'plain':!![]});_0x5e17a0=squel[_0x1db5('0x6d')]()[_0x1db5('0x6e')](_0x1db5('0x94'))[_0x1db5('0x6f')]([_0x1db5('0x70'),'ContactId',_0x1db5('0x72'),_0x1db5('0x5e'),_0x1db5('0x58'),_0x1db5('0x59')],squel[_0x1db5('0x73')]()['field'](_0x1db5('0x70'),_0x1db5('0x70'))[_0x1db5('0x74')]('id','ContactId')[_0x1db5('0x74')](_0x19cce9[_0x1db5('0x77')][_0x1db5('0x78')](),_0x1db5('0x72'))[_0x1db5('0x74')](_0x209096['params']['id']['toString'](),_0x1db5('0x5e'))[_0x1db5('0x74')](_0x1db5('0x75'),_0x1db5('0x58'))[_0x1db5('0x74')](_0x1db5('0x75'),_0x1db5('0x59'))[_0x1db5('0x79')]('cm_contacts')[_0x1db5('0x3c')]('deletedAt\x20IS\x20NULL')[_0x1db5('0x3c')](_0x1db5('0x83'),_0x19cce9[_0x1db5('0x77')][_0x1db5('0x78')]())[_0x1db5('0x3c')](_0x1db5('0x7b')))[_0x1db5('0x78')]();_0x54634d['push'](db['sequelize']['query'](_0x5e17a0));}return BPromise[_0x1db5('0x8f')](_0x54634d);}})['then'](function(){return _0x5b45fa;})['then'](respondWithResult(_0x3f4833,null))[_0x1db5('0x46')](handleError(_0x3f4833,null));};exports['removeBlackLists']=function(_0x5d8a52,_0x1d49ae,_0x2c6e1c){return db['Campaign'][_0x1db5('0x4c')]({'where':{'id':_0x5d8a52[_0x1db5('0x48')]['id']}})[_0x1db5('0x27')](handleEntityNotFound(_0x1d49ae,null))[_0x1db5('0x27')](function(_0x5d8977){if(_0x5d8977){return _0x5d8977['removeBlackLists'](_0x5d8a52[_0x1db5('0x32')][_0x1db5('0x69')]);}})[_0x1db5('0x27')](function(_0x4264e7){if(_0x4264e7){return db[_0x1db5('0x64')]['destroy']({'where':{'ListId':_0x5d8a52[_0x1db5('0x32')][_0x1db5('0x69')],'CampaignId':_0x5d8a52['params']['id']}})['then'](function(){return _0x4264e7;});}})['then'](respondWithStatusCode(_0x1d49ae,null))[_0x1db5('0x46')](handleError(_0x1d49ae,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 9a6774d..d808de3 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x332e43,_0x252844){var _0x13bee3=function(_0x28c39a){while(--_0x28c39a){_0x332e43['push'](_0x332e43['shift']());}};_0x13bee3(++_0x252844);}(_0x7a54,0x106));var _0x47a5=function(_0x533a99,_0x6c29c4){_0x533a99=_0x533a99-0x0;var _0x29eb5c=_0x7a54[_0x533a99];return _0x29eb5c;};'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 77a407f..c6691ec 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 _0x1789=['debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCampaign','Campaign','options','where','attributes','limit','include','model','map','then','info','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','Campaign,\x20%s,\x20%s','request\x20sent'];(function(_0x5ed1c5,_0x266bf1){var _0x2ea2fc=function(_0x3e7976){while(--_0x3e7976){_0x5ed1c5['push'](_0x5ed1c5['shift']());}};_0x2ea2fc(++_0x266bf1);}(_0x1789,0x92));var _0x9178=function(_0x334ad2,_0xcd1829){_0x334ad2=_0x334ad2-0x0;var _0x1560eb=_0x1789[_0x334ad2];return _0x1560eb;};'use strict';var _=require(_0x9178('0x0'));var util=require(_0x9178('0x1'));var moment=require(_0x9178('0x2'));var BPromise=require('bluebird');var rs=require(_0x9178('0x3'));var fs=require('fs');var Redis=require(_0x9178('0x4'));var db=require(_0x9178('0x5'))['db'];var utils=require(_0x9178('0x6'));var logger=require(_0x9178('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9178('0x8'));var client=jayson[_0x9178('0x9')][_0x9178('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f00a8,_0x502d21,_0x1001b0){return new BPromise(function(_0x333b8b,_0x3bcc1b){return client[_0x9178('0xb')](_0x1f00a8,_0x1001b0)['then'](function(_0x4bd20e){logger['info'](_0x9178('0xc'),_0x502d21,_0x9178('0xd'));logger[_0x9178('0xe')](_0x9178('0xf'),_0x502d21,'request\x20sent',JSON[_0x9178('0x10')](_0x4bd20e));if(_0x4bd20e[_0x9178('0x11')]){if(_0x4bd20e['error']['code']===0x1f4){logger['error'](_0x9178('0xc'),_0x502d21,_0x4bd20e[_0x9178('0x11')]['message']);return _0x3bcc1b(_0x4bd20e[_0x9178('0x11')][_0x9178('0x12')]);}logger[_0x9178('0x11')]('Campaign,\x20%s,\x20%s',_0x502d21,_0x4bd20e[_0x9178('0x11')][_0x9178('0x12')]);return _0x333b8b(_0x4bd20e['error'][_0x9178('0x12')]);}else{logger['info'](_0x9178('0xc'),_0x502d21,_0x9178('0xd'));_0x333b8b(_0x4bd20e[_0x9178('0x13')][_0x9178('0x12')]);}})[_0x9178('0x14')](function(_0x31baa2){logger[_0x9178('0x11')](_0x9178('0xc'),_0x502d21,_0x31baa2);_0x3bcc1b(_0x31baa2);});});}exports[_0x9178('0x15')]=function(_0x3f3dd4){var _0x2184a0=this;return new Promise(function(_0x4393f3,_0x42c31b){return db[_0x9178('0x16')]['findAll']({'raw':_0x3f3dd4[_0x9178('0x17')]?_0x3f3dd4[_0x9178('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3f3dd4[_0x9178('0x17')]?_0x3f3dd4['options'][_0x9178('0x18')]||null:null,'attributes':_0x3f3dd4[_0x9178('0x17')]?_0x3f3dd4[_0x9178('0x17')][_0x9178('0x19')]||null:null,'limit':_0x3f3dd4[_0x9178('0x17')]?_0x3f3dd4[_0x9178('0x17')][_0x9178('0x1a')]||null:null,'include':_0x3f3dd4[_0x9178('0x17')]?_0x3f3dd4['options'][_0x9178('0x1b')]?_['map'](_0x3f3dd4['options'][_0x9178('0x1b')],function(_0x19aafe){return{'model':db[_0x19aafe[_0x9178('0x1c')]],'as':_0x19aafe['as'],'attributes':_0x19aafe[_0x9178('0x19')],'include':_0x19aafe[_0x9178('0x1b')]?_[_0x9178('0x1d')](_0x19aafe[_0x9178('0x1b')],function(_0x23c04a){return{'model':db[_0x23c04a[_0x9178('0x1c')]],'as':_0x23c04a['as'],'attributes':_0x23c04a[_0x9178('0x19')],'include':_0x23c04a[_0x9178('0x1b')]?_[_0x9178('0x1d')](_0x23c04a[_0x9178('0x1b')],function(_0x3af74d){return{'model':db[_0x3af74d['model']],'as':_0x3af74d['as'],'attributes':_0x3af74d[_0x9178('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9178('0x1e')](function(_0x5c39ed){logger[_0x9178('0x1f')](_0x9178('0x15'),_0x3f3dd4);logger[_0x9178('0xe')](_0x9178('0x15'),_0x3f3dd4,JSON[_0x9178('0x10')](_0x5c39ed));_0x4393f3(_0x5c39ed);})[_0x9178('0x14')](function(_0x5d9747){logger[_0x9178('0x11')](_0x9178('0x15'),_0x5d9747['message'],_0x3f3dd4);_0x42c31b(_0x2184a0[_0x9178('0x11')](0x1f4,_0x5d9747[_0x9178('0x12')]));});});};
\ No newline at end of file
+var _0x4a3d=['jayson/promise','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','Campaign','findAll','options','raw','attributes','include','map','model','GetCampaign','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x315d14,_0x38a4a0){var _0x4952c4=function(_0x9f2719){while(--_0x9f2719){_0x315d14['push'](_0x315d14['shift']());}};_0x4952c4(++_0x38a4a0);}(_0x4a3d,0x79));var _0xd4a3=function(_0x1fde90,_0x1a79d0){_0x1fde90=_0x1fde90-0x0;var _0x449f15=_0x4a3d[_0x1fde90];return _0x449f15;};'use strict';var _=require(_0xd4a3('0x0'));var util=require(_0xd4a3('0x1'));var moment=require(_0xd4a3('0x2'));var BPromise=require(_0xd4a3('0x3'));var rs=require(_0xd4a3('0x4'));var fs=require('fs');var Redis=require(_0xd4a3('0x5'));var db=require(_0xd4a3('0x6'))['db'];var utils=require(_0xd4a3('0x7'));var logger=require(_0xd4a3('0x8'))(_0xd4a3('0x9'));var config=require(_0xd4a3('0xa'));var jayson=require(_0xd4a3('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2449da,_0x45baf1,_0x5910aa){return new BPromise(function(_0x490bc1,_0x33c34b){return client[_0xd4a3('0xc')](_0x2449da,_0x5910aa)[_0xd4a3('0xd')](function(_0x128d6c){logger[_0xd4a3('0xe')](_0xd4a3('0xf'),_0x45baf1,_0xd4a3('0x10'));logger[_0xd4a3('0x11')]('Campaign,\x20%s,\x20%s,\x20%s',_0x45baf1,_0xd4a3('0x10'),JSON[_0xd4a3('0x12')](_0x128d6c));if(_0x128d6c[_0xd4a3('0x13')]){if(_0x128d6c[_0xd4a3('0x13')][_0xd4a3('0x14')]===0x1f4){logger[_0xd4a3('0x13')](_0xd4a3('0xf'),_0x45baf1,_0x128d6c['error'][_0xd4a3('0x15')]);return _0x33c34b(_0x128d6c[_0xd4a3('0x13')][_0xd4a3('0x15')]);}logger[_0xd4a3('0x13')](_0xd4a3('0xf'),_0x45baf1,_0x128d6c[_0xd4a3('0x13')][_0xd4a3('0x15')]);return _0x490bc1(_0x128d6c[_0xd4a3('0x13')]['message']);}else{logger['info'](_0xd4a3('0xf'),_0x45baf1,_0xd4a3('0x10'));_0x490bc1(_0x128d6c[_0xd4a3('0x16')][_0xd4a3('0x15')]);}})[_0xd4a3('0x17')](function(_0x454361){logger['error'](_0xd4a3('0xf'),_0x45baf1,_0x454361);_0x33c34b(_0x454361);});});}exports['GetCampaign']=function(_0xf9fc3c){var _0x592077=this;return new Promise(function(_0x21fa36,_0x4b8850){return db[_0xd4a3('0x18')][_0xd4a3('0x19')]({'raw':_0xf9fc3c['options']?_0xf9fc3c[_0xd4a3('0x1a')][_0xd4a3('0x1b')]===undefined?!![]:![]:!![],'where':_0xf9fc3c[_0xd4a3('0x1a')]?_0xf9fc3c['options']['where']||null:null,'attributes':_0xf9fc3c[_0xd4a3('0x1a')]?_0xf9fc3c['options'][_0xd4a3('0x1c')]||null:null,'limit':_0xf9fc3c[_0xd4a3('0x1a')]?_0xf9fc3c['options']['limit']||null:null,'include':_0xf9fc3c['options']?_0xf9fc3c[_0xd4a3('0x1a')][_0xd4a3('0x1d')]?_[_0xd4a3('0x1e')](_0xf9fc3c['options'][_0xd4a3('0x1d')],function(_0x137bba){return{'model':db[_0x137bba[_0xd4a3('0x1f')]],'as':_0x137bba['as'],'attributes':_0x137bba[_0xd4a3('0x1c')],'include':_0x137bba[_0xd4a3('0x1d')]?_[_0xd4a3('0x1e')](_0x137bba['include'],function(_0x35a871){return{'model':db[_0x35a871[_0xd4a3('0x1f')]],'as':_0x35a871['as'],'attributes':_0x35a871['attributes'],'include':_0x35a871[_0xd4a3('0x1d')]?_[_0xd4a3('0x1e')](_0x35a871[_0xd4a3('0x1d')],function(_0x4ce98a){return{'model':db[_0x4ce98a[_0xd4a3('0x1f')]],'as':_0x4ce98a['as'],'attributes':_0x4ce98a[_0xd4a3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd4a3('0xd')](function(_0x586cd8){logger[_0xd4a3('0xe')]('GetCampaign',_0xf9fc3c);logger[_0xd4a3('0x11')]('GetCampaign',_0xf9fc3c,JSON[_0xd4a3('0x12')](_0x586cd8));_0x21fa36(_0x586cd8);})['catch'](function(_0x2769b7){logger['error'](_0xd4a3('0x20'),_0x2769b7['message'],_0xf9fc3c);_0x4b8850(_0x592077[_0xd4a3('0x13')](0x1f4,_0x2769b7[_0xd4a3('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index c742e30..f1d3718 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 _0x05fd=['util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','put','/:id','delete','destroy','removeLists','removeBlackLists','exports','multer'];(function(_0x5cc2a3,_0x2d38a6){var _0x9d6e07=function(_0xa7d53f){while(--_0xa7d53f){_0x5cc2a3['push'](_0x5cc2a3['shift']());}};_0x9d6e07(++_0x2d38a6);}(_0x05fd,0x173));var _0xd05f=function(_0x466552,_0x3d4e47){_0x466552=_0x466552-0x0;var _0x3721c2=_0x05fd[_0x466552];return _0x3721c2;};'use strict';var multer=require(_0xd05f('0x0'));var util=require(_0xd05f('0x1'));var path=require('path');var timeout=require(_0xd05f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd05f('0x3'));var auth=require(_0xd05f('0x4'));var interaction=require(_0xd05f('0x5'));var config=require(_0xd05f('0x6'));var controller=require(_0xd05f('0x7'));router[_0xd05f('0x8')]('/',auth[_0xd05f('0x9')](),controller[_0xd05f('0xa')]);router[_0xd05f('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xd05f('0x8')](_0xd05f('0xb'),auth[_0xd05f('0x9')](),controller['getHoppers']);router[_0xd05f('0x8')](_0xd05f('0xc'),auth['isAuthenticated'](),controller[_0xd05f('0xd')]);router['get'](_0xd05f('0xe'),auth[_0xd05f('0x9')](),controller['getHopperFinals']);router[_0xd05f('0x8')]('/:id/hopper_black',auth['isAuthenticated'](),controller['getHopperBlacks']);router['get'](_0xd05f('0xf'),auth[_0xd05f('0x9')](),controller[_0xd05f('0x10')]);router[_0xd05f('0x8')](_0xd05f('0x11'),auth[_0xd05f('0x9')](),controller[_0xd05f('0x12')]);router[_0xd05f('0x13')]('/',auth[_0xd05f('0x9')](),controller[_0xd05f('0x14')]);router[_0xd05f('0x13')](_0xd05f('0x15'),auth[_0xd05f('0x9')](),controller[_0xd05f('0x16')]);router[_0xd05f('0x13')](_0xd05f('0xf'),auth[_0xd05f('0x9')](),controller[_0xd05f('0x17')]);router[_0xd05f('0x13')]('/:id/blacklists',auth[_0xd05f('0x9')](),controller['addBlackLists']);router[_0xd05f('0x18')](_0xd05f('0x19'),auth[_0xd05f('0x9')](),controller['update']);router[_0xd05f('0x1a')]('/:id',auth[_0xd05f('0x9')](),controller[_0xd05f('0x1b')]);router[_0xd05f('0x1a')]('/:id/lists',auth[_0xd05f('0x9')](),controller[_0xd05f('0x1c')]);router[_0xd05f('0x1a')](_0xd05f('0x11'),auth[_0xd05f('0x9')](),controller[_0xd05f('0x1d')]);module[_0xd05f('0x1e')]=router;
\ No newline at end of file
+var _0xef60=['index','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','getHopperBlacks','/:id/lists','getLists','getBlackLists','create','post','/:id/clone','clone','addLists','/:id/blacklists','put','delete','destroy','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./campaign.controller','get'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xef60,0xa0));var _0x0ef6=function(_0x2286a8,_0x5d1dbb){_0x2286a8=_0x2286a8-0x0;var _0x82a3ba=_0xef60[_0x2286a8];return _0x82a3ba;};'use strict';var multer=require(_0x0ef6('0x0'));var util=require(_0x0ef6('0x1'));var path=require(_0x0ef6('0x2'));var timeout=require(_0x0ef6('0x3'));var express=require(_0x0ef6('0x4'));var router=express[_0x0ef6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0ef6('0x6'));var interaction=require(_0x0ef6('0x7'));var config=require('../../config/environment');var controller=require(_0x0ef6('0x8'));router[_0x0ef6('0x9')]('/',auth['isAuthenticated'](),controller[_0x0ef6('0xa')]);router[_0x0ef6('0x9')](_0x0ef6('0xb'),auth[_0x0ef6('0xc')](),controller[_0x0ef6('0xd')]);router[_0x0ef6('0x9')](_0x0ef6('0xe'),auth['isAuthenticated'](),controller[_0x0ef6('0xf')]);router[_0x0ef6('0x9')](_0x0ef6('0x10'),auth[_0x0ef6('0xc')](),controller[_0x0ef6('0x11')]);router[_0x0ef6('0x9')]('/:id/hopper_finals',auth[_0x0ef6('0xc')](),controller[_0x0ef6('0x12')]);router[_0x0ef6('0x9')]('/:id/hopper_black',auth[_0x0ef6('0xc')](),controller[_0x0ef6('0x13')]);router[_0x0ef6('0x9')](_0x0ef6('0x14'),auth[_0x0ef6('0xc')](),controller[_0x0ef6('0x15')]);router[_0x0ef6('0x9')]('/:id/blacklists',auth[_0x0ef6('0xc')](),controller[_0x0ef6('0x16')]);router['post']('/',auth[_0x0ef6('0xc')](),controller[_0x0ef6('0x17')]);router[_0x0ef6('0x18')](_0x0ef6('0x19'),auth[_0x0ef6('0xc')](),controller[_0x0ef6('0x1a')]);router[_0x0ef6('0x18')](_0x0ef6('0x14'),auth[_0x0ef6('0xc')](),controller[_0x0ef6('0x1b')]);router[_0x0ef6('0x18')](_0x0ef6('0x1c'),auth[_0x0ef6('0xc')](),controller['addBlackLists']);router[_0x0ef6('0x1d')](_0x0ef6('0xb'),auth[_0x0ef6('0xc')](),controller['update']);router[_0x0ef6('0x1e')](_0x0ef6('0xb'),auth['isAuthenticated'](),controller[_0x0ef6('0x1f')]);router[_0x0ef6('0x1e')](_0x0ef6('0x14'),auth[_0x0ef6('0xc')](),controller['removeLists']);router[_0x0ef6('0x1e')](_0x0ef6('0x1c'),auth[_0x0ef6('0xc')](),controller[_0x0ef6('0x20')]);module[_0x0ef6('0x21')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 4fd84ca..6b9f246 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 _0x7dc0=['medium','STRING','VIRTUAL','getDataValue','key','sequelize','exports','TEXT'];(function(_0x5d78f0,_0x3784f9){var _0x4d1012=function(_0x23d0ba){while(--_0x23d0ba){_0x5d78f0['push'](_0x5d78f0['shift']());}};_0x4d1012(++_0x3784f9);}(_0x7dc0,0x9d));var _0x07dc=function(_0x2cef86,_0xbae0a6){_0x2cef86=_0x2cef86-0x0;var _0x46dfd6=_0x7dc0[_0x2cef86];return _0x46dfd6;};'use strict';var Sequelize=require(_0x07dc('0x0'));module[_0x07dc('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x07dc('0x2')],'length':_0x07dc('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x07dc('0x4')]},'name':{'type':Sequelize[_0x07dc('0x5')],'get':function(){return this[_0x07dc('0x6')](_0x07dc('0x7'));}}};
\ No newline at end of file
+var _0x9c50=['getDataValue','sequelize','STRING','VIRTUAL'];(function(_0x2f8fa6,_0x259848){var _0x4a4cf8=function(_0x4ed910){while(--_0x4ed910){_0x2f8fa6['push'](_0x2f8fa6['shift']());}};_0x4a4cf8(++_0x259848);}(_0x9c50,0xf5));var _0x09c5=function(_0xb27b00,_0x3c854b){_0xb27b00=_0xb27b00-0x0;var _0xd139f0=_0x9c50[_0xb27b00];return _0xd139f0;};'use strict';var Sequelize=require(_0x09c5('0x0'));module['exports']={'key':{'type':Sequelize[_0x09c5('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0x09c5('0x1')]},'name':{'type':Sequelize[_0x09c5('0x2')],'get':function(){return this[_0x09c5('0x3')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 79d03da..5d9eb6f 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 _0x9cd5=['map','CannedAnswer','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','filter','merge','where','includeAll','include','findAll','catch','show','params','options','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','find','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','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','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','CannedAnswers','error','name','send','index'];(function(_0x3808b5,_0x5907a0){var _0x352c3d=function(_0x334e63){while(--_0x334e63){_0x3808b5['push'](_0x3808b5['shift']());}};_0x352c3d(++_0x5907a0);}(_0x9cd5,0x1f1));var _0x59cd=function(_0x53fdd5,_0x1f3f58){_0x53fdd5=_0x53fdd5-0x0;var _0x1cc7bf=_0x9cd5[_0x53fdd5];return _0x1cc7bf;};'use strict';var emlformat=require(_0x59cd('0x0'));var rimraf=require(_0x59cd('0x1'));var zipdir=require(_0x59cd('0x2'));var jsonpatch=require(_0x59cd('0x3'));var rp=require(_0x59cd('0x4'));var moment=require('moment');var BPromise=require(_0x59cd('0x5'));var Mustache=require(_0x59cd('0x6'));var util=require(_0x59cd('0x7'));var path=require(_0x59cd('0x8'));var sox=require('sox');var csv=require(_0x59cd('0x9'));var ejs=require(_0x59cd('0xa'));var fs=require('fs');var fs_extra=require(_0x59cd('0xb'));var _=require(_0x59cd('0xc'));var squel=require(_0x59cd('0xd'));var crypto=require(_0x59cd('0xe'));var jsforce=require(_0x59cd('0xf'));var deskjs=require(_0x59cd('0x10'));var toCsv=require(_0x59cd('0x9'));var querystring=require(_0x59cd('0x11'));var Papa=require(_0x59cd('0x12'));var Redis=require(_0x59cd('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x59cd('0x14'));var as=require(_0x59cd('0x15'));var hardwareService=require(_0x59cd('0x16'));var logger=require(_0x59cd('0x17'))(_0x59cd('0x18'));var utils=require(_0x59cd('0x19'));var config=require(_0x59cd('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x59cd('0x1b'))['db'];function respondWithStatusCode(_0x184d4b,_0x13e657){_0x13e657=_0x13e657||0xcc;return function(_0x513a5f){if(_0x513a5f){return _0x184d4b[_0x59cd('0x1c')](_0x13e657);}return _0x184d4b[_0x59cd('0x1d')](_0x13e657)[_0x59cd('0x1e')]();};}function respondWithResult(_0x195a8c,_0x264e4d){_0x264e4d=_0x264e4d||0xc8;return function(_0x3aa051){if(_0x3aa051){return _0x195a8c[_0x59cd('0x1d')](_0x264e4d)[_0x59cd('0x1f')](_0x3aa051);}};}function respondWithFilteredResult(_0x561fb5,_0x266d41){return function(_0x29aa0b){if(_0x29aa0b){var _0x3bab89=typeof _0x266d41[_0x59cd('0x20')]===_0x59cd('0x21')&&typeof _0x266d41['limit']===_0x59cd('0x21');var _0x21b9db=_0x29aa0b[_0x59cd('0x22')];var _0x5237e6=_0x3bab89?0x0:_0x266d41[_0x59cd('0x20')];var _0x5ecb02=_0x3bab89?_0x29aa0b['count']:_0x266d41[_0x59cd('0x20')]+_0x266d41[_0x59cd('0x23')];var _0x567691;if(_0x5ecb02>=_0x21b9db){_0x5ecb02=_0x21b9db;_0x567691=0xc8;}else{_0x567691=0xce;}_0x561fb5['status'](_0x567691);return _0x561fb5[_0x59cd('0x24')]('Content-Range',_0x5237e6+'-'+_0x5ecb02+'/'+_0x21b9db)[_0x59cd('0x1f')](_0x29aa0b);}return null;};}function patchUpdates(_0x304219){return function(_0x43c4c5){try{jsonpatch[_0x59cd('0x25')](_0x43c4c5,_0x304219,!![]);}catch(_0x5a49ab){return BPromise[_0x59cd('0x26')](_0x5a49ab);}return _0x43c4c5[_0x59cd('0x27')]();};}function saveUpdates(_0x2d0feb,_0x2d7157){return function(_0x5e5b20){if(_0x5e5b20){return _0x5e5b20[_0x59cd('0x28')](_0x2d0feb)[_0x59cd('0x29')](function(_0x3522d4){return _0x3522d4;});}return null;};}function removeEntity(_0xad36dc,_0xb1291){return function(_0x342bce){if(_0x342bce){return _0x342bce[_0x59cd('0x2a')]()[_0x59cd('0x29')](function(){var _0x490052=_0x342bce[_0x59cd('0x2b')]({'plain':!![]});var _0x3d2379=_0x59cd('0x2c');return db['UserProfileResource'][_0x59cd('0x2a')]({'where':{'type':_0x3d2379,'resourceId':_0x490052['id']}})[_0x59cd('0x29')](function(){return _0x342bce;});})[_0x59cd('0x29')](function(){_0xad36dc[_0x59cd('0x1d')](0xcc)[_0x59cd('0x1e')]();});}};}function handleEntityNotFound(_0x391d01,_0x1e47a6){return function(_0x6fb06b){if(!_0x6fb06b){_0x391d01[_0x59cd('0x1c')](0x194);}return _0x6fb06b;};}function handleError(_0x1d525d,_0x4cd1bd){_0x4cd1bd=_0x4cd1bd||0x1f4;return function(_0x46e532){logger[_0x59cd('0x2d')](_0x46e532['stack']);if(_0x46e532['name']){delete _0x46e532[_0x59cd('0x2e')];}_0x1d525d[_0x59cd('0x1d')](_0x4cd1bd)[_0x59cd('0x2f')](_0x46e532);};}exports[_0x59cd('0x30')]=function(_0x5dc6,_0x1a7e05){var _0x41b0b3={},_0x1f1af2={},_0x522f79={'count':0x0,'rows':[]};var _0x132b58=_[_0x59cd('0x31')](db[_0x59cd('0x32')]['rawAttributes'],function(_0x86cde2){return{'name':_0x86cde2['fieldName'],'type':_0x86cde2[_0x59cd('0x33')][_0x59cd('0x34')]};});_0x1f1af2[_0x59cd('0x35')]=_[_0x59cd('0x31')](_0x132b58,_0x59cd('0x2e'));_0x1f1af2[_0x59cd('0x36')]=_[_0x59cd('0x37')](_0x5dc6[_0x59cd('0x36')]);_0x1f1af2[_0x59cd('0x38')]=_[_0x59cd('0x39')](_0x1f1af2[_0x59cd('0x35')],_0x1f1af2[_0x59cd('0x36')]);_0x41b0b3[_0x59cd('0x3a')]=_[_0x59cd('0x39')](_0x1f1af2[_0x59cd('0x35')],qs[_0x59cd('0x3b')](_0x5dc6[_0x59cd('0x36')][_0x59cd('0x3b')]));_0x41b0b3[_0x59cd('0x3a')]=_0x41b0b3[_0x59cd('0x3a')][_0x59cd('0x3c')]?_0x41b0b3[_0x59cd('0x3a')]:_0x1f1af2[_0x59cd('0x35')];if(!_0x5dc6[_0x59cd('0x36')]['hasOwnProperty']('nolimit')){_0x41b0b3[_0x59cd('0x23')]=qs[_0x59cd('0x23')](_0x5dc6[_0x59cd('0x36')]['limit']);_0x41b0b3[_0x59cd('0x20')]=qs[_0x59cd('0x20')](_0x5dc6[_0x59cd('0x36')][_0x59cd('0x20')]);}_0x41b0b3[_0x59cd('0x3d')]=qs[_0x59cd('0x3e')](_0x5dc6[_0x59cd('0x36')][_0x59cd('0x3e')]);_0x41b0b3['where']=qs[_0x59cd('0x38')](_[_0x59cd('0x3f')](_0x5dc6[_0x59cd('0x36')],_0x1f1af2['filters']),_0x132b58);if(_0x5dc6[_0x59cd('0x36')][_0x59cd('0x40')]){_0x41b0b3['where']=_[_0x59cd('0x41')](_0x41b0b3[_0x59cd('0x42')],{'$or':[{'key':{'$like':'%'+_0x5dc6[_0x59cd('0x36')][_0x59cd('0x40')]+'%'}},{'value':{'$like':'%'+_0x5dc6[_0x59cd('0x36')][_0x59cd('0x40')]+'%'}}]});}_0x41b0b3=_[_0x59cd('0x41')]({},_0x41b0b3,_0x5dc6['options']);var _0x442e0c={'where':_0x41b0b3[_0x59cd('0x42')]};return db[_0x59cd('0x32')][_0x59cd('0x22')](_0x442e0c)[_0x59cd('0x29')](function(_0x1e550e){_0x522f79[_0x59cd('0x22')]=_0x1e550e;if(_0x5dc6['query'][_0x59cd('0x43')]){_0x41b0b3[_0x59cd('0x44')]=[{'all':!![]}];}return db[_0x59cd('0x32')][_0x59cd('0x45')](_0x41b0b3);})['then'](function(_0x2a5eff){_0x522f79['rows']=_0x2a5eff;return _0x522f79;})[_0x59cd('0x29')](respondWithFilteredResult(_0x1a7e05,_0x41b0b3))[_0x59cd('0x46')](handleError(_0x1a7e05,null));};exports[_0x59cd('0x47')]=function(_0x313796,_0x148e57){var _0x313b54={'raw':!![],'where':{'id':_0x313796[_0x59cd('0x48')]['id']}},_0x198dd1={};_0x198dd1[_0x59cd('0x35')]=_[_0x59cd('0x37')](db['CannedAnswer']['rawAttributes']);_0x198dd1[_0x59cd('0x36')]=_['keys'](_0x313796['query']);_0x198dd1['filters']=_['intersection'](_0x198dd1['model'],_0x198dd1[_0x59cd('0x36')]);_0x313b54[_0x59cd('0x3a')]=_['intersection'](_0x198dd1[_0x59cd('0x35')],qs[_0x59cd('0x3b')](_0x313796[_0x59cd('0x36')][_0x59cd('0x3b')]));_0x313b54[_0x59cd('0x3a')]=_0x313b54[_0x59cd('0x3a')][_0x59cd('0x3c')]?_0x313b54[_0x59cd('0x3a')]:_0x198dd1[_0x59cd('0x35')];if(_0x313796[_0x59cd('0x36')][_0x59cd('0x43')]){_0x313b54['include']=[{'all':!![]}];}_0x313b54=_[_0x59cd('0x41')]({},_0x313b54,_0x313796[_0x59cd('0x49')]);return db[_0x59cd('0x32')]['find'](_0x313b54)[_0x59cd('0x29')](handleEntityNotFound(_0x148e57,null))['then'](respondWithResult(_0x148e57,null))[_0x59cd('0x46')](handleError(_0x148e57,null));};exports[_0x59cd('0x28')]=function(_0x5bac72,_0x4f706c){if(_0x5bac72[_0x59cd('0x4a')]['id']){delete _0x5bac72[_0x59cd('0x4a')]['id'];}return db[_0x59cd('0x32')]['find']({'where':{'id':_0x5bac72[_0x59cd('0x48')]['id']}})['then'](handleEntityNotFound(_0x4f706c,null))[_0x59cd('0x29')](saveUpdates(_0x5bac72[_0x59cd('0x4a')],null))[_0x59cd('0x29')](respondWithResult(_0x4f706c,null))[_0x59cd('0x46')](handleError(_0x4f706c,null));};exports[_0x59cd('0x2a')]=function(_0x22d2f6,_0xdf9712){return db[_0x59cd('0x32')]['find']({'where':{'id':_0x22d2f6['params']['id']}})[_0x59cd('0x29')](handleEntityNotFound(_0xdf9712,null))['then'](removeEntity(_0xdf9712,null))[_0x59cd('0x46')](handleError(_0xdf9712,null));};exports['create']=function(_0x149a06,_0x3aa8dc){var _0x230cd4={'key':_0x149a06[_0x59cd('0x4a')][_0x59cd('0x34')]};if(_0x149a06[_0x59cd('0x4a')]['MailAccountId']){_0x230cd4[_0x59cd('0x4b')]=_0x149a06[_0x59cd('0x4a')][_0x59cd('0x4b')];}else if(_0x149a06['body']['SmsAccountId']){_0x230cd4[_0x59cd('0x4c')]=_0x149a06[_0x59cd('0x4a')][_0x59cd('0x4c')];}else if(_0x149a06[_0x59cd('0x4a')][_0x59cd('0x4d')]){_0x230cd4[_0x59cd('0x4d')]=_0x149a06[_0x59cd('0x4a')]['OpenchannelAccountId'];}else if(_0x149a06['body'][_0x59cd('0x4e')]){_0x230cd4[_0x59cd('0x4e')]=_0x149a06[_0x59cd('0x4a')][_0x59cd('0x4e')];}return db[_0x59cd('0x32')][_0x59cd('0x4f')]({'where':_0x230cd4})[_0x59cd('0x29')](function(_0x1acf54){if(_0x1acf54){throw new db[(_0x59cd('0x50'))][(_0x59cd('0x51'))](_0x59cd('0x52'));}return db['CannedAnswer']['create'](_0x149a06[_0x59cd('0x4a')]);})['then'](function(_0xa47d22){var _0x1ff85c=_0x149a06[_0x59cd('0x53')]['get']({'plain':!![]});if(!_0x1ff85c)throw new Error(_0x59cd('0x54'));if(_0x1ff85c[_0x59cd('0x55')]===_0x59cd('0x53')){var _0x820f91=_0xa47d22[_0x59cd('0x2b')]({'plain':!![]});return db[_0x59cd('0x56')][_0x59cd('0x4f')]({'where':{'name':_0x59cd('0x2c'),'userProfileId':_0x1ff85c[_0x59cd('0x57')]},'raw':!![]})[_0x59cd('0x29')](function(_0x51c1ce){if(_0x51c1ce&&_0x51c1ce[_0x59cd('0x58')]===0x0){return db['UserProfileResource'][_0x59cd('0x59')]({'name':_0x820f91[_0x59cd('0x2e')],'resourceId':_0x820f91['id'],'type':_0x51c1ce['name'],'sectionId':_0x51c1ce['id']},{})[_0x59cd('0x29')](function(){return _0xa47d22;});}else{return _0xa47d22;}})['catch'](function(_0x1b71de){logger[_0x59cd('0x2d')](_0x59cd('0x5a'),_0x1b71de);throw _0x1b71de;});}return _0xa47d22;})[_0x59cd('0x29')](respondWithResult(_0x3aa8dc,0xc9))[_0x59cd('0x46')](handleError(_0x3aa8dc,null));};
\ No newline at end of file
+var _0xf3fc=['fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','show','params','includeAll','find','catch','update','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','model','query','keys','intersection','attributes'];(function(_0x75cc31,_0x21bdbe){var _0x3eefa7=function(_0x125e39){while(--_0x125e39){_0x75cc31['push'](_0x75cc31['shift']());}};_0x3eefa7(++_0x21bdbe);}(_0xf3fc,0x128));var _0xcf3f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf3fc[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xcf3f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcf3f('0x1'));var jsonpatch=require(_0xcf3f('0x2'));var rp=require(_0xcf3f('0x3'));var moment=require(_0xcf3f('0x4'));var BPromise=require(_0xcf3f('0x5'));var Mustache=require(_0xcf3f('0x6'));var util=require(_0xcf3f('0x7'));var path=require('path');var sox=require(_0xcf3f('0x8'));var csv=require(_0xcf3f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcf3f('0xa'));var _=require(_0xcf3f('0xb'));var squel=require('squel');var crypto=require(_0xcf3f('0xc'));var jsforce=require(_0xcf3f('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcf3f('0xe'));var Redis=require(_0xcf3f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xcf3f('0x10'));var as=require(_0xcf3f('0x11'));var hardwareService=require(_0xcf3f('0x12'));var logger=require(_0xcf3f('0x13'))(_0xcf3f('0x14'));var utils=require('../../config/utils');var config=require(_0xcf3f('0x15'));var licenseUtil=require(_0xcf3f('0x16'));var db=require(_0xcf3f('0x17'))['db'];function respondWithStatusCode(_0x4baf2c,_0x3c0dc8){_0x3c0dc8=_0x3c0dc8||0xcc;return function(_0x1b4bb0){if(_0x1b4bb0){return _0x4baf2c[_0xcf3f('0x18')](_0x3c0dc8);}return _0x4baf2c[_0xcf3f('0x19')](_0x3c0dc8)[_0xcf3f('0x1a')]();};}function respondWithResult(_0x9f69a0,_0xde5fbf){_0xde5fbf=_0xde5fbf||0xc8;return function(_0x16216c){if(_0x16216c){return _0x9f69a0[_0xcf3f('0x19')](_0xde5fbf)[_0xcf3f('0x1b')](_0x16216c);}};}function respondWithFilteredResult(_0x59a0e1,_0x320275){return function(_0x5a8f36){if(_0x5a8f36){var _0x213fd8=typeof _0x320275[_0xcf3f('0x1c')]===_0xcf3f('0x1d')&&typeof _0x320275[_0xcf3f('0x1e')]===_0xcf3f('0x1d');var _0x4d5ed4=_0x5a8f36['count'];var _0x59c2d6=_0x213fd8?0x0:_0x320275[_0xcf3f('0x1c')];var _0x48733a=_0x213fd8?_0x5a8f36[_0xcf3f('0x1f')]:_0x320275[_0xcf3f('0x1c')]+_0x320275[_0xcf3f('0x1e')];var _0x430c18;if(_0x48733a>=_0x4d5ed4){_0x48733a=_0x4d5ed4;_0x430c18=0xc8;}else{_0x430c18=0xce;}_0x59a0e1[_0xcf3f('0x19')](_0x430c18);return _0x59a0e1[_0xcf3f('0x20')](_0xcf3f('0x21'),_0x59c2d6+'-'+_0x48733a+'/'+_0x4d5ed4)[_0xcf3f('0x1b')](_0x5a8f36);}return null;};}function patchUpdates(_0xab4fb1){return function(_0x36b117){try{jsonpatch[_0xcf3f('0x22')](_0x36b117,_0xab4fb1,!![]);}catch(_0xa8bb41){return BPromise[_0xcf3f('0x23')](_0xa8bb41);}return _0x36b117['save']();};}function saveUpdates(_0x453ff2,_0x474daf){return function(_0xf52d2e){if(_0xf52d2e){return _0xf52d2e['update'](_0x453ff2)[_0xcf3f('0x24')](function(_0x498c9b){return _0x498c9b;});}return null;};}function removeEntity(_0x2787f1,_0x58c567){return function(_0x12fbd2){if(_0x12fbd2){return _0x12fbd2[_0xcf3f('0x25')]()['then'](function(){var _0xb4fa94=_0x12fbd2['get']({'plain':!![]});var _0x1306d8='CannedAnswers';return db[_0xcf3f('0x26')][_0xcf3f('0x25')]({'where':{'type':_0x1306d8,'resourceId':_0xb4fa94['id']}})[_0xcf3f('0x24')](function(){return _0x12fbd2;});})[_0xcf3f('0x24')](function(){_0x2787f1[_0xcf3f('0x19')](0xcc)[_0xcf3f('0x1a')]();});}};}function handleEntityNotFound(_0x42adeb,_0x2e51e7){return function(_0x3d5f27){if(!_0x3d5f27){_0x42adeb[_0xcf3f('0x18')](0x194);}return _0x3d5f27;};}function handleError(_0x2807b9,_0x338ea6){_0x338ea6=_0x338ea6||0x1f4;return function(_0x1f26ff){logger[_0xcf3f('0x27')](_0x1f26ff[_0xcf3f('0x28')]);if(_0x1f26ff[_0xcf3f('0x29')]){delete _0x1f26ff[_0xcf3f('0x29')];}_0x2807b9[_0xcf3f('0x19')](_0x338ea6)[_0xcf3f('0x2a')](_0x1f26ff);};}exports[_0xcf3f('0x2b')]=function(_0x49c043,_0x4e3bae){var _0x359baa={},_0x46b26f={},_0x5b2ec6={'count':0x0,'rows':[]};var _0xa2a9b=_[_0xcf3f('0x2c')](db[_0xcf3f('0x2d')][_0xcf3f('0x2e')],function(_0x322cea){return{'name':_0x322cea['fieldName'],'type':_0x322cea['type']['key']};});_0x46b26f[_0xcf3f('0x2f')]=_['map'](_0xa2a9b,'name');_0x46b26f[_0xcf3f('0x30')]=_[_0xcf3f('0x31')](_0x49c043[_0xcf3f('0x30')]);_0x46b26f['filters']=_[_0xcf3f('0x32')](_0x46b26f['model'],_0x46b26f[_0xcf3f('0x30')]);_0x359baa[_0xcf3f('0x33')]=_[_0xcf3f('0x32')](_0x46b26f[_0xcf3f('0x2f')],qs[_0xcf3f('0x34')](_0x49c043['query'][_0xcf3f('0x34')]));_0x359baa[_0xcf3f('0x33')]=_0x359baa[_0xcf3f('0x33')]['length']?_0x359baa[_0xcf3f('0x33')]:_0x46b26f[_0xcf3f('0x2f')];if(!_0x49c043['query'][_0xcf3f('0x35')](_0xcf3f('0x36'))){_0x359baa[_0xcf3f('0x1e')]=qs[_0xcf3f('0x1e')](_0x49c043[_0xcf3f('0x30')][_0xcf3f('0x1e')]);_0x359baa[_0xcf3f('0x1c')]=qs[_0xcf3f('0x1c')](_0x49c043[_0xcf3f('0x30')][_0xcf3f('0x1c')]);}_0x359baa[_0xcf3f('0x37')]=qs[_0xcf3f('0x38')](_0x49c043[_0xcf3f('0x30')][_0xcf3f('0x38')]);_0x359baa[_0xcf3f('0x39')]=qs[_0xcf3f('0x3a')](_[_0xcf3f('0x3b')](_0x49c043[_0xcf3f('0x30')],_0x46b26f[_0xcf3f('0x3a')]),_0xa2a9b);if(_0x49c043[_0xcf3f('0x30')][_0xcf3f('0x3c')]){_0x359baa[_0xcf3f('0x39')]=_[_0xcf3f('0x3d')](_0x359baa['where'],{'$or':[{'key':{'$like':'%'+_0x49c043['query'][_0xcf3f('0x3c')]+'%'}},{'value':{'$like':'%'+_0x49c043[_0xcf3f('0x30')][_0xcf3f('0x3c')]+'%'}}]});}_0x359baa=_[_0xcf3f('0x3d')]({},_0x359baa,_0x49c043[_0xcf3f('0x3e')]);var _0x1d57aa={'where':_0x359baa[_0xcf3f('0x39')]};return db[_0xcf3f('0x2d')][_0xcf3f('0x1f')](_0x1d57aa)['then'](function(_0x5b44b7){_0x5b2ec6[_0xcf3f('0x1f')]=_0x5b44b7;if(_0x49c043[_0xcf3f('0x30')]['includeAll']){_0x359baa[_0xcf3f('0x3f')]=[{'all':!![]}];}return db[_0xcf3f('0x2d')][_0xcf3f('0x40')](_0x359baa);})[_0xcf3f('0x24')](function(_0x2a5ce8){_0x5b2ec6['rows']=_0x2a5ce8;return _0x5b2ec6;})[_0xcf3f('0x24')](respondWithFilteredResult(_0x4e3bae,_0x359baa))['catch'](handleError(_0x4e3bae,null));};exports[_0xcf3f('0x41')]=function(_0x522015,_0x479dad){var _0x202bd8={'raw':!![],'where':{'id':_0x522015[_0xcf3f('0x42')]['id']}},_0x2e3ce8={};_0x2e3ce8[_0xcf3f('0x2f')]=_['keys'](db[_0xcf3f('0x2d')]['rawAttributes']);_0x2e3ce8['query']=_[_0xcf3f('0x31')](_0x522015['query']);_0x2e3ce8[_0xcf3f('0x3a')]=_[_0xcf3f('0x32')](_0x2e3ce8[_0xcf3f('0x2f')],_0x2e3ce8['query']);_0x202bd8[_0xcf3f('0x33')]=_[_0xcf3f('0x32')](_0x2e3ce8[_0xcf3f('0x2f')],qs[_0xcf3f('0x34')](_0x522015[_0xcf3f('0x30')][_0xcf3f('0x34')]));_0x202bd8[_0xcf3f('0x33')]=_0x202bd8['attributes']['length']?_0x202bd8['attributes']:_0x2e3ce8[_0xcf3f('0x2f')];if(_0x522015[_0xcf3f('0x30')][_0xcf3f('0x43')]){_0x202bd8['include']=[{'all':!![]}];}_0x202bd8=_['merge']({},_0x202bd8,_0x522015[_0xcf3f('0x3e')]);return db[_0xcf3f('0x2d')][_0xcf3f('0x44')](_0x202bd8)[_0xcf3f('0x24')](handleEntityNotFound(_0x479dad,null))[_0xcf3f('0x24')](respondWithResult(_0x479dad,null))[_0xcf3f('0x45')](handleError(_0x479dad,null));};exports[_0xcf3f('0x46')]=function(_0x12901d,_0x1dc922){if(_0x12901d[_0xcf3f('0x47')]['id']){delete _0x12901d[_0xcf3f('0x47')]['id'];}return db['CannedAnswer'][_0xcf3f('0x44')]({'where':{'id':_0x12901d[_0xcf3f('0x42')]['id']}})[_0xcf3f('0x24')](handleEntityNotFound(_0x1dc922,null))[_0xcf3f('0x24')](saveUpdates(_0x12901d[_0xcf3f('0x47')],null))['then'](respondWithResult(_0x1dc922,null))['catch'](handleError(_0x1dc922,null));};exports[_0xcf3f('0x25')]=function(_0x12fbdb,_0x3effd5){return db[_0xcf3f('0x2d')]['find']({'where':{'id':_0x12fbdb['params']['id']}})['then'](handleEntityNotFound(_0x3effd5,null))['then'](removeEntity(_0x3effd5,null))[_0xcf3f('0x45')](handleError(_0x3effd5,null));};exports[_0xcf3f('0x48')]=function(_0x50c420,_0x27dc3c){var _0x4bd04d={'key':_0x50c420[_0xcf3f('0x47')][_0xcf3f('0x49')]};if(_0x50c420[_0xcf3f('0x47')]['MailAccountId']){_0x4bd04d[_0xcf3f('0x4a')]=_0x50c420['body'][_0xcf3f('0x4a')];}else if(_0x50c420[_0xcf3f('0x47')]['SmsAccountId']){_0x4bd04d[_0xcf3f('0x4b')]=_0x50c420[_0xcf3f('0x47')][_0xcf3f('0x4b')];}else if(_0x50c420[_0xcf3f('0x47')][_0xcf3f('0x4c')]){_0x4bd04d[_0xcf3f('0x4c')]=_0x50c420[_0xcf3f('0x47')][_0xcf3f('0x4c')];}else if(_0x50c420['body']['ChatWebsiteId']){_0x4bd04d[_0xcf3f('0x4d')]=_0x50c420['body'][_0xcf3f('0x4d')];}return db[_0xcf3f('0x2d')]['find']({'where':_0x4bd04d})['then'](function(_0x1566cc){if(_0x1566cc){throw new db['Sequelize'][(_0xcf3f('0x4e'))](_0xcf3f('0x4f'));}return db[_0xcf3f('0x2d')][_0xcf3f('0x48')](_0x50c420['body']);})[_0xcf3f('0x24')](function(_0x526032){var _0x501932=_0x50c420[_0xcf3f('0x50')][_0xcf3f('0x51')]({'plain':!![]});if(!_0x501932)throw new Error(_0xcf3f('0x52'));if(_0x501932[_0xcf3f('0x53')]==='user'){var _0x101e4c=_0x526032['get']({'plain':!![]});return db[_0xcf3f('0x54')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x501932[_0xcf3f('0x55')]},'raw':!![]})[_0xcf3f('0x24')](function(_0x22f850){if(_0x22f850&&_0x22f850[_0xcf3f('0x56')]===0x0){return db[_0xcf3f('0x26')]['create']({'name':_0x101e4c[_0xcf3f('0x29')],'resourceId':_0x101e4c['id'],'type':_0x22f850[_0xcf3f('0x29')],'sectionId':_0x22f850['id']},{})[_0xcf3f('0x24')](function(){return _0x526032;});}else{return _0x526032;}})[_0xcf3f('0x45')](function(_0x8f2dc2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x8f2dc2);throw _0x8f2dc2;});}return _0x526032;})[_0xcf3f('0x24')](respondWithResult(_0x27dc3c,0xc9))[_0xcf3f('0x45')](handleError(_0x27dc3c,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 34c3137..9f014f8 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 _0xd592=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CannedAnswer','tools_canned_answers'];(function(_0x119f3c,_0x4bee97){var _0x335bfc=function(_0x2102cd){while(--_0x2102cd){_0x119f3c['push'](_0x119f3c['shift']());}};_0x335bfc(++_0x4bee97);}(_0xd592,0x97));var _0x2d59=function(_0x26c264,_0xd8bc65){_0x26c264=_0x26c264-0x0;var _0x2a40a4=_0xd592[_0x26c264];return _0x2a40a4;};'use strict';var _=require(_0x2d59('0x0'));var util=require(_0x2d59('0x1'));var logger=require(_0x2d59('0x2'))(_0x2d59('0x3'));var moment=require(_0x2d59('0x4'));var BPromise=require(_0x2d59('0x5'));var rp=require(_0x2d59('0x6'));var fs=require('fs');var path=require(_0x2d59('0x7'));var rimraf=require(_0x2d59('0x8'));var config=require(_0x2d59('0x9'));var attributes=require('./cannedAnswer.attributes');module[_0x2d59('0xa')]=function(_0x5f059b,_0x44f619){return _0x5f059b[_0x2d59('0xb')](_0x2d59('0xc'),attributes,{'tableName':_0x2d59('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2d59('0xe')});};
\ No newline at end of file
+var _0x4e16=['CannedAnswer','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','exports','define'];(function(_0x28e919,_0x145939){var _0x692b7e=function(_0x1514ae){while(--_0x1514ae){_0x28e919['push'](_0x28e919['shift']());}};_0x692b7e(++_0x145939);}(_0x4e16,0x1ee));var _0x64e1=function(_0x1af572,_0x1d11c5){_0x1af572=_0x1af572-0x0;var _0x2cf6bf=_0x4e16[_0x1af572];return _0x2cf6bf;};'use strict';var _=require(_0x64e1('0x0'));var util=require(_0x64e1('0x1'));var logger=require(_0x64e1('0x2'))(_0x64e1('0x3'));var moment=require(_0x64e1('0x4'));var BPromise=require('bluebird');var rp=require(_0x64e1('0x5'));var fs=require('fs');var path=require(_0x64e1('0x6'));var rimraf=require(_0x64e1('0x7'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0x64e1('0x8')]=function(_0x58dad6,_0x4f05ae){return _0x58dad6[_0x64e1('0x9')](_0x64e1('0xa'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x64e1('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 9787022..725cc74 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(_0x30d199,_0x287cb0){var _0x5c465d=function(_0x4bc356){while(--_0x4bc356){_0x30d199['push'](_0x30d199['shift']());}};_0x5c465d(++_0x287cb0);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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(_0x2fe6a5,_0x259962){var _0x3af016=function(_0x63b950){while(--_0x63b950){_0x2fe6a5['push'](_0x2fe6a5['shift']());}};_0x3af016(++_0x259962);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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 ba0e9b4..76726e3 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 _0x8c26=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','create','put','delete','destroy'];(function(_0x52ef9a,_0x312e31){var _0x424c2b=function(_0x231947){while(--_0x231947){_0x52ef9a['push'](_0x52ef9a['shift']());}};_0x424c2b(++_0x312e31);}(_0x8c26,0x1e1));var _0x68c2=function(_0x5e31d6,_0x238cb5){_0x5e31d6=_0x5e31d6-0x0;var _0x2e206a=_0x8c26[_0x5e31d6];return _0x2e206a;};'use strict';var multer=require(_0x68c2('0x0'));var util=require(_0x68c2('0x1'));var path=require(_0x68c2('0x2'));var timeout=require(_0x68c2('0x3'));var express=require('express');var router=express[_0x68c2('0x4')]();var fs_extra=require(_0x68c2('0x5'));var auth=require(_0x68c2('0x6'));var interaction=require(_0x68c2('0x7'));var config=require(_0x68c2('0x8'));var controller=require(_0x68c2('0x9'));router[_0x68c2('0xa')]('/',auth['isAuthenticated'](),controller[_0x68c2('0xb')]);router['get'](_0x68c2('0xc'),auth[_0x68c2('0xd')](),controller[_0x68c2('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x68c2('0xf')]);router[_0x68c2('0x10')]('/:id',auth[_0x68c2('0xd')](),controller['update']);router[_0x68c2('0x11')](_0x68c2('0xc'),auth[_0x68c2('0xd')](),controller[_0x68c2('0x12')]);module[_0x68c2('0x13')]=router;
\ No newline at end of file
+var _0x3e26=['show','post','create','isAuthenticated','update','delete','/:id','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get'];(function(_0x1e48d9,_0x5df5d8){var _0x20255c=function(_0x4d20a2){while(--_0x4d20a2){_0x1e48d9['push'](_0x1e48d9['shift']());}};_0x20255c(++_0x5df5d8);}(_0x3e26,0x13a));var _0x63e2=function(_0xc0737c,_0xee6126){_0xc0737c=_0xc0737c-0x0;var _0x541d26=_0x3e26[_0xc0737c];return _0x541d26;};'use strict';var multer=require(_0x63e2('0x0'));var util=require('util');var path=require(_0x63e2('0x1'));var timeout=require(_0x63e2('0x2'));var express=require(_0x63e2('0x3'));var router=express[_0x63e2('0x4')]();var fs_extra=require(_0x63e2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x63e2('0x6'));var config=require(_0x63e2('0x7'));var controller=require(_0x63e2('0x8'));router[_0x63e2('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x63e2('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x63e2('0xa')]);router[_0x63e2('0xb')]('/',auth['isAuthenticated'](),controller[_0x63e2('0xc')]);router['put']('/:id',auth[_0x63e2('0xd')](),controller[_0x63e2('0xe')]);router[_0x63e2('0xf')](_0x63e2('0x10'),auth['isAuthenticated'](),controller[_0x63e2('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index f8a5ac7..7b7feb0 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 _0x6449=['1970-01-01\x2000:00:01','STRING','INTEGER','exports','DATE'];(function(_0x504b50,_0x3ee98c){var _0x4f627c=function(_0x3120cf){while(--_0x3120cf){_0x504b50['push'](_0x504b50['shift']());}};_0x4f627c(++_0x3ee98c);}(_0x6449,0xee));var _0x9644=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x6449[_0x88cd7b];return _0x56fcc8;};'use strict';var Sequelize=require('sequelize');module[_0x9644('0x0')]={'calldate':{'type':Sequelize[_0x9644('0x1')],'allowNull':![],'defaultValue':_0x9644('0x2')},'clid':{'type':Sequelize[_0x9644('0x3')]},'src':{'type':Sequelize[_0x9644('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x9644('0x3')]},'channel':{'type':Sequelize[_0x9644('0x3')]},'dstchannel':{'type':Sequelize[_0x9644('0x3')]},'lastapp':{'type':Sequelize[_0x9644('0x3')]},'lastdata':{'type':Sequelize[_0x9644('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x9644('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x9644('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x9644('0x3')]},'userfield':{'type':Sequelize[_0x9644('0x3')]},'uniqueid':{'type':Sequelize[_0x9644('0x3')]},'linkedid':{'type':Sequelize[_0x9644('0x3')]},'sequence':{'type':Sequelize[_0x9644('0x3')]},'peeraccount':{'type':Sequelize[_0x9644('0x3')]},'type':{'type':Sequelize[_0x9644('0x3')]},'tag':{'type':Sequelize[_0x9644('0x3')]}};
\ No newline at end of file
+var _0x0194=['INTEGER','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x2634a7,_0x118508){var _0xa52e2c=function(_0x400f75){while(--_0x400f75){_0x2634a7['push'](_0x2634a7['shift']());}};_0xa52e2c(++_0x118508);}(_0x0194,0xf1));var _0x4019=function(_0x26a8e9,_0x2013a1){_0x26a8e9=_0x26a8e9-0x0;var _0x17333a=_0x0194[_0x26a8e9];return _0x17333a;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x4019('0x0')],'allowNull':![],'defaultValue':_0x4019('0x1')},'clid':{'type':Sequelize[_0x4019('0x2')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x4019('0x2')]},'dcontext':{'type':Sequelize[_0x4019('0x2')]},'channel':{'type':Sequelize[_0x4019('0x2')]},'dstchannel':{'type':Sequelize[_0x4019('0x2')]},'lastapp':{'type':Sequelize[_0x4019('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x4019('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x4019('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x4019('0x2')]},'amaflags':{'type':Sequelize[_0x4019('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x4019('0x2')]},'uniqueid':{'type':Sequelize[_0x4019('0x2')]},'linkedid':{'type':Sequelize[_0x4019('0x2')]},'sequence':{'type':Sequelize[_0x4019('0x2')]},'peeraccount':{'type':Sequelize[_0x4019('0x2')]},'type':{'type':Sequelize[_0x4019('0x2')]},'tag':{'type':Sequelize[_0x4019('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 66690b5..996626d 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 _0x7a59=['describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','type','query','filters','model','intersection','fields','attributes','length','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','Cdr','findAll','show','params','keys','include','find','create','body','catch','update'];(function(_0x272700,_0x525483){var _0x3927a4=function(_0x5a98e0){while(--_0x5a98e0){_0x272700['push'](_0x272700['shift']());}};_0x3927a4(++_0x525483);}(_0x7a59,0x16e));var _0x97a5=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x7a59[_0x2be8c2];return _0x97f531;};'use strict';var emlformat=require(_0x97a5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x97a5('0x1'));var rp=require(_0x97a5('0x2'));var moment=require(_0x97a5('0x3'));var BPromise=require(_0x97a5('0x4'));var Mustache=require(_0x97a5('0x5'));var util=require('util');var path=require(_0x97a5('0x6'));var sox=require(_0x97a5('0x7'));var csv=require(_0x97a5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97a5('0x9'));var _=require(_0x97a5('0xa'));var squel=require(_0x97a5('0xb'));var crypto=require(_0x97a5('0xc'));var jsforce=require(_0x97a5('0xd'));var deskjs=require(_0x97a5('0xe'));var toCsv=require(_0x97a5('0x8'));var querystring=require('querystring');var Papa=require(_0x97a5('0xf'));var Redis=require(_0x97a5('0x10'));var authService=require(_0x97a5('0x11'));var qs=require(_0x97a5('0x12'));var as=require(_0x97a5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x97a5('0x14'));var utils=require(_0x97a5('0x15'));var config=require(_0x97a5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x97a5('0x17'))['db'];function respondWithStatusCode(_0x350720,_0x55305a){_0x55305a=_0x55305a||0xcc;return function(_0x4f85a0){if(_0x4f85a0){return _0x350720[_0x97a5('0x18')](_0x55305a);}return _0x350720[_0x97a5('0x19')](_0x55305a)['end']();};}function respondWithResult(_0x595437,_0x51d5e2){_0x51d5e2=_0x51d5e2||0xc8;return function(_0x5a4471){if(_0x5a4471){return _0x595437[_0x97a5('0x19')](_0x51d5e2)[_0x97a5('0x1a')](_0x5a4471);}};}function respondWithFilteredResult(_0x3603e4,_0x4d8ba7){return function(_0x1a7a62){if(_0x1a7a62){var _0x3fa986=typeof _0x4d8ba7['offset']===_0x97a5('0x1b')&&typeof _0x4d8ba7['limit']===_0x97a5('0x1b');var _0x55071b=_0x1a7a62['count'];var _0x52ce92=_0x3fa986?0x0:_0x4d8ba7[_0x97a5('0x1c')];var _0x5c5740=_0x3fa986?_0x1a7a62[_0x97a5('0x1d')]:_0x4d8ba7[_0x97a5('0x1c')]+_0x4d8ba7[_0x97a5('0x1e')];var _0x1efe8c;if(_0x5c5740>=_0x55071b){_0x5c5740=_0x55071b;_0x1efe8c=0xc8;}else{_0x1efe8c=0xce;}_0x3603e4['status'](_0x1efe8c);return _0x3603e4['set'](_0x97a5('0x1f'),_0x52ce92+'-'+_0x5c5740+'/'+_0x55071b)[_0x97a5('0x1a')](_0x1a7a62);}return null;};}function patchUpdates(_0x4e3386){return function(_0x51858b){try{jsonpatch[_0x97a5('0x20')](_0x51858b,_0x4e3386,!![]);}catch(_0x3d7dba){return BPromise[_0x97a5('0x21')](_0x3d7dba);}return _0x51858b['save']();};}function saveUpdates(_0x34fb55,_0x3a5849){return function(_0x23f4f8){if(_0x23f4f8){return _0x23f4f8['update'](_0x34fb55)[_0x97a5('0x22')](function(_0x33d6da){return _0x33d6da;});}return null;};}function removeEntity(_0x4e2074,_0x5e731e){return function(_0x469592){if(_0x469592){return _0x469592[_0x97a5('0x23')]()[_0x97a5('0x22')](function(){_0x4e2074[_0x97a5('0x19')](0xcc)[_0x97a5('0x24')]();});}};}function handleEntityNotFound(_0x302d78,_0xf7ad1e){return function(_0x4743e0){if(!_0x4743e0){_0x302d78['sendStatus'](0x194);}return _0x4743e0;};}function handleError(_0x2038dd,_0x46ee45){_0x46ee45=_0x46ee45||0x1f4;return function(_0x2ca97c){logger[_0x97a5('0x25')](_0x2ca97c[_0x97a5('0x26')]);if(_0x2ca97c[_0x97a5('0x27')]){delete _0x2ca97c['name'];}_0x2038dd[_0x97a5('0x19')](_0x46ee45)[_0x97a5('0x28')](_0x2ca97c);};}exports['index']=function(_0x274ccb,_0x52248f){var _0x48f1c1={},_0x1bdb74={},_0x2eaae4={'count':0x0,'rows':[]};var _0x5c1c67=_[_0x97a5('0x29')](db['Cdr'][_0x97a5('0x2a')],function(_0x3c5d02){return{'name':_0x3c5d02[_0x97a5('0x2b')],'type':_0x3c5d02[_0x97a5('0x2c')]['key']};});_0x1bdb74['model']=_[_0x97a5('0x29')](_0x5c1c67,_0x97a5('0x27'));_0x1bdb74[_0x97a5('0x2d')]=_['keys'](_0x274ccb[_0x97a5('0x2d')]);_0x1bdb74[_0x97a5('0x2e')]=_['intersection'](_0x1bdb74[_0x97a5('0x2f')],_0x1bdb74[_0x97a5('0x2d')]);_0x48f1c1['attributes']=_[_0x97a5('0x30')](_0x1bdb74[_0x97a5('0x2f')],qs[_0x97a5('0x31')](_0x274ccb['query'][_0x97a5('0x31')]));_0x48f1c1[_0x97a5('0x32')]=_0x48f1c1[_0x97a5('0x32')][_0x97a5('0x33')]?_0x48f1c1[_0x97a5('0x32')]:_0x1bdb74[_0x97a5('0x2f')];if(!_0x274ccb[_0x97a5('0x2d')]['hasOwnProperty'](_0x97a5('0x34'))){_0x48f1c1[_0x97a5('0x1e')]=qs[_0x97a5('0x1e')](_0x274ccb[_0x97a5('0x2d')][_0x97a5('0x1e')]);_0x48f1c1[_0x97a5('0x1c')]=qs[_0x97a5('0x1c')](_0x274ccb[_0x97a5('0x2d')][_0x97a5('0x1c')]);}_0x48f1c1[_0x97a5('0x35')]=qs[_0x97a5('0x36')](_0x274ccb[_0x97a5('0x2d')][_0x97a5('0x36')]);_0x48f1c1['where']=qs[_0x97a5('0x2e')](_[_0x97a5('0x37')](_0x274ccb[_0x97a5('0x2d')],_0x1bdb74[_0x97a5('0x2e')]),_0x5c1c67);if(_0x274ccb[_0x97a5('0x2d')]['filter']){_0x48f1c1['where']=_[_0x97a5('0x38')](_0x48f1c1[_0x97a5('0x39')],{'$or':_[_0x97a5('0x29')](_0x5c1c67,function(_0x45a548){if(_0x45a548[_0x97a5('0x2c')]!==_0x97a5('0x3a')){var _0x57333b={};_0x57333b[_0x45a548[_0x97a5('0x27')]]={'$like':'%'+_0x274ccb['query'][_0x97a5('0x3b')]+'%'};return _0x57333b;}})});}_0x48f1c1=_[_0x97a5('0x38')]({},_0x48f1c1,_0x274ccb[_0x97a5('0x3c')]);var _0x798318={'where':_0x48f1c1[_0x97a5('0x39')]};return db['Cdr'][_0x97a5('0x1d')](_0x798318)[_0x97a5('0x22')](function(_0x64505){_0x2eaae4[_0x97a5('0x1d')]=_0x64505;if(_0x274ccb[_0x97a5('0x2d')]['includeAll']){_0x48f1c1['include']=[{'all':!![]}];}return db[_0x97a5('0x3d')][_0x97a5('0x3e')](_0x48f1c1);})[_0x97a5('0x22')](function(_0x20dbc6){_0x2eaae4['rows']=_0x20dbc6;return _0x2eaae4;})[_0x97a5('0x22')](respondWithFilteredResult(_0x52248f,_0x48f1c1))['catch'](handleError(_0x52248f,null));};exports[_0x97a5('0x3f')]=function(_0x331108,_0x111e72){var _0x5baf77={'raw':!![],'where':{'id':_0x331108[_0x97a5('0x40')]['id']}},_0xefb019={};_0xefb019['model']=_[_0x97a5('0x41')](db[_0x97a5('0x3d')][_0x97a5('0x2a')]);_0xefb019[_0x97a5('0x2d')]=_[_0x97a5('0x41')](_0x331108[_0x97a5('0x2d')]);_0xefb019[_0x97a5('0x2e')]=_[_0x97a5('0x30')](_0xefb019[_0x97a5('0x2f')],_0xefb019[_0x97a5('0x2d')]);_0x5baf77[_0x97a5('0x32')]=_[_0x97a5('0x30')](_0xefb019['model'],qs[_0x97a5('0x31')](_0x331108[_0x97a5('0x2d')][_0x97a5('0x31')]));_0x5baf77['attributes']=_0x5baf77[_0x97a5('0x32')][_0x97a5('0x33')]?_0x5baf77[_0x97a5('0x32')]:_0xefb019[_0x97a5('0x2f')];if(_0x331108[_0x97a5('0x2d')]['includeAll']){_0x5baf77[_0x97a5('0x42')]=[{'all':!![]}];}_0x5baf77=_[_0x97a5('0x38')]({},_0x5baf77,_0x331108[_0x97a5('0x3c')]);return db[_0x97a5('0x3d')][_0x97a5('0x43')](_0x5baf77)['then'](handleEntityNotFound(_0x111e72,null))[_0x97a5('0x22')](respondWithResult(_0x111e72,null))['catch'](handleError(_0x111e72,null));};exports[_0x97a5('0x44')]=function(_0x235f9d,_0x330f6a){return db['Cdr'][_0x97a5('0x44')](_0x235f9d[_0x97a5('0x45')],{})[_0x97a5('0x22')](respondWithResult(_0x330f6a,0xc9))[_0x97a5('0x46')](handleError(_0x330f6a,null));};exports[_0x97a5('0x47')]=function(_0x42ced6,_0x49b215){if(_0x42ced6[_0x97a5('0x45')]['id']){delete _0x42ced6[_0x97a5('0x45')]['id'];}return db[_0x97a5('0x3d')][_0x97a5('0x43')]({'where':{'id':_0x42ced6['params']['id']}})[_0x97a5('0x22')](handleEntityNotFound(_0x49b215,null))[_0x97a5('0x22')](saveUpdates(_0x42ced6['body'],null))[_0x97a5('0x22')](respondWithResult(_0x49b215,null))[_0x97a5('0x46')](handleError(_0x49b215,null));};exports[_0x97a5('0x23')]=function(_0x56890f,_0x2a6fa0){return db[_0x97a5('0x3d')]['find']({'where':{'id':_0x56890f[_0x97a5('0x40')]['id']}})[_0x97a5('0x22')](handleEntityNotFound(_0x2a6fa0,null))[_0x97a5('0x22')](removeEntity(_0x2a6fa0,null))['catch'](handleError(_0x2a6fa0,null));};exports[_0x97a5('0x48')]=function(_0xc3c9e5,_0x7adad){return db['Cdr']['describe']()[_0x97a5('0x22')](respondWithResult(_0x7adad,null))[_0x97a5('0x46')](handleError(_0x7adad,null));};
\ No newline at end of file
+var _0xc492=['findAll','rows','catch','params','includeAll','find','body','describe','eml-format','rimraf','zip-dir','moment','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','Cdr','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include'];(function(_0x5da9e1,_0xc580f8){var _0x21a139=function(_0x35b0cd){while(--_0x35b0cd){_0x5da9e1['push'](_0x5da9e1['shift']());}};_0x21a139(++_0xc580f8);}(_0xc492,0xd7));var _0x2c49=function(_0x38d465,_0x5ba8f2){_0x38d465=_0x38d465-0x0;var _0x3056d1=_0xc492[_0x38d465];return _0x3056d1;};'use strict';var emlformat=require(_0x2c49('0x0'));var rimraf=require(_0x2c49('0x1'));var zipdir=require(_0x2c49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2c49('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2c49('0x4'));var path=require(_0x2c49('0x5'));var sox=require('sox');var csv=require(_0x2c49('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c49('0x7'));var _=require(_0x2c49('0x8'));var squel=require('squel');var crypto=require(_0x2c49('0x9'));var jsforce=require(_0x2c49('0xa'));var deskjs=require(_0x2c49('0xb'));var toCsv=require(_0x2c49('0x6'));var querystring=require(_0x2c49('0xc'));var Papa=require('papaparse');var Redis=require(_0x2c49('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2c49('0xe'))('api');var utils=require(_0x2c49('0xf'));var config=require(_0x2c49('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x2c49('0x11'))['db'];function respondWithStatusCode(_0x1cc78b,_0x19f7d9){_0x19f7d9=_0x19f7d9||0xcc;return function(_0x1e2210){if(_0x1e2210){return _0x1cc78b[_0x2c49('0x12')](_0x19f7d9);}return _0x1cc78b[_0x2c49('0x13')](_0x19f7d9)['end']();};}function respondWithResult(_0x2006cf,_0x5af5e7){_0x5af5e7=_0x5af5e7||0xc8;return function(_0x2eeb10){if(_0x2eeb10){return _0x2006cf[_0x2c49('0x13')](_0x5af5e7)[_0x2c49('0x14')](_0x2eeb10);}};}function respondWithFilteredResult(_0x561d83,_0x19f59b){return function(_0x385724){if(_0x385724){var _0x30da01=typeof _0x19f59b[_0x2c49('0x15')]===_0x2c49('0x16')&&typeof _0x19f59b[_0x2c49('0x17')]===_0x2c49('0x16');var _0x2e2e07=_0x385724[_0x2c49('0x18')];var _0x89bcb=_0x30da01?0x0:_0x19f59b['offset'];var _0x3001af=_0x30da01?_0x385724[_0x2c49('0x18')]:_0x19f59b[_0x2c49('0x15')]+_0x19f59b[_0x2c49('0x17')];var _0x4793d5;if(_0x3001af>=_0x2e2e07){_0x3001af=_0x2e2e07;_0x4793d5=0xc8;}else{_0x4793d5=0xce;}_0x561d83[_0x2c49('0x13')](_0x4793d5);return _0x561d83['set'](_0x2c49('0x19'),_0x89bcb+'-'+_0x3001af+'/'+_0x2e2e07)[_0x2c49('0x14')](_0x385724);}return null;};}function patchUpdates(_0x573157){return function(_0x4b8f61){try{jsonpatch[_0x2c49('0x1a')](_0x4b8f61,_0x573157,!![]);}catch(_0x3bda90){return BPromise[_0x2c49('0x1b')](_0x3bda90);}return _0x4b8f61[_0x2c49('0x1c')]();};}function saveUpdates(_0x202205,_0x294c70){return function(_0x33c09f){if(_0x33c09f){return _0x33c09f[_0x2c49('0x1d')](_0x202205)[_0x2c49('0x1e')](function(_0x54fe21){return _0x54fe21;});}return null;};}function removeEntity(_0x14ca06,_0x20f3bf){return function(_0x4037b0){if(_0x4037b0){return _0x4037b0[_0x2c49('0x1f')]()['then'](function(){_0x14ca06[_0x2c49('0x13')](0xcc)[_0x2c49('0x20')]();});}};}function handleEntityNotFound(_0x3a35b4,_0x2a9109){return function(_0x59c061){if(!_0x59c061){_0x3a35b4[_0x2c49('0x12')](0x194);}return _0x59c061;};}function handleError(_0x18a41e,_0x25bf3d){_0x25bf3d=_0x25bf3d||0x1f4;return function(_0x50da06){logger[_0x2c49('0x21')](_0x50da06[_0x2c49('0x22')]);if(_0x50da06['name']){delete _0x50da06[_0x2c49('0x23')];}_0x18a41e['status'](_0x25bf3d)['send'](_0x50da06);};}exports[_0x2c49('0x24')]=function(_0x4d2564,_0x5c4fb1){var _0x4d9334={},_0x433503={},_0x7b8d75={'count':0x0,'rows':[]};var _0x2b2dd5=_[_0x2c49('0x25')](db[_0x2c49('0x26')][_0x2c49('0x27')],function(_0x131c06){return{'name':_0x131c06[_0x2c49('0x28')],'type':_0x131c06[_0x2c49('0x29')][_0x2c49('0x2a')]};});_0x433503['model']=_[_0x2c49('0x25')](_0x2b2dd5,'name');_0x433503[_0x2c49('0x2b')]=_[_0x2c49('0x2c')](_0x4d2564[_0x2c49('0x2b')]);_0x433503[_0x2c49('0x2d')]=_[_0x2c49('0x2e')](_0x433503[_0x2c49('0x2f')],_0x433503[_0x2c49('0x2b')]);_0x4d9334[_0x2c49('0x30')]=_[_0x2c49('0x2e')](_0x433503[_0x2c49('0x2f')],qs[_0x2c49('0x31')](_0x4d2564[_0x2c49('0x2b')][_0x2c49('0x31')]));_0x4d9334[_0x2c49('0x30')]=_0x4d9334['attributes']['length']?_0x4d9334[_0x2c49('0x30')]:_0x433503[_0x2c49('0x2f')];if(!_0x4d2564['query'][_0x2c49('0x32')](_0x2c49('0x33'))){_0x4d9334[_0x2c49('0x17')]=qs[_0x2c49('0x17')](_0x4d2564[_0x2c49('0x2b')][_0x2c49('0x17')]);_0x4d9334[_0x2c49('0x15')]=qs[_0x2c49('0x15')](_0x4d2564['query'][_0x2c49('0x15')]);}_0x4d9334[_0x2c49('0x34')]=qs['sort'](_0x4d2564[_0x2c49('0x2b')][_0x2c49('0x35')]);_0x4d9334[_0x2c49('0x36')]=qs['filters'](_[_0x2c49('0x37')](_0x4d2564[_0x2c49('0x2b')],_0x433503[_0x2c49('0x2d')]),_0x2b2dd5);if(_0x4d2564[_0x2c49('0x2b')][_0x2c49('0x38')]){_0x4d9334[_0x2c49('0x36')]=_['merge'](_0x4d9334[_0x2c49('0x36')],{'$or':_[_0x2c49('0x25')](_0x2b2dd5,function(_0x4cbfe4){if(_0x4cbfe4[_0x2c49('0x29')]!==_0x2c49('0x39')){var _0x52f123={};_0x52f123[_0x4cbfe4[_0x2c49('0x23')]]={'$like':'%'+_0x4d2564['query'][_0x2c49('0x38')]+'%'};return _0x52f123;}})});}_0x4d9334=_[_0x2c49('0x3a')]({},_0x4d9334,_0x4d2564[_0x2c49('0x3b')]);var _0x5a6822={'where':_0x4d9334[_0x2c49('0x36')]};return db['Cdr'][_0x2c49('0x18')](_0x5a6822)[_0x2c49('0x1e')](function(_0x24e53a){_0x7b8d75[_0x2c49('0x18')]=_0x24e53a;if(_0x4d2564[_0x2c49('0x2b')]['includeAll']){_0x4d9334[_0x2c49('0x3c')]=[{'all':!![]}];}return db[_0x2c49('0x26')][_0x2c49('0x3d')](_0x4d9334);})[_0x2c49('0x1e')](function(_0x251c8d){_0x7b8d75[_0x2c49('0x3e')]=_0x251c8d;return _0x7b8d75;})[_0x2c49('0x1e')](respondWithFilteredResult(_0x5c4fb1,_0x4d9334))[_0x2c49('0x3f')](handleError(_0x5c4fb1,null));};exports['show']=function(_0xa912b8,_0x30e892){var _0x5b1ee0={'raw':!![],'where':{'id':_0xa912b8[_0x2c49('0x40')]['id']}},_0x2a21b9={};_0x2a21b9['model']=_[_0x2c49('0x2c')](db['Cdr']['rawAttributes']);_0x2a21b9['query']=_['keys'](_0xa912b8[_0x2c49('0x2b')]);_0x2a21b9[_0x2c49('0x2d')]=_[_0x2c49('0x2e')](_0x2a21b9[_0x2c49('0x2f')],_0x2a21b9[_0x2c49('0x2b')]);_0x5b1ee0['attributes']=_['intersection'](_0x2a21b9['model'],qs['fields'](_0xa912b8[_0x2c49('0x2b')]['fields']));_0x5b1ee0[_0x2c49('0x30')]=_0x5b1ee0['attributes']['length']?_0x5b1ee0['attributes']:_0x2a21b9[_0x2c49('0x2f')];if(_0xa912b8['query'][_0x2c49('0x41')]){_0x5b1ee0[_0x2c49('0x3c')]=[{'all':!![]}];}_0x5b1ee0=_['merge']({},_0x5b1ee0,_0xa912b8['options']);return db[_0x2c49('0x26')][_0x2c49('0x42')](_0x5b1ee0)[_0x2c49('0x1e')](handleEntityNotFound(_0x30e892,null))[_0x2c49('0x1e')](respondWithResult(_0x30e892,null))[_0x2c49('0x3f')](handleError(_0x30e892,null));};exports['create']=function(_0x50dce4,_0x426c8a){return db[_0x2c49('0x26')]['create'](_0x50dce4['body'],{})['then'](respondWithResult(_0x426c8a,0xc9))[_0x2c49('0x3f')](handleError(_0x426c8a,null));};exports[_0x2c49('0x1d')]=function(_0x98fc90,_0x55e4cd){if(_0x98fc90[_0x2c49('0x43')]['id']){delete _0x98fc90[_0x2c49('0x43')]['id'];}return db[_0x2c49('0x26')][_0x2c49('0x42')]({'where':{'id':_0x98fc90[_0x2c49('0x40')]['id']}})[_0x2c49('0x1e')](handleEntityNotFound(_0x55e4cd,null))[_0x2c49('0x1e')](saveUpdates(_0x98fc90['body'],null))['then'](respondWithResult(_0x55e4cd,null))['catch'](handleError(_0x55e4cd,null));};exports[_0x2c49('0x1f')]=function(_0x1aa034,_0x5385e5){return db[_0x2c49('0x26')][_0x2c49('0x42')]({'where':{'id':_0x1aa034[_0x2c49('0x40')]['id']}})[_0x2c49('0x1e')](handleEntityNotFound(_0x5385e5,null))[_0x2c49('0x1e')](removeEntity(_0x5385e5,null))[_0x2c49('0x3f')](handleError(_0x5385e5,null));};exports[_0x2c49('0x44')]=function(_0x11878d,_0x331519){return db[_0x2c49('0x26')]['describe']()[_0x2c49('0x1e')](respondWithResult(_0x331519,null))[_0x2c49('0x3f')](handleError(_0x331519,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 526a101..0bc5f16 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x3bbce0,_0x1a8d2c){var _0x40a716=function(_0x28c470){while(--_0x28c470){_0x3bbce0['push'](_0x3bbce0['shift']());}};_0x40a716(++_0x1a8d2c);}(_0x7a54,0x106));var _0x47a5=function(_0x26ac6e,_0xb38c5e){_0x26ac6e=_0x26ac6e-0x0;var _0x275731=_0x7a54[_0x26ac6e];return _0x275731;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x9fbc99,_0x4a758f){var _0x15b10e=function(_0x2a1203){while(--_0x2a1203){_0x9fbc99['push'](_0x9fbc99['shift']());}};_0x15b10e(++_0x4a758f);}(_0x7a54,0x106));var _0x47a5=function(_0x462f99,_0xf86909){_0x462f99=_0x462f99-0x0;var _0x40977e=_0x7a54[_0x462f99];return _0x40977e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 88064a0..c1b4a01 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 _0x3e55=['code','Cdr,\x20%s,\x20%s','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xd4fcd0,_0x10ed9c){var _0x841d2=function(_0x5e6054){while(--_0x5e6054){_0xd4fcd0['push'](_0xd4fcd0['shift']());}};_0x841d2(++_0x10ed9c);}(_0x3e55,0x9e));var _0x53e5=function(_0x333690,_0x33b5cb){_0x333690=_0x333690-0x0;var _0x33b681=_0x3e55[_0x333690];return _0x33b681;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x53e5('0x0'));var BPromise=require(_0x53e5('0x1'));var rs=require(_0x53e5('0x2'));var fs=require('fs');var Redis=require(_0x53e5('0x3'));var db=require(_0x53e5('0x4'))['db'];var utils=require(_0x53e5('0x5'));var logger=require('../../config/logger')(_0x53e5('0x6'));var config=require('../../config/environment');var jayson=require(_0x53e5('0x7'));var client=jayson[_0x53e5('0x8')][_0x53e5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a1158,_0x44b561,_0x4479cd){return new BPromise(function(_0x5f33ad,_0x11fa2c){return client[_0x53e5('0xa')](_0x1a1158,_0x4479cd)[_0x53e5('0xb')](function(_0x195d2f){logger[_0x53e5('0xc')]('Cdr,\x20%s,\x20%s',_0x44b561,_0x53e5('0xd'));logger[_0x53e5('0xe')](_0x53e5('0xf'),_0x44b561,'request\x20sent',JSON[_0x53e5('0x10')](_0x195d2f));if(_0x195d2f[_0x53e5('0x11')]){if(_0x195d2f[_0x53e5('0x11')][_0x53e5('0x12')]===0x1f4){logger['error'](_0x53e5('0x13'),_0x44b561,_0x195d2f[_0x53e5('0x11')][_0x53e5('0x14')]);return _0x11fa2c(_0x195d2f['error'][_0x53e5('0x14')]);}logger[_0x53e5('0x11')](_0x53e5('0x13'),_0x44b561,_0x195d2f[_0x53e5('0x11')]['message']);return _0x5f33ad(_0x195d2f[_0x53e5('0x11')]['message']);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x44b561,_0x53e5('0xd'));_0x5f33ad(_0x195d2f[_0x53e5('0x15')][_0x53e5('0x14')]);}})['catch'](function(_0x20393e){logger[_0x53e5('0x11')](_0x53e5('0x13'),_0x44b561,_0x20393e);_0x11fa2c(_0x20393e);});});}
\ No newline at end of file
+var _0x24ed=['rpc','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','randomstring','ioredis','../../config/logger'];(function(_0x445819,_0x11b666){var _0x160c43=function(_0x22e9fa){while(--_0x22e9fa){_0x445819['push'](_0x445819['shift']());}};_0x160c43(++_0x11b666);}(_0x24ed,0x19d));var _0xd24e=function(_0x2127c7,_0x1d65c1){_0x2127c7=_0x2127c7-0x0;var _0x57f014=_0x24ed[_0x2127c7];return _0x57f014;};'use strict';var _=require(_0xd24e('0x0'));var util=require(_0xd24e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd24e('0x2'));var fs=require('fs');var Redis=require(_0xd24e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd24e('0x4'))(_0xd24e('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd24e('0x6')][_0xd24e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x350315,_0x2b77da,_0x35a09f){return new BPromise(function(_0x14b35b,_0x333eca){return client[_0xd24e('0x8')](_0x350315,_0x35a09f)[_0xd24e('0x9')](function(_0x1f8a7a){logger[_0xd24e('0xa')](_0xd24e('0xb'),_0x2b77da,_0xd24e('0xc'));logger[_0xd24e('0xd')]('Cdr,\x20%s,\x20%s,\x20%s',_0x2b77da,_0xd24e('0xc'),JSON[_0xd24e('0xe')](_0x1f8a7a));if(_0x1f8a7a[_0xd24e('0xf')]){if(_0x1f8a7a[_0xd24e('0xf')][_0xd24e('0x10')]===0x1f4){logger[_0xd24e('0xf')](_0xd24e('0xb'),_0x2b77da,_0x1f8a7a[_0xd24e('0xf')][_0xd24e('0x11')]);return _0x333eca(_0x1f8a7a[_0xd24e('0xf')][_0xd24e('0x11')]);}logger['error'](_0xd24e('0xb'),_0x2b77da,_0x1f8a7a[_0xd24e('0xf')]['message']);return _0x14b35b(_0x1f8a7a[_0xd24e('0xf')][_0xd24e('0x11')]);}else{logger['info'](_0xd24e('0xb'),_0x2b77da,_0xd24e('0xc'));_0x14b35b(_0x1f8a7a[_0xd24e('0x12')][_0xd24e('0x11')]);}})['catch'](function(_0x38d987){logger[_0xd24e('0xf')]('Cdr,\x20%s,\x20%s',_0x2b77da,_0x38d987);_0x333eca(_0x38d987);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 0e8b163..53e8b8b 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(_0x39eaf1,_0x56f6b9){var _0x116705=function(_0x242c21){while(--_0x242c21){_0x39eaf1['push'](_0x39eaf1['shift']());}};_0x116705(++_0x56f6b9);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _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(_0x14bf66,_0x3e1066){var _0xaf4bf7=function(_0x3d9c3f){while(--_0x3d9c3f){_0x14bf66['push'](_0x14bf66['shift']());}};_0xaf4bf7(++_0x3e1066);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index e844475..47ac788 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 _0xdb9c=['TEXT','exports','STRING'];(function(_0x534027,_0x381ca3){var _0x2c8b53=function(_0x3f8343){while(--_0x3f8343){_0x534027['push'](_0x534027['shift']());}};_0x2c8b53(++_0x381ca3);}(_0xdb9c,0x1cf));var _0xcdb9=function(_0x21a897,_0xfde1f8){_0x21a897=_0x21a897-0x0;var _0x1d841c=_0xdb9c[_0x21a897];return _0x1d841c;};'use strict';var Sequelize=require('sequelize');module[_0xcdb9('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xcdb9('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xcdb9('0x2')]()},'description':{'type':Sequelize[_0xcdb9('0x1')]},'interval':{'type':Sequelize[_0xcdb9('0x1')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xfe16=['exports','STRING','noop','TEXT','sequelize'];(function(_0x1efb7e,_0x50cfa0){var _0x27aa56=function(_0x53fb85){while(--_0x53fb85){_0x1efb7e['push'](_0x1efb7e['shift']());}};_0x27aa56(++_0x50cfa0);}(_0xfe16,0x1bc));var _0x6fe1=function(_0x272786,_0x1e2aec){_0x272786=_0x272786-0x0;var _0x42bb92=_0xfe16[_0x272786];return _0x42bb92;};'use strict';var Sequelize=require(_0x6fe1('0x0'));module[_0x6fe1('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x6fe1('0x2')],'allowNull':![],'defaultValue':_0x6fe1('0x3')},'appdata':{'type':Sequelize[_0x6fe1('0x4')]()},'description':{'type':Sequelize[_0x6fe1('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index e3cf006..ec9704a 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 _0x847d=['sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','name','send','show','keys','ChatApplication','rawAttributes','query','filters','intersection','model','attributes','fields','length','includeAll','merge','find','catch','body','params','rimraf','zip-dir','fast-json-patch','moment','mustache','util'];(function(_0x210d00,_0x2a89a3){var _0x53db70=function(_0x5655d1){while(--_0x5655d1){_0x210d00['push'](_0x210d00['shift']());}};_0x53db70(++_0x2a89a3);}(_0x847d,0x14a));var _0xd847=function(_0x466af7,_0x2f7551){_0x466af7=_0x466af7-0x0;var _0x348c96=_0x847d[_0x466af7];return _0x348c96;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd847('0x0'));var zipdir=require(_0xd847('0x1'));var jsonpatch=require(_0xd847('0x2'));var rp=require('request-promise');var moment=require(_0xd847('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd847('0x4'));var util=require(_0xd847('0x5'));var path=require('path');var sox=require(_0xd847('0x6'));var csv=require(_0xd847('0x7'));var ejs=require(_0xd847('0x8'));var fs=require('fs');var fs_extra=require(_0xd847('0x9'));var _=require('lodash');var squel=require(_0xd847('0xa'));var crypto=require(_0xd847('0xb'));var jsforce=require(_0xd847('0xc'));var deskjs=require(_0xd847('0xd'));var toCsv=require(_0xd847('0x7'));var querystring=require(_0xd847('0xe'));var Papa=require(_0xd847('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd847('0x10'));var logger=require(_0xd847('0x11'))(_0xd847('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd847('0x13'));var db=require(_0xd847('0x14'))['db'];function respondWithStatusCode(_0x344d39,_0x2ea8e7){_0x2ea8e7=_0x2ea8e7||0xcc;return function(_0x1e4e26){if(_0x1e4e26){return _0x344d39[_0xd847('0x15')](_0x2ea8e7);}return _0x344d39[_0xd847('0x16')](_0x2ea8e7)[_0xd847('0x17')]();};}function respondWithResult(_0x1c827a,_0x2faa39){_0x2faa39=_0x2faa39||0xc8;return function(_0x3c4805){if(_0x3c4805){return _0x1c827a['status'](_0x2faa39)[_0xd847('0x18')](_0x3c4805);}};}function respondWithFilteredResult(_0x165fbe,_0xd69fc9){return function(_0x404bdb){if(_0x404bdb){var _0x16c79a=typeof _0xd69fc9['offset']===_0xd847('0x19')&&typeof _0xd69fc9[_0xd847('0x1a')]===_0xd847('0x19');var _0x1a01ad=_0x404bdb['count'];var _0x1ef765=_0x16c79a?0x0:_0xd69fc9['offset'];var _0x4b6264=_0x16c79a?_0x404bdb[_0xd847('0x1b')]:_0xd69fc9[_0xd847('0x1c')]+_0xd69fc9[_0xd847('0x1a')];var _0x3905b8;if(_0x4b6264>=_0x1a01ad){_0x4b6264=_0x1a01ad;_0x3905b8=0xc8;}else{_0x3905b8=0xce;}_0x165fbe['status'](_0x3905b8);return _0x165fbe[_0xd847('0x1d')]('Content-Range',_0x1ef765+'-'+_0x4b6264+'/'+_0x1a01ad)['json'](_0x404bdb);}return null;};}function patchUpdates(_0x25e139){return function(_0x2c1091){try{jsonpatch[_0xd847('0x1e')](_0x2c1091,_0x25e139,!![]);}catch(_0x2a57df){return BPromise[_0xd847('0x1f')](_0x2a57df);}return _0x2c1091[_0xd847('0x20')]();};}function saveUpdates(_0x1490a1,_0x39c465){return function(_0x1eaf08){if(_0x1eaf08){return _0x1eaf08[_0xd847('0x21')](_0x1490a1)[_0xd847('0x22')](function(_0x3795fc){return _0x3795fc;});}return null;};}function removeEntity(_0x4a1691,_0x560563){return function(_0x26a787){if(_0x26a787){return _0x26a787[_0xd847('0x23')]()[_0xd847('0x22')](function(){_0x4a1691['status'](0xcc)[_0xd847('0x17')]();});}};}function handleEntityNotFound(_0x246920,_0x74bf0e){return function(_0x64b701){if(!_0x64b701){_0x246920[_0xd847('0x15')](0x194);}return _0x64b701;};}function handleError(_0x5b8e2a,_0x24793c){_0x24793c=_0x24793c||0x1f4;return function(_0x460eba){logger[_0xd847('0x24')](_0x460eba['stack']);if(_0x460eba[_0xd847('0x25')]){delete _0x460eba[_0xd847('0x25')];}_0x5b8e2a[_0xd847('0x16')](_0x24793c)[_0xd847('0x26')](_0x460eba);};}exports[_0xd847('0x27')]=function(_0x3301cd,_0x5c0099){var _0x1e6119={'raw':!![],'where':{'id':_0x3301cd['params']['id']}},_0x5375fe={};_0x5375fe['model']=_[_0xd847('0x28')](db[_0xd847('0x29')][_0xd847('0x2a')]);_0x5375fe[_0xd847('0x2b')]=_[_0xd847('0x28')](_0x3301cd[_0xd847('0x2b')]);_0x5375fe[_0xd847('0x2c')]=_[_0xd847('0x2d')](_0x5375fe[_0xd847('0x2e')],_0x5375fe[_0xd847('0x2b')]);_0x1e6119[_0xd847('0x2f')]=_[_0xd847('0x2d')](_0x5375fe['model'],qs['fields'](_0x3301cd[_0xd847('0x2b')][_0xd847('0x30')]));_0x1e6119[_0xd847('0x2f')]=_0x1e6119[_0xd847('0x2f')][_0xd847('0x31')]?_0x1e6119['attributes']:_0x5375fe[_0xd847('0x2e')];if(_0x3301cd['query'][_0xd847('0x32')]){_0x1e6119['include']=[{'all':!![]}];}_0x1e6119=_[_0xd847('0x33')]({},_0x1e6119,_0x3301cd['options']);return db[_0xd847('0x29')][_0xd847('0x34')](_0x1e6119)['then'](handleEntityNotFound(_0x5c0099,null))['then'](respondWithResult(_0x5c0099,null))[_0xd847('0x35')](handleError(_0x5c0099,null));};exports[_0xd847('0x21')]=function(_0x429bb5,_0x2d2c94){if(_0x429bb5[_0xd847('0x36')]['id']){delete _0x429bb5[_0xd847('0x36')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x429bb5[_0xd847('0x37')]['id']}})[_0xd847('0x22')](handleEntityNotFound(_0x2d2c94,null))[_0xd847('0x22')](saveUpdates(_0x429bb5['body'],null))[_0xd847('0x22')](respondWithResult(_0x2d2c94,null))[_0xd847('0x35')](handleError(_0x2d2c94,null));};exports['destroy']=function(_0x547794,_0x3e5590){return db['ChatApplication'][_0xd847('0x34')]({'where':{'id':_0x547794[_0xd847('0x37')]['id']}})[_0xd847('0x22')](handleEntityNotFound(_0x3e5590,null))['then'](removeEntity(_0x3e5590,null))['catch'](handleError(_0x3e5590,null));};
\ No newline at end of file
+var _0x30fe=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','count','status','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','model','keys','ChatApplication','rawAttributes','query','filters','attributes','intersection','fields','includeAll','merge','options','find','catch','body','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x30fe,0x149));var _0xe30f=function(_0x86e191,_0x585a70){_0x86e191=_0x86e191-0x0;var _0x286b0b=_0x30fe[_0x86e191];return _0x286b0b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe30f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe30f('0x1'));var rp=require('request-promise');var moment=require(_0xe30f('0x2'));var BPromise=require(_0xe30f('0x3'));var Mustache=require(_0xe30f('0x4'));var util=require(_0xe30f('0x5'));var path=require(_0xe30f('0x6'));var sox=require('sox');var csv=require(_0xe30f('0x7'));var ejs=require(_0xe30f('0x8'));var fs=require('fs');var fs_extra=require(_0xe30f('0x9'));var _=require(_0xe30f('0xa'));var squel=require(_0xe30f('0xb'));var crypto=require(_0xe30f('0xc'));var jsforce=require(_0xe30f('0xd'));var deskjs=require(_0xe30f('0xe'));var toCsv=require(_0xe30f('0x7'));var querystring=require(_0xe30f('0xf'));var Papa=require('papaparse');var Redis=require(_0xe30f('0x10'));var authService=require(_0xe30f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe30f('0x12'));var hardwareService=require(_0xe30f('0x13'));var logger=require(_0xe30f('0x14'))(_0xe30f('0x15'));var utils=require('../../config/utils');var config=require(_0xe30f('0x16'));var licenseUtil=require(_0xe30f('0x17'));var db=require(_0xe30f('0x18'))['db'];function respondWithStatusCode(_0x583eb9,_0x3859df){_0x3859df=_0x3859df||0xcc;return function(_0x19970e){if(_0x19970e){return _0x583eb9[_0xe30f('0x19')](_0x3859df);}return _0x583eb9['status'](_0x3859df)[_0xe30f('0x1a')]();};}function respondWithResult(_0x460e07,_0x122e2a){_0x122e2a=_0x122e2a||0xc8;return function(_0x7d684c){if(_0x7d684c){return _0x460e07['status'](_0x122e2a)['json'](_0x7d684c);}};}function respondWithFilteredResult(_0x5ac4b2,_0x3c9680){return function(_0x494ad3){if(_0x494ad3){var _0x2b6a9b=typeof _0x3c9680[_0xe30f('0x1b')]==='undefined'&&typeof _0x3c9680[_0xe30f('0x1c')]==='undefined';var _0x2dbb2b=_0x494ad3[_0xe30f('0x1d')];var _0x406c98=_0x2b6a9b?0x0:_0x3c9680[_0xe30f('0x1b')];var _0x17024a=_0x2b6a9b?_0x494ad3['count']:_0x3c9680['offset']+_0x3c9680[_0xe30f('0x1c')];var _0x535873;if(_0x17024a>=_0x2dbb2b){_0x17024a=_0x2dbb2b;_0x535873=0xc8;}else{_0x535873=0xce;}_0x5ac4b2[_0xe30f('0x1e')](_0x535873);return _0x5ac4b2['set'](_0xe30f('0x1f'),_0x406c98+'-'+_0x17024a+'/'+_0x2dbb2b)[_0xe30f('0x20')](_0x494ad3);}return null;};}function patchUpdates(_0x2c4d1f){return function(_0x2a0432){try{jsonpatch[_0xe30f('0x21')](_0x2a0432,_0x2c4d1f,!![]);}catch(_0x5b33fa){return BPromise[_0xe30f('0x22')](_0x5b33fa);}return _0x2a0432['save']();};}function saveUpdates(_0xf66c5a,_0x5af7b5){return function(_0x322ee0){if(_0x322ee0){return _0x322ee0[_0xe30f('0x23')](_0xf66c5a)[_0xe30f('0x24')](function(_0x42833a){return _0x42833a;});}return null;};}function removeEntity(_0x7f7b1f,_0x378d6f){return function(_0x50bca4){if(_0x50bca4){return _0x50bca4[_0xe30f('0x25')]()['then'](function(){_0x7f7b1f[_0xe30f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d4fbe,_0x4fc220){return function(_0x11a539){if(!_0x11a539){_0x4d4fbe['sendStatus'](0x194);}return _0x11a539;};}function handleError(_0x412015,_0x25e3cf){_0x25e3cf=_0x25e3cf||0x1f4;return function(_0x37c716){logger[_0xe30f('0x26')](_0x37c716[_0xe30f('0x27')]);if(_0x37c716[_0xe30f('0x28')]){delete _0x37c716['name'];}_0x412015[_0xe30f('0x1e')](_0x25e3cf)[_0xe30f('0x29')](_0x37c716);};}exports['show']=function(_0x15a217,_0x2d67d4){var _0x5a6cc3={'raw':!![],'where':{'id':_0x15a217['params']['id']}},_0x500626={};_0x500626[_0xe30f('0x2a')]=_[_0xe30f('0x2b')](db[_0xe30f('0x2c')][_0xe30f('0x2d')]);_0x500626[_0xe30f('0x2e')]=_[_0xe30f('0x2b')](_0x15a217['query']);_0x500626[_0xe30f('0x2f')]=_['intersection'](_0x500626[_0xe30f('0x2a')],_0x500626[_0xe30f('0x2e')]);_0x5a6cc3[_0xe30f('0x30')]=_[_0xe30f('0x31')](_0x500626['model'],qs[_0xe30f('0x32')](_0x15a217[_0xe30f('0x2e')][_0xe30f('0x32')]));_0x5a6cc3['attributes']=_0x5a6cc3[_0xe30f('0x30')]['length']?_0x5a6cc3[_0xe30f('0x30')]:_0x500626[_0xe30f('0x2a')];if(_0x15a217[_0xe30f('0x2e')][_0xe30f('0x33')]){_0x5a6cc3['include']=[{'all':!![]}];}_0x5a6cc3=_[_0xe30f('0x34')]({},_0x5a6cc3,_0x15a217[_0xe30f('0x35')]);return db[_0xe30f('0x2c')][_0xe30f('0x36')](_0x5a6cc3)[_0xe30f('0x24')](handleEntityNotFound(_0x2d67d4,null))[_0xe30f('0x24')](respondWithResult(_0x2d67d4,null))[_0xe30f('0x37')](handleError(_0x2d67d4,null));};exports['update']=function(_0x139915,_0xcc659c){if(_0x139915[_0xe30f('0x38')]['id']){delete _0x139915['body']['id'];}return db[_0xe30f('0x2c')][_0xe30f('0x36')]({'where':{'id':_0x139915['params']['id']}})[_0xe30f('0x24')](handleEntityNotFound(_0xcc659c,null))['then'](saveUpdates(_0x139915[_0xe30f('0x38')],null))['then'](respondWithResult(_0xcc659c,null))['catch'](handleError(_0xcc659c,null));};exports['destroy']=function(_0xf09327,_0x86fbbc){return db['ChatApplication'][_0xe30f('0x36')]({'where':{'id':_0xf09327['params']['id']}})[_0xe30f('0x24')](handleEntityNotFound(_0x86fbbc,null))[_0xe30f('0x24')](removeEntity(_0x86fbbc,null))[_0xe30f('0x37')](handleError(_0x86fbbc,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 39a8224..36003f2 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 _0x3423=['exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x431640,_0x1bd49a){var _0xd9dd62=function(_0x418069){while(--_0x418069){_0x431640['push'](_0x431640['shift']());}};_0xd9dd62(++_0x1bd49a);}(_0x3423,0x1f0));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3342('0x0'));var util=require(_0x3342('0x1'));var logger=require('../../config/logger')(_0x3342('0x2'));var moment=require(_0x3342('0x3'));var BPromise=require(_0x3342('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3342('0x5'));var rimraf=require(_0x3342('0x6'));var config=require(_0x3342('0x7'));var attributes=require('./chatApplication.attributes');module[_0x3342('0x8')]=function(_0x43d55b,_0x3a56ff){return _0x43d55b[_0x3342('0x9')](_0x3342('0xa'),attributes,{'tableName':_0x3342('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3342('0xc'),'collate':_0x3342('0xd')});};
\ No newline at end of file
+var _0x8e18=['ChatApplication','utf8mb4','util','api','moment','bluebird','rimraf','../../config/environment','./chatApplication.attributes','exports','define'];(function(_0x5f0e72,_0x25c3c4){var _0x239cd6=function(_0x40b044){while(--_0x40b044){_0x5f0e72['push'](_0x5f0e72['shift']());}};_0x239cd6(++_0x25c3c4);}(_0x8e18,0x1ba));var _0x88e1=function(_0x1350d2,_0x3d09c){_0x1350d2=_0x1350d2-0x0;var _0x1c8f51=_0x8e18[_0x1350d2];return _0x1c8f51;};'use strict';var _=require('lodash');var util=require(_0x88e1('0x0'));var logger=require('../../config/logger')(_0x88e1('0x1'));var moment=require(_0x88e1('0x2'));var BPromise=require(_0x88e1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x88e1('0x4'));var config=require(_0x88e1('0x5'));var attributes=require(_0x88e1('0x6'));module[_0x88e1('0x7')]=function(_0xf4e5e6,_0x146671){return _0xf4e5e6[_0x88e1('0x8')](_0x88e1('0x9'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x88e1('0xa'),'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 03a140b..9cf7651 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 _0x21e5=['http','request','then','info','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','randomstring','ioredis','rpc','client'];(function(_0x251e8c,_0x277c33){var _0x1e0c1d=function(_0x20b89c){while(--_0x20b89c){_0x251e8c['push'](_0x251e8c['shift']());}};_0x1e0c1d(++_0x277c33);}(_0x21e5,0x172));var _0x521e=function(_0x11155f,_0x57b687){_0x11155f=_0x11155f-0x0;var _0xd07e48=_0x21e5[_0x11155f];return _0xd07e48;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x521e('0x0'));var fs=require('fs');var Redis=require(_0x521e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x521e('0x2'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x521e('0x3')][_0x521e('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x469924,_0x79be67,_0x5da1a7){return new BPromise(function(_0x465446,_0x47e015){return client[_0x521e('0x5')](_0x469924,_0x5da1a7)[_0x521e('0x6')](function(_0x3d8726){logger[_0x521e('0x7')]('ChatApplication,\x20%s,\x20%s',_0x79be67,'request\x20sent');logger[_0x521e('0x8')](_0x521e('0x9'),_0x79be67,_0x521e('0xa'),JSON['stringify'](_0x3d8726));if(_0x3d8726[_0x521e('0xb')]){if(_0x3d8726[_0x521e('0xb')][_0x521e('0xc')]===0x1f4){logger[_0x521e('0xb')](_0x521e('0xd'),_0x79be67,_0x3d8726['error'][_0x521e('0xe')]);return _0x47e015(_0x3d8726['error'][_0x521e('0xe')]);}logger[_0x521e('0xb')](_0x521e('0xd'),_0x79be67,_0x3d8726[_0x521e('0xb')][_0x521e('0xe')]);return _0x465446(_0x3d8726[_0x521e('0xb')][_0x521e('0xe')]);}else{logger['info'](_0x521e('0xd'),_0x79be67,_0x521e('0xa'));_0x465446(_0x3d8726[_0x521e('0xf')][_0x521e('0xe')]);}})[_0x521e('0x10')](function(_0x4fb816){logger['error'](_0x521e('0xd'),_0x79be67,_0x4fb816);_0x47e015(_0x4fb816);});});}
\ No newline at end of file
+var _0xf8bc=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x2f6c38,_0x4b067a){var _0x66279f=function(_0x13c4b5){while(--_0x13c4b5){_0x2f6c38['push'](_0x2f6c38['shift']());}};_0x66279f(++_0x4b067a);}(_0xf8bc,0x165));var _0xcf8b=function(_0x4b12ae,_0xf2b3b){_0x4b12ae=_0x4b12ae-0x0;var _0x16957b=_0xf8bc[_0x4b12ae];return _0x16957b;};'use strict';var _=require(_0xcf8b('0x0'));var util=require(_0xcf8b('0x1'));var moment=require(_0xcf8b('0x2'));var BPromise=require(_0xcf8b('0x3'));var rs=require(_0xcf8b('0x4'));var fs=require('fs');var Redis=require(_0xcf8b('0x5'));var db=require(_0xcf8b('0x6'))['db'];var utils=require(_0xcf8b('0x7'));var logger=require('../../config/logger')(_0xcf8b('0x8'));var config=require(_0xcf8b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xcf8b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x183078,_0x23d532,_0x454cf6){return new BPromise(function(_0x2cbe74,_0x667e2f){return client[_0xcf8b('0xb')](_0x183078,_0x454cf6)['then'](function(_0x19063e){logger[_0xcf8b('0xc')](_0xcf8b('0xd'),_0x23d532,_0xcf8b('0xe'));logger[_0xcf8b('0xf')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x23d532,_0xcf8b('0xe'),JSON[_0xcf8b('0x10')](_0x19063e));if(_0x19063e[_0xcf8b('0x11')]){if(_0x19063e['error'][_0xcf8b('0x12')]===0x1f4){logger['error'](_0xcf8b('0xd'),_0x23d532,_0x19063e[_0xcf8b('0x11')][_0xcf8b('0x13')]);return _0x667e2f(_0x19063e[_0xcf8b('0x11')][_0xcf8b('0x13')]);}logger[_0xcf8b('0x11')](_0xcf8b('0xd'),_0x23d532,_0x19063e[_0xcf8b('0x11')][_0xcf8b('0x13')]);return _0x2cbe74(_0x19063e['error'][_0xcf8b('0x13')]);}else{logger[_0xcf8b('0xc')](_0xcf8b('0xd'),_0x23d532,'request\x20sent');_0x2cbe74(_0x19063e[_0xcf8b('0x14')][_0xcf8b('0x13')]);}})['catch'](function(_0x1f6a31){logger[_0xcf8b('0x11')](_0xcf8b('0xd'),_0x23d532,_0x1f6a31);_0x667e2f(_0x1f6a31);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index baa34ba..f9f1e0c 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 _0x568d=['../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x246419,_0x554ea8){var _0x5c54c6=function(_0xc723fc){while(--_0xc723fc){_0x246419['push'](_0x246419['shift']());}};_0x5c54c6(++_0x554ea8);}(_0x568d,0xf9));var _0xd568=function(_0x7a35b1,_0x925417){_0x7a35b1=_0x7a35b1-0x0;var _0x3c4535=_0x568d[_0x7a35b1];return _0x3c4535;};'use strict';var multer=require(_0xd568('0x0'));var util=require(_0xd568('0x1'));var path=require(_0xd568('0x2'));var timeout=require('connect-timeout');var express=require(_0xd568('0x3'));var router=express[_0xd568('0x4')]();var fs_extra=require(_0xd568('0x5'));var auth=require(_0xd568('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd568('0x7'));var controller=require(_0xd568('0x8'));router[_0xd568('0x9')](_0xd568('0xa'),auth[_0xd568('0xb')](),controller[_0xd568('0xc')]);router[_0xd568('0xd')](_0xd568('0xa'),auth[_0xd568('0xb')](),controller['update']);router[_0xd568('0xe')](_0xd568('0xa'),auth[_0xd568('0xb')](),controller[_0xd568('0xf')]);module[_0xd568('0x10')]=router;
\ No newline at end of file
+var _0x7631=['multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','isAuthenticated','put','delete','/:id','destroy'];(function(_0x535596,_0x15c174){var _0x5751dd=function(_0x2b3a50){while(--_0x2b3a50){_0x535596['push'](_0x535596['shift']());}};_0x5751dd(++_0x15c174);}(_0x7631,0x108));var _0x1763=function(_0x43730d,_0x20829c){_0x43730d=_0x43730d-0x0;var _0x53353d=_0x7631[_0x43730d];return _0x53353d;};'use strict';var multer=require(_0x1763('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1763('0x1'));var express=require('express');var router=express[_0x1763('0x2')]();var fs_extra=require(_0x1763('0x3'));var auth=require(_0x1763('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1763('0x5'));var controller=require(_0x1763('0x6'));router['get']('/:id',auth[_0x1763('0x7')](),controller['show']);router[_0x1763('0x8')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x1763('0x9')](_0x1763('0xa'),auth[_0x1763('0x7')](),controller[_0x1763('0xb')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 7a2eed1..e1ace08 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 _0x4df9=['exports','BOOLEAN'];(function(_0x470f24,_0x2436a9){var _0x2c6fc8=function(_0x3ef190){while(--_0x3ef190){_0x470f24['push'](_0x470f24['shift']());}};_0x2c6fc8(++_0x2436a9);}(_0x4df9,0x19a));var _0x94df=function(_0x1654ec,_0x584374){_0x1654ec=_0x1654ec-0x0;var _0x329fbf=_0x4df9[_0x1654ec];return _0x329fbf;};'use strict';var Sequelize=require('sequelize');module[_0x94df('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x94df('0x1')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x2fb7=['exports','STRING','BOOLEAN'];(function(_0xd43aed,_0x556f54){var _0x4aa694=function(_0x56817d){while(--_0x56817d){_0xd43aed['push'](_0xd43aed['shift']());}};_0x4aa694(++_0x556f54);}(_0x2fb7,0x90));var _0x72fb=function(_0x2ca538,_0x123635){_0x2ca538=_0x2ca538-0x0;var _0x13fd09=_0x2fb7[_0x2ca538];return _0x13fd09;};'use strict';var Sequelize=require('sequelize');module[_0x72fb('0x0')]={'name':{'type':Sequelize[_0x72fb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x72fb('0x1')]},'write':{'type':Sequelize[_0x72fb('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index de02b90..69b21c3 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 _0xed08=['find','create','body','update','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','order','removeMembers','getMessages','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','then','destroy','error','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','length','include'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xed08,0x7a));var _0x8ed0=function(_0x54e29a,_0x1c9650){_0x54e29a=_0x54e29a-0x0;var _0x49bda7=_0xed08[_0x54e29a];return _0x49bda7;};'use strict';var emlformat=require(_0x8ed0('0x0'));var rimraf=require(_0x8ed0('0x1'));var zipdir=require(_0x8ed0('0x2'));var jsonpatch=require(_0x8ed0('0x3'));var rp=require('request-promise');var moment=require(_0x8ed0('0x4'));var BPromise=require(_0x8ed0('0x5'));var Mustache=require('mustache');var util=require(_0x8ed0('0x6'));var path=require('path');var sox=require(_0x8ed0('0x7'));var csv=require(_0x8ed0('0x8'));var ejs=require(_0x8ed0('0x9'));var fs=require('fs');var fs_extra=require(_0x8ed0('0xa'));var _=require('lodash');var squel=require(_0x8ed0('0xb'));var crypto=require('crypto');var jsforce=require(_0x8ed0('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8ed0('0xd'));var Papa=require(_0x8ed0('0xe'));var Redis=require(_0x8ed0('0xf'));var authService=require(_0x8ed0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8ed0('0x11'));var hardwareService=require(_0x8ed0('0x12'));var logger=require(_0x8ed0('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x8ed0('0x14'));var licenseUtil=require(_0x8ed0('0x15'));var db=require(_0x8ed0('0x16'))['db'];config[_0x8ed0('0x17')]=_[_0x8ed0('0x18')](config['redis'],{'host':_0x8ed0('0x19'),'port':0x18eb});var socket=require(_0x8ed0('0x1a'))(new Redis(config[_0x8ed0('0x17')]));require(_0x8ed0('0x1b'))['register'](socket);function respondWithStatusCode(_0x1aa3ac,_0x51e341){_0x51e341=_0x51e341||0xcc;return function(_0x5ead40){if(_0x5ead40){return _0x1aa3ac[_0x8ed0('0x1c')](_0x51e341);}return _0x1aa3ac[_0x8ed0('0x1d')](_0x51e341)[_0x8ed0('0x1e')]();};}function respondWithResult(_0x4644c4,_0x4dfb4b){_0x4dfb4b=_0x4dfb4b||0xc8;return function(_0x734a42){if(_0x734a42){return _0x4644c4['status'](_0x4dfb4b)['json'](_0x734a42);}};}function respondWithFilteredResult(_0x39c61c,_0x261b58){return function(_0x340a4a){if(_0x340a4a){var _0x2da6ce=typeof _0x261b58[_0x8ed0('0x1f')]===_0x8ed0('0x20')&&typeof _0x261b58['limit']==='undefined';var _0x1c6163=_0x340a4a['count'];var _0x524d7d=_0x2da6ce?0x0:_0x261b58[_0x8ed0('0x1f')];var _0x4768a3=_0x2da6ce?_0x340a4a[_0x8ed0('0x21')]:_0x261b58[_0x8ed0('0x1f')]+_0x261b58[_0x8ed0('0x22')];var _0x489ca0;if(_0x4768a3>=_0x1c6163){_0x4768a3=_0x1c6163;_0x489ca0=0xc8;}else{_0x489ca0=0xce;}_0x39c61c[_0x8ed0('0x1d')](_0x489ca0);return _0x39c61c[_0x8ed0('0x23')](_0x8ed0('0x24'),_0x524d7d+'-'+_0x4768a3+'/'+_0x1c6163)[_0x8ed0('0x25')](_0x340a4a);}return null;};}function patchUpdates(_0x587536){return function(_0x4d0111){try{jsonpatch['apply'](_0x4d0111,_0x587536,!![]);}catch(_0x434107){return BPromise[_0x8ed0('0x26')](_0x434107);}return _0x4d0111[_0x8ed0('0x27')]();};}function saveUpdates(_0x367fbf,_0x1ad4d5){return function(_0x41e011){if(_0x41e011){return _0x41e011['update'](_0x367fbf)[_0x8ed0('0x28')](function(_0x1297ec){return _0x1297ec;});}return null;};}function removeEntity(_0x3f015f,_0x41a340){return function(_0x4d7f62){if(_0x4d7f62){return _0x4d7f62[_0x8ed0('0x29')]()[_0x8ed0('0x28')](function(){_0x3f015f[_0x8ed0('0x1d')](0xcc)[_0x8ed0('0x1e')]();});}};}function handleEntityNotFound(_0x1045cb,_0x360ca5){return function(_0x55ce28){if(!_0x55ce28){_0x1045cb[_0x8ed0('0x1c')](0x194);}return _0x55ce28;};}function handleError(_0x389ac9,_0x33310f){_0x33310f=_0x33310f||0x1f4;return function(_0x329a17){logger[_0x8ed0('0x2a')](_0x329a17['stack']);if(_0x329a17[_0x8ed0('0x2b')]){delete _0x329a17[_0x8ed0('0x2b')];}_0x389ac9[_0x8ed0('0x1d')](_0x33310f)[_0x8ed0('0x2c')](_0x329a17);};}exports[_0x8ed0('0x2d')]=function(_0x47db4a,_0x2983db){var _0x5e93bc={},_0x1813d7={},_0x16b23a={'count':0x0,'rows':[]};var _0x4a2ebe=_[_0x8ed0('0x2e')](db[_0x8ed0('0x2f')][_0x8ed0('0x30')],function(_0x38d4a9){return{'name':_0x38d4a9[_0x8ed0('0x31')],'type':_0x38d4a9[_0x8ed0('0x32')][_0x8ed0('0x33')]};});_0x1813d7[_0x8ed0('0x34')]=_['map'](_0x4a2ebe,_0x8ed0('0x2b'));_0x1813d7['query']=_[_0x8ed0('0x35')](_0x47db4a['query']);_0x1813d7[_0x8ed0('0x36')]=_[_0x8ed0('0x37')](_0x1813d7[_0x8ed0('0x34')],_0x1813d7[_0x8ed0('0x38')]);_0x5e93bc[_0x8ed0('0x39')]=_[_0x8ed0('0x37')](_0x1813d7['model'],qs['fields'](_0x47db4a[_0x8ed0('0x38')][_0x8ed0('0x3a')]));_0x5e93bc[_0x8ed0('0x39')]=_0x5e93bc[_0x8ed0('0x39')]['length']?_0x5e93bc['attributes']:_0x1813d7[_0x8ed0('0x34')];if(!_0x47db4a['query'][_0x8ed0('0x3b')](_0x8ed0('0x3c'))){_0x5e93bc[_0x8ed0('0x22')]=qs[_0x8ed0('0x22')](_0x47db4a[_0x8ed0('0x38')][_0x8ed0('0x22')]);_0x5e93bc['offset']=qs[_0x8ed0('0x1f')](_0x47db4a['query']['offset']);}_0x5e93bc['order']=qs[_0x8ed0('0x3d')](_0x47db4a['query'][_0x8ed0('0x3d')]);_0x5e93bc[_0x8ed0('0x3e')]=qs[_0x8ed0('0x36')](_['pick'](_0x47db4a[_0x8ed0('0x38')],_0x1813d7[_0x8ed0('0x36')]),_0x4a2ebe);if(_0x47db4a[_0x8ed0('0x38')]['filter']){_0x5e93bc[_0x8ed0('0x3e')]=_['merge'](_0x5e93bc[_0x8ed0('0x3e')],{'$or':_[_0x8ed0('0x2e')](_0x4a2ebe,function(_0x1854d2){if(_0x1854d2['type']!==_0x8ed0('0x3f')){var _0xe6863b={};_0xe6863b[_0x1854d2[_0x8ed0('0x2b')]]={'$like':'%'+_0x47db4a[_0x8ed0('0x38')]['filter']+'%'};return _0xe6863b;}})});}_0x5e93bc=_[_0x8ed0('0x40')]({},_0x5e93bc,_0x47db4a[_0x8ed0('0x41')]);var _0x14e687={'where':_0x5e93bc[_0x8ed0('0x3e')]};return db[_0x8ed0('0x2f')][_0x8ed0('0x21')](_0x14e687)[_0x8ed0('0x28')](function(_0x580a30){_0x16b23a[_0x8ed0('0x21')]=_0x580a30;if(_0x47db4a[_0x8ed0('0x38')][_0x8ed0('0x42')]){_0x5e93bc['include']=[{'all':!![]}];}return db[_0x8ed0('0x2f')][_0x8ed0('0x43')](_0x5e93bc);})[_0x8ed0('0x28')](function(_0x1857f9){_0x16b23a[_0x8ed0('0x44')]=_0x1857f9;return _0x16b23a;})[_0x8ed0('0x28')](respondWithFilteredResult(_0x2983db,_0x5e93bc))[_0x8ed0('0x45')](handleError(_0x2983db,null));};exports[_0x8ed0('0x46')]=function(_0x1e5d58,_0x1a6bd8){var _0x10c2a6={'raw':!![],'where':{'id':_0x1e5d58[_0x8ed0('0x47')]['id']}},_0x202811={};_0x202811[_0x8ed0('0x34')]=_[_0x8ed0('0x35')](db[_0x8ed0('0x2f')][_0x8ed0('0x30')]);_0x202811['query']=_[_0x8ed0('0x35')](_0x1e5d58[_0x8ed0('0x38')]);_0x202811[_0x8ed0('0x36')]=_['intersection'](_0x202811[_0x8ed0('0x34')],_0x202811['query']);_0x10c2a6[_0x8ed0('0x39')]=_[_0x8ed0('0x37')](_0x202811[_0x8ed0('0x34')],qs['fields'](_0x1e5d58['query'][_0x8ed0('0x3a')]));_0x10c2a6[_0x8ed0('0x39')]=_0x10c2a6[_0x8ed0('0x39')][_0x8ed0('0x48')]?_0x10c2a6[_0x8ed0('0x39')]:_0x202811[_0x8ed0('0x34')];if(_0x1e5d58[_0x8ed0('0x38')]['includeAll']){_0x10c2a6[_0x8ed0('0x49')]=[{'all':!![]}];}_0x10c2a6=_['merge']({},_0x10c2a6,_0x1e5d58[_0x8ed0('0x41')]);return db['ChatGroup'][_0x8ed0('0x4a')](_0x10c2a6)[_0x8ed0('0x28')](handleEntityNotFound(_0x1a6bd8,null))[_0x8ed0('0x28')](respondWithResult(_0x1a6bd8,null))[_0x8ed0('0x45')](handleError(_0x1a6bd8,null));};exports[_0x8ed0('0x4b')]=function(_0x1d7851,_0x5c37af){return db['ChatGroup'][_0x8ed0('0x4b')](_0x1d7851[_0x8ed0('0x4c')],{})[_0x8ed0('0x28')](respondWithResult(_0x5c37af,0xc9))[_0x8ed0('0x45')](handleError(_0x5c37af,null));};exports[_0x8ed0('0x4d')]=function(_0x255f7f,_0x4cb4ca){if(_0x255f7f['body']['id']){delete _0x255f7f[_0x8ed0('0x4c')]['id'];}return db[_0x8ed0('0x2f')]['find']({'where':{'id':_0x255f7f['params']['id']}})[_0x8ed0('0x28')](handleEntityNotFound(_0x4cb4ca,null))[_0x8ed0('0x28')](saveUpdates(_0x255f7f['body'],null))['then'](respondWithResult(_0x4cb4ca,null))['catch'](handleError(_0x4cb4ca,null));};exports['destroy']=function(_0x193abb,_0x1b7d9e){return db[_0x8ed0('0x2f')][_0x8ed0('0x4a')]({'where':{'id':_0x193abb[_0x8ed0('0x47')]['id']}})['then'](handleEntityNotFound(_0x1b7d9e,null))['then'](removeEntity(_0x1b7d9e,null))['catch'](handleError(_0x1b7d9e,null));};exports[_0x8ed0('0x4e')]=function(_0x119fae,_0x5c1f1c){return db[_0x8ed0('0x2f')][_0x8ed0('0x4e')]()['then'](respondWithResult(_0x5c1f1c,null))['catch'](handleError(_0x5c1f1c,null));};exports[_0x8ed0('0x4f')]=function(_0x3a42ad,_0x380ac8,_0x32f3b1){return db[_0x8ed0('0x50')][_0x8ed0('0x21')]({'where':{'ChatGroupId':_0x3a42ad['params']['id'],'ToId':_0x3a42ad[_0x8ed0('0x51')]['id'],'read':![]}})[_0x8ed0('0x28')](function(_0x45e51a){return{'id':_[_0x8ed0('0x52')](_0x3a42ad[_0x8ed0('0x47')]['id']),'count':_0x45e51a};})['then'](respondWithResult(_0x380ac8,null))[_0x8ed0('0x45')](handleError(_0x380ac8,null));};exports[_0x8ed0('0x53')]=function(_0x3067e4,_0x271a6c,_0x4aaf1a){return db[_0x8ed0('0x2f')]['find']({'where':{'id':_0x3067e4['params']['id']}})[_0x8ed0('0x28')](handleEntityNotFound(_0x271a6c,null))[_0x8ed0('0x28')](function(_0x57f82a){if(_0x57f82a){return _0x57f82a['addMembers'](_0x3067e4[_0x8ed0('0x4c')][_0x8ed0('0x54')],_[_0x8ed0('0x55')](_0x3067e4['body'],[_0x8ed0('0x54'),'id'])||{});}})[_0x8ed0('0x28')](respondWithResult(_0x271a6c,null))['catch'](handleError(_0x271a6c,null));};exports[_0x8ed0('0x56')]=function(_0x15bdaa,_0x21f9e1,_0x137ef2){var _0x56c4a7={};var _0x57e080={};var _0x24fe7c;var _0x4c0ed5;return db['ChatGroup'][_0x8ed0('0x57')]({'where':{'id':_0x15bdaa['params']['id']}})[_0x8ed0('0x28')](handleEntityNotFound(_0x21f9e1,null))[_0x8ed0('0x28')](function(_0x349dd7){if(_0x349dd7){_0x24fe7c=_0x349dd7;_0x57e080['model']=_[_0x8ed0('0x35')](db[_0x8ed0('0x58')][_0x8ed0('0x30')]);_0x57e080[_0x8ed0('0x38')]=_[_0x8ed0('0x35')](_0x15bdaa[_0x8ed0('0x38')]);_0x57e080[_0x8ed0('0x36')]=_[_0x8ed0('0x37')](_0x57e080[_0x8ed0('0x34')],_0x57e080[_0x8ed0('0x38')]);_0x56c4a7[_0x8ed0('0x39')]=_[_0x8ed0('0x37')](_0x57e080[_0x8ed0('0x34')],qs[_0x8ed0('0x3a')](_0x15bdaa[_0x8ed0('0x38')][_0x8ed0('0x3a')]));_0x56c4a7[_0x8ed0('0x39')]=_0x56c4a7[_0x8ed0('0x39')][_0x8ed0('0x48')]?_0x56c4a7['attributes']:_0x57e080[_0x8ed0('0x34')];_0x56c4a7[_0x8ed0('0x59')]=qs['sort'](_0x15bdaa[_0x8ed0('0x38')]['sort']);_0x56c4a7[_0x8ed0('0x3e')]=qs[_0x8ed0('0x36')](_['pick'](_0x15bdaa[_0x8ed0('0x38')],_0x57e080[_0x8ed0('0x36')]));if(_0x15bdaa['query']['filter']){_0x56c4a7['where']=_[_0x8ed0('0x40')](_0x56c4a7['where'],{'$or':_[_0x8ed0('0x2e')](_0x56c4a7[_0x8ed0('0x39')],function(_0x3d1d47){var _0x21d3f7={};_0x21d3f7[_0x3d1d47]={'$like':'%'+_0x15bdaa[_0x8ed0('0x38')]['filter']+'%'};return _0x21d3f7;})});}_0x56c4a7=_[_0x8ed0('0x40')]({},_0x56c4a7,_0x15bdaa[_0x8ed0('0x41')]);return _0x24fe7c[_0x8ed0('0x56')](_0x56c4a7);}})[_0x8ed0('0x28')](function(_0x2d89e7){if(_0x2d89e7){_0x4c0ed5=_0x2d89e7[_0x8ed0('0x48')];if(!_0x15bdaa['query'][_0x8ed0('0x3b')](_0x8ed0('0x3c'))){_0x56c4a7[_0x8ed0('0x22')]=qs[_0x8ed0('0x22')](_0x15bdaa[_0x8ed0('0x38')]['limit']);_0x56c4a7[_0x8ed0('0x1f')]=qs['offset'](_0x15bdaa[_0x8ed0('0x38')][_0x8ed0('0x1f')]);}return _0x24fe7c[_0x8ed0('0x56')](_0x56c4a7);}})['then'](function(_0x27a577){if(_0x27a577){return _0x27a577?{'count':_0x4c0ed5,'rows':_0x27a577}:null;}})[_0x8ed0('0x28')](respondWithResult(_0x21f9e1,null))['catch'](handleError(_0x21f9e1,null));};exports[_0x8ed0('0x5a')]=function(_0x3dd1ac,_0xca2045,_0xd6da19){return db[_0x8ed0('0x2f')][_0x8ed0('0x4a')]({'where':{'id':_0x3dd1ac[_0x8ed0('0x47')]['id']}})[_0x8ed0('0x28')](handleEntityNotFound(_0xca2045,null))[_0x8ed0('0x28')](function(_0x172bbb){if(_0x172bbb){return _0x172bbb[_0x8ed0('0x5a')](_0x3dd1ac['query'][_0x8ed0('0x54')]);}})[_0x8ed0('0x28')](respondWithStatusCode(_0xca2045,null))[_0x8ed0('0x45')](handleError(_0xca2045,null));};exports['addMessage']=function(_0x16b0f9,_0x7a5396,_0x3719d6){if(_0x16b0f9[_0x8ed0('0x4c')]['id']){delete _0x16b0f9[_0x8ed0('0x4c')]['id'];}return db[_0x8ed0('0x2f')][_0x8ed0('0x4a')]({'where':{'id':_0x16b0f9['params']['id']}})[_0x8ed0('0x28')](handleEntityNotFound(_0x7a5396,null))[_0x8ed0('0x28')](function(_0x3a6b92){if(_0x3a6b92){_0x16b0f9['body']['ChatGroupId']=_0x3a6b92['id'];return db[_0x8ed0('0x50')]['create'](_0x16b0f9['body']);}})['then'](respondWithResult(_0x7a5396,null))[_0x8ed0('0x45')](handleError(_0x7a5396,null));};exports[_0x8ed0('0x5b')]=function(_0x9ba15,_0x54511a,_0x99334f){var _0x59a495={};var _0x3f8115={};var _0xfff855;var _0x287f34;return db['ChatGroup']['findOne']({'where':{'id':_0x9ba15[_0x8ed0('0x47')]['id']}})['then'](handleEntityNotFound(_0x54511a,null))['then'](function(_0x377d19){if(_0x377d19){_0xfff855=_0x377d19;_0x3f8115['model']=_[_0x8ed0('0x35')](db['ChatInternalMessage'][_0x8ed0('0x30')]);_0x3f8115[_0x8ed0('0x38')]=_[_0x8ed0('0x35')](_0x9ba15['query']);_0x3f8115['filters']=_[_0x8ed0('0x37')](_0x3f8115[_0x8ed0('0x34')],_0x3f8115['query']);_0x59a495['attributes']=_[_0x8ed0('0x37')](_0x3f8115[_0x8ed0('0x34')],qs['fields'](_0x9ba15[_0x8ed0('0x38')][_0x8ed0('0x3a')]));_0x59a495['attributes']=_0x59a495['attributes'][_0x8ed0('0x48')]?_0x59a495[_0x8ed0('0x39')]:_0x3f8115['model'];_0x59a495[_0x8ed0('0x59')]=qs[_0x8ed0('0x3d')](_0x9ba15['query'][_0x8ed0('0x3d')]);_0x59a495[_0x8ed0('0x3e')]=qs['filters'](_[_0x8ed0('0x5c')](_0x9ba15[_0x8ed0('0x38')],_0x3f8115['filters']));if(_0x9ba15['query'][_0x8ed0('0x5d')]){_0x59a495[_0x8ed0('0x3e')]=_['merge'](_0x59a495[_0x8ed0('0x3e')],{'$or':_['map'](_0x59a495[_0x8ed0('0x39')],function(_0x387d70){var _0x297e15={};_0x297e15[_0x387d70]={'$like':'%'+_0x9ba15['query']['filter']+'%'};return _0x297e15;})});}if(_0x9ba15['query'][_0x8ed0('0x5e')]){var _0x1b04ee=_0x9ba15[_0x8ed0('0x38')][_0x8ed0('0x5e')][_0x8ed0('0x5f')](',');var _0x4ab876={};_0x4ab876[_0x1b04ee[0x0]]={'$gte':moment(_0x1b04ee[0x1])[_0x8ed0('0x60')](_0x8ed0('0x61'))};_0x59a495[_0x8ed0('0x3e')]=_[_0x8ed0('0x40')](_0x59a495[_0x8ed0('0x3e')],_0x4ab876);}_0x59a495=_[_0x8ed0('0x40')]({},_0x59a495,_0x9ba15[_0x8ed0('0x41')]);return _0xfff855[_0x8ed0('0x5b')](_0x59a495);}})['then'](function(_0x381d8e){if(_0x381d8e){_0x287f34=_0x381d8e[_0x8ed0('0x48')];if(!_0x9ba15[_0x8ed0('0x38')][_0x8ed0('0x3b')](_0x8ed0('0x3c'))){_0x59a495[_0x8ed0('0x22')]=qs[_0x8ed0('0x22')](_0x9ba15[_0x8ed0('0x38')][_0x8ed0('0x22')]);_0x59a495['offset']=qs[_0x8ed0('0x1f')](_0x9ba15['query']['offset']);}return _0xfff855[_0x8ed0('0x5b')](_0x59a495);}})[_0x8ed0('0x28')](function(_0xa6e989){if(_0xa6e989){return _0xa6e989?{'count':_0x287f34,'rows':_0xa6e989}:null;}})[_0x8ed0('0x28')](respondWithResult(_0x54511a,null))['catch'](handleError(_0x54511a,null));};
\ No newline at end of file
+var _0x114c=['json','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','ChatGroup','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','limit','order','filters','filter','where','merge','map','options','includeAll','include','rows','catch','show','params','length','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','find','ids','getMembers','findOne','User','sort','pick','nolimit','removeMembers','ChatGroupId','getMessages','split','format','YYYY-MM-DD\x20HH:mm:ss','hasOwnProperty','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register','status','end','undefined','count','offset','Content-Range'];(function(_0x154f66,_0x116f85){var _0x3f947a=function(_0x1f671e){while(--_0x1f671e){_0x154f66['push'](_0x154f66['shift']());}};_0x3f947a(++_0x116f85);}(_0x114c,0x1bd));var _0xc114=function(_0x17cfbb,_0x1e6943){_0x17cfbb=_0x17cfbb-0x0;var _0xd149a6=_0x114c[_0x17cfbb];return _0xd149a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc114('0x0'));var zipdir=require(_0xc114('0x1'));var jsonpatch=require(_0xc114('0x2'));var rp=require('request-promise');var moment=require(_0xc114('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc114('0x4'));var util=require(_0xc114('0x5'));var path=require(_0xc114('0x6'));var sox=require(_0xc114('0x7'));var csv=require(_0xc114('0x8'));var ejs=require(_0xc114('0x9'));var fs=require('fs');var fs_extra=require(_0xc114('0xa'));var _=require(_0xc114('0xb'));var squel=require(_0xc114('0xc'));var crypto=require(_0xc114('0xd'));var jsforce=require(_0xc114('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc114('0x8'));var querystring=require(_0xc114('0xf'));var Papa=require(_0xc114('0x10'));var Redis=require(_0xc114('0x11'));var authService=require(_0xc114('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc114('0x13'));var utils=require(_0xc114('0x14'));var config=require(_0xc114('0x15'));var licenseUtil=require(_0xc114('0x16'));var db=require(_0xc114('0x17'))['db'];config[_0xc114('0x18')]=_[_0xc114('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc114('0x1a'))(new Redis(config[_0xc114('0x18')]));require(_0xc114('0x1b'))[_0xc114('0x1c')](socket);function respondWithStatusCode(_0x4c91cd,_0x13ece9){_0x13ece9=_0x13ece9||0xcc;return function(_0x2a7973){if(_0x2a7973){return _0x4c91cd['sendStatus'](_0x13ece9);}return _0x4c91cd[_0xc114('0x1d')](_0x13ece9)[_0xc114('0x1e')]();};}function respondWithResult(_0x48f1b2,_0x1d5240){_0x1d5240=_0x1d5240||0xc8;return function(_0x49a963){if(_0x49a963){return _0x48f1b2[_0xc114('0x1d')](_0x1d5240)['json'](_0x49a963);}};}function respondWithFilteredResult(_0x117411,_0x56535c){return function(_0x3302f4){if(_0x3302f4){var _0x5b1a5e=typeof _0x56535c['offset']===_0xc114('0x1f')&&typeof _0x56535c['limit']===_0xc114('0x1f');var _0x3cb540=_0x3302f4['count'];var _0xd632d3=_0x5b1a5e?0x0:_0x56535c['offset'];var _0x553412=_0x5b1a5e?_0x3302f4[_0xc114('0x20')]:_0x56535c[_0xc114('0x21')]+_0x56535c['limit'];var _0x45d7a1;if(_0x553412>=_0x3cb540){_0x553412=_0x3cb540;_0x45d7a1=0xc8;}else{_0x45d7a1=0xce;}_0x117411[_0xc114('0x1d')](_0x45d7a1);return _0x117411['set'](_0xc114('0x22'),_0xd632d3+'-'+_0x553412+'/'+_0x3cb540)[_0xc114('0x23')](_0x3302f4);}return null;};}function patchUpdates(_0x2a8eba){return function(_0x34e724){try{jsonpatch[_0xc114('0x24')](_0x34e724,_0x2a8eba,!![]);}catch(_0x12f1e4){return BPromise[_0xc114('0x25')](_0x12f1e4);}return _0x34e724['save']();};}function saveUpdates(_0x33a890,_0x27ed6f){return function(_0x41d4c7){if(_0x41d4c7){return _0x41d4c7[_0xc114('0x26')](_0x33a890)[_0xc114('0x27')](function(_0x4f2bea){return _0x4f2bea;});}return null;};}function removeEntity(_0x3a472a,_0x57b2ba){return function(_0x3fb031){if(_0x3fb031){return _0x3fb031[_0xc114('0x28')]()[_0xc114('0x27')](function(){_0x3a472a['status'](0xcc)[_0xc114('0x1e')]();});}};}function handleEntityNotFound(_0x560b86,_0x2d52c6){return function(_0x594dd4){if(!_0x594dd4){_0x560b86[_0xc114('0x29')](0x194);}return _0x594dd4;};}function handleError(_0x12ab5d,_0x42c6fd){_0x42c6fd=_0x42c6fd||0x1f4;return function(_0x27d3b4){logger[_0xc114('0x2a')](_0x27d3b4[_0xc114('0x2b')]);if(_0x27d3b4['name']){delete _0x27d3b4[_0xc114('0x2c')];}_0x12ab5d[_0xc114('0x1d')](_0x42c6fd)[_0xc114('0x2d')](_0x27d3b4);};}exports[_0xc114('0x2e')]=function(_0x56bff9,_0x20ae0e){var _0x5cdf90={},_0x37b065={},_0x3c0aa9={'count':0x0,'rows':[]};var _0x5f4283=_['map'](db[_0xc114('0x2f')][_0xc114('0x30')],function(_0x3f7d61){return{'name':_0x3f7d61[_0xc114('0x31')],'type':_0x3f7d61[_0xc114('0x32')][_0xc114('0x33')]};});_0x37b065['model']=_['map'](_0x5f4283,_0xc114('0x2c'));_0x37b065[_0xc114('0x34')]=_[_0xc114('0x35')](_0x56bff9[_0xc114('0x34')]);_0x37b065['filters']=_[_0xc114('0x36')](_0x37b065['model'],_0x37b065['query']);_0x5cdf90['attributes']=_[_0xc114('0x36')](_0x37b065[_0xc114('0x37')],qs[_0xc114('0x38')](_0x56bff9[_0xc114('0x34')][_0xc114('0x38')]));_0x5cdf90[_0xc114('0x39')]=_0x5cdf90['attributes']['length']?_0x5cdf90['attributes']:_0x37b065['model'];if(!_0x56bff9['query']['hasOwnProperty']('nolimit')){_0x5cdf90[_0xc114('0x3a')]=qs[_0xc114('0x3a')](_0x56bff9[_0xc114('0x34')]['limit']);_0x5cdf90[_0xc114('0x21')]=qs[_0xc114('0x21')](_0x56bff9[_0xc114('0x34')][_0xc114('0x21')]);}_0x5cdf90[_0xc114('0x3b')]=qs['sort'](_0x56bff9['query']['sort']);_0x5cdf90['where']=qs['filters'](_['pick'](_0x56bff9[_0xc114('0x34')],_0x37b065[_0xc114('0x3c')]),_0x5f4283);if(_0x56bff9[_0xc114('0x34')][_0xc114('0x3d')]){_0x5cdf90[_0xc114('0x3e')]=_[_0xc114('0x3f')](_0x5cdf90[_0xc114('0x3e')],{'$or':_[_0xc114('0x40')](_0x5f4283,function(_0x435be2){if(_0x435be2[_0xc114('0x32')]!=='VIRTUAL'){var _0x24536d={};_0x24536d[_0x435be2[_0xc114('0x2c')]]={'$like':'%'+_0x56bff9[_0xc114('0x34')]['filter']+'%'};return _0x24536d;}})});}_0x5cdf90=_[_0xc114('0x3f')]({},_0x5cdf90,_0x56bff9[_0xc114('0x41')]);var _0xacd3e8={'where':_0x5cdf90[_0xc114('0x3e')]};return db[_0xc114('0x2f')][_0xc114('0x20')](_0xacd3e8)[_0xc114('0x27')](function(_0x5617a6){_0x3c0aa9[_0xc114('0x20')]=_0x5617a6;if(_0x56bff9[_0xc114('0x34')][_0xc114('0x42')]){_0x5cdf90[_0xc114('0x43')]=[{'all':!![]}];}return db[_0xc114('0x2f')]['findAll'](_0x5cdf90);})[_0xc114('0x27')](function(_0x18ffd0){_0x3c0aa9[_0xc114('0x44')]=_0x18ffd0;return _0x3c0aa9;})[_0xc114('0x27')](respondWithFilteredResult(_0x20ae0e,_0x5cdf90))[_0xc114('0x45')](handleError(_0x20ae0e,null));};exports[_0xc114('0x46')]=function(_0x5bdb6a,_0x2c4da2){var _0x52438e={'raw':!![],'where':{'id':_0x5bdb6a[_0xc114('0x47')]['id']}},_0x284e9c={};_0x284e9c[_0xc114('0x37')]=_[_0xc114('0x35')](db[_0xc114('0x2f')]['rawAttributes']);_0x284e9c['query']=_[_0xc114('0x35')](_0x5bdb6a[_0xc114('0x34')]);_0x284e9c[_0xc114('0x3c')]=_[_0xc114('0x36')](_0x284e9c['model'],_0x284e9c[_0xc114('0x34')]);_0x52438e[_0xc114('0x39')]=_[_0xc114('0x36')](_0x284e9c[_0xc114('0x37')],qs[_0xc114('0x38')](_0x5bdb6a[_0xc114('0x34')][_0xc114('0x38')]));_0x52438e['attributes']=_0x52438e[_0xc114('0x39')][_0xc114('0x48')]?_0x52438e[_0xc114('0x39')]:_0x284e9c['model'];if(_0x5bdb6a[_0xc114('0x34')]['includeAll']){_0x52438e[_0xc114('0x43')]=[{'all':!![]}];}_0x52438e=_['merge']({},_0x52438e,_0x5bdb6a[_0xc114('0x41')]);return db[_0xc114('0x2f')]['find'](_0x52438e)['then'](handleEntityNotFound(_0x2c4da2,null))['then'](respondWithResult(_0x2c4da2,null))['catch'](handleError(_0x2c4da2,null));};exports[_0xc114('0x49')]=function(_0xca0d4b,_0x1d9d1d){return db[_0xc114('0x2f')][_0xc114('0x49')](_0xca0d4b['body'],{})[_0xc114('0x27')](respondWithResult(_0x1d9d1d,0xc9))[_0xc114('0x45')](handleError(_0x1d9d1d,null));};exports[_0xc114('0x26')]=function(_0xee4437,_0xc24b0c){if(_0xee4437[_0xc114('0x4a')]['id']){delete _0xee4437[_0xc114('0x4a')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0xee4437[_0xc114('0x47')]['id']}})['then'](handleEntityNotFound(_0xc24b0c,null))[_0xc114('0x27')](saveUpdates(_0xee4437[_0xc114('0x4a')],null))[_0xc114('0x27')](respondWithResult(_0xc24b0c,null))[_0xc114('0x45')](handleError(_0xc24b0c,null));};exports[_0xc114('0x28')]=function(_0x17f2da,_0x495cec){return db[_0xc114('0x2f')]['find']({'where':{'id':_0x17f2da[_0xc114('0x47')]['id']}})[_0xc114('0x27')](handleEntityNotFound(_0x495cec,null))[_0xc114('0x27')](removeEntity(_0x495cec,null))[_0xc114('0x45')](handleError(_0x495cec,null));};exports[_0xc114('0x4b')]=function(_0x1d5b55,_0x1fb325){return db[_0xc114('0x2f')][_0xc114('0x4b')]()[_0xc114('0x27')](respondWithResult(_0x1fb325,null))[_0xc114('0x45')](handleError(_0x1fb325,null));};exports[_0xc114('0x4c')]=function(_0x2ed926,_0x3e9fd9,_0x5b5999){return db[_0xc114('0x4d')]['count']({'where':{'ChatGroupId':_0x2ed926[_0xc114('0x47')]['id'],'ToId':_0x2ed926[_0xc114('0x4e')]['id'],'read':![]}})['then'](function(_0x5ce09a){return{'id':_[_0xc114('0x4f')](_0x2ed926['params']['id']),'count':_0x5ce09a};})[_0xc114('0x27')](respondWithResult(_0x3e9fd9,null))[_0xc114('0x45')](handleError(_0x3e9fd9,null));};exports[_0xc114('0x50')]=function(_0x5b54ac,_0x15ed68,_0x5676f7){return db[_0xc114('0x2f')][_0xc114('0x51')]({'where':{'id':_0x5b54ac[_0xc114('0x47')]['id']}})[_0xc114('0x27')](handleEntityNotFound(_0x15ed68,null))['then'](function(_0x365084){if(_0x365084){return _0x365084['addMembers'](_0x5b54ac[_0xc114('0x4a')][_0xc114('0x52')],_['omit'](_0x5b54ac[_0xc114('0x4a')],['ids','id'])||{});}})[_0xc114('0x27')](respondWithResult(_0x15ed68,null))[_0xc114('0x45')](handleError(_0x15ed68,null));};exports[_0xc114('0x53')]=function(_0x2ccdfc,_0x4f4814,_0x243517){var _0x147fed={};var _0x585506={};var _0x4b8d98;var _0x135a9c;return db[_0xc114('0x2f')][_0xc114('0x54')]({'where':{'id':_0x2ccdfc[_0xc114('0x47')]['id']}})[_0xc114('0x27')](handleEntityNotFound(_0x4f4814,null))['then'](function(_0x2d8d6c){if(_0x2d8d6c){_0x4b8d98=_0x2d8d6c;_0x585506[_0xc114('0x37')]=_['keys'](db[_0xc114('0x55')][_0xc114('0x30')]);_0x585506[_0xc114('0x34')]=_[_0xc114('0x35')](_0x2ccdfc['query']);_0x585506[_0xc114('0x3c')]=_[_0xc114('0x36')](_0x585506[_0xc114('0x37')],_0x585506[_0xc114('0x34')]);_0x147fed[_0xc114('0x39')]=_[_0xc114('0x36')](_0x585506[_0xc114('0x37')],qs[_0xc114('0x38')](_0x2ccdfc['query'][_0xc114('0x38')]));_0x147fed[_0xc114('0x39')]=_0x147fed[_0xc114('0x39')][_0xc114('0x48')]?_0x147fed['attributes']:_0x585506[_0xc114('0x37')];_0x147fed['order']=qs[_0xc114('0x56')](_0x2ccdfc[_0xc114('0x34')][_0xc114('0x56')]);_0x147fed[_0xc114('0x3e')]=qs[_0xc114('0x3c')](_[_0xc114('0x57')](_0x2ccdfc['query'],_0x585506[_0xc114('0x3c')]));if(_0x2ccdfc[_0xc114('0x34')][_0xc114('0x3d')]){_0x147fed['where']=_[_0xc114('0x3f')](_0x147fed[_0xc114('0x3e')],{'$or':_['map'](_0x147fed[_0xc114('0x39')],function(_0x6cd687){var _0x46db73={};_0x46db73[_0x6cd687]={'$like':'%'+_0x2ccdfc[_0xc114('0x34')][_0xc114('0x3d')]+'%'};return _0x46db73;})});}_0x147fed=_['merge']({},_0x147fed,_0x2ccdfc[_0xc114('0x41')]);return _0x4b8d98[_0xc114('0x53')](_0x147fed);}})[_0xc114('0x27')](function(_0x49c0c7){if(_0x49c0c7){_0x135a9c=_0x49c0c7[_0xc114('0x48')];if(!_0x2ccdfc[_0xc114('0x34')]['hasOwnProperty'](_0xc114('0x58'))){_0x147fed[_0xc114('0x3a')]=qs['limit'](_0x2ccdfc[_0xc114('0x34')][_0xc114('0x3a')]);_0x147fed[_0xc114('0x21')]=qs[_0xc114('0x21')](_0x2ccdfc['query'][_0xc114('0x21')]);}return _0x4b8d98[_0xc114('0x53')](_0x147fed);}})['then'](function(_0x30d401){if(_0x30d401){return _0x30d401?{'count':_0x135a9c,'rows':_0x30d401}:null;}})['then'](respondWithResult(_0x4f4814,null))[_0xc114('0x45')](handleError(_0x4f4814,null));};exports[_0xc114('0x59')]=function(_0x2692dd,_0x43638e,_0x1c8742){return db[_0xc114('0x2f')]['find']({'where':{'id':_0x2692dd['params']['id']}})['then'](handleEntityNotFound(_0x43638e,null))['then'](function(_0xdff876){if(_0xdff876){return _0xdff876[_0xc114('0x59')](_0x2692dd[_0xc114('0x34')][_0xc114('0x52')]);}})[_0xc114('0x27')](respondWithStatusCode(_0x43638e,null))[_0xc114('0x45')](handleError(_0x43638e,null));};exports['addMessage']=function(_0x64b466,_0x1016bf,_0x31376e){if(_0x64b466[_0xc114('0x4a')]['id']){delete _0x64b466['body']['id'];}return db[_0xc114('0x2f')][_0xc114('0x51')]({'where':{'id':_0x64b466[_0xc114('0x47')]['id']}})['then'](handleEntityNotFound(_0x1016bf,null))[_0xc114('0x27')](function(_0x4430c6){if(_0x4430c6){_0x64b466['body'][_0xc114('0x5a')]=_0x4430c6['id'];return db[_0xc114('0x4d')][_0xc114('0x49')](_0x64b466['body']);}})['then'](respondWithResult(_0x1016bf,null))['catch'](handleError(_0x1016bf,null));};exports[_0xc114('0x5b')]=function(_0x51234f,_0xa31a04,_0xce5758){var _0x1aa9e7={};var _0x383b1d={};var _0x138bd1;var _0x87ff4;return db[_0xc114('0x2f')][_0xc114('0x54')]({'where':{'id':_0x51234f['params']['id']}})[_0xc114('0x27')](handleEntityNotFound(_0xa31a04,null))[_0xc114('0x27')](function(_0x215170){if(_0x215170){_0x138bd1=_0x215170;_0x383b1d[_0xc114('0x37')]=_['keys'](db[_0xc114('0x4d')][_0xc114('0x30')]);_0x383b1d['query']=_['keys'](_0x51234f[_0xc114('0x34')]);_0x383b1d[_0xc114('0x3c')]=_[_0xc114('0x36')](_0x383b1d[_0xc114('0x37')],_0x383b1d[_0xc114('0x34')]);_0x1aa9e7[_0xc114('0x39')]=_[_0xc114('0x36')](_0x383b1d['model'],qs[_0xc114('0x38')](_0x51234f[_0xc114('0x34')]['fields']));_0x1aa9e7[_0xc114('0x39')]=_0x1aa9e7[_0xc114('0x39')][_0xc114('0x48')]?_0x1aa9e7[_0xc114('0x39')]:_0x383b1d[_0xc114('0x37')];_0x1aa9e7['order']=qs[_0xc114('0x56')](_0x51234f[_0xc114('0x34')][_0xc114('0x56')]);_0x1aa9e7['where']=qs[_0xc114('0x3c')](_[_0xc114('0x57')](_0x51234f[_0xc114('0x34')],_0x383b1d['filters']));if(_0x51234f[_0xc114('0x34')]['filter']){_0x1aa9e7[_0xc114('0x3e')]=_['merge'](_0x1aa9e7[_0xc114('0x3e')],{'$or':_[_0xc114('0x40')](_0x1aa9e7['attributes'],function(_0xe12985){var _0x5cbc71={};_0x5cbc71[_0xe12985]={'$like':'%'+_0x51234f['query']['filter']+'%'};return _0x5cbc71;})});}if(_0x51234f[_0xc114('0x34')]['$gte']){var _0x45cdbe=_0x51234f[_0xc114('0x34')]['$gte'][_0xc114('0x5c')](',');var _0x504d5e={};_0x504d5e[_0x45cdbe[0x0]]={'$gte':moment(_0x45cdbe[0x1])[_0xc114('0x5d')](_0xc114('0x5e'))};_0x1aa9e7[_0xc114('0x3e')]=_[_0xc114('0x3f')](_0x1aa9e7[_0xc114('0x3e')],_0x504d5e);}_0x1aa9e7=_['merge']({},_0x1aa9e7,_0x51234f['options']);return _0x138bd1['getMessages'](_0x1aa9e7);}})['then'](function(_0x5a445d){if(_0x5a445d){_0x87ff4=_0x5a445d[_0xc114('0x48')];if(!_0x51234f['query'][_0xc114('0x5f')](_0xc114('0x58'))){_0x1aa9e7[_0xc114('0x3a')]=qs[_0xc114('0x3a')](_0x51234f[_0xc114('0x34')]['limit']);_0x1aa9e7['offset']=qs[_0xc114('0x21')](_0x51234f[_0xc114('0x34')][_0xc114('0x21')]);}return _0x138bd1['getMessages'](_0x1aa9e7);}})[_0xc114('0x27')](function(_0x5b5b4b){if(_0x5b5b4b){return _0x5b5b4b?{'count':_0x87ff4,'rows':_0x5b5b4b}:null;}})[_0xc114('0x27')](respondWithResult(_0xa31a04,null))['catch'](handleError(_0xa31a04,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 6650d2e..6f4f43e 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 _0xdb21=['../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports','events'];(function(_0x295a55,_0x56e0dc){var _0x3890cf=function(_0x284d42){while(--_0x284d42){_0x295a55['push'](_0x295a55['shift']());}};_0x3890cf(++_0x56e0dc);}(_0xdb21,0x135));var _0x1db2=function(_0x4f3949,_0x1b28b5){_0x4f3949=_0x4f3949-0x0;var _0x2bbb60=_0xdb21[_0x4f3949];return _0x2bbb60;};'use strict';var EventEmitter=require(_0x1db2('0x0'));var ChatGroup=require(_0x1db2('0x1'))['db'][_0x1db2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x1db2('0x3')](0x0);var events={'afterCreate':_0x1db2('0x4'),'afterUpdate':_0x1db2('0x5'),'afterDestroy':_0x1db2('0x6')};function emitEvent(_0xdc2c0c){return function(_0x4102c4,_0x54a04e,_0x3b16c7){ChatGroupEvents['emit'](_0xdc2c0c+':'+_0x4102c4['id'],_0x4102c4);ChatGroupEvents['emit'](_0xdc2c0c,_0x4102c4);_0x3b16c7(null);};}for(var e in events){if(events[_0x1db2('0x7')](e)){var event=events[e];ChatGroup[_0x1db2('0x8')](e,emitEvent(event));}}module[_0x1db2('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0x7c71=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','update'];(function(_0x295b80,_0x3bf87d){var _0xfc29b6=function(_0x4d0e5f){while(--_0x4d0e5f){_0x295b80['push'](_0x295b80['shift']());}};_0xfc29b6(++_0x3bf87d);}(_0x7c71,0x177));var _0x17c7=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x7c71[_0x2f1762];return _0x8ab21;};'use strict';var EventEmitter=require(_0x17c7('0x0'));var ChatGroup=require(_0x17c7('0x1'))['db'][_0x17c7('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x17c7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x17c7('0x4'),'afterDestroy':_0x17c7('0x5')};function emitEvent(_0x3f9105){return function(_0x5a4923,_0x4fed29,_0xa4e319){ChatGroupEvents[_0x17c7('0x6')](_0x3f9105+':'+_0x5a4923['id'],_0x5a4923);ChatGroupEvents[_0x17c7('0x6')](_0x3f9105,_0x5a4923);_0xa4e319(null);};}for(var e in events){if(events[_0x17c7('0x7')](e)){var event=events[e];ChatGroup[_0x17c7('0x8')](e,emitEvent(event));}}module[_0x17c7('0x9')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 0457e5e..3ab90d2 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 _0x2275=['request-promise','path','../../config/environment','./chatGroup.attributes','exports','ChatGroup','lodash','util','../../config/logger','moment'];(function(_0x2b8077,_0x453634){var _0x308091=function(_0x426df7){while(--_0x426df7){_0x2b8077['push'](_0x2b8077['shift']());}};_0x308091(++_0x453634);}(_0x2275,0x132));var _0x5227=function(_0x387ce6,_0x3a45c4){_0x387ce6=_0x387ce6-0x0;var _0x8d2923=_0x2275[_0x387ce6];return _0x8d2923;};'use strict';var _=require(_0x5227('0x0'));var util=require(_0x5227('0x1'));var logger=require(_0x5227('0x2'))('api');var moment=require(_0x5227('0x3'));var BPromise=require('bluebird');var rp=require(_0x5227('0x4'));var fs=require('fs');var path=require(_0x5227('0x5'));var rimraf=require('rimraf');var config=require(_0x5227('0x6'));var attributes=require(_0x5227('0x7'));module[_0x5227('0x8')]=function(_0x4c0469,_0xd3d705){return _0x4c0469['define'](_0x5227('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9e45=['path','rimraf','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','api','moment','bluebird','request-promise'];(function(_0x5b119c,_0x49403e){var _0x1af35b=function(_0x563175){while(--_0x563175){_0x5b119c['push'](_0x5b119c['shift']());}};_0x1af35b(++_0x49403e);}(_0x9e45,0x1e8));var _0x59e4=function(_0xccd4d3,_0xec2028){_0xccd4d3=_0xccd4d3-0x0;var _0xca752=_0x9e45[_0xccd4d3];return _0xca752;};'use strict';var _=require(_0x59e4('0x0'));var util=require(_0x59e4('0x1'));var logger=require('../../config/logger')(_0x59e4('0x2'));var moment=require(_0x59e4('0x3'));var BPromise=require(_0x59e4('0x4'));var rp=require(_0x59e4('0x5'));var fs=require('fs');var path=require(_0x59e4('0x6'));var rimraf=require(_0x59e4('0x7'));var config=require('../../config/environment');var attributes=require(_0x59e4('0x8'));module[_0x59e4('0x9')]=function(_0x1ca339,_0x4235a9){return _0x1ca339[_0x59e4('0xa')](_0x59e4('0xb'),attributes,{'tableName':_0x59e4('0xc'),'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 637cba7..c42e804 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 _0x95f4=['catch','lodash','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x3e16c4,_0x1f1954){var _0x5945d1=function(_0x404a8f){while(--_0x404a8f){_0x3e16c4['push'](_0x3e16c4['shift']());}};_0x5945d1(++_0x1f1954);}(_0x95f4,0xf1));var _0x495f=function(_0x3206cb,_0x3d3f65){_0x3206cb=_0x3206cb-0x0;var _0x4be1ea=_0x95f4[_0x3206cb];return _0x4be1ea;};'use strict';var _=require(_0x495f('0x0'));var util=require(_0x495f('0x1'));var moment=require(_0x495f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x495f('0x3'));var db=require(_0x495f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x495f('0x5'));var config=require(_0x495f('0x6'));var jayson=require(_0x495f('0x7'));var client=jayson['client'][_0x495f('0x8')]({'port':0x232a});config[_0x495f('0x9')]=_[_0x495f('0xa')](config['redis'],{'host':_0x495f('0xb'),'port':0x18eb});var socket=require(_0x495f('0xc'))(new Redis(config[_0x495f('0x9')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x3f5880,_0x48c225,_0x415017){return new BPromise(function(_0x508c3d,_0x2b6d9d){return client[_0x495f('0xd')](_0x3f5880,_0x415017)[_0x495f('0xe')](function(_0x2a90c0){logger['info'](_0x495f('0xf'),_0x48c225,_0x495f('0x10'));logger[_0x495f('0x11')](_0x495f('0x12'),_0x48c225,_0x495f('0x10'),JSON['stringify'](_0x2a90c0));if(_0x2a90c0[_0x495f('0x13')]){if(_0x2a90c0[_0x495f('0x13')][_0x495f('0x14')]===0x1f4){logger[_0x495f('0x13')](_0x495f('0xf'),_0x48c225,_0x2a90c0[_0x495f('0x13')][_0x495f('0x15')]);return _0x2b6d9d(_0x2a90c0['error'][_0x495f('0x15')]);}logger[_0x495f('0x13')](_0x495f('0xf'),_0x48c225,_0x2a90c0[_0x495f('0x13')]['message']);return _0x508c3d(_0x2a90c0[_0x495f('0x13')][_0x495f('0x15')]);}else{logger['info'](_0x495f('0xf'),_0x48c225,_0x495f('0x10'));_0x508c3d(_0x2a90c0[_0x495f('0x16')]['message']);}})[_0x495f('0x17')](function(_0x3dc481){logger[_0x495f('0x13')](_0x495f('0xf'),_0x48c225,_0x3dc481);_0x2b6d9d(_0x3dc481);});});}
\ No newline at end of file
+var _0xba2d=['ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatGroup.socket','register','info'];(function(_0x283e62,_0x327cbb){var _0x409c32=function(_0x42c1cf){while(--_0x42c1cf){_0x283e62['push'](_0x283e62['shift']());}};_0x409c32(++_0x327cbb);}(_0xba2d,0xa3));var _0xdba2=function(_0x54f8a7,_0x59b843){_0x54f8a7=_0x54f8a7-0x0;var _0x1275d2=_0xba2d[_0x54f8a7];return _0x1275d2;};'use strict';var _=require('lodash');var util=require(_0xdba2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdba2('0x1'));var logger=require(_0xdba2('0x2'))(_0xdba2('0x3'));var config=require(_0xdba2('0x4'));var jayson=require(_0xdba2('0x5'));var client=jayson[_0xdba2('0x6')][_0xdba2('0x7')]({'port':0x232a});config[_0xdba2('0x8')]=_['defaults'](config[_0xdba2('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xdba2('0x9'))(new Redis(config[_0xdba2('0x8')]));require(_0xdba2('0xa'))[_0xdba2('0xb')](socket);function respondWithRpcPromise(_0x28324a,_0x3aea25,_0x4ee95c){return new BPromise(function(_0x2f50a9,_0x49ab14){return client['request'](_0x28324a,_0x4ee95c)['then'](function(_0x16aa87){logger[_0xdba2('0xc')](_0xdba2('0xd'),_0x3aea25,_0xdba2('0xe'));logger[_0xdba2('0xf')](_0xdba2('0x10'),_0x3aea25,_0xdba2('0xe'),JSON[_0xdba2('0x11')](_0x16aa87));if(_0x16aa87[_0xdba2('0x12')]){if(_0x16aa87[_0xdba2('0x12')][_0xdba2('0x13')]===0x1f4){logger[_0xdba2('0x12')](_0xdba2('0xd'),_0x3aea25,_0x16aa87[_0xdba2('0x12')][_0xdba2('0x14')]);return _0x49ab14(_0x16aa87[_0xdba2('0x12')]['message']);}logger['error'](_0xdba2('0xd'),_0x3aea25,_0x16aa87['error'][_0xdba2('0x14')]);return _0x2f50a9(_0x16aa87[_0xdba2('0x12')]['message']);}else{logger[_0xdba2('0xc')]('ChatGroup,\x20%s,\x20%s',_0x3aea25,_0xdba2('0xe'));_0x2f50a9(_0x16aa87['result'][_0xdba2('0x14')]);}})[_0xdba2('0x15')](function(_0x1b67ec){logger[_0xdba2('0x12')](_0xdba2('0xd'),_0x3aea25,_0x1b67ec);_0x49ab14(_0x1b67ec);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 7478a85..0cb1c6d 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 _0x2b98=['update','register','length','chatGroup:','./chatGroup.events','remove'];(function(_0x335c97,_0x485355){var _0x36ac8e=function(_0x582562){while(--_0x582562){_0x335c97['push'](_0x335c97['shift']());}};_0x36ac8e(++_0x485355);}(_0x2b98,0x1f0));var _0x82b9=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x2b98[_0x9df060];return _0x338dfe;};'use strict';var ChatGroupEvents=require(_0x82b9('0x0'));var events=['save',_0x82b9('0x1'),_0x82b9('0x2')];function createListener(_0x3eb099,_0x5ca328){return function(_0x285393){_0x5ca328['emit'](_0x3eb099,_0x285393);};}function removeListener(_0x53bda9,_0x36aec0){return function(){ChatGroupEvents['removeListener'](_0x53bda9,_0x36aec0);};}exports[_0x82b9('0x3')]=function(_0x439941){for(var _0x5b2727=0x0,_0x2af581=events[_0x82b9('0x4')];_0x5b2727<_0x2af581;_0x5b2727++){var _0x55c248=events[_0x5b2727];var _0x360b47=createListener(_0x82b9('0x5')+_0x55c248,_0x439941);ChatGroupEvents['on'](_0x55c248,_0x360b47);}};
\ No newline at end of file
+var _0xa39a=['chatGroup:','./chatGroup.events','save','remove','update','removeListener','register','length'];(function(_0xdcbbb,_0x39b964){var _0x19bb4e=function(_0x4952b7){while(--_0x4952b7){_0xdcbbb['push'](_0xdcbbb['shift']());}};_0x19bb4e(++_0x39b964);}(_0xa39a,0x121));var _0xaa39=function(_0x5aa68d,_0x3515b5){_0x5aa68d=_0x5aa68d-0x0;var _0x55e204=_0xa39a[_0x5aa68d];return _0x55e204;};'use strict';var ChatGroupEvents=require(_0xaa39('0x0'));var events=[_0xaa39('0x1'),_0xaa39('0x2'),_0xaa39('0x3')];function createListener(_0xf6f2df,_0x33d207){return function(_0x1f5db1){_0x33d207['emit'](_0xf6f2df,_0x1f5db1);};}function removeListener(_0x4a67c0,_0x4d67ea){return function(){ChatGroupEvents[_0xaa39('0x4')](_0x4a67c0,_0x4d67ea);};}exports[_0xaa39('0x5')]=function(_0x5d0bfb){for(var _0x505d48=0x0,_0x5dd364=events[_0xaa39('0x6')];_0x505d48<_0x5dd364;_0x505d48++){var _0x4bc2de=events[_0x505d48];var _0x4cfcf3=createListener(_0xaa39('0x7')+_0x4bc2de,_0x5d0bfb);ChatGroupEvents['on'](_0x4bc2de,_0x4cfcf3);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index c8c04da..82e4e5e 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 _0x3734=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatGroup.controller','isAuthenticated','/describe','get','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','/:id','update','delete','destroy','removeMembers'];(function(_0xcb5530,_0x1de24a){var _0x3bb3e7=function(_0x461fa8){while(--_0x461fa8){_0xcb5530['push'](_0xcb5530['shift']());}};_0x3bb3e7(++_0x1de24a);}(_0x3734,0x179));var _0x4373=function(_0x290be4,_0x2df3bd){_0x290be4=_0x290be4-0x0;var _0x2cbe14=_0x3734[_0x290be4];return _0x2cbe14;};'use strict';var multer=require(_0x4373('0x0'));var util=require(_0x4373('0x1'));var path=require(_0x4373('0x2'));var timeout=require(_0x4373('0x3'));var express=require(_0x4373('0x4'));var router=express[_0x4373('0x5')]();var fs_extra=require(_0x4373('0x6'));var auth=require(_0x4373('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4373('0x8'));var controller=require(_0x4373('0x9'));router['get']('/',auth[_0x4373('0xa')](),controller['index']);router['get'](_0x4373('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x4373('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x4373('0xd')]);router['get'](_0x4373('0xe'),auth['isAuthenticated'](),controller[_0x4373('0xf')]);router[_0x4373('0xc')](_0x4373('0x10'),auth[_0x4373('0xa')](),controller[_0x4373('0x11')]);router[_0x4373('0xc')](_0x4373('0x12'),auth[_0x4373('0xa')](),controller[_0x4373('0x13')]);router[_0x4373('0x14')]('/',auth['isAuthenticated'](),controller[_0x4373('0x15')]);router[_0x4373('0x14')]('/:id/members',auth[_0x4373('0xa')](),controller[_0x4373('0x16')]);router[_0x4373('0x14')](_0x4373('0x12'),auth['isAuthenticated'](),controller[_0x4373('0x17')]);router['put'](_0x4373('0x18'),auth[_0x4373('0xa')](),controller[_0x4373('0x19')]);router[_0x4373('0x1a')](_0x4373('0x18'),auth[_0x4373('0xa')](),controller[_0x4373('0x1b')]);router[_0x4373('0x1a')]('/:id/members',auth[_0x4373('0xa')](),controller[_0x4373('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0xff6f=['multer','connect-timeout','Router','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','/describe','/:id','show','getUnread','getMembers','/:id/messages','getMessages','post','create','put','update','destroy','delete','/:id/members','removeMembers','exports'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0xff6f,0x108));var _0xfff6=function(_0x3adc9f,_0x5d49d5){_0x3adc9f=_0x3adc9f-0x0;var _0x432a40=_0xff6f[_0x3adc9f];return _0x432a40;};'use strict';var multer=require(_0xfff6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfff6('0x1'));var express=require('express');var router=express[_0xfff6('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfff6('0x3'));var config=require('../../config/environment');var controller=require(_0xfff6('0x4'));router[_0xfff6('0x5')]('/',auth[_0xfff6('0x6')](),controller[_0xfff6('0x7')]);router[_0xfff6('0x5')](_0xfff6('0x8'),auth[_0xfff6('0x6')](),controller['describe']);router[_0xfff6('0x5')](_0xfff6('0x9'),auth[_0xfff6('0x6')](),controller[_0xfff6('0xa')]);router[_0xfff6('0x5')]('/:id/unread',auth[_0xfff6('0x6')](),controller[_0xfff6('0xb')]);router[_0xfff6('0x5')]('/:id/members',auth[_0xfff6('0x6')](),controller[_0xfff6('0xc')]);router[_0xfff6('0x5')](_0xfff6('0xd'),auth['isAuthenticated'](),controller[_0xfff6('0xe')]);router[_0xfff6('0xf')]('/',auth['isAuthenticated'](),controller[_0xfff6('0x10')]);router[_0xfff6('0xf')]('/:id/members',auth['isAuthenticated'](),controller['addMembers']);router['post'](_0xfff6('0xd'),auth[_0xfff6('0x6')](),controller['addMessage']);router[_0xfff6('0x11')](_0xfff6('0x9'),auth[_0xfff6('0x6')](),controller[_0xfff6('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xfff6('0x13')]);router[_0xfff6('0x14')](_0xfff6('0x15'),auth[_0xfff6('0x6')](),controller[_0xfff6('0x16')]);module[_0xfff6('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 3483e33..f1ca5b8 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 _0x0b89=['ENUM','thumb','star','TEXT','STRING','DATE','long','INTEGER','sequelize','BOOLEAN'];(function(_0x415210,_0x33aff1){var _0x2cb0fa=function(_0x2ad5a1){while(--_0x2ad5a1){_0x415210['push'](_0x415210['shift']());}};_0x2cb0fa(++_0x33aff1);}(_0x0b89,0xc6));var _0x90b8=function(_0x38ddfc,_0x572362){_0x38ddfc=_0x38ddfc-0x0;var _0x1a8e60=_0x0b89[_0x38ddfc];return _0x1a8e60;};'use strict';var Sequelize=require(_0x90b8('0x0'));module['exports']={'closed':{'type':Sequelize[_0x90b8('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x90b8('0x2')]('star',_0x90b8('0x3')),'defaultValue':_0x90b8('0x4')},'ratingMessage':{'type':Sequelize[_0x90b8('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x90b8('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x90b8('0x7')]},'disposition':{'type':Sequelize[_0x90b8('0x6')]},'secondDisposition':{'type':Sequelize[_0x90b8('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x90b8('0x6')]},'browserName':{'type':Sequelize[_0x90b8('0x6')]},'browserVersion':{'type':Sequelize[_0x90b8('0x6')]},'osName':{'type':Sequelize[_0x90b8('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x90b8('0x6')]},'deviceVendor':{'type':Sequelize[_0x90b8('0x6')]},'deviceType':{'type':Sequelize[_0x90b8('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x90b8('0x6')]},'formData':{'type':Sequelize['TEXT'](_0x90b8('0x8'))},'read1stAt':{'type':Sequelize[_0x90b8('0x7')]},'lastMsgAt':{'type':Sequelize[_0x90b8('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x90b8('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x90b8('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x90b8('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x90b8('0x9')]}};
\ No newline at end of file
+var _0x1614=['sequelize','exports','ENUM','star','thumb','TEXT','STRING','DATE','long','out','BOOLEAN','INTEGER'];(function(_0x2aa30f,_0x3d58d0){var _0x2b8376=function(_0x4c0548){while(--_0x4c0548){_0x2aa30f['push'](_0x2aa30f['shift']());}};_0x2b8376(++_0x3d58d0);}(_0x1614,0xa8));var _0x4161=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0x1614[_0xb833b1];return _0x1ab87a;};'use strict';var Sequelize=require(_0x4161('0x0'));module[_0x4161('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x4161('0x2')](_0x4161('0x3'),_0x4161('0x4')),'defaultValue':_0x4161('0x3')},'ratingMessage':{'type':Sequelize[_0x4161('0x5')]},'pathTranscript':{'type':Sequelize[_0x4161('0x5')]},'mailTranscript':{'type':Sequelize[_0x4161('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x4161('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x4161('0x6')]},'thirdDisposition':{'type':Sequelize[_0x4161('0x6')]},'note':{'type':Sequelize[_0x4161('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x4161('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x4161('0x6')]},'deviceModel':{'type':Sequelize[_0x4161('0x6')]},'deviceVendor':{'type':Sequelize[_0x4161('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x4161('0x5')]},'customerIp':{'type':Sequelize[_0x4161('0x6')]},'formData':{'type':Sequelize['TEXT'](_0x4161('0x8'))},'read1stAt':{'type':Sequelize[_0x4161('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x4161('0x2')]('in',_0x4161('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x4161('0x6')]},'customerPort':{'type':Sequelize[_0x4161('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x4161('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x4161('0xa')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x4161('0xb')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 1f0a28a..5477d0f 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 _0x2faf=['secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','nolimit','order','sort','where','pick','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','include','findAll','rows','hasOwnProperty','ChatInteractionId','includeAgent','push','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','createdAt','Account','get','Chat','Owner','N.A.','closedAt','browserName','osName','referer','customerIp','tail','existsSync','pipe','createWriteStream','read','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','update','destroy','status','stack','name','send','render','merge','interaction','account','map','type','getOptions','chat','query','user','params','model','ChatInteraction','rawAttributes','keys','filters','intersection','attributes','fields','length','includeAll','create','body','find','describe','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','UserId','closed','disposition','AbandonInteraction','attachmentUpload','originalname','basename','filename','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','download','close','mailTranscript','root','server/files/chat/upload/','format','now','pathTranscript','User','ChatWebsite','ContactId','Messages','%s%d','agentAlias','System','customer','Visitor','website_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction'];(function(_0x4b649b,_0x544487){var _0x1a92a8=function(_0xa0f8b6){while(--_0xa0f8b6){_0x4b649b['push'](_0x4b649b['shift']());}};_0x1a92a8(++_0x544487);}(_0x2faf,0x114));var _0xf2fa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2faf[_0xa464c9];return _0x3d73c4;};'use strict';var rimraf=require(_0xf2fa('0x0'));var zipdir=require(_0xf2fa('0x1'));var rp=require('request-promise');var moment=require(_0xf2fa('0x2'));var BPromise=require(_0xf2fa('0x3'));var Mustache=require(_0xf2fa('0x4'));var util=require(_0xf2fa('0x5'));var path=require(_0xf2fa('0x6'));var ejs=require(_0xf2fa('0x7'));var fs=require('fs');var _=require(_0xf2fa('0x8'));var Redis=require(_0xf2fa('0x9'));var interaction=require(_0xf2fa('0xa'));var qs=require(_0xf2fa('0xb'));var pdf=require('../../components/export/pdf');var logger=require(_0xf2fa('0xc'))('api');var config=require('../../config/environment');var db=require(_0xf2fa('0xd'))['db'];config['redis']=_['defaults'](config[_0xf2fa('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xf2fa('0xf'))(new Redis(config['redis']));require(_0xf2fa('0x10'))[_0xf2fa('0x11')](socket);var jayson=require(_0xf2fa('0x12'));var client=jayson[_0xf2fa('0x13')]['http']({'port':0x232b});var client9004=jayson[_0xf2fa('0x13')]['http']({'port':0x232c});function respondWithRpcPromise(_0x153a45,_0xe024e6,_0x375f1d,_0x339a55){return new BPromise(function(_0x1e133e,_0x26c9cf){var _0xa131ad=_0x339a55||client;return _0xa131ad[_0xf2fa('0x14')](_0x153a45,_0x375f1d)[_0xf2fa('0x15')](function(_0x5e24fb){logger[_0xf2fa('0x16')](_0xf2fa('0x17'),_0xe024e6,'request\x20sent');logger[_0xf2fa('0x18')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xe024e6,'request\x20sent',JSON[_0xf2fa('0x19')](_0x5e24fb));if(_0x5e24fb[_0xf2fa('0x1a')]){if(_0x5e24fb[_0xf2fa('0x1a')][_0xf2fa('0x1b')]===0x1f4){logger[_0xf2fa('0x1a')](_0xf2fa('0x17'),_0xe024e6,_0x5e24fb[_0xf2fa('0x1a')][_0xf2fa('0x1c')]);return _0x26c9cf(_0x5e24fb[_0xf2fa('0x1a')][_0xf2fa('0x1c')]);}logger['error'](_0xf2fa('0x17'),_0xe024e6,_0x5e24fb[_0xf2fa('0x1a')][_0xf2fa('0x1c')]);return _0x1e133e(_0x5e24fb[_0xf2fa('0x1a')][_0xf2fa('0x1c')]);}else{logger['info'](_0xf2fa('0x17'),_0xe024e6,_0xf2fa('0x1d'));_0x1e133e(_0x5e24fb['result'][_0xf2fa('0x1c')]);}})[_0xf2fa('0x1e')](function(_0x4c47a9){logger[_0xf2fa('0x1a')](_0xf2fa('0x17'),_0xe024e6,_0x4c47a9);_0x26c9cf(_0x4c47a9);});});}function respondWithStatusCode(_0x1b99c7,_0x40dc30){_0x40dc30=_0x40dc30||0xcc;return function(_0x178e8a){if(_0x178e8a){return _0x1b99c7[_0xf2fa('0x1f')](_0x40dc30);}return _0x1b99c7['status'](_0x40dc30)[_0xf2fa('0x20')]();};}function respondWithResult(_0x9a8a7d,_0xb69e9e){_0xb69e9e=_0xb69e9e||0xc8;return function(_0x4722ca){if(_0x4722ca){return _0x9a8a7d['status'](_0xb69e9e)['json'](_0x4722ca);}};}function respondWithFilteredResult(_0x2c9429,_0x589b2d){return function(_0x52bedf){if(_0x52bedf){var _0x216862=typeof _0x589b2d[_0xf2fa('0x21')]===_0xf2fa('0x22')&&typeof _0x589b2d[_0xf2fa('0x23')]==='undefined';var _0x29e753=_0x52bedf[_0xf2fa('0x24')];var _0x5d70fb=_0x216862?0x0:_0x589b2d['offset'];var _0x26c676=_0x216862?_0x52bedf['count']:_0x589b2d[_0xf2fa('0x21')]+_0x589b2d[_0xf2fa('0x23')];var _0x35bbea;if(_0x26c676>=_0x29e753){_0x26c676=_0x29e753;_0x35bbea=0xc8;}else{_0x35bbea=0xce;}_0x2c9429['status'](_0x35bbea);return _0x2c9429[_0xf2fa('0x25')](_0xf2fa('0x26'),_0x5d70fb+'-'+_0x26c676+'/'+_0x29e753)[_0xf2fa('0x27')](_0x52bedf);}return null;};}function saveUpdates(_0xf3f270){return function(_0x3e75d6){if(_0x3e75d6){return _0x3e75d6[_0xf2fa('0x28')](_0xf3f270)[_0xf2fa('0x15')](function(_0x5c61dc){return _0x5c61dc;});}return null;};}function removeEntity(_0xe31ce6){return function(_0x4eb599){if(_0x4eb599){return _0x4eb599[_0xf2fa('0x29')]()[_0xf2fa('0x15')](function(){_0xe31ce6[_0xf2fa('0x2a')](0xcc)[_0xf2fa('0x20')]();});}};}function handleEntityNotFound(_0x4545b2){return function(_0x3605a7){if(!_0x3605a7){_0x4545b2['sendStatus'](0x194);}return _0x3605a7;};}function handleError(_0x57148c,_0x124179){_0x124179=_0x124179||0x1f4;return function(_0x285f27){logger['error'](_0x285f27[_0xf2fa('0x2b')]);if(_0x285f27[_0xf2fa('0x2c')]){delete _0x285f27['name'];}_0x57148c[_0xf2fa('0x2a')](_0x124179)[_0xf2fa('0x2d')](_0x285f27);};}function getMustacheRender(_0x46768f,_0xd3df82){return Mustache[_0xf2fa('0x2e')](_0x46768f,_[_0xf2fa('0x2f')](_0xd3df82['body'],{'contact':_0xd3df82['contact'],'message':_0xd3df82[_0xf2fa('0x1c')],'agent':_0xd3df82['agent'],'interaction':_0xd3df82[_0xf2fa('0x30')],'account':_0xd3df82[_0xf2fa('0x31')]}))||'';}exports['index']=function(_0x4c3def,_0x5017dd){var _0x1a07da={};var _0x294467=_[_0xf2fa('0x32')](db['ChatInteraction']['rawAttributes'],function(_0x421a9f){return{'name':_0x421a9f['fieldName'],'type':_0x421a9f[_0xf2fa('0x33')]['key']};});_0x1a07da=qs[_0xf2fa('0x34')](_0x294467,_0x4c3def);return interaction['findAll'](_0xf2fa('0x35'),_0x4c3def[_0xf2fa('0x36')],_0x4c3def[_0xf2fa('0x37')],_0x1a07da,_0x294467)['then'](respondWithFilteredResult(_0x5017dd,_0x1a07da))[_0xf2fa('0x1e')](handleError(_0x5017dd,null));};exports['show']=function(_0x112ee1,_0x438e12){var _0x426885={'raw':![],'where':{'id':_0x112ee1[_0xf2fa('0x38')]['id']}},_0x381c8e={};_0x381c8e[_0xf2fa('0x39')]=_['keys'](db[_0xf2fa('0x3a')][_0xf2fa('0x3b')]);_0x381c8e['query']=_[_0xf2fa('0x3c')](_0x112ee1[_0xf2fa('0x36')]);_0x381c8e[_0xf2fa('0x3d')]=_[_0xf2fa('0x3e')](_0x381c8e['model'],_0x381c8e[_0xf2fa('0x36')]);_0x426885[_0xf2fa('0x3f')]=_['intersection'](_0x381c8e['model'],qs[_0xf2fa('0x40')](_0x112ee1[_0xf2fa('0x36')][_0xf2fa('0x40')]));_0x426885[_0xf2fa('0x3f')]=_0x426885[_0xf2fa('0x3f')][_0xf2fa('0x41')]?_0x426885[_0xf2fa('0x3f')]:_0x381c8e[_0xf2fa('0x39')];if(_0x112ee1['query'][_0xf2fa('0x42')]){_0x426885['include']=[{'all':!![]}];}_0x426885=_[_0xf2fa('0x2f')]({},_0x426885,_0x112ee1['options']);return db[_0xf2fa('0x3a')]['find'](_0x426885)['then'](handleEntityNotFound(_0x438e12,null))['then'](respondWithResult(_0x438e12,null))[_0xf2fa('0x1e')](handleError(_0x438e12,null));};exports[_0xf2fa('0x43')]=function(_0x1fe147,_0x34419f){return db['ChatInteraction'][_0xf2fa('0x43')](_0x1fe147['body'],{})[_0xf2fa('0x15')](respondWithResult(_0x34419f,0xc9))[_0xf2fa('0x1e')](handleError(_0x34419f,null));};exports[_0xf2fa('0x28')]=function(_0x3b187f,_0xdf38ae){if(_0x3b187f['body']['id']){delete _0x3b187f[_0xf2fa('0x44')]['id'];}return db[_0xf2fa('0x3a')][_0xf2fa('0x45')]({'where':{'id':_0x3b187f[_0xf2fa('0x38')]['id']}})[_0xf2fa('0x15')](handleEntityNotFound(_0xdf38ae,null))[_0xf2fa('0x15')](saveUpdates(_0x3b187f[_0xf2fa('0x44')],null))['then'](respondWithResult(_0xdf38ae,null))[_0xf2fa('0x1e')](handleError(_0xdf38ae,null));};exports[_0xf2fa('0x29')]=function(_0x496cc8,_0x2a092f){return db['ChatInteraction'][_0xf2fa('0x45')]({'where':{'id':_0x496cc8[_0xf2fa('0x38')]['id']}})['then'](handleEntityNotFound(_0x2a092f,null))['then'](removeEntity(_0x2a092f,null))[_0xf2fa('0x1e')](handleError(_0x2a092f,null));};exports[_0xf2fa('0x46')]=function(_0x34f35e,_0x31a9c3){return db[_0xf2fa('0x3a')]['describe']()[_0xf2fa('0x15')](respondWithResult(_0x31a9c3,null))[_0xf2fa('0x1e')](handleError(_0x31a9c3,null));};exports['createVidaooSession']=function(_0x5ae15c,_0x2b7012){var _0x47cd30=_0x5ae15c[_0xf2fa('0x38')]['id'];var _0x32e7c4;var _0x347523;var _0x59c6f8;return db[_0xf2fa('0x3a')][_0xf2fa('0x47')]({'where':{'id':_0x47cd30}})[_0xf2fa('0x15')](function(_0x33369a){_0x32e7c4=_0x33369a;return db['ChatWebsite']['findOne']({'where':{'id':_0x33369a[_0xf2fa('0x48')]},'attributes':['id',_0xf2fa('0x49'),_0xf2fa('0x4a'),_0xf2fa('0x4b'),_0xf2fa('0x4c'),_0xf2fa('0x4d')],'raw':!![]});})[_0xf2fa('0x15')](function(_0x2d9f72){if(_0x2d9f72&&_0x2d9f72[_0xf2fa('0x49')]&&_0x2d9f72[_0xf2fa('0x4a')]){_0x347523=_0x2d9f72;var _0x48d55c={'interaction':{'id':_0x47cd30},'agent':{'id':_0x5ae15c['user']['id'],'name':_0x5ae15c['user'][_0xf2fa('0x2c')],'fullname':_0x5ae15c['user'][_0xf2fa('0x4e')],'email':_0x5ae15c[_0xf2fa('0x37')][_0xf2fa('0x4f')]},'contact':_0x5ae15c[_0xf2fa('0x44')][_0xf2fa('0x50')],'account':_0x5ae15c[_0xf2fa('0x44')]['account']};var _0x1e5e67={'rejectUnauthorized':![],'method':_0xf2fa('0x51'),'url':_0xf2fa('0x52'),'headers':{'X-APIKEY':_0x2d9f72[_0xf2fa('0x49')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5ae15c[_0xf2fa('0x37')]['email']],'buttons':null,'topic':_0x347523['vidaooTopic'],'note':_[_0xf2fa('0x53')](_0x347523[_0xf2fa('0x4c')])?null:getMustacheRender(_0x347523['vidaooNote'],_0x48d55c),'metadata':null},'redirect':_0xf2fa('0x54'),'json':!![]};try{if(!_[_0xf2fa('0x53')](_0x347523[_0xf2fa('0x4d')])){var _0xb0f779=getMustacheRender(_0x347523[_0xf2fa('0x4d')],_0x48d55c);var _0x230b66=JSON['parse'](_0xb0f779);_0x1e5e67[_0xf2fa('0x44')][_0xf2fa('0x55')]=_0x230b66;}}catch(_0x235cb4){throw new db[(_0xf2fa('0x56'))][(_0xf2fa('0x57'))](_0xf2fa('0x58'));}return rp(_0x1e5e67);}else{throw new db['Sequelize'][(_0xf2fa('0x57'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xf2fa('0x15')](function(_0x1b8cc6){_0x59c6f8=_0x1b8cc6;if(_0x59c6f8['id']){var _0x4d1715={'body':_0x59c6f8[_0xf2fa('0x59')],'ChatWebsiteId':_0x347523['id'],'ChatInteractionId':_0x32e7c4['id'],'direction':_0xf2fa('0x5a'),'UserId':_0x5ae15c[_0xf2fa('0x37')]['id']};return db[_0xf2fa('0x5b')][_0xf2fa('0x43')](_0x4d1715,{});}else{throw new db[(_0xf2fa('0x56'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xf2fa('0x15')](function(){return _0x32e7c4[_0xf2fa('0x5c')]({'vidaooSessionId':_0x59c6f8['id']});})[_0xf2fa('0x15')](respondWithResult(_0x2b7012,null))[_0xf2fa('0x1e')](handleError(_0x2b7012,null));};exports[_0xf2fa('0x5d')]=function(_0x5bb579,_0x237a6f){if(_0x5bb579[_0xf2fa('0x44')]['id']){delete _0x5bb579[_0xf2fa('0x44')]['id'];}return db[_0xf2fa('0x3a')]['find']({'where':{'id':_0x5bb579[_0xf2fa('0x38')]['id']},'include':[{'model':db[_0xf2fa('0x5e')],'as':'Contact'}]})[_0xf2fa('0x15')](handleEntityNotFound(_0x237a6f,null))[_0xf2fa('0x15')](saveUpdates(_0x5bb579[_0xf2fa('0x44')],null))[_0xf2fa('0x15')](respondWithResult(_0x237a6f,null))[_0xf2fa('0x1e')](handleError(_0x237a6f,null));};exports[_0xf2fa('0x5f')]=function(_0x203349,_0x122470){if(_0x203349['body']['id']){delete _0x203349[_0xf2fa('0x44')]['id'];}return db[_0xf2fa('0x3a')][_0xf2fa('0x45')]({'where':{'id':_0x203349['params']['id']}})[_0xf2fa('0x15')](function(_0x40493d){if(!_0x40493d){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,_0xf2fa('0x60'));_0x122470['sendStatus'](0x194);}else{if(_0x40493d[_0xf2fa('0x61')]){throw new db[(_0xf2fa('0x56'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x40493d;})[_0xf2fa('0x15')](function(_0x3b16ff){if(_0x3b16ff){return _0x3b16ff[_0xf2fa('0x28')]({'closed':_0x203349[_0xf2fa('0x44')][_0xf2fa('0x62')],'disposition':_0x203349['body'][_0xf2fa('0x63')]})[_0xf2fa('0x15')](function(_0x2c83f7){return _0x2c83f7;});}})['then'](function(){return respondWithRpcPromise(_0xf2fa('0x64'),_0xf2fa('0x5f'),_0x203349[_0xf2fa('0x44')],client9004);})[_0xf2fa('0x15')](respondWithResult(_0x122470,null))['catch'](handleError(_0x122470,null));};exports[_0xf2fa('0x65')]=function(_0x215845,_0x5a4a96){_0x215845[_0xf2fa('0x44')][_0xf2fa('0x2c')]=_0x215845['file'][_0xf2fa('0x66')];_0x215845['body'][_0xf2fa('0x67')]=_0x215845['file'][_0xf2fa('0x68')];_0x215845['body'][_0xf2fa('0x33')]=_0x215845['file']['mimetype'];return db[_0xf2fa('0x69')][_0xf2fa('0x43')](_0x215845[_0xf2fa('0x44')])['then'](respondWithResult(_0x5a4a96,0xc9))[_0xf2fa('0x1e')](handleError(_0x5a4a96,null));};exports[_0xf2fa('0x6a')]=function(_0x22db86,_0x4e4d1d){return db['ChatInteraction'][_0xf2fa('0x47')]({'where':{'id':_0x22db86['params']['id']},'raw':!![]})[_0xf2fa('0x15')](handleEntityNotFound(_0x4e4d1d,null))[_0xf2fa('0x15')](function(_0x52386d){if(_0x52386d){if(_0x52386d[_0xf2fa('0x62')]){return _0x4e4d1d[_0xf2fa('0x2a')](0x193)[_0xf2fa('0x27')]({'status':0x193,'message':_0xf2fa('0x6b')});}return db['Attachment']['findOne']({'where':{'id':_0x22db86[_0xf2fa('0x36')][_0xf2fa('0x6c')]},'raw':!![]})[_0xf2fa('0x15')](handleEntityNotFound(_0x4e4d1d,null));}})[_0xf2fa('0x15')](function(_0x126f28){if(_0x126f28){var _0xa068a2=_0x126f28[_0xf2fa('0x6d')]!==null;var _0x2ef7ec=path[_0xf2fa('0x6e')](config['root'],_0xf2fa('0x6f'));if(_0xa068a2){_0x2ef7ec=path['join'](_0x2ef7ec,_0xf2fa('0x70'));}var _0x4ccf37=path[_0xf2fa('0x6e')](_0x2ef7ec,_0x126f28[_0xf2fa('0x67')]);return _0x4e4d1d[_0xf2fa('0x71')](_0x4ccf37);}})[_0xf2fa('0x1e')](handleError(_0x4e4d1d,null));};exports[_0xf2fa('0x72')]=function(_0x46a15a,_0x40b0c2){var _0x411d64=null;var _0x4bb0f4=null;var _0x524fc6=null;if(_0x46a15a['body']['id']){delete _0x46a15a[_0xf2fa('0x44')]['id'];}if(_0x46a15a['body'][_0xf2fa('0x73')]){_0x524fc6=path['join'](config[_0xf2fa('0x74')],_0xf2fa('0x75'),util[_0xf2fa('0x76')]('transcript-%s.txt',Date[_0xf2fa('0x77')]()));_0x46a15a['body'][_0xf2fa('0x78')]=_0x524fc6;}return db[_0xf2fa('0x3a')][_0xf2fa('0x45')]({'where':{'id':_0x46a15a['params']['id']},'include':[{'model':db[_0xf2fa('0x5b')],'as':'Messages','include':[{'model':db[_0xf2fa('0x79')],'as':'User'}]}]})[_0xf2fa('0x15')](handleEntityNotFound(_0x40b0c2,null))[_0xf2fa('0x15')](saveUpdates(_0x46a15a[_0xf2fa('0x44')],null))[_0xf2fa('0x15')](function(_0x188bae){if(_0x188bae){_0x411d64=_0x188bae;return db[_0xf2fa('0x7a')][_0xf2fa('0x45')]({'where':{'id':_0x411d64[_0xf2fa('0x48')]}});}})['then'](function(_0x32a7e8){if(_0x32a7e8){_0x4bb0f4=_0x32a7e8;return db[_0xf2fa('0x5e')]['find']({'where':{'id':_0x411d64[_0xf2fa('0x7b')]}});}})[_0xf2fa('0x15')](function(_0x5012e2){if(_0x5012e2){if(_0x524fc6){var _0xb2a141=null;for(var _0x4f67a9=0x1;_0x4f67a9<_0x411d64[_0xf2fa('0x7c')][_0xf2fa('0x41')];++_0x4f67a9){_0xb2a141=_0x411d64['Messages'][_0x4f67a9];var _0x45b8ba=_0xb2a141[_0xf2fa('0x61')]?util[_0xf2fa('0x76')](_0xf2fa('0x7d'),_0x4bb0f4[_0xf2fa('0x7e')],_0xb2a141[_0xf2fa('0x61')]):_0xf2fa('0x7f');var _0x14eabf=_0x46a15a[_0xf2fa('0x44')][_0xf2fa('0x80')]||util[_0xf2fa('0x76')](_0xf2fa('0x7d'),_0xf2fa('0x81'),_0xb2a141[_0xf2fa('0x7b')]);switch(_0x4bb0f4['agentIdentifier']){case _0xf2fa('0x82'):_0x45b8ba=_0xb2a141[_0xf2fa('0x61')]?util['format'](_0xf2fa('0x7d'),_0x4bb0f4[_0xf2fa('0x7e')],_0xb2a141[_0xf2fa('0x61')]):_0xf2fa('0x7f');break;case'agent_alias':_0x45b8ba=_0xb2a141[_0xf2fa('0x61')]?_0xb2a141[_0xf2fa('0x79')][_0xf2fa('0x83')]||_0xb2a141[_0xf2fa('0x79')][_0xf2fa('0x4e')]:'System';break;case _0xf2fa('0x84'):_0x45b8ba=_0xb2a141[_0xf2fa('0x61')]?_0xb2a141[_0xf2fa('0x79')][_0xf2fa('0x4e')]:_0xf2fa('0x7f');break;default:_0x45b8ba=_0xb2a141['UserId']?util[_0xf2fa('0x76')](_0xf2fa('0x7d'),_0x4bb0f4[_0xf2fa('0x7e')],_0xb2a141[_0xf2fa('0x61')]):_0xf2fa('0x7f');}var _0x10fae9=util[_0xf2fa('0x76')](_0xf2fa('0x85'),moment(_0xb2a141['createdAt'])[_0xf2fa('0x76')](_0xf2fa('0x86')),_0xb2a141[_0xf2fa('0x87')]==='in'?_0x14eabf:_0x45b8ba,_0xb2a141[_0xf2fa('0x44')]);if(!_0xb2a141[_0xf2fa('0x88')]){fs[_0xf2fa('0x89')](_0x524fc6,_0x10fae9);}}return db[_0xf2fa('0x8a')][_0xf2fa('0x47')]({'where':{'service':!![]},'include':[{'model':db[_0xf2fa('0x8b')],'as':_0xf2fa('0x8c'),'raw':!![],'include':[{'model':db[_0xf2fa('0x8d')],'as':_0xf2fa('0x8d'),'raw':!![]}]}]});}}})[_0xf2fa('0x15')](function(_0x4526cb){if(!_0x4526cb||!_0x4526cb[_0xf2fa('0x8c')]||!_0x46a15a[_0xf2fa('0x44')])return _0x411d64;var _0x30dd7c=_0x4526cb[_0xf2fa('0x8e')]();return respondWithRpcPromise(_0xf2fa('0x8f'),'sendMail',{'account':_0x30dd7c,'message':{'from':util[_0xf2fa('0x76')]('\x22%s\x22\x20<%s>',_0x4526cb[_0xf2fa('0x2c')],_0x4526cb[_0xf2fa('0x4f')]||_0x4526cb[_0xf2fa('0x8c')][_0xf2fa('0x37')]),'to':_0x46a15a[_0xf2fa('0x44')][_0xf2fa('0x73')],'subject':_0xf2fa('0x90'),'text':util[_0xf2fa('0x76')](_0xf2fa('0x91'),_0x46a15a[_0xf2fa('0x44')][_0xf2fa('0x73')]),'attachments':[{'path':_0x524fc6}]}})[_0xf2fa('0x15')](function(){return _0x411d64;})[_0xf2fa('0x1e')](function(_0x4f2d36){logger['error'](_0x4f2d36);});})['then'](respondWithStatusCode(_0x40b0c2,0xc8))[_0xf2fa('0x1e')](handleError(_0x40b0c2,null));};exports[_0xf2fa('0x92')]=function(_0x2a4c02,_0x2cc662){return db['ChatMessage'][_0xf2fa('0x45')]({'where':{'id':_0x2a4c02[_0xf2fa('0x38')]['id']}})['then'](handleEntityNotFound(_0x2cc662,null))[_0xf2fa('0x15')](function(_0x4d3776){if(_0x4d3776){return _0x4d3776['addMessage'](_0x2a4c02[_0xf2fa('0x44')]['ids'],_[_0xf2fa('0x93')](_0x2a4c02[_0xf2fa('0x44')],[_0xf2fa('0x94'),'id'])||{});}})[_0xf2fa('0x15')](respondWithResult(_0x2cc662,null))[_0xf2fa('0x1e')](handleError(_0x2cc662,null));};exports[_0xf2fa('0x95')]=function(_0x5d097e,_0x4bb3c2){var _0x512d89={'raw':![],'where':{}};var _0x5b17ae={};var _0x409764={'count':0x0,'rows':[]};return db[_0xf2fa('0x3a')][_0xf2fa('0x47')]({'where':{'id':_0x5d097e[_0xf2fa('0x38')]['id']}})['then'](handleEntityNotFound(_0x4bb3c2,null))[_0xf2fa('0x15')](function(_0x524c48){if(_0x524c48){_0x5b17ae[_0xf2fa('0x39')]=_['keys'](db[_0xf2fa('0x5b')][_0xf2fa('0x3b')]);_0x5b17ae['query']=_['keys'](_0x5d097e[_0xf2fa('0x36')]);_0x5b17ae['filters']=_[_0xf2fa('0x3e')](_0x5b17ae['model'],_0x5b17ae[_0xf2fa('0x36')]);_0x512d89[_0xf2fa('0x3f')]=_[_0xf2fa('0x3e')](_0x5b17ae['model'],qs['fields'](_0x5d097e[_0xf2fa('0x36')]['fields']));_0x512d89[_0xf2fa('0x3f')]=_0x512d89[_0xf2fa('0x3f')][_0xf2fa('0x41')]?_0x512d89[_0xf2fa('0x3f')]:_0x5b17ae['model'];if(!_0x5d097e[_0xf2fa('0x36')]['hasOwnProperty'](_0xf2fa('0x96'))){_0x512d89[_0xf2fa('0x23')]=qs['limit'](_0x5d097e[_0xf2fa('0x36')][_0xf2fa('0x23')]);_0x512d89['offset']=qs[_0xf2fa('0x21')](_0x5d097e['query']['offset']);}_0x512d89[_0xf2fa('0x97')]=qs[_0xf2fa('0x98')](_0x5d097e[_0xf2fa('0x36')][_0xf2fa('0x98')]);_0x512d89[_0xf2fa('0x99')]=qs[_0xf2fa('0x3d')](_[_0xf2fa('0x9a')](_0x5d097e[_0xf2fa('0x36')],_0x5b17ae['filters']));_0x512d89[_0xf2fa('0x99')]['ChatInteractionId']=_0x524c48['id'];if(_0x5d097e[_0xf2fa('0x36')][_0xf2fa('0x9b')]){_0x512d89[_0xf2fa('0x99')]=_[_0xf2fa('0x2f')](_0x512d89[_0xf2fa('0x99')],{'$or':_[_0xf2fa('0x32')](_0x512d89['attributes'],function(_0x10136a){var _0x44f34a={};_0x44f34a[_0x10136a]={'$like':'%'+_0x5d097e[_0xf2fa('0x36')][_0xf2fa('0x9b')]+'%'};return _0x44f34a;})});}if(_0x5d097e[_0xf2fa('0x36')]['$gte']){var _0x2b5a04=_0x5d097e[_0xf2fa('0x36')][_0xf2fa('0x9c')][_0xf2fa('0x9d')](',');var _0x9ddd6={};_0x9ddd6[_0x2b5a04[0x0]]={'$gte':moment(_0x2b5a04[0x1])['format'](_0xf2fa('0x9e'))};_0x512d89[_0xf2fa('0x99')]=_[_0xf2fa('0x2f')](_0x512d89[_0xf2fa('0x99')],_0x9ddd6);}_0x512d89=_[_0xf2fa('0x2f')]({},_0x512d89,_0x5d097e[_0xf2fa('0x9f')]);return db[_0xf2fa('0x5b')][_0xf2fa('0x24')]({'where':_0x512d89[_0xf2fa('0x99')]})['then'](function(_0x52f48f){_0x409764[_0xf2fa('0x24')]=_0x52f48f;if(_0x5d097e[_0xf2fa('0x36')][_0xf2fa('0x42')]){_0x512d89[_0xf2fa('0xa0')]=[{'all':!![]}];}return db[_0xf2fa('0x5b')][_0xf2fa('0xa1')](_0x512d89);})[_0xf2fa('0x15')](function(_0x4e7161){_0x409764[_0xf2fa('0xa2')]=_0x4e7161;return _0x409764;});}})[_0xf2fa('0x15')](respondWithFilteredResult(_0x4bb3c2,_0x512d89))[_0xf2fa('0x1e')](handleError(_0x4bb3c2,null));};exports['getMyMessages']=function(_0x4dd93c,_0x2ac43c){var _0x59b864={'where':{}},_0x53221c={},_0x1ae891={'count':0x0,'rows':[]};return db[_0xf2fa('0x3a')]['findOne']({'where':{'id':_0x4dd93c[_0xf2fa('0x38')]['id']}})[_0xf2fa('0x15')](handleEntityNotFound(_0x2ac43c,null))[_0xf2fa('0x15')](function(_0x4ae4df){if(_0x4ae4df){_0x53221c['model']=_[_0xf2fa('0x3c')](db['ChatMessage'][_0xf2fa('0x3b')]);_0x53221c[_0xf2fa('0x36')]=_[_0xf2fa('0x3c')](_0x4dd93c['query']);_0x53221c[_0xf2fa('0x3d')]=_[_0xf2fa('0x3e')](_0x53221c[_0xf2fa('0x39')],_0x53221c[_0xf2fa('0x36')]);_0x59b864[_0xf2fa('0x3f')]=_[_0xf2fa('0x3e')](_0x53221c[_0xf2fa('0x39')],qs['fields'](_0x4dd93c[_0xf2fa('0x36')]['fields']));_0x59b864[_0xf2fa('0x3f')]=_0x59b864[_0xf2fa('0x3f')]['length']?_0x59b864['attributes']:_0x53221c[_0xf2fa('0x39')];if(!_0x4dd93c[_0xf2fa('0x36')][_0xf2fa('0xa3')]('nolimit')){_0x59b864['limit']=qs[_0xf2fa('0x23')](_0x4dd93c['query'][_0xf2fa('0x23')]);_0x59b864[_0xf2fa('0x21')]=qs[_0xf2fa('0x21')](_0x4dd93c['query'][_0xf2fa('0x21')]);}_0x59b864[_0xf2fa('0x97')]=qs[_0xf2fa('0x98')](_0x4dd93c[_0xf2fa('0x36')][_0xf2fa('0x98')]);_0x59b864[_0xf2fa('0x99')]=qs['filters'](_[_0xf2fa('0x9a')](_0x4dd93c[_0xf2fa('0x36')],_0x53221c[_0xf2fa('0x3d')]));_0x59b864[_0xf2fa('0x99')][_0xf2fa('0xa4')]=_0x4ae4df['id'];if(_0x4dd93c['query'][_0xf2fa('0x9b')]){_0x59b864[_0xf2fa('0x99')]=_[_0xf2fa('0x2f')](_0x59b864[_0xf2fa('0x99')],{'$or':_[_0xf2fa('0x32')](_0x59b864[_0xf2fa('0x3f')],function(_0x3bde55){var _0x20357f={};_0x20357f[_0x3bde55]={'$like':'%'+_0x4dd93c['query'][_0xf2fa('0x9b')]+'%'};return _0x20357f;})});}_0x59b864[_0xf2fa('0x99')][_0xf2fa('0x88')]=![];if(_0x4dd93c['query']['id']){_0x59b864[_0xf2fa('0x99')]['id']={'$gt':_0x4dd93c[_0xf2fa('0x36')]['id']};}_0x59b864=_[_0xf2fa('0x2f')]({},_0x59b864,_0x4dd93c[_0xf2fa('0x9f')]);return db['ChatMessage']['count']({'where':_0x59b864[_0xf2fa('0x99')]})[_0xf2fa('0x15')](function(_0x5776d7){_0x1ae891['count']=_0x5776d7;_0x59b864[_0xf2fa('0xa0')]=[];if(_0x4dd93c[_0xf2fa('0x36')][_0xf2fa('0xa5')]){_0x59b864[_0xf2fa('0xa0')][_0xf2fa('0xa6')]({'model':db['User'],'as':'User','attributes':['id',_0xf2fa('0x4e'),_0xf2fa('0x83')]});}if(_0x4dd93c[_0xf2fa('0x36')][_0xf2fa('0x42')]){_0x59b864[_0xf2fa('0xa0')]=[{'all':!![]}];}return db[_0xf2fa('0x5b')][_0xf2fa('0xa1')](_0x59b864);})[_0xf2fa('0x15')](function(_0x430fdb){_0x1ae891['rows']=_0x430fdb;return _0x1ae891;});}})['then'](respondWithFilteredResult(_0x2ac43c,_0x59b864))['catch'](handleError(_0x2ac43c,null));};exports['addTags']=function(_0x2dd141,_0x16f79d){return db[_0xf2fa('0x3a')][_0xf2fa('0x45')]({'where':{'id':_0x2dd141['params']['id']}})[_0xf2fa('0x15')](handleEntityNotFound(_0x16f79d,null))[_0xf2fa('0x15')](function(_0x424dc4){if(_0x424dc4){return _0x424dc4[_0xf2fa('0xa7')](_0x2dd141[_0xf2fa('0x44')][_0xf2fa('0x94')],_[_0xf2fa('0x93')](_0x2dd141[_0xf2fa('0x44')],[_0xf2fa('0x94'),'id'])||{})[_0xf2fa('0xa8')](function(){return db[_0xf2fa('0xa9')][_0xf2fa('0xa1')]({'attributes':['id',_0xf2fa('0x2c'),'color'],'where':{'id':_0x2dd141[_0xf2fa('0x44')][_0xf2fa('0x94')]}});})[_0xf2fa('0x15')](function(_0x20a488){socket[_0xf2fa('0xaa')](_0xf2fa('0xab'),{'id':Number(_0x2dd141[_0xf2fa('0x38')]['id']),'tags':_0x20a488||[]});return{'id':Number(_0x2dd141['params']['id']),'tags':_0x20a488||[]};});}})[_0xf2fa('0x15')](respondWithResult(_0x16f79d,null))[_0xf2fa('0x1e')](handleError(_0x16f79d,null));};exports[_0xf2fa('0xac')]=function(_0x3b645a,_0xfb9985){return db[_0xf2fa('0x3a')][_0xf2fa('0x45')]({'where':{'id':_0x3b645a[_0xf2fa('0x38')]['id']}})['then'](handleEntityNotFound(_0xfb9985,null))[_0xf2fa('0x15')](function(_0x567bc8){if(_0x567bc8){return _0x567bc8[_0xf2fa('0xac')](_0x3b645a[_0xf2fa('0x36')][_0xf2fa('0x94')]);}})[_0xf2fa('0x15')](respondWithStatusCode(_0xfb9985,null))[_0xf2fa('0x1e')](handleError(_0xfb9985,null));};exports[_0xf2fa('0x71')]=function(_0x38b6e4,_0x278409){var _0x40433f=moment()[_0xf2fa('0xad')]()[_0xf2fa('0xae')]();var _0x428d86=path['join'](config[_0xf2fa('0x74')],_0xf2fa('0xaf'),_0xf2fa('0xb0'),_0xf2fa('0xb1'));var _0x3a23a6=path['join'](config[_0xf2fa('0x74')],_0xf2fa('0xaf'),'files',_0xf2fa('0xb2'));var _0x121fc8=path['join'](_0x428d86,_0x40433f);var _0x553b27=util[_0xf2fa('0x76')](_0xf2fa('0xb3'),_0x38b6e4['params']['id'],_0x40433f);var _0x59201f=path[_0xf2fa('0x6e')](_0x428d86,_0x553b27);var _0x3f0502=[];_0x3f0502['push']({'model':db[_0xf2fa('0x79')],'as':_0xf2fa('0x79'),'attributes':['id',_0xf2fa('0x4e')],'raw':!![]});_0x3f0502[_0xf2fa('0xa6')]({'model':db['CmContact'],'as':_0xf2fa('0xb4'),'attributes':['id',_0xf2fa('0xb5'),_0xf2fa('0xb6')],'raw':!![]});if(_0x38b6e4[_0xf2fa('0x36')][_0xf2fa('0xb2')]){_0x3f0502[_0xf2fa('0xa6')]({'model':db[_0xf2fa('0x69')],'as':_0xf2fa('0x69'),'raw':!![]});}var _0x32e3d9=[{'model':db['ChatMessage'],'as':_0xf2fa('0x7c'),'attributes':['id','body',_0xf2fa('0xb7'),'direction',_0xf2fa('0x88'),'read'],'include':_0x3f0502}];_0x32e3d9['push']({'model':db[_0xf2fa('0x7a')],'as':_0xf2fa('0xb8'),'attributes':['id',_0xf2fa('0x2c')]});_0x32e3d9[_0xf2fa('0xa6')]({'model':db[_0xf2fa('0x79')],'as':'Owner','attributes':['id',_0xf2fa('0x4e')]});return db[_0xf2fa('0x3a')]['find']({'where':{'id':_0x38b6e4[_0xf2fa('0x38')]['id']},'include':_0x32e3d9})[_0xf2fa('0x15')](handleEntityNotFound(_0x278409,null))[_0xf2fa('0x15')](function(_0x4e5c7f){if(_0x4e5c7f){var _0x2eab29=_0x4e5c7f[_0xf2fa('0xb9')]({'plain':!![]});fs['mkdirSync'](_0x121fc8);var _0x10663f={'channel':_0xf2fa('0xba'),'account':_0x2eab29[_0xf2fa('0xb8')][_0xf2fa('0x2c')],'agent':_0x2eab29[_0xf2fa('0xbb')]?_0x2eab29['Owner'][_0xf2fa('0x4e')]:_0xf2fa('0xbc'),'createdAt':moment(_0x2eab29[_0xf2fa('0xb7')])[_0xf2fa('0x76')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x2eab29[_0xf2fa('0x62')]?moment(_0x2eab29[_0xf2fa('0xbd')])[_0xf2fa('0x76')](_0xf2fa('0x9e'))[_0xf2fa('0xae')]():'','disposition':_0x2eab29[_0xf2fa('0x63')],'chatInfo':{'browser':_0x2eab29[_0xf2fa('0xbe')],'os':_0x2eab29[_0xf2fa('0xbf')],'referer':_0x2eab29[_0xf2fa('0xc0')],'customerIp':_0x2eab29[_0xf2fa('0xc1')],'customerPort':_0x2eab29['customerPort']?_0x2eab29['customerPort']:_0xf2fa('0xbc')},'messages':_(_0x2eab29[_0xf2fa('0x7c')])[_0xf2fa('0xc2')]()[_0xf2fa('0x9b')]({'secret':![]})[_0xf2fa('0x32')](function(_0x5aea6e){if(_0x5aea6e[_0xf2fa('0x69')]){var _0x269b60=path[_0xf2fa('0x6e')](_0x3a23a6,_0x5aea6e[_0xf2fa('0x69')][_0xf2fa('0x67')]);if(fs[_0xf2fa('0xc3')](_0x269b60)){fs['createReadStream'](_0x269b60)[_0xf2fa('0xc4')](fs[_0xf2fa('0xc5')](path[_0xf2fa('0x6e')](_0x121fc8,_0x5aea6e[_0xf2fa('0x69')]['basename'])));}}return{'date':moment(_0x5aea6e[_0xf2fa('0xb7')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xf2fa('0xae')](),'sender':_0x5aea6e[_0xf2fa('0x87')]===_0xf2fa('0x5a')?_0x5aea6e[_0xf2fa('0x79')]?_0x5aea6e[_0xf2fa('0x79')][_0xf2fa('0x4e')]:_0xf2fa('0x7f'):_0x5aea6e[_0xf2fa('0xb4')][_0xf2fa('0xb5')]+(_0x5aea6e[_0xf2fa('0xb4')][_0xf2fa('0xb6')]?'\x20'+_0x5aea6e[_0xf2fa('0xb4')]['lastName']:''),'body':_0x5aea6e['Attachment']?_0x5aea6e['Attachment']['basename']:_0x5aea6e[_0xf2fa('0x44')],'direction':_0x5aea6e[_0xf2fa('0x87')]===_0xf2fa('0x5a')?'A':'C','secret':_0x5aea6e[_0xf2fa('0x88')],'read':_0x5aea6e[_0xf2fa('0xc6')],'attachment':_0x5aea6e[_0xf2fa('0x69')]};})[_0xf2fa('0xc7')]()};return ejs[_0xf2fa('0xc8')](path[_0xf2fa('0x6e')](config[_0xf2fa('0x74')],_0xf2fa('0xaf'),_0xf2fa('0xc9'),_0xf2fa('0xca')),{'interaction':_0x10663f})['then'](function(_0x580e53){var _0x426fcf=path[_0xf2fa('0x6e')](_0x121fc8,_0xf2fa('0xcb')+_0x2eab29['id']+'-'+_0x40433f+'.pdf');var _0x4c8b88={'path':_0x426fcf,'channel':_0xf2fa('0xba'),'interactionId':_0x2eab29['id']};return pdf[_0xf2fa('0xcc')](_0x580e53,_0x4c8b88);})[_0xf2fa('0x15')](function(){return new Promise(function(_0x1b336e,_0x343241){zipdir(_0x121fc8,{'saveTo':_0x59201f},function(_0x5848ea,_0x3d49f9){if(_0x5848ea)return _0x343241(_0x5848ea);return _0x1b336e(_0x3d49f9);});})[_0xf2fa('0x15')](function(){return new BPromise(function(_0x59eaf4,_0x438f3d){rimraf(_0x121fc8,function(_0x40b2b9){if(_0x40b2b9)_0x438f3d(_0x40b2b9);return _0x59eaf4();});});})['then'](function(){return _0x278409[_0xf2fa('0x71')](_0x59201f,_0x553b27,function(_0x5a482c){if(_0x5a482c){logger[_0xf2fa('0x1a')]('err',_0x5a482c);}else{fs[_0xf2fa('0xcd')](_0x59201f);}});});});}else{return _0x278409['sendStatus'](0xc8);}})['catch'](handleError(_0x278409,null));};
\ No newline at end of file
+var _0x22c9=['Messages','User','ChatWebsiteId','ContactId','length','%s%d','agentAlias','customer','Visitor','System','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','hasOwnProperty','nolimit','order','sort','where','pick','filter','split','rows','getMyMessages','ChatInteractionId','push','addTags','setTags','spread','Tag','color','chatInteractionTags:save','removeTags','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Account','get','mkdirSync','Chat','Owner','N.A.','closedAt','YYYY-MM-DD\x20HH:mm:ss','toString','osName','customerIp','customerPort','tail','value','renderFile','views','downloadInteraction.ejs','createPdfFromHTML','rimraf','zip-dir','request-promise','moment','mustache','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','request','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','map','ChatInteraction','rawAttributes','type','key','getOptions','findAll','chat','query','user','show','params','model','keys','filters','intersection','attributes','fields','includeAll','include','options','create','find','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','isNull','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','basename','filename','mimetype','Attachment','Unauthorized','attachId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now'];(function(_0x120f6d,_0x543071){var _0x1498dd=function(_0x350147){while(--_0x350147){_0x120f6d['push'](_0x120f6d['shift']());}};_0x1498dd(++_0x543071);}(_0x22c9,0x1cf));var _0x922c=function(_0x524bb0,_0x326327){_0x524bb0=_0x524bb0-0x0;var _0x2fb947=_0x22c9[_0x524bb0];return _0x2fb947;};'use strict';var rimraf=require(_0x922c('0x0'));var zipdir=require(_0x922c('0x1'));var rp=require(_0x922c('0x2'));var moment=require(_0x922c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x922c('0x4'));var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x922c('0x5'));var Redis=require('ioredis');var interaction=require(_0x922c('0x6'));var qs=require(_0x922c('0x7'));var pdf=require('../../components/export/pdf');var logger=require(_0x922c('0x8'))('api');var config=require(_0x922c('0x9'));var db=require('../../mysqldb')['db'];config[_0x922c('0xa')]=_[_0x922c('0xb')](config[_0x922c('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x922c('0xc'))(new Redis(config[_0x922c('0xa')]));require(_0x922c('0xd'))[_0x922c('0xe')](socket);var jayson=require(_0x922c('0xf'));var client=jayson['client']['http']({'port':0x232b});var client9004=jayson[_0x922c('0x10')]['http']({'port':0x232c});function respondWithRpcPromise(_0x42088a,_0x4d9075,_0x4b4b6b,_0xa5676c){return new BPromise(function(_0x29005e,_0x4092a5){var _0x160522=_0xa5676c||client;return _0x160522[_0x922c('0x11')](_0x42088a,_0x4b4b6b)['then'](function(_0x10a1ae){logger[_0x922c('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x4d9075,_0x922c('0x13'));logger[_0x922c('0x14')](_0x922c('0x15'),_0x4d9075,_0x922c('0x13'),JSON[_0x922c('0x16')](_0x10a1ae));if(_0x10a1ae[_0x922c('0x17')]){if(_0x10a1ae[_0x922c('0x17')]['code']===0x1f4){logger['error'](_0x922c('0x18'),_0x4d9075,_0x10a1ae['error'][_0x922c('0x19')]);return _0x4092a5(_0x10a1ae['error'][_0x922c('0x19')]);}logger[_0x922c('0x17')](_0x922c('0x18'),_0x4d9075,_0x10a1ae[_0x922c('0x17')][_0x922c('0x19')]);return _0x29005e(_0x10a1ae[_0x922c('0x17')][_0x922c('0x19')]);}else{logger[_0x922c('0x12')](_0x922c('0x18'),_0x4d9075,_0x922c('0x13'));_0x29005e(_0x10a1ae['result']['message']);}})[_0x922c('0x1a')](function(_0x3ec5e6){logger[_0x922c('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x4d9075,_0x3ec5e6);_0x4092a5(_0x3ec5e6);});});}function respondWithStatusCode(_0x5618e9,_0x5a4f5b){_0x5a4f5b=_0x5a4f5b||0xcc;return function(_0x2343e3){if(_0x2343e3){return _0x5618e9[_0x922c('0x1b')](_0x5a4f5b);}return _0x5618e9[_0x922c('0x1c')](_0x5a4f5b)[_0x922c('0x1d')]();};}function respondWithResult(_0x154b65,_0x52596c){_0x52596c=_0x52596c||0xc8;return function(_0x34a5f7){if(_0x34a5f7){return _0x154b65[_0x922c('0x1c')](_0x52596c)[_0x922c('0x1e')](_0x34a5f7);}};}function respondWithFilteredResult(_0x64aa91,_0x40220c){return function(_0x2e5f95){if(_0x2e5f95){var _0x2c4a5a=typeof _0x40220c[_0x922c('0x1f')]===_0x922c('0x20')&&typeof _0x40220c['limit']===_0x922c('0x20');var _0x5273f1=_0x2e5f95[_0x922c('0x21')];var _0x54f8b9=_0x2c4a5a?0x0:_0x40220c[_0x922c('0x1f')];var _0x26cc1a=_0x2c4a5a?_0x2e5f95[_0x922c('0x21')]:_0x40220c[_0x922c('0x1f')]+_0x40220c[_0x922c('0x22')];var _0x32b499;if(_0x26cc1a>=_0x5273f1){_0x26cc1a=_0x5273f1;_0x32b499=0xc8;}else{_0x32b499=0xce;}_0x64aa91['status'](_0x32b499);return _0x64aa91[_0x922c('0x23')](_0x922c('0x24'),_0x54f8b9+'-'+_0x26cc1a+'/'+_0x5273f1)[_0x922c('0x1e')](_0x2e5f95);}return null;};}function saveUpdates(_0x1e79ce){return function(_0x5b5ee6){if(_0x5b5ee6){return _0x5b5ee6[_0x922c('0x25')](_0x1e79ce)[_0x922c('0x26')](function(_0x1914b9){return _0x1914b9;});}return null;};}function removeEntity(_0x8fcf59){return function(_0x210113){if(_0x210113){return _0x210113[_0x922c('0x27')]()[_0x922c('0x26')](function(){_0x8fcf59['status'](0xcc)[_0x922c('0x1d')]();});}};}function handleEntityNotFound(_0x44dddd){return function(_0x1f6af2){if(!_0x1f6af2){_0x44dddd[_0x922c('0x1b')](0x194);}return _0x1f6af2;};}function handleError(_0x5103a4,_0x13221e){_0x13221e=_0x13221e||0x1f4;return function(_0x1fc26c){logger[_0x922c('0x17')](_0x1fc26c[_0x922c('0x28')]);if(_0x1fc26c['name']){delete _0x1fc26c[_0x922c('0x29')];}_0x5103a4[_0x922c('0x1c')](_0x13221e)[_0x922c('0x2a')](_0x1fc26c);};}function getMustacheRender(_0x560d65,_0x3c0d55){return Mustache[_0x922c('0x2b')](_0x560d65,_[_0x922c('0x2c')](_0x3c0d55[_0x922c('0x2d')],{'contact':_0x3c0d55[_0x922c('0x2e')],'message':_0x3c0d55[_0x922c('0x19')],'agent':_0x3c0d55[_0x922c('0x2f')],'interaction':_0x3c0d55[_0x922c('0x30')],'account':_0x3c0d55[_0x922c('0x31')]}))||'';}exports['index']=function(_0x36ecd9,_0x26fec6){var _0x111a5a={};var _0x53a0b0=_[_0x922c('0x32')](db[_0x922c('0x33')][_0x922c('0x34')],function(_0x4bc671){return{'name':_0x4bc671['fieldName'],'type':_0x4bc671[_0x922c('0x35')][_0x922c('0x36')]};});_0x111a5a=qs[_0x922c('0x37')](_0x53a0b0,_0x36ecd9);return interaction[_0x922c('0x38')](_0x922c('0x39'),_0x36ecd9[_0x922c('0x3a')],_0x36ecd9[_0x922c('0x3b')],_0x111a5a,_0x53a0b0)['then'](respondWithFilteredResult(_0x26fec6,_0x111a5a))['catch'](handleError(_0x26fec6,null));};exports[_0x922c('0x3c')]=function(_0x42418d,_0x40e142){var _0x25a71d={'raw':![],'where':{'id':_0x42418d[_0x922c('0x3d')]['id']}},_0x4beff6={};_0x4beff6[_0x922c('0x3e')]=_[_0x922c('0x3f')](db[_0x922c('0x33')][_0x922c('0x34')]);_0x4beff6['query']=_[_0x922c('0x3f')](_0x42418d[_0x922c('0x3a')]);_0x4beff6[_0x922c('0x40')]=_[_0x922c('0x41')](_0x4beff6[_0x922c('0x3e')],_0x4beff6['query']);_0x25a71d[_0x922c('0x42')]=_['intersection'](_0x4beff6[_0x922c('0x3e')],qs[_0x922c('0x43')](_0x42418d['query'][_0x922c('0x43')]));_0x25a71d[_0x922c('0x42')]=_0x25a71d[_0x922c('0x42')]['length']?_0x25a71d[_0x922c('0x42')]:_0x4beff6['model'];if(_0x42418d[_0x922c('0x3a')][_0x922c('0x44')]){_0x25a71d[_0x922c('0x45')]=[{'all':!![]}];}_0x25a71d=_[_0x922c('0x2c')]({},_0x25a71d,_0x42418d[_0x922c('0x46')]);return db['ChatInteraction']['find'](_0x25a71d)['then'](handleEntityNotFound(_0x40e142,null))[_0x922c('0x26')](respondWithResult(_0x40e142,null))[_0x922c('0x1a')](handleError(_0x40e142,null));};exports[_0x922c('0x47')]=function(_0x46195e,_0x43ce1f){return db[_0x922c('0x33')][_0x922c('0x47')](_0x46195e[_0x922c('0x2d')],{})[_0x922c('0x26')](respondWithResult(_0x43ce1f,0xc9))[_0x922c('0x1a')](handleError(_0x43ce1f,null));};exports[_0x922c('0x25')]=function(_0x3ca96d,_0x48d3bf){if(_0x3ca96d[_0x922c('0x2d')]['id']){delete _0x3ca96d[_0x922c('0x2d')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x3ca96d[_0x922c('0x3d')]['id']}})[_0x922c('0x26')](handleEntityNotFound(_0x48d3bf,null))[_0x922c('0x26')](saveUpdates(_0x3ca96d['body'],null))[_0x922c('0x26')](respondWithResult(_0x48d3bf,null))['catch'](handleError(_0x48d3bf,null));};exports['destroy']=function(_0x1c9022,_0x11eddb){return db[_0x922c('0x33')][_0x922c('0x48')]({'where':{'id':_0x1c9022[_0x922c('0x3d')]['id']}})[_0x922c('0x26')](handleEntityNotFound(_0x11eddb,null))[_0x922c('0x26')](removeEntity(_0x11eddb,null))[_0x922c('0x1a')](handleError(_0x11eddb,null));};exports[_0x922c('0x49')]=function(_0x295d00,_0x26e89c){return db['ChatInteraction'][_0x922c('0x49')]()[_0x922c('0x26')](respondWithResult(_0x26e89c,null))[_0x922c('0x1a')](handleError(_0x26e89c,null));};exports[_0x922c('0x4a')]=function(_0x4a6a1b,_0xd8a884){var _0x143b02=_0x4a6a1b['params']['id'];var _0x1cea44;var _0x11d0d1;var _0x5736a0;return db[_0x922c('0x33')][_0x922c('0x4b')]({'where':{'id':_0x143b02}})['then'](function(_0x3be5b2){_0x1cea44=_0x3be5b2;return db[_0x922c('0x4c')][_0x922c('0x4b')]({'where':{'id':_0x3be5b2['ChatWebsiteId']},'attributes':['id',_0x922c('0x4d'),_0x922c('0x4e'),_0x922c('0x4f'),_0x922c('0x50'),_0x922c('0x51')],'raw':!![]});})['then'](function(_0x4d804a){if(_0x4d804a&&_0x4d804a['vidaooApiKey']&&_0x4d804a[_0x922c('0x4e')]){_0x11d0d1=_0x4d804a;var _0x2ad2f3={'interaction':{'id':_0x143b02},'agent':{'id':_0x4a6a1b[_0x922c('0x3b')]['id'],'name':_0x4a6a1b['user']['name'],'fullname':_0x4a6a1b[_0x922c('0x3b')][_0x922c('0x52')],'email':_0x4a6a1b[_0x922c('0x3b')][_0x922c('0x53')]},'contact':_0x4a6a1b[_0x922c('0x2d')]['contact'],'account':_0x4a6a1b[_0x922c('0x2d')][_0x922c('0x31')]};var _0x217719={'rejectUnauthorized':![],'method':_0x922c('0x54'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x4d804a[_0x922c('0x4d')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4a6a1b[_0x922c('0x3b')][_0x922c('0x53')]],'buttons':null,'topic':_0x11d0d1['vidaooTopic'],'note':_[_0x922c('0x55')](_0x11d0d1[_0x922c('0x50')])?null:getMustacheRender(_0x11d0d1[_0x922c('0x50')],_0x2ad2f3),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x11d0d1[_0x922c('0x51')])){var _0x8a2794=getMustacheRender(_0x11d0d1['vidaooMetadata'],_0x2ad2f3);var _0x22cc44=JSON[_0x922c('0x56')](_0x8a2794);_0x217719[_0x922c('0x2d')][_0x922c('0x57')]=_0x22cc44;}}catch(_0x3e18cf){throw new db[(_0x922c('0x58'))][(_0x922c('0x59'))](_0x922c('0x5a'));}return rp(_0x217719);}else{throw new db['Sequelize'][(_0x922c('0x59'))](_0x922c('0x5b'));}})['then'](function(_0x4d98de){_0x5736a0=_0x4d98de;if(_0x5736a0['id']){var _0x13e74b={'body':_0x5736a0[_0x922c('0x5c')],'ChatWebsiteId':_0x11d0d1['id'],'ChatInteractionId':_0x1cea44['id'],'direction':_0x922c('0x5d'),'UserId':_0x4a6a1b[_0x922c('0x3b')]['id']};return db[_0x922c('0x5e')][_0x922c('0x47')](_0x13e74b,{});}else{throw new db[(_0x922c('0x58'))][(_0x922c('0x59'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x922c('0x26')](function(){return _0x1cea44[_0x922c('0x5f')]({'vidaooSessionId':_0x5736a0['id']});})[_0x922c('0x26')](respondWithResult(_0xd8a884,null))[_0x922c('0x1a')](handleError(_0xd8a884,null));};exports[_0x922c('0x60')]=function(_0x4bc9e1,_0x587129){if(_0x4bc9e1[_0x922c('0x2d')]['id']){delete _0x4bc9e1['body']['id'];}return db[_0x922c('0x33')]['find']({'where':{'id':_0x4bc9e1[_0x922c('0x3d')]['id']},'include':[{'model':db[_0x922c('0x61')],'as':_0x922c('0x62')}]})[_0x922c('0x26')](handleEntityNotFound(_0x587129,null))[_0x922c('0x26')](saveUpdates(_0x4bc9e1[_0x922c('0x2d')],null))[_0x922c('0x26')](respondWithResult(_0x587129,null))[_0x922c('0x1a')](handleError(_0x587129,null));};exports[_0x922c('0x63')]=function(_0x517de8,_0x57a2d4){if(_0x517de8[_0x922c('0x2d')]['id']){delete _0x517de8[_0x922c('0x2d')]['id'];}return db[_0x922c('0x33')][_0x922c('0x48')]({'where':{'id':_0x517de8[_0x922c('0x3d')]['id']}})[_0x922c('0x26')](function(_0x40924c){if(!_0x40924c){logger[_0x922c('0x17')](_0x922c('0x64'),_0x922c('0x63'),0x194,_0x922c('0x65'));_0x57a2d4['sendStatus'](0x194);}else{if(_0x40924c[_0x922c('0x66')]){throw new db[(_0x922c('0x58'))][(_0x922c('0x59'))](_0x922c('0x67'));}}return _0x40924c;})[_0x922c('0x26')](function(_0x363e52){if(_0x363e52){return _0x363e52['update']({'closed':_0x517de8[_0x922c('0x2d')][_0x922c('0x68')],'disposition':_0x517de8[_0x922c('0x2d')][_0x922c('0x69')]})['then'](function(_0x105aff){return _0x105aff;});}})[_0x922c('0x26')](function(){return respondWithRpcPromise(_0x922c('0x6a'),_0x922c('0x63'),_0x517de8['body'],client9004);})[_0x922c('0x26')](respondWithResult(_0x57a2d4,null))[_0x922c('0x1a')](handleError(_0x57a2d4,null));};exports['attachmentUpload']=function(_0x2710de,_0x34f6a4){_0x2710de['body'][_0x922c('0x29')]=_0x2710de[_0x922c('0x6b')]['originalname'];_0x2710de[_0x922c('0x2d')][_0x922c('0x6c')]=_0x2710de[_0x922c('0x6b')][_0x922c('0x6d')];_0x2710de[_0x922c('0x2d')][_0x922c('0x35')]=_0x2710de[_0x922c('0x6b')][_0x922c('0x6e')];return db[_0x922c('0x6f')][_0x922c('0x47')](_0x2710de[_0x922c('0x2d')])[_0x922c('0x26')](respondWithResult(_0x34f6a4,0xc9))[_0x922c('0x1a')](handleError(_0x34f6a4,null));};exports['attachmentDownload']=function(_0x59f65b,_0x571443){return db[_0x922c('0x33')][_0x922c('0x4b')]({'where':{'id':_0x59f65b[_0x922c('0x3d')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x571443,null))['then'](function(_0x6bf263){if(_0x6bf263){if(_0x6bf263[_0x922c('0x68')]){return _0x571443[_0x922c('0x1c')](0x193)[_0x922c('0x1e')]({'status':0x193,'message':_0x922c('0x70')});}return db[_0x922c('0x6f')]['findOne']({'where':{'id':_0x59f65b[_0x922c('0x3a')][_0x922c('0x71')]},'raw':!![]})[_0x922c('0x26')](handleEntityNotFound(_0x571443,null));}})[_0x922c('0x26')](function(_0x5cb8a0){if(_0x5cb8a0){var _0x5d6f66=_0x5cb8a0['ChatOfflineMessageId']!==null;var _0x537d63=path[_0x922c('0x72')](config[_0x922c('0x73')],_0x922c('0x74'));if(_0x5d6f66){_0x537d63=path['join'](_0x537d63,_0x922c('0x75'));}var _0x12f2f4=path[_0x922c('0x72')](_0x537d63,_0x5cb8a0['basename']);return _0x571443[_0x922c('0x76')](_0x12f2f4);}})[_0x922c('0x1a')](handleError(_0x571443,null));};exports[_0x922c('0x77')]=function(_0x1657f8,_0x33ad10){var _0x2d7719=null;var _0x3bfba7=null;var _0x196f69=null;if(_0x1657f8[_0x922c('0x2d')]['id']){delete _0x1657f8[_0x922c('0x2d')]['id'];}if(_0x1657f8[_0x922c('0x2d')][_0x922c('0x78')]){_0x196f69=path[_0x922c('0x72')](config[_0x922c('0x73')],_0x922c('0x79'),util[_0x922c('0x7a')](_0x922c('0x7b'),Date[_0x922c('0x7c')]()));_0x1657f8['body']['pathTranscript']=_0x196f69;}return db[_0x922c('0x33')]['find']({'where':{'id':_0x1657f8['params']['id']},'include':[{'model':db[_0x922c('0x5e')],'as':_0x922c('0x7d'),'include':[{'model':db['User'],'as':_0x922c('0x7e')}]}]})['then'](handleEntityNotFound(_0x33ad10,null))[_0x922c('0x26')](saveUpdates(_0x1657f8[_0x922c('0x2d')],null))['then'](function(_0x50b5cb){if(_0x50b5cb){_0x2d7719=_0x50b5cb;return db['ChatWebsite'][_0x922c('0x48')]({'where':{'id':_0x2d7719[_0x922c('0x7f')]}});}})['then'](function(_0x5cddbb){if(_0x5cddbb){_0x3bfba7=_0x5cddbb;return db[_0x922c('0x61')][_0x922c('0x48')]({'where':{'id':_0x2d7719[_0x922c('0x80')]}});}})['then'](function(_0x348655){if(_0x348655){if(_0x196f69){var _0x561aca=null;for(var _0x2737a2=0x1;_0x2737a2<_0x2d7719[_0x922c('0x7d')][_0x922c('0x81')];++_0x2737a2){_0x561aca=_0x2d7719[_0x922c('0x7d')][_0x2737a2];var _0x3eb06d=_0x561aca[_0x922c('0x66')]?util[_0x922c('0x7a')](_0x922c('0x82'),_0x3bfba7[_0x922c('0x83')],_0x561aca[_0x922c('0x66')]):'System';var _0xd27d02=_0x1657f8['body'][_0x922c('0x84')]||util['format'](_0x922c('0x82'),_0x922c('0x85'),_0x561aca['ContactId']);switch(_0x3bfba7['agentIdentifier']){case'website_alias':_0x3eb06d=_0x561aca[_0x922c('0x66')]?util['format'](_0x922c('0x82'),_0x3bfba7['agentAlias'],_0x561aca['UserId']):_0x922c('0x86');break;case'agent_alias':_0x3eb06d=_0x561aca[_0x922c('0x66')]?_0x561aca[_0x922c('0x7e')][_0x922c('0x87')]||_0x561aca[_0x922c('0x7e')][_0x922c('0x52')]:_0x922c('0x86');break;case _0x922c('0x88'):_0x3eb06d=_0x561aca[_0x922c('0x66')]?_0x561aca[_0x922c('0x7e')]['fullname']:_0x922c('0x86');break;default:_0x3eb06d=_0x561aca[_0x922c('0x66')]?util[_0x922c('0x7a')](_0x922c('0x82'),_0x3bfba7[_0x922c('0x83')],_0x561aca[_0x922c('0x66')]):'System';}var _0x725a1=util['format'](_0x922c('0x89'),moment(_0x561aca[_0x922c('0x8a')])['format'](_0x922c('0x8b')),_0x561aca[_0x922c('0x8c')]==='in'?_0xd27d02:_0x3eb06d,_0x561aca[_0x922c('0x2d')]);if(!_0x561aca[_0x922c('0x8d')]){fs['appendFileSync'](_0x196f69,_0x725a1);}}return db['MailAccount'][_0x922c('0x4b')]({'where':{'service':!![]},'include':[{'model':db[_0x922c('0x8e')],'as':_0x922c('0x8f'),'raw':!![],'include':[{'model':db[_0x922c('0x90')],'as':_0x922c('0x90'),'raw':!![]}]}]});}}})[_0x922c('0x26')](function(_0x5b7cbe){if(!_0x5b7cbe||!_0x5b7cbe[_0x922c('0x8f')]||!_0x1657f8[_0x922c('0x2d')])return _0x2d7719;var _0x180d60=_0x5b7cbe[_0x922c('0x91')]();return respondWithRpcPromise(_0x922c('0x92'),'sendMail',{'account':_0x180d60,'message':{'from':util[_0x922c('0x7a')](_0x922c('0x93'),_0x5b7cbe[_0x922c('0x29')],_0x5b7cbe[_0x922c('0x53')]||_0x5b7cbe[_0x922c('0x8f')][_0x922c('0x3b')]),'to':_0x1657f8[_0x922c('0x2d')][_0x922c('0x78')],'subject':'Mail\x20Transcript','text':util['format'](_0x922c('0x94'),_0x1657f8['body'][_0x922c('0x78')]),'attachments':[{'path':_0x196f69}]}})[_0x922c('0x26')](function(){return _0x2d7719;})[_0x922c('0x1a')](function(_0x305f7f){logger[_0x922c('0x17')](_0x305f7f);});})[_0x922c('0x26')](respondWithStatusCode(_0x33ad10,0xc8))[_0x922c('0x1a')](handleError(_0x33ad10,null));};exports[_0x922c('0x95')]=function(_0x5e4417,_0x5c044f){return db[_0x922c('0x5e')]['find']({'where':{'id':_0x5e4417[_0x922c('0x3d')]['id']}})[_0x922c('0x26')](handleEntityNotFound(_0x5c044f,null))[_0x922c('0x26')](function(_0x1d583b){if(_0x1d583b){return _0x1d583b[_0x922c('0x95')](_0x5e4417[_0x922c('0x2d')][_0x922c('0x96')],_[_0x922c('0x97')](_0x5e4417[_0x922c('0x2d')],[_0x922c('0x96'),'id'])||{});}})[_0x922c('0x26')](respondWithResult(_0x5c044f,null))[_0x922c('0x1a')](handleError(_0x5c044f,null));};exports['getMessages']=function(_0x34a96d,_0x68257a){var _0x3beb16={'raw':![],'where':{}};var _0x55abc8={};var _0x29eb3b={'count':0x0,'rows':[]};return db[_0x922c('0x33')][_0x922c('0x4b')]({'where':{'id':_0x34a96d[_0x922c('0x3d')]['id']}})[_0x922c('0x26')](handleEntityNotFound(_0x68257a,null))[_0x922c('0x26')](function(_0xb1de28){if(_0xb1de28){_0x55abc8[_0x922c('0x3e')]=_[_0x922c('0x3f')](db[_0x922c('0x5e')]['rawAttributes']);_0x55abc8[_0x922c('0x3a')]=_['keys'](_0x34a96d[_0x922c('0x3a')]);_0x55abc8[_0x922c('0x40')]=_['intersection'](_0x55abc8[_0x922c('0x3e')],_0x55abc8['query']);_0x3beb16[_0x922c('0x42')]=_[_0x922c('0x41')](_0x55abc8[_0x922c('0x3e')],qs[_0x922c('0x43')](_0x34a96d['query'][_0x922c('0x43')]));_0x3beb16[_0x922c('0x42')]=_0x3beb16[_0x922c('0x42')][_0x922c('0x81')]?_0x3beb16[_0x922c('0x42')]:_0x55abc8[_0x922c('0x3e')];if(!_0x34a96d['query'][_0x922c('0x98')](_0x922c('0x99'))){_0x3beb16[_0x922c('0x22')]=qs['limit'](_0x34a96d[_0x922c('0x3a')]['limit']);_0x3beb16[_0x922c('0x1f')]=qs[_0x922c('0x1f')](_0x34a96d['query'][_0x922c('0x1f')]);}_0x3beb16[_0x922c('0x9a')]=qs[_0x922c('0x9b')](_0x34a96d['query'][_0x922c('0x9b')]);_0x3beb16[_0x922c('0x9c')]=qs['filters'](_[_0x922c('0x9d')](_0x34a96d[_0x922c('0x3a')],_0x55abc8['filters']));_0x3beb16['where']['ChatInteractionId']=_0xb1de28['id'];if(_0x34a96d[_0x922c('0x3a')][_0x922c('0x9e')]){_0x3beb16['where']=_[_0x922c('0x2c')](_0x3beb16[_0x922c('0x9c')],{'$or':_[_0x922c('0x32')](_0x3beb16['attributes'],function(_0x48ef62){var _0x3e4113={};_0x3e4113[_0x48ef62]={'$like':'%'+_0x34a96d[_0x922c('0x3a')][_0x922c('0x9e')]+'%'};return _0x3e4113;})});}if(_0x34a96d[_0x922c('0x3a')]['$gte']){var _0xc11ab7=_0x34a96d[_0x922c('0x3a')]['$gte'][_0x922c('0x9f')](',');var _0x44797e={};_0x44797e[_0xc11ab7[0x0]]={'$gte':moment(_0xc11ab7[0x1])[_0x922c('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3beb16[_0x922c('0x9c')]=_[_0x922c('0x2c')](_0x3beb16[_0x922c('0x9c')],_0x44797e);}_0x3beb16=_['merge']({},_0x3beb16,_0x34a96d[_0x922c('0x46')]);return db[_0x922c('0x5e')]['count']({'where':_0x3beb16[_0x922c('0x9c')]})[_0x922c('0x26')](function(_0x1b60b5){_0x29eb3b[_0x922c('0x21')]=_0x1b60b5;if(_0x34a96d[_0x922c('0x3a')][_0x922c('0x44')]){_0x3beb16['include']=[{'all':!![]}];}return db[_0x922c('0x5e')][_0x922c('0x38')](_0x3beb16);})[_0x922c('0x26')](function(_0x4f3f1a){_0x29eb3b[_0x922c('0xa0')]=_0x4f3f1a;return _0x29eb3b;});}})[_0x922c('0x26')](respondWithFilteredResult(_0x68257a,_0x3beb16))[_0x922c('0x1a')](handleError(_0x68257a,null));};exports[_0x922c('0xa1')]=function(_0x54e5ea,_0x40d71c){var _0x24e4db={'where':{}},_0xe2576f={},_0x107659={'count':0x0,'rows':[]};return db[_0x922c('0x33')][_0x922c('0x4b')]({'where':{'id':_0x54e5ea[_0x922c('0x3d')]['id']}})[_0x922c('0x26')](handleEntityNotFound(_0x40d71c,null))['then'](function(_0x5b0062){if(_0x5b0062){_0xe2576f['model']=_[_0x922c('0x3f')](db[_0x922c('0x5e')][_0x922c('0x34')]);_0xe2576f[_0x922c('0x3a')]=_[_0x922c('0x3f')](_0x54e5ea[_0x922c('0x3a')]);_0xe2576f[_0x922c('0x40')]=_[_0x922c('0x41')](_0xe2576f['model'],_0xe2576f[_0x922c('0x3a')]);_0x24e4db[_0x922c('0x42')]=_[_0x922c('0x41')](_0xe2576f['model'],qs[_0x922c('0x43')](_0x54e5ea[_0x922c('0x3a')][_0x922c('0x43')]));_0x24e4db['attributes']=_0x24e4db['attributes'][_0x922c('0x81')]?_0x24e4db[_0x922c('0x42')]:_0xe2576f[_0x922c('0x3e')];if(!_0x54e5ea['query'][_0x922c('0x98')](_0x922c('0x99'))){_0x24e4db[_0x922c('0x22')]=qs[_0x922c('0x22')](_0x54e5ea[_0x922c('0x3a')][_0x922c('0x22')]);_0x24e4db['offset']=qs[_0x922c('0x1f')](_0x54e5ea['query'][_0x922c('0x1f')]);}_0x24e4db['order']=qs[_0x922c('0x9b')](_0x54e5ea[_0x922c('0x3a')][_0x922c('0x9b')]);_0x24e4db[_0x922c('0x9c')]=qs[_0x922c('0x40')](_[_0x922c('0x9d')](_0x54e5ea['query'],_0xe2576f[_0x922c('0x40')]));_0x24e4db[_0x922c('0x9c')][_0x922c('0xa2')]=_0x5b0062['id'];if(_0x54e5ea[_0x922c('0x3a')][_0x922c('0x9e')]){_0x24e4db[_0x922c('0x9c')]=_[_0x922c('0x2c')](_0x24e4db[_0x922c('0x9c')],{'$or':_[_0x922c('0x32')](_0x24e4db[_0x922c('0x42')],function(_0x43ea50){var _0x5d895e={};_0x5d895e[_0x43ea50]={'$like':'%'+_0x54e5ea[_0x922c('0x3a')][_0x922c('0x9e')]+'%'};return _0x5d895e;})});}_0x24e4db['where'][_0x922c('0x8d')]=![];if(_0x54e5ea['query']['id']){_0x24e4db[_0x922c('0x9c')]['id']={'$gt':_0x54e5ea[_0x922c('0x3a')]['id']};}_0x24e4db=_[_0x922c('0x2c')]({},_0x24e4db,_0x54e5ea[_0x922c('0x46')]);return db[_0x922c('0x5e')][_0x922c('0x21')]({'where':_0x24e4db['where']})['then'](function(_0x3b55a0){_0x107659[_0x922c('0x21')]=_0x3b55a0;_0x24e4db[_0x922c('0x45')]=[];if(_0x54e5ea[_0x922c('0x3a')]['includeAgent']){_0x24e4db['include'][_0x922c('0xa3')]({'model':db['User'],'as':'User','attributes':['id',_0x922c('0x52'),'alias']});}if(_0x54e5ea[_0x922c('0x3a')][_0x922c('0x44')]){_0x24e4db[_0x922c('0x45')]=[{'all':!![]}];}return db[_0x922c('0x5e')][_0x922c('0x38')](_0x24e4db);})[_0x922c('0x26')](function(_0x3061ca){_0x107659[_0x922c('0xa0')]=_0x3061ca;return _0x107659;});}})[_0x922c('0x26')](respondWithFilteredResult(_0x40d71c,_0x24e4db))[_0x922c('0x1a')](handleError(_0x40d71c,null));};exports[_0x922c('0xa4')]=function(_0x47f9c4,_0x5768e1){return db[_0x922c('0x33')][_0x922c('0x48')]({'where':{'id':_0x47f9c4[_0x922c('0x3d')]['id']}})[_0x922c('0x26')](handleEntityNotFound(_0x5768e1,null))[_0x922c('0x26')](function(_0x3f7f97){if(_0x3f7f97){return _0x3f7f97[_0x922c('0xa5')](_0x47f9c4[_0x922c('0x2d')][_0x922c('0x96')],_[_0x922c('0x97')](_0x47f9c4[_0x922c('0x2d')],[_0x922c('0x96'),'id'])||{})[_0x922c('0xa6')](function(){return db[_0x922c('0xa7')][_0x922c('0x38')]({'attributes':['id',_0x922c('0x29'),_0x922c('0xa8')],'where':{'id':_0x47f9c4['body']['ids']}});})[_0x922c('0x26')](function(_0x48d45e){socket['emit'](_0x922c('0xa9'),{'id':Number(_0x47f9c4[_0x922c('0x3d')]['id']),'tags':_0x48d45e||[]});return{'id':Number(_0x47f9c4[_0x922c('0x3d')]['id']),'tags':_0x48d45e||[]};});}})[_0x922c('0x26')](respondWithResult(_0x5768e1,null))[_0x922c('0x1a')](handleError(_0x5768e1,null));};exports[_0x922c('0xaa')]=function(_0x4a080a,_0x54da9b){return db[_0x922c('0x33')]['find']({'where':{'id':_0x4a080a[_0x922c('0x3d')]['id']}})[_0x922c('0x26')](handleEntityNotFound(_0x54da9b,null))['then'](function(_0xd23953){if(_0xd23953){return _0xd23953[_0x922c('0xaa')](_0x4a080a['query'][_0x922c('0x96')]);}})[_0x922c('0x26')](respondWithStatusCode(_0x54da9b,null))['catch'](handleError(_0x54da9b,null));};exports[_0x922c('0x76')]=function(_0x31037,_0x2d9529){var _0x3413df=moment()['unix']()['toString']();var _0x471566=path[_0x922c('0x72')](config['root'],_0x922c('0xab'),_0x922c('0xac'),_0x922c('0xad'));var _0x2066e5=path[_0x922c('0x72')](config['root'],_0x922c('0xab'),_0x922c('0xac'),_0x922c('0xae'));var _0x8a770=path[_0x922c('0x72')](_0x471566,_0x3413df);var _0x57b32d=util[_0x922c('0x7a')](_0x922c('0xaf'),_0x31037[_0x922c('0x3d')]['id'],_0x3413df);var _0xb04275=path['join'](_0x471566,_0x57b32d);var _0x497595=[];_0x497595[_0x922c('0xa3')]({'model':db[_0x922c('0x7e')],'as':'User','attributes':['id',_0x922c('0x52')],'raw':!![]});_0x497595[_0x922c('0xa3')]({'model':db['CmContact'],'as':_0x922c('0x62'),'attributes':['id',_0x922c('0xb0'),_0x922c('0xb1')],'raw':!![]});if(_0x31037['query'][_0x922c('0xae')]){_0x497595[_0x922c('0xa3')]({'model':db[_0x922c('0x6f')],'as':_0x922c('0x6f'),'raw':!![]});}var _0x26cb92=[{'model':db[_0x922c('0x5e')],'as':_0x922c('0x7d'),'attributes':['id',_0x922c('0x2d'),_0x922c('0x8a'),_0x922c('0x8c'),_0x922c('0x8d'),'read'],'include':_0x497595}];_0x26cb92[_0x922c('0xa3')]({'model':db[_0x922c('0x4c')],'as':_0x922c('0xb2'),'attributes':['id',_0x922c('0x29')]});_0x26cb92[_0x922c('0xa3')]({'model':db[_0x922c('0x7e')],'as':'Owner','attributes':['id',_0x922c('0x52')]});return db[_0x922c('0x33')][_0x922c('0x48')]({'where':{'id':_0x31037['params']['id']},'include':_0x26cb92})[_0x922c('0x26')](handleEntityNotFound(_0x2d9529,null))[_0x922c('0x26')](function(_0x27deb7){if(_0x27deb7){var _0x343f88=_0x27deb7[_0x922c('0xb3')]({'plain':!![]});fs[_0x922c('0xb4')](_0x8a770);var _0x396a03={'channel':_0x922c('0xb5'),'account':_0x343f88['Account'][_0x922c('0x29')],'agent':_0x343f88[_0x922c('0xb6')]?_0x343f88['Owner'][_0x922c('0x52')]:_0x922c('0xb7'),'createdAt':moment(_0x343f88['createdAt'])[_0x922c('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x343f88[_0x922c('0x68')]?moment(_0x343f88[_0x922c('0xb8')])['format'](_0x922c('0xb9'))[_0x922c('0xba')]():'','disposition':_0x343f88[_0x922c('0x69')],'chatInfo':{'browser':_0x343f88['browserName'],'os':_0x343f88[_0x922c('0xbb')],'referer':_0x343f88['referer'],'customerIp':_0x343f88[_0x922c('0xbc')],'customerPort':_0x343f88[_0x922c('0xbd')]?_0x343f88[_0x922c('0xbd')]:'N.A.'},'messages':_(_0x343f88[_0x922c('0x7d')])[_0x922c('0xbe')]()[_0x922c('0x9e')]({'secret':![]})[_0x922c('0x32')](function(_0x4ee643){if(_0x4ee643['Attachment']){var _0x11d914=path['join'](_0x2066e5,_0x4ee643[_0x922c('0x6f')][_0x922c('0x6c')]);if(fs['existsSync'](_0x11d914)){fs['createReadStream'](_0x11d914)['pipe'](fs['createWriteStream'](path[_0x922c('0x72')](_0x8a770,_0x4ee643[_0x922c('0x6f')]['basename'])));}}return{'date':moment(_0x4ee643['createdAt'])['format'](_0x922c('0xb9'))[_0x922c('0xba')](),'sender':_0x4ee643[_0x922c('0x8c')]===_0x922c('0x5d')?_0x4ee643[_0x922c('0x7e')]?_0x4ee643[_0x922c('0x7e')]['fullname']:'System':_0x4ee643[_0x922c('0x62')][_0x922c('0xb0')]+(_0x4ee643[_0x922c('0x62')][_0x922c('0xb1')]?'\x20'+_0x4ee643['Contact']['lastName']:''),'body':_0x4ee643[_0x922c('0x6f')]?_0x4ee643['Attachment']['basename']:_0x4ee643[_0x922c('0x2d')],'direction':_0x4ee643[_0x922c('0x8c')]===_0x922c('0x5d')?'A':'C','secret':_0x4ee643[_0x922c('0x8d')],'read':_0x4ee643['read'],'attachment':_0x4ee643[_0x922c('0x6f')]};})[_0x922c('0xbf')]()};return ejs[_0x922c('0xc0')](path[_0x922c('0x72')](config[_0x922c('0x73')],_0x922c('0xab'),_0x922c('0xc1'),_0x922c('0xc2')),{'interaction':_0x396a03})[_0x922c('0x26')](function(_0x9e417){var _0x3b8d7c=path[_0x922c('0x72')](_0x8a770,'transcript-'+_0x343f88['id']+'-'+_0x3413df+'.pdf');var _0x462156={'path':_0x3b8d7c,'channel':_0x922c('0xb5'),'interactionId':_0x343f88['id']};return pdf[_0x922c('0xc3')](_0x9e417,_0x462156);})[_0x922c('0x26')](function(){return new Promise(function(_0xf3ff5f,_0x5aaf2a){zipdir(_0x8a770,{'saveTo':_0xb04275},function(_0x35881f,_0x5a648a){if(_0x35881f)return _0x5aaf2a(_0x35881f);return _0xf3ff5f(_0x5a648a);});})[_0x922c('0x26')](function(){return new BPromise(function(_0x1f7f45,_0x4623ff){rimraf(_0x8a770,function(_0x139250){if(_0x139250)_0x4623ff(_0x139250);return _0x1f7f45();});});})[_0x922c('0x26')](function(){return _0x2d9529[_0x922c('0x76')](_0xb04275,_0x57b32d,function(_0x3ddb88){if(_0x3ddb88){logger[_0x922c('0x17')]('err',_0x3ddb88);}else{fs['unlinkSync'](_0xb04275);}});});});}else{return _0x2d9529[_0x922c('0x1b')](0xc8);}})[_0x922c('0x1a')](handleError(_0x2d9529,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index da7bc7c..4391334 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 _0x7ed4=['then','setDataValue','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','../../mysqldb','save','update','remove'];(function(_0x34b821,_0x504e55){var _0x5e00a0=function(_0x242892){while(--_0x242892){_0x34b821['push'](_0x34b821['shift']());}};_0x5e00a0(++_0x504e55);}(_0x7ed4,0x182));var _0x47ed=function(_0x4cc280,_0x3b77f3){_0x4cc280=_0x4cc280-0x0;var _0x16ed24=_0x7ed4[_0x4cc280];return _0x16ed24;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x47ed('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0x47ed('0x0'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x47ed('0x1'),'afterUpdate':_0x47ed('0x2'),'afterDestroy':_0x47ed('0x3')};function emitEvent(_0x2b8bf2){return function(_0x2a7ebd,_0x53d383,_0x497689){_0x2a7ebd['getUsers']({'attributes':['id'],'raw':!![]})[_0x47ed('0x4')](function(_0x26bd9a){_0x2a7ebd[_0x47ed('0x5')]('Users',_0x26bd9a['map'](function(_0x374ed6){return{'id':_0x374ed6['id']};}));return ChatMessage[_0x47ed('0x6')]({'where':{'ChatInteractionId':_0x2a7ebd['id'],'direction':'in','read':![]},'raw':!![]});})[_0x47ed('0x4')](function(_0x20d1b0){_0x2a7ebd[_0x47ed('0x5')](_0x47ed('0x7'),_0x20d1b0[_0x47ed('0x8')]);ChatInteractionEvents[_0x47ed('0x9')](_0x2b8bf2+':'+_0x2a7ebd['id'],_0x2a7ebd);ChatInteractionEvents['emit'](_0x2b8bf2,_0x2a7ebd);_0x497689(null);})['catch'](_0x497689(null));};}for(var e in events){if(events[_0x47ed('0xa')](e)){var event=events[e];ChatInteraction[_0x47ed('0xb')](e,emitEvent(event));}}module[_0x47ed('0xc')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xb9fe=['hook','exports','events','../../mysqldb','ChatInteraction','save','update','then','setDataValue','findAll','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x4ccf86,_0x4f71e5){var _0x2e1688=function(_0x17c013){while(--_0x17c013){_0x4ccf86['push'](_0x4ccf86['shift']());}};_0x2e1688(++_0x4f71e5);}(_0xb9fe,0x7a));var _0xeb9f=function(_0x17b169,_0x5e3f15){_0x17b169=_0x17b169-0x0;var _0x2b4ad4=_0xb9fe[_0x17b169];return _0x2b4ad4;};'use strict';var EventEmitter=require(_0xeb9f('0x0'));var ChatInteraction=require(_0xeb9f('0x1'))['db'][_0xeb9f('0x2')];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeb9f('0x3'),'afterUpdate':_0xeb9f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x82cffa){return function(_0x170eb0,_0x50dbb7,_0x4ff700){_0x170eb0['getUsers']({'attributes':['id'],'raw':!![]})[_0xeb9f('0x5')](function(_0x28087e){_0x170eb0[_0xeb9f('0x6')]('Users',_0x28087e['map'](function(_0x2b6b3f){return{'id':_0x2b6b3f['id']};}));return ChatMessage[_0xeb9f('0x7')]({'where':{'ChatInteractionId':_0x170eb0['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2e89d2){_0x170eb0[_0xeb9f('0x6')](_0xeb9f('0x8'),_0x2e89d2[_0xeb9f('0x9')]);ChatInteractionEvents[_0xeb9f('0xa')](_0x82cffa+':'+_0x170eb0['id'],_0x170eb0);ChatInteractionEvents[_0xeb9f('0xa')](_0x82cffa,_0x170eb0);_0x4ff700(null);})[_0xeb9f('0xb')](_0x4ff700(null));};}for(var e in events){if(events[_0xeb9f('0xc')](e)){var event=events[e];ChatInteraction[_0xeb9f('0xd')](e,emitEvent(event));}}module[_0xeb9f('0xe')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 0bd14c9..62069e7 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 _0xd1cc=['format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','changed','closed','closedAt'];(function(_0x3f0c4d,_0x36c466){var _0x4789fd=function(_0x3e2c36){while(--_0x3e2c36){_0x3f0c4d['push'](_0x3f0c4d['shift']());}};_0x4789fd(++_0x36c466);}(_0xd1cc,0x76));var _0xcd1c=function(_0x6d7d6d,_0x401215){_0x6d7d6d=_0x6d7d6d-0x0;var _0x34dc6d=_0xd1cc[_0x6d7d6d];return _0x34dc6d;};'use strict';var _=require(_0xcd1c('0x0'));var util=require('util');var logger=require(_0xcd1c('0x1'))(_0xcd1c('0x2'));var moment=require(_0xcd1c('0x3'));var BPromise=require(_0xcd1c('0x4'));var rp=require(_0xcd1c('0x5'));var fs=require('fs');var path=require(_0xcd1c('0x6'));var rimraf=require(_0xcd1c('0x7'));var config=require(_0xcd1c('0x8'));var attributes=require(_0xcd1c('0x9'));module['exports']=function(_0x18aed3,_0x2c0bae){return _0x18aed3[_0xcd1c('0xa')](_0xcd1c('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4bfc3d,_0x2b153,_0x3b3f54){if(_0x4bfc3d[_0xcd1c('0xc')](_0xcd1c('0xd'))){_0x4bfc3d[_0xcd1c('0xe')]=moment()[_0xcd1c('0xf')](_0xcd1c('0x10'));}_0x3b3f54(null,_0x4bfc3d);}},'charset':_0xcd1c('0x11'),'collate':_0xcd1c('0x12')});};
\ No newline at end of file
+var _0x8155=['define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','../../config/environment','exports'];(function(_0x3504a0,_0x3f770f){var _0x3dfca3=function(_0x5adf34){while(--_0x5adf34){_0x3504a0['push'](_0x3504a0['shift']());}};_0x3dfca3(++_0x3f770f);}(_0x8155,0x198));var _0x5815=function(_0x4ebffa,_0x1ab8db){_0x4ebffa=_0x4ebffa-0x0;var _0x4aec5f=_0x8155[_0x4ebffa];return _0x4aec5f;};'use strict';var _=require(_0x5815('0x0'));var util=require(_0x5815('0x1'));var logger=require(_0x5815('0x2'))(_0x5815('0x3'));var moment=require(_0x5815('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5815('0x5'));var rimraf=require('rimraf');var config=require(_0x5815('0x6'));var attributes=require('./chatInteraction.attributes');module[_0x5815('0x7')]=function(_0x3ba965,_0x1b484e){return _0x3ba965[_0x5815('0x8')](_0x5815('0x9'),attributes,{'tableName':_0x5815('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1df755,_0x2256c5,_0x4fc851){if(_0x1df755[_0x5815('0xb')](_0x5815('0xc'))){_0x1df755[_0x5815('0xd')]=moment()[_0x5815('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4fc851(null,_0x1df755);}},'charset':'utf8mb4','collate':_0x5815('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index e8bbf46..ec6121d 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 _0xf7f4=['find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','UpdateChatInteraction','update','body','options','where','attributes','limit','AddTagsToChatInteraction','ChatInteraction'];(function(_0xe33dfe,_0x326077){var _0x4eaed0=function(_0x5c448a){while(--_0x5c448a){_0xe33dfe['push'](_0xe33dfe['shift']());}};_0x4eaed0(++_0x326077);}(_0xf7f4,0xd8));var _0x4f7f=function(_0x30b734,_0x17baf6){_0x30b734=_0x30b734-0x0;var _0x2c4c07=_0xf7f4[_0x30b734];return _0x2c4c07;};'use strict';var _=require(_0x4f7f('0x0'));var util=require('util');var moment=require(_0x4f7f('0x1'));var BPromise=require(_0x4f7f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f7f('0x3'));var db=require(_0x4f7f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4f7f('0x5'))(_0x4f7f('0x6'));var config=require(_0x4f7f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4f7f('0x8')][_0x4f7f('0x9')]({'port':0x232a});config[_0x4f7f('0xa')]=_['defaults'](config['redis'],{'host':_0x4f7f('0xb'),'port':0x18eb});var socket=require(_0x4f7f('0xc'))(new Redis(config[_0x4f7f('0xa')]));require(_0x4f7f('0xd'))[_0x4f7f('0xe')](socket);function respondWithRpcPromise(_0x13b0b9,_0x2f1c06,_0xf556a0){return new BPromise(function(_0x5cf9a6,_0x3ad9b4){return client['request'](_0x13b0b9,_0xf556a0)[_0x4f7f('0xf')](function(_0x5bc629){logger[_0x4f7f('0x10')](_0x4f7f('0x11'),_0x2f1c06,'request\x20sent');logger[_0x4f7f('0x12')](_0x4f7f('0x13'),_0x2f1c06,'request\x20sent',JSON[_0x4f7f('0x14')](_0x5bc629));if(_0x5bc629[_0x4f7f('0x15')]){if(_0x5bc629[_0x4f7f('0x15')][_0x4f7f('0x16')]===0x1f4){logger[_0x4f7f('0x15')](_0x4f7f('0x11'),_0x2f1c06,_0x5bc629[_0x4f7f('0x15')][_0x4f7f('0x17')]);return _0x3ad9b4(_0x5bc629[_0x4f7f('0x15')][_0x4f7f('0x17')]);}logger[_0x4f7f('0x15')](_0x4f7f('0x11'),_0x2f1c06,_0x5bc629[_0x4f7f('0x15')][_0x4f7f('0x17')]);return _0x5cf9a6(_0x5bc629[_0x4f7f('0x15')][_0x4f7f('0x17')]);}else{logger[_0x4f7f('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x2f1c06,_0x4f7f('0x18'));_0x5cf9a6(_0x5bc629[_0x4f7f('0x19')][_0x4f7f('0x17')]);}})[_0x4f7f('0x1a')](function(_0x292683){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x2f1c06,_0x292683);_0x3ad9b4(_0x292683);});});}exports[_0x4f7f('0x1b')]=function(_0x52300d){var _0x362b3c=this;return new Promise(function(_0x4e023f,_0x1dbbca){return db['ChatInteraction'][_0x4f7f('0x1c')](_0x52300d[_0x4f7f('0x1d')],{'raw':_0x52300d[_0x4f7f('0x1e')]?_0x52300d['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52300d[_0x4f7f('0x1e')]?_0x52300d['options'][_0x4f7f('0x1f')]||null:null,'attributes':_0x52300d[_0x4f7f('0x1e')]?_0x52300d[_0x4f7f('0x1e')][_0x4f7f('0x20')]||null:null,'limit':_0x52300d[_0x4f7f('0x1e')]?_0x52300d[_0x4f7f('0x1e')][_0x4f7f('0x21')]||null:null})[_0x4f7f('0xf')](function(_0x5c9366){logger[_0x4f7f('0x10')]('UpdateChatInteraction',_0x52300d);logger['debug']('UpdateChatInteraction',_0x52300d,JSON[_0x4f7f('0x14')](_0x5c9366));_0x4e023f(_0x5c9366);})[_0x4f7f('0x1a')](function(_0x15286a){logger[_0x4f7f('0x15')](_0x4f7f('0x1b'),_0x15286a[_0x4f7f('0x17')],_0x52300d);_0x1dbbca(_0x362b3c[_0x4f7f('0x15')](0x1f4,_0x15286a[_0x4f7f('0x17')]));});});};exports[_0x4f7f('0x22')]=function(_0x50719f){return new Promise(function(_0x555a15,_0x340fc3){return db[_0x4f7f('0x23')][_0x4f7f('0x24')]({'where':_0x50719f[_0x4f7f('0x1e')]?_0x50719f[_0x4f7f('0x1e')][_0x4f7f('0x1f')]||null:null})[_0x4f7f('0xf')](function(_0x15513b){if(_0x15513b){return _0x15513b[_0x4f7f('0x25')](_0x50719f[_0x4f7f('0x1d')][_0x4f7f('0x26')],_[_0x4f7f('0x27')](_0x50719f[_0x4f7f('0x1d')],[_0x4f7f('0x26'),'id'])||{});}})[_0x4f7f('0x28')](function(_0x392a61){logger[_0x4f7f('0x10')](_0x4f7f('0x29'),_0x50719f);logger[_0x4f7f('0x12')](_0x4f7f('0x29'),_0x50719f,JSON[_0x4f7f('0x14')](_0x392a61));_0x555a15(_0x392a61);})[_0x4f7f('0x1a')](function(_0x550052){logger[_0x4f7f('0x15')](_0x4f7f('0x29'),_0x550052[_0x4f7f('0x17')],_0x50719f);_0x340fc3(_this[_0x4f7f('0x15')](0x1f4,_0x550052[_0x4f7f('0x17')]));});});};
\ No newline at end of file
+var _0xf0f0=['AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','attributes','debug','AddTagsToChatInteraction','find','where','ids','omit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf0f0,0x1c4));var _0x0f0f=function(_0x3bc9a9,_0x4daccb){_0x3bc9a9=_0x3bc9a9-0x0;var _0x29923b=_0xf0f0[_0x3bc9a9];return _0x29923b;};'use strict';var _=require(_0x0f0f('0x0'));var util=require(_0x0f0f('0x1'));var moment=require(_0x0f0f('0x2'));var BPromise=require(_0x0f0f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f0f('0x4'));var db=require(_0x0f0f('0x5'))['db'];var utils=require(_0x0f0f('0x6'));var logger=require(_0x0f0f('0x7'))(_0x0f0f('0x8'));var config=require(_0x0f0f('0x9'));var jayson=require(_0x0f0f('0xa'));var client=jayson[_0x0f0f('0xb')][_0x0f0f('0xc')]({'port':0x232a});config[_0x0f0f('0xd')]=_[_0x0f0f('0xe')](config[_0x0f0f('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0f0f('0xd')]));require(_0x0f0f('0xf'))['register'](socket);function respondWithRpcPromise(_0x30b8e6,_0xed9ed5,_0x2f0301){return new BPromise(function(_0x5e6878,_0x371465){return client[_0x0f0f('0x10')](_0x30b8e6,_0x2f0301)[_0x0f0f('0x11')](function(_0x44b2be){logger[_0x0f0f('0x12')](_0x0f0f('0x13'),_0xed9ed5,'request\x20sent');logger['debug'](_0x0f0f('0x14'),_0xed9ed5,_0x0f0f('0x15'),JSON[_0x0f0f('0x16')](_0x44b2be));if(_0x44b2be[_0x0f0f('0x17')]){if(_0x44b2be['error'][_0x0f0f('0x18')]===0x1f4){logger[_0x0f0f('0x17')](_0x0f0f('0x13'),_0xed9ed5,_0x44b2be[_0x0f0f('0x17')][_0x0f0f('0x19')]);return _0x371465(_0x44b2be[_0x0f0f('0x17')][_0x0f0f('0x19')]);}logger[_0x0f0f('0x17')](_0x0f0f('0x13'),_0xed9ed5,_0x44b2be[_0x0f0f('0x17')][_0x0f0f('0x19')]);return _0x5e6878(_0x44b2be[_0x0f0f('0x17')][_0x0f0f('0x19')]);}else{logger[_0x0f0f('0x12')](_0x0f0f('0x13'),_0xed9ed5,_0x0f0f('0x15'));_0x5e6878(_0x44b2be[_0x0f0f('0x1a')][_0x0f0f('0x19')]);}})[_0x0f0f('0x1b')](function(_0x84fb6d){logger[_0x0f0f('0x17')](_0x0f0f('0x13'),_0xed9ed5,_0x84fb6d);_0x371465(_0x84fb6d);});});}exports[_0x0f0f('0x1c')]=function(_0x3604ad){var _0x21ef0a=this;return new Promise(function(_0xcb35a8,_0x506f23){return db[_0x0f0f('0x1d')][_0x0f0f('0x1e')](_0x3604ad[_0x0f0f('0x1f')],{'raw':_0x3604ad['options']?_0x3604ad['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3604ad[_0x0f0f('0x20')]?_0x3604ad[_0x0f0f('0x20')]['where']||null:null,'attributes':_0x3604ad['options']?_0x3604ad['options'][_0x0f0f('0x21')]||null:null,'limit':_0x3604ad[_0x0f0f('0x20')]?_0x3604ad[_0x0f0f('0x20')]['limit']||null:null})[_0x0f0f('0x11')](function(_0x53c545){logger[_0x0f0f('0x12')]('UpdateChatInteraction',_0x3604ad);logger[_0x0f0f('0x22')](_0x0f0f('0x1c'),_0x3604ad,JSON[_0x0f0f('0x16')](_0x53c545));_0xcb35a8(_0x53c545);})['catch'](function(_0x5e37c2){logger[_0x0f0f('0x17')](_0x0f0f('0x1c'),_0x5e37c2['message'],_0x3604ad);_0x506f23(_0x21ef0a[_0x0f0f('0x17')](0x1f4,_0x5e37c2[_0x0f0f('0x19')]));});});};exports[_0x0f0f('0x23')]=function(_0x2bef08){return new Promise(function(_0x10b2d8,_0x26a378){return db['ChatInteraction'][_0x0f0f('0x24')]({'where':_0x2bef08[_0x0f0f('0x20')]?_0x2bef08[_0x0f0f('0x20')][_0x0f0f('0x25')]||null:null})[_0x0f0f('0x11')](function(_0x460549){if(_0x460549){return _0x460549['addTags'](_0x2bef08[_0x0f0f('0x1f')][_0x0f0f('0x26')],_[_0x0f0f('0x27')](_0x2bef08[_0x0f0f('0x1f')],[_0x0f0f('0x26'),'id'])||{});}})['spread'](function(_0x4f2df0){logger[_0x0f0f('0x12')](_0x0f0f('0x28'),_0x2bef08);logger[_0x0f0f('0x22')](_0x0f0f('0x28'),_0x2bef08,JSON[_0x0f0f('0x16')](_0x4f2df0));_0x10b2d8(_0x4f2df0);})[_0x0f0f('0x1b')](function(_0x42ea63){logger[_0x0f0f('0x17')](_0x0f0f('0x28'),_0x42ea63[_0x0f0f('0x19')],_0x2bef08);_0x26a378(_this[_0x0f0f('0x17')](0x1f4,_0x42ea63[_0x0f0f('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 0ef2291..0a61383 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 _0x58e4=['emit','register','length','chatInteraction:','./chatInteraction.events','remove','update'];(function(_0x2b7b29,_0x59b527){var _0x179776=function(_0x414f34){while(--_0x414f34){_0x2b7b29['push'](_0x2b7b29['shift']());}};_0x179776(++_0x59b527);}(_0x58e4,0x1c4));var _0x458e=function(_0x2e9b61,_0x2120cf){_0x2e9b61=_0x2e9b61-0x0;var _0x597ccd=_0x58e4[_0x2e9b61];return _0x597ccd;};'use strict';var ChatInteractionEvents=require(_0x458e('0x0'));var events=['save',_0x458e('0x1'),_0x458e('0x2')];function createListener(_0x1cfd14,_0x34c66f){return function(_0x22d432){_0x34c66f[_0x458e('0x3')](_0x1cfd14,_0x22d432);};}function removeListener(_0x17f459,_0x304b9c){return function(){ChatInteractionEvents['removeListener'](_0x17f459,_0x304b9c);};}exports[_0x458e('0x4')]=function(_0x2c628a){for(var _0x4eb896=0x0,_0x4a54c0=events[_0x458e('0x5')];_0x4eb896<_0x4a54c0;_0x4eb896++){var _0x3025b9=events[_0x4eb896];var _0x2d4560=createListener(_0x458e('0x6')+_0x3025b9,_0x2c628a);ChatInteractionEvents['on'](_0x3025b9,_0x2d4560);}};
\ No newline at end of file
+var _0x5489=['removeListener','register','./chatInteraction.events','save','remove','update'];(function(_0x1d6e3d,_0x51b0c5){var _0x27d1e4=function(_0x37d6c4){while(--_0x37d6c4){_0x1d6e3d['push'](_0x1d6e3d['shift']());}};_0x27d1e4(++_0x51b0c5);}(_0x5489,0x10a));var _0x9548=function(_0xeda869,_0x101e27){_0xeda869=_0xeda869-0x0;var _0x4a6e8f=_0x5489[_0xeda869];return _0x4a6e8f;};'use strict';var ChatInteractionEvents=require(_0x9548('0x0'));var events=[_0x9548('0x1'),_0x9548('0x2'),_0x9548('0x3')];function createListener(_0x164d0d,_0x36fdc9){return function(_0x155746){_0x36fdc9['emit'](_0x164d0d,_0x155746);};}function removeListener(_0xb06c04,_0x1969dc){return function(){ChatInteractionEvents[_0x9548('0x4')](_0xb06c04,_0x1969dc);};}exports[_0x9548('0x5')]=function(_0x2e8c5c){for(var _0x138c5a=0x0,_0x115571=events['length'];_0x138c5a<_0x115571;_0x138c5a++){var _0x497fd0=events[_0x138c5a];var _0x278a5e=createListener('chatInteraction:'+_0x497fd0,_0x2e8c5c);ChatInteractionEvents['on'](_0x497fd0,_0x278a5e);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 386323d..ff18ffb 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 _0xc1e2=['attachmentUpload','/:id/messages','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','/:id/tags','exports','multer','path','express','Router','fs-extra','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','diskStorage','join','root','server/files/attachments/','%s-%s','originalname','single'];(function(_0x2d486b,_0x5f213c){var _0x4291d1=function(_0x2cebcb){while(--_0x2cebcb){_0x2d486b['push'](_0x2d486b['shift']());}};_0x4291d1(++_0x5f213c);}(_0xc1e2,0xa5));var _0x2c1e=function(_0x2708c3,_0x2149c4){_0x2708c3=_0x2708c3-0x0;var _0x803a64=_0xc1e2[_0x2708c3];return _0x803a64;};'use strict';var multer=require(_0x2c1e('0x0'));var util=require('util');var path=require(_0x2c1e('0x1'));var timeout=require('connect-timeout');var express=require(_0x2c1e('0x2'));var router=express[_0x2c1e('0x3')]();var fs_extra=require(_0x2c1e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2c1e('0x5'));var controller=require(_0x2c1e('0x6'));router[_0x2c1e('0x7')]('/',auth[_0x2c1e('0x8')](),controller[_0x2c1e('0x9')]);router[_0x2c1e('0x7')](_0x2c1e('0xa'),auth[_0x2c1e('0x8')](),controller[_0x2c1e('0xb')]);router['get'](_0x2c1e('0xc'),auth['isChatInteractionAuthorized'](),controller[_0x2c1e('0xd')]);router['get'](_0x2c1e('0xe'),auth[_0x2c1e('0xf')](),controller[_0x2c1e('0x10')]);router['get']('/:id/messages',auth[_0x2c1e('0x8')](),controller[_0x2c1e('0x11')]);router['get'](_0x2c1e('0x12'),auth[_0x2c1e('0xf')](),controller[_0x2c1e('0x13')]);router[_0x2c1e('0x7')](_0x2c1e('0x14'),auth['isAuthenticated'](),controller[_0x2c1e('0x15')]);router['post']('/',auth[_0x2c1e('0x8')](),controller[_0x2c1e('0x16')]);router[_0x2c1e('0x17')]('/:id/vidaoo',auth[_0x2c1e('0x8')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x2c1e('0x18')]({'destination':function(_0x5c7e5c,_0x13f03d,_0xb473db){_0xb473db(null,path[_0x2c1e('0x19')](config[_0x2c1e('0x1a')],_0x2c1e('0x1b')));},'filename':function(_0x407590,_0x2ed754,_0x5715c6){_0x5715c6(null,util['format'](_0x2c1e('0x1c'),Date['now'](),_0x2ed754[_0x2c1e('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2c1e('0x17')]('/:id/attachment_upload',upload[_0x2c1e('0x1e')]('file'),controller[_0x2c1e('0x1f')]);router['post'](_0x2c1e('0x20'),auth[_0x2c1e('0xf')](),controller[_0x2c1e('0x21')]);router[_0x2c1e('0x17')]('/:id/tags',auth[_0x2c1e('0x8')](),interaction[_0x2c1e('0x22')](_0x2c1e('0x23'),_0x2c1e('0x24')),controller[_0x2c1e('0x25')]);router[_0x2c1e('0x26')](_0x2c1e('0xc'),auth['isAuthenticated'](),interaction[_0x2c1e('0x22')](_0x2c1e('0x23'),'chatinteraction:update'),controller['update']);router['put'](_0x2c1e('0x27'),controller[_0x2c1e('0x28')]);router['put'](_0x2c1e('0x29'),auth[_0x2c1e('0xf')](),controller[_0x2c1e('0x2a')]);router['put']('/:id/close',controller[_0x2c1e('0x2b')]);router[_0x2c1e('0x2c')](_0x2c1e('0xc'),auth[_0x2c1e('0x8')](),interaction[_0x2c1e('0x22')](_0x2c1e('0x23'),_0x2c1e('0x2d')),controller[_0x2c1e('0x2e')]);router[_0x2c1e('0x2c')](_0x2c1e('0x2f'),auth[_0x2c1e('0x8')](),controller['removeTags']);module[_0x2c1e('0x30')]=router;
\ No newline at end of file
+var _0xb954=['format','%s-%s','now','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/'];(function(_0x1bab70,_0x399ccf){var _0x44a639=function(_0x36c682){while(--_0x36c682){_0x1bab70['push'](_0x1bab70['shift']());}};_0x44a639(++_0x399ccf);}(_0xb954,0x151));var _0x4b95=function(_0x3c6f79,_0x3ed502){_0x3c6f79=_0x3c6f79-0x0;var _0x311855=_0xb954[_0x3c6f79];return _0x311855;};'use strict';var multer=require(_0x4b95('0x0'));var util=require('util');var path=require(_0x4b95('0x1'));var timeout=require(_0x4b95('0x2'));var express=require(_0x4b95('0x3'));var router=express[_0x4b95('0x4')]();var fs_extra=require(_0x4b95('0x5'));var auth=require(_0x4b95('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4b95('0x7'));var controller=require('./chatInteraction.controller');router[_0x4b95('0x8')]('/',auth[_0x4b95('0x9')](),controller['index']);router[_0x4b95('0x8')](_0x4b95('0xa'),auth[_0x4b95('0x9')](),controller['describe']);router[_0x4b95('0x8')]('/:id',auth[_0x4b95('0xb')](),controller[_0x4b95('0xc')]);router[_0x4b95('0x8')]('/:id/attachment_download',auth[_0x4b95('0xb')](),controller[_0x4b95('0xd')]);router['get'](_0x4b95('0xe'),auth[_0x4b95('0x9')](),controller[_0x4b95('0xf')]);router[_0x4b95('0x8')](_0x4b95('0x10'),auth[_0x4b95('0xb')](),controller[_0x4b95('0x11')]);router[_0x4b95('0x8')](_0x4b95('0x12'),auth[_0x4b95('0x9')](),controller[_0x4b95('0x13')]);router['post']('/',auth[_0x4b95('0x9')](),controller[_0x4b95('0x14')]);router[_0x4b95('0x15')](_0x4b95('0x16'),auth[_0x4b95('0x9')](),controller[_0x4b95('0x17')]);var upload=multer({'storage':multer[_0x4b95('0x18')]({'destination':function(_0x3c51ef,_0x267e12,_0x4f27ca){_0x4f27ca(null,path['join'](config[_0x4b95('0x19')],_0x4b95('0x1a')));},'filename':function(_0x3aaa73,_0x412ad5,_0x4acd7f){_0x4acd7f(null,util[_0x4b95('0x1b')](_0x4b95('0x1c'),Date[_0x4b95('0x1d')](),_0x412ad5['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x4b95('0x15')](_0x4b95('0x1e'),upload[_0x4b95('0x1f')](_0x4b95('0x20')),controller[_0x4b95('0x21')]);router[_0x4b95('0x15')](_0x4b95('0xe'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router['post'](_0x4b95('0x22'),auth[_0x4b95('0x9')](),interaction[_0x4b95('0x23')](_0x4b95('0x24'),_0x4b95('0x25')),controller[_0x4b95('0x26')]);router[_0x4b95('0x27')](_0x4b95('0x28'),auth[_0x4b95('0x9')](),interaction[_0x4b95('0x23')](_0x4b95('0x24'),'chatinteraction:update'),controller[_0x4b95('0x29')]);router[_0x4b95('0x27')](_0x4b95('0x2a'),controller[_0x4b95('0x2b')]);router[_0x4b95('0x27')](_0x4b95('0x2c'),auth[_0x4b95('0xb')](),controller[_0x4b95('0x2d')]);router['put'](_0x4b95('0x2e'),controller[_0x4b95('0x2f')]);router[_0x4b95('0x30')](_0x4b95('0x28'),auth['isAuthenticated'](),interaction['tracked']('chat',_0x4b95('0x31')),controller[_0x4b95('0x32')]);router['delete'](_0x4b95('0x22'),auth['isAuthenticated'](),controller[_0x4b95('0x33')]);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 9a07860..631a415 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 _0xb0de=['medium','INTEGER','sequelize','TEXT'];(function(_0xc7006a,_0x26fe34){var _0x4b49d9=function(_0x4ee238){while(--_0x4ee238){_0xc7006a['push'](_0xc7006a['shift']());}};_0x4b49d9(++_0x26fe34);}(_0xb0de,0xc2));var _0xeb0d=function(_0x17369c,_0x57e58f){_0x17369c=_0x17369c-0x0;var _0x5d558e=_0xb0de[_0x17369c];return _0x5d558e;};'use strict';var Sequelize=require(_0xeb0d('0x0'));module['exports']={'body':{'type':Sequelize[_0xeb0d('0x1')](_0xeb0d('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xeb0d('0x3')]}};
\ No newline at end of file
+var _0x46ea=['sequelize','TEXT','medium','BOOLEAN'];(function(_0x20b18d,_0x9aed5){var _0x5391d0=function(_0x38b157){while(--_0x38b157){_0x20b18d['push'](_0x20b18d['shift']());}};_0x5391d0(++_0x9aed5);}(_0x46ea,0x148));var _0xa46e=function(_0x34e1e1,_0x43a5b5){_0x34e1e1=_0x34e1e1-0x0;var _0x4a1f4d=_0x46ea[_0x34e1e1];return _0x4a1f4d;};'use strict';var Sequelize=require(_0xa46e('0x0'));module['exports']={'body':{'type':Sequelize[_0xa46e('0x1')](_0xa46e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xa46e('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index d55dd93..8f63726 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 _0xbd7d=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','ChatInternalMessage','includeAll','include','rows','catch','params','find','body','update','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','findAll','agent','admin','user','fullname','userpic','online','allowmessenger','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0xf0b5aa,_0x2bf688){var _0x116c02=function(_0x3d6d94){while(--_0x3d6d94){_0xf0b5aa['push'](_0xf0b5aa['shift']());}};_0x116c02(++_0x2bf688);}(_0xbd7d,0x1a6));var _0xdbd7=function(_0x5d23c2,_0x314419){_0x5d23c2=_0x5d23c2-0x0;var _0x50b8f0=_0xbd7d[_0x5d23c2];return _0x50b8f0;};'use strict';var emlformat=require(_0xdbd7('0x0'));var rimraf=require(_0xdbd7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdbd7('0x2'));var rp=require(_0xdbd7('0x3'));var moment=require(_0xdbd7('0x4'));var BPromise=require(_0xdbd7('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xdbd7('0x6'));var csv=require(_0xdbd7('0x7'));var ejs=require(_0xdbd7('0x8'));var fs=require('fs');var fs_extra=require(_0xdbd7('0x9'));var _=require(_0xdbd7('0xa'));var squel=require(_0xdbd7('0xb'));var crypto=require(_0xdbd7('0xc'));var jsforce=require(_0xdbd7('0xd'));var deskjs=require(_0xdbd7('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdbd7('0xf'));var Papa=require(_0xdbd7('0x10'));var Redis=require(_0xdbd7('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdbd7('0x12'));var hardwareService=require(_0xdbd7('0x13'));var logger=require(_0xdbd7('0x14'))(_0xdbd7('0x15'));var utils=require(_0xdbd7('0x16'));var config=require(_0xdbd7('0x17'));var licenseUtil=require(_0xdbd7('0x18'));var db=require(_0xdbd7('0x19'))['db'];config[_0xdbd7('0x1a')]=_[_0xdbd7('0x1b')](config[_0xdbd7('0x1a')],{'host':_0xdbd7('0x1c'),'port':0x18eb});var socket=require(_0xdbd7('0x1d'))(new Redis(config[_0xdbd7('0x1a')]));require(_0xdbd7('0x1e'))[_0xdbd7('0x1f')](socket);function respondWithStatusCode(_0x1347ed,_0x3286ab){_0x3286ab=_0x3286ab||0xcc;return function(_0xd13b4a){if(_0xd13b4a){return _0x1347ed[_0xdbd7('0x20')](_0x3286ab);}return _0x1347ed[_0xdbd7('0x21')](_0x3286ab)[_0xdbd7('0x22')]();};}function respondWithResult(_0x4ae3f3,_0x22a553){_0x22a553=_0x22a553||0xc8;return function(_0x230499){if(_0x230499){return _0x4ae3f3[_0xdbd7('0x21')](_0x22a553)[_0xdbd7('0x23')](_0x230499);}};}function respondWithFilteredResult(_0x34a468,_0x1718b0){return function(_0x44d192){if(_0x44d192){var _0x439677=typeof _0x1718b0[_0xdbd7('0x24')]===_0xdbd7('0x25')&&typeof _0x1718b0[_0xdbd7('0x26')]===_0xdbd7('0x25');var _0x375f13=_0x44d192[_0xdbd7('0x27')];var _0x1f25ae=_0x439677?0x0:_0x1718b0[_0xdbd7('0x24')];var _0x509c99=_0x439677?_0x44d192[_0xdbd7('0x27')]:_0x1718b0[_0xdbd7('0x24')]+_0x1718b0['limit'];var _0x3e703f;if(_0x509c99>=_0x375f13){_0x509c99=_0x375f13;_0x3e703f=0xc8;}else{_0x3e703f=0xce;}_0x34a468['status'](_0x3e703f);return _0x34a468[_0xdbd7('0x28')](_0xdbd7('0x29'),_0x1f25ae+'-'+_0x509c99+'/'+_0x375f13)[_0xdbd7('0x23')](_0x44d192);}return null;};}function patchUpdates(_0x55ce67){return function(_0x4a106e){try{jsonpatch[_0xdbd7('0x2a')](_0x4a106e,_0x55ce67,!![]);}catch(_0x36d0c2){return BPromise[_0xdbd7('0x2b')](_0x36d0c2);}return _0x4a106e[_0xdbd7('0x2c')]();};}function saveUpdates(_0x4a339f,_0xad2939){return function(_0x5e2c99){if(_0x5e2c99){return _0x5e2c99['update'](_0x4a339f)[_0xdbd7('0x2d')](function(_0x294889){return _0x294889;});}return null;};}function removeEntity(_0x5a510e,_0x525d7b){return function(_0x3845fe){if(_0x3845fe){return _0x3845fe[_0xdbd7('0x2e')]()[_0xdbd7('0x2d')](function(){_0x5a510e[_0xdbd7('0x21')](0xcc)[_0xdbd7('0x22')]();});}};}function handleEntityNotFound(_0x5b7a54,_0x1d835e){return function(_0xb05d91){if(!_0xb05d91){_0x5b7a54['sendStatus'](0x194);}return _0xb05d91;};}function handleError(_0x15347f,_0x159630){_0x159630=_0x159630||0x1f4;return function(_0x5a926f){logger['error'](_0x5a926f[_0xdbd7('0x2f')]);if(_0x5a926f['name']){delete _0x5a926f[_0xdbd7('0x30')];}_0x15347f[_0xdbd7('0x21')](_0x159630)['send'](_0x5a926f);};}exports[_0xdbd7('0x31')]=function(_0x74e3f5,_0x2f9118){var _0x174316={},_0x286c41={},_0x495eef={'count':0x0,'rows':[]};var _0x51faaa=_[_0xdbd7('0x32')](db['ChatInternalMessage']['rawAttributes'],function(_0x574d7c){return{'name':_0x574d7c[_0xdbd7('0x33')],'type':_0x574d7c[_0xdbd7('0x34')]['key']};});_0x286c41[_0xdbd7('0x35')]=_[_0xdbd7('0x32')](_0x51faaa,_0xdbd7('0x30'));_0x286c41[_0xdbd7('0x36')]=_[_0xdbd7('0x37')](_0x74e3f5[_0xdbd7('0x36')]);_0x286c41[_0xdbd7('0x38')]=_[_0xdbd7('0x39')](_0x286c41['model'],_0x286c41[_0xdbd7('0x36')]);_0x174316[_0xdbd7('0x3a')]=_[_0xdbd7('0x39')](_0x286c41['model'],qs[_0xdbd7('0x3b')](_0x74e3f5[_0xdbd7('0x36')][_0xdbd7('0x3b')]));_0x174316[_0xdbd7('0x3a')]=_0x174316[_0xdbd7('0x3a')][_0xdbd7('0x3c')]?_0x174316[_0xdbd7('0x3a')]:_0x286c41[_0xdbd7('0x35')];if(!_0x74e3f5[_0xdbd7('0x36')][_0xdbd7('0x3d')]('nolimit')){_0x174316[_0xdbd7('0x26')]=qs[_0xdbd7('0x26')](_0x74e3f5[_0xdbd7('0x36')]['limit']);_0x174316[_0xdbd7('0x24')]=qs[_0xdbd7('0x24')](_0x74e3f5[_0xdbd7('0x36')][_0xdbd7('0x24')]);}_0x174316['order']=qs[_0xdbd7('0x3e')](_0x74e3f5[_0xdbd7('0x36')][_0xdbd7('0x3e')]);_0x174316[_0xdbd7('0x3f')]=qs[_0xdbd7('0x38')](_[_0xdbd7('0x40')](_0x74e3f5[_0xdbd7('0x36')],_0x286c41[_0xdbd7('0x38')]),_0x51faaa);if(_0x74e3f5[_0xdbd7('0x36')][_0xdbd7('0x41')]){_0x174316['where']=_[_0xdbd7('0x42')](_0x174316[_0xdbd7('0x3f')],{'$or':_[_0xdbd7('0x32')](_0x51faaa,function(_0x41e1d5){if(_0x41e1d5[_0xdbd7('0x34')]!==_0xdbd7('0x43')){var _0x4bbf8b={};_0x4bbf8b[_0x41e1d5['name']]={'$like':'%'+_0x74e3f5[_0xdbd7('0x36')]['filter']+'%'};return _0x4bbf8b;}})});}_0x174316=_[_0xdbd7('0x42')]({},_0x174316,_0x74e3f5[_0xdbd7('0x44')]);var _0x5e3e5a={'where':_0x174316[_0xdbd7('0x3f')]};return db[_0xdbd7('0x45')][_0xdbd7('0x27')](_0x5e3e5a)['then'](function(_0x273b29){_0x495eef['count']=_0x273b29;if(_0x74e3f5[_0xdbd7('0x36')][_0xdbd7('0x46')]){_0x174316[_0xdbd7('0x47')]=[{'all':!![]}];}return db[_0xdbd7('0x45')]['findAll'](_0x174316);})[_0xdbd7('0x2d')](function(_0x20b343){_0x495eef[_0xdbd7('0x48')]=_0x20b343;return _0x495eef;})[_0xdbd7('0x2d')](respondWithFilteredResult(_0x2f9118,_0x174316))[_0xdbd7('0x49')](handleError(_0x2f9118,null));};exports['show']=function(_0x1feca8,_0x4eca72){var _0xe2b428={'raw':!![],'where':{'id':_0x1feca8[_0xdbd7('0x4a')]['id']}},_0x45bc2e={};_0x45bc2e[_0xdbd7('0x35')]=_[_0xdbd7('0x37')](db['ChatInternalMessage']['rawAttributes']);_0x45bc2e[_0xdbd7('0x36')]=_[_0xdbd7('0x37')](_0x1feca8[_0xdbd7('0x36')]);_0x45bc2e[_0xdbd7('0x38')]=_[_0xdbd7('0x39')](_0x45bc2e[_0xdbd7('0x35')],_0x45bc2e['query']);_0xe2b428[_0xdbd7('0x3a')]=_[_0xdbd7('0x39')](_0x45bc2e[_0xdbd7('0x35')],qs[_0xdbd7('0x3b')](_0x1feca8['query'][_0xdbd7('0x3b')]));_0xe2b428['attributes']=_0xe2b428['attributes'][_0xdbd7('0x3c')]?_0xe2b428[_0xdbd7('0x3a')]:_0x45bc2e[_0xdbd7('0x35')];if(_0x1feca8[_0xdbd7('0x36')][_0xdbd7('0x46')]){_0xe2b428[_0xdbd7('0x47')]=[{'all':!![]}];}_0xe2b428=_[_0xdbd7('0x42')]({},_0xe2b428,_0x1feca8['options']);return db[_0xdbd7('0x45')][_0xdbd7('0x4b')](_0xe2b428)[_0xdbd7('0x2d')](handleEntityNotFound(_0x4eca72,null))[_0xdbd7('0x2d')](respondWithResult(_0x4eca72,null))['catch'](handleError(_0x4eca72,null));};exports['create']=function(_0x146ceb,_0x54be24){return db['ChatInternalMessage']['create'](_0x146ceb[_0xdbd7('0x4c')],{})[_0xdbd7('0x2d')](respondWithResult(_0x54be24,0xc9))[_0xdbd7('0x49')](handleError(_0x54be24,null));};exports[_0xdbd7('0x4d')]=function(_0x33fcd1,_0x576a41){if(_0x33fcd1[_0xdbd7('0x4c')]['id']){delete _0x33fcd1[_0xdbd7('0x4c')]['id'];}return db[_0xdbd7('0x45')][_0xdbd7('0x4b')]({'where':{'id':_0x33fcd1[_0xdbd7('0x4a')]['id']}})[_0xdbd7('0x2d')](handleEntityNotFound(_0x576a41,null))[_0xdbd7('0x2d')](saveUpdates(_0x33fcd1[_0xdbd7('0x4c')],null))[_0xdbd7('0x2d')](respondWithResult(_0x576a41,null))[_0xdbd7('0x49')](handleError(_0x576a41,null));};exports[_0xdbd7('0x2e')]=function(_0x13836c,_0x58c5ea){return db[_0xdbd7('0x45')]['find']({'where':{'id':_0x13836c[_0xdbd7('0x4a')]['id']}})[_0xdbd7('0x2d')](handleEntityNotFound(_0x58c5ea,null))[_0xdbd7('0x2d')](removeEntity(_0x58c5ea,null))['catch'](handleError(_0x58c5ea,null));};exports['describe']=function(_0x436124,_0x380bae){return db[_0xdbd7('0x45')][_0xdbd7('0x4e')]()[_0xdbd7('0x2d')](respondWithResult(_0x380bae,null))[_0xdbd7('0x49')](handleError(_0x380bae,null));};function wrapUser(_0xb0bd93){return function(_0x50f22d){var _0x11e457=_0xb0bd93[_0xdbd7('0x4f')]({'plain':!![]});_0x11e457[_0xdbd7('0x50')]=[];if(_0x50f22d){_0x11e457['lastMessageAt']=_0x50f22d[_0xdbd7('0x51')];_0x11e457[_0xdbd7('0x52')]=_0x50f22d;}else{_0x11e457[_0xdbd7('0x53')]=moment(0x0)[_0xdbd7('0x54')](_0xdbd7('0x55'));_0x11e457['lastMessage']={};}return _0x11e457;};}exports[_0xdbd7('0x56')]=function(_0x5eaf0b,_0x55345a,_0x443716){var _0x4209b9=[];return db['User'][_0xdbd7('0x57')]({'where':{'role':[_0xdbd7('0x58'),_0xdbd7('0x59'),_0xdbd7('0x5a')]},'attributes':['id',_0xdbd7('0x5b'),_0xdbd7('0x30'),'role',_0xdbd7('0x5c'),'internal',_0xdbd7('0x5d'),'lastLoginAt',_0xdbd7('0x5e'),'showWebBar'],'order':qs[_0xdbd7('0x3e')](_0xdbd7('0x5f')),'include':[{'model':db[_0xdbd7('0x60')],'as':_0xdbd7('0x61'),'attributes':['id',_0xdbd7('0x30'),_0xdbd7('0x34')],'through':{'attributes':[]}}]})[_0xdbd7('0x2d')](function(_0x42a35b){if(_0x42a35b){var _0x4c735d=_0x5eaf0b[_0xdbd7('0x5a')][_0xdbd7('0x4f')]({'plain':!![]});if(!_0x4c735d)throw new Error(_0xdbd7('0x62'));if(_0x4c735d[_0xdbd7('0x63')]==='user'){return db[_0xdbd7('0x64')][_0xdbd7('0x4b')]({'where':{'name':'Agents','userProfileId':_0x4c735d[_0xdbd7('0x65')]},'raw':!![]})['then'](function(_0x533311){if(_0x533311){if(_0x533311[_0xdbd7('0x66')]===0x0){return db[_0xdbd7('0x67')][_0xdbd7('0x57')]({'where':{'sectionId':_0x533311['id']},'raw':!![]})[_0xdbd7('0x2d')](function(_0x4ef8fd){var _0x42eb39=[];if(_['isEmpty'](_0x4ef8fd)){_0x42eb39=_['filter'](_0x42a35b,function(_0x4925d5){if(_0x4925d5['role']!==_0xdbd7('0x58')){return _0x4925d5;}});return _0x42eb39;}else{for(var _0x529ce6=0x0;_0x529ce6<_0x42a35b[_0xdbd7('0x3c')];_0x529ce6++){var _0x59cb03=_0x42a35b[_0x529ce6];if(_0x59cb03[_0xdbd7('0x63')]===_0xdbd7('0x58')){var _0x5f0ab4=_['find'](_0x4ef8fd,function(_0x3588fd){return _0x3588fd[_0xdbd7('0x68')]===_0x59cb03['id'];});if(_0x5f0ab4)_0x42eb39[_0xdbd7('0x69')](_0x59cb03);}else{_0x42eb39['push'](_0x59cb03);}}return _0x42eb39;}});}else{return _0x42a35b;}}else{var _0x12b688=_[_0xdbd7('0x41')](_0x42a35b,function(_0x4bd285){if(_0x4bd285[_0xdbd7('0x63')]!==_0xdbd7('0x58')){return _0x4bd285;}});return _0x12b688;}});}else{return _0x42a35b;}}})[_0xdbd7('0x2d')](function(_0x5c6c0d){var _0x47b70b=[];if(_0x5c6c0d){_0x4209b9=_0x5c6c0d;for(var _0x43403a=0x0;_0x43403a<_0x5c6c0d[_0xdbd7('0x3c')];_0x43403a+=0x1){_0x4209b9[_0x43403a][_0xdbd7('0x50')]=[];_0x47b70b[_0xdbd7('0x69')](db[_0xdbd7('0x45')][_0xdbd7('0x4b')]({'where':{'FromId':[_0x5eaf0b[_0xdbd7('0x5a')]['id'],_0x5c6c0d[_0x43403a]['id']],'ToId':[_0x5eaf0b[_0xdbd7('0x5a')]['id'],_0x5c6c0d[_0x43403a]['id']],'ChatGroupId':null},'attributes':['id',_0xdbd7('0x51'),_0xdbd7('0x6a'),_0xdbd7('0x6b'),_0xdbd7('0x6c'),_0xdbd7('0x4c')],'order':qs[_0xdbd7('0x3e')](_0xdbd7('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xdbd7('0x2d')](wrapUser(_0x5c6c0d[_0x43403a])));}return BPromise[_0xdbd7('0x6e')](_0x47b70b);}return[];})['then'](function(_0x233045){return{'rows':_0x233045,'count':_0x233045['length']};})[_0xdbd7('0x2d')](respondWithResult(_0x55345a,null))['catch'](handleError(_0x55345a,null));};
\ No newline at end of file
+var _0x0052=['redis','defaults','localhost','socket.io-emitter','register','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','end','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','params','keys','find','catch','create','body','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','read','-createdAt','all','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x14dcc5,_0x163ab7){var _0x35d6cc=function(_0x2de1ae){while(--_0x2de1ae){_0x14dcc5['push'](_0x14dcc5['shift']());}};_0x35d6cc(++_0x163ab7);}(_0x0052,0x128));var _0x2005=function(_0x365c0a,_0x26dcb7){_0x365c0a=_0x365c0a-0x0;var _0x19e3e7=_0x0052[_0x365c0a];return _0x19e3e7;};'use strict';var emlformat=require(_0x2005('0x0'));var rimraf=require(_0x2005('0x1'));var zipdir=require(_0x2005('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2005('0x3'));var BPromise=require(_0x2005('0x4'));var Mustache=require('mustache');var util=require(_0x2005('0x5'));var path=require(_0x2005('0x6'));var sox=require(_0x2005('0x7'));var csv=require('to-csv');var ejs=require(_0x2005('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2005('0x9'));var squel=require(_0x2005('0xa'));var crypto=require('crypto');var jsforce=require(_0x2005('0xb'));var deskjs=require(_0x2005('0xc'));var toCsv=require(_0x2005('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2005('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x2005('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2005('0x10'))(_0x2005('0x11'));var utils=require(_0x2005('0x12'));var config=require(_0x2005('0x13'));var licenseUtil=require(_0x2005('0x14'));var db=require(_0x2005('0x15'))['db'];config[_0x2005('0x16')]=_[_0x2005('0x17')](config['redis'],{'host':_0x2005('0x18'),'port':0x18eb});var socket=require(_0x2005('0x19'))(new Redis(config[_0x2005('0x16')]));require('./chatInternalMessage.socket')[_0x2005('0x1a')](socket);function respondWithStatusCode(_0x30e178,_0x13f934){_0x13f934=_0x13f934||0xcc;return function(_0x202cec){if(_0x202cec){return _0x30e178['sendStatus'](_0x13f934);}return _0x30e178[_0x2005('0x1b')](_0x13f934)['end']();};}function respondWithResult(_0x3ee93f,_0x1d07d2){_0x1d07d2=_0x1d07d2||0xc8;return function(_0x4dbcaa){if(_0x4dbcaa){return _0x3ee93f[_0x2005('0x1b')](_0x1d07d2)['json'](_0x4dbcaa);}};}function respondWithFilteredResult(_0x543bc1,_0x484a87){return function(_0x1a0810){if(_0x1a0810){var _0x1647e8=typeof _0x484a87[_0x2005('0x1c')]===_0x2005('0x1d')&&typeof _0x484a87[_0x2005('0x1e')]==='undefined';var _0x16e2ff=_0x1a0810['count'];var _0x1427c3=_0x1647e8?0x0:_0x484a87['offset'];var _0x22c725=_0x1647e8?_0x1a0810[_0x2005('0x1f')]:_0x484a87[_0x2005('0x1c')]+_0x484a87[_0x2005('0x1e')];var _0x1ac740;if(_0x22c725>=_0x16e2ff){_0x22c725=_0x16e2ff;_0x1ac740=0xc8;}else{_0x1ac740=0xce;}_0x543bc1[_0x2005('0x1b')](_0x1ac740);return _0x543bc1[_0x2005('0x20')](_0x2005('0x21'),_0x1427c3+'-'+_0x22c725+'/'+_0x16e2ff)[_0x2005('0x22')](_0x1a0810);}return null;};}function patchUpdates(_0x15d9cd){return function(_0x5c8e78){try{jsonpatch[_0x2005('0x23')](_0x5c8e78,_0x15d9cd,!![]);}catch(_0x451f75){return BPromise[_0x2005('0x24')](_0x451f75);}return _0x5c8e78['save']();};}function saveUpdates(_0x3d7d22,_0x598392){return function(_0x1fd1c3){if(_0x1fd1c3){return _0x1fd1c3[_0x2005('0x25')](_0x3d7d22)['then'](function(_0xe805a3){return _0xe805a3;});}return null;};}function removeEntity(_0x3501a8,_0x3d3649){return function(_0x3ec891){if(_0x3ec891){return _0x3ec891['destroy']()[_0x2005('0x26')](function(){_0x3501a8[_0x2005('0x1b')](0xcc)[_0x2005('0x27')]();});}};}function handleEntityNotFound(_0x3d4a22,_0x512448){return function(_0x4e3b58){if(!_0x4e3b58){_0x3d4a22['sendStatus'](0x194);}return _0x4e3b58;};}function handleError(_0x514168,_0x2d12e7){_0x2d12e7=_0x2d12e7||0x1f4;return function(_0x424435){logger['error'](_0x424435['stack']);if(_0x424435[_0x2005('0x28')]){delete _0x424435['name'];}_0x514168[_0x2005('0x1b')](_0x2d12e7)[_0x2005('0x29')](_0x424435);};}exports[_0x2005('0x2a')]=function(_0x27924f,_0x264257){var _0x1fafea={},_0x21af35={},_0x3a7e29={'count':0x0,'rows':[]};var _0x4408d1=_[_0x2005('0x2b')](db[_0x2005('0x2c')][_0x2005('0x2d')],function(_0xcec449){return{'name':_0xcec449[_0x2005('0x2e')],'type':_0xcec449[_0x2005('0x2f')]['key']};});_0x21af35[_0x2005('0x30')]=_[_0x2005('0x2b')](_0x4408d1,_0x2005('0x28'));_0x21af35['query']=_['keys'](_0x27924f[_0x2005('0x31')]);_0x21af35[_0x2005('0x32')]=_[_0x2005('0x33')](_0x21af35[_0x2005('0x30')],_0x21af35['query']);_0x1fafea[_0x2005('0x34')]=_['intersection'](_0x21af35[_0x2005('0x30')],qs[_0x2005('0x35')](_0x27924f[_0x2005('0x31')]['fields']));_0x1fafea[_0x2005('0x34')]=_0x1fafea[_0x2005('0x34')][_0x2005('0x36')]?_0x1fafea[_0x2005('0x34')]:_0x21af35[_0x2005('0x30')];if(!_0x27924f[_0x2005('0x31')]['hasOwnProperty'](_0x2005('0x37'))){_0x1fafea['limit']=qs['limit'](_0x27924f[_0x2005('0x31')][_0x2005('0x1e')]);_0x1fafea['offset']=qs[_0x2005('0x1c')](_0x27924f[_0x2005('0x31')][_0x2005('0x1c')]);}_0x1fafea[_0x2005('0x38')]=qs[_0x2005('0x39')](_0x27924f[_0x2005('0x31')][_0x2005('0x39')]);_0x1fafea[_0x2005('0x3a')]=qs[_0x2005('0x32')](_['pick'](_0x27924f[_0x2005('0x31')],_0x21af35[_0x2005('0x32')]),_0x4408d1);if(_0x27924f[_0x2005('0x31')][_0x2005('0x3b')]){_0x1fafea[_0x2005('0x3a')]=_[_0x2005('0x3c')](_0x1fafea[_0x2005('0x3a')],{'$or':_[_0x2005('0x2b')](_0x4408d1,function(_0xd51378){if(_0xd51378['type']!==_0x2005('0x3d')){var _0x3a0334={};_0x3a0334[_0xd51378[_0x2005('0x28')]]={'$like':'%'+_0x27924f[_0x2005('0x31')][_0x2005('0x3b')]+'%'};return _0x3a0334;}})});}_0x1fafea=_[_0x2005('0x3c')]({},_0x1fafea,_0x27924f[_0x2005('0x3e')]);var _0x5e1855={'where':_0x1fafea['where']};return db[_0x2005('0x2c')]['count'](_0x5e1855)[_0x2005('0x26')](function(_0x3b3eac){_0x3a7e29[_0x2005('0x1f')]=_0x3b3eac;if(_0x27924f['query']['includeAll']){_0x1fafea[_0x2005('0x3f')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x2005('0x40')](_0x1fafea);})[_0x2005('0x26')](function(_0x19bfc7){_0x3a7e29['rows']=_0x19bfc7;return _0x3a7e29;})[_0x2005('0x26')](respondWithFilteredResult(_0x264257,_0x1fafea))['catch'](handleError(_0x264257,null));};exports['show']=function(_0x232278,_0x1d009e){var _0x266b65={'raw':!![],'where':{'id':_0x232278[_0x2005('0x41')]['id']}},_0x206798={};_0x206798[_0x2005('0x30')]=_[_0x2005('0x42')](db[_0x2005('0x2c')][_0x2005('0x2d')]);_0x206798[_0x2005('0x31')]=_[_0x2005('0x42')](_0x232278['query']);_0x206798[_0x2005('0x32')]=_[_0x2005('0x33')](_0x206798[_0x2005('0x30')],_0x206798[_0x2005('0x31')]);_0x266b65['attributes']=_['intersection'](_0x206798['model'],qs[_0x2005('0x35')](_0x232278[_0x2005('0x31')][_0x2005('0x35')]));_0x266b65['attributes']=_0x266b65[_0x2005('0x34')][_0x2005('0x36')]?_0x266b65['attributes']:_0x206798[_0x2005('0x30')];if(_0x232278[_0x2005('0x31')]['includeAll']){_0x266b65[_0x2005('0x3f')]=[{'all':!![]}];}_0x266b65=_['merge']({},_0x266b65,_0x232278[_0x2005('0x3e')]);return db[_0x2005('0x2c')][_0x2005('0x43')](_0x266b65)['then'](handleEntityNotFound(_0x1d009e,null))[_0x2005('0x26')](respondWithResult(_0x1d009e,null))[_0x2005('0x44')](handleError(_0x1d009e,null));};exports[_0x2005('0x45')]=function(_0xc96105,_0x1b556f){return db[_0x2005('0x2c')][_0x2005('0x45')](_0xc96105[_0x2005('0x46')],{})['then'](respondWithResult(_0x1b556f,0xc9))[_0x2005('0x44')](handleError(_0x1b556f,null));};exports[_0x2005('0x25')]=function(_0x423e0a,_0x3e926c){if(_0x423e0a[_0x2005('0x46')]['id']){delete _0x423e0a[_0x2005('0x46')]['id'];}return db['ChatInternalMessage'][_0x2005('0x43')]({'where':{'id':_0x423e0a[_0x2005('0x41')]['id']}})[_0x2005('0x26')](handleEntityNotFound(_0x3e926c,null))[_0x2005('0x26')](saveUpdates(_0x423e0a[_0x2005('0x46')],null))[_0x2005('0x26')](respondWithResult(_0x3e926c,null))[_0x2005('0x44')](handleError(_0x3e926c,null));};exports[_0x2005('0x47')]=function(_0x54eff2,_0x2b34c3){return db[_0x2005('0x2c')][_0x2005('0x43')]({'where':{'id':_0x54eff2[_0x2005('0x41')]['id']}})[_0x2005('0x26')](handleEntityNotFound(_0x2b34c3,null))[_0x2005('0x26')](removeEntity(_0x2b34c3,null))[_0x2005('0x44')](handleError(_0x2b34c3,null));};exports[_0x2005('0x48')]=function(_0x833b58,_0x59fdfb){return db['ChatInternalMessage'][_0x2005('0x48')]()[_0x2005('0x26')](respondWithResult(_0x59fdfb,null))[_0x2005('0x44')](handleError(_0x59fdfb,null));};function wrapUser(_0x10a470){return function(_0x51577b){var _0x17dcbf=_0x10a470[_0x2005('0x49')]({'plain':!![]});_0x17dcbf[_0x2005('0x4a')]=[];if(_0x51577b){_0x17dcbf[_0x2005('0x4b')]=_0x51577b[_0x2005('0x4c')];_0x17dcbf[_0x2005('0x4d')]=_0x51577b;}else{_0x17dcbf['lastMessageAt']=moment(0x0)[_0x2005('0x4e')](_0x2005('0x4f'));_0x17dcbf[_0x2005('0x4d')]={};}return _0x17dcbf;};}exports[_0x2005('0x50')]=function(_0x3e7d4e,_0x48f070,_0x14e768){var _0x26116e=[];return db[_0x2005('0x51')][_0x2005('0x40')]({'where':{'role':[_0x2005('0x52'),_0x2005('0x53'),_0x2005('0x54')]},'attributes':['id',_0x2005('0x55'),'name',_0x2005('0x56'),_0x2005('0x57'),'internal','online',_0x2005('0x58'),_0x2005('0x59'),_0x2005('0x5a')],'order':qs[_0x2005('0x39')](_0x2005('0x5b')),'include':[{'model':db[_0x2005('0x5c')],'as':_0x2005('0x5d'),'attributes':['id',_0x2005('0x28'),_0x2005('0x2f')],'through':{'attributes':[]}}]})[_0x2005('0x26')](function(_0x1e365e){if(_0x1e365e){var _0x43d983=_0x3e7d4e[_0x2005('0x54')]['get']({'plain':!![]});if(!_0x43d983)throw new Error(_0x2005('0x5e'));if(_0x43d983['role']===_0x2005('0x54')){return db[_0x2005('0x5f')][_0x2005('0x43')]({'where':{'name':_0x2005('0x60'),'userProfileId':_0x43d983[_0x2005('0x61')]},'raw':!![]})['then'](function(_0x3c41ae){if(_0x3c41ae){if(_0x3c41ae[_0x2005('0x62')]===0x0){return db[_0x2005('0x63')][_0x2005('0x40')]({'where':{'sectionId':_0x3c41ae['id']},'raw':!![]})['then'](function(_0x2f507e){var _0x43f8ac=[];if(_[_0x2005('0x64')](_0x2f507e)){_0x43f8ac=_['filter'](_0x1e365e,function(_0x30991a){if(_0x30991a[_0x2005('0x56')]!=='agent'){return _0x30991a;}});return _0x43f8ac;}else{for(var _0x4e4d37=0x0;_0x4e4d37<_0x1e365e[_0x2005('0x36')];_0x4e4d37++){var _0x12b7d2=_0x1e365e[_0x4e4d37];if(_0x12b7d2[_0x2005('0x56')]===_0x2005('0x52')){var _0x34aa89=_['find'](_0x2f507e,function(_0x1f52d4){return _0x1f52d4[_0x2005('0x65')]===_0x12b7d2['id'];});if(_0x34aa89)_0x43f8ac[_0x2005('0x66')](_0x12b7d2);}else{_0x43f8ac[_0x2005('0x66')](_0x12b7d2);}}return _0x43f8ac;}});}else{return _0x1e365e;}}else{var _0x5627b3=_[_0x2005('0x3b')](_0x1e365e,function(_0x4b2453){if(_0x4b2453[_0x2005('0x56')]!==_0x2005('0x52')){return _0x4b2453;}});return _0x5627b3;}});}else{return _0x1e365e;}}})[_0x2005('0x26')](function(_0x4c9b5f){var _0x4ea91a=[];if(_0x4c9b5f){_0x26116e=_0x4c9b5f;for(var _0x449548=0x0;_0x449548<_0x4c9b5f[_0x2005('0x36')];_0x449548+=0x1){_0x26116e[_0x449548]['messages']=[];_0x4ea91a[_0x2005('0x66')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x3e7d4e['user']['id'],_0x4c9b5f[_0x449548]['id']],'ToId':[_0x3e7d4e[_0x2005('0x54')]['id'],_0x4c9b5f[_0x449548]['id']],'ChatGroupId':null},'attributes':['id',_0x2005('0x4c'),'FromId','ToId',_0x2005('0x67'),_0x2005('0x46')],'order':qs[_0x2005('0x39')](_0x2005('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x2005('0x26')](wrapUser(_0x4c9b5f[_0x449548])));}return BPromise[_0x2005('0x69')](_0x4ea91a);}return[];})[_0x2005('0x26')](function(_0x472059){return{'rows':_0x472059,'count':_0x472059[_0x2005('0x36')]};})['then'](respondWithResult(_0x48f070,null))[_0x2005('0x44')](handleError(_0x48f070,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 5d14210..9206086 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 _0xf628=['exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','emit','hasOwnProperty'];(function(_0x398a4b,_0x3474fb){var _0x493eda=function(_0x388dbb){while(--_0x388dbb){_0x398a4b['push'](_0x398a4b['shift']());}};_0x493eda(++_0x3474fb);}(_0xf628,0x7f));var _0x8f62=function(_0x46ce86,_0x2e07e0){_0x46ce86=_0x46ce86-0x0;var _0x29e3b6=_0xf628[_0x46ce86];return _0x29e3b6;};'use strict';var EventEmitter=require(_0x8f62('0x0'));var ChatInternalMessage=require(_0x8f62('0x1'))['db'][_0x8f62('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x8f62('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x393c04){return function(_0x18593f,_0x1706d2,_0x2377a5){ChatInternalMessageEvents[_0x8f62('0x4')](_0x393c04+':'+_0x18593f['id'],_0x18593f);ChatInternalMessageEvents['emit'](_0x393c04,_0x18593f);_0x2377a5(null);};}for(var e in events){if(events[_0x8f62('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x8f62('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x6370=['events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x4fff8b,_0x413fd4){var _0x8fd07e=function(_0x367f03){while(--_0x367f03){_0x4fff8b['push'](_0x4fff8b['shift']());}};_0x8fd07e(++_0x413fd4);}(_0x6370,0x99));var _0x0637=function(_0x58c513,_0x15deec){_0x58c513=_0x58c513-0x0;var _0x4da4c4=_0x6370[_0x58c513];return _0x4da4c4;};'use strict';var EventEmitter=require(_0x0637('0x0'));var ChatInternalMessage=require(_0x0637('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0637('0x2')](0x0);var events={'afterCreate':_0x0637('0x3'),'afterUpdate':_0x0637('0x4'),'afterDestroy':'remove'};function emitEvent(_0x11b4ea){return function(_0x1e54b7,_0x3c9c73,_0x1a0239){ChatInternalMessageEvents[_0x0637('0x5')](_0x11b4ea+':'+_0x1e54b7['id'],_0x1e54b7);ChatInternalMessageEvents[_0x0637('0x5')](_0x11b4ea,_0x1e54b7);_0x1a0239(null);};}for(var e in events){if(events[_0x0637('0x6')](e)){var event=events[e];ChatInternalMessage[_0x0637('0x7')](e,emitEvent(event));}}module[_0x0637('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 07bc515..94e90be 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 _0xc7b4=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4','lodash'];(function(_0x3e6ac0,_0x34b200){var _0xe1dee5=function(_0x8864a8){while(--_0x8864a8){_0x3e6ac0['push'](_0x3e6ac0['shift']());}};_0xe1dee5(++_0x34b200);}(_0xc7b4,0x8b));var _0x4c7b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7b4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4c7b('0x0'));var util=require(_0x4c7b('0x1'));var logger=require('../../config/logger')(_0x4c7b('0x2'));var moment=require(_0x4c7b('0x3'));var BPromise=require(_0x4c7b('0x4'));var rp=require(_0x4c7b('0x5'));var fs=require('fs');var path=require(_0x4c7b('0x6'));var rimraf=require(_0x4c7b('0x7'));var config=require(_0x4c7b('0x8'));var attributes=require(_0x4c7b('0x9'));module[_0x4c7b('0xa')]=function(_0xa2f065,_0x20234b){return _0xa2f065[_0x4c7b('0xb')]('ChatInternalMessage',attributes,{'tableName':_0x4c7b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4c7b('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xa7ac=['lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x2007e9,_0x29df16){var _0x435c09=function(_0x2cf569){while(--_0x2cf569){_0x2007e9['push'](_0x2007e9['shift']());}};_0x435c09(++_0x29df16);}(_0xa7ac,0xb6));var _0xca7a=function(_0x2cbfe5,_0x1fb99b){_0x2cbfe5=_0x2cbfe5-0x0;var _0x3f69ad=_0xa7ac[_0x2cbfe5];return _0x3f69ad;};'use strict';var _=require(_0xca7a('0x0'));var util=require(_0xca7a('0x1'));var logger=require(_0xca7a('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xca7a('0x3'));var fs=require('fs');var path=require(_0xca7a('0x4'));var rimraf=require(_0xca7a('0x5'));var config=require(_0xca7a('0x6'));var attributes=require('./chatInternalMessage.attributes');module[_0xca7a('0x7')]=function(_0x47dc7b,_0x4ca145){return _0x47dc7b[_0xca7a('0x8')](_0xca7a('0x9'),attributes,{'tableName':_0xca7a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xca7a('0xb'),'collate':_0xca7a('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index ffe6b11..17deb3f 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 _0xde84=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','register','info','ChatInternalMessage,\x20%s,\x20%s','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x2f6322,_0xaf6305){var _0x77bcf6=function(_0x358932){while(--_0x358932){_0x2f6322['push'](_0x2f6322['shift']());}};_0x77bcf6(++_0xaf6305);}(_0xde84,0x84));var _0x4de8=function(_0x287e0f,_0x5638e7){_0x287e0f=_0x287e0f-0x0;var _0x4dd42a=_0xde84[_0x287e0f];return _0x4dd42a;};'use strict';var _=require(_0x4de8('0x0'));var util=require(_0x4de8('0x1'));var moment=require(_0x4de8('0x2'));var BPromise=require(_0x4de8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4de8('0x4'));var db=require(_0x4de8('0x5'))['db'];var utils=require(_0x4de8('0x6'));var logger=require(_0x4de8('0x7'))(_0x4de8('0x8'));var config=require(_0x4de8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4de8('0xa')]({'port':0x232a});config[_0x4de8('0xb')]=_[_0x4de8('0xc')](config[_0x4de8('0xb')],{'host':_0x4de8('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4de8('0xb')]));require('./chatInternalMessage.socket')[_0x4de8('0xe')](socket);function respondWithRpcPromise(_0x170a2b,_0x387a29,_0x185136){return new BPromise(function(_0x531f82,_0x65e52d){return client['request'](_0x170a2b,_0x185136)['then'](function(_0x718a0e){logger[_0x4de8('0xf')](_0x4de8('0x10'),_0x387a29,'request\x20sent');logger[_0x4de8('0x11')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x387a29,'request\x20sent',JSON[_0x4de8('0x12')](_0x718a0e));if(_0x718a0e['error']){if(_0x718a0e[_0x4de8('0x13')][_0x4de8('0x14')]===0x1f4){logger[_0x4de8('0x13')](_0x4de8('0x10'),_0x387a29,_0x718a0e[_0x4de8('0x13')][_0x4de8('0x15')]);return _0x65e52d(_0x718a0e[_0x4de8('0x13')]['message']);}logger[_0x4de8('0x13')](_0x4de8('0x10'),_0x387a29,_0x718a0e['error'][_0x4de8('0x15')]);return _0x531f82(_0x718a0e[_0x4de8('0x13')][_0x4de8('0x15')]);}else{logger['info'](_0x4de8('0x10'),_0x387a29,'request\x20sent');_0x531f82(_0x718a0e[_0x4de8('0x16')][_0x4de8('0x15')]);}})['catch'](function(_0x2edd23){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x387a29,_0x2edd23);_0x65e52d(_0x2edd23);});});}
\ No newline at end of file
+var _0x1a6b=['register','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','localhost','./chatInternalMessage.socket'];(function(_0x126797,_0x586e0a){var _0xe2afa7=function(_0x1e4a21){while(--_0x1e4a21){_0x126797['push'](_0x126797['shift']());}};_0xe2afa7(++_0x586e0a);}(_0x1a6b,0x94));var _0xb1a6=function(_0x1d15a9,_0x223eab){_0x1d15a9=_0x1d15a9-0x0;var _0x53ae6d=_0x1a6b[_0x1d15a9];return _0x53ae6d;};'use strict';var _=require(_0xb1a6('0x0'));var util=require(_0xb1a6('0x1'));var moment=require(_0xb1a6('0x2'));var BPromise=require('bluebird');var rs=require(_0xb1a6('0x3'));var fs=require('fs');var Redis=require(_0xb1a6('0x4'));var db=require(_0xb1a6('0x5'))['db'];var utils=require(_0xb1a6('0x6'));var logger=require('../../config/logger')(_0xb1a6('0x7'));var config=require('../../config/environment');var jayson=require(_0xb1a6('0x8'));var client=jayson[_0xb1a6('0x9')]['http']({'port':0x232a});config[_0xb1a6('0xa')]=_['defaults'](config[_0xb1a6('0xa')],{'host':_0xb1a6('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb1a6('0xa')]));require(_0xb1a6('0xc'))[_0xb1a6('0xd')](socket);function respondWithRpcPromise(_0x2dc37d,_0x4e585e,_0x41cde3){return new BPromise(function(_0x211cdd,_0x19fd96){return client['request'](_0x2dc37d,_0x41cde3)['then'](function(_0x4bffda){logger['info'](_0xb1a6('0xe'),_0x4e585e,_0xb1a6('0xf'));logger['debug'](_0xb1a6('0x10'),_0x4e585e,'request\x20sent',JSON['stringify'](_0x4bffda));if(_0x4bffda[_0xb1a6('0x11')]){if(_0x4bffda['error'][_0xb1a6('0x12')]===0x1f4){logger['error'](_0xb1a6('0xe'),_0x4e585e,_0x4bffda[_0xb1a6('0x11')][_0xb1a6('0x13')]);return _0x19fd96(_0x4bffda['error'][_0xb1a6('0x13')]);}logger['error'](_0xb1a6('0xe'),_0x4e585e,_0x4bffda['error'][_0xb1a6('0x13')]);return _0x211cdd(_0x4bffda['error'][_0xb1a6('0x13')]);}else{logger[_0xb1a6('0x14')](_0xb1a6('0xe'),_0x4e585e,_0xb1a6('0xf'));_0x211cdd(_0x4bffda[_0xb1a6('0x15')][_0xb1a6('0x13')]);}})[_0xb1a6('0x16')](function(_0x5e42ca){logger[_0xb1a6('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x4e585e,_0x5e42ca);_0x19fd96(_0x5e42ca);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index d7bb81a..dbfdb48 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 _0xe2e5=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','update'];(function(_0x566e36,_0x25a2f9){var _0x18fc87=function(_0x102b83){while(--_0x102b83){_0x566e36['push'](_0x566e36['shift']());}};_0x18fc87(++_0x25a2f9);}(_0xe2e5,0x135));var _0x5e2e=function(_0x365e6d,_0x2b0157){_0x365e6d=_0x365e6d-0x0;var _0x76b60=_0xe2e5[_0x365e6d];return _0x76b60;};'use strict';var ChatInternalMessageEvents=require(_0x5e2e('0x0'));var events=[_0x5e2e('0x1'),'remove',_0x5e2e('0x2')];function createListener(_0x542ae8,_0x33a6b8){return function(_0x2c375a){_0x33a6b8[_0x5e2e('0x3')](_0x542ae8,_0x2c375a);};}function removeListener(_0x5ecd21,_0x5bad8a){return function(){ChatInternalMessageEvents[_0x5e2e('0x4')](_0x5ecd21,_0x5bad8a);};}exports[_0x5e2e('0x5')]=function(_0x58518e){for(var _0x5f5bc7=0x0,_0x9166fc=events[_0x5e2e('0x6')];_0x5f5bc7<_0x9166fc;_0x5f5bc7++){var _0x2c08ee=events[_0x5f5bc7];var _0x58fce3=createListener(_0x5e2e('0x7')+_0x2c08ee,_0x58518e);ChatInternalMessageEvents['on'](_0x2c08ee,_0x58fce3);}};
\ No newline at end of file
+var _0xc0f5=['length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','register'];(function(_0x381379,_0x3f3b86){var _0x3e1063=function(_0x4c282d){while(--_0x4c282d){_0x381379['push'](_0x381379['shift']());}};_0x3e1063(++_0x3f3b86);}(_0xc0f5,0x11a));var _0x5c0f=function(_0x508c7e,_0x9ac41e){_0x508c7e=_0x508c7e-0x0;var _0x4476e3=_0xc0f5[_0x508c7e];return _0x4476e3;};'use strict';var ChatInternalMessageEvents=require(_0x5c0f('0x0'));var events=[_0x5c0f('0x1'),_0x5c0f('0x2'),_0x5c0f('0x3')];function createListener(_0x3e6abb,_0x3d0c9f){return function(_0x12c8a3){_0x3d0c9f[_0x5c0f('0x4')](_0x3e6abb,_0x12c8a3);};}function removeListener(_0x1048d9,_0x105281){return function(){ChatInternalMessageEvents['removeListener'](_0x1048d9,_0x105281);};}exports[_0x5c0f('0x5')]=function(_0x34c0e9){for(var _0xd437c6=0x0,_0x116db2=events[_0x5c0f('0x6')];_0xd437c6<_0x116db2;_0xd437c6++){var _0x44a9d3=events[_0xd437c6];var _0x2e96c3=createListener(_0x5c0f('0x7')+_0x44a9d3,_0x34c0e9);ChatInternalMessageEvents['on'](_0x44a9d3,_0x2e96c3);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index fd99667..22377de 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 _0x969d=['post','create','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show'];(function(_0x311879,_0x25d1e1){var _0x4e7cd4=function(_0x4f4e88){while(--_0x4f4e88){_0x311879['push'](_0x311879['shift']());}};_0x4e7cd4(++_0x25d1e1);}(_0x969d,0x155));var _0xd969=function(_0x5c6831,_0x3fe733){_0x5c6831=_0x5c6831-0x0;var _0x4d96af=_0x969d[_0x5c6831];return _0x4d96af;};'use strict';var multer=require(_0xd969('0x0'));var util=require(_0xd969('0x1'));var path=require('path');var timeout=require(_0xd969('0x2'));var express=require(_0xd969('0x3'));var router=express[_0xd969('0x4')]();var fs_extra=require(_0xd969('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd969('0x6'));router[_0xd969('0x7')]('/',auth[_0xd969('0x8')](),controller[_0xd969('0x9')]);router[_0xd969('0x7')](_0xd969('0xa'),auth[_0xd969('0x8')](),controller[_0xd969('0xb')]);router[_0xd969('0x7')](_0xd969('0xc'),auth['isAuthenticated'](),controller[_0xd969('0xd')]);router[_0xd969('0x7')](_0xd969('0xe'),auth['isAuthenticated'](),controller[_0xd969('0xf')]);router[_0xd969('0x10')]('/',auth[_0xd969('0x8')](),controller[_0xd969('0x11')]);router[_0xd969('0x12')](_0xd969('0xe'),controller[_0xd969('0x13')]);router['delete']('/:id',auth[_0xd969('0x8')](),controller[_0xd969('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x5c04=['connect-timeout','fs-extra','../../components/auth/service','get','/describe','isAuthenticated','/users','getUsers','show','create','/:id','update','exports','multer','util'];(function(_0x5b360e,_0x494136){var _0x1bf752=function(_0x6df32e){while(--_0x6df32e){_0x5b360e['push'](_0x5b360e['shift']());}};_0x1bf752(++_0x494136);}(_0x5c04,0x139));var _0x45c0=function(_0x43695d,_0x34bc11){_0x43695d=_0x43695d-0x0;var _0x2c004d=_0x5c04[_0x43695d];return _0x2c004d;};'use strict';var multer=require(_0x45c0('0x0'));var util=require(_0x45c0('0x1'));var path=require('path');var timeout=require(_0x45c0('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x45c0('0x3'));var auth=require(_0x45c0('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x45c0('0x5')](_0x45c0('0x6'),auth[_0x45c0('0x7')](),controller['describe']);router[_0x45c0('0x5')](_0x45c0('0x8'),auth[_0x45c0('0x7')](),controller[_0x45c0('0x9')]);router['get']('/:id',auth[_0x45c0('0x7')](),controller[_0x45c0('0xa')]);router['post']('/',auth[_0x45c0('0x7')](),controller[_0x45c0('0xb')]);router['put'](_0x45c0('0xc'),controller[_0x45c0('0xd')]);router['delete'](_0x45c0('0xc'),auth[_0x45c0('0x7')](),controller['destroy']);module[_0x45c0('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index ddce367..ab2ea94 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 _0x1123=['TEXT','BOOLEAN','ENUM','DATE','STRING'];(function(_0x54aef6,_0x4155fc){var _0x1a2d10=function(_0x4cefb6){while(--_0x4cefb6){_0x54aef6['push'](_0x54aef6['shift']());}};_0x1a2d10(++_0x4155fc);}(_0x1123,0x118));var _0x3112=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x1123[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x3112('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x3112('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0x3112('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3112('0x2')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x3112('0x3')]},'providerName':{'type':Sequelize[_0x3112('0x4')]},'providerResponse':{'type':Sequelize[_0x3112('0x0')]}};
\ No newline at end of file
+var _0x117c=['ENUM','out','DATE','STRING','TEXT','medium'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x117c,0x71));var _0xc117=function(_0xb72cc8,_0x3b7aa3){_0xb72cc8=_0xb72cc8-0x0;var _0x75cfb3=_0x117c[_0xb72cc8];return _0x75cfb3;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0xc117('0x0')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xc117('0x1')]('in',_0xc117('0x2')),'defaultValue':_0xc117('0x2'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc117('0x3')]},'providerName':{'type':Sequelize[_0xc117('0x4')]},'providerResponse':{'type':Sequelize[_0xc117('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 4608446..e8b5d11 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 _0x05cd=['set','Content-Range','reject','save','destroy','sendStatus','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','type','options','ChatMessage','includeAll','include','findAll','rows','find','create','body','update','params','describe','../../config/logger','chat-interactions','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','ChatInteractionId','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','User','agent','fullname','email','internal','SIP/%s','channel','motionChannel','EventManager','acceptmessage','parse','formData','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','rejectMessage','QueryTypes','SELECT','interface','rejectmessage','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','end','status','json','offset','limit','count'];(function(_0x555573,_0x462f66){var _0x2c48e4=function(_0x1c00ac){while(--_0x1c00ac){_0x555573['push'](_0x555573['shift']());}};_0x2c48e4(++_0x462f66);}(_0x05cd,0xd4));var _0xd05c=function(_0x3b58b5,_0x5799ad){_0x3b58b5=_0x3b58b5-0x0;var _0x5d48e6=_0x05cd[_0x3b58b5];return _0x5d48e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd05c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd05c('0x1'));var rp=require(_0xd05c('0x2'));var moment=require(_0xd05c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd05c('0x4'));var util=require(_0xd05c('0x5'));var path=require(_0xd05c('0x6'));var sox=require(_0xd05c('0x7'));var csv=require(_0xd05c('0x8'));var ejs=require(_0xd05c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd05c('0xa'));var squel=require(_0xd05c('0xb'));var crypto=require(_0xd05c('0xc'));var jsforce=require(_0xd05c('0xd'));var deskjs=require(_0xd05c('0xe'));var toCsv=require(_0xd05c('0x8'));var querystring=require(_0xd05c('0xf'));var Papa=require('papaparse');var Redis=require(_0xd05c('0x10'));var authService=require(_0xd05c('0x11'));var qs=require(_0xd05c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd05c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xd05c('0x14'));var config=require(_0xd05c('0x15'));var licenseUtil=require(_0xd05c('0x16'));var db=require(_0xd05c('0x17'))['db'];config[_0xd05c('0x18')]=_[_0xd05c('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd05c('0x1a'))(new Redis(config[_0xd05c('0x18')]));require(_0xd05c('0x1b'))['register'](socket);var jayson=require(_0xd05c('0x1c'));var client=jayson[_0xd05c('0x1d')][_0xd05c('0x1e')]({'port':0x232c});var client9002=jayson[_0xd05c('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x504db0,_0x455804,_0x2645d3,_0x29a6e7){return new BPromise(function(_0x1d6838,_0x57fa3f){var _0x431611=_0x29a6e7||client;return _0x431611[_0xd05c('0x1f')](_0x504db0,_0x2645d3)[_0xd05c('0x20')](function(_0xb3a471){logger[_0xd05c('0x21')](_0xd05c('0x22'),_0x455804,'request\x20sent');logger['debug'](_0xd05c('0x23'),_0x455804,'request\x20sent',JSON['stringify'](_0xb3a471));if(_0xb3a471[_0xd05c('0x24')]){if(_0xb3a471[_0xd05c('0x24')][_0xd05c('0x25')]===0x1f4){logger['error'](_0xd05c('0x22'),_0x455804,_0xb3a471[_0xd05c('0x24')][_0xd05c('0x26')]);return _0x57fa3f(_0xb3a471[_0xd05c('0x24')][_0xd05c('0x26')]);}logger['error'](_0xd05c('0x22'),_0x455804,_0xb3a471[_0xd05c('0x24')]['message']);return _0x1d6838(_0xb3a471[_0xd05c('0x24')][_0xd05c('0x26')]);}else{logger['info'](_0xd05c('0x22'),_0x455804,'request\x20sent');_0x1d6838(_0xb3a471['result'][_0xd05c('0x26')]);}})[_0xd05c('0x27')](function(_0x6d4d9e){logger[_0xd05c('0x24')](_0xd05c('0x22'),_0x455804,_0x6d4d9e);_0x57fa3f(_0x6d4d9e);});});}function respondWithStatusCode(_0x4937f2,_0x27876d){_0x27876d=_0x27876d||0xcc;return function(_0x58011b){if(_0x58011b){return _0x4937f2['sendStatus'](_0x27876d);}return _0x4937f2['status'](_0x27876d)[_0xd05c('0x28')]();};}function respondWithResult(_0x3a38a0,_0x254034){_0x254034=_0x254034||0xc8;return function(_0x49d14a){if(_0x49d14a){return _0x3a38a0[_0xd05c('0x29')](_0x254034)[_0xd05c('0x2a')](_0x49d14a);}};}function respondWithFilteredResult(_0x546107,_0x2b9a43){return function(_0x26e195){if(_0x26e195){var _0x4d5513=typeof _0x2b9a43[_0xd05c('0x2b')]==='undefined'&&typeof _0x2b9a43[_0xd05c('0x2c')]==='undefined';var _0x573bfb=_0x26e195[_0xd05c('0x2d')];var _0x530949=_0x4d5513?0x0:_0x2b9a43[_0xd05c('0x2b')];var _0x52c85c=_0x4d5513?_0x26e195['count']:_0x2b9a43['offset']+_0x2b9a43[_0xd05c('0x2c')];var _0xfd08e2;if(_0x52c85c>=_0x573bfb){_0x52c85c=_0x573bfb;_0xfd08e2=0xc8;}else{_0xfd08e2=0xce;}_0x546107[_0xd05c('0x29')](_0xfd08e2);return _0x546107[_0xd05c('0x2e')](_0xd05c('0x2f'),_0x530949+'-'+_0x52c85c+'/'+_0x573bfb)['json'](_0x26e195);}return null;};}function patchUpdates(_0x178333){return function(_0x4b580c){try{jsonpatch['apply'](_0x4b580c,_0x178333,!![]);}catch(_0x497e59){return BPromise[_0xd05c('0x30')](_0x497e59);}return _0x4b580c[_0xd05c('0x31')]();};}function saveUpdates(_0x44b905,_0x5c2430){return function(_0x922ccb){if(_0x922ccb){return _0x922ccb['update'](_0x44b905)['then'](function(_0x4621df){return _0x4621df;});}return null;};}function removeEntity(_0x53bef1,_0xc25105){return function(_0xaffdce){if(_0xaffdce){return _0xaffdce[_0xd05c('0x32')]()[_0xd05c('0x20')](function(){_0x53bef1[_0xd05c('0x29')](0xcc)[_0xd05c('0x28')]();});}};}function handleEntityNotFound(_0x136d97,_0x515f02){return function(_0x3372f7){if(!_0x3372f7){_0x136d97[_0xd05c('0x33')](0x194);}return _0x3372f7;};}function handleError(_0x215fd8,_0x8a4931){_0x8a4931=_0x8a4931||0x1f4;return function(_0x1febbd){logger[_0xd05c('0x24')](_0x1febbd['stack']);if(_0x1febbd[_0xd05c('0x34')]){delete _0x1febbd[_0xd05c('0x34')];}_0x215fd8['status'](_0x8a4931)[_0xd05c('0x35')](_0x1febbd);};}exports['index']=function(_0x5afaaa,_0x1c4b85){var _0x56f26f={},_0x4f7307={},_0x569432={'count':0x0,'rows':[]};var _0x5b50ce=_[_0xd05c('0x36')](db['ChatMessage'][_0xd05c('0x37')],function(_0x32cd33){return{'name':_0x32cd33[_0xd05c('0x38')],'type':_0x32cd33['type'][_0xd05c('0x39')]};});_0x4f7307[_0xd05c('0x3a')]=_[_0xd05c('0x36')](_0x5b50ce,'name');_0x4f7307[_0xd05c('0x3b')]=_[_0xd05c('0x3c')](_0x5afaaa[_0xd05c('0x3b')]);_0x4f7307[_0xd05c('0x3d')]=_[_0xd05c('0x3e')](_0x4f7307[_0xd05c('0x3a')],_0x4f7307[_0xd05c('0x3b')]);_0x56f26f[_0xd05c('0x3f')]=_[_0xd05c('0x3e')](_0x4f7307[_0xd05c('0x3a')],qs[_0xd05c('0x40')](_0x5afaaa[_0xd05c('0x3b')][_0xd05c('0x40')]));_0x56f26f['attributes']=_0x56f26f['attributes'][_0xd05c('0x41')]?_0x56f26f[_0xd05c('0x3f')]:_0x4f7307[_0xd05c('0x3a')];if(!_0x5afaaa[_0xd05c('0x3b')]['hasOwnProperty'](_0xd05c('0x42'))){_0x56f26f[_0xd05c('0x2c')]=qs[_0xd05c('0x2c')](_0x5afaaa[_0xd05c('0x3b')][_0xd05c('0x2c')]);_0x56f26f[_0xd05c('0x2b')]=qs[_0xd05c('0x2b')](_0x5afaaa[_0xd05c('0x3b')][_0xd05c('0x2b')]);}_0x56f26f[_0xd05c('0x43')]=qs[_0xd05c('0x44')](_0x5afaaa[_0xd05c('0x3b')][_0xd05c('0x44')]);_0x56f26f['where']=qs[_0xd05c('0x3d')](_[_0xd05c('0x45')](_0x5afaaa[_0xd05c('0x3b')],_0x4f7307['filters']),_0x5b50ce);if(_0x5afaaa[_0xd05c('0x3b')][_0xd05c('0x46')]){_0x56f26f[_0xd05c('0x47')]=_[_0xd05c('0x48')](_0x56f26f[_0xd05c('0x47')],{'$or':_[_0xd05c('0x36')](_0x5b50ce,function(_0x2a28f2){if(_0x2a28f2[_0xd05c('0x49')]!=='VIRTUAL'){var _0x352c2a={};_0x352c2a[_0x2a28f2['name']]={'$like':'%'+_0x5afaaa[_0xd05c('0x3b')][_0xd05c('0x46')]+'%'};return _0x352c2a;}})});}_0x56f26f=_['merge']({},_0x56f26f,_0x5afaaa[_0xd05c('0x4a')]);var _0x48ae35={'where':_0x56f26f[_0xd05c('0x47')]};return db[_0xd05c('0x4b')][_0xd05c('0x2d')](_0x48ae35)[_0xd05c('0x20')](function(_0x402c3a){_0x569432[_0xd05c('0x2d')]=_0x402c3a;if(_0x5afaaa['query'][_0xd05c('0x4c')]){_0x56f26f[_0xd05c('0x4d')]=[{'all':!![]}];}return db['ChatMessage'][_0xd05c('0x4e')](_0x56f26f);})['then'](function(_0x5c523e){_0x569432[_0xd05c('0x4f')]=_0x5c523e;return _0x569432;})[_0xd05c('0x20')](respondWithFilteredResult(_0x1c4b85,_0x56f26f))[_0xd05c('0x27')](handleError(_0x1c4b85,null));};exports['show']=function(_0x162b20,_0x2bb870){var _0x27add4={'raw':!![],'where':{'id':_0x162b20['params']['id']}},_0x5c8cb2={};_0x5c8cb2[_0xd05c('0x3a')]=_['keys'](db[_0xd05c('0x4b')][_0xd05c('0x37')]);_0x5c8cb2[_0xd05c('0x3b')]=_[_0xd05c('0x3c')](_0x162b20[_0xd05c('0x3b')]);_0x5c8cb2['filters']=_[_0xd05c('0x3e')](_0x5c8cb2[_0xd05c('0x3a')],_0x5c8cb2[_0xd05c('0x3b')]);_0x27add4[_0xd05c('0x3f')]=_[_0xd05c('0x3e')](_0x5c8cb2[_0xd05c('0x3a')],qs[_0xd05c('0x40')](_0x162b20['query'][_0xd05c('0x40')]));_0x27add4[_0xd05c('0x3f')]=_0x27add4[_0xd05c('0x3f')][_0xd05c('0x41')]?_0x27add4[_0xd05c('0x3f')]:_0x5c8cb2['model'];if(_0x162b20[_0xd05c('0x3b')][_0xd05c('0x4c')]){_0x27add4[_0xd05c('0x4d')]=[{'all':!![]}];}_0x27add4=_[_0xd05c('0x48')]({},_0x27add4,_0x162b20[_0xd05c('0x4a')]);return db[_0xd05c('0x4b')][_0xd05c('0x50')](_0x27add4)['then'](handleEntityNotFound(_0x2bb870,null))[_0xd05c('0x20')](respondWithResult(_0x2bb870,null))['catch'](handleError(_0x2bb870,null));};exports[_0xd05c('0x51')]=function(_0x4a2702,_0x399956){return db[_0xd05c('0x4b')][_0xd05c('0x51')](_0x4a2702[_0xd05c('0x52')],{})[_0xd05c('0x20')](respondWithResult(_0x399956,0xc9))[_0xd05c('0x27')](handleError(_0x399956,null));};exports[_0xd05c('0x53')]=function(_0x45b50c,_0x77916d){if(_0x45b50c[_0xd05c('0x52')]['id']){delete _0x45b50c['body']['id'];}return db['ChatMessage'][_0xd05c('0x50')]({'where':{'id':_0x45b50c['params']['id']}})['then'](handleEntityNotFound(_0x77916d,null))[_0xd05c('0x20')](saveUpdates(_0x45b50c[_0xd05c('0x52')],null))[_0xd05c('0x20')](respondWithResult(_0x77916d,null))[_0xd05c('0x27')](handleError(_0x77916d,null));};exports['destroy']=function(_0x325983,_0x419da7){return db[_0xd05c('0x4b')][_0xd05c('0x50')]({'where':{'id':_0x325983[_0xd05c('0x54')]['id']}})[_0xd05c('0x20')](handleEntityNotFound(_0x419da7,null))[_0xd05c('0x20')](removeEntity(_0x419da7,null))[_0xd05c('0x27')](handleError(_0x419da7,null));};exports[_0xd05c('0x55')]=function(_0x28b175,_0x537339){return db['ChatMessage'][_0xd05c('0x55')]()['then'](respondWithResult(_0x537339,null))['catch'](handleError(_0x537339,null));};var interaction_log=require(_0xd05c('0x56'))(_0xd05c('0x57'));exports[_0xd05c('0x58')]=function(_0x542ed4,_0x5cd5e0,_0x37bcc7){var _0x24e7c3={'agent':{},'channel':_0xd05c('0x59')};if(_0x542ed4['body']['id']){delete _0x542ed4[_0xd05c('0x52')]['id'];}_0x542ed4[_0xd05c('0x52')]['read']=!![];_0x542ed4[_0xd05c('0x52')][_0xd05c('0x5a')]=moment()[_0xd05c('0x5b')](_0xd05c('0x5c'));_0x542ed4['body'][_0xd05c('0x5d')]=_0x542ed4[_0xd05c('0x52')][_0xd05c('0x5d')]||_0x542ed4['user']['id'];_0x24e7c3['agent']['id']=_0x542ed4['body']['UserId'];return db[_0xd05c('0x4b')][_0xd05c('0x50')]({'where':{'id':_0x542ed4['params']['id'],'UserId':null}})[_0xd05c('0x20')](handleEntityNotFound(_0x5cd5e0,null))['then'](saveUpdates(_0x542ed4[_0xd05c('0x52')],null))[_0xd05c('0x20')](function(_0x1a50e5){if(_0x1a50e5){_0x24e7c3[_0xd05c('0x26')]=_0x1a50e5['get']({'plain':!![]});return db['ChatInteraction'][_0xd05c('0x50')]({'where':{'id':_0x1a50e5[_0xd05c('0x5e')]}});}return null;})[_0xd05c('0x20')](handleEntityNotFound(_0x5cd5e0,null))['then'](function(_0x59c217){if(_0x59c217){return _0x59c217[_0xd05c('0x53')]({'UserId':_0x542ed4['body'][_0xd05c('0x5d')],'read1stAt':_['isNil'](_0x59c217[_0xd05c('0x5f')])?moment()[_0xd05c('0x5b')](_0xd05c('0x5c')):undefined});}return null;})[_0xd05c('0x20')](function(_0x11f0ac){if(_0x11f0ac){_0x24e7c3[_0xd05c('0x60')]=_0x11f0ac[_0xd05c('0x61')]({'plain':!![]});interaction_log[_0xd05c('0x21')](_0xd05c('0x62'),_0x542ed4[_0xd05c('0x63')]['id'],_0x542ed4[_0xd05c('0x63')]['name'],_0x542ed4[_0xd05c('0x63')][_0xd05c('0x64')],_0x24e7c3[_0xd05c('0x60')]['id'],_0x542ed4['body']?JSON['stringify'](_0x542ed4['body']):'null');return respondWithRpcPromise(_0xd05c('0x65'),_0xd05c('0x66'),_0x24e7c3);}return null;})[_0xd05c('0x20')](function(_0x50bdc1){var _0x2d9e54=_0xd05c('0x67')+_0x50bdc1['message'][_0xd05c('0x68')];return db[_0xd05c('0x69')][_0xd05c('0x3b')](_0x2d9e54,{'type':db[_0xd05c('0x6a')]['QueryTypes']['SELECT'],'raw':!![]})[_0xd05c('0x20')](function(_0x22cd55){return _0x22cd55;});})[_0xd05c('0x20')](function(_0x34655c){if(_0x34655c){_0x24e7c3[_0xd05c('0x26')][_0xd05c('0x6b')]=_0x34655c[0x0];if(!_0x542ed4['body'][_0xd05c('0x5d')])return;return db[_0xd05c('0x6c')][_0xd05c('0x50')]({'where':{'id':_0x542ed4[_0xd05c('0x52')]['UserId'],'role':_0xd05c('0x6d')},'attributes':['id',_0xd05c('0x34'),_0xd05c('0x6e'),_0xd05c('0x6f'),_0xd05c('0x70')],'raw':!![]});}return null;})['then'](function(_0xca753a){if(!_0xca753a)return null;_0x24e7c3['message'][_0xd05c('0x6d')]=_0xca753a;return _0x24e7c3;})['then'](function(_0x1e23e5){if(_0x1e23e5){if(_0x542ed4[_0xd05c('0x52')]['manual']){_0x24e7c3[_0xd05c('0x26')]['interface']=util[_0xd05c('0x5b')](_0xd05c('0x71'),_0x542ed4['user'][_0xd05c('0x34')]);_0x24e7c3['message'][_0xd05c('0x72')]=_0x24e7c3['channel'];_0x24e7c3[_0xd05c('0x26')][_0xd05c('0x73')]=_0x24e7c3[_0xd05c('0x72')];_0x24e7c3[_0xd05c('0x26')]['event']=_0xd05c('0x58');return respondWithRpcPromise('EventManager',_0xd05c('0x74'),{'event':_0xd05c('0x75'),'message':_[_0xd05c('0x48')](_0x24e7c3[_0xd05c('0x26')],JSON[_0xd05c('0x76')](_0x24e7c3['interaction'][_0xd05c('0x77')]))},client9002)[_0xd05c('0x20')](function(){return _0x24e7c3;});}return _0x24e7c3;}return null;})[_0xd05c('0x20')](respondWithResult(_0x5cd5e0,null))[_0xd05c('0x27')](handleError(_0x5cd5e0,null));};var interaction_log=require(_0xd05c('0x56'))(_0xd05c('0x57'));exports['reject']=function(_0x3e2815,_0x56d64b,_0x56f12c){var _0x2d6041={'agent':{},'channel':_0xd05c('0x59')};if(_0x3e2815['body']['id']){delete _0x3e2815['body']['id'];}_0x3e2815[_0xd05c('0x52')][_0xd05c('0x5d')]=_0x3e2815[_0xd05c('0x52')][_0xd05c('0x5d')]||_0x3e2815[_0xd05c('0x63')]['id'];_0x2d6041[_0xd05c('0x6d')]['id']=_0x3e2815[_0xd05c('0x52')][_0xd05c('0x5d')];return db[_0xd05c('0x4b')][_0xd05c('0x50')]({'where':{'id':_0x3e2815['params']['id'],'UserId':null}})[_0xd05c('0x20')](handleEntityNotFound(_0x56d64b,null))['then'](function(_0x3661de){if(_0x3661de){_0x2d6041['message']=_0x3661de[_0xd05c('0x61')]({'plain':!![]});return db[_0xd05c('0x78')][_0xd05c('0x50')]({'where':{'id':_0x3661de[_0xd05c('0x5e')]}});}return null;})['then'](handleEntityNotFound(_0x56d64b,null))[_0xd05c('0x20')](function(_0x1c7791){if(_0x1c7791){_0x2d6041[_0xd05c('0x60')]=_0x1c7791[_0xd05c('0x61')]({'plain':!![]});interaction_log[_0xd05c('0x21')](_0xd05c('0x79'),_0x3e2815[_0xd05c('0x63')]['id'],_0x3e2815[_0xd05c('0x63')][_0xd05c('0x34')],_0x3e2815['user'][_0xd05c('0x64')],_0x2d6041[_0xd05c('0x60')]['id'],_0x3e2815[_0xd05c('0x52')]?JSON[_0xd05c('0x7a')](_0x3e2815[_0xd05c('0x52')]):_0xd05c('0x7b'));return respondWithRpcPromise('RejectMessage',_0xd05c('0x7c'),_0x2d6041);}return null;})[_0xd05c('0x20')](function(_0x15a87a){var _0x530775=_0xd05c('0x67')+_0x15a87a[_0xd05c('0x26')][_0xd05c('0x68')];return db[_0xd05c('0x69')]['query'](_0x530775,{'type':db[_0xd05c('0x6a')][_0xd05c('0x7d')][_0xd05c('0x7e')],'raw':!![]})[_0xd05c('0x20')](function(_0x18387e){return _0x18387e;});})[_0xd05c('0x20')](function(_0x34b001){if(_0x34b001){_0x2d6041[_0xd05c('0x26')][_0xd05c('0x6b')]=_0x34b001[0x0];if(!_0x3e2815['body'][_0xd05c('0x5d')])return;return db['User'][_0xd05c('0x50')]({'where':{'id':_0x3e2815[_0xd05c('0x52')][_0xd05c('0x5d')],'role':_0xd05c('0x6d')},'attributes':['id','name',_0xd05c('0x6e'),'email',_0xd05c('0x70')],'raw':!![]});}return null;})[_0xd05c('0x20')](function(_0x2dbbba){if(!_0x2dbbba)return null;_0x2d6041[_0xd05c('0x26')]['agent']=_0x2dbbba;return _0x2d6041;})['then'](function(_0x250598){if(_0x250598){_0x250598[_0xd05c('0x26')][_0xd05c('0x7f')]=util[_0xd05c('0x5b')](_0xd05c('0x71'),_0x3e2815[_0xd05c('0x63')][_0xd05c('0x34')]);_0x250598[_0xd05c('0x26')][_0xd05c('0x72')]=_0x2d6041[_0xd05c('0x72')];_0x250598[_0xd05c('0x26')]['motionChannel']=_0x2d6041['channel'];_0x250598[_0xd05c('0x26')]['event']=_0xd05c('0x30');respondWithRpcPromise(_0xd05c('0x74'),_0xd05c('0x74'),{'event':_0xd05c('0x80'),'message':_[_0xd05c('0x48')](_0x2d6041['message'],JSON[_0xd05c('0x76')](_0x2d6041['interaction'][_0xd05c('0x77')]))},client9002);return _0x2d6041;}return null;})[_0xd05c('0x20')](respondWithResult(_0x56d64b,null))[_0xd05c('0x27')](handleError(_0x56d64b,null));};
\ No newline at end of file
+var _0xfdb4=['include','findAll','rows','show','params','keys','includeAll','catch','create','body','find','destroy','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','chat-interactions','role','null','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','event','rejectmessage','parse','formData','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatMessage,\x20%s,\x20%s','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','stack','name','send','index','map','ChatMessage','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0xfdb4,0x14f));var _0x4fdb=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xfdb4[_0x4fde08];return _0x12e725;};'use strict';var emlformat=require(_0x4fdb('0x0'));var rimraf=require(_0x4fdb('0x1'));var zipdir=require(_0x4fdb('0x2'));var jsonpatch=require(_0x4fdb('0x3'));var rp=require('request-promise');var moment=require(_0x4fdb('0x4'));var BPromise=require(_0x4fdb('0x5'));var Mustache=require(_0x4fdb('0x6'));var util=require('util');var path=require(_0x4fdb('0x7'));var sox=require(_0x4fdb('0x8'));var csv=require('to-csv');var ejs=require(_0x4fdb('0x9'));var fs=require('fs');var fs_extra=require(_0x4fdb('0xa'));var _=require(_0x4fdb('0xb'));var squel=require(_0x4fdb('0xc'));var crypto=require(_0x4fdb('0xd'));var jsforce=require(_0x4fdb('0xe'));var deskjs=require(_0x4fdb('0xf'));var toCsv=require(_0x4fdb('0x10'));var querystring=require(_0x4fdb('0x11'));var Papa=require(_0x4fdb('0x12'));var Redis=require(_0x4fdb('0x13'));var authService=require(_0x4fdb('0x14'));var qs=require(_0x4fdb('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4fdb('0x16'));var logger=require(_0x4fdb('0x17'))('api');var utils=require(_0x4fdb('0x18'));var config=require(_0x4fdb('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x4fdb('0x1a'))['db'];config[_0x4fdb('0x1b')]=_[_0x4fdb('0x1c')](config[_0x4fdb('0x1b')],{'host':_0x4fdb('0x1d'),'port':0x18eb});var socket=require(_0x4fdb('0x1e'))(new Redis(config[_0x4fdb('0x1b')]));require(_0x4fdb('0x1f'))[_0x4fdb('0x20')](socket);var jayson=require(_0x4fdb('0x21'));var client=jayson[_0x4fdb('0x22')][_0x4fdb('0x23')]({'port':0x232c});var client9002=jayson['client'][_0x4fdb('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x3094da,_0x3df724,_0x2c35cb,_0x879d8d){return new BPromise(function(_0x5061d9,_0x22a95f){var _0x576991=_0x879d8d||client;return _0x576991[_0x4fdb('0x24')](_0x3094da,_0x2c35cb)[_0x4fdb('0x25')](function(_0x1fcd0c){logger[_0x4fdb('0x26')]('ChatMessage,\x20%s,\x20%s',_0x3df724,_0x4fdb('0x27'));logger[_0x4fdb('0x28')](_0x4fdb('0x29'),_0x3df724,_0x4fdb('0x27'),JSON[_0x4fdb('0x2a')](_0x1fcd0c));if(_0x1fcd0c[_0x4fdb('0x2b')]){if(_0x1fcd0c[_0x4fdb('0x2b')]['code']===0x1f4){logger[_0x4fdb('0x2b')]('ChatMessage,\x20%s,\x20%s',_0x3df724,_0x1fcd0c['error'][_0x4fdb('0x2c')]);return _0x22a95f(_0x1fcd0c['error']['message']);}logger[_0x4fdb('0x2b')]('ChatMessage,\x20%s,\x20%s',_0x3df724,_0x1fcd0c[_0x4fdb('0x2b')]['message']);return _0x5061d9(_0x1fcd0c[_0x4fdb('0x2b')][_0x4fdb('0x2c')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x3df724,_0x4fdb('0x27'));_0x5061d9(_0x1fcd0c['result'][_0x4fdb('0x2c')]);}})['catch'](function(_0xaf8252){logger[_0x4fdb('0x2b')](_0x4fdb('0x2d'),_0x3df724,_0xaf8252);_0x22a95f(_0xaf8252);});});}function respondWithStatusCode(_0x129201,_0x344a17){_0x344a17=_0x344a17||0xcc;return function(_0x37f881){if(_0x37f881){return _0x129201[_0x4fdb('0x2e')](_0x344a17);}return _0x129201['status'](_0x344a17)[_0x4fdb('0x2f')]();};}function respondWithResult(_0x1f00b8,_0x1dac64){_0x1dac64=_0x1dac64||0xc8;return function(_0x1f31dc){if(_0x1f31dc){return _0x1f00b8['status'](_0x1dac64)[_0x4fdb('0x30')](_0x1f31dc);}};}function respondWithFilteredResult(_0x1943d2,_0x4f106e){return function(_0x471ed2){if(_0x471ed2){var _0x50a285=typeof _0x4f106e[_0x4fdb('0x31')]===_0x4fdb('0x32')&&typeof _0x4f106e['limit']==='undefined';var _0x44fc09=_0x471ed2[_0x4fdb('0x33')];var _0x43f0b6=_0x50a285?0x0:_0x4f106e['offset'];var _0xf192e9=_0x50a285?_0x471ed2[_0x4fdb('0x33')]:_0x4f106e[_0x4fdb('0x31')]+_0x4f106e[_0x4fdb('0x34')];var _0xc035e4;if(_0xf192e9>=_0x44fc09){_0xf192e9=_0x44fc09;_0xc035e4=0xc8;}else{_0xc035e4=0xce;}_0x1943d2[_0x4fdb('0x35')](_0xc035e4);return _0x1943d2[_0x4fdb('0x36')](_0x4fdb('0x37'),_0x43f0b6+'-'+_0xf192e9+'/'+_0x44fc09)[_0x4fdb('0x30')](_0x471ed2);}return null;};}function patchUpdates(_0x4becd7){return function(_0x5d4ba4){try{jsonpatch[_0x4fdb('0x38')](_0x5d4ba4,_0x4becd7,!![]);}catch(_0x557408){return BPromise[_0x4fdb('0x39')](_0x557408);}return _0x5d4ba4[_0x4fdb('0x3a')]();};}function saveUpdates(_0x47f9a1,_0x6095a2){return function(_0x3940e2){if(_0x3940e2){return _0x3940e2[_0x4fdb('0x3b')](_0x47f9a1)[_0x4fdb('0x25')](function(_0x1852ba){return _0x1852ba;});}return null;};}function removeEntity(_0x550924,_0x351da2){return function(_0x187478){if(_0x187478){return _0x187478['destroy']()[_0x4fdb('0x25')](function(){_0x550924[_0x4fdb('0x35')](0xcc)[_0x4fdb('0x2f')]();});}};}function handleEntityNotFound(_0x347846,_0x16d5b0){return function(_0xc59042){if(!_0xc59042){_0x347846[_0x4fdb('0x2e')](0x194);}return _0xc59042;};}function handleError(_0x1d1aee,_0x8d1dd8){_0x8d1dd8=_0x8d1dd8||0x1f4;return function(_0x606e7a){logger[_0x4fdb('0x2b')](_0x606e7a[_0x4fdb('0x3c')]);if(_0x606e7a[_0x4fdb('0x3d')]){delete _0x606e7a['name'];}_0x1d1aee['status'](_0x8d1dd8)[_0x4fdb('0x3e')](_0x606e7a);};}exports[_0x4fdb('0x3f')]=function(_0x45a13d,_0x1db2e9){var _0x392a9c={},_0x117632={},_0x405567={'count':0x0,'rows':[]};var _0x3695dc=_[_0x4fdb('0x40')](db[_0x4fdb('0x41')][_0x4fdb('0x42')],function(_0x46e610){return{'name':_0x46e610['fieldName'],'type':_0x46e610[_0x4fdb('0x43')]['key']};});_0x117632[_0x4fdb('0x44')]=_[_0x4fdb('0x40')](_0x3695dc,_0x4fdb('0x3d'));_0x117632['query']=_['keys'](_0x45a13d[_0x4fdb('0x45')]);_0x117632[_0x4fdb('0x46')]=_[_0x4fdb('0x47')](_0x117632[_0x4fdb('0x44')],_0x117632[_0x4fdb('0x45')]);_0x392a9c[_0x4fdb('0x48')]=_['intersection'](_0x117632[_0x4fdb('0x44')],qs[_0x4fdb('0x49')](_0x45a13d['query'][_0x4fdb('0x49')]));_0x392a9c[_0x4fdb('0x48')]=_0x392a9c[_0x4fdb('0x48')][_0x4fdb('0x4a')]?_0x392a9c[_0x4fdb('0x48')]:_0x117632[_0x4fdb('0x44')];if(!_0x45a13d[_0x4fdb('0x45')][_0x4fdb('0x4b')](_0x4fdb('0x4c'))){_0x392a9c[_0x4fdb('0x34')]=qs[_0x4fdb('0x34')](_0x45a13d[_0x4fdb('0x45')][_0x4fdb('0x34')]);_0x392a9c[_0x4fdb('0x31')]=qs[_0x4fdb('0x31')](_0x45a13d[_0x4fdb('0x45')][_0x4fdb('0x31')]);}_0x392a9c[_0x4fdb('0x4d')]=qs[_0x4fdb('0x4e')](_0x45a13d['query'][_0x4fdb('0x4e')]);_0x392a9c[_0x4fdb('0x4f')]=qs[_0x4fdb('0x46')](_[_0x4fdb('0x50')](_0x45a13d[_0x4fdb('0x45')],_0x117632[_0x4fdb('0x46')]),_0x3695dc);if(_0x45a13d[_0x4fdb('0x45')][_0x4fdb('0x51')]){_0x392a9c[_0x4fdb('0x4f')]=_[_0x4fdb('0x52')](_0x392a9c[_0x4fdb('0x4f')],{'$or':_[_0x4fdb('0x40')](_0x3695dc,function(_0x2e4731){if(_0x2e4731['type']!==_0x4fdb('0x53')){var _0x4630f9={};_0x4630f9[_0x2e4731['name']]={'$like':'%'+_0x45a13d[_0x4fdb('0x45')][_0x4fdb('0x51')]+'%'};return _0x4630f9;}})});}_0x392a9c=_[_0x4fdb('0x52')]({},_0x392a9c,_0x45a13d[_0x4fdb('0x54')]);var _0x5cc9ad={'where':_0x392a9c[_0x4fdb('0x4f')]};return db['ChatMessage'][_0x4fdb('0x33')](_0x5cc9ad)[_0x4fdb('0x25')](function(_0xdae31a){_0x405567['count']=_0xdae31a;if(_0x45a13d[_0x4fdb('0x45')]['includeAll']){_0x392a9c[_0x4fdb('0x55')]=[{'all':!![]}];}return db[_0x4fdb('0x41')][_0x4fdb('0x56')](_0x392a9c);})[_0x4fdb('0x25')](function(_0x3f21eb){_0x405567[_0x4fdb('0x57')]=_0x3f21eb;return _0x405567;})['then'](respondWithFilteredResult(_0x1db2e9,_0x392a9c))['catch'](handleError(_0x1db2e9,null));};exports[_0x4fdb('0x58')]=function(_0x49cf3d,_0x2f0061){var _0xc3f155={'raw':!![],'where':{'id':_0x49cf3d[_0x4fdb('0x59')]['id']}},_0x1be582={};_0x1be582[_0x4fdb('0x44')]=_[_0x4fdb('0x5a')](db[_0x4fdb('0x41')][_0x4fdb('0x42')]);_0x1be582[_0x4fdb('0x45')]=_[_0x4fdb('0x5a')](_0x49cf3d[_0x4fdb('0x45')]);_0x1be582[_0x4fdb('0x46')]=_[_0x4fdb('0x47')](_0x1be582[_0x4fdb('0x44')],_0x1be582[_0x4fdb('0x45')]);_0xc3f155['attributes']=_[_0x4fdb('0x47')](_0x1be582['model'],qs[_0x4fdb('0x49')](_0x49cf3d[_0x4fdb('0x45')][_0x4fdb('0x49')]));_0xc3f155[_0x4fdb('0x48')]=_0xc3f155['attributes']['length']?_0xc3f155[_0x4fdb('0x48')]:_0x1be582[_0x4fdb('0x44')];if(_0x49cf3d[_0x4fdb('0x45')][_0x4fdb('0x5b')]){_0xc3f155['include']=[{'all':!![]}];}_0xc3f155=_[_0x4fdb('0x52')]({},_0xc3f155,_0x49cf3d[_0x4fdb('0x54')]);return db[_0x4fdb('0x41')]['find'](_0xc3f155)['then'](handleEntityNotFound(_0x2f0061,null))[_0x4fdb('0x25')](respondWithResult(_0x2f0061,null))[_0x4fdb('0x5c')](handleError(_0x2f0061,null));};exports[_0x4fdb('0x5d')]=function(_0x5b783f,_0x21088e){return db[_0x4fdb('0x41')][_0x4fdb('0x5d')](_0x5b783f[_0x4fdb('0x5e')],{})[_0x4fdb('0x25')](respondWithResult(_0x21088e,0xc9))['catch'](handleError(_0x21088e,null));};exports[_0x4fdb('0x3b')]=function(_0x5ee5cc,_0x1d0dce){if(_0x5ee5cc[_0x4fdb('0x5e')]['id']){delete _0x5ee5cc[_0x4fdb('0x5e')]['id'];}return db[_0x4fdb('0x41')][_0x4fdb('0x5f')]({'where':{'id':_0x5ee5cc['params']['id']}})[_0x4fdb('0x25')](handleEntityNotFound(_0x1d0dce,null))[_0x4fdb('0x25')](saveUpdates(_0x5ee5cc[_0x4fdb('0x5e')],null))[_0x4fdb('0x25')](respondWithResult(_0x1d0dce,null))['catch'](handleError(_0x1d0dce,null));};exports[_0x4fdb('0x60')]=function(_0x4b8a31,_0x51ab16){return db[_0x4fdb('0x41')][_0x4fdb('0x5f')]({'where':{'id':_0x4b8a31['params']['id']}})[_0x4fdb('0x25')](handleEntityNotFound(_0x51ab16,null))['then'](removeEntity(_0x51ab16,null))[_0x4fdb('0x5c')](handleError(_0x51ab16,null));};exports[_0x4fdb('0x61')]=function(_0xf5e66,_0x1d21ba){return db[_0x4fdb('0x41')][_0x4fdb('0x61')]()[_0x4fdb('0x25')](respondWithResult(_0x1d21ba,null))[_0x4fdb('0x5c')](handleError(_0x1d21ba,null));};var interaction_log=require(_0x4fdb('0x17'))('chat-interactions');exports[_0x4fdb('0x62')]=function(_0x2b95cf,_0xa89b8c,_0x11be65){var _0x5bb2e6={'agent':{},'channel':'chat'};if(_0x2b95cf[_0x4fdb('0x5e')]['id']){delete _0x2b95cf[_0x4fdb('0x5e')]['id'];}_0x2b95cf[_0x4fdb('0x5e')][_0x4fdb('0x63')]=!![];_0x2b95cf[_0x4fdb('0x5e')][_0x4fdb('0x64')]=moment()[_0x4fdb('0x65')](_0x4fdb('0x66'));_0x2b95cf['body'][_0x4fdb('0x67')]=_0x2b95cf[_0x4fdb('0x5e')]['UserId']||_0x2b95cf[_0x4fdb('0x68')]['id'];_0x5bb2e6[_0x4fdb('0x69')]['id']=_0x2b95cf[_0x4fdb('0x5e')][_0x4fdb('0x67')];return db[_0x4fdb('0x41')][_0x4fdb('0x5f')]({'where':{'id':_0x2b95cf[_0x4fdb('0x59')]['id'],'UserId':null}})[_0x4fdb('0x25')](handleEntityNotFound(_0xa89b8c,null))['then'](saveUpdates(_0x2b95cf['body'],null))[_0x4fdb('0x25')](function(_0x352923){if(_0x352923){_0x5bb2e6['message']=_0x352923[_0x4fdb('0x6a')]({'plain':!![]});return db[_0x4fdb('0x6b')]['find']({'where':{'id':_0x352923[_0x4fdb('0x6c')]}});}return null;})[_0x4fdb('0x25')](handleEntityNotFound(_0xa89b8c,null))[_0x4fdb('0x25')](function(_0x65be3){if(_0x65be3){return _0x65be3[_0x4fdb('0x3b')]({'UserId':_0x2b95cf[_0x4fdb('0x5e')][_0x4fdb('0x67')],'read1stAt':_[_0x4fdb('0x6d')](_0x65be3[_0x4fdb('0x6e')])?moment()[_0x4fdb('0x65')](_0x4fdb('0x66')):undefined});}return null;})[_0x4fdb('0x25')](function(_0x46f2f2){if(_0x46f2f2){_0x5bb2e6[_0x4fdb('0x6f')]=_0x46f2f2['get']({'plain':!![]});interaction_log[_0x4fdb('0x26')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2b95cf['user']['id'],_0x2b95cf['user'][_0x4fdb('0x3d')],_0x2b95cf[_0x4fdb('0x68')]['role'],_0x5bb2e6[_0x4fdb('0x6f')]['id'],_0x2b95cf[_0x4fdb('0x5e')]?JSON[_0x4fdb('0x2a')](_0x2b95cf['body']):'null');return respondWithRpcPromise(_0x4fdb('0x70'),_0x4fdb('0x71'),_0x5bb2e6);}return null;})['then'](function(_0x4b6c2c){var _0x52506c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4b6c2c[_0x4fdb('0x2c')][_0x4fdb('0x72')];return db[_0x4fdb('0x73')][_0x4fdb('0x45')](_0x52506c,{'type':db[_0x4fdb('0x74')][_0x4fdb('0x75')][_0x4fdb('0x76')],'raw':!![]})[_0x4fdb('0x25')](function(_0x510a9b){return _0x510a9b;});})[_0x4fdb('0x25')](function(_0x7ed6e4){if(_0x7ed6e4){_0x5bb2e6['message'][_0x4fdb('0x77')]=_0x7ed6e4[0x0];if(!_0x2b95cf['body'][_0x4fdb('0x67')])return;return db[_0x4fdb('0x78')]['find']({'where':{'id':_0x2b95cf['body'][_0x4fdb('0x67')],'role':_0x4fdb('0x69')},'attributes':['id',_0x4fdb('0x3d'),_0x4fdb('0x79'),_0x4fdb('0x7a'),_0x4fdb('0x7b')],'raw':!![]});}return null;})[_0x4fdb('0x25')](function(_0x547fa){if(!_0x547fa)return null;_0x5bb2e6[_0x4fdb('0x2c')][_0x4fdb('0x69')]=_0x547fa;return _0x5bb2e6;})[_0x4fdb('0x25')](function(_0x3b83c6){if(_0x3b83c6){if(_0x2b95cf[_0x4fdb('0x5e')][_0x4fdb('0x7c')]){_0x5bb2e6[_0x4fdb('0x2c')][_0x4fdb('0x7d')]=util[_0x4fdb('0x65')](_0x4fdb('0x7e'),_0x2b95cf[_0x4fdb('0x68')][_0x4fdb('0x3d')]);_0x5bb2e6[_0x4fdb('0x2c')][_0x4fdb('0x7f')]=_0x5bb2e6['channel'];_0x5bb2e6[_0x4fdb('0x2c')][_0x4fdb('0x80')]=_0x5bb2e6[_0x4fdb('0x7f')];_0x5bb2e6[_0x4fdb('0x2c')]['event']=_0x4fdb('0x62');return respondWithRpcPromise(_0x4fdb('0x81'),_0x4fdb('0x81'),{'event':_0x4fdb('0x82'),'message':_[_0x4fdb('0x52')](_0x5bb2e6['message'],JSON['parse'](_0x5bb2e6[_0x4fdb('0x6f')]['formData']))},client9002)[_0x4fdb('0x25')](function(){return _0x5bb2e6;});}return _0x5bb2e6;}return null;})[_0x4fdb('0x25')](respondWithResult(_0xa89b8c,null))[_0x4fdb('0x5c')](handleError(_0xa89b8c,null));};var interaction_log=require(_0x4fdb('0x17'))(_0x4fdb('0x83'));exports[_0x4fdb('0x39')]=function(_0x14884b,_0x1ebaf0,_0x2935a7){var _0x50a62a={'agent':{},'channel':'chat'};if(_0x14884b[_0x4fdb('0x5e')]['id']){delete _0x14884b[_0x4fdb('0x5e')]['id'];}_0x14884b[_0x4fdb('0x5e')]['UserId']=_0x14884b[_0x4fdb('0x5e')][_0x4fdb('0x67')]||_0x14884b['user']['id'];_0x50a62a[_0x4fdb('0x69')]['id']=_0x14884b[_0x4fdb('0x5e')][_0x4fdb('0x67')];return db['ChatMessage'][_0x4fdb('0x5f')]({'where':{'id':_0x14884b[_0x4fdb('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1ebaf0,null))[_0x4fdb('0x25')](function(_0x576afe){if(_0x576afe){_0x50a62a['message']=_0x576afe[_0x4fdb('0x6a')]({'plain':!![]});return db[_0x4fdb('0x6b')][_0x4fdb('0x5f')]({'where':{'id':_0x576afe[_0x4fdb('0x6c')]}});}return null;})[_0x4fdb('0x25')](handleEntityNotFound(_0x1ebaf0,null))['then'](function(_0x5e021d){if(_0x5e021d){_0x50a62a[_0x4fdb('0x6f')]=_0x5e021d[_0x4fdb('0x6a')]({'plain':!![]});interaction_log[_0x4fdb('0x26')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x14884b[_0x4fdb('0x68')]['id'],_0x14884b[_0x4fdb('0x68')][_0x4fdb('0x3d')],_0x14884b[_0x4fdb('0x68')][_0x4fdb('0x84')],_0x50a62a['interaction']['id'],_0x14884b[_0x4fdb('0x5e')]?JSON['stringify'](_0x14884b[_0x4fdb('0x5e')]):_0x4fdb('0x85'));return respondWithRpcPromise('RejectMessage',_0x4fdb('0x86'),_0x50a62a);}return null;})[_0x4fdb('0x25')](function(_0x58856d){var _0x4e3946=_0x4fdb('0x87')+_0x58856d[_0x4fdb('0x2c')][_0x4fdb('0x72')];return db[_0x4fdb('0x73')]['query'](_0x4e3946,{'type':db[_0x4fdb('0x74')][_0x4fdb('0x75')][_0x4fdb('0x76')],'raw':!![]})[_0x4fdb('0x25')](function(_0x1f43d5){return _0x1f43d5;});})[_0x4fdb('0x25')](function(_0x53ece0){if(_0x53ece0){_0x50a62a['message'][_0x4fdb('0x77')]=_0x53ece0[0x0];if(!_0x14884b[_0x4fdb('0x5e')][_0x4fdb('0x67')])return;return db[_0x4fdb('0x78')][_0x4fdb('0x5f')]({'where':{'id':_0x14884b[_0x4fdb('0x5e')]['UserId'],'role':'agent'},'attributes':['id',_0x4fdb('0x3d'),_0x4fdb('0x79'),'email',_0x4fdb('0x7b')],'raw':!![]});}return null;})[_0x4fdb('0x25')](function(_0x458a59){if(!_0x458a59)return null;_0x50a62a[_0x4fdb('0x2c')]['agent']=_0x458a59;return _0x50a62a;})[_0x4fdb('0x25')](function(_0x38cf0d){if(_0x38cf0d){_0x38cf0d['message'][_0x4fdb('0x7d')]=util[_0x4fdb('0x65')](_0x4fdb('0x7e'),_0x14884b[_0x4fdb('0x68')][_0x4fdb('0x3d')]);_0x38cf0d['message'][_0x4fdb('0x7f')]=_0x50a62a[_0x4fdb('0x7f')];_0x38cf0d[_0x4fdb('0x2c')][_0x4fdb('0x80')]=_0x50a62a[_0x4fdb('0x7f')];_0x38cf0d['message'][_0x4fdb('0x88')]='reject';respondWithRpcPromise(_0x4fdb('0x81'),_0x4fdb('0x81'),{'event':_0x4fdb('0x89'),'message':_[_0x4fdb('0x52')](_0x50a62a[_0x4fdb('0x2c')],JSON[_0x4fdb('0x8a')](_0x50a62a['interaction'][_0x4fdb('0x8b')]))},client9002);return _0x50a62a;}return null;})[_0x4fdb('0x25')](respondWithResult(_0x1ebaf0,null))[_0x4fdb('0x5c')](handleError(_0x1ebaf0,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 0997b4e..56ccb51 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 _0x780b=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','emit'];(function(_0xd5307f,_0x4d1fe9){var _0x39d3d4=function(_0x40c4e1){while(--_0x40c4e1){_0xd5307f['push'](_0xd5307f['shift']());}};_0x39d3d4(++_0x4d1fe9);}(_0x780b,0xa3));var _0xb780=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x780b[_0x297fd3];return _0x2af381;};'use strict';var EventEmitter=require(_0xb780('0x0'));var ChatMessage=require(_0xb780('0x1'))['db'][_0xb780('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xb780('0x3')](0x0);var events={'afterCreate':_0xb780('0x4'),'afterUpdate':_0xb780('0x5'),'afterDestroy':'remove'};function emitEvent(_0x25a884){return function(_0x15e882,_0x412b4d,_0x418bc1){ChatMessageEvents[_0xb780('0x6')](_0x25a884+':'+_0x15e882['id'],_0x15e882);ChatMessageEvents[_0xb780('0x6')](_0x25a884,_0x15e882);_0x418bc1(null);};}for(var e in events){if(events[_0xb780('0x7')](e)){var event=events[e];ChatMessage[_0xb780('0x8')](e,emitEvent(event));}}module[_0xb780('0x9')]=ChatMessageEvents;
\ No newline at end of file
+var _0x5382=['ChatMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x26ee9a,_0x1917d7){var _0x1e8a0f=function(_0x472cbf){while(--_0x472cbf){_0x26ee9a['push'](_0x26ee9a['shift']());}};_0x1e8a0f(++_0x1917d7);}(_0x5382,0x76));var _0x2538=function(_0x5adf7a,_0x3cc807){_0x5adf7a=_0x5adf7a-0x0;var _0x32b5be=_0x5382[_0x5adf7a];return _0x32b5be;};'use strict';var EventEmitter=require(_0x2538('0x0'));var ChatMessage=require(_0x2538('0x1'))['db'][_0x2538('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x2538('0x3')](0x0);var events={'afterCreate':_0x2538('0x4'),'afterUpdate':_0x2538('0x5'),'afterDestroy':'remove'};function emitEvent(_0x549e80){return function(_0x42bbb0,_0x124140,_0x57745b){ChatMessageEvents[_0x2538('0x6')](_0x549e80+':'+_0x42bbb0['id'],_0x42bbb0);ChatMessageEvents[_0x2538('0x6')](_0x549e80,_0x42bbb0);_0x57745b(null);};}for(var e in events){if(events[_0x2538('0x7')](e)){var event=events[e];ChatMessage[_0x2538('0x8')](e,emitEvent(event));}}module[_0x2538('0x9')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 42da59c..6831076 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 _0x8f1d=['define','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','out','secret','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','toLowerCase','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','exports'];(function(_0x876194,_0x2d77c2){var _0x5dd914=function(_0x681caa){while(--_0x681caa){_0x876194['push'](_0x876194['shift']());}};_0x5dd914(++_0x2d77c2);}(_0x8f1d,0x72));var _0xd8f1=function(_0x477491,_0x5ca700){_0x477491=_0x477491-0x0;var _0xac6aec=_0x8f1d[_0x477491];return _0xac6aec;};'use strict';var _=require(_0xd8f1('0x0'));var util=require(_0xd8f1('0x1'));var logger=require('../../config/logger')(_0xd8f1('0x2'));var moment=require(_0xd8f1('0x3'));var BPromise=require(_0xd8f1('0x4'));var rp=require(_0xd8f1('0x5'));var fs=require('fs');var path=require(_0xd8f1('0x6'));var rimraf=require('rimraf');var config=require(_0xd8f1('0x7'));var attributes=require(_0xd8f1('0x8'));module[_0xd8f1('0x9')]=function(_0x103610,_0x5ef96f){return _0x103610[_0xd8f1('0xa')](_0xd8f1('0xb'),attributes,{'tableName':_0xd8f1('0xc'),'paranoid':![],'indexes':[{'name':_0xd8f1('0xd'),'fields':[_0xd8f1('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x29db48,_0x2e88e9,_0x2c423e){var _0xfa16f5=_0x103610[_0xd8f1('0xf')];var _0x53c6b6=_0x29db48[_0xd8f1('0x10')]({'plain':!![]});if(_0x53c6b6[_0xd8f1('0x11')]['toLowerCase']()==='in'||_0x53c6b6[_0xd8f1('0x11')]['toLowerCase']()===_0xd8f1('0x12')&&!_0x53c6b6[_0xd8f1('0x13')]&&!_['isNil'](_0x53c6b6[_0xd8f1('0x14')])){_0xfa16f5[_0xd8f1('0x15')][_0xd8f1('0x16')]({'where':{'id':_0x53c6b6[_0xd8f1('0x17')]}})[_0xd8f1('0x18')](function(_0x269e57){if(_0x269e57){_0x269e57[_0xd8f1('0x19')]({'lastMsgAt':_0x53c6b6[_0xd8f1('0x1a')],'lastMsgDirection':_0x53c6b6['direction'][_0xd8f1('0x1b')]()});}})[_0xd8f1('0x1c')](function(_0xc6828c){console['error'](_0xc6828c);});}_0x2c423e();}},'charset':_0xd8f1('0x1d'),'collate':_0xd8f1('0x1e')});};
\ No newline at end of file
+var _0x765e=['secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','chat_messages','fti_chat_messages','body','FULLTEXT','direction','toLowerCase','out'];(function(_0x152341,_0x8f0c56){var _0x440e1b=function(_0x33918f){while(--_0x33918f){_0x152341['push'](_0x152341['shift']());}};_0x440e1b(++_0x8f0c56);}(_0x765e,0x1bf));var _0xe765=function(_0x3ef029,_0x302589){_0x3ef029=_0x3ef029-0x0;var _0x1147b8=_0x765e[_0x3ef029];return _0x1147b8;};'use strict';var _=require(_0xe765('0x0'));var util=require(_0xe765('0x1'));var logger=require(_0xe765('0x2'))(_0xe765('0x3'));var moment=require(_0xe765('0x4'));var BPromise=require(_0xe765('0x5'));var rp=require(_0xe765('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe765('0x7'));var config=require(_0xe765('0x8'));var attributes=require('./chatMessage.attributes');module[_0xe765('0x9')]=function(_0x1ae7a2,_0x3ff2f5){return _0x1ae7a2[_0xe765('0xa')]('ChatMessage',attributes,{'tableName':_0xe765('0xb'),'paranoid':![],'indexes':[{'name':_0xe765('0xc'),'fields':[_0xe765('0xd')],'type':_0xe765('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4459ab,_0x224b0f,_0x540379){var _0x59f097=_0x1ae7a2['models'];var _0x11fb96=_0x4459ab['get']({'plain':!![]});if(_0x11fb96[_0xe765('0xf')][_0xe765('0x10')]()==='in'||_0x11fb96[_0xe765('0xf')][_0xe765('0x10')]()===_0xe765('0x11')&&!_0x11fb96[_0xe765('0x12')]&&!_[_0xe765('0x13')](_0x11fb96[_0xe765('0x14')])){_0x59f097[_0xe765('0x15')][_0xe765('0x16')]({'where':{'id':_0x11fb96[_0xe765('0x17')]}})[_0xe765('0x18')](function(_0x235270){if(_0x235270){_0x235270[_0xe765('0x19')]({'lastMsgAt':_0x11fb96[_0xe765('0x1a')],'lastMsgDirection':_0x11fb96['direction'][_0xe765('0x10')]()});}})[_0xe765('0x1b')](function(_0x1cd5dc){console[_0xe765('0x1c')](_0x1cd5dc);});}_0x540379();}},'charset':_0xe765('0x1d'),'collate':_0xe765('0x1e')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 6dc1aec..a3cf292 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 _0x9834=['ChatMessage,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateChatMessage','create','body','options','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','socket.io-emitter','register','request','then'];(function(_0xe72e2a,_0x3d600f){var _0x1ee37e=function(_0x27c473){while(--_0x27c473){_0xe72e2a['push'](_0xe72e2a['shift']());}};_0x1ee37e(++_0x3d600f);}(_0x9834,0xd1));var _0x4983=function(_0xe057df,_0x49c828){_0xe057df=_0xe057df-0x0;var _0x518ae4=_0x9834[_0xe057df];return _0x518ae4;};'use strict';var _=require(_0x4983('0x0'));var util=require(_0x4983('0x1'));var moment=require(_0x4983('0x2'));var BPromise=require('bluebird');var rs=require(_0x4983('0x3'));var fs=require('fs');var Redis=require(_0x4983('0x4'));var db=require(_0x4983('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4983('0x6'));var config=require('../../config/environment');var jayson=require(_0x4983('0x7'));var client=jayson[_0x4983('0x8')][_0x4983('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4983('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4983('0xb'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x4983('0xc')](socket);function respondWithRpcPromise(_0x1f1adf,_0x215037,_0x2b379a){return new BPromise(function(_0xbcb969,_0x2ad925){return client[_0x4983('0xd')](_0x1f1adf,_0x2b379a)[_0x4983('0xe')](function(_0x507ea2){logger['info'](_0x4983('0xf'),_0x215037,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x215037,'request\x20sent',JSON[_0x4983('0x10')](_0x507ea2));if(_0x507ea2[_0x4983('0x11')]){if(_0x507ea2[_0x4983('0x11')][_0x4983('0x12')]===0x1f4){logger[_0x4983('0x11')]('ChatMessage,\x20%s,\x20%s',_0x215037,_0x507ea2['error'][_0x4983('0x13')]);return _0x2ad925(_0x507ea2[_0x4983('0x11')][_0x4983('0x13')]);}logger[_0x4983('0x11')](_0x4983('0xf'),_0x215037,_0x507ea2[_0x4983('0x11')][_0x4983('0x13')]);return _0xbcb969(_0x507ea2[_0x4983('0x11')][_0x4983('0x13')]);}else{logger[_0x4983('0x14')](_0x4983('0xf'),_0x215037,'request\x20sent');_0xbcb969(_0x507ea2[_0x4983('0x15')]['message']);}})[_0x4983('0x16')](function(_0x498d7c){logger['error']('ChatMessage,\x20%s,\x20%s',_0x215037,_0x498d7c);_0x2ad925(_0x498d7c);});});}exports[_0x4983('0x17')]=function(_0x5e6f12){var _0x55aff3=this;return new Promise(function(_0x4f3195,_0x129edc){return db['ChatMessage'][_0x4983('0x18')](_0x5e6f12[_0x4983('0x19')],{'raw':_0x5e6f12[_0x4983('0x1a')]?_0x5e6f12[_0x4983('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x4983('0xe')](function(_0xd27719){logger[_0x4983('0x14')](_0x4983('0x17'),_0x5e6f12);logger[_0x4983('0x1b')](_0x4983('0x17'),_0x5e6f12,JSON[_0x4983('0x10')](_0xd27719));_0x4f3195(_0xd27719);})['catch'](function(_0x3e8ba7){logger[_0x4983('0x11')]('CreateChatMessage',_0x3e8ba7[_0x4983('0x13')],_0x5e6f12);_0x129edc(_0x55aff3['error'](0x1f4,_0x3e8ba7[_0x4983('0x13')]));});});};
\ No newline at end of file
+var _0x442e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateChatMessage','create','body','options','raw','util','bluebird','randomstring'];(function(_0x605d3,_0x3dcd80){var _0xbf0f70=function(_0x305c63){while(--_0x305c63){_0x605d3['push'](_0x605d3['shift']());}};_0xbf0f70(++_0x3dcd80);}(_0x442e,0x133));var _0xe442=function(_0x568f9f,_0x209067){_0x568f9f=_0x568f9f-0x0;var _0x46d6f9=_0x442e[_0x568f9f];return _0x46d6f9;};'use strict';var _=require('lodash');var util=require(_0xe442('0x0'));var moment=require('moment');var BPromise=require(_0xe442('0x1'));var rs=require(_0xe442('0x2'));var fs=require('fs');var Redis=require(_0xe442('0x3'));var db=require(_0xe442('0x4'))['db'];var utils=require(_0xe442('0x5'));var logger=require(_0xe442('0x6'))('rpc');var config=require(_0xe442('0x7'));var jayson=require(_0xe442('0x8'));var client=jayson[_0xe442('0x9')][_0xe442('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xe442('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xe442('0xc'))(new Redis(config['redis']));require(_0xe442('0xd'))['register'](socket);function respondWithRpcPromise(_0x1ac8a8,_0x2f9b2a,_0x34839e){return new BPromise(function(_0x48dd4e,_0x4a221e){return client[_0xe442('0xe')](_0x1ac8a8,_0x34839e)[_0xe442('0xf')](function(_0x9b83aa){logger[_0xe442('0x10')](_0xe442('0x11'),_0x2f9b2a,'request\x20sent');logger[_0xe442('0x12')](_0xe442('0x13'),_0x2f9b2a,_0xe442('0x14'),JSON[_0xe442('0x15')](_0x9b83aa));if(_0x9b83aa[_0xe442('0x16')]){if(_0x9b83aa[_0xe442('0x16')]['code']===0x1f4){logger[_0xe442('0x16')](_0xe442('0x11'),_0x2f9b2a,_0x9b83aa[_0xe442('0x16')][_0xe442('0x17')]);return _0x4a221e(_0x9b83aa[_0xe442('0x16')]['message']);}logger['error'](_0xe442('0x11'),_0x2f9b2a,_0x9b83aa['error'][_0xe442('0x17')]);return _0x48dd4e(_0x9b83aa[_0xe442('0x16')][_0xe442('0x17')]);}else{logger['info'](_0xe442('0x11'),_0x2f9b2a,_0xe442('0x14'));_0x48dd4e(_0x9b83aa[_0xe442('0x18')][_0xe442('0x17')]);}})[_0xe442('0x19')](function(_0x5c0112){logger[_0xe442('0x16')](_0xe442('0x11'),_0x2f9b2a,_0x5c0112);_0x4a221e(_0x5c0112);});});}exports[_0xe442('0x1a')]=function(_0x48b03c){var _0x3ec087=this;return new Promise(function(_0x7e1037,_0x21557f){return db['ChatMessage'][_0xe442('0x1b')](_0x48b03c[_0xe442('0x1c')],{'raw':_0x48b03c['options']?_0x48b03c[_0xe442('0x1d')][_0xe442('0x1e')]===undefined?!![]:![]:!![]})[_0xe442('0xf')](function(_0x1adcc5){logger[_0xe442('0x10')](_0xe442('0x1a'),_0x48b03c);logger[_0xe442('0x12')](_0xe442('0x1a'),_0x48b03c,JSON[_0xe442('0x15')](_0x1adcc5));_0x7e1037(_0x1adcc5);})[_0xe442('0x19')](function(_0x44aa65){logger[_0xe442('0x16')]('CreateChatMessage',_0x44aa65[_0xe442('0x17')],_0x48b03c);_0x21557f(_0x3ec087[_0xe442('0x16')](0x1f4,_0x44aa65['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 4b2aa78..6ac7c46 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 _0x6c32=['remove','update','emit','removeListener','register','chatMessage:','./chatMessage.events','save'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x6c32,0x6e));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var ChatMessageEvents=require(_0x26c3('0x0'));var events=[_0x26c3('0x1'),_0x26c3('0x2'),_0x26c3('0x3')];function createListener(_0x2bbfc4,_0x44fc8c){return function(_0x40cb8e){_0x44fc8c[_0x26c3('0x4')](_0x2bbfc4,_0x40cb8e);};}function removeListener(_0x36528a,_0x49d4a1){return function(){ChatMessageEvents[_0x26c3('0x5')](_0x36528a,_0x49d4a1);};}exports[_0x26c3('0x6')]=function(_0x15ac36){for(var _0x57d915=0x0,_0x187b81=events['length'];_0x57d915<_0x187b81;_0x57d915++){var _0x3dde22=events[_0x57d915];var _0x3ff8e7=createListener(_0x26c3('0x7')+_0x3dde22,_0x15ac36);ChatMessageEvents['on'](_0x3dde22,_0x3ff8e7);}};
\ No newline at end of file
+var _0xf0ba=['update','emit','register','length','chatMessage:','./chatMessage.events','save','remove'];(function(_0x555fef,_0x538c8e){var _0x352754=function(_0xbcd509){while(--_0xbcd509){_0x555fef['push'](_0x555fef['shift']());}};_0x352754(++_0x538c8e);}(_0xf0ba,0x1ed));var _0xaf0b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf0ba[_0x14add3];return _0x4a174f;};'use strict';var ChatMessageEvents=require(_0xaf0b('0x0'));var events=[_0xaf0b('0x1'),_0xaf0b('0x2'),_0xaf0b('0x3')];function createListener(_0xea88b2,_0x555620){return function(_0x277920){_0x555620[_0xaf0b('0x4')](_0xea88b2,_0x277920);};}function removeListener(_0x4cffa5,_0xcd565f){return function(){ChatMessageEvents['removeListener'](_0x4cffa5,_0xcd565f);};}exports[_0xaf0b('0x5')]=function(_0x4b3b85){for(var _0x4d1479=0x0,_0x53b32d=events[_0xaf0b('0x6')];_0x4d1479<_0x53b32d;_0x4d1479++){var _0x17b6d5=events[_0x4d1479];var _0x3439d5=createListener(_0xaf0b('0x7')+_0x17b6d5,_0x4b3b85);ChatMessageEvents['on'](_0x17b6d5,_0x3439d5);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 29f35ab..d27e4bf 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 _0x835e=['../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','/:id/accept','reject','destroy','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2adb42,_0xed8b12){var _0x101363=function(_0x1a9d3d){while(--_0x1a9d3d){_0x2adb42['push'](_0x2adb42['shift']());}};_0x101363(++_0xed8b12);}(_0x835e,0xb3));var _0xe835=function(_0x143a9e,_0x561a1a){_0x143a9e=_0x143a9e-0x0;var _0x46b750=_0x835e[_0x143a9e];return _0x46b750;};'use strict';var multer=require(_0xe835('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe835('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe835('0x2'));var auth=require(_0xe835('0x3'));var interaction=require(_0xe835('0x4'));var config=require(_0xe835('0x5'));var controller=require(_0xe835('0x6'));router[_0xe835('0x7')]('/',auth[_0xe835('0x8')](),controller[_0xe835('0x9')]);router[_0xe835('0x7')](_0xe835('0xa'),auth[_0xe835('0x8')](),controller[_0xe835('0xb')]);router['get'](_0xe835('0xc'),auth['isAuthenticated'](),controller[_0xe835('0xd')]);router[_0xe835('0xe')]('/',auth[_0xe835('0x8')](),interaction[_0xe835('0xf')](_0xe835('0x10'),_0xe835('0x11')),controller[_0xe835('0x12')]);router[_0xe835('0x13')](_0xe835('0xc'),controller['update']);router['put'](_0xe835('0x14'),auth[_0xe835('0x8')](),controller['accept']);router[_0xe835('0x13')]('/:id/reject',auth[_0xe835('0x8')](),controller[_0xe835('0x15')]);router['delete']('/:id',auth[_0xe835('0x8')](),controller[_0xe835('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x3aec=['reject','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','show','tracked','chat','chatmessage:create','update','put','/:id/accept','accept','/:id/reject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3aec,0x1b3));var _0xc3ae=function(_0x2e3107,_0x25f970){_0x2e3107=_0x2e3107-0x0;var _0x833d69=_0x3aec[_0x2e3107];return _0x833d69;};'use strict';var multer=require(_0xc3ae('0x0'));var util=require(_0xc3ae('0x1'));var path=require(_0xc3ae('0x2'));var timeout=require(_0xc3ae('0x3'));var express=require(_0xc3ae('0x4'));var router=express[_0xc3ae('0x5')]();var fs_extra=require(_0xc3ae('0x6'));var auth=require(_0xc3ae('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xc3ae('0x8'));var controller=require(_0xc3ae('0x9'));router[_0xc3ae('0xa')]('/',auth[_0xc3ae('0xb')](),controller[_0xc3ae('0xc')]);router['get'](_0xc3ae('0xd'),auth[_0xc3ae('0xb')](),controller[_0xc3ae('0xe')]);router[_0xc3ae('0xa')]('/:id',auth[_0xc3ae('0xb')](),controller[_0xc3ae('0xf')]);router['post']('/',auth[_0xc3ae('0xb')](),interaction[_0xc3ae('0x10')](_0xc3ae('0x11'),_0xc3ae('0x12')),controller['create']);router['put']('/:id',controller[_0xc3ae('0x13')]);router[_0xc3ae('0x14')](_0xc3ae('0x15'),auth[_0xc3ae('0xb')](),controller[_0xc3ae('0x16')]);router[_0xc3ae('0x14')](_0xc3ae('0x17'),auth[_0xc3ae('0xb')](),controller[_0xc3ae('0x18')]);router['delete']('/:id',auth[_0xc3ae('0xb')](),controller[_0xc3ae('0x19')]);module[_0xc3ae('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index a43820e..16f5a84 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(_0x5a90cd,_0x140d12){var _0x50d5ad=function(_0x10d94f){while(--_0x10d94f){_0x5a90cd['push'](_0x5a90cd['shift']());}};_0x50d5ad(++_0x140d12);}(_0xadb5,0xad));var _0x5adb=function(_0x31ff15,_0x59c221){_0x31ff15=_0x31ff15-0x0;var _0x49927a=_0xadb5[_0x31ff15];return _0x49927a;};'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 _0x757a=['exports','TEXT'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x757a,0xde));var _0xa757=function(_0x51b98b,_0x3b9b68){_0x51b98b=_0x51b98b-0x0;var _0x569c22=_0x757a[_0x51b98b];return _0x569c22;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'body':{'type':Sequelize[_0xa757('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('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 329a36d..ecbfe54 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(_0x6dc537,_0x4fb967){var _0x5ede93=function(_0x24ecf9){while(--_0x24ecf9){_0x6dc537['push'](_0x6dc537['shift']());}};_0x5ede93(++_0x4fb967);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_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 _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x7a54,0x106));var _0x47a5=function(_0x595835,_0x243d02){_0x595835=_0x595835-0x0;var _0x38a203=_0x7a54[_0x595835];return _0x38a203;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index ff2ad44..a5f1f6c 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 _0xa0f4=['hasOwnProperty','../../mysqldb','update','remove','emit'];(function(_0x349a3d,_0x12c2a3){var _0x211a04=function(_0x1edaea){while(--_0x1edaea){_0x349a3d['push'](_0x349a3d['shift']());}};_0x211a04(++_0x12c2a3);}(_0xa0f4,0x1b4));var _0x4a0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0f4[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x4a0f('0x0'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4a0f('0x1'),'afterDestroy':_0x4a0f('0x2')};function emitEvent(_0x317118){return function(_0x4fe4a3,_0x50ab71,_0x552648){ChatOfflineMessageEvents[_0x4a0f('0x3')](_0x317118+':'+_0x4fe4a3['id'],_0x4fe4a3);ChatOfflineMessageEvents['emit'](_0x317118,_0x4fe4a3);_0x552648(null);};}for(var e in events){if(events[_0x4a0f('0x4')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x8d0a=['exports','events','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x54861c,_0x8756fc){var _0x4786d6=function(_0x2c151b){while(--_0x2c151b){_0x54861c['push'](_0x54861c['shift']());}};_0x4786d6(++_0x8756fc);}(_0x8d0a,0x65));var _0xa8d0=function(_0x156797,_0xc2f92f){_0x156797=_0x156797-0x0;var _0x576f6d=_0x8d0a[_0x156797];return _0x576f6d;};'use strict';var EventEmitter=require(_0xa8d0('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0xa8d0('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xa8d0('0x2')](0x0);var events={'afterCreate':_0xa8d0('0x3'),'afterUpdate':_0xa8d0('0x4'),'afterDestroy':_0xa8d0('0x5')};function emitEvent(_0x477190){return function(_0x528287,_0x202833,_0x34f130){ChatOfflineMessageEvents['emit'](_0x477190+':'+_0x528287['id'],_0x528287);ChatOfflineMessageEvents[_0xa8d0('0x6')](_0x477190,_0x528287);_0x34f130(null);};}for(var e in events){if(events[_0xa8d0('0x7')](e)){var event=events[e];ChatOfflineMessage[_0xa8d0('0x8')](e,emitEvent(event));}}module[_0xa8d0('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index b3dfcd6..509f799 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 _0x6526=['chat_offline_messages','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x6526,0x1ca));var _0x6652=function(_0x21205e,_0x7eb8e7){_0x21205e=_0x21205e-0x0;var _0x136ebb=_0x6526[_0x21205e];return _0x136ebb;};'use strict';var attributes=require(_0x6652('0x0'));module[_0x6652('0x1')]=function(_0x2bd8ee){return _0x2bd8ee[_0x6652('0x2')](_0x6652('0x3'),attributes,{'tableName':_0x6652('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6652('0x5')});};
\ No newline at end of file
+var _0x62c5=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x4451e6,_0x4cfaab){var _0x4dbf17=function(_0x54e6ee){while(--_0x54e6ee){_0x4451e6['push'](_0x4451e6['shift']());}};_0x4dbf17(++_0x4cfaab);}(_0x62c5,0x112));var _0x562c=function(_0x91ed5c,_0xdb6b34){_0x91ed5c=_0x91ed5c-0x0;var _0x2387d8=_0x62c5[_0x91ed5c];return _0x2387d8;};'use strict';var attributes=require(_0x562c('0x0'));module[_0x562c('0x1')]=function(_0x183b1e){return _0x183b1e['define']('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x562c('0x2'),'collate':_0x562c('0x3')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 1d1a5c9..3cd677d 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 _0xaa7d=['code','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x33ca83,_0x54f25c){var _0x175082=function(_0x1c44a9){while(--_0x1c44a9){_0x33ca83['push'](_0x33ca83['shift']());}};_0x175082(++_0x54f25c);}(_0xaa7d,0x1ea));var _0xdaa7=function(_0x5e9a69,_0x40c0ec){_0x5e9a69=_0x5e9a69-0x0;var _0x5979c8=_0xaa7d[_0x5e9a69];return _0x5979c8;};'use strict';var _=require(_0xdaa7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdaa7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdaa7('0x2'))['db'];var utils=require(_0xdaa7('0x3'));var logger=require(_0xdaa7('0x4'))(_0xdaa7('0x5'));var config=require(_0xdaa7('0x6'));var jayson=require(_0xdaa7('0x7'));var client=jayson['client'][_0xdaa7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x995170,_0x478a70,_0x45f435){return new BPromise(function(_0x324e0b,_0x2eb2e2){return client['request'](_0x995170,_0x45f435)['then'](function(_0x5f3364){logger['info'](_0xdaa7('0x9'),_0x478a70,_0xdaa7('0xa'));logger['debug'](_0xdaa7('0xb'),_0x478a70,'request\x20sent',JSON[_0xdaa7('0xc')](_0x5f3364));if(_0x5f3364[_0xdaa7('0xd')]){if(_0x5f3364[_0xdaa7('0xd')][_0xdaa7('0xe')]===0x1f4){logger[_0xdaa7('0xd')](_0xdaa7('0x9'),_0x478a70,_0x5f3364[_0xdaa7('0xd')]['message']);return _0x2eb2e2(_0x5f3364[_0xdaa7('0xd')][_0xdaa7('0xf')]);}logger[_0xdaa7('0xd')](_0xdaa7('0x9'),_0x478a70,_0x5f3364[_0xdaa7('0xd')]['message']);return _0x324e0b(_0x5f3364[_0xdaa7('0xd')][_0xdaa7('0xf')]);}else{logger['info'](_0xdaa7('0x9'),_0x478a70,_0xdaa7('0xa'));_0x324e0b(_0x5f3364[_0xdaa7('0x10')][_0xdaa7('0xf')]);}})[_0xdaa7('0x11')](function(_0x5ddfb6){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x478a70,_0x5ddfb6);_0x2eb2e2(_0x5ddfb6);});});}
\ No newline at end of file
+var _0x4e3d=['info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','then'];(function(_0x522ae8,_0x3b637e){var _0x3189b9=function(_0x3115d4){while(--_0x3115d4){_0x522ae8['push'](_0x522ae8['shift']());}};_0x3189b9(++_0x3b637e);}(_0x4e3d,0x14b));var _0xd4e3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4e3d[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0xd4e3('0x0'));var moment=require('moment');var BPromise=require(_0xd4e3('0x1'));var rs=require(_0xd4e3('0x2'));var fs=require('fs');var Redis=require(_0xd4e3('0x3'));var db=require(_0xd4e3('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd4e3('0x5'));var jayson=require(_0xd4e3('0x6'));var client=jayson[_0xd4e3('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d2095,_0x172965,_0x38c887){return new BPromise(function(_0x17ed8d,_0x24fbb5){return client['request'](_0x1d2095,_0x38c887)[_0xd4e3('0x8')](function(_0x49f22b){logger[_0xd4e3('0x9')](_0xd4e3('0xa'),_0x172965,_0xd4e3('0xb'));logger[_0xd4e3('0xc')](_0xd4e3('0xd'),_0x172965,'request\x20sent',JSON['stringify'](_0x49f22b));if(_0x49f22b[_0xd4e3('0xe')]){if(_0x49f22b[_0xd4e3('0xe')]['code']===0x1f4){logger['error'](_0xd4e3('0xa'),_0x172965,_0x49f22b[_0xd4e3('0xe')][_0xd4e3('0xf')]);return _0x24fbb5(_0x49f22b['error'][_0xd4e3('0xf')]);}logger[_0xd4e3('0xe')](_0xd4e3('0xa'),_0x172965,_0x49f22b[_0xd4e3('0xe')]['message']);return _0x17ed8d(_0x49f22b[_0xd4e3('0xe')][_0xd4e3('0xf')]);}else{logger['info'](_0xd4e3('0xa'),_0x172965,_0xd4e3('0xb'));_0x17ed8d(_0x49f22b['result']['message']);}})[_0xd4e3('0x10')](function(_0xc4d165){logger['error'](_0xd4e3('0xa'),_0x172965,_0xc4d165);_0x24fbb5(_0xc4d165);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index cb3fe91..e4b2b18 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 _0x5510=['describe','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe'];(function(_0x2e1051,_0x58b01d){var _0x5aa734=function(_0x15a99d){while(--_0x15a99d){_0x2e1051['push'](_0x2e1051['shift']());}};_0x5aa734(++_0x58b01d);}(_0x5510,0x149));var _0x0551=function(_0x3ad9b3,_0x5c76e9){_0x3ad9b3=_0x3ad9b3-0x0;var _0x4ef8d1=_0x5510[_0x3ad9b3];return _0x4ef8d1;};'use strict';var multer=require(_0x0551('0x0'));var util=require('util');var path=require(_0x0551('0x1'));var timeout=require(_0x0551('0x2'));var express=require(_0x0551('0x3'));var router=express[_0x0551('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0551('0x5'));var interaction=require(_0x0551('0x6'));var config=require(_0x0551('0x7'));var controller=require('./chatOfflineMessage.controller');router[_0x0551('0x8')]('/',auth[_0x0551('0x9')](),controller['index']);router[_0x0551('0x8')](_0x0551('0xa'),auth[_0x0551('0x9')](),controller[_0x0551('0xb')]);router['get'](_0x0551('0xc'),auth[_0x0551('0x9')](),controller[_0x0551('0xd')]);router[_0x0551('0xe')]('/',auth[_0x0551('0x9')](),controller[_0x0551('0xf')]);router[_0x0551('0x10')]('/:id',auth[_0x0551('0x9')](),controller['update']);router[_0x0551('0x11')](_0x0551('0xc'),auth[_0x0551('0x9')](),controller[_0x0551('0x12')]);module[_0x0551('0x13')]=router;
\ No newline at end of file
+var _0xea32=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x5e709f,_0x49c4a1){var _0x45445f=function(_0x3d116f){while(--_0x3d116f){_0x5e709f['push'](_0x5e709f['shift']());}};_0x45445f(++_0x49c4a1);}(_0xea32,0x131));var _0x2ea3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xea32[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x2ea3('0x0'));var path=require(_0x2ea3('0x1'));var timeout=require(_0x2ea3('0x2'));var express=require(_0x2ea3('0x3'));var router=express[_0x2ea3('0x4')]();var fs_extra=require(_0x2ea3('0x5'));var auth=require(_0x2ea3('0x6'));var interaction=require(_0x2ea3('0x7'));var config=require(_0x2ea3('0x8'));var controller=require(_0x2ea3('0x9'));router[_0x2ea3('0xa')]('/',auth[_0x2ea3('0xb')](),controller[_0x2ea3('0xc')]);router[_0x2ea3('0xa')](_0x2ea3('0xd'),auth[_0x2ea3('0xb')](),controller[_0x2ea3('0xe')]);router[_0x2ea3('0xa')](_0x2ea3('0xf'),auth[_0x2ea3('0xb')](),controller['show']);router['post']('/',auth[_0x2ea3('0xb')](),controller[_0x2ea3('0x10')]);router[_0x2ea3('0x11')](_0x2ea3('0xf'),auth[_0x2ea3('0xb')](),controller[_0x2ea3('0x12')]);router[_0x2ea3('0x13')](_0x2ea3('0xf'),auth[_0x2ea3('0xb')](),controller[_0x2ea3('0x14')]);module[_0x2ea3('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 57bb7e7..50d8c79 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 _0x67b5=['sequelize','exports','STRING','mouseOver','timeout'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x67b5,0x11d));var _0x567b=function(_0x2a2091,_0x5d6a29){_0x2a2091=_0x2a2091-0x0;var _0x284077=_0x67b5[_0x2a2091];return _0x284077;};'use strict';var Sequelize=require(_0x567b('0x0'));module[_0x567b('0x1')]={'name':{'type':Sequelize[_0x567b('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x567b('0x3'),_0x567b('0x4')),'defaultValue':_0x567b('0x3')},'selector':{'type':Sequelize[_0x567b('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x89ea=['sequelize','STRING','ENUM','mouseOver','INTEGER'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0x89ea,0xdc));var _0xa89e=function(_0x3744c4,_0x4bdca9){_0x3744c4=_0x3744c4-0x0;var _0x167b7f=_0x89ea[_0x3744c4];return _0x167b7f;};'use strict';var Sequelize=require(_0xa89e('0x0'));module['exports']={'name':{'type':Sequelize[_0xa89e('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xa89e('0x2')](_0xa89e('0x3'),'timeout'),'defaultValue':_0xa89e('0x3')},'selector':{'type':Sequelize[_0xa89e('0x1')]},'timeout':{'type':Sequelize[_0xa89e('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index be7e5c7..fb636f3 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 _0x5a52=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','count','status','set','Content-Range','apply','save','then','destroy','error','stack','name','send','show','params','model','ChatProactiveAction','query','keys','intersection','attributes','fields','length','includeAll','include','options','find','catch','create','body','update','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service'];(function(_0x2e561f,_0x1b1660){var _0x4160ea=function(_0x1fa2ca){while(--_0x1fa2ca){_0x2e561f['push'](_0x2e561f['shift']());}};_0x4160ea(++_0x1b1660);}(_0x5a52,0x18d));var _0x25a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a52[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x25a5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x25a5('0x1'));var moment=require(_0x25a5('0x2'));var BPromise=require(_0x25a5('0x3'));var Mustache=require(_0x25a5('0x4'));var util=require(_0x25a5('0x5'));var path=require(_0x25a5('0x6'));var sox=require(_0x25a5('0x7'));var csv=require(_0x25a5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x25a5('0x9'));var _=require('lodash');var squel=require(_0x25a5('0xa'));var crypto=require(_0x25a5('0xb'));var jsforce=require(_0x25a5('0xc'));var deskjs=require(_0x25a5('0xd'));var toCsv=require(_0x25a5('0x8'));var querystring=require(_0x25a5('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x25a5('0xf'));var qs=require(_0x25a5('0x10'));var as=require(_0x25a5('0x11'));var hardwareService=require(_0x25a5('0x12'));var logger=require(_0x25a5('0x13'))(_0x25a5('0x14'));var utils=require(_0x25a5('0x15'));var config=require(_0x25a5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x25a5('0x17'))['db'];function respondWithStatusCode(_0x20df69,_0x425f2e){_0x425f2e=_0x425f2e||0xcc;return function(_0x5deb28){if(_0x5deb28){return _0x20df69[_0x25a5('0x18')](_0x425f2e);}return _0x20df69['status'](_0x425f2e)[_0x25a5('0x19')]();};}function respondWithResult(_0x25b7bb,_0x1edef3){_0x1edef3=_0x1edef3||0xc8;return function(_0x47d1d1){if(_0x47d1d1){return _0x25b7bb['status'](_0x1edef3)[_0x25a5('0x1a')](_0x47d1d1);}};}function respondWithFilteredResult(_0x5e1590,_0x7e183e){return function(_0x1c0ad6){if(_0x1c0ad6){var _0x39313e=typeof _0x7e183e[_0x25a5('0x1b')]==='undefined'&&typeof _0x7e183e[_0x25a5('0x1c')]==='undefined';var _0x5f257b=_0x1c0ad6[_0x25a5('0x1d')];var _0x17901b=_0x39313e?0x0:_0x7e183e[_0x25a5('0x1b')];var _0x95dfbc=_0x39313e?_0x1c0ad6[_0x25a5('0x1d')]:_0x7e183e['offset']+_0x7e183e['limit'];var _0x1390fb;if(_0x95dfbc>=_0x5f257b){_0x95dfbc=_0x5f257b;_0x1390fb=0xc8;}else{_0x1390fb=0xce;}_0x5e1590[_0x25a5('0x1e')](_0x1390fb);return _0x5e1590[_0x25a5('0x1f')](_0x25a5('0x20'),_0x17901b+'-'+_0x95dfbc+'/'+_0x5f257b)[_0x25a5('0x1a')](_0x1c0ad6);}return null;};}function patchUpdates(_0x44f1ed){return function(_0x514c59){try{jsonpatch[_0x25a5('0x21')](_0x514c59,_0x44f1ed,!![]);}catch(_0x4dba9d){return BPromise['reject'](_0x4dba9d);}return _0x514c59[_0x25a5('0x22')]();};}function saveUpdates(_0x54cc71,_0x34a92f){return function(_0x3177ea){if(_0x3177ea){return _0x3177ea['update'](_0x54cc71)[_0x25a5('0x23')](function(_0x174c3f){return _0x174c3f;});}return null;};}function removeEntity(_0x4be312,_0x37f7fe){return function(_0xaea9aa){if(_0xaea9aa){return _0xaea9aa[_0x25a5('0x24')]()['then'](function(){_0x4be312[_0x25a5('0x1e')](0xcc)[_0x25a5('0x19')]();});}};}function handleEntityNotFound(_0x5e8db0,_0x23b304){return function(_0x48db7e){if(!_0x48db7e){_0x5e8db0[_0x25a5('0x18')](0x194);}return _0x48db7e;};}function handleError(_0x42f14a,_0x400800){_0x400800=_0x400800||0x1f4;return function(_0x5caf87){logger[_0x25a5('0x25')](_0x5caf87[_0x25a5('0x26')]);if(_0x5caf87[_0x25a5('0x27')]){delete _0x5caf87[_0x25a5('0x27')];}_0x42f14a[_0x25a5('0x1e')](_0x400800)[_0x25a5('0x28')](_0x5caf87);};}exports[_0x25a5('0x29')]=function(_0x387774,_0x12e1be){var _0x112a08={'raw':!![],'where':{'id':_0x387774[_0x25a5('0x2a')]['id']}},_0x412f42={};_0x412f42[_0x25a5('0x2b')]=_['keys'](db[_0x25a5('0x2c')]['rawAttributes']);_0x412f42[_0x25a5('0x2d')]=_[_0x25a5('0x2e')](_0x387774['query']);_0x412f42['filters']=_[_0x25a5('0x2f')](_0x412f42[_0x25a5('0x2b')],_0x412f42[_0x25a5('0x2d')]);_0x112a08[_0x25a5('0x30')]=_['intersection'](_0x412f42[_0x25a5('0x2b')],qs[_0x25a5('0x31')](_0x387774[_0x25a5('0x2d')][_0x25a5('0x31')]));_0x112a08[_0x25a5('0x30')]=_0x112a08[_0x25a5('0x30')][_0x25a5('0x32')]?_0x112a08['attributes']:_0x412f42['model'];if(_0x387774[_0x25a5('0x2d')][_0x25a5('0x33')]){_0x112a08[_0x25a5('0x34')]=[{'all':!![]}];}_0x112a08=_['merge']({},_0x112a08,_0x387774[_0x25a5('0x35')]);return db[_0x25a5('0x2c')][_0x25a5('0x36')](_0x112a08)[_0x25a5('0x23')](handleEntityNotFound(_0x12e1be,null))[_0x25a5('0x23')](respondWithResult(_0x12e1be,null))[_0x25a5('0x37')](handleError(_0x12e1be,null));};exports[_0x25a5('0x38')]=function(_0x19ab5f,_0xaedce7){return db[_0x25a5('0x2c')][_0x25a5('0x38')](_0x19ab5f[_0x25a5('0x39')],{})['then'](respondWithResult(_0xaedce7,0xc9))['catch'](handleError(_0xaedce7,null));};exports[_0x25a5('0x3a')]=function(_0x5b872c,_0x27eefb){if(_0x5b872c['body']['id']){delete _0x5b872c[_0x25a5('0x39')]['id'];}return db[_0x25a5('0x2c')][_0x25a5('0x36')]({'where':{'id':_0x5b872c[_0x25a5('0x2a')]['id']}})[_0x25a5('0x23')](handleEntityNotFound(_0x27eefb,null))['then'](saveUpdates(_0x5b872c[_0x25a5('0x39')],null))['then'](respondWithResult(_0x27eefb,null))[_0x25a5('0x37')](handleError(_0x27eefb,null));};exports['destroy']=function(_0x5ad0b6,_0x3c3c64){return db[_0x25a5('0x2c')][_0x25a5('0x36')]({'where':{'id':_0x5ad0b6[_0x25a5('0x2a')]['id']}})[_0x25a5('0x23')](handleEntityNotFound(_0x3c3c64,null))[_0x25a5('0x23')](removeEntity(_0x3c3c64,null))[_0x25a5('0x37')](handleError(_0x3c3c64,null));};
\ No newline at end of file
+var _0xf9d5=['catch','create','body','update','find','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','then','sendStatus','error','stack','name','show','params','model','keys','ChatProactiveAction','query','intersection','fields','attributes','includeAll','merge','options'];(function(_0x5192de,_0x4e91cd){var _0x4e287e=function(_0x3639bc){while(--_0x3639bc){_0x5192de['push'](_0x5192de['shift']());}};_0x4e287e(++_0x4e91cd);}(_0xf9d5,0x122));var _0x5f9d=function(_0x19093e,_0x2b5387){_0x19093e=_0x19093e-0x0;var _0x2e3e83=_0xf9d5[_0x19093e];return _0x2e3e83;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5f9d('0x0'));var zipdir=require(_0x5f9d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f9d('0x2'));var moment=require(_0x5f9d('0x3'));var BPromise=require(_0x5f9d('0x4'));var Mustache=require(_0x5f9d('0x5'));var util=require(_0x5f9d('0x6'));var path=require(_0x5f9d('0x7'));var sox=require(_0x5f9d('0x8'));var csv=require('to-csv');var ejs=require(_0x5f9d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5f9d('0xa'));var squel=require(_0x5f9d('0xb'));var crypto=require('crypto');var jsforce=require(_0x5f9d('0xc'));var deskjs=require(_0x5f9d('0xd'));var toCsv=require(_0x5f9d('0xe'));var querystring=require(_0x5f9d('0xf'));var Papa=require(_0x5f9d('0x10'));var Redis=require(_0x5f9d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5f9d('0x12'));var as=require(_0x5f9d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5f9d('0x14'));var utils=require(_0x5f9d('0x15'));var config=require(_0x5f9d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f9d('0x17'))['db'];function respondWithStatusCode(_0x10f5b1,_0x257910){_0x257910=_0x257910||0xcc;return function(_0x23a39f){if(_0x23a39f){return _0x10f5b1['sendStatus'](_0x257910);}return _0x10f5b1[_0x5f9d('0x18')](_0x257910)[_0x5f9d('0x19')]();};}function respondWithResult(_0x234902,_0x5aacdc){_0x5aacdc=_0x5aacdc||0xc8;return function(_0x8e2381){if(_0x8e2381){return _0x234902[_0x5f9d('0x18')](_0x5aacdc)['json'](_0x8e2381);}};}function respondWithFilteredResult(_0x4fd1cb,_0x2f0154){return function(_0x334cea){if(_0x334cea){var _0x3d4a1c=typeof _0x2f0154[_0x5f9d('0x1a')]===_0x5f9d('0x1b')&&typeof _0x2f0154['limit']==='undefined';var _0x54bd00=_0x334cea[_0x5f9d('0x1c')];var _0x4fb9a5=_0x3d4a1c?0x0:_0x2f0154[_0x5f9d('0x1a')];var _0x48448e=_0x3d4a1c?_0x334cea[_0x5f9d('0x1c')]:_0x2f0154[_0x5f9d('0x1a')]+_0x2f0154[_0x5f9d('0x1d')];var _0x55a31c;if(_0x48448e>=_0x54bd00){_0x48448e=_0x54bd00;_0x55a31c=0xc8;}else{_0x55a31c=0xce;}_0x4fd1cb[_0x5f9d('0x18')](_0x55a31c);return _0x4fd1cb[_0x5f9d('0x1e')](_0x5f9d('0x1f'),_0x4fb9a5+'-'+_0x48448e+'/'+_0x54bd00)[_0x5f9d('0x20')](_0x334cea);}return null;};}function patchUpdates(_0x320182){return function(_0xa62826){try{jsonpatch[_0x5f9d('0x21')](_0xa62826,_0x320182,!![]);}catch(_0x2563d5){return BPromise[_0x5f9d('0x22')](_0x2563d5);}return _0xa62826['save']();};}function saveUpdates(_0x4a2eeb,_0x5465b1){return function(_0x1bc76b){if(_0x1bc76b){return _0x1bc76b['update'](_0x4a2eeb)[_0x5f9d('0x23')](function(_0x5a3472){return _0x5a3472;});}return null;};}function removeEntity(_0x9d86ce,_0x564886){return function(_0x4875c5){if(_0x4875c5){return _0x4875c5['destroy']()[_0x5f9d('0x23')](function(){_0x9d86ce[_0x5f9d('0x18')](0xcc)[_0x5f9d('0x19')]();});}};}function handleEntityNotFound(_0x234511,_0x542bbc){return function(_0x379d2d){if(!_0x379d2d){_0x234511[_0x5f9d('0x24')](0x194);}return _0x379d2d;};}function handleError(_0x190402,_0x74f212){_0x74f212=_0x74f212||0x1f4;return function(_0x2d097f){logger[_0x5f9d('0x25')](_0x2d097f[_0x5f9d('0x26')]);if(_0x2d097f[_0x5f9d('0x27')]){delete _0x2d097f[_0x5f9d('0x27')];}_0x190402[_0x5f9d('0x18')](_0x74f212)['send'](_0x2d097f);};}exports[_0x5f9d('0x28')]=function(_0x1b9054,_0x1496c0){var _0x13cc7c={'raw':!![],'where':{'id':_0x1b9054[_0x5f9d('0x29')]['id']}},_0x10e542={};_0x10e542[_0x5f9d('0x2a')]=_[_0x5f9d('0x2b')](db[_0x5f9d('0x2c')]['rawAttributes']);_0x10e542['query']=_['keys'](_0x1b9054[_0x5f9d('0x2d')]);_0x10e542['filters']=_[_0x5f9d('0x2e')](_0x10e542['model'],_0x10e542[_0x5f9d('0x2d')]);_0x13cc7c['attributes']=_[_0x5f9d('0x2e')](_0x10e542[_0x5f9d('0x2a')],qs[_0x5f9d('0x2f')](_0x1b9054[_0x5f9d('0x2d')][_0x5f9d('0x2f')]));_0x13cc7c['attributes']=_0x13cc7c[_0x5f9d('0x30')]['length']?_0x13cc7c[_0x5f9d('0x30')]:_0x10e542['model'];if(_0x1b9054[_0x5f9d('0x2d')][_0x5f9d('0x31')]){_0x13cc7c['include']=[{'all':!![]}];}_0x13cc7c=_[_0x5f9d('0x32')]({},_0x13cc7c,_0x1b9054[_0x5f9d('0x33')]);return db[_0x5f9d('0x2c')]['find'](_0x13cc7c)[_0x5f9d('0x23')](handleEntityNotFound(_0x1496c0,null))[_0x5f9d('0x23')](respondWithResult(_0x1496c0,null))[_0x5f9d('0x34')](handleError(_0x1496c0,null));};exports[_0x5f9d('0x35')]=function(_0x3377af,_0x506869){return db[_0x5f9d('0x2c')][_0x5f9d('0x35')](_0x3377af[_0x5f9d('0x36')],{})[_0x5f9d('0x23')](respondWithResult(_0x506869,0xc9))[_0x5f9d('0x34')](handleError(_0x506869,null));};exports[_0x5f9d('0x37')]=function(_0x48a8e8,_0x1692c0){if(_0x48a8e8[_0x5f9d('0x36')]['id']){delete _0x48a8e8[_0x5f9d('0x36')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x48a8e8[_0x5f9d('0x29')]['id']}})[_0x5f9d('0x23')](handleEntityNotFound(_0x1692c0,null))[_0x5f9d('0x23')](saveUpdates(_0x48a8e8[_0x5f9d('0x36')],null))[_0x5f9d('0x23')](respondWithResult(_0x1692c0,null))['catch'](handleError(_0x1692c0,null));};exports['destroy']=function(_0x43b7b9,_0x3c5737){return db['ChatProactiveAction'][_0x5f9d('0x38')]({'where':{'id':_0x43b7b9['params']['id']}})[_0x5f9d('0x23')](handleEntityNotFound(_0x3c5737,null))[_0x5f9d('0x23')](removeEntity(_0x3c5737,null))['catch'](handleError(_0x3c5737,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 932a05f..7c96efd 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 _0x77d7=['ChatProactiveAction','lodash','../../config/logger','bluebird','path','./chatProactiveAction.attributes'];(function(_0x154192,_0x2d360f){var _0x3c2792=function(_0x2e257b){while(--_0x2e257b){_0x154192['push'](_0x154192['shift']());}};_0x3c2792(++_0x2d360f);}(_0x77d7,0x12d));var _0x777d=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x77d7[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x777d('0x0'));var util=require('util');var logger=require(_0x777d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x777d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x777d('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x777d('0x4'));module['exports']=function(_0xa4ac17,_0x4791fc){return _0xa4ac17['define'](_0x777d('0x5'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb1b6=['request-promise','path','rimraf','../../config/environment','exports','define','ChatProactiveAction','lodash','../../config/logger','api','moment','bluebird'];(function(_0x128c2,_0x24f64d){var _0xec6cad=function(_0x592865){while(--_0x592865){_0x128c2['push'](_0x128c2['shift']());}};_0xec6cad(++_0x24f64d);}(_0xb1b6,0x1f3));var _0x6b1b=function(_0x53cbcc,_0x252b41){_0x53cbcc=_0x53cbcc-0x0;var _0x26c68c=_0xb1b6[_0x53cbcc];return _0x26c68c;};'use strict';var _=require(_0x6b1b('0x0'));var util=require('util');var logger=require(_0x6b1b('0x1'))(_0x6b1b('0x2'));var moment=require(_0x6b1b('0x3'));var BPromise=require(_0x6b1b('0x4'));var rp=require(_0x6b1b('0x5'));var fs=require('fs');var path=require(_0x6b1b('0x6'));var rimraf=require(_0x6b1b('0x7'));var config=require(_0x6b1b('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0x6b1b('0x9')]=function(_0x24c12b,_0x3ed5d4){return _0x24c12b[_0x6b1b('0xa')](_0x6b1b('0xb'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 435e2d7..ce1de0a 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 _0x5707=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','message','ChatProactiveAction,\x20%s,\x20%s','lodash','util','moment','bluebird'];(function(_0x38157b,_0x28834d){var _0x3e8df2=function(_0x21ff1){while(--_0x21ff1){_0x38157b['push'](_0x38157b['shift']());}};_0x3e8df2(++_0x28834d);}(_0x5707,0x122));var _0x7570=function(_0x180c9b,_0x13d173){_0x180c9b=_0x180c9b-0x0;var _0x3ff116=_0x5707[_0x180c9b];return _0x3ff116;};'use strict';var _=require(_0x7570('0x0'));var util=require(_0x7570('0x1'));var moment=require(_0x7570('0x2'));var BPromise=require(_0x7570('0x3'));var rs=require(_0x7570('0x4'));var fs=require('fs');var Redis=require(_0x7570('0x5'));var db=require(_0x7570('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7570('0x7'))(_0x7570('0x8'));var config=require(_0x7570('0x9'));var jayson=require(_0x7570('0xa'));var client=jayson[_0x7570('0xb')][_0x7570('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x56626b,_0xb8da42,_0x94d5cf){return new BPromise(function(_0x8ffb97,_0x429d0c){return client[_0x7570('0xd')](_0x56626b,_0x94d5cf)[_0x7570('0xe')](function(_0x37121f){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0xb8da42,_0x7570('0xf'));logger[_0x7570('0x10')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0xb8da42,'request\x20sent',JSON[_0x7570('0x11')](_0x37121f));if(_0x37121f[_0x7570('0x12')]){if(_0x37121f[_0x7570('0x12')]['code']===0x1f4){logger[_0x7570('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0xb8da42,_0x37121f[_0x7570('0x12')]['message']);return _0x429d0c(_0x37121f[_0x7570('0x12')][_0x7570('0x13')]);}logger[_0x7570('0x12')](_0x7570('0x14'),_0xb8da42,_0x37121f[_0x7570('0x12')][_0x7570('0x13')]);return _0x8ffb97(_0x37121f[_0x7570('0x12')][_0x7570('0x13')]);}else{logger['info'](_0x7570('0x14'),_0xb8da42,_0x7570('0xf'));_0x8ffb97(_0x37121f['result'][_0x7570('0x13')]);}})['catch'](function(_0xf6c705){logger[_0x7570('0x12')](_0x7570('0x14'),_0xb8da42,_0xf6c705);_0x429d0c(_0xf6c705);});});}
\ No newline at end of file
+var _0x6688=['info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x49a84b,_0x17c1be){var _0x171650=function(_0x1cc9cf){while(--_0x1cc9cf){_0x49a84b['push'](_0x49a84b['shift']());}};_0x171650(++_0x17c1be);}(_0x6688,0x13d));var _0x8668=function(_0x5d4b7d,_0x2a54f8){_0x5d4b7d=_0x5d4b7d-0x0;var _0x5d1eaf=_0x6688[_0x5d4b7d];return _0x5d1eaf;};'use strict';var _=require('lodash');var util=require(_0x8668('0x0'));var moment=require(_0x8668('0x1'));var BPromise=require(_0x8668('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8668('0x3'));var db=require(_0x8668('0x4'))['db'];var utils=require(_0x8668('0x5'));var logger=require(_0x8668('0x6'))(_0x8668('0x7'));var config=require(_0x8668('0x8'));var jayson=require(_0x8668('0x9'));var client=jayson[_0x8668('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x389de5,_0x493efe,_0x2964bf){return new BPromise(function(_0x51b317,_0x5cf43a){return client[_0x8668('0xb')](_0x389de5,_0x2964bf)[_0x8668('0xc')](function(_0x800ab7){logger[_0x8668('0xd')](_0x8668('0xe'),_0x493efe,_0x8668('0xf'));logger['debug'](_0x8668('0x10'),_0x493efe,_0x8668('0xf'),JSON[_0x8668('0x11')](_0x800ab7));if(_0x800ab7[_0x8668('0x12')]){if(_0x800ab7[_0x8668('0x12')][_0x8668('0x13')]===0x1f4){logger[_0x8668('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x493efe,_0x800ab7['error'][_0x8668('0x14')]);return _0x5cf43a(_0x800ab7[_0x8668('0x12')]['message']);}logger['error'](_0x8668('0xe'),_0x493efe,_0x800ab7[_0x8668('0x12')][_0x8668('0x14')]);return _0x51b317(_0x800ab7[_0x8668('0x12')][_0x8668('0x14')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x493efe,_0x8668('0xf'));_0x51b317(_0x800ab7['result'][_0x8668('0x14')]);}})[_0x8668('0x15')](function(_0x3316a3){logger[_0x8668('0x12')](_0x8668('0xe'),_0x493efe,_0x3316a3);_0x5cf43a(_0x3316a3);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 3cf2d9a..ca244c4 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 _0xeff8=['isAuthenticated','show','post','create','put','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xeff8,0x186));var _0x8eff=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xeff8[_0x39096d];return _0x13da4f;};'use strict';var multer=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var path=require('path');var timeout=require(_0x8eff('0x2'));var express=require(_0x8eff('0x3'));var router=express[_0x8eff('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8eff('0x5'));var interaction=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var controller=require(_0x8eff('0x8'));router['get'](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller[_0x8eff('0xb')]);router[_0x8eff('0xc')]('/',auth['isAuthenticated'](),controller[_0x8eff('0xd')]);router[_0x8eff('0xe')](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller['update']);router['delete'](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller[_0x8eff('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','create','put','update','delete','exports','multer','util'];(function(_0x46b98,_0x202301){var _0x550fed=function(_0x5b2634){while(--_0x5b2634){_0x46b98['push'](_0x46b98['shift']());}};_0x550fed(++_0x202301);}(_0xf494,0x1c6));var _0x4f49=function(_0x109864,_0x2339ec){_0x109864=_0x109864-0x0;var _0x1523a1=_0xf494[_0x109864];return _0x1523a1;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4f49('0xe')]);router[_0x4f49('0xf')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0x10')]);router[_0x4f49('0x11')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller['destroy']);module[_0x4f49('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 0652ac9..96d5bba 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 _0x5529=['sequelize','exports','STRING','name','ENUM','rrmemory','beepall','roundrobin'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x5529,0x180));var _0x9552=function(_0x1c09f4,_0x46a2e5){_0x1c09f4=_0x1c09f4-0x0;var _0x122707=_0x5529[_0x1c09f4];return _0x122707;};'use strict';var Sequelize=require(_0x9552('0x0'));module[_0x9552('0x1')]={'name':{'type':Sequelize[_0x9552('0x2')],'unique':_0x9552('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9552('0x4')](_0x9552('0x5'),_0x9552('0x6'),_0x9552('0x7'))}};
\ No newline at end of file
+var _0x1659=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x2035b1,_0x240790){var _0x2a3f32=function(_0x3f65e9){while(--_0x3f65e9){_0x2035b1['push'](_0x2035b1['shift']());}};_0x2a3f32(++_0x240790);}(_0x1659,0x1a1));var _0x9165=function(_0x7af1ed,_0x150d56){_0x7af1ed=_0x7af1ed-0x0;var _0x7dcac9=_0x1659[_0x7af1ed];return _0x7dcac9;};'use strict';var Sequelize=require(_0x9165('0x0'));module[_0x9165('0x1')]={'name':{'type':Sequelize[_0x9165('0x2')],'unique':_0x9165('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9165('0x2')]},'timeout':{'type':Sequelize[_0x9165('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9165('0x5')](_0x9165('0x6'),'beepall',_0x9165('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 4f268a4..944167d 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 _0xdc2b=['compact','value','removeAgents','userChatQueue:remove','addAgents','omit','userChatQueue:save','isArray','getAgents','bluebird','util','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','update','then','get','ChatQueues','UserProfileResource','destroy','error','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','getOptions','include','findAll','catch','show','params','model','keys','query','intersection','attributes','fields','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','describe','getMembers','findOne','UserChatQueue','filters','hasOwnProperty','nolimit','sort','where','User','UserId','chatPause','updatedAt','rows','format','%s/%s','createdAt','Team','order','pick','filter','getTeams','length','ids','online','voicePause','interface','flatMap','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','Agents','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','TeamId','includes','all','union'];(function(_0x1a2f18,_0x400424){var _0x1a6a7f=function(_0x2022a2){while(--_0x2022a2){_0x1a2f18['push'](_0x1a2f18['shift']());}};_0x1a6a7f(++_0x400424);}(_0xdc2b,0x174));var _0xbdc2=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xdc2b[_0xa6cc5c];return _0x44803d;};'use strict';var BPromise=require(_0xbdc2('0x0'));var util=require(_0xbdc2('0x1'));var _=require('lodash');var squel=require('squel');var Redis=require(_0xbdc2('0x2'));var qs=require(_0xbdc2('0x3'));var logger=require(_0xbdc2('0x4'))(_0xbdc2('0x5'));var config=require(_0xbdc2('0x6'));var db=require('../../mysqldb')['db'];config[_0xbdc2('0x7')]=_[_0xbdc2('0x8')](config[_0xbdc2('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xbdc2('0x9'))(new Redis(config['redis']));require('./chatQueue.socket')[_0xbdc2('0xa')](socket);function respondWithStatusCode(_0x565313,_0x15317d){_0x15317d=_0x15317d||0xcc;return function(_0x1ef8f6){if(_0x1ef8f6){return _0x565313[_0xbdc2('0xb')](_0x15317d);}return _0x565313[_0xbdc2('0xc')](_0x15317d)[_0xbdc2('0xd')]();};}function respondWithResult(_0x25b9bb,_0x511256){_0x511256=_0x511256||0xc8;return function(_0x45b01a){if(_0x45b01a){return _0x25b9bb[_0xbdc2('0xc')](_0x511256)['json'](_0x45b01a);}};}function respondWithFilteredResult(_0x6c5ce2,_0x4b2c81){return function(_0x5d4622){if(_0x5d4622){var _0x2e0521=typeof _0x4b2c81[_0xbdc2('0xe')]==='undefined'&&typeof _0x4b2c81[_0xbdc2('0xf')]===_0xbdc2('0x10');var _0x171014=_0x5d4622[_0xbdc2('0x11')];var _0xc0a6d7=_0x2e0521?0x0:_0x4b2c81[_0xbdc2('0xe')];var _0x4c8ae6=_0x2e0521?_0x5d4622[_0xbdc2('0x11')]:_0x4b2c81[_0xbdc2('0xe')]+_0x4b2c81['limit'];var _0x16837b;if(_0x4c8ae6>=_0x171014){_0x4c8ae6=_0x171014;_0x16837b=0xc8;}else{_0x16837b=0xce;}_0x6c5ce2[_0xbdc2('0xc')](_0x16837b);return _0x6c5ce2[_0xbdc2('0x12')](_0xbdc2('0x13'),_0xc0a6d7+'-'+_0x4c8ae6+'/'+_0x171014)[_0xbdc2('0x14')](_0x5d4622);}return null;};}function saveUpdates(_0xeba671){return function(_0x33f7ea){if(_0x33f7ea){return _0x33f7ea[_0xbdc2('0x15')](_0xeba671)[_0xbdc2('0x16')](function(_0x4222df){return _0x4222df;});}return null;};}function removeEntity(_0x2de6d1){return function(_0x10bcaa){if(_0x10bcaa){return _0x10bcaa['destroy']()[_0xbdc2('0x16')](function(){var _0x2782c1=_0x10bcaa[_0xbdc2('0x17')]({'plain':!![]});var _0x35ab99=_0xbdc2('0x18');return db[_0xbdc2('0x19')][_0xbdc2('0x1a')]({'where':{'type':_0x35ab99,'resourceId':_0x2782c1['id']}})['then'](function(){return _0x10bcaa;});})[_0xbdc2('0x16')](function(){_0x2de6d1[_0xbdc2('0xc')](0xcc)[_0xbdc2('0xd')]();});}};}function handleEntityNotFound(_0x3a5fda){return function(_0x59281f){if(!_0x59281f){_0x3a5fda['sendStatus'](0x194);}return _0x59281f;};}function handleError(_0x2cb1ba,_0x19cb96){_0x19cb96=_0x19cb96||0x1f4;return function(_0x4365a9){logger[_0xbdc2('0x1b')](_0x4365a9['stack']);if(_0x4365a9[_0xbdc2('0x1c')]){delete _0x4365a9[_0xbdc2('0x1c')];}_0x2cb1ba[_0xbdc2('0xc')](_0x19cb96)[_0xbdc2('0x1d')](_0x4365a9);};}exports[_0xbdc2('0x1e')]=function(_0x150981,_0x241a3b){var _0x265935={};var _0x1ab11d={'count':0x0,'rows':[]};var _0x646363=_[_0xbdc2('0x1f')](db[_0xbdc2('0x20')][_0xbdc2('0x21')],function(_0x347f06){return{'name':_0x347f06[_0xbdc2('0x22')],'type':_0x347f06[_0xbdc2('0x23')][_0xbdc2('0x24')]};});_0x265935=qs[_0xbdc2('0x25')](_0x646363,_0x150981);var _0x48798d={'where':_0x265935['where']};return db['ChatQueue']['count'](_0x48798d)['then'](function(_0xb13846){_0x1ab11d['count']=_0xb13846;_0x265935[_0xbdc2('0x26')]=qs[_0xbdc2('0x26')](_0x150981['query']);return db['ChatQueue'][_0xbdc2('0x27')](_0x265935);})['then'](function(_0x41133a){_0x1ab11d['rows']=_0x41133a;return _0x1ab11d;})[_0xbdc2('0x16')](respondWithFilteredResult(_0x241a3b,_0x265935))[_0xbdc2('0x28')](handleError(_0x241a3b,null));};exports[_0xbdc2('0x29')]=function(_0xdcade9,_0x941804){var _0x51cc40={'raw':!![],'where':{'id':_0xdcade9[_0xbdc2('0x2a')]['id']}},_0x39acd2={};_0x39acd2[_0xbdc2('0x2b')]=_[_0xbdc2('0x2c')](db['ChatQueue']['rawAttributes']);_0x39acd2['query']=_[_0xbdc2('0x2c')](_0xdcade9[_0xbdc2('0x2d')]);_0x39acd2['filters']=_[_0xbdc2('0x2e')](_0x39acd2['model'],_0x39acd2['query']);_0x51cc40[_0xbdc2('0x2f')]=_[_0xbdc2('0x2e')](_0x39acd2['model'],qs[_0xbdc2('0x30')](_0xdcade9[_0xbdc2('0x2d')]['fields']));_0x51cc40[_0xbdc2('0x2f')]=_0x51cc40[_0xbdc2('0x2f')]['length']?_0x51cc40[_0xbdc2('0x2f')]:_0x39acd2[_0xbdc2('0x2b')];if(_0xdcade9['query'][_0xbdc2('0x31')]){_0x51cc40[_0xbdc2('0x26')]=[{'all':!![]}];}_0x51cc40=_[_0xbdc2('0x32')]({},_0x51cc40,_0xdcade9[_0xbdc2('0x33')]);return db[_0xbdc2('0x20')][_0xbdc2('0x34')](_0x51cc40)[_0xbdc2('0x16')](handleEntityNotFound(_0x941804,null))['then'](respondWithResult(_0x941804,null))[_0xbdc2('0x28')](handleError(_0x941804,null));};exports[_0xbdc2('0x35')]=function(_0x4ef443,_0x37f176){return db['ChatQueue'][_0xbdc2('0x35')](_0x4ef443[_0xbdc2('0x36')],{})[_0xbdc2('0x16')](function(_0x29bddd){var _0x4b6aa3=_0x4ef443[_0xbdc2('0x37')][_0xbdc2('0x17')]({'plain':!![]});if(!_0x4b6aa3)throw new Error(_0xbdc2('0x38'));if(_0x4b6aa3['role']===_0xbdc2('0x37')){var _0x374382=_0x29bddd[_0xbdc2('0x17')]({'plain':!![]});var _0x373bea=_0xbdc2('0x18');return db['UserProfileSection'][_0xbdc2('0x34')]({'where':{'name':_0x373bea,'userProfileId':_0x4b6aa3['userProfileId']},'raw':!![]})[_0xbdc2('0x16')](function(_0x208fd0){if(_0x208fd0&&_0x208fd0[_0xbdc2('0x39')]===0x0){return db['UserProfileResource'][_0xbdc2('0x35')]({'name':_0x374382['name'],'resourceId':_0x374382['id'],'type':_0x208fd0[_0xbdc2('0x1c')],'sectionId':_0x208fd0['id']},{})[_0xbdc2('0x16')](function(){return _0x29bddd;});}else{return _0x29bddd;}})['catch'](function(_0x39fc26){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x39fc26);throw _0x39fc26;});}return _0x29bddd;})['then'](respondWithResult(_0x37f176,0xc9))[_0xbdc2('0x28')](handleError(_0x37f176,null));};exports[_0xbdc2('0x15')]=function(_0x2c67c3,_0x53687b){if(_0x2c67c3[_0xbdc2('0x36')]['id']){delete _0x2c67c3[_0xbdc2('0x36')]['id'];}return db[_0xbdc2('0x20')][_0xbdc2('0x34')]({'where':{'id':_0x2c67c3[_0xbdc2('0x2a')]['id']}})[_0xbdc2('0x16')](handleEntityNotFound(_0x53687b,null))[_0xbdc2('0x16')](saveUpdates(_0x2c67c3['body'],null))[_0xbdc2('0x16')](respondWithResult(_0x53687b,null))['catch'](handleError(_0x53687b,null));};exports[_0xbdc2('0x1a')]=function(_0xb20a1,_0x280b24){return db[_0xbdc2('0x20')][_0xbdc2('0x34')]({'where':{'id':_0xb20a1['params']['id']}})[_0xbdc2('0x16')](handleEntityNotFound(_0x280b24,null))[_0xbdc2('0x16')](removeEntity(_0x280b24,null))[_0xbdc2('0x28')](handleError(_0x280b24,null));};exports[_0xbdc2('0x3a')]=function(_0x4b6d1e,_0x5a6d47){return db['ChatQueue'][_0xbdc2('0x3a')]()[_0xbdc2('0x16')](respondWithResult(_0x5a6d47,null))[_0xbdc2('0x28')](handleError(_0x5a6d47,null));};exports[_0xbdc2('0x3b')]=function(_0x33bc0f,_0x3733d4){var _0x266c61={'raw':!![],'where':{}},_0x5aa5e1={},_0xc6be87;return db[_0xbdc2('0x20')][_0xbdc2('0x3c')]({'where':{'id':_0x33bc0f['params']['id']}})[_0xbdc2('0x16')](handleEntityNotFound(_0x3733d4,null))[_0xbdc2('0x16')](function(_0x152f3e){if(_0x152f3e){_0xc6be87=_0x152f3e[_0xbdc2('0x17')]({'plain':!![]});_0x5aa5e1[_0xbdc2('0x2b')]=_[_0xbdc2('0x2c')](db[_0xbdc2('0x3d')][_0xbdc2('0x21')]);_0x5aa5e1[_0xbdc2('0x2d')]=_[_0xbdc2('0x2c')](_0x33bc0f[_0xbdc2('0x2d')]);_0x5aa5e1[_0xbdc2('0x3e')]=_['intersection'](_0x5aa5e1[_0xbdc2('0x2b')],_0x5aa5e1[_0xbdc2('0x2d')]);_0x266c61['attributes']=_[_0xbdc2('0x2e')](_0x5aa5e1[_0xbdc2('0x2b')],qs['fields'](_0x33bc0f[_0xbdc2('0x2d')][_0xbdc2('0x30')]));_0x266c61[_0xbdc2('0x2f')]=_0x266c61['attributes']['length']?_0x266c61[_0xbdc2('0x2f')]:_0x5aa5e1['model'];if(!_0x33bc0f[_0xbdc2('0x2d')][_0xbdc2('0x3f')](_0xbdc2('0x40'))){_0x266c61[_0xbdc2('0xf')]=qs[_0xbdc2('0xf')](_0x33bc0f[_0xbdc2('0x2d')][_0xbdc2('0xf')]);_0x266c61['offset']=qs[_0xbdc2('0xe')](_0x33bc0f['query'][_0xbdc2('0xe')]);}_0x266c61['order']=qs[_0xbdc2('0x41')](_0x33bc0f[_0xbdc2('0x2d')][_0xbdc2('0x41')]);_0x266c61[_0xbdc2('0x42')]=qs[_0xbdc2('0x3e')](_['pick'](_0x33bc0f[_0xbdc2('0x2d')],_0x5aa5e1[_0xbdc2('0x3e')]));_0x266c61[_0xbdc2('0x42')]['ChatQueueId']=_0x152f3e['id'];if(_0x33bc0f[_0xbdc2('0x2d')]['filter']){_0x266c61[_0xbdc2('0x42')]=_[_0xbdc2('0x32')](_0x266c61[_0xbdc2('0x42')],{'$or':_[_0xbdc2('0x1f')](_0x266c61[_0xbdc2('0x2f')],function(_0x3da852){var _0x3c64a0={};_0x3c64a0[_0x3da852]={'$like':'%'+_0x33bc0f['query']['filter']+'%'};return _0x3c64a0;})});}_0x266c61=_[_0xbdc2('0x32')]({},_0x266c61,_0x33bc0f[_0xbdc2('0x33')]);return db[_0xbdc2('0x3d')]['findAll'](_0x266c61);}})[_0xbdc2('0x16')](function(_0x887ca4){if(_0x887ca4){return db[_0xbdc2('0x43')]['findAndCountAll']({'where':{'id':_[_0xbdc2('0x1f')](_0x887ca4,_0xbdc2('0x44')),'role':'agent'},'attributes':['id',_0xbdc2('0x1c'),_0xbdc2('0x45'),_0xbdc2('0x46'),'createdAt']});}})[_0xbdc2('0x16')](function(_0x58242a){if(_0x58242a){return{'count':_0x58242a['count'],'rows':_[_0xbdc2('0x1f')](_0x58242a[_0xbdc2('0x47')],function(_0x43eff1){return{'membername':_0x43eff1['name'],'UserId':_0x43eff1['id'],'queue_name':_0xc6be87[_0xbdc2('0x1c')],'ChatQueueId':_0xc6be87['id'],'interface':util[_0xbdc2('0x48')](_0xbdc2('0x49'),'SIP',_0x43eff1[_0xbdc2('0x1c')]),'penalty':0x0,'paused':_0x43eff1['chatPause'],'createdAt':_0x43eff1[_0xbdc2('0x4a')],'updatedAt':_0x43eff1[_0xbdc2('0x46')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbdc2('0x16')](respondWithFilteredResult(_0x3733d4,_0x266c61))[_0xbdc2('0x28')](handleError(_0x3733d4,null));};exports['getTeams']=function(_0x362f58,_0x2a6ba3){var _0xb19c24={};var _0x5681a9={};var _0x5be75c;var _0x1289d1;return db[_0xbdc2('0x20')][_0xbdc2('0x3c')]({'where':{'id':_0x362f58['params']['id']}})['then'](handleEntityNotFound(_0x2a6ba3,null))[_0xbdc2('0x16')](function(_0x56780){if(_0x56780){_0x5be75c=_0x56780;_0x5681a9['model']=_[_0xbdc2('0x2c')](db[_0xbdc2('0x4b')][_0xbdc2('0x21')]);_0x5681a9[_0xbdc2('0x2d')]=_['keys'](_0x362f58['query']);_0x5681a9[_0xbdc2('0x3e')]=_['intersection'](_0x5681a9[_0xbdc2('0x2b')],_0x5681a9[_0xbdc2('0x2d')]);_0xb19c24[_0xbdc2('0x2f')]=_['intersection'](_0x5681a9[_0xbdc2('0x2b')],qs[_0xbdc2('0x30')](_0x362f58['query'][_0xbdc2('0x30')]));_0xb19c24[_0xbdc2('0x2f')]=_0xb19c24[_0xbdc2('0x2f')]['length']?_0xb19c24[_0xbdc2('0x2f')]:_0x5681a9[_0xbdc2('0x2b')];_0xb19c24[_0xbdc2('0x4c')]=qs[_0xbdc2('0x41')](_0x362f58[_0xbdc2('0x2d')][_0xbdc2('0x41')]);_0xb19c24[_0xbdc2('0x42')]=qs[_0xbdc2('0x3e')](_[_0xbdc2('0x4d')](_0x362f58[_0xbdc2('0x2d')],_0x5681a9[_0xbdc2('0x3e')]));if(_0x362f58['query'][_0xbdc2('0x4e')]){_0xb19c24['where']=_[_0xbdc2('0x32')](_0xb19c24[_0xbdc2('0x42')],{'$or':_['map'](_0xb19c24[_0xbdc2('0x2f')],function(_0x2aa285){var _0x357539={};_0x357539[_0x2aa285]={'$like':'%'+_0x362f58['query'][_0xbdc2('0x4e')]+'%'};return _0x357539;})});}_0xb19c24=_[_0xbdc2('0x32')]({},_0xb19c24,_0x362f58[_0xbdc2('0x33')]);return _0x5be75c[_0xbdc2('0x4f')](_0xb19c24);}})[_0xbdc2('0x16')](function(_0x21faf8){if(_0x21faf8){_0x1289d1=_0x21faf8[_0xbdc2('0x50')];if(!_0x362f58[_0xbdc2('0x2d')][_0xbdc2('0x3f')](_0xbdc2('0x40'))){_0xb19c24[_0xbdc2('0xf')]=qs[_0xbdc2('0xf')](_0x362f58['query']['limit']);_0xb19c24[_0xbdc2('0xe')]=qs[_0xbdc2('0xe')](_0x362f58[_0xbdc2('0x2d')][_0xbdc2('0xe')]);}return _0x5be75c['getTeams'](_0xb19c24);}})[_0xbdc2('0x16')](function(_0x4962b8){if(_0x4962b8){return _0x4962b8?{'count':_0x1289d1,'rows':_0x4962b8}:null;}})['then'](respondWithResult(_0x2a6ba3,null))[_0xbdc2('0x28')](handleError(_0x2a6ba3,null));};exports['addTeams']=function(_0x34a0f8,_0x4e2c2d){var _0x24fbfa=_0x34a0f8['body'][_0xbdc2('0x51')];return db[_0xbdc2('0x4b')]['findAll']({'where':{'id':_0x24fbfa},'attributes':['id'],'include':[{'model':db[_0xbdc2('0x43')],'as':'Agents','attributes':['id',_0xbdc2('0x1c'),_0xbdc2('0x52'),_0xbdc2('0x53'),_0xbdc2('0x54')],'raw':!![]}]})[_0xbdc2('0x16')](function(_0x33b504){if(_0x33b504){var _0xc48eb6=_[_0xbdc2('0x55')](_0x33b504,function(_0x3ca6a1){var _0x44d04e=_0x3ca6a1[_0xbdc2('0x17')]({'plain':!![]});return _0x44d04e['Agents'];});return db[_0xbdc2('0x20')][_0xbdc2('0x34')]({'where':{'id':_0x34a0f8[_0xbdc2('0x2a')]['id']}})[_0xbdc2('0x16')](function(_0x458979){return db['sequelize'][_0xbdc2('0x56')](function(_0x5b63df){return _0x458979[_0xbdc2('0x57')](_0x24fbfa,{'transaction':_0x5b63df})[_0xbdc2('0x16')](function(){return BPromise[_0xbdc2('0x58')](_0xc48eb6,function(_0x1d5ed2){return db[_0xbdc2('0x3d')][_0xbdc2('0x59')]({'where':{'UserId':_0x1d5ed2['id'],'ChatQueueId':_0x34a0f8[_0xbdc2('0x2a')]['id']},'transaction':_0x5b63df});});})[_0xbdc2('0x16')](function(){_0xc48eb6[_0xbdc2('0x5a')](function(_0x3fb7f1){socket[_0xbdc2('0x5b')]('userChatQueue:save',{'UserId':_0x3fb7f1['id'],'ChatQueueId':_0x458979['id']});});});});});}})[_0xbdc2('0x16')](respondWithStatusCode(_0x4e2c2d,null))['catch'](handleError(_0x4e2c2d,null));};exports[_0xbdc2('0x5c')]=function(_0x30700f,_0x182cae){return db[_0xbdc2('0x4b')]['findAll']({'where':{'id':_0x30700f[_0xbdc2('0x2d')][_0xbdc2('0x51')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x182cae,null))['then'](function(_0x292e79){var _0xecf9d7=_[_0xbdc2('0x1f')](_0x292e79,'id');var _0x32b137=[];var _0x17303c=[];var _0x448ad6=squel[_0xbdc2('0x5d')]();_0x448ad6[_0xbdc2('0x5e')](_0xbdc2('0x5f'))[_0xbdc2('0x60')](_0xbdc2('0x61'),'tq')[_0xbdc2('0x62')]('user_has_teams','ut',_0xbdc2('0x63'))['where'](_0xbdc2('0x64'),_0x30700f[_0xbdc2('0x2a')]['id']);for(var _0x3cf7d9=0x0;_0x3cf7d9<_0x292e79[_0xbdc2('0x50')];_0x3cf7d9+=0x1){let _0x2cfcbf=_0x292e79[_0x3cf7d9];for(var _0x73afe1=0x0;_0x73afe1<_0x2cfcbf[_0xbdc2('0x65')][_0xbdc2('0x50')];_0x73afe1+=0x1){let _0x21d9e0=_0x2cfcbf[_0xbdc2('0x65')][_0x73afe1];var _0x2a2aa4=_0x448ad6['clone']();_0x2a2aa4['where'](_0xbdc2('0x66'),_0x21d9e0['id']);_0x17303c[_0xbdc2('0x67')](db[_0xbdc2('0x68')][_0xbdc2('0x2d')](_0x2a2aa4[_0xbdc2('0x69')](),{'type':db[_0xbdc2('0x68')][_0xbdc2('0x6a')][_0xbdc2('0x6b')]})[_0xbdc2('0x16')](function(_0x1e8cab){if(_0x1e8cab[_0xbdc2('0x50')]===0x1){return _0x21d9e0['id'];}else{var _0x3b48e5=_['every'](_['map'](_0x1e8cab,_0xbdc2('0x6c')),function(_0x46fc79){return _[_0xbdc2('0x6d')](_0xecf9d7,_0x46fc79);});if(_0x3b48e5){return _0x21d9e0['id'];}}}));}}return BPromise[_0xbdc2('0x6e')](_0x17303c)[_0xbdc2('0x16')](function(_0x21dd49){_0x32b137=_(_0x32b137)[_0xbdc2('0x6f')](_0x21dd49)[_0xbdc2('0x70')]()[_0xbdc2('0x71')]();return db[_0xbdc2('0x20')][_0xbdc2('0x34')]({'where':{'id':_0x30700f['params']['id']}})[_0xbdc2('0x16')](function(_0x4df595){return db['sequelize']['transaction'](function(_0x39d64f){return _0x4df595[_0xbdc2('0x5c')](_0x30700f[_0xbdc2('0x2d')]['ids'],{'transaction':_0x39d64f})[_0xbdc2('0x16')](function(){if(!_['isEmpty'](_0x32b137)){return _0x4df595[_0xbdc2('0x72')](_0x32b137,{'transaction':_0x39d64f});}})[_0xbdc2('0x16')](function(){_0x32b137[_0xbdc2('0x5a')](function(_0x4a941a){socket[_0xbdc2('0x5b')](_0xbdc2('0x73'),{'UserId':_0x4a941a,'ChatQueueId':_0x4df595['id']});});});});});});})[_0xbdc2('0x16')](respondWithStatusCode(_0x182cae,null))[_0xbdc2('0x28')](handleError(_0x182cae,null));};exports[_0xbdc2('0x74')]=function(_0x22b82,_0x1cd65c){return db[_0xbdc2('0x20')][_0xbdc2('0x34')]({'where':{'id':_0x22b82[_0xbdc2('0x2a')]['id']}})[_0xbdc2('0x16')](handleEntityNotFound(_0x1cd65c,null))[_0xbdc2('0x16')](function(_0x58937a){if(_0x58937a){return _0x58937a['addAgents'](_0x22b82[_0xbdc2('0x36')]['ids'],_[_0xbdc2('0x75')](_0x22b82[_0xbdc2('0x36')],[_0xbdc2('0x51'),'id'])||{})['spread'](function(_0xd0e7ac){for(var _0x1b41c5=0x0;_0x1b41c5<_0x22b82[_0xbdc2('0x36')][_0xbdc2('0x51')][_0xbdc2('0x50')];_0x1b41c5+=0x1){socket['emit'](_0xbdc2('0x76'),{'UserId':Number(_0x22b82[_0xbdc2('0x36')]['ids'][_0x1b41c5]),'ChatQueueId':Number(_0x22b82[_0xbdc2('0x2a')]['id'])});}return _0xd0e7ac;});}})['then'](respondWithResult(_0x1cd65c,null))[_0xbdc2('0x28')](handleError(_0x1cd65c,null));};exports[_0xbdc2('0x72')]=function(_0x22bc7b,_0x3c4822){return db[_0xbdc2('0x20')][_0xbdc2('0x34')]({'where':{'id':_0x22bc7b[_0xbdc2('0x2a')]['id']}})[_0xbdc2('0x16')](handleEntityNotFound(_0x3c4822,null))[_0xbdc2('0x16')](function(_0x309ddc){if(_0x309ddc){return _0x309ddc[_0xbdc2('0x72')](_0x22bc7b[_0xbdc2('0x2d')][_0xbdc2('0x51')])[_0xbdc2('0x16')](function(){if(_[_0xbdc2('0x77')](_0x22bc7b['query'][_0xbdc2('0x51')])){for(var _0x322c57=0x0;_0x322c57<_0x22bc7b[_0xbdc2('0x2d')][_0xbdc2('0x51')][_0xbdc2('0x50')];_0x322c57+=0x1){socket[_0xbdc2('0x5b')](_0xbdc2('0x73'),{'UserId':Number(_0x22bc7b['query'][_0xbdc2('0x51')][_0x322c57]),'ChatQueueId':Number(_0x22bc7b['params']['id'])});}}else{socket[_0xbdc2('0x5b')](_0xbdc2('0x73'),{'UserId':Number(_0x22bc7b[_0xbdc2('0x2d')][_0xbdc2('0x51')]),'ChatQueueId':Number(_0x22bc7b[_0xbdc2('0x2a')]['id'])});}});}})[_0xbdc2('0x16')](respondWithStatusCode(_0x3c4822,null))[_0xbdc2('0x28')](handleError(_0x3c4822,null));};exports['getAgents']=function(_0x18d501,_0x1eda3a){var _0x3948aa={};var _0x22b9c8={};var _0x178d7;var _0x49940b;return db[_0xbdc2('0x20')][_0xbdc2('0x3c')]({'where':{'id':_0x18d501['params']['id']}})[_0xbdc2('0x16')](handleEntityNotFound(_0x1eda3a,null))['then'](function(_0x2e09dc){if(_0x2e09dc){_0x178d7=_0x2e09dc;_0x22b9c8[_0xbdc2('0x2b')]=_[_0xbdc2('0x2c')](db[_0xbdc2('0x43')][_0xbdc2('0x21')]);_0x22b9c8[_0xbdc2('0x2d')]=_['keys'](_0x18d501[_0xbdc2('0x2d')]);_0x22b9c8[_0xbdc2('0x3e')]=_[_0xbdc2('0x2e')](_0x22b9c8['model'],_0x22b9c8['query']);_0x3948aa['attributes']=_[_0xbdc2('0x2e')](_0x22b9c8[_0xbdc2('0x2b')],qs[_0xbdc2('0x30')](_0x18d501[_0xbdc2('0x2d')][_0xbdc2('0x30')]));_0x3948aa[_0xbdc2('0x2f')]=_0x3948aa[_0xbdc2('0x2f')]['length']?_0x3948aa[_0xbdc2('0x2f')]:_0x22b9c8[_0xbdc2('0x2b')];_0x3948aa[_0xbdc2('0x4c')]=qs[_0xbdc2('0x41')](_0x18d501[_0xbdc2('0x2d')][_0xbdc2('0x41')]);_0x3948aa[_0xbdc2('0x42')]=qs['filters'](_[_0xbdc2('0x4d')](_0x18d501['query'],_0x22b9c8[_0xbdc2('0x3e')]));if(_0x18d501['query'][_0xbdc2('0x4e')]){_0x3948aa[_0xbdc2('0x42')]=_[_0xbdc2('0x32')](_0x3948aa[_0xbdc2('0x42')],{'$or':_['map'](_0x3948aa['attributes'],function(_0x4157c6){var _0xbe3097={};_0xbe3097[_0x4157c6]={'$like':'%'+_0x18d501[_0xbdc2('0x2d')]['filter']+'%'};return _0xbe3097;})});}_0x3948aa=_[_0xbdc2('0x32')]({},_0x3948aa,_0x18d501['options']);return _0x178d7['getAgents'](_0x3948aa);}})[_0xbdc2('0x16')](function(_0x5f2672){if(_0x5f2672){_0x49940b=_0x5f2672[_0xbdc2('0x50')];if(!_0x18d501[_0xbdc2('0x2d')][_0xbdc2('0x3f')](_0xbdc2('0x40'))){_0x3948aa['limit']=qs[_0xbdc2('0xf')](_0x18d501[_0xbdc2('0x2d')]['limit']);_0x3948aa[_0xbdc2('0xe')]=qs[_0xbdc2('0xe')](_0x18d501['query'][_0xbdc2('0xe')]);}return _0x178d7[_0xbdc2('0x78')](_0x3948aa);}})[_0xbdc2('0x16')](function(_0x315cba){if(_0x315cba){return _0x315cba?{'count':_0x49940b,'rows':_0x315cba}:null;}})[_0xbdc2('0x16')](respondWithResult(_0x1eda3a,null))[_0xbdc2('0x28')](handleError(_0x1eda3a,null));};
\ No newline at end of file
+var _0xdf87=['index','map','ChatQueue','rawAttributes','fieldName','type','key','where','include','query','findAll','params','model','keys','filters','intersection','fields','attributes','length','includeAll','merge','options','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','nolimit','order','sort','pick','ChatQueueId','filter','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','addTeams','ids','online','voicePause','Agents','transaction','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','TeamId','includes','union','compact','value','isEmpty','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','hasOwnProperty','bluebird','util','squel','../../config/logger','../../config/environment','redis','defaults','socket.io-emitter','./chatQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','ChatQueues','UserProfileResource','error','stack','name'];(function(_0x2794e4,_0x11bcf6){var _0xf860d4=function(_0x1ef56e){while(--_0x1ef56e){_0x2794e4['push'](_0x2794e4['shift']());}};_0xf860d4(++_0x11bcf6);}(_0xdf87,0x14a));var _0x7df8=function(_0x15c0dd,_0x5dcc24){_0x15c0dd=_0x15c0dd-0x0;var _0x4a0d6d=_0xdf87[_0x15c0dd];return _0x4a0d6d;};'use strict';var BPromise=require(_0x7df8('0x0'));var util=require(_0x7df8('0x1'));var _=require('lodash');var squel=require(_0x7df8('0x2'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x7df8('0x3'))('api');var config=require(_0x7df8('0x4'));var db=require('../../mysqldb')['db'];config[_0x7df8('0x5')]=_[_0x7df8('0x6')](config[_0x7df8('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x7df8('0x7'))(new Redis(config[_0x7df8('0x5')]));require(_0x7df8('0x8'))[_0x7df8('0x9')](socket);function respondWithStatusCode(_0x41c3d9,_0x4bcad8){_0x4bcad8=_0x4bcad8||0xcc;return function(_0x14a38c){if(_0x14a38c){return _0x41c3d9['sendStatus'](_0x4bcad8);}return _0x41c3d9[_0x7df8('0xa')](_0x4bcad8)[_0x7df8('0xb')]();};}function respondWithResult(_0x136119,_0x3f2154){_0x3f2154=_0x3f2154||0xc8;return function(_0x41eeec){if(_0x41eeec){return _0x136119[_0x7df8('0xa')](_0x3f2154)[_0x7df8('0xc')](_0x41eeec);}};}function respondWithFilteredResult(_0x814a7,_0x2494db){return function(_0x116cb9){if(_0x116cb9){var _0x57cd20=typeof _0x2494db[_0x7df8('0xd')]===_0x7df8('0xe')&&typeof _0x2494db[_0x7df8('0xf')]===_0x7df8('0xe');var _0x43d424=_0x116cb9[_0x7df8('0x10')];var _0xfaac8b=_0x57cd20?0x0:_0x2494db['offset'];var _0x3b7b80=_0x57cd20?_0x116cb9['count']:_0x2494db[_0x7df8('0xd')]+_0x2494db[_0x7df8('0xf')];var _0x3b76bb;if(_0x3b7b80>=_0x43d424){_0x3b7b80=_0x43d424;_0x3b76bb=0xc8;}else{_0x3b76bb=0xce;}_0x814a7[_0x7df8('0xa')](_0x3b76bb);return _0x814a7[_0x7df8('0x11')](_0x7df8('0x12'),_0xfaac8b+'-'+_0x3b7b80+'/'+_0x43d424)['json'](_0x116cb9);}return null;};}function saveUpdates(_0x26ff58){return function(_0x1cf5ec){if(_0x1cf5ec){return _0x1cf5ec[_0x7df8('0x13')](_0x26ff58)[_0x7df8('0x14')](function(_0x25235e){return _0x25235e;});}return null;};}function removeEntity(_0x20a61c){return function(_0x13503f){if(_0x13503f){return _0x13503f[_0x7df8('0x15')]()[_0x7df8('0x14')](function(){var _0x23a45b=_0x13503f['get']({'plain':!![]});var _0x215042=_0x7df8('0x16');return db[_0x7df8('0x17')][_0x7df8('0x15')]({'where':{'type':_0x215042,'resourceId':_0x23a45b['id']}})[_0x7df8('0x14')](function(){return _0x13503f;});})['then'](function(){_0x20a61c['status'](0xcc)[_0x7df8('0xb')]();});}};}function handleEntityNotFound(_0x3c2da9){return function(_0xb6d3f0){if(!_0xb6d3f0){_0x3c2da9['sendStatus'](0x194);}return _0xb6d3f0;};}function handleError(_0x11ed17,_0x351135){_0x351135=_0x351135||0x1f4;return function(_0x59d95b){logger[_0x7df8('0x18')](_0x59d95b[_0x7df8('0x19')]);if(_0x59d95b[_0x7df8('0x1a')]){delete _0x59d95b['name'];}_0x11ed17['status'](_0x351135)['send'](_0x59d95b);};}exports[_0x7df8('0x1b')]=function(_0x4fb9f5,_0x309f34){var _0x46adbd={};var _0x5c2600={'count':0x0,'rows':[]};var _0x4af6d3=_[_0x7df8('0x1c')](db[_0x7df8('0x1d')][_0x7df8('0x1e')],function(_0x583739){return{'name':_0x583739[_0x7df8('0x1f')],'type':_0x583739[_0x7df8('0x20')][_0x7df8('0x21')]};});_0x46adbd=qs['getOptions'](_0x4af6d3,_0x4fb9f5);var _0x1b6f90={'where':_0x46adbd[_0x7df8('0x22')]};return db[_0x7df8('0x1d')][_0x7df8('0x10')](_0x1b6f90)[_0x7df8('0x14')](function(_0x15a6b0){_0x5c2600[_0x7df8('0x10')]=_0x15a6b0;_0x46adbd[_0x7df8('0x23')]=qs[_0x7df8('0x23')](_0x4fb9f5[_0x7df8('0x24')]);return db[_0x7df8('0x1d')][_0x7df8('0x25')](_0x46adbd);})[_0x7df8('0x14')](function(_0x2653db){_0x5c2600['rows']=_0x2653db;return _0x5c2600;})[_0x7df8('0x14')](respondWithFilteredResult(_0x309f34,_0x46adbd))['catch'](handleError(_0x309f34,null));};exports['show']=function(_0x2cf751,_0x5d6a2e){var _0x22f9d1={'raw':!![],'where':{'id':_0x2cf751[_0x7df8('0x26')]['id']}},_0xa6e745={};_0xa6e745[_0x7df8('0x27')]=_[_0x7df8('0x28')](db['ChatQueue'][_0x7df8('0x1e')]);_0xa6e745[_0x7df8('0x24')]=_[_0x7df8('0x28')](_0x2cf751[_0x7df8('0x24')]);_0xa6e745[_0x7df8('0x29')]=_[_0x7df8('0x2a')](_0xa6e745['model'],_0xa6e745[_0x7df8('0x24')]);_0x22f9d1['attributes']=_[_0x7df8('0x2a')](_0xa6e745['model'],qs[_0x7df8('0x2b')](_0x2cf751[_0x7df8('0x24')][_0x7df8('0x2b')]));_0x22f9d1['attributes']=_0x22f9d1[_0x7df8('0x2c')][_0x7df8('0x2d')]?_0x22f9d1[_0x7df8('0x2c')]:_0xa6e745['model'];if(_0x2cf751['query'][_0x7df8('0x2e')]){_0x22f9d1[_0x7df8('0x23')]=[{'all':!![]}];}_0x22f9d1=_[_0x7df8('0x2f')]({},_0x22f9d1,_0x2cf751[_0x7df8('0x30')]);return db[_0x7df8('0x1d')][_0x7df8('0x31')](_0x22f9d1)[_0x7df8('0x14')](handleEntityNotFound(_0x5d6a2e,null))[_0x7df8('0x14')](respondWithResult(_0x5d6a2e,null))[_0x7df8('0x32')](handleError(_0x5d6a2e,null));};exports[_0x7df8('0x33')]=function(_0x2e0fc9,_0x591239){return db[_0x7df8('0x1d')]['create'](_0x2e0fc9[_0x7df8('0x34')],{})[_0x7df8('0x14')](function(_0x31f646){var _0x187a06=_0x2e0fc9[_0x7df8('0x35')][_0x7df8('0x36')]({'plain':!![]});if(!_0x187a06)throw new Error(_0x7df8('0x37'));if(_0x187a06['role']===_0x7df8('0x35')){var _0x3a64c4=_0x31f646[_0x7df8('0x36')]({'plain':!![]});var _0x5219f6=_0x7df8('0x16');return db['UserProfileSection']['find']({'where':{'name':_0x5219f6,'userProfileId':_0x187a06[_0x7df8('0x38')]},'raw':!![]})['then'](function(_0x3ebef1){if(_0x3ebef1&&_0x3ebef1[_0x7df8('0x39')]===0x0){return db[_0x7df8('0x17')][_0x7df8('0x33')]({'name':_0x3a64c4['name'],'resourceId':_0x3a64c4['id'],'type':_0x3ebef1[_0x7df8('0x1a')],'sectionId':_0x3ebef1['id']},{})[_0x7df8('0x14')](function(){return _0x31f646;});}else{return _0x31f646;}})[_0x7df8('0x32')](function(_0x112b61){logger[_0x7df8('0x18')](_0x7df8('0x3a'),_0x112b61);throw _0x112b61;});}return _0x31f646;})[_0x7df8('0x14')](respondWithResult(_0x591239,0xc9))[_0x7df8('0x32')](handleError(_0x591239,null));};exports[_0x7df8('0x13')]=function(_0xda559f,_0x2c33e7){if(_0xda559f['body']['id']){delete _0xda559f[_0x7df8('0x34')]['id'];}return db['ChatQueue'][_0x7df8('0x31')]({'where':{'id':_0xda559f['params']['id']}})['then'](handleEntityNotFound(_0x2c33e7,null))[_0x7df8('0x14')](saveUpdates(_0xda559f['body'],null))['then'](respondWithResult(_0x2c33e7,null))[_0x7df8('0x32')](handleError(_0x2c33e7,null));};exports['destroy']=function(_0x210191,_0x416555){return db['ChatQueue'][_0x7df8('0x31')]({'where':{'id':_0x210191[_0x7df8('0x26')]['id']}})[_0x7df8('0x14')](handleEntityNotFound(_0x416555,null))['then'](removeEntity(_0x416555,null))[_0x7df8('0x32')](handleError(_0x416555,null));};exports[_0x7df8('0x3b')]=function(_0x1ac2e0,_0x78f40f){return db[_0x7df8('0x1d')][_0x7df8('0x3b')]()[_0x7df8('0x14')](respondWithResult(_0x78f40f,null))['catch'](handleError(_0x78f40f,null));};exports[_0x7df8('0x3c')]=function(_0x4a474f,_0x31f8e7){var _0x4ff4b4={'raw':!![],'where':{}},_0x1f3552={},_0x46bb4e;return db[_0x7df8('0x1d')][_0x7df8('0x3d')]({'where':{'id':_0x4a474f[_0x7df8('0x26')]['id']}})['then'](handleEntityNotFound(_0x31f8e7,null))[_0x7df8('0x14')](function(_0x1b9537){if(_0x1b9537){_0x46bb4e=_0x1b9537['get']({'plain':!![]});_0x1f3552['model']=_[_0x7df8('0x28')](db[_0x7df8('0x3e')][_0x7df8('0x1e')]);_0x1f3552[_0x7df8('0x24')]=_['keys'](_0x4a474f[_0x7df8('0x24')]);_0x1f3552[_0x7df8('0x29')]=_[_0x7df8('0x2a')](_0x1f3552[_0x7df8('0x27')],_0x1f3552[_0x7df8('0x24')]);_0x4ff4b4[_0x7df8('0x2c')]=_[_0x7df8('0x2a')](_0x1f3552[_0x7df8('0x27')],qs['fields'](_0x4a474f['query']['fields']));_0x4ff4b4['attributes']=_0x4ff4b4[_0x7df8('0x2c')][_0x7df8('0x2d')]?_0x4ff4b4[_0x7df8('0x2c')]:_0x1f3552['model'];if(!_0x4a474f[_0x7df8('0x24')]['hasOwnProperty'](_0x7df8('0x3f'))){_0x4ff4b4[_0x7df8('0xf')]=qs[_0x7df8('0xf')](_0x4a474f[_0x7df8('0x24')][_0x7df8('0xf')]);_0x4ff4b4['offset']=qs[_0x7df8('0xd')](_0x4a474f[_0x7df8('0x24')][_0x7df8('0xd')]);}_0x4ff4b4[_0x7df8('0x40')]=qs[_0x7df8('0x41')](_0x4a474f[_0x7df8('0x24')][_0x7df8('0x41')]);_0x4ff4b4[_0x7df8('0x22')]=qs['filters'](_[_0x7df8('0x42')](_0x4a474f[_0x7df8('0x24')],_0x1f3552['filters']));_0x4ff4b4[_0x7df8('0x22')][_0x7df8('0x43')]=_0x1b9537['id'];if(_0x4a474f[_0x7df8('0x24')]['filter']){_0x4ff4b4['where']=_['merge'](_0x4ff4b4[_0x7df8('0x22')],{'$or':_[_0x7df8('0x1c')](_0x4ff4b4[_0x7df8('0x2c')],function(_0x34e9df){var _0x57548f={};_0x57548f[_0x34e9df]={'$like':'%'+_0x4a474f[_0x7df8('0x24')][_0x7df8('0x44')]+'%'};return _0x57548f;})});}_0x4ff4b4=_[_0x7df8('0x2f')]({},_0x4ff4b4,_0x4a474f['options']);return db['UserChatQueue']['findAll'](_0x4ff4b4);}})[_0x7df8('0x14')](function(_0x920684){if(_0x920684){return db[_0x7df8('0x45')][_0x7df8('0x46')]({'where':{'id':_[_0x7df8('0x1c')](_0x920684,_0x7df8('0x47')),'role':_0x7df8('0x48')},'attributes':['id','name',_0x7df8('0x49'),_0x7df8('0x4a'),_0x7df8('0x4b')]});}})['then'](function(_0x1ed50e){if(_0x1ed50e){return{'count':_0x1ed50e['count'],'rows':_[_0x7df8('0x1c')](_0x1ed50e[_0x7df8('0x4c')],function(_0x11817f){return{'membername':_0x11817f['name'],'UserId':_0x11817f['id'],'queue_name':_0x46bb4e[_0x7df8('0x1a')],'ChatQueueId':_0x46bb4e['id'],'interface':util[_0x7df8('0x4d')](_0x7df8('0x4e'),_0x7df8('0x4f'),_0x11817f['name']),'penalty':0x0,'paused':_0x11817f[_0x7df8('0x49')],'createdAt':_0x11817f[_0x7df8('0x4b')],'updatedAt':_0x11817f[_0x7df8('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x31f8e7,_0x4ff4b4))[_0x7df8('0x32')](handleError(_0x31f8e7,null));};exports[_0x7df8('0x50')]=function(_0x43c0a2,_0x59ea15){var _0x14b7c4={};var _0x5c7cde={};var _0x27d30a;var _0x1b0167;return db[_0x7df8('0x1d')]['findOne']({'where':{'id':_0x43c0a2['params']['id']}})[_0x7df8('0x14')](handleEntityNotFound(_0x59ea15,null))['then'](function(_0x1af887){if(_0x1af887){_0x27d30a=_0x1af887;_0x5c7cde[_0x7df8('0x27')]=_[_0x7df8('0x28')](db[_0x7df8('0x51')][_0x7df8('0x1e')]);_0x5c7cde[_0x7df8('0x24')]=_[_0x7df8('0x28')](_0x43c0a2[_0x7df8('0x24')]);_0x5c7cde[_0x7df8('0x29')]=_[_0x7df8('0x2a')](_0x5c7cde[_0x7df8('0x27')],_0x5c7cde['query']);_0x14b7c4['attributes']=_[_0x7df8('0x2a')](_0x5c7cde[_0x7df8('0x27')],qs[_0x7df8('0x2b')](_0x43c0a2[_0x7df8('0x24')][_0x7df8('0x2b')]));_0x14b7c4['attributes']=_0x14b7c4[_0x7df8('0x2c')][_0x7df8('0x2d')]?_0x14b7c4[_0x7df8('0x2c')]:_0x5c7cde['model'];_0x14b7c4[_0x7df8('0x40')]=qs[_0x7df8('0x41')](_0x43c0a2[_0x7df8('0x24')][_0x7df8('0x41')]);_0x14b7c4[_0x7df8('0x22')]=qs[_0x7df8('0x29')](_[_0x7df8('0x42')](_0x43c0a2[_0x7df8('0x24')],_0x5c7cde[_0x7df8('0x29')]));if(_0x43c0a2[_0x7df8('0x24')][_0x7df8('0x44')]){_0x14b7c4[_0x7df8('0x22')]=_[_0x7df8('0x2f')](_0x14b7c4[_0x7df8('0x22')],{'$or':_[_0x7df8('0x1c')](_0x14b7c4[_0x7df8('0x2c')],function(_0x5a2b39){var _0x263229={};_0x263229[_0x5a2b39]={'$like':'%'+_0x43c0a2['query'][_0x7df8('0x44')]+'%'};return _0x263229;})});}_0x14b7c4=_[_0x7df8('0x2f')]({},_0x14b7c4,_0x43c0a2[_0x7df8('0x30')]);return _0x27d30a[_0x7df8('0x50')](_0x14b7c4);}})[_0x7df8('0x14')](function(_0x4d9cbb){if(_0x4d9cbb){_0x1b0167=_0x4d9cbb[_0x7df8('0x2d')];if(!_0x43c0a2['query']['hasOwnProperty'](_0x7df8('0x3f'))){_0x14b7c4[_0x7df8('0xf')]=qs['limit'](_0x43c0a2['query']['limit']);_0x14b7c4[_0x7df8('0xd')]=qs[_0x7df8('0xd')](_0x43c0a2['query']['offset']);}return _0x27d30a[_0x7df8('0x50')](_0x14b7c4);}})[_0x7df8('0x14')](function(_0x1cda61){if(_0x1cda61){return _0x1cda61?{'count':_0x1b0167,'rows':_0x1cda61}:null;}})['then'](respondWithResult(_0x59ea15,null))[_0x7df8('0x32')](handleError(_0x59ea15,null));};exports[_0x7df8('0x52')]=function(_0x55925d,_0x1258cd){var _0x4eb59f=_0x55925d[_0x7df8('0x34')][_0x7df8('0x53')];return db[_0x7df8('0x51')][_0x7df8('0x25')]({'where':{'id':_0x4eb59f},'attributes':['id'],'include':[{'model':db[_0x7df8('0x45')],'as':'Agents','attributes':['id',_0x7df8('0x1a'),_0x7df8('0x54'),_0x7df8('0x55'),'interface'],'raw':!![]}]})[_0x7df8('0x14')](function(_0x42ce0b){if(_0x42ce0b){var _0xa2c350=_['flatMap'](_0x42ce0b,function(_0x1bfa3c){var _0x321538=_0x1bfa3c[_0x7df8('0x36')]({'plain':!![]});return _0x321538[_0x7df8('0x56')];});return db['ChatQueue']['find']({'where':{'id':_0x55925d['params']['id']}})[_0x7df8('0x14')](function(_0x430293){return db['sequelize'][_0x7df8('0x57')](function(_0x38a856){return _0x430293[_0x7df8('0x52')](_0x4eb59f,{'transaction':_0x38a856})['then'](function(){return BPromise['each'](_0xa2c350,function(_0xe528d){return db[_0x7df8('0x3e')][_0x7df8('0x58')]({'where':{'UserId':_0xe528d['id'],'ChatQueueId':_0x55925d[_0x7df8('0x26')]['id']},'transaction':_0x38a856});});})[_0x7df8('0x14')](function(){_0xa2c350[_0x7df8('0x59')](function(_0x3627f2){socket[_0x7df8('0x5a')](_0x7df8('0x5b'),{'UserId':_0x3627f2['id'],'ChatQueueId':_0x430293['id']});});});});});}})[_0x7df8('0x14')](respondWithStatusCode(_0x1258cd,null))[_0x7df8('0x32')](handleError(_0x1258cd,null));};exports[_0x7df8('0x5c')]=function(_0x357cc2,_0x34a8d3){return db[_0x7df8('0x51')][_0x7df8('0x25')]({'where':{'id':_0x357cc2[_0x7df8('0x24')][_0x7df8('0x53')]},'attributes':['id'],'include':[{'model':db[_0x7df8('0x45')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x7df8('0x14')](handleEntityNotFound(_0x34a8d3,null))[_0x7df8('0x14')](function(_0xd65835){var _0x3fc871=_['map'](_0xd65835,'id');var _0x3742ed=[];var _0x47bfdb=[];var _0x4accc5=squel[_0x7df8('0x5d')]();_0x4accc5[_0x7df8('0x5e')](_0x7df8('0x5f'))[_0x7df8('0x60')](_0x7df8('0x61'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7df8('0x22')](_0x7df8('0x62'),_0x357cc2[_0x7df8('0x26')]['id']);for(var _0x11f13f=0x0;_0x11f13f<_0xd65835[_0x7df8('0x2d')];_0x11f13f+=0x1){let _0x5270a8=_0xd65835[_0x11f13f];for(var _0x1667d9=0x0;_0x1667d9<_0x5270a8[_0x7df8('0x56')][_0x7df8('0x2d')];_0x1667d9+=0x1){let _0xd6dc75=_0x5270a8[_0x7df8('0x56')][_0x1667d9];var _0x55bca0=_0x4accc5[_0x7df8('0x63')]();_0x55bca0[_0x7df8('0x22')](_0x7df8('0x64'),_0xd6dc75['id']);_0x47bfdb[_0x7df8('0x65')](db[_0x7df8('0x66')][_0x7df8('0x24')](_0x55bca0['toString'](),{'type':db[_0x7df8('0x66')][_0x7df8('0x67')][_0x7df8('0x68')]})[_0x7df8('0x14')](function(_0x518a6c){if(_0x518a6c['length']===0x1){return _0xd6dc75['id'];}else{var _0x2a8a51=_['every'](_[_0x7df8('0x1c')](_0x518a6c,_0x7df8('0x69')),function(_0x8cddbb){return _[_0x7df8('0x6a')](_0x3fc871,_0x8cddbb);});if(_0x2a8a51){return _0xd6dc75['id'];}}}));}}return BPromise['all'](_0x47bfdb)[_0x7df8('0x14')](function(_0x1480db){_0x3742ed=_(_0x3742ed)[_0x7df8('0x6b')](_0x1480db)[_0x7df8('0x6c')]()[_0x7df8('0x6d')]();return db[_0x7df8('0x1d')][_0x7df8('0x31')]({'where':{'id':_0x357cc2[_0x7df8('0x26')]['id']}})['then'](function(_0x29d406){return db[_0x7df8('0x66')]['transaction'](function(_0x15d3c7){return _0x29d406['removeTeams'](_0x357cc2[_0x7df8('0x24')][_0x7df8('0x53')],{'transaction':_0x15d3c7})[_0x7df8('0x14')](function(){if(!_[_0x7df8('0x6e')](_0x3742ed)){return _0x29d406['removeAgents'](_0x3742ed,{'transaction':_0x15d3c7});}})[_0x7df8('0x14')](function(){_0x3742ed[_0x7df8('0x59')](function(_0x2f5e29){socket[_0x7df8('0x5a')](_0x7df8('0x6f'),{'UserId':_0x2f5e29,'ChatQueueId':_0x29d406['id']});});});});});});})[_0x7df8('0x14')](respondWithStatusCode(_0x34a8d3,null))['catch'](handleError(_0x34a8d3,null));};exports[_0x7df8('0x70')]=function(_0x2fe050,_0x3c422){return db[_0x7df8('0x1d')][_0x7df8('0x31')]({'where':{'id':_0x2fe050[_0x7df8('0x26')]['id']}})[_0x7df8('0x14')](handleEntityNotFound(_0x3c422,null))['then'](function(_0x26da58){if(_0x26da58){return _0x26da58[_0x7df8('0x70')](_0x2fe050['body']['ids'],_[_0x7df8('0x71')](_0x2fe050[_0x7df8('0x34')],[_0x7df8('0x53'),'id'])||{})[_0x7df8('0x72')](function(_0x1420ec){for(var _0x28d831=0x0;_0x28d831<_0x2fe050['body']['ids']['length'];_0x28d831+=0x1){socket[_0x7df8('0x5a')]('userChatQueue:save',{'UserId':Number(_0x2fe050[_0x7df8('0x34')][_0x7df8('0x53')][_0x28d831]),'ChatQueueId':Number(_0x2fe050[_0x7df8('0x26')]['id'])});}return _0x1420ec;});}})[_0x7df8('0x14')](respondWithResult(_0x3c422,null))[_0x7df8('0x32')](handleError(_0x3c422,null));};exports[_0x7df8('0x73')]=function(_0x293998,_0x1e2375){return db[_0x7df8('0x1d')]['find']({'where':{'id':_0x293998[_0x7df8('0x26')]['id']}})[_0x7df8('0x14')](handleEntityNotFound(_0x1e2375,null))[_0x7df8('0x14')](function(_0x423dc4){if(_0x423dc4){return _0x423dc4[_0x7df8('0x73')](_0x293998[_0x7df8('0x24')][_0x7df8('0x53')])[_0x7df8('0x14')](function(){if(_[_0x7df8('0x74')](_0x293998[_0x7df8('0x24')][_0x7df8('0x53')])){for(var _0x1127ae=0x0;_0x1127ae<_0x293998[_0x7df8('0x24')][_0x7df8('0x53')][_0x7df8('0x2d')];_0x1127ae+=0x1){socket[_0x7df8('0x5a')]('userChatQueue:remove',{'UserId':Number(_0x293998[_0x7df8('0x24')][_0x7df8('0x53')][_0x1127ae]),'ChatQueueId':Number(_0x293998[_0x7df8('0x26')]['id'])});}}else{socket[_0x7df8('0x5a')](_0x7df8('0x6f'),{'UserId':Number(_0x293998[_0x7df8('0x24')][_0x7df8('0x53')]),'ChatQueueId':Number(_0x293998['params']['id'])});}});}})[_0x7df8('0x14')](respondWithStatusCode(_0x1e2375,null))['catch'](handleError(_0x1e2375,null));};exports[_0x7df8('0x75')]=function(_0xd3a60f,_0xd826de){var _0x3292ba={};var _0xba95={};var _0x505904;var _0x13e8a6;return db[_0x7df8('0x1d')][_0x7df8('0x3d')]({'where':{'id':_0xd3a60f[_0x7df8('0x26')]['id']}})[_0x7df8('0x14')](handleEntityNotFound(_0xd826de,null))[_0x7df8('0x14')](function(_0x247615){if(_0x247615){_0x505904=_0x247615;_0xba95[_0x7df8('0x27')]=_[_0x7df8('0x28')](db[_0x7df8('0x45')][_0x7df8('0x1e')]);_0xba95[_0x7df8('0x24')]=_[_0x7df8('0x28')](_0xd3a60f['query']);_0xba95['filters']=_[_0x7df8('0x2a')](_0xba95[_0x7df8('0x27')],_0xba95[_0x7df8('0x24')]);_0x3292ba[_0x7df8('0x2c')]=_[_0x7df8('0x2a')](_0xba95[_0x7df8('0x27')],qs[_0x7df8('0x2b')](_0xd3a60f[_0x7df8('0x24')][_0x7df8('0x2b')]));_0x3292ba[_0x7df8('0x2c')]=_0x3292ba[_0x7df8('0x2c')][_0x7df8('0x2d')]?_0x3292ba[_0x7df8('0x2c')]:_0xba95['model'];_0x3292ba['order']=qs['sort'](_0xd3a60f[_0x7df8('0x24')][_0x7df8('0x41')]);_0x3292ba[_0x7df8('0x22')]=qs[_0x7df8('0x29')](_[_0x7df8('0x42')](_0xd3a60f[_0x7df8('0x24')],_0xba95['filters']));if(_0xd3a60f[_0x7df8('0x24')][_0x7df8('0x44')]){_0x3292ba[_0x7df8('0x22')]=_['merge'](_0x3292ba[_0x7df8('0x22')],{'$or':_[_0x7df8('0x1c')](_0x3292ba[_0x7df8('0x2c')],function(_0x51efbe){var _0x4be41a={};_0x4be41a[_0x51efbe]={'$like':'%'+_0xd3a60f[_0x7df8('0x24')][_0x7df8('0x44')]+'%'};return _0x4be41a;})});}_0x3292ba=_[_0x7df8('0x2f')]({},_0x3292ba,_0xd3a60f[_0x7df8('0x30')]);return _0x505904[_0x7df8('0x75')](_0x3292ba);}})['then'](function(_0x363357){if(_0x363357){_0x13e8a6=_0x363357[_0x7df8('0x2d')];if(!_0xd3a60f['query'][_0x7df8('0x76')](_0x7df8('0x3f'))){_0x3292ba['limit']=qs[_0x7df8('0xf')](_0xd3a60f['query'][_0x7df8('0xf')]);_0x3292ba[_0x7df8('0xd')]=qs[_0x7df8('0xd')](_0xd3a60f[_0x7df8('0x24')][_0x7df8('0xd')]);}return _0x505904[_0x7df8('0x75')](_0x3292ba);}})[_0x7df8('0x14')](function(_0x1144e3){if(_0x1144e3){return _0x1144e3?{'count':_0x13e8a6,'rows':_0x1144e3}:null;}})['then'](respondWithResult(_0xd826de,null))['catch'](handleError(_0xd826de,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 4727016..afe1065 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 _0x0141=['../../mysqldb','ChatQueue','save','update','remove','emit','hook','exports','events'];(function(_0x277541,_0x5e4f04){var _0x531d89=function(_0x151a5b){while(--_0x151a5b){_0x277541['push'](_0x277541['shift']());}};_0x531d89(++_0x5e4f04);}(_0x0141,0x104));var _0x1014=function(_0x4a7501,_0x135d07){_0x4a7501=_0x4a7501-0x0;var _0x5b1a76=_0x0141[_0x4a7501];return _0x5b1a76;};'use strict';var EventEmitter=require(_0x1014('0x0'));var ChatQueue=require(_0x1014('0x1'))['db'][_0x1014('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1014('0x3'),'afterUpdate':_0x1014('0x4'),'afterDestroy':_0x1014('0x5')};function emitEvent(_0x5ef913){return function(_0x4748e7,_0x127683,_0x3d66ae){ChatQueueEvents[_0x1014('0x6')](_0x5ef913+':'+_0x4748e7['id'],_0x4748e7);ChatQueueEvents[_0x1014('0x6')](_0x5ef913,_0x4748e7);_0x3d66ae(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x1014('0x7')](e,emitEvent(event));}}module[_0x1014('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0xde84=['setMaxListeners','update','remove','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue'];(function(_0x4427c9,_0xb06e1c){var _0x1efc85=function(_0x462fd0){while(--_0x462fd0){_0x4427c9['push'](_0x4427c9['shift']());}};_0x1efc85(++_0xb06e1c);}(_0xde84,0x84));var _0x4de8=function(_0x7162ba,_0x44d30f){_0x7162ba=_0x7162ba-0x0;var _0x6526a0=_0xde84[_0x7162ba];return _0x6526a0;};'use strict';var EventEmitter=require(_0x4de8('0x0'));var ChatQueue=require(_0x4de8('0x1'))['db'][_0x4de8('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4de8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4de8('0x4'),'afterDestroy':_0x4de8('0x5')};function emitEvent(_0x39edc0){return function(_0x1fb457,_0x400e18,_0x1de6cf){ChatQueueEvents['emit'](_0x39edc0+':'+_0x1fb457['id'],_0x1fb457);ChatQueueEvents['emit'](_0x39edc0,_0x1fb457);_0x1de6cf(null);};}for(var e in events){if(events[_0x4de8('0x6')](e)){var event=events[e];ChatQueue[_0x4de8('0x7')](e,emitEvent(event));}}module[_0x4de8('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 547ea44..99b48cc 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 _0xc753=['request-promise','rimraf','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','util','../../config/logger','api','moment','bluebird'];(function(_0x38c5bb,_0x153bdb){var _0x5cbd09=function(_0xe17565){while(--_0xe17565){_0x38c5bb['push'](_0x38c5bb['shift']());}};_0x5cbd09(++_0x153bdb);}(_0xc753,0x193));var _0x3c75=function(_0x4cca37,_0x4319e6){_0x4cca37=_0x4cca37-0x0;var _0x365981=_0xc753[_0x4cca37];return _0x365981;};'use strict';var _=require('lodash');var util=require(_0x3c75('0x0'));var logger=require(_0x3c75('0x1'))(_0x3c75('0x2'));var moment=require(_0x3c75('0x3'));var BPromise=require(_0x3c75('0x4'));var rp=require(_0x3c75('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c75('0x6'));var config=require('../../config/environment');var attributes=require(_0x3c75('0x7'));module[_0x3c75('0x8')]=function(_0xb84f8e,_0x1c0134){return _0xb84f8e[_0x3c75('0x9')](_0x3c75('0xa'),attributes,{'tableName':_0x3c75('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe98a=['exports','define','ChatQueue','chat_queues','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0xe98a,0xb8));var _0xae98=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xe98a[_0x1035c1];return _0x308d67;};'use strict';var _=require('lodash');var util=require(_0xae98('0x0'));var logger=require(_0xae98('0x1'))(_0xae98('0x2'));var moment=require('moment');var BPromise=require(_0xae98('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xae98('0x4'));var rimraf=require(_0xae98('0x5'));var config=require(_0xae98('0x6'));var attributes=require(_0xae98('0x7'));module[_0xae98('0x8')]=function(_0x54cd18,_0x2f2a07){return _0x54cd18[_0xae98('0x9')](_0xae98('0xa'),attributes,{'tableName':_0xae98('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 9de173c..4abb097 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 _0x531a=['jayson/promise','http','redis','defaults','localhost','./chatQueue.socket','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','result','GetChatQueue','findAll','options','raw','where','attributes','limit','map','include','model','catch','ShowChatQueue','find','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xf16af5,_0x358d22){var _0x41d3f1=function(_0x168618){while(--_0x168618){_0xf16af5['push'](_0xf16af5['shift']());}};_0x41d3f1(++_0x358d22);}(_0x531a,0x100));var _0xa531=function(_0x35563c,_0x1393e9){_0x35563c=_0x35563c-0x0;var _0x2a763c=_0x531a[_0x35563c];return _0x2a763c;};'use strict';var _=require(_0xa531('0x0'));var util=require(_0xa531('0x1'));var moment=require(_0xa531('0x2'));var BPromise=require(_0xa531('0x3'));var rs=require(_0xa531('0x4'));var fs=require('fs');var Redis=require(_0xa531('0x5'));var db=require(_0xa531('0x6'))['db'];var utils=require(_0xa531('0x7'));var logger=require(_0xa531('0x8'))(_0xa531('0x9'));var config=require('../../config/environment');var jayson=require(_0xa531('0xa'));var client=jayson['client'][_0xa531('0xb')]({'port':0x232a});config[_0xa531('0xc')]=_[_0xa531('0xd')](config[_0xa531('0xc')],{'host':_0xa531('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa531('0xc')]));require(_0xa531('0xf'))['register'](socket);function respondWithRpcPromise(_0x190db4,_0x3eebc8,_0x10f6e0){return new BPromise(function(_0x3eb94f,_0x3e25a8){return client['request'](_0x190db4,_0x10f6e0)[_0xa531('0x10')](function(_0x4df80e){logger[_0xa531('0x11')](_0xa531('0x12'),_0x3eebc8,_0xa531('0x13'));logger['debug'](_0xa531('0x14'),_0x3eebc8,_0xa531('0x13'),JSON['stringify'](_0x4df80e));if(_0x4df80e[_0xa531('0x15')]){if(_0x4df80e[_0xa531('0x15')]['code']===0x1f4){logger[_0xa531('0x15')](_0xa531('0x12'),_0x3eebc8,_0x4df80e[_0xa531('0x15')]['message']);return _0x3e25a8(_0x4df80e['error']['message']);}logger[_0xa531('0x15')](_0xa531('0x12'),_0x3eebc8,_0x4df80e[_0xa531('0x15')][_0xa531('0x16')]);return _0x3eb94f(_0x4df80e[_0xa531('0x15')][_0xa531('0x16')]);}else{logger['info'](_0xa531('0x12'),_0x3eebc8,'request\x20sent');_0x3eb94f(_0x4df80e[_0xa531('0x17')][_0xa531('0x16')]);}})['catch'](function(_0x4eb512){logger[_0xa531('0x15')](_0xa531('0x12'),_0x3eebc8,_0x4eb512);_0x3e25a8(_0x4eb512);});});}exports[_0xa531('0x18')]=function(_0x55a731){var _0x42b629=this;return new Promise(function(_0x468b75,_0x4096f0){return db['ChatQueue'][_0xa531('0x19')]({'raw':_0x55a731[_0xa531('0x1a')]?_0x55a731['options'][_0xa531('0x1b')]===undefined?!![]:![]:!![],'where':_0x55a731[_0xa531('0x1a')]?_0x55a731[_0xa531('0x1a')][_0xa531('0x1c')]||null:null,'attributes':_0x55a731[_0xa531('0x1a')]?_0x55a731[_0xa531('0x1a')][_0xa531('0x1d')]||null:null,'limit':_0x55a731[_0xa531('0x1a')]?_0x55a731[_0xa531('0x1a')][_0xa531('0x1e')]||null:null,'include':_0x55a731[_0xa531('0x1a')]?_0x55a731[_0xa531('0x1a')]['include']?_[_0xa531('0x1f')](_0x55a731[_0xa531('0x1a')][_0xa531('0x20')],function(_0x487a8c){return{'model':db[_0x487a8c[_0xa531('0x21')]],'as':_0x487a8c['as'],'attributes':_0x487a8c[_0xa531('0x1d')],'include':_0x487a8c['include']?_['map'](_0x487a8c[_0xa531('0x20')],function(_0x56b96d){return{'model':db[_0x56b96d[_0xa531('0x21')]],'as':_0x56b96d['as'],'attributes':_0x56b96d[_0xa531('0x1d')],'include':_0x56b96d['include']?_[_0xa531('0x1f')](_0x56b96d['include'],function(_0x36a8e6){return{'model':db[_0x36a8e6['model']],'as':_0x36a8e6['as'],'attributes':_0x36a8e6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x27bd5c){logger[_0xa531('0x11')]('GetChatQueue',_0x55a731);logger['debug'](_0xa531('0x18'),_0x55a731,JSON['stringify'](_0x27bd5c));_0x468b75(_0x27bd5c);})[_0xa531('0x22')](function(_0x133431){logger['error'](_0xa531('0x18'),_0x133431[_0xa531('0x16')],_0x55a731);_0x4096f0(_0x42b629[_0xa531('0x15')](0x1f4,_0x133431['message']));});});};exports[_0xa531('0x23')]=function(_0x3c3376){var _0x4b8104=this;return new Promise(function(_0x2fc577,_0x13c270){return db['ChatQueue'][_0xa531('0x24')]({'raw':_0x3c3376[_0xa531('0x1a')]?_0x3c3376[_0xa531('0x1a')][_0xa531('0x1b')]===undefined?!![]:![]:!![],'where':_0x3c3376[_0xa531('0x1a')]?_0x3c3376[_0xa531('0x1a')][_0xa531('0x1c')]||null:null,'attributes':_0x3c3376['options']?_0x3c3376['options'][_0xa531('0x1d')]||null:null,'include':_0x3c3376[_0xa531('0x1a')]?_0x3c3376[_0xa531('0x1a')][_0xa531('0x20')]?_[_0xa531('0x1f')](_0x3c3376['options'][_0xa531('0x20')],function(_0x3b1ba7){return{'model':db[_0x3b1ba7[_0xa531('0x21')]],'as':_0x3b1ba7['as'],'attributes':_0x3b1ba7[_0xa531('0x1d')],'include':_0x3b1ba7[_0xa531('0x20')]?_[_0xa531('0x1f')](_0x3b1ba7[_0xa531('0x20')],function(_0x24efee){return{'model':db[_0x24efee[_0xa531('0x21')]],'as':_0x24efee['as'],'attributes':_0x24efee[_0xa531('0x1d')],'include':_0x24efee[_0xa531('0x20')]?_['map'](_0x24efee[_0xa531('0x20')],function(_0x311aee){return{'model':db[_0x311aee[_0xa531('0x21')]],'as':_0x311aee['as'],'attributes':_0x311aee[_0xa531('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa531('0x10')](function(_0x4eae17){logger[_0xa531('0x11')](_0xa531('0x23'),_0x3c3376);logger[_0xa531('0x25')](_0xa531('0x23'),_0x3c3376,JSON['stringify'](_0x4eae17));_0x2fc577(_0x4eae17);})[_0xa531('0x22')](function(_0x297c78){logger[_0xa531('0x15')]('ShowChatQueue',_0x297c78['message'],_0x3c3376);_0x13c270(_0x4b8104[_0xa531('0x15')](0x1f4,_0x297c78['message']));});});};
\ No newline at end of file
+var _0x21f8=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetChatQueue','findAll','options','where','attributes','model','include','map','ChatQueue','find','ShowChatQueue','lodash'];(function(_0x139485,_0x2d0aac){var _0x221cb9=function(_0x38b8de){while(--_0x38b8de){_0x139485['push'](_0x139485['shift']());}};_0x221cb9(++_0x2d0aac);}(_0x21f8,0x71));var _0x821f=function(_0x401d67,_0xeb1592){_0x401d67=_0x401d67-0x0;var _0x25076b=_0x21f8[_0x401d67];return _0x25076b;};'use strict';var _=require(_0x821f('0x0'));var util=require(_0x821f('0x1'));var moment=require(_0x821f('0x2'));var BPromise=require(_0x821f('0x3'));var rs=require(_0x821f('0x4'));var fs=require('fs');var Redis=require(_0x821f('0x5'));var db=require(_0x821f('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x821f('0x7'));var jayson=require(_0x821f('0x8'));var client=jayson[_0x821f('0x9')][_0x821f('0xa')]({'port':0x232a});config[_0x821f('0xb')]=_[_0x821f('0xc')](config[_0x821f('0xb')],{'host':_0x821f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x821f('0xe'))[_0x821f('0xf')](socket);function respondWithRpcPromise(_0x81e2f4,_0x53ce42,_0x387056){return new BPromise(function(_0x44e3f3,_0x101ae7){return client[_0x821f('0x10')](_0x81e2f4,_0x387056)[_0x821f('0x11')](function(_0x4590da){logger[_0x821f('0x12')](_0x821f('0x13'),_0x53ce42,_0x821f('0x14'));logger[_0x821f('0x15')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x53ce42,'request\x20sent',JSON[_0x821f('0x16')](_0x4590da));if(_0x4590da[_0x821f('0x17')]){if(_0x4590da[_0x821f('0x17')][_0x821f('0x18')]===0x1f4){logger[_0x821f('0x17')](_0x821f('0x13'),_0x53ce42,_0x4590da[_0x821f('0x17')][_0x821f('0x19')]);return _0x101ae7(_0x4590da[_0x821f('0x17')][_0x821f('0x19')]);}logger['error'](_0x821f('0x13'),_0x53ce42,_0x4590da['error'][_0x821f('0x19')]);return _0x44e3f3(_0x4590da['error'][_0x821f('0x19')]);}else{logger[_0x821f('0x12')](_0x821f('0x13'),_0x53ce42,_0x821f('0x14'));_0x44e3f3(_0x4590da['result'][_0x821f('0x19')]);}})[_0x821f('0x1a')](function(_0x499483){logger[_0x821f('0x17')]('ChatQueue,\x20%s,\x20%s',_0x53ce42,_0x499483);_0x101ae7(_0x499483);});});}exports[_0x821f('0x1b')]=function(_0x5cdfc7){var _0x3104e4=this;return new Promise(function(_0x2e7b8a,_0x4fbcf2){return db['ChatQueue'][_0x821f('0x1c')]({'raw':_0x5cdfc7[_0x821f('0x1d')]?_0x5cdfc7[_0x821f('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5cdfc7[_0x821f('0x1d')]?_0x5cdfc7[_0x821f('0x1d')][_0x821f('0x1e')]||null:null,'attributes':_0x5cdfc7['options']?_0x5cdfc7[_0x821f('0x1d')][_0x821f('0x1f')]||null:null,'limit':_0x5cdfc7['options']?_0x5cdfc7['options']['limit']||null:null,'include':_0x5cdfc7['options']?_0x5cdfc7[_0x821f('0x1d')]['include']?_['map'](_0x5cdfc7[_0x821f('0x1d')]['include'],function(_0x57f5a2){return{'model':db[_0x57f5a2[_0x821f('0x20')]],'as':_0x57f5a2['as'],'attributes':_0x57f5a2[_0x821f('0x1f')],'include':_0x57f5a2[_0x821f('0x21')]?_[_0x821f('0x22')](_0x57f5a2['include'],function(_0xf6d94a){return{'model':db[_0xf6d94a[_0x821f('0x20')]],'as':_0xf6d94a['as'],'attributes':_0xf6d94a[_0x821f('0x1f')],'include':_0xf6d94a[_0x821f('0x21')]?_['map'](_0xf6d94a[_0x821f('0x21')],function(_0xac9ab1){return{'model':db[_0xac9ab1[_0x821f('0x20')]],'as':_0xac9ab1['as'],'attributes':_0xac9ab1[_0x821f('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xceb073){logger['info']('GetChatQueue',_0x5cdfc7);logger[_0x821f('0x15')](_0x821f('0x1b'),_0x5cdfc7,JSON[_0x821f('0x16')](_0xceb073));_0x2e7b8a(_0xceb073);})[_0x821f('0x1a')](function(_0x122e56){logger['error'](_0x821f('0x1b'),_0x122e56[_0x821f('0x19')],_0x5cdfc7);_0x4fbcf2(_0x3104e4[_0x821f('0x17')](0x1f4,_0x122e56[_0x821f('0x19')]));});});};exports['ShowChatQueue']=function(_0x1eae9c){var _0x386faf=this;return new Promise(function(_0x163ed3,_0x15891b){return db[_0x821f('0x23')][_0x821f('0x24')]({'raw':_0x1eae9c['options']?_0x1eae9c[_0x821f('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x1eae9c[_0x821f('0x1d')]?_0x1eae9c[_0x821f('0x1d')]['where']||null:null,'attributes':_0x1eae9c['options']?_0x1eae9c[_0x821f('0x1d')][_0x821f('0x1f')]||null:null,'include':_0x1eae9c[_0x821f('0x1d')]?_0x1eae9c[_0x821f('0x1d')][_0x821f('0x21')]?_['map'](_0x1eae9c['options'][_0x821f('0x21')],function(_0x34f607){return{'model':db[_0x34f607[_0x821f('0x20')]],'as':_0x34f607['as'],'attributes':_0x34f607['attributes'],'include':_0x34f607[_0x821f('0x21')]?_[_0x821f('0x22')](_0x34f607[_0x821f('0x21')],function(_0x34bd2c){return{'model':db[_0x34bd2c[_0x821f('0x20')]],'as':_0x34bd2c['as'],'attributes':_0x34bd2c[_0x821f('0x1f')],'include':_0x34bd2c[_0x821f('0x21')]?_['map'](_0x34bd2c['include'],function(_0x432952){return{'model':db[_0x432952[_0x821f('0x20')]],'as':_0x432952['as'],'attributes':_0x432952[_0x821f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x821f('0x11')](function(_0x355d38){logger['info']('ShowChatQueue',_0x1eae9c);logger[_0x821f('0x15')](_0x821f('0x25'),_0x1eae9c,JSON[_0x821f('0x16')](_0x355d38));_0x163ed3(_0x355d38);})['catch'](function(_0x46bc50){logger[_0x821f('0x17')](_0x821f('0x25'),_0x46bc50['message'],_0x1eae9c);_0x15891b(_0x386faf[_0x821f('0x17')](0x1f4,_0x46bc50[_0x821f('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 962ccc1..83f21b8 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 _0x9a19=['removeListener','register','chatQueue:','./chatQueue.events','save','remove','emit'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9a19,0x114));var _0x99a1=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x9a19[_0x45bf86];return _0x1f02b7;};'use strict';var ChatQueueEvents=require(_0x99a1('0x0'));var events=[_0x99a1('0x1'),_0x99a1('0x2'),'update'];function createListener(_0x16fd8b,_0x2ba463){return function(_0x112bcc){_0x2ba463[_0x99a1('0x3')](_0x16fd8b,_0x112bcc);};}function removeListener(_0x214082,_0x3d73c5){return function(){ChatQueueEvents[_0x99a1('0x4')](_0x214082,_0x3d73c5);};}exports[_0x99a1('0x5')]=function(_0x3eff4a){for(var _0xff0240=0x0,_0x65045d=events['length'];_0xff0240<_0x65045d;_0xff0240++){var _0x4d2a5c=events[_0xff0240];var _0x5aa6c2=createListener(_0x99a1('0x6')+_0x4d2a5c,_0x3eff4a);ChatQueueEvents['on'](_0x4d2a5c,_0x5aa6c2);}};
\ No newline at end of file
+var _0xb66c=['chatQueue:','./chatQueue.events','remove','removeListener','register','length'];(function(_0x3817a9,_0x29e215){var _0x443f30=function(_0x13940b){while(--_0x13940b){_0x3817a9['push'](_0x3817a9['shift']());}};_0x443f30(++_0x29e215);}(_0xb66c,0x175));var _0xcb66=function(_0x2d198d,_0x4790ed){_0x2d198d=_0x2d198d-0x0;var _0x3674d4=_0xb66c[_0x2d198d];return _0x3674d4;};'use strict';var ChatQueueEvents=require(_0xcb66('0x0'));var events=['save',_0xcb66('0x1'),'update'];function createListener(_0x2afcb8,_0x24ea13){return function(_0xf7ccc5){_0x24ea13['emit'](_0x2afcb8,_0xf7ccc5);};}function removeListener(_0x35d439,_0x386241){return function(){ChatQueueEvents[_0xcb66('0x2')](_0x35d439,_0x386241);};}exports[_0xcb66('0x3')]=function(_0x5d766d){for(var _0x518163=0x0,_0x19adf5=events[_0xcb66('0x4')];_0x518163<_0x19adf5;_0x518163++){var _0xa3993=events[_0x518163];var _0x439f3d=createListener(_0xcb66('0x5')+_0xa3993,_0x5d766d);ChatQueueEvents['on'](_0xa3993,_0x439f3d);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index ea289ef..2c1e11e 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 _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3e74,0x175));var _0x43e7=function(_0x4e16f2,_0x24ba3b){_0x4e16f2=_0x4e16f2-0x0;var _0x77bca4=_0x3e74[_0x4e16f2];return _0x77bca4;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
+var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x21733f,_0x38b1f8){var _0x2e2952=function(_0x7c62a1){while(--_0x7c62a1){_0x21733f['push'](_0x21733f['shift']());}};_0x2e2952(++_0x38b1f8);}(_0x814b,0x1a2));var _0xb814=function(_0x35c5a8,_0x8ecb48){_0x35c5a8=_0x35c5a8-0x0;var _0x34782c=_0x814b[_0x35c5a8];return _0x34782c;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 2e0b0ce..3ec0e66 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 _0x38db=['sequelize','exports','STRING','DATE','moment'];(function(_0x46e4da,_0x448bf3){var _0x4db797=function(_0x4f2eaa){while(--_0x4f2eaa){_0x46e4da['push'](_0x46e4da['shift']());}};_0x4db797(++_0x448bf3);}(_0x38db,0x18a));var _0xb38d=function(_0x3fc9af,_0x9bb776){_0x3fc9af=_0x3fc9af-0x0;var _0x3574c0=_0x38db[_0x3fc9af];return _0x3574c0;};'use strict';var moment=require(_0xb38d('0x0'));var Sequelize=require(_0xb38d('0x1'));module[_0xb38d('0x2')]={'uniqueid':{'type':Sequelize[_0xb38d('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xb38d('0x3')]},'joinAt':{'type':Sequelize[_0xb38d('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xb38d('0x4')]},'exitAt':{'type':Sequelize[_0xb38d('0x4')]},'reason':{'type':Sequelize[_0xb38d('0x3')]}};
\ No newline at end of file
+var _0x059d=['DATE','moment','sequelize','exports','STRING'];(function(_0x270817,_0x48a86a){var _0x58135e=function(_0x3df2c1){while(--_0x3df2c1){_0x270817['push'](_0x270817['shift']());}};_0x58135e(++_0x48a86a);}(_0x059d,0x1b9));var _0xd059=function(_0x5e1b94,_0x4764f9){_0x5e1b94=_0x5e1b94-0x0;var _0x42aa36=_0x059d[_0x5e1b94];return _0x42aa36;};'use strict';var moment=require(_0xd059('0x0'));var Sequelize=require(_0xd059('0x1'));module[_0xd059('0x2')]={'uniqueid':{'type':Sequelize[_0xd059('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xd059('0x3')]},'joinAt':{'type':Sequelize[_0xd059('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xd059('0x4')]},'exitAt':{'type':Sequelize[_0xd059('0x4')]},'reason':{'type':Sequelize[_0xd059('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index e6d204e..e37a1fc 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 _0x9303=['order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','params','include','create','body','find','describe','eml-format','fast-json-patch','moment','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','count','apply','save','update','then','destroy','end','error','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit'];(function(_0x2e2681,_0x4089c1){var _0x368a64=function(_0x267262){while(--_0x267262){_0x2e2681['push'](_0x2e2681['shift']());}};_0x368a64(++_0x4089c1);}(_0x9303,0xd7));var _0x3930=function(_0x37810c,_0x480382){_0x37810c=_0x37810c-0x0;var _0x44c4ef=_0x9303[_0x37810c];return _0x44c4ef;};'use strict';var emlformat=require(_0x3930('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3930('0x1'));var rp=require('request-promise');var moment=require(_0x3930('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3930('0x3'));var path=require(_0x3930('0x4'));var sox=require(_0x3930('0x5'));var csv=require(_0x3930('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3930('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3930('0x8'));var jsforce=require(_0x3930('0x9'));var deskjs=require(_0x3930('0xa'));var toCsv=require(_0x3930('0x6'));var querystring=require(_0x3930('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3930('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3930('0xd'))(_0x3930('0xe'));var utils=require(_0x3930('0xf'));var config=require(_0x3930('0x10'));var licenseUtil=require(_0x3930('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13b928,_0x55130d){_0x55130d=_0x55130d||0xcc;return function(_0x185659){if(_0x185659){return _0x13b928[_0x3930('0x12')](_0x55130d);}return _0x13b928[_0x3930('0x13')](_0x55130d)['end']();};}function respondWithResult(_0x11b256,_0x15f039){_0x15f039=_0x15f039||0xc8;return function(_0x4ef6c4){if(_0x4ef6c4){return _0x11b256[_0x3930('0x13')](_0x15f039)[_0x3930('0x14')](_0x4ef6c4);}};}function respondWithFilteredResult(_0x3bc35e,_0x135498){return function(_0x5db060){if(_0x5db060){var _0x55ec9b=typeof _0x135498[_0x3930('0x15')]==='undefined'&&typeof _0x135498[_0x3930('0x16')]==='undefined';var _0x4113c4=_0x5db060[_0x3930('0x17')];var _0x5a1c39=_0x55ec9b?0x0:_0x135498['offset'];var _0x4b02b6=_0x55ec9b?_0x5db060[_0x3930('0x17')]:_0x135498[_0x3930('0x15')]+_0x135498[_0x3930('0x16')];var _0x5b5f55;if(_0x4b02b6>=_0x4113c4){_0x4b02b6=_0x4113c4;_0x5b5f55=0xc8;}else{_0x5b5f55=0xce;}_0x3bc35e['status'](_0x5b5f55);return _0x3bc35e['set']('Content-Range',_0x5a1c39+'-'+_0x4b02b6+'/'+_0x4113c4)[_0x3930('0x14')](_0x5db060);}return null;};}function patchUpdates(_0x2ba9ba){return function(_0x2e650d){try{jsonpatch[_0x3930('0x18')](_0x2e650d,_0x2ba9ba,!![]);}catch(_0x3d2a2f){return BPromise['reject'](_0x3d2a2f);}return _0x2e650d[_0x3930('0x19')]();};}function saveUpdates(_0x315f73,_0x1c5f4a){return function(_0x4a4307){if(_0x4a4307){return _0x4a4307[_0x3930('0x1a')](_0x315f73)[_0x3930('0x1b')](function(_0x12eeb7){return _0x12eeb7;});}return null;};}function removeEntity(_0x3a0e16,_0x2bcc3b){return function(_0x186e2e){if(_0x186e2e){return _0x186e2e[_0x3930('0x1c')]()[_0x3930('0x1b')](function(){_0x3a0e16['status'](0xcc)[_0x3930('0x1d')]();});}};}function handleEntityNotFound(_0x1dcdcd,_0x187453){return function(_0x11358e){if(!_0x11358e){_0x1dcdcd[_0x3930('0x12')](0x194);}return _0x11358e;};}function handleError(_0x5b4c56,_0x276940){_0x276940=_0x276940||0x1f4;return function(_0x7b6825){logger[_0x3930('0x1e')](_0x7b6825['stack']);if(_0x7b6825[_0x3930('0x1f')]){delete _0x7b6825[_0x3930('0x1f')];}_0x5b4c56[_0x3930('0x13')](_0x276940)[_0x3930('0x20')](_0x7b6825);};}exports[_0x3930('0x21')]=function(_0x575e76,_0x447d71){var _0x121cce={},_0xca904a={},_0x51ceb9={'count':0x0,'rows':[]};var _0x3b9168=_[_0x3930('0x22')](db[_0x3930('0x23')][_0x3930('0x24')],function(_0x11290d){return{'name':_0x11290d[_0x3930('0x25')],'type':_0x11290d[_0x3930('0x26')][_0x3930('0x27')]};});_0xca904a[_0x3930('0x28')]=_[_0x3930('0x22')](_0x3b9168,_0x3930('0x1f'));_0xca904a[_0x3930('0x29')]=_[_0x3930('0x2a')](_0x575e76[_0x3930('0x29')]);_0xca904a[_0x3930('0x2b')]=_[_0x3930('0x2c')](_0xca904a[_0x3930('0x28')],_0xca904a[_0x3930('0x29')]);_0x121cce[_0x3930('0x2d')]=_[_0x3930('0x2c')](_0xca904a['model'],qs['fields'](_0x575e76['query'][_0x3930('0x2e')]));_0x121cce[_0x3930('0x2d')]=_0x121cce['attributes'][_0x3930('0x2f')]?_0x121cce[_0x3930('0x2d')]:_0xca904a['model'];if(!_0x575e76[_0x3930('0x29')]['hasOwnProperty'](_0x3930('0x30'))){_0x121cce[_0x3930('0x16')]=qs[_0x3930('0x16')](_0x575e76[_0x3930('0x29')][_0x3930('0x16')]);_0x121cce[_0x3930('0x15')]=qs[_0x3930('0x15')](_0x575e76[_0x3930('0x29')][_0x3930('0x15')]);}_0x121cce[_0x3930('0x31')]=qs[_0x3930('0x32')](_0x575e76[_0x3930('0x29')][_0x3930('0x32')]);_0x121cce[_0x3930('0x33')]=qs[_0x3930('0x2b')](_[_0x3930('0x34')](_0x575e76['query'],_0xca904a[_0x3930('0x2b')]),_0x3b9168);if(_0x575e76['query'][_0x3930('0x35')]){_0x121cce['where']=_[_0x3930('0x36')](_0x121cce['where'],{'$or':_['map'](_0x3b9168,function(_0x37cb76){if(_0x37cb76[_0x3930('0x26')]!=='VIRTUAL'){var _0x4f1717={};_0x4f1717[_0x37cb76[_0x3930('0x1f')]]={'$like':'%'+_0x575e76['query'][_0x3930('0x35')]+'%'};return _0x4f1717;}})});}_0x121cce=_[_0x3930('0x36')]({},_0x121cce,_0x575e76[_0x3930('0x37')]);var _0x3a8c7e={'where':_0x121cce[_0x3930('0x33')]};return db[_0x3930('0x23')][_0x3930('0x17')](_0x3a8c7e)[_0x3930('0x1b')](function(_0x4d6a5b){_0x51ceb9['count']=_0x4d6a5b;if(_0x575e76[_0x3930('0x29')][_0x3930('0x38')]){_0x121cce['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0x3930('0x39')](_0x121cce);})[_0x3930('0x1b')](function(_0x5cab01){_0x51ceb9['rows']=_0x5cab01;return _0x51ceb9;})['then'](respondWithFilteredResult(_0x447d71,_0x121cce))[_0x3930('0x3a')](handleError(_0x447d71,null));};exports[_0x3930('0x3b')]=function(_0x3ddc79,_0x1f9076){var _0x5cc6d8={'raw':!![],'where':{'id':_0x3ddc79[_0x3930('0x3c')]['id']}},_0x5e7718={};_0x5e7718['model']=_[_0x3930('0x2a')](db[_0x3930('0x23')]['rawAttributes']);_0x5e7718[_0x3930('0x29')]=_['keys'](_0x3ddc79[_0x3930('0x29')]);_0x5e7718[_0x3930('0x2b')]=_[_0x3930('0x2c')](_0x5e7718[_0x3930('0x28')],_0x5e7718[_0x3930('0x29')]);_0x5cc6d8[_0x3930('0x2d')]=_[_0x3930('0x2c')](_0x5e7718[_0x3930('0x28')],qs[_0x3930('0x2e')](_0x3ddc79[_0x3930('0x29')][_0x3930('0x2e')]));_0x5cc6d8[_0x3930('0x2d')]=_0x5cc6d8[_0x3930('0x2d')][_0x3930('0x2f')]?_0x5cc6d8[_0x3930('0x2d')]:_0x5e7718['model'];if(_0x3ddc79[_0x3930('0x29')][_0x3930('0x38')]){_0x5cc6d8[_0x3930('0x3d')]=[{'all':!![]}];}_0x5cc6d8=_[_0x3930('0x36')]({},_0x5cc6d8,_0x3ddc79[_0x3930('0x37')]);return db[_0x3930('0x23')]['find'](_0x5cc6d8)[_0x3930('0x1b')](handleEntityNotFound(_0x1f9076,null))[_0x3930('0x1b')](respondWithResult(_0x1f9076,null))[_0x3930('0x3a')](handleError(_0x1f9076,null));};exports[_0x3930('0x3e')]=function(_0x576beb,_0xc5d137){return db['ChatQueueReport'][_0x3930('0x3e')](_0x576beb['body'],{})['then'](respondWithResult(_0xc5d137,0xc9))[_0x3930('0x3a')](handleError(_0xc5d137,null));};exports[_0x3930('0x1a')]=function(_0x5cbb07,_0x2bdb26){if(_0x5cbb07[_0x3930('0x3f')]['id']){delete _0x5cbb07[_0x3930('0x3f')]['id'];}return db[_0x3930('0x23')]['find']({'where':{'id':_0x5cbb07[_0x3930('0x3c')]['id']}})[_0x3930('0x1b')](handleEntityNotFound(_0x2bdb26,null))[_0x3930('0x1b')](saveUpdates(_0x5cbb07[_0x3930('0x3f')],null))['then'](respondWithResult(_0x2bdb26,null))[_0x3930('0x3a')](handleError(_0x2bdb26,null));};exports[_0x3930('0x1c')]=function(_0x435735,_0x2efbb4){return db[_0x3930('0x23')][_0x3930('0x40')]({'where':{'id':_0x435735['params']['id']}})[_0x3930('0x1b')](handleEntityNotFound(_0x2efbb4,null))[_0x3930('0x1b')](removeEntity(_0x2efbb4,null))['catch'](handleError(_0x2efbb4,null));};exports[_0x3930('0x41')]=function(_0x5b2707,_0x28d074){return db[_0x3930('0x23')][_0x3930('0x41')]()[_0x3930('0x1b')](respondWithResult(_0x28d074,null))['catch'](handleError(_0x28d074,null));};
\ No newline at end of file
+var _0xf811=['error','stack','name','index','map','ChatQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','includeAll','include','findAll','catch','show','length','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','then','destroy'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf811,0x6f));var _0x1f81=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xf811[_0x55e08b];return _0xd1a7ff;};'use strict';var emlformat=require(_0x1f81('0x0'));var rimraf=require(_0x1f81('0x1'));var zipdir=require(_0x1f81('0x2'));var jsonpatch=require(_0x1f81('0x3'));var rp=require(_0x1f81('0x4'));var moment=require(_0x1f81('0x5'));var BPromise=require(_0x1f81('0x6'));var Mustache=require(_0x1f81('0x7'));var util=require(_0x1f81('0x8'));var path=require(_0x1f81('0x9'));var sox=require(_0x1f81('0xa'));var csv=require(_0x1f81('0xb'));var ejs=require(_0x1f81('0xc'));var fs=require('fs');var fs_extra=require(_0x1f81('0xd'));var _=require('lodash');var squel=require(_0x1f81('0xe'));var crypto=require(_0x1f81('0xf'));var jsforce=require(_0x1f81('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x1f81('0xb'));var querystring=require(_0x1f81('0x11'));var Papa=require('papaparse');var Redis=require(_0x1f81('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1f81('0x13'));var as=require(_0x1f81('0x14'));var hardwareService=require(_0x1f81('0x15'));var logger=require(_0x1f81('0x16'))(_0x1f81('0x17'));var utils=require(_0x1f81('0x18'));var config=require(_0x1f81('0x19'));var licenseUtil=require(_0x1f81('0x1a'));var db=require(_0x1f81('0x1b'))['db'];function respondWithStatusCode(_0x111c85,_0x14851a){_0x14851a=_0x14851a||0xcc;return function(_0x1d9ef5){if(_0x1d9ef5){return _0x111c85[_0x1f81('0x1c')](_0x14851a);}return _0x111c85[_0x1f81('0x1d')](_0x14851a)[_0x1f81('0x1e')]();};}function respondWithResult(_0x247b10,_0x5a4992){_0x5a4992=_0x5a4992||0xc8;return function(_0x29941f){if(_0x29941f){return _0x247b10[_0x1f81('0x1d')](_0x5a4992)['json'](_0x29941f);}};}function respondWithFilteredResult(_0x5e1036,_0x20cea6){return function(_0x1a781d){if(_0x1a781d){var _0x5da9d1=typeof _0x20cea6[_0x1f81('0x1f')]===_0x1f81('0x20')&&typeof _0x20cea6[_0x1f81('0x21')]===_0x1f81('0x20');var _0x4bdba8=_0x1a781d['count'];var _0x13bf61=_0x5da9d1?0x0:_0x20cea6[_0x1f81('0x1f')];var _0x579638=_0x5da9d1?_0x1a781d[_0x1f81('0x22')]:_0x20cea6['offset']+_0x20cea6[_0x1f81('0x21')];var _0x1f9813;if(_0x579638>=_0x4bdba8){_0x579638=_0x4bdba8;_0x1f9813=0xc8;}else{_0x1f9813=0xce;}_0x5e1036[_0x1f81('0x1d')](_0x1f9813);return _0x5e1036['set'](_0x1f81('0x23'),_0x13bf61+'-'+_0x579638+'/'+_0x4bdba8)[_0x1f81('0x24')](_0x1a781d);}return null;};}function patchUpdates(_0x2d9b8d){return function(_0x3d35bd){try{jsonpatch[_0x1f81('0x25')](_0x3d35bd,_0x2d9b8d,!![]);}catch(_0x20e351){return BPromise['reject'](_0x20e351);}return _0x3d35bd[_0x1f81('0x26')]();};}function saveUpdates(_0x37b6ff,_0x3751d4){return function(_0x4ecfa9){if(_0x4ecfa9){return _0x4ecfa9['update'](_0x37b6ff)[_0x1f81('0x27')](function(_0x4aaf6e){return _0x4aaf6e;});}return null;};}function removeEntity(_0x13e8c5,_0x4f714a){return function(_0x59c93a){if(_0x59c93a){return _0x59c93a[_0x1f81('0x28')]()['then'](function(){_0x13e8c5[_0x1f81('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21caa5,_0xe95e9c){return function(_0x147695){if(!_0x147695){_0x21caa5[_0x1f81('0x1c')](0x194);}return _0x147695;};}function handleError(_0x19dab0,_0x3d9e7a){_0x3d9e7a=_0x3d9e7a||0x1f4;return function(_0x2ff623){logger[_0x1f81('0x29')](_0x2ff623[_0x1f81('0x2a')]);if(_0x2ff623[_0x1f81('0x2b')]){delete _0x2ff623['name'];}_0x19dab0[_0x1f81('0x1d')](_0x3d9e7a)['send'](_0x2ff623);};}exports[_0x1f81('0x2c')]=function(_0x197da5,_0x537166){var _0x3d547b={},_0x186e42={},_0x218040={'count':0x0,'rows':[]};var _0x232750=_[_0x1f81('0x2d')](db[_0x1f81('0x2e')][_0x1f81('0x2f')],function(_0x381b5c){return{'name':_0x381b5c['fieldName'],'type':_0x381b5c[_0x1f81('0x30')][_0x1f81('0x31')]};});_0x186e42[_0x1f81('0x32')]=_[_0x1f81('0x2d')](_0x232750,_0x1f81('0x2b'));_0x186e42[_0x1f81('0x33')]=_[_0x1f81('0x34')](_0x197da5[_0x1f81('0x33')]);_0x186e42[_0x1f81('0x35')]=_[_0x1f81('0x36')](_0x186e42[_0x1f81('0x32')],_0x186e42['query']);_0x3d547b[_0x1f81('0x37')]=_[_0x1f81('0x36')](_0x186e42[_0x1f81('0x32')],qs[_0x1f81('0x38')](_0x197da5['query'][_0x1f81('0x38')]));_0x3d547b[_0x1f81('0x37')]=_0x3d547b[_0x1f81('0x37')]['length']?_0x3d547b['attributes']:_0x186e42[_0x1f81('0x32')];if(!_0x197da5['query'][_0x1f81('0x39')]('nolimit')){_0x3d547b[_0x1f81('0x21')]=qs[_0x1f81('0x21')](_0x197da5[_0x1f81('0x33')][_0x1f81('0x21')]);_0x3d547b[_0x1f81('0x1f')]=qs[_0x1f81('0x1f')](_0x197da5[_0x1f81('0x33')]['offset']);}_0x3d547b[_0x1f81('0x3a')]=qs['sort'](_0x197da5[_0x1f81('0x33')][_0x1f81('0x3b')]);_0x3d547b['where']=qs[_0x1f81('0x35')](_[_0x1f81('0x3c')](_0x197da5[_0x1f81('0x33')],_0x186e42['filters']),_0x232750);if(_0x197da5[_0x1f81('0x33')][_0x1f81('0x3d')]){_0x3d547b[_0x1f81('0x3e')]=_[_0x1f81('0x3f')](_0x3d547b[_0x1f81('0x3e')],{'$or':_['map'](_0x232750,function(_0x1823ee){if(_0x1823ee[_0x1f81('0x30')]!=='VIRTUAL'){var _0x5a57d1={};_0x5a57d1[_0x1823ee['name']]={'$like':'%'+_0x197da5[_0x1f81('0x33')][_0x1f81('0x3d')]+'%'};return _0x5a57d1;}})});}_0x3d547b=_['merge']({},_0x3d547b,_0x197da5['options']);var _0x4ec05c={'where':_0x3d547b[_0x1f81('0x3e')]};return db[_0x1f81('0x2e')]['count'](_0x4ec05c)[_0x1f81('0x27')](function(_0x29b54f){_0x218040[_0x1f81('0x22')]=_0x29b54f;if(_0x197da5['query'][_0x1f81('0x40')]){_0x3d547b[_0x1f81('0x41')]=[{'all':!![]}];}return db[_0x1f81('0x2e')][_0x1f81('0x42')](_0x3d547b);})[_0x1f81('0x27')](function(_0xb0d536){_0x218040['rows']=_0xb0d536;return _0x218040;})[_0x1f81('0x27')](respondWithFilteredResult(_0x537166,_0x3d547b))[_0x1f81('0x43')](handleError(_0x537166,null));};exports[_0x1f81('0x44')]=function(_0x176884,_0x5a22a4){var _0x2c9c48={'raw':!![],'where':{'id':_0x176884['params']['id']}},_0x15c1b9={};_0x15c1b9[_0x1f81('0x32')]=_['keys'](db[_0x1f81('0x2e')]['rawAttributes']);_0x15c1b9[_0x1f81('0x33')]=_['keys'](_0x176884[_0x1f81('0x33')]);_0x15c1b9[_0x1f81('0x35')]=_[_0x1f81('0x36')](_0x15c1b9['model'],_0x15c1b9[_0x1f81('0x33')]);_0x2c9c48[_0x1f81('0x37')]=_['intersection'](_0x15c1b9[_0x1f81('0x32')],qs[_0x1f81('0x38')](_0x176884[_0x1f81('0x33')][_0x1f81('0x38')]));_0x2c9c48[_0x1f81('0x37')]=_0x2c9c48[_0x1f81('0x37')][_0x1f81('0x45')]?_0x2c9c48['attributes']:_0x15c1b9[_0x1f81('0x32')];if(_0x176884[_0x1f81('0x33')]['includeAll']){_0x2c9c48[_0x1f81('0x41')]=[{'all':!![]}];}_0x2c9c48=_[_0x1f81('0x3f')]({},_0x2c9c48,_0x176884[_0x1f81('0x46')]);return db['ChatQueueReport'][_0x1f81('0x47')](_0x2c9c48)[_0x1f81('0x27')](handleEntityNotFound(_0x5a22a4,null))['then'](respondWithResult(_0x5a22a4,null))[_0x1f81('0x43')](handleError(_0x5a22a4,null));};exports['create']=function(_0x51bd8d,_0x19f10d){return db[_0x1f81('0x2e')][_0x1f81('0x48')](_0x51bd8d['body'],{})['then'](respondWithResult(_0x19f10d,0xc9))[_0x1f81('0x43')](handleError(_0x19f10d,null));};exports['update']=function(_0x9a7ddb,_0x388936){if(_0x9a7ddb[_0x1f81('0x49')]['id']){delete _0x9a7ddb[_0x1f81('0x49')]['id'];}return db[_0x1f81('0x2e')]['find']({'where':{'id':_0x9a7ddb[_0x1f81('0x4a')]['id']}})[_0x1f81('0x27')](handleEntityNotFound(_0x388936,null))[_0x1f81('0x27')](saveUpdates(_0x9a7ddb[_0x1f81('0x49')],null))['then'](respondWithResult(_0x388936,null))['catch'](handleError(_0x388936,null));};exports[_0x1f81('0x28')]=function(_0x271570,_0x56beff){return db[_0x1f81('0x2e')]['find']({'where':{'id':_0x271570[_0x1f81('0x4a')]['id']}})['then'](handleEntityNotFound(_0x56beff,null))[_0x1f81('0x27')](removeEntity(_0x56beff,null))['catch'](handleError(_0x56beff,null));};exports[_0x1f81('0x4b')]=function(_0x53a454,_0x45729c){return db[_0x1f81('0x2e')][_0x1f81('0x4b')]()['then'](respondWithResult(_0x45729c,null))[_0x1f81('0x43')](handleError(_0x45729c,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 5686701..2b1e392 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 _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x12c944,_0x3a3a06){var _0xebfda5=function(_0x668806){while(--_0x668806){_0x12c944['push'](_0x12c944['shift']());}};_0xebfda5(++_0x3a3a06);}(_0x757a,0xde));var _0xa757=function(_0xb80757,_0x53340a){_0xb80757=_0xb80757-0x0;var _0x2daefe=_0x757a[_0xb80757];return _0x2daefe;};'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
+var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x4e00e4,_0x58fd04){var _0x421c55=function(_0xcd71c5){while(--_0xcd71c5){_0x4e00e4['push'](_0x4e00e4['shift']());}};_0x421c55(++_0x58fd04);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 7dd3764..b753082 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 _0x081c=['catch','ChatQueueReport','body','options','raw','CreateChatQueueReport','debug','UpdateChatQueueReport','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','ChatQueueReport,\x20%s,\x20%s','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x081c,0xd7));var _0xc081=function(_0x416a3c,_0x481c83){_0x416a3c=_0x416a3c-0x0;var _0x2a055d=_0x081c[_0x416a3c];return _0x2a055d;};'use strict';var _=require(_0xc081('0x0'));var util=require(_0xc081('0x1'));var moment=require(_0xc081('0x2'));var BPromise=require(_0xc081('0x3'));var rs=require(_0xc081('0x4'));var fs=require('fs');var Redis=require(_0xc081('0x5'));var db=require(_0xc081('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc081('0x7'))(_0xc081('0x8'));var config=require(_0xc081('0x9'));var jayson=require(_0xc081('0xa'));var client=jayson[_0xc081('0xb')][_0xc081('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x85f165,_0x29539d,_0x16089f){return new BPromise(function(_0x43d6f3,_0x1cfbe2){return client[_0xc081('0xd')](_0x85f165,_0x16089f)[_0xc081('0xe')](function(_0x50e75a){logger[_0xc081('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x29539d,_0xc081('0x10'));logger['debug'](_0xc081('0x11'),_0x29539d,_0xc081('0x10'),JSON[_0xc081('0x12')](_0x50e75a));if(_0x50e75a['error']){if(_0x50e75a['error'][_0xc081('0x13')]===0x1f4){logger[_0xc081('0x14')](_0xc081('0x15'),_0x29539d,_0x50e75a['error'][_0xc081('0x16')]);return _0x1cfbe2(_0x50e75a[_0xc081('0x14')][_0xc081('0x16')]);}logger[_0xc081('0x14')](_0xc081('0x15'),_0x29539d,_0x50e75a[_0xc081('0x14')][_0xc081('0x16')]);return _0x43d6f3(_0x50e75a['error'][_0xc081('0x16')]);}else{logger[_0xc081('0xf')](_0xc081('0x15'),_0x29539d,'request\x20sent');_0x43d6f3(_0x50e75a['result'][_0xc081('0x16')]);}})[_0xc081('0x17')](function(_0x56e454){logger['error'](_0xc081('0x15'),_0x29539d,_0x56e454);_0x1cfbe2(_0x56e454);});});}exports['CreateChatQueueReport']=function(_0x529e49){var _0x3b0e22=this;return new Promise(function(_0x5c837a,_0x43ab94){return db[_0xc081('0x18')]['create'](_0x529e49[_0xc081('0x19')],{'raw':_0x529e49['options']?_0x529e49[_0xc081('0x1a')][_0xc081('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0xb14a50){logger[_0xc081('0xf')](_0xc081('0x1c'),_0x529e49);logger[_0xc081('0x1d')](_0xc081('0x1c'),_0x529e49,JSON['stringify'](_0xb14a50));_0x5c837a(_0xb14a50);})[_0xc081('0x17')](function(_0x2ef1b3){logger['error'](_0xc081('0x1c'),_0x2ef1b3[_0xc081('0x16')],_0x529e49);_0x43ab94(_0x3b0e22['error'](0x1f4,_0x2ef1b3[_0xc081('0x16')]));});});};exports[_0xc081('0x1e')]=function(_0x29c0fa){var _0x5f5410=this;return new Promise(function(_0x33d506,_0x5aa45c){return db[_0xc081('0x18')]['update'](_0x29c0fa[_0xc081('0x19')],{'raw':_0x29c0fa[_0xc081('0x1a')]?_0x29c0fa['options'][_0xc081('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29c0fa['options']?_0x29c0fa['options'][_0xc081('0x1f')]||null:null,'attributes':_0x29c0fa[_0xc081('0x1a')]?_0x29c0fa[_0xc081('0x1a')][_0xc081('0x20')]||null:null,'limit':_0x29c0fa[_0xc081('0x1a')]?_0x29c0fa[_0xc081('0x1a')][_0xc081('0x21')]||null:null})[_0xc081('0xe')](function(_0x55d712){logger[_0xc081('0xf')](_0xc081('0x1e'),_0x29c0fa);logger[_0xc081('0x1d')](_0xc081('0x1e'),_0x29c0fa,JSON[_0xc081('0x12')](_0x55d712));_0x33d506(_0x55d712);})[_0xc081('0x17')](function(_0x1ad3ef){logger['error']('UpdateChatQueueReport',_0x1ad3ef[_0xc081('0x16')],_0x29c0fa);_0x5aa45c(_0x5f5410[_0xc081('0x14')](0x1f4,_0x1ad3ef['message']));});});};
\ No newline at end of file
+var _0x6685=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','CreateChatQueueReport','body','raw','options','where','attributes','limit','UpdateChatQueueReport','util','moment','bluebird'];(function(_0x484783,_0x5adb3b){var _0x583af8=function(_0x46d5f2){while(--_0x46d5f2){_0x484783['push'](_0x484783['shift']());}};_0x583af8(++_0x5adb3b);}(_0x6685,0xfd));var _0x5668=function(_0x10826b,_0x4449df){_0x10826b=_0x10826b-0x0;var _0x9e8258=_0x6685[_0x10826b];return _0x9e8258;};'use strict';var _=require('lodash');var util=require(_0x5668('0x0'));var moment=require(_0x5668('0x1'));var BPromise=require(_0x5668('0x2'));var rs=require(_0x5668('0x3'));var fs=require('fs');var Redis=require(_0x5668('0x4'));var db=require(_0x5668('0x5'))['db'];var utils=require(_0x5668('0x6'));var logger=require('../../config/logger')(_0x5668('0x7'));var config=require(_0x5668('0x8'));var jayson=require(_0x5668('0x9'));var client=jayson[_0x5668('0xa')][_0x5668('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9a4434,_0x472ae2,_0x47792f){return new BPromise(function(_0x1e50f1,_0x1840ac){return client[_0x5668('0xc')](_0x9a4434,_0x47792f)[_0x5668('0xd')](function(_0x1c5306){logger[_0x5668('0xe')](_0x5668('0xf'),_0x472ae2,'request\x20sent');logger[_0x5668('0x10')](_0x5668('0x11'),_0x472ae2,_0x5668('0x12'),JSON[_0x5668('0x13')](_0x1c5306));if(_0x1c5306['error']){if(_0x1c5306['error'][_0x5668('0x14')]===0x1f4){logger[_0x5668('0x15')]('ChatQueueReport,\x20%s,\x20%s',_0x472ae2,_0x1c5306[_0x5668('0x15')][_0x5668('0x16')]);return _0x1840ac(_0x1c5306[_0x5668('0x15')][_0x5668('0x16')]);}logger[_0x5668('0x15')](_0x5668('0xf'),_0x472ae2,_0x1c5306[_0x5668('0x15')][_0x5668('0x16')]);return _0x1e50f1(_0x1c5306[_0x5668('0x15')]['message']);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x472ae2,_0x5668('0x12'));_0x1e50f1(_0x1c5306['result']['message']);}})[_0x5668('0x17')](function(_0x2dfa0d){logger['error'](_0x5668('0xf'),_0x472ae2,_0x2dfa0d);_0x1840ac(_0x2dfa0d);});});}exports[_0x5668('0x18')]=function(_0x2df44e){var _0x3bd764=this;return new Promise(function(_0x1572d8,_0xe72742){return db['ChatQueueReport']['create'](_0x2df44e[_0x5668('0x19')],{'raw':_0x2df44e['options']?_0x2df44e['options'][_0x5668('0x1a')]===undefined?!![]:![]:!![]})[_0x5668('0xd')](function(_0x4876fe){logger[_0x5668('0xe')](_0x5668('0x18'),_0x2df44e);logger['debug'](_0x5668('0x18'),_0x2df44e,JSON[_0x5668('0x13')](_0x4876fe));_0x1572d8(_0x4876fe);})['catch'](function(_0x411d38){logger[_0x5668('0x15')]('CreateChatQueueReport',_0x411d38['message'],_0x2df44e);_0xe72742(_0x3bd764[_0x5668('0x15')](0x1f4,_0x411d38[_0x5668('0x16')]));});});};exports['UpdateChatQueueReport']=function(_0x374d80){var _0x1a8d3d=this;return new Promise(function(_0x51e398,_0x383268){return db['ChatQueueReport']['update'](_0x374d80[_0x5668('0x19')],{'raw':_0x374d80[_0x5668('0x1b')]?_0x374d80[_0x5668('0x1b')][_0x5668('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x374d80[_0x5668('0x1b')]?_0x374d80[_0x5668('0x1b')][_0x5668('0x1c')]||null:null,'attributes':_0x374d80['options']?_0x374d80[_0x5668('0x1b')][_0x5668('0x1d')]||null:null,'limit':_0x374d80['options']?_0x374d80[_0x5668('0x1b')][_0x5668('0x1e')]||null:null})[_0x5668('0xd')](function(_0x127874){logger[_0x5668('0xe')](_0x5668('0x1f'),_0x374d80);logger[_0x5668('0x10')](_0x5668('0x1f'),_0x374d80,JSON[_0x5668('0x13')](_0x127874));_0x51e398(_0x127874);})[_0x5668('0x17')](function(_0x5e7e98){logger[_0x5668('0x15')](_0x5668('0x1f'),_0x5e7e98[_0x5668('0x16')],_0x374d80);_0x383268(_0x1a8d3d[_0x5668('0x15')](0x1f4,_0x5e7e98['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 60e1c02..6047c69 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 _0xa319=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create','update','delete','exports','multer','util'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0xa319,0x178));var _0x9a31=function(_0x1caf21,_0x48a169){_0x1caf21=_0x1caf21-0x0;var _0x55e77f=_0xa319[_0x1caf21];return _0x55e77f;};'use strict';var multer=require(_0x9a31('0x0'));var util=require(_0x9a31('0x1'));var path=require(_0x9a31('0x2'));var timeout=require(_0x9a31('0x3'));var express=require(_0x9a31('0x4'));var router=express[_0x9a31('0x5')]();var fs_extra=require(_0x9a31('0x6'));var auth=require(_0x9a31('0x7'));var interaction=require(_0x9a31('0x8'));var config=require('../../config/environment');var controller=require(_0x9a31('0x9'));router['get']('/',auth[_0x9a31('0xa')](),controller['index']);router[_0x9a31('0xb')](_0x9a31('0xc'),auth[_0x9a31('0xa')](),controller[_0x9a31('0xd')]);router[_0x9a31('0xb')](_0x9a31('0xe'),auth['isAuthenticated'](),controller[_0x9a31('0xf')]);router[_0x9a31('0x10')]('/',auth[_0x9a31('0xa')](),controller[_0x9a31('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9a31('0x12')]);router[_0x9a31('0x13')](_0x9a31('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x9a31('0x14')]=router;
\ No newline at end of file
+var _0xd76d=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','create','put','destroy','exports'];(function(_0x1469f6,_0x1811c5){var _0x1a43cf=function(_0x2e810e){while(--_0x2e810e){_0x1469f6['push'](_0x1469f6['shift']());}};_0x1a43cf(++_0x1811c5);}(_0xd76d,0xe4));var _0xdd76=function(_0xf845cc,_0x7bce78){_0xf845cc=_0xf845cc-0x0;var _0x24da94=_0xd76d[_0xf845cc];return _0x24da94;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdd76('0x0'));var timeout=require(_0xdd76('0x1'));var express=require(_0xdd76('0x2'));var router=express[_0xdd76('0x3')]();var fs_extra=require(_0xdd76('0x4'));var auth=require(_0xdd76('0x5'));var interaction=require(_0xdd76('0x6'));var config=require(_0xdd76('0x7'));var controller=require(_0xdd76('0x8'));router['get']('/',auth[_0xdd76('0x9')](),controller[_0xdd76('0xa')]);router[_0xdd76('0xb')](_0xdd76('0xc'),auth[_0xdd76('0x9')](),controller[_0xdd76('0xd')]);router[_0xdd76('0xb')](_0xdd76('0xe'),auth[_0xdd76('0x9')](),controller['show']);router['post']('/',auth[_0xdd76('0x9')](),controller[_0xdd76('0xf')]);router[_0xdd76('0x10')]('/:id',auth[_0xdd76('0x9')](),controller['update']);router['delete'](_0xdd76('0xe'),auth[_0xdd76('0x9')](),controller[_0xdd76('0x11')]);module[_0xdd76('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 7055265..dc740e0 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x10f100,_0x20f3d3){var _0x51546e=function(_0x488217){while(--_0x488217){_0x10f100['push'](_0x10f100['shift']());}};_0x51546e(++_0x20f3d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}};
\ No newline at end of file
+var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x524862,_0x51a6ff){var _0x5e225d=function(_0x3aedbd){while(--_0x3aedbd){_0x524862['push'](_0x524862['shift']());}};_0x5e225d(++_0x51a6ff);}(_0xedd9,0xfc));var _0x9edd=function(_0x2aa2e9,_0x4b05c7){_0x2aa2e9=_0x2aa2e9-0x0;var _0x2dbc4d=_0xedd9[_0x2aa2e9];return _0x2dbc4d;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 2462d6f..854dd27 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 _0xc1e0=['update','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','error','name','send','index','ChatTransferReport','rawAttributes','fieldName','type','key','map','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','body'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xc1e0,0xe7));var _0x0c1e=function(_0x29059d,_0x332387){_0x29059d=_0x29059d-0x0;var _0x4d5f08=_0xc1e0[_0x29059d];return _0x4d5f08;};'use strict';var emlformat=require(_0x0c1e('0x0'));var rimraf=require(_0x0c1e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0c1e('0x2'));var rp=require(_0x0c1e('0x3'));var moment=require(_0x0c1e('0x4'));var BPromise=require(_0x0c1e('0x5'));var Mustache=require('mustache');var util=require(_0x0c1e('0x6'));var path=require(_0x0c1e('0x7'));var sox=require(_0x0c1e('0x8'));var csv=require(_0x0c1e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0c1e('0xa'));var _=require(_0x0c1e('0xb'));var squel=require('squel');var crypto=require(_0x0c1e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0c1e('0xd'));var Redis=require(_0x0c1e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0c1e('0xf'));var as=require(_0x0c1e('0x10'));var hardwareService=require(_0x0c1e('0x11'));var logger=require('../../config/logger')(_0x0c1e('0x12'));var utils=require(_0x0c1e('0x13'));var config=require(_0x0c1e('0x14'));var licenseUtil=require(_0x0c1e('0x15'));var db=require(_0x0c1e('0x16'))['db'];function respondWithStatusCode(_0x7639cf,_0x129851){_0x129851=_0x129851||0xcc;return function(_0x789fc0){if(_0x789fc0){return _0x7639cf[_0x0c1e('0x17')](_0x129851);}return _0x7639cf[_0x0c1e('0x18')](_0x129851)[_0x0c1e('0x19')]();};}function respondWithResult(_0x54b1ec,_0x4017cd){_0x4017cd=_0x4017cd||0xc8;return function(_0x2fd6e4){if(_0x2fd6e4){return _0x54b1ec['status'](_0x4017cd)[_0x0c1e('0x1a')](_0x2fd6e4);}};}function respondWithFilteredResult(_0x53f9a3,_0x4db2de){return function(_0x1425da){if(_0x1425da){var _0x44e94c=typeof _0x4db2de['offset']===_0x0c1e('0x1b')&&typeof _0x4db2de['limit']===_0x0c1e('0x1b');var _0x5dcdc2=_0x1425da['count'];var _0x4ba793=_0x44e94c?0x0:_0x4db2de['offset'];var _0x2a1ff3=_0x44e94c?_0x1425da[_0x0c1e('0x1c')]:_0x4db2de['offset']+_0x4db2de[_0x0c1e('0x1d')];var _0x3ce25e;if(_0x2a1ff3>=_0x5dcdc2){_0x2a1ff3=_0x5dcdc2;_0x3ce25e=0xc8;}else{_0x3ce25e=0xce;}_0x53f9a3[_0x0c1e('0x18')](_0x3ce25e);return _0x53f9a3['set'](_0x0c1e('0x1e'),_0x4ba793+'-'+_0x2a1ff3+'/'+_0x5dcdc2)[_0x0c1e('0x1a')](_0x1425da);}return null;};}function patchUpdates(_0x213562){return function(_0x1fdc9b){try{jsonpatch[_0x0c1e('0x1f')](_0x1fdc9b,_0x213562,!![]);}catch(_0x42b13d){return BPromise[_0x0c1e('0x20')](_0x42b13d);}return _0x1fdc9b[_0x0c1e('0x21')]();};}function saveUpdates(_0x18e1c2,_0x4a67ad){return function(_0x3753fe){if(_0x3753fe){return _0x3753fe['update'](_0x18e1c2)[_0x0c1e('0x22')](function(_0x484eee){return _0x484eee;});}return null;};}function removeEntity(_0xa127db,_0xc4ef8e){return function(_0x174119){if(_0x174119){return _0x174119[_0x0c1e('0x23')]()[_0x0c1e('0x22')](function(){_0xa127db['status'](0xcc)[_0x0c1e('0x19')]();});}};}function handleEntityNotFound(_0xeb7dde,_0x557c59){return function(_0x5b8619){if(!_0x5b8619){_0xeb7dde[_0x0c1e('0x17')](0x194);}return _0x5b8619;};}function handleError(_0x472130,_0x20f02b){_0x20f02b=_0x20f02b||0x1f4;return function(_0xcbf211){logger[_0x0c1e('0x24')](_0xcbf211['stack']);if(_0xcbf211[_0x0c1e('0x25')]){delete _0xcbf211[_0x0c1e('0x25')];}_0x472130[_0x0c1e('0x18')](_0x20f02b)[_0x0c1e('0x26')](_0xcbf211);};}exports[_0x0c1e('0x27')]=function(_0x312a34,_0xd1d45e){var _0x473da9={},_0x36e5b8={},_0x2fcade={'count':0x0,'rows':[]};var _0x414bfe=_['map'](db[_0x0c1e('0x28')][_0x0c1e('0x29')],function(_0x52dbc6){return{'name':_0x52dbc6[_0x0c1e('0x2a')],'type':_0x52dbc6[_0x0c1e('0x2b')][_0x0c1e('0x2c')]};});_0x36e5b8['model']=_[_0x0c1e('0x2d')](_0x414bfe,'name');_0x36e5b8[_0x0c1e('0x2e')]=_[_0x0c1e('0x2f')](_0x312a34[_0x0c1e('0x2e')]);_0x36e5b8['filters']=_[_0x0c1e('0x30')](_0x36e5b8['model'],_0x36e5b8[_0x0c1e('0x2e')]);_0x473da9[_0x0c1e('0x31')]=_[_0x0c1e('0x30')](_0x36e5b8['model'],qs[_0x0c1e('0x32')](_0x312a34[_0x0c1e('0x2e')]['fields']));_0x473da9[_0x0c1e('0x31')]=_0x473da9[_0x0c1e('0x31')][_0x0c1e('0x33')]?_0x473da9[_0x0c1e('0x31')]:_0x36e5b8[_0x0c1e('0x34')];if(!_0x312a34[_0x0c1e('0x2e')][_0x0c1e('0x35')](_0x0c1e('0x36'))){_0x473da9[_0x0c1e('0x1d')]=qs['limit'](_0x312a34[_0x0c1e('0x2e')]['limit']);_0x473da9[_0x0c1e('0x37')]=qs['offset'](_0x312a34['query'][_0x0c1e('0x37')]);}_0x473da9[_0x0c1e('0x38')]=qs['sort'](_0x312a34[_0x0c1e('0x2e')][_0x0c1e('0x39')]);_0x473da9[_0x0c1e('0x3a')]=qs[_0x0c1e('0x3b')](_[_0x0c1e('0x3c')](_0x312a34[_0x0c1e('0x2e')],_0x36e5b8[_0x0c1e('0x3b')]),_0x414bfe);if(_0x312a34[_0x0c1e('0x2e')][_0x0c1e('0x3d')]){_0x473da9[_0x0c1e('0x3a')]=_[_0x0c1e('0x3e')](_0x473da9['where'],{'$or':_[_0x0c1e('0x2d')](_0x414bfe,function(_0xce21fd){if(_0xce21fd[_0x0c1e('0x2b')]!==_0x0c1e('0x3f')){var _0xf712ac={};_0xf712ac[_0xce21fd[_0x0c1e('0x25')]]={'$like':'%'+_0x312a34['query'][_0x0c1e('0x3d')]+'%'};return _0xf712ac;}})});}_0x473da9=_[_0x0c1e('0x3e')]({},_0x473da9,_0x312a34[_0x0c1e('0x40')]);var _0x11a4ba={'where':_0x473da9[_0x0c1e('0x3a')]};return db[_0x0c1e('0x28')][_0x0c1e('0x1c')](_0x11a4ba)['then'](function(_0x443cdb){_0x2fcade[_0x0c1e('0x1c')]=_0x443cdb;if(_0x312a34[_0x0c1e('0x2e')][_0x0c1e('0x41')]){_0x473da9[_0x0c1e('0x42')]=[{'all':!![]}];}return db[_0x0c1e('0x28')][_0x0c1e('0x43')](_0x473da9);})[_0x0c1e('0x22')](function(_0x2c5b6d){_0x2fcade[_0x0c1e('0x44')]=_0x2c5b6d;return _0x2fcade;})[_0x0c1e('0x22')](respondWithFilteredResult(_0xd1d45e,_0x473da9))[_0x0c1e('0x45')](handleError(_0xd1d45e,null));};exports[_0x0c1e('0x46')]=function(_0x276062,_0x1aa175){var _0x11038d={'raw':!![],'where':{'id':_0x276062['params']['id']}},_0x5738d0={};_0x5738d0[_0x0c1e('0x34')]=_['keys'](db[_0x0c1e('0x28')][_0x0c1e('0x29')]);_0x5738d0['query']=_[_0x0c1e('0x2f')](_0x276062[_0x0c1e('0x2e')]);_0x5738d0[_0x0c1e('0x3b')]=_[_0x0c1e('0x30')](_0x5738d0[_0x0c1e('0x34')],_0x5738d0[_0x0c1e('0x2e')]);_0x11038d['attributes']=_[_0x0c1e('0x30')](_0x5738d0[_0x0c1e('0x34')],qs[_0x0c1e('0x32')](_0x276062['query']['fields']));_0x11038d['attributes']=_0x11038d['attributes'][_0x0c1e('0x33')]?_0x11038d[_0x0c1e('0x31')]:_0x5738d0[_0x0c1e('0x34')];if(_0x276062[_0x0c1e('0x2e')][_0x0c1e('0x41')]){_0x11038d['include']=[{'all':!![]}];}_0x11038d=_[_0x0c1e('0x3e')]({},_0x11038d,_0x276062[_0x0c1e('0x40')]);return db[_0x0c1e('0x28')][_0x0c1e('0x47')](_0x11038d)[_0x0c1e('0x22')](handleEntityNotFound(_0x1aa175,null))[_0x0c1e('0x22')](respondWithResult(_0x1aa175,null))[_0x0c1e('0x45')](handleError(_0x1aa175,null));};exports['create']=function(_0x1393d7,_0x540176){return db['ChatTransferReport']['create'](_0x1393d7[_0x0c1e('0x48')],{})[_0x0c1e('0x22')](respondWithResult(_0x540176,0xc9))['catch'](handleError(_0x540176,null));};exports[_0x0c1e('0x49')]=function(_0x5d960b,_0x53dbb0){if(_0x5d960b[_0x0c1e('0x48')]['id']){delete _0x5d960b['body']['id'];}return db['ChatTransferReport'][_0x0c1e('0x47')]({'where':{'id':_0x5d960b[_0x0c1e('0x4a')]['id']}})[_0x0c1e('0x22')](handleEntityNotFound(_0x53dbb0,null))[_0x0c1e('0x22')](saveUpdates(_0x5d960b[_0x0c1e('0x48')],null))[_0x0c1e('0x22')](respondWithResult(_0x53dbb0,null))[_0x0c1e('0x45')](handleError(_0x53dbb0,null));};exports['destroy']=function(_0x6a2a71,_0x1c7ebf){return db[_0x0c1e('0x28')][_0x0c1e('0x47')]({'where':{'id':_0x6a2a71[_0x0c1e('0x4a')]['id']}})[_0x0c1e('0x22')](handleEntityNotFound(_0x1c7ebf,null))[_0x0c1e('0x22')](removeEntity(_0x1c7ebf,null))['catch'](handleError(_0x1c7ebf,null));};exports[_0x0c1e('0x4b')]=function(_0x28f79d,_0x39a969){return db[_0x0c1e('0x28')][_0x0c1e('0x4b')]()[_0x0c1e('0x22')](respondWithResult(_0x39a969,null))[_0x0c1e('0x45')](handleError(_0x39a969,null));};
\ No newline at end of file
+var _0xf0a8=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','key','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','rimraf'];(function(_0x4f6703,_0x35ef58){var _0x311437=function(_0x585600){while(--_0x585600){_0x4f6703['push'](_0x4f6703['shift']());}};_0x311437(++_0x35ef58);}(_0xf0a8,0x12f));var _0x8f0a=function(_0x45606e,_0x22c5b0){_0x45606e=_0x45606e-0x0;var _0x788a25=_0xf0a8[_0x45606e];return _0x788a25;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8f0a('0x0'));var zipdir=require(_0x8f0a('0x1'));var jsonpatch=require(_0x8f0a('0x2'));var rp=require(_0x8f0a('0x3'));var moment=require(_0x8f0a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8f0a('0x5'));var util=require(_0x8f0a('0x6'));var path=require(_0x8f0a('0x7'));var sox=require(_0x8f0a('0x8'));var csv=require(_0x8f0a('0x9'));var ejs=require(_0x8f0a('0xa'));var fs=require('fs');var fs_extra=require(_0x8f0a('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8f0a('0xc'));var jsforce=require(_0x8f0a('0xd'));var deskjs=require(_0x8f0a('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8f0a('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8f0a('0x10'));var logger=require(_0x8f0a('0x11'))(_0x8f0a('0x12'));var utils=require(_0x8f0a('0x13'));var config=require(_0x8f0a('0x14'));var licenseUtil=require(_0x8f0a('0x15'));var db=require(_0x8f0a('0x16'))['db'];function respondWithStatusCode(_0x4d9980,_0x481d15){_0x481d15=_0x481d15||0xcc;return function(_0x221184){if(_0x221184){return _0x4d9980[_0x8f0a('0x17')](_0x481d15);}return _0x4d9980[_0x8f0a('0x18')](_0x481d15)[_0x8f0a('0x19')]();};}function respondWithResult(_0x11b49a,_0x4fb84){_0x4fb84=_0x4fb84||0xc8;return function(_0x44a730){if(_0x44a730){return _0x11b49a[_0x8f0a('0x18')](_0x4fb84)[_0x8f0a('0x1a')](_0x44a730);}};}function respondWithFilteredResult(_0x3ed2a0,_0x59d439){return function(_0x3223d8){if(_0x3223d8){var _0x1c4d48=typeof _0x59d439[_0x8f0a('0x1b')]===_0x8f0a('0x1c')&&typeof _0x59d439[_0x8f0a('0x1d')]===_0x8f0a('0x1c');var _0x22315b=_0x3223d8['count'];var _0x13d1a3=_0x1c4d48?0x0:_0x59d439[_0x8f0a('0x1b')];var _0x1ae136=_0x1c4d48?_0x3223d8[_0x8f0a('0x1e')]:_0x59d439[_0x8f0a('0x1b')]+_0x59d439['limit'];var _0xa3c6e3;if(_0x1ae136>=_0x22315b){_0x1ae136=_0x22315b;_0xa3c6e3=0xc8;}else{_0xa3c6e3=0xce;}_0x3ed2a0[_0x8f0a('0x18')](_0xa3c6e3);return _0x3ed2a0[_0x8f0a('0x1f')](_0x8f0a('0x20'),_0x13d1a3+'-'+_0x1ae136+'/'+_0x22315b)[_0x8f0a('0x1a')](_0x3223d8);}return null;};}function patchUpdates(_0x4c20b5){return function(_0x5a787c){try{jsonpatch[_0x8f0a('0x21')](_0x5a787c,_0x4c20b5,!![]);}catch(_0x37a8d1){return BPromise['reject'](_0x37a8d1);}return _0x5a787c[_0x8f0a('0x22')]();};}function saveUpdates(_0x578a21,_0x80d487){return function(_0x583f79){if(_0x583f79){return _0x583f79[_0x8f0a('0x23')](_0x578a21)[_0x8f0a('0x24')](function(_0x2bf852){return _0x2bf852;});}return null;};}function removeEntity(_0x2a3282,_0x41a21b){return function(_0x326407){if(_0x326407){return _0x326407[_0x8f0a('0x25')]()['then'](function(){_0x2a3282[_0x8f0a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35897f,_0x4baa5d){return function(_0x1f00cc){if(!_0x1f00cc){_0x35897f[_0x8f0a('0x17')](0x194);}return _0x1f00cc;};}function handleError(_0x24d8cd,_0x376ded){_0x376ded=_0x376ded||0x1f4;return function(_0x573721){logger[_0x8f0a('0x26')](_0x573721[_0x8f0a('0x27')]);if(_0x573721['name']){delete _0x573721[_0x8f0a('0x28')];}_0x24d8cd[_0x8f0a('0x18')](_0x376ded)[_0x8f0a('0x29')](_0x573721);};}exports[_0x8f0a('0x2a')]=function(_0x2f92e3,_0x2204a8){var _0x360acd={},_0x3ef5e3={},_0x317db5={'count':0x0,'rows':[]};var _0x4fa061=_[_0x8f0a('0x2b')](db[_0x8f0a('0x2c')][_0x8f0a('0x2d')],function(_0x38ebb6){return{'name':_0x38ebb6[_0x8f0a('0x2e')],'type':_0x38ebb6['type'][_0x8f0a('0x2f')]};});_0x3ef5e3['model']=_[_0x8f0a('0x2b')](_0x4fa061,'name');_0x3ef5e3['query']=_['keys'](_0x2f92e3['query']);_0x3ef5e3[_0x8f0a('0x30')]=_[_0x8f0a('0x31')](_0x3ef5e3[_0x8f0a('0x32')],_0x3ef5e3[_0x8f0a('0x33')]);_0x360acd[_0x8f0a('0x34')]=_[_0x8f0a('0x31')](_0x3ef5e3['model'],qs[_0x8f0a('0x35')](_0x2f92e3['query'][_0x8f0a('0x35')]));_0x360acd['attributes']=_0x360acd['attributes'][_0x8f0a('0x36')]?_0x360acd[_0x8f0a('0x34')]:_0x3ef5e3[_0x8f0a('0x32')];if(!_0x2f92e3[_0x8f0a('0x33')][_0x8f0a('0x37')]('nolimit')){_0x360acd[_0x8f0a('0x1d')]=qs['limit'](_0x2f92e3[_0x8f0a('0x33')][_0x8f0a('0x1d')]);_0x360acd[_0x8f0a('0x1b')]=qs[_0x8f0a('0x1b')](_0x2f92e3[_0x8f0a('0x33')][_0x8f0a('0x1b')]);}_0x360acd[_0x8f0a('0x38')]=qs[_0x8f0a('0x39')](_0x2f92e3[_0x8f0a('0x33')][_0x8f0a('0x39')]);_0x360acd[_0x8f0a('0x3a')]=qs[_0x8f0a('0x30')](_[_0x8f0a('0x3b')](_0x2f92e3['query'],_0x3ef5e3[_0x8f0a('0x30')]),_0x4fa061);if(_0x2f92e3[_0x8f0a('0x33')][_0x8f0a('0x3c')]){_0x360acd['where']=_[_0x8f0a('0x3d')](_0x360acd[_0x8f0a('0x3a')],{'$or':_[_0x8f0a('0x2b')](_0x4fa061,function(_0x589db5){if(_0x589db5[_0x8f0a('0x3e')]!==_0x8f0a('0x3f')){var _0x52c2c6={};_0x52c2c6[_0x589db5[_0x8f0a('0x28')]]={'$like':'%'+_0x2f92e3[_0x8f0a('0x33')]['filter']+'%'};return _0x52c2c6;}})});}_0x360acd=_[_0x8f0a('0x3d')]({},_0x360acd,_0x2f92e3['options']);var _0x8f1fcb={'where':_0x360acd[_0x8f0a('0x3a')]};return db[_0x8f0a('0x2c')][_0x8f0a('0x1e')](_0x8f1fcb)[_0x8f0a('0x24')](function(_0x381510){_0x317db5['count']=_0x381510;if(_0x2f92e3[_0x8f0a('0x33')][_0x8f0a('0x40')]){_0x360acd[_0x8f0a('0x41')]=[{'all':!![]}];}return db[_0x8f0a('0x2c')][_0x8f0a('0x42')](_0x360acd);})[_0x8f0a('0x24')](function(_0x55224f){_0x317db5[_0x8f0a('0x43')]=_0x55224f;return _0x317db5;})[_0x8f0a('0x24')](respondWithFilteredResult(_0x2204a8,_0x360acd))[_0x8f0a('0x44')](handleError(_0x2204a8,null));};exports[_0x8f0a('0x45')]=function(_0x16949f,_0x29d16f){var _0x4188cd={'raw':!![],'where':{'id':_0x16949f[_0x8f0a('0x46')]['id']}},_0x458210={};_0x458210['model']=_[_0x8f0a('0x47')](db[_0x8f0a('0x2c')][_0x8f0a('0x2d')]);_0x458210[_0x8f0a('0x33')]=_[_0x8f0a('0x47')](_0x16949f[_0x8f0a('0x33')]);_0x458210[_0x8f0a('0x30')]=_['intersection'](_0x458210[_0x8f0a('0x32')],_0x458210[_0x8f0a('0x33')]);_0x4188cd[_0x8f0a('0x34')]=_[_0x8f0a('0x31')](_0x458210[_0x8f0a('0x32')],qs[_0x8f0a('0x35')](_0x16949f[_0x8f0a('0x33')][_0x8f0a('0x35')]));_0x4188cd[_0x8f0a('0x34')]=_0x4188cd[_0x8f0a('0x34')][_0x8f0a('0x36')]?_0x4188cd[_0x8f0a('0x34')]:_0x458210['model'];if(_0x16949f[_0x8f0a('0x33')][_0x8f0a('0x40')]){_0x4188cd['include']=[{'all':!![]}];}_0x4188cd=_['merge']({},_0x4188cd,_0x16949f['options']);return db[_0x8f0a('0x2c')][_0x8f0a('0x48')](_0x4188cd)[_0x8f0a('0x24')](handleEntityNotFound(_0x29d16f,null))[_0x8f0a('0x24')](respondWithResult(_0x29d16f,null))[_0x8f0a('0x44')](handleError(_0x29d16f,null));};exports[_0x8f0a('0x49')]=function(_0xfb5b47,_0x8335c){return db[_0x8f0a('0x2c')][_0x8f0a('0x49')](_0xfb5b47['body'],{})[_0x8f0a('0x24')](respondWithResult(_0x8335c,0xc9))['catch'](handleError(_0x8335c,null));};exports[_0x8f0a('0x23')]=function(_0x40334d,_0x5a1b7d){if(_0x40334d[_0x8f0a('0x4a')]['id']){delete _0x40334d[_0x8f0a('0x4a')]['id'];}return db[_0x8f0a('0x2c')][_0x8f0a('0x48')]({'where':{'id':_0x40334d['params']['id']}})[_0x8f0a('0x24')](handleEntityNotFound(_0x5a1b7d,null))[_0x8f0a('0x24')](saveUpdates(_0x40334d[_0x8f0a('0x4a')],null))[_0x8f0a('0x24')](respondWithResult(_0x5a1b7d,null))[_0x8f0a('0x44')](handleError(_0x5a1b7d,null));};exports[_0x8f0a('0x25')]=function(_0x19e4be,_0x523da3){return db[_0x8f0a('0x2c')][_0x8f0a('0x48')]({'where':{'id':_0x19e4be[_0x8f0a('0x46')]['id']}})[_0x8f0a('0x24')](handleEntityNotFound(_0x523da3,null))[_0x8f0a('0x24')](removeEntity(_0x523da3,null))['catch'](handleError(_0x523da3,null));};exports[_0x8f0a('0x4b')]=function(_0x2175f0,_0x11f4c0){return db['ChatTransferReport'][_0x8f0a('0x4b')]()[_0x8f0a('0x24')](respondWithResult(_0x11f4c0,null))[_0x8f0a('0x44')](handleError(_0x11f4c0,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index d8ec4cc..8fe0b16 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 _0xebe3=['./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','api','moment','../../config/environment'];(function(_0x3165c0,_0x429078){var _0x5d7e16=function(_0x184539){while(--_0x184539){_0x3165c0['push'](_0x3165c0['shift']());}};_0x5d7e16(++_0x429078);}(_0xebe3,0x73));var _0x3ebe=function(_0x4211f6,_0x4934e6){_0x4211f6=_0x4211f6-0x0;var _0x1253f2=_0xebe3[_0x4211f6];return _0x1253f2;};'use strict';var _=require(_0x3ebe('0x0'));var util=require(_0x3ebe('0x1'));var logger=require('../../config/logger')(_0x3ebe('0x2'));var moment=require(_0x3ebe('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3ebe('0x4'));var attributes=require(_0x3ebe('0x5'));module['exports']=function(_0x57ea6f,_0x39b3e3){return _0x57ea6f[_0x3ebe('0x6')](_0x3ebe('0x7'),attributes,{'tableName':_0x3ebe('0x8'),'paranoid':![],'indexes':[{'name':_0x3ebe('0x9'),'fields':[_0x3ebe('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1dbc=['request-promise','path','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2940a6,_0x3a84ac){var _0x1461cc=function(_0x19598f){while(--_0x19598f){_0x2940a6['push'](_0x2940a6['shift']());}};_0x1461cc(++_0x3a84ac);}(_0x1dbc,0xe8));var _0xc1db=function(_0x590b63,_0x14debb){_0x590b63=_0x590b63-0x0;var _0x3c9380=_0x1dbc[_0x590b63];return _0x3c9380;};'use strict';var _=require(_0xc1db('0x0'));var util=require(_0xc1db('0x1'));var logger=require(_0xc1db('0x2'))(_0xc1db('0x3'));var moment=require(_0xc1db('0x4'));var BPromise=require(_0xc1db('0x5'));var rp=require(_0xc1db('0x6'));var fs=require('fs');var path=require(_0xc1db('0x7'));var rimraf=require('rimraf');var config=require(_0xc1db('0x8'));var attributes=require(_0xc1db('0x9'));module[_0xc1db('0xa')]=function(_0x2e068c,_0x2f56f6){return _0x2e068c[_0xc1db('0xb')](_0xc1db('0xc'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xc1db('0xd'),'fields':[_0xc1db('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index c9a73d3..5bf3c48 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 _0x0aae=['ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x0aae,0xb9));var _0xe0aa=function(_0x513c0c,_0x3fc365){_0x513c0c=_0x513c0c-0x0;var _0x5ee35b=_0x0aae[_0x513c0c];return _0x5ee35b;};'use strict';var _=require('lodash');var util=require(_0xe0aa('0x0'));var moment=require(_0xe0aa('0x1'));var BPromise=require(_0xe0aa('0x2'));var rs=require(_0xe0aa('0x3'));var fs=require('fs');var Redis=require(_0xe0aa('0x4'));var db=require(_0xe0aa('0x5'))['db'];var utils=require(_0xe0aa('0x6'));var logger=require('../../config/logger')(_0xe0aa('0x7'));var config=require(_0xe0aa('0x8'));var jayson=require(_0xe0aa('0x9'));var client=jayson[_0xe0aa('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x320a2d,_0x186392,_0x5afb10){return new BPromise(function(_0x1919ab,_0x2b2920){return client['request'](_0x320a2d,_0x5afb10)[_0xe0aa('0xb')](function(_0x3d1118){logger[_0xe0aa('0xc')](_0xe0aa('0xd'),_0x186392,_0xe0aa('0xe'));logger[_0xe0aa('0xf')](_0xe0aa('0x10'),_0x186392,_0xe0aa('0xe'),JSON[_0xe0aa('0x11')](_0x3d1118));if(_0x3d1118[_0xe0aa('0x12')]){if(_0x3d1118[_0xe0aa('0x12')]['code']===0x1f4){logger[_0xe0aa('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x186392,_0x3d1118[_0xe0aa('0x12')]['message']);return _0x2b2920(_0x3d1118[_0xe0aa('0x12')][_0xe0aa('0x13')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x186392,_0x3d1118[_0xe0aa('0x12')][_0xe0aa('0x13')]);return _0x1919ab(_0x3d1118[_0xe0aa('0x12')][_0xe0aa('0x13')]);}else{logger['info'](_0xe0aa('0xd'),_0x186392,'request\x20sent');_0x1919ab(_0x3d1118[_0xe0aa('0x14')][_0xe0aa('0x13')]);}})[_0xe0aa('0x15')](function(_0xaa4fa5){logger[_0xe0aa('0x12')](_0xe0aa('0xd'),_0x186392,_0xaa4fa5);_0x2b2920(_0xaa4fa5);});});}
\ No newline at end of file
+var _0xa7cf=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','request\x20sent'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa7cf,0xf1));var _0xfa7c=function(_0x1bfe2b,_0x34856e){_0x1bfe2b=_0x1bfe2b-0x0;var _0x1477d4=_0xa7cf[_0x1bfe2b];return _0x1477d4;};'use strict';var _=require(_0xfa7c('0x0'));var util=require(_0xfa7c('0x1'));var moment=require(_0xfa7c('0x2'));var BPromise=require(_0xfa7c('0x3'));var rs=require(_0xfa7c('0x4'));var fs=require('fs');var Redis=require(_0xfa7c('0x5'));var db=require(_0xfa7c('0x6'))['db'];var utils=require(_0xfa7c('0x7'));var logger=require(_0xfa7c('0x8'))(_0xfa7c('0x9'));var config=require(_0xfa7c('0xa'));var jayson=require(_0xfa7c('0xb'));var client=jayson[_0xfa7c('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1fcc11,_0x213497,_0x107826){return new BPromise(function(_0x3250b5,_0x4483fd){return client['request'](_0x1fcc11,_0x107826)[_0xfa7c('0xd')](function(_0x5d5bb1){logger[_0xfa7c('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x213497,'request\x20sent');logger[_0xfa7c('0xf')](_0xfa7c('0x10'),_0x213497,'request\x20sent',JSON[_0xfa7c('0x11')](_0x5d5bb1));if(_0x5d5bb1[_0xfa7c('0x12')]){if(_0x5d5bb1['error'][_0xfa7c('0x13')]===0x1f4){logger['error'](_0xfa7c('0x14'),_0x213497,_0x5d5bb1[_0xfa7c('0x12')][_0xfa7c('0x15')]);return _0x4483fd(_0x5d5bb1[_0xfa7c('0x12')][_0xfa7c('0x15')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x213497,_0x5d5bb1[_0xfa7c('0x12')][_0xfa7c('0x15')]);return _0x3250b5(_0x5d5bb1[_0xfa7c('0x12')][_0xfa7c('0x15')]);}else{logger[_0xfa7c('0xe')](_0xfa7c('0x14'),_0x213497,_0xfa7c('0x16'));_0x3250b5(_0x5d5bb1[_0xfa7c('0x17')][_0xfa7c('0x15')]);}})['catch'](function(_0x19ec52){logger[_0xfa7c('0x12')](_0xfa7c('0x14'),_0x213497,_0x19ec52);_0x4483fd(_0x19ec52);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 6c4b556..2da1433 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 _0x16c1=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','create','update','delete','destroy','multer','path'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x16c1,0xe8));var _0x116c=function(_0x2bdc70,_0x4464f9){_0x2bdc70=_0x2bdc70-0x0;var _0x5494ac=_0x16c1[_0x2bdc70];return _0x5494ac;};'use strict';var multer=require(_0x116c('0x0'));var util=require('util');var path=require(_0x116c('0x1'));var timeout=require(_0x116c('0x2'));var express=require(_0x116c('0x3'));var router=express[_0x116c('0x4')]();var fs_extra=require(_0x116c('0x5'));var auth=require(_0x116c('0x6'));var interaction=require(_0x116c('0x7'));var config=require('../../config/environment');var controller=require(_0x116c('0x8'));router[_0x116c('0x9')]('/',auth[_0x116c('0xa')](),controller['index']);router[_0x116c('0x9')](_0x116c('0xb'),auth[_0x116c('0xa')](),controller[_0x116c('0xc')]);router[_0x116c('0x9')](_0x116c('0xd'),auth[_0x116c('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x116c('0xe')]);router['put'](_0x116c('0xd'),auth[_0x116c('0xa')](),controller[_0x116c('0xf')]);router[_0x116c('0x10')](_0x116c('0xd'),auth['isAuthenticated'](),controller[_0x116c('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x9cfb=['connect-timeout','fs-extra','../../config/environment','./chatTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','exports','multer','util'];(function(_0x3fcc20,_0x57c31b){var _0x15d3ce=function(_0x575619){while(--_0x575619){_0x3fcc20['push'](_0x3fcc20['shift']());}};_0x15d3ce(++_0x57c31b);}(_0x9cfb,0xa8));var _0xb9cf=function(_0xf2ad49,_0xfc0721){_0xf2ad49=_0xf2ad49-0x0;var _0x388626=_0x9cfb[_0xf2ad49];return _0x388626;};'use strict';var multer=require(_0xb9cf('0x0'));var util=require(_0xb9cf('0x1'));var path=require('path');var timeout=require(_0xb9cf('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb9cf('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb9cf('0x4'));var controller=require(_0xb9cf('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb9cf('0x6')](_0xb9cf('0x7'),auth[_0xb9cf('0x8')](),controller[_0xb9cf('0x9')]);router[_0xb9cf('0x6')](_0xb9cf('0xa'),auth['isAuthenticated'](),controller[_0xb9cf('0xb')]);router[_0xb9cf('0xc')]('/',auth[_0xb9cf('0x8')](),controller[_0xb9cf('0xd')]);router[_0xb9cf('0xe')](_0xb9cf('0xa'),auth[_0xb9cf('0x8')](),controller[_0xb9cf('0xf')]);router['delete']('/:id',auth[_0xb9cf('0x8')](),controller['destroy']);module[_0xb9cf('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index a61fd32..96b8e21 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 _0x18c0=['Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','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.','Skip','bottom_right','CHAT','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message'];(function(_0x36befb,_0x12559c){var _0x479e63=function(_0x3a1f39){while(--_0x3a1f39){_0x36befb['push'](_0x36befb['shift']());}};_0x479e63(++_0x12559c);}(_0x18c0,0x174));var _0x018c=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x18c0[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0x018c('0x0'));var rs=require(_0x018c('0x1'));module[_0x018c('0x2')]={'name':{'type':Sequelize[_0x018c('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x018c('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x018c('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x018c('0x3')],'allowNull':![],'defaultValue':_0x018c('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x018c('0x3')],'allowNull':![],'defaultValue':_0x018c('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x018c('0x3')],'allowNull':![],'defaultValue':_0x018c('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x018c('0x3')],'allowNull':![],'defaultValue':_0x018c('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x018c('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x018c('0x3')]},'animation':{'type':Sequelize[_0x018c('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x018c('0x9')](_0x018c('0xa'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0xb')},'offline_chat_button':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0xd')},'download_transcript':{'type':Sequelize[_0x018c('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x018c('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x018c('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x018c('0xf')]},'closingQuestion':{'type':Sequelize[_0x018c('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0x10')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0x11')},'noteTitle':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0x13')},'closingMessage':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0x14')},'closingMessageButton':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x018c('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x018c('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0x15')},'ratingType':{'type':Sequelize[_0x018c('0x9')](_0x018c('0x16'),_0x018c('0x17')),'defaultValue':_0x018c('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x018c('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x018c('0x18')]({'items':[{'type':_0x018c('0x19'),'variable':null,'config':{'placeholder':_0x018c('0x1a'),'type':'text','required':!![]},'props':{'title':_0x018c('0x1a'),'helpText':''}},{'type':_0x018c('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x018c('0x4'),'type':_0x018c('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x018c('0x1b')](_0x018c('0x1c'))?JSON[_0x018c('0x1d')](this[_0x018c('0x1b')]('onlineForm')):{};},'set':function(_0xa88043){return this[_0x018c('0x1e')]('onlineForm',JSON['stringify'](_0xa88043));}},'offlineForm':{'type':Sequelize[_0x018c('0xf')],'defaultValue':function(){return JSON[_0x018c('0x18')]({'items':[{'type':'input','props':{'title':_0x018c('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x018c('0x4'),'type':_0x018c('0x4')},'variable':null},{'type':_0x018c('0x1f'),'config':{'placeholder':_0x018c('0x20')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x018c('0x1b')](_0x018c('0x21'))?JSON['parse'](this['getDataValue'](_0x018c('0x21'))):{};},'set':function(_0x578da3){return this[_0x018c('0x1e')](_0x018c('0x21'),JSON[_0x018c('0x18')](_0x578da3));}},'token':{'type':Sequelize[_0x018c('0x3')],'defaultValue':function(){return rs[_0x018c('0x22')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x018c('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x018c('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0x23')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0x24')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x018c('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0x26')},'skipUnmanaged':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0x27')},'sendUnmanaged':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x018c('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x018c('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x018c('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x018c('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x018c('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x018c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x018c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0x28')},'verticalAlignment':{'type':Sequelize[_0x018c('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0x29')},'messagesAlignment':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0x2a')},'defaultTitle':{'type':Sequelize[_0x018c('0x3')]},'customerAvatar':{'type':Sequelize[_0x018c('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x018c('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x018c('0x3')],'allowNull':![],'defaultValue':_0x018c('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x018c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0x2c')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x018c('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x018c('0x8')],'defaultValue':![],'comment':_0x018c('0x2d'),'set':function(_0x5a6d80){if(!_0x5a6d80)this[_0x018c('0x1e')](_0x018c('0x2e'),null);this[_0x018c('0x1e')](_0x018c('0x2f'),_0x5a6d80);}},'vidaooEscalation':{'type':Sequelize[_0x018c('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x018c('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x018c('0x30')},'vidaooNote':{'type':Sequelize[_0x018c('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x018c('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x018c('0xf')]}};
\ No newline at end of file
+var _0xb628=['exports','STRING','email','#011F6A','#ffffff','INTEGER','ENUM','rounded','We\x20are\x20here!','Send','Contact\x20us','BOOLEAN','TEXT','Form\x20properly\x20submitted','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','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','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring'];(function(_0x595fea,_0x1f7e6f){var _0x20ce9b=function(_0xc167d1){while(--_0xc167d1){_0x595fea['push'](_0x595fea['shift']());}};_0x20ce9b(++_0x1f7e6f);}(_0xb628,0xf3));var _0x8b62=function(_0x1e42f2,_0x1fece5){_0x1e42f2=_0x1e42f2-0x0;var _0x262489=_0xb628[_0x1e42f2];return _0x262489;};'use strict';var Sequelize=require(_0x8b62('0x0'));var rs=require(_0x8b62('0x1'));module[_0x8b62('0x2')]={'name':{'type':Sequelize[_0x8b62('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x8b62('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x8b62('0x3')]},'mapKey':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x4')},'mapKeyOffline':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x8b62('0x3')],'allowNull':![],'defaultValue':_0x8b62('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x8b62('0x3')],'allowNull':![],'defaultValue':_0x8b62('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x8b62('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x8b62('0x3')],'allowNull':![],'defaultValue':_0x8b62('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x8b62('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x8b62('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x8b62('0x8')](_0x8b62('0x9'),'squared'),'defaultValue':_0x8b62('0x9')},'header_online':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0xa')},'start_chat_button':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0xb')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x8b62('0xc')},'download_transcript':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x8b62('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x8b62('0xe')]},'closingQuestion':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x10')},'closingMessage':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x11')},'closingMessageButton':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0xb')},'skipMessageButton':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x12')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x13')},'ratingType':{'type':Sequelize[_0x8b62('0x8')](_0x8b62('0x14'),_0x8b62('0x15')),'defaultValue':_0x8b62('0x14')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x8b62('0xe')],'defaultValue':function(){return JSON[_0x8b62('0x16')]({'items':[{'type':_0x8b62('0x17'),'variable':null,'config':{'placeholder':_0x8b62('0x18'),'type':_0x8b62('0x19'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x8b62('0x1a')](_0x8b62('0x1b'))?JSON[_0x8b62('0x1c')](this[_0x8b62('0x1a')](_0x8b62('0x1b'))):{};},'set':function(_0x31afe8){return this['setDataValue'](_0x8b62('0x1b'),JSON[_0x8b62('0x16')](_0x31afe8));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x8b62('0x16')]({'items':[{'type':_0x8b62('0x17'),'props':{'title':_0x8b62('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x8b62('0x4'),'type':_0x8b62('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x8b62('0x1d'),'helpText':_0x8b62('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0x8b62('0x1a')]('offlineForm')?JSON['parse'](this[_0x8b62('0x1a')](_0x8b62('0x1f'))):{};},'set':function(_0x158e24){return this[_0x8b62('0x20')](_0x8b62('0x1f'),JSON[_0x8b62('0x16')](_0x158e24));}},'token':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':function(){return rs[_0x8b62('0x21')]();}},'autoclose':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x8b62('0x3')]},'forwardOffline':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x22')},'waitingMessage':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x23')},'offlineMessageSubject':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x24')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x8b62('0x25')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x26')},'skipUnmanaged':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x12')},'sendUnmanaged':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x8b62('0xe')]},'showAgentAvatar':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x8b62('0x3')]},'notificationTemplate':{'type':Sequelize[_0x8b62('0xe')],'defaultValue':function(){return _0x8b62('0x27');}},'notificationSound':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x8b62('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x8b62('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x29')},'verticalAlignment':{'type':Sequelize[_0x8b62('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x2a')},'messagesAlignment':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x2b')},'defaultTitle':{'type':Sequelize[_0x8b62('0x3')]},'customerAvatar':{'type':Sequelize[_0x8b62('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x8b62('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x2c')},'systemAvatar':{'type':Sequelize[_0x8b62('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8b62('0x7')],'comment':_0x8b62('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':![],'comment':_0x8b62('0x2e'),'set':function(_0x35b2e3){if(!_0x35b2e3)this[_0x8b62('0x20')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x35b2e3);}},'vidaooEscalation':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x8b62('0x3')],'allowNull':![],'defaultValue':_0x8b62('0x2f')},'vidaooNote':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':function(){return _0x8b62('0x30');}},'vidaooMetadata':{'type':Sequelize[_0x8b62('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x8b62('0xe')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index f0c7605..3ad1ea9 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 _0x70e0=['getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','toPairsIn','mapValues','Chat','NotifyMailAccount','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','hasOwnProperty','Owner','fullname','Tag','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','../../config/license/util','License','increment','chatLicenseExceeded','all','some','URL','origin','remote','x-real-ip','connection','remoteAddress','virtual','render','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getProactiveActions','getFields','online','false','onlineForm','items','fromKey','Contact','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','fs-extra','lodash','querystring','ioredis','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','type','key','model','keys','query','filters','attributes','fields','length','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','rows','show','params','rawAttributes','intersection','create','user','get','role','ChatWebsites','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','addDisposition','ChatWebsiteId','pick','Disposition','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','Sequelize','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','DESC','ChatApplication','Applications','List','applications','orderBy','priority','account','Contacts','contact','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','agent','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','startRouting','EventManager','offline','files','CompanyId','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress'];(function(_0x4fe35d,_0x21fee1){var _0x5bb28e=function(_0x214051){while(--_0x214051){_0x4fe35d['push'](_0x4fe35d['shift']());}};_0x5bb28e(++_0x21fee1);}(_0x70e0,0x17b));var _0x070e=function(_0x37f1d9,_0x95a04f){_0x37f1d9=_0x37f1d9-0x0;var _0x47413d=_0x70e0[_0x37f1d9];return _0x47413d;};'use strict';var BPromise=require(_0x070e('0x0'));var Mustache=require(_0x070e('0x1'));var util=require(_0x070e('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x070e('0x3'));var _=require(_0x070e('0x4'));var querystring=require(_0x070e('0x5'));var Redis=require(_0x070e('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x070e('0x7'))('api');var config=require(_0x070e('0x8'));var url=require('url');var db=require('../../mysqldb')['db'];config['redis']=_[_0x070e('0x9')](config[_0x070e('0xa')],{'host':_0x070e('0xb'),'port':0x18eb});var socket=require(_0x070e('0xc'))(new Redis(config[_0x070e('0xa')]));require(_0x070e('0xd'))[_0x070e('0xe')](socket);var htmlToText=require('html-to-text');var jayson=require('jayson/promise');var client=jayson[_0x070e('0xf')][_0x070e('0x10')]({'port':0x232c});var client9002=jayson[_0x070e('0xf')][_0x070e('0x10')]({'port':0x232a});var client9003=jayson[_0x070e('0xf')][_0x070e('0x10')]({'port':0x232b});var client9001=jayson[_0x070e('0xf')][_0x070e('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x39d2b9,_0x5bf079,_0x2930b8,_0x52da3b){return new BPromise(function(_0x5dca0f,_0x24baba){var _0x56c7ba=_0x52da3b||client;return _0x56c7ba['request'](_0x39d2b9,_0x2930b8)['then'](function(_0x11d2ce){logger[_0x070e('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x5bf079,'request\x20sent');logger[_0x070e('0x12')](_0x070e('0x13'),_0x5bf079,_0x070e('0x14'),JSON[_0x070e('0x15')](_0x11d2ce));if(_0x11d2ce['error']){if(_0x11d2ce['error'][_0x070e('0x16')]===0x1f4){logger[_0x070e('0x17')](_0x070e('0x18'),_0x5bf079,_0x11d2ce[_0x070e('0x17')][_0x070e('0x19')]);return _0x24baba(_0x11d2ce['error'][_0x070e('0x19')]);}logger[_0x070e('0x17')](_0x070e('0x18'),_0x5bf079,_0x11d2ce[_0x070e('0x17')][_0x070e('0x19')]);return _0x5dca0f(_0x11d2ce['error']['message']);}else{logger['info'](_0x070e('0x18'),_0x5bf079,_0x070e('0x14'));_0x5dca0f(_0x11d2ce[_0x070e('0x1a')]['message']);}})[_0x070e('0x1b')](function(_0x5dc5d2){logger[_0x070e('0x17')](_0x070e('0x18'),_0x5bf079,_0x5dc5d2);_0x24baba(_0x5dc5d2);});});}function respondWithStatusCode(_0x27a01e,_0x33e8c6){_0x33e8c6=_0x33e8c6||0xcc;return function(_0x28a1c3){if(_0x28a1c3){return _0x27a01e[_0x070e('0x1c')](_0x33e8c6);}return _0x27a01e[_0x070e('0x1d')](_0x33e8c6)[_0x070e('0x1e')]();};}function respondWithResult(_0x595c7e,_0x2f8055){_0x2f8055=_0x2f8055||0xc8;return function(_0x270061){if(_0x270061){return _0x595c7e[_0x070e('0x1d')](_0x2f8055)['json'](_0x270061);}};}function respondWithFilteredResult(_0xf17c56,_0x5f3e9d){return function(_0x4a2dbd){if(_0x4a2dbd){var _0x2ccbd7=typeof _0x5f3e9d[_0x070e('0x1f')]===_0x070e('0x20')&&typeof _0x5f3e9d[_0x070e('0x21')]===_0x070e('0x20');var _0x497f58=_0x4a2dbd[_0x070e('0x22')];var _0x219e48=_0x2ccbd7?0x0:_0x5f3e9d[_0x070e('0x1f')];var _0x1d2a34=_0x2ccbd7?_0x4a2dbd[_0x070e('0x22')]:_0x5f3e9d[_0x070e('0x1f')]+_0x5f3e9d[_0x070e('0x21')];var _0x26373b;if(_0x1d2a34>=_0x497f58){_0x1d2a34=_0x497f58;_0x26373b=0xc8;}else{_0x26373b=0xce;}_0xf17c56['status'](_0x26373b);return _0xf17c56[_0x070e('0x23')](_0x070e('0x24'),_0x219e48+'-'+_0x1d2a34+'/'+_0x497f58)[_0x070e('0x25')](_0x4a2dbd);}return null;};}function saveUpdates(_0x56fc12){return function(_0x5c5f0d){if(_0x5c5f0d){return _0x5c5f0d[_0x070e('0x26')](_0x56fc12)[_0x070e('0x27')](function(_0xa6c0ab){return _0xa6c0ab;});}return null;};}function removeEntity(_0x51402c){return function(_0x3fa994){if(_0x3fa994){return _0x3fa994[_0x070e('0x28')]()[_0x070e('0x27')](function(){var _0x5f2bee=_0x3fa994['get']({'plain':!![]});var _0x5bf522='ChatWebsites';return db['UserProfileResource'][_0x070e('0x28')]({'where':{'type':_0x5bf522,'resourceId':_0x5f2bee['id']}})['then'](function(){return _0x3fa994;});})[_0x070e('0x27')](function(){_0x51402c[_0x070e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47a739){return function(_0x699739){if(!_0x699739){_0x47a739[_0x070e('0x1c')](0x194);}return _0x699739;};}function handleError(_0x55288a,_0x546a16){_0x546a16=_0x546a16||0x1f4;return function(_0x41ade4){logger[_0x070e('0x17')](_0x41ade4[_0x070e('0x29')]);if(_0x41ade4[_0x070e('0x2a')]){delete _0x41ade4[_0x070e('0x2a')];}_0x55288a['status'](_0x546a16)['send'](_0x41ade4);};}exports[_0x070e('0x2b')]=function(_0x3011c4,_0x4bb439){var _0xf57ed={'include':[{'model':db[_0x070e('0x2c')],'as':_0x070e('0x2d')}]},_0xf11439={},_0x4deaf8={'count':0x0,'rows':[]};var _0x534150=_[_0x070e('0x2e')](db[_0x070e('0x2f')]['rawAttributes'],function(_0x4d4ee8){return{'name':_0x4d4ee8['fieldName'],'type':_0x4d4ee8[_0x070e('0x30')][_0x070e('0x31')]};});_0xf11439[_0x070e('0x32')]=_[_0x070e('0x2e')](_0x534150,_0x070e('0x2a'));_0xf11439['query']=_[_0x070e('0x33')](_0x3011c4[_0x070e('0x34')]);_0xf11439[_0x070e('0x35')]=_['intersection'](_0xf11439[_0x070e('0x32')],_0xf11439[_0x070e('0x34')]);_0xf57ed[_0x070e('0x36')]=_['intersection'](_0xf11439[_0x070e('0x32')],qs[_0x070e('0x37')](_0x3011c4['query'][_0x070e('0x37')]));_0xf57ed['attributes']=_0xf57ed[_0x070e('0x36')][_0x070e('0x38')]?_0xf57ed[_0x070e('0x36')]:_0xf11439[_0x070e('0x32')];if(!_0x3011c4[_0x070e('0x34')]['hasOwnProperty'](_0x070e('0x39'))){_0xf57ed['limit']=qs['limit'](_0x3011c4[_0x070e('0x34')][_0x070e('0x21')]);_0xf57ed[_0x070e('0x1f')]=qs['offset'](_0x3011c4[_0x070e('0x34')][_0x070e('0x1f')]);}_0xf57ed[_0x070e('0x3a')]=qs[_0x070e('0x3b')](_0x3011c4['query'][_0x070e('0x3b')]);_0xf57ed['where']=qs['filters'](_['pick'](_0x3011c4[_0x070e('0x34')],_0xf11439[_0x070e('0x35')]),_0x534150);if(_0x3011c4[_0x070e('0x34')][_0x070e('0x3c')]){_0xf57ed[_0x070e('0x3d')]=_['merge'](_0xf57ed[_0x070e('0x3d')],{'$or':_['map'](_0x534150,function(_0x23dac5){if(_0x23dac5[_0x070e('0x30')]!==_0x070e('0x3e')){var _0x52fcea={};_0x52fcea[_0x23dac5['name']]={'$like':'%'+_0x3011c4[_0x070e('0x34')]['filter']+'%'};return _0x52fcea;}})});}_0xf57ed=_[_0x070e('0x3f')]({},_0xf57ed,_0x3011c4[_0x070e('0x40')]);var _0x139820={'where':_0xf57ed['where']};return db[_0x070e('0x2f')][_0x070e('0x22')](_0x139820)['then'](function(_0x589b97){_0x4deaf8[_0x070e('0x22')]=_0x589b97;if(_0x3011c4[_0x070e('0x34')][_0x070e('0x41')]){_0xf57ed[_0x070e('0x42')]=[{'all':!![]}];}return db[_0x070e('0x2f')]['findAll'](_0xf57ed);})[_0x070e('0x27')](function(_0x3f6c64){_0x4deaf8[_0x070e('0x43')]=_0x3f6c64;return _0x4deaf8;})[_0x070e('0x27')](respondWithFilteredResult(_0x4bb439,_0xf57ed))[_0x070e('0x1b')](handleError(_0x4bb439,null));};exports[_0x070e('0x44')]=function(_0x1f54d5,_0x1b5374){var _0xd67987={'raw':![],'where':{'id':_0x1f54d5[_0x070e('0x45')]['id']},'include':[{'model':db[_0x070e('0x2c')],'as':_0x070e('0x2d')}]},_0x66a3f3={};_0x66a3f3[_0x070e('0x32')]=_[_0x070e('0x33')](db['ChatWebsite'][_0x070e('0x46')]);_0x66a3f3[_0x070e('0x34')]=_[_0x070e('0x33')](_0x1f54d5[_0x070e('0x34')]);_0x66a3f3[_0x070e('0x35')]=_[_0x070e('0x47')](_0x66a3f3[_0x070e('0x32')],_0x66a3f3[_0x070e('0x34')]);_0xd67987[_0x070e('0x36')]=_['intersection'](_0x66a3f3[_0x070e('0x32')],qs['fields'](_0x1f54d5[_0x070e('0x34')][_0x070e('0x37')]));_0xd67987['attributes']=_0xd67987[_0x070e('0x36')][_0x070e('0x38')]?_0xd67987[_0x070e('0x36')]:_0x66a3f3[_0x070e('0x32')];if(_0x1f54d5[_0x070e('0x34')][_0x070e('0x41')]){_0xd67987[_0x070e('0x42')]=[{'all':!![]}];}_0xd67987=_['merge']({},_0xd67987,_0x1f54d5[_0x070e('0x40')]);return db['ChatWebsite']['find'](_0xd67987)[_0x070e('0x27')](handleEntityNotFound(_0x1b5374,null))[_0x070e('0x27')](respondWithResult(_0x1b5374,null))[_0x070e('0x1b')](handleError(_0x1b5374,null));};exports[_0x070e('0x48')]=function(_0x202015,_0x7948ed){return db[_0x070e('0x2f')][_0x070e('0x48')](_0x202015['body'],{})[_0x070e('0x27')](function(_0x51d27d){var _0x564d82=_0x202015[_0x070e('0x49')][_0x070e('0x4a')]({'plain':!![]});if(!_0x564d82)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x564d82[_0x070e('0x4b')]===_0x070e('0x49')){var _0x210f4a=_0x51d27d[_0x070e('0x4a')]({'plain':!![]});var _0x1aacfc=_0x070e('0x4c');return db[_0x070e('0x4d')]['find']({'where':{'name':_0x1aacfc,'userProfileId':_0x564d82['userProfileId']},'raw':!![]})['then'](function(_0x3087e5){if(_0x3087e5&&_0x3087e5[_0x070e('0x4e')]===0x0){return db[_0x070e('0x4f')][_0x070e('0x48')]({'name':_0x210f4a['name'],'resourceId':_0x210f4a['id'],'type':_0x3087e5[_0x070e('0x2a')],'sectionId':_0x3087e5['id']},{})['then'](function(){return _0x51d27d;});}else{return _0x51d27d;}})[_0x070e('0x1b')](function(_0x1cbb7e){logger[_0x070e('0x17')](_0x070e('0x50'),_0x1cbb7e);throw _0x1cbb7e;});}return _0x51d27d;})[_0x070e('0x27')](respondWithResult(_0x7948ed,0xc9))[_0x070e('0x1b')](handleError(_0x7948ed,null));};exports['update']=function(_0x20ff87,_0x18e8d0){if(_0x20ff87[_0x070e('0x51')]['id']){delete _0x20ff87['body']['id'];}return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x20ff87['params']['id']},'include':[{'model':db[_0x070e('0x2c')],'as':'mandatoryDispositionPause'}]})[_0x070e('0x27')](handleEntityNotFound(_0x18e8d0,null))['then'](saveUpdates(_0x20ff87['body'],null))['then'](respondWithResult(_0x18e8d0,null))[_0x070e('0x1b')](handleError(_0x18e8d0,null));};exports[_0x070e('0x28')]=function(_0x1100d8,_0x122198){return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x1100d8['params']['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x122198,null))['then'](removeEntity(_0x122198,null))[_0x070e('0x1b')](handleError(_0x122198,null));};exports['describe']=function(_0x2e10f7,_0x34f410){return db['ChatWebsite'][_0x070e('0x53')]()['then'](respondWithResult(_0x34f410,null))[_0x070e('0x1b')](handleError(_0x34f410,null));};exports[_0x070e('0x54')]=function(_0x2f1604,_0x2b172a){if(_0x2f1604[_0x070e('0x51')]['id']){delete _0x2f1604[_0x070e('0x51')]['id'];}return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x2f1604[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x2b172a,null))[_0x070e('0x27')](function(_0x16887c){if(_0x16887c){_0x2f1604[_0x070e('0x51')][_0x070e('0x55')]=_0x16887c['id'];return db['Disposition'][_0x070e('0x48')](_0x2f1604[_0x070e('0x51')]);}})[_0x070e('0x27')](respondWithResult(_0x2b172a,null))[_0x070e('0x1b')](handleError(_0x2b172a,null));};exports['getDispositions']=function(_0x2ccd8d,_0x4e8e58){var _0x398f54={'raw':![],'where':{}};var _0x5625a9={};var _0x2a7b5d={'count':0x0,'rows':[]};return db[_0x070e('0x2f')]['findOne']({'where':{'id':_0x2ccd8d[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x4e8e58,null))[_0x070e('0x27')](function(_0x2fe202){if(_0x2fe202){_0x5625a9['model']=_[_0x070e('0x33')](db['Disposition'][_0x070e('0x46')]);_0x5625a9[_0x070e('0x34')]=_[_0x070e('0x33')](_0x2ccd8d[_0x070e('0x34')]);_0x5625a9[_0x070e('0x35')]=_['intersection'](_0x5625a9[_0x070e('0x32')],_0x5625a9[_0x070e('0x34')]);_0x398f54[_0x070e('0x36')]=_[_0x070e('0x47')](_0x5625a9['model'],qs[_0x070e('0x37')](_0x2ccd8d['query'][_0x070e('0x37')]));_0x398f54[_0x070e('0x36')]=_0x398f54[_0x070e('0x36')]['length']?_0x398f54[_0x070e('0x36')]:_0x5625a9['model'];if(!_0x2ccd8d[_0x070e('0x34')]['hasOwnProperty'](_0x070e('0x39'))){_0x398f54[_0x070e('0x21')]=qs['limit'](_0x2ccd8d[_0x070e('0x34')]['limit']);_0x398f54[_0x070e('0x1f')]=qs[_0x070e('0x1f')](_0x2ccd8d['query']['offset']);}_0x398f54[_0x070e('0x3a')]=qs[_0x070e('0x3b')](_0x2ccd8d[_0x070e('0x34')][_0x070e('0x3b')]);_0x398f54[_0x070e('0x3d')]=qs[_0x070e('0x35')](_[_0x070e('0x56')](_0x2ccd8d[_0x070e('0x34')],_0x5625a9[_0x070e('0x35')]));_0x398f54[_0x070e('0x3d')][_0x070e('0x55')]=_0x2fe202['id'];if(_0x2ccd8d[_0x070e('0x34')][_0x070e('0x3c')]){_0x398f54['where']=_[_0x070e('0x3f')](_0x398f54[_0x070e('0x3d')],{'$or':_['map'](_0x398f54['attributes'],function(_0x1916f4){var _0x2a4de5={};_0x2a4de5[_0x1916f4]={'$like':'%'+_0x2ccd8d[_0x070e('0x34')][_0x070e('0x3c')]+'%'};return _0x2a4de5;})});}_0x398f54=_[_0x070e('0x3f')]({},_0x398f54,_0x2ccd8d[_0x070e('0x40')]);return db[_0x070e('0x57')][_0x070e('0x22')]({'where':_0x398f54[_0x070e('0x3d')]})[_0x070e('0x27')](function(_0x62800d){_0x2a7b5d[_0x070e('0x22')]=_0x62800d;if(_0x2ccd8d[_0x070e('0x34')]['includeAll']){_0x398f54['include']=[{'all':!![]}];}return db['Disposition'][_0x070e('0x58')](_0x398f54);})[_0x070e('0x27')](function(_0x2c4e67){_0x2a7b5d[_0x070e('0x43')]=_0x2c4e67;return _0x2a7b5d;});}})['then'](respondWithFilteredResult(_0x4e8e58,_0x398f54))[_0x070e('0x1b')](handleError(_0x4e8e58,null));};exports[_0x070e('0x59')]=function(_0x416dde,_0xd74f9c){return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x416dde['params']['id']}})[_0x070e('0x27')](handleEntityNotFound(_0xd74f9c,null))['then'](function(_0x2e5bca){if(_0x2e5bca){return _0x2e5bca[_0x070e('0x59')](_0x416dde[_0x070e('0x34')][_0x070e('0x5a')]);}})[_0x070e('0x27')](respondWithStatusCode(_0xd74f9c,null))['catch'](handleError(_0xd74f9c,null));};exports[_0x070e('0x5b')]=function(_0x15450f,_0x5d3bd8){if(_0x15450f[_0x070e('0x51')]['id']){delete _0x15450f[_0x070e('0x51')]['id'];}return db['ChatWebsite'][_0x070e('0x52')]({'where':{'id':_0x15450f[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x5d3bd8,null))['then'](function(_0x40d7e6){if(_0x40d7e6){_0x15450f[_0x070e('0x51')][_0x070e('0x55')]=_0x40d7e6['id'];return db[_0x070e('0x5c')][_0x070e('0x48')](_0x15450f[_0x070e('0x51')]);}})[_0x070e('0x27')](respondWithResult(_0x5d3bd8,null))[_0x070e('0x1b')](handleError(_0x5d3bd8,null));};exports[_0x070e('0x5d')]=function(_0x31ab81,_0x1b1a0c){var _0x46d2b7={'raw':![],'where':{}};var _0x18c27a={};var _0x4b058d={'count':0x0,'rows':[]};return db[_0x070e('0x2f')][_0x070e('0x5e')]({'where':{'id':_0x31ab81[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x1b1a0c,null))[_0x070e('0x27')](function(_0x1d1aa2){if(_0x1d1aa2){_0x18c27a['model']=_['keys'](db['CannedAnswer'][_0x070e('0x46')]);_0x18c27a[_0x070e('0x34')]=_[_0x070e('0x33')](_0x31ab81[_0x070e('0x34')]);_0x18c27a['filters']=_[_0x070e('0x47')](_0x18c27a[_0x070e('0x32')],_0x18c27a[_0x070e('0x34')]);_0x46d2b7['attributes']=_[_0x070e('0x47')](_0x18c27a['model'],qs[_0x070e('0x37')](_0x31ab81[_0x070e('0x34')]['fields']));_0x46d2b7['attributes']=_0x46d2b7[_0x070e('0x36')][_0x070e('0x38')]?_0x46d2b7['attributes']:_0x18c27a[_0x070e('0x32')];if(!_0x31ab81['query']['hasOwnProperty']('nolimit')){_0x46d2b7[_0x070e('0x21')]=qs[_0x070e('0x21')](_0x31ab81[_0x070e('0x34')][_0x070e('0x21')]);_0x46d2b7[_0x070e('0x1f')]=qs[_0x070e('0x1f')](_0x31ab81[_0x070e('0x34')][_0x070e('0x1f')]);}_0x46d2b7[_0x070e('0x3a')]=qs[_0x070e('0x3b')](_0x31ab81[_0x070e('0x34')][_0x070e('0x3b')]);_0x46d2b7[_0x070e('0x3d')]=qs[_0x070e('0x35')](_[_0x070e('0x56')](_0x31ab81[_0x070e('0x34')],_0x18c27a[_0x070e('0x35')]));_0x46d2b7[_0x070e('0x3d')][_0x070e('0x55')]=_0x1d1aa2['id'];if(_0x31ab81[_0x070e('0x34')][_0x070e('0x3c')]){_0x46d2b7[_0x070e('0x3d')]=_['merge'](_0x46d2b7[_0x070e('0x3d')],{'$or':_[_0x070e('0x2e')](_0x46d2b7[_0x070e('0x36')],function(_0xe50b1b){var _0x495403={};_0x495403[_0xe50b1b]={'$like':'%'+_0x31ab81[_0x070e('0x34')][_0x070e('0x3c')]+'%'};return _0x495403;})});}_0x46d2b7=_[_0x070e('0x3f')]({},_0x46d2b7,_0x31ab81[_0x070e('0x40')]);return db[_0x070e('0x5c')][_0x070e('0x22')]({'where':_0x46d2b7['where']})['then'](function(_0x524a81){_0x4b058d[_0x070e('0x22')]=_0x524a81;if(_0x31ab81['query'][_0x070e('0x41')]){_0x46d2b7[_0x070e('0x42')]=[{'all':!![]}];}return db['CannedAnswer'][_0x070e('0x58')](_0x46d2b7);})[_0x070e('0x27')](function(_0x4f9a95){_0x4b058d['rows']=_0x4f9a95;return _0x4b058d;});}})[_0x070e('0x27')](respondWithFilteredResult(_0x1b1a0c,_0x46d2b7))[_0x070e('0x1b')](handleError(_0x1b1a0c,null));};exports[_0x070e('0x5f')]=function(_0x38f600,_0x6149cc){return db['ChatWebsite'][_0x070e('0x52')]({'where':{'id':_0x38f600['params']['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x6149cc,null))[_0x070e('0x27')](function(_0x490641){if(_0x490641){return _0x490641[_0x070e('0x5f')](_0x38f600[_0x070e('0x34')][_0x070e('0x5a')]);}})[_0x070e('0x27')](respondWithStatusCode(_0x6149cc,null))[_0x070e('0x1b')](handleError(_0x6149cc,null));};exports[_0x070e('0x60')]=function(_0x4bc490,_0x41a3cc){_0x4bc490[_0x070e('0x51')][_0x070e('0x61')]=_0x4bc490[_0x070e('0x62')][_0x070e('0x63')];return db['ChatWebsite'][_0x070e('0x52')]({'where':{'id':_0x4bc490[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x41a3cc,null))[_0x070e('0x27')](saveUpdates(_0x4bc490[_0x070e('0x51')],null))[_0x070e('0x27')](respondWithResult(_0x41a3cc,null))[_0x070e('0x1b')](handleError(_0x41a3cc,null));};exports[_0x070e('0x64')]=function(_0x1fb1e6,_0xfe61be){_0x1fb1e6[_0x070e('0x51')][_0x070e('0x65')]=_0x1fb1e6[_0x070e('0x62')][_0x070e('0x63')];return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x1fb1e6['params']['id']}})['then'](handleEntityNotFound(_0xfe61be,null))[_0x070e('0x27')](saveUpdates(_0x1fb1e6[_0x070e('0x51')],null))['then'](respondWithResult(_0xfe61be,null))['catch'](handleError(_0xfe61be,null));};exports['addCustomerAvatar']=function(_0x4cb7b2,_0x1a430d){_0x4cb7b2[_0x070e('0x51')][_0x070e('0x66')]=_0x4cb7b2[_0x070e('0x62')][_0x070e('0x63')];return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x4cb7b2[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x1a430d,null))[_0x070e('0x27')](saveUpdates(_0x4cb7b2['body'],null))[_0x070e('0x27')](respondWithResult(_0x1a430d,null))[_0x070e('0x1b')](handleError(_0x1a430d,null));};exports['addSystemAvatar']=function(_0x30db4a,_0x2890ba){_0x30db4a[_0x070e('0x51')][_0x070e('0x67')]=_0x30db4a['file'][_0x070e('0x63')];return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x30db4a[_0x070e('0x45')]['id']}})['then'](handleEntityNotFound(_0x2890ba,null))[_0x070e('0x27')](saveUpdates(_0x30db4a[_0x070e('0x51')],null))[_0x070e('0x27')](respondWithResult(_0x2890ba,null))[_0x070e('0x1b')](handleError(_0x2890ba,null));};exports[_0x070e('0x68')]=function(_0x27b51c,_0x1a4ed1){var _0xb2cca5=path[_0x070e('0x69')](config[_0x070e('0x6a')],_0x070e('0x6b'));var _0x479888={'where':{'id':_0x27b51c[_0x070e('0x45')]['id']},'attributes':['id',_0x070e('0x61')],'raw':!![]};var _0x5e3263=![];return require('../../config/license/util')[_0x070e('0x6c')]()['then'](function(_0x2c759a){if(_0x2c759a){_0x5e3263=_0x2c759a[_0x070e('0x6d')];}})[_0x070e('0x27')](function(){return db[_0x070e('0x2f')][_0x070e('0x52')](_0x479888);})[_0x070e('0x27')](handleEntityNotFound(_0x1a4ed1,null))[_0x070e('0x27')](function(_0x5186d8){if(_0x5186d8){if(!_[_0x070e('0x6e')](_0x5186d8[_0x070e('0x61')])){if(fs[_0x070e('0x6f')](path[_0x070e('0x69')](config['root'],'server/files/images/logos/',_0x5186d8[_0x070e('0x61')]))&&_0x5e3263){_0xb2cca5=path[_0x070e('0x69')](config[_0x070e('0x6a')],'server/files/images/logos/',_0x5186d8[_0x070e('0x61')]);}}return _0x1a4ed1[_0x070e('0x70')](_0xb2cca5);}})['catch'](handleError(_0x1a4ed1,null));};exports[_0x070e('0x71')]=function(_0x344289,_0x7af3cd){var _0x33009c=path[_0x070e('0x69')](config[_0x070e('0x6a')],'server/files/images/avatars/default_avatar.png');var _0x58c3d7={'where':{'id':_0x344289[_0x070e('0x45')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x070e('0x2f')][_0x070e('0x52')](_0x58c3d7)['then'](handleEntityNotFound(_0x7af3cd,null))[_0x070e('0x27')](function(_0x4b80b9){if(_0x4b80b9){if(!_[_0x070e('0x6e')](_0x4b80b9[_0x070e('0x65')])){if(fs[_0x070e('0x6f')](path[_0x070e('0x69')](config[_0x070e('0x6a')],_0x070e('0x72'),_0x4b80b9['agentAvatar']))){_0x33009c=path[_0x070e('0x69')](config[_0x070e('0x6a')],'server/files/images/avatars/',_0x4b80b9['agentAvatar']);}}return _0x7af3cd[_0x070e('0x70')](_0x33009c);}})[_0x070e('0x1b')](handleError(_0x7af3cd,null));};exports[_0x070e('0x73')]=function(_0x13ffd9,_0x3893a5){var _0x3e2c30=path[_0x070e('0x69')](config[_0x070e('0x6a')],'server/files/images/avatars/customer_avatar.png');var _0x1deb2a={'where':{'id':_0x13ffd9[_0x070e('0x45')]['id']},'attributes':['id',_0x070e('0x66'),_0x070e('0x74')],'raw':!![]};return db[_0x070e('0x2f')][_0x070e('0x52')](_0x1deb2a)[_0x070e('0x27')](handleEntityNotFound(_0x3893a5,null))[_0x070e('0x27')](function(_0x522513){if(_0x522513){if(!_[_0x070e('0x6e')](_0x522513[_0x070e('0x66')])){if(fs[_0x070e('0x6f')](path[_0x070e('0x69')](config[_0x070e('0x6a')],_0x070e('0x72'),_0x522513[_0x070e('0x66')]))&&_0x522513[_0x070e('0x74')]){_0x3e2c30=path[_0x070e('0x69')](config[_0x070e('0x6a')],'server/files/images/avatars/',_0x522513['customerAvatar']);}}return _0x3893a5[_0x070e('0x70')](_0x3e2c30);}})[_0x070e('0x1b')](handleError(_0x3893a5,null));};exports[_0x070e('0x75')]=function(_0x567202,_0xefd35a){var _0x36dfb5=path['join'](config[_0x070e('0x6a')],_0x070e('0x76'));var _0x2f34b9={'where':{'id':_0x567202[_0x070e('0x45')]['id']},'attributes':['id',_0x070e('0x67')],'raw':!![]};return db[_0x070e('0x2f')]['find'](_0x2f34b9)['then'](handleEntityNotFound(_0xefd35a,null))[_0x070e('0x27')](function(_0x3f3d7e){if(_0x3f3d7e){if(!_['isNil'](_0x3f3d7e[_0x070e('0x67')])){if(fs[_0x070e('0x6f')](path[_0x070e('0x69')](config[_0x070e('0x6a')],_0x070e('0x72'),_0x3f3d7e[_0x070e('0x67')]))){_0x36dfb5=path['join'](config[_0x070e('0x6a')],_0x070e('0x72'),_0x3f3d7e['systemAvatar']);}}return _0xefd35a[_0x070e('0x70')](_0x36dfb5);}})[_0x070e('0x1b')](handleError(_0xefd35a,null));};exports[_0x070e('0x77')]=function(_0x1fe46c,_0x4b6569){var _0x4c621a=require(_0x070e('0x78'));var _0x210e92=new _0x4c621a();var _0x2ad143=_0x210e92[_0x070e('0x79')](_0x1fe46c[_0x070e('0x7a')][_0x070e('0x7b')])[_0x070e('0x7c')]();var _0x2e1753={'body':_0x1fe46c[_0x070e('0x51')],'channel':_0x070e('0x7d')};var _0x4aab66=[];var _0x3759a6=[];var _0x13e414={};var _0x1de175=![];return db[_0x070e('0x7e')]['describe']()[_0x070e('0x27')](function(_0x35ddab){if(!_0x35ddab){throw new db['Sequelize']['ValidationError'](_0x070e('0x7f'));}_0x4aab66=_[_0x070e('0x80')](_[_0x070e('0x33')](_0x35ddab),['createdAt',_0x070e('0x81')]);_0x3759a6=_[_0x070e('0x80')](_[_0x070e('0x33')](_0x35ddab),[_0x070e('0x82'),_0x070e('0x81'),'CompanyId',_0x070e('0x83')]);if(_0x1fe46c[_0x070e('0x51')]['id']){delete _0x1fe46c['body']['id'];}if(_[_0x070e('0x6e')](_0x1fe46c['body']['from'])){throw new db['Sequelize'][(_0x070e('0x84'))](_0x070e('0x85'));}if(_[_0x070e('0x6e')](_0x1fe46c[_0x070e('0x51')]['body'])||_0x1fe46c[_0x070e('0x51')][_0x070e('0x51')]===''){throw new db['Sequelize'][(_0x070e('0x84'))](_0x070e('0x86'));}if(_[_0x070e('0x6e')](_0x1fe46c[_0x070e('0x51')][_0x070e('0x87')])){throw new db[(_0x070e('0x88'))]['ValidationError'](_0x070e('0x89')+_0x3759a6);}if(!_['includes'](_0x3759a6,_0x1fe46c[_0x070e('0x51')][_0x070e('0x87')])){throw new db[(_0x070e('0x88'))]['ValidationError'](_0x070e('0x8a')+_0x3759a6);}_0x13e414[_0x1fe46c[_0x070e('0x51')][_0x070e('0x87')]]=_0x1fe46c['body'][_0x070e('0x8b')];})[_0x070e('0x27')](function(){return db['ChatWebsite'][_0x070e('0x52')]({'where':{'id':_0x1fe46c[_0x070e('0x45')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x13e414,'limit':0x1,'order':[[_0x070e('0x81'),_0x070e('0x8c')]]}]},{'model':db[_0x070e('0x8d')],'as':_0x070e('0x8e')}]});})[_0x070e('0x27')](handleEntityNotFound(_0x4b6569,null))[_0x070e('0x27')](function(_0x3ce644){if(_0x3ce644&&_0x3ce644[_0x070e('0x8f')]){_0x2e1753['account']=_0x3ce644;_0x2e1753['applications']=_0x3ce644['Applications'];_0x2e1753['list']=_0x3ce644[_0x070e('0x8f')];_0x2e1753[_0x070e('0x90')]=_[_0x070e('0x91')](_0x2e1753[_0x070e('0x90')],[_0x070e('0x92')],['asc']);if(_0x2e1753['account'][_0x070e('0x8e')]){delete _0x2e1753[_0x070e('0x93')]['Applications'];}if(_0x2e1753[_0x070e('0x93')][_0x070e('0x8f')]&&_0x2e1753[_0x070e('0x93')][_0x070e('0x8f')][_0x070e('0x94')][_0x070e('0x38')]){return _0x2e1753['account'][_0x070e('0x8f')][_0x070e('0x94')][0x0];}var _0xb56b8e=_['defaults'](_0x1fe46c[_0x070e('0x51')],{'firstName':_0x1fe46c[_0x070e('0x51')][_0x070e('0x8b')],'ListId':_0x3ce644[_0x070e('0x83')]});_0xb56b8e[_0x1fe46c['body'][_0x070e('0x87')]]=_0x1fe46c[_0x070e('0x51')]['from'];return db[_0x070e('0x7e')][_0x070e('0x48')](_0xb56b8e,{'fields':_0x4aab66,'raw':!![]});}})['then'](handleEntityNotFound(_0x4b6569,null))[_0x070e('0x27')](function(_0x4ff695){_0x2e1753[_0x070e('0x95')]=_0x4ff695;var _0x54f8d3=_0x1fe46c[_0x070e('0x51')]['customerIp'];if(_0x1fe46c['headers'][_0x070e('0x96')]){_0x54f8d3=_0x1fe46c['headers']['cf-connecting-ip'];}else if(_0x1fe46c[_0x070e('0x7a')][_0x070e('0x97')]){_0x54f8d3=_[_0x070e('0x98')](_0x1fe46c[_0x070e('0x7a')][_0x070e('0x97')]['split'](','));}if(_0x4ff695){var _0x29e1f8={'ContactId':_0x4ff695['id'],'ChatWebsiteId':_0x1fe46c[_0x070e('0x45')]['id'],'from':(_0x4ff695[_0x070e('0x99')]||'')+'\x20'+(_0x4ff695[_0x070e('0x9a')]||''),'customerIp':_0x54f8d3,'customerPort':_0x1fe46c[_0x070e('0x7a')][_0x070e('0x9b')]?_0x1fe46c['headers'][_0x070e('0x9b')]:null,'referer':_0x1fe46c[_0x070e('0x51')][_0x070e('0x9c')],'browserName':_0x2ad143[_0x070e('0x9d')]['name']&&_0x2ad143['browser'][_0x070e('0x9e')]?util[_0x070e('0x9f')](_0x070e('0xa0'),_0x2ad143[_0x070e('0x9d')][_0x070e('0x2a')],_0x2ad143[_0x070e('0x9d')]['version']):_0x070e('0xa1'),'browserVersion':_0x2ad143[_0x070e('0x9d')][_0x070e('0x9e')]||_0x070e('0xa1'),'osName':util[_0x070e('0x9f')](_0x070e('0xa0'),_0x2ad143['os']['name'],_0x2ad143['os']['version']),'osVersion':_0x2ad143['os'][_0x070e('0x9e')],'deviceModel':_0x2ad143[_0x070e('0xa2')][_0x070e('0x32')]&&_0x2ad143[_0x070e('0xa2')][_0x070e('0xa3')]?util[_0x070e('0x9f')](_0x070e('0xa4'),_0x2ad143['device'][_0x070e('0x32')],_0x2ad143['device'][_0x070e('0xa3')],_0x2ad143['device']['type']):null,'deviceVendor':_0x2ad143['device'][_0x070e('0xa3')],'deviceType':_0x2ad143[_0x070e('0xa2')][_0x070e('0x30')],'formData':JSON[_0x070e('0x15')](_0x1fe46c[_0x070e('0x51')])};var _0x2016e8={'ChatWebsiteId':_0x1fe46c[_0x070e('0x45')]['id'],'closed':![]};if(_0x1fe46c[_0x070e('0x51')][_0x070e('0xa5')]){_0x2016e8['threadId']=_0x1fe46c[_0x070e('0x51')][_0x070e('0xa5')];return db[_0x070e('0xa6')][_0x070e('0x52')]({'where':_0x2016e8})[_0x070e('0x27')](function(_0x3d3375){if(_0x3d3375){return[_0x3d3375,![]];}_0x29e1f8[_0x070e('0xa5')]=_0x1fe46c[_0x070e('0x51')][_0x070e('0xa5')];_0x29e1f8['externalUrl']=_0x1fe46c['body'][_0x070e('0xa7')];return db[_0x070e('0xa6')]['create'](_0x29e1f8)[_0x070e('0x27')](function(_0x58985b){return[_0x58985b,!![]];});});}_0x2016e8['ContactId']=_0x4ff695['id'];if(_0x1fe46c[_0x070e('0x51')][_0x070e('0xa8')]&&_0x1fe46c['body'][_0x070e('0xa8')]['id']){_0x2016e8['id']=_0x1fe46c[_0x070e('0x51')][_0x070e('0xa8')]['id'];return db['ChatInteraction']['find']({'where':_0x2016e8})[_0x070e('0x27')](function(_0x33bd72){if(_0x33bd72){return[_0x33bd72,![]];}return db[_0x070e('0xa6')]['create'](_0x29e1f8)[_0x070e('0x27')](function(_0x36a2cf){return[_0x36a2cf,!![]];});});}return db['ChatInteraction'][_0x070e('0x48')](_0x29e1f8)[_0x070e('0x27')](function(_0x2f5f19){return[_0x2f5f19,!![]];});}})[_0x070e('0xa9')](function(_0x3f7b2c,_0x92db3c){if(_0x3f7b2c){_0x1de175=_0x92db3c;if(!_0x92db3c){var _0x921cc0={'from':(_0x2e1753[_0x070e('0x95')][_0x070e('0x99')]||'')+'\x20'+(_0x2e1753[_0x070e('0x95')][_0x070e('0x9a')]||'')};if(_0x1fe46c[_0x070e('0x51')][_0x070e('0xa5')]&&_0x1fe46c[_0x070e('0x51')][_0x070e('0xaa')]&&_0x1fe46c[_0x070e('0x51')][_0x070e('0xa5')]!=_0x1fe46c['body']['messageId']){_0x921cc0['threadId']=_0x1fe46c['body'][_0x070e('0xaa')];}return _0x3f7b2c[_0x070e('0x26')](_0x921cc0);}else{return _0x3f7b2c;}}})[_0x070e('0x27')](function(_0x4f89d2){_0x2e1753[_0x070e('0xa8')]=_0x4f89d2[_0x070e('0x4a')]({'plain':!![]});_0x2e1753[_0x070e('0xa8')]['created']=_0x1de175;if(_0x2e1753[_0x070e('0xa8')][_0x070e('0xab')]){if(_0x2e1753[_0x070e('0x93')][_0x070e('0xac')]){_0x2e1753['applications'][_0x070e('0xad')]({'id':0x0,'priority':_0x2e1753[_0x070e('0x90')][_0x070e('0x38')]+0x1,'app':'close','appdata':_0x070e('0xae'),'interval':_0x070e('0xaf')});}}return db[_0x070e('0xb0')][_0x070e('0x48')]({'body':_0x1fe46c[_0x070e('0x51')][_0x070e('0x51')],'ChatWebsiteId':_0x1fe46c[_0x070e('0x45')]['id'],'ChatInteractionId':_0x4f89d2['id'],'direction':'in','ContactId':_0x2e1753[_0x070e('0x95')]['id'],'AttachmentId':_0x1fe46c[_0x070e('0x51')]['AttachmentId']});})['then'](function(_0x276c34){_0x2e1753['message']=_0x276c34;if(!_0x2e1753['interaction'][_0x070e('0xb1')]){return;}return db[_0x070e('0xb2')][_0x070e('0x52')]({'attributes':['id',_0x070e('0x2a')],'where':{'id':_0x2e1753[_0x070e('0xa8')][_0x070e('0xb1')]}});})['then'](function(_0x2b9209){if(_0x2b9209){_0x2e1753[_0x070e('0x90')][_0x070e('0xb3')]({'id':0x0,'priority':0x0,'app':_0x070e('0xb4'),'appdata':_0x2b9209['name']+','+(_0x2e1753[_0x070e('0x93')]['waitForTheAssignedAgent']||0xa),'interval':_0x070e('0xaf')});_0x2e1753[_0x070e('0xb5')]=!![];}if(!_0x2e1753[_0x070e('0xa8')][_0x070e('0xb6')]){return;}return db[_0x070e('0xb7')][_0x070e('0x52')]({'attributes':['id',_0x070e('0x2a')],'where':{'id':_0x2e1753[_0x070e('0xa8')][_0x070e('0xb6')]}});})['then'](function(_0xc35037){if(_0xc35037){_0x2e1753[_0x070e('0x90')][_0x070e('0xb3')]({'id':0x0,'priority':0x1,'app':_0x070e('0xb8'),'appdata':_0xc35037[_0x070e('0x2a')]+','+(_0x2e1753[_0x070e('0x93')][_0x070e('0xb9')]||0x12c),'interval':_0x070e('0xaf')});}return respondWithRpcPromise('Start',_0x070e('0xba'),_0x2e1753);})[_0x070e('0x27')](function(_0x5356d0){respondWithRpcPromise('EventManager',_0x070e('0xbb'),{'event':_0x070e('0x77'),'message':_0x5356d0},client9002);return _0x5356d0;})[_0x070e('0x27')](respondWithResult(_0x4b6569,null))[_0x070e('0x1b')](handleError(_0x4b6569,null));};exports[_0x070e('0xbc')]=function(_0x45ee9e,_0x545fb5){var _0x5c44b4,_0x236ccb,_0x37fb87;var _0x5079d9=[];var _0x31d3fa={};var _0x5aebee=_0x45ee9e[_0x070e('0xbd')]||[];var _0xa2c957=[];var _0x535518;return db[_0x070e('0x7e')][_0x070e('0x53')]()['then'](function(_0x5549ad){if(!_0x5549ad){throw new db[(_0x070e('0x88'))]['ValidationError'](_0x070e('0x7f'));}_0x5079d9=_[_0x070e('0x80')](_[_0x070e('0x33')](_0x5549ad),['createdAt',_0x070e('0x81'),_0x070e('0xbe'),'ListId']);if(_0x45ee9e[_0x070e('0x51')]['id']){delete _0x45ee9e[_0x070e('0x51')]['id'];}if(_[_0x070e('0x6e')](_0x45ee9e[_0x070e('0x51')][_0x070e('0x8b')])){throw _0x545fb5[_0x070e('0x1d')](0x1f4)[_0x070e('0xbf')](new db[(_0x070e('0x88'))][(_0x070e('0x84'))](_0x070e('0x85')));}if(_['isNil'](_0x45ee9e[_0x070e('0x51')][_0x070e('0x51')])||_0x45ee9e[_0x070e('0x51')]['body']===''){throw _0x545fb5['status'](0x1f4)[_0x070e('0xbf')](new db[(_0x070e('0x88'))][(_0x070e('0x84'))](_0x070e('0x86')));}if(_['isNil'](_0x45ee9e[_0x070e('0x51')]['mapKeyOffline'])){throw _0x545fb5['status'](0x1f4)[_0x070e('0xbf')](new db['Sequelize'][(_0x070e('0x84'))](_0x070e('0xc0')+_0x5079d9));}if(!_[_0x070e('0xc1')](_0x5079d9,_0x45ee9e[_0x070e('0x51')]['mapKeyOffline'])){throw _0x545fb5[_0x070e('0x1d')](0x1f4)['send'](new db[(_0x070e('0x88'))][(_0x070e('0x84'))](_0x070e('0xc2')+_0x5079d9));}_0x31d3fa[_0x45ee9e[_0x070e('0x51')][_0x070e('0xc3')]]=_0x45ee9e[_0x070e('0x51')][_0x070e('0x8b')];})[_0x070e('0x27')](function(){return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x45ee9e[_0x070e('0x45')]['id']},'include':[{'model':db[_0x070e('0xc4')],'as':_0x070e('0x8f')},{'model':db[_0x070e('0xc5')],'as':_0x070e('0xc5')}]});})[_0x070e('0x27')](handleEntityNotFound(_0x545fb5,null))['then'](function(_0x48ea98){if(_0x48ea98&&_0x48ea98[_0x070e('0x8f')]){_0x236ccb=_0x48ea98;var _0x2b2b57=_['defaults'](_0x45ee9e[_0x070e('0x51')],{'firstName':_0x45ee9e[_0x070e('0x51')]['from'],'phone':_0x45ee9e[_0x070e('0x51')][_0x070e('0x8b')],'ListId':_0x48ea98['ListId']});_0x2b2b57[_0x45ee9e[_0x070e('0x51')][_0x070e('0xc3')]]=_0x45ee9e[_0x070e('0x51')][_0x070e('0x8b')];return db[_0x070e('0x7e')][_0x070e('0xc6')]({'where':_0x31d3fa,'defaults':_0x2b2b57});}})['spread'](function(_0x3a01db){if(_0x3a01db){_0x37fb87=_0x3a01db;var _0x283199=fs[_0x070e('0xc7')](path['join'](config[_0x070e('0x6a')],_0x070e('0xc8')),_0x070e('0xc9'));var _0x1a6a01=ejs['render'](_0x283199,{'body':_['toPairs'](_0x45ee9e[_0x070e('0x51')][_0x070e('0x51')]),'bodyTitle':_0x236ccb[_0x070e('0xca')]});return db[_0x070e('0xcb')][_0x070e('0x48')]({'body':_0x1a6a01,'plainBody':htmlToText[_0x070e('0xcc')](_0x1a6a01),'ContactId':_0x3a01db['id'],'ChatWebsiteId':_0x236ccb['id']});}})[_0x070e('0x27')](function(_0x48882f){_0x535518=_0x48882f;if(_0x5aebee[_0x070e('0x38')]){var _0x181cce=_0x5aebee[_0x070e('0x2e')](function(_0x172aa1){return{'name':_0x172aa1[_0x070e('0xcd')],'basename':_0x172aa1[_0x070e('0x63')],'type':_0x172aa1[_0x070e('0xce')],'ChatOfflineMessageId':_0x48882f['id']};});_0xa2c957=_0x181cce[_0x070e('0x2e')](_0x408ba0=>{var _0x5734ba={'filename':_0x408ba0[_0x070e('0x2a')],'path':path[_0x070e('0x69')](config[_0x070e('0x6a')],_0x070e('0xcf'),_0x070e('0xbd'),'attachments',_0x070e('0xd0'),_0x408ba0[_0x070e('0xd1')])};return _0x5734ba;});if(!_0x236ccb[_0x070e('0xd2')]){return db[_0x070e('0xd3')][_0x070e('0xd4')](function(_0x3c5019){return db[_0x070e('0xd5')]['bulkCreate'](_0x181cce,{'transaction':_0x3c5019});});}}})[_0x070e('0x27')](function(){if(_0x535518){_0x5c44b4=_0x535518;return db[_0x070e('0xc5')][_0x070e('0x5e')]({'where':{'service':!![]},'include':[{'model':db[_0x070e('0xd6')],'as':_0x070e('0xd7'),'raw':!![],'include':[{'model':db[_0x070e('0xd8')],'as':_0x070e('0xd8'),'raw':!![]}]}]});}})[_0x070e('0x27')](function(_0x45735c){if(_0x45735c&&_0x45735c['Smtp']&&_0x236ccb[_0x070e('0xd9')]&&_0x236ccb[_0x070e('0xda')]){var _0xf94878=_0x45735c[_0x070e('0xdb')]();return respondWithRpcPromise(_0x070e('0xdc'),_0x070e('0xdd'),{'account':_0xf94878,'message':{'from':util[_0x070e('0x9f')](_0x070e('0xde'),_0x45735c[_0x070e('0x2a')],_0x45735c[_0x070e('0xdf')]||_0x45735c[_0x070e('0xd7')][_0x070e('0x49')]),'to':_0x236ccb[_0x070e('0xda')],'subject':_0x236ccb[_0x070e('0xe0')],'html':_0x5c44b4[_0x070e('0x51')],'attachments':_0xa2c957}},client9003)[_0x070e('0x27')](function(){return _0x5c44b4;})[_0x070e('0x1b')](function(_0x5608f9){logger[_0x070e('0x17')](_0x5608f9);});}})[_0x070e('0x27')](function(){if(_0x236ccb&&_0x236ccb[_0x070e('0xd2')]&&_0x236ccb[_0x070e('0xe1')]){var _0x5608d0=[];if(_0x5aebee[_0x070e('0x38')]){_0x5608d0=_0x5aebee[_0x070e('0x2e')](function(_0x1fd493){return{'name':_0x1fd493[_0x070e('0xcd')],'basename':_0x1fd493['filename'],'type':_0x1fd493[_0x070e('0xce')],'ChatOfflineMessageId':_0x535518['id']};});}var _0x4c9619;if(!_[_0x070e('0x6e')](_0x236ccb['subjectOffline'])){var _0x59383a=_[_0x070e('0x2e')](_0x45ee9e[_0x070e('0x51')],function(_0x906cb7){return _0x906cb7;});var _0x5880bb=_[_0x070e('0xe2')](_0x59383a)[0x0];var _0x5ab854=_[_0x070e('0xe3')](_0x5880bb,function(_0x1e0e55){return _0x1e0e55;});_0x4c9619=_0x5ab854[0x1][_0x236ccb['subjectOffline']];}var _0x17a593={'from':_0x37fb87['email'],'firstName':_0x37fb87[_0x070e('0x99')],'lastName':_0x37fb87[_0x070e('0x9a')],'mapKey':_0x070e('0xdf'),'message':{'from':_0x37fb87['email'],'to':_0x236ccb['MailAccount'][_0x070e('0xdf')],'cc':'','subject':_['isNil'](_0x4c9619)?_0x236ccb[_0x070e('0xe0')]:_0x4c9619,'messageId':'','sentAt':new Date(),'attach':_0x5608d0[_0x070e('0x38')],'attachments':_0x5608d0,'originChannel':_0x070e('0xe4'),'ChatWebsiteId':_0x236ccb['id'],'ChatOfflineMessageId':_0x5c44b4['id'],'originTo':_0x236ccb[_0x070e('0xc5')][_0x070e('0xdf')]},'body':_0x5c44b4[_0x070e('0x51')]};var _0x4aaf0f={'account':{'id':_0x236ccb['MailAccountId']},'body':_0x17a593,'log':_0x070e('0xe5')};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x4aaf0f,client9001)[_0x070e('0x27')](function(){return _0x5c44b4;})[_0x070e('0x1b')](function(_0x3c8b7d){logger['error'](_0x3c8b7d);});}return;})[_0x070e('0x27')](function(){if(_0x5c44b4){return _0x5c44b4;}})[_0x070e('0x27')](respondWithResult(_0x545fb5,null))[_0x070e('0x1b')](function(_0x4dfac3){logger['error'](_0x070e('0x1b'),_0x4dfac3);for(var _0x421d8e of _0x5aebee){var _0x306654=path['join'](config[_0x070e('0x6a')],'server',_0x070e('0xbd'),'attachments',_0x070e('0xd0'),_0x421d8e[_0x070e('0x63')]);fs_extra['remove'](_0x306654)[_0x070e('0x1b')](function(_0x30fa55){logger[_0x070e('0x17')](_0x070e('0xe6'),_0x306654,_0x30fa55);});}});};exports[_0x070e('0xe7')]=function(_0xd6529a,_0x24ded2){return db[_0x070e('0xa6')][_0x070e('0x52')]({'where':{'id':_0xd6529a[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x24ded2,null))[_0x070e('0x27')](function(_0x3301b8){if(_0x3301b8){return _0x3301b8['addInteraction'](_0xd6529a[_0x070e('0x51')][_0x070e('0x5a')],_[_0x070e('0xe8')](_0xd6529a['body'],['ids','id'])||{});}})[_0x070e('0x27')](respondWithResult(_0x24ded2,null))[_0x070e('0x1b')](handleError(_0x24ded2,null));};exports['getInteractions']=function(_0x134ca4,_0x800c97){var _0x216d58={'raw':![],'where':{}};var _0x483c30={};var _0x9f2102={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x070e('0x5e')]({'where':{'id':_0x134ca4[_0x070e('0x45')]['id']}})['then'](handleEntityNotFound(_0x800c97,null))[_0x070e('0x27')](function(_0x2268ea){if(_0x2268ea){_0x483c30[_0x070e('0x32')]=_[_0x070e('0x33')](db[_0x070e('0xa6')][_0x070e('0x46')]);_0x483c30[_0x070e('0x34')]=_[_0x070e('0x33')](_0x134ca4[_0x070e('0x34')]);_0x483c30['filters']=_[_0x070e('0x47')](_0x483c30[_0x070e('0x32')],_0x483c30[_0x070e('0x34')]);_0x216d58[_0x070e('0x36')]=_['intersection'](_0x483c30['model'],qs['fields'](_0x134ca4[_0x070e('0x34')]['fields']));_0x216d58[_0x070e('0x36')]=_0x216d58[_0x070e('0x36')]['length']?_0x216d58[_0x070e('0x36')]:_0x483c30['model'];if(!_0x134ca4['query'][_0x070e('0xe9')](_0x070e('0x39'))){_0x216d58[_0x070e('0x21')]=qs[_0x070e('0x21')](_0x134ca4[_0x070e('0x34')][_0x070e('0x21')]);_0x216d58[_0x070e('0x1f')]=qs[_0x070e('0x1f')](_0x134ca4[_0x070e('0x34')][_0x070e('0x1f')]);}_0x216d58[_0x070e('0x3a')]=qs[_0x070e('0x3b')](_0x134ca4['query'][_0x070e('0x3b')]);_0x216d58[_0x070e('0x3d')]=qs[_0x070e('0x35')](_[_0x070e('0x56')](_0x134ca4[_0x070e('0x34')],_0x483c30[_0x070e('0x35')]));_0x216d58['where']['ChatWebsiteId']=_0x2268ea['id'];if(_0x134ca4['query'][_0x070e('0x3c')]){_0x216d58[_0x070e('0x3d')]=_[_0x070e('0x3f')](_0x216d58['where'],{'$or':_[_0x070e('0x2e')](_0x216d58[_0x070e('0x36')],function(_0x48437d){var _0x495926={};_0x495926[_0x48437d]={'$like':'%'+_0x134ca4[_0x070e('0x34')]['filter']+'%'};return _0x495926;})});}_0x216d58=_[_0x070e('0x3f')]({},_0x216d58,_0x134ca4[_0x070e('0x40')]);return db[_0x070e('0xa6')][_0x070e('0x22')]({'where':_0x216d58[_0x070e('0x3d')]})[_0x070e('0x27')](function(_0x4e1e0e){_0x9f2102[_0x070e('0x22')]=_0x4e1e0e;if(_0x134ca4[_0x070e('0x34')][_0x070e('0x41')]){_0x216d58['include']=[{'model':db[_0x070e('0x7e')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x070e('0xea'),'attributes':['name',_0x070e('0xeb'),'internal'],'required':![]},{'model':db[_0x070e('0xec')],'as':_0x070e('0xed'),'attributes':['id','name',_0x070e('0xee')],'where':_0x134ca4[_0x070e('0x34')][_0x070e('0xef')]?{'id':_0x134ca4[_0x070e('0x34')][_0x070e('0xef')]}:undefined,'required':_0x134ca4[_0x070e('0x34')][_0x070e('0xef')]?!![]:![]}];}return db[_0x070e('0xa6')][_0x070e('0x58')](_0x216d58);})[_0x070e('0x27')](function(_0x52acf3){_0x9f2102[_0x070e('0x43')]=_0x52acf3;return _0x9f2102;});}})['then'](respondWithFilteredResult(_0x800c97,_0x216d58))[_0x070e('0x1b')](handleError(_0x800c97,null));};function iftimePromise(_0x8d52b9,_0x58052b){return respondWithRpcPromise(_0x070e('0xf0'),'getSnippet',{'command':_0x58052b[_0x070e('0xf1')]?util['format'](_0x070e('0xf2'),_0x8d52b9[_0x070e('0xf3')],_0x58052b['timezone']):util[_0x070e('0x9f')](_0x070e('0xf4'),_0x8d52b9[_0x070e('0xf3')])},client9002)[_0x070e('0x27')](function(_0x12e363){var _0x5cbcf6=_0x12e363&&_0x12e363[_0x070e('0xf5')]('true')>=0x0?!![]:![];logger['info'](_0x070e('0xf6'),_0x58052b['id'],_0x8d52b9['id'],_0x8d52b9['interval'],_0x5cbcf6?'ONLINE':_0x070e('0xf7'),_0x58052b['timezone']?_0x58052b[_0x070e('0xf1')]:_0x070e('0xf8'));return _0x5cbcf6;})[_0x070e('0x1b')](function(_0x56f60d){logger[_0x070e('0x17')](_0x070e('0xf6'),_0x58052b['id'],_0x8d52b9['id'],_0x8d52b9[_0x070e('0xf3')],util[_0x070e('0xf9')](_0x56f60d,{'showHidden':![],'depth':null}),_0x58052b[_0x070e('0xf1')]?_0x58052b['timezone']:_0x070e('0xf8'));return![];});}exports[_0x070e('0xfa')]=function(_0x2bc10f,_0x486249){var _0x20cae7=0x0;var _0x952836=0x0;var _0x399add=![];var _0x4e4996;var _0x1dbff0;return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x2bc10f[_0x070e('0x45')]['id']},'include':[{'model':db['Interval'],'as':_0x070e('0xfb'),'include':[{'model':db[_0x070e('0xfb')],'as':_0x070e('0xfc'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x070e('0x27')](handleEntityNotFound(_0x486249,null))[_0x070e('0x27')](function(_0x73e3f4){if(_0x73e3f4){_0x4e4996=_0x73e3f4;return _0x73e3f4['getProactiveActions']({'raw':!![]});}})[_0x070e('0x27')](function(_0x581b04){if(_0x4e4996){if(_0x581b04){_0x1dbff0=_0x581b04;}}return require(_0x070e('0xfd'))[_0x070e('0x6c')]();})[_0x070e('0x27')](function(_0x46bc31){if(_0x46bc31){_0x952836=_0x46bc31['virtual'];_0x399add=_0x46bc31[_0x070e('0x6d')];}})[_0x070e('0x27')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0x070e('0x27')](function(_0x4542a8){_0x20cae7=_0x4542a8;if(_0x952836&&_0x4542a8>_0x952836){return db[_0x070e('0xfe')][_0x070e('0x5e')]({'where':{'id':0x1}})['then'](function(_0x43b79d){if(_0x43b79d){_0x43b79d[_0x070e('0xff')](_0x070e('0x100'));}});}})['then'](function(){if(_0x4e4996[_0x070e('0xfb')]&&_0x4e4996[_0x070e('0xfb')][_0x070e('0xfc')]){var _0x26a26b=[];for(var _0x4d5e29=0x0;_0x4d5e29<_0x4e4996['Interval'][_0x070e('0xfc')][_0x070e('0x38')];_0x4d5e29++){var _0x58c7e1=_0x4e4996[_0x070e('0xfb')][_0x070e('0xfc')][_0x4d5e29]['get']({'plain':!![]});_0x26a26b['push'](iftimePromise(_0x58c7e1,_0x4e4996));}return BPromise[_0x070e('0x101')](_0x26a26b)[_0x070e('0x27')](function(_0x3094d4){return _[_0x070e('0x102')](_0x3094d4);});}else{return!![];}})['then'](function(_0x59d668){var _0x2d597c=fs[_0x070e('0xc7')](path['join'](config[_0x070e('0x6a')],'server/files/chat/iframe.ejs'),_0x070e('0xc9'));var _0x3420d0=new url[(_0x070e('0x103'))](_0x4e4996['address'])[_0x070e('0x104')];var _0x589b76='3.5.0';var _0x47e50f=![];var _0x36ad23={'chatVersion':_0x589b76,'chatWebsiteAddressOrigin':_0x3420d0,'remote':_0x4e4996[_0x070e('0x105')],'query':querystring[_0x070e('0x15')](_[_0x070e('0x3f')](_0x4e4996[_0x070e('0x4a')]({'plain':!![]}),{'customerIp':_0x2bc10f[_0x070e('0x7a')][_0x070e('0x97')]||_0x2bc10f[_0x070e('0x7a')][_0x070e('0x106')]||_0x2bc10f[_0x070e('0x107')][_0x070e('0x108')]||_0x2bc10f['ip'],'referer':_0x2bc10f['headers'][_0x070e('0x9c')],'openedInteractions':_0x20cae7,'maxInteractions':_0x952836,'virtual':_0x399add[_0x070e('0x109')],'online':_0x59d668,'custom':_0x399add}))['replace'](/'/g,'\x5c\x27')};_0x486249['send'](ejs[_0x070e('0x10a')](Mustache[_0x070e('0x10a')](_0x2d597c,_0x36ad23),{'proactiveActions':_0x1dbff0,'alignment':_0x4e4996[_0x070e('0x10b')],'verticalAlignment':_0x4e4996[_0x070e('0x10c')],'div_color':_0x4e4996['color'],'labelText':_0x4e4996[_0x070e('0x10d')],'text_color':_0x4e4996[_0x070e('0x10e')],'text_button_color':_0x4e4996[_0x070e('0x10f')],'button_color':_0x4e4996[_0x070e('0x110')],'background_color':_0x4e4996[_0x070e('0x111')],'hideWhenOffline':_0x4e4996[_0x070e('0x112')],'intervalId':_0x4e4996['IntervalId'],'isDevelopment':_0x47e50f,'chatVersion':_0x589b76}));})[_0x070e('0x1b')](handleError(_0x486249,null));};exports['addApplications']=function(_0x260eb9,_0x835606){var _0x20612b=_0x260eb9[_0x070e('0x45')]['id'];var _0x2290e8=_0x260eb9[_0x070e('0x51')];var _0x22cca8=0xc8;var _0x560176=null;return db[_0x070e('0xd3')][_0x070e('0xd4')]({'isolationLevel':db[_0x070e('0xd3')][_0x070e('0x113')][_0x070e('0x114')][_0x070e('0x115')]},function(_0x405d9f){return db[_0x070e('0x2f')][_0x070e('0x5e')]({'where':{'id':_0x20612b},'transaction':_0x405d9f})[_0x070e('0x27')](function(_0x14c924){if(_0x14c924){return db[_0x070e('0x8d')][_0x070e('0x28')]({'where':{'ChatWebsiteId':_0x20612b},'transaction':_0x405d9f})[_0x070e('0x27')](function(){var _0x4c9226=_[_0x070e('0x2e')](_0x2290e8,function(_0x234fe6){_0x234fe6['ChatWebsiteId']=_0x20612b;return _0x234fe6;});return db[_0x070e('0x8d')][_0x070e('0x116')](_0x4c9226,{'transaction':_0x405d9f});});}else{_0x22cca8=0x194;_0x560176=[];}});})[_0x070e('0x27')](function(){if(_0x22cca8!==0x194){return db[_0x070e('0x8d')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x20612b},'order':_0x070e('0x92')})[_0x070e('0x27')](function(_0x4c9334){_0x560176=_0x4c9334;});}})[_0x070e('0x1b')](function(_0x606970){_0x22cca8=0x1f4;logger[_0x070e('0x17')](_0x606970[_0x070e('0x29')]);if(_0x606970[_0x070e('0x2a')]){delete _0x606970['name'];}_0x560176=_0x606970;})[_0x070e('0x117')](function(){if(_0x560176===null){_0x835606[_0x070e('0x1c')](_0x22cca8);}else{if(_0x22cca8===0x1f4){_0x835606[_0x070e('0x1d')](_0x22cca8)[_0x070e('0xbf')](_0x560176);}else{_0x835606['status'](_0x22cca8)[_0x070e('0x25')](_0x560176);}}});};exports[_0x070e('0x118')]=function(_0x3d0462,_0x50267c){var _0x2855c9={};var _0x4292f0={};var _0x5448ef;var _0x3a684d;return db[_0x070e('0x2f')][_0x070e('0x5e')]({'where':{'id':_0x3d0462[_0x070e('0x45')]['id']}})['then'](handleEntityNotFound(_0x50267c,null))[_0x070e('0x27')](function(_0x5e1a7a){if(_0x5e1a7a){_0x5448ef=_0x5e1a7a;_0x4292f0[_0x070e('0x32')]=_[_0x070e('0x33')](db[_0x070e('0x8d')]['rawAttributes']);_0x4292f0['query']=_['keys'](_0x3d0462[_0x070e('0x34')]);_0x4292f0[_0x070e('0x35')]=_['intersection'](_0x4292f0[_0x070e('0x32')],_0x4292f0[_0x070e('0x34')]);_0x2855c9[_0x070e('0x36')]=_[_0x070e('0x47')](_0x4292f0[_0x070e('0x32')],qs[_0x070e('0x37')](_0x3d0462[_0x070e('0x34')]['fields']));_0x2855c9[_0x070e('0x36')]=_0x2855c9['attributes'][_0x070e('0x38')]?_0x2855c9[_0x070e('0x36')]:_0x4292f0[_0x070e('0x32')];_0x2855c9[_0x070e('0x3a')]=qs['sort'](_0x3d0462[_0x070e('0x34')][_0x070e('0x3b')]);_0x2855c9[_0x070e('0x3d')]=qs['filters'](_[_0x070e('0x56')](_0x3d0462['query'],_0x4292f0[_0x070e('0x35')]));if(_0x3d0462[_0x070e('0x34')][_0x070e('0x3c')]){_0x2855c9['where']=_[_0x070e('0x3f')](_0x2855c9[_0x070e('0x3d')],{'$or':_[_0x070e('0x2e')](_0x2855c9[_0x070e('0x36')],function(_0x45fa15){var _0x155c3d={};_0x155c3d[_0x45fa15]={'$like':'%'+_0x3d0462[_0x070e('0x34')][_0x070e('0x3c')]+'%'};return _0x155c3d;})});}_0x2855c9=_[_0x070e('0x3f')]({},_0x2855c9,_0x3d0462[_0x070e('0x40')]);return _0x5448ef[_0x070e('0x118')](_0x2855c9);}})['then'](function(_0x15fc52){if(_0x15fc52){_0x3a684d=_0x15fc52[_0x070e('0x38')];if(!_0x3d0462['query'][_0x070e('0xe9')](_0x070e('0x39'))){_0x2855c9[_0x070e('0x21')]=qs[_0x070e('0x21')](_0x3d0462[_0x070e('0x34')][_0x070e('0x21')]);_0x2855c9[_0x070e('0x1f')]=qs[_0x070e('0x1f')](_0x3d0462[_0x070e('0x34')]['offset']);}return _0x5448ef[_0x070e('0x118')](_0x2855c9);}})[_0x070e('0x27')](function(_0x3f459b){if(_0x3f459b){return _0x3f459b?{'count':_0x3a684d,'rows':_0x3f459b}:null;}})['then'](respondWithResult(_0x50267c,null))[_0x070e('0x1b')](handleError(_0x50267c,null));};exports[_0x070e('0x119')]=function(_0x2f5572,_0x42c8b3){return db[_0x070e('0x11a')][_0x070e('0x52')]({'where':{'id':_0x2f5572[_0x070e('0x45')]['id']}})['then'](handleEntityNotFound(_0x42c8b3,null))[_0x070e('0x27')](function(_0x673c7e){if(_0x673c7e){return _0x673c7e[_0x070e('0x119')](_0x2f5572[_0x070e('0x51')][_0x070e('0x5a')],_['omit'](_0x2f5572[_0x070e('0x51')],[_0x070e('0x5a'),'id'])||{});}})['then'](respondWithResult(_0x42c8b3,null))['catch'](handleError(_0x42c8b3,null));};exports['getProactiveActions']=function(_0x395bf7,_0x41b760){var _0x5906f5={};var _0x550c04={};var _0x205559;var _0x4878d8;return db[_0x070e('0x2f')][_0x070e('0x5e')]({'where':{'id':_0x395bf7[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x41b760,null))[_0x070e('0x27')](function(_0x1d5c86){if(_0x1d5c86){_0x205559=_0x1d5c86;_0x550c04[_0x070e('0x32')]=_['keys'](db[_0x070e('0x11b')][_0x070e('0x46')]);_0x550c04[_0x070e('0x34')]=_[_0x070e('0x33')](_0x395bf7['query']);_0x550c04['filters']=_[_0x070e('0x47')](_0x550c04[_0x070e('0x32')],_0x550c04[_0x070e('0x34')]);_0x5906f5['attributes']=_[_0x070e('0x47')](_0x550c04[_0x070e('0x32')],qs[_0x070e('0x37')](_0x395bf7[_0x070e('0x34')]['fields']));_0x5906f5['attributes']=_0x5906f5[_0x070e('0x36')][_0x070e('0x38')]?_0x5906f5[_0x070e('0x36')]:_0x550c04[_0x070e('0x32')];_0x5906f5[_0x070e('0x3a')]=qs['sort'](_0x395bf7['query']['sort']);_0x5906f5[_0x070e('0x3d')]=qs[_0x070e('0x35')](_[_0x070e('0x56')](_0x395bf7[_0x070e('0x34')],_0x550c04['filters']));if(_0x395bf7[_0x070e('0x34')]['filter']){_0x5906f5['where']=_[_0x070e('0x3f')](_0x5906f5[_0x070e('0x3d')],{'$or':_['map'](_0x5906f5[_0x070e('0x36')],function(_0x1b6728){var _0x158670={};_0x158670[_0x1b6728]={'$like':'%'+_0x395bf7[_0x070e('0x34')][_0x070e('0x3c')]+'%'};return _0x158670;})});}_0x5906f5=_[_0x070e('0x3f')]({},_0x5906f5,_0x395bf7['options']);return _0x205559[_0x070e('0x11c')](_0x5906f5);}})[_0x070e('0x27')](function(_0x408b87){if(_0x408b87){_0x4878d8=_0x408b87['length'];if(!_0x395bf7[_0x070e('0x34')][_0x070e('0xe9')](_0x070e('0x39'))){_0x5906f5['limit']=qs[_0x070e('0x21')](_0x395bf7[_0x070e('0x34')][_0x070e('0x21')]);_0x5906f5[_0x070e('0x1f')]=qs[_0x070e('0x1f')](_0x395bf7[_0x070e('0x34')][_0x070e('0x1f')]);}return _0x205559[_0x070e('0x11c')](_0x5906f5);}})[_0x070e('0x27')](function(_0x39497c){if(_0x39497c){return _0x39497c?{'count':_0x4878d8,'rows':_0x39497c}:null;}})[_0x070e('0x27')](respondWithResult(_0x41b760,null))['catch'](handleError(_0x41b760,null));};exports[_0x070e('0x11d')]=function(_0x1e0b95,_0x460933){var _0x9fa764=_0x1e0b95['query'][_0x070e('0x11e')]===_0x070e('0x11f')?'offlineForm':_0x070e('0x120');return db[_0x070e('0x2f')]['find']({'attributes':['id',_0x9fa764],'where':{'id':_0x1e0b95[_0x070e('0x45')]['id']}})['then'](handleEntityNotFound(_0x460933,null))[_0x070e('0x27')](function(_0x5a7692){if(_0x5a7692){var _0x5b85be=_0x5a7692[_0x9fa764];var _0x3877b3=_0x5b85be&&_0x5b85be['items']?_0x5b85be[_0x070e('0x121')]:[];_0x460933[_0x070e('0xbf')]({'fromKey':_[_0x070e('0x6e')](_0x5b85be[_0x070e('0x122')])?undefined:_0x5b85be[_0x070e('0x122')],'count':_0x3877b3[_0x070e('0x38')],'rows':_0x3877b3});}})['catch'](handleError(_0x460933,null));};exports['getOfflineMessages']=function(_0x50f8c4,_0x4b1e3a){var _0x349339={'raw':![],'where':{}};var _0x54ffda={};var _0x295e24={'count':0x0,'rows':[]};return db[_0x070e('0x2f')][_0x070e('0x5e')]({'where':{'id':_0x50f8c4[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x4b1e3a,null))[_0x070e('0x27')](function(_0x5d7cbf){if(_0x5d7cbf){_0x54ffda[_0x070e('0x32')]=_[_0x070e('0x33')](db[_0x070e('0xcb')][_0x070e('0x46')]);_0x54ffda[_0x070e('0x34')]=_[_0x070e('0x33')](_0x50f8c4['query']);_0x54ffda[_0x070e('0x35')]=_[_0x070e('0x47')](_0x54ffda[_0x070e('0x32')],_0x54ffda['query']);_0x349339[_0x070e('0x36')]=_[_0x070e('0x47')](_0x54ffda[_0x070e('0x32')],qs[_0x070e('0x37')](_0x50f8c4[_0x070e('0x34')][_0x070e('0x37')]));_0x349339[_0x070e('0x36')]=_0x349339[_0x070e('0x36')][_0x070e('0x38')]?_0x349339[_0x070e('0x36')]:_0x54ffda[_0x070e('0x32')];if(!_0x50f8c4[_0x070e('0x34')][_0x070e('0xe9')](_0x070e('0x39'))){_0x349339[_0x070e('0x21')]=qs[_0x070e('0x21')](_0x50f8c4[_0x070e('0x34')][_0x070e('0x21')]);_0x349339[_0x070e('0x1f')]=qs[_0x070e('0x1f')](_0x50f8c4['query'][_0x070e('0x1f')]);}_0x349339['order']=qs['sort'](_0x50f8c4[_0x070e('0x34')]['sort']);_0x349339[_0x070e('0x3d')]=qs[_0x070e('0x35')](_[_0x070e('0x56')](_0x50f8c4[_0x070e('0x34')],_0x54ffda[_0x070e('0x35')]));_0x349339[_0x070e('0x3d')][_0x070e('0x55')]=_0x5d7cbf['id'];if(_0x50f8c4[_0x070e('0x34')][_0x070e('0x3c')]){_0x349339[_0x070e('0x3d')]=_['merge'](_0x349339[_0x070e('0x3d')],{'$or':_[_0x070e('0x2e')](_0x349339[_0x070e('0x36')],function(_0x24cc9e){var _0x340df0={};_0x340df0[_0x24cc9e]={'$like':'%'+_0x50f8c4['query'][_0x070e('0x3c')]+'%'};return _0x340df0;})});}_0x349339=_[_0x070e('0x3f')]({},_0x349339,_0x50f8c4[_0x070e('0x40')]);return db[_0x070e('0xcb')]['count']({'where':_0x349339[_0x070e('0x3d')]})[_0x070e('0x27')](function(_0x5c0fa5){_0x295e24[_0x070e('0x22')]=_0x5c0fa5;if(_0x50f8c4[_0x070e('0x34')][_0x070e('0x41')]){_0x349339[_0x070e('0x42')]=[{'all':!![]}];}else{_0x349339['include']=[{'model':db[_0x070e('0x7e')],'as':_0x070e('0x123'),'required':![]},{'model':db[_0x070e('0xd5')],'as':'Attachments','required':![]}];}return db[_0x070e('0xcb')]['findAll'](_0x349339);})[_0x070e('0x27')](function(_0xc4a364){_0x295e24['rows']=_0xc4a364;return _0x295e24;});}})[_0x070e('0x27')](respondWithFilteredResult(_0x4b1e3a,_0x349339))[_0x070e('0x1b')](handleError(_0x4b1e3a,null));};exports[_0x070e('0x124')]=function(_0x553cf8,_0x353041){return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x553cf8['params']['id']}})['then'](handleEntityNotFound(_0x353041,null))[_0x070e('0x27')](function(_0x22932b){if(_0x22932b){return _0x22932b[_0x070e('0x124')](_0x553cf8['body']['ids'],_[_0x070e('0xe8')](_0x553cf8['body'],['ids','id'])||{})[_0x070e('0xa9')](function(_0xeb1314){for(var _0x42414c=0x0;_0x42414c<_0x553cf8[_0x070e('0x51')]['ids']['length'];_0x42414c+=0x1){socket[_0x070e('0x125')](_0x070e('0x126'),{'UserId':Number(_0x553cf8[_0x070e('0x51')][_0x070e('0x5a')][_0x42414c]),'ChatWebsiteId':Number(_0x553cf8[_0x070e('0x45')]['id'])});}return _0xeb1314;});}})['then'](respondWithResult(_0x353041,null))[_0x070e('0x1b')](handleError(_0x353041,null));};exports[_0x070e('0x127')]=function(_0x1a2d80,_0x50c3a9){return db[_0x070e('0x2f')]['find']({'where':{'id':_0x1a2d80[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x50c3a9,null))[_0x070e('0x27')](function(_0x5274f){if(_0x5274f){return _0x5274f[_0x070e('0x127')](_0x1a2d80['query']['ids'])[_0x070e('0x27')](function(){if(_[_0x070e('0x128')](_0x1a2d80[_0x070e('0x34')]['ids'])){for(var _0x5c5fcb=0x0;_0x5c5fcb<_0x1a2d80[_0x070e('0x34')][_0x070e('0x5a')][_0x070e('0x38')];_0x5c5fcb+=0x1){socket[_0x070e('0x125')](_0x070e('0x129'),{'UserId':Number(_0x1a2d80[_0x070e('0x34')][_0x070e('0x5a')][_0x5c5fcb]),'ChatWebsiteId':Number(_0x1a2d80[_0x070e('0x45')]['id'])});}}else{socket[_0x070e('0x125')](_0x070e('0x129'),{'UserId':Number(_0x1a2d80[_0x070e('0x34')][_0x070e('0x5a')]),'ChatWebsiteId':Number(_0x1a2d80[_0x070e('0x45')]['id'])});}});}})[_0x070e('0x27')](respondWithStatusCode(_0x50c3a9,null))[_0x070e('0x1b')](handleError(_0x50c3a9,null));};exports['getAgents']=function(_0x15277b,_0x31db5c){var _0x2f20d9={};var _0x5268e9={};var _0x51836a;var _0x4dd9cb;return db['ChatWebsite'][_0x070e('0x5e')]({'where':{'id':_0x15277b[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x31db5c,null))[_0x070e('0x27')](function(_0xd10a6e){if(_0xd10a6e){_0x51836a=_0xd10a6e;_0x5268e9[_0x070e('0x32')]=_[_0x070e('0x33')](db[_0x070e('0xb2')][_0x070e('0x46')]);_0x5268e9['query']=_['keys'](_0x15277b['query']);_0x5268e9['filters']=_[_0x070e('0x47')](_0x5268e9['model'],_0x5268e9[_0x070e('0x34')]);_0x2f20d9[_0x070e('0x36')]=_[_0x070e('0x47')](_0x5268e9[_0x070e('0x32')],qs[_0x070e('0x37')](_0x15277b[_0x070e('0x34')][_0x070e('0x37')]));_0x2f20d9[_0x070e('0x36')]=_0x2f20d9['attributes'][_0x070e('0x38')]?_0x2f20d9[_0x070e('0x36')]:_0x5268e9[_0x070e('0x32')];_0x2f20d9[_0x070e('0x3a')]=qs[_0x070e('0x3b')](_0x15277b[_0x070e('0x34')][_0x070e('0x3b')]);_0x2f20d9[_0x070e('0x3d')]=qs[_0x070e('0x35')](_[_0x070e('0x56')](_0x15277b[_0x070e('0x34')],_0x5268e9['filters']));if(_0x15277b[_0x070e('0x34')][_0x070e('0x3c')]){_0x2f20d9['where']=_[_0x070e('0x3f')](_0x2f20d9['where'],{'$or':_['map'](_0x2f20d9[_0x070e('0x36')],function(_0x4c9db4){var _0x28456b={};_0x28456b[_0x4c9db4]={'$like':'%'+_0x15277b[_0x070e('0x34')][_0x070e('0x3c')]+'%'};return _0x28456b;})});}_0x2f20d9=_['merge']({},_0x2f20d9,_0x15277b[_0x070e('0x40')]);return _0x51836a['getAgents'](_0x2f20d9);}})[_0x070e('0x27')](function(_0x5c04b8){if(_0x5c04b8){_0x4dd9cb=_0x5c04b8[_0x070e('0x38')];if(!_0x15277b[_0x070e('0x34')][_0x070e('0xe9')]('nolimit')){_0x2f20d9['limit']=qs[_0x070e('0x21')](_0x15277b[_0x070e('0x34')][_0x070e('0x21')]);_0x2f20d9[_0x070e('0x1f')]=qs['offset'](_0x15277b[_0x070e('0x34')][_0x070e('0x1f')]);}return _0x51836a[_0x070e('0x12a')](_0x2f20d9);}})[_0x070e('0x27')](function(_0x326961){if(_0x326961){return _0x326961?{'count':_0x4dd9cb,'rows':_0x326961}:null;}})[_0x070e('0x27')](respondWithResult(_0x31db5c,null))['catch'](handleError(_0x31db5c,null));};
\ No newline at end of file
+var _0x5cc1=['server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','chat','CmContact','Sequelize','ValidationError','difference','updatedAt','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','ChatApplication','Applications','spread','list','priority','asc','account','contact','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','applications','push','close','unmanaged','AttachmentId','UserId','unshift','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','EventManager','no\x20available\x20attributes','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','files','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions','sendMail','email','MailAccountId','originalname','toPairsIn','mapValues','lastName','offlineMessageSubject','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','hasOwnProperty','Contact','User','Owner','fullname','Tag','Tags','tag','getProactiveActions','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','utf8','URL','address','origin','3.5.0','remote','x-real-ip','connection','remoteAddress','referer','replace','render','alignment','color','labelText','textColor','textButtonColor','color_button','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','getApplications','addProactiveActions','getFields','online','offlineForm','onlineForm','items','Attachment','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','path','fs-extra','lodash','querystring','ioredis','jayson/promise','../../config/logger','api','../../config/environment','../../errors/api','APIOutOfIntervalError','APINotFoundError','../../mysqldb','defaults','redis','localhost','./chatWebsite.socket','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','destroy','ChatWebsites','UserProfileResource','stack','name','send','getSnippet','format','iftime\x20%s,%s','interval','timezone','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','map','Interval','Intervals','get','all','some','user-agent-parser','setUA','user-agent','getResult','customerIp','x-forwarded-for','first','split','firstName','x-real-port','browser','version','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','model','index','mandatoryDispositionPause','ChatWebsite','fieldName','type','key','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','Pause','rawAttributes','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','params','body','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','order','Disposition','removeDispositions','ids','getAnswers','CannedAnswer','sitepic','addAvatar','agentAvatar','file','customerAvatar','filename','addSystemAvatar','systemAvatar','getLogo','root','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','join','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x5cc1,0x1c1));var _0x15cc=function(_0x5f026e,_0x224df5){_0x5f026e=_0x5f026e-0x0;var _0x2f74a1=_0x5cc1[_0x5f026e];return _0x2f74a1;};'use strict';var Mustache=require('mustache');var util=require('util');var path=require(_0x15cc('0x0'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x15cc('0x1'));var _=require(_0x15cc('0x2'));var querystring=require(_0x15cc('0x3'));var htmlToText=require('html-to-text');var Redis=require(_0x15cc('0x4'));var jayson=require(_0x15cc('0x5'));var url=require('url');var qs=require('../../components/parsers/qs');var logger=require(_0x15cc('0x6'))(_0x15cc('0x7'));var config=require(_0x15cc('0x8'));var APIOutOfIntervalError=require(_0x15cc('0x9'))[_0x15cc('0xa')];var APINotFoundError=require(_0x15cc('0x9'))[_0x15cc('0xb')];var APIHandleError=require(_0x15cc('0x9'))['handleError'];var db=require(_0x15cc('0xc'))['db'];config['redis']=_[_0x15cc('0xd')](config[_0x15cc('0xe')],{'host':_0x15cc('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x15cc('0x10'))[_0x15cc('0x11')](socket);var client=jayson[_0x15cc('0x12')]['http']({'port':0x232c});var client9002=jayson[_0x15cc('0x12')][_0x15cc('0x13')]({'port':0x232a});var client9003=jayson[_0x15cc('0x12')]['http']({'port':0x232b});var client9001=jayson['client'][_0x15cc('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x155800,_0x59f052,_0x236f46,_0x1f6704){return new Promise(function(_0x5e0767,_0x18687d){var _0x293f23=_0x1f6704||client;return _0x293f23[_0x15cc('0x14')](_0x155800,_0x236f46)[_0x15cc('0x15')](function(_0x1e1c79){logger[_0x15cc('0x16')](_0x15cc('0x17'),_0x59f052,'request\x20sent');logger[_0x15cc('0x18')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x59f052,_0x15cc('0x19'),JSON[_0x15cc('0x1a')](_0x1e1c79));if(_0x1e1c79['error']){if(_0x1e1c79['error'][_0x15cc('0x1b')]===0x1f4){logger[_0x15cc('0x1c')](_0x15cc('0x17'),_0x59f052,_0x1e1c79[_0x15cc('0x1c')][_0x15cc('0x1d')]);return _0x18687d(_0x1e1c79[_0x15cc('0x1c')][_0x15cc('0x1d')]);}logger[_0x15cc('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x59f052,_0x1e1c79[_0x15cc('0x1c')][_0x15cc('0x1d')]);return _0x5e0767(_0x1e1c79['error'][_0x15cc('0x1d')]);}else{logger['info'](_0x15cc('0x17'),_0x59f052,_0x15cc('0x19'));_0x5e0767(_0x1e1c79[_0x15cc('0x1e')][_0x15cc('0x1d')]);}})['catch'](function(_0xbf12c3){logger['error'](_0x15cc('0x17'),_0x59f052,_0xbf12c3);_0x18687d(_0xbf12c3);});});}function respondWithStatusCode(_0x593c5f,_0x1b24e4){_0x1b24e4=_0x1b24e4||0xcc;return function(_0x2b6b18){if(_0x2b6b18){return _0x593c5f[_0x15cc('0x1f')](_0x1b24e4);}return _0x593c5f[_0x15cc('0x20')](_0x1b24e4)[_0x15cc('0x21')]();};}function respondWithResult(_0x56eb5b,_0x19a27e){_0x19a27e=_0x19a27e||0xc8;return function(_0x1d12af){if(_0x1d12af){return _0x56eb5b['status'](_0x19a27e)[_0x15cc('0x22')](_0x1d12af);}};}function respondWithFilteredResult(_0x4d66b0,_0x46b6e6){return function(_0x42b00e){if(_0x42b00e){var _0x131bc2=typeof _0x46b6e6[_0x15cc('0x23')]==='undefined'&&typeof _0x46b6e6[_0x15cc('0x24')]===_0x15cc('0x25');var _0x31f8b1=_0x42b00e[_0x15cc('0x26')];var _0xc41dc0=_0x131bc2?0x0:_0x46b6e6[_0x15cc('0x23')];var _0x730b6a=_0x131bc2?_0x42b00e['count']:_0x46b6e6[_0x15cc('0x23')]+_0x46b6e6[_0x15cc('0x24')];var _0x2502bf;if(_0x730b6a>=_0x31f8b1){_0x730b6a=_0x31f8b1;_0x2502bf=0xc8;}else{_0x2502bf=0xce;}_0x4d66b0[_0x15cc('0x20')](_0x2502bf);return _0x4d66b0[_0x15cc('0x27')](_0x15cc('0x28'),_0xc41dc0+'-'+_0x730b6a+'/'+_0x31f8b1)[_0x15cc('0x22')](_0x42b00e);}return null;};}function saveUpdates(_0x5a6bec){return function(_0x4e70d7){if(_0x4e70d7){return _0x4e70d7[_0x15cc('0x29')](_0x5a6bec)[_0x15cc('0x15')](function(_0x3af015){return _0x3af015;});}return null;};}function removeEntity(_0x3d6c22){return function(_0x17f002){if(_0x17f002){return _0x17f002[_0x15cc('0x2a')]()['then'](function(){var _0x32ac02=_0x17f002['get']({'plain':!![]});var _0x2f9511=_0x15cc('0x2b');return db[_0x15cc('0x2c')][_0x15cc('0x2a')]({'where':{'type':_0x2f9511,'resourceId':_0x32ac02['id']}})[_0x15cc('0x15')](function(){return _0x17f002;});})[_0x15cc('0x15')](function(){_0x3d6c22['status'](0xcc)[_0x15cc('0x21')]();});}};}function handleEntityNotFound(_0x1dcb1f){return function(_0x2815e3){if(!_0x2815e3){_0x1dcb1f[_0x15cc('0x1f')](0x194);}return _0x2815e3;};}function handleError(_0x31994a,_0x3d94b0){_0x3d94b0=_0x3d94b0||0x1f4;return function(_0x1c865e){logger[_0x15cc('0x1c')](_0x1c865e[_0x15cc('0x2d')]);if(_0x1c865e[_0x15cc('0x2e')]){delete _0x1c865e[_0x15cc('0x2e')];}_0x31994a[_0x15cc('0x20')](_0x3d94b0)[_0x15cc('0x2f')](_0x1c865e);};}function iftimePromise(_0x43e528,_0x4a4400){return respondWithRpcPromise('Command',_0x15cc('0x30'),{'command':_0x4a4400['timezone']?util[_0x15cc('0x31')](_0x15cc('0x32'),_0x43e528[_0x15cc('0x33')],_0x4a4400[_0x15cc('0x34')]):util[_0x15cc('0x31')]('iftime\x20%s',_0x43e528[_0x15cc('0x33')])},client9002)['then'](function(_0xb9ac88){var _0x481e68=_0xb9ac88&&_0xb9ac88[_0x15cc('0x35')](_0x15cc('0x36'))>=0x0?!![]:![];logger[_0x15cc('0x16')](_0x15cc('0x37'),_0x4a4400['id'],_0x43e528['id'],_0x43e528[_0x15cc('0x33')],_0x481e68?_0x15cc('0x38'):_0x15cc('0x39'),_0x4a4400[_0x15cc('0x34')]?_0x4a4400[_0x15cc('0x34')]:_0x15cc('0x3a'));return _0x481e68;})['catch'](function(_0x188bbf){logger[_0x15cc('0x1c')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x4a4400['id'],_0x43e528['id'],_0x43e528[_0x15cc('0x33')],util[_0x15cc('0x3b')](_0x188bbf,{'showHidden':![],'depth':null}),_0x4a4400[_0x15cc('0x34')]?_0x4a4400[_0x15cc('0x34')]:_0x15cc('0x3a'));return![];});}function checkWebsiteIntervals(_0x405dcf){var _0x18374d=_[_0x15cc('0x3c')](_0x405dcf[_0x15cc('0x3d')][_0x15cc('0x3e')],function(_0x45510d){var _0x1ca62b=_0x45510d[_0x15cc('0x3f')]({'plain':!![]});return iftimePromise(_0x1ca62b,_0x405dcf);});return Promise[_0x15cc('0x40')](_0x18374d)[_0x15cc('0x15')](function(_0x312acb){return _[_0x15cc('0x41')](_0x312acb);});}function createInteractionObject(_0x420bdc,_0xa6fb49,_0x5310dd,_0x33e79b){var _0x28ab58=require(_0x15cc('0x42'));var _0x110acb=new _0x28ab58();var _0x1aae42=_0x110acb[_0x15cc('0x43')](_0x5310dd[_0x15cc('0x44')])[_0x15cc('0x45')]();var _0x13bbef=_0xa6fb49[_0x15cc('0x46')];if(_0x5310dd['cf-connecting-ip']){_0x13bbef=_0x5310dd['cf-connecting-ip'];}else if(_0x5310dd[_0x15cc('0x47')]){_0x13bbef=_[_0x15cc('0x48')](_0x5310dd[_0x15cc('0x47')][_0x15cc('0x49')](','));}return{'ContactId':_0x33e79b['id'],'ChatWebsiteId':_0x420bdc,'from':(_0x33e79b[_0x15cc('0x4a')]||'')+'\x20'+(_0x33e79b['lastName']||''),'customerIp':_0x13bbef,'customerPort':_0x5310dd[_0x15cc('0x4b')]?_0x5310dd['x-real-port']:null,'referer':_0xa6fb49['referer'],'browserName':_0x1aae42[_0x15cc('0x4c')][_0x15cc('0x2e')]&&_0x1aae42[_0x15cc('0x4c')][_0x15cc('0x4d')]?util[_0x15cc('0x31')](_0x15cc('0x4e'),_0x1aae42[_0x15cc('0x4c')][_0x15cc('0x2e')],_0x1aae42[_0x15cc('0x4c')][_0x15cc('0x4d')]):_0x15cc('0x4f'),'browserVersion':_0x1aae42[_0x15cc('0x4c')]['version']||_0x15cc('0x4f'),'osName':util[_0x15cc('0x31')](_0x15cc('0x4e'),_0x1aae42['os'][_0x15cc('0x2e')],_0x1aae42['os'][_0x15cc('0x4d')]),'osVersion':_0x1aae42['os'][_0x15cc('0x4d')],'deviceModel':_0x1aae42[_0x15cc('0x50')]['model']&&_0x1aae42[_0x15cc('0x50')][_0x15cc('0x51')]?util[_0x15cc('0x31')](_0x15cc('0x52'),_0x1aae42[_0x15cc('0x50')][_0x15cc('0x53')],_0x1aae42['device'][_0x15cc('0x51')],_0x1aae42[_0x15cc('0x50')]['type']):null,'deviceVendor':_0x1aae42['device']['vendor'],'deviceType':_0x1aae42[_0x15cc('0x50')]['type'],'formData':JSON[_0x15cc('0x1a')](_0xa6fb49)};}exports[_0x15cc('0x54')]=function(_0x1da8aa,_0x3f262b){var _0x139909={'include':[{'model':db['Pause'],'as':_0x15cc('0x55')}]},_0x4b7ed7={},_0x1088d7={'count':0x0,'rows':[]};var _0x264cd2=_[_0x15cc('0x3c')](db[_0x15cc('0x56')]['rawAttributes'],function(_0x36541b){return{'name':_0x36541b[_0x15cc('0x57')],'type':_0x36541b[_0x15cc('0x58')][_0x15cc('0x59')]};});_0x4b7ed7[_0x15cc('0x53')]=_[_0x15cc('0x3c')](_0x264cd2,_0x15cc('0x2e'));_0x4b7ed7[_0x15cc('0x5a')]=_[_0x15cc('0x5b')](_0x1da8aa[_0x15cc('0x5a')]);_0x4b7ed7[_0x15cc('0x5c')]=_[_0x15cc('0x5d')](_0x4b7ed7['model'],_0x4b7ed7['query']);_0x139909['attributes']=_[_0x15cc('0x5d')](_0x4b7ed7['model'],qs['fields'](_0x1da8aa['query'][_0x15cc('0x5e')]));_0x139909[_0x15cc('0x5f')]=_0x139909[_0x15cc('0x5f')][_0x15cc('0x60')]?_0x139909['attributes']:_0x4b7ed7['model'];if(!_0x1da8aa[_0x15cc('0x5a')]['hasOwnProperty'](_0x15cc('0x61'))){_0x139909[_0x15cc('0x24')]=qs['limit'](_0x1da8aa['query']['limit']);_0x139909[_0x15cc('0x23')]=qs['offset'](_0x1da8aa[_0x15cc('0x5a')][_0x15cc('0x23')]);}_0x139909['order']=qs[_0x15cc('0x62')](_0x1da8aa[_0x15cc('0x5a')][_0x15cc('0x62')]);_0x139909[_0x15cc('0x63')]=qs['filters'](_[_0x15cc('0x64')](_0x1da8aa[_0x15cc('0x5a')],_0x4b7ed7['filters']),_0x264cd2);if(_0x1da8aa[_0x15cc('0x5a')][_0x15cc('0x65')]){_0x139909[_0x15cc('0x63')]=_[_0x15cc('0x66')](_0x139909['where'],{'$or':_['map'](_0x264cd2,function(_0x440396){if(_0x440396[_0x15cc('0x58')]!==_0x15cc('0x67')){var _0x578a2e={};_0x578a2e[_0x440396['name']]={'$like':'%'+_0x1da8aa['query'][_0x15cc('0x65')]+'%'};return _0x578a2e;}})});}_0x139909=_[_0x15cc('0x66')]({},_0x139909,_0x1da8aa[_0x15cc('0x68')]);var _0x17814d={'where':_0x139909[_0x15cc('0x63')]};return db[_0x15cc('0x56')][_0x15cc('0x26')](_0x17814d)[_0x15cc('0x15')](function(_0x413e9f){_0x1088d7[_0x15cc('0x26')]=_0x413e9f;if(_0x1da8aa[_0x15cc('0x5a')][_0x15cc('0x69')]){_0x139909[_0x15cc('0x6a')]=[{'all':!![]}];}return db[_0x15cc('0x56')][_0x15cc('0x6b')](_0x139909);})[_0x15cc('0x15')](function(_0x41aed7){_0x1088d7[_0x15cc('0x6c')]=_0x41aed7;return _0x1088d7;})[_0x15cc('0x15')](respondWithFilteredResult(_0x3f262b,_0x139909))[_0x15cc('0x6d')](handleError(_0x3f262b,null));};exports[_0x15cc('0x6e')]=function(_0x54690c,_0x353eff){var _0x55ca97={'raw':![],'where':{'id':_0x54690c['params']['id']},'include':[{'model':db[_0x15cc('0x6f')],'as':'mandatoryDispositionPause'}]},_0x568579={};_0x568579[_0x15cc('0x53')]=_['keys'](db[_0x15cc('0x56')][_0x15cc('0x70')]);_0x568579[_0x15cc('0x5a')]=_[_0x15cc('0x5b')](_0x54690c[_0x15cc('0x5a')]);_0x568579[_0x15cc('0x5c')]=_[_0x15cc('0x5d')](_0x568579[_0x15cc('0x53')],_0x568579[_0x15cc('0x5a')]);_0x55ca97['attributes']=_[_0x15cc('0x5d')](_0x568579[_0x15cc('0x53')],qs[_0x15cc('0x5e')](_0x54690c[_0x15cc('0x5a')][_0x15cc('0x5e')]));_0x55ca97['attributes']=_0x55ca97[_0x15cc('0x5f')]['length']?_0x55ca97[_0x15cc('0x5f')]:_0x568579['model'];if(_0x54690c[_0x15cc('0x5a')][_0x15cc('0x69')]){_0x55ca97[_0x15cc('0x6a')]=[{'all':!![]}];}_0x55ca97=_['merge']({},_0x55ca97,_0x54690c['options']);return db[_0x15cc('0x56')]['find'](_0x55ca97)['then'](handleEntityNotFound(_0x353eff,null))['then'](respondWithResult(_0x353eff,null))[_0x15cc('0x6d')](handleError(_0x353eff,null));};exports[_0x15cc('0x71')]=function(_0x4212b4,_0x1b1ef5){return db[_0x15cc('0x56')][_0x15cc('0x71')](_0x4212b4['body'],{})[_0x15cc('0x15')](function(_0xa91862){var _0x52f52f=_0x4212b4[_0x15cc('0x72')][_0x15cc('0x3f')]({'plain':!![]});if(!_0x52f52f)throw new Error(_0x15cc('0x73'));if(_0x52f52f[_0x15cc('0x74')]==='user'){var _0x4b5005=_0xa91862[_0x15cc('0x3f')]({'plain':!![]});var _0x5ca81b='ChatWebsites';return db[_0x15cc('0x75')][_0x15cc('0x76')]({'where':{'name':_0x5ca81b,'userProfileId':_0x52f52f[_0x15cc('0x77')]},'raw':!![]})[_0x15cc('0x15')](function(_0x17bbb5){if(_0x17bbb5&&_0x17bbb5[_0x15cc('0x78')]===0x0){return db[_0x15cc('0x2c')][_0x15cc('0x71')]({'name':_0x4b5005[_0x15cc('0x2e')],'resourceId':_0x4b5005['id'],'type':_0x17bbb5['name'],'sectionId':_0x17bbb5['id']},{})['then'](function(){return _0xa91862;});}else{return _0xa91862;}})[_0x15cc('0x6d')](function(_0x3ed324){logger[_0x15cc('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ed324);throw _0x3ed324;});}return _0xa91862;})['then'](respondWithResult(_0x1b1ef5,0xc9))[_0x15cc('0x6d')](handleError(_0x1b1ef5,null));};exports[_0x15cc('0x29')]=function(_0x1ec51a,_0x205c5c){if(_0x1ec51a['body']['id']){delete _0x1ec51a['body']['id'];}return db['ChatWebsite'][_0x15cc('0x76')]({'where':{'id':_0x1ec51a[_0x15cc('0x79')]['id']},'include':[{'model':db[_0x15cc('0x6f')],'as':_0x15cc('0x55')}]})[_0x15cc('0x15')](handleEntityNotFound(_0x205c5c,null))[_0x15cc('0x15')](saveUpdates(_0x1ec51a[_0x15cc('0x7a')],null))[_0x15cc('0x15')](respondWithResult(_0x205c5c,null))[_0x15cc('0x6d')](handleError(_0x205c5c,null));};exports[_0x15cc('0x2a')]=function(_0x9f61c,_0x11d21a){return db[_0x15cc('0x56')]['find']({'where':{'id':_0x9f61c['params']['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x11d21a,null))[_0x15cc('0x15')](removeEntity(_0x11d21a,null))[_0x15cc('0x6d')](handleError(_0x11d21a,null));};exports[_0x15cc('0x7b')]=function(_0xb337e4,_0x2ec7d2){return db[_0x15cc('0x56')][_0x15cc('0x7b')]()[_0x15cc('0x15')](respondWithResult(_0x2ec7d2,null))[_0x15cc('0x6d')](handleError(_0x2ec7d2,null));};exports[_0x15cc('0x7c')]=function(_0xd536ce,_0x590f53){if(_0xd536ce[_0x15cc('0x7a')]['id']){delete _0xd536ce[_0x15cc('0x7a')]['id'];}return db['ChatWebsite'][_0x15cc('0x76')]({'where':{'id':_0xd536ce[_0x15cc('0x79')]['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x590f53,null))[_0x15cc('0x15')](function(_0x19ab9c){if(_0x19ab9c){_0xd536ce[_0x15cc('0x7a')][_0x15cc('0x7d')]=_0x19ab9c['id'];return db['Disposition'][_0x15cc('0x71')](_0xd536ce[_0x15cc('0x7a')]);}})['then'](respondWithResult(_0x590f53,null))[_0x15cc('0x6d')](handleError(_0x590f53,null));};exports[_0x15cc('0x7e')]=function(_0x524cb6,_0x6c51bb){var _0x29407d={'raw':![],'where':{}};var _0x2dcd1c={};var _0x58f802={'count':0x0,'rows':[]};return db[_0x15cc('0x56')][_0x15cc('0x7f')]({'where':{'id':_0x524cb6[_0x15cc('0x79')]['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x6c51bb,null))[_0x15cc('0x15')](function(_0x17a3ee){if(_0x17a3ee){_0x2dcd1c['model']=_[_0x15cc('0x5b')](db['Disposition'][_0x15cc('0x70')]);_0x2dcd1c[_0x15cc('0x5a')]=_[_0x15cc('0x5b')](_0x524cb6['query']);_0x2dcd1c[_0x15cc('0x5c')]=_[_0x15cc('0x5d')](_0x2dcd1c[_0x15cc('0x53')],_0x2dcd1c[_0x15cc('0x5a')]);_0x29407d[_0x15cc('0x5f')]=_['intersection'](_0x2dcd1c[_0x15cc('0x53')],qs[_0x15cc('0x5e')](_0x524cb6[_0x15cc('0x5a')][_0x15cc('0x5e')]));_0x29407d['attributes']=_0x29407d[_0x15cc('0x5f')][_0x15cc('0x60')]?_0x29407d[_0x15cc('0x5f')]:_0x2dcd1c[_0x15cc('0x53')];if(!_0x524cb6['query']['hasOwnProperty']('nolimit')){_0x29407d[_0x15cc('0x24')]=qs['limit'](_0x524cb6['query'][_0x15cc('0x24')]);_0x29407d[_0x15cc('0x23')]=qs[_0x15cc('0x23')](_0x524cb6[_0x15cc('0x5a')]['offset']);}_0x29407d[_0x15cc('0x80')]=qs[_0x15cc('0x62')](_0x524cb6[_0x15cc('0x5a')][_0x15cc('0x62')]);_0x29407d[_0x15cc('0x63')]=qs[_0x15cc('0x5c')](_[_0x15cc('0x64')](_0x524cb6[_0x15cc('0x5a')],_0x2dcd1c[_0x15cc('0x5c')]));_0x29407d[_0x15cc('0x63')][_0x15cc('0x7d')]=_0x17a3ee['id'];if(_0x524cb6[_0x15cc('0x5a')]['filter']){_0x29407d[_0x15cc('0x63')]=_[_0x15cc('0x66')](_0x29407d['where'],{'$or':_['map'](_0x29407d[_0x15cc('0x5f')],function(_0x568ceb){var _0x92d298={};_0x92d298[_0x568ceb]={'$like':'%'+_0x524cb6['query']['filter']+'%'};return _0x92d298;})});}_0x29407d=_[_0x15cc('0x66')]({},_0x29407d,_0x524cb6[_0x15cc('0x68')]);return db[_0x15cc('0x81')][_0x15cc('0x26')]({'where':_0x29407d[_0x15cc('0x63')]})[_0x15cc('0x15')](function(_0x24f521){_0x58f802[_0x15cc('0x26')]=_0x24f521;if(_0x524cb6[_0x15cc('0x5a')][_0x15cc('0x69')]){_0x29407d[_0x15cc('0x6a')]=[{'all':!![]}];}return db[_0x15cc('0x81')]['findAll'](_0x29407d);})[_0x15cc('0x15')](function(_0x47ffe4){_0x58f802[_0x15cc('0x6c')]=_0x47ffe4;return _0x58f802;});}})[_0x15cc('0x15')](respondWithFilteredResult(_0x6c51bb,_0x29407d))[_0x15cc('0x6d')](handleError(_0x6c51bb,null));};exports['removeDispositions']=function(_0x1e6651,_0x2f2861){return db['ChatWebsite']['find']({'where':{'id':_0x1e6651[_0x15cc('0x79')]['id']}})['then'](handleEntityNotFound(_0x2f2861,null))[_0x15cc('0x15')](function(_0x3241e3){if(_0x3241e3){return _0x3241e3[_0x15cc('0x82')](_0x1e6651['query'][_0x15cc('0x83')]);}})[_0x15cc('0x15')](respondWithStatusCode(_0x2f2861,null))[_0x15cc('0x6d')](handleError(_0x2f2861,null));};exports['addAnswer']=function(_0x4957b2,_0x57b566){if(_0x4957b2[_0x15cc('0x7a')]['id']){delete _0x4957b2[_0x15cc('0x7a')]['id'];}return db[_0x15cc('0x56')][_0x15cc('0x76')]({'where':{'id':_0x4957b2[_0x15cc('0x79')]['id']}})['then'](handleEntityNotFound(_0x57b566,null))[_0x15cc('0x15')](function(_0x451861){if(_0x451861){_0x4957b2[_0x15cc('0x7a')][_0x15cc('0x7d')]=_0x451861['id'];return db['CannedAnswer'][_0x15cc('0x71')](_0x4957b2[_0x15cc('0x7a')]);}})[_0x15cc('0x15')](respondWithResult(_0x57b566,null))[_0x15cc('0x6d')](handleError(_0x57b566,null));};exports[_0x15cc('0x84')]=function(_0x1ca630,_0x26b8ca){var _0x56a307={'raw':![],'where':{}};var _0x2f9b2a={};var _0x2b1e51={'count':0x0,'rows':[]};return db[_0x15cc('0x56')]['findOne']({'where':{'id':_0x1ca630[_0x15cc('0x79')]['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x26b8ca,null))[_0x15cc('0x15')](function(_0x49619f){if(_0x49619f){_0x2f9b2a[_0x15cc('0x53')]=_[_0x15cc('0x5b')](db[_0x15cc('0x85')][_0x15cc('0x70')]);_0x2f9b2a[_0x15cc('0x5a')]=_[_0x15cc('0x5b')](_0x1ca630[_0x15cc('0x5a')]);_0x2f9b2a[_0x15cc('0x5c')]=_[_0x15cc('0x5d')](_0x2f9b2a[_0x15cc('0x53')],_0x2f9b2a['query']);_0x56a307[_0x15cc('0x5f')]=_['intersection'](_0x2f9b2a[_0x15cc('0x53')],qs[_0x15cc('0x5e')](_0x1ca630[_0x15cc('0x5a')][_0x15cc('0x5e')]));_0x56a307[_0x15cc('0x5f')]=_0x56a307[_0x15cc('0x5f')][_0x15cc('0x60')]?_0x56a307[_0x15cc('0x5f')]:_0x2f9b2a[_0x15cc('0x53')];if(!_0x1ca630[_0x15cc('0x5a')]['hasOwnProperty'](_0x15cc('0x61'))){_0x56a307['limit']=qs[_0x15cc('0x24')](_0x1ca630[_0x15cc('0x5a')][_0x15cc('0x24')]);_0x56a307[_0x15cc('0x23')]=qs[_0x15cc('0x23')](_0x1ca630[_0x15cc('0x5a')][_0x15cc('0x23')]);}_0x56a307[_0x15cc('0x80')]=qs[_0x15cc('0x62')](_0x1ca630[_0x15cc('0x5a')][_0x15cc('0x62')]);_0x56a307[_0x15cc('0x63')]=qs['filters'](_[_0x15cc('0x64')](_0x1ca630['query'],_0x2f9b2a[_0x15cc('0x5c')]));_0x56a307['where'][_0x15cc('0x7d')]=_0x49619f['id'];if(_0x1ca630[_0x15cc('0x5a')]['filter']){_0x56a307['where']=_['merge'](_0x56a307['where'],{'$or':_['map'](_0x56a307[_0x15cc('0x5f')],function(_0x5c7e9e){var _0xf382a6={};_0xf382a6[_0x5c7e9e]={'$like':'%'+_0x1ca630[_0x15cc('0x5a')][_0x15cc('0x65')]+'%'};return _0xf382a6;})});}_0x56a307=_[_0x15cc('0x66')]({},_0x56a307,_0x1ca630[_0x15cc('0x68')]);return db[_0x15cc('0x85')]['count']({'where':_0x56a307['where']})[_0x15cc('0x15')](function(_0x3506e5){_0x2b1e51['count']=_0x3506e5;if(_0x1ca630['query'][_0x15cc('0x69')]){_0x56a307[_0x15cc('0x6a')]=[{'all':!![]}];}return db[_0x15cc('0x85')][_0x15cc('0x6b')](_0x56a307);})[_0x15cc('0x15')](function(_0x5298b8){_0x2b1e51['rows']=_0x5298b8;return _0x2b1e51;});}})['then'](respondWithFilteredResult(_0x26b8ca,_0x56a307))[_0x15cc('0x6d')](handleError(_0x26b8ca,null));};exports['removeAnswers']=function(_0x293d08,_0x2b97a7){return db[_0x15cc('0x56')][_0x15cc('0x76')]({'where':{'id':_0x293d08[_0x15cc('0x79')]['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x2b97a7,null))[_0x15cc('0x15')](function(_0x5b3c99){if(_0x5b3c99){return _0x5b3c99['removeAnswers'](_0x293d08[_0x15cc('0x5a')][_0x15cc('0x83')]);}})['then'](respondWithStatusCode(_0x2b97a7,null))[_0x15cc('0x6d')](handleError(_0x2b97a7,null));};exports['addLogo']=function(_0x5103fe,_0x197aae){_0x5103fe[_0x15cc('0x7a')][_0x15cc('0x86')]=_0x5103fe['file']['filename'];return db[_0x15cc('0x56')][_0x15cc('0x76')]({'where':{'id':_0x5103fe[_0x15cc('0x79')]['id']}})['then'](handleEntityNotFound(_0x197aae,null))[_0x15cc('0x15')](saveUpdates(_0x5103fe['body'],null))[_0x15cc('0x15')](respondWithResult(_0x197aae,null))[_0x15cc('0x6d')](handleError(_0x197aae,null));};exports[_0x15cc('0x87')]=function(_0x103aaf,_0x1f9429){_0x103aaf[_0x15cc('0x7a')][_0x15cc('0x88')]=_0x103aaf[_0x15cc('0x89')]['filename'];return db[_0x15cc('0x56')][_0x15cc('0x76')]({'where':{'id':_0x103aaf['params']['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x1f9429,null))[_0x15cc('0x15')](saveUpdates(_0x103aaf['body'],null))[_0x15cc('0x15')](respondWithResult(_0x1f9429,null))[_0x15cc('0x6d')](handleError(_0x1f9429,null));};exports['addCustomerAvatar']=function(_0x16781e,_0x1179a3){_0x16781e[_0x15cc('0x7a')][_0x15cc('0x8a')]=_0x16781e[_0x15cc('0x89')][_0x15cc('0x8b')];return db[_0x15cc('0x56')][_0x15cc('0x76')]({'where':{'id':_0x16781e[_0x15cc('0x79')]['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x1179a3,null))[_0x15cc('0x15')](saveUpdates(_0x16781e[_0x15cc('0x7a')],null))[_0x15cc('0x15')](respondWithResult(_0x1179a3,null))['catch'](handleError(_0x1179a3,null));};exports[_0x15cc('0x8c')]=function(_0x432ae5,_0x33c97d){_0x432ae5[_0x15cc('0x7a')][_0x15cc('0x8d')]=_0x432ae5[_0x15cc('0x89')][_0x15cc('0x8b')];return db[_0x15cc('0x56')][_0x15cc('0x76')]({'where':{'id':_0x432ae5[_0x15cc('0x79')]['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x33c97d,null))[_0x15cc('0x15')](saveUpdates(_0x432ae5[_0x15cc('0x7a')],null))[_0x15cc('0x15')](respondWithResult(_0x33c97d,null))['catch'](handleError(_0x33c97d,null));};exports[_0x15cc('0x8e')]=function(_0x2b4f6e,_0x532062){var _0x14e291=path['join'](config[_0x15cc('0x8f')],'server/files/images/logos/default_logo.svg');var _0x52b07f={'where':{'id':_0x2b4f6e[_0x15cc('0x79')]['id']},'attributes':['id',_0x15cc('0x86')],'raw':!![]};var _0x491fba=![];return require(_0x15cc('0x90'))[_0x15cc('0x91')]()['then'](function(_0x48d767){if(_0x48d767){_0x491fba=_0x48d767[_0x15cc('0x92')];}})['then'](function(){return db['ChatWebsite'][_0x15cc('0x76')](_0x52b07f);})[_0x15cc('0x15')](handleEntityNotFound(_0x532062,null))[_0x15cc('0x15')](function(_0x1bf191){if(_0x1bf191){if(!_[_0x15cc('0x93')](_0x1bf191[_0x15cc('0x86')])){if(fs[_0x15cc('0x94')](path['join'](config['root'],_0x15cc('0x95'),_0x1bf191[_0x15cc('0x86')]))&&_0x491fba){_0x14e291=path[_0x15cc('0x96')](config['root'],_0x15cc('0x95'),_0x1bf191[_0x15cc('0x86')]);}}return _0x532062[_0x15cc('0x97')](_0x14e291);}})[_0x15cc('0x6d')](handleError(_0x532062,null));};exports['getAvatar']=function(_0x35f904,_0x1dd4a8){var _0x415f0a=path[_0x15cc('0x96')](config[_0x15cc('0x8f')],_0x15cc('0x98'));var _0x210235={'where':{'id':_0x35f904['params']['id']},'attributes':['id',_0x15cc('0x88')],'raw':!![]};return db[_0x15cc('0x56')][_0x15cc('0x76')](_0x210235)['then'](handleEntityNotFound(_0x1dd4a8,null))[_0x15cc('0x15')](function(_0x5ec8e8){if(_0x5ec8e8){if(!_[_0x15cc('0x93')](_0x5ec8e8[_0x15cc('0x88')])){if(fs[_0x15cc('0x94')](path[_0x15cc('0x96')](config[_0x15cc('0x8f')],_0x15cc('0x99'),_0x5ec8e8[_0x15cc('0x88')]))){_0x415f0a=path['join'](config[_0x15cc('0x8f')],'server/files/images/avatars/',_0x5ec8e8['agentAvatar']);}}return _0x1dd4a8[_0x15cc('0x97')](_0x415f0a);}})['catch'](handleError(_0x1dd4a8,null));};exports[_0x15cc('0x9a')]=function(_0x22190b,_0x546224){var _0x4da79f=path[_0x15cc('0x96')](config[_0x15cc('0x8f')],_0x15cc('0x9b'));var _0x46ba58={'where':{'id':_0x22190b['params']['id']},'attributes':['id',_0x15cc('0x8a'),_0x15cc('0x9c')],'raw':!![]};return db['ChatWebsite'][_0x15cc('0x76')](_0x46ba58)[_0x15cc('0x15')](handleEntityNotFound(_0x546224,null))[_0x15cc('0x15')](function(_0x237f02){if(_0x237f02){if(!_[_0x15cc('0x93')](_0x237f02[_0x15cc('0x8a')])){if(fs['existsSync'](path[_0x15cc('0x96')](config[_0x15cc('0x8f')],_0x15cc('0x99'),_0x237f02[_0x15cc('0x8a')]))&&_0x237f02[_0x15cc('0x9c')]){_0x4da79f=path['join'](config[_0x15cc('0x8f')],'server/files/images/avatars/',_0x237f02[_0x15cc('0x8a')]);}}return _0x546224['download'](_0x4da79f);}})[_0x15cc('0x6d')](handleError(_0x546224,null));};exports[_0x15cc('0x9d')]=function(_0xc77efd,_0xbb74c5){var _0xc2fab3=path['join'](config[_0x15cc('0x8f')],_0x15cc('0x9e'));var _0x22eb9f={'where':{'id':_0xc77efd[_0x15cc('0x79')]['id']},'attributes':['id',_0x15cc('0x8d')],'raw':!![]};return db[_0x15cc('0x56')][_0x15cc('0x76')](_0x22eb9f)[_0x15cc('0x15')](handleEntityNotFound(_0xbb74c5,null))[_0x15cc('0x15')](function(_0x22c884){if(_0x22c884){if(!_[_0x15cc('0x93')](_0x22c884[_0x15cc('0x8d')])){if(fs[_0x15cc('0x94')](path[_0x15cc('0x96')](config[_0x15cc('0x8f')],'server/files/images/avatars/',_0x22c884[_0x15cc('0x8d')]))){_0xc2fab3=path['join'](config[_0x15cc('0x8f')],_0x15cc('0x99'),_0x22c884['systemAvatar']);}}return _0xbb74c5[_0x15cc('0x97')](_0xc2fab3);}})[_0x15cc('0x6d')](handleError(_0xbb74c5,null));};exports['notify']=function(_0x13826b,_0x245031){var _0x3235d3={'body':_0x13826b[_0x15cc('0x7a')],'channel':_0x15cc('0x9f')};var _0x11c6d5=[];var _0x5f249d=[];var _0x4db08c={};var _0x312ed0=![];return db[_0x15cc('0xa0')][_0x15cc('0x7b')]()['then'](function(_0x3ea2ae){if(!_0x3ea2ae){throw new db[(_0x15cc('0xa1'))][(_0x15cc('0xa2'))]('no\x20available\x20attributes');}_0x11c6d5=_[_0x15cc('0xa3')](_[_0x15cc('0x5b')](_0x3ea2ae),['createdAt',_0x15cc('0xa4')]);_0x5f249d=_[_0x15cc('0xa3')](_['keys'](_0x3ea2ae),[_0x15cc('0xa5'),_0x15cc('0xa4'),_0x15cc('0xa6'),_0x15cc('0xa7')]);if(_0x13826b[_0x15cc('0x7a')]['id']){delete _0x13826b[_0x15cc('0x7a')]['id'];}if(_['isNil'](_0x13826b[_0x15cc('0x7a')][_0x15cc('0xa8')])){throw new db['Sequelize']['ValidationError'](_0x15cc('0xa9'));}if(_[_0x15cc('0x93')](_0x13826b[_0x15cc('0x7a')][_0x15cc('0x7a')])||_0x13826b[_0x15cc('0x7a')][_0x15cc('0x7a')]===''){throw new db[(_0x15cc('0xa1'))][(_0x15cc('0xa2'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x13826b['body'][_0x15cc('0xaa')])){throw new db[(_0x15cc('0xa1'))][(_0x15cc('0xa2'))](_0x15cc('0xab')+_0x5f249d);}if(!_[_0x15cc('0xac')](_0x5f249d,_0x13826b[_0x15cc('0x7a')][_0x15cc('0xaa')])){throw new db[(_0x15cc('0xa1'))][(_0x15cc('0xa2'))](_0x15cc('0xad')+_0x5f249d);}_0x4db08c[_0x13826b[_0x15cc('0x7a')][_0x15cc('0xaa')]]=_0x13826b['body'][_0x15cc('0xa8')];})[_0x15cc('0x15')](function(){return db[_0x15cc('0x56')][_0x15cc('0x76')]({'where':{'id':_0x13826b[_0x15cc('0x79')]['id']},'include':[{'model':db['CmList'],'as':_0x15cc('0xae'),'include':[{'model':db[_0x15cc('0xa0')],'as':_0x15cc('0xaf'),'where':_0x4db08c,'limit':0x1,'order':[[_0x15cc('0xa4'),'DESC']]}]},{'model':db[_0x15cc('0xb0')],'as':_0x15cc('0xb1')},{'model':db[_0x15cc('0x3d')],'as':_0x15cc('0x3d'),'include':[{'model':db['Interval'],'as':_0x15cc('0x3e'),'attributes':['id',_0x15cc('0x33')],'raw':!![]}]}]});})['then'](function(_0x16f4cf){if(!_0x16f4cf)throw new APINotFoundError(util[_0x15cc('0x31')]('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x13826b[_0x15cc('0x79')]['id']));if(!_0x16f4cf[_0x15cc('0x3d')]||!_0x16f4cf[_0x15cc('0x3d')][_0x15cc('0x3e')])return[_0x16f4cf,!![]];return[_0x16f4cf,checkWebsiteIntervals(_0x16f4cf)];})[_0x15cc('0xb2')](function(_0x87455f,_0xd79fa1){if(!_0xd79fa1)throw new APIOutOfIntervalError();if(!_0x87455f[_0x15cc('0xae')])return;_0x3235d3['account']=_0x87455f;_0x3235d3[_0x15cc('0xb3')]=_0x87455f[_0x15cc('0xae')];_0x3235d3['applications']=_['orderBy'](_0x87455f['Applications'],[_0x15cc('0xb4')],[_0x15cc('0xb5')]);if(_0x3235d3[_0x15cc('0xb6')][_0x15cc('0xb1')]){delete _0x3235d3[_0x15cc('0xb6')]['Applications'];}if(_0x3235d3[_0x15cc('0xb6')][_0x15cc('0xae')]&&_0x3235d3['account'][_0x15cc('0xae')]['Contacts'][_0x15cc('0x60')]){return _0x3235d3[_0x15cc('0xb6')][_0x15cc('0xae')]['Contacts'][0x0];}var _0x16493f=_[_0x15cc('0xd')](_0x13826b[_0x15cc('0x7a')],{'firstName':_0x13826b[_0x15cc('0x7a')][_0x15cc('0xa8')],'ListId':_0x87455f[_0x15cc('0xa7')]});_0x16493f[_0x13826b[_0x15cc('0x7a')][_0x15cc('0xaa')]]=_0x13826b[_0x15cc('0x7a')][_0x15cc('0xa8')];return db[_0x15cc('0xa0')][_0x15cc('0x71')](_0x16493f,{'fields':_0x11c6d5,'raw':!![]});})['then'](function(_0x593fd0){_0x3235d3[_0x15cc('0xb7')]=_0x593fd0;var _0x3e4e99=createInteractionObject(_0x13826b[_0x15cc('0x79')]['id'],_0x13826b[_0x15cc('0x7a')],_0x13826b[_0x15cc('0xb8')],_0x593fd0);var _0x365c93={'ChatWebsiteId':_0x13826b['params']['id'],'closed':![]};if(_0x13826b['body'][_0x15cc('0xb9')]){_0x365c93[_0x15cc('0xb9')]=_0x13826b['body']['threadId'];return db[_0x15cc('0xba')][_0x15cc('0x76')]({'where':_0x365c93})[_0x15cc('0x15')](function(_0x3f7128){if(_0x3f7128){_0x312ed0=!![];return _0x3f7128;}_0x3e4e99['threadId']=_0x13826b[_0x15cc('0x7a')]['threadId'];_0x3e4e99[_0x15cc('0xbb')]=_0x13826b[_0x15cc('0x7a')][_0x15cc('0xbb')];return db[_0x15cc('0xba')]['create'](_0x3e4e99);});}_0x365c93[_0x15cc('0xbc')]=_0x593fd0['id'];if(_0x13826b['body'][_0x15cc('0xbd')]&&_0x13826b[_0x15cc('0x7a')][_0x15cc('0xbd')]['id']){_0x365c93['id']=_0x13826b[_0x15cc('0x7a')][_0x15cc('0xbd')]['id'];return db['ChatInteraction'][_0x15cc('0x76')]({'where':_0x365c93})[_0x15cc('0x15')](function(_0x404504){if(_0x404504){_0x312ed0=!![];return _0x404504;}return db['ChatInteraction']['create'](_0x3e4e99);});}return db[_0x15cc('0xba')][_0x15cc('0x71')](_0x3e4e99);})['then'](function(_0x56f7e7){if(!_0x312ed0)return _0x56f7e7;var _0xa3911d={'from':(_0x3235d3[_0x15cc('0xb7')][_0x15cc('0x4a')]||'')+'\x20'+(_0x3235d3[_0x15cc('0xb7')]['lastName']||'')};if(_0x13826b[_0x15cc('0x7a')][_0x15cc('0xb9')]&&_0x13826b[_0x15cc('0x7a')][_0x15cc('0xbe')]&&_0x13826b['body'][_0x15cc('0xb9')]!=_0x13826b[_0x15cc('0x7a')]['messageId']){_0xa3911d[_0x15cc('0xb9')]=_0x13826b[_0x15cc('0x7a')][_0x15cc('0xbe')];}return _0x56f7e7[_0x15cc('0x29')](_0xa3911d);})[_0x15cc('0x15')](function(_0x1c87c5){_0x3235d3['interaction']=_0x1c87c5[_0x15cc('0x3f')]({'plain':!![]});_0x3235d3[_0x15cc('0xbd')][_0x15cc('0xbf')]=!_0x312ed0;if(_0x3235d3[_0x15cc('0xbd')][_0x15cc('0xbf')]){if(_0x3235d3['account'][_0x15cc('0xc0')]){_0x3235d3[_0x15cc('0xc1')][_0x15cc('0xc2')]({'id':0x0,'priority':_0x3235d3[_0x15cc('0xc1')][_0x15cc('0x60')]+0x1,'app':_0x15cc('0xc3'),'appdata':_0x15cc('0xc4'),'interval':'*,*,*,*'});}}return db['ChatMessage'][_0x15cc('0x71')]({'body':_0x13826b['body'][_0x15cc('0x7a')],'ChatWebsiteId':_0x13826b[_0x15cc('0x79')]['id'],'ChatInteractionId':_0x1c87c5['id'],'direction':'in','ContactId':_0x3235d3[_0x15cc('0xb7')]['id'],'AttachmentId':_0x13826b['body'][_0x15cc('0xc5')]});})['then'](function(_0x786939){_0x3235d3[_0x15cc('0x1d')]=_0x786939;if(!_0x3235d3['interaction'][_0x15cc('0xc6')]){return;}return db['User'][_0x15cc('0x76')]({'attributes':['id',_0x15cc('0x2e')],'where':{'id':_0x3235d3[_0x15cc('0xbd')][_0x15cc('0xc6')]}});})[_0x15cc('0x15')](function(_0x5ad585){if(_0x5ad585){_0x3235d3[_0x15cc('0xc1')][_0x15cc('0xc7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5ad585[_0x15cc('0x2e')]+','+(_0x3235d3[_0x15cc('0xb6')][_0x15cc('0xc8')]||0xa),'interval':_0x15cc('0xc9')});_0x3235d3[_0x15cc('0xca')]=!![];}if(!_0x3235d3[_0x15cc('0xbd')][_0x15cc('0xcb')]){return;}return db[_0x15cc('0xcc')][_0x15cc('0x76')]({'attributes':['id',_0x15cc('0x2e')],'where':{'id':_0x3235d3[_0x15cc('0xbd')][_0x15cc('0xcb')]}});})[_0x15cc('0x15')](function(_0x2712bb){if(_0x2712bb){_0x3235d3[_0x15cc('0xc1')][_0x15cc('0xc7')]({'id':0x0,'priority':0x1,'app':_0x15cc('0xcd'),'appdata':_0x2712bb[_0x15cc('0x2e')]+','+(_0x3235d3[_0x15cc('0xb6')][_0x15cc('0xce')]||0x12c),'interval':_0x15cc('0xc9')});}return respondWithRpcPromise('Start','startRouting',_0x3235d3);})[_0x15cc('0x15')](function(_0x2ccb3d){respondWithRpcPromise('EventManager',_0x15cc('0xcf'),{'event':'notify','message':_0x2ccb3d},client9002);return _0x2ccb3d;})[_0x15cc('0x15')](respondWithResult(_0x245031,null))[_0x15cc('0x6d')](APIHandleError(_0x245031));};exports['offline']=function(_0x35fe34,_0x50e46e){var _0x3b1069,_0x5859da,_0x468fa7;var _0x4b2be5=[];var _0x119936={};var _0x59790a=_0x35fe34['files']||[];var _0x44cb8a=[];var _0x45c16c;return db[_0x15cc('0xa0')]['describe']()[_0x15cc('0x15')](function(_0x4ba358){if(!_0x4ba358){throw new db['Sequelize'][(_0x15cc('0xa2'))](_0x15cc('0xd0'));}_0x4b2be5=_[_0x15cc('0xa3')](_[_0x15cc('0x5b')](_0x4ba358),['createdAt',_0x15cc('0xa4'),_0x15cc('0xa6'),_0x15cc('0xa7')]);if(_0x35fe34[_0x15cc('0x7a')]['id']){delete _0x35fe34[_0x15cc('0x7a')]['id'];}if(_['isNil'](_0x35fe34[_0x15cc('0x7a')][_0x15cc('0xa8')])){throw _0x50e46e['status'](0x1f4)[_0x15cc('0x2f')](new db[(_0x15cc('0xa1'))][(_0x15cc('0xa2'))]('from\x20is\x20mandatory'));}if(_[_0x15cc('0x93')](_0x35fe34['body']['body'])||_0x35fe34[_0x15cc('0x7a')][_0x15cc('0x7a')]===''){throw _0x50e46e[_0x15cc('0x20')](0x1f4)[_0x15cc('0x2f')](new db[(_0x15cc('0xa1'))][(_0x15cc('0xa2'))](_0x15cc('0xd1')));}if(_[_0x15cc('0x93')](_0x35fe34[_0x15cc('0x7a')]['mapKeyOffline'])){throw _0x50e46e['status'](0x1f4)['send'](new db['Sequelize'][(_0x15cc('0xa2'))](_0x15cc('0xd2')+_0x4b2be5));}if(!_[_0x15cc('0xac')](_0x4b2be5,_0x35fe34[_0x15cc('0x7a')][_0x15cc('0xd3')])){throw _0x50e46e[_0x15cc('0x20')](0x1f4)[_0x15cc('0x2f')](new db[(_0x15cc('0xa1'))]['ValidationError'](_0x15cc('0xd4')+_0x4b2be5));}_0x119936[_0x35fe34[_0x15cc('0x7a')][_0x15cc('0xd3')]]=_0x35fe34['body'][_0x15cc('0xa8')];})[_0x15cc('0x15')](function(){return db[_0x15cc('0x56')]['find']({'where':{'id':_0x35fe34[_0x15cc('0x79')]['id']},'include':[{'model':db[_0x15cc('0xd5')],'as':_0x15cc('0xae')},{'model':db[_0x15cc('0xd6')],'as':'MailAccount'}]});})[_0x15cc('0x15')](handleEntityNotFound(_0x50e46e,null))[_0x15cc('0x15')](function(_0x375d47){if(_0x375d47&&_0x375d47[_0x15cc('0xae')]){_0x5859da=_0x375d47;var _0x32af71=_[_0x15cc('0xd')](_0x35fe34[_0x15cc('0x7a')],{'firstName':_0x35fe34[_0x15cc('0x7a')][_0x15cc('0xa8')],'phone':_0x35fe34[_0x15cc('0x7a')][_0x15cc('0xa8')],'ListId':_0x375d47['ListId']});_0x32af71[_0x35fe34[_0x15cc('0x7a')][_0x15cc('0xd3')]]=_0x35fe34['body'][_0x15cc('0xa8')];return db[_0x15cc('0xa0')][_0x15cc('0xd7')]({'where':_0x119936,'defaults':_0x32af71});}})[_0x15cc('0xb2')](function(_0x43bdce){if(_0x43bdce){_0x468fa7=_0x43bdce;var _0x16383b=fs[_0x15cc('0xd8')](path[_0x15cc('0x96')](config[_0x15cc('0x8f')],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x2e8967=ejs['render'](_0x16383b,{'body':_[_0x15cc('0xd9')](_0x35fe34[_0x15cc('0x7a')]['body']),'bodyTitle':_0x5859da[_0x15cc('0xda')]});return db[_0x15cc('0xdb')][_0x15cc('0x71')]({'body':_0x2e8967,'plainBody':htmlToText[_0x15cc('0xdc')](_0x2e8967),'ContactId':_0x43bdce['id'],'ChatWebsiteId':_0x5859da['id']});}})[_0x15cc('0x15')](function(_0xa85b4e){_0x45c16c=_0xa85b4e;if(_0x59790a[_0x15cc('0x60')]){var _0x139ca1=_0x59790a[_0x15cc('0x3c')](function(_0x287b7a){return{'name':_0x287b7a['originalname'],'basename':_0x287b7a[_0x15cc('0x8b')],'type':_0x287b7a[_0x15cc('0xdd')],'ChatOfflineMessageId':_0xa85b4e['id']};});_0x44cb8a=_0x139ca1['map'](_0x392251=>{var _0x2e4b9d={'filename':_0x392251['name'],'path':path[_0x15cc('0x96')](config[_0x15cc('0x8f')],'server',_0x15cc('0xde'),_0x15cc('0xdf'),_0x15cc('0xe0'),_0x392251[_0x15cc('0xe1')])};return _0x2e4b9d;});if(!_0x5859da[_0x15cc('0xe2')]){return db[_0x15cc('0xe3')][_0x15cc('0xe4')](function(_0x3509b6){return db['Attachment'][_0x15cc('0xe5')](_0x139ca1,{'transaction':_0x3509b6});});}}})[_0x15cc('0x15')](function(){if(_0x45c16c){_0x3b1069=_0x45c16c;return db[_0x15cc('0xd6')][_0x15cc('0x7f')]({'where':{'service':!![]},'include':[{'model':db[_0x15cc('0xe6')],'as':_0x15cc('0xe7'),'raw':!![],'include':[{'model':db[_0x15cc('0xe8')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x15cc('0x15')](function(_0x43b79b){if(_0x43b79b&&_0x43b79b[_0x15cc('0xe7')]&&_0x5859da['forwardOffline']&&_0x5859da[_0x15cc('0xe9')]){var _0x245dfa=_0x43b79b[_0x15cc('0xea')]();return respondWithRpcPromise('SendMail',_0x15cc('0xeb'),{'account':_0x245dfa,'message':{'from':util[_0x15cc('0x31')]('\x22%s\x22\x20<%s>',_0x43b79b[_0x15cc('0x2e')],_0x43b79b[_0x15cc('0xec')]||_0x43b79b['Smtp'][_0x15cc('0x72')]),'to':_0x5859da[_0x15cc('0xe9')],'subject':_0x5859da['offlineMessageSubject'],'html':_0x3b1069[_0x15cc('0x7a')],'attachments':_0x44cb8a}},client9003)[_0x15cc('0x15')](function(){return _0x3b1069;})['catch'](function(_0x3d6629){logger[_0x15cc('0x1c')](_0x3d6629);});}})['then'](function(){if(_0x5859da&&_0x5859da['openNewInteraction']&&_0x5859da[_0x15cc('0xed')]){var _0x3260d6=[];if(_0x59790a[_0x15cc('0x60')]){_0x3260d6=_0x59790a['map'](function(_0x5ea1c5){return{'name':_0x5ea1c5[_0x15cc('0xee')],'basename':_0x5ea1c5[_0x15cc('0x8b')],'type':_0x5ea1c5[_0x15cc('0xdd')],'ChatOfflineMessageId':_0x45c16c['id']};});}var _0x548025;if(!_[_0x15cc('0x93')](_0x5859da['subjectOffline'])){var _0x442634=_['map'](_0x35fe34[_0x15cc('0x7a')],function(_0x2c29ca){return _0x2c29ca;});var _0x5a4e14=_[_0x15cc('0xef')](_0x442634)[0x0];var _0x301754=_[_0x15cc('0xf0')](_0x5a4e14,function(_0x7dd60b){return _0x7dd60b;});_0x548025=_0x301754[0x1][_0x5859da['subjectOffline']];}var _0x1723fb={'from':_0x468fa7[_0x15cc('0xec')],'firstName':_0x468fa7['firstName'],'lastName':_0x468fa7[_0x15cc('0xf1')],'mapKey':_0x15cc('0xec'),'message':{'from':_0x468fa7[_0x15cc('0xec')],'to':_0x5859da[_0x15cc('0xd6')][_0x15cc('0xec')],'cc':'','subject':_['isNil'](_0x548025)?_0x5859da[_0x15cc('0xf2')]:_0x548025,'messageId':'','sentAt':new Date(),'attach':_0x3260d6['length'],'attachments':_0x3260d6,'originChannel':'Chat','ChatWebsiteId':_0x5859da['id'],'ChatOfflineMessageId':_0x3b1069['id'],'originTo':_0x5859da[_0x15cc('0xd6')][_0x15cc('0xec')]},'body':_0x3b1069[_0x15cc('0x7a')]};var _0x517b76={'account':{'id':_0x5859da[_0x15cc('0xed')]},'body':_0x1723fb,'log':_0x15cc('0xf3')};return respondWithRpcPromise('NotifyMailAccount',_0x15cc('0xf4'),_0x517b76,client9001)['then'](function(){return _0x3b1069;})[_0x15cc('0x6d')](function(_0x2513a3){logger['error'](_0x2513a3);});}return;})['then'](function(){if(_0x3b1069){return _0x3b1069;}})[_0x15cc('0x15')](respondWithResult(_0x50e46e,null))[_0x15cc('0x6d')](function(){for(var _0x45b8ec of _0x59790a){var _0x5b9ab1=path['join'](config['root'],_0x15cc('0xf5'),_0x15cc('0xde'),'attachments',_0x15cc('0xe0'),_0x45b8ec['filename']);fs_extra[_0x15cc('0xf6')](_0x5b9ab1)[_0x15cc('0x6d')](function(_0xaee966){logger[_0x15cc('0x1c')](_0x15cc('0xf7'),_0x5b9ab1,_0xaee966);});}});};exports[_0x15cc('0xf8')]=function(_0x51562e,_0x540a00){return db[_0x15cc('0xba')][_0x15cc('0x76')]({'where':{'id':_0x51562e[_0x15cc('0x79')]['id']}})['then'](handleEntityNotFound(_0x540a00,null))['then'](function(_0x15706a){if(_0x15706a){return _0x15706a['addInteraction'](_0x51562e[_0x15cc('0x7a')][_0x15cc('0x83')],_[_0x15cc('0xf9')](_0x51562e['body'],[_0x15cc('0x83'),'id'])||{});}})[_0x15cc('0x15')](respondWithResult(_0x540a00,null))[_0x15cc('0x6d')](handleError(_0x540a00,null));};exports['getInteractions']=function(_0x16e37c,_0xb12c60){var _0x22d925={'raw':![],'where':{}};var _0x1529ae={};var _0xacdcea={'count':0x0,'rows':[]};return db[_0x15cc('0x56')][_0x15cc('0x7f')]({'where':{'id':_0x16e37c[_0x15cc('0x79')]['id']}})['then'](handleEntityNotFound(_0xb12c60,null))[_0x15cc('0x15')](function(_0x58b2c3){if(_0x58b2c3){_0x1529ae[_0x15cc('0x53')]=_[_0x15cc('0x5b')](db[_0x15cc('0xba')][_0x15cc('0x70')]);_0x1529ae['query']=_[_0x15cc('0x5b')](_0x16e37c[_0x15cc('0x5a')]);_0x1529ae[_0x15cc('0x5c')]=_['intersection'](_0x1529ae['model'],_0x1529ae[_0x15cc('0x5a')]);_0x22d925[_0x15cc('0x5f')]=_['intersection'](_0x1529ae[_0x15cc('0x53')],qs[_0x15cc('0x5e')](_0x16e37c['query'][_0x15cc('0x5e')]));_0x22d925['attributes']=_0x22d925[_0x15cc('0x5f')]['length']?_0x22d925[_0x15cc('0x5f')]:_0x1529ae[_0x15cc('0x53')];if(!_0x16e37c['query'][_0x15cc('0xfa')]('nolimit')){_0x22d925[_0x15cc('0x24')]=qs[_0x15cc('0x24')](_0x16e37c[_0x15cc('0x5a')][_0x15cc('0x24')]);_0x22d925['offset']=qs[_0x15cc('0x23')](_0x16e37c[_0x15cc('0x5a')][_0x15cc('0x23')]);}_0x22d925[_0x15cc('0x80')]=qs[_0x15cc('0x62')](_0x16e37c[_0x15cc('0x5a')]['sort']);_0x22d925[_0x15cc('0x63')]=qs[_0x15cc('0x5c')](_['pick'](_0x16e37c[_0x15cc('0x5a')],_0x1529ae['filters']));_0x22d925[_0x15cc('0x63')][_0x15cc('0x7d')]=_0x58b2c3['id'];if(_0x16e37c[_0x15cc('0x5a')][_0x15cc('0x65')]){_0x22d925[_0x15cc('0x63')]=_[_0x15cc('0x66')](_0x22d925['where'],{'$or':_[_0x15cc('0x3c')](_0x22d925[_0x15cc('0x5f')],function(_0x26f4a5){var _0x78c042={};_0x78c042[_0x26f4a5]={'$like':'%'+_0x16e37c['query'][_0x15cc('0x65')]+'%'};return _0x78c042;})});}_0x22d925=_[_0x15cc('0x66')]({},_0x22d925,_0x16e37c[_0x15cc('0x68')]);return db[_0x15cc('0xba')][_0x15cc('0x26')]({'where':_0x22d925[_0x15cc('0x63')]})[_0x15cc('0x15')](function(_0x44b259){_0xacdcea[_0x15cc('0x26')]=_0x44b259;if(_0x16e37c[_0x15cc('0x5a')]['includeAll']){_0x22d925[_0x15cc('0x6a')]=[{'model':db[_0x15cc('0xa0')],'as':_0x15cc('0xfb'),'required':![]},{'model':db[_0x15cc('0xfc')],'as':_0x15cc('0xfd'),'attributes':[_0x15cc('0x2e'),_0x15cc('0xfe'),'internal'],'required':![]},{'model':db[_0x15cc('0xff')],'as':_0x15cc('0x100'),'attributes':['id',_0x15cc('0x2e'),'color'],'where':_0x16e37c[_0x15cc('0x5a')][_0x15cc('0x101')]?{'id':_0x16e37c[_0x15cc('0x5a')]['tag']}:undefined,'required':_0x16e37c['query'][_0x15cc('0x101')]?!![]:![]}];}return db[_0x15cc('0xba')][_0x15cc('0x6b')](_0x22d925);})[_0x15cc('0x15')](function(_0x73fd4c){_0xacdcea[_0x15cc('0x6c')]=_0x73fd4c;return _0xacdcea;});}})[_0x15cc('0x15')](respondWithFilteredResult(_0xb12c60,_0x22d925))['catch'](handleError(_0xb12c60,null));};exports[_0x15cc('0x30')]=function(_0x442e64,_0x1b34e8){var _0xc5fc1f=0x0;var _0x3f54fd=0x0;var _0x128a3d=![];var _0x559c02;var _0xdc5ed5;return db[_0x15cc('0x56')]['find']({'where':{'id':_0x442e64[_0x15cc('0x79')]['id']},'include':[{'model':db[_0x15cc('0x3d')],'as':_0x15cc('0x3d'),'include':[{'model':db[_0x15cc('0x3d')],'as':'Intervals','attributes':['id',_0x15cc('0x33')]}]}]})[_0x15cc('0x15')](handleEntityNotFound(_0x1b34e8,null))[_0x15cc('0x15')](function(_0x29cb61){if(_0x29cb61){_0x559c02=_0x29cb61;return _0x29cb61[_0x15cc('0x102')]({'raw':!![]});}})[_0x15cc('0x15')](function(_0x3b9639){if(_0x559c02){if(_0x3b9639){_0xdc5ed5=_0x3b9639;}}return require(_0x15cc('0x90'))[_0x15cc('0x91')]();})[_0x15cc('0x15')](function(_0x5a6e1e){if(_0x5a6e1e){_0x3f54fd=_0x5a6e1e['virtual'];_0x128a3d=_0x5a6e1e[_0x15cc('0x92')];}})['then'](function(){return db[_0x15cc('0xba')][_0x15cc('0x26')]({'where':{'closed':![]}});})[_0x15cc('0x15')](function(_0x5b988b){_0xc5fc1f=_0x5b988b;if(_0x3f54fd&&_0x5b988b>_0x3f54fd){return db[_0x15cc('0x103')]['findOne']({'where':{'id':0x1}})[_0x15cc('0x15')](function(_0x1a6216){if(_0x1a6216){_0x1a6216[_0x15cc('0x104')](_0x15cc('0x105'));}});}})[_0x15cc('0x15')](function(){if(!_0x559c02[_0x15cc('0x3d')]||!_0x559c02[_0x15cc('0x3d')][_0x15cc('0x3e')])return!![];return checkWebsiteIntervals(_0x559c02);})[_0x15cc('0x15')](function(_0x31df6f){var _0x3d7719=fs['readFileSync'](path['join'](config[_0x15cc('0x8f')],_0x15cc('0x106')),_0x15cc('0x107'));var _0x1751a8=new url[(_0x15cc('0x108'))](_0x559c02[_0x15cc('0x109')])[_0x15cc('0x10a')];var _0x3e5b63=_0x15cc('0x10b');var _0x4e0496=![];var _0x213fd0={'chatVersion':_0x3e5b63,'chatWebsiteAddressOrigin':_0x1751a8,'remote':_0x559c02[_0x15cc('0x10c')],'query':querystring[_0x15cc('0x1a')](_['merge'](_0x559c02[_0x15cc('0x3f')]({'plain':!![]}),{'customerIp':_0x442e64[_0x15cc('0xb8')][_0x15cc('0x47')]||_0x442e64['headers'][_0x15cc('0x10d')]||_0x442e64[_0x15cc('0x10e')][_0x15cc('0x10f')]||_0x442e64['ip'],'referer':_0x442e64['headers'][_0x15cc('0x110')],'openedInteractions':_0xc5fc1f,'maxInteractions':_0x3f54fd,'virtual':_0x128a3d['virtual'],'online':_0x31df6f,'custom':_0x128a3d}))[_0x15cc('0x111')](/'/g,'\x5c\x27')};_0x1b34e8[_0x15cc('0x2f')](ejs['render'](Mustache[_0x15cc('0x112')](_0x3d7719,_0x213fd0),{'proactiveActions':_0xdc5ed5,'alignment':_0x559c02[_0x15cc('0x113')],'verticalAlignment':_0x559c02['verticalAlignment'],'div_color':_0x559c02[_0x15cc('0x114')],'labelText':_0x559c02[_0x15cc('0x115')],'text_color':_0x559c02[_0x15cc('0x116')],'text_button_color':_0x559c02[_0x15cc('0x117')],'button_color':_0x559c02[_0x15cc('0x118')],'background_color':_0x559c02['backgroundColor'],'hideWhenOffline':_0x559c02['hideWhenOffline'],'intervalId':_0x559c02[_0x15cc('0x119')],'isDevelopment':_0x4e0496,'chatVersion':_0x3e5b63}));})['catch'](handleError(_0x1b34e8,null));};exports[_0x15cc('0x11a')]=function(_0x3bb432,_0x4253e4){var _0x584462=_0x3bb432['params']['id'];var _0x2c830b=_0x3bb432['body'];var _0x70239d=0xc8;var _0x16b5a7=null;return db[_0x15cc('0xe3')][_0x15cc('0xe4')]({'isolationLevel':db['sequelize'][_0x15cc('0x11b')][_0x15cc('0x11c')][_0x15cc('0x11d')]},function(_0x5d3af6){return db['ChatWebsite'][_0x15cc('0x7f')]({'where':{'id':_0x584462},'transaction':_0x5d3af6})[_0x15cc('0x15')](function(_0x46b439){if(_0x46b439){return db[_0x15cc('0xb0')][_0x15cc('0x2a')]({'where':{'ChatWebsiteId':_0x584462},'transaction':_0x5d3af6})[_0x15cc('0x15')](function(){var _0x391653=_['map'](_0x2c830b,function(_0x46aae1){_0x46aae1['ChatWebsiteId']=_0x584462;return _0x46aae1;});return db['ChatApplication'][_0x15cc('0xe5')](_0x391653,{'transaction':_0x5d3af6});});}else{_0x70239d=0x194;_0x16b5a7=[];}});})[_0x15cc('0x15')](function(){if(_0x70239d!==0x194){return db[_0x15cc('0xb0')][_0x15cc('0x11e')]({'where':{'ChatWebsiteId':_0x584462},'order':_0x15cc('0xb4')})[_0x15cc('0x15')](function(_0xab7a4e){_0x16b5a7=_0xab7a4e;});}})[_0x15cc('0x6d')](function(_0x2057c2){_0x70239d=0x1f4;logger['error'](_0x2057c2[_0x15cc('0x2d')]);if(_0x2057c2[_0x15cc('0x2e')]){delete _0x2057c2[_0x15cc('0x2e')];}_0x16b5a7=_0x2057c2;})['finally'](function(){if(_0x16b5a7===null){_0x4253e4[_0x15cc('0x1f')](_0x70239d);}else{if(_0x70239d===0x1f4){_0x4253e4['status'](_0x70239d)[_0x15cc('0x2f')](_0x16b5a7);}else{_0x4253e4[_0x15cc('0x20')](_0x70239d)[_0x15cc('0x22')](_0x16b5a7);}}});};exports[_0x15cc('0x11f')]=function(_0x25b7ca,_0x304c3f){var _0x25a9f8={};var _0xb001ad={};var _0x126dc1;var _0x502abf;return db[_0x15cc('0x56')][_0x15cc('0x7f')]({'where':{'id':_0x25b7ca[_0x15cc('0x79')]['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x304c3f,null))[_0x15cc('0x15')](function(_0x17594a){if(_0x17594a){_0x126dc1=_0x17594a;_0xb001ad['model']=_[_0x15cc('0x5b')](db['ChatApplication'][_0x15cc('0x70')]);_0xb001ad[_0x15cc('0x5a')]=_[_0x15cc('0x5b')](_0x25b7ca[_0x15cc('0x5a')]);_0xb001ad['filters']=_[_0x15cc('0x5d')](_0xb001ad[_0x15cc('0x53')],_0xb001ad[_0x15cc('0x5a')]);_0x25a9f8[_0x15cc('0x5f')]=_[_0x15cc('0x5d')](_0xb001ad[_0x15cc('0x53')],qs[_0x15cc('0x5e')](_0x25b7ca[_0x15cc('0x5a')][_0x15cc('0x5e')]));_0x25a9f8['attributes']=_0x25a9f8[_0x15cc('0x5f')][_0x15cc('0x60')]?_0x25a9f8[_0x15cc('0x5f')]:_0xb001ad[_0x15cc('0x53')];_0x25a9f8[_0x15cc('0x80')]=qs['sort'](_0x25b7ca[_0x15cc('0x5a')]['sort']);_0x25a9f8[_0x15cc('0x63')]=qs[_0x15cc('0x5c')](_['pick'](_0x25b7ca[_0x15cc('0x5a')],_0xb001ad['filters']));if(_0x25b7ca['query'][_0x15cc('0x65')]){_0x25a9f8['where']=_[_0x15cc('0x66')](_0x25a9f8[_0x15cc('0x63')],{'$or':_[_0x15cc('0x3c')](_0x25a9f8[_0x15cc('0x5f')],function(_0x5cc59c){var _0x36023d={};_0x36023d[_0x5cc59c]={'$like':'%'+_0x25b7ca[_0x15cc('0x5a')][_0x15cc('0x65')]+'%'};return _0x36023d;})});}_0x25a9f8=_[_0x15cc('0x66')]({},_0x25a9f8,_0x25b7ca[_0x15cc('0x68')]);return _0x126dc1[_0x15cc('0x11f')](_0x25a9f8);}})[_0x15cc('0x15')](function(_0x4e40ab){if(_0x4e40ab){_0x502abf=_0x4e40ab['length'];if(!_0x25b7ca[_0x15cc('0x5a')][_0x15cc('0xfa')](_0x15cc('0x61'))){_0x25a9f8[_0x15cc('0x24')]=qs['limit'](_0x25b7ca['query'][_0x15cc('0x24')]);_0x25a9f8[_0x15cc('0x23')]=qs[_0x15cc('0x23')](_0x25b7ca[_0x15cc('0x5a')]['offset']);}return _0x126dc1[_0x15cc('0x11f')](_0x25a9f8);}})[_0x15cc('0x15')](function(_0x5b027c){if(_0x5b027c){return _0x5b027c?{'count':_0x502abf,'rows':_0x5b027c}:null;}})['then'](respondWithResult(_0x304c3f,null))[_0x15cc('0x6d')](handleError(_0x304c3f,null));};exports[_0x15cc('0x120')]=function(_0xa33009,_0xc0df40){return db['chatProactiveAction'][_0x15cc('0x76')]({'where':{'id':_0xa33009[_0x15cc('0x79')]['id']}})['then'](handleEntityNotFound(_0xc0df40,null))['then'](function(_0x1a2b12){if(_0x1a2b12){return _0x1a2b12['addProactiveActions'](_0xa33009[_0x15cc('0x7a')]['ids'],_[_0x15cc('0xf9')](_0xa33009[_0x15cc('0x7a')],[_0x15cc('0x83'),'id'])||{});}})[_0x15cc('0x15')](respondWithResult(_0xc0df40,null))[_0x15cc('0x6d')](handleError(_0xc0df40,null));};exports[_0x15cc('0x102')]=function(_0x23a20e,_0x273873){var _0x1075ef={};var _0x869b2a={};var _0x1cd0ea;var _0x2b96ff;return db[_0x15cc('0x56')][_0x15cc('0x7f')]({'where':{'id':_0x23a20e['params']['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x273873,null))[_0x15cc('0x15')](function(_0x19a5b6){if(_0x19a5b6){_0x1cd0ea=_0x19a5b6;_0x869b2a[_0x15cc('0x53')]=_['keys'](db['ChatProactiveAction'][_0x15cc('0x70')]);_0x869b2a[_0x15cc('0x5a')]=_[_0x15cc('0x5b')](_0x23a20e[_0x15cc('0x5a')]);_0x869b2a['filters']=_[_0x15cc('0x5d')](_0x869b2a[_0x15cc('0x53')],_0x869b2a[_0x15cc('0x5a')]);_0x1075ef[_0x15cc('0x5f')]=_[_0x15cc('0x5d')](_0x869b2a[_0x15cc('0x53')],qs[_0x15cc('0x5e')](_0x23a20e['query'][_0x15cc('0x5e')]));_0x1075ef[_0x15cc('0x5f')]=_0x1075ef[_0x15cc('0x5f')][_0x15cc('0x60')]?_0x1075ef[_0x15cc('0x5f')]:_0x869b2a[_0x15cc('0x53')];_0x1075ef['order']=qs['sort'](_0x23a20e[_0x15cc('0x5a')]['sort']);_0x1075ef['where']=qs[_0x15cc('0x5c')](_[_0x15cc('0x64')](_0x23a20e[_0x15cc('0x5a')],_0x869b2a[_0x15cc('0x5c')]));if(_0x23a20e['query'][_0x15cc('0x65')]){_0x1075ef['where']=_['merge'](_0x1075ef['where'],{'$or':_[_0x15cc('0x3c')](_0x1075ef['attributes'],function(_0x19e65f){var _0x1314a2={};_0x1314a2[_0x19e65f]={'$like':'%'+_0x23a20e[_0x15cc('0x5a')][_0x15cc('0x65')]+'%'};return _0x1314a2;})});}_0x1075ef=_['merge']({},_0x1075ef,_0x23a20e[_0x15cc('0x68')]);return _0x1cd0ea['getProactiveActions'](_0x1075ef);}})['then'](function(_0x1b0a68){if(_0x1b0a68){_0x2b96ff=_0x1b0a68[_0x15cc('0x60')];if(!_0x23a20e['query'][_0x15cc('0xfa')]('nolimit')){_0x1075ef['limit']=qs['limit'](_0x23a20e[_0x15cc('0x5a')][_0x15cc('0x24')]);_0x1075ef[_0x15cc('0x23')]=qs[_0x15cc('0x23')](_0x23a20e['query']['offset']);}return _0x1cd0ea[_0x15cc('0x102')](_0x1075ef);}})[_0x15cc('0x15')](function(_0x4da513){if(_0x4da513){return _0x4da513?{'count':_0x2b96ff,'rows':_0x4da513}:null;}})['then'](respondWithResult(_0x273873,null))[_0x15cc('0x6d')](handleError(_0x273873,null));};exports[_0x15cc('0x121')]=function(_0x58fe15,_0x3b075e){var _0x5ce6bb=_0x58fe15[_0x15cc('0x5a')][_0x15cc('0x122')]==='false'?_0x15cc('0x123'):_0x15cc('0x124');return db['ChatWebsite']['find']({'attributes':['id',_0x5ce6bb],'where':{'id':_0x58fe15[_0x15cc('0x79')]['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x3b075e,null))[_0x15cc('0x15')](function(_0x59dbe7){if(_0x59dbe7){var _0x5d90ac=_0x59dbe7[_0x5ce6bb];var _0x2fbf97=_0x5d90ac&&_0x5d90ac[_0x15cc('0x125')]?_0x5d90ac['items']:[];_0x3b075e['send']({'fromKey':_['isNil'](_0x5d90ac['fromKey'])?undefined:_0x5d90ac['fromKey'],'count':_0x2fbf97[_0x15cc('0x60')],'rows':_0x2fbf97});}})[_0x15cc('0x6d')](handleError(_0x3b075e,null));};exports['getOfflineMessages']=function(_0x31dad7,_0x502234){var _0x2debb7={'raw':![],'where':{}};var _0x280102={};var _0x468fdc={'count':0x0,'rows':[]};return db[_0x15cc('0x56')][_0x15cc('0x7f')]({'where':{'id':_0x31dad7['params']['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x502234,null))[_0x15cc('0x15')](function(_0x5d9fd2){if(_0x5d9fd2){_0x280102[_0x15cc('0x53')]=_[_0x15cc('0x5b')](db['ChatOfflineMessage'][_0x15cc('0x70')]);_0x280102[_0x15cc('0x5a')]=_[_0x15cc('0x5b')](_0x31dad7[_0x15cc('0x5a')]);_0x280102[_0x15cc('0x5c')]=_['intersection'](_0x280102[_0x15cc('0x53')],_0x280102['query']);_0x2debb7[_0x15cc('0x5f')]=_[_0x15cc('0x5d')](_0x280102[_0x15cc('0x53')],qs[_0x15cc('0x5e')](_0x31dad7[_0x15cc('0x5a')][_0x15cc('0x5e')]));_0x2debb7[_0x15cc('0x5f')]=_0x2debb7['attributes'][_0x15cc('0x60')]?_0x2debb7['attributes']:_0x280102[_0x15cc('0x53')];if(!_0x31dad7['query'][_0x15cc('0xfa')](_0x15cc('0x61'))){_0x2debb7['limit']=qs[_0x15cc('0x24')](_0x31dad7[_0x15cc('0x5a')][_0x15cc('0x24')]);_0x2debb7[_0x15cc('0x23')]=qs['offset'](_0x31dad7[_0x15cc('0x5a')]['offset']);}_0x2debb7[_0x15cc('0x80')]=qs['sort'](_0x31dad7[_0x15cc('0x5a')]['sort']);_0x2debb7['where']=qs['filters'](_[_0x15cc('0x64')](_0x31dad7[_0x15cc('0x5a')],_0x280102['filters']));_0x2debb7['where'][_0x15cc('0x7d')]=_0x5d9fd2['id'];if(_0x31dad7['query'][_0x15cc('0x65')]){_0x2debb7[_0x15cc('0x63')]=_['merge'](_0x2debb7[_0x15cc('0x63')],{'$or':_[_0x15cc('0x3c')](_0x2debb7[_0x15cc('0x5f')],function(_0x57caa9){var _0x442a47={};_0x442a47[_0x57caa9]={'$like':'%'+_0x31dad7[_0x15cc('0x5a')][_0x15cc('0x65')]+'%'};return _0x442a47;})});}_0x2debb7=_[_0x15cc('0x66')]({},_0x2debb7,_0x31dad7[_0x15cc('0x68')]);return db[_0x15cc('0xdb')][_0x15cc('0x26')]({'where':_0x2debb7[_0x15cc('0x63')]})[_0x15cc('0x15')](function(_0x4471a6){_0x468fdc[_0x15cc('0x26')]=_0x4471a6;if(_0x31dad7[_0x15cc('0x5a')]['includeAll']){_0x2debb7[_0x15cc('0x6a')]=[{'all':!![]}];}else{_0x2debb7[_0x15cc('0x6a')]=[{'model':db['CmContact'],'as':_0x15cc('0xfb'),'required':![]},{'model':db[_0x15cc('0x126')],'as':'Attachments','required':![]}];}return db[_0x15cc('0xdb')][_0x15cc('0x6b')](_0x2debb7);})[_0x15cc('0x15')](function(_0x19a4dd){_0x468fdc['rows']=_0x19a4dd;return _0x468fdc;});}})['then'](respondWithFilteredResult(_0x502234,_0x2debb7))[_0x15cc('0x6d')](handleError(_0x502234,null));};exports[_0x15cc('0x127')]=function(_0x328886,_0x407c6f){return db['ChatWebsite']['find']({'where':{'id':_0x328886['params']['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x407c6f,null))[_0x15cc('0x15')](function(_0x204365){if(_0x204365){return _0x204365[_0x15cc('0x127')](_0x328886['body'][_0x15cc('0x83')],_[_0x15cc('0xf9')](_0x328886['body'],[_0x15cc('0x83'),'id'])||{})[_0x15cc('0xb2')](function(_0x150ccb){for(var _0x3682cb=0x0;_0x3682cb<_0x328886['body'][_0x15cc('0x83')][_0x15cc('0x60')];_0x3682cb+=0x1){socket[_0x15cc('0x128')](_0x15cc('0x129'),{'UserId':Number(_0x328886[_0x15cc('0x7a')]['ids'][_0x3682cb]),'ChatWebsiteId':Number(_0x328886[_0x15cc('0x79')]['id'])});}return _0x150ccb;});}})[_0x15cc('0x15')](respondWithResult(_0x407c6f,null))[_0x15cc('0x6d')](handleError(_0x407c6f,null));};exports[_0x15cc('0x12a')]=function(_0x1313ae,_0x1d4959){return db[_0x15cc('0x56')][_0x15cc('0x76')]({'where':{'id':_0x1313ae[_0x15cc('0x79')]['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x1d4959,null))['then'](function(_0x382a7e){if(_0x382a7e){return _0x382a7e['removeAgents'](_0x1313ae['query'][_0x15cc('0x83')])['then'](function(){if(_[_0x15cc('0x12b')](_0x1313ae[_0x15cc('0x5a')][_0x15cc('0x83')])){for(var _0x689cc4=0x0;_0x689cc4<_0x1313ae[_0x15cc('0x5a')]['ids']['length'];_0x689cc4+=0x1){socket[_0x15cc('0x128')](_0x15cc('0x12c'),{'UserId':Number(_0x1313ae['query'][_0x15cc('0x83')][_0x689cc4]),'ChatWebsiteId':Number(_0x1313ae['params']['id'])});}}else{socket[_0x15cc('0x128')](_0x15cc('0x12c'),{'UserId':Number(_0x1313ae[_0x15cc('0x5a')][_0x15cc('0x83')]),'ChatWebsiteId':Number(_0x1313ae[_0x15cc('0x79')]['id'])});}});}})[_0x15cc('0x15')](respondWithStatusCode(_0x1d4959,null))[_0x15cc('0x6d')](handleError(_0x1d4959,null));};exports['getAgents']=function(_0x1acaba,_0x33edf6){var _0x19a150={};var _0x3ff2b7={};var _0x17f733;var _0x32024f;return db[_0x15cc('0x56')][_0x15cc('0x7f')]({'where':{'id':_0x1acaba[_0x15cc('0x79')]['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x33edf6,null))[_0x15cc('0x15')](function(_0x3bf826){if(_0x3bf826){_0x17f733=_0x3bf826;_0x3ff2b7[_0x15cc('0x53')]=_['keys'](db[_0x15cc('0xfc')][_0x15cc('0x70')]);_0x3ff2b7['query']=_['keys'](_0x1acaba[_0x15cc('0x5a')]);_0x3ff2b7['filters']=_[_0x15cc('0x5d')](_0x3ff2b7[_0x15cc('0x53')],_0x3ff2b7['query']);_0x19a150['attributes']=_['intersection'](_0x3ff2b7['model'],qs['fields'](_0x1acaba[_0x15cc('0x5a')]['fields']));_0x19a150[_0x15cc('0x5f')]=_0x19a150[_0x15cc('0x5f')][_0x15cc('0x60')]?_0x19a150[_0x15cc('0x5f')]:_0x3ff2b7[_0x15cc('0x53')];_0x19a150[_0x15cc('0x80')]=qs[_0x15cc('0x62')](_0x1acaba[_0x15cc('0x5a')][_0x15cc('0x62')]);_0x19a150[_0x15cc('0x63')]=qs[_0x15cc('0x5c')](_[_0x15cc('0x64')](_0x1acaba[_0x15cc('0x5a')],_0x3ff2b7[_0x15cc('0x5c')]));if(_0x1acaba[_0x15cc('0x5a')][_0x15cc('0x65')]){_0x19a150['where']=_[_0x15cc('0x66')](_0x19a150[_0x15cc('0x63')],{'$or':_[_0x15cc('0x3c')](_0x19a150[_0x15cc('0x5f')],function(_0x30a727){var _0x136dec={};_0x136dec[_0x30a727]={'$like':'%'+_0x1acaba[_0x15cc('0x5a')][_0x15cc('0x65')]+'%'};return _0x136dec;})});}_0x19a150=_[_0x15cc('0x66')]({},_0x19a150,_0x1acaba['options']);return _0x17f733['getAgents'](_0x19a150);}})[_0x15cc('0x15')](function(_0x428c5d){if(_0x428c5d){_0x32024f=_0x428c5d['length'];if(!_0x1acaba[_0x15cc('0x5a')][_0x15cc('0xfa')](_0x15cc('0x61'))){_0x19a150[_0x15cc('0x24')]=qs[_0x15cc('0x24')](_0x1acaba[_0x15cc('0x5a')][_0x15cc('0x24')]);_0x19a150[_0x15cc('0x23')]=qs['offset'](_0x1acaba['query'][_0x15cc('0x23')]);}return _0x17f733[_0x15cc('0x12d')](_0x19a150);}})[_0x15cc('0x15')](function(_0x1e75a5){if(_0x1e75a5){return _0x1e75a5?{'count':_0x32024f,'rows':_0x1e75a5}:null;}})[_0x15cc('0x15')](respondWithResult(_0x33edf6,null))['catch'](handleError(_0x33edf6,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 55123e9..768ee95 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 _0xbf4e=['events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x1ad89c,_0x49dfe0){var _0x1dd3b1=function(_0xb4094c){while(--_0xb4094c){_0x1ad89c['push'](_0x1ad89c['shift']());}};_0x1dd3b1(++_0x49dfe0);}(_0xbf4e,0x172));var _0xebf4=function(_0x5be829,_0x48378c){_0x5be829=_0x5be829-0x0;var _0x343686=_0xbf4e[_0x5be829];return _0x343686;};'use strict';var EventEmitter=require(_0xebf4('0x0'));var ChatWebsite=require(_0xebf4('0x1'))['db'][_0xebf4('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xebf4('0x3')](0x0);var events={'afterCreate':_0xebf4('0x4'),'afterUpdate':_0xebf4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x41cb2c){return function(_0x5d2ad5,_0x59cc54,_0x15328a){ChatWebsiteEvents[_0xebf4('0x6')](_0x41cb2c+':'+_0x5d2ad5['id'],_0x5d2ad5);ChatWebsiteEvents['emit'](_0x41cb2c,_0x5d2ad5);_0x15328a(null);};}for(var e in events){if(events[_0xebf4('0x7')](e)){var event=events[e];ChatWebsite[_0xebf4('0x8')](e,emitEvent(event));}}module[_0xebf4('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x1280=['save','update','remove','emit','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x14bcaa,_0x1f775d){var _0x211587=function(_0x55e7a2){while(--_0x55e7a2){_0x14bcaa['push'](_0x14bcaa['shift']());}};_0x211587(++_0x1f775d);}(_0x1280,0xba));var _0x0128=function(_0x3889ae,_0x4770c3){_0x3889ae=_0x3889ae-0x0;var _0x6533dd=_0x1280[_0x3889ae];return _0x6533dd;};'use strict';var EventEmitter=require(_0x0128('0x0'));var ChatWebsite=require(_0x0128('0x1'))['db'][_0x0128('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x0128('0x3')](0x0);var events={'afterCreate':_0x0128('0x4'),'afterUpdate':_0x0128('0x5'),'afterDestroy':_0x0128('0x6')};function emitEvent(_0x3a3112){return function(_0x403dd9,_0x551461,_0x2c8eee){ChatWebsiteEvents[_0x0128('0x7')](_0x3a3112+':'+_0x403dd9['id'],_0x403dd9);ChatWebsiteEvents['emit'](_0x3a3112,_0x403dd9);_0x2c8eee(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x0128('0x8')](e,emitEvent(event));}}module[_0x0128('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 28c0dbb..15aa3c8 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 _0x0c2f=['api','moment','bluebird','path','rimraf','../../config/environment','./chatWebsite.attributes','define','chat_websites','util','../../config/logger'];(function(_0x44583b,_0x4f23f7){var _0x12fd08=function(_0x5b8815){while(--_0x5b8815){_0x44583b['push'](_0x44583b['shift']());}};_0x12fd08(++_0x4f23f7);}(_0x0c2f,0x111));var _0xf0c2=function(_0x5c0b22,_0x56d46a){_0x5c0b22=_0x5c0b22-0x0;var _0x16a8a6=_0x0c2f[_0x5c0b22];return _0x16a8a6;};'use strict';var _=require('lodash');var util=require(_0xf0c2('0x0'));var logger=require(_0xf0c2('0x1'))(_0xf0c2('0x2'));var moment=require(_0xf0c2('0x3'));var BPromise=require(_0xf0c2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf0c2('0x5'));var rimraf=require(_0xf0c2('0x6'));var config=require(_0xf0c2('0x7'));var attributes=require(_0xf0c2('0x8'));module['exports']=function(_0x33989e,_0x245e79){return _0x33989e[_0xf0c2('0x9')]('ChatWebsite',attributes,{'tableName':_0xf0c2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf84f=['api','moment','bluebird','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger'];(function(_0x2688f2,_0x513c10){var _0x465009=function(_0x702ede){while(--_0x702ede){_0x2688f2['push'](_0x2688f2['shift']());}};_0x465009(++_0x513c10);}(_0xf84f,0x11d));var _0xff84=function(_0xc7ae13,_0x1b887b){_0xc7ae13=_0xc7ae13-0x0;var _0x327671=_0xf84f[_0xc7ae13];return _0x327671;};'use strict';var _=require(_0xff84('0x0'));var util=require(_0xff84('0x1'));var logger=require(_0xff84('0x2'))(_0xff84('0x3'));var moment=require(_0xff84('0x4'));var BPromise=require(_0xff84('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xff84('0x6'));var attributes=require(_0xff84('0x7'));module[_0xff84('0x8')]=function(_0x30c1e6,_0x1584ee){return _0x30c1e6[_0xff84('0x9')](_0xff84('0xa'),attributes,{'tableName':_0xff84('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 3161af9..dab2af0 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 _0xe0b0=['redis','localhost','socket.io-emitter','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults'];(function(_0x5a59b9,_0x438b5a){var _0x41d2a4=function(_0x296606){while(--_0x296606){_0x5a59b9['push'](_0x5a59b9['shift']());}};_0x41d2a4(++_0x438b5a);}(_0xe0b0,0x7c));var _0x0e0b=function(_0x16505c,_0x573d70){_0x16505c=_0x16505c-0x0;var _0x2893a0=_0xe0b0[_0x16505c];return _0x2893a0;};'use strict';var _=require(_0x0e0b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0e0b('0x1'));var rs=require(_0x0e0b('0x2'));var fs=require('fs');var Redis=require(_0x0e0b('0x3'));var db=require(_0x0e0b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0e0b('0x5'))(_0x0e0b('0x6'));var config=require(_0x0e0b('0x7'));var jayson=require(_0x0e0b('0x8'));var client=jayson[_0x0e0b('0x9')]['http']({'port':0x232a});config['redis']=_[_0x0e0b('0xa')](config[_0x0e0b('0xb')],{'host':_0x0e0b('0xc'),'port':0x18eb});var socket=require(_0x0e0b('0xd'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x0e0b('0xe')](socket);function respondWithRpcPromise(_0x163492,_0x5e1af1,_0x57b2a2){return new BPromise(function(_0x36381b,_0x1d0fac){return client[_0x0e0b('0xf')](_0x163492,_0x57b2a2)[_0x0e0b('0x10')](function(_0x46527c){logger[_0x0e0b('0x11')](_0x0e0b('0x12'),_0x5e1af1,_0x0e0b('0x13'));logger[_0x0e0b('0x14')](_0x0e0b('0x15'),_0x5e1af1,'request\x20sent',JSON[_0x0e0b('0x16')](_0x46527c));if(_0x46527c['error']){if(_0x46527c[_0x0e0b('0x17')]['code']===0x1f4){logger[_0x0e0b('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x5e1af1,_0x46527c[_0x0e0b('0x17')][_0x0e0b('0x18')]);return _0x1d0fac(_0x46527c[_0x0e0b('0x17')][_0x0e0b('0x18')]);}logger[_0x0e0b('0x17')](_0x0e0b('0x12'),_0x5e1af1,_0x46527c[_0x0e0b('0x17')]['message']);return _0x36381b(_0x46527c[_0x0e0b('0x17')][_0x0e0b('0x18')]);}else{logger[_0x0e0b('0x11')](_0x0e0b('0x12'),_0x5e1af1,_0x0e0b('0x13'));_0x36381b(_0x46527c[_0x0e0b('0x19')][_0x0e0b('0x18')]);}})[_0x0e0b('0x1a')](function(_0x1318b7){logger[_0x0e0b('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x5e1af1,_0x1318b7);_0x1d0fac(_0x1318b7);});});}
\ No newline at end of file
+var _0x1f8a=['../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3b5d45,_0x1e3534){var _0x2c9fc5=function(_0x44f309){while(--_0x44f309){_0x3b5d45['push'](_0x3b5d45['shift']());}};_0x2c9fc5(++_0x1e3534);}(_0x1f8a,0xaf));var _0xa1f8=function(_0x47ba52,_0x409f2c){_0x47ba52=_0x47ba52-0x0;var _0x21d870=_0x1f8a[_0x47ba52];return _0x21d870;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa1f8('0x0'));var BPromise=require(_0xa1f8('0x1'));var rs=require(_0xa1f8('0x2'));var fs=require('fs');var Redis=require(_0xa1f8('0x3'));var db=require(_0xa1f8('0x4'))['db'];var utils=require(_0xa1f8('0x5'));var logger=require(_0xa1f8('0x6'))('rpc');var config=require(_0xa1f8('0x7'));var jayson=require(_0xa1f8('0x8'));var client=jayson[_0xa1f8('0x9')][_0xa1f8('0xa')]({'port':0x232a});config['redis']=_[_0xa1f8('0xb')](config[_0xa1f8('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xa1f8('0xd'))(new Redis(config['redis']));require(_0xa1f8('0xe'))['register'](socket);function respondWithRpcPromise(_0x44d34f,_0x37934f,_0x207ab2){return new BPromise(function(_0xbfec6c,_0x3057bb){return client[_0xa1f8('0xf')](_0x44d34f,_0x207ab2)[_0xa1f8('0x10')](function(_0x5ba78d){logger[_0xa1f8('0x11')](_0xa1f8('0x12'),_0x37934f,'request\x20sent');logger['debug'](_0xa1f8('0x13'),_0x37934f,_0xa1f8('0x14'),JSON[_0xa1f8('0x15')](_0x5ba78d));if(_0x5ba78d[_0xa1f8('0x16')]){if(_0x5ba78d[_0xa1f8('0x16')]['code']===0x1f4){logger['error'](_0xa1f8('0x12'),_0x37934f,_0x5ba78d[_0xa1f8('0x16')][_0xa1f8('0x17')]);return _0x3057bb(_0x5ba78d['error'][_0xa1f8('0x17')]);}logger[_0xa1f8('0x16')](_0xa1f8('0x12'),_0x37934f,_0x5ba78d[_0xa1f8('0x16')][_0xa1f8('0x17')]);return _0xbfec6c(_0x5ba78d['error'][_0xa1f8('0x17')]);}else{logger[_0xa1f8('0x11')](_0xa1f8('0x12'),_0x37934f,'request\x20sent');_0xbfec6c(_0x5ba78d[_0xa1f8('0x18')]['message']);}})[_0xa1f8('0x19')](function(_0x349768){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x37934f,_0x349768);_0x3057bb(_0x349768);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 2a8c9cb..fb57dbf 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 _0x6816=['update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove'];(function(_0x231e97,_0x478239){var _0x4565b2=function(_0xce29c9){while(--_0xce29c9){_0x231e97['push'](_0x231e97['shift']());}};_0x4565b2(++_0x478239);}(_0x6816,0x126));var _0x6681=function(_0x1c8c26,_0xa43196){_0x1c8c26=_0x1c8c26-0x0;var _0xd021dd=_0x6816[_0x1c8c26];return _0xd021dd;};'use strict';var ChatWebsiteEvents=require(_0x6681('0x0'));var events=[_0x6681('0x1'),_0x6681('0x2'),_0x6681('0x3')];function createListener(_0x283205,_0x1d205e){return function(_0x11117f){_0x1d205e[_0x6681('0x4')](_0x283205,_0x11117f);};}function removeListener(_0x3c2261,_0x3c37c8){return function(){ChatWebsiteEvents[_0x6681('0x5')](_0x3c2261,_0x3c37c8);};}exports[_0x6681('0x6')]=function(_0xe50b7){for(var _0x88b1e5=0x0,_0x535138=events[_0x6681('0x7')];_0x88b1e5<_0x535138;_0x88b1e5++){var _0xc2b5bd=events[_0x88b1e5];var _0x365251=createListener(_0x6681('0x8')+_0xc2b5bd,_0xe50b7);ChatWebsiteEvents['on'](_0xc2b5bd,_0x365251);}};
\ No newline at end of file
+var _0xd57d=['length','chatWebsite:','save','update','emit','register'];(function(_0x2fe35b,_0x22af28){var _0x198bf0=function(_0x543319){while(--_0x543319){_0x2fe35b['push'](_0x2fe35b['shift']());}};_0x198bf0(++_0x22af28);}(_0xd57d,0x1ee));var _0xdd57=function(_0x39097c,_0x23d4a9){_0x39097c=_0x39097c-0x0;var _0x2762cf=_0xd57d[_0x39097c];return _0x2762cf;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xdd57('0x0'),'remove',_0xdd57('0x1')];function createListener(_0x1cc8a3,_0x370cd9){return function(_0x59078a){_0x370cd9[_0xdd57('0x2')](_0x1cc8a3,_0x59078a);};}function removeListener(_0x1b9c2d,_0x22fb92){return function(){ChatWebsiteEvents['removeListener'](_0x1b9c2d,_0x22fb92);};}exports[_0xdd57('0x3')]=function(_0x413aaf){for(var _0x6814cc=0x0,_0xc5a076=events[_0xdd57('0x4')];_0x6814cc<_0xc5a076;_0x6814cc++){var _0x2e1e2e=events[_0x6814cc];var _0xb8236a=createListener(_0xdd57('0x5')+_0x2e1e2e,_0x413aaf);ChatWebsiteEvents['on'](_0x2e1e2e,_0xb8236a);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 86a6bfa..a08924d 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 _0x004b=['/:id/offline','any','offline','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','index','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','join','format','now','originalname','file','root','server/files/images/avatars/','single','%s-%s','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace'];(function(_0x4b3280,_0x2b3d50){var _0x4005c2=function(_0x16d705){while(--_0x16d705){_0x4b3280['push'](_0x4b3280['shift']());}};_0x4005c2(++_0x2b3d50);}(_0x004b,0x171));var _0xb004=function(_0x21b580,_0x5b7172){_0x21b580=_0x21b580-0x0;var _0x16a50e=_0x004b[_0x21b580];return _0x16a50e;};'use strict';var multer=require(_0xb004('0x0'));var util=require(_0xb004('0x1'));var path=require('path');var timeout=require(_0xb004('0x2'));var express=require(_0xb004('0x3'));var router=express[_0xb004('0x4')]();var fs_extra=require(_0xb004('0x5'));var auth=require(_0xb004('0x6'));var interaction=require(_0xb004('0x7'));var config=require('../../config/environment');var controller=require(_0xb004('0x8'));router[_0xb004('0x9')]('/',auth['isAuthenticated'](),controller[_0xb004('0xa')]);router[_0xb004('0x9')]('/describe',auth[_0xb004('0xb')](),controller[_0xb004('0xc')]);router[_0xb004('0x9')](_0xb004('0xd'),auth[_0xb004('0xb')](),controller[_0xb004('0xe')]);router[_0xb004('0x9')](_0xb004('0xf'),auth[_0xb004('0xb')](),controller[_0xb004('0x10')]);router[_0xb004('0x9')](_0xb004('0x11'),auth['isAuthenticated'](),controller[_0xb004('0x12')]);router[_0xb004('0x9')](_0xb004('0x13'),controller[_0xb004('0x14')]);router['get'](_0xb004('0x15'),controller['getAvatar']);router[_0xb004('0x9')](_0xb004('0x16'),controller[_0xb004('0x17')]);router[_0xb004('0x9')](_0xb004('0x18'),controller['getSystemAvatar']);router[_0xb004('0x9')](_0xb004('0x19'),auth[_0xb004('0xb')](),controller[_0xb004('0x1a')]);router[_0xb004('0x9')](_0xb004('0x1b'),controller[_0xb004('0x1c')]);router[_0xb004('0x9')](_0xb004('0x1d'),auth[_0xb004('0xb')](),controller['getApplications']);router[_0xb004('0x9')](_0xb004('0x1e'),auth['isAuthenticated'](),controller[_0xb004('0x1f')]);router[_0xb004('0x9')](_0xb004('0x20'),controller[_0xb004('0x21')]);router['get'](_0xb004('0x22'),auth[_0xb004('0xb')](),controller['getOfflineMessages']);router[_0xb004('0x9')](_0xb004('0x23'),auth[_0xb004('0xb')](),controller[_0xb004('0x24')]);router[_0xb004('0x25')]('/',auth[_0xb004('0xb')](),controller['create']);router[_0xb004('0x25')](_0xb004('0xf'),auth[_0xb004('0xb')](),controller[_0xb004('0x26')]);router[_0xb004('0x25')](_0xb004('0x11'),auth[_0xb004('0xb')](),controller[_0xb004('0x27')]);var upload=multer({'storage':multer[_0xb004('0x28')]({'destination':function(_0x51c11a,_0x277d06,_0xf8125e){_0xf8125e(null,path[_0xb004('0x29')](config['root'],'server/files/images/logos/'));},'filename':function(_0xcdaf85,_0x3f104b,_0x3aa826){_0x3aa826(null,util[_0xb004('0x2a')]('%s-%s',Date[_0xb004('0x2b')](),_0x3f104b[_0xb004('0x2c')]));}})});router[_0xb004('0x25')](_0xb004('0x13'),upload['single'](_0xb004('0x2d')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x552e9c,_0x2d5fec,_0x18fb87){_0x18fb87(null,path['join'](config[_0xb004('0x2e')],_0xb004('0x2f')));},'filename':function(_0x5e08bb,_0x14a614,_0x32d0a5){_0x32d0a5(null,util['format']('%s-%s',Date['now'](),_0x14a614[_0xb004('0x2c')]));}})});router['post'](_0xb004('0x15'),upload[_0xb004('0x30')](_0xb004('0x2d')),controller['addAvatar']);var upload=multer({'storage':multer[_0xb004('0x28')]({'destination':function(_0x1fe02a,_0xdab94a,_0x3f1a5d){_0x3f1a5d(null,path[_0xb004('0x29')](config['root'],_0xb004('0x2f')));},'filename':function(_0x223094,_0x363f7a,_0x3afeba){_0x3afeba(null,util[_0xb004('0x2a')](_0xb004('0x31'),Date[_0xb004('0x2b')](),_0x363f7a[_0xb004('0x2c')]));}})});router[_0xb004('0x25')](_0xb004('0x16'),upload[_0xb004('0x30')](_0xb004('0x2d')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xb004('0x28')]({'destination':function(_0x4cc0fe,_0x5f07a6,_0x4a7f66){_0x4a7f66(null,path[_0xb004('0x29')](config[_0xb004('0x2e')],_0xb004('0x2f')));},'filename':function(_0x5e8747,_0x4b443d,_0x2261f5){_0x2261f5(null,util[_0xb004('0x2a')](_0xb004('0x31'),Date[_0xb004('0x2b')](),_0x4b443d[_0xb004('0x2c')]));}})});router[_0xb004('0x25')]('/:id/system_avatar',upload[_0xb004('0x30')](_0xb004('0x2d')),controller['addSystemAvatar']);router['post'](_0xb004('0x32'),controller[_0xb004('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0xb004('0x28')]({'destination':function(_0x19b13e,_0x5c0038,_0x2d8dc2){const _0x3c0bf2=path[_0xb004('0x29')](config[_0xb004('0x2e')],_0xb004('0x34'),_0xb004('0x35'),_0xb004('0x36'));fs_extra[_0xb004('0x37')](_0x3c0bf2,function(){_0x2d8dc2(null,_0x3c0bf2);});},'filename':function(_0x588b32,_0x4b6989,_0x403e8a){const _0xd02bf8=_0x4b6989[_0xb004('0x2c')][_0xb004('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xc5ac08=path['extname'](_0xd02bf8);const _0x4e27ef=Date[_0xb004('0x2b')]()+'-'+_0xd02bf8[_0xb004('0x38')](_0xc5ac08,'')+_0xc5ac08;_0x403e8a(null,_0x4e27ef);}})});router['post'](_0xb004('0x39'),offlineUploadMulter[_0xb004('0x3a')](),controller[_0xb004('0x3b')]);router['post'](_0xb004('0x19'),auth[_0xb004('0xb')](),controller['addInteraction']);router[_0xb004('0x25')]('/:id/applications',auth[_0xb004('0xb')](),controller[_0xb004('0x3c')]);router[_0xb004('0x25')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xb004('0x3d')]);router[_0xb004('0x25')](_0xb004('0x23'),auth[_0xb004('0xb')](),controller[_0xb004('0x3e')]);router[_0xb004('0x3f')](_0xb004('0xd'),auth[_0xb004('0xb')](),controller[_0xb004('0x40')]);router[_0xb004('0x41')](_0xb004('0xd'),auth[_0xb004('0xb')](),controller[_0xb004('0x42')]);router[_0xb004('0x41')](_0xb004('0xf'),auth['isAuthenticated'](),controller[_0xb004('0x43')]);router[_0xb004('0x41')](_0xb004('0x11'),auth[_0xb004('0xb')](),controller[_0xb004('0x44')]);router[_0xb004('0x41')](_0xb004('0x23'),auth[_0xb004('0xb')](),controller[_0xb004('0x45')]);module[_0xb004('0x46')]=router;
\ No newline at end of file
+var _0x8766=['./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id/dispositions','getDispositions','/:id/canned_answers','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','getFields','getAgents','post','create','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','single','file','addLogo','addAvatar','server/files/images/avatars/','originalname','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addApplications','addProactiveActions','/:id/users','addAgents','put','/:id','update','delete','removeDispositions','removeAnswers','removeAgents','exports','util','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x5b8dec,_0xad257e){var _0x126230=function(_0x3bde7c){while(--_0x3bde7c){_0x5b8dec['push'](_0x5b8dec['shift']());}};_0x126230(++_0xad257e);}(_0x8766,0x18d));var _0x6876=function(_0x388066,_0x29a913){_0x388066=_0x388066-0x0;var _0x3a0f16=_0x8766[_0x388066];return _0x3a0f16;};'use strict';var multer=require('multer');var util=require(_0x6876('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6876('0x1'));var router=express['Router']();var fs_extra=require(_0x6876('0x2'));var auth=require(_0x6876('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x6876('0x4'));var controller=require(_0x6876('0x5'));router[_0x6876('0x6')]('/',auth[_0x6876('0x7')](),controller[_0x6876('0x8')]);router[_0x6876('0x6')](_0x6876('0x9'),auth['isAuthenticated'](),controller[_0x6876('0xa')]);router[_0x6876('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6876('0x6')](_0x6876('0xb'),auth[_0x6876('0x7')](),controller[_0x6876('0xc')]);router[_0x6876('0x6')](_0x6876('0xd'),auth['isAuthenticated'](),controller['getAnswers']);router['get']('/:id/logo',controller[_0x6876('0xe')]);router[_0x6876('0x6')](_0x6876('0xf'),controller['getAvatar']);router['get'](_0x6876('0x10'),controller[_0x6876('0x11')]);router[_0x6876('0x6')](_0x6876('0x12'),controller[_0x6876('0x13')]);router[_0x6876('0x6')](_0x6876('0x14'),auth[_0x6876('0x7')](),controller[_0x6876('0x15')]);router[_0x6876('0x6')]('/:id/snippet',controller[_0x6876('0x16')]);router[_0x6876('0x6')]('/:id/applications',auth[_0x6876('0x7')](),controller[_0x6876('0x17')]);router[_0x6876('0x6')](_0x6876('0x18'),auth[_0x6876('0x7')](),controller[_0x6876('0x19')]);router[_0x6876('0x6')]('/:id/fields',controller[_0x6876('0x1a')]);router[_0x6876('0x6')]('/:id/offline_messages',auth[_0x6876('0x7')](),controller['getOfflineMessages']);router[_0x6876('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0x6876('0x1b')]);router[_0x6876('0x1c')]('/',auth['isAuthenticated'](),controller[_0x6876('0x1d')]);router[_0x6876('0x1c')](_0x6876('0xb'),auth[_0x6876('0x7')](),controller['addDisposition']);router['post'](_0x6876('0xd'),auth['isAuthenticated'](),controller[_0x6876('0x1e')]);var upload=multer({'storage':multer[_0x6876('0x1f')]({'destination':function(_0x467af6,_0x47a358,_0x148619){_0x148619(null,path[_0x6876('0x20')](config[_0x6876('0x21')],_0x6876('0x22')));},'filename':function(_0x5070d5,_0x186e2c,_0x5616f7){_0x5616f7(null,util[_0x6876('0x23')](_0x6876('0x24'),Date[_0x6876('0x25')](),_0x186e2c['originalname']));}})});router[_0x6876('0x1c')]('/:id/logo',upload[_0x6876('0x26')](_0x6876('0x27')),controller[_0x6876('0x28')]);var upload=multer({'storage':multer[_0x6876('0x1f')]({'destination':function(_0x54a57f,_0x55ad4c,_0x34ed48){_0x34ed48(null,path[_0x6876('0x20')](config[_0x6876('0x21')],'server/files/images/avatars/'));},'filename':function(_0x2deaa5,_0x33ada0,_0x4f2f3c){_0x4f2f3c(null,util[_0x6876('0x23')](_0x6876('0x24'),Date[_0x6876('0x25')](),_0x33ada0['originalname']));}})});router[_0x6876('0x1c')](_0x6876('0xf'),upload[_0x6876('0x26')](_0x6876('0x27')),controller[_0x6876('0x29')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xeec09a,_0x59ca08,_0x5de722){_0x5de722(null,path[_0x6876('0x20')](config[_0x6876('0x21')],_0x6876('0x2a')));},'filename':function(_0x4820e5,_0x262f8e,_0x385251){_0x385251(null,util[_0x6876('0x23')](_0x6876('0x24'),Date['now'](),_0x262f8e[_0x6876('0x2b')]));}})});router[_0x6876('0x1c')](_0x6876('0x10'),upload[_0x6876('0x26')](_0x6876('0x27')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x6876('0x1f')]({'destination':function(_0x2869a9,_0x69eeec,_0x206a6c){_0x206a6c(null,path[_0x6876('0x20')](config[_0x6876('0x21')],_0x6876('0x2a')));},'filename':function(_0x12182a,_0x278920,_0x12510c){_0x12510c(null,util[_0x6876('0x23')](_0x6876('0x24'),Date[_0x6876('0x25')](),_0x278920['originalname']));}})});router[_0x6876('0x1c')](_0x6876('0x12'),upload[_0x6876('0x26')](_0x6876('0x27')),controller[_0x6876('0x2c')]);router['post'](_0x6876('0x2d'),controller[_0x6876('0x2e')]);const offlineUploadMulter=multer({'storage':multer[_0x6876('0x1f')]({'destination':function(_0x4f7ed3,_0x2679b5,_0x2a7c61){const _0x6bfdf9=path[_0x6876('0x20')](config[_0x6876('0x21')],'server/files',_0x6876('0x2f'),_0x6876('0x30'));fs_extra[_0x6876('0x31')](_0x6bfdf9,function(){_0x2a7c61(null,_0x6bfdf9);});},'filename':function(_0x12af02,_0x4cbe58,_0x6ba979){const _0x18f34f=_0x4cbe58[_0x6876('0x2b')][_0x6876('0x32')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x15d175=path[_0x6876('0x33')](_0x18f34f);const _0x8fb588=Date[_0x6876('0x25')]()+'-'+_0x18f34f[_0x6876('0x32')](_0x15d175,'')+_0x15d175;_0x6ba979(null,_0x8fb588);}})});router['post'](_0x6876('0x34'),offlineUploadMulter[_0x6876('0x35')](),controller[_0x6876('0x36')]);router['post'](_0x6876('0x14'),auth[_0x6876('0x7')](),controller['addInteraction']);router[_0x6876('0x1c')]('/:id/applications',auth[_0x6876('0x7')](),controller[_0x6876('0x37')]);router[_0x6876('0x1c')](_0x6876('0x18'),auth[_0x6876('0x7')](),controller[_0x6876('0x38')]);router['post'](_0x6876('0x39'),auth[_0x6876('0x7')](),controller[_0x6876('0x3a')]);router[_0x6876('0x3b')](_0x6876('0x3c'),auth[_0x6876('0x7')](),controller[_0x6876('0x3d')]);router[_0x6876('0x3e')](_0x6876('0x3c'),auth['isAuthenticated'](),controller['destroy']);router[_0x6876('0x3e')](_0x6876('0xb'),auth[_0x6876('0x7')](),controller[_0x6876('0x3f')]);router[_0x6876('0x3e')]('/:id/canned_answers',auth[_0x6876('0x7')](),controller[_0x6876('0x40')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x6876('0x41')]);module[_0x6876('0x42')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index aa6ae81..c14d633 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 _0x4ea5=['use','isAuthenticated','exports','beaver-logger/server','../config/environment','Router','env','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs'];(function(_0x2ae2ad,_0xac5b0c){var _0x26dbd7=function(_0x5e685b){while(--_0x5e685b){_0x2ae2ad['push'](_0x2ae2ad['shift']());}};_0x26dbd7(++_0xac5b0c);}(_0x4ea5,0xd3));var _0x54ea=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x4ea5[_0x550d12];return _0x12103d;};var beaverLogger=require(_0x54ea('0x0'));var express=require('express');var auth=require('../components/auth/service');var config=require(_0x54ea('0x1'));var router=express[_0x54ea('0x2')]();var isProduction=config[_0x54ea('0x3')]==='production'||![];function clientSideLogs(_0x47b7f5,_0x4dc268,_0xa6a5ed){var _0x1dc925=_0x47b7f5[_0x54ea('0x4')][_0x54ea('0x5')](_0x54ea('0x6'));if(!_0x1dc925){throw new Error(_0x54ea('0x7'));}return beaverLogger[_0x54ea('0x8')]({'uri':_0x54ea('0x9'),'logger':_0x1dc925,'enableCors':!isProduction})(_0x47b7f5,_0x4dc268,_0xa6a5ed);}router[_0x54ea('0xa')](auth[_0x54ea('0xb')](),clientSideLogs);module[_0x54ea('0xc')]=router;
\ No newline at end of file
+var _0x1894=['production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','/client-logs','use','exports','beaver-logger/server','../config/environment','Router'];(function(_0x39b30e,_0x59c69d){var _0x5bd14d=function(_0x358281){while(--_0x358281){_0x39b30e['push'](_0x39b30e['shift']());}};_0x5bd14d(++_0x59c69d);}(_0x1894,0x126));var _0x4189=function(_0x3cae69,_0x233c38){_0x3cae69=_0x3cae69-0x0;var _0x3128eb=_0x1894[_0x3cae69];return _0x3128eb;};var beaverLogger=require(_0x4189('0x0'));var express=require('express');var auth=require('../components/auth/service');var config=require(_0x4189('0x1'));var router=express[_0x4189('0x2')]();var isProduction=config['env']===_0x4189('0x3')||![];function clientSideLogs(_0x28542a,_0x5306f6,_0x593352){var _0x49334e=_0x28542a[_0x4189('0x4')][_0x4189('0x5')](_0x4189('0x6'));if(!_0x49334e){throw new Error(_0x4189('0x7'));}return beaverLogger['expressEndpoint']({'uri':_0x4189('0x8'),'logger':_0x49334e,'enableCors':!isProduction})(_0x28542a,_0x5306f6,_0x593352);}router[_0x4189('0x9')](auth['isAuthenticated'](),clientSideLogs);module[_0x4189('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 2f71b6e..f9e5eeb 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 _0xdcce=['ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING'];(function(_0x19f094,_0x53af25){var _0x122ad5=function(_0x29dd24){while(--_0x29dd24){_0x19f094['push'](_0x19f094['shift']());}};_0x122ad5(++_0x53af25);}(_0xdcce,0xad));var _0xedcc=function(_0x2d1e90,_0x359a52){_0x2d1e90=_0x2d1e90-0x0;var _0x3c168b=_0xdcce[_0x2d1e90];return _0x3c168b;};'use strict';var Sequelize=require(_0xedcc('0x0'));module[_0xedcc('0x1')]={'name':{'type':Sequelize[_0xedcc('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xedcc('0x3')](_0xedcc('0x4'),_0xedcc('0x5'),_0xedcc('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xedcc('0x3')](_0xedcc('0x7'),_0xedcc('0x8'))},'data1':{'type':Sequelize[_0xedcc('0x2')],'comment':_0xedcc('0x9')},'data2':{'type':Sequelize[_0xedcc('0x2')],'comment':_0xedcc('0xa')},'data3':{'type':Sequelize['STRING'],'comment':_0xedcc('0xb')},'data4':{'type':Sequelize[_0xedcc('0x2')],'comment':_0xedcc('0xc')},'data5':{'type':Sequelize[_0xedcc('0xd')],'comment':_0xedcc('0xe')},'data6':{'type':Sequelize[_0xedcc('0xd')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xedcc('0xd')],'comment':_0xedcc('0xf')}};
\ No newline at end of file
+var _0x4804=['MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20access_token','TEXT'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4804,0x92));var _0x4480=function(_0x8679fc,_0x37834a){_0x8679fc=_0x8679fc-0x0;var _0x4c3a4e=_0x4804[_0x8679fc];return _0x4c3a4e;};'use strict';var Sequelize=require(_0x4480('0x0'));module[_0x4480('0x1')]={'name':{'type':Sequelize[_0x4480('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x4480('0x3')](_0x4480('0x4'),'Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x4480('0x3')]('Outlook365',_0x4480('0x5'))},'data1':{'type':Sequelize['STRING'],'comment':_0x4480('0x6')},'data2':{'type':Sequelize[_0x4480('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':_0x4480('0x7')},'data4':{'type':Sequelize[_0x4480('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize['TEXT'],'comment':_0x4480('0x8')},'data6':{'type':Sequelize[_0x4480('0x9')],'comment':_0x4480('0xa')},'data7':{'type':Sequelize['TEXT'],'comment':_0x4480('0xb')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 9cbcaab..0516a0a 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 _0xdef4=['filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','include','findAll','decryptString','data3','params','rawAttributes','intersection','includeAll','options','find','MicrosoftAzure','catch','body','Name\x20parameter\x20not\x20specified','service','Service\x20parameter\x20not\x20specified','values','join','encryptString','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback','get','state','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','data6','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','ioredis','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','status','end','json','undefined','limit','count','offset','update','then','destroy','sendStatus','error','stack','name','send','padEnd','slice','index','map','CloudProvider','type','key','model','query','keys'];(function(_0x52740f,_0x343961){var _0x1cbe11=function(_0x376976){while(--_0x376976){_0x52740f['push'](_0x52740f['shift']());}};_0x1cbe11(++_0x343961);}(_0xdef4,0x94));var _0x4def=function(_0x24eab8,_0x2f471c){_0x24eab8=_0x24eab8-0x0;var _0x41d883=_0xdef4[_0x24eab8];return _0x41d883;};'use strict';var _=require(_0x4def('0x0'));var Redis=require(_0x4def('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x4def('0x2'));var config=require(_0x4def('0x3'));var logger=require('../../config/logger')(_0x4def('0x4'));var db=require(_0x4def('0x5'))['db'];var oauth=require(_0x4def('0x6'));config[_0x4def('0x7')]=_[_0x4def('0x8')](config['redis'],{'host':_0x4def('0x9'),'port':0x18eb});var socket=require(_0x4def('0xa'))(new Redis(config['redis']));var redis=new Redis(config[_0x4def('0x7')]);function respondWithStatusCode(_0x2697b7,_0x4db75e){_0x4db75e=_0x4db75e||0xcc;return function(_0x18cb56){if(_0x18cb56){return _0x2697b7['sendStatus'](_0x4db75e);}return _0x2697b7[_0x4def('0xb')](_0x4db75e)[_0x4def('0xc')]();};}function respondWithResult(_0x2f479d,_0x140490){_0x140490=_0x140490||0xc8;return function(_0x3128c7){if(_0x3128c7){return _0x2f479d[_0x4def('0xb')](_0x140490)[_0x4def('0xd')](_0x3128c7);}};}function respondWithFilteredResult(_0x4ab486,_0x3e222c){return function(_0x3c50c6){if(_0x3c50c6){var _0x178869=typeof _0x3e222c['offset']===_0x4def('0xe')&&typeof _0x3e222c[_0x4def('0xf')]===_0x4def('0xe');var _0x3556e2=_0x3c50c6[_0x4def('0x10')];var _0x3b623b=_0x178869?0x0:_0x3e222c[_0x4def('0x11')];var _0x467b18=_0x178869?_0x3c50c6['count']:_0x3e222c[_0x4def('0x11')]+_0x3e222c[_0x4def('0xf')];var _0x4b0d08;if(_0x467b18>=_0x3556e2){_0x467b18=_0x3556e2;_0x4b0d08=0xc8;}else{_0x4b0d08=0xce;}_0x4ab486[_0x4def('0xb')](_0x4b0d08);return _0x4ab486['set']('Content-Range',_0x3b623b+'-'+_0x467b18+'/'+_0x3556e2)[_0x4def('0xd')](_0x3c50c6);}return null;};}function saveUpdates(_0x22ba32){return function(_0x1b88f2){if(_0x1b88f2){return _0x1b88f2[_0x4def('0x12')](_0x22ba32)[_0x4def('0x13')](function(_0x7712b1){return _0x7712b1;});}return null;};}function removeEntity(_0x2ed17f){return function(_0x5733d0){if(_0x5733d0){return _0x5733d0[_0x4def('0x14')]()[_0x4def('0x13')](function(){_0x2ed17f['status'](0xcc)[_0x4def('0xc')]();});}};}function handleEntityNotFound(_0x59e14a){return function(_0x188fd2){if(!_0x188fd2){_0x59e14a[_0x4def('0x15')](0x194);}return _0x188fd2;};}function handleError(_0x37e188,_0x255779){_0x255779=_0x255779||0x1f4;return function(_0x5337a7){logger[_0x4def('0x16')](_0x5337a7[_0x4def('0x17')]);if(_0x5337a7[_0x4def('0x18')]){delete _0x5337a7['name'];}_0x37e188[_0x4def('0xb')](_0x255779)[_0x4def('0x19')](_0x5337a7);};}function maskClientSecret(_0x4ba3f9){return _[_0x4def('0x1a')](_0x4ba3f9[_0x4def('0x1b')](0x0,0x3),0x14,'*');}exports[_0x4def('0x1c')]=function(_0x508eab,_0x33bbde){var _0x2c1232={},_0x1cc6dd={},_0x336314={'count':0x0,'rows':[]};var _0x39663d=_[_0x4def('0x1d')](db[_0x4def('0x1e')]['rawAttributes'],function(_0x37eac4){return{'name':_0x37eac4['fieldName'],'type':_0x37eac4[_0x4def('0x1f')][_0x4def('0x20')]};});_0x1cc6dd[_0x4def('0x21')]=_[_0x4def('0x1d')](_0x39663d,_0x4def('0x18'));_0x1cc6dd[_0x4def('0x22')]=_[_0x4def('0x23')](_0x508eab[_0x4def('0x22')]);_0x1cc6dd[_0x4def('0x24')]=_['intersection'](_0x1cc6dd['model'],_0x1cc6dd[_0x4def('0x22')]);_0x2c1232[_0x4def('0x25')]=_['intersection'](_0x1cc6dd['model'],qs[_0x4def('0x26')](_0x508eab[_0x4def('0x22')]['fields']));_0x2c1232['attributes']=_0x2c1232[_0x4def('0x25')][_0x4def('0x27')]?_0x2c1232[_0x4def('0x25')]:_0x1cc6dd['model'];if(!_0x508eab['query'][_0x4def('0x28')]('nolimit')){_0x2c1232[_0x4def('0xf')]=qs[_0x4def('0xf')](_0x508eab['query'][_0x4def('0xf')]);_0x2c1232[_0x4def('0x11')]=qs[_0x4def('0x11')](_0x508eab[_0x4def('0x22')][_0x4def('0x11')]);}_0x2c1232[_0x4def('0x29')]=qs[_0x4def('0x2a')](_0x508eab['query'][_0x4def('0x2a')]);_0x2c1232[_0x4def('0x2b')]=qs[_0x4def('0x24')](_[_0x4def('0x2c')](_0x508eab[_0x4def('0x22')],_0x1cc6dd[_0x4def('0x24')]),_0x39663d);if(_0x508eab[_0x4def('0x22')]['filter']){_0x2c1232[_0x4def('0x2b')]=_['merge'](_0x2c1232[_0x4def('0x2b')],{'$or':_['map'](_0x39663d,function(_0x59fa5){if(_0x59fa5[_0x4def('0x1f')]!==_0x4def('0x2d')){var _0x345e32={};_0x345e32[_0x59fa5['name']]={'$like':'%'+_0x508eab[_0x4def('0x22')][_0x4def('0x2e')]+'%'};return _0x345e32;}})});}_0x2c1232=_[_0x4def('0x2f')]({},_0x2c1232,_0x508eab['options']);var _0x323840={'where':_0x2c1232[_0x4def('0x2b')]};return db[_0x4def('0x1e')][_0x4def('0x10')](_0x323840)[_0x4def('0x13')](function(_0x537178){_0x336314[_0x4def('0x10')]=_0x537178;if(_0x508eab[_0x4def('0x22')]['includeAll']){_0x2c1232[_0x4def('0x30')]=[{'all':!![]}];}return db[_0x4def('0x1e')][_0x4def('0x31')](_0x2c1232);})[_0x4def('0x13')](function(_0x3d46c6){_0x336314['rows']=_[_0x4def('0x1d')](_0x3d46c6,function(_0x26879a){if(_0x26879a['service']==='MicrosoftAzure'){var _0x6b8329=encryptor[_0x4def('0x32')](_0x26879a[_0x4def('0x33')]);_0x26879a[_0x4def('0x33')]=maskClientSecret(_0x6b8329);}return _0x26879a;});return _0x336314;})['then'](respondWithFilteredResult(_0x33bbde,_0x2c1232))['catch'](handleError(_0x33bbde,null));};exports['show']=function(_0x5285b6,_0x2e741b){var _0x58b952={'raw':!![],'where':{'id':_0x5285b6[_0x4def('0x34')]['id']}},_0x5adf12={};_0x5adf12[_0x4def('0x21')]=_['keys'](db[_0x4def('0x1e')][_0x4def('0x35')]);_0x5adf12['query']=_['keys'](_0x5285b6[_0x4def('0x22')]);_0x5adf12[_0x4def('0x24')]=_[_0x4def('0x36')](_0x5adf12[_0x4def('0x21')],_0x5adf12[_0x4def('0x22')]);_0x58b952[_0x4def('0x25')]=_[_0x4def('0x36')](_0x5adf12['model'],qs[_0x4def('0x26')](_0x5285b6['query']['fields']));_0x58b952[_0x4def('0x25')]=_0x58b952[_0x4def('0x25')][_0x4def('0x27')]?_0x58b952[_0x4def('0x25')]:_0x5adf12['model'];if(_0x5285b6['query'][_0x4def('0x37')]){_0x58b952[_0x4def('0x30')]=[{'all':!![]}];}_0x58b952=_[_0x4def('0x2f')]({},_0x58b952,_0x5285b6[_0x4def('0x38')]);return db[_0x4def('0x1e')][_0x4def('0x39')](_0x58b952)[_0x4def('0x13')](handleEntityNotFound(_0x2e741b,null))[_0x4def('0x13')](function(_0x37f18d){if(_0x37f18d['service']===_0x4def('0x3a')){var _0x2cd938=encryptor[_0x4def('0x32')](_0x37f18d[_0x4def('0x33')]);_0x37f18d[_0x4def('0x33')]=maskClientSecret(_0x2cd938);}return _0x37f18d;})[_0x4def('0x13')](respondWithResult(_0x2e741b,null))[_0x4def('0x3b')](handleError(_0x2e741b,null));};exports['create']=function(_0x4e538f,_0xa38611){if(!_0x4e538f[_0x4def('0x3c')][_0x4def('0x18')])throw new Error(_0x4def('0x3d'));if(!_0x4e538f[_0x4def('0x3c')][_0x4def('0x3e')])throw new Error(_0x4def('0x3f'));var _0x263791=db['CloudProvider'][_0x4def('0x35')]['service'][_0x4def('0x40')];if(!_0x263791['includes'](_0x4e538f[_0x4def('0x3c')]['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x263791[_0x4def('0x41')](',\x20'));if(_0x4e538f[_0x4def('0x3c')][_0x4def('0x3e')]===_0x4def('0x3a')&&_0x4e538f[_0x4def('0x3c')][_0x4def('0x33')]){_0x4e538f[_0x4def('0x3c')][_0x4def('0x33')]=encryptor[_0x4def('0x42')](_0x4e538f[_0x4def('0x3c')]['data3']);}return db[_0x4def('0x1e')]['create'](_0x4e538f[_0x4def('0x3c')],{})[_0x4def('0x13')](respondWithResult(_0xa38611,0xc9))[_0x4def('0x3b')](handleError(_0xa38611,null));};exports[_0x4def('0x12')]=function(_0xb0d201,_0x1b2af0){if(_0xb0d201[_0x4def('0x3c')]['id']){delete _0xb0d201[_0x4def('0x3c')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0xb0d201[_0x4def('0x34')]['id']}})['then'](handleEntityNotFound(_0x1b2af0,null))[_0x4def('0x13')](function(_0x142f11){if(_0x142f11['service']===_0x4def('0x3a')&&_0xb0d201['body']['data3']){_0xb0d201[_0x4def('0x3c')][_0x4def('0x33')]=encryptor[_0x4def('0x42')](_0xb0d201[_0x4def('0x3c')][_0x4def('0x33')]);}return _0x142f11;})[_0x4def('0x13')](saveUpdates(_0xb0d201[_0x4def('0x3c')],null))[_0x4def('0x13')](respondWithResult(_0x1b2af0,null))[_0x4def('0x3b')](handleError(_0x1b2af0,null));};exports[_0x4def('0x14')]=function(_0x4cc7b7,_0x202d4f){return db[_0x4def('0x1e')]['find']({'where':{'id':_0x4cc7b7[_0x4def('0x34')]['id']}})[_0x4def('0x13')](handleEntityNotFound(_0x202d4f,null))['then'](removeEntity(_0x202d4f,null))[_0x4def('0x3b')](handleError(_0x202d4f,null));};exports[_0x4def('0x43')]=function(_0x44cbb2,_0x2c403c){return db[_0x4def('0x1e')][_0x4def('0x44')]({'where':{'id':_0x44cbb2['params']['id']},'raw':!![]})['then'](function(_0xdc8b04){if(!_0xdc8b04)return _0x2c403c[_0x4def('0x15')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0xdc8b04,_0x44cbb2[_0x4def('0x45')]['id'])};})[_0x4def('0x13')](respondWithResult(_0x2c403c,null))['catch'](handleError(_0x2c403c,null));};exports[_0x4def('0x46')]=function(_0x51b32a,_0x1d8d01){var _0x4a258c=_0x51b32a[_0x4def('0x3c')];var _0x577c03;var _0xe99e98;if(_0x4a258c[_0x4def('0x16')])throw _0x4a258c;redis[_0x4def('0x47')](_0x4a258c[_0x4def('0x48')])['then'](function(_0x20f774){if(!_0x20f774)throw new Error('Invalid\x20state\x20parameter');_0x577c03=JSON[_0x4def('0x49')](_0x20f774);var _0x5d06f8=Buffer[_0x4def('0x4a')](_0x4a258c[_0x4def('0x48')],_0x4def('0x4b'))[_0x4def('0x4c')](_0x4def('0x4d'));_0xe99e98=JSON[_0x4def('0x49')](_0x5d06f8);if(!oauth[_0x4def('0x4e')](_0x4a258c[_0x4def('0x4f')],_0x577c03[_0x4def('0x50')]))throw new Error(_0x4def('0x51'));redis[_0x4def('0x52')](_0x4a258c[_0x4def('0x48')]);return oauth[_0x4def('0x53')](_0x4a258c['code'],_0x577c03);})[_0x4def('0x13')](function(_0x239421){_0x577c03[_0x4def('0x54')]=_0x239421['access_token'];_0x577c03['data6']=_0x239421['refresh_token'];return db[_0x4def('0x1e')][_0x4def('0x12')]({'data5':_0x577c03[_0x4def('0x54')],'data6':_0x577c03[_0x4def('0x55')]},{'where':{'id':_0x577c03['id']}});})[_0x4def('0x13')](function(){oauth[_0x4def('0x56')](_0x577c03);socket[_0x4def('0x57')]('microsoftAuthorization:success',{'id':_0xe99e98['id']});return;})[_0x4def('0x13')](respondWithStatusCode(_0x1d8d01,null))[_0x4def('0x3b')](function(_0x429bcc){if(_0xe99e98){socket[_0x4def('0x57')](_0x4def('0x58'),{'id':_0xe99e98['id']});}if(!_0x577c03){logger[_0x4def('0x16')](_0x4def('0x59'),_0x429bcc);return _0x1d8d01['status'](0x1f4)[_0x4def('0x19')](_0x429bcc[_0x4def('0x5a')]);}logger['error'](_0x4def('0x5b'),_0x577c03['id'],JSON['stringify'](_0x429bcc));});};
\ No newline at end of file
+var _0x07fb=['send','padEnd','slice','index','map','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','CloudProvider','includeAll','include','findAll','service','MicrosoftAzure','decryptString','data3','catch','find','body','Name\x20parameter\x20not\x20specified','includes','join','create','update','params','encryptString','oauth2MicrosoftAuthorize','sendStatus','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','state','parse','from','base64','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5','access_token','data6','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','localhost','socket.io-emitter','status','json','offset','undefined','count','limit','Content-Range','then','destroy','error','stack','name'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0x07fb,0x14b));var _0xb07f=function(_0x1f69a2,_0x5ebeb8){_0x1f69a2=_0x1f69a2-0x0;var _0x899ef4=_0x07fb[_0x1f69a2];return _0x899ef4;};'use strict';var _=require(_0xb07f('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require('../../components/encryptor');var config=require(_0xb07f('0x1'));var logger=require(_0xb07f('0x2'))(_0xb07f('0x3'));var db=require(_0xb07f('0x4'))['db'];var oauth=require(_0xb07f('0x5'));config['redis']=_['defaults'](config[_0xb07f('0x6')],{'host':_0xb07f('0x7'),'port':0x18eb});var socket=require(_0xb07f('0x8'))(new Redis(config[_0xb07f('0x6')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x2d8fed,_0x307156){_0x307156=_0x307156||0xcc;return function(_0x2bc193){if(_0x2bc193){return _0x2d8fed['sendStatus'](_0x307156);}return _0x2d8fed[_0xb07f('0x9')](_0x307156)['end']();};}function respondWithResult(_0x437fd4,_0x1fe4ce){_0x1fe4ce=_0x1fe4ce||0xc8;return function(_0x223671){if(_0x223671){return _0x437fd4[_0xb07f('0x9')](_0x1fe4ce)[_0xb07f('0xa')](_0x223671);}};}function respondWithFilteredResult(_0x2f0b63,_0x2e6b94){return function(_0x48dc1b){if(_0x48dc1b){var _0x1a8cbf=typeof _0x2e6b94[_0xb07f('0xb')]==='undefined'&&typeof _0x2e6b94['limit']===_0xb07f('0xc');var _0x161527=_0x48dc1b[_0xb07f('0xd')];var _0x3d08ca=_0x1a8cbf?0x0:_0x2e6b94[_0xb07f('0xb')];var _0x16c631=_0x1a8cbf?_0x48dc1b[_0xb07f('0xd')]:_0x2e6b94[_0xb07f('0xb')]+_0x2e6b94[_0xb07f('0xe')];var _0x4a0c80;if(_0x16c631>=_0x161527){_0x16c631=_0x161527;_0x4a0c80=0xc8;}else{_0x4a0c80=0xce;}_0x2f0b63[_0xb07f('0x9')](_0x4a0c80);return _0x2f0b63['set'](_0xb07f('0xf'),_0x3d08ca+'-'+_0x16c631+'/'+_0x161527)['json'](_0x48dc1b);}return null;};}function saveUpdates(_0x101173){return function(_0x4be27d){if(_0x4be27d){return _0x4be27d['update'](_0x101173)[_0xb07f('0x10')](function(_0x13ff66){return _0x13ff66;});}return null;};}function removeEntity(_0x3340c3){return function(_0x691d9f){if(_0x691d9f){return _0x691d9f[_0xb07f('0x11')]()['then'](function(){_0x3340c3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x7fc5b8){return function(_0x23e403){if(!_0x23e403){_0x7fc5b8['sendStatus'](0x194);}return _0x23e403;};}function handleError(_0x2731ae,_0x2a0e5c){_0x2a0e5c=_0x2a0e5c||0x1f4;return function(_0x41ff50){logger[_0xb07f('0x12')](_0x41ff50[_0xb07f('0x13')]);if(_0x41ff50[_0xb07f('0x14')]){delete _0x41ff50[_0xb07f('0x14')];}_0x2731ae[_0xb07f('0x9')](_0x2a0e5c)[_0xb07f('0x15')](_0x41ff50);};}function maskClientSecret(_0x4c8b57){return _[_0xb07f('0x16')](_0x4c8b57[_0xb07f('0x17')](0x0,0x3),0x14,'*');}exports[_0xb07f('0x18')]=function(_0x38578d,_0x151ef2){var _0x368372={},_0x4f0a87={},_0x2a4ec0={'count':0x0,'rows':[]};var _0x7e4382=_[_0xb07f('0x19')](db['CloudProvider'][_0xb07f('0x1a')],function(_0x4778d8){return{'name':_0x4778d8['fieldName'],'type':_0x4778d8['type']['key']};});_0x4f0a87[_0xb07f('0x1b')]=_[_0xb07f('0x19')](_0x7e4382,_0xb07f('0x14'));_0x4f0a87['query']=_[_0xb07f('0x1c')](_0x38578d[_0xb07f('0x1d')]);_0x4f0a87[_0xb07f('0x1e')]=_[_0xb07f('0x1f')](_0x4f0a87[_0xb07f('0x1b')],_0x4f0a87[_0xb07f('0x1d')]);_0x368372[_0xb07f('0x20')]=_[_0xb07f('0x1f')](_0x4f0a87[_0xb07f('0x1b')],qs['fields'](_0x38578d[_0xb07f('0x1d')][_0xb07f('0x21')]));_0x368372[_0xb07f('0x20')]=_0x368372[_0xb07f('0x20')][_0xb07f('0x22')]?_0x368372[_0xb07f('0x20')]:_0x4f0a87['model'];if(!_0x38578d[_0xb07f('0x1d')][_0xb07f('0x23')]('nolimit')){_0x368372[_0xb07f('0xe')]=qs[_0xb07f('0xe')](_0x38578d[_0xb07f('0x1d')][_0xb07f('0xe')]);_0x368372[_0xb07f('0xb')]=qs[_0xb07f('0xb')](_0x38578d[_0xb07f('0x1d')][_0xb07f('0xb')]);}_0x368372[_0xb07f('0x24')]=qs[_0xb07f('0x25')](_0x38578d[_0xb07f('0x1d')][_0xb07f('0x25')]);_0x368372[_0xb07f('0x26')]=qs[_0xb07f('0x1e')](_[_0xb07f('0x27')](_0x38578d[_0xb07f('0x1d')],_0x4f0a87[_0xb07f('0x1e')]),_0x7e4382);if(_0x38578d[_0xb07f('0x1d')][_0xb07f('0x28')]){_0x368372[_0xb07f('0x26')]=_[_0xb07f('0x29')](_0x368372[_0xb07f('0x26')],{'$or':_[_0xb07f('0x19')](_0x7e4382,function(_0x2bff83){if(_0x2bff83[_0xb07f('0x2a')]!==_0xb07f('0x2b')){var _0x504e69={};_0x504e69[_0x2bff83[_0xb07f('0x14')]]={'$like':'%'+_0x38578d[_0xb07f('0x1d')][_0xb07f('0x28')]+'%'};return _0x504e69;}})});}_0x368372=_[_0xb07f('0x29')]({},_0x368372,_0x38578d[_0xb07f('0x2c')]);var _0x300afc={'where':_0x368372['where']};return db[_0xb07f('0x2d')]['count'](_0x300afc)[_0xb07f('0x10')](function(_0x48ebb5){_0x2a4ec0[_0xb07f('0xd')]=_0x48ebb5;if(_0x38578d[_0xb07f('0x1d')][_0xb07f('0x2e')]){_0x368372[_0xb07f('0x2f')]=[{'all':!![]}];}return db['CloudProvider'][_0xb07f('0x30')](_0x368372);})[_0xb07f('0x10')](function(_0x5a0ff8){_0x2a4ec0['rows']=_[_0xb07f('0x19')](_0x5a0ff8,function(_0x225c68){if(_0x225c68[_0xb07f('0x31')]===_0xb07f('0x32')){var _0x23cde4=encryptor[_0xb07f('0x33')](_0x225c68[_0xb07f('0x34')]);_0x225c68[_0xb07f('0x34')]=maskClientSecret(_0x23cde4);}return _0x225c68;});return _0x2a4ec0;})[_0xb07f('0x10')](respondWithFilteredResult(_0x151ef2,_0x368372))[_0xb07f('0x35')](handleError(_0x151ef2,null));};exports['show']=function(_0x29ec82,_0x5a6f40){var _0x4384f1={'raw':!![],'where':{'id':_0x29ec82['params']['id']}},_0x51487d={};_0x51487d['model']=_[_0xb07f('0x1c')](db[_0xb07f('0x2d')][_0xb07f('0x1a')]);_0x51487d['query']=_[_0xb07f('0x1c')](_0x29ec82['query']);_0x51487d['filters']=_[_0xb07f('0x1f')](_0x51487d[_0xb07f('0x1b')],_0x51487d[_0xb07f('0x1d')]);_0x4384f1['attributes']=_['intersection'](_0x51487d[_0xb07f('0x1b')],qs[_0xb07f('0x21')](_0x29ec82[_0xb07f('0x1d')][_0xb07f('0x21')]));_0x4384f1[_0xb07f('0x20')]=_0x4384f1[_0xb07f('0x20')][_0xb07f('0x22')]?_0x4384f1['attributes']:_0x51487d[_0xb07f('0x1b')];if(_0x29ec82[_0xb07f('0x1d')]['includeAll']){_0x4384f1[_0xb07f('0x2f')]=[{'all':!![]}];}_0x4384f1=_[_0xb07f('0x29')]({},_0x4384f1,_0x29ec82[_0xb07f('0x2c')]);return db[_0xb07f('0x2d')][_0xb07f('0x36')](_0x4384f1)['then'](handleEntityNotFound(_0x5a6f40,null))[_0xb07f('0x10')](function(_0x5b0383){if(_0x5b0383[_0xb07f('0x31')]===_0xb07f('0x32')){var _0xb6cf09=encryptor['decryptString'](_0x5b0383[_0xb07f('0x34')]);_0x5b0383[_0xb07f('0x34')]=maskClientSecret(_0xb6cf09);}return _0x5b0383;})['then'](respondWithResult(_0x5a6f40,null))[_0xb07f('0x35')](handleError(_0x5a6f40,null));};exports['create']=function(_0x12c437,_0x4a1490){if(!_0x12c437[_0xb07f('0x37')][_0xb07f('0x14')])throw new Error(_0xb07f('0x38'));if(!_0x12c437[_0xb07f('0x37')][_0xb07f('0x31')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x5baa15=db[_0xb07f('0x2d')][_0xb07f('0x1a')]['service']['values'];if(!_0x5baa15[_0xb07f('0x39')](_0x12c437['body'][_0xb07f('0x31')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x5baa15[_0xb07f('0x3a')](',\x20'));if(_0x12c437[_0xb07f('0x37')][_0xb07f('0x31')]===_0xb07f('0x32')&&_0x12c437[_0xb07f('0x37')][_0xb07f('0x34')]){_0x12c437[_0xb07f('0x37')]['data3']=encryptor['encryptString'](_0x12c437[_0xb07f('0x37')][_0xb07f('0x34')]);}return db[_0xb07f('0x2d')][_0xb07f('0x3b')](_0x12c437[_0xb07f('0x37')],{})[_0xb07f('0x10')](respondWithResult(_0x4a1490,0xc9))[_0xb07f('0x35')](handleError(_0x4a1490,null));};exports[_0xb07f('0x3c')]=function(_0xc79e9b,_0x22504d){if(_0xc79e9b['body']['id']){delete _0xc79e9b[_0xb07f('0x37')]['id'];}return db[_0xb07f('0x2d')]['find']({'where':{'id':_0xc79e9b[_0xb07f('0x3d')]['id']}})[_0xb07f('0x10')](handleEntityNotFound(_0x22504d,null))['then'](function(_0xfc6548){if(_0xfc6548[_0xb07f('0x31')]===_0xb07f('0x32')&&_0xc79e9b[_0xb07f('0x37')]['data3']){_0xc79e9b['body'][_0xb07f('0x34')]=encryptor[_0xb07f('0x3e')](_0xc79e9b['body'][_0xb07f('0x34')]);}return _0xfc6548;})[_0xb07f('0x10')](saveUpdates(_0xc79e9b[_0xb07f('0x37')],null))[_0xb07f('0x10')](respondWithResult(_0x22504d,null))[_0xb07f('0x35')](handleError(_0x22504d,null));};exports[_0xb07f('0x11')]=function(_0x29f14e,_0xbbc551){return db[_0xb07f('0x2d')][_0xb07f('0x36')]({'where':{'id':_0x29f14e[_0xb07f('0x3d')]['id']}})[_0xb07f('0x10')](handleEntityNotFound(_0xbbc551,null))[_0xb07f('0x10')](removeEntity(_0xbbc551,null))['catch'](handleError(_0xbbc551,null));};exports[_0xb07f('0x3f')]=function(_0x48a78e,_0x2ffcbd){return db[_0xb07f('0x2d')]['findOne']({'where':{'id':_0x48a78e[_0xb07f('0x3d')]['id']},'raw':!![]})[_0xb07f('0x10')](function(_0x4be573){if(!_0x4be573)return _0x2ffcbd[_0xb07f('0x40')](0x194);return{'url':oauth[_0xb07f('0x41')](_0x4be573,_0x48a78e['user']['id'])};})[_0xb07f('0x10')](respondWithResult(_0x2ffcbd,null))['catch'](handleError(_0x2ffcbd,null));};exports[_0xb07f('0x42')]=function(_0x3f2186,_0x3c800a){var _0x14a2cb=_0x3f2186['body'];var _0x1f2ae6;var _0x50532f;if(_0x14a2cb[_0xb07f('0x12')])throw _0x14a2cb;redis['get'](_0x14a2cb[_0xb07f('0x43')])[_0xb07f('0x10')](function(_0x5d2065){if(!_0x5d2065)throw new Error('Invalid\x20state\x20parameter');_0x1f2ae6=JSON[_0xb07f('0x44')](_0x5d2065);var _0x24e76f=Buffer[_0xb07f('0x45')](_0x14a2cb[_0xb07f('0x43')],_0xb07f('0x46'))['toString'](_0xb07f('0x47'));_0x50532f=JSON['parse'](_0x24e76f);if(!oauth[_0xb07f('0x48')](_0x14a2cb[_0xb07f('0x49')],_0x1f2ae6[_0xb07f('0x4a')]))throw new Error(_0xb07f('0x4b'));redis[_0xb07f('0x4c')](_0x14a2cb[_0xb07f('0x43')]);return oauth['getOauth2MicrosoftAccessToken'](_0x14a2cb[_0xb07f('0x4d')],_0x1f2ae6);})[_0xb07f('0x10')](function(_0x1a9def){_0x1f2ae6[_0xb07f('0x4e')]=_0x1a9def[_0xb07f('0x4f')];_0x1f2ae6[_0xb07f('0x50')]=_0x1a9def['refresh_token'];return db[_0xb07f('0x2d')][_0xb07f('0x3c')]({'data5':_0x1f2ae6[_0xb07f('0x4e')],'data6':_0x1f2ae6['data6']},{'where':{'id':_0x1f2ae6['id']}});})['then'](function(){oauth[_0xb07f('0x51')](_0x1f2ae6);socket[_0xb07f('0x52')]('microsoftAuthorization:success',{'id':_0x50532f['id']});return;})[_0xb07f('0x10')](respondWithStatusCode(_0x3c800a,null))[_0xb07f('0x35')](function(_0x15df1a){if(_0x50532f){socket[_0xb07f('0x52')](_0xb07f('0x53'),{'id':_0x50532f['id']});}if(!_0x1f2ae6){logger['error'](_0xb07f('0x54'),_0x15df1a);return _0x3c800a[_0xb07f('0x9')](0x1f4)[_0xb07f('0x15')](_0x15df1a[_0xb07f('0x55')]);}logger['error'](_0xb07f('0x56'),_0x1f2ae6['id'],JSON[_0xb07f('0x57')](_0x15df1a));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 79f8b74..3aee912 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 _0x9bce=['path','rimraf','../../config/environment','./cloudProvider.attributes','define','cloud_providers','lodash','util','../../config/logger','moment','bluebird'];(function(_0x241424,_0x25eb5d){var _0x3da798=function(_0x415153){while(--_0x415153){_0x241424['push'](_0x241424['shift']());}};_0x3da798(++_0x25eb5d);}(_0x9bce,0x192));var _0xe9bc=function(_0x2288c3,_0x470419){_0x2288c3=_0x2288c3-0x0;var _0x1ccf3e=_0x9bce[_0x2288c3];return _0x1ccf3e;};'use strict';var _=require(_0xe9bc('0x0'));var util=require(_0xe9bc('0x1'));var logger=require(_0xe9bc('0x2'))('api');var moment=require(_0xe9bc('0x3'));var BPromise=require(_0xe9bc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe9bc('0x5'));var rimraf=require(_0xe9bc('0x6'));var config=require(_0xe9bc('0x7'));var attributes=require(_0xe9bc('0x8'));module['exports']=function(_0x4fc601,_0x5a3fe6){return _0x4fc601[_0xe9bc('0x9')]('CloudProvider',attributes,{'tableName':_0xe9bc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1825=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CloudProvider','lodash','util','../../config/logger','api'];(function(_0x25cd10,_0x193910){var _0x99a9f9=function(_0x555314){while(--_0x555314){_0x25cd10['push'](_0x25cd10['shift']());}};_0x99a9f9(++_0x193910);}(_0x1825,0x7e));var _0x5182=function(_0x37ced0,_0x29518c){_0x37ced0=_0x37ced0-0x0;var _0x59ecfb=_0x1825[_0x37ced0];return _0x59ecfb;};'use strict';var _=require(_0x5182('0x0'));var util=require(_0x5182('0x1'));var logger=require(_0x5182('0x2'))(_0x5182('0x3'));var moment=require(_0x5182('0x4'));var BPromise=require(_0x5182('0x5'));var rp=require(_0x5182('0x6'));var fs=require('fs');var path=require(_0x5182('0x7'));var rimraf=require(_0x5182('0x8'));var config=require(_0x5182('0x9'));var attributes=require('./cloudProvider.attributes');module[_0x5182('0xa')]=function(_0x203711,_0x49434b){return _0x203711[_0x5182('0xb')](_0x5182('0xc'),attributes,{'tableName':'cloud_providers','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 f484161..ca7d610 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 _0x258f=['update','data5','then','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','findAll','inspect','exports','lodash','moment','ioredis','request-promise','util','../../config/environment','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','type','Dynamics365','push','data7','/.default','Outlook365','replace','{TENANT_ID}','data2','id_token','from','stringify','randomBytes','toString','response_type','redirect_uri','data4','response_mode','scope','nonce','prompt','login','map','key','oauth2Claims','oauth2/','data1','decode','payload','iss','audience','isAfter','exp','resolve','data3','refresh_token','data6','decryptString','POST','access_token','CloudProvider'];(function(_0x260e07,_0x2dd0e4){var _0x28ba4e=function(_0x237146){while(--_0x237146){_0x260e07['push'](_0x260e07['shift']());}};_0x28ba4e(++_0x2dd0e4);}(_0x258f,0x11c));var _0xf258=function(_0xee2791,_0x3fb463){_0xee2791=_0xee2791-0x0;var _0x4c0cfb=_0x258f[_0xee2791];return _0x4c0cfb;};'use strict';var _=require(_0xf258('0x0'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require(_0xf258('0x1'));var Redis=require(_0xf258('0x2'));var rp=require(_0xf258('0x3'));var util=require(_0xf258('0x4'));var encryptor=require('../../components/encryptor');var config=require(_0xf258('0x5'));var logger=require('../../config/logger')(_0xf258('0x6'));var schedule=require(_0xf258('0x7'));var db=require(_0xf258('0x8'))['db'];config[_0xf258('0x9')]=_[_0xf258('0xa')](config[_0xf258('0x9')],{'host':_0xf258('0xb'),'port':0x18eb});var redis=new Redis(config[_0xf258('0x9')]);var MICROSOFT_AUTH_URL=_0xf258('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0xf258('0xd'),_0xf258('0xe'),_0xf258('0xf'),_0xf258('0x10'),_0xf258('0x11'),'https://outlook.office.com/POP.AccessAsUser.All',_0xf258('0x12')],'Dynamics365':[_0xf258('0xd'),_0xf258('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0xf258('0x13');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x28b962){var _0x726940=_['map'](AZURE_AUTH_SCOPES[_0x28b962[_0xf258('0x14')]]);if(_0x28b962['type']===_0xf258('0x15'))_0x726940[_0xf258('0x16')](_0x28b962[_0xf258('0x17')]+_0xf258('0x18'));return _0x726940['join']('\x20');}function getAccessTokenScope(_0x390a53){if(_0x390a53[_0xf258('0x14')]===_0xf258('0x19'))return _0xf258('0x11');if(_0x390a53[_0xf258('0x14')]===_0xf258('0x15'))return _0x390a53[_0xf258('0x17')]+_0xf258('0x18');}function generateMicrosoftAuthorizationUrl(_0x3f79f0,_0x102403){var _0x202626=MICROSOFT_AUTH_URL[_0xf258('0x1a')](_0xf258('0x1b'),_0x3f79f0[_0xf258('0x1c')]);var _0x106c04=['code',_0xf258('0x1d')];var _0x6f8ff7=Buffer[_0xf258('0x1e')](JSON[_0xf258('0x1f')]({'id':_0x102403}))['toString']('base64');var _0x2eee29=crypto[_0xf258('0x20')](0x10)[_0xf258('0x21')]('hex');var _0x20af4d=getAuthorizationScopes(_0x3f79f0);var _0x48076a=[{'key':'client_id','value':_0x3f79f0['data1']},{'key':_0xf258('0x22'),'value':encodeURIComponent(_0x106c04['join']('\x20'))},{'key':_0xf258('0x23'),'value':_0x3f79f0[_0xf258('0x24')]},{'key':_0xf258('0x25'),'value':'form_post'},{'key':_0xf258('0x26'),'value':encodeURIComponent(_0x20af4d)},{'key':'state','value':_0x6f8ff7},{'key':_0xf258('0x27'),'value':_0x2eee29},{'key':_0xf258('0x28'),'value':_0xf258('0x29')}];var _0x618115=_0x202626+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xf258('0x2a')](_0x48076a,function(_0x30b09c){return _0x30b09c[_0xf258('0x2b')]+'='+_0x30b09c['value'];})['join']('&');_0x3f79f0[_0xf258('0x2c')]={'issuer':_0x202626[_0xf258('0x1a')](_0xf258('0x2d'),''),'audience':_0x3f79f0[_0xf258('0x2e')],'state':_0x6f8ff7,'nonce':_0x2eee29};redis['set'](_0x6f8ff7,JSON[_0xf258('0x1f')](_0x3f79f0));return _0x618115;}function isValidIdToken(_0x330ec7,_0x1c2140){try{var _0x1cf52e=jwt[_0xf258('0x2f')](_0x330ec7,{'complete':!![]});var _0x37cea0=_0x1cf52e[_0xf258('0x30')];if(_0x37cea0[_0xf258('0x31')]!==_0x1c2140['issuer'])return![];if(_0x37cea0['aud']!==_0x1c2140[_0xf258('0x32')])return![];if(_0x37cea0[_0xf258('0x27')]!==_0x1c2140[_0xf258('0x27')])return![];if(moment()[_0xf258('0x33')](moment['unix'](_0x37cea0[_0xf258('0x34')])))return![];return!![];}catch(_0x25c3ee){throw _0x25c3ee;}}function refreshOauth2MicrosoftAccessToken(_0x118813){return Promise[_0xf258('0x35')]()['then'](function(){if(_0x118813[_0xf258('0x36')])return _0x118813;return db['CloudProvider']['findOne']({'where':{'id':_0x118813['id']},'raw':!![]});})['then'](function(_0xc7928){var _0x557116={'grant_type':_0xf258('0x37'),'refresh_token':_0xc7928[_0xf258('0x38')],'scope':getAccessTokenScope(_0xc7928),'redirect_uri':_0xc7928[_0xf258('0x24')],'client_id':_0xc7928[_0xf258('0x2e')],'client_secret':encryptor[_0xf258('0x39')](_0xc7928[_0xf258('0x36')])};var _0x1ea6da={'method':_0xf258('0x3a'),'uri':MICROSOFT_AUTH_URL[_0xf258('0x1a')]('{TENANT_ID}',_0xc7928[_0xf258('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x557116,'json':!![]};return rp(_0x1ea6da);})['then'](function(_0x3bd07b){_0x118813['data5']=_0x3bd07b[_0xf258('0x3b')];_0x118813[_0xf258('0x38')]=_0x3bd07b[_0xf258('0x37')];return db[_0xf258('0x3c')][_0xf258('0x3d')]({'data5':_0x118813[_0xf258('0x3e')],'data6':_0x118813['data6']},{'where':{'id':_0x118813['id']}});})[_0xf258('0x3f')](function(){return _0x118813;})['catch'](function(_0x5a8b2d){logger[_0xf258('0x40')](_0xf258('0x41'),_0x118813['id'],_0x5a8b2d);});}function getOauth2MicrosoftAccessToken(_0x317d25,_0x2087c0){var _0x3460e9={'grant_type':'authorization_code','code':_0x317d25,'scope':getAccessTokenScope(_0x2087c0),'redirect_uri':_0x2087c0[_0xf258('0x24')],'client_id':_0x2087c0[_0xf258('0x2e')],'client_secret':encryptor[_0xf258('0x39')](_0x2087c0[_0xf258('0x36')])};var _0x2c7545={'method':_0xf258('0x3a'),'uri':MICROSOFT_AUTH_URL[_0xf258('0x1a')]('{TENANT_ID}',_0x2087c0[_0xf258('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3460e9,'json':!![]};return rp(_0x2c7545);}function startRefreshInterval(_0x3a2daa){var _0x230889=schedule['intervals'];if(_0x230889[_0x3a2daa['id']])clearInterval(_0x230889[_0x3a2daa['id']]);_0x230889[_0x3a2daa['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x3a2daa['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x230889;}function startAllRefreshIntervals(){return db[_0xf258('0x3c')][_0xf258('0x42')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xf258('0x3f')](function(_0x1438eb){var _0x183ee0=_0x1438eb[_0xf258('0x2a')](function(_0x426a3e){return refreshOauth2MicrosoftAccessToken(_0x426a3e)[_0xf258('0x3f')](function(_0x4ba0b3){startRefreshInterval(_0x4ba0b3);});});return Promise['all'](_0x183ee0);})['catch'](function(_0x1fcf42){var _0x3b6261=_0x1fcf42?util[_0xf258('0x43')](_0x1fcf42,{'showHidden':![],'depth':null}):'';logger[_0xf258('0x40')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x3b6261);});}module[_0xf258('0x44')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xa6fc=['key','value','oauth2Claims','replace','oauth2/','set','decode','payload','iss','audience','isAfter','exp','resolve','then','CloudProvider','refresh_token','data6','data4','decryptString','data3','access_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','bind','findAll','all','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','defaults','redis','localhost','profile','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','{TENANT_ID}','data2','code','id_token','from','stringify','toString','hex','client_id','data1','response_mode','form_post','state','nonce','prompt','login'];(function(_0x30a36b,_0xa9e29b){var _0x4ea420=function(_0x442a14){while(--_0x442a14){_0x30a36b['push'](_0x30a36b['shift']());}};_0x4ea420(++_0xa9e29b);}(_0xa6fc,0x70));var _0xca6f=function(_0x5e332f,_0x5b706f){_0x5e332f=_0x5e332f-0x0;var _0x6df24f=_0xa6fc[_0x5e332f];return _0x6df24f;};'use strict';var _=require(_0xca6f('0x0'));var crypto=require(_0xca6f('0x1'));var jwt=require(_0xca6f('0x2'));var moment=require(_0xca6f('0x3'));var Redis=require(_0xca6f('0x4'));var rp=require(_0xca6f('0x5'));var util=require(_0xca6f('0x6'));var encryptor=require(_0xca6f('0x7'));var config=require('../../config/environment');var logger=require(_0xca6f('0x8'))(_0xca6f('0x9'));var schedule=require(_0xca6f('0xa'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xca6f('0xb')](config[_0xca6f('0xc')],{'host':_0xca6f('0xd'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xca6f('0xe'),'email',_0xca6f('0xf'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0xca6f('0x10'),_0xca6f('0x11')],'Dynamics365':[_0xca6f('0x12'),_0xca6f('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0xca6f('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0xca6f('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x301e3d){var _0x298220=_[_0xca6f('0x15')](AZURE_AUTH_SCOPES[_0x301e3d['type']]);if(_0x301e3d[_0xca6f('0x16')]===_0xca6f('0x17'))_0x298220[_0xca6f('0x18')](_0x301e3d[_0xca6f('0x19')]+_0xca6f('0x1a'));return _0x298220[_0xca6f('0x1b')]('\x20');}function getAccessTokenScope(_0x1f58bf){if(_0x1f58bf[_0xca6f('0x16')]===_0xca6f('0x1c'))return _0xca6f('0x1d');if(_0x1f58bf[_0xca6f('0x16')]===_0xca6f('0x17'))return _0x1f58bf[_0xca6f('0x19')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x2613b5,_0x38672a){var _0x510ce0=MICROSOFT_AUTH_URL['replace'](_0xca6f('0x1e'),_0x2613b5[_0xca6f('0x1f')]);var _0x53fd74=[_0xca6f('0x20'),_0xca6f('0x21')];var _0xd83320=Buffer[_0xca6f('0x22')](JSON[_0xca6f('0x23')]({'id':_0x38672a}))[_0xca6f('0x24')]('base64');var _0x237cdb=crypto['randomBytes'](0x10)[_0xca6f('0x24')](_0xca6f('0x25'));var _0x18c03e=getAuthorizationScopes(_0x2613b5);var _0x2941e4=[{'key':_0xca6f('0x26'),'value':_0x2613b5[_0xca6f('0x27')]},{'key':'response_type','value':encodeURIComponent(_0x53fd74[_0xca6f('0x1b')]('\x20'))},{'key':'redirect_uri','value':_0x2613b5['data4']},{'key':_0xca6f('0x28'),'value':_0xca6f('0x29')},{'key':'scope','value':encodeURIComponent(_0x18c03e)},{'key':_0xca6f('0x2a'),'value':_0xd83320},{'key':_0xca6f('0x2b'),'value':_0x237cdb},{'key':_0xca6f('0x2c'),'value':_0xca6f('0x2d')}];var _0x141f21=_0x510ce0+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xca6f('0x15')](_0x2941e4,function(_0x4e05df){return _0x4e05df[_0xca6f('0x2e')]+'='+_0x4e05df[_0xca6f('0x2f')];})[_0xca6f('0x1b')]('&');_0x2613b5[_0xca6f('0x30')]={'issuer':_0x510ce0[_0xca6f('0x31')](_0xca6f('0x32'),''),'audience':_0x2613b5[_0xca6f('0x27')],'state':_0xd83320,'nonce':_0x237cdb};redis[_0xca6f('0x33')](_0xd83320,JSON['stringify'](_0x2613b5));return _0x141f21;}function isValidIdToken(_0x392eaa,_0x415751){try{var _0x308ce9=jwt[_0xca6f('0x34')](_0x392eaa,{'complete':!![]});var _0x2bfcca=_0x308ce9[_0xca6f('0x35')];if(_0x2bfcca[_0xca6f('0x36')]!==_0x415751['issuer'])return![];if(_0x2bfcca['aud']!==_0x415751[_0xca6f('0x37')])return![];if(_0x2bfcca['nonce']!==_0x415751['nonce'])return![];if(moment()[_0xca6f('0x38')](moment['unix'](_0x2bfcca[_0xca6f('0x39')])))return![];return!![];}catch(_0x3c59e9){throw _0x3c59e9;}}function refreshOauth2MicrosoftAccessToken(_0x5091fe){return Promise[_0xca6f('0x3a')]()[_0xca6f('0x3b')](function(){if(_0x5091fe['data3'])return _0x5091fe;return db[_0xca6f('0x3c')]['findOne']({'where':{'id':_0x5091fe['id']},'raw':!![]});})[_0xca6f('0x3b')](function(_0x1e6281){var _0x4208a2={'grant_type':_0xca6f('0x3d'),'refresh_token':_0x1e6281[_0xca6f('0x3e')],'scope':getAccessTokenScope(_0x1e6281),'redirect_uri':_0x1e6281[_0xca6f('0x3f')],'client_id':_0x1e6281[_0xca6f('0x27')],'client_secret':encryptor[_0xca6f('0x40')](_0x1e6281[_0xca6f('0x41')])};var _0x2e8f6b={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xca6f('0x31')](_0xca6f('0x1e'),_0x1e6281['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4208a2,'json':!![]};return rp(_0x2e8f6b);})[_0xca6f('0x3b')](function(_0x1bd65a){_0x5091fe['data5']=_0x1bd65a[_0xca6f('0x42')];_0x5091fe[_0xca6f('0x3e')]=_0x1bd65a[_0xca6f('0x3d')];return db[_0xca6f('0x3c')][_0xca6f('0x43')]({'data5':_0x5091fe['data5'],'data6':_0x5091fe[_0xca6f('0x3e')]},{'where':{'id':_0x5091fe['id']}});})[_0xca6f('0x3b')](function(){return _0x5091fe;})[_0xca6f('0x44')](function(_0x447ddc){logger['error'](_0xca6f('0x45'),_0x5091fe['id'],_0x447ddc);});}function getOauth2MicrosoftAccessToken(_0x5b6b85,_0x39029b){var _0x288dd1={'grant_type':_0xca6f('0x46'),'code':_0x5b6b85,'scope':getAccessTokenScope(_0x39029b),'redirect_uri':_0x39029b[_0xca6f('0x3f')],'client_id':_0x39029b[_0xca6f('0x27')],'client_secret':encryptor['decryptString'](_0x39029b['data3'])};var _0x244994={'method':_0xca6f('0x47'),'uri':MICROSOFT_AUTH_URL[_0xca6f('0x31')](_0xca6f('0x1e'),_0x39029b['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x288dd1,'json':!![]};return rp(_0x244994);}function startRefreshInterval(_0x478173){var _0x29faed=schedule[_0xca6f('0x48')];if(_0x29faed[_0x478173['id']])clearInterval(_0x29faed[_0x478173['id']]);_0x29faed[_0x478173['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xca6f('0x49')](this,{'id':_0x478173['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xca6f('0x48')]=_0x29faed;}function startAllRefreshIntervals(){return db[_0xca6f('0x3c')][_0xca6f('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xca6f('0x3b')](function(_0x36815b){var _0x51417a=_0x36815b['map'](function(_0x2539c0){return refreshOauth2MicrosoftAccessToken(_0x2539c0)[_0xca6f('0x3b')](function(_0x3e933d){startRefreshInterval(_0x3e933d);});});return Promise[_0xca6f('0x4b')](_0x51417a);})['catch'](function(_0x166a75){var _0x5dcee1=_0x166a75?util['inspect'](_0x166a75,{'showHidden':![],'depth':null}):'';logger[_0xca6f('0x4c')](_0xca6f('0x4d'),_0x5dcee1);});}module[_0xca6f('0x4e')]={'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 db02546..f139e68 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 _0xed03=['info','CloudProvider,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x57afc0,_0x24ff04){var _0x44b769=function(_0x238847){while(--_0x238847){_0x57afc0['push'](_0x57afc0['shift']());}};_0x44b769(++_0x24ff04);}(_0xed03,0xdc));var _0x3ed0=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xed03[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x3ed0('0x0'));var util=require(_0x3ed0('0x1'));var moment=require('moment');var BPromise=require(_0x3ed0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ed0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3ed0('0x4'))('rpc');var config=require(_0x3ed0('0x5'));var jayson=require(_0x3ed0('0x6'));var client=jayson[_0x3ed0('0x7')][_0x3ed0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x8470b7,_0x3f1277,_0xd729a0){return new BPromise(function(_0x4500aa,_0xddc4c5){return client[_0x3ed0('0x9')](_0x8470b7,_0xd729a0)[_0x3ed0('0xa')](function(_0x34950c){logger[_0x3ed0('0xb')](_0x3ed0('0xc'),_0x3f1277,'request\x20sent');logger[_0x3ed0('0xd')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x3f1277,_0x3ed0('0xe'),JSON[_0x3ed0('0xf')](_0x34950c));if(_0x34950c[_0x3ed0('0x10')]){if(_0x34950c['error'][_0x3ed0('0x11')]===0x1f4){logger[_0x3ed0('0x10')](_0x3ed0('0xc'),_0x3f1277,_0x34950c[_0x3ed0('0x10')][_0x3ed0('0x12')]);return _0xddc4c5(_0x34950c['error'][_0x3ed0('0x12')]);}logger[_0x3ed0('0x10')](_0x3ed0('0xc'),_0x3f1277,_0x34950c[_0x3ed0('0x10')][_0x3ed0('0x12')]);return _0x4500aa(_0x34950c['error'][_0x3ed0('0x12')]);}else{logger[_0x3ed0('0xb')]('CloudProvider,\x20%s,\x20%s',_0x3f1277,_0x3ed0('0xe'));_0x4500aa(_0x34950c[_0x3ed0('0x13')][_0x3ed0('0x12')]);}})[_0x3ed0('0x14')](function(_0xaa73cd){logger[_0x3ed0('0x10')]('CloudProvider,\x20%s,\x20%s',_0x3f1277,_0xaa73cd);_0xddc4c5(_0xaa73cd);});});}
\ No newline at end of file
+var _0x3d2f=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error'];(function(_0x55677b,_0x3e5655){var _0x104b88=function(_0x78d34f){while(--_0x78d34f){_0x55677b['push'](_0x55677b['shift']());}};_0x104b88(++_0x3e5655);}(_0x3d2f,0x18f));var _0xf3d2=function(_0x2d1da8,_0x5606b9){_0x2d1da8=_0x2d1da8-0x0;var _0x53ae73=_0x3d2f[_0x2d1da8];return _0x53ae73;};'use strict';var _=require(_0xf3d2('0x0'));var util=require(_0xf3d2('0x1'));var moment=require('moment');var BPromise=require(_0xf3d2('0x2'));var rs=require(_0xf3d2('0x3'));var fs=require('fs');var Redis=require(_0xf3d2('0x4'));var db=require(_0xf3d2('0x5'))['db'];var utils=require(_0xf3d2('0x6'));var logger=require(_0xf3d2('0x7'))(_0xf3d2('0x8'));var config=require('../../config/environment');var jayson=require(_0xf3d2('0x9'));var client=jayson[_0xf3d2('0xa')][_0xf3d2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf9a0c9,_0x23edba,_0x57f94b){return new BPromise(function(_0x26f330,_0x3f86f6){return client['request'](_0xf9a0c9,_0x57f94b)[_0xf3d2('0xc')](function(_0x4ef134){logger[_0xf3d2('0xd')](_0xf3d2('0xe'),_0x23edba,_0xf3d2('0xf'));logger[_0xf3d2('0x10')](_0xf3d2('0x11'),_0x23edba,_0xf3d2('0xf'),JSON['stringify'](_0x4ef134));if(_0x4ef134[_0xf3d2('0x12')]){if(_0x4ef134[_0xf3d2('0x12')]['code']===0x1f4){logger[_0xf3d2('0x12')]('CloudProvider,\x20%s,\x20%s',_0x23edba,_0x4ef134[_0xf3d2('0x12')][_0xf3d2('0x13')]);return _0x3f86f6(_0x4ef134[_0xf3d2('0x12')]['message']);}logger[_0xf3d2('0x12')](_0xf3d2('0xe'),_0x23edba,_0x4ef134[_0xf3d2('0x12')][_0xf3d2('0x13')]);return _0x26f330(_0x4ef134[_0xf3d2('0x12')][_0xf3d2('0x13')]);}else{logger['info'](_0xf3d2('0xe'),_0x23edba,_0xf3d2('0xf'));_0x26f330(_0x4ef134[_0xf3d2('0x14')][_0xf3d2('0x13')]);}})[_0xf3d2('0x15')](function(_0x3daaaf){logger[_0xf3d2('0x12')](_0xf3d2('0xe'),_0x23edba,_0x3daaaf);_0x3f86f6(_0x3daaaf);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 4ec3099..dc2c671 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 _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x5c82e9,_0x1a13d5){var _0x57fc44=function(_0x196831){while(--_0x196831){_0x5c82e9['push'](_0x5c82e9['shift']());}};_0x57fc44(++_0x1a13d5);}(_0x2ef3,0xba));var _0x32ef=function(_0x421c29,_0x4074f6){_0x421c29=_0x421c29-0x0;var _0xd2c93b=_0x2ef3[_0x421c29];return _0xd2c93b;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=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(_0x1ba00d,_0x28ec4b){var _0x199e87=function(_0x22daa7){while(--_0x22daa7){_0x1ba00d['push'](_0x1ba00d['shift']());}};_0x199e87(++_0x28ec4b);}(_0xdb28,0x106));var _0x8db2=function(_0x473ffe,_0x3844f8){_0x473ffe=_0x473ffe-0x0;var _0x10423f=_0xdb28[_0x473ffe];return _0x10423f;};'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 a8133a1..54e67af 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 _0x9a45=['name','STRING'];(function(_0x119961,_0x38c0a1){var _0x147fe2=function(_0xd2e914){while(--_0xd2e914){_0x119961['push'](_0x119961['shift']());}};_0x147fe2(++_0x38c0a1);}(_0x9a45,0x11d));var _0x59a4=function(_0x21f729,_0x20de13){_0x21f729=_0x21f729-0x0;var _0x41c0ab=_0x9a45[_0x21f729];return _0x41c0ab;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x59a4('0x0')],'unique':_0x59a4('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x59a4('0x0')]},'companyId':{'type':Sequelize[_0x59a4('0x0')]},'website':{'type':Sequelize[_0x59a4('0x0')]},'phone':{'type':Sequelize[_0x59a4('0x0')]},'fax':{'type':Sequelize[_0x59a4('0x0')]},'type':{'type':Sequelize[_0x59a4('0x0')]},'street':{'type':Sequelize[_0x59a4('0x0')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x59a4('0x0')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x59a4('0x0')]},'sPostalCode':{'type':Sequelize[_0x59a4('0x0')]},'sCity':{'type':Sequelize[_0x59a4('0x0')]},'sCountry':{'type':Sequelize[_0x59a4('0x0')]},'description':{'type':Sequelize[_0x59a4('0x0')]}};
\ No newline at end of file
+var _0x217a=['name','sequelize','STRING'];(function(_0x4cf0b7,_0x560029){var _0x545f10=function(_0x993533){while(--_0x993533){_0x4cf0b7['push'](_0x4cf0b7['shift']());}};_0x545f10(++_0x560029);}(_0x217a,0x130));var _0xa217=function(_0x4a9f03,_0xda7a8a){_0x4a9f03=_0x4a9f03-0x0;var _0x5db5a3=_0x217a[_0x4a9f03];return _0x5db5a3;};'use strict';var Sequelize=require(_0xa217('0x0'));module['exports']={'name':{'type':Sequelize[_0xa217('0x1')],'unique':_0xa217('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa217('0x1')]},'companyId':{'type':Sequelize[_0xa217('0x1')]},'website':{'type':Sequelize[_0xa217('0x1')]},'phone':{'type':Sequelize[_0xa217('0x1')]},'fax':{'type':Sequelize[_0xa217('0x1')]},'type':{'type':Sequelize[_0xa217('0x1')]},'street':{'type':Sequelize[_0xa217('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa217('0x1')]},'country':{'type':Sequelize[_0xa217('0x1')]},'email':{'type':Sequelize[_0xa217('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa217('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xa217('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa217('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 1284121..54a3bdc 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 _0x3e89=['describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','pick','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../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','stack','name','send','index','CmCompany'];(function(_0x3ee39d,_0x2e04a5){var _0x1ada4f=function(_0x145d54){while(--_0x145d54){_0x3ee39d['push'](_0x3ee39d['shift']());}};_0x1ada4f(++_0x2e04a5);}(_0x3e89,0x17d));var _0x93e8=function(_0x1cdaaa,_0x493dda){_0x1cdaaa=_0x1cdaaa-0x0;var _0x1c761d=_0x3e89[_0x1cdaaa];return _0x1c761d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x93e8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x93e8('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x93e8('0x2'));var Mustache=require(_0x93e8('0x3'));var util=require(_0x93e8('0x4'));var path=require(_0x93e8('0x5'));var sox=require(_0x93e8('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x93e8('0x7'));var jsforce=require(_0x93e8('0x8'));var deskjs=require(_0x93e8('0x9'));var toCsv=require(_0x93e8('0xa'));var querystring=require(_0x93e8('0xb'));var Papa=require(_0x93e8('0xc'));var Redis=require(_0x93e8('0xd'));var authService=require(_0x93e8('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x93e8('0xf'));var hardwareService=require(_0x93e8('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x93e8('0x11'));var config=require(_0x93e8('0x12'));var licenseUtil=require(_0x93e8('0x13'));var db=require(_0x93e8('0x14'))['db'];function respondWithStatusCode(_0x1c71ba,_0x240045){_0x240045=_0x240045||0xcc;return function(_0x298d63){if(_0x298d63){return _0x1c71ba['sendStatus'](_0x240045);}return _0x1c71ba[_0x93e8('0x15')](_0x240045)[_0x93e8('0x16')]();};}function respondWithResult(_0x59c05d,_0x540013){_0x540013=_0x540013||0xc8;return function(_0x11690e){if(_0x11690e){return _0x59c05d[_0x93e8('0x15')](_0x540013)[_0x93e8('0x17')](_0x11690e);}};}function respondWithFilteredResult(_0x5db59f,_0x198ee6){return function(_0x273add){if(_0x273add){var _0x597357=typeof _0x198ee6[_0x93e8('0x18')]===_0x93e8('0x19')&&typeof _0x198ee6[_0x93e8('0x1a')]==='undefined';var _0x52dc66=_0x273add[_0x93e8('0x1b')];var _0x4f8fe9=_0x597357?0x0:_0x198ee6[_0x93e8('0x18')];var _0x42ffe3=_0x597357?_0x273add[_0x93e8('0x1b')]:_0x198ee6['offset']+_0x198ee6[_0x93e8('0x1a')];var _0x2f0902;if(_0x42ffe3>=_0x52dc66){_0x42ffe3=_0x52dc66;_0x2f0902=0xc8;}else{_0x2f0902=0xce;}_0x5db59f[_0x93e8('0x15')](_0x2f0902);return _0x5db59f['set'](_0x93e8('0x1c'),_0x4f8fe9+'-'+_0x42ffe3+'/'+_0x52dc66)['json'](_0x273add);}return null;};}function patchUpdates(_0x242a84){return function(_0x1024ea){try{jsonpatch[_0x93e8('0x1d')](_0x1024ea,_0x242a84,!![]);}catch(_0x36951e){return BPromise[_0x93e8('0x1e')](_0x36951e);}return _0x1024ea[_0x93e8('0x1f')]();};}function saveUpdates(_0x2c891e,_0x43734b){return function(_0x3749f0){if(_0x3749f0){return _0x3749f0[_0x93e8('0x20')](_0x2c891e)['then'](function(_0x429cc6){return _0x429cc6;});}return null;};}function removeEntity(_0x4b0a7f,_0x4fee7d){return function(_0x46b5ed){if(_0x46b5ed){return _0x46b5ed[_0x93e8('0x21')]()[_0x93e8('0x22')](function(){var _0x2fe8c4=_0x46b5ed[_0x93e8('0x23')]({'plain':!![]});var _0x28797e=_0x93e8('0x24');return db[_0x93e8('0x25')][_0x93e8('0x21')]({'where':{'type':_0x28797e,'resourceId':_0x2fe8c4['id']}})[_0x93e8('0x22')](function(){return _0x46b5ed;});})['then'](function(){_0x4b0a7f[_0x93e8('0x15')](0xcc)[_0x93e8('0x16')]();});}};}function handleEntityNotFound(_0x4117c5,_0x2b79f8){return function(_0x21a58f){if(!_0x21a58f){_0x4117c5['sendStatus'](0x194);}return _0x21a58f;};}function handleError(_0x2ea8f7,_0x1bbb89){_0x1bbb89=_0x1bbb89||0x1f4;return function(_0x37e2c1){logger[_0x93e8('0x26')](_0x37e2c1[_0x93e8('0x27')]);if(_0x37e2c1['name']){delete _0x37e2c1[_0x93e8('0x28')];}_0x2ea8f7[_0x93e8('0x15')](_0x1bbb89)[_0x93e8('0x29')](_0x37e2c1);};}exports[_0x93e8('0x2a')]=function(_0x114ebe,_0x9695c9){var _0x3e22c5={},_0x26a1ab={},_0x501ed4={'count':0x0,'rows':[]};return db[_0x93e8('0x2b')][_0x93e8('0x2c')]()['then'](function(_0x5e7e78){_0x26a1ab[_0x93e8('0x2d')]=_[_0x93e8('0x2e')](_0x5e7e78);_0x26a1ab[_0x93e8('0x2f')]=_[_0x93e8('0x2e')](_0x114ebe['query']);_0x26a1ab['filters']=_[_0x93e8('0x30')](_0x26a1ab['model'],_0x26a1ab[_0x93e8('0x2f')]);_0x3e22c5[_0x93e8('0x31')]=_[_0x93e8('0x30')](_0x26a1ab[_0x93e8('0x2d')],qs['fields'](_0x114ebe[_0x93e8('0x2f')][_0x93e8('0x32')]));_0x3e22c5[_0x93e8('0x31')]=_0x3e22c5[_0x93e8('0x31')][_0x93e8('0x33')]?_0x3e22c5[_0x93e8('0x31')]:_0x26a1ab[_0x93e8('0x2d')];if(!_0x114ebe['query'][_0x93e8('0x34')](_0x93e8('0x35'))){_0x3e22c5[_0x93e8('0x1a')]=qs[_0x93e8('0x1a')](_0x114ebe[_0x93e8('0x2f')][_0x93e8('0x1a')]);_0x3e22c5['offset']=qs[_0x93e8('0x18')](_0x114ebe['query'][_0x93e8('0x18')]);}_0x3e22c5[_0x93e8('0x36')]=qs[_0x93e8('0x37')](_0x114ebe[_0x93e8('0x2f')][_0x93e8('0x37')]);_0x3e22c5[_0x93e8('0x38')]=qs[_0x93e8('0x39')](_['pick'](_0x114ebe[_0x93e8('0x2f')],_0x26a1ab[_0x93e8('0x39')]),_0x5e7e78);if(_0x114ebe[_0x93e8('0x2f')][_0x93e8('0x3a')]){_0x3e22c5[_0x93e8('0x38')]=_[_0x93e8('0x3b')](_0x3e22c5[_0x93e8('0x38')],{'$or':_[_0x93e8('0x3c')](_0x3e22c5[_0x93e8('0x31')],function(_0x1b32bb){var _0x16a044={};_0x16a044[_0x1b32bb]={'$like':'%'+_0x114ebe['query'][_0x93e8('0x3a')]+'%'};return _0x16a044;})});}_0x3e22c5=_[_0x93e8('0x3b')]({},_0x3e22c5,_0x114ebe[_0x93e8('0x3d')]);var _0x5134b8={'where':_0x3e22c5[_0x93e8('0x38')]};return db[_0x93e8('0x2b')][_0x93e8('0x1b')](_0x5134b8)['then'](function(_0x30ced0){_0x501ed4[_0x93e8('0x1b')]=_0x30ced0;if(_0x114ebe[_0x93e8('0x2f')][_0x93e8('0x3e')]){_0x3e22c5['include']=[{'all':!![]}];}return db['CmCompany'][_0x93e8('0x3f')](_0x3e22c5);})[_0x93e8('0x22')](function(_0x5431b1){_0x501ed4[_0x93e8('0x40')]=_0x5431b1;return _0x501ed4;})[_0x93e8('0x22')](respondWithFilteredResult(_0x9695c9,_0x3e22c5))[_0x93e8('0x41')](handleError(_0x9695c9,null));})[_0x93e8('0x41')](handleError(_0x9695c9,null));};exports['show']=function(_0x199eda,_0x36ab0f){var _0x161f96={'raw':![],'where':{'id':_0x199eda[_0x93e8('0x42')]['id']}},_0x1dcc4d={};_0x1dcc4d[_0x93e8('0x2d')]=_[_0x93e8('0x2e')](db[_0x93e8('0x2b')][_0x93e8('0x43')]);_0x1dcc4d[_0x93e8('0x2f')]=_['keys'](_0x199eda[_0x93e8('0x2f')]);_0x1dcc4d['filters']=_[_0x93e8('0x30')](_0x1dcc4d[_0x93e8('0x2d')],_0x1dcc4d[_0x93e8('0x2f')]);_0x161f96[_0x93e8('0x31')]=_['intersection'](_0x1dcc4d[_0x93e8('0x2d')],qs[_0x93e8('0x32')](_0x199eda['query'][_0x93e8('0x32')]));_0x161f96['attributes']=_0x161f96[_0x93e8('0x31')][_0x93e8('0x33')]?_0x161f96[_0x93e8('0x31')]:_0x1dcc4d[_0x93e8('0x2d')];if(_0x199eda[_0x93e8('0x2f')][_0x93e8('0x3e')]){_0x161f96[_0x93e8('0x44')]=[{'all':!![]}];}_0x161f96=_[_0x93e8('0x3b')]({},_0x161f96,_0x199eda[_0x93e8('0x3d')]);return db[_0x93e8('0x2b')][_0x93e8('0x45')](_0x161f96)[_0x93e8('0x22')](handleEntityNotFound(_0x36ab0f,null))[_0x93e8('0x22')](respondWithResult(_0x36ab0f,null))['catch'](handleError(_0x36ab0f,null));};exports[_0x93e8('0x46')]=function(_0x56eb63,_0x4fe99a){return db[_0x93e8('0x2b')][_0x93e8('0x46')](_0x56eb63[_0x93e8('0x47')],{})[_0x93e8('0x22')](function(_0x1fd6de){var _0x78d35b=_0x56eb63[_0x93e8('0x48')]['get']({'plain':!![]});if(!_0x78d35b)throw new Error(_0x93e8('0x49'));if(_0x78d35b[_0x93e8('0x4a')]===_0x93e8('0x48')){var _0x1837ed=_0x1fd6de[_0x93e8('0x23')]({'plain':!![]});var _0x114ea4=_0x93e8('0x24');return db[_0x93e8('0x4b')][_0x93e8('0x45')]({'where':{'name':_0x114ea4,'userProfileId':_0x78d35b[_0x93e8('0x4c')]},'raw':!![]})[_0x93e8('0x22')](function(_0x26cb80){if(_0x26cb80&&_0x26cb80['autoAssociation']===0x0){return db['UserProfileResource'][_0x93e8('0x46')]({'name':_0x1837ed[_0x93e8('0x28')],'resourceId':_0x1837ed['id'],'type':_0x26cb80['name'],'sectionId':_0x26cb80['id']},{})['then'](function(){return _0x1fd6de;});}else{return _0x1fd6de;}})['catch'](function(_0x389df4){logger[_0x93e8('0x26')](_0x93e8('0x4d'),_0x389df4);throw _0x389df4;});}return _0x1fd6de;})[_0x93e8('0x22')](respondWithResult(_0x4fe99a,0xc9))[_0x93e8('0x41')](handleError(_0x4fe99a,null));};exports[_0x93e8('0x20')]=function(_0x2d2b7f,_0x51b5a1){if(_0x2d2b7f[_0x93e8('0x47')]['id']){delete _0x2d2b7f[_0x93e8('0x47')]['id'];}return db[_0x93e8('0x2b')]['find']({'where':{'id':_0x2d2b7f[_0x93e8('0x42')]['id']}})[_0x93e8('0x22')](handleEntityNotFound(_0x51b5a1,null))[_0x93e8('0x22')](saveUpdates(_0x2d2b7f['body'],null))['then'](respondWithResult(_0x51b5a1,null))[_0x93e8('0x41')](handleError(_0x51b5a1,null));};exports['destroy']=function(_0xc60f0a,_0xccb513){return db[_0x93e8('0x2b')][_0x93e8('0x45')]({'where':{'id':_0xc60f0a[_0x93e8('0x42')]['id']}})['then'](handleEntityNotFound(_0xccb513,null))[_0x93e8('0x22')](removeEntity(_0xccb513,null))[_0x93e8('0x41')](handleError(_0xccb513,null));};exports['describe']=function(_0x3dfd4b,_0x28cc8b){return db[_0x93e8('0x2b')]['describe']()[_0x93e8('0x22')](respondWithResult(_0x28cc8b,null))['catch'](handleError(_0x28cc8b,null));};exports[_0x93e8('0x4e')]=function(_0xa0d379,_0x332f41,_0xb98850){return db[_0x93e8('0x4f')][_0x93e8('0x45')]({'where':{'id':_0xa0d379[_0x93e8('0x42')]['id']}})['then'](handleEntityNotFound(_0x332f41,null))[_0x93e8('0x22')](function(_0x2c67ec){if(_0x2c67ec){return _0x2c67ec[_0x93e8('0x4e')](_0xa0d379[_0x93e8('0x47')][_0x93e8('0x50')],_[_0x93e8('0x51')](_0xa0d379['body'],[_0x93e8('0x50'),'id'])||{});}})[_0x93e8('0x22')](respondWithResult(_0x332f41,null))['catch'](handleError(_0x332f41,null));};exports[_0x93e8('0x52')]=function(_0x3df805,_0x5b395b,_0x30e631){var _0x18feff={};var _0x425605={};var _0x3862a6;var _0x373d0a;return db[_0x93e8('0x2b')][_0x93e8('0x53')]({'where':{'id':_0x3df805[_0x93e8('0x42')]['id']}})['then'](handleEntityNotFound(_0x5b395b,null))[_0x93e8('0x22')](function(_0x15a008){if(_0x15a008){_0x3862a6=_0x15a008;_0x425605[_0x93e8('0x2d')]=_[_0x93e8('0x2e')](db[_0x93e8('0x4f')]['rawAttributes']);_0x425605[_0x93e8('0x2f')]=_[_0x93e8('0x2e')](_0x3df805[_0x93e8('0x2f')]);_0x425605[_0x93e8('0x39')]=_[_0x93e8('0x30')](_0x425605[_0x93e8('0x2d')],_0x425605[_0x93e8('0x2f')]);_0x18feff[_0x93e8('0x31')]=_[_0x93e8('0x30')](_0x425605['model'],qs[_0x93e8('0x32')](_0x3df805[_0x93e8('0x2f')][_0x93e8('0x32')]));_0x18feff[_0x93e8('0x31')]=_0x18feff[_0x93e8('0x31')][_0x93e8('0x33')]?_0x18feff['attributes']:_0x425605[_0x93e8('0x2d')];_0x18feff['order']=qs[_0x93e8('0x37')](_0x3df805[_0x93e8('0x2f')][_0x93e8('0x37')]);_0x18feff[_0x93e8('0x38')]=qs[_0x93e8('0x39')](_[_0x93e8('0x54')](_0x3df805[_0x93e8('0x2f')],_0x425605[_0x93e8('0x39')]));if(_0x3df805[_0x93e8('0x2f')][_0x93e8('0x3a')]){_0x18feff['where']=_[_0x93e8('0x3b')](_0x18feff[_0x93e8('0x38')],{'$or':_[_0x93e8('0x3c')](_0x18feff['attributes'],function(_0x157c25){var _0x377d9b={};_0x377d9b[_0x157c25]={'$like':'%'+_0x3df805[_0x93e8('0x2f')][_0x93e8('0x3a')]+'%'};return _0x377d9b;})});}_0x18feff=_[_0x93e8('0x3b')]({},_0x18feff,_0x3df805['options']);return _0x3862a6[_0x93e8('0x52')](_0x18feff);}})[_0x93e8('0x22')](function(_0x1244ce){if(_0x1244ce){_0x373d0a=_0x1244ce[_0x93e8('0x33')];if(!_0x3df805[_0x93e8('0x2f')]['hasOwnProperty'](_0x93e8('0x35'))){_0x18feff['limit']=qs[_0x93e8('0x1a')](_0x3df805[_0x93e8('0x2f')][_0x93e8('0x1a')]);_0x18feff[_0x93e8('0x18')]=qs[_0x93e8('0x18')](_0x3df805['query'][_0x93e8('0x18')]);}return _0x3862a6[_0x93e8('0x52')](_0x18feff);}})['then'](function(_0x5f5a18){if(_0x5f5a18){return _0x5f5a18?{'count':_0x373d0a,'rows':_0x5f5a18}:null;}})['then'](respondWithResult(_0x5b395b,null))[_0x93e8('0x41')](handleError(_0x5b395b,null));};
\ No newline at end of file
+var _0x27e4=['attributes','length','hasOwnProperty','order','sort','where','pick','filters','merge','map','filter','includeAll','include','findAll','rows','show','rawAttributes','options','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','params','ids','omit','findOne','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','destroy','then','UserProfileResource','error','stack','name','index','CmCompany','describe','model','query','keys','intersection','fields'];(function(_0x34063f,_0x55bb48){var _0x509b9e=function(_0x32f598){while(--_0x32f598){_0x34063f['push'](_0x34063f['shift']());}};_0x509b9e(++_0x55bb48);}(_0x27e4,0x18c));var _0x427e=function(_0x566a23,_0x5f3e1d){_0x566a23=_0x566a23-0x0;var _0x3d033a=_0x27e4[_0x566a23];return _0x3d033a;};'use strict';var emlformat=require(_0x427e('0x0'));var rimraf=require(_0x427e('0x1'));var zipdir=require(_0x427e('0x2'));var jsonpatch=require(_0x427e('0x3'));var rp=require(_0x427e('0x4'));var moment=require(_0x427e('0x5'));var BPromise=require(_0x427e('0x6'));var Mustache=require(_0x427e('0x7'));var util=require(_0x427e('0x8'));var path=require('path');var sox=require(_0x427e('0x9'));var csv=require(_0x427e('0xa'));var ejs=require(_0x427e('0xb'));var fs=require('fs');var fs_extra=require(_0x427e('0xc'));var _=require('lodash');var squel=require(_0x427e('0xd'));var crypto=require('crypto');var jsforce=require(_0x427e('0xe'));var deskjs=require(_0x427e('0xf'));var toCsv=require('to-csv');var querystring=require(_0x427e('0x10'));var Papa=require('papaparse');var Redis=require(_0x427e('0x11'));var authService=require(_0x427e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x427e('0x13'));var hardwareService=require(_0x427e('0x14'));var logger=require(_0x427e('0x15'))(_0x427e('0x16'));var utils=require(_0x427e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x427e('0x18'));var db=require(_0x427e('0x19'))['db'];function respondWithStatusCode(_0x5764b7,_0x183228){_0x183228=_0x183228||0xcc;return function(_0x6522b7){if(_0x6522b7){return _0x5764b7[_0x427e('0x1a')](_0x183228);}return _0x5764b7[_0x427e('0x1b')](_0x183228)[_0x427e('0x1c')]();};}function respondWithResult(_0x1127a1,_0x4e2446){_0x4e2446=_0x4e2446||0xc8;return function(_0xfc052d){if(_0xfc052d){return _0x1127a1['status'](_0x4e2446)['json'](_0xfc052d);}};}function respondWithFilteredResult(_0x290868,_0x5062de){return function(_0x1c7379){if(_0x1c7379){var _0x23a35a=typeof _0x5062de['offset']===_0x427e('0x1d')&&typeof _0x5062de[_0x427e('0x1e')]===_0x427e('0x1d');var _0x3fd9c3=_0x1c7379['count'];var _0x57ea9d=_0x23a35a?0x0:_0x5062de[_0x427e('0x1f')];var _0x512a38=_0x23a35a?_0x1c7379[_0x427e('0x20')]:_0x5062de[_0x427e('0x1f')]+_0x5062de[_0x427e('0x1e')];var _0x44722d;if(_0x512a38>=_0x3fd9c3){_0x512a38=_0x3fd9c3;_0x44722d=0xc8;}else{_0x44722d=0xce;}_0x290868['status'](_0x44722d);return _0x290868[_0x427e('0x21')](_0x427e('0x22'),_0x57ea9d+'-'+_0x512a38+'/'+_0x3fd9c3)[_0x427e('0x23')](_0x1c7379);}return null;};}function patchUpdates(_0xb2b594){return function(_0x1a3c14){try{jsonpatch[_0x427e('0x24')](_0x1a3c14,_0xb2b594,!![]);}catch(_0x6616bb){return BPromise[_0x427e('0x25')](_0x6616bb);}return _0x1a3c14[_0x427e('0x26')]();};}function saveUpdates(_0x2343cd,_0x83ac2e){return function(_0x34ff00){if(_0x34ff00){return _0x34ff00[_0x427e('0x27')](_0x2343cd)['then'](function(_0x52848a){return _0x52848a;});}return null;};}function removeEntity(_0x1e15d6,_0x3f3d19){return function(_0x33306e){if(_0x33306e){return _0x33306e[_0x427e('0x28')]()[_0x427e('0x29')](function(){var _0x2a1ef2=_0x33306e['get']({'plain':!![]});var _0x38dae2='Companies';return db[_0x427e('0x2a')]['destroy']({'where':{'type':_0x38dae2,'resourceId':_0x2a1ef2['id']}})['then'](function(){return _0x33306e;});})[_0x427e('0x29')](function(){_0x1e15d6[_0x427e('0x1b')](0xcc)[_0x427e('0x1c')]();});}};}function handleEntityNotFound(_0x414617,_0x2df916){return function(_0x3be449){if(!_0x3be449){_0x414617['sendStatus'](0x194);}return _0x3be449;};}function handleError(_0x506004,_0x38f082){_0x38f082=_0x38f082||0x1f4;return function(_0x229eda){logger[_0x427e('0x2b')](_0x229eda[_0x427e('0x2c')]);if(_0x229eda[_0x427e('0x2d')]){delete _0x229eda[_0x427e('0x2d')];}_0x506004['status'](_0x38f082)['send'](_0x229eda);};}exports[_0x427e('0x2e')]=function(_0x472359,_0x1835b4){var _0x2da28c={},_0x314c53={},_0x26b477={'count':0x0,'rows':[]};return db[_0x427e('0x2f')][_0x427e('0x30')]()[_0x427e('0x29')](function(_0x1c14e1){_0x314c53[_0x427e('0x31')]=_['keys'](_0x1c14e1);_0x314c53[_0x427e('0x32')]=_[_0x427e('0x33')](_0x472359[_0x427e('0x32')]);_0x314c53['filters']=_[_0x427e('0x34')](_0x314c53['model'],_0x314c53[_0x427e('0x32')]);_0x2da28c['attributes']=_[_0x427e('0x34')](_0x314c53[_0x427e('0x31')],qs[_0x427e('0x35')](_0x472359[_0x427e('0x32')][_0x427e('0x35')]));_0x2da28c[_0x427e('0x36')]=_0x2da28c[_0x427e('0x36')][_0x427e('0x37')]?_0x2da28c[_0x427e('0x36')]:_0x314c53[_0x427e('0x31')];if(!_0x472359['query'][_0x427e('0x38')]('nolimit')){_0x2da28c[_0x427e('0x1e')]=qs['limit'](_0x472359[_0x427e('0x32')][_0x427e('0x1e')]);_0x2da28c[_0x427e('0x1f')]=qs[_0x427e('0x1f')](_0x472359[_0x427e('0x32')][_0x427e('0x1f')]);}_0x2da28c[_0x427e('0x39')]=qs[_0x427e('0x3a')](_0x472359[_0x427e('0x32')][_0x427e('0x3a')]);_0x2da28c[_0x427e('0x3b')]=qs['filters'](_[_0x427e('0x3c')](_0x472359[_0x427e('0x32')],_0x314c53[_0x427e('0x3d')]),_0x1c14e1);if(_0x472359['query']['filter']){_0x2da28c[_0x427e('0x3b')]=_[_0x427e('0x3e')](_0x2da28c[_0x427e('0x3b')],{'$or':_[_0x427e('0x3f')](_0x2da28c[_0x427e('0x36')],function(_0x5f44cf){var _0x247621={};_0x247621[_0x5f44cf]={'$like':'%'+_0x472359[_0x427e('0x32')][_0x427e('0x40')]+'%'};return _0x247621;})});}_0x2da28c=_[_0x427e('0x3e')]({},_0x2da28c,_0x472359['options']);var _0x165728={'where':_0x2da28c[_0x427e('0x3b')]};return db[_0x427e('0x2f')][_0x427e('0x20')](_0x165728)['then'](function(_0xb96c19){_0x26b477['count']=_0xb96c19;if(_0x472359[_0x427e('0x32')][_0x427e('0x41')]){_0x2da28c[_0x427e('0x42')]=[{'all':!![]}];}return db['CmCompany'][_0x427e('0x43')](_0x2da28c);})['then'](function(_0x4058e7){_0x26b477[_0x427e('0x44')]=_0x4058e7;return _0x26b477;})['then'](respondWithFilteredResult(_0x1835b4,_0x2da28c))['catch'](handleError(_0x1835b4,null));})['catch'](handleError(_0x1835b4,null));};exports[_0x427e('0x45')]=function(_0x51c388,_0x3818e6){var _0x3ac8ea={'raw':![],'where':{'id':_0x51c388['params']['id']}},_0x315d05={};_0x315d05[_0x427e('0x31')]=_[_0x427e('0x33')](db['CmCompany'][_0x427e('0x46')]);_0x315d05[_0x427e('0x32')]=_['keys'](_0x51c388[_0x427e('0x32')]);_0x315d05['filters']=_[_0x427e('0x34')](_0x315d05[_0x427e('0x31')],_0x315d05[_0x427e('0x32')]);_0x3ac8ea[_0x427e('0x36')]=_['intersection'](_0x315d05[_0x427e('0x31')],qs['fields'](_0x51c388[_0x427e('0x32')]['fields']));_0x3ac8ea[_0x427e('0x36')]=_0x3ac8ea[_0x427e('0x36')][_0x427e('0x37')]?_0x3ac8ea[_0x427e('0x36')]:_0x315d05[_0x427e('0x31')];if(_0x51c388['query']['includeAll']){_0x3ac8ea[_0x427e('0x42')]=[{'all':!![]}];}_0x3ac8ea=_[_0x427e('0x3e')]({},_0x3ac8ea,_0x51c388[_0x427e('0x47')]);return db[_0x427e('0x2f')]['find'](_0x3ac8ea)['then'](handleEntityNotFound(_0x3818e6,null))['then'](respondWithResult(_0x3818e6,null))[_0x427e('0x48')](handleError(_0x3818e6,null));};exports[_0x427e('0x49')]=function(_0x5b6795,_0x52d2d8){return db['CmCompany']['create'](_0x5b6795[_0x427e('0x4a')],{})[_0x427e('0x29')](function(_0x3f0be9){var _0x1b0a3a=_0x5b6795[_0x427e('0x4b')][_0x427e('0x4c')]({'plain':!![]});if(!_0x1b0a3a)throw new Error(_0x427e('0x4d'));if(_0x1b0a3a[_0x427e('0x4e')]===_0x427e('0x4b')){var _0x2cf7f9=_0x3f0be9[_0x427e('0x4c')]({'plain':!![]});var _0xbeb2b5='Companies';return db['UserProfileSection'][_0x427e('0x4f')]({'where':{'name':_0xbeb2b5,'userProfileId':_0x1b0a3a[_0x427e('0x50')]},'raw':!![]})[_0x427e('0x29')](function(_0x1cb591){if(_0x1cb591&&_0x1cb591[_0x427e('0x51')]===0x0){return db[_0x427e('0x2a')][_0x427e('0x49')]({'name':_0x2cf7f9[_0x427e('0x2d')],'resourceId':_0x2cf7f9['id'],'type':_0x1cb591[_0x427e('0x2d')],'sectionId':_0x1cb591['id']},{})[_0x427e('0x29')](function(){return _0x3f0be9;});}else{return _0x3f0be9;}})[_0x427e('0x48')](function(_0x183e71){logger[_0x427e('0x2b')](_0x427e('0x52'),_0x183e71);throw _0x183e71;});}return _0x3f0be9;})[_0x427e('0x29')](respondWithResult(_0x52d2d8,0xc9))[_0x427e('0x48')](handleError(_0x52d2d8,null));};exports[_0x427e('0x27')]=function(_0x20558d,_0x2b1dba){if(_0x20558d[_0x427e('0x4a')]['id']){delete _0x20558d[_0x427e('0x4a')]['id'];}return db[_0x427e('0x2f')][_0x427e('0x4f')]({'where':{'id':_0x20558d['params']['id']}})[_0x427e('0x29')](handleEntityNotFound(_0x2b1dba,null))[_0x427e('0x29')](saveUpdates(_0x20558d['body'],null))[_0x427e('0x29')](respondWithResult(_0x2b1dba,null))[_0x427e('0x48')](handleError(_0x2b1dba,null));};exports[_0x427e('0x28')]=function(_0x42e4f4,_0x2cc59d){return db[_0x427e('0x2f')][_0x427e('0x4f')]({'where':{'id':_0x42e4f4['params']['id']}})[_0x427e('0x29')](handleEntityNotFound(_0x2cc59d,null))[_0x427e('0x29')](removeEntity(_0x2cc59d,null))[_0x427e('0x48')](handleError(_0x2cc59d,null));};exports['describe']=function(_0x9c17e0,_0x3148a3){return db[_0x427e('0x2f')][_0x427e('0x30')]()[_0x427e('0x29')](respondWithResult(_0x3148a3,null))['catch'](handleError(_0x3148a3,null));};exports[_0x427e('0x53')]=function(_0xe1e07d,_0x57a92f,_0x36f8de){return db[_0x427e('0x54')][_0x427e('0x4f')]({'where':{'id':_0xe1e07d[_0x427e('0x55')]['id']}})[_0x427e('0x29')](handleEntityNotFound(_0x57a92f,null))[_0x427e('0x29')](function(_0x4bc0de){if(_0x4bc0de){return _0x4bc0de['addContacts'](_0xe1e07d[_0x427e('0x4a')][_0x427e('0x56')],_[_0x427e('0x57')](_0xe1e07d[_0x427e('0x4a')],[_0x427e('0x56'),'id'])||{});}})[_0x427e('0x29')](respondWithResult(_0x57a92f,null))[_0x427e('0x48')](handleError(_0x57a92f,null));};exports['getContacts']=function(_0x41a7eb,_0x55df5e,_0x12abfd){var _0x321c45={};var _0x4332df={};var _0x2ef444;var _0x43fb76;return db[_0x427e('0x2f')][_0x427e('0x58')]({'where':{'id':_0x41a7eb[_0x427e('0x55')]['id']}})[_0x427e('0x29')](handleEntityNotFound(_0x55df5e,null))[_0x427e('0x29')](function(_0x374305){if(_0x374305){_0x2ef444=_0x374305;_0x4332df[_0x427e('0x31')]=_[_0x427e('0x33')](db['CmContact'][_0x427e('0x46')]);_0x4332df[_0x427e('0x32')]=_[_0x427e('0x33')](_0x41a7eb[_0x427e('0x32')]);_0x4332df['filters']=_[_0x427e('0x34')](_0x4332df[_0x427e('0x31')],_0x4332df[_0x427e('0x32')]);_0x321c45[_0x427e('0x36')]=_['intersection'](_0x4332df['model'],qs['fields'](_0x41a7eb[_0x427e('0x32')][_0x427e('0x35')]));_0x321c45['attributes']=_0x321c45['attributes'][_0x427e('0x37')]?_0x321c45[_0x427e('0x36')]:_0x4332df['model'];_0x321c45[_0x427e('0x39')]=qs[_0x427e('0x3a')](_0x41a7eb[_0x427e('0x32')][_0x427e('0x3a')]);_0x321c45[_0x427e('0x3b')]=qs[_0x427e('0x3d')](_['pick'](_0x41a7eb[_0x427e('0x32')],_0x4332df[_0x427e('0x3d')]));if(_0x41a7eb['query']['filter']){_0x321c45[_0x427e('0x3b')]=_[_0x427e('0x3e')](_0x321c45[_0x427e('0x3b')],{'$or':_['map'](_0x321c45['attributes'],function(_0x308d00){var _0x3a697e={};_0x3a697e[_0x308d00]={'$like':'%'+_0x41a7eb[_0x427e('0x32')]['filter']+'%'};return _0x3a697e;})});}_0x321c45=_[_0x427e('0x3e')]({},_0x321c45,_0x41a7eb[_0x427e('0x47')]);return _0x2ef444[_0x427e('0x59')](_0x321c45);}})[_0x427e('0x29')](function(_0x76d48e){if(_0x76d48e){_0x43fb76=_0x76d48e[_0x427e('0x37')];if(!_0x41a7eb[_0x427e('0x32')][_0x427e('0x38')]('nolimit')){_0x321c45[_0x427e('0x1e')]=qs['limit'](_0x41a7eb['query']['limit']);_0x321c45[_0x427e('0x1f')]=qs['offset'](_0x41a7eb[_0x427e('0x32')][_0x427e('0x1f')]);}return _0x2ef444['getContacts'](_0x321c45);}})[_0x427e('0x29')](function(_0x46ce85){if(_0x46ce85){return _0x46ce85?{'count':_0x43fb76,'rows':_0x46ce85}:null;}})[_0x427e('0x29')](respondWithResult(_0x55df5e,null))[_0x427e('0x48')](handleError(_0x55df5e,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 040e890..6e13cd7 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 _0x0ed7=['api','moment','bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger'];(function(_0x598ac5,_0x11aa0e){var _0x317e7f=function(_0x487a5a){while(--_0x487a5a){_0x598ac5['push'](_0x598ac5['shift']());}};_0x317e7f(++_0x11aa0e);}(_0x0ed7,0x1d9));var _0x70ed=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x0ed7[_0x5317b5];return _0x3b7ce2;};'use strict';var _=require(_0x70ed('0x0'));var util=require(_0x70ed('0x1'));var logger=require(_0x70ed('0x2'))(_0x70ed('0x3'));var moment=require(_0x70ed('0x4'));var BPromise=require(_0x70ed('0x5'));var rp=require(_0x70ed('0x6'));var fs=require('fs');var path=require(_0x70ed('0x7'));var rimraf=require('rimraf');var config=require(_0x70ed('0x8'));var attributes=require(_0x70ed('0x9'));module[_0x70ed('0xa')]=function(_0x285d70,_0x2159c6){return _0x285d70[_0x70ed('0xb')](_0x70ed('0xc'),attributes,{'tableName':_0x70ed('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x623f=['./cmCompany.attributes','exports','define','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x8bf685,_0x1cb3c7){var _0xd13234=function(_0x343121){while(--_0x343121){_0x8bf685['push'](_0x8bf685['shift']());}};_0xd13234(++_0x1cb3c7);}(_0x623f,0x19a));var _0xf623=function(_0x4cc053,_0x2a65b0){_0x4cc053=_0x4cc053-0x0;var _0x10ddf6=_0x623f[_0x4cc053];return _0x10ddf6;};'use strict';var _=require(_0xf623('0x0'));var util=require(_0xf623('0x1'));var logger=require(_0xf623('0x2'))('api');var moment=require(_0xf623('0x3'));var BPromise=require(_0xf623('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf623('0x5'));var rimraf=require(_0xf623('0x6'));var config=require(_0xf623('0x7'));var attributes=require(_0xf623('0x8'));module[_0xf623('0x9')]=function(_0x2b9260,_0x374b0d){return _0x2b9260[_0xf623('0xa')]('CmCompany',attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 1da5d89..49e6c9a 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 _0xc3b1=['result','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x916117,_0x3101da){var _0x5ddef9=function(_0x43136a){while(--_0x43136a){_0x916117['push'](_0x916117['shift']());}};_0x5ddef9(++_0x3101da);}(_0xc3b1,0x10f));var _0x1c3b=function(_0x2ecf13,_0x213a49){_0x2ecf13=_0x2ecf13-0x0;var _0x423a67=_0xc3b1[_0x2ecf13];return _0x423a67;};'use strict';var _=require(_0x1c3b('0x0'));var util=require('util');var moment=require(_0x1c3b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c3b('0x2'));var db=require(_0x1c3b('0x3'))['db'];var utils=require(_0x1c3b('0x4'));var logger=require(_0x1c3b('0x5'))('rpc');var config=require(_0x1c3b('0x6'));var jayson=require(_0x1c3b('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xa3b870,_0x1c53a9,_0x32ac49){return new BPromise(function(_0x261f47,_0x30a82d){return client[_0x1c3b('0x8')](_0xa3b870,_0x32ac49)[_0x1c3b('0x9')](function(_0x1ac37c){logger['info'](_0x1c3b('0xa'),_0x1c53a9,_0x1c3b('0xb'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x1c53a9,'request\x20sent',JSON[_0x1c3b('0xc')](_0x1ac37c));if(_0x1ac37c[_0x1c3b('0xd')]){if(_0x1ac37c['error'][_0x1c3b('0xe')]===0x1f4){logger[_0x1c3b('0xd')](_0x1c3b('0xa'),_0x1c53a9,_0x1ac37c[_0x1c3b('0xd')][_0x1c3b('0xf')]);return _0x30a82d(_0x1ac37c['error'][_0x1c3b('0xf')]);}logger[_0x1c3b('0xd')](_0x1c3b('0xa'),_0x1c53a9,_0x1ac37c[_0x1c3b('0xd')]['message']);return _0x261f47(_0x1ac37c[_0x1c3b('0xd')][_0x1c3b('0xf')]);}else{logger[_0x1c3b('0x10')](_0x1c3b('0xa'),_0x1c53a9,'request\x20sent');_0x261f47(_0x1ac37c[_0x1c3b('0x11')][_0x1c3b('0xf')]);}})['catch'](function(_0x6aafba){logger[_0x1c3b('0xd')](_0x1c3b('0xa'),_0x1c53a9,_0x6aafba);_0x30a82d(_0x6aafba);});});}
\ No newline at end of file
+var _0x44c4=['info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x5a612c,_0x33e310){var _0x4a8e51=function(_0x21f180){while(--_0x21f180){_0x5a612c['push'](_0x5a612c['shift']());}};_0x4a8e51(++_0x33e310);}(_0x44c4,0x13d));var _0x444c=function(_0x176e46,_0x298091){_0x176e46=_0x176e46-0x0;var _0x546a76=_0x44c4[_0x176e46];return _0x546a76;};'use strict';var _=require('lodash');var util=require(_0x444c('0x0'));var moment=require(_0x444c('0x1'));var BPromise=require(_0x444c('0x2'));var rs=require(_0x444c('0x3'));var fs=require('fs');var Redis=require(_0x444c('0x4'));var db=require(_0x444c('0x5'))['db'];var utils=require(_0x444c('0x6'));var logger=require('../../config/logger')(_0x444c('0x7'));var config=require(_0x444c('0x8'));var jayson=require(_0x444c('0x9'));var client=jayson[_0x444c('0xa')][_0x444c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4445ec,_0x4c83b2,_0xc679d0){return new BPromise(function(_0x5c8fc4,_0x5d0f99){return client['request'](_0x4445ec,_0xc679d0)[_0x444c('0xc')](function(_0x2fc491){logger[_0x444c('0xd')](_0x444c('0xe'),_0x4c83b2,_0x444c('0xf'));logger[_0x444c('0x10')](_0x444c('0x11'),_0x4c83b2,_0x444c('0xf'),JSON['stringify'](_0x2fc491));if(_0x2fc491[_0x444c('0x12')]){if(_0x2fc491[_0x444c('0x12')][_0x444c('0x13')]===0x1f4){logger[_0x444c('0x12')](_0x444c('0xe'),_0x4c83b2,_0x2fc491[_0x444c('0x12')][_0x444c('0x14')]);return _0x5d0f99(_0x2fc491['error'][_0x444c('0x14')]);}logger[_0x444c('0x12')](_0x444c('0xe'),_0x4c83b2,_0x2fc491[_0x444c('0x12')][_0x444c('0x14')]);return _0x5c8fc4(_0x2fc491[_0x444c('0x12')][_0x444c('0x14')]);}else{logger['info'](_0x444c('0xe'),_0x4c83b2,_0x444c('0xf'));_0x5c8fc4(_0x2fc491['result'][_0x444c('0x14')]);}})[_0x444c('0x15')](function(_0x5422f5){logger['error'](_0x444c('0xe'),_0x4c83b2,_0x5422f5);_0x5d0f99(_0x5422f5);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index e377ed0..da99dbd 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 _0xe2da=['../../config/environment','./cmCompany.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x53f152,_0x7e09db){var _0x54e658=function(_0x597bf0){while(--_0x597bf0){_0x53f152['push'](_0x53f152['shift']());}};_0x54e658(++_0x7e09db);}(_0xe2da,0xc8));var _0xae2d=function(_0x195e0b,_0x3c536b){_0x195e0b=_0x195e0b-0x0;var _0x3df39e=_0xe2da[_0x195e0b];return _0x3df39e;};'use strict';var multer=require(_0xae2d('0x0'));var util=require(_0xae2d('0x1'));var path=require(_0xae2d('0x2'));var timeout=require(_0xae2d('0x3'));var express=require(_0xae2d('0x4'));var router=express['Router']();var fs_extra=require(_0xae2d('0x5'));var auth=require(_0xae2d('0x6'));var interaction=require(_0xae2d('0x7'));var config=require(_0xae2d('0x8'));var controller=require(_0xae2d('0x9'));router[_0xae2d('0xa')]('/',auth['isAuthenticated'](),controller[_0xae2d('0xb')]);router['get'](_0xae2d('0xc'),auth[_0xae2d('0xd')](),controller[_0xae2d('0xe')]);router['get'](_0xae2d('0xf'),auth[_0xae2d('0xd')](),controller[_0xae2d('0x10')]);router[_0xae2d('0xa')](_0xae2d('0x11'),auth[_0xae2d('0xd')](),controller[_0xae2d('0x12')]);router[_0xae2d('0x13')]('/',auth[_0xae2d('0xd')](),controller[_0xae2d('0x14')]);router['post']('/:id/contacts',auth['isAuthenticated'](),controller[_0xae2d('0x15')]);router[_0xae2d('0x16')](_0xae2d('0xf'),auth[_0xae2d('0xd')](),controller['update']);router[_0xae2d('0x17')](_0xae2d('0xf'),auth[_0xae2d('0xd')](),controller[_0xae2d('0x18')]);module[_0xae2d('0x19')]=router;
\ No newline at end of file
+var _0xe485=['index','show','/:id/contacts','getContacts','post','create','addContacts','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated'];(function(_0x1a7cd1,_0x22824d){var _0x5553f6=function(_0x4537a6){while(--_0x4537a6){_0x1a7cd1['push'](_0x1a7cd1['shift']());}};_0x5553f6(++_0x22824d);}(_0xe485,0x114));var _0x5e48=function(_0x2e8651,_0x3da688){_0x2e8651=_0x2e8651-0x0;var _0x58949f=_0xe485[_0x2e8651];return _0x58949f;};'use strict';var multer=require(_0x5e48('0x0'));var util=require('util');var path=require(_0x5e48('0x1'));var timeout=require(_0x5e48('0x2'));var express=require(_0x5e48('0x3'));var router=express['Router']();var fs_extra=require(_0x5e48('0x4'));var auth=require(_0x5e48('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5e48('0x6'));var controller=require(_0x5e48('0x7'));router[_0x5e48('0x8')]('/',auth[_0x5e48('0x9')](),controller[_0x5e48('0xa')]);router['get']('/describe',auth[_0x5e48('0x9')](),controller['describe']);router[_0x5e48('0x8')]('/:id',auth[_0x5e48('0x9')](),controller[_0x5e48('0xb')]);router['get'](_0x5e48('0xc'),auth[_0x5e48('0x9')](),controller[_0x5e48('0xd')]);router[_0x5e48('0xe')]('/',auth[_0x5e48('0x9')](),controller[_0x5e48('0xf')]);router[_0x5e48('0xe')](_0x5e48('0xc'),auth[_0x5e48('0x9')](),controller[_0x5e48('0x10')]);router['put'](_0x5e48('0x11'),auth['isAuthenticated'](),controller[_0x5e48('0x12')]);router[_0x5e48('0x13')](_0x5e48('0x11'),auth[_0x5e48('0x9')](),controller[_0x5e48('0x14')]);module[_0x5e48('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 151d68c..cfa4a50 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 _0x1436=['NOW','sequelize','exports','STRING','TEXT','INTEGER','DATE'];(function(_0x47a385,_0x5d8781){var _0x31abb9=function(_0x210f7a){while(--_0x210f7a){_0x47a385['push'](_0x47a385['shift']());}};_0x31abb9(++_0x5d8781);}(_0x1436,0x1eb));var _0x6143=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x1436[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var Sequelize=require(_0x6143('0x0'));module[_0x6143('0x1')]={'firstName':{'type':Sequelize[_0x6143('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x6143('0x2')]},'street':{'type':Sequelize[_0x6143('0x2')]},'postalCode':{'type':Sequelize[_0x6143('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x6143('0x2')]},'description':{'type':Sequelize[_0x6143('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x6143('0x2')]},'fax':{'type':Sequelize[_0x6143('0x2')]},'email':{'type':Sequelize[_0x6143('0x2')]},'url':{'type':Sequelize[_0x6143('0x2')]},'facebook':{'type':Sequelize[_0x6143('0x2')]},'fb_data':{'type':Sequelize[_0x6143('0x2')]},'twitter':{'type':Sequelize[_0x6143('0x2')]},'skype':{'type':Sequelize[_0x6143('0x2')]},'teams':{'type':Sequelize[_0x6143('0x2')]},'viber':{'type':Sequelize[_0x6143('0x2')]},'line':{'type':Sequelize[_0x6143('0x2')]},'wechat':{'type':Sequelize[_0x6143('0x2')]},'telegram':{'type':Sequelize[_0x6143('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x6143('0x2')]},'priority':{'type':Sequelize[_0x6143('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x6143('0x5')],'defaultValue':Sequelize[_0x6143('0x6')]},'dialTimezone':{'type':Sequelize[_0x6143('0x2')]},'utcOffset':{'type':Sequelize[_0x6143('0x4')]}};
\ No newline at end of file
+var _0xf4c5=['NOW','lodash','sequelize','exports','STRING','INTEGER','UNSIGNED','DATE'];(function(_0x18bc72,_0x1b2062){var _0x3db2c0=function(_0x2c6256){while(--_0x2c6256){_0x18bc72['push'](_0x18bc72['shift']());}};_0x3db2c0(++_0x1b2062);}(_0xf4c5,0x1a9));var _0x5f4c=function(_0x1e393b,_0x355f6b){_0x1e393b=_0x1e393b-0x0;var _0x3d0bfe=_0xf4c5[_0x1e393b];return _0x3d0bfe;};'use strict';var _=require(_0x5f4c('0x0'));var Sequelize=require(_0x5f4c('0x1'));module[_0x5f4c('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x5f4c('0x3')]},'street':{'type':Sequelize[_0x5f4c('0x3')]},'postalCode':{'type':Sequelize[_0x5f4c('0x3')]},'city':{'type':Sequelize[_0x5f4c('0x3')]},'country':{'type':Sequelize[_0x5f4c('0x3')]},'dateOfBirth':{'type':Sequelize[_0x5f4c('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x5f4c('0x3')]},'fax':{'type':Sequelize[_0x5f4c('0x3')]},'email':{'type':Sequelize[_0x5f4c('0x3')]},'url':{'type':Sequelize[_0x5f4c('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x5f4c('0x3')]},'twitter':{'type':Sequelize[_0x5f4c('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x5f4c('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x5f4c('0x3')]},'telegram':{'type':Sequelize[_0x5f4c('0x3')]},'UserId':{'type':Sequelize[_0x5f4c('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x5f4c('0x3')]},'priority':{'type':Sequelize[_0x5f4c('0x4')](0x2)[_0x5f4c('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x5f4c('0x6')],'defaultValue':Sequelize[_0x5f4c('0x7')]},'dialTimezone':{'type':Sequelize['STRING']},'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 9afd072..2ebf5f7 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 _0x658c=['range','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','type','destination','callerid','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','startCase','Website','closed','closedAt','secondDisposition','key','Owner','DESC','customerIp','customerPort','deviceModel','ratingMessage','ratingType','ratingValue','referer','subject','threadId','findAndCountAll','flatten','sortBy','reverse','moment','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','register','status','offset','limit','undefined','count','set','then','destroy','end','sendStatus','error','name','send','describe','getOptions','query','catch','CmContact','find','keys','startsWith','cf_','displayName','CmCustomField','findAll','length','columnName','alias','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','from','get','mergeWith','isArray','tags','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatInteraction','update','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','push','ListId','findOrCreate','spread','contact','all','show','Tag','Tags','tag','Phones','params','ContactItemType','ItemType','sequelize','literal','$and','omit','map','format','cf_%d','pickBy','isEmpty','cm_contacts','setFields','id\x20=\x20?','toParam','text','phone','CmHopper','findOne','model','filters','intersection','attributes','fields','order','sort','pick','filter','getTags','setTags','ids','setAdditionalPhones','item_types','items','ItemTypeId','description','OrderBy','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','rawAttributes','nolimit','ContactId','options','include','rows','getHopperHistories','getHopperFinals','includeAll','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','root','server/files/tmp','filename','chmodSync','0777','child_process','CompanyId','json','File\x20uploaded\x20correctly!','upload','createReadStream','file','import','User','agent','binding','No\x20firstName\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','fork','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','importUpdates','No\x20phone\x20column\x20specified','getJourney','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','includes','channel','toLowerCase'];(function(_0x46cf00,_0x457a43){var _0x3974dc=function(_0x4b5d0a){while(--_0x4b5d0a){_0x46cf00['push'](_0x46cf00['shift']());}};_0x3974dc(++_0x457a43);}(_0x658c,0x129));var _0xc658=function(_0x450210,_0x4cbf0f){_0x450210=_0x450210-0x0;var _0x541e23=_0x658c[_0x450210];return _0x541e23;};'use strict';var moment=require(_0xc658('0x0'));var BPromise=require(_0xc658('0x1'));var util=require(_0xc658('0x2'));var path=require(_0xc658('0x3'));var fs=require('fs');var _=require(_0xc658('0x4'));var squel=require(_0xc658('0x5'));var Papa=require(_0xc658('0x6'));var Redis=require(_0xc658('0x7'));var contacts=require(_0xc658('0x8'));var qs=require(_0xc658('0x9'));var logger=require(_0xc658('0xa'))(_0xc658('0xb'));var config=require(_0xc658('0xc'));var shared=require(_0xc658('0xd'));var db=require(_0xc658('0xe'))['db'];config[_0xc658('0xf')]=_[_0xc658('0x10')](config[_0xc658('0xf')],{'host':_0xc658('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc658('0xf')]));require('./cmContact.socket')[_0xc658('0x12')](socket);function respondWithResult(_0x184e10,_0x3b96fd){_0x3b96fd=_0x3b96fd||0xc8;return function(_0x4063ce){if(_0x4063ce){return _0x184e10[_0xc658('0x13')](_0x3b96fd)['json'](_0x4063ce);}};}function respondWithFilteredResult(_0x51087c,_0x1473f0){return function(_0x54b749){if(_0x54b749){var _0x1eb565=typeof _0x1473f0[_0xc658('0x14')]==='undefined'&&typeof _0x1473f0[_0xc658('0x15')]===_0xc658('0x16');var _0x44e447=_0x54b749[_0xc658('0x17')];var _0x5924fb=_0x1eb565?0x0:_0x1473f0[_0xc658('0x14')];var _0x5b90db=_0x1eb565?_0x54b749[_0xc658('0x17')]:_0x1473f0[_0xc658('0x14')]+_0x1473f0['limit'];var _0xb6f390;if(_0x5b90db>=_0x44e447){_0x5b90db=_0x44e447;_0xb6f390=0xc8;}else{_0xb6f390=0xce;}_0x51087c[_0xc658('0x13')](_0xb6f390);return _0x51087c[_0xc658('0x18')]('Content-Range',_0x5924fb+'-'+_0x5b90db+'/'+_0x44e447)['json'](_0x54b749);}return null;};}function saveUpdates(_0xa0ad5){return function(_0x4a8d06){if(_0x4a8d06){return _0x4a8d06['update'](_0xa0ad5)[_0xc658('0x19')](function(_0x1c3d2f){return _0x1c3d2f;});}return null;};}function removeEntity(_0x3f6159){return function(_0x58ccfd){if(_0x58ccfd){return _0x58ccfd[_0xc658('0x1a')]()[_0xc658('0x19')](function(){_0x3f6159['status'](0xcc)[_0xc658('0x1b')]();});}};}function handleEntityNotFound(_0x1d40d5){return function(_0x1f76d6){if(!_0x1f76d6){_0x1d40d5[_0xc658('0x1c')](0x194);}return _0x1f76d6;};}function handleError(_0x5a476c,_0x4cd9b8){_0x4cd9b8=_0x4cd9b8||0x1f4;return function(_0x31d8f9){logger[_0xc658('0x1d')](_0x31d8f9['stack']);if(_0x31d8f9[_0xc658('0x1e')]){delete _0x31d8f9[_0xc658('0x1e')];}_0x5a476c[_0xc658('0x13')](_0x4cd9b8)[_0xc658('0x1f')](_0x31d8f9);};}exports['index']=function(_0x59e8d0,_0x342c1f){var _0x4b550b={};return contacts[_0xc658('0x20')]()[_0xc658('0x19')](function(_0x10e920){_0x4b550b=qs[_0xc658('0x21')](_0x10e920,_0x59e8d0);return contacts['findAll'](_0x59e8d0[_0xc658('0x22')],_0x59e8d0['user'],_0x4b550b,_0x10e920);})[_0xc658('0x19')](respondWithFilteredResult(_0x342c1f,_0x4b550b))[_0xc658('0x23')](handleError(_0x342c1f,null));};exports['destroy']=function(_0x58acfd,_0x1c9388){return db[_0xc658('0x24')][_0xc658('0x25')]({'where':{'id':_0x58acfd['params']['id']}})[_0xc658('0x19')](handleEntityNotFound(_0x1c9388,null))['then'](removeEntity(_0x1c9388,null))[_0xc658('0x23')](handleError(_0x1c9388,null));};exports['describe']=function(_0x4705d4,_0x3e3e6b){return db[_0xc658('0x24')][_0xc658('0x20')]()[_0xc658('0x19')](function(_0x3338ae){delete _0x3338ae['tags'];for(var _0x4336e8=0x0;_0x4336e8
','generateXOAuth2Token','user=','base64','moment','randomstring','path','../../../config/logger','email','head','address','generate','value','name','indexOf','length','slice','join','Anonymous','split','pop','anonymous','@xcally.com','html','replace','\x20[Attachment:\x20'];(function(_0x1e028c,_0x2bd5b0){var _0x336831=function(_0x506de1){while(--_0x506de1){_0x1e028c['push'](_0x1e028c['shift']());}};_0x336831(++_0x2bd5b0);}(_0x1794,0x69));var _0x4179=function(_0x1aa552,_0x3ac508){_0x1aa552=_0x1aa552-0x0;var _0x4a773d=_0x1794[_0x1aa552];return _0x4a773d;};'use strict';var _=require('lodash');var moment=require(_0x4179('0x0'));var random=require(_0x4179('0x1'));var fs=require('fs');var path=require(_0x4179('0x2'));var util=require('util');var tnef=require('node-tnef');var logger=require(_0x4179('0x3'))(_0x4179('0x4'));var config=require('../../../config/environment');function getAddress(_0x68ede7){var _0x139d2a=_[_0x4179('0x5')](_0x68ede7['value']);return _0x139d2a&&_0x139d2a[_0x4179('0x6')]?_0x139d2a[_0x4179('0x6')]:'anonymous'+random[_0x4179('0x7')](0x6)+'@xcally.com';}function getFirstName(_0x198019){var _0x54c5a9=_[_0x4179('0x5')](_0x198019[_0x4179('0x8')]);if(_0x54c5a9&&_0x54c5a9[_0x4179('0x9')]){if(_0x54c5a9['name']==_0x54c5a9[_0x4179('0x6')]){return _0x54c5a9['name']['substring'](0x0,_0x54c5a9[_0x4179('0x9')][_0x4179('0xa')]('@'));}var _0x52bcdd=_0x54c5a9[_0x4179('0x9')]['split'](/\s+/);return _0x52bcdd[_0x4179('0xb')]>0x1?_0x52bcdd[_0x4179('0xc')](0x0,-0x1)[_0x4179('0xd')]('\x20'):_0x54c5a9[_0x4179('0x9')];}return _0x4179('0xe');}function getLastName(_0x4a65fb){var _0x1138bc=_['head'](_0x4a65fb[_0x4179('0x8')]);if(_0x1138bc&&_0x1138bc['name']){var _0x5370f0=_0x1138bc[_0x4179('0x9')][_0x4179('0xf')](/\s+/);return _0x5370f0[_0x4179('0xb')]>0x1?_0x5370f0[_0x4179('0x10')]():'';}return'';}function getMails(_0x45a762,_0x388ca1){var _0xda12a7='';for(var _0x284b4c=0x0;_0x284b4c<_0x388ca1[_0x4179('0x8')][_0x4179('0xb')];_0x284b4c+=0x1){if(_0x388ca1[_0x4179('0x8')][_0x284b4c]['address']!==_0x45a762){if(!_['isEmpty'](_0xda12a7)){_0xda12a7+=',';}_0xda12a7+=_0x388ca1[_0x4179('0x8')][_0x284b4c][_0x4179('0x9')]||_0x388ca1[_0x4179('0x8')][_0x284b4c]['address']||'';_0xda12a7+='\x20<';_0xda12a7+=_0x388ca1[_0x4179('0x8')][_0x284b4c][_0x4179('0x6')]?_0x388ca1['value'][_0x284b4c][_0x4179('0x6')]:_0x4179('0x11')+random[_0x4179('0x7')](0x6)+_0x4179('0x12');_0xda12a7+='>';}}return _0xda12a7;}function parseEmail(_0x25a903,_0x267bec,_0x3efb9a){if(_0x267bec['html']){var _0x451fb7=/