From: support
Date: Tue, 25 Oct 2022 08:59:20 +0000 (+0000)
Subject: Built motion from commit 15aa0e42.|2.6.19
X-Git-Url: http://repos.xcallymotion.com/base//%22http:/google.github.io/material-design-icons?a=commitdiff_plain;h=a96b461e453c02590c5297ecf9aa17f082231bc0;p=motion2.git
Built motion from commit 15aa0e42.|2.6.19
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index b90dd24..362f09e 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-10-24T16:17:15.617Z",
+ "time": "2022-10-25T08:51:37.014Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 18ef972..2cd8d23 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-10-24T16:17:15.617Z",
+ "time": "2022-10-25T08:51:37.014Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index c4d3a3b..1c5c9e0 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 _0xc360=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','VIRTUAL','getDataValue','action','contactManager','integration','jscripty','urlForward','browser','script'];(function(_0x2b1e99,_0xcb3464){var _0x99721b=function(_0x242133){while(--_0x242133){_0x2b1e99['push'](_0x2b1e99['shift']());}};_0x99721b(++_0xcb3464);}(_0xc360,0x15f));var _0x0c36=function(_0x2b24d0,_0x49b3d7){_0x2b24d0=_0x2b24d0-0x0;var _0x1a2482=_0xc360[_0x2b24d0];return _0x1a2482;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0c36('0x0')],'get':function(_0x1d1cff){return this[_0x0c36('0x1')](_0x0c36('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x0c36('0x3'),_0x0c36('0x4'),'motionbar',_0x0c36('0x5'),_0x0c36('0x6'),_0x0c36('0x7'),'bot',_0x0c36('0x8')]],'msg':_0x0c36('0x9')}},'comment':_0x0c36('0x9')},'data1':{'type':Sequelize[_0x0c36('0xa')](0x1000),'comment':_0x0c36('0xb')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x0c36('0xc')},'data3':{'type':Sequelize[_0x0c36('0xa')](0x1000),'comment':_0x0c36('0xd')},'data4':{'type':Sequelize[_0x0c36('0xa')](0x1000),'comments':_0x0c36('0xe')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x0c36('0xf')},'data6':{'type':Sequelize[_0x0c36('0xa')],'comments':_0x0c36('0x10')},'data7':{'type':Sequelize['TEXT'],'comments':_0x0c36('0x11')}};
\ No newline at end of file
+var _0x9fe3=['urlForward[headers],\x20browser[wsindowHeight]','sequelize','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'];(function(_0x3178ca,_0x133bc2){var _0x47d0d7=function(_0x4dabeb){while(--_0x4dabeb){_0x3178ca['push'](_0x3178ca['shift']());}};_0x47d0d7(++_0x133bc2);}(_0x9fe3,0x1b1));var _0x39fe=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x9fe3[_0xd0b415];return _0x2bdf2c;};'use strict';var Sequelize=require(_0x39fe('0x0'));module['exports']={'name':{'type':Sequelize[_0x39fe('0x1')],'get':function(_0x161312){return this[_0x39fe('0x2')](_0x39fe('0x3'));}},'action':{'type':Sequelize[_0x39fe('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x39fe('0x5'),_0x39fe('0x6'),_0x39fe('0x7'),_0x39fe('0x8'),'urlForward',_0x39fe('0x9'),'bot',_0x39fe('0xa')]],'msg':_0x39fe('0xb')}},'comment':_0x39fe('0xb')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x39fe('0xc')},'data2':{'type':Sequelize[_0x39fe('0x4')](0x1000),'comment':_0x39fe('0xd')},'data3':{'type':Sequelize[_0x39fe('0x4')](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[_0x39fe('0x4')](0x1000),'comments':_0x39fe('0xe')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x39fe('0x4')],'comments':_0x39fe('0xf')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 9de1314..d847e07 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 _0x714b=['destroy','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','send','body','Action','find','catch'];(function(_0x75b810,_0x5873cf){var _0x26de6b=function(_0x173af6){while(--_0x173af6){_0x75b810['push'](_0x75b810['shift']());}};_0x26de6b(++_0x5873cf);}(_0x714b,0xb1));var _0xb714=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x714b[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0xb714('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb714('0x1'));var jsonpatch=require(_0xb714('0x2'));var rp=require(_0xb714('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb714('0x4'));var util=require('util');var path=require(_0xb714('0x5'));var sox=require('sox');var csv=require(_0xb714('0x6'));var ejs=require(_0xb714('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb714('0x8'));var squel=require(_0xb714('0x9'));var crypto=require(_0xb714('0xa'));var jsforce=require(_0xb714('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb714('0x6'));var querystring=require(_0xb714('0xc'));var Papa=require(_0xb714('0xd'));var Redis=require('ioredis');var authService=require(_0xb714('0xe'));var qs=require(_0xb714('0xf'));var as=require(_0xb714('0x10'));var hardwareService=require(_0xb714('0x11'));var logger=require(_0xb714('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xb714('0x13'));var licenseUtil=require(_0xb714('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c08d8,_0x50d65e){_0x50d65e=_0x50d65e||0xcc;return function(_0x4d2bb1){if(_0x4d2bb1){return _0x5c08d8[_0xb714('0x15')](_0x50d65e);}return _0x5c08d8[_0xb714('0x16')](_0x50d65e)[_0xb714('0x17')]();};}function respondWithResult(_0x87a208,_0x44d97c){_0x44d97c=_0x44d97c||0xc8;return function(_0x1be75b){if(_0x1be75b){return _0x87a208['status'](_0x44d97c)['json'](_0x1be75b);}};}function respondWithFilteredResult(_0x28ce68,_0x4cc930){return function(_0x4c48d4){if(_0x4c48d4){var _0x37eef8=typeof _0x4cc930[_0xb714('0x18')]===_0xb714('0x19')&&typeof _0x4cc930[_0xb714('0x1a')]===_0xb714('0x19');var _0x395b09=_0x4c48d4[_0xb714('0x1b')];var _0x3ff7a8=_0x37eef8?0x0:_0x4cc930['offset'];var _0x27717a=_0x37eef8?_0x4c48d4[_0xb714('0x1b')]:_0x4cc930[_0xb714('0x18')]+_0x4cc930[_0xb714('0x1a')];var _0xc61033;if(_0x27717a>=_0x395b09){_0x27717a=_0x395b09;_0xc61033=0xc8;}else{_0xc61033=0xce;}_0x28ce68[_0xb714('0x16')](_0xc61033);return _0x28ce68[_0xb714('0x1c')](_0xb714('0x1d'),_0x3ff7a8+'-'+_0x27717a+'/'+_0x395b09)[_0xb714('0x1e')](_0x4c48d4);}return null;};}function patchUpdates(_0x580ee2){return function(_0x40209a){try{jsonpatch[_0xb714('0x1f')](_0x40209a,_0x580ee2,!![]);}catch(_0x3177c3){return BPromise[_0xb714('0x20')](_0x3177c3);}return _0x40209a[_0xb714('0x21')]();};}function saveUpdates(_0x2aebc0,_0x1eab52){return function(_0x4c8519){if(_0x4c8519){return _0x4c8519[_0xb714('0x22')](_0x2aebc0)[_0xb714('0x23')](function(_0x3f4ec8){return _0x3f4ec8;});}return null;};}function removeEntity(_0x4be929,_0x17e48b){return function(_0x510c10){if(_0x510c10){return _0x510c10['destroy']()[_0xb714('0x23')](function(){_0x4be929[_0xb714('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2206d0,_0x1b6a9e){return function(_0x68a7e9){if(!_0x68a7e9){_0x2206d0[_0xb714('0x15')](0x194);}return _0x68a7e9;};}function handleError(_0x128b1a,_0x4d7951){_0x4d7951=_0x4d7951||0x1f4;return function(_0x39d0d6){logger[_0xb714('0x24')](_0x39d0d6[_0xb714('0x25')]);if(_0x39d0d6['name']){delete _0x39d0d6['name'];}_0x128b1a[_0xb714('0x16')](_0x4d7951)[_0xb714('0x26')](_0x39d0d6);};}exports[_0xb714('0x22')]=function(_0x2fb1df,_0x1b4b3c){if(_0x2fb1df['body']['id']){delete _0x2fb1df[_0xb714('0x27')]['id'];}return db[_0xb714('0x28')][_0xb714('0x29')]({'where':{'id':_0x2fb1df['params']['id']}})['then'](handleEntityNotFound(_0x1b4b3c,null))[_0xb714('0x23')](saveUpdates(_0x2fb1df[_0xb714('0x27')],null))['then'](respondWithResult(_0x1b4b3c,null))[_0xb714('0x2a')](handleError(_0x1b4b3c,null));};exports[_0xb714('0x2b')]=function(_0xc780de,_0x4b6955){return db[_0xb714('0x28')]['find']({'where':{'id':_0xc780de['params']['id']}})[_0xb714('0x23')](handleEntityNotFound(_0x4b6955,null))[_0xb714('0x23')](removeEntity(_0x4b6955,null))['catch'](handleError(_0x4b6955,null));};
\ No newline at end of file
+var _0x44a3=['apply','reject','update','then','end','sendStatus','stack','name','send','body','Action','find','catch','destroy','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','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','status','json','offset','undefined','count','set','Content-Range'];(function(_0x34fedc,_0x30255f){var _0xbd34b=function(_0x25b598){while(--_0x25b598){_0x34fedc['push'](_0x34fedc['shift']());}};_0xbd34b(++_0x30255f);}(_0x44a3,0x1da));var _0x344a=function(_0x3a175b,_0x505d13){_0x3a175b=_0x3a175b-0x0;var _0x9b84fa=_0x44a3[_0x3a175b];return _0x9b84fa;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x344a('0x0'));var jsonpatch=require(_0x344a('0x1'));var rp=require(_0x344a('0x2'));var moment=require(_0x344a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x344a('0x4'));var util=require('util');var path=require(_0x344a('0x5'));var sox=require(_0x344a('0x6'));var csv=require(_0x344a('0x7'));var ejs=require(_0x344a('0x8'));var fs=require('fs');var fs_extra=require(_0x344a('0x9'));var _=require(_0x344a('0xa'));var squel=require(_0x344a('0xb'));var crypto=require(_0x344a('0xc'));var jsforce=require(_0x344a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x344a('0x7'));var querystring=require(_0x344a('0xe'));var Papa=require('papaparse');var Redis=require(_0x344a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x344a('0x10'));var as=require(_0x344a('0x11'));var hardwareService=require(_0x344a('0x12'));var logger=require(_0x344a('0x13'))(_0x344a('0x14'));var utils=require(_0x344a('0x15'));var config=require(_0x344a('0x16'));var licenseUtil=require(_0x344a('0x17'));var db=require(_0x344a('0x18'))['db'];function respondWithStatusCode(_0x4a7531,_0x2c7d22){_0x2c7d22=_0x2c7d22||0xcc;return function(_0xb87cbd){if(_0xb87cbd){return _0x4a7531['sendStatus'](_0x2c7d22);}return _0x4a7531['status'](_0x2c7d22)['end']();};}function respondWithResult(_0x5abb76,_0x2878cd){_0x2878cd=_0x2878cd||0xc8;return function(_0x4a4290){if(_0x4a4290){return _0x5abb76[_0x344a('0x19')](_0x2878cd)[_0x344a('0x1a')](_0x4a4290);}};}function respondWithFilteredResult(_0x4712ff,_0x87f28b){return function(_0x52509f){if(_0x52509f){var _0x22e8b3=typeof _0x87f28b[_0x344a('0x1b')]===_0x344a('0x1c')&&typeof _0x87f28b['limit']===_0x344a('0x1c');var _0x25c840=_0x52509f[_0x344a('0x1d')];var _0x3c8a8d=_0x22e8b3?0x0:_0x87f28b[_0x344a('0x1b')];var _0x3f5155=_0x22e8b3?_0x52509f[_0x344a('0x1d')]:_0x87f28b[_0x344a('0x1b')]+_0x87f28b['limit'];var _0x16b509;if(_0x3f5155>=_0x25c840){_0x3f5155=_0x25c840;_0x16b509=0xc8;}else{_0x16b509=0xce;}_0x4712ff['status'](_0x16b509);return _0x4712ff[_0x344a('0x1e')](_0x344a('0x1f'),_0x3c8a8d+'-'+_0x3f5155+'/'+_0x25c840)['json'](_0x52509f);}return null;};}function patchUpdates(_0x43fda4){return function(_0x482446){try{jsonpatch[_0x344a('0x20')](_0x482446,_0x43fda4,!![]);}catch(_0x1c9087){return BPromise[_0x344a('0x21')](_0x1c9087);}return _0x482446['save']();};}function saveUpdates(_0x44c9ed,_0x27c1f3){return function(_0x481cee){if(_0x481cee){return _0x481cee[_0x344a('0x22')](_0x44c9ed)['then'](function(_0x1cda8f){return _0x1cda8f;});}return null;};}function removeEntity(_0x228e58,_0x1a4aa3){return function(_0xbb9e5c){if(_0xbb9e5c){return _0xbb9e5c['destroy']()[_0x344a('0x23')](function(){_0x228e58[_0x344a('0x19')](0xcc)[_0x344a('0x24')]();});}};}function handleEntityNotFound(_0x23cd58,_0x39d12a){return function(_0x58de39){if(!_0x58de39){_0x23cd58[_0x344a('0x25')](0x194);}return _0x58de39;};}function handleError(_0xcafa41,_0x433fd6){_0x433fd6=_0x433fd6||0x1f4;return function(_0x34f1a4){logger['error'](_0x34f1a4[_0x344a('0x26')]);if(_0x34f1a4[_0x344a('0x27')]){delete _0x34f1a4[_0x344a('0x27')];}_0xcafa41[_0x344a('0x19')](_0x433fd6)[_0x344a('0x28')](_0x34f1a4);};}exports[_0x344a('0x22')]=function(_0x4fd65d,_0xbf09be){if(_0x4fd65d[_0x344a('0x29')]['id']){delete _0x4fd65d[_0x344a('0x29')]['id'];}return db[_0x344a('0x2a')][_0x344a('0x2b')]({'where':{'id':_0x4fd65d['params']['id']}})[_0x344a('0x23')](handleEntityNotFound(_0xbf09be,null))['then'](saveUpdates(_0x4fd65d['body'],null))[_0x344a('0x23')](respondWithResult(_0xbf09be,null))[_0x344a('0x2c')](handleError(_0xbf09be,null));};exports[_0x344a('0x2d')]=function(_0x21b858,_0x22b7a0){return db['Action'][_0x344a('0x2b')]({'where':{'id':_0x21b858['params']['id']}})[_0x344a('0x23')](handleEntityNotFound(_0x22b7a0,null))[_0x344a('0x23')](removeEntity(_0x22b7a0,null))[_0x344a('0x2c')](handleError(_0x22b7a0,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 514bee9..57a929d 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 _0x0590=['moment','request-promise','rimraf','../../config/environment','exports','define','tools_actions','../../config/logger','api'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x0590,0x166));var _0x0059=function(_0x5a5b56,_0x25b0cf){_0x5a5b56=_0x5a5b56-0x0;var _0xc6d035=_0x0590[_0x5a5b56];return _0xc6d035;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0059('0x0'))(_0x0059('0x1'));var moment=require(_0x0059('0x2'));var BPromise=require('bluebird');var rp=require(_0x0059('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0059('0x4'));var config=require(_0x0059('0x5'));var attributes=require('./action.attributes');module[_0x0059('0x6')]=function(_0xb88d6f,_0x489111){return _0xb88d6f[_0x0059('0x7')]('Action',attributes,{'tableName':_0x0059('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1cff=['lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','tools_actions'];(function(_0x3a2e49,_0x21ebea){var _0x257140=function(_0x5a2362){while(--_0x5a2362){_0x3a2e49['push'](_0x3a2e49['shift']());}};_0x257140(++_0x21ebea);}(_0x1cff,0x1cc));var _0xf1cf=function(_0x27c582,_0x6652de){_0x27c582=_0x27c582-0x0;var _0x24b4e7=_0x1cff[_0x27c582];return _0x24b4e7;};'use strict';var _=require(_0xf1cf('0x0'));var util=require('util');var logger=require(_0xf1cf('0x1'))('api');var moment=require(_0xf1cf('0x2'));var BPromise=require('bluebird');var rp=require(_0xf1cf('0x3'));var fs=require('fs');var path=require(_0xf1cf('0x4'));var rimraf=require(_0xf1cf('0x5'));var config=require(_0xf1cf('0x6'));var attributes=require('./action.attributes');module[_0xf1cf('0x7')]=function(_0x4ee429,_0x44e83f){return _0x4ee429[_0xf1cf('0x8')]('Action',attributes,{'tableName':_0xf1cf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 2494ec6..130af9c 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x7217,0x19e));var _0x7721=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x7217[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}
\ No newline at end of file
+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(_0xa0b359,_0x3ef1bd){var _0x11f480=function(_0x5f0706){while(--_0x5f0706){_0xa0b359['push'](_0xa0b359['shift']());}};_0x11f480(++_0x3ef1bd);}(_0x1261,0x144));var _0x1126=function(_0x5b5947,_0x11623c){_0x5b5947=_0x5b5947-0x0;var _0x7623e0=_0x1261[_0x5b5947];return _0x7623e0;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index b91b120..232bb6f 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 _0x891f=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','isAuthenticated','update','delete','/:id','exports','multer','util','path','connect-timeout','express'];(function(_0x31ed0a,_0x248431){var _0x30a689=function(_0x426283){while(--_0x426283){_0x31ed0a['push'](_0x31ed0a['shift']());}};_0x30a689(++_0x248431);}(_0x891f,0x6b));var _0xf891=function(_0x41da2a,_0x252b01){_0x41da2a=_0x41da2a-0x0;var _0x15e039=_0x891f[_0x41da2a];return _0x15e039;};'use strict';var multer=require(_0xf891('0x0'));var util=require(_0xf891('0x1'));var path=require(_0xf891('0x2'));var timeout=require(_0xf891('0x3'));var express=require(_0xf891('0x4'));var router=express[_0xf891('0x5')]();var fs_extra=require(_0xf891('0x6'));var auth=require(_0xf891('0x7'));var interaction=require(_0xf891('0x8'));var config=require(_0xf891('0x9'));var controller=require('./action.controller');router[_0xf891('0xa')]('/:id',auth[_0xf891('0xb')](),controller[_0xf891('0xc')]);router[_0xf891('0xd')](_0xf891('0xe'),auth[_0xf891('0xb')](),controller['destroy']);module[_0xf891('0xf')]=router;
\ No newline at end of file
+var _0x4798=['/:id','isAuthenticated','update','destroy','exports','path','express','Router','../../components/auth/service','../../config/environment','put'];(function(_0x215788,_0x5d430c){var _0x1dacb9=function(_0x417e22){while(--_0x417e22){_0x215788['push'](_0x215788['shift']());}};_0x1dacb9(++_0x5d430c);}(_0x4798,0x118));var _0x8479=function(_0x5562fe,_0x4e809c){_0x5562fe=_0x5562fe-0x0;var _0x1829c7=_0x4798[_0x5562fe];return _0x1829c7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8479('0x0'));var timeout=require('connect-timeout');var express=require(_0x8479('0x1'));var router=express[_0x8479('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x8479('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x8479('0x4'));var controller=require('./action.controller');router[_0x8479('0x5')](_0x8479('0x6'),auth[_0x8479('0x7')](),controller[_0x8479('0x8')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8479('0x9')]);module[_0x8479('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 728f055..3dc5908 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 _0x24ca=['sequelize','STRING','TEXT'];(function(_0x2de0ec,_0x38812f){var _0x13aa7b=function(_0x340176){while(--_0x340176){_0x2de0ec['push'](_0x2de0ec['shift']());}};_0x13aa7b(++_0x38812f);}(_0x24ca,0x1bc));var _0xa24c=function(_0x5a19fc,_0x58f9f4){_0x5a19fc=_0x5a19fc-0x0;var _0x34b413=_0x24ca[_0x5a19fc];return _0x34b413;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa24c('0x1')]},'parent':{'type':Sequelize[_0xa24c('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xa24c('0x2')]},'joins':{'type':Sequelize[_0xa24c('0x2')]}};
\ No newline at end of file
+var _0x5fd1=['STRING','TEXT','sequelize'];(function(_0x4bed75,_0x211cc7){var _0x2dd8e8=function(_0x6369c7){while(--_0x6369c7){_0x4bed75['push'](_0x4bed75['shift']());}};_0x2dd8e8(++_0x211cc7);}(_0x5fd1,0x155));var _0x15fd=function(_0x7c7843,_0x2f5468){_0x7c7843=_0x7c7843-0x0;var _0x393bc0=_0x5fd1[_0x7c7843];return _0x393bc0;};'use strict';var Sequelize=require(_0x15fd('0x0'));module['exports']={'name':{'type':Sequelize[_0x15fd('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x15fd('0x1')]},'parent':{'type':Sequelize[_0x15fd('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x15fd('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index c915987..26f0f64 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 _0x11fb=['save','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','send','map','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','AnalyticCustomReport','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','field','function','replace','format','groupBy','orderBy','order','alias','joins','parse','parentKey','foreignKey','foreignTable','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','left_join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','%s.%s\x20=\x20%s.%s','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','savename','COUNT(*)','SELECT','run','runReport','cross_join','DESC','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x11fb,0x131));var _0xb11f=function(_0x54957a,_0x2f0bcf){_0x54957a=_0x54957a-0x0;var _0x52d5d3=_0x11fb[_0x54957a];return _0x52d5d3;};'use strict';var emlformat=require(_0xb11f('0x0'));var rimraf=require(_0xb11f('0x1'));var zipdir=require(_0xb11f('0x2'));var jsonpatch=require(_0xb11f('0x3'));var rp=require(_0xb11f('0x4'));var moment=require(_0xb11f('0x5'));var BPromise=require(_0xb11f('0x6'));var Mustache=require(_0xb11f('0x7'));var util=require('util');var path=require(_0xb11f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb11f('0x9'));var fs=require('fs');var fs_extra=require(_0xb11f('0xa'));var _=require(_0xb11f('0xb'));var squel=require(_0xb11f('0xc'));var crypto=require(_0xb11f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb11f('0xe'));var toCsv=require(_0xb11f('0xf'));var querystring=require(_0xb11f('0x10'));var Papa=require(_0xb11f('0x11'));var Redis=require(_0xb11f('0x12'));var authService=require(_0xb11f('0x13'));var qs=require(_0xb11f('0x14'));var as=require(_0xb11f('0x15'));var hardwareService=require(_0xb11f('0x16'));var logger=require(_0xb11f('0x17'))(_0xb11f('0x18'));var utils=require(_0xb11f('0x19'));var config=require(_0xb11f('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xb11f('0x1b'))['db'];var dbH=require(_0xb11f('0x1b'))[_0xb11f('0x1c')];function respondWithStatusCode(_0x5177ad,_0x40a2e3){_0x40a2e3=_0x40a2e3||0xcc;return function(_0x333360){if(_0x333360){return _0x5177ad[_0xb11f('0x1d')](_0x40a2e3);}return _0x5177ad[_0xb11f('0x1e')](_0x40a2e3)[_0xb11f('0x1f')]();};}function respondWithResult(_0x51e1c6,_0x193122){_0x193122=_0x193122||0xc8;return function(_0x2962e6){if(_0x2962e6){return _0x51e1c6[_0xb11f('0x1e')](_0x193122)[_0xb11f('0x20')](_0x2962e6);}};}function respondWithFilteredResult(_0x466f11,_0x15e48f){return function(_0x187a4f){if(_0x187a4f){var _0x3e4694=typeof _0x15e48f[_0xb11f('0x21')]===_0xb11f('0x22')&&typeof _0x15e48f[_0xb11f('0x23')]===_0xb11f('0x22');var _0x2dbb60=_0x187a4f[_0xb11f('0x24')];var _0x38df8b=_0x3e4694?0x0:_0x15e48f[_0xb11f('0x21')];var _0x14be34=_0x3e4694?_0x187a4f[_0xb11f('0x24')]:_0x15e48f[_0xb11f('0x21')]+_0x15e48f[_0xb11f('0x23')];var _0x317f53;if(_0x14be34>=_0x2dbb60){_0x14be34=_0x2dbb60;_0x317f53=0xc8;}else{_0x317f53=0xce;}_0x466f11[_0xb11f('0x1e')](_0x317f53);return _0x466f11['set'](_0xb11f('0x25'),_0x38df8b+'-'+_0x14be34+'/'+_0x2dbb60)[_0xb11f('0x20')](_0x187a4f);}return null;};}function patchUpdates(_0x3f1dd2){return function(_0x484c31){try{jsonpatch['apply'](_0x484c31,_0x3f1dd2,!![]);}catch(_0x4b13e3){return BPromise[_0xb11f('0x26')](_0x4b13e3);}return _0x484c31[_0xb11f('0x27')]();};}function saveUpdates(_0x2f11b9,_0x262bba){return function(_0x31d4e4){if(_0x31d4e4){return _0x31d4e4[_0xb11f('0x28')](_0x2f11b9)[_0xb11f('0x29')](function(_0x249ccb){return _0x249ccb;});}return null;};}function removeEntity(_0x2c5ad2,_0x21561e){return function(_0x2c42e1){if(_0x2c42e1){return _0x2c42e1[_0xb11f('0x2a')]()['then'](function(){var _0x31b137=_0x2c42e1['get']({'plain':!![]});var _0x4ccd02=_0xb11f('0x2b');return db[_0xb11f('0x2c')][_0xb11f('0x2a')]({'where':{'type':_0x4ccd02,'resourceId':_0x31b137['id']}})[_0xb11f('0x29')](function(){return _0x2c42e1;});})['then'](function(){_0x2c5ad2[_0xb11f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54be11,_0x14adf1){return function(_0x592c00){if(!_0x592c00){_0x54be11[_0xb11f('0x1d')](0x194);}return _0x592c00;};}function handleError(_0x3bb1a7,_0x5bd105){_0x5bd105=_0x5bd105||0x1f4;return function(_0x5113f8){logger[_0xb11f('0x2d')](_0x5113f8[_0xb11f('0x2e')]);if(_0x5113f8[_0xb11f('0x2f')]){delete _0x5113f8[_0xb11f('0x2f')];}_0x3bb1a7[_0xb11f('0x1e')](_0x5bd105)[_0xb11f('0x30')](_0x5113f8);};}exports['index']=function(_0x3b1d0f,_0x44f6ae){var _0x59efe7={},_0x59d8a9={},_0x4e7837={'count':0x0,'rows':[]};var _0x24a5dd=_[_0xb11f('0x31')](db['AnalyticCustomReport']['rawAttributes'],function(_0x4d63ef){return{'name':_0x4d63ef[_0xb11f('0x32')],'type':_0x4d63ef['type'][_0xb11f('0x33')]};});_0x59d8a9[_0xb11f('0x34')]=_[_0xb11f('0x31')](_0x24a5dd,_0xb11f('0x2f'));_0x59d8a9[_0xb11f('0x35')]=_[_0xb11f('0x36')](_0x3b1d0f[_0xb11f('0x35')]);_0x59d8a9['filters']=_[_0xb11f('0x37')](_0x59d8a9['model'],_0x59d8a9[_0xb11f('0x35')]);_0x59efe7[_0xb11f('0x38')]=_['intersection'](_0x59d8a9['model'],qs[_0xb11f('0x39')](_0x3b1d0f[_0xb11f('0x35')][_0xb11f('0x39')]));_0x59efe7[_0xb11f('0x38')]=_0x59efe7['attributes'][_0xb11f('0x3a')]?_0x59efe7[_0xb11f('0x38')]:_0x59d8a9[_0xb11f('0x34')];if(!_0x3b1d0f['query'][_0xb11f('0x3b')](_0xb11f('0x3c'))){_0x59efe7[_0xb11f('0x23')]=qs['limit'](_0x3b1d0f[_0xb11f('0x35')][_0xb11f('0x23')]);_0x59efe7[_0xb11f('0x21')]=qs[_0xb11f('0x21')](_0x3b1d0f[_0xb11f('0x35')]['offset']);}_0x59efe7['order']=qs[_0xb11f('0x3d')](_0x3b1d0f['query'][_0xb11f('0x3d')]);_0x59efe7[_0xb11f('0x3e')]=qs[_0xb11f('0x3f')](_[_0xb11f('0x40')](_0x3b1d0f[_0xb11f('0x35')],_0x59d8a9[_0xb11f('0x3f')]),_0x24a5dd);if(_0x3b1d0f[_0xb11f('0x35')][_0xb11f('0x41')]){_0x59efe7[_0xb11f('0x3e')]=_[_0xb11f('0x42')](_0x59efe7['where'],{'$or':_[_0xb11f('0x31')](_0x24a5dd,function(_0x2acac3){if(_0x2acac3[_0xb11f('0x43')]!==_0xb11f('0x44')){var _0x29c5e8={};_0x29c5e8[_0x2acac3[_0xb11f('0x2f')]]={'$like':'%'+_0x3b1d0f['query'][_0xb11f('0x41')]+'%'};return _0x29c5e8;}})});}_0x59efe7=_[_0xb11f('0x42')]({},_0x59efe7,_0x3b1d0f[_0xb11f('0x45')]);var _0x53051f={'where':_0x59efe7[_0xb11f('0x3e')]};return db['AnalyticCustomReport'][_0xb11f('0x24')](_0x53051f)['then'](function(_0x235091){_0x4e7837[_0xb11f('0x24')]=_0x235091;if(_0x3b1d0f[_0xb11f('0x35')][_0xb11f('0x46')]){_0x59efe7[_0xb11f('0x47')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xb11f('0x48')](_0x59efe7);})[_0xb11f('0x29')](function(_0x57206b){_0x4e7837[_0xb11f('0x49')]=_0x57206b;return _0x4e7837;})[_0xb11f('0x29')](respondWithFilteredResult(_0x44f6ae,_0x59efe7))[_0xb11f('0x4a')](handleError(_0x44f6ae,null));};exports[_0xb11f('0x4b')]=function(_0xd2cd95,_0x442b00){var _0x2212c4={'raw':![],'where':{'id':_0xd2cd95[_0xb11f('0x4c')]['id']}},_0x4baf4e={};_0x4baf4e['model']=_['keys'](db[_0xb11f('0x4d')][_0xb11f('0x4e')]);_0x4baf4e[_0xb11f('0x35')]=_[_0xb11f('0x36')](_0xd2cd95[_0xb11f('0x35')]);_0x4baf4e[_0xb11f('0x3f')]=_['intersection'](_0x4baf4e[_0xb11f('0x34')],_0x4baf4e[_0xb11f('0x35')]);_0x2212c4['attributes']=_[_0xb11f('0x37')](_0x4baf4e['model'],qs[_0xb11f('0x39')](_0xd2cd95[_0xb11f('0x35')][_0xb11f('0x39')]));_0x2212c4['attributes']=_0x2212c4[_0xb11f('0x38')]['length']?_0x2212c4[_0xb11f('0x38')]:_0x4baf4e[_0xb11f('0x34')];if(_0xd2cd95['query'][_0xb11f('0x46')]){_0x2212c4[_0xb11f('0x47')]=[{'all':!![]}];}_0x2212c4=_['merge']({},_0x2212c4,_0xd2cd95[_0xb11f('0x45')]);return db[_0xb11f('0x4d')][_0xb11f('0x4f')](_0x2212c4)[_0xb11f('0x29')](handleEntityNotFound(_0x442b00,null))[_0xb11f('0x29')](respondWithResult(_0x442b00,null))[_0xb11f('0x4a')](handleError(_0x442b00,null));};exports[_0xb11f('0x50')]=function(_0x351ee5,_0x2ce91e){return db[_0xb11f('0x4d')][_0xb11f('0x50')](_0x351ee5['body'],{})['then'](function(_0xf3cc2b){var _0x18eefb=_0x351ee5[_0xb11f('0x51')]['get']({'plain':!![]});if(!_0x18eefb)throw new Error(_0xb11f('0x52'));if(_0x18eefb[_0xb11f('0x53')]===_0xb11f('0x51')){var _0x1653e7=_0xf3cc2b['get']({'plain':!![]});var _0x492cef='Reports';return db[_0xb11f('0x54')][_0xb11f('0x4f')]({'where':{'name':_0x492cef,'userProfileId':_0x18eefb[_0xb11f('0x55')]},'raw':!![]})[_0xb11f('0x29')](function(_0x479815){if(_0x479815&&_0x479815[_0xb11f('0x56')]===0x0){return db['UserProfileResource'][_0xb11f('0x50')]({'name':_0x1653e7['name'],'resourceId':_0x1653e7['id'],'type':_0xb11f('0x2b'),'sectionId':_0x479815['id']},{})[_0xb11f('0x29')](function(){return _0xf3cc2b;});}else{return _0xf3cc2b;}})[_0xb11f('0x4a')](function(_0x5cb97f){logger[_0xb11f('0x2d')](_0xb11f('0x57'),_0x5cb97f);throw _0x5cb97f;});}return _0xf3cc2b;})['then'](respondWithResult(_0x2ce91e,0xc9))[_0xb11f('0x4a')](handleError(_0x2ce91e,null));};exports[_0xb11f('0x28')]=function(_0x3f032e,_0x593d17){if(_0x3f032e[_0xb11f('0x58')]['id']){delete _0x3f032e[_0xb11f('0x58')]['id'];}return db[_0xb11f('0x4d')][_0xb11f('0x4f')]({'where':{'id':_0x3f032e[_0xb11f('0x4c')]['id']}})[_0xb11f('0x29')](handleEntityNotFound(_0x593d17,null))[_0xb11f('0x29')](saveUpdates(_0x3f032e['body'],null))[_0xb11f('0x29')](respondWithResult(_0x593d17,null))[_0xb11f('0x4a')](handleError(_0x593d17,null));};exports[_0xb11f('0x2a')]=function(_0x3d8e8f,_0x1e2320){return db[_0xb11f('0x4d')][_0xb11f('0x4f')]({'where':{'id':_0x3d8e8f[_0xb11f('0x4c')]['id']}})[_0xb11f('0x29')](handleEntityNotFound(_0x1e2320,null))[_0xb11f('0x29')](removeEntity(_0x1e2320,null))['catch'](handleError(_0x1e2320,null));};exports[_0xb11f('0x59')]=function(_0x25ec45,_0x9fa56f){var _0x34421b=0xa;var _0x5e5dbb=[_0xb11f('0x5a'),'left_join',_0xb11f('0x5b'),'cross_join'];var _0x5a1eef={'SUM':_0xb11f('0x5c'),'COUNT':_0xb11f('0x5d'),'COUNT DISTINCT':_0xb11f('0x5e'),'MAX':_0xb11f('0x5f'),'MIN':_0xb11f('0x60'),'AVG':_0xb11f('0x61'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb11f('0x62')};var _0x3d9b24={'SEC_TO_TIME':_0xb11f('0x63'),'DATE':_0xb11f('0x64'),'HOUR':_0xb11f('0x65'),'ROUND':_0xb11f('0x66'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1985ad=function(_0x26174a){return!_[_0xb11f('0x67')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xb11f('0x68'),'IS\x20NOT\x20EMPTY'],_0x26174a);};var _0x340531=function(_0xaf67f){if(!_0xaf67f||!_0xaf67f[_0xb11f('0x69')][_0xb11f('0x3a')]){return'';}for(var _0x4997fc='(',_0x49fc47=0x0;_0x49fc47<_0xaf67f['rules'][_0xb11f('0x3a')];_0x49fc47+=0x1){_0x49fc47>0x0&&(_0x4997fc+='\x20'+_0xaf67f[_0xb11f('0x6a')]+'\x20');_0x4997fc+=_0xaf67f[_0xb11f('0x69')][_0x49fc47][_0xb11f('0x6b')]?_0x340531(_0xaf67f[_0xb11f('0x69')][_0x49fc47][_0xb11f('0x6b')]):_0xaf67f[_0xb11f('0x69')][_0x49fc47]['field']+'\x20'+_0xaf67f[_0xb11f('0x69')][_0x49fc47][_0xb11f('0x6c')]+(_0x1985ad(_0xaf67f[_0xb11f('0x69')][_0x49fc47][_0xb11f('0x6c')])?'\x20'+_0xaf67f['rules'][_0x49fc47][_0xb11f('0x6d')]:'');}return _0x4997fc+')';};var _0x314fa1={'where':{'id':_0x25ec45['params']['id']}},_0x3f7f96,_0x40692a,_0x56f0ad,_0x1cebe0,_0x4202b9;_0x314fa1=_[_0xb11f('0x42')]({},_0x314fa1,_0x25ec45[_0xb11f('0x45')]);return db[_0xb11f('0x4d')][_0xb11f('0x4f')](_0x314fa1)[_0xb11f('0x29')](function(_0x55ea29){if(_0x55ea29){_0x3f7f96=_0x55ea29;return _0x55ea29[_0xb11f('0x6e')]();}return null;})[_0xb11f('0x29')](function(_0x14db42){if(_0x14db42){if(!_0x14db42[_0xb11f('0x3a')]){throw new db[(_0xb11f('0x6f'))][(_0xb11f('0x70'))](_0xb11f('0x71'),0x193);}_0x40692a=_0x14db42;return db[_0xb11f('0x72')][_0xb11f('0x48')]({'raw':!![]});}return null;})[_0xb11f('0x29')](function(_0x34dd7e){if(_0x34dd7e){_0x56f0ad=_[_0xb11f('0x73')](_0x34dd7e,'id');var _0x5bd649;var _0x408b24=squel[_0xb11f('0x74')]();_0x408b24[_0xb11f('0x75')](_0x3f7f96[_0xb11f('0x76')]);for(var _0x3284f6=0x0;_0x3284f6<_0x40692a['length'];_0x3284f6+=0x1){_0x5bd649=_0x40692a[_0x3284f6][_0xb11f('0x77')]?_0x56f0ad[_0x40692a[_0x3284f6]['MetricId']][_0xb11f('0x78')]:_0x40692a[_0x3284f6][_0xb11f('0x79')];_0x5bd649=_0x40692a[_0x3284f6][_0xb11f('0x7a')]?_[_0xb11f('0x7b')](_0x5a1eef[_0x40692a[_0x3284f6][_0xb11f('0x7a')]],'%s',_0x5bd649):_0x5bd649;_0x5bd649=_0x40692a[_0x3284f6][_0xb11f('0x7c')]?_[_0xb11f('0x7b')](_0x3d9b24[_0x40692a[_0x3284f6][_0xb11f('0x7c')]],'%s',_0x5bd649):_0x5bd649;if(_0x40692a[_0x3284f6][_0xb11f('0x7d')]){_0x408b24[_0xb11f('0x6b')](_0x5bd649);}_0x40692a[_0x3284f6][_0xb11f('0x7e')]&&_0x408b24[_0xb11f('0x7f')](_0x5bd649,_0x40692a[_0x3284f6]['orderBy']==='DESC'?![]:!![]);_0x408b24[_0xb11f('0x79')](_0x5bd649,_0x40692a[_0x3284f6][_0xb11f('0x80')]||_0x5bd649);}if(_0x3f7f96[_0xb11f('0x81')]){_0x3f7f96['joins']=JSON[_0xb11f('0x82')](_0x3f7f96[_0xb11f('0x81')]);for(var _0x472f09=0x0;_0x472f09<_0x3f7f96['joins'][_0xb11f('0x3a')];_0x472f09+=0x1){if(_0x3f7f96['joins'][_0x472f09][_0xb11f('0x43')]&&_['includes'](_0x5e5dbb,_0x3f7f96[_0xb11f('0x81')][_0x472f09][_0xb11f('0x43')])&&_0x3f7f96[_0xb11f('0x81')][_0x472f09][_0xb11f('0x83')]&&_0x3f7f96[_0xb11f('0x81')][_0x472f09]['foreignTable']&&_0x3f7f96[_0xb11f('0x81')][_0x472f09][_0xb11f('0x84')]){_0x408b24[_0x3f7f96[_0xb11f('0x81')][_0x472f09]['type']](_0x3f7f96['joins'][_0x472f09]['foreignTable'],null,util[_0xb11f('0x7c')]('%s.%s\x20=\x20%s.%s',_0x3f7f96['table'],_0x3f7f96[_0xb11f('0x81')][_0x472f09]['parentKey'],_0x3f7f96[_0xb11f('0x81')][_0x472f09][_0xb11f('0x85')],_0x3f7f96[_0xb11f('0x81')][_0x472f09][_0xb11f('0x84')]));}}}if(_0x3f7f96[_0xb11f('0x86')]){_0x3f7f96[_0xb11f('0x86')]=JSON[_0xb11f('0x82')](_0x3f7f96[_0xb11f('0x86')]);_0x408b24[_0xb11f('0x3e')](_0x340531(_0x3f7f96[_0xb11f('0x86')][_0xb11f('0x6b')]));}_0x4202b9=_0x408b24['clone']();_0x408b24[_0xb11f('0x23')](_0x34421b);_0x408b24['offset'](0x0);logger[_0xb11f('0x87')](_0xb11f('0x88'),_0x408b24['toString']());return dbH[_0xb11f('0x89')]['query'](_0x408b24[_0xb11f('0x8a')](),{'type':dbH[_0xb11f('0x89')][_0xb11f('0x8b')]['SELECT']});}})[_0xb11f('0x29')](respondWithResult(_0x9fa56f,null))[_0xb11f('0x4a')](handleError(_0x9fa56f,null));};function runReport(_0x145462,_0x3f860e,_0x4a46f4){var _0x5757e7=_0x3f860e[_0xb11f('0x2f')];var _0x398ebf=0xa;var _0x19f64a=[_0xb11f('0x5a'),_0xb11f('0x8c'),_0xb11f('0x5b'),'cross_join'];var _0x454310={'SUM':_0xb11f('0x5c'),'COUNT':_0xb11f('0x5d'),'COUNT DISTINCT':_0xb11f('0x5e'),'MAX':_0xb11f('0x5f'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xb11f('0x8d'),'GROUP_CONCAT ASC':_0xb11f('0x8e'),'GROUP_CONCAT DESC':_0xb11f('0x62')};var _0x1dc041={'SEC_TO_TIME':_0xb11f('0x63'),'DATE':_0xb11f('0x64'),'HOUR':_0xb11f('0x65'),'ROUND':_0xb11f('0x66'),'UNIX_TIMESTAMP':_0xb11f('0x8f')};var _0x2fac8e=function(_0x10b162){return!_[_0xb11f('0x67')]([_0xb11f('0x90'),_0xb11f('0x91'),_0xb11f('0x68'),_0xb11f('0x92')],_0x10b162);};var _0x7f8c97=function(_0x15780b){if(!_0x15780b||!_0x15780b[_0xb11f('0x69')][_0xb11f('0x3a')]){return'';}for(var _0x2ace1f='(',_0x1ef2b1=0x0;_0x1ef2b1<_0x15780b[_0xb11f('0x69')][_0xb11f('0x3a')];_0x1ef2b1+=0x1){_0x1ef2b1>0x0&&(_0x2ace1f+='\x20'+_0x15780b[_0xb11f('0x6a')]+'\x20');_0x2ace1f+=_0x15780b[_0xb11f('0x69')][_0x1ef2b1][_0xb11f('0x6b')]?_0x7f8c97(_0x15780b['rules'][_0x1ef2b1]['group']):_0x15780b[_0xb11f('0x69')][_0x1ef2b1]['field']+'\x20'+_0x15780b[_0xb11f('0x69')][_0x1ef2b1][_0xb11f('0x6c')]+(_0x2fac8e(_0x15780b[_0xb11f('0x69')][_0x1ef2b1]['condition'])?'\x20'+_0x15780b[_0xb11f('0x69')][_0x1ef2b1]['value']:'');}return _0x2ace1f+')';};var _0x58b5f5={'where':{'id':_0x145462['id']}},_0x4b28c2,_0x39035c,_0x3527af,_0x33df96,_0x2ab825;_0x58b5f5=_['merge']({},_0x58b5f5,_0x4a46f4);return db[_0xb11f('0x4d')][_0xb11f('0x4f')](_0x58b5f5)[_0xb11f('0x29')](function(_0x363424){if(_0x363424){_0x4b28c2=_0x363424;return _0x363424[_0xb11f('0x6e')]();}return null;})[_0xb11f('0x29')](function(_0xa10855){if(_0xa10855){if(!_0xa10855[_0xb11f('0x3a')]){throw new db[(_0xb11f('0x6f'))][(_0xb11f('0x70'))](_0xb11f('0x71'),0x193);}_0x39035c=_0xa10855;return db[_0xb11f('0x72')]['findAll']({'raw':!![]});}return null;})[_0xb11f('0x29')](function(_0x2bc50a){if(_0x2bc50a){_0x3527af=_[_0xb11f('0x73')](_0x2bc50a,'id');var _0x15fadb;var _0x101ac4=squel[_0xb11f('0x74')]();_0x101ac4[_0xb11f('0x75')](_0x4b28c2[_0xb11f('0x76')]);for(var _0x19d190=0x0;_0x19d190<_0x39035c[_0xb11f('0x3a')];_0x19d190+=0x1){_0x15fadb=_0x39035c[_0x19d190][_0xb11f('0x77')]?_0x3527af[_0x39035c[_0x19d190][_0xb11f('0x77')]][_0xb11f('0x78')]:_0x39035c[_0x19d190]['field'];_0x15fadb=_0x39035c[_0x19d190][_0xb11f('0x7a')]?_['replace'](_0x454310[_0x39035c[_0x19d190][_0xb11f('0x7a')]],'%s',_0x15fadb):_0x15fadb;_0x15fadb=_0x39035c[_0x19d190][_0xb11f('0x7c')]?_['replace'](_0x1dc041[_0x39035c[_0x19d190][_0xb11f('0x7c')]],'%s',_0x15fadb):_0x15fadb;if(_0x39035c[_0x19d190][_0xb11f('0x7d')]){_0x101ac4[_0xb11f('0x6b')](_0x15fadb);}_0x39035c[_0x19d190][_0xb11f('0x7e')]&&_0x101ac4[_0xb11f('0x7f')](_0x15fadb,_0x39035c[_0x19d190][_0xb11f('0x7e')]==='DESC'?![]:!![]);_0x101ac4[_0xb11f('0x79')](_0x15fadb,_0x39035c[_0x19d190][_0xb11f('0x80')]||_0x15fadb);}if(_0x4b28c2[_0xb11f('0x81')]){_0x4b28c2[_0xb11f('0x81')]=JSON[_0xb11f('0x82')](_0x4b28c2[_0xb11f('0x81')]);for(var _0x5f522f=0x0;_0x5f522f<_0x4b28c2[_0xb11f('0x81')][_0xb11f('0x3a')];_0x5f522f+=0x1){if(_0x4b28c2[_0xb11f('0x81')][_0x5f522f][_0xb11f('0x43')]&&_[_0xb11f('0x67')](_0x19f64a,_0x4b28c2[_0xb11f('0x81')][_0x5f522f][_0xb11f('0x43')])&&_0x4b28c2[_0xb11f('0x81')][_0x5f522f][_0xb11f('0x83')]&&_0x4b28c2[_0xb11f('0x81')][_0x5f522f][_0xb11f('0x85')]&&_0x4b28c2['joins'][_0x5f522f][_0xb11f('0x84')]){_0x101ac4[_0x4b28c2[_0xb11f('0x81')][_0x5f522f][_0xb11f('0x43')]](_0x4b28c2[_0xb11f('0x81')][_0x5f522f]['foreignTable'],null,util['format'](_0xb11f('0x93'),_0x4b28c2[_0xb11f('0x76')],_0x4b28c2[_0xb11f('0x81')][_0x5f522f][_0xb11f('0x83')],_0x4b28c2[_0xb11f('0x81')][_0x5f522f]['foreignTable'],_0x4b28c2[_0xb11f('0x81')][_0x5f522f][_0xb11f('0x84')]));}}}if(_0x4b28c2['conditions']){_0x4b28c2[_0xb11f('0x86')]=JSON[_0xb11f('0x82')](_0x4b28c2[_0xb11f('0x86')]);_0x101ac4[_0xb11f('0x3e')](_0x7f8c97(_0x4b28c2['conditions'][_0xb11f('0x6b')]));}_0x2ab825=_0x101ac4[_0xb11f('0x94')]();_0x101ac4[_0xb11f('0x23')](_0x398ebf);_0x101ac4['offset'](0x0);return;}})['then'](function(){if(_0x3f860e[_0xb11f('0x95')]===_0xb11f('0x96')){return null;}var _0x38b26f=_['merge'](_0x3f860e,{'name':_0x3f860e[_0xb11f('0x97')]||_0x3f860e['name']||_0x4b28c2['name'],'basename':_0x5757e7,'savename':util['format'](_0xb11f('0x98'),_0x3f860e[_0xb11f('0x2f')]||_0x4b28c2[_0xb11f('0x2f')],require(_0xb11f('0x99'))[_0xb11f('0x9a')](0x4),_0x3f860e['output']||_0xb11f('0x9b')),'reportId':_0x4b28c2['id'],'reportType':_0xb11f('0x9c')});return db[_0xb11f('0x9d')][_0xb11f('0x50')](_0x38b26f,{'raw':!![]});})['then'](function(_0x105c96){if(_0x4b28c2[_0xb11f('0x76')]==='cdr'){_0x2ab825[_0xb11f('0x3e')](_0x4b28c2[_0xb11f('0x76')]+_0xb11f('0x9e'),_0x3f860e[_0xb11f('0x9f')],_0x3f860e[_0xb11f('0xa0')]);}else{_0x2ab825['where'](_0x4b28c2[_0xb11f('0x76')]+_0xb11f('0xa1'),_0x3f860e[_0xb11f('0x9f')],_0x3f860e[_0xb11f('0xa0')]);}if(_0x105c96){logger[_0xb11f('0xa2')](_0xb11f('0xa3'),_0x2ab825[_0xb11f('0x8a')]());require(_0xb11f('0xa4'))['fork'](path[_0xb11f('0x5a')](__dirname,'../../components/export/',_0x105c96['output']),[_0x105c96['id'],_0x2ab825['toString'](),path[_0xb11f('0x5a')](__dirname,'../../files/reports',_0x105c96[_0xb11f('0xa5')]),_0x5757e7]);return _0x105c96;}else{var _0x16dfb9=squel['select']();_0x16dfb9['from']('('+_0x2ab825[_0xb11f('0x8a')]()+')','countTable');_0x16dfb9[_0xb11f('0x79')](_0xb11f('0xa6'),_0xb11f('0x24'));_0x2ab825[_0xb11f('0x23')](_0x3f860e[_0xb11f('0x23')]||_0x398ebf);_0x2ab825['offset'](_0x3f860e[_0xb11f('0x21')]||0x0);return dbH[_0xb11f('0x89')][_0xb11f('0x35')](_0x16dfb9[_0xb11f('0x8a')](),{'type':dbH[_0xb11f('0x89')][_0xb11f('0x8b')]['SELECT']})[_0xb11f('0x29')](function(_0xb1b446){if(!_0xb1b446[_0xb11f('0x3a')]){_0x33df96=0x0;}else{_0x33df96=_0xb1b446[0x0]['count']||0x0;}return dbH['sequelize'][_0xb11f('0x35')](_0x2ab825[_0xb11f('0x8a')](),{'type':dbH[_0xb11f('0x89')][_0xb11f('0x8b')][_0xb11f('0xa7')]});})[_0xb11f('0x29')](function(_0x4c6ea3){return{'rows':_0x4c6ea3||[],'count':_0x33df96};});}});}exports[_0xb11f('0xa8')]=function(_0x3d3b8a,_0x39566d){return runReport(_0x3d3b8a[_0xb11f('0x4c')],_0x3d3b8a[_0xb11f('0x35')],_0x3d3b8a['options'])[_0xb11f('0x29')](respondWithResult(_0x39566d,null))[_0xb11f('0x4a')](handleError(_0x39566d,null));};exports[_0xb11f('0xa9')]=runReport;exports['query']=function(_0x26f696,_0x3f1bfb){var _0x1f6011=0xa;var _0x36c97f=['join','left_join',_0xb11f('0x5b'),_0xb11f('0xaa')];var _0x48e2f5={'SUM':_0xb11f('0x5c'),'COUNT':_0xb11f('0x5d'),'COUNT DISTINCT':_0xb11f('0x5e'),'MAX':_0xb11f('0x5f'),'MIN':_0xb11f('0x60'),'AVG':_0xb11f('0x61'),'GROUP_CONCAT':_0xb11f('0x8d'),'GROUP_CONCAT ASC':_0xb11f('0x8e'),'GROUP_CONCAT DESC':_0xb11f('0x62')};var _0x3ffe4c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb11f('0x64'),'HOUR':_0xb11f('0x65'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb11f('0x8f')};var _0x1def94=function(_0x4829c3){return!_[_0xb11f('0x67')]([_0xb11f('0x90'),_0xb11f('0x91'),_0xb11f('0x68'),'IS\x20NOT\x20EMPTY'],_0x4829c3);};var _0x3aa1dd=function(_0x3f0ece){if(!_0x3f0ece||!_0x3f0ece[_0xb11f('0x69')][_0xb11f('0x3a')]){return'';}for(var _0x583ee7='(',_0x5e15da=0x0;_0x5e15da<_0x3f0ece[_0xb11f('0x69')][_0xb11f('0x3a')];_0x5e15da+=0x1){_0x5e15da>0x0&&(_0x583ee7+='\x20'+_0x3f0ece[_0xb11f('0x6a')]+'\x20');_0x583ee7+=_0x3f0ece[_0xb11f('0x69')][_0x5e15da][_0xb11f('0x6b')]?_0x3aa1dd(_0x3f0ece[_0xb11f('0x69')][_0x5e15da][_0xb11f('0x6b')]):_0x3f0ece[_0xb11f('0x69')][_0x5e15da][_0xb11f('0x79')]+'\x20'+_0x3f0ece[_0xb11f('0x69')][_0x5e15da][_0xb11f('0x6c')]+(_0x1def94(_0x3f0ece[_0xb11f('0x69')][_0x5e15da][_0xb11f('0x6c')])?'\x20'+_0x3f0ece[_0xb11f('0x69')][_0x5e15da][_0xb11f('0x6d')]:'');}return _0x583ee7+')';};var _0x265410={'where':{'id':_0x26f696[_0xb11f('0x4c')]['id']}},_0x2d0970,_0x46eb9a,_0x41c4e1,_0x5a79a3,_0x2106dd;_0x265410=_[_0xb11f('0x42')]({},_0x265410,_0x26f696[_0xb11f('0x45')]);return db[_0xb11f('0x4d')][_0xb11f('0x4f')](_0x265410)[_0xb11f('0x29')](function(_0x240f64){if(_0x240f64){_0x2d0970=_0x240f64;return _0x240f64[_0xb11f('0x6e')]();}return null;})['then'](function(_0x23875a){if(_0x23875a){if(!_0x23875a[_0xb11f('0x3a')]){throw new db['Sequelize'][(_0xb11f('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x46eb9a=_0x23875a;return db[_0xb11f('0x72')][_0xb11f('0x48')]({'raw':!![]});}return null;})[_0xb11f('0x29')](function(_0x241a71){if(_0x241a71){_0x41c4e1=_[_0xb11f('0x73')](_0x241a71,'id');var _0x44298;var _0x2ff93e=squel[_0xb11f('0x74')]();_0x2ff93e[_0xb11f('0x75')](_0x2d0970[_0xb11f('0x76')]);for(var _0x47cfa2=0x0;_0x47cfa2<_0x46eb9a['length'];_0x47cfa2+=0x1){_0x44298=_0x46eb9a[_0x47cfa2][_0xb11f('0x77')]?_0x41c4e1[_0x46eb9a[_0x47cfa2][_0xb11f('0x77')]][_0xb11f('0x78')]:_0x46eb9a[_0x47cfa2][_0xb11f('0x79')];_0x44298=_0x46eb9a[_0x47cfa2]['function']?_['replace'](_0x48e2f5[_0x46eb9a[_0x47cfa2]['function']],'%s',_0x44298):_0x44298;_0x44298=_0x46eb9a[_0x47cfa2][_0xb11f('0x7c')]?_[_0xb11f('0x7b')](_0x3ffe4c[_0x46eb9a[_0x47cfa2][_0xb11f('0x7c')]],'%s',_0x44298):_0x44298;if(_0x46eb9a[_0x47cfa2][_0xb11f('0x7d')]){_0x2ff93e[_0xb11f('0x6b')](_0x44298);}_0x46eb9a[_0x47cfa2][_0xb11f('0x7e')]&&_0x2ff93e[_0xb11f('0x7f')](_0x44298,_0x46eb9a[_0x47cfa2][_0xb11f('0x7e')]===_0xb11f('0xab')?![]:!![]);_0x2ff93e['field'](_0x44298,_0x46eb9a[_0x47cfa2][_0xb11f('0x80')]||_0x44298);}if(_0x2d0970[_0xb11f('0x81')]){_0x2d0970[_0xb11f('0x81')]=JSON[_0xb11f('0x82')](_0x2d0970[_0xb11f('0x81')]);for(var _0x198c5a=0x0;_0x198c5a<_0x2d0970[_0xb11f('0x81')][_0xb11f('0x3a')];_0x198c5a+=0x1){if(_0x2d0970[_0xb11f('0x81')][_0x198c5a][_0xb11f('0x43')]&&_['includes'](_0x36c97f,_0x2d0970['joins'][_0x198c5a][_0xb11f('0x43')])&&_0x2d0970[_0xb11f('0x81')][_0x198c5a][_0xb11f('0x83')]&&_0x2d0970[_0xb11f('0x81')][_0x198c5a][_0xb11f('0x85')]&&_0x2d0970['joins'][_0x198c5a][_0xb11f('0x84')]){_0x2ff93e[_0x2d0970['joins'][_0x198c5a][_0xb11f('0x43')]](_0x2d0970[_0xb11f('0x81')][_0x198c5a][_0xb11f('0x85')],null,util[_0xb11f('0x7c')](_0xb11f('0x93'),_0x2d0970[_0xb11f('0x76')],_0x2d0970[_0xb11f('0x81')][_0x198c5a][_0xb11f('0x83')],_0x2d0970[_0xb11f('0x81')][_0x198c5a][_0xb11f('0x85')],_0x2d0970[_0xb11f('0x81')][_0x198c5a][_0xb11f('0x84')]));}}}if(_0x2d0970[_0xb11f('0x86')]){_0x2d0970[_0xb11f('0x86')]=JSON[_0xb11f('0x82')](_0x2d0970[_0xb11f('0x86')]);_0x2ff93e['where'](_0x3aa1dd(_0x2d0970['conditions'][_0xb11f('0x6b')]));}_0x2106dd=_0x2ff93e[_0xb11f('0x94')]();_0x2ff93e[_0xb11f('0x23')](_0x1f6011);_0x2ff93e['offset'](0x0);logger[_0xb11f('0x87')](_0xb11f('0x88'),_0x2ff93e['toString']());return dbH[_0xb11f('0x89')][_0xb11f('0x35')](_0x2ff93e['toString'](),{'type':dbH[_0xb11f('0x89')][_0xb11f('0x8b')]['SELECT']});}})[_0xb11f('0x29')](function(){return{'sql':_0x2106dd['toString']()};})['then'](respondWithResult(_0x3f1bfb,null))[_0xb11f('0x4a')](handleError(_0x3f1bfb,null));};
\ No newline at end of file
+var _0x4ab6=['SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','rules','operator','group','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','replace','format','groupBy','DESC','alias','joins','parse','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','MAX(%s)','DATE(%s)','HOUR(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','findAll','foreignTable','clone','web','fullPath','%s-%s.%s','generate','output','csv','AnalyticExtractedReport','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','countTable','run','runReport','MIN(%s)','value','metric','orderBy','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','get','UserProfileResource','then','stack','name','send','index','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','map','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','length','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','right_join','cross_join'];(function(_0x48245e,_0x178e51){var _0x4e5e30=function(_0x428bfd){while(--_0x428bfd){_0x48245e['push'](_0x48245e['shift']());}};_0x4e5e30(++_0x178e51);}(_0x4ab6,0x1a6));var _0x64ab=function(_0x45e5f2,_0xc803d0){_0x45e5f2=_0x45e5f2-0x0;var _0x333b0a=_0x4ab6[_0x45e5f2];return _0x333b0a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x64ab('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x64ab('0x1'));var rp=require('request-promise');var moment=require(_0x64ab('0x2'));var BPromise=require(_0x64ab('0x3'));var Mustache=require(_0x64ab('0x4'));var util=require(_0x64ab('0x5'));var path=require(_0x64ab('0x6'));var sox=require(_0x64ab('0x7'));var csv=require(_0x64ab('0x8'));var ejs=require(_0x64ab('0x9'));var fs=require('fs');var fs_extra=require(_0x64ab('0xa'));var _=require(_0x64ab('0xb'));var squel=require(_0x64ab('0xc'));var crypto=require(_0x64ab('0xd'));var jsforce=require(_0x64ab('0xe'));var deskjs=require(_0x64ab('0xf'));var toCsv=require(_0x64ab('0x8'));var querystring=require(_0x64ab('0x10'));var Papa=require(_0x64ab('0x11'));var Redis=require(_0x64ab('0x12'));var authService=require(_0x64ab('0x13'));var qs=require(_0x64ab('0x14'));var as=require(_0x64ab('0x15'));var hardwareService=require(_0x64ab('0x16'));var logger=require('../../config/logger')(_0x64ab('0x17'));var utils=require(_0x64ab('0x18'));var config=require(_0x64ab('0x19'));var licenseUtil=require(_0x64ab('0x1a'));var db=require(_0x64ab('0x1b'))['db'];var dbH=require('../../mysqldb')[_0x64ab('0x1c')];function respondWithStatusCode(_0x85fa6f,_0x54c906){_0x54c906=_0x54c906||0xcc;return function(_0x2e1935){if(_0x2e1935){return _0x85fa6f[_0x64ab('0x1d')](_0x54c906);}return _0x85fa6f['status'](_0x54c906)[_0x64ab('0x1e')]();};}function respondWithResult(_0x57933d,_0x264f2a){_0x264f2a=_0x264f2a||0xc8;return function(_0x4d7717){if(_0x4d7717){return _0x57933d[_0x64ab('0x1f')](_0x264f2a)[_0x64ab('0x20')](_0x4d7717);}};}function respondWithFilteredResult(_0x190df8,_0x1deae8){return function(_0x6595dc){if(_0x6595dc){var _0x521e30=typeof _0x1deae8[_0x64ab('0x21')]===_0x64ab('0x22')&&typeof _0x1deae8[_0x64ab('0x23')]===_0x64ab('0x22');var _0x150cac=_0x6595dc[_0x64ab('0x24')];var _0x5017e6=_0x521e30?0x0:_0x1deae8[_0x64ab('0x21')];var _0x361291=_0x521e30?_0x6595dc[_0x64ab('0x24')]:_0x1deae8['offset']+_0x1deae8[_0x64ab('0x23')];var _0x3d0432;if(_0x361291>=_0x150cac){_0x361291=_0x150cac;_0x3d0432=0xc8;}else{_0x3d0432=0xce;}_0x190df8['status'](_0x3d0432);return _0x190df8[_0x64ab('0x25')](_0x64ab('0x26'),_0x5017e6+'-'+_0x361291+'/'+_0x150cac)[_0x64ab('0x20')](_0x6595dc);}return null;};}function patchUpdates(_0x31818a){return function(_0x39039d){try{jsonpatch[_0x64ab('0x27')](_0x39039d,_0x31818a,!![]);}catch(_0x402d49){return BPromise['reject'](_0x402d49);}return _0x39039d['save']();};}function saveUpdates(_0x1c8186,_0x5af5f9){return function(_0x3b08e3){if(_0x3b08e3){return _0x3b08e3[_0x64ab('0x28')](_0x1c8186)['then'](function(_0x5c136b){return _0x5c136b;});}return null;};}function removeEntity(_0x4a18d1,_0x404c7a){return function(_0x423377){if(_0x423377){return _0x423377[_0x64ab('0x29')]()['then'](function(){var _0x45099f=_0x423377[_0x64ab('0x2a')]({'plain':!![]});var _0x548716='CustomReports';return db[_0x64ab('0x2b')][_0x64ab('0x29')]({'where':{'type':_0x548716,'resourceId':_0x45099f['id']}})[_0x64ab('0x2c')](function(){return _0x423377;});})[_0x64ab('0x2c')](function(){_0x4a18d1[_0x64ab('0x1f')](0xcc)[_0x64ab('0x1e')]();});}};}function handleEntityNotFound(_0x521cf6,_0x66604e){return function(_0x4e482e){if(!_0x4e482e){_0x521cf6['sendStatus'](0x194);}return _0x4e482e;};}function handleError(_0x255208,_0x175345){_0x175345=_0x175345||0x1f4;return function(_0x38be4e){logger['error'](_0x38be4e[_0x64ab('0x2d')]);if(_0x38be4e[_0x64ab('0x2e')]){delete _0x38be4e[_0x64ab('0x2e')];}_0x255208[_0x64ab('0x1f')](_0x175345)[_0x64ab('0x2f')](_0x38be4e);};}exports[_0x64ab('0x30')]=function(_0x4d0d7f,_0x35f722){var _0x5a5aae={},_0x1abe00={},_0x10998c={'count':0x0,'rows':[]};var _0x2f76c0=_['map'](db[_0x64ab('0x31')][_0x64ab('0x32')],function(_0x2d54c5){return{'name':_0x2d54c5[_0x64ab('0x33')],'type':_0x2d54c5[_0x64ab('0x34')][_0x64ab('0x35')]};});_0x1abe00[_0x64ab('0x36')]=_[_0x64ab('0x37')](_0x2f76c0,_0x64ab('0x2e'));_0x1abe00[_0x64ab('0x38')]=_['keys'](_0x4d0d7f['query']);_0x1abe00['filters']=_[_0x64ab('0x39')](_0x1abe00['model'],_0x1abe00[_0x64ab('0x38')]);_0x5a5aae['attributes']=_[_0x64ab('0x39')](_0x1abe00[_0x64ab('0x36')],qs[_0x64ab('0x3a')](_0x4d0d7f[_0x64ab('0x38')][_0x64ab('0x3a')]));_0x5a5aae['attributes']=_0x5a5aae[_0x64ab('0x3b')]['length']?_0x5a5aae[_0x64ab('0x3b')]:_0x1abe00[_0x64ab('0x36')];if(!_0x4d0d7f['query'][_0x64ab('0x3c')](_0x64ab('0x3d'))){_0x5a5aae[_0x64ab('0x23')]=qs[_0x64ab('0x23')](_0x4d0d7f[_0x64ab('0x38')][_0x64ab('0x23')]);_0x5a5aae[_0x64ab('0x21')]=qs[_0x64ab('0x21')](_0x4d0d7f[_0x64ab('0x38')][_0x64ab('0x21')]);}_0x5a5aae[_0x64ab('0x3e')]=qs[_0x64ab('0x3f')](_0x4d0d7f[_0x64ab('0x38')][_0x64ab('0x3f')]);_0x5a5aae[_0x64ab('0x40')]=qs[_0x64ab('0x41')](_[_0x64ab('0x42')](_0x4d0d7f[_0x64ab('0x38')],_0x1abe00['filters']),_0x2f76c0);if(_0x4d0d7f[_0x64ab('0x38')][_0x64ab('0x43')]){_0x5a5aae['where']=_[_0x64ab('0x44')](_0x5a5aae[_0x64ab('0x40')],{'$or':_[_0x64ab('0x37')](_0x2f76c0,function(_0x136ce4){if(_0x136ce4['type']!==_0x64ab('0x45')){var _0x3c9357={};_0x3c9357[_0x136ce4[_0x64ab('0x2e')]]={'$like':'%'+_0x4d0d7f['query'][_0x64ab('0x43')]+'%'};return _0x3c9357;}})});}_0x5a5aae=_[_0x64ab('0x44')]({},_0x5a5aae,_0x4d0d7f[_0x64ab('0x46')]);var _0x74b431={'where':_0x5a5aae['where']};return db[_0x64ab('0x31')]['count'](_0x74b431)[_0x64ab('0x2c')](function(_0x1d2a75){_0x10998c[_0x64ab('0x24')]=_0x1d2a75;if(_0x4d0d7f[_0x64ab('0x38')][_0x64ab('0x47')]){_0x5a5aae[_0x64ab('0x48')]=[{'all':!![]}];}return db[_0x64ab('0x31')]['findAll'](_0x5a5aae);})[_0x64ab('0x2c')](function(_0x123f98){_0x10998c[_0x64ab('0x49')]=_0x123f98;return _0x10998c;})[_0x64ab('0x2c')](respondWithFilteredResult(_0x35f722,_0x5a5aae))['catch'](handleError(_0x35f722,null));};exports[_0x64ab('0x4a')]=function(_0x10406c,_0x547329){var _0x52f9d0={'raw':![],'where':{'id':_0x10406c[_0x64ab('0x4b')]['id']}},_0x4a27e9={};_0x4a27e9[_0x64ab('0x36')]=_[_0x64ab('0x4c')](db['AnalyticCustomReport']['rawAttributes']);_0x4a27e9[_0x64ab('0x38')]=_[_0x64ab('0x4c')](_0x10406c['query']);_0x4a27e9[_0x64ab('0x41')]=_[_0x64ab('0x39')](_0x4a27e9[_0x64ab('0x36')],_0x4a27e9['query']);_0x52f9d0[_0x64ab('0x3b')]=_[_0x64ab('0x39')](_0x4a27e9[_0x64ab('0x36')],qs[_0x64ab('0x3a')](_0x10406c['query']['fields']));_0x52f9d0[_0x64ab('0x3b')]=_0x52f9d0[_0x64ab('0x3b')][_0x64ab('0x4d')]?_0x52f9d0[_0x64ab('0x3b')]:_0x4a27e9[_0x64ab('0x36')];if(_0x10406c[_0x64ab('0x38')][_0x64ab('0x47')]){_0x52f9d0[_0x64ab('0x48')]=[{'all':!![]}];}_0x52f9d0=_[_0x64ab('0x44')]({},_0x52f9d0,_0x10406c[_0x64ab('0x46')]);return db[_0x64ab('0x31')][_0x64ab('0x4e')](_0x52f9d0)['then'](handleEntityNotFound(_0x547329,null))[_0x64ab('0x2c')](respondWithResult(_0x547329,null))[_0x64ab('0x4f')](handleError(_0x547329,null));};exports[_0x64ab('0x50')]=function(_0x294e4e,_0x357229){return db[_0x64ab('0x31')][_0x64ab('0x50')](_0x294e4e['body'],{})['then'](function(_0x25ecde){var _0x37a4da=_0x294e4e[_0x64ab('0x51')][_0x64ab('0x2a')]({'plain':!![]});if(!_0x37a4da)throw new Error(_0x64ab('0x52'));if(_0x37a4da[_0x64ab('0x53')]==='user'){var _0x5447d8=_0x25ecde['get']({'plain':!![]});var _0x2fa4ab=_0x64ab('0x54');return db[_0x64ab('0x55')][_0x64ab('0x4e')]({'where':{'name':_0x2fa4ab,'userProfileId':_0x37a4da[_0x64ab('0x56')]},'raw':!![]})[_0x64ab('0x2c')](function(_0x55f9fe){if(_0x55f9fe&&_0x55f9fe[_0x64ab('0x57')]===0x0){return db[_0x64ab('0x2b')][_0x64ab('0x50')]({'name':_0x5447d8['name'],'resourceId':_0x5447d8['id'],'type':_0x64ab('0x58'),'sectionId':_0x55f9fe['id']},{})[_0x64ab('0x2c')](function(){return _0x25ecde;});}else{return _0x25ecde;}})[_0x64ab('0x4f')](function(_0x1a6bb8){logger[_0x64ab('0x59')](_0x64ab('0x5a'),_0x1a6bb8);throw _0x1a6bb8;});}return _0x25ecde;})[_0x64ab('0x2c')](respondWithResult(_0x357229,0xc9))[_0x64ab('0x4f')](handleError(_0x357229,null));};exports[_0x64ab('0x28')]=function(_0x376141,_0x974f18){if(_0x376141[_0x64ab('0x5b')]['id']){delete _0x376141[_0x64ab('0x5b')]['id'];}return db['AnalyticCustomReport'][_0x64ab('0x4e')]({'where':{'id':_0x376141['params']['id']}})[_0x64ab('0x2c')](handleEntityNotFound(_0x974f18,null))['then'](saveUpdates(_0x376141[_0x64ab('0x5b')],null))['then'](respondWithResult(_0x974f18,null))[_0x64ab('0x4f')](handleError(_0x974f18,null));};exports['destroy']=function(_0x328373,_0x2ba652){return db[_0x64ab('0x31')][_0x64ab('0x4e')]({'where':{'id':_0x328373['params']['id']}})[_0x64ab('0x2c')](handleEntityNotFound(_0x2ba652,null))['then'](removeEntity(_0x2ba652,null))[_0x64ab('0x4f')](handleError(_0x2ba652,null));};exports[_0x64ab('0x5c')]=function(_0x524e80,_0x3fb356){var _0x40e5e7=0xa;var _0xb5d628=[_0x64ab('0x5d'),_0x64ab('0x5e'),_0x64ab('0x5f'),_0x64ab('0x60')];var _0x5715c5={'SUM':_0x64ab('0x61'),'COUNT':_0x64ab('0x62'),'COUNT DISTINCT':_0x64ab('0x63'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x64ab('0x64'),'GROUP_CONCAT':_0x64ab('0x65'),'GROUP_CONCAT ASC':_0x64ab('0x66'),'GROUP_CONCAT DESC':_0x64ab('0x67')};var _0xa60754={'SEC_TO_TIME':_0x64ab('0x68'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x64ab('0x69'),'UNIX_TIMESTAMP':_0x64ab('0x6a')};var _0x297450=function(_0xe9ee98){return!_[_0x64ab('0x6b')]([_0x64ab('0x6c'),'IS\x20NOT\x20NULL',_0x64ab('0x6d'),'IS\x20NOT\x20EMPTY'],_0xe9ee98);};var _0x3d5fc8=function(_0x4af6a5){if(!_0x4af6a5||!_0x4af6a5[_0x64ab('0x6e')][_0x64ab('0x4d')]){return'';}for(var _0x5a5997='(',_0x1265da=0x0;_0x1265da<_0x4af6a5[_0x64ab('0x6e')][_0x64ab('0x4d')];_0x1265da+=0x1){_0x1265da>0x0&&(_0x5a5997+='\x20'+_0x4af6a5[_0x64ab('0x6f')]+'\x20');_0x5a5997+=_0x4af6a5[_0x64ab('0x6e')][_0x1265da][_0x64ab('0x70')]?_0x3d5fc8(_0x4af6a5[_0x64ab('0x6e')][_0x1265da][_0x64ab('0x70')]):_0x4af6a5[_0x64ab('0x6e')][_0x1265da]['field']+'\x20'+_0x4af6a5[_0x64ab('0x6e')][_0x1265da][_0x64ab('0x71')]+(_0x297450(_0x4af6a5[_0x64ab('0x6e')][_0x1265da][_0x64ab('0x71')])?'\x20'+_0x4af6a5[_0x64ab('0x6e')][_0x1265da]['value']:'');}return _0x5a5997+')';};var _0x12a5cc={'where':{'id':_0x524e80[_0x64ab('0x4b')]['id']}},_0x19a315,_0x57ecab,_0x53bc5c,_0x2117d5,_0xe4db05;_0x12a5cc=_[_0x64ab('0x44')]({},_0x12a5cc,_0x524e80['options']);return db[_0x64ab('0x31')]['find'](_0x12a5cc)[_0x64ab('0x2c')](function(_0x8ce62f){if(_0x8ce62f){_0x19a315=_0x8ce62f;return _0x8ce62f[_0x64ab('0x72')]();}return null;})[_0x64ab('0x2c')](function(_0x5dfa84){if(_0x5dfa84){if(!_0x5dfa84[_0x64ab('0x4d')]){throw new db[(_0x64ab('0x73'))][(_0x64ab('0x74'))](_0x64ab('0x75'),0x193);}_0x57ecab=_0x5dfa84;return db[_0x64ab('0x76')]['findAll']({'raw':!![]});}return null;})[_0x64ab('0x2c')](function(_0x19d8b9){if(_0x19d8b9){_0x53bc5c=_[_0x64ab('0x77')](_0x19d8b9,'id');var _0x34f84e;var _0x3ec6cb=squel[_0x64ab('0x78')]();_0x3ec6cb[_0x64ab('0x79')](_0x19a315[_0x64ab('0x7a')]);for(var _0x431ba8=0x0;_0x431ba8<_0x57ecab['length'];_0x431ba8+=0x1){_0x34f84e=_0x57ecab[_0x431ba8][_0x64ab('0x7b')]?_0x53bc5c[_0x57ecab[_0x431ba8][_0x64ab('0x7b')]]['metric']:_0x57ecab[_0x431ba8][_0x64ab('0x7c')];_0x34f84e=_0x57ecab[_0x431ba8][_0x64ab('0x7d')]?_[_0x64ab('0x7e')](_0x5715c5[_0x57ecab[_0x431ba8][_0x64ab('0x7d')]],'%s',_0x34f84e):_0x34f84e;_0x34f84e=_0x57ecab[_0x431ba8][_0x64ab('0x7f')]?_[_0x64ab('0x7e')](_0xa60754[_0x57ecab[_0x431ba8][_0x64ab('0x7f')]],'%s',_0x34f84e):_0x34f84e;if(_0x57ecab[_0x431ba8][_0x64ab('0x80')]){_0x3ec6cb[_0x64ab('0x70')](_0x34f84e);}_0x57ecab[_0x431ba8]['orderBy']&&_0x3ec6cb[_0x64ab('0x3e')](_0x34f84e,_0x57ecab[_0x431ba8]['orderBy']===_0x64ab('0x81')?![]:!![]);_0x3ec6cb['field'](_0x34f84e,_0x57ecab[_0x431ba8][_0x64ab('0x82')]||_0x34f84e);}if(_0x19a315[_0x64ab('0x83')]){_0x19a315['joins']=JSON[_0x64ab('0x84')](_0x19a315[_0x64ab('0x83')]);for(var _0x188b70=0x0;_0x188b70<_0x19a315['joins'][_0x64ab('0x4d')];_0x188b70+=0x1){if(_0x19a315[_0x64ab('0x83')][_0x188b70]['type']&&_[_0x64ab('0x6b')](_0xb5d628,_0x19a315[_0x64ab('0x83')][_0x188b70][_0x64ab('0x34')])&&_0x19a315[_0x64ab('0x83')][_0x188b70]['parentKey']&&_0x19a315[_0x64ab('0x83')][_0x188b70]['foreignTable']&&_0x19a315[_0x64ab('0x83')][_0x188b70][_0x64ab('0x85')]){_0x3ec6cb[_0x19a315[_0x64ab('0x83')][_0x188b70][_0x64ab('0x34')]](_0x19a315['joins'][_0x188b70]['foreignTable'],null,util[_0x64ab('0x7f')](_0x64ab('0x86'),_0x19a315[_0x64ab('0x7a')],_0x19a315[_0x64ab('0x83')][_0x188b70][_0x64ab('0x87')],_0x19a315[_0x64ab('0x83')][_0x188b70]['foreignTable'],_0x19a315[_0x64ab('0x83')][_0x188b70][_0x64ab('0x85')]));}}}if(_0x19a315[_0x64ab('0x88')]){_0x19a315[_0x64ab('0x88')]=JSON[_0x64ab('0x84')](_0x19a315[_0x64ab('0x88')]);_0x3ec6cb[_0x64ab('0x40')](_0x3d5fc8(_0x19a315[_0x64ab('0x88')]['group']));}_0xe4db05=_0x3ec6cb['clone']();_0x3ec6cb[_0x64ab('0x23')](_0x40e5e7);_0x3ec6cb[_0x64ab('0x21')](0x0);logger[_0x64ab('0x89')](_0x64ab('0x8a'),_0x3ec6cb[_0x64ab('0x8b')]());return dbH[_0x64ab('0x8c')][_0x64ab('0x38')](_0x3ec6cb[_0x64ab('0x8b')](),{'type':dbH[_0x64ab('0x8c')][_0x64ab('0x8d')][_0x64ab('0x8e')]});}})['then'](respondWithResult(_0x3fb356,null))[_0x64ab('0x4f')](handleError(_0x3fb356,null));};function runReport(_0xa24846,_0x3ab896,_0x4e7ef6){var _0x278038=_0x3ab896['name'];var _0x401f82=0xa;var _0x34c282=[_0x64ab('0x5d'),_0x64ab('0x5e'),'right_join','cross_join'];var _0x2eaf65={'SUM':_0x64ab('0x61'),'COUNT':_0x64ab('0x62'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x64ab('0x8f'),'MIN':'MIN(%s)','AVG':_0x64ab('0x64'),'GROUP_CONCAT':_0x64ab('0x65'),'GROUP_CONCAT ASC':_0x64ab('0x66'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x13f72c={'SEC_TO_TIME':_0x64ab('0x68'),'DATE':_0x64ab('0x90'),'HOUR':_0x64ab('0x91'),'ROUND':_0x64ab('0x69'),'UNIX_TIMESTAMP':_0x64ab('0x6a')};var _0x558d65=function(_0x3fe0c9){return!_[_0x64ab('0x6b')]([_0x64ab('0x6c'),_0x64ab('0x92'),_0x64ab('0x6d'),_0x64ab('0x93')],_0x3fe0c9);};var _0x2ba1f1=function(_0x169aee){if(!_0x169aee||!_0x169aee[_0x64ab('0x6e')]['length']){return'';}for(var _0x1c98c='(',_0x493bba=0x0;_0x493bba<_0x169aee[_0x64ab('0x6e')][_0x64ab('0x4d')];_0x493bba+=0x1){_0x493bba>0x0&&(_0x1c98c+='\x20'+_0x169aee['operator']+'\x20');_0x1c98c+=_0x169aee[_0x64ab('0x6e')][_0x493bba][_0x64ab('0x70')]?_0x2ba1f1(_0x169aee['rules'][_0x493bba]['group']):_0x169aee[_0x64ab('0x6e')][_0x493bba][_0x64ab('0x7c')]+'\x20'+_0x169aee[_0x64ab('0x6e')][_0x493bba]['condition']+(_0x558d65(_0x169aee[_0x64ab('0x6e')][_0x493bba][_0x64ab('0x71')])?'\x20'+_0x169aee[_0x64ab('0x6e')][_0x493bba]['value']:'');}return _0x1c98c+')';};var _0x352e7d={'where':{'id':_0xa24846['id']}},_0x2bec14,_0x131fd6,_0x5e7e3e,_0x3914c8,_0x1e433a;_0x352e7d=_[_0x64ab('0x44')]({},_0x352e7d,_0x4e7ef6);return db[_0x64ab('0x31')][_0x64ab('0x4e')](_0x352e7d)[_0x64ab('0x2c')](function(_0xf41e62){if(_0xf41e62){_0x2bec14=_0xf41e62;return _0xf41e62[_0x64ab('0x72')]();}return null;})[_0x64ab('0x2c')](function(_0x4a40af){if(_0x4a40af){if(!_0x4a40af[_0x64ab('0x4d')]){throw new db['Sequelize'][(_0x64ab('0x74'))](_0x64ab('0x75'),0x193);}_0x131fd6=_0x4a40af;return db[_0x64ab('0x76')][_0x64ab('0x94')]({'raw':!![]});}return null;})['then'](function(_0x663822){if(_0x663822){_0x5e7e3e=_[_0x64ab('0x77')](_0x663822,'id');var _0x4286c7;var _0x5b13d7=squel[_0x64ab('0x78')]();_0x5b13d7['from'](_0x2bec14[_0x64ab('0x7a')]);for(var _0x117bde=0x0;_0x117bde<_0x131fd6['length'];_0x117bde+=0x1){_0x4286c7=_0x131fd6[_0x117bde]['MetricId']?_0x5e7e3e[_0x131fd6[_0x117bde][_0x64ab('0x7b')]]['metric']:_0x131fd6[_0x117bde][_0x64ab('0x7c')];_0x4286c7=_0x131fd6[_0x117bde][_0x64ab('0x7d')]?_['replace'](_0x2eaf65[_0x131fd6[_0x117bde][_0x64ab('0x7d')]],'%s',_0x4286c7):_0x4286c7;_0x4286c7=_0x131fd6[_0x117bde][_0x64ab('0x7f')]?_['replace'](_0x13f72c[_0x131fd6[_0x117bde][_0x64ab('0x7f')]],'%s',_0x4286c7):_0x4286c7;if(_0x131fd6[_0x117bde][_0x64ab('0x80')]){_0x5b13d7[_0x64ab('0x70')](_0x4286c7);}_0x131fd6[_0x117bde]['orderBy']&&_0x5b13d7[_0x64ab('0x3e')](_0x4286c7,_0x131fd6[_0x117bde]['orderBy']===_0x64ab('0x81')?![]:!![]);_0x5b13d7[_0x64ab('0x7c')](_0x4286c7,_0x131fd6[_0x117bde][_0x64ab('0x82')]||_0x4286c7);}if(_0x2bec14[_0x64ab('0x83')]){_0x2bec14[_0x64ab('0x83')]=JSON[_0x64ab('0x84')](_0x2bec14[_0x64ab('0x83')]);for(var _0x85ba68=0x0;_0x85ba68<_0x2bec14[_0x64ab('0x83')][_0x64ab('0x4d')];_0x85ba68+=0x1){if(_0x2bec14[_0x64ab('0x83')][_0x85ba68][_0x64ab('0x34')]&&_[_0x64ab('0x6b')](_0x34c282,_0x2bec14[_0x64ab('0x83')][_0x85ba68][_0x64ab('0x34')])&&_0x2bec14[_0x64ab('0x83')][_0x85ba68][_0x64ab('0x87')]&&_0x2bec14[_0x64ab('0x83')][_0x85ba68]['foreignTable']&&_0x2bec14[_0x64ab('0x83')][_0x85ba68][_0x64ab('0x85')]){_0x5b13d7[_0x2bec14[_0x64ab('0x83')][_0x85ba68][_0x64ab('0x34')]](_0x2bec14['joins'][_0x85ba68]['foreignTable'],null,util[_0x64ab('0x7f')](_0x64ab('0x86'),_0x2bec14[_0x64ab('0x7a')],_0x2bec14['joins'][_0x85ba68]['parentKey'],_0x2bec14[_0x64ab('0x83')][_0x85ba68][_0x64ab('0x95')],_0x2bec14[_0x64ab('0x83')][_0x85ba68]['foreignKey']));}}}if(_0x2bec14[_0x64ab('0x88')]){_0x2bec14['conditions']=JSON[_0x64ab('0x84')](_0x2bec14[_0x64ab('0x88')]);_0x5b13d7['where'](_0x2ba1f1(_0x2bec14['conditions'][_0x64ab('0x70')]));}_0x1e433a=_0x5b13d7[_0x64ab('0x96')]();_0x5b13d7[_0x64ab('0x23')](_0x401f82);_0x5b13d7[_0x64ab('0x21')](0x0);return;}})[_0x64ab('0x2c')](function(){if(_0x3ab896['output']===_0x64ab('0x97')){return null;}var _0x27b94b=_[_0x64ab('0x44')](_0x3ab896,{'name':_0x3ab896[_0x64ab('0x98')]||_0x3ab896['name']||_0x2bec14[_0x64ab('0x2e')],'basename':_0x278038,'savename':util[_0x64ab('0x7f')](_0x64ab('0x99'),_0x3ab896[_0x64ab('0x2e')]||_0x2bec14[_0x64ab('0x2e')],require('randomstring')[_0x64ab('0x9a')](0x4),_0x3ab896[_0x64ab('0x9b')]||_0x64ab('0x9c')),'reportId':_0x2bec14['id'],'reportType':'custom'});return db[_0x64ab('0x9d')]['create'](_0x27b94b,{'raw':!![]});})[_0x64ab('0x2c')](function(_0x148090){if(_0x2bec14[_0x64ab('0x7a')]==='cdr'){_0x1e433a[_0x64ab('0x40')](_0x2bec14[_0x64ab('0x7a')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3ab896[_0x64ab('0x9e')],_0x3ab896['endDate']);}else{_0x1e433a[_0x64ab('0x40')](_0x2bec14[_0x64ab('0x7a')]+_0x64ab('0x9f'),_0x3ab896[_0x64ab('0x9e')],_0x3ab896[_0x64ab('0xa0')]);}if(_0x148090){logger[_0x64ab('0xa1')](_0x64ab('0xa2'),_0x1e433a[_0x64ab('0x8b')]());require(_0x64ab('0xa3'))[_0x64ab('0xa4')](path['join'](__dirname,_0x64ab('0xa5'),_0x148090[_0x64ab('0x9b')]),[_0x148090['id'],_0x1e433a[_0x64ab('0x8b')](),path[_0x64ab('0x5d')](__dirname,'../../files/reports',_0x148090['savename']),_0x278038]);return _0x148090;}else{var _0x167177=squel[_0x64ab('0x78')]();_0x167177[_0x64ab('0x79')]('('+_0x1e433a[_0x64ab('0x8b')]()+')',_0x64ab('0xa6'));_0x167177['field']('COUNT(*)','count');_0x1e433a['limit'](_0x3ab896['limit']||_0x401f82);_0x1e433a[_0x64ab('0x21')](_0x3ab896[_0x64ab('0x21')]||0x0);return dbH[_0x64ab('0x8c')][_0x64ab('0x38')](_0x167177[_0x64ab('0x8b')](),{'type':dbH[_0x64ab('0x8c')]['QueryTypes'][_0x64ab('0x8e')]})[_0x64ab('0x2c')](function(_0x2a2230){if(!_0x2a2230[_0x64ab('0x4d')]){_0x3914c8=0x0;}else{_0x3914c8=_0x2a2230[0x0][_0x64ab('0x24')]||0x0;}return dbH[_0x64ab('0x8c')]['query'](_0x1e433a[_0x64ab('0x8b')](),{'type':dbH[_0x64ab('0x8c')][_0x64ab('0x8d')][_0x64ab('0x8e')]});})[_0x64ab('0x2c')](function(_0x877b4f){return{'rows':_0x877b4f||[],'count':_0x3914c8};});}});}exports[_0x64ab('0xa7')]=function(_0x4b6846,_0x399a32){return runReport(_0x4b6846[_0x64ab('0x4b')],_0x4b6846[_0x64ab('0x38')],_0x4b6846[_0x64ab('0x46')])[_0x64ab('0x2c')](respondWithResult(_0x399a32,null))['catch'](handleError(_0x399a32,null));};exports[_0x64ab('0xa8')]=runReport;exports[_0x64ab('0x38')]=function(_0x5f12f7,_0x262bd3){var _0x4bd492=0xa;var _0x11b0cc=[_0x64ab('0x5d'),_0x64ab('0x5e'),_0x64ab('0x5f'),_0x64ab('0x60')];var _0x6bde46={'SUM':_0x64ab('0x61'),'COUNT':_0x64ab('0x62'),'COUNT DISTINCT':_0x64ab('0x63'),'MAX':'MAX(%s)','MIN':_0x64ab('0xa9'),'AVG':_0x64ab('0x64'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x17cbac={'SEC_TO_TIME':_0x64ab('0x68'),'DATE':_0x64ab('0x90'),'HOUR':_0x64ab('0x91'),'ROUND':_0x64ab('0x69'),'UNIX_TIMESTAMP':_0x64ab('0x6a')};var _0xc01f66=function(_0x538efd){return!_['includes'](['IS\x20NULL',_0x64ab('0x92'),_0x64ab('0x6d'),_0x64ab('0x93')],_0x538efd);};var _0x1e6757=function(_0x10e33f){if(!_0x10e33f||!_0x10e33f[_0x64ab('0x6e')][_0x64ab('0x4d')]){return'';}for(var _0x4f255c='(',_0x1390c2=0x0;_0x1390c2<_0x10e33f[_0x64ab('0x6e')][_0x64ab('0x4d')];_0x1390c2+=0x1){_0x1390c2>0x0&&(_0x4f255c+='\x20'+_0x10e33f[_0x64ab('0x6f')]+'\x20');_0x4f255c+=_0x10e33f[_0x64ab('0x6e')][_0x1390c2]['group']?_0x1e6757(_0x10e33f[_0x64ab('0x6e')][_0x1390c2][_0x64ab('0x70')]):_0x10e33f[_0x64ab('0x6e')][_0x1390c2][_0x64ab('0x7c')]+'\x20'+_0x10e33f[_0x64ab('0x6e')][_0x1390c2][_0x64ab('0x71')]+(_0xc01f66(_0x10e33f['rules'][_0x1390c2][_0x64ab('0x71')])?'\x20'+_0x10e33f[_0x64ab('0x6e')][_0x1390c2][_0x64ab('0xaa')]:'');}return _0x4f255c+')';};var _0x20c701={'where':{'id':_0x5f12f7[_0x64ab('0x4b')]['id']}},_0x2cff7d,_0x545f42,_0x282f16,_0x5e200b,_0xcf61d7;_0x20c701=_['merge']({},_0x20c701,_0x5f12f7['options']);return db[_0x64ab('0x31')]['find'](_0x20c701)[_0x64ab('0x2c')](function(_0x20649f){if(_0x20649f){_0x2cff7d=_0x20649f;return _0x20649f[_0x64ab('0x72')]();}return null;})[_0x64ab('0x2c')](function(_0x1e8c8b){if(_0x1e8c8b){if(!_0x1e8c8b[_0x64ab('0x4d')]){throw new db['Sequelize'][(_0x64ab('0x74'))](_0x64ab('0x75'),0x193);}_0x545f42=_0x1e8c8b;return db[_0x64ab('0x76')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x3a07fa){if(_0x3a07fa){_0x282f16=_[_0x64ab('0x77')](_0x3a07fa,'id');var _0x2664ee;var _0x483c05=squel[_0x64ab('0x78')]();_0x483c05['from'](_0x2cff7d[_0x64ab('0x7a')]);for(var _0x5f51e1=0x0;_0x5f51e1<_0x545f42[_0x64ab('0x4d')];_0x5f51e1+=0x1){_0x2664ee=_0x545f42[_0x5f51e1][_0x64ab('0x7b')]?_0x282f16[_0x545f42[_0x5f51e1]['MetricId']][_0x64ab('0xab')]:_0x545f42[_0x5f51e1][_0x64ab('0x7c')];_0x2664ee=_0x545f42[_0x5f51e1]['function']?_[_0x64ab('0x7e')](_0x6bde46[_0x545f42[_0x5f51e1][_0x64ab('0x7d')]],'%s',_0x2664ee):_0x2664ee;_0x2664ee=_0x545f42[_0x5f51e1]['format']?_[_0x64ab('0x7e')](_0x17cbac[_0x545f42[_0x5f51e1][_0x64ab('0x7f')]],'%s',_0x2664ee):_0x2664ee;if(_0x545f42[_0x5f51e1][_0x64ab('0x80')]){_0x483c05['group'](_0x2664ee);}_0x545f42[_0x5f51e1][_0x64ab('0xac')]&&_0x483c05[_0x64ab('0x3e')](_0x2664ee,_0x545f42[_0x5f51e1]['orderBy']==='DESC'?![]:!![]);_0x483c05['field'](_0x2664ee,_0x545f42[_0x5f51e1][_0x64ab('0x82')]||_0x2664ee);}if(_0x2cff7d[_0x64ab('0x83')]){_0x2cff7d[_0x64ab('0x83')]=JSON[_0x64ab('0x84')](_0x2cff7d[_0x64ab('0x83')]);for(var _0x46193b=0x0;_0x46193b<_0x2cff7d['joins'][_0x64ab('0x4d')];_0x46193b+=0x1){if(_0x2cff7d[_0x64ab('0x83')][_0x46193b]['type']&&_[_0x64ab('0x6b')](_0x11b0cc,_0x2cff7d[_0x64ab('0x83')][_0x46193b]['type'])&&_0x2cff7d[_0x64ab('0x83')][_0x46193b][_0x64ab('0x87')]&&_0x2cff7d[_0x64ab('0x83')][_0x46193b][_0x64ab('0x95')]&&_0x2cff7d['joins'][_0x46193b][_0x64ab('0x85')]){_0x483c05[_0x2cff7d['joins'][_0x46193b]['type']](_0x2cff7d['joins'][_0x46193b][_0x64ab('0x95')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x2cff7d['table'],_0x2cff7d['joins'][_0x46193b][_0x64ab('0x87')],_0x2cff7d['joins'][_0x46193b][_0x64ab('0x95')],_0x2cff7d[_0x64ab('0x83')][_0x46193b][_0x64ab('0x85')]));}}}if(_0x2cff7d[_0x64ab('0x88')]){_0x2cff7d['conditions']=JSON[_0x64ab('0x84')](_0x2cff7d['conditions']);_0x483c05[_0x64ab('0x40')](_0x1e6757(_0x2cff7d['conditions'][_0x64ab('0x70')]));}_0xcf61d7=_0x483c05[_0x64ab('0x96')]();_0x483c05[_0x64ab('0x23')](_0x4bd492);_0x483c05[_0x64ab('0x21')](0x0);logger[_0x64ab('0x89')]('Limited\x20Query:',_0x483c05[_0x64ab('0x8b')]());return dbH[_0x64ab('0x8c')][_0x64ab('0x38')](_0x483c05[_0x64ab('0x8b')](),{'type':dbH['sequelize'][_0x64ab('0x8d')][_0x64ab('0x8e')]});}})[_0x64ab('0x2c')](function(){return{'sql':_0xcf61d7[_0x64ab('0x8b')]()};})[_0x64ab('0x2c')](respondWithResult(_0x262bd3,null))[_0x64ab('0x4f')](handleError(_0x262bd3,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 8c41add..578958c 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 _0xda7b=['./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x23fc4b,_0x2602f8){var _0x9d10c1=function(_0x14096b){while(--_0x14096b){_0x23fc4b['push'](_0x23fc4b['shift']());}};_0x9d10c1(++_0x2602f8);}(_0xda7b,0x1f3));var _0xbda7=function(_0x4bfd80,_0x34ce14){_0x4bfd80=_0x4bfd80-0x0;var _0x920c6c=_0xda7b[_0x4bfd80];return _0x920c6c;};'use strict';var _=require(_0xbda7('0x0'));var util=require('util');var logger=require(_0xbda7('0x1'))('api');var moment=require(_0xbda7('0x2'));var BPromise=require(_0xbda7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbda7('0x4'));var rimraf=require(_0xbda7('0x5'));var config=require(_0xbda7('0x6'));var attributes=require(_0xbda7('0x7'));module[_0xbda7('0x8')]=function(_0x2fa8d3,_0x1ff07c){return _0x2fa8d3[_0xbda7('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0xbda7('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x697c=['rimraf','../../config/environment','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xedbb74,_0x6069a){var _0x1e1c35=function(_0x42527d){while(--_0x42527d){_0xedbb74['push'](_0xedbb74['shift']());}};_0x1e1c35(++_0x6069a);}(_0x697c,0x131));var _0xc697=function(_0xb50b94,_0x6b7a4){_0xb50b94=_0xb50b94-0x0;var _0x1cc5a0=_0x697c[_0xb50b94];return _0x1cc5a0;};'use strict';var _=require(_0xc697('0x0'));var util=require(_0xc697('0x1'));var logger=require(_0xc697('0x2'))(_0xc697('0x3'));var moment=require(_0xc697('0x4'));var BPromise=require(_0xc697('0x5'));var rp=require(_0xc697('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc697('0x7'));var config=require(_0xc697('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0xc697('0x9')]=function(_0x131eb4,_0x3a9903){return _0x131eb4['define'](_0xc697('0xa'),attributes,{'tableName':_0xc697('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index b85feef..6aa384f 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 _0x91c5=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x91c5,0x1ae));var _0x591c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x91c5[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x591c('0x0'));var util=require(_0x591c('0x1'));var moment=require('moment');var BPromise=require(_0x591c('0x2'));var rs=require(_0x591c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x591c('0x4'))['db'];var utils=require(_0x591c('0x5'));var logger=require(_0x591c('0x6'))(_0x591c('0x7'));var config=require(_0x591c('0x8'));var jayson=require(_0x591c('0x9'));var client=jayson[_0x591c('0xa')][_0x591c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53b554,_0xba6cfe,_0x1e2569){return new BPromise(function(_0x3888bc,_0x496def){return client[_0x591c('0xc')](_0x53b554,_0x1e2569)[_0x591c('0xd')](function(_0x8ffeb1){logger[_0x591c('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0xba6cfe,_0x591c('0xf'));logger[_0x591c('0x10')](_0x591c('0x11'),_0xba6cfe,_0x591c('0xf'),JSON['stringify'](_0x8ffeb1));if(_0x8ffeb1[_0x591c('0x12')]){if(_0x8ffeb1[_0x591c('0x12')][_0x591c('0x13')]===0x1f4){logger['error'](_0x591c('0x14'),_0xba6cfe,_0x8ffeb1['error'][_0x591c('0x15')]);return _0x496def(_0x8ffeb1[_0x591c('0x12')][_0x591c('0x15')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0xba6cfe,_0x8ffeb1[_0x591c('0x12')][_0x591c('0x15')]);return _0x3888bc(_0x8ffeb1[_0x591c('0x12')][_0x591c('0x15')]);}else{logger['info'](_0x591c('0x14'),_0xba6cfe,_0x591c('0xf'));_0x3888bc(_0x8ffeb1[_0x591c('0x16')]['message']);}})[_0x591c('0x17')](function(_0x355469){logger[_0x591c('0x12')](_0x591c('0x14'),_0xba6cfe,_0x355469);_0x496def(_0x355469);});});}
\ No newline at end of file
+var _0x5bf3=['http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4eb1b5,_0x32b0c6){var _0x1ebed6=function(_0x2cca8f){while(--_0x2cca8f){_0x4eb1b5['push'](_0x4eb1b5['shift']());}};_0x1ebed6(++_0x32b0c6);}(_0x5bf3,0x1a4));var _0x35bf=function(_0x165bc9,_0x4f30d6){_0x165bc9=_0x165bc9-0x0;var _0x2c4540=_0x5bf3[_0x165bc9];return _0x2c4540;};'use strict';var _=require('lodash');var util=require(_0x35bf('0x0'));var moment=require(_0x35bf('0x1'));var BPromise=require(_0x35bf('0x2'));var rs=require(_0x35bf('0x3'));var fs=require('fs');var Redis=require(_0x35bf('0x4'));var db=require(_0x35bf('0x5'))['db'];var utils=require(_0x35bf('0x6'));var logger=require(_0x35bf('0x7'))(_0x35bf('0x8'));var config=require(_0x35bf('0x9'));var jayson=require(_0x35bf('0xa'));var client=jayson[_0x35bf('0xb')][_0x35bf('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x34c9cf,_0x5c2a59,_0x5de66f){return new BPromise(function(_0x10922b,_0xc1fc1e){return client[_0x35bf('0xd')](_0x34c9cf,_0x5de66f)[_0x35bf('0xe')](function(_0x4da803){logger[_0x35bf('0xf')](_0x35bf('0x10'),_0x5c2a59,_0x35bf('0x11'));logger[_0x35bf('0x12')](_0x35bf('0x13'),_0x5c2a59,'request\x20sent',JSON['stringify'](_0x4da803));if(_0x4da803['error']){if(_0x4da803[_0x35bf('0x14')]['code']===0x1f4){logger['error'](_0x35bf('0x10'),_0x5c2a59,_0x4da803[_0x35bf('0x14')][_0x35bf('0x15')]);return _0xc1fc1e(_0x4da803[_0x35bf('0x14')][_0x35bf('0x15')]);}logger[_0x35bf('0x14')](_0x35bf('0x10'),_0x5c2a59,_0x4da803[_0x35bf('0x14')][_0x35bf('0x15')]);return _0x10922b(_0x4da803[_0x35bf('0x14')]['message']);}else{logger[_0x35bf('0xf')](_0x35bf('0x10'),_0x5c2a59,_0x35bf('0x11'));_0x10922b(_0x4da803[_0x35bf('0x16')][_0x35bf('0x15')]);}})[_0x35bf('0x17')](function(_0x39f1fa){logger['error'](_0x35bf('0x10'),_0x5c2a59,_0x39f1fa);_0xc1fc1e(_0x39f1fa);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 36b48d1..ff87647 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 _0x90e0=['/:id/preview','preview','/:id/run','/:id/query','query','put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','/:id','show'];(function(_0xa787cb,_0x1b48c7){var _0x5964f8=function(_0x390d65){while(--_0x390d65){_0xa787cb['push'](_0xa787cb['shift']());}};_0x5964f8(++_0x1b48c7);}(_0x90e0,0x153));var _0x090e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x90e0[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x090e('0x0'));var util=require(_0x090e('0x1'));var path=require('path');var timeout=require(_0x090e('0x2'));var express=require(_0x090e('0x3'));var router=express[_0x090e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x090e('0x5'));var config=require(_0x090e('0x6'));var controller=require(_0x090e('0x7'));router['get']('/',auth[_0x090e('0x8')](),controller[_0x090e('0x9')]);router[_0x090e('0xa')](_0x090e('0xb'),auth[_0x090e('0x8')](),controller[_0x090e('0xc')]);router[_0x090e('0xa')](_0x090e('0xd'),auth[_0x090e('0x8')](),controller[_0x090e('0xe')]);router['get'](_0x090e('0xf'),auth[_0x090e('0x8')](),controller['run']);router[_0x090e('0xa')](_0x090e('0x10'),auth['isAuthenticated'](),controller[_0x090e('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x090e('0x12')](_0x090e('0xb'),auth['isAuthenticated'](),controller[_0x090e('0x13')]);router[_0x090e('0x14')](_0x090e('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x090e('0x15')]=router;
\ No newline at end of file
+var _0x7e1d=['put','update','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','query','post','create'];(function(_0x499bd9,_0x51a209){var _0x5eb275=function(_0x4ce722){while(--_0x4ce722){_0x499bd9['push'](_0x499bd9['shift']());}};_0x5eb275(++_0x51a209);}(_0x7e1d,0xbf));var _0xd7e1=function(_0x4ecfe8,_0x57a7bc){_0x4ecfe8=_0x4ecfe8-0x0;var _0x332ed3=_0x7e1d[_0x4ecfe8];return _0x332ed3;};'use strict';var multer=require('multer');var util=require(_0xd7e1('0x0'));var path=require(_0xd7e1('0x1'));var timeout=require(_0xd7e1('0x2'));var express=require(_0xd7e1('0x3'));var router=express['Router']();var fs_extra=require(_0xd7e1('0x4'));var auth=require(_0xd7e1('0x5'));var interaction=require(_0xd7e1('0x6'));var config=require(_0xd7e1('0x7'));var controller=require(_0xd7e1('0x8'));router[_0xd7e1('0x9')]('/',auth[_0xd7e1('0xa')](),controller[_0xd7e1('0xb')]);router[_0xd7e1('0x9')](_0xd7e1('0xc'),auth[_0xd7e1('0xa')](),controller[_0xd7e1('0xd')]);router[_0xd7e1('0x9')](_0xd7e1('0xe'),auth['isAuthenticated'](),controller['preview']);router[_0xd7e1('0x9')](_0xd7e1('0xf'),auth[_0xd7e1('0xa')](),controller['run']);router[_0xd7e1('0x9')]('/:id/query',auth[_0xd7e1('0xa')](),controller[_0xd7e1('0x10')]);router[_0xd7e1('0x11')]('/',auth[_0xd7e1('0xa')](),controller[_0xd7e1('0x12')]);router[_0xd7e1('0x13')](_0xd7e1('0xc'),auth['isAuthenticated'](),controller[_0xd7e1('0x14')]);router['delete'](_0xd7e1('0xc'),auth[_0xd7e1('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 2b2a457..e7a9d50 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 _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x46ed,0x168));var _0xd46e=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x46ed[_0x29d94e];return _0x106237;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd46e('0x2')]},'parent':{'type':Sequelize[_0xd46e('0x2')]},'table':{'type':Sequelize[_0xd46e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xd46e('0x3')]}};
\ No newline at end of file
+var _0x33c5=['STRING','TEXT','exports'];(function(_0x1a43d5,_0xc8eb23){var _0x36b836=function(_0x3b2e2b){while(--_0x3b2e2b){_0x1a43d5['push'](_0x1a43d5['shift']());}};_0x36b836(++_0xc8eb23);}(_0x33c5,0xe6));var _0x533c=function(_0xf6aec0,_0x51ffd6){_0xf6aec0=_0xf6aec0-0x0;var _0x59a51b=_0x33c5[_0xf6aec0];return _0x59a51b;};'use strict';var Sequelize=require('sequelize');module[_0x533c('0x0')]={'name':{'type':Sequelize[_0x533c('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x533c('0x1')]},'table':{'type':Sequelize[_0x533c('0x1')]},'conditions':{'type':Sequelize[_0x533c('0x2')]},'joins':{'type':Sequelize[_0x533c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index c8a9ed0..c572f23 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 _0xba34=['save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','AVG(%s)','IS\x20NOT\x20NULL','value','order','output','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','fork','countTable','QueryTypes','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject'];(function(_0x5b9168,_0x203c8a){var _0x1c8403=function(_0x59b381){while(--_0x59b381){_0x5b9168['push'](_0x5b9168['shift']());}};_0x1c8403(++_0x203c8a);}(_0xba34,0x119));var _0x4ba3=function(_0x55a269,_0x3be6d9){_0x55a269=_0x55a269-0x0;var _0x29968a=_0xba34[_0x55a269];return _0x29968a;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4ba3('0x19'))['dbH'];function respondWithStatusCode(_0x256f02,_0x4419b4){_0x4419b4=_0x4419b4||0xcc;return function(_0x29e498){if(_0x29e498){return _0x256f02[_0x4ba3('0x1a')](_0x4419b4);}return _0x256f02[_0x4ba3('0x1b')](_0x4419b4)[_0x4ba3('0x1c')]();};}function respondWithResult(_0x3a74f7,_0x12ac90){_0x12ac90=_0x12ac90||0xc8;return function(_0x1dec48){if(_0x1dec48){return _0x3a74f7[_0x4ba3('0x1b')](_0x12ac90)[_0x4ba3('0x1d')](_0x1dec48);}};}function respondWithFilteredResult(_0x301359,_0x29a9d1){return function(_0x25f584){if(_0x25f584){var _0x40e75b=typeof _0x29a9d1[_0x4ba3('0x1e')]==='undefined'&&typeof _0x29a9d1[_0x4ba3('0x1f')]===_0x4ba3('0x20');var _0x5ff7ce=_0x25f584[_0x4ba3('0x21')];var _0x556290=_0x40e75b?0x0:_0x29a9d1[_0x4ba3('0x1e')];var _0xe4eff9=_0x40e75b?_0x25f584[_0x4ba3('0x21')]:_0x29a9d1[_0x4ba3('0x1e')]+_0x29a9d1[_0x4ba3('0x1f')];var _0x125944;if(_0xe4eff9>=_0x5ff7ce){_0xe4eff9=_0x5ff7ce;_0x125944=0xc8;}else{_0x125944=0xce;}_0x301359['status'](_0x125944);return _0x301359['set'](_0x4ba3('0x22'),_0x556290+'-'+_0xe4eff9+'/'+_0x5ff7ce)['json'](_0x25f584);}return null;};}function patchUpdates(_0x18dff5){return function(_0x163967){try{jsonpatch[_0x4ba3('0x23')](_0x163967,_0x18dff5,!![]);}catch(_0xbc7023){return BPromise[_0x4ba3('0x24')](_0xbc7023);}return _0x163967[_0x4ba3('0x25')]();};}function saveUpdates(_0x4a0823,_0x143c78){return function(_0x1f87e1){if(_0x1f87e1){return _0x1f87e1['update'](_0x4a0823)[_0x4ba3('0x26')](function(_0x4ffe39){return _0x4ffe39;});}return null;};}function removeEntity(_0x1ae4de,_0x18abb3){return function(_0x11a917){if(_0x11a917){return _0x11a917[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){var _0xe29a49=_0x11a917[_0x4ba3('0x28')]({'plain':!![]});var _0xe1f7d2=_0x4ba3('0x29');return db[_0x4ba3('0x2a')]['destroy']({'where':{'type':_0xe1f7d2,'resourceId':_0xe29a49['id']}})[_0x4ba3('0x26')](function(){return _0x11a917;});})[_0x4ba3('0x26')](function(){_0x1ae4de[_0x4ba3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10537e,_0x1fe5e2){return function(_0x44d78c){if(!_0x44d78c){_0x10537e['sendStatus'](0x194);}return _0x44d78c;};}function handleError(_0x10cae6,_0x843276){_0x843276=_0x843276||0x1f4;return function(_0x34ecb4){logger[_0x4ba3('0x2b')](_0x34ecb4['stack']);if(_0x34ecb4['name']){delete _0x34ecb4[_0x4ba3('0x2c')];}_0x10cae6[_0x4ba3('0x1b')](_0x843276)[_0x4ba3('0x2d')](_0x34ecb4);};}exports[_0x4ba3('0x2e')]=function(_0x2cb5d5,_0x11f88f){var _0x48b3b7={},_0x27444b={},_0x28f36c={'count':0x0,'rows':[]};var _0x24d8fc=_[_0x4ba3('0x2f')](db[_0x4ba3('0x30')][_0x4ba3('0x31')],function(_0x457236){return{'name':_0x457236[_0x4ba3('0x32')],'type':_0x457236[_0x4ba3('0x33')][_0x4ba3('0x34')]};});_0x27444b['model']=_['map'](_0x24d8fc,'name');_0x27444b[_0x4ba3('0x35')]=_[_0x4ba3('0x36')](_0x2cb5d5[_0x4ba3('0x35')]);_0x27444b[_0x4ba3('0x37')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],_0x27444b[_0x4ba3('0x35')]);_0x48b3b7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x2cb5d5[_0x4ba3('0x35')]['fields']));_0x48b3b7[_0x4ba3('0x3a')]=_0x48b3b7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x48b3b7['attributes']:_0x27444b[_0x4ba3('0x39')];if(!_0x2cb5d5['query'][_0x4ba3('0x3d')](_0x4ba3('0x3e'))){_0x48b3b7[_0x4ba3('0x1f')]=qs[_0x4ba3('0x1f')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1f')]);_0x48b3b7['offset']=qs[_0x4ba3('0x1e')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1e')]);}_0x48b3b7['order']=qs[_0x4ba3('0x3f')](_0x2cb5d5[_0x4ba3('0x35')]['sort']);_0x48b3b7[_0x4ba3('0x40')]=qs['filters'](_['pick'](_0x2cb5d5[_0x4ba3('0x35')],_0x27444b[_0x4ba3('0x37')]),_0x24d8fc);if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x41')]){_0x48b3b7[_0x4ba3('0x40')]=_['merge'](_0x48b3b7[_0x4ba3('0x40')],{'$or':_[_0x4ba3('0x2f')](_0x24d8fc,function(_0x46d2ca){if(_0x46d2ca[_0x4ba3('0x33')]!==_0x4ba3('0x42')){var _0x2acc92={};_0x2acc92[_0x46d2ca[_0x4ba3('0x2c')]]={'$like':'%'+_0x2cb5d5[_0x4ba3('0x35')]['filter']+'%'};return _0x2acc92;}})});}_0x48b3b7=_[_0x4ba3('0x43')]({},_0x48b3b7,_0x2cb5d5[_0x4ba3('0x44')]);var _0x3cb07f={'where':_0x48b3b7[_0x4ba3('0x40')]};return db[_0x4ba3('0x30')][_0x4ba3('0x21')](_0x3cb07f)[_0x4ba3('0x26')](function(_0xdcc2a2){_0x28f36c[_0x4ba3('0x21')]=_0xdcc2a2;if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x45')]){_0x48b3b7[_0x4ba3('0x46')]=[{'all':!![]}];}return db[_0x4ba3('0x30')][_0x4ba3('0x47')](_0x48b3b7);})['then'](function(_0x5af671){_0x28f36c['rows']=_0x5af671;return _0x28f36c;})['then'](respondWithFilteredResult(_0x11f88f,_0x48b3b7))['catch'](handleError(_0x11f88f,null));};exports[_0x4ba3('0x48')]=function(_0x5c4659,_0x29e74d){var _0x5567c7={'raw':!![],'where':{'id':_0x5c4659[_0x4ba3('0x49')]['id']}},_0x53d6eb={};_0x53d6eb[_0x4ba3('0x39')]=_[_0x4ba3('0x36')](db[_0x4ba3('0x30')]['rawAttributes']);_0x53d6eb[_0x4ba3('0x35')]=_['keys'](_0x5c4659[_0x4ba3('0x35')]);_0x53d6eb['filters']=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],_0x53d6eb[_0x4ba3('0x35')]);_0x5567c7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x5c4659['query'][_0x4ba3('0x3b')]));_0x5567c7[_0x4ba3('0x3a')]=_0x5567c7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x5567c7[_0x4ba3('0x3a')]:_0x53d6eb['model'];if(_0x5c4659['query'][_0x4ba3('0x45')]){_0x5567c7[_0x4ba3('0x46')]=[{'all':!![]}];}_0x5567c7=_[_0x4ba3('0x43')]({},_0x5567c7,_0x5c4659['options']);return db[_0x4ba3('0x30')][_0x4ba3('0x4a')](_0x5567c7)[_0x4ba3('0x26')](handleEntityNotFound(_0x29e74d,null))['then'](respondWithResult(_0x29e74d,null))['catch'](handleError(_0x29e74d,null));};exports[_0x4ba3('0x4b')]=function(_0x482a83,_0x439acf){return db[_0x4ba3('0x30')][_0x4ba3('0x4b')](_0x482a83[_0x4ba3('0x4c')],{})[_0x4ba3('0x26')](function(_0x213eb0){var _0x590739=_0x482a83[_0x4ba3('0x4d')][_0x4ba3('0x28')]({'plain':!![]});if(!_0x590739)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x590739[_0x4ba3('0x4e')]===_0x4ba3('0x4d')){var _0x156c2d=_0x213eb0[_0x4ba3('0x28')]({'plain':!![]});var _0x360472='Reports';return db[_0x4ba3('0x4f')][_0x4ba3('0x4a')]({'where':{'name':_0x360472,'userProfileId':_0x590739['userProfileId']},'raw':!![]})[_0x4ba3('0x26')](function(_0x19d70f){if(_0x19d70f&&_0x19d70f[_0x4ba3('0x50')]===0x0){return db[_0x4ba3('0x2a')][_0x4ba3('0x4b')]({'name':_0x156c2d[_0x4ba3('0x2c')],'resourceId':_0x156c2d['id'],'type':_0x4ba3('0x29'),'sectionId':_0x19d70f['id']},{})[_0x4ba3('0x26')](function(){return _0x213eb0;});}else{return _0x213eb0;}})[_0x4ba3('0x51')](function(_0x428a27){logger[_0x4ba3('0x2b')](_0x4ba3('0x52'),_0x428a27);throw _0x428a27;});}return _0x213eb0;})[_0x4ba3('0x26')](respondWithResult(_0x439acf,0xc9))[_0x4ba3('0x51')](handleError(_0x439acf,null));};exports[_0x4ba3('0x53')]=function(_0x48a3d4,_0x5e7ed5){if(_0x48a3d4['body']['id']){delete _0x48a3d4[_0x4ba3('0x4c')]['id'];}return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x48a3d4[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5e7ed5,null))['then'](saveUpdates(_0x48a3d4[_0x4ba3('0x4c')],null))[_0x4ba3('0x26')](respondWithResult(_0x5e7ed5,null))[_0x4ba3('0x51')](handleError(_0x5e7ed5,null));};exports[_0x4ba3('0x27')]=function(_0x5359d1,_0x1e83fb){return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x5359d1[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x1e83fb,null))[_0x4ba3('0x26')](removeEntity(_0x1e83fb,null))[_0x4ba3('0x51')](handleError(_0x1e83fb,null));};exports[_0x4ba3('0x54')]=function(_0x328314,_0x4fa64d){var _0x20c849=0xa;var _0x42bb4b=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x40827a={'SUM':_0x4ba3('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':_0x4ba3('0x5b'),'MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x4cc10a={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4ba3('0x62')};var _0xaef1b=function(_0x2a48fe){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),'IS\x20NOT\x20NULL',_0x4ba3('0x65'),_0x4ba3('0x66')],_0x2a48fe);};var _0x34cc21=function(_0x469ef0){if(!_0x469ef0||!_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')]){return'';}for(var _0x3fdf7f='(',_0x38699e=0x0;_0x38699e<_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')];_0x38699e+=0x1){_0x38699e>0x0&&(_0x3fdf7f+='\x20'+_0x469ef0[_0x4ba3('0x68')]+'\x20');_0x3fdf7f+=_0x469ef0['rules'][_0x38699e][_0x4ba3('0x69')]?_0x34cc21(_0x469ef0[_0x4ba3('0x67')][_0x38699e]['group']):_0x469ef0['rules'][_0x38699e][_0x4ba3('0x6a')]+'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['condition']+(_0xaef1b(_0x469ef0[_0x4ba3('0x67')][_0x38699e][_0x4ba3('0x6b')])?'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['value']:'');}return _0x3fdf7f+')';};var _0x1f5815={'where':{'id':_0x328314['params']['id']}},_0x46224,_0x1af489,_0x11209b,_0x24a75a,_0x3a4838;_0x1f5815=_[_0x4ba3('0x43')]({},_0x1f5815,_0x328314[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x1f5815)[_0x4ba3('0x26')](function(_0x2f8bcc){if(_0x2f8bcc){_0x46224=_0x2f8bcc;return _0x2f8bcc[_0x4ba3('0x6c')]();}return null;})[_0x4ba3('0x26')](function(_0x21c8b1){if(_0x21c8b1){if(!_0x21c8b1[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1af489=_0x21c8b1;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})['then'](function(_0x13ee2c){if(_0x13ee2c){_0x11209b=_[_0x4ba3('0x6f')](_0x13ee2c,'id');var _0x442d66;var _0x5c7fc2=squel[_0x4ba3('0x70')]();_0x5c7fc2[_0x4ba3('0x71')](_0x46224[_0x4ba3('0x72')]);for(var _0x5baf26=0x0;_0x5baf26<_0x1af489[_0x4ba3('0x3c')];_0x5baf26+=0x1){_0x442d66=_0x1af489[_0x5baf26]['MetricId']?_0x11209b[_0x1af489[_0x5baf26][_0x4ba3('0x73')]][_0x4ba3('0x74')]:_0x1af489[_0x5baf26]['field'];_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x40827a[_0x1af489[_0x5baf26][_0x4ba3('0x75')]],'%s',_0x442d66):_0x442d66;_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x4cc10a[_0x1af489[_0x5baf26][_0x4ba3('0x77')]],'%s',_0x442d66):_0x442d66;if(_0x1af489[_0x5baf26][_0x4ba3('0x78')]){_0x5c7fc2[_0x4ba3('0x69')](_0x442d66);}_0x1af489[_0x5baf26][_0x4ba3('0x79')]&&_0x5c7fc2['order'](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x5c7fc2[_0x4ba3('0x6a')](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x7b')]||_0x442d66);}if(_0x46224[_0x4ba3('0x7c')]){_0x46224[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x7c')]);for(var _0x365d94=0x0;_0x365d94<_0x46224[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x365d94+=0x1){if(_0x46224[_0x4ba3('0x7c')][_0x365d94]['type']&&_[_0x4ba3('0x63')](_0x42bb4b,_0x46224[_0x4ba3('0x7c')][_0x365d94]['type'])&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7e')]&&_0x46224['joins'][_0x365d94]['foreignTable']&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]){_0x5c7fc2[_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x33')]](_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x46224['table'],_0x46224[_0x4ba3('0x7c')][_0x365d94]['parentKey'],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]));}}}if(_0x46224[_0x4ba3('0x82')]){_0x46224[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x82')]);_0x5c7fc2['where'](_0x34cc21(_0x46224[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x3a4838=_0x5c7fc2[_0x4ba3('0x83')]();_0x5c7fc2['limit'](_0x20c849);_0x5c7fc2[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x5c7fc2[_0x4ba3('0x86')]());return dbH[_0x4ba3('0x87')][_0x4ba3('0x35')](_0x5c7fc2[_0x4ba3('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x4ba3('0x88')]});}})['then'](respondWithResult(_0x4fa64d,null))[_0x4ba3('0x51')](handleError(_0x4fa64d,null));};function runReport(_0x15508f,_0x108679,_0x20f7db){var _0x5a3c63=_0x108679['name'];var _0x2d16e5=0xa;var _0x2b2132=['join',_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x1e8232={'SUM':_0x4ba3('0x59'),'COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':_0x4ba3('0x8a'),'GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x13dbc4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5aa412=function(_0x4ec70e){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),_0x4ba3('0x65'),_0x4ba3('0x66')],_0x4ec70e);};var _0x333a97=function(_0x30d7a9){if(!_0x30d7a9||!_0x30d7a9['rules'][_0x4ba3('0x3c')]){return'';}for(var _0x4cd4a2='(',_0x31a725=0x0;_0x31a725<_0x30d7a9['rules'][_0x4ba3('0x3c')];_0x31a725+=0x1){_0x31a725>0x0&&(_0x4cd4a2+='\x20'+_0x30d7a9[_0x4ba3('0x68')]+'\x20');_0x4cd4a2+=_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x69')]?_0x333a97(_0x30d7a9[_0x4ba3('0x67')][_0x31a725]['group']):_0x30d7a9['rules'][_0x31a725][_0x4ba3('0x6a')]+'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')]+(_0x5aa412(_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')])?'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x8c')]:'');}return _0x4cd4a2+')';};var _0x3d8606={'where':{'id':_0x15508f['id']}},_0x2d00e3,_0x35441e,_0x217ea4,_0x40dcee,_0x5ea9d0;_0x3d8606=_[_0x4ba3('0x43')]({},_0x3d8606,_0x20f7db);return db['AnalyticDefaultReport'][_0x4ba3('0x4a')](_0x3d8606)[_0x4ba3('0x26')](function(_0x17b970){if(_0x17b970){_0x2d00e3=_0x17b970;return _0x17b970[_0x4ba3('0x6c')]();}return null;})['then'](function(_0x2a2dc2){if(_0x2a2dc2){if(!_0x2a2dc2[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x35441e=_0x2a2dc2;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0x3188c8){if(_0x3188c8){_0x217ea4=_['keyBy'](_0x3188c8,'id');var _0x2f793a;var _0x1194a5=squel[_0x4ba3('0x70')]();_0x1194a5[_0x4ba3('0x71')](_0x2d00e3[_0x4ba3('0x72')]);for(var _0x1e2134=0x0;_0x1e2134<_0x35441e['length'];_0x1e2134+=0x1){_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x73')]?_0x217ea4[_0x35441e[_0x1e2134]['MetricId']][_0x4ba3('0x74')]:_0x35441e[_0x1e2134][_0x4ba3('0x6a')];_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x1e8232[_0x35441e[_0x1e2134]['function']],'%s',_0x2f793a):_0x2f793a;_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x13dbc4[_0x35441e[_0x1e2134]['format']],'%s',_0x2f793a):_0x2f793a;if(_0x35441e[_0x1e2134][_0x4ba3('0x78')]){_0x1194a5['group'](_0x2f793a);}_0x35441e[_0x1e2134][_0x4ba3('0x79')]&&_0x1194a5[_0x4ba3('0x8d')](_0x2f793a,_0x35441e[_0x1e2134][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x1194a5[_0x4ba3('0x6a')](_0x2f793a,_0x35441e[_0x1e2134]['alias']||_0x2f793a);}if(_0x2d00e3['joins']){_0x2d00e3[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x7c')]);for(var _0x56244e=0x0;_0x56244e<_0x2d00e3[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x56244e+=0x1){if(_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x2b2132,_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')])&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')]&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')]&&_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x7f')]){_0x1194a5[_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')]](_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x2d00e3[_0x4ba3('0x72')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e]['foreignKey']));}}}if(_0x2d00e3['conditions']){_0x2d00e3[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x82')]);_0x1194a5[_0x4ba3('0x40')](_0x333a97(_0x2d00e3[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x5ea9d0=_0x1194a5[_0x4ba3('0x83')]();_0x1194a5['limit'](_0x2d16e5);_0x1194a5['offset'](0x0);return;}})[_0x4ba3('0x26')](function(){if(_0x108679[_0x4ba3('0x8e')]==='web'){return null;}var _0x4fb6b5=_['merge'](_0x108679,{'name':_0x108679['fullPath']||_0x108679[_0x4ba3('0x2c')]||_0x2d00e3[_0x4ba3('0x2c')],'basename':_0x5a3c63,'savename':util[_0x4ba3('0x77')](_0x4ba3('0x8f'),_0x108679[_0x4ba3('0x2c')]||_0x2d00e3['name'],require(_0x4ba3('0x90'))[_0x4ba3('0x91')](0x4),_0x108679[_0x4ba3('0x8e')]||'csv'),'reportId':_0x2d00e3['id'],'reportType':'default'});return db['AnalyticExtractedReport']['create'](_0x4fb6b5,{'raw':!![]});})[_0x4ba3('0x26')](function(_0x17d501){if(_0x2d00e3[_0x4ba3('0x72')]===_0x4ba3('0x92')){_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3['table']+_0x4ba3('0x93'),_0x108679['startDate'],_0x108679[_0x4ba3('0x94')]);}else{_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3[_0x4ba3('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x108679[_0x4ba3('0x95')],_0x108679[_0x4ba3('0x94')]);}if(_0x17d501){logger[_0x4ba3('0x96')](_0x4ba3('0x97'),_0x5ea9d0['toString']());require('child_process')[_0x4ba3('0x98')](path[_0x4ba3('0x55')](__dirname,'../../components/export/',_0x17d501[_0x4ba3('0x8e')]),[_0x17d501['id'],_0x5ea9d0['toString'](),path['join'](__dirname,'../../files/reports',_0x17d501['savename']),_0x5a3c63]);return _0x17d501;}else{var _0x2d2ca3=squel[_0x4ba3('0x70')]();_0x2d2ca3[_0x4ba3('0x71')]('('+_0x5ea9d0[_0x4ba3('0x86')]()+')',_0x4ba3('0x99'));_0x2d2ca3['field']('COUNT(*)',_0x4ba3('0x21'));_0x5ea9d0['limit'](_0x108679[_0x4ba3('0x1f')]||_0x2d16e5);_0x5ea9d0[_0x4ba3('0x1e')](_0x108679[_0x4ba3('0x1e')]||0x0);return dbH['sequelize'][_0x4ba3('0x35')](_0x2d2ca3[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]})[_0x4ba3('0x26')](function(_0xc938c){if(!_0xc938c[_0x4ba3('0x3c')]){_0x40dcee=0x0;}else{_0x40dcee=_0xc938c[0x0][_0x4ba3('0x21')]||0x0;}return dbH['sequelize']['query'](_0x5ea9d0[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]});})[_0x4ba3('0x26')](function(_0xd97c26){return{'rows':_0xd97c26||[],'count':_0x40dcee};});}});}exports['run']=function(_0x1fbdc7,_0x9e45ec){return runReport(_0x1fbdc7['params'],_0x1fbdc7[_0x4ba3('0x35')],_0x1fbdc7[_0x4ba3('0x44')])[_0x4ba3('0x26')](respondWithResult(_0x9e45ec,null))[_0x4ba3('0x51')](handleError(_0x9e45ec,null));};exports[_0x4ba3('0x9b')]=runReport;exports[_0x4ba3('0x35')]=function(_0xddfb0c,_0x41c531){var _0x25bf75=0xa;var _0x18bd77=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x2e812b={'SUM':'SUM(%s)','COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':_0x4ba3('0x9c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5dc74f={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':'DATE(%s)','HOUR':_0x4ba3('0x61'),'ROUND':_0x4ba3('0x9d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1590f0=function(_0x5efab9){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),'IS\x20EMPTY',_0x4ba3('0x66')],_0x5efab9);};var _0x4d3262=function(_0x4ad4d3){if(!_0x4ad4d3||!_0x4ad4d3[_0x4ba3('0x67')]['length']){return'';}for(var _0x4529a3='(',_0x9b9c64=0x0;_0x9b9c64<_0x4ad4d3[_0x4ba3('0x67')]['length'];_0x9b9c64+=0x1){_0x9b9c64>0x0&&(_0x4529a3+='\x20'+_0x4ad4d3['operator']+'\x20');_0x4529a3+=_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]?_0x4d3262(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]):_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64]['field']+'\x20'+_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')]+(_0x1590f0(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')])?'\x20'+_0x4ad4d3['rules'][_0x9b9c64][_0x4ba3('0x8c')]:'');}return _0x4529a3+')';};var _0x3073c5={'where':{'id':_0xddfb0c[_0x4ba3('0x49')]['id']}},_0x3d1c11,_0xa41747,_0x25c92c,_0x422a8d,_0x225746;_0x3073c5=_[_0x4ba3('0x43')]({},_0x3073c5,_0xddfb0c[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x3073c5)[_0x4ba3('0x26')](function(_0x3db4c2){if(_0x3db4c2){_0x3d1c11=_0x3db4c2;return _0x3db4c2['getFields']();}return null;})[_0x4ba3('0x26')](function(_0x4a8449){if(_0x4a8449){if(!_0x4a8449[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))](_0x4ba3('0x9e'),0x193);}_0xa41747=_0x4a8449;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0xfaf98a){if(_0xfaf98a){_0x25c92c=_['keyBy'](_0xfaf98a,'id');var _0x30c904;var _0x267801=squel[_0x4ba3('0x70')]();_0x267801[_0x4ba3('0x71')](_0x3d1c11['table']);for(var _0x1bae1b=0x0;_0x1bae1b<_0xa41747[_0x4ba3('0x3c')];_0x1bae1b+=0x1){_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x73')]?_0x25c92c[_0xa41747[_0x1bae1b][_0x4ba3('0x73')]]['metric']:_0xa41747[_0x1bae1b][_0x4ba3('0x6a')];_0x30c904=_0xa41747[_0x1bae1b]['function']?_[_0x4ba3('0x76')](_0x2e812b[_0xa41747[_0x1bae1b][_0x4ba3('0x75')]],'%s',_0x30c904):_0x30c904;_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x5dc74f[_0xa41747[_0x1bae1b]['format']],'%s',_0x30c904):_0x30c904;if(_0xa41747[_0x1bae1b]['groupBy']){_0x267801[_0x4ba3('0x69')](_0x30c904);}_0xa41747[_0x1bae1b][_0x4ba3('0x79')]&&_0x267801[_0x4ba3('0x8d')](_0x30c904,_0xa41747[_0x1bae1b]['orderBy']==='DESC'?![]:!![]);_0x267801[_0x4ba3('0x6a')](_0x30c904,_0xa41747[_0x1bae1b][_0x4ba3('0x7b')]||_0x30c904);}if(_0x3d1c11[_0x4ba3('0x7c')]){_0x3d1c11[_0x4ba3('0x7c')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x7c')]);for(var _0x2f4966=0x0;_0x2f4966<_0x3d1c11[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x2f4966+=0x1){if(_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x18bd77,_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')])&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x80')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7f')]){_0x267801[_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]](_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x3d1c11[_0x4ba3('0x72')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],_0x3d1c11['joins'][_0x2f4966][_0x4ba3('0x7f')]));}}}if(_0x3d1c11[_0x4ba3('0x82')]){_0x3d1c11[_0x4ba3('0x82')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x82')]);_0x267801[_0x4ba3('0x40')](_0x4d3262(_0x3d1c11[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x225746=_0x267801[_0x4ba3('0x83')]();_0x267801[_0x4ba3('0x1f')](_0x25bf75);_0x267801[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x267801['toString']());return dbH[_0x4ba3('0x87')]['query'](_0x267801['toString'](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')]['SELECT']});}})[_0x4ba3('0x26')](function(){return{'sql':_0x225746[_0x4ba3('0x86')]()};})[_0x4ba3('0x26')](respondWithResult(_0x41c531,null))[_0x4ba3('0x51')](handleError(_0x41c531,null));};
\ No newline at end of file
+var _0xc6ac=['keyBy','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','DefaultReports','UserProfileResource','stack','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','name','query','keys','filters','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','intersection','length','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','field','condition','value','Sequelize','AnalyticMetric','select','from','table','MetricId','replace','format','group','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','COUNT(%s)','COUNT(DISTINCT\x20%s)','IS\x20NOT\x20EMPTY','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','metric','function','groupBy','orderBy','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','getFields'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x5dad5a,_0x24f358){_0x5dad5a=_0x5dad5a-0x0;var _0x19d88a=_0xc6ac[_0x5dad5a];return _0x19d88a;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xcc6a('0x1b')];function respondWithStatusCode(_0x211444,_0x4300c0){_0x4300c0=_0x4300c0||0xcc;return function(_0x559a0a){if(_0x559a0a){return _0x211444['sendStatus'](_0x4300c0);}return _0x211444[_0xcc6a('0x1c')](_0x4300c0)[_0xcc6a('0x1d')]();};}function respondWithResult(_0x43710d,_0x348af7){_0x348af7=_0x348af7||0xc8;return function(_0x96f9de){if(_0x96f9de){return _0x43710d[_0xcc6a('0x1c')](_0x348af7)[_0xcc6a('0x1e')](_0x96f9de);}};}function respondWithFilteredResult(_0x403b18,_0x56ffb0){return function(_0x4e628f){if(_0x4e628f){var _0x4d021a=typeof _0x56ffb0[_0xcc6a('0x1f')]===_0xcc6a('0x20')&&typeof _0x56ffb0[_0xcc6a('0x21')]===_0xcc6a('0x20');var _0x33079c=_0x4e628f[_0xcc6a('0x22')];var _0x2d9585=_0x4d021a?0x0:_0x56ffb0[_0xcc6a('0x1f')];var _0x374e51=_0x4d021a?_0x4e628f[_0xcc6a('0x22')]:_0x56ffb0[_0xcc6a('0x1f')]+_0x56ffb0['limit'];var _0xfec60f;if(_0x374e51>=_0x33079c){_0x374e51=_0x33079c;_0xfec60f=0xc8;}else{_0xfec60f=0xce;}_0x403b18[_0xcc6a('0x1c')](_0xfec60f);return _0x403b18[_0xcc6a('0x23')](_0xcc6a('0x24'),_0x2d9585+'-'+_0x374e51+'/'+_0x33079c)[_0xcc6a('0x1e')](_0x4e628f);}return null;};}function patchUpdates(_0x30b8ed){return function(_0x36c80f){try{jsonpatch[_0xcc6a('0x25')](_0x36c80f,_0x30b8ed,!![]);}catch(_0x2254a8){return BPromise[_0xcc6a('0x26')](_0x2254a8);}return _0x36c80f[_0xcc6a('0x27')]();};}function saveUpdates(_0x845088,_0x51be9a){return function(_0x41c4c8){if(_0x41c4c8){return _0x41c4c8[_0xcc6a('0x28')](_0x845088)[_0xcc6a('0x29')](function(_0x581aae){return _0x581aae;});}return null;};}function removeEntity(_0x10016a,_0x294486){return function(_0x3a00e5){if(_0x3a00e5){return _0x3a00e5[_0xcc6a('0x2a')]()[_0xcc6a('0x29')](function(){var _0x5fc697=_0x3a00e5['get']({'plain':!![]});var _0x26def8=_0xcc6a('0x2b');return db[_0xcc6a('0x2c')]['destroy']({'where':{'type':_0x26def8,'resourceId':_0x5fc697['id']}})[_0xcc6a('0x29')](function(){return _0x3a00e5;});})[_0xcc6a('0x29')](function(){_0x10016a['status'](0xcc)[_0xcc6a('0x1d')]();});}};}function handleEntityNotFound(_0x8b1b2b,_0x3233d1){return function(_0x473f88){if(!_0x473f88){_0x8b1b2b['sendStatus'](0x194);}return _0x473f88;};}function handleError(_0x194aab,_0x3cf14c){_0x3cf14c=_0x3cf14c||0x1f4;return function(_0x2c6d88){logger['error'](_0x2c6d88[_0xcc6a('0x2d')]);if(_0x2c6d88['name']){delete _0x2c6d88['name'];}_0x194aab[_0xcc6a('0x1c')](_0x3cf14c)[_0xcc6a('0x2e')](_0x2c6d88);};}exports[_0xcc6a('0x2f')]=function(_0x11b481,_0x2b575d){var _0x131138={},_0x4e2de4={},_0x7b2b54={'count':0x0,'rows':[]};var _0x28e3c3=_[_0xcc6a('0x30')](db[_0xcc6a('0x31')][_0xcc6a('0x32')],function(_0x152ebd){return{'name':_0x152ebd[_0xcc6a('0x33')],'type':_0x152ebd[_0xcc6a('0x34')]['key']};});_0x4e2de4[_0xcc6a('0x35')]=_[_0xcc6a('0x30')](_0x28e3c3,_0xcc6a('0x36'));_0x4e2de4[_0xcc6a('0x37')]=_[_0xcc6a('0x38')](_0x11b481[_0xcc6a('0x37')]);_0x4e2de4[_0xcc6a('0x39')]=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],_0x4e2de4['query']);_0x131138['attributes']=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3a')]));_0x131138[_0xcc6a('0x3b')]=_0x131138['attributes']['length']?_0x131138[_0xcc6a('0x3b')]:_0x4e2de4[_0xcc6a('0x35')];if(!_0x11b481[_0xcc6a('0x37')]['hasOwnProperty'](_0xcc6a('0x3c'))){_0x131138[_0xcc6a('0x21')]=qs[_0xcc6a('0x21')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x21')]);_0x131138[_0xcc6a('0x1f')]=qs[_0xcc6a('0x1f')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x1f')]);}_0x131138[_0xcc6a('0x3d')]=qs[_0xcc6a('0x3e')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3e')]);_0x131138[_0xcc6a('0x3f')]=qs[_0xcc6a('0x39')](_[_0xcc6a('0x40')](_0x11b481[_0xcc6a('0x37')],_0x4e2de4[_0xcc6a('0x39')]),_0x28e3c3);if(_0x11b481['query']['filter']){_0x131138[_0xcc6a('0x3f')]=_[_0xcc6a('0x41')](_0x131138[_0xcc6a('0x3f')],{'$or':_[_0xcc6a('0x30')](_0x28e3c3,function(_0x1e628b){if(_0x1e628b[_0xcc6a('0x34')]!==_0xcc6a('0x42')){var _0x1199f1={};_0x1199f1[_0x1e628b['name']]={'$like':'%'+_0x11b481['query'][_0xcc6a('0x43')]+'%'};return _0x1199f1;}})});}_0x131138=_['merge']({},_0x131138,_0x11b481['options']);var _0x5cf1ba={'where':_0x131138[_0xcc6a('0x3f')]};return db[_0xcc6a('0x31')][_0xcc6a('0x22')](_0x5cf1ba)[_0xcc6a('0x29')](function(_0xe8056f){_0x7b2b54['count']=_0xe8056f;if(_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x44')]){_0x131138[_0xcc6a('0x45')]=[{'all':!![]}];}return db[_0xcc6a('0x31')][_0xcc6a('0x46')](_0x131138);})[_0xcc6a('0x29')](function(_0x54f862){_0x7b2b54[_0xcc6a('0x47')]=_0x54f862;return _0x7b2b54;})[_0xcc6a('0x29')](respondWithFilteredResult(_0x2b575d,_0x131138))[_0xcc6a('0x48')](handleError(_0x2b575d,null));};exports[_0xcc6a('0x49')]=function(_0x494904,_0x1fe723){var _0x4a9cea={'raw':!![],'where':{'id':_0x494904[_0xcc6a('0x4a')]['id']}},_0x351529={};_0x351529[_0xcc6a('0x35')]=_['keys'](db[_0xcc6a('0x31')][_0xcc6a('0x32')]);_0x351529[_0xcc6a('0x37')]=_['keys'](_0x494904['query']);_0x351529[_0xcc6a('0x39')]=_[_0xcc6a('0x4b')](_0x351529[_0xcc6a('0x35')],_0x351529[_0xcc6a('0x37')]);_0x4a9cea[_0xcc6a('0x3b')]=_['intersection'](_0x351529[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x494904['query'][_0xcc6a('0x3a')]));_0x4a9cea[_0xcc6a('0x3b')]=_0x4a9cea[_0xcc6a('0x3b')][_0xcc6a('0x4c')]?_0x4a9cea[_0xcc6a('0x3b')]:_0x351529[_0xcc6a('0x35')];if(_0x494904['query']['includeAll']){_0x4a9cea['include']=[{'all':!![]}];}_0x4a9cea=_[_0xcc6a('0x41')]({},_0x4a9cea,_0x494904[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4a9cea)['then'](handleEntityNotFound(_0x1fe723,null))[_0xcc6a('0x29')](respondWithResult(_0x1fe723,null))['catch'](handleError(_0x1fe723,null));};exports[_0xcc6a('0x4f')]=function(_0x4299ca,_0xcfc540){return db[_0xcc6a('0x31')][_0xcc6a('0x4f')](_0x4299ca[_0xcc6a('0x50')],{})['then'](function(_0x1a3b82){var _0x7288b2=_0x4299ca[_0xcc6a('0x51')][_0xcc6a('0x52')]({'plain':!![]});if(!_0x7288b2)throw new Error(_0xcc6a('0x53'));if(_0x7288b2[_0xcc6a('0x54')]===_0xcc6a('0x51')){var _0x392805=_0x1a3b82[_0xcc6a('0x52')]({'plain':!![]});var _0x30d0ef='Reports';return db[_0xcc6a('0x55')][_0xcc6a('0x4e')]({'where':{'name':_0x30d0ef,'userProfileId':_0x7288b2[_0xcc6a('0x56')]},'raw':!![]})[_0xcc6a('0x29')](function(_0x14f5e5){if(_0x14f5e5&&_0x14f5e5[_0xcc6a('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x392805[_0xcc6a('0x36')],'resourceId':_0x392805['id'],'type':'DefaultReports','sectionId':_0x14f5e5['id']},{})[_0xcc6a('0x29')](function(){return _0x1a3b82;});}else{return _0x1a3b82;}})[_0xcc6a('0x48')](function(_0x2b5782){logger[_0xcc6a('0x58')](_0xcc6a('0x59'),_0x2b5782);throw _0x2b5782;});}return _0x1a3b82;})[_0xcc6a('0x29')](respondWithResult(_0xcfc540,0xc9))[_0xcc6a('0x48')](handleError(_0xcfc540,null));};exports[_0xcc6a('0x28')]=function(_0x68b823,_0x27b074){if(_0x68b823[_0xcc6a('0x50')]['id']){delete _0x68b823['body']['id'];}return db[_0xcc6a('0x31')]['find']({'where':{'id':_0x68b823[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x27b074,null))[_0xcc6a('0x29')](saveUpdates(_0x68b823['body'],null))[_0xcc6a('0x29')](respondWithResult(_0x27b074,null))['catch'](handleError(_0x27b074,null));};exports[_0xcc6a('0x2a')]=function(_0x5db3b5,_0x3c0b1c){return db[_0xcc6a('0x31')][_0xcc6a('0x4e')]({'where':{'id':_0x5db3b5[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x3c0b1c,null))[_0xcc6a('0x29')](removeEntity(_0x3c0b1c,null))[_0xcc6a('0x48')](handleError(_0x3c0b1c,null));};exports[_0xcc6a('0x5a')]=function(_0x506311,_0x14d3ff){var _0x56d512=0xa;var _0x3a6b7e=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x586789={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x389e5f={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2cc561=function(_0x483aa4){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x483aa4);};var _0x46d93b=function(_0x4ed702){if(!_0x4ed702||!_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x20a16b='(',_0x19a578=0x0;_0x19a578<_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')];_0x19a578+=0x1){_0x19a578>0x0&&(_0x20a16b+='\x20'+_0x4ed702[_0xcc6a('0x6f')]+'\x20');_0x20a16b+=_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['group']?_0x46d93b(_0x4ed702['rules'][_0x19a578]['group']):_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x70')]+'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['condition']+(_0x2cc561(_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x71')])?'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x72')]:'');}return _0x20a16b+')';};var _0x5e1c69={'where':{'id':_0x506311['params']['id']}},_0x481d25,_0xaec5e8,_0x41527b,_0x4403d3,_0x386a74;_0x5e1c69=_[_0xcc6a('0x41')]({},_0x5e1c69,_0x506311[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x5e1c69)[_0xcc6a('0x29')](function(_0x55d129){if(_0x55d129){_0x481d25=_0x55d129;return _0x55d129['getFields']();}return null;})[_0xcc6a('0x29')](function(_0xd1a27b){if(_0xd1a27b){if(!_0xd1a27b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xaec5e8=_0xd1a27b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x421d0b){if(_0x421d0b){_0x41527b=_['keyBy'](_0x421d0b,'id');var _0x4a8863;var _0x58e6b4=squel[_0xcc6a('0x75')]();_0x58e6b4[_0xcc6a('0x76')](_0x481d25[_0xcc6a('0x77')]);for(var _0x729b2=0x0;_0x729b2<_0xaec5e8['length'];_0x729b2+=0x1){_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x78')]?_0x41527b[_0xaec5e8[_0x729b2][_0xcc6a('0x78')]]['metric']:_0xaec5e8[_0x729b2][_0xcc6a('0x70')];_0x4a8863=_0xaec5e8[_0x729b2]['function']?_[_0xcc6a('0x79')](_0x586789[_0xaec5e8[_0x729b2]['function']],'%s',_0x4a8863):_0x4a8863;_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x389e5f[_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]],'%s',_0x4a8863):_0x4a8863;if(_0xaec5e8[_0x729b2]['groupBy']){_0x58e6b4[_0xcc6a('0x7b')](_0x4a8863);}_0xaec5e8[_0x729b2]['orderBy']&&_0x58e6b4[_0xcc6a('0x3d')](_0x4a8863,_0xaec5e8[_0x729b2]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x58e6b4[_0xcc6a('0x70')](_0x4a8863,_0xaec5e8[_0x729b2][_0xcc6a('0x7d')]||_0x4a8863);}if(_0x481d25[_0xcc6a('0x7e')]){_0x481d25[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x481d25['joins']);for(var _0x18f5dc=0x0;_0x18f5dc<_0x481d25[_0xcc6a('0x7e')][_0xcc6a('0x4c')];_0x18f5dc+=0x1){if(_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]&&_['includes'](_0x3a6b7e,_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')])&&_0x481d25['joins'][_0x18f5dc]['parentKey']&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x80')]&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]){_0x58e6b4[_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]](_0x481d25['joins'][_0x18f5dc][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x481d25[_0xcc6a('0x77')],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x83')],_0x481d25['joins'][_0x18f5dc]['foreignTable'],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]));}}}if(_0x481d25[_0xcc6a('0x84')]){_0x481d25[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x481d25[_0xcc6a('0x84')]);_0x58e6b4[_0xcc6a('0x3f')](_0x46d93b(_0x481d25['conditions'][_0xcc6a('0x7b')]));}_0x386a74=_0x58e6b4[_0xcc6a('0x85')]();_0x58e6b4[_0xcc6a('0x21')](_0x56d512);_0x58e6b4[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x58e6b4['toString']());return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x58e6b4[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')][_0xcc6a('0x8b')]});}})[_0xcc6a('0x29')](respondWithResult(_0x14d3ff,null))[_0xcc6a('0x48')](handleError(_0x14d3ff,null));};function runReport(_0x2a25df,_0x1f1ff7,_0x565bcd){var _0x45c45f=_0x1f1ff7[_0xcc6a('0x36')];var _0x58cd56=0xa;var _0x1848dd=[_0xcc6a('0x8c'),_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x5abd5c={'SUM':_0xcc6a('0x5e'),'COUNT':_0xcc6a('0x8d'),'COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x5be65b={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2b5c15=function(_0x3207b2){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),_0xcc6a('0x8f')],_0x3207b2);};var _0x58fdb3=function(_0xb4b2b4){if(!_0xb4b2b4||!_0xb4b2b4[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x275e15='(',_0x53b419=0x0;_0x53b419<_0xb4b2b4[_0xcc6a('0x6e')]['length'];_0x53b419+=0x1){_0x53b419>0x0&&(_0x275e15+='\x20'+_0xb4b2b4[_0xcc6a('0x6f')]+'\x20');_0x275e15+=_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]?_0x58fdb3(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]):_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x70')]+'\x20'+_0xb4b2b4['rules'][_0x53b419][_0xcc6a('0x71')]+(_0x2b5c15(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x71')])?'\x20'+_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x72')]:'');}return _0x275e15+')';};var _0x4473ab={'where':{'id':_0x2a25df['id']}},_0x558e2f,_0x14a957,_0x350766,_0x589bff,_0x5661b5;_0x4473ab=_[_0xcc6a('0x41')]({},_0x4473ab,_0x565bcd);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4473ab)[_0xcc6a('0x29')](function(_0x2f0b79){if(_0x2f0b79){_0x558e2f=_0x2f0b79;return _0x2f0b79['getFields']();}return null;})[_0xcc6a('0x29')](function(_0x4a268b){if(_0x4a268b){if(!_0x4a268b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x14a957=_0x4a268b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x1f4c4e){if(_0x1f4c4e){_0x350766=_['keyBy'](_0x1f4c4e,'id');var _0x312431;var _0x2a850c=squel[_0xcc6a('0x75')]();_0x2a850c['from'](_0x558e2f[_0xcc6a('0x77')]);for(var _0xd5b9f3=0x0;_0xd5b9f3<_0x14a957[_0xcc6a('0x4c')];_0xd5b9f3+=0x1){_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]?_0x350766[_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x14a957[_0xd5b9f3][_0xcc6a('0x70')];_0x312431=_0x14a957[_0xd5b9f3]['function']?_[_0xcc6a('0x79')](_0x5abd5c[_0x14a957[_0xd5b9f3][_0xcc6a('0x93')]],'%s',_0x312431):_0x312431;_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x5be65b[_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]],'%s',_0x312431):_0x312431;if(_0x14a957[_0xd5b9f3][_0xcc6a('0x94')]){_0x2a850c[_0xcc6a('0x7b')](_0x312431);}_0x14a957[_0xd5b9f3][_0xcc6a('0x95')]&&_0x2a850c['order'](_0x312431,_0x14a957[_0xd5b9f3]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x2a850c['field'](_0x312431,_0x14a957[_0xd5b9f3][_0xcc6a('0x7d')]||_0x312431);}if(_0x558e2f[_0xcc6a('0x7e')]){_0x558e2f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x7e')]);for(var _0x1f7ee5=0x0;_0x1f7ee5<_0x558e2f[_0xcc6a('0x7e')]['length'];_0x1f7ee5+=0x1){if(_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type']&&_['includes'](_0x1848dd,_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type'])&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')]&&_0x558e2f['joins'][_0x1f7ee5]['foreignTable']&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['foreignKey']){_0x2a850c[_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x34')]](_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x558e2f['table'],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],_0x558e2f['joins'][_0x1f7ee5][_0xcc6a('0x81')]));}}}if(_0x558e2f[_0xcc6a('0x84')]){_0x558e2f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x84')]);_0x2a850c[_0xcc6a('0x3f')](_0x58fdb3(_0x558e2f[_0xcc6a('0x84')]['group']));}_0x5661b5=_0x2a850c[_0xcc6a('0x85')]();_0x2a850c[_0xcc6a('0x21')](_0x58cd56);_0x2a850c['offset'](0x0);return;}})[_0xcc6a('0x29')](function(){if(_0x1f1ff7[_0xcc6a('0x96')]===_0xcc6a('0x97')){return null;}var _0x2297ea=_[_0xcc6a('0x41')](_0x1f1ff7,{'name':_0x1f1ff7[_0xcc6a('0x98')]||_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],'basename':_0x45c45f,'savename':util[_0xcc6a('0x7a')](_0xcc6a('0x99'),_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],require(_0xcc6a('0x9a'))[_0xcc6a('0x9b')](0x4),_0x1f1ff7['output']||'csv'),'reportId':_0x558e2f['id'],'reportType':_0xcc6a('0x9c')});return db[_0xcc6a('0x9d')]['create'](_0x2297ea,{'raw':!![]});})[_0xcc6a('0x29')](function(_0x1e74a4){if(_0x558e2f[_0xcc6a('0x77')]==='cdr'){_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0x9e'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7['endDate']);}else{_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0xa0'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7[_0xcc6a('0xa1')]);}if(_0x1e74a4){logger[_0xcc6a('0xa2')](_0xcc6a('0xa3'),_0x5661b5[_0xcc6a('0x89')]());require('child_process')['fork'](path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa4'),_0x1e74a4[_0xcc6a('0x96')]),[_0x1e74a4['id'],_0x5661b5['toString'](),path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa5'),_0x1e74a4[_0xcc6a('0xa6')]),_0x45c45f]);return _0x1e74a4;}else{var _0x3b7b43=squel['select']();_0x3b7b43[_0xcc6a('0x76')]('('+_0x5661b5[_0xcc6a('0x89')]()+')',_0xcc6a('0xa7'));_0x3b7b43['field'](_0xcc6a('0xa8'),'count');_0x5661b5[_0xcc6a('0x21')](_0x1f1ff7[_0xcc6a('0x21')]||_0x58cd56);_0x5661b5['offset'](_0x1f1ff7[_0xcc6a('0x1f')]||0x0);return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x3b7b43[_0xcc6a('0x89')](),{'type':dbH[_0xcc6a('0x88')][_0xcc6a('0x8a')][_0xcc6a('0x8b')]})[_0xcc6a('0x29')](function(_0x25ba57){if(!_0x25ba57[_0xcc6a('0x4c')]){_0x589bff=0x0;}else{_0x589bff=_0x25ba57[0x0][_0xcc6a('0x22')]||0x0;}return dbH['sequelize']['query'](_0x5661b5[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});})['then'](function(_0x32ced0){return{'rows':_0x32ced0||[],'count':_0x589bff};});}});}exports[_0xcc6a('0xa9')]=function(_0xc638ae,_0x3367e8){return runReport(_0xc638ae['params'],_0xc638ae[_0xcc6a('0x37')],_0xc638ae['options'])['then'](respondWithResult(_0x3367e8,null))[_0xcc6a('0x48')](handleError(_0x3367e8,null));};exports[_0xcc6a('0xaa')]=runReport;exports[_0xcc6a('0x37')]=function(_0x38d805,_0x3f5f97){var _0x399eb6=0xa;var _0x2ae391=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x50b948={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x1d2ae0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x41d17b=function(_0x1827e6){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),'IS\x20NOT\x20NULL',_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x1827e6);};var _0xa70fa=function(_0x33ec76){if(!_0x33ec76||!_0x33ec76[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x30162c='(',_0x48746a=0x0;_0x48746a<_0x33ec76['rules'][_0xcc6a('0x4c')];_0x48746a+=0x1){_0x48746a>0x0&&(_0x30162c+='\x20'+_0x33ec76[_0xcc6a('0x6f')]+'\x20');_0x30162c+=_0x33ec76['rules'][_0x48746a][_0xcc6a('0x7b')]?_0xa70fa(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x7b')]):_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x70')]+'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['condition']+(_0x41d17b(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x71')])?'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['value']:'');}return _0x30162c+')';};var _0x54f0e4={'where':{'id':_0x38d805[_0xcc6a('0x4a')]['id']}},_0x559f4f,_0x545b15,_0x17a4e1,_0x5a7da7,_0x434c8b;_0x54f0e4=_['merge']({},_0x54f0e4,_0x38d805[_0xcc6a('0x4d')]);return db['AnalyticDefaultReport'][_0xcc6a('0x4e')](_0x54f0e4)[_0xcc6a('0x29')](function(_0xe9231f){if(_0xe9231f){_0x559f4f=_0xe9231f;return _0xe9231f[_0xcc6a('0xab')]();}return null;})[_0xcc6a('0x29')](function(_0x197961){if(_0x197961){if(!_0x197961[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x545b15=_0x197961;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x171a2a){if(_0x171a2a){_0x17a4e1=_[_0xcc6a('0xac')](_0x171a2a,'id');var _0x13860b;var _0x3b52f7=squel[_0xcc6a('0x75')]();_0x3b52f7[_0xcc6a('0x76')](_0x559f4f[_0xcc6a('0x77')]);for(var _0x319f4a=0x0;_0x319f4a<_0x545b15[_0xcc6a('0x4c')];_0x319f4a+=0x1){_0x13860b=_0x545b15[_0x319f4a]['MetricId']?_0x17a4e1[_0x545b15[_0x319f4a][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x545b15[_0x319f4a][_0xcc6a('0x70')];_0x13860b=_0x545b15[_0x319f4a]['function']?_[_0xcc6a('0x79')](_0x50b948[_0x545b15[_0x319f4a][_0xcc6a('0x93')]],'%s',_0x13860b):_0x13860b;_0x13860b=_0x545b15[_0x319f4a]['format']?_[_0xcc6a('0x79')](_0x1d2ae0[_0x545b15[_0x319f4a][_0xcc6a('0x7a')]],'%s',_0x13860b):_0x13860b;if(_0x545b15[_0x319f4a]['groupBy']){_0x3b52f7[_0xcc6a('0x7b')](_0x13860b);}_0x545b15[_0x319f4a][_0xcc6a('0x95')]&&_0x3b52f7[_0xcc6a('0x3d')](_0x13860b,_0x545b15[_0x319f4a][_0xcc6a('0x95')]===_0xcc6a('0x7c')?![]:!![]);_0x3b52f7[_0xcc6a('0x70')](_0x13860b,_0x545b15[_0x319f4a]['alias']||_0x13860b);}if(_0x559f4f['joins']){_0x559f4f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x559f4f['joins']);for(var _0x154885=0x0;_0x154885<_0x559f4f['joins'][_0xcc6a('0x4c')];_0x154885+=0x1){if(_0x559f4f['joins'][_0x154885][_0xcc6a('0x34')]&&_[_0xcc6a('0x6a')](_0x2ae391,_0x559f4f[_0xcc6a('0x7e')][_0x154885]['type'])&&_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')]&&_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignTable']&&_0x559f4f['joins'][_0x154885]['foreignKey']){_0x3b52f7[_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x34')]](_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x559f4f[_0xcc6a('0x77')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignKey']));}}}if(_0x559f4f[_0xcc6a('0x84')]){_0x559f4f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x559f4f['conditions']);_0x3b52f7[_0xcc6a('0x3f')](_0xa70fa(_0x559f4f[_0xcc6a('0x84')][_0xcc6a('0x7b')]));}_0x434c8b=_0x3b52f7['clone']();_0x3b52f7[_0xcc6a('0x21')](_0x399eb6);_0x3b52f7[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x3b52f7['toString']());return dbH[_0xcc6a('0x88')]['query'](_0x3b52f7['toString'](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});}})['then'](function(){return{'sql':_0x434c8b[_0xcc6a('0x89')]()};})[_0xcc6a('0x29')](respondWithResult(_0x3f5f97,null))[_0xcc6a('0x48')](handleError(_0x3f5f97,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index cb0345e..4f5c278 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 _0xdb1f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','util','../../config/logger'];(function(_0x4f0dc8,_0xb40b72){var _0x240785=function(_0x590c2d){while(--_0x590c2d){_0x4f0dc8['push'](_0x4f0dc8['shift']());}};_0x240785(++_0xb40b72);}(_0xdb1f,0x128));var _0xfdb1=function(_0x34b7e0,_0x2f90f2){_0x34b7e0=_0x34b7e0-0x0;var _0x320937=_0xdb1f[_0x34b7e0];return _0x320937;};'use strict';var _=require(_0xfdb1('0x0'));var util=require(_0xfdb1('0x1'));var logger=require(_0xfdb1('0x2'))('api');var moment=require(_0xfdb1('0x3'));var BPromise=require(_0xfdb1('0x4'));var rp=require(_0xfdb1('0x5'));var fs=require('fs');var path=require(_0xfdb1('0x6'));var rimraf=require(_0xfdb1('0x7'));var config=require(_0xfdb1('0x8'));var attributes=require(_0xfdb1('0x9'));module[_0xfdb1('0xa')]=function(_0x3aff69,_0x423aab){return _0x3aff69[_0xfdb1('0xb')]('AnalyticDefaultReport',attributes,{'tableName':_0xfdb1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd5c3=['analytics_default_reports','lodash','util','../../config/logger','moment','path','rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport'];(function(_0x3a4ce4,_0x4f9e46){var _0x5837ea=function(_0x3fe823){while(--_0x3fe823){_0x3a4ce4['push'](_0x3a4ce4['shift']());}};_0x5837ea(++_0x4f9e46);}(_0xd5c3,0xe8));var _0x3d5c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd5c3[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x3d5c('0x0'));var util=require(_0x3d5c('0x1'));var logger=require(_0x3d5c('0x2'))('api');var moment=require(_0x3d5c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d5c('0x4'));var rimraf=require(_0x3d5c('0x5'));var config=require('../../config/environment');var attributes=require(_0x3d5c('0x6'));module[_0x3d5c('0x7')]=function(_0x1325b9,_0x5bd7b7){return _0x1325b9[_0x3d5c('0x8')](_0x3d5c('0x9'),attributes,{'tableName':_0x3d5c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 4ffc9ca..4f50eb7 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 _0xf08d=['then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x24cef0,_0x42a80f){var _0x2b767b=function(_0x2529ee){while(--_0x2529ee){_0x24cef0['push'](_0x24cef0['shift']());}};_0x2b767b(++_0x42a80f);}(_0xf08d,0xd0));var _0xdf08=function(_0x1e4fbf,_0x2862c4){_0x1e4fbf=_0x1e4fbf-0x0;var _0x2441a8=_0xf08d[_0x1e4fbf];return _0x2441a8;};'use strict';var _=require(_0xdf08('0x0'));var util=require(_0xdf08('0x1'));var moment=require(_0xdf08('0x2'));var BPromise=require(_0xdf08('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdf08('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf08('0x5'));var logger=require(_0xdf08('0x6'))(_0xdf08('0x7'));var config=require(_0xdf08('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdf08('0x9')][_0xdf08('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2893f9,_0x137c59,_0x226707){return new BPromise(function(_0x45d7ee,_0x43dc03){return client[_0xdf08('0xb')](_0x2893f9,_0x226707)[_0xdf08('0xc')](function(_0x2481ff){logger['info'](_0xdf08('0xd'),_0x137c59,_0xdf08('0xe'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x137c59,_0xdf08('0xe'),JSON[_0xdf08('0xf')](_0x2481ff));if(_0x2481ff[_0xdf08('0x10')]){if(_0x2481ff[_0xdf08('0x10')]['code']===0x1f4){logger['error'](_0xdf08('0xd'),_0x137c59,_0x2481ff[_0xdf08('0x10')][_0xdf08('0x11')]);return _0x43dc03(_0x2481ff[_0xdf08('0x10')][_0xdf08('0x11')]);}logger['error'](_0xdf08('0xd'),_0x137c59,_0x2481ff[_0xdf08('0x10')][_0xdf08('0x11')]);return _0x45d7ee(_0x2481ff[_0xdf08('0x10')][_0xdf08('0x11')]);}else{logger[_0xdf08('0x12')](_0xdf08('0xd'),_0x137c59,_0xdf08('0xe'));_0x45d7ee(_0x2481ff['result'][_0xdf08('0x11')]);}})[_0xdf08('0x13')](function(_0x367399){logger['error'](_0xdf08('0xd'),_0x137c59,_0x367399);_0x43dc03(_0x367399);});});}
\ No newline at end of file
+var _0x91af=['info','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x1c2538,_0x36370f){var _0x16e08a=function(_0x105fd3){while(--_0x105fd3){_0x1c2538['push'](_0x1c2538['shift']());}};_0x16e08a(++_0x36370f);}(_0x91af,0x92));var _0xf91a=function(_0x55e5a4,_0x4b9468){_0x55e5a4=_0x55e5a4-0x0;var _0x39d7a0=_0x91af[_0x55e5a4];return _0x39d7a0;};'use strict';var _=require(_0xf91a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf91a('0x1'));var fs=require('fs');var Redis=require(_0xf91a('0x2'));var db=require(_0xf91a('0x3'))['db'];var utils=require(_0xf91a('0x4'));var logger=require('../../config/logger')(_0xf91a('0x5'));var config=require(_0xf91a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf91a('0x7')][_0xf91a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x58028d,_0x1355fe,_0x5d358c){return new BPromise(function(_0x2e179d,_0x21a9c5){return client[_0xf91a('0x9')](_0x58028d,_0x5d358c)[_0xf91a('0xa')](function(_0x4687d1){logger['info'](_0xf91a('0xb'),_0x1355fe,_0xf91a('0xc'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x1355fe,_0xf91a('0xc'),JSON['stringify'](_0x4687d1));if(_0x4687d1[_0xf91a('0xd')]){if(_0x4687d1['error'][_0xf91a('0xe')]===0x1f4){logger[_0xf91a('0xd')](_0xf91a('0xb'),_0x1355fe,_0x4687d1['error'][_0xf91a('0xf')]);return _0x21a9c5(_0x4687d1['error'][_0xf91a('0xf')]);}logger[_0xf91a('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1355fe,_0x4687d1['error']['message']);return _0x2e179d(_0x4687d1[_0xf91a('0xd')][_0xf91a('0xf')]);}else{logger[_0xf91a('0x10')](_0xf91a('0xb'),_0x1355fe,_0xf91a('0xc'));_0x2e179d(_0x4687d1['result'][_0xf91a('0xf')]);}})[_0xf91a('0x11')](function(_0x366c5d){logger[_0xf91a('0xd')](_0xf91a('0xb'),_0x1355fe,_0x366c5d);_0x21a9c5(_0x366c5d);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index bff2ccd..a68e8c0 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 _0x9129=['./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','run','/:id/query','query','post','create','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../config/environment'];(function(_0x395162,_0x5af476){var _0x13f769=function(_0x300065){while(--_0x300065){_0x395162['push'](_0x395162['shift']());}};_0x13f769(++_0x5af476);}(_0x9129,0xcc));var _0x9912=function(_0xfee10f,_0x53470e){_0xfee10f=_0xfee10f-0x0;var _0xb91051=_0x9129[_0xfee10f];return _0xb91051;};'use strict';var multer=require(_0x9912('0x0'));var util=require(_0x9912('0x1'));var path=require('path');var timeout=require(_0x9912('0x2'));var express=require('express');var router=express[_0x9912('0x3')]();var fs_extra=require(_0x9912('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9912('0x5'));var controller=require(_0x9912('0x6'));router[_0x9912('0x7')]('/',auth[_0x9912('0x8')](),controller[_0x9912('0x9')]);router['get'](_0x9912('0xa'),auth[_0x9912('0x8')](),controller[_0x9912('0xb')]);router['get']('/:id/preview',auth[_0x9912('0x8')](),controller['preview']);router[_0x9912('0x7')]('/:id/run',auth[_0x9912('0x8')](),controller[_0x9912('0xc')]);router[_0x9912('0x7')](_0x9912('0xd'),auth[_0x9912('0x8')](),controller[_0x9912('0xe')]);router[_0x9912('0xf')]('/',auth['isAuthenticated'](),controller[_0x9912('0x10')]);router['put'](_0x9912('0xa'),auth[_0x9912('0x8')](),controller[_0x9912('0x11')]);router[_0x9912('0x12')](_0x9912('0xa'),auth[_0x9912('0x8')](),controller[_0x9912('0x13')]);module[_0x9912('0x14')]=router;
\ No newline at end of file
+var _0x9df5=['Router','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','query','put','update','delete','exports','util','path','express'];(function(_0x4ef25d,_0x5c71ca){var _0x34040f=function(_0x3329f2){while(--_0x3329f2){_0x4ef25d['push'](_0x4ef25d['shift']());}};_0x34040f(++_0x5c71ca);}(_0x9df5,0x165));var _0x59df=function(_0x4d753b,_0x2c0cf2){_0x4d753b=_0x4d753b-0x0;var _0x36a72d=_0x9df5[_0x4d753b];return _0x36a72d;};'use strict';var multer=require('multer');var util=require(_0x59df('0x0'));var path=require(_0x59df('0x1'));var timeout=require('connect-timeout');var express=require(_0x59df('0x2'));var router=express[_0x59df('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x59df('0x4'));var interaction=require(_0x59df('0x5'));var config=require('../../config/environment');var controller=require(_0x59df('0x6'));router[_0x59df('0x7')]('/',auth[_0x59df('0x8')](),controller['index']);router[_0x59df('0x7')](_0x59df('0x9'),auth[_0x59df('0x8')](),controller[_0x59df('0xa')]);router[_0x59df('0x7')](_0x59df('0xb'),auth['isAuthenticated'](),controller[_0x59df('0xc')]);router[_0x59df('0x7')](_0x59df('0xd'),auth['isAuthenticated'](),controller[_0x59df('0xe')]);router['get']('/:id/query',auth['isAuthenticated'](),controller[_0x59df('0xf')]);router['post']('/',auth[_0x59df('0x8')](),controller['create']);router[_0x59df('0x10')](_0x59df('0x9'),auth[_0x59df('0x8')](),controller[_0x59df('0x11')]);router[_0x59df('0x12')](_0x59df('0x9'),auth[_0x59df('0x8')](),controller['destroy']);module[_0x59df('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index f313113..0c0cbf6 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 _0xe1d3=['manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','DATE'];(function(_0x2191fb,_0x216516){var _0x31d7a1=function(_0x2035f7){while(--_0x2035f7){_0x2191fb['push'](_0x2191fb['shift']());}};_0x31d7a1(++_0x216516);}(_0xe1d3,0x19c));var _0x3e1d=function(_0x1fb16c,_0x440bfd){_0x1fb16c=_0x1fb16c-0x0;var _0xee214e=_0xe1d3[_0x1fb16c];return _0xee214e;};'use strict';var Sequelize=require(_0x3e1d('0x0'));var moment=require(_0x3e1d('0x1'));module[_0x3e1d('0x2')]={'name':{'type':Sequelize[_0x3e1d('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x3e1d('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x3e1d('0x4')](_0x3e1d('0x5'),_0x3e1d('0x6'),'xlsx'),'allowNull':![],'defaultValue':_0x3e1d('0x5')},'savename':{'type':Sequelize[_0x3e1d('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x3e1d('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x3e1d('0x4')](_0x3e1d('0x8'),_0x3e1d('0x9')),'allowNull':![],'defaultValue':_0x3e1d('0x8')},'reportId':{'type':Sequelize[_0x3e1d('0xa')](0xb)[_0x3e1d('0xb')]},'reportType':{'type':Sequelize[_0x3e1d('0x3')]}};
\ No newline at end of file
+var _0x37a5=['ENUM','csv','DATE','manual','scheduled','UNSIGNED','sequelize','moment','exports','STRING'];(function(_0x47bbd5,_0xfab6bc){var _0xea2a13=function(_0xc1964c){while(--_0xc1964c){_0x47bbd5['push'](_0x47bbd5['shift']());}};_0xea2a13(++_0xfab6bc);}(_0x37a5,0x1e6));var _0x537a=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x37a5[_0x2d2c16];return _0x53f2fb;};'use strict';var Sequelize=require(_0x537a('0x0'));var moment=require(_0x537a('0x1'));module[_0x537a('0x2')]={'name':{'type':Sequelize[_0x537a('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x537a('0x4')](_0x537a('0x5'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0x537a('0x5')},'savename':{'type':Sequelize[_0x537a('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x537a('0x6')]},'endDate':{'type':Sequelize[_0x537a('0x6')]},'status':{'type':Sequelize[_0x537a('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x537a('0x4')](_0x537a('0x7'),_0x537a('0x8')),'allowNull':![],'defaultValue':_0x537a('0x7')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x537a('0x9')]},'reportType':{'type':Sequelize[_0x537a('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 35a1db7..bdc3355 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 _0xba48=['options','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','update','download','basename','savename','output','join','root','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','format','%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','AnalyticExtractedReport','fieldName','type','key','model','map','filters','attributes','intersection','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','catch','params','rawAttributes','keys','includeAll','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xba48,0x12f));var _0x8ba4=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0xba48[_0x186376];return _0x2dbdd9;};'use strict';var emlformat=require(_0x8ba4('0x0'));var rimraf=require(_0x8ba4('0x1'));var zipdir=require(_0x8ba4('0x2'));var jsonpatch=require(_0x8ba4('0x3'));var rp=require(_0x8ba4('0x4'));var moment=require(_0x8ba4('0x5'));var BPromise=require(_0x8ba4('0x6'));var Mustache=require('mustache');var util=require(_0x8ba4('0x7'));var path=require(_0x8ba4('0x8'));var sox=require(_0x8ba4('0x9'));var csv=require(_0x8ba4('0xa'));var ejs=require(_0x8ba4('0xb'));var fs=require('fs');var fs_extra=require(_0x8ba4('0xc'));var _=require('lodash');var squel=require(_0x8ba4('0xd'));var crypto=require(_0x8ba4('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8ba4('0xa'));var querystring=require('querystring');var Papa=require(_0x8ba4('0xf'));var Redis=require('ioredis');var authService=require(_0x8ba4('0x10'));var qs=require(_0x8ba4('0x11'));var as=require(_0x8ba4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ba4('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x8ba4('0x14'));var licenseUtil=require(_0x8ba4('0x15'));var db=require(_0x8ba4('0x16'))['db'];function respondWithStatusCode(_0x2d2b88,_0xd5cf5b){_0xd5cf5b=_0xd5cf5b||0xcc;return function(_0x1d79a7){if(_0x1d79a7){return _0x2d2b88[_0x8ba4('0x17')](_0xd5cf5b);}return _0x2d2b88[_0x8ba4('0x18')](_0xd5cf5b)[_0x8ba4('0x19')]();};}function respondWithResult(_0x493854,_0x25d4f3){_0x25d4f3=_0x25d4f3||0xc8;return function(_0x5885af){if(_0x5885af){return _0x493854[_0x8ba4('0x18')](_0x25d4f3)[_0x8ba4('0x1a')](_0x5885af);}};}function respondWithFilteredResult(_0x4cc13d,_0x39123a){return function(_0x4e4fb2){if(_0x4e4fb2){var _0x146c2c=typeof _0x39123a[_0x8ba4('0x1b')]==='undefined'&&typeof _0x39123a[_0x8ba4('0x1c')]===_0x8ba4('0x1d');var _0x2f2fde=_0x4e4fb2[_0x8ba4('0x1e')];var _0x208289=_0x146c2c?0x0:_0x39123a[_0x8ba4('0x1b')];var _0x4932f0=_0x146c2c?_0x4e4fb2[_0x8ba4('0x1e')]:_0x39123a[_0x8ba4('0x1b')]+_0x39123a[_0x8ba4('0x1c')];var _0x170b31;if(_0x4932f0>=_0x2f2fde){_0x4932f0=_0x2f2fde;_0x170b31=0xc8;}else{_0x170b31=0xce;}_0x4cc13d['status'](_0x170b31);return _0x4cc13d[_0x8ba4('0x1f')](_0x8ba4('0x20'),_0x208289+'-'+_0x4932f0+'/'+_0x2f2fde)[_0x8ba4('0x1a')](_0x4e4fb2);}return null;};}function patchUpdates(_0x14072f){return function(_0x1b01a7){try{jsonpatch[_0x8ba4('0x21')](_0x1b01a7,_0x14072f,!![]);}catch(_0x468e48){return BPromise[_0x8ba4('0x22')](_0x468e48);}return _0x1b01a7[_0x8ba4('0x23')]();};}function saveUpdates(_0x7ba7f4,_0x1e6665){return function(_0x1f2fa8){if(_0x1f2fa8){return _0x1f2fa8['update'](_0x7ba7f4)[_0x8ba4('0x24')](function(_0x2a0493){return _0x2a0493;});}return null;};}function removeEntity(_0x30292b,_0x736f9c){return function(_0x1b6a68){if(_0x1b6a68){return _0x1b6a68[_0x8ba4('0x25')]()[_0x8ba4('0x24')](function(){var _0x4d8e59=_0x1b6a68[_0x8ba4('0x26')]({'plain':!![]});var _0xe3732c=_0x8ba4('0x27');return db[_0x8ba4('0x28')]['destroy']({'where':{'type':_0xe3732c,'resourceId':_0x4d8e59['id']}})[_0x8ba4('0x24')](function(){return _0x1b6a68;});})['then'](function(){_0x30292b[_0x8ba4('0x18')](0xcc)[_0x8ba4('0x19')]();});}};}function handleEntityNotFound(_0x504d02,_0x2bf764){return function(_0x447f07){if(!_0x447f07){_0x504d02[_0x8ba4('0x17')](0x194);}return _0x447f07;};}function handleError(_0x3afcea,_0x141562){_0x141562=_0x141562||0x1f4;return function(_0x65ab5d){logger[_0x8ba4('0x29')](_0x65ab5d[_0x8ba4('0x2a')]);if(_0x65ab5d[_0x8ba4('0x2b')]){delete _0x65ab5d[_0x8ba4('0x2b')];}_0x3afcea[_0x8ba4('0x18')](_0x141562)[_0x8ba4('0x2c')](_0x65ab5d);};}exports['index']=function(_0x102a4e,_0x4fa9ef){var _0x1e01a9={},_0x353a61={},_0xd0503={'count':0x0,'rows':[]};var _0x132f38=_['map'](db[_0x8ba4('0x2d')]['rawAttributes'],function(_0x4902ee){return{'name':_0x4902ee[_0x8ba4('0x2e')],'type':_0x4902ee[_0x8ba4('0x2f')][_0x8ba4('0x30')]};});_0x353a61[_0x8ba4('0x31')]=_[_0x8ba4('0x32')](_0x132f38,_0x8ba4('0x2b'));_0x353a61['query']=_['keys'](_0x102a4e['query']);_0x353a61[_0x8ba4('0x33')]=_['intersection'](_0x353a61[_0x8ba4('0x31')],_0x353a61['query']);_0x1e01a9[_0x8ba4('0x34')]=_[_0x8ba4('0x35')](_0x353a61['model'],qs[_0x8ba4('0x36')](_0x102a4e[_0x8ba4('0x37')]['fields']));_0x1e01a9['attributes']=_0x1e01a9[_0x8ba4('0x34')][_0x8ba4('0x38')]?_0x1e01a9['attributes']:_0x353a61['model'];if(!_0x102a4e['query'][_0x8ba4('0x39')](_0x8ba4('0x3a'))){_0x1e01a9[_0x8ba4('0x1c')]=qs['limit'](_0x102a4e[_0x8ba4('0x37')][_0x8ba4('0x1c')]);_0x1e01a9['offset']=qs[_0x8ba4('0x1b')](_0x102a4e['query']['offset']);}_0x1e01a9[_0x8ba4('0x3b')]=qs['sort'](_0x102a4e[_0x8ba4('0x37')][_0x8ba4('0x3c')]);_0x1e01a9[_0x8ba4('0x3d')]=qs[_0x8ba4('0x33')](_[_0x8ba4('0x3e')](_0x102a4e[_0x8ba4('0x37')],_0x353a61[_0x8ba4('0x33')]),_0x132f38);if(_0x102a4e['query'][_0x8ba4('0x3f')]){_0x1e01a9[_0x8ba4('0x3d')]=_[_0x8ba4('0x40')](_0x1e01a9[_0x8ba4('0x3d')],{'$or':_[_0x8ba4('0x32')](_0x132f38,function(_0x4d5607){if(_0x4d5607[_0x8ba4('0x2f')]!==_0x8ba4('0x41')){var _0x56d218={};_0x56d218[_0x4d5607[_0x8ba4('0x2b')]]={'$like':'%'+_0x102a4e[_0x8ba4('0x37')][_0x8ba4('0x3f')]+'%'};return _0x56d218;}})});}_0x1e01a9=_[_0x8ba4('0x40')]({},_0x1e01a9,_0x102a4e['options']);var _0x5896f4={'where':_0x1e01a9[_0x8ba4('0x3d')]};return db[_0x8ba4('0x2d')][_0x8ba4('0x1e')](_0x5896f4)[_0x8ba4('0x24')](function(_0x39d40f){_0xd0503[_0x8ba4('0x1e')]=_0x39d40f;if(_0x102a4e[_0x8ba4('0x37')]['includeAll']){_0x1e01a9['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x8ba4('0x42')](_0x1e01a9);})[_0x8ba4('0x24')](function(_0x316e5f){_0xd0503['rows']=_0x316e5f;return _0xd0503;})[_0x8ba4('0x24')](respondWithFilteredResult(_0x4fa9ef,_0x1e01a9))[_0x8ba4('0x43')](handleError(_0x4fa9ef,null));};exports['show']=function(_0x52466e,_0xd24ad5){var _0xc20218={'raw':!![],'where':{'id':_0x52466e[_0x8ba4('0x44')]['id']}},_0x1a378b={};_0x1a378b[_0x8ba4('0x31')]=_['keys'](db[_0x8ba4('0x2d')][_0x8ba4('0x45')]);_0x1a378b[_0x8ba4('0x37')]=_[_0x8ba4('0x46')](_0x52466e['query']);_0x1a378b[_0x8ba4('0x33')]=_['intersection'](_0x1a378b[_0x8ba4('0x31')],_0x1a378b['query']);_0xc20218[_0x8ba4('0x34')]=_[_0x8ba4('0x35')](_0x1a378b[_0x8ba4('0x31')],qs[_0x8ba4('0x36')](_0x52466e['query'][_0x8ba4('0x36')]));_0xc20218[_0x8ba4('0x34')]=_0xc20218[_0x8ba4('0x34')][_0x8ba4('0x38')]?_0xc20218['attributes']:_0x1a378b[_0x8ba4('0x31')];if(_0x52466e[_0x8ba4('0x37')][_0x8ba4('0x47')]){_0xc20218[_0x8ba4('0x48')]=[{'all':!![]}];}_0xc20218=_['merge']({},_0xc20218,_0x52466e[_0x8ba4('0x49')]);return db[_0x8ba4('0x2d')][_0x8ba4('0x4a')](_0xc20218)[_0x8ba4('0x24')](handleEntityNotFound(_0xd24ad5,null))[_0x8ba4('0x24')](respondWithResult(_0xd24ad5,null))[_0x8ba4('0x43')](handleError(_0xd24ad5,null));};exports[_0x8ba4('0x4b')]=function(_0x4fca59,_0x1924e7){return db[_0x8ba4('0x2d')]['create'](_0x4fca59[_0x8ba4('0x4c')],{})[_0x8ba4('0x24')](function(_0x4fa705){var _0x292e6e=_0x4fca59[_0x8ba4('0x4d')]['get']({'plain':!![]});if(!_0x292e6e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x292e6e['role']===_0x8ba4('0x4d')){var _0x52acc8=_0x4fa705[_0x8ba4('0x26')]({'plain':!![]});var _0x2e5019='ExtractedReports';return db[_0x8ba4('0x4e')]['find']({'where':{'name':_0x2e5019,'userProfileId':_0x292e6e[_0x8ba4('0x4f')]},'raw':!![]})[_0x8ba4('0x24')](function(_0x350e24){if(_0x350e24&&_0x350e24[_0x8ba4('0x50')]===0x0){return db['UserProfileResource'][_0x8ba4('0x4b')]({'name':_0x52acc8[_0x8ba4('0x2b')],'resourceId':_0x52acc8['id'],'type':_0x350e24[_0x8ba4('0x2b')],'sectionId':_0x350e24['id']},{})[_0x8ba4('0x24')](function(){return _0x4fa705;});}else{return _0x4fa705;}})[_0x8ba4('0x43')](function(_0x46bd03){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46bd03);throw _0x46bd03;});}return _0x4fa705;})[_0x8ba4('0x24')](respondWithResult(_0x1924e7,0xc9))['catch'](handleError(_0x1924e7,null));};exports[_0x8ba4('0x51')]=function(_0x48f276,_0x1953fe){if(_0x48f276[_0x8ba4('0x4c')]['id']){delete _0x48f276[_0x8ba4('0x4c')]['id'];}return db[_0x8ba4('0x2d')][_0x8ba4('0x4a')]({'where':{'id':_0x48f276[_0x8ba4('0x44')]['id']}})['then'](handleEntityNotFound(_0x1953fe,null))[_0x8ba4('0x24')](saveUpdates(_0x48f276[_0x8ba4('0x4c')],null))['then'](respondWithResult(_0x1953fe,null))['catch'](handleError(_0x1953fe,null));};exports['destroy']=function(_0x221d0c,_0x4b0bdb){return db[_0x8ba4('0x2d')]['find']({'where':{'id':_0x221d0c['params']['id']}})['then'](handleEntityNotFound(_0x4b0bdb,null))[_0x8ba4('0x24')](removeEntity(_0x4b0bdb,null))[_0x8ba4('0x43')](handleError(_0x4b0bdb,null));};exports[_0x8ba4('0x52')]=function(_0x4c54ef,_0x56b018,_0xed9e06){return db[_0x8ba4('0x2d')][_0x8ba4('0x4a')]({'where':{'id':_0x4c54ef[_0x8ba4('0x44')]['id']},'attributes':['name',_0x8ba4('0x53'),_0x8ba4('0x54'),_0x8ba4('0x55')],'raw':!![]})[_0x8ba4('0x24')](handleEntityNotFound(_0x56b018,null))['then'](function(_0x1f1cb9){if(_0x1f1cb9){if(!fs['existsSync'](path[_0x8ba4('0x56')](config[_0x8ba4('0x57')],'server/files/reports',_0x1f1cb9[_0x8ba4('0x54')]))){throw new db[(_0x8ba4('0x58'))]['ValidationError'](_0x8ba4('0x59'));}if(_0x4c54ef['query'][_0x8ba4('0x5a')]){return _0x56b018['sendStatus'](0xc8);}return _0x56b018[_0x8ba4('0x52')](path[_0x8ba4('0x56')](config[_0x8ba4('0x57')],_0x8ba4('0x5b'),_0x1f1cb9[_0x8ba4('0x54')]),util[_0x8ba4('0x5c')](_0x8ba4('0x5d'),_0x1f1cb9[_0x8ba4('0x53')]||_0x1f1cb9[_0x8ba4('0x2b')],_0x1f1cb9[_0x8ba4('0x55')]['toLowerCase']()));}})['catch'](handleError(_0x56b018,null));};
\ No newline at end of file
+var _0x734e=['Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','download','format','%s.%s','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','get','ExtractedReports','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','AnalyticExtractedReport','includeAll','include','rows','catch','show','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','params','find','output','existsSync','join','root','server/files/reports','savename'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x734e,0x18f));var _0xe734=function(_0x7dfb21,_0x54cbb5){_0x7dfb21=_0x7dfb21-0x0;var _0x544f45=_0x734e[_0x7dfb21];return _0x544f45;};'use strict';var emlformat=require(_0xe734('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe734('0x1'));var jsonpatch=require(_0xe734('0x2'));var rp=require(_0xe734('0x3'));var moment=require(_0xe734('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xe734('0x5'));var sox=require(_0xe734('0x6'));var csv=require('to-csv');var ejs=require(_0xe734('0x7'));var fs=require('fs');var fs_extra=require(_0xe734('0x8'));var _=require(_0xe734('0x9'));var squel=require(_0xe734('0xa'));var crypto=require(_0xe734('0xb'));var jsforce=require(_0xe734('0xc'));var deskjs=require(_0xe734('0xd'));var toCsv=require(_0xe734('0xe'));var querystring=require(_0xe734('0xf'));var Papa=require(_0xe734('0x10'));var Redis=require('ioredis');var authService=require(_0xe734('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe734('0x12'));var hardwareService=require(_0xe734('0x13'));var logger=require(_0xe734('0x14'))(_0xe734('0x15'));var utils=require('../../config/utils');var config=require(_0xe734('0x16'));var licenseUtil=require(_0xe734('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e7c75,_0x1c342e){_0x1c342e=_0x1c342e||0xcc;return function(_0x36c518){if(_0x36c518){return _0x5e7c75[_0xe734('0x18')](_0x1c342e);}return _0x5e7c75[_0xe734('0x19')](_0x1c342e)[_0xe734('0x1a')]();};}function respondWithResult(_0x21e3a5,_0x1178b5){_0x1178b5=_0x1178b5||0xc8;return function(_0x2631f4){if(_0x2631f4){return _0x21e3a5[_0xe734('0x19')](_0x1178b5)[_0xe734('0x1b')](_0x2631f4);}};}function respondWithFilteredResult(_0x428671,_0x5be318){return function(_0x4d2690){if(_0x4d2690){var _0xa73ccd=typeof _0x5be318['offset']===_0xe734('0x1c')&&typeof _0x5be318[_0xe734('0x1d')]===_0xe734('0x1c');var _0x507d2a=_0x4d2690['count'];var _0xaf4f95=_0xa73ccd?0x0:_0x5be318['offset'];var _0x4291ab=_0xa73ccd?_0x4d2690[_0xe734('0x1e')]:_0x5be318[_0xe734('0x1f')]+_0x5be318[_0xe734('0x1d')];var _0x29930c;if(_0x4291ab>=_0x507d2a){_0x4291ab=_0x507d2a;_0x29930c=0xc8;}else{_0x29930c=0xce;}_0x428671[_0xe734('0x19')](_0x29930c);return _0x428671[_0xe734('0x20')](_0xe734('0x21'),_0xaf4f95+'-'+_0x4291ab+'/'+_0x507d2a)[_0xe734('0x1b')](_0x4d2690);}return null;};}function patchUpdates(_0x5191c8){return function(_0x507dc0){try{jsonpatch['apply'](_0x507dc0,_0x5191c8,!![]);}catch(_0x2dd95f){return BPromise[_0xe734('0x22')](_0x2dd95f);}return _0x507dc0[_0xe734('0x23')]();};}function saveUpdates(_0x30c315,_0xc2b02){return function(_0x2b8721){if(_0x2b8721){return _0x2b8721['update'](_0x30c315)['then'](function(_0x5be503){return _0x5be503;});}return null;};}function removeEntity(_0x52d408,_0x110c50){return function(_0xeae0b3){if(_0xeae0b3){return _0xeae0b3['destroy']()[_0xe734('0x24')](function(){var _0x44cb59=_0xeae0b3[_0xe734('0x25')]({'plain':!![]});var _0x4857d9=_0xe734('0x26');return db[_0xe734('0x27')]['destroy']({'where':{'type':_0x4857d9,'resourceId':_0x44cb59['id']}})['then'](function(){return _0xeae0b3;});})[_0xe734('0x24')](function(){_0x52d408[_0xe734('0x19')](0xcc)[_0xe734('0x1a')]();});}};}function handleEntityNotFound(_0x42e769,_0x3747b2){return function(_0x15e585){if(!_0x15e585){_0x42e769[_0xe734('0x18')](0x194);}return _0x15e585;};}function handleError(_0x56e635,_0x34166e){_0x34166e=_0x34166e||0x1f4;return function(_0x57dec1){logger[_0xe734('0x28')](_0x57dec1[_0xe734('0x29')]);if(_0x57dec1[_0xe734('0x2a')]){delete _0x57dec1[_0xe734('0x2a')];}_0x56e635['status'](_0x34166e)[_0xe734('0x2b')](_0x57dec1);};}exports[_0xe734('0x2c')]=function(_0x49cc7f,_0x81949b){var _0x5b0e4b={},_0xa1b7ee={},_0x4ca8d6={'count':0x0,'rows':[]};var _0x308d5a=_['map'](db['AnalyticExtractedReport'][_0xe734('0x2d')],function(_0x44eb14){return{'name':_0x44eb14[_0xe734('0x2e')],'type':_0x44eb14[_0xe734('0x2f')]['key']};});_0xa1b7ee['model']=_[_0xe734('0x30')](_0x308d5a,_0xe734('0x2a'));_0xa1b7ee[_0xe734('0x31')]=_[_0xe734('0x32')](_0x49cc7f[_0xe734('0x31')]);_0xa1b7ee['filters']=_[_0xe734('0x33')](_0xa1b7ee[_0xe734('0x34')],_0xa1b7ee['query']);_0x5b0e4b[_0xe734('0x35')]=_[_0xe734('0x33')](_0xa1b7ee[_0xe734('0x34')],qs[_0xe734('0x36')](_0x49cc7f[_0xe734('0x31')]['fields']));_0x5b0e4b[_0xe734('0x35')]=_0x5b0e4b['attributes'][_0xe734('0x37')]?_0x5b0e4b[_0xe734('0x35')]:_0xa1b7ee[_0xe734('0x34')];if(!_0x49cc7f['query'][_0xe734('0x38')](_0xe734('0x39'))){_0x5b0e4b[_0xe734('0x1d')]=qs[_0xe734('0x1d')](_0x49cc7f[_0xe734('0x31')][_0xe734('0x1d')]);_0x5b0e4b[_0xe734('0x1f')]=qs[_0xe734('0x1f')](_0x49cc7f['query'][_0xe734('0x1f')]);}_0x5b0e4b[_0xe734('0x3a')]=qs[_0xe734('0x3b')](_0x49cc7f[_0xe734('0x31')][_0xe734('0x3b')]);_0x5b0e4b[_0xe734('0x3c')]=qs['filters'](_[_0xe734('0x3d')](_0x49cc7f[_0xe734('0x31')],_0xa1b7ee[_0xe734('0x3e')]),_0x308d5a);if(_0x49cc7f[_0xe734('0x31')][_0xe734('0x3f')]){_0x5b0e4b[_0xe734('0x3c')]=_[_0xe734('0x40')](_0x5b0e4b[_0xe734('0x3c')],{'$or':_[_0xe734('0x30')](_0x308d5a,function(_0x3c3a7d){if(_0x3c3a7d['type']!==_0xe734('0x41')){var _0x447bd2={};_0x447bd2[_0x3c3a7d[_0xe734('0x2a')]]={'$like':'%'+_0x49cc7f['query']['filter']+'%'};return _0x447bd2;}})});}_0x5b0e4b=_['merge']({},_0x5b0e4b,_0x49cc7f[_0xe734('0x42')]);var _0x268992={'where':_0x5b0e4b[_0xe734('0x3c')]};return db[_0xe734('0x43')][_0xe734('0x1e')](_0x268992)[_0xe734('0x24')](function(_0x528580){_0x4ca8d6[_0xe734('0x1e')]=_0x528580;if(_0x49cc7f['query'][_0xe734('0x44')]){_0x5b0e4b[_0xe734('0x45')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x5b0e4b);})[_0xe734('0x24')](function(_0x5b0b7e){_0x4ca8d6[_0xe734('0x46')]=_0x5b0b7e;return _0x4ca8d6;})[_0xe734('0x24')](respondWithFilteredResult(_0x81949b,_0x5b0e4b))[_0xe734('0x47')](handleError(_0x81949b,null));};exports[_0xe734('0x48')]=function(_0x1b0a08,_0x3aa32c){var _0x52b79f={'raw':!![],'where':{'id':_0x1b0a08['params']['id']}},_0x30ed05={};_0x30ed05[_0xe734('0x34')]=_['keys'](db[_0xe734('0x43')]['rawAttributes']);_0x30ed05[_0xe734('0x31')]=_[_0xe734('0x32')](_0x1b0a08[_0xe734('0x31')]);_0x30ed05['filters']=_[_0xe734('0x33')](_0x30ed05[_0xe734('0x34')],_0x30ed05[_0xe734('0x31')]);_0x52b79f[_0xe734('0x35')]=_['intersection'](_0x30ed05['model'],qs[_0xe734('0x36')](_0x1b0a08[_0xe734('0x31')][_0xe734('0x36')]));_0x52b79f[_0xe734('0x35')]=_0x52b79f['attributes'][_0xe734('0x37')]?_0x52b79f[_0xe734('0x35')]:_0x30ed05[_0xe734('0x34')];if(_0x1b0a08[_0xe734('0x31')][_0xe734('0x44')]){_0x52b79f[_0xe734('0x45')]=[{'all':!![]}];}_0x52b79f=_[_0xe734('0x40')]({},_0x52b79f,_0x1b0a08['options']);return db[_0xe734('0x43')]['find'](_0x52b79f)['then'](handleEntityNotFound(_0x3aa32c,null))[_0xe734('0x24')](respondWithResult(_0x3aa32c,null))[_0xe734('0x47')](handleError(_0x3aa32c,null));};exports[_0xe734('0x49')]=function(_0x58e972,_0x3b0255){return db[_0xe734('0x43')]['create'](_0x58e972[_0xe734('0x4a')],{})[_0xe734('0x24')](function(_0x3c40d6){var _0x4fab0a=_0x58e972[_0xe734('0x4b')]['get']({'plain':!![]});if(!_0x4fab0a)throw new Error(_0xe734('0x4c'));if(_0x4fab0a[_0xe734('0x4d')]==='user'){var _0x3626b6=_0x3c40d6[_0xe734('0x25')]({'plain':!![]});var _0x526aaa=_0xe734('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x526aaa,'userProfileId':_0x4fab0a[_0xe734('0x4e')]},'raw':!![]})[_0xe734('0x24')](function(_0x3bb043){if(_0x3bb043&&_0x3bb043[_0xe734('0x4f')]===0x0){return db[_0xe734('0x27')][_0xe734('0x49')]({'name':_0x3626b6[_0xe734('0x2a')],'resourceId':_0x3626b6['id'],'type':_0x3bb043[_0xe734('0x2a')],'sectionId':_0x3bb043['id']},{})[_0xe734('0x24')](function(){return _0x3c40d6;});}else{return _0x3c40d6;}})[_0xe734('0x47')](function(_0x4c33c5){logger[_0xe734('0x28')](_0xe734('0x50'),_0x4c33c5);throw _0x4c33c5;});}return _0x3c40d6;})[_0xe734('0x24')](respondWithResult(_0x3b0255,0xc9))[_0xe734('0x47')](handleError(_0x3b0255,null));};exports[_0xe734('0x51')]=function(_0xda90e9,_0x26114e){if(_0xda90e9[_0xe734('0x4a')]['id']){delete _0xda90e9[_0xe734('0x4a')]['id'];}return db[_0xe734('0x43')]['find']({'where':{'id':_0xda90e9['params']['id']}})[_0xe734('0x24')](handleEntityNotFound(_0x26114e,null))['then'](saveUpdates(_0xda90e9['body'],null))[_0xe734('0x24')](respondWithResult(_0x26114e,null))['catch'](handleError(_0x26114e,null));};exports[_0xe734('0x52')]=function(_0x187744,_0x30db7d){return db[_0xe734('0x43')]['find']({'where':{'id':_0x187744[_0xe734('0x53')]['id']}})['then'](handleEntityNotFound(_0x30db7d,null))[_0xe734('0x24')](removeEntity(_0x30db7d,null))[_0xe734('0x47')](handleError(_0x30db7d,null));};exports['download']=function(_0x350675,_0x22ad40,_0xc2d096){return db[_0xe734('0x43')][_0xe734('0x54')]({'where':{'id':_0x350675['params']['id']},'attributes':[_0xe734('0x2a'),'basename','savename',_0xe734('0x55')],'raw':!![]})['then'](handleEntityNotFound(_0x22ad40,null))[_0xe734('0x24')](function(_0xffb35d){if(_0xffb35d){if(!fs[_0xe734('0x56')](path[_0xe734('0x57')](config[_0xe734('0x58')],_0xe734('0x59'),_0xffb35d[_0xe734('0x5a')]))){throw new db[(_0xe734('0x5b'))][(_0xe734('0x5c'))](_0xe734('0x5d'));}if(_0x350675['query']['exists']){return _0x22ad40[_0xe734('0x18')](0xc8);}return _0x22ad40[_0xe734('0x5e')](path[_0xe734('0x57')](config[_0xe734('0x58')],_0xe734('0x59'),_0xffb35d[_0xe734('0x5a')]),util[_0xe734('0x5f')](_0xe734('0x60'),_0xffb35d['basename']||_0xffb35d[_0xe734('0x2a')],_0xffb35d[_0xe734('0x55')][_0xe734('0x61')]()));}})[_0xe734('0x47')](handleError(_0x22ad40,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 0f86691..d7c122b 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 _0x7e74=['exports','define','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes'];(function(_0x1c4c46,_0x3f3e8b){var _0x38e0e0=function(_0xa8038a){while(--_0xa8038a){_0x1c4c46['push'](_0x1c4c46['shift']());}};_0x38e0e0(++_0x3f3e8b);}(_0x7e74,0x16f));var _0x47e7=function(_0x29a0d7,_0x4ecd68){_0x29a0d7=_0x29a0d7-0x0;var _0x3e336f=_0x7e74[_0x29a0d7];return _0x3e336f;};'use strict';var _=require(_0x47e7('0x0'));var util=require(_0x47e7('0x1'));var logger=require(_0x47e7('0x2'))(_0x47e7('0x3'));var moment=require(_0x47e7('0x4'));var BPromise=require(_0x47e7('0x5'));var rp=require(_0x47e7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x47e7('0x7'));var config=require(_0x47e7('0x8'));var attributes=require(_0x47e7('0x9'));module[_0x47e7('0xa')]=function(_0x4b110b,_0x2123f5){return _0x4b110b[_0x47e7('0xb')]('AnalyticExtractedReport',attributes,{'tableName':_0x47e7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x47e4=['../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util'];(function(_0x1357aa,_0xd2f202){var _0x368ebc=function(_0x5a3adf){while(--_0x5a3adf){_0x1357aa['push'](_0x1357aa['shift']());}};_0x368ebc(++_0xd2f202);}(_0x47e4,0x15a));var _0x447e=function(_0x29d530,_0x5da0d7){_0x29d530=_0x29d530-0x0;var _0x242905=_0x47e4[_0x29d530];return _0x242905;};'use strict';var _=require(_0x447e('0x0'));var util=require(_0x447e('0x1'));var logger=require(_0x447e('0x2'))(_0x447e('0x3'));var moment=require(_0x447e('0x4'));var BPromise=require(_0x447e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x447e('0x6'));var rimraf=require('rimraf');var config=require(_0x447e('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0x447e('0x8')]=function(_0x48f696,_0x16905d){return _0x48f696[_0x447e('0x9')](_0x447e('0xa'),attributes,{'tableName':_0x447e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 63610a1..3a106a3 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 _0xe51d=['ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','randomstring'];(function(_0xd902ad,_0x34a4db){var _0x2dda06=function(_0x29e470){while(--_0x29e470){_0xd902ad['push'](_0xd902ad['shift']());}};_0x2dda06(++_0x34a4db);}(_0xe51d,0x9c));var _0xde51=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe51d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xde51('0x0'));var util=require(_0xde51('0x1'));var moment=require('moment');var BPromise=require(_0xde51('0x2'));var rs=require(_0xde51('0x3'));var fs=require('fs');var Redis=require(_0xde51('0x4'));var db=require(_0xde51('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde51('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xde51('0x7'));var client=jayson[_0xde51('0x8')][_0xde51('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d1507,_0x21477c,_0x38ec14){return new BPromise(function(_0x2d6634,_0x3ff147){return client[_0xde51('0xa')](_0x5d1507,_0x38ec14)['then'](function(_0x5a95af){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x21477c,'request\x20sent');logger['debug'](_0xde51('0xb'),_0x21477c,_0xde51('0xc'),JSON[_0xde51('0xd')](_0x5a95af));if(_0x5a95af['error']){if(_0x5a95af[_0xde51('0xe')][_0xde51('0xf')]===0x1f4){logger[_0xde51('0xe')](_0xde51('0x10'),_0x21477c,_0x5a95af[_0xde51('0xe')][_0xde51('0x11')]);return _0x3ff147(_0x5a95af[_0xde51('0xe')][_0xde51('0x11')]);}logger[_0xde51('0xe')](_0xde51('0x10'),_0x21477c,_0x5a95af[_0xde51('0xe')][_0xde51('0x11')]);return _0x2d6634(_0x5a95af['error'][_0xde51('0x11')]);}else{logger[_0xde51('0x12')](_0xde51('0x10'),_0x21477c,'request\x20sent');_0x2d6634(_0x5a95af[_0xde51('0x13')][_0xde51('0x11')]);}})['catch'](function(_0x358ee5){logger[_0xde51('0xe')](_0xde51('0x10'),_0x21477c,_0x358ee5);_0x3ff147(_0x358ee5);});});}
\ No newline at end of file
+var _0x29fa=['error','code','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0x32518f,_0x45f6ef){var _0x383217=function(_0x43c371){while(--_0x43c371){_0x32518f['push'](_0x32518f['shift']());}};_0x383217(++_0x45f6ef);}(_0x29fa,0x1e8));var _0xa29f=function(_0x2e8418,_0x58c529){_0x2e8418=_0x2e8418-0x0;var _0x548fe6=_0x29fa[_0x2e8418];return _0x548fe6;};'use strict';var _=require(_0xa29f('0x0'));var util=require(_0xa29f('0x1'));var moment=require('moment');var BPromise=require(_0xa29f('0x2'));var rs=require(_0xa29f('0x3'));var fs=require('fs');var Redis=require(_0xa29f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa29f('0x5'));var logger=require('../../config/logger')(_0xa29f('0x6'));var config=require(_0xa29f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa29f('0x8')][_0xa29f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2abed0,_0x369a07,_0x3499c1){return new BPromise(function(_0x2e0660,_0x16975e){return client[_0xa29f('0xa')](_0x2abed0,_0x3499c1)[_0xa29f('0xb')](function(_0x336028){logger['info'](_0xa29f('0xc'),_0x369a07,_0xa29f('0xd'));logger[_0xa29f('0xe')](_0xa29f('0xf'),_0x369a07,_0xa29f('0xd'),JSON['stringify'](_0x336028));if(_0x336028['error']){if(_0x336028[_0xa29f('0x10')][_0xa29f('0x11')]===0x1f4){logger[_0xa29f('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x369a07,_0x336028[_0xa29f('0x10')]['message']);return _0x16975e(_0x336028[_0xa29f('0x10')][_0xa29f('0x12')]);}logger[_0xa29f('0x10')](_0xa29f('0xc'),_0x369a07,_0x336028[_0xa29f('0x10')][_0xa29f('0x12')]);return _0x2e0660(_0x336028['error'][_0xa29f('0x12')]);}else{logger[_0xa29f('0x13')](_0xa29f('0xc'),_0x369a07,_0xa29f('0xd'));_0x2e0660(_0x336028[_0xa29f('0x14')]['message']);}})['catch'](function(_0x2979c0){logger[_0xa29f('0x10')](_0xa29f('0xc'),_0x369a07,_0x2979c0);_0x16975e(_0x2979c0);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index b2876c8..a222e57 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 _0x4f59=['isAuthenticated','index','show','/:id/download','download','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x4f59,0x68));var _0x94f5=function(_0xb875ee,_0x583042){_0xb875ee=_0xb875ee-0x0;var _0x4c7f3a=_0x4f59[_0xb875ee];return _0x4c7f3a;};'use strict';var multer=require(_0x94f5('0x0'));var util=require(_0x94f5('0x1'));var path=require(_0x94f5('0x2'));var timeout=require(_0x94f5('0x3'));var express=require(_0x94f5('0x4'));var router=express[_0x94f5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x94f5('0x6'));var interaction=require(_0x94f5('0x7'));var config=require(_0x94f5('0x8'));var controller=require(_0x94f5('0x9'));router[_0x94f5('0xa')]('/',auth[_0x94f5('0xb')](),controller[_0x94f5('0xc')]);router[_0x94f5('0xa')]('/:id',auth[_0x94f5('0xb')](),controller[_0x94f5('0xd')]);router[_0x94f5('0xa')](_0x94f5('0xe'),auth[_0x94f5('0xb')](),controller[_0x94f5('0xf')]);router['post']('/',auth[_0x94f5('0xb')](),controller[_0x94f5('0x10')]);router[_0x94f5('0x11')]('/:id',auth[_0x94f5('0xb')](),controller[_0x94f5('0x12')]);router[_0x94f5('0x13')](_0x94f5('0x14'),auth[_0x94f5('0xb')](),controller[_0x94f5('0x15')]);module[_0x94f5('0x16')]=router;
\ No newline at end of file
+var _0xca4f=['get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticExtractedReport.controller'];(function(_0x4d934b,_0x52f8e9){var _0xc0338b=function(_0x1a356c){while(--_0x1a356c){_0x4d934b['push'](_0x4d934b['shift']());}};_0xc0338b(++_0x52f8e9);}(_0xca4f,0x160));var _0xfca4=function(_0x4448ce,_0xea7546){_0x4448ce=_0x4448ce-0x0;var _0x4fad2e=_0xca4f[_0x4448ce];return _0x4fad2e;};'use strict';var multer=require(_0xfca4('0x0'));var util=require(_0xfca4('0x1'));var path=require(_0xfca4('0x2'));var timeout=require(_0xfca4('0x3'));var express=require(_0xfca4('0x4'));var router=express[_0xfca4('0x5')]();var fs_extra=require(_0xfca4('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfca4('0x7'));var controller=require(_0xfca4('0x8'));router[_0xfca4('0x9')]('/',auth[_0xfca4('0xa')](),controller[_0xfca4('0xb')]);router[_0xfca4('0x9')](_0xfca4('0xc'),auth[_0xfca4('0xa')](),controller['show']);router[_0xfca4('0x9')](_0xfca4('0xd'),auth[_0xfca4('0xa')](),controller[_0xfca4('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfca4('0xf')]);router[_0xfca4('0x10')](_0xfca4('0xc'),auth[_0xfca4('0xa')](),controller['update']);router[_0xfca4('0x11')](_0xfca4('0xc'),auth['isAuthenticated'](),controller[_0xfca4('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 1422d0a..47c332a 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 _0xf3e9=['STRING','BOOLEAN','sequelize','exports'];(function(_0x352392,_0x3337c7){var _0x567118=function(_0x142120){while(--_0x142120){_0x352392['push'](_0x352392['shift']());}};_0x567118(++_0x3337c7);}(_0xf3e9,0x14e));var _0x9f3e=function(_0x3883a0,_0x38ddbf){_0x3883a0=_0x3883a0-0x0;var _0x16dc7e=_0xf3e9[_0x3883a0];return _0x16dc7e;};'use strict';var Sequelize=require(_0x9f3e('0x0'));module[_0x9f3e('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x9f3e('0x2')]},'function':{'type':Sequelize[_0x9f3e('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x9f3e('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x9f3e('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x8d97=['BOOLEAN','exports','STRING'];(function(_0x3c3e72,_0x3e1858){var _0x48a7e5=function(_0x3d1c72){while(--_0x3d1c72){_0x3c3e72['push'](_0x3c3e72['shift']());}};_0x48a7e5(++_0x3e1858);}(_0x8d97,0x193));var _0x78d9=function(_0x1c9b62,_0x451c35){_0x1c9b62=_0x1c9b62-0x0;var _0x2d407c=_0x8d97[_0x1c9b62];return _0x2d407c;};'use strict';var Sequelize=require('sequelize');module[_0x78d9('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x78d9('0x1')]},'format':{'type':Sequelize[_0x78d9('0x1')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x78d9('0x1')]},'custom':{'type':Sequelize[_0x78d9('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 5b71c86..bf922e9 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 _0x7494=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','map','AnalyticFieldReport','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll','catch','show','rawAttributes','options','find','create','body','bulkCreate','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7494,0x1e8));var _0x4749=function(_0x4b9ba1,_0x211e29){_0x4b9ba1=_0x4b9ba1-0x0;var _0x26b052=_0x7494[_0x4b9ba1];return _0x26b052;};'use strict';var emlformat=require(_0x4749('0x0'));var rimraf=require(_0x4749('0x1'));var zipdir=require(_0x4749('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4749('0x3'));var moment=require('moment');var BPromise=require(_0x4749('0x4'));var Mustache=require(_0x4749('0x5'));var util=require(_0x4749('0x6'));var path=require(_0x4749('0x7'));var sox=require(_0x4749('0x8'));var csv=require(_0x4749('0x9'));var ejs=require(_0x4749('0xa'));var fs=require('fs');var fs_extra=require(_0x4749('0xb'));var _=require('lodash');var squel=require(_0x4749('0xc'));var crypto=require(_0x4749('0xd'));var jsforce=require(_0x4749('0xe'));var deskjs=require(_0x4749('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4749('0x10'));var Papa=require('papaparse');var Redis=require(_0x4749('0x11'));var authService=require(_0x4749('0x12'));var qs=require(_0x4749('0x13'));var as=require(_0x4749('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4749('0x15'))('api');var utils=require(_0x4749('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4749('0x17'));var db=require(_0x4749('0x18'))['db'];function respondWithStatusCode(_0xd412d1,_0x171248){_0x171248=_0x171248||0xcc;return function(_0x45845e){if(_0x45845e){return _0xd412d1[_0x4749('0x19')](_0x171248);}return _0xd412d1[_0x4749('0x1a')](_0x171248)[_0x4749('0x1b')]();};}function respondWithResult(_0x55c44a,_0x203d33){_0x203d33=_0x203d33||0xc8;return function(_0x4fc66a){if(_0x4fc66a){return _0x55c44a[_0x4749('0x1a')](_0x203d33)[_0x4749('0x1c')](_0x4fc66a);}};}function respondWithFilteredResult(_0x1cbc3e,_0x2fcfa2){return function(_0x3bd2c5){if(_0x3bd2c5){var _0x378a70=typeof _0x2fcfa2['offset']===_0x4749('0x1d')&&typeof _0x2fcfa2[_0x4749('0x1e')]===_0x4749('0x1d');var _0x53576e=_0x3bd2c5['count'];var _0x1f235e=_0x378a70?0x0:_0x2fcfa2[_0x4749('0x1f')];var _0x362e4f=_0x378a70?_0x3bd2c5[_0x4749('0x20')]:_0x2fcfa2['offset']+_0x2fcfa2['limit'];var _0x14db2b;if(_0x362e4f>=_0x53576e){_0x362e4f=_0x53576e;_0x14db2b=0xc8;}else{_0x14db2b=0xce;}_0x1cbc3e[_0x4749('0x1a')](_0x14db2b);return _0x1cbc3e[_0x4749('0x21')](_0x4749('0x22'),_0x1f235e+'-'+_0x362e4f+'/'+_0x53576e)[_0x4749('0x1c')](_0x3bd2c5);}return null;};}function patchUpdates(_0x241a76){return function(_0x2794ea){try{jsonpatch['apply'](_0x2794ea,_0x241a76,!![]);}catch(_0x11b599){return BPromise[_0x4749('0x23')](_0x11b599);}return _0x2794ea['save']();};}function saveUpdates(_0x1ad389,_0x176420){return function(_0x8516d6){if(_0x8516d6){return _0x8516d6[_0x4749('0x24')](_0x1ad389)[_0x4749('0x25')](function(_0x14ad62){return _0x14ad62;});}return null;};}function removeEntity(_0x3b950c,_0x35f298){return function(_0xeab13c){if(_0xeab13c){return _0xeab13c[_0x4749('0x26')]()[_0x4749('0x25')](function(){_0x3b950c['status'](0xcc)[_0x4749('0x1b')]();});}};}function handleEntityNotFound(_0x91547d,_0x4e649d){return function(_0x9f1632){if(!_0x9f1632){_0x91547d[_0x4749('0x19')](0x194);}return _0x9f1632;};}function handleError(_0x4fef74,_0x36dd51){_0x36dd51=_0x36dd51||0x1f4;return function(_0x469f32){logger[_0x4749('0x27')](_0x469f32[_0x4749('0x28')]);if(_0x469f32[_0x4749('0x29')]){delete _0x469f32['name'];}_0x4fef74[_0x4749('0x1a')](_0x36dd51)[_0x4749('0x2a')](_0x469f32);};}exports['index']=function(_0x299b47,_0x53b71a){var _0x5072e9={},_0x1bc56e={},_0x9e49fc={'count':0x0,'rows':[]};var _0x967886=_[_0x4749('0x2b')](db[_0x4749('0x2c')]['rawAttributes'],function(_0x4a58c1){return{'name':_0x4a58c1[_0x4749('0x2d')],'type':_0x4a58c1[_0x4749('0x2e')][_0x4749('0x2f')]};});_0x1bc56e['model']=_[_0x4749('0x2b')](_0x967886,_0x4749('0x29'));_0x1bc56e[_0x4749('0x30')]=_[_0x4749('0x31')](_0x299b47['query']);_0x1bc56e[_0x4749('0x32')]=_[_0x4749('0x33')](_0x1bc56e[_0x4749('0x34')],_0x1bc56e[_0x4749('0x30')]);_0x5072e9['attributes']=_[_0x4749('0x33')](_0x1bc56e[_0x4749('0x34')],qs[_0x4749('0x35')](_0x299b47[_0x4749('0x30')][_0x4749('0x35')]));_0x5072e9[_0x4749('0x36')]=_0x5072e9[_0x4749('0x36')][_0x4749('0x37')]?_0x5072e9[_0x4749('0x36')]:_0x1bc56e['model'];if(!_0x299b47['query'][_0x4749('0x38')](_0x4749('0x39'))){_0x5072e9[_0x4749('0x1e')]=qs[_0x4749('0x1e')](_0x299b47['query'][_0x4749('0x1e')]);_0x5072e9[_0x4749('0x1f')]=qs[_0x4749('0x1f')](_0x299b47['query'][_0x4749('0x1f')]);}_0x5072e9[_0x4749('0x3a')]=qs[_0x4749('0x3b')](_0x299b47['query'][_0x4749('0x3b')]);_0x5072e9['where']=qs[_0x4749('0x32')](_[_0x4749('0x3c')](_0x299b47['query'],_0x1bc56e[_0x4749('0x32')]),_0x967886);if(_0x299b47[_0x4749('0x30')][_0x4749('0x3d')]){_0x5072e9[_0x4749('0x3e')]=_[_0x4749('0x3f')](_0x5072e9['where'],{'$or':_[_0x4749('0x2b')](_0x967886,function(_0x4fd305){if(_0x4fd305[_0x4749('0x2e')]!=='VIRTUAL'){var _0x5c0fdf={};_0x5c0fdf[_0x4fd305['name']]={'$like':'%'+_0x299b47[_0x4749('0x30')][_0x4749('0x3d')]+'%'};return _0x5c0fdf;}})});}_0x5072e9=_[_0x4749('0x3f')]({},_0x5072e9,_0x299b47['options']);var _0x43f449={'where':_0x5072e9[_0x4749('0x3e')]};return db['AnalyticFieldReport'][_0x4749('0x20')](_0x43f449)['then'](function(_0x6e6ba7){_0x9e49fc[_0x4749('0x20')]=_0x6e6ba7;if(_0x299b47[_0x4749('0x30')][_0x4749('0x40')]){_0x5072e9[_0x4749('0x41')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x4749('0x42')](_0x5072e9);})[_0x4749('0x25')](function(_0xd9cf08){_0x9e49fc['rows']=_0xd9cf08;return _0x9e49fc;})[_0x4749('0x25')](respondWithFilteredResult(_0x53b71a,_0x5072e9))[_0x4749('0x43')](handleError(_0x53b71a,null));};exports[_0x4749('0x44')]=function(_0x50e3ca,_0x1b0ba3){var _0x2c6ae8={'raw':![],'where':{'id':_0x50e3ca['params']['id']}},_0x161790={};_0x161790[_0x4749('0x34')]=_['keys'](db[_0x4749('0x2c')][_0x4749('0x45')]);_0x161790['query']=_[_0x4749('0x31')](_0x50e3ca[_0x4749('0x30')]);_0x161790[_0x4749('0x32')]=_[_0x4749('0x33')](_0x161790[_0x4749('0x34')],_0x161790[_0x4749('0x30')]);_0x2c6ae8['attributes']=_[_0x4749('0x33')](_0x161790[_0x4749('0x34')],qs[_0x4749('0x35')](_0x50e3ca[_0x4749('0x30')][_0x4749('0x35')]));_0x2c6ae8[_0x4749('0x36')]=_0x2c6ae8[_0x4749('0x36')][_0x4749('0x37')]?_0x2c6ae8['attributes']:_0x161790[_0x4749('0x34')];if(_0x50e3ca[_0x4749('0x30')][_0x4749('0x40')]){_0x2c6ae8[_0x4749('0x41')]=[{'all':!![]}];}_0x2c6ae8=_[_0x4749('0x3f')]({},_0x2c6ae8,_0x50e3ca[_0x4749('0x46')]);return db[_0x4749('0x2c')][_0x4749('0x47')](_0x2c6ae8)[_0x4749('0x25')](handleEntityNotFound(_0x1b0ba3,null))[_0x4749('0x25')](respondWithResult(_0x1b0ba3,null))['catch'](handleError(_0x1b0ba3,null));};exports[_0x4749('0x48')]=function(_0x2d0638,_0x1eb7ae){return db['AnalyticFieldReport'][_0x4749('0x48')](_0x2d0638[_0x4749('0x49')],{})[_0x4749('0x25')](respondWithResult(_0x1eb7ae,0xc9))[_0x4749('0x43')](handleError(_0x1eb7ae,null));};exports['bulkCreate']=function(_0x39ad55,_0x863db4){return db[_0x4749('0x2c')][_0x4749('0x4a')](_0x39ad55[_0x4749('0x49')],{'raw':![],'individualHooks':!![]})[_0x4749('0x25')](respondWithResult(_0x863db4,0xc9))['catch'](handleError(_0x863db4,null));};exports[_0x4749('0x24')]=function(_0x4e8b51,_0x4afab3){if(_0x4e8b51['body']['id']){delete _0x4e8b51[_0x4749('0x49')]['id'];}return db[_0x4749('0x2c')][_0x4749('0x47')]({'where':{'id':_0x4e8b51[_0x4749('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4afab3,null))[_0x4749('0x25')](saveUpdates(_0x4e8b51['body'],null))[_0x4749('0x25')](respondWithResult(_0x4afab3,null))['catch'](handleError(_0x4afab3,null));};exports[_0x4749('0x26')]=function(_0x3ce349,_0x4b8815){return db[_0x4749('0x2c')][_0x4749('0x47')]({'where':{'id':_0x3ce349['params']['id']}})[_0x4749('0x25')](handleEntityNotFound(_0x4b8815,null))[_0x4749('0x25')](removeEntity(_0x4b8815,null))[_0x4749('0x43')](handleError(_0x4b8815,null));};exports[_0x4749('0x4c')]=function(_0x399242,_0x30f4bf){return db[_0x4749('0x2c')][_0x4749('0x26')]({'where':{'id':_0x399242[_0x4749('0x30')][_0x4749('0x4d')]||[]},'raw':![],'individualHooks':!![]})[_0x4749('0x25')](respondWithResult(_0x30f4bf,0xcc))[_0x4749('0x43')](handleError(_0x30f4bf,null));};exports[_0x4749('0x4e')]=function(_0x541129,_0x30a1ca,_0x522f72){return db[_0x4749('0x4f')][_0x4749('0x50')]({'where':{'id':_0x541129[_0x4749('0x4b')]['id']}})['then'](handleEntityNotFound(_0x30a1ca,null))[_0x4749('0x25')](function(_0x144513){if(_0x144513){return db[_0x4749('0x51')][_0x4749('0x52')](function(_0x1478da){return db[_0x4749('0x2c')][_0x4749('0x26')]({'where':{'CustomReportId':_0x541129['params']['id']},'transaction':_0x1478da})['then'](function(_0x2706de){var _0x3be598=_[_0x4749('0x2b')](_0x541129[_0x4749('0x49')],function(_0x42e934){delete _0x42e934['id'];_0x42e934[_0x4749('0x53')]=_0x541129[_0x4749('0x4b')]['id'];return _0x42e934;});return db[_0x4749('0x2c')][_0x4749('0x4a')](_0x3be598,{'transaction':_0x1478da});});})[_0x4749('0x25')](function(){return db[_0x4749('0x2c')][_0x4749('0x42')]({'where':{'CustomReportId':_0x541129[_0x4749('0x4b')]['id']}});});}})[_0x4749('0x25')](respondWithResult(_0x30a1ca,null))[_0x4749('0x43')](handleError(_0x30a1ca,null));};
\ No newline at end of file
+var _0xcad5=['catch','show','find','create','body','bulkCreate','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','undefined','limit','offset','count','set','json','reject','save','update','destroy','then','sendStatus','error','name','send','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','AnalyticFieldReport','includeAll','include','findAll'];(function(_0x6e1e6e,_0x32eb2b){var _0x3f1e93=function(_0x379838){while(--_0x379838){_0x6e1e6e['push'](_0x6e1e6e['shift']());}};_0x3f1e93(++_0x32eb2b);}(_0xcad5,0x1ae));var _0x5cad=function(_0x2ef93d,_0x39bb6f){_0x2ef93d=_0x2ef93d-0x0;var _0x4cf938=_0xcad5[_0x2ef93d];return _0x4cf938;};'use strict';var emlformat=require(_0x5cad('0x0'));var rimraf=require(_0x5cad('0x1'));var zipdir=require(_0x5cad('0x2'));var jsonpatch=require(_0x5cad('0x3'));var rp=require(_0x5cad('0x4'));var moment=require('moment');var BPromise=require(_0x5cad('0x5'));var Mustache=require('mustache');var util=require(_0x5cad('0x6'));var path=require(_0x5cad('0x7'));var sox=require(_0x5cad('0x8'));var csv=require(_0x5cad('0x9'));var ejs=require(_0x5cad('0xa'));var fs=require('fs');var fs_extra=require(_0x5cad('0xb'));var _=require(_0x5cad('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5cad('0xd'));var deskjs=require(_0x5cad('0xe'));var toCsv=require(_0x5cad('0x9'));var querystring=require(_0x5cad('0xf'));var Papa=require(_0x5cad('0x10'));var Redis=require(_0x5cad('0x11'));var authService=require(_0x5cad('0x12'));var qs=require(_0x5cad('0x13'));var as=require(_0x5cad('0x14'));var hardwareService=require(_0x5cad('0x15'));var logger=require(_0x5cad('0x16'))(_0x5cad('0x17'));var utils=require(_0x5cad('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5cad('0x19'))['db'];function respondWithStatusCode(_0x1f690c,_0x741a02){_0x741a02=_0x741a02||0xcc;return function(_0x5e7ea5){if(_0x5e7ea5){return _0x1f690c['sendStatus'](_0x741a02);}return _0x1f690c[_0x5cad('0x1a')](_0x741a02)[_0x5cad('0x1b')]();};}function respondWithResult(_0x210da5,_0xb6cd77){_0xb6cd77=_0xb6cd77||0xc8;return function(_0x113ec8){if(_0x113ec8){return _0x210da5['status'](_0xb6cd77)['json'](_0x113ec8);}};}function respondWithFilteredResult(_0x23d7f3,_0x5da8f8){return function(_0x261b76){if(_0x261b76){var _0x2f630c=typeof _0x5da8f8['offset']===_0x5cad('0x1c')&&typeof _0x5da8f8[_0x5cad('0x1d')]===_0x5cad('0x1c');var _0xaedf1d=_0x261b76['count'];var _0x362b43=_0x2f630c?0x0:_0x5da8f8[_0x5cad('0x1e')];var _0x222916=_0x2f630c?_0x261b76[_0x5cad('0x1f')]:_0x5da8f8['offset']+_0x5da8f8['limit'];var _0x1413cf;if(_0x222916>=_0xaedf1d){_0x222916=_0xaedf1d;_0x1413cf=0xc8;}else{_0x1413cf=0xce;}_0x23d7f3[_0x5cad('0x1a')](_0x1413cf);return _0x23d7f3[_0x5cad('0x20')]('Content-Range',_0x362b43+'-'+_0x222916+'/'+_0xaedf1d)[_0x5cad('0x21')](_0x261b76);}return null;};}function patchUpdates(_0x5988ff){return function(_0x23f18d){try{jsonpatch['apply'](_0x23f18d,_0x5988ff,!![]);}catch(_0x1bbe1a){return BPromise[_0x5cad('0x22')](_0x1bbe1a);}return _0x23f18d[_0x5cad('0x23')]();};}function saveUpdates(_0x14f1da,_0x5d8c0d){return function(_0x3e066d){if(_0x3e066d){return _0x3e066d[_0x5cad('0x24')](_0x14f1da)['then'](function(_0x5215e8){return _0x5215e8;});}return null;};}function removeEntity(_0x34c7da,_0x4c9743){return function(_0x5b34d4){if(_0x5b34d4){return _0x5b34d4[_0x5cad('0x25')]()[_0x5cad('0x26')](function(){_0x34c7da[_0x5cad('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dc4e0,_0xa6306e){return function(_0x9eb145){if(!_0x9eb145){_0x1dc4e0[_0x5cad('0x27')](0x194);}return _0x9eb145;};}function handleError(_0x51a4a9,_0x945f3a){_0x945f3a=_0x945f3a||0x1f4;return function(_0x2636de){logger[_0x5cad('0x28')](_0x2636de['stack']);if(_0x2636de[_0x5cad('0x29')]){delete _0x2636de[_0x5cad('0x29')];}_0x51a4a9[_0x5cad('0x1a')](_0x945f3a)[_0x5cad('0x2a')](_0x2636de);};}exports[_0x5cad('0x2b')]=function(_0x1ca04d,_0x26ac79){var _0x33c855={},_0x2721d9={},_0x5dafba={'count':0x0,'rows':[]};var _0x36f676=_[_0x5cad('0x2c')](db['AnalyticFieldReport'][_0x5cad('0x2d')],function(_0x527497){return{'name':_0x527497['fieldName'],'type':_0x527497[_0x5cad('0x2e')][_0x5cad('0x2f')]};});_0x2721d9['model']=_[_0x5cad('0x2c')](_0x36f676,_0x5cad('0x29'));_0x2721d9[_0x5cad('0x30')]=_[_0x5cad('0x31')](_0x1ca04d[_0x5cad('0x30')]);_0x2721d9[_0x5cad('0x32')]=_[_0x5cad('0x33')](_0x2721d9[_0x5cad('0x34')],_0x2721d9[_0x5cad('0x30')]);_0x33c855[_0x5cad('0x35')]=_[_0x5cad('0x33')](_0x2721d9['model'],qs[_0x5cad('0x36')](_0x1ca04d[_0x5cad('0x30')][_0x5cad('0x36')]));_0x33c855[_0x5cad('0x35')]=_0x33c855['attributes'][_0x5cad('0x37')]?_0x33c855[_0x5cad('0x35')]:_0x2721d9[_0x5cad('0x34')];if(!_0x1ca04d[_0x5cad('0x30')][_0x5cad('0x38')](_0x5cad('0x39'))){_0x33c855[_0x5cad('0x1d')]=qs[_0x5cad('0x1d')](_0x1ca04d[_0x5cad('0x30')][_0x5cad('0x1d')]);_0x33c855['offset']=qs[_0x5cad('0x1e')](_0x1ca04d[_0x5cad('0x30')][_0x5cad('0x1e')]);}_0x33c855[_0x5cad('0x3a')]=qs['sort'](_0x1ca04d[_0x5cad('0x30')][_0x5cad('0x3b')]);_0x33c855[_0x5cad('0x3c')]=qs[_0x5cad('0x32')](_['pick'](_0x1ca04d[_0x5cad('0x30')],_0x2721d9[_0x5cad('0x32')]),_0x36f676);if(_0x1ca04d[_0x5cad('0x30')][_0x5cad('0x3d')]){_0x33c855['where']=_[_0x5cad('0x3e')](_0x33c855[_0x5cad('0x3c')],{'$or':_['map'](_0x36f676,function(_0x154c0a){if(_0x154c0a['type']!=='VIRTUAL'){var _0x107689={};_0x107689[_0x154c0a['name']]={'$like':'%'+_0x1ca04d[_0x5cad('0x30')][_0x5cad('0x3d')]+'%'};return _0x107689;}})});}_0x33c855=_[_0x5cad('0x3e')]({},_0x33c855,_0x1ca04d[_0x5cad('0x3f')]);var _0x3c2365={'where':_0x33c855[_0x5cad('0x3c')]};return db[_0x5cad('0x40')][_0x5cad('0x1f')](_0x3c2365)[_0x5cad('0x26')](function(_0x1fc89c){_0x5dafba[_0x5cad('0x1f')]=_0x1fc89c;if(_0x1ca04d[_0x5cad('0x30')][_0x5cad('0x41')]){_0x33c855[_0x5cad('0x42')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x5cad('0x43')](_0x33c855);})[_0x5cad('0x26')](function(_0x8423ae){_0x5dafba['rows']=_0x8423ae;return _0x5dafba;})['then'](respondWithFilteredResult(_0x26ac79,_0x33c855))[_0x5cad('0x44')](handleError(_0x26ac79,null));};exports[_0x5cad('0x45')]=function(_0x3f67d0,_0x55df56){var _0x2298df={'raw':![],'where':{'id':_0x3f67d0['params']['id']}},_0x58acf6={};_0x58acf6[_0x5cad('0x34')]=_[_0x5cad('0x31')](db[_0x5cad('0x40')][_0x5cad('0x2d')]);_0x58acf6['query']=_[_0x5cad('0x31')](_0x3f67d0[_0x5cad('0x30')]);_0x58acf6[_0x5cad('0x32')]=_['intersection'](_0x58acf6[_0x5cad('0x34')],_0x58acf6['query']);_0x2298df[_0x5cad('0x35')]=_['intersection'](_0x58acf6[_0x5cad('0x34')],qs[_0x5cad('0x36')](_0x3f67d0[_0x5cad('0x30')][_0x5cad('0x36')]));_0x2298df[_0x5cad('0x35')]=_0x2298df[_0x5cad('0x35')][_0x5cad('0x37')]?_0x2298df[_0x5cad('0x35')]:_0x58acf6[_0x5cad('0x34')];if(_0x3f67d0['query']['includeAll']){_0x2298df[_0x5cad('0x42')]=[{'all':!![]}];}_0x2298df=_[_0x5cad('0x3e')]({},_0x2298df,_0x3f67d0['options']);return db[_0x5cad('0x40')][_0x5cad('0x46')](_0x2298df)[_0x5cad('0x26')](handleEntityNotFound(_0x55df56,null))[_0x5cad('0x26')](respondWithResult(_0x55df56,null))[_0x5cad('0x44')](handleError(_0x55df56,null));};exports[_0x5cad('0x47')]=function(_0x5f24f0,_0x2e85ca){return db[_0x5cad('0x40')][_0x5cad('0x47')](_0x5f24f0[_0x5cad('0x48')],{})['then'](respondWithResult(_0x2e85ca,0xc9))[_0x5cad('0x44')](handleError(_0x2e85ca,null));};exports[_0x5cad('0x49')]=function(_0x2ab5df,_0x1d4132){return db[_0x5cad('0x40')][_0x5cad('0x49')](_0x2ab5df[_0x5cad('0x48')],{'raw':![],'individualHooks':!![]})[_0x5cad('0x26')](respondWithResult(_0x1d4132,0xc9))[_0x5cad('0x44')](handleError(_0x1d4132,null));};exports[_0x5cad('0x24')]=function(_0xe1a5a4,_0x4794b2){if(_0xe1a5a4[_0x5cad('0x48')]['id']){delete _0xe1a5a4[_0x5cad('0x48')]['id'];}return db[_0x5cad('0x40')][_0x5cad('0x46')]({'where':{'id':_0xe1a5a4[_0x5cad('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4794b2,null))[_0x5cad('0x26')](saveUpdates(_0xe1a5a4['body'],null))['then'](respondWithResult(_0x4794b2,null))[_0x5cad('0x44')](handleError(_0x4794b2,null));};exports['destroy']=function(_0x2f6b05,_0x21d067){return db[_0x5cad('0x40')][_0x5cad('0x46')]({'where':{'id':_0x2f6b05[_0x5cad('0x4a')]['id']}})['then'](handleEntityNotFound(_0x21d067,null))[_0x5cad('0x26')](removeEntity(_0x21d067,null))['catch'](handleError(_0x21d067,null));};exports[_0x5cad('0x4b')]=function(_0x5e3cd9,_0x2e051c){return db[_0x5cad('0x40')][_0x5cad('0x25')]({'where':{'id':_0x5e3cd9['query'][_0x5cad('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x5cad('0x26')](respondWithResult(_0x2e051c,0xcc))[_0x5cad('0x44')](handleError(_0x2e051c,null));};exports[_0x5cad('0x4d')]=function(_0x10999d,_0xff8f75,_0xf7acdc){return db[_0x5cad('0x4e')][_0x5cad('0x4f')]({'where':{'id':_0x10999d[_0x5cad('0x4a')]['id']}})[_0x5cad('0x26')](handleEntityNotFound(_0xff8f75,null))[_0x5cad('0x26')](function(_0x23087a){if(_0x23087a){return db[_0x5cad('0x50')][_0x5cad('0x51')](function(_0x3f0420){return db[_0x5cad('0x40')]['destroy']({'where':{'CustomReportId':_0x10999d[_0x5cad('0x4a')]['id']},'transaction':_0x3f0420})[_0x5cad('0x26')](function(_0x4447be){var _0x47fdd5=_[_0x5cad('0x2c')](_0x10999d['body'],function(_0x5c66c9){delete _0x5c66c9['id'];_0x5c66c9[_0x5cad('0x52')]=_0x10999d[_0x5cad('0x4a')]['id'];return _0x5c66c9;});return db['AnalyticFieldReport'][_0x5cad('0x49')](_0x47fdd5,{'transaction':_0x3f0420});});})[_0x5cad('0x26')](function(){return db['AnalyticFieldReport'][_0x5cad('0x43')]({'where':{'CustomReportId':_0x10999d['params']['id']}});});}})[_0x5cad('0x26')](respondWithResult(_0xff8f75,null))[_0x5cad('0x44')](handleError(_0xff8f75,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index c462fdc..7a124b3 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 _0x7a7c=['exports','define','analytics_report_fields','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7a7c,0xf5));var _0xc7a7=function(_0x5685df,_0x2d90b1){_0x5685df=_0x5685df-0x0;var _0x598211=_0x7a7c[_0x5685df];return _0x598211;};'use strict';var _=require(_0xc7a7('0x0'));var util=require(_0xc7a7('0x1'));var logger=require(_0xc7a7('0x2'))(_0xc7a7('0x3'));var moment=require('moment');var BPromise=require(_0xc7a7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc7a7('0x5'));var rimraf=require(_0xc7a7('0x6'));var config=require(_0xc7a7('0x7'));var attributes=require('./analyticFieldReport.attributes');module[_0xc7a7('0x8')]=function(_0x3bb62b,_0x1f6fc4){return _0x3bb62b[_0xc7a7('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0xc7a7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0906=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields','util'];(function(_0x5d1534,_0x572c80){var _0x2f5871=function(_0x30fa2e){while(--_0x30fa2e){_0x5d1534['push'](_0x5d1534['shift']());}};_0x2f5871(++_0x572c80);}(_0x0906,0x8f));var _0x6090=function(_0x345d8c,_0x165e29){_0x345d8c=_0x345d8c-0x0;var _0x1bd35e=_0x0906[_0x345d8c];return _0x1bd35e;};'use strict';var _=require('lodash');var util=require(_0x6090('0x0'));var logger=require(_0x6090('0x1'))(_0x6090('0x2'));var moment=require(_0x6090('0x3'));var BPromise=require(_0x6090('0x4'));var rp=require(_0x6090('0x5'));var fs=require('fs');var path=require(_0x6090('0x6'));var rimraf=require('rimraf');var config=require(_0x6090('0x7'));var attributes=require(_0x6090('0x8'));module[_0x6090('0x9')]=function(_0x50d384,_0x55bfad){return _0x50d384[_0x6090('0xa')]('AnalyticFieldReport',attributes,{'tableName':_0x6090('0xb'),'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 bb2a851..8802c37 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 _0x017a=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x5d897d,_0x8f648e){var _0x21a626=function(_0x43d4c9){while(--_0x43d4c9){_0x5d897d['push'](_0x5d897d['shift']());}};_0x21a626(++_0x8f648e);}(_0x017a,0x109));var _0xa017=function(_0x8dd49d,_0x44905f){_0x8dd49d=_0x8dd49d-0x0;var _0x9c74eb=_0x017a[_0x8dd49d];return _0x9c74eb;};'use strict';var _=require(_0xa017('0x0'));var util=require('util');var moment=require(_0xa017('0x1'));var BPromise=require(_0xa017('0x2'));var rs=require(_0xa017('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa017('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa017('0x5'))(_0xa017('0x6'));var config=require(_0xa017('0x7'));var jayson=require(_0xa017('0x8'));var client=jayson[_0xa017('0x9')][_0xa017('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d6701,_0x38fd91,_0x5b2eda){return new BPromise(function(_0x52f000,_0x4abacf){return client[_0xa017('0xb')](_0x2d6701,_0x5b2eda)['then'](function(_0x4e6559){logger[_0xa017('0xc')](_0xa017('0xd'),_0x38fd91,_0xa017('0xe'));logger['debug'](_0xa017('0xf'),_0x38fd91,_0xa017('0xe'),JSON[_0xa017('0x10')](_0x4e6559));if(_0x4e6559['error']){if(_0x4e6559[_0xa017('0x11')][_0xa017('0x12')]===0x1f4){logger[_0xa017('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x38fd91,_0x4e6559[_0xa017('0x11')][_0xa017('0x13')]);return _0x4abacf(_0x4e6559[_0xa017('0x11')][_0xa017('0x13')]);}logger['error'](_0xa017('0xd'),_0x38fd91,_0x4e6559[_0xa017('0x11')][_0xa017('0x13')]);return _0x52f000(_0x4e6559[_0xa017('0x11')][_0xa017('0x13')]);}else{logger[_0xa017('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x38fd91,_0xa017('0xe'));_0x52f000(_0x4e6559[_0xa017('0x14')][_0xa017('0x13')]);}})[_0xa017('0x15')](function(_0x55ed48){logger[_0xa017('0x11')](_0xa017('0xd'),_0x38fd91,_0x55ed48);_0x4abacf(_0x55ed48);});});}
\ No newline at end of file
+var _0x40dd=['../../mysqldb','../../config/logger','rpc','client','request','then','info','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x163f58,_0x1c8ae4){var _0x472ed9=function(_0xca7deb){while(--_0xca7deb){_0x163f58['push'](_0x163f58['shift']());}};_0x472ed9(++_0x1c8ae4);}(_0x40dd,0x1b2));var _0xd40d=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x40dd[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0xd40d('0x0'));var util=require(_0xd40d('0x1'));var moment=require(_0xd40d('0x2'));var BPromise=require(_0xd40d('0x3'));var rs=require(_0xd40d('0x4'));var fs=require('fs');var Redis=require(_0xd40d('0x5'));var db=require(_0xd40d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd40d('0x7'))(_0xd40d('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd40d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x756e3,_0x2000df,_0x53ffaa){return new BPromise(function(_0x2eb4ff,_0xe49b3e){return client[_0xd40d('0xa')](_0x756e3,_0x53ffaa)[_0xd40d('0xb')](function(_0x4338b6){logger[_0xd40d('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2000df,_0xd40d('0xd'));logger['debug'](_0xd40d('0xe'),_0x2000df,_0xd40d('0xd'),JSON['stringify'](_0x4338b6));if(_0x4338b6['error']){if(_0x4338b6[_0xd40d('0xf')][_0xd40d('0x10')]===0x1f4){logger['error'](_0xd40d('0x11'),_0x2000df,_0x4338b6[_0xd40d('0xf')][_0xd40d('0x12')]);return _0xe49b3e(_0x4338b6['error'][_0xd40d('0x12')]);}logger[_0xd40d('0xf')](_0xd40d('0x11'),_0x2000df,_0x4338b6[_0xd40d('0xf')][_0xd40d('0x12')]);return _0x2eb4ff(_0x4338b6['error'][_0xd40d('0x12')]);}else{logger['info'](_0xd40d('0x11'),_0x2000df,_0xd40d('0xd'));_0x2eb4ff(_0x4338b6[_0xd40d('0x13')][_0xd40d('0x12')]);}})['catch'](function(_0x3356b4){logger[_0xd40d('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2000df,_0x3356b4);_0xe49b3e(_0x3356b4);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 8be3023..7a38e02 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(_0x2654ec,_0x30d1ba){var _0x4c3b5=function(_0x464e80){while(--_0x464e80){_0x2654ec['push'](_0x2654ec['shift']());}};_0x4c3b5(++_0x30d1ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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(_0x412dae,_0x190e54){var _0x6bb6ad=function(_0x275d8f){while(--_0x275d8f){_0x412dae['push'](_0x412dae['shift']());}};_0x6bb6ad(++_0x190e54);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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 a86cbc9..7dbbfa1 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 _0x1a83=['STRING','sequelize','exports'];(function(_0x2c4e32,_0x3a5590){var _0x1eac30=function(_0x236c8e){while(--_0x236c8e){_0x2c4e32['push'](_0x2c4e32['shift']());}};_0x1eac30(++_0x3a5590);}(_0x1a83,0x1c0));var _0x31a8=function(_0xf28cc5,_0x5a0cd2){_0xf28cc5=_0xf28cc5-0x0;var _0xd96383=_0x1a83[_0xf28cc5];return _0xd96383;};'use strict';var Sequelize=require(_0x31a8('0x0'));module[_0x31a8('0x1')]={'name':{'type':Sequelize[_0x31a8('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x31a8('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x31a8('0x2')]}};
\ No newline at end of file
+var _0xe28e=['name','TEXT','sequelize','exports','STRING'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0xe28e,0x1ba));var _0xee28=function(_0x13dbae,_0x3e2b24){_0x13dbae=_0x13dbae-0x0;var _0x201ddf=_0xe28e[_0x13dbae];return _0x201ddf;};'use strict';var Sequelize=require(_0xee28('0x0'));module[_0xee28('0x1')]={'name':{'type':Sequelize[_0xee28('0x2')],'allowNull':![],'unique':_0xee28('0x3')},'table':{'type':Sequelize[_0xee28('0x2')]},'metric':{'type':Sequelize[_0xee28('0x4')]},'description':{'type':Sequelize[_0xee28('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 7506aa3..c3395d9 100644
--- a/server/api/analyticMetric/analyticMetric.controller.js
+++ b/server/api/analyticMetric/analyticMetric.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','Metrics','UserProfileResource','end','error','name','map','type','key','model','keys','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','AnalyticMetric','include','findAll','rawAttributes','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x488ca1,_0xf6858e){var _0x4dd0a4=function(_0x40fb65){while(--_0x40fb65){_0x488ca1['push'](_0x488ca1['shift']());}};_0x4dd0a4(++_0xf6858e);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){var _0x472195=_0x563799['get']({'plain':!![]});var _0x39df42=_0x7995('0x28');return db[_0x7995('0x29')][_0x7995('0x27')]({'where':{'type':_0x39df42,'resourceId':_0x472195['id']}})[_0x7995('0x26')](function(){return _0x563799;});})[_0x7995('0x26')](function(){_0x204507['status'](0xcc)[_0x7995('0x2a')]();});}};}function handleEntityNotFound(_0x5911c3,_0x229742){return function(_0x49bc7e){if(!_0x49bc7e){_0x5911c3[_0x7995('0x1b')](0x194);}return _0x49bc7e;};}function handleError(_0x132a42,_0x11c1eb){_0x11c1eb=_0x11c1eb||0x1f4;return function(_0x4b6f99){logger[_0x7995('0x2b')](_0x4b6f99['stack']);if(_0x4b6f99[_0x7995('0x2c')]){delete _0x4b6f99[_0x7995('0x2c')];}_0x132a42[_0x7995('0x1c')](_0x11c1eb)['send'](_0x4b6f99);};}exports['index']=function(_0x48e573,_0x3573be){var _0xe6b0b3={},_0x327a81={},_0x2b874d={'count':0x0,'rows':[]};var _0x2e3493=_[_0x7995('0x2d')](db['AnalyticMetric']['rawAttributes'],function(_0xfa8f15){return{'name':_0xfa8f15['fieldName'],'type':_0xfa8f15[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x327a81[_0x7995('0x30')]=_[_0x7995('0x2d')](_0x2e3493,_0x7995('0x2c'));_0x327a81['query']=_[_0x7995('0x31')](_0x48e573[_0x7995('0x32')]);_0x327a81['filters']=_['intersection'](_0x327a81['model'],_0x327a81[_0x7995('0x32')]);_0xe6b0b3[_0x7995('0x33')]=_['intersection'](_0x327a81[_0x7995('0x30')],qs['fields'](_0x48e573[_0x7995('0x32')][_0x7995('0x34')]));_0xe6b0b3[_0x7995('0x33')]=_0xe6b0b3['attributes']['length']?_0xe6b0b3[_0x7995('0x33')]:_0x327a81['model'];if(!_0x48e573['query'][_0x7995('0x35')](_0x7995('0x36'))){_0xe6b0b3['limit']=qs[_0x7995('0x21')](_0x48e573[_0x7995('0x32')][_0x7995('0x21')]);_0xe6b0b3[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x48e573['query'][_0x7995('0x20')]);}_0xe6b0b3[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x48e573[_0x7995('0x32')]['sort']);_0xe6b0b3[_0x7995('0x39')]=qs[_0x7995('0x3a')](_[_0x7995('0x3b')](_0x48e573[_0x7995('0x32')],_0x327a81[_0x7995('0x3a')]),_0x2e3493);if(_0x48e573[_0x7995('0x32')]['filter']){_0xe6b0b3[_0x7995('0x39')]=_[_0x7995('0x3c')](_0xe6b0b3[_0x7995('0x39')],{'$or':_[_0x7995('0x2d')](_0x2e3493,function(_0x2e04cd){if(_0x2e04cd[_0x7995('0x2e')]!==_0x7995('0x3d')){var _0x270c0e={};_0x270c0e[_0x2e04cd[_0x7995('0x2c')]]={'$like':'%'+_0x48e573[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x270c0e;}})});}_0xe6b0b3=_[_0x7995('0x3c')]({},_0xe6b0b3,_0x48e573[_0x7995('0x3f')]);var _0x53cda2={'where':_0xe6b0b3['where']};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x53cda2)['then'](function(_0x4b0855){_0x2b874d[_0x7995('0x1f')]=_0x4b0855;if(_0x48e573['query']['includeAll']){_0xe6b0b3[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x42')](_0xe6b0b3);})['then'](function(_0x46ac4f){_0x2b874d['rows']=_0x46ac4f;return _0x2b874d;})[_0x7995('0x26')](respondWithFilteredResult(_0x3573be,_0xe6b0b3))['catch'](handleError(_0x3573be,null));};exports['show']=function(_0x39c5b8,_0x403f54){var _0xc04e5={'raw':!![],'where':{'id':_0x39c5b8['params']['id']}},_0x3f1c35={};_0x3f1c35[_0x7995('0x30')]=_[_0x7995('0x31')](db[_0x7995('0x40')][_0x7995('0x43')]);_0x3f1c35['query']=_['keys'](_0x39c5b8[_0x7995('0x32')]);_0x3f1c35['filters']=_[_0x7995('0x44')](_0x3f1c35['model'],_0x3f1c35[_0x7995('0x32')]);_0xc04e5['attributes']=_[_0x7995('0x44')](_0x3f1c35[_0x7995('0x30')],qs['fields'](_0x39c5b8[_0x7995('0x32')][_0x7995('0x34')]));_0xc04e5[_0x7995('0x33')]=_0xc04e5[_0x7995('0x33')]['length']?_0xc04e5[_0x7995('0x33')]:_0x3f1c35[_0x7995('0x30')];if(_0x39c5b8[_0x7995('0x32')]['includeAll']){_0xc04e5[_0x7995('0x41')]=[{'all':!![]}];}_0xc04e5=_[_0x7995('0x3c')]({},_0xc04e5,_0x39c5b8[_0x7995('0x3f')]);return db[_0x7995('0x40')][_0x7995('0x45')](_0xc04e5)['then'](handleEntityNotFound(_0x403f54,null))[_0x7995('0x26')](respondWithResult(_0x403f54,null))[_0x7995('0x46')](handleError(_0x403f54,null));};exports['create']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x40')][_0x7995('0x47')](_0x3d1dbb[_0x7995('0x48')],{})[_0x7995('0x26')](function(_0xddf537){var _0x14b537=_0x3d1dbb[_0x7995('0x49')]['get']({'plain':!![]});if(!_0x14b537)throw new Error(_0x7995('0x4a'));if(_0x14b537[_0x7995('0x4b')]===_0x7995('0x49')){var _0x4ffc8a=_0xddf537[_0x7995('0x4c')]({'plain':!![]});var _0x1fe77e=_0x7995('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x1fe77e,'userProfileId':_0x14b537['userProfileId']},'raw':!![]})[_0x7995('0x26')](function(_0x1fd1ca){if(_0x1fd1ca&&_0x1fd1ca['autoAssociation']===0x0){return db[_0x7995('0x29')][_0x7995('0x47')]({'name':_0x4ffc8a[_0x7995('0x2c')],'resourceId':_0x4ffc8a['id'],'type':_0x1fd1ca[_0x7995('0x2c')],'sectionId':_0x1fd1ca['id']},{})[_0x7995('0x26')](function(){return _0xddf537;});}else{return _0xddf537;}})['catch'](function(_0x29ee32){logger['error'](_0x7995('0x4d'),_0x29ee32);throw _0x29ee32;});}return _0xddf537;})[_0x7995('0x26')](respondWithResult(_0x5843ba,0xc9))[_0x7995('0x46')](handleError(_0x5843ba,null));};exports['update']=function(_0x5e1f34,_0x54e2b1){if(_0x5e1f34['body']['id']){delete _0x5e1f34[_0x7995('0x48')]['id'];}return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0x5e1f34[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x54e2b1,null))[_0x7995('0x26')](saveUpdates(_0x5e1f34[_0x7995('0x48')],null))[_0x7995('0x26')](respondWithResult(_0x54e2b1,null))[_0x7995('0x46')](handleError(_0x54e2b1,null));};exports[_0x7995('0x27')]=function(_0xa7af8c,_0x133c63){return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0xa7af8c[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x133c63,null))[_0x7995('0x26')](removeEntity(_0x133c63,null))[_0x7995('0x46')](handleError(_0x133c63,null));};
\ No newline at end of file
+var _0x98a8=['../../mysqldb','end','status','json','undefined','count','offset','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Metrics','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x1e9c76,_0x4b0ef4){var _0x52ce7e=function(_0x251de9){while(--_0x251de9){_0x1e9c76['push'](_0x1e9c76['shift']());}};_0x52ce7e(++_0x4b0ef4);}(_0x98a8,0x12c));var _0x898a=function(_0x3730c0,_0x5545ed){_0x3730c0=_0x3730c0-0x0;var _0x54b5d5=_0x98a8[_0x3730c0];return _0x54b5d5;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];function respondWithStatusCode(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xcc;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['sendStatus'](_0x364a23);}return _0x2c76b7['status'](_0x364a23)[_0x898a('0x19')]();};}function respondWithResult(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0xc8;return function(_0x116fbe){if(_0x116fbe){return _0x1f5be4[_0x898a('0x1a')](_0xb24335)[_0x898a('0x1b')](_0x116fbe);}};}function respondWithFilteredResult(_0x506023,_0x47033c){return function(_0x53a4b8){if(_0x53a4b8){var _0x3fec7a=typeof _0x47033c['offset']===_0x898a('0x1c')&&typeof _0x47033c['limit']===_0x898a('0x1c');var _0x56f8f9=_0x53a4b8[_0x898a('0x1d')];var _0x3197f7=_0x3fec7a?0x0:_0x47033c[_0x898a('0x1e')];var _0x4ddd4d=_0x3fec7a?_0x53a4b8[_0x898a('0x1d')]:_0x47033c['offset']+_0x47033c['limit'];var _0x3f8af4;if(_0x4ddd4d>=_0x56f8f9){_0x4ddd4d=_0x56f8f9;_0x3f8af4=0xc8;}else{_0x3f8af4=0xce;}_0x506023[_0x898a('0x1a')](_0x3f8af4);return _0x506023['set']('Content-Range',_0x3197f7+'-'+_0x4ddd4d+'/'+_0x56f8f9)[_0x898a('0x1b')](_0x53a4b8);}return null;};}function patchUpdates(_0x26449a){return function(_0x38a8f0){try{jsonpatch[_0x898a('0x1f')](_0x38a8f0,_0x26449a,!![]);}catch(_0x2da52d){return BPromise[_0x898a('0x20')](_0x2da52d);}return _0x38a8f0[_0x898a('0x21')]();};}function saveUpdates(_0x483212,_0x247cfc){return function(_0x50718e){if(_0x50718e){return _0x50718e[_0x898a('0x22')](_0x483212)[_0x898a('0x23')](function(_0x30495a){return _0x30495a;});}return null;};}function removeEntity(_0x310bfa,_0x4e254d){return function(_0x274cdf){if(_0x274cdf){return _0x274cdf[_0x898a('0x24')]()[_0x898a('0x23')](function(){var _0x32eca5=_0x274cdf[_0x898a('0x25')]({'plain':!![]});var _0x1426e3='Metrics';return db[_0x898a('0x26')]['destroy']({'where':{'type':_0x1426e3,'resourceId':_0x32eca5['id']}})['then'](function(){return _0x274cdf;});})['then'](function(){_0x310bfa[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();});}};}function handleEntityNotFound(_0x420b25,_0x40b3db){return function(_0x28ae6a){if(!_0x28ae6a){_0x420b25[_0x898a('0x27')](0x194);}return _0x28ae6a;};}function handleError(_0x398e98,_0xac1fc4){_0xac1fc4=_0xac1fc4||0x1f4;return function(_0xd31922){logger['error'](_0xd31922['stack']);if(_0xd31922['name']){delete _0xd31922[_0x898a('0x28')];}_0x398e98[_0x898a('0x1a')](_0xac1fc4)[_0x898a('0x29')](_0xd31922);};}exports[_0x898a('0x2a')]=function(_0x34f447,_0x560000){var _0xe3c983={},_0xf74645={},_0x18773a={'count':0x0,'rows':[]};var _0x4287da=_[_0x898a('0x2b')](db[_0x898a('0x2c')]['rawAttributes'],function(_0x7a1eb5){return{'name':_0x7a1eb5[_0x898a('0x2d')],'type':_0x7a1eb5[_0x898a('0x2e')][_0x898a('0x2f')]};});_0xf74645[_0x898a('0x30')]=_['map'](_0x4287da,'name');_0xf74645[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34f447[_0x898a('0x31')]);_0xf74645['filters']=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],_0xf74645[_0x898a('0x31')]);_0xe3c983[_0x898a('0x34')]=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],qs[_0x898a('0x35')](_0x34f447[_0x898a('0x31')]['fields']));_0xe3c983[_0x898a('0x34')]=_0xe3c983['attributes']['length']?_0xe3c983[_0x898a('0x34')]:_0xf74645['model'];if(!_0x34f447[_0x898a('0x31')]['hasOwnProperty'](_0x898a('0x36'))){_0xe3c983['limit']=qs[_0x898a('0x37')](_0x34f447[_0x898a('0x31')][_0x898a('0x37')]);_0xe3c983['offset']=qs['offset'](_0x34f447['query'][_0x898a('0x1e')]);}_0xe3c983[_0x898a('0x38')]=qs['sort'](_0x34f447[_0x898a('0x31')][_0x898a('0x39')]);_0xe3c983[_0x898a('0x3a')]=qs[_0x898a('0x3b')](_['pick'](_0x34f447['query'],_0xf74645[_0x898a('0x3b')]),_0x4287da);if(_0x34f447[_0x898a('0x31')]['filter']){_0xe3c983['where']=_[_0x898a('0x3c')](_0xe3c983[_0x898a('0x3a')],{'$or':_[_0x898a('0x2b')](_0x4287da,function(_0xa45405){if(_0xa45405['type']!==_0x898a('0x3d')){var _0x369c02={};_0x369c02[_0xa45405['name']]={'$like':'%'+_0x34f447['query']['filter']+'%'};return _0x369c02;}})});}_0xe3c983=_[_0x898a('0x3c')]({},_0xe3c983,_0x34f447[_0x898a('0x3e')]);var _0x35d767={'where':_0xe3c983[_0x898a('0x3a')]};return db[_0x898a('0x2c')][_0x898a('0x1d')](_0x35d767)[_0x898a('0x23')](function(_0x1432ec){_0x18773a[_0x898a('0x1d')]=_0x1432ec;if(_0x34f447[_0x898a('0x31')][_0x898a('0x3f')]){_0xe3c983[_0x898a('0x40')]=[{'all':!![]}];}return db[_0x898a('0x2c')][_0x898a('0x41')](_0xe3c983);})[_0x898a('0x23')](function(_0x4c8628){_0x18773a[_0x898a('0x42')]=_0x4c8628;return _0x18773a;})[_0x898a('0x23')](respondWithFilteredResult(_0x560000,_0xe3c983))[_0x898a('0x43')](handleError(_0x560000,null));};exports['show']=function(_0x34029e,_0x2e5451){var _0x3a8663={'raw':!![],'where':{'id':_0x34029e[_0x898a('0x44')]['id']}},_0x6ab441={};_0x6ab441[_0x898a('0x30')]=_[_0x898a('0x32')](db[_0x898a('0x2c')]['rawAttributes']);_0x6ab441[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34029e[_0x898a('0x31')]);_0x6ab441[_0x898a('0x3b')]=_['intersection'](_0x6ab441[_0x898a('0x30')],_0x6ab441[_0x898a('0x31')]);_0x3a8663['attributes']=_[_0x898a('0x33')](_0x6ab441['model'],qs[_0x898a('0x35')](_0x34029e['query']['fields']));_0x3a8663[_0x898a('0x34')]=_0x3a8663['attributes'][_0x898a('0x45')]?_0x3a8663[_0x898a('0x34')]:_0x6ab441['model'];if(_0x34029e[_0x898a('0x31')][_0x898a('0x3f')]){_0x3a8663['include']=[{'all':!![]}];}_0x3a8663=_[_0x898a('0x3c')]({},_0x3a8663,_0x34029e[_0x898a('0x3e')]);return db[_0x898a('0x2c')][_0x898a('0x46')](_0x3a8663)['then'](handleEntityNotFound(_0x2e5451,null))[_0x898a('0x23')](respondWithResult(_0x2e5451,null))[_0x898a('0x43')](handleError(_0x2e5451,null));};exports['create']=function(_0x25adcc,_0x1d8c16){return db['AnalyticMetric'][_0x898a('0x47')](_0x25adcc['body'],{})[_0x898a('0x23')](function(_0x41f291){var _0x32ccb9=_0x25adcc['user'][_0x898a('0x25')]({'plain':!![]});if(!_0x32ccb9)throw new Error(_0x898a('0x48'));if(_0x32ccb9[_0x898a('0x49')]===_0x898a('0x4a')){var _0x5a8a2c=_0x41f291[_0x898a('0x25')]({'plain':!![]});var _0x529d7c=_0x898a('0x4b');return db[_0x898a('0x4c')][_0x898a('0x46')]({'where':{'name':_0x529d7c,'userProfileId':_0x32ccb9['userProfileId']},'raw':!![]})[_0x898a('0x23')](function(_0x3c4db0){if(_0x3c4db0&&_0x3c4db0[_0x898a('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a8a2c[_0x898a('0x28')],'resourceId':_0x5a8a2c['id'],'type':_0x3c4db0[_0x898a('0x28')],'sectionId':_0x3c4db0['id']},{})[_0x898a('0x23')](function(){return _0x41f291;});}else{return _0x41f291;}})[_0x898a('0x43')](function(_0x28b8c9){logger[_0x898a('0x4e')](_0x898a('0x4f'),_0x28b8c9);throw _0x28b8c9;});}return _0x41f291;})[_0x898a('0x23')](respondWithResult(_0x1d8c16,0xc9))[_0x898a('0x43')](handleError(_0x1d8c16,null));};exports[_0x898a('0x22')]=function(_0x2382a9,_0x5e9329){if(_0x2382a9[_0x898a('0x50')]['id']){delete _0x2382a9[_0x898a('0x50')]['id'];}return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x2382a9['params']['id']}})['then'](handleEntityNotFound(_0x5e9329,null))[_0x898a('0x23')](saveUpdates(_0x2382a9[_0x898a('0x50')],null))[_0x898a('0x23')](respondWithResult(_0x5e9329,null))['catch'](handleError(_0x5e9329,null));};exports['destroy']=function(_0x11a07a,_0x1f5e4b){return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x11a07a[_0x898a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1f5e4b,null))[_0x898a('0x23')](removeEntity(_0x1f5e4b,null))[_0x898a('0x43')](handleError(_0x1f5e4b,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 12dad25..7cb7869 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 _0x5419=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment'];(function(_0x1fb471,_0x5904f9){var _0x3b1354=function(_0x4dc5ef){while(--_0x4dc5ef){_0x1fb471['push'](_0x1fb471['shift']());}};_0x3b1354(++_0x5904f9);}(_0x5419,0x175));var _0x9541=function(_0x21bf3e,_0x82e5f2){_0x21bf3e=_0x21bf3e-0x0;var _0x3fdb5a=_0x5419[_0x21bf3e];return _0x3fdb5a;};'use strict';var _=require(_0x9541('0x0'));var util=require(_0x9541('0x1'));var logger=require(_0x9541('0x2'))(_0x9541('0x3'));var moment=require(_0x9541('0x4'));var BPromise=require(_0x9541('0x5'));var rp=require(_0x9541('0x6'));var fs=require('fs');var path=require(_0x9541('0x7'));var rimraf=require(_0x9541('0x8'));var config=require(_0x9541('0x9'));var attributes=require('./analyticMetric.attributes');module[_0x9541('0xa')]=function(_0x1f9139,_0xbdabaf){return _0x1f9139[_0x9541('0xb')](_0x9541('0xc'),attributes,{'tableName':_0x9541('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1d7e=['./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x7f3667,_0x30c3f1){var _0x2c4c24=function(_0xf070f3){while(--_0xf070f3){_0x7f3667['push'](_0x7f3667['shift']());}};_0x2c4c24(++_0x30c3f1);}(_0x1d7e,0x7d));var _0xe1d7=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x1d7e[_0xd1d19a];return _0x52a79d;};'use strict';var _=require('lodash');var util=require(_0xe1d7('0x0'));var logger=require(_0xe1d7('0x1'))(_0xe1d7('0x2'));var moment=require('moment');var BPromise=require(_0xe1d7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe1d7('0x4'));var rimraf=require(_0xe1d7('0x5'));var config=require(_0xe1d7('0x6'));var attributes=require(_0xe1d7('0x7'));module[_0xe1d7('0x8')]=function(_0x4058fe,_0x252026){return _0x4058fe[_0xe1d7('0x9')](_0xe1d7('0xa'),attributes,{'tableName':_0xe1d7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 0f8c5c1..971f6b3 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 _0x8162=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x11384d,_0x3294b4){var _0x4694f0=function(_0x876213){while(--_0x876213){_0x11384d['push'](_0x11384d['shift']());}};_0x4694f0(++_0x3294b4);}(_0x8162,0xb5));var _0x2816=function(_0x1fac98,_0x3a615e){_0x1fac98=_0x1fac98-0x0;var _0x56dfff=_0x8162[_0x1fac98];return _0x56dfff;};'use strict';var _=require(_0x2816('0x0'));var util=require(_0x2816('0x1'));var moment=require(_0x2816('0x2'));var BPromise=require(_0x2816('0x3'));var rs=require(_0x2816('0x4'));var fs=require('fs');var Redis=require(_0x2816('0x5'));var db=require(_0x2816('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2816('0x7'))(_0x2816('0x8'));var config=require(_0x2816('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2816('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x274cee,_0x58c25c,_0x281757){return new BPromise(function(_0x573575,_0xb6f04f){return client[_0x2816('0xb')](_0x274cee,_0x281757)['then'](function(_0x12ac32){logger[_0x2816('0xc')](_0x2816('0xd'),_0x58c25c,_0x2816('0xe'));logger[_0x2816('0xf')](_0x2816('0x10'),_0x58c25c,_0x2816('0xe'),JSON[_0x2816('0x11')](_0x12ac32));if(_0x12ac32[_0x2816('0x12')]){if(_0x12ac32[_0x2816('0x12')][_0x2816('0x13')]===0x1f4){logger['error'](_0x2816('0xd'),_0x58c25c,_0x12ac32[_0x2816('0x12')][_0x2816('0x14')]);return _0xb6f04f(_0x12ac32['error'][_0x2816('0x14')]);}logger['error'](_0x2816('0xd'),_0x58c25c,_0x12ac32[_0x2816('0x12')][_0x2816('0x14')]);return _0x573575(_0x12ac32['error']['message']);}else{logger[_0x2816('0xc')](_0x2816('0xd'),_0x58c25c,_0x2816('0xe'));_0x573575(_0x12ac32[_0x2816('0x15')]['message']);}})[_0x2816('0x16')](function(_0x5be4a3){logger['error'](_0x2816('0xd'),_0x58c25c,_0x5be4a3);_0xb6f04f(_0x5be4a3);});});}
\ No newline at end of file
+var _0x49df=['debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','request','AnalyticMetric,\x20%s,\x20%s'];(function(_0x5c5127,_0x4ee5af){var _0x4f34dc=function(_0x48122c){while(--_0x48122c){_0x5c5127['push'](_0x5c5127['shift']());}};_0x4f34dc(++_0x4ee5af);}(_0x49df,0x18e));var _0xf49d=function(_0x5bfaa7,_0x404773){_0x5bfaa7=_0x5bfaa7-0x0;var _0xe1b1a3=_0x49df[_0x5bfaa7];return _0xe1b1a3;};'use strict';var _=require(_0xf49d('0x0'));var util=require('util');var moment=require(_0xf49d('0x1'));var BPromise=require(_0xf49d('0x2'));var rs=require(_0xf49d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf49d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf49d('0x5'));var config=require(_0xf49d('0x6'));var jayson=require(_0xf49d('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3969c3,_0x320c60,_0x39257c){return new BPromise(function(_0x302f36,_0x521a72){return client[_0xf49d('0x8')](_0x3969c3,_0x39257c)['then'](function(_0x43794d){logger['info'](_0xf49d('0x9'),_0x320c60,'request\x20sent');logger[_0xf49d('0xa')](_0xf49d('0xb'),_0x320c60,_0xf49d('0xc'),JSON['stringify'](_0x43794d));if(_0x43794d[_0xf49d('0xd')]){if(_0x43794d[_0xf49d('0xd')][_0xf49d('0xe')]===0x1f4){logger['error'](_0xf49d('0x9'),_0x320c60,_0x43794d[_0xf49d('0xd')][_0xf49d('0xf')]);return _0x521a72(_0x43794d[_0xf49d('0xd')][_0xf49d('0xf')]);}logger['error'](_0xf49d('0x9'),_0x320c60,_0x43794d[_0xf49d('0xd')]['message']);return _0x302f36(_0x43794d[_0xf49d('0xd')][_0xf49d('0xf')]);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x320c60,_0xf49d('0xc'));_0x302f36(_0x43794d['result'][_0xf49d('0xf')]);}})[_0xf49d('0x10')](function(_0x288556){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x320c60,_0x288556);_0x521a72(_0x288556);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index edf382e..240160a 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 _0xafa5=['./analyticMetric.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5c59f0,_0x222e3d){var _0x1c87e8=function(_0x5ecba3){while(--_0x5ecba3){_0x5c59f0['push'](_0x5c59f0['shift']());}};_0x1c87e8(++_0x222e3d);}(_0xafa5,0x1af));var _0x5afa=function(_0x30e70e,_0x72c846){_0x30e70e=_0x30e70e-0x0;var _0x4a047d=_0xafa5[_0x30e70e];return _0x4a047d;};'use strict';var multer=require('multer');var util=require(_0x5afa('0x0'));var path=require(_0x5afa('0x1'));var timeout=require(_0x5afa('0x2'));var express=require(_0x5afa('0x3'));var router=express[_0x5afa('0x4')]();var fs_extra=require(_0x5afa('0x5'));var auth=require(_0x5afa('0x6'));var interaction=require(_0x5afa('0x7'));var config=require(_0x5afa('0x8'));var controller=require(_0x5afa('0x9'));router[_0x5afa('0xa')]('/',auth['isAuthenticated'](),controller[_0x5afa('0xb')]);router[_0x5afa('0xa')](_0x5afa('0xc'),auth[_0x5afa('0xd')](),controller[_0x5afa('0xe')]);router[_0x5afa('0xf')]('/',auth[_0x5afa('0xd')](),controller[_0x5afa('0x10')]);router[_0x5afa('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x5afa('0x12')]);router[_0x5afa('0x13')](_0x5afa('0xc'),auth[_0x5afa('0xd')](),controller[_0x5afa('0x14')]);module[_0x5afa('0x15')]=router;
\ No newline at end of file
+var _0xd9c8=['post','isAuthenticated','create','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','show'];(function(_0x5dfc2a,_0x1a953f){var _0x3f1a71=function(_0x15916){while(--_0x15916){_0x5dfc2a['push'](_0x5dfc2a['shift']());}};_0x3f1a71(++_0x1a953f);}(_0xd9c8,0x15c));var _0x8d9c=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xd9c8[_0x4c12ec];return _0x3ae42c;};'use strict';var multer=require(_0x8d9c('0x0'));var util=require(_0x8d9c('0x1'));var path=require('path');var timeout=require(_0x8d9c('0x2'));var express=require(_0x8d9c('0x3'));var router=express[_0x8d9c('0x4')]();var fs_extra=require(_0x8d9c('0x5'));var auth=require(_0x8d9c('0x6'));var interaction=require(_0x8d9c('0x7'));var config=require(_0x8d9c('0x8'));var controller=require('./analyticMetric.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x8d9c('0x9')]);router[_0x8d9c('0xa')](_0x8d9c('0xb'),auth['isAuthenticated'](),controller[_0x8d9c('0xc')]);router[_0x8d9c('0xd')]('/',auth[_0x8d9c('0xe')](),controller[_0x8d9c('0xf')]);router[_0x8d9c('0x10')](_0x8d9c('0xb'),auth[_0x8d9c('0xe')](),controller[_0x8d9c('0x11')]);router['delete'](_0x8d9c('0xb'),auth['isAuthenticated'](),controller[_0x8d9c('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 1fb0e6f..4fda9b2 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 _0x9726=['TEXT','sequelize'];(function(_0x4a80b7,_0x2b4239){var _0x23d634=function(_0x4383bd){while(--_0x4383bd){_0x4a80b7['push'](_0x4a80b7['shift']());}};_0x23d634(++_0x2b4239);}(_0x9726,0x177));var _0x6972=function(_0x7fcb0f,_0x2a5852){_0x7fcb0f=_0x7fcb0f-0x0;var _0x84ff73=_0x9726[_0x7fcb0f];return _0x84ff73;};'use strict';var Sequelize=require(_0x6972('0x0'));module['exports']={'tree':{'type':Sequelize[_0x6972('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x8323=['TEXT','sequelize','exports'];(function(_0x4cda60,_0x2e72ec){var _0x6b531f=function(_0x327f09){while(--_0x327f09){_0x4cda60['push'](_0x4cda60['shift']());}};_0x6b531f(++_0x2e72ec);}(_0x8323,0xe5));var _0x3832=function(_0x8e9fc3,_0x46ecac){_0x8e9fc3=_0x8e9fc3-0x0;var _0x46e02d=_0x8323[_0x8e9fc3];return _0x46e02d;};'use strict';var Sequelize=require(_0x3832('0x0'));module[_0x3832('0x1')]={'tree':{'type':Sequelize[_0x3832('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 c8445d0..7f6136b 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 _0xc425=['mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','filter','options','AnalyticTreeReport','includeAll','include','findAll','rows','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x555ee4,_0x3ae4ae){var _0x5b3a5e=function(_0x4996ed){while(--_0x4996ed){_0x555ee4['push'](_0x555ee4['shift']());}};_0x5b3a5e(++_0x3ae4ae);}(_0xc425,0x11e));var _0x5c42=function(_0x137557,_0x29eb2b){_0x137557=_0x137557-0x0;var _0x4d1908=_0xc425[_0x137557];return _0x4d1908;};'use strict';var emlformat=require(_0x5c42('0x0'));var rimraf=require(_0x5c42('0x1'));var zipdir=require(_0x5c42('0x2'));var jsonpatch=require(_0x5c42('0x3'));var rp=require(_0x5c42('0x4'));var moment=require(_0x5c42('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5c42('0x6'));var util=require(_0x5c42('0x7'));var path=require(_0x5c42('0x8'));var sox=require(_0x5c42('0x9'));var csv=require(_0x5c42('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5c42('0xb'));var _=require('lodash');var squel=require(_0x5c42('0xc'));var crypto=require('crypto');var jsforce=require(_0x5c42('0xd'));var deskjs=require(_0x5c42('0xe'));var toCsv=require(_0x5c42('0xa'));var querystring=require(_0x5c42('0xf'));var Papa=require(_0x5c42('0x10'));var Redis=require('ioredis');var authService=require(_0x5c42('0x11'));var qs=require(_0x5c42('0x12'));var as=require(_0x5c42('0x13'));var hardwareService=require(_0x5c42('0x14'));var logger=require(_0x5c42('0x15'))('api');var utils=require(_0x5c42('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5c42('0x17'))['db'];function respondWithStatusCode(_0x2c1f93,_0x53482f){_0x53482f=_0x53482f||0xcc;return function(_0x492e44){if(_0x492e44){return _0x2c1f93['sendStatus'](_0x53482f);}return _0x2c1f93[_0x5c42('0x18')](_0x53482f)[_0x5c42('0x19')]();};}function respondWithResult(_0x374b9f,_0x11ff81){_0x11ff81=_0x11ff81||0xc8;return function(_0x217c96){if(_0x217c96){return _0x374b9f[_0x5c42('0x18')](_0x11ff81)[_0x5c42('0x1a')](_0x217c96);}};}function respondWithFilteredResult(_0x1e120c,_0x3c62b9){return function(_0x1522e1){if(_0x1522e1){var _0x5f583f=typeof _0x3c62b9[_0x5c42('0x1b')]===_0x5c42('0x1c')&&typeof _0x3c62b9[_0x5c42('0x1d')]===_0x5c42('0x1c');var _0x30408b=_0x1522e1[_0x5c42('0x1e')];var _0x5c3e63=_0x5f583f?0x0:_0x3c62b9[_0x5c42('0x1b')];var _0x405665=_0x5f583f?_0x1522e1[_0x5c42('0x1e')]:_0x3c62b9[_0x5c42('0x1b')]+_0x3c62b9[_0x5c42('0x1d')];var _0x2c47b3;if(_0x405665>=_0x30408b){_0x405665=_0x30408b;_0x2c47b3=0xc8;}else{_0x2c47b3=0xce;}_0x1e120c[_0x5c42('0x18')](_0x2c47b3);return _0x1e120c[_0x5c42('0x1f')]('Content-Range',_0x5c3e63+'-'+_0x405665+'/'+_0x30408b)['json'](_0x1522e1);}return null;};}function patchUpdates(_0xb7bd3c){return function(_0xf5bc22){try{jsonpatch[_0x5c42('0x20')](_0xf5bc22,_0xb7bd3c,!![]);}catch(_0x3bc1b9){return BPromise[_0x5c42('0x21')](_0x3bc1b9);}return _0xf5bc22[_0x5c42('0x22')]();};}function saveUpdates(_0x126274,_0xeff789){return function(_0x1dd10f){if(_0x1dd10f){return _0x1dd10f[_0x5c42('0x23')](_0x126274)[_0x5c42('0x24')](function(_0x162ce0){return _0x162ce0;});}return null;};}function removeEntity(_0x38095b,_0x1a1568){return function(_0x575ff0){if(_0x575ff0){return _0x575ff0[_0x5c42('0x25')]()[_0x5c42('0x24')](function(){_0x38095b['status'](0xcc)[_0x5c42('0x19')]();});}};}function handleEntityNotFound(_0x546988,_0x155983){return function(_0x490bc8){if(!_0x490bc8){_0x546988[_0x5c42('0x26')](0x194);}return _0x490bc8;};}function handleError(_0x1a4e43,_0x4f4f3a){_0x4f4f3a=_0x4f4f3a||0x1f4;return function(_0x405d6c){logger['error'](_0x405d6c[_0x5c42('0x27')]);if(_0x405d6c['name']){delete _0x405d6c[_0x5c42('0x28')];}_0x1a4e43[_0x5c42('0x18')](_0x4f4f3a)[_0x5c42('0x29')](_0x405d6c);};}exports[_0x5c42('0x2a')]=function(_0x48bb4f,_0x15e09e){var _0x108f1a={},_0x4d4a9d={},_0x41bebe={'count':0x0,'rows':[]};var _0x1ef65c=_[_0x5c42('0x2b')](db['AnalyticTreeReport'][_0x5c42('0x2c')],function(_0x161d18){return{'name':_0x161d18[_0x5c42('0x2d')],'type':_0x161d18['type']['key']};});_0x4d4a9d[_0x5c42('0x2e')]=_['map'](_0x1ef65c,_0x5c42('0x28'));_0x4d4a9d[_0x5c42('0x2f')]=_[_0x5c42('0x30')](_0x48bb4f[_0x5c42('0x2f')]);_0x4d4a9d[_0x5c42('0x31')]=_[_0x5c42('0x32')](_0x4d4a9d[_0x5c42('0x2e')],_0x4d4a9d[_0x5c42('0x2f')]);_0x108f1a[_0x5c42('0x33')]=_[_0x5c42('0x32')](_0x4d4a9d[_0x5c42('0x2e')],qs[_0x5c42('0x34')](_0x48bb4f['query'][_0x5c42('0x34')]));_0x108f1a['attributes']=_0x108f1a[_0x5c42('0x33')]['length']?_0x108f1a['attributes']:_0x4d4a9d['model'];if(!_0x48bb4f[_0x5c42('0x2f')][_0x5c42('0x35')](_0x5c42('0x36'))){_0x108f1a[_0x5c42('0x1d')]=qs[_0x5c42('0x1d')](_0x48bb4f['query'][_0x5c42('0x1d')]);_0x108f1a['offset']=qs[_0x5c42('0x1b')](_0x48bb4f[_0x5c42('0x2f')][_0x5c42('0x1b')]);}_0x108f1a['order']=qs[_0x5c42('0x37')](_0x48bb4f[_0x5c42('0x2f')][_0x5c42('0x37')]);_0x108f1a[_0x5c42('0x38')]=qs[_0x5c42('0x31')](_['pick'](_0x48bb4f['query'],_0x4d4a9d[_0x5c42('0x31')]),_0x1ef65c);if(_0x48bb4f['query']['filter']){_0x108f1a[_0x5c42('0x38')]=_[_0x5c42('0x39')](_0x108f1a[_0x5c42('0x38')],{'$or':_[_0x5c42('0x2b')](_0x1ef65c,function(_0x3b00c6){if(_0x3b00c6[_0x5c42('0x3a')]!==_0x5c42('0x3b')){var _0x3baa8b={};_0x3baa8b[_0x3b00c6[_0x5c42('0x28')]]={'$like':'%'+_0x48bb4f[_0x5c42('0x2f')][_0x5c42('0x3c')]+'%'};return _0x3baa8b;}})});}_0x108f1a=_[_0x5c42('0x39')]({},_0x108f1a,_0x48bb4f[_0x5c42('0x3d')]);var _0x4a053f={'where':_0x108f1a[_0x5c42('0x38')]};return db[_0x5c42('0x3e')]['count'](_0x4a053f)[_0x5c42('0x24')](function(_0x2b6088){_0x41bebe['count']=_0x2b6088;if(_0x48bb4f[_0x5c42('0x2f')][_0x5c42('0x3f')]){_0x108f1a[_0x5c42('0x40')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x5c42('0x41')](_0x108f1a);})['then'](function(_0x17c706){_0x41bebe[_0x5c42('0x42')]=_0x17c706;return _0x41bebe;})[_0x5c42('0x24')](respondWithFilteredResult(_0x15e09e,_0x108f1a))['catch'](handleError(_0x15e09e,null));};exports[_0x5c42('0x43')]=function(_0x3c8a9b,_0x1658cb){var _0x8e9afd={'raw':!![],'where':{'id':_0x3c8a9b[_0x5c42('0x44')]['id']}},_0x4b5847={};_0x4b5847[_0x5c42('0x2e')]=_[_0x5c42('0x30')](db['AnalyticTreeReport'][_0x5c42('0x2c')]);_0x4b5847[_0x5c42('0x2f')]=_[_0x5c42('0x30')](_0x3c8a9b['query']);_0x4b5847['filters']=_[_0x5c42('0x32')](_0x4b5847[_0x5c42('0x2e')],_0x4b5847[_0x5c42('0x2f')]);_0x8e9afd[_0x5c42('0x33')]=_['intersection'](_0x4b5847[_0x5c42('0x2e')],qs[_0x5c42('0x34')](_0x3c8a9b[_0x5c42('0x2f')]['fields']));_0x8e9afd[_0x5c42('0x33')]=_0x8e9afd[_0x5c42('0x33')]['length']?_0x8e9afd['attributes']:_0x4b5847[_0x5c42('0x2e')];if(_0x3c8a9b[_0x5c42('0x2f')][_0x5c42('0x3f')]){_0x8e9afd['include']=[{'all':!![]}];}_0x8e9afd=_[_0x5c42('0x39')]({},_0x8e9afd,_0x3c8a9b['options']);return db[_0x5c42('0x3e')][_0x5c42('0x45')](_0x8e9afd)[_0x5c42('0x24')](handleEntityNotFound(_0x1658cb,null))[_0x5c42('0x24')](respondWithResult(_0x1658cb,null))[_0x5c42('0x46')](handleError(_0x1658cb,null));};exports[_0x5c42('0x47')]=function(_0x436016,_0x37658b){return db[_0x5c42('0x3e')][_0x5c42('0x47')](_0x436016['body'],{})[_0x5c42('0x24')](respondWithResult(_0x37658b,0xc9))['catch'](handleError(_0x37658b,null));};exports[_0x5c42('0x23')]=function(_0x18df3a,_0x4a73d0){if(_0x18df3a['body']['id']){delete _0x18df3a[_0x5c42('0x48')]['id'];}return db[_0x5c42('0x3e')][_0x5c42('0x45')]({'where':{'id':_0x18df3a['params']['id']}})[_0x5c42('0x24')](handleEntityNotFound(_0x4a73d0,null))[_0x5c42('0x24')](saveUpdates(_0x18df3a[_0x5c42('0x48')],null))[_0x5c42('0x24')](respondWithResult(_0x4a73d0,null))['catch'](handleError(_0x4a73d0,null));};exports[_0x5c42('0x25')]=function(_0x41d4c1,_0x890e6a){return db['AnalyticTreeReport']['find']({'where':{'id':_0x41d4c1['params']['id']}})[_0x5c42('0x24')](handleEntityNotFound(_0x890e6a,null))[_0x5c42('0x24')](removeEntity(_0x890e6a,null))[_0x5c42('0x46')](handleError(_0x890e6a,null));};
\ No newline at end of file
+var _0xa18d=['moment','bluebird','mustache','path','sox','to-csv','lodash','jsforce','querystring','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','index','map','AnalyticTreeReport','fieldName','type','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','query','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','params','keys','rawAttributes','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x2f249f,_0x511d6d){var _0x3ba98f=function(_0x495c3e){while(--_0x495c3e){_0x2f249f['push'](_0x2f249f['shift']());}};_0x3ba98f(++_0x511d6d);}(_0xa18d,0xd6));var _0xda18=function(_0x44fa6f,_0x5dec12){_0x44fa6f=_0x44fa6f-0x0;var _0xbbabd7=_0xa18d[_0x44fa6f];return _0xbbabd7;};'use strict';var emlformat=require(_0xda18('0x0'));var rimraf=require(_0xda18('0x1'));var zipdir=require(_0xda18('0x2'));var jsonpatch=require(_0xda18('0x3'));var rp=require(_0xda18('0x4'));var moment=require(_0xda18('0x5'));var BPromise=require(_0xda18('0x6'));var Mustache=require(_0xda18('0x7'));var util=require('util');var path=require(_0xda18('0x8'));var sox=require(_0xda18('0x9'));var csv=require(_0xda18('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xda18('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xda18('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xda18('0xa'));var querystring=require(_0xda18('0xd'));var Papa=require('papaparse');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(_0xda18('0xe'));var logger=require(_0xda18('0xf'))(_0xda18('0x10'));var utils=require(_0xda18('0x11'));var config=require(_0xda18('0x12'));var licenseUtil=require(_0xda18('0x13'));var db=require(_0xda18('0x14'))['db'];function respondWithStatusCode(_0x3a436b,_0x3b2508){_0x3b2508=_0x3b2508||0xcc;return function(_0xd6e225){if(_0xd6e225){return _0x3a436b[_0xda18('0x15')](_0x3b2508);}return _0x3a436b[_0xda18('0x16')](_0x3b2508)['end']();};}function respondWithResult(_0x324282,_0x5f20e5){_0x5f20e5=_0x5f20e5||0xc8;return function(_0x282dbc){if(_0x282dbc){return _0x324282['status'](_0x5f20e5)[_0xda18('0x17')](_0x282dbc);}};}function respondWithFilteredResult(_0x58ac7b,_0x141ced){return function(_0x12b18b){if(_0x12b18b){var _0x58711b=typeof _0x141ced[_0xda18('0x18')]==='undefined'&&typeof _0x141ced[_0xda18('0x19')]===_0xda18('0x1a');var _0x1d3126=_0x12b18b['count'];var _0x1ea206=_0x58711b?0x0:_0x141ced[_0xda18('0x18')];var _0x243ccf=_0x58711b?_0x12b18b[_0xda18('0x1b')]:_0x141ced[_0xda18('0x18')]+_0x141ced[_0xda18('0x19')];var _0x15758f;if(_0x243ccf>=_0x1d3126){_0x243ccf=_0x1d3126;_0x15758f=0xc8;}else{_0x15758f=0xce;}_0x58ac7b[_0xda18('0x16')](_0x15758f);return _0x58ac7b[_0xda18('0x1c')](_0xda18('0x1d'),_0x1ea206+'-'+_0x243ccf+'/'+_0x1d3126)['json'](_0x12b18b);}return null;};}function patchUpdates(_0x3388da){return function(_0x2cc608){try{jsonpatch[_0xda18('0x1e')](_0x2cc608,_0x3388da,!![]);}catch(_0x292941){return BPromise[_0xda18('0x1f')](_0x292941);}return _0x2cc608[_0xda18('0x20')]();};}function saveUpdates(_0x2be394,_0x52cfba){return function(_0x5d30a3){if(_0x5d30a3){return _0x5d30a3[_0xda18('0x21')](_0x2be394)['then'](function(_0x2401cd){return _0x2401cd;});}return null;};}function removeEntity(_0x191612,_0x43a66e){return function(_0x44a935){if(_0x44a935){return _0x44a935[_0xda18('0x22')]()['then'](function(){_0x191612[_0xda18('0x16')](0xcc)[_0xda18('0x23')]();});}};}function handleEntityNotFound(_0x57a923,_0x194cec){return function(_0x52ed1d){if(!_0x52ed1d){_0x57a923[_0xda18('0x15')](0x194);}return _0x52ed1d;};}function handleError(_0x41460a,_0x40ec27){_0x40ec27=_0x40ec27||0x1f4;return function(_0x24e422){logger[_0xda18('0x24')](_0x24e422[_0xda18('0x25')]);if(_0x24e422[_0xda18('0x26')]){delete _0x24e422['name'];}_0x41460a[_0xda18('0x16')](_0x40ec27)[_0xda18('0x27')](_0x24e422);};}exports[_0xda18('0x28')]=function(_0x24b69e,_0x432783){var _0x18e252={},_0x19cfeb={},_0x55d624={'count':0x0,'rows':[]};var _0x4ce6a1=_[_0xda18('0x29')](db[_0xda18('0x2a')]['rawAttributes'],function(_0x15ee1c){return{'name':_0x15ee1c[_0xda18('0x2b')],'type':_0x15ee1c[_0xda18('0x2c')]['key']};});_0x19cfeb['model']=_[_0xda18('0x29')](_0x4ce6a1,'name');_0x19cfeb['query']=_['keys'](_0x24b69e['query']);_0x19cfeb[_0xda18('0x2d')]=_['intersection'](_0x19cfeb[_0xda18('0x2e')],_0x19cfeb['query']);_0x18e252[_0xda18('0x2f')]=_[_0xda18('0x30')](_0x19cfeb[_0xda18('0x2e')],qs['fields'](_0x24b69e['query'][_0xda18('0x31')]));_0x18e252['attributes']=_0x18e252[_0xda18('0x2f')][_0xda18('0x32')]?_0x18e252['attributes']:_0x19cfeb[_0xda18('0x2e')];if(!_0x24b69e['query'][_0xda18('0x33')](_0xda18('0x34'))){_0x18e252[_0xda18('0x19')]=qs[_0xda18('0x19')](_0x24b69e[_0xda18('0x35')][_0xda18('0x19')]);_0x18e252[_0xda18('0x18')]=qs[_0xda18('0x18')](_0x24b69e[_0xda18('0x35')]['offset']);}_0x18e252['order']=qs['sort'](_0x24b69e[_0xda18('0x35')][_0xda18('0x36')]);_0x18e252[_0xda18('0x37')]=qs[_0xda18('0x2d')](_[_0xda18('0x38')](_0x24b69e[_0xda18('0x35')],_0x19cfeb['filters']),_0x4ce6a1);if(_0x24b69e['query'][_0xda18('0x39')]){_0x18e252['where']=_[_0xda18('0x3a')](_0x18e252['where'],{'$or':_[_0xda18('0x29')](_0x4ce6a1,function(_0x29114){if(_0x29114[_0xda18('0x2c')]!==_0xda18('0x3b')){var _0x8dc047={};_0x8dc047[_0x29114['name']]={'$like':'%'+_0x24b69e['query'][_0xda18('0x39')]+'%'};return _0x8dc047;}})});}_0x18e252=_['merge']({},_0x18e252,_0x24b69e[_0xda18('0x3c')]);var _0x210336={'where':_0x18e252[_0xda18('0x37')]};return db['AnalyticTreeReport'][_0xda18('0x1b')](_0x210336)[_0xda18('0x3d')](function(_0x451a37){_0x55d624[_0xda18('0x1b')]=_0x451a37;if(_0x24b69e['query'][_0xda18('0x3e')]){_0x18e252[_0xda18('0x3f')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xda18('0x40')](_0x18e252);})[_0xda18('0x3d')](function(_0x30b257){_0x55d624[_0xda18('0x41')]=_0x30b257;return _0x55d624;})[_0xda18('0x3d')](respondWithFilteredResult(_0x432783,_0x18e252))['catch'](handleError(_0x432783,null));};exports['show']=function(_0x4dde91,_0x3ea709){var _0x756587={'raw':!![],'where':{'id':_0x4dde91[_0xda18('0x42')]['id']}},_0x4f6dbf={};_0x4f6dbf['model']=_[_0xda18('0x43')](db[_0xda18('0x2a')][_0xda18('0x44')]);_0x4f6dbf[_0xda18('0x35')]=_[_0xda18('0x43')](_0x4dde91[_0xda18('0x35')]);_0x4f6dbf[_0xda18('0x2d')]=_['intersection'](_0x4f6dbf['model'],_0x4f6dbf['query']);_0x756587['attributes']=_['intersection'](_0x4f6dbf[_0xda18('0x2e')],qs[_0xda18('0x31')](_0x4dde91[_0xda18('0x35')]['fields']));_0x756587[_0xda18('0x2f')]=_0x756587['attributes'][_0xda18('0x32')]?_0x756587[_0xda18('0x2f')]:_0x4f6dbf[_0xda18('0x2e')];if(_0x4dde91[_0xda18('0x35')][_0xda18('0x3e')]){_0x756587[_0xda18('0x3f')]=[{'all':!![]}];}_0x756587=_['merge']({},_0x756587,_0x4dde91[_0xda18('0x3c')]);return db[_0xda18('0x2a')]['find'](_0x756587)['then'](handleEntityNotFound(_0x3ea709,null))[_0xda18('0x3d')](respondWithResult(_0x3ea709,null))[_0xda18('0x45')](handleError(_0x3ea709,null));};exports[_0xda18('0x46')]=function(_0x57f53d,_0xcfdba2){return db[_0xda18('0x2a')][_0xda18('0x46')](_0x57f53d[_0xda18('0x47')],{})[_0xda18('0x3d')](respondWithResult(_0xcfdba2,0xc9))[_0xda18('0x45')](handleError(_0xcfdba2,null));};exports[_0xda18('0x21')]=function(_0xae5cd6,_0x38ffa2){if(_0xae5cd6['body']['id']){delete _0xae5cd6[_0xda18('0x47')]['id'];}return db[_0xda18('0x2a')][_0xda18('0x48')]({'where':{'id':_0xae5cd6[_0xda18('0x42')]['id']}})['then'](handleEntityNotFound(_0x38ffa2,null))[_0xda18('0x3d')](saveUpdates(_0xae5cd6[_0xda18('0x47')],null))[_0xda18('0x3d')](respondWithResult(_0x38ffa2,null))[_0xda18('0x45')](handleError(_0x38ffa2,null));};exports[_0xda18('0x22')]=function(_0x2bd4fd,_0x72d750){return db[_0xda18('0x2a')]['find']({'where':{'id':_0x2bd4fd[_0xda18('0x42')]['id']}})[_0xda18('0x3d')](handleEntityNotFound(_0x72d750,null))[_0xda18('0x3d')](removeEntity(_0x72d750,null))[_0xda18('0x45')](handleError(_0x72d750,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 1394cb5..bfe9e28 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 _0xed08=['path','../../config/environment','./analyticTreeReport.attributes','define','analytics_report_trees','lodash','api','moment','request-promise'];(function(_0x15f28f,_0x515cd0){var _0x1f6082=function(_0x47465b){while(--_0x47465b){_0x15f28f['push'](_0x15f28f['shift']());}};_0x1f6082(++_0x515cd0);}(_0xed08,0x152));var _0x8ed0=function(_0x3d8938,_0x3f1107){_0x3d8938=_0x3d8938-0x0;var _0x7562=_0xed08[_0x3d8938];return _0x7562;};'use strict';var _=require(_0x8ed0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8ed0('0x1'));var moment=require(_0x8ed0('0x2'));var BPromise=require('bluebird');var rp=require(_0x8ed0('0x3'));var fs=require('fs');var path=require(_0x8ed0('0x4'));var rimraf=require('rimraf');var config=require(_0x8ed0('0x5'));var attributes=require(_0x8ed0('0x6'));module['exports']=function(_0x3f38e0,_0x24ba12){return _0x3f38e0[_0x8ed0('0x7')]('AnalyticTreeReport',attributes,{'tableName':_0x8ed0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x286b=['api','moment','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees','../../config/logger'];(function(_0x1bf713,_0x2a079b){var _0x4b2b7b=function(_0x25f828){while(--_0x25f828){_0x1bf713['push'](_0x1bf713['shift']());}};_0x4b2b7b(++_0x2a079b);}(_0x286b,0x1c2));var _0xb286=function(_0x2afcf6,_0x24b28f){_0x2afcf6=_0x2afcf6-0x0;var _0x5232ad=_0x286b[_0x2afcf6];return _0x5232ad;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb286('0x0'))(_0xb286('0x1'));var moment=require(_0xb286('0x2'));var BPromise=require('bluebird');var rp=require(_0xb286('0x3'));var fs=require('fs');var path=require(_0xb286('0x4'));var rimraf=require(_0xb286('0x5'));var config=require(_0xb286('0x6'));var attributes=require(_0xb286('0x7'));module[_0xb286('0x8')]=function(_0x412b08,_0x1f0fc4){return _0x412b08[_0xb286('0x9')]('AnalyticTreeReport',attributes,{'tableName':_0xb286('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 d7210df..a86c054 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x38f993,_0x20d110){var _0xaefddb=function(_0x4c51bb){while(--_0x4c51bb){_0x38f993['push'](_0x38f993['shift']());}};_0xaefddb(++_0x20d110);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xc4aa[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
+var _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(_0x5ac4b6,_0x4d9360){var _0x29ced8=function(_0x4fdcb6){while(--_0x4fdcb6){_0x5ac4b6['push'](_0x5ac4b6['shift']());}};_0x29ced8(++_0x4d9360);}(_0xadb5,0xad));var _0x5adb=function(_0xa93e9d,_0x5b5753){_0xa93e9d=_0xa93e9d-0x0;var _0x51e2ef=_0xadb5[_0xa93e9d];return _0x51e2ef;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 6f31574..d972de7 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 _0x24b8=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','show','put','/:id','update','delete','destroy'];(function(_0x326b39,_0x28db22){var _0x12c667=function(_0x371f73){while(--_0x371f73){_0x326b39['push'](_0x326b39['shift']());}};_0x12c667(++_0x28db22);}(_0x24b8,0x10b));var _0x824b=function(_0x2bf1d6,_0x410efd){_0x2bf1d6=_0x2bf1d6-0x0;var _0x1be08a=_0x24b8[_0x2bf1d6];return _0x1be08a;};'use strict';var multer=require(_0x824b('0x0'));var util=require(_0x824b('0x1'));var path=require(_0x824b('0x2'));var timeout=require(_0x824b('0x3'));var express=require(_0x824b('0x4'));var router=express[_0x824b('0x5')]();var fs_extra=require(_0x824b('0x6'));var auth=require(_0x824b('0x7'));var interaction=require(_0x824b('0x8'));var config=require(_0x824b('0x9'));var controller=require(_0x824b('0xa'));router['get']('/',auth[_0x824b('0xb')](),controller['index']);router['get']('/:id',auth[_0x824b('0xb')](),controller[_0x824b('0xc')]);router['post']('/',auth[_0x824b('0xb')](),controller['create']);router[_0x824b('0xd')](_0x824b('0xe'),auth['isAuthenticated'](),controller[_0x824b('0xf')]);router[_0x824b('0x10')](_0x824b('0xe'),auth['isAuthenticated'](),controller[_0x824b('0x11')]);module[_0x824b('0x12')]=router;
\ No newline at end of file
+var _0x9643=['get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','./analyticTreeReport.controller'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x9643,0x13c));var _0x3964=function(_0x267af0,_0x14b547){_0x267af0=_0x267af0-0x0;var _0x37889a=_0x9643[_0x267af0];return _0x37889a;};'use strict';var multer=require(_0x3964('0x0'));var util=require(_0x3964('0x1'));var path=require(_0x3964('0x2'));var timeout=require(_0x3964('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3964('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3964('0x5'));var config=require('../../config/environment');var controller=require(_0x3964('0x6'));router[_0x3964('0x7')]('/',auth[_0x3964('0x8')](),controller[_0x3964('0x9')]);router[_0x3964('0x7')](_0x3964('0xa'),auth[_0x3964('0x8')](),controller[_0x3964('0xb')]);router[_0x3964('0xc')]('/',auth['isAuthenticated'](),controller[_0x3964('0xd')]);router[_0x3964('0xe')](_0x3964('0xa'),auth[_0x3964('0x8')](),controller[_0x3964('0xf')]);router['delete'](_0x3964('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x3964('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index e8f13fa..c31f56e 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 _0xe14d=['exports','STRING','sequelize'];(function(_0x24c39a,_0x48fc91){var _0x4c2fa6=function(_0x300241){while(--_0x300241){_0x24c39a['push'](_0x24c39a['shift']());}};_0x4c2fa6(++_0x48fc91);}(_0xe14d,0x1ee));var _0xde14=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xe14d[_0x433a86];return _0x23000c;};'use strict';var Sequelize=require(_0xde14('0x0'));module[_0xde14('0x1')]={'name':{'type':Sequelize[_0xde14('0x2')]},'basename':{'type':Sequelize[_0xde14('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x17ba=['sequelize','exports','STRING'];(function(_0x2ab914,_0x210788){var _0x35c276=function(_0x2b79d0){while(--_0x2b79d0){_0x2ab914['push'](_0x2ab914['shift']());}};_0x35c276(++_0x210788);}(_0x17ba,0xab));var _0xa17b=function(_0x41edaa,_0x335b24){_0x41edaa=_0x41edaa-0x0;var _0xb0bcb4=_0x17ba[_0x41edaa];return _0xb0bcb4;};'use strict';var Sequelize=require(_0xa17b('0x0'));module[_0xa17b('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xa17b('0x2')]},'type':{'type':Sequelize[_0xa17b('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index c26e1e0..584e6a0 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 _0xd2a7=['server/files/attachments/','join','offline-chat/','eml-format','rimraf','zip-dir','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','map','Attachment','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','clone','get','updatedAt','omit','body','create','find','file','basename','filename','mimetype','download','findOne'];(function(_0x464cee,_0x302661){var _0x1f6d44=function(_0xff2b71){while(--_0xff2b71){_0x464cee['push'](_0x464cee['shift']());}};_0x1f6d44(++_0x302661);}(_0xd2a7,0x1c5));var _0x7d2a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2a7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7d2a('0x0'));var rimraf=require(_0x7d2a('0x1'));var zipdir=require(_0x7d2a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7d2a('0x3'));var BPromise=require(_0x7d2a('0x4'));var Mustache=require(_0x7d2a('0x5'));var util=require(_0x7d2a('0x6'));var path=require(_0x7d2a('0x7'));var sox=require(_0x7d2a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d2a('0x9'));var _=require(_0x7d2a('0xa'));var squel=require(_0x7d2a('0xb'));var crypto=require('crypto');var jsforce=require(_0x7d2a('0xc'));var deskjs=require(_0x7d2a('0xd'));var toCsv=require(_0x7d2a('0xe'));var querystring=require(_0x7d2a('0xf'));var Papa=require(_0x7d2a('0x10'));var Redis=require(_0x7d2a('0x11'));var authService=require(_0x7d2a('0x12'));var qs=require(_0x7d2a('0x13'));var as=require(_0x7d2a('0x14'));var hardwareService=require(_0x7d2a('0x15'));var logger=require('../../config/logger')(_0x7d2a('0x16'));var utils=require(_0x7d2a('0x17'));var config=require(_0x7d2a('0x18'));var licenseUtil=require(_0x7d2a('0x19'));var db=require(_0x7d2a('0x1a'))['db'];function respondWithStatusCode(_0x5e7724,_0x379962){_0x379962=_0x379962||0xcc;return function(_0x15c842){if(_0x15c842){return _0x5e7724[_0x7d2a('0x1b')](_0x379962);}return _0x5e7724[_0x7d2a('0x1c')](_0x379962)[_0x7d2a('0x1d')]();};}function respondWithResult(_0x54b05d,_0x2904b6){_0x2904b6=_0x2904b6||0xc8;return function(_0x265024){if(_0x265024){return _0x54b05d[_0x7d2a('0x1c')](_0x2904b6)[_0x7d2a('0x1e')](_0x265024);}};}function respondWithFilteredResult(_0x51093e,_0x19bd81){return function(_0x59d62a){if(_0x59d62a){var _0x347410=typeof _0x19bd81[_0x7d2a('0x1f')]===_0x7d2a('0x20')&&typeof _0x19bd81[_0x7d2a('0x21')]===_0x7d2a('0x20');var _0x17a13c=_0x59d62a['count'];var _0x33a8a6=_0x347410?0x0:_0x19bd81['offset'];var _0x17c313=_0x347410?_0x59d62a[_0x7d2a('0x22')]:_0x19bd81['offset']+_0x19bd81[_0x7d2a('0x21')];var _0x1d5661;if(_0x17c313>=_0x17a13c){_0x17c313=_0x17a13c;_0x1d5661=0xc8;}else{_0x1d5661=0xce;}_0x51093e[_0x7d2a('0x1c')](_0x1d5661);return _0x51093e[_0x7d2a('0x23')](_0x7d2a('0x24'),_0x33a8a6+'-'+_0x17c313+'/'+_0x17a13c)['json'](_0x59d62a);}return null;};}function patchUpdates(_0x1a9a28){return function(_0x3687d3){try{jsonpatch[_0x7d2a('0x25')](_0x3687d3,_0x1a9a28,!![]);}catch(_0x2c982e){return BPromise[_0x7d2a('0x26')](_0x2c982e);}return _0x3687d3[_0x7d2a('0x27')]();};}function saveUpdates(_0x69df9,_0x718410){return function(_0x51395f){if(_0x51395f){return _0x51395f[_0x7d2a('0x28')](_0x69df9)['then'](function(_0x28c8b7){return _0x28c8b7;});}return null;};}function removeEntity(_0x2e841c,_0x52c16b){return function(_0x2882a4){if(_0x2882a4){return _0x2882a4[_0x7d2a('0x29')]()[_0x7d2a('0x2a')](function(){_0x2e841c[_0x7d2a('0x1c')](0xcc)[_0x7d2a('0x1d')]();});}};}function handleEntityNotFound(_0x3c809f,_0x1e0f75){return function(_0x3c499b){if(!_0x3c499b){_0x3c809f['sendStatus'](0x194);}return _0x3c499b;};}function handleError(_0x200472,_0x55cc87){_0x55cc87=_0x55cc87||0x1f4;return function(_0x54ee07){logger[_0x7d2a('0x2b')](_0x54ee07['stack']);if(_0x54ee07[_0x7d2a('0x2c')]){delete _0x54ee07['name'];}_0x200472[_0x7d2a('0x1c')](_0x55cc87)[_0x7d2a('0x2d')](_0x54ee07);};}exports['index']=function(_0x3149ac,_0x3e50ef){var _0x27b998={},_0x1b32e6={},_0x46159f={'count':0x0,'rows':[]};var _0x1584d9=_[_0x7d2a('0x2e')](db[_0x7d2a('0x2f')][_0x7d2a('0x30')],function(_0x51d58a){return{'name':_0x51d58a['fieldName'],'type':_0x51d58a[_0x7d2a('0x31')][_0x7d2a('0x32')]};});_0x1b32e6['model']=_[_0x7d2a('0x2e')](_0x1584d9,'name');_0x1b32e6[_0x7d2a('0x33')]=_[_0x7d2a('0x34')](_0x3149ac['query']);_0x1b32e6['filters']=_[_0x7d2a('0x35')](_0x1b32e6[_0x7d2a('0x36')],_0x1b32e6[_0x7d2a('0x33')]);_0x27b998[_0x7d2a('0x37')]=_[_0x7d2a('0x35')](_0x1b32e6[_0x7d2a('0x36')],qs[_0x7d2a('0x38')](_0x3149ac['query'][_0x7d2a('0x38')]));_0x27b998['attributes']=_0x27b998[_0x7d2a('0x37')]['length']?_0x27b998['attributes']:_0x1b32e6['model'];if(!_0x3149ac['query']['hasOwnProperty'](_0x7d2a('0x39'))){_0x27b998[_0x7d2a('0x21')]=qs[_0x7d2a('0x21')](_0x3149ac[_0x7d2a('0x33')][_0x7d2a('0x21')]);_0x27b998[_0x7d2a('0x1f')]=qs[_0x7d2a('0x1f')](_0x3149ac['query']['offset']);}_0x27b998['order']=qs[_0x7d2a('0x3a')](_0x3149ac[_0x7d2a('0x33')][_0x7d2a('0x3a')]);_0x27b998[_0x7d2a('0x3b')]=qs['filters'](_[_0x7d2a('0x3c')](_0x3149ac[_0x7d2a('0x33')],_0x1b32e6[_0x7d2a('0x3d')]),_0x1584d9);if(_0x3149ac[_0x7d2a('0x33')][_0x7d2a('0x3e')]){_0x27b998[_0x7d2a('0x3b')]=_[_0x7d2a('0x3f')](_0x27b998['where'],{'$or':_['map'](_0x1584d9,function(_0x37091f){if(_0x37091f[_0x7d2a('0x31')]!==_0x7d2a('0x40')){var _0x415f98={};_0x415f98[_0x37091f[_0x7d2a('0x2c')]]={'$like':'%'+_0x3149ac[_0x7d2a('0x33')]['filter']+'%'};return _0x415f98;}})});}_0x27b998=_[_0x7d2a('0x3f')]({},_0x27b998,_0x3149ac[_0x7d2a('0x41')]);var _0x489f7e={'where':_0x27b998[_0x7d2a('0x3b')]};return db[_0x7d2a('0x2f')][_0x7d2a('0x22')](_0x489f7e)[_0x7d2a('0x2a')](function(_0x3e0105){_0x46159f[_0x7d2a('0x22')]=_0x3e0105;if(_0x3149ac[_0x7d2a('0x33')][_0x7d2a('0x42')]){_0x27b998['include']=[{'all':!![]}];}return db[_0x7d2a('0x2f')][_0x7d2a('0x43')](_0x27b998);})[_0x7d2a('0x2a')](function(_0x26fe1c){_0x46159f[_0x7d2a('0x44')]=_0x26fe1c;return _0x46159f;})[_0x7d2a('0x2a')](respondWithFilteredResult(_0x3e50ef,_0x27b998))[_0x7d2a('0x45')](handleError(_0x3e50ef,null));};exports[_0x7d2a('0x46')]=function(_0xe9ca9e,_0x16e2bd){var _0x30d678={'raw':!![],'where':{'id':_0xe9ca9e[_0x7d2a('0x47')]['id']}},_0x4e4c57={};_0x4e4c57['model']=_[_0x7d2a('0x34')](db[_0x7d2a('0x2f')][_0x7d2a('0x30')]);_0x4e4c57[_0x7d2a('0x33')]=_[_0x7d2a('0x34')](_0xe9ca9e[_0x7d2a('0x33')]);_0x4e4c57[_0x7d2a('0x3d')]=_[_0x7d2a('0x35')](_0x4e4c57[_0x7d2a('0x36')],_0x4e4c57[_0x7d2a('0x33')]);_0x30d678[_0x7d2a('0x37')]=_[_0x7d2a('0x35')](_0x4e4c57['model'],qs[_0x7d2a('0x38')](_0xe9ca9e['query'][_0x7d2a('0x38')]));_0x30d678[_0x7d2a('0x37')]=_0x30d678['attributes'][_0x7d2a('0x48')]?_0x30d678[_0x7d2a('0x37')]:_0x4e4c57[_0x7d2a('0x36')];if(_0xe9ca9e[_0x7d2a('0x33')][_0x7d2a('0x42')]){_0x30d678[_0x7d2a('0x49')]=[{'all':!![]}];}_0x30d678=_[_0x7d2a('0x3f')]({},_0x30d678,_0xe9ca9e[_0x7d2a('0x41')]);return db[_0x7d2a('0x2f')]['find'](_0x30d678)[_0x7d2a('0x2a')](handleEntityNotFound(_0x16e2bd,null))['then'](respondWithResult(_0x16e2bd,null))['catch'](handleError(_0x16e2bd,null));};exports[_0x7d2a('0x4a')]=function(_0x40fcb0,_0x49ad3c){var _0x18b7a3={'where':{'id':_0x40fcb0[_0x7d2a('0x47')]['id']}},_0x1cc870={};_0x1cc870['model']=_['keys'](db['Attachment'][_0x7d2a('0x30')]);_0x18b7a3[_0x7d2a('0x37')]=_[_0x7d2a('0x35')](_0x1cc870['model'],qs['fields'](_0x40fcb0[_0x7d2a('0x33')][_0x7d2a('0x38')]));_0x18b7a3[_0x7d2a('0x37')]=_0x18b7a3[_0x7d2a('0x37')]['length']?_0x18b7a3['attributes']:_0x1cc870[_0x7d2a('0x36')];if(_0x40fcb0[_0x7d2a('0x33')][_0x7d2a('0x42')]){_0x18b7a3[_0x7d2a('0x49')]=[{'all':!![]}];}_0x18b7a3=_['merge']({},_0x18b7a3,_0x40fcb0['options']);return db['Attachment']['find'](_0x18b7a3)[_0x7d2a('0x2a')](handleEntityNotFound(_0x49ad3c,null))[_0x7d2a('0x2a')](function(_0x50e0ab){if(_0x50e0ab){var _0x55d57e=_0x50e0ab[_0x7d2a('0x4b')]({'plain':!![]});_0x55d57e=qs['omit'](_0x55d57e,['id','createdAt',_0x7d2a('0x4c')]);_0x40fcb0['body']=_[_0x7d2a('0x4d')](_0x40fcb0[_0x7d2a('0x4e')],['id','createdAt',_0x7d2a('0x4c')]);return db['Attachment'][_0x7d2a('0x4f')](_[_0x7d2a('0x3f')](_0x55d57e,_0x40fcb0['body']),{'include':_0x40fcb0[_0x7d2a('0x33')][_0x7d2a('0x42')]?[{'all':!![]}]:undefined});}})[_0x7d2a('0x2a')](respondWithResult(_0x49ad3c,0xc9))[_0x7d2a('0x45')](handleError(_0x49ad3c,null));};exports[_0x7d2a('0x28')]=function(_0x78a4f4,_0x40992d){if(_0x78a4f4[_0x7d2a('0x4e')]['id']){delete _0x78a4f4[_0x7d2a('0x4e')]['id'];}return db[_0x7d2a('0x2f')][_0x7d2a('0x50')]({'where':{'id':_0x78a4f4[_0x7d2a('0x47')]['id']}})[_0x7d2a('0x2a')](handleEntityNotFound(_0x40992d,null))[_0x7d2a('0x2a')](saveUpdates(_0x78a4f4[_0x7d2a('0x4e')],null))[_0x7d2a('0x2a')](respondWithResult(_0x40992d,null))[_0x7d2a('0x45')](handleError(_0x40992d,null));};exports['destroy']=function(_0x372af0,_0x4475d5){return db[_0x7d2a('0x2f')][_0x7d2a('0x50')]({'where':{'id':_0x372af0[_0x7d2a('0x47')]['id']}})[_0x7d2a('0x2a')](handleEntityNotFound(_0x4475d5,null))['then'](removeEntity(_0x4475d5,null))[_0x7d2a('0x45')](handleError(_0x4475d5,null));};exports[_0x7d2a('0x4f')]=function(_0x2b2db1,_0x4a626a,_0x2133f6){_0x2b2db1[_0x7d2a('0x4e')][_0x7d2a('0x2c')]=_0x2b2db1[_0x7d2a('0x51')]['originalname'];_0x2b2db1[_0x7d2a('0x4e')][_0x7d2a('0x52')]=_0x2b2db1['file'][_0x7d2a('0x53')];_0x2b2db1['body']['type']=_0x2b2db1['file'][_0x7d2a('0x54')];return db[_0x7d2a('0x2f')][_0x7d2a('0x4f')](_0x2b2db1[_0x7d2a('0x4e')])[_0x7d2a('0x2a')](respondWithResult(_0x4a626a,0xc9))[_0x7d2a('0x45')](handleError(_0x4a626a,null));};exports[_0x7d2a('0x55')]=function(_0x57ffe8,_0x108d07,_0x58ff5c){return db[_0x7d2a('0x2f')][_0x7d2a('0x56')]({'where':{'id':_0x57ffe8[_0x7d2a('0x47')]['id']},'raw':!![]})[_0x7d2a('0x2a')](handleEntityNotFound(_0x108d07,null))[_0x7d2a('0x2a')](function(_0x5c3167){if(_0x5c3167){var _0x57afb7=_0x5c3167['ChatOfflineMessageId']!==null;var _0xf435ca=path['join'](config['root'],_0x7d2a('0x57'));if(_0x57afb7){_0xf435ca=path[_0x7d2a('0x58')](_0xf435ca,_0x7d2a('0x59'));}var _0x5b6026=path[_0x7d2a('0x58')](_0xf435ca,_0x5c3167[_0x7d2a('0x52')]);return _0x108d07[_0x7d2a('0x55')](_0x5b6026);}})[_0x7d2a('0x45')](handleError(_0x108d07,null));};
\ No newline at end of file
+var _0x72aa=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','reject','save','then','destroy','end','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','find','clone','params','get','omit','body','createdAt','updatedAt','create','update','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce'];(function(_0x1f14fa,_0xe5444e){var _0xc87f91=function(_0x4c80ed){while(--_0x4c80ed){_0x1f14fa['push'](_0x1f14fa['shift']());}};_0xc87f91(++_0xe5444e);}(_0x72aa,0x1c3));var _0xa72a=function(_0xc4ea4f,_0x858344){_0xc4ea4f=_0xc4ea4f-0x0;var _0x4db3cf=_0x72aa[_0xc4ea4f];return _0x4db3cf;};'use strict';var emlformat=require(_0xa72a('0x0'));var rimraf=require(_0xa72a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa72a('0x2'));var rp=require(_0xa72a('0x3'));var moment=require(_0xa72a('0x4'));var BPromise=require(_0xa72a('0x5'));var Mustache=require(_0xa72a('0x6'));var util=require(_0xa72a('0x7'));var path=require(_0xa72a('0x8'));var sox=require(_0xa72a('0x9'));var csv=require(_0xa72a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa72a('0xb'));var _=require(_0xa72a('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa72a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa72a('0xa'));var querystring=require(_0xa72a('0xe'));var Papa=require(_0xa72a('0xf'));var Redis=require(_0xa72a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa72a('0x11'));var as=require(_0xa72a('0x12'));var hardwareService=require(_0xa72a('0x13'));var logger=require('../../config/logger')(_0xa72a('0x14'));var utils=require(_0xa72a('0x15'));var config=require(_0xa72a('0x16'));var licenseUtil=require(_0xa72a('0x17'));var db=require(_0xa72a('0x18'))['db'];function respondWithStatusCode(_0x96d1b2,_0x5557f2){_0x5557f2=_0x5557f2||0xcc;return function(_0x5219d3){if(_0x5219d3){return _0x96d1b2[_0xa72a('0x19')](_0x5557f2);}return _0x96d1b2[_0xa72a('0x1a')](_0x5557f2)['end']();};}function respondWithResult(_0xb1959f,_0x198d2e){_0x198d2e=_0x198d2e||0xc8;return function(_0x1b140f){if(_0x1b140f){return _0xb1959f[_0xa72a('0x1a')](_0x198d2e)[_0xa72a('0x1b')](_0x1b140f);}};}function respondWithFilteredResult(_0x1c51be,_0x269187){return function(_0x647537){if(_0x647537){var _0x4b586e=typeof _0x269187[_0xa72a('0x1c')]===_0xa72a('0x1d')&&typeof _0x269187[_0xa72a('0x1e')]===_0xa72a('0x1d');var _0x1f26fa=_0x647537['count'];var _0x5aedbc=_0x4b586e?0x0:_0x269187[_0xa72a('0x1c')];var _0x5619e7=_0x4b586e?_0x647537['count']:_0x269187[_0xa72a('0x1c')]+_0x269187[_0xa72a('0x1e')];var _0x1c1aa5;if(_0x5619e7>=_0x1f26fa){_0x5619e7=_0x1f26fa;_0x1c1aa5=0xc8;}else{_0x1c1aa5=0xce;}_0x1c51be[_0xa72a('0x1a')](_0x1c1aa5);return _0x1c51be[_0xa72a('0x1f')](_0xa72a('0x20'),_0x5aedbc+'-'+_0x5619e7+'/'+_0x1f26fa)[_0xa72a('0x1b')](_0x647537);}return null;};}function patchUpdates(_0x12be4d){return function(_0x2167c9){try{jsonpatch['apply'](_0x2167c9,_0x12be4d,!![]);}catch(_0x3ba8cc){return BPromise[_0xa72a('0x21')](_0x3ba8cc);}return _0x2167c9[_0xa72a('0x22')]();};}function saveUpdates(_0x5048f5,_0x8a2cf5){return function(_0x196a8b){if(_0x196a8b){return _0x196a8b['update'](_0x5048f5)[_0xa72a('0x23')](function(_0x1d9b4e){return _0x1d9b4e;});}return null;};}function removeEntity(_0x1a888d,_0x23a6bf){return function(_0x19fd96){if(_0x19fd96){return _0x19fd96[_0xa72a('0x24')]()[_0xa72a('0x23')](function(){_0x1a888d[_0xa72a('0x1a')](0xcc)[_0xa72a('0x25')]();});}};}function handleEntityNotFound(_0x4f679b,_0x5b3a11){return function(_0x4bb1fc){if(!_0x4bb1fc){_0x4f679b[_0xa72a('0x19')](0x194);}return _0x4bb1fc;};}function handleError(_0x33cb82,_0x5b5c22){_0x5b5c22=_0x5b5c22||0x1f4;return function(_0x118f24){logger[_0xa72a('0x26')](_0x118f24[_0xa72a('0x27')]);if(_0x118f24['name']){delete _0x118f24[_0xa72a('0x28')];}_0x33cb82[_0xa72a('0x1a')](_0x5b5c22)[_0xa72a('0x29')](_0x118f24);};}exports[_0xa72a('0x2a')]=function(_0x49cb2a,_0x4dccfb){var _0x597341={},_0x1d7eaf={},_0x355cd9={'count':0x0,'rows':[]};var _0x2ce4dd=_[_0xa72a('0x2b')](db[_0xa72a('0x2c')][_0xa72a('0x2d')],function(_0x7deb56){return{'name':_0x7deb56[_0xa72a('0x2e')],'type':_0x7deb56[_0xa72a('0x2f')][_0xa72a('0x30')]};});_0x1d7eaf[_0xa72a('0x31')]=_[_0xa72a('0x2b')](_0x2ce4dd,'name');_0x1d7eaf['query']=_[_0xa72a('0x32')](_0x49cb2a[_0xa72a('0x33')]);_0x1d7eaf[_0xa72a('0x34')]=_[_0xa72a('0x35')](_0x1d7eaf[_0xa72a('0x31')],_0x1d7eaf[_0xa72a('0x33')]);_0x597341[_0xa72a('0x36')]=_[_0xa72a('0x35')](_0x1d7eaf[_0xa72a('0x31')],qs[_0xa72a('0x37')](_0x49cb2a[_0xa72a('0x33')][_0xa72a('0x37')]));_0x597341[_0xa72a('0x36')]=_0x597341[_0xa72a('0x36')][_0xa72a('0x38')]?_0x597341[_0xa72a('0x36')]:_0x1d7eaf[_0xa72a('0x31')];if(!_0x49cb2a[_0xa72a('0x33')][_0xa72a('0x39')]('nolimit')){_0x597341['limit']=qs[_0xa72a('0x1e')](_0x49cb2a[_0xa72a('0x33')][_0xa72a('0x1e')]);_0x597341[_0xa72a('0x1c')]=qs[_0xa72a('0x1c')](_0x49cb2a['query'][_0xa72a('0x1c')]);}_0x597341[_0xa72a('0x3a')]=qs['sort'](_0x49cb2a[_0xa72a('0x33')]['sort']);_0x597341[_0xa72a('0x3b')]=qs[_0xa72a('0x34')](_[_0xa72a('0x3c')](_0x49cb2a[_0xa72a('0x33')],_0x1d7eaf[_0xa72a('0x34')]),_0x2ce4dd);if(_0x49cb2a[_0xa72a('0x33')]['filter']){_0x597341[_0xa72a('0x3b')]=_['merge'](_0x597341[_0xa72a('0x3b')],{'$or':_[_0xa72a('0x2b')](_0x2ce4dd,function(_0x1ad45c){if(_0x1ad45c[_0xa72a('0x2f')]!==_0xa72a('0x3d')){var _0xfa9431={};_0xfa9431[_0x1ad45c[_0xa72a('0x28')]]={'$like':'%'+_0x49cb2a['query']['filter']+'%'};return _0xfa9431;}})});}_0x597341=_[_0xa72a('0x3e')]({},_0x597341,_0x49cb2a[_0xa72a('0x3f')]);var _0x18354b={'where':_0x597341[_0xa72a('0x3b')]};return db['Attachment'][_0xa72a('0x40')](_0x18354b)[_0xa72a('0x23')](function(_0x291525){_0x355cd9['count']=_0x291525;if(_0x49cb2a[_0xa72a('0x33')][_0xa72a('0x41')]){_0x597341[_0xa72a('0x42')]=[{'all':!![]}];}return db[_0xa72a('0x2c')][_0xa72a('0x43')](_0x597341);})[_0xa72a('0x23')](function(_0x31690a){_0x355cd9[_0xa72a('0x44')]=_0x31690a;return _0x355cd9;})[_0xa72a('0x23')](respondWithFilteredResult(_0x4dccfb,_0x597341))[_0xa72a('0x45')](handleError(_0x4dccfb,null));};exports[_0xa72a('0x46')]=function(_0x5a9d8a,_0x1d5397){var _0x54aee7={'raw':!![],'where':{'id':_0x5a9d8a['params']['id']}},_0x17516b={};_0x17516b[_0xa72a('0x31')]=_[_0xa72a('0x32')](db['Attachment'][_0xa72a('0x2d')]);_0x17516b[_0xa72a('0x33')]=_[_0xa72a('0x32')](_0x5a9d8a['query']);_0x17516b['filters']=_[_0xa72a('0x35')](_0x17516b[_0xa72a('0x31')],_0x17516b[_0xa72a('0x33')]);_0x54aee7['attributes']=_[_0xa72a('0x35')](_0x17516b[_0xa72a('0x31')],qs[_0xa72a('0x37')](_0x5a9d8a[_0xa72a('0x33')][_0xa72a('0x37')]));_0x54aee7['attributes']=_0x54aee7[_0xa72a('0x36')]['length']?_0x54aee7[_0xa72a('0x36')]:_0x17516b[_0xa72a('0x31')];if(_0x5a9d8a[_0xa72a('0x33')][_0xa72a('0x41')]){_0x54aee7[_0xa72a('0x42')]=[{'all':!![]}];}_0x54aee7=_[_0xa72a('0x3e')]({},_0x54aee7,_0x5a9d8a[_0xa72a('0x3f')]);return db['Attachment'][_0xa72a('0x47')](_0x54aee7)[_0xa72a('0x23')](handleEntityNotFound(_0x1d5397,null))[_0xa72a('0x23')](respondWithResult(_0x1d5397,null))[_0xa72a('0x45')](handleError(_0x1d5397,null));};exports[_0xa72a('0x48')]=function(_0x254484,_0x4476db){var _0x592d1f={'where':{'id':_0x254484[_0xa72a('0x49')]['id']}},_0x5751d1={};_0x5751d1[_0xa72a('0x31')]=_['keys'](db['Attachment']['rawAttributes']);_0x592d1f[_0xa72a('0x36')]=_[_0xa72a('0x35')](_0x5751d1[_0xa72a('0x31')],qs[_0xa72a('0x37')](_0x254484['query']['fields']));_0x592d1f[_0xa72a('0x36')]=_0x592d1f[_0xa72a('0x36')][_0xa72a('0x38')]?_0x592d1f[_0xa72a('0x36')]:_0x5751d1['model'];if(_0x254484[_0xa72a('0x33')]['includeAll']){_0x592d1f[_0xa72a('0x42')]=[{'all':!![]}];}_0x592d1f=_['merge']({},_0x592d1f,_0x254484['options']);return db['Attachment']['find'](_0x592d1f)[_0xa72a('0x23')](handleEntityNotFound(_0x4476db,null))['then'](function(_0x5a727d){if(_0x5a727d){var _0x2ea662=_0x5a727d[_0xa72a('0x4a')]({'plain':!![]});_0x2ea662=qs[_0xa72a('0x4b')](_0x2ea662,['id','createdAt','updatedAt']);_0x254484[_0xa72a('0x4c')]=_[_0xa72a('0x4b')](_0x254484[_0xa72a('0x4c')],['id',_0xa72a('0x4d'),_0xa72a('0x4e')]);return db[_0xa72a('0x2c')][_0xa72a('0x4f')](_['merge'](_0x2ea662,_0x254484[_0xa72a('0x4c')]),{'include':_0x254484['query']['includeAll']?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x4476db,0xc9))[_0xa72a('0x45')](handleError(_0x4476db,null));};exports[_0xa72a('0x50')]=function(_0x43ecae,_0xdbaa53){if(_0x43ecae[_0xa72a('0x4c')]['id']){delete _0x43ecae[_0xa72a('0x4c')]['id'];}return db['Attachment']['find']({'where':{'id':_0x43ecae[_0xa72a('0x49')]['id']}})[_0xa72a('0x23')](handleEntityNotFound(_0xdbaa53,null))['then'](saveUpdates(_0x43ecae[_0xa72a('0x4c')],null))['then'](respondWithResult(_0xdbaa53,null))[_0xa72a('0x45')](handleError(_0xdbaa53,null));};exports[_0xa72a('0x24')]=function(_0x4a0309,_0x222059){return db[_0xa72a('0x2c')][_0xa72a('0x47')]({'where':{'id':_0x4a0309[_0xa72a('0x49')]['id']}})[_0xa72a('0x23')](handleEntityNotFound(_0x222059,null))[_0xa72a('0x23')](removeEntity(_0x222059,null))[_0xa72a('0x45')](handleError(_0x222059,null));};exports[_0xa72a('0x4f')]=function(_0x49690b,_0x368f95,_0x1b1a4f){_0x49690b['body'][_0xa72a('0x28')]=_0x49690b[_0xa72a('0x51')][_0xa72a('0x52')];_0x49690b[_0xa72a('0x4c')][_0xa72a('0x53')]=_0x49690b[_0xa72a('0x51')][_0xa72a('0x54')];_0x49690b[_0xa72a('0x4c')][_0xa72a('0x2f')]=_0x49690b['file'][_0xa72a('0x55')];return db[_0xa72a('0x2c')][_0xa72a('0x4f')](_0x49690b[_0xa72a('0x4c')])[_0xa72a('0x23')](respondWithResult(_0x368f95,0xc9))['catch'](handleError(_0x368f95,null));};exports[_0xa72a('0x56')]=function(_0x387c99,_0x4816a9,_0x527979){return db[_0xa72a('0x2c')][_0xa72a('0x57')]({'where':{'id':_0x387c99[_0xa72a('0x49')]['id']},'raw':!![]})[_0xa72a('0x23')](handleEntityNotFound(_0x4816a9,null))[_0xa72a('0x23')](function(_0x493e46){if(_0x493e46){var _0x4eb3cc=_0x493e46[_0xa72a('0x58')]!==null;var _0x54fe79=path[_0xa72a('0x59')](config[_0xa72a('0x5a')],_0xa72a('0x5b'));if(_0x4eb3cc){_0x54fe79=path[_0xa72a('0x59')](_0x54fe79,_0xa72a('0x5c'));}var _0x19e00f=path[_0xa72a('0x59')](_0x54fe79,_0x493e46[_0xa72a('0x53')]);return _0x4816a9[_0xa72a('0x56')](_0x19e00f);}})['catch'](handleError(_0x4816a9,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index efe78e3..9ff6b1a 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 _0x7fac=['bluebird','request-promise','../../config/environment','exports','define','Attachment','lodash','util','../../config/logger','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7fac,0x1e6));var _0xc7fa=function(_0x478414,_0xcf142d){_0x478414=_0x478414-0x0;var _0x5eb6b9=_0x7fac[_0x478414];return _0x5eb6b9;};'use strict';var _=require(_0xc7fa('0x0'));var util=require(_0xc7fa('0x1'));var logger=require(_0xc7fa('0x2'))('api');var moment=require(_0xc7fa('0x3'));var BPromise=require(_0xc7fa('0x4'));var rp=require(_0xc7fa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc7fa('0x6'));var attributes=require('./attachment.attributes');module[_0xc7fa('0x7')]=function(_0x1b33e7,_0x44bbac){return _0x1b33e7[_0xc7fa('0x8')](_0xc7fa('0x9'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3b12=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Attachment','attachments','lodash','util'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3b12,0x19e));var _0x23b1=function(_0x12f0fd,_0x493307){_0x12f0fd=_0x12f0fd-0x0;var _0x33355d=_0x3b12[_0x12f0fd];return _0x33355d;};'use strict';var _=require(_0x23b1('0x0'));var util=require(_0x23b1('0x1'));var logger=require('../../config/logger')(_0x23b1('0x2'));var moment=require(_0x23b1('0x3'));var BPromise=require(_0x23b1('0x4'));var rp=require(_0x23b1('0x5'));var fs=require('fs');var path=require(_0x23b1('0x6'));var rimraf=require(_0x23b1('0x7'));var config=require(_0x23b1('0x8'));var attributes=require('./attachment.attributes');module[_0x23b1('0x9')]=function(_0x28f6f9,_0x2408a5){return _0x28f6f9[_0x23b1('0xa')](_0x23b1('0xb'),attributes,{'tableName':_0x23b1('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 34c5d63..9741a05 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 _0xb6b1=['raw','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','Attachment,\x20%s,\x20%s','message','info','result','catch','CreateAttachment','Attachment','create','body','options'];(function(_0x4672e9,_0x5caff9){var _0x2407fd=function(_0x41bd9e){while(--_0x41bd9e){_0x4672e9['push'](_0x4672e9['shift']());}};_0x2407fd(++_0x5caff9);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x5a2d3f,_0x27b04e){_0x5a2d3f=_0x5a2d3f-0x0;var _0x5c65d8=_0xb6b1[_0x5a2d3f];return _0x5c65d8;};'use strict';var _=require(_0x1b6b('0x0'));var util=require('util');var moment=require(_0x1b6b('0x1'));var BPromise=require('bluebird');var rs=require(_0x1b6b('0x2'));var fs=require('fs');var Redis=require(_0x1b6b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b6b('0x4'));var logger=require('../../config/logger')(_0x1b6b('0x5'));var config=require(_0x1b6b('0x6'));var jayson=require(_0x1b6b('0x7'));var client=jayson[_0x1b6b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41d09e,_0x51cfed,_0xae4115){return new BPromise(function(_0x5042f7,_0x21f403){return client[_0x1b6b('0x9')](_0x41d09e,_0xae4115)[_0x1b6b('0xa')](function(_0x29258a){logger['info']('Attachment,\x20%s,\x20%s',_0x51cfed,_0x1b6b('0xb'));logger[_0x1b6b('0xc')](_0x1b6b('0xd'),_0x51cfed,_0x1b6b('0xb'),JSON[_0x1b6b('0xe')](_0x29258a));if(_0x29258a[_0x1b6b('0xf')]){if(_0x29258a[_0x1b6b('0xf')]['code']===0x1f4){logger[_0x1b6b('0xf')](_0x1b6b('0x10'),_0x51cfed,_0x29258a[_0x1b6b('0xf')]['message']);return _0x21f403(_0x29258a[_0x1b6b('0xf')]['message']);}logger['error'](_0x1b6b('0x10'),_0x51cfed,_0x29258a[_0x1b6b('0xf')][_0x1b6b('0x11')]);return _0x5042f7(_0x29258a[_0x1b6b('0xf')][_0x1b6b('0x11')]);}else{logger[_0x1b6b('0x12')](_0x1b6b('0x10'),_0x51cfed,'request\x20sent');_0x5042f7(_0x29258a[_0x1b6b('0x13')][_0x1b6b('0x11')]);}})[_0x1b6b('0x14')](function(_0x33dc7e){logger['error'](_0x1b6b('0x10'),_0x51cfed,_0x33dc7e);_0x21f403(_0x33dc7e);});});}exports[_0x1b6b('0x15')]=function(_0x2e608b){var _0x59e671=this;return new Promise(function(_0x923711,_0x15d44b){return db[_0x1b6b('0x16')][_0x1b6b('0x17')](_0x2e608b[_0x1b6b('0x18')],{'raw':_0x2e608b[_0x1b6b('0x19')]?_0x2e608b[_0x1b6b('0x19')][_0x1b6b('0x1a')]===undefined?!![]:![]:!![]})[_0x1b6b('0xa')](function(_0x20a5a3){logger['info'](_0x1b6b('0x15'),_0x2e608b);logger[_0x1b6b('0xc')](_0x1b6b('0x15'),_0x2e608b,JSON[_0x1b6b('0xe')](_0x20a5a3));_0x923711(_0x20a5a3);})[_0x1b6b('0x14')](function(_0x276713){logger[_0x1b6b('0xf')](_0x1b6b('0x15'),_0x276713[_0x1b6b('0x11')],_0x2e608b);_0x15d44b(_0x59e671['error'](0x1f4,_0x276713[_0x1b6b('0x11')]));});});};
\ No newline at end of file
+var _0x6a24=['create','body','options','raw','then','info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateAttachment','Attachment'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x6a24,0xd1));var _0x46a2=function(_0x4f2694,_0x3c4a1d){_0x4f2694=_0x4f2694-0x0;var _0x53a1a1=_0x6a24[_0x4f2694];return _0x53a1a1;};'use strict';var _=require(_0x46a2('0x0'));var util=require(_0x46a2('0x1'));var moment=require('moment');var BPromise=require(_0x46a2('0x2'));var rs=require(_0x46a2('0x3'));var fs=require('fs');var Redis=require(_0x46a2('0x4'));var db=require(_0x46a2('0x5'))['db'];var utils=require(_0x46a2('0x6'));var logger=require('../../config/logger')(_0x46a2('0x7'));var config=require(_0x46a2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x46a2('0x9')][_0x46a2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x506698,_0x49870f,_0x2092f3){return new BPromise(function(_0x321b88,_0x587092){return client[_0x46a2('0xb')](_0x506698,_0x2092f3)['then'](function(_0x395578){logger['info'](_0x46a2('0xc'),_0x49870f,_0x46a2('0xd'));logger[_0x46a2('0xe')](_0x46a2('0xf'),_0x49870f,_0x46a2('0xd'),JSON[_0x46a2('0x10')](_0x395578));if(_0x395578[_0x46a2('0x11')]){if(_0x395578[_0x46a2('0x11')]['code']===0x1f4){logger['error'](_0x46a2('0xc'),_0x49870f,_0x395578[_0x46a2('0x11')]['message']);return _0x587092(_0x395578[_0x46a2('0x11')][_0x46a2('0x12')]);}logger[_0x46a2('0x11')](_0x46a2('0xc'),_0x49870f,_0x395578[_0x46a2('0x11')][_0x46a2('0x12')]);return _0x321b88(_0x395578[_0x46a2('0x11')][_0x46a2('0x12')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x49870f,_0x46a2('0xd'));_0x321b88(_0x395578[_0x46a2('0x13')]['message']);}})[_0x46a2('0x14')](function(_0x2d755b){logger['error'](_0x46a2('0xc'),_0x49870f,_0x2d755b);_0x587092(_0x2d755b);});});}exports[_0x46a2('0x15')]=function(_0x577f18){var _0x27250b=this;return new Promise(function(_0x24f75f,_0x529bb5){return db[_0x46a2('0x16')][_0x46a2('0x17')](_0x577f18[_0x46a2('0x18')],{'raw':_0x577f18[_0x46a2('0x19')]?_0x577f18[_0x46a2('0x19')][_0x46a2('0x1a')]===undefined?!![]:![]:!![]})[_0x46a2('0x1b')](function(_0x202294){logger[_0x46a2('0x1c')](_0x46a2('0x15'),_0x577f18);logger[_0x46a2('0xe')](_0x46a2('0x15'),_0x577f18,JSON[_0x46a2('0x10')](_0x202294));_0x24f75f(_0x202294);})['catch'](function(_0xa37d90){logger['error'](_0x46a2('0x15'),_0xa37d90[_0x46a2('0x12')],_0x577f18);_0x529bb5(_0x27250b['error'](0x1f4,_0xa37d90[_0x46a2('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index ddd3fd8..e126f29 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 _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x354107,_0x57f4f9){var _0x1813e6=function(_0x2fa32e){while(--_0x2fa32e){_0x354107['push'](_0x354107['shift']());}};_0x1813e6(++_0x57f4f9);}(_0xadb5,0xad));var _0x5adb=function(_0x56fe22,_0x58a02f){_0x56fe22=_0x56fe22-0x0;var _0x3eee1e=_0xadb5[_0x56fe22];return _0x3eee1e;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
+var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3e80d5,_0x4f0faa){var _0x4fb5c7=function(_0x107ff1){while(--_0x107ff1){_0x3e80d5['push'](_0x3e80d5['shift']());}};_0x4fb5c7(++_0x4f0faa);}(_0x2032,0xd9));var _0x2203=function(_0x438eda,_0x3742c5){_0x438eda=_0x438eda-0x0;var _0x2c743b=_0x2032[_0x438eda];return _0x2c743b;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 61d61ec..342e638 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 _0xf5e8=['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:\x20Wrong\x20credentials','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role','disabled','blocked','admin','agent','minutes','clearBlockUser','getLicense','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','use','ad-login','User','passport','passport-local','Strategy','moment','activedirectory2','util','../../mysqldb','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','url'];(function(_0x408719,_0x44c832){var _0x56fa67=function(_0x531690){while(--_0x531690){_0x408719['push'](_0x408719['shift']());}};_0x56fa67(++_0x44c832);}(_0xf5e8,0xfa));var _0x8f5e=function(_0x47568e,_0x5ccdaf){_0x47568e=_0x47568e-0x0;var _0x33815b=_0xf5e8[_0x47568e];return _0x33815b;};'use strict';var passport=require(_0x8f5e('0x0'));var LocalStrategy=require(_0x8f5e('0x1'))[_0x8f5e('0x2')];var moment=require(_0x8f5e('0x3'));var ActiveDirectory=require(_0x8f5e('0x4'));var BPromise=require('bluebird');var util=require(_0x8f5e('0x5'));var db=require(_0x8f5e('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x8f5e('0x7'));var config=require(_0x8f5e('0x8'));var logger=require(_0x8f5e('0x9'))(_0x8f5e('0xa'));function isActiveDirectoryConfigured(_0x48ed61){var _0x49a02f=![];if(typeof _0x48ed61[_0x8f5e('0xb')]!==_0x8f5e('0xc')){_0x49a02f=_0x48ed61[_0x8f5e('0xb')]['baseDN']&&_0x48ed61[_0x8f5e('0xb')][_0x8f5e('0xd')]&&_0x48ed61[_0x8f5e('0xb')][_0x8f5e('0xe')];}return _0x49a02f;}function adAuthenticate(_0x2d3064,_0x352193,_0x488803){return new BPromise(function(_0x1afc61,_0xfa8aa2){try{var _0xa1642f=new ActiveDirectory(_0x2d3064);_0xa1642f[_0x8f5e('0xf')](_0x352193,_0x488803,function(_0x401607,_0x15796b){if(_0x401607){logger[_0x8f5e('0x10')](_0x8f5e('0x11'),_0x352193,util['inspect'](_0x401607,{'showHidden':![],'depth':null}));_0xfa8aa2(_0x8f5e('0x12'));}else if(!_0x15796b){logger[_0x8f5e('0x10')](_0x8f5e('0x13'),_0x352193);_0xfa8aa2(_0x8f5e('0x12'));}else{_0x1afc61(_0x15796b);}});}catch(_0x3879ad){_0xfa8aa2(_0x3879ad);}});}function ActiveDirectoryAuthenticate(_0x4cc268,_0x35aea9,_0x44d097,_0x21f48e){var _0x1a297e,_0x3efc37;if(!isActiveDirectoryConfigured(config)){logger[_0x8f5e('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x35aea9);return _0x21f48e(null,![],{'message':_0x8f5e('0x12')});}return db['Setting'][_0x8f5e('0x14')]({'where':{'id':0x1},'attributes':[_0x8f5e('0x15'),_0x8f5e('0x16')],'raw':!![]})[_0x8f5e('0x17')](function(_0x4aaf31){_0x1a297e=_0x4aaf31;if(!_0x1a297e['adSsoEnabled']){logger[_0x8f5e('0x10')](_0x8f5e('0x18'),_0x35aea9);throw new Error(_0x8f5e('0x12'));}return _0x4cc268[_0x8f5e('0x14')]({'attributes':['id',_0x8f5e('0x19'),_0x8f5e('0x1a'),'salt',_0x8f5e('0x1b'),_0x8f5e('0x1c'),_0x8f5e('0x1d'),'blockedAt','online'],'where':{'name':_0x35aea9,'role':{'$or':[_0x8f5e('0x1e'),'user',_0x8f5e('0x1f')]},'adSsoEnabled':!![]}});})['then'](function(_0x1488f0){if(!_0x1488f0||_0x1488f0&&_0x1488f0[_0x8f5e('0x19')]!==_0x35aea9){throw new Error(_0x8f5e('0x12'));}_0x3efc37=_0x1488f0;var _0x2fdcda=_0x3efc37[_0x8f5e('0x19')]+'@'+config[_0x8f5e('0xb')][_0x8f5e('0xe')];return adAuthenticate(config[_0x8f5e('0xb')],_0x2fdcda,_0x44d097);})[_0x8f5e('0x17')](function(_0x33bc36){if(_0x3efc37[_0x8f5e('0x1c')]){throw new Error(_0x8f5e('0x12'));}if(_0x1a297e['blockDuration']>0x0){if(_0x3efc37['blocked']){if(moment(_0x3efc37['blockedAt'])['add'](_0x1a297e['blockDuration'],_0x8f5e('0x20'))>moment()){throw new Error(_0x8f5e('0x12'));}return utils[_0x8f5e('0x21')](_0x3efc37,0x0,![],null)[_0x8f5e('0x17')](function(){return utils[_0x8f5e('0x22')](_0x3efc37);})[_0x8f5e('0x17')](function(){return _0x21f48e(null,_0x3efc37);});}else{return utils[_0x8f5e('0x22')](_0x3efc37)[_0x8f5e('0x17')](function(){return _0x21f48e(null,_0x3efc37);});}}else{return utils['getLicense'](_0x3efc37)[_0x8f5e('0x17')](function(){return _0x21f48e(null,_0x3efc37);});}})['catch'](function(_0x42d76f){return _0x21f48e(null,![],_0x42d76f);});}function handleError(_0x21a301,_0x1a0b72,_0x2430e5){return _0x21a301[_0x8f5e('0x23')](_0x1a0b72||0x1f4)[_0x8f5e('0x24')]({'message':_0x2430e5?_0x2430e5['message']||_0x2430e5:''});}exports[_0x8f5e('0x25')]=function(_0x1f6a74,_0x442d76,_0x12ec1f){passport[_0x8f5e('0xf')]('ad-login',function(_0x532ea7,_0x4d7ce9,_0xba3a96){var _0x4b1148=_0x532ea7||_0xba3a96;if(_0x4b1148){return handleError(_0x442d76,0x191,_0x4b1148);}if(!_0x4d7ce9){return handleError(_0x442d76,0x194,{'message':_0x8f5e('0x26')});}else{var _0x1c34b7={'payload':{'id':_0x4d7ce9['id'],'role':_0x4d7ce9[_0x8f5e('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0x8f5e('0x27')](_0x1c34b7)[_0x8f5e('0x17')](function(_0x3905c0){_0x442d76['json']({'id':_0x4d7ce9['id'],'token':_0x3905c0,'statusCall':'','isAlreadyLogged':_0x4d7ce9[_0x8f5e('0x28')]});});}})(_0x1f6a74,_0x442d76,_0x12ec1f);};passport[_0x8f5e('0x29')](_0x8f5e('0x2a'),new LocalStrategy({'usernameField':_0x8f5e('0x19'),'passwordField':_0x8f5e('0x1a')},function(_0x3f36d9,_0x2eb85e,_0x7f3361){return ActiveDirectoryAuthenticate(db[_0x8f5e('0x2b')],_0x3f36d9,_0x2eb85e,_0x7f3361);}));
\ No newline at end of file
+var _0xcd8d=['clearBlockUser','getLicense','catch','status','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','passport','passport-local','Strategy','moment','util','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','then','adSsoEnabled','findOne','password','salt','disabled','blocked','online','admin','agent','name','blockDuration','blockedAt','add'];(function(_0x4727f1,_0x2ff773){var _0x2977ce=function(_0x29be89){while(--_0x29be89){_0x4727f1['push'](_0x4727f1['shift']());}};_0x2977ce(++_0x2ff773);}(_0xcd8d,0x13e));var _0xdcd8=function(_0x2f32c4,_0x531dc6){_0x2f32c4=_0x2f32c4-0x0;var _0x3f3018=_0xcd8d[_0x2f32c4];return _0x3f3018;};'use strict';var passport=require(_0xdcd8('0x0'));var LocalStrategy=require(_0xdcd8('0x1'))[_0xdcd8('0x2')];var moment=require(_0xdcd8('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require('bluebird');var util=require(_0xdcd8('0x4'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0xdcd8('0x5'));var config=require(_0xdcd8('0x6'));var logger=require(_0xdcd8('0x7'))(_0xdcd8('0x8'));function isActiveDirectoryConfigured(_0x18abbd){var _0x2e3281=![];if(typeof _0x18abbd[_0xdcd8('0x9')]!==_0xdcd8('0xa')){_0x2e3281=_0x18abbd[_0xdcd8('0x9')][_0xdcd8('0xb')]&&_0x18abbd[_0xdcd8('0x9')][_0xdcd8('0xc')]&&_0x18abbd[_0xdcd8('0x9')]['domain'];}return _0x2e3281;}function adAuthenticate(_0x4fdf26,_0x421c06,_0x52770d){return new BPromise(function(_0x1fcf72,_0x1f2ff6){try{var _0x2c5616=new ActiveDirectory(_0x4fdf26);_0x2c5616['authenticate'](_0x421c06,_0x52770d,function(_0x8758c7,_0xe6d091){if(_0x8758c7){logger[_0xdcd8('0xd')](_0xdcd8('0xe'),_0x421c06,util[_0xdcd8('0xf')](_0x8758c7,{'showHidden':![],'depth':null}));_0x1f2ff6(_0xdcd8('0x10'));}else if(!_0xe6d091){logger['error'](_0xdcd8('0x11'),_0x421c06);_0x1f2ff6(_0xdcd8('0x10'));}else{_0x1fcf72(_0xe6d091);}});}catch(_0x4f04ca){_0x1f2ff6(_0x4f04ca);}});}function ActiveDirectoryAuthenticate(_0x316ad9,_0x50e768,_0x3b1989,_0xec131b){var _0x1f1372,_0x34fd8a;if(!isActiveDirectoryConfigured(config)){logger[_0xdcd8('0xd')](_0xdcd8('0x12'),_0x50e768);return _0xec131b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xdcd8('0x13')]['findOne']({'where':{'id':0x1},'attributes':['adSsoEnabled','blockDuration'],'raw':!![]})[_0xdcd8('0x14')](function(_0x193d03){_0x1f1372=_0x193d03;if(!_0x1f1372[_0xdcd8('0x15')]){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x50e768);throw new Error(_0xdcd8('0x10'));}return _0x316ad9[_0xdcd8('0x16')]({'attributes':['id','name',_0xdcd8('0x17'),_0xdcd8('0x18'),'role',_0xdcd8('0x19'),_0xdcd8('0x1a'),'blockedAt',_0xdcd8('0x1b')],'where':{'name':_0x50e768,'role':{'$or':[_0xdcd8('0x1c'),'user',_0xdcd8('0x1d')]},'adSsoEnabled':!![]}});})[_0xdcd8('0x14')](function(_0x172bca){if(!_0x172bca||_0x172bca&&_0x172bca['name']!==_0x50e768){throw new Error(_0xdcd8('0x10'));}_0x34fd8a=_0x172bca;var _0x75a381=_0x34fd8a[_0xdcd8('0x1e')]+'@'+config[_0xdcd8('0x9')]['domain'];return adAuthenticate(config[_0xdcd8('0x9')],_0x75a381,_0x3b1989);})['then'](function(_0x3912e5){if(_0x34fd8a[_0xdcd8('0x19')]){throw new Error(_0xdcd8('0x10'));}if(_0x1f1372[_0xdcd8('0x1f')]>0x0){if(_0x34fd8a[_0xdcd8('0x1a')]){if(moment(_0x34fd8a[_0xdcd8('0x20')])[_0xdcd8('0x21')](_0x1f1372['blockDuration'],'minutes')>moment()){throw new Error(_0xdcd8('0x10'));}return utils[_0xdcd8('0x22')](_0x34fd8a,0x0,![],null)[_0xdcd8('0x14')](function(){return utils[_0xdcd8('0x23')](_0x34fd8a);})[_0xdcd8('0x14')](function(){return _0xec131b(null,_0x34fd8a);});}else{return utils[_0xdcd8('0x23')](_0x34fd8a)['then'](function(){return _0xec131b(null,_0x34fd8a);});}}else{return utils[_0xdcd8('0x23')](_0x34fd8a)['then'](function(){return _0xec131b(null,_0x34fd8a);});}})[_0xdcd8('0x24')](function(_0x36816b){return _0xec131b(null,![],_0x36816b);});}function handleError(_0x3341ce,_0x5f2200,_0xa18d09){return _0x3341ce[_0xdcd8('0x25')](_0x5f2200||0x1f4)[_0xdcd8('0x26')]({'message':_0xa18d09?_0xa18d09['message']||_0xa18d09:''});}exports[_0xdcd8('0x27')]=function(_0x2d5778,_0x23d501,_0x505abe){passport['authenticate'](_0xdcd8('0x28'),function(_0xe7747b,_0x4f3ec5,_0x3a7663){var _0x10d625=_0xe7747b||_0x3a7663;if(_0x10d625){return handleError(_0x23d501,0x191,_0x10d625);}if(!_0x4f3ec5){return handleError(_0x23d501,0x194,{'message':_0xdcd8('0x29')});}else{var _0xca743e={'payload':{'id':_0x4f3ec5['id'],'role':_0x4f3ec5['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0xca743e)['then'](function(_0x2b3963){_0x23d501[_0xdcd8('0x2a')]({'id':_0x4f3ec5['id'],'token':_0x2b3963,'statusCall':'','isAlreadyLogged':_0x4f3ec5[_0xdcd8('0x1b')]});});}})(_0x2d5778,_0x23d501,_0x505abe);};passport[_0xdcd8('0x2b')](_0xdcd8('0x28'),new LocalStrategy({'usernameField':_0xdcd8('0x1e'),'passwordField':_0xdcd8('0x17')},function(_0x271eb6,_0x946aab,_0x56d581){return ActiveDirectoryAuthenticate(db['User'],_0x271eb6,_0x946aab,_0x56d581);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index a1b1658..75883ea 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 _0x2cf4=['login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x214f40,_0x17e44b){var _0x22a380=function(_0x47a1c6){while(--_0x47a1c6){_0x214f40['push'](_0x214f40['shift']());}};_0x22a380(++_0x17e44b);}(_0x2cf4,0x11f));var _0x42cf=function(_0x3cb3ca,_0x44d697){_0x3cb3ca=_0x3cb3ca-0x0;var _0x214366=_0x2cf4[_0x3cb3ca];return _0x214366;};'use strict';var express=require(_0x42cf('0x0'));var router=express[_0x42cf('0x1')]();var controller=require(_0x42cf('0x2'));router['post']('/',controller[_0x42cf('0x3')]);module[_0x42cf('0x4')]=router;
\ No newline at end of file
+var _0xb50b=['login','exports','express','./authActiveDirectory.controller'];(function(_0x7c43a9,_0x2ed443){var _0x573edb=function(_0x2be93d){while(--_0x2be93d){_0x7c43a9['push'](_0x7c43a9['shift']());}};_0x573edb(++_0x2ed443);}(_0xb50b,0x15a));var _0xbb50=function(_0x319cb9,_0x4b8d35){_0x319cb9=_0x319cb9-0x0;var _0x1735fc=_0xb50b[_0x319cb9];return _0x1735fc;};'use strict';var express=require(_0xbb50('0x0'));var router=express['Router']();var controller=require(_0xbb50('0x1'));router['post']('/',controller[_0xbb50('0x2')]);module[_0xbb50('0x3')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 95a7446..cc46ef1 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x23603,_0x281eee){var _0x2357a1=function(_0x265b78){while(--_0x265b78){_0x23603['push'](_0x23603['shift']());}};_0x2357a1(++_0x281eee);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _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(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x7a54,0x106));var _0x47a5=function(_0x595630,_0x904aeb){_0x595630=_0x595630-0x0;var _0x2464ec=_0x7a54[_0x595630];return _0x2464ec;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index ee6e203..a1ed68e 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 _0x64d7=['setTokenCookie','express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','callback'];(function(_0x32b3b2,_0x4571ca){var _0x3f42cc=function(_0x170106){while(--_0x170106){_0x32b3b2['push'](_0x32b3b2['shift']());}};_0x3f42cc(++_0x4571ca);}(_0x64d7,0x19f));var _0x764d=function(_0xbb4325,_0x293598){_0xbb4325=_0xbb4325-0x0;var _0xf7423a=_0x64d7[_0xbb4325];return _0xf7423a;};'use strict';var express=require(_0x764d('0x0'));var passport=require('passport');var router=express[_0x764d('0x1')]();var controller=require(_0x764d('0x2'));var userController=require(_0x764d('0x3'));var authService=require(_0x764d('0x4'));router[_0x764d('0x5')]('/',controller[_0x764d('0x6')]);router[_0x764d('0x5')]('/callback',controller[_0x764d('0x7')],authService['isMiddleware'],userController[_0x764d('0x6')],authService[_0x764d('0x8')]);module['exports']=router;
\ No newline at end of file
+var _0xbd3a=['login','/callback','callback','isMiddleware','setTokenCookie','passport','Router','./authGoogle.controller','../../components/auth/service','get'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xbd3a,0x1e5));var _0xabd3=function(_0x420348,_0x42038c){_0x420348=_0x420348-0x0;var _0x2c09e5=_0xbd3a[_0x420348];return _0x2c09e5;};'use strict';var express=require('express');var passport=require(_0xabd3('0x0'));var router=express[_0xabd3('0x1')]();var controller=require(_0xabd3('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0xabd3('0x3'));router[_0xabd3('0x4')]('/',controller[_0xabd3('0x5')]);router[_0xabd3('0x4')](_0xabd3('0x6'),controller[_0xabd3('0x7')],authService[_0xabd3('0x8')],userController[_0xabd3('0x5')],authService[_0xabd3('0x9')]);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 97a102f..9b22476 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 _0xa237=['merge','\x22%s\x22\x20<%s>','request','SendMail','error','format','message','status','login','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','use','local-login','util','Strategy','jayson/promise','lodash','randomstring','moment','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','role','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','disabled','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','getSmtpOptions'];(function(_0x2e3531,_0x1f0a91){var _0x39f792=function(_0x453003){while(--_0x453003){_0x2e3531['push'](_0x2e3531['shift']());}};_0x39f792(++_0x1f0a91);}(_0xa237,0x7c));var _0x7a23=function(_0x12524e,_0x28d790){_0x12524e=_0x12524e-0x0;var _0x6274e=_0xa237[_0x12524e];return _0x6274e;};'use strict';var util=require(_0x7a23('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0x7a23('0x1')];var jayson=require(_0x7a23('0x2'));var _=require(_0x7a23('0x3'));var rs=require(_0x7a23('0x4'));var moment=require(_0x7a23('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x7a23('0x6'));var utils=require(_0x7a23('0x7'));var client=jayson[_0x7a23('0x8')][_0x7a23('0x9')]({'port':0x232b});function localAuthenticate(_0x40e9a3,_0x20f11d,_0x1f8a97,_0x337eff){var _0x232784,_0x59100e;return db[_0x7a23('0xa')][_0x7a23('0xb')]({'where':{'id':0x1},'attributes':[_0x7a23('0xc'),_0x7a23('0xd')],'raw':!![]})[_0x7a23('0xe')](function(_0x5a8c2d){_0x232784=_0x5a8c2d;return _0x40e9a3[_0x7a23('0xb')]({'attributes':['id',_0x7a23('0xf'),_0x7a23('0x10'),'salt',_0x7a23('0x11'),'disabled',_0x7a23('0x12'),_0x7a23('0x13'),_0x7a23('0x14')],'where':{'name':_0x20f11d,'role':{'$or':[_0x7a23('0x15'),_0x7a23('0x16'),_0x7a23('0x17')]}}});})['then'](function(_0x5177aa){if(!_0x5177aa||_0x5177aa&&_0x5177aa[_0x7a23('0xf')]!==_0x20f11d){throw new Error(_0x7a23('0x18'));}else{_0x59100e=_0x5177aa;return _0x59100e;}})['then'](function(){_0x59100e['authenticate'](_0x1f8a97,function(_0x3d010a,_0x10f458){var _0x5b5637=_0x59100e[_0x7a23('0x14')]+0x1;if(_0x3d010a){return _0x337eff(_0x3d010a);}else if(!_0x10f458){if(_0x59100e[_0x7a23('0x19')]){return _0x337eff(null,![],{'message':_0x7a23('0x18')});}else if(_0x232784['allowedLoginAttempts']>0x0){if(_0x59100e[_0x7a23('0x12')]){if(_0x232784[_0x7a23('0xd')]>0x0){if(moment(_0x59100e['blockedAt'])[_0x7a23('0x1a')](_0x232784[_0x7a23('0xd')],_0x7a23('0x1b'))>moment()){return _0x337eff(null,![],{'message':_0x7a23('0x18')});}else{return utils[_0x7a23('0x1c')](_0x59100e,_0x5b5637,![],null)[_0x7a23('0xe')](function(){return _0x337eff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x337eff(null,![],{'message':_0x7a23('0x18')});}}else{if(_0x5b5637>=_0x232784[_0x7a23('0xc')]){return utils[_0x7a23('0x1c')](_0x59100e,0x0,!![],moment())[_0x7a23('0xe')](function(){return _0x337eff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x7a23('0x1c')](_0x59100e,_0x5b5637,![],null)[_0x7a23('0xe')](function(){return _0x337eff(null,![],{'message':_0x7a23('0x18')});});}}}else{return _0x337eff(null,![],{'message':_0x7a23('0x18')});}}else{if(_0x59100e[_0x7a23('0x19')]){return _0x337eff(null,![],{'message':_0x7a23('0x18')});}else if(_0x232784['allowedLoginAttempts']>0x0){if(_0x59100e[_0x7a23('0x12')]){if(_0x232784[_0x7a23('0xd')]>0x0){if(moment(_0x59100e[_0x7a23('0x13')])[_0x7a23('0x1a')](_0x232784['blockDuration'],'minutes')>moment()){return _0x337eff(null,![],{'message':_0x7a23('0x18')});}else{return utils['clearBlockUser'](_0x59100e,0x0,![],null)[_0x7a23('0xe')](function(){return utils[_0x7a23('0x1d')](_0x59100e);})[_0x7a23('0xe')](function(){return _0x337eff(null,_0x59100e);});}}else{return _0x337eff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x7a23('0x1c')](_0x59100e,0x0,![],null)[_0x7a23('0xe')](function(){return utils['getLicense'](_0x59100e);})[_0x7a23('0xe')](function(){return _0x337eff(null,_0x59100e);})[_0x7a23('0x1e')](function(_0x4f0e1a){return _0x337eff(null,![],_0x4f0e1a);});}}else{if(_0x59100e['blocked']){return _0x337eff(null,![],{'message':_0x7a23('0x18')});}else{return utils[_0x7a23('0x1d')](_0x59100e)[_0x7a23('0xe')](function(){return _0x337eff(null,_0x59100e);});}}}});})[_0x7a23('0x1e')](function(_0x5d70d4){return _0x337eff(null,![],_0x5d70d4);});}function sendServiceMail(_0x1a55e6){return db[_0x7a23('0x1f')][_0x7a23('0x20')]({'where':{'service':!![]},'attributes':['id',_0x7a23('0xf'),_0x7a23('0x21')],'include':[{'model':db[_0x7a23('0x22')],'as':_0x7a23('0x23'),'include':[{'model':db[_0x7a23('0x24')],'as':_0x7a23('0x24')}]}]})[_0x7a23('0xe')](function(_0x2bf609){if(!_0x2bf609){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x1fa127=_0x2bf609[_0x7a23('0x25')]();var _0x2a0eb1={'account':_0x1fa127,'message':_[_0x7a23('0x26')]({'from':util['format'](_0x7a23('0x27'),_0x2bf609[_0x7a23('0xf')],_0x2bf609[_0x7a23('0x21')]||_0x2bf609[_0x7a23('0x23')]['user'])},_0x1a55e6)};return client[_0x7a23('0x28')](_0x7a23('0x29'),_0x2a0eb1);})[_0x7a23('0xe')](function(_0x5c42b8){if(_0x5c42b8[_0x7a23('0x2a')]){throw new Error(util[_0x7a23('0x2b')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x5c42b8[_0x7a23('0x2a')][_0x7a23('0x2c')]||JSON['stringify'](_0x5c42b8['error'])));}return!![];});}function handleError(_0x45f19c,_0x31b285,_0x5e18f6){return _0x45f19c[_0x7a23('0x2d')](_0x31b285||0x1f4)['send']({'message':_0x5e18f6?_0x5e18f6[_0x7a23('0x2c')]||_0x5e18f6:''});}exports[_0x7a23('0x2e')]=function(_0x582ec2,_0x14d23b,_0x5a390a){passport[_0x7a23('0x2f')]('local-login',function(_0x4d17b6,_0x5dc53c,_0x37b939){var _0x2adcf6=_0x4d17b6||_0x37b939;if(_0x2adcf6){return handleError(_0x14d23b,0x191,_0x2adcf6);}if(!_0x5dc53c){return handleError(_0x14d23b,0x194,{'message':_0x7a23('0x30')});}else{var _0x48e73b={'payload':{'id':_0x5dc53c['id'],'role':_0x5dc53c[_0x7a23('0x11')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x48e73b)['then'](function(_0x592b17){_0x14d23b[_0x7a23('0x31')]({'id':_0x5dc53c['id'],'token':_0x592b17,'statusCall':'','isAlreadyLogged':_0x5dc53c[_0x7a23('0x32')]});});}})(_0x582ec2,_0x14d23b,_0x5a390a);};exports[_0x7a23('0x33')]=function(_0x777331,_0x2818ca){if(!_0x777331[_0x7a23('0x34')][_0x7a23('0x21')]){return handleError(_0x2818ca,0x1f4,{'message':_0x7a23('0x35')});}var _0x5d652f=rs[_0x7a23('0x36')]();_0x777331['body']['email']=_0x777331[_0x7a23('0x34')][_0x7a23('0x21')]['trim']()[_0x7a23('0x37')]();var _0x544d1b;return db[_0x7a23('0xa')][_0x7a23('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x7a23('0xd')],'raw':!![]})[_0x7a23('0xe')](function(_0x3a43fc){_0x544d1b=_0x3a43fc;return db[_0x7a23('0x38')]['find']({'where':{'email':_0x777331[_0x7a23('0x34')]['email']}});})[_0x7a23('0xe')](function(_0xfe9755){if(!_0xfe9755){throw new Error(_0x7a23('0x39'));}if(_0xfe9755[_0x7a23('0x19')]){throw new Error(_0x7a23('0x3a'));}if(_0xfe9755[_0x7a23('0x12')]){if(moment(_0xfe9755[_0x7a23('0x13')])[_0x7a23('0x1a')](_0x544d1b['blockDuration'],_0x7a23('0x1b'))>moment()){throw new Error(_0x7a23('0x3b'));}else{_0xfe9755['blocked']=![];_0xfe9755[_0x7a23('0x13')]=null;}}_0xfe9755[_0x7a23('0x3c')]=_0x5d652f;_0xfe9755[_0x7a23('0x3d')]=Date[_0x7a23('0x3e')]()+0x36ee80;return _0xfe9755[_0x7a23('0x3f')]();})[_0x7a23('0xe')](function(){return sendServiceMail({'to':_0x777331[_0x7a23('0x34')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x7a23('0x40')+_0x7a23('0x41')+_0x777331[_0x7a23('0x42')][_0x7a23('0x43')]+_0x7a23('0x44')+_0x5d652f+'\x0a\x0a'+_0x7a23('0x45')});})[_0x7a23('0xe')](function(){_0x2818ca[_0x7a23('0x2d')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0xbe786d){return handleError(_0x2818ca,0x1f4,_0xbe786d);});};exports[_0x7a23('0x46')]=function(_0x2ed2cf,_0x451dbb){return db[_0x7a23('0x38')][_0x7a23('0x20')]({'where':{'resetPasswordToken':_0x2ed2cf[_0x7a23('0x47')][_0x7a23('0x48')],'resetPasswordExpires':{'$gt':Date[_0x7a23('0x3e')]()}}})['then'](function(_0x5641a1){if(!_0x5641a1){throw new Error(_0x7a23('0x49'));}return db['Setting']['findOne']({'attributes':['id','securePassword',_0x7a23('0x4a'),'passwordHistoryLimit']})[_0x7a23('0xe')](function(_0x573aa4){if(_0x573aa4['securePassword'])authService[_0x7a23('0x4b')](_0x2ed2cf[_0x7a23('0x34')]['password']);if(!_0x573aa4[_0x7a23('0x4a')]||!_0x5641a1[_0x7a23('0x4c')])return _0x5641a1;authService[_0x7a23('0x4d')](_0x2ed2cf[_0x7a23('0x34')][_0x7a23('0x10')],_0x5641a1[_0x7a23('0x4c')],_0x573aa4[_0x7a23('0x4e')]);return _0x5641a1;})[_0x7a23('0xe')](function(){_0x5641a1[_0x7a23('0x10')]=_0x2ed2cf[_0x7a23('0x34')][_0x7a23('0x10')];_0x5641a1[_0x7a23('0x3c')]=null;_0x5641a1[_0x7a23('0x3d')]=null;return _0x5641a1['save']();});})[_0x7a23('0xe')](function(){_0x451dbb[_0x7a23('0x2d')](0xc8)['send']({'message':'Password\x20reset!'});})[_0x7a23('0x1e')](function(_0x102a1c){return handleError(_0x451dbb,0x1f4,_0x102a1c);});};passport[_0x7a23('0x4f')](_0x7a23('0x50'),new LocalStrategy({'usernameField':_0x7a23('0xf'),'passwordField':_0x7a23('0x10')},function(_0x2f0531,_0x5f4c28,_0x2182d6){return localAuthenticate(db['User'],_0x2f0531,_0x5f4c28,_0x2182d6);}));
\ No newline at end of file
+var _0xed4f=['signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','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','enforcePasswordHistory','validatePasswordPattern','validatePasswordHistory','passwordHistoryLimit','save','Password\x20reset!','use','util','passport','passport-local','jayson/promise','lodash','../../config/utils','http','allowedLoginAttempts','blockDuration','then','findOne','name','password','salt','role','blockedAt','loginAttempts','agent','authenticate','blocked','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','disabled','add','minutes','getLicense','catch','MailAccount','find','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login'];(function(_0x416c14,_0x8f64df){var _0x13a057=function(_0x4131b2){while(--_0x4131b2){_0x416c14['push'](_0x416c14['shift']());}};_0x13a057(++_0x8f64df);}(_0xed4f,0x111));var _0xfed4=function(_0x5d9024,_0x213750){_0x5d9024=_0x5d9024-0x0;var _0x6e7987=_0xed4f[_0x5d9024];return _0x6e7987;};'use strict';var util=require(_0xfed4('0x0'));var passport=require(_0xfed4('0x1'));var LocalStrategy=require(_0xfed4('0x2'))['Strategy'];var jayson=require(_0xfed4('0x3'));var _=require(_0xfed4('0x4'));var rs=require('randomstring');var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0xfed4('0x5'));var client=jayson['client'][_0xfed4('0x6')]({'port':0x232b});function localAuthenticate(_0x4f82d1,_0x1312de,_0x5d6685,_0x1cfb5e){var _0x45203a,_0x510943;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xfed4('0x7'),_0xfed4('0x8')],'raw':!![]})[_0xfed4('0x9')](function(_0x4c171a){_0x45203a=_0x4c171a;return _0x4f82d1[_0xfed4('0xa')]({'attributes':['id',_0xfed4('0xb'),_0xfed4('0xc'),_0xfed4('0xd'),_0xfed4('0xe'),'disabled','blocked',_0xfed4('0xf'),_0xfed4('0x10')],'where':{'name':_0x1312de,'role':{'$or':['admin','user',_0xfed4('0x11')]}}});})[_0xfed4('0x9')](function(_0x5b9030){if(!_0x5b9030||_0x5b9030&&_0x5b9030[_0xfed4('0xb')]!==_0x1312de){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x510943=_0x5b9030;return _0x510943;}})[_0xfed4('0x9')](function(){_0x510943[_0xfed4('0x12')](_0x5d6685,function(_0x10251b,_0x5b7558){var _0x261ab8=_0x510943[_0xfed4('0x10')]+0x1;if(_0x10251b){return _0x1cfb5e(_0x10251b);}else if(!_0x5b7558){if(_0x510943['disabled']){return _0x1cfb5e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x45203a['allowedLoginAttempts']>0x0){if(_0x510943[_0xfed4('0x13')]){if(_0x45203a[_0xfed4('0x8')]>0x0){if(moment(_0x510943[_0xfed4('0xf')])['add'](_0x45203a['blockDuration'],'minutes')>moment()){return _0x1cfb5e(null,![],{'message':_0xfed4('0x14')});}else{return utils[_0xfed4('0x15')](_0x510943,_0x261ab8,![],null)[_0xfed4('0x9')](function(){return _0x1cfb5e(null,![],{'message':_0xfed4('0x14')});});}}else{return _0x1cfb5e(null,![],{'message':_0xfed4('0x14')});}}else{if(_0x261ab8>=_0x45203a[_0xfed4('0x7')]){return utils[_0xfed4('0x15')](_0x510943,0x0,!![],moment())['then'](function(){return _0x1cfb5e(null,![],{'message':_0xfed4('0x14')});});}else{return utils[_0xfed4('0x15')](_0x510943,_0x261ab8,![],null)['then'](function(){return _0x1cfb5e(null,![],{'message':_0xfed4('0x14')});});}}}else{return _0x1cfb5e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x510943[_0xfed4('0x16')]){return _0x1cfb5e(null,![],{'message':_0xfed4('0x14')});}else if(_0x45203a[_0xfed4('0x7')]>0x0){if(_0x510943[_0xfed4('0x13')]){if(_0x45203a['blockDuration']>0x0){if(moment(_0x510943[_0xfed4('0xf')])[_0xfed4('0x17')](_0x45203a[_0xfed4('0x8')],_0xfed4('0x18'))>moment()){return _0x1cfb5e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xfed4('0x15')](_0x510943,0x0,![],null)[_0xfed4('0x9')](function(){return utils['getLicense'](_0x510943);})[_0xfed4('0x9')](function(){return _0x1cfb5e(null,_0x510943);});}}else{return _0x1cfb5e(null,![],{'message':_0xfed4('0x14')});}}else{return utils[_0xfed4('0x15')](_0x510943,0x0,![],null)[_0xfed4('0x9')](function(){return utils[_0xfed4('0x19')](_0x510943);})[_0xfed4('0x9')](function(){return _0x1cfb5e(null,_0x510943);})[_0xfed4('0x1a')](function(_0x5313e4){return _0x1cfb5e(null,![],_0x5313e4);});}}else{if(_0x510943[_0xfed4('0x13')]){return _0x1cfb5e(null,![],{'message':_0xfed4('0x14')});}else{return utils[_0xfed4('0x19')](_0x510943)[_0xfed4('0x9')](function(){return _0x1cfb5e(null,_0x510943);});}}}});})[_0xfed4('0x1a')](function(_0x976a9){return _0x1cfb5e(null,![],_0x976a9);});}function sendServiceMail(_0x5f3899){return db[_0xfed4('0x1b')][_0xfed4('0x1c')]({'where':{'service':!![]},'attributes':['id','name',_0xfed4('0x1d')],'include':[{'model':db['MailServerOut'],'as':_0xfed4('0x1e'),'include':[{'model':db['CloudProvider'],'as':_0xfed4('0x1f')}]}]})[_0xfed4('0x9')](function(_0x236359){if(!_0x236359){throw new Error(_0xfed4('0x20'));}var _0x3095fe=_0x236359[_0xfed4('0x21')]();var _0x1eb961={'account':_0x3095fe,'message':_[_0xfed4('0x22')]({'from':util[_0xfed4('0x23')](_0xfed4('0x24'),_0x236359[_0xfed4('0xb')],_0x236359[_0xfed4('0x1d')]||_0x236359['Smtp']['user'])},_0x5f3899)};return client[_0xfed4('0x25')](_0xfed4('0x26'),_0x1eb961);})['then'](function(_0x23f051){if(_0x23f051[_0xfed4('0x27')]){throw new Error(util['format'](_0xfed4('0x28'),_0x23f051[_0xfed4('0x27')][_0xfed4('0x29')]||JSON[_0xfed4('0x2a')](_0x23f051[_0xfed4('0x27')])));}return!![];});}function handleError(_0x35afa2,_0x117636,_0x15d519){return _0x35afa2[_0xfed4('0x2b')](_0x117636||0x1f4)[_0xfed4('0x2c')]({'message':_0x15d519?_0x15d519['message']||_0x15d519:''});}exports[_0xfed4('0x2d')]=function(_0x581157,_0x3766ed,_0x2192bb){passport[_0xfed4('0x12')](_0xfed4('0x2e'),function(_0x28d505,_0x429833,_0x586557){var _0x15fd68=_0x28d505||_0x586557;if(_0x15fd68){return handleError(_0x3766ed,0x191,_0x15fd68);}if(!_0x429833){return handleError(_0x3766ed,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x3fd64c={'payload':{'id':_0x429833['id'],'role':_0x429833[_0xfed4('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0xfed4('0x2f')](_0x3fd64c)[_0xfed4('0x9')](function(_0xe4b1b5){_0x3766ed[_0xfed4('0x30')]({'id':_0x429833['id'],'token':_0xe4b1b5,'statusCall':'','isAlreadyLogged':_0x429833[_0xfed4('0x31')]});});}})(_0x581157,_0x3766ed,_0x2192bb);};exports['forgot']=function(_0x9c26da,_0x85b335){if(!_0x9c26da[_0xfed4('0x32')][_0xfed4('0x1d')]){return handleError(_0x85b335,0x1f4,{'message':_0xfed4('0x33')});}var _0x2a2f04=rs[_0xfed4('0x34')]();_0x9c26da[_0xfed4('0x32')][_0xfed4('0x1d')]=_0x9c26da[_0xfed4('0x32')][_0xfed4('0x1d')][_0xfed4('0x35')]()[_0xfed4('0x36')]();var _0x544ed7;return db[_0xfed4('0x37')]['findOne']({'where':{'id':0x1},'attributes':[_0xfed4('0x7'),_0xfed4('0x8')],'raw':!![]})['then'](function(_0x185075){_0x544ed7=_0x185075;return db[_0xfed4('0x38')]['find']({'where':{'email':_0x9c26da[_0xfed4('0x32')][_0xfed4('0x1d')]}});})[_0xfed4('0x9')](function(_0x3f99bd){if(!_0x3f99bd){throw new Error(_0xfed4('0x39'));}if(_0x3f99bd[_0xfed4('0x16')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x3f99bd['blocked']){if(moment(_0x3f99bd['blockedAt'])[_0xfed4('0x17')](_0x544ed7[_0xfed4('0x8')],_0xfed4('0x18'))>moment()){throw new Error(_0xfed4('0x3a'));}else{_0x3f99bd['blocked']=![];_0x3f99bd['blockedAt']=null;}}_0x3f99bd[_0xfed4('0x3b')]=_0x2a2f04;_0x3f99bd[_0xfed4('0x3c')]=Date[_0xfed4('0x3d')]()+0x36ee80;return _0x3f99bd['save']();})['then'](function(){return sendServiceMail({'to':_0x9c26da[_0xfed4('0x32')][_0xfed4('0x1d')],'subject':_0xfed4('0x3e'),'text':_0xfed4('0x3f')+_0xfed4('0x40')+'https://'+_0x9c26da[_0xfed4('0x41')]['host']+_0xfed4('0x42')+_0x2a2f04+'\x0a\x0a'+_0xfed4('0x43')});})[_0xfed4('0x9')](function(){_0x85b335[_0xfed4('0x2b')](0xc8)[_0xfed4('0x2c')]({'message':_0xfed4('0x44')});})[_0xfed4('0x1a')](function(_0x18181f){return handleError(_0x85b335,0x1f4,_0x18181f);});};exports[_0xfed4('0x45')]=function(_0x344653,_0x42713d){return db[_0xfed4('0x38')][_0xfed4('0x1c')]({'where':{'resetPasswordToken':_0x344653['params'][_0xfed4('0x46')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xfed4('0x9')](function(_0x42cd3e){if(!_0x42cd3e){throw new Error(_0xfed4('0x47'));}return db[_0xfed4('0x37')][_0xfed4('0xa')]({'attributes':['id',_0xfed4('0x48'),_0xfed4('0x49'),'passwordHistoryLimit']})['then'](function(_0x1b411e){if(_0x1b411e[_0xfed4('0x48')])authService[_0xfed4('0x4a')](_0x344653[_0xfed4('0x32')][_0xfed4('0xc')]);if(!_0x1b411e[_0xfed4('0x49')]||!_0x42cd3e['previousPasswords'])return _0x42cd3e;authService[_0xfed4('0x4b')](_0x344653['body']['password'],_0x42cd3e['previousPasswords'],_0x1b411e[_0xfed4('0x4c')]);return _0x42cd3e;})[_0xfed4('0x9')](function(){_0x42cd3e[_0xfed4('0xc')]=_0x344653[_0xfed4('0x32')][_0xfed4('0xc')];_0x42cd3e[_0xfed4('0x3b')]=null;_0x42cd3e[_0xfed4('0x3c')]=null;return _0x42cd3e[_0xfed4('0x4d')]();});})['then'](function(){_0x42713d['status'](0xc8)[_0xfed4('0x2c')]({'message':_0xfed4('0x4e')});})[_0xfed4('0x1a')](function(_0x48329d){return handleError(_0x42713d,0x1f4,_0x48329d);});};passport[_0xfed4('0x4f')]('local-login',new LocalStrategy({'usernameField':_0xfed4('0xb'),'passwordField':_0xfed4('0xc')},function(_0xe2874e,_0x31fc23,_0x3dbdab){return localAuthenticate(db[_0xfed4('0x38')],_0xe2874e,_0x31fc23,_0x3dbdab);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 51f4aa4..61672c2 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 _0x0d6a=['/reset/:token','reset','exports','express','Router','./authLocal.controller','post','/forgot','forgot'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0d6a,0x186));var _0xa0d6=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x0d6a[_0x4b2863];return _0x567d67;};'use strict';var express=require(_0xa0d6('0x0'));var router=express[_0xa0d6('0x1')]();var controller=require(_0xa0d6('0x2'));router[_0xa0d6('0x3')]('/',controller['login']);router[_0xa0d6('0x3')](_0xa0d6('0x4'),controller[_0xa0d6('0x5')]);router[_0xa0d6('0x3')](_0xa0d6('0x6'),controller[_0xa0d6('0x7')]);module[_0xa0d6('0x8')]=router;
\ No newline at end of file
+var _0x2bf6=['exports','express','Router','post','/forgot','forgot','/reset/:token','reset'];(function(_0x4da736,_0x55e2b1){var _0x270d2e=function(_0x1f97bf){while(--_0x1f97bf){_0x4da736['push'](_0x4da736['shift']());}};_0x270d2e(++_0x55e2b1);}(_0x2bf6,0xd1));var _0x62bf=function(_0x49fc33,_0x471664){_0x49fc33=_0x49fc33-0x0;var _0x5cf941=_0x2bf6[_0x49fc33];return _0x5cf941;};'use strict';var express=require(_0x62bf('0x0'));var router=express[_0x62bf('0x1')]();var controller=require('./authLocal.controller');router[_0x62bf('0x2')]('/',controller['login']);router[_0x62bf('0x2')](_0x62bf('0x3'),controller[_0x62bf('0x4')]);router['post'](_0x62bf('0x5'),controller[_0x62bf('0x6')]);module[_0x62bf('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index b4e58b6..23e52cb 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 _0x8848=['BOOLEAN','INTEGER','STRING'];(function(_0x120376,_0x571898){var _0x28c529=function(_0x4f130c){while(--_0x4f130c){_0x120376['push'](_0x120376['shift']());}};_0x28c529(++_0x571898);}(_0x8848,0x188));var _0x8884=function(_0x173f10,_0x35db61){_0x173f10=_0x173f10-0x0;var _0x53142d=_0x8848[_0x173f10];return _0x53142d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8884('0x0')],'allowNull':![]},'channel':{'type':Sequelize[_0x8884('0x0')]},'description':{'type':Sequelize[_0x8884('0x0')]},'status':{'type':Sequelize[_0x8884('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x8884('0x2')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xea19=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x58ff8e,_0x39fe0d){var _0x701683=function(_0x163930){while(--_0x163930){_0x58ff8e['push'](_0x58ff8e['shift']());}};_0x701683(++_0x39fe0d);}(_0xea19,0x1ca));var _0x9ea1=function(_0x1e3671,_0x9ae4fc){_0x1e3671=_0x1e3671-0x0;var _0x48d5f5=_0xea19[_0x1e3671];return _0x48d5f5;};'use strict';var Sequelize=require(_0x9ea1('0x0'));module[_0x9ea1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x9ea1('0x2')]},'description':{'type':Sequelize[_0x9ea1('0x2')]},'status':{'type':Sequelize[_0x9ea1('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x9ea1('0x4')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index fec9b1f..3edf3cb 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 _0x1c1b=['limit','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','Condition','ids','omit','getConditions','findOne','order','hasOwnProperty','nolimit','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','status','stack','name','send','map','Automation','fieldName','type','key','keys','query','intersection','model','attributes','fields','length'];(function(_0x2797bc,_0x3617b0){var _0x24a66c=function(_0x2bc0ff){while(--_0x2bc0ff){_0x2797bc['push'](_0x2797bc['shift']());}};_0x24a66c(++_0x3617b0);}(_0x1c1b,0xc8));var _0xb1c1=function(_0x428dad,_0x7ff665){_0x428dad=_0x428dad-0x0;var _0x4d112f=_0x1c1b[_0x428dad];return _0x4d112f;};'use strict';var emlformat=require(_0xb1c1('0x0'));var rimraf=require(_0xb1c1('0x1'));var zipdir=require(_0xb1c1('0x2'));var jsonpatch=require(_0xb1c1('0x3'));var rp=require(_0xb1c1('0x4'));var moment=require(_0xb1c1('0x5'));var BPromise=require(_0xb1c1('0x6'));var Mustache=require(_0xb1c1('0x7'));var util=require(_0xb1c1('0x8'));var path=require(_0xb1c1('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb1c1('0xa'));var _=require(_0xb1c1('0xb'));var squel=require(_0xb1c1('0xc'));var crypto=require(_0xb1c1('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb1c1('0xe'));var querystring=require(_0xb1c1('0xf'));var Papa=require('papaparse');var Redis=require(_0xb1c1('0x10'));var authService=require(_0xb1c1('0x11'));var qs=require(_0xb1c1('0x12'));var as=require(_0xb1c1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb1c1('0x14'))(_0xb1c1('0x15'));var utils=require(_0xb1c1('0x16'));var config=require(_0xb1c1('0x17'));var licenseUtil=require(_0xb1c1('0x18'));var db=require(_0xb1c1('0x19'))['db'];function respondWithStatusCode(_0x4e55e7,_0x2b52b5){_0x2b52b5=_0x2b52b5||0xcc;return function(_0x2fdd7e){if(_0x2fdd7e){return _0x4e55e7[_0xb1c1('0x1a')](_0x2b52b5);}return _0x4e55e7['status'](_0x2b52b5)[_0xb1c1('0x1b')]();};}function respondWithResult(_0x54397f,_0x1d1ec4){_0x1d1ec4=_0x1d1ec4||0xc8;return function(_0x419f4e){if(_0x419f4e){return _0x54397f['status'](_0x1d1ec4)[_0xb1c1('0x1c')](_0x419f4e);}};}function respondWithFilteredResult(_0x2f8c31,_0x57182c){return function(_0x3db660){if(_0x3db660){var _0x18c2f5=typeof _0x57182c[_0xb1c1('0x1d')]===_0xb1c1('0x1e')&&typeof _0x57182c['limit']===_0xb1c1('0x1e');var _0x32d539=_0x3db660[_0xb1c1('0x1f')];var _0x41b19e=_0x18c2f5?0x0:_0x57182c[_0xb1c1('0x1d')];var _0x877e79=_0x18c2f5?_0x3db660['count']:_0x57182c[_0xb1c1('0x1d')]+_0x57182c['limit'];var _0x387ee3;if(_0x877e79>=_0x32d539){_0x877e79=_0x32d539;_0x387ee3=0xc8;}else{_0x387ee3=0xce;}_0x2f8c31['status'](_0x387ee3);return _0x2f8c31[_0xb1c1('0x20')](_0xb1c1('0x21'),_0x41b19e+'-'+_0x877e79+'/'+_0x32d539)[_0xb1c1('0x1c')](_0x3db660);}return null;};}function patchUpdates(_0x9f66f1){return function(_0x3d3622){try{jsonpatch[_0xb1c1('0x22')](_0x3d3622,_0x9f66f1,!![]);}catch(_0x56cc37){return BPromise[_0xb1c1('0x23')](_0x56cc37);}return _0x3d3622[_0xb1c1('0x24')]();};}function saveUpdates(_0x29e58a,_0x272cf8){return function(_0xfee761){if(_0xfee761){return _0xfee761['update'](_0x29e58a)[_0xb1c1('0x25')](function(_0x93abcd){return _0x93abcd;});}return null;};}function removeEntity(_0x19bb60,_0x63f135){return function(_0x539b2c){if(_0x539b2c){return _0x539b2c[_0xb1c1('0x26')]()[_0xb1c1('0x25')](function(){_0x19bb60[_0xb1c1('0x27')](0xcc)[_0xb1c1('0x1b')]();});}};}function handleEntityNotFound(_0x57bf46,_0x2ca9e5){return function(_0x383b02){if(!_0x383b02){_0x57bf46[_0xb1c1('0x1a')](0x194);}return _0x383b02;};}function handleError(_0x1ddd99,_0x181f16){_0x181f16=_0x181f16||0x1f4;return function(_0x27b12a){logger['error'](_0x27b12a[_0xb1c1('0x28')]);if(_0x27b12a['name']){delete _0x27b12a[_0xb1c1('0x29')];}_0x1ddd99[_0xb1c1('0x27')](_0x181f16)[_0xb1c1('0x2a')](_0x27b12a);};}exports['index']=function(_0x38434d,_0x3687c9){var _0x287af3={},_0x1a8b93={},_0x1fd7d9={'count':0x0,'rows':[]};var _0x2d1d3a=_[_0xb1c1('0x2b')](db[_0xb1c1('0x2c')]['rawAttributes'],function(_0xb2e091){return{'name':_0xb2e091[_0xb1c1('0x2d')],'type':_0xb2e091[_0xb1c1('0x2e')][_0xb1c1('0x2f')]};});_0x1a8b93['model']=_[_0xb1c1('0x2b')](_0x2d1d3a,'name');_0x1a8b93['query']=_[_0xb1c1('0x30')](_0x38434d[_0xb1c1('0x31')]);_0x1a8b93['filters']=_[_0xb1c1('0x32')](_0x1a8b93[_0xb1c1('0x33')],_0x1a8b93[_0xb1c1('0x31')]);_0x287af3[_0xb1c1('0x34')]=_[_0xb1c1('0x32')](_0x1a8b93[_0xb1c1('0x33')],qs[_0xb1c1('0x35')](_0x38434d[_0xb1c1('0x31')][_0xb1c1('0x35')]));_0x287af3[_0xb1c1('0x34')]=_0x287af3[_0xb1c1('0x34')][_0xb1c1('0x36')]?_0x287af3[_0xb1c1('0x34')]:_0x1a8b93[_0xb1c1('0x33')];if(!_0x38434d[_0xb1c1('0x31')]['hasOwnProperty']('nolimit')){_0x287af3[_0xb1c1('0x37')]=qs[_0xb1c1('0x37')](_0x38434d[_0xb1c1('0x31')][_0xb1c1('0x37')]);_0x287af3[_0xb1c1('0x1d')]=qs[_0xb1c1('0x1d')](_0x38434d[_0xb1c1('0x31')]['offset']);}_0x287af3['order']=qs[_0xb1c1('0x38')](_0x38434d[_0xb1c1('0x31')][_0xb1c1('0x38')]);_0x287af3['where']=qs[_0xb1c1('0x39')](_[_0xb1c1('0x3a')](_0x38434d[_0xb1c1('0x31')],_0x1a8b93[_0xb1c1('0x39')]),_0x2d1d3a);if(_0x38434d[_0xb1c1('0x31')][_0xb1c1('0x3b')]){_0x287af3[_0xb1c1('0x3c')]=_[_0xb1c1('0x3d')](_0x287af3['where'],{'$or':_['map'](_0x2d1d3a,function(_0x38cb3d){if(_0x38cb3d['type']!==_0xb1c1('0x3e')){var _0x1705a4={};_0x1705a4[_0x38cb3d[_0xb1c1('0x29')]]={'$like':'%'+_0x38434d[_0xb1c1('0x31')][_0xb1c1('0x3b')]+'%'};return _0x1705a4;}})});}_0x287af3=_['merge']({},_0x287af3,_0x38434d['options']);var _0x13f7b2={'where':_0x287af3['where']};return db[_0xb1c1('0x2c')][_0xb1c1('0x1f')](_0x13f7b2)['then'](function(_0x67ca0){_0x1fd7d9[_0xb1c1('0x1f')]=_0x67ca0;if(_0x38434d['query'][_0xb1c1('0x3f')]){_0x287af3['include']=[{'all':!![]}];}return db[_0xb1c1('0x2c')][_0xb1c1('0x40')](_0x287af3);})[_0xb1c1('0x25')](function(_0x58a484){_0x1fd7d9[_0xb1c1('0x41')]=_0x58a484;return _0x1fd7d9;})[_0xb1c1('0x25')](respondWithFilteredResult(_0x3687c9,_0x287af3))[_0xb1c1('0x42')](handleError(_0x3687c9,null));};exports[_0xb1c1('0x43')]=function(_0x2d12b1,_0x42ecc5){var _0x32fa62={'raw':![],'where':{'id':_0x2d12b1[_0xb1c1('0x44')]['id']}},_0xe6964f={};_0xe6964f[_0xb1c1('0x33')]=_[_0xb1c1('0x30')](db[_0xb1c1('0x2c')][_0xb1c1('0x45')]);_0xe6964f[_0xb1c1('0x31')]=_['keys'](_0x2d12b1['query']);_0xe6964f[_0xb1c1('0x39')]=_[_0xb1c1('0x32')](_0xe6964f['model'],_0xe6964f[_0xb1c1('0x31')]);_0x32fa62[_0xb1c1('0x34')]=_[_0xb1c1('0x32')](_0xe6964f[_0xb1c1('0x33')],qs['fields'](_0x2d12b1[_0xb1c1('0x31')][_0xb1c1('0x35')]));_0x32fa62[_0xb1c1('0x34')]=_0x32fa62['attributes'][_0xb1c1('0x36')]?_0x32fa62[_0xb1c1('0x34')]:_0xe6964f['model'];if(_0x2d12b1[_0xb1c1('0x31')][_0xb1c1('0x3f')]){_0x32fa62['include']=[{'all':!![]}];}_0x32fa62=_[_0xb1c1('0x3d')]({},_0x32fa62,_0x2d12b1[_0xb1c1('0x46')]);return db['Automation'][_0xb1c1('0x47')](_0x32fa62)[_0xb1c1('0x25')](handleEntityNotFound(_0x42ecc5,null))[_0xb1c1('0x25')](respondWithResult(_0x42ecc5,null))['catch'](handleError(_0x42ecc5,null));};exports['create']=function(_0x547016,_0x397003){return db['Automation'][_0xb1c1('0x48')](_0x547016[_0xb1c1('0x49')],{})[_0xb1c1('0x25')](respondWithResult(_0x397003,0xc9))['catch'](handleError(_0x397003,null));};exports['update']=function(_0xde9864,_0x3d57d0){if(_0xde9864[_0xb1c1('0x49')]['id']){delete _0xde9864[_0xb1c1('0x49')]['id'];}return db[_0xb1c1('0x2c')][_0xb1c1('0x47')]({'where':{'id':_0xde9864[_0xb1c1('0x44')]['id']}})[_0xb1c1('0x25')](handleEntityNotFound(_0x3d57d0,null))[_0xb1c1('0x25')](saveUpdates(_0xde9864['body'],null))[_0xb1c1('0x25')](respondWithResult(_0x3d57d0,null))[_0xb1c1('0x42')](handleError(_0x3d57d0,null));};exports[_0xb1c1('0x26')]=function(_0x2f0b99,_0x2a58a3){return db[_0xb1c1('0x2c')]['find']({'where':{'id':_0x2f0b99[_0xb1c1('0x44')]['id']}})['then'](handleEntityNotFound(_0x2a58a3,null))['then'](removeEntity(_0x2a58a3,null))[_0xb1c1('0x42')](handleError(_0x2a58a3,null));};exports['addConditions']=function(_0x1ea308,_0x4c67a1,_0x25c1c2){return db[_0xb1c1('0x4a')][_0xb1c1('0x47')]({'where':{'id':_0x1ea308['params']['id']}})['then'](handleEntityNotFound(_0x4c67a1,null))[_0xb1c1('0x25')](function(_0x473155){if(_0x473155){return _0x473155['addConditions'](_0x1ea308[_0xb1c1('0x49')][_0xb1c1('0x4b')],_[_0xb1c1('0x4c')](_0x1ea308[_0xb1c1('0x49')],[_0xb1c1('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x4c67a1,null))[_0xb1c1('0x42')](handleError(_0x4c67a1,null));};exports[_0xb1c1('0x4d')]=function(_0x13c306,_0x35d94c,_0x4896ee){var _0x56ec58={};var _0x19f1f4={};var _0x2eedef;var _0x3d1243;return db[_0xb1c1('0x2c')][_0xb1c1('0x4e')]({'where':{'id':_0x13c306[_0xb1c1('0x44')]['id']}})[_0xb1c1('0x25')](handleEntityNotFound(_0x35d94c,null))['then'](function(_0x4ecbc4){if(_0x4ecbc4){_0x2eedef=_0x4ecbc4;_0x19f1f4[_0xb1c1('0x33')]=_[_0xb1c1('0x30')](db['Condition'][_0xb1c1('0x45')]);_0x19f1f4[_0xb1c1('0x31')]=_[_0xb1c1('0x30')](_0x13c306[_0xb1c1('0x31')]);_0x19f1f4[_0xb1c1('0x39')]=_[_0xb1c1('0x32')](_0x19f1f4[_0xb1c1('0x33')],_0x19f1f4[_0xb1c1('0x31')]);_0x56ec58[_0xb1c1('0x34')]=_[_0xb1c1('0x32')](_0x19f1f4['model'],qs['fields'](_0x13c306['query'][_0xb1c1('0x35')]));_0x56ec58[_0xb1c1('0x34')]=_0x56ec58[_0xb1c1('0x34')][_0xb1c1('0x36')]?_0x56ec58['attributes']:_0x19f1f4[_0xb1c1('0x33')];_0x56ec58[_0xb1c1('0x4f')]=qs['sort'](_0x13c306['query']['sort']);_0x56ec58[_0xb1c1('0x3c')]=qs[_0xb1c1('0x39')](_[_0xb1c1('0x3a')](_0x13c306[_0xb1c1('0x31')],_0x19f1f4[_0xb1c1('0x39')]));if(_0x13c306[_0xb1c1('0x31')][_0xb1c1('0x3b')]){_0x56ec58['where']=_[_0xb1c1('0x3d')](_0x56ec58['where'],{'$or':_[_0xb1c1('0x2b')](_0x56ec58[_0xb1c1('0x34')],function(_0x502b69){var _0x37edda={};_0x37edda[_0x502b69]={'$like':'%'+_0x13c306[_0xb1c1('0x31')][_0xb1c1('0x3b')]+'%'};return _0x37edda;})});}_0x56ec58=_[_0xb1c1('0x3d')]({},_0x56ec58,_0x13c306['options']);return _0x2eedef['getConditions'](_0x56ec58);}})[_0xb1c1('0x25')](function(_0x3a9570){if(_0x3a9570){_0x3d1243=_0x3a9570[_0xb1c1('0x36')];if(!_0x13c306[_0xb1c1('0x31')][_0xb1c1('0x50')](_0xb1c1('0x51'))){_0x56ec58[_0xb1c1('0x37')]=qs[_0xb1c1('0x37')](_0x13c306[_0xb1c1('0x31')][_0xb1c1('0x37')]);_0x56ec58[_0xb1c1('0x1d')]=qs[_0xb1c1('0x1d')](_0x13c306[_0xb1c1('0x31')][_0xb1c1('0x1d')]);}return _0x2eedef[_0xb1c1('0x4d')](_0x56ec58);}})[_0xb1c1('0x25')](function(_0x34bba2){if(_0x34bba2){return _0x34bba2?{'count':_0x3d1243,'rows':_0x34bba2}:null;}})['then'](respondWithResult(_0x35d94c,null))[_0xb1c1('0x42')](handleError(_0x35d94c,null));};exports[_0xb1c1('0x52')]=function(_0x221284,_0x5ee748,_0x318bcb){return db[_0xb1c1('0x53')]['find']({'where':{'id':_0x221284[_0xb1c1('0x44')]['id']}})[_0xb1c1('0x25')](handleEntityNotFound(_0x5ee748,null))[_0xb1c1('0x25')](function(_0x1d80ec){if(_0x1d80ec){return _0x1d80ec['addActions'](_0x221284[_0xb1c1('0x49')]['ids'],_[_0xb1c1('0x4c')](_0x221284[_0xb1c1('0x49')],['ids','id'])||{});}})[_0xb1c1('0x25')](respondWithResult(_0x5ee748,null))[_0xb1c1('0x42')](handleError(_0x5ee748,null));};exports[_0xb1c1('0x54')]=function(_0xb0e814,_0x397abf,_0x5c8ca6){var _0x1e91c7={};var _0x2c6605={};var _0x18acd9;var _0x1d95ec;return db['Automation'][_0xb1c1('0x4e')]({'where':{'id':_0xb0e814['params']['id']}})[_0xb1c1('0x25')](handleEntityNotFound(_0x397abf,null))[_0xb1c1('0x25')](function(_0x380cf2){if(_0x380cf2){_0x18acd9=_0x380cf2;_0x2c6605[_0xb1c1('0x33')]=_[_0xb1c1('0x30')](db[_0xb1c1('0x53')][_0xb1c1('0x45')]);_0x2c6605[_0xb1c1('0x31')]=_[_0xb1c1('0x30')](_0xb0e814[_0xb1c1('0x31')]);_0x2c6605[_0xb1c1('0x39')]=_[_0xb1c1('0x32')](_0x2c6605['model'],_0x2c6605[_0xb1c1('0x31')]);_0x1e91c7[_0xb1c1('0x34')]=_[_0xb1c1('0x32')](_0x2c6605['model'],qs[_0xb1c1('0x35')](_0xb0e814[_0xb1c1('0x31')][_0xb1c1('0x35')]));_0x1e91c7['attributes']=_0x1e91c7['attributes'][_0xb1c1('0x36')]?_0x1e91c7['attributes']:_0x2c6605[_0xb1c1('0x33')];_0x1e91c7[_0xb1c1('0x4f')]=qs[_0xb1c1('0x38')](_0xb0e814['query'][_0xb1c1('0x38')]);_0x1e91c7[_0xb1c1('0x3c')]=qs['filters'](_['pick'](_0xb0e814[_0xb1c1('0x31')],_0x2c6605['filters']));if(_0xb0e814['query'][_0xb1c1('0x3b')]){_0x1e91c7['where']=_[_0xb1c1('0x3d')](_0x1e91c7[_0xb1c1('0x3c')],{'$or':_['map'](_0x1e91c7[_0xb1c1('0x34')],function(_0x7670a9){var _0xf1094f={};_0xf1094f[_0x7670a9]={'$like':'%'+_0xb0e814[_0xb1c1('0x31')]['filter']+'%'};return _0xf1094f;})});}_0x1e91c7=_['merge']({},_0x1e91c7,_0xb0e814[_0xb1c1('0x46')]);return _0x18acd9[_0xb1c1('0x54')](_0x1e91c7);}})['then'](function(_0x413d83){if(_0x413d83){_0x1d95ec=_0x413d83[_0xb1c1('0x36')];if(!_0xb0e814[_0xb1c1('0x31')][_0xb1c1('0x50')](_0xb1c1('0x51'))){_0x1e91c7[_0xb1c1('0x37')]=qs[_0xb1c1('0x37')](_0xb0e814[_0xb1c1('0x31')][_0xb1c1('0x37')]);_0x1e91c7[_0xb1c1('0x1d')]=qs[_0xb1c1('0x1d')](_0xb0e814[_0xb1c1('0x31')][_0xb1c1('0x1d')]);}return _0x18acd9[_0xb1c1('0x54')](_0x1e91c7);}})[_0xb1c1('0x25')](function(_0x23a22e){if(_0x23a22e){return _0x23a22e?{'count':_0x1d95ec,'rows':_0x23a22e}:null;}})['then'](respondWithResult(_0x397abf,null))[_0xb1c1('0x42')](handleError(_0x397abf,null));};
\ No newline at end of file
+var _0x168e=['fields','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','catch','show','length','include','find','create','body','params','addConditions','ids','omit','getConditions','findOne','Condition','pick','hasOwnProperty','Action','addActions','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','offset','undefined','limit','set','Content-Range','json','apply','update','then','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x168e,0x1ea));var _0xe168=function(_0xfa0af,_0x21827e){_0xfa0af=_0xfa0af-0x0;var _0x3ee174=_0x168e[_0xfa0af];return _0x3ee174;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe168('0x0'));var rp=require(_0xe168('0x1'));var moment=require(_0xe168('0x2'));var BPromise=require(_0xe168('0x3'));var Mustache=require('mustache');var util=require(_0xe168('0x4'));var path=require(_0xe168('0x5'));var sox=require(_0xe168('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe168('0x7'));var _=require(_0xe168('0x8'));var squel=require(_0xe168('0x9'));var crypto=require(_0xe168('0xa'));var jsforce=require(_0xe168('0xb'));var deskjs=require(_0xe168('0xc'));var toCsv=require(_0xe168('0xd'));var querystring=require('querystring');var Papa=require(_0xe168('0xe'));var Redis=require(_0xe168('0xf'));var authService=require(_0xe168('0x10'));var qs=require(_0xe168('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe168('0x12'));var logger=require(_0xe168('0x13'))('api');var utils=require(_0xe168('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe168('0x15'))['db'];function respondWithStatusCode(_0x380416,_0x59858d){_0x59858d=_0x59858d||0xcc;return function(_0x4f3268){if(_0x4f3268){return _0x380416['sendStatus'](_0x59858d);}return _0x380416[_0xe168('0x16')](_0x59858d)[_0xe168('0x17')]();};}function respondWithResult(_0x21b11a,_0x2c7ced){_0x2c7ced=_0x2c7ced||0xc8;return function(_0x3d3e9c){if(_0x3d3e9c){return _0x21b11a['status'](_0x2c7ced)['json'](_0x3d3e9c);}};}function respondWithFilteredResult(_0x39adae,_0x480dff){return function(_0xdcd480){if(_0xdcd480){var _0x9088de=typeof _0x480dff[_0xe168('0x18')]===_0xe168('0x19')&&typeof _0x480dff[_0xe168('0x1a')]===_0xe168('0x19');var _0xf637d9=_0xdcd480['count'];var _0x226826=_0x9088de?0x0:_0x480dff[_0xe168('0x18')];var _0x11d64d=_0x9088de?_0xdcd480['count']:_0x480dff['offset']+_0x480dff[_0xe168('0x1a')];var _0x43624b;if(_0x11d64d>=_0xf637d9){_0x11d64d=_0xf637d9;_0x43624b=0xc8;}else{_0x43624b=0xce;}_0x39adae[_0xe168('0x16')](_0x43624b);return _0x39adae[_0xe168('0x1b')](_0xe168('0x1c'),_0x226826+'-'+_0x11d64d+'/'+_0xf637d9)[_0xe168('0x1d')](_0xdcd480);}return null;};}function patchUpdates(_0x55cd9a){return function(_0x2853f2){try{jsonpatch[_0xe168('0x1e')](_0x2853f2,_0x55cd9a,!![]);}catch(_0x60ef2a){return BPromise['reject'](_0x60ef2a);}return _0x2853f2['save']();};}function saveUpdates(_0x451184,_0x13a9c6){return function(_0x737651){if(_0x737651){return _0x737651[_0xe168('0x1f')](_0x451184)['then'](function(_0x266926){return _0x266926;});}return null;};}function removeEntity(_0x237711,_0x448241){return function(_0x3d3212){if(_0x3d3212){return _0x3d3212['destroy']()[_0xe168('0x20')](function(){_0x237711[_0xe168('0x16')](0xcc)[_0xe168('0x17')]();});}};}function handleEntityNotFound(_0x1188e5,_0x6749b3){return function(_0x2bf254){if(!_0x2bf254){_0x1188e5['sendStatus'](0x194);}return _0x2bf254;};}function handleError(_0x77aa18,_0x16c971){_0x16c971=_0x16c971||0x1f4;return function(_0x55f58b){logger[_0xe168('0x21')](_0x55f58b[_0xe168('0x22')]);if(_0x55f58b['name']){delete _0x55f58b[_0xe168('0x23')];}_0x77aa18[_0xe168('0x16')](_0x16c971)[_0xe168('0x24')](_0x55f58b);};}exports[_0xe168('0x25')]=function(_0x303046,_0x3da944){var _0x208202={},_0x1bfb68={},_0x390bdd={'count':0x0,'rows':[]};var _0x8bce3f=_[_0xe168('0x26')](db[_0xe168('0x27')][_0xe168('0x28')],function(_0x1e50b5){return{'name':_0x1e50b5[_0xe168('0x29')],'type':_0x1e50b5[_0xe168('0x2a')]['key']};});_0x1bfb68[_0xe168('0x2b')]=_[_0xe168('0x26')](_0x8bce3f,_0xe168('0x23'));_0x1bfb68['query']=_[_0xe168('0x2c')](_0x303046['query']);_0x1bfb68[_0xe168('0x2d')]=_[_0xe168('0x2e')](_0x1bfb68['model'],_0x1bfb68[_0xe168('0x2f')]);_0x208202[_0xe168('0x30')]=_['intersection'](_0x1bfb68[_0xe168('0x2b')],qs['fields'](_0x303046[_0xe168('0x2f')][_0xe168('0x31')]));_0x208202[_0xe168('0x30')]=_0x208202['attributes']['length']?_0x208202[_0xe168('0x30')]:_0x1bfb68['model'];if(!_0x303046[_0xe168('0x2f')]['hasOwnProperty'](_0xe168('0x32'))){_0x208202[_0xe168('0x1a')]=qs[_0xe168('0x1a')](_0x303046[_0xe168('0x2f')][_0xe168('0x1a')]);_0x208202[_0xe168('0x18')]=qs[_0xe168('0x18')](_0x303046[_0xe168('0x2f')][_0xe168('0x18')]);}_0x208202[_0xe168('0x33')]=qs[_0xe168('0x34')](_0x303046[_0xe168('0x2f')][_0xe168('0x34')]);_0x208202[_0xe168('0x35')]=qs[_0xe168('0x2d')](_['pick'](_0x303046['query'],_0x1bfb68[_0xe168('0x2d')]),_0x8bce3f);if(_0x303046[_0xe168('0x2f')][_0xe168('0x36')]){_0x208202[_0xe168('0x35')]=_[_0xe168('0x37')](_0x208202[_0xe168('0x35')],{'$or':_['map'](_0x8bce3f,function(_0x131250){if(_0x131250[_0xe168('0x2a')]!=='VIRTUAL'){var _0x51108f={};_0x51108f[_0x131250[_0xe168('0x23')]]={'$like':'%'+_0x303046[_0xe168('0x2f')][_0xe168('0x36')]+'%'};return _0x51108f;}})});}_0x208202=_['merge']({},_0x208202,_0x303046[_0xe168('0x38')]);var _0x53d1e5={'where':_0x208202[_0xe168('0x35')]};return db[_0xe168('0x27')]['count'](_0x53d1e5)[_0xe168('0x20')](function(_0x4364e5){_0x390bdd['count']=_0x4364e5;if(_0x303046[_0xe168('0x2f')][_0xe168('0x39')]){_0x208202['include']=[{'all':!![]}];}return db['Automation'][_0xe168('0x3a')](_0x208202);})[_0xe168('0x20')](function(_0x17fd43){_0x390bdd['rows']=_0x17fd43;return _0x390bdd;})[_0xe168('0x20')](respondWithFilteredResult(_0x3da944,_0x208202))[_0xe168('0x3b')](handleError(_0x3da944,null));};exports[_0xe168('0x3c')]=function(_0x58db54,_0xe279f2){var _0x34dfda={'raw':![],'where':{'id':_0x58db54['params']['id']}},_0x3bc349={};_0x3bc349[_0xe168('0x2b')]=_['keys'](db[_0xe168('0x27')][_0xe168('0x28')]);_0x3bc349[_0xe168('0x2f')]=_[_0xe168('0x2c')](_0x58db54[_0xe168('0x2f')]);_0x3bc349[_0xe168('0x2d')]=_[_0xe168('0x2e')](_0x3bc349['model'],_0x3bc349[_0xe168('0x2f')]);_0x34dfda[_0xe168('0x30')]=_['intersection'](_0x3bc349['model'],qs['fields'](_0x58db54[_0xe168('0x2f')][_0xe168('0x31')]));_0x34dfda[_0xe168('0x30')]=_0x34dfda[_0xe168('0x30')][_0xe168('0x3d')]?_0x34dfda['attributes']:_0x3bc349[_0xe168('0x2b')];if(_0x58db54[_0xe168('0x2f')]['includeAll']){_0x34dfda[_0xe168('0x3e')]=[{'all':!![]}];}_0x34dfda=_[_0xe168('0x37')]({},_0x34dfda,_0x58db54['options']);return db[_0xe168('0x27')][_0xe168('0x3f')](_0x34dfda)[_0xe168('0x20')](handleEntityNotFound(_0xe279f2,null))['then'](respondWithResult(_0xe279f2,null))[_0xe168('0x3b')](handleError(_0xe279f2,null));};exports[_0xe168('0x40')]=function(_0x290dea,_0x495a47){return db[_0xe168('0x27')]['create'](_0x290dea[_0xe168('0x41')],{})[_0xe168('0x20')](respondWithResult(_0x495a47,0xc9))[_0xe168('0x3b')](handleError(_0x495a47,null));};exports[_0xe168('0x1f')]=function(_0x2a1c7d,_0x31c221){if(_0x2a1c7d['body']['id']){delete _0x2a1c7d['body']['id'];}return db[_0xe168('0x27')][_0xe168('0x3f')]({'where':{'id':_0x2a1c7d[_0xe168('0x42')]['id']}})['then'](handleEntityNotFound(_0x31c221,null))['then'](saveUpdates(_0x2a1c7d['body'],null))[_0xe168('0x20')](respondWithResult(_0x31c221,null))[_0xe168('0x3b')](handleError(_0x31c221,null));};exports['destroy']=function(_0x37e691,_0x17d632){return db[_0xe168('0x27')]['find']({'where':{'id':_0x37e691[_0xe168('0x42')]['id']}})[_0xe168('0x20')](handleEntityNotFound(_0x17d632,null))['then'](removeEntity(_0x17d632,null))[_0xe168('0x3b')](handleError(_0x17d632,null));};exports[_0xe168('0x43')]=function(_0x1076d0,_0x5ae2f1,_0x2ec083){return db['Condition'][_0xe168('0x3f')]({'where':{'id':_0x1076d0['params']['id']}})[_0xe168('0x20')](handleEntityNotFound(_0x5ae2f1,null))[_0xe168('0x20')](function(_0x3bfb7e){if(_0x3bfb7e){return _0x3bfb7e['addConditions'](_0x1076d0[_0xe168('0x41')][_0xe168('0x44')],_[_0xe168('0x45')](_0x1076d0[_0xe168('0x41')],[_0xe168('0x44'),'id'])||{});}})['then'](respondWithResult(_0x5ae2f1,null))[_0xe168('0x3b')](handleError(_0x5ae2f1,null));};exports[_0xe168('0x46')]=function(_0x33ce7e,_0x40b930,_0x10a802){var _0x197262={};var _0xde48cb={};var _0x58f474;var _0x3b27e6;return db[_0xe168('0x27')][_0xe168('0x47')]({'where':{'id':_0x33ce7e[_0xe168('0x42')]['id']}})[_0xe168('0x20')](handleEntityNotFound(_0x40b930,null))[_0xe168('0x20')](function(_0x5669f5){if(_0x5669f5){_0x58f474=_0x5669f5;_0xde48cb[_0xe168('0x2b')]=_[_0xe168('0x2c')](db[_0xe168('0x48')][_0xe168('0x28')]);_0xde48cb[_0xe168('0x2f')]=_[_0xe168('0x2c')](_0x33ce7e[_0xe168('0x2f')]);_0xde48cb[_0xe168('0x2d')]=_[_0xe168('0x2e')](_0xde48cb[_0xe168('0x2b')],_0xde48cb[_0xe168('0x2f')]);_0x197262[_0xe168('0x30')]=_[_0xe168('0x2e')](_0xde48cb[_0xe168('0x2b')],qs[_0xe168('0x31')](_0x33ce7e['query'][_0xe168('0x31')]));_0x197262[_0xe168('0x30')]=_0x197262[_0xe168('0x30')][_0xe168('0x3d')]?_0x197262[_0xe168('0x30')]:_0xde48cb[_0xe168('0x2b')];_0x197262[_0xe168('0x33')]=qs[_0xe168('0x34')](_0x33ce7e[_0xe168('0x2f')][_0xe168('0x34')]);_0x197262[_0xe168('0x35')]=qs[_0xe168('0x2d')](_[_0xe168('0x49')](_0x33ce7e[_0xe168('0x2f')],_0xde48cb['filters']));if(_0x33ce7e['query']['filter']){_0x197262[_0xe168('0x35')]=_['merge'](_0x197262['where'],{'$or':_['map'](_0x197262[_0xe168('0x30')],function(_0x4a953a){var _0x1d10f1={};_0x1d10f1[_0x4a953a]={'$like':'%'+_0x33ce7e[_0xe168('0x2f')]['filter']+'%'};return _0x1d10f1;})});}_0x197262=_[_0xe168('0x37')]({},_0x197262,_0x33ce7e[_0xe168('0x38')]);return _0x58f474[_0xe168('0x46')](_0x197262);}})['then'](function(_0x3641ed){if(_0x3641ed){_0x3b27e6=_0x3641ed[_0xe168('0x3d')];if(!_0x33ce7e[_0xe168('0x2f')][_0xe168('0x4a')](_0xe168('0x32'))){_0x197262[_0xe168('0x1a')]=qs[_0xe168('0x1a')](_0x33ce7e['query']['limit']);_0x197262['offset']=qs[_0xe168('0x18')](_0x33ce7e[_0xe168('0x2f')][_0xe168('0x18')]);}return _0x58f474[_0xe168('0x46')](_0x197262);}})[_0xe168('0x20')](function(_0x2242a5){if(_0x2242a5){return _0x2242a5?{'count':_0x3b27e6,'rows':_0x2242a5}:null;}})['then'](respondWithResult(_0x40b930,null))[_0xe168('0x3b')](handleError(_0x40b930,null));};exports['addActions']=function(_0x3e172f,_0x42a844,_0x59e6ad){return db[_0xe168('0x4b')][_0xe168('0x3f')]({'where':{'id':_0x3e172f[_0xe168('0x42')]['id']}})['then'](handleEntityNotFound(_0x42a844,null))['then'](function(_0x294858){if(_0x294858){return _0x294858[_0xe168('0x4c')](_0x3e172f[_0xe168('0x41')][_0xe168('0x44')],_[_0xe168('0x45')](_0x3e172f[_0xe168('0x41')],[_0xe168('0x44'),'id'])||{});}})[_0xe168('0x20')](respondWithResult(_0x42a844,null))[_0xe168('0x3b')](handleError(_0x42a844,null));};exports['getActions']=function(_0x2f02a6,_0x4e5725,_0x23681b){var _0x550742={};var _0xd5618d={};var _0x3bae02;var _0x39f637;return db[_0xe168('0x27')][_0xe168('0x47')]({'where':{'id':_0x2f02a6[_0xe168('0x42')]['id']}})['then'](handleEntityNotFound(_0x4e5725,null))['then'](function(_0x38e457){if(_0x38e457){_0x3bae02=_0x38e457;_0xd5618d['model']=_[_0xe168('0x2c')](db[_0xe168('0x4b')][_0xe168('0x28')]);_0xd5618d[_0xe168('0x2f')]=_[_0xe168('0x2c')](_0x2f02a6[_0xe168('0x2f')]);_0xd5618d[_0xe168('0x2d')]=_[_0xe168('0x2e')](_0xd5618d['model'],_0xd5618d[_0xe168('0x2f')]);_0x550742['attributes']=_[_0xe168('0x2e')](_0xd5618d[_0xe168('0x2b')],qs[_0xe168('0x31')](_0x2f02a6[_0xe168('0x2f')][_0xe168('0x31')]));_0x550742[_0xe168('0x30')]=_0x550742[_0xe168('0x30')][_0xe168('0x3d')]?_0x550742['attributes']:_0xd5618d[_0xe168('0x2b')];_0x550742[_0xe168('0x33')]=qs['sort'](_0x2f02a6['query']['sort']);_0x550742[_0xe168('0x35')]=qs[_0xe168('0x2d')](_[_0xe168('0x49')](_0x2f02a6[_0xe168('0x2f')],_0xd5618d[_0xe168('0x2d')]));if(_0x2f02a6[_0xe168('0x2f')][_0xe168('0x36')]){_0x550742[_0xe168('0x35')]=_[_0xe168('0x37')](_0x550742[_0xe168('0x35')],{'$or':_[_0xe168('0x26')](_0x550742['attributes'],function(_0x147727){var _0x37ba73={};_0x37ba73[_0x147727]={'$like':'%'+_0x2f02a6[_0xe168('0x2f')][_0xe168('0x36')]+'%'};return _0x37ba73;})});}_0x550742=_['merge']({},_0x550742,_0x2f02a6[_0xe168('0x38')]);return _0x3bae02['getActions'](_0x550742);}})[_0xe168('0x20')](function(_0x125c17){if(_0x125c17){_0x39f637=_0x125c17['length'];if(!_0x2f02a6[_0xe168('0x2f')][_0xe168('0x4a')]('nolimit')){_0x550742['limit']=qs[_0xe168('0x1a')](_0x2f02a6[_0xe168('0x2f')][_0xe168('0x1a')]);_0x550742[_0xe168('0x18')]=qs[_0xe168('0x18')](_0x2f02a6[_0xe168('0x2f')]['offset']);}return _0x3bae02['getActions'](_0x550742);}})[_0xe168('0x20')](function(_0x2e36a1){if(_0x2e36a1){return _0x2e36a1?{'count':_0x39f637,'rows':_0x2e36a1}:null;}})[_0xe168('0x20')](respondWithResult(_0x4e5725,null))[_0xe168('0x3b')](handleError(_0x4e5725,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 54b1d54..b8a5a75 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 _0x2568=['tools_automations','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./automation.attributes','exports','define','Automation'];(function(_0x265773,_0x5d1b6e){var _0x4ed75d=function(_0x3b7ce7){while(--_0x3b7ce7){_0x265773['push'](_0x265773['shift']());}};_0x4ed75d(++_0x5d1b6e);}(_0x2568,0xa9));var _0x8256=function(_0x2ca322,_0x37f83f){_0x2ca322=_0x2ca322-0x0;var _0x509bca=_0x2568[_0x2ca322];return _0x509bca;};'use strict';var _=require('lodash');var util=require(_0x8256('0x0'));var logger=require(_0x8256('0x1'))(_0x8256('0x2'));var moment=require(_0x8256('0x3'));var BPromise=require('bluebird');var rp=require(_0x8256('0x4'));var fs=require('fs');var path=require(_0x8256('0x5'));var rimraf=require('rimraf');var config=require(_0x8256('0x6'));var attributes=require(_0x8256('0x7'));module[_0x8256('0x8')]=function(_0x26804e,_0x36d18b){return _0x26804e[_0x8256('0x9')](_0x8256('0xa'),attributes,{'tableName':_0x8256('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd45a=['api','moment','bluebird','path','rimraf','../../config/environment','./automation.attributes','define','tools_automations','lodash','util'];(function(_0x114f51,_0x418f91){var _0x23ba4b=function(_0x1a59d1){while(--_0x1a59d1){_0x114f51['push'](_0x114f51['shift']());}};_0x23ba4b(++_0x418f91);}(_0xd45a,0xcf));var _0xad45=function(_0x2ba36b,_0x254206){_0x2ba36b=_0x2ba36b-0x0;var _0x163030=_0xd45a[_0x2ba36b];return _0x163030;};'use strict';var _=require(_0xad45('0x0'));var util=require(_0xad45('0x1'));var logger=require('../../config/logger')(_0xad45('0x2'));var moment=require(_0xad45('0x3'));var BPromise=require(_0xad45('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xad45('0x5'));var rimraf=require(_0xad45('0x6'));var config=require(_0xad45('0x7'));var attributes=require(_0xad45('0x8'));module['exports']=function(_0x428708,_0x61b526){return _0x428708[_0xad45('0x9')]('Automation',attributes,{'tableName':_0xad45('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 91cc31a..44118ab 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 _0xf7d9=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x52fb0c,_0x97790b){var _0x11697d=function(_0x80af74){while(--_0x80af74){_0x52fb0c['push'](_0x52fb0c['shift']());}};_0x11697d(++_0x97790b);}(_0xf7d9,0x122));var _0x9f7d=function(_0x3523c5,_0x426d73){_0x3523c5=_0x3523c5-0x0;var _0x2f1beb=_0xf7d9[_0x3523c5];return _0x2f1beb;};'use strict';var _=require(_0x9f7d('0x0'));var util=require(_0x9f7d('0x1'));var moment=require(_0x9f7d('0x2'));var BPromise=require(_0x9f7d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f7d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f7d('0x5'))(_0x9f7d('0x6'));var config=require(_0x9f7d('0x7'));var jayson=require(_0x9f7d('0x8'));var client=jayson[_0x9f7d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4dc6b9,_0xf09259,_0x2333e8){return new BPromise(function(_0x218628,_0x2893a5){return client[_0x9f7d('0xa')](_0x4dc6b9,_0x2333e8)[_0x9f7d('0xb')](function(_0x5290e2){logger[_0x9f7d('0xc')](_0x9f7d('0xd'),_0xf09259,'request\x20sent');logger[_0x9f7d('0xe')](_0x9f7d('0xf'),_0xf09259,_0x9f7d('0x10'),JSON['stringify'](_0x5290e2));if(_0x5290e2[_0x9f7d('0x11')]){if(_0x5290e2[_0x9f7d('0x11')][_0x9f7d('0x12')]===0x1f4){logger[_0x9f7d('0x11')](_0x9f7d('0xd'),_0xf09259,_0x5290e2[_0x9f7d('0x11')]['message']);return _0x2893a5(_0x5290e2[_0x9f7d('0x11')][_0x9f7d('0x13')]);}logger[_0x9f7d('0x11')](_0x9f7d('0xd'),_0xf09259,_0x5290e2['error'][_0x9f7d('0x13')]);return _0x218628(_0x5290e2[_0x9f7d('0x11')][_0x9f7d('0x13')]);}else{logger[_0x9f7d('0xc')](_0x9f7d('0xd'),_0xf09259,_0x9f7d('0x10'));_0x218628(_0x5290e2[_0x9f7d('0x14')]['message']);}})['catch'](function(_0x402609){logger[_0x9f7d('0x11')](_0x9f7d('0xd'),_0xf09259,_0x402609);_0x2893a5(_0x402609);});});}
\ No newline at end of file
+var _0xd5fc=['info','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','Automation,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message'];(function(_0x34697c,_0x20ab9d){var _0x9db760=function(_0x49889f){while(--_0x49889f){_0x34697c['push'](_0x34697c['shift']());}};_0x9db760(++_0x20ab9d);}(_0xd5fc,0xae));var _0xcd5f=function(_0x13c3c2,_0x229f57){_0x13c3c2=_0x13c3c2-0x0;var _0xeea492=_0xd5fc[_0x13c3c2];return _0xeea492;};'use strict';var _=require(_0xcd5f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcd5f('0x1'));var fs=require('fs');var Redis=require(_0xcd5f('0x2'));var db=require(_0xcd5f('0x3'))['db'];var utils=require(_0xcd5f('0x4'));var logger=require(_0xcd5f('0x5'))(_0xcd5f('0x6'));var config=require('../../config/environment');var jayson=require(_0xcd5f('0x7'));var client=jayson['client'][_0xcd5f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x159b3f,_0x5af696,_0x58d65d){return new BPromise(function(_0x4e668e,_0x102ce9){return client['request'](_0x159b3f,_0x58d65d)[_0xcd5f('0x9')](function(_0x3e63d4){logger['info'](_0xcd5f('0xa'),_0x5af696,'request\x20sent');logger[_0xcd5f('0xb')]('Automation,\x20%s,\x20%s,\x20%s',_0x5af696,_0xcd5f('0xc'),JSON[_0xcd5f('0xd')](_0x3e63d4));if(_0x3e63d4[_0xcd5f('0xe')]){if(_0x3e63d4[_0xcd5f('0xe')]['code']===0x1f4){logger[_0xcd5f('0xe')](_0xcd5f('0xa'),_0x5af696,_0x3e63d4['error'][_0xcd5f('0xf')]);return _0x102ce9(_0x3e63d4[_0xcd5f('0xe')][_0xcd5f('0xf')]);}logger[_0xcd5f('0xe')](_0xcd5f('0xa'),_0x5af696,_0x3e63d4['error'][_0xcd5f('0xf')]);return _0x4e668e(_0x3e63d4[_0xcd5f('0xe')][_0xcd5f('0xf')]);}else{logger[_0xcd5f('0x10')](_0xcd5f('0xa'),_0x5af696,_0xcd5f('0xc'));_0x4e668e(_0x3e63d4[_0xcd5f('0x11')]['message']);}})[_0xcd5f('0x12')](function(_0x33ab1a){logger[_0xcd5f('0xe')](_0xcd5f('0xa'),_0x5af696,_0x33ab1a);_0x102ce9(_0x33ab1a);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index d4d0289..7f2472a 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 _0x5044=['../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/conditions','getActions','post','create','addConditions','/:id/actions','addActions','delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4ee5d1,_0x873e57){var _0x18bc14=function(_0xba1b9b){while(--_0xba1b9b){_0x4ee5d1['push'](_0x4ee5d1['shift']());}};_0x18bc14(++_0x873e57);}(_0x5044,0xc8));var _0x4504=function(_0x32032a,_0x24e8d1){_0x32032a=_0x32032a-0x0;var _0x5d5792=_0x5044[_0x32032a];return _0x5d5792;};'use strict';var multer=require('multer');var util=require(_0x4504('0x0'));var path=require('path');var timeout=require(_0x4504('0x1'));var express=require(_0x4504('0x2'));var router=express[_0x4504('0x3')]();var fs_extra=require(_0x4504('0x4'));var auth=require(_0x4504('0x5'));var interaction=require(_0x4504('0x6'));var config=require(_0x4504('0x7'));var controller=require(_0x4504('0x8'));router['get']('/',auth[_0x4504('0x9')](),controller[_0x4504('0xa')]);router[_0x4504('0xb')](_0x4504('0xc'),auth[_0x4504('0x9')](),controller[_0x4504('0xd')]);router[_0x4504('0xb')](_0x4504('0xe'),auth[_0x4504('0x9')](),controller['getConditions']);router[_0x4504('0xb')]('/:id/actions',auth[_0x4504('0x9')](),controller[_0x4504('0xf')]);router[_0x4504('0x10')]('/',auth[_0x4504('0x9')](),controller[_0x4504('0x11')]);router[_0x4504('0x10')](_0x4504('0xe'),auth[_0x4504('0x9')](),controller[_0x4504('0x12')]);router[_0x4504('0x10')](_0x4504('0x13'),auth[_0x4504('0x9')](),controller[_0x4504('0x14')]);router['put'](_0x4504('0xc'),auth[_0x4504('0x9')](),controller['update']);router[_0x4504('0x15')](_0x4504('0xc'),auth[_0x4504('0x9')](),controller[_0x4504('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x4f5a=['multer','util','connect-timeout','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/conditions','getConditions','post','create','addActions','put','delete','exports'];(function(_0x190323,_0x4e67dd){var _0x1f0899=function(_0x72e018){while(--_0x72e018){_0x190323['push'](_0x190323['shift']());}};_0x1f0899(++_0x4e67dd);}(_0x4f5a,0xaa));var _0xa4f5=function(_0x4a31c3,_0x442619){_0x4a31c3=_0x4a31c3-0x0;var _0x9047d7=_0x4f5a[_0x4a31c3];return _0x9047d7;};'use strict';var multer=require(_0xa4f5('0x0'));var util=require(_0xa4f5('0x1'));var path=require('path');var timeout=require(_0xa4f5('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa4f5('0x3'));var config=require(_0xa4f5('0x4'));var controller=require('./automation.controller');router[_0xa4f5('0x5')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa4f5('0x6'),auth[_0xa4f5('0x7')](),controller[_0xa4f5('0x8')]);router[_0xa4f5('0x5')](_0xa4f5('0x9'),auth['isAuthenticated'](),controller[_0xa4f5('0xa')]);router['get']('/:id/actions',auth[_0xa4f5('0x7')](),controller['getActions']);router[_0xa4f5('0xb')]('/',auth[_0xa4f5('0x7')](),controller[_0xa4f5('0xc')]);router[_0xa4f5('0xb')](_0xa4f5('0x9'),auth['isAuthenticated'](),controller['addConditions']);router[_0xa4f5('0xb')]('/:id/actions',auth[_0xa4f5('0x7')](),controller[_0xa4f5('0xd')]);router[_0xa4f5('0xe')](_0xa4f5('0x6'),auth[_0xa4f5('0x7')](),controller['update']);router[_0xa4f5('0xf')](_0xa4f5('0x6'),auth[_0xa4f5('0x7')](),controller['destroy']);module[_0xa4f5('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 974af81..3de1fa2 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 _0x5324=['ENUM','DESC','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\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)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length'];(function(_0x2a13f3,_0x38636a){var _0x8987ac=function(_0x4e9eef){while(--_0x4e9eef){_0x2a13f3['push'](_0x2a13f3['shift']());}};_0x8987ac(++_0x38636a);}(_0x5324,0x154));var _0x4532=function(_0x3e6f29,_0x4dda33){_0x3e6f29=_0x3e6f29-0x0;var _0xd8dd25=_0x5324[_0x3e6f29];return _0xd8dd25;};'use strict';var Sequelize=require(_0x4532('0x0'));module[_0x4532('0x1')]={'name':{'type':Sequelize[_0x4532('0x2')],'unique':_0x4532('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x4532('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x4532('0x2')]},'active':{'type':Sequelize[_0x4532('0x5')],'defaultValue':0x0,'comment':_0x4532('0x6')},'limitCalls':{'type':Sequelize[_0x4532('0x7')](0x4)[_0x4532('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x4532('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x4532('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4532('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x4532('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4532('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x4532('0x7')](0x3)[_0x4532('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4532('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x4532('0x7')](0x5)[_0x4532('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4532('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x4532('0x7')](0x3)[_0x4532('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4532('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x4532('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4532('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x4532('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x4532('0x7')](0x5)[_0x4532('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4532('0xf')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4532('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x4532('0x10')},'dialTimezone':{'type':Sequelize[_0x4532('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x4532('0x2')],'defaultValue':_0x4532('0x11')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always','never',_0x4532('0x12')),'defaultValue':_0x4532('0x13')},'dialAMDActive':{'type':Sequelize[_0x4532('0x5')],'defaultValue':0x0,'comment':_0x4532('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x4532('0x7')](0x9)[_0x4532('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4532('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x4532('0x7')](0x9)[_0x4532('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x4532('0x7')](0x9)[_0x4532('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4532('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x4532('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4532('0x17')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x4532('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4532('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4532('0x7')](0x9)[_0x4532('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x4532('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4532('0x7')](0x9)[_0x4532('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4532('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x4532('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4532('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x4532('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4532('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x4532('0x1d')](_0x4532('0x1e'),'ASC'),'defaultValue':_0x4532('0x1e')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4532('0x7')](0x3)[_0x4532('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4532('0x1f')},'dialCutDigit':{'type':Sequelize[_0x4532('0x7')](0x3)[_0x4532('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4532('0x20')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4532('0x7')](0x3)[_0x4532('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4532('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4532('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0x4532('0x7')](0x3)[_0x4532('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4532('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0x4532('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4532('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x4532('0x7')](0x3)[_0x4532('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4532('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4532('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4532('0x25')},'dialMachineMaxRetry':{'type':Sequelize[_0x4532('0x7')](0x3)[_0x4532('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4532('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x4532('0x7')](0x3)[_0x4532('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4532('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x4532('0x7')](0x5)[_0x4532('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4532('0x28')}};
\ No newline at end of file
+var _0x575d=['Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\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','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x575d,0xc8));var _0xd575=function(_0x36a83e,_0x2dfaaa){_0x36a83e=_0x36a83e-0x0;var _0x2d6049=_0x575d[_0x36a83e];return _0x2d6049;};'use strict';var Sequelize=require(_0xd575('0x0'));module[_0xd575('0x1')]={'name':{'type':Sequelize[_0xd575('0x2')],'unique':_0xd575('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd575('0x4')](_0xd575('0x5')),'allowNull':![],'defaultValue':_0xd575('0x5')},'description':{'type':Sequelize[_0xd575('0x2')]},'active':{'type':Sequelize[_0xd575('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xd575('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd575('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd575('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xd575('0x9')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd575('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd575('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd575('0x9')](0x5)[_0xd575('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xd575('0x9')](0x3)[_0xd575('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd575('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xd575('0x9')](0x5)[_0xd575('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd575('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd575('0x9')](0x3)[_0xd575('0x7')],'defaultValue':0x3,'comment':_0xd575('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd575('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd575('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xd575('0x9')](0x3)[_0xd575('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd575('0xf')},'dialTimezone':{'type':Sequelize[_0xd575('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xd575('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xd575('0x4')]('always',_0xd575('0x11'),_0xd575('0x12')),'defaultValue':_0xd575('0x13')},'dialAMDActive':{'type':Sequelize[_0xd575('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xd575('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xd575('0x9')](0x9)[_0xd575('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd575('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd575('0x9')](0x9)[_0xd575('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd575('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd575('0x9')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd575('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xd575('0x9')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd575('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd575('0x9')](0x9)[_0xd575('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd575('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd575('0x9')](0x9)[_0xd575('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd575('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd575('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd575('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd575('0x9')](0x9)[_0xd575('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd575('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd575('0x4')](_0xd575('0x1c'),_0xd575('0x1d')),'defaultValue':_0xd575('0x1c')},'dialPrefix':{'type':Sequelize[_0xd575('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xd575('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xd575('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd575('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd575('0x9')](0x3)[_0xd575('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd575('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd575('0x9')](0x5)[_0xd575('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd575('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xd575('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd575('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0xd575('0x9')](0x5)[_0xd575('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd575('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xd575('0x9')](0x3)[_0xd575('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd575('0x9')](0x5)[_0xd575('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xd575('0x9')](0x3)[_0xd575('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd575('0x23')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd575('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd575('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd575('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd575('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd575('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd575('0x26')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 348c385..5d794f0 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 _0xbaca=['save','then','get','sendStatus','error','stack','name','index','Campaign','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','merge','options','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','autoAssociation','rawAttributes','include','omit','createdAt','updatedAt','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','toString','phone\x20IS\x20NOT\x20NULL','from','phone\x20NOT\x20IN\x20(?)','CampaignId\x20=\x20?','into','cm_hopper','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','cmHopperId','ci.item','ci.OrderBY','cm_contact_has_items','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject'];(function(_0xa464a1,_0x4ec344){var _0x19e814=function(_0x37a871){while(--_0x37a871){_0xa464a1['push'](_0xa464a1['shift']());}};_0x19e814(++_0x4ec344);}(_0xbaca,0xfc));var _0xabac=function(_0x351b46,_0x26b265){_0x351b46=_0x351b46-0x0;var _0x1515df=_0xbaca[_0x351b46];return _0x1515df;};'use strict';var emlformat=require(_0xabac('0x0'));var rimraf=require(_0xabac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xabac('0x2'));var rp=require(_0xabac('0x3'));var moment=require('moment');var BPromise=require(_0xabac('0x4'));var Mustache=require('mustache');var util=require(_0xabac('0x5'));var path=require(_0xabac('0x6'));var sox=require(_0xabac('0x7'));var csv=require(_0xabac('0x8'));var ejs=require(_0xabac('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xabac('0xa'));var crypto=require(_0xabac('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xabac('0x8'));var querystring=require(_0xabac('0xc'));var Papa=require(_0xabac('0xd'));var Redis=require('ioredis');var authService=require(_0xabac('0xe'));var qs=require(_0xabac('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xabac('0x10'));var logger=require('../../config/logger')(_0xabac('0x11'));var utils=require(_0xabac('0x12'));var config=require(_0xabac('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xabac('0x14'))['db'];function respondWithStatusCode(_0xbd90d,_0x16f966){_0x16f966=_0x16f966||0xcc;return function(_0x5d9804){if(_0x5d9804){return _0xbd90d['sendStatus'](_0x16f966);}return _0xbd90d['status'](_0x16f966)[_0xabac('0x15')]();};}function respondWithResult(_0x40883b,_0x1484a4){_0x1484a4=_0x1484a4||0xc8;return function(_0x4e0a5){if(_0x4e0a5){return _0x40883b['status'](_0x1484a4)[_0xabac('0x16')](_0x4e0a5);}};}function respondWithFilteredResult(_0x3cbd4e,_0x267e31){return function(_0x3f54bc){if(_0x3f54bc){var _0x54381d=typeof _0x267e31[_0xabac('0x17')]===_0xabac('0x18')&&typeof _0x267e31[_0xabac('0x19')]===_0xabac('0x18');var _0x331da9=_0x3f54bc[_0xabac('0x1a')];var _0x3cd537=_0x54381d?0x0:_0x267e31['offset'];var _0x174d5b=_0x54381d?_0x3f54bc['count']:_0x267e31[_0xabac('0x17')]+_0x267e31[_0xabac('0x19')];var _0x42ccfb;if(_0x174d5b>=_0x331da9){_0x174d5b=_0x331da9;_0x42ccfb=0xc8;}else{_0x42ccfb=0xce;}_0x3cbd4e[_0xabac('0x1b')](_0x42ccfb);return _0x3cbd4e[_0xabac('0x1c')](_0xabac('0x1d'),_0x3cd537+'-'+_0x174d5b+'/'+_0x331da9)[_0xabac('0x16')](_0x3f54bc);}return null;};}function patchUpdates(_0x4313d7){return function(_0x42922d){try{jsonpatch[_0xabac('0x1e')](_0x42922d,_0x4313d7,!![]);}catch(_0x4ecae5){return BPromise[_0xabac('0x1f')](_0x4ecae5);}return _0x42922d[_0xabac('0x20')]();};}function saveUpdates(_0x459c84,_0x2b0586){return function(_0x3e8dc0){if(_0x3e8dc0){return _0x3e8dc0['update'](_0x459c84)[_0xabac('0x21')](function(_0x4ca55f){return _0x4ca55f;});}return null;};}function removeEntity(_0x5892f3,_0x159dc6){return function(_0xba977d){if(_0xba977d){return _0xba977d['destroy']()[_0xabac('0x21')](function(){var _0x55e6a5=_0xba977d[_0xabac('0x22')]({'plain':!![]});var _0x12d962='IvrCampaigns';return db['UserProfileResource']['destroy']({'where':{'type':_0x12d962,'resourceId':_0x55e6a5['id']}})[_0xabac('0x21')](function(){return _0xba977d;});})[_0xabac('0x21')](function(){_0x5892f3[_0xabac('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ec8a4,_0x62dd1e){return function(_0x191d7c){if(!_0x191d7c){_0x2ec8a4[_0xabac('0x23')](0x194);}return _0x191d7c;};}function handleError(_0x3471ab,_0x3e4a13){_0x3e4a13=_0x3e4a13||0x1f4;return function(_0xb34291){logger[_0xabac('0x24')](_0xb34291[_0xabac('0x25')]);if(_0xb34291[_0xabac('0x26')]){delete _0xb34291[_0xabac('0x26')];}_0x3471ab[_0xabac('0x1b')](_0x3e4a13)['send'](_0xb34291);};}exports[_0xabac('0x27')]=function(_0x5714d4,_0x3a624d){var _0xf2ada5={},_0x571024={},_0x308f6f={'count':0x0,'rows':[]};var _0x1eb6ee=_['map'](db[_0xabac('0x28')]['rawAttributes'],function(_0x46f2c0){return{'name':_0x46f2c0[_0xabac('0x29')],'type':_0x46f2c0['type'][_0xabac('0x2a')]};});_0x571024[_0xabac('0x2b')]=_['map'](_0x1eb6ee,_0xabac('0x26'));_0x571024[_0xabac('0x2c')]=_[_0xabac('0x2d')](_0x5714d4[_0xabac('0x2c')]);_0x571024[_0xabac('0x2e')]=_['intersection'](_0x571024[_0xabac('0x2b')],_0x571024[_0xabac('0x2c')]);_0xf2ada5['attributes']=_[_0xabac('0x2f')](_0x571024[_0xabac('0x2b')],qs[_0xabac('0x30')](_0x5714d4[_0xabac('0x2c')]['fields']));_0xf2ada5[_0xabac('0x31')]=_0xf2ada5[_0xabac('0x31')][_0xabac('0x32')]?_0xf2ada5[_0xabac('0x31')]:_0x571024[_0xabac('0x2b')];if(!_0x5714d4[_0xabac('0x2c')][_0xabac('0x33')](_0xabac('0x34'))){_0xf2ada5[_0xabac('0x19')]=qs[_0xabac('0x19')](_0x5714d4['query'][_0xabac('0x19')]);_0xf2ada5[_0xabac('0x17')]=qs[_0xabac('0x17')](_0x5714d4['query'][_0xabac('0x17')]);}_0xf2ada5[_0xabac('0x35')]=qs[_0xabac('0x36')](_0x5714d4[_0xabac('0x2c')][_0xabac('0x36')]);_0xf2ada5[_0xabac('0x37')]=qs[_0xabac('0x2e')](_[_0xabac('0x38')](_0x5714d4[_0xabac('0x2c')],_0x571024[_0xabac('0x2e')]),_0x1eb6ee);if(_0x5714d4[_0xabac('0x2c')][_0xabac('0x39')]){_0xf2ada5[_0xabac('0x37')]=_['merge'](_0xf2ada5[_0xabac('0x37')],{'$or':_[_0xabac('0x3a')](_0x1eb6ee,function(_0x1ab8e7){if(_0x1ab8e7[_0xabac('0x3b')]!==_0xabac('0x3c')){var _0x403b06={};_0x403b06[_0x1ab8e7[_0xabac('0x26')]]={'$like':'%'+_0x5714d4['query'][_0xabac('0x39')]+'%'};return _0x403b06;}})});}_0xf2ada5=_[_0xabac('0x3d')]({},_0xf2ada5,_0x5714d4[_0xabac('0x3e')]);var _0x39c157={'where':_0xf2ada5['where']};return db[_0xabac('0x28')][_0xabac('0x1a')](_0x39c157)[_0xabac('0x21')](function(_0x201d51){_0x308f6f[_0xabac('0x1a')]=_0x201d51;if(_0x5714d4['query']['includeAll']){_0xf2ada5['include']=[{'all':!![]}];}return db['Campaign'][_0xabac('0x3f')](_0xf2ada5);})[_0xabac('0x21')](function(_0x1bb9bf){_0x308f6f[_0xabac('0x40')]=_0x1bb9bf;return _0x308f6f;})[_0xabac('0x21')](respondWithFilteredResult(_0x3a624d,_0xf2ada5))[_0xabac('0x41')](handleError(_0x3a624d,null));};exports[_0xabac('0x42')]=function(_0x41ffcd,_0x1b3f34){var _0x4f7792={'raw':![],'where':{'id':_0x41ffcd[_0xabac('0x43')]['id']}},_0x354541={};_0x354541[_0xabac('0x2b')]=_['keys'](db[_0xabac('0x28')]['rawAttributes']);_0x354541[_0xabac('0x2c')]=_[_0xabac('0x2d')](_0x41ffcd[_0xabac('0x2c')]);_0x354541[_0xabac('0x2e')]=_[_0xabac('0x2f')](_0x354541[_0xabac('0x2b')],_0x354541[_0xabac('0x2c')]);_0x4f7792[_0xabac('0x31')]=_['intersection'](_0x354541[_0xabac('0x2b')],qs[_0xabac('0x30')](_0x41ffcd[_0xabac('0x2c')][_0xabac('0x30')]));_0x4f7792[_0xabac('0x31')]=_0x4f7792[_0xabac('0x31')][_0xabac('0x32')]?_0x4f7792[_0xabac('0x31')]:_0x354541[_0xabac('0x2b')];if(_0x41ffcd[_0xabac('0x2c')][_0xabac('0x44')]){_0x4f7792['include']=[{'all':!![]}];}_0x4f7792=_['merge']({},_0x4f7792,_0x41ffcd[_0xabac('0x3e')]);return db[_0xabac('0x28')][_0xabac('0x45')](_0x4f7792)[_0xabac('0x21')](handleEntityNotFound(_0x1b3f34,null))[_0xabac('0x21')](respondWithResult(_0x1b3f34,null))[_0xabac('0x41')](handleError(_0x1b3f34,null));};exports[_0xabac('0x46')]=function(_0x50ec3b,_0x50dd71){return db[_0xabac('0x28')][_0xabac('0x46')](_0x50ec3b[_0xabac('0x47')],{})[_0xabac('0x21')](function(_0x18449a){var _0x13227a=_0x50ec3b[_0xabac('0x48')][_0xabac('0x22')]({'plain':!![]});if(!_0x13227a)throw new Error(_0xabac('0x49'));if(_0x13227a[_0xabac('0x4a')]===_0xabac('0x48')){var _0x2af818=_0x18449a[_0xabac('0x22')]({'plain':!![]});var _0x199ab5=_0xabac('0x4b');return db[_0xabac('0x4c')][_0xabac('0x45')]({'where':{'name':_0x199ab5,'userProfileId':_0x13227a['userProfileId']},'raw':!![]})[_0xabac('0x21')](function(_0x54a04d){if(_0x54a04d&&_0x54a04d[_0xabac('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x2af818['name'],'resourceId':_0x2af818['id'],'type':_0x54a04d[_0xabac('0x26')],'sectionId':_0x54a04d['id']},{})['then'](function(){return _0x18449a;});}else{return _0x18449a;}})[_0xabac('0x41')](function(_0x1cb946){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1cb946);throw _0x1cb946;});}return _0x18449a;})[_0xabac('0x21')](respondWithResult(_0x50dd71,0xc9))[_0xabac('0x41')](handleError(_0x50dd71,null));};exports['clone']=function(_0x2edc16,_0x2e6b2e){var _0x1c5553={'where':{'id':_0x2edc16[_0xabac('0x43')]['id']}},_0xcc22ed={};_0xcc22ed[_0xabac('0x2b')]=_[_0xabac('0x2d')](db[_0xabac('0x28')][_0xabac('0x4e')]);_0x1c5553[_0xabac('0x31')]=_[_0xabac('0x2f')](_0xcc22ed[_0xabac('0x2b')],qs[_0xabac('0x30')](_0x2edc16[_0xabac('0x2c')][_0xabac('0x30')]));_0x1c5553[_0xabac('0x31')]=_0x1c5553[_0xabac('0x31')][_0xabac('0x32')]?_0x1c5553[_0xabac('0x31')]:_0xcc22ed[_0xabac('0x2b')];if(_0x2edc16[_0xabac('0x2c')][_0xabac('0x44')]){_0x1c5553[_0xabac('0x4f')]=[{'all':!![]}];}_0x1c5553=_['merge']({},_0x1c5553,_0x2edc16[_0xabac('0x3e')]);return db['Campaign'][_0xabac('0x45')](_0x1c5553)[_0xabac('0x21')](handleEntityNotFound(_0x2e6b2e,null))[_0xabac('0x21')](function(_0x3d6878){if(_0x3d6878){var _0x3f1b5a=_0x3d6878[_0xabac('0x22')]({'plain':!![]});_0x3f1b5a=qs[_0xabac('0x50')](_0x3f1b5a,['id',_0xabac('0x51'),_0xabac('0x52')]);_0x2edc16[_0xabac('0x47')]=_[_0xabac('0x50')](_0x2edc16[_0xabac('0x47')],['id','createdAt',_0xabac('0x52')]);return db[_0xabac('0x28')][_0xabac('0x46')](_[_0xabac('0x3d')](_0x3f1b5a,_0x2edc16[_0xabac('0x47')]),{'include':_0x2edc16['query'][_0xabac('0x44')]?[{'all':!![]}]:undefined})[_0xabac('0x21')](function(_0xf8ecbc){var _0x44ce6b=_0x2edc16[_0xabac('0x48')]['get']({'plain':!![]});if(!_0x44ce6b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x44ce6b[_0xabac('0x4a')]===_0xabac('0x48')){var _0x490821=_0xf8ecbc[_0xabac('0x22')]({'plain':!![]});var _0x6bc7a4=_0xabac('0x4b');return db[_0xabac('0x4c')][_0xabac('0x45')]({'where':{'name':_0x6bc7a4,'userProfileId':_0x44ce6b[_0xabac('0x53')]},'raw':!![]})[_0xabac('0x21')](function(_0x25e25e){if(_0x25e25e&&_0x25e25e[_0xabac('0x4d')]===0x0){return db['UserProfileResource'][_0xabac('0x46')]({'name':_0x490821[_0xabac('0x26')],'resourceId':_0x490821['id'],'type':_0x25e25e[_0xabac('0x26')],'sectionId':_0x25e25e['id']},{})[_0xabac('0x21')](function(){return _0xf8ecbc;});}else{return _0xf8ecbc;}})[_0xabac('0x41')](function(_0x2ed8ca){logger[_0xabac('0x24')](_0xabac('0x54'),_0x2ed8ca);throw _0x2ed8ca;});}return _0xf8ecbc;});}})[_0xabac('0x21')](respondWithResult(_0x2e6b2e,0xc9))[_0xabac('0x41')](handleError(_0x2e6b2e,null));};exports[_0xabac('0x55')]=function(_0x42cbef,_0xc1b4ae){if(_0x42cbef[_0xabac('0x47')]['id']){delete _0x42cbef['body']['id'];}return db[_0xabac('0x28')][_0xabac('0x45')]({'where':{'id':_0x42cbef['params']['id']}})[_0xabac('0x21')](handleEntityNotFound(_0xc1b4ae,null))[_0xabac('0x21')](saveUpdates(_0x42cbef[_0xabac('0x47')],null))[_0xabac('0x21')](respondWithResult(_0xc1b4ae,null))[_0xabac('0x41')](handleError(_0xc1b4ae,null));};exports[_0xabac('0x56')]=function(_0x5507b4,_0x7c45b1){return db[_0xabac('0x28')][_0xabac('0x45')]({'where':{'id':_0x5507b4[_0xabac('0x43')]['id']}})[_0xabac('0x21')](handleEntityNotFound(_0x7c45b1,null))[_0xabac('0x21')](removeEntity(_0x7c45b1,null))[_0xabac('0x41')](handleError(_0x7c45b1,null));};exports['getHoppers']=function(_0x2ac6a8,_0x3573c7,_0x889cf2){var _0x135057={'raw':!![],'where':{}};var _0x3aa068={};var _0x1d6b8e={'count':0x0,'rows':[]};return db[_0xabac('0x28')][_0xabac('0x57')]({'where':{'id':_0x2ac6a8[_0xabac('0x43')]['id']}})[_0xabac('0x21')](handleEntityNotFound(_0x3573c7,null))[_0xabac('0x21')](function(_0x30e525){if(_0x30e525){_0x3aa068['model']=_[_0xabac('0x2d')](db[_0xabac('0x58')][_0xabac('0x4e')]);_0x3aa068[_0xabac('0x2c')]=_[_0xabac('0x2d')](_0x2ac6a8[_0xabac('0x2c')]);_0x3aa068[_0xabac('0x2e')]=_[_0xabac('0x2f')](_0x3aa068[_0xabac('0x2b')],_0x3aa068[_0xabac('0x2c')]);_0x135057[_0xabac('0x31')]=_[_0xabac('0x2f')](_0x3aa068['model'],qs['fields'](_0x2ac6a8[_0xabac('0x2c')][_0xabac('0x30')]));_0x135057[_0xabac('0x31')]=_0x135057[_0xabac('0x31')][_0xabac('0x32')]?_0x135057[_0xabac('0x31')]:_0x3aa068[_0xabac('0x2b')];if(!_0x2ac6a8['query'][_0xabac('0x33')](_0xabac('0x34'))){_0x135057['limit']=qs[_0xabac('0x19')](_0x2ac6a8[_0xabac('0x2c')][_0xabac('0x19')]);_0x135057['offset']=qs['offset'](_0x2ac6a8['query'][_0xabac('0x17')]);}_0x135057[_0xabac('0x35')]=qs['sort'](_0x2ac6a8[_0xabac('0x2c')][_0xabac('0x36')]);_0x135057[_0xabac('0x37')]=qs[_0xabac('0x2e')](_[_0xabac('0x38')](_0x2ac6a8[_0xabac('0x2c')],_0x3aa068[_0xabac('0x2e')]));_0x135057[_0xabac('0x37')][_0xabac('0x59')]=_0x30e525['id'];if(_0x2ac6a8[_0xabac('0x2c')][_0xabac('0x39')]){_0x135057[_0xabac('0x37')]=_[_0xabac('0x3d')](_0x135057[_0xabac('0x37')],{'$or':_[_0xabac('0x3a')](_0x135057['attributes'],function(_0x23dd76){var _0x19448b={};_0x19448b[_0x23dd76]={'$like':'%'+_0x2ac6a8[_0xabac('0x2c')][_0xabac('0x39')]+'%'};return _0x19448b;})});}_0x135057=_[_0xabac('0x3d')]({},_0x135057,_0x2ac6a8['options']);return db[_0xabac('0x58')][_0xabac('0x1a')]({'where':_0x135057[_0xabac('0x37')]})['then'](function(_0x30be11){_0x1d6b8e[_0xabac('0x1a')]=_0x30be11;if(_0x2ac6a8[_0xabac('0x2c')]['includeAll']){_0x135057['include']=[{'all':!![]}];}return db[_0xabac('0x58')][_0xabac('0x3f')](_0x135057);})['then'](function(_0x34a827){_0x1d6b8e[_0xabac('0x40')]=_0x34a827;return _0x1d6b8e;});}})[_0xabac('0x21')](respondWithFilteredResult(_0x3573c7,_0x135057))['catch'](handleError(_0x3573c7,null));};exports[_0xabac('0x5a')]=function(_0x498dda,_0x4abe55,_0x2b9eba){var _0xa31a74={'raw':!![],'where':{}};var _0x39950c={};var _0x509ac1={'count':0x0,'rows':[]};return db[_0xabac('0x28')][_0xabac('0x57')]({'where':{'id':_0x498dda[_0xabac('0x43')]['id']}})[_0xabac('0x21')](handleEntityNotFound(_0x4abe55,null))[_0xabac('0x21')](function(_0x445a94){if(_0x445a94){_0x39950c['model']=_[_0xabac('0x2d')](db['CmHopperHistory'][_0xabac('0x4e')]);_0x39950c[_0xabac('0x2c')]=_['keys'](_0x498dda[_0xabac('0x2c')]);_0x39950c[_0xabac('0x2e')]=_[_0xabac('0x2f')](_0x39950c[_0xabac('0x2b')],_0x39950c[_0xabac('0x2c')]);_0xa31a74['attributes']=_['intersection'](_0x39950c['model'],qs[_0xabac('0x30')](_0x498dda[_0xabac('0x2c')][_0xabac('0x30')]));_0xa31a74['attributes']=_0xa31a74[_0xabac('0x31')][_0xabac('0x32')]?_0xa31a74[_0xabac('0x31')]:_0x39950c['model'];if(!_0x498dda[_0xabac('0x2c')]['hasOwnProperty'](_0xabac('0x34'))){_0xa31a74[_0xabac('0x19')]=qs['limit'](_0x498dda['query'][_0xabac('0x19')]);_0xa31a74[_0xabac('0x17')]=qs['offset'](_0x498dda[_0xabac('0x2c')]['offset']);}_0xa31a74[_0xabac('0x35')]=qs[_0xabac('0x36')](_0x498dda[_0xabac('0x2c')][_0xabac('0x36')]);_0xa31a74[_0xabac('0x37')]=qs[_0xabac('0x2e')](_[_0xabac('0x38')](_0x498dda['query'],_0x39950c[_0xabac('0x2e')]));_0xa31a74[_0xabac('0x37')]['CampaignId']=_0x445a94['id'];if(_0x498dda[_0xabac('0x2c')][_0xabac('0x39')]){_0xa31a74[_0xabac('0x37')]=_[_0xabac('0x3d')](_0xa31a74[_0xabac('0x37')],{'$or':_[_0xabac('0x3a')](_0xa31a74['attributes'],function(_0x4896b0){var _0x229c23={};_0x229c23[_0x4896b0]={'$like':'%'+_0x498dda[_0xabac('0x2c')]['filter']+'%'};return _0x229c23;})});}_0xa31a74=_['merge']({},_0xa31a74,_0x498dda[_0xabac('0x3e')]);return db[_0xabac('0x5b')][_0xabac('0x1a')]({'where':_0xa31a74[_0xabac('0x37')]})[_0xabac('0x21')](function(_0x3fe47f){_0x509ac1['count']=_0x3fe47f;if(_0x498dda['query']['includeAll']){_0xa31a74['include']=[{'all':!![]}];}return db[_0xabac('0x5b')]['findAll'](_0xa31a74);})[_0xabac('0x21')](function(_0x309125){_0x509ac1['rows']=_0x309125;return _0x509ac1;});}})[_0xabac('0x21')](respondWithFilteredResult(_0x4abe55,_0xa31a74))['catch'](handleError(_0x4abe55,null));};exports[_0xabac('0x5c')]=function(_0x1e10b6,_0x52cf62,_0x3dedae){var _0x168965={'raw':!![],'where':{}};var _0x5e445f={};var _0x4b8675={'count':0x0,'rows':[]};return db[_0xabac('0x28')][_0xabac('0x57')]({'where':{'id':_0x1e10b6[_0xabac('0x43')]['id']}})[_0xabac('0x21')](handleEntityNotFound(_0x52cf62,null))[_0xabac('0x21')](function(_0x3b4670){if(_0x3b4670){_0x5e445f['model']=_['keys'](db['CmHopperFinal'][_0xabac('0x4e')]);_0x5e445f[_0xabac('0x2c')]=_['keys'](_0x1e10b6[_0xabac('0x2c')]);_0x5e445f[_0xabac('0x2e')]=_['intersection'](_0x5e445f[_0xabac('0x2b')],_0x5e445f['query']);_0x168965[_0xabac('0x31')]=_[_0xabac('0x2f')](_0x5e445f[_0xabac('0x2b')],qs[_0xabac('0x30')](_0x1e10b6['query'][_0xabac('0x30')]));_0x168965[_0xabac('0x31')]=_0x168965[_0xabac('0x31')][_0xabac('0x32')]?_0x168965[_0xabac('0x31')]:_0x5e445f[_0xabac('0x2b')];if(!_0x1e10b6[_0xabac('0x2c')][_0xabac('0x33')]('nolimit')){_0x168965['limit']=qs[_0xabac('0x19')](_0x1e10b6[_0xabac('0x2c')][_0xabac('0x19')]);_0x168965['offset']=qs['offset'](_0x1e10b6[_0xabac('0x2c')][_0xabac('0x17')]);}_0x168965[_0xabac('0x35')]=qs[_0xabac('0x36')](_0x1e10b6[_0xabac('0x2c')]['sort']);_0x168965[_0xabac('0x37')]=qs[_0xabac('0x2e')](_[_0xabac('0x38')](_0x1e10b6[_0xabac('0x2c')],_0x5e445f[_0xabac('0x2e')]));_0x168965[_0xabac('0x37')][_0xabac('0x59')]=_0x3b4670['id'];if(_0x1e10b6[_0xabac('0x2c')][_0xabac('0x39')]){_0x168965[_0xabac('0x37')]=_[_0xabac('0x3d')](_0x168965['where'],{'$or':_[_0xabac('0x3a')](_0x168965[_0xabac('0x31')],function(_0x3affbc){var _0x3da961={};_0x3da961[_0x3affbc]={'$like':'%'+_0x1e10b6[_0xabac('0x2c')]['filter']+'%'};return _0x3da961;})});}_0x168965=_[_0xabac('0x3d')]({},_0x168965,_0x1e10b6[_0xabac('0x3e')]);return db['CmHopperFinal'][_0xabac('0x1a')]({'where':_0x168965[_0xabac('0x37')]})[_0xabac('0x21')](function(_0x19c2da){_0x4b8675[_0xabac('0x1a')]=_0x19c2da;if(_0x1e10b6[_0xabac('0x2c')][_0xabac('0x44')]){_0x168965[_0xabac('0x4f')]=[{'all':!![]}];}return db[_0xabac('0x5d')][_0xabac('0x3f')](_0x168965);})[_0xabac('0x21')](function(_0x1a7ba1){_0x4b8675[_0xabac('0x40')]=_0x1a7ba1;return _0x4b8675;});}})[_0xabac('0x21')](respondWithFilteredResult(_0x52cf62,_0x168965))[_0xabac('0x41')](handleError(_0x52cf62,null));};exports[_0xabac('0x5e')]=function(_0x3223cc,_0x5e96cb,_0x2b6b16){var _0x24d29c={'raw':!![],'where':{}};var _0x2e0c6f={};var _0x4e38ff={'count':0x0,'rows':[]};return db[_0xabac('0x28')][_0xabac('0x57')]({'where':{'id':_0x3223cc[_0xabac('0x43')]['id']}})['then'](handleEntityNotFound(_0x5e96cb,null))['then'](function(_0x1d4d87){if(_0x1d4d87){_0x2e0c6f[_0xabac('0x2b')]=_[_0xabac('0x2d')](db['CmHopperBlack']['rawAttributes']);_0x2e0c6f['query']=_[_0xabac('0x2d')](_0x3223cc[_0xabac('0x2c')]);_0x2e0c6f['filters']=_['intersection'](_0x2e0c6f['model'],_0x2e0c6f[_0xabac('0x2c')]);_0x24d29c[_0xabac('0x31')]=_[_0xabac('0x2f')](_0x2e0c6f[_0xabac('0x2b')],qs[_0xabac('0x30')](_0x3223cc['query'][_0xabac('0x30')]));_0x24d29c['attributes']=_0x24d29c[_0xabac('0x31')][_0xabac('0x32')]?_0x24d29c['attributes']:_0x2e0c6f[_0xabac('0x2b')];if(!_0x3223cc[_0xabac('0x2c')]['hasOwnProperty'](_0xabac('0x34'))){_0x24d29c['limit']=qs[_0xabac('0x19')](_0x3223cc[_0xabac('0x2c')][_0xabac('0x19')]);_0x24d29c[_0xabac('0x17')]=qs[_0xabac('0x17')](_0x3223cc[_0xabac('0x2c')][_0xabac('0x17')]);}_0x24d29c[_0xabac('0x35')]=qs[_0xabac('0x36')](_0x3223cc[_0xabac('0x2c')][_0xabac('0x36')]);_0x24d29c[_0xabac('0x37')]=qs['filters'](_[_0xabac('0x38')](_0x3223cc[_0xabac('0x2c')],_0x2e0c6f[_0xabac('0x2e')]));_0x24d29c[_0xabac('0x37')][_0xabac('0x59')]=_0x1d4d87['id'];if(_0x3223cc[_0xabac('0x2c')][_0xabac('0x39')]){_0x24d29c[_0xabac('0x37')]=_['merge'](_0x24d29c[_0xabac('0x37')],{'$or':_[_0xabac('0x3a')](_0x24d29c[_0xabac('0x31')],function(_0x379fd0){var _0x52c45c={};_0x52c45c[_0x379fd0]={'$like':'%'+_0x3223cc[_0xabac('0x2c')][_0xabac('0x39')]+'%'};return _0x52c45c;})});}_0x24d29c=_['merge']({},_0x24d29c,_0x3223cc[_0xabac('0x3e')]);return db[_0xabac('0x5f')][_0xabac('0x1a')]({'where':_0x24d29c[_0xabac('0x37')]})[_0xabac('0x21')](function(_0x5dbb72){_0x4e38ff['count']=_0x5dbb72;if(_0x3223cc['query'][_0xabac('0x44')]){_0x24d29c[_0xabac('0x4f')]=[{'all':!![]}];}return db[_0xabac('0x5f')][_0xabac('0x3f')](_0x24d29c);})[_0xabac('0x21')](function(_0xe37d20){_0x4e38ff[_0xabac('0x40')]=_0xe37d20;return _0x4e38ff;});}})[_0xabac('0x21')](respondWithFilteredResult(_0x5e96cb,_0x24d29c))['catch'](handleError(_0x5e96cb,null));};exports[_0xabac('0x60')]=function(_0x330324,_0x413f0e,_0x467f73){var _0x51c300={};var _0x2ab4bc={};var _0x2c272f;var _0x37a1bc;return db['Campaign']['findOne']({'where':{'id':_0x330324['params']['id']}})['then'](handleEntityNotFound(_0x413f0e,null))[_0xabac('0x21')](function(_0x1e8064){if(_0x1e8064){_0x2c272f=_0x1e8064;_0x2ab4bc['model']=_['keys'](db[_0xabac('0x61')][_0xabac('0x4e')]);_0x2ab4bc[_0xabac('0x2c')]=_[_0xabac('0x2d')](_0x330324[_0xabac('0x2c')]);_0x2ab4bc[_0xabac('0x2e')]=_['intersection'](_0x2ab4bc['model'],_0x2ab4bc[_0xabac('0x2c')]);_0x51c300[_0xabac('0x31')]=_[_0xabac('0x2f')](_0x2ab4bc['model'],qs['fields'](_0x330324[_0xabac('0x2c')]['fields']));_0x51c300[_0xabac('0x31')]=_0x51c300['attributes']['length']?_0x51c300[_0xabac('0x31')]:_0x2ab4bc[_0xabac('0x2b')];_0x51c300[_0xabac('0x35')]=qs[_0xabac('0x36')](_0x330324['query']['sort']);_0x51c300[_0xabac('0x37')]=qs[_0xabac('0x2e')](_[_0xabac('0x38')](_0x330324[_0xabac('0x2c')],_0x2ab4bc[_0xabac('0x2e')]));if(_0x330324[_0xabac('0x2c')][_0xabac('0x39')]){_0x51c300['where']=_[_0xabac('0x3d')](_0x51c300[_0xabac('0x37')],{'$or':_[_0xabac('0x3a')](_0x51c300[_0xabac('0x31')],function(_0x2effdd){var _0x2ce3d3={};_0x2ce3d3[_0x2effdd]={'$like':'%'+_0x330324[_0xabac('0x2c')][_0xabac('0x39')]+'%'};return _0x2ce3d3;})});}_0x51c300=_[_0xabac('0x3d')]({},_0x51c300,_0x330324['options']);return _0x2c272f[_0xabac('0x60')](_0x51c300);}})[_0xabac('0x21')](function(_0x5abf97){if(_0x5abf97){_0x37a1bc=_0x5abf97[_0xabac('0x32')];if(!_0x330324[_0xabac('0x2c')]['hasOwnProperty']('nolimit')){_0x51c300[_0xabac('0x19')]=qs[_0xabac('0x19')](_0x330324[_0xabac('0x2c')][_0xabac('0x19')]);_0x51c300[_0xabac('0x17')]=qs[_0xabac('0x17')](_0x330324[_0xabac('0x2c')]['offset']);}return _0x2c272f[_0xabac('0x60')](_0x51c300);}})[_0xabac('0x21')](function(_0x532ebe){if(_0x532ebe){return _0x532ebe?{'count':_0x37a1bc,'rows':_0x532ebe}:null;}})[_0xabac('0x21')](respondWithResult(_0x413f0e,null))['catch'](handleError(_0x413f0e,null));};exports[_0xabac('0x62')]=function(_0x70d28d,_0x5a790f,_0x24853c){var _0x5c5415,_0x33bad0;var _0x3da35c=[];var _0x2c0caa=moment()[_0xabac('0x63')](_0xabac('0x64'));return db[_0xabac('0x28')][_0xabac('0x45')]({'where':{'id':_0x70d28d['params']['id']}})[_0xabac('0x21')](handleEntityNotFound(_0x5a790f,null))[_0xabac('0x21')](function(_0x26b5f2){if(_0x26b5f2){_0x33bad0=_0x26b5f2;return _0x26b5f2[_0xabac('0x62')](_0x70d28d[_0xabac('0x47')][_0xabac('0x65')],_[_0xabac('0x50')](_0x70d28d[_0xabac('0x47')],['ids','id'])||{});}return null;})[_0xabac('0x66')](function(_0x2f683){var _0x14fe10;var _0x4d86da;_0x5c5415=_0x2f683||[];var _0x507448=[];if(_0x2f683){for(var _0x39d47b=0x0;_0x39d47b<_0x2f683['length'];_0x39d47b+=0x1){var _0x56145f=_0x2f683[_0x39d47b]['get']({'plain':!![]});_0x33bad0['dialCheckDuplicateType']=_0x70d28d['body'][_0xabac('0x67')]?_0x70d28d['body'][_0xabac('0x67')]:_0x33bad0[_0xabac('0x67')];switch(_0x33bad0[_0xabac('0x67')]){case _0xabac('0x68'):_0x14fe10=squel[_0xabac('0x69')]()['into']('cm_hopper')[_0xabac('0x6a')]([_0xabac('0x6b'),_0xabac('0x6c'),_0xabac('0x6d'),_0xabac('0x6e'),_0xabac('0x59'),'createdAt',_0xabac('0x52')],squel[_0xabac('0x6f')]()['field'](_0xabac('0x6b'),_0xabac('0x6b'))[_0xabac('0x70')](_0xabac('0x71'),_0xabac('0x6c'))[_0xabac('0x70')]('id',_0xabac('0x6d'))[_0xabac('0x70')](_0x56145f[_0xabac('0x72')]['toString'](),_0xabac('0x6e'))[_0xabac('0x70')](_0x70d28d[_0xabac('0x43')]['id']['toString'](),'CampaignId')['field']('\x27'+_0x2c0caa+'\x27',_0xabac('0x51'))[_0xabac('0x70')]('\x27'+_0x2c0caa+'\x27',_0xabac('0x52'))['from'](_0xabac('0x73'))[_0xabac('0x37')](_0xabac('0x74'))[_0xabac('0x37')](_0xabac('0x75'),_0x56145f['CmListId'][_0xabac('0x76')]())[_0xabac('0x37')](_0xabac('0x77'))[_0xabac('0x37')]('phone\x20NOT\x20IN\x20(?)',squel[_0xabac('0x6f')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0xabac('0x78')]('cm_hopper_final')[_0xabac('0x37')]('CampaignId\x20=\x20?',_0x70d28d[_0xabac('0x43')]['id'][_0xabac('0x76')]()))[_0xabac('0x37')](_0xabac('0x79'),squel[_0xabac('0x6f')]()[_0xabac('0x70')]('COALESCE(phone,\x27\x27)')[_0xabac('0x78')]('cm_hopper')[_0xabac('0x37')](_0xabac('0x7a'),_0x70d28d[_0xabac('0x43')]['id'][_0xabac('0x76')]())))[_0xabac('0x76')]();break;case'onlyIfOpen':_0x14fe10=squel[_0xabac('0x69')]()[_0xabac('0x7b')](_0xabac('0x7c'))[_0xabac('0x6a')](['phone',_0xabac('0x6c'),_0xabac('0x6d'),_0xabac('0x6e'),_0xabac('0x59'),_0xabac('0x51'),_0xabac('0x52')],squel['select']()[_0xabac('0x70')]('phone','phone')[_0xabac('0x70')](_0xabac('0x71'),_0xabac('0x6c'))['field']('id',_0xabac('0x6d'))['field'](_0x56145f['CmListId'][_0xabac('0x76')](),_0xabac('0x6e'))[_0xabac('0x70')](_0x70d28d[_0xabac('0x43')]['id']['toString'](),_0xabac('0x59'))[_0xabac('0x70')]('\x27'+_0x2c0caa+'\x27',_0xabac('0x51'))[_0xabac('0x70')]('\x27'+_0x2c0caa+'\x27',_0xabac('0x52'))[_0xabac('0x78')](_0xabac('0x73'))[_0xabac('0x37')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x56145f[_0xabac('0x72')][_0xabac('0x76')]())[_0xabac('0x37')](_0xabac('0x77'))[_0xabac('0x37')](_0xabac('0x79'),squel[_0xabac('0x6f')]()['field'](_0xabac('0x7d'))['from']('cm_hopper')[_0xabac('0x37')](_0xabac('0x7a'),_0x70d28d[_0xabac('0x43')]['id']['toString']())))['toString']();break;default:_0x14fe10=squel[_0xabac('0x69')]()[_0xabac('0x7b')](_0xabac('0x7c'))[_0xabac('0x6a')](['phone','scheduledAt',_0xabac('0x6d'),_0xabac('0x6e'),_0xabac('0x59'),_0xabac('0x51'),'updatedAt'],squel['select']()[_0xabac('0x70')](_0xabac('0x6b'),_0xabac('0x6b'))['field']('NOW()',_0xabac('0x6c'))['field']('id',_0xabac('0x6d'))[_0xabac('0x70')](_0x56145f[_0xabac('0x72')]['toString'](),'ListId')[_0xabac('0x70')](_0x70d28d[_0xabac('0x43')]['id'][_0xabac('0x76')](),_0xabac('0x59'))[_0xabac('0x70')]('\x27'+_0x2c0caa+'\x27','createdAt')[_0xabac('0x70')]('\x27'+_0x2c0caa+'\x27',_0xabac('0x52'))['from'](_0xabac('0x73'))[_0xabac('0x37')](_0xabac('0x74'))[_0xabac('0x37')](_0xabac('0x75'),_0x56145f[_0xabac('0x72')]['toString']())['where'](_0xabac('0x77')))[_0xabac('0x76')]();}_0x4d86da=squel[_0xabac('0x69')]()[_0xabac('0x7b')](_0xabac('0x7e'))[_0xabac('0x6a')]([_0xabac('0x7f'),_0xabac('0x6c'),_0xabac('0x6b'),'OrderBy','createdAt',_0xabac('0x52')],squel[_0xabac('0x6f')]()[_0xabac('0x70')]('h.id','id')['field'](_0xabac('0x71'),'scheduledAt')['field'](_0xabac('0x80'),_0xabac('0x6b'))[_0xabac('0x70')](_0xabac('0x81'),'OrderBy')['field']('\x27'+_0x2c0caa+'\x27',_0xabac('0x51'))[_0xabac('0x70')]('\x27'+_0x2c0caa+'\x27',_0xabac('0x52'))['from'](_0xabac('0x82'),'ci')['join'](_0xabac('0x7c'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0xabac('0x37')](_0xabac('0x83'),_0x56145f[_0xabac('0x72')]['toString']())[_0xabac('0x37')](_0xabac('0x84'),_0x70d28d[_0xabac('0x43')]['id'][_0xabac('0x76')]())[_0xabac('0x37')](_0xabac('0x85'),_0x2c0caa))[_0xabac('0x76')]();_0x507448[_0xabac('0x86')](db[_0xabac('0x87')]['query'](_0x14fe10));_0x3da35c[_0xabac('0x86')](db[_0xabac('0x87')][_0xabac('0x2c')](_0x4d86da));}return BPromise['all'](_0x507448);}})[_0xabac('0x21')](function(){return BPromise[_0xabac('0x88')](_0x3da35c);})[_0xabac('0x21')](function(){return _0x5c5415;})[_0xabac('0x21')](respondWithResult(_0x5a790f,null))['catch'](handleError(_0x5a790f,null));};exports[_0xabac('0x89')]=function(_0x3fe4cd,_0x1852db,_0x17b65d){return db[_0xabac('0x28')][_0xabac('0x45')]({'where':{'id':_0x3fe4cd['params']['id']}})[_0xabac('0x21')](handleEntityNotFound(_0x1852db,null))[_0xabac('0x21')](function(_0x3490ee){if(_0x3490ee){return _0x3490ee[_0xabac('0x89')](_0x3fe4cd[_0xabac('0x2c')][_0xabac('0x65')]);}})['then'](function(_0x512838){if(_0x512838){return db['CmHopper'][_0xabac('0x56')]({'where':{'ListId':_0x3fe4cd[_0xabac('0x2c')][_0xabac('0x65')],'CampaignId':_0x3fe4cd[_0xabac('0x43')]['id']}})[_0xabac('0x21')](function(){return _0x512838;});}})[_0xabac('0x21')](respondWithStatusCode(_0x1852db,null))[_0xabac('0x41')](handleError(_0x1852db,null));};exports[_0xabac('0x8a')]=function(_0xcf8beb,_0x3bdc03,_0x24f177){var _0x189bc3={};var _0x5b1034={};var _0x557670;var _0x11cb24;return db[_0xabac('0x28')]['findOne']({'where':{'id':_0xcf8beb['params']['id']}})[_0xabac('0x21')](handleEntityNotFound(_0x3bdc03,null))[_0xabac('0x21')](function(_0x182471){if(_0x182471){_0x557670=_0x182471;_0x5b1034[_0xabac('0x2b')]=_[_0xabac('0x2d')](db['CmList'][_0xabac('0x4e')]);_0x5b1034[_0xabac('0x2c')]=_[_0xabac('0x2d')](_0xcf8beb['query']);_0x5b1034[_0xabac('0x2e')]=_[_0xabac('0x2f')](_0x5b1034[_0xabac('0x2b')],_0x5b1034[_0xabac('0x2c')]);_0x189bc3[_0xabac('0x31')]=_['intersection'](_0x5b1034['model'],qs[_0xabac('0x30')](_0xcf8beb['query']['fields']));_0x189bc3[_0xabac('0x31')]=_0x189bc3['attributes'][_0xabac('0x32')]?_0x189bc3[_0xabac('0x31')]:_0x5b1034['model'];_0x189bc3['order']=qs[_0xabac('0x36')](_0xcf8beb[_0xabac('0x2c')][_0xabac('0x36')]);_0x189bc3['where']=qs[_0xabac('0x2e')](_[_0xabac('0x38')](_0xcf8beb['query'],_0x5b1034['filters']));if(_0xcf8beb[_0xabac('0x2c')][_0xabac('0x39')]){_0x189bc3['where']=_[_0xabac('0x3d')](_0x189bc3[_0xabac('0x37')],{'$or':_[_0xabac('0x3a')](_0x189bc3[_0xabac('0x31')],function(_0xc5242e){var _0x36d829={};_0x36d829[_0xc5242e]={'$like':'%'+_0xcf8beb['query'][_0xabac('0x39')]+'%'};return _0x36d829;})});}_0x189bc3=_[_0xabac('0x3d')]({},_0x189bc3,_0xcf8beb[_0xabac('0x3e')]);return _0x557670['getBlackLists'](_0x189bc3);}})['then'](function(_0x16c0cf){if(_0x16c0cf){_0x11cb24=_0x16c0cf['length'];if(!_0xcf8beb[_0xabac('0x2c')][_0xabac('0x33')](_0xabac('0x34'))){_0x189bc3[_0xabac('0x19')]=qs[_0xabac('0x19')](_0xcf8beb['query']['limit']);_0x189bc3[_0xabac('0x17')]=qs[_0xabac('0x17')](_0xcf8beb[_0xabac('0x2c')][_0xabac('0x17')]);}return _0x557670[_0xabac('0x8a')](_0x189bc3);}})[_0xabac('0x21')](function(_0x4ed552){if(_0x4ed552){return _0x4ed552?{'count':_0x11cb24,'rows':_0x4ed552}:null;}})[_0xabac('0x21')](respondWithResult(_0x3bdc03,null))['catch'](handleError(_0x3bdc03,null));};exports[_0xabac('0x8b')]=function(_0x155341,_0xc44f98,_0x55c34d){var _0x277b6b,_0x48b17a;var _0x21fcd8=[];var _0x5bd78b=moment()[_0xabac('0x63')](_0xabac('0x64'));return db[_0xabac('0x28')][_0xabac('0x45')]({'where':{'id':_0x155341[_0xabac('0x43')]['id']}})['then'](handleEntityNotFound(_0xc44f98,null))[_0xabac('0x21')](function(_0x41559e){if(_0x41559e){_0x48b17a=_0x41559e;return _0x41559e[_0xabac('0x8b')](_0x155341[_0xabac('0x47')][_0xabac('0x65')],_[_0xabac('0x50')](_0x155341['body'],[_0xabac('0x65'),'id'])||{});}return null;})['spread'](function(_0x3e237f){var _0x20446d;var _0x2d0fb0;_0x277b6b=_0x3e237f||[];var _0x37bfac=[];if(_0x3e237f){for(var _0x3316b6=0x0;_0x3316b6<_0x3e237f[_0xabac('0x32')];_0x3316b6+=0x1){var _0x3640f5=_0x3e237f[_0x3316b6][_0xabac('0x22')]({'plain':!![]});_0x20446d=squel['insert']()[_0xabac('0x7b')](_0xabac('0x8c'))[_0xabac('0x6a')]([_0xabac('0x6b'),_0xabac('0x6d'),_0xabac('0x6e'),_0xabac('0x59'),_0xabac('0x51'),_0xabac('0x52')],squel[_0xabac('0x6f')]()[_0xabac('0x70')](_0xabac('0x6b'),_0xabac('0x6b'))[_0xabac('0x70')]('id',_0xabac('0x6d'))['field'](_0x3640f5[_0xabac('0x72')][_0xabac('0x76')](),_0xabac('0x6e'))[_0xabac('0x70')](_0x155341[_0xabac('0x43')]['id']['toString'](),_0xabac('0x59'))[_0xabac('0x70')](_0xabac('0x71'),_0xabac('0x51'))[_0xabac('0x70')]('NOW()',_0xabac('0x52'))[_0xabac('0x78')](_0xabac('0x73'))[_0xabac('0x37')]('deletedAt\x20IS\x20NULL')[_0xabac('0x37')](_0xabac('0x75'),_0x3640f5['CmListId'][_0xabac('0x76')]())['where'](_0xabac('0x77')))['toString']();_0x37bfac[_0xabac('0x86')](db['sequelize'][_0xabac('0x2c')](_0x20446d));}return BPromise['all'](_0x37bfac);}})[_0xabac('0x21')](function(){return _0x277b6b;})['then'](respondWithResult(_0xc44f98,null))[_0xabac('0x41')](handleError(_0xc44f98,null));};exports[_0xabac('0x8d')]=function(_0x5cffca,_0x350f7b,_0x10f24d){return db[_0xabac('0x28')][_0xabac('0x45')]({'where':{'id':_0x5cffca[_0xabac('0x43')]['id']}})[_0xabac('0x21')](handleEntityNotFound(_0x350f7b,null))['then'](function(_0x1c9d3f){if(_0x1c9d3f){return _0x1c9d3f['removeBlackLists'](_0x5cffca['query'][_0xabac('0x65')]);}})['then'](function(_0x472f3f){if(_0x472f3f){return db[_0xabac('0x5f')][_0xabac('0x56')]({'where':{'ListId':_0x5cffca[_0xabac('0x2c')][_0xabac('0x65')],'CampaignId':_0x5cffca[_0xabac('0x43')]['id']}})[_0xabac('0x21')](function(){return _0x472f3f;});}})[_0xabac('0x21')](respondWithStatusCode(_0x350f7b,null))[_0xabac('0x41')](handleError(_0x350f7b,null));};
\ No newline at end of file
+var _0x5453=['Campaign','rawAttributes','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','UserProfileSection','error','getHoppers','CmHopper','CampaignId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','field','phone','NOW()','CmListId','toString','from','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','insert','cm_contacts','deletedAt\x20IS\x20NULL','cmHopperId','OrderBy','h.id','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','IvrCampaigns','UserProfileResource','sendStatus','index','map'];(function(_0x3da5ce,_0x2787ea){var _0x3d217a=function(_0x4f1c3d){while(--_0x4f1c3d){_0x3da5ce['push'](_0x3da5ce['shift']());}};_0x3d217a(++_0x2787ea);}(_0x5453,0x18b));var _0x3545=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5453[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require(_0x3545('0x0'));var rimraf=require(_0x3545('0x1'));var zipdir=require(_0x3545('0x2'));var jsonpatch=require(_0x3545('0x3'));var rp=require(_0x3545('0x4'));var moment=require(_0x3545('0x5'));var BPromise=require(_0x3545('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3545('0x7'));var sox=require(_0x3545('0x8'));var csv=require('to-csv');var ejs=require(_0x3545('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3545('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3545('0xb'));var deskjs=require(_0x3545('0xc'));var toCsv=require(_0x3545('0xd'));var querystring=require('querystring');var Papa=require(_0x3545('0xe'));var Redis=require(_0x3545('0xf'));var authService=require(_0x3545('0x10'));var qs=require(_0x3545('0x11'));var as=require(_0x3545('0x12'));var hardwareService=require(_0x3545('0x13'));var logger=require(_0x3545('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x3545('0x15'));var licenseUtil=require(_0x3545('0x16'));var db=require(_0x3545('0x17'))['db'];function respondWithStatusCode(_0x3de48b,_0x54fcf4){_0x54fcf4=_0x54fcf4||0xcc;return function(_0x4b9316){if(_0x4b9316){return _0x3de48b['sendStatus'](_0x54fcf4);}return _0x3de48b[_0x3545('0x18')](_0x54fcf4)[_0x3545('0x19')]();};}function respondWithResult(_0x5ddba6,_0x427f72){_0x427f72=_0x427f72||0xc8;return function(_0x5b5474){if(_0x5b5474){return _0x5ddba6['status'](_0x427f72)[_0x3545('0x1a')](_0x5b5474);}};}function respondWithFilteredResult(_0x1a4a55,_0x569ebd){return function(_0x29921b){if(_0x29921b){var _0x1717f6=typeof _0x569ebd['offset']===_0x3545('0x1b')&&typeof _0x569ebd['limit']===_0x3545('0x1b');var _0x16e2f8=_0x29921b[_0x3545('0x1c')];var _0x2c008a=_0x1717f6?0x0:_0x569ebd['offset'];var _0x573970=_0x1717f6?_0x29921b[_0x3545('0x1c')]:_0x569ebd['offset']+_0x569ebd[_0x3545('0x1d')];var _0x21c623;if(_0x573970>=_0x16e2f8){_0x573970=_0x16e2f8;_0x21c623=0xc8;}else{_0x21c623=0xce;}_0x1a4a55[_0x3545('0x18')](_0x21c623);return _0x1a4a55[_0x3545('0x1e')](_0x3545('0x1f'),_0x2c008a+'-'+_0x573970+'/'+_0x16e2f8)[_0x3545('0x1a')](_0x29921b);}return null;};}function patchUpdates(_0x10037f){return function(_0x365bc3){try{jsonpatch[_0x3545('0x20')](_0x365bc3,_0x10037f,!![]);}catch(_0x329228){return BPromise[_0x3545('0x21')](_0x329228);}return _0x365bc3['save']();};}function saveUpdates(_0x57de12,_0x20800f){return function(_0x580791){if(_0x580791){return _0x580791[_0x3545('0x22')](_0x57de12)[_0x3545('0x23')](function(_0x5bd498){return _0x5bd498;});}return null;};}function removeEntity(_0x473c00,_0x528b30){return function(_0x5de099){if(_0x5de099){return _0x5de099[_0x3545('0x24')]()[_0x3545('0x23')](function(){var _0x5bb284=_0x5de099[_0x3545('0x25')]({'plain':!![]});var _0x21c4e5=_0x3545('0x26');return db[_0x3545('0x27')][_0x3545('0x24')]({'where':{'type':_0x21c4e5,'resourceId':_0x5bb284['id']}})[_0x3545('0x23')](function(){return _0x5de099;});})['then'](function(){_0x473c00[_0x3545('0x18')](0xcc)[_0x3545('0x19')]();});}};}function handleEntityNotFound(_0x1cc167,_0xeea892){return function(_0x864712){if(!_0x864712){_0x1cc167[_0x3545('0x28')](0x194);}return _0x864712;};}function handleError(_0x3535e6,_0x5360df){_0x5360df=_0x5360df||0x1f4;return function(_0x46450f){logger['error'](_0x46450f['stack']);if(_0x46450f['name']){delete _0x46450f['name'];}_0x3535e6[_0x3545('0x18')](_0x5360df)['send'](_0x46450f);};}exports[_0x3545('0x29')]=function(_0x900e88,_0x341ad3){var _0x2f6057={},_0x3d78a9={},_0x77931f={'count':0x0,'rows':[]};var _0x2fb95f=_[_0x3545('0x2a')](db[_0x3545('0x2b')][_0x3545('0x2c')],function(_0x1277a8){return{'name':_0x1277a8['fieldName'],'type':_0x1277a8['type'][_0x3545('0x2d')]};});_0x3d78a9[_0x3545('0x2e')]=_['map'](_0x2fb95f,_0x3545('0x2f'));_0x3d78a9[_0x3545('0x30')]=_[_0x3545('0x31')](_0x900e88[_0x3545('0x30')]);_0x3d78a9[_0x3545('0x32')]=_[_0x3545('0x33')](_0x3d78a9[_0x3545('0x2e')],_0x3d78a9[_0x3545('0x30')]);_0x2f6057[_0x3545('0x34')]=_[_0x3545('0x33')](_0x3d78a9['model'],qs[_0x3545('0x35')](_0x900e88[_0x3545('0x30')][_0x3545('0x35')]));_0x2f6057[_0x3545('0x34')]=_0x2f6057[_0x3545('0x34')][_0x3545('0x36')]?_0x2f6057['attributes']:_0x3d78a9['model'];if(!_0x900e88[_0x3545('0x30')][_0x3545('0x37')](_0x3545('0x38'))){_0x2f6057[_0x3545('0x1d')]=qs[_0x3545('0x1d')](_0x900e88[_0x3545('0x30')]['limit']);_0x2f6057[_0x3545('0x39')]=qs['offset'](_0x900e88['query']['offset']);}_0x2f6057[_0x3545('0x3a')]=qs[_0x3545('0x3b')](_0x900e88['query'][_0x3545('0x3b')]);_0x2f6057[_0x3545('0x3c')]=qs[_0x3545('0x32')](_[_0x3545('0x3d')](_0x900e88[_0x3545('0x30')],_0x3d78a9[_0x3545('0x32')]),_0x2fb95f);if(_0x900e88[_0x3545('0x30')][_0x3545('0x3e')]){_0x2f6057['where']=_[_0x3545('0x3f')](_0x2f6057[_0x3545('0x3c')],{'$or':_[_0x3545('0x2a')](_0x2fb95f,function(_0x2ec932){if(_0x2ec932[_0x3545('0x40')]!==_0x3545('0x41')){var _0x51a06a={};_0x51a06a[_0x2ec932['name']]={'$like':'%'+_0x900e88[_0x3545('0x30')][_0x3545('0x3e')]+'%'};return _0x51a06a;}})});}_0x2f6057=_[_0x3545('0x3f')]({},_0x2f6057,_0x900e88[_0x3545('0x42')]);var _0x2f13b8={'where':_0x2f6057['where']};return db[_0x3545('0x2b')][_0x3545('0x1c')](_0x2f13b8)[_0x3545('0x23')](function(_0x4d5469){_0x77931f[_0x3545('0x1c')]=_0x4d5469;if(_0x900e88[_0x3545('0x30')]['includeAll']){_0x2f6057[_0x3545('0x43')]=[{'all':!![]}];}return db[_0x3545('0x2b')][_0x3545('0x44')](_0x2f6057);})['then'](function(_0xee3a73){_0x77931f[_0x3545('0x45')]=_0xee3a73;return _0x77931f;})[_0x3545('0x23')](respondWithFilteredResult(_0x341ad3,_0x2f6057))[_0x3545('0x46')](handleError(_0x341ad3,null));};exports[_0x3545('0x47')]=function(_0x44af9d,_0x530854){var _0x505898={'raw':![],'where':{'id':_0x44af9d[_0x3545('0x48')]['id']}},_0x5c9303={};_0x5c9303[_0x3545('0x2e')]=_[_0x3545('0x31')](db[_0x3545('0x2b')]['rawAttributes']);_0x5c9303[_0x3545('0x30')]=_[_0x3545('0x31')](_0x44af9d[_0x3545('0x30')]);_0x5c9303[_0x3545('0x32')]=_[_0x3545('0x33')](_0x5c9303[_0x3545('0x2e')],_0x5c9303[_0x3545('0x30')]);_0x505898[_0x3545('0x34')]=_[_0x3545('0x33')](_0x5c9303['model'],qs['fields'](_0x44af9d[_0x3545('0x30')]['fields']));_0x505898[_0x3545('0x34')]=_0x505898[_0x3545('0x34')]['length']?_0x505898[_0x3545('0x34')]:_0x5c9303[_0x3545('0x2e')];if(_0x44af9d[_0x3545('0x30')][_0x3545('0x49')]){_0x505898['include']=[{'all':!![]}];}_0x505898=_['merge']({},_0x505898,_0x44af9d[_0x3545('0x42')]);return db[_0x3545('0x2b')]['find'](_0x505898)[_0x3545('0x23')](handleEntityNotFound(_0x530854,null))['then'](respondWithResult(_0x530854,null))[_0x3545('0x46')](handleError(_0x530854,null));};exports[_0x3545('0x4a')]=function(_0x5f4e9c,_0x3350a9){return db['Campaign'][_0x3545('0x4a')](_0x5f4e9c[_0x3545('0x4b')],{})[_0x3545('0x23')](function(_0x181301){var _0x24ee85=_0x5f4e9c[_0x3545('0x4c')][_0x3545('0x25')]({'plain':!![]});if(!_0x24ee85)throw new Error(_0x3545('0x4d'));if(_0x24ee85[_0x3545('0x4e')]==='user'){var _0x1e16c1=_0x181301['get']({'plain':!![]});var _0x309c3b='IvrCampaigns';return db['UserProfileSection'][_0x3545('0x4f')]({'where':{'name':_0x309c3b,'userProfileId':_0x24ee85[_0x3545('0x50')]},'raw':!![]})[_0x3545('0x23')](function(_0x278b8e){if(_0x278b8e&&_0x278b8e[_0x3545('0x51')]===0x0){return db[_0x3545('0x27')][_0x3545('0x4a')]({'name':_0x1e16c1[_0x3545('0x2f')],'resourceId':_0x1e16c1['id'],'type':_0x278b8e[_0x3545('0x2f')],'sectionId':_0x278b8e['id']},{})[_0x3545('0x23')](function(){return _0x181301;});}else{return _0x181301;}})['catch'](function(_0x2e506b){logger['error'](_0x3545('0x52'),_0x2e506b);throw _0x2e506b;});}return _0x181301;})[_0x3545('0x23')](respondWithResult(_0x3350a9,0xc9))[_0x3545('0x46')](handleError(_0x3350a9,null));};exports[_0x3545('0x53')]=function(_0x3db67c,_0x5d3ed2){var _0x557a73={'where':{'id':_0x3db67c[_0x3545('0x48')]['id']}},_0x2416a8={};_0x2416a8[_0x3545('0x2e')]=_[_0x3545('0x31')](db['Campaign'][_0x3545('0x2c')]);_0x557a73[_0x3545('0x34')]=_['intersection'](_0x2416a8[_0x3545('0x2e')],qs['fields'](_0x3db67c[_0x3545('0x30')]['fields']));_0x557a73['attributes']=_0x557a73[_0x3545('0x34')][_0x3545('0x36')]?_0x557a73[_0x3545('0x34')]:_0x2416a8[_0x3545('0x2e')];if(_0x3db67c[_0x3545('0x30')][_0x3545('0x49')]){_0x557a73[_0x3545('0x43')]=[{'all':!![]}];}_0x557a73=_[_0x3545('0x3f')]({},_0x557a73,_0x3db67c[_0x3545('0x42')]);return db[_0x3545('0x2b')][_0x3545('0x4f')](_0x557a73)[_0x3545('0x23')](handleEntityNotFound(_0x5d3ed2,null))[_0x3545('0x23')](function(_0x2a8a6d){if(_0x2a8a6d){var _0x424e89=_0x2a8a6d[_0x3545('0x25')]({'plain':!![]});_0x424e89=qs[_0x3545('0x54')](_0x424e89,['id','createdAt',_0x3545('0x55')]);_0x3db67c[_0x3545('0x4b')]=_[_0x3545('0x54')](_0x3db67c[_0x3545('0x4b')],['id',_0x3545('0x56'),_0x3545('0x55')]);return db[_0x3545('0x2b')][_0x3545('0x4a')](_[_0x3545('0x3f')](_0x424e89,_0x3db67c[_0x3545('0x4b')]),{'include':_0x3db67c[_0x3545('0x30')][_0x3545('0x49')]?[{'all':!![]}]:undefined})[_0x3545('0x23')](function(_0x373852){var _0x37a077=_0x3db67c[_0x3545('0x4c')][_0x3545('0x25')]({'plain':!![]});if(!_0x37a077)throw new Error(_0x3545('0x4d'));if(_0x37a077[_0x3545('0x4e')]===_0x3545('0x4c')){var _0x176ac3=_0x373852[_0x3545('0x25')]({'plain':!![]});var _0x1c0d67=_0x3545('0x26');return db[_0x3545('0x57')]['find']({'where':{'name':_0x1c0d67,'userProfileId':_0x37a077[_0x3545('0x50')]},'raw':!![]})[_0x3545('0x23')](function(_0x2ddf75){if(_0x2ddf75&&_0x2ddf75[_0x3545('0x51')]===0x0){return db[_0x3545('0x27')][_0x3545('0x4a')]({'name':_0x176ac3[_0x3545('0x2f')],'resourceId':_0x176ac3['id'],'type':_0x2ddf75['name'],'sectionId':_0x2ddf75['id']},{})[_0x3545('0x23')](function(){return _0x373852;});}else{return _0x373852;}})[_0x3545('0x46')](function(_0x4f40da){logger[_0x3545('0x58')](_0x3545('0x52'),_0x4f40da);throw _0x4f40da;});}return _0x373852;});}})[_0x3545('0x23')](respondWithResult(_0x5d3ed2,0xc9))['catch'](handleError(_0x5d3ed2,null));};exports['update']=function(_0x269419,_0x5d2bea){if(_0x269419[_0x3545('0x4b')]['id']){delete _0x269419[_0x3545('0x4b')]['id'];}return db[_0x3545('0x2b')][_0x3545('0x4f')]({'where':{'id':_0x269419[_0x3545('0x48')]['id']}})[_0x3545('0x23')](handleEntityNotFound(_0x5d2bea,null))[_0x3545('0x23')](saveUpdates(_0x269419[_0x3545('0x4b')],null))[_0x3545('0x23')](respondWithResult(_0x5d2bea,null))[_0x3545('0x46')](handleError(_0x5d2bea,null));};exports[_0x3545('0x24')]=function(_0x571416,_0x4d4e91){return db[_0x3545('0x2b')][_0x3545('0x4f')]({'where':{'id':_0x571416[_0x3545('0x48')]['id']}})['then'](handleEntityNotFound(_0x4d4e91,null))[_0x3545('0x23')](removeEntity(_0x4d4e91,null))['catch'](handleError(_0x4d4e91,null));};exports[_0x3545('0x59')]=function(_0x3c3bdf,_0x384638,_0x3ea02f){var _0x4028ab={'raw':!![],'where':{}};var _0x428eaa={};var _0x179991={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x3c3bdf[_0x3545('0x48')]['id']}})['then'](handleEntityNotFound(_0x384638,null))[_0x3545('0x23')](function(_0x255561){if(_0x255561){_0x428eaa[_0x3545('0x2e')]=_[_0x3545('0x31')](db[_0x3545('0x5a')][_0x3545('0x2c')]);_0x428eaa[_0x3545('0x30')]=_[_0x3545('0x31')](_0x3c3bdf['query']);_0x428eaa[_0x3545('0x32')]=_[_0x3545('0x33')](_0x428eaa[_0x3545('0x2e')],_0x428eaa[_0x3545('0x30')]);_0x4028ab[_0x3545('0x34')]=_['intersection'](_0x428eaa[_0x3545('0x2e')],qs['fields'](_0x3c3bdf[_0x3545('0x30')][_0x3545('0x35')]));_0x4028ab['attributes']=_0x4028ab[_0x3545('0x34')][_0x3545('0x36')]?_0x4028ab[_0x3545('0x34')]:_0x428eaa[_0x3545('0x2e')];if(!_0x3c3bdf[_0x3545('0x30')][_0x3545('0x37')](_0x3545('0x38'))){_0x4028ab['limit']=qs['limit'](_0x3c3bdf['query'][_0x3545('0x1d')]);_0x4028ab['offset']=qs[_0x3545('0x39')](_0x3c3bdf[_0x3545('0x30')][_0x3545('0x39')]);}_0x4028ab[_0x3545('0x3a')]=qs[_0x3545('0x3b')](_0x3c3bdf[_0x3545('0x30')][_0x3545('0x3b')]);_0x4028ab[_0x3545('0x3c')]=qs['filters'](_['pick'](_0x3c3bdf[_0x3545('0x30')],_0x428eaa[_0x3545('0x32')]));_0x4028ab[_0x3545('0x3c')][_0x3545('0x5b')]=_0x255561['id'];if(_0x3c3bdf[_0x3545('0x30')][_0x3545('0x3e')]){_0x4028ab[_0x3545('0x3c')]=_[_0x3545('0x3f')](_0x4028ab[_0x3545('0x3c')],{'$or':_[_0x3545('0x2a')](_0x4028ab['attributes'],function(_0x2b4bed){var _0x5f25b6={};_0x5f25b6[_0x2b4bed]={'$like':'%'+_0x3c3bdf[_0x3545('0x30')][_0x3545('0x3e')]+'%'};return _0x5f25b6;})});}_0x4028ab=_[_0x3545('0x3f')]({},_0x4028ab,_0x3c3bdf[_0x3545('0x42')]);return db['CmHopper'][_0x3545('0x1c')]({'where':_0x4028ab[_0x3545('0x3c')]})[_0x3545('0x23')](function(_0x1a5198){_0x179991[_0x3545('0x1c')]=_0x1a5198;if(_0x3c3bdf[_0x3545('0x30')][_0x3545('0x49')]){_0x4028ab['include']=[{'all':!![]}];}return db[_0x3545('0x5a')]['findAll'](_0x4028ab);})[_0x3545('0x23')](function(_0x15964a){_0x179991[_0x3545('0x45')]=_0x15964a;return _0x179991;});}})[_0x3545('0x23')](respondWithFilteredResult(_0x384638,_0x4028ab))['catch'](handleError(_0x384638,null));};exports[_0x3545('0x5c')]=function(_0x4ef84b,_0x5f1f40,_0xaf94fd){var _0x3a5035={'raw':!![],'where':{}};var _0x1eade9={};var _0x431548={'count':0x0,'rows':[]};return db['Campaign'][_0x3545('0x5d')]({'where':{'id':_0x4ef84b['params']['id']}})['then'](handleEntityNotFound(_0x5f1f40,null))[_0x3545('0x23')](function(_0x427247){if(_0x427247){_0x1eade9[_0x3545('0x2e')]=_['keys'](db[_0x3545('0x5e')][_0x3545('0x2c')]);_0x1eade9[_0x3545('0x30')]=_[_0x3545('0x31')](_0x4ef84b[_0x3545('0x30')]);_0x1eade9[_0x3545('0x32')]=_[_0x3545('0x33')](_0x1eade9['model'],_0x1eade9[_0x3545('0x30')]);_0x3a5035['attributes']=_[_0x3545('0x33')](_0x1eade9[_0x3545('0x2e')],qs[_0x3545('0x35')](_0x4ef84b[_0x3545('0x30')][_0x3545('0x35')]));_0x3a5035[_0x3545('0x34')]=_0x3a5035[_0x3545('0x34')][_0x3545('0x36')]?_0x3a5035['attributes']:_0x1eade9[_0x3545('0x2e')];if(!_0x4ef84b['query'][_0x3545('0x37')](_0x3545('0x38'))){_0x3a5035[_0x3545('0x1d')]=qs[_0x3545('0x1d')](_0x4ef84b[_0x3545('0x30')]['limit']);_0x3a5035['offset']=qs[_0x3545('0x39')](_0x4ef84b[_0x3545('0x30')][_0x3545('0x39')]);}_0x3a5035[_0x3545('0x3a')]=qs[_0x3545('0x3b')](_0x4ef84b[_0x3545('0x30')][_0x3545('0x3b')]);_0x3a5035['where']=qs[_0x3545('0x32')](_[_0x3545('0x3d')](_0x4ef84b['query'],_0x1eade9['filters']));_0x3a5035[_0x3545('0x3c')][_0x3545('0x5b')]=_0x427247['id'];if(_0x4ef84b[_0x3545('0x30')][_0x3545('0x3e')]){_0x3a5035['where']=_['merge'](_0x3a5035[_0x3545('0x3c')],{'$or':_[_0x3545('0x2a')](_0x3a5035['attributes'],function(_0x13d47d){var _0x5e7c85={};_0x5e7c85[_0x13d47d]={'$like':'%'+_0x4ef84b['query'][_0x3545('0x3e')]+'%'};return _0x5e7c85;})});}_0x3a5035=_[_0x3545('0x3f')]({},_0x3a5035,_0x4ef84b[_0x3545('0x42')]);return db[_0x3545('0x5e')][_0x3545('0x1c')]({'where':_0x3a5035['where']})[_0x3545('0x23')](function(_0x469e0c){_0x431548[_0x3545('0x1c')]=_0x469e0c;if(_0x4ef84b['query'][_0x3545('0x49')]){_0x3a5035['include']=[{'all':!![]}];}return db[_0x3545('0x5e')][_0x3545('0x44')](_0x3a5035);})[_0x3545('0x23')](function(_0x5b0118){_0x431548[_0x3545('0x45')]=_0x5b0118;return _0x431548;});}})[_0x3545('0x23')](respondWithFilteredResult(_0x5f1f40,_0x3a5035))[_0x3545('0x46')](handleError(_0x5f1f40,null));};exports[_0x3545('0x5f')]=function(_0x1b9928,_0x2e18e7,_0x42fb6f){var _0x5d4014={'raw':!![],'where':{}};var _0x2322dd={};var _0x291b8c={'count':0x0,'rows':[]};return db[_0x3545('0x2b')][_0x3545('0x5d')]({'where':{'id':_0x1b9928[_0x3545('0x48')]['id']}})[_0x3545('0x23')](handleEntityNotFound(_0x2e18e7,null))[_0x3545('0x23')](function(_0x218a28){if(_0x218a28){_0x2322dd[_0x3545('0x2e')]=_[_0x3545('0x31')](db[_0x3545('0x60')][_0x3545('0x2c')]);_0x2322dd['query']=_[_0x3545('0x31')](_0x1b9928[_0x3545('0x30')]);_0x2322dd[_0x3545('0x32')]=_[_0x3545('0x33')](_0x2322dd[_0x3545('0x2e')],_0x2322dd[_0x3545('0x30')]);_0x5d4014[_0x3545('0x34')]=_[_0x3545('0x33')](_0x2322dd[_0x3545('0x2e')],qs[_0x3545('0x35')](_0x1b9928[_0x3545('0x30')][_0x3545('0x35')]));_0x5d4014['attributes']=_0x5d4014['attributes'][_0x3545('0x36')]?_0x5d4014[_0x3545('0x34')]:_0x2322dd[_0x3545('0x2e')];if(!_0x1b9928['query'][_0x3545('0x37')]('nolimit')){_0x5d4014[_0x3545('0x1d')]=qs[_0x3545('0x1d')](_0x1b9928[_0x3545('0x30')][_0x3545('0x1d')]);_0x5d4014[_0x3545('0x39')]=qs['offset'](_0x1b9928[_0x3545('0x30')][_0x3545('0x39')]);}_0x5d4014[_0x3545('0x3a')]=qs[_0x3545('0x3b')](_0x1b9928[_0x3545('0x30')][_0x3545('0x3b')]);_0x5d4014[_0x3545('0x3c')]=qs[_0x3545('0x32')](_[_0x3545('0x3d')](_0x1b9928['query'],_0x2322dd[_0x3545('0x32')]));_0x5d4014['where'][_0x3545('0x5b')]=_0x218a28['id'];if(_0x1b9928[_0x3545('0x30')][_0x3545('0x3e')]){_0x5d4014[_0x3545('0x3c')]=_[_0x3545('0x3f')](_0x5d4014[_0x3545('0x3c')],{'$or':_[_0x3545('0x2a')](_0x5d4014[_0x3545('0x34')],function(_0x48aa79){var _0x219cb5={};_0x219cb5[_0x48aa79]={'$like':'%'+_0x1b9928['query'][_0x3545('0x3e')]+'%'};return _0x219cb5;})});}_0x5d4014=_['merge']({},_0x5d4014,_0x1b9928['options']);return db[_0x3545('0x60')]['count']({'where':_0x5d4014[_0x3545('0x3c')]})[_0x3545('0x23')](function(_0x18b862){_0x291b8c['count']=_0x18b862;if(_0x1b9928[_0x3545('0x30')][_0x3545('0x49')]){_0x5d4014[_0x3545('0x43')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x3545('0x44')](_0x5d4014);})[_0x3545('0x23')](function(_0x1c20cd){_0x291b8c[_0x3545('0x45')]=_0x1c20cd;return _0x291b8c;});}})[_0x3545('0x23')](respondWithFilteredResult(_0x2e18e7,_0x5d4014))[_0x3545('0x46')](handleError(_0x2e18e7,null));};exports[_0x3545('0x61')]=function(_0x10e9f8,_0xc2bd4b,_0x5c949f){var _0xb8d80e={'raw':!![],'where':{}};var _0x23421c={};var _0x361769={'count':0x0,'rows':[]};return db['Campaign'][_0x3545('0x5d')]({'where':{'id':_0x10e9f8['params']['id']}})[_0x3545('0x23')](handleEntityNotFound(_0xc2bd4b,null))['then'](function(_0x120bb0){if(_0x120bb0){_0x23421c[_0x3545('0x2e')]=_['keys'](db[_0x3545('0x62')][_0x3545('0x2c')]);_0x23421c[_0x3545('0x30')]=_[_0x3545('0x31')](_0x10e9f8['query']);_0x23421c[_0x3545('0x32')]=_[_0x3545('0x33')](_0x23421c[_0x3545('0x2e')],_0x23421c[_0x3545('0x30')]);_0xb8d80e[_0x3545('0x34')]=_[_0x3545('0x33')](_0x23421c[_0x3545('0x2e')],qs[_0x3545('0x35')](_0x10e9f8[_0x3545('0x30')][_0x3545('0x35')]));_0xb8d80e[_0x3545('0x34')]=_0xb8d80e[_0x3545('0x34')][_0x3545('0x36')]?_0xb8d80e[_0x3545('0x34')]:_0x23421c[_0x3545('0x2e')];if(!_0x10e9f8['query'][_0x3545('0x37')](_0x3545('0x38'))){_0xb8d80e[_0x3545('0x1d')]=qs['limit'](_0x10e9f8['query'][_0x3545('0x1d')]);_0xb8d80e[_0x3545('0x39')]=qs[_0x3545('0x39')](_0x10e9f8['query']['offset']);}_0xb8d80e['order']=qs[_0x3545('0x3b')](_0x10e9f8[_0x3545('0x30')][_0x3545('0x3b')]);_0xb8d80e['where']=qs[_0x3545('0x32')](_[_0x3545('0x3d')](_0x10e9f8[_0x3545('0x30')],_0x23421c[_0x3545('0x32')]));_0xb8d80e['where'][_0x3545('0x5b')]=_0x120bb0['id'];if(_0x10e9f8['query']['filter']){_0xb8d80e[_0x3545('0x3c')]=_['merge'](_0xb8d80e[_0x3545('0x3c')],{'$or':_['map'](_0xb8d80e[_0x3545('0x34')],function(_0x5f3e9b){var _0x275c99={};_0x275c99[_0x5f3e9b]={'$like':'%'+_0x10e9f8[_0x3545('0x30')]['filter']+'%'};return _0x275c99;})});}_0xb8d80e=_[_0x3545('0x3f')]({},_0xb8d80e,_0x10e9f8[_0x3545('0x42')]);return db[_0x3545('0x62')]['count']({'where':_0xb8d80e[_0x3545('0x3c')]})[_0x3545('0x23')](function(_0x3a1af6){_0x361769[_0x3545('0x1c')]=_0x3a1af6;if(_0x10e9f8[_0x3545('0x30')][_0x3545('0x49')]){_0xb8d80e[_0x3545('0x43')]=[{'all':!![]}];}return db[_0x3545('0x62')]['findAll'](_0xb8d80e);})[_0x3545('0x23')](function(_0x13edbe){_0x361769['rows']=_0x13edbe;return _0x361769;});}})[_0x3545('0x23')](respondWithFilteredResult(_0xc2bd4b,_0xb8d80e))['catch'](handleError(_0xc2bd4b,null));};exports['getLists']=function(_0x2ee527,_0x46b1a6,_0x40b46c){var _0x13fe4b={};var _0x2ae752={};var _0x2f41bb;var _0x26d69f;return db[_0x3545('0x2b')][_0x3545('0x5d')]({'where':{'id':_0x2ee527[_0x3545('0x48')]['id']}})[_0x3545('0x23')](handleEntityNotFound(_0x46b1a6,null))[_0x3545('0x23')](function(_0x381834){if(_0x381834){_0x2f41bb=_0x381834;_0x2ae752[_0x3545('0x2e')]=_['keys'](db[_0x3545('0x63')][_0x3545('0x2c')]);_0x2ae752[_0x3545('0x30')]=_[_0x3545('0x31')](_0x2ee527[_0x3545('0x30')]);_0x2ae752[_0x3545('0x32')]=_['intersection'](_0x2ae752[_0x3545('0x2e')],_0x2ae752[_0x3545('0x30')]);_0x13fe4b['attributes']=_[_0x3545('0x33')](_0x2ae752['model'],qs[_0x3545('0x35')](_0x2ee527[_0x3545('0x30')][_0x3545('0x35')]));_0x13fe4b[_0x3545('0x34')]=_0x13fe4b[_0x3545('0x34')]['length']?_0x13fe4b[_0x3545('0x34')]:_0x2ae752['model'];_0x13fe4b[_0x3545('0x3a')]=qs[_0x3545('0x3b')](_0x2ee527[_0x3545('0x30')][_0x3545('0x3b')]);_0x13fe4b[_0x3545('0x3c')]=qs[_0x3545('0x32')](_[_0x3545('0x3d')](_0x2ee527[_0x3545('0x30')],_0x2ae752[_0x3545('0x32')]));if(_0x2ee527[_0x3545('0x30')][_0x3545('0x3e')]){_0x13fe4b[_0x3545('0x3c')]=_[_0x3545('0x3f')](_0x13fe4b['where'],{'$or':_[_0x3545('0x2a')](_0x13fe4b[_0x3545('0x34')],function(_0x5ca39b){var _0x5c4c97={};_0x5c4c97[_0x5ca39b]={'$like':'%'+_0x2ee527['query'][_0x3545('0x3e')]+'%'};return _0x5c4c97;})});}_0x13fe4b=_['merge']({},_0x13fe4b,_0x2ee527['options']);return _0x2f41bb[_0x3545('0x64')](_0x13fe4b);}})[_0x3545('0x23')](function(_0x39595b){if(_0x39595b){_0x26d69f=_0x39595b['length'];if(!_0x2ee527['query'][_0x3545('0x37')](_0x3545('0x38'))){_0x13fe4b[_0x3545('0x1d')]=qs[_0x3545('0x1d')](_0x2ee527[_0x3545('0x30')]['limit']);_0x13fe4b[_0x3545('0x39')]=qs[_0x3545('0x39')](_0x2ee527[_0x3545('0x30')]['offset']);}return _0x2f41bb[_0x3545('0x64')](_0x13fe4b);}})[_0x3545('0x23')](function(_0x1acb08){if(_0x1acb08){return _0x1acb08?{'count':_0x26d69f,'rows':_0x1acb08}:null;}})[_0x3545('0x23')](respondWithResult(_0x46b1a6,null))[_0x3545('0x46')](handleError(_0x46b1a6,null));};exports[_0x3545('0x65')]=function(_0x5de7be,_0x1598ee,_0x370f47){var _0x1b8e14,_0x9bc9c1;var _0x419263=[];var _0x301ecc=moment()['format'](_0x3545('0x66'));return db[_0x3545('0x2b')][_0x3545('0x4f')]({'where':{'id':_0x5de7be[_0x3545('0x48')]['id']}})[_0x3545('0x23')](handleEntityNotFound(_0x1598ee,null))[_0x3545('0x23')](function(_0x550279){if(_0x550279){_0x9bc9c1=_0x550279;return _0x550279['addLists'](_0x5de7be[_0x3545('0x4b')][_0x3545('0x67')],_[_0x3545('0x54')](_0x5de7be[_0x3545('0x4b')],[_0x3545('0x67'),'id'])||{});}return null;})[_0x3545('0x68')](function(_0x5cb465){var _0x593b61;var _0x250d85;_0x1b8e14=_0x5cb465||[];var _0x475d4e=[];if(_0x5cb465){for(var _0x575aeb=0x0;_0x575aeb<_0x5cb465[_0x3545('0x36')];_0x575aeb+=0x1){var _0x2cc35b=_0x5cb465[_0x575aeb]['get']({'plain':!![]});_0x9bc9c1[_0x3545('0x69')]=_0x5de7be[_0x3545('0x4b')][_0x3545('0x69')]?_0x5de7be[_0x3545('0x4b')][_0x3545('0x69')]:_0x9bc9c1['dialCheckDuplicateType'];switch(_0x9bc9c1[_0x3545('0x69')]){case _0x3545('0x6a'):_0x593b61=squel['insert']()[_0x3545('0x6b')](_0x3545('0x6c'))[_0x3545('0x6d')](['phone',_0x3545('0x6e'),_0x3545('0x6f'),_0x3545('0x70'),_0x3545('0x5b'),_0x3545('0x56'),_0x3545('0x55')],squel[_0x3545('0x71')]()[_0x3545('0x72')]('phone',_0x3545('0x73'))[_0x3545('0x72')](_0x3545('0x74'),_0x3545('0x6e'))['field']('id',_0x3545('0x6f'))[_0x3545('0x72')](_0x2cc35b[_0x3545('0x75')][_0x3545('0x76')](),_0x3545('0x70'))[_0x3545('0x72')](_0x5de7be['params']['id'][_0x3545('0x76')](),_0x3545('0x5b'))[_0x3545('0x72')]('\x27'+_0x301ecc+'\x27',_0x3545('0x56'))[_0x3545('0x72')]('\x27'+_0x301ecc+'\x27',_0x3545('0x55'))[_0x3545('0x77')]('cm_contacts')[_0x3545('0x3c')]('deletedAt\x20IS\x20NULL')[_0x3545('0x3c')]('ListId\x20=\x20?',_0x2cc35b['CmListId'][_0x3545('0x76')]())[_0x3545('0x3c')](_0x3545('0x78'))[_0x3545('0x3c')](_0x3545('0x79'),squel[_0x3545('0x71')]()['field'](_0x3545('0x7a'))['from'](_0x3545('0x7b'))[_0x3545('0x3c')]('CampaignId\x20=\x20?',_0x5de7be[_0x3545('0x48')]['id']['toString']()))[_0x3545('0x3c')](_0x3545('0x79'),squel[_0x3545('0x71')]()[_0x3545('0x72')](_0x3545('0x7c'))[_0x3545('0x77')](_0x3545('0x6c'))[_0x3545('0x3c')](_0x3545('0x7d'),_0x5de7be['params']['id'][_0x3545('0x76')]())))[_0x3545('0x76')]();break;case _0x3545('0x7e'):_0x593b61=squel[_0x3545('0x7f')]()[_0x3545('0x6b')](_0x3545('0x6c'))['fromQuery']([_0x3545('0x73'),_0x3545('0x6e'),_0x3545('0x6f'),'ListId',_0x3545('0x5b'),_0x3545('0x56'),_0x3545('0x55')],squel[_0x3545('0x71')]()[_0x3545('0x72')](_0x3545('0x73'),'phone')['field'](_0x3545('0x74'),_0x3545('0x6e'))[_0x3545('0x72')]('id',_0x3545('0x6f'))[_0x3545('0x72')](_0x2cc35b['CmListId'][_0x3545('0x76')](),_0x3545('0x70'))['field'](_0x5de7be[_0x3545('0x48')]['id']['toString'](),_0x3545('0x5b'))[_0x3545('0x72')]('\x27'+_0x301ecc+'\x27','createdAt')[_0x3545('0x72')]('\x27'+_0x301ecc+'\x27',_0x3545('0x55'))[_0x3545('0x77')](_0x3545('0x80'))[_0x3545('0x3c')](_0x3545('0x81'))[_0x3545('0x3c')]('ListId\x20=\x20?',_0x2cc35b[_0x3545('0x75')][_0x3545('0x76')]())[_0x3545('0x3c')](_0x3545('0x78'))[_0x3545('0x3c')](_0x3545('0x79'),squel[_0x3545('0x71')]()[_0x3545('0x72')]('COALESCE(phone,\x27\x27)')['from'](_0x3545('0x6c'))['where']('CampaignId\x20=\x20?',_0x5de7be['params']['id']['toString']())))['toString']();break;default:_0x593b61=squel['insert']()[_0x3545('0x6b')](_0x3545('0x6c'))[_0x3545('0x6d')](['phone',_0x3545('0x6e'),_0x3545('0x6f'),_0x3545('0x70'),'CampaignId',_0x3545('0x56'),_0x3545('0x55')],squel[_0x3545('0x71')]()[_0x3545('0x72')](_0x3545('0x73'),'phone')['field'](_0x3545('0x74'),'scheduledAt')[_0x3545('0x72')]('id','ContactId')[_0x3545('0x72')](_0x2cc35b['CmListId'][_0x3545('0x76')](),'ListId')[_0x3545('0x72')](_0x5de7be[_0x3545('0x48')]['id']['toString'](),'CampaignId')[_0x3545('0x72')]('\x27'+_0x301ecc+'\x27','createdAt')[_0x3545('0x72')]('\x27'+_0x301ecc+'\x27',_0x3545('0x55'))[_0x3545('0x77')](_0x3545('0x80'))[_0x3545('0x3c')](_0x3545('0x81'))[_0x3545('0x3c')]('ListId\x20=\x20?',_0x2cc35b[_0x3545('0x75')]['toString']())['where'](_0x3545('0x78')))['toString']();}_0x250d85=squel['insert']()[_0x3545('0x6b')]('cm_hopper_additional_phones')[_0x3545('0x6d')]([_0x3545('0x82'),_0x3545('0x6e'),_0x3545('0x73'),_0x3545('0x83'),'createdAt',_0x3545('0x55')],squel[_0x3545('0x71')]()[_0x3545('0x72')](_0x3545('0x84'),'id')['field'](_0x3545('0x74'),_0x3545('0x6e'))[_0x3545('0x72')]('ci.item',_0x3545('0x73'))[_0x3545('0x72')]('ci.OrderBY',_0x3545('0x83'))[_0x3545('0x72')]('\x27'+_0x301ecc+'\x27',_0x3545('0x56'))[_0x3545('0x72')]('\x27'+_0x301ecc+'\x27','updatedAt')[_0x3545('0x77')]('cm_contact_has_items','ci')[_0x3545('0x85')](_0x3545('0x6c'),'h','h.ContactId\x20=\x20ci.CmContactId')['where'](_0x3545('0x86'),_0x2cc35b[_0x3545('0x75')]['toString']())[_0x3545('0x3c')](_0x3545('0x87'),_0x5de7be[_0x3545('0x48')]['id'][_0x3545('0x76')]())[_0x3545('0x3c')](_0x3545('0x88'),_0x301ecc))[_0x3545('0x76')]();_0x475d4e['push'](db['sequelize'][_0x3545('0x30')](_0x593b61));_0x419263[_0x3545('0x89')](db[_0x3545('0x8a')][_0x3545('0x30')](_0x250d85));}return BPromise[_0x3545('0x8b')](_0x475d4e);}})[_0x3545('0x23')](function(){return BPromise[_0x3545('0x8b')](_0x419263);})['then'](function(){return _0x1b8e14;})[_0x3545('0x23')](respondWithResult(_0x1598ee,null))[_0x3545('0x46')](handleError(_0x1598ee,null));};exports[_0x3545('0x8c')]=function(_0x2edbe3,_0x681b1b,_0x38e85b){return db['Campaign'][_0x3545('0x4f')]({'where':{'id':_0x2edbe3[_0x3545('0x48')]['id']}})['then'](handleEntityNotFound(_0x681b1b,null))[_0x3545('0x23')](function(_0x8f094c){if(_0x8f094c){return _0x8f094c[_0x3545('0x8c')](_0x2edbe3[_0x3545('0x30')][_0x3545('0x67')]);}})[_0x3545('0x23')](function(_0x14b63e){if(_0x14b63e){return db[_0x3545('0x5a')][_0x3545('0x24')]({'where':{'ListId':_0x2edbe3[_0x3545('0x30')][_0x3545('0x67')],'CampaignId':_0x2edbe3[_0x3545('0x48')]['id']}})[_0x3545('0x23')](function(){return _0x14b63e;});}})[_0x3545('0x23')](respondWithStatusCode(_0x681b1b,null))['catch'](handleError(_0x681b1b,null));};exports[_0x3545('0x8d')]=function(_0x5e8014,_0x2b18d4,_0x1d01ce){var _0x3e16ae={};var _0x4ab5dc={};var _0x3cc121;var _0x3124ff;return db[_0x3545('0x2b')][_0x3545('0x5d')]({'where':{'id':_0x5e8014[_0x3545('0x48')]['id']}})['then'](handleEntityNotFound(_0x2b18d4,null))[_0x3545('0x23')](function(_0x265413){if(_0x265413){_0x3cc121=_0x265413;_0x4ab5dc[_0x3545('0x2e')]=_[_0x3545('0x31')](db[_0x3545('0x63')][_0x3545('0x2c')]);_0x4ab5dc[_0x3545('0x30')]=_[_0x3545('0x31')](_0x5e8014[_0x3545('0x30')]);_0x4ab5dc[_0x3545('0x32')]=_['intersection'](_0x4ab5dc[_0x3545('0x2e')],_0x4ab5dc[_0x3545('0x30')]);_0x3e16ae[_0x3545('0x34')]=_['intersection'](_0x4ab5dc[_0x3545('0x2e')],qs[_0x3545('0x35')](_0x5e8014[_0x3545('0x30')][_0x3545('0x35')]));_0x3e16ae['attributes']=_0x3e16ae[_0x3545('0x34')][_0x3545('0x36')]?_0x3e16ae[_0x3545('0x34')]:_0x4ab5dc[_0x3545('0x2e')];_0x3e16ae[_0x3545('0x3a')]=qs[_0x3545('0x3b')](_0x5e8014[_0x3545('0x30')][_0x3545('0x3b')]);_0x3e16ae[_0x3545('0x3c')]=qs[_0x3545('0x32')](_['pick'](_0x5e8014[_0x3545('0x30')],_0x4ab5dc[_0x3545('0x32')]));if(_0x5e8014[_0x3545('0x30')][_0x3545('0x3e')]){_0x3e16ae[_0x3545('0x3c')]=_[_0x3545('0x3f')](_0x3e16ae['where'],{'$or':_['map'](_0x3e16ae[_0x3545('0x34')],function(_0x152e35){var _0x13eed7={};_0x13eed7[_0x152e35]={'$like':'%'+_0x5e8014[_0x3545('0x30')][_0x3545('0x3e')]+'%'};return _0x13eed7;})});}_0x3e16ae=_['merge']({},_0x3e16ae,_0x5e8014[_0x3545('0x42')]);return _0x3cc121[_0x3545('0x8d')](_0x3e16ae);}})[_0x3545('0x23')](function(_0x43410c){if(_0x43410c){_0x3124ff=_0x43410c[_0x3545('0x36')];if(!_0x5e8014[_0x3545('0x30')]['hasOwnProperty'](_0x3545('0x38'))){_0x3e16ae['limit']=qs[_0x3545('0x1d')](_0x5e8014['query'][_0x3545('0x1d')]);_0x3e16ae[_0x3545('0x39')]=qs[_0x3545('0x39')](_0x5e8014['query'][_0x3545('0x39')]);}return _0x3cc121[_0x3545('0x8d')](_0x3e16ae);}})[_0x3545('0x23')](function(_0x408676){if(_0x408676){return _0x408676?{'count':_0x3124ff,'rows':_0x408676}:null;}})[_0x3545('0x23')](respondWithResult(_0x2b18d4,null))['catch'](handleError(_0x2b18d4,null));};exports[_0x3545('0x8e')]=function(_0x4c2ae2,_0x56dffe,_0x2c868c){var _0xf6d8d2,_0x1ce974;var _0x1b5b50=[];var _0x582d91=moment()[_0x3545('0x8f')](_0x3545('0x66'));return db['Campaign'][_0x3545('0x4f')]({'where':{'id':_0x4c2ae2[_0x3545('0x48')]['id']}})[_0x3545('0x23')](handleEntityNotFound(_0x56dffe,null))[_0x3545('0x23')](function(_0x7d1356){if(_0x7d1356){_0x1ce974=_0x7d1356;return _0x7d1356[_0x3545('0x8e')](_0x4c2ae2[_0x3545('0x4b')][_0x3545('0x67')],_['omit'](_0x4c2ae2[_0x3545('0x4b')],[_0x3545('0x67'),'id'])||{});}return null;})['spread'](function(_0x5948f0){var _0x6c8529;var _0x2f4aff;_0xf6d8d2=_0x5948f0||[];var _0x2e95e5=[];if(_0x5948f0){for(var _0x4167e1=0x0;_0x4167e1<_0x5948f0['length'];_0x4167e1+=0x1){var _0x870ef4=_0x5948f0[_0x4167e1][_0x3545('0x25')]({'plain':!![]});_0x6c8529=squel[_0x3545('0x7f')]()['into'](_0x3545('0x90'))['fromQuery']([_0x3545('0x73'),'ContactId',_0x3545('0x70'),_0x3545('0x5b'),_0x3545('0x56'),_0x3545('0x55')],squel['select']()['field'](_0x3545('0x73'),_0x3545('0x73'))[_0x3545('0x72')]('id','ContactId')[_0x3545('0x72')](_0x870ef4[_0x3545('0x75')][_0x3545('0x76')](),'ListId')[_0x3545('0x72')](_0x4c2ae2[_0x3545('0x48')]['id']['toString'](),'CampaignId')[_0x3545('0x72')](_0x3545('0x74'),'createdAt')[_0x3545('0x72')]('NOW()',_0x3545('0x55'))[_0x3545('0x77')](_0x3545('0x80'))[_0x3545('0x3c')](_0x3545('0x81'))[_0x3545('0x3c')]('ListId\x20=\x20?',_0x870ef4[_0x3545('0x75')]['toString']())[_0x3545('0x3c')](_0x3545('0x78')))['toString']();_0x2e95e5[_0x3545('0x89')](db[_0x3545('0x8a')][_0x3545('0x30')](_0x6c8529));}return BPromise[_0x3545('0x8b')](_0x2e95e5);}})['then'](function(){return _0xf6d8d2;})['then'](respondWithResult(_0x56dffe,null))['catch'](handleError(_0x56dffe,null));};exports[_0x3545('0x91')]=function(_0x86c0c2,_0x3ef7cb,_0x263dde){return db[_0x3545('0x2b')]['find']({'where':{'id':_0x86c0c2[_0x3545('0x48')]['id']}})[_0x3545('0x23')](handleEntityNotFound(_0x3ef7cb,null))['then'](function(_0x3a3c0a){if(_0x3a3c0a){return _0x3a3c0a[_0x3545('0x91')](_0x86c0c2[_0x3545('0x30')][_0x3545('0x67')]);}})[_0x3545('0x23')](function(_0x11cb6d){if(_0x11cb6d){return db[_0x3545('0x62')][_0x3545('0x24')]({'where':{'ListId':_0x86c0c2[_0x3545('0x30')][_0x3545('0x67')],'CampaignId':_0x86c0c2[_0x3545('0x48')]['id']}})[_0x3545('0x23')](function(){return _0x11cb6d;});}})[_0x3545('0x23')](respondWithStatusCode(_0x3ef7cb,null))['catch'](handleError(_0x3ef7cb,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 6c848ec..6154881 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x5bb215,_0x268c07){var _0x5c615f=function(_0x2d458c){while(--_0x2d458c){_0x5bb215['push'](_0x5bb215['shift']());}};_0x5c615f(++_0x268c07);}(_0x7a54,0x106));var _0x47a5=function(_0x186e9b,_0x4869b6){_0x186e9b=_0x186e9b-0x0;var _0x48177c=_0x7a54[_0x186e9b];return _0x48177c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 5d727c4..d5d9158 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 _0x9234=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','findAll','options','raw','where','attributes','map','include','model','lodash','moment','bluebird'];(function(_0x510bf0,_0x595be7){var _0xd9877f=function(_0x98aff){while(--_0x98aff){_0x510bf0['push'](_0x510bf0['shift']());}};_0xd9877f(++_0x595be7);}(_0x9234,0x1bd));var _0x4923=function(_0x3cb30b,_0x504b3e){_0x3cb30b=_0x3cb30b-0x0;var _0x2ca717=_0x9234[_0x3cb30b];return _0x2ca717;};'use strict';var _=require(_0x4923('0x0'));var util=require('util');var moment=require(_0x4923('0x1'));var BPromise=require(_0x4923('0x2'));var rs=require(_0x4923('0x3'));var fs=require('fs');var Redis=require(_0x4923('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4923('0x5'));var logger=require(_0x4923('0x6'))('rpc');var config=require(_0x4923('0x7'));var jayson=require(_0x4923('0x8'));var client=jayson[_0x4923('0x9')][_0x4923('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17b854,_0x133b0d,_0x2de396){return new BPromise(function(_0x548676,_0x1fffc2){return client['request'](_0x17b854,_0x2de396)[_0x4923('0xb')](function(_0x2c4057){logger[_0x4923('0xc')]('Campaign,\x20%s,\x20%s',_0x133b0d,_0x4923('0xd'));logger[_0x4923('0xe')](_0x4923('0xf'),_0x133b0d,_0x4923('0xd'),JSON[_0x4923('0x10')](_0x2c4057));if(_0x2c4057[_0x4923('0x11')]){if(_0x2c4057[_0x4923('0x11')][_0x4923('0x12')]===0x1f4){logger[_0x4923('0x11')](_0x4923('0x13'),_0x133b0d,_0x2c4057['error']['message']);return _0x1fffc2(_0x2c4057[_0x4923('0x11')][_0x4923('0x14')]);}logger[_0x4923('0x11')]('Campaign,\x20%s,\x20%s',_0x133b0d,_0x2c4057[_0x4923('0x11')][_0x4923('0x14')]);return _0x548676(_0x2c4057[_0x4923('0x11')][_0x4923('0x14')]);}else{logger[_0x4923('0xc')](_0x4923('0x13'),_0x133b0d,_0x4923('0xd'));_0x548676(_0x2c4057[_0x4923('0x15')][_0x4923('0x14')]);}})[_0x4923('0x16')](function(_0x559e4a){logger[_0x4923('0x11')](_0x4923('0x13'),_0x133b0d,_0x559e4a);_0x1fffc2(_0x559e4a);});});}exports[_0x4923('0x17')]=function(_0x1be04d){var _0x517b95=this;return new Promise(function(_0x50fd18,_0x16955b){return db['Campaign'][_0x4923('0x18')]({'raw':_0x1be04d[_0x4923('0x19')]?_0x1be04d['options'][_0x4923('0x1a')]===undefined?!![]:![]:!![],'where':_0x1be04d[_0x4923('0x19')]?_0x1be04d[_0x4923('0x19')][_0x4923('0x1b')]||null:null,'attributes':_0x1be04d['options']?_0x1be04d[_0x4923('0x19')][_0x4923('0x1c')]||null:null,'limit':_0x1be04d['options']?_0x1be04d[_0x4923('0x19')]['limit']||null:null,'include':_0x1be04d[_0x4923('0x19')]?_0x1be04d[_0x4923('0x19')]['include']?_[_0x4923('0x1d')](_0x1be04d[_0x4923('0x19')][_0x4923('0x1e')],function(_0x161cf9){return{'model':db[_0x161cf9[_0x4923('0x1f')]],'as':_0x161cf9['as'],'attributes':_0x161cf9[_0x4923('0x1c')],'include':_0x161cf9[_0x4923('0x1e')]?_['map'](_0x161cf9['include'],function(_0x23ec97){return{'model':db[_0x23ec97[_0x4923('0x1f')]],'as':_0x23ec97['as'],'attributes':_0x23ec97[_0x4923('0x1c')],'include':_0x23ec97[_0x4923('0x1e')]?_[_0x4923('0x1d')](_0x23ec97[_0x4923('0x1e')],function(_0x13681b){return{'model':db[_0x13681b[_0x4923('0x1f')]],'as':_0x13681b['as'],'attributes':_0x13681b[_0x4923('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4923('0xb')](function(_0x3a7852){logger['info'](_0x4923('0x17'),_0x1be04d);logger[_0x4923('0xe')](_0x4923('0x17'),_0x1be04d,JSON[_0x4923('0x10')](_0x3a7852));_0x50fd18(_0x3a7852);})[_0x4923('0x16')](function(_0x47158c){logger[_0x4923('0x11')](_0x4923('0x17'),_0x47158c[_0x4923('0x14')],_0x1be04d);_0x16955b(_0x517b95[_0x4923('0x11')](0x1f4,_0x47158c[_0x4923('0x14')]));});});};
\ No newline at end of file
+var _0x1782=['info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then'];(function(_0x48fda4,_0x2a3651){var _0x39bedb=function(_0x1e023b){while(--_0x1e023b){_0x48fda4['push'](_0x48fda4['shift']());}};_0x39bedb(++_0x2a3651);}(_0x1782,0x13e));var _0x2178=function(_0x5cf767,_0x3f09d1){_0x5cf767=_0x5cf767-0x0;var _0x41d91c=_0x1782[_0x5cf767];return _0x41d91c;};'use strict';var _=require(_0x2178('0x0'));var util=require('util');var moment=require(_0x2178('0x1'));var BPromise=require(_0x2178('0x2'));var rs=require(_0x2178('0x3'));var fs=require('fs');var Redis=require(_0x2178('0x4'));var db=require(_0x2178('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2178('0x6'))(_0x2178('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2178('0x8')][_0x2178('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50ad34,_0x53b9f9,_0x4cf22a){return new BPromise(function(_0x3b4115,_0x2b3991){return client[_0x2178('0xa')](_0x50ad34,_0x4cf22a)[_0x2178('0xb')](function(_0x1cb1e6){logger[_0x2178('0xc')]('Campaign,\x20%s,\x20%s',_0x53b9f9,_0x2178('0xd'));logger[_0x2178('0xe')](_0x2178('0xf'),_0x53b9f9,_0x2178('0xd'),JSON[_0x2178('0x10')](_0x1cb1e6));if(_0x1cb1e6[_0x2178('0x11')]){if(_0x1cb1e6[_0x2178('0x11')][_0x2178('0x12')]===0x1f4){logger[_0x2178('0x11')](_0x2178('0x13'),_0x53b9f9,_0x1cb1e6['error'][_0x2178('0x14')]);return _0x2b3991(_0x1cb1e6[_0x2178('0x11')]['message']);}logger[_0x2178('0x11')](_0x2178('0x13'),_0x53b9f9,_0x1cb1e6[_0x2178('0x11')][_0x2178('0x14')]);return _0x3b4115(_0x1cb1e6[_0x2178('0x11')]['message']);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x53b9f9,_0x2178('0xd'));_0x3b4115(_0x1cb1e6['result'][_0x2178('0x14')]);}})[_0x2178('0x15')](function(_0x5edc68){logger['error'](_0x2178('0x13'),_0x53b9f9,_0x5edc68);_0x2b3991(_0x5edc68);});});}exports[_0x2178('0x16')]=function(_0x561990){var _0x3d7e36=this;return new Promise(function(_0x39dd60,_0x1cece2){return db[_0x2178('0x17')][_0x2178('0x18')]({'raw':_0x561990[_0x2178('0x19')]?_0x561990[_0x2178('0x19')][_0x2178('0x1a')]===undefined?!![]:![]:!![],'where':_0x561990[_0x2178('0x19')]?_0x561990[_0x2178('0x19')][_0x2178('0x1b')]||null:null,'attributes':_0x561990[_0x2178('0x19')]?_0x561990['options'][_0x2178('0x1c')]||null:null,'limit':_0x561990[_0x2178('0x19')]?_0x561990[_0x2178('0x19')][_0x2178('0x1d')]||null:null,'include':_0x561990[_0x2178('0x19')]?_0x561990[_0x2178('0x19')][_0x2178('0x1e')]?_[_0x2178('0x1f')](_0x561990[_0x2178('0x19')][_0x2178('0x1e')],function(_0x3c03f7){return{'model':db[_0x3c03f7[_0x2178('0x20')]],'as':_0x3c03f7['as'],'attributes':_0x3c03f7[_0x2178('0x1c')],'include':_0x3c03f7[_0x2178('0x1e')]?_[_0x2178('0x1f')](_0x3c03f7[_0x2178('0x1e')],function(_0x393f67){return{'model':db[_0x393f67[_0x2178('0x20')]],'as':_0x393f67['as'],'attributes':_0x393f67[_0x2178('0x1c')],'include':_0x393f67[_0x2178('0x1e')]?_[_0x2178('0x1f')](_0x393f67[_0x2178('0x1e')],function(_0x330618){return{'model':db[_0x330618['model']],'as':_0x330618['as'],'attributes':_0x330618[_0x2178('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2178('0xb')](function(_0x50804b){logger['info'](_0x2178('0x16'),_0x561990);logger['debug'](_0x2178('0x16'),_0x561990,JSON[_0x2178('0x10')](_0x50804b));_0x39dd60(_0x50804b);})[_0x2178('0x15')](function(_0x47a28f){logger['error'](_0x2178('0x16'),_0x47a28f[_0x2178('0x14')],_0x561990);_0x1cece2(_0x3d7e36[_0x2178('0x11')](0x1f4,_0x47a28f['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 7001a87..4f9f55a 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 _0xc5b1=['update','destroy','removeLists','delete','removeBlackLists','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','clone','addLists','addBlackLists'];(function(_0x1376c2,_0x2a07ef){var _0x39232a=function(_0x43d810){while(--_0x43d810){_0x1376c2['push'](_0x1376c2['shift']());}};_0x39232a(++_0x2a07ef);}(_0xc5b1,0x106));var _0x1c5b=function(_0x5740bb,_0x215865){_0x5740bb=_0x5740bb-0x0;var _0x60a2d2=_0xc5b1[_0x5740bb];return _0x60a2d2;};'use strict';var multer=require(_0x1c5b('0x0'));var util=require(_0x1c5b('0x1'));var path=require(_0x1c5b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1c5b('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1c5b('0x4'));var config=require(_0x1c5b('0x5'));var controller=require('./campaign.controller');router[_0x1c5b('0x6')]('/',auth['isAuthenticated'](),controller[_0x1c5b('0x7')]);router[_0x1c5b('0x6')](_0x1c5b('0x8'),auth[_0x1c5b('0x9')](),controller[_0x1c5b('0xa')]);router['get'](_0x1c5b('0xb'),auth[_0x1c5b('0x9')](),controller[_0x1c5b('0xc')]);router[_0x1c5b('0x6')](_0x1c5b('0xd'),auth['isAuthenticated'](),controller[_0x1c5b('0xe')]);router[_0x1c5b('0x6')](_0x1c5b('0xf'),auth[_0x1c5b('0x9')](),controller[_0x1c5b('0x10')]);router['get']('/:id/hopper_black',auth[_0x1c5b('0x9')](),controller['getHopperBlacks']);router['get'](_0x1c5b('0x11'),auth[_0x1c5b('0x9')](),controller[_0x1c5b('0x12')]);router[_0x1c5b('0x6')](_0x1c5b('0x13'),auth[_0x1c5b('0x9')](),controller['getBlackLists']);router[_0x1c5b('0x14')]('/',auth['isAuthenticated'](),controller[_0x1c5b('0x15')]);router[_0x1c5b('0x14')](_0x1c5b('0x16'),auth[_0x1c5b('0x9')](),controller[_0x1c5b('0x17')]);router[_0x1c5b('0x14')](_0x1c5b('0x11'),auth[_0x1c5b('0x9')](),controller[_0x1c5b('0x18')]);router[_0x1c5b('0x14')](_0x1c5b('0x13'),auth['isAuthenticated'](),controller[_0x1c5b('0x19')]);router['put']('/:id',auth[_0x1c5b('0x9')](),controller[_0x1c5b('0x1a')]);router['delete']('/:id',auth[_0x1c5b('0x9')](),controller[_0x1c5b('0x1b')]);router['delete'](_0x1c5b('0x11'),auth[_0x1c5b('0x9')](),controller[_0x1c5b('0x1c')]);router[_0x1c5b('0x1d')](_0x1c5b('0x13'),auth[_0x1c5b('0x9')](),controller[_0x1c5b('0x1e')]);module[_0x1c5b('0x1f')]=router;
\ No newline at end of file
+var _0xeb53=['get','index','/:id','isAuthenticated','show','/:id/hoppers','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getLists','/:id/blacklists','post','create','/:id/clone','clone','addLists','addBlackLists','update','delete','/:id/lists','removeBlackLists','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./campaign.controller'];(function(_0xe51920,_0x4a1092){var _0x4e4c70=function(_0x71151){while(--_0x71151){_0xe51920['push'](_0xe51920['shift']());}};_0x4e4c70(++_0x4a1092);}(_0xeb53,0xca));var _0x3eb5=function(_0x357bb5,_0x28b8d3){_0x357bb5=_0x357bb5-0x0;var _0xf08844=_0xeb53[_0x357bb5];return _0xf08844;};'use strict';var multer=require(_0x3eb5('0x0'));var util=require(_0x3eb5('0x1'));var path=require(_0x3eb5('0x2'));var timeout=require(_0x3eb5('0x3'));var express=require(_0x3eb5('0x4'));var router=express['Router']();var fs_extra=require(_0x3eb5('0x5'));var auth=require(_0x3eb5('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3eb5('0x7'));router[_0x3eb5('0x8')]('/',auth['isAuthenticated'](),controller[_0x3eb5('0x9')]);router[_0x3eb5('0x8')](_0x3eb5('0xa'),auth[_0x3eb5('0xb')](),controller[_0x3eb5('0xc')]);router[_0x3eb5('0x8')](_0x3eb5('0xd'),auth['isAuthenticated'](),controller['getHoppers']);router[_0x3eb5('0x8')]('/:id/hopper_histories',auth[_0x3eb5('0xb')](),controller[_0x3eb5('0xe')]);router[_0x3eb5('0x8')](_0x3eb5('0xf'),auth[_0x3eb5('0xb')](),controller['getHopperFinals']);router['get'](_0x3eb5('0x10'),auth[_0x3eb5('0xb')](),controller['getHopperBlacks']);router['get']('/:id/lists',auth[_0x3eb5('0xb')](),controller[_0x3eb5('0x11')]);router[_0x3eb5('0x8')](_0x3eb5('0x12'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0x3eb5('0x13')]('/',auth['isAuthenticated'](),controller[_0x3eb5('0x14')]);router[_0x3eb5('0x13')](_0x3eb5('0x15'),auth['isAuthenticated'](),controller[_0x3eb5('0x16')]);router[_0x3eb5('0x13')]('/:id/lists',auth['isAuthenticated'](),controller[_0x3eb5('0x17')]);router[_0x3eb5('0x13')](_0x3eb5('0x12'),auth[_0x3eb5('0xb')](),controller[_0x3eb5('0x18')]);router['put'](_0x3eb5('0xa'),auth[_0x3eb5('0xb')](),controller[_0x3eb5('0x19')]);router[_0x3eb5('0x1a')](_0x3eb5('0xa'),auth[_0x3eb5('0xb')](),controller['destroy']);router[_0x3eb5('0x1a')](_0x3eb5('0x1b'),auth[_0x3eb5('0xb')](),controller['removeLists']);router[_0x3eb5('0x1a')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x3eb5('0x1c')]);module[_0x3eb5('0x1d')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index ef98ba9..3fa1481 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 _0x2ca6=['getDataValue','sequelize','exports','STRING','TEXT','medium','VIRTUAL'];(function(_0x390791,_0x56a05f){var _0x543bc6=function(_0x5a5e8f){while(--_0x5a5e8f){_0x390791['push'](_0x390791['shift']());}};_0x543bc6(++_0x56a05f);}(_0x2ca6,0xb0));var _0x62ca=function(_0x2489d5,_0x118404){_0x2489d5=_0x2489d5-0x0;var _0x453f4e=_0x2ca6[_0x2489d5];return _0x453f4e;};'use strict';var Sequelize=require(_0x62ca('0x0'));module[_0x62ca('0x1')]={'key':{'type':Sequelize[_0x62ca('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x62ca('0x3')],'length':_0x62ca('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x62ca('0x5')],'get':function(){return this[_0x62ca('0x6')]('key');}}};
\ No newline at end of file
+var _0xa362=['STRING','TEXT','medium','VIRTUAL','key','sequelize','exports'];(function(_0x503950,_0x5022eb){var _0x1657a9=function(_0x4c1e8f){while(--_0x4c1e8f){_0x503950['push'](_0x503950['shift']());}};_0x1657a9(++_0x5022eb);}(_0xa362,0xe5));var _0x2a36=function(_0xe2ec77,_0x242e37){_0xe2ec77=_0xe2ec77-0x0;var _0x40d177=_0xa362[_0xe2ec77];return _0x40d177;};'use strict';var Sequelize=require(_0x2a36('0x0'));module[_0x2a36('0x1')]={'key':{'type':Sequelize[_0x2a36('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x2a36('0x3')],'length':_0x2a36('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x2a36('0x2')]},'name':{'type':Sequelize[_0x2a36('0x5')],'get':function(){return this['getDataValue'](_0x2a36('0x6'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 455191a..62d022c 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 _0xffdc=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','CannedAnswers','UserProfileResource','end','error','stack','name','send','index','CannedAnswer','rawAttributes','type'];(function(_0xd80a30,_0x15e548){var _0x1b0c5e=function(_0x4893d6){while(--_0x4893d6){_0xd80a30['push'](_0xd80a30['shift']());}};_0x1b0c5e(++_0x15e548);}(_0xffdc,0x182));var _0xcffd=function(_0x53a8bf,_0x59b79f){_0x53a8bf=_0x53a8bf-0x0;var _0x1cee30=_0xffdc[_0x53a8bf];return _0x1cee30;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcffd('0x0'));var jsonpatch=require(_0xcffd('0x1'));var rp=require(_0xcffd('0x2'));var moment=require('moment');var BPromise=require(_0xcffd('0x3'));var Mustache=require(_0xcffd('0x4'));var util=require(_0xcffd('0x5'));var path=require('path');var sox=require(_0xcffd('0x6'));var csv=require(_0xcffd('0x7'));var ejs=require(_0xcffd('0x8'));var fs=require('fs');var fs_extra=require(_0xcffd('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcffd('0xa'));var jsforce=require(_0xcffd('0xb'));var deskjs=require(_0xcffd('0xc'));var toCsv=require(_0xcffd('0x7'));var querystring=require(_0xcffd('0xd'));var Papa=require(_0xcffd('0xe'));var Redis=require(_0xcffd('0xf'));var authService=require(_0xcffd('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xcffd('0x11'));var hardwareService=require(_0xcffd('0x12'));var logger=require(_0xcffd('0x13'))(_0xcffd('0x14'));var utils=require(_0xcffd('0x15'));var config=require(_0xcffd('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcffd('0x17'))['db'];function respondWithStatusCode(_0x84983f,_0x47879e){_0x47879e=_0x47879e||0xcc;return function(_0x2d87cc){if(_0x2d87cc){return _0x84983f[_0xcffd('0x18')](_0x47879e);}return _0x84983f[_0xcffd('0x19')](_0x47879e)['end']();};}function respondWithResult(_0x559b03,_0x70832c){_0x70832c=_0x70832c||0xc8;return function(_0xc38187){if(_0xc38187){return _0x559b03['status'](_0x70832c)[_0xcffd('0x1a')](_0xc38187);}};}function respondWithFilteredResult(_0x445a73,_0x23babd){return function(_0x57cc4f){if(_0x57cc4f){var _0x1d554a=typeof _0x23babd['offset']==='undefined'&&typeof _0x23babd[_0xcffd('0x1b')]===_0xcffd('0x1c');var _0x5b2721=_0x57cc4f[_0xcffd('0x1d')];var _0x2e2fdc=_0x1d554a?0x0:_0x23babd['offset'];var _0x3f143c=_0x1d554a?_0x57cc4f[_0xcffd('0x1d')]:_0x23babd[_0xcffd('0x1e')]+_0x23babd[_0xcffd('0x1b')];var _0x4ef531;if(_0x3f143c>=_0x5b2721){_0x3f143c=_0x5b2721;_0x4ef531=0xc8;}else{_0x4ef531=0xce;}_0x445a73[_0xcffd('0x19')](_0x4ef531);return _0x445a73[_0xcffd('0x1f')](_0xcffd('0x20'),_0x2e2fdc+'-'+_0x3f143c+'/'+_0x5b2721)[_0xcffd('0x1a')](_0x57cc4f);}return null;};}function patchUpdates(_0x20adad){return function(_0x177fe7){try{jsonpatch[_0xcffd('0x21')](_0x177fe7,_0x20adad,!![]);}catch(_0x1e60ea){return BPromise['reject'](_0x1e60ea);}return _0x177fe7[_0xcffd('0x22')]();};}function saveUpdates(_0x40f4e1,_0x8e199b){return function(_0x5895c9){if(_0x5895c9){return _0x5895c9[_0xcffd('0x23')](_0x40f4e1)[_0xcffd('0x24')](function(_0x473c82){return _0x473c82;});}return null;};}function removeEntity(_0x1c91a5,_0x39d8bd){return function(_0x5a8677){if(_0x5a8677){return _0x5a8677[_0xcffd('0x25')]()[_0xcffd('0x24')](function(){var _0x1ae068=_0x5a8677['get']({'plain':!![]});var _0x2aa886=_0xcffd('0x26');return db[_0xcffd('0x27')]['destroy']({'where':{'type':_0x2aa886,'resourceId':_0x1ae068['id']}})['then'](function(){return _0x5a8677;});})['then'](function(){_0x1c91a5['status'](0xcc)[_0xcffd('0x28')]();});}};}function handleEntityNotFound(_0x5b0787,_0x2ac475){return function(_0x30415f){if(!_0x30415f){_0x5b0787[_0xcffd('0x18')](0x194);}return _0x30415f;};}function handleError(_0x39dc42,_0x1684bc){_0x1684bc=_0x1684bc||0x1f4;return function(_0x30a96c){logger[_0xcffd('0x29')](_0x30a96c[_0xcffd('0x2a')]);if(_0x30a96c[_0xcffd('0x2b')]){delete _0x30a96c[_0xcffd('0x2b')];}_0x39dc42[_0xcffd('0x19')](_0x1684bc)[_0xcffd('0x2c')](_0x30a96c);};}exports[_0xcffd('0x2d')]=function(_0x3bded6,_0x4ef4a8){var _0x37e40e={},_0x4f4b35={},_0xe76191={'count':0x0,'rows':[]};var _0x103ff4=_['map'](db[_0xcffd('0x2e')][_0xcffd('0x2f')],function(_0x14c216){return{'name':_0x14c216['fieldName'],'type':_0x14c216[_0xcffd('0x30')][_0xcffd('0x31')]};});_0x4f4b35[_0xcffd('0x32')]=_['map'](_0x103ff4,_0xcffd('0x2b'));_0x4f4b35[_0xcffd('0x33')]=_[_0xcffd('0x34')](_0x3bded6[_0xcffd('0x33')]);_0x4f4b35[_0xcffd('0x35')]=_[_0xcffd('0x36')](_0x4f4b35[_0xcffd('0x32')],_0x4f4b35[_0xcffd('0x33')]);_0x37e40e[_0xcffd('0x37')]=_[_0xcffd('0x36')](_0x4f4b35['model'],qs[_0xcffd('0x38')](_0x3bded6[_0xcffd('0x33')][_0xcffd('0x38')]));_0x37e40e[_0xcffd('0x37')]=_0x37e40e['attributes'][_0xcffd('0x39')]?_0x37e40e['attributes']:_0x4f4b35[_0xcffd('0x32')];if(!_0x3bded6[_0xcffd('0x33')][_0xcffd('0x3a')]('nolimit')){_0x37e40e['limit']=qs[_0xcffd('0x1b')](_0x3bded6[_0xcffd('0x33')][_0xcffd('0x1b')]);_0x37e40e[_0xcffd('0x1e')]=qs[_0xcffd('0x1e')](_0x3bded6[_0xcffd('0x33')][_0xcffd('0x1e')]);}_0x37e40e['order']=qs[_0xcffd('0x3b')](_0x3bded6['query'][_0xcffd('0x3b')]);_0x37e40e[_0xcffd('0x3c')]=qs[_0xcffd('0x35')](_[_0xcffd('0x3d')](_0x3bded6[_0xcffd('0x33')],_0x4f4b35['filters']),_0x103ff4);if(_0x3bded6[_0xcffd('0x33')][_0xcffd('0x3e')]){_0x37e40e[_0xcffd('0x3c')]=_[_0xcffd('0x3f')](_0x37e40e[_0xcffd('0x3c')],{'$or':[{'key':{'$like':'%'+_0x3bded6[_0xcffd('0x33')]['filter']+'%'}},{'value':{'$like':'%'+_0x3bded6[_0xcffd('0x33')][_0xcffd('0x3e')]+'%'}}]});}_0x37e40e=_[_0xcffd('0x3f')]({},_0x37e40e,_0x3bded6[_0xcffd('0x40')]);var _0x3545a2={'where':_0x37e40e['where']};return db[_0xcffd('0x2e')][_0xcffd('0x1d')](_0x3545a2)[_0xcffd('0x24')](function(_0xb8a04f){_0xe76191[_0xcffd('0x1d')]=_0xb8a04f;if(_0x3bded6[_0xcffd('0x33')][_0xcffd('0x41')]){_0x37e40e[_0xcffd('0x42')]=[{'all':!![]}];}return db[_0xcffd('0x2e')][_0xcffd('0x43')](_0x37e40e);})[_0xcffd('0x24')](function(_0x5333b2){_0xe76191[_0xcffd('0x44')]=_0x5333b2;return _0xe76191;})[_0xcffd('0x24')](respondWithFilteredResult(_0x4ef4a8,_0x37e40e))[_0xcffd('0x45')](handleError(_0x4ef4a8,null));};exports['show']=function(_0x5371e1,_0x4e5135){var _0x1eeb18={'raw':!![],'where':{'id':_0x5371e1['params']['id']}},_0x43b7bd={};_0x43b7bd['model']=_[_0xcffd('0x34')](db['CannedAnswer'][_0xcffd('0x2f')]);_0x43b7bd[_0xcffd('0x33')]=_['keys'](_0x5371e1[_0xcffd('0x33')]);_0x43b7bd['filters']=_['intersection'](_0x43b7bd[_0xcffd('0x32')],_0x43b7bd['query']);_0x1eeb18[_0xcffd('0x37')]=_[_0xcffd('0x36')](_0x43b7bd[_0xcffd('0x32')],qs['fields'](_0x5371e1[_0xcffd('0x33')]['fields']));_0x1eeb18[_0xcffd('0x37')]=_0x1eeb18[_0xcffd('0x37')][_0xcffd('0x39')]?_0x1eeb18[_0xcffd('0x37')]:_0x43b7bd[_0xcffd('0x32')];if(_0x5371e1['query'][_0xcffd('0x41')]){_0x1eeb18[_0xcffd('0x42')]=[{'all':!![]}];}_0x1eeb18=_['merge']({},_0x1eeb18,_0x5371e1[_0xcffd('0x40')]);return db['CannedAnswer'][_0xcffd('0x46')](_0x1eeb18)[_0xcffd('0x24')](handleEntityNotFound(_0x4e5135,null))['then'](respondWithResult(_0x4e5135,null))[_0xcffd('0x45')](handleError(_0x4e5135,null));};exports[_0xcffd('0x23')]=function(_0x8c83d5,_0x201e79){if(_0x8c83d5[_0xcffd('0x47')]['id']){delete _0x8c83d5[_0xcffd('0x47')]['id'];}return db[_0xcffd('0x2e')][_0xcffd('0x46')]({'where':{'id':_0x8c83d5[_0xcffd('0x48')]['id']}})[_0xcffd('0x24')](handleEntityNotFound(_0x201e79,null))[_0xcffd('0x24')](saveUpdates(_0x8c83d5[_0xcffd('0x47')],null))[_0xcffd('0x24')](respondWithResult(_0x201e79,null))[_0xcffd('0x45')](handleError(_0x201e79,null));};exports[_0xcffd('0x25')]=function(_0x11118f,_0x1fe955){return db[_0xcffd('0x2e')][_0xcffd('0x46')]({'where':{'id':_0x11118f[_0xcffd('0x48')]['id']}})['then'](handleEntityNotFound(_0x1fe955,null))[_0xcffd('0x24')](removeEntity(_0x1fe955,null))['catch'](handleError(_0x1fe955,null));};exports[_0xcffd('0x49')]=function(_0x570880,_0x147ae0){var _0x303749={'key':_0x570880['body']['key']};if(_0x570880['body'][_0xcffd('0x4a')]){_0x303749['MailAccountId']=_0x570880[_0xcffd('0x47')][_0xcffd('0x4a')];}else if(_0x570880[_0xcffd('0x47')][_0xcffd('0x4b')]){_0x303749[_0xcffd('0x4b')]=_0x570880[_0xcffd('0x47')][_0xcffd('0x4b')];}else if(_0x570880[_0xcffd('0x47')][_0xcffd('0x4c')]){_0x303749[_0xcffd('0x4c')]=_0x570880['body'][_0xcffd('0x4c')];}else if(_0x570880[_0xcffd('0x47')][_0xcffd('0x4d')]){_0x303749[_0xcffd('0x4d')]=_0x570880[_0xcffd('0x47')]['ChatWebsiteId'];}return db[_0xcffd('0x2e')][_0xcffd('0x46')]({'where':_0x303749})[_0xcffd('0x24')](function(_0x566912){if(_0x566912){throw new db[(_0xcffd('0x4e'))][(_0xcffd('0x4f'))](_0xcffd('0x50'));}return db[_0xcffd('0x2e')][_0xcffd('0x49')](_0x570880[_0xcffd('0x47')]);})[_0xcffd('0x24')](function(_0x25208b){var _0x29126a=_0x570880[_0xcffd('0x51')][_0xcffd('0x52')]({'plain':!![]});if(!_0x29126a)throw new Error(_0xcffd('0x53'));if(_0x29126a['role']==='user'){var _0x365b60=_0x25208b[_0xcffd('0x52')]({'plain':!![]});return db[_0xcffd('0x54')][_0xcffd('0x46')]({'where':{'name':_0xcffd('0x26'),'userProfileId':_0x29126a['userProfileId']},'raw':!![]})['then'](function(_0x30f363){if(_0x30f363&&_0x30f363[_0xcffd('0x55')]===0x0){return db[_0xcffd('0x27')][_0xcffd('0x49')]({'name':_0x365b60[_0xcffd('0x2b')],'resourceId':_0x365b60['id'],'type':_0x30f363[_0xcffd('0x2b')],'sectionId':_0x30f363['id']},{})[_0xcffd('0x24')](function(){return _0x25208b;});}else{return _0x25208b;}})[_0xcffd('0x45')](function(_0xb8968d){logger[_0xcffd('0x29')](_0xcffd('0x56'),_0xb8968d);throw _0xb8968d;});}return _0x25208b;})[_0xcffd('0x24')](respondWithResult(_0x147ae0,0xc9))[_0xcffd('0x45')](handleError(_0x147ae0,null));};
\ No newline at end of file
+var _0x4e33=['keys','rawAttributes','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','name','send','index','map','CannedAnswer','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','catch','params'];(function(_0x5934f3,_0x55f354){var _0x44e3f4=function(_0x481815){while(--_0x481815){_0x5934f3['push'](_0x5934f3['shift']());}};_0x44e3f4(++_0x55f354);}(_0x4e33,0x1b5));var _0x34e3=function(_0x153e7d,_0x10a35f){_0x153e7d=_0x153e7d-0x0;var _0x3c22dd=_0x4e33[_0x153e7d];return _0x3c22dd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x34e3('0x0'));var rp=require(_0x34e3('0x1'));var moment=require(_0x34e3('0x2'));var BPromise=require(_0x34e3('0x3'));var Mustache=require(_0x34e3('0x4'));var util=require('util');var path=require(_0x34e3('0x5'));var sox=require('sox');var csv=require(_0x34e3('0x6'));var ejs=require(_0x34e3('0x7'));var fs=require('fs');var fs_extra=require(_0x34e3('0x8'));var _=require(_0x34e3('0x9'));var squel=require(_0x34e3('0xa'));var crypto=require('crypto');var jsforce=require(_0x34e3('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x34e3('0x6'));var querystring=require(_0x34e3('0xc'));var Papa=require(_0x34e3('0xd'));var Redis=require('ioredis');var authService=require(_0x34e3('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x34e3('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x34e3('0x10'))(_0x34e3('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x34e3('0x12'))['db'];function respondWithStatusCode(_0xe3751b,_0x320104){_0x320104=_0x320104||0xcc;return function(_0x1f4e6f){if(_0x1f4e6f){return _0xe3751b[_0x34e3('0x13')](_0x320104);}return _0xe3751b[_0x34e3('0x14')](_0x320104)[_0x34e3('0x15')]();};}function respondWithResult(_0x538f7f,_0x51267a){_0x51267a=_0x51267a||0xc8;return function(_0x533115){if(_0x533115){return _0x538f7f[_0x34e3('0x14')](_0x51267a)[_0x34e3('0x16')](_0x533115);}};}function respondWithFilteredResult(_0x44da4f,_0x4b072e){return function(_0x42a5b9){if(_0x42a5b9){var _0x393c48=typeof _0x4b072e[_0x34e3('0x17')]===_0x34e3('0x18')&&typeof _0x4b072e[_0x34e3('0x19')]===_0x34e3('0x18');var _0x4f81b7=_0x42a5b9[_0x34e3('0x1a')];var _0x258106=_0x393c48?0x0:_0x4b072e[_0x34e3('0x17')];var _0x1be3f7=_0x393c48?_0x42a5b9[_0x34e3('0x1a')]:_0x4b072e[_0x34e3('0x17')]+_0x4b072e['limit'];var _0x4a90e7;if(_0x1be3f7>=_0x4f81b7){_0x1be3f7=_0x4f81b7;_0x4a90e7=0xc8;}else{_0x4a90e7=0xce;}_0x44da4f[_0x34e3('0x14')](_0x4a90e7);return _0x44da4f[_0x34e3('0x1b')](_0x34e3('0x1c'),_0x258106+'-'+_0x1be3f7+'/'+_0x4f81b7)[_0x34e3('0x16')](_0x42a5b9);}return null;};}function patchUpdates(_0x4370ba){return function(_0x43cf7a){try{jsonpatch[_0x34e3('0x1d')](_0x43cf7a,_0x4370ba,!![]);}catch(_0x460ab1){return BPromise[_0x34e3('0x1e')](_0x460ab1);}return _0x43cf7a[_0x34e3('0x1f')]();};}function saveUpdates(_0x5f3597,_0x3dea01){return function(_0x47c1a4){if(_0x47c1a4){return _0x47c1a4[_0x34e3('0x20')](_0x5f3597)[_0x34e3('0x21')](function(_0x4154c1){return _0x4154c1;});}return null;};}function removeEntity(_0x42fc9f,_0x48dbdd){return function(_0x11bf91){if(_0x11bf91){return _0x11bf91[_0x34e3('0x22')]()['then'](function(){var _0x17f687=_0x11bf91[_0x34e3('0x23')]({'plain':!![]});var _0x28fc37=_0x34e3('0x24');return db[_0x34e3('0x25')][_0x34e3('0x22')]({'where':{'type':_0x28fc37,'resourceId':_0x17f687['id']}})[_0x34e3('0x21')](function(){return _0x11bf91;});})[_0x34e3('0x21')](function(){_0x42fc9f[_0x34e3('0x14')](0xcc)[_0x34e3('0x15')]();});}};}function handleEntityNotFound(_0xdd062c,_0x777774){return function(_0x399137){if(!_0x399137){_0xdd062c[_0x34e3('0x13')](0x194);}return _0x399137;};}function handleError(_0x1a6180,_0xdc3433){_0xdc3433=_0xdc3433||0x1f4;return function(_0x294e29){logger[_0x34e3('0x26')](_0x294e29['stack']);if(_0x294e29['name']){delete _0x294e29[_0x34e3('0x27')];}_0x1a6180[_0x34e3('0x14')](_0xdc3433)[_0x34e3('0x28')](_0x294e29);};}exports[_0x34e3('0x29')]=function(_0x786732,_0x89ea7c){var _0x3f534b={},_0x109189={},_0x420c44={'count':0x0,'rows':[]};var _0x569ce2=_[_0x34e3('0x2a')](db[_0x34e3('0x2b')]['rawAttributes'],function(_0x4c9821){return{'name':_0x4c9821[_0x34e3('0x2c')],'type':_0x4c9821[_0x34e3('0x2d')][_0x34e3('0x2e')]};});_0x109189['model']=_[_0x34e3('0x2a')](_0x569ce2,'name');_0x109189[_0x34e3('0x2f')]=_['keys'](_0x786732['query']);_0x109189[_0x34e3('0x30')]=_[_0x34e3('0x31')](_0x109189[_0x34e3('0x32')],_0x109189[_0x34e3('0x2f')]);_0x3f534b[_0x34e3('0x33')]=_[_0x34e3('0x31')](_0x109189[_0x34e3('0x32')],qs['fields'](_0x786732[_0x34e3('0x2f')][_0x34e3('0x34')]));_0x3f534b[_0x34e3('0x33')]=_0x3f534b['attributes'][_0x34e3('0x35')]?_0x3f534b['attributes']:_0x109189[_0x34e3('0x32')];if(!_0x786732[_0x34e3('0x2f')][_0x34e3('0x36')]('nolimit')){_0x3f534b[_0x34e3('0x19')]=qs[_0x34e3('0x19')](_0x786732[_0x34e3('0x2f')][_0x34e3('0x19')]);_0x3f534b[_0x34e3('0x17')]=qs[_0x34e3('0x17')](_0x786732[_0x34e3('0x2f')]['offset']);}_0x3f534b[_0x34e3('0x37')]=qs[_0x34e3('0x38')](_0x786732['query'][_0x34e3('0x38')]);_0x3f534b['where']=qs[_0x34e3('0x30')](_[_0x34e3('0x39')](_0x786732[_0x34e3('0x2f')],_0x109189[_0x34e3('0x30')]),_0x569ce2);if(_0x786732['query'][_0x34e3('0x3a')]){_0x3f534b[_0x34e3('0x3b')]=_[_0x34e3('0x3c')](_0x3f534b['where'],{'$or':[{'key':{'$like':'%'+_0x786732['query'][_0x34e3('0x3a')]+'%'}},{'value':{'$like':'%'+_0x786732[_0x34e3('0x2f')][_0x34e3('0x3a')]+'%'}}]});}_0x3f534b=_['merge']({},_0x3f534b,_0x786732[_0x34e3('0x3d')]);var _0x53f4fc={'where':_0x3f534b[_0x34e3('0x3b')]};return db[_0x34e3('0x2b')][_0x34e3('0x1a')](_0x53f4fc)[_0x34e3('0x21')](function(_0x417038){_0x420c44[_0x34e3('0x1a')]=_0x417038;if(_0x786732[_0x34e3('0x2f')][_0x34e3('0x3e')]){_0x3f534b['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x34e3('0x3f')](_0x3f534b);})[_0x34e3('0x21')](function(_0x2b2af2){_0x420c44[_0x34e3('0x40')]=_0x2b2af2;return _0x420c44;})[_0x34e3('0x21')](respondWithFilteredResult(_0x89ea7c,_0x3f534b))[_0x34e3('0x41')](handleError(_0x89ea7c,null));};exports['show']=function(_0x218d2b,_0x36472e){var _0x2732b3={'raw':!![],'where':{'id':_0x218d2b[_0x34e3('0x42')]['id']}},_0x596305={};_0x596305[_0x34e3('0x32')]=_[_0x34e3('0x43')](db[_0x34e3('0x2b')][_0x34e3('0x44')]);_0x596305[_0x34e3('0x2f')]=_[_0x34e3('0x43')](_0x218d2b['query']);_0x596305[_0x34e3('0x30')]=_[_0x34e3('0x31')](_0x596305['model'],_0x596305[_0x34e3('0x2f')]);_0x2732b3['attributes']=_[_0x34e3('0x31')](_0x596305['model'],qs['fields'](_0x218d2b[_0x34e3('0x2f')][_0x34e3('0x34')]));_0x2732b3[_0x34e3('0x33')]=_0x2732b3[_0x34e3('0x33')][_0x34e3('0x35')]?_0x2732b3[_0x34e3('0x33')]:_0x596305[_0x34e3('0x32')];if(_0x218d2b[_0x34e3('0x2f')][_0x34e3('0x3e')]){_0x2732b3[_0x34e3('0x45')]=[{'all':!![]}];}_0x2732b3=_[_0x34e3('0x3c')]({},_0x2732b3,_0x218d2b['options']);return db[_0x34e3('0x2b')][_0x34e3('0x46')](_0x2732b3)[_0x34e3('0x21')](handleEntityNotFound(_0x36472e,null))[_0x34e3('0x21')](respondWithResult(_0x36472e,null))[_0x34e3('0x41')](handleError(_0x36472e,null));};exports[_0x34e3('0x20')]=function(_0x308565,_0x4807f9){if(_0x308565[_0x34e3('0x47')]['id']){delete _0x308565[_0x34e3('0x47')]['id'];}return db[_0x34e3('0x2b')][_0x34e3('0x46')]({'where':{'id':_0x308565[_0x34e3('0x42')]['id']}})[_0x34e3('0x21')](handleEntityNotFound(_0x4807f9,null))[_0x34e3('0x21')](saveUpdates(_0x308565[_0x34e3('0x47')],null))['then'](respondWithResult(_0x4807f9,null))[_0x34e3('0x41')](handleError(_0x4807f9,null));};exports[_0x34e3('0x22')]=function(_0x2d2317,_0x268701){return db[_0x34e3('0x2b')][_0x34e3('0x46')]({'where':{'id':_0x2d2317[_0x34e3('0x42')]['id']}})['then'](handleEntityNotFound(_0x268701,null))[_0x34e3('0x21')](removeEntity(_0x268701,null))[_0x34e3('0x41')](handleError(_0x268701,null));};exports[_0x34e3('0x48')]=function(_0xa1fa51,_0x309c88){var _0x2a8590={'key':_0xa1fa51[_0x34e3('0x47')][_0x34e3('0x2e')]};if(_0xa1fa51[_0x34e3('0x47')][_0x34e3('0x49')]){_0x2a8590['MailAccountId']=_0xa1fa51[_0x34e3('0x47')]['MailAccountId'];}else if(_0xa1fa51[_0x34e3('0x47')]['SmsAccountId']){_0x2a8590[_0x34e3('0x4a')]=_0xa1fa51['body'][_0x34e3('0x4a')];}else if(_0xa1fa51[_0x34e3('0x47')][_0x34e3('0x4b')]){_0x2a8590[_0x34e3('0x4b')]=_0xa1fa51[_0x34e3('0x47')][_0x34e3('0x4b')];}else if(_0xa1fa51[_0x34e3('0x47')][_0x34e3('0x4c')]){_0x2a8590['ChatWebsiteId']=_0xa1fa51[_0x34e3('0x47')][_0x34e3('0x4c')];}return db[_0x34e3('0x2b')][_0x34e3('0x46')]({'where':_0x2a8590})[_0x34e3('0x21')](function(_0x28c912){if(_0x28c912){throw new db[(_0x34e3('0x4d'))][(_0x34e3('0x4e'))](_0x34e3('0x4f'));}return db[_0x34e3('0x2b')][_0x34e3('0x48')](_0xa1fa51[_0x34e3('0x47')]);})[_0x34e3('0x21')](function(_0x42a996){var _0x5ad46c=_0xa1fa51[_0x34e3('0x50')][_0x34e3('0x23')]({'plain':!![]});if(!_0x5ad46c)throw new Error(_0x34e3('0x51'));if(_0x5ad46c[_0x34e3('0x52')]===_0x34e3('0x50')){var _0x20c35d=_0x42a996['get']({'plain':!![]});return db['UserProfileSection'][_0x34e3('0x46')]({'where':{'name':_0x34e3('0x24'),'userProfileId':_0x5ad46c[_0x34e3('0x53')]},'raw':!![]})[_0x34e3('0x21')](function(_0x3bcc38){if(_0x3bcc38&&_0x3bcc38['autoAssociation']===0x0){return db[_0x34e3('0x25')][_0x34e3('0x48')]({'name':_0x20c35d[_0x34e3('0x27')],'resourceId':_0x20c35d['id'],'type':_0x3bcc38['name'],'sectionId':_0x3bcc38['id']},{})[_0x34e3('0x21')](function(){return _0x42a996;});}else{return _0x42a996;}})[_0x34e3('0x41')](function(_0x2fa677){logger[_0x34e3('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2fa677);throw _0x2fa677;});}return _0x42a996;})[_0x34e3('0x21')](respondWithResult(_0x309c88,0xc9))[_0x34e3('0x41')](handleError(_0x309c88,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 1c44cf7..13e9e14 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 _0xeebc=['lodash','../../config/logger','moment','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4'];(function(_0x218d1b,_0x5cf934){var _0x405ad0=function(_0x1e7d68){while(--_0x1e7d68){_0x218d1b['push'](_0x218d1b['shift']());}};_0x405ad0(++_0x5cf934);}(_0xeebc,0x79));var _0xceeb=function(_0x491703,_0x349860){_0x491703=_0x491703-0x0;var _0x53d338=_0xeebc[_0x491703];return _0x53d338;};'use strict';var _=require(_0xceeb('0x0'));var util=require('util');var logger=require(_0xceeb('0x1'))('api');var moment=require(_0xceeb('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xceeb('0x3'));var config=require(_0xceeb('0x4'));var attributes=require(_0xceeb('0x5'));module[_0xceeb('0x6')]=function(_0x3bef84,_0x287895){return _0x3bef84[_0xceeb('0x7')](_0xceeb('0x8'),attributes,{'tableName':_0xceeb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xceeb('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x7b70=['moment','bluebird','request-promise','path','rimraf','./cannedAnswer.attributes','define','CannedAnswer','utf8mb4','lodash','api'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7b70,0xc4));var _0x07b7=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x7b70[_0x44bcb0];return _0xfaf881;};'use strict';var _=require(_0x07b7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x07b7('0x1'));var moment=require(_0x07b7('0x2'));var BPromise=require(_0x07b7('0x3'));var rp=require(_0x07b7('0x4'));var fs=require('fs');var path=require(_0x07b7('0x5'));var rimraf=require(_0x07b7('0x6'));var config=require('../../config/environment');var attributes=require(_0x07b7('0x7'));module['exports']=function(_0x1de428,_0x19e16d){return _0x1de428[_0x07b7('0x8')](_0x07b7('0x9'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x07b7('0xa'),'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 4aded27..9b78835 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(_0x5420c5,_0x48d0ac){var _0x164f68=function(_0x15d032){while(--_0x15d032){_0x5420c5['push'](_0x5420c5['shift']());}};_0x164f68(++_0x48d0ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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(_0xba4983,_0x4b1f8b){var _0x216a79=function(_0x2c9e6f){while(--_0x2c9e6f){_0xba4983['push'](_0xba4983['shift']());}};_0x216a79(++_0x4b1f8b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index 4c7a613..7d5673e 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 _0xb033=['isAuthenticated','index','/:id','show','post','create','put','destroy','exports','util','express','Router','fs-extra','../../components/interaction/service','get'];(function(_0xc1da2f,_0x4aa1c5){var _0x11f1b1=function(_0x346f6a){while(--_0x346f6a){_0xc1da2f['push'](_0xc1da2f['shift']());}};_0x11f1b1(++_0x4aa1c5);}(_0xb033,0x180));var _0x3b03=function(_0x3616e4,_0xf41415){_0x3616e4=_0x3616e4-0x0;var _0x20c9ab=_0xb033[_0x3616e4];return _0x20c9ab;};'use strict';var multer=require('multer');var util=require(_0x3b03('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3b03('0x1'));var router=express[_0x3b03('0x2')]();var fs_extra=require(_0x3b03('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3b03('0x4'));var config=require('../../config/environment');var controller=require('./cannedAnswer.controller');router[_0x3b03('0x5')]('/',auth[_0x3b03('0x6')](),controller[_0x3b03('0x7')]);router[_0x3b03('0x5')](_0x3b03('0x8'),auth[_0x3b03('0x6')](),controller[_0x3b03('0x9')]);router[_0x3b03('0xa')]('/',auth[_0x3b03('0x6')](),controller[_0x3b03('0xb')]);router[_0x3b03('0xc')](_0x3b03('0x8'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x3b03('0x8'),auth[_0x3b03('0x6')](),controller[_0x3b03('0xd')]);module[_0x3b03('0xe')]=router;
\ No newline at end of file
+var _0x6fc3=['connect-timeout','express','Router','fs-extra','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','post','create','put','update','destroy'];(function(_0x117f4c,_0x36a9b1){var _0x2b24e9=function(_0x31761b){while(--_0x31761b){_0x117f4c['push'](_0x117f4c['shift']());}};_0x2b24e9(++_0x36a9b1);}(_0x6fc3,0x13b));var _0x36fc=function(_0x185399,_0x5d382d){_0x185399=_0x185399-0x0;var _0x4d08e3=_0x6fc3[_0x185399];return _0x4d08e3;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x36fc('0x0'));var express=require(_0x36fc('0x1'));var router=express[_0x36fc('0x2')]();var fs_extra=require(_0x36fc('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x36fc('0x4'));var controller=require(_0x36fc('0x5'));router[_0x36fc('0x6')]('/',auth[_0x36fc('0x7')](),controller[_0x36fc('0x8')]);router[_0x36fc('0x6')](_0x36fc('0x9'),auth[_0x36fc('0x7')](),controller['show']);router[_0x36fc('0xa')]('/',auth['isAuthenticated'](),controller[_0x36fc('0xb')]);router[_0x36fc('0xc')](_0x36fc('0x9'),auth[_0x36fc('0x7')](),controller[_0x36fc('0xd')]);router['delete'](_0x36fc('0x9'),auth[_0x36fc('0x7')](),controller[_0x36fc('0xe')]);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 399ab9b..6f0054f 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 _0xacc5=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x4ec40b,_0x242c15){var _0x360697=function(_0x1017e7){while(--_0x1017e7){_0x4ec40b['push'](_0x4ec40b['shift']());}};_0x360697(++_0x242c15);}(_0xacc5,0x104));var _0x5acc=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xacc5[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x5acc('0x0'));module[_0x5acc('0x1')]={'calldate':{'type':Sequelize[_0x5acc('0x2')],'allowNull':![],'defaultValue':_0x5acc('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x5acc('0x4')]},'dst':{'type':Sequelize[_0x5acc('0x4')]},'dcontext':{'type':Sequelize[_0x5acc('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x5acc('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5acc('0x4')]},'amaflags':{'type':Sequelize[_0x5acc('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x5acc('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x5acc('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x5acc('0x4')]},'type':{'type':Sequelize[_0x5acc('0x4')]},'tag':{'type':Sequelize[_0x5acc('0x4')]}};
\ No newline at end of file
+var _0xab3a=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x603641,_0x529e6){var _0x4e6e1b=function(_0x3b8072){while(--_0x3b8072){_0x603641['push'](_0x603641['shift']());}};_0x4e6e1b(++_0x529e6);}(_0xab3a,0x1d3));var _0xaab3=function(_0x57426f,_0x52f0d3){_0x57426f=_0x57426f-0x0;var _0xe15733=_0xab3a[_0x57426f];return _0xe15733;};'use strict';var Sequelize=require(_0xaab3('0x0'));module[_0xaab3('0x1')]={'calldate':{'type':Sequelize[_0xaab3('0x2')],'allowNull':![],'defaultValue':_0xaab3('0x3')},'clid':{'type':Sequelize[_0xaab3('0x4')]},'src':{'type':Sequelize[_0xaab3('0x4')]},'dst':{'type':Sequelize[_0xaab3('0x4')]},'dcontext':{'type':Sequelize[_0xaab3('0x4')]},'channel':{'type':Sequelize[_0xaab3('0x4')]},'dstchannel':{'type':Sequelize[_0xaab3('0x4')]},'lastapp':{'type':Sequelize[_0xaab3('0x4')]},'lastdata':{'type':Sequelize[_0xaab3('0x4')]},'duration':{'type':Sequelize[_0xaab3('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xaab3('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xaab3('0x4')]},'userfield':{'type':Sequelize[_0xaab3('0x4')]},'uniqueid':{'type':Sequelize[_0xaab3('0x4')]},'linkedid':{'type':Sequelize[_0xaab3('0x4')]},'sequence':{'type':Sequelize[_0xaab3('0x4')]},'peeraccount':{'type':Sequelize[_0xaab3('0x4')]},'type':{'type':Sequelize[_0xaab3('0x4')]},'tag':{'type':Sequelize[_0xaab3('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 3162bd6..65e7625 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 _0x8819=['request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','describe','zip-dir','fast-json-patch'];(function(_0xaf63c5,_0x3ad012){var _0x4f4ac5=function(_0x4d36b4){while(--_0x4d36b4){_0xaf63c5['push'](_0xaf63c5['shift']());}};_0x4f4ac5(++_0x3ad012);}(_0x8819,0x94));var _0x9881=function(_0x27411f,_0x38e1d9){_0x27411f=_0x27411f-0x0;var _0x37d0f5=_0x8819[_0x27411f];return _0x37d0f5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9881('0x0'));var jsonpatch=require(_0x9881('0x1'));var rp=require(_0x9881('0x2'));var moment=require(_0x9881('0x3'));var BPromise=require(_0x9881('0x4'));var Mustache=require('mustache');var util=require(_0x9881('0x5'));var path=require(_0x9881('0x6'));var sox=require(_0x9881('0x7'));var csv=require(_0x9881('0x8'));var ejs=require(_0x9881('0x9'));var fs=require('fs');var fs_extra=require(_0x9881('0xa'));var _=require('lodash');var squel=require(_0x9881('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9881('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9881('0xd'));var Redis=require('ioredis');var authService=require(_0x9881('0xe'));var qs=require(_0x9881('0xf'));var as=require(_0x9881('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9881('0x11'))(_0x9881('0x12'));var utils=require(_0x9881('0x13'));var config=require(_0x9881('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9881('0x15'))['db'];function respondWithStatusCode(_0x26ee3f,_0x5c6d2d){_0x5c6d2d=_0x5c6d2d||0xcc;return function(_0x42850e){if(_0x42850e){return _0x26ee3f['sendStatus'](_0x5c6d2d);}return _0x26ee3f['status'](_0x5c6d2d)['end']();};}function respondWithResult(_0x58f526,_0x12794f){_0x12794f=_0x12794f||0xc8;return function(_0x3178d7){if(_0x3178d7){return _0x58f526[_0x9881('0x16')](_0x12794f)[_0x9881('0x17')](_0x3178d7);}};}function respondWithFilteredResult(_0x39d127,_0x1d57ea){return function(_0x4b9d1b){if(_0x4b9d1b){var _0x411513=typeof _0x1d57ea[_0x9881('0x18')]===_0x9881('0x19')&&typeof _0x1d57ea['limit']==='undefined';var _0x4c92c9=_0x4b9d1b[_0x9881('0x1a')];var _0x4c3493=_0x411513?0x0:_0x1d57ea[_0x9881('0x18')];var _0x5a9848=_0x411513?_0x4b9d1b['count']:_0x1d57ea[_0x9881('0x18')]+_0x1d57ea[_0x9881('0x1b')];var _0x1cbac3;if(_0x5a9848>=_0x4c92c9){_0x5a9848=_0x4c92c9;_0x1cbac3=0xc8;}else{_0x1cbac3=0xce;}_0x39d127[_0x9881('0x16')](_0x1cbac3);return _0x39d127[_0x9881('0x1c')](_0x9881('0x1d'),_0x4c3493+'-'+_0x5a9848+'/'+_0x4c92c9)[_0x9881('0x17')](_0x4b9d1b);}return null;};}function patchUpdates(_0x1243cc){return function(_0x1ee450){try{jsonpatch[_0x9881('0x1e')](_0x1ee450,_0x1243cc,!![]);}catch(_0x32ca84){return BPromise[_0x9881('0x1f')](_0x32ca84);}return _0x1ee450[_0x9881('0x20')]();};}function saveUpdates(_0x300fa6,_0x174b39){return function(_0x58485d){if(_0x58485d){return _0x58485d['update'](_0x300fa6)[_0x9881('0x21')](function(_0x513545){return _0x513545;});}return null;};}function removeEntity(_0x499461,_0x1ba558){return function(_0x30ed15){if(_0x30ed15){return _0x30ed15['destroy']()['then'](function(){_0x499461[_0x9881('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bddc1,_0x161f8d){return function(_0x16eeca){if(!_0x16eeca){_0x2bddc1[_0x9881('0x22')](0x194);}return _0x16eeca;};}function handleError(_0x2c3cd1,_0x14e6f9){_0x14e6f9=_0x14e6f9||0x1f4;return function(_0x2f6b7c){logger[_0x9881('0x23')](_0x2f6b7c[_0x9881('0x24')]);if(_0x2f6b7c[_0x9881('0x25')]){delete _0x2f6b7c[_0x9881('0x25')];}_0x2c3cd1[_0x9881('0x16')](_0x14e6f9)[_0x9881('0x26')](_0x2f6b7c);};}exports['index']=function(_0x31956e,_0x41fe0d){var _0x5c2815={},_0x236979={},_0x3d7120={'count':0x0,'rows':[]};var _0x4970be=_[_0x9881('0x27')](db[_0x9881('0x28')][_0x9881('0x29')],function(_0x204f2b){return{'name':_0x204f2b[_0x9881('0x2a')],'type':_0x204f2b[_0x9881('0x2b')][_0x9881('0x2c')]};});_0x236979[_0x9881('0x2d')]=_['map'](_0x4970be,_0x9881('0x25'));_0x236979[_0x9881('0x2e')]=_[_0x9881('0x2f')](_0x31956e[_0x9881('0x2e')]);_0x236979[_0x9881('0x30')]=_[_0x9881('0x31')](_0x236979['model'],_0x236979[_0x9881('0x2e')]);_0x5c2815[_0x9881('0x32')]=_['intersection'](_0x236979[_0x9881('0x2d')],qs[_0x9881('0x33')](_0x31956e[_0x9881('0x2e')][_0x9881('0x33')]));_0x5c2815[_0x9881('0x32')]=_0x5c2815['attributes'][_0x9881('0x34')]?_0x5c2815[_0x9881('0x32')]:_0x236979[_0x9881('0x2d')];if(!_0x31956e[_0x9881('0x2e')][_0x9881('0x35')](_0x9881('0x36'))){_0x5c2815[_0x9881('0x1b')]=qs[_0x9881('0x1b')](_0x31956e[_0x9881('0x2e')][_0x9881('0x1b')]);_0x5c2815[_0x9881('0x18')]=qs[_0x9881('0x18')](_0x31956e[_0x9881('0x2e')][_0x9881('0x18')]);}_0x5c2815[_0x9881('0x37')]=qs[_0x9881('0x38')](_0x31956e['query'][_0x9881('0x38')]);_0x5c2815['where']=qs[_0x9881('0x30')](_['pick'](_0x31956e[_0x9881('0x2e')],_0x236979[_0x9881('0x30')]),_0x4970be);if(_0x31956e['query'][_0x9881('0x39')]){_0x5c2815['where']=_[_0x9881('0x3a')](_0x5c2815[_0x9881('0x3b')],{'$or':_[_0x9881('0x27')](_0x4970be,function(_0x204fc3){if(_0x204fc3['type']!==_0x9881('0x3c')){var _0x3d183e={};_0x3d183e[_0x204fc3[_0x9881('0x25')]]={'$like':'%'+_0x31956e[_0x9881('0x2e')][_0x9881('0x39')]+'%'};return _0x3d183e;}})});}_0x5c2815=_[_0x9881('0x3a')]({},_0x5c2815,_0x31956e[_0x9881('0x3d')]);var _0x4feb70={'where':_0x5c2815[_0x9881('0x3b')]};return db['Cdr'][_0x9881('0x1a')](_0x4feb70)[_0x9881('0x21')](function(_0x1c0396){_0x3d7120['count']=_0x1c0396;if(_0x31956e[_0x9881('0x2e')][_0x9881('0x3e')]){_0x5c2815[_0x9881('0x3f')]=[{'all':!![]}];}return db['Cdr'][_0x9881('0x40')](_0x5c2815);})[_0x9881('0x21')](function(_0x4fe13d){_0x3d7120[_0x9881('0x41')]=_0x4fe13d;return _0x3d7120;})[_0x9881('0x21')](respondWithFilteredResult(_0x41fe0d,_0x5c2815))[_0x9881('0x42')](handleError(_0x41fe0d,null));};exports[_0x9881('0x43')]=function(_0x424ed1,_0x1eae2f){var _0x2ac606={'raw':!![],'where':{'id':_0x424ed1[_0x9881('0x44')]['id']}},_0x4421bc={};_0x4421bc[_0x9881('0x2d')]=_['keys'](db[_0x9881('0x28')][_0x9881('0x29')]);_0x4421bc[_0x9881('0x2e')]=_[_0x9881('0x2f')](_0x424ed1[_0x9881('0x2e')]);_0x4421bc['filters']=_[_0x9881('0x31')](_0x4421bc[_0x9881('0x2d')],_0x4421bc[_0x9881('0x2e')]);_0x2ac606[_0x9881('0x32')]=_['intersection'](_0x4421bc[_0x9881('0x2d')],qs[_0x9881('0x33')](_0x424ed1[_0x9881('0x2e')]['fields']));_0x2ac606[_0x9881('0x32')]=_0x2ac606[_0x9881('0x32')][_0x9881('0x34')]?_0x2ac606[_0x9881('0x32')]:_0x4421bc[_0x9881('0x2d')];if(_0x424ed1[_0x9881('0x2e')][_0x9881('0x3e')]){_0x2ac606[_0x9881('0x3f')]=[{'all':!![]}];}_0x2ac606=_[_0x9881('0x3a')]({},_0x2ac606,_0x424ed1[_0x9881('0x3d')]);return db['Cdr'][_0x9881('0x45')](_0x2ac606)[_0x9881('0x21')](handleEntityNotFound(_0x1eae2f,null))[_0x9881('0x21')](respondWithResult(_0x1eae2f,null))['catch'](handleError(_0x1eae2f,null));};exports[_0x9881('0x46')]=function(_0x24a52b,_0x1e1f0f){return db['Cdr']['create'](_0x24a52b[_0x9881('0x47')],{})[_0x9881('0x21')](respondWithResult(_0x1e1f0f,0xc9))[_0x9881('0x42')](handleError(_0x1e1f0f,null));};exports[_0x9881('0x48')]=function(_0x49c478,_0x514263){if(_0x49c478[_0x9881('0x47')]['id']){delete _0x49c478[_0x9881('0x47')]['id'];}return db[_0x9881('0x28')]['find']({'where':{'id':_0x49c478[_0x9881('0x44')]['id']}})[_0x9881('0x21')](handleEntityNotFound(_0x514263,null))['then'](saveUpdates(_0x49c478[_0x9881('0x47')],null))[_0x9881('0x21')](respondWithResult(_0x514263,null))[_0x9881('0x42')](handleError(_0x514263,null));};exports[_0x9881('0x49')]=function(_0x21720a,_0x32cb89){return db[_0x9881('0x28')]['find']({'where':{'id':_0x21720a[_0x9881('0x44')]['id']}})['then'](handleEntityNotFound(_0x32cb89,null))[_0x9881('0x21')](removeEntity(_0x32cb89,null))[_0x9881('0x42')](handleError(_0x32cb89,null));};exports[_0x9881('0x4a')]=function(_0x16ca26,_0x590acc){return db['Cdr'][_0x9881('0x4a')]()[_0x9881('0x21')](respondWithResult(_0x590acc,null))[_0x9881('0x42')](handleError(_0x590acc,null));};
\ No newline at end of file
+var _0x86f4=['bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','Cdr','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x1daed9,_0xa4075e){var _0x37b134=function(_0x260e8f){while(--_0x260e8f){_0x1daed9['push'](_0x1daed9['shift']());}};_0x37b134(++_0xa4075e);}(_0x86f4,0x18a));var _0x486f=function(_0x2814f3,_0x593a48){_0x2814f3=_0x2814f3-0x0;var _0x3a38e3=_0x86f4[_0x2814f3];return _0x3a38e3;};'use strict';var emlformat=require(_0x486f('0x0'));var rimraf=require(_0x486f('0x1'));var zipdir=require(_0x486f('0x2'));var jsonpatch=require(_0x486f('0x3'));var rp=require(_0x486f('0x4'));var moment=require(_0x486f('0x5'));var BPromise=require(_0x486f('0x6'));var Mustache=require('mustache');var util=require(_0x486f('0x7'));var path=require(_0x486f('0x8'));var sox=require('sox');var csv=require(_0x486f('0x9'));var ejs=require(_0x486f('0xa'));var fs=require('fs');var fs_extra=require(_0x486f('0xb'));var _=require(_0x486f('0xc'));var squel=require(_0x486f('0xd'));var crypto=require(_0x486f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x486f('0xf'));var toCsv=require(_0x486f('0x9'));var querystring=require(_0x486f('0x10'));var Papa=require(_0x486f('0x11'));var Redis=require(_0x486f('0x12'));var authService=require(_0x486f('0x13'));var qs=require(_0x486f('0x14'));var as=require(_0x486f('0x15'));var hardwareService=require(_0x486f('0x16'));var logger=require(_0x486f('0x17'))(_0x486f('0x18'));var utils=require(_0x486f('0x19'));var config=require(_0x486f('0x1a'));var licenseUtil=require(_0x486f('0x1b'));var db=require(_0x486f('0x1c'))['db'];function respondWithStatusCode(_0x4312fb,_0x1c4e55){_0x1c4e55=_0x1c4e55||0xcc;return function(_0x4eb4f9){if(_0x4eb4f9){return _0x4312fb[_0x486f('0x1d')](_0x1c4e55);}return _0x4312fb['status'](_0x1c4e55)[_0x486f('0x1e')]();};}function respondWithResult(_0x2cc608,_0x1ac871){_0x1ac871=_0x1ac871||0xc8;return function(_0x50bee8){if(_0x50bee8){return _0x2cc608['status'](_0x1ac871)[_0x486f('0x1f')](_0x50bee8);}};}function respondWithFilteredResult(_0x3a4fef,_0x51334f){return function(_0x16830e){if(_0x16830e){var _0x2ab753=typeof _0x51334f[_0x486f('0x20')]==='undefined'&&typeof _0x51334f['limit']===_0x486f('0x21');var _0x3eeae0=_0x16830e[_0x486f('0x22')];var _0x39bfac=_0x2ab753?0x0:_0x51334f['offset'];var _0x59deb8=_0x2ab753?_0x16830e[_0x486f('0x22')]:_0x51334f[_0x486f('0x20')]+_0x51334f[_0x486f('0x23')];var _0x20a1f7;if(_0x59deb8>=_0x3eeae0){_0x59deb8=_0x3eeae0;_0x20a1f7=0xc8;}else{_0x20a1f7=0xce;}_0x3a4fef[_0x486f('0x24')](_0x20a1f7);return _0x3a4fef[_0x486f('0x25')](_0x486f('0x26'),_0x39bfac+'-'+_0x59deb8+'/'+_0x3eeae0)[_0x486f('0x1f')](_0x16830e);}return null;};}function patchUpdates(_0xe0b1cc){return function(_0x3d79bc){try{jsonpatch[_0x486f('0x27')](_0x3d79bc,_0xe0b1cc,!![]);}catch(_0x4ccac0){return BPromise[_0x486f('0x28')](_0x4ccac0);}return _0x3d79bc[_0x486f('0x29')]();};}function saveUpdates(_0x26a909,_0x4a0eb5){return function(_0x4d784e){if(_0x4d784e){return _0x4d784e[_0x486f('0x2a')](_0x26a909)[_0x486f('0x2b')](function(_0x16a530){return _0x16a530;});}return null;};}function removeEntity(_0x14b309,_0x351f81){return function(_0x26822b){if(_0x26822b){return _0x26822b[_0x486f('0x2c')]()[_0x486f('0x2b')](function(){_0x14b309[_0x486f('0x24')](0xcc)[_0x486f('0x1e')]();});}};}function handleEntityNotFound(_0x2e983b,_0x71a26f){return function(_0x387462){if(!_0x387462){_0x2e983b[_0x486f('0x1d')](0x194);}return _0x387462;};}function handleError(_0x8b3277,_0x30b322){_0x30b322=_0x30b322||0x1f4;return function(_0x6f1e8e){logger[_0x486f('0x2d')](_0x6f1e8e[_0x486f('0x2e')]);if(_0x6f1e8e[_0x486f('0x2f')]){delete _0x6f1e8e[_0x486f('0x2f')];}_0x8b3277[_0x486f('0x24')](_0x30b322)['send'](_0x6f1e8e);};}exports['index']=function(_0x52fb3a,_0x5b4718){var _0x173512={},_0x5c994a={},_0x2003a3={'count':0x0,'rows':[]};var _0x3ffa45=_['map'](db[_0x486f('0x30')]['rawAttributes'],function(_0x1f9dee){return{'name':_0x1f9dee[_0x486f('0x31')],'type':_0x1f9dee[_0x486f('0x32')][_0x486f('0x33')]};});_0x5c994a[_0x486f('0x34')]=_[_0x486f('0x35')](_0x3ffa45,'name');_0x5c994a[_0x486f('0x36')]=_[_0x486f('0x37')](_0x52fb3a[_0x486f('0x36')]);_0x5c994a[_0x486f('0x38')]=_[_0x486f('0x39')](_0x5c994a[_0x486f('0x34')],_0x5c994a[_0x486f('0x36')]);_0x173512[_0x486f('0x3a')]=_['intersection'](_0x5c994a[_0x486f('0x34')],qs[_0x486f('0x3b')](_0x52fb3a['query'][_0x486f('0x3b')]));_0x173512[_0x486f('0x3a')]=_0x173512[_0x486f('0x3a')][_0x486f('0x3c')]?_0x173512[_0x486f('0x3a')]:_0x5c994a['model'];if(!_0x52fb3a[_0x486f('0x36')][_0x486f('0x3d')](_0x486f('0x3e'))){_0x173512[_0x486f('0x23')]=qs[_0x486f('0x23')](_0x52fb3a[_0x486f('0x36')][_0x486f('0x23')]);_0x173512['offset']=qs[_0x486f('0x20')](_0x52fb3a[_0x486f('0x36')][_0x486f('0x20')]);}_0x173512['order']=qs['sort'](_0x52fb3a[_0x486f('0x36')][_0x486f('0x3f')]);_0x173512['where']=qs[_0x486f('0x38')](_['pick'](_0x52fb3a[_0x486f('0x36')],_0x5c994a[_0x486f('0x38')]),_0x3ffa45);if(_0x52fb3a['query']['filter']){_0x173512[_0x486f('0x40')]=_[_0x486f('0x41')](_0x173512[_0x486f('0x40')],{'$or':_[_0x486f('0x35')](_0x3ffa45,function(_0xdedd85){if(_0xdedd85[_0x486f('0x32')]!==_0x486f('0x42')){var _0x1742e0={};_0x1742e0[_0xdedd85[_0x486f('0x2f')]]={'$like':'%'+_0x52fb3a[_0x486f('0x36')][_0x486f('0x43')]+'%'};return _0x1742e0;}})});}_0x173512=_[_0x486f('0x41')]({},_0x173512,_0x52fb3a[_0x486f('0x44')]);var _0x43d9be={'where':_0x173512['where']};return db[_0x486f('0x30')][_0x486f('0x22')](_0x43d9be)['then'](function(_0x12f7dc){_0x2003a3[_0x486f('0x22')]=_0x12f7dc;if(_0x52fb3a[_0x486f('0x36')][_0x486f('0x45')]){_0x173512[_0x486f('0x46')]=[{'all':!![]}];}return db[_0x486f('0x30')][_0x486f('0x47')](_0x173512);})[_0x486f('0x2b')](function(_0x3205e0){_0x2003a3['rows']=_0x3205e0;return _0x2003a3;})['then'](respondWithFilteredResult(_0x5b4718,_0x173512))[_0x486f('0x48')](handleError(_0x5b4718,null));};exports[_0x486f('0x49')]=function(_0x3cf897,_0x42ef68){var _0x2937a6={'raw':!![],'where':{'id':_0x3cf897[_0x486f('0x4a')]['id']}},_0x250979={};_0x250979[_0x486f('0x34')]=_[_0x486f('0x37')](db['Cdr'][_0x486f('0x4b')]);_0x250979[_0x486f('0x36')]=_[_0x486f('0x37')](_0x3cf897[_0x486f('0x36')]);_0x250979['filters']=_[_0x486f('0x39')](_0x250979['model'],_0x250979[_0x486f('0x36')]);_0x2937a6[_0x486f('0x3a')]=_[_0x486f('0x39')](_0x250979[_0x486f('0x34')],qs[_0x486f('0x3b')](_0x3cf897[_0x486f('0x36')]['fields']));_0x2937a6['attributes']=_0x2937a6[_0x486f('0x3a')][_0x486f('0x3c')]?_0x2937a6[_0x486f('0x3a')]:_0x250979[_0x486f('0x34')];if(_0x3cf897['query'][_0x486f('0x45')]){_0x2937a6[_0x486f('0x46')]=[{'all':!![]}];}_0x2937a6=_[_0x486f('0x41')]({},_0x2937a6,_0x3cf897['options']);return db[_0x486f('0x30')][_0x486f('0x4c')](_0x2937a6)[_0x486f('0x2b')](handleEntityNotFound(_0x42ef68,null))[_0x486f('0x2b')](respondWithResult(_0x42ef68,null))[_0x486f('0x48')](handleError(_0x42ef68,null));};exports[_0x486f('0x4d')]=function(_0xb65e98,_0x21f222){return db['Cdr'][_0x486f('0x4d')](_0xb65e98['body'],{})[_0x486f('0x2b')](respondWithResult(_0x21f222,0xc9))[_0x486f('0x48')](handleError(_0x21f222,null));};exports[_0x486f('0x2a')]=function(_0x1055cf,_0x34033e){if(_0x1055cf[_0x486f('0x4e')]['id']){delete _0x1055cf['body']['id'];}return db[_0x486f('0x30')][_0x486f('0x4c')]({'where':{'id':_0x1055cf[_0x486f('0x4a')]['id']}})[_0x486f('0x2b')](handleEntityNotFound(_0x34033e,null))[_0x486f('0x2b')](saveUpdates(_0x1055cf[_0x486f('0x4e')],null))[_0x486f('0x2b')](respondWithResult(_0x34033e,null))[_0x486f('0x48')](handleError(_0x34033e,null));};exports[_0x486f('0x2c')]=function(_0x5cd989,_0x300de9){return db[_0x486f('0x30')][_0x486f('0x4c')]({'where':{'id':_0x5cd989['params']['id']}})[_0x486f('0x2b')](handleEntityNotFound(_0x300de9,null))[_0x486f('0x2b')](removeEntity(_0x300de9,null))[_0x486f('0x48')](handleError(_0x300de9,null));};exports['describe']=function(_0x195c9c,_0x372d2f){return db[_0x486f('0x30')][_0x486f('0x4f')]()['then'](respondWithResult(_0x372d2f,null))['catch'](handleError(_0x372d2f,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index b390a9d..f3180c8 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0xd94408,_0x31df46){var _0x5b06ee=function(_0x37911c){while(--_0x37911c){_0xd94408['push'](_0xd94408['shift']());}};_0x5b06ee(++_0x31df46);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x592f08,_0x25c7b6){var _0x4cd8fb=function(_0x5887b1){while(--_0x5887b1){_0x592f08['push'](_0x592f08['shift']());}};_0x4cd8fb(++_0x25c7b6);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 68e4dec..4827642 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 _0x8669=['randomstring','ioredis','../../config/logger','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x8669,0x1eb));var _0x9866=function(_0x23e015,_0x44c03d){_0x23e015=_0x23e015-0x0;var _0x5e5208=_0x8669[_0x23e015];return _0x5e5208;};'use strict';var _=require('lodash');var util=require(_0x9866('0x0'));var moment=require(_0x9866('0x1'));var BPromise=require(_0x9866('0x2'));var rs=require(_0x9866('0x3'));var fs=require('fs');var Redis=require(_0x9866('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9866('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9866('0x6'));var client=jayson[_0x9866('0x7')][_0x9866('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x41d1d5,_0x3a2382,_0x5c67a7){return new BPromise(function(_0x541138,_0x4687a9){return client['request'](_0x41d1d5,_0x5c67a7)[_0x9866('0x9')](function(_0x157d36){logger[_0x9866('0xa')](_0x9866('0xb'),_0x3a2382,_0x9866('0xc'));logger[_0x9866('0xd')](_0x9866('0xe'),_0x3a2382,'request\x20sent',JSON['stringify'](_0x157d36));if(_0x157d36[_0x9866('0xf')]){if(_0x157d36[_0x9866('0xf')][_0x9866('0x10')]===0x1f4){logger['error'](_0x9866('0xb'),_0x3a2382,_0x157d36[_0x9866('0xf')]['message']);return _0x4687a9(_0x157d36[_0x9866('0xf')][_0x9866('0x11')]);}logger[_0x9866('0xf')](_0x9866('0xb'),_0x3a2382,_0x157d36[_0x9866('0xf')][_0x9866('0x11')]);return _0x541138(_0x157d36[_0x9866('0xf')][_0x9866('0x11')]);}else{logger['info'](_0x9866('0xb'),_0x3a2382,'request\x20sent');_0x541138(_0x157d36[_0x9866('0x12')][_0x9866('0x11')]);}})['catch'](function(_0x42daf2){logger[_0x9866('0xf')](_0x9866('0xb'),_0x3a2382,_0x42daf2);_0x4687a9(_0x42daf2);});});}
\ No newline at end of file
+var _0xcece=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash'];(function(_0x11b502,_0x3b3f9){var _0x532480=function(_0x1b55a7){while(--_0x1b55a7){_0x11b502['push'](_0x11b502['shift']());}};_0x532480(++_0x3b3f9);}(_0xcece,0x12f));var _0xecec=function(_0x385329,_0x4fbae6){_0x385329=_0x385329-0x0;var _0x2d88dc=_0xcece[_0x385329];return _0x2d88dc;};'use strict';var _=require(_0xecec('0x0'));var util=require('util');var moment=require(_0xecec('0x1'));var BPromise=require(_0xecec('0x2'));var rs=require(_0xecec('0x3'));var fs=require('fs');var Redis=require(_0xecec('0x4'));var db=require(_0xecec('0x5'))['db'];var utils=require(_0xecec('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xecec('0x7'));var jayson=require(_0xecec('0x8'));var client=jayson['client'][_0xecec('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e3568,_0x2dd0f1,_0x58886a){return new BPromise(function(_0x1f51fa,_0x575e64){return client[_0xecec('0xa')](_0x3e3568,_0x58886a)[_0xecec('0xb')](function(_0x4ba43a){logger[_0xecec('0xc')](_0xecec('0xd'),_0x2dd0f1,_0xecec('0xe'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x2dd0f1,_0xecec('0xe'),JSON['stringify'](_0x4ba43a));if(_0x4ba43a['error']){if(_0x4ba43a[_0xecec('0xf')]['code']===0x1f4){logger['error'](_0xecec('0xd'),_0x2dd0f1,_0x4ba43a[_0xecec('0xf')][_0xecec('0x10')]);return _0x575e64(_0x4ba43a[_0xecec('0xf')][_0xecec('0x10')]);}logger[_0xecec('0xf')](_0xecec('0xd'),_0x2dd0f1,_0x4ba43a['error'][_0xecec('0x10')]);return _0x1f51fa(_0x4ba43a[_0xecec('0xf')][_0xecec('0x10')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x2dd0f1,_0xecec('0xe'));_0x1f51fa(_0x4ba43a[_0xecec('0x11')][_0xecec('0x10')]);}})[_0xecec('0x12')](function(_0x158312){logger['error'](_0xecec('0xd'),_0x2dd0f1,_0x158312);_0x575e64(_0x158312);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index e7d226d..8e7c34a 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(_0x42f3e4,_0x2646fd){var _0x1d7aa6=function(_0x4a721d){while(--_0x4a721d){_0x42f3e4['push'](_0x42f3e4['shift']());}};_0x1d7aa6(++_0x2646fd);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2b30e1,_0x5989e0){var _0xa082ed=function(_0x502150){while(--_0x502150){_0x2b30e1['push'](_0x2b30e1['shift']());}};_0xa082ed(++_0x5989e0);}(_0xb10b,0x12a));var _0xbb10=function(_0x27650e,_0x278f7a){_0x27650e=_0x27650e-0x0;var _0x28fe08=_0xb10b[_0x27650e];return _0x28fe08;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 2d1e417..1c21c6e 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 _0x1912=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1912,0x9d));var _0x2191=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1912[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x2191('0x0'));module[_0x2191('0x1')]={'priority':{'type':Sequelize[_0x2191('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2191('0x3')],'allowNull':![],'defaultValue':_0x2191('0x4')},'appdata':{'type':Sequelize[_0x2191('0x5')]()},'description':{'type':Sequelize[_0x2191('0x3')]},'interval':{'type':Sequelize[_0x2191('0x3')],'defaultValue':_0x2191('0x6')}};
\ No newline at end of file
+var _0xb492=['STRING','noop','TEXT','*,*,*,*'];(function(_0x36c8c6,_0x527c52){var _0x45c1e0=function(_0x41daf3){while(--_0x41daf3){_0x36c8c6['push'](_0x36c8c6['shift']());}};_0x45c1e0(++_0x527c52);}(_0xb492,0x8c));var _0x2b49=function(_0x26f451,_0x11a72e){_0x26f451=_0x26f451-0x0;var _0x342138=_0xb492[_0x26f451];return _0x342138;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x2b49('0x0')],'allowNull':![],'defaultValue':_0x2b49('0x1')},'appdata':{'type':Sequelize[_0x2b49('0x2')]()},'description':{'type':Sequelize[_0x2b49('0x0')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x2b49('0x3')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index b758740..2824979 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 _0x0db9=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','stack','name','send','show','model','keys','rawAttributes','query','intersection','fields','attributes','includeAll','include','merge','options','catch','body','ChatApplication','find','destroy','params','eml-format','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring'];(function(_0x45346d,_0xffd56b){var _0x5ce7ca=function(_0x27ce87){while(--_0x27ce87){_0x45346d['push'](_0x45346d['shift']());}};_0x5ce7ca(++_0xffd56b);}(_0x0db9,0xa3));var _0x90db=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x0db9[_0x4f9b18];return _0x29f20c;};'use strict';var emlformat=require(_0x90db('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x90db('0x1'));var moment=require(_0x90db('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x90db('0x3'));var util=require('util');var path=require(_0x90db('0x4'));var sox=require(_0x90db('0x5'));var csv=require('to-csv');var ejs=require(_0x90db('0x6'));var fs=require('fs');var fs_extra=require(_0x90db('0x7'));var _=require(_0x90db('0x8'));var squel=require(_0x90db('0x9'));var crypto=require(_0x90db('0xa'));var jsforce=require(_0x90db('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x90db('0xc'));var querystring=require(_0x90db('0xd'));var Papa=require(_0x90db('0xe'));var Redis=require(_0x90db('0xf'));var authService=require(_0x90db('0x10'));var qs=require(_0x90db('0x11'));var as=require(_0x90db('0x12'));var hardwareService=require(_0x90db('0x13'));var logger=require(_0x90db('0x14'))(_0x90db('0x15'));var utils=require(_0x90db('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x90db('0x17'));var db=require(_0x90db('0x18'))['db'];function respondWithStatusCode(_0x45ad3c,_0x436327){_0x436327=_0x436327||0xcc;return function(_0x1b410d){if(_0x1b410d){return _0x45ad3c[_0x90db('0x19')](_0x436327);}return _0x45ad3c[_0x90db('0x1a')](_0x436327)[_0x90db('0x1b')]();};}function respondWithResult(_0x7826f7,_0x309aea){_0x309aea=_0x309aea||0xc8;return function(_0x334e22){if(_0x334e22){return _0x7826f7[_0x90db('0x1a')](_0x309aea)[_0x90db('0x1c')](_0x334e22);}};}function respondWithFilteredResult(_0xda2abe,_0x544226){return function(_0x3124d4){if(_0x3124d4){var _0x5ef456=typeof _0x544226[_0x90db('0x1d')]===_0x90db('0x1e')&&typeof _0x544226[_0x90db('0x1f')]===_0x90db('0x1e');var _0x32ff04=_0x3124d4[_0x90db('0x20')];var _0x15e33e=_0x5ef456?0x0:_0x544226[_0x90db('0x1d')];var _0x24a16a=_0x5ef456?_0x3124d4[_0x90db('0x20')]:_0x544226['offset']+_0x544226[_0x90db('0x1f')];var _0x445a22;if(_0x24a16a>=_0x32ff04){_0x24a16a=_0x32ff04;_0x445a22=0xc8;}else{_0x445a22=0xce;}_0xda2abe['status'](_0x445a22);return _0xda2abe['set'](_0x90db('0x21'),_0x15e33e+'-'+_0x24a16a+'/'+_0x32ff04)[_0x90db('0x1c')](_0x3124d4);}return null;};}function patchUpdates(_0x300dc2){return function(_0x3a58c4){try{jsonpatch[_0x90db('0x22')](_0x3a58c4,_0x300dc2,!![]);}catch(_0x168eaf){return BPromise[_0x90db('0x23')](_0x168eaf);}return _0x3a58c4['save']();};}function saveUpdates(_0xb45340,_0x1aeab9){return function(_0x23934a){if(_0x23934a){return _0x23934a[_0x90db('0x24')](_0xb45340)['then'](function(_0x43028e){return _0x43028e;});}return null;};}function removeEntity(_0x5a98f6,_0x459068){return function(_0x19f9c6){if(_0x19f9c6){return _0x19f9c6['destroy']()[_0x90db('0x25')](function(){_0x5a98f6[_0x90db('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f8469,_0x3e3fbd){return function(_0x5b3c09){if(!_0x5b3c09){_0x2f8469[_0x90db('0x19')](0x194);}return _0x5b3c09;};}function handleError(_0xe026cf,_0x1cc660){_0x1cc660=_0x1cc660||0x1f4;return function(_0x94cd84){logger['error'](_0x94cd84[_0x90db('0x26')]);if(_0x94cd84[_0x90db('0x27')]){delete _0x94cd84[_0x90db('0x27')];}_0xe026cf[_0x90db('0x1a')](_0x1cc660)[_0x90db('0x28')](_0x94cd84);};}exports[_0x90db('0x29')]=function(_0x44b5b6,_0x3c7f67){var _0x4c6311={'raw':!![],'where':{'id':_0x44b5b6['params']['id']}},_0x3489d1={};_0x3489d1[_0x90db('0x2a')]=_[_0x90db('0x2b')](db['ChatApplication'][_0x90db('0x2c')]);_0x3489d1[_0x90db('0x2d')]=_[_0x90db('0x2b')](_0x44b5b6[_0x90db('0x2d')]);_0x3489d1['filters']=_[_0x90db('0x2e')](_0x3489d1[_0x90db('0x2a')],_0x3489d1[_0x90db('0x2d')]);_0x4c6311['attributes']=_['intersection'](_0x3489d1[_0x90db('0x2a')],qs[_0x90db('0x2f')](_0x44b5b6[_0x90db('0x2d')]['fields']));_0x4c6311[_0x90db('0x30')]=_0x4c6311[_0x90db('0x30')]['length']?_0x4c6311[_0x90db('0x30')]:_0x3489d1[_0x90db('0x2a')];if(_0x44b5b6['query'][_0x90db('0x31')]){_0x4c6311[_0x90db('0x32')]=[{'all':!![]}];}_0x4c6311=_[_0x90db('0x33')]({},_0x4c6311,_0x44b5b6[_0x90db('0x34')]);return db['ChatApplication']['find'](_0x4c6311)[_0x90db('0x25')](handleEntityNotFound(_0x3c7f67,null))['then'](respondWithResult(_0x3c7f67,null))[_0x90db('0x35')](handleError(_0x3c7f67,null));};exports[_0x90db('0x24')]=function(_0x45cebb,_0x540176){if(_0x45cebb[_0x90db('0x36')]['id']){delete _0x45cebb['body']['id'];}return db[_0x90db('0x37')][_0x90db('0x38')]({'where':{'id':_0x45cebb['params']['id']}})[_0x90db('0x25')](handleEntityNotFound(_0x540176,null))[_0x90db('0x25')](saveUpdates(_0x45cebb[_0x90db('0x36')],null))[_0x90db('0x25')](respondWithResult(_0x540176,null))[_0x90db('0x35')](handleError(_0x540176,null));};exports[_0x90db('0x39')]=function(_0x4de656,_0x88789f){return db[_0x90db('0x37')]['find']({'where':{'id':_0x4de656[_0x90db('0x3a')]['id']}})[_0x90db('0x25')](handleEntityNotFound(_0x88789f,null))[_0x90db('0x25')](removeEntity(_0x88789f,null))['catch'](handleError(_0x88789f,null));};
\ No newline at end of file
+var _0x7e05=['path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','status','Content-Range','reject','save','update','then','destroy','error','name','send','params','keys','ChatApplication','query','filters','model','attributes','intersection','fields','includeAll','include','merge','find','catch','body','eml-format','rimraf','fast-json-patch','moment','bluebird'];(function(_0x1cbf75,_0x325719){var _0xe8aec9=function(_0x1af7ec){while(--_0x1af7ec){_0x1cbf75['push'](_0x1cbf75['shift']());}};_0xe8aec9(++_0x325719);}(_0x7e05,0x69));var _0x57e0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7e05[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x57e0('0x0'));var rimraf=require(_0x57e0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x57e0('0x2'));var rp=require('request-promise');var moment=require(_0x57e0('0x3'));var BPromise=require(_0x57e0('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x57e0('0x5'));var sox=require(_0x57e0('0x6'));var csv=require(_0x57e0('0x7'));var ejs=require(_0x57e0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x57e0('0x9'));var squel=require('squel');var crypto=require(_0x57e0('0xa'));var jsforce=require(_0x57e0('0xb'));var deskjs=require(_0x57e0('0xc'));var toCsv=require(_0x57e0('0x7'));var querystring=require(_0x57e0('0xd'));var Papa=require(_0x57e0('0xe'));var Redis=require(_0x57e0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x57e0('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x57e0('0x11'));var logger=require('../../config/logger')(_0x57e0('0x12'));var utils=require(_0x57e0('0x13'));var config=require(_0x57e0('0x14'));var licenseUtil=require(_0x57e0('0x15'));var db=require(_0x57e0('0x16'))['db'];function respondWithStatusCode(_0x254141,_0x142d1f){_0x142d1f=_0x142d1f||0xcc;return function(_0x114d14){if(_0x114d14){return _0x254141[_0x57e0('0x17')](_0x142d1f);}return _0x254141['status'](_0x142d1f)[_0x57e0('0x18')]();};}function respondWithResult(_0x1ed2c1,_0x4a4562){_0x4a4562=_0x4a4562||0xc8;return function(_0x32babd){if(_0x32babd){return _0x1ed2c1['status'](_0x4a4562)[_0x57e0('0x19')](_0x32babd);}};}function respondWithFilteredResult(_0x3797e2,_0x746a9d){return function(_0x2e0beb){if(_0x2e0beb){var _0x304ec4=typeof _0x746a9d['offset']===_0x57e0('0x1a')&&typeof _0x746a9d[_0x57e0('0x1b')]===_0x57e0('0x1a');var _0x22c344=_0x2e0beb[_0x57e0('0x1c')];var _0x52cf5a=_0x304ec4?0x0:_0x746a9d[_0x57e0('0x1d')];var _0x2500ea=_0x304ec4?_0x2e0beb[_0x57e0('0x1c')]:_0x746a9d[_0x57e0('0x1d')]+_0x746a9d[_0x57e0('0x1b')];var _0x1f5dce;if(_0x2500ea>=_0x22c344){_0x2500ea=_0x22c344;_0x1f5dce=0xc8;}else{_0x1f5dce=0xce;}_0x3797e2[_0x57e0('0x1e')](_0x1f5dce);return _0x3797e2['set'](_0x57e0('0x1f'),_0x52cf5a+'-'+_0x2500ea+'/'+_0x22c344)[_0x57e0('0x19')](_0x2e0beb);}return null;};}function patchUpdates(_0x2007ff){return function(_0x3814a3){try{jsonpatch['apply'](_0x3814a3,_0x2007ff,!![]);}catch(_0x143e51){return BPromise[_0x57e0('0x20')](_0x143e51);}return _0x3814a3[_0x57e0('0x21')]();};}function saveUpdates(_0x3bc1c0,_0x5d83c6){return function(_0xc5b15){if(_0xc5b15){return _0xc5b15[_0x57e0('0x22')](_0x3bc1c0)[_0x57e0('0x23')](function(_0x4dbdc7){return _0x4dbdc7;});}return null;};}function removeEntity(_0x595696,_0x44e84c){return function(_0x3a6a14){if(_0x3a6a14){return _0x3a6a14[_0x57e0('0x24')]()[_0x57e0('0x23')](function(){_0x595696[_0x57e0('0x1e')](0xcc)[_0x57e0('0x18')]();});}};}function handleEntityNotFound(_0x46fff4,_0x257e51){return function(_0x34b9a4){if(!_0x34b9a4){_0x46fff4['sendStatus'](0x194);}return _0x34b9a4;};}function handleError(_0x3a3047,_0x541c24){_0x541c24=_0x541c24||0x1f4;return function(_0x12a4ec){logger[_0x57e0('0x25')](_0x12a4ec['stack']);if(_0x12a4ec[_0x57e0('0x26')]){delete _0x12a4ec[_0x57e0('0x26')];}_0x3a3047['status'](_0x541c24)[_0x57e0('0x27')](_0x12a4ec);};}exports['show']=function(_0x5d06bc,_0x1a5402){var _0x1b7d9c={'raw':!![],'where':{'id':_0x5d06bc[_0x57e0('0x28')]['id']}},_0x2cef3e={};_0x2cef3e['model']=_[_0x57e0('0x29')](db[_0x57e0('0x2a')]['rawAttributes']);_0x2cef3e['query']=_['keys'](_0x5d06bc[_0x57e0('0x2b')]);_0x2cef3e[_0x57e0('0x2c')]=_['intersection'](_0x2cef3e[_0x57e0('0x2d')],_0x2cef3e[_0x57e0('0x2b')]);_0x1b7d9c[_0x57e0('0x2e')]=_[_0x57e0('0x2f')](_0x2cef3e['model'],qs[_0x57e0('0x30')](_0x5d06bc[_0x57e0('0x2b')]['fields']));_0x1b7d9c['attributes']=_0x1b7d9c['attributes']['length']?_0x1b7d9c['attributes']:_0x2cef3e[_0x57e0('0x2d')];if(_0x5d06bc[_0x57e0('0x2b')][_0x57e0('0x31')]){_0x1b7d9c[_0x57e0('0x32')]=[{'all':!![]}];}_0x1b7d9c=_[_0x57e0('0x33')]({},_0x1b7d9c,_0x5d06bc['options']);return db['ChatApplication'][_0x57e0('0x34')](_0x1b7d9c)[_0x57e0('0x23')](handleEntityNotFound(_0x1a5402,null))[_0x57e0('0x23')](respondWithResult(_0x1a5402,null))[_0x57e0('0x35')](handleError(_0x1a5402,null));};exports[_0x57e0('0x22')]=function(_0x1e1b90,_0x267d30){if(_0x1e1b90[_0x57e0('0x36')]['id']){delete _0x1e1b90[_0x57e0('0x36')]['id'];}return db[_0x57e0('0x2a')][_0x57e0('0x34')]({'where':{'id':_0x1e1b90['params']['id']}})[_0x57e0('0x23')](handleEntityNotFound(_0x267d30,null))[_0x57e0('0x23')](saveUpdates(_0x1e1b90['body'],null))['then'](respondWithResult(_0x267d30,null))[_0x57e0('0x35')](handleError(_0x267d30,null));};exports['destroy']=function(_0x24b74f,_0x3ae7be){return db['ChatApplication']['find']({'where':{'id':_0x24b74f[_0x57e0('0x28')]['id']}})[_0x57e0('0x23')](handleEntityNotFound(_0x3ae7be,null))[_0x57e0('0x23')](removeEntity(_0x3ae7be,null))[_0x57e0('0x35')](handleError(_0x3ae7be,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 4993361..7fad744 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 _0x28eb=['utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','define','ChatApplication'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x28eb,0x105));var _0xb28e=function(_0x266ca7,_0x15005f){_0x266ca7=_0x266ca7-0x0;var _0x2969ca=_0x28eb[_0x266ca7];return _0x2969ca;};'use strict';var _=require(_0xb28e('0x0'));var util=require(_0xb28e('0x1'));var logger=require(_0xb28e('0x2'))('api');var moment=require(_0xb28e('0x3'));var BPromise=require(_0xb28e('0x4'));var rp=require(_0xb28e('0x5'));var fs=require('fs');var path=require(_0xb28e('0x6'));var rimraf=require(_0xb28e('0x7'));var config=require(_0xb28e('0x8'));var attributes=require(_0xb28e('0x9'));module['exports']=function(_0x42b823,_0x4638f9){return _0x42b823[_0xb28e('0xa')](_0xb28e('0xb'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb28e('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xfd25=['utf8mb4','lodash','api','moment','bluebird','request-promise','path','rimraf','./chatApplication.attributes','exports','define','chat_applications'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xfd25,0x169));var _0x5fd2=function(_0x4b31ea,_0x4dbc5f){_0x4b31ea=_0x4b31ea-0x0;var _0x3bb0f5=_0xfd25[_0x4b31ea];return _0x3bb0f5;};'use strict';var _=require(_0x5fd2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5fd2('0x1'));var moment=require(_0x5fd2('0x2'));var BPromise=require(_0x5fd2('0x3'));var rp=require(_0x5fd2('0x4'));var fs=require('fs');var path=require(_0x5fd2('0x5'));var rimraf=require(_0x5fd2('0x6'));var config=require('../../config/environment');var attributes=require(_0x5fd2('0x7'));module[_0x5fd2('0x8')]=function(_0x31ddb3,_0xbee3e){return _0x31ddb3[_0x5fd2('0x9')]('ChatApplication',attributes,{'tableName':_0x5fd2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5fd2('0xb'),'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 af7a4fd..b02491a 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 _0x906c=['result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x1f7413,_0x3388c3){var _0x2d2775=function(_0x5e5b4){while(--_0x5e5b4){_0x1f7413['push'](_0x1f7413['shift']());}};_0x2d2775(++_0x3388c3);}(_0x906c,0x192));var _0xc906=function(_0x4b759f,_0x25b082){_0x4b759f=_0x4b759f-0x0;var _0x4518cc=_0x906c[_0x4b759f];return _0x4518cc;};'use strict';var _=require(_0xc906('0x0'));var util=require('util');var moment=require(_0xc906('0x1'));var BPromise=require('bluebird');var rs=require(_0xc906('0x2'));var fs=require('fs');var Redis=require(_0xc906('0x3'));var db=require(_0xc906('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc906('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc906('0x6'));var client=jayson['client'][_0xc906('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x30cefe,_0x412740,_0x2ae2a1){return new BPromise(function(_0x5191ea,_0xfbb96c){return client[_0xc906('0x8')](_0x30cefe,_0x2ae2a1)[_0xc906('0x9')](function(_0x3a2697){logger['info'](_0xc906('0xa'),_0x412740,_0xc906('0xb'));logger[_0xc906('0xc')](_0xc906('0xd'),_0x412740,'request\x20sent',JSON['stringify'](_0x3a2697));if(_0x3a2697[_0xc906('0xe')]){if(_0x3a2697['error'][_0xc906('0xf')]===0x1f4){logger['error'](_0xc906('0xa'),_0x412740,_0x3a2697['error'][_0xc906('0x10')]);return _0xfbb96c(_0x3a2697[_0xc906('0xe')][_0xc906('0x10')]);}logger[_0xc906('0xe')](_0xc906('0xa'),_0x412740,_0x3a2697['error']['message']);return _0x5191ea(_0x3a2697[_0xc906('0xe')][_0xc906('0x10')]);}else{logger[_0xc906('0x11')](_0xc906('0xa'),_0x412740,'request\x20sent');_0x5191ea(_0x3a2697[_0xc906('0x12')][_0xc906('0x10')]);}})[_0xc906('0x13')](function(_0x4eba5f){logger[_0xc906('0xe')](_0xc906('0xa'),_0x412740,_0x4eba5f);_0xfbb96c(_0x4eba5f);});});}
\ No newline at end of file
+var _0x6491=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','moment','bluebird'];(function(_0x33c70e,_0xd8cb0b){var _0x5a33e5=function(_0x3b7f9d){while(--_0x3b7f9d){_0x33c70e['push'](_0x33c70e['shift']());}};_0x5a33e5(++_0xd8cb0b);}(_0x6491,0x10f));var _0x1649=function(_0x3856a9,_0x59ed19){_0x3856a9=_0x3856a9-0x0;var _0x541756=_0x6491[_0x3856a9];return _0x541756;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1649('0x0'));var BPromise=require(_0x1649('0x1'));var rs=require(_0x1649('0x2'));var fs=require('fs');var Redis=require(_0x1649('0x3'));var db=require(_0x1649('0x4'))['db'];var utils=require(_0x1649('0x5'));var logger=require(_0x1649('0x6'))(_0x1649('0x7'));var config=require(_0x1649('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1649('0x9')][_0x1649('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39f62e,_0x25d8de,_0x16b1eb){return new BPromise(function(_0x40fe4d,_0x18bd9d){return client[_0x1649('0xb')](_0x39f62e,_0x16b1eb)[_0x1649('0xc')](function(_0x15d87e){logger['info'](_0x1649('0xd'),_0x25d8de,'request\x20sent');logger[_0x1649('0xe')](_0x1649('0xf'),_0x25d8de,_0x1649('0x10'),JSON['stringify'](_0x15d87e));if(_0x15d87e[_0x1649('0x11')]){if(_0x15d87e[_0x1649('0x11')][_0x1649('0x12')]===0x1f4){logger[_0x1649('0x11')](_0x1649('0xd'),_0x25d8de,_0x15d87e[_0x1649('0x11')][_0x1649('0x13')]);return _0x18bd9d(_0x15d87e['error'][_0x1649('0x13')]);}logger[_0x1649('0x11')]('ChatApplication,\x20%s,\x20%s',_0x25d8de,_0x15d87e[_0x1649('0x11')][_0x1649('0x13')]);return _0x40fe4d(_0x15d87e[_0x1649('0x11')]['message']);}else{logger['info'](_0x1649('0xd'),_0x25d8de,_0x1649('0x10'));_0x40fe4d(_0x15d87e['result']['message']);}})[_0x1649('0x14')](function(_0x143980){logger[_0x1649('0x11')](_0x1649('0xd'),_0x25d8de,_0x143980);_0x18bd9d(_0x143980);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index bae263c..6a8a66e 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 _0x212c=['isAuthenticated','show','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id'];(function(_0x352cd3,_0x3489ae){var _0x5a5be1=function(_0x58fdcd){while(--_0x58fdcd){_0x352cd3['push'](_0x352cd3['shift']());}};_0x5a5be1(++_0x3489ae);}(_0x212c,0x1af));var _0xc212=function(_0x3b7f17,_0x5ba525){_0x3b7f17=_0x3b7f17-0x0;var _0x1195dc=_0x212c[_0x3b7f17];return _0x1195dc;};'use strict';var multer=require(_0xc212('0x0'));var util=require(_0xc212('0x1'));var path=require(_0xc212('0x2'));var timeout=require(_0xc212('0x3'));var express=require('express');var router=express[_0xc212('0x4')]();var fs_extra=require(_0xc212('0x5'));var auth=require(_0xc212('0x6'));var interaction=require(_0xc212('0x7'));var config=require(_0xc212('0x8'));var controller=require('./chatApplication.controller');router[_0xc212('0x9')](_0xc212('0xa'),auth[_0xc212('0xb')](),controller[_0xc212('0xc')]);router[_0xc212('0xd')]('/:id',auth[_0xc212('0xb')](),controller[_0xc212('0xe')]);router[_0xc212('0xf')](_0xc212('0xa'),auth[_0xc212('0xb')](),controller['destroy']);module[_0xc212('0x10')]=router;
\ No newline at end of file
+var _0x67ca=['/:id','isAuthenticated','show','put','update','delete','destroy','exports','path','Router','../../components/auth/service','../../config/environment','./chatApplication.controller','get'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x67ca,0x78));var _0xa67c=function(_0x13d90d,_0x12b0f7){_0x13d90d=_0x13d90d-0x0;var _0x84bc48=_0x67ca[_0x13d90d];return _0x84bc48;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa67c('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa67c('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xa67c('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xa67c('0x3'));var controller=require(_0xa67c('0x4'));router[_0xa67c('0x5')](_0xa67c('0x6'),auth[_0xa67c('0x7')](),controller[_0xa67c('0x8')]);router[_0xa67c('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xa67c('0xa')]);router[_0xa67c('0xb')](_0xa67c('0x6'),auth[_0xa67c('0x7')](),controller[_0xa67c('0xc')]);module[_0xa67c('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index ff84bdc..367ec4e 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 _0x6c99=['sequelize','exports','STRING'];(function(_0x2410da,_0x15fc59){var _0x17db47=function(_0x4b8ed3){while(--_0x4b8ed3){_0x2410da['push'](_0x2410da['shift']());}};_0x17db47(++_0x15fc59);}(_0x6c99,0x19b));var _0x96c9=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0x6c99[_0x310504];return _0x5b36d0;};'use strict';var Sequelize=require(_0x96c9('0x0'));module[_0x96c9('0x1')]={'name':{'type':Sequelize[_0x96c9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x96c9('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x287f=['exports','STRING','BOOLEAN','sequelize'];(function(_0x35468d,_0x2a7240){var _0x30da52=function(_0xd9d2f){while(--_0xd9d2f){_0x35468d['push'](_0x35468d['shift']());}};_0x30da52(++_0x2a7240);}(_0x287f,0xc7));var _0xf287=function(_0x14080c,_0x485b3){_0x14080c=_0x14080c-0x0;var _0x254794=_0x287f[_0x14080c];return _0x254794;};'use strict';var Sequelize=require(_0xf287('0x0'));module[_0xf287('0x1')]={'name':{'type':Sequelize[_0xf287('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf287('0x2')]},'write':{'type':Sequelize[_0xf287('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 343b117..0367a10 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 _0xb982=['querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','ChatGroup','findAll','rows','catch','show','length','include','create','body','find','params','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','findOne','User','pick','getMembers','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel'];(function(_0x382e89,_0x4768c0){var _0x3a1318=function(_0x79e1ce){while(--_0x79e1ce){_0x382e89['push'](_0x382e89['shift']());}};_0x3a1318(++_0x4768c0);}(_0xb982,0x1d3));var _0x2b98=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb982[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x2b98('0x0'));var rimraf=require(_0x2b98('0x1'));var zipdir=require(_0x2b98('0x2'));var jsonpatch=require(_0x2b98('0x3'));var rp=require(_0x2b98('0x4'));var moment=require(_0x2b98('0x5'));var BPromise=require(_0x2b98('0x6'));var Mustache=require(_0x2b98('0x7'));var util=require(_0x2b98('0x8'));var path=require('path');var sox=require(_0x2b98('0x9'));var csv=require(_0x2b98('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2b98('0xb'));var _=require('lodash');var squel=require(_0x2b98('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2b98('0xd'));var Papa=require(_0x2b98('0xe'));var Redis=require(_0x2b98('0xf'));var authService=require(_0x2b98('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2b98('0x11'));var logger=require(_0x2b98('0x12'))(_0x2b98('0x13'));var utils=require('../../config/utils');var config=require(_0x2b98('0x14'));var licenseUtil=require(_0x2b98('0x15'));var db=require(_0x2b98('0x16'))['db'];config[_0x2b98('0x17')]=_[_0x2b98('0x18')](config[_0x2b98('0x17')],{'host':_0x2b98('0x19'),'port':0x18eb});var socket=require(_0x2b98('0x1a'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x2b98('0x1b')](socket);function respondWithStatusCode(_0x1534a6,_0x41f740){_0x41f740=_0x41f740||0xcc;return function(_0x58189a){if(_0x58189a){return _0x1534a6[_0x2b98('0x1c')](_0x41f740);}return _0x1534a6['status'](_0x41f740)[_0x2b98('0x1d')]();};}function respondWithResult(_0x592457,_0x36521f){_0x36521f=_0x36521f||0xc8;return function(_0x4e09e7){if(_0x4e09e7){return _0x592457[_0x2b98('0x1e')](_0x36521f)[_0x2b98('0x1f')](_0x4e09e7);}};}function respondWithFilteredResult(_0x580fff,_0x286e22){return function(_0x289c3a){if(_0x289c3a){var _0x1910eb=typeof _0x286e22[_0x2b98('0x20')]===_0x2b98('0x21')&&typeof _0x286e22['limit']==='undefined';var _0x46f101=_0x289c3a[_0x2b98('0x22')];var _0x685ea7=_0x1910eb?0x0:_0x286e22[_0x2b98('0x20')];var _0x3876bb=_0x1910eb?_0x289c3a[_0x2b98('0x22')]:_0x286e22[_0x2b98('0x20')]+_0x286e22[_0x2b98('0x23')];var _0x72a6ba;if(_0x3876bb>=_0x46f101){_0x3876bb=_0x46f101;_0x72a6ba=0xc8;}else{_0x72a6ba=0xce;}_0x580fff[_0x2b98('0x1e')](_0x72a6ba);return _0x580fff[_0x2b98('0x24')]('Content-Range',_0x685ea7+'-'+_0x3876bb+'/'+_0x46f101)['json'](_0x289c3a);}return null;};}function patchUpdates(_0x4d3e9b){return function(_0x3f2446){try{jsonpatch[_0x2b98('0x25')](_0x3f2446,_0x4d3e9b,!![]);}catch(_0x5d08a5){return BPromise[_0x2b98('0x26')](_0x5d08a5);}return _0x3f2446['save']();};}function saveUpdates(_0x4cab34,_0x457c37){return function(_0x414627){if(_0x414627){return _0x414627[_0x2b98('0x27')](_0x4cab34)[_0x2b98('0x28')](function(_0xcf3f7a){return _0xcf3f7a;});}return null;};}function removeEntity(_0x29339c,_0x313830){return function(_0x3f6498){if(_0x3f6498){return _0x3f6498[_0x2b98('0x29')]()[_0x2b98('0x28')](function(){_0x29339c['status'](0xcc)[_0x2b98('0x1d')]();});}};}function handleEntityNotFound(_0x4f80d9,_0x40c063){return function(_0x456a4a){if(!_0x456a4a){_0x4f80d9[_0x2b98('0x1c')](0x194);}return _0x456a4a;};}function handleError(_0x3f4a34,_0x3ce673){_0x3ce673=_0x3ce673||0x1f4;return function(_0x587de6){logger['error'](_0x587de6[_0x2b98('0x2a')]);if(_0x587de6['name']){delete _0x587de6[_0x2b98('0x2b')];}_0x3f4a34['status'](_0x3ce673)[_0x2b98('0x2c')](_0x587de6);};}exports['index']=function(_0x1d7d76,_0x1ec185){var _0x44e747={},_0x2b04fe={},_0x256709={'count':0x0,'rows':[]};var _0x486ae0=_[_0x2b98('0x2d')](db['ChatGroup'][_0x2b98('0x2e')],function(_0x21dff4){return{'name':_0x21dff4['fieldName'],'type':_0x21dff4[_0x2b98('0x2f')][_0x2b98('0x30')]};});_0x2b04fe[_0x2b98('0x31')]=_[_0x2b98('0x2d')](_0x486ae0,_0x2b98('0x2b'));_0x2b04fe[_0x2b98('0x32')]=_[_0x2b98('0x33')](_0x1d7d76[_0x2b98('0x32')]);_0x2b04fe[_0x2b98('0x34')]=_[_0x2b98('0x35')](_0x2b04fe[_0x2b98('0x31')],_0x2b04fe[_0x2b98('0x32')]);_0x44e747[_0x2b98('0x36')]=_['intersection'](_0x2b04fe[_0x2b98('0x31')],qs[_0x2b98('0x37')](_0x1d7d76[_0x2b98('0x32')][_0x2b98('0x37')]));_0x44e747['attributes']=_0x44e747[_0x2b98('0x36')]['length']?_0x44e747[_0x2b98('0x36')]:_0x2b04fe[_0x2b98('0x31')];if(!_0x1d7d76[_0x2b98('0x32')]['hasOwnProperty'](_0x2b98('0x38'))){_0x44e747[_0x2b98('0x23')]=qs[_0x2b98('0x23')](_0x1d7d76[_0x2b98('0x32')][_0x2b98('0x23')]);_0x44e747[_0x2b98('0x20')]=qs[_0x2b98('0x20')](_0x1d7d76[_0x2b98('0x32')][_0x2b98('0x20')]);}_0x44e747[_0x2b98('0x39')]=qs['sort'](_0x1d7d76['query'][_0x2b98('0x3a')]);_0x44e747[_0x2b98('0x3b')]=qs['filters'](_['pick'](_0x1d7d76[_0x2b98('0x32')],_0x2b04fe['filters']),_0x486ae0);if(_0x1d7d76[_0x2b98('0x32')]['filter']){_0x44e747[_0x2b98('0x3b')]=_['merge'](_0x44e747['where'],{'$or':_[_0x2b98('0x2d')](_0x486ae0,function(_0x4eb80c){if(_0x4eb80c[_0x2b98('0x2f')]!==_0x2b98('0x3c')){var _0x3f68ae={};_0x3f68ae[_0x4eb80c['name']]={'$like':'%'+_0x1d7d76[_0x2b98('0x32')][_0x2b98('0x3d')]+'%'};return _0x3f68ae;}})});}_0x44e747=_[_0x2b98('0x3e')]({},_0x44e747,_0x1d7d76[_0x2b98('0x3f')]);var _0x768433={'where':_0x44e747[_0x2b98('0x3b')]};return db['ChatGroup']['count'](_0x768433)[_0x2b98('0x28')](function(_0x4324d1){_0x256709['count']=_0x4324d1;if(_0x1d7d76[_0x2b98('0x32')][_0x2b98('0x40')]){_0x44e747['include']=[{'all':!![]}];}return db[_0x2b98('0x41')][_0x2b98('0x42')](_0x44e747);})['then'](function(_0x3f2306){_0x256709[_0x2b98('0x43')]=_0x3f2306;return _0x256709;})[_0x2b98('0x28')](respondWithFilteredResult(_0x1ec185,_0x44e747))[_0x2b98('0x44')](handleError(_0x1ec185,null));};exports[_0x2b98('0x45')]=function(_0x55d9e8,_0x5cc2db){var _0x3dbdaf={'raw':!![],'where':{'id':_0x55d9e8['params']['id']}},_0xe7685d={};_0xe7685d[_0x2b98('0x31')]=_[_0x2b98('0x33')](db[_0x2b98('0x41')][_0x2b98('0x2e')]);_0xe7685d[_0x2b98('0x32')]=_[_0x2b98('0x33')](_0x55d9e8[_0x2b98('0x32')]);_0xe7685d[_0x2b98('0x34')]=_[_0x2b98('0x35')](_0xe7685d[_0x2b98('0x31')],_0xe7685d['query']);_0x3dbdaf[_0x2b98('0x36')]=_[_0x2b98('0x35')](_0xe7685d[_0x2b98('0x31')],qs[_0x2b98('0x37')](_0x55d9e8[_0x2b98('0x32')][_0x2b98('0x37')]));_0x3dbdaf[_0x2b98('0x36')]=_0x3dbdaf['attributes'][_0x2b98('0x46')]?_0x3dbdaf[_0x2b98('0x36')]:_0xe7685d[_0x2b98('0x31')];if(_0x55d9e8[_0x2b98('0x32')][_0x2b98('0x40')]){_0x3dbdaf[_0x2b98('0x47')]=[{'all':!![]}];}_0x3dbdaf=_[_0x2b98('0x3e')]({},_0x3dbdaf,_0x55d9e8[_0x2b98('0x3f')]);return db[_0x2b98('0x41')]['find'](_0x3dbdaf)[_0x2b98('0x28')](handleEntityNotFound(_0x5cc2db,null))[_0x2b98('0x28')](respondWithResult(_0x5cc2db,null))[_0x2b98('0x44')](handleError(_0x5cc2db,null));};exports['create']=function(_0x53e6dc,_0x3fdcca){return db[_0x2b98('0x41')][_0x2b98('0x48')](_0x53e6dc[_0x2b98('0x49')],{})[_0x2b98('0x28')](respondWithResult(_0x3fdcca,0xc9))[_0x2b98('0x44')](handleError(_0x3fdcca,null));};exports['update']=function(_0x55bd9b,_0x3536ce){if(_0x55bd9b[_0x2b98('0x49')]['id']){delete _0x55bd9b[_0x2b98('0x49')]['id'];}return db['ChatGroup'][_0x2b98('0x4a')]({'where':{'id':_0x55bd9b['params']['id']}})['then'](handleEntityNotFound(_0x3536ce,null))[_0x2b98('0x28')](saveUpdates(_0x55bd9b['body'],null))[_0x2b98('0x28')](respondWithResult(_0x3536ce,null))['catch'](handleError(_0x3536ce,null));};exports[_0x2b98('0x29')]=function(_0x4ec7b0,_0x1bf8ed){return db[_0x2b98('0x41')][_0x2b98('0x4a')]({'where':{'id':_0x4ec7b0[_0x2b98('0x4b')]['id']}})[_0x2b98('0x28')](handleEntityNotFound(_0x1bf8ed,null))['then'](removeEntity(_0x1bf8ed,null))[_0x2b98('0x44')](handleError(_0x1bf8ed,null));};exports[_0x2b98('0x4c')]=function(_0x534949,_0x35cc0f){return db[_0x2b98('0x41')][_0x2b98('0x4c')]()[_0x2b98('0x28')](respondWithResult(_0x35cc0f,null))[_0x2b98('0x44')](handleError(_0x35cc0f,null));};exports['getUnread']=function(_0x23172d,_0x413afd,_0x4970fe){return db[_0x2b98('0x4d')]['count']({'where':{'ChatGroupId':_0x23172d[_0x2b98('0x4b')]['id'],'ToId':_0x23172d[_0x2b98('0x4e')]['id'],'read':![]}})[_0x2b98('0x28')](function(_0x5da52f){return{'id':_[_0x2b98('0x4f')](_0x23172d[_0x2b98('0x4b')]['id']),'count':_0x5da52f};})[_0x2b98('0x28')](respondWithResult(_0x413afd,null))[_0x2b98('0x44')](handleError(_0x413afd,null));};exports[_0x2b98('0x50')]=function(_0x1846e6,_0x2e13e1,_0x37d527){return db[_0x2b98('0x41')][_0x2b98('0x4a')]({'where':{'id':_0x1846e6[_0x2b98('0x4b')]['id']}})[_0x2b98('0x28')](handleEntityNotFound(_0x2e13e1,null))[_0x2b98('0x28')](function(_0x3a3bb8){if(_0x3a3bb8){return _0x3a3bb8[_0x2b98('0x50')](_0x1846e6['body'][_0x2b98('0x51')],_[_0x2b98('0x52')](_0x1846e6[_0x2b98('0x49')],[_0x2b98('0x51'),'id'])||{});}})['then'](respondWithResult(_0x2e13e1,null))[_0x2b98('0x44')](handleError(_0x2e13e1,null));};exports['getMembers']=function(_0x396153,_0x4e4c32,_0x20640a){var _0x13ec57={};var _0x5617d4={};var _0x38ed34;var _0xe0e0cd;return db[_0x2b98('0x41')][_0x2b98('0x53')]({'where':{'id':_0x396153[_0x2b98('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4e4c32,null))[_0x2b98('0x28')](function(_0x4f255d){if(_0x4f255d){_0x38ed34=_0x4f255d;_0x5617d4[_0x2b98('0x31')]=_[_0x2b98('0x33')](db[_0x2b98('0x54')][_0x2b98('0x2e')]);_0x5617d4[_0x2b98('0x32')]=_[_0x2b98('0x33')](_0x396153['query']);_0x5617d4[_0x2b98('0x34')]=_[_0x2b98('0x35')](_0x5617d4[_0x2b98('0x31')],_0x5617d4[_0x2b98('0x32')]);_0x13ec57[_0x2b98('0x36')]=_['intersection'](_0x5617d4[_0x2b98('0x31')],qs[_0x2b98('0x37')](_0x396153[_0x2b98('0x32')]['fields']));_0x13ec57[_0x2b98('0x36')]=_0x13ec57[_0x2b98('0x36')]['length']?_0x13ec57[_0x2b98('0x36')]:_0x5617d4[_0x2b98('0x31')];_0x13ec57[_0x2b98('0x39')]=qs[_0x2b98('0x3a')](_0x396153[_0x2b98('0x32')][_0x2b98('0x3a')]);_0x13ec57['where']=qs['filters'](_[_0x2b98('0x55')](_0x396153['query'],_0x5617d4[_0x2b98('0x34')]));if(_0x396153['query']['filter']){_0x13ec57['where']=_[_0x2b98('0x3e')](_0x13ec57[_0x2b98('0x3b')],{'$or':_[_0x2b98('0x2d')](_0x13ec57[_0x2b98('0x36')],function(_0x509f3e){var _0x4c9446={};_0x4c9446[_0x509f3e]={'$like':'%'+_0x396153[_0x2b98('0x32')]['filter']+'%'};return _0x4c9446;})});}_0x13ec57=_['merge']({},_0x13ec57,_0x396153[_0x2b98('0x3f')]);return _0x38ed34[_0x2b98('0x56')](_0x13ec57);}})[_0x2b98('0x28')](function(_0x24890f){if(_0x24890f){_0xe0e0cd=_0x24890f[_0x2b98('0x46')];if(!_0x396153[_0x2b98('0x32')][_0x2b98('0x57')](_0x2b98('0x38'))){_0x13ec57[_0x2b98('0x23')]=qs[_0x2b98('0x23')](_0x396153['query']['limit']);_0x13ec57[_0x2b98('0x20')]=qs[_0x2b98('0x20')](_0x396153['query']['offset']);}return _0x38ed34[_0x2b98('0x56')](_0x13ec57);}})[_0x2b98('0x28')](function(_0x1ff8d6){if(_0x1ff8d6){return _0x1ff8d6?{'count':_0xe0e0cd,'rows':_0x1ff8d6}:null;}})[_0x2b98('0x28')](respondWithResult(_0x4e4c32,null))[_0x2b98('0x44')](handleError(_0x4e4c32,null));};exports[_0x2b98('0x58')]=function(_0x5554dd,_0x4b227a,_0x2b4ee9){return db[_0x2b98('0x41')][_0x2b98('0x4a')]({'where':{'id':_0x5554dd[_0x2b98('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4b227a,null))[_0x2b98('0x28')](function(_0x5b6026){if(_0x5b6026){return _0x5b6026['removeMembers'](_0x5554dd[_0x2b98('0x32')]['ids']);}})['then'](respondWithStatusCode(_0x4b227a,null))[_0x2b98('0x44')](handleError(_0x4b227a,null));};exports[_0x2b98('0x59')]=function(_0x139ed6,_0x6be0ad,_0xd91ee){if(_0x139ed6[_0x2b98('0x49')]['id']){delete _0x139ed6[_0x2b98('0x49')]['id'];}return db[_0x2b98('0x41')][_0x2b98('0x4a')]({'where':{'id':_0x139ed6[_0x2b98('0x4b')]['id']}})[_0x2b98('0x28')](handleEntityNotFound(_0x6be0ad,null))[_0x2b98('0x28')](function(_0xca3056){if(_0xca3056){_0x139ed6[_0x2b98('0x49')][_0x2b98('0x5a')]=_0xca3056['id'];return db[_0x2b98('0x4d')][_0x2b98('0x48')](_0x139ed6['body']);}})[_0x2b98('0x28')](respondWithResult(_0x6be0ad,null))[_0x2b98('0x44')](handleError(_0x6be0ad,null));};exports[_0x2b98('0x5b')]=function(_0x22279e,_0x2f028c,_0x23d160){var _0x7f3d01={};var _0x15a30d={};var _0x469a38;var _0x29f32d;return db[_0x2b98('0x41')][_0x2b98('0x53')]({'where':{'id':_0x22279e[_0x2b98('0x4b')]['id']}})[_0x2b98('0x28')](handleEntityNotFound(_0x2f028c,null))['then'](function(_0xd2d251){if(_0xd2d251){_0x469a38=_0xd2d251;_0x15a30d['model']=_['keys'](db['ChatInternalMessage'][_0x2b98('0x2e')]);_0x15a30d[_0x2b98('0x32')]=_[_0x2b98('0x33')](_0x22279e[_0x2b98('0x32')]);_0x15a30d[_0x2b98('0x34')]=_[_0x2b98('0x35')](_0x15a30d[_0x2b98('0x31')],_0x15a30d[_0x2b98('0x32')]);_0x7f3d01[_0x2b98('0x36')]=_[_0x2b98('0x35')](_0x15a30d[_0x2b98('0x31')],qs[_0x2b98('0x37')](_0x22279e[_0x2b98('0x32')][_0x2b98('0x37')]));_0x7f3d01[_0x2b98('0x36')]=_0x7f3d01[_0x2b98('0x36')][_0x2b98('0x46')]?_0x7f3d01[_0x2b98('0x36')]:_0x15a30d[_0x2b98('0x31')];_0x7f3d01[_0x2b98('0x39')]=qs[_0x2b98('0x3a')](_0x22279e[_0x2b98('0x32')][_0x2b98('0x3a')]);_0x7f3d01[_0x2b98('0x3b')]=qs[_0x2b98('0x34')](_[_0x2b98('0x55')](_0x22279e[_0x2b98('0x32')],_0x15a30d['filters']));if(_0x22279e[_0x2b98('0x32')][_0x2b98('0x3d')]){_0x7f3d01[_0x2b98('0x3b')]=_[_0x2b98('0x3e')](_0x7f3d01['where'],{'$or':_[_0x2b98('0x2d')](_0x7f3d01[_0x2b98('0x36')],function(_0x218d80){var _0x2da025={};_0x2da025[_0x218d80]={'$like':'%'+_0x22279e[_0x2b98('0x32')][_0x2b98('0x3d')]+'%'};return _0x2da025;})});}if(_0x22279e[_0x2b98('0x32')]['$gte']){var _0x4197bd=_0x22279e[_0x2b98('0x32')][_0x2b98('0x5c')][_0x2b98('0x5d')](',');var _0xe45294={};_0xe45294[_0x4197bd[0x0]]={'$gte':moment(_0x4197bd[0x1])[_0x2b98('0x5e')](_0x2b98('0x5f'))};_0x7f3d01[_0x2b98('0x3b')]=_[_0x2b98('0x3e')](_0x7f3d01[_0x2b98('0x3b')],_0xe45294);}_0x7f3d01=_[_0x2b98('0x3e')]({},_0x7f3d01,_0x22279e[_0x2b98('0x3f')]);return _0x469a38[_0x2b98('0x5b')](_0x7f3d01);}})['then'](function(_0x32d91d){if(_0x32d91d){_0x29f32d=_0x32d91d['length'];if(!_0x22279e[_0x2b98('0x32')]['hasOwnProperty'](_0x2b98('0x38'))){_0x7f3d01[_0x2b98('0x23')]=qs['limit'](_0x22279e[_0x2b98('0x32')][_0x2b98('0x23')]);_0x7f3d01[_0x2b98('0x20')]=qs['offset'](_0x22279e[_0x2b98('0x32')][_0x2b98('0x20')]);}return _0x469a38[_0x2b98('0x5b')](_0x7f3d01);}})['then'](function(_0x2114bd){if(_0x2114bd){return _0x2114bd?{'count':_0x29f32d,'rows':_0x2114bd}:null;}})[_0x2b98('0x28')](respondWithResult(_0x2f028c,null))[_0x2b98('0x44')](handleError(_0x2f028c,null));};
\ No newline at end of file
+var _0x049d=['./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','name','send','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','ChatGroup','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','ids','omit','findOne','User','filter','getMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost'];(function(_0x44b454,_0xd8d71d){var _0x1e6eef=function(_0x232acd){while(--_0x232acd){_0x44b454['push'](_0x44b454['shift']());}};_0x1e6eef(++_0xd8d71d);}(_0x049d,0xa8));var _0xd049=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x049d[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xd049('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd049('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd049('0x2'));var moment=require('moment');var BPromise=require(_0xd049('0x3'));var Mustache=require('mustache');var util=require(_0xd049('0x4'));var path=require(_0xd049('0x5'));var sox=require('sox');var csv=require(_0xd049('0x6'));var ejs=require(_0xd049('0x7'));var fs=require('fs');var fs_extra=require(_0xd049('0x8'));var _=require(_0xd049('0x9'));var squel=require(_0xd049('0xa'));var crypto=require('crypto');var jsforce=require(_0xd049('0xb'));var deskjs=require(_0xd049('0xc'));var toCsv=require(_0xd049('0x6'));var querystring=require(_0xd049('0xd'));var Papa=require(_0xd049('0xe'));var Redis=require('ioredis');var authService=require(_0xd049('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd049('0x10'));var logger=require(_0xd049('0x11'))(_0xd049('0x12'));var utils=require(_0xd049('0x13'));var config=require(_0xd049('0x14'));var licenseUtil=require(_0xd049('0x15'));var db=require(_0xd049('0x16'))['db'];config[_0xd049('0x17')]=_[_0xd049('0x18')](config[_0xd049('0x17')],{'host':_0xd049('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd049('0x17')]));require(_0xd049('0x1a'))[_0xd049('0x1b')](socket);function respondWithStatusCode(_0x2c4a0a,_0x56a771){_0x56a771=_0x56a771||0xcc;return function(_0x33379f){if(_0x33379f){return _0x2c4a0a[_0xd049('0x1c')](_0x56a771);}return _0x2c4a0a[_0xd049('0x1d')](_0x56a771)[_0xd049('0x1e')]();};}function respondWithResult(_0x1bbecd,_0x1b1ee1){_0x1b1ee1=_0x1b1ee1||0xc8;return function(_0x1b37e9){if(_0x1b37e9){return _0x1bbecd[_0xd049('0x1d')](_0x1b1ee1)[_0xd049('0x1f')](_0x1b37e9);}};}function respondWithFilteredResult(_0x15fa72,_0x36c8cf){return function(_0x2baea8){if(_0x2baea8){var _0x49639e=typeof _0x36c8cf[_0xd049('0x20')]===_0xd049('0x21')&&typeof _0x36c8cf['limit']===_0xd049('0x21');var _0x2393ac=_0x2baea8['count'];var _0x96bd17=_0x49639e?0x0:_0x36c8cf[_0xd049('0x20')];var _0xefe906=_0x49639e?_0x2baea8[_0xd049('0x22')]:_0x36c8cf[_0xd049('0x20')]+_0x36c8cf[_0xd049('0x23')];var _0xc772fb;if(_0xefe906>=_0x2393ac){_0xefe906=_0x2393ac;_0xc772fb=0xc8;}else{_0xc772fb=0xce;}_0x15fa72[_0xd049('0x1d')](_0xc772fb);return _0x15fa72[_0xd049('0x24')](_0xd049('0x25'),_0x96bd17+'-'+_0xefe906+'/'+_0x2393ac)['json'](_0x2baea8);}return null;};}function patchUpdates(_0x32b248){return function(_0x136ccd){try{jsonpatch[_0xd049('0x26')](_0x136ccd,_0x32b248,!![]);}catch(_0x128551){return BPromise[_0xd049('0x27')](_0x128551);}return _0x136ccd[_0xd049('0x28')]();};}function saveUpdates(_0x5e67ec,_0x13d02a){return function(_0x8c698f){if(_0x8c698f){return _0x8c698f[_0xd049('0x29')](_0x5e67ec)[_0xd049('0x2a')](function(_0x301c99){return _0x301c99;});}return null;};}function removeEntity(_0x1186be,_0x37f685){return function(_0x30b488){if(_0x30b488){return _0x30b488['destroy']()[_0xd049('0x2a')](function(){_0x1186be[_0xd049('0x1d')](0xcc)[_0xd049('0x1e')]();});}};}function handleEntityNotFound(_0x1f94e7,_0x171759){return function(_0x3ccf5a){if(!_0x3ccf5a){_0x1f94e7[_0xd049('0x1c')](0x194);}return _0x3ccf5a;};}function handleError(_0x441ce6,_0x2499d1){_0x2499d1=_0x2499d1||0x1f4;return function(_0x43b3f3){logger['error'](_0x43b3f3['stack']);if(_0x43b3f3[_0xd049('0x2b')]){delete _0x43b3f3[_0xd049('0x2b')];}_0x441ce6[_0xd049('0x1d')](_0x2499d1)[_0xd049('0x2c')](_0x43b3f3);};}exports['index']=function(_0x1b3f8b,_0x717c00){var _0x280436={},_0x46eb1f={},_0xd7adf8={'count':0x0,'rows':[]};var _0x5a9596=_['map'](db['ChatGroup']['rawAttributes'],function(_0x45835d){return{'name':_0x45835d[_0xd049('0x2d')],'type':_0x45835d[_0xd049('0x2e')][_0xd049('0x2f')]};});_0x46eb1f[_0xd049('0x30')]=_[_0xd049('0x31')](_0x5a9596,_0xd049('0x2b'));_0x46eb1f[_0xd049('0x32')]=_[_0xd049('0x33')](_0x1b3f8b['query']);_0x46eb1f['filters']=_[_0xd049('0x34')](_0x46eb1f[_0xd049('0x30')],_0x46eb1f['query']);_0x280436[_0xd049('0x35')]=_[_0xd049('0x34')](_0x46eb1f[_0xd049('0x30')],qs[_0xd049('0x36')](_0x1b3f8b[_0xd049('0x32')]['fields']));_0x280436[_0xd049('0x35')]=_0x280436[_0xd049('0x35')][_0xd049('0x37')]?_0x280436[_0xd049('0x35')]:_0x46eb1f[_0xd049('0x30')];if(!_0x1b3f8b[_0xd049('0x32')][_0xd049('0x38')](_0xd049('0x39'))){_0x280436[_0xd049('0x23')]=qs[_0xd049('0x23')](_0x1b3f8b[_0xd049('0x32')][_0xd049('0x23')]);_0x280436[_0xd049('0x20')]=qs['offset'](_0x1b3f8b[_0xd049('0x32')][_0xd049('0x20')]);}_0x280436[_0xd049('0x3a')]=qs[_0xd049('0x3b')](_0x1b3f8b[_0xd049('0x32')]['sort']);_0x280436[_0xd049('0x3c')]=qs[_0xd049('0x3d')](_[_0xd049('0x3e')](_0x1b3f8b['query'],_0x46eb1f[_0xd049('0x3d')]),_0x5a9596);if(_0x1b3f8b[_0xd049('0x32')]['filter']){_0x280436['where']=_[_0xd049('0x3f')](_0x280436['where'],{'$or':_['map'](_0x5a9596,function(_0x348aac){if(_0x348aac[_0xd049('0x2e')]!==_0xd049('0x40')){var _0x53d8af={};_0x53d8af[_0x348aac[_0xd049('0x2b')]]={'$like':'%'+_0x1b3f8b[_0xd049('0x32')]['filter']+'%'};return _0x53d8af;}})});}_0x280436=_[_0xd049('0x3f')]({},_0x280436,_0x1b3f8b[_0xd049('0x41')]);var _0x1f6d7d={'where':_0x280436[_0xd049('0x3c')]};return db[_0xd049('0x42')][_0xd049('0x22')](_0x1f6d7d)[_0xd049('0x2a')](function(_0x4db973){_0xd7adf8[_0xd049('0x22')]=_0x4db973;if(_0x1b3f8b[_0xd049('0x32')][_0xd049('0x43')]){_0x280436[_0xd049('0x44')]=[{'all':!![]}];}return db[_0xd049('0x42')][_0xd049('0x45')](_0x280436);})[_0xd049('0x2a')](function(_0x406712){_0xd7adf8[_0xd049('0x46')]=_0x406712;return _0xd7adf8;})['then'](respondWithFilteredResult(_0x717c00,_0x280436))[_0xd049('0x47')](handleError(_0x717c00,null));};exports[_0xd049('0x48')]=function(_0x14b00b,_0x31b6f8){var _0x3df931={'raw':!![],'where':{'id':_0x14b00b['params']['id']}},_0x1e3f15={};_0x1e3f15['model']=_[_0xd049('0x33')](db['ChatGroup'][_0xd049('0x49')]);_0x1e3f15[_0xd049('0x32')]=_[_0xd049('0x33')](_0x14b00b[_0xd049('0x32')]);_0x1e3f15[_0xd049('0x3d')]=_[_0xd049('0x34')](_0x1e3f15[_0xd049('0x30')],_0x1e3f15[_0xd049('0x32')]);_0x3df931[_0xd049('0x35')]=_[_0xd049('0x34')](_0x1e3f15[_0xd049('0x30')],qs['fields'](_0x14b00b[_0xd049('0x32')]['fields']));_0x3df931[_0xd049('0x35')]=_0x3df931['attributes'][_0xd049('0x37')]?_0x3df931[_0xd049('0x35')]:_0x1e3f15[_0xd049('0x30')];if(_0x14b00b[_0xd049('0x32')][_0xd049('0x43')]){_0x3df931['include']=[{'all':!![]}];}_0x3df931=_['merge']({},_0x3df931,_0x14b00b[_0xd049('0x41')]);return db['ChatGroup'][_0xd049('0x4a')](_0x3df931)['then'](handleEntityNotFound(_0x31b6f8,null))['then'](respondWithResult(_0x31b6f8,null))[_0xd049('0x47')](handleError(_0x31b6f8,null));};exports[_0xd049('0x4b')]=function(_0x55ec08,_0x978fa4){return db[_0xd049('0x42')]['create'](_0x55ec08[_0xd049('0x4c')],{})['then'](respondWithResult(_0x978fa4,0xc9))[_0xd049('0x47')](handleError(_0x978fa4,null));};exports[_0xd049('0x29')]=function(_0x349b58,_0x1d9254){if(_0x349b58[_0xd049('0x4c')]['id']){delete _0x349b58[_0xd049('0x4c')]['id'];}return db['ChatGroup'][_0xd049('0x4a')]({'where':{'id':_0x349b58[_0xd049('0x4d')]['id']}})[_0xd049('0x2a')](handleEntityNotFound(_0x1d9254,null))[_0xd049('0x2a')](saveUpdates(_0x349b58[_0xd049('0x4c')],null))['then'](respondWithResult(_0x1d9254,null))[_0xd049('0x47')](handleError(_0x1d9254,null));};exports[_0xd049('0x4e')]=function(_0x230e94,_0x51af55){return db[_0xd049('0x42')]['find']({'where':{'id':_0x230e94[_0xd049('0x4d')]['id']}})[_0xd049('0x2a')](handleEntityNotFound(_0x51af55,null))[_0xd049('0x2a')](removeEntity(_0x51af55,null))[_0xd049('0x47')](handleError(_0x51af55,null));};exports['describe']=function(_0x421f2b,_0x171e46){return db[_0xd049('0x42')][_0xd049('0x4f')]()[_0xd049('0x2a')](respondWithResult(_0x171e46,null))[_0xd049('0x47')](handleError(_0x171e46,null));};exports[_0xd049('0x50')]=function(_0x10021f,_0x2249a0,_0x1abfce){return db[_0xd049('0x51')]['count']({'where':{'ChatGroupId':_0x10021f[_0xd049('0x4d')]['id'],'ToId':_0x10021f[_0xd049('0x52')]['id'],'read':![]}})[_0xd049('0x2a')](function(_0xcce276){return{'id':_[_0xd049('0x53')](_0x10021f[_0xd049('0x4d')]['id']),'count':_0xcce276};})['then'](respondWithResult(_0x2249a0,null))[_0xd049('0x47')](handleError(_0x2249a0,null));};exports['addMembers']=function(_0xb15f47,_0x43f8ac,_0x36e529){return db[_0xd049('0x42')][_0xd049('0x4a')]({'where':{'id':_0xb15f47[_0xd049('0x4d')]['id']}})['then'](handleEntityNotFound(_0x43f8ac,null))[_0xd049('0x2a')](function(_0x20319b){if(_0x20319b){return _0x20319b['addMembers'](_0xb15f47[_0xd049('0x4c')][_0xd049('0x54')],_[_0xd049('0x55')](_0xb15f47[_0xd049('0x4c')],[_0xd049('0x54'),'id'])||{});}})[_0xd049('0x2a')](respondWithResult(_0x43f8ac,null))[_0xd049('0x47')](handleError(_0x43f8ac,null));};exports['getMembers']=function(_0x372d8f,_0x33781a,_0x250ca6){var _0x3a4b0f={};var _0x22e083={};var _0x285fdb;var _0x5b3663;return db['ChatGroup'][_0xd049('0x56')]({'where':{'id':_0x372d8f[_0xd049('0x4d')]['id']}})[_0xd049('0x2a')](handleEntityNotFound(_0x33781a,null))[_0xd049('0x2a')](function(_0xccd771){if(_0xccd771){_0x285fdb=_0xccd771;_0x22e083['model']=_[_0xd049('0x33')](db[_0xd049('0x57')][_0xd049('0x49')]);_0x22e083[_0xd049('0x32')]=_[_0xd049('0x33')](_0x372d8f[_0xd049('0x32')]);_0x22e083[_0xd049('0x3d')]=_[_0xd049('0x34')](_0x22e083[_0xd049('0x30')],_0x22e083[_0xd049('0x32')]);_0x3a4b0f[_0xd049('0x35')]=_[_0xd049('0x34')](_0x22e083[_0xd049('0x30')],qs[_0xd049('0x36')](_0x372d8f[_0xd049('0x32')][_0xd049('0x36')]));_0x3a4b0f['attributes']=_0x3a4b0f[_0xd049('0x35')][_0xd049('0x37')]?_0x3a4b0f[_0xd049('0x35')]:_0x22e083[_0xd049('0x30')];_0x3a4b0f[_0xd049('0x3a')]=qs[_0xd049('0x3b')](_0x372d8f[_0xd049('0x32')][_0xd049('0x3b')]);_0x3a4b0f[_0xd049('0x3c')]=qs[_0xd049('0x3d')](_['pick'](_0x372d8f[_0xd049('0x32')],_0x22e083['filters']));if(_0x372d8f[_0xd049('0x32')][_0xd049('0x58')]){_0x3a4b0f[_0xd049('0x3c')]=_[_0xd049('0x3f')](_0x3a4b0f[_0xd049('0x3c')],{'$or':_[_0xd049('0x31')](_0x3a4b0f['attributes'],function(_0x4abe1d){var _0x315f1e={};_0x315f1e[_0x4abe1d]={'$like':'%'+_0x372d8f['query'][_0xd049('0x58')]+'%'};return _0x315f1e;})});}_0x3a4b0f=_[_0xd049('0x3f')]({},_0x3a4b0f,_0x372d8f[_0xd049('0x41')]);return _0x285fdb[_0xd049('0x59')](_0x3a4b0f);}})[_0xd049('0x2a')](function(_0x5e3337){if(_0x5e3337){_0x5b3663=_0x5e3337[_0xd049('0x37')];if(!_0x372d8f[_0xd049('0x32')]['hasOwnProperty'](_0xd049('0x39'))){_0x3a4b0f[_0xd049('0x23')]=qs['limit'](_0x372d8f[_0xd049('0x32')][_0xd049('0x23')]);_0x3a4b0f[_0xd049('0x20')]=qs[_0xd049('0x20')](_0x372d8f['query']['offset']);}return _0x285fdb['getMembers'](_0x3a4b0f);}})[_0xd049('0x2a')](function(_0x33b6c8){if(_0x33b6c8){return _0x33b6c8?{'count':_0x5b3663,'rows':_0x33b6c8}:null;}})[_0xd049('0x2a')](respondWithResult(_0x33781a,null))[_0xd049('0x47')](handleError(_0x33781a,null));};exports['removeMembers']=function(_0x569d75,_0x1763d7,_0x44d4c5){return db[_0xd049('0x42')][_0xd049('0x4a')]({'where':{'id':_0x569d75['params']['id']}})[_0xd049('0x2a')](handleEntityNotFound(_0x1763d7,null))[_0xd049('0x2a')](function(_0x3904af){if(_0x3904af){return _0x3904af['removeMembers'](_0x569d75[_0xd049('0x32')]['ids']);}})['then'](respondWithStatusCode(_0x1763d7,null))[_0xd049('0x47')](handleError(_0x1763d7,null));};exports[_0xd049('0x5a')]=function(_0x4a64f1,_0x11af7c,_0x524c77){if(_0x4a64f1['body']['id']){delete _0x4a64f1[_0xd049('0x4c')]['id'];}return db[_0xd049('0x42')][_0xd049('0x4a')]({'where':{'id':_0x4a64f1['params']['id']}})[_0xd049('0x2a')](handleEntityNotFound(_0x11af7c,null))[_0xd049('0x2a')](function(_0x573263){if(_0x573263){_0x4a64f1[_0xd049('0x4c')][_0xd049('0x5b')]=_0x573263['id'];return db[_0xd049('0x51')][_0xd049('0x4b')](_0x4a64f1[_0xd049('0x4c')]);}})[_0xd049('0x2a')](respondWithResult(_0x11af7c,null))['catch'](handleError(_0x11af7c,null));};exports[_0xd049('0x5c')]=function(_0x1a2f36,_0x49f7b3,_0x1dbb61){var _0x61565e={};var _0x98a5cf={};var _0x58288f;var _0x195233;return db[_0xd049('0x42')][_0xd049('0x56')]({'where':{'id':_0x1a2f36[_0xd049('0x4d')]['id']}})['then'](handleEntityNotFound(_0x49f7b3,null))[_0xd049('0x2a')](function(_0x7b34b8){if(_0x7b34b8){_0x58288f=_0x7b34b8;_0x98a5cf[_0xd049('0x30')]=_['keys'](db[_0xd049('0x51')][_0xd049('0x49')]);_0x98a5cf[_0xd049('0x32')]=_[_0xd049('0x33')](_0x1a2f36[_0xd049('0x32')]);_0x98a5cf[_0xd049('0x3d')]=_[_0xd049('0x34')](_0x98a5cf[_0xd049('0x30')],_0x98a5cf[_0xd049('0x32')]);_0x61565e[_0xd049('0x35')]=_[_0xd049('0x34')](_0x98a5cf[_0xd049('0x30')],qs[_0xd049('0x36')](_0x1a2f36[_0xd049('0x32')][_0xd049('0x36')]));_0x61565e[_0xd049('0x35')]=_0x61565e[_0xd049('0x35')]['length']?_0x61565e[_0xd049('0x35')]:_0x98a5cf[_0xd049('0x30')];_0x61565e[_0xd049('0x3a')]=qs[_0xd049('0x3b')](_0x1a2f36[_0xd049('0x32')]['sort']);_0x61565e[_0xd049('0x3c')]=qs['filters'](_[_0xd049('0x3e')](_0x1a2f36[_0xd049('0x32')],_0x98a5cf[_0xd049('0x3d')]));if(_0x1a2f36[_0xd049('0x32')]['filter']){_0x61565e[_0xd049('0x3c')]=_[_0xd049('0x3f')](_0x61565e[_0xd049('0x3c')],{'$or':_['map'](_0x61565e[_0xd049('0x35')],function(_0xc5b1ab){var _0x2287be={};_0x2287be[_0xc5b1ab]={'$like':'%'+_0x1a2f36['query'][_0xd049('0x58')]+'%'};return _0x2287be;})});}if(_0x1a2f36['query'][_0xd049('0x5d')]){var _0x1b15b0=_0x1a2f36[_0xd049('0x32')][_0xd049('0x5d')][_0xd049('0x5e')](',');var _0xdaf171={};_0xdaf171[_0x1b15b0[0x0]]={'$gte':moment(_0x1b15b0[0x1])[_0xd049('0x5f')](_0xd049('0x60'))};_0x61565e['where']=_[_0xd049('0x3f')](_0x61565e[_0xd049('0x3c')],_0xdaf171);}_0x61565e=_['merge']({},_0x61565e,_0x1a2f36[_0xd049('0x41')]);return _0x58288f[_0xd049('0x5c')](_0x61565e);}})['then'](function(_0x1d1fdb){if(_0x1d1fdb){_0x195233=_0x1d1fdb[_0xd049('0x37')];if(!_0x1a2f36[_0xd049('0x32')][_0xd049('0x38')](_0xd049('0x39'))){_0x61565e[_0xd049('0x23')]=qs[_0xd049('0x23')](_0x1a2f36['query'][_0xd049('0x23')]);_0x61565e[_0xd049('0x20')]=qs[_0xd049('0x20')](_0x1a2f36['query'][_0xd049('0x20')]);}return _0x58288f['getMessages'](_0x61565e);}})[_0xd049('0x2a')](function(_0x4dfcac){if(_0x4dfcac){return _0x4dfcac?{'count':_0x195233,'rows':_0x4dfcac}:null;}})[_0xd049('0x2a')](respondWithResult(_0x49f7b3,null))[_0xd049('0x47')](handleError(_0x49f7b3,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index e544872..f73c2da 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 _0x4888=['emit','hasOwnProperty','hook','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove'];(function(_0x41013b,_0x428de5){var _0x3f9601=function(_0x8587d3){while(--_0x8587d3){_0x41013b['push'](_0x41013b['shift']());}};_0x3f9601(++_0x428de5);}(_0x4888,0x198));var _0x8488=function(_0x5350ec,_0x316fd1){_0x5350ec=_0x5350ec-0x0;var _0x47da97=_0x4888[_0x5350ec];return _0x47da97;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x8488('0x0'))['db'][_0x8488('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8488('0x2')](0x0);var events={'afterCreate':_0x8488('0x3'),'afterUpdate':_0x8488('0x4'),'afterDestroy':_0x8488('0x5')};function emitEvent(_0x19e51d){return function(_0x571e4b,_0x267093,_0xf45c3f){ChatGroupEvents[_0x8488('0x6')](_0x19e51d+':'+_0x571e4b['id'],_0x571e4b);ChatGroupEvents[_0x8488('0x6')](_0x19e51d,_0x571e4b);_0xf45c3f(null);};}for(var e in events){if(events[_0x8488('0x7')](e)){var event=events[e];ChatGroup[_0x8488('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x1a9b=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','save'];(function(_0x5302c2,_0x172b86){var _0x46182c=function(_0x2cd650){while(--_0x2cd650){_0x5302c2['push'](_0x5302c2['shift']());}};_0x46182c(++_0x172b86);}(_0x1a9b,0xf6));var _0xb1a9=function(_0x108fea,_0x1d3617){_0x108fea=_0x108fea-0x0;var _0x499199=_0x1a9b[_0x108fea];return _0x499199;};'use strict';var EventEmitter=require(_0xb1a9('0x0'));var ChatGroup=require(_0xb1a9('0x1'))['db'][_0xb1a9('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb1a9('0x3'),'afterUpdate':_0xb1a9('0x4'),'afterDestroy':_0xb1a9('0x5')};function emitEvent(_0x16dab3){return function(_0x1b473a,_0x312774,_0x409e8c){ChatGroupEvents[_0xb1a9('0x6')](_0x16dab3+':'+_0x1b473a['id'],_0x1b473a);ChatGroupEvents['emit'](_0x16dab3,_0x1b473a);_0x409e8c(null);};}for(var e in events){if(events[_0xb1a9('0x7')](e)){var event=events[e];ChatGroup[_0xb1a9('0x8')](e,emitEvent(event));}}module[_0xb1a9('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 f486a26..62939bd 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 _0x26f6=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x5dee43,_0x35aa9b){var _0x3bcfb0=function(_0x22dad2){while(--_0x22dad2){_0x5dee43['push'](_0x5dee43['shift']());}};_0x3bcfb0(++_0x35aa9b);}(_0x26f6,0xfd));var _0x626f=function(_0x4897ae,_0x574381){_0x4897ae=_0x4897ae-0x0;var _0x8f8f7c=_0x26f6[_0x4897ae];return _0x8f8f7c;};'use strict';var _=require(_0x626f('0x0'));var util=require(_0x626f('0x1'));var logger=require(_0x626f('0x2'))('api');var moment=require(_0x626f('0x3'));var BPromise=require(_0x626f('0x4'));var rp=require(_0x626f('0x5'));var fs=require('fs');var path=require(_0x626f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x626f('0x7'));module[_0x626f('0x8')]=function(_0x35bf4d,_0x581fee){return _0x35bf4d[_0x626f('0x9')](_0x626f('0xa'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe418=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatGroup.attributes','exports','define'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0xe418,0x155));var _0x8e41=function(_0x7b3f49,_0x59869f){_0x7b3f49=_0x7b3f49-0x0;var _0x34beb6=_0xe418[_0x7b3f49];return _0x34beb6;};'use strict';var _=require('lodash');var util=require(_0x8e41('0x0'));var logger=require(_0x8e41('0x1'))(_0x8e41('0x2'));var moment=require(_0x8e41('0x3'));var BPromise=require(_0x8e41('0x4'));var rp=require(_0x8e41('0x5'));var fs=require('fs');var path=require(_0x8e41('0x6'));var rimraf=require(_0x8e41('0x7'));var config=require('../../config/environment');var attributes=require(_0x8e41('0x8'));module[_0x8e41('0x9')]=function(_0x2ccf5c,_0x2effc2){return _0x2ccf5c[_0x8e41('0xa')]('ChatGroup',attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index aaa3c5b..01a58d5 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 _0x1353=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatGroup.socket','then','info','request\x20sent','debug','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x578432,_0x3977e0){var _0x2ee8b3=function(_0x5acd9f){while(--_0x5acd9f){_0x578432['push'](_0x578432['shift']());}};_0x2ee8b3(++_0x3977e0);}(_0x1353,0xb3));var _0x3135=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x1353[_0x173441];return _0x2423a8;};'use strict';var _=require(_0x3135('0x0'));var util=require(_0x3135('0x1'));var moment=require(_0x3135('0x2'));var BPromise=require(_0x3135('0x3'));var rs=require(_0x3135('0x4'));var fs=require('fs');var Redis=require(_0x3135('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3135('0x6'));var logger=require(_0x3135('0x7'))(_0x3135('0x8'));var config=require(_0x3135('0x9'));var jayson=require(_0x3135('0xa'));var client=jayson['client'][_0x3135('0xb')]({'port':0x232a});config[_0x3135('0xc')]=_['defaults'](config[_0x3135('0xc')],{'host':_0x3135('0xd'),'port':0x18eb});var socket=require(_0x3135('0xe'))(new Redis(config[_0x3135('0xc')]));require(_0x3135('0xf'))['register'](socket);function respondWithRpcPromise(_0xab9e19,_0x1c0a36,_0x22c939){return new BPromise(function(_0x249bf0,_0x3721de){return client['request'](_0xab9e19,_0x22c939)[_0x3135('0x10')](function(_0x499acd){logger[_0x3135('0x11')]('ChatGroup,\x20%s,\x20%s',_0x1c0a36,_0x3135('0x12'));logger[_0x3135('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x1c0a36,_0x3135('0x12'),JSON['stringify'](_0x499acd));if(_0x499acd[_0x3135('0x14')]){if(_0x499acd[_0x3135('0x14')][_0x3135('0x15')]===0x1f4){logger['error'](_0x3135('0x16'),_0x1c0a36,_0x499acd['error']['message']);return _0x3721de(_0x499acd[_0x3135('0x14')][_0x3135('0x17')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x1c0a36,_0x499acd['error'][_0x3135('0x17')]);return _0x249bf0(_0x499acd[_0x3135('0x14')][_0x3135('0x17')]);}else{logger[_0x3135('0x11')]('ChatGroup,\x20%s,\x20%s',_0x1c0a36,_0x3135('0x12'));_0x249bf0(_0x499acd[_0x3135('0x18')][_0x3135('0x17')]);}})[_0x3135('0x19')](function(_0x67a9fb){logger[_0x3135('0x14')](_0x3135('0x16'),_0x1c0a36,_0x67a9fb);_0x3721de(_0x67a9fb);});});}
\ No newline at end of file
+var _0xf6d1=['ChatGroup,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x136cbb,_0x2a97f9){var _0x333a69=function(_0x5dc5bb){while(--_0x5dc5bb){_0x136cbb['push'](_0x136cbb['shift']());}};_0x333a69(++_0x2a97f9);}(_0xf6d1,0x99));var _0x1f6d=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xf6d1[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0x1f6d('0x0'));var util=require(_0x1f6d('0x1'));var moment=require(_0x1f6d('0x2'));var BPromise=require(_0x1f6d('0x3'));var rs=require(_0x1f6d('0x4'));var fs=require('fs');var Redis=require(_0x1f6d('0x5'));var db=require(_0x1f6d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1f6d('0x7'))('rpc');var config=require(_0x1f6d('0x8'));var jayson=require(_0x1f6d('0x9'));var client=jayson[_0x1f6d('0xa')][_0x1f6d('0xb')]({'port':0x232a});config[_0x1f6d('0xc')]=_[_0x1f6d('0xd')](config[_0x1f6d('0xc')],{'host':_0x1f6d('0xe'),'port':0x18eb});var socket=require(_0x1f6d('0xf'))(new Redis(config[_0x1f6d('0xc')]));require(_0x1f6d('0x10'))[_0x1f6d('0x11')](socket);function respondWithRpcPromise(_0x523958,_0x25ec55,_0x4f33bd){return new BPromise(function(_0x456882,_0x4aaba1){return client[_0x1f6d('0x12')](_0x523958,_0x4f33bd)[_0x1f6d('0x13')](function(_0x3d813c){logger[_0x1f6d('0x14')]('ChatGroup,\x20%s,\x20%s',_0x25ec55,'request\x20sent');logger[_0x1f6d('0x15')](_0x1f6d('0x16'),_0x25ec55,_0x1f6d('0x17'),JSON[_0x1f6d('0x18')](_0x3d813c));if(_0x3d813c[_0x1f6d('0x19')]){if(_0x3d813c[_0x1f6d('0x19')][_0x1f6d('0x1a')]===0x1f4){logger[_0x1f6d('0x19')](_0x1f6d('0x1b'),_0x25ec55,_0x3d813c[_0x1f6d('0x19')]['message']);return _0x4aaba1(_0x3d813c[_0x1f6d('0x19')][_0x1f6d('0x1c')]);}logger[_0x1f6d('0x19')]('ChatGroup,\x20%s,\x20%s',_0x25ec55,_0x3d813c[_0x1f6d('0x19')][_0x1f6d('0x1c')]);return _0x456882(_0x3d813c['error'][_0x1f6d('0x1c')]);}else{logger[_0x1f6d('0x14')](_0x1f6d('0x1b'),_0x25ec55,_0x1f6d('0x17'));_0x456882(_0x3d813c[_0x1f6d('0x1d')][_0x1f6d('0x1c')]);}})['catch'](function(_0x24c5b8){logger[_0x1f6d('0x19')](_0x1f6d('0x1b'),_0x25ec55,_0x24c5b8);_0x4aaba1(_0x24c5b8);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 122411f..2833183 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 _0x6476=['chatGroup:','save','update','emit','register','length'];(function(_0x5048f6,_0xf9eadc){var _0x4aa085=function(_0x414ecb){while(--_0x414ecb){_0x5048f6['push'](_0x5048f6['shift']());}};_0x4aa085(++_0xf9eadc);}(_0x6476,0x17b));var _0x6647=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x6476[_0x12d033];return _0x3b4e80;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x6647('0x0'),'remove',_0x6647('0x1')];function createListener(_0x2e6339,_0x4d2fe3){return function(_0x58e57e){_0x4d2fe3[_0x6647('0x2')](_0x2e6339,_0x58e57e);};}function removeListener(_0x1123e8,_0x30e24e){return function(){ChatGroupEvents['removeListener'](_0x1123e8,_0x30e24e);};}exports[_0x6647('0x3')]=function(_0x305d41){for(var _0x37a4b1=0x0,_0x554295=events[_0x6647('0x4')];_0x37a4b1<_0x554295;_0x37a4b1++){var _0x40d8fc=events[_0x37a4b1];var _0x5991df=createListener(_0x6647('0x5')+_0x40d8fc,_0x305d41);ChatGroupEvents['on'](_0x40d8fc,_0x5991df);}};
\ No newline at end of file
+var _0x7aa1=['update','removeListener','register','chatGroup:','./chatGroup.events','save','remove'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x7aa1,0x12a));var _0x17aa=function(_0x5085de,_0x6e0678){_0x5085de=_0x5085de-0x0;var _0x52b6c3=_0x7aa1[_0x5085de];return _0x52b6c3;};'use strict';var ChatGroupEvents=require(_0x17aa('0x0'));var events=[_0x17aa('0x1'),_0x17aa('0x2'),_0x17aa('0x3')];function createListener(_0x4c4ad7,_0x425ea9){return function(_0x5bd760){_0x425ea9['emit'](_0x4c4ad7,_0x5bd760);};}function removeListener(_0x42855e,_0x2b4eb1){return function(){ChatGroupEvents[_0x17aa('0x4')](_0x42855e,_0x2b4eb1);};}exports[_0x17aa('0x5')]=function(_0x583219){for(var _0x4301d4=0x0,_0x32994b=events['length'];_0x4301d4<_0x32994b;_0x4301d4++){var _0xdcee76=events[_0x4301d4];var _0x1e2739=createListener(_0x17aa('0x6')+_0xdcee76,_0x583219);ChatGroupEvents['on'](_0xdcee76,_0x1e2739);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 0c22aeb..787b5e2 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 _0xcdde=['./chatGroup.controller','get','isAuthenticated','show','getUnread','/:id/members','/:id/messages','post','addMessage','/:id','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3a5259,_0x34c361){var _0x402adc=function(_0x3ebd28){while(--_0x3ebd28){_0x3a5259['push'](_0x3a5259['shift']());}};_0x402adc(++_0x34c361);}(_0xcdde,0x1a7));var _0xecdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdde[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xecdd('0x0'));var util=require(_0xecdd('0x1'));var path=require(_0xecdd('0x2'));var timeout=require(_0xecdd('0x3'));var express=require(_0xecdd('0x4'));var router=express['Router']();var fs_extra=require(_0xecdd('0x5'));var auth=require(_0xecdd('0x6'));var interaction=require(_0xecdd('0x7'));var config=require(_0xecdd('0x8'));var controller=require(_0xecdd('0x9'));router[_0xecdd('0xa')]('/',auth[_0xecdd('0xb')](),controller['index']);router[_0xecdd('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xecdd('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xecdd('0xc')]);router['get']('/:id/unread',auth[_0xecdd('0xb')](),controller[_0xecdd('0xd')]);router['get'](_0xecdd('0xe'),auth['isAuthenticated'](),controller['getMembers']);router[_0xecdd('0xa')](_0xecdd('0xf'),auth['isAuthenticated'](),controller['getMessages']);router[_0xecdd('0x10')]('/',auth[_0xecdd('0xb')](),controller['create']);router[_0xecdd('0x10')](_0xecdd('0xe'),auth[_0xecdd('0xb')](),controller['addMembers']);router['post'](_0xecdd('0xf'),auth[_0xecdd('0xb')](),controller[_0xecdd('0x11')]);router['put'](_0xecdd('0x12'),auth['isAuthenticated'](),controller[_0xecdd('0x13')]);router[_0xecdd('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xecdd('0x15')]);router[_0xecdd('0x14')]('/:id/members',auth['isAuthenticated'](),controller[_0xecdd('0x16')]);module[_0xecdd('0x17')]=router;
\ No newline at end of file
+var _0x4973=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','/:id/members','/:id/messages','getMessages','post','create','addMembers','update','delete','destroy','removeMembers','exports','util','path'];(function(_0x480e73,_0x4fc890){var _0x4db556=function(_0x19df7b){while(--_0x19df7b){_0x480e73['push'](_0x480e73['shift']());}};_0x4db556(++_0x4fc890);}(_0x4973,0xbb));var _0x3497=function(_0xd22918,_0x1de1a1){_0xd22918=_0xd22918-0x0;var _0x30c9f9=_0x4973[_0xd22918];return _0x30c9f9;};'use strict';var multer=require('multer');var util=require(_0x3497('0x0'));var path=require(_0x3497('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3497('0x2')]();var fs_extra=require(_0x3497('0x3'));var auth=require(_0x3497('0x4'));var interaction=require(_0x3497('0x5'));var config=require(_0x3497('0x6'));var controller=require(_0x3497('0x7'));router[_0x3497('0x8')]('/',auth[_0x3497('0x9')](),controller[_0x3497('0xa')]);router[_0x3497('0x8')](_0x3497('0xb'),auth[_0x3497('0x9')](),controller[_0x3497('0xc')]);router[_0x3497('0x8')](_0x3497('0xd'),auth[_0x3497('0x9')](),controller[_0x3497('0xe')]);router[_0x3497('0x8')](_0x3497('0xf'),auth[_0x3497('0x9')](),controller['getUnread']);router['get'](_0x3497('0x10'),auth[_0x3497('0x9')](),controller['getMembers']);router[_0x3497('0x8')](_0x3497('0x11'),auth[_0x3497('0x9')](),controller[_0x3497('0x12')]);router[_0x3497('0x13')]('/',auth[_0x3497('0x9')](),controller[_0x3497('0x14')]);router['post'](_0x3497('0x10'),auth[_0x3497('0x9')](),controller[_0x3497('0x15')]);router[_0x3497('0x13')](_0x3497('0x11'),auth[_0x3497('0x9')](),controller['addMessage']);router['put'](_0x3497('0xd'),auth[_0x3497('0x9')](),controller[_0x3497('0x16')]);router[_0x3497('0x17')](_0x3497('0xd'),auth[_0x3497('0x9')](),controller[_0x3497('0x18')]);router[_0x3497('0x17')](_0x3497('0x10'),auth[_0x3497('0x9')](),controller[_0x3497('0x19')]);module[_0x3497('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 62858e2..6227887 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 _0xa9c6=['thumb','TEXT','STRING','DATE','long','out','sequelize','BOOLEAN','INTEGER','ENUM','star'];(function(_0xf19481,_0x175a45){var _0x32ffb9=function(_0x3a8fed){while(--_0x3a8fed){_0xf19481['push'](_0xf19481['shift']());}};_0x32ffb9(++_0x175a45);}(_0xa9c6,0x12f));var _0x6a9c=function(_0x17d5af,_0x2ef8a7){_0x17d5af=_0x17d5af-0x0;var _0x4363c8=_0xa9c6[_0x17d5af];return _0x4363c8;};'use strict';var Sequelize=require(_0x6a9c('0x0'));module['exports']={'closed':{'type':Sequelize[_0x6a9c('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x6a9c('0x2')]},'ratingType':{'type':Sequelize[_0x6a9c('0x3')](_0x6a9c('0x4'),_0x6a9c('0x5')),'defaultValue':_0x6a9c('0x4')},'ratingMessage':{'type':Sequelize[_0x6a9c('0x6')]},'pathTranscript':{'type':Sequelize[_0x6a9c('0x6')]},'mailTranscript':{'type':Sequelize[_0x6a9c('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x6a9c('0x8')]},'disposition':{'type':Sequelize[_0x6a9c('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x6a9c('0x7')]},'osName':{'type':Sequelize[_0x6a9c('0x7')]},'osVersion':{'type':Sequelize[_0x6a9c('0x7')]},'deviceModel':{'type':Sequelize[_0x6a9c('0x7')]},'deviceVendor':{'type':Sequelize[_0x6a9c('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x6a9c('0x6')]},'customerIp':{'type':Sequelize[_0x6a9c('0x7')]},'formData':{'type':Sequelize[_0x6a9c('0x6')](_0x6a9c('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x6a9c('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x6a9c('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x6a9c('0x7')]},'customerPort':{'type':Sequelize[_0x6a9c('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x6a9c('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x6a9c('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x7b14=['TEXT','DATE','STRING','long','out','BOOLEAN','sequelize','exports','INTEGER','ENUM','star'];(function(_0x567a45,_0x2d70e6){var _0x8d4cc3=function(_0x20ccba){while(--_0x20ccba){_0x567a45['push'](_0x567a45['shift']());}};_0x8d4cc3(++_0x2d70e6);}(_0x7b14,0x171));var _0x47b1=function(_0x32b7b8,_0xc36409){_0x32b7b8=_0x32b7b8-0x0;var _0x3d381d=_0x7b14[_0x32b7b8];return _0x3d381d;};'use strict';var Sequelize=require(_0x47b1('0x0'));module[_0x47b1('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x47b1('0x2')]},'ratingType':{'type':Sequelize[_0x47b1('0x3')](_0x47b1('0x4'),'thumb'),'defaultValue':_0x47b1('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x47b1('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x47b1('0x6')]},'disposition':{'type':Sequelize[_0x47b1('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x47b1('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x47b1('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x47b1('0x7')]},'osVersion':{'type':Sequelize[_0x47b1('0x7')]},'deviceModel':{'type':Sequelize[_0x47b1('0x7')]},'deviceVendor':{'type':Sequelize[_0x47b1('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x47b1('0x5')]},'customerIp':{'type':Sequelize[_0x47b1('0x7')]},'formData':{'type':Sequelize[_0x47b1('0x5')](_0x47b1('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x47b1('0x3')]('in',_0x47b1('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x47b1('0x7')]},'customerPort':{'type':Sequelize[_0x47b1('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x47b1('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x47b1('0xa')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x47b1('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 70d53bd..3abacc4 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 _0x0e42=['create','destroy','describe','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','fullname','email','vidaooTopic','follow','isNull','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','closed','disposition','AbandonInteraction','abandon','attachmentUpload','file','originalname','basename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','CmContact','agentAlias','System','customer','%s%d','Visitor','ContactId','website_alias','alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','push','rows','addTags','omit','spread','Tag','color','emit','removeTags','toString','files','server','transcript-%d-%s.zip','firstName','attachments','ChatWebsite','Account','Owner','get','mkdirSync','Chat','osName','referer','customerPort','tail','existsSync','createReadStream','pipe','direction','lastName','read','value','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','unlinkSync','zip-dir','request-promise','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','offset','undefined','limit','count','json','update','name','send','render','merge','body','contact','agent','interaction','account','index','map','rawAttributes','fieldName','type','key','findAll','user','show','params','model','keys','ChatInteraction','filters','intersection','query','attributes','fields','length','includeAll','include','options','find'];(function(_0x1ed938,_0x3ee138){var _0x30b8a1=function(_0x4b7103){while(--_0x4b7103){_0x1ed938['push'](_0x1ed938['shift']());}};_0x30b8a1(++_0x3ee138);}(_0x0e42,0x14e));var _0x20e4=function(_0x14989b,_0xc4ae0){_0x14989b=_0x14989b-0x0;var _0x1c9f55=_0x0e42[_0x14989b];return _0x1c9f55;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x20e4('0x0'));var rp=require(_0x20e4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x20e4('0x2'));var path=require(_0x20e4('0x3'));var ejs=require(_0x20e4('0x4'));var fs=require('fs');var _=require(_0x20e4('0x5'));var Redis=require(_0x20e4('0x6'));var interaction=require(_0x20e4('0x7'));var qs=require(_0x20e4('0x8'));var pdf=require(_0x20e4('0x9'));var logger=require(_0x20e4('0xa'))(_0x20e4('0xb'));var config=require(_0x20e4('0xc'));var db=require(_0x20e4('0xd'))['db'];config['redis']=_[_0x20e4('0xe')](config[_0x20e4('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x20e4('0x10'))(new Redis(config[_0x20e4('0xf')]));require(_0x20e4('0x11'))['register'](socket);var jayson=require(_0x20e4('0x12'));var client=jayson[_0x20e4('0x13')][_0x20e4('0x14')]({'port':0x232b});var client9004=jayson[_0x20e4('0x13')]['http']({'port':0x232c});function respondWithRpcPromise(_0xf6d6a9,_0x110f51,_0x487461,_0x202f17){return new BPromise(function(_0x15ad61,_0x5be9d5){var _0x1cbf48=_0x202f17||client;return _0x1cbf48['request'](_0xf6d6a9,_0x487461)[_0x20e4('0x15')](function(_0x185292){logger['info'](_0x20e4('0x16'),_0x110f51,_0x20e4('0x17'));logger[_0x20e4('0x18')](_0x20e4('0x19'),_0x110f51,_0x20e4('0x17'),JSON[_0x20e4('0x1a')](_0x185292));if(_0x185292[_0x20e4('0x1b')]){if(_0x185292[_0x20e4('0x1b')][_0x20e4('0x1c')]===0x1f4){logger[_0x20e4('0x1b')](_0x20e4('0x16'),_0x110f51,_0x185292[_0x20e4('0x1b')][_0x20e4('0x1d')]);return _0x5be9d5(_0x185292[_0x20e4('0x1b')][_0x20e4('0x1d')]);}logger[_0x20e4('0x1b')](_0x20e4('0x16'),_0x110f51,_0x185292[_0x20e4('0x1b')][_0x20e4('0x1d')]);return _0x15ad61(_0x185292['error']['message']);}else{logger[_0x20e4('0x1e')](_0x20e4('0x16'),_0x110f51,_0x20e4('0x17'));_0x15ad61(_0x185292[_0x20e4('0x1f')][_0x20e4('0x1d')]);}})[_0x20e4('0x20')](function(_0x3bba22){logger[_0x20e4('0x1b')](_0x20e4('0x16'),_0x110f51,_0x3bba22);_0x5be9d5(_0x3bba22);});});}function respondWithStatusCode(_0xddec2b,_0x1b29e3){_0x1b29e3=_0x1b29e3||0xcc;return function(_0x5d17dc){if(_0x5d17dc){return _0xddec2b[_0x20e4('0x21')](_0x1b29e3);}return _0xddec2b[_0x20e4('0x22')](_0x1b29e3)[_0x20e4('0x23')]();};}function respondWithResult(_0x55b72c,_0x34f0b5){_0x34f0b5=_0x34f0b5||0xc8;return function(_0x3179aa){if(_0x3179aa){return _0x55b72c['status'](_0x34f0b5)['json'](_0x3179aa);}};}function respondWithFilteredResult(_0x43dad0,_0x435512){return function(_0x5e43cd){if(_0x5e43cd){var _0x4713b8=typeof _0x435512[_0x20e4('0x24')]===_0x20e4('0x25')&&typeof _0x435512[_0x20e4('0x26')]==='undefined';var _0x4781f4=_0x5e43cd[_0x20e4('0x27')];var _0x4cc6d5=_0x4713b8?0x0:_0x435512[_0x20e4('0x24')];var _0x1f6606=_0x4713b8?_0x5e43cd[_0x20e4('0x27')]:_0x435512[_0x20e4('0x24')]+_0x435512[_0x20e4('0x26')];var _0x290a54;if(_0x1f6606>=_0x4781f4){_0x1f6606=_0x4781f4;_0x290a54=0xc8;}else{_0x290a54=0xce;}_0x43dad0[_0x20e4('0x22')](_0x290a54);return _0x43dad0['set']('Content-Range',_0x4cc6d5+'-'+_0x1f6606+'/'+_0x4781f4)[_0x20e4('0x28')](_0x5e43cd);}return null;};}function saveUpdates(_0x1cf996){return function(_0xf8adbf){if(_0xf8adbf){return _0xf8adbf[_0x20e4('0x29')](_0x1cf996)[_0x20e4('0x15')](function(_0x45276){return _0x45276;});}return null;};}function removeEntity(_0xb6535a){return function(_0x456821){if(_0x456821){return _0x456821['destroy']()[_0x20e4('0x15')](function(){_0xb6535a['status'](0xcc)[_0x20e4('0x23')]();});}};}function handleEntityNotFound(_0x59c991){return function(_0x24131f){if(!_0x24131f){_0x59c991['sendStatus'](0x194);}return _0x24131f;};}function handleError(_0x4abc43,_0x3dd2a6){_0x3dd2a6=_0x3dd2a6||0x1f4;return function(_0x347144){logger['error'](_0x347144['stack']);if(_0x347144[_0x20e4('0x2a')]){delete _0x347144[_0x20e4('0x2a')];}_0x4abc43[_0x20e4('0x22')](_0x3dd2a6)[_0x20e4('0x2b')](_0x347144);};}function getMustacheRender(_0x4b258b,_0x1b3080){return Mustache[_0x20e4('0x2c')](_0x4b258b,_[_0x20e4('0x2d')](_0x1b3080[_0x20e4('0x2e')],{'contact':_0x1b3080[_0x20e4('0x2f')],'message':_0x1b3080[_0x20e4('0x1d')],'agent':_0x1b3080[_0x20e4('0x30')],'interaction':_0x1b3080[_0x20e4('0x31')],'account':_0x1b3080[_0x20e4('0x32')]}))||'';}exports[_0x20e4('0x33')]=function(_0x3aeec5,_0x1f7726){var _0x4cd982={};var _0x5d1c11=_[_0x20e4('0x34')](db['ChatInteraction'][_0x20e4('0x35')],function(_0x1e7e0d){return{'name':_0x1e7e0d[_0x20e4('0x36')],'type':_0x1e7e0d[_0x20e4('0x37')][_0x20e4('0x38')]};});_0x4cd982=qs['getOptions'](_0x5d1c11,_0x3aeec5);return interaction[_0x20e4('0x39')]('chat',_0x3aeec5['query'],_0x3aeec5[_0x20e4('0x3a')],_0x4cd982,_0x5d1c11)[_0x20e4('0x15')](respondWithFilteredResult(_0x1f7726,_0x4cd982))['catch'](handleError(_0x1f7726,null));};exports[_0x20e4('0x3b')]=function(_0x572852,_0x4ee3a8){var _0x57d49c={'raw':![],'where':{'id':_0x572852[_0x20e4('0x3c')]['id']}},_0x35bfb4={};_0x35bfb4[_0x20e4('0x3d')]=_[_0x20e4('0x3e')](db[_0x20e4('0x3f')][_0x20e4('0x35')]);_0x35bfb4['query']=_[_0x20e4('0x3e')](_0x572852['query']);_0x35bfb4[_0x20e4('0x40')]=_[_0x20e4('0x41')](_0x35bfb4['model'],_0x35bfb4[_0x20e4('0x42')]);_0x57d49c[_0x20e4('0x43')]=_[_0x20e4('0x41')](_0x35bfb4[_0x20e4('0x3d')],qs[_0x20e4('0x44')](_0x572852[_0x20e4('0x42')][_0x20e4('0x44')]));_0x57d49c[_0x20e4('0x43')]=_0x57d49c[_0x20e4('0x43')][_0x20e4('0x45')]?_0x57d49c[_0x20e4('0x43')]:_0x35bfb4['model'];if(_0x572852['query'][_0x20e4('0x46')]){_0x57d49c[_0x20e4('0x47')]=[{'all':!![]}];}_0x57d49c=_[_0x20e4('0x2d')]({},_0x57d49c,_0x572852[_0x20e4('0x48')]);return db[_0x20e4('0x3f')][_0x20e4('0x49')](_0x57d49c)[_0x20e4('0x15')](handleEntityNotFound(_0x4ee3a8,null))[_0x20e4('0x15')](respondWithResult(_0x4ee3a8,null))[_0x20e4('0x20')](handleError(_0x4ee3a8,null));};exports[_0x20e4('0x4a')]=function(_0x580d5c,_0x44b281){return db[_0x20e4('0x3f')][_0x20e4('0x4a')](_0x580d5c[_0x20e4('0x2e')],{})[_0x20e4('0x15')](respondWithResult(_0x44b281,0xc9))[_0x20e4('0x20')](handleError(_0x44b281,null));};exports['update']=function(_0x412be1,_0x248394){if(_0x412be1['body']['id']){delete _0x412be1[_0x20e4('0x2e')]['id'];}return db['ChatInteraction'][_0x20e4('0x49')]({'where':{'id':_0x412be1[_0x20e4('0x3c')]['id']}})['then'](handleEntityNotFound(_0x248394,null))['then'](saveUpdates(_0x412be1[_0x20e4('0x2e')],null))[_0x20e4('0x15')](respondWithResult(_0x248394,null))[_0x20e4('0x20')](handleError(_0x248394,null));};exports[_0x20e4('0x4b')]=function(_0x33bd67,_0x5bca1c){return db[_0x20e4('0x3f')][_0x20e4('0x49')]({'where':{'id':_0x33bd67[_0x20e4('0x3c')]['id']}})[_0x20e4('0x15')](handleEntityNotFound(_0x5bca1c,null))['then'](removeEntity(_0x5bca1c,null))[_0x20e4('0x20')](handleError(_0x5bca1c,null));};exports['describe']=function(_0x2eac7a,_0x413708){return db[_0x20e4('0x3f')][_0x20e4('0x4c')]()[_0x20e4('0x15')](respondWithResult(_0x413708,null))[_0x20e4('0x20')](handleError(_0x413708,null));};exports['createVidaooSession']=function(_0x39434c,_0x3c7ffb){var _0x419be2=_0x39434c['params']['id'];var _0x3d01a4;var _0x537bbb;var _0xb20207;return db[_0x20e4('0x3f')][_0x20e4('0x4d')]({'where':{'id':_0x419be2}})[_0x20e4('0x15')](function(_0x3864dd){_0x3d01a4=_0x3864dd;return db['ChatWebsite'][_0x20e4('0x4d')]({'where':{'id':_0x3864dd[_0x20e4('0x4e')]},'attributes':['id',_0x20e4('0x4f'),_0x20e4('0x50'),'vidaooTopic',_0x20e4('0x51'),_0x20e4('0x52')],'raw':!![]});})[_0x20e4('0x15')](function(_0x18fbbe){if(_0x18fbbe&&_0x18fbbe[_0x20e4('0x4f')]&&_0x18fbbe[_0x20e4('0x50')]){_0x537bbb=_0x18fbbe;var _0x13034c={'interaction':{'id':_0x419be2},'agent':{'id':_0x39434c[_0x20e4('0x3a')]['id'],'name':_0x39434c[_0x20e4('0x3a')][_0x20e4('0x2a')],'fullname':_0x39434c[_0x20e4('0x3a')][_0x20e4('0x53')],'email':_0x39434c[_0x20e4('0x3a')][_0x20e4('0x54')]},'contact':_0x39434c[_0x20e4('0x2e')]['contact'],'account':_0x39434c[_0x20e4('0x2e')][_0x20e4('0x32')]};var _0x404e69={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x18fbbe[_0x20e4('0x4f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x39434c[_0x20e4('0x3a')][_0x20e4('0x54')]],'buttons':null,'topic':_0x537bbb[_0x20e4('0x55')],'note':_['isNull'](_0x537bbb['vidaooNote'])?null:getMustacheRender(_0x537bbb['vidaooNote'],_0x13034c),'metadata':null},'redirect':_0x20e4('0x56'),'json':!![]};try{if(!_[_0x20e4('0x57')](_0x537bbb[_0x20e4('0x52')])){var _0x5029fc=getMustacheRender(_0x537bbb['vidaooMetadata'],_0x13034c);var _0x1e4332=JSON[_0x20e4('0x58')](_0x5029fc);_0x404e69['body']['metadata']=_0x1e4332;}}catch(_0x11a5a5){throw new db[(_0x20e4('0x59'))][(_0x20e4('0x5a'))](_0x20e4('0x5b'));}return rp(_0x404e69);}else{throw new db[(_0x20e4('0x59'))][(_0x20e4('0x5a'))](_0x20e4('0x5c'));}})[_0x20e4('0x15')](function(_0x5ba9e3){_0xb20207=_0x5ba9e3;if(_0xb20207['id']){var _0x477162={'body':_0xb20207[_0x20e4('0x5d')],'ChatWebsiteId':_0x537bbb['id'],'ChatInteractionId':_0x3d01a4['id'],'direction':_0x20e4('0x5e'),'UserId':_0x39434c[_0x20e4('0x3a')]['id']};return db[_0x20e4('0x5f')]['create'](_0x477162,{});}else{throw new db['Sequelize'][(_0x20e4('0x5a'))](_0x20e4('0x60'));}})['then'](function(){return _0x3d01a4[_0x20e4('0x61')]({'vidaooSessionId':_0xb20207['id']});})[_0x20e4('0x15')](respondWithResult(_0x3c7ffb,null))[_0x20e4('0x20')](handleError(_0x3c7ffb,null));};exports['customUpdate']=function(_0x5def37,_0x1856ce){if(_0x5def37[_0x20e4('0x2e')]['id']){delete _0x5def37[_0x20e4('0x2e')]['id'];}return db[_0x20e4('0x3f')][_0x20e4('0x49')]({'where':{'id':_0x5def37[_0x20e4('0x3c')]['id']},'include':[{'model':db['CmContact'],'as':_0x20e4('0x62')}]})[_0x20e4('0x15')](handleEntityNotFound(_0x1856ce,null))[_0x20e4('0x15')](saveUpdates(_0x5def37[_0x20e4('0x2e')],null))['then'](respondWithResult(_0x1856ce,null))[_0x20e4('0x20')](handleError(_0x1856ce,null));};exports['abandon']=function(_0x5090f7,_0x591705){if(_0x5090f7[_0x20e4('0x2e')]['id']){delete _0x5090f7[_0x20e4('0x2e')]['id'];}return db['ChatInteraction'][_0x20e4('0x49')]({'where':{'id':_0x5090f7['params']['id']}})[_0x20e4('0x15')](function(_0x462005){if(!_0x462005){logger[_0x20e4('0x1b')](_0x20e4('0x63'),'abandon',0x194,_0x20e4('0x64'));_0x591705[_0x20e4('0x21')](0x194);}else{if(_0x462005[_0x20e4('0x65')]){throw new db[(_0x20e4('0x59'))][(_0x20e4('0x5a'))]('Interaction\x20already\x20assigned');}}return _0x462005;})[_0x20e4('0x15')](function(_0x4e62b6){if(_0x4e62b6){return _0x4e62b6[_0x20e4('0x29')]({'closed':_0x5090f7['body'][_0x20e4('0x66')],'disposition':_0x5090f7['body'][_0x20e4('0x67')]})[_0x20e4('0x15')](function(_0x3f25d9){return _0x3f25d9;});}})[_0x20e4('0x15')](function(){return respondWithRpcPromise(_0x20e4('0x68'),_0x20e4('0x69'),_0x5090f7[_0x20e4('0x2e')],client9004);})[_0x20e4('0x15')](respondWithResult(_0x591705,null))[_0x20e4('0x20')](handleError(_0x591705,null));};exports[_0x20e4('0x6a')]=function(_0x10b27b,_0x22e38c){_0x10b27b[_0x20e4('0x2e')][_0x20e4('0x2a')]=_0x10b27b[_0x20e4('0x6b')][_0x20e4('0x6c')];_0x10b27b['body'][_0x20e4('0x6d')]=_0x10b27b['file']['filename'];_0x10b27b['body'][_0x20e4('0x37')]=_0x10b27b[_0x20e4('0x6b')][_0x20e4('0x6e')];return db[_0x20e4('0x6f')][_0x20e4('0x4a')](_0x10b27b[_0x20e4('0x2e')])[_0x20e4('0x15')](respondWithResult(_0x22e38c,0xc9))[_0x20e4('0x20')](handleError(_0x22e38c,null));};exports[_0x20e4('0x70')]=function(_0x17d0c5,_0x2d7f94){return db[_0x20e4('0x3f')][_0x20e4('0x4d')]({'where':{'id':_0x17d0c5['params']['id']},'raw':!![]})[_0x20e4('0x15')](handleEntityNotFound(_0x2d7f94,null))[_0x20e4('0x15')](function(_0x1fc07c){if(_0x1fc07c){if(_0x1fc07c[_0x20e4('0x66')]){return _0x2d7f94[_0x20e4('0x22')](0x193)['json']({'status':0x193,'message':_0x20e4('0x71')});}return db[_0x20e4('0x6f')]['findOne']({'where':{'id':_0x17d0c5[_0x20e4('0x42')][_0x20e4('0x72')]},'raw':!![]})[_0x20e4('0x15')](handleEntityNotFound(_0x2d7f94,null));}})[_0x20e4('0x15')](function(_0x2ce824){if(_0x2ce824){var _0x30597d=_0x2ce824[_0x20e4('0x73')]!==null;var _0x4f3935=path[_0x20e4('0x74')](config[_0x20e4('0x75')],_0x20e4('0x76'));if(_0x30597d){_0x4f3935=path['join'](_0x4f3935,_0x20e4('0x77'));}var _0x5a239a=path[_0x20e4('0x74')](_0x4f3935,_0x2ce824['basename']);return _0x2d7f94[_0x20e4('0x78')](_0x5a239a);}})[_0x20e4('0x20')](handleError(_0x2d7f94,null));};exports['close']=function(_0x1186b2,_0x159c3e){var _0xef777e=null;var _0x43c1c6=null;var _0x4a711d=null;if(_0x1186b2[_0x20e4('0x2e')]['id']){delete _0x1186b2[_0x20e4('0x2e')]['id'];}if(_0x1186b2['body'][_0x20e4('0x79')]){_0x4a711d=path[_0x20e4('0x74')](config[_0x20e4('0x75')],_0x20e4('0x7a'),util[_0x20e4('0x7b')](_0x20e4('0x7c'),Date[_0x20e4('0x7d')]()));_0x1186b2[_0x20e4('0x2e')][_0x20e4('0x7e')]=_0x4a711d;}return db['ChatInteraction'][_0x20e4('0x49')]({'where':{'id':_0x1186b2[_0x20e4('0x3c')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x20e4('0x7f'),'include':[{'model':db[_0x20e4('0x80')],'as':_0x20e4('0x80')}]}]})[_0x20e4('0x15')](handleEntityNotFound(_0x159c3e,null))[_0x20e4('0x15')](saveUpdates(_0x1186b2[_0x20e4('0x2e')],null))[_0x20e4('0x15')](function(_0x293710){if(_0x293710){_0xef777e=_0x293710;return db['ChatWebsite'][_0x20e4('0x49')]({'where':{'id':_0xef777e['ChatWebsiteId']}});}})[_0x20e4('0x15')](function(_0x12ffcf){if(_0x12ffcf){_0x43c1c6=_0x12ffcf;return db[_0x20e4('0x81')][_0x20e4('0x49')]({'where':{'id':_0xef777e['ContactId']}});}})['then'](function(_0x3cffb1){if(_0x3cffb1){if(_0x4a711d){var _0x3dff75=null;for(var _0x303d15=0x1;_0x303d15<_0xef777e[_0x20e4('0x7f')]['length'];++_0x303d15){_0x3dff75=_0xef777e['Messages'][_0x303d15];var _0x4bd331=_0x3dff75[_0x20e4('0x65')]?util[_0x20e4('0x7b')]('%s%d',_0x43c1c6[_0x20e4('0x82')],_0x3dff75[_0x20e4('0x65')]):_0x20e4('0x83');var _0x5cf134=_0x1186b2[_0x20e4('0x2e')][_0x20e4('0x84')]||util[_0x20e4('0x7b')](_0x20e4('0x85'),_0x20e4('0x86'),_0x3dff75[_0x20e4('0x87')]);switch(_0x43c1c6['agentIdentifier']){case _0x20e4('0x88'):_0x4bd331=_0x3dff75[_0x20e4('0x65')]?util[_0x20e4('0x7b')](_0x20e4('0x85'),_0x43c1c6[_0x20e4('0x82')],_0x3dff75[_0x20e4('0x65')]):_0x20e4('0x83');break;case'agent_alias':_0x4bd331=_0x3dff75['UserId']?_0x3dff75[_0x20e4('0x80')][_0x20e4('0x89')]||_0x3dff75[_0x20e4('0x80')]['fullname']:_0x20e4('0x83');break;case _0x20e4('0x8a'):_0x4bd331=_0x3dff75['UserId']?_0x3dff75[_0x20e4('0x80')][_0x20e4('0x53')]:_0x20e4('0x83');break;default:_0x4bd331=_0x3dff75[_0x20e4('0x65')]?util[_0x20e4('0x7b')](_0x20e4('0x85'),_0x43c1c6['agentAlias'],_0x3dff75['UserId']):_0x20e4('0x83');}var _0x1abbaf=util[_0x20e4('0x7b')]('[%s]\x20%s:\x20%s\x0a',moment(_0x3dff75[_0x20e4('0x8b')])['format'](_0x20e4('0x8c')),_0x3dff75['direction']==='in'?_0x5cf134:_0x4bd331,_0x3dff75[_0x20e4('0x2e')]);if(!_0x3dff75[_0x20e4('0x8d')]){fs[_0x20e4('0x8e')](_0x4a711d,_0x1abbaf);}}return db['MailAccount'][_0x20e4('0x4d')]({'where':{'service':!![]},'include':[{'model':db[_0x20e4('0x8f')],'as':_0x20e4('0x90'),'raw':!![],'include':[{'model':db[_0x20e4('0x91')],'as':_0x20e4('0x91'),'raw':!![]}]}]});}}})['then'](function(_0x12a861){if(!_0x12a861||!_0x12a861['Smtp']||!_0x1186b2[_0x20e4('0x2e')])return _0xef777e;var _0x147bda=_0x12a861[_0x20e4('0x92')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x147bda,'message':{'from':util[_0x20e4('0x7b')](_0x20e4('0x93'),_0x12a861[_0x20e4('0x2a')],_0x12a861[_0x20e4('0x54')]||_0x12a861[_0x20e4('0x90')]['user']),'to':_0x1186b2[_0x20e4('0x2e')][_0x20e4('0x79')],'subject':_0x20e4('0x94'),'text':util[_0x20e4('0x7b')](_0x20e4('0x95'),_0x1186b2[_0x20e4('0x2e')][_0x20e4('0x79')]),'attachments':[{'path':_0x4a711d}]}})['then'](function(){return _0xef777e;})[_0x20e4('0x20')](function(_0x3f6872){logger[_0x20e4('0x1b')](_0x3f6872);});})[_0x20e4('0x15')](respondWithStatusCode(_0x159c3e,0xc8))[_0x20e4('0x20')](handleError(_0x159c3e,null));};exports[_0x20e4('0x96')]=function(_0x3772a4,_0x6d2f3c){return db[_0x20e4('0x5f')][_0x20e4('0x49')]({'where':{'id':_0x3772a4['params']['id']}})[_0x20e4('0x15')](handleEntityNotFound(_0x6d2f3c,null))[_0x20e4('0x15')](function(_0x47e2de){if(_0x47e2de){return _0x47e2de[_0x20e4('0x96')](_0x3772a4['body'][_0x20e4('0x97')],_['omit'](_0x3772a4[_0x20e4('0x2e')],[_0x20e4('0x97'),'id'])||{});}})[_0x20e4('0x15')](respondWithResult(_0x6d2f3c,null))['catch'](handleError(_0x6d2f3c,null));};exports[_0x20e4('0x98')]=function(_0x28b358,_0x7f2445){var _0x153539={'raw':![],'where':{}};var _0x4a196c={};var _0x32d4f7={'count':0x0,'rows':[]};return db[_0x20e4('0x3f')][_0x20e4('0x4d')]({'where':{'id':_0x28b358[_0x20e4('0x3c')]['id']}})[_0x20e4('0x15')](handleEntityNotFound(_0x7f2445,null))[_0x20e4('0x15')](function(_0x5157cd){if(_0x5157cd){_0x4a196c[_0x20e4('0x3d')]=_['keys'](db[_0x20e4('0x5f')][_0x20e4('0x35')]);_0x4a196c[_0x20e4('0x42')]=_[_0x20e4('0x3e')](_0x28b358[_0x20e4('0x42')]);_0x4a196c[_0x20e4('0x40')]=_[_0x20e4('0x41')](_0x4a196c[_0x20e4('0x3d')],_0x4a196c[_0x20e4('0x42')]);_0x153539['attributes']=_[_0x20e4('0x41')](_0x4a196c[_0x20e4('0x3d')],qs[_0x20e4('0x44')](_0x28b358[_0x20e4('0x42')][_0x20e4('0x44')]));_0x153539[_0x20e4('0x43')]=_0x153539['attributes'][_0x20e4('0x45')]?_0x153539[_0x20e4('0x43')]:_0x4a196c['model'];if(!_0x28b358[_0x20e4('0x42')][_0x20e4('0x99')](_0x20e4('0x9a'))){_0x153539['limit']=qs['limit'](_0x28b358[_0x20e4('0x42')][_0x20e4('0x26')]);_0x153539[_0x20e4('0x24')]=qs[_0x20e4('0x24')](_0x28b358[_0x20e4('0x42')][_0x20e4('0x24')]);}_0x153539[_0x20e4('0x9b')]=qs['sort'](_0x28b358[_0x20e4('0x42')][_0x20e4('0x9c')]);_0x153539[_0x20e4('0x9d')]=qs[_0x20e4('0x40')](_[_0x20e4('0x9e')](_0x28b358[_0x20e4('0x42')],_0x4a196c['filters']));_0x153539['where'][_0x20e4('0x9f')]=_0x5157cd['id'];if(_0x28b358[_0x20e4('0x42')][_0x20e4('0xa0')]){_0x153539[_0x20e4('0x9d')]=_[_0x20e4('0x2d')](_0x153539['where'],{'$or':_[_0x20e4('0x34')](_0x153539[_0x20e4('0x43')],function(_0x268ffd){var _0x3e76b9={};_0x3e76b9[_0x268ffd]={'$like':'%'+_0x28b358['query']['filter']+'%'};return _0x3e76b9;})});}if(_0x28b358[_0x20e4('0x42')][_0x20e4('0xa1')]){var _0x368a28=_0x28b358[_0x20e4('0x42')][_0x20e4('0xa1')][_0x20e4('0xa2')](',');var _0x53520f={};_0x53520f[_0x368a28[0x0]]={'$gte':moment(_0x368a28[0x1])[_0x20e4('0x7b')](_0x20e4('0xa3'))};_0x153539[_0x20e4('0x9d')]=_[_0x20e4('0x2d')](_0x153539['where'],_0x53520f);}_0x153539=_[_0x20e4('0x2d')]({},_0x153539,_0x28b358[_0x20e4('0x48')]);return db[_0x20e4('0x5f')][_0x20e4('0x27')]({'where':_0x153539[_0x20e4('0x9d')]})[_0x20e4('0x15')](function(_0x5ee5ed){_0x32d4f7[_0x20e4('0x27')]=_0x5ee5ed;if(_0x28b358[_0x20e4('0x42')]['includeAll']){_0x153539['include']=[{'all':!![]}];}return db[_0x20e4('0x5f')]['findAll'](_0x153539);})[_0x20e4('0x15')](function(_0x4177be){_0x32d4f7['rows']=_0x4177be;return _0x32d4f7;});}})['then'](respondWithFilteredResult(_0x7f2445,_0x153539))['catch'](handleError(_0x7f2445,null));};exports[_0x20e4('0xa4')]=function(_0x28b305,_0x880704){var _0xfb5f24={'where':{}},_0x9f9772={},_0x38ad8d={'count':0x0,'rows':[]};return db[_0x20e4('0x3f')]['findOne']({'where':{'id':_0x28b305['params']['id']}})[_0x20e4('0x15')](handleEntityNotFound(_0x880704,null))[_0x20e4('0x15')](function(_0x1b1a0e){if(_0x1b1a0e){_0x9f9772[_0x20e4('0x3d')]=_['keys'](db[_0x20e4('0x5f')]['rawAttributes']);_0x9f9772[_0x20e4('0x42')]=_[_0x20e4('0x3e')](_0x28b305[_0x20e4('0x42')]);_0x9f9772[_0x20e4('0x40')]=_[_0x20e4('0x41')](_0x9f9772[_0x20e4('0x3d')],_0x9f9772['query']);_0xfb5f24[_0x20e4('0x43')]=_[_0x20e4('0x41')](_0x9f9772[_0x20e4('0x3d')],qs[_0x20e4('0x44')](_0x28b305[_0x20e4('0x42')][_0x20e4('0x44')]));_0xfb5f24[_0x20e4('0x43')]=_0xfb5f24[_0x20e4('0x43')][_0x20e4('0x45')]?_0xfb5f24['attributes']:_0x9f9772[_0x20e4('0x3d')];if(!_0x28b305['query'][_0x20e4('0x99')](_0x20e4('0x9a'))){_0xfb5f24['limit']=qs[_0x20e4('0x26')](_0x28b305[_0x20e4('0x42')]['limit']);_0xfb5f24['offset']=qs[_0x20e4('0x24')](_0x28b305[_0x20e4('0x42')]['offset']);}_0xfb5f24[_0x20e4('0x9b')]=qs[_0x20e4('0x9c')](_0x28b305[_0x20e4('0x42')][_0x20e4('0x9c')]);_0xfb5f24['where']=qs[_0x20e4('0x40')](_[_0x20e4('0x9e')](_0x28b305[_0x20e4('0x42')],_0x9f9772[_0x20e4('0x40')]));_0xfb5f24[_0x20e4('0x9d')][_0x20e4('0x9f')]=_0x1b1a0e['id'];if(_0x28b305[_0x20e4('0x42')]['filter']){_0xfb5f24[_0x20e4('0x9d')]=_[_0x20e4('0x2d')](_0xfb5f24[_0x20e4('0x9d')],{'$or':_[_0x20e4('0x34')](_0xfb5f24[_0x20e4('0x43')],function(_0x52f208){var _0x408b95={};_0x408b95[_0x52f208]={'$like':'%'+_0x28b305[_0x20e4('0x42')]['filter']+'%'};return _0x408b95;})});}_0xfb5f24['where'][_0x20e4('0x8d')]=![];if(_0x28b305[_0x20e4('0x42')]['id']){_0xfb5f24['where']['id']={'$gt':_0x28b305[_0x20e4('0x42')]['id']};}_0xfb5f24=_[_0x20e4('0x2d')]({},_0xfb5f24,_0x28b305[_0x20e4('0x48')]);return db[_0x20e4('0x5f')][_0x20e4('0x27')]({'where':_0xfb5f24['where']})[_0x20e4('0x15')](function(_0x21c583){_0x38ad8d['count']=_0x21c583;_0xfb5f24['include']=[];if(_0x28b305[_0x20e4('0x42')]['includeAgent']){_0xfb5f24[_0x20e4('0x47')][_0x20e4('0xa5')]({'model':db[_0x20e4('0x80')],'as':_0x20e4('0x80'),'attributes':['id','fullname',_0x20e4('0x89')]});}if(_0x28b305[_0x20e4('0x42')][_0x20e4('0x46')]){_0xfb5f24[_0x20e4('0x47')]=[{'all':!![]}];}return db[_0x20e4('0x5f')]['findAll'](_0xfb5f24);})[_0x20e4('0x15')](function(_0xfc88fc){_0x38ad8d[_0x20e4('0xa6')]=_0xfc88fc;return _0x38ad8d;});}})[_0x20e4('0x15')](respondWithFilteredResult(_0x880704,_0xfb5f24))[_0x20e4('0x20')](handleError(_0x880704,null));};exports[_0x20e4('0xa7')]=function(_0x23a920,_0x3ad567){return db[_0x20e4('0x3f')][_0x20e4('0x49')]({'where':{'id':_0x23a920[_0x20e4('0x3c')]['id']}})[_0x20e4('0x15')](handleEntityNotFound(_0x3ad567,null))['then'](function(_0x5cda52){if(_0x5cda52){return _0x5cda52['setTags'](_0x23a920[_0x20e4('0x2e')]['ids'],_[_0x20e4('0xa8')](_0x23a920[_0x20e4('0x2e')],[_0x20e4('0x97'),'id'])||{})[_0x20e4('0xa9')](function(){return db[_0x20e4('0xaa')][_0x20e4('0x39')]({'attributes':['id',_0x20e4('0x2a'),_0x20e4('0xab')],'where':{'id':_0x23a920[_0x20e4('0x2e')][_0x20e4('0x97')]}});})[_0x20e4('0x15')](function(_0x33e1eb){socket[_0x20e4('0xac')]('chatInteractionTags:save',{'id':Number(_0x23a920[_0x20e4('0x3c')]['id']),'tags':_0x33e1eb||[]});return{'id':Number(_0x23a920[_0x20e4('0x3c')]['id']),'tags':_0x33e1eb||[]};});}})[_0x20e4('0x15')](respondWithResult(_0x3ad567,null))[_0x20e4('0x20')](handleError(_0x3ad567,null));};exports[_0x20e4('0xad')]=function(_0xe9a5de,_0x38dcd7){return db['ChatInteraction'][_0x20e4('0x49')]({'where':{'id':_0xe9a5de['params']['id']}})['then'](handleEntityNotFound(_0x38dcd7,null))[_0x20e4('0x15')](function(_0x33712b){if(_0x33712b){return _0x33712b[_0x20e4('0xad')](_0xe9a5de[_0x20e4('0x42')]['ids']);}})[_0x20e4('0x15')](respondWithStatusCode(_0x38dcd7,null))[_0x20e4('0x20')](handleError(_0x38dcd7,null));};exports[_0x20e4('0x78')]=function(_0x5985a7,_0x36b332){var _0xe45735=moment()['unix']()[_0x20e4('0xae')]();var _0x520ebf=path[_0x20e4('0x74')](config[_0x20e4('0x75')],'server',_0x20e4('0xaf'),'tmp');var _0x1baceb=path[_0x20e4('0x74')](config[_0x20e4('0x75')],_0x20e4('0xb0'),_0x20e4('0xaf'),'attachments');var _0xba5e76=path[_0x20e4('0x74')](_0x520ebf,_0xe45735);var _0x492287=util[_0x20e4('0x7b')](_0x20e4('0xb1'),_0x5985a7[_0x20e4('0x3c')]['id'],_0xe45735);var _0x413ec8=path[_0x20e4('0x74')](_0x520ebf,_0x492287);var _0xcddf31=[];_0xcddf31['push']({'model':db['User'],'as':_0x20e4('0x80'),'attributes':['id',_0x20e4('0x53')],'raw':!![]});_0xcddf31[_0x20e4('0xa5')]({'model':db['CmContact'],'as':_0x20e4('0x62'),'attributes':['id',_0x20e4('0xb2'),'lastName'],'raw':!![]});if(_0x5985a7['query'][_0x20e4('0xb3')]){_0xcddf31[_0x20e4('0xa5')]({'model':db[_0x20e4('0x6f')],'as':'Attachment','raw':!![]});}var _0x20b1fd=[{'model':db[_0x20e4('0x5f')],'as':_0x20e4('0x7f'),'attributes':['id',_0x20e4('0x2e'),_0x20e4('0x8b'),'direction',_0x20e4('0x8d'),'read'],'include':_0xcddf31}];_0x20b1fd[_0x20e4('0xa5')]({'model':db[_0x20e4('0xb4')],'as':_0x20e4('0xb5'),'attributes':['id',_0x20e4('0x2a')]});_0x20b1fd[_0x20e4('0xa5')]({'model':db[_0x20e4('0x80')],'as':_0x20e4('0xb6'),'attributes':['id','fullname']});return db['ChatInteraction'][_0x20e4('0x49')]({'where':{'id':_0x5985a7[_0x20e4('0x3c')]['id']},'include':_0x20b1fd})[_0x20e4('0x15')](handleEntityNotFound(_0x36b332,null))[_0x20e4('0x15')](function(_0x2ac219){if(_0x2ac219){var _0xc052e=_0x2ac219[_0x20e4('0xb7')]({'plain':!![]});fs[_0x20e4('0xb8')](_0xba5e76);var _0x40d6e8={'channel':_0x20e4('0xb9'),'account':_0xc052e['Account']['name'],'agent':_0xc052e[_0x20e4('0xb6')]?_0xc052e[_0x20e4('0xb6')][_0x20e4('0x53')]:'N.A.','createdAt':moment(_0xc052e[_0x20e4('0x8b')])[_0x20e4('0x7b')](_0x20e4('0xa3'))[_0x20e4('0xae')](),'closedAt':_0xc052e[_0x20e4('0x66')]?moment(_0xc052e['closedAt'])[_0x20e4('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0xc052e['disposition'],'chatInfo':{'browser':_0xc052e['browserName'],'os':_0xc052e[_0x20e4('0xba')],'referer':_0xc052e[_0x20e4('0xbb')],'customerIp':_0xc052e['customerIp'],'customerPort':_0xc052e[_0x20e4('0xbc')]?_0xc052e['customerPort']:'N.A.'},'messages':_(_0xc052e[_0x20e4('0x7f')])[_0x20e4('0xbd')]()['filter']({'secret':![]})[_0x20e4('0x34')](function(_0x55d9ff){if(_0x55d9ff[_0x20e4('0x6f')]){var _0x27b663=path['join'](_0x1baceb,_0x55d9ff[_0x20e4('0x6f')][_0x20e4('0x6d')]);if(fs[_0x20e4('0xbe')](_0x27b663)){fs[_0x20e4('0xbf')](_0x27b663)[_0x20e4('0xc0')](fs['createWriteStream'](path[_0x20e4('0x74')](_0xba5e76,_0x55d9ff[_0x20e4('0x6f')]['basename'])));}}return{'date':moment(_0x55d9ff[_0x20e4('0x8b')])[_0x20e4('0x7b')](_0x20e4('0xa3'))['toString'](),'sender':_0x55d9ff[_0x20e4('0xc1')]===_0x20e4('0x5e')?_0x55d9ff[_0x20e4('0x80')]?_0x55d9ff[_0x20e4('0x80')]['fullname']:_0x20e4('0x83'):_0x55d9ff['Contact']['firstName']+(_0x55d9ff[_0x20e4('0x62')][_0x20e4('0xc2')]?'\x20'+_0x55d9ff[_0x20e4('0x62')][_0x20e4('0xc2')]:''),'body':_0x55d9ff['Attachment']?_0x55d9ff[_0x20e4('0x6f')]['basename']:_0x55d9ff[_0x20e4('0x2e')],'direction':_0x55d9ff[_0x20e4('0xc1')]===_0x20e4('0x5e')?'A':'C','secret':_0x55d9ff['secret'],'read':_0x55d9ff[_0x20e4('0xc3')],'attachment':_0x55d9ff[_0x20e4('0x6f')]};})[_0x20e4('0xc4')]()};return ejs[_0x20e4('0xc5')](path[_0x20e4('0x74')](config['root'],_0x20e4('0xb0'),_0x20e4('0xc6'),_0x20e4('0xc7')),{'interaction':_0x40d6e8})['then'](function(_0x463bbb){var _0x1cc618=path[_0x20e4('0x74')](_0xba5e76,'transcript-'+_0xc052e['id']+'-'+_0xe45735+_0x20e4('0xc8'));var _0x26b1c3={'path':_0x1cc618,'channel':_0x20e4('0xb9'),'interactionId':_0xc052e['id']};return pdf[_0x20e4('0xc9')](_0x463bbb,_0x26b1c3);})[_0x20e4('0x15')](function(){return new Promise(function(_0x4fdc64,_0xe1d666){zipdir(_0xba5e76,{'saveTo':_0x413ec8},function(_0x28f7ec,_0x1a97cb){if(_0x28f7ec)return _0xe1d666(_0x28f7ec);return _0x4fdc64(_0x1a97cb);});})[_0x20e4('0x15')](function(){return new BPromise(function(_0x253233,_0x1886a5){rimraf(_0xba5e76,function(_0x7bb7dc){if(_0x7bb7dc)_0x1886a5(_0x7bb7dc);return _0x253233();});});})[_0x20e4('0x15')](function(){return _0x36b332[_0x20e4('0x78')](_0x413ec8,_0x492287,function(_0x55ffd8){if(_0x55ffd8){logger[_0x20e4('0x1b')](_0x20e4('0xca'),_0x55ffd8);}else{fs[_0x20e4('0xcb')](_0x413ec8);}});});});}else{return _0x36b332[_0x20e4('0x21')](0xc8);}})[_0x20e4('0x20')](handleError(_0x36b332,null));};
\ No newline at end of file
+var _0x3a15=['customerPort','N.A.','tail','existsSync','createReadStream','pipe','firstName','lastName','out','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','err','rimraf','request-promise','bluebird','mustache','util','lodash','../../components/export/pdf','api','../../config/environment','../../mysqldb','defaults','redis','./chatInteraction.socket','register','jayson/promise','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','json','offset','limit','undefined','count','status','Content-Range','update','destroy','stack','name','send','merge','body','contact','agent','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','key','getOptions','findAll','chat','query','user','show','params','model','keys','attributes','intersection','fields','length','include','options','create','find','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooTopic','vidaooNote','vidaooMetadata','vidaooEscalation','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','closed','disposition','AbandonInteraction','file','originalname','basename','filename','type','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','close','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','User','CmContact','ContactId','System','customer','Visitor','agentIdentifier','website_alias','agentAlias','%s%d','createdAt','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','filters','hasOwnProperty','nolimit','order','sort','where','pick','filter','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','ChatInteractionId','push','alias','addTags','setTags','spread','color','chatInteractionTags:save','removeTags','toString','files','tmp','server','attachments','transcript-%d-%s.zip','read','Owner','mkdirSync','Chat','closedAt','browserName','osName','referer','customerIp'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x3a15,0xde));var _0x53a1=function(_0x51bd64,_0x1c8850){_0x51bd64=_0x51bd64-0x0;var _0x2c7ee4=_0x3a15[_0x51bd64];return _0x2c7ee4;};'use strict';var rimraf=require(_0x53a1('0x0'));var zipdir=require('zip-dir');var rp=require(_0x53a1('0x1'));var moment=require('moment');var BPromise=require(_0x53a1('0x2'));var Mustache=require(_0x53a1('0x3'));var util=require(_0x53a1('0x4'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x53a1('0x5'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0x53a1('0x6'));var logger=require('../../config/logger')(_0x53a1('0x7'));var config=require(_0x53a1('0x8'));var db=require(_0x53a1('0x9'))['db'];config['redis']=_[_0x53a1('0xa')](config[_0x53a1('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x53a1('0xc'))[_0x53a1('0xd')](socket);var jayson=require(_0x53a1('0xe'));var client=jayson[_0x53a1('0xf')]['http']({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x1a5c95,_0x12f86c,_0x50cd84,_0x1a89e9){return new BPromise(function(_0x17d23b,_0x33b513){var _0x4a14bc=_0x1a89e9||client;return _0x4a14bc[_0x53a1('0x10')](_0x1a5c95,_0x50cd84)[_0x53a1('0x11')](function(_0x3d66f5){logger[_0x53a1('0x12')](_0x53a1('0x13'),_0x12f86c,_0x53a1('0x14'));logger[_0x53a1('0x15')](_0x53a1('0x16'),_0x12f86c,_0x53a1('0x14'),JSON['stringify'](_0x3d66f5));if(_0x3d66f5[_0x53a1('0x17')]){if(_0x3d66f5[_0x53a1('0x17')][_0x53a1('0x18')]===0x1f4){logger[_0x53a1('0x17')](_0x53a1('0x13'),_0x12f86c,_0x3d66f5[_0x53a1('0x17')][_0x53a1('0x19')]);return _0x33b513(_0x3d66f5['error'][_0x53a1('0x19')]);}logger['error'](_0x53a1('0x13'),_0x12f86c,_0x3d66f5[_0x53a1('0x17')][_0x53a1('0x19')]);return _0x17d23b(_0x3d66f5[_0x53a1('0x17')][_0x53a1('0x19')]);}else{logger[_0x53a1('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x12f86c,_0x53a1('0x14'));_0x17d23b(_0x3d66f5[_0x53a1('0x1a')]['message']);}})[_0x53a1('0x1b')](function(_0x32c5f5){logger['error'](_0x53a1('0x13'),_0x12f86c,_0x32c5f5);_0x33b513(_0x32c5f5);});});}function respondWithStatusCode(_0x11253c,_0x5173a3){_0x5173a3=_0x5173a3||0xcc;return function(_0x14718c){if(_0x14718c){return _0x11253c[_0x53a1('0x1c')](_0x5173a3);}return _0x11253c['status'](_0x5173a3)[_0x53a1('0x1d')]();};}function respondWithResult(_0x1a4dab,_0x471e34){_0x471e34=_0x471e34||0xc8;return function(_0x26f84a){if(_0x26f84a){return _0x1a4dab['status'](_0x471e34)[_0x53a1('0x1e')](_0x26f84a);}};}function respondWithFilteredResult(_0x428866,_0x2a71f1){return function(_0x1027d4){if(_0x1027d4){var _0x3bf15c=typeof _0x2a71f1[_0x53a1('0x1f')]==='undefined'&&typeof _0x2a71f1[_0x53a1('0x20')]===_0x53a1('0x21');var _0x17d3ff=_0x1027d4[_0x53a1('0x22')];var _0x348d5f=_0x3bf15c?0x0:_0x2a71f1[_0x53a1('0x1f')];var _0x13f5f7=_0x3bf15c?_0x1027d4[_0x53a1('0x22')]:_0x2a71f1[_0x53a1('0x1f')]+_0x2a71f1[_0x53a1('0x20')];var _0x255768;if(_0x13f5f7>=_0x17d3ff){_0x13f5f7=_0x17d3ff;_0x255768=0xc8;}else{_0x255768=0xce;}_0x428866[_0x53a1('0x23')](_0x255768);return _0x428866['set'](_0x53a1('0x24'),_0x348d5f+'-'+_0x13f5f7+'/'+_0x17d3ff)[_0x53a1('0x1e')](_0x1027d4);}return null;};}function saveUpdates(_0x2ac270){return function(_0x300b4d){if(_0x300b4d){return _0x300b4d[_0x53a1('0x25')](_0x2ac270)[_0x53a1('0x11')](function(_0x2271d7){return _0x2271d7;});}return null;};}function removeEntity(_0x4e10ff){return function(_0x5aba04){if(_0x5aba04){return _0x5aba04[_0x53a1('0x26')]()[_0x53a1('0x11')](function(){_0x4e10ff[_0x53a1('0x23')](0xcc)[_0x53a1('0x1d')]();});}};}function handleEntityNotFound(_0x116f82){return function(_0x7c89a9){if(!_0x7c89a9){_0x116f82['sendStatus'](0x194);}return _0x7c89a9;};}function handleError(_0x53df98,_0x13a2b1){_0x13a2b1=_0x13a2b1||0x1f4;return function(_0x37f834){logger[_0x53a1('0x17')](_0x37f834[_0x53a1('0x27')]);if(_0x37f834[_0x53a1('0x28')]){delete _0x37f834[_0x53a1('0x28')];}_0x53df98[_0x53a1('0x23')](_0x13a2b1)[_0x53a1('0x29')](_0x37f834);};}function getMustacheRender(_0x1c1211,_0x536409){return Mustache['render'](_0x1c1211,_[_0x53a1('0x2a')](_0x536409[_0x53a1('0x2b')],{'contact':_0x536409[_0x53a1('0x2c')],'message':_0x536409['message'],'agent':_0x536409[_0x53a1('0x2d')],'interaction':_0x536409[_0x53a1('0x2e')],'account':_0x536409[_0x53a1('0x2f')]}))||'';}exports[_0x53a1('0x30')]=function(_0x1d9496,_0x33cbec){var _0x4c3bb8={};var _0x3a4c1d=_[_0x53a1('0x31')](db[_0x53a1('0x32')][_0x53a1('0x33')],function(_0x4a83a2){return{'name':_0x4a83a2[_0x53a1('0x34')],'type':_0x4a83a2['type'][_0x53a1('0x35')]};});_0x4c3bb8=qs[_0x53a1('0x36')](_0x3a4c1d,_0x1d9496);return interaction[_0x53a1('0x37')](_0x53a1('0x38'),_0x1d9496[_0x53a1('0x39')],_0x1d9496[_0x53a1('0x3a')],_0x4c3bb8,_0x3a4c1d)[_0x53a1('0x11')](respondWithFilteredResult(_0x33cbec,_0x4c3bb8))[_0x53a1('0x1b')](handleError(_0x33cbec,null));};exports[_0x53a1('0x3b')]=function(_0x4b71a0,_0x2ae1f4){var _0x24776a={'raw':![],'where':{'id':_0x4b71a0[_0x53a1('0x3c')]['id']}},_0x3a47a5={};_0x3a47a5[_0x53a1('0x3d')]=_['keys'](db[_0x53a1('0x32')][_0x53a1('0x33')]);_0x3a47a5[_0x53a1('0x39')]=_[_0x53a1('0x3e')](_0x4b71a0[_0x53a1('0x39')]);_0x3a47a5['filters']=_['intersection'](_0x3a47a5[_0x53a1('0x3d')],_0x3a47a5[_0x53a1('0x39')]);_0x24776a[_0x53a1('0x3f')]=_[_0x53a1('0x40')](_0x3a47a5['model'],qs['fields'](_0x4b71a0['query'][_0x53a1('0x41')]));_0x24776a[_0x53a1('0x3f')]=_0x24776a[_0x53a1('0x3f')][_0x53a1('0x42')]?_0x24776a['attributes']:_0x3a47a5[_0x53a1('0x3d')];if(_0x4b71a0['query']['includeAll']){_0x24776a[_0x53a1('0x43')]=[{'all':!![]}];}_0x24776a=_['merge']({},_0x24776a,_0x4b71a0[_0x53a1('0x44')]);return db[_0x53a1('0x32')]['find'](_0x24776a)[_0x53a1('0x11')](handleEntityNotFound(_0x2ae1f4,null))['then'](respondWithResult(_0x2ae1f4,null))[_0x53a1('0x1b')](handleError(_0x2ae1f4,null));};exports['create']=function(_0x308f91,_0x4ad64a){return db['ChatInteraction'][_0x53a1('0x45')](_0x308f91['body'],{})['then'](respondWithResult(_0x4ad64a,0xc9))[_0x53a1('0x1b')](handleError(_0x4ad64a,null));};exports[_0x53a1('0x25')]=function(_0x29a00f,_0x5cf7e0){if(_0x29a00f[_0x53a1('0x2b')]['id']){delete _0x29a00f[_0x53a1('0x2b')]['id'];}return db[_0x53a1('0x32')][_0x53a1('0x46')]({'where':{'id':_0x29a00f[_0x53a1('0x3c')]['id']}})['then'](handleEntityNotFound(_0x5cf7e0,null))[_0x53a1('0x11')](saveUpdates(_0x29a00f[_0x53a1('0x2b')],null))['then'](respondWithResult(_0x5cf7e0,null))[_0x53a1('0x1b')](handleError(_0x5cf7e0,null));};exports[_0x53a1('0x26')]=function(_0x2ac036,_0x42d96c){return db[_0x53a1('0x32')]['find']({'where':{'id':_0x2ac036[_0x53a1('0x3c')]['id']}})[_0x53a1('0x11')](handleEntityNotFound(_0x42d96c,null))['then'](removeEntity(_0x42d96c,null))['catch'](handleError(_0x42d96c,null));};exports[_0x53a1('0x47')]=function(_0x40152c,_0x2b277d){return db[_0x53a1('0x32')][_0x53a1('0x47')]()[_0x53a1('0x11')](respondWithResult(_0x2b277d,null))[_0x53a1('0x1b')](handleError(_0x2b277d,null));};exports[_0x53a1('0x48')]=function(_0x7dd2ee,_0x1c370b){var _0x57de5b=_0x7dd2ee['params']['id'];var _0xda708a;var _0x5ea173;var _0x1d38dc;return db[_0x53a1('0x32')][_0x53a1('0x49')]({'where':{'id':_0x57de5b}})['then'](function(_0x232009){_0xda708a=_0x232009;return db[_0x53a1('0x4a')][_0x53a1('0x49')]({'where':{'id':_0x232009[_0x53a1('0x4b')]},'attributes':['id',_0x53a1('0x4c'),'vidaooEscalation',_0x53a1('0x4d'),_0x53a1('0x4e'),_0x53a1('0x4f')],'raw':!![]});})[_0x53a1('0x11')](function(_0x1229bf){if(_0x1229bf&&_0x1229bf[_0x53a1('0x4c')]&&_0x1229bf[_0x53a1('0x50')]){_0x5ea173=_0x1229bf;var _0x1ddf80={'interaction':{'id':_0x57de5b},'agent':{'id':_0x7dd2ee['user']['id'],'name':_0x7dd2ee['user']['name'],'fullname':_0x7dd2ee[_0x53a1('0x3a')][_0x53a1('0x51')],'email':_0x7dd2ee[_0x53a1('0x3a')][_0x53a1('0x52')]},'contact':_0x7dd2ee['body'][_0x53a1('0x2c')],'account':_0x7dd2ee['body'][_0x53a1('0x2f')]};var _0x265ee2={'rejectUnauthorized':![],'method':_0x53a1('0x53'),'url':_0x53a1('0x54'),'headers':{'X-APIKEY':_0x1229bf['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x7dd2ee['user'][_0x53a1('0x52')]],'buttons':null,'topic':_0x5ea173[_0x53a1('0x4d')],'note':_[_0x53a1('0x55')](_0x5ea173[_0x53a1('0x4e')])?null:getMustacheRender(_0x5ea173['vidaooNote'],_0x1ddf80),'metadata':null},'redirect':_0x53a1('0x56'),'json':!![]};try{if(!_[_0x53a1('0x55')](_0x5ea173['vidaooMetadata'])){var _0x3190ba=getMustacheRender(_0x5ea173[_0x53a1('0x4f')],_0x1ddf80);var _0x11bcc1=JSON[_0x53a1('0x57')](_0x3190ba);_0x265ee2[_0x53a1('0x2b')]['metadata']=_0x11bcc1;}}catch(_0x35af82){throw new db[(_0x53a1('0x58'))][(_0x53a1('0x59'))](_0x53a1('0x5a'));}return rp(_0x265ee2);}else{throw new db[(_0x53a1('0x58'))]['ValidationError'](_0x53a1('0x5b'));}})[_0x53a1('0x11')](function(_0x30bd3e){_0x1d38dc=_0x30bd3e;if(_0x1d38dc['id']){var _0x1624ee={'body':_0x1d38dc[_0x53a1('0x5c')],'ChatWebsiteId':_0x5ea173['id'],'ChatInteractionId':_0xda708a['id'],'direction':'out','UserId':_0x7dd2ee['user']['id']};return db[_0x53a1('0x5d')][_0x53a1('0x45')](_0x1624ee,{});}else{throw new db[(_0x53a1('0x58'))]['ValidationError'](_0x53a1('0x5e'));}})[_0x53a1('0x11')](function(){return _0xda708a[_0x53a1('0x5f')]({'vidaooSessionId':_0x1d38dc['id']});})['then'](respondWithResult(_0x1c370b,null))[_0x53a1('0x1b')](handleError(_0x1c370b,null));};exports[_0x53a1('0x60')]=function(_0x193d33,_0x28eb0e){if(_0x193d33[_0x53a1('0x2b')]['id']){delete _0x193d33[_0x53a1('0x2b')]['id'];}return db[_0x53a1('0x32')][_0x53a1('0x46')]({'where':{'id':_0x193d33['params']['id']},'include':[{'model':db['CmContact'],'as':_0x53a1('0x61')}]})[_0x53a1('0x11')](handleEntityNotFound(_0x28eb0e,null))[_0x53a1('0x11')](saveUpdates(_0x193d33[_0x53a1('0x2b')],null))[_0x53a1('0x11')](respondWithResult(_0x28eb0e,null))['catch'](handleError(_0x28eb0e,null));};exports[_0x53a1('0x62')]=function(_0x530265,_0x14776b){if(_0x530265[_0x53a1('0x2b')]['id']){delete _0x530265[_0x53a1('0x2b')]['id'];}return db[_0x53a1('0x32')][_0x53a1('0x46')]({'where':{'id':_0x530265[_0x53a1('0x3c')]['id']}})['then'](function(_0x41e61c){if(!_0x41e61c){logger[_0x53a1('0x17')](_0x53a1('0x63'),_0x53a1('0x62'),0x194,'entity\x20not\x20found');_0x14776b[_0x53a1('0x1c')](0x194);}else{if(_0x41e61c[_0x53a1('0x64')]){throw new db['Sequelize']['ValidationError']('Interaction\x20already\x20assigned');}}return _0x41e61c;})[_0x53a1('0x11')](function(_0x6ebb33){if(_0x6ebb33){return _0x6ebb33['update']({'closed':_0x530265[_0x53a1('0x2b')][_0x53a1('0x65')],'disposition':_0x530265[_0x53a1('0x2b')][_0x53a1('0x66')]})[_0x53a1('0x11')](function(_0x57b4dc){return _0x57b4dc;});}})[_0x53a1('0x11')](function(){return respondWithRpcPromise(_0x53a1('0x67'),_0x53a1('0x62'),_0x530265[_0x53a1('0x2b')],client9004);})['then'](respondWithResult(_0x14776b,null))[_0x53a1('0x1b')](handleError(_0x14776b,null));};exports['attachmentUpload']=function(_0xf00eb9,_0x102b54){_0xf00eb9[_0x53a1('0x2b')][_0x53a1('0x28')]=_0xf00eb9[_0x53a1('0x68')][_0x53a1('0x69')];_0xf00eb9[_0x53a1('0x2b')][_0x53a1('0x6a')]=_0xf00eb9['file'][_0x53a1('0x6b')];_0xf00eb9[_0x53a1('0x2b')][_0x53a1('0x6c')]=_0xf00eb9[_0x53a1('0x68')][_0x53a1('0x6d')];return db[_0x53a1('0x6e')][_0x53a1('0x45')](_0xf00eb9['body'])['then'](respondWithResult(_0x102b54,0xc9))[_0x53a1('0x1b')](handleError(_0x102b54,null));};exports[_0x53a1('0x6f')]=function(_0x5db8de,_0x143524){return db[_0x53a1('0x32')][_0x53a1('0x49')]({'where':{'id':_0x5db8de[_0x53a1('0x3c')]['id']},'raw':!![]})[_0x53a1('0x11')](handleEntityNotFound(_0x143524,null))[_0x53a1('0x11')](function(_0x215161){if(_0x215161){if(_0x215161[_0x53a1('0x65')]){return _0x143524[_0x53a1('0x23')](0x193)[_0x53a1('0x1e')]({'status':0x193,'message':_0x53a1('0x70')});}return db[_0x53a1('0x6e')]['findOne']({'where':{'id':_0x5db8de[_0x53a1('0x39')][_0x53a1('0x71')]},'raw':!![]})[_0x53a1('0x11')](handleEntityNotFound(_0x143524,null));}})[_0x53a1('0x11')](function(_0x20efc4){if(_0x20efc4){var _0x5ca204=_0x20efc4[_0x53a1('0x72')]!==null;var _0x2182b2=path[_0x53a1('0x73')](config[_0x53a1('0x74')],_0x53a1('0x75'));if(_0x5ca204){_0x2182b2=path[_0x53a1('0x73')](_0x2182b2,'offline-chat/');}var _0x1e4c6a=path[_0x53a1('0x73')](_0x2182b2,_0x20efc4[_0x53a1('0x6a')]);return _0x143524['download'](_0x1e4c6a);}})[_0x53a1('0x1b')](handleError(_0x143524,null));};exports[_0x53a1('0x76')]=function(_0x4b99a2,_0x14b633){var _0x49ff14=null;var _0x191111=null;var _0x1a1e73=null;if(_0x4b99a2[_0x53a1('0x2b')]['id']){delete _0x4b99a2[_0x53a1('0x2b')]['id'];}if(_0x4b99a2['body']['mailTranscript']){_0x1a1e73=path[_0x53a1('0x73')](config[_0x53a1('0x74')],_0x53a1('0x77'),util[_0x53a1('0x78')](_0x53a1('0x79'),Date[_0x53a1('0x7a')]()));_0x4b99a2['body']['pathTranscript']=_0x1a1e73;}return db['ChatInteraction'][_0x53a1('0x46')]({'where':{'id':_0x4b99a2['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0x53a1('0x7b'),'include':[{'model':db[_0x53a1('0x7c')],'as':_0x53a1('0x7c')}]}]})[_0x53a1('0x11')](handleEntityNotFound(_0x14b633,null))[_0x53a1('0x11')](saveUpdates(_0x4b99a2[_0x53a1('0x2b')],null))[_0x53a1('0x11')](function(_0xddc9bf){if(_0xddc9bf){_0x49ff14=_0xddc9bf;return db[_0x53a1('0x4a')][_0x53a1('0x46')]({'where':{'id':_0x49ff14[_0x53a1('0x4b')]}});}})['then'](function(_0x486038){if(_0x486038){_0x191111=_0x486038;return db[_0x53a1('0x7d')]['find']({'where':{'id':_0x49ff14[_0x53a1('0x7e')]}});}})['then'](function(_0x40ca34){if(_0x40ca34){if(_0x1a1e73){var _0xf95a2a=null;for(var _0x697910=0x1;_0x697910<_0x49ff14[_0x53a1('0x7b')][_0x53a1('0x42')];++_0x697910){_0xf95a2a=_0x49ff14['Messages'][_0x697910];var _0x512e5b=_0xf95a2a[_0x53a1('0x64')]?util[_0x53a1('0x78')]('%s%d',_0x191111['agentAlias'],_0xf95a2a[_0x53a1('0x64')]):_0x53a1('0x7f');var _0x526330=_0x4b99a2[_0x53a1('0x2b')][_0x53a1('0x80')]||util[_0x53a1('0x78')]('%s%d',_0x53a1('0x81'),_0xf95a2a['ContactId']);switch(_0x191111[_0x53a1('0x82')]){case _0x53a1('0x83'):_0x512e5b=_0xf95a2a[_0x53a1('0x64')]?util[_0x53a1('0x78')]('%s%d',_0x191111[_0x53a1('0x84')],_0xf95a2a['UserId']):_0x53a1('0x7f');break;case'agent_alias':_0x512e5b=_0xf95a2a[_0x53a1('0x64')]?_0xf95a2a[_0x53a1('0x7c')]['alias']||_0xf95a2a[_0x53a1('0x7c')][_0x53a1('0x51')]:_0x53a1('0x7f');break;case'agent_fullname':_0x512e5b=_0xf95a2a[_0x53a1('0x64')]?_0xf95a2a['User'][_0x53a1('0x51')]:_0x53a1('0x7f');break;default:_0x512e5b=_0xf95a2a[_0x53a1('0x64')]?util[_0x53a1('0x78')](_0x53a1('0x85'),_0x191111[_0x53a1('0x84')],_0xf95a2a[_0x53a1('0x64')]):_0x53a1('0x7f');}var _0x14d402=util[_0x53a1('0x78')]('[%s]\x20%s:\x20%s\x0a',moment(_0xf95a2a[_0x53a1('0x86')])[_0x53a1('0x78')]('MM/DD/YYYY\x20HH:mm:ss'),_0xf95a2a['direction']==='in'?_0x526330:_0x512e5b,_0xf95a2a[_0x53a1('0x2b')]);if(!_0xf95a2a[_0x53a1('0x87')]){fs[_0x53a1('0x88')](_0x1a1e73,_0x14d402);}}return db[_0x53a1('0x89')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x53a1('0x8a')],'as':_0x53a1('0x8b'),'raw':!![],'include':[{'model':db[_0x53a1('0x8c')],'as':_0x53a1('0x8c'),'raw':!![]}]}]});}}})[_0x53a1('0x11')](function(_0x2a611a){if(!_0x2a611a||!_0x2a611a['Smtp']||!_0x4b99a2[_0x53a1('0x2b')])return _0x49ff14;var _0x517f1d=_0x2a611a[_0x53a1('0x8d')]();return respondWithRpcPromise('SendMail',_0x53a1('0x8e'),{'account':_0x517f1d,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x2a611a[_0x53a1('0x28')],_0x2a611a['email']||_0x2a611a[_0x53a1('0x8b')][_0x53a1('0x3a')]),'to':_0x4b99a2['body'][_0x53a1('0x8f')],'subject':_0x53a1('0x90'),'text':util[_0x53a1('0x78')](_0x53a1('0x91'),_0x4b99a2[_0x53a1('0x2b')][_0x53a1('0x8f')]),'attachments':[{'path':_0x1a1e73}]}})[_0x53a1('0x11')](function(){return _0x49ff14;})[_0x53a1('0x1b')](function(_0x281892){logger[_0x53a1('0x17')](_0x281892);});})[_0x53a1('0x11')](respondWithStatusCode(_0x14b633,0xc8))[_0x53a1('0x1b')](handleError(_0x14b633,null));};exports[_0x53a1('0x92')]=function(_0x3e063e,_0x4291df){return db['ChatMessage'][_0x53a1('0x46')]({'where':{'id':_0x3e063e[_0x53a1('0x3c')]['id']}})[_0x53a1('0x11')](handleEntityNotFound(_0x4291df,null))['then'](function(_0x4466b4){if(_0x4466b4){return _0x4466b4['addMessage'](_0x3e063e['body'][_0x53a1('0x93')],_[_0x53a1('0x94')](_0x3e063e['body'],[_0x53a1('0x93'),'id'])||{});}})[_0x53a1('0x11')](respondWithResult(_0x4291df,null))[_0x53a1('0x1b')](handleError(_0x4291df,null));};exports[_0x53a1('0x95')]=function(_0x4f8613,_0x22e646){var _0x427aab={'raw':![],'where':{}};var _0x3e417d={};var _0x10d871={'count':0x0,'rows':[]};return db[_0x53a1('0x32')]['findOne']({'where':{'id':_0x4f8613[_0x53a1('0x3c')]['id']}})[_0x53a1('0x11')](handleEntityNotFound(_0x22e646,null))[_0x53a1('0x11')](function(_0x44cd4b){if(_0x44cd4b){_0x3e417d[_0x53a1('0x3d')]=_['keys'](db[_0x53a1('0x5d')][_0x53a1('0x33')]);_0x3e417d[_0x53a1('0x39')]=_['keys'](_0x4f8613['query']);_0x3e417d[_0x53a1('0x96')]=_[_0x53a1('0x40')](_0x3e417d[_0x53a1('0x3d')],_0x3e417d[_0x53a1('0x39')]);_0x427aab['attributes']=_[_0x53a1('0x40')](_0x3e417d[_0x53a1('0x3d')],qs['fields'](_0x4f8613[_0x53a1('0x39')]['fields']));_0x427aab[_0x53a1('0x3f')]=_0x427aab['attributes'][_0x53a1('0x42')]?_0x427aab[_0x53a1('0x3f')]:_0x3e417d['model'];if(!_0x4f8613[_0x53a1('0x39')][_0x53a1('0x97')](_0x53a1('0x98'))){_0x427aab[_0x53a1('0x20')]=qs[_0x53a1('0x20')](_0x4f8613[_0x53a1('0x39')][_0x53a1('0x20')]);_0x427aab[_0x53a1('0x1f')]=qs[_0x53a1('0x1f')](_0x4f8613['query'][_0x53a1('0x1f')]);}_0x427aab[_0x53a1('0x99')]=qs[_0x53a1('0x9a')](_0x4f8613[_0x53a1('0x39')]['sort']);_0x427aab[_0x53a1('0x9b')]=qs[_0x53a1('0x96')](_[_0x53a1('0x9c')](_0x4f8613[_0x53a1('0x39')],_0x3e417d[_0x53a1('0x96')]));_0x427aab[_0x53a1('0x9b')]['ChatInteractionId']=_0x44cd4b['id'];if(_0x4f8613[_0x53a1('0x39')][_0x53a1('0x9d')]){_0x427aab[_0x53a1('0x9b')]=_[_0x53a1('0x2a')](_0x427aab['where'],{'$or':_[_0x53a1('0x31')](_0x427aab[_0x53a1('0x3f')],function(_0x3fce61){var _0x16cf27={};_0x16cf27[_0x3fce61]={'$like':'%'+_0x4f8613[_0x53a1('0x39')]['filter']+'%'};return _0x16cf27;})});}if(_0x4f8613[_0x53a1('0x39')]['$gte']){var _0x4a1616=_0x4f8613['query']['$gte'][_0x53a1('0x9e')](',');var _0x3bb17a={};_0x3bb17a[_0x4a1616[0x0]]={'$gte':moment(_0x4a1616[0x1])['format'](_0x53a1('0x9f'))};_0x427aab['where']=_['merge'](_0x427aab[_0x53a1('0x9b')],_0x3bb17a);}_0x427aab=_[_0x53a1('0x2a')]({},_0x427aab,_0x4f8613[_0x53a1('0x44')]);return db[_0x53a1('0x5d')]['count']({'where':_0x427aab[_0x53a1('0x9b')]})['then'](function(_0x541bbd){_0x10d871[_0x53a1('0x22')]=_0x541bbd;if(_0x4f8613[_0x53a1('0x39')][_0x53a1('0xa0')]){_0x427aab['include']=[{'all':!![]}];}return db[_0x53a1('0x5d')][_0x53a1('0x37')](_0x427aab);})['then'](function(_0x2aba59){_0x10d871[_0x53a1('0xa1')]=_0x2aba59;return _0x10d871;});}})[_0x53a1('0x11')](respondWithFilteredResult(_0x22e646,_0x427aab))[_0x53a1('0x1b')](handleError(_0x22e646,null));};exports['getMyMessages']=function(_0xa7cf0d,_0x57be75){var _0x275093={'where':{}},_0x5bd589={},_0x282e21={'count':0x0,'rows':[]};return db[_0x53a1('0x32')][_0x53a1('0x49')]({'where':{'id':_0xa7cf0d['params']['id']}})['then'](handleEntityNotFound(_0x57be75,null))['then'](function(_0x1047ea){if(_0x1047ea){_0x5bd589[_0x53a1('0x3d')]=_[_0x53a1('0x3e')](db[_0x53a1('0x5d')]['rawAttributes']);_0x5bd589[_0x53a1('0x39')]=_[_0x53a1('0x3e')](_0xa7cf0d[_0x53a1('0x39')]);_0x5bd589[_0x53a1('0x96')]=_[_0x53a1('0x40')](_0x5bd589[_0x53a1('0x3d')],_0x5bd589[_0x53a1('0x39')]);_0x275093[_0x53a1('0x3f')]=_[_0x53a1('0x40')](_0x5bd589[_0x53a1('0x3d')],qs[_0x53a1('0x41')](_0xa7cf0d[_0x53a1('0x39')][_0x53a1('0x41')]));_0x275093[_0x53a1('0x3f')]=_0x275093[_0x53a1('0x3f')][_0x53a1('0x42')]?_0x275093[_0x53a1('0x3f')]:_0x5bd589[_0x53a1('0x3d')];if(!_0xa7cf0d[_0x53a1('0x39')][_0x53a1('0x97')](_0x53a1('0x98'))){_0x275093['limit']=qs[_0x53a1('0x20')](_0xa7cf0d[_0x53a1('0x39')][_0x53a1('0x20')]);_0x275093[_0x53a1('0x1f')]=qs[_0x53a1('0x1f')](_0xa7cf0d[_0x53a1('0x39')][_0x53a1('0x1f')]);}_0x275093['order']=qs['sort'](_0xa7cf0d[_0x53a1('0x39')]['sort']);_0x275093[_0x53a1('0x9b')]=qs['filters'](_[_0x53a1('0x9c')](_0xa7cf0d[_0x53a1('0x39')],_0x5bd589[_0x53a1('0x96')]));_0x275093[_0x53a1('0x9b')][_0x53a1('0xa2')]=_0x1047ea['id'];if(_0xa7cf0d[_0x53a1('0x39')]['filter']){_0x275093[_0x53a1('0x9b')]=_[_0x53a1('0x2a')](_0x275093['where'],{'$or':_[_0x53a1('0x31')](_0x275093[_0x53a1('0x3f')],function(_0x1bffd3){var _0x5af6b7={};_0x5af6b7[_0x1bffd3]={'$like':'%'+_0xa7cf0d[_0x53a1('0x39')][_0x53a1('0x9d')]+'%'};return _0x5af6b7;})});}_0x275093[_0x53a1('0x9b')][_0x53a1('0x87')]=![];if(_0xa7cf0d['query']['id']){_0x275093[_0x53a1('0x9b')]['id']={'$gt':_0xa7cf0d[_0x53a1('0x39')]['id']};}_0x275093=_[_0x53a1('0x2a')]({},_0x275093,_0xa7cf0d['options']);return db['ChatMessage'][_0x53a1('0x22')]({'where':_0x275093[_0x53a1('0x9b')]})['then'](function(_0x208841){_0x282e21['count']=_0x208841;_0x275093['include']=[];if(_0xa7cf0d[_0x53a1('0x39')]['includeAgent']){_0x275093[_0x53a1('0x43')][_0x53a1('0xa3')]({'model':db[_0x53a1('0x7c')],'as':_0x53a1('0x7c'),'attributes':['id',_0x53a1('0x51'),_0x53a1('0xa4')]});}if(_0xa7cf0d[_0x53a1('0x39')][_0x53a1('0xa0')]){_0x275093['include']=[{'all':!![]}];}return db['ChatMessage'][_0x53a1('0x37')](_0x275093);})[_0x53a1('0x11')](function(_0x4dc428){_0x282e21['rows']=_0x4dc428;return _0x282e21;});}})['then'](respondWithFilteredResult(_0x57be75,_0x275093))[_0x53a1('0x1b')](handleError(_0x57be75,null));};exports[_0x53a1('0xa5')]=function(_0x1d5e1f,_0xb368ab){return db[_0x53a1('0x32')]['find']({'where':{'id':_0x1d5e1f['params']['id']}})[_0x53a1('0x11')](handleEntityNotFound(_0xb368ab,null))[_0x53a1('0x11')](function(_0x5290e2){if(_0x5290e2){return _0x5290e2[_0x53a1('0xa6')](_0x1d5e1f['body'][_0x53a1('0x93')],_[_0x53a1('0x94')](_0x1d5e1f[_0x53a1('0x2b')],['ids','id'])||{})[_0x53a1('0xa7')](function(){return db['Tag'][_0x53a1('0x37')]({'attributes':['id',_0x53a1('0x28'),_0x53a1('0xa8')],'where':{'id':_0x1d5e1f['body']['ids']}});})['then'](function(_0x190084){socket['emit'](_0x53a1('0xa9'),{'id':Number(_0x1d5e1f[_0x53a1('0x3c')]['id']),'tags':_0x190084||[]});return{'id':Number(_0x1d5e1f[_0x53a1('0x3c')]['id']),'tags':_0x190084||[]};});}})[_0x53a1('0x11')](respondWithResult(_0xb368ab,null))['catch'](handleError(_0xb368ab,null));};exports[_0x53a1('0xaa')]=function(_0xd1e900,_0x7d48d9){return db[_0x53a1('0x32')]['find']({'where':{'id':_0xd1e900[_0x53a1('0x3c')]['id']}})[_0x53a1('0x11')](handleEntityNotFound(_0x7d48d9,null))[_0x53a1('0x11')](function(_0x1ca795){if(_0x1ca795){return _0x1ca795[_0x53a1('0xaa')](_0xd1e900['query'][_0x53a1('0x93')]);}})[_0x53a1('0x11')](respondWithStatusCode(_0x7d48d9,null))[_0x53a1('0x1b')](handleError(_0x7d48d9,null));};exports['download']=function(_0x4eb911,_0x142525){var _0x6b3b8b=moment()['unix']()[_0x53a1('0xab')]();var _0x3b8c26=path[_0x53a1('0x73')](config['root'],'server',_0x53a1('0xac'),_0x53a1('0xad'));var _0x40bcee=path[_0x53a1('0x73')](config[_0x53a1('0x74')],_0x53a1('0xae'),_0x53a1('0xac'),_0x53a1('0xaf'));var _0x510d00=path[_0x53a1('0x73')](_0x3b8c26,_0x6b3b8b);var _0x53f8fd=util[_0x53a1('0x78')](_0x53a1('0xb0'),_0x4eb911['params']['id'],_0x6b3b8b);var _0x176c59=path[_0x53a1('0x73')](_0x3b8c26,_0x53f8fd);var _0x258397=[];_0x258397[_0x53a1('0xa3')]({'model':db['User'],'as':'User','attributes':['id',_0x53a1('0x51')],'raw':!![]});_0x258397[_0x53a1('0xa3')]({'model':db[_0x53a1('0x7d')],'as':_0x53a1('0x61'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x4eb911[_0x53a1('0x39')][_0x53a1('0xaf')]){_0x258397[_0x53a1('0xa3')]({'model':db[_0x53a1('0x6e')],'as':_0x53a1('0x6e'),'raw':!![]});}var _0x1f4a9f=[{'model':db[_0x53a1('0x5d')],'as':'Messages','attributes':['id',_0x53a1('0x2b'),_0x53a1('0x86'),'direction','secret',_0x53a1('0xb1')],'include':_0x258397}];_0x1f4a9f['push']({'model':db[_0x53a1('0x4a')],'as':'Account','attributes':['id',_0x53a1('0x28')]});_0x1f4a9f[_0x53a1('0xa3')]({'model':db['User'],'as':_0x53a1('0xb2'),'attributes':['id',_0x53a1('0x51')]});return db[_0x53a1('0x32')][_0x53a1('0x46')]({'where':{'id':_0x4eb911[_0x53a1('0x3c')]['id']},'include':_0x1f4a9f})['then'](handleEntityNotFound(_0x142525,null))[_0x53a1('0x11')](function(_0x52c127){if(_0x52c127){var _0x11a98b=_0x52c127['get']({'plain':!![]});fs[_0x53a1('0xb3')](_0x510d00);var _0x58f97d={'channel':_0x53a1('0xb4'),'account':_0x11a98b['Account'][_0x53a1('0x28')],'agent':_0x11a98b[_0x53a1('0xb2')]?_0x11a98b['Owner'][_0x53a1('0x51')]:'N.A.','createdAt':moment(_0x11a98b[_0x53a1('0x86')])[_0x53a1('0x78')]('YYYY-MM-DD\x20HH:mm:ss')[_0x53a1('0xab')](),'closedAt':_0x11a98b['closed']?moment(_0x11a98b[_0x53a1('0xb5')])[_0x53a1('0x78')](_0x53a1('0x9f'))[_0x53a1('0xab')]():'','disposition':_0x11a98b['disposition'],'chatInfo':{'browser':_0x11a98b[_0x53a1('0xb6')],'os':_0x11a98b[_0x53a1('0xb7')],'referer':_0x11a98b[_0x53a1('0xb8')],'customerIp':_0x11a98b[_0x53a1('0xb9')],'customerPort':_0x11a98b['customerPort']?_0x11a98b[_0x53a1('0xba')]:_0x53a1('0xbb')},'messages':_(_0x11a98b['Messages'])[_0x53a1('0xbc')]()[_0x53a1('0x9d')]({'secret':![]})['map'](function(_0x3ee993){if(_0x3ee993[_0x53a1('0x6e')]){var _0xd8264d=path[_0x53a1('0x73')](_0x40bcee,_0x3ee993['Attachment']['basename']);if(fs[_0x53a1('0xbd')](_0xd8264d)){fs[_0x53a1('0xbe')](_0xd8264d)[_0x53a1('0xbf')](fs['createWriteStream'](path[_0x53a1('0x73')](_0x510d00,_0x3ee993['Attachment'][_0x53a1('0x6a')])));}}return{'date':moment(_0x3ee993[_0x53a1('0x86')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x53a1('0xab')](),'sender':_0x3ee993['direction']==='out'?_0x3ee993['User']?_0x3ee993['User']['fullname']:_0x53a1('0x7f'):_0x3ee993[_0x53a1('0x61')][_0x53a1('0xc0')]+(_0x3ee993[_0x53a1('0x61')][_0x53a1('0xc1')]?'\x20'+_0x3ee993[_0x53a1('0x61')][_0x53a1('0xc1')]:''),'body':_0x3ee993[_0x53a1('0x6e')]?_0x3ee993[_0x53a1('0x6e')][_0x53a1('0x6a')]:_0x3ee993[_0x53a1('0x2b')],'direction':_0x3ee993['direction']===_0x53a1('0xc2')?'A':'C','secret':_0x3ee993['secret'],'read':_0x3ee993[_0x53a1('0xb1')],'attachment':_0x3ee993[_0x53a1('0x6e')]};})[_0x53a1('0xc3')]()};return ejs[_0x53a1('0xc4')](path[_0x53a1('0x73')](config[_0x53a1('0x74')],'server',_0x53a1('0xc5'),_0x53a1('0xc6')),{'interaction':_0x58f97d})[_0x53a1('0x11')](function(_0x120878){var _0x36b6b0=path['join'](_0x510d00,_0x53a1('0xc7')+_0x11a98b['id']+'-'+_0x6b3b8b+_0x53a1('0xc8'));var _0x460d21={'path':_0x36b6b0,'channel':_0x53a1('0xb4'),'interactionId':_0x11a98b['id']};return pdf[_0x53a1('0xc9')](_0x120878,_0x460d21);})[_0x53a1('0x11')](function(){return new Promise(function(_0x1fe3ce,_0x2ccedf){zipdir(_0x510d00,{'saveTo':_0x176c59},function(_0x2918c2,_0x307684){if(_0x2918c2)return _0x2ccedf(_0x2918c2);return _0x1fe3ce(_0x307684);});})['then'](function(){return new BPromise(function(_0x26d733,_0x1e7170){rimraf(_0x510d00,function(_0x42e33d){if(_0x42e33d)_0x1e7170(_0x42e33d);return _0x26d733();});});})[_0x53a1('0x11')](function(){return _0x142525[_0x53a1('0xca')](_0x176c59,_0x53f8fd,function(_0xbcb0cf){if(_0xbcb0cf){logger['error'](_0x53a1('0xcb'),_0xbcb0cf);}else{fs['unlinkSync'](_0x176c59);}});});});}else{return _0x142525[_0x53a1('0x1c')](0xc8);}})[_0x53a1('0x1b')](handleError(_0x142525,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 87bc9b0..6053c45 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 _0x4514=['events','../../mysqldb','ChatInteraction','setMaxListeners','save','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x16ea87,_0x378d8b){var _0x6e7b1c=function(_0x26306e){while(--_0x26306e){_0x16ea87['push'](_0x16ea87['shift']());}};_0x6e7b1c(++_0x378d8b);}(_0x4514,0xfc));var _0x4451=function(_0x27900c,_0x2868fd){_0x27900c=_0x27900c-0x0;var _0x3ea8e0=_0x4514[_0x27900c];return _0x3ea8e0;};'use strict';var EventEmitter=require(_0x4451('0x0'));var ChatInteraction=require(_0x4451('0x1'))['db'][_0x4451('0x2')];var ChatMessage=require(_0x4451('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x4451('0x3')](0x0);var events={'afterCreate':_0x4451('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3be86e){return function(_0x1c621f,_0x348baf,_0x13e94b){_0x1c621f[_0x4451('0x5')]({'attributes':['id'],'raw':!![]})[_0x4451('0x6')](function(_0x55d661){_0x1c621f[_0x4451('0x7')](_0x4451('0x8'),_0x55d661[_0x4451('0x9')](function(_0x2d83be){return{'id':_0x2d83be['id']};}));return ChatMessage[_0x4451('0xa')]({'where':{'ChatInteractionId':_0x1c621f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4451('0x6')](function(_0x484370){_0x1c621f[_0x4451('0x7')](_0x4451('0xb'),_0x484370[_0x4451('0xc')]);ChatInteractionEvents[_0x4451('0xd')](_0x3be86e+':'+_0x1c621f['id'],_0x1c621f);ChatInteractionEvents[_0x4451('0xd')](_0x3be86e,_0x1c621f);_0x13e94b(null);})[_0x4451('0xe')](_0x13e94b(null));};}for(var e in events){if(events[_0x4451('0xf')](e)){var event=events[e];ChatInteraction[_0x4451('0x10')](e,emitEvent(event));}}module[_0x4451('0x11')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x425b=['length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','ChatInteraction','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0x41ee16,_0xfa94c3){var _0x1f60de=function(_0x1c8ffc){while(--_0x1c8ffc){_0x41ee16['push'](_0x41ee16['shift']());}};_0x1f60de(++_0xfa94c3);}(_0x425b,0x191));var _0xb425=function(_0xc4ddc3,_0x4c7d3f){_0xc4ddc3=_0xc4ddc3-0x0;var _0x28045e=_0x425b[_0xc4ddc3];return _0x28045e;};'use strict';var EventEmitter=require(_0xb425('0x0'));var ChatInteraction=require(_0xb425('0x1'))['db'][_0xb425('0x2')];var ChatMessage=require(_0xb425('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xb425('0x3')](0x0);var events={'afterCreate':_0xb425('0x4'),'afterUpdate':_0xb425('0x5'),'afterDestroy':'remove'};function emitEvent(_0x424a2a){return function(_0x3bee6f,_0x2b3332,_0x3177fe){_0x3bee6f[_0xb425('0x6')]({'attributes':['id'],'raw':!![]})[_0xb425('0x7')](function(_0x1d1c8e){_0x3bee6f[_0xb425('0x8')](_0xb425('0x9'),_0x1d1c8e[_0xb425('0xa')](function(_0x50bb20){return{'id':_0x50bb20['id']};}));return ChatMessage[_0xb425('0xb')]({'where':{'ChatInteractionId':_0x3bee6f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x57e9cd){_0x3bee6f['setDataValue'](_0xb425('0xc'),_0x57e9cd[_0xb425('0xd')]);ChatInteractionEvents[_0xb425('0xe')](_0x424a2a+':'+_0x3bee6f['id'],_0x3bee6f);ChatInteractionEvents['emit'](_0x424a2a,_0x3bee6f);_0x3177fe(null);})[_0xb425('0xf')](_0x3177fe(null));};}for(var e in events){if(events[_0xb425('0x10')](e)){var event=events[e];ChatInteraction[_0xb425('0x11')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 927a5eb..13995d0 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 _0xcd82=['utf8mb4_unicode_ci','lodash','util','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5e8d3e,_0x18ed2e){var _0x1348c0=function(_0x5a889f){while(--_0x5a889f){_0x5e8d3e['push'](_0x5e8d3e['shift']());}};_0x1348c0(++_0x18ed2e);}(_0xcd82,0x11e));var _0x2cd8=function(_0x1ac5ed,_0x37c9ea){_0x1ac5ed=_0x1ac5ed-0x0;var _0x56cda8=_0xcd82[_0x1ac5ed];return _0x56cda8;};'use strict';var _=require(_0x2cd8('0x0'));var util=require(_0x2cd8('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2cd8('0x2'));var rp=require(_0x2cd8('0x3'));var fs=require('fs');var path=require(_0x2cd8('0x4'));var rimraf=require(_0x2cd8('0x5'));var config=require('../../config/environment');var attributes=require(_0x2cd8('0x6'));module[_0x2cd8('0x7')]=function(_0x15bc39,_0x2932af){return _0x15bc39['define'](_0x2cd8('0x8'),attributes,{'tableName':_0x2cd8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1241e2,_0x242932,_0x3406ba){if(_0x1241e2[_0x2cd8('0xa')](_0x2cd8('0xb'))){_0x1241e2['closedAt']=moment()[_0x2cd8('0xc')](_0x2cd8('0xd'));}_0x3406ba(null,_0x1241e2);}},'charset':'utf8mb4','collate':_0x2cd8('0xe')});};
\ No newline at end of file
+var _0xbc24=['YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closedAt','format'];(function(_0x20d06a,_0x16b092){var _0x1c48ef=function(_0x2da6d5){while(--_0x2da6d5){_0x20d06a['push'](_0x20d06a['shift']());}};_0x1c48ef(++_0x16b092);}(_0xbc24,0x106));var _0x4bc2=function(_0x1e0ee7,_0x4c6ec9){_0x1e0ee7=_0x1e0ee7-0x0;var _0x4c8045=_0xbc24[_0x1e0ee7];return _0x4c8045;};'use strict';var _=require(_0x4bc2('0x0'));var util=require(_0x4bc2('0x1'));var logger=require(_0x4bc2('0x2'))(_0x4bc2('0x3'));var moment=require(_0x4bc2('0x4'));var BPromise=require(_0x4bc2('0x5'));var rp=require(_0x4bc2('0x6'));var fs=require('fs');var path=require(_0x4bc2('0x7'));var rimraf=require(_0x4bc2('0x8'));var config=require(_0x4bc2('0x9'));var attributes=require(_0x4bc2('0xa'));module[_0x4bc2('0xb')]=function(_0x1b9baf,_0x38778c){return _0x1b9baf[_0x4bc2('0xc')](_0x4bc2('0xd'),attributes,{'tableName':_0x4bc2('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5b9239,_0x25808c,_0x1fe0ec){if(_0x5b9239[_0x4bc2('0xf')]('closed')){_0x5b9239[_0x4bc2('0x10')]=moment()[_0x4bc2('0x11')](_0x4bc2('0x12'));}_0x1fe0ec(null,_0x5b9239);}},'charset':_0x4bc2('0x13'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 47189e8..9cb4162 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 _0x837b=['omit','ids','spread','AddTags','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','request\x20sent','debug','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','attributes','limit','AddTagsToChatInteraction','find','where','addTags'];(function(_0x106517,_0x9ada4d){var _0x5a6280=function(_0x33805e){while(--_0x33805e){_0x106517['push'](_0x106517['shift']());}};_0x5a6280(++_0x9ada4d);}(_0x837b,0x14c));var _0xb837=function(_0x2c7f80,_0x2b0052){_0x2c7f80=_0x2c7f80-0x0;var _0x11fe38=_0x837b[_0x2c7f80];return _0x11fe38;};'use strict';var _=require(_0xb837('0x0'));var util=require('util');var moment=require(_0xb837('0x1'));var BPromise=require('bluebird');var rs=require(_0xb837('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb837('0x3'))['db'];var utils=require(_0xb837('0x4'));var logger=require(_0xb837('0x5'))(_0xb837('0x6'));var config=require('../../config/environment');var jayson=require(_0xb837('0x7'));var client=jayson[_0xb837('0x8')]['http']({'port':0x232a});config[_0xb837('0x9')]=_[_0xb837('0xa')](config['redis'],{'host':_0xb837('0xb'),'port':0x18eb});var socket=require(_0xb837('0xc'))(new Redis(config[_0xb837('0x9')]));require(_0xb837('0xd'))['register'](socket);function respondWithRpcPromise(_0x318b8a,_0x4c78a2,_0x161000){return new BPromise(function(_0x377511,_0x39575a){return client[_0xb837('0xe')](_0x318b8a,_0x161000)[_0xb837('0xf')](function(_0x3f0eaf){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x4c78a2,_0xb837('0x10'));logger[_0xb837('0x11')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x4c78a2,_0xb837('0x10'),JSON[_0xb837('0x12')](_0x3f0eaf));if(_0x3f0eaf[_0xb837('0x13')]){if(_0x3f0eaf[_0xb837('0x13')][_0xb837('0x14')]===0x1f4){logger[_0xb837('0x13')](_0xb837('0x15'),_0x4c78a2,_0x3f0eaf[_0xb837('0x13')][_0xb837('0x16')]);return _0x39575a(_0x3f0eaf[_0xb837('0x13')][_0xb837('0x16')]);}logger[_0xb837('0x13')](_0xb837('0x15'),_0x4c78a2,_0x3f0eaf['error'][_0xb837('0x16')]);return _0x377511(_0x3f0eaf[_0xb837('0x13')][_0xb837('0x16')]);}else{logger[_0xb837('0x17')](_0xb837('0x15'),_0x4c78a2,_0xb837('0x10'));_0x377511(_0x3f0eaf['result']['message']);}})[_0xb837('0x18')](function(_0x3f7107){logger['error'](_0xb837('0x15'),_0x4c78a2,_0x3f7107);_0x39575a(_0x3f7107);});});}exports[_0xb837('0x19')]=function(_0x2fcd94){var _0x458587=this;return new Promise(function(_0x40e6fc,_0x15ef9d){return db[_0xb837('0x1a')][_0xb837('0x1b')](_0x2fcd94[_0xb837('0x1c')],{'raw':_0x2fcd94[_0xb837('0x1d')]?_0x2fcd94[_0xb837('0x1d')][_0xb837('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fcd94[_0xb837('0x1d')]?_0x2fcd94[_0xb837('0x1d')]['where']||null:null,'attributes':_0x2fcd94[_0xb837('0x1d')]?_0x2fcd94[_0xb837('0x1d')][_0xb837('0x1f')]||null:null,'limit':_0x2fcd94['options']?_0x2fcd94[_0xb837('0x1d')][_0xb837('0x20')]||null:null})[_0xb837('0xf')](function(_0x2ed1cb){logger[_0xb837('0x17')](_0xb837('0x19'),_0x2fcd94);logger[_0xb837('0x11')]('UpdateChatInteraction',_0x2fcd94,JSON[_0xb837('0x12')](_0x2ed1cb));_0x40e6fc(_0x2ed1cb);})['catch'](function(_0x3413a9){logger[_0xb837('0x13')](_0xb837('0x19'),_0x3413a9['message'],_0x2fcd94);_0x15ef9d(_0x458587['error'](0x1f4,_0x3413a9[_0xb837('0x16')]));});});};exports[_0xb837('0x21')]=function(_0x1446d0){return new Promise(function(_0xcea74c,_0x12d1a1){return db['ChatInteraction'][_0xb837('0x22')]({'where':_0x1446d0[_0xb837('0x1d')]?_0x1446d0['options'][_0xb837('0x23')]||null:null})[_0xb837('0xf')](function(_0x582ab4){if(_0x582ab4){return _0x582ab4[_0xb837('0x24')](_0x1446d0['body']['ids'],_[_0xb837('0x25')](_0x1446d0['body'],[_0xb837('0x26'),'id'])||{});}})[_0xb837('0x27')](function(_0x45a6e9){logger[_0xb837('0x17')]('AddTags',_0x1446d0);logger['debug'](_0xb837('0x28'),_0x1446d0,JSON[_0xb837('0x12')](_0x45a6e9));_0xcea74c(_0x45a6e9);})[_0xb837('0x18')](function(_0x3a74a9){logger['error']('AddTags',_0x3a74a9['message'],_0x1446d0);_0x12d1a1(_this['error'](0x1f4,_0x3a74a9[_0xb837('0x16')]));});});};
\ No newline at end of file
+var _0xb51e=['debug','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','http','redis','localhost','./chatInteraction.socket','request','then','info','request\x20sent'];(function(_0x286282,_0x21c62d){var _0x452868=function(_0x206985){while(--_0x206985){_0x286282['push'](_0x286282['shift']());}};_0x452868(++_0x21c62d);}(_0xb51e,0x87));var _0xeb51=function(_0x20adc7,_0x16cd8c){_0x20adc7=_0x20adc7-0x0;var _0x22b4f1=_0xb51e[_0x20adc7];return _0x22b4f1;};'use strict';var _=require(_0xeb51('0x0'));var util=require(_0xeb51('0x1'));var moment=require(_0xeb51('0x2'));var BPromise=require(_0xeb51('0x3'));var rs=require(_0xeb51('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeb51('0x5'))['db'];var utils=require(_0xeb51('0x6'));var logger=require('../../config/logger')(_0xeb51('0x7'));var config=require(_0xeb51('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xeb51('0x9')]({'port':0x232a});config[_0xeb51('0xa')]=_['defaults'](config[_0xeb51('0xa')],{'host':_0xeb51('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeb51('0xa')]));require(_0xeb51('0xc'))['register'](socket);function respondWithRpcPromise(_0x1e8190,_0x30b61c,_0x588610){return new BPromise(function(_0x1b8e49,_0x4c658f){return client[_0xeb51('0xd')](_0x1e8190,_0x588610)[_0xeb51('0xe')](function(_0x5f4238){logger[_0xeb51('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x30b61c,_0xeb51('0x10'));logger[_0xeb51('0x11')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x30b61c,_0xeb51('0x10'),JSON[_0xeb51('0x12')](_0x5f4238));if(_0x5f4238[_0xeb51('0x13')]){if(_0x5f4238[_0xeb51('0x13')][_0xeb51('0x14')]===0x1f4){logger[_0xeb51('0x13')](_0xeb51('0x15'),_0x30b61c,_0x5f4238[_0xeb51('0x13')][_0xeb51('0x16')]);return _0x4c658f(_0x5f4238['error'][_0xeb51('0x16')]);}logger[_0xeb51('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x30b61c,_0x5f4238['error'][_0xeb51('0x16')]);return _0x1b8e49(_0x5f4238['error'][_0xeb51('0x16')]);}else{logger[_0xeb51('0xf')](_0xeb51('0x15'),_0x30b61c,'request\x20sent');_0x1b8e49(_0x5f4238[_0xeb51('0x17')]['message']);}})[_0xeb51('0x18')](function(_0x316af4){logger[_0xeb51('0x13')](_0xeb51('0x15'),_0x30b61c,_0x316af4);_0x4c658f(_0x316af4);});});}exports[_0xeb51('0x19')]=function(_0x52e004){var _0x544269=this;return new Promise(function(_0x31bcbf,_0x495ddc){return db[_0xeb51('0x1a')][_0xeb51('0x1b')](_0x52e004[_0xeb51('0x1c')],{'raw':_0x52e004[_0xeb51('0x1d')]?_0x52e004[_0xeb51('0x1d')][_0xeb51('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52e004['options']?_0x52e004['options'][_0xeb51('0x1f')]||null:null,'attributes':_0x52e004['options']?_0x52e004[_0xeb51('0x1d')][_0xeb51('0x20')]||null:null,'limit':_0x52e004[_0xeb51('0x1d')]?_0x52e004[_0xeb51('0x1d')]['limit']||null:null})['then'](function(_0x563984){logger[_0xeb51('0xf')](_0xeb51('0x19'),_0x52e004);logger[_0xeb51('0x11')](_0xeb51('0x19'),_0x52e004,JSON[_0xeb51('0x12')](_0x563984));_0x31bcbf(_0x563984);})[_0xeb51('0x18')](function(_0x4d403d){logger[_0xeb51('0x13')](_0xeb51('0x19'),_0x4d403d[_0xeb51('0x16')],_0x52e004);_0x495ddc(_0x544269[_0xeb51('0x13')](0x1f4,_0x4d403d['message']));});});};exports['AddTagsToChatInteraction']=function(_0x225e43){return new Promise(function(_0xe03ab5,_0x1e5f9a){return db[_0xeb51('0x1a')][_0xeb51('0x21')]({'where':_0x225e43[_0xeb51('0x1d')]?_0x225e43['options']['where']||null:null})['then'](function(_0x2b9318){if(_0x2b9318){return _0x2b9318[_0xeb51('0x22')](_0x225e43[_0xeb51('0x1c')]['ids'],_['omit'](_0x225e43[_0xeb51('0x1c')],[_0xeb51('0x23'),'id'])||{});}})[_0xeb51('0x24')](function(_0x46de1c){logger[_0xeb51('0xf')](_0xeb51('0x25'),_0x225e43);logger[_0xeb51('0x11')](_0xeb51('0x25'),_0x225e43,JSON[_0xeb51('0x12')](_0x46de1c));_0xe03ab5(_0x46de1c);})[_0xeb51('0x18')](function(_0x5db673){logger[_0xeb51('0x13')](_0xeb51('0x25'),_0x5db673[_0xeb51('0x16')],_0x225e43);_0x1e5f9a(_this['error'](0x1f4,_0x5db673[_0xeb51('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 4be20a1..e1a8eaf 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 _0x1b9c=['removeListener','length','chatInteraction:','./chatInteraction.events','save','update'];(function(_0x183214,_0x2b0629){var _0x701714=function(_0x24f5fc){while(--_0x24f5fc){_0x183214['push'](_0x183214['shift']());}};_0x701714(++_0x2b0629);}(_0x1b9c,0x1ad));var _0xc1b9=function(_0x473773,_0x55bf3c){_0x473773=_0x473773-0x0;var _0x14a95c=_0x1b9c[_0x473773];return _0x14a95c;};'use strict';var ChatInteractionEvents=require(_0xc1b9('0x0'));var events=[_0xc1b9('0x1'),'remove',_0xc1b9('0x2')];function createListener(_0xe4413e,_0x5551a4){return function(_0x8d93c4){_0x5551a4['emit'](_0xe4413e,_0x8d93c4);};}function removeListener(_0x90b4e4,_0x5593de){return function(){ChatInteractionEvents[_0xc1b9('0x3')](_0x90b4e4,_0x5593de);};}exports['register']=function(_0x21e501){for(var _0x56a1f5=0x0,_0x52ac80=events[_0xc1b9('0x4')];_0x56a1f5<_0x52ac80;_0x56a1f5++){var _0x1b9fe7=events[_0x56a1f5];var _0x584782=createListener(_0xc1b9('0x5')+_0x1b9fe7,_0x21e501);ChatInteractionEvents['on'](_0x1b9fe7,_0x584782);}};
\ No newline at end of file
+var _0x686d=['update','register','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x372198,_0x31cb62){var _0x510048=function(_0x4b370d){while(--_0x4b370d){_0x372198['push'](_0x372198['shift']());}};_0x510048(++_0x31cb62);}(_0x686d,0x172));var _0xd686=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x686d[_0x20a584];return _0x4b41a8;};'use strict';var ChatInteractionEvents=require(_0xd686('0x0'));var events=[_0xd686('0x1'),'remove',_0xd686('0x2')];function createListener(_0xd8c3b2,_0x489671){return function(_0x5b7a13){_0x489671['emit'](_0xd8c3b2,_0x5b7a13);};}function removeListener(_0x16af4c,_0x1e5a5e){return function(){ChatInteractionEvents['removeListener'](_0x16af4c,_0x1e5a5e);};}exports[_0xd686('0x3')]=function(_0x5cc0b3){for(var _0x144020=0x0,_0x2e44cf=events[_0xd686('0x4')];_0x144020<_0x2e44cf;_0x144020++){var _0x511a5e=events[_0x144020];var _0xbb3ea0=createListener(_0xd686('0x5')+_0x511a5e,_0x5cc0b3);ChatInteractionEvents['on'](_0x511a5e,_0xbb3ea0);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 00163cc..8329785 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 _0x6dc2=['/:id/my_messages','getMyMessages','/:id/download','download','post','create','createVidaooSession','diskStorage','root','server/files/attachments/','format','originalname','replace','/:id/attachment_upload','single','attachmentUpload','addMessage','chat','chatinteraction:addtags','addTags','tracked','chatinteraction:update','put','customUpdate','/:id/abandon','abandon','close','chatinteraction:destroy','destroy','delete','/:id/tags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages'];(function(_0xddfab6,_0x57f0f6){var _0x238867=function(_0x13e72e){while(--_0x13e72e){_0xddfab6['push'](_0xddfab6['shift']());}};_0x238867(++_0x57f0f6);}(_0x6dc2,0xc5));var _0x26dc=function(_0x26e9c6,_0x3b7098){_0x26e9c6=_0x26e9c6-0x0;var _0x461ebc=_0x6dc2[_0x26e9c6];return _0x461ebc;};'use strict';var multer=require(_0x26dc('0x0'));var util=require(_0x26dc('0x1'));var path=require(_0x26dc('0x2'));var timeout=require(_0x26dc('0x3'));var express=require(_0x26dc('0x4'));var router=express[_0x26dc('0x5')]();var fs_extra=require(_0x26dc('0x6'));var auth=require(_0x26dc('0x7'));var interaction=require(_0x26dc('0x8'));var config=require(_0x26dc('0x9'));var controller=require(_0x26dc('0xa'));router[_0x26dc('0xb')]('/',auth[_0x26dc('0xc')](),controller[_0x26dc('0xd')]);router[_0x26dc('0xb')](_0x26dc('0xe'),auth[_0x26dc('0xc')](),controller[_0x26dc('0xf')]);router[_0x26dc('0xb')](_0x26dc('0x10'),auth[_0x26dc('0x11')](),controller[_0x26dc('0x12')]);router[_0x26dc('0xb')](_0x26dc('0x13'),auth[_0x26dc('0x11')](),controller[_0x26dc('0x14')]);router[_0x26dc('0xb')](_0x26dc('0x15'),auth['isAuthenticated'](),controller[_0x26dc('0x16')]);router[_0x26dc('0xb')](_0x26dc('0x17'),auth[_0x26dc('0x11')](),controller[_0x26dc('0x18')]);router[_0x26dc('0xb')](_0x26dc('0x19'),auth[_0x26dc('0xc')](),controller[_0x26dc('0x1a')]);router[_0x26dc('0x1b')]('/',auth['isAuthenticated'](),controller[_0x26dc('0x1c')]);router[_0x26dc('0x1b')]('/:id/vidaoo',auth[_0x26dc('0xc')](),controller[_0x26dc('0x1d')]);var upload=multer({'storage':multer[_0x26dc('0x1e')]({'destination':function(_0x11bf94,_0x1b880c,_0xf92c3f){_0xf92c3f(null,path['join'](config[_0x26dc('0x1f')],_0x26dc('0x20')));},'filename':function(_0x5f243b,_0x4712b0,_0x21eba9){_0x21eba9(null,util[_0x26dc('0x21')]('%s-%s',Date['now'](),_0x4712b0[_0x26dc('0x22')][_0x26dc('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x26dc('0x1b')](_0x26dc('0x24'),upload[_0x26dc('0x25')]('file'),controller[_0x26dc('0x26')]);router['post']('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x26dc('0x27')]);router[_0x26dc('0x1b')]('/:id/tags',auth[_0x26dc('0xc')](),interaction['tracked'](_0x26dc('0x28'),_0x26dc('0x29')),controller[_0x26dc('0x2a')]);router['put'](_0x26dc('0x10'),auth['isAuthenticated'](),interaction[_0x26dc('0x2b')](_0x26dc('0x28'),_0x26dc('0x2c')),controller['update']);router[_0x26dc('0x2d')]('/:id/custom_update',controller[_0x26dc('0x2e')]);router['put'](_0x26dc('0x2f'),auth[_0x26dc('0x11')](),controller[_0x26dc('0x30')]);router['put']('/:id/close',controller[_0x26dc('0x31')]);router['delete']('/:id',auth[_0x26dc('0xc')](),interaction[_0x26dc('0x2b')](_0x26dc('0x28'),_0x26dc('0x32')),controller[_0x26dc('0x33')]);router[_0x26dc('0x34')](_0x26dc('0x35'),auth[_0x26dc('0xc')](),controller['removeTags']);module[_0x26dc('0x36')]=router;
\ No newline at end of file
+var _0x2e57=['originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','format','%s-%s'];(function(_0x54defc,_0x627178){var _0x1955d3=function(_0x299afe){while(--_0x299afe){_0x54defc['push'](_0x54defc['shift']());}};_0x1955d3(++_0x627178);}(_0x2e57,0x1a7));var _0x72e5=function(_0x58fae4,_0x4be087){_0x58fae4=_0x58fae4-0x0;var _0x516951=_0x2e57[_0x58fae4];return _0x516951;};'use strict';var multer=require(_0x72e5('0x0'));var util=require(_0x72e5('0x1'));var path=require('path');var timeout=require(_0x72e5('0x2'));var express=require(_0x72e5('0x3'));var router=express[_0x72e5('0x4')]();var fs_extra=require(_0x72e5('0x5'));var auth=require(_0x72e5('0x6'));var interaction=require(_0x72e5('0x7'));var config=require(_0x72e5('0x8'));var controller=require('./chatInteraction.controller');router[_0x72e5('0x9')]('/',auth[_0x72e5('0xa')](),controller[_0x72e5('0xb')]);router[_0x72e5('0x9')](_0x72e5('0xc'),auth[_0x72e5('0xa')](),controller['describe']);router[_0x72e5('0x9')](_0x72e5('0xd'),auth[_0x72e5('0xe')](),controller[_0x72e5('0xf')]);router[_0x72e5('0x9')](_0x72e5('0x10'),auth[_0x72e5('0xe')](),controller[_0x72e5('0x11')]);router[_0x72e5('0x9')](_0x72e5('0x12'),auth[_0x72e5('0xa')](),controller[_0x72e5('0x13')]);router['get'](_0x72e5('0x14'),auth['isChatInteractionAuthorized'](),controller[_0x72e5('0x15')]);router[_0x72e5('0x9')](_0x72e5('0x16'),auth['isAuthenticated'](),controller[_0x72e5('0x17')]);router[_0x72e5('0x18')]('/',auth[_0x72e5('0xa')](),controller[_0x72e5('0x19')]);router[_0x72e5('0x18')](_0x72e5('0x1a'),auth[_0x72e5('0xa')](),controller[_0x72e5('0x1b')]);var upload=multer({'storage':multer[_0x72e5('0x1c')]({'destination':function(_0x20e3c3,_0x440860,_0x1e00fe){_0x1e00fe(null,path[_0x72e5('0x1d')](config[_0x72e5('0x1e')],'server/files/attachments/'));},'filename':function(_0xef41ec,_0xeccd47,_0x2d783d){_0x2d783d(null,util[_0x72e5('0x1f')](_0x72e5('0x20'),Date['now'](),_0xeccd47[_0x72e5('0x21')][_0x72e5('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x72e5('0x18')](_0x72e5('0x23'),upload[_0x72e5('0x24')](_0x72e5('0x25')),controller[_0x72e5('0x26')]);router[_0x72e5('0x18')]('/:id/messages',auth[_0x72e5('0xe')](),controller[_0x72e5('0x27')]);router['post'](_0x72e5('0x28'),auth['isAuthenticated'](),interaction[_0x72e5('0x29')](_0x72e5('0x2a'),_0x72e5('0x2b')),controller[_0x72e5('0x2c')]);router[_0x72e5('0x2d')](_0x72e5('0xd'),auth['isAuthenticated'](),interaction[_0x72e5('0x29')](_0x72e5('0x2a'),'chatinteraction:update'),controller[_0x72e5('0x2e')]);router['put'](_0x72e5('0x2f'),controller[_0x72e5('0x30')]);router['put'](_0x72e5('0x31'),auth[_0x72e5('0xe')](),controller[_0x72e5('0x32')]);router[_0x72e5('0x2d')](_0x72e5('0x33'),controller[_0x72e5('0x34')]);router[_0x72e5('0x35')](_0x72e5('0xd'),auth['isAuthenticated'](),interaction[_0x72e5('0x29')](_0x72e5('0x2a'),_0x72e5('0x36')),controller[_0x72e5('0x37')]);router['delete'](_0x72e5('0x28'),auth[_0x72e5('0xa')](),controller['removeTags']);module[_0x72e5('0x38')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index b9f1378..223d10d 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 _0x2435=['BOOLEAN','INTEGER','TEXT','medium'];(function(_0x14a63a,_0x5a0ad1){var _0x1cc157=function(_0x136390){while(--_0x136390){_0x14a63a['push'](_0x14a63a['shift']());}};_0x1cc157(++_0x5a0ad1);}(_0x2435,0x146));var _0x5243=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0x2435[_0x20a558];return _0x53d3f7;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x5243('0x0')](_0x5243('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x5243('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x5243('0x3')]}};
\ No newline at end of file
+var _0x6611=['BOOLEAN','INTEGER'];(function(_0x4b6791,_0x390a9f){var _0x47de56=function(_0x4f3236){while(--_0x4f3236){_0x4b6791['push'](_0x4b6791['shift']());}};_0x47de56(++_0x390a9f);}(_0x6611,0x9e));var _0x1661=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6611[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x1661('0x0')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x1661('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index ccc8872..a161f93 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 _0xf038=['get','messages','lastMessageAt','createdAt','format','lastMessage','getUsers','User','agent','admin','fullname','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','type','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','length','push','user','FromId','ToId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./chatInternalMessage.socket','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','destroy','then','stack','name','send','index','map','ChatInternalMessage','rawAttributes','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','create','body','find','describe'];(function(_0x23b204,_0x4b773c){var _0x29ac3b=function(_0x26dedf){while(--_0x26dedf){_0x23b204['push'](_0x23b204['shift']());}};_0x29ac3b(++_0x4b773c);}(_0xf038,0x1ea));var _0x8f03=function(_0x12e3e3,_0x501eaf){_0x12e3e3=_0x12e3e3-0x0;var _0x26602e=_0xf038[_0x12e3e3];return _0x26602e;};'use strict';var emlformat=require(_0x8f03('0x0'));var rimraf=require(_0x8f03('0x1'));var zipdir=require(_0x8f03('0x2'));var jsonpatch=require(_0x8f03('0x3'));var rp=require(_0x8f03('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8f03('0x5'));var util=require(_0x8f03('0x6'));var path=require(_0x8f03('0x7'));var sox=require(_0x8f03('0x8'));var csv=require(_0x8f03('0x9'));var ejs=require(_0x8f03('0xa'));var fs=require('fs');var fs_extra=require(_0x8f03('0xb'));var _=require(_0x8f03('0xc'));var squel=require(_0x8f03('0xd'));var crypto=require(_0x8f03('0xe'));var jsforce=require(_0x8f03('0xf'));var deskjs=require(_0x8f03('0x10'));var toCsv=require(_0x8f03('0x9'));var querystring=require(_0x8f03('0x11'));var Papa=require('papaparse');var Redis=require(_0x8f03('0x12'));var authService=require(_0x8f03('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8f03('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8f03('0x15'))(_0x8f03('0x16'));var utils=require(_0x8f03('0x17'));var config=require(_0x8f03('0x18'));var licenseUtil=require(_0x8f03('0x19'));var db=require(_0x8f03('0x1a'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x8f03('0x1b'),'port':0x18eb});var socket=require(_0x8f03('0x1c'))(new Redis(config[_0x8f03('0x1d')]));require(_0x8f03('0x1e'))['register'](socket);function respondWithStatusCode(_0x5bdbf2,_0x44f3cb){_0x44f3cb=_0x44f3cb||0xcc;return function(_0x58b779){if(_0x58b779){return _0x5bdbf2[_0x8f03('0x1f')](_0x44f3cb);}return _0x5bdbf2[_0x8f03('0x20')](_0x44f3cb)[_0x8f03('0x21')]();};}function respondWithResult(_0x512ca9,_0x295d6){_0x295d6=_0x295d6||0xc8;return function(_0x3d2c7f){if(_0x3d2c7f){return _0x512ca9[_0x8f03('0x20')](_0x295d6)['json'](_0x3d2c7f);}};}function respondWithFilteredResult(_0xca857d,_0x295a48){return function(_0x330af9){if(_0x330af9){var _0xd11178=typeof _0x295a48[_0x8f03('0x22')]==='undefined'&&typeof _0x295a48['limit']===_0x8f03('0x23');var _0x474fdb=_0x330af9[_0x8f03('0x24')];var _0x5e368c=_0xd11178?0x0:_0x295a48[_0x8f03('0x22')];var _0x2738d5=_0xd11178?_0x330af9[_0x8f03('0x24')]:_0x295a48[_0x8f03('0x22')]+_0x295a48[_0x8f03('0x25')];var _0x14c714;if(_0x2738d5>=_0x474fdb){_0x2738d5=_0x474fdb;_0x14c714=0xc8;}else{_0x14c714=0xce;}_0xca857d[_0x8f03('0x20')](_0x14c714);return _0xca857d['set'](_0x8f03('0x26'),_0x5e368c+'-'+_0x2738d5+'/'+_0x474fdb)[_0x8f03('0x27')](_0x330af9);}return null;};}function patchUpdates(_0x5402bb){return function(_0xfc4058){try{jsonpatch[_0x8f03('0x28')](_0xfc4058,_0x5402bb,!![]);}catch(_0x49632f){return BPromise[_0x8f03('0x29')](_0x49632f);}return _0xfc4058[_0x8f03('0x2a')]();};}function saveUpdates(_0x580f02,_0x5b8919){return function(_0x37f537){if(_0x37f537){return _0x37f537[_0x8f03('0x2b')](_0x580f02)['then'](function(_0x385ce1){return _0x385ce1;});}return null;};}function removeEntity(_0xe11c87,_0x44b20d){return function(_0x49d176){if(_0x49d176){return _0x49d176[_0x8f03('0x2c')]()[_0x8f03('0x2d')](function(){_0xe11c87[_0x8f03('0x20')](0xcc)[_0x8f03('0x21')]();});}};}function handleEntityNotFound(_0x1f8071,_0x15d017){return function(_0x4f8b08){if(!_0x4f8b08){_0x1f8071['sendStatus'](0x194);}return _0x4f8b08;};}function handleError(_0x3907f8,_0x55c641){_0x55c641=_0x55c641||0x1f4;return function(_0xdcaa50){logger['error'](_0xdcaa50[_0x8f03('0x2e')]);if(_0xdcaa50[_0x8f03('0x2f')]){delete _0xdcaa50[_0x8f03('0x2f')];}_0x3907f8[_0x8f03('0x20')](_0x55c641)[_0x8f03('0x30')](_0xdcaa50);};}exports[_0x8f03('0x31')]=function(_0x525ee5,_0x3357f2){var _0x56bf55={},_0x562cb9={},_0x546482={'count':0x0,'rows':[]};var _0x49ec7f=_[_0x8f03('0x32')](db[_0x8f03('0x33')][_0x8f03('0x34')],function(_0x3ce409){return{'name':_0x3ce409['fieldName'],'type':_0x3ce409['type']['key']};});_0x562cb9[_0x8f03('0x35')]=_[_0x8f03('0x32')](_0x49ec7f,_0x8f03('0x2f'));_0x562cb9['query']=_['keys'](_0x525ee5[_0x8f03('0x36')]);_0x562cb9[_0x8f03('0x37')]=_['intersection'](_0x562cb9[_0x8f03('0x35')],_0x562cb9[_0x8f03('0x36')]);_0x56bf55[_0x8f03('0x38')]=_[_0x8f03('0x39')](_0x562cb9[_0x8f03('0x35')],qs[_0x8f03('0x3a')](_0x525ee5[_0x8f03('0x36')][_0x8f03('0x3a')]));_0x56bf55['attributes']=_0x56bf55[_0x8f03('0x38')]['length']?_0x56bf55[_0x8f03('0x38')]:_0x562cb9[_0x8f03('0x35')];if(!_0x525ee5[_0x8f03('0x36')][_0x8f03('0x3b')](_0x8f03('0x3c'))){_0x56bf55['limit']=qs[_0x8f03('0x25')](_0x525ee5[_0x8f03('0x36')]['limit']);_0x56bf55[_0x8f03('0x22')]=qs[_0x8f03('0x22')](_0x525ee5[_0x8f03('0x36')]['offset']);}_0x56bf55[_0x8f03('0x3d')]=qs['sort'](_0x525ee5[_0x8f03('0x36')][_0x8f03('0x3e')]);_0x56bf55[_0x8f03('0x3f')]=qs['filters'](_[_0x8f03('0x40')](_0x525ee5[_0x8f03('0x36')],_0x562cb9[_0x8f03('0x37')]),_0x49ec7f);if(_0x525ee5[_0x8f03('0x36')][_0x8f03('0x41')]){_0x56bf55['where']=_[_0x8f03('0x42')](_0x56bf55['where'],{'$or':_[_0x8f03('0x32')](_0x49ec7f,function(_0x395873){if(_0x395873['type']!=='VIRTUAL'){var _0x14ad0f={};_0x14ad0f[_0x395873[_0x8f03('0x2f')]]={'$like':'%'+_0x525ee5[_0x8f03('0x36')][_0x8f03('0x41')]+'%'};return _0x14ad0f;}})});}_0x56bf55=_[_0x8f03('0x42')]({},_0x56bf55,_0x525ee5['options']);var _0x4825cf={'where':_0x56bf55[_0x8f03('0x3f')]};return db[_0x8f03('0x33')][_0x8f03('0x24')](_0x4825cf)['then'](function(_0x268498){_0x546482[_0x8f03('0x24')]=_0x268498;if(_0x525ee5[_0x8f03('0x36')][_0x8f03('0x43')]){_0x56bf55[_0x8f03('0x44')]=[{'all':!![]}];}return db[_0x8f03('0x33')][_0x8f03('0x45')](_0x56bf55);})['then'](function(_0x2a44ea){_0x546482[_0x8f03('0x46')]=_0x2a44ea;return _0x546482;})[_0x8f03('0x2d')](respondWithFilteredResult(_0x3357f2,_0x56bf55))[_0x8f03('0x47')](handleError(_0x3357f2,null));};exports[_0x8f03('0x48')]=function(_0xcdef67,_0x5eb5cb){var _0x3fb31e={'raw':!![],'where':{'id':_0xcdef67[_0x8f03('0x49')]['id']}},_0x75adeb={};_0x75adeb[_0x8f03('0x35')]=_[_0x8f03('0x4a')](db[_0x8f03('0x33')][_0x8f03('0x34')]);_0x75adeb[_0x8f03('0x36')]=_[_0x8f03('0x4a')](_0xcdef67['query']);_0x75adeb['filters']=_['intersection'](_0x75adeb[_0x8f03('0x35')],_0x75adeb['query']);_0x3fb31e['attributes']=_['intersection'](_0x75adeb[_0x8f03('0x35')],qs[_0x8f03('0x3a')](_0xcdef67[_0x8f03('0x36')][_0x8f03('0x3a')]));_0x3fb31e[_0x8f03('0x38')]=_0x3fb31e[_0x8f03('0x38')]['length']?_0x3fb31e[_0x8f03('0x38')]:_0x75adeb[_0x8f03('0x35')];if(_0xcdef67[_0x8f03('0x36')][_0x8f03('0x43')]){_0x3fb31e[_0x8f03('0x44')]=[{'all':!![]}];}_0x3fb31e=_['merge']({},_0x3fb31e,_0xcdef67[_0x8f03('0x4b')]);return db[_0x8f03('0x33')]['find'](_0x3fb31e)[_0x8f03('0x2d')](handleEntityNotFound(_0x5eb5cb,null))['then'](respondWithResult(_0x5eb5cb,null))[_0x8f03('0x47')](handleError(_0x5eb5cb,null));};exports[_0x8f03('0x4c')]=function(_0x1f58e0,_0x4cc274){return db['ChatInternalMessage']['create'](_0x1f58e0[_0x8f03('0x4d')],{})[_0x8f03('0x2d')](respondWithResult(_0x4cc274,0xc9))[_0x8f03('0x47')](handleError(_0x4cc274,null));};exports[_0x8f03('0x2b')]=function(_0x368dde,_0x5aa2e0){if(_0x368dde[_0x8f03('0x4d')]['id']){delete _0x368dde[_0x8f03('0x4d')]['id'];}return db[_0x8f03('0x33')][_0x8f03('0x4e')]({'where':{'id':_0x368dde['params']['id']}})['then'](handleEntityNotFound(_0x5aa2e0,null))[_0x8f03('0x2d')](saveUpdates(_0x368dde[_0x8f03('0x4d')],null))['then'](respondWithResult(_0x5aa2e0,null))[_0x8f03('0x47')](handleError(_0x5aa2e0,null));};exports[_0x8f03('0x2c')]=function(_0x2bad2c,_0x3a9d72){return db[_0x8f03('0x33')][_0x8f03('0x4e')]({'where':{'id':_0x2bad2c['params']['id']}})[_0x8f03('0x2d')](handleEntityNotFound(_0x3a9d72,null))[_0x8f03('0x2d')](removeEntity(_0x3a9d72,null))[_0x8f03('0x47')](handleError(_0x3a9d72,null));};exports[_0x8f03('0x4f')]=function(_0x254ef0,_0x1473a5){return db['ChatInternalMessage'][_0x8f03('0x4f')]()[_0x8f03('0x2d')](respondWithResult(_0x1473a5,null))[_0x8f03('0x47')](handleError(_0x1473a5,null));};function wrapUser(_0x2c3d18){return function(_0xe298a5){var _0xe75147=_0x2c3d18[_0x8f03('0x50')]({'plain':!![]});_0xe75147[_0x8f03('0x51')]=[];if(_0xe298a5){_0xe75147[_0x8f03('0x52')]=_0xe298a5[_0x8f03('0x53')];_0xe75147['lastMessage']=_0xe298a5;}else{_0xe75147[_0x8f03('0x52')]=moment(0x0)[_0x8f03('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0xe75147[_0x8f03('0x55')]={};}return _0xe75147;};}exports[_0x8f03('0x56')]=function(_0x2fb0ea,_0x2b61ea,_0x40a581){var _0x17a829=[];return db[_0x8f03('0x57')]['findAll']({'where':{'role':[_0x8f03('0x58'),_0x8f03('0x59'),'user']},'attributes':['id',_0x8f03('0x5a'),'name','role',_0x8f03('0x5b'),_0x8f03('0x5c'),_0x8f03('0x5d'),_0x8f03('0x5e'),_0x8f03('0x5f'),_0x8f03('0x60')],'order':qs[_0x8f03('0x3e')](_0x8f03('0x61')),'include':[{'model':db['VoiceQueue'],'as':_0x8f03('0x62'),'attributes':['id',_0x8f03('0x2f'),_0x8f03('0x63')],'through':{'attributes':[]}}]})[_0x8f03('0x2d')](function(_0xaac356){if(_0xaac356){var _0x11d991=_0x2fb0ea['user'][_0x8f03('0x50')]({'plain':!![]});if(!_0x11d991)throw new Error(_0x8f03('0x64'));if(_0x11d991[_0x8f03('0x65')]==='user'){return db[_0x8f03('0x66')][_0x8f03('0x4e')]({'where':{'name':'Agents','userProfileId':_0x11d991[_0x8f03('0x67')]},'raw':!![]})[_0x8f03('0x2d')](function(_0x5b68f7){if(_0x5b68f7){if(_0x5b68f7[_0x8f03('0x68')]===0x0){return db[_0x8f03('0x69')][_0x8f03('0x45')]({'where':{'sectionId':_0x5b68f7['id']},'raw':!![]})['then'](function(_0x2afc0f){var _0x43b0fa=[];if(_[_0x8f03('0x6a')](_0x2afc0f)){_0x43b0fa=_[_0x8f03('0x41')](_0xaac356,function(_0x54bbbe){if(_0x54bbbe['role']!==_0x8f03('0x58')){return _0x54bbbe;}});return _0x43b0fa;}else{for(var _0x42fb2=0x0;_0x42fb2<_0xaac356[_0x8f03('0x6b')];_0x42fb2++){var _0xdfb7c6=_0xaac356[_0x42fb2];if(_0xdfb7c6[_0x8f03('0x65')]===_0x8f03('0x58')){var _0x2e4dc7=_[_0x8f03('0x4e')](_0x2afc0f,function(_0x14fc38){return _0x14fc38['resourceId']===_0xdfb7c6['id'];});if(_0x2e4dc7)_0x43b0fa[_0x8f03('0x6c')](_0xdfb7c6);}else{_0x43b0fa[_0x8f03('0x6c')](_0xdfb7c6);}}return _0x43b0fa;}});}else{return _0xaac356;}}else{var _0x202322=_[_0x8f03('0x41')](_0xaac356,function(_0x4a9833){if(_0x4a9833['role']!==_0x8f03('0x58')){return _0x4a9833;}});return _0x202322;}});}else{return _0xaac356;}}})[_0x8f03('0x2d')](function(_0x4e4947){var _0x20845e=[];if(_0x4e4947){_0x17a829=_0x4e4947;for(var _0x38d747=0x0;_0x38d747<_0x4e4947['length'];_0x38d747+=0x1){_0x17a829[_0x38d747][_0x8f03('0x51')]=[];_0x20845e[_0x8f03('0x6c')](db[_0x8f03('0x33')]['find']({'where':{'FromId':[_0x2fb0ea[_0x8f03('0x6d')]['id'],_0x4e4947[_0x38d747]['id']],'ToId':[_0x2fb0ea[_0x8f03('0x6d')]['id'],_0x4e4947[_0x38d747]['id']],'ChatGroupId':null},'attributes':['id',_0x8f03('0x53'),_0x8f03('0x6e'),_0x8f03('0x6f'),'read','body'],'order':qs[_0x8f03('0x3e')](_0x8f03('0x70')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x8f03('0x2d')](wrapUser(_0x4e4947[_0x38d747])));}return BPromise[_0x8f03('0x71')](_0x20845e);}return[];})[_0x8f03('0x2d')](function(_0xc87025){return{'rows':_0xc87025,'count':_0xc87025[_0x8f03('0x6b')]};})[_0x8f03('0x2d')](respondWithResult(_0x2b61ea,null))[_0x8f03('0x47')](handleError(_0x2b61ea,null));};
\ No newline at end of file
+var _0x7aa8=['key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','ChatInternalMessage','includeAll','findAll','rows','params','include','find','catch','create','body','describe','get','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','user','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','isEmpty','length','push','messages','FromId','ToId','read','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','redis','./chatInternalMessage.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type'];(function(_0x1c8e15,_0x288b5e){var _0x336251=function(_0x349808){while(--_0x349808){_0x1c8e15['push'](_0x1c8e15['shift']());}};_0x336251(++_0x288b5e);}(_0x7aa8,0xa9));var _0x87aa=function(_0x3f850e,_0x388709){_0x3f850e=_0x3f850e-0x0;var _0x3958f4=_0x7aa8[_0x3f850e];return _0x3958f4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x87aa('0x0'));var zipdir=require(_0x87aa('0x1'));var jsonpatch=require(_0x87aa('0x2'));var rp=require(_0x87aa('0x3'));var moment=require(_0x87aa('0x4'));var BPromise=require(_0x87aa('0x5'));var Mustache=require(_0x87aa('0x6'));var util=require(_0x87aa('0x7'));var path=require(_0x87aa('0x8'));var sox=require(_0x87aa('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x87aa('0xa'));var _=require(_0x87aa('0xb'));var squel=require(_0x87aa('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x87aa('0xd'));var toCsv=require(_0x87aa('0xe'));var querystring=require('querystring');var Papa=require(_0x87aa('0xf'));var Redis=require(_0x87aa('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x87aa('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x87aa('0x12'))(_0x87aa('0x13'));var utils=require(_0x87aa('0x14'));var config=require(_0x87aa('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x87aa('0x16'))['db'];config['redis']=_[_0x87aa('0x17')](config['redis'],{'host':_0x87aa('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x87aa('0x19')]));require(_0x87aa('0x1a'))[_0x87aa('0x1b')](socket);function respondWithStatusCode(_0x1f8c08,_0x59d2fb){_0x59d2fb=_0x59d2fb||0xcc;return function(_0x34d17d){if(_0x34d17d){return _0x1f8c08[_0x87aa('0x1c')](_0x59d2fb);}return _0x1f8c08[_0x87aa('0x1d')](_0x59d2fb)[_0x87aa('0x1e')]();};}function respondWithResult(_0x4ad68a,_0x4fb0c9){_0x4fb0c9=_0x4fb0c9||0xc8;return function(_0x1213ab){if(_0x1213ab){return _0x4ad68a[_0x87aa('0x1d')](_0x4fb0c9)[_0x87aa('0x1f')](_0x1213ab);}};}function respondWithFilteredResult(_0x28e36f,_0x29ec50){return function(_0x4616b4){if(_0x4616b4){var _0x1b843d=typeof _0x29ec50['offset']==='undefined'&&typeof _0x29ec50['limit']===_0x87aa('0x20');var _0x4b0b4a=_0x4616b4[_0x87aa('0x21')];var _0x5da8f4=_0x1b843d?0x0:_0x29ec50['offset'];var _0x5ab5e2=_0x1b843d?_0x4616b4[_0x87aa('0x21')]:_0x29ec50[_0x87aa('0x22')]+_0x29ec50[_0x87aa('0x23')];var _0x5a5f91;if(_0x5ab5e2>=_0x4b0b4a){_0x5ab5e2=_0x4b0b4a;_0x5a5f91=0xc8;}else{_0x5a5f91=0xce;}_0x28e36f[_0x87aa('0x1d')](_0x5a5f91);return _0x28e36f['set'](_0x87aa('0x24'),_0x5da8f4+'-'+_0x5ab5e2+'/'+_0x4b0b4a)[_0x87aa('0x1f')](_0x4616b4);}return null;};}function patchUpdates(_0x29fbdd){return function(_0x75657d){try{jsonpatch[_0x87aa('0x25')](_0x75657d,_0x29fbdd,!![]);}catch(_0x53fb3a){return BPromise[_0x87aa('0x26')](_0x53fb3a);}return _0x75657d[_0x87aa('0x27')]();};}function saveUpdates(_0x32ac69,_0x5b9384){return function(_0x43e236){if(_0x43e236){return _0x43e236[_0x87aa('0x28')](_0x32ac69)[_0x87aa('0x29')](function(_0x305a20){return _0x305a20;});}return null;};}function removeEntity(_0x564a53,_0x2b8061){return function(_0x5b638f){if(_0x5b638f){return _0x5b638f[_0x87aa('0x2a')]()['then'](function(){_0x564a53['status'](0xcc)[_0x87aa('0x1e')]();});}};}function handleEntityNotFound(_0xf79a08,_0x1e6ab6){return function(_0x364a18){if(!_0x364a18){_0xf79a08[_0x87aa('0x1c')](0x194);}return _0x364a18;};}function handleError(_0x591591,_0x111682){_0x111682=_0x111682||0x1f4;return function(_0x237a0b){logger[_0x87aa('0x2b')](_0x237a0b['stack']);if(_0x237a0b[_0x87aa('0x2c')]){delete _0x237a0b['name'];}_0x591591[_0x87aa('0x1d')](_0x111682)[_0x87aa('0x2d')](_0x237a0b);};}exports[_0x87aa('0x2e')]=function(_0x3f8b3c,_0x59c029){var _0xf2d221={},_0x94fd44={},_0x4af1ed={'count':0x0,'rows':[]};var _0x23f20e=_[_0x87aa('0x2f')](db['ChatInternalMessage'][_0x87aa('0x30')],function(_0x58dad5){return{'name':_0x58dad5[_0x87aa('0x31')],'type':_0x58dad5[_0x87aa('0x32')][_0x87aa('0x33')]};});_0x94fd44[_0x87aa('0x34')]=_[_0x87aa('0x2f')](_0x23f20e,_0x87aa('0x2c'));_0x94fd44[_0x87aa('0x35')]=_[_0x87aa('0x36')](_0x3f8b3c['query']);_0x94fd44['filters']=_[_0x87aa('0x37')](_0x94fd44[_0x87aa('0x34')],_0x94fd44['query']);_0xf2d221[_0x87aa('0x38')]=_[_0x87aa('0x37')](_0x94fd44['model'],qs[_0x87aa('0x39')](_0x3f8b3c[_0x87aa('0x35')]['fields']));_0xf2d221[_0x87aa('0x38')]=_0xf2d221[_0x87aa('0x38')]['length']?_0xf2d221[_0x87aa('0x38')]:_0x94fd44[_0x87aa('0x34')];if(!_0x3f8b3c[_0x87aa('0x35')][_0x87aa('0x3a')](_0x87aa('0x3b'))){_0xf2d221[_0x87aa('0x23')]=qs[_0x87aa('0x23')](_0x3f8b3c[_0x87aa('0x35')][_0x87aa('0x23')]);_0xf2d221[_0x87aa('0x22')]=qs['offset'](_0x3f8b3c['query'][_0x87aa('0x22')]);}_0xf2d221['order']=qs['sort'](_0x3f8b3c[_0x87aa('0x35')][_0x87aa('0x3c')]);_0xf2d221[_0x87aa('0x3d')]=qs[_0x87aa('0x3e')](_[_0x87aa('0x3f')](_0x3f8b3c[_0x87aa('0x35')],_0x94fd44[_0x87aa('0x3e')]),_0x23f20e);if(_0x3f8b3c['query'][_0x87aa('0x40')]){_0xf2d221[_0x87aa('0x3d')]=_['merge'](_0xf2d221[_0x87aa('0x3d')],{'$or':_[_0x87aa('0x2f')](_0x23f20e,function(_0x3c2d6a){if(_0x3c2d6a[_0x87aa('0x32')]!==_0x87aa('0x41')){var _0x518a20={};_0x518a20[_0x3c2d6a[_0x87aa('0x2c')]]={'$like':'%'+_0x3f8b3c[_0x87aa('0x35')][_0x87aa('0x40')]+'%'};return _0x518a20;}})});}_0xf2d221=_[_0x87aa('0x42')]({},_0xf2d221,_0x3f8b3c[_0x87aa('0x43')]);var _0x5568ad={'where':_0xf2d221['where']};return db[_0x87aa('0x44')][_0x87aa('0x21')](_0x5568ad)['then'](function(_0x34b7a8){_0x4af1ed[_0x87aa('0x21')]=_0x34b7a8;if(_0x3f8b3c['query'][_0x87aa('0x45')]){_0xf2d221['include']=[{'all':!![]}];}return db['ChatInternalMessage'][_0x87aa('0x46')](_0xf2d221);})[_0x87aa('0x29')](function(_0x29f17f){_0x4af1ed[_0x87aa('0x47')]=_0x29f17f;return _0x4af1ed;})['then'](respondWithFilteredResult(_0x59c029,_0xf2d221))['catch'](handleError(_0x59c029,null));};exports['show']=function(_0x397a21,_0x402b5e){var _0x46dc97={'raw':!![],'where':{'id':_0x397a21[_0x87aa('0x48')]['id']}},_0x2f98c9={};_0x2f98c9[_0x87aa('0x34')]=_[_0x87aa('0x36')](db['ChatInternalMessage'][_0x87aa('0x30')]);_0x2f98c9[_0x87aa('0x35')]=_[_0x87aa('0x36')](_0x397a21[_0x87aa('0x35')]);_0x2f98c9[_0x87aa('0x3e')]=_[_0x87aa('0x37')](_0x2f98c9[_0x87aa('0x34')],_0x2f98c9['query']);_0x46dc97[_0x87aa('0x38')]=_[_0x87aa('0x37')](_0x2f98c9[_0x87aa('0x34')],qs[_0x87aa('0x39')](_0x397a21[_0x87aa('0x35')]['fields']));_0x46dc97[_0x87aa('0x38')]=_0x46dc97[_0x87aa('0x38')]['length']?_0x46dc97['attributes']:_0x2f98c9[_0x87aa('0x34')];if(_0x397a21[_0x87aa('0x35')][_0x87aa('0x45')]){_0x46dc97[_0x87aa('0x49')]=[{'all':!![]}];}_0x46dc97=_[_0x87aa('0x42')]({},_0x46dc97,_0x397a21[_0x87aa('0x43')]);return db['ChatInternalMessage'][_0x87aa('0x4a')](_0x46dc97)[_0x87aa('0x29')](handleEntityNotFound(_0x402b5e,null))['then'](respondWithResult(_0x402b5e,null))[_0x87aa('0x4b')](handleError(_0x402b5e,null));};exports[_0x87aa('0x4c')]=function(_0x5dc522,_0x376c4f){return db[_0x87aa('0x44')][_0x87aa('0x4c')](_0x5dc522['body'],{})['then'](respondWithResult(_0x376c4f,0xc9))[_0x87aa('0x4b')](handleError(_0x376c4f,null));};exports[_0x87aa('0x28')]=function(_0x2b1eed,_0x758819){if(_0x2b1eed[_0x87aa('0x4d')]['id']){delete _0x2b1eed[_0x87aa('0x4d')]['id'];}return db[_0x87aa('0x44')][_0x87aa('0x4a')]({'where':{'id':_0x2b1eed[_0x87aa('0x48')]['id']}})[_0x87aa('0x29')](handleEntityNotFound(_0x758819,null))[_0x87aa('0x29')](saveUpdates(_0x2b1eed[_0x87aa('0x4d')],null))[_0x87aa('0x29')](respondWithResult(_0x758819,null))['catch'](handleError(_0x758819,null));};exports['destroy']=function(_0xa71b11,_0x2d782b){return db['ChatInternalMessage'][_0x87aa('0x4a')]({'where':{'id':_0xa71b11[_0x87aa('0x48')]['id']}})['then'](handleEntityNotFound(_0x2d782b,null))[_0x87aa('0x29')](removeEntity(_0x2d782b,null))['catch'](handleError(_0x2d782b,null));};exports[_0x87aa('0x4e')]=function(_0x269a38,_0xc4c6a5){return db[_0x87aa('0x44')][_0x87aa('0x4e')]()[_0x87aa('0x29')](respondWithResult(_0xc4c6a5,null))['catch'](handleError(_0xc4c6a5,null));};function wrapUser(_0x21de28){return function(_0x3c7eb9){var _0x1f1984=_0x21de28[_0x87aa('0x4f')]({'plain':!![]});_0x1f1984['messages']=[];if(_0x3c7eb9){_0x1f1984['lastMessageAt']=_0x3c7eb9[_0x87aa('0x50')];_0x1f1984[_0x87aa('0x51')]=_0x3c7eb9;}else{_0x1f1984[_0x87aa('0x52')]=moment(0x0)[_0x87aa('0x53')](_0x87aa('0x54'));_0x1f1984[_0x87aa('0x51')]={};}return _0x1f1984;};}exports[_0x87aa('0x55')]=function(_0x438394,_0x30d23b,_0x37838c){var _0x4a00da=[];return db[_0x87aa('0x56')][_0x87aa('0x46')]({'where':{'role':[_0x87aa('0x57'),'admin',_0x87aa('0x58')]},'attributes':['id','fullname',_0x87aa('0x2c'),'role',_0x87aa('0x59'),_0x87aa('0x5a'),_0x87aa('0x5b'),_0x87aa('0x5c'),_0x87aa('0x5d'),_0x87aa('0x5e')],'order':qs['sort']('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x87aa('0x5f'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0x87aa('0x29')](function(_0x4246be){if(_0x4246be){var _0x4607be=_0x438394[_0x87aa('0x58')]['get']({'plain':!![]});if(!_0x4607be)throw new Error(_0x87aa('0x60'));if(_0x4607be[_0x87aa('0x61')]===_0x87aa('0x58')){return db[_0x87aa('0x62')][_0x87aa('0x4a')]({'where':{'name':'Agents','userProfileId':_0x4607be[_0x87aa('0x63')]},'raw':!![]})[_0x87aa('0x29')](function(_0x1c93de){if(_0x1c93de){if(_0x1c93de['autoAssociation']===0x0){return db[_0x87aa('0x64')][_0x87aa('0x46')]({'where':{'sectionId':_0x1c93de['id']},'raw':!![]})['then'](function(_0x3bdddc){var _0x4f079a=[];if(_[_0x87aa('0x65')](_0x3bdddc)){_0x4f079a=_[_0x87aa('0x40')](_0x4246be,function(_0x3b883e){if(_0x3b883e[_0x87aa('0x61')]!=='agent'){return _0x3b883e;}});return _0x4f079a;}else{for(var _0x2689b1=0x0;_0x2689b1<_0x4246be[_0x87aa('0x66')];_0x2689b1++){var _0x36836f=_0x4246be[_0x2689b1];if(_0x36836f[_0x87aa('0x61')]===_0x87aa('0x57')){var _0x4fdc5f=_['find'](_0x3bdddc,function(_0x212535){return _0x212535['resourceId']===_0x36836f['id'];});if(_0x4fdc5f)_0x4f079a[_0x87aa('0x67')](_0x36836f);}else{_0x4f079a[_0x87aa('0x67')](_0x36836f);}}return _0x4f079a;}});}else{return _0x4246be;}}else{var _0x42356f=_[_0x87aa('0x40')](_0x4246be,function(_0xbca36){if(_0xbca36[_0x87aa('0x61')]!==_0x87aa('0x57')){return _0xbca36;}});return _0x42356f;}});}else{return _0x4246be;}}})['then'](function(_0x2a297e){var _0x34b1c0=[];if(_0x2a297e){_0x4a00da=_0x2a297e;for(var _0x3ade28=0x0;_0x3ade28<_0x2a297e[_0x87aa('0x66')];_0x3ade28+=0x1){_0x4a00da[_0x3ade28][_0x87aa('0x68')]=[];_0x34b1c0[_0x87aa('0x67')](db[_0x87aa('0x44')][_0x87aa('0x4a')]({'where':{'FromId':[_0x438394[_0x87aa('0x58')]['id'],_0x2a297e[_0x3ade28]['id']],'ToId':[_0x438394[_0x87aa('0x58')]['id'],_0x2a297e[_0x3ade28]['id']],'ChatGroupId':null},'attributes':['id',_0x87aa('0x50'),_0x87aa('0x69'),_0x87aa('0x6a'),_0x87aa('0x6b'),_0x87aa('0x4d')],'order':qs[_0x87aa('0x3c')](_0x87aa('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x2a297e[_0x3ade28])));}return BPromise[_0x87aa('0x6d')](_0x34b1c0);}return[];})[_0x87aa('0x29')](function(_0x5c31b4){return{'rows':_0x5c31b4,'count':_0x5c31b4[_0x87aa('0x66')]};})[_0x87aa('0x29')](respondWithResult(_0x30d23b,null))[_0x87aa('0x4b')](handleError(_0x30d23b,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 4e29dd7..4295755 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 _0x943a=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','save','update'];(function(_0x337748,_0x402b05){var _0x3bb03f=function(_0x2fcdf4){while(--_0x2fcdf4){_0x337748['push'](_0x337748['shift']());}};_0x3bb03f(++_0x402b05);}(_0x943a,0x84));var _0xa943=function(_0x4baac8,_0x5f1dc7){_0x4baac8=_0x4baac8-0x0;var _0x56ebc5=_0x943a[_0x4baac8];return _0x56ebc5;};'use strict';var EventEmitter=require(_0xa943('0x0'));var ChatInternalMessage=require(_0xa943('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa943('0x2'),'afterUpdate':_0xa943('0x3'),'afterDestroy':_0xa943('0x4')};function emitEvent(_0x47a2cb){return function(_0x56f1fd,_0x186955,_0x2bbb60){ChatInternalMessageEvents[_0xa943('0x5')](_0x47a2cb+':'+_0x56f1fd['id'],_0x56f1fd);ChatInternalMessageEvents[_0xa943('0x5')](_0x47a2cb,_0x56f1fd);_0x2bbb60(null);};}for(var e in events){if(events[_0xa943('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xa943('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x49a1=['hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','emit'];(function(_0x8b1425,_0x57171c){var _0x416663=function(_0x1ea508){while(--_0x1ea508){_0x8b1425['push'](_0x8b1425['shift']());}};_0x416663(++_0x57171c);}(_0x49a1,0x190));var _0x149a=function(_0x29aa0c,_0x46d2e9){_0x29aa0c=_0x29aa0c-0x0;var _0x491a1d=_0x49a1[_0x29aa0c];return _0x491a1d;};'use strict';var EventEmitter=require(_0x149a('0x0'));var ChatInternalMessage=require(_0x149a('0x1'))['db'][_0x149a('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x149a('0x3')](0x0);var events={'afterCreate':_0x149a('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x49a483){return function(_0x3f7895,_0x13623b,_0x51b039){ChatInternalMessageEvents[_0x149a('0x5')](_0x49a483+':'+_0x3f7895['id'],_0x3f7895);ChatInternalMessageEvents[_0x149a('0x5')](_0x49a483,_0x3f7895);_0x51b039(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x149a('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 0b48223..d97df86 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 _0x4f54=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x1301df,_0x58d8ff){var _0x26c233=function(_0x42c800){while(--_0x42c800){_0x1301df['push'](_0x1301df['shift']());}};_0x26c233(++_0x58d8ff);}(_0x4f54,0x1c6));var _0x44f5=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x4f54[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x44f5('0x0'));var util=require('util');var logger=require(_0x44f5('0x1'))(_0x44f5('0x2'));var moment=require(_0x44f5('0x3'));var BPromise=require(_0x44f5('0x4'));var rp=require(_0x44f5('0x5'));var fs=require('fs');var path=require(_0x44f5('0x6'));var rimraf=require(_0x44f5('0x7'));var config=require('../../config/environment');var attributes=require(_0x44f5('0x8'));module['exports']=function(_0xee464d,_0x191305){return _0xee464d['define'](_0x44f5('0x9'),attributes,{'tableName':_0x44f5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x44f5('0xb'),'collate':_0x44f5('0xc')});};
\ No newline at end of file
+var _0x28b7=['exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x28b7,0x17c));var _0x728b=function(_0x285c76,_0x12ea80){_0x285c76=_0x285c76-0x0;var _0x5ced11=_0x28b7[_0x285c76];return _0x5ced11;};'use strict';var _=require(_0x728b('0x0'));var util=require(_0x728b('0x1'));var logger=require(_0x728b('0x2'))(_0x728b('0x3'));var moment=require(_0x728b('0x4'));var BPromise=require(_0x728b('0x5'));var rp=require(_0x728b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x728b('0x7'));var config=require(_0x728b('0x8'));var attributes=require(_0x728b('0x9'));module[_0x728b('0xa')]=function(_0x2101d5,_0x44b8e4){return _0x2101d5[_0x728b('0xb')](_0x728b('0xc'),attributes,{'tableName':_0x728b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x728b('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index f5ad55c..3cc3de6 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 _0x934a=['./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x934a,0x127));var _0xa934=function(_0x2714ec,_0x36daa4){_0x2714ec=_0x2714ec-0x0;var _0x2608e5=_0x934a[_0x2714ec];return _0x2608e5;};'use strict';var _=require(_0xa934('0x0'));var util=require('util');var moment=require(_0xa934('0x1'));var BPromise=require(_0xa934('0x2'));var rs=require(_0xa934('0x3'));var fs=require('fs');var Redis=require(_0xa934('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa934('0x5'));var logger=require(_0xa934('0x6'))(_0xa934('0x7'));var config=require(_0xa934('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa934('0x9')][_0xa934('0xa')]({'port':0x232a});config[_0xa934('0xb')]=_['defaults'](config[_0xa934('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xa934('0xc'))(new Redis(config[_0xa934('0xb')]));require(_0xa934('0xd'))[_0xa934('0xe')](socket);function respondWithRpcPromise(_0x17372b,_0x3d3774,_0x27e438){return new BPromise(function(_0x31c980,_0x116e97){return client[_0xa934('0xf')](_0x17372b,_0x27e438)[_0xa934('0x10')](function(_0xd58e8c){logger[_0xa934('0x11')](_0xa934('0x12'),_0x3d3774,'request\x20sent');logger[_0xa934('0x13')](_0xa934('0x14'),_0x3d3774,'request\x20sent',JSON[_0xa934('0x15')](_0xd58e8c));if(_0xd58e8c['error']){if(_0xd58e8c['error'][_0xa934('0x16')]===0x1f4){logger[_0xa934('0x17')](_0xa934('0x12'),_0x3d3774,_0xd58e8c[_0xa934('0x17')][_0xa934('0x18')]);return _0x116e97(_0xd58e8c[_0xa934('0x17')][_0xa934('0x18')]);}logger[_0xa934('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x3d3774,_0xd58e8c['error'][_0xa934('0x18')]);return _0x31c980(_0xd58e8c['error'][_0xa934('0x18')]);}else{logger[_0xa934('0x11')](_0xa934('0x12'),_0x3d3774,_0xa934('0x19'));_0x31c980(_0xd58e8c[_0xa934('0x1a')][_0xa934('0x18')]);}})[_0xa934('0x1b')](function(_0x2c13ff){logger[_0xa934('0x17')](_0xa934('0x12'),_0x3d3774,_0x2c13ff);_0x116e97(_0x2c13ff);});});}
\ No newline at end of file
+var _0xf101=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','util','moment','bluebird','randomstring'];(function(_0x34fc32,_0x1b372f){var _0x567758=function(_0x54ca0f){while(--_0x54ca0f){_0x34fc32['push'](_0x34fc32['shift']());}};_0x567758(++_0x1b372f);}(_0xf101,0x141));var _0x1f10=function(_0xab2afb,_0x546bfb){_0xab2afb=_0xab2afb-0x0;var _0x25262b=_0xf101[_0xab2afb];return _0x25262b;};'use strict';var _=require('lodash');var util=require(_0x1f10('0x0'));var moment=require(_0x1f10('0x1'));var BPromise=require(_0x1f10('0x2'));var rs=require(_0x1f10('0x3'));var fs=require('fs');var Redis=require(_0x1f10('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1f10('0x5'))(_0x1f10('0x6'));var config=require(_0x1f10('0x7'));var jayson=require(_0x1f10('0x8'));var client=jayson[_0x1f10('0x9')]['http']({'port':0x232a});config['redis']=_[_0x1f10('0xa')](config[_0x1f10('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1f10('0xc'))(new Redis(config[_0x1f10('0xb')]));require(_0x1f10('0xd'))[_0x1f10('0xe')](socket);function respondWithRpcPromise(_0x4c3e55,_0x2fb802,_0x33a239){return new BPromise(function(_0x5bee7e,_0x4d2183){return client[_0x1f10('0xf')](_0x4c3e55,_0x33a239)[_0x1f10('0x10')](function(_0x43cdb9){logger['info'](_0x1f10('0x11'),_0x2fb802,'request\x20sent');logger[_0x1f10('0x12')](_0x1f10('0x13'),_0x2fb802,_0x1f10('0x14'),JSON['stringify'](_0x43cdb9));if(_0x43cdb9['error']){if(_0x43cdb9[_0x1f10('0x15')][_0x1f10('0x16')]===0x1f4){logger[_0x1f10('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x2fb802,_0x43cdb9['error'][_0x1f10('0x17')]);return _0x4d2183(_0x43cdb9[_0x1f10('0x15')]['message']);}logger[_0x1f10('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x2fb802,_0x43cdb9['error']['message']);return _0x5bee7e(_0x43cdb9[_0x1f10('0x15')][_0x1f10('0x17')]);}else{logger[_0x1f10('0x18')](_0x1f10('0x11'),_0x2fb802,_0x1f10('0x14'));_0x5bee7e(_0x43cdb9['result']['message']);}})['catch'](function(_0x15a2f8){logger[_0x1f10('0x15')](_0x1f10('0x11'),_0x2fb802,_0x15a2f8);_0x4d2183(_0x15a2f8);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 88734fc..dc22198 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 _0xd378=['update','emit','removeListener','register','remove'];(function(_0x1034ee,_0x12998c){var _0x2922af=function(_0x13715a){while(--_0x13715a){_0x1034ee['push'](_0x1034ee['shift']());}};_0x2922af(++_0x12998c);}(_0xd378,0x1d0));var _0x8d37=function(_0x547b1c,_0xae1569){_0x547b1c=_0x547b1c-0x0;var _0x13defa=_0xd378[_0x547b1c];return _0x13defa;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save',_0x8d37('0x0'),_0x8d37('0x1')];function createListener(_0x3c77bc,_0x6426e7){return function(_0x39ed33){_0x6426e7[_0x8d37('0x2')](_0x3c77bc,_0x39ed33);};}function removeListener(_0x29ab0d,_0x2bcfe2){return function(){ChatInternalMessageEvents[_0x8d37('0x3')](_0x29ab0d,_0x2bcfe2);};}exports[_0x8d37('0x4')]=function(_0x48efda){for(var _0x486b67=0x0,_0x41d501=events['length'];_0x486b67<_0x41d501;_0x486b67++){var _0x4e4679=events[_0x486b67];var _0x405812=createListener('chatInternalMessage:'+_0x4e4679,_0x48efda);ChatInternalMessageEvents['on'](_0x4e4679,_0x405812);}};
\ No newline at end of file
+var _0x93f9=['save','remove','emit','removeListener','length','./chatInternalMessage.events'];(function(_0x26c4f9,_0x2773ec){var _0x3e7e9f=function(_0x247ed6){while(--_0x247ed6){_0x26c4f9['push'](_0x26c4f9['shift']());}};_0x3e7e9f(++_0x2773ec);}(_0x93f9,0xd1));var _0x993f=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x93f9[_0x5783f4];return _0x28e380;};'use strict';var ChatInternalMessageEvents=require(_0x993f('0x0'));var events=[_0x993f('0x1'),_0x993f('0x2'),'update'];function createListener(_0x686b67,_0x11c5e7){return function(_0x5f35d8){_0x11c5e7[_0x993f('0x3')](_0x686b67,_0x5f35d8);};}function removeListener(_0x2a47ac,_0x5d7f39){return function(){ChatInternalMessageEvents[_0x993f('0x4')](_0x2a47ac,_0x5d7f39);};}exports['register']=function(_0x2f2b9a){for(var _0x22cc65=0x0,_0x3df05d=events[_0x993f('0x5')];_0x22cc65<_0x3df05d;_0x22cc65++){var _0x789c03=events[_0x22cc65];var _0x56c68f=createListener('chatInternalMessage:'+_0x789c03,_0x2f2b9a);ChatInternalMessageEvents['on'](_0x789c03,_0x56c68f);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 1b2a28c..b5f0abb 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 _0x6dfe=['path','Router','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','/:id','show','post','create','put','update','delete','exports','util'];(function(_0x569caa,_0x5174ce){var _0x44cb5a=function(_0x456df4){while(--_0x456df4){_0x569caa['push'](_0x569caa['shift']());}};_0x44cb5a(++_0x5174ce);}(_0x6dfe,0x1a3));var _0xe6df=function(_0x59bfb8,_0x5dde3f){_0x59bfb8=_0x59bfb8-0x0;var _0x428495=_0x6dfe[_0x59bfb8];return _0x428495;};'use strict';var multer=require('multer');var util=require(_0xe6df('0x0'));var path=require(_0xe6df('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe6df('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe6df('0x3'));var interaction=require(_0xe6df('0x4'));var config=require('../../config/environment');var controller=require(_0xe6df('0x5'));router[_0xe6df('0x6')]('/',auth[_0xe6df('0x7')](),controller[_0xe6df('0x8')]);router[_0xe6df('0x6')](_0xe6df('0x9'),auth['isAuthenticated'](),controller[_0xe6df('0xa')]);router[_0xe6df('0x6')](_0xe6df('0xb'),auth[_0xe6df('0x7')](),controller['getUsers']);router[_0xe6df('0x6')](_0xe6df('0xc'),auth[_0xe6df('0x7')](),controller[_0xe6df('0xd')]);router[_0xe6df('0xe')]('/',auth[_0xe6df('0x7')](),controller[_0xe6df('0xf')]);router[_0xe6df('0x10')](_0xe6df('0xc'),controller[_0xe6df('0x11')]);router[_0xe6df('0x12')](_0xe6df('0xc'),auth[_0xe6df('0x7')](),controller['destroy']);module[_0xe6df('0x13')]=router;
\ No newline at end of file
+var _0x0b80=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post','create','update','destroy','exports','multer','util'];(function(_0x49c445,_0x350b54){var _0x118bb4=function(_0xdce3dc){while(--_0xdce3dc){_0x49c445['push'](_0x49c445['shift']());}};_0x118bb4(++_0x350b54);}(_0x0b80,0x196));var _0x00b8=function(_0x2f3f03,_0x3576b4){_0x2f3f03=_0x2f3f03-0x0;var _0x28ca10=_0x0b80[_0x2f3f03];return _0x28ca10;};'use strict';var multer=require(_0x00b8('0x0'));var util=require(_0x00b8('0x1'));var path=require(_0x00b8('0x2'));var timeout=require('connect-timeout');var express=require(_0x00b8('0x3'));var router=express[_0x00b8('0x4')]();var fs_extra=require(_0x00b8('0x5'));var auth=require(_0x00b8('0x6'));var interaction=require(_0x00b8('0x7'));var config=require(_0x00b8('0x8'));var controller=require(_0x00b8('0x9'));router[_0x00b8('0xa')]('/',auth[_0x00b8('0xb')](),controller[_0x00b8('0xc')]);router[_0x00b8('0xa')](_0x00b8('0xd'),auth[_0x00b8('0xb')](),controller[_0x00b8('0xe')]);router[_0x00b8('0xa')](_0x00b8('0xf'),auth['isAuthenticated'](),controller[_0x00b8('0x10')]);router[_0x00b8('0xa')](_0x00b8('0x11'),auth['isAuthenticated'](),controller[_0x00b8('0x12')]);router[_0x00b8('0x13')]('/',auth[_0x00b8('0xb')](),controller[_0x00b8('0x14')]);router['put']('/:id',controller[_0x00b8('0x15')]);router['delete'](_0x00b8('0x11'),auth[_0x00b8('0xb')](),controller[_0x00b8('0x16')]);module[_0x00b8('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index aaa71b5..b113474 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 _0xce3a=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x2b6061,_0xd17e1a){var _0x1efbe1=function(_0x26b4ee){while(--_0x26b4ee){_0x2b6061['push'](_0x2b6061['shift']());}};_0x1efbe1(++_0xd17e1a);}(_0xce3a,0x194));var _0xace3=function(_0x3a657f,_0x25679f){_0x3a657f=_0x3a657f-0x0;var _0x415e94=_0xce3a[_0x3a657f];return _0x415e94;};'use strict';var Sequelize=require(_0xace3('0x0'));module[_0xace3('0x1')]={'body':{'type':Sequelize[_0xace3('0x2')](_0xace3('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xace3('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xace3('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xace3('0x5')]('in',_0xace3('0x6')),'defaultValue':_0xace3('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xace3('0x7')]},'providerName':{'type':Sequelize[_0xace3('0x8')]},'providerResponse':{'type':Sequelize[_0xace3('0x2')]}};
\ No newline at end of file
+var _0x0833=['medium','BOOLEAN','out','STRING','sequelize','exports','TEXT'];(function(_0x1892a3,_0x5e5d83){var _0x551b4e=function(_0x1c39cc){while(--_0x1c39cc){_0x1892a3['push'](_0x1892a3['shift']());}};_0x551b4e(++_0x5e5d83);}(_0x0833,0x1bd));var _0x3083=function(_0x1aeff5,_0x365dc2){_0x1aeff5=_0x1aeff5-0x0;var _0x193808=_0x0833[_0x1aeff5];return _0x193808;};'use strict';var Sequelize=require(_0x3083('0x0'));module[_0x3083('0x1')]={'body':{'type':Sequelize[_0x3083('0x2')](_0x3083('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x3083('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x3083('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x3083('0x6')]},'providerResponse':{'type':Sequelize[_0x3083('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 6114a1e..740c892 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 _0x30dd=['Sequelize','SELECT','User','agent','fullname','email','internal','manual','interface','channel','motionChannel','accept','EventManager','acceptmessage','formData','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','QueryTypes','contact','SIP/%s','event','rejectmessage','parse','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','info','request\x20sent','debug','error','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','undefined','count','offset','set','Content-Range','json','apply','destroy','end','name','send','index','map','ChatMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','limit','order','sort','where','filter','merge','type','includeAll','include','findAll','rows','show','params','options','find','create','body','update','describe','chat-interactions','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteraction','ChatInteractionId','format','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x30dd,0x1ab));var _0xd30d=function(_0x3fb9f7,_0x297de6){_0x3fb9f7=_0x3fb9f7-0x0;var _0x70fabc=_0x30dd[_0x3fb9f7];return _0x70fabc;};'use strict';var emlformat=require(_0xd30d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd30d('0x1'));var rp=require(_0xd30d('0x2'));var moment=require(_0xd30d('0x3'));var BPromise=require(_0xd30d('0x4'));var Mustache=require(_0xd30d('0x5'));var util=require(_0xd30d('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd30d('0x7'));var ejs=require(_0xd30d('0x8'));var fs=require('fs');var fs_extra=require(_0xd30d('0x9'));var _=require(_0xd30d('0xa'));var squel=require(_0xd30d('0xb'));var crypto=require(_0xd30d('0xc'));var jsforce=require(_0xd30d('0xd'));var deskjs=require(_0xd30d('0xe'));var toCsv=require(_0xd30d('0x7'));var querystring=require(_0xd30d('0xf'));var Papa=require(_0xd30d('0x10'));var Redis=require(_0xd30d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd30d('0x12'));var as=require(_0xd30d('0x13'));var hardwareService=require(_0xd30d('0x14'));var logger=require(_0xd30d('0x15'))(_0xd30d('0x16'));var utils=require(_0xd30d('0x17'));var config=require(_0xd30d('0x18'));var licenseUtil=require(_0xd30d('0x19'));var db=require(_0xd30d('0x1a'))['db'];config[_0xd30d('0x1b')]=_[_0xd30d('0x1c')](config['redis'],{'host':_0xd30d('0x1d'),'port':0x18eb});var socket=require(_0xd30d('0x1e'))(new Redis(config[_0xd30d('0x1b')]));require('./chatMessage.socket')[_0xd30d('0x1f')](socket);var jayson=require(_0xd30d('0x20'));var client=jayson['client'][_0xd30d('0x21')]({'port':0x232c});var client9002=jayson[_0xd30d('0x22')][_0xd30d('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x5cc3bf,_0x1dcffe,_0x32c1e5,_0x344bae){return new BPromise(function(_0x37713f,_0x3cb322){var _0x7e0d63=_0x344bae||client;return _0x7e0d63[_0xd30d('0x23')](_0x5cc3bf,_0x32c1e5)[_0xd30d('0x24')](function(_0x3dbff2){logger[_0xd30d('0x25')]('ChatMessage,\x20%s,\x20%s',_0x1dcffe,_0xd30d('0x26'));logger[_0xd30d('0x27')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1dcffe,_0xd30d('0x26'),JSON['stringify'](_0x3dbff2));if(_0x3dbff2[_0xd30d('0x28')]){if(_0x3dbff2[_0xd30d('0x28')]['code']===0x1f4){logger[_0xd30d('0x28')](_0xd30d('0x29'),_0x1dcffe,_0x3dbff2[_0xd30d('0x28')][_0xd30d('0x2a')]);return _0x3cb322(_0x3dbff2[_0xd30d('0x28')]['message']);}logger[_0xd30d('0x28')]('ChatMessage,\x20%s,\x20%s',_0x1dcffe,_0x3dbff2[_0xd30d('0x28')]['message']);return _0x37713f(_0x3dbff2[_0xd30d('0x28')][_0xd30d('0x2a')]);}else{logger[_0xd30d('0x25')](_0xd30d('0x29'),_0x1dcffe,_0xd30d('0x26'));_0x37713f(_0x3dbff2[_0xd30d('0x2b')][_0xd30d('0x2a')]);}})[_0xd30d('0x2c')](function(_0x1a1814){logger[_0xd30d('0x28')](_0xd30d('0x29'),_0x1dcffe,_0x1a1814);_0x3cb322(_0x1a1814);});});}function respondWithStatusCode(_0x19d376,_0xd16469){_0xd16469=_0xd16469||0xcc;return function(_0x51d91d){if(_0x51d91d){return _0x19d376[_0xd30d('0x2d')](_0xd16469);}return _0x19d376[_0xd30d('0x2e')](_0xd16469)['end']();};}function respondWithResult(_0xa4c709,_0x207608){_0x207608=_0x207608||0xc8;return function(_0x540479){if(_0x540479){return _0xa4c709[_0xd30d('0x2e')](_0x207608)['json'](_0x540479);}};}function respondWithFilteredResult(_0x4b3de9,_0x4a7857){return function(_0x2b3945){if(_0x2b3945){var _0x10b7c5=typeof _0x4a7857['offset']===_0xd30d('0x2f')&&typeof _0x4a7857['limit']==='undefined';var _0x5f178a=_0x2b3945[_0xd30d('0x30')];var _0x99a141=_0x10b7c5?0x0:_0x4a7857['offset'];var _0x441c46=_0x10b7c5?_0x2b3945[_0xd30d('0x30')]:_0x4a7857[_0xd30d('0x31')]+_0x4a7857['limit'];var _0x39970c;if(_0x441c46>=_0x5f178a){_0x441c46=_0x5f178a;_0x39970c=0xc8;}else{_0x39970c=0xce;}_0x4b3de9[_0xd30d('0x2e')](_0x39970c);return _0x4b3de9[_0xd30d('0x32')](_0xd30d('0x33'),_0x99a141+'-'+_0x441c46+'/'+_0x5f178a)[_0xd30d('0x34')](_0x2b3945);}return null;};}function patchUpdates(_0x29851c){return function(_0x2bf8d2){try{jsonpatch[_0xd30d('0x35')](_0x2bf8d2,_0x29851c,!![]);}catch(_0x9c538d){return BPromise['reject'](_0x9c538d);}return _0x2bf8d2['save']();};}function saveUpdates(_0x580399,_0x38cac9){return function(_0x23246d){if(_0x23246d){return _0x23246d['update'](_0x580399)['then'](function(_0x118920){return _0x118920;});}return null;};}function removeEntity(_0x53c508,_0x2883b1){return function(_0x4e63c6){if(_0x4e63c6){return _0x4e63c6[_0xd30d('0x36')]()[_0xd30d('0x24')](function(){_0x53c508[_0xd30d('0x2e')](0xcc)[_0xd30d('0x37')]();});}};}function handleEntityNotFound(_0x4b616e,_0x14917a){return function(_0x5d71c0){if(!_0x5d71c0){_0x4b616e[_0xd30d('0x2d')](0x194);}return _0x5d71c0;};}function handleError(_0x3ec58f,_0x353ac6){_0x353ac6=_0x353ac6||0x1f4;return function(_0x5d70a9){logger['error'](_0x5d70a9['stack']);if(_0x5d70a9[_0xd30d('0x38')]){delete _0x5d70a9['name'];}_0x3ec58f[_0xd30d('0x2e')](_0x353ac6)[_0xd30d('0x39')](_0x5d70a9);};}exports[_0xd30d('0x3a')]=function(_0x294c50,_0x1ec303){var _0x20c6c9={},_0x2f151d={},_0x33beb0={'count':0x0,'rows':[]};var _0x5d5c42=_[_0xd30d('0x3b')](db[_0xd30d('0x3c')][_0xd30d('0x3d')],function(_0x28eeb5){return{'name':_0x28eeb5[_0xd30d('0x3e')],'type':_0x28eeb5['type'][_0xd30d('0x3f')]};});_0x2f151d[_0xd30d('0x40')]=_[_0xd30d('0x3b')](_0x5d5c42,_0xd30d('0x38'));_0x2f151d[_0xd30d('0x41')]=_[_0xd30d('0x42')](_0x294c50[_0xd30d('0x41')]);_0x2f151d[_0xd30d('0x43')]=_[_0xd30d('0x44')](_0x2f151d[_0xd30d('0x40')],_0x2f151d[_0xd30d('0x41')]);_0x20c6c9[_0xd30d('0x45')]=_[_0xd30d('0x44')](_0x2f151d[_0xd30d('0x40')],qs['fields'](_0x294c50[_0xd30d('0x41')][_0xd30d('0x46')]));_0x20c6c9[_0xd30d('0x45')]=_0x20c6c9[_0xd30d('0x45')][_0xd30d('0x47')]?_0x20c6c9[_0xd30d('0x45')]:_0x2f151d['model'];if(!_0x294c50[_0xd30d('0x41')]['hasOwnProperty']('nolimit')){_0x20c6c9[_0xd30d('0x48')]=qs[_0xd30d('0x48')](_0x294c50[_0xd30d('0x41')]['limit']);_0x20c6c9[_0xd30d('0x31')]=qs[_0xd30d('0x31')](_0x294c50[_0xd30d('0x41')][_0xd30d('0x31')]);}_0x20c6c9[_0xd30d('0x49')]=qs[_0xd30d('0x4a')](_0x294c50[_0xd30d('0x41')][_0xd30d('0x4a')]);_0x20c6c9[_0xd30d('0x4b')]=qs[_0xd30d('0x43')](_['pick'](_0x294c50[_0xd30d('0x41')],_0x2f151d[_0xd30d('0x43')]),_0x5d5c42);if(_0x294c50[_0xd30d('0x41')][_0xd30d('0x4c')]){_0x20c6c9[_0xd30d('0x4b')]=_[_0xd30d('0x4d')](_0x20c6c9[_0xd30d('0x4b')],{'$or':_[_0xd30d('0x3b')](_0x5d5c42,function(_0x1d873d){if(_0x1d873d[_0xd30d('0x4e')]!=='VIRTUAL'){var _0x50dd3e={};_0x50dd3e[_0x1d873d[_0xd30d('0x38')]]={'$like':'%'+_0x294c50['query'][_0xd30d('0x4c')]+'%'};return _0x50dd3e;}})});}_0x20c6c9=_[_0xd30d('0x4d')]({},_0x20c6c9,_0x294c50['options']);var _0x4dec84={'where':_0x20c6c9[_0xd30d('0x4b')]};return db[_0xd30d('0x3c')][_0xd30d('0x30')](_0x4dec84)[_0xd30d('0x24')](function(_0x1672c1){_0x33beb0['count']=_0x1672c1;if(_0x294c50[_0xd30d('0x41')][_0xd30d('0x4f')]){_0x20c6c9[_0xd30d('0x50')]=[{'all':!![]}];}return db['ChatMessage'][_0xd30d('0x51')](_0x20c6c9);})[_0xd30d('0x24')](function(_0x44ea6a){_0x33beb0[_0xd30d('0x52')]=_0x44ea6a;return _0x33beb0;})['then'](respondWithFilteredResult(_0x1ec303,_0x20c6c9))[_0xd30d('0x2c')](handleError(_0x1ec303,null));};exports[_0xd30d('0x53')]=function(_0x2ec9e4,_0x47c512){var _0xce43c7={'raw':!![],'where':{'id':_0x2ec9e4[_0xd30d('0x54')]['id']}},_0x5dffb6={};_0x5dffb6['model']=_[_0xd30d('0x42')](db[_0xd30d('0x3c')][_0xd30d('0x3d')]);_0x5dffb6['query']=_[_0xd30d('0x42')](_0x2ec9e4[_0xd30d('0x41')]);_0x5dffb6[_0xd30d('0x43')]=_['intersection'](_0x5dffb6['model'],_0x5dffb6[_0xd30d('0x41')]);_0xce43c7['attributes']=_[_0xd30d('0x44')](_0x5dffb6[_0xd30d('0x40')],qs[_0xd30d('0x46')](_0x2ec9e4[_0xd30d('0x41')][_0xd30d('0x46')]));_0xce43c7[_0xd30d('0x45')]=_0xce43c7[_0xd30d('0x45')][_0xd30d('0x47')]?_0xce43c7[_0xd30d('0x45')]:_0x5dffb6[_0xd30d('0x40')];if(_0x2ec9e4[_0xd30d('0x41')]['includeAll']){_0xce43c7[_0xd30d('0x50')]=[{'all':!![]}];}_0xce43c7=_[_0xd30d('0x4d')]({},_0xce43c7,_0x2ec9e4[_0xd30d('0x55')]);return db[_0xd30d('0x3c')][_0xd30d('0x56')](_0xce43c7)['then'](handleEntityNotFound(_0x47c512,null))[_0xd30d('0x24')](respondWithResult(_0x47c512,null))[_0xd30d('0x2c')](handleError(_0x47c512,null));};exports['create']=function(_0x437882,_0x144cac){return db[_0xd30d('0x3c')][_0xd30d('0x57')](_0x437882[_0xd30d('0x58')],{})['then'](respondWithResult(_0x144cac,0xc9))[_0xd30d('0x2c')](handleError(_0x144cac,null));};exports[_0xd30d('0x59')]=function(_0x33fd1c,_0x52b686){if(_0x33fd1c[_0xd30d('0x58')]['id']){delete _0x33fd1c[_0xd30d('0x58')]['id'];}return db[_0xd30d('0x3c')][_0xd30d('0x56')]({'where':{'id':_0x33fd1c[_0xd30d('0x54')]['id']}})[_0xd30d('0x24')](handleEntityNotFound(_0x52b686,null))['then'](saveUpdates(_0x33fd1c[_0xd30d('0x58')],null))[_0xd30d('0x24')](respondWithResult(_0x52b686,null))[_0xd30d('0x2c')](handleError(_0x52b686,null));};exports[_0xd30d('0x36')]=function(_0x1fb840,_0x42528d){return db[_0xd30d('0x3c')]['find']({'where':{'id':_0x1fb840['params']['id']}})[_0xd30d('0x24')](handleEntityNotFound(_0x42528d,null))[_0xd30d('0x24')](removeEntity(_0x42528d,null))[_0xd30d('0x2c')](handleError(_0x42528d,null));};exports[_0xd30d('0x5a')]=function(_0x3fbec7,_0x44db0a){return db[_0xd30d('0x3c')][_0xd30d('0x5a')]()[_0xd30d('0x24')](respondWithResult(_0x44db0a,null))['catch'](handleError(_0x44db0a,null));};var interaction_log=require(_0xd30d('0x15'))(_0xd30d('0x5b'));exports['accept']=function(_0x158269,_0x586c46,_0x2ebca8){var _0x4bb854={'agent':{},'channel':_0xd30d('0x5c')};if(_0x158269['body']['id']){delete _0x158269['body']['id'];}_0x158269['body'][_0xd30d('0x5d')]=!![];_0x158269[_0xd30d('0x58')][_0xd30d('0x5e')]=moment()['format'](_0xd30d('0x5f'));_0x158269[_0xd30d('0x58')][_0xd30d('0x60')]=_0x158269[_0xd30d('0x58')]['UserId']||_0x158269[_0xd30d('0x61')]['id'];_0x4bb854['agent']['id']=_0x158269[_0xd30d('0x58')][_0xd30d('0x60')];return db[_0xd30d('0x3c')][_0xd30d('0x56')]({'where':{'id':_0x158269[_0xd30d('0x54')]['id'],'UserId':null}})[_0xd30d('0x24')](handleEntityNotFound(_0x586c46,null))[_0xd30d('0x24')](saveUpdates(_0x158269['body'],null))[_0xd30d('0x24')](function(_0x205a18){if(_0x205a18){_0x4bb854[_0xd30d('0x2a')]=_0x205a18['get']({'plain':!![]});return db[_0xd30d('0x62')][_0xd30d('0x56')]({'where':{'id':_0x205a18[_0xd30d('0x63')]}});}return null;})[_0xd30d('0x24')](handleEntityNotFound(_0x586c46,null))[_0xd30d('0x24')](function(_0x5b911e){if(_0x5b911e){return _0x5b911e[_0xd30d('0x59')]({'UserId':_0x158269['body'][_0xd30d('0x60')],'read1stAt':_['isNil'](_0x5b911e['read1stAt'])?moment()[_0xd30d('0x64')](_0xd30d('0x5f')):undefined});}return null;})['then'](function(_0x18b257){if(_0x18b257){_0x4bb854[_0xd30d('0x65')]=_0x18b257[_0xd30d('0x66')]({'plain':!![]});interaction_log['info'](_0xd30d('0x67'),_0x158269[_0xd30d('0x61')]['id'],_0x158269['user'][_0xd30d('0x38')],_0x158269[_0xd30d('0x61')]['role'],_0x4bb854[_0xd30d('0x65')]['id'],_0x158269[_0xd30d('0x58')]?JSON[_0xd30d('0x68')](_0x158269[_0xd30d('0x58')]):_0xd30d('0x69'));return respondWithRpcPromise(_0xd30d('0x6a'),'acceptMessage',_0x4bb854);}return null;})[_0xd30d('0x24')](function(_0x1d68bd){var _0x5b28e4=_0xd30d('0x6b')+_0x1d68bd['message'][_0xd30d('0x6c')];return db['sequelize']['query'](_0x5b28e4,{'type':db[_0xd30d('0x6d')]['QueryTypes'][_0xd30d('0x6e')],'raw':!![]})['then'](function(_0x882260){return _0x882260;});})[_0xd30d('0x24')](function(_0xa3775){if(_0xa3775){_0x4bb854[_0xd30d('0x2a')]['contact']=_0xa3775[0x0];if(!_0x158269[_0xd30d('0x58')][_0xd30d('0x60')])return;return db[_0xd30d('0x6f')][_0xd30d('0x56')]({'where':{'id':_0x158269[_0xd30d('0x58')][_0xd30d('0x60')],'role':_0xd30d('0x70')},'attributes':['id',_0xd30d('0x38'),_0xd30d('0x71'),_0xd30d('0x72'),_0xd30d('0x73')],'raw':!![]});}return null;})[_0xd30d('0x24')](function(_0x341e4){if(!_0x341e4)return null;_0x4bb854[_0xd30d('0x2a')][_0xd30d('0x70')]=_0x341e4;return _0x4bb854;})[_0xd30d('0x24')](function(_0x5f42a7){if(_0x5f42a7){if(_0x158269[_0xd30d('0x58')][_0xd30d('0x74')]){_0x4bb854[_0xd30d('0x2a')][_0xd30d('0x75')]=util[_0xd30d('0x64')]('SIP/%s',_0x158269[_0xd30d('0x61')]['name']);_0x4bb854[_0xd30d('0x2a')][_0xd30d('0x76')]=_0x4bb854[_0xd30d('0x76')];_0x4bb854['message'][_0xd30d('0x77')]=_0x4bb854[_0xd30d('0x76')];_0x4bb854[_0xd30d('0x2a')]['event']=_0xd30d('0x78');return respondWithRpcPromise(_0xd30d('0x79'),_0xd30d('0x79'),{'event':_0xd30d('0x7a'),'message':_[_0xd30d('0x4d')](_0x4bb854['message'],JSON['parse'](_0x4bb854[_0xd30d('0x65')][_0xd30d('0x7b')]))},client9002)[_0xd30d('0x24')](function(){return _0x4bb854;});}return _0x4bb854;}return null;})[_0xd30d('0x24')](respondWithResult(_0x586c46,null))[_0xd30d('0x2c')](handleError(_0x586c46,null));};var interaction_log=require(_0xd30d('0x15'))(_0xd30d('0x5b'));exports[_0xd30d('0x7c')]=function(_0x32dc0f,_0x3ca5c1,_0x1c4423){var _0x4c7d1b={'agent':{},'channel':'chat'};if(_0x32dc0f[_0xd30d('0x58')]['id']){delete _0x32dc0f[_0xd30d('0x58')]['id'];}_0x32dc0f['body']['UserId']=_0x32dc0f['body']['UserId']||_0x32dc0f[_0xd30d('0x61')]['id'];_0x4c7d1b[_0xd30d('0x70')]['id']=_0x32dc0f[_0xd30d('0x58')][_0xd30d('0x60')];return db[_0xd30d('0x3c')][_0xd30d('0x56')]({'where':{'id':_0x32dc0f[_0xd30d('0x54')]['id'],'UserId':null}})[_0xd30d('0x24')](handleEntityNotFound(_0x3ca5c1,null))[_0xd30d('0x24')](function(_0x1ed0b4){if(_0x1ed0b4){_0x4c7d1b['message']=_0x1ed0b4[_0xd30d('0x66')]({'plain':!![]});return db[_0xd30d('0x62')][_0xd30d('0x56')]({'where':{'id':_0x1ed0b4[_0xd30d('0x63')]}});}return null;})[_0xd30d('0x24')](handleEntityNotFound(_0x3ca5c1,null))[_0xd30d('0x24')](function(_0x11df78){if(_0x11df78){_0x4c7d1b['interaction']=_0x11df78[_0xd30d('0x66')]({'plain':!![]});interaction_log[_0xd30d('0x25')](_0xd30d('0x7d'),_0x32dc0f['user']['id'],_0x32dc0f[_0xd30d('0x61')][_0xd30d('0x38')],_0x32dc0f['user'][_0xd30d('0x7e')],_0x4c7d1b['interaction']['id'],_0x32dc0f[_0xd30d('0x58')]?JSON[_0xd30d('0x68')](_0x32dc0f[_0xd30d('0x58')]):_0xd30d('0x69'));return respondWithRpcPromise(_0xd30d('0x7f'),'rejectMessage',_0x4c7d1b);}return null;})[_0xd30d('0x24')](function(_0x81597c){var _0x5acd99=_0xd30d('0x6b')+_0x81597c[_0xd30d('0x2a')][_0xd30d('0x6c')];return db['sequelize'][_0xd30d('0x41')](_0x5acd99,{'type':db['Sequelize'][_0xd30d('0x80')]['SELECT'],'raw':!![]})[_0xd30d('0x24')](function(_0x1e25e1){return _0x1e25e1;});})[_0xd30d('0x24')](function(_0x12b5d7){if(_0x12b5d7){_0x4c7d1b['message'][_0xd30d('0x81')]=_0x12b5d7[0x0];if(!_0x32dc0f[_0xd30d('0x58')][_0xd30d('0x60')])return;return db[_0xd30d('0x6f')][_0xd30d('0x56')]({'where':{'id':_0x32dc0f[_0xd30d('0x58')]['UserId'],'role':_0xd30d('0x70')},'attributes':['id',_0xd30d('0x38'),'fullname',_0xd30d('0x72'),_0xd30d('0x73')],'raw':!![]});}return null;})[_0xd30d('0x24')](function(_0x16d8b2){if(!_0x16d8b2)return null;_0x4c7d1b[_0xd30d('0x2a')][_0xd30d('0x70')]=_0x16d8b2;return _0x4c7d1b;})[_0xd30d('0x24')](function(_0x225488){if(_0x225488){_0x225488['message'][_0xd30d('0x75')]=util[_0xd30d('0x64')](_0xd30d('0x82'),_0x32dc0f['user'][_0xd30d('0x38')]);_0x225488['message']['channel']=_0x4c7d1b[_0xd30d('0x76')];_0x225488[_0xd30d('0x2a')][_0xd30d('0x77')]=_0x4c7d1b[_0xd30d('0x76')];_0x225488['message'][_0xd30d('0x83')]=_0xd30d('0x7c');respondWithRpcPromise('EventManager','EventManager',{'event':_0xd30d('0x84'),'message':_['merge'](_0x4c7d1b[_0xd30d('0x2a')],JSON[_0xd30d('0x85')](_0x4c7d1b[_0xd30d('0x65')][_0xd30d('0x7b')]))},client9002);return _0x4c7d1b;}return null;})[_0xd30d('0x24')](respondWithResult(_0x3ca5c1,null))[_0xd30d('0x2c')](handleError(_0x3ca5c1,null));};
\ No newline at end of file
+var _0x4580=['chat-interactions','accept','chat','read','readAt','format','UserId','get','ChatInteractionId','update','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','interface','channel','motionChannel','EventManager','parse','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SIP/%s','event','rejectmessage','formData','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','http','client','request','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','then','destroy','name','index','map','ChatMessage','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','show','include','find','create','body','params','describe','../../config/logger'];(function(_0x12e719,_0x4f5581){var _0x3bdd30=function(_0x489472){while(--_0x489472){_0x12e719['push'](_0x12e719['shift']());}};_0x3bdd30(++_0x4f5581);}(_0x4580,0x136));var _0x0458=function(_0x3a2f45,_0x628b19){_0x3a2f45=_0x3a2f45-0x0;var _0x25b26c=_0x4580[_0x3a2f45];return _0x25b26c;};'use strict';var emlformat=require(_0x0458('0x0'));var rimraf=require(_0x0458('0x1'));var zipdir=require(_0x0458('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0458('0x3'));var moment=require('moment');var BPromise=require(_0x0458('0x4'));var Mustache=require(_0x0458('0x5'));var util=require(_0x0458('0x6'));var path=require(_0x0458('0x7'));var sox=require(_0x0458('0x8'));var csv=require('to-csv');var ejs=require(_0x0458('0x9'));var fs=require('fs');var fs_extra=require(_0x0458('0xa'));var _=require('lodash');var squel=require(_0x0458('0xb'));var crypto=require(_0x0458('0xc'));var jsforce=require(_0x0458('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0458('0xe'));var querystring=require(_0x0458('0xf'));var Papa=require(_0x0458('0x10'));var Redis=require(_0x0458('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0458('0x12'));var hardwareService=require(_0x0458('0x13'));var logger=require('../../config/logger')(_0x0458('0x14'));var utils=require(_0x0458('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0458('0x16'))['db'];config[_0x0458('0x17')]=_[_0x0458('0x18')](config[_0x0458('0x17')],{'host':_0x0458('0x19'),'port':0x18eb});var socket=require(_0x0458('0x1a'))(new Redis(config[_0x0458('0x17')]));require(_0x0458('0x1b'))['register'](socket);var jayson=require(_0x0458('0x1c'));var client=jayson['client'][_0x0458('0x1d')]({'port':0x232c});var client9002=jayson[_0x0458('0x1e')][_0x0458('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x261989,_0x14b116,_0x5db9d9,_0x4f4141){return new BPromise(function(_0xc4706c,_0x4677af){var _0x1dd5e7=_0x4f4141||client;return _0x1dd5e7[_0x0458('0x1f')](_0x261989,_0x5db9d9)['then'](function(_0x276ab2){logger[_0x0458('0x20')](_0x0458('0x21'),_0x14b116,'request\x20sent');logger['debug'](_0x0458('0x22'),_0x14b116,_0x0458('0x23'),JSON[_0x0458('0x24')](_0x276ab2));if(_0x276ab2['error']){if(_0x276ab2[_0x0458('0x25')]['code']===0x1f4){logger[_0x0458('0x25')](_0x0458('0x21'),_0x14b116,_0x276ab2['error']['message']);return _0x4677af(_0x276ab2['error'][_0x0458('0x26')]);}logger[_0x0458('0x25')](_0x0458('0x21'),_0x14b116,_0x276ab2[_0x0458('0x25')][_0x0458('0x26')]);return _0xc4706c(_0x276ab2[_0x0458('0x25')]['message']);}else{logger[_0x0458('0x20')](_0x0458('0x21'),_0x14b116,_0x0458('0x23'));_0xc4706c(_0x276ab2[_0x0458('0x27')][_0x0458('0x26')]);}})[_0x0458('0x28')](function(_0x418386){logger['error'](_0x0458('0x21'),_0x14b116,_0x418386);_0x4677af(_0x418386);});});}function respondWithStatusCode(_0x72c84f,_0x4e9dec){_0x4e9dec=_0x4e9dec||0xcc;return function(_0x4d6eac){if(_0x4d6eac){return _0x72c84f[_0x0458('0x29')](_0x4e9dec);}return _0x72c84f[_0x0458('0x2a')](_0x4e9dec)[_0x0458('0x2b')]();};}function respondWithResult(_0x464cf5,_0x2fed83){_0x2fed83=_0x2fed83||0xc8;return function(_0x198546){if(_0x198546){return _0x464cf5[_0x0458('0x2a')](_0x2fed83)[_0x0458('0x2c')](_0x198546);}};}function respondWithFilteredResult(_0x302ffa,_0x1763bf){return function(_0x157b7e){if(_0x157b7e){var _0x26f52f=typeof _0x1763bf[_0x0458('0x2d')]==='undefined'&&typeof _0x1763bf[_0x0458('0x2e')]===_0x0458('0x2f');var _0xfee443=_0x157b7e[_0x0458('0x30')];var _0x11ccf1=_0x26f52f?0x0:_0x1763bf[_0x0458('0x2d')];var _0x4e8c9e=_0x26f52f?_0x157b7e[_0x0458('0x30')]:_0x1763bf[_0x0458('0x2d')]+_0x1763bf[_0x0458('0x2e')];var _0x3dc4d8;if(_0x4e8c9e>=_0xfee443){_0x4e8c9e=_0xfee443;_0x3dc4d8=0xc8;}else{_0x3dc4d8=0xce;}_0x302ffa[_0x0458('0x2a')](_0x3dc4d8);return _0x302ffa[_0x0458('0x31')]('Content-Range',_0x11ccf1+'-'+_0x4e8c9e+'/'+_0xfee443)[_0x0458('0x2c')](_0x157b7e);}return null;};}function patchUpdates(_0x3b6b72){return function(_0x4b4da2){try{jsonpatch[_0x0458('0x32')](_0x4b4da2,_0x3b6b72,!![]);}catch(_0x46ab77){return BPromise[_0x0458('0x33')](_0x46ab77);}return _0x4b4da2['save']();};}function saveUpdates(_0xb7bd01,_0x2de457){return function(_0x4e4efb){if(_0x4e4efb){return _0x4e4efb['update'](_0xb7bd01)[_0x0458('0x34')](function(_0x45f380){return _0x45f380;});}return null;};}function removeEntity(_0x2f5555,_0x21f6f8){return function(_0x5d4ecb){if(_0x5d4ecb){return _0x5d4ecb[_0x0458('0x35')]()[_0x0458('0x34')](function(){_0x2f5555['status'](0xcc)[_0x0458('0x2b')]();});}};}function handleEntityNotFound(_0x1b24dc,_0x9f98c0){return function(_0x28949f){if(!_0x28949f){_0x1b24dc[_0x0458('0x29')](0x194);}return _0x28949f;};}function handleError(_0x46eb04,_0x587e65){_0x587e65=_0x587e65||0x1f4;return function(_0x3b1d7d){logger[_0x0458('0x25')](_0x3b1d7d['stack']);if(_0x3b1d7d[_0x0458('0x36')]){delete _0x3b1d7d[_0x0458('0x36')];}_0x46eb04[_0x0458('0x2a')](_0x587e65)['send'](_0x3b1d7d);};}exports[_0x0458('0x37')]=function(_0x2905a4,_0x1e45b5){var _0x754d74={},_0x2ff3ab={},_0x4d57a3={'count':0x0,'rows':[]};var _0xe28213=_[_0x0458('0x38')](db[_0x0458('0x39')][_0x0458('0x3a')],function(_0x18ec57){return{'name':_0x18ec57[_0x0458('0x3b')],'type':_0x18ec57['type']['key']};});_0x2ff3ab[_0x0458('0x3c')]=_['map'](_0xe28213,'name');_0x2ff3ab[_0x0458('0x3d')]=_[_0x0458('0x3e')](_0x2905a4[_0x0458('0x3d')]);_0x2ff3ab[_0x0458('0x3f')]=_['intersection'](_0x2ff3ab[_0x0458('0x3c')],_0x2ff3ab[_0x0458('0x3d')]);_0x754d74['attributes']=_[_0x0458('0x40')](_0x2ff3ab[_0x0458('0x3c')],qs[_0x0458('0x41')](_0x2905a4[_0x0458('0x3d')][_0x0458('0x41')]));_0x754d74[_0x0458('0x42')]=_0x754d74['attributes'][_0x0458('0x43')]?_0x754d74['attributes']:_0x2ff3ab[_0x0458('0x3c')];if(!_0x2905a4['query'][_0x0458('0x44')]('nolimit')){_0x754d74[_0x0458('0x2e')]=qs[_0x0458('0x2e')](_0x2905a4[_0x0458('0x3d')][_0x0458('0x2e')]);_0x754d74[_0x0458('0x2d')]=qs[_0x0458('0x2d')](_0x2905a4[_0x0458('0x3d')][_0x0458('0x2d')]);}_0x754d74[_0x0458('0x45')]=qs[_0x0458('0x46')](_0x2905a4[_0x0458('0x3d')]['sort']);_0x754d74[_0x0458('0x47')]=qs[_0x0458('0x3f')](_[_0x0458('0x48')](_0x2905a4[_0x0458('0x3d')],_0x2ff3ab[_0x0458('0x3f')]),_0xe28213);if(_0x2905a4['query']['filter']){_0x754d74['where']=_[_0x0458('0x49')](_0x754d74['where'],{'$or':_[_0x0458('0x38')](_0xe28213,function(_0x3ff470){if(_0x3ff470[_0x0458('0x4a')]!==_0x0458('0x4b')){var _0x1c2362={};_0x1c2362[_0x3ff470['name']]={'$like':'%'+_0x2905a4['query'][_0x0458('0x4c')]+'%'};return _0x1c2362;}})});}_0x754d74=_[_0x0458('0x49')]({},_0x754d74,_0x2905a4[_0x0458('0x4d')]);var _0x541ae4={'where':_0x754d74[_0x0458('0x47')]};return db[_0x0458('0x39')][_0x0458('0x30')](_0x541ae4)[_0x0458('0x34')](function(_0x349d32){_0x4d57a3[_0x0458('0x30')]=_0x349d32;if(_0x2905a4['query'][_0x0458('0x4e')]){_0x754d74['include']=[{'all':!![]}];}return db['ChatMessage'][_0x0458('0x4f')](_0x754d74);})[_0x0458('0x34')](function(_0x170ce8){_0x4d57a3[_0x0458('0x50')]=_0x170ce8;return _0x4d57a3;})[_0x0458('0x34')](respondWithFilteredResult(_0x1e45b5,_0x754d74))[_0x0458('0x28')](handleError(_0x1e45b5,null));};exports[_0x0458('0x51')]=function(_0x2e76b4,_0x3a4ba6){var _0x32c3dd={'raw':!![],'where':{'id':_0x2e76b4['params']['id']}},_0x7768f={};_0x7768f[_0x0458('0x3c')]=_[_0x0458('0x3e')](db[_0x0458('0x39')][_0x0458('0x3a')]);_0x7768f[_0x0458('0x3d')]=_['keys'](_0x2e76b4[_0x0458('0x3d')]);_0x7768f[_0x0458('0x3f')]=_[_0x0458('0x40')](_0x7768f['model'],_0x7768f[_0x0458('0x3d')]);_0x32c3dd[_0x0458('0x42')]=_[_0x0458('0x40')](_0x7768f[_0x0458('0x3c')],qs[_0x0458('0x41')](_0x2e76b4[_0x0458('0x3d')][_0x0458('0x41')]));_0x32c3dd[_0x0458('0x42')]=_0x32c3dd[_0x0458('0x42')][_0x0458('0x43')]?_0x32c3dd[_0x0458('0x42')]:_0x7768f[_0x0458('0x3c')];if(_0x2e76b4[_0x0458('0x3d')][_0x0458('0x4e')]){_0x32c3dd[_0x0458('0x52')]=[{'all':!![]}];}_0x32c3dd=_[_0x0458('0x49')]({},_0x32c3dd,_0x2e76b4['options']);return db['ChatMessage'][_0x0458('0x53')](_0x32c3dd)[_0x0458('0x34')](handleEntityNotFound(_0x3a4ba6,null))[_0x0458('0x34')](respondWithResult(_0x3a4ba6,null))[_0x0458('0x28')](handleError(_0x3a4ba6,null));};exports[_0x0458('0x54')]=function(_0x38cf6d,_0x1f14c5){return db[_0x0458('0x39')][_0x0458('0x54')](_0x38cf6d[_0x0458('0x55')],{})[_0x0458('0x34')](respondWithResult(_0x1f14c5,0xc9))[_0x0458('0x28')](handleError(_0x1f14c5,null));};exports['update']=function(_0x4014e3,_0x58857e){if(_0x4014e3['body']['id']){delete _0x4014e3[_0x0458('0x55')]['id'];}return db[_0x0458('0x39')][_0x0458('0x53')]({'where':{'id':_0x4014e3['params']['id']}})[_0x0458('0x34')](handleEntityNotFound(_0x58857e,null))['then'](saveUpdates(_0x4014e3[_0x0458('0x55')],null))[_0x0458('0x34')](respondWithResult(_0x58857e,null))[_0x0458('0x28')](handleError(_0x58857e,null));};exports[_0x0458('0x35')]=function(_0x3bbc80,_0x4fb1cb){return db[_0x0458('0x39')][_0x0458('0x53')]({'where':{'id':_0x3bbc80[_0x0458('0x56')]['id']}})[_0x0458('0x34')](handleEntityNotFound(_0x4fb1cb,null))[_0x0458('0x34')](removeEntity(_0x4fb1cb,null))[_0x0458('0x28')](handleError(_0x4fb1cb,null));};exports[_0x0458('0x57')]=function(_0x5bae36,_0x6bb4c1){return db['ChatMessage'][_0x0458('0x57')]()[_0x0458('0x34')](respondWithResult(_0x6bb4c1,null))['catch'](handleError(_0x6bb4c1,null));};var interaction_log=require(_0x0458('0x58'))(_0x0458('0x59'));exports[_0x0458('0x5a')]=function(_0x1d09ed,_0xa4a72a,_0x55693d){var _0x58654c={'agent':{},'channel':_0x0458('0x5b')};if(_0x1d09ed[_0x0458('0x55')]['id']){delete _0x1d09ed[_0x0458('0x55')]['id'];}_0x1d09ed[_0x0458('0x55')][_0x0458('0x5c')]=!![];_0x1d09ed[_0x0458('0x55')][_0x0458('0x5d')]=moment()[_0x0458('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x1d09ed[_0x0458('0x55')][_0x0458('0x5f')]=_0x1d09ed[_0x0458('0x55')][_0x0458('0x5f')]||_0x1d09ed['user']['id'];_0x58654c['agent']['id']=_0x1d09ed[_0x0458('0x55')][_0x0458('0x5f')];return db[_0x0458('0x39')]['find']({'where':{'id':_0x1d09ed[_0x0458('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xa4a72a,null))[_0x0458('0x34')](saveUpdates(_0x1d09ed['body'],null))['then'](function(_0x362f5b){if(_0x362f5b){_0x58654c[_0x0458('0x26')]=_0x362f5b[_0x0458('0x60')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x362f5b[_0x0458('0x61')]}});}return null;})[_0x0458('0x34')](handleEntityNotFound(_0xa4a72a,null))[_0x0458('0x34')](function(_0x59cbc7){if(_0x59cbc7){return _0x59cbc7[_0x0458('0x62')]({'UserId':_0x1d09ed[_0x0458('0x55')][_0x0458('0x5f')],'read1stAt':_[_0x0458('0x63')](_0x59cbc7[_0x0458('0x64')])?moment()[_0x0458('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x31da7f){if(_0x31da7f){_0x58654c[_0x0458('0x65')]=_0x31da7f[_0x0458('0x60')]({'plain':!![]});interaction_log[_0x0458('0x20')](_0x0458('0x66'),_0x1d09ed[_0x0458('0x67')]['id'],_0x1d09ed[_0x0458('0x67')][_0x0458('0x36')],_0x1d09ed[_0x0458('0x67')][_0x0458('0x68')],_0x58654c[_0x0458('0x65')]['id'],_0x1d09ed[_0x0458('0x55')]?JSON[_0x0458('0x24')](_0x1d09ed['body']):_0x0458('0x69'));return respondWithRpcPromise(_0x0458('0x6a'),_0x0458('0x6b'),_0x58654c);}return null;})[_0x0458('0x34')](function(_0x2b9446){var _0x2df0a8='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2b9446[_0x0458('0x26')][_0x0458('0x6c')];return db[_0x0458('0x6d')][_0x0458('0x3d')](_0x2df0a8,{'type':db[_0x0458('0x6e')][_0x0458('0x6f')][_0x0458('0x70')],'raw':!![]})[_0x0458('0x34')](function(_0x2ad9f0){return _0x2ad9f0;});})[_0x0458('0x34')](function(_0x4ea3f0){if(_0x4ea3f0){_0x58654c['message'][_0x0458('0x71')]=_0x4ea3f0[0x0];if(!_0x1d09ed[_0x0458('0x55')][_0x0458('0x5f')])return;return db[_0x0458('0x72')][_0x0458('0x53')]({'where':{'id':_0x1d09ed[_0x0458('0x55')][_0x0458('0x5f')],'role':_0x0458('0x73')},'attributes':['id','name',_0x0458('0x74'),_0x0458('0x75'),_0x0458('0x76')],'raw':!![]});}return null;})[_0x0458('0x34')](function(_0x1aaf65){if(!_0x1aaf65)return null;_0x58654c[_0x0458('0x26')][_0x0458('0x73')]=_0x1aaf65;return _0x58654c;})[_0x0458('0x34')](function(_0x17c782){if(_0x17c782){if(_0x1d09ed['body']['manual']){_0x58654c[_0x0458('0x26')][_0x0458('0x77')]=util[_0x0458('0x5e')]('SIP/%s',_0x1d09ed[_0x0458('0x67')]['name']);_0x58654c[_0x0458('0x26')][_0x0458('0x78')]=_0x58654c[_0x0458('0x78')];_0x58654c['message'][_0x0458('0x79')]=_0x58654c[_0x0458('0x78')];_0x58654c['message']['event']='accept';return respondWithRpcPromise(_0x0458('0x7a'),_0x0458('0x7a'),{'event':'acceptmessage','message':_[_0x0458('0x49')](_0x58654c[_0x0458('0x26')],JSON[_0x0458('0x7b')](_0x58654c['interaction']['formData']))},client9002)[_0x0458('0x34')](function(){return _0x58654c;});}return _0x58654c;}return null;})[_0x0458('0x34')](respondWithResult(_0xa4a72a,null))[_0x0458('0x28')](handleError(_0xa4a72a,null));};var interaction_log=require(_0x0458('0x58'))(_0x0458('0x59'));exports[_0x0458('0x33')]=function(_0x4be26d,_0x3d7ff0,_0x2e72eb){var _0x58b3be={'agent':{},'channel':_0x0458('0x5b')};if(_0x4be26d[_0x0458('0x55')]['id']){delete _0x4be26d[_0x0458('0x55')]['id'];}_0x4be26d[_0x0458('0x55')][_0x0458('0x5f')]=_0x4be26d[_0x0458('0x55')]['UserId']||_0x4be26d[_0x0458('0x67')]['id'];_0x58b3be[_0x0458('0x73')]['id']=_0x4be26d[_0x0458('0x55')]['UserId'];return db['ChatMessage'][_0x0458('0x53')]({'where':{'id':_0x4be26d['params']['id'],'UserId':null}})[_0x0458('0x34')](handleEntityNotFound(_0x3d7ff0,null))[_0x0458('0x34')](function(_0x3636b6){if(_0x3636b6){_0x58b3be[_0x0458('0x26')]=_0x3636b6['get']({'plain':!![]});return db[_0x0458('0x7c')]['find']({'where':{'id':_0x3636b6[_0x0458('0x61')]}});}return null;})[_0x0458('0x34')](handleEntityNotFound(_0x3d7ff0,null))['then'](function(_0x4c8e5e){if(_0x4c8e5e){_0x58b3be[_0x0458('0x65')]=_0x4c8e5e[_0x0458('0x60')]({'plain':!![]});interaction_log[_0x0458('0x20')](_0x0458('0x7d'),_0x4be26d[_0x0458('0x67')]['id'],_0x4be26d[_0x0458('0x67')][_0x0458('0x36')],_0x4be26d[_0x0458('0x67')]['role'],_0x58b3be[_0x0458('0x65')]['id'],_0x4be26d[_0x0458('0x55')]?JSON[_0x0458('0x24')](_0x4be26d[_0x0458('0x55')]):_0x0458('0x69'));return respondWithRpcPromise(_0x0458('0x7e'),_0x0458('0x7f'),_0x58b3be);}return null;})[_0x0458('0x34')](function(_0x2eac78){var _0x3ed047=_0x0458('0x80')+_0x2eac78[_0x0458('0x26')][_0x0458('0x6c')];return db[_0x0458('0x6d')][_0x0458('0x3d')](_0x3ed047,{'type':db[_0x0458('0x6e')][_0x0458('0x6f')][_0x0458('0x70')],'raw':!![]})['then'](function(_0x36a2e6){return _0x36a2e6;});})[_0x0458('0x34')](function(_0x4fc6ef){if(_0x4fc6ef){_0x58b3be[_0x0458('0x26')][_0x0458('0x71')]=_0x4fc6ef[0x0];if(!_0x4be26d['body'][_0x0458('0x5f')])return;return db['User'][_0x0458('0x53')]({'where':{'id':_0x4be26d['body'][_0x0458('0x5f')],'role':_0x0458('0x73')},'attributes':['id',_0x0458('0x36'),'fullname','email','internal'],'raw':!![]});}return null;})[_0x0458('0x34')](function(_0xcd6c6e){if(!_0xcd6c6e)return null;_0x58b3be[_0x0458('0x26')][_0x0458('0x73')]=_0xcd6c6e;return _0x58b3be;})['then'](function(_0x215598){if(_0x215598){_0x215598[_0x0458('0x26')][_0x0458('0x77')]=util['format'](_0x0458('0x81'),_0x4be26d[_0x0458('0x67')][_0x0458('0x36')]);_0x215598[_0x0458('0x26')][_0x0458('0x78')]=_0x58b3be['channel'];_0x215598[_0x0458('0x26')][_0x0458('0x79')]=_0x58b3be[_0x0458('0x78')];_0x215598[_0x0458('0x26')][_0x0458('0x82')]=_0x0458('0x33');respondWithRpcPromise(_0x0458('0x7a'),_0x0458('0x7a'),{'event':_0x0458('0x83'),'message':_[_0x0458('0x49')](_0x58b3be['message'],JSON[_0x0458('0x7b')](_0x58b3be[_0x0458('0x65')][_0x0458('0x84')]))},client9002);return _0x58b3be;}return null;})[_0x0458('0x34')](respondWithResult(_0x3d7ff0,null))[_0x0458('0x28')](handleError(_0x3d7ff0,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 769a6a0..678d198 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 _0x54aa=['../../mysqldb','ChatMessage','save','emit','exports','events'];(function(_0x238cd5,_0x5eaefc){var _0x196bfb=function(_0x5c7d53){while(--_0x5c7d53){_0x238cd5['push'](_0x238cd5['shift']());}};_0x196bfb(++_0x5eaefc);}(_0x54aa,0x1a9));var _0xa54a=function(_0x596c48,_0x5f4b40){_0x596c48=_0x596c48-0x0;var _0x2508d0=_0x54aa[_0x596c48];return _0x2508d0;};'use strict';var EventEmitter=require(_0xa54a('0x0'));var ChatMessage=require(_0xa54a('0x1'))['db'][_0xa54a('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa54a('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x11e72c){return function(_0x53829d,_0x5147b6,_0x35d176){ChatMessageEvents['emit'](_0x11e72c+':'+_0x53829d['id'],_0x53829d);ChatMessageEvents[_0xa54a('0x4')](_0x11e72c,_0x53829d);_0x35d176(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xa54a('0x5')]=ChatMessageEvents;
\ No newline at end of file
+var _0x6e6d=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0x1e4a4a,_0x625229){var _0x215c1d=function(_0x2d6a79){while(--_0x2d6a79){_0x1e4a4a['push'](_0x1e4a4a['shift']());}};_0x215c1d(++_0x625229);}(_0x6e6d,0x7d));var _0xd6e6=function(_0x3c6022,_0x5c4610){_0x3c6022=_0x3c6022-0x0;var _0x54fcd2=_0x6e6d[_0x3c6022];return _0x54fcd2;};'use strict';var EventEmitter=require(_0xd6e6('0x0'));var ChatMessage=require(_0xd6e6('0x1'))['db'][_0xd6e6('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xd6e6('0x3')](0x0);var events={'afterCreate':_0xd6e6('0x4'),'afterUpdate':_0xd6e6('0x5'),'afterDestroy':_0xd6e6('0x6')};function emitEvent(_0x143fc1){return function(_0x39747c,_0x23e654,_0x4d9e98){ChatMessageEvents[_0xd6e6('0x7')](_0x143fc1+':'+_0x39747c['id'],_0x39747c);ChatMessageEvents[_0xd6e6('0x7')](_0x143fc1,_0x39747c);_0x4d9e98(null);};}for(var e in events){if(events[_0xd6e6('0x8')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xd6e6('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 dbbf3f3..c4de903 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 _0x1403=['secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','createdAt','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out'];(function(_0x289874,_0x1b6752){var _0x2f8bbb=function(_0x23ee80){while(--_0x23ee80){_0x289874['push'](_0x289874['shift']());}};_0x2f8bbb(++_0x1b6752);}(_0x1403,0x9b));var _0x3140=function(_0x4873e7,_0xadd09b){_0x4873e7=_0x4873e7-0x0;var _0x589ef4=_0x1403[_0x4873e7];return _0x589ef4;};'use strict';var _=require('lodash');var util=require(_0x3140('0x0'));var logger=require(_0x3140('0x1'))(_0x3140('0x2'));var moment=require(_0x3140('0x3'));var BPromise=require(_0x3140('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3140('0x5'));var rimraf=require(_0x3140('0x6'));var config=require(_0x3140('0x7'));var attributes=require(_0x3140('0x8'));module['exports']=function(_0x5cb034,_0x5cfeb0){return _0x5cb034[_0x3140('0x9')](_0x3140('0xa'),attributes,{'tableName':_0x3140('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x3140('0xc')],'type':_0x3140('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47d0f4,_0x269c6b,_0xa63ba6){var _0x2491e3=_0x5cb034[_0x3140('0xe')];var _0x35818a=_0x47d0f4[_0x3140('0xf')]({'plain':!![]});if(_0x35818a[_0x3140('0x10')][_0x3140('0x11')]()==='in'||_0x35818a[_0x3140('0x10')][_0x3140('0x11')]()===_0x3140('0x12')&&!_0x35818a[_0x3140('0x13')]&&!_[_0x3140('0x14')](_0x35818a[_0x3140('0x15')])){_0x2491e3[_0x3140('0x16')][_0x3140('0x17')]({'where':{'id':_0x35818a[_0x3140('0x18')]}})['then'](function(_0x505750){if(_0x505750){_0x505750['update']({'lastMsgAt':_0x35818a[_0x3140('0x19')],'lastMsgDirection':_0x35818a[_0x3140('0x10')][_0x3140('0x11')]()});}})['catch'](function(_0x136b5b){console[_0x3140('0x1a')](_0x136b5b);});}_0xa63ba6();}},'charset':_0x3140('0x1b'),'collate':_0x3140('0x1c')});};
\ No newline at end of file
+var _0xccfc=['then','update','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./chatMessage.attributes','ChatMessage','chat_messages','body','FULLTEXT','models','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId'];(function(_0x176108,_0x21f3b8){var _0x1f2f7c=function(_0x32a8b4){while(--_0x32a8b4){_0x176108['push'](_0x176108['shift']());}};_0x1f2f7c(++_0x21f3b8);}(_0xccfc,0x19a));var _0xcccf=function(_0x50b94a,_0x3445be){_0x50b94a=_0x50b94a-0x0;var _0x38b60c=_0xccfc[_0x50b94a];return _0x38b60c;};'use strict';var _=require(_0xcccf('0x0'));var util=require(_0xcccf('0x1'));var logger=require('../../config/logger')(_0xcccf('0x2'));var moment=require(_0xcccf('0x3'));var BPromise=require(_0xcccf('0x4'));var rp=require(_0xcccf('0x5'));var fs=require('fs');var path=require(_0xcccf('0x6'));var rimraf=require(_0xcccf('0x7'));var config=require('../../config/environment');var attributes=require(_0xcccf('0x8'));module['exports']=function(_0x57f6e2,_0x74b960){return _0x57f6e2['define'](_0xcccf('0x9'),attributes,{'tableName':_0xcccf('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xcccf('0xb')],'type':_0xcccf('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xcbcef8,_0x5f269f,_0x1eb048){var _0xb95854=_0x57f6e2[_0xcccf('0xd')];var _0x6c691=_0xcbcef8['get']({'plain':!![]});if(_0x6c691[_0xcccf('0xe')][_0xcccf('0xf')]()==='in'||_0x6c691['direction']['toLowerCase']()==='out'&&!_0x6c691[_0xcccf('0x10')]&&!_[_0xcccf('0x11')](_0x6c691[_0xcccf('0x12')])){_0xb95854[_0xcccf('0x13')][_0xcccf('0x14')]({'where':{'id':_0x6c691[_0xcccf('0x15')]}})[_0xcccf('0x16')](function(_0x2a8cc9){if(_0x2a8cc9){_0x2a8cc9[_0xcccf('0x17')]({'lastMsgAt':_0x6c691[_0xcccf('0x18')],'lastMsgDirection':_0x6c691[_0xcccf('0xe')][_0xcccf('0xf')]()});}})['catch'](function(_0x12050e){console['error'](_0x12050e);});}_0x1eb048();}},'charset':_0xcccf('0x19'),'collate':_0xcccf('0x1a')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 2aa7d8b..4dc7d2b 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 _0xd399=['http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','result','catch','ChatMessage','create','body','options','CreateChatMessage','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x3251d0,_0x4d310c){var _0x28dd57=function(_0x19bcb4){while(--_0x19bcb4){_0x3251d0['push'](_0x3251d0['shift']());}};_0x28dd57(++_0x4d310c);}(_0xd399,0x181));var _0x9d39=function(_0x4d71b7,_0x3a110d){_0x4d71b7=_0x4d71b7-0x0;var _0x252631=_0xd399[_0x4d71b7];return _0x252631;};'use strict';var _=require(_0x9d39('0x0'));var util=require(_0x9d39('0x1'));var moment=require(_0x9d39('0x2'));var BPromise=require(_0x9d39('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d39('0x4'));var db=require(_0x9d39('0x5'))['db'];var utils=require(_0x9d39('0x6'));var logger=require(_0x9d39('0x7'))(_0x9d39('0x8'));var config=require('../../config/environment');var jayson=require(_0x9d39('0x9'));var client=jayson[_0x9d39('0xa')][_0x9d39('0xb')]({'port':0x232a});config['redis']=_[_0x9d39('0xc')](config[_0x9d39('0xd')],{'host':_0x9d39('0xe'),'port':0x18eb});var socket=require(_0x9d39('0xf'))(new Redis(config[_0x9d39('0xd')]));require(_0x9d39('0x10'))[_0x9d39('0x11')](socket);function respondWithRpcPromise(_0x482e61,_0x49a963,_0x1b4583){return new BPromise(function(_0x17d13e,_0x43572f){return client[_0x9d39('0x12')](_0x482e61,_0x1b4583)[_0x9d39('0x13')](function(_0x2886e6){logger[_0x9d39('0x14')]('ChatMessage,\x20%s,\x20%s',_0x49a963,'request\x20sent');logger[_0x9d39('0x15')](_0x9d39('0x16'),_0x49a963,_0x9d39('0x17'),JSON[_0x9d39('0x18')](_0x2886e6));if(_0x2886e6[_0x9d39('0x19')]){if(_0x2886e6[_0x9d39('0x19')][_0x9d39('0x1a')]===0x1f4){logger[_0x9d39('0x19')]('ChatMessage,\x20%s,\x20%s',_0x49a963,_0x2886e6[_0x9d39('0x19')][_0x9d39('0x1b')]);return _0x43572f(_0x2886e6[_0x9d39('0x19')][_0x9d39('0x1b')]);}logger[_0x9d39('0x19')]('ChatMessage,\x20%s,\x20%s',_0x49a963,_0x2886e6[_0x9d39('0x19')][_0x9d39('0x1b')]);return _0x17d13e(_0x2886e6[_0x9d39('0x19')]['message']);}else{logger['info'](_0x9d39('0x1c'),_0x49a963,_0x9d39('0x17'));_0x17d13e(_0x2886e6[_0x9d39('0x1d')]['message']);}})[_0x9d39('0x1e')](function(_0x8f9a6c){logger[_0x9d39('0x19')](_0x9d39('0x1c'),_0x49a963,_0x8f9a6c);_0x43572f(_0x8f9a6c);});});}exports['CreateChatMessage']=function(_0x48c2fd){var _0x750458=this;return new Promise(function(_0x284f67,_0xd2ced7){return db[_0x9d39('0x1f')][_0x9d39('0x20')](_0x48c2fd[_0x9d39('0x21')],{'raw':_0x48c2fd[_0x9d39('0x22')]?_0x48c2fd['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x23f0fe){logger[_0x9d39('0x14')](_0x9d39('0x23'),_0x48c2fd);logger[_0x9d39('0x15')](_0x9d39('0x23'),_0x48c2fd,JSON['stringify'](_0x23f0fe));_0x284f67(_0x23f0fe);})[_0x9d39('0x1e')](function(_0x406060){logger[_0x9d39('0x19')](_0x9d39('0x23'),_0x406060['message'],_0x48c2fd);_0xd2ced7(_0x750458[_0x9d39('0x19')](0x1f4,_0x406060[_0x9d39('0x1b')]));});});};
\ No newline at end of file
+var _0xa40d=['body','options','raw','info','CreateChatMessage','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ChatMessage','create'];(function(_0x629f05,_0x3f7c6f){var _0x4119ea=function(_0x5b3ba2){while(--_0x5b3ba2){_0x629f05['push'](_0x629f05['shift']());}};_0x4119ea(++_0x3f7c6f);}(_0xa40d,0x140));var _0xda40=function(_0x3e29df,_0x42fdf8){_0x3e29df=_0x3e29df-0x0;var _0x3e3ba9=_0xa40d[_0x3e29df];return _0x3e3ba9;};'use strict';var _=require(_0xda40('0x0'));var util=require(_0xda40('0x1'));var moment=require(_0xda40('0x2'));var BPromise=require(_0xda40('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda40('0x4'));var db=require(_0xda40('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xda40('0x6'))(_0xda40('0x7'));var config=require('../../config/environment');var jayson=require(_0xda40('0x8'));var client=jayson[_0xda40('0x9')][_0xda40('0xa')]({'port':0x232a});config[_0xda40('0xb')]=_[_0xda40('0xc')](config[_0xda40('0xb')],{'host':_0xda40('0xd'),'port':0x18eb});var socket=require(_0xda40('0xe'))(new Redis(config[_0xda40('0xb')]));require(_0xda40('0xf'))[_0xda40('0x10')](socket);function respondWithRpcPromise(_0x87c09f,_0x57e818,_0x828ace){return new BPromise(function(_0x4fdf7,_0x4008cb){return client[_0xda40('0x11')](_0x87c09f,_0x828ace)[_0xda40('0x12')](function(_0x2099a8){logger['info'](_0xda40('0x13'),_0x57e818,_0xda40('0x14'));logger[_0xda40('0x15')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x57e818,_0xda40('0x14'),JSON[_0xda40('0x16')](_0x2099a8));if(_0x2099a8[_0xda40('0x17')]){if(_0x2099a8['error'][_0xda40('0x18')]===0x1f4){logger['error'](_0xda40('0x13'),_0x57e818,_0x2099a8[_0xda40('0x17')][_0xda40('0x19')]);return _0x4008cb(_0x2099a8['error'][_0xda40('0x19')]);}logger[_0xda40('0x17')](_0xda40('0x13'),_0x57e818,_0x2099a8[_0xda40('0x17')][_0xda40('0x19')]);return _0x4fdf7(_0x2099a8[_0xda40('0x17')]['message']);}else{logger['info'](_0xda40('0x13'),_0x57e818,_0xda40('0x14'));_0x4fdf7(_0x2099a8[_0xda40('0x1a')][_0xda40('0x19')]);}})[_0xda40('0x1b')](function(_0x1a2770){logger[_0xda40('0x17')](_0xda40('0x13'),_0x57e818,_0x1a2770);_0x4008cb(_0x1a2770);});});}exports['CreateChatMessage']=function(_0x289bd5){var _0x50eed8=this;return new Promise(function(_0x303d45,_0x207410){return db[_0xda40('0x1c')][_0xda40('0x1d')](_0x289bd5[_0xda40('0x1e')],{'raw':_0x289bd5['options']?_0x289bd5[_0xda40('0x1f')][_0xda40('0x20')]===undefined?!![]:![]:!![]})[_0xda40('0x12')](function(_0x4eb632){logger[_0xda40('0x21')](_0xda40('0x22'),_0x289bd5);logger[_0xda40('0x15')](_0xda40('0x22'),_0x289bd5,JSON[_0xda40('0x16')](_0x4eb632));_0x303d45(_0x4eb632);})[_0xda40('0x1b')](function(_0xaa3258){logger['error'](_0xda40('0x22'),_0xaa3258[_0xda40('0x19')],_0x289bd5);_0x207410(_0x50eed8[_0xda40('0x17')](0x1f4,_0xaa3258['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index a467ca0..f173584 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 _0x60c2=['removeListener','register','length','save','remove','update','emit'];(function(_0x527771,_0x466d7b){var _0x1e9a21=function(_0x67cad8){while(--_0x67cad8){_0x527771['push'](_0x527771['shift']());}};_0x1e9a21(++_0x466d7b);}(_0x60c2,0x8f));var _0x260c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x60c2[_0xa464c9];return _0x3d73c4;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x260c('0x0'),_0x260c('0x1'),_0x260c('0x2')];function createListener(_0x3ad4c5,_0x2f5bc8){return function(_0x759b92){_0x2f5bc8[_0x260c('0x3')](_0x3ad4c5,_0x759b92);};}function removeListener(_0x309bde,_0x17a599){return function(){ChatMessageEvents[_0x260c('0x4')](_0x309bde,_0x17a599);};}exports[_0x260c('0x5')]=function(_0x13c7d0){for(var _0x558b0c=0x0,_0x14fab2=events[_0x260c('0x6')];_0x558b0c<_0x14fab2;_0x558b0c++){var _0x3b432d=events[_0x558b0c];var _0xf22c37=createListener('chatMessage:'+_0x3b432d,_0x13c7d0);ChatMessageEvents['on'](_0x3b432d,_0xf22c37);}};
\ No newline at end of file
+var _0xb66c=['chatMessage:','./chatMessage.events','remove','removeListener','register','length'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0xb66c,0x175));var _0xcb66=function(_0xc5d436,_0x3fb8b8){_0xc5d436=_0xc5d436-0x0;var _0x1ac952=_0xb66c[_0xc5d436];return _0x1ac952;};'use strict';var ChatMessageEvents=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(){ChatMessageEvents[_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);ChatMessageEvents['on'](_0xa3993,_0x439f3d);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 69bfecb..ed5aee1 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 _0x3dcb=['../../config/environment','isAuthenticated','get','/describe','describe','show','post','chat','chatmessage:create','create','put','/:id','update','/:id/accept','/:id/reject','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x29e24c,_0x168327){var _0x1bfa32=function(_0x46f400){while(--_0x46f400){_0x29e24c['push'](_0x29e24c['shift']());}};_0x1bfa32(++_0x168327);}(_0x3dcb,0x13d));var _0xb3dc=function(_0x4f5a83,_0x2e5c25){_0x4f5a83=_0x4f5a83-0x0;var _0xd165f9=_0x3dcb[_0x4f5a83];return _0xd165f9;};'use strict';var multer=require(_0xb3dc('0x0'));var util=require(_0xb3dc('0x1'));var path=require(_0xb3dc('0x2'));var timeout=require(_0xb3dc('0x3'));var express=require('express');var router=express[_0xb3dc('0x4')]();var fs_extra=require(_0xb3dc('0x5'));var auth=require(_0xb3dc('0x6'));var interaction=require(_0xb3dc('0x7'));var config=require(_0xb3dc('0x8'));var controller=require('./chatMessage.controller');router['get']('/',auth[_0xb3dc('0x9')](),controller['index']);router[_0xb3dc('0xa')](_0xb3dc('0xb'),auth[_0xb3dc('0x9')](),controller[_0xb3dc('0xc')]);router[_0xb3dc('0xa')]('/:id',auth[_0xb3dc('0x9')](),controller[_0xb3dc('0xd')]);router[_0xb3dc('0xe')]('/',auth[_0xb3dc('0x9')](),interaction['tracked'](_0xb3dc('0xf'),_0xb3dc('0x10')),controller[_0xb3dc('0x11')]);router[_0xb3dc('0x12')](_0xb3dc('0x13'),controller[_0xb3dc('0x14')]);router['put'](_0xb3dc('0x15'),auth['isAuthenticated'](),controller['accept']);router[_0xb3dc('0x12')](_0xb3dc('0x16'),auth[_0xb3dc('0x9')](),controller['reject']);router[_0xb3dc('0x17')]('/:id',auth[_0xb3dc('0x9')](),controller[_0xb3dc('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0x7b6e=['reject','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','chatmessage:create','create','update','put','/:id/accept','accept'];(function(_0x4bddb3,_0x54faf0){var _0x198ed7=function(_0x263bd7){while(--_0x263bd7){_0x4bddb3['push'](_0x4bddb3['shift']());}};_0x198ed7(++_0x54faf0);}(_0x7b6e,0x117));var _0xe7b6=function(_0x132887,_0x8a429e){_0x132887=_0x132887-0x0;var _0x4edd79=_0x7b6e[_0x132887];return _0x4edd79;};'use strict';var multer=require('multer');var util=require(_0xe7b6('0x0'));var path=require('path');var timeout=require(_0xe7b6('0x1'));var express=require(_0xe7b6('0x2'));var router=express[_0xe7b6('0x3')]();var fs_extra=require(_0xe7b6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe7b6('0x5'));var config=require(_0xe7b6('0x6'));var controller=require(_0xe7b6('0x7'));router[_0xe7b6('0x8')]('/',auth[_0xe7b6('0x9')](),controller[_0xe7b6('0xa')]);router['get']('/describe',auth[_0xe7b6('0x9')](),controller[_0xe7b6('0xb')]);router[_0xe7b6('0x8')](_0xe7b6('0xc'),auth[_0xe7b6('0x9')](),controller[_0xe7b6('0xd')]);router[_0xe7b6('0xe')]('/',auth[_0xe7b6('0x9')](),interaction['tracked']('chat',_0xe7b6('0xf')),controller[_0xe7b6('0x10')]);router['put']('/:id',controller[_0xe7b6('0x11')]);router[_0xe7b6('0x12')](_0xe7b6('0x13'),auth[_0xe7b6('0x9')](),controller[_0xe7b6('0x14')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0xe7b6('0x15')]);router[_0xe7b6('0x16')]('/:id',auth[_0xe7b6('0x9')](),controller[_0xe7b6('0x17')]);module[_0xe7b6('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index ff5c171..265d42b 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 _0x757a=['exports','TEXT'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x757a,0xde));var _0xa757=function(_0x10734c,_0x5ba664){_0x10734c=_0x10734c-0x0;var _0x40e81d=_0x757a[_0x10734c];return _0x40e81d;};'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
+var _0x5f66=['medium','TEXT','exports'];(function(_0x40d042,_0x3ed545){var _0x5b4901=function(_0x3a0f75){while(--_0x3a0f75){_0x40d042['push'](_0x40d042['shift']());}};_0x5b4901(++_0x3ed545);}(_0x5f66,0x1a0));var _0x65f6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5f66[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 525bd4b..64906a6 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(_0x495e47,_0x1cfb0e){var _0x2ce11c=function(_0x43057f){while(--_0x43057f){_0x495e47['push'](_0x495e47['shift']());}};_0x2ce11c(++_0x1cfb0e);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'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(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0x7a54,0x106));var _0x47a5=function(_0x5b5088,_0xa04f3f){_0x5b5088=_0x5b5088-0x0;var _0x22f947=_0x7a54[_0x5b5088];return _0x22f947;};'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 712d6eb..8bc93d3 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 _0xa6a4=['emit','hasOwnProperty','hook','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove'];(function(_0x43fba9,_0x36b884){var _0x24cb3e=function(_0x7f8441){while(--_0x7f8441){_0x43fba9['push'](_0x43fba9['shift']());}};_0x24cb3e(++_0x36b884);}(_0xa6a4,0xe9));var _0x4a6a=function(_0x43fb6b,_0xd25c0f){_0x43fb6b=_0x43fb6b-0x0;var _0x16dd9e=_0xa6a4[_0x43fb6b];return _0x16dd9e;};'use strict';var EventEmitter=require(_0x4a6a('0x0'));var ChatOfflineMessage=require(_0x4a6a('0x1'))['db'][_0x4a6a('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x4a6a('0x3')](0x0);var events={'afterCreate':_0x4a6a('0x4'),'afterUpdate':_0x4a6a('0x5'),'afterDestroy':_0x4a6a('0x6')};function emitEvent(_0x1d70ef){return function(_0x5f53ea,_0x4a946a,_0x36aa0c){ChatOfflineMessageEvents[_0x4a6a('0x7')](_0x1d70ef+':'+_0x5f53ea['id'],_0x5f53ea);ChatOfflineMessageEvents[_0x4a6a('0x7')](_0x1d70ef,_0x5f53ea);_0x36aa0c(null);};}for(var e in events){if(events[_0x4a6a('0x8')](e)){var event=events[e];ChatOfflineMessage[_0x4a6a('0x9')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x6a33=['hook','exports','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x48b819,_0x5159df){var _0x16b470=function(_0x46083e){while(--_0x46083e){_0x48b819['push'](_0x48b819['shift']());}};_0x16b470(++_0x5159df);}(_0x6a33,0x9b));var _0x36a3=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x6a33[_0x47fd36];return _0x21a0fc;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require('../../mysqldb')['db'][_0x36a3('0x0')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x36a3('0x1')](0x0);var events={'afterCreate':_0x36a3('0x2'),'afterUpdate':_0x36a3('0x3'),'afterDestroy':_0x36a3('0x4')};function emitEvent(_0x441486){return function(_0x3c14af,_0x99f59b,_0x46bb4c){ChatOfflineMessageEvents[_0x36a3('0x5')](_0x441486+':'+_0x3c14af['id'],_0x3c14af);ChatOfflineMessageEvents[_0x36a3('0x5')](_0x441486,_0x3c14af);_0x46bb4c(null);};}for(var e in events){if(events[_0x36a3('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x36a3('0x7')](e,emitEvent(event));}}module[_0x36a3('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 2571d00..4efe412 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 _0x52f6=['utf8mb4','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x2493a0,_0x30e38d){var _0x261a78=function(_0x309150){while(--_0x309150){_0x2493a0['push'](_0x2493a0['shift']());}};_0x261a78(++_0x30e38d);}(_0x52f6,0x157));var _0x652f=function(_0x38448c,_0xf81883){_0x38448c=_0x38448c-0x0;var _0x441f82=_0x52f6[_0x38448c];return _0x441f82;};'use strict';var attributes=require(_0x652f('0x0'));module[_0x652f('0x1')]=function(_0x33bc2f){return _0x33bc2f[_0x652f('0x2')](_0x652f('0x3'),attributes,{'tableName':_0x652f('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x652f('0x5'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x1f46=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x2a390b,_0xf49f9b){var _0x5df10a=function(_0x115dbe){while(--_0x115dbe){_0x2a390b['push'](_0x2a390b['shift']());}};_0x5df10a(++_0xf49f9b);}(_0x1f46,0x1b4));var _0x61f4=function(_0x11cd43,_0x1e235e){_0x11cd43=_0x11cd43-0x0;var _0x5ef8d5=_0x1f46[_0x11cd43];return _0x5ef8d5;};'use strict';var attributes=require(_0x61f4('0x0'));module[_0x61f4('0x1')]=function(_0x5aeda4){return _0x5aeda4[_0x61f4('0x2')](_0x61f4('0x3'),attributes,{'tableName':_0x61f4('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x61f4('0x5'),'collate':_0x61f4('0x6')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 942cef7..29dfdd2 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 _0x6726=['request\x20sent','debug','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x46c644,_0x5eca5a){var _0x1058fa=function(_0x28073f){while(--_0x28073f){_0x46c644['push'](_0x46c644['shift']());}};_0x1058fa(++_0x5eca5a);}(_0x6726,0xdb));var _0x6672=function(_0x65c903,_0x41e920){_0x65c903=_0x65c903-0x0;var _0x23e1d7=_0x6726[_0x65c903];return _0x23e1d7;};'use strict';var _=require('lodash');var util=require(_0x6672('0x0'));var moment=require(_0x6672('0x1'));var BPromise=require('bluebird');var rs=require(_0x6672('0x2'));var fs=require('fs');var Redis=require(_0x6672('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6672('0x4'));var logger=require('../../config/logger')(_0x6672('0x5'));var config=require(_0x6672('0x6'));var jayson=require(_0x6672('0x7'));var client=jayson[_0x6672('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa1d3b7,_0x303146,_0x263321){return new BPromise(function(_0x379b90,_0xc53855){return client[_0x6672('0x9')](_0xa1d3b7,_0x263321)[_0x6672('0xa')](function(_0x3c093b){logger[_0x6672('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x303146,_0x6672('0xc'));logger[_0x6672('0xd')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x303146,_0x6672('0xc'),JSON[_0x6672('0xe')](_0x3c093b));if(_0x3c093b[_0x6672('0xf')]){if(_0x3c093b[_0x6672('0xf')][_0x6672('0x10')]===0x1f4){logger[_0x6672('0xf')](_0x6672('0x11'),_0x303146,_0x3c093b[_0x6672('0xf')][_0x6672('0x12')]);return _0xc53855(_0x3c093b['error'][_0x6672('0x12')]);}logger[_0x6672('0xf')](_0x6672('0x11'),_0x303146,_0x3c093b[_0x6672('0xf')][_0x6672('0x12')]);return _0x379b90(_0x3c093b[_0x6672('0xf')][_0x6672('0x12')]);}else{logger['info'](_0x6672('0x11'),_0x303146,_0x6672('0xc'));_0x379b90(_0x3c093b[_0x6672('0x13')][_0x6672('0x12')]);}})[_0x6672('0x14')](function(_0x6884f){logger[_0x6672('0xf')](_0x6672('0x11'),_0x303146,_0x6884f);_0xc53855(_0x6884f);});});}
\ No newline at end of file
+var _0x68b8=['request','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x68b8,0x1d8));var _0x868b=function(_0x4d8789,_0x3fdff1){_0x4d8789=_0x4d8789-0x0;var _0x404e41=_0x68b8[_0x4d8789];return _0x404e41;};'use strict';var _=require(_0x868b('0x0'));var util=require(_0x868b('0x1'));var moment=require(_0x868b('0x2'));var BPromise=require(_0x868b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x868b('0x4'));var db=require(_0x868b('0x5'))['db'];var utils=require(_0x868b('0x6'));var logger=require(_0x868b('0x7'))('rpc');var config=require(_0x868b('0x8'));var jayson=require(_0x868b('0x9'));var client=jayson['client'][_0x868b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x107cfe,_0x1d107d,_0x766ed3){return new BPromise(function(_0x17ce24,_0x157d0a){return client[_0x868b('0xb')](_0x107cfe,_0x766ed3)['then'](function(_0x53c451){logger['info'](_0x868b('0xc'),_0x1d107d,'request\x20sent');logger['debug'](_0x868b('0xd'),_0x1d107d,_0x868b('0xe'),JSON[_0x868b('0xf')](_0x53c451));if(_0x53c451[_0x868b('0x10')]){if(_0x53c451[_0x868b('0x10')][_0x868b('0x11')]===0x1f4){logger['error'](_0x868b('0xc'),_0x1d107d,_0x53c451[_0x868b('0x10')][_0x868b('0x12')]);return _0x157d0a(_0x53c451[_0x868b('0x10')][_0x868b('0x12')]);}logger['error'](_0x868b('0xc'),_0x1d107d,_0x53c451['error']['message']);return _0x17ce24(_0x53c451['error'][_0x868b('0x12')]);}else{logger['info'](_0x868b('0xc'),_0x1d107d,_0x868b('0xe'));_0x17ce24(_0x53c451[_0x868b('0x13')][_0x868b('0x12')]);}})[_0x868b('0x14')](function(_0x390010){logger[_0x868b('0x10')](_0x868b('0xc'),_0x1d107d,_0x390010);_0x157d0a(_0x390010);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index bdc43ab..f9abcc2 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 _0xe2c3=['isAuthenticated','index','describe','/:id','show','post','create','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get'];(function(_0x4f08dd,_0x3784ec){var _0x3017ee=function(_0x7d95be){while(--_0x7d95be){_0x4f08dd['push'](_0x4f08dd['shift']());}};_0x3017ee(++_0x3784ec);}(_0xe2c3,0x1c1));var _0x3e2c=function(_0x45bd84,_0x4a61bb){_0x45bd84=_0x45bd84-0x0;var _0x551b62=_0xe2c3[_0x45bd84];return _0x551b62;};'use strict';var multer=require(_0x3e2c('0x0'));var util=require(_0x3e2c('0x1'));var path=require(_0x3e2c('0x2'));var timeout=require(_0x3e2c('0x3'));var express=require('express');var router=express[_0x3e2c('0x4')]();var fs_extra=require(_0x3e2c('0x5'));var auth=require(_0x3e2c('0x6'));var interaction=require(_0x3e2c('0x7'));var config=require(_0x3e2c('0x8'));var controller=require(_0x3e2c('0x9'));router[_0x3e2c('0xa')]('/',auth[_0x3e2c('0xb')](),controller[_0x3e2c('0xc')]);router[_0x3e2c('0xa')]('/describe',auth[_0x3e2c('0xb')](),controller[_0x3e2c('0xd')]);router[_0x3e2c('0xa')](_0x3e2c('0xe'),auth[_0x3e2c('0xb')](),controller[_0x3e2c('0xf')]);router[_0x3e2c('0x10')]('/',auth[_0x3e2c('0xb')](),controller[_0x3e2c('0x11')]);router['put'](_0x3e2c('0xe'),auth[_0x3e2c('0xb')](),controller['update']);router[_0x3e2c('0x12')](_0x3e2c('0xe'),auth[_0x3e2c('0xb')](),controller['destroy']);module[_0x3e2c('0x13')]=router;
\ No newline at end of file
+var _0x6a41=['describe','/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','get','/describe'];(function(_0x426bb6,_0x14e2ea){var _0x3421ab=function(_0x341ccc){while(--_0x341ccc){_0x426bb6['push'](_0x426bb6['shift']());}};_0x3421ab(++_0x14e2ea);}(_0x6a41,0x105));var _0x16a4=function(_0xb3205f,_0x13694e){_0xb3205f=_0xb3205f-0x0;var _0x3eac2d=_0x6a41[_0xb3205f];return _0x3eac2d;};'use strict';var multer=require(_0x16a4('0x0'));var util=require(_0x16a4('0x1'));var path=require('path');var timeout=require(_0x16a4('0x2'));var express=require(_0x16a4('0x3'));var router=express[_0x16a4('0x4')]();var fs_extra=require(_0x16a4('0x5'));var auth=require(_0x16a4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x16a4('0x7'));var controller=require(_0x16a4('0x8'));router['get']('/',auth[_0x16a4('0x9')](),controller['index']);router[_0x16a4('0xa')](_0x16a4('0xb'),auth['isAuthenticated'](),controller[_0x16a4('0xc')]);router['get'](_0x16a4('0xd'),auth[_0x16a4('0x9')](),controller[_0x16a4('0xe')]);router[_0x16a4('0xf')]('/',auth[_0x16a4('0x9')](),controller[_0x16a4('0x10')]);router[_0x16a4('0x11')](_0x16a4('0xd'),auth[_0x16a4('0x9')](),controller[_0x16a4('0x12')]);router['delete']('/:id',auth[_0x16a4('0x9')](),controller[_0x16a4('0x13')]);module[_0x16a4('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index a9ac3a9..3509682 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 _0xaee1=['STRING','ENUM','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0x51f2c0,_0xb7c46e){var _0x34ffd5=function(_0x2238c0){while(--_0x2238c0){_0x51f2c0['push'](_0x51f2c0['shift']());}};_0x34ffd5(++_0xb7c46e);}(_0xaee1,0x8a));var _0x1aee=function(_0x583c9c,_0x1cfa5a){_0x583c9c=_0x583c9c-0x0;var _0x3b5d86=_0xaee1[_0x583c9c];return _0x3b5d86;};'use strict';var Sequelize=require(_0x1aee('0x0'));module[_0x1aee('0x1')]={'name':{'type':Sequelize[_0x1aee('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1aee('0x3')](_0x1aee('0x4'),_0x1aee('0x5')),'defaultValue':_0x1aee('0x4')},'selector':{'type':Sequelize[_0x1aee('0x2')]},'timeout':{'type':Sequelize[_0x1aee('0x6')]}};
\ No newline at end of file
+var _0x2f3b=['exports','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x2820c8,_0x9cc2c9){var _0x38c7ba=function(_0x80429){while(--_0x80429){_0x2820c8['push'](_0x2820c8['shift']());}};_0x38c7ba(++_0x9cc2c9);}(_0x2f3b,0xc6));var _0xb2f3=function(_0x4e64fc,_0x12bb94){_0x4e64fc=_0x4e64fc-0x0;var _0x3b6898=_0x2f3b[_0x4e64fc];return _0x3b6898;};'use strict';var Sequelize=require('sequelize');module[_0xb2f3('0x0')]={'name':{'type':Sequelize[_0xb2f3('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xb2f3('0x2')](_0xb2f3('0x3'),_0xb2f3('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xb2f3('0x1')]},'timeout':{'type':Sequelize[_0xb2f3('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index e45154a..81ccdd6 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 _0xab36=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','includeAll','include','merge','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0xb3b5ed,_0x386a22){var _0x373859=function(_0x2b71fb){while(--_0x2b71fb){_0xb3b5ed['push'](_0xb3b5ed['shift']());}};_0x373859(++_0x386a22);}(_0xab36,0x1df));var _0x6ab3=function(_0x1b673b,_0x3b3ac0){_0x1b673b=_0x1b673b-0x0;var _0x3ee6f0=_0xab36[_0x1b673b];return _0x3ee6f0;};'use strict';var emlformat=require(_0x6ab3('0x0'));var rimraf=require(_0x6ab3('0x1'));var zipdir=require(_0x6ab3('0x2'));var jsonpatch=require(_0x6ab3('0x3'));var rp=require(_0x6ab3('0x4'));var moment=require('moment');var BPromise=require(_0x6ab3('0x5'));var Mustache=require(_0x6ab3('0x6'));var util=require(_0x6ab3('0x7'));var path=require('path');var sox=require(_0x6ab3('0x8'));var csv=require(_0x6ab3('0x9'));var ejs=require(_0x6ab3('0xa'));var fs=require('fs');var fs_extra=require(_0x6ab3('0xb'));var _=require(_0x6ab3('0xc'));var squel=require(_0x6ab3('0xd'));var crypto=require('crypto');var jsforce=require(_0x6ab3('0xe'));var deskjs=require(_0x6ab3('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6ab3('0x10'));var Papa=require('papaparse');var Redis=require(_0x6ab3('0x11'));var authService=require(_0x6ab3('0x12'));var qs=require(_0x6ab3('0x13'));var as=require(_0x6ab3('0x14'));var hardwareService=require(_0x6ab3('0x15'));var logger=require(_0x6ab3('0x16'))('api');var utils=require(_0x6ab3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6ab3('0x18'));var db=require(_0x6ab3('0x19'))['db'];function respondWithStatusCode(_0x183508,_0x2fe47b){_0x2fe47b=_0x2fe47b||0xcc;return function(_0x23d0ae){if(_0x23d0ae){return _0x183508['sendStatus'](_0x2fe47b);}return _0x183508[_0x6ab3('0x1a')](_0x2fe47b)[_0x6ab3('0x1b')]();};}function respondWithResult(_0x32acd8,_0x313481){_0x313481=_0x313481||0xc8;return function(_0x1412c2){if(_0x1412c2){return _0x32acd8['status'](_0x313481)[_0x6ab3('0x1c')](_0x1412c2);}};}function respondWithFilteredResult(_0x51a0c4,_0x246b5b){return function(_0x27595a){if(_0x27595a){var _0xc20d35=typeof _0x246b5b[_0x6ab3('0x1d')]===_0x6ab3('0x1e')&&typeof _0x246b5b[_0x6ab3('0x1f')]===_0x6ab3('0x1e');var _0xfa65b4=_0x27595a[_0x6ab3('0x20')];var _0x586dcb=_0xc20d35?0x0:_0x246b5b[_0x6ab3('0x1d')];var _0x5db46c=_0xc20d35?_0x27595a[_0x6ab3('0x20')]:_0x246b5b[_0x6ab3('0x1d')]+_0x246b5b[_0x6ab3('0x1f')];var _0x2c1b52;if(_0x5db46c>=_0xfa65b4){_0x5db46c=_0xfa65b4;_0x2c1b52=0xc8;}else{_0x2c1b52=0xce;}_0x51a0c4[_0x6ab3('0x1a')](_0x2c1b52);return _0x51a0c4[_0x6ab3('0x21')](_0x6ab3('0x22'),_0x586dcb+'-'+_0x5db46c+'/'+_0xfa65b4)['json'](_0x27595a);}return null;};}function patchUpdates(_0x253bb2){return function(_0x22b143){try{jsonpatch[_0x6ab3('0x23')](_0x22b143,_0x253bb2,!![]);}catch(_0x4cb92c){return BPromise[_0x6ab3('0x24')](_0x4cb92c);}return _0x22b143['save']();};}function saveUpdates(_0x4bf937,_0x1ac3c6){return function(_0x4e6680){if(_0x4e6680){return _0x4e6680[_0x6ab3('0x25')](_0x4bf937)[_0x6ab3('0x26')](function(_0x30aec0){return _0x30aec0;});}return null;};}function removeEntity(_0x1f0579,_0x344e9f){return function(_0x30af9e){if(_0x30af9e){return _0x30af9e[_0x6ab3('0x27')]()[_0x6ab3('0x26')](function(){_0x1f0579[_0x6ab3('0x1a')](0xcc)[_0x6ab3('0x1b')]();});}};}function handleEntityNotFound(_0x16cfb2,_0x1284d8){return function(_0x10d362){if(!_0x10d362){_0x16cfb2[_0x6ab3('0x28')](0x194);}return _0x10d362;};}function handleError(_0x5d75f6,_0x23cb5b){_0x23cb5b=_0x23cb5b||0x1f4;return function(_0x554cf0){logger[_0x6ab3('0x29')](_0x554cf0[_0x6ab3('0x2a')]);if(_0x554cf0[_0x6ab3('0x2b')]){delete _0x554cf0[_0x6ab3('0x2b')];}_0x5d75f6[_0x6ab3('0x1a')](_0x23cb5b)[_0x6ab3('0x2c')](_0x554cf0);};}exports['show']=function(_0x5b5647,_0x365edb){var _0x57c04b={'raw':!![],'where':{'id':_0x5b5647[_0x6ab3('0x2d')]['id']}},_0x5370d7={};_0x5370d7[_0x6ab3('0x2e')]=_[_0x6ab3('0x2f')](db[_0x6ab3('0x30')][_0x6ab3('0x31')]);_0x5370d7[_0x6ab3('0x32')]=_[_0x6ab3('0x2f')](_0x5b5647[_0x6ab3('0x32')]);_0x5370d7['filters']=_[_0x6ab3('0x33')](_0x5370d7[_0x6ab3('0x2e')],_0x5370d7[_0x6ab3('0x32')]);_0x57c04b[_0x6ab3('0x34')]=_[_0x6ab3('0x33')](_0x5370d7[_0x6ab3('0x2e')],qs[_0x6ab3('0x35')](_0x5b5647[_0x6ab3('0x32')]['fields']));_0x57c04b[_0x6ab3('0x34')]=_0x57c04b['attributes']['length']?_0x57c04b[_0x6ab3('0x34')]:_0x5370d7['model'];if(_0x5b5647[_0x6ab3('0x32')][_0x6ab3('0x36')]){_0x57c04b[_0x6ab3('0x37')]=[{'all':!![]}];}_0x57c04b=_[_0x6ab3('0x38')]({},_0x57c04b,_0x5b5647[_0x6ab3('0x39')]);return db[_0x6ab3('0x30')][_0x6ab3('0x3a')](_0x57c04b)[_0x6ab3('0x26')](handleEntityNotFound(_0x365edb,null))[_0x6ab3('0x26')](respondWithResult(_0x365edb,null))[_0x6ab3('0x3b')](handleError(_0x365edb,null));};exports[_0x6ab3('0x3c')]=function(_0x22e39a,_0xdfe14b){return db[_0x6ab3('0x30')]['create'](_0x22e39a[_0x6ab3('0x3d')],{})[_0x6ab3('0x26')](respondWithResult(_0xdfe14b,0xc9))[_0x6ab3('0x3b')](handleError(_0xdfe14b,null));};exports[_0x6ab3('0x25')]=function(_0x315c99,_0xd70937){if(_0x315c99['body']['id']){delete _0x315c99[_0x6ab3('0x3d')]['id'];}return db['ChatProactiveAction'][_0x6ab3('0x3a')]({'where':{'id':_0x315c99[_0x6ab3('0x2d')]['id']}})['then'](handleEntityNotFound(_0xd70937,null))[_0x6ab3('0x26')](saveUpdates(_0x315c99[_0x6ab3('0x3d')],null))['then'](respondWithResult(_0xd70937,null))['catch'](handleError(_0xd70937,null));};exports[_0x6ab3('0x27')]=function(_0x4a3988,_0x2ec0c7){return db[_0x6ab3('0x30')]['find']({'where':{'id':_0x4a3988['params']['id']}})[_0x6ab3('0x26')](handleEntityNotFound(_0x2ec0c7,null))[_0x6ab3('0x26')](removeEntity(_0x2ec0c7,null))['catch'](handleError(_0x2ec0c7,null));};
\ No newline at end of file
+var _0xf6c1=['count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','attributes','intersection','fields','includeAll','include','options','catch','create','body','params','find','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3c3b8c,_0x440db6){var _0x2a377e=function(_0x52cf2c){while(--_0x52cf2c){_0x3c3b8c['push'](_0x3c3b8c['shift']());}};_0x2a377e(++_0x440db6);}(_0xf6c1,0x99));var _0x1f6c=function(_0x2d5beb,_0x552f69){_0x2d5beb=_0x2d5beb-0x0;var _0x134b5b=_0xf6c1[_0x2d5beb];return _0x134b5b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1f6c('0x0'));var jsonpatch=require(_0x1f6c('0x1'));var rp=require(_0x1f6c('0x2'));var moment=require('moment');var BPromise=require(_0x1f6c('0x3'));var Mustache=require('mustache');var util=require(_0x1f6c('0x4'));var path=require(_0x1f6c('0x5'));var sox=require(_0x1f6c('0x6'));var csv=require(_0x1f6c('0x7'));var ejs=require(_0x1f6c('0x8'));var fs=require('fs');var fs_extra=require(_0x1f6c('0x9'));var _=require('lodash');var squel=require(_0x1f6c('0xa'));var crypto=require(_0x1f6c('0xb'));var jsforce=require(_0x1f6c('0xc'));var deskjs=require(_0x1f6c('0xd'));var toCsv=require(_0x1f6c('0x7'));var querystring=require(_0x1f6c('0xe'));var Papa=require(_0x1f6c('0xf'));var Redis=require(_0x1f6c('0x10'));var authService=require(_0x1f6c('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1f6c('0x12'))(_0x1f6c('0x13'));var utils=require(_0x1f6c('0x14'));var config=require(_0x1f6c('0x15'));var licenseUtil=require(_0x1f6c('0x16'));var db=require(_0x1f6c('0x17'))['db'];function respondWithStatusCode(_0x507a06,_0x7963a9){_0x7963a9=_0x7963a9||0xcc;return function(_0x1e7060){if(_0x1e7060){return _0x507a06[_0x1f6c('0x18')](_0x7963a9);}return _0x507a06[_0x1f6c('0x19')](_0x7963a9)[_0x1f6c('0x1a')]();};}function respondWithResult(_0x1315b7,_0x31fc67){_0x31fc67=_0x31fc67||0xc8;return function(_0x147c01){if(_0x147c01){return _0x1315b7['status'](_0x31fc67)[_0x1f6c('0x1b')](_0x147c01);}};}function respondWithFilteredResult(_0x302026,_0x26652b){return function(_0x43ce04){if(_0x43ce04){var _0xc8b6f2=typeof _0x26652b[_0x1f6c('0x1c')]==='undefined'&&typeof _0x26652b['limit']===_0x1f6c('0x1d');var _0x30a8dc=_0x43ce04['count'];var _0x2328f2=_0xc8b6f2?0x0:_0x26652b['offset'];var _0x31c887=_0xc8b6f2?_0x43ce04[_0x1f6c('0x1e')]:_0x26652b[_0x1f6c('0x1c')]+_0x26652b[_0x1f6c('0x1f')];var _0xd71b77;if(_0x31c887>=_0x30a8dc){_0x31c887=_0x30a8dc;_0xd71b77=0xc8;}else{_0xd71b77=0xce;}_0x302026[_0x1f6c('0x19')](_0xd71b77);return _0x302026[_0x1f6c('0x20')](_0x1f6c('0x21'),_0x2328f2+'-'+_0x31c887+'/'+_0x30a8dc)[_0x1f6c('0x1b')](_0x43ce04);}return null;};}function patchUpdates(_0x459944){return function(_0x44b1c5){try{jsonpatch[_0x1f6c('0x22')](_0x44b1c5,_0x459944,!![]);}catch(_0x196356){return BPromise[_0x1f6c('0x23')](_0x196356);}return _0x44b1c5[_0x1f6c('0x24')]();};}function saveUpdates(_0x55881f,_0x2644e9){return function(_0x511191){if(_0x511191){return _0x511191[_0x1f6c('0x25')](_0x55881f)[_0x1f6c('0x26')](function(_0x536eb6){return _0x536eb6;});}return null;};}function removeEntity(_0x1aa1f6,_0x4ef92a){return function(_0x32a812){if(_0x32a812){return _0x32a812[_0x1f6c('0x27')]()[_0x1f6c('0x26')](function(){_0x1aa1f6[_0x1f6c('0x19')](0xcc)[_0x1f6c('0x1a')]();});}};}function handleEntityNotFound(_0x386016,_0x8b998c){return function(_0x236f17){if(!_0x236f17){_0x386016[_0x1f6c('0x18')](0x194);}return _0x236f17;};}function handleError(_0x147385,_0x4ffb66){_0x4ffb66=_0x4ffb66||0x1f4;return function(_0xa16408){logger[_0x1f6c('0x28')](_0xa16408[_0x1f6c('0x29')]);if(_0xa16408['name']){delete _0xa16408[_0x1f6c('0x2a')];}_0x147385[_0x1f6c('0x19')](_0x4ffb66)[_0x1f6c('0x2b')](_0xa16408);};}exports[_0x1f6c('0x2c')]=function(_0xeaeccd,_0x15df56){var _0x51a230={'raw':!![],'where':{'id':_0xeaeccd['params']['id']}},_0x420853={};_0x420853[_0x1f6c('0x2d')]=_[_0x1f6c('0x2e')](db[_0x1f6c('0x2f')][_0x1f6c('0x30')]);_0x420853[_0x1f6c('0x31')]=_['keys'](_0xeaeccd[_0x1f6c('0x31')]);_0x420853['filters']=_['intersection'](_0x420853[_0x1f6c('0x2d')],_0x420853[_0x1f6c('0x31')]);_0x51a230[_0x1f6c('0x32')]=_[_0x1f6c('0x33')](_0x420853['model'],qs[_0x1f6c('0x34')](_0xeaeccd[_0x1f6c('0x31')][_0x1f6c('0x34')]));_0x51a230[_0x1f6c('0x32')]=_0x51a230[_0x1f6c('0x32')]['length']?_0x51a230['attributes']:_0x420853[_0x1f6c('0x2d')];if(_0xeaeccd[_0x1f6c('0x31')][_0x1f6c('0x35')]){_0x51a230[_0x1f6c('0x36')]=[{'all':!![]}];}_0x51a230=_['merge']({},_0x51a230,_0xeaeccd[_0x1f6c('0x37')]);return db['ChatProactiveAction']['find'](_0x51a230)[_0x1f6c('0x26')](handleEntityNotFound(_0x15df56,null))[_0x1f6c('0x26')](respondWithResult(_0x15df56,null))[_0x1f6c('0x38')](handleError(_0x15df56,null));};exports[_0x1f6c('0x39')]=function(_0x44f909,_0x271aa0){return db[_0x1f6c('0x2f')][_0x1f6c('0x39')](_0x44f909[_0x1f6c('0x3a')],{})[_0x1f6c('0x26')](respondWithResult(_0x271aa0,0xc9))[_0x1f6c('0x38')](handleError(_0x271aa0,null));};exports[_0x1f6c('0x25')]=function(_0x16e207,_0x2fc1c6){if(_0x16e207[_0x1f6c('0x3a')]['id']){delete _0x16e207[_0x1f6c('0x3a')]['id'];}return db[_0x1f6c('0x2f')]['find']({'where':{'id':_0x16e207[_0x1f6c('0x3b')]['id']}})[_0x1f6c('0x26')](handleEntityNotFound(_0x2fc1c6,null))[_0x1f6c('0x26')](saveUpdates(_0x16e207[_0x1f6c('0x3a')],null))[_0x1f6c('0x26')](respondWithResult(_0x2fc1c6,null))['catch'](handleError(_0x2fc1c6,null));};exports['destroy']=function(_0x29a9ef,_0x845949){return db[_0x1f6c('0x2f')][_0x1f6c('0x3c')]({'where':{'id':_0x29a9ef[_0x1f6c('0x3b')]['id']}})[_0x1f6c('0x26')](handleEntityNotFound(_0x845949,null))['then'](removeEntity(_0x845949,null))[_0x1f6c('0x38')](handleError(_0x845949,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 681b57d..72837fa 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 _0x22f0=['api','moment','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger'];(function(_0x1ec8b7,_0x1d1b94){var _0x281722=function(_0x556075){while(--_0x556075){_0x1ec8b7['push'](_0x1ec8b7['shift']());}};_0x281722(++_0x1d1b94);}(_0x22f0,0xf9));var _0x022f=function(_0x2c6a9c,_0x244ed9){_0x2c6a9c=_0x2c6a9c-0x0;var _0x21591f=_0x22f0[_0x2c6a9c];return _0x21591f;};'use strict';var _=require(_0x022f('0x0'));var util=require(_0x022f('0x1'));var logger=require(_0x022f('0x2'))(_0x022f('0x3'));var moment=require(_0x022f('0x4'));var BPromise=require('bluebird');var rp=require(_0x022f('0x5'));var fs=require('fs');var path=require(_0x022f('0x6'));var rimraf=require(_0x022f('0x7'));var config=require(_0x022f('0x8'));var attributes=require(_0x022f('0x9'));module[_0x022f('0xa')]=function(_0x1ad02f,_0x10f4bd){return _0x1ad02f[_0x022f('0xb')](_0x022f('0xc'),attributes,{'tableName':_0x022f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdbb8=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash'];(function(_0x2a87fe,_0x52c61c){var _0x539085=function(_0x966460){while(--_0x966460){_0x2a87fe['push'](_0x2a87fe['shift']());}};_0x539085(++_0x52c61c);}(_0xdbb8,0xe3));var _0x8dbb=function(_0x59bcb1,_0x5a4b6c){_0x59bcb1=_0x59bcb1-0x0;var _0x4a737f=_0xdbb8[_0x59bcb1];return _0x4a737f;};'use strict';var _=require(_0x8dbb('0x0'));var util=require(_0x8dbb('0x1'));var logger=require(_0x8dbb('0x2'))(_0x8dbb('0x3'));var moment=require(_0x8dbb('0x4'));var BPromise=require(_0x8dbb('0x5'));var rp=require(_0x8dbb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8dbb('0x7'));var config=require('../../config/environment');var attributes=require(_0x8dbb('0x8'));module[_0x8dbb('0x9')]=function(_0x3f86ca,_0x1199af){return _0x3f86ca[_0x8dbb('0xa')]('ChatProactiveAction',attributes,{'tableName':_0x8dbb('0xb'),'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 7146693..843b9b4 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 _0xa117=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','lodash','util'];(function(_0x476b00,_0x250877){var _0x44ec8e=function(_0xec6b23){while(--_0xec6b23){_0x476b00['push'](_0x476b00['shift']());}};_0x44ec8e(++_0x250877);}(_0xa117,0x11c));var _0x7a11=function(_0x348567,_0x151fc1){_0x348567=_0x348567-0x0;var _0x2deeef=_0xa117[_0x348567];return _0x2deeef;};'use strict';var _=require(_0x7a11('0x0'));var util=require(_0x7a11('0x1'));var moment=require(_0x7a11('0x2'));var BPromise=require(_0x7a11('0x3'));var rs=require(_0x7a11('0x4'));var fs=require('fs');var Redis=require(_0x7a11('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7a11('0x6'));var logger=require(_0x7a11('0x7'))(_0x7a11('0x8'));var config=require(_0x7a11('0x9'));var jayson=require(_0x7a11('0xa'));var client=jayson['client'][_0x7a11('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x385b18,_0x41306b,_0x5814bc){return new BPromise(function(_0x4879df,_0x276463){return client['request'](_0x385b18,_0x5814bc)[_0x7a11('0xc')](function(_0x44a722){logger[_0x7a11('0xd')](_0x7a11('0xe'),_0x41306b,'request\x20sent');logger[_0x7a11('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x41306b,'request\x20sent',JSON[_0x7a11('0x10')](_0x44a722));if(_0x44a722['error']){if(_0x44a722[_0x7a11('0x11')][_0x7a11('0x12')]===0x1f4){logger[_0x7a11('0x11')](_0x7a11('0xe'),_0x41306b,_0x44a722[_0x7a11('0x11')]['message']);return _0x276463(_0x44a722[_0x7a11('0x11')][_0x7a11('0x13')]);}logger[_0x7a11('0x11')](_0x7a11('0xe'),_0x41306b,_0x44a722['error'][_0x7a11('0x13')]);return _0x4879df(_0x44a722[_0x7a11('0x11')][_0x7a11('0x13')]);}else{logger[_0x7a11('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x41306b,_0x7a11('0x14'));_0x4879df(_0x44a722[_0x7a11('0x15')][_0x7a11('0x13')]);}})['catch'](function(_0x4e3818){logger[_0x7a11('0x11')](_0x7a11('0xe'),_0x41306b,_0x4e3818);_0x276463(_0x4e3818);});});}
\ No newline at end of file
+var _0x2972=['code','message','ChatProactiveAction,\x20%s,\x20%s','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','stringify','error'];(function(_0x168127,_0x59cea1){var _0x4c99ad=function(_0x4ab3f2){while(--_0x4ab3f2){_0x168127['push'](_0x168127['shift']());}};_0x4c99ad(++_0x59cea1);}(_0x2972,0x144));var _0x2297=function(_0x21a59d,_0x1d8c25){_0x21a59d=_0x21a59d-0x0;var _0x3fc7ae=_0x2972[_0x21a59d];return _0x3fc7ae;};'use strict';var _=require(_0x2297('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2297('0x1'));var rs=require(_0x2297('0x2'));var fs=require('fs');var Redis=require(_0x2297('0x3'));var db=require(_0x2297('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2297('0x5'))(_0x2297('0x6'));var config=require(_0x2297('0x7'));var jayson=require(_0x2297('0x8'));var client=jayson[_0x2297('0x9')][_0x2297('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f65a3,_0x4d0c06,_0x50bff7){return new BPromise(function(_0x41f7a0,_0x414dbb){return client[_0x2297('0xb')](_0x4f65a3,_0x50bff7)['then'](function(_0x845a95){logger[_0x2297('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x4d0c06,_0x2297('0xd'));logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x4d0c06,_0x2297('0xd'),JSON[_0x2297('0xe')](_0x845a95));if(_0x845a95[_0x2297('0xf')]){if(_0x845a95[_0x2297('0xf')][_0x2297('0x10')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4d0c06,_0x845a95[_0x2297('0xf')][_0x2297('0x11')]);return _0x414dbb(_0x845a95['error'][_0x2297('0x11')]);}logger['error'](_0x2297('0x12'),_0x4d0c06,_0x845a95[_0x2297('0xf')][_0x2297('0x11')]);return _0x41f7a0(_0x845a95[_0x2297('0xf')][_0x2297('0x11')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x4d0c06,'request\x20sent');_0x41f7a0(_0x845a95['result'][_0x2297('0x11')]);}})[_0x2297('0x13')](function(_0x38d337){logger[_0x2297('0xf')](_0x2297('0x12'),_0x4d0c06,_0x38d337);_0x414dbb(_0x38d337);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index f71d08d..b5b52cc 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 _0xb4c7=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','show','create'];(function(_0x154192,_0x2d360f){var _0x3c2792=function(_0x2e257b){while(--_0x2e257b){_0x154192['push'](_0x154192['shift']());}};_0x3c2792(++_0x2d360f);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x5b449b,_0x5fdca9){_0x5b449b=_0x5b449b-0x0;var _0x43660a=_0xb4c7[_0x5b449b];return _0x43660a;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xc')]);router['post']('/',auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xd')]);router['put'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xe')]);router[_0x7b4c('0xf')](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0x10')]);module[_0x7b4c('0x11')]=router;
\ No newline at end of file
+var _0x2675=['../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','delete','exports','multer','express','Router'];(function(_0x3344ed,_0x555e9d){var _0x1196de=function(_0x18312b){while(--_0x18312b){_0x3344ed['push'](_0x3344ed['shift']());}};_0x1196de(++_0x555e9d);}(_0x2675,0x75));var _0x5267=function(_0x1c947f,_0x347428){_0x1c947f=_0x1c947f-0x0;var _0x2618da=_0x2675[_0x1c947f];return _0x2618da;};'use strict';var multer=require(_0x5267('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5267('0x1'));var router=express[_0x5267('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x5267('0x3'));var interaction=require(_0x5267('0x4'));var config=require('../../config/environment');var controller=require(_0x5267('0x5'));router[_0x5267('0x6')](_0x5267('0x7'),auth[_0x5267('0x8')](),controller[_0x5267('0x9')]);router[_0x5267('0xa')]('/',auth['isAuthenticated'](),controller[_0x5267('0xb')]);router[_0x5267('0xc')]('/:id',auth[_0x5267('0x8')](),controller['update']);router[_0x5267('0xd')](_0x5267('0x7'),auth[_0x5267('0x8')](),controller['destroy']);module[_0x5267('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 7cc356b..72199b7 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 _0xeac8=['STRING','name','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x13c304,_0x4791de){var _0x12696e=function(_0x2070d4){while(--_0x2070d4){_0x13c304['push'](_0x13c304['shift']());}};_0x12696e(++_0x4791de);}(_0xeac8,0x1d6));var _0x8eac=function(_0x2e8496,_0xa4934a){_0x2e8496=_0x2e8496-0x0;var _0x31979b=_0xeac8[_0x2e8496];return _0x31979b;};'use strict';var Sequelize=require(_0x8eac('0x0'));module[_0x8eac('0x1')]={'name':{'type':Sequelize[_0x8eac('0x2')],'unique':_0x8eac('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8eac('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8eac('0x4')](_0x8eac('0x5'),_0x8eac('0x6'),_0x8eac('0x7'))}};
\ No newline at end of file
+var _0xb3b7=['STRING','name','INTEGER','ENUM','beepall','roundrobin','sequelize'];(function(_0x1d2d4c,_0x340107){var _0x58ed56=function(_0xf95ad){while(--_0xf95ad){_0x1d2d4c['push'](_0x1d2d4c['shift']());}};_0x58ed56(++_0x340107);}(_0xb3b7,0xdf));var _0x7b3b=function(_0x40c370,_0x421b26){_0x40c370=_0x40c370-0x0;var _0x326048=_0xb3b7[_0x40c370];return _0x326048;};'use strict';var Sequelize=require(_0x7b3b('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b3b('0x1')],'unique':_0x7b3b('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7b3b('0x1')]},'timeout':{'type':Sequelize[_0x7b3b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7b3b('0x4')]('rrmemory',_0x7b3b('0x5'),_0x7b3b('0x6'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 1b56e4f..2100079 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 _0x272f=['lodash','squel','ioredis','../../components/parsers/qs','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','update','then','get','ChatQueues','UserProfileResource','error','stack','name','send','index','map','ChatQueue','type','getOptions','include','rows','catch','params','model','keys','rawAttributes','query','filters','attributes','fields','length','includeAll','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','destroy','describe','getMembers','intersection','hasOwnProperty','nolimit','sort','where','pick','ChatQueueId','filter','UserChatQueue','findAll','User','findAndCountAll','UserId','agent','format','SIP','chatPause','createdAt','updatedAt','getTeams','findOne','Team','order','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','emit','userChatQueue:save','removeTeams','select','tq.TeamId','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','isArray','getAgents','bluebird','util'];(function(_0x543f4d,_0x5953de){var _0x173378=function(_0x59aaff){while(--_0x59aaff){_0x543f4d['push'](_0x543f4d['shift']());}};_0x173378(++_0x5953de);}(_0x272f,0x1ee));var _0xf272=function(_0x225c4b,_0x45d0e9){_0x225c4b=_0x225c4b-0x0;var _0x3305b1=_0x272f[_0x225c4b];return _0x3305b1;};'use strict';var BPromise=require(_0xf272('0x0'));var util=require(_0xf272('0x1'));var _=require(_0xf272('0x2'));var squel=require(_0xf272('0x3'));var Redis=require(_0xf272('0x4'));var qs=require(_0xf272('0x5'));var logger=require('../../config/logger')(_0xf272('0x6'));var config=require('../../config/environment');var db=require(_0xf272('0x7'))['db'];config[_0xf272('0x8')]=_['defaults'](config[_0xf272('0x8')],{'host':_0xf272('0x9'),'port':0x18eb});var socket=require(_0xf272('0xa'))(new Redis(config[_0xf272('0x8')]));require(_0xf272('0xb'))[_0xf272('0xc')](socket);function respondWithStatusCode(_0x248ebc,_0x52769c){_0x52769c=_0x52769c||0xcc;return function(_0x849b2c){if(_0x849b2c){return _0x248ebc[_0xf272('0xd')](_0x52769c);}return _0x248ebc['status'](_0x52769c)[_0xf272('0xe')]();};}function respondWithResult(_0x265db8,_0x433a28){_0x433a28=_0x433a28||0xc8;return function(_0x3fea1b){if(_0x3fea1b){return _0x265db8[_0xf272('0xf')](_0x433a28)[_0xf272('0x10')](_0x3fea1b);}};}function respondWithFilteredResult(_0xb4f29e,_0x107e5c){return function(_0x991223){if(_0x991223){var _0x231901=typeof _0x107e5c['offset']===_0xf272('0x11')&&typeof _0x107e5c[_0xf272('0x12')]===_0xf272('0x11');var _0x4bfcf4=_0x991223[_0xf272('0x13')];var _0x505152=_0x231901?0x0:_0x107e5c[_0xf272('0x14')];var _0x4895e4=_0x231901?_0x991223[_0xf272('0x13')]:_0x107e5c[_0xf272('0x14')]+_0x107e5c[_0xf272('0x12')];var _0x2214f4;if(_0x4895e4>=_0x4bfcf4){_0x4895e4=_0x4bfcf4;_0x2214f4=0xc8;}else{_0x2214f4=0xce;}_0xb4f29e['status'](_0x2214f4);return _0xb4f29e[_0xf272('0x15')](_0xf272('0x16'),_0x505152+'-'+_0x4895e4+'/'+_0x4bfcf4)[_0xf272('0x10')](_0x991223);}return null;};}function saveUpdates(_0x26f93a){return function(_0x3f640c){if(_0x3f640c){return _0x3f640c[_0xf272('0x17')](_0x26f93a)[_0xf272('0x18')](function(_0x570a67){return _0x570a67;});}return null;};}function removeEntity(_0x4fb668){return function(_0x1c9620){if(_0x1c9620){return _0x1c9620['destroy']()['then'](function(){var _0x501675=_0x1c9620[_0xf272('0x19')]({'plain':!![]});var _0x2c68d0=_0xf272('0x1a');return db[_0xf272('0x1b')]['destroy']({'where':{'type':_0x2c68d0,'resourceId':_0x501675['id']}})['then'](function(){return _0x1c9620;});})['then'](function(){_0x4fb668[_0xf272('0xf')](0xcc)[_0xf272('0xe')]();});}};}function handleEntityNotFound(_0x46ec78){return function(_0x314337){if(!_0x314337){_0x46ec78[_0xf272('0xd')](0x194);}return _0x314337;};}function handleError(_0x1596e9,_0x59d556){_0x59d556=_0x59d556||0x1f4;return function(_0xb7cccb){logger[_0xf272('0x1c')](_0xb7cccb[_0xf272('0x1d')]);if(_0xb7cccb[_0xf272('0x1e')]){delete _0xb7cccb['name'];}_0x1596e9['status'](_0x59d556)[_0xf272('0x1f')](_0xb7cccb);};}exports[_0xf272('0x20')]=function(_0xcbf388,_0x1bddd1){var _0x29a87a={};var _0x5d6449={'count':0x0,'rows':[]};var _0x3db6b5=_[_0xf272('0x21')](db[_0xf272('0x22')]['rawAttributes'],function(_0x398a6d){return{'name':_0x398a6d['fieldName'],'type':_0x398a6d[_0xf272('0x23')]['key']};});_0x29a87a=qs[_0xf272('0x24')](_0x3db6b5,_0xcbf388);var _0x58ddaf={'where':_0x29a87a['where']};return db[_0xf272('0x22')][_0xf272('0x13')](_0x58ddaf)[_0xf272('0x18')](function(_0x571746){_0x5d6449[_0xf272('0x13')]=_0x571746;_0x29a87a[_0xf272('0x25')]=qs[_0xf272('0x25')](_0xcbf388['query']);return db[_0xf272('0x22')]['findAll'](_0x29a87a);})[_0xf272('0x18')](function(_0x273cd6){_0x5d6449[_0xf272('0x26')]=_0x273cd6;return _0x5d6449;})[_0xf272('0x18')](respondWithFilteredResult(_0x1bddd1,_0x29a87a))[_0xf272('0x27')](handleError(_0x1bddd1,null));};exports['show']=function(_0x2f1b53,_0x2bce85){var _0x176fdf={'raw':!![],'where':{'id':_0x2f1b53[_0xf272('0x28')]['id']}},_0x1ee4fa={};_0x1ee4fa[_0xf272('0x29')]=_[_0xf272('0x2a')](db[_0xf272('0x22')][_0xf272('0x2b')]);_0x1ee4fa[_0xf272('0x2c')]=_[_0xf272('0x2a')](_0x2f1b53[_0xf272('0x2c')]);_0x1ee4fa[_0xf272('0x2d')]=_['intersection'](_0x1ee4fa[_0xf272('0x29')],_0x1ee4fa[_0xf272('0x2c')]);_0x176fdf[_0xf272('0x2e')]=_['intersection'](_0x1ee4fa[_0xf272('0x29')],qs['fields'](_0x2f1b53[_0xf272('0x2c')][_0xf272('0x2f')]));_0x176fdf[_0xf272('0x2e')]=_0x176fdf[_0xf272('0x2e')][_0xf272('0x30')]?_0x176fdf['attributes']:_0x1ee4fa[_0xf272('0x29')];if(_0x2f1b53[_0xf272('0x2c')][_0xf272('0x31')]){_0x176fdf['include']=[{'all':!![]}];}_0x176fdf=_[_0xf272('0x32')]({},_0x176fdf,_0x2f1b53[_0xf272('0x33')]);return db['ChatQueue'][_0xf272('0x34')](_0x176fdf)['then'](handleEntityNotFound(_0x2bce85,null))[_0xf272('0x18')](respondWithResult(_0x2bce85,null))['catch'](handleError(_0x2bce85,null));};exports[_0xf272('0x35')]=function(_0x381655,_0x1ab4de){return db[_0xf272('0x22')][_0xf272('0x35')](_0x381655[_0xf272('0x36')],{})['then'](function(_0x393778){var _0xc02997=_0x381655['user'][_0xf272('0x19')]({'plain':!![]});if(!_0xc02997)throw new Error(_0xf272('0x37'));if(_0xc02997[_0xf272('0x38')]===_0xf272('0x39')){var _0x9461b4=_0x393778[_0xf272('0x19')]({'plain':!![]});var _0xba876=_0xf272('0x1a');return db[_0xf272('0x3a')]['find']({'where':{'name':_0xba876,'userProfileId':_0xc02997[_0xf272('0x3b')]},'raw':!![]})[_0xf272('0x18')](function(_0x22dc79){if(_0x22dc79&&_0x22dc79[_0xf272('0x3c')]===0x0){return db[_0xf272('0x1b')][_0xf272('0x35')]({'name':_0x9461b4['name'],'resourceId':_0x9461b4['id'],'type':_0x22dc79['name'],'sectionId':_0x22dc79['id']},{})['then'](function(){return _0x393778;});}else{return _0x393778;}})[_0xf272('0x27')](function(_0xd1f941){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd1f941);throw _0xd1f941;});}return _0x393778;})[_0xf272('0x18')](respondWithResult(_0x1ab4de,0xc9))[_0xf272('0x27')](handleError(_0x1ab4de,null));};exports[_0xf272('0x17')]=function(_0x4ee7d9,_0x15853f){if(_0x4ee7d9[_0xf272('0x36')]['id']){delete _0x4ee7d9[_0xf272('0x36')]['id'];}return db[_0xf272('0x22')][_0xf272('0x34')]({'where':{'id':_0x4ee7d9[_0xf272('0x28')]['id']}})['then'](handleEntityNotFound(_0x15853f,null))[_0xf272('0x18')](saveUpdates(_0x4ee7d9[_0xf272('0x36')],null))[_0xf272('0x18')](respondWithResult(_0x15853f,null))['catch'](handleError(_0x15853f,null));};exports[_0xf272('0x3d')]=function(_0x47e1f7,_0x5b4d8b){return db[_0xf272('0x22')]['find']({'where':{'id':_0x47e1f7[_0xf272('0x28')]['id']}})[_0xf272('0x18')](handleEntityNotFound(_0x5b4d8b,null))[_0xf272('0x18')](removeEntity(_0x5b4d8b,null))['catch'](handleError(_0x5b4d8b,null));};exports[_0xf272('0x3e')]=function(_0x45a672,_0x4eedbe){return db[_0xf272('0x22')][_0xf272('0x3e')]()[_0xf272('0x18')](respondWithResult(_0x4eedbe,null))[_0xf272('0x27')](handleError(_0x4eedbe,null));};exports[_0xf272('0x3f')]=function(_0x45d335,_0x15f662){var _0x12d767={'raw':!![],'where':{}},_0x5c57ab={},_0x45a9b0;return db['ChatQueue']['findOne']({'where':{'id':_0x45d335[_0xf272('0x28')]['id']}})[_0xf272('0x18')](handleEntityNotFound(_0x15f662,null))['then'](function(_0x212225){if(_0x212225){_0x45a9b0=_0x212225[_0xf272('0x19')]({'plain':!![]});_0x5c57ab['model']=_[_0xf272('0x2a')](db['UserChatQueue']['rawAttributes']);_0x5c57ab[_0xf272('0x2c')]=_['keys'](_0x45d335['query']);_0x5c57ab[_0xf272('0x2d')]=_[_0xf272('0x40')](_0x5c57ab[_0xf272('0x29')],_0x5c57ab[_0xf272('0x2c')]);_0x12d767[_0xf272('0x2e')]=_[_0xf272('0x40')](_0x5c57ab['model'],qs[_0xf272('0x2f')](_0x45d335['query'][_0xf272('0x2f')]));_0x12d767['attributes']=_0x12d767[_0xf272('0x2e')]['length']?_0x12d767[_0xf272('0x2e')]:_0x5c57ab['model'];if(!_0x45d335[_0xf272('0x2c')][_0xf272('0x41')](_0xf272('0x42'))){_0x12d767['limit']=qs[_0xf272('0x12')](_0x45d335[_0xf272('0x2c')][_0xf272('0x12')]);_0x12d767[_0xf272('0x14')]=qs[_0xf272('0x14')](_0x45d335[_0xf272('0x2c')][_0xf272('0x14')]);}_0x12d767['order']=qs[_0xf272('0x43')](_0x45d335[_0xf272('0x2c')][_0xf272('0x43')]);_0x12d767[_0xf272('0x44')]=qs['filters'](_[_0xf272('0x45')](_0x45d335[_0xf272('0x2c')],_0x5c57ab[_0xf272('0x2d')]));_0x12d767[_0xf272('0x44')][_0xf272('0x46')]=_0x212225['id'];if(_0x45d335[_0xf272('0x2c')][_0xf272('0x47')]){_0x12d767[_0xf272('0x44')]=_['merge'](_0x12d767['where'],{'$or':_[_0xf272('0x21')](_0x12d767[_0xf272('0x2e')],function(_0x71664e){var _0x415d2f={};_0x415d2f[_0x71664e]={'$like':'%'+_0x45d335['query'][_0xf272('0x47')]+'%'};return _0x415d2f;})});}_0x12d767=_[_0xf272('0x32')]({},_0x12d767,_0x45d335[_0xf272('0x33')]);return db[_0xf272('0x48')][_0xf272('0x49')](_0x12d767);}})[_0xf272('0x18')](function(_0x23c0ff){if(_0x23c0ff){return db[_0xf272('0x4a')][_0xf272('0x4b')]({'where':{'id':_[_0xf272('0x21')](_0x23c0ff,_0xf272('0x4c')),'role':_0xf272('0x4d')},'attributes':['id','name','chatPause','updatedAt','createdAt']});}})[_0xf272('0x18')](function(_0x972763){if(_0x972763){return{'count':_0x972763[_0xf272('0x13')],'rows':_[_0xf272('0x21')](_0x972763[_0xf272('0x26')],function(_0x13f37f){return{'membername':_0x13f37f[_0xf272('0x1e')],'UserId':_0x13f37f['id'],'queue_name':_0x45a9b0[_0xf272('0x1e')],'ChatQueueId':_0x45a9b0['id'],'interface':util[_0xf272('0x4e')]('%s/%s',_0xf272('0x4f'),_0x13f37f[_0xf272('0x1e')]),'penalty':0x0,'paused':_0x13f37f[_0xf272('0x50')],'createdAt':_0x13f37f[_0xf272('0x51')],'updatedAt':_0x13f37f[_0xf272('0x52')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf272('0x18')](respondWithFilteredResult(_0x15f662,_0x12d767))['catch'](handleError(_0x15f662,null));};exports[_0xf272('0x53')]=function(_0x5cb010,_0x5387be){var _0x4e53d4={};var _0x2f0ba7={};var _0x535c00;var _0x5d1104;return db['ChatQueue'][_0xf272('0x54')]({'where':{'id':_0x5cb010[_0xf272('0x28')]['id']}})[_0xf272('0x18')](handleEntityNotFound(_0x5387be,null))[_0xf272('0x18')](function(_0x4f89b3){if(_0x4f89b3){_0x535c00=_0x4f89b3;_0x2f0ba7[_0xf272('0x29')]=_[_0xf272('0x2a')](db[_0xf272('0x55')][_0xf272('0x2b')]);_0x2f0ba7[_0xf272('0x2c')]=_[_0xf272('0x2a')](_0x5cb010[_0xf272('0x2c')]);_0x2f0ba7[_0xf272('0x2d')]=_['intersection'](_0x2f0ba7[_0xf272('0x29')],_0x2f0ba7[_0xf272('0x2c')]);_0x4e53d4['attributes']=_['intersection'](_0x2f0ba7[_0xf272('0x29')],qs[_0xf272('0x2f')](_0x5cb010['query']['fields']));_0x4e53d4['attributes']=_0x4e53d4[_0xf272('0x2e')]['length']?_0x4e53d4[_0xf272('0x2e')]:_0x2f0ba7[_0xf272('0x29')];_0x4e53d4[_0xf272('0x56')]=qs['sort'](_0x5cb010[_0xf272('0x2c')][_0xf272('0x43')]);_0x4e53d4['where']=qs[_0xf272('0x2d')](_[_0xf272('0x45')](_0x5cb010['query'],_0x2f0ba7[_0xf272('0x2d')]));if(_0x5cb010[_0xf272('0x2c')][_0xf272('0x47')]){_0x4e53d4[_0xf272('0x44')]=_[_0xf272('0x32')](_0x4e53d4[_0xf272('0x44')],{'$or':_[_0xf272('0x21')](_0x4e53d4[_0xf272('0x2e')],function(_0x37380b){var _0x4ac7c6={};_0x4ac7c6[_0x37380b]={'$like':'%'+_0x5cb010[_0xf272('0x2c')][_0xf272('0x47')]+'%'};return _0x4ac7c6;})});}_0x4e53d4=_['merge']({},_0x4e53d4,_0x5cb010[_0xf272('0x33')]);return _0x535c00[_0xf272('0x53')](_0x4e53d4);}})[_0xf272('0x18')](function(_0x322e0b){if(_0x322e0b){_0x5d1104=_0x322e0b[_0xf272('0x30')];if(!_0x5cb010[_0xf272('0x2c')][_0xf272('0x41')](_0xf272('0x42'))){_0x4e53d4[_0xf272('0x12')]=qs['limit'](_0x5cb010[_0xf272('0x2c')][_0xf272('0x12')]);_0x4e53d4[_0xf272('0x14')]=qs[_0xf272('0x14')](_0x5cb010[_0xf272('0x2c')][_0xf272('0x14')]);}return _0x535c00['getTeams'](_0x4e53d4);}})[_0xf272('0x18')](function(_0x2f979b){if(_0x2f979b){return _0x2f979b?{'count':_0x5d1104,'rows':_0x2f979b}:null;}})[_0xf272('0x18')](respondWithResult(_0x5387be,null))[_0xf272('0x27')](handleError(_0x5387be,null));};exports['addTeams']=function(_0x4141ed,_0x25ad70){var _0x2c6ec3=_0x4141ed['body'][_0xf272('0x57')];return db[_0xf272('0x55')][_0xf272('0x49')]({'where':{'id':_0x2c6ec3},'attributes':['id'],'include':[{'model':db[_0xf272('0x4a')],'as':'Agents','attributes':['id','name',_0xf272('0x58'),_0xf272('0x59'),_0xf272('0x5a')],'raw':!![]}]})[_0xf272('0x18')](function(_0x11bbb9){if(_0x11bbb9){var _0x3c4a2e=_[_0xf272('0x5b')](_0x11bbb9,function(_0x51a356){var _0x3ae7c9=_0x51a356[_0xf272('0x19')]({'plain':!![]});return _0x3ae7c9[_0xf272('0x5c')];});return db[_0xf272('0x22')][_0xf272('0x34')]({'where':{'id':_0x4141ed['params']['id']}})[_0xf272('0x18')](function(_0x44cb14){return db[_0xf272('0x5d')][_0xf272('0x5e')](function(_0x3cd0c0){return _0x44cb14['addTeams'](_0x2c6ec3,{'transaction':_0x3cd0c0})[_0xf272('0x18')](function(){return BPromise[_0xf272('0x5f')](_0x3c4a2e,function(_0x1f5e4e){return db[_0xf272('0x48')][_0xf272('0x60')]({'where':{'UserId':_0x1f5e4e['id'],'ChatQueueId':_0x4141ed['params']['id']},'transaction':_0x3cd0c0});});})[_0xf272('0x18')](function(){_0x3c4a2e['forEach'](function(_0x317f1f){socket[_0xf272('0x61')](_0xf272('0x62'),{'UserId':_0x317f1f['id'],'ChatQueueId':_0x44cb14['id']});});});});});}})['then'](respondWithStatusCode(_0x25ad70,null))['catch'](handleError(_0x25ad70,null));};exports[_0xf272('0x63')]=function(_0x30369e,_0xcfb7b6){return db['Team'][_0xf272('0x49')]({'where':{'id':_0x30369e[_0xf272('0x2c')][_0xf272('0x57')]},'attributes':['id'],'include':[{'model':db[_0xf272('0x4a')],'as':_0xf272('0x5c'),'attributes':['id'],'raw':!![]}]})[_0xf272('0x18')](handleEntityNotFound(_0xcfb7b6,null))[_0xf272('0x18')](function(_0x42bb79){var _0xd493d7=_[_0xf272('0x21')](_0x42bb79,'id');var _0x694003=[];var _0x265812=[];var _0x236212=squel[_0xf272('0x64')]();_0x236212['field'](_0xf272('0x65'))['from'](_0xf272('0x66'),'tq')[_0xf272('0x67')]('user_has_teams','ut',_0xf272('0x68'))[_0xf272('0x44')](_0xf272('0x69'),_0x30369e[_0xf272('0x28')]['id']);for(var _0x9bc57b=0x0;_0x9bc57b<_0x42bb79[_0xf272('0x30')];_0x9bc57b+=0x1){let _0x4a7017=_0x42bb79[_0x9bc57b];for(var _0x3e9f36=0x0;_0x3e9f36<_0x4a7017[_0xf272('0x5c')][_0xf272('0x30')];_0x3e9f36+=0x1){let _0x3e952f=_0x4a7017[_0xf272('0x5c')][_0x3e9f36];var _0x44b688=_0x236212['clone']();_0x44b688[_0xf272('0x44')](_0xf272('0x6a'),_0x3e952f['id']);_0x265812['push'](db[_0xf272('0x5d')]['query'](_0x44b688[_0xf272('0x6b')](),{'type':db[_0xf272('0x5d')][_0xf272('0x6c')][_0xf272('0x6d')]})[_0xf272('0x18')](function(_0x1c0aaf){if(_0x1c0aaf['length']===0x1){return _0x3e952f['id'];}else{var _0x41404e=_[_0xf272('0x6e')](_[_0xf272('0x21')](_0x1c0aaf,_0xf272('0x6f')),function(_0x1ccbb0){return _['includes'](_0xd493d7,_0x1ccbb0);});if(_0x41404e){return _0x3e952f['id'];}}}));}}return BPromise[_0xf272('0x70')](_0x265812)[_0xf272('0x18')](function(_0x2610ed){_0x694003=_(_0x694003)[_0xf272('0x71')](_0x2610ed)[_0xf272('0x72')]()[_0xf272('0x73')]();return db['ChatQueue'][_0xf272('0x34')]({'where':{'id':_0x30369e['params']['id']}})['then'](function(_0x30333d){return db[_0xf272('0x5d')][_0xf272('0x5e')](function(_0x1e5e29){return _0x30333d['removeTeams'](_0x30369e[_0xf272('0x2c')][_0xf272('0x57')],{'transaction':_0x1e5e29})['then'](function(){if(!_[_0xf272('0x74')](_0x694003)){return _0x30333d[_0xf272('0x75')](_0x694003,{'transaction':_0x1e5e29});}})[_0xf272('0x18')](function(){_0x694003[_0xf272('0x76')](function(_0xa74252){socket['emit'](_0xf272('0x77'),{'UserId':_0xa74252,'ChatQueueId':_0x30333d['id']});});});});});});})[_0xf272('0x18')](respondWithStatusCode(_0xcfb7b6,null))[_0xf272('0x27')](handleError(_0xcfb7b6,null));};exports[_0xf272('0x78')]=function(_0x338761,_0x18db7f){return db[_0xf272('0x22')][_0xf272('0x34')]({'where':{'id':_0x338761[_0xf272('0x28')]['id']}})[_0xf272('0x18')](handleEntityNotFound(_0x18db7f,null))[_0xf272('0x18')](function(_0x2cf6d2){if(_0x2cf6d2){return _0x2cf6d2['addAgents'](_0x338761['body']['ids'],_[_0xf272('0x79')](_0x338761[_0xf272('0x36')],['ids','id'])||{})['spread'](function(_0xf4891a){for(var _0x4ac5f0=0x0;_0x4ac5f0<_0x338761[_0xf272('0x36')][_0xf272('0x57')]['length'];_0x4ac5f0+=0x1){socket['emit'](_0xf272('0x62'),{'UserId':Number(_0x338761['body'][_0xf272('0x57')][_0x4ac5f0]),'ChatQueueId':Number(_0x338761[_0xf272('0x28')]['id'])});}return _0xf4891a;});}})[_0xf272('0x18')](respondWithResult(_0x18db7f,null))['catch'](handleError(_0x18db7f,null));};exports[_0xf272('0x75')]=function(_0x3f3123,_0x4ba569){return db[_0xf272('0x22')][_0xf272('0x34')]({'where':{'id':_0x3f3123['params']['id']}})['then'](handleEntityNotFound(_0x4ba569,null))[_0xf272('0x18')](function(_0x3adbcd){if(_0x3adbcd){return _0x3adbcd['removeAgents'](_0x3f3123['query'][_0xf272('0x57')])[_0xf272('0x18')](function(){if(_[_0xf272('0x7a')](_0x3f3123[_0xf272('0x2c')][_0xf272('0x57')])){for(var _0x578f2d=0x0;_0x578f2d<_0x3f3123[_0xf272('0x2c')][_0xf272('0x57')]['length'];_0x578f2d+=0x1){socket[_0xf272('0x61')]('userChatQueue:remove',{'UserId':Number(_0x3f3123[_0xf272('0x2c')][_0xf272('0x57')][_0x578f2d]),'ChatQueueId':Number(_0x3f3123[_0xf272('0x28')]['id'])});}}else{socket['emit'](_0xf272('0x77'),{'UserId':Number(_0x3f3123[_0xf272('0x2c')][_0xf272('0x57')]),'ChatQueueId':Number(_0x3f3123[_0xf272('0x28')]['id'])});}});}})['then'](respondWithStatusCode(_0x4ba569,null))[_0xf272('0x27')](handleError(_0x4ba569,null));};exports[_0xf272('0x7b')]=function(_0x321171,_0x1fa98a){var _0x37bec8={};var _0x5a4c65={};var _0x54dbee;var _0x5a035c;return db[_0xf272('0x22')][_0xf272('0x54')]({'where':{'id':_0x321171[_0xf272('0x28')]['id']}})['then'](handleEntityNotFound(_0x1fa98a,null))[_0xf272('0x18')](function(_0x1b48b9){if(_0x1b48b9){_0x54dbee=_0x1b48b9;_0x5a4c65[_0xf272('0x29')]=_[_0xf272('0x2a')](db[_0xf272('0x4a')][_0xf272('0x2b')]);_0x5a4c65[_0xf272('0x2c')]=_[_0xf272('0x2a')](_0x321171[_0xf272('0x2c')]);_0x5a4c65[_0xf272('0x2d')]=_[_0xf272('0x40')](_0x5a4c65[_0xf272('0x29')],_0x5a4c65['query']);_0x37bec8[_0xf272('0x2e')]=_[_0xf272('0x40')](_0x5a4c65['model'],qs[_0xf272('0x2f')](_0x321171[_0xf272('0x2c')][_0xf272('0x2f')]));_0x37bec8[_0xf272('0x2e')]=_0x37bec8[_0xf272('0x2e')][_0xf272('0x30')]?_0x37bec8['attributes']:_0x5a4c65[_0xf272('0x29')];_0x37bec8['order']=qs['sort'](_0x321171[_0xf272('0x2c')][_0xf272('0x43')]);_0x37bec8[_0xf272('0x44')]=qs['filters'](_[_0xf272('0x45')](_0x321171['query'],_0x5a4c65[_0xf272('0x2d')]));if(_0x321171[_0xf272('0x2c')]['filter']){_0x37bec8[_0xf272('0x44')]=_['merge'](_0x37bec8[_0xf272('0x44')],{'$or':_[_0xf272('0x21')](_0x37bec8[_0xf272('0x2e')],function(_0x2cd679){var _0x3891cb={};_0x3891cb[_0x2cd679]={'$like':'%'+_0x321171['query']['filter']+'%'};return _0x3891cb;})});}_0x37bec8=_[_0xf272('0x32')]({},_0x37bec8,_0x321171['options']);return _0x54dbee[_0xf272('0x7b')](_0x37bec8);}})['then'](function(_0x596135){if(_0x596135){_0x5a035c=_0x596135[_0xf272('0x30')];if(!_0x321171['query']['hasOwnProperty'](_0xf272('0x42'))){_0x37bec8[_0xf272('0x12')]=qs[_0xf272('0x12')](_0x321171[_0xf272('0x2c')]['limit']);_0x37bec8[_0xf272('0x14')]=qs['offset'](_0x321171[_0xf272('0x2c')][_0xf272('0x14')]);}return _0x54dbee[_0xf272('0x7b')](_0x37bec8);}})[_0xf272('0x18')](function(_0x3bf295){if(_0x3bf295){return _0x3bf295?{'count':_0x5a035c,'rows':_0x3bf295}:null;}})[_0xf272('0x18')](respondWithResult(_0x1fa98a,null))[_0xf272('0x27')](handleError(_0x1fa98a,null));};
\ No newline at end of file
+var _0x3de1=['omit','spread','userChatQueue:save','isArray','getAgents','bluebird','util','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','status','end','json','offset','undefined','count','limit','set','then','destroy','get','ChatQueues','UserProfileResource','sendStatus','error','name','index','map','ChatQueue','rawAttributes','fieldName','type','key','getOptions','include','catch','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','UserChatQueue','hasOwnProperty','nolimit','sort','pick','where','filter','findAll','findAndCountAll','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','findOne','Team','order','getTeams','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','select','field','tq.TeamId','from','team_has_chat_queues','ChatQueueId\x20=\x20?','clone','toString','QueryTypes','every','all','union','compact','value','removeTeams','isEmpty','removeAgents','forEach','addAgents'];(function(_0x2662c8,_0x1351c7){var _0x27fba5=function(_0x1493cc){while(--_0x1493cc){_0x2662c8['push'](_0x2662c8['shift']());}};_0x27fba5(++_0x1351c7);}(_0x3de1,0x170));var _0x13de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3de1[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x13de('0x0'));var util=require(_0x13de('0x1'));var _=require(_0x13de('0x2'));var squel=require('squel');var Redis=require(_0x13de('0x3'));var qs=require(_0x13de('0x4'));var logger=require('../../config/logger')(_0x13de('0x5'));var config=require(_0x13de('0x6'));var db=require(_0x13de('0x7'))['db'];config[_0x13de('0x8')]=_['defaults'](config[_0x13de('0x8')],{'host':_0x13de('0x9'),'port':0x18eb});var socket=require(_0x13de('0xa'))(new Redis(config[_0x13de('0x8')]));require(_0x13de('0xb'))[_0x13de('0xc')](socket);function respondWithStatusCode(_0x25333e,_0x41f1a5){_0x41f1a5=_0x41f1a5||0xcc;return function(_0xffe4f4){if(_0xffe4f4){return _0x25333e['sendStatus'](_0x41f1a5);}return _0x25333e[_0x13de('0xd')](_0x41f1a5)[_0x13de('0xe')]();};}function respondWithResult(_0x56d766,_0x4cc713){_0x4cc713=_0x4cc713||0xc8;return function(_0x4d9dec){if(_0x4d9dec){return _0x56d766['status'](_0x4cc713)[_0x13de('0xf')](_0x4d9dec);}};}function respondWithFilteredResult(_0x5bf0b5,_0x327799){return function(_0x9d442){if(_0x9d442){var _0x30f6bd=typeof _0x327799[_0x13de('0x10')]===_0x13de('0x11')&&typeof _0x327799['limit']===_0x13de('0x11');var _0x22a452=_0x9d442['count'];var _0x53bcfb=_0x30f6bd?0x0:_0x327799[_0x13de('0x10')];var _0x47d36c=_0x30f6bd?_0x9d442[_0x13de('0x12')]:_0x327799[_0x13de('0x10')]+_0x327799[_0x13de('0x13')];var _0xabab30;if(_0x47d36c>=_0x22a452){_0x47d36c=_0x22a452;_0xabab30=0xc8;}else{_0xabab30=0xce;}_0x5bf0b5['status'](_0xabab30);return _0x5bf0b5[_0x13de('0x14')]('Content-Range',_0x53bcfb+'-'+_0x47d36c+'/'+_0x22a452)[_0x13de('0xf')](_0x9d442);}return null;};}function saveUpdates(_0x57b81c){return function(_0x43e30b){if(_0x43e30b){return _0x43e30b['update'](_0x57b81c)[_0x13de('0x15')](function(_0x3fcee7){return _0x3fcee7;});}return null;};}function removeEntity(_0x23c6be){return function(_0x33d0eb){if(_0x33d0eb){return _0x33d0eb[_0x13de('0x16')]()[_0x13de('0x15')](function(){var _0x14fb5a=_0x33d0eb[_0x13de('0x17')]({'plain':!![]});var _0x290f7e=_0x13de('0x18');return db[_0x13de('0x19')]['destroy']({'where':{'type':_0x290f7e,'resourceId':_0x14fb5a['id']}})[_0x13de('0x15')](function(){return _0x33d0eb;});})[_0x13de('0x15')](function(){_0x23c6be[_0x13de('0xd')](0xcc)[_0x13de('0xe')]();});}};}function handleEntityNotFound(_0x19fdc2){return function(_0x4a7151){if(!_0x4a7151){_0x19fdc2[_0x13de('0x1a')](0x194);}return _0x4a7151;};}function handleError(_0xd1e657,_0x33e64e){_0x33e64e=_0x33e64e||0x1f4;return function(_0x25ccd9){logger[_0x13de('0x1b')](_0x25ccd9['stack']);if(_0x25ccd9[_0x13de('0x1c')]){delete _0x25ccd9['name'];}_0xd1e657[_0x13de('0xd')](_0x33e64e)['send'](_0x25ccd9);};}exports[_0x13de('0x1d')]=function(_0x3a88eb,_0x391e94){var _0x4068d1={};var _0x42bf7d={'count':0x0,'rows':[]};var _0x59786e=_[_0x13de('0x1e')](db[_0x13de('0x1f')][_0x13de('0x20')],function(_0x2ef45c){return{'name':_0x2ef45c[_0x13de('0x21')],'type':_0x2ef45c[_0x13de('0x22')][_0x13de('0x23')]};});_0x4068d1=qs[_0x13de('0x24')](_0x59786e,_0x3a88eb);var _0x3d9d24={'where':_0x4068d1['where']};return db[_0x13de('0x1f')]['count'](_0x3d9d24)[_0x13de('0x15')](function(_0x3525ee){_0x42bf7d[_0x13de('0x12')]=_0x3525ee;_0x4068d1[_0x13de('0x25')]=qs[_0x13de('0x25')](_0x3a88eb['query']);return db[_0x13de('0x1f')]['findAll'](_0x4068d1);})[_0x13de('0x15')](function(_0xc892d8){_0x42bf7d['rows']=_0xc892d8;return _0x42bf7d;})['then'](respondWithFilteredResult(_0x391e94,_0x4068d1))[_0x13de('0x26')](handleError(_0x391e94,null));};exports[_0x13de('0x27')]=function(_0x5487bb,_0x144cea){var _0x543c31={'raw':!![],'where':{'id':_0x5487bb[_0x13de('0x28')]['id']}},_0x1e5bdf={};_0x1e5bdf[_0x13de('0x29')]=_[_0x13de('0x2a')](db[_0x13de('0x1f')][_0x13de('0x20')]);_0x1e5bdf[_0x13de('0x2b')]=_['keys'](_0x5487bb['query']);_0x1e5bdf[_0x13de('0x2c')]=_[_0x13de('0x2d')](_0x1e5bdf['model'],_0x1e5bdf['query']);_0x543c31[_0x13de('0x2e')]=_[_0x13de('0x2d')](_0x1e5bdf[_0x13de('0x29')],qs[_0x13de('0x2f')](_0x5487bb[_0x13de('0x2b')][_0x13de('0x2f')]));_0x543c31['attributes']=_0x543c31[_0x13de('0x2e')][_0x13de('0x30')]?_0x543c31[_0x13de('0x2e')]:_0x1e5bdf[_0x13de('0x29')];if(_0x5487bb[_0x13de('0x2b')][_0x13de('0x31')]){_0x543c31[_0x13de('0x25')]=[{'all':!![]}];}_0x543c31=_[_0x13de('0x32')]({},_0x543c31,_0x5487bb[_0x13de('0x33')]);return db[_0x13de('0x1f')][_0x13de('0x34')](_0x543c31)[_0x13de('0x15')](handleEntityNotFound(_0x144cea,null))[_0x13de('0x15')](respondWithResult(_0x144cea,null))['catch'](handleError(_0x144cea,null));};exports['create']=function(_0x15ba11,_0x47337c){return db[_0x13de('0x1f')][_0x13de('0x35')](_0x15ba11[_0x13de('0x36')],{})['then'](function(_0x50725d){var _0x449187=_0x15ba11['user'][_0x13de('0x17')]({'plain':!![]});if(!_0x449187)throw new Error(_0x13de('0x37'));if(_0x449187[_0x13de('0x38')]==='user'){var _0x493e5f=_0x50725d[_0x13de('0x17')]({'plain':!![]});var _0x5ad727='ChatQueues';return db[_0x13de('0x39')]['find']({'where':{'name':_0x5ad727,'userProfileId':_0x449187[_0x13de('0x3a')]},'raw':!![]})[_0x13de('0x15')](function(_0x1a66b2){if(_0x1a66b2&&_0x1a66b2[_0x13de('0x3b')]===0x0){return db[_0x13de('0x19')]['create']({'name':_0x493e5f[_0x13de('0x1c')],'resourceId':_0x493e5f['id'],'type':_0x1a66b2[_0x13de('0x1c')],'sectionId':_0x1a66b2['id']},{})['then'](function(){return _0x50725d;});}else{return _0x50725d;}})['catch'](function(_0x137123){logger[_0x13de('0x1b')](_0x13de('0x3c'),_0x137123);throw _0x137123;});}return _0x50725d;})[_0x13de('0x15')](respondWithResult(_0x47337c,0xc9))[_0x13de('0x26')](handleError(_0x47337c,null));};exports[_0x13de('0x3d')]=function(_0x520a43,_0x3a6fd6){if(_0x520a43[_0x13de('0x36')]['id']){delete _0x520a43['body']['id'];}return db[_0x13de('0x1f')][_0x13de('0x34')]({'where':{'id':_0x520a43[_0x13de('0x28')]['id']}})[_0x13de('0x15')](handleEntityNotFound(_0x3a6fd6,null))[_0x13de('0x15')](saveUpdates(_0x520a43['body'],null))[_0x13de('0x15')](respondWithResult(_0x3a6fd6,null))[_0x13de('0x26')](handleError(_0x3a6fd6,null));};exports[_0x13de('0x16')]=function(_0x150b7b,_0x278574){return db[_0x13de('0x1f')][_0x13de('0x34')]({'where':{'id':_0x150b7b[_0x13de('0x28')]['id']}})[_0x13de('0x15')](handleEntityNotFound(_0x278574,null))[_0x13de('0x15')](removeEntity(_0x278574,null))[_0x13de('0x26')](handleError(_0x278574,null));};exports[_0x13de('0x3e')]=function(_0x5b92c1,_0x494427){return db[_0x13de('0x1f')]['describe']()[_0x13de('0x15')](respondWithResult(_0x494427,null))[_0x13de('0x26')](handleError(_0x494427,null));};exports[_0x13de('0x3f')]=function(_0x3d4dd3,_0x3694c0){var _0x3ef33c={'raw':!![],'where':{}},_0x34c4e2={},_0x56fb2b;return db[_0x13de('0x1f')]['findOne']({'where':{'id':_0x3d4dd3['params']['id']}})[_0x13de('0x15')](handleEntityNotFound(_0x3694c0,null))[_0x13de('0x15')](function(_0x4adf83){if(_0x4adf83){_0x56fb2b=_0x4adf83['get']({'plain':!![]});_0x34c4e2[_0x13de('0x29')]=_[_0x13de('0x2a')](db[_0x13de('0x40')][_0x13de('0x20')]);_0x34c4e2['query']=_[_0x13de('0x2a')](_0x3d4dd3[_0x13de('0x2b')]);_0x34c4e2['filters']=_[_0x13de('0x2d')](_0x34c4e2['model'],_0x34c4e2[_0x13de('0x2b')]);_0x3ef33c[_0x13de('0x2e')]=_[_0x13de('0x2d')](_0x34c4e2[_0x13de('0x29')],qs['fields'](_0x3d4dd3[_0x13de('0x2b')][_0x13de('0x2f')]));_0x3ef33c['attributes']=_0x3ef33c[_0x13de('0x2e')][_0x13de('0x30')]?_0x3ef33c[_0x13de('0x2e')]:_0x34c4e2[_0x13de('0x29')];if(!_0x3d4dd3[_0x13de('0x2b')][_0x13de('0x41')](_0x13de('0x42'))){_0x3ef33c['limit']=qs['limit'](_0x3d4dd3['query'][_0x13de('0x13')]);_0x3ef33c[_0x13de('0x10')]=qs[_0x13de('0x10')](_0x3d4dd3[_0x13de('0x2b')][_0x13de('0x10')]);}_0x3ef33c['order']=qs[_0x13de('0x43')](_0x3d4dd3[_0x13de('0x2b')][_0x13de('0x43')]);_0x3ef33c['where']=qs[_0x13de('0x2c')](_[_0x13de('0x44')](_0x3d4dd3['query'],_0x34c4e2[_0x13de('0x2c')]));_0x3ef33c[_0x13de('0x45')]['ChatQueueId']=_0x4adf83['id'];if(_0x3d4dd3[_0x13de('0x2b')][_0x13de('0x46')]){_0x3ef33c[_0x13de('0x45')]=_[_0x13de('0x32')](_0x3ef33c[_0x13de('0x45')],{'$or':_[_0x13de('0x1e')](_0x3ef33c[_0x13de('0x2e')],function(_0x2bffc2){var _0x46835e={};_0x46835e[_0x2bffc2]={'$like':'%'+_0x3d4dd3[_0x13de('0x2b')][_0x13de('0x46')]+'%'};return _0x46835e;})});}_0x3ef33c=_[_0x13de('0x32')]({},_0x3ef33c,_0x3d4dd3[_0x13de('0x33')]);return db[_0x13de('0x40')][_0x13de('0x47')](_0x3ef33c);}})[_0x13de('0x15')](function(_0x32bfa8){if(_0x32bfa8){return db['User'][_0x13de('0x48')]({'where':{'id':_[_0x13de('0x1e')](_0x32bfa8,'UserId'),'role':_0x13de('0x49')},'attributes':['id',_0x13de('0x1c'),_0x13de('0x4a'),_0x13de('0x4b'),_0x13de('0x4c')]});}})[_0x13de('0x15')](function(_0x4949db){if(_0x4949db){return{'count':_0x4949db['count'],'rows':_[_0x13de('0x1e')](_0x4949db[_0x13de('0x4d')],function(_0x27b661){return{'membername':_0x27b661[_0x13de('0x1c')],'UserId':_0x27b661['id'],'queue_name':_0x56fb2b['name'],'ChatQueueId':_0x56fb2b['id'],'interface':util[_0x13de('0x4e')](_0x13de('0x4f'),'SIP',_0x27b661[_0x13de('0x1c')]),'penalty':0x0,'paused':_0x27b661[_0x13de('0x4a')],'createdAt':_0x27b661[_0x13de('0x4c')],'updatedAt':_0x27b661[_0x13de('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x13de('0x15')](respondWithFilteredResult(_0x3694c0,_0x3ef33c))[_0x13de('0x26')](handleError(_0x3694c0,null));};exports['getTeams']=function(_0x243434,_0x2707ab){var _0xf27d96={};var _0x508daf={};var _0x1554b2;var _0x429840;return db[_0x13de('0x1f')][_0x13de('0x50')]({'where':{'id':_0x243434[_0x13de('0x28')]['id']}})[_0x13de('0x15')](handleEntityNotFound(_0x2707ab,null))[_0x13de('0x15')](function(_0x4d21e4){if(_0x4d21e4){_0x1554b2=_0x4d21e4;_0x508daf['model']=_[_0x13de('0x2a')](db[_0x13de('0x51')][_0x13de('0x20')]);_0x508daf[_0x13de('0x2b')]=_['keys'](_0x243434[_0x13de('0x2b')]);_0x508daf['filters']=_[_0x13de('0x2d')](_0x508daf[_0x13de('0x29')],_0x508daf[_0x13de('0x2b')]);_0xf27d96['attributes']=_[_0x13de('0x2d')](_0x508daf[_0x13de('0x29')],qs['fields'](_0x243434[_0x13de('0x2b')][_0x13de('0x2f')]));_0xf27d96[_0x13de('0x2e')]=_0xf27d96[_0x13de('0x2e')][_0x13de('0x30')]?_0xf27d96['attributes']:_0x508daf[_0x13de('0x29')];_0xf27d96[_0x13de('0x52')]=qs[_0x13de('0x43')](_0x243434[_0x13de('0x2b')][_0x13de('0x43')]);_0xf27d96[_0x13de('0x45')]=qs[_0x13de('0x2c')](_[_0x13de('0x44')](_0x243434[_0x13de('0x2b')],_0x508daf[_0x13de('0x2c')]));if(_0x243434[_0x13de('0x2b')]['filter']){_0xf27d96[_0x13de('0x45')]=_[_0x13de('0x32')](_0xf27d96[_0x13de('0x45')],{'$or':_[_0x13de('0x1e')](_0xf27d96[_0x13de('0x2e')],function(_0x5b38ae){var _0x5547b2={};_0x5547b2[_0x5b38ae]={'$like':'%'+_0x243434[_0x13de('0x2b')][_0x13de('0x46')]+'%'};return _0x5547b2;})});}_0xf27d96=_[_0x13de('0x32')]({},_0xf27d96,_0x243434[_0x13de('0x33')]);return _0x1554b2[_0x13de('0x53')](_0xf27d96);}})[_0x13de('0x15')](function(_0x5c3e01){if(_0x5c3e01){_0x429840=_0x5c3e01[_0x13de('0x30')];if(!_0x243434[_0x13de('0x2b')][_0x13de('0x41')](_0x13de('0x42'))){_0xf27d96[_0x13de('0x13')]=qs[_0x13de('0x13')](_0x243434[_0x13de('0x2b')][_0x13de('0x13')]);_0xf27d96[_0x13de('0x10')]=qs[_0x13de('0x10')](_0x243434[_0x13de('0x2b')]['offset']);}return _0x1554b2[_0x13de('0x53')](_0xf27d96);}})[_0x13de('0x15')](function(_0xf8ac5e){if(_0xf8ac5e){return _0xf8ac5e?{'count':_0x429840,'rows':_0xf8ac5e}:null;}})[_0x13de('0x15')](respondWithResult(_0x2707ab,null))['catch'](handleError(_0x2707ab,null));};exports[_0x13de('0x54')]=function(_0x80485,_0x3ff4b1){var _0x45de19=_0x80485[_0x13de('0x36')][_0x13de('0x55')];return db['Team'][_0x13de('0x47')]({'where':{'id':_0x45de19},'attributes':['id'],'include':[{'model':db[_0x13de('0x56')],'as':_0x13de('0x57'),'attributes':['id',_0x13de('0x1c'),_0x13de('0x58'),_0x13de('0x59'),_0x13de('0x5a')],'raw':!![]}]})[_0x13de('0x15')](function(_0xdef1db){if(_0xdef1db){var _0x2a1cca=_[_0x13de('0x5b')](_0xdef1db,function(_0x4a000b){var _0x11de90=_0x4a000b[_0x13de('0x17')]({'plain':!![]});return _0x11de90[_0x13de('0x57')];});return db[_0x13de('0x1f')]['find']({'where':{'id':_0x80485[_0x13de('0x28')]['id']}})[_0x13de('0x15')](function(_0x1ef6d3){return db[_0x13de('0x5c')][_0x13de('0x5d')](function(_0x40ff8e){return _0x1ef6d3[_0x13de('0x54')](_0x45de19,{'transaction':_0x40ff8e})[_0x13de('0x15')](function(){return BPromise[_0x13de('0x5e')](_0x2a1cca,function(_0x5072ac){return db['UserChatQueue'][_0x13de('0x5f')]({'where':{'UserId':_0x5072ac['id'],'ChatQueueId':_0x80485['params']['id']},'transaction':_0x40ff8e});});})[_0x13de('0x15')](function(){_0x2a1cca['forEach'](function(_0x5750f7){socket[_0x13de('0x60')]('userChatQueue:save',{'UserId':_0x5750f7['id'],'ChatQueueId':_0x1ef6d3['id']});});});});});}})[_0x13de('0x15')](respondWithStatusCode(_0x3ff4b1,null))[_0x13de('0x26')](handleError(_0x3ff4b1,null));};exports['removeTeams']=function(_0x4be593,_0xab412c){return db[_0x13de('0x51')][_0x13de('0x47')]({'where':{'id':_0x4be593[_0x13de('0x2b')]['ids']},'attributes':['id'],'include':[{'model':db[_0x13de('0x56')],'as':_0x13de('0x57'),'attributes':['id'],'raw':!![]}]})[_0x13de('0x15')](handleEntityNotFound(_0xab412c,null))['then'](function(_0x5d12e2){var _0x5d5fce=_[_0x13de('0x1e')](_0x5d12e2,'id');var _0x3dfe5a=[];var _0x11e0aa=[];var _0x1a24e7=squel[_0x13de('0x61')]();_0x1a24e7[_0x13de('0x62')](_0x13de('0x63'))[_0x13de('0x64')](_0x13de('0x65'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x13de('0x45')](_0x13de('0x66'),_0x4be593['params']['id']);for(var _0x3bba86=0x0;_0x3bba86<_0x5d12e2['length'];_0x3bba86+=0x1){let _0x58f435=_0x5d12e2[_0x3bba86];for(var _0x27ec58=0x0;_0x27ec58<_0x58f435[_0x13de('0x57')][_0x13de('0x30')];_0x27ec58+=0x1){let _0x3b22a5=_0x58f435[_0x13de('0x57')][_0x27ec58];var _0x9f8d32=_0x1a24e7[_0x13de('0x67')]();_0x9f8d32[_0x13de('0x45')]('ut.UserId\x20=\x20?',_0x3b22a5['id']);_0x11e0aa['push'](db['sequelize']['query'](_0x9f8d32[_0x13de('0x68')](),{'type':db[_0x13de('0x5c')][_0x13de('0x69')]['SELECT']})[_0x13de('0x15')](function(_0x2eb74c){if(_0x2eb74c['length']===0x1){return _0x3b22a5['id'];}else{var _0x278967=_[_0x13de('0x6a')](_[_0x13de('0x1e')](_0x2eb74c,'TeamId'),function(_0x2eaa7e){return _['includes'](_0x5d5fce,_0x2eaa7e);});if(_0x278967){return _0x3b22a5['id'];}}}));}}return BPromise[_0x13de('0x6b')](_0x11e0aa)['then'](function(_0x305044){_0x3dfe5a=_(_0x3dfe5a)[_0x13de('0x6c')](_0x305044)[_0x13de('0x6d')]()[_0x13de('0x6e')]();return db['ChatQueue'][_0x13de('0x34')]({'where':{'id':_0x4be593['params']['id']}})[_0x13de('0x15')](function(_0x3280eb){return db[_0x13de('0x5c')][_0x13de('0x5d')](function(_0x40bb66){return _0x3280eb[_0x13de('0x6f')](_0x4be593[_0x13de('0x2b')][_0x13de('0x55')],{'transaction':_0x40bb66})[_0x13de('0x15')](function(){if(!_[_0x13de('0x70')](_0x3dfe5a)){return _0x3280eb[_0x13de('0x71')](_0x3dfe5a,{'transaction':_0x40bb66});}})[_0x13de('0x15')](function(){_0x3dfe5a[_0x13de('0x72')](function(_0x3c7920){socket[_0x13de('0x60')]('userChatQueue:remove',{'UserId':_0x3c7920,'ChatQueueId':_0x3280eb['id']});});});});});});})[_0x13de('0x15')](respondWithStatusCode(_0xab412c,null))[_0x13de('0x26')](handleError(_0xab412c,null));};exports['addAgents']=function(_0x2f23a0,_0x11ab96){return db['ChatQueue'][_0x13de('0x34')]({'where':{'id':_0x2f23a0[_0x13de('0x28')]['id']}})[_0x13de('0x15')](handleEntityNotFound(_0x11ab96,null))[_0x13de('0x15')](function(_0x270238){if(_0x270238){return _0x270238[_0x13de('0x73')](_0x2f23a0[_0x13de('0x36')]['ids'],_[_0x13de('0x74')](_0x2f23a0[_0x13de('0x36')],[_0x13de('0x55'),'id'])||{})[_0x13de('0x75')](function(_0x5d96b7){for(var _0x5be97e=0x0;_0x5be97e<_0x2f23a0[_0x13de('0x36')][_0x13de('0x55')][_0x13de('0x30')];_0x5be97e+=0x1){socket[_0x13de('0x60')](_0x13de('0x76'),{'UserId':Number(_0x2f23a0[_0x13de('0x36')][_0x13de('0x55')][_0x5be97e]),'ChatQueueId':Number(_0x2f23a0['params']['id'])});}return _0x5d96b7;});}})['then'](respondWithResult(_0x11ab96,null))[_0x13de('0x26')](handleError(_0x11ab96,null));};exports['removeAgents']=function(_0x4871d9,_0x422fbd){return db[_0x13de('0x1f')]['find']({'where':{'id':_0x4871d9[_0x13de('0x28')]['id']}})['then'](handleEntityNotFound(_0x422fbd,null))[_0x13de('0x15')](function(_0x3de88c){if(_0x3de88c){return _0x3de88c[_0x13de('0x71')](_0x4871d9[_0x13de('0x2b')][_0x13de('0x55')])['then'](function(){if(_[_0x13de('0x77')](_0x4871d9[_0x13de('0x2b')]['ids'])){for(var _0x29f18c=0x0;_0x29f18c<_0x4871d9[_0x13de('0x2b')][_0x13de('0x55')][_0x13de('0x30')];_0x29f18c+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x4871d9[_0x13de('0x2b')][_0x13de('0x55')][_0x29f18c]),'ChatQueueId':Number(_0x4871d9[_0x13de('0x28')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x4871d9['query'][_0x13de('0x55')]),'ChatQueueId':Number(_0x4871d9[_0x13de('0x28')]['id'])});}});}})[_0x13de('0x15')](respondWithStatusCode(_0x422fbd,null))[_0x13de('0x26')](handleError(_0x422fbd,null));};exports[_0x13de('0x78')]=function(_0x351127,_0x5f0b70){var _0x270aff={};var _0x567b18={};var _0x162c1e;var _0x61018d;return db[_0x13de('0x1f')][_0x13de('0x50')]({'where':{'id':_0x351127[_0x13de('0x28')]['id']}})[_0x13de('0x15')](handleEntityNotFound(_0x5f0b70,null))[_0x13de('0x15')](function(_0xbe2346){if(_0xbe2346){_0x162c1e=_0xbe2346;_0x567b18[_0x13de('0x29')]=_[_0x13de('0x2a')](db[_0x13de('0x56')][_0x13de('0x20')]);_0x567b18[_0x13de('0x2b')]=_['keys'](_0x351127[_0x13de('0x2b')]);_0x567b18[_0x13de('0x2c')]=_[_0x13de('0x2d')](_0x567b18[_0x13de('0x29')],_0x567b18[_0x13de('0x2b')]);_0x270aff[_0x13de('0x2e')]=_[_0x13de('0x2d')](_0x567b18['model'],qs[_0x13de('0x2f')](_0x351127['query'][_0x13de('0x2f')]));_0x270aff['attributes']=_0x270aff[_0x13de('0x2e')][_0x13de('0x30')]?_0x270aff['attributes']:_0x567b18[_0x13de('0x29')];_0x270aff[_0x13de('0x52')]=qs[_0x13de('0x43')](_0x351127[_0x13de('0x2b')]['sort']);_0x270aff[_0x13de('0x45')]=qs[_0x13de('0x2c')](_[_0x13de('0x44')](_0x351127['query'],_0x567b18['filters']));if(_0x351127[_0x13de('0x2b')][_0x13de('0x46')]){_0x270aff[_0x13de('0x45')]=_['merge'](_0x270aff[_0x13de('0x45')],{'$or':_['map'](_0x270aff[_0x13de('0x2e')],function(_0x4f0818){var _0x2538ec={};_0x2538ec[_0x4f0818]={'$like':'%'+_0x351127[_0x13de('0x2b')][_0x13de('0x46')]+'%'};return _0x2538ec;})});}_0x270aff=_[_0x13de('0x32')]({},_0x270aff,_0x351127[_0x13de('0x33')]);return _0x162c1e[_0x13de('0x78')](_0x270aff);}})[_0x13de('0x15')](function(_0x1cf2c7){if(_0x1cf2c7){_0x61018d=_0x1cf2c7[_0x13de('0x30')];if(!_0x351127[_0x13de('0x2b')][_0x13de('0x41')](_0x13de('0x42'))){_0x270aff[_0x13de('0x13')]=qs[_0x13de('0x13')](_0x351127[_0x13de('0x2b')][_0x13de('0x13')]);_0x270aff['offset']=qs[_0x13de('0x10')](_0x351127['query'][_0x13de('0x10')]);}return _0x162c1e[_0x13de('0x78')](_0x270aff);}})[_0x13de('0x15')](function(_0x5b27fa){if(_0x5b27fa){return _0x5b27fa?{'count':_0x61018d,'rows':_0x5b27fa}:null;}})[_0x13de('0x15')](respondWithResult(_0x5f0b70,null))[_0x13de('0x26')](handleError(_0x5f0b70,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index e320b01..69bc35e 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 _0x8eb1=['../../mysqldb','ChatQueue','setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8eb1,0x108));var _0x18eb=function(_0x30a04c,_0x1949e1){_0x30a04c=_0x30a04c-0x0;var _0x1da59b=_0x8eb1[_0x30a04c];return _0x1da59b;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x18eb('0x0'))['db'][_0x18eb('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x18eb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x18eb('0x3')};function emitEvent(_0x51b833){return function(_0x264b0e,_0x2bf482,_0x4a33b8){ChatQueueEvents['emit'](_0x51b833+':'+_0x264b0e['id'],_0x264b0e);ChatQueueEvents[_0x18eb('0x4')](_0x51b833,_0x264b0e);_0x4a33b8(null);};}for(var e in events){if(events[_0x18eb('0x5')](e)){var event=events[e];ChatQueue[_0x18eb('0x6')](e,emitEvent(event));}}module[_0x18eb('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0x82f0=['ChatQueue','save','update','emit','exports','events','../../mysqldb'];(function(_0x2b0649,_0x233956){var _0x131ab9=function(_0x42c09f){while(--_0x42c09f){_0x2b0649['push'](_0x2b0649['shift']());}};_0x131ab9(++_0x233956);}(_0x82f0,0xc9));var _0x082f=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x82f0[_0x5ddb1c];return _0x354adc;};'use strict';var EventEmitter=require(_0x082f('0x0'));var ChatQueue=require(_0x082f('0x1'))['db'][_0x082f('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x082f('0x3'),'afterUpdate':_0x082f('0x4'),'afterDestroy':'remove'};function emitEvent(_0xc15ea5){return function(_0x18593a,_0x5bfe40,_0x43414e){ChatQueueEvents[_0x082f('0x5')](_0xc15ea5+':'+_0x18593a['id'],_0x18593a);ChatQueueEvents['emit'](_0xc15ea5,_0x18593a);_0x43414e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x082f('0x6')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index dff7294..d49dc95 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 _0x78bb=['moment','bluebird','request-promise','path','rimraf','../../config/environment','ChatQueue','chat_queues','lodash','util','../../config/logger','api'];(function(_0x53a442,_0x1b0063){var _0x2e8e36=function(_0x191266){while(--_0x191266){_0x53a442['push'](_0x53a442['shift']());}};_0x2e8e36(++_0x1b0063);}(_0x78bb,0x74));var _0xb78b=function(_0xd2d54,_0x5329f7){_0xd2d54=_0xd2d54-0x0;var _0x78b113=_0x78bb[_0xd2d54];return _0x78b113;};'use strict';var _=require(_0xb78b('0x0'));var util=require(_0xb78b('0x1'));var logger=require(_0xb78b('0x2'))(_0xb78b('0x3'));var moment=require(_0xb78b('0x4'));var BPromise=require(_0xb78b('0x5'));var rp=require(_0xb78b('0x6'));var fs=require('fs');var path=require(_0xb78b('0x7'));var rimraf=require(_0xb78b('0x8'));var config=require(_0xb78b('0x9'));var attributes=require('./chatQueue.attributes');module['exports']=function(_0x15c70c,_0x28005f){return _0x15c70c['define'](_0xb78b('0xa'),attributes,{'tableName':_0xb78b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdd6a=['chat_queues','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatQueue.attributes','exports'];(function(_0x526fdd,_0x48a18e){var _0x5f0d48=function(_0x783b8d){while(--_0x783b8d){_0x526fdd['push'](_0x526fdd['shift']());}};_0x5f0d48(++_0x48a18e);}(_0xdd6a,0x169));var _0xadd6=function(_0x723288,_0x361804){_0x723288=_0x723288-0x0;var _0x45fecf=_0xdd6a[_0x723288];return _0x45fecf;};'use strict';var _=require(_0xadd6('0x0'));var util=require('util');var logger=require(_0xadd6('0x1'))(_0xadd6('0x2'));var moment=require(_0xadd6('0x3'));var BPromise=require(_0xadd6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xadd6('0x5'));var rimraf=require('rimraf');var config=require(_0xadd6('0x6'));var attributes=require(_0xadd6('0x7'));module[_0xadd6('0x8')]=function(_0x266dce,_0x51f135){return _0x266dce['define']('ChatQueue',attributes,{'tableName':_0xadd6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index adcc5a4..3c957e7 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 _0xa0a3=['ChatQueue','findAll','options','where','attributes','limit','include','map','model','ShowChatQueue','find','raw','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatQueue.socket','register','then','request\x20sent','debug','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','info','catch','GetChatQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa0a3,0x1e0));var _0x3a0a=function(_0x172318,_0x25c35f){_0x172318=_0x172318-0x0;var _0xf34564=_0xa0a3[_0x172318];return _0xf34564;};'use strict';var _=require('lodash');var util=require(_0x3a0a('0x0'));var moment=require(_0x3a0a('0x1'));var BPromise=require('bluebird');var rs=require(_0x3a0a('0x2'));var fs=require('fs');var Redis=require(_0x3a0a('0x3'));var db=require(_0x3a0a('0x4'))['db'];var utils=require(_0x3a0a('0x5'));var logger=require(_0x3a0a('0x6'))(_0x3a0a('0x7'));var config=require(_0x3a0a('0x8'));var jayson=require(_0x3a0a('0x9'));var client=jayson[_0x3a0a('0xa')][_0x3a0a('0xb')]({'port':0x232a});config[_0x3a0a('0xc')]=_[_0x3a0a('0xd')](config[_0x3a0a('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3a0a('0xc')]));require(_0x3a0a('0xe'))[_0x3a0a('0xf')](socket);function respondWithRpcPromise(_0x3460be,_0x43e9ec,_0x272435){return new BPromise(function(_0x42235e,_0x53f366){return client['request'](_0x3460be,_0x272435)[_0x3a0a('0x10')](function(_0x3b1003){logger['info']('ChatQueue,\x20%s,\x20%s',_0x43e9ec,_0x3a0a('0x11'));logger[_0x3a0a('0x12')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x43e9ec,_0x3a0a('0x11'),JSON[_0x3a0a('0x13')](_0x3b1003));if(_0x3b1003[_0x3a0a('0x14')]){if(_0x3b1003[_0x3a0a('0x14')][_0x3a0a('0x15')]===0x1f4){logger[_0x3a0a('0x14')](_0x3a0a('0x16'),_0x43e9ec,_0x3b1003[_0x3a0a('0x14')][_0x3a0a('0x17')]);return _0x53f366(_0x3b1003[_0x3a0a('0x14')][_0x3a0a('0x17')]);}logger[_0x3a0a('0x14')](_0x3a0a('0x16'),_0x43e9ec,_0x3b1003[_0x3a0a('0x14')]['message']);return _0x42235e(_0x3b1003[_0x3a0a('0x14')]['message']);}else{logger[_0x3a0a('0x18')](_0x3a0a('0x16'),_0x43e9ec,_0x3a0a('0x11'));_0x42235e(_0x3b1003['result'][_0x3a0a('0x17')]);}})[_0x3a0a('0x19')](function(_0x4f0372){logger[_0x3a0a('0x14')](_0x3a0a('0x16'),_0x43e9ec,_0x4f0372);_0x53f366(_0x4f0372);});});}exports[_0x3a0a('0x1a')]=function(_0x36ca41){var _0x91d764=this;return new Promise(function(_0x423990,_0x3e99f9){return db[_0x3a0a('0x1b')][_0x3a0a('0x1c')]({'raw':_0x36ca41[_0x3a0a('0x1d')]?_0x36ca41['options']['raw']===undefined?!![]:![]:!![],'where':_0x36ca41['options']?_0x36ca41[_0x3a0a('0x1d')][_0x3a0a('0x1e')]||null:null,'attributes':_0x36ca41[_0x3a0a('0x1d')]?_0x36ca41[_0x3a0a('0x1d')][_0x3a0a('0x1f')]||null:null,'limit':_0x36ca41['options']?_0x36ca41[_0x3a0a('0x1d')][_0x3a0a('0x20')]||null:null,'include':_0x36ca41[_0x3a0a('0x1d')]?_0x36ca41['options'][_0x3a0a('0x21')]?_[_0x3a0a('0x22')](_0x36ca41['options']['include'],function(_0x16e93d){return{'model':db[_0x16e93d[_0x3a0a('0x23')]],'as':_0x16e93d['as'],'attributes':_0x16e93d[_0x3a0a('0x1f')],'include':_0x16e93d['include']?_[_0x3a0a('0x22')](_0x16e93d[_0x3a0a('0x21')],function(_0x130ca6){return{'model':db[_0x130ca6[_0x3a0a('0x23')]],'as':_0x130ca6['as'],'attributes':_0x130ca6[_0x3a0a('0x1f')],'include':_0x130ca6['include']?_['map'](_0x130ca6[_0x3a0a('0x21')],function(_0x3d01d8){return{'model':db[_0x3d01d8['model']],'as':_0x3d01d8['as'],'attributes':_0x3d01d8['attributes']};}):[]};}):[]};}):[]:[]})[_0x3a0a('0x10')](function(_0x2e7481){logger[_0x3a0a('0x18')](_0x3a0a('0x1a'),_0x36ca41);logger['debug']('GetChatQueue',_0x36ca41,JSON[_0x3a0a('0x13')](_0x2e7481));_0x423990(_0x2e7481);})[_0x3a0a('0x19')](function(_0x177181){logger['error'](_0x3a0a('0x1a'),_0x177181[_0x3a0a('0x17')],_0x36ca41);_0x3e99f9(_0x91d764[_0x3a0a('0x14')](0x1f4,_0x177181[_0x3a0a('0x17')]));});});};exports[_0x3a0a('0x24')]=function(_0x3184cb){var _0x26ff5d=this;return new Promise(function(_0x1218fd,_0x21be1c){return db['ChatQueue'][_0x3a0a('0x25')]({'raw':_0x3184cb[_0x3a0a('0x1d')]?_0x3184cb[_0x3a0a('0x1d')][_0x3a0a('0x26')]===undefined?!![]:![]:!![],'where':_0x3184cb[_0x3a0a('0x1d')]?_0x3184cb['options'][_0x3a0a('0x1e')]||null:null,'attributes':_0x3184cb[_0x3a0a('0x1d')]?_0x3184cb[_0x3a0a('0x1d')][_0x3a0a('0x1f')]||null:null,'include':_0x3184cb[_0x3a0a('0x1d')]?_0x3184cb[_0x3a0a('0x1d')]['include']?_[_0x3a0a('0x22')](_0x3184cb[_0x3a0a('0x1d')][_0x3a0a('0x21')],function(_0x32c2e1){return{'model':db[_0x32c2e1[_0x3a0a('0x23')]],'as':_0x32c2e1['as'],'attributes':_0x32c2e1[_0x3a0a('0x1f')],'include':_0x32c2e1[_0x3a0a('0x21')]?_[_0x3a0a('0x22')](_0x32c2e1['include'],function(_0x2301be){return{'model':db[_0x2301be[_0x3a0a('0x23')]],'as':_0x2301be['as'],'attributes':_0x2301be[_0x3a0a('0x1f')],'include':_0x2301be[_0x3a0a('0x21')]?_[_0x3a0a('0x22')](_0x2301be[_0x3a0a('0x21')],function(_0x2ab6d2){return{'model':db[_0x2ab6d2[_0x3a0a('0x23')]],'as':_0x2ab6d2['as'],'attributes':_0x2ab6d2['attributes']};}):[]};}):[]};}):[]:[]})[_0x3a0a('0x10')](function(_0x143696){logger[_0x3a0a('0x18')](_0x3a0a('0x24'),_0x3184cb);logger[_0x3a0a('0x12')](_0x3a0a('0x24'),_0x3184cb,JSON[_0x3a0a('0x13')](_0x143696));_0x1218fd(_0x143696);})[_0x3a0a('0x19')](function(_0xea232d){logger['error'](_0x3a0a('0x24'),_0xea232d['message'],_0x3184cb);_0x21be1c(_0x26ff5d[_0x3a0a('0x14')](0x1f4,_0xea232d[_0x3a0a('0x17')]));});});};
\ No newline at end of file
+var _0x153c=['rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','register','then','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','ChatQueue','findAll','options','raw','where','include','map','model','attributes','GetChatQueue','debug','ShowChatQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x41bc22,_0x18f647){var _0x56b23c=function(_0x321e62){while(--_0x321e62){_0x41bc22['push'](_0x41bc22['shift']());}};_0x56b23c(++_0x18f647);}(_0x153c,0x8c));var _0xc153=function(_0x1f8a6e,_0x5bb5d0){_0x1f8a6e=_0x1f8a6e-0x0;var _0x389dd8=_0x153c[_0x1f8a6e];return _0x389dd8;};'use strict';var _=require(_0xc153('0x0'));var util=require(_0xc153('0x1'));var moment=require(_0xc153('0x2'));var BPromise=require(_0xc153('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc153('0x4'));var db=require(_0xc153('0x5'))['db'];var utils=require(_0xc153('0x6'));var logger=require(_0xc153('0x7'))(_0xc153('0x8'));var config=require(_0xc153('0x9'));var jayson=require(_0xc153('0xa'));var client=jayson['client'][_0xc153('0xb')]({'port':0x232a});config[_0xc153('0xc')]=_[_0xc153('0xd')](config[_0xc153('0xc')],{'host':_0xc153('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatQueue.socket')[_0xc153('0xf')](socket);function respondWithRpcPromise(_0x3566e3,_0x12ecca,_0x4040b3){return new BPromise(function(_0x1d706e,_0x5367d7){return client['request'](_0x3566e3,_0x4040b3)[_0xc153('0x10')](function(_0x44905b){logger['info'](_0xc153('0x11'),_0x12ecca,_0xc153('0x12'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x12ecca,_0xc153('0x12'),JSON[_0xc153('0x13')](_0x44905b));if(_0x44905b[_0xc153('0x14')]){if(_0x44905b['error'][_0xc153('0x15')]===0x1f4){logger[_0xc153('0x14')](_0xc153('0x11'),_0x12ecca,_0x44905b['error'][_0xc153('0x16')]);return _0x5367d7(_0x44905b[_0xc153('0x14')]['message']);}logger['error'](_0xc153('0x11'),_0x12ecca,_0x44905b[_0xc153('0x14')][_0xc153('0x16')]);return _0x1d706e(_0x44905b[_0xc153('0x14')][_0xc153('0x16')]);}else{logger[_0xc153('0x17')](_0xc153('0x11'),_0x12ecca,_0xc153('0x12'));_0x1d706e(_0x44905b['result'][_0xc153('0x16')]);}})[_0xc153('0x18')](function(_0x19fc4e){logger['error'](_0xc153('0x11'),_0x12ecca,_0x19fc4e);_0x5367d7(_0x19fc4e);});});}exports['GetChatQueue']=function(_0x596131){var _0x2198ff=this;return new Promise(function(_0x285e71,_0x2954d){return db[_0xc153('0x19')][_0xc153('0x1a')]({'raw':_0x596131[_0xc153('0x1b')]?_0x596131['options'][_0xc153('0x1c')]===undefined?!![]:![]:!![],'where':_0x596131['options']?_0x596131[_0xc153('0x1b')][_0xc153('0x1d')]||null:null,'attributes':_0x596131[_0xc153('0x1b')]?_0x596131[_0xc153('0x1b')]['attributes']||null:null,'limit':_0x596131['options']?_0x596131[_0xc153('0x1b')]['limit']||null:null,'include':_0x596131[_0xc153('0x1b')]?_0x596131[_0xc153('0x1b')][_0xc153('0x1e')]?_[_0xc153('0x1f')](_0x596131['options'][_0xc153('0x1e')],function(_0x39bbdb){return{'model':db[_0x39bbdb[_0xc153('0x20')]],'as':_0x39bbdb['as'],'attributes':_0x39bbdb[_0xc153('0x21')],'include':_0x39bbdb[_0xc153('0x1e')]?_[_0xc153('0x1f')](_0x39bbdb['include'],function(_0x319405){return{'model':db[_0x319405['model']],'as':_0x319405['as'],'attributes':_0x319405[_0xc153('0x21')],'include':_0x319405[_0xc153('0x1e')]?_['map'](_0x319405[_0xc153('0x1e')],function(_0x38033f){return{'model':db[_0x38033f['model']],'as':_0x38033f['as'],'attributes':_0x38033f[_0xc153('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc153('0x10')](function(_0x27315f){logger['info'](_0xc153('0x22'),_0x596131);logger[_0xc153('0x23')](_0xc153('0x22'),_0x596131,JSON['stringify'](_0x27315f));_0x285e71(_0x27315f);})[_0xc153('0x18')](function(_0x136524){logger[_0xc153('0x14')](_0xc153('0x22'),_0x136524['message'],_0x596131);_0x2954d(_0x2198ff[_0xc153('0x14')](0x1f4,_0x136524['message']));});});};exports[_0xc153('0x24')]=function(_0x5c1741){var _0x3be25b=this;return new Promise(function(_0x23a5be,_0x4f2e7c){return db[_0xc153('0x19')]['find']({'raw':_0x5c1741['options']?_0x5c1741[_0xc153('0x1b')][_0xc153('0x1c')]===undefined?!![]:![]:!![],'where':_0x5c1741[_0xc153('0x1b')]?_0x5c1741[_0xc153('0x1b')][_0xc153('0x1d')]||null:null,'attributes':_0x5c1741['options']?_0x5c1741[_0xc153('0x1b')][_0xc153('0x21')]||null:null,'include':_0x5c1741[_0xc153('0x1b')]?_0x5c1741[_0xc153('0x1b')][_0xc153('0x1e')]?_[_0xc153('0x1f')](_0x5c1741[_0xc153('0x1b')][_0xc153('0x1e')],function(_0x3b57a7){return{'model':db[_0x3b57a7[_0xc153('0x20')]],'as':_0x3b57a7['as'],'attributes':_0x3b57a7['attributes'],'include':_0x3b57a7['include']?_[_0xc153('0x1f')](_0x3b57a7['include'],function(_0x3e1de5){return{'model':db[_0x3e1de5[_0xc153('0x20')]],'as':_0x3e1de5['as'],'attributes':_0x3e1de5[_0xc153('0x21')],'include':_0x3e1de5['include']?_[_0xc153('0x1f')](_0x3e1de5[_0xc153('0x1e')],function(_0x1c1d4d){return{'model':db[_0x1c1d4d[_0xc153('0x20')]],'as':_0x1c1d4d['as'],'attributes':_0x1c1d4d[_0xc153('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc153('0x10')](function(_0x412455){logger[_0xc153('0x17')]('ShowChatQueue',_0x5c1741);logger['debug'](_0xc153('0x24'),_0x5c1741,JSON[_0xc153('0x13')](_0x412455));_0x23a5be(_0x412455);})[_0xc153('0x18')](function(_0x447c3c){logger[_0xc153('0x14')](_0xc153('0x24'),_0x447c3c['message'],_0x5c1741);_0x4f2e7c(_0x3be25b[_0xc153('0x14')](0x1f4,_0x447c3c[_0xc153('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 8b2b003..7d0ca4e 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 _0x00bb=['removeListener','length','chatQueue:','./chatQueue.events','save','remove','emit'];(function(_0x5f08a6,_0x400121){var _0x5d0641=function(_0x304467){while(--_0x304467){_0x5f08a6['push'](_0x5f08a6['shift']());}};_0x5d0641(++_0x400121);}(_0x00bb,0x1d8));var _0xb00b=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x00bb[_0x33032e];return _0x13316b;};'use strict';var ChatQueueEvents=require(_0xb00b('0x0'));var events=[_0xb00b('0x1'),_0xb00b('0x2'),'update'];function createListener(_0x170f94,_0x47a3bf){return function(_0x278c5e){_0x47a3bf[_0xb00b('0x3')](_0x170f94,_0x278c5e);};}function removeListener(_0x582ef9,_0x14b5d0){return function(){ChatQueueEvents[_0xb00b('0x4')](_0x582ef9,_0x14b5d0);};}exports['register']=function(_0x574cf8){for(var _0x532ffb=0x0,_0x36e363=events[_0xb00b('0x5')];_0x532ffb<_0x36e363;_0x532ffb++){var _0x41dfc9=events[_0x532ffb];var _0x37f07d=createListener(_0xb00b('0x6')+_0x41dfc9,_0x574cf8);ChatQueueEvents['on'](_0x41dfc9,_0x37f07d);}};
\ No newline at end of file
+var _0xda55=['chatQueue:','./chatQueue.events','save','emit','removeListener','length'];(function(_0x5964d3,_0x41e285){var _0x41c5dd=function(_0x3dee3e){while(--_0x3dee3e){_0x5964d3['push'](_0x5964d3['shift']());}};_0x41c5dd(++_0x41e285);}(_0xda55,0x6d));var _0x5da5=function(_0x34ca5a,_0x2f14b1){_0x34ca5a=_0x34ca5a-0x0;var _0x38c2be=_0xda55[_0x34ca5a];return _0x38c2be;};'use strict';var ChatQueueEvents=require(_0x5da5('0x0'));var events=[_0x5da5('0x1'),'remove','update'];function createListener(_0x13ecbc,_0x240a49){return function(_0x26a443){_0x240a49[_0x5da5('0x2')](_0x13ecbc,_0x26a443);};}function removeListener(_0x1c3afd,_0x5da254){return function(){ChatQueueEvents[_0x5da5('0x3')](_0x1c3afd,_0x5da254);};}exports['register']=function(_0x356a37){for(var _0x58e7b3=0x0,_0x2fd877=events[_0x5da5('0x4')];_0x58e7b3<_0x2fd877;_0x58e7b3++){var _0x71b187=events[_0x58e7b3];var _0x46290d=createListener(_0x5da5('0x5')+_0x71b187,_0x356a37);ChatQueueEvents['on'](_0x71b187,_0x46290d);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index e926c52..e3fb326 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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3e74,0x175));var _0x43e7=function(_0x15757e,_0x8031c2){_0x15757e=_0x15757e-0x0;var _0x5a5843=_0x3e74[_0x15757e];return _0x5a5843;};'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 _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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3e74,0x175));var _0x43e7=function(_0x571896,_0x2edf00){_0x571896=_0x571896-0x0;var _0x20a002=_0x3e74[_0x571896];return _0x20a002;};'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
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index f29054d..e4599d9 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 _0x71ef=['moment','exports','STRING','DATE'];(function(_0x5923e8,_0xc8d316){var _0x7a1148=function(_0x95a6bc){while(--_0x95a6bc){_0x5923e8['push'](_0x5923e8['shift']());}};_0x7a1148(++_0xc8d316);}(_0x71ef,0x140));var _0xf71e=function(_0x1399d6,_0x2c1661){_0x1399d6=_0x1399d6-0x0;var _0x4a9db4=_0x71ef[_0x1399d6];return _0x4a9db4;};'use strict';var moment=require(_0xf71e('0x0'));var Sequelize=require('sequelize');module[_0xf71e('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xf71e('0x2')]},'joinAt':{'type':Sequelize[_0xf71e('0x3')]},'leaveAt':{'type':Sequelize[_0xf71e('0x3')]},'acceptAt':{'type':Sequelize[_0xf71e('0x3')]},'exitAt':{'type':Sequelize[_0xf71e('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x100a=['moment','sequelize','exports','STRING','DATE'];(function(_0x20c88b,_0x1e45e1){var _0x1204db=function(_0x198dd9){while(--_0x198dd9){_0x20c88b['push'](_0x20c88b['shift']());}};_0x1204db(++_0x1e45e1);}(_0x100a,0x87));var _0xa100=function(_0x4d166c,_0x5a4732){_0x4d166c=_0x4d166c-0x0;var _0x4c68b2=_0x100a[_0x4d166c];return _0x4c68b2;};'use strict';var moment=require(_0xa100('0x0'));var Sequelize=require(_0xa100('0x1'));module[_0xa100('0x2')]={'uniqueid':{'type':Sequelize[_0xa100('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa100('0x3')]},'joinAt':{'type':Sequelize[_0xa100('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xa100('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 8fbcb94..8b31c4c 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 _0x7163=['key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','show','params','includeAll','find','create','body','catch','describe','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','ChatQueueReport','rawAttributes','fieldName','type'];(function(_0x123af9,_0x9ae1a8){var _0x379fa9=function(_0x306b03){while(--_0x306b03){_0x123af9['push'](_0x123af9['shift']());}};_0x379fa9(++_0x9ae1a8);}(_0x7163,0x1ef));var _0x3716=function(_0xa2c0a3,_0x5bbac0){_0xa2c0a3=_0xa2c0a3-0x0;var _0x52c618=_0x7163[_0xa2c0a3];return _0x52c618;};'use strict';var emlformat=require(_0x3716('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3716('0x1'));var rp=require(_0x3716('0x2'));var moment=require(_0x3716('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3716('0x4'));var util=require(_0x3716('0x5'));var path=require(_0x3716('0x6'));var sox=require(_0x3716('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3716('0x8'));var _=require(_0x3716('0x9'));var squel=require(_0x3716('0xa'));var crypto=require(_0x3716('0xb'));var jsforce=require(_0x3716('0xc'));var deskjs=require(_0x3716('0xd'));var toCsv=require(_0x3716('0xe'));var querystring=require(_0x3716('0xf'));var Papa=require(_0x3716('0x10'));var Redis=require(_0x3716('0x11'));var authService=require(_0x3716('0x12'));var qs=require(_0x3716('0x13'));var as=require(_0x3716('0x14'));var hardwareService=require(_0x3716('0x15'));var logger=require(_0x3716('0x16'))(_0x3716('0x17'));var utils=require(_0x3716('0x18'));var config=require(_0x3716('0x19'));var licenseUtil=require(_0x3716('0x1a'));var db=require(_0x3716('0x1b'))['db'];function respondWithStatusCode(_0x2c32cf,_0x2bbb95){_0x2bbb95=_0x2bbb95||0xcc;return function(_0x21925a){if(_0x21925a){return _0x2c32cf[_0x3716('0x1c')](_0x2bbb95);}return _0x2c32cf[_0x3716('0x1d')](_0x2bbb95)[_0x3716('0x1e')]();};}function respondWithResult(_0xc095c4,_0x131c5a){_0x131c5a=_0x131c5a||0xc8;return function(_0x4d1791){if(_0x4d1791){return _0xc095c4['status'](_0x131c5a)['json'](_0x4d1791);}};}function respondWithFilteredResult(_0x493b7d,_0x372785){return function(_0x5bbc0a){if(_0x5bbc0a){var _0x166835=typeof _0x372785[_0x3716('0x1f')]===_0x3716('0x20')&&typeof _0x372785['limit']==='undefined';var _0x5f3833=_0x5bbc0a['count'];var _0x27fa57=_0x166835?0x0:_0x372785[_0x3716('0x1f')];var _0x5d16c4=_0x166835?_0x5bbc0a[_0x3716('0x21')]:_0x372785[_0x3716('0x1f')]+_0x372785[_0x3716('0x22')];var _0xf6c764;if(_0x5d16c4>=_0x5f3833){_0x5d16c4=_0x5f3833;_0xf6c764=0xc8;}else{_0xf6c764=0xce;}_0x493b7d[_0x3716('0x1d')](_0xf6c764);return _0x493b7d[_0x3716('0x23')](_0x3716('0x24'),_0x27fa57+'-'+_0x5d16c4+'/'+_0x5f3833)['json'](_0x5bbc0a);}return null;};}function patchUpdates(_0x4cd0a6){return function(_0x524db1){try{jsonpatch[_0x3716('0x25')](_0x524db1,_0x4cd0a6,!![]);}catch(_0x49a885){return BPromise[_0x3716('0x26')](_0x49a885);}return _0x524db1[_0x3716('0x27')]();};}function saveUpdates(_0x2cccca,_0x233517){return function(_0x2b5296){if(_0x2b5296){return _0x2b5296[_0x3716('0x28')](_0x2cccca)[_0x3716('0x29')](function(_0x12bc19){return _0x12bc19;});}return null;};}function removeEntity(_0x1f18b2,_0x483bdd){return function(_0xec15ce){if(_0xec15ce){return _0xec15ce[_0x3716('0x2a')]()[_0x3716('0x29')](function(){_0x1f18b2['status'](0xcc)[_0x3716('0x1e')]();});}};}function handleEntityNotFound(_0x3e7452,_0x4daec7){return function(_0x3fd2bf){if(!_0x3fd2bf){_0x3e7452['sendStatus'](0x194);}return _0x3fd2bf;};}function handleError(_0x224451,_0x2c3df6){_0x2c3df6=_0x2c3df6||0x1f4;return function(_0x203310){logger['error'](_0x203310[_0x3716('0x2b')]);if(_0x203310['name']){delete _0x203310[_0x3716('0x2c')];}_0x224451[_0x3716('0x1d')](_0x2c3df6)['send'](_0x203310);};}exports[_0x3716('0x2d')]=function(_0x3dcf6b,_0x1c29b8){var _0xc5211={},_0x1e413c={},_0x4f76dc={'count':0x0,'rows':[]};var _0x2fdfa1=_[_0x3716('0x2e')](db[_0x3716('0x2f')][_0x3716('0x30')],function(_0x4fee70){return{'name':_0x4fee70[_0x3716('0x31')],'type':_0x4fee70[_0x3716('0x32')][_0x3716('0x33')]};});_0x1e413c[_0x3716('0x34')]=_[_0x3716('0x2e')](_0x2fdfa1,'name');_0x1e413c[_0x3716('0x35')]=_[_0x3716('0x36')](_0x3dcf6b[_0x3716('0x35')]);_0x1e413c['filters']=_['intersection'](_0x1e413c[_0x3716('0x34')],_0x1e413c[_0x3716('0x35')]);_0xc5211[_0x3716('0x37')]=_[_0x3716('0x38')](_0x1e413c['model'],qs[_0x3716('0x39')](_0x3dcf6b[_0x3716('0x35')][_0x3716('0x39')]));_0xc5211[_0x3716('0x37')]=_0xc5211[_0x3716('0x37')][_0x3716('0x3a')]?_0xc5211['attributes']:_0x1e413c[_0x3716('0x34')];if(!_0x3dcf6b[_0x3716('0x35')][_0x3716('0x3b')]('nolimit')){_0xc5211['limit']=qs[_0x3716('0x22')](_0x3dcf6b['query'][_0x3716('0x22')]);_0xc5211[_0x3716('0x1f')]=qs[_0x3716('0x1f')](_0x3dcf6b[_0x3716('0x35')][_0x3716('0x1f')]);}_0xc5211[_0x3716('0x3c')]=qs[_0x3716('0x3d')](_0x3dcf6b[_0x3716('0x35')]['sort']);_0xc5211[_0x3716('0x3e')]=qs[_0x3716('0x3f')](_[_0x3716('0x40')](_0x3dcf6b['query'],_0x1e413c[_0x3716('0x3f')]),_0x2fdfa1);if(_0x3dcf6b['query'][_0x3716('0x41')]){_0xc5211[_0x3716('0x3e')]=_[_0x3716('0x42')](_0xc5211[_0x3716('0x3e')],{'$or':_[_0x3716('0x2e')](_0x2fdfa1,function(_0x207d5e){if(_0x207d5e[_0x3716('0x32')]!==_0x3716('0x43')){var _0x4028b9={};_0x4028b9[_0x207d5e[_0x3716('0x2c')]]={'$like':'%'+_0x3dcf6b[_0x3716('0x35')]['filter']+'%'};return _0x4028b9;}})});}_0xc5211=_[_0x3716('0x42')]({},_0xc5211,_0x3dcf6b[_0x3716('0x44')]);var _0xe69c79={'where':_0xc5211[_0x3716('0x3e')]};return db['ChatQueueReport'][_0x3716('0x21')](_0xe69c79)[_0x3716('0x29')](function(_0x48a539){_0x4f76dc[_0x3716('0x21')]=_0x48a539;if(_0x3dcf6b[_0x3716('0x35')]['includeAll']){_0xc5211[_0x3716('0x45')]=[{'all':!![]}];}return db[_0x3716('0x2f')]['findAll'](_0xc5211);})[_0x3716('0x29')](function(_0xe4b86a){_0x4f76dc['rows']=_0xe4b86a;return _0x4f76dc;})[_0x3716('0x29')](respondWithFilteredResult(_0x1c29b8,_0xc5211))['catch'](handleError(_0x1c29b8,null));};exports[_0x3716('0x46')]=function(_0x215ca6,_0x50dabb){var _0x55147c={'raw':!![],'where':{'id':_0x215ca6[_0x3716('0x47')]['id']}},_0x100807={};_0x100807[_0x3716('0x34')]=_['keys'](db[_0x3716('0x2f')][_0x3716('0x30')]);_0x100807['query']=_[_0x3716('0x36')](_0x215ca6['query']);_0x100807[_0x3716('0x3f')]=_[_0x3716('0x38')](_0x100807[_0x3716('0x34')],_0x100807['query']);_0x55147c['attributes']=_[_0x3716('0x38')](_0x100807[_0x3716('0x34')],qs['fields'](_0x215ca6[_0x3716('0x35')][_0x3716('0x39')]));_0x55147c[_0x3716('0x37')]=_0x55147c[_0x3716('0x37')][_0x3716('0x3a')]?_0x55147c[_0x3716('0x37')]:_0x100807[_0x3716('0x34')];if(_0x215ca6['query'][_0x3716('0x48')]){_0x55147c[_0x3716('0x45')]=[{'all':!![]}];}_0x55147c=_[_0x3716('0x42')]({},_0x55147c,_0x215ca6[_0x3716('0x44')]);return db[_0x3716('0x2f')][_0x3716('0x49')](_0x55147c)[_0x3716('0x29')](handleEntityNotFound(_0x50dabb,null))['then'](respondWithResult(_0x50dabb,null))['catch'](handleError(_0x50dabb,null));};exports['create']=function(_0x5b5df8,_0x1ef5da){return db[_0x3716('0x2f')][_0x3716('0x4a')](_0x5b5df8[_0x3716('0x4b')],{})['then'](respondWithResult(_0x1ef5da,0xc9))[_0x3716('0x4c')](handleError(_0x1ef5da,null));};exports['update']=function(_0xf06450,_0x524088){if(_0xf06450[_0x3716('0x4b')]['id']){delete _0xf06450['body']['id'];}return db[_0x3716('0x2f')][_0x3716('0x49')]({'where':{'id':_0xf06450[_0x3716('0x47')]['id']}})[_0x3716('0x29')](handleEntityNotFound(_0x524088,null))[_0x3716('0x29')](saveUpdates(_0xf06450[_0x3716('0x4b')],null))[_0x3716('0x29')](respondWithResult(_0x524088,null))[_0x3716('0x4c')](handleError(_0x524088,null));};exports[_0x3716('0x2a')]=function(_0xca5eca,_0x3f05de){return db['ChatQueueReport']['find']({'where':{'id':_0xca5eca[_0x3716('0x47')]['id']}})[_0x3716('0x29')](handleEntityNotFound(_0x3f05de,null))['then'](removeEntity(_0x3f05de,null))[_0x3716('0x4c')](handleError(_0x3f05de,null));};exports[_0x3716('0x4d')]=function(_0x2e439e,_0x2ae48b){return db[_0x3716('0x2f')]['describe']()[_0x3716('0x29')](respondWithResult(_0x2ae48b,null))[_0x3716('0x4c')](handleError(_0x2ae48b,null));};
\ No newline at end of file
+var _0xd43e=['to-csv','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','Content-Range','json','apply','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','ChatQueueReport','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0xd43e,0x88));var _0xed43=function(_0x5b9168,_0x203c8a){_0x5b9168=_0x5b9168-0x0;var _0x1c8403=_0xd43e[_0x5b9168];return _0x1c8403;};'use strict';var emlformat=require(_0xed43('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xed43('0x1'));var jsonpatch=require(_0xed43('0x2'));var rp=require(_0xed43('0x3'));var moment=require(_0xed43('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xed43('0x5'));var path=require(_0xed43('0x6'));var sox=require(_0xed43('0x7'));var csv=require(_0xed43('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xed43('0x9'));var _=require(_0xed43('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xed43('0xb'));var toCsv=require(_0xed43('0x8'));var querystring=require(_0xed43('0xc'));var Papa=require(_0xed43('0xd'));var Redis=require(_0xed43('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xed43('0xf'));var as=require(_0xed43('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed43('0x11'))(_0xed43('0x12'));var utils=require(_0xed43('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xed43('0x14'))['db'];function respondWithStatusCode(_0x34027b,_0x4eed04){_0x4eed04=_0x4eed04||0xcc;return function(_0x1519aa){if(_0x1519aa){return _0x34027b[_0xed43('0x15')](_0x4eed04);}return _0x34027b[_0xed43('0x16')](_0x4eed04)[_0xed43('0x17')]();};}function respondWithResult(_0x2adbc5,_0x403a89){_0x403a89=_0x403a89||0xc8;return function(_0x597544){if(_0x597544){return _0x2adbc5[_0xed43('0x16')](_0x403a89)['json'](_0x597544);}};}function respondWithFilteredResult(_0x2ec9c3,_0x4a9621){return function(_0x2d457a){if(_0x2d457a){var _0x4caa03=typeof _0x4a9621['offset']===_0xed43('0x18')&&typeof _0x4a9621['limit']===_0xed43('0x18');var _0x1ada9c=_0x2d457a[_0xed43('0x19')];var _0x5f5093=_0x4caa03?0x0:_0x4a9621[_0xed43('0x1a')];var _0xa8a443=_0x4caa03?_0x2d457a['count']:_0x4a9621['offset']+_0x4a9621[_0xed43('0x1b')];var _0x46a875;if(_0xa8a443>=_0x1ada9c){_0xa8a443=_0x1ada9c;_0x46a875=0xc8;}else{_0x46a875=0xce;}_0x2ec9c3[_0xed43('0x16')](_0x46a875);return _0x2ec9c3['set'](_0xed43('0x1c'),_0x5f5093+'-'+_0xa8a443+'/'+_0x1ada9c)[_0xed43('0x1d')](_0x2d457a);}return null;};}function patchUpdates(_0x5bbd5c){return function(_0x3570ef){try{jsonpatch[_0xed43('0x1e')](_0x3570ef,_0x5bbd5c,!![]);}catch(_0x336ce7){return BPromise['reject'](_0x336ce7);}return _0x3570ef['save']();};}function saveUpdates(_0x2a6329,_0x42fb48){return function(_0x7f4c4c){if(_0x7f4c4c){return _0x7f4c4c[_0xed43('0x1f')](_0x2a6329)[_0xed43('0x20')](function(_0x45a24a){return _0x45a24a;});}return null;};}function removeEntity(_0x556440,_0x414c7a){return function(_0x30b5cf){if(_0x30b5cf){return _0x30b5cf[_0xed43('0x21')]()['then'](function(){_0x556440[_0xed43('0x16')](0xcc)[_0xed43('0x17')]();});}};}function handleEntityNotFound(_0x28a908,_0x90350a){return function(_0x549f91){if(!_0x549f91){_0x28a908[_0xed43('0x15')](0x194);}return _0x549f91;};}function handleError(_0x53f575,_0x3e7442){_0x3e7442=_0x3e7442||0x1f4;return function(_0xed8706){logger[_0xed43('0x22')](_0xed8706[_0xed43('0x23')]);if(_0xed8706['name']){delete _0xed8706[_0xed43('0x24')];}_0x53f575['status'](_0x3e7442)['send'](_0xed8706);};}exports[_0xed43('0x25')]=function(_0x51f128,_0x587d85){var _0x1b2f66={},_0x139750={},_0x325ab5={'count':0x0,'rows':[]};var _0x1f1207=_[_0xed43('0x26')](db['ChatQueueReport'][_0xed43('0x27')],function(_0x32c395){return{'name':_0x32c395[_0xed43('0x28')],'type':_0x32c395[_0xed43('0x29')][_0xed43('0x2a')]};});_0x139750['model']=_[_0xed43('0x26')](_0x1f1207,_0xed43('0x24'));_0x139750[_0xed43('0x2b')]=_['keys'](_0x51f128[_0xed43('0x2b')]);_0x139750[_0xed43('0x2c')]=_[_0xed43('0x2d')](_0x139750[_0xed43('0x2e')],_0x139750[_0xed43('0x2b')]);_0x1b2f66[_0xed43('0x2f')]=_[_0xed43('0x2d')](_0x139750[_0xed43('0x2e')],qs['fields'](_0x51f128['query'][_0xed43('0x30')]));_0x1b2f66['attributes']=_0x1b2f66[_0xed43('0x2f')][_0xed43('0x31')]?_0x1b2f66['attributes']:_0x139750[_0xed43('0x2e')];if(!_0x51f128[_0xed43('0x2b')][_0xed43('0x32')](_0xed43('0x33'))){_0x1b2f66[_0xed43('0x1b')]=qs[_0xed43('0x1b')](_0x51f128[_0xed43('0x2b')][_0xed43('0x1b')]);_0x1b2f66['offset']=qs['offset'](_0x51f128[_0xed43('0x2b')][_0xed43('0x1a')]);}_0x1b2f66[_0xed43('0x34')]=qs[_0xed43('0x35')](_0x51f128[_0xed43('0x2b')]['sort']);_0x1b2f66[_0xed43('0x36')]=qs['filters'](_[_0xed43('0x37')](_0x51f128[_0xed43('0x2b')],_0x139750[_0xed43('0x2c')]),_0x1f1207);if(_0x51f128['query'][_0xed43('0x38')]){_0x1b2f66[_0xed43('0x36')]=_['merge'](_0x1b2f66[_0xed43('0x36')],{'$or':_[_0xed43('0x26')](_0x1f1207,function(_0x5bf247){if(_0x5bf247[_0xed43('0x29')]!=='VIRTUAL'){var _0x16c207={};_0x16c207[_0x5bf247[_0xed43('0x24')]]={'$like':'%'+_0x51f128['query'][_0xed43('0x38')]+'%'};return _0x16c207;}})});}_0x1b2f66=_[_0xed43('0x39')]({},_0x1b2f66,_0x51f128[_0xed43('0x3a')]);var _0x4a6ff6={'where':_0x1b2f66[_0xed43('0x36')]};return db[_0xed43('0x3b')][_0xed43('0x19')](_0x4a6ff6)[_0xed43('0x20')](function(_0xa6a7c3){_0x325ab5[_0xed43('0x19')]=_0xa6a7c3;if(_0x51f128['query'][_0xed43('0x3c')]){_0x1b2f66['include']=[{'all':!![]}];}return db[_0xed43('0x3b')][_0xed43('0x3d')](_0x1b2f66);})[_0xed43('0x20')](function(_0x2a9a15){_0x325ab5[_0xed43('0x3e')]=_0x2a9a15;return _0x325ab5;})[_0xed43('0x20')](respondWithFilteredResult(_0x587d85,_0x1b2f66))[_0xed43('0x3f')](handleError(_0x587d85,null));};exports[_0xed43('0x40')]=function(_0x19d7de,_0x32ddec){var _0x3ec9c0={'raw':!![],'where':{'id':_0x19d7de[_0xed43('0x41')]['id']}},_0x57ac6b={};_0x57ac6b[_0xed43('0x2e')]=_[_0xed43('0x42')](db['ChatQueueReport'][_0xed43('0x27')]);_0x57ac6b[_0xed43('0x2b')]=_[_0xed43('0x42')](_0x19d7de['query']);_0x57ac6b[_0xed43('0x2c')]=_['intersection'](_0x57ac6b['model'],_0x57ac6b[_0xed43('0x2b')]);_0x3ec9c0[_0xed43('0x2f')]=_[_0xed43('0x2d')](_0x57ac6b[_0xed43('0x2e')],qs['fields'](_0x19d7de[_0xed43('0x2b')][_0xed43('0x30')]));_0x3ec9c0['attributes']=_0x3ec9c0['attributes'][_0xed43('0x31')]?_0x3ec9c0['attributes']:_0x57ac6b[_0xed43('0x2e')];if(_0x19d7de['query'][_0xed43('0x3c')]){_0x3ec9c0[_0xed43('0x43')]=[{'all':!![]}];}_0x3ec9c0=_[_0xed43('0x39')]({},_0x3ec9c0,_0x19d7de[_0xed43('0x3a')]);return db[_0xed43('0x3b')][_0xed43('0x44')](_0x3ec9c0)['then'](handleEntityNotFound(_0x32ddec,null))[_0xed43('0x20')](respondWithResult(_0x32ddec,null))[_0xed43('0x3f')](handleError(_0x32ddec,null));};exports[_0xed43('0x45')]=function(_0x2ff4cf,_0x298662){return db[_0xed43('0x3b')]['create'](_0x2ff4cf[_0xed43('0x46')],{})[_0xed43('0x20')](respondWithResult(_0x298662,0xc9))[_0xed43('0x3f')](handleError(_0x298662,null));};exports[_0xed43('0x1f')]=function(_0x567327,_0xeda46e){if(_0x567327[_0xed43('0x46')]['id']){delete _0x567327['body']['id'];}return db[_0xed43('0x3b')][_0xed43('0x44')]({'where':{'id':_0x567327[_0xed43('0x41')]['id']}})[_0xed43('0x20')](handleEntityNotFound(_0xeda46e,null))[_0xed43('0x20')](saveUpdates(_0x567327[_0xed43('0x46')],null))[_0xed43('0x20')](respondWithResult(_0xeda46e,null))[_0xed43('0x3f')](handleError(_0xeda46e,null));};exports[_0xed43('0x21')]=function(_0x5f1968,_0x47cb1e){return db[_0xed43('0x3b')][_0xed43('0x44')]({'where':{'id':_0x5f1968[_0xed43('0x41')]['id']}})['then'](handleEntityNotFound(_0x47cb1e,null))['then'](removeEntity(_0x47cb1e,null))[_0xed43('0x3f')](handleError(_0x47cb1e,null));};exports[_0xed43('0x47')]=function(_0x399b30,_0x31846d){return db[_0xed43('0x3b')][_0xed43('0x47')]()[_0xed43('0x20')](respondWithResult(_0x31846d,null))[_0xed43('0x3f')](handleError(_0x31846d,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 008e03f..fd5a0e7 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(_0x27faed,_0x217be4){var _0x2aaeab=function(_0x2e8b17){while(--_0x2e8b17){_0x27faed['push'](_0x27faed['shift']());}};_0x2aaeab(++_0x217be4);}(_0x757a,0xde));var _0xa757=function(_0x14f957,_0x25c3a7){_0x14f957=_0x14f957-0x0;var _0x5af3c8=_0x757a[_0x14f957];return _0x5af3c8;};'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 _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x10cc02,_0x9f88bd){var _0x18187a=function(_0x13d345){while(--_0x13d345){_0x10cc02['push'](_0x10cc02['shift']());}};_0x18187a(++_0x9f88bd);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x151721,_0x20d5bc){_0x151721=_0x151721-0x0;var _0x2deaa7=_0xcb91[_0x151721];return _0x2deaa7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index c2eadd0..50bfe57 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 _0x9829=['ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','raw','then','UpdateChatQueueReport','update','where','attributes','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','info'];(function(_0x93a15c,_0x2ec812){var _0x1e32e4=function(_0x174b05){while(--_0x174b05){_0x93a15c['push'](_0x93a15c['shift']());}};_0x1e32e4(++_0x2ec812);}(_0x9829,0xfb));var _0x9982=function(_0x25c326,_0x250137){_0x25c326=_0x25c326-0x0;var _0x762452=_0x9829[_0x25c326];return _0x762452;};'use strict';var _=require(_0x9982('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9982('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9982('0x2'));var db=require(_0x9982('0x3'))['db'];var utils=require(_0x9982('0x4'));var logger=require('../../config/logger')(_0x9982('0x5'));var config=require(_0x9982('0x6'));var jayson=require(_0x9982('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x44a7f4,_0x45c41d,_0x4b7b7b){return new BPromise(function(_0x3d2209,_0x385713){return client[_0x9982('0x8')](_0x44a7f4,_0x4b7b7b)['then'](function(_0x4cbfd0){logger[_0x9982('0x9')](_0x9982('0xa'),_0x45c41d,_0x9982('0xb'));logger[_0x9982('0xc')](_0x9982('0xd'),_0x45c41d,_0x9982('0xb'),JSON[_0x9982('0xe')](_0x4cbfd0));if(_0x4cbfd0[_0x9982('0xf')]){if(_0x4cbfd0[_0x9982('0xf')]['code']===0x1f4){logger[_0x9982('0xf')](_0x9982('0xa'),_0x45c41d,_0x4cbfd0['error']['message']);return _0x385713(_0x4cbfd0[_0x9982('0xf')]['message']);}logger[_0x9982('0xf')](_0x9982('0xa'),_0x45c41d,_0x4cbfd0[_0x9982('0xf')][_0x9982('0x10')]);return _0x3d2209(_0x4cbfd0[_0x9982('0xf')][_0x9982('0x10')]);}else{logger[_0x9982('0x9')](_0x9982('0xa'),_0x45c41d,_0x9982('0xb'));_0x3d2209(_0x4cbfd0[_0x9982('0x11')][_0x9982('0x10')]);}})[_0x9982('0x12')](function(_0x5598cd){logger[_0x9982('0xf')](_0x9982('0xa'),_0x45c41d,_0x5598cd);_0x385713(_0x5598cd);});});}exports[_0x9982('0x13')]=function(_0xecdd2a){var _0x1368e0=this;return new Promise(function(_0xa0534c,_0x34dc32){return db[_0x9982('0x14')]['create'](_0xecdd2a[_0x9982('0x15')],{'raw':_0xecdd2a['options']?_0xecdd2a[_0x9982('0x16')][_0x9982('0x17')]===undefined?!![]:![]:!![]})[_0x9982('0x18')](function(_0x1e71f9){logger[_0x9982('0x9')](_0x9982('0x13'),_0xecdd2a);logger[_0x9982('0xc')]('CreateChatQueueReport',_0xecdd2a,JSON[_0x9982('0xe')](_0x1e71f9));_0xa0534c(_0x1e71f9);})[_0x9982('0x12')](function(_0x2b5c35){logger[_0x9982('0xf')](_0x9982('0x13'),_0x2b5c35[_0x9982('0x10')],_0xecdd2a);_0x34dc32(_0x1368e0[_0x9982('0xf')](0x1f4,_0x2b5c35[_0x9982('0x10')]));});});};exports[_0x9982('0x19')]=function(_0x358345){var _0x95dd7c=this;return new Promise(function(_0x354ab7,_0x5a0f25){return db[_0x9982('0x14')][_0x9982('0x1a')](_0x358345[_0x9982('0x15')],{'raw':_0x358345[_0x9982('0x16')]?_0x358345[_0x9982('0x16')][_0x9982('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x358345['options']?_0x358345['options'][_0x9982('0x1b')]||null:null,'attributes':_0x358345['options']?_0x358345[_0x9982('0x16')][_0x9982('0x1c')]||null:null,'limit':_0x358345[_0x9982('0x16')]?_0x358345[_0x9982('0x16')]['limit']||null:null})[_0x9982('0x18')](function(_0x1ff242){logger[_0x9982('0x9')](_0x9982('0x19'),_0x358345);logger[_0x9982('0xc')]('UpdateChatQueueReport',_0x358345,JSON[_0x9982('0xe')](_0x1ff242));_0x354ab7(_0x1ff242);})[_0x9982('0x12')](function(_0x868f62){logger[_0x9982('0xf')](_0x9982('0x19'),_0x868f62[_0x9982('0x10')],_0x358345);_0x5a0f25(_0x95dd7c['error'](0x1f4,_0x868f62['message']));});});};
\ No newline at end of file
+var _0x79ad=['then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','debug','UpdateChatQueueReport','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x79ad,0x16e));var _0xd79a=function(_0x5d0792,_0x486759){_0x5d0792=_0x5d0792-0x0;var _0x2885a6=_0x79ad[_0x5d0792];return _0x2885a6;};'use strict';var _=require(_0xd79a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd79a('0x1'));var rs=require(_0xd79a('0x2'));var fs=require('fs');var Redis=require(_0xd79a('0x3'));var db=require(_0xd79a('0x4'))['db'];var utils=require(_0xd79a('0x5'));var logger=require(_0xd79a('0x6'))(_0xd79a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd79a('0x8')][_0xd79a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d3a5a,_0x273f8d,_0x12bf8c){return new BPromise(function(_0x263519,_0x2d3ec9){return client[_0xd79a('0xa')](_0x1d3a5a,_0x12bf8c)[_0xd79a('0xb')](function(_0x3080b0){logger[_0xd79a('0xc')](_0xd79a('0xd'),_0x273f8d,_0xd79a('0xe'));logger['debug'](_0xd79a('0xf'),_0x273f8d,_0xd79a('0xe'),JSON[_0xd79a('0x10')](_0x3080b0));if(_0x3080b0[_0xd79a('0x11')]){if(_0x3080b0[_0xd79a('0x11')][_0xd79a('0x12')]===0x1f4){logger[_0xd79a('0x11')](_0xd79a('0xd'),_0x273f8d,_0x3080b0[_0xd79a('0x11')]['message']);return _0x2d3ec9(_0x3080b0['error'][_0xd79a('0x13')]);}logger['error'](_0xd79a('0xd'),_0x273f8d,_0x3080b0[_0xd79a('0x11')][_0xd79a('0x13')]);return _0x263519(_0x3080b0[_0xd79a('0x11')][_0xd79a('0x13')]);}else{logger[_0xd79a('0xc')](_0xd79a('0xd'),_0x273f8d,_0xd79a('0xe'));_0x263519(_0x3080b0[_0xd79a('0x14')][_0xd79a('0x13')]);}})[_0xd79a('0x15')](function(_0x10f490){logger['error'](_0xd79a('0xd'),_0x273f8d,_0x10f490);_0x2d3ec9(_0x10f490);});});}exports[_0xd79a('0x16')]=function(_0x13a3e1){var _0x96a4b8=this;return new Promise(function(_0x41d296,_0x1a678b){return db[_0xd79a('0x17')][_0xd79a('0x18')](_0x13a3e1[_0xd79a('0x19')],{'raw':_0x13a3e1[_0xd79a('0x1a')]?_0x13a3e1[_0xd79a('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xd79a('0xb')](function(_0x558db5){logger['info']('CreateChatQueueReport',_0x13a3e1);logger[_0xd79a('0x1b')](_0xd79a('0x16'),_0x13a3e1,JSON[_0xd79a('0x10')](_0x558db5));_0x41d296(_0x558db5);})['catch'](function(_0x389520){logger[_0xd79a('0x11')](_0xd79a('0x16'),_0x389520[_0xd79a('0x13')],_0x13a3e1);_0x1a678b(_0x96a4b8['error'](0x1f4,_0x389520['message']));});});};exports['UpdateChatQueueReport']=function(_0x59d86b){var _0x170aa1=this;return new Promise(function(_0x5dcadd,_0x4dbc80){return db[_0xd79a('0x17')]['update'](_0x59d86b['body'],{'raw':_0x59d86b[_0xd79a('0x1a')]?_0x59d86b[_0xd79a('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59d86b['options']?_0x59d86b['options']['where']||null:null,'attributes':_0x59d86b[_0xd79a('0x1a')]?_0x59d86b[_0xd79a('0x1a')]['attributes']||null:null,'limit':_0x59d86b[_0xd79a('0x1a')]?_0x59d86b['options']['limit']||null:null})[_0xd79a('0xb')](function(_0x5be5bd){logger[_0xd79a('0xc')]('UpdateChatQueueReport',_0x59d86b);logger[_0xd79a('0x1b')](_0xd79a('0x1c'),_0x59d86b,JSON[_0xd79a('0x10')](_0x5be5bd));_0x5dcadd(_0x5be5bd);})[_0xd79a('0x15')](function(_0x37d02c){logger[_0xd79a('0x11')]('UpdateChatQueueReport',_0x37d02c[_0xd79a('0x13')],_0x59d86b);_0x4dbc80(_0x170aa1[_0xd79a('0x11')](0x1f4,_0x37d02c[_0xd79a('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index a191296..19ca60c 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 _0x10b6=['isAuthenticated','index','/describe','describe','/:id','show','put','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get'];(function(_0x560497,_0x342635){var _0x6250c1=function(_0x15fd4c){while(--_0x15fd4c){_0x560497['push'](_0x560497['shift']());}};_0x6250c1(++_0x342635);}(_0x10b6,0x172));var _0x610b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x10b6[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x610b('0x0'));var util=require(_0x610b('0x1'));var path=require(_0x610b('0x2'));var timeout=require(_0x610b('0x3'));var express=require('express');var router=express[_0x610b('0x4')]();var fs_extra=require(_0x610b('0x5'));var auth=require(_0x610b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x610b('0x7'));var controller=require(_0x610b('0x8'));router[_0x610b('0x9')]('/',auth[_0x610b('0xa')](),controller[_0x610b('0xb')]);router[_0x610b('0x9')](_0x610b('0xc'),auth['isAuthenticated'](),controller[_0x610b('0xd')]);router[_0x610b('0x9')](_0x610b('0xe'),auth[_0x610b('0xa')](),controller[_0x610b('0xf')]);router['post']('/',auth[_0x610b('0xa')](),controller['create']);router[_0x610b('0x10')](_0x610b('0xe'),auth[_0x610b('0xa')](),controller['update']);router['delete'](_0x610b('0xe'),auth[_0x610b('0xa')](),controller[_0x610b('0x11')]);module[_0x610b('0x12')]=router;
\ No newline at end of file
+var _0x72ec=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','get','/describe','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3d18d1,_0x365c54){var _0x1409e9=function(_0x29defd){while(--_0x29defd){_0x3d18d1['push'](_0x3d18d1['shift']());}};_0x1409e9(++_0x365c54);}(_0x72ec,0x95));var _0xc72e=function(_0x70504d,_0x34e810){_0x70504d=_0x70504d-0x0;var _0x47e29b=_0x72ec[_0x70504d];return _0x47e29b;};'use strict';var multer=require(_0xc72e('0x0'));var util=require(_0xc72e('0x1'));var path=require(_0xc72e('0x2'));var timeout=require(_0xc72e('0x3'));var express=require(_0xc72e('0x4'));var router=express[_0xc72e('0x5')]();var fs_extra=require(_0xc72e('0x6'));var auth=require(_0xc72e('0x7'));var interaction=require(_0xc72e('0x8'));var config=require(_0xc72e('0x9'));var controller=require(_0xc72e('0xa'));router['get']('/',auth[_0xc72e('0xb')](),controller['index']);router[_0xc72e('0xc')](_0xc72e('0xd'),auth[_0xc72e('0xb')](),controller['describe']);router[_0xc72e('0xc')]('/:id',auth[_0xc72e('0xb')](),controller['show']);router[_0xc72e('0xe')]('/',auth[_0xc72e('0xb')](),controller[_0xc72e('0xf')]);router[_0xc72e('0x10')](_0xc72e('0x11'),auth[_0xc72e('0xb')](),controller[_0xc72e('0x12')]);router[_0xc72e('0x13')](_0xc72e('0x11'),auth[_0xc72e('0xb')](),controller[_0xc72e('0x14')]);module[_0xc72e('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 373898b..af2341b 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x118653,_0x50ef26){var _0xc11fa6=function(_0x2ec581){while(--_0x2ec581){_0x118653['push'](_0x118653['shift']());}};_0xc11fa6(++_0x50ef26);}(_0x54ef,0x112));var _0xf54e=function(_0x34731d,_0x2660af){_0x34731d=_0x34731d-0x0;var _0x2f379e=_0x54ef[_0x34731d];return _0x2f379e;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}};
\ No newline at end of file
+var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0xaef372,_0xc57733){var _0x181170=function(_0x55b6db){while(--_0x55b6db){_0xaef372['push'](_0xaef372['shift']());}};_0x181170(++_0xc57733);}(_0xf4eb,0xec));var _0xbf4e=function(_0x307c62,_0x3e7463){_0x307c62=_0x307c62-0x0;var _0x2d4e20=_0xf4eb[_0x307c62];return _0x2d4e20;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 40a49a5..ae2492e 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 _0xdab4=['error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','filters','options','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy'];(function(_0x4b39ec,_0x26ae2a){var _0x574102=function(_0x1e9d24){while(--_0x1e9d24){_0x4b39ec['push'](_0x4b39ec['shift']());}};_0x574102(++_0x26ae2a);}(_0xdab4,0x11a));var _0x4dab=function(_0x3619f0,_0x393b23){_0x3619f0=_0x3619f0-0x0;var _0x369c02=_0xdab4[_0x3619f0];return _0x369c02;};'use strict';var emlformat=require(_0x4dab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4dab('0x1'));var jsonpatch=require(_0x4dab('0x2'));var rp=require(_0x4dab('0x3'));var moment=require(_0x4dab('0x4'));var BPromise=require(_0x4dab('0x5'));var Mustache=require(_0x4dab('0x6'));var util=require(_0x4dab('0x7'));var path=require(_0x4dab('0x8'));var sox=require(_0x4dab('0x9'));var csv=require('to-csv');var ejs=require(_0x4dab('0xa'));var fs=require('fs');var fs_extra=require(_0x4dab('0xb'));var _=require(_0x4dab('0xc'));var squel=require(_0x4dab('0xd'));var crypto=require(_0x4dab('0xe'));var jsforce=require(_0x4dab('0xf'));var deskjs=require(_0x4dab('0x10'));var toCsv=require('to-csv');var querystring=require(_0x4dab('0x11'));var Papa=require(_0x4dab('0x12'));var Redis=require('ioredis');var authService=require(_0x4dab('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4dab('0x14'));var hardwareService=require(_0x4dab('0x15'));var logger=require(_0x4dab('0x16'))('api');var utils=require(_0x4dab('0x17'));var config=require(_0x4dab('0x18'));var licenseUtil=require(_0x4dab('0x19'));var db=require(_0x4dab('0x1a'))['db'];function respondWithStatusCode(_0x47d367,_0x51c024){_0x51c024=_0x51c024||0xcc;return function(_0x127b40){if(_0x127b40){return _0x47d367[_0x4dab('0x1b')](_0x51c024);}return _0x47d367['status'](_0x51c024)[_0x4dab('0x1c')]();};}function respondWithResult(_0x5b07dd,_0x2750db){_0x2750db=_0x2750db||0xc8;return function(_0x395fda){if(_0x395fda){return _0x5b07dd[_0x4dab('0x1d')](_0x2750db)[_0x4dab('0x1e')](_0x395fda);}};}function respondWithFilteredResult(_0x4cec35,_0x55743e){return function(_0x4b3019){if(_0x4b3019){var _0x7f4222=typeof _0x55743e[_0x4dab('0x1f')]===_0x4dab('0x20')&&typeof _0x55743e['limit']==='undefined';var _0x93d100=_0x4b3019[_0x4dab('0x21')];var _0x595864=_0x7f4222?0x0:_0x55743e[_0x4dab('0x1f')];var _0x4c6e11=_0x7f4222?_0x4b3019[_0x4dab('0x21')]:_0x55743e['offset']+_0x55743e[_0x4dab('0x22')];var _0x1b422f;if(_0x4c6e11>=_0x93d100){_0x4c6e11=_0x93d100;_0x1b422f=0xc8;}else{_0x1b422f=0xce;}_0x4cec35[_0x4dab('0x1d')](_0x1b422f);return _0x4cec35[_0x4dab('0x23')](_0x4dab('0x24'),_0x595864+'-'+_0x4c6e11+'/'+_0x93d100)[_0x4dab('0x1e')](_0x4b3019);}return null;};}function patchUpdates(_0x95a064){return function(_0x53e814){try{jsonpatch[_0x4dab('0x25')](_0x53e814,_0x95a064,!![]);}catch(_0x1fd2a7){return BPromise[_0x4dab('0x26')](_0x1fd2a7);}return _0x53e814['save']();};}function saveUpdates(_0x21fd93,_0x37549a){return function(_0x4dd0f3){if(_0x4dd0f3){return _0x4dd0f3[_0x4dab('0x27')](_0x21fd93)[_0x4dab('0x28')](function(_0x3c5077){return _0x3c5077;});}return null;};}function removeEntity(_0x17ab24,_0x269cb0){return function(_0xfc646b){if(_0xfc646b){return _0xfc646b[_0x4dab('0x29')]()[_0x4dab('0x28')](function(){_0x17ab24[_0x4dab('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dc834,_0x983dec){return function(_0x34ce06){if(!_0x34ce06){_0x4dc834[_0x4dab('0x1b')](0x194);}return _0x34ce06;};}function handleError(_0x34da6a,_0x20d922){_0x20d922=_0x20d922||0x1f4;return function(_0x10925f){logger[_0x4dab('0x2a')](_0x10925f[_0x4dab('0x2b')]);if(_0x10925f['name']){delete _0x10925f[_0x4dab('0x2c')];}_0x34da6a[_0x4dab('0x1d')](_0x20d922)[_0x4dab('0x2d')](_0x10925f);};}exports[_0x4dab('0x2e')]=function(_0x37450c,_0x2b2e68){var _0x3f88d5={},_0x5c913c={},_0xfff2a0={'count':0x0,'rows':[]};var _0x2e5387=_[_0x4dab('0x2f')](db[_0x4dab('0x30')][_0x4dab('0x31')],function(_0x5baab8){return{'name':_0x5baab8[_0x4dab('0x32')],'type':_0x5baab8[_0x4dab('0x33')][_0x4dab('0x34')]};});_0x5c913c['model']=_[_0x4dab('0x2f')](_0x2e5387,_0x4dab('0x2c'));_0x5c913c['query']=_['keys'](_0x37450c[_0x4dab('0x35')]);_0x5c913c['filters']=_[_0x4dab('0x36')](_0x5c913c[_0x4dab('0x37')],_0x5c913c[_0x4dab('0x35')]);_0x3f88d5['attributes']=_['intersection'](_0x5c913c[_0x4dab('0x37')],qs[_0x4dab('0x38')](_0x37450c[_0x4dab('0x35')]['fields']));_0x3f88d5[_0x4dab('0x39')]=_0x3f88d5[_0x4dab('0x39')][_0x4dab('0x3a')]?_0x3f88d5['attributes']:_0x5c913c[_0x4dab('0x37')];if(!_0x37450c[_0x4dab('0x35')][_0x4dab('0x3b')]('nolimit')){_0x3f88d5['limit']=qs[_0x4dab('0x22')](_0x37450c[_0x4dab('0x35')][_0x4dab('0x22')]);_0x3f88d5[_0x4dab('0x1f')]=qs[_0x4dab('0x1f')](_0x37450c['query'][_0x4dab('0x1f')]);}_0x3f88d5[_0x4dab('0x3c')]=qs[_0x4dab('0x3d')](_0x37450c[_0x4dab('0x35')][_0x4dab('0x3d')]);_0x3f88d5['where']=qs['filters'](_[_0x4dab('0x3e')](_0x37450c[_0x4dab('0x35')],_0x5c913c['filters']),_0x2e5387);if(_0x37450c[_0x4dab('0x35')][_0x4dab('0x3f')]){_0x3f88d5['where']=_[_0x4dab('0x40')](_0x3f88d5[_0x4dab('0x41')],{'$or':_['map'](_0x2e5387,function(_0x2d2340){if(_0x2d2340[_0x4dab('0x33')]!==_0x4dab('0x42')){var _0x172993={};_0x172993[_0x2d2340['name']]={'$like':'%'+_0x37450c[_0x4dab('0x35')]['filter']+'%'};return _0x172993;}})});}_0x3f88d5=_[_0x4dab('0x40')]({},_0x3f88d5,_0x37450c['options']);var _0x27114e={'where':_0x3f88d5[_0x4dab('0x41')]};return db['ChatTransferReport'][_0x4dab('0x21')](_0x27114e)[_0x4dab('0x28')](function(_0x134b92){_0xfff2a0['count']=_0x134b92;if(_0x37450c[_0x4dab('0x35')][_0x4dab('0x43')]){_0x3f88d5[_0x4dab('0x44')]=[{'all':!![]}];}return db[_0x4dab('0x30')][_0x4dab('0x45')](_0x3f88d5);})[_0x4dab('0x28')](function(_0x477120){_0xfff2a0[_0x4dab('0x46')]=_0x477120;return _0xfff2a0;})['then'](respondWithFilteredResult(_0x2b2e68,_0x3f88d5))[_0x4dab('0x47')](handleError(_0x2b2e68,null));};exports[_0x4dab('0x48')]=function(_0x41195f,_0x2798c9){var _0x71a014={'raw':!![],'where':{'id':_0x41195f[_0x4dab('0x49')]['id']}},_0x490bd9={};_0x490bd9['model']=_['keys'](db['ChatTransferReport'][_0x4dab('0x31')]);_0x490bd9[_0x4dab('0x35')]=_[_0x4dab('0x4a')](_0x41195f['query']);_0x490bd9[_0x4dab('0x4b')]=_[_0x4dab('0x36')](_0x490bd9['model'],_0x490bd9['query']);_0x71a014[_0x4dab('0x39')]=_[_0x4dab('0x36')](_0x490bd9[_0x4dab('0x37')],qs[_0x4dab('0x38')](_0x41195f['query'][_0x4dab('0x38')]));_0x71a014[_0x4dab('0x39')]=_0x71a014['attributes'][_0x4dab('0x3a')]?_0x71a014[_0x4dab('0x39')]:_0x490bd9[_0x4dab('0x37')];if(_0x41195f['query'][_0x4dab('0x43')]){_0x71a014['include']=[{'all':!![]}];}_0x71a014=_[_0x4dab('0x40')]({},_0x71a014,_0x41195f[_0x4dab('0x4c')]);return db[_0x4dab('0x30')]['find'](_0x71a014)[_0x4dab('0x28')](handleEntityNotFound(_0x2798c9,null))[_0x4dab('0x28')](respondWithResult(_0x2798c9,null))[_0x4dab('0x47')](handleError(_0x2798c9,null));};exports[_0x4dab('0x4d')]=function(_0xa414b5,_0x429adf){return db[_0x4dab('0x30')]['create'](_0xa414b5[_0x4dab('0x4e')],{})[_0x4dab('0x28')](respondWithResult(_0x429adf,0xc9))[_0x4dab('0x47')](handleError(_0x429adf,null));};exports[_0x4dab('0x27')]=function(_0x18d84a,_0x733de){if(_0x18d84a['body']['id']){delete _0x18d84a[_0x4dab('0x4e')]['id'];}return db[_0x4dab('0x30')]['find']({'where':{'id':_0x18d84a[_0x4dab('0x49')]['id']}})[_0x4dab('0x28')](handleEntityNotFound(_0x733de,null))['then'](saveUpdates(_0x18d84a['body'],null))[_0x4dab('0x28')](respondWithResult(_0x733de,null))['catch'](handleError(_0x733de,null));};exports[_0x4dab('0x29')]=function(_0x5dff65,_0x36e5ed){return db['ChatTransferReport'][_0x4dab('0x4f')]({'where':{'id':_0x5dff65['params']['id']}})['then'](handleEntityNotFound(_0x36e5ed,null))[_0x4dab('0x28')](removeEntity(_0x36e5ed,null))[_0x4dab('0x47')](handleError(_0x36e5ed,null));};exports[_0x4dab('0x50')]=function(_0x1eb3a2,_0x416323){return db['ChatTransferReport'][_0x4dab('0x50')]()[_0x4dab('0x28')](respondWithResult(_0x416323,null))[_0x4dab('0x47')](handleError(_0x416323,null));};
\ No newline at end of file
+var _0xd3d5=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','keys','intersection','length','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','ChatTransferReport','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','fields','nolimit'];(function(_0x31d833,_0xda825a){var _0x16d362=function(_0x46cb6c){while(--_0x46cb6c){_0x31d833['push'](_0x31d833['shift']());}};_0x16d362(++_0xda825a);}(_0xd3d5,0xf6));var _0x5d3d=function(_0x274a6c,_0x1a7726){_0x274a6c=_0x274a6c-0x0;var _0x30a5cf=_0xd3d5[_0x274a6c];return _0x30a5cf;};'use strict';var emlformat=require(_0x5d3d('0x0'));var rimraf=require(_0x5d3d('0x1'));var zipdir=require(_0x5d3d('0x2'));var jsonpatch=require(_0x5d3d('0x3'));var rp=require(_0x5d3d('0x4'));var moment=require(_0x5d3d('0x5'));var BPromise=require(_0x5d3d('0x6'));var Mustache=require(_0x5d3d('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x5d3d('0x8'));var ejs=require(_0x5d3d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5d3d('0xa'));var crypto=require('crypto');var jsforce=require(_0x5d3d('0xb'));var deskjs=require(_0x5d3d('0xc'));var toCsv=require(_0x5d3d('0x8'));var querystring=require(_0x5d3d('0xd'));var Papa=require(_0x5d3d('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5d3d('0xf'));var as=require(_0x5d3d('0x10'));var hardwareService=require(_0x5d3d('0x11'));var logger=require(_0x5d3d('0x12'))(_0x5d3d('0x13'));var utils=require(_0x5d3d('0x14'));var config=require(_0x5d3d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5d3d('0x16'))['db'];function respondWithStatusCode(_0x1543f0,_0x50f004){_0x50f004=_0x50f004||0xcc;return function(_0x4b4103){if(_0x4b4103){return _0x1543f0[_0x5d3d('0x17')](_0x50f004);}return _0x1543f0[_0x5d3d('0x18')](_0x50f004)[_0x5d3d('0x19')]();};}function respondWithResult(_0x25b340,_0xdcca91){_0xdcca91=_0xdcca91||0xc8;return function(_0x1c51ba){if(_0x1c51ba){return _0x25b340[_0x5d3d('0x18')](_0xdcca91)[_0x5d3d('0x1a')](_0x1c51ba);}};}function respondWithFilteredResult(_0x5e9cd8,_0x212f8c){return function(_0x550be2){if(_0x550be2){var _0x43a47b=typeof _0x212f8c[_0x5d3d('0x1b')]===_0x5d3d('0x1c')&&typeof _0x212f8c[_0x5d3d('0x1d')]==='undefined';var _0x1ea164=_0x550be2[_0x5d3d('0x1e')];var _0x35317d=_0x43a47b?0x0:_0x212f8c['offset'];var _0x309990=_0x43a47b?_0x550be2[_0x5d3d('0x1e')]:_0x212f8c[_0x5d3d('0x1b')]+_0x212f8c[_0x5d3d('0x1d')];var _0x170d9b;if(_0x309990>=_0x1ea164){_0x309990=_0x1ea164;_0x170d9b=0xc8;}else{_0x170d9b=0xce;}_0x5e9cd8[_0x5d3d('0x18')](_0x170d9b);return _0x5e9cd8[_0x5d3d('0x1f')](_0x5d3d('0x20'),_0x35317d+'-'+_0x309990+'/'+_0x1ea164)[_0x5d3d('0x1a')](_0x550be2);}return null;};}function patchUpdates(_0x23de3f){return function(_0x4d9a11){try{jsonpatch[_0x5d3d('0x21')](_0x4d9a11,_0x23de3f,!![]);}catch(_0x435d11){return BPromise[_0x5d3d('0x22')](_0x435d11);}return _0x4d9a11[_0x5d3d('0x23')]();};}function saveUpdates(_0x4a083b,_0x421f4d){return function(_0x42db5c){if(_0x42db5c){return _0x42db5c[_0x5d3d('0x24')](_0x4a083b)[_0x5d3d('0x25')](function(_0x4325de){return _0x4325de;});}return null;};}function removeEntity(_0x326c82,_0x13b787){return function(_0x4cf820){if(_0x4cf820){return _0x4cf820[_0x5d3d('0x26')]()[_0x5d3d('0x25')](function(){_0x326c82[_0x5d3d('0x18')](0xcc)[_0x5d3d('0x19')]();});}};}function handleEntityNotFound(_0xd0ccbe,_0x3e4230){return function(_0xf2c7ef){if(!_0xf2c7ef){_0xd0ccbe[_0x5d3d('0x17')](0x194);}return _0xf2c7ef;};}function handleError(_0x4014da,_0x3c93f0){_0x3c93f0=_0x3c93f0||0x1f4;return function(_0x4a8a89){logger[_0x5d3d('0x27')](_0x4a8a89['stack']);if(_0x4a8a89[_0x5d3d('0x28')]){delete _0x4a8a89[_0x5d3d('0x28')];}_0x4014da['status'](_0x3c93f0)[_0x5d3d('0x29')](_0x4a8a89);};}exports['index']=function(_0xb819f5,_0x37e91a){var _0x5cdb58={},_0x7b346={},_0x1bc53b={'count':0x0,'rows':[]};var _0x5113a9=_['map'](db[_0x5d3d('0x2a')][_0x5d3d('0x2b')],function(_0x51afbe){return{'name':_0x51afbe[_0x5d3d('0x2c')],'type':_0x51afbe[_0x5d3d('0x2d')][_0x5d3d('0x2e')]};});_0x7b346[_0x5d3d('0x2f')]=_[_0x5d3d('0x30')](_0x5113a9,_0x5d3d('0x28'));_0x7b346[_0x5d3d('0x31')]=_['keys'](_0xb819f5[_0x5d3d('0x31')]);_0x7b346[_0x5d3d('0x32')]=_['intersection'](_0x7b346[_0x5d3d('0x2f')],_0x7b346[_0x5d3d('0x31')]);_0x5cdb58[_0x5d3d('0x33')]=_['intersection'](_0x7b346['model'],qs[_0x5d3d('0x34')](_0xb819f5['query'][_0x5d3d('0x34')]));_0x5cdb58[_0x5d3d('0x33')]=_0x5cdb58[_0x5d3d('0x33')]['length']?_0x5cdb58[_0x5d3d('0x33')]:_0x7b346[_0x5d3d('0x2f')];if(!_0xb819f5['query']['hasOwnProperty'](_0x5d3d('0x35'))){_0x5cdb58[_0x5d3d('0x1d')]=qs[_0x5d3d('0x1d')](_0xb819f5[_0x5d3d('0x31')][_0x5d3d('0x1d')]);_0x5cdb58[_0x5d3d('0x1b')]=qs[_0x5d3d('0x1b')](_0xb819f5['query'][_0x5d3d('0x1b')]);}_0x5cdb58[_0x5d3d('0x36')]=qs[_0x5d3d('0x37')](_0xb819f5[_0x5d3d('0x31')][_0x5d3d('0x37')]);_0x5cdb58[_0x5d3d('0x38')]=qs[_0x5d3d('0x32')](_[_0x5d3d('0x39')](_0xb819f5[_0x5d3d('0x31')],_0x7b346[_0x5d3d('0x32')]),_0x5113a9);if(_0xb819f5[_0x5d3d('0x31')][_0x5d3d('0x3a')]){_0x5cdb58['where']=_[_0x5d3d('0x3b')](_0x5cdb58['where'],{'$or':_[_0x5d3d('0x30')](_0x5113a9,function(_0x333fd4){if(_0x333fd4[_0x5d3d('0x2d')]!==_0x5d3d('0x3c')){var _0x5631a6={};_0x5631a6[_0x333fd4[_0x5d3d('0x28')]]={'$like':'%'+_0xb819f5['query'][_0x5d3d('0x3a')]+'%'};return _0x5631a6;}})});}_0x5cdb58=_[_0x5d3d('0x3b')]({},_0x5cdb58,_0xb819f5[_0x5d3d('0x3d')]);var _0x165590={'where':_0x5cdb58[_0x5d3d('0x38')]};return db[_0x5d3d('0x2a')][_0x5d3d('0x1e')](_0x165590)[_0x5d3d('0x25')](function(_0x117b76){_0x1bc53b['count']=_0x117b76;if(_0xb819f5['query'][_0x5d3d('0x3e')]){_0x5cdb58['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0x5d3d('0x3f')](_0x5cdb58);})[_0x5d3d('0x25')](function(_0x157cc5){_0x1bc53b['rows']=_0x157cc5;return _0x1bc53b;})[_0x5d3d('0x25')](respondWithFilteredResult(_0x37e91a,_0x5cdb58))['catch'](handleError(_0x37e91a,null));};exports[_0x5d3d('0x40')]=function(_0x264d38,_0x5e94dd){var _0x42a610={'raw':!![],'where':{'id':_0x264d38[_0x5d3d('0x41')]['id']}},_0x269d3b={};_0x269d3b['model']=_[_0x5d3d('0x42')](db['ChatTransferReport'][_0x5d3d('0x2b')]);_0x269d3b[_0x5d3d('0x31')]=_[_0x5d3d('0x42')](_0x264d38[_0x5d3d('0x31')]);_0x269d3b[_0x5d3d('0x32')]=_[_0x5d3d('0x43')](_0x269d3b[_0x5d3d('0x2f')],_0x269d3b[_0x5d3d('0x31')]);_0x42a610[_0x5d3d('0x33')]=_[_0x5d3d('0x43')](_0x269d3b[_0x5d3d('0x2f')],qs['fields'](_0x264d38[_0x5d3d('0x31')][_0x5d3d('0x34')]));_0x42a610[_0x5d3d('0x33')]=_0x42a610[_0x5d3d('0x33')][_0x5d3d('0x44')]?_0x42a610['attributes']:_0x269d3b['model'];if(_0x264d38[_0x5d3d('0x31')][_0x5d3d('0x3e')]){_0x42a610[_0x5d3d('0x45')]=[{'all':!![]}];}_0x42a610=_[_0x5d3d('0x3b')]({},_0x42a610,_0x264d38[_0x5d3d('0x3d')]);return db[_0x5d3d('0x2a')][_0x5d3d('0x46')](_0x42a610)[_0x5d3d('0x25')](handleEntityNotFound(_0x5e94dd,null))[_0x5d3d('0x25')](respondWithResult(_0x5e94dd,null))[_0x5d3d('0x47')](handleError(_0x5e94dd,null));};exports[_0x5d3d('0x48')]=function(_0x4eb42a,_0x3b8ef5){return db[_0x5d3d('0x2a')][_0x5d3d('0x48')](_0x4eb42a[_0x5d3d('0x49')],{})[_0x5d3d('0x25')](respondWithResult(_0x3b8ef5,0xc9))['catch'](handleError(_0x3b8ef5,null));};exports[_0x5d3d('0x24')]=function(_0x2daf73,_0x3a3e7e){if(_0x2daf73[_0x5d3d('0x49')]['id']){delete _0x2daf73[_0x5d3d('0x49')]['id'];}return db[_0x5d3d('0x2a')]['find']({'where':{'id':_0x2daf73[_0x5d3d('0x41')]['id']}})[_0x5d3d('0x25')](handleEntityNotFound(_0x3a3e7e,null))[_0x5d3d('0x25')](saveUpdates(_0x2daf73['body'],null))[_0x5d3d('0x25')](respondWithResult(_0x3a3e7e,null))['catch'](handleError(_0x3a3e7e,null));};exports[_0x5d3d('0x26')]=function(_0x1b4dac,_0x59bed6){return db[_0x5d3d('0x2a')][_0x5d3d('0x46')]({'where':{'id':_0x1b4dac[_0x5d3d('0x41')]['id']}})[_0x5d3d('0x25')](handleEntityNotFound(_0x59bed6,null))['then'](removeEntity(_0x59bed6,null))[_0x5d3d('0x47')](handleError(_0x59bed6,null));};exports[_0x5d3d('0x4a')]=function(_0x42f858,_0x5cbef7){return db[_0x5d3d('0x2a')]['describe']()[_0x5d3d('0x25')](respondWithResult(_0x5cbef7,null))[_0x5d3d('0x47')](handleError(_0x5cbef7,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 77d10cf..6d914ed 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 _0xcfa1=['api','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util'];(function(_0x27d217,_0x475037){var _0x5cef01=function(_0x1f66a3){while(--_0x1f66a3){_0x27d217['push'](_0x27d217['shift']());}};_0x5cef01(++_0x475037);}(_0xcfa1,0x80));var _0x1cfa=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xcfa1[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x1cfa('0x0'));var util=require(_0x1cfa('0x1'));var logger=require('../../config/logger')(_0x1cfa('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1cfa('0x3'));var fs=require('fs');var path=require(_0x1cfa('0x4'));var rimraf=require(_0x1cfa('0x5'));var config=require(_0x1cfa('0x6'));var attributes=require(_0x1cfa('0x7'));module[_0x1cfa('0x8')]=function(_0x2a793c,_0xd5a873){return _0x2a793c[_0x1cfa('0x9')](_0x1cfa('0xa'),attributes,{'tableName':_0x1cfa('0xb'),'paranoid':![],'indexes':[{'name':_0x1cfa('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7ecb=['../../config/logger','api','bluebird','path','rimraf','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash'];(function(_0x3b3a82,_0x53b5e0){var _0x267063=function(_0x5aaf3d){while(--_0x5aaf3d){_0x3b3a82['push'](_0x3b3a82['shift']());}};_0x267063(++_0x53b5e0);}(_0x7ecb,0x1c7));var _0xb7ec=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7ecb[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb7ec('0x0'));var util=require('util');var logger=require(_0xb7ec('0x1'))(_0xb7ec('0x2'));var moment=require('moment');var BPromise=require(_0xb7ec('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb7ec('0x4'));var rimraf=require(_0xb7ec('0x5'));var config=require('../../config/environment');var attributes=require(_0xb7ec('0x6'));module[_0xb7ec('0x7')]=function(_0x4718b2,_0x502efa){return _0x4718b2[_0xb7ec('0x8')](_0xb7ec('0x9'),attributes,{'tableName':_0xb7ec('0xa'),'paranoid':![],'indexes':[{'name':_0xb7ec('0xb'),'fields':[_0xb7ec('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 2dbffd7..9bb9f88 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 _0x01de=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird'];(function(_0x35a049,_0x58e987){var _0x272abc=function(_0x1cf89a){while(--_0x1cf89a){_0x35a049['push'](_0x35a049['shift']());}};_0x272abc(++_0x58e987);}(_0x01de,0x81));var _0xe01d=function(_0x3b3f6c,_0x3315f4){_0x3b3f6c=_0x3b3f6c-0x0;var _0x1b7f33=_0x01de[_0x3b3f6c];return _0x1b7f33;};'use strict';var _=require('lodash');var util=require(_0xe01d('0x0'));var moment=require(_0xe01d('0x1'));var BPromise=require(_0xe01d('0x2'));var rs=require(_0xe01d('0x3'));var fs=require('fs');var Redis=require(_0xe01d('0x4'));var db=require(_0xe01d('0x5'))['db'];var utils=require(_0xe01d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xe01d('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe01d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x21ba82,_0x5b3503,_0x5f0bad){return new BPromise(function(_0x2a857b,_0x27f92e){return client[_0xe01d('0x9')](_0x21ba82,_0x5f0bad)[_0xe01d('0xa')](function(_0x113738){logger[_0xe01d('0xb')](_0xe01d('0xc'),_0x5b3503,_0xe01d('0xd'));logger[_0xe01d('0xe')](_0xe01d('0xf'),_0x5b3503,'request\x20sent',JSON[_0xe01d('0x10')](_0x113738));if(_0x113738[_0xe01d('0x11')]){if(_0x113738[_0xe01d('0x11')][_0xe01d('0x12')]===0x1f4){logger[_0xe01d('0x11')](_0xe01d('0xc'),_0x5b3503,_0x113738[_0xe01d('0x11')][_0xe01d('0x13')]);return _0x27f92e(_0x113738[_0xe01d('0x11')][_0xe01d('0x13')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x5b3503,_0x113738['error']['message']);return _0x2a857b(_0x113738['error'][_0xe01d('0x13')]);}else{logger[_0xe01d('0xb')](_0xe01d('0xc'),_0x5b3503,_0xe01d('0xd'));_0x2a857b(_0x113738[_0xe01d('0x14')][_0xe01d('0x13')]);}})[_0xe01d('0x15')](function(_0x317b40){logger[_0xe01d('0x11')](_0xe01d('0xc'),_0x5b3503,_0x317b40);_0x27f92e(_0x317b40);});});}
\ No newline at end of file
+var _0xd62a=['then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd62a,0x172));var _0xad62=function(_0x3a3a6b,_0x59b6ec){_0x3a3a6b=_0x3a3a6b-0x0;var _0x66450a=_0xd62a[_0x3a3a6b];return _0x66450a;};'use strict';var _=require('lodash');var util=require(_0xad62('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xad62('0x1'));var fs=require('fs');var Redis=require(_0xad62('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xad62('0x3'));var logger=require(_0xad62('0x4'))(_0xad62('0x5'));var config=require('../../config/environment');var jayson=require(_0xad62('0x6'));var client=jayson[_0xad62('0x7')][_0xad62('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x580db0,_0x2f09cf,_0x410239){return new BPromise(function(_0xc5b52e,_0x5a9ad4){return client[_0xad62('0x9')](_0x580db0,_0x410239)[_0xad62('0xa')](function(_0xdb6abb){logger[_0xad62('0xb')](_0xad62('0xc'),_0x2f09cf,_0xad62('0xd'));logger[_0xad62('0xe')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x2f09cf,_0xad62('0xd'),JSON['stringify'](_0xdb6abb));if(_0xdb6abb[_0xad62('0xf')]){if(_0xdb6abb[_0xad62('0xf')][_0xad62('0x10')]===0x1f4){logger[_0xad62('0xf')](_0xad62('0xc'),_0x2f09cf,_0xdb6abb[_0xad62('0xf')][_0xad62('0x11')]);return _0x5a9ad4(_0xdb6abb[_0xad62('0xf')][_0xad62('0x11')]);}logger[_0xad62('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x2f09cf,_0xdb6abb[_0xad62('0xf')][_0xad62('0x11')]);return _0xc5b52e(_0xdb6abb[_0xad62('0xf')][_0xad62('0x11')]);}else{logger['info'](_0xad62('0xc'),_0x2f09cf,_0xad62('0xd'));_0xc5b52e(_0xdb6abb[_0xad62('0x12')][_0xad62('0x11')]);}})[_0xad62('0x13')](function(_0xd9c823){logger['error'](_0xad62('0xc'),_0x2f09cf,_0xd9c823);_0x5a9ad4(_0xd9c823);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index ef8d2bb..e593143 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 _0x25a4=['/:id','show','isAuthenticated','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','index','/describe','describe','get'];(function(_0x3f3bd7,_0x361f3b){var _0x688ea2=function(_0x419d9c){while(--_0x419d9c){_0x3f3bd7['push'](_0x3f3bd7['shift']());}};_0x688ea2(++_0x361f3b);}(_0x25a4,0x9b));var _0x425a=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x25a4[_0x9df060];return _0x338dfe;};'use strict';var multer=require('multer');var util=require(_0x425a('0x0'));var path=require(_0x425a('0x1'));var timeout=require(_0x425a('0x2'));var express=require(_0x425a('0x3'));var router=express[_0x425a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x425a('0x5'));var interaction=require(_0x425a('0x6'));var config=require(_0x425a('0x7'));var controller=require(_0x425a('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x425a('0x9')]);router['get'](_0x425a('0xa'),auth['isAuthenticated'](),controller[_0x425a('0xb')]);router[_0x425a('0xc')](_0x425a('0xd'),auth['isAuthenticated'](),controller[_0x425a('0xe')]);router['post']('/',auth[_0x425a('0xf')](),controller[_0x425a('0x10')]);router[_0x425a('0x11')](_0x425a('0xd'),auth[_0x425a('0xf')](),controller[_0x425a('0x12')]);router[_0x425a('0x13')](_0x425a('0xd'),auth[_0x425a('0xf')](),controller[_0x425a('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x6622=['update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','index','get','/describe','isAuthenticated','describe','post','create','put','/:id'];(function(_0x8bf294,_0x1ca4ae){var _0x596021=function(_0x2d1e15){while(--_0x2d1e15){_0x8bf294['push'](_0x8bf294['shift']());}};_0x596021(++_0x1ca4ae);}(_0x6622,0x115));var _0x2662=function(_0x37ae26,_0x2ecd70){_0x37ae26=_0x37ae26-0x0;var _0x1b1902=_0x6622[_0x37ae26];return _0x1b1902;};'use strict';var multer=require(_0x2662('0x0'));var util=require('util');var path=require(_0x2662('0x1'));var timeout=require(_0x2662('0x2'));var express=require('express');var router=express[_0x2662('0x3')]();var fs_extra=require(_0x2662('0x4'));var auth=require(_0x2662('0x5'));var interaction=require(_0x2662('0x6'));var config=require('../../config/environment');var controller=require(_0x2662('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x2662('0x8')]);router[_0x2662('0x9')](_0x2662('0xa'),auth[_0x2662('0xb')](),controller[_0x2662('0xc')]);router['get']('/:id',auth[_0x2662('0xb')](),controller['show']);router[_0x2662('0xd')]('/',auth[_0x2662('0xb')](),controller[_0x2662('0xe')]);router[_0x2662('0xf')](_0x2662('0x10'),auth[_0x2662('0xb')](),controller[_0x2662('0x11')]);router[_0x2662('0x12')](_0x2662('0x10'),auth[_0x2662('0xb')](),controller[_0x2662('0x13')]);module[_0x2662('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 3d904fd..043d586 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 _0xea96=['mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','star','stringify','name','text','input','onlineForm','parse','getDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','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','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xea96,0x183));var _0x6ea9=function(_0x4b835c,_0xa85bb1){_0x4b835c=_0x4b835c-0x0;var _0x18e7f2=_0xea96[_0x4b835c];return _0x18e7f2;};'use strict';var Sequelize=require(_0x6ea9('0x0'));var rs=require(_0x6ea9('0x1'));module['exports']={'name':{'type':Sequelize[_0x6ea9('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x6ea9('0x2')],'allowNull':![],'unique':_0x6ea9('0x3')},'description':{'type':Sequelize[_0x6ea9('0x2')]},'mapKey':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0x4')},'mapKeyOffline':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0x4')},'key':{'type':Sequelize[_0x6ea9('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x6ea9('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x6ea9('0x2')],'allowNull':![],'defaultValue':_0x6ea9('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6ea9('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x6ea9('0x2')],'allowNull':![],'defaultValue':_0x6ea9('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x6ea9('0x2')],'allowNull':![],'defaultValue':_0x6ea9('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6ea9('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x6ea9('0x2')]},'animation':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6ea9('0xa')](_0x6ea9('0xb'),'squared'),'defaultValue':_0x6ea9('0xb')},'header_online':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0xc')},'start_chat_button':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0xd')},'offline_chat_button':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x6ea9('0x10')]},'closingQuestion':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0x13')},'noteTitle':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0x15')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x6ea9('0x16')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x6ea9('0x17')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM'](_0x6ea9('0x18'),'thumb'),'defaultValue':_0x6ea9('0x18')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6ea9('0x10')],'defaultValue':function(){return JSON[_0x6ea9('0x19')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x6ea9('0x1a'),'type':_0x6ea9('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x6ea9('0x1c'),'props':{'title':_0x6ea9('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x6ea9('0x4'),'type':_0x6ea9('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x6ea9('0x1d'))?JSON[_0x6ea9('0x1e')](this[_0x6ea9('0x1f')](_0x6ea9('0x1d'))):{};},'set':function(_0x3c7e68){return this['setDataValue']('onlineForm',JSON[_0x6ea9('0x19')](_0x3c7e68));}},'offlineForm':{'type':Sequelize[_0x6ea9('0x10')],'defaultValue':function(){return JSON[_0x6ea9('0x19')]({'items':[{'type':_0x6ea9('0x1c'),'props':{'title':_0x6ea9('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x6ea9('0x4'),'type':_0x6ea9('0x4')},'variable':null},{'type':_0x6ea9('0x20'),'config':{'placeholder':'Comments'},'props':{'title':_0x6ea9('0x21'),'helpText':_0x6ea9('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x6ea9('0x1f')](_0x6ea9('0x23'))?JSON[_0x6ea9('0x1e')](this['getDataValue'](_0x6ea9('0x23'))):{};},'set':function(_0x1ef0ec){return this['setDataValue'](_0x6ea9('0x23'),JSON[_0x6ea9('0x19')](_0x1ef0ec));}},'token':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x6ea9('0x2')]},'forwardOffline':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0x24')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0x25')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6ea9('0x26')},'skipUnmanaged':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0x17')},'sendUnmanaged':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0x16')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x6ea9('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x6ea9('0x2')]},'notificationTemplate':{'type':Sequelize[_0x6ea9('0x10')],'defaultValue':function(){return _0x6ea9('0x27');}},'notificationSound':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x6ea9('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x6ea9('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x6ea9('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0x29')},'verticalAlignment':{'type':Sequelize[_0x6ea9('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x6ea9('0x2')]},'customerAvatar':{'type':Sequelize[_0x6ea9('0x10')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6ea9('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x6ea9('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6ea9('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6ea9('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6ea9('0x8')],'comment':_0x6ea9('0x2a')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x6ea9('0x2b'),'set':function(_0x13460b){if(!_0x13460b)this[_0x6ea9('0x2c')](_0x6ea9('0x2d'),null);this[_0x6ea9('0x2c')]('mandatoryDisposition',_0x13460b);}},'vidaooEscalation':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x6ea9('0x2')]},'vidaooTopic':{'type':Sequelize[_0x6ea9('0x2')],'allowNull':![],'defaultValue':_0x6ea9('0x2e')},'vidaooNote':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':function(){return _0x6ea9('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0x6ea9('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x6ea9('0x10')]}};
\ No newline at end of file
+var _0xeb65=['setDataValue','input','textarea','Leave\x20your\x20comments','getDataValue','parse','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Send','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','stringify','name','text','onlineForm'];(function(_0x540cf4,_0x21e29e){var _0x254c12=function(_0x5da45e){while(--_0x5da45e){_0x540cf4['push'](_0x540cf4['shift']());}};_0x254c12(++_0x21e29e);}(_0xeb65,0x110));var _0x5eb6=function(_0x565a48,_0x2fd653){_0x565a48=_0x565a48-0x0;var _0x2ce86b=_0xeb65[_0x565a48];return _0x2ce86b;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x5eb6('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x5eb6('0x1')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x5eb6('0x1')]},'mapKey':{'type':Sequelize[_0x5eb6('0x1')],'defaultValue':_0x5eb6('0x2')},'mapKeyOffline':{'type':Sequelize[_0x5eb6('0x1')],'defaultValue':'email'},'key':{'type':Sequelize[_0x5eb6('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x5eb6('0x1')],'defaultValue':_0x5eb6('0x3')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x5eb6('0x1')],'allowNull':![],'defaultValue':_0x5eb6('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x5eb6('0x1')],'allowNull':![],'defaultValue':_0x5eb6('0x5'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x5eb6('0x1')],'allowNull':![],'defaultValue':_0x5eb6('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x5eb6('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x5eb6('0x1')]},'animation':{'type':Sequelize[_0x5eb6('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x5eb6('0x8')](_0x5eb6('0x9'),_0x5eb6('0xa')),'defaultValue':_0x5eb6('0x9')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x5eb6('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x5eb6('0x1')],'defaultValue':_0x5eb6('0xc')},'header_offline':{'type':Sequelize[_0x5eb6('0x1')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x5eb6('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x5eb6('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x5eb6('0x1')],'defaultValue':_0x5eb6('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x5eb6('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x5eb6('0xe')]},'closingQuestion':{'type':Sequelize[_0x5eb6('0x1')],'defaultValue':_0x5eb6('0xf')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x5eb6('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x5eb6('0x1')],'defaultValue':_0x5eb6('0x11')},'noteTitle':{'type':Sequelize[_0x5eb6('0x1')],'defaultValue':_0x5eb6('0x12')},'placeholderMessage':{'type':Sequelize[_0x5eb6('0x1')],'defaultValue':_0x5eb6('0x13')},'closingMessage':{'type':Sequelize[_0x5eb6('0x1')],'defaultValue':_0x5eb6('0x14')},'closingMessageButton':{'type':Sequelize[_0x5eb6('0x1')],'defaultValue':_0x5eb6('0xc')},'skipMessageButton':{'type':Sequelize[_0x5eb6('0x1')],'defaultValue':_0x5eb6('0x15')},'conditionAgreement':{'type':Sequelize[_0x5eb6('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x5eb6('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x5eb6('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x5eb6('0x1')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x5eb6('0x8')](_0x5eb6('0x16'),_0x5eb6('0x17')),'defaultValue':_0x5eb6('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x5eb6('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x5eb6('0xe')],'defaultValue':function(){return JSON[_0x5eb6('0x18')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x5eb6('0x19'),'type':_0x5eb6('0x1a'),'required':!![]},'props':{'title':_0x5eb6('0x19'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x5eb6('0x2'),'type':_0x5eb6('0x2')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x5eb6('0x1b'))?JSON['parse'](this['getDataValue']('onlineForm')):{};},'set':function(_0x3b6b8b){return this[_0x5eb6('0x1c')](_0x5eb6('0x1b'),JSON[_0x5eb6('0x18')](_0x3b6b8b));}},'offlineForm':{'type':Sequelize[_0x5eb6('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x5eb6('0x1d'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x5eb6('0x2')},'variable':null},{'type':_0x5eb6('0x1e'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x5eb6('0x1f')}}],'fromKey':0x0});},'get':function(){return this[_0x5eb6('0x20')]('offlineForm')?JSON[_0x5eb6('0x21')](this['getDataValue'](_0x5eb6('0x22'))):{};},'set':function(_0x376f87){return this[_0x5eb6('0x1c')](_0x5eb6('0x22'),JSON[_0x5eb6('0x18')](_0x376f87));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x5eb6('0x23')]();}},'autoclose':{'type':Sequelize[_0x5eb6('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x5eb6('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x5eb6('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x5eb6('0x1')]},'waitingTitle':{'type':Sequelize[_0x5eb6('0x1')],'defaultValue':_0x5eb6('0x24')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x5eb6('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x5eb6('0x1')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x5eb6('0x1')],'defaultValue':_0x5eb6('0x26')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x5eb6('0x1')],'defaultValue':_0x5eb6('0x27')},'skipUnmanaged':{'type':Sequelize[_0x5eb6('0x1')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x5eb6('0x1')],'defaultValue':_0x5eb6('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x5eb6('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x5eb6('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x5eb6('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x5eb6('0x28');}},'notificationSound':{'type':Sequelize[_0x5eb6('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5eb6('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x5eb6('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x5eb6('0x1')],'defaultValue':_0x5eb6('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x5eb6('0x1')],'defaultValue':_0x5eb6('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x5eb6('0x1')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x5eb6('0x2b')},'defaultTitle':{'type':Sequelize[_0x5eb6('0x1')]},'customerAvatar':{'type':Sequelize[_0x5eb6('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0x5eb6('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x5eb6('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x5eb6('0x1')],'allowNull':![],'defaultValue':_0x5eb6('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5eb6('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5eb6('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5eb6('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x5eb6('0x1')],'defaultValue':_0x5eb6('0x2d')},'systemAvatar':{'type':Sequelize[_0x5eb6('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5eb6('0x6')],'comment':_0x5eb6('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x5eb6('0x7')],'defaultValue':![],'comment':_0x5eb6('0x2f'),'set':function(_0x22d130){if(!_0x22d130)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0x5eb6('0x30'),_0x22d130);}},'vidaooEscalation':{'type':Sequelize[_0x5eb6('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x5eb6('0x1')]},'vidaooTopic':{'type':Sequelize[_0x5eb6('0x1')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x5eb6('0x1')],'defaultValue':function(){return _0x5eb6('0x31');}},'vidaooMetadata':{'type':Sequelize[_0x5eb6('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x5eb6('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x5eb6('0xe')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index b4fd1ba..301d7af 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 _0xa9fc=['destroy','ChatWebsites','UserProfileResource','end','sendStatus','stack','name','send','getSnippet','timezone','format','iftime\x20%s,%s','interval','iftime\x20%s','true','ONLINE','inspect','No\x20timezone','map','Interval','Intervals','get','all','some','user-agent-parser','setUA','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','%s\x20%s','unknown','device','model','vendor','type','index','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','rows','catch','show','params','Pause','includeAll','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','describe','addDisposition','Disposition','getDispositions','ChatWebsiteId','include','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addLogo','sitepic','filename','agentAvatar','file','customerAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','notify','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','ListId','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','list','priority','asc','account','from','contact','headers','threadId','ChatInteraction','externalUrl','interaction','lastName','messageId','created','push','applications','close','*,*,*,*','ChatMessage','UserId','User','unshift','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','EventManager','updatedAt','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','server','files','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','sendMail','\x22%s\x22\x20<%s>','MailAccountId','subjectOffline','toPairsIn','mapValues','email','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','Contact','Owner','internal','Tag','Tags','tag','getProactiveActions','virtual','License','increment','utf8','origin','3.5.0','remote','connection','render','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','hideWhenOffline','IntervalId','READ_COMMITTED','ChatApplication','findAndCountAll','getApplications','addProactiveActions','omit','getFields','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','util','path','ejs','fs-extra','lodash','querystring','html-to-text','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','handleError','../../mysqldb','redis','defaults','localhost','register','http','client','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','status','json','undefined','limit','count','offset','update'];(function(_0x1b57af,_0x839caa){var _0x242d5d=function(_0xf5e00e){while(--_0xf5e00e){_0x1b57af['push'](_0x1b57af['shift']());}};_0x242d5d(++_0x839caa);}(_0xa9fc,0xfd));var _0xca9f=function(_0x368587,_0x1b6554){_0x368587=_0x368587-0x0;var _0x42d33c=_0xa9fc[_0x368587];return _0x42d33c;};'use strict';var Mustache=require('mustache');var util=require(_0xca9f('0x0'));var path=require(_0xca9f('0x1'));var ejs=require(_0xca9f('0x2'));var fs=require('fs');var fs_extra=require(_0xca9f('0x3'));var _=require(_0xca9f('0x4'));var querystring=require(_0xca9f('0x5'));var htmlToText=require(_0xca9f('0x6'));var Redis=require(_0xca9f('0x7'));var jayson=require('jayson/promise');var url=require('url');var qs=require(_0xca9f('0x8'));var logger=require(_0xca9f('0x9'))(_0xca9f('0xa'));var config=require(_0xca9f('0xb'));var APIOutOfIntervalError=require('../../errors/api')['APIOutOfIntervalError'];var APINotFoundError=require('../../errors/api')['APINotFoundError'];var APIHandleError=require('../../errors/api')[_0xca9f('0xc')];var db=require(_0xca9f('0xd'))['db'];config[_0xca9f('0xe')]=_[_0xca9f('0xf')](config[_0xca9f('0xe')],{'host':_0xca9f('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xca9f('0xe')]));require('./chatWebsite.socket')[_0xca9f('0x11')](socket);var client=jayson['client'][_0xca9f('0x12')]({'port':0x232c});var client9002=jayson[_0xca9f('0x13')][_0xca9f('0x12')]({'port':0x232a});var client9003=jayson[_0xca9f('0x13')][_0xca9f('0x12')]({'port':0x232b});var client9001=jayson[_0xca9f('0x13')][_0xca9f('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x4f72c5,_0x18377e,_0x2d0189,_0x424d27){return new Promise(function(_0x37cc03,_0x2d11cb){var _0x36dc70=_0x424d27||client;return _0x36dc70['request'](_0x4f72c5,_0x2d0189)[_0xca9f('0x14')](function(_0x30ae2a){logger['info'](_0xca9f('0x15'),_0x18377e,_0xca9f('0x16'));logger[_0xca9f('0x17')](_0xca9f('0x18'),_0x18377e,_0xca9f('0x16'),JSON[_0xca9f('0x19')](_0x30ae2a));if(_0x30ae2a['error']){if(_0x30ae2a['error'][_0xca9f('0x1a')]===0x1f4){logger[_0xca9f('0x1b')](_0xca9f('0x15'),_0x18377e,_0x30ae2a[_0xca9f('0x1b')][_0xca9f('0x1c')]);return _0x2d11cb(_0x30ae2a[_0xca9f('0x1b')][_0xca9f('0x1c')]);}logger[_0xca9f('0x1b')](_0xca9f('0x15'),_0x18377e,_0x30ae2a[_0xca9f('0x1b')][_0xca9f('0x1c')]);return _0x37cc03(_0x30ae2a[_0xca9f('0x1b')]['message']);}else{logger[_0xca9f('0x1d')](_0xca9f('0x15'),_0x18377e,'request\x20sent');_0x37cc03(_0x30ae2a['result'][_0xca9f('0x1c')]);}})['catch'](function(_0x4ff5b4){logger[_0xca9f('0x1b')](_0xca9f('0x15'),_0x18377e,_0x4ff5b4);_0x2d11cb(_0x4ff5b4);});});}function respondWithStatusCode(_0x3d79b0,_0x173966){_0x173966=_0x173966||0xcc;return function(_0xa34f){if(_0xa34f){return _0x3d79b0['sendStatus'](_0x173966);}return _0x3d79b0[_0xca9f('0x1e')](_0x173966)['end']();};}function respondWithResult(_0x150b46,_0x4a0827){_0x4a0827=_0x4a0827||0xc8;return function(_0x40d00c){if(_0x40d00c){return _0x150b46[_0xca9f('0x1e')](_0x4a0827)[_0xca9f('0x1f')](_0x40d00c);}};}function respondWithFilteredResult(_0x449004,_0x296c16){return function(_0x1f6fab){if(_0x1f6fab){var _0x2cb22f=typeof _0x296c16['offset']===_0xca9f('0x20')&&typeof _0x296c16[_0xca9f('0x21')]==='undefined';var _0x19e8ac=_0x1f6fab[_0xca9f('0x22')];var _0x4b37de=_0x2cb22f?0x0:_0x296c16[_0xca9f('0x23')];var _0x135c51=_0x2cb22f?_0x1f6fab[_0xca9f('0x22')]:_0x296c16[_0xca9f('0x23')]+_0x296c16[_0xca9f('0x21')];var _0x44d7ec;if(_0x135c51>=_0x19e8ac){_0x135c51=_0x19e8ac;_0x44d7ec=0xc8;}else{_0x44d7ec=0xce;}_0x449004[_0xca9f('0x1e')](_0x44d7ec);return _0x449004['set']('Content-Range',_0x4b37de+'-'+_0x135c51+'/'+_0x19e8ac)[_0xca9f('0x1f')](_0x1f6fab);}return null;};}function saveUpdates(_0x43bc6e){return function(_0xde54bf){if(_0xde54bf){return _0xde54bf[_0xca9f('0x24')](_0x43bc6e)[_0xca9f('0x14')](function(_0x1332c4){return _0x1332c4;});}return null;};}function removeEntity(_0x5d5694){return function(_0x3b7969){if(_0x3b7969){return _0x3b7969[_0xca9f('0x25')]()['then'](function(){var _0x2dd14e=_0x3b7969['get']({'plain':!![]});var _0x1af3eb=_0xca9f('0x26');return db[_0xca9f('0x27')][_0xca9f('0x25')]({'where':{'type':_0x1af3eb,'resourceId':_0x2dd14e['id']}})['then'](function(){return _0x3b7969;});})[_0xca9f('0x14')](function(){_0x5d5694[_0xca9f('0x1e')](0xcc)[_0xca9f('0x28')]();});}};}function handleEntityNotFound(_0x2b78b3){return function(_0x19ee44){if(!_0x19ee44){_0x2b78b3[_0xca9f('0x29')](0x194);}return _0x19ee44;};}function handleError(_0x8debf,_0x90c31f){_0x90c31f=_0x90c31f||0x1f4;return function(_0x3eb0b4){logger[_0xca9f('0x1b')](_0x3eb0b4[_0xca9f('0x2a')]);if(_0x3eb0b4[_0xca9f('0x2b')]){delete _0x3eb0b4['name'];}_0x8debf[_0xca9f('0x1e')](_0x90c31f)[_0xca9f('0x2c')](_0x3eb0b4);};}function iftimePromise(_0x238997,_0x52309c){return respondWithRpcPromise('Command',_0xca9f('0x2d'),{'command':_0x52309c[_0xca9f('0x2e')]?util[_0xca9f('0x2f')](_0xca9f('0x30'),_0x238997[_0xca9f('0x31')],_0x52309c['timezone']):util[_0xca9f('0x2f')](_0xca9f('0x32'),_0x238997[_0xca9f('0x31')])},client9002)[_0xca9f('0x14')](function(_0xefedc8){var _0x5e0de0=_0xefedc8&&_0xefedc8['indexOf'](_0xca9f('0x33'))>=0x0?!![]:![];logger[_0xca9f('0x1d')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x52309c['id'],_0x238997['id'],_0x238997['interval'],_0x5e0de0?_0xca9f('0x34'):'OFFLINE',_0x52309c[_0xca9f('0x2e')]?_0x52309c[_0xca9f('0x2e')]:'No\x20timezone');return _0x5e0de0;})['catch'](function(_0x5588ea){logger[_0xca9f('0x1b')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x52309c['id'],_0x238997['id'],_0x238997['interval'],util[_0xca9f('0x35')](_0x5588ea,{'showHidden':![],'depth':null}),_0x52309c[_0xca9f('0x2e')]?_0x52309c['timezone']:_0xca9f('0x36'));return![];});}function checkWebsiteIntervals(_0x87bb97){var _0x163090=_[_0xca9f('0x37')](_0x87bb97[_0xca9f('0x38')][_0xca9f('0x39')],function(_0x55b6ee){var _0x4494df=_0x55b6ee[_0xca9f('0x3a')]({'plain':!![]});return iftimePromise(_0x4494df,_0x87bb97);});return Promise[_0xca9f('0x3b')](_0x163090)['then'](function(_0x1931bc){return _[_0xca9f('0x3c')](_0x1931bc);});}function createInteractionObject(_0x133796,_0x56c6e5,_0x3abe1b,_0x11f2a8){var _0x61320a=require(_0xca9f('0x3d'));var _0x12d7b9=new _0x61320a();var _0x520035=_0x12d7b9[_0xca9f('0x3e')](_0x3abe1b['user-agent'])[_0xca9f('0x3f')]();var _0xe90b13=_0x56c6e5[_0xca9f('0x40')];if(_0x3abe1b[_0xca9f('0x41')]){_0xe90b13=_0x3abe1b[_0xca9f('0x41')];}else if(_0x3abe1b[_0xca9f('0x42')]){_0xe90b13=_[_0xca9f('0x43')](_0x3abe1b[_0xca9f('0x42')][_0xca9f('0x44')](','));}return{'ContactId':_0x11f2a8['id'],'ChatWebsiteId':_0x133796,'from':(_0x11f2a8[_0xca9f('0x45')]||'')+'\x20'+(_0x11f2a8['lastName']||''),'customerIp':_0xe90b13,'customerPort':_0x3abe1b[_0xca9f('0x46')]?_0x3abe1b[_0xca9f('0x46')]:null,'referer':_0x56c6e5[_0xca9f('0x47')],'browserName':_0x520035[_0xca9f('0x48')][_0xca9f('0x2b')]&&_0x520035['browser'][_0xca9f('0x49')]?util[_0xca9f('0x2f')](_0xca9f('0x4a'),_0x520035['browser'][_0xca9f('0x2b')],_0x520035[_0xca9f('0x48')][_0xca9f('0x49')]):_0xca9f('0x4b'),'browserVersion':_0x520035[_0xca9f('0x48')][_0xca9f('0x49')]||'unknown','osName':util[_0xca9f('0x2f')](_0xca9f('0x4a'),_0x520035['os'][_0xca9f('0x2b')],_0x520035['os'][_0xca9f('0x49')]),'osVersion':_0x520035['os'][_0xca9f('0x49')],'deviceModel':_0x520035[_0xca9f('0x4c')][_0xca9f('0x4d')]&&_0x520035[_0xca9f('0x4c')][_0xca9f('0x4e')]?util[_0xca9f('0x2f')]('%s\x20%s\x20%s',_0x520035[_0xca9f('0x4c')]['model'],_0x520035[_0xca9f('0x4c')][_0xca9f('0x4e')],_0x520035[_0xca9f('0x4c')][_0xca9f('0x4f')]):null,'deviceVendor':_0x520035[_0xca9f('0x4c')][_0xca9f('0x4e')],'deviceType':_0x520035['device']['type'],'formData':JSON[_0xca9f('0x19')](_0x56c6e5)};}exports[_0xca9f('0x50')]=function(_0x509c9d,_0x1b1047){var _0x5582ca={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2de39c={},_0x338d6f={'count':0x0,'rows':[]};var _0x397125=_[_0xca9f('0x37')](db[_0xca9f('0x51')][_0xca9f('0x52')],function(_0x45f9bc){return{'name':_0x45f9bc[_0xca9f('0x53')],'type':_0x45f9bc[_0xca9f('0x4f')][_0xca9f('0x54')]};});_0x2de39c[_0xca9f('0x4d')]=_['map'](_0x397125,_0xca9f('0x2b'));_0x2de39c[_0xca9f('0x55')]=_[_0xca9f('0x56')](_0x509c9d[_0xca9f('0x55')]);_0x2de39c[_0xca9f('0x57')]=_[_0xca9f('0x58')](_0x2de39c[_0xca9f('0x4d')],_0x2de39c['query']);_0x5582ca[_0xca9f('0x59')]=_[_0xca9f('0x58')](_0x2de39c['model'],qs[_0xca9f('0x5a')](_0x509c9d[_0xca9f('0x55')]['fields']));_0x5582ca[_0xca9f('0x59')]=_0x5582ca[_0xca9f('0x59')][_0xca9f('0x5b')]?_0x5582ca[_0xca9f('0x59')]:_0x2de39c[_0xca9f('0x4d')];if(!_0x509c9d[_0xca9f('0x55')][_0xca9f('0x5c')](_0xca9f('0x5d'))){_0x5582ca['limit']=qs['limit'](_0x509c9d[_0xca9f('0x55')]['limit']);_0x5582ca[_0xca9f('0x23')]=qs[_0xca9f('0x23')](_0x509c9d[_0xca9f('0x55')][_0xca9f('0x23')]);}_0x5582ca[_0xca9f('0x5e')]=qs[_0xca9f('0x5f')](_0x509c9d['query'][_0xca9f('0x5f')]);_0x5582ca[_0xca9f('0x60')]=qs[_0xca9f('0x57')](_[_0xca9f('0x61')](_0x509c9d[_0xca9f('0x55')],_0x2de39c[_0xca9f('0x57')]),_0x397125);if(_0x509c9d[_0xca9f('0x55')][_0xca9f('0x62')]){_0x5582ca[_0xca9f('0x60')]=_['merge'](_0x5582ca['where'],{'$or':_['map'](_0x397125,function(_0x207067){if(_0x207067[_0xca9f('0x4f')]!==_0xca9f('0x63')){var _0x3fb80d={};_0x3fb80d[_0x207067[_0xca9f('0x2b')]]={'$like':'%'+_0x509c9d[_0xca9f('0x55')][_0xca9f('0x62')]+'%'};return _0x3fb80d;}})});}_0x5582ca=_[_0xca9f('0x64')]({},_0x5582ca,_0x509c9d[_0xca9f('0x65')]);var _0x5e1e2f={'where':_0x5582ca['where']};return db[_0xca9f('0x51')][_0xca9f('0x22')](_0x5e1e2f)[_0xca9f('0x14')](function(_0x8fb35f){_0x338d6f['count']=_0x8fb35f;if(_0x509c9d[_0xca9f('0x55')]['includeAll']){_0x5582ca['include']=[{'all':!![]}];}return db[_0xca9f('0x51')]['findAll'](_0x5582ca);})[_0xca9f('0x14')](function(_0x376b85){_0x338d6f[_0xca9f('0x66')]=_0x376b85;return _0x338d6f;})[_0xca9f('0x14')](respondWithFilteredResult(_0x1b1047,_0x5582ca))[_0xca9f('0x67')](handleError(_0x1b1047,null));};exports[_0xca9f('0x68')]=function(_0x19ae59,_0x95acdf){var _0x20727d={'raw':![],'where':{'id':_0x19ae59[_0xca9f('0x69')]['id']},'include':[{'model':db[_0xca9f('0x6a')],'as':'mandatoryDispositionPause'}]},_0x491a61={};_0x491a61['model']=_[_0xca9f('0x56')](db[_0xca9f('0x51')]['rawAttributes']);_0x491a61[_0xca9f('0x55')]=_[_0xca9f('0x56')](_0x19ae59[_0xca9f('0x55')]);_0x491a61['filters']=_['intersection'](_0x491a61[_0xca9f('0x4d')],_0x491a61[_0xca9f('0x55')]);_0x20727d[_0xca9f('0x59')]=_[_0xca9f('0x58')](_0x491a61[_0xca9f('0x4d')],qs[_0xca9f('0x5a')](_0x19ae59[_0xca9f('0x55')]['fields']));_0x20727d['attributes']=_0x20727d['attributes']['length']?_0x20727d[_0xca9f('0x59')]:_0x491a61[_0xca9f('0x4d')];if(_0x19ae59[_0xca9f('0x55')][_0xca9f('0x6b')]){_0x20727d['include']=[{'all':!![]}];}_0x20727d=_[_0xca9f('0x64')]({},_0x20727d,_0x19ae59['options']);return db[_0xca9f('0x51')][_0xca9f('0x6c')](_0x20727d)['then'](handleEntityNotFound(_0x95acdf,null))['then'](respondWithResult(_0x95acdf,null))[_0xca9f('0x67')](handleError(_0x95acdf,null));};exports[_0xca9f('0x6d')]=function(_0x52d135,_0x23b7b1){return db[_0xca9f('0x51')]['create'](_0x52d135[_0xca9f('0x6e')],{})['then'](function(_0x26e351){var _0x448806=_0x52d135['user'][_0xca9f('0x3a')]({'plain':!![]});if(!_0x448806)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x448806[_0xca9f('0x6f')]===_0xca9f('0x70')){var _0x4b7b59=_0x26e351['get']({'plain':!![]});var _0x3d14cd='ChatWebsites';return db[_0xca9f('0x71')]['find']({'where':{'name':_0x3d14cd,'userProfileId':_0x448806[_0xca9f('0x72')]},'raw':!![]})[_0xca9f('0x14')](function(_0x9c2a4c){if(_0x9c2a4c&&_0x9c2a4c[_0xca9f('0x73')]===0x0){return db[_0xca9f('0x27')][_0xca9f('0x6d')]({'name':_0x4b7b59['name'],'resourceId':_0x4b7b59['id'],'type':_0x9c2a4c['name'],'sectionId':_0x9c2a4c['id']},{})[_0xca9f('0x14')](function(){return _0x26e351;});}else{return _0x26e351;}})['catch'](function(_0x5251a9){logger[_0xca9f('0x1b')](_0xca9f('0x74'),_0x5251a9);throw _0x5251a9;});}return _0x26e351;})[_0xca9f('0x14')](respondWithResult(_0x23b7b1,0xc9))['catch'](handleError(_0x23b7b1,null));};exports[_0xca9f('0x24')]=function(_0x12b983,_0x49484e){if(_0x12b983['body']['id']){delete _0x12b983[_0xca9f('0x6e')]['id'];}return db['ChatWebsite'][_0xca9f('0x6c')]({'where':{'id':_0x12b983[_0xca9f('0x69')]['id']},'include':[{'model':db[_0xca9f('0x6a')],'as':_0xca9f('0x75')}]})[_0xca9f('0x14')](handleEntityNotFound(_0x49484e,null))[_0xca9f('0x14')](saveUpdates(_0x12b983['body'],null))['then'](respondWithResult(_0x49484e,null))[_0xca9f('0x67')](handleError(_0x49484e,null));};exports['destroy']=function(_0x2d7c5a,_0x4ec969){return db['ChatWebsite'][_0xca9f('0x6c')]({'where':{'id':_0x2d7c5a['params']['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x4ec969,null))[_0xca9f('0x14')](removeEntity(_0x4ec969,null))[_0xca9f('0x67')](handleError(_0x4ec969,null));};exports[_0xca9f('0x76')]=function(_0x1e4e99,_0x3c9816){return db['ChatWebsite'][_0xca9f('0x76')]()['then'](respondWithResult(_0x3c9816,null))[_0xca9f('0x67')](handleError(_0x3c9816,null));};exports[_0xca9f('0x77')]=function(_0x2a3954,_0x235b6b){if(_0x2a3954[_0xca9f('0x6e')]['id']){delete _0x2a3954['body']['id'];}return db[_0xca9f('0x51')][_0xca9f('0x6c')]({'where':{'id':_0x2a3954[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x235b6b,null))['then'](function(_0x36a3fe){if(_0x36a3fe){_0x2a3954[_0xca9f('0x6e')]['ChatWebsiteId']=_0x36a3fe['id'];return db[_0xca9f('0x78')][_0xca9f('0x6d')](_0x2a3954['body']);}})[_0xca9f('0x14')](respondWithResult(_0x235b6b,null))[_0xca9f('0x67')](handleError(_0x235b6b,null));};exports[_0xca9f('0x79')]=function(_0x1c0445,_0x2a922b){var _0xc4969f={'raw':![],'where':{}};var _0x2e80f2={};var _0x3d87ef={'count':0x0,'rows':[]};return db[_0xca9f('0x51')]['findOne']({'where':{'id':_0x1c0445[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x2a922b,null))[_0xca9f('0x14')](function(_0x46a58d){if(_0x46a58d){_0x2e80f2[_0xca9f('0x4d')]=_[_0xca9f('0x56')](db[_0xca9f('0x78')][_0xca9f('0x52')]);_0x2e80f2[_0xca9f('0x55')]=_['keys'](_0x1c0445[_0xca9f('0x55')]);_0x2e80f2[_0xca9f('0x57')]=_['intersection'](_0x2e80f2[_0xca9f('0x4d')],_0x2e80f2[_0xca9f('0x55')]);_0xc4969f['attributes']=_['intersection'](_0x2e80f2['model'],qs[_0xca9f('0x5a')](_0x1c0445[_0xca9f('0x55')][_0xca9f('0x5a')]));_0xc4969f[_0xca9f('0x59')]=_0xc4969f['attributes']['length']?_0xc4969f[_0xca9f('0x59')]:_0x2e80f2[_0xca9f('0x4d')];if(!_0x1c0445[_0xca9f('0x55')]['hasOwnProperty']('nolimit')){_0xc4969f[_0xca9f('0x21')]=qs[_0xca9f('0x21')](_0x1c0445[_0xca9f('0x55')][_0xca9f('0x21')]);_0xc4969f[_0xca9f('0x23')]=qs[_0xca9f('0x23')](_0x1c0445[_0xca9f('0x55')][_0xca9f('0x23')]);}_0xc4969f[_0xca9f('0x5e')]=qs[_0xca9f('0x5f')](_0x1c0445['query'][_0xca9f('0x5f')]);_0xc4969f[_0xca9f('0x60')]=qs[_0xca9f('0x57')](_['pick'](_0x1c0445[_0xca9f('0x55')],_0x2e80f2[_0xca9f('0x57')]));_0xc4969f[_0xca9f('0x60')][_0xca9f('0x7a')]=_0x46a58d['id'];if(_0x1c0445['query']['filter']){_0xc4969f[_0xca9f('0x60')]=_[_0xca9f('0x64')](_0xc4969f[_0xca9f('0x60')],{'$or':_[_0xca9f('0x37')](_0xc4969f[_0xca9f('0x59')],function(_0x40e2bd){var _0x490beb={};_0x490beb[_0x40e2bd]={'$like':'%'+_0x1c0445[_0xca9f('0x55')]['filter']+'%'};return _0x490beb;})});}_0xc4969f=_[_0xca9f('0x64')]({},_0xc4969f,_0x1c0445[_0xca9f('0x65')]);return db['Disposition'][_0xca9f('0x22')]({'where':_0xc4969f[_0xca9f('0x60')]})['then'](function(_0x26691a){_0x3d87ef[_0xca9f('0x22')]=_0x26691a;if(_0x1c0445[_0xca9f('0x55')][_0xca9f('0x6b')]){_0xc4969f[_0xca9f('0x7b')]=[{'all':!![]}];}return db[_0xca9f('0x78')][_0xca9f('0x7c')](_0xc4969f);})[_0xca9f('0x14')](function(_0x2b5a67){_0x3d87ef[_0xca9f('0x66')]=_0x2b5a67;return _0x3d87ef;});}})[_0xca9f('0x14')](respondWithFilteredResult(_0x2a922b,_0xc4969f))['catch'](handleError(_0x2a922b,null));};exports['removeDispositions']=function(_0x419d25,_0x5c1074){return db[_0xca9f('0x51')][_0xca9f('0x6c')]({'where':{'id':_0x419d25[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x5c1074,null))[_0xca9f('0x14')](function(_0x5f3b41){if(_0x5f3b41){return _0x5f3b41[_0xca9f('0x7d')](_0x419d25[_0xca9f('0x55')][_0xca9f('0x7e')]);}})[_0xca9f('0x14')](respondWithStatusCode(_0x5c1074,null))[_0xca9f('0x67')](handleError(_0x5c1074,null));};exports[_0xca9f('0x7f')]=function(_0x43e2f3,_0x280c4e){if(_0x43e2f3[_0xca9f('0x6e')]['id']){delete _0x43e2f3[_0xca9f('0x6e')]['id'];}return db[_0xca9f('0x51')][_0xca9f('0x6c')]({'where':{'id':_0x43e2f3[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x280c4e,null))[_0xca9f('0x14')](function(_0x50b0d5){if(_0x50b0d5){_0x43e2f3[_0xca9f('0x6e')][_0xca9f('0x7a')]=_0x50b0d5['id'];return db[_0xca9f('0x80')][_0xca9f('0x6d')](_0x43e2f3[_0xca9f('0x6e')]);}})[_0xca9f('0x14')](respondWithResult(_0x280c4e,null))['catch'](handleError(_0x280c4e,null));};exports[_0xca9f('0x81')]=function(_0xbfdf0,_0x504f24){var _0x247761={'raw':![],'where':{}};var _0x390b25={};var _0x44b89e={'count':0x0,'rows':[]};return db[_0xca9f('0x51')][_0xca9f('0x82')]({'where':{'id':_0xbfdf0[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x504f24,null))[_0xca9f('0x14')](function(_0x419f76){if(_0x419f76){_0x390b25['model']=_['keys'](db[_0xca9f('0x80')][_0xca9f('0x52')]);_0x390b25['query']=_[_0xca9f('0x56')](_0xbfdf0[_0xca9f('0x55')]);_0x390b25[_0xca9f('0x57')]=_[_0xca9f('0x58')](_0x390b25[_0xca9f('0x4d')],_0x390b25[_0xca9f('0x55')]);_0x247761[_0xca9f('0x59')]=_['intersection'](_0x390b25['model'],qs[_0xca9f('0x5a')](_0xbfdf0[_0xca9f('0x55')][_0xca9f('0x5a')]));_0x247761['attributes']=_0x247761[_0xca9f('0x59')][_0xca9f('0x5b')]?_0x247761[_0xca9f('0x59')]:_0x390b25['model'];if(!_0xbfdf0['query']['hasOwnProperty'](_0xca9f('0x5d'))){_0x247761[_0xca9f('0x21')]=qs['limit'](_0xbfdf0['query']['limit']);_0x247761[_0xca9f('0x23')]=qs[_0xca9f('0x23')](_0xbfdf0[_0xca9f('0x55')]['offset']);}_0x247761['order']=qs[_0xca9f('0x5f')](_0xbfdf0['query'][_0xca9f('0x5f')]);_0x247761[_0xca9f('0x60')]=qs[_0xca9f('0x57')](_[_0xca9f('0x61')](_0xbfdf0[_0xca9f('0x55')],_0x390b25[_0xca9f('0x57')]));_0x247761[_0xca9f('0x60')][_0xca9f('0x7a')]=_0x419f76['id'];if(_0xbfdf0[_0xca9f('0x55')][_0xca9f('0x62')]){_0x247761[_0xca9f('0x60')]=_[_0xca9f('0x64')](_0x247761['where'],{'$or':_[_0xca9f('0x37')](_0x247761['attributes'],function(_0x42dd70){var _0x1b0b37={};_0x1b0b37[_0x42dd70]={'$like':'%'+_0xbfdf0[_0xca9f('0x55')][_0xca9f('0x62')]+'%'};return _0x1b0b37;})});}_0x247761=_[_0xca9f('0x64')]({},_0x247761,_0xbfdf0[_0xca9f('0x65')]);return db['CannedAnswer'][_0xca9f('0x22')]({'where':_0x247761[_0xca9f('0x60')]})['then'](function(_0x534daa){_0x44b89e[_0xca9f('0x22')]=_0x534daa;if(_0xbfdf0[_0xca9f('0x55')]['includeAll']){_0x247761['include']=[{'all':!![]}];}return db[_0xca9f('0x80')]['findAll'](_0x247761);})[_0xca9f('0x14')](function(_0x185a8c){_0x44b89e['rows']=_0x185a8c;return _0x44b89e;});}})[_0xca9f('0x14')](respondWithFilteredResult(_0x504f24,_0x247761))[_0xca9f('0x67')](handleError(_0x504f24,null));};exports[_0xca9f('0x83')]=function(_0x59080c,_0x12c4a7){return db[_0xca9f('0x51')][_0xca9f('0x6c')]({'where':{'id':_0x59080c[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x12c4a7,null))['then'](function(_0x2fcd16){if(_0x2fcd16){return _0x2fcd16[_0xca9f('0x83')](_0x59080c[_0xca9f('0x55')][_0xca9f('0x7e')]);}})[_0xca9f('0x14')](respondWithStatusCode(_0x12c4a7,null))[_0xca9f('0x67')](handleError(_0x12c4a7,null));};exports[_0xca9f('0x84')]=function(_0x2c74b7,_0xc598fe){_0x2c74b7['body'][_0xca9f('0x85')]=_0x2c74b7['file'][_0xca9f('0x86')];return db['ChatWebsite'][_0xca9f('0x6c')]({'where':{'id':_0x2c74b7[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0xc598fe,null))['then'](saveUpdates(_0x2c74b7[_0xca9f('0x6e')],null))['then'](respondWithResult(_0xc598fe,null))[_0xca9f('0x67')](handleError(_0xc598fe,null));};exports['addAvatar']=function(_0x1f82c2,_0x192bb8){_0x1f82c2[_0xca9f('0x6e')][_0xca9f('0x87')]=_0x1f82c2[_0xca9f('0x88')][_0xca9f('0x86')];return db['ChatWebsite']['find']({'where':{'id':_0x1f82c2[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x192bb8,null))[_0xca9f('0x14')](saveUpdates(_0x1f82c2[_0xca9f('0x6e')],null))['then'](respondWithResult(_0x192bb8,null))[_0xca9f('0x67')](handleError(_0x192bb8,null));};exports['addCustomerAvatar']=function(_0x1ff090,_0x5902b6){_0x1ff090[_0xca9f('0x6e')][_0xca9f('0x89')]=_0x1ff090[_0xca9f('0x88')][_0xca9f('0x86')];return db[_0xca9f('0x51')][_0xca9f('0x6c')]({'where':{'id':_0x1ff090['params']['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x5902b6,null))[_0xca9f('0x14')](saveUpdates(_0x1ff090[_0xca9f('0x6e')],null))['then'](respondWithResult(_0x5902b6,null))[_0xca9f('0x67')](handleError(_0x5902b6,null));};exports['addSystemAvatar']=function(_0x1b87c8,_0x396b04){_0x1b87c8[_0xca9f('0x6e')][_0xca9f('0x8a')]=_0x1b87c8['file'][_0xca9f('0x86')];return db[_0xca9f('0x51')][_0xca9f('0x6c')]({'where':{'id':_0x1b87c8[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x396b04,null))[_0xca9f('0x14')](saveUpdates(_0x1b87c8[_0xca9f('0x6e')],null))[_0xca9f('0x14')](respondWithResult(_0x396b04,null))[_0xca9f('0x67')](handleError(_0x396b04,null));};exports[_0xca9f('0x8b')]=function(_0x8ea22f,_0x365a8a){var _0x223732=path[_0xca9f('0x8c')](config[_0xca9f('0x8d')],_0xca9f('0x8e'));var _0x4c7625={'where':{'id':_0x8ea22f['params']['id']},'attributes':['id',_0xca9f('0x85')],'raw':!![]};var _0x4622c6=![];return require(_0xca9f('0x8f'))[_0xca9f('0x90')]()[_0xca9f('0x14')](function(_0x32c2a8){if(_0x32c2a8){_0x4622c6=_0x32c2a8[_0xca9f('0x91')];}})[_0xca9f('0x14')](function(){return db[_0xca9f('0x51')]['find'](_0x4c7625);})[_0xca9f('0x14')](handleEntityNotFound(_0x365a8a,null))[_0xca9f('0x14')](function(_0x4e9574){if(_0x4e9574){if(!_[_0xca9f('0x92')](_0x4e9574['sitepic'])){if(fs[_0xca9f('0x93')](path[_0xca9f('0x8c')](config[_0xca9f('0x8d')],_0xca9f('0x94'),_0x4e9574['sitepic']))&&_0x4622c6){_0x223732=path[_0xca9f('0x8c')](config[_0xca9f('0x8d')],_0xca9f('0x94'),_0x4e9574[_0xca9f('0x85')]);}}return _0x365a8a[_0xca9f('0x95')](_0x223732);}})['catch'](handleError(_0x365a8a,null));};exports['getAvatar']=function(_0x3dec24,_0xe232e5){var _0x29df49=path[_0xca9f('0x8c')](config[_0xca9f('0x8d')],_0xca9f('0x96'));var _0x97a0f5={'where':{'id':_0x3dec24[_0xca9f('0x69')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xca9f('0x51')][_0xca9f('0x6c')](_0x97a0f5)['then'](handleEntityNotFound(_0xe232e5,null))[_0xca9f('0x14')](function(_0x462254){if(_0x462254){if(!_[_0xca9f('0x92')](_0x462254['agentAvatar'])){if(fs['existsSync'](path[_0xca9f('0x8c')](config[_0xca9f('0x8d')],'server/files/images/avatars/',_0x462254[_0xca9f('0x87')]))){_0x29df49=path['join'](config[_0xca9f('0x8d')],_0xca9f('0x97'),_0x462254[_0xca9f('0x87')]);}}return _0xe232e5['download'](_0x29df49);}})[_0xca9f('0x67')](handleError(_0xe232e5,null));};exports[_0xca9f('0x98')]=function(_0x948c25,_0x57e916){var _0x4545cc=path[_0xca9f('0x8c')](config[_0xca9f('0x8d')],'server/files/images/avatars/customer_avatar.png');var _0x4a3d38={'where':{'id':_0x948c25[_0xca9f('0x69')]['id']},'attributes':['id',_0xca9f('0x89'),_0xca9f('0x99')],'raw':!![]};return db[_0xca9f('0x51')][_0xca9f('0x6c')](_0x4a3d38)[_0xca9f('0x14')](handleEntityNotFound(_0x57e916,null))[_0xca9f('0x14')](function(_0xdd77d5){if(_0xdd77d5){if(!_[_0xca9f('0x92')](_0xdd77d5[_0xca9f('0x89')])){if(fs[_0xca9f('0x93')](path[_0xca9f('0x8c')](config['root'],_0xca9f('0x97'),_0xdd77d5[_0xca9f('0x89')]))&&_0xdd77d5['showCustomerAvatar']){_0x4545cc=path[_0xca9f('0x8c')](config['root'],'server/files/images/avatars/',_0xdd77d5[_0xca9f('0x89')]);}}return _0x57e916[_0xca9f('0x95')](_0x4545cc);}})[_0xca9f('0x67')](handleError(_0x57e916,null));};exports['getSystemAvatar']=function(_0x295479,_0xb8fc0e){var _0x502a19=path[_0xca9f('0x8c')](config[_0xca9f('0x8d')],'server/files/images/avatars/system_avatar.png');var _0x354695={'where':{'id':_0x295479[_0xca9f('0x69')]['id']},'attributes':['id',_0xca9f('0x8a')],'raw':!![]};return db['ChatWebsite']['find'](_0x354695)[_0xca9f('0x14')](handleEntityNotFound(_0xb8fc0e,null))[_0xca9f('0x14')](function(_0x3bee67){if(_0x3bee67){if(!_[_0xca9f('0x92')](_0x3bee67[_0xca9f('0x8a')])){if(fs[_0xca9f('0x93')](path['join'](config[_0xca9f('0x8d')],_0xca9f('0x97'),_0x3bee67[_0xca9f('0x8a')]))){_0x502a19=path[_0xca9f('0x8c')](config['root'],_0xca9f('0x97'),_0x3bee67[_0xca9f('0x8a')]);}}return _0xb8fc0e[_0xca9f('0x95')](_0x502a19);}})[_0xca9f('0x67')](handleError(_0xb8fc0e,null));};exports[_0xca9f('0x9a')]=function(_0x2c2686,_0x409bf0){var _0x2ca6f2={'body':_0x2c2686[_0xca9f('0x6e')],'channel':_0xca9f('0x9b')};var _0x2771be=[];var _0x36097d=[];var _0x331e75={};var _0x122302=![];return db[_0xca9f('0x9c')][_0xca9f('0x76')]()[_0xca9f('0x14')](function(_0x5a309c){if(!_0x5a309c){throw new db['Sequelize'][(_0xca9f('0x9d'))](_0xca9f('0x9e'));}_0x2771be=_[_0xca9f('0x9f')](_['keys'](_0x5a309c),[_0xca9f('0xa0'),'updatedAt']);_0x36097d=_['difference'](_[_0xca9f('0x56')](_0x5a309c),[_0xca9f('0xa0'),'updatedAt','CompanyId',_0xca9f('0xa1')]);if(_0x2c2686[_0xca9f('0x6e')]['id']){delete _0x2c2686['body']['id'];}if(_[_0xca9f('0x92')](_0x2c2686['body']['from'])){throw new db[(_0xca9f('0xa2'))][(_0xca9f('0x9d'))](_0xca9f('0xa3'));}if(_[_0xca9f('0x92')](_0x2c2686[_0xca9f('0x6e')][_0xca9f('0x6e')])||_0x2c2686['body'][_0xca9f('0x6e')]===''){throw new db[(_0xca9f('0xa2'))][(_0xca9f('0x9d'))](_0xca9f('0xa4'));}if(_[_0xca9f('0x92')](_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xa5')])){throw new db[(_0xca9f('0xa2'))][(_0xca9f('0x9d'))](_0xca9f('0xa6')+_0x36097d);}if(!_[_0xca9f('0xa7')](_0x36097d,_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xa5')])){throw new db[(_0xca9f('0xa2'))][(_0xca9f('0x9d'))](_0xca9f('0xa8')+_0x36097d);}_0x331e75[_0x2c2686['body'][_0xca9f('0xa5')]]=_0x2c2686[_0xca9f('0x6e')]['from'];})[_0xca9f('0x14')](function(){return db[_0xca9f('0x51')][_0xca9f('0x6c')]({'where':{'id':_0x2c2686[_0xca9f('0x69')]['id']},'include':[{'model':db[_0xca9f('0xa9')],'as':_0xca9f('0xaa'),'include':[{'model':db[_0xca9f('0x9c')],'as':_0xca9f('0xab'),'where':_0x331e75,'limit':0x1,'order':[['updatedAt',_0xca9f('0xac')]]}]},{'model':db['ChatApplication'],'as':_0xca9f('0xad')},{'model':db[_0xca9f('0x38')],'as':_0xca9f('0x38'),'include':[{'model':db[_0xca9f('0x38')],'as':_0xca9f('0x39'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0xca9f('0x14')](function(_0x5d9417){if(!_0x5d9417)throw new APINotFoundError(util[_0xca9f('0x2f')](_0xca9f('0xae'),_0x2c2686[_0xca9f('0x69')]['id']));if(!_0x5d9417['Interval']||!_0x5d9417[_0xca9f('0x38')][_0xca9f('0x39')])return[_0x5d9417,!![]];return[_0x5d9417,checkWebsiteIntervals(_0x5d9417)];})[_0xca9f('0xaf')](function(_0x3fccad,_0x5c8bd2){if(!_0x5c8bd2)throw new APIOutOfIntervalError();if(!_0x3fccad['List'])return;_0x2ca6f2['account']=_0x3fccad;_0x2ca6f2[_0xca9f('0xb0')]=_0x3fccad[_0xca9f('0xaa')];_0x2ca6f2['applications']=_['orderBy'](_0x3fccad[_0xca9f('0xad')],[_0xca9f('0xb1')],[_0xca9f('0xb2')]);if(_0x2ca6f2[_0xca9f('0xb3')][_0xca9f('0xad')]){delete _0x2ca6f2[_0xca9f('0xb3')][_0xca9f('0xad')];}if(_0x2ca6f2[_0xca9f('0xb3')][_0xca9f('0xaa')]&&_0x2ca6f2[_0xca9f('0xb3')]['List'][_0xca9f('0xab')][_0xca9f('0x5b')]){return _0x2ca6f2[_0xca9f('0xb3')][_0xca9f('0xaa')][_0xca9f('0xab')][0x0];}var _0x3614b4=_[_0xca9f('0xf')](_0x2c2686[_0xca9f('0x6e')],{'firstName':_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xb4')],'ListId':_0x3fccad['ListId']});_0x3614b4[_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xa5')]]=_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xb4')];return db['CmContact'][_0xca9f('0x6d')](_0x3614b4,{'fields':_0x2771be,'raw':!![]});})[_0xca9f('0x14')](function(_0x55398d){_0x2ca6f2[_0xca9f('0xb5')]=_0x55398d;var _0x1281e8=createInteractionObject(_0x2c2686['params']['id'],_0x2c2686['body'],_0x2c2686[_0xca9f('0xb6')],_0x55398d);var _0x159000={'ChatWebsiteId':_0x2c2686['params']['id'],'closed':![]};if(_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xb7')]){_0x159000[_0xca9f('0xb7')]=_0x2c2686[_0xca9f('0x6e')]['threadId'];return db[_0xca9f('0xb8')]['find']({'where':_0x159000})[_0xca9f('0x14')](function(_0x24c69f){if(_0x24c69f){_0x122302=!![];return _0x24c69f;}_0x1281e8[_0xca9f('0xb7')]=_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xb7')];_0x1281e8['externalUrl']=_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xb9')];return db[_0xca9f('0xb8')]['create'](_0x1281e8);});}_0x159000['ContactId']=_0x55398d['id'];if(_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xba')]&&_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xba')]['id']){_0x159000['id']=_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xba')]['id'];return db[_0xca9f('0xb8')][_0xca9f('0x6c')]({'where':_0x159000})[_0xca9f('0x14')](function(_0x4f4dff){if(_0x4f4dff){_0x122302=!![];return _0x4f4dff;}return db[_0xca9f('0xb8')][_0xca9f('0x6d')](_0x1281e8);});}return db[_0xca9f('0xb8')][_0xca9f('0x6d')](_0x1281e8);})[_0xca9f('0x14')](function(_0x2508ab){if(!_0x122302)return _0x2508ab;var _0x4d6985={'from':(_0x2ca6f2['contact'][_0xca9f('0x45')]||'')+'\x20'+(_0x2ca6f2[_0xca9f('0xb5')][_0xca9f('0xbb')]||'')};if(_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xb7')]&&_0x2c2686['body'][_0xca9f('0xbc')]&&_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xb7')]!=_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xbc')]){_0x4d6985['threadId']=_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xbc')];}return _0x2508ab[_0xca9f('0x24')](_0x4d6985);})[_0xca9f('0x14')](function(_0x30bba9){_0x2ca6f2['interaction']=_0x30bba9[_0xca9f('0x3a')]({'plain':!![]});_0x2ca6f2[_0xca9f('0xba')][_0xca9f('0xbd')]=!_0x122302;if(_0x2ca6f2[_0xca9f('0xba')]['created']){if(_0x2ca6f2[_0xca9f('0xb3')]['autoclose']){_0x2ca6f2['applications'][_0xca9f('0xbe')]({'id':0x0,'priority':_0x2ca6f2[_0xca9f('0xbf')]['length']+0x1,'app':_0xca9f('0xc0'),'appdata':'unmanaged','interval':_0xca9f('0xc1')});}}return db[_0xca9f('0xc2')]['create']({'body':_0x2c2686[_0xca9f('0x6e')][_0xca9f('0x6e')],'ChatWebsiteId':_0x2c2686['params']['id'],'ChatInteractionId':_0x30bba9['id'],'direction':'in','ContactId':_0x2ca6f2[_0xca9f('0xb5')]['id'],'AttachmentId':_0x2c2686[_0xca9f('0x6e')]['AttachmentId']});})[_0xca9f('0x14')](function(_0x47325b){_0x2ca6f2[_0xca9f('0x1c')]=_0x47325b;if(!_0x2ca6f2[_0xca9f('0xba')][_0xca9f('0xc3')]){return;}return db[_0xca9f('0xc4')][_0xca9f('0x6c')]({'attributes':['id',_0xca9f('0x2b')],'where':{'id':_0x2ca6f2[_0xca9f('0xba')][_0xca9f('0xc3')]}});})[_0xca9f('0x14')](function(_0x40e632){if(_0x40e632){_0x2ca6f2['applications'][_0xca9f('0xc5')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x40e632['name']+','+(_0x2ca6f2[_0xca9f('0xb3')]['waitForTheAssignedAgent']||0xa),'interval':_0xca9f('0xc1')});_0x2ca6f2[_0xca9f('0xc6')]=!![];}if(!_0x2ca6f2[_0xca9f('0xba')][_0xca9f('0xc7')]){return;}return db[_0xca9f('0xc8')][_0xca9f('0x6c')]({'attributes':['id',_0xca9f('0x2b')],'where':{'id':_0x2ca6f2[_0xca9f('0xba')][_0xca9f('0xc7')]}});})[_0xca9f('0x14')](function(_0x59ca2f){if(_0x59ca2f){_0x2ca6f2[_0xca9f('0xbf')][_0xca9f('0xc5')]({'id':0x0,'priority':0x1,'app':_0xca9f('0xc9'),'appdata':_0x59ca2f['name']+','+(_0x2ca6f2['account'][_0xca9f('0xca')]||0x12c),'interval':_0xca9f('0xc1')});}return respondWithRpcPromise(_0xca9f('0xcb'),'startRouting',_0x2ca6f2);})[_0xca9f('0x14')](function(_0x2bf376){respondWithRpcPromise(_0xca9f('0xcc'),_0xca9f('0xcc'),{'event':_0xca9f('0x9a'),'message':_0x2bf376},client9002);return _0x2bf376;})[_0xca9f('0x14')](respondWithResult(_0x409bf0,null))['catch'](APIHandleError(_0x409bf0));};exports['offline']=function(_0x3aedda,_0x39c187){var _0x441705,_0x2c59c3,_0x335695;var _0x417c7e=[];var _0x35d6b6={};var _0x5ac80a=_0x3aedda['files']||[];var _0x3f3570=[];var _0x549fa0;return db[_0xca9f('0x9c')][_0xca9f('0x76')]()[_0xca9f('0x14')](function(_0x96099c){if(!_0x96099c){throw new db[(_0xca9f('0xa2'))][(_0xca9f('0x9d'))]('no\x20available\x20attributes');}_0x417c7e=_[_0xca9f('0x9f')](_['keys'](_0x96099c),['createdAt',_0xca9f('0xcd'),'CompanyId',_0xca9f('0xa1')]);if(_0x3aedda[_0xca9f('0x6e')]['id']){delete _0x3aedda[_0xca9f('0x6e')]['id'];}if(_[_0xca9f('0x92')](_0x3aedda[_0xca9f('0x6e')][_0xca9f('0xb4')])){throw _0x39c187[_0xca9f('0x1e')](0x1f4)[_0xca9f('0x2c')](new db['Sequelize'][(_0xca9f('0x9d'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x3aedda[_0xca9f('0x6e')][_0xca9f('0x6e')])||_0x3aedda[_0xca9f('0x6e')]['body']===''){throw _0x39c187[_0xca9f('0x1e')](0x1f4)['send'](new db[(_0xca9f('0xa2'))][(_0xca9f('0x9d'))](_0xca9f('0xa4')));}if(_[_0xca9f('0x92')](_0x3aedda[_0xca9f('0x6e')][_0xca9f('0xce')])){throw _0x39c187[_0xca9f('0x1e')](0x1f4)[_0xca9f('0x2c')](new db[(_0xca9f('0xa2'))][(_0xca9f('0x9d'))](_0xca9f('0xcf')+_0x417c7e));}if(!_[_0xca9f('0xa7')](_0x417c7e,_0x3aedda['body'][_0xca9f('0xce')])){throw _0x39c187[_0xca9f('0x1e')](0x1f4)[_0xca9f('0x2c')](new db[(_0xca9f('0xa2'))]['ValidationError'](_0xca9f('0xd0')+_0x417c7e));}_0x35d6b6[_0x3aedda[_0xca9f('0x6e')][_0xca9f('0xce')]]=_0x3aedda[_0xca9f('0x6e')][_0xca9f('0xb4')];})[_0xca9f('0x14')](function(){return db['ChatWebsite'][_0xca9f('0x6c')]({'where':{'id':_0x3aedda[_0xca9f('0x69')]['id']},'include':[{'model':db['CmList'],'as':_0xca9f('0xaa')},{'model':db[_0xca9f('0xd1')],'as':_0xca9f('0xd1')}]});})[_0xca9f('0x14')](handleEntityNotFound(_0x39c187,null))[_0xca9f('0x14')](function(_0x4465cf){if(_0x4465cf&&_0x4465cf[_0xca9f('0xaa')]){_0x2c59c3=_0x4465cf;var _0x41d485=_['defaults'](_0x3aedda[_0xca9f('0x6e')],{'firstName':_0x3aedda[_0xca9f('0x6e')][_0xca9f('0xb4')],'phone':_0x3aedda[_0xca9f('0x6e')][_0xca9f('0xb4')],'ListId':_0x4465cf['ListId']});_0x41d485[_0x3aedda[_0xca9f('0x6e')][_0xca9f('0xce')]]=_0x3aedda['body'][_0xca9f('0xb4')];return db[_0xca9f('0x9c')][_0xca9f('0xd2')]({'where':_0x35d6b6,'defaults':_0x41d485});}})[_0xca9f('0xaf')](function(_0x32cae8){if(_0x32cae8){_0x335695=_0x32cae8;var _0x1a88c5=fs[_0xca9f('0xd3')](path[_0xca9f('0x8c')](config['root'],_0xca9f('0xd4')),'utf8');var _0x5c4e5c=ejs['render'](_0x1a88c5,{'body':_[_0xca9f('0xd5')](_0x3aedda[_0xca9f('0x6e')][_0xca9f('0x6e')]),'bodyTitle':_0x2c59c3[_0xca9f('0xd6')]});return db[_0xca9f('0xd7')]['create']({'body':_0x5c4e5c,'plainBody':htmlToText[_0xca9f('0xd8')](_0x5c4e5c),'ContactId':_0x32cae8['id'],'ChatWebsiteId':_0x2c59c3['id']});}})[_0xca9f('0x14')](function(_0xe923a4){_0x549fa0=_0xe923a4;if(_0x5ac80a['length']){var _0x29b84b=_0x5ac80a[_0xca9f('0x37')](function(_0x314bdf){return{'name':_0x314bdf[_0xca9f('0xd9')],'basename':_0x314bdf['filename'],'type':_0x314bdf['mimetype'],'ChatOfflineMessageId':_0xe923a4['id']};});_0x3f3570=_0x29b84b[_0xca9f('0x37')](_0x4497a4=>{var _0x362568={'filename':_0x4497a4[_0xca9f('0x2b')],'path':path[_0xca9f('0x8c')](config[_0xca9f('0x8d')],_0xca9f('0xda'),_0xca9f('0xdb'),_0xca9f('0xdc'),_0xca9f('0xdd'),_0x4497a4[_0xca9f('0xde')])};return _0x362568;});if(!_0x2c59c3[_0xca9f('0xdf')]){return db[_0xca9f('0xe0')][_0xca9f('0xe1')](function(_0x258d77){return db[_0xca9f('0xe2')][_0xca9f('0xe3')](_0x29b84b,{'transaction':_0x258d77});});}}})[_0xca9f('0x14')](function(){if(_0x549fa0){_0x441705=_0x549fa0;return db[_0xca9f('0xd1')][_0xca9f('0x82')]({'where':{'service':!![]},'include':[{'model':db[_0xca9f('0xe4')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xca9f('0xe5'),'raw':!![]}]}]});}})[_0xca9f('0x14')](function(_0x1b5ddd){if(_0x1b5ddd&&_0x1b5ddd[_0xca9f('0xe6')]&&_0x2c59c3[_0xca9f('0xe7')]&&_0x2c59c3[_0xca9f('0xe8')]){var _0x5d22e5=_0x1b5ddd['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0xca9f('0xe9'),{'account':_0x5d22e5,'message':{'from':util[_0xca9f('0x2f')](_0xca9f('0xea'),_0x1b5ddd[_0xca9f('0x2b')],_0x1b5ddd['email']||_0x1b5ddd[_0xca9f('0xe6')][_0xca9f('0x70')]),'to':_0x2c59c3['forwardOfflineAddress'],'subject':_0x2c59c3['offlineMessageSubject'],'html':_0x441705[_0xca9f('0x6e')],'attachments':_0x3f3570}},client9003)[_0xca9f('0x14')](function(){return _0x441705;})[_0xca9f('0x67')](function(_0x1e5d1c){logger['error'](_0x1e5d1c);});}})[_0xca9f('0x14')](function(){if(_0x2c59c3&&_0x2c59c3['openNewInteraction']&&_0x2c59c3[_0xca9f('0xeb')]){var _0x328974=[];if(_0x5ac80a[_0xca9f('0x5b')]){_0x328974=_0x5ac80a['map'](function(_0x223d1a){return{'name':_0x223d1a[_0xca9f('0xd9')],'basename':_0x223d1a[_0xca9f('0x86')],'type':_0x223d1a['mimetype'],'ChatOfflineMessageId':_0x549fa0['id']};});}var _0x2d6d3f;if(!_['isNil'](_0x2c59c3[_0xca9f('0xec')])){var _0x2cd013=_[_0xca9f('0x37')](_0x3aedda['body'],function(_0x365ab3){return _0x365ab3;});var _0x1704c3=_[_0xca9f('0xed')](_0x2cd013)[0x0];var _0x10a35a=_[_0xca9f('0xee')](_0x1704c3,function(_0x2364ce){return _0x2364ce;});_0x2d6d3f=_0x10a35a[0x1][_0x2c59c3[_0xca9f('0xec')]];}var _0x484c24={'from':_0x335695[_0xca9f('0xef')],'firstName':_0x335695[_0xca9f('0x45')],'lastName':_0x335695[_0xca9f('0xbb')],'mapKey':'email','message':{'from':_0x335695[_0xca9f('0xef')],'to':_0x2c59c3[_0xca9f('0xd1')][_0xca9f('0xef')],'cc':'','subject':_['isNil'](_0x2d6d3f)?_0x2c59c3[_0xca9f('0xf0')]:_0x2d6d3f,'messageId':'','sentAt':new Date(),'attach':_0x328974[_0xca9f('0x5b')],'attachments':_0x328974,'originChannel':_0xca9f('0xf1'),'ChatWebsiteId':_0x2c59c3['id'],'ChatOfflineMessageId':_0x441705['id'],'originTo':_0x2c59c3[_0xca9f('0xd1')][_0xca9f('0xef')]},'body':_0x441705[_0xca9f('0x6e')]};var _0xc503d7={'account':{'id':_0x2c59c3[_0xca9f('0xeb')]},'body':_0x484c24,'log':_0xca9f('0xf2')};return respondWithRpcPromise(_0xca9f('0xf2'),_0xca9f('0xf3'),_0xc503d7,client9001)[_0xca9f('0x14')](function(){return _0x441705;})[_0xca9f('0x67')](function(_0xf69cb){logger[_0xca9f('0x1b')](_0xf69cb);});}return;})[_0xca9f('0x14')](function(){if(_0x441705){return _0x441705;}})['then'](respondWithResult(_0x39c187,null))['catch'](function(){for(var _0x4c30d9 of _0x5ac80a){var _0x4f9f2f=path['join'](config[_0xca9f('0x8d')],'server',_0xca9f('0xdb'),_0xca9f('0xdc'),_0xca9f('0xdd'),_0x4c30d9[_0xca9f('0x86')]);fs_extra[_0xca9f('0xf4')](_0x4f9f2f)[_0xca9f('0x67')](function(_0x51cb72){logger[_0xca9f('0x1b')](_0xca9f('0xf5'),_0x4f9f2f,_0x51cb72);});}});};exports[_0xca9f('0xf6')]=function(_0xb3ba93,_0xfe02eb){return db[_0xca9f('0xb8')][_0xca9f('0x6c')]({'where':{'id':_0xb3ba93[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0xfe02eb,null))['then'](function(_0x18c699){if(_0x18c699){return _0x18c699[_0xca9f('0xf6')](_0xb3ba93[_0xca9f('0x6e')]['ids'],_['omit'](_0xb3ba93[_0xca9f('0x6e')],['ids','id'])||{});}})[_0xca9f('0x14')](respondWithResult(_0xfe02eb,null))['catch'](handleError(_0xfe02eb,null));};exports['getInteractions']=function(_0x240547,_0x20d914){var _0x44734d={'raw':![],'where':{}};var _0x5708b2={};var _0x38d93d={'count':0x0,'rows':[]};return db[_0xca9f('0x51')][_0xca9f('0x82')]({'where':{'id':_0x240547[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x20d914,null))[_0xca9f('0x14')](function(_0x182397){if(_0x182397){_0x5708b2['model']=_[_0xca9f('0x56')](db[_0xca9f('0xb8')]['rawAttributes']);_0x5708b2[_0xca9f('0x55')]=_[_0xca9f('0x56')](_0x240547[_0xca9f('0x55')]);_0x5708b2[_0xca9f('0x57')]=_['intersection'](_0x5708b2['model'],_0x5708b2[_0xca9f('0x55')]);_0x44734d[_0xca9f('0x59')]=_[_0xca9f('0x58')](_0x5708b2[_0xca9f('0x4d')],qs[_0xca9f('0x5a')](_0x240547['query'][_0xca9f('0x5a')]));_0x44734d['attributes']=_0x44734d[_0xca9f('0x59')][_0xca9f('0x5b')]?_0x44734d[_0xca9f('0x59')]:_0x5708b2[_0xca9f('0x4d')];if(!_0x240547[_0xca9f('0x55')][_0xca9f('0x5c')](_0xca9f('0x5d'))){_0x44734d[_0xca9f('0x21')]=qs['limit'](_0x240547[_0xca9f('0x55')]['limit']);_0x44734d[_0xca9f('0x23')]=qs[_0xca9f('0x23')](_0x240547[_0xca9f('0x55')]['offset']);}_0x44734d[_0xca9f('0x5e')]=qs[_0xca9f('0x5f')](_0x240547['query'][_0xca9f('0x5f')]);_0x44734d['where']=qs[_0xca9f('0x57')](_[_0xca9f('0x61')](_0x240547['query'],_0x5708b2[_0xca9f('0x57')]));_0x44734d[_0xca9f('0x60')][_0xca9f('0x7a')]=_0x182397['id'];if(_0x240547['query'][_0xca9f('0x62')]){_0x44734d[_0xca9f('0x60')]=_[_0xca9f('0x64')](_0x44734d[_0xca9f('0x60')],{'$or':_[_0xca9f('0x37')](_0x44734d[_0xca9f('0x59')],function(_0x3eefbc){var _0x51723d={};_0x51723d[_0x3eefbc]={'$like':'%'+_0x240547[_0xca9f('0x55')][_0xca9f('0x62')]+'%'};return _0x51723d;})});}_0x44734d=_[_0xca9f('0x64')]({},_0x44734d,_0x240547['options']);return db[_0xca9f('0xb8')][_0xca9f('0x22')]({'where':_0x44734d[_0xca9f('0x60')]})[_0xca9f('0x14')](function(_0x403185){_0x38d93d['count']=_0x403185;if(_0x240547['query']['includeAll']){_0x44734d[_0xca9f('0x7b')]=[{'model':db[_0xca9f('0x9c')],'as':_0xca9f('0xf7'),'required':![]},{'model':db[_0xca9f('0xc4')],'as':_0xca9f('0xf8'),'attributes':[_0xca9f('0x2b'),'fullname',_0xca9f('0xf9')],'required':![]},{'model':db[_0xca9f('0xfa')],'as':_0xca9f('0xfb'),'attributes':['id',_0xca9f('0x2b'),'color'],'where':_0x240547[_0xca9f('0x55')][_0xca9f('0xfc')]?{'id':_0x240547['query'][_0xca9f('0xfc')]}:undefined,'required':_0x240547[_0xca9f('0x55')][_0xca9f('0xfc')]?!![]:![]}];}return db[_0xca9f('0xb8')][_0xca9f('0x7c')](_0x44734d);})[_0xca9f('0x14')](function(_0x17833c){_0x38d93d[_0xca9f('0x66')]=_0x17833c;return _0x38d93d;});}})[_0xca9f('0x14')](respondWithFilteredResult(_0x20d914,_0x44734d))[_0xca9f('0x67')](handleError(_0x20d914,null));};exports[_0xca9f('0x2d')]=function(_0x25ec4c,_0x29e558){var _0x392438=0x0;var _0x2af499=0x0;var _0x110e57=![];var _0x5ca130;var _0x3d79db;return db[_0xca9f('0x51')][_0xca9f('0x6c')]({'where':{'id':_0x25ec4c['params']['id']},'include':[{'model':db['Interval'],'as':_0xca9f('0x38'),'include':[{'model':db[_0xca9f('0x38')],'as':_0xca9f('0x39'),'attributes':['id',_0xca9f('0x31')]}]}]})[_0xca9f('0x14')](handleEntityNotFound(_0x29e558,null))[_0xca9f('0x14')](function(_0x1df8d5){if(_0x1df8d5){_0x5ca130=_0x1df8d5;return _0x1df8d5[_0xca9f('0xfd')]({'raw':!![]});}})['then'](function(_0x12364e){if(_0x5ca130){if(_0x12364e){_0x3d79db=_0x12364e;}}return require(_0xca9f('0x8f'))[_0xca9f('0x90')]();})['then'](function(_0x5a6b3e){if(_0x5a6b3e){_0x2af499=_0x5a6b3e[_0xca9f('0xfe')];_0x110e57=_0x5a6b3e['custom'];}})['then'](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0xca9f('0x14')](function(_0x146b17){_0x392438=_0x146b17;if(_0x2af499&&_0x146b17>_0x2af499){return db[_0xca9f('0xff')][_0xca9f('0x82')]({'where':{'id':0x1}})[_0xca9f('0x14')](function(_0xdf0d8e){if(_0xdf0d8e){_0xdf0d8e[_0xca9f('0x100')]('chatLicenseExceeded');}});}})['then'](function(){if(!_0x5ca130[_0xca9f('0x38')]||!_0x5ca130[_0xca9f('0x38')][_0xca9f('0x39')])return!![];return checkWebsiteIntervals(_0x5ca130);})[_0xca9f('0x14')](function(_0x3584c3){var _0x236cf2=fs[_0xca9f('0xd3')](path[_0xca9f('0x8c')](config[_0xca9f('0x8d')],'server/files/chat/iframe.ejs'),_0xca9f('0x101'));var _0x2b24fd=new url['URL'](_0x5ca130['address'])[_0xca9f('0x102')];var _0x2014d3=_0xca9f('0x103');var _0x28f85a=![];var _0x26da36={'chatVersion':_0x2014d3,'chatWebsiteAddressOrigin':_0x2b24fd,'remote':_0x5ca130[_0xca9f('0x104')],'query':querystring[_0xca9f('0x19')](_[_0xca9f('0x64')](_0x5ca130[_0xca9f('0x3a')]({'plain':!![]}),{'customerIp':_0x25ec4c[_0xca9f('0xb6')][_0xca9f('0x42')]||_0x25ec4c[_0xca9f('0xb6')]['x-real-ip']||_0x25ec4c[_0xca9f('0x105')]['remoteAddress']||_0x25ec4c['ip'],'referer':_0x25ec4c[_0xca9f('0xb6')][_0xca9f('0x47')],'openedInteractions':_0x392438,'maxInteractions':_0x2af499,'virtual':_0x110e57[_0xca9f('0xfe')],'online':_0x3584c3,'custom':_0x110e57}))['replace'](/'/g,'\x5c\x27')};_0x29e558[_0xca9f('0x2c')](ejs[_0xca9f('0x106')](Mustache[_0xca9f('0x106')](_0x236cf2,_0x26da36),{'proactiveActions':_0x3d79db,'alignment':_0x5ca130[_0xca9f('0x107')],'verticalAlignment':_0x5ca130[_0xca9f('0x108')],'div_color':_0x5ca130['color'],'labelText':_0x5ca130[_0xca9f('0x109')],'text_color':_0x5ca130[_0xca9f('0x10a')],'text_button_color':_0x5ca130['textButtonColor'],'button_color':_0x5ca130[_0xca9f('0x10b')],'background_color':_0x5ca130[_0xca9f('0x10c')],'hideWhenOffline':_0x5ca130[_0xca9f('0x10d')],'intervalId':_0x5ca130[_0xca9f('0x10e')],'isDevelopment':_0x28f85a,'chatVersion':_0x2014d3}));})['catch'](handleError(_0x29e558,null));};exports['addApplications']=function(_0x1bbd50,_0x31b68e){var _0x171be2=_0x1bbd50[_0xca9f('0x69')]['id'];var _0x8a6f66=_0x1bbd50[_0xca9f('0x6e')];var _0x45735e=0xc8;var _0x4287ad=null;return db[_0xca9f('0xe0')][_0xca9f('0xe1')]({'isolationLevel':db[_0xca9f('0xe0')]['Transaction']['ISOLATION_LEVELS'][_0xca9f('0x10f')]},function(_0x223002){return db[_0xca9f('0x51')][_0xca9f('0x82')]({'where':{'id':_0x171be2},'transaction':_0x223002})[_0xca9f('0x14')](function(_0xc90557){if(_0xc90557){return db[_0xca9f('0x110')]['destroy']({'where':{'ChatWebsiteId':_0x171be2},'transaction':_0x223002})[_0xca9f('0x14')](function(){var _0xac3dd0=_[_0xca9f('0x37')](_0x8a6f66,function(_0x1d4991){_0x1d4991['ChatWebsiteId']=_0x171be2;return _0x1d4991;});return db[_0xca9f('0x110')][_0xca9f('0xe3')](_0xac3dd0,{'transaction':_0x223002});});}else{_0x45735e=0x194;_0x4287ad=[];}});})[_0xca9f('0x14')](function(){if(_0x45735e!==0x194){return db[_0xca9f('0x110')][_0xca9f('0x111')]({'where':{'ChatWebsiteId':_0x171be2},'order':_0xca9f('0xb1')})[_0xca9f('0x14')](function(_0x3752c8){_0x4287ad=_0x3752c8;});}})[_0xca9f('0x67')](function(_0x650705){_0x45735e=0x1f4;logger[_0xca9f('0x1b')](_0x650705[_0xca9f('0x2a')]);if(_0x650705[_0xca9f('0x2b')]){delete _0x650705[_0xca9f('0x2b')];}_0x4287ad=_0x650705;})['finally'](function(){if(_0x4287ad===null){_0x31b68e[_0xca9f('0x29')](_0x45735e);}else{if(_0x45735e===0x1f4){_0x31b68e['status'](_0x45735e)[_0xca9f('0x2c')](_0x4287ad);}else{_0x31b68e['status'](_0x45735e)['json'](_0x4287ad);}}});};exports['getApplications']=function(_0x1f0323,_0x672a97){var _0x2be16e={};var _0x1dcb76={};var _0x2e96cb;var _0x2f55a4;return db[_0xca9f('0x51')]['findOne']({'where':{'id':_0x1f0323['params']['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x672a97,null))[_0xca9f('0x14')](function(_0x739f79){if(_0x739f79){_0x2e96cb=_0x739f79;_0x1dcb76[_0xca9f('0x4d')]=_[_0xca9f('0x56')](db[_0xca9f('0x110')][_0xca9f('0x52')]);_0x1dcb76['query']=_[_0xca9f('0x56')](_0x1f0323['query']);_0x1dcb76['filters']=_[_0xca9f('0x58')](_0x1dcb76['model'],_0x1dcb76[_0xca9f('0x55')]);_0x2be16e[_0xca9f('0x59')]=_['intersection'](_0x1dcb76['model'],qs[_0xca9f('0x5a')](_0x1f0323[_0xca9f('0x55')][_0xca9f('0x5a')]));_0x2be16e[_0xca9f('0x59')]=_0x2be16e[_0xca9f('0x59')][_0xca9f('0x5b')]?_0x2be16e[_0xca9f('0x59')]:_0x1dcb76['model'];_0x2be16e[_0xca9f('0x5e')]=qs[_0xca9f('0x5f')](_0x1f0323[_0xca9f('0x55')][_0xca9f('0x5f')]);_0x2be16e['where']=qs[_0xca9f('0x57')](_['pick'](_0x1f0323[_0xca9f('0x55')],_0x1dcb76[_0xca9f('0x57')]));if(_0x1f0323[_0xca9f('0x55')]['filter']){_0x2be16e['where']=_[_0xca9f('0x64')](_0x2be16e[_0xca9f('0x60')],{'$or':_[_0xca9f('0x37')](_0x2be16e[_0xca9f('0x59')],function(_0x5eedc6){var _0x134eb3={};_0x134eb3[_0x5eedc6]={'$like':'%'+_0x1f0323['query'][_0xca9f('0x62')]+'%'};return _0x134eb3;})});}_0x2be16e=_[_0xca9f('0x64')]({},_0x2be16e,_0x1f0323['options']);return _0x2e96cb[_0xca9f('0x112')](_0x2be16e);}})['then'](function(_0x15574f){if(_0x15574f){_0x2f55a4=_0x15574f[_0xca9f('0x5b')];if(!_0x1f0323[_0xca9f('0x55')][_0xca9f('0x5c')](_0xca9f('0x5d'))){_0x2be16e[_0xca9f('0x21')]=qs['limit'](_0x1f0323['query'][_0xca9f('0x21')]);_0x2be16e['offset']=qs['offset'](_0x1f0323[_0xca9f('0x55')]['offset']);}return _0x2e96cb[_0xca9f('0x112')](_0x2be16e);}})[_0xca9f('0x14')](function(_0xa24131){if(_0xa24131){return _0xa24131?{'count':_0x2f55a4,'rows':_0xa24131}:null;}})['then'](respondWithResult(_0x672a97,null))[_0xca9f('0x67')](handleError(_0x672a97,null));};exports[_0xca9f('0x113')]=function(_0xaec7e9,_0x975f42){return db['chatProactiveAction'][_0xca9f('0x6c')]({'where':{'id':_0xaec7e9[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x975f42,null))[_0xca9f('0x14')](function(_0x5c97cf){if(_0x5c97cf){return _0x5c97cf['addProactiveActions'](_0xaec7e9[_0xca9f('0x6e')][_0xca9f('0x7e')],_[_0xca9f('0x114')](_0xaec7e9[_0xca9f('0x6e')],[_0xca9f('0x7e'),'id'])||{});}})[_0xca9f('0x14')](respondWithResult(_0x975f42,null))['catch'](handleError(_0x975f42,null));};exports['getProactiveActions']=function(_0x57a9d8,_0x1f93b7){var _0x3d1f13={};var _0x22a425={};var _0x2196d5;var _0x42b873;return db['ChatWebsite'][_0xca9f('0x82')]({'where':{'id':_0x57a9d8[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x1f93b7,null))[_0xca9f('0x14')](function(_0xe6d5ef){if(_0xe6d5ef){_0x2196d5=_0xe6d5ef;_0x22a425['model']=_['keys'](db['ChatProactiveAction'][_0xca9f('0x52')]);_0x22a425[_0xca9f('0x55')]=_['keys'](_0x57a9d8['query']);_0x22a425['filters']=_[_0xca9f('0x58')](_0x22a425[_0xca9f('0x4d')],_0x22a425[_0xca9f('0x55')]);_0x3d1f13[_0xca9f('0x59')]=_[_0xca9f('0x58')](_0x22a425[_0xca9f('0x4d')],qs['fields'](_0x57a9d8[_0xca9f('0x55')]['fields']));_0x3d1f13['attributes']=_0x3d1f13[_0xca9f('0x59')][_0xca9f('0x5b')]?_0x3d1f13['attributes']:_0x22a425[_0xca9f('0x4d')];_0x3d1f13[_0xca9f('0x5e')]=qs['sort'](_0x57a9d8['query'][_0xca9f('0x5f')]);_0x3d1f13[_0xca9f('0x60')]=qs[_0xca9f('0x57')](_['pick'](_0x57a9d8[_0xca9f('0x55')],_0x22a425['filters']));if(_0x57a9d8[_0xca9f('0x55')][_0xca9f('0x62')]){_0x3d1f13[_0xca9f('0x60')]=_[_0xca9f('0x64')](_0x3d1f13[_0xca9f('0x60')],{'$or':_[_0xca9f('0x37')](_0x3d1f13[_0xca9f('0x59')],function(_0x173ab0){var _0x5974d2={};_0x5974d2[_0x173ab0]={'$like':'%'+_0x57a9d8['query'][_0xca9f('0x62')]+'%'};return _0x5974d2;})});}_0x3d1f13=_['merge']({},_0x3d1f13,_0x57a9d8[_0xca9f('0x65')]);return _0x2196d5[_0xca9f('0xfd')](_0x3d1f13);}})[_0xca9f('0x14')](function(_0x54c2d1){if(_0x54c2d1){_0x42b873=_0x54c2d1[_0xca9f('0x5b')];if(!_0x57a9d8[_0xca9f('0x55')][_0xca9f('0x5c')](_0xca9f('0x5d'))){_0x3d1f13[_0xca9f('0x21')]=qs['limit'](_0x57a9d8['query'][_0xca9f('0x21')]);_0x3d1f13[_0xca9f('0x23')]=qs[_0xca9f('0x23')](_0x57a9d8[_0xca9f('0x55')][_0xca9f('0x23')]);}return _0x2196d5['getProactiveActions'](_0x3d1f13);}})['then'](function(_0x20e55b){if(_0x20e55b){return _0x20e55b?{'count':_0x42b873,'rows':_0x20e55b}:null;}})[_0xca9f('0x14')](respondWithResult(_0x1f93b7,null))[_0xca9f('0x67')](handleError(_0x1f93b7,null));};exports[_0xca9f('0x115')]=function(_0x3ccc81,_0x2b8637){var _0xd040f7=_0x3ccc81[_0xca9f('0x55')]['online']==='false'?_0xca9f('0x116'):_0xca9f('0x117');return db[_0xca9f('0x51')][_0xca9f('0x6c')]({'attributes':['id',_0xd040f7],'where':{'id':_0x3ccc81[_0xca9f('0x69')]['id']}})['then'](handleEntityNotFound(_0x2b8637,null))[_0xca9f('0x14')](function(_0x1e2d30){if(_0x1e2d30){var _0x2d1860=_0x1e2d30[_0xd040f7];var _0x179bc5=_0x2d1860&&_0x2d1860[_0xca9f('0x118')]?_0x2d1860[_0xca9f('0x118')]:[];_0x2b8637['send']({'fromKey':_['isNil'](_0x2d1860[_0xca9f('0x119')])?undefined:_0x2d1860[_0xca9f('0x119')],'count':_0x179bc5[_0xca9f('0x5b')],'rows':_0x179bc5});}})[_0xca9f('0x67')](handleError(_0x2b8637,null));};exports[_0xca9f('0x11a')]=function(_0x512bfe,_0x3d0759){var _0xb48531={'raw':![],'where':{}};var _0x5fa57a={};var _0x4845ae={'count':0x0,'rows':[]};return db[_0xca9f('0x51')][_0xca9f('0x82')]({'where':{'id':_0x512bfe[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x3d0759,null))[_0xca9f('0x14')](function(_0x9fb9e2){if(_0x9fb9e2){_0x5fa57a[_0xca9f('0x4d')]=_[_0xca9f('0x56')](db[_0xca9f('0xd7')]['rawAttributes']);_0x5fa57a['query']=_[_0xca9f('0x56')](_0x512bfe['query']);_0x5fa57a['filters']=_[_0xca9f('0x58')](_0x5fa57a[_0xca9f('0x4d')],_0x5fa57a['query']);_0xb48531[_0xca9f('0x59')]=_['intersection'](_0x5fa57a[_0xca9f('0x4d')],qs[_0xca9f('0x5a')](_0x512bfe['query'][_0xca9f('0x5a')]));_0xb48531[_0xca9f('0x59')]=_0xb48531[_0xca9f('0x59')][_0xca9f('0x5b')]?_0xb48531[_0xca9f('0x59')]:_0x5fa57a[_0xca9f('0x4d')];if(!_0x512bfe['query']['hasOwnProperty']('nolimit')){_0xb48531[_0xca9f('0x21')]=qs['limit'](_0x512bfe[_0xca9f('0x55')][_0xca9f('0x21')]);_0xb48531[_0xca9f('0x23')]=qs['offset'](_0x512bfe[_0xca9f('0x55')]['offset']);}_0xb48531[_0xca9f('0x5e')]=qs[_0xca9f('0x5f')](_0x512bfe[_0xca9f('0x55')][_0xca9f('0x5f')]);_0xb48531['where']=qs[_0xca9f('0x57')](_[_0xca9f('0x61')](_0x512bfe[_0xca9f('0x55')],_0x5fa57a['filters']));_0xb48531[_0xca9f('0x60')][_0xca9f('0x7a')]=_0x9fb9e2['id'];if(_0x512bfe[_0xca9f('0x55')]['filter']){_0xb48531[_0xca9f('0x60')]=_[_0xca9f('0x64')](_0xb48531[_0xca9f('0x60')],{'$or':_['map'](_0xb48531[_0xca9f('0x59')],function(_0x33472e){var _0x25cbaf={};_0x25cbaf[_0x33472e]={'$like':'%'+_0x512bfe[_0xca9f('0x55')][_0xca9f('0x62')]+'%'};return _0x25cbaf;})});}_0xb48531=_[_0xca9f('0x64')]({},_0xb48531,_0x512bfe['options']);return db[_0xca9f('0xd7')]['count']({'where':_0xb48531[_0xca9f('0x60')]})['then'](function(_0x55b609){_0x4845ae[_0xca9f('0x22')]=_0x55b609;if(_0x512bfe[_0xca9f('0x55')][_0xca9f('0x6b')]){_0xb48531[_0xca9f('0x7b')]=[{'all':!![]}];}else{_0xb48531[_0xca9f('0x7b')]=[{'model':db[_0xca9f('0x9c')],'as':_0xca9f('0xf7'),'required':![]},{'model':db['Attachment'],'as':_0xca9f('0x11b'),'required':![]}];}return db[_0xca9f('0xd7')][_0xca9f('0x7c')](_0xb48531);})['then'](function(_0x53e174){_0x4845ae[_0xca9f('0x66')]=_0x53e174;return _0x4845ae;});}})[_0xca9f('0x14')](respondWithFilteredResult(_0x3d0759,_0xb48531))[_0xca9f('0x67')](handleError(_0x3d0759,null));};exports[_0xca9f('0x11c')]=function(_0x4ccab2,_0x37245b){return db[_0xca9f('0x51')][_0xca9f('0x6c')]({'where':{'id':_0x4ccab2[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x37245b,null))[_0xca9f('0x14')](function(_0x38b006){if(_0x38b006){return _0x38b006[_0xca9f('0x11c')](_0x4ccab2[_0xca9f('0x6e')][_0xca9f('0x7e')],_[_0xca9f('0x114')](_0x4ccab2[_0xca9f('0x6e')],['ids','id'])||{})[_0xca9f('0xaf')](function(_0x461688){for(var _0x13319a=0x0;_0x13319a<_0x4ccab2[_0xca9f('0x6e')][_0xca9f('0x7e')][_0xca9f('0x5b')];_0x13319a+=0x1){socket[_0xca9f('0x11d')](_0xca9f('0x11e'),{'UserId':Number(_0x4ccab2['body'][_0xca9f('0x7e')][_0x13319a]),'ChatWebsiteId':Number(_0x4ccab2[_0xca9f('0x69')]['id'])});}return _0x461688;});}})['then'](respondWithResult(_0x37245b,null))['catch'](handleError(_0x37245b,null));};exports[_0xca9f('0x11f')]=function(_0x1ed2fe,_0x5e1a1d){return db[_0xca9f('0x51')][_0xca9f('0x6c')]({'where':{'id':_0x1ed2fe[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x5e1a1d,null))[_0xca9f('0x14')](function(_0x15b7c6){if(_0x15b7c6){return _0x15b7c6[_0xca9f('0x11f')](_0x1ed2fe['query'][_0xca9f('0x7e')])[_0xca9f('0x14')](function(){if(_['isArray'](_0x1ed2fe[_0xca9f('0x55')][_0xca9f('0x7e')])){for(var _0xd7ead=0x0;_0xd7ead<_0x1ed2fe[_0xca9f('0x55')]['ids'][_0xca9f('0x5b')];_0xd7ead+=0x1){socket[_0xca9f('0x11d')](_0xca9f('0x120'),{'UserId':Number(_0x1ed2fe[_0xca9f('0x55')]['ids'][_0xd7ead]),'ChatWebsiteId':Number(_0x1ed2fe['params']['id'])});}}else{socket['emit'](_0xca9f('0x120'),{'UserId':Number(_0x1ed2fe[_0xca9f('0x55')]['ids']),'ChatWebsiteId':Number(_0x1ed2fe[_0xca9f('0x69')]['id'])});}});}})[_0xca9f('0x14')](respondWithStatusCode(_0x5e1a1d,null))[_0xca9f('0x67')](handleError(_0x5e1a1d,null));};exports[_0xca9f('0x121')]=function(_0x2492a0,_0x4283c3){var _0x1466e0={};var _0x2cf498={};var _0x3f4a3a;var _0xd5c09e;return db[_0xca9f('0x51')][_0xca9f('0x82')]({'where':{'id':_0x2492a0[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x4283c3,null))[_0xca9f('0x14')](function(_0x2cc3e8){if(_0x2cc3e8){_0x3f4a3a=_0x2cc3e8;_0x2cf498['model']=_[_0xca9f('0x56')](db['User'][_0xca9f('0x52')]);_0x2cf498[_0xca9f('0x55')]=_[_0xca9f('0x56')](_0x2492a0[_0xca9f('0x55')]);_0x2cf498[_0xca9f('0x57')]=_['intersection'](_0x2cf498[_0xca9f('0x4d')],_0x2cf498[_0xca9f('0x55')]);_0x1466e0[_0xca9f('0x59')]=_[_0xca9f('0x58')](_0x2cf498[_0xca9f('0x4d')],qs['fields'](_0x2492a0[_0xca9f('0x55')]['fields']));_0x1466e0[_0xca9f('0x59')]=_0x1466e0['attributes'][_0xca9f('0x5b')]?_0x1466e0['attributes']:_0x2cf498[_0xca9f('0x4d')];_0x1466e0['order']=qs[_0xca9f('0x5f')](_0x2492a0[_0xca9f('0x55')]['sort']);_0x1466e0[_0xca9f('0x60')]=qs[_0xca9f('0x57')](_[_0xca9f('0x61')](_0x2492a0['query'],_0x2cf498[_0xca9f('0x57')]));if(_0x2492a0['query'][_0xca9f('0x62')]){_0x1466e0['where']=_[_0xca9f('0x64')](_0x1466e0[_0xca9f('0x60')],{'$or':_[_0xca9f('0x37')](_0x1466e0['attributes'],function(_0x5f1b4d){var _0x534066={};_0x534066[_0x5f1b4d]={'$like':'%'+_0x2492a0[_0xca9f('0x55')][_0xca9f('0x62')]+'%'};return _0x534066;})});}_0x1466e0=_[_0xca9f('0x64')]({},_0x1466e0,_0x2492a0[_0xca9f('0x65')]);return _0x3f4a3a[_0xca9f('0x121')](_0x1466e0);}})[_0xca9f('0x14')](function(_0x5d329a){if(_0x5d329a){_0xd5c09e=_0x5d329a[_0xca9f('0x5b')];if(!_0x2492a0[_0xca9f('0x55')][_0xca9f('0x5c')](_0xca9f('0x5d'))){_0x1466e0['limit']=qs[_0xca9f('0x21')](_0x2492a0['query'][_0xca9f('0x21')]);_0x1466e0[_0xca9f('0x23')]=qs[_0xca9f('0x23')](_0x2492a0[_0xca9f('0x55')][_0xca9f('0x23')]);}return _0x3f4a3a[_0xca9f('0x121')](_0x1466e0);}})[_0xca9f('0x14')](function(_0x29d97d){if(_0x29d97d){return _0x29d97d?{'count':_0xd5c09e,'rows':_0x29d97d}:null;}})['then'](respondWithResult(_0x4283c3,null))['catch'](handleError(_0x4283c3,null));};
\ No newline at end of file
+var _0xf9ae=['merge','options','includeAll','include','rows','params','keys','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','body','Disposition','getDispositions','findOne','nolimit','ChatWebsiteId','findAll','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','addLogo','file','filename','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','sitepic','../../config/license/util','custom','isNil','join','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','showCustomerAvatar','customerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','ChatApplication','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','List','orderBy','Applications','priority','asc','account','ListId','contact','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','applications','push','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','waitForTheAssignedQueue','startRouting','EventManager','notify','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','render','offlineMessageBody','ChatOfflineMessage','originalname','server','offline-chat','basename','openNewInteraction','Attachment','bulkCreate','CloudProvider','Smtp','forwardOffline','getSmtpOptions','SendMail','sendMail','forwardOfflineAddress','subjectOffline','toPairsIn','mapValues','email','offlineMessageSubject','Chat','MailAccountId','NotifyMailAccount','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','order','Owner','internal','Tag','Tags','color','tag','getLicense','virtual','License','chatLicenseExceeded','server/files/chat/iframe.ejs','utf8','URL','address','origin','3.5.0','remote','headers','x-real-ip','remoteAddress','replace','labelText','textColor','textButtonColor','hideWhenOffline','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','finally','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','getProactiveActions','getFields','online','false','onlineForm','items','fromKey','Contact','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','querystring','jayson/promise','url','../../components/parsers/qs','api','../../config/environment','../../errors/api','APIOutOfIntervalError','APINotFoundError','handleError','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','client','http','request','then','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','destroy','get','ChatWebsites','stack','name','send','getSnippet','format','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','info','ONLINE','OFFLINE','timezone','No\x20timezone','Interval','Intervals','all','user-agent-parser','user-agent','getResult','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','unknown','device','%s\x20%s\x20%s','vendor','type','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','intersection','model','attributes','fields','hasOwnProperty','limit','sort','where','pick','filters','filter'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xf9ae,0xc5));var _0xef9a=function(_0x510461,_0x42f9af){_0x510461=_0x510461-0x0;var _0x701009=_0xf9ae[_0x510461];return _0x701009;};'use strict';var Mustache=require(_0xef9a('0x0'));var util=require(_0xef9a('0x1'));var path=require(_0xef9a('0x2'));var ejs=require(_0xef9a('0x3'));var fs=require('fs');var fs_extra=require(_0xef9a('0x4'));var _=require('lodash');var querystring=require(_0xef9a('0x5'));var htmlToText=require('html-to-text');var Redis=require('ioredis');var jayson=require(_0xef9a('0x6'));var url=require(_0xef9a('0x7'));var qs=require(_0xef9a('0x8'));var logger=require('../../config/logger')(_0xef9a('0x9'));var config=require(_0xef9a('0xa'));var APIOutOfIntervalError=require(_0xef9a('0xb'))[_0xef9a('0xc')];var APINotFoundError=require('../../errors/api')[_0xef9a('0xd')];var APIHandleError=require(_0xef9a('0xb'))[_0xef9a('0xe')];var db=require(_0xef9a('0xf'))['db'];config[_0xef9a('0x10')]=_[_0xef9a('0x11')](config['redis'],{'host':_0xef9a('0x12'),'port':0x18eb});var socket=require(_0xef9a('0x13'))(new Redis(config[_0xef9a('0x10')]));require(_0xef9a('0x14'))['register'](socket);var client=jayson[_0xef9a('0x15')][_0xef9a('0x16')]({'port':0x232c});var client9002=jayson['client'][_0xef9a('0x16')]({'port':0x232a});var client9003=jayson['client'][_0xef9a('0x16')]({'port':0x232b});var client9001=jayson[_0xef9a('0x15')][_0xef9a('0x16')]({'port':0x2329});function respondWithRpcPromise(_0x22f793,_0x1e45e3,_0x52b3a7,_0x59d511){return new Promise(function(_0x48e659,_0x417c8d){var _0x393554=_0x59d511||client;return _0x393554[_0xef9a('0x17')](_0x22f793,_0x52b3a7)[_0xef9a('0x18')](function(_0x43b6a9){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x1e45e3,_0xef9a('0x19'));logger['debug'](_0xef9a('0x1a'),_0x1e45e3,_0xef9a('0x19'),JSON[_0xef9a('0x1b')](_0x43b6a9));if(_0x43b6a9[_0xef9a('0x1c')]){if(_0x43b6a9[_0xef9a('0x1c')][_0xef9a('0x1d')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x1e45e3,_0x43b6a9['error'][_0xef9a('0x1e')]);return _0x417c8d(_0x43b6a9['error'][_0xef9a('0x1e')]);}logger[_0xef9a('0x1c')](_0xef9a('0x1f'),_0x1e45e3,_0x43b6a9[_0xef9a('0x1c')][_0xef9a('0x1e')]);return _0x48e659(_0x43b6a9['error']['message']);}else{logger['info'](_0xef9a('0x1f'),_0x1e45e3,_0xef9a('0x19'));_0x48e659(_0x43b6a9[_0xef9a('0x20')][_0xef9a('0x1e')]);}})[_0xef9a('0x21')](function(_0x5661ca){logger[_0xef9a('0x1c')](_0xef9a('0x1f'),_0x1e45e3,_0x5661ca);_0x417c8d(_0x5661ca);});});}function respondWithStatusCode(_0xe85287,_0x139369){_0x139369=_0x139369||0xcc;return function(_0x39d64f){if(_0x39d64f){return _0xe85287[_0xef9a('0x22')](_0x139369);}return _0xe85287[_0xef9a('0x23')](_0x139369)[_0xef9a('0x24')]();};}function respondWithResult(_0x206876,_0x37c705){_0x37c705=_0x37c705||0xc8;return function(_0x1a79ed){if(_0x1a79ed){return _0x206876[_0xef9a('0x23')](_0x37c705)[_0xef9a('0x25')](_0x1a79ed);}};}function respondWithFilteredResult(_0xaadd94,_0x29bef7){return function(_0x5991bc){if(_0x5991bc){var _0x10d4b1=typeof _0x29bef7['offset']===_0xef9a('0x26')&&typeof _0x29bef7['limit']===_0xef9a('0x26');var _0x21f485=_0x5991bc[_0xef9a('0x27')];var _0x8711c9=_0x10d4b1?0x0:_0x29bef7[_0xef9a('0x28')];var _0x1834b7=_0x10d4b1?_0x5991bc[_0xef9a('0x27')]:_0x29bef7[_0xef9a('0x28')]+_0x29bef7['limit'];var _0x3b2947;if(_0x1834b7>=_0x21f485){_0x1834b7=_0x21f485;_0x3b2947=0xc8;}else{_0x3b2947=0xce;}_0xaadd94[_0xef9a('0x23')](_0x3b2947);return _0xaadd94[_0xef9a('0x29')](_0xef9a('0x2a'),_0x8711c9+'-'+_0x1834b7+'/'+_0x21f485)[_0xef9a('0x25')](_0x5991bc);}return null;};}function saveUpdates(_0x13a9fb){return function(_0x464639){if(_0x464639){return _0x464639['update'](_0x13a9fb)[_0xef9a('0x18')](function(_0x25b318){return _0x25b318;});}return null;};}function removeEntity(_0x2217b6){return function(_0x3743e5){if(_0x3743e5){return _0x3743e5[_0xef9a('0x2b')]()[_0xef9a('0x18')](function(){var _0x2849be=_0x3743e5[_0xef9a('0x2c')]({'plain':!![]});var _0x22cc8a=_0xef9a('0x2d');return db['UserProfileResource'][_0xef9a('0x2b')]({'where':{'type':_0x22cc8a,'resourceId':_0x2849be['id']}})[_0xef9a('0x18')](function(){return _0x3743e5;});})[_0xef9a('0x18')](function(){_0x2217b6[_0xef9a('0x23')](0xcc)[_0xef9a('0x24')]();});}};}function handleEntityNotFound(_0x3f498e){return function(_0x57e9c8){if(!_0x57e9c8){_0x3f498e[_0xef9a('0x22')](0x194);}return _0x57e9c8;};}function handleError(_0x456206,_0x32d98d){_0x32d98d=_0x32d98d||0x1f4;return function(_0x523d91){logger['error'](_0x523d91[_0xef9a('0x2e')]);if(_0x523d91[_0xef9a('0x2f')]){delete _0x523d91[_0xef9a('0x2f')];}_0x456206[_0xef9a('0x23')](_0x32d98d)[_0xef9a('0x30')](_0x523d91);};}function iftimePromise(_0x37789b,_0x1e8e7a){return respondWithRpcPromise('Command',_0xef9a('0x31'),{'command':_0x1e8e7a['timezone']?util[_0xef9a('0x32')](_0xef9a('0x33'),_0x37789b[_0xef9a('0x34')],_0x1e8e7a['timezone']):util[_0xef9a('0x32')](_0xef9a('0x35'),_0x37789b[_0xef9a('0x34')])},client9002)['then'](function(_0xe249c8){var _0x45fd3a=_0xe249c8&&_0xe249c8[_0xef9a('0x36')]('true')>=0x0?!![]:![];logger[_0xef9a('0x37')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1e8e7a['id'],_0x37789b['id'],_0x37789b[_0xef9a('0x34')],_0x45fd3a?_0xef9a('0x38'):_0xef9a('0x39'),_0x1e8e7a[_0xef9a('0x3a')]?_0x1e8e7a['timezone']:'No\x20timezone');return _0x45fd3a;})[_0xef9a('0x21')](function(_0x32ba16){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1e8e7a['id'],_0x37789b['id'],_0x37789b[_0xef9a('0x34')],util['inspect'](_0x32ba16,{'showHidden':![],'depth':null}),_0x1e8e7a['timezone']?_0x1e8e7a['timezone']:_0xef9a('0x3b'));return![];});}function checkWebsiteIntervals(_0x1b96f6){var _0x45085f=_['map'](_0x1b96f6[_0xef9a('0x3c')][_0xef9a('0x3d')],function(_0x1befa3){var _0x37a09b=_0x1befa3['get']({'plain':!![]});return iftimePromise(_0x37a09b,_0x1b96f6);});return Promise[_0xef9a('0x3e')](_0x45085f)[_0xef9a('0x18')](function(_0x84406e){return _['some'](_0x84406e);});}function createInteractionObject(_0x12787a,_0x92d99c,_0x3ab2af,_0x4acd8a){var _0xbcc328=require(_0xef9a('0x3f'));var _0x18905e=new _0xbcc328();var _0x348afd=_0x18905e['setUA'](_0x3ab2af[_0xef9a('0x40')])[_0xef9a('0x41')]();var _0x38af1c=_0x92d99c['customerIp'];if(_0x3ab2af[_0xef9a('0x42')]){_0x38af1c=_0x3ab2af[_0xef9a('0x42')];}else if(_0x3ab2af[_0xef9a('0x43')]){_0x38af1c=_['first'](_0x3ab2af[_0xef9a('0x43')][_0xef9a('0x44')](','));}return{'ContactId':_0x4acd8a['id'],'ChatWebsiteId':_0x12787a,'from':(_0x4acd8a[_0xef9a('0x45')]||'')+'\x20'+(_0x4acd8a[_0xef9a('0x46')]||''),'customerIp':_0x38af1c,'customerPort':_0x3ab2af['x-real-port']?_0x3ab2af[_0xef9a('0x47')]:null,'referer':_0x92d99c[_0xef9a('0x48')],'browserName':_0x348afd['browser'][_0xef9a('0x2f')]&&_0x348afd[_0xef9a('0x49')][_0xef9a('0x4a')]?util['format']('%s\x20%s',_0x348afd[_0xef9a('0x49')]['name'],_0x348afd[_0xef9a('0x49')][_0xef9a('0x4a')]):_0xef9a('0x4b'),'browserVersion':_0x348afd[_0xef9a('0x49')][_0xef9a('0x4a')]||_0xef9a('0x4b'),'osName':util[_0xef9a('0x32')]('%s\x20%s',_0x348afd['os'][_0xef9a('0x2f')],_0x348afd['os'][_0xef9a('0x4a')]),'osVersion':_0x348afd['os'][_0xef9a('0x4a')],'deviceModel':_0x348afd[_0xef9a('0x4c')]['model']&&_0x348afd[_0xef9a('0x4c')]['vendor']?util[_0xef9a('0x32')](_0xef9a('0x4d'),_0x348afd['device']['model'],_0x348afd[_0xef9a('0x4c')][_0xef9a('0x4e')],_0x348afd[_0xef9a('0x4c')]['type']):null,'deviceVendor':_0x348afd['device'][_0xef9a('0x4e')],'deviceType':_0x348afd[_0xef9a('0x4c')][_0xef9a('0x4f')],'formData':JSON[_0xef9a('0x1b')](_0x92d99c)};}exports['index']=function(_0x287d6e,_0x409af1){var _0x5c79ba={'include':[{'model':db[_0xef9a('0x50')],'as':_0xef9a('0x51')}]},_0x16251f={},_0x4d4ce9={'count':0x0,'rows':[]};var _0x1656dd=_[_0xef9a('0x52')](db[_0xef9a('0x53')][_0xef9a('0x54')],function(_0x17bd39){return{'name':_0x17bd39[_0xef9a('0x55')],'type':_0x17bd39['type'][_0xef9a('0x56')]};});_0x16251f['model']=_[_0xef9a('0x52')](_0x1656dd,_0xef9a('0x2f'));_0x16251f[_0xef9a('0x57')]=_['keys'](_0x287d6e[_0xef9a('0x57')]);_0x16251f['filters']=_[_0xef9a('0x58')](_0x16251f[_0xef9a('0x59')],_0x16251f[_0xef9a('0x57')]);_0x5c79ba[_0xef9a('0x5a')]=_[_0xef9a('0x58')](_0x16251f[_0xef9a('0x59')],qs[_0xef9a('0x5b')](_0x287d6e[_0xef9a('0x57')][_0xef9a('0x5b')]));_0x5c79ba[_0xef9a('0x5a')]=_0x5c79ba[_0xef9a('0x5a')]['length']?_0x5c79ba[_0xef9a('0x5a')]:_0x16251f['model'];if(!_0x287d6e[_0xef9a('0x57')][_0xef9a('0x5c')]('nolimit')){_0x5c79ba[_0xef9a('0x5d')]=qs[_0xef9a('0x5d')](_0x287d6e[_0xef9a('0x57')][_0xef9a('0x5d')]);_0x5c79ba[_0xef9a('0x28')]=qs['offset'](_0x287d6e[_0xef9a('0x57')][_0xef9a('0x28')]);}_0x5c79ba['order']=qs[_0xef9a('0x5e')](_0x287d6e[_0xef9a('0x57')][_0xef9a('0x5e')]);_0x5c79ba[_0xef9a('0x5f')]=qs['filters'](_[_0xef9a('0x60')](_0x287d6e[_0xef9a('0x57')],_0x16251f[_0xef9a('0x61')]),_0x1656dd);if(_0x287d6e[_0xef9a('0x57')][_0xef9a('0x62')]){_0x5c79ba[_0xef9a('0x5f')]=_['merge'](_0x5c79ba['where'],{'$or':_[_0xef9a('0x52')](_0x1656dd,function(_0x2a7bf8){if(_0x2a7bf8['type']!=='VIRTUAL'){var _0xe9460c={};_0xe9460c[_0x2a7bf8[_0xef9a('0x2f')]]={'$like':'%'+_0x287d6e[_0xef9a('0x57')][_0xef9a('0x62')]+'%'};return _0xe9460c;}})});}_0x5c79ba=_[_0xef9a('0x63')]({},_0x5c79ba,_0x287d6e[_0xef9a('0x64')]);var _0x567e87={'where':_0x5c79ba[_0xef9a('0x5f')]};return db['ChatWebsite'][_0xef9a('0x27')](_0x567e87)[_0xef9a('0x18')](function(_0x1f2c7d){_0x4d4ce9['count']=_0x1f2c7d;if(_0x287d6e[_0xef9a('0x57')][_0xef9a('0x65')]){_0x5c79ba[_0xef9a('0x66')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x5c79ba);})[_0xef9a('0x18')](function(_0xf6cb25){_0x4d4ce9[_0xef9a('0x67')]=_0xf6cb25;return _0x4d4ce9;})[_0xef9a('0x18')](respondWithFilteredResult(_0x409af1,_0x5c79ba))[_0xef9a('0x21')](handleError(_0x409af1,null));};exports['show']=function(_0x28d828,_0x329d82){var _0x5ab2b1={'raw':![],'where':{'id':_0x28d828[_0xef9a('0x68')]['id']},'include':[{'model':db['Pause'],'as':_0xef9a('0x51')}]},_0x2551f1={};_0x2551f1['model']=_[_0xef9a('0x69')](db[_0xef9a('0x53')][_0xef9a('0x54')]);_0x2551f1['query']=_[_0xef9a('0x69')](_0x28d828[_0xef9a('0x57')]);_0x2551f1[_0xef9a('0x61')]=_[_0xef9a('0x58')](_0x2551f1[_0xef9a('0x59')],_0x2551f1[_0xef9a('0x57')]);_0x5ab2b1['attributes']=_[_0xef9a('0x58')](_0x2551f1[_0xef9a('0x59')],qs[_0xef9a('0x5b')](_0x28d828['query'][_0xef9a('0x5b')]));_0x5ab2b1[_0xef9a('0x5a')]=_0x5ab2b1[_0xef9a('0x5a')][_0xef9a('0x6a')]?_0x5ab2b1[_0xef9a('0x5a')]:_0x2551f1[_0xef9a('0x59')];if(_0x28d828[_0xef9a('0x57')][_0xef9a('0x65')]){_0x5ab2b1[_0xef9a('0x66')]=[{'all':!![]}];}_0x5ab2b1=_['merge']({},_0x5ab2b1,_0x28d828[_0xef9a('0x64')]);return db['ChatWebsite'][_0xef9a('0x6b')](_0x5ab2b1)[_0xef9a('0x18')](handleEntityNotFound(_0x329d82,null))['then'](respondWithResult(_0x329d82,null))['catch'](handleError(_0x329d82,null));};exports[_0xef9a('0x6c')]=function(_0x1548c5,_0x16c3fe){return db[_0xef9a('0x53')][_0xef9a('0x6c')](_0x1548c5['body'],{})['then'](function(_0x178480){var _0x154f3c=_0x1548c5[_0xef9a('0x6d')]['get']({'plain':!![]});if(!_0x154f3c)throw new Error(_0xef9a('0x6e'));if(_0x154f3c[_0xef9a('0x6f')]===_0xef9a('0x6d')){var _0x247d2e=_0x178480['get']({'plain':!![]});var _0x574f96='ChatWebsites';return db[_0xef9a('0x70')]['find']({'where':{'name':_0x574f96,'userProfileId':_0x154f3c[_0xef9a('0x71')]},'raw':!![]})['then'](function(_0x238def){if(_0x238def&&_0x238def['autoAssociation']===0x0){return db['UserProfileResource'][_0xef9a('0x6c')]({'name':_0x247d2e[_0xef9a('0x2f')],'resourceId':_0x247d2e['id'],'type':_0x238def[_0xef9a('0x2f')],'sectionId':_0x238def['id']},{})[_0xef9a('0x18')](function(){return _0x178480;});}else{return _0x178480;}})[_0xef9a('0x21')](function(_0x3c23d3){logger[_0xef9a('0x1c')](_0xef9a('0x72'),_0x3c23d3);throw _0x3c23d3;});}return _0x178480;})['then'](respondWithResult(_0x16c3fe,0xc9))['catch'](handleError(_0x16c3fe,null));};exports[_0xef9a('0x73')]=function(_0x3f0db7,_0x3a1af6){if(_0x3f0db7['body']['id']){delete _0x3f0db7['body']['id'];}return db[_0xef9a('0x53')][_0xef9a('0x6b')]({'where':{'id':_0x3f0db7[_0xef9a('0x68')]['id']},'include':[{'model':db[_0xef9a('0x50')],'as':_0xef9a('0x51')}]})[_0xef9a('0x18')](handleEntityNotFound(_0x3a1af6,null))[_0xef9a('0x18')](saveUpdates(_0x3f0db7['body'],null))[_0xef9a('0x18')](respondWithResult(_0x3a1af6,null))[_0xef9a('0x21')](handleError(_0x3a1af6,null));};exports[_0xef9a('0x2b')]=function(_0x4883f0,_0x233883){return db[_0xef9a('0x53')][_0xef9a('0x6b')]({'where':{'id':_0x4883f0[_0xef9a('0x68')]['id']}})[_0xef9a('0x18')](handleEntityNotFound(_0x233883,null))[_0xef9a('0x18')](removeEntity(_0x233883,null))[_0xef9a('0x21')](handleError(_0x233883,null));};exports[_0xef9a('0x74')]=function(_0xede58,_0x205110){return db[_0xef9a('0x53')][_0xef9a('0x74')]()['then'](respondWithResult(_0x205110,null))[_0xef9a('0x21')](handleError(_0x205110,null));};exports[_0xef9a('0x75')]=function(_0x3fcfdb,_0xe58c2){if(_0x3fcfdb[_0xef9a('0x76')]['id']){delete _0x3fcfdb['body']['id'];}return db[_0xef9a('0x53')][_0xef9a('0x6b')]({'where':{'id':_0x3fcfdb[_0xef9a('0x68')]['id']}})[_0xef9a('0x18')](handleEntityNotFound(_0xe58c2,null))[_0xef9a('0x18')](function(_0x52f320){if(_0x52f320){_0x3fcfdb[_0xef9a('0x76')]['ChatWebsiteId']=_0x52f320['id'];return db[_0xef9a('0x77')]['create'](_0x3fcfdb[_0xef9a('0x76')]);}})[_0xef9a('0x18')](respondWithResult(_0xe58c2,null))['catch'](handleError(_0xe58c2,null));};exports[_0xef9a('0x78')]=function(_0x2e9f5d,_0x172e30){var _0x1b15ed={'raw':![],'where':{}};var _0x2cd78c={};var _0x1c56b6={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xef9a('0x79')]({'where':{'id':_0x2e9f5d[_0xef9a('0x68')]['id']}})[_0xef9a('0x18')](handleEntityNotFound(_0x172e30,null))[_0xef9a('0x18')](function(_0x429bfb){if(_0x429bfb){_0x2cd78c[_0xef9a('0x59')]=_[_0xef9a('0x69')](db['Disposition'][_0xef9a('0x54')]);_0x2cd78c[_0xef9a('0x57')]=_[_0xef9a('0x69')](_0x2e9f5d['query']);_0x2cd78c['filters']=_['intersection'](_0x2cd78c[_0xef9a('0x59')],_0x2cd78c[_0xef9a('0x57')]);_0x1b15ed[_0xef9a('0x5a')]=_[_0xef9a('0x58')](_0x2cd78c['model'],qs[_0xef9a('0x5b')](_0x2e9f5d['query'][_0xef9a('0x5b')]));_0x1b15ed[_0xef9a('0x5a')]=_0x1b15ed[_0xef9a('0x5a')][_0xef9a('0x6a')]?_0x1b15ed[_0xef9a('0x5a')]:_0x2cd78c[_0xef9a('0x59')];if(!_0x2e9f5d[_0xef9a('0x57')][_0xef9a('0x5c')](_0xef9a('0x7a'))){_0x1b15ed[_0xef9a('0x5d')]=qs[_0xef9a('0x5d')](_0x2e9f5d[_0xef9a('0x57')][_0xef9a('0x5d')]);_0x1b15ed[_0xef9a('0x28')]=qs[_0xef9a('0x28')](_0x2e9f5d[_0xef9a('0x57')]['offset']);}_0x1b15ed['order']=qs[_0xef9a('0x5e')](_0x2e9f5d[_0xef9a('0x57')][_0xef9a('0x5e')]);_0x1b15ed[_0xef9a('0x5f')]=qs[_0xef9a('0x61')](_['pick'](_0x2e9f5d['query'],_0x2cd78c[_0xef9a('0x61')]));_0x1b15ed[_0xef9a('0x5f')][_0xef9a('0x7b')]=_0x429bfb['id'];if(_0x2e9f5d[_0xef9a('0x57')][_0xef9a('0x62')]){_0x1b15ed[_0xef9a('0x5f')]=_[_0xef9a('0x63')](_0x1b15ed[_0xef9a('0x5f')],{'$or':_[_0xef9a('0x52')](_0x1b15ed[_0xef9a('0x5a')],function(_0x33acfa){var _0x4aa865={};_0x4aa865[_0x33acfa]={'$like':'%'+_0x2e9f5d[_0xef9a('0x57')][_0xef9a('0x62')]+'%'};return _0x4aa865;})});}_0x1b15ed=_['merge']({},_0x1b15ed,_0x2e9f5d['options']);return db[_0xef9a('0x77')]['count']({'where':_0x1b15ed['where']})['then'](function(_0x271b08){_0x1c56b6[_0xef9a('0x27')]=_0x271b08;if(_0x2e9f5d[_0xef9a('0x57')][_0xef9a('0x65')]){_0x1b15ed[_0xef9a('0x66')]=[{'all':!![]}];}return db[_0xef9a('0x77')][_0xef9a('0x7c')](_0x1b15ed);})[_0xef9a('0x18')](function(_0x4da80a){_0x1c56b6['rows']=_0x4da80a;return _0x1c56b6;});}})['then'](respondWithFilteredResult(_0x172e30,_0x1b15ed))['catch'](handleError(_0x172e30,null));};exports[_0xef9a('0x7d')]=function(_0x92b929,_0x54078f){return db[_0xef9a('0x53')]['find']({'where':{'id':_0x92b929['params']['id']}})[_0xef9a('0x18')](handleEntityNotFound(_0x54078f,null))[_0xef9a('0x18')](function(_0x46db8c){if(_0x46db8c){return _0x46db8c[_0xef9a('0x7d')](_0x92b929[_0xef9a('0x57')]['ids']);}})[_0xef9a('0x18')](respondWithStatusCode(_0x54078f,null))[_0xef9a('0x21')](handleError(_0x54078f,null));};exports[_0xef9a('0x7e')]=function(_0x19c5f5,_0x132dc0){if(_0x19c5f5['body']['id']){delete _0x19c5f5[_0xef9a('0x76')]['id'];}return db[_0xef9a('0x53')][_0xef9a('0x6b')]({'where':{'id':_0x19c5f5['params']['id']}})['then'](handleEntityNotFound(_0x132dc0,null))[_0xef9a('0x18')](function(_0x4e6ec6){if(_0x4e6ec6){_0x19c5f5[_0xef9a('0x76')][_0xef9a('0x7b')]=_0x4e6ec6['id'];return db[_0xef9a('0x7f')]['create'](_0x19c5f5[_0xef9a('0x76')]);}})[_0xef9a('0x18')](respondWithResult(_0x132dc0,null))[_0xef9a('0x21')](handleError(_0x132dc0,null));};exports['getAnswers']=function(_0x2c5fff,_0x4164d5){var _0x30e923={'raw':![],'where':{}};var _0x193603={};var _0x24419d={'count':0x0,'rows':[]};return db[_0xef9a('0x53')]['findOne']({'where':{'id':_0x2c5fff[_0xef9a('0x68')]['id']}})['then'](handleEntityNotFound(_0x4164d5,null))[_0xef9a('0x18')](function(_0x3b968d){if(_0x3b968d){_0x193603[_0xef9a('0x59')]=_[_0xef9a('0x69')](db[_0xef9a('0x7f')][_0xef9a('0x54')]);_0x193603[_0xef9a('0x57')]=_[_0xef9a('0x69')](_0x2c5fff['query']);_0x193603[_0xef9a('0x61')]=_[_0xef9a('0x58')](_0x193603['model'],_0x193603[_0xef9a('0x57')]);_0x30e923[_0xef9a('0x5a')]=_[_0xef9a('0x58')](_0x193603['model'],qs[_0xef9a('0x5b')](_0x2c5fff['query'][_0xef9a('0x5b')]));_0x30e923[_0xef9a('0x5a')]=_0x30e923['attributes'][_0xef9a('0x6a')]?_0x30e923[_0xef9a('0x5a')]:_0x193603['model'];if(!_0x2c5fff[_0xef9a('0x57')][_0xef9a('0x5c')]('nolimit')){_0x30e923[_0xef9a('0x5d')]=qs[_0xef9a('0x5d')](_0x2c5fff[_0xef9a('0x57')][_0xef9a('0x5d')]);_0x30e923[_0xef9a('0x28')]=qs['offset'](_0x2c5fff['query'][_0xef9a('0x28')]);}_0x30e923['order']=qs[_0xef9a('0x5e')](_0x2c5fff[_0xef9a('0x57')]['sort']);_0x30e923['where']=qs[_0xef9a('0x61')](_['pick'](_0x2c5fff['query'],_0x193603[_0xef9a('0x61')]));_0x30e923[_0xef9a('0x5f')][_0xef9a('0x7b')]=_0x3b968d['id'];if(_0x2c5fff['query'][_0xef9a('0x62')]){_0x30e923[_0xef9a('0x5f')]=_[_0xef9a('0x63')](_0x30e923['where'],{'$or':_[_0xef9a('0x52')](_0x30e923[_0xef9a('0x5a')],function(_0x5a85b1){var _0x55009e={};_0x55009e[_0x5a85b1]={'$like':'%'+_0x2c5fff[_0xef9a('0x57')][_0xef9a('0x62')]+'%'};return _0x55009e;})});}_0x30e923=_[_0xef9a('0x63')]({},_0x30e923,_0x2c5fff[_0xef9a('0x64')]);return db['CannedAnswer'][_0xef9a('0x27')]({'where':_0x30e923[_0xef9a('0x5f')]})[_0xef9a('0x18')](function(_0x5e5854){_0x24419d[_0xef9a('0x27')]=_0x5e5854;if(_0x2c5fff['query'][_0xef9a('0x65')]){_0x30e923['include']=[{'all':!![]}];}return db[_0xef9a('0x7f')][_0xef9a('0x7c')](_0x30e923);})[_0xef9a('0x18')](function(_0x280b10){_0x24419d[_0xef9a('0x67')]=_0x280b10;return _0x24419d;});}})[_0xef9a('0x18')](respondWithFilteredResult(_0x4164d5,_0x30e923))[_0xef9a('0x21')](handleError(_0x4164d5,null));};exports[_0xef9a('0x80')]=function(_0x3e303d,_0x4cae5e){return db[_0xef9a('0x53')][_0xef9a('0x6b')]({'where':{'id':_0x3e303d[_0xef9a('0x68')]['id']}})[_0xef9a('0x18')](handleEntityNotFound(_0x4cae5e,null))[_0xef9a('0x18')](function(_0x3d0d45){if(_0x3d0d45){return _0x3d0d45[_0xef9a('0x80')](_0x3e303d[_0xef9a('0x57')][_0xef9a('0x81')]);}})[_0xef9a('0x18')](respondWithStatusCode(_0x4cae5e,null))['catch'](handleError(_0x4cae5e,null));};exports[_0xef9a('0x82')]=function(_0x49b94a,_0x12d768){_0x49b94a[_0xef9a('0x76')]['sitepic']=_0x49b94a[_0xef9a('0x83')][_0xef9a('0x84')];return db[_0xef9a('0x53')][_0xef9a('0x6b')]({'where':{'id':_0x49b94a['params']['id']}})[_0xef9a('0x18')](handleEntityNotFound(_0x12d768,null))[_0xef9a('0x18')](saveUpdates(_0x49b94a[_0xef9a('0x76')],null))[_0xef9a('0x18')](respondWithResult(_0x12d768,null))[_0xef9a('0x21')](handleError(_0x12d768,null));};exports['addAvatar']=function(_0x40694f,_0x3f9749){_0x40694f[_0xef9a('0x76')][_0xef9a('0x85')]=_0x40694f[_0xef9a('0x83')][_0xef9a('0x84')];return db['ChatWebsite']['find']({'where':{'id':_0x40694f['params']['id']}})['then'](handleEntityNotFound(_0x3f9749,null))[_0xef9a('0x18')](saveUpdates(_0x40694f[_0xef9a('0x76')],null))[_0xef9a('0x18')](respondWithResult(_0x3f9749,null))['catch'](handleError(_0x3f9749,null));};exports[_0xef9a('0x86')]=function(_0x259ac0,_0x2d14a7){_0x259ac0[_0xef9a('0x76')]['customerAvatar']=_0x259ac0[_0xef9a('0x83')][_0xef9a('0x84')];return db['ChatWebsite'][_0xef9a('0x6b')]({'where':{'id':_0x259ac0[_0xef9a('0x68')]['id']}})[_0xef9a('0x18')](handleEntityNotFound(_0x2d14a7,null))[_0xef9a('0x18')](saveUpdates(_0x259ac0[_0xef9a('0x76')],null))[_0xef9a('0x18')](respondWithResult(_0x2d14a7,null))['catch'](handleError(_0x2d14a7,null));};exports[_0xef9a('0x87')]=function(_0x1d3417,_0x330e1d){_0x1d3417['body'][_0xef9a('0x88')]=_0x1d3417[_0xef9a('0x83')][_0xef9a('0x84')];return db[_0xef9a('0x53')]['find']({'where':{'id':_0x1d3417['params']['id']}})[_0xef9a('0x18')](handleEntityNotFound(_0x330e1d,null))[_0xef9a('0x18')](saveUpdates(_0x1d3417['body'],null))['then'](respondWithResult(_0x330e1d,null))['catch'](handleError(_0x330e1d,null));};exports['getLogo']=function(_0x3b3c89,_0x11d4ae){var _0x2844c9=path['join'](config['root'],'server/files/images/logos/default_logo.svg');var _0x1de243={'where':{'id':_0x3b3c89[_0xef9a('0x68')]['id']},'attributes':['id',_0xef9a('0x89')],'raw':!![]};var _0x34275f=![];return require(_0xef9a('0x8a'))['getLicense']()[_0xef9a('0x18')](function(_0x177985){if(_0x177985){_0x34275f=_0x177985[_0xef9a('0x8b')];}})[_0xef9a('0x18')](function(){return db['ChatWebsite'][_0xef9a('0x6b')](_0x1de243);})['then'](handleEntityNotFound(_0x11d4ae,null))[_0xef9a('0x18')](function(_0x527261){if(_0x527261){if(!_[_0xef9a('0x8c')](_0x527261['sitepic'])){if(fs['existsSync'](path[_0xef9a('0x8d')](config[_0xef9a('0x8e')],_0xef9a('0x8f'),_0x527261['sitepic']))&&_0x34275f){_0x2844c9=path['join'](config['root'],'server/files/images/logos/',_0x527261[_0xef9a('0x89')]);}}return _0x11d4ae[_0xef9a('0x90')](_0x2844c9);}})['catch'](handleError(_0x11d4ae,null));};exports[_0xef9a('0x91')]=function(_0xc44a00,_0x502daa){var _0x326ff4=path[_0xef9a('0x8d')](config[_0xef9a('0x8e')],_0xef9a('0x92'));var _0x2757a9={'where':{'id':_0xc44a00['params']['id']},'attributes':['id',_0xef9a('0x85')],'raw':!![]};return db[_0xef9a('0x53')][_0xef9a('0x6b')](_0x2757a9)[_0xef9a('0x18')](handleEntityNotFound(_0x502daa,null))['then'](function(_0x137d8e){if(_0x137d8e){if(!_['isNil'](_0x137d8e[_0xef9a('0x85')])){if(fs[_0xef9a('0x93')](path[_0xef9a('0x8d')](config[_0xef9a('0x8e')],_0xef9a('0x94'),_0x137d8e[_0xef9a('0x85')]))){_0x326ff4=path['join'](config[_0xef9a('0x8e')],'server/files/images/avatars/',_0x137d8e['agentAvatar']);}}return _0x502daa[_0xef9a('0x90')](_0x326ff4);}})['catch'](handleError(_0x502daa,null));};exports['getCustomerAvatar']=function(_0x346928,_0x3d8343){var _0x2b9c4d=path['join'](config[_0xef9a('0x8e')],'server/files/images/avatars/customer_avatar.png');var _0x53427b={'where':{'id':_0x346928[_0xef9a('0x68')]['id']},'attributes':['id','customerAvatar',_0xef9a('0x95')],'raw':!![]};return db[_0xef9a('0x53')][_0xef9a('0x6b')](_0x53427b)[_0xef9a('0x18')](handleEntityNotFound(_0x3d8343,null))[_0xef9a('0x18')](function(_0x2e15d8){if(_0x2e15d8){if(!_[_0xef9a('0x8c')](_0x2e15d8[_0xef9a('0x96')])){if(fs[_0xef9a('0x93')](path[_0xef9a('0x8d')](config['root'],_0xef9a('0x94'),_0x2e15d8[_0xef9a('0x96')]))&&_0x2e15d8['showCustomerAvatar']){_0x2b9c4d=path[_0xef9a('0x8d')](config['root'],_0xef9a('0x94'),_0x2e15d8['customerAvatar']);}}return _0x3d8343[_0xef9a('0x90')](_0x2b9c4d);}})[_0xef9a('0x21')](handleError(_0x3d8343,null));};exports[_0xef9a('0x97')]=function(_0x139973,_0xa25f15){var _0x53e675=path[_0xef9a('0x8d')](config[_0xef9a('0x8e')],_0xef9a('0x98'));var _0x3fc435={'where':{'id':_0x139973['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xef9a('0x53')][_0xef9a('0x6b')](_0x3fc435)[_0xef9a('0x18')](handleEntityNotFound(_0xa25f15,null))[_0xef9a('0x18')](function(_0x29da59){if(_0x29da59){if(!_[_0xef9a('0x8c')](_0x29da59[_0xef9a('0x88')])){if(fs['existsSync'](path['join'](config['root'],_0xef9a('0x94'),_0x29da59[_0xef9a('0x88')]))){_0x53e675=path[_0xef9a('0x8d')](config[_0xef9a('0x8e')],_0xef9a('0x94'),_0x29da59[_0xef9a('0x88')]);}}return _0xa25f15[_0xef9a('0x90')](_0x53e675);}})[_0xef9a('0x21')](handleError(_0xa25f15,null));};exports['notify']=function(_0xba598a,_0x379681){var _0x50dbd6={'body':_0xba598a[_0xef9a('0x76')],'channel':_0xef9a('0x99')};var _0x361354=[];var _0x249573=[];var _0x301df4={};var _0xdad25=![];return db[_0xef9a('0x9a')][_0xef9a('0x74')]()['then'](function(_0x3fa34d){if(!_0x3fa34d){throw new db[(_0xef9a('0x9b'))]['ValidationError'](_0xef9a('0x9c'));}_0x361354=_[_0xef9a('0x9d')](_[_0xef9a('0x69')](_0x3fa34d),['createdAt',_0xef9a('0x9e')]);_0x249573=_['difference'](_[_0xef9a('0x69')](_0x3fa34d),[_0xef9a('0x9f'),_0xef9a('0x9e'),_0xef9a('0xa0'),'ListId']);if(_0xba598a[_0xef9a('0x76')]['id']){delete _0xba598a[_0xef9a('0x76')]['id'];}if(_[_0xef9a('0x8c')](_0xba598a[_0xef9a('0x76')][_0xef9a('0xa1')])){throw new db[(_0xef9a('0x9b'))][(_0xef9a('0xa2'))](_0xef9a('0xa3'));}if(_[_0xef9a('0x8c')](_0xba598a[_0xef9a('0x76')][_0xef9a('0x76')])||_0xba598a[_0xef9a('0x76')][_0xef9a('0x76')]===''){throw new db[(_0xef9a('0x9b'))]['ValidationError'](_0xef9a('0xa4'));}if(_[_0xef9a('0x8c')](_0xba598a[_0xef9a('0x76')][_0xef9a('0xa5')])){throw new db[(_0xef9a('0x9b'))]['ValidationError'](_0xef9a('0xa6')+_0x249573);}if(!_[_0xef9a('0xa7')](_0x249573,_0xba598a[_0xef9a('0x76')][_0xef9a('0xa5')])){throw new db['Sequelize']['ValidationError'](_0xef9a('0xa8')+_0x249573);}_0x301df4[_0xba598a[_0xef9a('0x76')]['mapKey']]=_0xba598a[_0xef9a('0x76')][_0xef9a('0xa1')];})[_0xef9a('0x18')](function(){return db[_0xef9a('0x53')]['find']({'where':{'id':_0xba598a[_0xef9a('0x68')]['id']},'include':[{'model':db[_0xef9a('0xa9')],'as':'List','include':[{'model':db['CmContact'],'as':_0xef9a('0xaa'),'where':_0x301df4,'limit':0x1,'order':[[_0xef9a('0x9e'),_0xef9a('0xab')]]}]},{'model':db[_0xef9a('0xac')],'as':'Applications'},{'model':db['Interval'],'as':_0xef9a('0x3c'),'include':[{'model':db[_0xef9a('0x3c')],'as':_0xef9a('0x3d'),'attributes':['id',_0xef9a('0x34')],'raw':!![]}]}]});})[_0xef9a('0x18')](function(_0x4faab8){if(!_0x4faab8)throw new APINotFoundError(util['format'](_0xef9a('0xad'),_0xba598a[_0xef9a('0x68')]['id']));if(!_0x4faab8[_0xef9a('0x3c')]||!_0x4faab8['Interval'][_0xef9a('0x3d')])return[_0x4faab8,!![]];return[_0x4faab8,checkWebsiteIntervals(_0x4faab8)];})['spread'](function(_0xa9a767,_0xf69d6e){if(!_0xf69d6e)throw new APIOutOfIntervalError();if(!_0xa9a767[_0xef9a('0xae')])return;_0x50dbd6['account']=_0xa9a767;_0x50dbd6['list']=_0xa9a767[_0xef9a('0xae')];_0x50dbd6['applications']=_[_0xef9a('0xaf')](_0xa9a767[_0xef9a('0xb0')],[_0xef9a('0xb1')],[_0xef9a('0xb2')]);if(_0x50dbd6[_0xef9a('0xb3')][_0xef9a('0xb0')]){delete _0x50dbd6[_0xef9a('0xb3')][_0xef9a('0xb0')];}if(_0x50dbd6[_0xef9a('0xb3')][_0xef9a('0xae')]&&_0x50dbd6['account'][_0xef9a('0xae')]['Contacts'][_0xef9a('0x6a')]){return _0x50dbd6[_0xef9a('0xb3')]['List'][_0xef9a('0xaa')][0x0];}var _0xa55a28=_[_0xef9a('0x11')](_0xba598a['body'],{'firstName':_0xba598a['body'][_0xef9a('0xa1')],'ListId':_0xa9a767[_0xef9a('0xb4')]});_0xa55a28[_0xba598a[_0xef9a('0x76')]['mapKey']]=_0xba598a[_0xef9a('0x76')][_0xef9a('0xa1')];return db[_0xef9a('0x9a')]['create'](_0xa55a28,{'fields':_0x361354,'raw':!![]});})[_0xef9a('0x18')](function(_0x45a64d){_0x50dbd6[_0xef9a('0xb5')]=_0x45a64d;var _0x14675a=createInteractionObject(_0xba598a[_0xef9a('0x68')]['id'],_0xba598a[_0xef9a('0x76')],_0xba598a['headers'],_0x45a64d);var _0x3ff892={'ChatWebsiteId':_0xba598a['params']['id'],'closed':![]};if(_0xba598a[_0xef9a('0x76')]['threadId']){_0x3ff892[_0xef9a('0xb6')]=_0xba598a['body']['threadId'];return db[_0xef9a('0xb7')][_0xef9a('0x6b')]({'where':_0x3ff892})[_0xef9a('0x18')](function(_0x19e853){if(_0x19e853){_0xdad25=!![];return _0x19e853;}_0x14675a[_0xef9a('0xb6')]=_0xba598a[_0xef9a('0x76')][_0xef9a('0xb6')];_0x14675a[_0xef9a('0xb8')]=_0xba598a[_0xef9a('0x76')][_0xef9a('0xb8')];return db[_0xef9a('0xb7')][_0xef9a('0x6c')](_0x14675a);});}_0x3ff892[_0xef9a('0xb9')]=_0x45a64d['id'];if(_0xba598a[_0xef9a('0x76')][_0xef9a('0xba')]&&_0xba598a['body'][_0xef9a('0xba')]['id']){_0x3ff892['id']=_0xba598a['body'][_0xef9a('0xba')]['id'];return db[_0xef9a('0xb7')][_0xef9a('0x6b')]({'where':_0x3ff892})[_0xef9a('0x18')](function(_0x10c329){if(_0x10c329){_0xdad25=!![];return _0x10c329;}return db[_0xef9a('0xb7')][_0xef9a('0x6c')](_0x14675a);});}return db[_0xef9a('0xb7')]['create'](_0x14675a);})['then'](function(_0x429e77){if(!_0xdad25)return _0x429e77;var _0x524ec3={'from':(_0x50dbd6[_0xef9a('0xb5')][_0xef9a('0x45')]||'')+'\x20'+(_0x50dbd6[_0xef9a('0xb5')][_0xef9a('0x46')]||'')};if(_0xba598a[_0xef9a('0x76')][_0xef9a('0xb6')]&&_0xba598a['body'][_0xef9a('0xbb')]&&_0xba598a[_0xef9a('0x76')][_0xef9a('0xb6')]!=_0xba598a[_0xef9a('0x76')][_0xef9a('0xbb')]){_0x524ec3[_0xef9a('0xb6')]=_0xba598a[_0xef9a('0x76')][_0xef9a('0xbb')];}return _0x429e77['update'](_0x524ec3);})['then'](function(_0x47656b){_0x50dbd6[_0xef9a('0xba')]=_0x47656b[_0xef9a('0x2c')]({'plain':!![]});_0x50dbd6['interaction']['created']=!_0xdad25;if(_0x50dbd6[_0xef9a('0xba')][_0xef9a('0xbc')]){if(_0x50dbd6['account']['autoclose']){_0x50dbd6[_0xef9a('0xbd')][_0xef9a('0xbe')]({'id':0x0,'priority':_0x50dbd6['applications']['length']+0x1,'app':'close','appdata':_0xef9a('0xbf'),'interval':_0xef9a('0xc0')});}}return db[_0xef9a('0xc1')][_0xef9a('0x6c')]({'body':_0xba598a['body'][_0xef9a('0x76')],'ChatWebsiteId':_0xba598a[_0xef9a('0x68')]['id'],'ChatInteractionId':_0x47656b['id'],'direction':'in','ContactId':_0x50dbd6[_0xef9a('0xb5')]['id'],'AttachmentId':_0xba598a['body']['AttachmentId']});})[_0xef9a('0x18')](function(_0x52f0c4){_0x50dbd6[_0xef9a('0x1e')]=_0x52f0c4;if(!_0x50dbd6[_0xef9a('0xba')][_0xef9a('0xc2')]){return;}return db[_0xef9a('0xc3')]['find']({'attributes':['id',_0xef9a('0x2f')],'where':{'id':_0x50dbd6[_0xef9a('0xba')]['UserId']}});})['then'](function(_0x2a4436){if(_0x2a4436){_0x50dbd6[_0xef9a('0xbd')][_0xef9a('0xc4')]({'id':0x0,'priority':0x0,'app':_0xef9a('0xc5'),'appdata':_0x2a4436[_0xef9a('0x2f')]+','+(_0x50dbd6[_0xef9a('0xb3')][_0xef9a('0xc6')]||0xa),'interval':_0xef9a('0xc0')});_0x50dbd6[_0xef9a('0xc7')]=!![];}if(!_0x50dbd6['interaction'][_0xef9a('0xc8')]){return;}return db[_0xef9a('0xc9')][_0xef9a('0x6b')]({'attributes':['id',_0xef9a('0x2f')],'where':{'id':_0x50dbd6[_0xef9a('0xba')][_0xef9a('0xc8')]}});})[_0xef9a('0x18')](function(_0x45a34b){if(_0x45a34b){_0x50dbd6[_0xef9a('0xbd')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x45a34b[_0xef9a('0x2f')]+','+(_0x50dbd6['account'][_0xef9a('0xca')]||0x12c),'interval':_0xef9a('0xc0')});}return respondWithRpcPromise('Start',_0xef9a('0xcb'),_0x50dbd6);})[_0xef9a('0x18')](function(_0x4e9391){respondWithRpcPromise(_0xef9a('0xcc'),'EventManager',{'event':_0xef9a('0xcd'),'message':_0x4e9391},client9002);return _0x4e9391;})[_0xef9a('0x18')](respondWithResult(_0x379681,null))[_0xef9a('0x21')](APIHandleError(_0x379681));};exports[_0xef9a('0xce')]=function(_0x882a9f,_0x314fc3){var _0x5bbb5b,_0x4294aa,_0x40e66c;var _0x56b99e=[];var _0xd756b7={};var _0x412c9b=_0x882a9f[_0xef9a('0xcf')]||[];var _0x1d3c6c=[];var _0x130879;return db['CmContact'][_0xef9a('0x74')]()[_0xef9a('0x18')](function(_0x4adc5f){if(!_0x4adc5f){throw new db[(_0xef9a('0x9b'))][(_0xef9a('0xa2'))](_0xef9a('0x9c'));}_0x56b99e=_[_0xef9a('0x9d')](_['keys'](_0x4adc5f),[_0xef9a('0x9f'),_0xef9a('0x9e'),_0xef9a('0xa0'),_0xef9a('0xb4')]);if(_0x882a9f[_0xef9a('0x76')]['id']){delete _0x882a9f['body']['id'];}if(_[_0xef9a('0x8c')](_0x882a9f[_0xef9a('0x76')][_0xef9a('0xa1')])){throw _0x314fc3['status'](0x1f4)[_0xef9a('0x30')](new db[(_0xef9a('0x9b'))]['ValidationError'](_0xef9a('0xa3')));}if(_[_0xef9a('0x8c')](_0x882a9f[_0xef9a('0x76')][_0xef9a('0x76')])||_0x882a9f[_0xef9a('0x76')][_0xef9a('0x76')]===''){throw _0x314fc3[_0xef9a('0x23')](0x1f4)['send'](new db[(_0xef9a('0x9b'))][(_0xef9a('0xa2'))](_0xef9a('0xa4')));}if(_['isNil'](_0x882a9f[_0xef9a('0x76')][_0xef9a('0xd0')])){throw _0x314fc3['status'](0x1f4)[_0xef9a('0x30')](new db['Sequelize'][(_0xef9a('0xa2'))](_0xef9a('0xd1')+_0x56b99e));}if(!_[_0xef9a('0xa7')](_0x56b99e,_0x882a9f['body']['mapKeyOffline'])){throw _0x314fc3[_0xef9a('0x23')](0x1f4)[_0xef9a('0x30')](new db[(_0xef9a('0x9b'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x56b99e));}_0xd756b7[_0x882a9f[_0xef9a('0x76')][_0xef9a('0xd0')]]=_0x882a9f[_0xef9a('0x76')][_0xef9a('0xa1')];})['then'](function(){return db[_0xef9a('0x53')][_0xef9a('0x6b')]({'where':{'id':_0x882a9f[_0xef9a('0x68')]['id']},'include':[{'model':db[_0xef9a('0xa9')],'as':_0xef9a('0xae')},{'model':db[_0xef9a('0xd2')],'as':_0xef9a('0xd2')}]});})[_0xef9a('0x18')](handleEntityNotFound(_0x314fc3,null))[_0xef9a('0x18')](function(_0x3af56f){if(_0x3af56f&&_0x3af56f[_0xef9a('0xae')]){_0x4294aa=_0x3af56f;var _0x480833=_[_0xef9a('0x11')](_0x882a9f['body'],{'firstName':_0x882a9f[_0xef9a('0x76')][_0xef9a('0xa1')],'phone':_0x882a9f[_0xef9a('0x76')][_0xef9a('0xa1')],'ListId':_0x3af56f['ListId']});_0x480833[_0x882a9f[_0xef9a('0x76')]['mapKeyOffline']]=_0x882a9f[_0xef9a('0x76')][_0xef9a('0xa1')];return db['CmContact'][_0xef9a('0xd3')]({'where':_0xd756b7,'defaults':_0x480833});}})[_0xef9a('0xd4')](function(_0x52b261){if(_0x52b261){_0x40e66c=_0x52b261;var _0x42db73=fs['readFileSync'](path[_0xef9a('0x8d')](config[_0xef9a('0x8e')],_0xef9a('0xd5')),'utf8');var _0x20ecb6=ejs[_0xef9a('0xd6')](_0x42db73,{'body':_['toPairs'](_0x882a9f['body']['body']),'bodyTitle':_0x4294aa[_0xef9a('0xd7')]});return db[_0xef9a('0xd8')][_0xef9a('0x6c')]({'body':_0x20ecb6,'plainBody':htmlToText['fromString'](_0x20ecb6),'ContactId':_0x52b261['id'],'ChatWebsiteId':_0x4294aa['id']});}})[_0xef9a('0x18')](function(_0x37ffe6){_0x130879=_0x37ffe6;if(_0x412c9b[_0xef9a('0x6a')]){var _0x2fec2a=_0x412c9b[_0xef9a('0x52')](function(_0x139df5){return{'name':_0x139df5[_0xef9a('0xd9')],'basename':_0x139df5[_0xef9a('0x84')],'type':_0x139df5['mimetype'],'ChatOfflineMessageId':_0x37ffe6['id']};});_0x1d3c6c=_0x2fec2a[_0xef9a('0x52')](_0x36df2f=>{var _0x5626bf={'filename':_0x36df2f[_0xef9a('0x2f')],'path':path[_0xef9a('0x8d')](config['root'],_0xef9a('0xda'),_0xef9a('0xcf'),'attachments',_0xef9a('0xdb'),_0x36df2f[_0xef9a('0xdc')])};return _0x5626bf;});if(!_0x4294aa[_0xef9a('0xdd')]){return db['sequelize']['transaction'](function(_0x1621d0){return db[_0xef9a('0xde')][_0xef9a('0xdf')](_0x2fec2a,{'transaction':_0x1621d0});});}}})[_0xef9a('0x18')](function(){if(_0x130879){_0x5bbb5b=_0x130879;return db['MailAccount'][_0xef9a('0x79')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0xef9a('0xe0')],'as':_0xef9a('0xe0'),'raw':!![]}]}]});}})['then'](function(_0x59d138){if(_0x59d138&&_0x59d138[_0xef9a('0xe1')]&&_0x4294aa[_0xef9a('0xe2')]&&_0x4294aa['forwardOfflineAddress']){var _0x20e7da=_0x59d138[_0xef9a('0xe3')]();return respondWithRpcPromise(_0xef9a('0xe4'),_0xef9a('0xe5'),{'account':_0x20e7da,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x59d138[_0xef9a('0x2f')],_0x59d138['email']||_0x59d138[_0xef9a('0xe1')][_0xef9a('0x6d')]),'to':_0x4294aa[_0xef9a('0xe6')],'subject':_0x4294aa['offlineMessageSubject'],'html':_0x5bbb5b[_0xef9a('0x76')],'attachments':_0x1d3c6c}},client9003)['then'](function(){return _0x5bbb5b;})[_0xef9a('0x21')](function(_0x27a68e){logger['error'](_0x27a68e);});}})[_0xef9a('0x18')](function(){if(_0x4294aa&&_0x4294aa[_0xef9a('0xdd')]&&_0x4294aa['MailAccountId']){var _0x3f7cb5=[];if(_0x412c9b[_0xef9a('0x6a')]){_0x3f7cb5=_0x412c9b[_0xef9a('0x52')](function(_0x21dd6e){return{'name':_0x21dd6e['originalname'],'basename':_0x21dd6e[_0xef9a('0x84')],'type':_0x21dd6e['mimetype'],'ChatOfflineMessageId':_0x130879['id']};});}var _0x56180b;if(!_['isNil'](_0x4294aa[_0xef9a('0xe7')])){var _0x4bb8d8=_['map'](_0x882a9f['body'],function(_0x1d7af0){return _0x1d7af0;});var _0xe0e2c4=_[_0xef9a('0xe8')](_0x4bb8d8)[0x0];var _0x5646cd=_[_0xef9a('0xe9')](_0xe0e2c4,function(_0x458c4e){return _0x458c4e;});_0x56180b=_0x5646cd[0x1][_0x4294aa[_0xef9a('0xe7')]];}var _0x5f47d8={'from':_0x40e66c['email'],'firstName':_0x40e66c[_0xef9a('0x45')],'lastName':_0x40e66c[_0xef9a('0x46')],'mapKey':_0xef9a('0xea'),'message':{'from':_0x40e66c['email'],'to':_0x4294aa[_0xef9a('0xd2')][_0xef9a('0xea')],'cc':'','subject':_[_0xef9a('0x8c')](_0x56180b)?_0x4294aa[_0xef9a('0xeb')]:_0x56180b,'messageId':'','sentAt':new Date(),'attach':_0x3f7cb5['length'],'attachments':_0x3f7cb5,'originChannel':_0xef9a('0xec'),'ChatWebsiteId':_0x4294aa['id'],'ChatOfflineMessageId':_0x5bbb5b['id'],'originTo':_0x4294aa['MailAccount'][_0xef9a('0xea')]},'body':_0x5bbb5b[_0xef9a('0x76')]};var _0x3d98b0={'account':{'id':_0x4294aa[_0xef9a('0xed')]},'body':_0x5f47d8,'log':_0xef9a('0xee')};return respondWithRpcPromise(_0xef9a('0xee'),_0xef9a('0xef'),_0x3d98b0,client9001)['then'](function(){return _0x5bbb5b;})['catch'](function(_0x5aaf58){logger[_0xef9a('0x1c')](_0x5aaf58);});}return;})[_0xef9a('0x18')](function(){if(_0x5bbb5b){return _0x5bbb5b;}})['then'](respondWithResult(_0x314fc3,null))['catch'](function(){for(var _0x5b93b8 of _0x412c9b){var _0x1f5c59=path['join'](config[_0xef9a('0x8e')],_0xef9a('0xda'),_0xef9a('0xcf'),_0xef9a('0xf0'),_0xef9a('0xdb'),_0x5b93b8[_0xef9a('0x84')]);fs_extra[_0xef9a('0xf1')](_0x1f5c59)['catch'](function(_0x1da22c){logger[_0xef9a('0x1c')](_0xef9a('0xf2'),_0x1f5c59,_0x1da22c);});}});};exports[_0xef9a('0xf3')]=function(_0x4e70db,_0x2f43bd){return db[_0xef9a('0xb7')]['find']({'where':{'id':_0x4e70db['params']['id']}})[_0xef9a('0x18')](handleEntityNotFound(_0x2f43bd,null))[_0xef9a('0x18')](function(_0x4d6969){if(_0x4d6969){return _0x4d6969[_0xef9a('0xf3')](_0x4e70db['body'][_0xef9a('0x81')],_['omit'](_0x4e70db[_0xef9a('0x76')],[_0xef9a('0x81'),'id'])||{});}})[_0xef9a('0x18')](respondWithResult(_0x2f43bd,null))[_0xef9a('0x21')](handleError(_0x2f43bd,null));};exports[_0xef9a('0xf4')]=function(_0x61d390,_0x5849e2){var _0x4aef7b={'raw':![],'where':{}};var _0x16726f={};var _0x17f071={'count':0x0,'rows':[]};return db[_0xef9a('0x53')][_0xef9a('0x79')]({'where':{'id':_0x61d390['params']['id']}})[_0xef9a('0x18')](handleEntityNotFound(_0x5849e2,null))['then'](function(_0x4fd5a0){if(_0x4fd5a0){_0x16726f[_0xef9a('0x59')]=_[_0xef9a('0x69')](db[_0xef9a('0xb7')][_0xef9a('0x54')]);_0x16726f['query']=_[_0xef9a('0x69')](_0x61d390[_0xef9a('0x57')]);_0x16726f[_0xef9a('0x61')]=_[_0xef9a('0x58')](_0x16726f['model'],_0x16726f[_0xef9a('0x57')]);_0x4aef7b[_0xef9a('0x5a')]=_[_0xef9a('0x58')](_0x16726f['model'],qs[_0xef9a('0x5b')](_0x61d390[_0xef9a('0x57')][_0xef9a('0x5b')]));_0x4aef7b[_0xef9a('0x5a')]=_0x4aef7b[_0xef9a('0x5a')][_0xef9a('0x6a')]?_0x4aef7b[_0xef9a('0x5a')]:_0x16726f[_0xef9a('0x59')];if(!_0x61d390[_0xef9a('0x57')][_0xef9a('0x5c')](_0xef9a('0x7a'))){_0x4aef7b[_0xef9a('0x5d')]=qs[_0xef9a('0x5d')](_0x61d390[_0xef9a('0x57')][_0xef9a('0x5d')]);_0x4aef7b[_0xef9a('0x28')]=qs['offset'](_0x61d390[_0xef9a('0x57')][_0xef9a('0x28')]);}_0x4aef7b[_0xef9a('0xf5')]=qs['sort'](_0x61d390[_0xef9a('0x57')]['sort']);_0x4aef7b[_0xef9a('0x5f')]=qs[_0xef9a('0x61')](_[_0xef9a('0x60')](_0x61d390[_0xef9a('0x57')],_0x16726f[_0xef9a('0x61')]));_0x4aef7b[_0xef9a('0x5f')][_0xef9a('0x7b')]=_0x4fd5a0['id'];if(_0x61d390[_0xef9a('0x57')]['filter']){_0x4aef7b[_0xef9a('0x5f')]=_['merge'](_0x4aef7b['where'],{'$or':_[_0xef9a('0x52')](_0x4aef7b['attributes'],function(_0x1bfbbf){var _0x4bbcac={};_0x4bbcac[_0x1bfbbf]={'$like':'%'+_0x61d390[_0xef9a('0x57')][_0xef9a('0x62')]+'%'};return _0x4bbcac;})});}_0x4aef7b=_[_0xef9a('0x63')]({},_0x4aef7b,_0x61d390['options']);return db[_0xef9a('0xb7')][_0xef9a('0x27')]({'where':_0x4aef7b['where']})['then'](function(_0x488939){_0x17f071[_0xef9a('0x27')]=_0x488939;if(_0x61d390[_0xef9a('0x57')][_0xef9a('0x65')]){_0x4aef7b[_0xef9a('0x66')]=[{'model':db[_0xef9a('0x9a')],'as':'Contact','required':![]},{'model':db[_0xef9a('0xc3')],'as':_0xef9a('0xf6'),'attributes':[_0xef9a('0x2f'),'fullname',_0xef9a('0xf7')],'required':![]},{'model':db[_0xef9a('0xf8')],'as':_0xef9a('0xf9'),'attributes':['id',_0xef9a('0x2f'),_0xef9a('0xfa')],'where':_0x61d390[_0xef9a('0x57')][_0xef9a('0xfb')]?{'id':_0x61d390[_0xef9a('0x57')][_0xef9a('0xfb')]}:undefined,'required':_0x61d390[_0xef9a('0x57')][_0xef9a('0xfb')]?!![]:![]}];}return db['ChatInteraction'][_0xef9a('0x7c')](_0x4aef7b);})[_0xef9a('0x18')](function(_0x2b6b24){_0x17f071[_0xef9a('0x67')]=_0x2b6b24;return _0x17f071;});}})[_0xef9a('0x18')](respondWithFilteredResult(_0x5849e2,_0x4aef7b))[_0xef9a('0x21')](handleError(_0x5849e2,null));};exports[_0xef9a('0x31')]=function(_0x369268,_0x4e3826){var _0x29c19d=0x0;var _0x2dcff2=0x0;var _0x548dcd=![];var _0x319f27;var _0x2bed00;return db[_0xef9a('0x53')][_0xef9a('0x6b')]({'where':{'id':_0x369268[_0xef9a('0x68')]['id']},'include':[{'model':db[_0xef9a('0x3c')],'as':'Interval','include':[{'model':db[_0xef9a('0x3c')],'as':'Intervals','attributes':['id',_0xef9a('0x34')]}]}]})[_0xef9a('0x18')](handleEntityNotFound(_0x4e3826,null))[_0xef9a('0x18')](function(_0x304610){if(_0x304610){_0x319f27=_0x304610;return _0x304610['getProactiveActions']({'raw':!![]});}})[_0xef9a('0x18')](function(_0x4b3783){if(_0x319f27){if(_0x4b3783){_0x2bed00=_0x4b3783;}}return require(_0xef9a('0x8a'))[_0xef9a('0xfc')]();})['then'](function(_0x44cade){if(_0x44cade){_0x2dcff2=_0x44cade[_0xef9a('0xfd')];_0x548dcd=_0x44cade[_0xef9a('0x8b')];}})['then'](function(){return db[_0xef9a('0xb7')][_0xef9a('0x27')]({'where':{'closed':![]}});})['then'](function(_0x1cff2f){_0x29c19d=_0x1cff2f;if(_0x2dcff2&&_0x1cff2f>_0x2dcff2){return db[_0xef9a('0xfe')][_0xef9a('0x79')]({'where':{'id':0x1}})[_0xef9a('0x18')](function(_0x241a3b){if(_0x241a3b){_0x241a3b['increment'](_0xef9a('0xff'));}});}})[_0xef9a('0x18')](function(){if(!_0x319f27[_0xef9a('0x3c')]||!_0x319f27['Interval']['Intervals'])return!![];return checkWebsiteIntervals(_0x319f27);})['then'](function(_0x1daf13){var _0x539bb0=fs['readFileSync'](path[_0xef9a('0x8d')](config[_0xef9a('0x8e')],_0xef9a('0x100')),_0xef9a('0x101'));var _0x1dfe7d=new url[(_0xef9a('0x102'))](_0x319f27[_0xef9a('0x103')])[_0xef9a('0x104')];var _0x4a9862=_0xef9a('0x105');var _0x370b34=![];var _0x3ecfdd={'chatVersion':_0x4a9862,'chatWebsiteAddressOrigin':_0x1dfe7d,'remote':_0x319f27[_0xef9a('0x106')],'query':querystring['stringify'](_[_0xef9a('0x63')](_0x319f27[_0xef9a('0x2c')]({'plain':!![]}),{'customerIp':_0x369268[_0xef9a('0x107')][_0xef9a('0x43')]||_0x369268[_0xef9a('0x107')][_0xef9a('0x108')]||_0x369268['connection'][_0xef9a('0x109')]||_0x369268['ip'],'referer':_0x369268['headers'][_0xef9a('0x48')],'openedInteractions':_0x29c19d,'maxInteractions':_0x2dcff2,'virtual':_0x548dcd['virtual'],'online':_0x1daf13,'custom':_0x548dcd}))[_0xef9a('0x10a')](/'/g,'\x5c\x27')};_0x4e3826[_0xef9a('0x30')](ejs[_0xef9a('0xd6')](Mustache[_0xef9a('0xd6')](_0x539bb0,_0x3ecfdd),{'proactiveActions':_0x2bed00,'alignment':_0x319f27['alignment'],'verticalAlignment':_0x319f27['verticalAlignment'],'div_color':_0x319f27[_0xef9a('0xfa')],'labelText':_0x319f27[_0xef9a('0x10b')],'text_color':_0x319f27[_0xef9a('0x10c')],'text_button_color':_0x319f27[_0xef9a('0x10d')],'button_color':_0x319f27['color_button'],'background_color':_0x319f27['backgroundColor'],'hideWhenOffline':_0x319f27[_0xef9a('0x10e')],'intervalId':_0x319f27['IntervalId'],'isDevelopment':_0x370b34,'chatVersion':_0x4a9862}));})[_0xef9a('0x21')](handleError(_0x4e3826,null));};exports[_0xef9a('0x10f')]=function(_0x2fb277,_0x283199){var _0x57946e=_0x2fb277[_0xef9a('0x68')]['id'];var _0x6e33f8=_0x2fb277[_0xef9a('0x76')];var _0x134f68=0xc8;var _0x5cbba7=null;return db[_0xef9a('0x110')]['transaction']({'isolationLevel':db[_0xef9a('0x110')]['Transaction'][_0xef9a('0x111')][_0xef9a('0x112')]},function(_0x4ac7b9){return db['ChatWebsite'][_0xef9a('0x79')]({'where':{'id':_0x57946e},'transaction':_0x4ac7b9})[_0xef9a('0x18')](function(_0x45cf6f){if(_0x45cf6f){return db['ChatApplication'][_0xef9a('0x2b')]({'where':{'ChatWebsiteId':_0x57946e},'transaction':_0x4ac7b9})[_0xef9a('0x18')](function(){var _0x27ec8c=_['map'](_0x6e33f8,function(_0x193dae){_0x193dae[_0xef9a('0x7b')]=_0x57946e;return _0x193dae;});return db[_0xef9a('0xac')][_0xef9a('0xdf')](_0x27ec8c,{'transaction':_0x4ac7b9});});}else{_0x134f68=0x194;_0x5cbba7=[];}});})['then'](function(){if(_0x134f68!==0x194){return db[_0xef9a('0xac')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x57946e},'order':_0xef9a('0xb1')})[_0xef9a('0x18')](function(_0xcc2d07){_0x5cbba7=_0xcc2d07;});}})[_0xef9a('0x21')](function(_0x47a9ec){_0x134f68=0x1f4;logger[_0xef9a('0x1c')](_0x47a9ec[_0xef9a('0x2e')]);if(_0x47a9ec[_0xef9a('0x2f')]){delete _0x47a9ec['name'];}_0x5cbba7=_0x47a9ec;})[_0xef9a('0x113')](function(){if(_0x5cbba7===null){_0x283199[_0xef9a('0x22')](_0x134f68);}else{if(_0x134f68===0x1f4){_0x283199[_0xef9a('0x23')](_0x134f68)['send'](_0x5cbba7);}else{_0x283199[_0xef9a('0x23')](_0x134f68)[_0xef9a('0x25')](_0x5cbba7);}}});};exports[_0xef9a('0x114')]=function(_0x2b925c,_0x427587){var _0x51ea32={};var _0x2c18d9={};var _0x3842d0;var _0x196879;return db[_0xef9a('0x53')][_0xef9a('0x79')]({'where':{'id':_0x2b925c[_0xef9a('0x68')]['id']}})[_0xef9a('0x18')](handleEntityNotFound(_0x427587,null))[_0xef9a('0x18')](function(_0x8badeb){if(_0x8badeb){_0x3842d0=_0x8badeb;_0x2c18d9[_0xef9a('0x59')]=_[_0xef9a('0x69')](db[_0xef9a('0xac')]['rawAttributes']);_0x2c18d9[_0xef9a('0x57')]=_[_0xef9a('0x69')](_0x2b925c[_0xef9a('0x57')]);_0x2c18d9[_0xef9a('0x61')]=_[_0xef9a('0x58')](_0x2c18d9[_0xef9a('0x59')],_0x2c18d9[_0xef9a('0x57')]);_0x51ea32[_0xef9a('0x5a')]=_['intersection'](_0x2c18d9[_0xef9a('0x59')],qs['fields'](_0x2b925c['query'][_0xef9a('0x5b')]));_0x51ea32['attributes']=_0x51ea32['attributes']['length']?_0x51ea32[_0xef9a('0x5a')]:_0x2c18d9[_0xef9a('0x59')];_0x51ea32['order']=qs[_0xef9a('0x5e')](_0x2b925c[_0xef9a('0x57')]['sort']);_0x51ea32[_0xef9a('0x5f')]=qs[_0xef9a('0x61')](_['pick'](_0x2b925c['query'],_0x2c18d9['filters']));if(_0x2b925c[_0xef9a('0x57')][_0xef9a('0x62')]){_0x51ea32[_0xef9a('0x5f')]=_[_0xef9a('0x63')](_0x51ea32[_0xef9a('0x5f')],{'$or':_[_0xef9a('0x52')](_0x51ea32['attributes'],function(_0x450b9d){var _0x4d8f9b={};_0x4d8f9b[_0x450b9d]={'$like':'%'+_0x2b925c[_0xef9a('0x57')][_0xef9a('0x62')]+'%'};return _0x4d8f9b;})});}_0x51ea32=_[_0xef9a('0x63')]({},_0x51ea32,_0x2b925c[_0xef9a('0x64')]);return _0x3842d0[_0xef9a('0x114')](_0x51ea32);}})[_0xef9a('0x18')](function(_0x119fdd){if(_0x119fdd){_0x196879=_0x119fdd[_0xef9a('0x6a')];if(!_0x2b925c['query'][_0xef9a('0x5c')](_0xef9a('0x7a'))){_0x51ea32[_0xef9a('0x5d')]=qs['limit'](_0x2b925c[_0xef9a('0x57')]['limit']);_0x51ea32[_0xef9a('0x28')]=qs[_0xef9a('0x28')](_0x2b925c[_0xef9a('0x57')]['offset']);}return _0x3842d0['getApplications'](_0x51ea32);}})['then'](function(_0x7f4348){if(_0x7f4348){return _0x7f4348?{'count':_0x196879,'rows':_0x7f4348}:null;}})['then'](respondWithResult(_0x427587,null))[_0xef9a('0x21')](handleError(_0x427587,null));};exports[_0xef9a('0x115')]=function(_0x2f7f5e,_0x221c41){return db[_0xef9a('0x116')][_0xef9a('0x6b')]({'where':{'id':_0x2f7f5e[_0xef9a('0x68')]['id']}})[_0xef9a('0x18')](handleEntityNotFound(_0x221c41,null))[_0xef9a('0x18')](function(_0x384267){if(_0x384267){return _0x384267[_0xef9a('0x115')](_0x2f7f5e['body']['ids'],_[_0xef9a('0x117')](_0x2f7f5e[_0xef9a('0x76')],['ids','id'])||{});}})[_0xef9a('0x18')](respondWithResult(_0x221c41,null))[_0xef9a('0x21')](handleError(_0x221c41,null));};exports['getProactiveActions']=function(_0x2f5fca,_0x466671){var _0x1d7fe6={};var _0x324f27={};var _0x40a6cc;var _0x408928;return db[_0xef9a('0x53')][_0xef9a('0x79')]({'where':{'id':_0x2f5fca[_0xef9a('0x68')]['id']}})[_0xef9a('0x18')](handleEntityNotFound(_0x466671,null))[_0xef9a('0x18')](function(_0x4fe22a){if(_0x4fe22a){_0x40a6cc=_0x4fe22a;_0x324f27['model']=_['keys'](db[_0xef9a('0x118')][_0xef9a('0x54')]);_0x324f27[_0xef9a('0x57')]=_[_0xef9a('0x69')](_0x2f5fca['query']);_0x324f27[_0xef9a('0x61')]=_[_0xef9a('0x58')](_0x324f27[_0xef9a('0x59')],_0x324f27['query']);_0x1d7fe6[_0xef9a('0x5a')]=_[_0xef9a('0x58')](_0x324f27[_0xef9a('0x59')],qs[_0xef9a('0x5b')](_0x2f5fca['query'][_0xef9a('0x5b')]));_0x1d7fe6[_0xef9a('0x5a')]=_0x1d7fe6[_0xef9a('0x5a')][_0xef9a('0x6a')]?_0x1d7fe6[_0xef9a('0x5a')]:_0x324f27[_0xef9a('0x59')];_0x1d7fe6[_0xef9a('0xf5')]=qs[_0xef9a('0x5e')](_0x2f5fca[_0xef9a('0x57')][_0xef9a('0x5e')]);_0x1d7fe6[_0xef9a('0x5f')]=qs[_0xef9a('0x61')](_[_0xef9a('0x60')](_0x2f5fca[_0xef9a('0x57')],_0x324f27[_0xef9a('0x61')]));if(_0x2f5fca[_0xef9a('0x57')][_0xef9a('0x62')]){_0x1d7fe6['where']=_[_0xef9a('0x63')](_0x1d7fe6[_0xef9a('0x5f')],{'$or':_['map'](_0x1d7fe6['attributes'],function(_0x3587ec){var _0x41e5f0={};_0x41e5f0[_0x3587ec]={'$like':'%'+_0x2f5fca[_0xef9a('0x57')]['filter']+'%'};return _0x41e5f0;})});}_0x1d7fe6=_['merge']({},_0x1d7fe6,_0x2f5fca[_0xef9a('0x64')]);return _0x40a6cc[_0xef9a('0x119')](_0x1d7fe6);}})[_0xef9a('0x18')](function(_0x4de82d){if(_0x4de82d){_0x408928=_0x4de82d['length'];if(!_0x2f5fca[_0xef9a('0x57')][_0xef9a('0x5c')](_0xef9a('0x7a'))){_0x1d7fe6[_0xef9a('0x5d')]=qs[_0xef9a('0x5d')](_0x2f5fca[_0xef9a('0x57')][_0xef9a('0x5d')]);_0x1d7fe6['offset']=qs['offset'](_0x2f5fca[_0xef9a('0x57')][_0xef9a('0x28')]);}return _0x40a6cc[_0xef9a('0x119')](_0x1d7fe6);}})[_0xef9a('0x18')](function(_0x1fe7e2){if(_0x1fe7e2){return _0x1fe7e2?{'count':_0x408928,'rows':_0x1fe7e2}:null;}})[_0xef9a('0x18')](respondWithResult(_0x466671,null))[_0xef9a('0x21')](handleError(_0x466671,null));};exports[_0xef9a('0x11a')]=function(_0x16e549,_0x268415){var _0x6b34a5=_0x16e549[_0xef9a('0x57')][_0xef9a('0x11b')]===_0xef9a('0x11c')?'offlineForm':_0xef9a('0x11d');return db[_0xef9a('0x53')]['find']({'attributes':['id',_0x6b34a5],'where':{'id':_0x16e549[_0xef9a('0x68')]['id']}})[_0xef9a('0x18')](handleEntityNotFound(_0x268415,null))[_0xef9a('0x18')](function(_0x4c54ca){if(_0x4c54ca){var _0x8f8c85=_0x4c54ca[_0x6b34a5];var _0x38d3e9=_0x8f8c85&&_0x8f8c85[_0xef9a('0x11e')]?_0x8f8c85[_0xef9a('0x11e')]:[];_0x268415[_0xef9a('0x30')]({'fromKey':_[_0xef9a('0x8c')](_0x8f8c85['fromKey'])?undefined:_0x8f8c85[_0xef9a('0x11f')],'count':_0x38d3e9['length'],'rows':_0x38d3e9});}})[_0xef9a('0x21')](handleError(_0x268415,null));};exports['getOfflineMessages']=function(_0x19d0e7,_0x28b56f){var _0x2d86d4={'raw':![],'where':{}};var _0x11a5ef={};var _0x38a9ce={'count':0x0,'rows':[]};return db[_0xef9a('0x53')][_0xef9a('0x79')]({'where':{'id':_0x19d0e7[_0xef9a('0x68')]['id']}})[_0xef9a('0x18')](handleEntityNotFound(_0x28b56f,null))[_0xef9a('0x18')](function(_0x2052e4){if(_0x2052e4){_0x11a5ef[_0xef9a('0x59')]=_['keys'](db[_0xef9a('0xd8')][_0xef9a('0x54')]);_0x11a5ef['query']=_[_0xef9a('0x69')](_0x19d0e7['query']);_0x11a5ef[_0xef9a('0x61')]=_[_0xef9a('0x58')](_0x11a5ef['model'],_0x11a5ef[_0xef9a('0x57')]);_0x2d86d4[_0xef9a('0x5a')]=_[_0xef9a('0x58')](_0x11a5ef[_0xef9a('0x59')],qs[_0xef9a('0x5b')](_0x19d0e7[_0xef9a('0x57')]['fields']));_0x2d86d4[_0xef9a('0x5a')]=_0x2d86d4['attributes'][_0xef9a('0x6a')]?_0x2d86d4[_0xef9a('0x5a')]:_0x11a5ef['model'];if(!_0x19d0e7[_0xef9a('0x57')][_0xef9a('0x5c')](_0xef9a('0x7a'))){_0x2d86d4[_0xef9a('0x5d')]=qs[_0xef9a('0x5d')](_0x19d0e7[_0xef9a('0x57')][_0xef9a('0x5d')]);_0x2d86d4[_0xef9a('0x28')]=qs['offset'](_0x19d0e7['query']['offset']);}_0x2d86d4['order']=qs['sort'](_0x19d0e7[_0xef9a('0x57')][_0xef9a('0x5e')]);_0x2d86d4[_0xef9a('0x5f')]=qs['filters'](_['pick'](_0x19d0e7[_0xef9a('0x57')],_0x11a5ef[_0xef9a('0x61')]));_0x2d86d4[_0xef9a('0x5f')]['ChatWebsiteId']=_0x2052e4['id'];if(_0x19d0e7[_0xef9a('0x57')][_0xef9a('0x62')]){_0x2d86d4[_0xef9a('0x5f')]=_[_0xef9a('0x63')](_0x2d86d4[_0xef9a('0x5f')],{'$or':_[_0xef9a('0x52')](_0x2d86d4['attributes'],function(_0x50ac60){var _0x347ed0={};_0x347ed0[_0x50ac60]={'$like':'%'+_0x19d0e7[_0xef9a('0x57')]['filter']+'%'};return _0x347ed0;})});}_0x2d86d4=_['merge']({},_0x2d86d4,_0x19d0e7['options']);return db[_0xef9a('0xd8')][_0xef9a('0x27')]({'where':_0x2d86d4[_0xef9a('0x5f')]})[_0xef9a('0x18')](function(_0x19a6a0){_0x38a9ce[_0xef9a('0x27')]=_0x19a6a0;if(_0x19d0e7[_0xef9a('0x57')][_0xef9a('0x65')]){_0x2d86d4[_0xef9a('0x66')]=[{'all':!![]}];}else{_0x2d86d4[_0xef9a('0x66')]=[{'model':db[_0xef9a('0x9a')],'as':_0xef9a('0x120'),'required':![]},{'model':db[_0xef9a('0xde')],'as':'Attachments','required':![]}];}return db[_0xef9a('0xd8')][_0xef9a('0x7c')](_0x2d86d4);})[_0xef9a('0x18')](function(_0x17c0d3){_0x38a9ce[_0xef9a('0x67')]=_0x17c0d3;return _0x38a9ce;});}})['then'](respondWithFilteredResult(_0x28b56f,_0x2d86d4))['catch'](handleError(_0x28b56f,null));};exports[_0xef9a('0x121')]=function(_0x119f0b,_0x1672bc){return db[_0xef9a('0x53')][_0xef9a('0x6b')]({'where':{'id':_0x119f0b['params']['id']}})[_0xef9a('0x18')](handleEntityNotFound(_0x1672bc,null))['then'](function(_0x379c4a){if(_0x379c4a){return _0x379c4a[_0xef9a('0x121')](_0x119f0b[_0xef9a('0x76')][_0xef9a('0x81')],_['omit'](_0x119f0b[_0xef9a('0x76')],[_0xef9a('0x81'),'id'])||{})['spread'](function(_0x1613bf){for(var _0x355738=0x0;_0x355738<_0x119f0b[_0xef9a('0x76')][_0xef9a('0x81')][_0xef9a('0x6a')];_0x355738+=0x1){socket['emit'](_0xef9a('0x122'),{'UserId':Number(_0x119f0b[_0xef9a('0x76')][_0xef9a('0x81')][_0x355738]),'ChatWebsiteId':Number(_0x119f0b['params']['id'])});}return _0x1613bf;});}})[_0xef9a('0x18')](respondWithResult(_0x1672bc,null))[_0xef9a('0x21')](handleError(_0x1672bc,null));};exports['removeAgents']=function(_0x2f8f4e,_0x3e9808){return db[_0xef9a('0x53')]['find']({'where':{'id':_0x2f8f4e[_0xef9a('0x68')]['id']}})[_0xef9a('0x18')](handleEntityNotFound(_0x3e9808,null))[_0xef9a('0x18')](function(_0x136eba){if(_0x136eba){return _0x136eba[_0xef9a('0x123')](_0x2f8f4e[_0xef9a('0x57')][_0xef9a('0x81')])[_0xef9a('0x18')](function(){if(_[_0xef9a('0x124')](_0x2f8f4e['query'][_0xef9a('0x81')])){for(var _0x480723=0x0;_0x480723<_0x2f8f4e[_0xef9a('0x57')][_0xef9a('0x81')]['length'];_0x480723+=0x1){socket[_0xef9a('0x125')](_0xef9a('0x126'),{'UserId':Number(_0x2f8f4e[_0xef9a('0x57')][_0xef9a('0x81')][_0x480723]),'ChatWebsiteId':Number(_0x2f8f4e[_0xef9a('0x68')]['id'])});}}else{socket[_0xef9a('0x125')](_0xef9a('0x126'),{'UserId':Number(_0x2f8f4e[_0xef9a('0x57')][_0xef9a('0x81')]),'ChatWebsiteId':Number(_0x2f8f4e[_0xef9a('0x68')]['id'])});}});}})[_0xef9a('0x18')](respondWithStatusCode(_0x3e9808,null))[_0xef9a('0x21')](handleError(_0x3e9808,null));};exports[_0xef9a('0x127')]=function(_0x4025f4,_0x1fe2d5){var _0x2773a0={};var _0x186ec9={};var _0x5dd7f1;var _0x1fd9a8;return db[_0xef9a('0x53')]['findOne']({'where':{'id':_0x4025f4['params']['id']}})[_0xef9a('0x18')](handleEntityNotFound(_0x1fe2d5,null))[_0xef9a('0x18')](function(_0x77fc1a){if(_0x77fc1a){_0x5dd7f1=_0x77fc1a;_0x186ec9[_0xef9a('0x59')]=_[_0xef9a('0x69')](db[_0xef9a('0xc3')]['rawAttributes']);_0x186ec9['query']=_[_0xef9a('0x69')](_0x4025f4[_0xef9a('0x57')]);_0x186ec9[_0xef9a('0x61')]=_['intersection'](_0x186ec9[_0xef9a('0x59')],_0x186ec9[_0xef9a('0x57')]);_0x2773a0[_0xef9a('0x5a')]=_[_0xef9a('0x58')](_0x186ec9['model'],qs[_0xef9a('0x5b')](_0x4025f4[_0xef9a('0x57')]['fields']));_0x2773a0[_0xef9a('0x5a')]=_0x2773a0[_0xef9a('0x5a')]['length']?_0x2773a0[_0xef9a('0x5a')]:_0x186ec9[_0xef9a('0x59')];_0x2773a0[_0xef9a('0xf5')]=qs[_0xef9a('0x5e')](_0x4025f4['query'][_0xef9a('0x5e')]);_0x2773a0[_0xef9a('0x5f')]=qs[_0xef9a('0x61')](_[_0xef9a('0x60')](_0x4025f4[_0xef9a('0x57')],_0x186ec9[_0xef9a('0x61')]));if(_0x4025f4['query'][_0xef9a('0x62')]){_0x2773a0[_0xef9a('0x5f')]=_[_0xef9a('0x63')](_0x2773a0[_0xef9a('0x5f')],{'$or':_[_0xef9a('0x52')](_0x2773a0[_0xef9a('0x5a')],function(_0x366463){var _0x579605={};_0x579605[_0x366463]={'$like':'%'+_0x4025f4[_0xef9a('0x57')]['filter']+'%'};return _0x579605;})});}_0x2773a0=_[_0xef9a('0x63')]({},_0x2773a0,_0x4025f4['options']);return _0x5dd7f1[_0xef9a('0x127')](_0x2773a0);}})[_0xef9a('0x18')](function(_0x213153){if(_0x213153){_0x1fd9a8=_0x213153['length'];if(!_0x4025f4['query'][_0xef9a('0x5c')](_0xef9a('0x7a'))){_0x2773a0['limit']=qs['limit'](_0x4025f4['query'][_0xef9a('0x5d')]);_0x2773a0[_0xef9a('0x28')]=qs[_0xef9a('0x28')](_0x4025f4[_0xef9a('0x57')][_0xef9a('0x28')]);}return _0x5dd7f1['getAgents'](_0x2773a0);}})[_0xef9a('0x18')](function(_0x55b55d){if(_0x55b55d){return _0x55b55d?{'count':_0x1fd9a8,'rows':_0x55b55d}:null;}})[_0xef9a('0x18')](respondWithResult(_0x1fe2d5,null))['catch'](handleError(_0x1fe2d5,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index a3a0fbe..ce30580 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 _0xc090=['update','remove','emit','hook','events','../../mysqldb','ChatWebsite','setMaxListeners','save'];(function(_0x2f20e1,_0x9b9fad){var _0xc2a856=function(_0x1307a5){while(--_0x1307a5){_0x2f20e1['push'](_0x2f20e1['shift']());}};_0xc2a856(++_0x9b9fad);}(_0xc090,0x112));var _0x0c09=function(_0xa7597,_0x8edd65){_0xa7597=_0xa7597-0x0;var _0x25d273=_0xc090[_0xa7597];return _0x25d273;};'use strict';var EventEmitter=require(_0x0c09('0x0'));var ChatWebsite=require(_0x0c09('0x1'))['db'][_0x0c09('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x0c09('0x3')](0x0);var events={'afterCreate':_0x0c09('0x4'),'afterUpdate':_0x0c09('0x5'),'afterDestroy':_0x0c09('0x6')};function emitEvent(_0x260c36){return function(_0x11984f,_0x487f03,_0x2e968b){ChatWebsiteEvents[_0x0c09('0x7')](_0x260c36+':'+_0x11984f['id'],_0x11984f);ChatWebsiteEvents['emit'](_0x260c36,_0x11984f);_0x2e968b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x0c09('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0x4fde=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','update'];(function(_0x43afbb,_0x448109){var _0xa9ddec=function(_0x4e965f){while(--_0x4e965f){_0x43afbb['push'](_0x43afbb['shift']());}};_0xa9ddec(++_0x448109);}(_0x4fde,0x19f));var _0xe4fd=function(_0x5be7aa,_0x5de661){_0x5be7aa=_0x5be7aa-0x0;var _0x215408=_0x4fde[_0x5be7aa];return _0x215408;};'use strict';var EventEmitter=require(_0xe4fd('0x0'));var ChatWebsite=require(_0xe4fd('0x1'))['db'][_0xe4fd('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xe4fd('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe4fd('0x4'),'afterDestroy':_0xe4fd('0x5')};function emitEvent(_0x4bf61e){return function(_0x36d49f,_0x3c4c49,_0x8b810a){ChatWebsiteEvents[_0xe4fd('0x6')](_0x4bf61e+':'+_0x36d49f['id'],_0x36d49f);ChatWebsiteEvents[_0xe4fd('0x6')](_0x4bf61e,_0x36d49f);_0x8b810a(null);};}for(var e in events){if(events[_0xe4fd('0x7')](e)){var event=events[e];ChatWebsite[_0xe4fd('0x8')](e,emitEvent(event));}}module[_0xe4fd('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 2a41408..dd9a231 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 _0x3f68=['chat_websites','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','define'];(function(_0x223d84,_0x1db87b){var _0x3ae043=function(_0x3a78b7){while(--_0x3a78b7){_0x223d84['push'](_0x223d84['shift']());}};_0x3ae043(++_0x1db87b);}(_0x3f68,0x1d5));var _0x83f6=function(_0x4785fc,_0x216a89){_0x4785fc=_0x4785fc-0x0;var _0x363332=_0x3f68[_0x4785fc];return _0x363332;};'use strict';var _=require(_0x83f6('0x0'));var util=require(_0x83f6('0x1'));var logger=require('../../config/logger')(_0x83f6('0x2'));var moment=require(_0x83f6('0x3'));var BPromise=require(_0x83f6('0x4'));var rp=require(_0x83f6('0x5'));var fs=require('fs');var path=require(_0x83f6('0x6'));var rimraf=require(_0x83f6('0x7'));var config=require('../../config/environment');var attributes=require(_0x83f6('0x8'));module[_0x83f6('0x9')]=function(_0x5af2b1,_0xdaf088){return _0x5af2b1[_0x83f6('0xa')]('ChatWebsite',attributes,{'tableName':_0x83f6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5c65=['moment','bluebird','request-promise','rimraf','exports','define','ChatWebsite','lodash','util','../../config/logger'];(function(_0x4586f9,_0x39aee8){var _0x41d034=function(_0x31002c){while(--_0x31002c){_0x4586f9['push'](_0x4586f9['shift']());}};_0x41d034(++_0x39aee8);}(_0x5c65,0xb1));var _0x55c6=function(_0x528c42,_0x596eb4){_0x528c42=_0x528c42-0x0;var _0x607b50=_0x5c65[_0x528c42];return _0x607b50;};'use strict';var _=require(_0x55c6('0x0'));var util=require(_0x55c6('0x1'));var logger=require(_0x55c6('0x2'))('api');var moment=require(_0x55c6('0x3'));var BPromise=require(_0x55c6('0x4'));var rp=require(_0x55c6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x55c6('0x6'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0x55c6('0x7')]=function(_0x5c01cf,_0x10a484){return _0x5c01cf[_0x55c6('0x8')](_0x55c6('0x9'),attributes,{'tableName':'chat_websites','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 9c0c77c..adf0e0b 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 _0x459e=['info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request'];(function(_0x2593ea,_0xff1577){var _0x49e40e=function(_0x48607b){while(--_0x48607b){_0x2593ea['push'](_0x2593ea['shift']());}};_0x49e40e(++_0xff1577);}(_0x459e,0x183));var _0xe459=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x459e[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xe459('0x0'));var util=require(_0xe459('0x1'));var moment=require(_0xe459('0x2'));var BPromise=require(_0xe459('0x3'));var rs=require(_0xe459('0x4'));var fs=require('fs');var Redis=require(_0xe459('0x5'));var db=require(_0xe459('0x6'))['db'];var utils=require(_0xe459('0x7'));var logger=require(_0xe459('0x8'))('rpc');var config=require(_0xe459('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe459('0xa')][_0xe459('0xb')]({'port':0x232a});config[_0xe459('0xc')]=_[_0xe459('0xd')](config[_0xe459('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xe459('0xe'))(new Redis(config[_0xe459('0xc')]));require(_0xe459('0xf'))[_0xe459('0x10')](socket);function respondWithRpcPromise(_0x55e5fe,_0x556927,_0x25f803){return new BPromise(function(_0x2f856c,_0x3bc3bc){return client[_0xe459('0x11')](_0x55e5fe,_0x25f803)['then'](function(_0x436759){logger[_0xe459('0x12')](_0xe459('0x13'),_0x556927,_0xe459('0x14'));logger[_0xe459('0x15')](_0xe459('0x16'),_0x556927,'request\x20sent',JSON[_0xe459('0x17')](_0x436759));if(_0x436759[_0xe459('0x18')]){if(_0x436759[_0xe459('0x18')][_0xe459('0x19')]===0x1f4){logger[_0xe459('0x18')](_0xe459('0x13'),_0x556927,_0x436759['error']['message']);return _0x3bc3bc(_0x436759['error'][_0xe459('0x1a')]);}logger[_0xe459('0x18')](_0xe459('0x13'),_0x556927,_0x436759['error'][_0xe459('0x1a')]);return _0x2f856c(_0x436759['error'][_0xe459('0x1a')]);}else{logger[_0xe459('0x12')](_0xe459('0x13'),_0x556927,_0xe459('0x14'));_0x2f856c(_0x436759['result'][_0xe459('0x1a')]);}})['catch'](function(_0x5d4b8d){logger[_0xe459('0x18')](_0xe459('0x13'),_0x556927,_0x5d4b8d);_0x3bc3bc(_0x5d4b8d);});});}
\ No newline at end of file
+var _0x581d=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','then','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch'];(function(_0xaf803f,_0x22b3f6){var _0x40669f=function(_0x57aa19){while(--_0x57aa19){_0xaf803f['push'](_0xaf803f['shift']());}};_0x40669f(++_0x22b3f6);}(_0x581d,0xa8));var _0xd581=function(_0x80a3c,_0x24c35a){_0x80a3c=_0x80a3c-0x0;var _0x41b3bf=_0x581d[_0x80a3c];return _0x41b3bf;};'use strict';var _=require(_0xd581('0x0'));var util=require(_0xd581('0x1'));var moment=require(_0xd581('0x2'));var BPromise=require(_0xd581('0x3'));var rs=require(_0xd581('0x4'));var fs=require('fs');var Redis=require(_0xd581('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd581('0x6'));var logger=require(_0xd581('0x7'))(_0xd581('0x8'));var config=require(_0xd581('0x9'));var jayson=require(_0xd581('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xd581('0xb')]=_[_0xd581('0xc')](config[_0xd581('0xb')],{'host':_0xd581('0xd'),'port':0x18eb});var socket=require(_0xd581('0xe'))(new Redis(config[_0xd581('0xb')]));require(_0xd581('0xf'))[_0xd581('0x10')](socket);function respondWithRpcPromise(_0x3f5fe5,_0xd3a3b4,_0x23497f){return new BPromise(function(_0x5dcc88,_0x2c5d9d){return client['request'](_0x3f5fe5,_0x23497f)[_0xd581('0x11')](function(_0x565ab8){logger['info'](_0xd581('0x12'),_0xd3a3b4,'request\x20sent');logger[_0xd581('0x13')](_0xd581('0x14'),_0xd3a3b4,_0xd581('0x15'),JSON[_0xd581('0x16')](_0x565ab8));if(_0x565ab8[_0xd581('0x17')]){if(_0x565ab8['error'][_0xd581('0x18')]===0x1f4){logger['error'](_0xd581('0x12'),_0xd3a3b4,_0x565ab8[_0xd581('0x17')]['message']);return _0x2c5d9d(_0x565ab8['error'][_0xd581('0x19')]);}logger['error'](_0xd581('0x12'),_0xd3a3b4,_0x565ab8[_0xd581('0x17')][_0xd581('0x19')]);return _0x5dcc88(_0x565ab8[_0xd581('0x17')][_0xd581('0x19')]);}else{logger[_0xd581('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0xd3a3b4,_0xd581('0x15'));_0x5dcc88(_0x565ab8['result'][_0xd581('0x19')]);}})[_0xd581('0x1b')](function(_0x217553){logger[_0xd581('0x17')]('ChatWebsite,\x20%s,\x20%s',_0xd3a3b4,_0x217553);_0x2c5d9d(_0x217553);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 2f516f3..b2392f5 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 _0xba6f=['./chatWebsite.events','save','emit','register','chatWebsite:'];(function(_0x1b49ba,_0x3533f7){var _0x490b2a=function(_0x54f4a1){while(--_0x54f4a1){_0x1b49ba['push'](_0x1b49ba['shift']());}};_0x490b2a(++_0x3533f7);}(_0xba6f,0x73));var _0xfba6=function(_0x51fd25,_0x2fcbb){_0x51fd25=_0x51fd25-0x0;var _0x4529ae=_0xba6f[_0x51fd25];return _0x4529ae;};'use strict';var ChatWebsiteEvents=require(_0xfba6('0x0'));var events=[_0xfba6('0x1'),'remove','update'];function createListener(_0x9e3004,_0x29d888){return function(_0x1ef3cd){_0x29d888[_0xfba6('0x2')](_0x9e3004,_0x1ef3cd);};}function removeListener(_0x54b38e,_0x401bb9){return function(){ChatWebsiteEvents['removeListener'](_0x54b38e,_0x401bb9);};}exports[_0xfba6('0x3')]=function(_0x5ad294){for(var _0x455a4d=0x0,_0x48463f=events['length'];_0x455a4d<_0x48463f;_0x455a4d++){var _0x2166c9=events[_0x455a4d];var _0x5a68cc=createListener(_0xfba6('0x4')+_0x2166c9,_0x5ad294);ChatWebsiteEvents['on'](_0x2166c9,_0x5a68cc);}};
\ No newline at end of file
+var _0x4b05=['removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove','update','emit'];(function(_0x73f378,_0x550420){var _0x57db43=function(_0xdecd43){while(--_0xdecd43){_0x73f378['push'](_0x73f378['shift']());}};_0x57db43(++_0x550420);}(_0x4b05,0x1e1));var _0x54b0=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4b05[_0x122ef9];return _0x42fba0;};'use strict';var ChatWebsiteEvents=require(_0x54b0('0x0'));var events=[_0x54b0('0x1'),_0x54b0('0x2'),_0x54b0('0x3')];function createListener(_0x6c4a55,_0x276028){return function(_0x2aabb7){_0x276028[_0x54b0('0x4')](_0x6c4a55,_0x2aabb7);};}function removeListener(_0x412cbd,_0xe8132e){return function(){ChatWebsiteEvents[_0x54b0('0x5')](_0x412cbd,_0xe8132e);};}exports[_0x54b0('0x6')]=function(_0x39b968){for(var _0x5cbae1=0x0,_0x332243=events[_0x54b0('0x7')];_0x5cbae1<_0x332243;_0x5cbae1++){var _0x1b6653=events[_0x5cbae1];var _0x5e72fd=createListener(_0x54b0('0x8')+_0x1b6653,_0x39b968);ChatWebsiteEvents['on'](_0x1b6653,_0x5e72fd);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index b255003..b969ae3 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 _0xef04=['../../components/interaction/service','isAuthenticated','index','/describe','describe','get','/:id','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','/:id/snippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/users','getAgents','post','create','/:id/dispositions','diskStorage','join','format','%s-%s','now','originalname','single','addLogo','root','file','addAvatar','addCustomerAvatar','server/files/images/avatars/','addSystemAvatar','notify','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','/:id/applications','addApplications','addProactiveActions','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xef04,0x111));var _0x4ef0=function(_0x38c121,_0x29c927){_0x38c121=_0x38c121-0x0;var _0x21c1f5=_0xef04[_0x38c121];return _0x21c1f5;};'use strict';var multer=require(_0x4ef0('0x0'));var util=require('util');var path=require(_0x4ef0('0x1'));var timeout=require(_0x4ef0('0x2'));var express=require(_0x4ef0('0x3'));var router=express[_0x4ef0('0x4')]();var fs_extra=require(_0x4ef0('0x5'));var auth=require(_0x4ef0('0x6'));var interaction=require(_0x4ef0('0x7'));var config=require('../../config/environment');var controller=require('./chatWebsite.controller');router['get']('/',auth[_0x4ef0('0x8')](),controller[_0x4ef0('0x9')]);router['get'](_0x4ef0('0xa'),auth[_0x4ef0('0x8')](),controller[_0x4ef0('0xb')]);router[_0x4ef0('0xc')](_0x4ef0('0xd'),auth[_0x4ef0('0x8')](),controller['show']);router['get']('/:id/dispositions',auth[_0x4ef0('0x8')](),controller['getDispositions']);router[_0x4ef0('0xc')](_0x4ef0('0xe'),auth['isAuthenticated'](),controller[_0x4ef0('0xf')]);router['get'](_0x4ef0('0x10'),controller[_0x4ef0('0x11')]);router[_0x4ef0('0xc')](_0x4ef0('0x12'),controller[_0x4ef0('0x13')]);router['get'](_0x4ef0('0x14'),controller[_0x4ef0('0x15')]);router[_0x4ef0('0xc')](_0x4ef0('0x16'),controller['getSystemAvatar']);router[_0x4ef0('0xc')](_0x4ef0('0x17'),auth[_0x4ef0('0x8')](),controller['getInteractions']);router[_0x4ef0('0xc')](_0x4ef0('0x18'),controller['getSnippet']);router[_0x4ef0('0xc')]('/:id/applications',auth[_0x4ef0('0x8')](),controller[_0x4ef0('0x19')]);router[_0x4ef0('0xc')](_0x4ef0('0x1a'),auth[_0x4ef0('0x8')](),controller[_0x4ef0('0x1b')]);router[_0x4ef0('0xc')](_0x4ef0('0x1c'),controller[_0x4ef0('0x1d')]);router['get']('/:id/offline_messages',auth[_0x4ef0('0x8')](),controller['getOfflineMessages']);router[_0x4ef0('0xc')](_0x4ef0('0x1e'),auth[_0x4ef0('0x8')](),controller[_0x4ef0('0x1f')]);router[_0x4ef0('0x20')]('/',auth[_0x4ef0('0x8')](),controller[_0x4ef0('0x21')]);router['post'](_0x4ef0('0x22'),auth[_0x4ef0('0x8')](),controller['addDisposition']);router[_0x4ef0('0x20')](_0x4ef0('0xe'),auth[_0x4ef0('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x4ef0('0x23')]({'destination':function(_0x2a6333,_0x561e51,_0x39f5b2){_0x39f5b2(null,path[_0x4ef0('0x24')](config['root'],'server/files/images/logos/'));},'filename':function(_0x5f5cf5,_0xcfefe5,_0x518299){_0x518299(null,util[_0x4ef0('0x25')](_0x4ef0('0x26'),Date[_0x4ef0('0x27')](),_0xcfefe5[_0x4ef0('0x28')]));}})});router[_0x4ef0('0x20')](_0x4ef0('0x10'),upload[_0x4ef0('0x29')]('file'),controller[_0x4ef0('0x2a')]);var upload=multer({'storage':multer[_0x4ef0('0x23')]({'destination':function(_0x1132a8,_0x272497,_0x1b66b2){_0x1b66b2(null,path['join'](config[_0x4ef0('0x2b')],'server/files/images/avatars/'));},'filename':function(_0x4445bf,_0x513d6b,_0x1fe5ca){_0x1fe5ca(null,util[_0x4ef0('0x25')](_0x4ef0('0x26'),Date[_0x4ef0('0x27')](),_0x513d6b[_0x4ef0('0x28')]));}})});router[_0x4ef0('0x20')]('/:id/avatar',upload[_0x4ef0('0x29')](_0x4ef0('0x2c')),controller[_0x4ef0('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x9e2798,_0x472395,_0x41fbeb){_0x41fbeb(null,path[_0x4ef0('0x24')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x1f722b,_0x429c58,_0x3a6d9e){_0x3a6d9e(null,util[_0x4ef0('0x25')](_0x4ef0('0x26'),Date[_0x4ef0('0x27')](),_0x429c58[_0x4ef0('0x28')]));}})});router[_0x4ef0('0x20')](_0x4ef0('0x14'),upload[_0x4ef0('0x29')](_0x4ef0('0x2c')),controller[_0x4ef0('0x2e')]);var upload=multer({'storage':multer[_0x4ef0('0x23')]({'destination':function(_0x1c811e,_0x412da5,_0x3f9b8a){_0x3f9b8a(null,path[_0x4ef0('0x24')](config[_0x4ef0('0x2b')],_0x4ef0('0x2f')));},'filename':function(_0x4529d3,_0x1e73fe,_0x318b55){_0x318b55(null,util['format'](_0x4ef0('0x26'),Date['now'](),_0x1e73fe[_0x4ef0('0x28')]));}})});router[_0x4ef0('0x20')](_0x4ef0('0x16'),upload[_0x4ef0('0x29')](_0x4ef0('0x2c')),controller[_0x4ef0('0x30')]);router['post']('/:id/notify',controller[_0x4ef0('0x31')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x1c6a7b,_0x25bf8a,_0x591773){const _0x164f38=path[_0x4ef0('0x24')](config[_0x4ef0('0x2b')],'server/files','attachments',_0x4ef0('0x32'));fs_extra[_0x4ef0('0x33')](_0x164f38,function(){_0x591773(null,_0x164f38);});},'filename':function(_0x5a7a2c,_0xfa322c,_0x42fc50){const _0x32c42f=_0xfa322c[_0x4ef0('0x28')][_0x4ef0('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x30c468=path[_0x4ef0('0x35')](_0x32c42f);const _0x2a1d1c=Date[_0x4ef0('0x27')]()+'-'+_0x32c42f[_0x4ef0('0x34')](_0x30c468,'')+_0x30c468;_0x42fc50(null,_0x2a1d1c);}})});router[_0x4ef0('0x20')](_0x4ef0('0x36'),offlineUploadMulter[_0x4ef0('0x37')](),controller[_0x4ef0('0x38')]);router[_0x4ef0('0x20')](_0x4ef0('0x17'),auth[_0x4ef0('0x8')](),controller[_0x4ef0('0x39')]);router['post'](_0x4ef0('0x3a'),auth['isAuthenticated'](),controller[_0x4ef0('0x3b')]);router[_0x4ef0('0x20')](_0x4ef0('0x1a'),auth[_0x4ef0('0x8')](),controller[_0x4ef0('0x3c')]);router['post'](_0x4ef0('0x1e'),auth[_0x4ef0('0x8')](),controller[_0x4ef0('0x3d')]);router[_0x4ef0('0x3e')]('/:id',auth[_0x4ef0('0x8')](),controller[_0x4ef0('0x3f')]);router['delete'](_0x4ef0('0xd'),auth[_0x4ef0('0x8')](),controller[_0x4ef0('0x40')]);router[_0x4ef0('0x41')](_0x4ef0('0x22'),auth['isAuthenticated'](),controller[_0x4ef0('0x42')]);router['delete'](_0x4ef0('0xe'),auth[_0x4ef0('0x8')](),controller[_0x4ef0('0x43')]);router[_0x4ef0('0x41')](_0x4ef0('0x1e'),auth[_0x4ef0('0x8')](),controller[_0x4ef0('0x44')]);module[_0x4ef0('0x45')]=router;
\ No newline at end of file
+var _0x8167=['file','addLogo','server/files/images/avatars/','single','addAvatar','format','addCustomerAvatar','addSystemAvatar','notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','any','offline','/:id/interactions','addInteraction','addApplications','/:id/proactive_actions','update','delete','destroy','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','getFields','/:id/offline_messages','/:id/users','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','%s-%s','now','originalname','/:id/logo'];(function(_0x573f5b,_0x3b1368){var _0x4118ca=function(_0x3b5600){while(--_0x3b5600){_0x573f5b['push'](_0x573f5b['shift']());}};_0x4118ca(++_0x3b1368);}(_0x8167,0x136));var _0x7816=function(_0x2c6106,_0x24820c){_0x2c6106=_0x2c6106-0x0;var _0x446d8a=_0x8167[_0x2c6106];return _0x446d8a;};'use strict';var multer=require(_0x7816('0x0'));var util=require(_0x7816('0x1'));var path=require(_0x7816('0x2'));var timeout=require(_0x7816('0x3'));var express=require(_0x7816('0x4'));var router=express[_0x7816('0x5')]();var fs_extra=require(_0x7816('0x6'));var auth=require(_0x7816('0x7'));var interaction=require(_0x7816('0x8'));var config=require(_0x7816('0x9'));var controller=require('./chatWebsite.controller');router[_0x7816('0xa')]('/',auth['isAuthenticated'](),controller[_0x7816('0xb')]);router[_0x7816('0xa')](_0x7816('0xc'),auth['isAuthenticated'](),controller[_0x7816('0xd')]);router['get'](_0x7816('0xe'),auth[_0x7816('0xf')](),controller['show']);router[_0x7816('0xa')](_0x7816('0x10'),auth[_0x7816('0xf')](),controller[_0x7816('0x11')]);router[_0x7816('0xa')](_0x7816('0x12'),auth[_0x7816('0xf')](),controller['getAnswers']);router[_0x7816('0xa')]('/:id/logo',controller['getLogo']);router[_0x7816('0xa')](_0x7816('0x13'),controller['getAvatar']);router[_0x7816('0xa')](_0x7816('0x14'),controller[_0x7816('0x15')]);router[_0x7816('0xa')](_0x7816('0x16'),controller[_0x7816('0x17')]);router[_0x7816('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x7816('0x18')]);router[_0x7816('0xa')](_0x7816('0x19'),controller[_0x7816('0x1a')]);router[_0x7816('0xa')](_0x7816('0x1b'),auth[_0x7816('0xf')](),controller[_0x7816('0x1c')]);router[_0x7816('0xa')]('/:id/proactive_actions',auth[_0x7816('0xf')](),controller[_0x7816('0x1d')]);router[_0x7816('0xa')]('/:id/fields',controller[_0x7816('0x1e')]);router[_0x7816('0xa')](_0x7816('0x1f'),auth[_0x7816('0xf')](),controller['getOfflineMessages']);router[_0x7816('0xa')](_0x7816('0x20'),auth['isAuthenticated'](),controller['getAgents']);router[_0x7816('0x21')]('/',auth['isAuthenticated'](),controller[_0x7816('0x22')]);router[_0x7816('0x21')](_0x7816('0x10'),auth[_0x7816('0xf')](),controller[_0x7816('0x23')]);router['post']('/:id/canned_answers',auth[_0x7816('0xf')](),controller[_0x7816('0x24')]);var upload=multer({'storage':multer[_0x7816('0x25')]({'destination':function(_0x70beb2,_0x5a9bc2,_0x44ef7e){_0x44ef7e(null,path[_0x7816('0x26')](config[_0x7816('0x27')],_0x7816('0x28')));},'filename':function(_0x38df7b,_0xf01f0,_0x1b7439){_0x1b7439(null,util['format'](_0x7816('0x29'),Date[_0x7816('0x2a')](),_0xf01f0[_0x7816('0x2b')]));}})});router['post'](_0x7816('0x2c'),upload['single'](_0x7816('0x2d')),controller[_0x7816('0x2e')]);var upload=multer({'storage':multer[_0x7816('0x25')]({'destination':function(_0x4562b5,_0x2c2774,_0xfbcb99){_0xfbcb99(null,path[_0x7816('0x26')](config['root'],_0x7816('0x2f')));},'filename':function(_0x1b1d6d,_0xf43d41,_0x255742){_0x255742(null,util['format'](_0x7816('0x29'),Date['now'](),_0xf43d41[_0x7816('0x2b')]));}})});router['post']('/:id/avatar',upload[_0x7816('0x30')](_0x7816('0x2d')),controller[_0x7816('0x31')]);var upload=multer({'storage':multer[_0x7816('0x25')]({'destination':function(_0x449a77,_0x278074,_0x444102){_0x444102(null,path[_0x7816('0x26')](config['root'],_0x7816('0x2f')));},'filename':function(_0x539739,_0x2aab88,_0xeea89f){_0xeea89f(null,util[_0x7816('0x32')](_0x7816('0x29'),Date[_0x7816('0x2a')](),_0x2aab88['originalname']));}})});router[_0x7816('0x21')]('/:id/customer_avatar',upload[_0x7816('0x30')](_0x7816('0x2d')),controller[_0x7816('0x33')]);var upload=multer({'storage':multer[_0x7816('0x25')]({'destination':function(_0x490b22,_0x972218,_0x2f5363){_0x2f5363(null,path[_0x7816('0x26')](config[_0x7816('0x27')],'server/files/images/avatars/'));},'filename':function(_0x37c8c8,_0x48b7f5,_0x415f46){_0x415f46(null,util[_0x7816('0x32')](_0x7816('0x29'),Date[_0x7816('0x2a')](),_0x48b7f5[_0x7816('0x2b')]));}})});router[_0x7816('0x21')]('/:id/system_avatar',upload[_0x7816('0x30')](_0x7816('0x2d')),controller[_0x7816('0x34')]);router[_0x7816('0x21')]('/:id/notify',controller[_0x7816('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x7816('0x25')]({'destination':function(_0x438b6a,_0xfd2dab,_0x289927){const _0x48a6d9=path[_0x7816('0x26')](config[_0x7816('0x27')],_0x7816('0x36'),_0x7816('0x37'),_0x7816('0x38'));fs_extra[_0x7816('0x39')](_0x48a6d9,function(){_0x289927(null,_0x48a6d9);});},'filename':function(_0x30fdc9,_0xabc22,_0x2d2f7f){const _0x872740=_0xabc22[_0x7816('0x2b')][_0x7816('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5a1a74=path['extname'](_0x872740);const _0x58e3b8=Date[_0x7816('0x2a')]()+'-'+_0x872740[_0x7816('0x3a')](_0x5a1a74,'')+_0x5a1a74;_0x2d2f7f(null,_0x58e3b8);}})});router[_0x7816('0x21')](_0x7816('0x3b'),offlineUploadMulter[_0x7816('0x3c')](),controller[_0x7816('0x3d')]);router['post'](_0x7816('0x3e'),auth['isAuthenticated'](),controller[_0x7816('0x3f')]);router['post'](_0x7816('0x1b'),auth[_0x7816('0xf')](),controller[_0x7816('0x40')]);router['post'](_0x7816('0x41'),auth[_0x7816('0xf')](),controller['addProactiveActions']);router[_0x7816('0x21')](_0x7816('0x20'),auth[_0x7816('0xf')](),controller['addAgents']);router['put'](_0x7816('0xe'),auth[_0x7816('0xf')](),controller[_0x7816('0x42')]);router[_0x7816('0x43')](_0x7816('0xe'),auth[_0x7816('0xf')](),controller[_0x7816('0x44')]);router[_0x7816('0x43')]('/:id/dispositions',auth[_0x7816('0xf')](),controller[_0x7816('0x45')]);router[_0x7816('0x43')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x7816('0x43')](_0x7816('0x20'),auth[_0x7816('0xf')](),controller['removeAgents']);module[_0x7816('0x46')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 1ffa29e..10530f9 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 _0x30d3=['isAuthenticated','exports','beaver-logger/server','express','Router','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use'];(function(_0x5bd688,_0x182339){var _0xa84424=function(_0xc9fbb4){while(--_0xc9fbb4){_0x5bd688['push'](_0x5bd688['shift']());}};_0xa84424(++_0x182339);}(_0x30d3,0xc6));var _0x330d=function(_0x6c7031,_0x434dbf){_0x6c7031=_0x6c7031-0x0;var _0xc677f6=_0x30d3[_0x6c7031];return _0xc677f6;};var beaverLogger=require(_0x330d('0x0'));var express=require(_0x330d('0x1'));var auth=require('../components/auth/service');var config=require('../config/environment');var router=express[_0x330d('0x2')]();var isProduction=config[_0x330d('0x3')]===_0x330d('0x4')||![];function clientSideLogs(_0x2f7591,_0x17ed29,_0x480612){var _0x4a5a34=_0x2f7591[_0x330d('0x5')][_0x330d('0x6')](_0x330d('0x7'));if(!_0x4a5a34){throw new Error(_0x330d('0x8'));}return beaverLogger[_0x330d('0x9')]({'uri':_0x330d('0xa'),'logger':_0x4a5a34,'enableCors':!isProduction})(_0x2f7591,_0x17ed29,_0x480612);}router[_0x330d('0xb')](auth[_0x330d('0xc')](),clientSideLogs);module[_0x330d('0xd')]=router;
\ No newline at end of file
+var _0x0e6c=['production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env'];(function(_0x5e3a45,_0x45f0c5){var _0x13419f=function(_0x5ac996){while(--_0x5ac996){_0x5e3a45['push'](_0x5e3a45['shift']());}};_0x13419f(++_0x45f0c5);}(_0x0e6c,0x13c));var _0xc0e6=function(_0x41200c,_0x195027){_0x41200c=_0x41200c-0x0;var _0x2a4cf4=_0x0e6c[_0x41200c];return _0x2a4cf4;};var beaverLogger=require(_0xc0e6('0x0'));var express=require(_0xc0e6('0x1'));var auth=require(_0xc0e6('0x2'));var config=require(_0xc0e6('0x3'));var router=express[_0xc0e6('0x4')]();var isProduction=config[_0xc0e6('0x5')]===_0xc0e6('0x6')||![];function clientSideLogs(_0x1f2f55,_0x2a5999,_0xede790){var _0x41af34=_0x1f2f55[_0xc0e6('0x7')][_0xc0e6('0x8')](_0xc0e6('0x9'));if(!_0x41af34){throw new Error(_0xc0e6('0xa'));}return beaverLogger[_0xc0e6('0xb')]({'uri':_0xc0e6('0xc'),'logger':_0x41af34,'enableCors':!isProduction})(_0x1f2f55,_0x2a5999,_0xede790);}router[_0xc0e6('0xd')](auth['isAuthenticated'](),clientSideLogs);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 21ac330..836c356 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 _0x1f37=['Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','ENUM','Google','MicrosoftAzure'];(function(_0x58a994,_0x2e1bcf){var _0x40a74c=function(_0xd5e396){while(--_0xd5e396){_0x58a994['push'](_0x58a994['shift']());}};_0x40a74c(++_0x2e1bcf);}(_0x1f37,0x1d8));var _0x71f3=function(_0x4394b6,_0x12357f){_0x4394b6=_0x4394b6-0x0;var _0x360244=_0x1f37[_0x4394b6];return _0x360244;};'use strict';var Sequelize=require('sequelize');module[_0x71f3('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x71f3('0x1')]('AmazonAWS',_0x71f3('0x2'),_0x71f3('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x71f3('0x1')](_0x71f3('0x4'),_0x71f3('0x5'))},'data1':{'type':Sequelize[_0x71f3('0x6')],'comment':_0x71f3('0x7')},'data2':{'type':Sequelize['STRING'],'comment':_0x71f3('0x8')},'data3':{'type':Sequelize['STRING'],'comment':_0x71f3('0x9')},'data4':{'type':Sequelize[_0x71f3('0x6')],'comment':_0x71f3('0xa')},'data5':{'type':Sequelize[_0x71f3('0xb')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize['TEXT'],'comment':_0x71f3('0xc')},'data7':{'type':Sequelize[_0x71f3('0xb')],'comment':_0x71f3('0xd')}};
\ No newline at end of file
+var _0x5d9e=['MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret'];(function(_0x4eaad4,_0x5e4a95){var _0x1527f9=function(_0x487873){while(--_0x487873){_0x4eaad4['push'](_0x4eaad4['shift']());}};_0x1527f9(++_0x5e4a95);}(_0x5d9e,0x199));var _0xe5d9=function(_0x37b1d2,_0x59b821){_0x37b1d2=_0x37b1d2-0x0;var _0x5ce1bb=_0x5d9e[_0x37b1d2];return _0x5ce1bb;};'use strict';var Sequelize=require(_0xe5d9('0x0'));module[_0xe5d9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xe5d9('0x2')](_0xe5d9('0x3'),_0xe5d9('0x4'),_0xe5d9('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xe5d9('0x2')](_0xe5d9('0x6'),_0xe5d9('0x7'))},'data1':{'type':Sequelize[_0xe5d9('0x8')],'comment':_0xe5d9('0x9')},'data2':{'type':Sequelize[_0xe5d9('0x8')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0xe5d9('0x8')],'comment':_0xe5d9('0xa')},'data4':{'type':Sequelize['STRING'],'comment':_0xe5d9('0xb')},'data5':{'type':Sequelize[_0xe5d9('0xc')],'comment':_0xe5d9('0xd')},'data6':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xe5d9('0xc')],'comment':_0xe5d9('0xe')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 04bde99..9ba196d 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 _0x3ae0=['json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','end','sendStatus','error','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','params','length','create','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','values','find','encryptString','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback','get','parse','from','state','base64','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','stringify','lodash','ioredis','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','status'];(function(_0x34ae7e,_0x1e8cdd){var _0x2a5324=function(_0x4f1dfc){while(--_0x4f1dfc){_0x34ae7e['push'](_0x34ae7e['shift']());}};_0x2a5324(++_0x1e8cdd);}(_0x3ae0,0x110));var _0x03ae=function(_0x57349e,_0x34c1c1){_0x57349e=_0x57349e-0x0;var _0x2a2671=_0x3ae0[_0x57349e];return _0x2a2671;};'use strict';var _=require(_0x03ae('0x0'));var Redis=require(_0x03ae('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0x03ae('0x2'))(_0x03ae('0x3'));var db=require(_0x03ae('0x4'))['db'];var oauth=require('./cloudProvider.oauth');config['redis']=_[_0x03ae('0x5')](config[_0x03ae('0x6')],{'host':_0x03ae('0x7'),'port':0x18eb});var socket=require(_0x03ae('0x8'))(new Redis(config[_0x03ae('0x6')]));var redis=new Redis(config[_0x03ae('0x6')]);function respondWithStatusCode(_0x3a64fc,_0x1aa2a0){_0x1aa2a0=_0x1aa2a0||0xcc;return function(_0x2d2093){if(_0x2d2093){return _0x3a64fc['sendStatus'](_0x1aa2a0);}return _0x3a64fc[_0x03ae('0x9')](_0x1aa2a0)['end']();};}function respondWithResult(_0x51ee33,_0x2c327f){_0x2c327f=_0x2c327f||0xc8;return function(_0x53f7bc){if(_0x53f7bc){return _0x51ee33[_0x03ae('0x9')](_0x2c327f)[_0x03ae('0xa')](_0x53f7bc);}};}function respondWithFilteredResult(_0x5a2aa8,_0x2d87c0){return function(_0x43c660){if(_0x43c660){var _0x2d0517=typeof _0x2d87c0['offset']===_0x03ae('0xb')&&typeof _0x2d87c0[_0x03ae('0xc')]==='undefined';var _0x549c2a=_0x43c660[_0x03ae('0xd')];var _0x21682e=_0x2d0517?0x0:_0x2d87c0[_0x03ae('0xe')];var _0x403a8a=_0x2d0517?_0x43c660['count']:_0x2d87c0[_0x03ae('0xe')]+_0x2d87c0[_0x03ae('0xc')];var _0x541da5;if(_0x403a8a>=_0x549c2a){_0x403a8a=_0x549c2a;_0x541da5=0xc8;}else{_0x541da5=0xce;}_0x5a2aa8['status'](_0x541da5);return _0x5a2aa8[_0x03ae('0xf')](_0x03ae('0x10'),_0x21682e+'-'+_0x403a8a+'/'+_0x549c2a)[_0x03ae('0xa')](_0x43c660);}return null;};}function saveUpdates(_0x371aa2){return function(_0x596f5b){if(_0x596f5b){return _0x596f5b[_0x03ae('0x11')](_0x371aa2)[_0x03ae('0x12')](function(_0x2c81f){return _0x2c81f;});}return null;};}function removeEntity(_0x2cdb86){return function(_0x54f93a){if(_0x54f93a){return _0x54f93a[_0x03ae('0x13')]()[_0x03ae('0x12')](function(){_0x2cdb86[_0x03ae('0x9')](0xcc)[_0x03ae('0x14')]();});}};}function handleEntityNotFound(_0x2b3643){return function(_0x2cf171){if(!_0x2cf171){_0x2b3643[_0x03ae('0x15')](0x194);}return _0x2cf171;};}function handleError(_0xa8c24f,_0x43a149){_0x43a149=_0x43a149||0x1f4;return function(_0x509b0e){logger[_0x03ae('0x16')](_0x509b0e['stack']);if(_0x509b0e[_0x03ae('0x17')]){delete _0x509b0e[_0x03ae('0x17')];}_0xa8c24f[_0x03ae('0x9')](_0x43a149)[_0x03ae('0x18')](_0x509b0e);};}function maskClientSecret(_0x5674f9){return _[_0x03ae('0x19')](_0x5674f9[_0x03ae('0x1a')](0x0,0x3),0x14,'*');}exports[_0x03ae('0x1b')]=function(_0x560dbd,_0x78e833){var _0x126ba7={},_0x342eda={},_0x9c832b={'count':0x0,'rows':[]};var _0x28c9fb=_[_0x03ae('0x1c')](db[_0x03ae('0x1d')][_0x03ae('0x1e')],function(_0x527c7d){return{'name':_0x527c7d['fieldName'],'type':_0x527c7d[_0x03ae('0x1f')][_0x03ae('0x20')]};});_0x342eda[_0x03ae('0x21')]=_[_0x03ae('0x1c')](_0x28c9fb,_0x03ae('0x17'));_0x342eda[_0x03ae('0x22')]=_[_0x03ae('0x23')](_0x560dbd[_0x03ae('0x22')]);_0x342eda[_0x03ae('0x24')]=_[_0x03ae('0x25')](_0x342eda[_0x03ae('0x21')],_0x342eda['query']);_0x126ba7[_0x03ae('0x26')]=_[_0x03ae('0x25')](_0x342eda['model'],qs[_0x03ae('0x27')](_0x560dbd[_0x03ae('0x22')]['fields']));_0x126ba7['attributes']=_0x126ba7[_0x03ae('0x26')]['length']?_0x126ba7['attributes']:_0x342eda['model'];if(!_0x560dbd[_0x03ae('0x22')]['hasOwnProperty'](_0x03ae('0x28'))){_0x126ba7[_0x03ae('0xc')]=qs[_0x03ae('0xc')](_0x560dbd[_0x03ae('0x22')][_0x03ae('0xc')]);_0x126ba7[_0x03ae('0xe')]=qs['offset'](_0x560dbd[_0x03ae('0x22')][_0x03ae('0xe')]);}_0x126ba7[_0x03ae('0x29')]=qs[_0x03ae('0x2a')](_0x560dbd[_0x03ae('0x22')]['sort']);_0x126ba7[_0x03ae('0x2b')]=qs[_0x03ae('0x24')](_[_0x03ae('0x2c')](_0x560dbd[_0x03ae('0x22')],_0x342eda[_0x03ae('0x24')]),_0x28c9fb);if(_0x560dbd[_0x03ae('0x22')]['filter']){_0x126ba7['where']=_[_0x03ae('0x2d')](_0x126ba7[_0x03ae('0x2b')],{'$or':_['map'](_0x28c9fb,function(_0x554c95){if(_0x554c95[_0x03ae('0x1f')]!==_0x03ae('0x2e')){var _0x21333d={};_0x21333d[_0x554c95[_0x03ae('0x17')]]={'$like':'%'+_0x560dbd[_0x03ae('0x22')][_0x03ae('0x2f')]+'%'};return _0x21333d;}})});}_0x126ba7=_['merge']({},_0x126ba7,_0x560dbd[_0x03ae('0x30')]);var _0x528c3a={'where':_0x126ba7[_0x03ae('0x2b')]};return db[_0x03ae('0x1d')]['count'](_0x528c3a)[_0x03ae('0x12')](function(_0x394e58){_0x9c832b[_0x03ae('0xd')]=_0x394e58;if(_0x560dbd[_0x03ae('0x22')][_0x03ae('0x31')]){_0x126ba7[_0x03ae('0x32')]=[{'all':!![]}];}return db[_0x03ae('0x1d')][_0x03ae('0x33')](_0x126ba7);})[_0x03ae('0x12')](function(_0x6f4c34){_0x9c832b[_0x03ae('0x34')]=_[_0x03ae('0x1c')](_0x6f4c34,function(_0x1c5bb8){if(_0x1c5bb8[_0x03ae('0x35')]===_0x03ae('0x36')){var _0x4b85fc=encryptor[_0x03ae('0x37')](_0x1c5bb8[_0x03ae('0x38')]);_0x1c5bb8[_0x03ae('0x38')]=maskClientSecret(_0x4b85fc);}return _0x1c5bb8;});return _0x9c832b;})[_0x03ae('0x12')](respondWithFilteredResult(_0x78e833,_0x126ba7))[_0x03ae('0x39')](handleError(_0x78e833,null));};exports['show']=function(_0x52db40,_0x29c6be){var _0x5d07da={'raw':!![],'where':{'id':_0x52db40[_0x03ae('0x3a')]['id']}},_0x184d38={};_0x184d38['model']=_[_0x03ae('0x23')](db[_0x03ae('0x1d')][_0x03ae('0x1e')]);_0x184d38['query']=_[_0x03ae('0x23')](_0x52db40[_0x03ae('0x22')]);_0x184d38[_0x03ae('0x24')]=_['intersection'](_0x184d38['model'],_0x184d38[_0x03ae('0x22')]);_0x5d07da[_0x03ae('0x26')]=_[_0x03ae('0x25')](_0x184d38['model'],qs[_0x03ae('0x27')](_0x52db40[_0x03ae('0x22')][_0x03ae('0x27')]));_0x5d07da[_0x03ae('0x26')]=_0x5d07da[_0x03ae('0x26')][_0x03ae('0x3b')]?_0x5d07da['attributes']:_0x184d38['model'];if(_0x52db40[_0x03ae('0x22')][_0x03ae('0x31')]){_0x5d07da['include']=[{'all':!![]}];}_0x5d07da=_[_0x03ae('0x2d')]({},_0x5d07da,_0x52db40[_0x03ae('0x30')]);return db['CloudProvider']['find'](_0x5d07da)[_0x03ae('0x12')](handleEntityNotFound(_0x29c6be,null))[_0x03ae('0x12')](function(_0x15787b){if(_0x15787b[_0x03ae('0x35')]===_0x03ae('0x36')){var _0x3e65dc=encryptor[_0x03ae('0x37')](_0x15787b[_0x03ae('0x38')]);_0x15787b[_0x03ae('0x38')]=maskClientSecret(_0x3e65dc);}return _0x15787b;})[_0x03ae('0x12')](respondWithResult(_0x29c6be,null))[_0x03ae('0x39')](handleError(_0x29c6be,null));};exports[_0x03ae('0x3c')]=function(_0x2a72ef,_0x388220){if(!_0x2a72ef['body']['name'])throw new Error(_0x03ae('0x3d'));if(!_0x2a72ef[_0x03ae('0x3e')][_0x03ae('0x35')])throw new Error(_0x03ae('0x3f'));var _0x594031=db['CloudProvider'][_0x03ae('0x1e')]['service'][_0x03ae('0x40')];if(!_0x594031['includes'](_0x2a72ef[_0x03ae('0x3e')][_0x03ae('0x35')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x594031['join'](',\x20'));if(_0x2a72ef[_0x03ae('0x3e')][_0x03ae('0x35')]==='MicrosoftAzure'&&_0x2a72ef['body'][_0x03ae('0x38')]){_0x2a72ef['body'][_0x03ae('0x38')]=encryptor['encryptString'](_0x2a72ef[_0x03ae('0x3e')][_0x03ae('0x38')]);}return db[_0x03ae('0x1d')][_0x03ae('0x3c')](_0x2a72ef['body'],{})['then'](respondWithResult(_0x388220,0xc9))[_0x03ae('0x39')](handleError(_0x388220,null));};exports[_0x03ae('0x11')]=function(_0x5cc266,_0x55463c){if(_0x5cc266[_0x03ae('0x3e')]['id']){delete _0x5cc266[_0x03ae('0x3e')]['id'];}return db[_0x03ae('0x1d')][_0x03ae('0x41')]({'where':{'id':_0x5cc266[_0x03ae('0x3a')]['id']}})['then'](handleEntityNotFound(_0x55463c,null))[_0x03ae('0x12')](function(_0xbca63d){if(_0xbca63d[_0x03ae('0x35')]===_0x03ae('0x36')&&_0x5cc266[_0x03ae('0x3e')]['data3']){_0x5cc266['body'][_0x03ae('0x38')]=encryptor[_0x03ae('0x42')](_0x5cc266[_0x03ae('0x3e')][_0x03ae('0x38')]);}return _0xbca63d;})[_0x03ae('0x12')](saveUpdates(_0x5cc266['body'],null))['then'](respondWithResult(_0x55463c,null))[_0x03ae('0x39')](handleError(_0x55463c,null));};exports[_0x03ae('0x13')]=function(_0x3d5eb7,_0x5e987f){return db[_0x03ae('0x1d')]['find']({'where':{'id':_0x3d5eb7[_0x03ae('0x3a')]['id']}})['then'](handleEntityNotFound(_0x5e987f,null))['then'](removeEntity(_0x5e987f,null))[_0x03ae('0x39')](handleError(_0x5e987f,null));};exports[_0x03ae('0x43')]=function(_0x35ae87,_0x34151f){return db[_0x03ae('0x1d')][_0x03ae('0x44')]({'where':{'id':_0x35ae87[_0x03ae('0x3a')]['id']},'raw':!![]})[_0x03ae('0x12')](function(_0x51f4c0){if(!_0x51f4c0)return _0x34151f[_0x03ae('0x15')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x51f4c0,_0x35ae87[_0x03ae('0x45')]['id'])};})['then'](respondWithResult(_0x34151f,null))[_0x03ae('0x39')](handleError(_0x34151f,null));};exports[_0x03ae('0x46')]=function(_0x1b2139,_0x564a1c){var _0x4cadb9=_0x1b2139[_0x03ae('0x3e')];var _0x32188d;var _0x1ea4b8;if(_0x4cadb9[_0x03ae('0x16')])throw _0x4cadb9;redis[_0x03ae('0x47')](_0x4cadb9['state'])['then'](function(_0x38ffbb){if(!_0x38ffbb)throw new Error('Invalid\x20state\x20parameter');_0x32188d=JSON[_0x03ae('0x48')](_0x38ffbb);var _0x467f4a=Buffer[_0x03ae('0x49')](_0x4cadb9[_0x03ae('0x4a')],_0x03ae('0x4b'))[_0x03ae('0x4c')](_0x03ae('0x4d'));_0x1ea4b8=JSON['parse'](_0x467f4a);if(!oauth[_0x03ae('0x4e')](_0x4cadb9['id_token'],_0x32188d[_0x03ae('0x4f')]))throw new Error(_0x03ae('0x50'));redis[_0x03ae('0x51')](_0x4cadb9['state']);return oauth[_0x03ae('0x52')](_0x4cadb9[_0x03ae('0x53')],_0x32188d);})['then'](function(_0x49b5e5){_0x32188d[_0x03ae('0x54')]=_0x49b5e5['access_token'];_0x32188d[_0x03ae('0x55')]=_0x49b5e5[_0x03ae('0x56')];return db[_0x03ae('0x1d')][_0x03ae('0x11')]({'data5':_0x32188d[_0x03ae('0x54')],'data6':_0x32188d[_0x03ae('0x55')]},{'where':{'id':_0x32188d['id']}});})['then'](function(){oauth[_0x03ae('0x57')](_0x32188d);socket[_0x03ae('0x58')](_0x03ae('0x59'),{'id':_0x1ea4b8['id']});return;})[_0x03ae('0x12')](respondWithStatusCode(_0x564a1c,null))['catch'](function(_0x14f1cf){if(_0x1ea4b8){socket['emit'](_0x03ae('0x5a'),{'id':_0x1ea4b8['id']});}if(!_0x32188d){logger[_0x03ae('0x16')](_0x03ae('0x5b'),_0x14f1cf);return _0x564a1c['status'](0x1f4)[_0x03ae('0x18')](_0x14f1cf[_0x03ae('0x5c')]);}logger[_0x03ae('0x16')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x32188d['id'],JSON[_0x03ae('0x5d')](_0x14f1cf));});};
\ No newline at end of file
+var _0xc5d6=['update','then','destroy','error','stack','name','send','padEnd','slice','index','map','CloudProvider','fieldName','type','key','query','filters','attributes','model','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','MicrosoftAzure','data3','show','params','keys','intersection','fields','service','decryptString','create','Service\x20parameter\x20not\x20specified','rawAttributes','values','includes','body','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','catch','find','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','get','state','Invalid\x20state\x20parameter','parse','from','base64','ascii','isValidIdToken','id_token','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','stringify','ioredis','../../components/encryptor','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json'];(function(_0x26e727,_0x3e65be){var _0x563800=function(_0xbcf999){while(--_0xbcf999){_0x26e727['push'](_0x26e727['shift']());}};_0x563800(++_0x3e65be);}(_0xc5d6,0x10b));var _0x6c5d=function(_0x351a4c,_0x2c7ac7){_0x351a4c=_0x351a4c-0x0;var _0x4ab784=_0xc5d6[_0x351a4c];return _0x4ab784;};'use strict';var _=require('lodash');var Redis=require(_0x6c5d('0x0'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x6c5d('0x1'));var config=require('../../config/environment');var logger=require(_0x6c5d('0x2'))(_0x6c5d('0x3'));var db=require(_0x6c5d('0x4'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x6c5d('0x5')]=_[_0x6c5d('0x6')](config['redis'],{'host':_0x6c5d('0x7'),'port':0x18eb});var socket=require(_0x6c5d('0x8'))(new Redis(config[_0x6c5d('0x5')]));var redis=new Redis(config[_0x6c5d('0x5')]);function respondWithStatusCode(_0x2b47cf,_0x594cc6){_0x594cc6=_0x594cc6||0xcc;return function(_0x529106){if(_0x529106){return _0x2b47cf[_0x6c5d('0x9')](_0x594cc6);}return _0x2b47cf[_0x6c5d('0xa')](_0x594cc6)['end']();};}function respondWithResult(_0x436d8c,_0x4b23f8){_0x4b23f8=_0x4b23f8||0xc8;return function(_0x2dfcda){if(_0x2dfcda){return _0x436d8c[_0x6c5d('0xa')](_0x4b23f8)['json'](_0x2dfcda);}};}function respondWithFilteredResult(_0x445253,_0x365ba5){return function(_0x2b9761){if(_0x2b9761){var _0x5a8791=typeof _0x365ba5['offset']===_0x6c5d('0xb')&&typeof _0x365ba5[_0x6c5d('0xc')]===_0x6c5d('0xb');var _0x32aef5=_0x2b9761[_0x6c5d('0xd')];var _0x3bc8cd=_0x5a8791?0x0:_0x365ba5['offset'];var _0x59b31a=_0x5a8791?_0x2b9761[_0x6c5d('0xd')]:_0x365ba5[_0x6c5d('0xe')]+_0x365ba5[_0x6c5d('0xc')];var _0x23c67a;if(_0x59b31a>=_0x32aef5){_0x59b31a=_0x32aef5;_0x23c67a=0xc8;}else{_0x23c67a=0xce;}_0x445253[_0x6c5d('0xa')](_0x23c67a);return _0x445253[_0x6c5d('0xf')](_0x6c5d('0x10'),_0x3bc8cd+'-'+_0x59b31a+'/'+_0x32aef5)[_0x6c5d('0x11')](_0x2b9761);}return null;};}function saveUpdates(_0x1fc6de){return function(_0x3112d0){if(_0x3112d0){return _0x3112d0[_0x6c5d('0x12')](_0x1fc6de)[_0x6c5d('0x13')](function(_0xc29cca){return _0xc29cca;});}return null;};}function removeEntity(_0x2ce50d){return function(_0x3a1d49){if(_0x3a1d49){return _0x3a1d49[_0x6c5d('0x14')]()['then'](function(){_0x2ce50d[_0x6c5d('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11d9c5){return function(_0x11018d){if(!_0x11018d){_0x11d9c5[_0x6c5d('0x9')](0x194);}return _0x11018d;};}function handleError(_0x26e02b,_0x29bde4){_0x29bde4=_0x29bde4||0x1f4;return function(_0x28ff55){logger[_0x6c5d('0x15')](_0x28ff55[_0x6c5d('0x16')]);if(_0x28ff55[_0x6c5d('0x17')]){delete _0x28ff55[_0x6c5d('0x17')];}_0x26e02b['status'](_0x29bde4)[_0x6c5d('0x18')](_0x28ff55);};}function maskClientSecret(_0xb71270){return _[_0x6c5d('0x19')](_0xb71270[_0x6c5d('0x1a')](0x0,0x3),0x14,'*');}exports[_0x6c5d('0x1b')]=function(_0x1a4388,_0x5aa135){var _0x293637={},_0x326a56={},_0x51a646={'count':0x0,'rows':[]};var _0x5bb0a0=_[_0x6c5d('0x1c')](db[_0x6c5d('0x1d')]['rawAttributes'],function(_0x577374){return{'name':_0x577374[_0x6c5d('0x1e')],'type':_0x577374[_0x6c5d('0x1f')][_0x6c5d('0x20')]};});_0x326a56['model']=_[_0x6c5d('0x1c')](_0x5bb0a0,_0x6c5d('0x17'));_0x326a56[_0x6c5d('0x21')]=_['keys'](_0x1a4388[_0x6c5d('0x21')]);_0x326a56[_0x6c5d('0x22')]=_['intersection'](_0x326a56['model'],_0x326a56['query']);_0x293637[_0x6c5d('0x23')]=_['intersection'](_0x326a56[_0x6c5d('0x24')],qs['fields'](_0x1a4388[_0x6c5d('0x21')]['fields']));_0x293637[_0x6c5d('0x23')]=_0x293637['attributes'][_0x6c5d('0x25')]?_0x293637[_0x6c5d('0x23')]:_0x326a56[_0x6c5d('0x24')];if(!_0x1a4388[_0x6c5d('0x21')][_0x6c5d('0x26')]('nolimit')){_0x293637[_0x6c5d('0xc')]=qs[_0x6c5d('0xc')](_0x1a4388[_0x6c5d('0x21')][_0x6c5d('0xc')]);_0x293637[_0x6c5d('0xe')]=qs[_0x6c5d('0xe')](_0x1a4388[_0x6c5d('0x21')][_0x6c5d('0xe')]);}_0x293637[_0x6c5d('0x27')]=qs[_0x6c5d('0x28')](_0x1a4388[_0x6c5d('0x21')][_0x6c5d('0x28')]);_0x293637[_0x6c5d('0x29')]=qs[_0x6c5d('0x22')](_['pick'](_0x1a4388['query'],_0x326a56[_0x6c5d('0x22')]),_0x5bb0a0);if(_0x1a4388[_0x6c5d('0x21')][_0x6c5d('0x2a')]){_0x293637[_0x6c5d('0x29')]=_[_0x6c5d('0x2b')](_0x293637[_0x6c5d('0x29')],{'$or':_[_0x6c5d('0x1c')](_0x5bb0a0,function(_0x33ec4b){if(_0x33ec4b[_0x6c5d('0x1f')]!==_0x6c5d('0x2c')){var _0x527c3b={};_0x527c3b[_0x33ec4b['name']]={'$like':'%'+_0x1a4388['query']['filter']+'%'};return _0x527c3b;}})});}_0x293637=_[_0x6c5d('0x2b')]({},_0x293637,_0x1a4388[_0x6c5d('0x2d')]);var _0x18ab88={'where':_0x293637[_0x6c5d('0x29')]};return db[_0x6c5d('0x1d')]['count'](_0x18ab88)[_0x6c5d('0x13')](function(_0x5cdfcc){_0x51a646['count']=_0x5cdfcc;if(_0x1a4388[_0x6c5d('0x21')][_0x6c5d('0x2e')]){_0x293637[_0x6c5d('0x2f')]=[{'all':!![]}];}return db[_0x6c5d('0x1d')]['findAll'](_0x293637);})[_0x6c5d('0x13')](function(_0x17388b){_0x51a646[_0x6c5d('0x30')]=_[_0x6c5d('0x1c')](_0x17388b,function(_0x4345b9){if(_0x4345b9['service']===_0x6c5d('0x31')){var _0xc92c7=encryptor['decryptString'](_0x4345b9['data3']);_0x4345b9[_0x6c5d('0x32')]=maskClientSecret(_0xc92c7);}return _0x4345b9;});return _0x51a646;})[_0x6c5d('0x13')](respondWithFilteredResult(_0x5aa135,_0x293637))['catch'](handleError(_0x5aa135,null));};exports[_0x6c5d('0x33')]=function(_0x243eef,_0x2fb213){var _0x4973fb={'raw':!![],'where':{'id':_0x243eef[_0x6c5d('0x34')]['id']}},_0x53da50={};_0x53da50[_0x6c5d('0x24')]=_[_0x6c5d('0x35')](db[_0x6c5d('0x1d')]['rawAttributes']);_0x53da50[_0x6c5d('0x21')]=_[_0x6c5d('0x35')](_0x243eef['query']);_0x53da50['filters']=_[_0x6c5d('0x36')](_0x53da50['model'],_0x53da50[_0x6c5d('0x21')]);_0x4973fb[_0x6c5d('0x23')]=_[_0x6c5d('0x36')](_0x53da50['model'],qs['fields'](_0x243eef[_0x6c5d('0x21')][_0x6c5d('0x37')]));_0x4973fb[_0x6c5d('0x23')]=_0x4973fb[_0x6c5d('0x23')]['length']?_0x4973fb[_0x6c5d('0x23')]:_0x53da50[_0x6c5d('0x24')];if(_0x243eef['query']['includeAll']){_0x4973fb[_0x6c5d('0x2f')]=[{'all':!![]}];}_0x4973fb=_['merge']({},_0x4973fb,_0x243eef[_0x6c5d('0x2d')]);return db[_0x6c5d('0x1d')]['find'](_0x4973fb)[_0x6c5d('0x13')](handleEntityNotFound(_0x2fb213,null))[_0x6c5d('0x13')](function(_0x13d9e4){if(_0x13d9e4[_0x6c5d('0x38')]===_0x6c5d('0x31')){var _0x5df897=encryptor[_0x6c5d('0x39')](_0x13d9e4[_0x6c5d('0x32')]);_0x13d9e4[_0x6c5d('0x32')]=maskClientSecret(_0x5df897);}return _0x13d9e4;})[_0x6c5d('0x13')](respondWithResult(_0x2fb213,null))['catch'](handleError(_0x2fb213,null));};exports[_0x6c5d('0x3a')]=function(_0x26d09e,_0x48e74e){if(!_0x26d09e['body'][_0x6c5d('0x17')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x26d09e['body'][_0x6c5d('0x38')])throw new Error(_0x6c5d('0x3b'));var _0x5e23ed=db[_0x6c5d('0x1d')][_0x6c5d('0x3c')][_0x6c5d('0x38')][_0x6c5d('0x3d')];if(!_0x5e23ed[_0x6c5d('0x3e')](_0x26d09e[_0x6c5d('0x3f')][_0x6c5d('0x38')]))throw new Error(_0x6c5d('0x40')+_0x5e23ed['join'](',\x20'));if(_0x26d09e['body'][_0x6c5d('0x38')]===_0x6c5d('0x31')&&_0x26d09e[_0x6c5d('0x3f')][_0x6c5d('0x32')]){_0x26d09e[_0x6c5d('0x3f')][_0x6c5d('0x32')]=encryptor[_0x6c5d('0x41')](_0x26d09e['body']['data3']);}return db[_0x6c5d('0x1d')][_0x6c5d('0x3a')](_0x26d09e['body'],{})[_0x6c5d('0x13')](respondWithResult(_0x48e74e,0xc9))[_0x6c5d('0x42')](handleError(_0x48e74e,null));};exports[_0x6c5d('0x12')]=function(_0x2f870b,_0x3e51b1){if(_0x2f870b['body']['id']){delete _0x2f870b[_0x6c5d('0x3f')]['id'];}return db[_0x6c5d('0x1d')][_0x6c5d('0x43')]({'where':{'id':_0x2f870b[_0x6c5d('0x34')]['id']}})['then'](handleEntityNotFound(_0x3e51b1,null))[_0x6c5d('0x13')](function(_0x206c87){if(_0x206c87[_0x6c5d('0x38')]===_0x6c5d('0x31')&&_0x2f870b[_0x6c5d('0x3f')][_0x6c5d('0x32')]){_0x2f870b[_0x6c5d('0x3f')][_0x6c5d('0x32')]=encryptor[_0x6c5d('0x41')](_0x2f870b[_0x6c5d('0x3f')]['data3']);}return _0x206c87;})[_0x6c5d('0x13')](saveUpdates(_0x2f870b[_0x6c5d('0x3f')],null))['then'](respondWithResult(_0x3e51b1,null))['catch'](handleError(_0x3e51b1,null));};exports[_0x6c5d('0x14')]=function(_0x36fc30,_0x28780e){return db[_0x6c5d('0x1d')]['find']({'where':{'id':_0x36fc30['params']['id']}})[_0x6c5d('0x13')](handleEntityNotFound(_0x28780e,null))['then'](removeEntity(_0x28780e,null))[_0x6c5d('0x42')](handleError(_0x28780e,null));};exports[_0x6c5d('0x44')]=function(_0x20219c,_0x4d510e){return db[_0x6c5d('0x1d')]['findOne']({'where':{'id':_0x20219c[_0x6c5d('0x34')]['id']},'raw':!![]})[_0x6c5d('0x13')](function(_0x2024df){if(!_0x2024df)return _0x4d510e[_0x6c5d('0x9')](0x194);return{'url':oauth[_0x6c5d('0x45')](_0x2024df,_0x20219c[_0x6c5d('0x46')]['id'])};})[_0x6c5d('0x13')](respondWithResult(_0x4d510e,null))['catch'](handleError(_0x4d510e,null));};exports['oauth2MicrosoftCallback']=function(_0x2a4e90,_0x3c778d){var _0x2f7cfe=_0x2a4e90[_0x6c5d('0x3f')];var _0x4415e4;var _0x35c6ab;if(_0x2f7cfe['error'])throw _0x2f7cfe;redis[_0x6c5d('0x47')](_0x2f7cfe[_0x6c5d('0x48')])[_0x6c5d('0x13')](function(_0x1111b0){if(!_0x1111b0)throw new Error(_0x6c5d('0x49'));_0x4415e4=JSON[_0x6c5d('0x4a')](_0x1111b0);var _0x10b2e2=Buffer[_0x6c5d('0x4b')](_0x2f7cfe[_0x6c5d('0x48')],_0x6c5d('0x4c'))['toString'](_0x6c5d('0x4d'));_0x35c6ab=JSON[_0x6c5d('0x4a')](_0x10b2e2);if(!oauth[_0x6c5d('0x4e')](_0x2f7cfe[_0x6c5d('0x4f')],_0x4415e4['oauth2Claims']))throw new Error(_0x6c5d('0x50'));redis[_0x6c5d('0x51')](_0x2f7cfe[_0x6c5d('0x48')]);return oauth[_0x6c5d('0x52')](_0x2f7cfe[_0x6c5d('0x53')],_0x4415e4);})[_0x6c5d('0x13')](function(_0x121d73){_0x4415e4[_0x6c5d('0x54')]=_0x121d73[_0x6c5d('0x55')];_0x4415e4[_0x6c5d('0x56')]=_0x121d73[_0x6c5d('0x57')];return db[_0x6c5d('0x1d')][_0x6c5d('0x12')]({'data5':_0x4415e4['data5'],'data6':_0x4415e4[_0x6c5d('0x56')]},{'where':{'id':_0x4415e4['id']}});})[_0x6c5d('0x13')](function(){oauth[_0x6c5d('0x58')](_0x4415e4);socket[_0x6c5d('0x59')](_0x6c5d('0x5a'),{'id':_0x35c6ab['id']});return;})[_0x6c5d('0x13')](respondWithStatusCode(_0x3c778d,null))[_0x6c5d('0x42')](function(_0x1c5c6a){if(_0x35c6ab){socket['emit'](_0x6c5d('0x5b'),{'id':_0x35c6ab['id']});}if(!_0x4415e4){logger['error'](_0x6c5d('0x5c'),_0x1c5c6a);return _0x3c778d[_0x6c5d('0xa')](0x1f4)[_0x6c5d('0x18')](_0x1c5c6a[_0x6c5d('0x5d')]);}logger[_0x6c5d('0x15')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x4415e4['id'],JSON[_0x6c5d('0x5e')](_0x1c5c6a));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index eb8ac64..fa67cc0 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 _0x0b0b=['moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','CloudProvider','lodash','util','../../config/logger','api'];(function(_0x2262bf,_0xd7cf1){var _0x5115cc=function(_0x18e1f9){while(--_0x18e1f9){_0x2262bf['push'](_0x2262bf['shift']());}};_0x5115cc(++_0xd7cf1);}(_0x0b0b,0x128));var _0xb0b0=function(_0xdfd280,_0x17f746){_0xdfd280=_0xdfd280-0x0;var _0x1c5d8f=_0x0b0b[_0xdfd280];return _0x1c5d8f;};'use strict';var _=require(_0xb0b0('0x0'));var util=require(_0xb0b0('0x1'));var logger=require(_0xb0b0('0x2'))(_0xb0b0('0x3'));var moment=require(_0xb0b0('0x4'));var BPromise=require(_0xb0b0('0x5'));var rp=require(_0xb0b0('0x6'));var fs=require('fs');var path=require(_0xb0b0('0x7'));var rimraf=require('rimraf');var config=require(_0xb0b0('0x8'));var attributes=require(_0xb0b0('0x9'));module[_0xb0b0('0xa')]=function(_0x565baa,_0x48de74){return _0x565baa['define'](_0xb0b0('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3499=['CloudProvider','util','../../config/logger','api','moment','bluebird','path','rimraf','./cloudProvider.attributes','exports','define'];(function(_0x1dd18b,_0x5bdd0d){var _0x46926c=function(_0x3f40db){while(--_0x3f40db){_0x1dd18b['push'](_0x1dd18b['shift']());}};_0x46926c(++_0x5bdd0d);}(_0x3499,0xf3));var _0x9349=function(_0x718f1f,_0x2e2338){_0x718f1f=_0x718f1f-0x0;var _0x48b289=_0x3499[_0x718f1f];return _0x48b289;};'use strict';var _=require('lodash');var util=require(_0x9349('0x0'));var logger=require(_0x9349('0x1'))(_0x9349('0x2'));var moment=require(_0x9349('0x3'));var BPromise=require(_0x9349('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9349('0x5'));var rimraf=require(_0x9349('0x6'));var config=require('../../config/environment');var attributes=require(_0x9349('0x7'));module[_0x9349('0x8')]=function(_0x35e2b4,_0x533460){return _0x35e2b4[_0x9349('0x9')](_0x9349('0xa'),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 aa40339..ced4d28 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 _0x1a1a=['openid','profile','https://outlook.office.com/SMTP.Send','offline_access','/authorize','map','type','Dynamics365','push','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','/.default','{TENANT_ID}','data2','from','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','state','nonce','prompt','login','key','value','oauth2Claims','replace','oauth2/','set','decode','payload','issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','decryptString','POST','data5','access_token','data6','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','bind','findAll','all','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','redis','defaults','localhost'];(function(_0x1f99cc,_0x35138a){var _0x4e9c75=function(_0x41a9c9){while(--_0x41a9c9){_0x1f99cc['push'](_0x1f99cc['shift']());}};_0x4e9c75(++_0x35138a);}(_0x1a1a,0x12e));var _0xa1a1=function(_0x4d1631,_0x416231){_0x4d1631=_0x4d1631-0x0;var _0x3538a2=_0x1a1a[_0x4d1631];return _0x3538a2;};'use strict';var _=require(_0xa1a1('0x0'));var crypto=require(_0xa1a1('0x1'));var jwt=require(_0xa1a1('0x2'));var moment=require(_0xa1a1('0x3'));var Redis=require(_0xa1a1('0x4'));var rp=require(_0xa1a1('0x5'));var util=require(_0xa1a1('0x6'));var encryptor=require(_0xa1a1('0x7'));var config=require('../../config/environment');var logger=require(_0xa1a1('0x8'))(_0xa1a1('0x9'));var schedule=require(_0xa1a1('0xa'));var db=require('../../mysqldb')['db'];config[_0xa1a1('0xb')]=_[_0xa1a1('0xc')](config[_0xa1a1('0xb')],{'host':_0xa1a1('0xd'),'port':0x18eb});var redis=new Redis(config[_0xa1a1('0xb')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0xa1a1('0xe'),_0xa1a1('0xf'),'email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All',_0xa1a1('0x10')],'Dynamics365':[_0xa1a1('0xe'),_0xa1a1('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0xa1a1('0x12');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x575e54){var _0x122261=_[_0xa1a1('0x13')](AZURE_AUTH_SCOPES[_0x575e54['type']]);if(_0x575e54[_0xa1a1('0x14')]===_0xa1a1('0x15'))_0x122261[_0xa1a1('0x16')](_0x575e54['data7']+'/.default');return _0x122261[_0xa1a1('0x17')]('\x20');}function getAccessTokenScope(_0x3fa648){if(_0x3fa648[_0xa1a1('0x14')]===_0xa1a1('0x18'))return _0xa1a1('0x19');if(_0x3fa648['type']===_0xa1a1('0x15'))return _0x3fa648['data7']+_0xa1a1('0x1a');}function generateMicrosoftAuthorizationUrl(_0x425543,_0x4b1a54){var _0x343949=MICROSOFT_AUTH_URL['replace'](_0xa1a1('0x1b'),_0x425543[_0xa1a1('0x1c')]);var _0x40f400=['code','id_token'];var _0x423d5=Buffer[_0xa1a1('0x1d')](JSON[_0xa1a1('0x1e')]({'id':_0x4b1a54}))[_0xa1a1('0x1f')](_0xa1a1('0x20'));var _0x2a17d1=crypto[_0xa1a1('0x21')](0x10)['toString'](_0xa1a1('0x22'));var _0x28e0fc=getAuthorizationScopes(_0x425543);var _0x51a283=[{'key':_0xa1a1('0x23'),'value':_0x425543[_0xa1a1('0x24')]},{'key':_0xa1a1('0x25'),'value':encodeURIComponent(_0x40f400[_0xa1a1('0x17')]('\x20'))},{'key':_0xa1a1('0x26'),'value':_0x425543[_0xa1a1('0x27')]},{'key':_0xa1a1('0x28'),'value':_0xa1a1('0x29')},{'key':'scope','value':encodeURIComponent(_0x28e0fc)},{'key':_0xa1a1('0x2a'),'value':_0x423d5},{'key':_0xa1a1('0x2b'),'value':_0x2a17d1},{'key':_0xa1a1('0x2c'),'value':_0xa1a1('0x2d')}];var _0x5861f5=_0x343949+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xa1a1('0x13')](_0x51a283,function(_0x4f6c33){return _0x4f6c33[_0xa1a1('0x2e')]+'='+_0x4f6c33[_0xa1a1('0x2f')];})[_0xa1a1('0x17')]('&');_0x425543[_0xa1a1('0x30')]={'issuer':_0x343949[_0xa1a1('0x31')](_0xa1a1('0x32'),''),'audience':_0x425543[_0xa1a1('0x24')],'state':_0x423d5,'nonce':_0x2a17d1};redis[_0xa1a1('0x33')](_0x423d5,JSON[_0xa1a1('0x1e')](_0x425543));return _0x5861f5;}function isValidIdToken(_0x44670b,_0x3c7134){try{var _0x334bfd=jwt[_0xa1a1('0x34')](_0x44670b,{'complete':!![]});var _0x3ac40b=_0x334bfd[_0xa1a1('0x35')];if(_0x3ac40b['iss']!==_0x3c7134[_0xa1a1('0x36')])return![];if(_0x3ac40b[_0xa1a1('0x37')]!==_0x3c7134[_0xa1a1('0x38')])return![];if(_0x3ac40b['nonce']!==_0x3c7134[_0xa1a1('0x2b')])return![];if(moment()[_0xa1a1('0x39')](moment[_0xa1a1('0x3a')](_0x3ac40b[_0xa1a1('0x3b')])))return![];return!![];}catch(_0x1ba598){throw _0x1ba598;}}function refreshOauth2MicrosoftAccessToken(_0x5e5ab3){return Promise[_0xa1a1('0x3c')]()[_0xa1a1('0x3d')](function(){if(_0x5e5ab3[_0xa1a1('0x3e')])return _0x5e5ab3;return db[_0xa1a1('0x3f')][_0xa1a1('0x40')]({'where':{'id':_0x5e5ab3['id']},'raw':!![]});})[_0xa1a1('0x3d')](function(_0x324070){var _0x37aa2f={'grant_type':_0xa1a1('0x41'),'refresh_token':_0x324070['data6'],'scope':getAccessTokenScope(_0x324070),'redirect_uri':_0x324070[_0xa1a1('0x27')],'client_id':_0x324070[_0xa1a1('0x24')],'client_secret':encryptor[_0xa1a1('0x42')](_0x324070[_0xa1a1('0x3e')])};var _0x316aa5={'method':_0xa1a1('0x43'),'uri':MICROSOFT_AUTH_URL[_0xa1a1('0x31')](_0xa1a1('0x1b'),_0x324070[_0xa1a1('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x37aa2f,'json':!![]};return rp(_0x316aa5);})[_0xa1a1('0x3d')](function(_0xecb709){_0x5e5ab3[_0xa1a1('0x44')]=_0xecb709[_0xa1a1('0x45')];_0x5e5ab3[_0xa1a1('0x46')]=_0xecb709[_0xa1a1('0x41')];return db[_0xa1a1('0x3f')][_0xa1a1('0x47')]({'data5':_0x5e5ab3[_0xa1a1('0x44')],'data6':_0x5e5ab3[_0xa1a1('0x46')]},{'where':{'id':_0x5e5ab3['id']}});})['then'](function(){return _0x5e5ab3;})[_0xa1a1('0x48')](function(_0x4a605f){logger[_0xa1a1('0x49')](_0xa1a1('0x4a'),_0x5e5ab3['id'],_0x4a605f);});}function getOauth2MicrosoftAccessToken(_0x422163,_0x5eb82c){var _0x2e5a48={'grant_type':'authorization_code','code':_0x422163,'scope':getAccessTokenScope(_0x5eb82c),'redirect_uri':_0x5eb82c['data4'],'client_id':_0x5eb82c[_0xa1a1('0x24')],'client_secret':encryptor[_0xa1a1('0x42')](_0x5eb82c['data3'])};var _0x12aec2={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0xa1a1('0x1b'),_0x5eb82c[_0xa1a1('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2e5a48,'json':!![]};return rp(_0x12aec2);}function startRefreshInterval(_0x3c910b){var _0x5ee4b1=schedule['intervals'];if(_0x5ee4b1[_0x3c910b['id']])clearInterval(_0x5ee4b1[_0x3c910b['id']]);_0x5ee4b1[_0x3c910b['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xa1a1('0x4b')](this,{'id':_0x3c910b['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x5ee4b1;}function startAllRefreshIntervals(){return db[_0xa1a1('0x3f')][_0xa1a1('0x4c')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xa1a1('0x3d')](function(_0x3f6df7){var _0x452aba=_0x3f6df7[_0xa1a1('0x13')](function(_0x26aaae){return refreshOauth2MicrosoftAccessToken(_0x26aaae)[_0xa1a1('0x3d')](function(_0x289f70){startRefreshInterval(_0x289f70);});});return Promise[_0xa1a1('0x4d')](_0x452aba);})['catch'](function(_0x5507fe){var _0x70c3d6=_0x5507fe?util['inspect'](_0x5507fe,{'showHidden':![],'depth':null}):'';logger[_0xa1a1('0x49')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x70c3d6);});}module[_0xa1a1('0x4e')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xe3c1=['ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','defaults','redis','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/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','code','from','stringify','base64','randomBytes','toString','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','login','map','value','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','audience','isAfter','unix','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','data5','update','authorization_code','intervals','bind','findAll','all','catch','error','crypto','jsonwebtoken','moment'];(function(_0x4f3c10,_0x4cb1b1){var _0x1802cb=function(_0x4d4a74){while(--_0x4d4a74){_0x4f3c10['push'](_0x4f3c10['shift']());}};_0x1802cb(++_0x4cb1b1);}(_0xe3c1,0x197));var _0x1e3c=function(_0x1f7413,_0x3388c3){_0x1f7413=_0x1f7413-0x0;var _0x2d2775=_0xe3c1[_0x1f7413];return _0x2d2775;};'use strict';var _=require('lodash');var crypto=require(_0x1e3c('0x0'));var jwt=require(_0x1e3c('0x1'));var moment=require(_0x1e3c('0x2'));var Redis=require(_0x1e3c('0x3'));var rp=require(_0x1e3c('0x4'));var util=require(_0x1e3c('0x5'));var encryptor=require(_0x1e3c('0x6'));var config=require(_0x1e3c('0x7'));var logger=require(_0x1e3c('0x8'))(_0x1e3c('0x9'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x1e3c('0xa'))['db'];config['redis']=_[_0x1e3c('0xb')](config[_0x1e3c('0xc')],{'host':_0x1e3c('0xd'),'port':0x18eb});var redis=new Redis(config[_0x1e3c('0xc')]);var MICROSOFT_AUTH_URL=_0x1e3c('0xe');var AZURE_AUTH_SCOPES={'Outlook365':[_0x1e3c('0xf'),_0x1e3c('0x10'),_0x1e3c('0x11'),_0x1e3c('0x12'),_0x1e3c('0x13'),_0x1e3c('0x14'),_0x1e3c('0x15')],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x1e3c('0x16');var MICROSOFT_TOKEN_ENDPOINT=_0x1e3c('0x17');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x67ca21){var _0x37f729=_['map'](AZURE_AUTH_SCOPES[_0x67ca21[_0x1e3c('0x18')]]);if(_0x67ca21['type']===_0x1e3c('0x19'))_0x37f729[_0x1e3c('0x1a')](_0x67ca21[_0x1e3c('0x1b')]+_0x1e3c('0x1c'));return _0x37f729[_0x1e3c('0x1d')]('\x20');}function getAccessTokenScope(_0x5d45d){if(_0x5d45d[_0x1e3c('0x18')]===_0x1e3c('0x1e'))return _0x1e3c('0x13');if(_0x5d45d['type']===_0x1e3c('0x19'))return _0x5d45d[_0x1e3c('0x1b')]+_0x1e3c('0x1c');}function generateMicrosoftAuthorizationUrl(_0x2a58f0,_0x4fc0bc){var _0x42d810=MICROSOFT_AUTH_URL[_0x1e3c('0x1f')](_0x1e3c('0x20'),_0x2a58f0[_0x1e3c('0x21')]);var _0x401782=[_0x1e3c('0x22'),'id_token'];var _0x450610=Buffer[_0x1e3c('0x23')](JSON[_0x1e3c('0x24')]({'id':_0x4fc0bc}))['toString'](_0x1e3c('0x25'));var _0x187a57=crypto[_0x1e3c('0x26')](0x10)[_0x1e3c('0x27')](_0x1e3c('0x28'));var _0x12df62=getAuthorizationScopes(_0x2a58f0);var _0x24d2f6=[{'key':_0x1e3c('0x29'),'value':_0x2a58f0[_0x1e3c('0x2a')]},{'key':_0x1e3c('0x2b'),'value':encodeURIComponent(_0x401782[_0x1e3c('0x1d')]('\x20'))},{'key':_0x1e3c('0x2c'),'value':_0x2a58f0[_0x1e3c('0x2d')]},{'key':_0x1e3c('0x2e'),'value':_0x1e3c('0x2f')},{'key':_0x1e3c('0x30'),'value':encodeURIComponent(_0x12df62)},{'key':_0x1e3c('0x31'),'value':_0x450610},{'key':_0x1e3c('0x32'),'value':_0x187a57},{'key':_0x1e3c('0x33'),'value':_0x1e3c('0x34')}];var _0x3b29c8=_0x42d810+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x1e3c('0x35')](_0x24d2f6,function(_0x55baa2){return _0x55baa2['key']+'='+_0x55baa2[_0x1e3c('0x36')];})[_0x1e3c('0x1d')]('&');_0x2a58f0[_0x1e3c('0x37')]={'issuer':_0x42d810['replace'](_0x1e3c('0x38'),''),'audience':_0x2a58f0[_0x1e3c('0x2a')],'state':_0x450610,'nonce':_0x187a57};redis[_0x1e3c('0x39')](_0x450610,JSON[_0x1e3c('0x24')](_0x2a58f0));return _0x3b29c8;}function isValidIdToken(_0x561cd3,_0x253a02){try{var _0x3fb046=jwt[_0x1e3c('0x3a')](_0x561cd3,{'complete':!![]});var _0x14b90e=_0x3fb046[_0x1e3c('0x3b')];if(_0x14b90e[_0x1e3c('0x3c')]!==_0x253a02[_0x1e3c('0x3d')])return![];if(_0x14b90e['aud']!==_0x253a02[_0x1e3c('0x3e')])return![];if(_0x14b90e['nonce']!==_0x253a02['nonce'])return![];if(moment()[_0x1e3c('0x3f')](moment[_0x1e3c('0x40')](_0x14b90e['exp'])))return![];return!![];}catch(_0x5289ad){throw _0x5289ad;}}function refreshOauth2MicrosoftAccessToken(_0x1c9ce7){return Promise['resolve']()[_0x1e3c('0x41')](function(){if(_0x1c9ce7[_0x1e3c('0x42')])return _0x1c9ce7;return db[_0x1e3c('0x43')][_0x1e3c('0x44')]({'where':{'id':_0x1c9ce7['id']},'raw':!![]});})[_0x1e3c('0x41')](function(_0x5a2a72){var _0x56d123={'grant_type':_0x1e3c('0x45'),'refresh_token':_0x5a2a72[_0x1e3c('0x46')],'scope':getAccessTokenScope(_0x5a2a72),'redirect_uri':_0x5a2a72['data4'],'client_id':_0x5a2a72[_0x1e3c('0x2a')],'client_secret':encryptor[_0x1e3c('0x47')](_0x5a2a72['data3'])};var _0x5476ce={'method':_0x1e3c('0x48'),'uri':MICROSOFT_AUTH_URL['replace'](_0x1e3c('0x20'),_0x5a2a72['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x56d123,'json':!![]};return rp(_0x5476ce);})[_0x1e3c('0x41')](function(_0x259eec){_0x1c9ce7[_0x1e3c('0x49')]=_0x259eec['access_token'];_0x1c9ce7[_0x1e3c('0x46')]=_0x259eec[_0x1e3c('0x45')];return db[_0x1e3c('0x43')][_0x1e3c('0x4a')]({'data5':_0x1c9ce7[_0x1e3c('0x49')],'data6':_0x1c9ce7[_0x1e3c('0x46')]},{'where':{'id':_0x1c9ce7['id']}});})[_0x1e3c('0x41')](function(){return _0x1c9ce7;})['catch'](function(_0x32d1ea){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x1c9ce7['id'],_0x32d1ea);});}function getOauth2MicrosoftAccessToken(_0x3b0c20,_0x2cb53c){var _0x1ada52={'grant_type':_0x1e3c('0x4b'),'code':_0x3b0c20,'scope':getAccessTokenScope(_0x2cb53c),'redirect_uri':_0x2cb53c[_0x1e3c('0x2d')],'client_id':_0x2cb53c['data1'],'client_secret':encryptor['decryptString'](_0x2cb53c[_0x1e3c('0x42')])};var _0x7e7bb={'method':_0x1e3c('0x48'),'uri':MICROSOFT_AUTH_URL['replace'](_0x1e3c('0x20'),_0x2cb53c[_0x1e3c('0x21')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1ada52,'json':!![]};return rp(_0x7e7bb);}function startRefreshInterval(_0x515286){var _0x4dc746=schedule[_0x1e3c('0x4c')];if(_0x4dc746[_0x515286['id']])clearInterval(_0x4dc746[_0x515286['id']]);_0x4dc746[_0x515286['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x1e3c('0x4d')](this,{'id':_0x515286['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x1e3c('0x4c')]=_0x4dc746;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x1e3c('0x4e')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x1e3c('0x41')](function(_0x1648cf){var _0x200708=_0x1648cf['map'](function(_0x1b2d93){return refreshOauth2MicrosoftAccessToken(_0x1b2d93)['then'](function(_0x208abc){startRefreshInterval(_0x208abc);});});return Promise[_0x1e3c('0x4f')](_0x200708);})[_0x1e3c('0x50')](function(_0x15b73d){var _0x40ed25=_0x15b73d?util['inspect'](_0x15b73d,{'showHidden':![],'depth':null}):'';logger[_0x1e3c('0x51')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x40ed25);});}module['exports']={'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 cc32fb6..a46546d 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 _0xd5a2=['debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s'];(function(_0xa48ac5,_0xde975d){var _0x1e1d7a=function(_0x529efa){while(--_0x529efa){_0xa48ac5['push'](_0xa48ac5['shift']());}};_0x1e1d7a(++_0xde975d);}(_0xd5a2,0x1eb));var _0x2d5a=function(_0x568c2c,_0x366739){_0x568c2c=_0x568c2c-0x0;var _0x465923=_0xd5a2[_0x568c2c];return _0x465923;};'use strict';var _=require('lodash');var util=require(_0x2d5a('0x0'));var moment=require(_0x2d5a('0x1'));var BPromise=require(_0x2d5a('0x2'));var rs=require(_0x2d5a('0x3'));var fs=require('fs');var Redis=require(_0x2d5a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d5a('0x5'));var logger=require(_0x2d5a('0x6'))(_0x2d5a('0x7'));var config=require(_0x2d5a('0x8'));var jayson=require(_0x2d5a('0x9'));var client=jayson[_0x2d5a('0xa')][_0x2d5a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ae103,_0x1cdfc4,_0x7eb4c3){return new BPromise(function(_0x79898c,_0x4d5c52){return client['request'](_0x1ae103,_0x7eb4c3)[_0x2d5a('0xc')](function(_0x562b6a){logger[_0x2d5a('0xd')](_0x2d5a('0xe'),_0x1cdfc4,'request\x20sent');logger[_0x2d5a('0xf')](_0x2d5a('0x10'),_0x1cdfc4,_0x2d5a('0x11'),JSON[_0x2d5a('0x12')](_0x562b6a));if(_0x562b6a[_0x2d5a('0x13')]){if(_0x562b6a['error'][_0x2d5a('0x14')]===0x1f4){logger[_0x2d5a('0x13')](_0x2d5a('0xe'),_0x1cdfc4,_0x562b6a[_0x2d5a('0x13')]['message']);return _0x4d5c52(_0x562b6a['error'][_0x2d5a('0x15')]);}logger[_0x2d5a('0x13')](_0x2d5a('0xe'),_0x1cdfc4,_0x562b6a[_0x2d5a('0x13')]['message']);return _0x79898c(_0x562b6a[_0x2d5a('0x13')][_0x2d5a('0x15')]);}else{logger[_0x2d5a('0xd')](_0x2d5a('0xe'),_0x1cdfc4,_0x2d5a('0x11'));_0x79898c(_0x562b6a['result'][_0x2d5a('0x15')]);}})[_0x2d5a('0x16')](function(_0x38de62){logger[_0x2d5a('0x13')](_0x2d5a('0xe'),_0x1cdfc4,_0x38de62);_0x4d5c52(_0x38de62);});});}
\ No newline at end of file
+var _0x2581=['request','then','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','CloudProvider,\x20%s,\x20%s','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x16fb2b,_0xc16fac){var _0x26b2b8=function(_0x30d7fa){while(--_0x30d7fa){_0x16fb2b['push'](_0x16fb2b['shift']());}};_0x26b2b8(++_0xc16fac);}(_0x2581,0xcb));var _0x1258=function(_0x41cf27,_0x41b729){_0x41cf27=_0x41cf27-0x0;var _0x530b52=_0x2581[_0x41cf27];return _0x530b52;};'use strict';var _=require(_0x1258('0x0'));var util=require(_0x1258('0x1'));var moment=require(_0x1258('0x2'));var BPromise=require(_0x1258('0x3'));var rs=require(_0x1258('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1258('0x5'))['db'];var utils=require(_0x1258('0x6'));var logger=require(_0x1258('0x7'))(_0x1258('0x8'));var config=require(_0x1258('0x9'));var jayson=require(_0x1258('0xa'));var client=jayson[_0x1258('0xb')][_0x1258('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x582ed7,_0x3e1044,_0x21cd98){return new BPromise(function(_0x468494,_0x18bbac){return client[_0x1258('0xd')](_0x582ed7,_0x21cd98)[_0x1258('0xe')](function(_0x429efc){logger['info']('CloudProvider,\x20%s,\x20%s',_0x3e1044,_0x1258('0xf'));logger[_0x1258('0x10')](_0x1258('0x11'),_0x3e1044,_0x1258('0xf'),JSON['stringify'](_0x429efc));if(_0x429efc[_0x1258('0x12')]){if(_0x429efc[_0x1258('0x12')][_0x1258('0x13')]===0x1f4){logger[_0x1258('0x12')]('CloudProvider,\x20%s,\x20%s',_0x3e1044,_0x429efc[_0x1258('0x12')][_0x1258('0x14')]);return _0x18bbac(_0x429efc[_0x1258('0x12')][_0x1258('0x14')]);}logger[_0x1258('0x12')](_0x1258('0x15'),_0x3e1044,_0x429efc[_0x1258('0x12')]['message']);return _0x468494(_0x429efc[_0x1258('0x12')]['message']);}else{logger[_0x1258('0x16')](_0x1258('0x15'),_0x3e1044,_0x1258('0xf'));_0x468494(_0x429efc[_0x1258('0x17')][_0x1258('0x14')]);}})['catch'](function(_0x1645a6){logger[_0x1258('0x12')](_0x1258('0x15'),_0x3e1044,_0x1645a6);_0x18bbac(_0x1645a6);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 6c31f98..d5c00a7 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 _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x199cc7,_0x5bace6){var _0x3fcea6=function(_0x444685){while(--_0x444685){_0x199cc7['push'](_0x199cc7['shift']());}};_0x3fcea6(++_0x5bace6);}(_0xadb5,0xad));var _0x5adb=function(_0x19e1d7,_0x2be996){_0x19e1d7=_0x19e1d7-0x0;var _0x41db5f=_0xadb5[_0x19e1d7];return _0x41db5f;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router;
\ No newline at end of file
+var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x764874,_0x3ed544){var _0x29f9d5=function(_0x152dad){while(--_0x152dad){_0x764874['push'](_0x764874['shift']());}};_0x29f9d5(++_0x3ed544);}(_0x5f2f,0x73));var _0xf5f2=function(_0x392713,_0x49cee8){_0x392713=_0x392713-0x0;var _0x28c927=_0x5f2f[_0x392713];return _0x28c927;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index f8655ba..8f610c7 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 _0x49e9=['exports','STRING','name'];(function(_0x1fd2e6,_0x319411){var _0x38284b=function(_0x220170){while(--_0x220170){_0x1fd2e6['push'](_0x1fd2e6['shift']());}};_0x38284b(++_0x319411);}(_0x49e9,0x1cb));var _0x949e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x49e9[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x949e('0x0')]={'name':{'type':Sequelize[_0x949e('0x1')],'unique':_0x949e('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x949e('0x1')]},'companyId':{'type':Sequelize[_0x949e('0x1')]},'website':{'type':Sequelize[_0x949e('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x949e('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x949e('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x949e('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x949e('0x1')]},'sStreet':{'type':Sequelize[_0x949e('0x1')]},'sPostalCode':{'type':Sequelize[_0x949e('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x949e('0x1')]},'description':{'type':Sequelize[_0x949e('0x1')]}};
\ No newline at end of file
+var _0xa4a5=['exports','STRING','name','sequelize'];(function(_0x29380f,_0x281388){var _0xb059c7=function(_0x9efd5e){while(--_0x9efd5e){_0x29380f['push'](_0x29380f['shift']());}};_0xb059c7(++_0x281388);}(_0xa4a5,0xef));var _0x5a4a=function(_0x47f4f9,_0x4aa5f0){_0x47f4f9=_0x47f4f9-0x0;var _0x203a46=_0xa4a5[_0x47f4f9];return _0x203a46;};'use strict';var Sequelize=require(_0x5a4a('0x0'));module[_0x5a4a('0x1')]={'name':{'type':Sequelize[_0x5a4a('0x2')],'unique':_0x5a4a('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x5a4a('0x2')]},'companyId':{'type':Sequelize[_0x5a4a('0x2')]},'website':{'type':Sequelize[_0x5a4a('0x2')]},'phone':{'type':Sequelize[_0x5a4a('0x2')]},'fax':{'type':Sequelize[_0x5a4a('0x2')]},'type':{'type':Sequelize[_0x5a4a('0x2')]},'street':{'type':Sequelize[_0x5a4a('0x2')]},'postalCode':{'type':Sequelize[_0x5a4a('0x2')]},'city':{'type':Sequelize[_0x5a4a('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x5a4a('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x5a4a('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x5a4a('0x2')]},'sCity':{'type':Sequelize[_0x5a4a('0x2')]},'sCountry':{'type':Sequelize[_0x5a4a('0x2')]},'description':{'type':Sequelize[_0x5a4a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 0727310..d3742c8 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 _0xdbcb=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addContacts','ids','omit','findOne','CmContact','options','getContacts','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','error','name','index','CmCompany','keys','query','filters','intersection','model'];(function(_0x326f81,_0x57c9d8){var _0x8a3c6e=function(_0xde3601){while(--_0xde3601){_0x326f81['push'](_0x326f81['shift']());}};_0x8a3c6e(++_0x57c9d8);}(_0xdbcb,0x12f));var _0xbdbc=function(_0x25dfdf,_0x542333){_0x25dfdf=_0x25dfdf-0x0;var _0x5220da=_0xdbcb[_0x25dfdf];return _0x5220da;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbdbc('0x0'));var zipdir=require(_0xbdbc('0x1'));var jsonpatch=require(_0xbdbc('0x2'));var rp=require(_0xbdbc('0x3'));var moment=require(_0xbdbc('0x4'));var BPromise=require(_0xbdbc('0x5'));var Mustache=require(_0xbdbc('0x6'));var util=require(_0xbdbc('0x7'));var path=require('path');var sox=require(_0xbdbc('0x8'));var csv=require(_0xbdbc('0x9'));var ejs=require(_0xbdbc('0xa'));var fs=require('fs');var fs_extra=require(_0xbdbc('0xb'));var _=require(_0xbdbc('0xc'));var squel=require(_0xbdbc('0xd'));var crypto=require(_0xbdbc('0xe'));var jsforce=require(_0xbdbc('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xbdbc('0x9'));var querystring=require('querystring');var Papa=require(_0xbdbc('0x10'));var Redis=require(_0xbdbc('0x11'));var authService=require(_0xbdbc('0x12'));var qs=require(_0xbdbc('0x13'));var as=require(_0xbdbc('0x14'));var hardwareService=require(_0xbdbc('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xbdbc('0x16'));var config=require(_0xbdbc('0x17'));var licenseUtil=require(_0xbdbc('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14335d,_0x51e0f5){_0x51e0f5=_0x51e0f5||0xcc;return function(_0x2d6c27){if(_0x2d6c27){return _0x14335d[_0xbdbc('0x19')](_0x51e0f5);}return _0x14335d[_0xbdbc('0x1a')](_0x51e0f5)[_0xbdbc('0x1b')]();};}function respondWithResult(_0x495abb,_0xe41dda){_0xe41dda=_0xe41dda||0xc8;return function(_0x5efb98){if(_0x5efb98){return _0x495abb[_0xbdbc('0x1a')](_0xe41dda)[_0xbdbc('0x1c')](_0x5efb98);}};}function respondWithFilteredResult(_0x4eb118,_0x3f6ba3){return function(_0x2cacff){if(_0x2cacff){var _0xce5d1f=typeof _0x3f6ba3['offset']===_0xbdbc('0x1d')&&typeof _0x3f6ba3[_0xbdbc('0x1e')]==='undefined';var _0x5077ea=_0x2cacff[_0xbdbc('0x1f')];var _0x504810=_0xce5d1f?0x0:_0x3f6ba3[_0xbdbc('0x20')];var _0x4f3bd1=_0xce5d1f?_0x2cacff[_0xbdbc('0x1f')]:_0x3f6ba3[_0xbdbc('0x20')]+_0x3f6ba3[_0xbdbc('0x1e')];var _0x341590;if(_0x4f3bd1>=_0x5077ea){_0x4f3bd1=_0x5077ea;_0x341590=0xc8;}else{_0x341590=0xce;}_0x4eb118[_0xbdbc('0x1a')](_0x341590);return _0x4eb118[_0xbdbc('0x21')](_0xbdbc('0x22'),_0x504810+'-'+_0x4f3bd1+'/'+_0x5077ea)['json'](_0x2cacff);}return null;};}function patchUpdates(_0x5e405c){return function(_0xe66cfc){try{jsonpatch[_0xbdbc('0x23')](_0xe66cfc,_0x5e405c,!![]);}catch(_0xd21760){return BPromise[_0xbdbc('0x24')](_0xd21760);}return _0xe66cfc[_0xbdbc('0x25')]();};}function saveUpdates(_0x1500ff,_0x345d36){return function(_0x2bb9a2){if(_0x2bb9a2){return _0x2bb9a2[_0xbdbc('0x26')](_0x1500ff)[_0xbdbc('0x27')](function(_0x551253){return _0x551253;});}return null;};}function removeEntity(_0x5cee67,_0x2416a4){return function(_0x285158){if(_0x285158){return _0x285158[_0xbdbc('0x28')]()[_0xbdbc('0x27')](function(){var _0x455a30=_0x285158[_0xbdbc('0x29')]({'plain':!![]});var _0x5c16b7=_0xbdbc('0x2a');return db[_0xbdbc('0x2b')][_0xbdbc('0x28')]({'where':{'type':_0x5c16b7,'resourceId':_0x455a30['id']}})['then'](function(){return _0x285158;});})[_0xbdbc('0x27')](function(){_0x5cee67[_0xbdbc('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x398321,_0x158201){return function(_0xe962ec){if(!_0xe962ec){_0x398321[_0xbdbc('0x19')](0x194);}return _0xe962ec;};}function handleError(_0x144f2e,_0x114ec5){_0x114ec5=_0x114ec5||0x1f4;return function(_0x20571c){logger[_0xbdbc('0x2c')](_0x20571c['stack']);if(_0x20571c[_0xbdbc('0x2d')]){delete _0x20571c['name'];}_0x144f2e[_0xbdbc('0x1a')](_0x114ec5)['send'](_0x20571c);};}exports[_0xbdbc('0x2e')]=function(_0x2e8458,_0x549643){var _0x4127fb={},_0xcdc5b1={},_0x9496d6={'count':0x0,'rows':[]};return db[_0xbdbc('0x2f')]['describe']()['then'](function(_0x100e07){_0xcdc5b1['model']=_[_0xbdbc('0x30')](_0x100e07);_0xcdc5b1[_0xbdbc('0x31')]=_['keys'](_0x2e8458[_0xbdbc('0x31')]);_0xcdc5b1[_0xbdbc('0x32')]=_[_0xbdbc('0x33')](_0xcdc5b1[_0xbdbc('0x34')],_0xcdc5b1['query']);_0x4127fb[_0xbdbc('0x35')]=_['intersection'](_0xcdc5b1[_0xbdbc('0x34')],qs[_0xbdbc('0x36')](_0x2e8458['query'][_0xbdbc('0x36')]));_0x4127fb[_0xbdbc('0x35')]=_0x4127fb[_0xbdbc('0x35')][_0xbdbc('0x37')]?_0x4127fb[_0xbdbc('0x35')]:_0xcdc5b1[_0xbdbc('0x34')];if(!_0x2e8458[_0xbdbc('0x31')][_0xbdbc('0x38')](_0xbdbc('0x39'))){_0x4127fb[_0xbdbc('0x1e')]=qs[_0xbdbc('0x1e')](_0x2e8458[_0xbdbc('0x31')][_0xbdbc('0x1e')]);_0x4127fb[_0xbdbc('0x20')]=qs[_0xbdbc('0x20')](_0x2e8458[_0xbdbc('0x31')][_0xbdbc('0x20')]);}_0x4127fb[_0xbdbc('0x3a')]=qs[_0xbdbc('0x3b')](_0x2e8458[_0xbdbc('0x31')][_0xbdbc('0x3b')]);_0x4127fb[_0xbdbc('0x3c')]=qs[_0xbdbc('0x32')](_[_0xbdbc('0x3d')](_0x2e8458[_0xbdbc('0x31')],_0xcdc5b1[_0xbdbc('0x32')]),_0x100e07);if(_0x2e8458[_0xbdbc('0x31')][_0xbdbc('0x3e')]){_0x4127fb[_0xbdbc('0x3c')]=_[_0xbdbc('0x3f')](_0x4127fb[_0xbdbc('0x3c')],{'$or':_[_0xbdbc('0x40')](_0x4127fb[_0xbdbc('0x35')],function(_0x3caa46){var _0xcbe8db={};_0xcbe8db[_0x3caa46]={'$like':'%'+_0x2e8458[_0xbdbc('0x31')][_0xbdbc('0x3e')]+'%'};return _0xcbe8db;})});}_0x4127fb=_[_0xbdbc('0x3f')]({},_0x4127fb,_0x2e8458['options']);var _0x4239c2={'where':_0x4127fb[_0xbdbc('0x3c')]};return db['CmCompany']['count'](_0x4239c2)['then'](function(_0x563b43){_0x9496d6[_0xbdbc('0x1f')]=_0x563b43;if(_0x2e8458[_0xbdbc('0x31')][_0xbdbc('0x41')]){_0x4127fb[_0xbdbc('0x42')]=[{'all':!![]}];}return db['CmCompany'][_0xbdbc('0x43')](_0x4127fb);})[_0xbdbc('0x27')](function(_0x25681c){_0x9496d6[_0xbdbc('0x44')]=_0x25681c;return _0x9496d6;})[_0xbdbc('0x27')](respondWithFilteredResult(_0x549643,_0x4127fb))[_0xbdbc('0x45')](handleError(_0x549643,null));})[_0xbdbc('0x45')](handleError(_0x549643,null));};exports[_0xbdbc('0x46')]=function(_0x528900,_0x52d471){var _0x3a8ff2={'raw':![],'where':{'id':_0x528900[_0xbdbc('0x47')]['id']}},_0x4ecc7f={};_0x4ecc7f['model']=_[_0xbdbc('0x30')](db[_0xbdbc('0x2f')][_0xbdbc('0x48')]);_0x4ecc7f['query']=_[_0xbdbc('0x30')](_0x528900[_0xbdbc('0x31')]);_0x4ecc7f[_0xbdbc('0x32')]=_[_0xbdbc('0x33')](_0x4ecc7f[_0xbdbc('0x34')],_0x4ecc7f[_0xbdbc('0x31')]);_0x3a8ff2[_0xbdbc('0x35')]=_[_0xbdbc('0x33')](_0x4ecc7f['model'],qs[_0xbdbc('0x36')](_0x528900['query']['fields']));_0x3a8ff2[_0xbdbc('0x35')]=_0x3a8ff2[_0xbdbc('0x35')][_0xbdbc('0x37')]?_0x3a8ff2[_0xbdbc('0x35')]:_0x4ecc7f[_0xbdbc('0x34')];if(_0x528900[_0xbdbc('0x31')]['includeAll']){_0x3a8ff2[_0xbdbc('0x42')]=[{'all':!![]}];}_0x3a8ff2=_['merge']({},_0x3a8ff2,_0x528900['options']);return db[_0xbdbc('0x2f')]['find'](_0x3a8ff2)[_0xbdbc('0x27')](handleEntityNotFound(_0x52d471,null))['then'](respondWithResult(_0x52d471,null))[_0xbdbc('0x45')](handleError(_0x52d471,null));};exports['create']=function(_0x59d54f,_0x49f7c4){return db[_0xbdbc('0x2f')][_0xbdbc('0x49')](_0x59d54f['body'],{})[_0xbdbc('0x27')](function(_0x45ea2c){var _0x2dec30=_0x59d54f[_0xbdbc('0x4a')][_0xbdbc('0x29')]({'plain':!![]});if(!_0x2dec30)throw new Error(_0xbdbc('0x4b'));if(_0x2dec30['role']===_0xbdbc('0x4a')){var _0x4ada71=_0x45ea2c[_0xbdbc('0x29')]({'plain':!![]});var _0xc3e643=_0xbdbc('0x2a');return db[_0xbdbc('0x4c')][_0xbdbc('0x4d')]({'where':{'name':_0xc3e643,'userProfileId':_0x2dec30['userProfileId']},'raw':!![]})[_0xbdbc('0x27')](function(_0x4b9426){if(_0x4b9426&&_0x4b9426[_0xbdbc('0x4e')]===0x0){return db[_0xbdbc('0x2b')]['create']({'name':_0x4ada71['name'],'resourceId':_0x4ada71['id'],'type':_0x4b9426['name'],'sectionId':_0x4b9426['id']},{})[_0xbdbc('0x27')](function(){return _0x45ea2c;});}else{return _0x45ea2c;}})[_0xbdbc('0x45')](function(_0x5ac03c){logger[_0xbdbc('0x2c')](_0xbdbc('0x4f'),_0x5ac03c);throw _0x5ac03c;});}return _0x45ea2c;})[_0xbdbc('0x27')](respondWithResult(_0x49f7c4,0xc9))['catch'](handleError(_0x49f7c4,null));};exports[_0xbdbc('0x26')]=function(_0x310a8d,_0x5e983f){if(_0x310a8d['body']['id']){delete _0x310a8d['body']['id'];}return db[_0xbdbc('0x2f')][_0xbdbc('0x4d')]({'where':{'id':_0x310a8d[_0xbdbc('0x47')]['id']}})[_0xbdbc('0x27')](handleEntityNotFound(_0x5e983f,null))[_0xbdbc('0x27')](saveUpdates(_0x310a8d[_0xbdbc('0x50')],null))[_0xbdbc('0x27')](respondWithResult(_0x5e983f,null))[_0xbdbc('0x45')](handleError(_0x5e983f,null));};exports['destroy']=function(_0x4b83c7,_0x4dc319){return db[_0xbdbc('0x2f')][_0xbdbc('0x4d')]({'where':{'id':_0x4b83c7[_0xbdbc('0x47')]['id']}})[_0xbdbc('0x27')](handleEntityNotFound(_0x4dc319,null))['then'](removeEntity(_0x4dc319,null))[_0xbdbc('0x45')](handleError(_0x4dc319,null));};exports[_0xbdbc('0x51')]=function(_0x14995f,_0x4c8797){return db[_0xbdbc('0x2f')][_0xbdbc('0x51')]()[_0xbdbc('0x27')](respondWithResult(_0x4c8797,null))['catch'](handleError(_0x4c8797,null));};exports['addContacts']=function(_0x2469ea,_0xdcdd54,_0x292175){return db['CmContact'][_0xbdbc('0x4d')]({'where':{'id':_0x2469ea['params']['id']}})[_0xbdbc('0x27')](handleEntityNotFound(_0xdcdd54,null))[_0xbdbc('0x27')](function(_0x3dc32c){if(_0x3dc32c){return _0x3dc32c[_0xbdbc('0x52')](_0x2469ea['body'][_0xbdbc('0x53')],_[_0xbdbc('0x54')](_0x2469ea[_0xbdbc('0x50')],[_0xbdbc('0x53'),'id'])||{});}})[_0xbdbc('0x27')](respondWithResult(_0xdcdd54,null))[_0xbdbc('0x45')](handleError(_0xdcdd54,null));};exports['getContacts']=function(_0x4e3d19,_0x58f641,_0x1b7827){var _0x321bd4={};var _0x2975db={};var _0x3f5fdf;var _0x27481c;return db[_0xbdbc('0x2f')][_0xbdbc('0x55')]({'where':{'id':_0x4e3d19[_0xbdbc('0x47')]['id']}})[_0xbdbc('0x27')](handleEntityNotFound(_0x58f641,null))[_0xbdbc('0x27')](function(_0x5aa9d2){if(_0x5aa9d2){_0x3f5fdf=_0x5aa9d2;_0x2975db['model']=_[_0xbdbc('0x30')](db[_0xbdbc('0x56')][_0xbdbc('0x48')]);_0x2975db[_0xbdbc('0x31')]=_[_0xbdbc('0x30')](_0x4e3d19['query']);_0x2975db['filters']=_[_0xbdbc('0x33')](_0x2975db[_0xbdbc('0x34')],_0x2975db[_0xbdbc('0x31')]);_0x321bd4[_0xbdbc('0x35')]=_['intersection'](_0x2975db[_0xbdbc('0x34')],qs[_0xbdbc('0x36')](_0x4e3d19[_0xbdbc('0x31')]['fields']));_0x321bd4[_0xbdbc('0x35')]=_0x321bd4['attributes']['length']?_0x321bd4[_0xbdbc('0x35')]:_0x2975db[_0xbdbc('0x34')];_0x321bd4['order']=qs[_0xbdbc('0x3b')](_0x4e3d19[_0xbdbc('0x31')][_0xbdbc('0x3b')]);_0x321bd4[_0xbdbc('0x3c')]=qs[_0xbdbc('0x32')](_[_0xbdbc('0x3d')](_0x4e3d19['query'],_0x2975db[_0xbdbc('0x32')]));if(_0x4e3d19[_0xbdbc('0x31')][_0xbdbc('0x3e')]){_0x321bd4['where']=_['merge'](_0x321bd4[_0xbdbc('0x3c')],{'$or':_[_0xbdbc('0x40')](_0x321bd4[_0xbdbc('0x35')],function(_0x294614){var _0x42a1ff={};_0x42a1ff[_0x294614]={'$like':'%'+_0x4e3d19[_0xbdbc('0x31')][_0xbdbc('0x3e')]+'%'};return _0x42a1ff;})});}_0x321bd4=_[_0xbdbc('0x3f')]({},_0x321bd4,_0x4e3d19[_0xbdbc('0x57')]);return _0x3f5fdf[_0xbdbc('0x58')](_0x321bd4);}})[_0xbdbc('0x27')](function(_0x35385e){if(_0x35385e){_0x27481c=_0x35385e['length'];if(!_0x4e3d19['query']['hasOwnProperty'](_0xbdbc('0x39'))){_0x321bd4[_0xbdbc('0x1e')]=qs[_0xbdbc('0x1e')](_0x4e3d19[_0xbdbc('0x31')]['limit']);_0x321bd4['offset']=qs[_0xbdbc('0x20')](_0x4e3d19[_0xbdbc('0x31')][_0xbdbc('0x20')]);}return _0x3f5fdf[_0xbdbc('0x58')](_0x321bd4);}})['then'](function(_0xb755b8){if(_0xb755b8){return _0xb755b8?{'count':_0x27481c,'rows':_0xb755b8}:null;}})[_0xbdbc('0x27')](respondWithResult(_0x58f641,null))[_0xbdbc('0x45')](handleError(_0x58f641,null));};
\ No newline at end of file
+var _0xfd72=['error','stack','name','send','index','CmCompany','keys','query','filters','model','attributes','fields','nolimit','order','sort','where','filter','map','options','include','findAll','rows','catch','show','params','rawAttributes','intersection','length','includeAll','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','ids','getContacts','findOne','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','json','apply','update','then','destroy','get','UserProfileResource'];(function(_0x3dffd3,_0x44a5b7){var _0x2a65af=function(_0x57c5e1){while(--_0x57c5e1){_0x3dffd3['push'](_0x3dffd3['shift']());}};_0x2a65af(++_0x44a5b7);}(_0xfd72,0x182));var _0x2fd7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xfd72[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x2fd7('0x0'));var rimraf=require(_0x2fd7('0x1'));var zipdir=require(_0x2fd7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2fd7('0x3'));var moment=require('moment');var BPromise=require(_0x2fd7('0x4'));var Mustache=require(_0x2fd7('0x5'));var util=require(_0x2fd7('0x6'));var path=require(_0x2fd7('0x7'));var sox=require('sox');var csv=require(_0x2fd7('0x8'));var ejs=require(_0x2fd7('0x9'));var fs=require('fs');var fs_extra=require(_0x2fd7('0xa'));var _=require(_0x2fd7('0xb'));var squel=require(_0x2fd7('0xc'));var crypto=require(_0x2fd7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2fd7('0xe'));var toCsv=require(_0x2fd7('0x8'));var querystring=require('querystring');var Papa=require(_0x2fd7('0xf'));var Redis=require(_0x2fd7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2fd7('0x11'));var as=require(_0x2fd7('0x12'));var hardwareService=require(_0x2fd7('0x13'));var logger=require(_0x2fd7('0x14'))(_0x2fd7('0x15'));var utils=require(_0x2fd7('0x16'));var config=require(_0x2fd7('0x17'));var licenseUtil=require(_0x2fd7('0x18'));var db=require(_0x2fd7('0x19'))['db'];function respondWithStatusCode(_0x554030,_0x337a60){_0x337a60=_0x337a60||0xcc;return function(_0x4bff8c){if(_0x4bff8c){return _0x554030['sendStatus'](_0x337a60);}return _0x554030[_0x2fd7('0x1a')](_0x337a60)['end']();};}function respondWithResult(_0x4dfb68,_0x5e44f2){_0x5e44f2=_0x5e44f2||0xc8;return function(_0x1c0cab){if(_0x1c0cab){return _0x4dfb68['status'](_0x5e44f2)['json'](_0x1c0cab);}};}function respondWithFilteredResult(_0x21d883,_0x1f88e4){return function(_0x38f371){if(_0x38f371){var _0x190b42=typeof _0x1f88e4[_0x2fd7('0x1b')]===_0x2fd7('0x1c')&&typeof _0x1f88e4[_0x2fd7('0x1d')]==='undefined';var _0x2935ee=_0x38f371[_0x2fd7('0x1e')];var _0x339c0b=_0x190b42?0x0:_0x1f88e4[_0x2fd7('0x1b')];var _0xba914b=_0x190b42?_0x38f371[_0x2fd7('0x1e')]:_0x1f88e4['offset']+_0x1f88e4[_0x2fd7('0x1d')];var _0x166061;if(_0xba914b>=_0x2935ee){_0xba914b=_0x2935ee;_0x166061=0xc8;}else{_0x166061=0xce;}_0x21d883[_0x2fd7('0x1a')](_0x166061);return _0x21d883[_0x2fd7('0x1f')]('Content-Range',_0x339c0b+'-'+_0xba914b+'/'+_0x2935ee)[_0x2fd7('0x20')](_0x38f371);}return null;};}function patchUpdates(_0x339ed6){return function(_0x49e1b9){try{jsonpatch[_0x2fd7('0x21')](_0x49e1b9,_0x339ed6,!![]);}catch(_0x3dc2ef){return BPromise['reject'](_0x3dc2ef);}return _0x49e1b9['save']();};}function saveUpdates(_0x166c43,_0x2fd2d2){return function(_0x46ab3a){if(_0x46ab3a){return _0x46ab3a[_0x2fd7('0x22')](_0x166c43)[_0x2fd7('0x23')](function(_0xb766c8){return _0xb766c8;});}return null;};}function removeEntity(_0x1cd919,_0x5ee82a){return function(_0x194923){if(_0x194923){return _0x194923[_0x2fd7('0x24')]()[_0x2fd7('0x23')](function(){var _0x4f5350=_0x194923[_0x2fd7('0x25')]({'plain':!![]});var _0x284575='Companies';return db[_0x2fd7('0x26')][_0x2fd7('0x24')]({'where':{'type':_0x284575,'resourceId':_0x4f5350['id']}})[_0x2fd7('0x23')](function(){return _0x194923;});})['then'](function(){_0x1cd919[_0x2fd7('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f52f8,_0x371552){return function(_0x3dee89){if(!_0x3dee89){_0x2f52f8['sendStatus'](0x194);}return _0x3dee89;};}function handleError(_0x30476c,_0x5cc1b6){_0x5cc1b6=_0x5cc1b6||0x1f4;return function(_0x17be1c){logger[_0x2fd7('0x27')](_0x17be1c[_0x2fd7('0x28')]);if(_0x17be1c[_0x2fd7('0x29')]){delete _0x17be1c[_0x2fd7('0x29')];}_0x30476c['status'](_0x5cc1b6)[_0x2fd7('0x2a')](_0x17be1c);};}exports[_0x2fd7('0x2b')]=function(_0x35a30e,_0x5cef87){var _0x463df3={},_0x462231={},_0x239207={'count':0x0,'rows':[]};return db[_0x2fd7('0x2c')]['describe']()['then'](function(_0x2222aa){_0x462231['model']=_[_0x2fd7('0x2d')](_0x2222aa);_0x462231['query']=_[_0x2fd7('0x2d')](_0x35a30e[_0x2fd7('0x2e')]);_0x462231[_0x2fd7('0x2f')]=_['intersection'](_0x462231[_0x2fd7('0x30')],_0x462231[_0x2fd7('0x2e')]);_0x463df3[_0x2fd7('0x31')]=_['intersection'](_0x462231[_0x2fd7('0x30')],qs['fields'](_0x35a30e[_0x2fd7('0x2e')][_0x2fd7('0x32')]));_0x463df3[_0x2fd7('0x31')]=_0x463df3[_0x2fd7('0x31')]['length']?_0x463df3['attributes']:_0x462231[_0x2fd7('0x30')];if(!_0x35a30e[_0x2fd7('0x2e')]['hasOwnProperty'](_0x2fd7('0x33'))){_0x463df3['limit']=qs['limit'](_0x35a30e[_0x2fd7('0x2e')][_0x2fd7('0x1d')]);_0x463df3[_0x2fd7('0x1b')]=qs[_0x2fd7('0x1b')](_0x35a30e['query']['offset']);}_0x463df3[_0x2fd7('0x34')]=qs[_0x2fd7('0x35')](_0x35a30e['query'][_0x2fd7('0x35')]);_0x463df3[_0x2fd7('0x36')]=qs[_0x2fd7('0x2f')](_['pick'](_0x35a30e[_0x2fd7('0x2e')],_0x462231[_0x2fd7('0x2f')]),_0x2222aa);if(_0x35a30e[_0x2fd7('0x2e')][_0x2fd7('0x37')]){_0x463df3[_0x2fd7('0x36')]=_['merge'](_0x463df3['where'],{'$or':_[_0x2fd7('0x38')](_0x463df3[_0x2fd7('0x31')],function(_0x1595f2){var _0x4291a3={};_0x4291a3[_0x1595f2]={'$like':'%'+_0x35a30e[_0x2fd7('0x2e')][_0x2fd7('0x37')]+'%'};return _0x4291a3;})});}_0x463df3=_['merge']({},_0x463df3,_0x35a30e[_0x2fd7('0x39')]);var _0x2e76c2={'where':_0x463df3[_0x2fd7('0x36')]};return db[_0x2fd7('0x2c')][_0x2fd7('0x1e')](_0x2e76c2)[_0x2fd7('0x23')](function(_0xb58f8c){_0x239207[_0x2fd7('0x1e')]=_0xb58f8c;if(_0x35a30e[_0x2fd7('0x2e')]['includeAll']){_0x463df3[_0x2fd7('0x3a')]=[{'all':!![]}];}return db[_0x2fd7('0x2c')][_0x2fd7('0x3b')](_0x463df3);})[_0x2fd7('0x23')](function(_0x8b6da9){_0x239207[_0x2fd7('0x3c')]=_0x8b6da9;return _0x239207;})['then'](respondWithFilteredResult(_0x5cef87,_0x463df3))[_0x2fd7('0x3d')](handleError(_0x5cef87,null));})['catch'](handleError(_0x5cef87,null));};exports[_0x2fd7('0x3e')]=function(_0x3ea977,_0x4f3090){var _0x53afc4={'raw':![],'where':{'id':_0x3ea977[_0x2fd7('0x3f')]['id']}},_0x196586={};_0x196586['model']=_[_0x2fd7('0x2d')](db[_0x2fd7('0x2c')][_0x2fd7('0x40')]);_0x196586[_0x2fd7('0x2e')]=_[_0x2fd7('0x2d')](_0x3ea977[_0x2fd7('0x2e')]);_0x196586['filters']=_[_0x2fd7('0x41')](_0x196586[_0x2fd7('0x30')],_0x196586[_0x2fd7('0x2e')]);_0x53afc4[_0x2fd7('0x31')]=_[_0x2fd7('0x41')](_0x196586[_0x2fd7('0x30')],qs[_0x2fd7('0x32')](_0x3ea977[_0x2fd7('0x2e')][_0x2fd7('0x32')]));_0x53afc4['attributes']=_0x53afc4[_0x2fd7('0x31')][_0x2fd7('0x42')]?_0x53afc4[_0x2fd7('0x31')]:_0x196586['model'];if(_0x3ea977[_0x2fd7('0x2e')][_0x2fd7('0x43')]){_0x53afc4['include']=[{'all':!![]}];}_0x53afc4=_[_0x2fd7('0x44')]({},_0x53afc4,_0x3ea977[_0x2fd7('0x39')]);return db[_0x2fd7('0x2c')][_0x2fd7('0x45')](_0x53afc4)['then'](handleEntityNotFound(_0x4f3090,null))[_0x2fd7('0x23')](respondWithResult(_0x4f3090,null))['catch'](handleError(_0x4f3090,null));};exports[_0x2fd7('0x46')]=function(_0x1c70e5,_0x1cf57){return db[_0x2fd7('0x2c')][_0x2fd7('0x46')](_0x1c70e5[_0x2fd7('0x47')],{})[_0x2fd7('0x23')](function(_0x3e8440){var _0x5a7e5e=_0x1c70e5[_0x2fd7('0x48')][_0x2fd7('0x25')]({'plain':!![]});if(!_0x5a7e5e)throw new Error(_0x2fd7('0x49'));if(_0x5a7e5e[_0x2fd7('0x4a')]===_0x2fd7('0x48')){var _0x3dbd5f=_0x3e8440[_0x2fd7('0x25')]({'plain':!![]});var _0x297134=_0x2fd7('0x4b');return db[_0x2fd7('0x4c')][_0x2fd7('0x45')]({'where':{'name':_0x297134,'userProfileId':_0x5a7e5e[_0x2fd7('0x4d')]},'raw':!![]})['then'](function(_0x447ad7){if(_0x447ad7&&_0x447ad7[_0x2fd7('0x4e')]===0x0){return db[_0x2fd7('0x26')]['create']({'name':_0x3dbd5f[_0x2fd7('0x29')],'resourceId':_0x3dbd5f['id'],'type':_0x447ad7[_0x2fd7('0x29')],'sectionId':_0x447ad7['id']},{})[_0x2fd7('0x23')](function(){return _0x3e8440;});}else{return _0x3e8440;}})[_0x2fd7('0x3d')](function(_0x51d114){logger[_0x2fd7('0x27')](_0x2fd7('0x4f'),_0x51d114);throw _0x51d114;});}return _0x3e8440;})['then'](respondWithResult(_0x1cf57,0xc9))[_0x2fd7('0x3d')](handleError(_0x1cf57,null));};exports[_0x2fd7('0x22')]=function(_0x2ea39f,_0x10ec6e){if(_0x2ea39f[_0x2fd7('0x47')]['id']){delete _0x2ea39f[_0x2fd7('0x47')]['id'];}return db['CmCompany'][_0x2fd7('0x45')]({'where':{'id':_0x2ea39f['params']['id']}})[_0x2fd7('0x23')](handleEntityNotFound(_0x10ec6e,null))[_0x2fd7('0x23')](saveUpdates(_0x2ea39f['body'],null))[_0x2fd7('0x23')](respondWithResult(_0x10ec6e,null))['catch'](handleError(_0x10ec6e,null));};exports[_0x2fd7('0x24')]=function(_0x2d6413,_0x3c2094){return db['CmCompany'][_0x2fd7('0x45')]({'where':{'id':_0x2d6413[_0x2fd7('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3c2094,null))['then'](removeEntity(_0x3c2094,null))['catch'](handleError(_0x3c2094,null));};exports['describe']=function(_0x54731d,_0x4841ad){return db['CmCompany'][_0x2fd7('0x50')]()[_0x2fd7('0x23')](respondWithResult(_0x4841ad,null))[_0x2fd7('0x3d')](handleError(_0x4841ad,null));};exports[_0x2fd7('0x51')]=function(_0x36b8f8,_0x3ddfd6,_0x2782c6){return db['CmContact'][_0x2fd7('0x45')]({'where':{'id':_0x36b8f8[_0x2fd7('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3ddfd6,null))[_0x2fd7('0x23')](function(_0x5afc6c){if(_0x5afc6c){return _0x5afc6c[_0x2fd7('0x51')](_0x36b8f8['body'][_0x2fd7('0x52')],_['omit'](_0x36b8f8['body'],[_0x2fd7('0x52'),'id'])||{});}})[_0x2fd7('0x23')](respondWithResult(_0x3ddfd6,null))['catch'](handleError(_0x3ddfd6,null));};exports[_0x2fd7('0x53')]=function(_0xf1e904,_0x28f1c5,_0x1fb28e){var _0x1b9bbd={};var _0x1b20b0={};var _0x7a4906;var _0x393c53;return db[_0x2fd7('0x2c')][_0x2fd7('0x54')]({'where':{'id':_0xf1e904[_0x2fd7('0x3f')]['id']}})[_0x2fd7('0x23')](handleEntityNotFound(_0x28f1c5,null))[_0x2fd7('0x23')](function(_0x5c8907){if(_0x5c8907){_0x7a4906=_0x5c8907;_0x1b20b0[_0x2fd7('0x30')]=_[_0x2fd7('0x2d')](db['CmContact'][_0x2fd7('0x40')]);_0x1b20b0[_0x2fd7('0x2e')]=_[_0x2fd7('0x2d')](_0xf1e904[_0x2fd7('0x2e')]);_0x1b20b0[_0x2fd7('0x2f')]=_[_0x2fd7('0x41')](_0x1b20b0['model'],_0x1b20b0['query']);_0x1b9bbd[_0x2fd7('0x31')]=_[_0x2fd7('0x41')](_0x1b20b0['model'],qs[_0x2fd7('0x32')](_0xf1e904[_0x2fd7('0x2e')][_0x2fd7('0x32')]));_0x1b9bbd[_0x2fd7('0x31')]=_0x1b9bbd[_0x2fd7('0x31')][_0x2fd7('0x42')]?_0x1b9bbd[_0x2fd7('0x31')]:_0x1b20b0[_0x2fd7('0x30')];_0x1b9bbd[_0x2fd7('0x34')]=qs['sort'](_0xf1e904['query'][_0x2fd7('0x35')]);_0x1b9bbd[_0x2fd7('0x36')]=qs[_0x2fd7('0x2f')](_['pick'](_0xf1e904[_0x2fd7('0x2e')],_0x1b20b0[_0x2fd7('0x2f')]));if(_0xf1e904[_0x2fd7('0x2e')][_0x2fd7('0x37')]){_0x1b9bbd[_0x2fd7('0x36')]=_[_0x2fd7('0x44')](_0x1b9bbd[_0x2fd7('0x36')],{'$or':_[_0x2fd7('0x38')](_0x1b9bbd['attributes'],function(_0x5ddbe3){var _0x1d9374={};_0x1d9374[_0x5ddbe3]={'$like':'%'+_0xf1e904[_0x2fd7('0x2e')][_0x2fd7('0x37')]+'%'};return _0x1d9374;})});}_0x1b9bbd=_[_0x2fd7('0x44')]({},_0x1b9bbd,_0xf1e904[_0x2fd7('0x39')]);return _0x7a4906[_0x2fd7('0x53')](_0x1b9bbd);}})['then'](function(_0x6c309e){if(_0x6c309e){_0x393c53=_0x6c309e[_0x2fd7('0x42')];if(!_0xf1e904['query']['hasOwnProperty'](_0x2fd7('0x33'))){_0x1b9bbd[_0x2fd7('0x1d')]=qs[_0x2fd7('0x1d')](_0xf1e904[_0x2fd7('0x2e')][_0x2fd7('0x1d')]);_0x1b9bbd['offset']=qs[_0x2fd7('0x1b')](_0xf1e904[_0x2fd7('0x2e')]['offset']);}return _0x7a4906[_0x2fd7('0x53')](_0x1b9bbd);}})[_0x2fd7('0x23')](function(_0xa837a8){if(_0xa837a8){return _0xa837a8?{'count':_0x393c53,'rows':_0xa837a8}:null;}})[_0x2fd7('0x23')](respondWithResult(_0x28f1c5,null))[_0x2fd7('0x3d')](handleError(_0x28f1c5,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 35aab15..45fec10 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 _0xf50f=['exports','cm_companies','lodash','util','bluebird','path','rimraf','./cmCompany.attributes'];(function(_0x2ffc46,_0x35ce3c){var _0x1eda8f=function(_0x285344){while(--_0x285344){_0x2ffc46['push'](_0x2ffc46['shift']());}};_0x1eda8f(++_0x35ce3c);}(_0xf50f,0x112));var _0xff50=function(_0x53da6b,_0x2ce125){_0x53da6b=_0x53da6b-0x0;var _0x309813=_0xf50f[_0x53da6b];return _0x309813;};'use strict';var _=require(_0xff50('0x0'));var util=require(_0xff50('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xff50('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xff50('0x3'));var rimraf=require(_0xff50('0x4'));var config=require('../../config/environment');var attributes=require(_0xff50('0x5'));module[_0xff50('0x6')]=function(_0x250636,_0x4701b1){return _0x250636['define']('CmCompany',attributes,{'tableName':_0xff50('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8ff1=['api','request-promise','path','rimraf','exports','CmCompany','cm_companies','../../config/logger'];(function(_0x8f0c8d,_0x5b6a2a){var _0x6c39a5=function(_0x189c6d){while(--_0x189c6d){_0x8f0c8d['push'](_0x8f0c8d['shift']());}};_0x6c39a5(++_0x5b6a2a);}(_0x8ff1,0x10f));var _0x18ff=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x8ff1[_0x172747];return _0x509692;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x18ff('0x0'))(_0x18ff('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x18ff('0x2'));var fs=require('fs');var path=require(_0x18ff('0x3'));var rimraf=require(_0x18ff('0x4'));var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module[_0x18ff('0x5')]=function(_0x298118,_0x5680ad){return _0x298118['define'](_0x18ff('0x6'),attributes,{'tableName':_0x18ff('0x7'),'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 edb540d..8fd7577 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 _0x3565=['jayson/promise','client','http','info','CmCompany,\x20%s,\x20%s','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3565,0x1af));var _0x5356=function(_0x32622d,_0x1ef3bd){_0x32622d=_0x32622d-0x0;var _0x29146a=_0x3565[_0x32622d];return _0x29146a;};'use strict';var _=require(_0x5356('0x0'));var util=require(_0x5356('0x1'));var moment=require(_0x5356('0x2'));var BPromise=require(_0x5356('0x3'));var rs=require(_0x5356('0x4'));var fs=require('fs');var Redis=require(_0x5356('0x5'));var db=require(_0x5356('0x6'))['db'];var utils=require(_0x5356('0x7'));var logger=require(_0x5356('0x8'))('rpc');var config=require(_0x5356('0x9'));var jayson=require(_0x5356('0xa'));var client=jayson[_0x5356('0xb')][_0x5356('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb32b50,_0x5c0770,_0x5a1761){return new BPromise(function(_0x13ba82,_0x3fb29e){return client['request'](_0xb32b50,_0x5a1761)['then'](function(_0xc3d93e){logger[_0x5356('0xd')](_0x5356('0xe'),_0x5c0770,'request\x20sent');logger['debug'](_0x5356('0xf'),_0x5c0770,_0x5356('0x10'),JSON['stringify'](_0xc3d93e));if(_0xc3d93e[_0x5356('0x11')]){if(_0xc3d93e['error'][_0x5356('0x12')]===0x1f4){logger[_0x5356('0x11')]('CmCompany,\x20%s,\x20%s',_0x5c0770,_0xc3d93e[_0x5356('0x11')]['message']);return _0x3fb29e(_0xc3d93e[_0x5356('0x11')]['message']);}logger[_0x5356('0x11')](_0x5356('0xe'),_0x5c0770,_0xc3d93e[_0x5356('0x11')][_0x5356('0x13')]);return _0x13ba82(_0xc3d93e[_0x5356('0x11')]['message']);}else{logger['info'](_0x5356('0xe'),_0x5c0770,_0x5356('0x10'));_0x13ba82(_0xc3d93e[_0x5356('0x14')][_0x5356('0x13')]);}})['catch'](function(_0x4ef6d5){logger[_0x5356('0x11')](_0x5356('0xe'),_0x5c0770,_0x4ef6d5);_0x3fb29e(_0x4ef6d5);});});}
\ No newline at end of file
+var _0x8ef9=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash'];(function(_0x40d11b,_0x217dc5){var _0x3c3e13=function(_0x12e823){while(--_0x12e823){_0x40d11b['push'](_0x40d11b['shift']());}};_0x3c3e13(++_0x217dc5);}(_0x8ef9,0xd7));var _0x98ef=function(_0x5db17b,_0x9e71b1){_0x5db17b=_0x5db17b-0x0;var _0xcc4a8d=_0x8ef9[_0x5db17b];return _0xcc4a8d;};'use strict';var _=require(_0x98ef('0x0'));var util=require(_0x98ef('0x1'));var moment=require(_0x98ef('0x2'));var BPromise=require(_0x98ef('0x3'));var rs=require(_0x98ef('0x4'));var fs=require('fs');var Redis=require(_0x98ef('0x5'));var db=require(_0x98ef('0x6'))['db'];var utils=require(_0x98ef('0x7'));var logger=require(_0x98ef('0x8'))(_0x98ef('0x9'));var config=require(_0x98ef('0xa'));var jayson=require(_0x98ef('0xb'));var client=jayson[_0x98ef('0xc')][_0x98ef('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4bec03,_0x568860,_0x4ad311){return new BPromise(function(_0x4eea2b,_0x3188d1){return client['request'](_0x4bec03,_0x4ad311)[_0x98ef('0xe')](function(_0x2280ec){logger[_0x98ef('0xf')](_0x98ef('0x10'),_0x568860,_0x98ef('0x11'));logger[_0x98ef('0x12')](_0x98ef('0x13'),_0x568860,_0x98ef('0x11'),JSON[_0x98ef('0x14')](_0x2280ec));if(_0x2280ec[_0x98ef('0x15')]){if(_0x2280ec['error']['code']===0x1f4){logger[_0x98ef('0x15')]('CmCompany,\x20%s,\x20%s',_0x568860,_0x2280ec[_0x98ef('0x15')][_0x98ef('0x16')]);return _0x3188d1(_0x2280ec[_0x98ef('0x15')][_0x98ef('0x16')]);}logger['error'](_0x98ef('0x10'),_0x568860,_0x2280ec[_0x98ef('0x15')]['message']);return _0x4eea2b(_0x2280ec['error'][_0x98ef('0x16')]);}else{logger[_0x98ef('0xf')](_0x98ef('0x10'),_0x568860,_0x98ef('0x11'));_0x4eea2b(_0x2280ec[_0x98ef('0x17')][_0x98ef('0x16')]);}})['catch'](function(_0x53d447){logger[_0x98ef('0x15')](_0x98ef('0x10'),_0x568860,_0x53d447);_0x3188d1(_0x53d447);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 2c00742..0e7fcaf 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 _0x3f49=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','/:id','isAuthenticated','/:id/contacts','post','addContacts','put','destroy'];(function(_0x2ca636,_0x4f4da1){var _0x168e73=function(_0x282200){while(--_0x282200){_0x2ca636['push'](_0x2ca636['shift']());}};_0x168e73(++_0x4f4da1);}(_0x3f49,0x1b9));var _0x93f4=function(_0x5534f0,_0x4841a1){_0x5534f0=_0x5534f0-0x0;var _0x5089dd=_0x3f49[_0x5534f0];return _0x5089dd;};'use strict';var multer=require(_0x93f4('0x0'));var util=require(_0x93f4('0x1'));var path=require(_0x93f4('0x2'));var timeout=require(_0x93f4('0x3'));var express=require('express');var router=express[_0x93f4('0x4')]();var fs_extra=require(_0x93f4('0x5'));var auth=require(_0x93f4('0x6'));var interaction=require(_0x93f4('0x7'));var config=require(_0x93f4('0x8'));var controller=require(_0x93f4('0x9'));router[_0x93f4('0xa')]('/',auth['isAuthenticated'](),controller[_0x93f4('0xb')]);router[_0x93f4('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x93f4('0xa')](_0x93f4('0xc'),auth[_0x93f4('0xd')](),controller['show']);router['get'](_0x93f4('0xe'),auth['isAuthenticated'](),controller['getContacts']);router[_0x93f4('0xf')]('/',auth[_0x93f4('0xd')](),controller['create']);router[_0x93f4('0xf')](_0x93f4('0xe'),auth[_0x93f4('0xd')](),controller[_0x93f4('0x10')]);router[_0x93f4('0x11')](_0x93f4('0xc'),auth[_0x93f4('0xd')](),controller['update']);router['delete']('/:id',auth[_0x93f4('0xd')](),controller[_0x93f4('0x12')]);module[_0x93f4('0x13')]=router;
\ No newline at end of file
+var _0xa195=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getContacts','/:id/contacts','addContacts','put','update','delete','exports','multer','util','path','express'];(function(_0x388914,_0x3c63f9){var _0x1f9111=function(_0x23dd69){while(--_0x23dd69){_0x388914['push'](_0x388914['shift']());}};_0x1f9111(++_0x3c63f9);}(_0xa195,0x13e));var _0x5a19=function(_0x5da106,_0x50b4c3){_0x5da106=_0x5da106-0x0;var _0x393e19=_0xa195[_0x5da106];return _0x393e19;};'use strict';var multer=require(_0x5a19('0x0'));var util=require(_0x5a19('0x1'));var path=require(_0x5a19('0x2'));var timeout=require('connect-timeout');var express=require(_0x5a19('0x3'));var router=express[_0x5a19('0x4')]();var fs_extra=require(_0x5a19('0x5'));var auth=require(_0x5a19('0x6'));var interaction=require(_0x5a19('0x7'));var config=require('../../config/environment');var controller=require(_0x5a19('0x8'));router[_0x5a19('0x9')]('/',auth[_0x5a19('0xa')](),controller[_0x5a19('0xb')]);router['get'](_0x5a19('0xc'),auth[_0x5a19('0xa')](),controller[_0x5a19('0xd')]);router[_0x5a19('0x9')](_0x5a19('0xe'),auth[_0x5a19('0xa')](),controller[_0x5a19('0xf')]);router[_0x5a19('0x9')]('/:id/contacts',auth[_0x5a19('0xa')](),controller[_0x5a19('0x10')]);router['post']('/',auth[_0x5a19('0xa')](),controller['create']);router['post'](_0x5a19('0x11'),auth['isAuthenticated'](),controller[_0x5a19('0x12')]);router[_0x5a19('0x13')](_0x5a19('0xe'),auth[_0x5a19('0xa')](),controller[_0x5a19('0x14')]);router[_0x5a19('0x15')]('/:id',auth[_0x5a19('0xa')](),controller['destroy']);module[_0x5a19('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index edad918..5a3295a 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 _0x5c48=['exports','STRING','INTEGER','UNSIGNED','NOW'];(function(_0x4b4d43,_0x1590f7){var _0x5706ba=function(_0x11d99b){while(--_0x11d99b){_0x4b4d43['push'](_0x4b4d43['shift']());}};_0x5706ba(++_0x1590f7);}(_0x5c48,0x1c7));var _0x85c4=function(_0x59055e,_0x5add8f){_0x59055e=_0x59055e-0x0;var _0xd6174b=_0x5c48[_0x59055e];return _0xd6174b;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0x85c4('0x0')]={'firstName':{'type':Sequelize[_0x85c4('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0x85c4('0x1')]},'street':{'type':Sequelize[_0x85c4('0x1')]},'postalCode':{'type':Sequelize[_0x85c4('0x1')]},'city':{'type':Sequelize[_0x85c4('0x1')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x85c4('0x1')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x85c4('0x1')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x85c4('0x1')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x85c4('0x1')]},'skype':{'type':Sequelize[_0x85c4('0x1')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x85c4('0x1')]},'wechat':{'type':Sequelize[_0x85c4('0x1')]},'telegram':{'type':Sequelize[_0x85c4('0x1')]},'UserId':{'type':Sequelize[_0x85c4('0x2')]},'AdditionalPhones':{'type':Sequelize[_0x85c4('0x1')]},'priority':{'type':Sequelize[_0x85c4('0x2')](0x2)[_0x85c4('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x85c4('0x4')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x85c4('0x2')]}};
\ No newline at end of file
+var _0xfc4c=['INTEGER','lodash','sequelize','exports','STRING','UNSIGNED','NOW'];(function(_0x4fce48,_0x188ce1){var _0x2609c4=function(_0xb5a412){while(--_0xb5a412){_0x4fce48['push'](_0x4fce48['shift']());}};_0x2609c4(++_0x188ce1);}(_0xfc4c,0x104));var _0xcfc4=function(_0xcf97b,_0x27ee21){_0xcf97b=_0xcf97b-0x0;var _0x39bcdd=_0xfc4c[_0xcf97b];return _0x39bcdd;};'use strict';var _=require(_0xcfc4('0x0'));var Sequelize=require(_0xcfc4('0x1'));module[_0xcfc4('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xcfc4('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xcfc4('0x3')]},'country':{'type':Sequelize[_0xcfc4('0x3')]},'dateOfBirth':{'type':Sequelize[_0xcfc4('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xcfc4('0x3')]},'mobile':{'type':Sequelize[_0xcfc4('0x3')]},'fax':{'type':Sequelize[_0xcfc4('0x3')]},'email':{'type':Sequelize[_0xcfc4('0x3')]},'url':{'type':Sequelize[_0xcfc4('0x3')]},'facebook':{'type':Sequelize[_0xcfc4('0x3')]},'fb_data':{'type':Sequelize[_0xcfc4('0x3')]},'twitter':{'type':Sequelize[_0xcfc4('0x3')]},'skype':{'type':Sequelize[_0xcfc4('0x3')]},'teams':{'type':Sequelize[_0xcfc4('0x3')]},'viber':{'type':Sequelize[_0xcfc4('0x3')]},'line':{'type':Sequelize[_0xcfc4('0x3')]},'wechat':{'type':Sequelize[_0xcfc4('0x3')]},'telegram':{'type':Sequelize[_0xcfc4('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xcfc4('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xcfc4('0x5')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0xcfc4('0x6')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 36def5b..dc3fc08 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 _0xbfcb=['fields','order','filter','include','rows','getHopperHistories','rawAttributes','ContactId','count','CmHopperFinal','pick','includeAll','getJscriptySessions','nolimit','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','split','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','server/files/tmp','file','0777','child_process','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','import','User','agent','No\x20ListId\x20specified','binding','fork','stringify','start\x20child\x20process\x20correctly!','exit','importUpdates','../../components/import/cm/csvUpdates','message','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','toLowerCase','Invalid\x20channel','channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','source','destination','callerid','starttime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','VoiceCallReport','findAndCountAll','startCase','Website','closed','closedAt','disposition','thirdDisposition','Account','key','Owner','browserName','customerPort','deviceModel','ratingMessage','ratingType','ratingValue','referer','subject','threadId','Interaction','flatten','sortBy','reverse','value','slice','moment','bluebird','util','path','lodash','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','redis','socket.io-emitter','./cmContact.socket','status','json','offset','undefined','limit','set','Content-Range','update','destroy','sendStatus','stack','name','send','describe','then','findAll','query','user','catch','CmContact','find','params','tags','keys','cf_','columnName','analytics','CmCustomField','displayName','alias','custom','type','values','info','forEach','hasOwnProperty','merge','body','from','get','mergeWith','isArray','length','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','ChatOfflineMessage','MailMessage','MailInteraction','SmsMessage','FaxInteraction','FaxMessage','CmContactHasItem','CmHopperHistory','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','create','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','push','ListId','spread','contact','all','show','Tags','color','tag','Phones','ItemType','literal','Phones.OrderBy','$and','omit','map','format','cf_%d','startsWith','isEmpty','table','id\x20=\x20?','sequelize','text','phone','findOne','model','Tag','filters','intersection','attributes','sort','options','getTags','setTags','ids','setAdditionalPhones','ContactItemType','OrderBy','items','item_types','description','ItemTypeId','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','PHONE','CmHopperId','ItemType.OrderBy','getAdditionalPhones','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','getHoppers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbfcb,0x69));var _0xbbfc=function(_0x19707a,_0x46a4b1){_0x19707a=_0x19707a-0x0;var _0xa0f2b6=_0xbfcb[_0x19707a];return _0xa0f2b6;};'use strict';var moment=require(_0xbbfc('0x0'));var BPromise=require(_0xbbfc('0x1'));var util=require(_0xbbfc('0x2'));var path=require(_0xbbfc('0x3'));var fs=require('fs');var _=require(_0xbbfc('0x4'));var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0xbbfc('0x5'));var contacts=require(_0xbbfc('0x6'));var qs=require(_0xbbfc('0x7'));var logger=require(_0xbbfc('0x8'))(_0xbbfc('0x9'));var config=require(_0xbbfc('0xa'));var shared=require(_0xbbfc('0xb'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xbbfc('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xbbfc('0xd'))(new Redis(config['redis']));require(_0xbbfc('0xe'))['register'](socket);function respondWithResult(_0xdefebe,_0x46d591){_0x46d591=_0x46d591||0xc8;return function(_0x51c904){if(_0x51c904){return _0xdefebe[_0xbbfc('0xf')](_0x46d591)[_0xbbfc('0x10')](_0x51c904);}};}function respondWithFilteredResult(_0x417336,_0x434385){return function(_0xabf66e){if(_0xabf66e){var _0xf1685a=typeof _0x434385[_0xbbfc('0x11')]===_0xbbfc('0x12')&&typeof _0x434385[_0xbbfc('0x13')]===_0xbbfc('0x12');var _0x14988c=_0xabf66e['count'];var _0x5d1f90=_0xf1685a?0x0:_0x434385[_0xbbfc('0x11')];var _0x48fc76=_0xf1685a?_0xabf66e['count']:_0x434385[_0xbbfc('0x11')]+_0x434385['limit'];var _0xec846e;if(_0x48fc76>=_0x14988c){_0x48fc76=_0x14988c;_0xec846e=0xc8;}else{_0xec846e=0xce;}_0x417336['status'](_0xec846e);return _0x417336[_0xbbfc('0x14')](_0xbbfc('0x15'),_0x5d1f90+'-'+_0x48fc76+'/'+_0x14988c)[_0xbbfc('0x10')](_0xabf66e);}return null;};}function saveUpdates(_0x5a29c6){return function(_0x3ec825){if(_0x3ec825){return _0x3ec825[_0xbbfc('0x16')](_0x5a29c6)['then'](function(_0x4a5840){return _0x4a5840;});}return null;};}function removeEntity(_0x1342e6){return function(_0x280c4b){if(_0x280c4b){return _0x280c4b[_0xbbfc('0x17')]()['then'](function(){_0x1342e6[_0xbbfc('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a217b){return function(_0x29bc50){if(!_0x29bc50){_0x1a217b[_0xbbfc('0x18')](0x194);}return _0x29bc50;};}function handleError(_0x25c0cf,_0x4e9f06){_0x4e9f06=_0x4e9f06||0x1f4;return function(_0x2fed4a){logger['error'](_0x2fed4a[_0xbbfc('0x19')]);if(_0x2fed4a[_0xbbfc('0x1a')]){delete _0x2fed4a[_0xbbfc('0x1a')];}_0x25c0cf[_0xbbfc('0xf')](_0x4e9f06)[_0xbbfc('0x1b')](_0x2fed4a);};}exports['index']=function(_0x42242c,_0x521441){var _0x3a5521={};return contacts[_0xbbfc('0x1c')]()[_0xbbfc('0x1d')](function(_0x197a23){_0x3a5521=qs['getOptions'](_0x197a23,_0x42242c);return contacts[_0xbbfc('0x1e')](_0x42242c[_0xbbfc('0x1f')],_0x42242c[_0xbbfc('0x20')],_0x3a5521,_0x197a23);})[_0xbbfc('0x1d')](respondWithFilteredResult(_0x521441,_0x3a5521))[_0xbbfc('0x21')](handleError(_0x521441,null));};exports[_0xbbfc('0x17')]=function(_0x96d435,_0x5e888f){return db[_0xbbfc('0x22')][_0xbbfc('0x23')]({'where':{'id':_0x96d435[_0xbbfc('0x24')]['id']}})['then'](handleEntityNotFound(_0x5e888f,null))[_0xbbfc('0x1d')](removeEntity(_0x5e888f,null))[_0xbbfc('0x21')](handleError(_0x5e888f,null));};exports[_0xbbfc('0x1c')]=function(_0x512aae,_0x10010f){return db[_0xbbfc('0x22')][_0xbbfc('0x1c')]()[_0xbbfc('0x1d')](function(_0x35365b){delete _0x35365b[_0xbbfc('0x25')];for(var _0x2d2da3=0x0;_0x2d2da3
','generateXOAuth2Token','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','path','util','../../../config/logger','../../../config/environment','head','value','address','anonymous','generate','name','substring','indexOf','split','length','slice','join','Anonymous','pop','test','html','includes','attachments'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xfb83,0x78));var _0x3fb8=function(_0x259d17,_0x220710){_0x259d17=_0x259d17-0x0;var _0x407535=_0xfb83[_0x259d17];return _0x407535;};'use strict';var _=require(_0x3fb8('0x0'));var moment=require(_0x3fb8('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x3fb8('0x2'));var util=require(_0x3fb8('0x3'));var tnef=require('node-tnef');var logger=require(_0x3fb8('0x4'))('email');var config=require(_0x3fb8('0x5'));function getAddress(_0x37fc9a){var _0x3cadad=_[_0x3fb8('0x6')](_0x37fc9a[_0x3fb8('0x7')]);return _0x3cadad&&_0x3cadad[_0x3fb8('0x8')]?_0x3cadad[_0x3fb8('0x8')]:_0x3fb8('0x9')+random[_0x3fb8('0xa')](0x6)+'@xcally.com';}function getFirstName(_0x9e3fc6){var _0x59d9de=_[_0x3fb8('0x6')](_0x9e3fc6[_0x3fb8('0x7')]);if(_0x59d9de&&_0x59d9de[_0x3fb8('0xb')]){if(_0x59d9de[_0x3fb8('0xb')]==_0x59d9de[_0x3fb8('0x8')]){return _0x59d9de[_0x3fb8('0xb')][_0x3fb8('0xc')](0x0,_0x59d9de[_0x3fb8('0xb')][_0x3fb8('0xd')]('@'));}var _0x26ed8f=_0x59d9de[_0x3fb8('0xb')][_0x3fb8('0xe')](/\s+/);return _0x26ed8f[_0x3fb8('0xf')]>0x1?_0x26ed8f[_0x3fb8('0x10')](0x0,-0x1)[_0x3fb8('0x11')]('\x20'):_0x59d9de[_0x3fb8('0xb')];}return _0x3fb8('0x12');}function getLastName(_0x303432){var _0x5782d6=_[_0x3fb8('0x6')](_0x303432['value']);if(_0x5782d6&&_0x5782d6['name']){var _0x267c69=_0x5782d6[_0x3fb8('0xb')][_0x3fb8('0xe')](/\s+/);return _0x267c69[_0x3fb8('0xf')]>0x1?_0x267c69[_0x3fb8('0x13')]():'';}return'';}function getMails(_0x4b84f3,_0x6b0c85){var _0x5ae8cb='';for(var _0xaa6923=0x0;_0xaa6923<_0x6b0c85[_0x3fb8('0x7')]['length'];_0xaa6923+=0x1){if(_0x6b0c85[_0x3fb8('0x7')][_0xaa6923][_0x3fb8('0x8')]!==_0x4b84f3){if(!_['isEmpty'](_0x5ae8cb)){_0x5ae8cb+=',';}_0x5ae8cb+=_0x6b0c85[_0x3fb8('0x7')][_0xaa6923][_0x3fb8('0xb')]||_0x6b0c85[_0x3fb8('0x7')][_0xaa6923]['address']||'';_0x5ae8cb+='\x20<';_0x5ae8cb+=_0x6b0c85[_0x3fb8('0x7')][_0xaa6923][_0x3fb8('0x8')]?_0x6b0c85[_0x3fb8('0x7')][_0xaa6923]['address']:'anonymous'+random[_0x3fb8('0xa')](0x6)+'@xcally.com';_0x5ae8cb+='>';}}return _0x5ae8cb;}function parseEmail(_0x74b970,_0x4bdbe2,_0x533b59){if(_0x4bdbe2['html']){var _0x317cee=/